diff --git a/CMakeLists.txt b/CMakeLists.txt index 47a1496..a54a865 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,5 @@ project(fdb_c C CXX ASM) +cmake_minimum_required(VERSION 3.27) function(glob_flow_source VAR_NAME) file(GLOB SOURCE_FILES *.c *.cpp *.h) @@ -13,17 +14,21 @@ function(glob_flow_source VAR_NAME) set(${VAR_NAME} "${${VAR_NAME}}" PARENT_SCOPE) endfunction() -find_package(Boost REQUIRED) +find_package(Boost REQUIRED COMPONENTS filesystem) find_package(fmt CONFIG REQUIRED) find_package(msgpack-cxx CONFIG REQUIRED) find_package(OpenSSL REQUIRED) find_package(absl CONFIG REQUIRED) +find_package(RapidJSON CONFIG REQUIRED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_CXX_STANDARD 20) add_compile_definitions(NO_INTELLISENSE) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src) + +add_subdirectory(src/contrib/SimpleOpt) +add_subdirectory(src/contrib/crc32) +add_subdirectory(src/contrib/libb64) add_subdirectory(src/flow) add_subdirectory(src/fdbrpc) add_subdirectory(src/fdbclient) diff --git a/examples/basic_rw.cpp b/examples/basic_rw.cpp index 8adeffc..ecd9572 100644 --- a/examples/basic_rw.cpp +++ b/examples/basic_rw.cpp @@ -47,7 +47,7 @@ void wait(std::shared_ptr future) { int main() { using namespace std::chrono_literals; - assert_fdb_error(fdb_select_api_version(FDB_API_VERSION)); + assert_fdb_error(fdb_select_api_version(710)); // Start network assert_fdb_error(fdb_setup_network()); diff --git a/extractor/Dockerfile b/extractor/Dockerfile index 561d931..013268c 100644 --- a/extractor/Dockerfile +++ b/extractor/Dockerfile @@ -43,5 +43,22 @@ RUN apt-get update \ --yes --no-install-recommends \ && rm -rf /var/lib/apt/lists/* +# Install latest cmake +ENV CMAKE_VERSION 3.26.3 +ENV CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v3.27.0-rc4/cmake-3.27.0-rc4-linux-x86_64.sh +RUN wget -O /tmp/cmake-installer "$CMAKE_URL" \ + && chmod +x /tmp/cmake-installer \ + && /tmp/cmake-installer --prefix=/usr/local --skip-license \ + && rm /tmp/cmake-installer + +# Install build depends +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update \ + && apt-get install \ + liblz4-dev \ + python3-sphinx \ + --yes --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + ENV CC=clang-15 ENV CXX=clang++-15 \ No newline at end of file diff --git a/extractor/Makefile b/extractor/Makefile index 7edeb1c..69f813b 100644 --- a/extractor/Makefile +++ b/extractor/Makefile @@ -5,8 +5,7 @@ OUTPUT_DIR_REAL = $(realpath $(OUTPUT_DIR)) BUILDER_DOCKER_FLAGS = \ -u $(shell id -u):$(shell id -g) \ - -v "$(CURDIR)/$(EXTRACT_WORKDIR):$(CURDIR)/$(EXTRACT_WORKDIR)" \ - -e FOUNDATIONDB_TAG="7.1.41" + -v "$(CURDIR)/$(EXTRACT_WORKDIR):$(CURDIR)/$(EXTRACT_WORKDIR)" .PHONY: all docker-image extract build-tests clean diff --git a/extractor/workdir/cmake/fdbclient.cmake b/extractor/workdir/cmake/fdbclient.cmake index 4bc0ab2..229eb78 100644 --- a/extractor/workdir/cmake/fdbclient.cmake +++ b/extractor/workdir/cmake/fdbclient.cmake @@ -3,6 +3,7 @@ glob_flow_source(FDBCLIENT_SRC) list(APPEND FDBCLIENT_SRC sha1/SHA1.cpp) add_library(fdbclient STATIC ${FDBCLIENT_SRC}) +target_include_directories(fdbclient PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) target_link_libraries(fdbclient PRIVATE fdbrpc diff --git a/extractor/workdir/cmake/fdbrpc.cmake b/extractor/workdir/cmake/fdbrpc.cmake index 35c6c6d..6aac44d 100644 --- a/extractor/workdir/cmake/fdbrpc.cmake +++ b/extractor/workdir/cmake/fdbrpc.cmake @@ -4,12 +4,14 @@ add_library(fdbrpc STATIC ${FDBRPC_SRC}) target_link_libraries(fdbrpc PRIVATE flow + rapidjson + crc32 + libb64 ) - -add_library(fdbb64 STATIC libb64/cdecode.c libb64/cencode.c) -target_link_libraries(fdbrpc PRIVATE fdbb64) +target_include_directories(fdbrpc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) add_library(fdbeio STATIC libeio/eio.c) +target_include_directories(fdbeio PUBLIC libeio/) target_compile_definitions(fdbeio PRIVATE USE_UCONTEXT) target_compile_options(fdbeio BEFORE PRIVATE -w) # disable warnings for eio target_link_libraries(fdbrpc PRIVATE fdbeio) diff --git a/extractor/workdir/cmake/flow.cmake b/extractor/workdir/cmake/flow.cmake index c1d7615..c893efe 100644 --- a/extractor/workdir/cmake/flow.cmake +++ b/extractor/workdir/cmake/flow.cmake @@ -4,9 +4,15 @@ add_library(flow STATIC ${FLOW_SRC}) target_link_libraries(flow PRIVATE Boost::headers + Boost::filesystem fmt::fmt absl::debugging OpenSSL::SSL OpenSSL::Crypto + crc32 + SimpleOpt ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) \ No newline at end of file +target_include_directories(flow PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include) + +make_directory(${CMAKE_CURRENT_BINARY_DIR}/include/flow) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/include/flow/config.h) \ No newline at end of file diff --git a/extractor/workdir/extract.sh b/extractor/workdir/extract.sh index eb8765b..f04d422 100755 --- a/extractor/workdir/extract.sh +++ b/extractor/workdir/extract.sh @@ -1,6 +1,6 @@ #! /bin/bash -set -ex +set -exu OUTPUT_DIR="$1" [ -d "$OUTPUT_DIR" ] || exit 1 @@ -24,28 +24,53 @@ function convert_fdb_source() { rm -rf "${OUTPUT_DIR}/${_subdir}" mkdir -p "${OUTPUT_DIR}/${_subdir}" - for path in "${FOUNDATIONDB_REPO}/${_subdir}/"*; do + find "${FOUNDATIONDB_REPO}/${_subdir}/" -type f -print0 | + while IFS= read -r -d '' path; do + dir="$(realpath --relative-to="${FOUNDATIONDB_REPO}/${_subdir}" "$(dirname "$path")")/" + [ "$dir" = "./" ] && dir= file="$(basename "$path")" - if [[ " ${_skip_source[@]} " =~ " $file " ]]; then - echo "Skip $file" - elif [[ " ${_copy_source[@]} " =~ " $file " ]]; then - cp "$path" "${OUTPUT_DIR}/${_subdir}/${file}" + + skip=N + copy=N + + parent_dir="${dir}${file}" + while [ "$parent_dir" != "." ]; do + if [[ " ${_skip_source[@]} " =~ " $parent_dir " ]]; then + skip=Y + break; + fi + parent_dir="$(dirname "$parent_dir")" + done + + if [ "$skip" = "Y" ]; then + echo "Skip $dir$file" + elif [[ " ${_copy_source[@]} " =~ " $dir$file " ]]; then + copy=Y elif [[ "$file" =~ ^(.*)\.(h|cpp)$ ]]; then - _target="${OUTPUT_DIR}/${_subdir}/${file}" + _target="${OUTPUT_DIR}/${_subdir}/${dir}${file}" + + mkdir -p "$(dirname "$_target")" sed "$path" \ -e 's|contrib/fmt-8.1.1/include/||' \ - -e 's|flow/stacktrace.h|absl/debugging/stacktrace.h|' \ - -e 's|fdbrpc/md5/md5.h|openssl/md5.h|;' \ + -e 's|stacktrace/stacktrace.h|absl/debugging/stacktrace.h|' \ + -e 's|md5/md5.h|openssl/md5.h|;' \ > "$_target" if [[ "$file" =~ ^(.*)\.actor\.(h|cpp)$ ]]; then - _actor_target="${OUTPUT_DIR}/${_subdir}/${BASH_REMATCH[1]}.actor.g.${BASH_REMATCH[2]}" + _actor_target="${OUTPUT_DIR}/${_subdir}/${dir}${BASH_REMATCH[1]}.actor.g.${BASH_REMATCH[2]}" $ACTORCOMPILER "$_target" "$_actor_target" --generate-probes fi elif [[ "$file" =~ ^(.*).h.cmake$ ]]; then - cp "$FOUNDATIONDB_BUILDDIR/${_subdir}/${BASH_REMATCH[1]}.h" "${OUTPUT_DIR}/${_subdir}/${BASH_REMATCH[1]}.h" + _incdir="${OUTPUT_DIR}/${_subdir}/include/${_subdir}" + mkdir -p "$_incdir" + cp "$FOUNDATIONDB_BUILDDIR/${_subdir}/include/${_subdir}/${BASH_REMATCH[1]}.h" "${_incdir}/${BASH_REMATCH[1]}.h" else - cp -R "$path" "${OUTPUT_DIR}/${_subdir}/${file}" + copy=Y + fi + + if [ "$copy" = "Y" ]; then + mkdir -p "${OUTPUT_DIR}/${_subdir}/${dir}" + cp "$path" "${OUTPUT_DIR}/${_subdir}/${dir}${file}" fi done cp "${WORKDIR}/cmake/${_subdir}.cmake" "${OUTPUT_DIR}/${_subdir}/CMakeLists.txt" @@ -59,9 +84,7 @@ _skip_source=( coveragetool actorcompiler no_intellisense.opt - stacktrace_internal - stacktrace.amalgamation.cpp - stacktrace.h + ApiVersions.cmake ) _copy_source=( config.h.cmake @@ -74,19 +97,20 @@ _skip_source=( CMakeLists.txt README.md actorFuzz.py + tests + + TokenSign # Depends libcoroutine # use boost coro impl - md5 # use openssl impl - # libb64 # libeio ) _copy_source=() convert_fdb_source # fdbrpc requires fdbserver/Knobs.h -mkdir "${OUTPUT_DIR}/fdbserver" -cp "${FOUNDATIONDB_REPO}/fdbserver/Knobs.h" "${OUTPUT_DIR}/fdbserver/Knobs.h" +mkdir -p "${OUTPUT_DIR}/fdbserver/include/fdbserver" +cp "${FOUNDATIONDB_REPO}/fdbserver/include/fdbserver/Knobs.h" "${OUTPUT_DIR}/fdbserver/include/fdbserver/Knobs.h" # fdbclient _subdir=fdbclient @@ -96,14 +120,8 @@ _skip_source=( azurestorage.cmake vexillographer - # Depends - rapidxml # required by s3 - rapidjson # required by unit test - # json_spirit - # sha1 - # Disable AZURE - BackupContainerAzureBlobStore.actor.cpp + azure_backup # Disable S3 S3BlobStore.actor.cpp @@ -111,11 +129,17 @@ _skip_source=( _copy_source=() convert_fdb_source $VEXILLOGRAPHER "${FOUNDATIONDB_REPO}/fdbclient/vexillographer/fdb.options" cpp "${OUTPUT_DIR}/fdbclient/FDBOptions.g" +mv "${OUTPUT_DIR}"/fdbclient{,/include/fdbclient}/FDBOptions.g.h +$VEXILLOGRAPHER "${FOUNDATIONDB_REPO}/fdbclient/vexillographer/fdb.options" c "${OUTPUT_DIR}/fdbclient/include/fdbclient/fdb_c_options.g.h" # bindings/c mkdir -p "${OUTPUT_DIR}/bindings/c" cp "${FOUNDATIONDB_REPO}/bindings/c/fdb_c.cpp" "${OUTPUT_DIR}/bindings/c/fdb_c.cpp" cp -r "${FOUNDATIONDB_REPO}/bindings/c/foundationdb" "${OUTPUT_DIR}/bindings/c/foundationdb" + +rm "${OUTPUT_DIR}/bindings/c/foundationdb/fdb_c_apiversion.h.cmake" +cp {"${FOUNDATIONDB_BUILDDIR}","${OUTPUT_DIR}"}/bindings/c/foundationdb/fdb_c_apiversion.g.h + $VEXILLOGRAPHER "${FOUNDATIONDB_REPO}/fdbclient/vexillographer/fdb.options" c "${OUTPUT_DIR}/bindings/c/foundationdb/fdb_c_options.g.h" function generate_fdb_c_asm() { _os="${1}" @@ -134,3 +158,8 @@ generate_fdb_c_asm linux aarch64 generate_fdb_c_asm osx aarch64 cp "${WORKDIR}/cmake/fdb_c.cmake" "${OUTPUT_DIR}/bindings/c/CMakeLists.txt" +mkdir "${OUTPUT_DIR}/contrib" +for dep in crc32 SimpleOpt libb64 +do + cp -R "${FOUNDATIONDB_REPO}/contrib/${dep}" "${OUTPUT_DIR}/contrib/${dep}" +done diff --git a/extractor/workdir/patches/fix-fmt-cxx20.patch b/extractor/workdir/patches/fix-fmt-cxx20.patch new file mode 100644 index 0000000..4e43823 --- /dev/null +++ b/extractor/workdir/patches/fix-fmt-cxx20.patch @@ -0,0 +1,36 @@ +diff --git a/flow/TLSTest.cpp b/flow/TLSTest.cpp +index ebbbdacd3..d988dd899 100644 +--- a/flow/TLSTest.cpp ++++ b/flow/TLSTest.cpp +@@ -31,25 +31,25 @@ + std::FILE* outp = stdout; + + template +-void log(Args&&... args) { ++void log(fmt::format_string fmt, Args&&... args) { + auto buf = fmt::memory_buffer{}; +- fmt::format_to(std::back_inserter(buf), std::forward(args)...); ++ fmt::format_to(std::back_inserter(buf), fmt, std::forward(args)...); + fmt::print(outp, "{}\n", std::string_view(buf.data(), buf.size())); + } + + template +-void logc(Args&&... args) { ++void logc(fmt::format_string fmt, Args&&... args) { + auto buf = fmt::memory_buffer{}; + fmt::format_to(std::back_inserter(buf), "[CLIENT] "); +- fmt::format_to(std::back_inserter(buf), std::forward(args)...); ++ fmt::format_to(std::back_inserter(buf), fmt, std::forward(args)...); + fmt::print(outp, "{}\n", std::string_view(buf.data(), buf.size())); + } + + template +-void logs(Args&&... args) { ++void logs(fmt::format_string fmt, Args&&... args) { + auto buf = fmt::memory_buffer{}; + fmt::format_to(std::back_inserter(buf), "[SERVER] "); +- fmt::format_to(std::back_inserter(buf), std::forward(args)...); ++ fmt::format_to(std::back_inserter(buf), fmt, std::forward(args)...); + fmt::print(outp, "{}\n", std::string_view(buf.data(), buf.size())); + } + diff --git a/extractor/workdir/prepare-build.sh b/extractor/workdir/prepare-build.sh index 2306aad..098f4e5 100755 --- a/extractor/workdir/prepare-build.sh +++ b/extractor/workdir/prepare-build.sh @@ -5,7 +5,7 @@ set -ex WORKDIR="$(realpath "$(dirname "$0")")" FOUNDATIONDB_GIT=https://github.com/apple/foundationdb.git -FOUNDATIONDB_TAG=${FOUNDATIONDB_TAG:?FOUNDATIONDB_TAG is required} +FOUNDATIONDB_TAG=7.3.25 FOUNDATIONDB_REPO=${FOUNDATIONDB_REPO:?FOUNDATIONDB_REPO is required} FOUNDATIONDB_BUILDDIR=${FOUNDATIONDB_BUILDDIR:?FOUNDATIONDB_BUILDDIR is required} @@ -21,11 +21,11 @@ git reset HEAD --hard git clean -dffx # Apply patchs -for patch in fix-fmt-format.patch build-c-binding-only.patch backport-doctest.patch +for patch in fix-fmt-cxx20.patch # build-c-binding-only.patch fix-fmt-format.patch backport-doctest.patch do git apply "${WORKDIR}/patches/${patch}" done # Configure build # rm -rf "${FOUNDATIONDB_BUILDDIR}" -cmake -B "${FOUNDATIONDB_BUILDDIR}" -DCMAKE_BUILD_TYPE=Debug -G Ninja "${FOUNDATIONDB_REPO}" +cmake -B "${FOUNDATIONDB_BUILDDIR}" -DCMAKE_BUILD_TYPE=Debug -DUSE_JEMALLOC=OFF -G Ninja "${FOUNDATIONDB_REPO}" diff --git a/src/bindings/c/fdb_c.cpp b/src/bindings/c/fdb_c.cpp index 32496f2..87e3ccb 100644 --- a/src/bindings/c/fdb_c.cpp +++ b/src/bindings/c/fdb_c.cpp @@ -18,10 +18,12 @@ * limitations under the License. */ +#include "fdbclient/BlobGranuleCommon.h" +#include "fdbclient/BlobGranuleFiles.h" #include "fdbclient/FDBTypes.h" #include "flow/ProtocolVersion.h" #include -#define FDB_API_VERSION 710 +#define FDB_USE_LATEST_API_VERSION #define FDB_INCLUDE_LEGACY_TYPES #include "fdbclient/MultiVersionTransaction.h" @@ -61,6 +63,11 @@ int g_api_version = 0; /* This must be true so that we can return the data pointer of a Standalone as an array of FDBKeyValue. */ static_assert(sizeof(FDBKeyValue) == sizeof(KeyValueRef), "FDBKeyValue / KeyValueRef size mismatch"); +static_assert(sizeof(FDBBGMutation) == sizeof(GranuleMutationRef), "FDBBGMutation / GranuleMutationRef size mismatch"); +static_assert(static_cast(FDB_BG_MUTATION_TYPE_SET_VALUE) == static_cast(MutationRef::Type::SetValue), + "FDB_BG_MUTATION_TYPE_SET_VALUE enum value mismatch"); +static_assert(static_cast(FDB_BG_MUTATION_TYPE_CLEAR_RANGE) == static_cast(MutationRef::Type::ClearRange), + "FDB_BG_MUTATION_TYPE_CLEAR_RANGE enum value mismatch"); #define TSAV_ERROR(type, error) ((FDBFuture*)(ThreadFuture(error())).extractPtr()) @@ -79,9 +86,10 @@ extern "C" DLLEXPORT fdb_bool_t fdb_error_predicate(int predicate_test, fdb_erro if (predicate_test == FDBErrorPredicates::RETRYABLE_NOT_COMMITTED) { return code == error_code_not_committed || code == error_code_transaction_too_old || code == error_code_future_version || code == error_code_database_locked || - code == error_code_proxy_memory_limit_exceeded || code == error_code_batch_transaction_throttled || - code == error_code_process_behind || code == error_code_tag_throttled || - code == error_code_unknown_tenant; + code == error_code_grv_proxy_memory_limit_exceeded || + code == error_code_commit_proxy_memory_limit_exceeded || + code == error_code_batch_transaction_throttled || code == error_code_process_behind || + code == error_code_tag_throttled || code == error_code_proxy_tag_throttled; } return false; } @@ -238,6 +246,10 @@ fdb_error_t fdb_future_get_version_v619(FDBFuture* f, int64_t* out_version) { CATCH_AND_RETURN(*out_version = TSAV(Version, f)->get();); } +extern "C" DLLEXPORT fdb_error_t fdb_future_get_bool(FDBFuture* f, fdb_bool_t* out_value) { + CATCH_AND_RETURN(*out_value = TSAV(bool, f)->get();); +} + extern "C" DLLEXPORT fdb_error_t fdb_future_get_int64(FDBFuture* f, int64_t* out_value) { CATCH_AND_RETURN(*out_value = TSAV(int64_t, f)->get();); } @@ -246,6 +258,10 @@ extern "C" DLLEXPORT fdb_error_t fdb_future_get_uint64(FDBFuture* f, uint64_t* o CATCH_AND_RETURN(*out = TSAV(uint64_t, f)->get();); } +extern "C" DLLEXPORT fdb_error_t fdb_future_get_double(FDBFuture* f, double* out) { + CATCH_AND_RETURN(*out = TSAV(double, f)->get();); +} + extern "C" DLLEXPORT fdb_error_t fdb_future_get_key(FDBFuture* f, uint8_t const** out_key, int* out_key_length) { CATCH_AND_RETURN(KeyRef key = TSAV(Key, f)->get(); *out_key = key.begin(); *out_key_length = key.size();); } @@ -319,6 +335,203 @@ extern "C" DLLEXPORT fdb_error_t fdb_future_get_key_array(FDBFuture* f, FDBKey c *out_count = na.size();); } +extern "C" DLLEXPORT fdb_error_t fdb_future_get_granule_summary_array(FDBFuture* f, + FDBGranuleSummary const** out_ranges, + int* out_count) { + CATCH_AND_RETURN(Standalone> na = + TSAV(Standalone>, f)->get(); + *out_ranges = (FDBGranuleSummary*)na.begin(); + *out_count = na.size();); +} + +namespace { + +void parseGetTenant(Optional& dest, FDBBGTenantPrefix const* source) { + if (source->present) { + dest = StringRef(source->prefix.key, source->prefix.key_length); + } +} + +void parseGetEncryptionKey(BlobGranuleCipherKey& dest, FDBBGEncryptionKey const* source) { + dest.encryptDomainId = source->domain_id; + dest.baseCipherId = source->base_key_id; + dest.baseCipherKCV = source->base_kcv; + dest.salt = source->random_salt; + dest.baseCipher = StringRef(source->base_key.key, source->base_key.key_length); +} + +void parseGetEncryptionKeyCtx(Optional& dest, FDBBGEncryptionCtx const* source) { + if (source->present) { + dest = BlobGranuleCipherKeysCtx(); + parseGetEncryptionKey(dest.get().textCipherKey, &source->textKey); + parseGetEncryptionKey(dest.get().headerCipherKey, &source->headerKey); + dest.get().ivRef = StringRef(source->iv.key, source->iv.key_length); + } +} + +void setEncryptionKey(FDBBGEncryptionKey* dest, const BlobGranuleCipherKey& source) { + dest->domain_id = source.encryptDomainId; + dest->base_key_id = source.baseCipherId; + dest->base_kcv = source.baseCipherKCV; + dest->random_salt = source.salt; + dest->base_key.key = source.baseCipher.begin(); + dest->base_key.key_length = source.baseCipher.size(); +} + +void setEncryptionKeyCtx(FDBBGEncryptionCtx* dest, const BlobGranuleCipherKeysCtx& source) { + dest->present = true; + setEncryptionKey(&dest->textKey, source.textCipherKey); + dest->textKCV = source.textCipherKey.baseCipherKCV; + setEncryptionKey(&dest->headerKey, source.headerCipherKey); + dest->headerKCV = source.headerCipherKey.baseCipherKCV; + dest->iv.key = source.ivRef.begin(); + dest->iv.key_length = source.ivRef.size(); +} + +void setBlobFilePointer(FDBBGFilePointer* dest, const BlobFilePointerRef& source) { + dest->filename_ptr = source.filename.begin(); + dest->filename_length = source.filename.size(); + dest->file_offset = source.offset; + dest->file_length = source.length; + dest->full_file_length = source.fullFileLength; + dest->file_version = source.fileVersion; + + // handle encryption + if (source.cipherKeysCtx.present()) { + setEncryptionKeyCtx(&dest->encryption_ctx, source.cipherKeysCtx.get()); + } else { + dest->encryption_ctx.present = false; + } +} + +void setBGMutation(FDBBGMutation* dest, + int64_t version, + FDBBGTenantPrefix const* tenantPrefix, + const MutationRef& source) { + dest->version = version; + dest->type = source.type; + dest->param1_ptr = source.param1.begin(); + dest->param1_length = source.param1.size(); + dest->param2_ptr = source.param2.begin(); + dest->param2_length = source.param2.size(); + + if (tenantPrefix->present) { + dest->param1_ptr += tenantPrefix->prefix.key_length; + dest->param1_length -= tenantPrefix->prefix.key_length; + if (dest->type == FDB_BG_MUTATION_TYPE_CLEAR_RANGE) { + dest->param2_ptr += tenantPrefix->prefix.key_length; + dest->param2_length -= tenantPrefix->prefix.key_length; + } + } +} + +void setBGMutations(FDBBGMutation** mutationsOut, + int* mutationCountOut, + FDBBGTenantPrefix const* tenantPrefix, + Arena& ar, + const GranuleDeltas& deltas) { + // convert mutations from MutationsAndVersionRef to single mutations + int mutationCount = 0; + for (auto& it : deltas) { + mutationCount += it.mutations.size(); + } + *mutationCountOut = mutationCount; + + if (mutationCount > 0) { + *mutationsOut = new (ar) FDBBGMutation[mutationCount]; + mutationCount = 0; + for (auto& it : deltas) { + for (auto& m : it.mutations) { + setBGMutation(&((*mutationsOut)[mutationCount]), it.version, tenantPrefix, m); + mutationCount++; + } + } + ASSERT(mutationCount == *mutationCountOut); + } +} +} // namespace + +extern "C" DLLEXPORT fdb_error_t fdb_future_readbg_get_descriptions(FDBFuture* f, + FDBBGFileDescription** out, + int* desc_count) { + CATCH_AND_RETURN( + Standalone> results = TSAV(Standalone>, f)->get(); + *desc_count = results.size(); + Arena ar; + *out = new (ar) FDBBGFileDescription[results.size()]; + for (int chunkIdx = 0; chunkIdx < results.size(); chunkIdx++) { + BlobGranuleChunkRef& chunk = results[chunkIdx]; + FDBBGFileDescription& desc = (*out)[chunkIdx]; + + // set key range + desc.key_range.begin_key = chunk.keyRange.begin.begin(); + desc.key_range.begin_key_length = chunk.keyRange.begin.size(); + desc.key_range.end_key = chunk.keyRange.end.begin(); + desc.key_range.end_key_length = chunk.keyRange.end.size(); + + // set tenant metadata + if (chunk.tenantPrefix.present()) { + desc.tenant_prefix.present = true; + desc.tenant_prefix.prefix.key = chunk.tenantPrefix.get().begin(); + desc.tenant_prefix.prefix.key_length = chunk.tenantPrefix.get().size(); + + desc.key_range.begin_key += desc.tenant_prefix.prefix.key_length; + desc.key_range.begin_key_length -= desc.tenant_prefix.prefix.key_length; + desc.key_range.end_key += desc.tenant_prefix.prefix.key_length; + desc.key_range.end_key_length -= desc.tenant_prefix.prefix.key_length; + } else { + desc.tenant_prefix.present = false; + } + + // snapshot file + desc.snapshot_present = chunk.snapshotFile.present(); + if (desc.snapshot_present) { + setBlobFilePointer(&desc.snapshot_file_pointer, chunk.snapshotFile.get()); + } + + // delta files + desc.delta_file_count = chunk.deltaFiles.size(); + if (chunk.deltaFiles.size()) { + desc.delta_files = new (ar) FDBBGFilePointer[chunk.deltaFiles.size()]; + for (int d = 0; d < chunk.deltaFiles.size(); d++) { + setBlobFilePointer(&desc.delta_files[d], chunk.deltaFiles[d]); + } + } + + setBGMutations( + &desc.memory_mutations, &desc.memory_mutation_count, &desc.tenant_prefix, ar, chunk.newDeltas); + } + + // make this memory owned by the arena of the object stored in the future + results.arena() + .dependsOn(ar);); +} + +extern "C" DLLEXPORT FDBResult* fdb_readbg_parse_snapshot_file(const uint8_t* file_data, + int file_len, + FDBBGTenantPrefix const* tenant_prefix, + FDBBGEncryptionCtx const* encryption_ctx) { + RETURN_RESULT_ON_ERROR(RangeResult, Optional tenantPrefix; Optional encryptionCtx; + parseGetTenant(tenantPrefix, tenant_prefix); + parseGetEncryptionKeyCtx(encryptionCtx, encryption_ctx); + RangeResult parsedSnapshotData = + bgReadSnapshotFile(StringRef(file_data, file_len), tenantPrefix, encryptionCtx); + return ((FDBResult*)(ThreadResult(parsedSnapshotData)).extractPtr());); +} +extern "C" DLLEXPORT FDBResult* fdb_readbg_parse_delta_file(const uint8_t* file_data, + int file_len, + FDBBGTenantPrefix const* tenant_prefix, + FDBBGEncryptionCtx const* encryption_ctx) { + RETURN_RESULT_ON_ERROR( + Standalone>, Optional tenantPrefix; + Optional encryptionCtx; + parseGetTenant(tenantPrefix, tenant_prefix); + parseGetEncryptionKeyCtx(encryptionCtx, encryption_ctx); + Standalone> parsedDeltaData = + bgReadDeltaFile(StringRef(file_data, file_len), tenantPrefix, encryptionCtx); + return ((FDBResult*)(ThreadResult>>(parsedDeltaData)).extractPtr());); +} + extern "C" DLLEXPORT void fdb_result_destroy(FDBResult* r) { CATCH_AND_DIE(TSAVB(r)->cancel();); } @@ -332,6 +545,13 @@ fdb_error_t fdb_result_get_keyvalue_array(FDBResult* r, *out_more = rr.more;); } +fdb_error_t fdb_result_get_bg_mutations_array(FDBResult* r, FDBBGMutation const** out_mutations, int* out_count) { + CATCH_AND_RETURN(Standalone> mutations = + TSAV(Standalone>, r)->get(); + *out_mutations = (FDBBGMutation*)mutations.begin(); + *out_count = mutations.size();); +} + FDBFuture* fdb_create_cluster_v609(const char* cluster_file_path) { char* path; if (cluster_file_path) { @@ -382,6 +602,12 @@ extern "C" DLLEXPORT fdb_error_t fdb_create_database(const char* cluster_file_pa return fdb_create_database_impl(cluster_file_path, out_database); } +extern "C" DLLEXPORT fdb_error_t fdb_create_database_from_connection_string(const char* connection_string, + FDBDatabase** out_database) { + CATCH_AND_RETURN(*out_database = + (FDBDatabase*)API->createDatabaseFromConnectionString(connection_string).extractPtr();); +} + extern "C" DLLEXPORT fdb_error_t fdb_database_set_option(FDBDatabase* d, FDBDatabaseOption option, uint8_t const* value, @@ -460,10 +686,10 @@ extern "C" DLLEXPORT FDBFuture* fdb_database_get_server_protocol(FDBDatabase* db } return ( - FDBFuture*)(mapThreadFuture(DB(db)->getServerProtocol(expected), [](ErrorOr result) { - return result.map([](ProtocolVersion pv) { return pv.versionWithFlags(); }); - }).extractPtr()); + FDBFuture*)(mapThreadFuture( + DB(db)->getServerProtocol(expected), + [](ErrorOr result) { return result.map(&ProtocolVersion::versionWithFlags); }) + .extractPtr()); } extern "C" DLLEXPORT FDBFuture* fdb_database_purge_blob_granules(FDBDatabase* db, @@ -487,10 +713,204 @@ extern "C" DLLEXPORT FDBFuture* fdb_database_wait_purge_granules_complete(FDBDat FDBFuture*)(DB(db)->waitPurgeGranulesComplete(StringRef(purge_key_name, purge_key_name_length)).extractPtr()); } +extern "C" DLLEXPORT FDBFuture* fdb_database_blobbify_range(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length) { + return (FDBFuture*)(DB(db) + ->blobbifyRange(KeyRangeRef(StringRef(begin_key_name, begin_key_name_length), + StringRef(end_key_name, end_key_name_length))) + .extractPtr()); +} + +extern "C" DLLEXPORT FDBFuture* fdb_database_blobbify_range_blocking(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length) { + return (FDBFuture*)(DB(db) + ->blobbifyRangeBlocking(KeyRangeRef(StringRef(begin_key_name, begin_key_name_length), + StringRef(end_key_name, end_key_name_length))) + .extractPtr()); +} + +extern "C" DLLEXPORT FDBFuture* fdb_database_unblobbify_range(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length) { + return (FDBFuture*)(DB(db) + ->unblobbifyRange(KeyRangeRef(StringRef(begin_key_name, begin_key_name_length), + StringRef(end_key_name, end_key_name_length))) + .extractPtr()); +} + +extern "C" DLLEXPORT FDBFuture* fdb_database_list_blobbified_ranges(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int rangeLimit) { + return (FDBFuture*)(DB(db) + ->listBlobbifiedRanges(KeyRangeRef(StringRef(begin_key_name, begin_key_name_length), + StringRef(end_key_name, end_key_name_length)), + rangeLimit) + .extractPtr()); +} + +extern "C" DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_database_verify_blob_range(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t version) { + Optional rv; + if (version != latestVersion) { + rv = version; + } + return (FDBFuture*)(DB(db) + ->verifyBlobRange(KeyRangeRef(StringRef(begin_key_name, begin_key_name_length), + StringRef(end_key_name, end_key_name_length)), + rv) + .extractPtr()); +} + +extern "C" DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_database_flush_blob_range(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + fdb_bool_t compact, + int64_t version) { + Optional rv; + if (version != latestVersion) { + rv = version; + } + return (FDBFuture*)(DB(db) + ->flushBlobRange(KeyRangeRef(StringRef(begin_key_name, begin_key_name_length), + StringRef(end_key_name, end_key_name_length)), + compact, + rv) + .extractPtr()); +} + +extern "C" DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_database_get_client_status(FDBDatabase* db) { + return (FDBFuture*)(DB(db)->getClientStatus().extractPtr()); +} + extern "C" DLLEXPORT fdb_error_t fdb_tenant_create_transaction(FDBTenant* tenant, FDBTransaction** out_transaction) { CATCH_AND_RETURN(*out_transaction = (FDBTransaction*)TENANT(tenant)->createTransaction().extractPtr();); } +extern "C" DLLEXPORT FDBFuture* fdb_tenant_purge_blob_granules(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t purge_version, + fdb_bool_t force) { + return (FDBFuture*)(TENANT(tenant) + ->purgeBlobGranules(KeyRangeRef(StringRef(begin_key_name, begin_key_name_length), + StringRef(end_key_name, end_key_name_length)), + purge_version, + force) + .extractPtr()); +} +extern "C" DLLEXPORT FDBFuture* fdb_tenant_wait_purge_granules_complete(FDBTenant* tenant, + uint8_t const* purge_key_name, + int purge_key_name_length) { + return (FDBFuture*)(TENANT(tenant) + ->waitPurgeGranulesComplete(StringRef(purge_key_name, purge_key_name_length)) + .extractPtr()); +} + +extern "C" DLLEXPORT FDBFuture* fdb_tenant_blobbify_range(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length) { + return (FDBFuture*)(TENANT(tenant) + ->blobbifyRange(KeyRangeRef(StringRef(begin_key_name, begin_key_name_length), + StringRef(end_key_name, end_key_name_length))) + .extractPtr()); +} + +extern "C" DLLEXPORT FDBFuture* fdb_tenant_blobbify_range_blocking(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length) { + return (FDBFuture*)(TENANT(tenant) + ->blobbifyRangeBlocking(KeyRangeRef(StringRef(begin_key_name, begin_key_name_length), + StringRef(end_key_name, end_key_name_length))) + .extractPtr()); +} + +extern "C" DLLEXPORT FDBFuture* fdb_tenant_unblobbify_range(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length) { + return (FDBFuture*)(TENANT(tenant) + ->unblobbifyRange(KeyRangeRef(StringRef(begin_key_name, begin_key_name_length), + StringRef(end_key_name, end_key_name_length))) + .extractPtr()); +} + +extern "C" DLLEXPORT FDBFuture* fdb_tenant_list_blobbified_ranges(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int rangeLimit) { + return (FDBFuture*)(TENANT(tenant) + ->listBlobbifiedRanges(KeyRangeRef(StringRef(begin_key_name, begin_key_name_length), + StringRef(end_key_name, end_key_name_length)), + rangeLimit) + .extractPtr()); +} + +extern "C" DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_tenant_verify_blob_range(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t version) { + Optional rv; + if (version != latestVersion) { + rv = version; + } + return (FDBFuture*)(TENANT(tenant) + ->verifyBlobRange(KeyRangeRef(StringRef(begin_key_name, begin_key_name_length), + StringRef(end_key_name, end_key_name_length)), + rv) + .extractPtr()); +} + +extern "C" DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_tenant_flush_blob_range(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + fdb_bool_t compact, + int64_t version) { + Optional rv; + if (version != latestVersion) { + rv = version; + } + return (FDBFuture*)(TENANT(tenant) + ->flushBlobRange(KeyRangeRef(StringRef(begin_key_name, begin_key_name_length), + StringRef(end_key_name, end_key_name_length)), + compact, + rv) + .extractPtr()); +} + +extern "C" DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_tenant_get_id(FDBTenant* tenant) { + return (FDBFuture*)(TENANT(tenant)->getId().extractPtr()); +} + extern "C" DLLEXPORT void fdb_tenant_destroy(FDBTenant* tenant) { try { TENANT(tenant)->delref(); @@ -757,6 +1177,14 @@ extern "C" DLLEXPORT fdb_error_t fdb_transaction_get_committed_version(FDBTransa CATCH_AND_RETURN(*out_version = TXN(tr)->getCommittedVersion();); } +extern "C" DLLEXPORT FDBFuture* fdb_transaction_get_tag_throttled_duration(FDBTransaction* tr) { + return (FDBFuture*)TXN(tr)->getTagThrottledDuration().extractPtr(); +} + +extern "C" DLLEXPORT FDBFuture* fdb_transaction_get_total_cost(FDBTransaction* tr) { + return (FDBFuture*)TXN(tr)->getTotalCost().extractPtr(); +} + extern "C" DLLEXPORT FDBFuture* fdb_transaction_get_approximate_size(FDBTransaction* tr) { return (FDBFuture*)TXN(tr)->getApproximateSize().extractPtr(); } @@ -825,11 +1253,12 @@ extern "C" DLLEXPORT FDBFuture* fdb_transaction_get_blob_granule_ranges(FDBTrans uint8_t const* begin_key_name, int begin_key_name_length, uint8_t const* end_key_name, - int end_key_name_length) { + int end_key_name_length, + int rangeLimit) { RETURN_FUTURE_ON_ERROR( Standalone>, KeyRangeRef range(KeyRef(begin_key_name, begin_key_name_length), KeyRef(end_key_name, end_key_name_length)); - return (FDBFuture*)(TXN(tr)->getBlobGranuleRanges(range).extractPtr());); + return (FDBFuture*)(TXN(tr)->getBlobGranuleRanges(range, rangeLimit).extractPtr());); } extern "C" DLLEXPORT FDBResult* fdb_transaction_read_blob_granules(FDBTransaction* tr, @@ -859,6 +1288,96 @@ extern "C" DLLEXPORT FDBResult* fdb_transaction_read_blob_granules(FDBTransactio return (FDBResult*)(TXN(tr)->readBlobGranules(range, beginVersion, rv, context).extractPtr());); } +extern "C" DLLEXPORT FDBFuture* fdb_transaction_read_blob_granules_start(FDBTransaction* tr, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t beginVersion, + int64_t readVersion, + int64_t* readVersionOut) { + Optional rv; + if (readVersion != latestVersion) { + rv = readVersion; + } + return (FDBFuture*)(TXN(tr) + ->readBlobGranulesStart(KeyRangeRef(KeyRef(begin_key_name, begin_key_name_length), + KeyRef(end_key_name, end_key_name_length)), + beginVersion, + rv, + readVersionOut) + .extractPtr()); +} + +extern "C" DLLEXPORT FDBResult* fdb_transaction_read_blob_granules_finish(FDBTransaction* tr, + FDBFuture* f, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t beginVersion, + int64_t readVersion, + FDBReadBlobGranuleContext* granule_context) { + // FIXME: better way to convert? + ReadBlobGranuleContext context; + context.userContext = granule_context->userContext; + context.start_load_f = granule_context->start_load_f; + context.get_load_f = granule_context->get_load_f; + context.free_load_f = granule_context->free_load_f; + context.debugNoMaterialize = granule_context->debugNoMaterialize; + context.granuleParallelism = granule_context->granuleParallelism; + ThreadFuture>> startFuture( + TSAV(Standalone>, f)); + + return (FDBResult*)(TXN(tr) + ->readBlobGranulesFinish(startFuture, + KeyRangeRef(KeyRef(begin_key_name, begin_key_name_length), + KeyRef(end_key_name, end_key_name_length)), + beginVersion, + readVersion, + context) + .extractPtr()); +} + +extern "C" DLLEXPORT FDBFuture* fdb_transaction_summarize_blob_granules(FDBTransaction* tr, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t summaryVersion, + int rangeLimit) { + RETURN_FUTURE_ON_ERROR( + Standalone>, + KeyRangeRef range(KeyRef(begin_key_name, begin_key_name_length), KeyRef(end_key_name, end_key_name_length)); + + Optional sv; + if (summaryVersion != latestVersion) { sv = summaryVersion; } + + return (FDBFuture*)(TXN(tr)->summarizeBlobGranules(range, sv, rangeLimit).extractPtr());); +} + +// copied from read_blob_granules_start +extern "C" DLLEXPORT FDBFuture* fdb_transaction_read_blob_granules_description(FDBTransaction* tr, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t begin_version, + int64_t read_version, + int64_t* read_version_out) { + Optional rv; + if (read_version != latestVersion) { + rv = read_version; + } + return (FDBFuture*)(TXN(tr) + ->readBlobGranulesStart(KeyRangeRef(KeyRef(begin_key_name, begin_key_name_length), + KeyRef(end_key_name, end_key_name_length)), + begin_version, + rv, + read_version_out) + .extractPtr()); +} + #include "fdb_c_function_pointers.g.h" #define FDB_API_CHANGED(func, ver) \ @@ -934,6 +1453,10 @@ extern "C" DLLEXPORT const char* fdb_get_client_version() { return API->getClientVersion(); } +extern "C" DLLEXPORT void fdb_use_future_protocol_version() { + API->useFutureProtocolVersion(); +} + #if defined(__APPLE__) #include __attribute__((constructor)) static void initialize() { diff --git a/src/bindings/c/foundationdb/fdb_c.h b/src/bindings/c/foundationdb/fdb_c.h index 1088e78..f13bb29 100644 --- a/src/bindings/c/foundationdb/fdb_c.h +++ b/src/bindings/c/foundationdb/fdb_c.h @@ -26,11 +26,18 @@ #define DLLEXPORT #endif +#include "fdb_c_apiversion.g.h" +#if (defined FDB_USE_LATEST_API_VERSION) +#define FDB_API_VERSION FDB_LATEST_API_VERSION +#elif (defined FDB_USE_LATEST_BINDINGS_API_VERSION) +#define FDB_API_VERSION FDB_LATEST_BINDINGS_API_VERSION +#endif + #if !defined(FDB_API_VERSION) -#error You must #define FDB_API_VERSION prior to including fdb_c.h (current version is 710) +#error You must #define FDB_API_VERSION prior to including fdb_c.h (the latest version is defined as FDB_LATEST_API_VERSION) #elif FDB_API_VERSION < 13 #error API version no longer supported (upgrade to 13) -#elif FDB_API_VERSION > 710 +#elif FDB_API_VERSION > FDB_LATEST_API_VERSION #error Requested API version requires a newer version of this header #endif @@ -70,6 +77,15 @@ DLLEXPORT fdb_bool_t fdb_error_predicate(int predicate_test, fdb_error_t code); #define /* fdb_error_t */ fdb_select_api_version(v) fdb_select_api_version_impl(v, FDB_API_VERSION) +/* + * A variant of fdb_select_api_version that caps the header API version by the maximum API version + * supported by the client library. It is intended mainly for use in combination with the shim + * layer, which loads the client library dynamically. + */ +#define /* fdb_error_t */ fdb_select_api_version_capped(v) \ + fdb_select_api_version_impl( \ + v, FDB_API_VERSION < fdb_get_max_api_version() ? FDB_API_VERSION : fdb_get_max_api_version()) + DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_network_set_option(FDBNetworkOption option, uint8_t const* value, int value_length); @@ -90,7 +106,7 @@ typedef struct key { const uint8_t* key; int key_length; } FDBKey; -#if FDB_API_VERSION >= 710 +#if FDB_API_VERSION >= 630 typedef struct keyvalue { const uint8_t* key; int key_length; @@ -169,6 +185,14 @@ typedef struct keyrange { const uint8_t* end_key; int end_key_length; } FDBKeyRange; + +typedef struct granulesummary { + FDBKeyRange key_range; + int64_t snapshot_version; + int64_t snapshot_size; + int64_t delta_version; + int64_t delta_size; +} FDBGranuleSummary; #pragma pack(pop) typedef struct readgranulecontext { @@ -197,6 +221,64 @@ typedef struct readgranulecontext { int granuleParallelism; } FDBReadBlobGranuleContext; +typedef enum { FDB_BG_MUTATION_TYPE_SET_VALUE = 0, FDB_BG_MUTATION_TYPE_CLEAR_RANGE = 1 } FDBBGMutationType; + +#pragma pack(push, 4) + +typedef struct bgtenantprefix { + fdb_bool_t present; + FDBKey prefix; +} FDBBGTenantPrefix; + +/* encryption structs correspond to similar ones in BlobGranuleCommon.h */ +typedef struct bgencryptionkey { + int64_t domain_id; + uint64_t base_key_id; + uint32_t base_kcv; + uint64_t random_salt; + FDBKey base_key; +} FDBBGEncryptionKey; + +typedef struct bgencryptionctx { + fdb_bool_t present; + FDBBGEncryptionKey textKey; + uint32_t textKCV; + FDBBGEncryptionKey headerKey; + uint32_t headerKCV; + FDBKey iv; +} FDBBGEncryptionCtx; + +typedef struct bgfilepointer { + const uint8_t* filename_ptr; + int filename_length; + int64_t file_offset; + int64_t file_length; + int64_t full_file_length; + int64_t file_version; + FDBBGEncryptionCtx encryption_ctx; +} FDBBGFilePointer; + +typedef struct bgmutation { + /* FDBBGMutationType */ uint8_t type; + int64_t version; + const uint8_t* param1_ptr; + int param1_length; + const uint8_t* param2_ptr; + int param2_length; +} FDBBGMutation; + +typedef struct bgfiledescription { + FDBKeyRange key_range; + fdb_bool_t snapshot_present; + FDBBGFilePointer snapshot_file_pointer; + int delta_file_count; + FDBBGFilePointer* delta_files; + int memory_mutation_count; + FDBBGMutation* memory_mutations; + FDBBGTenantPrefix tenant_prefix; +} FDBBGFileDescription; +#pragma pack(pop) + DLLEXPORT void fdb_future_cancel(FDBFuture* f); DLLEXPORT void fdb_future_release_memory(FDBFuture* f); @@ -217,10 +299,14 @@ DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_future_set_callback(FDBFuture* f, DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_future_get_error(FDBFuture* f); #endif +DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_future_get_bool(FDBFuture* f, fdb_bool_t* out); + DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_future_get_int64(FDBFuture* f, int64_t* out); DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_future_get_uint64(FDBFuture* f, uint64_t* out); +DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_future_get_double(FDBFuture* f, double* out); + DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_future_get_key(FDBFuture* f, uint8_t const** out_key, int* out_key_length); DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_future_get_value(FDBFuture* f, @@ -252,6 +338,25 @@ DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_future_get_keyrange_array(FDBFuture FDBKeyRange const** out_ranges, int* out_count); +DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_future_get_granule_summary_array(FDBFuture* f, + FDBGranuleSummary const** out_summaries, + int* out_count); + +/* all for using future result from read_blob_granules_description */ +DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_future_readbg_get_descriptions(FDBFuture* f, + FDBBGFileDescription** out, + int* desc_count); + +DLLEXPORT WARN_UNUSED_RESULT FDBResult* fdb_readbg_parse_snapshot_file(const uint8_t* file_data, + int file_len, + FDBBGTenantPrefix const* tenant_prefix, + FDBBGEncryptionCtx const* encryption_ctx); + +DLLEXPORT WARN_UNUSED_RESULT FDBResult* fdb_readbg_parse_delta_file(const uint8_t* file_data, + int file_len, + FDBBGTenantPrefix const* tenant_prefix, + FDBBGEncryptionCtx const* encryption_ctx); + /* FDBResult is a synchronous computation result, as opposed to a future that is asynchronous. */ DLLEXPORT void fdb_result_destroy(FDBResult* r); @@ -260,10 +365,17 @@ DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_result_get_keyvalue_array(FDBResult int* out_count, fdb_bool_t* out_more); +DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_result_get_bg_mutations_array(FDBResult* r, + FDBBGMutation const** out_mutations, + int* out_count); + /* TODO: add other return types as we need them */ DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_create_database(const char* cluster_file_path, FDBDatabase** out_database); +DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_create_database_from_connection_string(const char* connection_string, + FDBDatabase** out_database); + DLLEXPORT void fdb_database_destroy(FDBDatabase* d); DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_database_set_option(FDBDatabase* d, @@ -311,9 +423,112 @@ DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_database_wait_purge_granules_complet uint8_t const* purge_key_name, int purge_key_name_length); +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_database_blobbify_range(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_database_blobbify_range_blocking(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_database_unblobbify_range(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_database_list_blobbified_ranges(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int rangeLimit); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_database_verify_blob_range(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t version); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_database_flush_blob_range(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + fdb_bool_t compact, + int64_t version); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_database_get_client_status(FDBDatabase* db); + DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_tenant_create_transaction(FDBTenant* tenant, FDBTransaction** out_transaction); +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_tenant_purge_blob_granules(FDBTenant* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t purge_version, + fdb_bool_t force); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_tenant_wait_purge_granules_complete(FDBTenant* db, + uint8_t const* purge_key_name, + int purge_key_name_length); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_tenant_blobbify_range(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_tenant_blobbify_range_blocking(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_tenant_unblobbify_range(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_tenant_list_blobbified_ranges(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int rangeLimit); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_tenant_list_blobbified_ranges(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int rangeLimit); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_tenant_verify_blob_range(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t version); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_tenant_flush_blob_range(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + fdb_bool_t compact, + int64_t version); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_tenant_get_id(FDBTenant* tenant); + DLLEXPORT void fdb_tenant_destroy(FDBTenant* tenant); DLLEXPORT void fdb_transaction_destroy(FDBTransaction* tr); @@ -418,12 +633,16 @@ DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_transaction_get_committed_version(F int64_t* out_version); /* - * This function intentionally returns an FDBFuture instead of an integer - * directly, so that calling this API can see the effect of previous + * These functions intentionally return an FDBFuture instead of a numeric value + * directly, so that calling the API can see the effect of previous * mutations on the transaction. Specifically, mutations are applied * asynchronously by the main thread. In order to see them, this call has to * be serviced by the main thread too. */ +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_transaction_get_tag_throttled_duration(FDBTransaction* tr); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_transaction_get_total_cost(FDBTransaction* tr); + DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_transaction_get_approximate_size(FDBTransaction* tr); DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_transaction_get_versionstamp(FDBTransaction* tr); @@ -456,7 +675,8 @@ DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_transaction_get_blob_granule_ranges( uint8_t const* begin_key_name, int begin_key_name_length, uint8_t const* end_key_name, - int end_key_name_length); + int end_key_name_length, + int rangeLimit); /* LatestVersion (-2) for readVersion means get read version from transaction Separated out as optional because BG reads can support longer-lived reads than normal FDB transactions */ @@ -469,6 +689,23 @@ DLLEXPORT WARN_UNUSED_RESULT FDBResult* fdb_transaction_read_blob_granules(FDBTr int64_t readVersion, FDBReadBlobGranuleContext granuleContext); +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_transaction_summarize_blob_granules(FDBTransaction* tr, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t summaryVersion, + int rangeLimit); + +DLLEXPORT WARN_UNUSED_RESULT FDBFuture* fdb_transaction_read_blob_granules_description(FDBTransaction* tr, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t begin_version, + int64_t read_version, + int64_t* read_version_out); + #define FDB_KEYSEL_LAST_LESS_THAN(k, l) k, l, 0, 0 #define FDB_KEYSEL_LAST_LESS_OR_EQUAL(k, l) k, l, 1, 0 #define FDB_KEYSEL_FIRST_GREATER_THAN(k, l) k, l, 1, 1 diff --git a/src/bindings/c/foundationdb/fdb_c_apiversion.g.h b/src/bindings/c/foundationdb/fdb_c_apiversion.g.h new file mode 100644 index 0000000..b878501 --- /dev/null +++ b/src/bindings/c/foundationdb/fdb_c_apiversion.g.h @@ -0,0 +1,41 @@ +#ifndef FDB_C_APIVERSION_G_H +#define FDB_C_APIVERSION_G_H +#pragma once + +/* + * fdb_c_apiversion.g.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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. + * Do not include this file directly. + */ + +/* The latest FDB C API version */ +#define FDB_LATEST_API_VERSION 730 + +/* The latest FDB API version supported by bindings. It may lag behind the latest C API version */ +#define FDB_LATEST_BINDINGS_API_VERSION 730 + +/* API version introducing client_tmp_dir option */ +#define FDB_API_VERSION_CLIENT_TMP_DIR 720 + +/* API version introducing disable_client_bypass option */ +#define FDB_API_VERSION_DISABLE_CLIENT_BYPASS 720 + +/* API version with multitenancy API released */ +#define FDB_API_VERSION_TENANT_API_RELEASED 720 + +#endif diff --git a/src/bindings/c/foundationdb/fdb_c_internal.h b/src/bindings/c/foundationdb/fdb_c_internal.h index f1897a5..67a59a5 100644 --- a/src/bindings/c/foundationdb/fdb_c_internal.h +++ b/src/bindings/c/foundationdb/fdb_c_internal.h @@ -46,6 +46,29 @@ DLLEXPORT void fdb_database_set_shared_state(FDBDatabase* db, DatabaseSharedStat DLLEXPORT WARN_UNUSED_RESULT fdb_error_t fdb_future_get_shared_state(FDBFuture* f, DatabaseSharedState** outPtr); +DLLEXPORT void fdb_use_future_protocol_version(); + +// the logical read_blob_granules is broken out (at different points depending on the client type) into the asynchronous +// start() that happens on the fdb network thread, and synchronous finish() that happens off it +DLLEXPORT FDBFuture* fdb_transaction_read_blob_granules_start(FDBTransaction* tr, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t beginVersion, + int64_t readVersion, + int64_t* readVersionOut); + +DLLEXPORT FDBResult* fdb_transaction_read_blob_granules_finish(FDBTransaction* tr, + FDBFuture* f, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t beginVersion, + int64_t readVersion, + FDBReadBlobGranuleContext* granuleContext); + #ifdef __cplusplus } #endif diff --git a/src/bindings/c/foundationdb/fdb_c_options.g.h b/src/bindings/c/foundationdb/fdb_c_options.g.h index 2d1515d..93ea031 100644 --- a/src/bindings/c/foundationdb/fdb_c_options.g.h +++ b/src/bindings/c/foundationdb/fdb_c_options.g.h @@ -60,6 +60,14 @@ typedef enum { /* Parameter: (String) The identifier that will be part of all trace file names */ FDB_NET_OPTION_TRACE_FILE_IDENTIFIER=36, + /* Use the same base trace file name for all client threads as it did before version 7.2. The current default behavior is to use distinct trace file names for client threads by including their version and thread index. */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_TRACE_SHARE_AMONG_CLIENT_THREADS=37, + + /* Initialize trace files on network setup, determine the local IP later. Otherwise tracing is initialized when opening the first database. */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_TRACE_INITIALIZE_ON_SETUP=38, + /* Set file suffix for partially written log files. */ /* Parameter: (String) Append this suffix to partially written log files. When a log file is complete, it is renamed to remove the suffix. No separator is added between the file and the suffix. If you want to add a file extension, you should include the separator - e.g. '.tmp' instead of 'tmp' to add the 'tmp' extension. */ FDB_NET_OPTION_TRACE_PARTIAL_FILE_SUFFIX=39, @@ -144,10 +152,22 @@ typedef enum { /* Parameter: (Int) Number of client threads to be spawned. Each cluster will be serviced by a single client thread. */ FDB_NET_OPTION_CLIENT_THREADS_PER_VERSION=65, + /* Adds an external client library to be used with a future version protocol. This option can be used testing purposes only! */ + /* Parameter: (String) path to client library */ + FDB_NET_OPTION_FUTURE_VERSION_CLIENT_LIBRARY=66, + /* Retain temporary external client library copies that are created for enabling multi-threading. */ /* Parameter: Option takes no parameter */ FDB_NET_OPTION_RETAIN_CLIENT_LIBRARY_COPIES=67, + /* Ignore the failure to initialize some of the external clients */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_IGNORE_EXTERNAL_CLIENT_FAILURES=68, + + /* Fail with an error if there is no client matching the server version the client is connecting to */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_FAIL_INCOMPATIBLE_CLIENT=69, + /* Disables logging of client statistics, such as sampled transaction activity. */ /* Parameter: Option takes no parameter */ FDB_NET_OPTION_DISABLE_CLIENT_STATISTICS_LOGGING=70, @@ -160,6 +180,10 @@ typedef enum { /* Parameter: Option takes no parameter */ FDB_NET_OPTION_ENABLE_RUN_LOOP_PROFILING=71, + /* Prevents the multi-version client API from being disabled, even if no external clients are configured. This option is required to use GRV caching. */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_DISABLE_CLIENT_BYPASS=72, + /* Enable client buggify - will make requests randomly fail (intended for client testing) */ /* Parameter: Option takes no parameter */ FDB_NET_OPTION_CLIENT_BUGGIFY_ENABLE=80, @@ -180,6 +204,10 @@ typedef enum { /* Parameter: (String) Distributed tracer type. Choose from none, log_file, or network_lossy */ FDB_NET_OPTION_DISTRIBUTED_CLIENT_TRACER=90, + /* Sets the directory for storing temporary files created by FDB client, such as temporary copies of client libraries. Defaults to /tmp */ + /* Parameter: (String) Client directory for temporary files. */ + FDB_NET_OPTION_CLIENT_TMP_DIR=91, + /* This option is set automatically to communicate the list of supported clients to the active client. */ /* Parameter: (String) [release version],[source version],[protocol version];... This is a hidden parameter and should not be used directly by applications.*/ FDB_NET_OPTION_SUPPORTED_CLIENT_VERSIONS=1000, @@ -246,16 +274,28 @@ typedef enum { /* Parameter: Option takes no parameter */ FDB_DB_OPTION_TRANSACTION_INCLUDE_PORT_IN_ADDRESS=505, + /* Set a random idempotency id for all transactions. See the transaction option description for more information. This feature is in development and not ready for general use. */ + /* Parameter: Option takes no parameter */ + FDB_DB_OPTION_TRANSACTION_AUTOMATIC_IDEMPOTENCY=506, + /* Allows ``get`` operations to read from sections of keyspace that have become unreadable because of versionstamp operations. This sets the ``bypass_unreadable`` option of each transaction created by this database. See the transaction option description for more information. */ /* Parameter: Option takes no parameter */ FDB_DB_OPTION_TRANSACTION_BYPASS_UNREADABLE=700, + /* By default, operations that are performed on a transaction while it is being committed will not only fail themselves, but they will attempt to fail other in-flight operations (such as the commit) as well. This behavior is intended to help developers discover situations where operations could be unintentionally executed after the transaction has been reset. Setting this option removes that protection, causing only the offending operation to fail. */ + /* Parameter: Option takes no parameter */ + FDB_DB_OPTION_TRANSACTION_USED_DURING_COMMIT_PROTECTION_DISABLE=701, + + /* Enables conflicting key reporting on all transactions, allowing them to retrieve the keys that are conflicting with other transactions. */ + /* Parameter: Option takes no parameter */ + FDB_DB_OPTION_TRANSACTION_REPORT_CONFLICTING_KEYS=702, + /* Use configuration database. */ /* Parameter: Option takes no parameter */ FDB_DB_OPTION_USE_CONFIG_DATABASE=800, - /* An integer between 0 and 100 (default is 0) expressing the probability that a client will verify it can't read stale data whenever it detects a recovery. */ - /* Parameter: Option takes no parameter */ + /* Enables verification of causal read risky by checking whether clients are able to read stale data when they detect a recovery, and logging an error if so. */ + /* Parameter: (Int) integer between 0 and 100 expressing the probability a client will verify it can't read stale data */ FDB_DB_OPTION_TEST_CAUSAL_READ_RISKY=900 } FDBDatabaseOption; @@ -296,6 +336,26 @@ typedef enum { /* Parameter: Option takes no parameter */ FDB_TR_OPTION_READ_AHEAD_DISABLE=52, + /* Storage server should cache disk blocks needed for subsequent read requests in this transaction. This is the default behavior. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_READ_SERVER_SIDE_CACHE_ENABLE=507, + + /* Storage server should not cache disk blocks needed for subsequent read requests in this transaction. This can be used to avoid cache pollution for reads not expected to be repeated. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_READ_SERVER_SIDE_CACHE_DISABLE=508, + + /* Use normal read priority for subsequent read requests in this transaction. This is the default read priority. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_READ_PRIORITY_NORMAL=509, + + /* Use low read priority for subsequent read requests in this transaction. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_READ_PRIORITY_LOW=510, + + /* Use high read priority for subsequent read requests in this transaction. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_READ_PRIORITY_HIGH=511, + /* */ /* Parameter: Option takes no parameter */ FDB_TR_OPTION_DURABILITY_DATACENTER=110, @@ -332,6 +392,10 @@ typedef enum { /* Parameter: Option takes no parameter */ FDB_TR_OPTION_RAW_ACCESS=303, + /* Allows this transaction to bypass storage quota enforcement. Should only be used for transactions that directly or indirectly decrease the size of the tenant group's data. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_BYPASS_STORAGE_QUOTA=304, + /* */ /* Parameter: Option takes no parameter This is a hidden parameter and should not be used directly by applications.*/ FDB_TR_OPTION_DEBUG_DUMP=400, @@ -376,6 +440,14 @@ typedef enum { /* Parameter: (Int) value in bytes */ FDB_TR_OPTION_SIZE_LIMIT=503, + /* Associate this transaction with this ID for the purpose of checking whether or not this transaction has already committed. Must be at least 16 bytes and less than 256 bytes. This feature is in development and not ready for general use. Unless the automatic_idempotency option is set after this option, the client will not automatically attempt to remove this id from the cluster after a successful commit. */ + /* Parameter: (String) Unique ID This is a hidden parameter and should not be used directly by applications.*/ + FDB_TR_OPTION_IDEMPOTENCY_ID=504, + + /* Automatically assign a random 16 byte idempotency id for this transaction. Prevents commits from failing with ``commit_unknown_result``. WARNING: If you are also using the multiversion client or transaction timeouts, if either cluster_version_changed or transaction_timed_out was thrown during a commit, then that commit may have already succeeded or may succeed in the future. This feature is in development and not ready for general use. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_AUTOMATIC_IDEMPOTENCY=505, + /* Snapshot read operations will see the results of writes done in the same transaction. This is the default behavior. */ /* Parameter: Option takes no parameter */ FDB_TR_OPTION_SNAPSHOT_RYW_ENABLE=600, @@ -436,13 +508,17 @@ typedef enum { /* Parameter: Option takes no parameter */ FDB_TR_OPTION_BYPASS_UNREADABLE=1100, - /* Allows this transaction to use cached GRV from the database context. Defaults to off. Upon first usage, starts a background updater to periodically update the cache to avoid stale read versions. */ + /* Allows this transaction to use cached GRV from the database context. Defaults to off. Upon first usage, starts a background updater to periodically update the cache to avoid stale read versions. The disable_client_bypass option must also be set. */ /* Parameter: Option takes no parameter */ FDB_TR_OPTION_USE_GRV_CACHE=1101, /* Specifically instruct this transaction to NOT use cached GRV. Primarily used for the read version cache's background updater to avoid attempting to read a cached entry in specific situations. */ /* Parameter: Option takes no parameter This is a hidden parameter and should not be used directly by applications.*/ - FDB_TR_OPTION_SKIP_GRV_CACHE=1102 + FDB_TR_OPTION_SKIP_GRV_CACHE=1102, + + /* Attach given authorization token to the transaction such that subsequent tenant-aware requests are authorized */ + /* Parameter: (String) A JSON Web Token authorized to access data belonging to one or more tenants, indicated by 'tenants' claim of the token's payload. */ + FDB_TR_OPTION_AUTHORIZATION_TOKEN=2000 } FDBTransactionOption; typedef enum { diff --git a/src/bindings/c/foundationdb/fdb_c_shim.h b/src/bindings/c/foundationdb/fdb_c_shim.h new file mode 100644 index 0000000..44dfdc7 --- /dev/null +++ b/src/bindings/c/foundationdb/fdb_c_shim.h @@ -0,0 +1,47 @@ +/* + * fdb_shim_c.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDB_SHIM_C_H +#define FDB_SHIM_C_H +#pragma once + +#ifndef DLLEXPORT +#define DLLEXPORT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Specify the path of the local libfdb_c.so library to be dynamically loaded by the shim layer + * + * This enables running the same application code with different client library versions, + * e.g. using the latest development build for testing new features, but still using the latest + * stable release in production deployments. + * + * The given path overrides the environment variable FDB_LOCAL_CLIENT_LIBRARY_PATH + */ +DLLEXPORT void fdb_shim_set_local_client_library_path(const char* filePath); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/contrib/SimpleOpt/CMakeLists.txt b/src/contrib/SimpleOpt/CMakeLists.txt new file mode 100644 index 0000000..449e1bc --- /dev/null +++ b/src/contrib/SimpleOpt/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(SimpleOpt INTERFACE) +target_include_directories(SimpleOpt INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") diff --git a/src/flow/SimpleOpt.h b/src/contrib/SimpleOpt/include/SimpleOpt/SimpleOpt.h similarity index 99% rename from src/flow/SimpleOpt.h rename to src/contrib/SimpleOpt/include/SimpleOpt/SimpleOpt.h index 96989fb..0b70307 100644 --- a/src/flow/SimpleOpt.h +++ b/src/contrib/SimpleOpt/include/SimpleOpt/SimpleOpt.h @@ -78,7 +78,7 @@
  • Include the SimpleOpt.h header file
    -        \#include "flow/SimpleOpt.h"
    +        \#include "SimpleOpt/SimpleOpt.h"
             
  • Define an array of valid options for your program. diff --git a/src/contrib/crc32/CMakeLists.txt b/src/contrib/crc32/CMakeLists.txt new file mode 100644 index 0000000..3fb87e1 --- /dev/null +++ b/src/contrib/crc32/CMakeLists.txt @@ -0,0 +1,8 @@ +add_library(crc32 STATIC crc32.S crc32_wrapper.c crc32c.cpp) +if (CLANG) + # This is necessary for clang since the compiler reports that crc32_align is + # defined but not used. With -Werror, crc32 will not compile. + # TODO: Remove this when the upstream issue is repaired. + target_compile_options(crc32 PUBLIC -Wno-unused-function) +endif () +target_include_directories(crc32 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") diff --git a/src/contrib/crc32/crc32.S b/src/contrib/crc32/crc32.S new file mode 100644 index 0000000..3cfc2d1 --- /dev/null +++ b/src/contrib/crc32/crc32.S @@ -0,0 +1,791 @@ +#if defined(__powerpc64__) +/* + * Calculate the checksum of data that is 16 byte aligned and a multiple of + * 16 bytes. + * + * The first step is to reduce it to 1024 bits. We do this in 8 parallel + * chunks in order to mask the latency of the vpmsum instructions. If we + * have more than 32 kB of data to checksum we repeat this step multiple + * times, passing in the previous 1024 bits. + * + * The next step is to reduce the 1024 bits to 64 bits. This step adds + * 32 bits of 0s to the end - this matches what a CRC does. We just + * calculate constants that land the data in this 32 bits. + * + * We then use fixed point Barrett reduction to compute a mod n over GF(2) + * for n = CRC using POWER8 instructions. We use x = 32. + * + * http://en.wikipedia.org/wiki/Barrett_reduction + * + * Copyright (C) 2015 Anton Blanchard , IBM + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of either: + * + * a) the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version, or + * b) the Apache License, Version 2.0 + */ + +#if defined (__clang__) +#ifndef __ALTIVEC__ +#define __ALTIVEC__ +#endif +#include "ppc-asm.h" +#else +#include +#endif +#include "ppc-opcode.h" + +#undef toc + +#ifndef r1 +#define r1 1 +#endif + +#ifndef r2 +#define r2 2 +#endif + + .section .rodata +.balign 16 + +.byteswap_constant: + /* byte reverse permute constant */ + .octa 0x0F0E0D0C0B0A09080706050403020100 + +#ifdef CRC32_CONSTANTS_HEADER +#include CRC32_CONSTANTS_HEADER +#else +#include "crc32/crc32_constants.h" +#endif + + .text + +#if defined(__BIG_ENDIAN__) && defined(REFLECT) +#define BYTESWAP_DATA +#elif defined(__LITTLE_ENDIAN__) && !defined(REFLECT) +#define BYTESWAP_DATA +#else +#undef BYTESWAP_DATA +#endif + +#define off16 r25 +#define off32 r26 +#define off48 r27 +#define off64 r28 +#define off80 r29 +#define off96 r30 +#define off112 r31 + +#define const1 v24 +#define const2 v25 + +#define byteswap v26 +#define mask_32bit v27 +#define mask_64bit v28 +#define zeroes v29 + +#ifdef BYTESWAP_DATA +#define VPERM(A, B, C, D) vperm A, B, C, D +#else +#define VPERM(A, B, C, D) +#endif + +#ifndef CRC32_FUNCTION_ASM +#define CRC32_FUNCTION_ASM __crc32_vpmsum +#endif + +//clang-format off + +/* unsigned int __crc32_vpmsum(unsigned int crc, void *p, unsigned long len) */ +FUNC_START(CRC32_FUNCTION_ASM) + std r31,-8(r1) + std r30,-16(r1) + std r29,-24(r1) + std r28,-32(r1) + std r27,-40(r1) + std r26,-48(r1) + std r25,-56(r1) + + li off16,16 + li off32,32 + li off48,48 + li off64,64 + li off80,80 + li off96,96 + li off112,112 + li r0,0 + + /* Enough room for saving 10 non volatile VMX registers */ + subi r6,r1,56+10*16 + subi r7,r1,56+2*16 + + stvx v20,0,r6 + stvx v21,off16,r6 + stvx v22,off32,r6 + stvx v23,off48,r6 + stvx v24,off64,r6 + stvx v25,off80,r6 + stvx v26,off96,r6 + stvx v27,off112,r6 + stvx v28,0,r7 + stvx v29,off16,r7 + + mr r10,r3 + + vxor zeroes,zeroes,zeroes + vspltisw v0,-1 + + vsldoi mask_32bit,zeroes,v0,4 + vsldoi mask_64bit,zeroes,v0,8 + + /* Get the initial value into v8 */ + vxor v8,v8,v8 + MTVRD(v8, r3) +#ifdef REFLECT + vsldoi v8,zeroes,v8,8 /* shift into bottom 32 bits */ +#else + vsldoi v8,v8,zeroes,4 /* shift into top 32 bits */ +#endif + +#ifdef BYTESWAP_DATA + addis r3,r2,.byteswap_constant@toc@ha + addi r3,r3,.byteswap_constant@toc@l + + lvx byteswap,0,r3 + addi r3,r3,16 +#endif + + cmpdi r5,256 + blt .Lshort + + rldicr r6,r5,0,56 + + /* Checksum in blocks of MAX_SIZE */ +1: lis r7,MAX_SIZE@h + ori r7,r7,MAX_SIZE@l + mr r9,r7 + cmpd r6,r7 + bgt 2f + mr r7,r6 +2: subf r6,r7,r6 + + /* our main loop does 128 bytes at a time */ + srdi r7,r7,7 + + /* + * Work out the offset into the constants table to start at. Each + * constant is 16 bytes, and it is used against 128 bytes of input + * data - 128 / 16 = 8 + */ + sldi r8,r7,4 + srdi r9,r9,3 + subf r8,r8,r9 + + /* We reduce our final 128 bytes in a separate step */ + addi r7,r7,-1 + mtctr r7 + + addis r3,r2,.constants@toc@ha + addi r3,r3,.constants@toc@l + + /* Find the start of our constants */ + add r3,r3,r8 + + /* zero v0-v7 which will contain our checksums */ + vxor v0,v0,v0 + vxor v1,v1,v1 + vxor v2,v2,v2 + vxor v3,v3,v3 + vxor v4,v4,v4 + vxor v5,v5,v5 + vxor v6,v6,v6 + vxor v7,v7,v7 + + lvx const1,0,r3 + + /* + * If we are looping back to consume more data we use the values + * already in v16-v23. + */ + cmpdi r0,1 + beq 2f + + /* First warm up pass */ + lvx v16,0,r4 + lvx v17,off16,r4 + VPERM(v16,v16,v16,byteswap) + VPERM(v17,v17,v17,byteswap) + lvx v18,off32,r4 + lvx v19,off48,r4 + VPERM(v18,v18,v18,byteswap) + VPERM(v19,v19,v19,byteswap) + lvx v20,off64,r4 + lvx v21,off80,r4 + VPERM(v20,v20,v20,byteswap) + VPERM(v21,v21,v21,byteswap) + lvx v22,off96,r4 + lvx v23,off112,r4 + VPERM(v22,v22,v22,byteswap) + VPERM(v23,v23,v23,byteswap) + addi r4,r4,8*16 + + /* xor in initial value */ + vxor v16,v16,v8 + +2: bdz .Lfirst_warm_up_done + + addi r3,r3,16 + lvx const2,0,r3 + + /* Second warm up pass */ + VPMSUMD(v8,v16,const1) + lvx v16,0,r4 + VPERM(v16,v16,v16,byteswap) + ori r2,r2,0 + + VPMSUMD(v9,v17,const1) + lvx v17,off16,r4 + VPERM(v17,v17,v17,byteswap) + ori r2,r2,0 + + VPMSUMD(v10,v18,const1) + lvx v18,off32,r4 + VPERM(v18,v18,v18,byteswap) + ori r2,r2,0 + + VPMSUMD(v11,v19,const1) + lvx v19,off48,r4 + VPERM(v19,v19,v19,byteswap) + ori r2,r2,0 + + VPMSUMD(v12,v20,const1) + lvx v20,off64,r4 + VPERM(v20,v20,v20,byteswap) + ori r2,r2,0 + + VPMSUMD(v13,v21,const1) + lvx v21,off80,r4 + VPERM(v21,v21,v21,byteswap) + ori r2,r2,0 + + VPMSUMD(v14,v22,const1) + lvx v22,off96,r4 + VPERM(v22,v22,v22,byteswap) + ori r2,r2,0 + + VPMSUMD(v15,v23,const1) + lvx v23,off112,r4 + VPERM(v23,v23,v23,byteswap) + + addi r4,r4,8*16 + + bdz .Lfirst_cool_down + + /* + * main loop. We modulo schedule it such that it takes three iterations + * to complete - first iteration load, second iteration vpmsum, third + * iteration xor. + */ + .balign 16 +4: lvx const1,0,r3 + addi r3,r3,16 + ori r2,r2,0 + + vxor v0,v0,v8 + VPMSUMD(v8,v16,const2) + lvx v16,0,r4 + VPERM(v16,v16,v16,byteswap) + ori r2,r2,0 + + vxor v1,v1,v9 + VPMSUMD(v9,v17,const2) + lvx v17,off16,r4 + VPERM(v17,v17,v17,byteswap) + ori r2,r2,0 + + vxor v2,v2,v10 + VPMSUMD(v10,v18,const2) + lvx v18,off32,r4 + VPERM(v18,v18,v18,byteswap) + ori r2,r2,0 + + vxor v3,v3,v11 + VPMSUMD(v11,v19,const2) + lvx v19,off48,r4 + VPERM(v19,v19,v19,byteswap) + lvx const2,0,r3 + ori r2,r2,0 + + vxor v4,v4,v12 + VPMSUMD(v12,v20,const1) + lvx v20,off64,r4 + VPERM(v20,v20,v20,byteswap) + ori r2,r2,0 + + vxor v5,v5,v13 + VPMSUMD(v13,v21,const1) + lvx v21,off80,r4 + VPERM(v21,v21,v21,byteswap) + ori r2,r2,0 + + vxor v6,v6,v14 + VPMSUMD(v14,v22,const1) + lvx v22,off96,r4 + VPERM(v22,v22,v22,byteswap) + ori r2,r2,0 + + vxor v7,v7,v15 + VPMSUMD(v15,v23,const1) + lvx v23,off112,r4 + VPERM(v23,v23,v23,byteswap) + + addi r4,r4,8*16 + + bdnz 4b + +.Lfirst_cool_down: + /* First cool down pass */ + lvx const1,0,r3 + addi r3,r3,16 + + vxor v0,v0,v8 + VPMSUMD(v8,v16,const1) + ori r2,r2,0 + + vxor v1,v1,v9 + VPMSUMD(v9,v17,const1) + ori r2,r2,0 + + vxor v2,v2,v10 + VPMSUMD(v10,v18,const1) + ori r2,r2,0 + + vxor v3,v3,v11 + VPMSUMD(v11,v19,const1) + ori r2,r2,0 + + vxor v4,v4,v12 + VPMSUMD(v12,v20,const1) + ori r2,r2,0 + + vxor v5,v5,v13 + VPMSUMD(v13,v21,const1) + ori r2,r2,0 + + vxor v6,v6,v14 + VPMSUMD(v14,v22,const1) + ori r2,r2,0 + + vxor v7,v7,v15 + VPMSUMD(v15,v23,const1) + ori r2,r2,0 + +.Lsecond_cool_down: + /* Second cool down pass */ + vxor v0,v0,v8 + vxor v1,v1,v9 + vxor v2,v2,v10 + vxor v3,v3,v11 + vxor v4,v4,v12 + vxor v5,v5,v13 + vxor v6,v6,v14 + vxor v7,v7,v15 + +#ifdef REFLECT + /* + * vpmsumd produces a 96 bit result in the least significant bits + * of the register. Since we are bit reflected we have to shift it + * left 32 bits so it occupies the least significant bits in the + * bit reflected domain. + */ + vsldoi v0,v0,zeroes,4 + vsldoi v1,v1,zeroes,4 + vsldoi v2,v2,zeroes,4 + vsldoi v3,v3,zeroes,4 + vsldoi v4,v4,zeroes,4 + vsldoi v5,v5,zeroes,4 + vsldoi v6,v6,zeroes,4 + vsldoi v7,v7,zeroes,4 +#endif + + /* xor with last 1024 bits */ + lvx v8,0,r4 + lvx v9,off16,r4 + VPERM(v8,v8,v8,byteswap) + VPERM(v9,v9,v9,byteswap) + lvx v10,off32,r4 + lvx v11,off48,r4 + VPERM(v10,v10,v10,byteswap) + VPERM(v11,v11,v11,byteswap) + lvx v12,off64,r4 + lvx v13,off80,r4 + VPERM(v12,v12,v12,byteswap) + VPERM(v13,v13,v13,byteswap) + lvx v14,off96,r4 + lvx v15,off112,r4 + VPERM(v14,v14,v14,byteswap) + VPERM(v15,v15,v15,byteswap) + + addi r4,r4,8*16 + + vxor v16,v0,v8 + vxor v17,v1,v9 + vxor v18,v2,v10 + vxor v19,v3,v11 + vxor v20,v4,v12 + vxor v21,v5,v13 + vxor v22,v6,v14 + vxor v23,v7,v15 + + li r0,1 + cmpdi r6,0 + addi r6,r6,128 + bne 1b + + /* Work out how many bytes we have left */ + andi. r5,r5,127 + + /* Calculate where in the constant table we need to start */ + subfic r6,r5,128 + add r3,r3,r6 + + /* How many 16 byte chunks are in the tail */ + srdi r7,r5,4 + mtctr r7 + + /* + * Reduce the previously calculated 1024 bits to 64 bits, shifting + * 32 bits to include the trailing 32 bits of zeros + */ + lvx v0,0,r3 + lvx v1,off16,r3 + lvx v2,off32,r3 + lvx v3,off48,r3 + lvx v4,off64,r3 + lvx v5,off80,r3 + lvx v6,off96,r3 + lvx v7,off112,r3 + addi r3,r3,8*16 + + VPMSUMW(v0,v16,v0) + VPMSUMW(v1,v17,v1) + VPMSUMW(v2,v18,v2) + VPMSUMW(v3,v19,v3) + VPMSUMW(v4,v20,v4) + VPMSUMW(v5,v21,v5) + VPMSUMW(v6,v22,v6) + VPMSUMW(v7,v23,v7) + + /* Now reduce the tail (0 - 112 bytes) */ + cmpdi r7,0 + beq 1f + + lvx v16,0,r4 + lvx v17,0,r3 + VPERM(v16,v16,v16,byteswap) + VPMSUMW(v16,v16,v17) + vxor v0,v0,v16 + bdz 1f + + lvx v16,off16,r4 + lvx v17,off16,r3 + VPERM(v16,v16,v16,byteswap) + VPMSUMW(v16,v16,v17) + vxor v0,v0,v16 + bdz 1f + + lvx v16,off32,r4 + lvx v17,off32,r3 + VPERM(v16,v16,v16,byteswap) + VPMSUMW(v16,v16,v17) + vxor v0,v0,v16 + bdz 1f + + lvx v16,off48,r4 + lvx v17,off48,r3 + VPERM(v16,v16,v16,byteswap) + VPMSUMW(v16,v16,v17) + vxor v0,v0,v16 + bdz 1f + + lvx v16,off64,r4 + lvx v17,off64,r3 + VPERM(v16,v16,v16,byteswap) + VPMSUMW(v16,v16,v17) + vxor v0,v0,v16 + bdz 1f + + lvx v16,off80,r4 + lvx v17,off80,r3 + VPERM(v16,v16,v16,byteswap) + VPMSUMW(v16,v16,v17) + vxor v0,v0,v16 + bdz 1f + + lvx v16,off96,r4 + lvx v17,off96,r3 + VPERM(v16,v16,v16,byteswap) + VPMSUMW(v16,v16,v17) + vxor v0,v0,v16 + + /* Now xor all the parallel chunks together */ +1: vxor v0,v0,v1 + vxor v2,v2,v3 + vxor v4,v4,v5 + vxor v6,v6,v7 + + vxor v0,v0,v2 + vxor v4,v4,v6 + + vxor v0,v0,v4 + +.Lbarrett_reduction: + /* Barrett constants */ + addis r3,r2,.barrett_constants@toc@ha + addi r3,r3,.barrett_constants@toc@l + + lvx const1,0,r3 + lvx const2,off16,r3 + + vsldoi v1,v0,v0,8 + vxor v0,v0,v1 /* xor two 64 bit results together */ + +#ifdef REFLECT + /* shift left one bit */ + vspltisb v1,1 + vsl v0,v0,v1 +#endif + + vand v0,v0,mask_64bit + +#ifndef REFLECT + /* + * Now for the Barrett reduction algorithm. The idea is to calculate q, + * the multiple of our polynomial that we need to subtract. By + * doing the computation 2x bits higher (ie 64 bits) and shifting the + * result back down 2x bits, we round down to the nearest multiple. + */ + VPMSUMD(v1,v0,const1) /* ma */ + vsldoi v1,zeroes,v1,8 /* q = floor(ma/(2^64)) */ + VPMSUMD(v1,v1,const2) /* qn */ + vxor v0,v0,v1 /* a - qn, subtraction is xor in GF(2) */ + + /* + * Get the result into r3. We need to shift it left 8 bytes: + * V0 [ 0 1 2 X ] + * V0 [ 0 X 2 3 ] + */ + vsldoi v0,v0,zeroes,8 /* shift result into top 64 bits */ +#else + /* + * The reflected version of Barrett reduction. Instead of bit + * reflecting our data (which is expensive to do), we bit reflect our + * constants and our algorithm, which means the intermediate data in + * our vector registers goes from 0-63 instead of 63-0. We can reflect + * the algorithm because we don't carry in mod 2 arithmetic. + */ + vand v1,v0,mask_32bit /* bottom 32 bits of a */ + VPMSUMD(v1,v1,const1) /* ma */ + vand v1,v1,mask_32bit /* bottom 32bits of ma */ + VPMSUMD(v1,v1,const2) /* qn */ + vxor v0,v0,v1 /* a - qn, subtraction is xor in GF(2) */ + + /* + * Since we are bit reflected, the result (ie the low 32 bits) is in + * the high 32 bits. We just need to shift it left 4 bytes + * V0 [ 0 1 X 3 ] + * V0 [ 0 X 2 3 ] + */ + vsldoi v0,v0,zeroes,4 /* shift result into top 64 bits of */ +#endif + + /* Get it into r3 */ + MFVRD(r3, v0) + +.Lout: + subi r6,r1,56+10*16 + subi r7,r1,56+2*16 + + lvx v20,0,r6 + lvx v21,off16,r6 + lvx v22,off32,r6 + lvx v23,off48,r6 + lvx v24,off64,r6 + lvx v25,off80,r6 + lvx v26,off96,r6 + lvx v27,off112,r6 + lvx v28,0,r7 + lvx v29,off16,r7 + + ld r31,-8(r1) + ld r30,-16(r1) + ld r29,-24(r1) + ld r28,-32(r1) + ld r27,-40(r1) + ld r26,-48(r1) + ld r25,-56(r1) + + blr + +.Lfirst_warm_up_done: + lvx const1,0,r3 + addi r3,r3,16 + + VPMSUMD(v8,v16,const1) + VPMSUMD(v9,v17,const1) + VPMSUMD(v10,v18,const1) + VPMSUMD(v11,v19,const1) + VPMSUMD(v12,v20,const1) + VPMSUMD(v13,v21,const1) + VPMSUMD(v14,v22,const1) + VPMSUMD(v15,v23,const1) + + b .Lsecond_cool_down + +.Lshort: + cmpdi r5,0 + beq .Lzero + + addis r3,r2,.short_constants@toc@ha + addi r3,r3,.short_constants@toc@l + + /* Calculate where in the constant table we need to start */ + subfic r6,r5,256 + add r3,r3,r6 + + /* How many 16 byte chunks? */ + srdi r7,r5,4 + mtctr r7 + + vxor v19,v19,v19 + vxor v20,v20,v20 + + lvx v0,0,r4 + lvx v16,0,r3 + VPERM(v0,v0,v16,byteswap) + vxor v0,v0,v8 /* xor in initial value */ + VPMSUMW(v0,v0,v16) + bdz .Lv0 + + lvx v1,off16,r4 + lvx v17,off16,r3 + VPERM(v1,v1,v17,byteswap) + VPMSUMW(v1,v1,v17) + bdz .Lv1 + + lvx v2,off32,r4 + lvx v16,off32,r3 + VPERM(v2,v2,v16,byteswap) + VPMSUMW(v2,v2,v16) + bdz .Lv2 + + lvx v3,off48,r4 + lvx v17,off48,r3 + VPERM(v3,v3,v17,byteswap) + VPMSUMW(v3,v3,v17) + bdz .Lv3 + + lvx v4,off64,r4 + lvx v16,off64,r3 + VPERM(v4,v4,v16,byteswap) + VPMSUMW(v4,v4,v16) + bdz .Lv4 + + lvx v5,off80,r4 + lvx v17,off80,r3 + VPERM(v5,v5,v17,byteswap) + VPMSUMW(v5,v5,v17) + bdz .Lv5 + + lvx v6,off96,r4 + lvx v16,off96,r3 + VPERM(v6,v6,v16,byteswap) + VPMSUMW(v6,v6,v16) + bdz .Lv6 + + lvx v7,off112,r4 + lvx v17,off112,r3 + VPERM(v7,v7,v17,byteswap) + VPMSUMW(v7,v7,v17) + bdz .Lv7 + + addi r3,r3,128 + addi r4,r4,128 + + lvx v8,0,r4 + lvx v16,0,r3 + VPERM(v8,v8,v16,byteswap) + VPMSUMW(v8,v8,v16) + bdz .Lv8 + + lvx v9,off16,r4 + lvx v17,off16,r3 + VPERM(v9,v9,v17,byteswap) + VPMSUMW(v9,v9,v17) + bdz .Lv9 + + lvx v10,off32,r4 + lvx v16,off32,r3 + VPERM(v10,v10,v16,byteswap) + VPMSUMW(v10,v10,v16) + bdz .Lv10 + + lvx v11,off48,r4 + lvx v17,off48,r3 + VPERM(v11,v11,v17,byteswap) + VPMSUMW(v11,v11,v17) + bdz .Lv11 + + lvx v12,off64,r4 + lvx v16,off64,r3 + VPERM(v12,v12,v16,byteswap) + VPMSUMW(v12,v12,v16) + bdz .Lv12 + + lvx v13,off80,r4 + lvx v17,off80,r3 + VPERM(v13,v13,v17,byteswap) + VPMSUMW(v13,v13,v17) + bdz .Lv13 + + lvx v14,off96,r4 + lvx v16,off96,r3 + VPERM(v14,v14,v16,byteswap) + VPMSUMW(v14,v14,v16) + bdz .Lv14 + + lvx v15,off112,r4 + lvx v17,off112,r3 + VPERM(v15,v15,v17,byteswap) + VPMSUMW(v15,v15,v17) + +.Lv15: vxor v19,v19,v15 +.Lv14: vxor v20,v20,v14 +.Lv13: vxor v19,v19,v13 +.Lv12: vxor v20,v20,v12 +.Lv11: vxor v19,v19,v11 +.Lv10: vxor v20,v20,v10 +.Lv9: vxor v19,v19,v9 +.Lv8: vxor v20,v20,v8 +.Lv7: vxor v19,v19,v7 +.Lv6: vxor v20,v20,v6 +.Lv5: vxor v19,v19,v5 +.Lv4: vxor v20,v20,v4 +.Lv3: vxor v19,v19,v3 +.Lv2: vxor v20,v20,v2 +.Lv1: vxor v19,v19,v1 +.Lv0: vxor v20,v20,v0 + + vxor v0,v19,v20 + + b .Lbarrett_reduction + +.Lzero: + mr r3,r10 + b .Lout + +FUNC_END(CRC32_FUNCTION_ASM) +#endif diff --git a/src/contrib/crc32/crc32_wrapper.c b/src/contrib/crc32/crc32_wrapper.c new file mode 100644 index 0000000..fbf1aa5 --- /dev/null +++ b/src/contrib/crc32/crc32_wrapper.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2015 Anton Blanchard , IBM + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of either: + * + * a) the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version, or + * b) the Apache License, Version 2.0 + */ + +#define CRC_TABLE + +#ifdef CRC32_CONSTANTS_HEADER +#include CRC32_CONSTANTS_HEADER +#else +#include "crc32/crc32_constants.h" +#endif + +#define VMX_ALIGN 16 +#define VMX_ALIGN_MASK (VMX_ALIGN - 1) + +#ifdef REFLECT +static unsigned int crc32_align(unsigned int crc, unsigned char* p, unsigned long len) { + while (len--) + crc = crc_table[(crc ^ *p++) & 0xff] ^ (crc >> 8); + return crc; +} +#else +static unsigned int crc32_align(unsigned int crc, unsigned char* p, unsigned long len) { + while (len--) + crc = crc_table[((crc >> 24) ^ *p++) & 0xff] ^ (crc << 8); + return crc; +} +#endif + +#ifndef CRC32_FUNCTION +#define CRC32_FUNCTION crc32_vpmsum +#endif +#ifndef CRC32_FUNCTION_ASM +#define CRC32_FUNCTION_ASM __crc32_vpmsum +#endif + +unsigned int CRC32_FUNCTION_ASM(unsigned int crc, unsigned char* p, unsigned long len); + +unsigned int CRC32_FUNCTION(unsigned int crc, unsigned char* p, unsigned long len) { +#ifdef __powerpc64 // avoid link failures on systems without CRC32_FUNCTION_ASM declared + unsigned int prealign; + unsigned int tail; + +#ifdef CRC_XOR + crc ^= 0xffffffff; +#endif + + if (len < VMX_ALIGN + VMX_ALIGN_MASK) { + crc = crc32_align(crc, p, len); + goto out; + } + + if ((unsigned long)p & VMX_ALIGN_MASK) { + prealign = VMX_ALIGN - ((unsigned long)p & VMX_ALIGN_MASK); + crc = crc32_align(crc, p, prealign); + len -= prealign; + p += prealign; + } + + crc = CRC32_FUNCTION_ASM(crc, p, len & ~VMX_ALIGN_MASK); + + tail = len & VMX_ALIGN_MASK; + if (tail) { + p += len & ~VMX_ALIGN_MASK; + crc = crc32_align(crc, p, tail); + } + +out: +#ifdef CRC_XOR + crc ^= 0xffffffff; +#endif +#endif + return crc; +} diff --git a/src/flow/crc32c-generated-constants.cpp b/src/contrib/crc32/crc32c-generated-constants.cpp similarity index 100% rename from src/flow/crc32c-generated-constants.cpp rename to src/contrib/crc32/crc32c-generated-constants.cpp diff --git a/src/flow/crc32c.cpp b/src/contrib/crc32/crc32c.cpp similarity index 82% rename from src/flow/crc32c.cpp rename to src/contrib/crc32/crc32c.cpp index 07cfac5..9c3ae6d 100644 --- a/src/flow/crc32c.cpp +++ b/src/contrib/crc32/crc32c.cpp @@ -25,7 +25,21 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "flow/crc32c.h" +#if (defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)) +#define __unixish__ 1 +#endif + +#ifdef __unixish__ +#if !defined(__aarch64__) && !defined(__powerpc64__) +#include +#endif +#endif + +#ifdef _WIN32 +#include +#endif + +#include "crc32/crc32c.h" #if !defined(__aarch64__) && !defined(__powerpc64__) #include @@ -34,9 +48,40 @@ #include #include #include -#include "flow/Platform.h" #include "crc32c-generated-constants.cpp" +// CRC32C +#ifdef __aarch64__ +// aarch64 +#include +static inline uint32_t hwCrc32cU8(unsigned int crc, unsigned char v) { + uint32_t ret; + asm volatile("crc32cb %w[r], %w[c], %w[v]" : [r] "=r"(ret) : [c] "r"(crc), [v] "r"(v)); + return ret; +} +static inline uint32_t hwCrc32cU32(unsigned int crc, unsigned int v) { + uint32_t ret; + asm volatile("crc32cw %w[r], %w[c], %w[v]" : [r] "=r"(ret) : [c] "r"(crc), [v] "r"(v)); + return ret; +} +#ifdef _M_X64 +static inline uint64_t hwCrc32cU64(uint64_t crc, uint64_t v) { + uint64_t ret; + asm volatile("crc32cx %w[r], %w[c], %x[v]" : [r] "=r"(ret) : [c] "r"(crc), [v] "r"(v)); + return ret; +} +#endif +#else +#ifndef __powerpc64__ +// Intel +#define hwCrc32cU8(c, v) _mm_crc32_u8(c, v) +#define hwCrc32cU32(c, v) _mm_crc32_u32(c, v) +#ifdef _M_X64 +#define hwCrc32cU64(c, v) _mm_crc32_u64(c, v) +#endif +#endif +#endif + [[maybe_unused]] static uint32_t append_trivial(uint32_t crc, const uint8_t* input, size_t length) { for (size_t i = 0; i < length; ++i) { crc = crc ^ input[i]; @@ -266,13 +311,46 @@ append_hw(uint32_t crc, const uint8_t* buf, size_t len) { } #endif -static bool hw_available = platform::isHwCrcSupported(); +#ifdef __powerpc64__ +#include "crc32_wrapper.h" + +#ifndef CRC32_FUNCTION +#define CRC32_FUNCTION crc32_vpmsum +#endif + +uint32_t ppc_hw(uint32_t crc, const uint8_t* input, size_t length) { + return CRC32_FUNCTION(0, (unsigned char*)input, (unsigned long)length); +} +#endif + +bool isHwCrcSupported() { +#if defined(_WIN32) + int info[4]; + __cpuid(info, 1); + return (info[2] & (1 << 20)) != 0; +#elif defined(__aarch64__) + return true; /* force to use crc instructions */ +#elif defined(__powerpc64__) + return false; /* force not to use crc instructions */ +#elif defined(__unixish__) + uint32_t eax, ebx, ecx, edx, level = 1, count = 0; + __cpuid_count(level, count, eax, ebx, ecx, edx); + return ((ecx >> 20) & 1) != 0; +#else +#error Port me! +#endif +} + +static bool hw_available = isHwCrcSupported(); extern "C" uint32_t crc32c_append(uint32_t crc, const uint8_t* input, size_t length) { + if (hw_available) { +#ifdef __powerpc64__ + return ppc_hw(crc, input, length); +#endif #ifndef __powerpc64__ - if (hw_available) return append_hw(crc, input, length); - else #endif + } else return append_table(crc, input, length); } diff --git a/src/contrib/crc32/include/crc32/crc32_constants.h b/src/contrib/crc32/include/crc32/crc32_constants.h new file mode 100644 index 0000000..66d575b --- /dev/null +++ b/src/contrib/crc32/include/crc32/crc32_constants.h @@ -0,0 +1,1994 @@ +/* +* +* THIS FILE IS GENERATED WITH +./crc32_constants -r -x 0x11EDC6F41 + +* This is from https://github.com/antonblanchard/crc32-vpmsum/ +* DO NOT MODIFY IT MANUALLY! +* +*/ + +#define CRC 0x1edc6f41 +#define CRC_XOR +#define REFLECT +#define MAX_SIZE 32768 + +#ifndef __ASSEMBLER__ +#ifdef CRC_TABLE +static const unsigned int crc_table[] = { + 0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4, 0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb, 0x8ad958cf, + 0x78b2dbcc, 0x6be22838, 0x9989ab3b, 0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24, 0x105ec76f, 0xe235446c, + 0xf165b798, 0x030e349b, 0xd7c45070, 0x25afd373, 0x36ff2087, 0xc494a384, 0x9a879fa0, 0x68ec1ca3, 0x7bbcef57, + 0x89d76c54, 0x5d1d08bf, 0xaf768bbc, 0xbc267848, 0x4e4dfb4b, 0x20bd8ede, 0xd2d60ddd, 0xc186fe29, 0x33ed7d2a, + 0xe72719c1, 0x154c9ac2, 0x061c6936, 0xf477ea35, 0xaa64d611, 0x580f5512, 0x4b5fa6e6, 0xb93425e5, 0x6dfe410e, + 0x9f95c20d, 0x8cc531f9, 0x7eaeb2fa, 0x30e349b1, 0xc288cab2, 0xd1d83946, 0x23b3ba45, 0xf779deae, 0x05125dad, + 0x1642ae59, 0xe4292d5a, 0xba3a117e, 0x4851927d, 0x5b016189, 0xa96ae28a, 0x7da08661, 0x8fcb0562, 0x9c9bf696, + 0x6ef07595, 0x417b1dbc, 0xb3109ebf, 0xa0406d4b, 0x522bee48, 0x86e18aa3, 0x748a09a0, 0x67dafa54, 0x95b17957, + 0xcba24573, 0x39c9c670, 0x2a993584, 0xd8f2b687, 0x0c38d26c, 0xfe53516f, 0xed03a29b, 0x1f682198, 0x5125dad3, + 0xa34e59d0, 0xb01eaa24, 0x42752927, 0x96bf4dcc, 0x64d4cecf, 0x77843d3b, 0x85efbe38, 0xdbfc821c, 0x2997011f, + 0x3ac7f2eb, 0xc8ac71e8, 0x1c661503, 0xee0d9600, 0xfd5d65f4, 0x0f36e6f7, 0x61c69362, 0x93ad1061, 0x80fde395, + 0x72966096, 0xa65c047d, 0x5437877e, 0x4767748a, 0xb50cf789, 0xeb1fcbad, 0x197448ae, 0x0a24bb5a, 0xf84f3859, + 0x2c855cb2, 0xdeeedfb1, 0xcdbe2c45, 0x3fd5af46, 0x7198540d, 0x83f3d70e, 0x90a324fa, 0x62c8a7f9, 0xb602c312, + 0x44694011, 0x5739b3e5, 0xa55230e6, 0xfb410cc2, 0x092a8fc1, 0x1a7a7c35, 0xe811ff36, 0x3cdb9bdd, 0xceb018de, + 0xdde0eb2a, 0x2f8b6829, 0x82f63b78, 0x709db87b, 0x63cd4b8f, 0x91a6c88c, 0x456cac67, 0xb7072f64, 0xa457dc90, + 0x563c5f93, 0x082f63b7, 0xfa44e0b4, 0xe9141340, 0x1b7f9043, 0xcfb5f4a8, 0x3dde77ab, 0x2e8e845f, 0xdce5075c, + 0x92a8fc17, 0x60c37f14, 0x73938ce0, 0x81f80fe3, 0x55326b08, 0xa759e80b, 0xb4091bff, 0x466298fc, 0x1871a4d8, + 0xea1a27db, 0xf94ad42f, 0x0b21572c, 0xdfeb33c7, 0x2d80b0c4, 0x3ed04330, 0xccbbc033, 0xa24bb5a6, 0x502036a5, + 0x4370c551, 0xb11b4652, 0x65d122b9, 0x97baa1ba, 0x84ea524e, 0x7681d14d, 0x2892ed69, 0xdaf96e6a, 0xc9a99d9e, + 0x3bc21e9d, 0xef087a76, 0x1d63f975, 0x0e330a81, 0xfc588982, 0xb21572c9, 0x407ef1ca, 0x532e023e, 0xa145813d, + 0x758fe5d6, 0x87e466d5, 0x94b49521, 0x66df1622, 0x38cc2a06, 0xcaa7a905, 0xd9f75af1, 0x2b9cd9f2, 0xff56bd19, + 0x0d3d3e1a, 0x1e6dcdee, 0xec064eed, 0xc38d26c4, 0x31e6a5c7, 0x22b65633, 0xd0ddd530, 0x0417b1db, 0xf67c32d8, + 0xe52cc12c, 0x1747422f, 0x49547e0b, 0xbb3ffd08, 0xa86f0efc, 0x5a048dff, 0x8ecee914, 0x7ca56a17, 0x6ff599e3, + 0x9d9e1ae0, 0xd3d3e1ab, 0x21b862a8, 0x32e8915c, 0xc083125f, 0x144976b4, 0xe622f5b7, 0xf5720643, 0x07198540, + 0x590ab964, 0xab613a67, 0xb831c993, 0x4a5a4a90, 0x9e902e7b, 0x6cfbad78, 0x7fab5e8c, 0x8dc0dd8f, 0xe330a81a, + 0x115b2b19, 0x020bd8ed, 0xf0605bee, 0x24aa3f05, 0xd6c1bc06, 0xc5914ff2, 0x37faccf1, 0x69e9f0d5, 0x9b8273d6, + 0x88d28022, 0x7ab90321, 0xae7367ca, 0x5c18e4c9, 0x4f48173d, 0xbd23943e, 0xf36e6f75, 0x0105ec76, 0x12551f82, + 0xe03e9c81, 0x34f4f86a, 0xc69f7b69, 0xd5cf889d, 0x27a40b9e, 0x79b737ba, 0x8bdcb4b9, 0x988c474d, 0x6ae7c44e, + 0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351, +}; + +#endif /* CRC_TABLE */ +#ifdef POWER8_INTRINSICS + +/* Constants */ + +/* Reduce 262144 kbits to 1024 bits */ +static const __vector unsigned long long vcrc_const[255] __attribute__((aligned(16))) = { +#ifdef __LITTLE_ENDIAN__ + /* x^261120 mod p(x)` << 1, x^261184 mod p(x)` << 1 */ + { 0x000000009c37c408, 0x00000000b6ca9e20 }, + /* x^260096 mod p(x)` << 1, x^260160 mod p(x)` << 1 */ + { 0x00000001b51df26c, 0x00000000350249a8 }, + /* x^259072 mod p(x)` << 1, x^259136 mod p(x)` << 1 */ + { 0x000000000724b9d0, 0x00000001862dac54 }, + /* x^258048 mod p(x)` << 1, x^258112 mod p(x)` << 1 */ + { 0x00000001c00532fe, 0x00000001d87fb48c }, + /* x^257024 mod p(x)` << 1, x^257088 mod p(x)` << 1 */ + { 0x00000000f05a9362, 0x00000001f39b699e }, + /* x^256000 mod p(x)` << 1, x^256064 mod p(x)` << 1 */ + { 0x00000001e1007970, 0x0000000101da11b4 }, + /* x^254976 mod p(x)` << 1, x^255040 mod p(x)` << 1 */ + { 0x00000000a57366ee, 0x00000001cab571e0 }, + /* x^253952 mod p(x)` << 1, x^254016 mod p(x)` << 1 */ + { 0x0000000192011284, 0x00000000c7020cfe }, + /* x^252928 mod p(x)` << 1, x^252992 mod p(x)` << 1 */ + { 0x0000000162716d9a, 0x00000000cdaed1ae }, + /* x^251904 mod p(x)` << 1, x^251968 mod p(x)` << 1 */ + { 0x00000000cd97ecde, 0x00000001e804effc }, + /* x^250880 mod p(x)` << 1, x^250944 mod p(x)` << 1 */ + { 0x0000000058812bc0, 0x0000000077c3ea3a }, + /* x^249856 mod p(x)` << 1, x^249920 mod p(x)` << 1 */ + { 0x0000000088b8c12e, 0x0000000068df31b4 }, + /* x^248832 mod p(x)` << 1, x^248896 mod p(x)` << 1 */ + { 0x00000001230b234c, 0x00000000b059b6c2 }, + /* x^247808 mod p(x)` << 1, x^247872 mod p(x)` << 1 */ + { 0x00000001120b416e, 0x0000000145fb8ed8 }, + /* x^246784 mod p(x)` << 1, x^246848 mod p(x)` << 1 */ + { 0x00000001974aecb0, 0x00000000cbc09168 }, + /* x^245760 mod p(x)` << 1, x^245824 mod p(x)` << 1 */ + { 0x000000008ee3f226, 0x000000005ceeedc2 }, + /* x^244736 mod p(x)` << 1, x^244800 mod p(x)` << 1 */ + { 0x00000001089aba9a, 0x0000000047d74e86 }, + /* x^243712 mod p(x)` << 1, x^243776 mod p(x)` << 1 */ + { 0x0000000065113872, 0x00000001407e9e22 }, + /* x^242688 mod p(x)` << 1, x^242752 mod p(x)` << 1 */ + { 0x000000005c07ec10, 0x00000001da967bda }, + /* x^241664 mod p(x)` << 1, x^241728 mod p(x)` << 1 */ + { 0x0000000187590924, 0x000000006c898368 }, + /* x^240640 mod p(x)` << 1, x^240704 mod p(x)` << 1 */ + { 0x00000000e35da7c6, 0x00000000f2d14c98 }, + /* x^239616 mod p(x)` << 1, x^239680 mod p(x)` << 1 */ + { 0x000000000415855a, 0x00000001993c6ad4 }, + /* x^238592 mod p(x)` << 1, x^238656 mod p(x)` << 1 */ + { 0x0000000073617758, 0x000000014683d1ac }, + /* x^237568 mod p(x)` << 1, x^237632 mod p(x)` << 1 */ + { 0x0000000176021d28, 0x00000001a7c93e6c }, + /* x^236544 mod p(x)` << 1, x^236608 mod p(x)` << 1 */ + { 0x00000001c358fd0a, 0x000000010211e90a }, + /* x^235520 mod p(x)` << 1, x^235584 mod p(x)` << 1 */ + { 0x00000001ff7a2c18, 0x000000001119403e }, + /* x^234496 mod p(x)` << 1, x^234560 mod p(x)` << 1 */ + { 0x00000000f2d9f7e4, 0x000000001c3261aa }, + /* x^233472 mod p(x)` << 1, x^233536 mod p(x)` << 1 */ + { 0x000000016cf1f9c8, 0x000000014e37a634 }, + /* x^232448 mod p(x)` << 1, x^232512 mod p(x)` << 1 */ + { 0x000000010af9279a, 0x0000000073786c0c }, + /* x^231424 mod p(x)` << 1, x^231488 mod p(x)` << 1 */ + { 0x0000000004f101e8, 0x000000011dc037f8 }, + /* x^230400 mod p(x)` << 1, x^230464 mod p(x)` << 1 */ + { 0x0000000070bcf184, 0x0000000031433dfc }, + /* x^229376 mod p(x)` << 1, x^229440 mod p(x)` << 1 */ + { 0x000000000a8de642, 0x000000009cde8348 }, + /* x^228352 mod p(x)` << 1, x^228416 mod p(x)` << 1 */ + { 0x0000000062ea130c, 0x0000000038d3c2a6 }, + /* x^227328 mod p(x)` << 1, x^227392 mod p(x)` << 1 */ + { 0x00000001eb31cbb2, 0x000000011b25f260 }, + /* x^226304 mod p(x)` << 1, x^226368 mod p(x)` << 1 */ + { 0x0000000170783448, 0x000000001629e6f0 }, + /* x^225280 mod p(x)` << 1, x^225344 mod p(x)` << 1 */ + { 0x00000001a684b4c6, 0x0000000160838b4c }, + /* x^224256 mod p(x)` << 1, x^224320 mod p(x)` << 1 */ + { 0x00000000253ca5b4, 0x000000007a44011c }, + /* x^223232 mod p(x)` << 1, x^223296 mod p(x)` << 1 */ + { 0x0000000057b4b1e2, 0x00000000226f417a }, + /* x^222208 mod p(x)` << 1, x^222272 mod p(x)` << 1 */ + { 0x00000000b6bd084c, 0x0000000045eb2eb4 }, + /* x^221184 mod p(x)` << 1, x^221248 mod p(x)` << 1 */ + { 0x0000000123c2d592, 0x000000014459d70c }, + /* x^220160 mod p(x)` << 1, x^220224 mod p(x)` << 1 */ + { 0x00000000159dafce, 0x00000001d406ed82 }, + /* x^219136 mod p(x)` << 1, x^219200 mod p(x)` << 1 */ + { 0x0000000127e1a64e, 0x0000000160c8e1a8 }, + /* x^218112 mod p(x)` << 1, x^218176 mod p(x)` << 1 */ + { 0x0000000056860754, 0x0000000027ba8098 }, + /* x^217088 mod p(x)` << 1, x^217152 mod p(x)` << 1 */ + { 0x00000001e661aae8, 0x000000006d92d018 }, + /* x^216064 mod p(x)` << 1, x^216128 mod p(x)` << 1 */ + { 0x00000000f82c6166, 0x000000012ed7e3f2 }, + /* x^215040 mod p(x)` << 1, x^215104 mod p(x)` << 1 */ + { 0x00000000c4f9c7ae, 0x000000002dc87788 }, + /* x^214016 mod p(x)` << 1, x^214080 mod p(x)` << 1 */ + { 0x0000000074203d20, 0x0000000018240bb8 }, + /* x^212992 mod p(x)` << 1, x^213056 mod p(x)` << 1 */ + { 0x0000000198173052, 0x000000001ad38158 }, + /* x^211968 mod p(x)` << 1, x^212032 mod p(x)` << 1 */ + { 0x00000001ce8aba54, 0x00000001396b78f2 }, + /* x^210944 mod p(x)` << 1, x^211008 mod p(x)` << 1 */ + { 0x00000001850d5d94, 0x000000011a681334 }, + /* x^209920 mod p(x)` << 1, x^209984 mod p(x)` << 1 */ + { 0x00000001d609239c, 0x000000012104732e }, + /* x^208896 mod p(x)` << 1, x^208960 mod p(x)` << 1 */ + { 0x000000001595f048, 0x00000000a140d90c }, + /* x^207872 mod p(x)` << 1, x^207936 mod p(x)` << 1 */ + { 0x0000000042ccee08, 0x00000001b7215eda }, + /* x^206848 mod p(x)` << 1, x^206912 mod p(x)` << 1 */ + { 0x000000010a389d74, 0x00000001aaf1df3c }, + /* x^205824 mod p(x)` << 1, x^205888 mod p(x)` << 1 */ + { 0x000000012a840da6, 0x0000000029d15b8a }, + /* x^204800 mod p(x)` << 1, x^204864 mod p(x)` << 1 */ + { 0x000000001d181c0c, 0x00000000f1a96922 }, + /* x^203776 mod p(x)` << 1, x^203840 mod p(x)` << 1 */ + { 0x0000000068b7d1f6, 0x00000001ac80d03c }, + /* x^202752 mod p(x)` << 1, x^202816 mod p(x)` << 1 */ + { 0x000000005b0f14fc, 0x000000000f11d56a }, + /* x^201728 mod p(x)` << 1, x^201792 mod p(x)` << 1 */ + { 0x0000000179e9e730, 0x00000001f1c022a2 }, + /* x^200704 mod p(x)` << 1, x^200768 mod p(x)` << 1 */ + { 0x00000001ce1368d6, 0x0000000173d00ae2 }, + /* x^199680 mod p(x)` << 1, x^199744 mod p(x)` << 1 */ + { 0x0000000112c3a84c, 0x00000001d4ffe4ac }, + /* x^198656 mod p(x)` << 1, x^198720 mod p(x)` << 1 */ + { 0x00000000de940fee, 0x000000016edc5ae4 }, + /* x^197632 mod p(x)` << 1, x^197696 mod p(x)` << 1 */ + { 0x00000000fe896b7e, 0x00000001f1a02140 }, + /* x^196608 mod p(x)` << 1, x^196672 mod p(x)` << 1 */ + { 0x00000001f797431c, 0x00000000ca0b28a0 }, + /* x^195584 mod p(x)` << 1, x^195648 mod p(x)` << 1 */ + { 0x0000000053e989ba, 0x00000001928e30a2 }, + /* x^194560 mod p(x)` << 1, x^194624 mod p(x)` << 1 */ + { 0x000000003920cd16, 0x0000000097b1b002 }, + /* x^193536 mod p(x)` << 1, x^193600 mod p(x)` << 1 */ + { 0x00000001e6f579b8, 0x00000000b15bf906 }, + /* x^192512 mod p(x)` << 1, x^192576 mod p(x)` << 1 */ + { 0x000000007493cb0a, 0x00000000411c5d52 }, + /* x^191488 mod p(x)` << 1, x^191552 mod p(x)` << 1 */ + { 0x00000001bdd376d8, 0x00000001c36f3300 }, + /* x^190464 mod p(x)` << 1, x^190528 mod p(x)` << 1 */ + { 0x000000016badfee6, 0x00000001119227e0 }, + /* x^189440 mod p(x)` << 1, x^189504 mod p(x)` << 1 */ + { 0x0000000071de5c58, 0x00000000114d4702 }, + /* x^188416 mod p(x)` << 1, x^188480 mod p(x)` << 1 */ + { 0x00000000453f317c, 0x00000000458b5b98 }, + /* x^187392 mod p(x)` << 1, x^187456 mod p(x)` << 1 */ + { 0x0000000121675cce, 0x000000012e31fb8e }, + /* x^186368 mod p(x)` << 1, x^186432 mod p(x)` << 1 */ + { 0x00000001f409ee92, 0x000000005cf619d8 }, + /* x^185344 mod p(x)` << 1, x^185408 mod p(x)` << 1 */ + { 0x00000000f36b9c88, 0x0000000063f4d8b2 }, + /* x^184320 mod p(x)` << 1, x^184384 mod p(x)` << 1 */ + { 0x0000000036b398f4, 0x000000004138dc8a }, + /* x^183296 mod p(x)` << 1, x^183360 mod p(x)` << 1 */ + { 0x00000001748f9adc, 0x00000001d29ee8e0 }, + /* x^182272 mod p(x)` << 1, x^182336 mod p(x)` << 1 */ + { 0x00000001be94ec00, 0x000000006a08ace8 }, + /* x^181248 mod p(x)` << 1, x^181312 mod p(x)` << 1 */ + { 0x00000000b74370d6, 0x0000000127d42010 }, + /* x^180224 mod p(x)` << 1, x^180288 mod p(x)` << 1 */ + { 0x00000001174d0b98, 0x0000000019d76b62 }, + /* x^179200 mod p(x)` << 1, x^179264 mod p(x)` << 1 */ + { 0x00000000befc06a4, 0x00000001b1471f6e }, + /* x^178176 mod p(x)` << 1, x^178240 mod p(x)` << 1 */ + { 0x00000001ae125288, 0x00000001f64c19cc }, + /* x^177152 mod p(x)` << 1, x^177216 mod p(x)` << 1 */ + { 0x0000000095c19b34, 0x00000000003c0ea0 }, + /* x^176128 mod p(x)` << 1, x^176192 mod p(x)` << 1 */ + { 0x00000001a78496f2, 0x000000014d73abf6 }, + /* x^175104 mod p(x)` << 1, x^175168 mod p(x)` << 1 */ + { 0x00000001ac5390a0, 0x00000001620eb844 }, + /* x^174080 mod p(x)` << 1, x^174144 mod p(x)` << 1 */ + { 0x000000002a80ed6e, 0x0000000147655048 }, + /* x^173056 mod p(x)` << 1, x^173120 mod p(x)` << 1 */ + { 0x00000001fa9b0128, 0x0000000067b5077e }, + /* x^172032 mod p(x)` << 1, x^172096 mod p(x)` << 1 */ + { 0x00000001ea94929e, 0x0000000010ffe206 }, + /* x^171008 mod p(x)` << 1, x^171072 mod p(x)` << 1 */ + { 0x0000000125f4305c, 0x000000000fee8f1e }, + /* x^169984 mod p(x)` << 1, x^170048 mod p(x)` << 1 */ + { 0x00000001471e2002, 0x00000001da26fbae }, + /* x^168960 mod p(x)` << 1, x^169024 mod p(x)` << 1 */ + { 0x0000000132d2253a, 0x00000001b3a8bd88 }, + /* x^167936 mod p(x)` << 1, x^168000 mod p(x)` << 1 */ + { 0x00000000f26b3592, 0x00000000e8f3898e }, + /* x^166912 mod p(x)` << 1, x^166976 mod p(x)` << 1 */ + { 0x00000000bc8b67b0, 0x00000000b0d0d28c }, + /* x^165888 mod p(x)` << 1, x^165952 mod p(x)` << 1 */ + { 0x000000013a826ef2, 0x0000000030f2a798 }, + /* x^164864 mod p(x)` << 1, x^164928 mod p(x)` << 1 */ + { 0x0000000081482c84, 0x000000000fba1002 }, + /* x^163840 mod p(x)` << 1, x^163904 mod p(x)` << 1 */ + { 0x00000000e77307c2, 0x00000000bdb9bd72 }, + /* x^162816 mod p(x)` << 1, x^162880 mod p(x)` << 1 */ + { 0x00000000d4a07ec8, 0x0000000075d3bf5a }, + /* x^161792 mod p(x)` << 1, x^161856 mod p(x)` << 1 */ + { 0x0000000017102100, 0x00000000ef1f98a0 }, + /* x^160768 mod p(x)` << 1, x^160832 mod p(x)` << 1 */ + { 0x00000000db406486, 0x00000000689c7602 }, + /* x^159744 mod p(x)` << 1, x^159808 mod p(x)` << 1 */ + { 0x0000000192db7f88, 0x000000016d5fa5fe }, + /* x^158720 mod p(x)` << 1, x^158784 mod p(x)` << 1 */ + { 0x000000018bf67b1e, 0x00000001d0d2b9ca }, + /* x^157696 mod p(x)` << 1, x^157760 mod p(x)` << 1 */ + { 0x000000007c09163e, 0x0000000041e7b470 }, + /* x^156672 mod p(x)` << 1, x^156736 mod p(x)` << 1 */ + { 0x000000000adac060, 0x00000001cbb6495e }, + /* x^155648 mod p(x)` << 1, x^155712 mod p(x)` << 1 */ + { 0x00000000bd8316ae, 0x000000010052a0b0 }, + /* x^154624 mod p(x)` << 1, x^154688 mod p(x)` << 1 */ + { 0x000000019f09ab54, 0x00000001d8effb5c }, + /* x^153600 mod p(x)` << 1, x^153664 mod p(x)` << 1 */ + { 0x0000000125155542, 0x00000001d969853c }, + /* x^152576 mod p(x)` << 1, x^152640 mod p(x)` << 1 */ + { 0x000000018fdb5882, 0x00000000523ccce2 }, + /* x^151552 mod p(x)` << 1, x^151616 mod p(x)` << 1 */ + { 0x00000000e794b3f4, 0x000000001e2436bc }, + /* x^150528 mod p(x)` << 1, x^150592 mod p(x)` << 1 */ + { 0x000000016f9bb022, 0x00000000ddd1c3a2 }, + /* x^149504 mod p(x)` << 1, x^149568 mod p(x)` << 1 */ + { 0x00000000290c9978, 0x0000000019fcfe38 }, + /* x^148480 mod p(x)` << 1, x^148544 mod p(x)` << 1 */ + { 0x0000000083c0f350, 0x00000001ce95db64 }, + /* x^147456 mod p(x)` << 1, x^147520 mod p(x)` << 1 */ + { 0x0000000173ea6628, 0x00000000af582806 }, + /* x^146432 mod p(x)` << 1, x^146496 mod p(x)` << 1 */ + { 0x00000001c8b4e00a, 0x00000001006388f6 }, + /* x^145408 mod p(x)` << 1, x^145472 mod p(x)` << 1 */ + { 0x00000000de95d6aa, 0x0000000179eca00a }, + /* x^144384 mod p(x)` << 1, x^144448 mod p(x)` << 1 */ + { 0x000000010b7f7248, 0x0000000122410a6a }, + /* x^143360 mod p(x)` << 1, x^143424 mod p(x)` << 1 */ + { 0x00000001326e3a06, 0x000000004288e87c }, + /* x^142336 mod p(x)` << 1, x^142400 mod p(x)` << 1 */ + { 0x00000000bb62c2e6, 0x000000016c5490da }, + /* x^141312 mod p(x)` << 1, x^141376 mod p(x)` << 1 */ + { 0x0000000156a4b2c2, 0x00000000d1c71f6e }, + /* x^140288 mod p(x)` << 1, x^140352 mod p(x)` << 1 */ + { 0x000000011dfe763a, 0x00000001b4ce08a6 }, + /* x^139264 mod p(x)` << 1, x^139328 mod p(x)` << 1 */ + { 0x000000007bcca8e2, 0x00000001466ba60c }, + /* x^138240 mod p(x)` << 1, x^138304 mod p(x)` << 1 */ + { 0x0000000186118faa, 0x00000001f6c488a4 }, + /* x^137216 mod p(x)` << 1, x^137280 mod p(x)` << 1 */ + { 0x0000000111a65a88, 0x000000013bfb0682 }, + /* x^136192 mod p(x)` << 1, x^136256 mod p(x)` << 1 */ + { 0x000000003565e1c4, 0x00000000690e9e54 }, + /* x^135168 mod p(x)` << 1, x^135232 mod p(x)` << 1 */ + { 0x000000012ed02a82, 0x00000000281346b6 }, + /* x^134144 mod p(x)` << 1, x^134208 mod p(x)` << 1 */ + { 0x00000000c486ecfc, 0x0000000156464024 }, + /* x^133120 mod p(x)` << 1, x^133184 mod p(x)` << 1 */ + { 0x0000000001b951b2, 0x000000016063a8dc }, + /* x^132096 mod p(x)` << 1, x^132160 mod p(x)` << 1 */ + { 0x0000000048143916, 0x0000000116a66362 }, + /* x^131072 mod p(x)` << 1, x^131136 mod p(x)` << 1 */ + { 0x00000001dc2ae124, 0x000000017e8aa4d2 }, + /* x^130048 mod p(x)` << 1, x^130112 mod p(x)` << 1 */ + { 0x00000001416c58d6, 0x00000001728eb10c }, + /* x^129024 mod p(x)` << 1, x^129088 mod p(x)` << 1 */ + { 0x00000000a479744a, 0x00000001b08fd7fa }, + /* x^128000 mod p(x)` << 1, x^128064 mod p(x)` << 1 */ + { 0x0000000096ca3a26, 0x00000001092a16e8 }, + /* x^126976 mod p(x)` << 1, x^127040 mod p(x)` << 1 */ + { 0x00000000ff223d4e, 0x00000000a505637c }, + /* x^125952 mod p(x)` << 1, x^126016 mod p(x)` << 1 */ + { 0x000000010e84da42, 0x00000000d94869b2 }, + /* x^124928 mod p(x)` << 1, x^124992 mod p(x)` << 1 */ + { 0x00000001b61ba3d0, 0x00000001c8b203ae }, + /* x^123904 mod p(x)` << 1, x^123968 mod p(x)` << 1 */ + { 0x00000000680f2de8, 0x000000005704aea0 }, + /* x^122880 mod p(x)` << 1, x^122944 mod p(x)` << 1 */ + { 0x000000008772a9a8, 0x000000012e295fa2 }, + /* x^121856 mod p(x)` << 1, x^121920 mod p(x)` << 1 */ + { 0x0000000155f295bc, 0x000000011d0908bc }, + /* x^120832 mod p(x)` << 1, x^120896 mod p(x)` << 1 */ + { 0x00000000595f9282, 0x0000000193ed97ea }, + /* x^119808 mod p(x)` << 1, x^119872 mod p(x)` << 1 */ + { 0x0000000164b1c25a, 0x000000013a0f1c52 }, + /* x^118784 mod p(x)` << 1, x^118848 mod p(x)` << 1 */ + { 0x00000000fbd67c50, 0x000000010c2c40c0 }, + /* x^117760 mod p(x)` << 1, x^117824 mod p(x)` << 1 */ + { 0x0000000096076268, 0x00000000ff6fac3e }, + /* x^116736 mod p(x)` << 1, x^116800 mod p(x)` << 1 */ + { 0x00000001d288e4cc, 0x000000017b3609c0 }, + /* x^115712 mod p(x)` << 1, x^115776 mod p(x)` << 1 */ + { 0x00000001eaac1bdc, 0x0000000088c8c922 }, + /* x^114688 mod p(x)` << 1, x^114752 mod p(x)` << 1 */ + { 0x00000001f1ea39e2, 0x00000001751baae6 }, + /* x^113664 mod p(x)` << 1, x^113728 mod p(x)` << 1 */ + { 0x00000001eb6506fc, 0x0000000107952972 }, + /* x^112640 mod p(x)` << 1, x^112704 mod p(x)` << 1 */ + { 0x000000010f806ffe, 0x0000000162b00abe }, + /* x^111616 mod p(x)` << 1, x^111680 mod p(x)` << 1 */ + { 0x000000010408481e, 0x000000000d7b404c }, + /* x^110592 mod p(x)` << 1, x^110656 mod p(x)` << 1 */ + { 0x0000000188260534, 0x00000000763b13d4 }, + /* x^109568 mod p(x)` << 1, x^109632 mod p(x)` << 1 */ + { 0x0000000058fc73e0, 0x00000000f6dc22d8 }, + /* x^108544 mod p(x)` << 1, x^108608 mod p(x)` << 1 */ + { 0x00000000391c59b8, 0x000000007daae060 }, + /* x^107520 mod p(x)` << 1, x^107584 mod p(x)` << 1 */ + { 0x000000018b638400, 0x000000013359ab7c }, + /* x^106496 mod p(x)` << 1, x^106560 mod p(x)` << 1 */ + { 0x000000011738f5c4, 0x000000008add438a }, + /* x^105472 mod p(x)` << 1, x^105536 mod p(x)` << 1 */ + { 0x000000008cf7c6da, 0x00000001edbefdea }, + /* x^104448 mod p(x)` << 1, x^104512 mod p(x)` << 1 */ + { 0x00000001ef97fb16, 0x000000004104e0f8 }, + /* x^103424 mod p(x)` << 1, x^103488 mod p(x)` << 1 */ + { 0x0000000102130e20, 0x00000000b48a8222 }, + /* x^102400 mod p(x)` << 1, x^102464 mod p(x)` << 1 */ + { 0x00000000db968898, 0x00000001bcb46844 }, + /* x^101376 mod p(x)` << 1, x^101440 mod p(x)` << 1 */ + { 0x00000000b5047b5e, 0x000000013293ce0a }, + /* x^100352 mod p(x)` << 1, x^100416 mod p(x)` << 1 */ + { 0x000000010b90fdb2, 0x00000001710d0844 }, + /* x^99328 mod p(x)` << 1, x^99392 mod p(x)` << 1 */ + { 0x000000004834a32e, 0x0000000117907f6e }, + /* x^98304 mod p(x)` << 1, x^98368 mod p(x)` << 1 */ + { 0x0000000059c8f2b0, 0x0000000087ddf93e }, + /* x^97280 mod p(x)` << 1, x^97344 mod p(x)` << 1 */ + { 0x0000000122cec508, 0x000000005970e9b0 }, + /* x^96256 mod p(x)` << 1, x^96320 mod p(x)` << 1 */ + { 0x000000000a330cda, 0x0000000185b2b7d0 }, + /* x^95232 mod p(x)` << 1, x^95296 mod p(x)` << 1 */ + { 0x000000014a47148c, 0x00000001dcee0efc }, + /* x^94208 mod p(x)` << 1, x^94272 mod p(x)` << 1 */ + { 0x0000000042c61cb8, 0x0000000030da2722 }, + /* x^93184 mod p(x)` << 1, x^93248 mod p(x)` << 1 */ + { 0x0000000012fe6960, 0x000000012f925a18 }, + /* x^92160 mod p(x)` << 1, x^92224 mod p(x)` << 1 */ + { 0x00000000dbda2c20, 0x00000000dd2e357c }, + /* x^91136 mod p(x)` << 1, x^91200 mod p(x)` << 1 */ + { 0x000000011122410c, 0x00000000071c80de }, + /* x^90112 mod p(x)` << 1, x^90176 mod p(x)` << 1 */ + { 0x00000000977b2070, 0x000000011513140a }, + /* x^89088 mod p(x)` << 1, x^89152 mod p(x)` << 1 */ + { 0x000000014050438e, 0x00000001df876e8e }, + /* x^88064 mod p(x)` << 1, x^88128 mod p(x)` << 1 */ + { 0x0000000147c840e8, 0x000000015f81d6ce }, + /* x^87040 mod p(x)` << 1, x^87104 mod p(x)` << 1 */ + { 0x00000001cc7c88ce, 0x000000019dd94dbe }, + /* x^86016 mod p(x)` << 1, x^86080 mod p(x)` << 1 */ + { 0x00000001476b35a4, 0x00000001373d206e }, + /* x^84992 mod p(x)` << 1, x^85056 mod p(x)` << 1 */ + { 0x000000013d52d508, 0x00000000668ccade }, + /* x^83968 mod p(x)` << 1, x^84032 mod p(x)` << 1 */ + { 0x000000008e4be32e, 0x00000001b192d268 }, + /* x^82944 mod p(x)` << 1, x^83008 mod p(x)` << 1 */ + { 0x00000000024120fe, 0x00000000e30f3a78 }, + /* x^81920 mod p(x)` << 1, x^81984 mod p(x)` << 1 */ + { 0x00000000ddecddb4, 0x000000010ef1f7bc }, + /* x^80896 mod p(x)` << 1, x^80960 mod p(x)` << 1 */ + { 0x00000000d4d403bc, 0x00000001f5ac7380 }, + /* x^79872 mod p(x)` << 1, x^79936 mod p(x)` << 1 */ + { 0x00000001734b89aa, 0x000000011822ea70 }, + /* x^78848 mod p(x)` << 1, x^78912 mod p(x)` << 1 */ + { 0x000000010e7a58d6, 0x00000000c3a33848 }, + /* x^77824 mod p(x)` << 1, x^77888 mod p(x)` << 1 */ + { 0x00000001f9f04e9c, 0x00000001bd151c24 }, + /* x^76800 mod p(x)` << 1, x^76864 mod p(x)` << 1 */ + { 0x00000000b692225e, 0x0000000056002d76 }, + /* x^75776 mod p(x)` << 1, x^75840 mod p(x)` << 1 */ + { 0x000000019b8d3f3e, 0x000000014657c4f4 }, + /* x^74752 mod p(x)` << 1, x^74816 mod p(x)` << 1 */ + { 0x00000001a874f11e, 0x0000000113742d7c }, + /* x^73728 mod p(x)` << 1, x^73792 mod p(x)` << 1 */ + { 0x000000010d5a4254, 0x000000019c5920ba }, + /* x^72704 mod p(x)` << 1, x^72768 mod p(x)` << 1 */ + { 0x00000000bbb2f5d6, 0x000000005216d2d6 }, + /* x^71680 mod p(x)` << 1, x^71744 mod p(x)` << 1 */ + { 0x0000000179cc0e36, 0x0000000136f5ad8a }, + /* x^70656 mod p(x)` << 1, x^70720 mod p(x)` << 1 */ + { 0x00000001dca1da4a, 0x000000018b07beb6 }, + /* x^69632 mod p(x)` << 1, x^69696 mod p(x)` << 1 */ + { 0x00000000feb1a192, 0x00000000db1e93b0 }, + /* x^68608 mod p(x)` << 1, x^68672 mod p(x)` << 1 */ + { 0x00000000d1eeedd6, 0x000000000b96fa3a }, + /* x^67584 mod p(x)` << 1, x^67648 mod p(x)` << 1 */ + { 0x000000008fad9bb4, 0x00000001d9968af0 }, + /* x^66560 mod p(x)` << 1, x^66624 mod p(x)` << 1 */ + { 0x00000001884938e4, 0x000000000e4a77a2 }, + /* x^65536 mod p(x)` << 1, x^65600 mod p(x)` << 1 */ + { 0x00000001bc2e9bc0, 0x00000000508c2ac8 }, + /* x^64512 mod p(x)` << 1, x^64576 mod p(x)` << 1 */ + { 0x00000001f9658a68, 0x0000000021572a80 }, + /* x^63488 mod p(x)` << 1, x^63552 mod p(x)` << 1 */ + { 0x000000001b9224fc, 0x00000001b859daf2 }, + /* x^62464 mod p(x)` << 1, x^62528 mod p(x)` << 1 */ + { 0x0000000055b2fb84, 0x000000016f788474 }, + /* x^61440 mod p(x)` << 1, x^61504 mod p(x)` << 1 */ + { 0x000000018b090348, 0x00000001b438810e }, + /* x^60416 mod p(x)` << 1, x^60480 mod p(x)` << 1 */ + { 0x000000011ccbd5ea, 0x0000000095ddc6f2 }, + /* x^59392 mod p(x)` << 1, x^59456 mod p(x)` << 1 */ + { 0x0000000007ae47f8, 0x00000001d977c20c }, + /* x^58368 mod p(x)` << 1, x^58432 mod p(x)` << 1 */ + { 0x0000000172acbec0, 0x00000000ebedb99a }, + /* x^57344 mod p(x)` << 1, x^57408 mod p(x)` << 1 */ + { 0x00000001c6e3ff20, 0x00000001df9e9e92 }, + /* x^56320 mod p(x)` << 1, x^56384 mod p(x)` << 1 */ + { 0x00000000e1b38744, 0x00000001a4a3f952 }, + /* x^55296 mod p(x)` << 1, x^55360 mod p(x)` << 1 */ + { 0x00000000791585b2, 0x00000000e2f51220 }, + /* x^54272 mod p(x)` << 1, x^54336 mod p(x)` << 1 */ + { 0x00000000ac53b894, 0x000000004aa01f3e }, + /* x^53248 mod p(x)` << 1, x^53312 mod p(x)` << 1 */ + { 0x00000001ed5f2cf4, 0x00000000b3e90a58 }, + /* x^52224 mod p(x)` << 1, x^52288 mod p(x)` << 1 */ + { 0x00000001df48b2e0, 0x000000000c9ca2aa }, + /* x^51200 mod p(x)` << 1, x^51264 mod p(x)` << 1 */ + { 0x00000000049c1c62, 0x0000000151682316 }, + /* x^50176 mod p(x)` << 1, x^50240 mod p(x)` << 1 */ + { 0x000000017c460c12, 0x0000000036fce78c }, + /* x^49152 mod p(x)` << 1, x^49216 mod p(x)` << 1 */ + { 0x000000015be4da7e, 0x000000009037dc10 }, + /* x^48128 mod p(x)` << 1, x^48192 mod p(x)` << 1 */ + { 0x000000010f38f668, 0x00000000d3298582 }, + /* x^47104 mod p(x)` << 1, x^47168 mod p(x)` << 1 */ + { 0x0000000039f40a00, 0x00000001b42e8ad6 }, + /* x^46080 mod p(x)` << 1, x^46144 mod p(x)` << 1 */ + { 0x00000000bd4c10c4, 0x00000000142a9838 }, + /* x^45056 mod p(x)` << 1, x^45120 mod p(x)` << 1 */ + { 0x0000000042db1d98, 0x0000000109c7f190 }, + /* x^44032 mod p(x)` << 1, x^44096 mod p(x)` << 1 */ + { 0x00000001c905bae6, 0x0000000056ff9310 }, + /* x^43008 mod p(x)` << 1, x^43072 mod p(x)` << 1 */ + { 0x00000000069d40ea, 0x00000001594513aa }, + /* x^41984 mod p(x)` << 1, x^42048 mod p(x)` << 1 */ + { 0x000000008e4fbad0, 0x00000001e3b5b1e8 }, + /* x^40960 mod p(x)` << 1, x^41024 mod p(x)` << 1 */ + { 0x0000000047bedd46, 0x000000011dd5fc08 }, + /* x^39936 mod p(x)` << 1, x^40000 mod p(x)` << 1 */ + { 0x0000000026396bf8, 0x00000001675f0cc2 }, + /* x^38912 mod p(x)` << 1, x^38976 mod p(x)` << 1 */ + { 0x00000000379beb92, 0x00000000d1c8dd44 }, + /* x^37888 mod p(x)` << 1, x^37952 mod p(x)` << 1 */ + { 0x000000000abae54a, 0x0000000115ebd3d8 }, + /* x^36864 mod p(x)` << 1, x^36928 mod p(x)` << 1 */ + { 0x0000000007e6a128, 0x00000001ecbd0dac }, + /* x^35840 mod p(x)` << 1, x^35904 mod p(x)` << 1 */ + { 0x000000000ade29d2, 0x00000000cdf67af2 }, + /* x^34816 mod p(x)` << 1, x^34880 mod p(x)` << 1 */ + { 0x00000000f974c45c, 0x000000004c01ff4c }, + /* x^33792 mod p(x)` << 1, x^33856 mod p(x)` << 1 */ + { 0x00000000e77ac60a, 0x00000000f2d8657e }, + /* x^32768 mod p(x)` << 1, x^32832 mod p(x)` << 1 */ + { 0x0000000145895816, 0x000000006bae74c4 }, + /* x^31744 mod p(x)` << 1, x^31808 mod p(x)` << 1 */ + { 0x0000000038e362be, 0x0000000152af8aa0 }, + /* x^30720 mod p(x)` << 1, x^30784 mod p(x)` << 1 */ + { 0x000000007f991a64, 0x0000000004663802 }, + /* x^29696 mod p(x)` << 1, x^29760 mod p(x)` << 1 */ + { 0x00000000fa366d3a, 0x00000001ab2f5afc }, + /* x^28672 mod p(x)` << 1, x^28736 mod p(x)` << 1 */ + { 0x00000001a2bb34f0, 0x0000000074a4ebd4 }, + /* x^27648 mod p(x)` << 1, x^27712 mod p(x)` << 1 */ + { 0x0000000028a9981e, 0x00000001d7ab3a4c }, + /* x^26624 mod p(x)` << 1, x^26688 mod p(x)` << 1 */ + { 0x00000001dbc672be, 0x00000001a8da60c6 }, + /* x^25600 mod p(x)` << 1, x^25664 mod p(x)` << 1 */ + { 0x00000000b04d77f6, 0x000000013cf63820 }, + /* x^24576 mod p(x)` << 1, x^24640 mod p(x)` << 1 */ + { 0x0000000124400d96, 0x00000000bec12e1e }, + /* x^23552 mod p(x)` << 1, x^23616 mod p(x)` << 1 */ + { 0x000000014ca4b414, 0x00000001c6368010 }, + /* x^22528 mod p(x)` << 1, x^22592 mod p(x)` << 1 */ + { 0x000000012fe2c938, 0x00000001e6e78758 }, + /* x^21504 mod p(x)` << 1, x^21568 mod p(x)` << 1 */ + { 0x00000001faed01e6, 0x000000008d7f2b3c }, + /* x^20480 mod p(x)` << 1, x^20544 mod p(x)` << 1 */ + { 0x000000007e80ecfe, 0x000000016b4a156e }, + /* x^19456 mod p(x)` << 1, x^19520 mod p(x)` << 1 */ + { 0x0000000098daee94, 0x00000001c63cfeb6 }, + /* x^18432 mod p(x)` << 1, x^18496 mod p(x)` << 1 */ + { 0x000000010a04edea, 0x000000015f902670 }, + /* x^17408 mod p(x)` << 1, x^17472 mod p(x)` << 1 */ + { 0x00000001c00b4524, 0x00000001cd5de11e }, + /* x^16384 mod p(x)` << 1, x^16448 mod p(x)` << 1 */ + { 0x0000000170296550, 0x000000001acaec54 }, + /* x^15360 mod p(x)` << 1, x^15424 mod p(x)` << 1 */ + { 0x0000000181afaa48, 0x000000002bd0ca78 }, + /* x^14336 mod p(x)` << 1, x^14400 mod p(x)` << 1 */ + { 0x0000000185a31ffa, 0x0000000032d63d5c }, + /* x^13312 mod p(x)` << 1, x^13376 mod p(x)` << 1 */ + { 0x000000002469f608, 0x000000001c6d4e4c }, + /* x^12288 mod p(x)` << 1, x^12352 mod p(x)` << 1 */ + { 0x000000006980102a, 0x0000000106a60b92 }, + /* x^11264 mod p(x)` << 1, x^11328 mod p(x)` << 1 */ + { 0x0000000111ea9ca8, 0x00000000d3855e12 }, + /* x^10240 mod p(x)` << 1, x^10304 mod p(x)` << 1 */ + { 0x00000001bd1d29ce, 0x00000000e3125636 }, + /* x^9216 mod p(x)` << 1, x^9280 mod p(x)` << 1 */ + { 0x00000001b34b9580, 0x000000009e8f7ea4 }, + /* x^8192 mod p(x)` << 1, x^8256 mod p(x)` << 1 */ + { 0x000000003076054e, 0x00000001c82e562c }, + /* x^7168 mod p(x)` << 1, x^7232 mod p(x)` << 1 */ + { 0x000000012a608ea4, 0x00000000ca9f09ce }, + /* x^6144 mod p(x)` << 1, x^6208 mod p(x)` << 1 */ + { 0x00000000784d05fe, 0x00000000c63764e6 }, + /* x^5120 mod p(x)` << 1, x^5184 mod p(x)` << 1 */ + { 0x000000016ef0d82a, 0x0000000168d2e49e }, + /* x^4096 mod p(x)` << 1, x^4160 mod p(x)` << 1 */ + { 0x0000000075bda454, 0x00000000e986c148 }, + /* x^3072 mod p(x)` << 1, x^3136 mod p(x)` << 1 */ + { 0x000000003dc0a1c4, 0x00000000cfb65894 }, + /* x^2048 mod p(x)` << 1, x^2112 mod p(x)` << 1 */ + { 0x00000000e9a5d8be, 0x0000000111cadee4 }, + /* x^1024 mod p(x)` << 1, x^1088 mod p(x)` << 1 */ + { 0x00000001609bc4b4, 0x0000000171fb63ce } +#else /* __LITTLE_ENDIAN__ */ + /* x^261120 mod p(x)` << 1, x^261184 mod p(x)` << 1 */ + { 0x00000000b6ca9e20, 0x000000009c37c408 }, + /* x^260096 mod p(x)` << 1, x^260160 mod p(x)` << 1 */ + { 0x00000000350249a8, 0x00000001b51df26c }, + /* x^259072 mod p(x)` << 1, x^259136 mod p(x)` << 1 */ + { 0x00000001862dac54, 0x000000000724b9d0 }, + /* x^258048 mod p(x)` << 1, x^258112 mod p(x)` << 1 */ + { 0x00000001d87fb48c, 0x00000001c00532fe }, + /* x^257024 mod p(x)` << 1, x^257088 mod p(x)` << 1 */ + { 0x00000001f39b699e, 0x00000000f05a9362 }, + /* x^256000 mod p(x)` << 1, x^256064 mod p(x)` << 1 */ + { 0x0000000101da11b4, 0x00000001e1007970 }, + /* x^254976 mod p(x)` << 1, x^255040 mod p(x)` << 1 */ + { 0x00000001cab571e0, 0x00000000a57366ee }, + /* x^253952 mod p(x)` << 1, x^254016 mod p(x)` << 1 */ + { 0x00000000c7020cfe, 0x0000000192011284 }, + /* x^252928 mod p(x)` << 1, x^252992 mod p(x)` << 1 */ + { 0x00000000cdaed1ae, 0x0000000162716d9a }, + /* x^251904 mod p(x)` << 1, x^251968 mod p(x)` << 1 */ + { 0x00000001e804effc, 0x00000000cd97ecde }, + /* x^250880 mod p(x)` << 1, x^250944 mod p(x)` << 1 */ + { 0x0000000077c3ea3a, 0x0000000058812bc0 }, + /* x^249856 mod p(x)` << 1, x^249920 mod p(x)` << 1 */ + { 0x0000000068df31b4, 0x0000000088b8c12e }, + /* x^248832 mod p(x)` << 1, x^248896 mod p(x)` << 1 */ + { 0x00000000b059b6c2, 0x00000001230b234c }, + /* x^247808 mod p(x)` << 1, x^247872 mod p(x)` << 1 */ + { 0x0000000145fb8ed8, 0x00000001120b416e }, + /* x^246784 mod p(x)` << 1, x^246848 mod p(x)` << 1 */ + { 0x00000000cbc09168, 0x00000001974aecb0 }, + /* x^245760 mod p(x)` << 1, x^245824 mod p(x)` << 1 */ + { 0x000000005ceeedc2, 0x000000008ee3f226 }, + /* x^244736 mod p(x)` << 1, x^244800 mod p(x)` << 1 */ + { 0x0000000047d74e86, 0x00000001089aba9a }, + /* x^243712 mod p(x)` << 1, x^243776 mod p(x)` << 1 */ + { 0x00000001407e9e22, 0x0000000065113872 }, + /* x^242688 mod p(x)` << 1, x^242752 mod p(x)` << 1 */ + { 0x00000001da967bda, 0x000000005c07ec10 }, + /* x^241664 mod p(x)` << 1, x^241728 mod p(x)` << 1 */ + { 0x000000006c898368, 0x0000000187590924 }, + /* x^240640 mod p(x)` << 1, x^240704 mod p(x)` << 1 */ + { 0x00000000f2d14c98, 0x00000000e35da7c6 }, + /* x^239616 mod p(x)` << 1, x^239680 mod p(x)` << 1 */ + { 0x00000001993c6ad4, 0x000000000415855a }, + /* x^238592 mod p(x)` << 1, x^238656 mod p(x)` << 1 */ + { 0x000000014683d1ac, 0x0000000073617758 }, + /* x^237568 mod p(x)` << 1, x^237632 mod p(x)` << 1 */ + { 0x00000001a7c93e6c, 0x0000000176021d28 }, + /* x^236544 mod p(x)` << 1, x^236608 mod p(x)` << 1 */ + { 0x000000010211e90a, 0x00000001c358fd0a }, + /* x^235520 mod p(x)` << 1, x^235584 mod p(x)` << 1 */ + { 0x000000001119403e, 0x00000001ff7a2c18 }, + /* x^234496 mod p(x)` << 1, x^234560 mod p(x)` << 1 */ + { 0x000000001c3261aa, 0x00000000f2d9f7e4 }, + /* x^233472 mod p(x)` << 1, x^233536 mod p(x)` << 1 */ + { 0x000000014e37a634, 0x000000016cf1f9c8 }, + /* x^232448 mod p(x)` << 1, x^232512 mod p(x)` << 1 */ + { 0x0000000073786c0c, 0x000000010af9279a }, + /* x^231424 mod p(x)` << 1, x^231488 mod p(x)` << 1 */ + { 0x000000011dc037f8, 0x0000000004f101e8 }, + /* x^230400 mod p(x)` << 1, x^230464 mod p(x)` << 1 */ + { 0x0000000031433dfc, 0x0000000070bcf184 }, + /* x^229376 mod p(x)` << 1, x^229440 mod p(x)` << 1 */ + { 0x000000009cde8348, 0x000000000a8de642 }, + /* x^228352 mod p(x)` << 1, x^228416 mod p(x)` << 1 */ + { 0x0000000038d3c2a6, 0x0000000062ea130c }, + /* x^227328 mod p(x)` << 1, x^227392 mod p(x)` << 1 */ + { 0x000000011b25f260, 0x00000001eb31cbb2 }, + /* x^226304 mod p(x)` << 1, x^226368 mod p(x)` << 1 */ + { 0x000000001629e6f0, 0x0000000170783448 }, + /* x^225280 mod p(x)` << 1, x^225344 mod p(x)` << 1 */ + { 0x0000000160838b4c, 0x00000001a684b4c6 }, + /* x^224256 mod p(x)` << 1, x^224320 mod p(x)` << 1 */ + { 0x000000007a44011c, 0x00000000253ca5b4 }, + /* x^223232 mod p(x)` << 1, x^223296 mod p(x)` << 1 */ + { 0x00000000226f417a, 0x0000000057b4b1e2 }, + /* x^222208 mod p(x)` << 1, x^222272 mod p(x)` << 1 */ + { 0x0000000045eb2eb4, 0x00000000b6bd084c }, + /* x^221184 mod p(x)` << 1, x^221248 mod p(x)` << 1 */ + { 0x000000014459d70c, 0x0000000123c2d592 }, + /* x^220160 mod p(x)` << 1, x^220224 mod p(x)` << 1 */ + { 0x00000001d406ed82, 0x00000000159dafce }, + /* x^219136 mod p(x)` << 1, x^219200 mod p(x)` << 1 */ + { 0x0000000160c8e1a8, 0x0000000127e1a64e }, + /* x^218112 mod p(x)` << 1, x^218176 mod p(x)` << 1 */ + { 0x0000000027ba8098, 0x0000000056860754 }, + /* x^217088 mod p(x)` << 1, x^217152 mod p(x)` << 1 */ + { 0x000000006d92d018, 0x00000001e661aae8 }, + /* x^216064 mod p(x)` << 1, x^216128 mod p(x)` << 1 */ + { 0x000000012ed7e3f2, 0x00000000f82c6166 }, + /* x^215040 mod p(x)` << 1, x^215104 mod p(x)` << 1 */ + { 0x000000002dc87788, 0x00000000c4f9c7ae }, + /* x^214016 mod p(x)` << 1, x^214080 mod p(x)` << 1 */ + { 0x0000000018240bb8, 0x0000000074203d20 }, + /* x^212992 mod p(x)` << 1, x^213056 mod p(x)` << 1 */ + { 0x000000001ad38158, 0x0000000198173052 }, + /* x^211968 mod p(x)` << 1, x^212032 mod p(x)` << 1 */ + { 0x00000001396b78f2, 0x00000001ce8aba54 }, + /* x^210944 mod p(x)` << 1, x^211008 mod p(x)` << 1 */ + { 0x000000011a681334, 0x00000001850d5d94 }, + /* x^209920 mod p(x)` << 1, x^209984 mod p(x)` << 1 */ + { 0x000000012104732e, 0x00000001d609239c }, + /* x^208896 mod p(x)` << 1, x^208960 mod p(x)` << 1 */ + { 0x00000000a140d90c, 0x000000001595f048 }, + /* x^207872 mod p(x)` << 1, x^207936 mod p(x)` << 1 */ + { 0x00000001b7215eda, 0x0000000042ccee08 }, + /* x^206848 mod p(x)` << 1, x^206912 mod p(x)` << 1 */ + { 0x00000001aaf1df3c, 0x000000010a389d74 }, + /* x^205824 mod p(x)` << 1, x^205888 mod p(x)` << 1 */ + { 0x0000000029d15b8a, 0x000000012a840da6 }, + /* x^204800 mod p(x)` << 1, x^204864 mod p(x)` << 1 */ + { 0x00000000f1a96922, 0x000000001d181c0c }, + /* x^203776 mod p(x)` << 1, x^203840 mod p(x)` << 1 */ + { 0x00000001ac80d03c, 0x0000000068b7d1f6 }, + /* x^202752 mod p(x)` << 1, x^202816 mod p(x)` << 1 */ + { 0x000000000f11d56a, 0x000000005b0f14fc }, + /* x^201728 mod p(x)` << 1, x^201792 mod p(x)` << 1 */ + { 0x00000001f1c022a2, 0x0000000179e9e730 }, + /* x^200704 mod p(x)` << 1, x^200768 mod p(x)` << 1 */ + { 0x0000000173d00ae2, 0x00000001ce1368d6 }, + /* x^199680 mod p(x)` << 1, x^199744 mod p(x)` << 1 */ + { 0x00000001d4ffe4ac, 0x0000000112c3a84c }, + /* x^198656 mod p(x)` << 1, x^198720 mod p(x)` << 1 */ + { 0x000000016edc5ae4, 0x00000000de940fee }, + /* x^197632 mod p(x)` << 1, x^197696 mod p(x)` << 1 */ + { 0x00000001f1a02140, 0x00000000fe896b7e }, + /* x^196608 mod p(x)` << 1, x^196672 mod p(x)` << 1 */ + { 0x00000000ca0b28a0, 0x00000001f797431c }, + /* x^195584 mod p(x)` << 1, x^195648 mod p(x)` << 1 */ + { 0x00000001928e30a2, 0x0000000053e989ba }, + /* x^194560 mod p(x)` << 1, x^194624 mod p(x)` << 1 */ + { 0x0000000097b1b002, 0x000000003920cd16 }, + /* x^193536 mod p(x)` << 1, x^193600 mod p(x)` << 1 */ + { 0x00000000b15bf906, 0x00000001e6f579b8 }, + /* x^192512 mod p(x)` << 1, x^192576 mod p(x)` << 1 */ + { 0x00000000411c5d52, 0x000000007493cb0a }, + /* x^191488 mod p(x)` << 1, x^191552 mod p(x)` << 1 */ + { 0x00000001c36f3300, 0x00000001bdd376d8 }, + /* x^190464 mod p(x)` << 1, x^190528 mod p(x)` << 1 */ + { 0x00000001119227e0, 0x000000016badfee6 }, + /* x^189440 mod p(x)` << 1, x^189504 mod p(x)` << 1 */ + { 0x00000000114d4702, 0x0000000071de5c58 }, + /* x^188416 mod p(x)` << 1, x^188480 mod p(x)` << 1 */ + { 0x00000000458b5b98, 0x00000000453f317c }, + /* x^187392 mod p(x)` << 1, x^187456 mod p(x)` << 1 */ + { 0x000000012e31fb8e, 0x0000000121675cce }, + /* x^186368 mod p(x)` << 1, x^186432 mod p(x)` << 1 */ + { 0x000000005cf619d8, 0x00000001f409ee92 }, + /* x^185344 mod p(x)` << 1, x^185408 mod p(x)` << 1 */ + { 0x0000000063f4d8b2, 0x00000000f36b9c88 }, + /* x^184320 mod p(x)` << 1, x^184384 mod p(x)` << 1 */ + { 0x000000004138dc8a, 0x0000000036b398f4 }, + /* x^183296 mod p(x)` << 1, x^183360 mod p(x)` << 1 */ + { 0x00000001d29ee8e0, 0x00000001748f9adc }, + /* x^182272 mod p(x)` << 1, x^182336 mod p(x)` << 1 */ + { 0x000000006a08ace8, 0x00000001be94ec00 }, + /* x^181248 mod p(x)` << 1, x^181312 mod p(x)` << 1 */ + { 0x0000000127d42010, 0x00000000b74370d6 }, + /* x^180224 mod p(x)` << 1, x^180288 mod p(x)` << 1 */ + { 0x0000000019d76b62, 0x00000001174d0b98 }, + /* x^179200 mod p(x)` << 1, x^179264 mod p(x)` << 1 */ + { 0x00000001b1471f6e, 0x00000000befc06a4 }, + /* x^178176 mod p(x)` << 1, x^178240 mod p(x)` << 1 */ + { 0x00000001f64c19cc, 0x00000001ae125288 }, + /* x^177152 mod p(x)` << 1, x^177216 mod p(x)` << 1 */ + { 0x00000000003c0ea0, 0x0000000095c19b34 }, + /* x^176128 mod p(x)` << 1, x^176192 mod p(x)` << 1 */ + { 0x000000014d73abf6, 0x00000001a78496f2 }, + /* x^175104 mod p(x)` << 1, x^175168 mod p(x)` << 1 */ + { 0x00000001620eb844, 0x00000001ac5390a0 }, + /* x^174080 mod p(x)` << 1, x^174144 mod p(x)` << 1 */ + { 0x0000000147655048, 0x000000002a80ed6e }, + /* x^173056 mod p(x)` << 1, x^173120 mod p(x)` << 1 */ + { 0x0000000067b5077e, 0x00000001fa9b0128 }, + /* x^172032 mod p(x)` << 1, x^172096 mod p(x)` << 1 */ + { 0x0000000010ffe206, 0x00000001ea94929e }, + /* x^171008 mod p(x)` << 1, x^171072 mod p(x)` << 1 */ + { 0x000000000fee8f1e, 0x0000000125f4305c }, + /* x^169984 mod p(x)` << 1, x^170048 mod p(x)` << 1 */ + { 0x00000001da26fbae, 0x00000001471e2002 }, + /* x^168960 mod p(x)` << 1, x^169024 mod p(x)` << 1 */ + { 0x00000001b3a8bd88, 0x0000000132d2253a }, + /* x^167936 mod p(x)` << 1, x^168000 mod p(x)` << 1 */ + { 0x00000000e8f3898e, 0x00000000f26b3592 }, + /* x^166912 mod p(x)` << 1, x^166976 mod p(x)` << 1 */ + { 0x00000000b0d0d28c, 0x00000000bc8b67b0 }, + /* x^165888 mod p(x)` << 1, x^165952 mod p(x)` << 1 */ + { 0x0000000030f2a798, 0x000000013a826ef2 }, + /* x^164864 mod p(x)` << 1, x^164928 mod p(x)` << 1 */ + { 0x000000000fba1002, 0x0000000081482c84 }, + /* x^163840 mod p(x)` << 1, x^163904 mod p(x)` << 1 */ + { 0x00000000bdb9bd72, 0x00000000e77307c2 }, + /* x^162816 mod p(x)` << 1, x^162880 mod p(x)` << 1 */ + { 0x0000000075d3bf5a, 0x00000000d4a07ec8 }, + /* x^161792 mod p(x)` << 1, x^161856 mod p(x)` << 1 */ + { 0x00000000ef1f98a0, 0x0000000017102100 }, + /* x^160768 mod p(x)` << 1, x^160832 mod p(x)` << 1 */ + { 0x00000000689c7602, 0x00000000db406486 }, + /* x^159744 mod p(x)` << 1, x^159808 mod p(x)` << 1 */ + { 0x000000016d5fa5fe, 0x0000000192db7f88 }, + /* x^158720 mod p(x)` << 1, x^158784 mod p(x)` << 1 */ + { 0x00000001d0d2b9ca, 0x000000018bf67b1e }, + /* x^157696 mod p(x)` << 1, x^157760 mod p(x)` << 1 */ + { 0x0000000041e7b470, 0x000000007c09163e }, + /* x^156672 mod p(x)` << 1, x^156736 mod p(x)` << 1 */ + { 0x00000001cbb6495e, 0x000000000adac060 }, + /* x^155648 mod p(x)` << 1, x^155712 mod p(x)` << 1 */ + { 0x000000010052a0b0, 0x00000000bd8316ae }, + /* x^154624 mod p(x)` << 1, x^154688 mod p(x)` << 1 */ + { 0x00000001d8effb5c, 0x000000019f09ab54 }, + /* x^153600 mod p(x)` << 1, x^153664 mod p(x)` << 1 */ + { 0x00000001d969853c, 0x0000000125155542 }, + /* x^152576 mod p(x)` << 1, x^152640 mod p(x)` << 1 */ + { 0x00000000523ccce2, 0x000000018fdb5882 }, + /* x^151552 mod p(x)` << 1, x^151616 mod p(x)` << 1 */ + { 0x000000001e2436bc, 0x00000000e794b3f4 }, + /* x^150528 mod p(x)` << 1, x^150592 mod p(x)` << 1 */ + { 0x00000000ddd1c3a2, 0x000000016f9bb022 }, + /* x^149504 mod p(x)` << 1, x^149568 mod p(x)` << 1 */ + { 0x0000000019fcfe38, 0x00000000290c9978 }, + /* x^148480 mod p(x)` << 1, x^148544 mod p(x)` << 1 */ + { 0x00000001ce95db64, 0x0000000083c0f350 }, + /* x^147456 mod p(x)` << 1, x^147520 mod p(x)` << 1 */ + { 0x00000000af582806, 0x0000000173ea6628 }, + /* x^146432 mod p(x)` << 1, x^146496 mod p(x)` << 1 */ + { 0x00000001006388f6, 0x00000001c8b4e00a }, + /* x^145408 mod p(x)` << 1, x^145472 mod p(x)` << 1 */ + { 0x0000000179eca00a, 0x00000000de95d6aa }, + /* x^144384 mod p(x)` << 1, x^144448 mod p(x)` << 1 */ + { 0x0000000122410a6a, 0x000000010b7f7248 }, + /* x^143360 mod p(x)` << 1, x^143424 mod p(x)` << 1 */ + { 0x000000004288e87c, 0x00000001326e3a06 }, + /* x^142336 mod p(x)` << 1, x^142400 mod p(x)` << 1 */ + { 0x000000016c5490da, 0x00000000bb62c2e6 }, + /* x^141312 mod p(x)` << 1, x^141376 mod p(x)` << 1 */ + { 0x00000000d1c71f6e, 0x0000000156a4b2c2 }, + /* x^140288 mod p(x)` << 1, x^140352 mod p(x)` << 1 */ + { 0x00000001b4ce08a6, 0x000000011dfe763a }, + /* x^139264 mod p(x)` << 1, x^139328 mod p(x)` << 1 */ + { 0x00000001466ba60c, 0x000000007bcca8e2 }, + /* x^138240 mod p(x)` << 1, x^138304 mod p(x)` << 1 */ + { 0x00000001f6c488a4, 0x0000000186118faa }, + /* x^137216 mod p(x)` << 1, x^137280 mod p(x)` << 1 */ + { 0x000000013bfb0682, 0x0000000111a65a88 }, + /* x^136192 mod p(x)` << 1, x^136256 mod p(x)` << 1 */ + { 0x00000000690e9e54, 0x000000003565e1c4 }, + /* x^135168 mod p(x)` << 1, x^135232 mod p(x)` << 1 */ + { 0x00000000281346b6, 0x000000012ed02a82 }, + /* x^134144 mod p(x)` << 1, x^134208 mod p(x)` << 1 */ + { 0x0000000156464024, 0x00000000c486ecfc }, + /* x^133120 mod p(x)` << 1, x^133184 mod p(x)` << 1 */ + { 0x000000016063a8dc, 0x0000000001b951b2 }, + /* x^132096 mod p(x)` << 1, x^132160 mod p(x)` << 1 */ + { 0x0000000116a66362, 0x0000000048143916 }, + /* x^131072 mod p(x)` << 1, x^131136 mod p(x)` << 1 */ + { 0x000000017e8aa4d2, 0x00000001dc2ae124 }, + /* x^130048 mod p(x)` << 1, x^130112 mod p(x)` << 1 */ + { 0x00000001728eb10c, 0x00000001416c58d6 }, + /* x^129024 mod p(x)` << 1, x^129088 mod p(x)` << 1 */ + { 0x00000001b08fd7fa, 0x00000000a479744a }, + /* x^128000 mod p(x)` << 1, x^128064 mod p(x)` << 1 */ + { 0x00000001092a16e8, 0x0000000096ca3a26 }, + /* x^126976 mod p(x)` << 1, x^127040 mod p(x)` << 1 */ + { 0x00000000a505637c, 0x00000000ff223d4e }, + /* x^125952 mod p(x)` << 1, x^126016 mod p(x)` << 1 */ + { 0x00000000d94869b2, 0x000000010e84da42 }, + /* x^124928 mod p(x)` << 1, x^124992 mod p(x)` << 1 */ + { 0x00000001c8b203ae, 0x00000001b61ba3d0 }, + /* x^123904 mod p(x)` << 1, x^123968 mod p(x)` << 1 */ + { 0x000000005704aea0, 0x00000000680f2de8 }, + /* x^122880 mod p(x)` << 1, x^122944 mod p(x)` << 1 */ + { 0x000000012e295fa2, 0x000000008772a9a8 }, + /* x^121856 mod p(x)` << 1, x^121920 mod p(x)` << 1 */ + { 0x000000011d0908bc, 0x0000000155f295bc }, + /* x^120832 mod p(x)` << 1, x^120896 mod p(x)` << 1 */ + { 0x0000000193ed97ea, 0x00000000595f9282 }, + /* x^119808 mod p(x)` << 1, x^119872 mod p(x)` << 1 */ + { 0x000000013a0f1c52, 0x0000000164b1c25a }, + /* x^118784 mod p(x)` << 1, x^118848 mod p(x)` << 1 */ + { 0x000000010c2c40c0, 0x00000000fbd67c50 }, + /* x^117760 mod p(x)` << 1, x^117824 mod p(x)` << 1 */ + { 0x00000000ff6fac3e, 0x0000000096076268 }, + /* x^116736 mod p(x)` << 1, x^116800 mod p(x)` << 1 */ + { 0x000000017b3609c0, 0x00000001d288e4cc }, + /* x^115712 mod p(x)` << 1, x^115776 mod p(x)` << 1 */ + { 0x0000000088c8c922, 0x00000001eaac1bdc }, + /* x^114688 mod p(x)` << 1, x^114752 mod p(x)` << 1 */ + { 0x00000001751baae6, 0x00000001f1ea39e2 }, + /* x^113664 mod p(x)` << 1, x^113728 mod p(x)` << 1 */ + { 0x0000000107952972, 0x00000001eb6506fc }, + /* x^112640 mod p(x)` << 1, x^112704 mod p(x)` << 1 */ + { 0x0000000162b00abe, 0x000000010f806ffe }, + /* x^111616 mod p(x)` << 1, x^111680 mod p(x)` << 1 */ + { 0x000000000d7b404c, 0x000000010408481e }, + /* x^110592 mod p(x)` << 1, x^110656 mod p(x)` << 1 */ + { 0x00000000763b13d4, 0x0000000188260534 }, + /* x^109568 mod p(x)` << 1, x^109632 mod p(x)` << 1 */ + { 0x00000000f6dc22d8, 0x0000000058fc73e0 }, + /* x^108544 mod p(x)` << 1, x^108608 mod p(x)` << 1 */ + { 0x000000007daae060, 0x00000000391c59b8 }, + /* x^107520 mod p(x)` << 1, x^107584 mod p(x)` << 1 */ + { 0x000000013359ab7c, 0x000000018b638400 }, + /* x^106496 mod p(x)` << 1, x^106560 mod p(x)` << 1 */ + { 0x000000008add438a, 0x000000011738f5c4 }, + /* x^105472 mod p(x)` << 1, x^105536 mod p(x)` << 1 */ + { 0x00000001edbefdea, 0x000000008cf7c6da }, + /* x^104448 mod p(x)` << 1, x^104512 mod p(x)` << 1 */ + { 0x000000004104e0f8, 0x00000001ef97fb16 }, + /* x^103424 mod p(x)` << 1, x^103488 mod p(x)` << 1 */ + { 0x00000000b48a8222, 0x0000000102130e20 }, + /* x^102400 mod p(x)` << 1, x^102464 mod p(x)` << 1 */ + { 0x00000001bcb46844, 0x00000000db968898 }, + /* x^101376 mod p(x)` << 1, x^101440 mod p(x)` << 1 */ + { 0x000000013293ce0a, 0x00000000b5047b5e }, + /* x^100352 mod p(x)` << 1, x^100416 mod p(x)` << 1 */ + { 0x00000001710d0844, 0x000000010b90fdb2 }, + /* x^99328 mod p(x)` << 1, x^99392 mod p(x)` << 1 */ + { 0x0000000117907f6e, 0x000000004834a32e }, + /* x^98304 mod p(x)` << 1, x^98368 mod p(x)` << 1 */ + { 0x0000000087ddf93e, 0x0000000059c8f2b0 }, + /* x^97280 mod p(x)` << 1, x^97344 mod p(x)` << 1 */ + { 0x000000005970e9b0, 0x0000000122cec508 }, + /* x^96256 mod p(x)` << 1, x^96320 mod p(x)` << 1 */ + { 0x0000000185b2b7d0, 0x000000000a330cda }, + /* x^95232 mod p(x)` << 1, x^95296 mod p(x)` << 1 */ + { 0x00000001dcee0efc, 0x000000014a47148c }, + /* x^94208 mod p(x)` << 1, x^94272 mod p(x)` << 1 */ + { 0x0000000030da2722, 0x0000000042c61cb8 }, + /* x^93184 mod p(x)` << 1, x^93248 mod p(x)` << 1 */ + { 0x000000012f925a18, 0x0000000012fe6960 }, + /* x^92160 mod p(x)` << 1, x^92224 mod p(x)` << 1 */ + { 0x00000000dd2e357c, 0x00000000dbda2c20 }, + /* x^91136 mod p(x)` << 1, x^91200 mod p(x)` << 1 */ + { 0x00000000071c80de, 0x000000011122410c }, + /* x^90112 mod p(x)` << 1, x^90176 mod p(x)` << 1 */ + { 0x000000011513140a, 0x00000000977b2070 }, + /* x^89088 mod p(x)` << 1, x^89152 mod p(x)` << 1 */ + { 0x00000001df876e8e, 0x000000014050438e }, + /* x^88064 mod p(x)` << 1, x^88128 mod p(x)` << 1 */ + { 0x000000015f81d6ce, 0x0000000147c840e8 }, + /* x^87040 mod p(x)` << 1, x^87104 mod p(x)` << 1 */ + { 0x000000019dd94dbe, 0x00000001cc7c88ce }, + /* x^86016 mod p(x)` << 1, x^86080 mod p(x)` << 1 */ + { 0x00000001373d206e, 0x00000001476b35a4 }, + /* x^84992 mod p(x)` << 1, x^85056 mod p(x)` << 1 */ + { 0x00000000668ccade, 0x000000013d52d508 }, + /* x^83968 mod p(x)` << 1, x^84032 mod p(x)` << 1 */ + { 0x00000001b192d268, 0x000000008e4be32e }, + /* x^82944 mod p(x)` << 1, x^83008 mod p(x)` << 1 */ + { 0x00000000e30f3a78, 0x00000000024120fe }, + /* x^81920 mod p(x)` << 1, x^81984 mod p(x)` << 1 */ + { 0x000000010ef1f7bc, 0x00000000ddecddb4 }, + /* x^80896 mod p(x)` << 1, x^80960 mod p(x)` << 1 */ + { 0x00000001f5ac7380, 0x00000000d4d403bc }, + /* x^79872 mod p(x)` << 1, x^79936 mod p(x)` << 1 */ + { 0x000000011822ea70, 0x00000001734b89aa }, + /* x^78848 mod p(x)` << 1, x^78912 mod p(x)` << 1 */ + { 0x00000000c3a33848, 0x000000010e7a58d6 }, + /* x^77824 mod p(x)` << 1, x^77888 mod p(x)` << 1 */ + { 0x00000001bd151c24, 0x00000001f9f04e9c }, + /* x^76800 mod p(x)` << 1, x^76864 mod p(x)` << 1 */ + { 0x0000000056002d76, 0x00000000b692225e }, + /* x^75776 mod p(x)` << 1, x^75840 mod p(x)` << 1 */ + { 0x000000014657c4f4, 0x000000019b8d3f3e }, + /* x^74752 mod p(x)` << 1, x^74816 mod p(x)` << 1 */ + { 0x0000000113742d7c, 0x00000001a874f11e }, + /* x^73728 mod p(x)` << 1, x^73792 mod p(x)` << 1 */ + { 0x000000019c5920ba, 0x000000010d5a4254 }, + /* x^72704 mod p(x)` << 1, x^72768 mod p(x)` << 1 */ + { 0x000000005216d2d6, 0x00000000bbb2f5d6 }, + /* x^71680 mod p(x)` << 1, x^71744 mod p(x)` << 1 */ + { 0x0000000136f5ad8a, 0x0000000179cc0e36 }, + /* x^70656 mod p(x)` << 1, x^70720 mod p(x)` << 1 */ + { 0x000000018b07beb6, 0x00000001dca1da4a }, + /* x^69632 mod p(x)` << 1, x^69696 mod p(x)` << 1 */ + { 0x00000000db1e93b0, 0x00000000feb1a192 }, + /* x^68608 mod p(x)` << 1, x^68672 mod p(x)` << 1 */ + { 0x000000000b96fa3a, 0x00000000d1eeedd6 }, + /* x^67584 mod p(x)` << 1, x^67648 mod p(x)` << 1 */ + { 0x00000001d9968af0, 0x000000008fad9bb4 }, + /* x^66560 mod p(x)` << 1, x^66624 mod p(x)` << 1 */ + { 0x000000000e4a77a2, 0x00000001884938e4 }, + /* x^65536 mod p(x)` << 1, x^65600 mod p(x)` << 1 */ + { 0x00000000508c2ac8, 0x00000001bc2e9bc0 }, + /* x^64512 mod p(x)` << 1, x^64576 mod p(x)` << 1 */ + { 0x0000000021572a80, 0x00000001f9658a68 }, + /* x^63488 mod p(x)` << 1, x^63552 mod p(x)` << 1 */ + { 0x00000001b859daf2, 0x000000001b9224fc }, + /* x^62464 mod p(x)` << 1, x^62528 mod p(x)` << 1 */ + { 0x000000016f788474, 0x0000000055b2fb84 }, + /* x^61440 mod p(x)` << 1, x^61504 mod p(x)` << 1 */ + { 0x00000001b438810e, 0x000000018b090348 }, + /* x^60416 mod p(x)` << 1, x^60480 mod p(x)` << 1 */ + { 0x0000000095ddc6f2, 0x000000011ccbd5ea }, + /* x^59392 mod p(x)` << 1, x^59456 mod p(x)` << 1 */ + { 0x00000001d977c20c, 0x0000000007ae47f8 }, + /* x^58368 mod p(x)` << 1, x^58432 mod p(x)` << 1 */ + { 0x00000000ebedb99a, 0x0000000172acbec0 }, + /* x^57344 mod p(x)` << 1, x^57408 mod p(x)` << 1 */ + { 0x00000001df9e9e92, 0x00000001c6e3ff20 }, + /* x^56320 mod p(x)` << 1, x^56384 mod p(x)` << 1 */ + { 0x00000001a4a3f952, 0x00000000e1b38744 }, + /* x^55296 mod p(x)` << 1, x^55360 mod p(x)` << 1 */ + { 0x00000000e2f51220, 0x00000000791585b2 }, + /* x^54272 mod p(x)` << 1, x^54336 mod p(x)` << 1 */ + { 0x000000004aa01f3e, 0x00000000ac53b894 }, + /* x^53248 mod p(x)` << 1, x^53312 mod p(x)` << 1 */ + { 0x00000000b3e90a58, 0x00000001ed5f2cf4 }, + /* x^52224 mod p(x)` << 1, x^52288 mod p(x)` << 1 */ + { 0x000000000c9ca2aa, 0x00000001df48b2e0 }, + /* x^51200 mod p(x)` << 1, x^51264 mod p(x)` << 1 */ + { 0x0000000151682316, 0x00000000049c1c62 }, + /* x^50176 mod p(x)` << 1, x^50240 mod p(x)` << 1 */ + { 0x0000000036fce78c, 0x000000017c460c12 }, + /* x^49152 mod p(x)` << 1, x^49216 mod p(x)` << 1 */ + { 0x000000009037dc10, 0x000000015be4da7e }, + /* x^48128 mod p(x)` << 1, x^48192 mod p(x)` << 1 */ + { 0x00000000d3298582, 0x000000010f38f668 }, + /* x^47104 mod p(x)` << 1, x^47168 mod p(x)` << 1 */ + { 0x00000001b42e8ad6, 0x0000000039f40a00 }, + /* x^46080 mod p(x)` << 1, x^46144 mod p(x)` << 1 */ + { 0x00000000142a9838, 0x00000000bd4c10c4 }, + /* x^45056 mod p(x)` << 1, x^45120 mod p(x)` << 1 */ + { 0x0000000109c7f190, 0x0000000042db1d98 }, + /* x^44032 mod p(x)` << 1, x^44096 mod p(x)` << 1 */ + { 0x0000000056ff9310, 0x00000001c905bae6 }, + /* x^43008 mod p(x)` << 1, x^43072 mod p(x)` << 1 */ + { 0x00000001594513aa, 0x00000000069d40ea }, + /* x^41984 mod p(x)` << 1, x^42048 mod p(x)` << 1 */ + { 0x00000001e3b5b1e8, 0x000000008e4fbad0 }, + /* x^40960 mod p(x)` << 1, x^41024 mod p(x)` << 1 */ + { 0x000000011dd5fc08, 0x0000000047bedd46 }, + /* x^39936 mod p(x)` << 1, x^40000 mod p(x)` << 1 */ + { 0x00000001675f0cc2, 0x0000000026396bf8 }, + /* x^38912 mod p(x)` << 1, x^38976 mod p(x)` << 1 */ + { 0x00000000d1c8dd44, 0x00000000379beb92 }, + /* x^37888 mod p(x)` << 1, x^37952 mod p(x)` << 1 */ + { 0x0000000115ebd3d8, 0x000000000abae54a }, + /* x^36864 mod p(x)` << 1, x^36928 mod p(x)` << 1 */ + { 0x00000001ecbd0dac, 0x0000000007e6a128 }, + /* x^35840 mod p(x)` << 1, x^35904 mod p(x)` << 1 */ + { 0x00000000cdf67af2, 0x000000000ade29d2 }, + /* x^34816 mod p(x)` << 1, x^34880 mod p(x)` << 1 */ + { 0x000000004c01ff4c, 0x00000000f974c45c }, + /* x^33792 mod p(x)` << 1, x^33856 mod p(x)` << 1 */ + { 0x00000000f2d8657e, 0x00000000e77ac60a }, + /* x^32768 mod p(x)` << 1, x^32832 mod p(x)` << 1 */ + { 0x000000006bae74c4, 0x0000000145895816 }, + /* x^31744 mod p(x)` << 1, x^31808 mod p(x)` << 1 */ + { 0x0000000152af8aa0, 0x0000000038e362be }, + /* x^30720 mod p(x)` << 1, x^30784 mod p(x)` << 1 */ + { 0x0000000004663802, 0x000000007f991a64 }, + /* x^29696 mod p(x)` << 1, x^29760 mod p(x)` << 1 */ + { 0x00000001ab2f5afc, 0x00000000fa366d3a }, + /* x^28672 mod p(x)` << 1, x^28736 mod p(x)` << 1 */ + { 0x0000000074a4ebd4, 0x00000001a2bb34f0 }, + /* x^27648 mod p(x)` << 1, x^27712 mod p(x)` << 1 */ + { 0x00000001d7ab3a4c, 0x0000000028a9981e }, + /* x^26624 mod p(x)` << 1, x^26688 mod p(x)` << 1 */ + { 0x00000001a8da60c6, 0x00000001dbc672be }, + /* x^25600 mod p(x)` << 1, x^25664 mod p(x)` << 1 */ + { 0x000000013cf63820, 0x00000000b04d77f6 }, + /* x^24576 mod p(x)` << 1, x^24640 mod p(x)` << 1 */ + { 0x00000000bec12e1e, 0x0000000124400d96 }, + /* x^23552 mod p(x)` << 1, x^23616 mod p(x)` << 1 */ + { 0x00000001c6368010, 0x000000014ca4b414 }, + /* x^22528 mod p(x)` << 1, x^22592 mod p(x)` << 1 */ + { 0x00000001e6e78758, 0x000000012fe2c938 }, + /* x^21504 mod p(x)` << 1, x^21568 mod p(x)` << 1 */ + { 0x000000008d7f2b3c, 0x00000001faed01e6 }, + /* x^20480 mod p(x)` << 1, x^20544 mod p(x)` << 1 */ + { 0x000000016b4a156e, 0x000000007e80ecfe }, + /* x^19456 mod p(x)` << 1, x^19520 mod p(x)` << 1 */ + { 0x00000001c63cfeb6, 0x0000000098daee94 }, + /* x^18432 mod p(x)` << 1, x^18496 mod p(x)` << 1 */ + { 0x000000015f902670, 0x000000010a04edea }, + /* x^17408 mod p(x)` << 1, x^17472 mod p(x)` << 1 */ + { 0x00000001cd5de11e, 0x00000001c00b4524 }, + /* x^16384 mod p(x)` << 1, x^16448 mod p(x)` << 1 */ + { 0x000000001acaec54, 0x0000000170296550 }, + /* x^15360 mod p(x)` << 1, x^15424 mod p(x)` << 1 */ + { 0x000000002bd0ca78, 0x0000000181afaa48 }, + /* x^14336 mod p(x)` << 1, x^14400 mod p(x)` << 1 */ + { 0x0000000032d63d5c, 0x0000000185a31ffa }, + /* x^13312 mod p(x)` << 1, x^13376 mod p(x)` << 1 */ + { 0x000000001c6d4e4c, 0x000000002469f608 }, + /* x^12288 mod p(x)` << 1, x^12352 mod p(x)` << 1 */ + { 0x0000000106a60b92, 0x000000006980102a }, + /* x^11264 mod p(x)` << 1, x^11328 mod p(x)` << 1 */ + { 0x00000000d3855e12, 0x0000000111ea9ca8 }, + /* x^10240 mod p(x)` << 1, x^10304 mod p(x)` << 1 */ + { 0x00000000e3125636, 0x00000001bd1d29ce }, + /* x^9216 mod p(x)` << 1, x^9280 mod p(x)` << 1 */ + { 0x000000009e8f7ea4, 0x00000001b34b9580 }, + /* x^8192 mod p(x)` << 1, x^8256 mod p(x)` << 1 */ + { 0x00000001c82e562c, 0x000000003076054e }, + /* x^7168 mod p(x)` << 1, x^7232 mod p(x)` << 1 */ + { 0x00000000ca9f09ce, 0x000000012a608ea4 }, + /* x^6144 mod p(x)` << 1, x^6208 mod p(x)` << 1 */ + { 0x00000000c63764e6, 0x00000000784d05fe }, + /* x^5120 mod p(x)` << 1, x^5184 mod p(x)` << 1 */ + { 0x0000000168d2e49e, 0x000000016ef0d82a }, + /* x^4096 mod p(x)` << 1, x^4160 mod p(x)` << 1 */ + { 0x00000000e986c148, 0x0000000075bda454 }, + /* x^3072 mod p(x)` << 1, x^3136 mod p(x)` << 1 */ + { 0x00000000cfb65894, 0x000000003dc0a1c4 }, + /* x^2048 mod p(x)` << 1, x^2112 mod p(x)` << 1 */ + { 0x0000000111cadee4, 0x00000000e9a5d8be }, + /* x^1024 mod p(x)` << 1, x^1088 mod p(x)` << 1 */ + { 0x0000000171fb63ce, 0x00000001609bc4b4 } +#endif /* __LITTLE_ENDIAN__ */ +}; + +/* Reduce final 1024-2048 bits to 64 bits, shifting 32 bits to include the trailing 32 bits of zeros */ + +static const __vector unsigned long long vcrc_short_const[16] __attribute__((aligned(16))) = { +#ifdef __LITTLE_ENDIAN__ + /* x^1952 mod p(x) , x^1984 mod p(x) , x^2016 mod p(x) , x^2048 mod p(x) */ + { 0x5cf015c388e56f72, 0x7fec2963e5bf8048 }, + /* x^1824 mod p(x) , x^1856 mod p(x) , x^1888 mod p(x) , x^1920 mod p(x) */ + { 0x963a18920246e2e6, 0x38e888d4844752a9 }, + /* x^1696 mod p(x) , x^1728 mod p(x) , x^1760 mod p(x) , x^1792 mod p(x) */ + { 0x419a441956993a31, 0x42316c00730206ad }, + /* x^1568 mod p(x) , x^1600 mod p(x) , x^1632 mod p(x) , x^1664 mod p(x) */ + { 0x924752ba2b830011, 0x543d5c543e65ddf9 }, + /* x^1440 mod p(x) , x^1472 mod p(x) , x^1504 mod p(x) , x^1536 mod p(x) */ + { 0x55bd7f9518e4a304, 0x78e87aaf56767c92 }, + /* x^1312 mod p(x) , x^1344 mod p(x) , x^1376 mod p(x) , x^1408 mod p(x) */ + { 0x6d76739fe0553f1e, 0x8f68fcec1903da7f }, + /* x^1184 mod p(x) , x^1216 mod p(x) , x^1248 mod p(x) , x^1280 mod p(x) */ + { 0xc133722b1fe0b5c3, 0x3f4840246791d588 }, + /* x^1056 mod p(x) , x^1088 mod p(x) , x^1120 mod p(x) , x^1152 mod p(x) */ + { 0x64b67ee0e55ef1f3, 0x34c96751b04de25a }, + /* x^928 mod p(x) , x^960 mod p(x) , x^992 mod p(x) , x^1024 mod p(x) */ + { 0x069db049b8fdb1e7, 0x156c8e180b4a395b }, + /* x^800 mod p(x) , x^832 mod p(x) , x^864 mod p(x) , x^896 mod p(x) */ + { 0xa11bfaf3c9e90b9e, 0xe0b99ccbe661f7be }, + /* x^672 mod p(x) , x^704 mod p(x) , x^736 mod p(x) , x^768 mod p(x) */ + { 0x817cdc5119b29a35, 0x041d37768cd75659 }, + /* x^544 mod p(x) , x^576 mod p(x) , x^608 mod p(x) , x^640 mod p(x) */ + { 0x1ce9d94b36c41f1c, 0x3a0777818cfaa965 }, + /* x^416 mod p(x) , x^448 mod p(x) , x^480 mod p(x) , x^512 mod p(x) */ + { 0x4f256efcb82be955, 0x0e148e8252377a55 }, + /* x^288 mod p(x) , x^320 mod p(x) , x^352 mod p(x) , x^384 mod p(x) */ + { 0xec1631edb2dea967, 0x9c25531d19e65dde }, + /* x^160 mod p(x) , x^192 mod p(x) , x^224 mod p(x) , x^256 mod p(x) */ + { 0x5d27e147510ac59a, 0x790606ff9957c0a6 }, + /* x^32 mod p(x) , x^64 mod p(x) , x^96 mod p(x) , x^128 mod p(x) */ + { 0xa66805eb18b8ea18, 0x82f63b786ea2d55c } +#else /* __LITTLE_ENDIAN__ */ + /* x^1952 mod p(x) , x^1984 mod p(x) , x^2016 mod p(x) , x^2048 mod p(x) */ + { 0x7fec2963e5bf8048, 0x5cf015c388e56f72 }, + /* x^1824 mod p(x) , x^1856 mod p(x) , x^1888 mod p(x) , x^1920 mod p(x) */ + { 0x38e888d4844752a9, 0x963a18920246e2e6 }, + /* x^1696 mod p(x) , x^1728 mod p(x) , x^1760 mod p(x) , x^1792 mod p(x) */ + { 0x42316c00730206ad, 0x419a441956993a31 }, + /* x^1568 mod p(x) , x^1600 mod p(x) , x^1632 mod p(x) , x^1664 mod p(x) */ + { 0x543d5c543e65ddf9, 0x924752ba2b830011 }, + /* x^1440 mod p(x) , x^1472 mod p(x) , x^1504 mod p(x) , x^1536 mod p(x) */ + { 0x78e87aaf56767c92, 0x55bd7f9518e4a304 }, + /* x^1312 mod p(x) , x^1344 mod p(x) , x^1376 mod p(x) , x^1408 mod p(x) */ + { 0x8f68fcec1903da7f, 0x6d76739fe0553f1e }, + /* x^1184 mod p(x) , x^1216 mod p(x) , x^1248 mod p(x) , x^1280 mod p(x) */ + { 0x3f4840246791d588, 0xc133722b1fe0b5c3 }, + /* x^1056 mod p(x) , x^1088 mod p(x) , x^1120 mod p(x) , x^1152 mod p(x) */ + { 0x34c96751b04de25a, 0x64b67ee0e55ef1f3 }, + /* x^928 mod p(x) , x^960 mod p(x) , x^992 mod p(x) , x^1024 mod p(x) */ + { 0x156c8e180b4a395b, 0x069db049b8fdb1e7 }, + /* x^800 mod p(x) , x^832 mod p(x) , x^864 mod p(x) , x^896 mod p(x) */ + { 0xe0b99ccbe661f7be, 0xa11bfaf3c9e90b9e }, + /* x^672 mod p(x) , x^704 mod p(x) , x^736 mod p(x) , x^768 mod p(x) */ + { 0x041d37768cd75659, 0x817cdc5119b29a35 }, + /* x^544 mod p(x) , x^576 mod p(x) , x^608 mod p(x) , x^640 mod p(x) */ + { 0x3a0777818cfaa965, 0x1ce9d94b36c41f1c }, + /* x^416 mod p(x) , x^448 mod p(x) , x^480 mod p(x) , x^512 mod p(x) */ + { 0x0e148e8252377a55, 0x4f256efcb82be955 }, + /* x^288 mod p(x) , x^320 mod p(x) , x^352 mod p(x) , x^384 mod p(x) */ + { 0x9c25531d19e65dde, 0xec1631edb2dea967 }, + /* x^160 mod p(x) , x^192 mod p(x) , x^224 mod p(x) , x^256 mod p(x) */ + { 0x790606ff9957c0a6, 0x5d27e147510ac59a }, + /* x^32 mod p(x) , x^64 mod p(x) , x^96 mod p(x) , x^128 mod p(x) */ + { 0x82f63b786ea2d55c, 0xa66805eb18b8ea18 } +#endif /* __LITTLE_ENDIAN__ */ +}; + +/* Barrett constants */ +/* 33 bit reflected Barrett constant m - (4^32)/n */ + +static const __vector unsigned long long v_Barrett_const[2] __attribute__((aligned(16))) = { +/* x^64 div p(x) */ +#ifdef __LITTLE_ENDIAN__ + { 0x00000000dea713f1, 0x0000000000000000 }, + { 0x0000000105ec76f1, 0x0000000000000000 } +#else /* __LITTLE_ENDIAN__ */ + { 0x0000000000000000, 0x00000000dea713f1 }, + { 0x0000000000000000, 0x0000000105ec76f1 } +#endif /* __LITTLE_ENDIAN__ */ +}; +#endif /* POWER8_INTRINSICS */ + +#else /* __ASSEMBLER__ */ +.constants : + + /* Reduce 262144 kbits to 1024 bits */ + /* x^261120 mod p(x)` << 1, x^261184 mod p(x)` << 1 */ + .octa 0x00000000b6ca9e20000000009c37c408 + + /* x^260096 mod p(x)` << 1, x^260160 mod p(x)` << 1 */ + .octa 0x00000000350249a800000001b51df26c + + /* x^259072 mod p(x)` << 1, x^259136 mod p(x)` << 1 */ + .octa 0x00000001862dac54000000000724b9d0 + + /* x^258048 mod p(x)` << 1, x^258112 mod p(x)` << 1 */ + .octa 0x00000001d87fb48c00000001c00532fe + + /* x^257024 mod p(x)` << 1, x^257088 mod p(x)` << 1 */ + .octa 0x00000001f39b699e00000000f05a9362 + + /* x^256000 mod p(x)` << 1, x^256064 mod p(x)` << 1 */ + .octa 0x0000000101da11b400000001e1007970 + + /* x^254976 mod p(x)` << 1, x^255040 mod p(x)` << 1 */ + .octa 0x00000001cab571e000000000a57366ee + + /* x^253952 mod p(x)` << 1, x^254016 mod p(x)` << 1 */ + .octa 0x00000000c7020cfe0000000192011284 + + /* x^252928 mod p(x)` << 1, x^252992 mod p(x)` << 1 */ + .octa 0x00000000cdaed1ae0000000162716d9a + + /* x^251904 mod p(x)` << 1, x^251968 mod p(x)` << 1 */ + .octa 0x00000001e804effc00000000cd97ecde + + /* x^250880 mod p(x)` << 1, x^250944 mod p(x)` << 1 */ + .octa 0x0000000077c3ea3a0000000058812bc0 + + /* x^249856 mod p(x)` << 1, x^249920 mod p(x)` << 1 */ + .octa 0x0000000068df31b40000000088b8c12e + + /* x^248832 mod p(x)` << 1, x^248896 mod p(x)` << 1 */ + .octa 0x00000000b059b6c200000001230b234c + + /* x^247808 mod p(x)` << 1, x^247872 mod p(x)` << 1 */ + .octa 0x0000000145fb8ed800000001120b416e + + /* x^246784 mod p(x)` << 1, x^246848 mod p(x)` << 1 */ + .octa 0x00000000cbc0916800000001974aecb0 + + /* x^245760 mod p(x)` << 1, x^245824 mod p(x)` << 1 */ + .octa 0x000000005ceeedc2000000008ee3f226 + + /* x^244736 mod p(x)` << 1, x^244800 mod p(x)` << 1 */ + .octa 0x0000000047d74e8600000001089aba9a + + /* x^243712 mod p(x)` << 1, x^243776 mod p(x)` << 1 */ + .octa 0x00000001407e9e220000000065113872 + + /* x^242688 mod p(x)` << 1, x^242752 mod p(x)` << 1 */ + .octa 0x00000001da967bda000000005c07ec10 + + /* x^241664 mod p(x)` << 1, x^241728 mod p(x)` << 1 */ + .octa 0x000000006c8983680000000187590924 + + /* x^240640 mod p(x)` << 1, x^240704 mod p(x)` << 1 */ + .octa 0x00000000f2d14c9800000000e35da7c6 + + /* x^239616 mod p(x)` << 1, x^239680 mod p(x)` << 1 */ + .octa 0x00000001993c6ad4000000000415855a + + /* x^238592 mod p(x)` << 1, x^238656 mod p(x)` << 1 */ + .octa 0x000000014683d1ac0000000073617758 + + /* x^237568 mod p(x)` << 1, x^237632 mod p(x)` << 1 */ + .octa 0x00000001a7c93e6c0000000176021d28 + + /* x^236544 mod p(x)` << 1, x^236608 mod p(x)` << 1 */ + .octa 0x000000010211e90a00000001c358fd0a + + /* x^235520 mod p(x)` << 1, x^235584 mod p(x)` << 1 */ + .octa 0x000000001119403e00000001ff7a2c18 + + /* x^234496 mod p(x)` << 1, x^234560 mod p(x)` << 1 */ + .octa 0x000000001c3261aa00000000f2d9f7e4 + + /* x^233472 mod p(x)` << 1, x^233536 mod p(x)` << 1 */ + .octa 0x000000014e37a634000000016cf1f9c8 + + /* x^232448 mod p(x)` << 1, x^232512 mod p(x)` << 1 */ + .octa 0x0000000073786c0c000000010af9279a + + /* x^231424 mod p(x)` << 1, x^231488 mod p(x)` << 1 */ + .octa 0x000000011dc037f80000000004f101e8 + + /* x^230400 mod p(x)` << 1, x^230464 mod p(x)` << 1 */ + .octa 0x0000000031433dfc0000000070bcf184 + + /* x^229376 mod p(x)` << 1, x^229440 mod p(x)` << 1 */ + .octa 0x000000009cde8348000000000a8de642 + + /* x^228352 mod p(x)` << 1, x^228416 mod p(x)` << 1 */ + .octa 0x0000000038d3c2a60000000062ea130c + + /* x^227328 mod p(x)` << 1, x^227392 mod p(x)` << 1 */ + .octa 0x000000011b25f26000000001eb31cbb2 + + /* x^226304 mod p(x)` << 1, x^226368 mod p(x)` << 1 */ + .octa 0x000000001629e6f00000000170783448 + + /* x^225280 mod p(x)` << 1, x^225344 mod p(x)` << 1 */ + .octa 0x0000000160838b4c00000001a684b4c6 + + /* x^224256 mod p(x)` << 1, x^224320 mod p(x)` << 1 */ + .octa 0x000000007a44011c00000000253ca5b4 + + /* x^223232 mod p(x)` << 1, x^223296 mod p(x)` << 1 */ + .octa 0x00000000226f417a0000000057b4b1e2 + + /* x^222208 mod p(x)` << 1, x^222272 mod p(x)` << 1 */ + .octa 0x0000000045eb2eb400000000b6bd084c + + /* x^221184 mod p(x)` << 1, x^221248 mod p(x)` << 1 */ + .octa 0x000000014459d70c0000000123c2d592 + + /* x^220160 mod p(x)` << 1, x^220224 mod p(x)` << 1 */ + .octa 0x00000001d406ed8200000000159dafce + + /* x^219136 mod p(x)` << 1, x^219200 mod p(x)` << 1 */ + .octa 0x0000000160c8e1a80000000127e1a64e + + /* x^218112 mod p(x)` << 1, x^218176 mod p(x)` << 1 */ + .octa 0x0000000027ba80980000000056860754 + + /* x^217088 mod p(x)` << 1, x^217152 mod p(x)` << 1 */ + .octa 0x000000006d92d01800000001e661aae8 + + /* x^216064 mod p(x)` << 1, x^216128 mod p(x)` << 1 */ + .octa 0x000000012ed7e3f200000000f82c6166 + + /* x^215040 mod p(x)` << 1, x^215104 mod p(x)` << 1 */ + .octa 0x000000002dc8778800000000c4f9c7ae + + /* x^214016 mod p(x)` << 1, x^214080 mod p(x)` << 1 */ + .octa 0x0000000018240bb80000000074203d20 + + /* x^212992 mod p(x)` << 1, x^213056 mod p(x)` << 1 */ + .octa 0x000000001ad381580000000198173052 + + /* x^211968 mod p(x)` << 1, x^212032 mod p(x)` << 1 */ + .octa 0x00000001396b78f200000001ce8aba54 + + /* x^210944 mod p(x)` << 1, x^211008 mod p(x)` << 1 */ + .octa 0x000000011a68133400000001850d5d94 + + /* x^209920 mod p(x)` << 1, x^209984 mod p(x)` << 1 */ + .octa 0x000000012104732e00000001d609239c + + /* x^208896 mod p(x)` << 1, x^208960 mod p(x)` << 1 */ + .octa 0x00000000a140d90c000000001595f048 + + /* x^207872 mod p(x)` << 1, x^207936 mod p(x)` << 1 */ + .octa 0x00000001b7215eda0000000042ccee08 + + /* x^206848 mod p(x)` << 1, x^206912 mod p(x)` << 1 */ + .octa 0x00000001aaf1df3c000000010a389d74 + + /* x^205824 mod p(x)` << 1, x^205888 mod p(x)` << 1 */ + .octa 0x0000000029d15b8a000000012a840da6 + + /* x^204800 mod p(x)` << 1, x^204864 mod p(x)` << 1 */ + .octa 0x00000000f1a96922000000001d181c0c + + /* x^203776 mod p(x)` << 1, x^203840 mod p(x)` << 1 */ + .octa 0x00000001ac80d03c0000000068b7d1f6 + + /* x^202752 mod p(x)` << 1, x^202816 mod p(x)` << 1 */ + .octa 0x000000000f11d56a000000005b0f14fc + + /* x^201728 mod p(x)` << 1, x^201792 mod p(x)` << 1 */ + .octa 0x00000001f1c022a20000000179e9e730 + + /* x^200704 mod p(x)` << 1, x^200768 mod p(x)` << 1 */ + .octa 0x0000000173d00ae200000001ce1368d6 + + /* x^199680 mod p(x)` << 1, x^199744 mod p(x)` << 1 */ + .octa 0x00000001d4ffe4ac0000000112c3a84c + + /* x^198656 mod p(x)` << 1, x^198720 mod p(x)` << 1 */ + .octa 0x000000016edc5ae400000000de940fee + + /* x^197632 mod p(x)` << 1, x^197696 mod p(x)` << 1 */ + .octa 0x00000001f1a0214000000000fe896b7e + + /* x^196608 mod p(x)` << 1, x^196672 mod p(x)` << 1 */ + .octa 0x00000000ca0b28a000000001f797431c + + /* x^195584 mod p(x)` << 1, x^195648 mod p(x)` << 1 */ + .octa 0x00000001928e30a20000000053e989ba + + /* x^194560 mod p(x)` << 1, x^194624 mod p(x)` << 1 */ + .octa 0x0000000097b1b002000000003920cd16 + + /* x^193536 mod p(x)` << 1, x^193600 mod p(x)` << 1 */ + .octa 0x00000000b15bf90600000001e6f579b8 + + /* x^192512 mod p(x)` << 1, x^192576 mod p(x)` << 1 */ + .octa 0x00000000411c5d52000000007493cb0a + + /* x^191488 mod p(x)` << 1, x^191552 mod p(x)` << 1 */ + .octa 0x00000001c36f330000000001bdd376d8 + + /* x^190464 mod p(x)` << 1, x^190528 mod p(x)` << 1 */ + .octa 0x00000001119227e0000000016badfee6 + + /* x^189440 mod p(x)` << 1, x^189504 mod p(x)` << 1 */ + .octa 0x00000000114d47020000000071de5c58 + + /* x^188416 mod p(x)` << 1, x^188480 mod p(x)` << 1 */ + .octa 0x00000000458b5b9800000000453f317c + + /* x^187392 mod p(x)` << 1, x^187456 mod p(x)` << 1 */ + .octa 0x000000012e31fb8e0000000121675cce + + /* x^186368 mod p(x)` << 1, x^186432 mod p(x)` << 1 */ + .octa 0x000000005cf619d800000001f409ee92 + + /* x^185344 mod p(x)` << 1, x^185408 mod p(x)` << 1 */ + .octa 0x0000000063f4d8b200000000f36b9c88 + + /* x^184320 mod p(x)` << 1, x^184384 mod p(x)` << 1 */ + .octa 0x000000004138dc8a0000000036b398f4 + + /* x^183296 mod p(x)` << 1, x^183360 mod p(x)` << 1 */ + .octa 0x00000001d29ee8e000000001748f9adc + + /* x^182272 mod p(x)` << 1, x^182336 mod p(x)` << 1 */ + .octa 0x000000006a08ace800000001be94ec00 + + /* x^181248 mod p(x)` << 1, x^181312 mod p(x)` << 1 */ + .octa 0x0000000127d4201000000000b74370d6 + + /* x^180224 mod p(x)` << 1, x^180288 mod p(x)` << 1 */ + .octa 0x0000000019d76b6200000001174d0b98 + + /* x^179200 mod p(x)` << 1, x^179264 mod p(x)` << 1 */ + .octa 0x00000001b1471f6e00000000befc06a4 + + /* x^178176 mod p(x)` << 1, x^178240 mod p(x)` << 1 */ + .octa 0x00000001f64c19cc00000001ae125288 + + /* x^177152 mod p(x)` << 1, x^177216 mod p(x)` << 1 */ + .octa 0x00000000003c0ea00000000095c19b34 + + /* x^176128 mod p(x)` << 1, x^176192 mod p(x)` << 1 */ + .octa 0x000000014d73abf600000001a78496f2 + + /* x^175104 mod p(x)` << 1, x^175168 mod p(x)` << 1 */ + .octa 0x00000001620eb84400000001ac5390a0 + + /* x^174080 mod p(x)` << 1, x^174144 mod p(x)` << 1 */ + .octa 0x0000000147655048000000002a80ed6e + + /* x^173056 mod p(x)` << 1, x^173120 mod p(x)` << 1 */ + .octa 0x0000000067b5077e00000001fa9b0128 + + /* x^172032 mod p(x)` << 1, x^172096 mod p(x)` << 1 */ + .octa 0x0000000010ffe20600000001ea94929e + + /* x^171008 mod p(x)` << 1, x^171072 mod p(x)` << 1 */ + .octa 0x000000000fee8f1e0000000125f4305c + + /* x^169984 mod p(x)` << 1, x^170048 mod p(x)` << 1 */ + .octa 0x00000001da26fbae00000001471e2002 + + /* x^168960 mod p(x)` << 1, x^169024 mod p(x)` << 1 */ + .octa 0x00000001b3a8bd880000000132d2253a + + /* x^167936 mod p(x)` << 1, x^168000 mod p(x)` << 1 */ + .octa 0x00000000e8f3898e00000000f26b3592 + + /* x^166912 mod p(x)` << 1, x^166976 mod p(x)` << 1 */ + .octa 0x00000000b0d0d28c00000000bc8b67b0 + + /* x^165888 mod p(x)` << 1, x^165952 mod p(x)` << 1 */ + .octa 0x0000000030f2a798000000013a826ef2 + + /* x^164864 mod p(x)` << 1, x^164928 mod p(x)` << 1 */ + .octa 0x000000000fba10020000000081482c84 + + /* x^163840 mod p(x)` << 1, x^163904 mod p(x)` << 1 */ + .octa 0x00000000bdb9bd7200000000e77307c2 + + /* x^162816 mod p(x)` << 1, x^162880 mod p(x)` << 1 */ + .octa 0x0000000075d3bf5a00000000d4a07ec8 + + /* x^161792 mod p(x)` << 1, x^161856 mod p(x)` << 1 */ + .octa 0x00000000ef1f98a00000000017102100 + + /* x^160768 mod p(x)` << 1, x^160832 mod p(x)` << 1 */ + .octa 0x00000000689c760200000000db406486 + + /* x^159744 mod p(x)` << 1, x^159808 mod p(x)` << 1 */ + .octa 0x000000016d5fa5fe0000000192db7f88 + + /* x^158720 mod p(x)` << 1, x^158784 mod p(x)` << 1 */ + .octa 0x00000001d0d2b9ca000000018bf67b1e + + /* x^157696 mod p(x)` << 1, x^157760 mod p(x)` << 1 */ + .octa 0x0000000041e7b470000000007c09163e + + /* x^156672 mod p(x)` << 1, x^156736 mod p(x)` << 1 */ + .octa 0x00000001cbb6495e000000000adac060 + + /* x^155648 mod p(x)` << 1, x^155712 mod p(x)` << 1 */ + .octa 0x000000010052a0b000000000bd8316ae + + /* x^154624 mod p(x)` << 1, x^154688 mod p(x)` << 1 */ + .octa 0x00000001d8effb5c000000019f09ab54 + + /* x^153600 mod p(x)` << 1, x^153664 mod p(x)` << 1 */ + .octa 0x00000001d969853c0000000125155542 + + /* x^152576 mod p(x)` << 1, x^152640 mod p(x)` << 1 */ + .octa 0x00000000523ccce2000000018fdb5882 + + /* x^151552 mod p(x)` << 1, x^151616 mod p(x)` << 1 */ + .octa 0x000000001e2436bc00000000e794b3f4 + + /* x^150528 mod p(x)` << 1, x^150592 mod p(x)` << 1 */ + .octa 0x00000000ddd1c3a2000000016f9bb022 + + /* x^149504 mod p(x)` << 1, x^149568 mod p(x)` << 1 */ + .octa 0x0000000019fcfe3800000000290c9978 + + /* x^148480 mod p(x)` << 1, x^148544 mod p(x)` << 1 */ + .octa 0x00000001ce95db640000000083c0f350 + + /* x^147456 mod p(x)` << 1, x^147520 mod p(x)` << 1 */ + .octa 0x00000000af5828060000000173ea6628 + + /* x^146432 mod p(x)` << 1, x^146496 mod p(x)` << 1 */ + .octa 0x00000001006388f600000001c8b4e00a + + /* x^145408 mod p(x)` << 1, x^145472 mod p(x)` << 1 */ + .octa 0x0000000179eca00a00000000de95d6aa + + /* x^144384 mod p(x)` << 1, x^144448 mod p(x)` << 1 */ + .octa 0x0000000122410a6a000000010b7f7248 + + /* x^143360 mod p(x)` << 1, x^143424 mod p(x)` << 1 */ + .octa 0x000000004288e87c00000001326e3a06 + + /* x^142336 mod p(x)` << 1, x^142400 mod p(x)` << 1 */ + .octa 0x000000016c5490da00000000bb62c2e6 + + /* x^141312 mod p(x)` << 1, x^141376 mod p(x)` << 1 */ + .octa 0x00000000d1c71f6e0000000156a4b2c2 + + /* x^140288 mod p(x)` << 1, x^140352 mod p(x)` << 1 */ + .octa 0x00000001b4ce08a6000000011dfe763a + + /* x^139264 mod p(x)` << 1, x^139328 mod p(x)` << 1 */ + .octa 0x00000001466ba60c000000007bcca8e2 + + /* x^138240 mod p(x)` << 1, x^138304 mod p(x)` << 1 */ + .octa 0x00000001f6c488a40000000186118faa + + /* x^137216 mod p(x)` << 1, x^137280 mod p(x)` << 1 */ + .octa 0x000000013bfb06820000000111a65a88 + + /* x^136192 mod p(x)` << 1, x^136256 mod p(x)` << 1 */ + .octa 0x00000000690e9e54000000003565e1c4 + + /* x^135168 mod p(x)` << 1, x^135232 mod p(x)` << 1 */ + .octa 0x00000000281346b6000000012ed02a82 + + /* x^134144 mod p(x)` << 1, x^134208 mod p(x)` << 1 */ + .octa 0x000000015646402400000000c486ecfc + + /* x^133120 mod p(x)` << 1, x^133184 mod p(x)` << 1 */ + .octa 0x000000016063a8dc0000000001b951b2 + + /* x^132096 mod p(x)` << 1, x^132160 mod p(x)` << 1 */ + .octa 0x0000000116a663620000000048143916 + + /* x^131072 mod p(x)` << 1, x^131136 mod p(x)` << 1 */ + .octa 0x000000017e8aa4d200000001dc2ae124 + + /* x^130048 mod p(x)` << 1, x^130112 mod p(x)` << 1 */ + .octa 0x00000001728eb10c00000001416c58d6 + + /* x^129024 mod p(x)` << 1, x^129088 mod p(x)` << 1 */ + .octa 0x00000001b08fd7fa00000000a479744a + + /* x^128000 mod p(x)` << 1, x^128064 mod p(x)` << 1 */ + .octa 0x00000001092a16e80000000096ca3a26 + + /* x^126976 mod p(x)` << 1, x^127040 mod p(x)` << 1 */ + .octa 0x00000000a505637c00000000ff223d4e + + /* x^125952 mod p(x)` << 1, x^126016 mod p(x)` << 1 */ + .octa 0x00000000d94869b2000000010e84da42 + + /* x^124928 mod p(x)` << 1, x^124992 mod p(x)` << 1 */ + .octa 0x00000001c8b203ae00000001b61ba3d0 + + /* x^123904 mod p(x)` << 1, x^123968 mod p(x)` << 1 */ + .octa 0x000000005704aea000000000680f2de8 + + /* x^122880 mod p(x)` << 1, x^122944 mod p(x)` << 1 */ + .octa 0x000000012e295fa2000000008772a9a8 + + /* x^121856 mod p(x)` << 1, x^121920 mod p(x)` << 1 */ + .octa 0x000000011d0908bc0000000155f295bc + + /* x^120832 mod p(x)` << 1, x^120896 mod p(x)` << 1 */ + .octa 0x0000000193ed97ea00000000595f9282 + + /* x^119808 mod p(x)` << 1, x^119872 mod p(x)` << 1 */ + .octa 0x000000013a0f1c520000000164b1c25a + + /* x^118784 mod p(x)` << 1, x^118848 mod p(x)` << 1 */ + .octa 0x000000010c2c40c000000000fbd67c50 + + /* x^117760 mod p(x)` << 1, x^117824 mod p(x)` << 1 */ + .octa 0x00000000ff6fac3e0000000096076268 + + /* x^116736 mod p(x)` << 1, x^116800 mod p(x)` << 1 */ + .octa 0x000000017b3609c000000001d288e4cc + + /* x^115712 mod p(x)` << 1, x^115776 mod p(x)` << 1 */ + .octa 0x0000000088c8c92200000001eaac1bdc + + /* x^114688 mod p(x)` << 1, x^114752 mod p(x)` << 1 */ + .octa 0x00000001751baae600000001f1ea39e2 + + /* x^113664 mod p(x)` << 1, x^113728 mod p(x)` << 1 */ + .octa 0x000000010795297200000001eb6506fc + + /* x^112640 mod p(x)` << 1, x^112704 mod p(x)` << 1 */ + .octa 0x0000000162b00abe000000010f806ffe + + /* x^111616 mod p(x)` << 1, x^111680 mod p(x)` << 1 */ + .octa 0x000000000d7b404c000000010408481e + + /* x^110592 mod p(x)` << 1, x^110656 mod p(x)` << 1 */ + .octa 0x00000000763b13d40000000188260534 + + /* x^109568 mod p(x)` << 1, x^109632 mod p(x)` << 1 */ + .octa 0x00000000f6dc22d80000000058fc73e0 + + /* x^108544 mod p(x)` << 1, x^108608 mod p(x)` << 1 */ + .octa 0x000000007daae06000000000391c59b8 + + /* x^107520 mod p(x)` << 1, x^107584 mod p(x)` << 1 */ + .octa 0x000000013359ab7c000000018b638400 + + /* x^106496 mod p(x)` << 1, x^106560 mod p(x)` << 1 */ + .octa 0x000000008add438a000000011738f5c4 + + /* x^105472 mod p(x)` << 1, x^105536 mod p(x)` << 1 */ + .octa 0x00000001edbefdea000000008cf7c6da + + /* x^104448 mod p(x)` << 1, x^104512 mod p(x)` << 1 */ + .octa 0x000000004104e0f800000001ef97fb16 + + /* x^103424 mod p(x)` << 1, x^103488 mod p(x)` << 1 */ + .octa 0x00000000b48a82220000000102130e20 + + /* x^102400 mod p(x)` << 1, x^102464 mod p(x)` << 1 */ + .octa 0x00000001bcb4684400000000db968898 + + /* x^101376 mod p(x)` << 1, x^101440 mod p(x)` << 1 */ + .octa 0x000000013293ce0a00000000b5047b5e + + /* x^100352 mod p(x)` << 1, x^100416 mod p(x)` << 1 */ + .octa 0x00000001710d0844000000010b90fdb2 + + /* x^99328 mod p(x)` << 1, x^99392 mod p(x)` << 1 */ + .octa 0x0000000117907f6e000000004834a32e + + /* x^98304 mod p(x)` << 1, x^98368 mod p(x)` << 1 */ + .octa 0x0000000087ddf93e0000000059c8f2b0 + + /* x^97280 mod p(x)` << 1, x^97344 mod p(x)` << 1 */ + .octa 0x000000005970e9b00000000122cec508 + + /* x^96256 mod p(x)` << 1, x^96320 mod p(x)` << 1 */ + .octa 0x0000000185b2b7d0000000000a330cda + + /* x^95232 mod p(x)` << 1, x^95296 mod p(x)` << 1 */ + .octa 0x00000001dcee0efc000000014a47148c + + /* x^94208 mod p(x)` << 1, x^94272 mod p(x)` << 1 */ + .octa 0x0000000030da27220000000042c61cb8 + + /* x^93184 mod p(x)` << 1, x^93248 mod p(x)` << 1 */ + .octa 0x000000012f925a180000000012fe6960 + + /* x^92160 mod p(x)` << 1, x^92224 mod p(x)` << 1 */ + .octa 0x00000000dd2e357c00000000dbda2c20 + + /* x^91136 mod p(x)` << 1, x^91200 mod p(x)` << 1 */ + .octa 0x00000000071c80de000000011122410c + + /* x^90112 mod p(x)` << 1, x^90176 mod p(x)` << 1 */ + .octa 0x000000011513140a00000000977b2070 + + /* x^89088 mod p(x)` << 1, x^89152 mod p(x)` << 1 */ + .octa 0x00000001df876e8e000000014050438e + + /* x^88064 mod p(x)` << 1, x^88128 mod p(x)` << 1 */ + .octa 0x000000015f81d6ce0000000147c840e8 + + /* x^87040 mod p(x)` << 1, x^87104 mod p(x)` << 1 */ + .octa 0x000000019dd94dbe00000001cc7c88ce + + /* x^86016 mod p(x)` << 1, x^86080 mod p(x)` << 1 */ + .octa 0x00000001373d206e00000001476b35a4 + + /* x^84992 mod p(x)` << 1, x^85056 mod p(x)` << 1 */ + .octa 0x00000000668ccade000000013d52d508 + + /* x^83968 mod p(x)` << 1, x^84032 mod p(x)` << 1 */ + .octa 0x00000001b192d268000000008e4be32e + + /* x^82944 mod p(x)` << 1, x^83008 mod p(x)` << 1 */ + .octa 0x00000000e30f3a7800000000024120fe + + /* x^81920 mod p(x)` << 1, x^81984 mod p(x)` << 1 */ + .octa 0x000000010ef1f7bc00000000ddecddb4 + + /* x^80896 mod p(x)` << 1, x^80960 mod p(x)` << 1 */ + .octa 0x00000001f5ac738000000000d4d403bc + + /* x^79872 mod p(x)` << 1, x^79936 mod p(x)` << 1 */ + .octa 0x000000011822ea7000000001734b89aa + + /* x^78848 mod p(x)` << 1, x^78912 mod p(x)` << 1 */ + .octa 0x00000000c3a33848000000010e7a58d6 + + /* x^77824 mod p(x)` << 1, x^77888 mod p(x)` << 1 */ + .octa 0x00000001bd151c2400000001f9f04e9c + + /* x^76800 mod p(x)` << 1, x^76864 mod p(x)` << 1 */ + .octa 0x0000000056002d7600000000b692225e + + /* x^75776 mod p(x)` << 1, x^75840 mod p(x)` << 1 */ + .octa 0x000000014657c4f4000000019b8d3f3e + + /* x^74752 mod p(x)` << 1, x^74816 mod p(x)` << 1 */ + .octa 0x0000000113742d7c00000001a874f11e + + /* x^73728 mod p(x)` << 1, x^73792 mod p(x)` << 1 */ + .octa 0x000000019c5920ba000000010d5a4254 + + /* x^72704 mod p(x)` << 1, x^72768 mod p(x)` << 1 */ + .octa 0x000000005216d2d600000000bbb2f5d6 + + /* x^71680 mod p(x)` << 1, x^71744 mod p(x)` << 1 */ + .octa 0x0000000136f5ad8a0000000179cc0e36 + + /* x^70656 mod p(x)` << 1, x^70720 mod p(x)` << 1 */ + .octa 0x000000018b07beb600000001dca1da4a + + /* x^69632 mod p(x)` << 1, x^69696 mod p(x)` << 1 */ + .octa 0x00000000db1e93b000000000feb1a192 + + /* x^68608 mod p(x)` << 1, x^68672 mod p(x)` << 1 */ + .octa 0x000000000b96fa3a00000000d1eeedd6 + + /* x^67584 mod p(x)` << 1, x^67648 mod p(x)` << 1 */ + .octa 0x00000001d9968af0000000008fad9bb4 + + /* x^66560 mod p(x)` << 1, x^66624 mod p(x)` << 1 */ + .octa 0x000000000e4a77a200000001884938e4 + + /* x^65536 mod p(x)` << 1, x^65600 mod p(x)` << 1 */ + .octa 0x00000000508c2ac800000001bc2e9bc0 + + /* x^64512 mod p(x)` << 1, x^64576 mod p(x)` << 1 */ + .octa 0x0000000021572a8000000001f9658a68 + + /* x^63488 mod p(x)` << 1, x^63552 mod p(x)` << 1 */ + .octa 0x00000001b859daf2000000001b9224fc + + /* x^62464 mod p(x)` << 1, x^62528 mod p(x)` << 1 */ + .octa 0x000000016f7884740000000055b2fb84 + + /* x^61440 mod p(x)` << 1, x^61504 mod p(x)` << 1 */ + .octa 0x00000001b438810e000000018b090348 + + /* x^60416 mod p(x)` << 1, x^60480 mod p(x)` << 1 */ + .octa 0x0000000095ddc6f2000000011ccbd5ea + + /* x^59392 mod p(x)` << 1, x^59456 mod p(x)` << 1 */ + .octa 0x00000001d977c20c0000000007ae47f8 + + /* x^58368 mod p(x)` << 1, x^58432 mod p(x)` << 1 */ + .octa 0x00000000ebedb99a0000000172acbec0 + + /* x^57344 mod p(x)` << 1, x^57408 mod p(x)` << 1 */ + .octa 0x00000001df9e9e9200000001c6e3ff20 + + /* x^56320 mod p(x)` << 1, x^56384 mod p(x)` << 1 */ + .octa 0x00000001a4a3f95200000000e1b38744 + + /* x^55296 mod p(x)` << 1, x^55360 mod p(x)` << 1 */ + .octa 0x00000000e2f5122000000000791585b2 + + /* x^54272 mod p(x)` << 1, x^54336 mod p(x)` << 1 */ + .octa 0x000000004aa01f3e00000000ac53b894 + + /* x^53248 mod p(x)` << 1, x^53312 mod p(x)` << 1 */ + .octa 0x00000000b3e90a5800000001ed5f2cf4 + + /* x^52224 mod p(x)` << 1, x^52288 mod p(x)` << 1 */ + .octa 0x000000000c9ca2aa00000001df48b2e0 + + /* x^51200 mod p(x)` << 1, x^51264 mod p(x)` << 1 */ + .octa 0x000000015168231600000000049c1c62 + + /* x^50176 mod p(x)` << 1, x^50240 mod p(x)` << 1 */ + .octa 0x0000000036fce78c000000017c460c12 + + /* x^49152 mod p(x)` << 1, x^49216 mod p(x)` << 1 */ + .octa 0x000000009037dc10000000015be4da7e + + /* x^48128 mod p(x)` << 1, x^48192 mod p(x)` << 1 */ + .octa 0x00000000d3298582000000010f38f668 + + /* x^47104 mod p(x)` << 1, x^47168 mod p(x)` << 1 */ + .octa 0x00000001b42e8ad60000000039f40a00 + + /* x^46080 mod p(x)` << 1, x^46144 mod p(x)` << 1 */ + .octa 0x00000000142a983800000000bd4c10c4 + + /* x^45056 mod p(x)` << 1, x^45120 mod p(x)` << 1 */ + .octa 0x0000000109c7f1900000000042db1d98 + + /* x^44032 mod p(x)` << 1, x^44096 mod p(x)` << 1 */ + .octa 0x0000000056ff931000000001c905bae6 + + /* x^43008 mod p(x)` << 1, x^43072 mod p(x)` << 1 */ + .octa 0x00000001594513aa00000000069d40ea + + /* x^41984 mod p(x)` << 1, x^42048 mod p(x)` << 1 */ + .octa 0x00000001e3b5b1e8000000008e4fbad0 + + /* x^40960 mod p(x)` << 1, x^41024 mod p(x)` << 1 */ + .octa 0x000000011dd5fc080000000047bedd46 + + /* x^39936 mod p(x)` << 1, x^40000 mod p(x)` << 1 */ + .octa 0x00000001675f0cc20000000026396bf8 + + /* x^38912 mod p(x)` << 1, x^38976 mod p(x)` << 1 */ + .octa 0x00000000d1c8dd4400000000379beb92 + + /* x^37888 mod p(x)` << 1, x^37952 mod p(x)` << 1 */ + .octa 0x0000000115ebd3d8000000000abae54a + + /* x^36864 mod p(x)` << 1, x^36928 mod p(x)` << 1 */ + .octa 0x00000001ecbd0dac0000000007e6a128 + + /* x^35840 mod p(x)` << 1, x^35904 mod p(x)` << 1 */ + .octa 0x00000000cdf67af2000000000ade29d2 + + /* x^34816 mod p(x)` << 1, x^34880 mod p(x)` << 1 */ + .octa 0x000000004c01ff4c00000000f974c45c + + /* x^33792 mod p(x)` << 1, x^33856 mod p(x)` << 1 */ + .octa 0x00000000f2d8657e00000000e77ac60a + + /* x^32768 mod p(x)` << 1, x^32832 mod p(x)` << 1 */ + .octa 0x000000006bae74c40000000145895816 + + /* x^31744 mod p(x)` << 1, x^31808 mod p(x)` << 1 */ + .octa 0x0000000152af8aa00000000038e362be + + /* x^30720 mod p(x)` << 1, x^30784 mod p(x)` << 1 */ + .octa 0x0000000004663802000000007f991a64 + + /* x^29696 mod p(x)` << 1, x^29760 mod p(x)` << 1 */ + .octa 0x00000001ab2f5afc00000000fa366d3a + + /* x^28672 mod p(x)` << 1, x^28736 mod p(x)` << 1 */ + .octa 0x0000000074a4ebd400000001a2bb34f0 + + /* x^27648 mod p(x)` << 1, x^27712 mod p(x)` << 1 */ + .octa 0x00000001d7ab3a4c0000000028a9981e + + /* x^26624 mod p(x)` << 1, x^26688 mod p(x)` << 1 */ + .octa 0x00000001a8da60c600000001dbc672be + + /* x^25600 mod p(x)` << 1, x^25664 mod p(x)` << 1 */ + .octa 0x000000013cf6382000000000b04d77f6 + + /* x^24576 mod p(x)` << 1, x^24640 mod p(x)` << 1 */ + .octa 0x00000000bec12e1e0000000124400d96 + + /* x^23552 mod p(x)` << 1, x^23616 mod p(x)` << 1 */ + .octa 0x00000001c6368010000000014ca4b414 + + /* x^22528 mod p(x)` << 1, x^22592 mod p(x)` << 1 */ + .octa 0x00000001e6e78758000000012fe2c938 + + /* x^21504 mod p(x)` << 1, x^21568 mod p(x)` << 1 */ + .octa 0x000000008d7f2b3c00000001faed01e6 + + /* x^20480 mod p(x)` << 1, x^20544 mod p(x)` << 1 */ + .octa 0x000000016b4a156e000000007e80ecfe + + /* x^19456 mod p(x)` << 1, x^19520 mod p(x)` << 1 */ + .octa 0x00000001c63cfeb60000000098daee94 + + /* x^18432 mod p(x)` << 1, x^18496 mod p(x)` << 1 */ + .octa 0x000000015f902670000000010a04edea + + /* x^17408 mod p(x)` << 1, x^17472 mod p(x)` << 1 */ + .octa 0x00000001cd5de11e00000001c00b4524 + + /* x^16384 mod p(x)` << 1, x^16448 mod p(x)` << 1 */ + .octa 0x000000001acaec540000000170296550 + + /* x^15360 mod p(x)` << 1, x^15424 mod p(x)` << 1 */ + .octa 0x000000002bd0ca780000000181afaa48 + + /* x^14336 mod p(x)` << 1, x^14400 mod p(x)` << 1 */ + .octa 0x0000000032d63d5c0000000185a31ffa + + /* x^13312 mod p(x)` << 1, x^13376 mod p(x)` << 1 */ + .octa 0x000000001c6d4e4c000000002469f608 + + /* x^12288 mod p(x)` << 1, x^12352 mod p(x)` << 1 */ + .octa 0x0000000106a60b92000000006980102a + + /* x^11264 mod p(x)` << 1, x^11328 mod p(x)` << 1 */ + .octa 0x00000000d3855e120000000111ea9ca8 + + /* x^10240 mod p(x)` << 1, x^10304 mod p(x)` << 1 */ + .octa 0x00000000e312563600000001bd1d29ce + + /* x^9216 mod p(x)` << 1, x^9280 mod p(x)` << 1 */ + .octa 0x000000009e8f7ea400000001b34b9580 + + /* x^8192 mod p(x)` << 1, x^8256 mod p(x)` << 1 */ + .octa 0x00000001c82e562c000000003076054e + + /* x^7168 mod p(x)` << 1, x^7232 mod p(x)` << 1 */ + .octa 0x00000000ca9f09ce000000012a608ea4 + + /* x^6144 mod p(x)` << 1, x^6208 mod p(x)` << 1 */ + .octa 0x00000000c63764e600000000784d05fe + + /* x^5120 mod p(x)` << 1, x^5184 mod p(x)` << 1 */ + .octa 0x0000000168d2e49e000000016ef0d82a + + /* x^4096 mod p(x)` << 1, x^4160 mod p(x)` << 1 */ + .octa 0x00000000e986c1480000000075bda454 + + /* x^3072 mod p(x)` << 1, x^3136 mod p(x)` << 1 */ + .octa 0x00000000cfb65894000000003dc0a1c4 + + /* x^2048 mod p(x)` << 1, x^2112 mod p(x)` << 1 */ + .octa 0x0000000111cadee400000000e9a5d8be + + /* x^1024 mod p(x)` << 1, x^1088 mod p(x)` << 1 */ + .octa 0x0000000171fb63ce00000001609bc4b4 + + .short_constants : + + /* Reduce final 1024-2048 bits to 64 bits, shifting 32 bits to include the trailing 32 bits of zeros */ + /* x^1952 mod p(x)`, x^1984 mod p(x)`, x^2016 mod p(x)`, x^2048 mod p(x)` */ + .octa 0x7fec2963e5bf80485cf015c388e56f72 + + /* x^1824 mod p(x)`, x^1856 mod p(x)`, x^1888 mod p(x)`, x^1920 mod p(x)` */ + .octa 0x38e888d4844752a9963a18920246e2e6 + + /* x^1696 mod p(x)`, x^1728 mod p(x)`, x^1760 mod p(x)`, x^1792 mod p(x)` */ + .octa 0x42316c00730206ad419a441956993a31 + + /* x^1568 mod p(x)`, x^1600 mod p(x)`, x^1632 mod p(x)`, x^1664 mod p(x)` */ + .octa 0x543d5c543e65ddf9924752ba2b830011 + + /* x^1440 mod p(x)`, x^1472 mod p(x)`, x^1504 mod p(x)`, x^1536 mod p(x)` */ + .octa 0x78e87aaf56767c9255bd7f9518e4a304 + + /* x^1312 mod p(x)`, x^1344 mod p(x)`, x^1376 mod p(x)`, x^1408 mod p(x)` */ + .octa 0x8f68fcec1903da7f6d76739fe0553f1e + + /* x^1184 mod p(x)`, x^1216 mod p(x)`, x^1248 mod p(x)`, x^1280 mod p(x)` */ + .octa 0x3f4840246791d588c133722b1fe0b5c3 + + /* x^1056 mod p(x)`, x^1088 mod p(x)`, x^1120 mod p(x)`, x^1152 mod p(x)` */ + .octa 0x34c96751b04de25a64b67ee0e55ef1f3 + + /* x^928 mod p(x)`, x^960 mod p(x)`, x^992 mod p(x)`, x^1024 mod p(x)` */ + .octa 0x156c8e180b4a395b069db049b8fdb1e7 + + /* x^800 mod p(x)`, x^832 mod p(x)`, x^864 mod p(x)`, x^896 mod p(x)` */ + .octa 0xe0b99ccbe661f7bea11bfaf3c9e90b9e + + /* x^672 mod p(x)`, x^704 mod p(x)`, x^736 mod p(x)`, x^768 mod p(x)` */ + .octa 0x041d37768cd75659817cdc5119b29a35 + + /* x^544 mod p(x)`, x^576 mod p(x)`, x^608 mod p(x)`, x^640 mod p(x)` */ + .octa 0x3a0777818cfaa9651ce9d94b36c41f1c + + /* x^416 mod p(x)`, x^448 mod p(x)`, x^480 mod p(x)`, x^512 mod p(x)` */ + .octa 0x0e148e8252377a554f256efcb82be955 + + /* x^288 mod p(x)`, x^320 mod p(x)`, x^352 mod p(x)`, x^384 mod p(x)` */ + .octa 0x9c25531d19e65ddeec1631edb2dea967 + + /* x^160 mod p(x)`, x^192 mod p(x)`, x^224 mod p(x)`, x^256 mod p(x)` */ + .octa 0x790606ff9957c0a65d27e147510ac59a + + /* x^32 mod p(x)`, x^64 mod p(x)`, x^96 mod p(x)`, x^128 mod p(x)` */ + .octa 0x82f63b786ea2d55ca66805eb18b8ea18 + + .barrett_constants : + /* 33 bit reflected Barrett constant m - (4^32)/n */ + .octa 0x000000000000000000000000dea713f1 /* x^64 div p(x)` */ + /* 33 bit reflected Barrett constant n */ + .octa 0x00000000000000000000000105ec76f1 +#endif /* __ASSEMBLER__ */ diff --git a/src/flow/folly_memcpy.h b/src/contrib/crc32/include/crc32/crc32_wrapper.h similarity index 75% rename from src/flow/folly_memcpy.h rename to src/contrib/crc32/include/crc32/crc32_wrapper.h index fd9d486..e2eddd0 100644 --- a/src/flow/folly_memcpy.h +++ b/src/contrib/crc32/include/crc32/crc32_wrapper.h @@ -1,5 +1,6 @@ + /* - * folly_memcpy.h + * crc32_wrapper.h * * This source file is part of the FoundationDB open source project * @@ -18,16 +19,15 @@ * limitations under the License. */ -#ifndef FLOW_FOLLY_MEMCPY_H -#define FLOW_FOLLY_MEMCPY_H +#ifndef FLOW_CRC32_WRAPPER_H +#define FLOW_CRC32_WRAPPER_H #pragma once -#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__AVX__) - +#ifdef __powerpc64__ extern "C" { -void* folly_memcpy(void* dst, const void* src, uint32_t length); +unsigned int crc32_vpmsum(unsigned int crc, unsigned char* p, unsigned long len); } -#endif // linux or bsd and avx +#endif // powerpc64 #endif diff --git a/src/flow/crc32c.h b/src/contrib/crc32/include/crc32/crc32c.h similarity index 100% rename from src/flow/crc32c.h rename to src/contrib/crc32/include/crc32/crc32c.h diff --git a/src/contrib/libb64/CMakeLists.txt b/src/contrib/libb64/CMakeLists.txt new file mode 100644 index 0000000..1ef665f --- /dev/null +++ b/src/contrib/libb64/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(libb64 STATIC cdecode.c cencode.c) +target_include_directories(libb64 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") diff --git a/src/fdbrpc/libb64/cdecode.c b/src/contrib/libb64/cdecode.c similarity index 56% rename from src/fdbrpc/libb64/cdecode.c rename to src/contrib/libb64/cdecode.c index 537f6af..5a833ab 100644 --- a/src/fdbrpc/libb64/cdecode.c +++ b/src/contrib/libb64/cdecode.c @@ -5,18 +5,18 @@ This is part of the libb64 project, and has been placed in the public domain. For details, see http://sourceforge.net/projects/libb64 */ -#include "cdecode.h" +#include "libb64/cdecode.h" -int base64_decode_value(char value_in) { - static const char decoding[] = { 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, - -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 }; - static const char decoding_size = sizeof(decoding); +int base64_decode_value(int value_in) { + static const int decoding[] = { 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, + -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 }; + static const int decoding_size = sizeof(decoding) / sizeof(decoding[0]); value_in -= 43; - if (value_in < 0 || value_in > decoding_size) + if (value_in < 0 || value_in >= decoding_size) return -1; - return decoding[(int)value_in]; + return decoding[value_in]; } void base64_init_decodestate(base64_decodestate* state_in) { @@ -27,7 +27,7 @@ void base64_init_decodestate(base64_decodestate* state_in) { int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in) { const char* codechar = code_in; char* plainchar = plaintext_out; - char fragment; + int fragment = 0; *plainchar = state_in->plainchar; @@ -40,9 +40,9 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex state_in->plainchar = *plainchar; return plainchar - plaintext_out; } - fragment = (char)base64_decode_value(*codechar++); + fragment = base64_decode_value(*codechar++); } while (fragment < 0); - *plainchar = (fragment & 0x03f) << 2; + *plainchar = (char)((fragment & 0x03f) << 2); case step_b: do { if (codechar == code_in + length_in) { @@ -50,10 +50,10 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex state_in->plainchar = *plainchar; return plainchar - plaintext_out; } - fragment = (char)base64_decode_value(*codechar++); + fragment = base64_decode_value(*codechar++); } while (fragment < 0); - *plainchar++ |= (fragment & 0x030) >> 4; - *plainchar = (fragment & 0x00f) << 4; + *plainchar++ |= (char)((fragment & 0x030) >> 4); + *plainchar = (char)((fragment & 0x00f) << 4); case step_c: do { if (codechar == code_in + length_in) { @@ -61,10 +61,10 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex state_in->plainchar = *plainchar; return plainchar - plaintext_out; } - fragment = (char)base64_decode_value(*codechar++); + fragment = base64_decode_value(*codechar++); } while (fragment < 0); - *plainchar++ |= (fragment & 0x03c) >> 2; - *plainchar = (fragment & 0x003) << 6; + *plainchar++ |= (char)((fragment & 0x03c) >> 2); + *plainchar = (char)((fragment & 0x003) << 6); case step_d: do { if (codechar == code_in + length_in) { @@ -72,9 +72,9 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex state_in->plainchar = *plainchar; return plainchar - plaintext_out; } - fragment = (char)base64_decode_value(*codechar++); + fragment = base64_decode_value(*codechar++); } while (fragment < 0); - *plainchar++ |= (fragment & 0x03f); + *plainchar++ |= (char)((fragment & 0x03f)); } } /* control should not reach here */ diff --git a/src/fdbrpc/libb64/cencode.c b/src/contrib/libb64/cencode.c similarity index 98% rename from src/fdbrpc/libb64/cencode.c rename to src/contrib/libb64/cencode.c index 94ba972..85e679c 100644 --- a/src/fdbrpc/libb64/cencode.c +++ b/src/contrib/libb64/cencode.c @@ -5,7 +5,7 @@ This is part of the libb64 project, and has been placed in the public domain. For details, see http://sourceforge.net/projects/libb64 */ -#include "cencode.h" +#include "libb64/cencode.h" const int CHARS_PER_LINE = 72; diff --git a/src/fdbrpc/libb64/cdecode.h b/src/contrib/libb64/include/libb64/cdecode.h similarity index 93% rename from src/fdbrpc/libb64/cdecode.h rename to src/contrib/libb64/include/libb64/cdecode.h index 26d5873..04655b3 100644 --- a/src/fdbrpc/libb64/cdecode.h +++ b/src/contrib/libb64/include/libb64/cdecode.h @@ -17,7 +17,7 @@ typedef struct { void base64_init_decodestate(base64_decodestate* state_in); -int base64_decode_value(char value_in); +int base64_decode_value(int value_in); int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in); diff --git a/src/fdbrpc/libb64/cencode.h b/src/contrib/libb64/include/libb64/cencode.h similarity index 100% rename from src/fdbrpc/libb64/cencode.h rename to src/contrib/libb64/include/libb64/cencode.h diff --git a/src/fdbrpc/libb64/decode.h b/src/contrib/libb64/include/libb64/decode.h similarity index 87% rename from src/fdbrpc/libb64/decode.h rename to src/contrib/libb64/include/libb64/decode.h index 74647e6..696e3f1 100644 --- a/src/fdbrpc/libb64/decode.h +++ b/src/contrib/libb64/include/libb64/decode.h @@ -9,6 +9,7 @@ For details, see http://sourceforge.net/projects/libb64 #define BASE64_DECODE_H #include +#include "libb64/encode.h" namespace base64 { extern "C" { @@ -48,6 +49,14 @@ struct decoder { delete[] code; delete[] plaintext; } + + static std::string from_string(std::string s) { + std::stringstream in(s); + std::stringstream out; + decoder dec; + dec.decode(in, out); + return out.str(); + } }; } // namespace base64 diff --git a/src/fdbrpc/libb64/encode.h b/src/contrib/libb64/include/libb64/encode.h similarity index 100% rename from src/fdbrpc/libb64/encode.h rename to src/contrib/libb64/include/libb64/encode.h diff --git a/src/fdbclient/ActorLineageProfiler.cpp b/src/fdbclient/ActorLineageProfiler.cpp index 0e16405..bcf3679 100644 --- a/src/fdbclient/ActorLineageProfiler.cpp +++ b/src/fdbclient/ActorLineageProfiler.cpp @@ -20,7 +20,7 @@ #include "flow/flow.h" #include "flow/singleton.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "fdbclient/ActorLineageProfiler.h" #include "fdbclient/NameLineage.h" #include diff --git a/src/fdbclient/AsyncFileS3BlobStore.actor.cpp b/src/fdbclient/AsyncFileS3BlobStore.actor.cpp index b97b95c..2429318 100644 --- a/src/fdbclient/AsyncFileS3BlobStore.actor.cpp +++ b/src/fdbclient/AsyncFileS3BlobStore.actor.cpp @@ -21,6 +21,7 @@ #include "fdbclient/AsyncFileS3BlobStore.actor.h" #include "fdbrpc/AsyncFileReadAhead.actor.h" #include "flow/UnitTest.h" +#include "flow/IConnection.h" #include "flow/actorcompiler.h" // has to be last include Future AsyncFileS3BlobStoreRead::size() const { diff --git a/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp b/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp index e9e7696..bfedaa3 100644 --- a/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp +++ b/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp @@ -23,6 +23,7 @@ #include "fdbclient/AsyncFileS3BlobStore.actor.h" #include "fdbrpc/AsyncFileReadAhead.actor.h" #include "flow/UnitTest.h" +#include "flow/IConnection.h" #include "flow/actorcompiler.h" // has to be last include Future AsyncFileS3BlobStoreRead::size() const { @@ -35,25 +36,25 @@ Future AsyncFileS3BlobStoreRead::read(void* data, int length, int64_t offse return m_bstore->readObject(m_bucket, m_object, data, length, offset); } - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" namespace { // This generated class is to be used only via sendStuff() - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" template - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" class SendStuffActorState { - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" public: - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" SendStuffActorState(int const& id,Reference const& t,int const& bytes) - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" : id(id), - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" t(t), - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" bytes(bytes) - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" { fdb_probe_actor_create("sendStuff", reinterpret_cast(this)); @@ -66,15 +67,15 @@ class SendStuffActorState { int a_body1(int loopDepth=0) { try { - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - printf("Starting fake sender %d which will send send %d bytes.\n", id, bytes); #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - ts = timer(); + printf("Starting fake sender %d which will send send %d bytes.\n", id, bytes); #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - total = 0; + ts = timer(); #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + total = 0; + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" ; - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -95,13 +96,13 @@ class SendStuffActorState { } int a_body1cont1(int loopDepth) { - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - double dur = timer() - ts; #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - printf("Sender %d: Sent %d in %fs, %f/s\n", id, total, dur, total / dur); + double dur = timer() - ts; #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + printf("Sender %d: Sent %d in %fs, %f/s\n", id, total, dur, total / dur); + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SendStuffActorState(); static_cast(this)->destroy(); return 0; } - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SendStuffActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -118,24 +119,24 @@ class SendStuffActorState { } int a_body1loopBody1(int loopDepth) { - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" if (!(total < bytes)) - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - r = std::min(deterministicRandom()->randomInt(0, 1000), bytes - total); #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + r = std::min(deterministicRandom()->randomInt(0, 1000), bytes - total); + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" StrictFuture __when_expr_0 = t->getAllowance(r); - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -155,18 +156,18 @@ class SendStuffActorState { } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" total += r; - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" total += r; - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -234,24 +235,24 @@ class SendStuffActorState { fdb_probe_actor_exit("sendStuff", reinterpret_cast(this), 0); } - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" int id; - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" Reference t; - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" int bytes; - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - double ts; #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + double ts; + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" int total; - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" int r; - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" }; // This generated class is to be used only via sendStuff() - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" class SendStuffActor final : public Actor, public ActorCallback< SendStuffActor, 0, Void >, public FastAllocated, public SendStuffActorState { - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -260,9 +261,9 @@ class SendStuffActor final : public Actor, public ActorCallback< SendStuff void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< SendStuffActor, 0, Void >; - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" SendStuffActor(int const& id,Reference const& t,int const& bytes) - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" : Actor(), SendStuffActorState(id, t, bytes) { @@ -286,104 +287,104 @@ friend struct ActorCallback< SendStuffActor, 0, Void >; } }; } - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" [[nodiscard]] Future sendStuff( int const& id, Reference const& t, int const& bytes ) { - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" return Future(new SendStuffActor(id, t, bytes)); - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" } -#line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" +#line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase50() - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" -template - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" -class FlowTestCase50ActorState { - #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" +// This generated class is to be used only via flowTestCase51() + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" +template + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" +class FlowTestCase51ActorState { + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" public: - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - FlowTestCase50ActorState(UnitTestParameters const& params) - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + FlowTestCase51ActorState(UnitTestParameters const& params) + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" : params(params) - #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase50", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase51", reinterpret_cast(this)); } - ~FlowTestCase50ActorState() + ~FlowTestCase51ActorState() { - fdb_probe_actor_destroy("flowTestCase50", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase51", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" if (g_network->isSimulated()) - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" { - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase50ActorState(); static_cast(this)->destroy(); return 0; } - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase50ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase51ActorState(); static_cast(this)->destroy(); return 0; } + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase51ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - limit = 100000; #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + limit = 100000; + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" t = Reference(new SpeedLimit(limit, 1)); - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - id = 1; #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - std::vector> f; + id = 1; #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - ts = timer(); + std::vector> f; #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - total = 0; + ts = timer(); #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - int s; + total = 0; #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - s = 500000; + int s; #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - f.push_back(sendStuff(id++, t, s)); + s = 500000; #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - total += s; - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" f.push_back(sendStuff(id++, t, s)); - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" total += s; + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + f.push_back(sendStuff(id++, t, s)); #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - s = 50000; + total += s; #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - f.push_back(sendStuff(id++, t, s)); + s = 50000; #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - total += s; - #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" f.push_back(sendStuff(id++, t, s)); - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" total += s; + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + f.push_back(sendStuff(id++, t, s)); #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - s = 5000; + total += s; #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - f.push_back(sendStuff(id++, t, s)); + s = 5000; #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + f.push_back(sendStuff(id++, t, s)); + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" total += s; - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" StrictFuture __when_expr_0 = waitForAll(f); - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -396,48 +397,48 @@ class FlowTestCase50ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase50ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase51ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(Void const& _,int loopDepth) { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - double dur = timer() - ts; #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - int speed = int(total / dur); + double dur = timer() - ts; #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - printf("Speed limit was %d, measured speed was %d\n", limit, speed); + int speed = int(total / dur); #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + printf("Speed limit was %d, measured speed was %d\n", limit, speed); + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" ASSERT(abs(speed - limit) / limit < .01); - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase50ActorState(); static_cast(this)->destroy(); return 0; } - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase50ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase51ActorState(); static_cast(this)->destroy(); return 0; } + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase51ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - double dur = timer() - ts; #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - int speed = int(total / dur); + double dur = timer() - ts; #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - printf("Speed limit was %d, measured speed was %d\n", limit, speed); + int speed = int(total / dur); #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + printf("Speed limit was %d, measured speed was %d\n", limit, speed); + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" ASSERT(abs(speed - limit) / limit < .01); - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase50ActorState(); static_cast(this)->destroy(); return 0; } - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase50ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase51ActorState(); static_cast(this)->destroy(); return 0; } + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase51ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -456,13 +457,13 @@ class FlowTestCase50ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase50Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase51Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase50Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase51Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase50", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase51", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -472,12 +473,12 @@ class FlowTestCase50ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase50", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase51", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase50Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase51Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase50", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase51", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -487,12 +488,12 @@ class FlowTestCase50ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase50", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase51", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase50Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase51Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase50", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase51", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -502,48 +503,48 @@ class FlowTestCase50ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase50", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase51", reinterpret_cast(this), 0); } - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" UnitTestParameters params; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - int limit; #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + int limit; + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" Reference t; - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" int id; - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - double ts; #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + double ts; + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" int total; - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase50() - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" -class FlowTestCase50Actor final : public Actor, public ActorCallback< FlowTestCase50Actor, 0, Void >, public FastAllocated, public FlowTestCase50ActorState { - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" +// This generated class is to be used only via flowTestCase51() + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" +class FlowTestCase51Actor final : public Actor, public ActorCallback< FlowTestCase51Actor, 0, Void >, public FastAllocated, public FlowTestCase51ActorState { + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase50Actor, 0, Void >; - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - FlowTestCase50Actor(UnitTestParameters const& params) - #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" +friend struct ActorCallback< FlowTestCase51Actor, 0, Void >; + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + FlowTestCase51Actor(UnitTestParameters const& params) + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" : Actor(), - FlowTestCase50ActorState(params) + FlowTestCase51ActorState(params) { - fdb_probe_actor_enter("flowTestCase50", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase51", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase50"); + this->lineage.setActorName("flowTestCase51"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase50", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase51", reinterpret_cast(this), -1); } void cancel() override @@ -551,18 +552,18 @@ friend struct ActorCallback< FlowTestCase50Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase50Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase51Actor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" -static Future flowTestCase50( UnitTestParameters const& params ) { - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" - return Future(new FlowTestCase50Actor(params)); - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" +static Future flowTestCase51( UnitTestParameters const& params ) { + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" + return Future(new FlowTestCase51Actor(params)); + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase50, "/backup/throttling") +ACTOR_TEST_CASE(flowTestCase51, "/backup/throttling") -#line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" +#line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.cpp" diff --git a/src/fdbclient/Atomic.cpp b/src/fdbclient/Atomic.cpp new file mode 100644 index 0000000..f2614e3 --- /dev/null +++ b/src/fdbclient/Atomic.cpp @@ -0,0 +1,47 @@ +/* + * Atomic.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/Atomic.h" +#include "flow/Arena.h" +#include "flow/UnitTest.h" + +void forceLinkAtomicTests() {} + +TEST_CASE("/Atomic/DoAppendIfFits") { + Arena arena; + { + Value existingValue = ValueRef(arena, "existing"_sr); + Value otherOperand = ValueRef(arena, "other"_sr); + auto result = doAppendIfFits(existingValue, otherOperand, arena); + ASSERT(compare("existingother"_sr, result) == 0); + } + { + Value existingValue = makeString(CLIENT_KNOBS->VALUE_SIZE_LIMIT - 1, arena); + Value otherOperand = makeString(2, arena); + deterministicRandom()->randomBytes(mutateString(existingValue), existingValue.size()); + deterministicRandom()->randomBytes(mutateString(otherOperand), otherOperand.size()); + // Appended values cannot fit in result, should return existingValue + auto result = doAppendIfFits(existingValue, otherOperand, arena); + ASSERT(compare(existingValue, result) == 0); + } + return Void(); +} + +// TODO: Add more unit tests for atomic operations defined in Atomic.h diff --git a/src/fdbclient/AuditUtils.actor.cpp b/src/fdbclient/AuditUtils.actor.cpp new file mode 100644 index 0000000..1788c9a --- /dev/null +++ b/src/fdbclient/AuditUtils.actor.cpp @@ -0,0 +1,1141 @@ +/* + * AuditUtils.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/AuditUtils.actor.h" + +#include "fdbclient/Audit.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/NativeAPI.actor.h" +#include "fdbclient/ReadYourWrites.h" +#include "fdbclient/ClientKnobs.h" +#include + +#include "flow/actorcompiler.h" // has to be last include + +void clearAuditProgressMetadata(Transaction* tr, AuditType auditType, UID auditId) { + // There are two possible places to store AuditProgressMetadata: + // (1) auditServerBasedProgressRangeFor or (2) auditRangeBasedProgressRangeFor + // Which place stores the progress metadata is decided by DDAudit design + // This function enforces the DDAudit design when clear the progress metadata + // Design: for replica/ha/locationMetadata, the audit always writes to RangeBased space + // for SSShard, the audit always writes to ServerBased space + // This function clears the progress metadata accordingly + if (auditType == AuditType::ValidateStorageServerShard) { + tr->clear(auditServerBasedProgressRangeFor(auditType, auditId)); + } else if (auditType == AuditType::ValidateHA) { + tr->clear(auditRangeBasedProgressRangeFor(auditType, auditId)); + } else if (auditType == AuditType::ValidateReplica) { + tr->clear(auditRangeBasedProgressRangeFor(auditType, auditId)); + } else if (auditType == AuditType::ValidateLocationMetadata) { + tr->clear(auditRangeBasedProgressRangeFor(auditType, auditId)); + } else { + UNREACHABLE(); + } + return; +} + +ACTOR Future checkStorageServerRemoved(Database cx, UID ssid) { + state bool res = false; + state Transaction tr(cx); + TraceEvent(SevDebug, "AuditUtilStorageServerRemovedStart").detail("StorageServer", ssid); + + loop { + try { + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + Optional serverListValue = wait(tr.get(serverListKeyFor(ssid))); + if (!serverListValue.present()) { + res = true; // SS is removed + } + break; + } catch (Error& e) { + TraceEvent(SevDebug, "AuditUtilStorageServerRemovedError") + .errorUnsuppressed(e) + .detail("StorageServer", ssid); + wait(tr.onError(e)); + } + } + + TraceEvent(SevDebug, "AuditUtilStorageServerRemovedEnd").detail("StorageServer", ssid).detail("Removed", res); + return res; +} + +ACTOR Future cancelAuditMetadata(Database cx, AuditType auditType, UID auditId) { + try { + state Transaction tr(cx); + TraceEvent(SevInfo, "AuditUtilCancelAuditMetadataStart", auditId) + .detail("AuditKey", auditKey(auditType, auditId)); + loop { + try { + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + Optional res_ = wait(tr.get(auditKey(auditType, auditId))); + if (!res_.present()) { // has been cancelled + break; // Nothing to cancel + } + state AuditStorageState toCancelState = decodeAuditStorageState(res_.get()); + // For a zombie audit, it is in running state + ASSERT(toCancelState.id == auditId && toCancelState.getType() == auditType); + toCancelState.setPhase(AuditPhase::Failed); + tr.set(auditKey(toCancelState.getType(), toCancelState.id), auditStorageStateValue(toCancelState)); + clearAuditProgressMetadata(&tr, toCancelState.getType(), toCancelState.id); + wait(tr.commit()); + TraceEvent(SevInfo, "AuditUtilCancelAuditMetadataEnd", auditId) + .detail("AuditKey", auditKey(auditType, auditId)); + break; + } catch (Error& e) { + TraceEvent(SevWarn, "AuditUtilCancelAuditMetadataError", auditId) + .detail("AuditKey", auditKey(auditType, auditId)); + wait(tr.onError(e)); + } + } + } catch (Error& e) { + throw cancel_audit_storage_failed(); + } + return Void(); +} + +AuditPhase stringToAuditPhase(std::string auditPhaseStr) { + // Convert chars of auditPhaseStr to lower case + std::transform(auditPhaseStr.begin(), auditPhaseStr.end(), auditPhaseStr.begin(), [](unsigned char c) { + return std::tolower(c); + }); + if (auditPhaseStr == "running") { + return AuditPhase::Running; + } else if (auditPhaseStr == "complete") { + return AuditPhase::Complete; + } else if (auditPhaseStr == "failed") { + return AuditPhase::Failed; + } else if (auditPhaseStr == "error") { + return AuditPhase::Error; + } else { + return AuditPhase::Invalid; + } +} + +// This is not transactional +ACTOR Future> getAuditStates(Database cx, + AuditType auditType, + bool newFirst, + Optional num, + Optional phase) { + state Transaction tr(cx); + state std::vector auditStates; + state Key readBegin; + state Key readEnd; + state Reverse reverse = newFirst ? Reverse::True : Reverse::False; + if (num.present() && num.get() == 0) { + return auditStates; + } + loop { + try { + readBegin = auditKeyRange(auditType).begin; + readEnd = auditKeyRange(auditType).end; + auditStates.clear(); + while (true) { + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + KeyRangeRef rangeToRead(readBegin, readEnd); + state RangeResult res = wait(tr.getRange(rangeToRead, + num.present() ? GetRangeLimits(num.get()) : GetRangeLimits(), + Snapshot::False, + reverse)); + for (int i = 0; i < res.size(); ++i) { + const AuditStorageState auditState = decodeAuditStorageState(res[i].value); + if (phase.present() && auditState.getPhase() != phase.get()) { + continue; + } + auditStates.push_back(auditState); + if (num.present() && auditStates.size() == num.get()) { + return auditStates; // since res.more is not reliable when GetRangeLimits is set to 1 + } + } + if (!res.more) { + break; + } + if (newFirst) { + readEnd = res.front().key; // we are reversely reading the range + } else { + readBegin = keyAfter(res.back().key); + } + tr.reset(); + } + break; + } catch (Error& e) { + wait(tr.onError(e)); + } + } + return auditStates; +} + +ACTOR Future clearAuditMetadataForType(Database cx, + AuditType auditType, + UID maxAuditIdToClear, + int numFinishAuditToKeep) { + state Transaction tr(cx); + state int numFinishAuditCleaned = 0; // We regard "Complete" and "Failed" audits as finish audits + TraceEvent(SevDebug, "AuditUtilClearAuditMetadataForTypeStart") + .detail("AuditType", auditType) + .detail("MaxAuditIdToClear", maxAuditIdToClear); + + try { + loop { // Cleanup until succeed or facing unretriable error + try { + state std::vector auditStates = + wait(getAuditStates(cx, auditType, /*newFirst=*/false)); + // auditStates has ascending order of auditIds + + // Read and clear are not atomic + int numFinishAudit = 0; + for (const auto& auditState : auditStates) { + if (auditState.id.first() > maxAuditIdToClear.first()) { + continue; // ignore any audit with a larger auditId than the input threshold + } + if (auditState.getPhase() == AuditPhase::Complete || auditState.getPhase() == AuditPhase::Failed) { + numFinishAudit++; + } + } + const int numFinishAuditToClean = numFinishAudit - numFinishAuditToKeep; + numFinishAuditCleaned = 0; + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + for (const auto& auditState : auditStates) { + if (auditState.id.first() > maxAuditIdToClear.first()) { + continue; // ignore any audit with a larger auditId than the input threshold + } + ASSERT(auditState.getType() == auditType); + if (auditState.getPhase() == AuditPhase::Complete && + numFinishAuditCleaned < numFinishAuditToClean) { + // Clear audit metadata + tr.clear(auditKey(auditType, auditState.id)); + // No need to clear progress metadata of Complete audits + // which has been done when Complete phase persistent + numFinishAuditCleaned++; + } else if (auditState.getPhase() == AuditPhase::Failed && + numFinishAuditCleaned < numFinishAuditToClean) { + // Clear audit metadata + tr.clear(auditKey(auditType, auditState.id)); + // Clear progress metadata + clearAuditProgressMetadata(&tr, auditType, auditState.id); + numFinishAuditCleaned++; + } + // For a zombie audit, it is in running state + } + wait(tr.commit()); + TraceEvent(SevDebug, "AuditUtilClearAuditMetadataForTypeEnd") + .detail("AuditType", auditType) + .detail("NumCleanedFinishAudits", numFinishAuditCleaned); + break; + + } catch (Error& e) { + wait(tr.onError(e)); + } + } + } catch (Error& e) { + TraceEvent(SevInfo, "AuditUtilClearAuditMetadataForTypeError") + .detail("AuditType", auditType) + .errorUnsuppressed(e); + // We do not want audit cleanup effects DD + } + + return Void(); +} + +ACTOR static Future checkMoveKeysLockForAudit(Transaction* tr, + MoveKeyLockInfo lock, + bool isDDEnabled, + bool isWrite = true) { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + if (!isDDEnabled) { + TraceEvent(SevDebug, "AuditUtilDisabledByInMemoryCheck").log(); + throw movekeys_conflict(); // need a new name + } + Optional readVal = wait(tr->get(moveKeysLockOwnerKey)); + UID currentOwner = readVal.present() ? BinaryReader::fromStringRef(readVal.get(), Unversioned()) : UID(); + + if (currentOwner == lock.prevOwner) { + // Check that the previous owner hasn't touched the lock since we took it + Optional readVal = wait(tr->get(moveKeysLockWriteKey)); + UID lastWrite = readVal.present() ? BinaryReader::fromStringRef(readVal.get(), Unversioned()) : UID(); + if (lastWrite != lock.prevWrite) { + TraceEvent(SevDebug, "ConflictWithPreviousOwner"); + throw movekeys_conflict(); // need a new name + } + // Take the lock + if (isWrite) { + BinaryWriter wrMyOwner(Unversioned()); + wrMyOwner << lock.myOwner; + tr->set(moveKeysLockOwnerKey, wrMyOwner.toValue()); + BinaryWriter wrLastWrite(Unversioned()); + UID lastWriter = deterministicRandom()->randomUniqueID(); + wrLastWrite << lastWriter; + tr->set(moveKeysLockWriteKey, wrLastWrite.toValue()); + TraceEvent("AuditUtilCheckMoveKeysLock") + .detail("PrevOwner", lock.prevOwner.toString()) + .detail("PrevWrite", lock.prevWrite.toString()) + .detail("MyOwner", lock.myOwner.toString()) + .detail("Writer", lastWriter.toString()); + } + return Void(); + } else if (currentOwner == lock.myOwner) { + if (isWrite) { + // Touch the lock, preventing overlapping attempts to take it + BinaryWriter wrLastWrite(Unversioned()); + wrLastWrite << deterministicRandom()->randomUniqueID(); + tr->set(moveKeysLockWriteKey, wrLastWrite.toValue()); + // Make this transaction self-conflicting so the database will not execute it twice with the same write key + tr->makeSelfConflicting(); + } + return Void(); + } else { + TraceEvent(SevDebug, "AuditUtilConflictWithNewOwner") + .detail("CurrentOwner", currentOwner.toString()) + .detail("PrevOwner", lock.prevOwner.toString()) + .detail("PrevWrite", lock.prevWrite.toString()) + .detail("MyOwner", lock.myOwner.toString()); + throw movekeys_conflict(); // need a new name + } +} + +ACTOR Future persistNewAuditState(Database cx, + AuditStorageState auditState, + MoveKeyLockInfo lock, + bool ddEnabled) { + ASSERT(!auditState.id.isValid()); + state Transaction tr(cx); + state UID auditId; + state AuditStorageState latestExistingAuditState; + TraceEvent(SevDebug, "AuditUtilPersistedNewAuditStateStart", auditId); + try { + loop { + try { + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + wait(checkMoveKeysLockForAudit(&tr, lock, ddEnabled, true)); + RangeResult res = + wait(tr.getRange(auditKeyRange(auditState.getType()), 1, Snapshot::False, Reverse::True)); + ASSERT(res.size() == 0 || res.size() == 1); + uint64_t nextId = 1; + if (!res.empty()) { + latestExistingAuditState = decodeAuditStorageState(res[0].value); + if (auditId.isValid()) { // new audit state persist gets failed last time + // Check to confirm no other actor can persist new audit state + ASSERT(latestExistingAuditState.id.first() <= auditId.first()); + if (latestExistingAuditState.id.first() == auditId.first()) { + // The new audit Id has been successfully persisted + // No more action needed + return auditId; + } else { + // When latestExistingAuditState.id.first() < auditId + // The new audit Id is failed to persist + // Check to confirm no other actor can persist new audit state + ASSERT(auditId.first() == latestExistingAuditState.id.first() + 1); + } + } + nextId = latestExistingAuditState.id.first() + 1; + } + auditId = UID(nextId, 0LL); + auditState.id = auditId; + TraceEvent(SevVerbose, "AuditUtilPersistedNewAuditStateIdSelected", auditId) + .detail("AuditKey", auditKey(auditState.getType(), auditId)); + tr.set(auditKey(auditState.getType(), auditId), auditStorageStateValue(auditState)); + wait(tr.commit()); + TraceEvent(SevDebug, "AuditUtilPersistedNewAuditState", auditId) + .detail("AuditKey", auditKey(auditState.getType(), auditId)); + break; + } catch (Error& e) { + TraceEvent(SevDebug, "AuditUtilPersistedNewAuditStateError", auditId) + .errorUnsuppressed(e) + .detail("AuditKey", auditKey(auditState.getType(), auditId)); + wait(tr.onError(e)); + } + } + } catch (Error& e) { + TraceEvent(SevWarn, "AuditUtilPersistedNewAuditStateUnretriableError", auditId) + .errorUnsuppressed(e) + .detail("AuditKey", auditKey(auditState.getType(), auditId)); + ASSERT_WE_THINK(e.code() == error_code_actor_cancelled || e.code() == error_code_movekeys_conflict); + if (e.code() == error_code_actor_cancelled) { + throw e; + } else { + throw persist_new_audit_metadata_error(); + } + } + + return auditId; +} + +ACTOR Future persistAuditState(Database cx, + AuditStorageState auditState, + std::string context, + MoveKeyLockInfo lock, + bool ddEnabled) { + state Transaction tr(cx); + state AuditPhase auditPhase = auditState.getPhase(); + ASSERT(auditPhase == AuditPhase::Complete || auditPhase == AuditPhase::Failed || auditPhase == AuditPhase::Error); + + loop { + try { + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + wait(checkMoveKeysLockForAudit(&tr, lock, ddEnabled, true)); + // Clear persistent progress data of the new audit if complete + if (auditPhase == AuditPhase::Complete) { + clearAuditProgressMetadata(&tr, auditState.getType(), auditState.id); + } // We keep the progess metadata of Failed and Error audits for further investigations + // Check existing state + Optional res_ = wait(tr.get(auditKey(auditState.getType(), auditState.id))); + if (!res_.present()) { // has been cancelled + throw audit_storage_cancelled(); + } else { + const AuditStorageState currentState = decodeAuditStorageState(res_.get()); + ASSERT(currentState.id == auditState.id && currentState.getType() == auditState.getType()); + if (currentState.getPhase() == AuditPhase::Failed) { + throw audit_storage_cancelled(); + } + } + // Persist audit result + tr.set(auditKey(auditState.getType(), auditState.id), auditStorageStateValue(auditState)); + wait(tr.commit()); + TraceEvent(SevInfo, "AuditUtilPersistAuditState", auditState.id) + .detail("AuditID", auditState.id) + .detail("AuditType", auditState.getType()) + .detail("AuditPhase", auditPhase) + .detail("AuditKey", auditKey(auditState.getType(), auditState.id)) + .detail("Context", context); + break; + } catch (Error& e) { + TraceEvent(SevWarn, "AuditUtilPersistAuditStateError", auditState.id) + .errorUnsuppressed(e) + .detail("AuditID", auditState.id) + .detail("AuditType", auditState.getType()) + .detail("AuditPhase", auditPhase) + .detail("AuditKey", auditKey(auditState.getType(), auditState.id)) + .detail("Context", context); + wait(tr.onError(e)); + } + } + + return Void(); +} + +ACTOR Future getAuditState(Database cx, AuditType type, UID id) { + state Transaction tr(cx); + state Optional res; + + loop { + try { + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + Optional res_ = wait(tr.get(auditKey(type, id))); + res = res_; + TraceEvent(SevDebug, "AuditUtilReadAuditState", id) + .detail("AuditID", id) + .detail("AuditType", type) + .detail("AuditKey", auditKey(type, id)); + break; + } catch (Error& e) { + TraceEvent(SevDebug, "AuditUtilReadAuditStateError", id) + .errorUnsuppressed(e) + .detail("AuditID", id) + .detail("AuditType", type) + .detail("AuditKey", auditKey(type, id)); + wait(tr.onError(e)); + } + } + + if (!res.present()) { + throw key_not_found(); + } + + return decodeAuditStorageState(res.get()); +} + +ACTOR Future persistAuditStateByRange(Database cx, AuditStorageState auditState) { + state Transaction tr(cx); + + loop { + try { + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + Optional ddAuditState_ = wait(tr.get(auditKey(auditState.getType(), auditState.id))); + if (!ddAuditState_.present()) { + throw audit_storage_cancelled(); + } + AuditStorageState ddAuditState = decodeAuditStorageState(ddAuditState_.get()); + ASSERT(ddAuditState.ddId.isValid()); + if (ddAuditState.ddId != auditState.ddId) { + throw audit_storage_task_outdated(); // a new dd starts and this audit task is outdated + } + // It is possible ddAuditState is complete while some progress is about to persist + // Since doAuditOnStorageServer may repeatedly issue multiple requests (see getReplyUnlessFailedFor) + // For this case, no need to proceed. Sliently exit + if (ddAuditState.getPhase() == AuditPhase::Complete) { + break; + } + // If this is the same dd, the phase must be following + ASSERT(ddAuditState.getPhase() == AuditPhase::Running || ddAuditState.getPhase() == AuditPhase::Failed); + if (ddAuditState.getPhase() == AuditPhase::Failed) { + throw audit_storage_cancelled(); + } + wait(krmSetRange(&tr, + auditRangeBasedProgressPrefixFor(auditState.getType(), auditState.id), + auditState.range, + auditStorageStateValue(auditState))); + wait(tr.commit()); + break; + } catch (Error& e) { + TraceEvent(SevDebug, "AuditUtilPersistAuditStateByRangeError") + .errorUnsuppressed(e) + .detail("AuditID", auditState.id) + .detail("AuditType", auditState.getType()) + .detail("AuditPhase", auditState.getPhase()); + wait(tr.onError(e)); + } + } + + return Void(); +} + +ACTOR Future> getAuditStateByRange(Database cx, + AuditType type, + UID auditId, + KeyRange range) { + state RangeResult auditStates; + state Transaction tr(cx); + + loop { + try { + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + RangeResult res_ = wait(krmGetRanges(&tr, + auditRangeBasedProgressPrefixFor(type, auditId), + range, + CLIENT_KNOBS->KRM_GET_RANGE_LIMIT, + CLIENT_KNOBS->KRM_GET_RANGE_LIMIT_BYTES)); + auditStates = res_; + break; + } catch (Error& e) { + TraceEvent(SevDebug, "AuditUtilGetAuditStateForRangeError").errorUnsuppressed(e).detail("AuditID", auditId); + wait(tr.onError(e)); + } + } + + // For a range of state that have value read from auditRangeBasedProgressPrefixFor + // add the state with the same range to res (these states are persisted by auditServers) + // For a range of state that does not have value read from auditRangeBasedProgressPrefixFor + // add an default (Invalid phase) state with the same range to res (DD will start audit for these ranges) + std::vector res; + for (int i = 0; i < auditStates.size() - 1; ++i) { + KeyRange currentRange = KeyRangeRef(auditStates[i].key, auditStates[i + 1].key); + AuditStorageState auditState(auditId, currentRange, type); + if (!auditStates[i].value.empty()) { + AuditStorageState auditState_ = decodeAuditStorageState(auditStates[i].value); + auditState.setPhase(auditState_.getPhase()); + auditState.error = auditState_.error; + } + res.push_back(auditState); + } + + return res; +} + +ACTOR Future persistAuditStateByServer(Database cx, AuditStorageState auditState) { + state Transaction tr(cx); + + loop { + try { + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + Optional ddAuditState_ = wait(tr.get(auditKey(auditState.getType(), auditState.id))); + if (!ddAuditState_.present()) { + throw audit_storage_cancelled(); + } + AuditStorageState ddAuditState = decodeAuditStorageState(ddAuditState_.get()); + ASSERT(ddAuditState.ddId.isValid()); + if (ddAuditState.ddId != auditState.ddId) { + throw audit_storage_task_outdated(); // a new dd starts and this audit task is outdated + } + // It is possible ddAuditState is complete while some progress is about to persist + // Since doAuditOnStorageServer may repeatedly issue multiple requests (see getReplyUnlessFailedFor) + // For this case, no need to proceed. Sliently exit + if (ddAuditState.getPhase() == AuditPhase::Complete) { + break; + } + // If this is the same dd, the phase must be following + ASSERT(ddAuditState.getPhase() == AuditPhase::Running || ddAuditState.getPhase() == AuditPhase::Failed); + if (ddAuditState.getPhase() == AuditPhase::Failed) { + throw audit_storage_cancelled(); + } + wait(krmSetRange( + &tr, + auditServerBasedProgressPrefixFor(auditState.getType(), auditState.id, auditState.auditServerId), + auditState.range, + auditStorageStateValue(auditState))); + wait(tr.commit()); + break; + } catch (Error& e) { + TraceEvent(SevDebug, "AuditUtilPersistAuditStateByRangeError") + .errorUnsuppressed(e) + .detail("AuditID", auditState.id) + .detail("AuditType", auditState.getType()) + .detail("AuditPhase", auditState.getPhase()) + .detail("AuditServerID", auditState.auditServerId); + wait(tr.onError(e)); + } + } + + return Void(); +} + +ACTOR Future> getAuditStateByServer(Database cx, + AuditType type, + UID auditId, + UID auditServerId, + KeyRange range) { + state RangeResult auditStates; + state Transaction tr(cx); + + loop { + try { + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + RangeResult res_ = wait(krmGetRanges(&tr, + auditServerBasedProgressPrefixFor(type, auditId, auditServerId), + range, + CLIENT_KNOBS->KRM_GET_RANGE_LIMIT, + CLIENT_KNOBS->KRM_GET_RANGE_LIMIT_BYTES)); + auditStates = res_; + break; + } catch (Error& e) { + TraceEvent(SevDebug, "AuditUtilGetAuditStateForRangeError") + .errorUnsuppressed(e) + .detail("AuditID", auditId) + .detail("AuditType", type) + .detail("AuditServerID", auditServerId); + wait(tr.onError(e)); + } + } + + // For a range of state that have value read from auditServerBasedProgressPrefixFor + // add the state with the same range to res (these states are persisted by auditServers) + // For a range of state that does not have value read from auditServerBasedProgressPrefixFor + // add an default (Invalid phase) state with the same range to res (DD will start audit for these ranges) + std::vector res; + for (int i = 0; i < auditStates.size() - 1; ++i) { + KeyRange currentRange = KeyRangeRef(auditStates[i].key, auditStates[i + 1].key); + AuditStorageState auditState(auditId, currentRange, type); + if (!auditStates[i].value.empty()) { + AuditStorageState auditState_ = decodeAuditStorageState(auditStates[i].value); + auditState.setPhase(auditState_.getPhase()); + auditState.error = auditState_.error; + } + res.push_back(auditState); + } + + return res; +} + +ACTOR Future checkAuditProgressCompleteByRange(Database cx, + AuditType auditType, + UID auditId, + KeyRange auditRange) { + ASSERT(auditType == AuditType::ValidateHA || auditType == AuditType::ValidateReplica || + auditType == AuditType::ValidateLocationMetadata); + state KeyRange rangeToRead = auditRange; + state Key rangeToReadBegin = auditRange.begin; + state int retryCount = 0; + while (rangeToReadBegin < auditRange.end) { + loop { + try { + rangeToRead = KeyRangeRef(rangeToReadBegin, auditRange.end); + state std::vector auditStates = + wait(getAuditStateByRange(cx, auditType, auditId, rangeToRead)); + for (int i = 0; i < auditStates.size(); i++) { + AuditPhase phase = auditStates[i].getPhase(); + if (phase == AuditPhase::Invalid) { + TraceEvent(SevWarn, "AuditUtilCheckAuditProgressNotFinished") + .detail("AuditID", auditId) + .detail("AuditRange", auditRange) + .detail("AuditType", auditType) + .detail("UnfinishedRange", auditStates[i].range); + return false; + } + } + rangeToReadBegin = auditStates.back().range.end; + break; + } catch (Error& e) { + if (e.code() == error_code_actor_cancelled) { + throw e; + } + if (retryCount > 30) { + TraceEvent(SevWarn, "AuditUtilCheckAuditProgressFailed") + .detail("AuditID", auditId) + .detail("AuditRange", auditRange) + .detail("AuditType", auditType); + throw audit_storage_failed(); + } + wait(delay(0.5)); + retryCount++; + } + } + } + TraceEvent(SevInfo, "AuditUtilCheckAuditProgressFinish") + .detail("AuditID", auditId) + .detail("AuditRange", auditRange) + .detail("AuditType", auditType); + return true; +} + +ACTOR Future checkAuditProgressCompleteByServer(Database cx, + AuditType auditType, + UID auditId, + KeyRange auditRange, + UID serverId, + std::shared_ptr> checkProgressBudget) { + ASSERT(auditType == AuditType::ValidateStorageServerShard); + state KeyRange rangeToRead = auditRange; + state Key rangeToReadBegin = auditRange.begin; + state int retryCount = 0; + while (rangeToReadBegin < auditRange.end) { + loop { + try { + rangeToRead = KeyRangeRef(rangeToReadBegin, auditRange.end); + state std::vector auditStates = + wait(getAuditStateByServer(cx, auditType, auditId, serverId, rangeToRead)); + for (int i = 0; i < auditStates.size(); i++) { + AuditPhase phase = auditStates[i].getPhase(); + if (phase == AuditPhase::Invalid) { + TraceEvent(SevWarn, "AuditUtilCheckAuditProgressNotFinished") + .detail("ServerID", serverId) + .detail("AuditID", auditId) + .detail("AuditRange", auditRange) + .detail("AuditType", auditType) + .detail("UnfinishedRange", auditStates[i].range); + checkProgressBudget->set(checkProgressBudget->get() + 1); + return false; + } + } + rangeToReadBegin = auditStates.back().range.end; + break; + } catch (Error& e) { + if (e.code() == error_code_actor_cancelled) { + throw e; + } + if (retryCount > 30) { + TraceEvent(SevWarn, "AuditUtilCheckAuditProgressFailed") + .detail("ServerID", serverId) + .detail("AuditID", auditId) + .detail("AuditRange", auditRange) + .detail("AuditType", auditType); + checkProgressBudget->set(checkProgressBudget->get() + 1); + throw audit_storage_failed(); + } + wait(delay(0.5)); + retryCount++; + } + } + } + checkProgressBudget->set(checkProgressBudget->get() + 1); + TraceEvent(SevInfo, "AuditUtilCheckAuditProgressFinish") + .detail("ServerID", serverId) + .detail("AuditID", auditId) + .detail("AuditRange", auditRange) + .detail("AuditType", auditType); + return true; +} + +// Load RUNNING audit states to resume, clean up COMPLETE and FAILED audit states +// Update ddId for RUNNING audit states +ACTOR Future> initAuditMetadata(Database cx, + MoveKeyLockInfo lock, + bool ddEnabled, + UID dataDistributorId, + int persistFinishAuditCount) { + state std::unordered_map> existingAuditStates; + state std::vector auditStatesToResume; + state Transaction tr(cx); + state int retryCount = 0; + loop { + try { + // Load existing audit states and update ddId in audit states + existingAuditStates.clear(); + auditStatesToResume.clear(); + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + wait(checkMoveKeysLockForAudit(&tr, lock, ddEnabled, true)); + RangeResult result = wait(tr.getRange(auditKeys, CLIENT_KNOBS->TOO_MANY)); + if (result.more || result.size() >= CLIENT_KNOBS->TOO_MANY) { + TraceEvent(g_network->isSimulated() ? SevError : SevWarnAlways, + "AuditUtilLoadMetadataIncomplete", + dataDistributorId) + .detail("ResMore", result.more) + .detail("ResSize", result.size()); + } + for (int i = 0; i < result.size(); ++i) { + auto auditState = decodeAuditStorageState(result[i].value); + TraceEvent(SevVerbose, "AuditUtilLoadMetadataEach", dataDistributorId) + .detail("CurrentDDID", dataDistributorId) + .detail("AuditDDID", auditState.ddId) + .detail("AuditType", auditState.getType()) + .detail("AuditID", auditState.id) + .detail("AuditPhase", auditState.getPhase()); + if (auditState.getPhase() == AuditPhase::Running) { + AuditStorageState toUpdate = auditState; + toUpdate.ddId = dataDistributorId; + tr.set(auditKey(toUpdate.getType(), toUpdate.id), auditStorageStateValue(toUpdate)); + } + existingAuditStates[auditState.getType()].push_back(auditState); + } + // Cleanup Complete/Failed audit metadata for each type separately + for (const auto& [auditType, _] : existingAuditStates) { + int numFinishAudit = 0; // "finish" audits include Complete/Failed audits + for (const auto& auditState : existingAuditStates[auditType]) { + if (auditState.getPhase() == AuditPhase::Complete || auditState.getPhase() == AuditPhase::Failed) { + numFinishAudit++; + } + } + const int numFinishAuditsToClear = numFinishAudit - persistFinishAuditCount; + int numFinishAuditsCleared = 0; + std::sort(existingAuditStates[auditType].begin(), + existingAuditStates[auditType].end(), + [](AuditStorageState a, AuditStorageState b) { + return a.id < b.id; // Inplacement sort in ascending order + }); + for (const auto& auditState : existingAuditStates[auditType]) { + if (auditState.getPhase() == AuditPhase::Failed) { + if (numFinishAuditsCleared < numFinishAuditsToClear) { + // Clear both audit metadata and corresponding progress metadata + tr.clear(auditKey(auditState.getType(), auditState.id)); + clearAuditProgressMetadata(&tr, auditState.getType(), auditState.id); + numFinishAuditsCleared++; + TraceEvent(SevInfo, "AuditUtilMetadataCleared", dataDistributorId) + .detail("AuditID", auditState.id) + .detail("AuditType", auditState.getType()) + .detail("AuditRange", auditState.range); + } + } else if (auditState.getPhase() == AuditPhase::Complete) { + if (numFinishAuditsCleared < numFinishAuditsToClear) { + // Clear audit metadata only + // No need to clear the corresponding progress metadata + // since it has been cleared for Complete audits + tr.clear(auditKey(auditState.getType(), auditState.id)); + numFinishAuditsCleared++; + TraceEvent(SevInfo, "AuditUtilMetadataCleared", dataDistributorId) + .detail("AuditID", auditState.id) + .detail("AuditType", auditState.getType()) + .detail("AuditRange", auditState.range); + } + } else if (auditState.getPhase() == AuditPhase::Running) { + auditStatesToResume.push_back(auditState); + TraceEvent(SevInfo, "AuditUtilMetadataAddedToResume", dataDistributorId) + .detail("AuditID", auditState.id) + .detail("AuditType", auditState.getType()) + .detail("AuditRange", auditState.range); + } + } + } + wait(tr.commit()); + break; + } catch (Error& e) { + if (e.code() == error_code_actor_cancelled || e.code() == error_code_movekeys_conflict) { + throw e; + } + if (retryCount > 50) { + TraceEvent(SevWarnAlways, "AuditUtilInitAuditMetadataExceedRetryMax", dataDistributorId) + .errorUnsuppressed(e); + break; + } + try { + wait(tr.onError(e)); + } catch (Error& e) { + retryCount++; + tr.reset(); + } + } + } + return auditStatesToResume; +} + +// Check if any pair of ranges are exclusive with each other +// This is not a part in consistency check of audit metadata +// This is used for checking the validity of inputs to rangesSame() +bool elementsAreExclusiveWithEachOther(std::vector ranges) { + ASSERT(std::is_sorted(ranges.begin(), ranges.end(), KeyRangeRef::ArbitraryOrder())); + for (int i = 0; i < ranges.size() - 1; ++i) { + if (ranges[i].end > ranges[i + 1].begin) { + TraceEvent(SevError, "AuditUtilElementsAreNotExclusiveWithEachOther").detail("Ranges", describe(ranges)); + return false; + } + } + return true; +} + +// Check if any range is empty in the given list of ranges +// This is not a part in consistency check of audit metadata +// This is used for checking the validity of inputs to rangesSame() +bool noEmptyRangeInRanges(std::vector ranges) { + for (const auto& range : ranges) { + if (range.empty()) { + return false; + } + } + return true; +} + +// Given a list of ranges, where ranges can overlap with each other +// Return a list of exclusive ranges which covers the ranges exactly +// the same as the input list of ranges +std::vector coalesceRangeList(std::vector ranges) { + std::sort(ranges.begin(), ranges.end(), [](KeyRange a, KeyRange b) { return a.begin < b.begin; }); + std::vector res; + for (const auto& range : ranges) { + if (res.empty()) { + res.push_back(range); + continue; + } + if (range.begin <= res.back().end) { + if (range.end > res.back().end) { // update res.back if current range extends the back range + KeyRange newBack = Standalone(KeyRangeRef(res.back().begin, range.end)); + res.pop_back(); + res.push_back(newBack); + } + } else { + res.push_back(range); + } + } + return res; +} + +// Given two lists of ranges --- rangesA and rangesB, check if two lists are identical +// If not, return the mismatched two ranges of rangeA and rangeB respectively +Optional> rangesSame(std::vector rangesA, std::vector rangesB) { + if (g_network->isSimulated()) { + ASSERT(noEmptyRangeInRanges(rangesA)); + ASSERT(noEmptyRangeInRanges(rangesB)); + } + KeyRange emptyRange; + if (rangesA.empty() && rangesB.empty()) { // no mismatch + return Optional>(); + } else if (rangesA.empty() && !rangesB.empty()) { // rangesA is empty while rangesB has a range + return std::make_pair(emptyRange, rangesB.front()); + } else if (!rangesA.empty() && rangesB.empty()) { // rangesB is empty while rangesA has a range + return std::make_pair(rangesA.front(), emptyRange); + } + TraceEvent(SevVerbose, "AuditUtilRangesSameBeforeSort").detail("RangesA", rangesA).detail("Rangesb", rangesB); + // sort in ascending order + std::sort(rangesA.begin(), rangesA.end(), [](KeyRange a, KeyRange b) { return a.begin < b.begin; }); + std::sort(rangesB.begin(), rangesB.end(), [](KeyRange a, KeyRange b) { return a.begin < b.begin; }); + TraceEvent(SevVerbose, "AuditUtilRangesSameAfterSort").detail("RangesA", rangesA).detail("Rangesb", rangesB); + if (g_network->isSimulated()) { + ASSERT(elementsAreExclusiveWithEachOther(rangesA)); + ASSERT(elementsAreExclusiveWithEachOther(rangesB)); + } + if (rangesA.front().begin != rangesB.front().begin) { // rangeList heads mismatch + return std::make_pair(rangesA.front(), rangesB.front()); + } else if (rangesA.back().end != rangesB.back().end) { // rangeList backs mismatch + return std::make_pair(rangesA.back(), rangesB.back()); + } + int ia = 0; + int ib = 0; + KeyRangeRef rangeA = rangesA[0]; + KeyRangeRef rangeB = rangesB[0]; + KeyRange lastRangeA = Standalone(rangeA); + KeyRange lastRangeB = Standalone(rangeB); + while (true) { + if (rangeA.begin == rangeB.begin) { + if (rangeA.end == rangeB.end) { + if (rangeA.end == rangesA.back().end) { + break; + } + ++ia; + ++ib; + rangeA = rangesA[ia]; + rangeB = rangesB[ib]; + lastRangeA = Standalone(rangeA); + lastRangeB = Standalone(rangeB); + } else if (rangeA.end > rangeB.end) { + rangeA = KeyRangeRef(rangeB.end, rangeA.end); + ++ib; + rangeB = rangesB[ib]; + lastRangeB = Standalone(rangeB); + } else { + rangeB = KeyRangeRef(rangeA.end, rangeB.end); + ++ia; + rangeA = rangesA[ia]; + lastRangeA = Standalone(rangeA); + } + } else { + return std::make_pair(lastRangeA, lastRangeB); + } + } + return Optional>(); +} + +// Given an input server, get ranges within the input range via the input transaction +// from the perspective of ServerKeys system key space +// Input: (1) SS id; (2) transaction tr; (3) within range +// Return AuditGetServerKeysRes, including: (1) complete range by a single read range; +// (2) verison of the read; (3) ranges of the input SS +ACTOR Future getThisServerKeysFromServerKeys(UID serverID, Transaction* tr, KeyRange range) { + state RangeResult readResult; + state AuditGetServerKeysRes res; + + try { + wait(store(readResult, + krmGetRanges(tr, + serverKeysPrefixFor(serverID), + range, + CLIENT_KNOBS->KRM_GET_RANGE_LIMIT, + CLIENT_KNOBS->KRM_GET_RANGE_LIMIT_BYTES))); + Future grvF = tr->getReadVersion(); + if (!grvF.isReady()) { + TraceEvent(SevWarnAlways, "AuditUtilReadServerKeysGRVError", serverID); + throw audit_storage_cancelled(); + } + Version readAtVersion = grvF.get(); + + TraceEvent(SevVerbose, "AuditUtilGetThisServerKeysFromServerKeysReadDone", serverID) + .detail("Range", range) + .detail("Prefix", serverKeysPrefixFor(serverID)) + .detail("ResultSize", readResult.size()) + .detail("AduitServerID", serverID); + + std::vector ownRanges; + for (int i = 0; i < readResult.size() - 1; ++i) { + TraceEvent(SevVerbose, "AuditUtilGetThisServerKeysFromServerKeysAddToResult", serverID) + .detail("ValueIsServerKeysFalse", readResult[i].value == serverKeysFalse) + .detail("ServerHasKey", serverHasKey(readResult[i].value)) + .detail("Range", KeyRangeRef(readResult[i].key, readResult[i + 1].key)) + .detail("AduitServerID", serverID); + if (serverHasKey(readResult[i].value)) { + KeyRange shardRange; + ownRanges.push_back(Standalone(KeyRangeRef(readResult[i].key, readResult[i + 1].key))); + } + } + const KeyRange completeRange = Standalone(KeyRangeRef(range.begin, readResult.back().key)); + TraceEvent(SevVerbose, "AuditUtilGetThisServerKeysFromServerKeysEnd", serverID) + .detail("AduitServerID", serverID) + .detail("Range", range) + .detail("Prefix", serverKeysPrefixFor(serverID)) + .detail("ReadAtVersion", readAtVersion) + .detail("CompleteRange", completeRange) + .detail("ResultSize", ownRanges.size()); + res = AuditGetServerKeysRes(completeRange, readAtVersion, serverID, ownRanges, readResult.logicalSize()); + + } catch (Error& e) { + TraceEvent(SevDebug, "AuditUtilGetThisServerKeysError", serverID) + .errorUnsuppressed(e) + .detail("AduitServerID", serverID); + throw e; + } + + return res; +} + +// Given an input server, get ranges within the input range via the input transaction +// from the perspective of KeyServers system key space +// Input: (1) Audit Server ID (for logging); (2) transaction tr; (3) within range +// Return AuditGetKeyServersRes, including : (1) complete range by a single read range; (2) verison of the read; +// (3) map between SSes and their ranges --- in KeyServers space, a range corresponds to multiple SSes +ACTOR Future getShardMapFromKeyServers(UID auditServerId, Transaction* tr, KeyRange range) { + state AuditGetKeyServersRes res; + state std::vector> actors; + state RangeResult readResult; + state RangeResult UIDtoTagMap; + state int64_t totalShardsCount = 0; + state int64_t shardsInAnonymousPhysicalShardCount = 0; + + try { + // read + actors.push_back(store(readResult, + krmGetRanges(tr, + keyServersPrefix, + range, + CLIENT_KNOBS->KRM_GET_RANGE_LIMIT, + CLIENT_KNOBS->KRM_GET_RANGE_LIMIT_BYTES))); + actors.push_back(store(UIDtoTagMap, tr->getRange(serverTagKeys, CLIENT_KNOBS->TOO_MANY))); + wait(waitForAll(actors)); + if (UIDtoTagMap.more || UIDtoTagMap.size() >= CLIENT_KNOBS->TOO_MANY) { + TraceEvent(g_network->isSimulated() ? SevError : SevWarnAlways, + "AuditUtilReadKeyServersReadTagError", + auditServerId); + throw audit_storage_cancelled(); + } + Future grvF = tr->getReadVersion(); + if (!grvF.isReady()) { + TraceEvent(SevWarnAlways, "AuditUtilReadKeyServersGRVError", auditServerId); + throw audit_storage_cancelled(); + } + Version readAtVersion = grvF.get(); + + TraceEvent(SevVerbose, "AuditUtilGetThisServerKeysFromKeyServersReadDone", auditServerId) + .detail("Range", range) + .detail("ResultSize", readResult.size()) + .detail("AduitServerID", auditServerId); + + // produce result + std::unordered_map> serverOwnRanges; + for (int i = 0; i < readResult.size() - 1; ++i) { + std::vector src; + std::vector dest; + UID srcID; + UID destID; + decodeKeyServersValue(UIDtoTagMap, readResult[i].value, src, dest, srcID, destID); + if (srcID == anonymousShardId) { + shardsInAnonymousPhysicalShardCount++; + } + totalShardsCount++; + std::vector servers(src.size() + dest.size()); + std::merge(src.begin(), src.end(), dest.begin(), dest.end(), servers.begin()); + for (auto& ssid : servers) { + serverOwnRanges[ssid].push_back(Standalone(KeyRangeRef(readResult[i].key, readResult[i + 1].key))); + } + } + const KeyRange completeRange = Standalone(KeyRangeRef(range.begin, readResult.back().key)); + TraceEvent(SevInfo, "AuditUtilGetThisServerKeysFromKeyServersEnd", auditServerId) + .detail("Range", range) + .detail("CompleteRange", completeRange) + .detail("AtVersion", readAtVersion) + .detail("ShardsInAnonymousPhysicalShardCount", shardsInAnonymousPhysicalShardCount) + .detail("TotalShardsCount", totalShardsCount); + res = AuditGetKeyServersRes(completeRange, readAtVersion, serverOwnRanges, readResult.logicalSize()); + + } catch (Error& e) { + TraceEvent(SevDebug, "AuditUtilGetThisServerKeysFromKeyServersError", auditServerId) + .errorUnsuppressed(e) + .detail("AuditServerId", auditServerId); + throw e; + } + + return res; +} diff --git a/src/fdbclient/AuditUtils.actor.g.cpp b/src/fdbclient/AuditUtils.actor.g.cpp new file mode 100644 index 0000000..21c3a71 --- /dev/null +++ b/src/fdbclient/AuditUtils.actor.g.cpp @@ -0,0 +1,8868 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +/* + * AuditUtils.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/AuditUtils.actor.h" + +#include "fdbclient/Audit.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/NativeAPI.actor.h" +#include "fdbclient/ReadYourWrites.h" +#include "fdbclient/ClientKnobs.h" +#include + +#include "flow/actorcompiler.h" // has to be last include + +void clearAuditProgressMetadata(Transaction* tr, AuditType auditType, UID auditId) { + // There are two possible places to store AuditProgressMetadata: + // (1) auditServerBasedProgressRangeFor or (2) auditRangeBasedProgressRangeFor + // Which place stores the progress metadata is decided by DDAudit design + // This function enforces the DDAudit design when clear the progress metadata + // Design: for replica/ha/locationMetadata, the audit always writes to RangeBased space + // for SSShard, the audit always writes to ServerBased space + // This function clears the progress metadata accordingly + if (auditType == AuditType::ValidateStorageServerShard) { + tr->clear(auditServerBasedProgressRangeFor(auditType, auditId)); + } else if (auditType == AuditType::ValidateHA) { + tr->clear(auditRangeBasedProgressRangeFor(auditType, auditId)); + } else if (auditType == AuditType::ValidateReplica) { + tr->clear(auditRangeBasedProgressRangeFor(auditType, auditId)); + } else if (auditType == AuditType::ValidateLocationMetadata) { + tr->clear(auditRangeBasedProgressRangeFor(auditType, auditId)); + } else { + UNREACHABLE(); + } + return; +} + + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via checkStorageServerRemoved() + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class CheckStorageServerRemovedActorState { + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + CheckStorageServerRemovedActorState(Database const& cx,UID const& ssid) + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : cx(cx), + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ssid(ssid), + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res(false), + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr(cx) + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("checkStorageServerRemoved", reinterpret_cast(this)); + + } + ~CheckStorageServerRemovedActorState() + { + fdb_probe_actor_destroy("checkStorageServerRemoved", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilStorageServerRemovedStart").detail("StorageServer", ssid); + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CheckStorageServerRemovedActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilStorageServerRemovedEnd").detail("StorageServer", ssid).detail("Removed", res); + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(res); this->~CheckStorageServerRemovedActorState(); static_cast(this)->destroy(); return 0; } + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(std::move(res)); // state_var_RVO + this->~CheckStorageServerRemovedActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture> __when_expr_0 = tr.get(serverListKeyFor(ssid)); + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilStorageServerRemovedError") .errorUnsuppressed(e) .detail("StorageServer", ssid); + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = tr.onError(e); + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Optional const& serverListValue,int loopDepth) + { + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!serverListValue.present()) + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res = true; + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont2(Optional && serverListValue,int loopDepth) + { + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!serverListValue.present()) + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res = true; + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& serverListValue,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(serverListValue, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && serverListValue,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(serverListValue), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckStorageServerRemovedActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< CheckStorageServerRemovedActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("checkStorageServerRemoved", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkStorageServerRemoved", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CheckStorageServerRemovedActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("checkStorageServerRemoved", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkStorageServerRemoved", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CheckStorageServerRemovedActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("checkStorageServerRemoved", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkStorageServerRemoved", reinterpret_cast(this), 0); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckStorageServerRemovedActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CheckStorageServerRemovedActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("checkStorageServerRemoved", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkStorageServerRemoved", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< CheckStorageServerRemovedActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("checkStorageServerRemoved", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkStorageServerRemoved", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< CheckStorageServerRemovedActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("checkStorageServerRemoved", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkStorageServerRemoved", reinterpret_cast(this), 1); + + } + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Database cx; + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID ssid; + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + bool res; + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction tr; + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via checkStorageServerRemoved() + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class CheckStorageServerRemovedActor final : public Actor, public ActorCallback< CheckStorageServerRemovedActor, 0, Optional >, public ActorCallback< CheckStorageServerRemovedActor, 1, Void >, public FastAllocated, public CheckStorageServerRemovedActorState { + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CheckStorageServerRemovedActor, 0, Optional >; +friend struct ActorCallback< CheckStorageServerRemovedActor, 1, Void >; + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + CheckStorageServerRemovedActor(Database const& cx,UID const& ssid) + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor(), + CheckStorageServerRemovedActorState(cx, ssid) + { + fdb_probe_actor_enter("checkStorageServerRemoved", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("checkStorageServerRemoved"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("checkStorageServerRemoved", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CheckStorageServerRemovedActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CheckStorageServerRemovedActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future checkStorageServerRemoved( Database const& cx, UID const& ssid ) { + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future(new CheckStorageServerRemovedActor(cx, ssid)); + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via cancelAuditMetadata() + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class CancelAuditMetadataActorState { + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + CancelAuditMetadataActorState(Database const& cx,AuditType const& auditType,UID const& auditId) + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : cx(cx), + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditType(auditType), + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditId(auditId) + #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("cancelAuditMetadata", reinterpret_cast(this)); + + } + ~CancelAuditMetadataActorState() + { + fdb_probe_actor_destroy("cancelAuditMetadata", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + try { + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr = Transaction(cx); + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilCancelAuditMetadataStart", auditId) .detail("AuditKey", auditKey(auditType, auditId)); + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CancelAuditMetadataActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CancelAuditMetadataActorState(); static_cast(this)->destroy(); return 0; } + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CancelAuditMetadataActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(cancel_audit_storage_failed(), loopDepth); + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2(int loopDepth) + { + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture> __when_expr_0 = tr.get(auditKey(auditType, auditId)); + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevWarn, "AuditUtilCancelAuditMetadataError", auditId) .detail("AuditKey", auditKey(auditType, auditId)); + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_2 = tr.onError(e); + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Optional const& res_,int loopDepth) + { + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!res_.present()) + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + toCancelState = decodeAuditStorageState(res_.get()); + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(toCancelState.id == auditId && toCancelState.getType() == auditType); + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + toCancelState.setPhase(AuditPhase::Failed); + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.set(auditKey(toCancelState.getType(), toCancelState.id), auditStorageStateValue(toCancelState)); + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + clearAuditProgressMetadata(&tr, toCancelState.getType(), toCancelState.id); + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = tr.commit(); + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Optional && res_,int loopDepth) + { + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!res_.present()) + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + toCancelState = decodeAuditStorageState(res_.get()); + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(toCancelState.id == auditId && toCancelState.getType() == auditType); + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + toCancelState.setPhase(AuditPhase::Failed); + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.set(auditKey(toCancelState.getType(), toCancelState.id), auditStorageStateValue(toCancelState)); + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + clearAuditProgressMetadata(&tr, toCancelState.getType(), toCancelState.id); + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = tr.commit(); + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& res_,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(res_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && res_,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(res_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CancelAuditMetadataActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< CancelAuditMetadataActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("cancelAuditMetadata", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cancelAuditMetadata", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CancelAuditMetadataActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("cancelAuditMetadata", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cancelAuditMetadata", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CancelAuditMetadataActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("cancelAuditMetadata", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cancelAuditMetadata", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilCancelAuditMetadataEnd", auditId) .detail("AuditKey", auditKey(auditType, auditId)); + #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilCancelAuditMetadataEnd", auditId) .detail("AuditKey", auditKey(auditType, auditId)); + #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CancelAuditMetadataActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CancelAuditMetadataActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("cancelAuditMetadata", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cancelAuditMetadata", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< CancelAuditMetadataActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("cancelAuditMetadata", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cancelAuditMetadata", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< CancelAuditMetadataActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("cancelAuditMetadata", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cancelAuditMetadata", reinterpret_cast(this), 1); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CancelAuditMetadataActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CancelAuditMetadataActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("cancelAuditMetadata", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("cancelAuditMetadata", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< CancelAuditMetadataActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("cancelAuditMetadata", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("cancelAuditMetadata", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< CancelAuditMetadataActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("cancelAuditMetadata", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("cancelAuditMetadata", reinterpret_cast(this), 2); + + } + int a_body1cont3(int loopDepth) + { + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Database cx; + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditType auditType; + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID auditId; + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction tr; + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState toCancelState; + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via cancelAuditMetadata() + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class CancelAuditMetadataActor final : public Actor, public ActorCallback< CancelAuditMetadataActor, 0, Optional >, public ActorCallback< CancelAuditMetadataActor, 1, Void >, public ActorCallback< CancelAuditMetadataActor, 2, Void >, public FastAllocated, public CancelAuditMetadataActorState { + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CancelAuditMetadataActor, 0, Optional >; +friend struct ActorCallback< CancelAuditMetadataActor, 1, Void >; +friend struct ActorCallback< CancelAuditMetadataActor, 2, Void >; + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + CancelAuditMetadataActor(Database const& cx,AuditType const& auditType,UID const& auditId) + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor(), + CancelAuditMetadataActorState(cx, auditType, auditId) + { + fdb_probe_actor_enter("cancelAuditMetadata", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("cancelAuditMetadata"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("cancelAuditMetadata", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CancelAuditMetadataActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CancelAuditMetadataActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< CancelAuditMetadataActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future cancelAuditMetadata( Database const& cx, AuditType const& auditType, UID const& auditId ) { + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future(new CancelAuditMetadataActor(cx, auditType, auditId)); + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + +AuditPhase stringToAuditPhase(std::string auditPhaseStr) { + // Convert chars of auditPhaseStr to lower case + std::transform(auditPhaseStr.begin(), auditPhaseStr.end(), auditPhaseStr.begin(), [](unsigned char c) { + return std::tolower(c); + }); + if (auditPhaseStr == "running") { + return AuditPhase::Running; + } else if (auditPhaseStr == "complete") { + return AuditPhase::Complete; + } else if (auditPhaseStr == "failed") { + return AuditPhase::Failed; + } else if (auditPhaseStr == "error") { + return AuditPhase::Error; + } else { + return AuditPhase::Invalid; + } +} + +// This is not transactional + #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via getAuditStates() + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class GetAuditStatesActorState { + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + GetAuditStatesActorState(Database const& cx,AuditType const& auditType,bool const& newFirst,Optional const& num,Optional const& phase) + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : cx(cx), + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditType(auditType), + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + newFirst(newFirst), + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + num(num), + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + phase(phase), + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr(cx), + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStates(), + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + readBegin(), + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + readEnd(), + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + reverse(newFirst ? Reverse::True : Reverse::False) + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("getAuditStates", reinterpret_cast(this)); + + } + ~GetAuditStatesActorState() + { + fdb_probe_actor_destroy("getAuditStates", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (num.present() && num.get() == 0) + #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(auditStates); this->~GetAuditStatesActorState(); static_cast(this)->destroy(); return 0; } + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::move(auditStates)); // state_var_RVO + this->~GetAuditStatesActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetAuditStatesActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(auditStates); this->~GetAuditStatesActorState(); static_cast(this)->destroy(); return 0; } + #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::move(auditStates)); // state_var_RVO + this->~GetAuditStatesActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + readBegin = auditKeyRange(auditType).begin; + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + readEnd = auditKeyRange(auditType).end; + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStates.clear(); + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopBody1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = tr.onError(e); + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1(int loopDepth) + { + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + KeyRangeRef rangeToRead(readBegin, readEnd); + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_0 = tr.getRange(rangeToRead, num.present() ? GetRangeLimits(num.get()) : GetRangeLimits(), Snapshot::False, reverse); + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1break1(int loopDepth) + { + try { + return a_body1loopBody1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1loopBody1cont1(int loopDepth) + { + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for(int i = 0;i < res.size();++i) { + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + const AuditStorageState auditState = decodeAuditStorageState(res[i].value); + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (phase.present() && auditState.getPhase() != phase.get()) + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + continue; + } + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStates.push_back(auditState); + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (num.present() && auditStates.size() == num.get()) + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(auditStates); this->~GetAuditStatesActorState(); static_cast(this)->destroy(); return 0; } + #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::move(auditStates)); // state_var_RVO + this->~GetAuditStatesActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!res.more) + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (newFirst) + #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + readEnd = res.front().key; + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + else + { + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + readBegin = keyAfter(res.back().key); + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.reset(); + #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (loopDepth == 0) return a_body1loopBody1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1loopBody1when1(RangeResult const& __res,int loopDepth) + { + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res = __res; + #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopBody1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1when1(RangeResult && __res,int loopDepth) + { + res = std::move(__res); + loopDepth = a_body1loopBody1loopBody1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetAuditStatesActor, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< GetAuditStatesActor, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("getAuditStates", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStates", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetAuditStatesActor, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("getAuditStates", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStates", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetAuditStatesActor, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("getAuditStates", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStates", reinterpret_cast(this), 0); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetAuditStatesActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetAuditStatesActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("getAuditStates", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStates", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetAuditStatesActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("getAuditStates", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStates", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetAuditStatesActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("getAuditStates", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStates", reinterpret_cast(this), 1); + + } + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Database cx; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditType auditType; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + bool newFirst; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Optional num; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Optional phase; + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction tr; + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector auditStates; + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Key readBegin; + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Key readEnd; + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Reverse reverse; + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + RangeResult res; + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via getAuditStates() + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class GetAuditStatesActor final : public Actor>, public ActorCallback< GetAuditStatesActor, 0, RangeResult >, public ActorCallback< GetAuditStatesActor, 1, Void >, public FastAllocated, public GetAuditStatesActorState { + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetAuditStatesActor, 0, RangeResult >; +friend struct ActorCallback< GetAuditStatesActor, 1, Void >; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + GetAuditStatesActor(Database const& cx,AuditType const& auditType,bool const& newFirst,Optional const& num,Optional const& phase) + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor>(), + GetAuditStatesActorState(cx, auditType, newFirst, num, phase) + { + fdb_probe_actor_enter("getAuditStates", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getAuditStates"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getAuditStates", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetAuditStatesActor, 0, RangeResult >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetAuditStatesActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future> getAuditStates( Database const& cx, AuditType const& auditType, bool const& newFirst, Optional const& num, Optional const& phase ) { + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future>(new GetAuditStatesActor(cx, auditType, newFirst, num, phase)); + #line 1460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + + #line 1465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via clearAuditMetadataForType() + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class ClearAuditMetadataForTypeActorState { + #line 1472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ClearAuditMetadataForTypeActorState(Database const& cx,AuditType const& auditType,UID const& maxAuditIdToClear,int const& numFinishAuditToKeep) + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : cx(cx), + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditType(auditType), + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + maxAuditIdToClear(maxAuditIdToClear), + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + numFinishAuditToKeep(numFinishAuditToKeep), + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr(cx), + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + numFinishAuditCleaned(0) + #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("clearAuditMetadataForType", reinterpret_cast(this)); + + } + ~ClearAuditMetadataForTypeActorState() + { + fdb_probe_actor_destroy("clearAuditMetadataForType", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilClearAuditMetadataForTypeStart") .detail("AuditType", auditType) .detail("MaxAuditIdToClear", maxAuditIdToClear); + #line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + try { + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ClearAuditMetadataForTypeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ClearAuditMetadataForTypeActorState(); static_cast(this)->destroy(); return 0; } + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ClearAuditMetadataForTypeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilClearAuditMetadataForTypeError") .detail("AuditType", auditType) .errorUnsuppressed(e); + #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2(int loopDepth) + { + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture> __when_expr_0 = getAuditStates(cx, auditType, false); + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 1586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_2 = tr.onError(e); + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + int numFinishAudit = 0; + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for( const auto& auditState : auditStates ) { + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.id.first() > maxAuditIdToClear.first()) + #line 1647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + continue; + } + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.getPhase() == AuditPhase::Complete || auditState.getPhase() == AuditPhase::Failed) + #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + numFinishAudit++; + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + const int numFinishAuditToClean = numFinishAudit - numFinishAuditToKeep; + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + numFinishAuditCleaned = 0; + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for( const auto& auditState : auditStates ) { + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.id.first() > maxAuditIdToClear.first()) + #line 1674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + continue; + } + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(auditState.getType() == auditType); + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.getPhase() == AuditPhase::Complete && numFinishAuditCleaned < numFinishAuditToClean) + #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.clear(auditKey(auditType, auditState.id)); + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + numFinishAuditCleaned++; + #line 1688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + else + { + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.getPhase() == AuditPhase::Failed && numFinishAuditCleaned < numFinishAuditToClean) + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.clear(auditKey(auditType, auditState.id)); + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + clearAuditProgressMetadata(&tr, auditType, auditState.id); + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + numFinishAuditCleaned++; + #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + } + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = tr.commit(); + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(std::vector const& __auditStates,int loopDepth) + { + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStates = __auditStates; + #line 1724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(std::vector && __auditStates,int loopDepth) + { + auditStates = std::move(__auditStates); + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ClearAuditMetadataForTypeActor, 0, std::vector >::remove(); + + } + void a_callback_fire(ActorCallback< ClearAuditMetadataForTypeActor, 0, std::vector >*,std::vector const& value) + { + fdb_probe_actor_enter("clearAuditMetadataForType", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("clearAuditMetadataForType", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ClearAuditMetadataForTypeActor, 0, std::vector >*,std::vector && value) + { + fdb_probe_actor_enter("clearAuditMetadataForType", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("clearAuditMetadataForType", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ClearAuditMetadataForTypeActor, 0, std::vector >*,Error err) + { + fdb_probe_actor_enter("clearAuditMetadataForType", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("clearAuditMetadataForType", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilClearAuditMetadataForTypeEnd") .detail("AuditType", auditType) .detail("NumCleanedFinishAudits", numFinishAuditCleaned); + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilClearAuditMetadataForTypeEnd") .detail("AuditType", auditType) .detail("NumCleanedFinishAudits", numFinishAuditCleaned); + #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ClearAuditMetadataForTypeActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ClearAuditMetadataForTypeActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("clearAuditMetadataForType", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("clearAuditMetadataForType", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ClearAuditMetadataForTypeActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("clearAuditMetadataForType", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("clearAuditMetadataForType", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< ClearAuditMetadataForTypeActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("clearAuditMetadataForType", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("clearAuditMetadataForType", reinterpret_cast(this), 1); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ClearAuditMetadataForTypeActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ClearAuditMetadataForTypeActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("clearAuditMetadataForType", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("clearAuditMetadataForType", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< ClearAuditMetadataForTypeActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("clearAuditMetadataForType", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("clearAuditMetadataForType", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< ClearAuditMetadataForTypeActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("clearAuditMetadataForType", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("clearAuditMetadataForType", reinterpret_cast(this), 2); + + } + int a_body1cont3(int loopDepth) + { + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Database cx; + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditType auditType; + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID maxAuditIdToClear; + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + int numFinishAuditToKeep; + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction tr; + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + int numFinishAuditCleaned; + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector auditStates; + #line 1970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via clearAuditMetadataForType() + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class ClearAuditMetadataForTypeActor final : public Actor, public ActorCallback< ClearAuditMetadataForTypeActor, 0, std::vector >, public ActorCallback< ClearAuditMetadataForTypeActor, 1, Void >, public ActorCallback< ClearAuditMetadataForTypeActor, 2, Void >, public FastAllocated, public ClearAuditMetadataForTypeActorState { + #line 1975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ClearAuditMetadataForTypeActor, 0, std::vector >; +friend struct ActorCallback< ClearAuditMetadataForTypeActor, 1, Void >; +friend struct ActorCallback< ClearAuditMetadataForTypeActor, 2, Void >; + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ClearAuditMetadataForTypeActor(Database const& cx,AuditType const& auditType,UID const& maxAuditIdToClear,int const& numFinishAuditToKeep) + #line 1988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor(), + ClearAuditMetadataForTypeActorState(cx, auditType, maxAuditIdToClear, numFinishAuditToKeep) + { + fdb_probe_actor_enter("clearAuditMetadataForType", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("clearAuditMetadataForType"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("clearAuditMetadataForType", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ClearAuditMetadataForTypeActor, 0, std::vector >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ClearAuditMetadataForTypeActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ClearAuditMetadataForTypeActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future clearAuditMetadataForType( Database const& cx, AuditType const& auditType, UID const& maxAuditIdToClear, int const& numFinishAuditToKeep ) { + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future(new ClearAuditMetadataForTypeActor(cx, auditType, maxAuditIdToClear, numFinishAuditToKeep)); + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + + #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via checkMoveKeysLockForAudit() + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class CheckMoveKeysLockForAuditActorState { + #line 2030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + CheckMoveKeysLockForAuditActorState(Transaction* const& tr,MoveKeyLockInfo const& lock,bool const& isDDEnabled,bool const& isWrite = true) + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : tr(tr), + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + lock(lock), + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + isDDEnabled(isDDEnabled), + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + isWrite(isWrite) + #line 2043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("checkMoveKeysLockForAudit", reinterpret_cast(this)); + + } + ~CheckMoveKeysLockForAuditActorState() + { + fdb_probe_actor_destroy("checkMoveKeysLockForAudit", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!isDDEnabled) + #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilDisabledByInMemoryCheck").log(); + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(movekeys_conflict(), loopDepth); + #line 2066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture> __when_expr_0 = tr->get(moveKeysLockOwnerKey); + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CheckMoveKeysLockForAuditActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional const& readVal,int loopDepth) + { + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID currentOwner = readVal.present() ? BinaryReader::fromStringRef(readVal.get(), Unversioned()) : UID(); + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (currentOwner == lock.prevOwner) + #line 2102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture> __when_expr_1 = tr->get(moveKeysLockWriteKey); + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (currentOwner == lock.myOwner) + #line 2120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (isWrite) + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + BinaryWriter wrLastWrite(Unversioned()); + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + wrLastWrite << deterministicRandom()->randomUniqueID(); + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr->set(moveKeysLockWriteKey, wrLastWrite.toValue()); + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr->makeSelfConflicting(); + #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckMoveKeysLockForAuditActorState(); static_cast(this)->destroy(); return 0; } + #line 2138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CheckMoveKeysLockForAuditActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilConflictWithNewOwner") .detail("CurrentOwner", currentOwner.toString()) .detail("PrevOwner", lock.prevOwner.toString()) .detail("PrevWrite", lock.prevWrite.toString()) .detail("MyOwner", lock.myOwner.toString()); + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(movekeys_conflict(), loopDepth); + #line 2150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + + return loopDepth; + } + int a_body1cont1(Optional && readVal,int loopDepth) + { + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID currentOwner = readVal.present() ? BinaryReader::fromStringRef(readVal.get(), Unversioned()) : UID(); + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (currentOwner == lock.prevOwner) + #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture> __when_expr_1 = tr->get(moveKeysLockWriteKey); + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (currentOwner == lock.myOwner) + #line 2180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (isWrite) + #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + BinaryWriter wrLastWrite(Unversioned()); + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + wrLastWrite << deterministicRandom()->randomUniqueID(); + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr->set(moveKeysLockWriteKey, wrLastWrite.toValue()); + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr->makeSelfConflicting(); + #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckMoveKeysLockForAuditActorState(); static_cast(this)->destroy(); return 0; } + #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CheckMoveKeysLockForAuditActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilConflictWithNewOwner") .detail("CurrentOwner", currentOwner.toString()) .detail("PrevOwner", lock.prevOwner.toString()) .detail("PrevWrite", lock.prevWrite.toString()) .detail("MyOwner", lock.myOwner.toString()); + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(movekeys_conflict(), loopDepth); + #line 2210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + + return loopDepth; + } + int a_body1when1(Optional const& readVal,int loopDepth) + { + loopDepth = a_body1cont1(readVal, loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && readVal,int loopDepth) + { + loopDepth = a_body1cont1(std::move(readVal), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckMoveKeysLockForAuditActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< CheckMoveKeysLockForAuditActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("checkMoveKeysLockForAudit", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkMoveKeysLockForAudit", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CheckMoveKeysLockForAuditActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("checkMoveKeysLockForAudit", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkMoveKeysLockForAudit", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CheckMoveKeysLockForAuditActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("checkMoveKeysLockForAudit", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkMoveKeysLockForAudit", reinterpret_cast(this), 0); + + } + int a_body1cont4(Optional const& readVal,int loopDepth) + { + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID lastWrite = readVal.present() ? BinaryReader::fromStringRef(readVal.get(), Unversioned()) : UID(); + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (lastWrite != lock.prevWrite) + #line 2285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "ConflictWithPreviousOwner"); + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(movekeys_conflict(), loopDepth); + #line 2291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (isWrite) + #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + BinaryWriter wrMyOwner(Unversioned()); + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + wrMyOwner << lock.myOwner; + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr->set(moveKeysLockOwnerKey, wrMyOwner.toValue()); + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + BinaryWriter wrLastWrite(Unversioned()); + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID lastWriter = deterministicRandom()->randomUniqueID(); + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + wrLastWrite << lastWriter; + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr->set(moveKeysLockWriteKey, wrLastWrite.toValue()); + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent("AuditUtilCheckMoveKeysLock") .detail("PrevOwner", lock.prevOwner.toString()) .detail("PrevWrite", lock.prevWrite.toString()) .detail("MyOwner", lock.myOwner.toString()) .detail("Writer", lastWriter.toString()); + #line 2313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckMoveKeysLockForAuditActorState(); static_cast(this)->destroy(); return 0; } + #line 2317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CheckMoveKeysLockForAuditActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont4(Optional && readVal,int loopDepth) + { + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID lastWrite = readVal.present() ? BinaryReader::fromStringRef(readVal.get(), Unversioned()) : UID(); + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (lastWrite != lock.prevWrite) + #line 2331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "ConflictWithPreviousOwner"); + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(movekeys_conflict(), loopDepth); + #line 2337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (isWrite) + #line 2341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + BinaryWriter wrMyOwner(Unversioned()); + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + wrMyOwner << lock.myOwner; + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr->set(moveKeysLockOwnerKey, wrMyOwner.toValue()); + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + BinaryWriter wrLastWrite(Unversioned()); + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID lastWriter = deterministicRandom()->randomUniqueID(); + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + wrLastWrite << lastWriter; + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr->set(moveKeysLockWriteKey, wrLastWrite.toValue()); + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent("AuditUtilCheckMoveKeysLock") .detail("PrevOwner", lock.prevOwner.toString()) .detail("PrevWrite", lock.prevWrite.toString()) .detail("MyOwner", lock.myOwner.toString()) .detail("Writer", lastWriter.toString()); + #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckMoveKeysLockForAuditActorState(); static_cast(this)->destroy(); return 0; } + #line 2363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CheckMoveKeysLockForAuditActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Optional const& readVal,int loopDepth) + { + loopDepth = a_body1cont4(readVal, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Optional && readVal,int loopDepth) + { + loopDepth = a_body1cont4(std::move(readVal), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckMoveKeysLockForAuditActor, 1, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< CheckMoveKeysLockForAuditActor, 1, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("checkMoveKeysLockForAudit", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkMoveKeysLockForAudit", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< CheckMoveKeysLockForAuditActor, 1, Optional >*,Optional && value) + { + fdb_probe_actor_enter("checkMoveKeysLockForAudit", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkMoveKeysLockForAudit", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< CheckMoveKeysLockForAuditActor, 1, Optional >*,Error err) + { + fdb_probe_actor_enter("checkMoveKeysLockForAudit", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkMoveKeysLockForAudit", reinterpret_cast(this), 1); + + } + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction* tr; + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + MoveKeyLockInfo lock; + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + bool isDDEnabled; + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + bool isWrite; + #line 2442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via checkMoveKeysLockForAudit() + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class CheckMoveKeysLockForAuditActor final : public Actor, public ActorCallback< CheckMoveKeysLockForAuditActor, 0, Optional >, public ActorCallback< CheckMoveKeysLockForAuditActor, 1, Optional >, public FastAllocated, public CheckMoveKeysLockForAuditActorState { + #line 2447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CheckMoveKeysLockForAuditActor, 0, Optional >; +friend struct ActorCallback< CheckMoveKeysLockForAuditActor, 1, Optional >; + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + CheckMoveKeysLockForAuditActor(Transaction* const& tr,MoveKeyLockInfo const& lock,bool const& isDDEnabled,bool const& isWrite = true) + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor(), + CheckMoveKeysLockForAuditActorState(tr, lock, isDDEnabled, isWrite) + { + fdb_probe_actor_enter("checkMoveKeysLockForAudit", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("checkMoveKeysLockForAudit"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("checkMoveKeysLockForAudit", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CheckMoveKeysLockForAuditActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CheckMoveKeysLockForAuditActor, 1, Optional >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] static Future checkMoveKeysLockForAudit( Transaction* const& tr, MoveKeyLockInfo const& lock, bool const& isDDEnabled, bool const& isWrite = true ) { + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future(new CheckMoveKeysLockForAuditActor(tr, lock, isDDEnabled, isWrite)); + #line 2488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via persistNewAuditState() + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class PersistNewAuditStateActorState { + #line 2500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + PersistNewAuditStateActorState(Database const& cx,AuditStorageState const& auditState,MoveKeyLockInfo const& lock,bool const& ddEnabled) + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : cx(cx), + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditState(auditState), + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + lock(lock), + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ddEnabled(ddEnabled) + #line 2513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("persistNewAuditState", reinterpret_cast(this)); + + } + ~PersistNewAuditStateActorState() + { + fdb_probe_actor_destroy("persistNewAuditState", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(!auditState.id.isValid()); + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr = Transaction(cx); + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditId = UID(); + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + latestExistingAuditState = AuditStorageState(); + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilPersistedNewAuditStateStart", auditId); + #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + try { + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 2540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~PersistNewAuditStateActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(auditId); this->~PersistNewAuditStateActorState(); static_cast(this)->destroy(); return 0; } + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< UID >::value()) UID(std::move(auditId)); // state_var_RVO + this->~PersistNewAuditStateActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevWarn, "AuditUtilPersistedNewAuditStateUnretriableError", auditId) .errorUnsuppressed(e) .detail("AuditKey", auditKey(auditState.getType(), auditId)); + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT_WE_THINK(e.code() == error_code_actor_cancelled || e.code() == error_code_movekeys_conflict); + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (e.code() == error_code_actor_cancelled) + #line 2586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 2590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + else + { + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(persist_new_audit_metadata_error(), loopDepth); + #line 2596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2(int loopDepth) + { + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_0 = checkMoveKeysLockForAudit(&tr, lock, ddEnabled, true); + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilPersistedNewAuditStateError", auditId) .errorUnsuppressed(e) .detail("AuditKey", auditKey(auditState.getType(), auditId)); + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_3 = tr.onError(e); + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Void const& _,int loopDepth) + { + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = tr.getRange(auditKeyRange(auditState.getType()), 1, Snapshot::False, Reverse::True); + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Void && _,int loopDepth) + { + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = tr.getRange(auditKeyRange(auditState.getType()), 1, Snapshot::False, Reverse::True); + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistNewAuditStateActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PersistNewAuditStateActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("persistNewAuditState", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistNewAuditState", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< PersistNewAuditStateActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("persistNewAuditState", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistNewAuditState", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< PersistNewAuditStateActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("persistNewAuditState", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistNewAuditState", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(RangeResult const& res,int loopDepth) + { + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(res.size() == 0 || res.size() == 1); + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + uint64_t nextId = 1; + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!res.empty()) + #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + latestExistingAuditState = decodeAuditStorageState(res[0].value); + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditId.isValid()) + #line 2802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(latestExistingAuditState.id.first() <= auditId.first()); + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (latestExistingAuditState.id.first() == auditId.first()) + #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(auditId); this->~PersistNewAuditStateActorState(); static_cast(this)->destroy(); return 0; } + #line 2812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< UID >::value()) UID(std::move(auditId)); // state_var_RVO + this->~PersistNewAuditStateActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(auditId.first() == latestExistingAuditState.id.first() + 1); + #line 2822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + nextId = latestExistingAuditState.id.first() + 1; + #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditId = UID(nextId, 0LL); + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditState.id = auditId; + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevVerbose, "AuditUtilPersistedNewAuditStateIdSelected", auditId) .detail("AuditKey", auditKey(auditState.getType(), auditId)); + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.set(auditKey(auditState.getType(), auditId), auditStorageStateValue(auditState)); + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_2 = tr.commit(); + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(RangeResult && res,int loopDepth) + { + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(res.size() == 0 || res.size() == 1); + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + uint64_t nextId = 1; + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!res.empty()) + #line 2859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + latestExistingAuditState = decodeAuditStorageState(res[0].value); + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditId.isValid()) + #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(latestExistingAuditState.id.first() <= auditId.first()); + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (latestExistingAuditState.id.first() == auditId.first()) + #line 2871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(auditId); this->~PersistNewAuditStateActorState(); static_cast(this)->destroy(); return 0; } + #line 2875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< UID >::value()) UID(std::move(auditId)); // state_var_RVO + this->~PersistNewAuditStateActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(auditId.first() == latestExistingAuditState.id.first() + 1); + #line 2885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + nextId = latestExistingAuditState.id.first() + 1; + #line 2890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditId = UID(nextId, 0LL); + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditState.id = auditId; + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevVerbose, "AuditUtilPersistedNewAuditStateIdSelected", auditId) .detail("AuditKey", auditKey(auditState.getType(), auditId)); + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.set(auditKey(auditState.getType(), auditId), auditStorageStateValue(auditState)); + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_2 = tr.commit(); + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(RangeResult const& res,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(res, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(RangeResult && res,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(res), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistNewAuditStateActor, 1, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< PersistNewAuditStateActor, 1, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("persistNewAuditState", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistNewAuditState", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< PersistNewAuditStateActor, 1, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("persistNewAuditState", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistNewAuditState", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< PersistNewAuditStateActor, 1, RangeResult >*,Error err) + { + fdb_probe_actor_enter("persistNewAuditState", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistNewAuditState", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont4(Void const& _,int loopDepth) + { + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilPersistedNewAuditState", auditId) .detail("AuditKey", auditKey(auditState.getType(), auditId)); + #line 2981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilPersistedNewAuditState", auditId) .detail("AuditKey", auditKey(auditState.getType(), auditId)); + #line 2990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistNewAuditStateActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PersistNewAuditStateActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("persistNewAuditState", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistNewAuditState", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< PersistNewAuditStateActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("persistNewAuditState", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistNewAuditState", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< PersistNewAuditStateActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("persistNewAuditState", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistNewAuditState", reinterpret_cast(this), 2); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistNewAuditStateActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PersistNewAuditStateActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("persistNewAuditState", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("persistNewAuditState", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< PersistNewAuditStateActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("persistNewAuditState", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("persistNewAuditState", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< PersistNewAuditStateActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("persistNewAuditState", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("persistNewAuditState", reinterpret_cast(this), 3); + + } + int a_body1cont3(int loopDepth) + { + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Database cx; + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState auditState; + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + MoveKeyLockInfo lock; + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + bool ddEnabled; + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction tr; + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID auditId; + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState latestExistingAuditState; + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via persistNewAuditState() + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class PersistNewAuditStateActor final : public Actor, public ActorCallback< PersistNewAuditStateActor, 0, Void >, public ActorCallback< PersistNewAuditStateActor, 1, RangeResult >, public ActorCallback< PersistNewAuditStateActor, 2, Void >, public ActorCallback< PersistNewAuditStateActor, 3, Void >, public FastAllocated, public PersistNewAuditStateActorState { + #line 3165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< PersistNewAuditStateActor, 0, Void >; +friend struct ActorCallback< PersistNewAuditStateActor, 1, RangeResult >; +friend struct ActorCallback< PersistNewAuditStateActor, 2, Void >; +friend struct ActorCallback< PersistNewAuditStateActor, 3, Void >; + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + PersistNewAuditStateActor(Database const& cx,AuditStorageState const& auditState,MoveKeyLockInfo const& lock,bool const& ddEnabled) + #line 3179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor(), + PersistNewAuditStateActorState(cx, auditState, lock, ddEnabled) + { + fdb_probe_actor_enter("persistNewAuditState", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("persistNewAuditState"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("persistNewAuditState", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< PersistNewAuditStateActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< PersistNewAuditStateActor, 1, RangeResult >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< PersistNewAuditStateActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< PersistNewAuditStateActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future persistNewAuditState( Database const& cx, AuditStorageState const& auditState, MoveKeyLockInfo const& lock, bool const& ddEnabled ) { + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future(new PersistNewAuditStateActor(cx, auditState, lock, ddEnabled)); + #line 3210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + + #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via persistAuditState() + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class PersistAuditStateActorState { + #line 3222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + PersistAuditStateActorState(Database const& cx,AuditStorageState const& auditState,std::string const& context,MoveKeyLockInfo const& lock,bool const& ddEnabled) + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : cx(cx), + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditState(auditState), + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + context(context), + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + lock(lock), + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ddEnabled(ddEnabled), + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr(cx), + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditPhase(auditState.getPhase()) + #line 3241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("persistAuditState", reinterpret_cast(this)); + + } + ~PersistAuditStateActorState() + { + fdb_probe_actor_destroy("persistAuditState", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(auditPhase == AuditPhase::Complete || auditPhase == AuditPhase::Failed || auditPhase == AuditPhase::Error); + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 3258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~PersistAuditStateActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PersistAuditStateActorState(); static_cast(this)->destroy(); return 0; } + #line 3281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PersistAuditStateActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_0 = checkMoveKeysLockForAudit(&tr, lock, ddEnabled, true); + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevWarn, "AuditUtilPersistAuditStateError", auditState.id) .errorUnsuppressed(e) .detail("AuditID", auditState.id) .detail("AuditType", auditState.getType()) .detail("AuditPhase", auditPhase) .detail("AuditKey", auditKey(auditState.getType(), auditState.id)) .detail("Context", context); + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_3 = tr.onError(e); + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Void const& _,int loopDepth) + { + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditPhase == AuditPhase::Complete) + #line 3373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + clearAuditProgressMetadata(&tr, auditState.getType(), auditState.id); + #line 3377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture> __when_expr_1 = tr.get(auditKey(auditState.getType(), auditState.id)); + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 3388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Void && _,int loopDepth) + { + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditPhase == AuditPhase::Complete) + #line 3397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + clearAuditProgressMetadata(&tr, auditState.getType(), auditState.id); + #line 3401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture> __when_expr_1 = tr.get(auditKey(auditState.getType(), auditState.id)); + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 3412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistAuditStateActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PersistAuditStateActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("persistAuditState", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditState", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< PersistAuditStateActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("persistAuditState", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditState", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< PersistAuditStateActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("persistAuditState", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditState", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(Optional const& res_,int loopDepth) + { + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!res_.present()) + #line 3484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_cancelled(), loopDepth); + #line 3488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + else + { + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + const AuditStorageState currentState = decodeAuditStorageState(res_.get()); + #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(currentState.id == auditState.id && currentState.getType() == auditState.getType()); + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (currentState.getPhase() == AuditPhase::Failed) + #line 3498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_cancelled(), loopDepth); + #line 3502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.set(auditKey(auditState.getType(), auditState.id), auditStorageStateValue(auditState)); + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_2 = tr.commit(); + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Optional && res_,int loopDepth) + { + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!res_.present()) + #line 3525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_cancelled(), loopDepth); + #line 3529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + else + { + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + const AuditStorageState currentState = decodeAuditStorageState(res_.get()); + #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(currentState.id == auditState.id && currentState.getType() == auditState.getType()); + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (currentState.getPhase() == AuditPhase::Failed) + #line 3539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_cancelled(), loopDepth); + #line 3543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.set(auditKey(auditState.getType(), auditState.id), auditStorageStateValue(auditState)); + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_2 = tr.commit(); + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Optional const& res_,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(res_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Optional && res_,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(res_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistAuditStateActor, 1, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< PersistAuditStateActor, 1, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("persistAuditState", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditState", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< PersistAuditStateActor, 1, Optional >*,Optional && value) + { + fdb_probe_actor_enter("persistAuditState", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditState", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< PersistAuditStateActor, 1, Optional >*,Error err) + { + fdb_probe_actor_enter("persistAuditState", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditState", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont5(Void const& _,int loopDepth) + { + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilPersistAuditState", auditState.id) .detail("AuditID", auditState.id) .detail("AuditType", auditState.getType()) .detail("AuditPhase", auditPhase) .detail("AuditKey", auditKey(auditState.getType(), auditState.id)) .detail("Context", context); + #line 3629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont5(Void && _,int loopDepth) + { + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilPersistAuditState", auditState.id) .detail("AuditID", auditState.id) .detail("AuditType", auditState.getType()) .detail("AuditPhase", auditPhase) .detail("AuditKey", auditKey(auditState.getType(), auditState.id)) .detail("Context", context); + #line 3638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont5(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont5(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistAuditStateActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PersistAuditStateActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("persistAuditState", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditState", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< PersistAuditStateActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("persistAuditState", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditState", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< PersistAuditStateActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("persistAuditState", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditState", reinterpret_cast(this), 2); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistAuditStateActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PersistAuditStateActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("persistAuditState", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditState", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< PersistAuditStateActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("persistAuditState", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditState", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< PersistAuditStateActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("persistAuditState", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditState", reinterpret_cast(this), 3); + + } + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Database cx; + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState auditState; + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::string context; + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + MoveKeyLockInfo lock; + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + bool ddEnabled; + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction tr; + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditPhase auditPhase; + #line 3795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via persistAuditState() + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class PersistAuditStateActor final : public Actor, public ActorCallback< PersistAuditStateActor, 0, Void >, public ActorCallback< PersistAuditStateActor, 1, Optional >, public ActorCallback< PersistAuditStateActor, 2, Void >, public ActorCallback< PersistAuditStateActor, 3, Void >, public FastAllocated, public PersistAuditStateActorState { + #line 3800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< PersistAuditStateActor, 0, Void >; +friend struct ActorCallback< PersistAuditStateActor, 1, Optional >; +friend struct ActorCallback< PersistAuditStateActor, 2, Void >; +friend struct ActorCallback< PersistAuditStateActor, 3, Void >; + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + PersistAuditStateActor(Database const& cx,AuditStorageState const& auditState,std::string const& context,MoveKeyLockInfo const& lock,bool const& ddEnabled) + #line 3814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor(), + PersistAuditStateActorState(cx, auditState, context, lock, ddEnabled) + { + fdb_probe_actor_enter("persistAuditState", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("persistAuditState"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("persistAuditState", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< PersistAuditStateActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< PersistAuditStateActor, 1, Optional >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< PersistAuditStateActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< PersistAuditStateActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future persistAuditState( Database const& cx, AuditStorageState const& auditState, std::string const& context, MoveKeyLockInfo const& lock, bool const& ddEnabled ) { + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future(new PersistAuditStateActor(cx, auditState, context, lock, ddEnabled)); + #line 3845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + + #line 3850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via getAuditState() + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class GetAuditStateActorState { + #line 3857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + GetAuditStateActorState(Database const& cx,AuditType const& type,UID const& id) + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : cx(cx), + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + type(type), + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + id(id), + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr(cx), + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res() + #line 3872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("getAuditState", reinterpret_cast(this)); + + } + ~GetAuditStateActorState() + { + fdb_probe_actor_destroy("getAuditState", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 3887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetAuditStateActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!res.present()) + #line 3910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(key_not_found(), loopDepth); + #line 3914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(decodeAuditStorageState(res.get())); this->~GetAuditStateActorState(); static_cast(this)->destroy(); return 0; } + #line 3918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< AuditStorageState >::value()) AuditStorageState(decodeAuditStorageState(res.get())); + this->~GetAuditStateActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture> __when_expr_0 = tr.get(auditKey(type, id)); + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 3951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilReadAuditStateError", id) .errorUnsuppressed(e) .detail("AuditID", id) .detail("AuditType", type) .detail("AuditKey", auditKey(type, id)); + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = tr.onError(e); + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Optional const& res_,int loopDepth) + { + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res = res_; + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilReadAuditState", id) .detail("AuditID", id) .detail("AuditType", type) .detail("AuditKey", auditKey(type, id)); + #line 4012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont2(Optional && res_,int loopDepth) + { + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res = res_; + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilReadAuditState", id) .detail("AuditID", id) .detail("AuditType", type) .detail("AuditKey", auditKey(type, id)); + #line 4023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& res_,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(res_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && res_,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(res_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetAuditStateActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< GetAuditStateActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("getAuditState", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditState", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetAuditStateActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("getAuditState", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditState", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetAuditStateActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("getAuditState", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditState", reinterpret_cast(this), 0); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetAuditStateActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetAuditStateActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("getAuditState", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditState", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetAuditStateActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("getAuditState", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditState", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetAuditStateActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("getAuditState", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditState", reinterpret_cast(this), 1); + + } + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Database cx; + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditType type; + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID id; + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction tr; + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Optional res; + #line 4176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via getAuditState() + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class GetAuditStateActor final : public Actor, public ActorCallback< GetAuditStateActor, 0, Optional >, public ActorCallback< GetAuditStateActor, 1, Void >, public FastAllocated, public GetAuditStateActorState { + #line 4181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetAuditStateActor, 0, Optional >; +friend struct ActorCallback< GetAuditStateActor, 1, Void >; + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + GetAuditStateActor(Database const& cx,AuditType const& type,UID const& id) + #line 4193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor(), + GetAuditStateActorState(cx, type, id) + { + fdb_probe_actor_enter("getAuditState", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getAuditState"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getAuditState", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetAuditStateActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetAuditStateActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future getAuditState( Database const& cx, AuditType const& type, UID const& id ) { + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future(new GetAuditStateActor(cx, type, id)); + #line 4222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + + #line 4227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via persistAuditStateByRange() + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class PersistAuditStateByRangeActorState { + #line 4234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + PersistAuditStateByRangeActorState(Database const& cx,AuditStorageState const& auditState) + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : cx(cx), + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditState(auditState), + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr(cx) + #line 4245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("persistAuditStateByRange", reinterpret_cast(this)); + + } + ~PersistAuditStateByRangeActorState() + { + fdb_probe_actor_destroy("persistAuditStateByRange", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 4260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~PersistAuditStateByRangeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PersistAuditStateByRangeActorState(); static_cast(this)->destroy(); return 0; } + #line 4283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PersistAuditStateByRangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture> __when_expr_0 = tr.get(auditKey(auditState.getType(), auditState.id)); + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 4311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 4316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilPersistAuditStateByRangeError") .errorUnsuppressed(e) .detail("AuditID", auditState.id) .detail("AuditType", auditState.getType()) .detail("AuditPhase", auditState.getPhase()); + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_3 = tr.onError(e); + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 4355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Optional const& ddAuditState_,int loopDepth) + { + #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!ddAuditState_.present()) + #line 4375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_cancelled(), loopDepth); + #line 4379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState ddAuditState = decodeAuditStorageState(ddAuditState_.get()); + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(ddAuditState.ddId.isValid()); + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (ddAuditState.ddId != auditState.ddId) + #line 4387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_task_outdated(), loopDepth); + #line 4391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (ddAuditState.getPhase() == AuditPhase::Complete) + #line 4395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(ddAuditState.getPhase() == AuditPhase::Running || ddAuditState.getPhase() == AuditPhase::Failed); + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (ddAuditState.getPhase() == AuditPhase::Failed) + #line 4403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_cancelled(), loopDepth); + #line 4407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = krmSetRange(&tr, auditRangeBasedProgressPrefixFor(auditState.getType(), auditState.id), auditState.range, auditStorageStateValue(auditState)); + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 4413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Optional && ddAuditState_,int loopDepth) + { + #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!ddAuditState_.present()) + #line 4427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_cancelled(), loopDepth); + #line 4431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState ddAuditState = decodeAuditStorageState(ddAuditState_.get()); + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(ddAuditState.ddId.isValid()); + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (ddAuditState.ddId != auditState.ddId) + #line 4439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_task_outdated(), loopDepth); + #line 4443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (ddAuditState.getPhase() == AuditPhase::Complete) + #line 4447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(ddAuditState.getPhase() == AuditPhase::Running || ddAuditState.getPhase() == AuditPhase::Failed); + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (ddAuditState.getPhase() == AuditPhase::Failed) + #line 4455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_cancelled(), loopDepth); + #line 4459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = krmSetRange(&tr, auditRangeBasedProgressPrefixFor(auditState.getType(), auditState.id), auditState.range, auditStorageStateValue(auditState)); + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 4465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& ddAuditState_,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(ddAuditState_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && ddAuditState_,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(ddAuditState_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistAuditStateByRangeActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByRangeActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("persistAuditStateByRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByRange", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByRangeActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("persistAuditStateByRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByRange", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< PersistAuditStateByRangeActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("persistAuditStateByRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByRange", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_2 = tr.commit(); + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 4544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_2 = tr.commit(); + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 4560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistAuditStateByRangeActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByRangeActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("persistAuditStateByRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByRange", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByRangeActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("persistAuditStateByRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByRange", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< PersistAuditStateByRangeActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("persistAuditStateByRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByRange", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont8(Void const& _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont8(Void && _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistAuditStateByRangeActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByRangeActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("persistAuditStateByRange", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByRange", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByRangeActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("persistAuditStateByRange", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByRange", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< PersistAuditStateByRangeActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("persistAuditStateByRange", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByRange", reinterpret_cast(this), 2); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistAuditStateByRangeActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByRangeActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("persistAuditStateByRange", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByRange", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByRangeActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("persistAuditStateByRange", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByRange", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< PersistAuditStateByRangeActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("persistAuditStateByRange", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByRange", reinterpret_cast(this), 3); + + } + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Database cx; + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState auditState; + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction tr; + #line 4789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via persistAuditStateByRange() + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class PersistAuditStateByRangeActor final : public Actor, public ActorCallback< PersistAuditStateByRangeActor, 0, Optional >, public ActorCallback< PersistAuditStateByRangeActor, 1, Void >, public ActorCallback< PersistAuditStateByRangeActor, 2, Void >, public ActorCallback< PersistAuditStateByRangeActor, 3, Void >, public FastAllocated, public PersistAuditStateByRangeActorState { + #line 4794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< PersistAuditStateByRangeActor, 0, Optional >; +friend struct ActorCallback< PersistAuditStateByRangeActor, 1, Void >; +friend struct ActorCallback< PersistAuditStateByRangeActor, 2, Void >; +friend struct ActorCallback< PersistAuditStateByRangeActor, 3, Void >; + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + PersistAuditStateByRangeActor(Database const& cx,AuditStorageState const& auditState) + #line 4808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor(), + PersistAuditStateByRangeActorState(cx, auditState) + { + fdb_probe_actor_enter("persistAuditStateByRange", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("persistAuditStateByRange"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("persistAuditStateByRange", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< PersistAuditStateByRangeActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< PersistAuditStateByRangeActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< PersistAuditStateByRangeActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< PersistAuditStateByRangeActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future persistAuditStateByRange( Database const& cx, AuditStorageState const& auditState ) { + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future(new PersistAuditStateByRangeActor(cx, auditState)); + #line 4839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + + #line 4844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via getAuditStateByRange() + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class GetAuditStateByRangeActorState { + #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + GetAuditStateByRangeActorState(Database const& cx,AuditType const& type,UID const& auditId,KeyRange const& range) + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : cx(cx), + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + type(type), + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditId(auditId), + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + range(range), + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStates(), + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr(cx) + #line 4868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("getAuditStateByRange", reinterpret_cast(this)); + + } + ~GetAuditStateByRangeActorState() + { + fdb_probe_actor_destroy("getAuditStateByRange", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 4883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetAuditStateByRangeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector res; + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for(int i = 0;i < auditStates.size() - 1;++i) { + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + KeyRange currentRange = KeyRangeRef(auditStates[i].key, auditStates[i + 1].key); + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState auditState(auditId, currentRange, type); + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!auditStates[i].value.empty()) + #line 4914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState auditState_ = decodeAuditStorageState(auditStates[i].value); + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditState.setPhase(auditState_.getPhase()); + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditState.error = auditState_.error; + #line 4922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res.push_back(auditState); + #line 4926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(res); this->~GetAuditStateByRangeActorState(); static_cast(this)->destroy(); return 0; } + #line 4930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< std::vector >::value()) std::vector(res); + this->~GetAuditStateByRangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_0 = krmGetRanges(&tr, auditRangeBasedProgressPrefixFor(type, auditId), range, CLIENT_KNOBS->KRM_GET_RANGE_LIMIT, CLIENT_KNOBS->KRM_GET_RANGE_LIMIT_BYTES); + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 4958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilGetAuditStateForRangeError").errorUnsuppressed(e).detail("AuditID", auditId); + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = tr.onError(e); + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 5002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(RangeResult const& res_,int loopDepth) + { + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStates = res_; + #line 5022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont2(RangeResult && res_,int loopDepth) + { + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStates = res_; + #line 5031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when1(RangeResult const& res_,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(res_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(RangeResult && res_,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(res_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetAuditStateByRangeActor, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< GetAuditStateByRangeActor, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("getAuditStateByRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStateByRange", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetAuditStateByRangeActor, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("getAuditStateByRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStateByRange", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetAuditStateByRangeActor, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("getAuditStateByRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStateByRange", reinterpret_cast(this), 0); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetAuditStateByRangeActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetAuditStateByRangeActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("getAuditStateByRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStateByRange", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetAuditStateByRangeActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("getAuditStateByRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStateByRange", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetAuditStateByRangeActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("getAuditStateByRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStateByRange", reinterpret_cast(this), 1); + + } + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Database cx; + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditType type; + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID auditId; + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + KeyRange range; + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + RangeResult auditStates; + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction tr; + #line 5186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via getAuditStateByRange() + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class GetAuditStateByRangeActor final : public Actor>, public ActorCallback< GetAuditStateByRangeActor, 0, RangeResult >, public ActorCallback< GetAuditStateByRangeActor, 1, Void >, public FastAllocated, public GetAuditStateByRangeActorState { + #line 5191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetAuditStateByRangeActor, 0, RangeResult >; +friend struct ActorCallback< GetAuditStateByRangeActor, 1, Void >; + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + GetAuditStateByRangeActor(Database const& cx,AuditType const& type,UID const& auditId,KeyRange const& range) + #line 5203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor>(), + GetAuditStateByRangeActorState(cx, type, auditId, range) + { + fdb_probe_actor_enter("getAuditStateByRange", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getAuditStateByRange"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getAuditStateByRange", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetAuditStateByRangeActor, 0, RangeResult >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetAuditStateByRangeActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future> getAuditStateByRange( Database const& cx, AuditType const& type, UID const& auditId, KeyRange const& range ) { + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future>(new GetAuditStateByRangeActor(cx, type, auditId, range)); + #line 5232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + + #line 5237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via persistAuditStateByServer() + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class PersistAuditStateByServerActorState { + #line 5244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + PersistAuditStateByServerActorState(Database const& cx,AuditStorageState const& auditState) + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : cx(cx), + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditState(auditState), + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr(cx) + #line 5255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("persistAuditStateByServer", reinterpret_cast(this)); + + } + ~PersistAuditStateByServerActorState() + { + fdb_probe_actor_destroy("persistAuditStateByServer", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 5270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~PersistAuditStateByServerActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PersistAuditStateByServerActorState(); static_cast(this)->destroy(); return 0; } + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PersistAuditStateByServerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture> __when_expr_0 = tr.get(auditKey(auditState.getType(), auditState.id)); + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 5326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilPersistAuditStateByRangeError") .errorUnsuppressed(e) .detail("AuditID", auditState.id) .detail("AuditType", auditState.getType()) .detail("AuditPhase", auditState.getPhase()) .detail("AuditServerID", auditState.auditServerId); + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_3 = tr.onError(e); + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 5365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Optional const& ddAuditState_,int loopDepth) + { + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!ddAuditState_.present()) + #line 5385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_cancelled(), loopDepth); + #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState ddAuditState = decodeAuditStorageState(ddAuditState_.get()); + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(ddAuditState.ddId.isValid()); + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (ddAuditState.ddId != auditState.ddId) + #line 5397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_task_outdated(), loopDepth); + #line 5401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (ddAuditState.getPhase() == AuditPhase::Complete) + #line 5405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(ddAuditState.getPhase() == AuditPhase::Running || ddAuditState.getPhase() == AuditPhase::Failed); + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (ddAuditState.getPhase() == AuditPhase::Failed) + #line 5413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_cancelled(), loopDepth); + #line 5417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = krmSetRange( &tr, auditServerBasedProgressPrefixFor(auditState.getType(), auditState.id, auditState.auditServerId), auditState.range, auditStorageStateValue(auditState)); + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Optional && ddAuditState_,int loopDepth) + { + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!ddAuditState_.present()) + #line 5437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_cancelled(), loopDepth); + #line 5441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState ddAuditState = decodeAuditStorageState(ddAuditState_.get()); + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(ddAuditState.ddId.isValid()); + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (ddAuditState.ddId != auditState.ddId) + #line 5449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_task_outdated(), loopDepth); + #line 5453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (ddAuditState.getPhase() == AuditPhase::Complete) + #line 5457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(ddAuditState.getPhase() == AuditPhase::Running || ddAuditState.getPhase() == AuditPhase::Failed); + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (ddAuditState.getPhase() == AuditPhase::Failed) + #line 5465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1loopBody1Catch1(audit_storage_cancelled(), loopDepth); + #line 5469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = krmSetRange( &tr, auditServerBasedProgressPrefixFor(auditState.getType(), auditState.id, auditState.auditServerId), auditState.range, auditStorageStateValue(auditState)); + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& ddAuditState_,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(ddAuditState_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && ddAuditState_,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(ddAuditState_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistAuditStateByServerActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByServerActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("persistAuditStateByServer", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByServer", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByServerActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("persistAuditStateByServer", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByServer", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< PersistAuditStateByServerActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("persistAuditStateByServer", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByServer", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_2 = tr.commit(); + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_2 = tr.commit(); + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistAuditStateByServerActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByServerActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("persistAuditStateByServer", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByServer", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByServerActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("persistAuditStateByServer", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByServer", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< PersistAuditStateByServerActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("persistAuditStateByServer", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByServer", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont8(Void const& _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont8(Void && _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistAuditStateByServerActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByServerActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("persistAuditStateByServer", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByServer", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByServerActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("persistAuditStateByServer", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByServer", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< PersistAuditStateByServerActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("persistAuditStateByServer", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByServer", reinterpret_cast(this), 2); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PersistAuditStateByServerActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByServerActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("persistAuditStateByServer", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByServer", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< PersistAuditStateByServerActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("persistAuditStateByServer", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByServer", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< PersistAuditStateByServerActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("persistAuditStateByServer", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("persistAuditStateByServer", reinterpret_cast(this), 3); + + } + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Database cx; + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState auditState; + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction tr; + #line 5799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via persistAuditStateByServer() + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class PersistAuditStateByServerActor final : public Actor, public ActorCallback< PersistAuditStateByServerActor, 0, Optional >, public ActorCallback< PersistAuditStateByServerActor, 1, Void >, public ActorCallback< PersistAuditStateByServerActor, 2, Void >, public ActorCallback< PersistAuditStateByServerActor, 3, Void >, public FastAllocated, public PersistAuditStateByServerActorState { + #line 5804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< PersistAuditStateByServerActor, 0, Optional >; +friend struct ActorCallback< PersistAuditStateByServerActor, 1, Void >; +friend struct ActorCallback< PersistAuditStateByServerActor, 2, Void >; +friend struct ActorCallback< PersistAuditStateByServerActor, 3, Void >; + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + PersistAuditStateByServerActor(Database const& cx,AuditStorageState const& auditState) + #line 5818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor(), + PersistAuditStateByServerActorState(cx, auditState) + { + fdb_probe_actor_enter("persistAuditStateByServer", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("persistAuditStateByServer"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("persistAuditStateByServer", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< PersistAuditStateByServerActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< PersistAuditStateByServerActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< PersistAuditStateByServerActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< PersistAuditStateByServerActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future persistAuditStateByServer( Database const& cx, AuditStorageState const& auditState ) { + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future(new PersistAuditStateByServerActor(cx, auditState)); + #line 5849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + + #line 5854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via getAuditStateByServer() + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class GetAuditStateByServerActorState { + #line 5861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + GetAuditStateByServerActorState(Database const& cx,AuditType const& type,UID const& auditId,UID const& auditServerId,KeyRange const& range) + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : cx(cx), + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + type(type), + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditId(auditId), + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditServerId(auditServerId), + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + range(range), + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStates(), + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr(cx) + #line 5880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("getAuditStateByServer", reinterpret_cast(this)); + + } + ~GetAuditStateByServerActorState() + { + fdb_probe_actor_destroy("getAuditStateByServer", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 5895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetAuditStateByServerActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector res; + #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for(int i = 0;i < auditStates.size() - 1;++i) { + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + KeyRange currentRange = KeyRangeRef(auditStates[i].key, auditStates[i + 1].key); + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState auditState(auditId, currentRange, type); + #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!auditStates[i].value.empty()) + #line 5926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState auditState_ = decodeAuditStorageState(auditStates[i].value); + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditState.setPhase(auditState_.getPhase()); + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditState.error = auditState_.error; + #line 5934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res.push_back(auditState); + #line 5938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(res); this->~GetAuditStateByServerActorState(); static_cast(this)->destroy(); return 0; } + #line 5942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< std::vector >::value()) std::vector(res); + this->~GetAuditStateByServerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_0 = krmGetRanges(&tr, auditServerBasedProgressPrefixFor(type, auditId, auditServerId), range, CLIENT_KNOBS->KRM_GET_RANGE_LIMIT, CLIENT_KNOBS->KRM_GET_RANGE_LIMIT_BYTES); + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilGetAuditStateForRangeError") .errorUnsuppressed(e) .detail("AuditID", auditId) .detail("AuditType", type) .detail("AuditServerID", auditServerId); + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = tr.onError(e); + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 6014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(RangeResult const& res_,int loopDepth) + { + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStates = res_; + #line 6034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont2(RangeResult && res_,int loopDepth) + { + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStates = res_; + #line 6043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when1(RangeResult const& res_,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(res_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(RangeResult && res_,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(res_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetAuditStateByServerActor, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< GetAuditStateByServerActor, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("getAuditStateByServer", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStateByServer", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetAuditStateByServerActor, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("getAuditStateByServer", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStateByServer", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetAuditStateByServerActor, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("getAuditStateByServer", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStateByServer", reinterpret_cast(this), 0); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetAuditStateByServerActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetAuditStateByServerActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("getAuditStateByServer", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStateByServer", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetAuditStateByServerActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("getAuditStateByServer", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStateByServer", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetAuditStateByServerActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("getAuditStateByServer", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getAuditStateByServer", reinterpret_cast(this), 1); + + } + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Database cx; + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditType type; + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID auditId; + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID auditServerId; + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + KeyRange range; + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + RangeResult auditStates; + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction tr; + #line 6200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via getAuditStateByServer() + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class GetAuditStateByServerActor final : public Actor>, public ActorCallback< GetAuditStateByServerActor, 0, RangeResult >, public ActorCallback< GetAuditStateByServerActor, 1, Void >, public FastAllocated, public GetAuditStateByServerActorState { + #line 6205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetAuditStateByServerActor, 0, RangeResult >; +friend struct ActorCallback< GetAuditStateByServerActor, 1, Void >; + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + GetAuditStateByServerActor(Database const& cx,AuditType const& type,UID const& auditId,UID const& auditServerId,KeyRange const& range) + #line 6217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor>(), + GetAuditStateByServerActorState(cx, type, auditId, auditServerId, range) + { + fdb_probe_actor_enter("getAuditStateByServer", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getAuditStateByServer"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getAuditStateByServer", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetAuditStateByServerActor, 0, RangeResult >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetAuditStateByServerActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future> getAuditStateByServer( Database const& cx, AuditType const& type, UID const& auditId, UID const& auditServerId, KeyRange const& range ) { + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future>(new GetAuditStateByServerActor(cx, type, auditId, auditServerId, range)); + #line 6246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + + #line 6251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via checkAuditProgressCompleteByRange() + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class CheckAuditProgressCompleteByRangeActorState { + #line 6258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + CheckAuditProgressCompleteByRangeActorState(Database const& cx,AuditType const& auditType,UID const& auditId,KeyRange const& auditRange) + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : cx(cx), + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditType(auditType), + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditId(auditId), + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditRange(auditRange) + #line 6271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("checkAuditProgressCompleteByRange", reinterpret_cast(this)); + + } + ~CheckAuditProgressCompleteByRangeActorState() + { + fdb_probe_actor_destroy("checkAuditProgressCompleteByRange", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(auditType == AuditType::ValidateHA || auditType == AuditType::ValidateReplica || auditType == AuditType::ValidateLocationMetadata); + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + rangeToRead = auditRange; + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + rangeToReadBegin = auditRange.begin; + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + retryCount = 0; + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 6294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CheckAuditProgressCompleteByRangeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilCheckAuditProgressFinish") .detail("AuditID", auditId) .detail("AuditRange", auditRange) .detail("AuditType", auditType); + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~CheckAuditProgressCompleteByRangeActorState(); static_cast(this)->destroy(); return 0; } + #line 6319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~CheckAuditProgressCompleteByRangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!(rangeToReadBegin < auditRange.end)) + #line 6338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 6344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopBody1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1(int loopDepth) + { + try { + #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + rangeToRead = KeyRangeRef(rangeToReadBegin, auditRange.end); + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture> __when_expr_0 = getAuditStateByRange(cx, auditType, auditId, rangeToRead); + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 6384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 6389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1break1(int loopDepth) + { + try { + return a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopBody1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (e.code() == error_code_actor_cancelled) + #line 6424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 2)); + #line 6428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (retryCount > 30) + #line 6432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevWarn, "AuditUtilCheckAuditProgressFailed") .detail("AuditID", auditId) .detail("AuditRange", auditRange) .detail("AuditType", auditType); + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(audit_storage_failed(), std::max(0, loopDepth - 2)); + #line 6438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = delay(0.5); + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); + #line 6444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 2)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 2)); + } + + return loopDepth; + } + int a_body1loopBody1loopBody1cont2(int loopDepth) + { + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for(int i = 0;i < auditStates.size();i++) { + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditPhase phase = auditStates[i].getPhase(); + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (phase == AuditPhase::Invalid) + #line 6468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevWarn, "AuditUtilCheckAuditProgressNotFinished") .detail("AuditID", auditId) .detail("AuditRange", auditRange) .detail("AuditType", auditType) .detail("UnfinishedRange", auditStates[i].range); + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckAuditProgressCompleteByRangeActorState(); static_cast(this)->destroy(); return 0; } + #line 6474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~CheckAuditProgressCompleteByRangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + rangeToReadBegin = auditStates.back().range.end; + #line 6483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1loopBody1when1(std::vector const& __auditStates,int loopDepth) + { + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStates = __auditStates; + #line 6492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopBody1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1when1(std::vector && __auditStates,int loopDepth) + { + auditStates = std::move(__auditStates); + loopDepth = a_body1loopBody1loopBody1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckAuditProgressCompleteByRangeActor, 0, std::vector >::remove(); + + } + void a_callback_fire(ActorCallback< CheckAuditProgressCompleteByRangeActor, 0, std::vector >*,std::vector const& value) + { + fdb_probe_actor_enter("checkAuditProgressCompleteByRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAuditProgressCompleteByRange", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CheckAuditProgressCompleteByRangeActor, 0, std::vector >*,std::vector && value) + { + fdb_probe_actor_enter("checkAuditProgressCompleteByRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAuditProgressCompleteByRange", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CheckAuditProgressCompleteByRangeActor, 0, std::vector >*,Error err) + { + fdb_probe_actor_enter("checkAuditProgressCompleteByRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAuditProgressCompleteByRange", reinterpret_cast(this), 0); + + } + int a_body1loopBody1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + retryCount++; + #line 6559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopBody1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1Catch1cont1(Void && _,int loopDepth) + { + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + retryCount++; + #line 6568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopBody1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckAuditProgressCompleteByRangeActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CheckAuditProgressCompleteByRangeActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("checkAuditProgressCompleteByRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAuditProgressCompleteByRange", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< CheckAuditProgressCompleteByRangeActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("checkAuditProgressCompleteByRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAuditProgressCompleteByRange", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< CheckAuditProgressCompleteByRangeActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("checkAuditProgressCompleteByRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAuditProgressCompleteByRange", reinterpret_cast(this), 1); + + } + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Database cx; + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditType auditType; + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID auditId; + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + KeyRange auditRange; + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + KeyRange rangeToRead; + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Key rangeToReadBegin; + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + int retryCount; + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector auditStates; + #line 6652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via checkAuditProgressCompleteByRange() + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class CheckAuditProgressCompleteByRangeActor final : public Actor, public ActorCallback< CheckAuditProgressCompleteByRangeActor, 0, std::vector >, public ActorCallback< CheckAuditProgressCompleteByRangeActor, 1, Void >, public FastAllocated, public CheckAuditProgressCompleteByRangeActorState { + #line 6657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CheckAuditProgressCompleteByRangeActor, 0, std::vector >; +friend struct ActorCallback< CheckAuditProgressCompleteByRangeActor, 1, Void >; + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + CheckAuditProgressCompleteByRangeActor(Database const& cx,AuditType const& auditType,UID const& auditId,KeyRange const& auditRange) + #line 6669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor(), + CheckAuditProgressCompleteByRangeActorState(cx, auditType, auditId, auditRange) + { + fdb_probe_actor_enter("checkAuditProgressCompleteByRange", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("checkAuditProgressCompleteByRange"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("checkAuditProgressCompleteByRange", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CheckAuditProgressCompleteByRangeActor, 0, std::vector >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CheckAuditProgressCompleteByRangeActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future checkAuditProgressCompleteByRange( Database const& cx, AuditType const& auditType, UID const& auditId, KeyRange const& auditRange ) { + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future(new CheckAuditProgressCompleteByRangeActor(cx, auditType, auditId, auditRange)); + #line 6698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + + #line 6703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via checkAuditProgressCompleteByServer() + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class CheckAuditProgressCompleteByServerActorState { + #line 6710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + CheckAuditProgressCompleteByServerActorState(Database const& cx,AuditType const& auditType,UID const& auditId,KeyRange const& auditRange,UID const& serverId,std::shared_ptr> const& checkProgressBudget) + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : cx(cx), + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditType(auditType), + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditId(auditId), + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditRange(auditRange), + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + serverId(serverId), + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + checkProgressBudget(checkProgressBudget) + #line 6727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("checkAuditProgressCompleteByServer", reinterpret_cast(this)); + + } + ~CheckAuditProgressCompleteByServerActorState() + { + fdb_probe_actor_destroy("checkAuditProgressCompleteByServer", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ASSERT(auditType == AuditType::ValidateStorageServerShard); + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + rangeToRead = auditRange; + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + rangeToReadBegin = auditRange.begin; + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + retryCount = 0; + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 6750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CheckAuditProgressCompleteByServerActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + checkProgressBudget->set(checkProgressBudget->get() + 1); + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilCheckAuditProgressFinish") .detail("ServerID", serverId) .detail("AuditID", auditId) .detail("AuditRange", auditRange) .detail("AuditType", auditType); + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~CheckAuditProgressCompleteByServerActorState(); static_cast(this)->destroy(); return 0; } + #line 6777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~CheckAuditProgressCompleteByServerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!(rangeToReadBegin < auditRange.end)) + #line 6796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 6802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopBody1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1(int loopDepth) + { + try { + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + rangeToRead = KeyRangeRef(rangeToReadBegin, auditRange.end); + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture> __when_expr_0 = getAuditStateByServer(cx, auditType, auditId, serverId, rangeToRead); + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 6842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 6847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1break1(int loopDepth) + { + try { + return a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopBody1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (e.code() == error_code_actor_cancelled) + #line 6882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 2)); + #line 6886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (retryCount > 30) + #line 6890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevWarn, "AuditUtilCheckAuditProgressFailed") .detail("ServerID", serverId) .detail("AuditID", auditId) .detail("AuditRange", auditRange) .detail("AuditType", auditType); + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + checkProgressBudget->set(checkProgressBudget->get() + 1); + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(audit_storage_failed(), std::max(0, loopDepth - 2)); + #line 6898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = delay(0.5); + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); + #line 6904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 2)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 2)); + } + + return loopDepth; + } + int a_body1loopBody1loopBody1cont2(int loopDepth) + { + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for(int i = 0;i < auditStates.size();i++) { + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditPhase phase = auditStates[i].getPhase(); + #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (phase == AuditPhase::Invalid) + #line 6928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevWarn, "AuditUtilCheckAuditProgressNotFinished") .detail("ServerID", serverId) .detail("AuditID", auditId) .detail("AuditRange", auditRange) .detail("AuditType", auditType) .detail("UnfinishedRange", auditStates[i].range); + #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + checkProgressBudget->set(checkProgressBudget->get() + 1); + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckAuditProgressCompleteByServerActorState(); static_cast(this)->destroy(); return 0; } + #line 6936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~CheckAuditProgressCompleteByServerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + rangeToReadBegin = auditStates.back().range.end; + #line 6945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1loopBody1when1(std::vector const& __auditStates,int loopDepth) + { + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStates = __auditStates; + #line 6954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopBody1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1when1(std::vector && __auditStates,int loopDepth) + { + auditStates = std::move(__auditStates); + loopDepth = a_body1loopBody1loopBody1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckAuditProgressCompleteByServerActor, 0, std::vector >::remove(); + + } + void a_callback_fire(ActorCallback< CheckAuditProgressCompleteByServerActor, 0, std::vector >*,std::vector const& value) + { + fdb_probe_actor_enter("checkAuditProgressCompleteByServer", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAuditProgressCompleteByServer", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CheckAuditProgressCompleteByServerActor, 0, std::vector >*,std::vector && value) + { + fdb_probe_actor_enter("checkAuditProgressCompleteByServer", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAuditProgressCompleteByServer", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CheckAuditProgressCompleteByServerActor, 0, std::vector >*,Error err) + { + fdb_probe_actor_enter("checkAuditProgressCompleteByServer", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAuditProgressCompleteByServer", reinterpret_cast(this), 0); + + } + int a_body1loopBody1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + retryCount++; + #line 7021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopBody1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1Catch1cont1(Void && _,int loopDepth) + { + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + retryCount++; + #line 7030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopBody1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckAuditProgressCompleteByServerActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CheckAuditProgressCompleteByServerActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("checkAuditProgressCompleteByServer", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAuditProgressCompleteByServer", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< CheckAuditProgressCompleteByServerActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("checkAuditProgressCompleteByServer", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAuditProgressCompleteByServer", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< CheckAuditProgressCompleteByServerActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("checkAuditProgressCompleteByServer", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAuditProgressCompleteByServer", reinterpret_cast(this), 1); + + } + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Database cx; + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditType auditType; + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID auditId; + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + KeyRange auditRange; + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID serverId; + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::shared_ptr> checkProgressBudget; + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + KeyRange rangeToRead; + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Key rangeToReadBegin; + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + int retryCount; + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector auditStates; + #line 7118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via checkAuditProgressCompleteByServer() + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class CheckAuditProgressCompleteByServerActor final : public Actor, public ActorCallback< CheckAuditProgressCompleteByServerActor, 0, std::vector >, public ActorCallback< CheckAuditProgressCompleteByServerActor, 1, Void >, public FastAllocated, public CheckAuditProgressCompleteByServerActorState { + #line 7123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CheckAuditProgressCompleteByServerActor, 0, std::vector >; +friend struct ActorCallback< CheckAuditProgressCompleteByServerActor, 1, Void >; + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + CheckAuditProgressCompleteByServerActor(Database const& cx,AuditType const& auditType,UID const& auditId,KeyRange const& auditRange,UID const& serverId,std::shared_ptr> const& checkProgressBudget) + #line 7135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor(), + CheckAuditProgressCompleteByServerActorState(cx, auditType, auditId, auditRange, serverId, checkProgressBudget) + { + fdb_probe_actor_enter("checkAuditProgressCompleteByServer", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("checkAuditProgressCompleteByServer"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("checkAuditProgressCompleteByServer", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CheckAuditProgressCompleteByServerActor, 0, std::vector >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CheckAuditProgressCompleteByServerActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future checkAuditProgressCompleteByServer( Database const& cx, AuditType const& auditType, UID const& auditId, KeyRange const& auditRange, UID const& serverId, std::shared_ptr> const& checkProgressBudget ) { + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future(new CheckAuditProgressCompleteByServerActor(cx, auditType, auditId, auditRange, serverId, checkProgressBudget)); + #line 7164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + +// Load RUNNING audit states to resume, clean up COMPLETE and FAILED audit states +// Update ddId for RUNNING audit states + #line 7171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via initAuditMetadata() + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class InitAuditMetadataActorState { + #line 7178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + InitAuditMetadataActorState(Database const& cx,MoveKeyLockInfo const& lock,bool const& ddEnabled,UID const& dataDistributorId,int const& persistFinishAuditCount) + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : cx(cx), + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + lock(lock), + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ddEnabled(ddEnabled), + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + dataDistributorId(dataDistributorId), + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + persistFinishAuditCount(persistFinishAuditCount), + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + existingAuditStates(), + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStatesToResume(), + #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr(cx), + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + retryCount(0) + #line 7201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("initAuditMetadata", reinterpret_cast(this)); + + } + ~InitAuditMetadataActorState() + { + fdb_probe_actor_destroy("initAuditMetadata", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ; + #line 7216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~InitAuditMetadataActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(auditStatesToResume); this->~InitAuditMetadataActorState(); static_cast(this)->destroy(); return 0; } + #line 7239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::move(auditStatesToResume)); // state_var_RVO + this->~InitAuditMetadataActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + existingAuditStates.clear(); + #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStatesToResume.clear(); + #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_0 = checkMoveKeysLockForAudit(&tr, lock, ddEnabled, true); + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (e.code() == error_code_actor_cancelled || e.code() == error_code_movekeys_conflict) + #line 7311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 7315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (retryCount > 50) + #line 7319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevWarnAlways, "AuditUtilInitAuditMetadataExceedRetryMax", dataDistributorId) .errorUnsuppressed(e); + #line 7323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + try { + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_3 = tr.onError(e); + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1Catch1(actor_cancelled(), loopDepth); + #line 7331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1Catch1(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Void const& _,int loopDepth) + { + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = tr.getRange(auditKeys, CLIENT_KNOBS->TOO_MANY); + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Void && _,int loopDepth) + { + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_1 = tr.getRange(auditKeys, CLIENT_KNOBS->TOO_MANY); + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< InitAuditMetadataActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< InitAuditMetadataActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("initAuditMetadata", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initAuditMetadata", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< InitAuditMetadataActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("initAuditMetadata", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initAuditMetadata", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< InitAuditMetadataActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("initAuditMetadata", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initAuditMetadata", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(RangeResult const& result,int loopDepth) + { + #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (result.more || result.size() >= CLIENT_KNOBS->TOO_MANY) + #line 7452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(g_network->isSimulated() ? SevError : SevWarnAlways, "AuditUtilLoadMetadataIncomplete", dataDistributorId) .detail("ResMore", result.more) .detail("ResSize", result.size()); + #line 7456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for(int i = 0;i < result.size();++i) { + #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auto auditState = decodeAuditStorageState(result[i].value); + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevVerbose, "AuditUtilLoadMetadataEach", dataDistributorId) .detail("CurrentDDID", dataDistributorId) .detail("AuditDDID", auditState.ddId) .detail("AuditType", auditState.getType()) .detail("AuditID", auditState.id) .detail("AuditPhase", auditState.getPhase()); + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.getPhase() == AuditPhase::Running) + #line 7466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState toUpdate = auditState; + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + toUpdate.ddId = dataDistributorId; + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.set(auditKey(toUpdate.getType(), toUpdate.id), auditStorageStateValue(toUpdate)); + #line 7474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + existingAuditStates[auditState.getType()].push_back(auditState); + #line 7478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for( const auto& [auditType, _] : existingAuditStates ) { + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + int numFinishAudit = 0; + #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for( const auto& auditState : existingAuditStates[auditType] ) { + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.getPhase() == AuditPhase::Complete || auditState.getPhase() == AuditPhase::Failed) + #line 7488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + numFinishAudit++; + #line 7492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + const int numFinishAuditsToClear = numFinishAudit - persistFinishAuditCount; + #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + int numFinishAuditsCleared = 0; + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::sort(existingAuditStates[auditType].begin(), existingAuditStates[auditType].end(), [](AuditStorageState a, AuditStorageState b) { return a.id < b.id; }); + #line 834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for( const auto& auditState : existingAuditStates[auditType] ) { + #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.getPhase() == AuditPhase::Failed) + #line 7505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (numFinishAuditsCleared < numFinishAuditsToClear) + #line 7509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.clear(auditKey(auditState.getType(), auditState.id)); + #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + clearAuditProgressMetadata(&tr, auditState.getType(), auditState.id); + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + numFinishAuditsCleared++; + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilMetadataCleared", dataDistributorId) .detail("AuditID", auditState.id) .detail("AuditType", auditState.getType()) .detail("AuditRange", auditState.range); + #line 7519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + else + { + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.getPhase() == AuditPhase::Complete) + #line 7526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (numFinishAuditsCleared < numFinishAuditsToClear) + #line 7530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.clear(auditKey(auditState.getType(), auditState.id)); + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + numFinishAuditsCleared++; + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilMetadataCleared", dataDistributorId) .detail("AuditID", auditState.id) .detail("AuditType", auditState.getType()) .detail("AuditRange", auditState.range); + #line 7538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + else + { + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.getPhase() == AuditPhase::Running) + #line 7545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStatesToResume.push_back(auditState); + #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilMetadataAddedToResume", dataDistributorId) .detail("AuditID", auditState.id) .detail("AuditType", auditState.getType()) .detail("AuditRange", auditState.range); + #line 7551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + } + } + } + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_2 = tr.commit(); + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(RangeResult && result,int loopDepth) + { + #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (result.more || result.size() >= CLIENT_KNOBS->TOO_MANY) + #line 7575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(g_network->isSimulated() ? SevError : SevWarnAlways, "AuditUtilLoadMetadataIncomplete", dataDistributorId) .detail("ResMore", result.more) .detail("ResSize", result.size()); + #line 7579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for(int i = 0;i < result.size();++i) { + #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auto auditState = decodeAuditStorageState(result[i].value); + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevVerbose, "AuditUtilLoadMetadataEach", dataDistributorId) .detail("CurrentDDID", dataDistributorId) .detail("AuditDDID", auditState.ddId) .detail("AuditType", auditState.getType()) .detail("AuditID", auditState.id) .detail("AuditPhase", auditState.getPhase()); + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.getPhase() == AuditPhase::Running) + #line 7589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditStorageState toUpdate = auditState; + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + toUpdate.ddId = dataDistributorId; + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.set(auditKey(toUpdate.getType(), toUpdate.id), auditStorageStateValue(toUpdate)); + #line 7597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + existingAuditStates[auditState.getType()].push_back(auditState); + #line 7601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for( const auto& [auditType, _] : existingAuditStates ) { + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + int numFinishAudit = 0; + #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for( const auto& auditState : existingAuditStates[auditType] ) { + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.getPhase() == AuditPhase::Complete || auditState.getPhase() == AuditPhase::Failed) + #line 7611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + numFinishAudit++; + #line 7615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + const int numFinishAuditsToClear = numFinishAudit - persistFinishAuditCount; + #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + int numFinishAuditsCleared = 0; + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::sort(existingAuditStates[auditType].begin(), existingAuditStates[auditType].end(), [](AuditStorageState a, AuditStorageState b) { return a.id < b.id; }); + #line 834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for( const auto& auditState : existingAuditStates[auditType] ) { + #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.getPhase() == AuditPhase::Failed) + #line 7628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (numFinishAuditsCleared < numFinishAuditsToClear) + #line 7632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.clear(auditKey(auditState.getType(), auditState.id)); + #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + clearAuditProgressMetadata(&tr, auditState.getType(), auditState.id); + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + numFinishAuditsCleared++; + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilMetadataCleared", dataDistributorId) .detail("AuditID", auditState.id) .detail("AuditType", auditState.getType()) .detail("AuditRange", auditState.range); + #line 7642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + else + { + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.getPhase() == AuditPhase::Complete) + #line 7649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (numFinishAuditsCleared < numFinishAuditsToClear) + #line 7653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.clear(auditKey(auditState.getType(), auditState.id)); + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + numFinishAuditsCleared++; + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilMetadataCleared", dataDistributorId) .detail("AuditID", auditState.id) .detail("AuditType", auditState.getType()) .detail("AuditRange", auditState.range); + #line 7661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + else + { + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (auditState.getPhase() == AuditPhase::Running) + #line 7668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + auditStatesToResume.push_back(auditState); + #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilMetadataAddedToResume", dataDistributorId) .detail("AuditID", auditState.id) .detail("AuditType", auditState.getType()) .detail("AuditRange", auditState.range); + #line 7674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + } + } + } + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_2 = tr.commit(); + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(RangeResult const& result,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(result, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(RangeResult && result,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(result), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< InitAuditMetadataActor, 1, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< InitAuditMetadataActor, 1, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("initAuditMetadata", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initAuditMetadata", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< InitAuditMetadataActor, 1, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("initAuditMetadata", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initAuditMetadata", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< InitAuditMetadataActor, 1, RangeResult >*,Error err) + { + fdb_probe_actor_enter("initAuditMetadata", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initAuditMetadata", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont4(Void const& _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< InitAuditMetadataActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< InitAuditMetadataActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("initAuditMetadata", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initAuditMetadata", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< InitAuditMetadataActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("initAuditMetadata", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initAuditMetadata", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< InitAuditMetadataActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("initAuditMetadata", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initAuditMetadata", reinterpret_cast(this), 2); + + } + int a_body1loopBody1Catch1cont1(int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + retryCount++; + #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr.reset(); + #line 7845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1Catch1cont4(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont5(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont4(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont5(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< InitAuditMetadataActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< InitAuditMetadataActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("initAuditMetadata", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initAuditMetadata", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< InitAuditMetadataActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("initAuditMetadata", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initAuditMetadata", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< InitAuditMetadataActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("initAuditMetadata", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initAuditMetadata", reinterpret_cast(this), 3); + + } + int a_body1loopBody1Catch1cont5(int loopDepth) + { + try { + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Database cx; + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + MoveKeyLockInfo lock; + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + bool ddEnabled; + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID dataDistributorId; + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + int persistFinishAuditCount; + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::unordered_map> existingAuditStates; + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector auditStatesToResume; + #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction tr; + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + int retryCount; + #line 7962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via initAuditMetadata() + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class InitAuditMetadataActor final : public Actor>, public ActorCallback< InitAuditMetadataActor, 0, Void >, public ActorCallback< InitAuditMetadataActor, 1, RangeResult >, public ActorCallback< InitAuditMetadataActor, 2, Void >, public ActorCallback< InitAuditMetadataActor, 3, Void >, public FastAllocated, public InitAuditMetadataActorState { + #line 7967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< InitAuditMetadataActor, 0, Void >; +friend struct ActorCallback< InitAuditMetadataActor, 1, RangeResult >; +friend struct ActorCallback< InitAuditMetadataActor, 2, Void >; +friend struct ActorCallback< InitAuditMetadataActor, 3, Void >; + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + InitAuditMetadataActor(Database const& cx,MoveKeyLockInfo const& lock,bool const& ddEnabled,UID const& dataDistributorId,int const& persistFinishAuditCount) + #line 7981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor>(), + InitAuditMetadataActorState(cx, lock, ddEnabled, dataDistributorId, persistFinishAuditCount) + { + fdb_probe_actor_enter("initAuditMetadata", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("initAuditMetadata"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("initAuditMetadata", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< InitAuditMetadataActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< InitAuditMetadataActor, 1, RangeResult >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< InitAuditMetadataActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< InitAuditMetadataActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future> initAuditMetadata( Database const& cx, MoveKeyLockInfo const& lock, bool const& ddEnabled, UID const& dataDistributorId, int const& persistFinishAuditCount ) { + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future>(new InitAuditMetadataActor(cx, lock, ddEnabled, dataDistributorId, persistFinishAuditCount)); + #line 8012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + +// Check if any pair of ranges are exclusive with each other +// This is not a part in consistency check of audit metadata +// This is used for checking the validity of inputs to rangesSame() +bool elementsAreExclusiveWithEachOther(std::vector ranges) { + ASSERT(std::is_sorted(ranges.begin(), ranges.end(), KeyRangeRef::ArbitraryOrder())); + for (int i = 0; i < ranges.size() - 1; ++i) { + if (ranges[i].end > ranges[i + 1].begin) { + TraceEvent(SevError, "AuditUtilElementsAreNotExclusiveWithEachOther").detail("Ranges", describe(ranges)); + return false; + } + } + return true; +} + +// Check if any range is empty in the given list of ranges +// This is not a part in consistency check of audit metadata +// This is used for checking the validity of inputs to rangesSame() +bool noEmptyRangeInRanges(std::vector ranges) { + for (const auto& range : ranges) { + if (range.empty()) { + return false; + } + } + return true; +} + +// Given a list of ranges, where ranges can overlap with each other +// Return a list of exclusive ranges which covers the ranges exactly +// the same as the input list of ranges +std::vector coalesceRangeList(std::vector ranges) { + std::sort(ranges.begin(), ranges.end(), [](KeyRange a, KeyRange b) { return a.begin < b.begin; }); + std::vector res; + for (const auto& range : ranges) { + if (res.empty()) { + res.push_back(range); + continue; + } + if (range.begin <= res.back().end) { + if (range.end > res.back().end) { // update res.back if current range extends the back range + KeyRange newBack = Standalone(KeyRangeRef(res.back().begin, range.end)); + res.pop_back(); + res.push_back(newBack); + } + } else { + res.push_back(range); + } + } + return res; +} + +// Given two lists of ranges --- rangesA and rangesB, check if two lists are identical +// If not, return the mismatched two ranges of rangeA and rangeB respectively +Optional> rangesSame(std::vector rangesA, std::vector rangesB) { + if (g_network->isSimulated()) { + ASSERT(noEmptyRangeInRanges(rangesA)); + ASSERT(noEmptyRangeInRanges(rangesB)); + } + KeyRange emptyRange; + if (rangesA.empty() && rangesB.empty()) { // no mismatch + return Optional>(); + } else if (rangesA.empty() && !rangesB.empty()) { // rangesA is empty while rangesB has a range + return std::make_pair(emptyRange, rangesB.front()); + } else if (!rangesA.empty() && rangesB.empty()) { // rangesB is empty while rangesA has a range + return std::make_pair(rangesA.front(), emptyRange); + } + TraceEvent(SevVerbose, "AuditUtilRangesSameBeforeSort").detail("RangesA", rangesA).detail("Rangesb", rangesB); + // sort in ascending order + std::sort(rangesA.begin(), rangesA.end(), [](KeyRange a, KeyRange b) { return a.begin < b.begin; }); + std::sort(rangesB.begin(), rangesB.end(), [](KeyRange a, KeyRange b) { return a.begin < b.begin; }); + TraceEvent(SevVerbose, "AuditUtilRangesSameAfterSort").detail("RangesA", rangesA).detail("Rangesb", rangesB); + if (g_network->isSimulated()) { + ASSERT(elementsAreExclusiveWithEachOther(rangesA)); + ASSERT(elementsAreExclusiveWithEachOther(rangesB)); + } + if (rangesA.front().begin != rangesB.front().begin) { // rangeList heads mismatch + return std::make_pair(rangesA.front(), rangesB.front()); + } else if (rangesA.back().end != rangesB.back().end) { // rangeList backs mismatch + return std::make_pair(rangesA.back(), rangesB.back()); + } + int ia = 0; + int ib = 0; + KeyRangeRef rangeA = rangesA[0]; + KeyRangeRef rangeB = rangesB[0]; + KeyRange lastRangeA = Standalone(rangeA); + KeyRange lastRangeB = Standalone(rangeB); + while (true) { + if (rangeA.begin == rangeB.begin) { + if (rangeA.end == rangeB.end) { + if (rangeA.end == rangesA.back().end) { + break; + } + ++ia; + ++ib; + rangeA = rangesA[ia]; + rangeB = rangesB[ib]; + lastRangeA = Standalone(rangeA); + lastRangeB = Standalone(rangeB); + } else if (rangeA.end > rangeB.end) { + rangeA = KeyRangeRef(rangeB.end, rangeA.end); + ++ib; + rangeB = rangesB[ib]; + lastRangeB = Standalone(rangeB); + } else { + rangeB = KeyRangeRef(rangeA.end, rangeB.end); + ++ia; + rangeA = rangesA[ia]; + lastRangeA = Standalone(rangeA); + } + } else { + return std::make_pair(lastRangeA, lastRangeB); + } + } + return Optional>(); +} + +// Given an input server, get ranges within the input range via the input transaction +// from the perspective of ServerKeys system key space +// Input: (1) SS id; (2) transaction tr; (3) within range +// Return AuditGetServerKeysRes, including: (1) complete range by a single read range; +// (2) verison of the read; (3) ranges of the input SS + #line 8137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via getThisServerKeysFromServerKeys() + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class GetThisServerKeysFromServerKeysActorState { + #line 8144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + GetThisServerKeysFromServerKeysActorState(UID const& serverID,Transaction* const& tr,KeyRange const& range) + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : serverID(serverID), + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr(tr), + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + range(range), + #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + readResult(), + #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res() + #line 8159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("getThisServerKeysFromServerKeys", reinterpret_cast(this)); + + } + ~GetThisServerKeysFromServerKeysActorState() + { + fdb_probe_actor_destroy("getThisServerKeysFromServerKeys", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + try { + #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_0 = store(readResult, krmGetRanges(tr, serverKeysPrefixFor(serverID), range, CLIENT_KNOBS->KRM_GET_RANGE_LIMIT, CLIENT_KNOBS->KRM_GET_RANGE_LIMIT_BYTES)); + #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 8177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 8182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetThisServerKeysFromServerKeysActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(res); this->~GetThisServerKeysFromServerKeysActorState(); static_cast(this)->destroy(); return 0; } + #line 8211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< AuditGetServerKeysRes >::value()) AuditGetServerKeysRes(std::move(res)); // state_var_RVO + this->~GetThisServerKeysFromServerKeysActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilGetThisServerKeysError", serverID) .errorUnsuppressed(e) .detail("AduitServerID", serverID); + #line 1059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 8226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Future grvF = tr->getReadVersion(); + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!grvF.isReady()) + #line 8242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevWarnAlways, "AuditUtilReadServerKeysGRVError", serverID); + #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch2(audit_storage_cancelled(), loopDepth); + #line 8248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Version readAtVersion = grvF.get(); + #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevVerbose, "AuditUtilGetThisServerKeysFromServerKeysReadDone", serverID) .detail("Range", range) .detail("Prefix", serverKeysPrefixFor(serverID)) .detail("ResultSize", readResult.size()) .detail("AduitServerID", serverID); + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector ownRanges; + #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for(int i = 0;i < readResult.size() - 1;++i) { + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevVerbose, "AuditUtilGetThisServerKeysFromServerKeysAddToResult", serverID) .detail("ValueIsServerKeysFalse", readResult[i].value == serverKeysFalse) .detail("ServerHasKey", serverHasKey(readResult[i].value)) .detail("Range", KeyRangeRef(readResult[i].key, readResult[i + 1].key)) .detail("AduitServerID", serverID); + #line 1040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (serverHasKey(readResult[i].value)) + #line 8262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + KeyRange shardRange; + #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ownRanges.push_back(Standalone(KeyRangeRef(readResult[i].key, readResult[i + 1].key))); + #line 8268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + const KeyRange completeRange = Standalone(KeyRangeRef(range.begin, readResult.back().key)); + #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevVerbose, "AuditUtilGetThisServerKeysFromServerKeysEnd", serverID) .detail("AduitServerID", serverID) .detail("Range", range) .detail("Prefix", serverKeysPrefixFor(serverID)) .detail("ReadAtVersion", readAtVersion) .detail("CompleteRange", completeRange) .detail("ResultSize", ownRanges.size()); + #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res = AuditGetServerKeysRes(completeRange, readAtVersion, serverID, ownRanges, readResult.logicalSize()); + #line 8277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1cont7(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Future grvF = tr->getReadVersion(); + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!grvF.isReady()) + #line 8288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevWarnAlways, "AuditUtilReadServerKeysGRVError", serverID); + #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch2(audit_storage_cancelled(), loopDepth); + #line 8294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Version readAtVersion = grvF.get(); + #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevVerbose, "AuditUtilGetThisServerKeysFromServerKeysReadDone", serverID) .detail("Range", range) .detail("Prefix", serverKeysPrefixFor(serverID)) .detail("ResultSize", readResult.size()) .detail("AduitServerID", serverID); + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector ownRanges; + #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for(int i = 0;i < readResult.size() - 1;++i) { + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevVerbose, "AuditUtilGetThisServerKeysFromServerKeysAddToResult", serverID) .detail("ValueIsServerKeysFalse", readResult[i].value == serverKeysFalse) .detail("ServerHasKey", serverHasKey(readResult[i].value)) .detail("Range", KeyRangeRef(readResult[i].key, readResult[i + 1].key)) .detail("AduitServerID", serverID); + #line 1040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (serverHasKey(readResult[i].value)) + #line 8308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + KeyRange shardRange; + #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + ownRanges.push_back(Standalone(KeyRangeRef(readResult[i].key, readResult[i + 1].key))); + #line 8314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + const KeyRange completeRange = Standalone(KeyRangeRef(range.begin, readResult.back().key)); + #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevVerbose, "AuditUtilGetThisServerKeysFromServerKeysEnd", serverID) .detail("AduitServerID", serverID) .detail("Range", range) .detail("Prefix", serverKeysPrefixFor(serverID)) .detail("ReadAtVersion", readAtVersion) .detail("CompleteRange", completeRange) .detail("ResultSize", ownRanges.size()); + #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res = AuditGetServerKeysRes(completeRange, readAtVersion, serverID, ownRanges, readResult.logicalSize()); + #line 8323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1cont7(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetThisServerKeysFromServerKeysActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetThisServerKeysFromServerKeysActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getThisServerKeysFromServerKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("getThisServerKeysFromServerKeys", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetThisServerKeysFromServerKeysActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getThisServerKeysFromServerKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("getThisServerKeysFromServerKeys", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetThisServerKeysFromServerKeysActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getThisServerKeysFromServerKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("getThisServerKeysFromServerKeys", reinterpret_cast(this), 0); + + } + int a_body1cont7(int loopDepth) + { + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID serverID; + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction* tr; + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + KeyRange range; + #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + RangeResult readResult; + #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditGetServerKeysRes res; + #line 8414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via getThisServerKeysFromServerKeys() + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class GetThisServerKeysFromServerKeysActor final : public Actor, public ActorCallback< GetThisServerKeysFromServerKeysActor, 0, Void >, public FastAllocated, public GetThisServerKeysFromServerKeysActorState { + #line 8419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetThisServerKeysFromServerKeysActor, 0, Void >; + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + GetThisServerKeysFromServerKeysActor(UID const& serverID,Transaction* const& tr,KeyRange const& range) + #line 8430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor(), + GetThisServerKeysFromServerKeysActorState(serverID, tr, range) + { + fdb_probe_actor_enter("getThisServerKeysFromServerKeys", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getThisServerKeysFromServerKeys"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getThisServerKeysFromServerKeys", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetThisServerKeysFromServerKeysActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future getThisServerKeysFromServerKeys( UID const& serverID, Transaction* const& tr, KeyRange const& range ) { + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future(new GetThisServerKeysFromServerKeysActor(serverID, tr, range)); + #line 8458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + +// Given an input server, get ranges within the input range via the input transaction +// from the perspective of KeyServers system key space +// Input: (1) Audit Server ID (for logging); (2) transaction tr; (3) within range +// Return AuditGetKeyServersRes, including : (1) complete range by a single read range; (2) verison of the read; +// (3) map between SSes and their ranges --- in KeyServers space, a range corresponds to multiple SSes + #line 8468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via getShardMapFromKeyServers() + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +template + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class GetShardMapFromKeyServersActorState { + #line 8475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + GetShardMapFromKeyServersActorState(UID const& auditServerId,Transaction* const& tr,KeyRange const& range) + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + : auditServerId(auditServerId), + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + tr(tr), + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + range(range), + #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res(), + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + actors(), + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + readResult(), + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UIDtoTagMap(), + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + totalShardsCount(0), + #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + shardsInAnonymousPhysicalShardCount(0) + #line 8498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + fdb_probe_actor_create("getShardMapFromKeyServers", reinterpret_cast(this)); + + } + ~GetShardMapFromKeyServersActorState() + { + fdb_probe_actor_destroy("getShardMapFromKeyServers", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + try { + #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + actors.push_back(store(readResult, krmGetRanges(tr, keyServersPrefix, range, CLIENT_KNOBS->KRM_GET_RANGE_LIMIT, CLIENT_KNOBS->KRM_GET_RANGE_LIMIT_BYTES))); + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + actors.push_back(store(UIDtoTagMap, tr->getRange(serverTagKeys, CLIENT_KNOBS->TOO_MANY))); + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + StrictFuture __when_expr_0 = waitForAll(actors); + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 8520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 8525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetShardMapFromKeyServersActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(res); this->~GetShardMapFromKeyServersActorState(); static_cast(this)->destroy(); return 0; } + #line 8554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + new (&static_cast(this)->SAV< AuditGetKeyServersRes >::value()) AuditGetKeyServersRes(std::move(res)); // state_var_RVO + this->~GetShardMapFromKeyServersActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevDebug, "AuditUtilGetThisServerKeysFromKeyServersError", auditServerId) .errorUnsuppressed(e) .detail("AuditServerId", auditServerId); + #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 8569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (UIDtoTagMap.more || UIDtoTagMap.size() >= CLIENT_KNOBS->TOO_MANY) + #line 8583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(g_network->isSimulated() ? SevError : SevWarnAlways, "AuditUtilReadKeyServersReadTagError", auditServerId); + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch2(audit_storage_cancelled(), loopDepth); + #line 8589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Future grvF = tr->getReadVersion(); + #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!grvF.isReady()) + #line 8595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevWarnAlways, "AuditUtilReadKeyServersGRVError", auditServerId); + #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch2(audit_storage_cancelled(), loopDepth); + #line 8601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Version readAtVersion = grvF.get(); + #line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevVerbose, "AuditUtilGetThisServerKeysFromKeyServersReadDone", auditServerId) .detail("Range", range) .detail("ResultSize", readResult.size()) .detail("AduitServerID", auditServerId); + #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::unordered_map> serverOwnRanges; + #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for(int i = 0;i < readResult.size() - 1;++i) { + #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector src; + #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector dest; + #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID srcID; + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID destID; + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + decodeKeyServersValue(UIDtoTagMap, readResult[i].value, src, dest, srcID, destID); + #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (srcID == anonymousShardId) + #line 8623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + shardsInAnonymousPhysicalShardCount++; + #line 8627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + totalShardsCount++; + #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector servers(src.size() + dest.size()); + #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::merge(src.begin(), src.end(), dest.begin(), dest.end(), servers.begin()); + #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for( auto& ssid : servers ) { + #line 1121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + serverOwnRanges[ssid].push_back(Standalone(KeyRangeRef(readResult[i].key, readResult[i + 1].key))); + #line 8639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + const KeyRange completeRange = Standalone(KeyRangeRef(range.begin, readResult.back().key)); + #line 1125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilGetThisServerKeysFromKeyServersEnd", auditServerId) .detail("Range", range) .detail("CompleteRange", completeRange) .detail("AtVersion", readAtVersion) .detail("ShardsInAnonymousPhysicalShardCount", shardsInAnonymousPhysicalShardCount) .detail("TotalShardsCount", totalShardsCount); + #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res = AuditGetKeyServersRes(completeRange, readAtVersion, serverOwnRanges, readResult.logicalSize()); + #line 8648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1cont9(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (UIDtoTagMap.more || UIDtoTagMap.size() >= CLIENT_KNOBS->TOO_MANY) + #line 8657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(g_network->isSimulated() ? SevError : SevWarnAlways, "AuditUtilReadKeyServersReadTagError", auditServerId); + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch2(audit_storage_cancelled(), loopDepth); + #line 8663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Future grvF = tr->getReadVersion(); + #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (!grvF.isReady()) + #line 8669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevWarnAlways, "AuditUtilReadKeyServersGRVError", auditServerId); + #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return a_body1Catch2(audit_storage_cancelled(), loopDepth); + #line 8675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Version readAtVersion = grvF.get(); + #line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevVerbose, "AuditUtilGetThisServerKeysFromKeyServersReadDone", auditServerId) .detail("Range", range) .detail("ResultSize", readResult.size()) .detail("AduitServerID", auditServerId); + #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::unordered_map> serverOwnRanges; + #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for(int i = 0;i < readResult.size() - 1;++i) { + #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector src; + #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector dest; + #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID srcID; + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID destID; + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + decodeKeyServersValue(UIDtoTagMap, readResult[i].value, src, dest, srcID, destID); + #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + if (srcID == anonymousShardId) + #line 8697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + { + #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + shardsInAnonymousPhysicalShardCount++; + #line 8701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + totalShardsCount++; + #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector servers(src.size() + dest.size()); + #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::merge(src.begin(), src.end(), dest.begin(), dest.end(), servers.begin()); + #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + for( auto& ssid : servers ) { + #line 1121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + serverOwnRanges[ssid].push_back(Standalone(KeyRangeRef(readResult[i].key, readResult[i + 1].key))); + #line 8713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + } + } + #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + const KeyRange completeRange = Standalone(KeyRangeRef(range.begin, readResult.back().key)); + #line 1125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + TraceEvent(SevInfo, "AuditUtilGetThisServerKeysFromKeyServersEnd", auditServerId) .detail("Range", range) .detail("CompleteRange", completeRange) .detail("AtVersion", readAtVersion) .detail("ShardsInAnonymousPhysicalShardCount", shardsInAnonymousPhysicalShardCount) .detail("TotalShardsCount", totalShardsCount); + #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + res = AuditGetKeyServersRes(completeRange, readAtVersion, serverOwnRanges, readResult.logicalSize()); + #line 8722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + loopDepth = a_body1cont9(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetShardMapFromKeyServersActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetShardMapFromKeyServersActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getShardMapFromKeyServers", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("getShardMapFromKeyServers", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetShardMapFromKeyServersActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getShardMapFromKeyServers", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("getShardMapFromKeyServers", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetShardMapFromKeyServersActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getShardMapFromKeyServers", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("getShardMapFromKeyServers", reinterpret_cast(this), 0); + + } + int a_body1cont9(int loopDepth) + { + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + UID auditServerId; + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + Transaction* tr; + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + KeyRange range; + #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + AuditGetKeyServersRes res; + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + std::vector> actors; + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + RangeResult readResult; + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + RangeResult UIDtoTagMap; + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + int64_t totalShardsCount; + #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + int64_t shardsInAnonymousPhysicalShardCount; + #line 8821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +}; +// This generated class is to be used only via getShardMapFromKeyServers() + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +class GetShardMapFromKeyServersActor final : public Actor, public ActorCallback< GetShardMapFromKeyServersActor, 0, Void >, public FastAllocated, public GetShardMapFromKeyServersActorState { + #line 8826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetShardMapFromKeyServersActor, 0, Void >; + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + GetShardMapFromKeyServersActor(UID const& auditServerId,Transaction* const& tr,KeyRange const& range) + #line 8837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" + : Actor(), + GetShardMapFromKeyServersActorState(auditServerId, tr, range) + { + fdb_probe_actor_enter("getShardMapFromKeyServers", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getShardMapFromKeyServers"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getShardMapFromKeyServers", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetShardMapFromKeyServersActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" +[[nodiscard]] Future getShardMapFromKeyServers( UID const& auditServerId, Transaction* const& tr, KeyRange const& range ) { + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" + return Future(new GetShardMapFromKeyServersActor(auditServerId, tr, range)); + #line 8865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.g.cpp" +} + +#line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AuditUtils.actor.cpp" diff --git a/src/fdbclient/BackupAgentBase.actor.cpp b/src/fdbclient/BackupAgentBase.actor.cpp index cd6cc19..201e33b 100644 --- a/src/fdbclient/BackupAgentBase.actor.cpp +++ b/src/fdbclient/BackupAgentBase.actor.cpp @@ -22,28 +22,21 @@ #include #include "fdbclient/BackupAgent.actor.h" -#include "fdbclient/Knobs.h" +#include "fdbclient/BlobCipher.h" +#include "fdbclient/CommitProxyInterface.h" +#include "fdbclient/CommitTransaction.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/GetEncryptCipherKeys.h" +#include "fdbclient/DatabaseContext.h" +#include "fdbclient/ManagementAPI.actor.h" +#include "fdbclient/MetaclusterRegistration.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/TenantManagement.actor.h" #include "fdbrpc/simulator.h" #include "flow/ActorCollection.h" -#include "flow/actorcompiler.h" // has to be last include +#include "flow/network.h" -FDB_DEFINE_BOOLEAN_PARAM(LockDB); -FDB_DEFINE_BOOLEAN_PARAM(UnlockDB); -FDB_DEFINE_BOOLEAN_PARAM(StopWhenDone); -FDB_DEFINE_BOOLEAN_PARAM(Verbose); -FDB_DEFINE_BOOLEAN_PARAM(WaitForComplete); -FDB_DEFINE_BOOLEAN_PARAM(ForceAction); -FDB_DEFINE_BOOLEAN_PARAM(Terminator); -FDB_DEFINE_BOOLEAN_PARAM(UsePartitionedLog); -FDB_DEFINE_BOOLEAN_PARAM(InconsistentSnapshotOnly); -FDB_DEFINE_BOOLEAN_PARAM(ShowErrors); -FDB_DEFINE_BOOLEAN_PARAM(AbortOldBackup); -FDB_DEFINE_BOOLEAN_PARAM(DstOnly); -FDB_DEFINE_BOOLEAN_PARAM(WaitForDestUID); -FDB_DEFINE_BOOLEAN_PARAM(CheckBackupUID); -FDB_DEFINE_BOOLEAN_PARAM(DeleteData); -FDB_DEFINE_BOOLEAN_PARAM(SetValidation); -FDB_DEFINE_BOOLEAN_PARAM(PartialBackup); +#include "flow/actorcompiler.h" // has to be last include std::string BackupAgentBase::formatTime(int64_t epochs) { time_t curTime = (time_t)epochs; @@ -244,6 +237,34 @@ Version getLogKeyVersion(Key key) { return bigEndian64(*(int64_t*)(key.begin() + backupLogPrefixBytes + sizeof(UID) + sizeof(uint8_t))); } +bool validTenantAccess(std::map* tenantMap, + MutationRef m, + bool provisionalProxy, + Version version) { + if (isSystemKey(m.param1)) { + return true; + } + int64_t tenantId = TenantInfo::INVALID_TENANT; + if (m.isEncrypted()) { + tenantId = m.encryptDomainId(); + } else { + tenantId = TenantAPI::extractTenantIdFromMutation(m); + } + ASSERT(tenantMap != nullptr); + if (m.isEncrypted() && isReservedEncryptDomain(tenantId)) { + // These are valid encrypt domains so don't check the tenant map + } else if (tenantMap->find(tenantId) == tenantMap->end()) { + // If a tenant is not found for a given mutation then exclude it from the batch + ASSERT(!provisionalProxy); + TraceEvent(SevWarnAlways, "MutationLogRestoreTenantNotFound") + .detail("Version", version) + .detail("TenantId", tenantId); + CODE_PROBE(true, "mutation log restore tenant not found"); + return false; + } + return true; +} + // Given a key from one of the ranges returned by get_log_ranges, // returns(version, part) where version is the database version number of // the transaction log data in the value, and part is 0 for the first such @@ -254,16 +275,38 @@ std::pair decodeBKMutationLogKey(Key key) { bigEndian32(*(int32_t*)(key.begin() + backupLogPrefixBytes + sizeof(UID) + sizeof(uint8_t) + sizeof(int64_t)))); } -void decodeBackupLogValue(Arena& arena, - VectorRef& result, - int& mutationSize, - StringRef value, - StringRef addPrefix, - StringRef removePrefix, - Version version, - Reference> key_version) { +void _addResult(bool* tenantMapChanging, + VectorRef* result, + int* mutationSize, + Arena* arena, + MutationRef logValue, + KeyRangeRef tenantMapRange) { + *tenantMapChanging = *tenantMapChanging || TenantAPI::tenantMapChanging(logValue, tenantMapRange); + result->push_back_deep(*arena, logValue); + *mutationSize += logValue.expectedSize(); +} + +/* + This actor is responsible for taking an original transaction which was added to the backup mutation log (represented + by "value" parameter), breaking it up into the individual MutationRefs (that constitute the transaction), decrypting + each mutation (if needed) and adding/removing prefixes from the mutations. The final mutations are then added to the + "result" vector alongside their encrypted counterparts (which is added to the "encryptedResult" vector) +*/ +ACTOR static Future decodeBackupLogValue(Arena* arena, + VectorRef* result, + VectorRef>* encryptedResult, + int* mutationSize, + bool* tenantMapChanging, + Standalone value, + Key addPrefix, + Key removePrefix, + Version version, + Reference> key_version, + Database cx, + std::map* tenantMap, + bool provisionalProxy) { try { - uint64_t offset(0); + state uint64_t offset(0); uint64_t protocolVersion = 0; memcpy(&protocolVersion, value.begin(), sizeof(uint64_t)); offset += sizeof(uint64_t); @@ -275,36 +318,96 @@ void decodeBackupLogValue(Arena& arena, throw incompatible_protocol_version(); } - uint32_t totalBytes = 0; + state uint32_t totalBytes = 0; memcpy(&totalBytes, value.begin() + offset, sizeof(uint32_t)); offset += sizeof(uint32_t); - uint32_t consumed = 0; + state uint32_t consumed = 0; if (totalBytes + offset > value.size()) throw restore_missing_data(); - int originalOffset = offset; + state int originalOffset = offset; + state DatabaseConfiguration config = wait(getDatabaseConfiguration(cx)); + state KeyRangeRef tenantMapRange = TenantMetadata::tenantMap().subspace; while (consumed < totalBytes) { uint32_t type = 0; memcpy(&type, value.begin() + offset, sizeof(uint32_t)); offset += sizeof(uint32_t); - uint32_t len1 = 0; + state uint32_t len1 = 0; memcpy(&len1, value.begin() + offset, sizeof(uint32_t)); offset += sizeof(uint32_t); - uint32_t len2 = 0; + state uint32_t len2 = 0; memcpy(&len2, value.begin() + offset, sizeof(uint32_t)); offset += sizeof(uint32_t); ASSERT(offset + len1 + len2 <= value.size() && isValidMutationType(type)); - MutationRef logValue; - Arena tempArena; + state MutationRef logValue; + state Arena tempArena; logValue.type = type; logValue.param1 = value.substr(offset, len1); offset += len1; logValue.param2 = value.substr(offset, len2); offset += len2; + state Optional encryptedLogValue = Optional(); + ASSERT(!config.encryptionAtRestMode.isEncryptionEnabled() || logValue.isEncrypted()); + + // Check for valid tenant in required tenant mode. If the tenant does not exist in our tenant map then + // we EXCLUDE the mutation (of that respective tenant) during the restore. NOTE: This simply allows a + // restore to make progress in the event of tenant deletion, but tenant deletion should be considered + // carefully so that we do not run into this case. We do this check here so if encrypted mutations are not + // found in the tenant map then we exit early without needing to reach out to the EKP. + if (config.tenantMode == TenantMode::REQUIRED && + config.encryptionAtRestMode.mode != EncryptionAtRestMode::CLUSTER_AWARE && + !validTenantAccess(tenantMap, logValue, provisionalProxy, version)) { + consumed += BackupAgentBase::logHeaderSize + len1 + len2; + continue; + } + + // Decrypt mutation ref if encrypted + if (logValue.isEncrypted()) { + encryptedLogValue = logValue; + state EncryptCipherDomainId domainId = logValue.encryptDomainId(); + Reference const> dbInfo = cx->clientInfo; + try { + if (CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION) { + TextAndHeaderCipherKeys cipherKeys = + wait(GetEncryptCipherKeys::getEncryptCipherKeys( + dbInfo, logValue.configurableEncryptionHeader(), BlobCipherMetrics::RESTORE)); + logValue = logValue.decrypt(cipherKeys, tempArena, BlobCipherMetrics::RESTORE); + } else { + TextAndHeaderCipherKeys cipherKeys = + wait(GetEncryptCipherKeys::getEncryptCipherKeys( + dbInfo, *logValue.encryptionHeader(), BlobCipherMetrics::RESTORE)); + logValue = logValue.decrypt(cipherKeys, tempArena, BlobCipherMetrics::RESTORE); + } + } catch (Error& e) { + // It's possible a tenant was deleted and the encrypt key fetch failed + TraceEvent(SevWarnAlways, "MutationLogRestoreEncryptKeyFetchFailed") + .detail("Version", version) + .detail("TenantId", domainId); + if (e.code() == error_code_encrypt_keys_fetch_failed || + e.code() == error_code_encrypt_key_not_found) { + CODE_PROBE(true, "mutation log restore encrypt keys not found"); + consumed += BackupAgentBase::logHeaderSize + len1 + len2; + continue; + } else { + throw; + } + } + } + ASSERT(!logValue.isEncrypted()); + + // If the mutation was encrypted using cluster aware encryption then check after decryption + if (config.tenantMode == TenantMode::REQUIRED && + config.encryptionAtRestMode.mode == EncryptionAtRestMode::CLUSTER_AWARE && + !validTenantAccess(tenantMap, logValue, provisionalProxy, version)) { + consumed += BackupAgentBase::logHeaderSize + len1 + len2; + continue; + } + + MutationRef originalLogValue = logValue; if (logValue.type == MutationRef::ClearRange) { KeyRangeRef range(logValue.param1, logValue.param2); @@ -312,7 +415,7 @@ void decodeBackupLogValue(Arena& arena, for (auto r : ranges) { if (version > r.value() && r.value() != invalidVersion) { KeyRef minKey = std::min(r.range().end, range.end); - if (minKey == (removePrefix == StringRef() ? normalKeys.end : strinc(removePrefix))) { + if (minKey == (removePrefix == StringRef() ? allKeys.end : strinc(removePrefix))) { logValue.param1 = std::max(r.range().begin, range.begin); if (removePrefix.size()) { logValue.param1 = logValue.param1.removePrefix(removePrefix); @@ -320,9 +423,8 @@ void decodeBackupLogValue(Arena& arena, if (addPrefix.size()) { logValue.param1 = logValue.param1.withPrefix(addPrefix, tempArena); } - logValue.param2 = addPrefix == StringRef() ? normalKeys.end : strinc(addPrefix, tempArena); - result.push_back_deep(arena, logValue); - mutationSize += logValue.expectedSize(); + logValue.param2 = addPrefix == StringRef() ? allKeys.end : strinc(addPrefix, tempArena); + _addResult(tenantMapChanging, result, mutationSize, arena, logValue, tenantMapRange); } else { logValue.param1 = std::max(r.range().begin, range.begin); logValue.param2 = minKey; @@ -334,8 +436,12 @@ void decodeBackupLogValue(Arena& arena, logValue.param1 = logValue.param1.withPrefix(addPrefix, tempArena); logValue.param2 = logValue.param2.withPrefix(addPrefix, tempArena); } - result.push_back_deep(arena, logValue); - mutationSize += logValue.expectedSize(); + _addResult(tenantMapChanging, result, mutationSize, arena, logValue, tenantMapRange); + } + if (originalLogValue.param1 == logValue.param1 && originalLogValue.param2 == logValue.param2) { + encryptedResult->push_back_deep(*arena, encryptedLogValue); + } else { + encryptedResult->push_back_deep(*arena, Optional()); } } } @@ -349,8 +455,14 @@ void decodeBackupLogValue(Arena& arena, if (addPrefix.size()) { logValue.param1 = logValue.param1.withPrefix(addPrefix, tempArena); } - result.push_back_deep(arena, logValue); - mutationSize += logValue.expectedSize(); + _addResult(tenantMapChanging, result, mutationSize, arena, logValue, tenantMapRange); + // If we did not remove/add prefixes to the mutation then keep the original encrypted mutation so we + // do not have to re-encrypt unnecessarily + if (originalLogValue.param1 == logValue.param1 && originalLogValue.param2 == logValue.param2) { + encryptedResult->push_back_deep(*arena, encryptedLogValue); + } else { + encryptedResult->push_back_deep(*arena, Optional()); + } } } @@ -375,6 +487,7 @@ void decodeBackupLogValue(Arena& arena, .detail("Value", value); throw; } + return Void(); } static double lastErrorTime = 0; @@ -415,7 +528,7 @@ ACTOR Future readCommitted(Database cx, loop { try { state GetRangeLimits limits(GetRangeLimits::ROW_LIMIT_UNLIMITED, - (g_network->isSimulated() && !g_simulator.speedUpSimulation) + (g_network->isSimulated() && !g_simulator->speedUpSimulation) ? CLIENT_KNOBS->BACKUP_SIMULATED_LIMIT_BYTES : CLIENT_KNOBS->BACKUP_GET_RANGE_LIMIT_BYTES); @@ -494,7 +607,7 @@ ACTOR Future readCommitted(Database cx, loop { try { state GetRangeLimits limits(GetRangeLimits::ROW_LIMIT_UNLIMITED, - (g_network->isSimulated() && !g_simulator.speedUpSimulation) + (g_network->isSimulated() && !g_simulator->speedUpSimulation) ? CLIENT_KNOBS->BACKUP_SIMULATED_LIMIT_BYTES : CLIENT_KNOBS->BACKUP_GET_RANGE_LIMIT_BYTES); @@ -593,19 +706,56 @@ Future readCommitted(Database cx, cx, results, Void(), lock, range, groupBy, Terminator::True, AccessSystemKeys::True, LockAware::True); } -ACTOR Future dumpData(Database cx, - PromiseStream results, - Reference lock, - Key uid, - Key addPrefix, - Key removePrefix, - RequestStream commit, - NotifiedVersion* committedVersion, - Optional endVersion, - Key rangeBegin, - PromiseStream> addActor, - FlowLock* commitLock, - Reference> keyVersion) { +ACTOR Future sendCommitTransactionRequest(CommitTransactionRequest req, + Key uid, + Version newBeginVersion, + Key rangeBegin, + NotifiedVersion* committedVersion, + int* totalBytes, + int* mutationSize, + PromiseStream> addActor, + FlowLock* commitLock, + PublicRequestStream commit) { + Key applyBegin = uid.withPrefix(applyMutationsBeginRange.begin); + Key versionKey = BinaryWriter::toValue(newBeginVersion, Unversioned()); + Key rangeEnd = getApplyKey(newBeginVersion, uid); + + // mutations and encrypted mutations (and their relationship) is described in greater detail in the defenition of + // CommitTransactionRef in CommitTransaction.h + req.transaction.mutations.push_back_deep(req.arena, MutationRef(MutationRef::SetValue, applyBegin, versionKey)); + req.transaction.encryptedMutations.push_back_deep(req.arena, Optional()); + req.transaction.write_conflict_ranges.push_back_deep(req.arena, singleKeyRange(applyBegin)); + req.transaction.mutations.push_back_deep(req.arena, MutationRef(MutationRef::ClearRange, rangeBegin, rangeEnd)); + req.transaction.encryptedMutations.push_back_deep(req.arena, Optional()); + req.transaction.write_conflict_ranges.push_back_deep(req.arena, singleKeyRange(rangeBegin)); + + // The commit request contains no read conflict ranges, so regardless of what read version we + // choose, it's impossible for us to get a transaction_too_old error back, and it's impossible + // for our transaction to be aborted due to conflicts. + req.transaction.read_snapshot = committedVersion->get(); + req.flags = req.flags | CommitTransactionRequest::FLAG_IS_LOCK_AWARE; + + *totalBytes += *mutationSize; + wait(commitLock->take(TaskPriority::DefaultYield, *mutationSize)); + addActor.send(commitLock->releaseWhen(success(commit.getReply(req)), *mutationSize)); + return Void(); +} + +ACTOR Future kvMutationLogToTransactions(Database cx, + PromiseStream results, + Reference lock, + Key uid, + Key addPrefix, + Key removePrefix, + PublicRequestStream commit, + NotifiedVersion* committedVersion, + Optional endVersion, + Key rangeBegin, + PromiseStream> addActor, + FlowLock* commitLock, + Reference> keyVersion, + std::map* tenantMap, + bool provisionalProxy) { state Version lastVersion = invalidVersion; state bool endOfStream = false; state int totalBytes = 0; @@ -613,25 +763,76 @@ ACTOR Future dumpData(Database cx, state CommitTransactionRequest req; state Version newBeginVersion = invalidVersion; state int mutationSize = 0; + state bool tenantMapChanging = false; loop { try { - RCGroup group = waitNext(results.getFuture()); + state RCGroup group = waitNext(results.getFuture()); + state CommitTransactionRequest curReq; lock->release(group.items.expectedSize()); + state int curBatchMutationSize = 0; + tenantMapChanging = false; BinaryWriter bw(Unversioned()); for (int i = 0; i < group.items.size(); ++i) { bw.serializeBytes(group.items[i].value); } - decodeBackupLogValue(req.arena, - req.transaction.mutations, - mutationSize, - bw.toValue(), - addPrefix, - removePrefix, - group.groupKey, - keyVersion); + // Parse a single transaction from the backup mutation log + Standalone value = bw.toValue(); + wait(decodeBackupLogValue(&curReq.arena, + &curReq.transaction.mutations, + &curReq.transaction.encryptedMutations, + &curBatchMutationSize, + &tenantMapChanging, + value, + addPrefix, + removePrefix, + group.groupKey, + keyVersion, + cx, + tenantMap, + provisionalProxy)); + + // A single call to decodeBackupLogValue (above) will only parse mutations from a single transaction, + // however in the code below we batch the results across several calls to decodeBackupLogValue and send + // it in one big CommitTransactionRequest (so one CTR contains mutations from multiple transactions). + // Generally, this would be fine since the mutations in the log are ordered (and thus so are the results + // after calling decodeBackupLogValue). However in the CommitProxy we do not allow mutations which + // change the tenant map to appear alongside regular normalKey mutations in a single + // CommitTransactionRequest. Thus the code below will immediately send any mutations accumulated thus + // far if the latest call to decodeBackupLogValue contained a transaction which changed the tenant map + // (before processing the mutations which caused the tenant map to change). + if (tenantMapChanging && req.transaction.mutations.size()) { + // If the tenantMap is changing send the previous CommitTransactionRequest to the CommitProxy + TraceEvent("MutationLogRestoreTenantMapChanging").detail("BeginVersion", newBeginVersion); + CODE_PROBE(true, "mutation log tenant map changing"); + wait(sendCommitTransactionRequest(req, + uid, + newBeginVersion, + rangeBegin, + committedVersion, + &totalBytes, + &mutationSize, + addActor, + commitLock, + commit)); + req = CommitTransactionRequest(); + mutationSize = 0; + } + + state int i; + for (i = 0; i < curReq.transaction.mutations.size(); i++) { + req.transaction.mutations.push_back_deep(req.arena, curReq.transaction.mutations[i]); + req.transaction.encryptedMutations.push_back_deep(req.arena, + curReq.transaction.encryptedMutations[i]); + } + mutationSize += curBatchMutationSize; newBeginVersion = group.groupKey + 1; - if (mutationSize >= CLIENT_KNOBS->BACKUP_LOG_WRITE_BATCH_MAX_SIZE) { + + // At this point if the tenant map changed we would have already sent any normalKey mutations + // accumulated thus far, so all thats left to do is to send all the mutations in the the offending + // transaction that changed the tenant map. This is necessary so that we don't batch these tenant map + // mutations with future normalKey mutations (which will result in the same problem discussed above). + if (tenantMapChanging || mutationSize >= CLIENT_KNOBS->BACKUP_LOG_WRITE_BATCH_MAX_SIZE) { break; } } catch (Error& e) { @@ -647,26 +848,16 @@ ACTOR Future dumpData(Database cx, throw; } } - - Key applyBegin = uid.withPrefix(applyMutationsBeginRange.begin); - Key versionKey = BinaryWriter::toValue(newBeginVersion, Unversioned()); - Key rangeEnd = getApplyKey(newBeginVersion, uid); - - req.transaction.mutations.push_back_deep(req.arena, MutationRef(MutationRef::SetValue, applyBegin, versionKey)); - req.transaction.write_conflict_ranges.push_back_deep(req.arena, singleKeyRange(applyBegin)); - req.transaction.mutations.push_back_deep(req.arena, MutationRef(MutationRef::ClearRange, rangeBegin, rangeEnd)); - req.transaction.write_conflict_ranges.push_back_deep(req.arena, singleKeyRange(rangeBegin)); - - // The commit request contains no read conflict ranges, so regardless of what read version we - // choose, it's impossible for us to get a transaction_too_old error back, and it's impossible - // for our transaction to be aborted due to conflicts. - req.transaction.read_snapshot = committedVersion->get(); - req.flags = req.flags | CommitTransactionRequest::FLAG_IS_LOCK_AWARE; - - totalBytes += mutationSize; - wait(commitLock->take(TaskPriority::DefaultYield, mutationSize)); - addActor.send(commitLock->releaseWhen(success(commit.getReply(req)), mutationSize)); - + wait(sendCommitTransactionRequest(req, + uid, + newBeginVersion, + rangeBegin, + committedVersion, + &totalBytes, + &mutationSize, + addActor, + commitLock, + commit)); if (endOfStream) { return totalBytes; } @@ -676,7 +867,7 @@ ACTOR Future dumpData(Database cx, ACTOR Future coalesceKeyVersionCache(Key uid, Version endVersion, Reference> keyVersion, - RequestStream commit, + PublicRequestStream commit, NotifiedVersion* committedVersion, PromiseStream> addActor, FlowLock* commitLock) { @@ -726,9 +917,11 @@ ACTOR Future applyMutations(Database cx, Key removePrefix, Version beginVersion, Version* endVersion, - RequestStream commit, + PublicRequestStream commit, NotifiedVersion* committedVersion, - Reference> keyVersion) { + Reference> keyVersion, + std::map* tenantMap, + bool provisionalProxy) { state FlowLock commitLock(CLIENT_KNOBS->BACKUP_LOCK_BYTES); state PromiseStream> addActor; state Future error = actorCollection(addActor.getFuture()); @@ -765,19 +958,22 @@ ACTOR Future applyMutations(Database cx, maxBytes = std::max(maxBytes * CLIENT_KNOBS->APPLY_MAX_DECAY_RATE, CLIENT_KNOBS->APPLY_MIN_LOCK_BYTES); for (idx = 0; idx < ranges.size(); ++idx) { - int bytes = wait(dumpData(cx, - results[idx], - locks[idx], - uid, - addPrefix, - removePrefix, - commit, - committedVersion, - idx == ranges.size() - 1 ? newEndVersion : Optional(), - ranges[idx].begin, - addActor, - &commitLock, - keyVersion)); + int bytes = + wait(kvMutationLogToTransactions(cx, + results[idx], + locks[idx], + uid, + addPrefix, + removePrefix, + commit, + committedVersion, + idx == ranges.size() - 1 ? newEndVersion : Optional(), + ranges[idx].begin, + addActor, + &commitLock, + keyVersion, + tenantMap, + provisionalProxy)); maxBytes = std::max(CLIENT_KNOBS->APPLY_MAX_INCREASE_FACTOR * bytes, maxBytes); if (error.isError()) throw error.getError(); @@ -890,31 +1086,14 @@ ACTOR static Future _eraseLogData(Reference tr, uint64_t ev = bigEndian64(nextSmallestVersion); uint8_t h1 = h; Key vblockPrefix = StringRef(&h1, sizeof(uint8_t)).withPrefix(baLogRangePrefix); - KeyRange range = KeyRangeRef(StringRef((uint8_t*)&bv, sizeof(uint64_t)).withPrefix(vblockPrefix), - StringRef((uint8_t*)&ev, sizeof(uint64_t)).withPrefix(vblockPrefix)); - tr->clear(range); - if (CLIENT_KNOBS->BACKUP_AGENT_VERBOSE_LOGGING) { - TraceEvent("EraseLogDataClearLogRanges") - .detail("Range", range) - .detail("Begin", 0) - .detail("End", nextSmallestVersion) - .detail("HexRangeBegin", range.begin.toHex()) - .detail("HexRangeEnd", range.end.toHex()); - } + tr->clear(KeyRangeRef(StringRef((uint8_t*)&bv, sizeof(uint64_t)).withPrefix(vblockPrefix), + StringRef((uint8_t*)&ev, sizeof(uint64_t)).withPrefix(vblockPrefix))); } } else { Standalone> ranges = getLogRanges(currBeginVersion, nextSmallestVersion, destUidValue); for (auto& range : ranges) { tr->clear(range); - if (CLIENT_KNOBS->BACKUP_AGENT_VERBOSE_LOGGING) { - TraceEvent("EraseLogDataClearLogRanges") - .detail("Range", range) - .detail("Begin", currBeginVersion) - .detail("End", nextSmallestVersion) - .detail("HexRangeBegin", range.begin.toHex()) - .detail("HexRangeEnd", range.end.toHex()); - } } } } @@ -986,10 +1165,9 @@ ACTOR Future cleanupLogMutations(Database cx, Value destUidValue, bool del .get(BackupAgentBase::keySourceStates) .get(currLogUid) .pack(DatabaseBackupAgent::keyStateStatus)); - state Future> foundBackupKey = - tr->get(Subspace(currLogUid.withPrefix(LiteralStringRef("uid->config/")) - .withPrefix(fileBackupPrefixRange.begin)) - .pack(LiteralStringRef("stateEnum"))); + state Future> foundBackupKey = tr->get( + Subspace(currLogUid.withPrefix("uid->config/"_sr).withPrefix(fileBackupPrefixRange.begin)) + .pack("stateEnum"_sr)); wait(success(foundDRKey) && success(foundBackupKey)); if (foundDRKey.get().present() && foundBackupKey.get().present()) { @@ -1183,3 +1361,40 @@ Standalone BackupAgentBase::getCurrentTime() { } std::string const BackupAgentBase::defaultTagName = "default"; + +void addDefaultBackupRanges(Standalone>& backupKeys) { + backupKeys.push_back_deep(backupKeys.arena(), normalKeys); + + for (auto& r : getSystemBackupRanges()) { + backupKeys.push_back_deep(backupKeys.arena(), r); + } +} + +VectorRef const& getSystemBackupRanges() { + static Standalone> systemBackupRanges; + if (systemBackupRanges.empty()) { + systemBackupRanges.push_back_deep(systemBackupRanges.arena(), prefixRange(TenantMetadata::subspace())); + systemBackupRanges.push_back_deep(systemBackupRanges.arena(), + singleKeyRange(metacluster::metadata::metaclusterRegistration().key)); + systemBackupRanges.push_back_deep(systemBackupRanges.arena(), tagQuotaKeys); + systemBackupRanges.push_back_deep(systemBackupRanges.arena(), blobRangeKeys); + } + + return systemBackupRanges; +} + +KeyRangeMap const& systemBackupMutationMask() { + static KeyRangeMap mask; + if (mask.size() == 1) { + for (auto r : getSystemBackupRanges()) { + mask.insert(r, true); + } + } + + return mask; +} + +KeyRangeRef const& getDefaultBackupSharedRange() { + static KeyRangeRef defaultSharedRange(""_sr, ""_sr); + return defaultSharedRange; +} diff --git a/src/fdbclient/BackupAgentBase.actor.g.cpp b/src/fdbclient/BackupAgentBase.actor.g.cpp index 4c3c719..4e785c7 100644 --- a/src/fdbclient/BackupAgentBase.actor.g.cpp +++ b/src/fdbclient/BackupAgentBase.actor.g.cpp @@ -24,28 +24,21 @@ #include #include "fdbclient/BackupAgent.actor.h" -#include "fdbclient/Knobs.h" +#include "fdbclient/BlobCipher.h" +#include "fdbclient/CommitProxyInterface.h" +#include "fdbclient/CommitTransaction.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/GetEncryptCipherKeys.h" +#include "fdbclient/DatabaseContext.h" +#include "fdbclient/ManagementAPI.actor.h" +#include "fdbclient/MetaclusterRegistration.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/TenantManagement.actor.h" #include "fdbrpc/simulator.h" #include "flow/ActorCollection.h" -#include "flow/actorcompiler.h" // has to be last include +#include "flow/network.h" -FDB_DEFINE_BOOLEAN_PARAM(LockDB); -FDB_DEFINE_BOOLEAN_PARAM(UnlockDB); -FDB_DEFINE_BOOLEAN_PARAM(StopWhenDone); -FDB_DEFINE_BOOLEAN_PARAM(Verbose); -FDB_DEFINE_BOOLEAN_PARAM(WaitForComplete); -FDB_DEFINE_BOOLEAN_PARAM(ForceAction); -FDB_DEFINE_BOOLEAN_PARAM(Terminator); -FDB_DEFINE_BOOLEAN_PARAM(UsePartitionedLog); -FDB_DEFINE_BOOLEAN_PARAM(InconsistentSnapshotOnly); -FDB_DEFINE_BOOLEAN_PARAM(ShowErrors); -FDB_DEFINE_BOOLEAN_PARAM(AbortOldBackup); -FDB_DEFINE_BOOLEAN_PARAM(DstOnly); -FDB_DEFINE_BOOLEAN_PARAM(WaitForDestUID); -FDB_DEFINE_BOOLEAN_PARAM(CheckBackupUID); -FDB_DEFINE_BOOLEAN_PARAM(DeleteData); -FDB_DEFINE_BOOLEAN_PARAM(SetValidation); -FDB_DEFINE_BOOLEAN_PARAM(PartialBackup); +#include "flow/actorcompiler.h" // has to be last include std::string BackupAgentBase::formatTime(int64_t epochs) { time_t curTime = (time_t)epochs; @@ -203,182 +196,971 @@ Standalone> getApplyRanges(Version beginVersion, Version //TraceEvent("GetLogRanges").detail("BackupUid", backupUid).detail("Prefix", baLogRangePrefix); - for (int64_t vblock = beginVersion / CLIENT_KNOBS->APPLY_BLOCK_SIZE; - vblock < (endVersion + CLIENT_KNOBS->APPLY_BLOCK_SIZE - 1) / CLIENT_KNOBS->APPLY_BLOCK_SIZE; - ++vblock) { - int64_t tb = vblock * CLIENT_KNOBS->APPLY_BLOCK_SIZE / CLIENT_KNOBS->LOG_RANGE_BLOCK_SIZE; - uint64_t bv = bigEndian64(std::max(beginVersion, vblock * CLIENT_KNOBS->APPLY_BLOCK_SIZE)); - uint64_t ev = bigEndian64(std::min(endVersion, (vblock + 1) * CLIENT_KNOBS->APPLY_BLOCK_SIZE)); - uint32_t data = tb & 0xffffffff; - uint8_t hash = (uint8_t)hashlittle(&data, sizeof(uint32_t), 0); + for (int64_t vblock = beginVersion / CLIENT_KNOBS->APPLY_BLOCK_SIZE; + vblock < (endVersion + CLIENT_KNOBS->APPLY_BLOCK_SIZE - 1) / CLIENT_KNOBS->APPLY_BLOCK_SIZE; + ++vblock) { + int64_t tb = vblock * CLIENT_KNOBS->APPLY_BLOCK_SIZE / CLIENT_KNOBS->LOG_RANGE_BLOCK_SIZE; + uint64_t bv = bigEndian64(std::max(beginVersion, vblock * CLIENT_KNOBS->APPLY_BLOCK_SIZE)); + uint64_t ev = bigEndian64(std::min(endVersion, (vblock + 1) * CLIENT_KNOBS->APPLY_BLOCK_SIZE)); + uint32_t data = tb & 0xffffffff; + uint8_t hash = (uint8_t)hashlittle(&data, sizeof(uint32_t), 0); + + Key vblockPrefix = StringRef(&hash, sizeof(uint8_t)).withPrefix(baLogRangePrefix); + + ret.push_back_deep(ret.arena(), + KeyRangeRef(StringRef((uint8_t*)&bv, sizeof(uint64_t)).withPrefix(vblockPrefix), + StringRef((uint8_t*)&ev, sizeof(uint64_t)).withPrefix(vblockPrefix))); + } + + return ret; +} + +Key getApplyKey(Version version, Key backupUid) { + int64_t vblock = (version - 1) / CLIENT_KNOBS->LOG_RANGE_BLOCK_SIZE; + uint64_t v = bigEndian64(version); + uint32_t data = vblock & 0xffffffff; + uint8_t hash = (uint8_t)hashlittle(&data, sizeof(uint32_t), 0); + Key k1 = StringRef((uint8_t*)&v, sizeof(uint64_t)).withPrefix(StringRef(&hash, sizeof(uint8_t))); + Key k2 = k1.withPrefix(backupUid); + return k2.withPrefix(applyLogKeys.begin); +} + +Key getLogKey(Version version, Key backupUid) { + int64_t vblock = (version - 1) / CLIENT_KNOBS->LOG_RANGE_BLOCK_SIZE; + uint64_t v = bigEndian64(version); + uint32_t data = vblock & 0xffffffff; + uint8_t hash = (uint8_t)hashlittle(&data, sizeof(uint32_t), 0); + Key k1 = StringRef((uint8_t*)&v, sizeof(uint64_t)).withPrefix(StringRef(&hash, sizeof(uint8_t))); + Key k2 = k1.withPrefix(backupUid); + return k2.withPrefix(backupLogKeys.begin); +} + +Version getLogKeyVersion(Key key) { + return bigEndian64(*(int64_t*)(key.begin() + backupLogPrefixBytes + sizeof(UID) + sizeof(uint8_t))); +} + +bool validTenantAccess(std::map* tenantMap, + MutationRef m, + bool provisionalProxy, + Version version) { + if (isSystemKey(m.param1)) { + return true; + } + int64_t tenantId = TenantInfo::INVALID_TENANT; + if (m.isEncrypted()) { + tenantId = m.encryptDomainId(); + } else { + tenantId = TenantAPI::extractTenantIdFromMutation(m); + } + ASSERT(tenantMap != nullptr); + if (m.isEncrypted() && isReservedEncryptDomain(tenantId)) { + // These are valid encrypt domains so don't check the tenant map + } else if (tenantMap->find(tenantId) == tenantMap->end()) { + // If a tenant is not found for a given mutation then exclude it from the batch + ASSERT(!provisionalProxy); + TraceEvent(SevWarnAlways, "MutationLogRestoreTenantNotFound") + .detail("Version", version) + .detail("TenantId", tenantId); + CODE_PROBE(true, "mutation log restore tenant not found"); + return false; + } + return true; +} + +// Given a key from one of the ranges returned by get_log_ranges, +// returns(version, part) where version is the database version number of +// the transaction log data in the value, and part is 0 for the first such +// data for a given version, 1 for the second block of data, etc. +std::pair decodeBKMutationLogKey(Key key) { + return std::make_pair( + getLogKeyVersion(key), + bigEndian32(*(int32_t*)(key.begin() + backupLogPrefixBytes + sizeof(UID) + sizeof(uint8_t) + sizeof(int64_t)))); +} + +void _addResult(bool* tenantMapChanging, + VectorRef* result, + int* mutationSize, + Arena* arena, + MutationRef logValue, + KeyRangeRef tenantMapRange) { + *tenantMapChanging = *tenantMapChanging || TenantAPI::tenantMapChanging(logValue, tenantMapRange); + result->push_back_deep(*arena, logValue); + *mutationSize += logValue.expectedSize(); +} + +/* + This actor is responsible for taking an original transaction which was added to the backup mutation log (represented + by "value" parameter), breaking it up into the individual MutationRefs (that constitute the transaction), decrypting + each mutation (if needed) and adding/removing prefixes from the mutations. The final mutations are then added to the + "result" vector alongside their encrypted counterparts (which is added to the "encryptedResult" vector) +*/ + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" +namespace { +// This generated class is to be used only via decodeBackupLogValue() + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +template + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +class DecodeBackupLogValueActorState { + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" +public: + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + DecodeBackupLogValueActorState(Arena* const& arena,VectorRef* const& result,VectorRef>* const& encryptedResult,int* const& mutationSize,bool* const& tenantMapChanging,Standalone const& value,Key const& addPrefix,Key const& removePrefix,Version const& version,Reference> const& key_version,Database const& cx,std::map* const& tenantMap,bool const& provisionalProxy) + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + : arena(arena), + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + result(result), + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + encryptedResult(encryptedResult), + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + mutationSize(mutationSize), + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + tenantMapChanging(tenantMapChanging), + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + value(value), + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + addPrefix(addPrefix), + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + removePrefix(removePrefix), + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + version(version), + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + key_version(key_version), + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + cx(cx), + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + tenantMap(tenantMap), + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + provisionalProxy(provisionalProxy) + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + fdb_probe_actor_create("decodeBackupLogValue", reinterpret_cast(this)); + + } + ~DecodeBackupLogValueActorState() + { + fdb_probe_actor_destroy("decodeBackupLogValue", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + try { + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + offset = uint64_t(0); + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + uint64_t protocolVersion = 0; + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + memcpy(&protocolVersion, value.begin(), sizeof(uint64_t)); + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + offset += sizeof(uint64_t); + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (protocolVersion <= 0x0FDB00A200090001) + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + TraceEvent(SevError, "DecodeBackupLogValue") .detail("IncompatibleProtocolVersion", protocolVersion) .detail("ValueSize", value.size()) .detail("Value", value); + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + return a_body1Catch2(incompatible_protocol_version(), loopDepth); + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + totalBytes = 0; + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + memcpy(&totalBytes, value.begin() + offset, sizeof(uint32_t)); + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + offset += sizeof(uint32_t); + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + consumed = 0; + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (totalBytes + offset > value.size()) + #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + return a_body1Catch2(restore_missing_data(), loopDepth); + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + originalOffset = offset; + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + StrictFuture __when_expr_0 = getDatabaseConfiguration(cx); + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~DecodeBackupLogValueActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DecodeBackupLogValueActorState(); static_cast(this)->destroy(); return 0; } + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DecodeBackupLogValueActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + TraceEvent(e.code() == error_code_restore_missing_data ? SevWarn : SevError, "BA_DecodeBackupLogValue") .error(e) .GetLastError() .detail("ValueSize", value.size()) .detail("Value", value); + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2(int loopDepth) + { + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + tenantMapRange = TenantMetadata::tenantMap().subspace; + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + ; + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = a_body1cont2loopHead1(loopDepth); + + return loopDepth; + } + int a_body1when1(DatabaseConfiguration const& __config,int loopDepth) + { + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + config = __config; + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1when1(DatabaseConfiguration && __config,int loopDepth) + { + config = std::move(__config); + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeBackupLogValueActor, 0, DatabaseConfiguration >::remove(); + + } + void a_callback_fire(ActorCallback< DecodeBackupLogValueActor, 0, DatabaseConfiguration >*,DatabaseConfiguration const& value) + { + fdb_probe_actor_enter("decodeBackupLogValue", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("decodeBackupLogValue", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< DecodeBackupLogValueActor, 0, DatabaseConfiguration >*,DatabaseConfiguration && value) + { + fdb_probe_actor_enter("decodeBackupLogValue", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("decodeBackupLogValue", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< DecodeBackupLogValueActor, 0, DatabaseConfiguration >*,Error err) + { + fdb_probe_actor_enter("decodeBackupLogValue", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("decodeBackupLogValue", reinterpret_cast(this), 0); + + } + int a_body1cont5(int loopDepth) + { + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + ASSERT(consumed == totalBytes); + #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (value.size() != offset) + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + TraceEvent(SevError, "BA_DecodeBackupLogValue") .detail("UnexpectedExtraDataSize", value.size()) .detail("Offset", offset) .detail("TotalBytes", totalBytes) .detail("Consumed", consumed) .detail("OriginalOffset", originalOffset); + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + return a_body1Catch2(restore_corrupted_data(), loopDepth); + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + loopDepth = a_body1cont8(loopDepth); + + return loopDepth; + } + int a_body1cont2loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont2loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1(int loopDepth) + { + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (!(consumed < totalBytes)) + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break + } + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + uint32_t type = 0; + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + memcpy(&type, value.begin() + offset, sizeof(uint32_t)); + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + offset += sizeof(uint32_t); + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + len1 = 0; + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + memcpy(&len1, value.begin() + offset, sizeof(uint32_t)); + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + offset += sizeof(uint32_t); + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + len2 = 0; + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + memcpy(&len2, value.begin() + offset, sizeof(uint32_t)); + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + offset += sizeof(uint32_t); + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + ASSERT(offset + len1 + len2 <= value.size() && isValidMutationType(type)); + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue = MutationRef(); + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + tempArena = Arena(); + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.type = type; + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.param1 = value.substr(offset, len1); + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + offset += len1; + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.param2 = value.substr(offset, len2); + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + offset += len2; + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + encryptedLogValue = Optional(); + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + ASSERT(!config.encryptionAtRestMode.isEncryptionEnabled() || logValue.isEncrypted()); + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (config.tenantMode == TenantMode::REQUIRED && config.encryptionAtRestMode.mode != EncryptionAtRestMode::CLUSTER_AWARE && !validTenantAccess(tenantMap, logValue, provisionalProxy, version)) + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + consumed += BackupAgentBase::logHeaderSize + len1 + len2; + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + return a_body1cont2loopHead1(loopDepth); // continue + } + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (logValue.isEncrypted()) + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + encryptedLogValue = logValue; + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + domainId = logValue.encryptDomainId(); + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Reference const> dbInfo = cx->clientInfo; + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + try { + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION) + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + StrictFuture __when_expr_1 = GetEncryptCipherKeys::getEncryptCipherKeys( dbInfo, logValue.configurableEncryptionHeader(), BlobCipherMetrics::RESTORE); + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont2loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + StrictFuture __when_expr_2 = GetEncryptCipherKeys::getEncryptCipherKeys( dbInfo, *logValue.encryptionHeader(), BlobCipherMetrics::RESTORE); + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont2loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2loopBody1when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = 0; + } + } + catch (Error& error) { + loopDepth = a_body1cont2loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont2loopBody1Catch1(unknown_error(), loopDepth); + } + } + else + { + loopDepth = a_body1cont2loopBody1cont1(loopDepth); + } + + return loopDepth; + } + int a_body1cont2break1(int loopDepth) + { + try { + return a_body1cont5(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2loopBody1cont1(int loopDepth) + { + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + ASSERT(!logValue.isEncrypted()); + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (config.tenantMode == TenantMode::REQUIRED && config.encryptionAtRestMode.mode == EncryptionAtRestMode::CLUSTER_AWARE && !validTenantAccess(tenantMap, logValue, provisionalProxy, version)) + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + consumed += BackupAgentBase::logHeaderSize + len1 + len2; + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + return a_body1cont2loopHead1(loopDepth); // continue + } + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + MutationRef originalLogValue = logValue; + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (logValue.type == MutationRef::ClearRange) + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + KeyRangeRef range(logValue.param1, logValue.param2); + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + auto ranges = key_version->intersectingRanges(range); + #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + for( auto r : ranges ) { + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (version > r.value() && r.value() != invalidVersion) + #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + KeyRef minKey = std::min(r.range().end, range.end); + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (minKey == (removePrefix == StringRef() ? allKeys.end : strinc(removePrefix))) + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.param1 = std::max(r.range().begin, range.begin); + #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (removePrefix.size()) + #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.param1 = logValue.param1.removePrefix(removePrefix); + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (addPrefix.size()) + #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.param1 = logValue.param1.withPrefix(addPrefix, tempArena); + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.param2 = addPrefix == StringRef() ? allKeys.end : strinc(addPrefix, tempArena); + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + _addResult(tenantMapChanging, result, mutationSize, arena, logValue, tenantMapRange); + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + else + { + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.param1 = std::max(r.range().begin, range.begin); + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.param2 = minKey; + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (removePrefix.size()) + #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.param1 = logValue.param1.removePrefix(removePrefix); + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.param2 = logValue.param2.removePrefix(removePrefix); + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (addPrefix.size()) + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.param1 = logValue.param1.withPrefix(addPrefix, tempArena); + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.param2 = logValue.param2.withPrefix(addPrefix, tempArena); + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + _addResult(tenantMapChanging, result, mutationSize, arena, logValue, tenantMapRange); + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (originalLogValue.param1 == logValue.param1 && originalLogValue.param2 == logValue.param2) + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + encryptedResult->push_back_deep(*arena, encryptedLogValue); + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + else + { + #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + encryptedResult->push_back_deep(*arena, Optional()); + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + } + } + } + else + { + #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Version ver = key_version->rangeContaining(logValue.param1).value(); + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (version > ver && ver != invalidVersion) + #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (removePrefix.size()) + #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.param1 = logValue.param1.removePrefix(removePrefix); + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (addPrefix.size()) + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue.param1 = logValue.param1.withPrefix(addPrefix, tempArena); + #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + _addResult(tenantMapChanging, result, mutationSize, arena, logValue, tenantMapRange); + #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (originalLogValue.param1 == logValue.param1 && originalLogValue.param2 == logValue.param2) + #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + encryptedResult->push_back_deep(*arena, encryptedLogValue); + #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + else + { + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + encryptedResult->push_back_deep(*arena, Optional()); + #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + } + } + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + consumed += BackupAgentBase::logHeaderSize + len1 + len2; + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + if (loopDepth == 0) return a_body1cont2loopHead1(0); + + return loopDepth; + } + int a_body1cont2loopBody1cont4(int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + TraceEvent(SevWarnAlways, "MutationLogRestoreEncryptKeyFetchFailed") .detail("Version", version) .detail("TenantId", domainId); + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (e.code() == error_code_encrypt_keys_fetch_failed || e.code() == error_code_encrypt_key_not_found) + #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + CODE_PROBE(true, "mutation log restore encrypt keys not found"); + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + consumed += BackupAgentBase::logHeaderSize + len1 + len2; + #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + return a_body1cont2loopHead1(loopDepth); // continue + } + else + { + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + return a_body1Catch2(e, std::max(0, loopDepth - 1)); + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont2loopBody1cont5(int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont10(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1cont6(TextAndHeaderCipherKeys const& cipherKeys,int loopDepth) + { + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue = logValue.decrypt(cipherKeys, tempArena, BlobCipherMetrics::RESTORE); + #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = a_body1cont2loopBody1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1cont6(TextAndHeaderCipherKeys && cipherKeys,int loopDepth) + { + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue = logValue.decrypt(cipherKeys, tempArena, BlobCipherMetrics::RESTORE); + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = a_body1cont2loopBody1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1when1(TextAndHeaderCipherKeys const& cipherKeys,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont6(cipherKeys, loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1when1(TextAndHeaderCipherKeys && cipherKeys,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont6(std::move(cipherKeys), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeBackupLogValueActor, 1, TextAndHeaderCipherKeys >::remove(); + + } + void a_callback_fire(ActorCallback< DecodeBackupLogValueActor, 1, TextAndHeaderCipherKeys >*,TextAndHeaderCipherKeys const& value) + { + fdb_probe_actor_enter("decodeBackupLogValue", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont2loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("decodeBackupLogValue", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< DecodeBackupLogValueActor, 1, TextAndHeaderCipherKeys >*,TextAndHeaderCipherKeys && value) + { + fdb_probe_actor_enter("decodeBackupLogValue", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont2loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("decodeBackupLogValue", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< DecodeBackupLogValueActor, 1, TextAndHeaderCipherKeys >*,Error err) + { + fdb_probe_actor_enter("decodeBackupLogValue", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont2loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("decodeBackupLogValue", reinterpret_cast(this), 1); + + } + int a_body1cont2loopBody1cont8(TextAndHeaderCipherKeys const& cipherKeys,int loopDepth) + { + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue = logValue.decrypt(cipherKeys, tempArena, BlobCipherMetrics::RESTORE); + #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = a_body1cont2loopBody1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1cont8(TextAndHeaderCipherKeys && cipherKeys,int loopDepth) + { + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + logValue = logValue.decrypt(cipherKeys, tempArena, BlobCipherMetrics::RESTORE); + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = a_body1cont2loopBody1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1when2(TextAndHeaderCipherKeys const& cipherKeys,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont8(cipherKeys, loopDepth); - Key vblockPrefix = StringRef(&hash, sizeof(uint8_t)).withPrefix(baLogRangePrefix); + return loopDepth; + } + int a_body1cont2loopBody1when2(TextAndHeaderCipherKeys && cipherKeys,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont8(std::move(cipherKeys), loopDepth); - ret.push_back_deep(ret.arena(), - KeyRangeRef(StringRef((uint8_t*)&bv, sizeof(uint64_t)).withPrefix(vblockPrefix), - StringRef((uint8_t*)&ev, sizeof(uint64_t)).withPrefix(vblockPrefix))); + return loopDepth; } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeBackupLogValueActor, 2, TextAndHeaderCipherKeys >::remove(); - return ret; -} + } + void a_callback_fire(ActorCallback< DecodeBackupLogValueActor, 2, TextAndHeaderCipherKeys >*,TextAndHeaderCipherKeys const& value) + { + fdb_probe_actor_enter("decodeBackupLogValue", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2loopBody1when2(value, 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("decodeBackupLogValue", reinterpret_cast(this), 2); -Key getApplyKey(Version version, Key backupUid) { - int64_t vblock = (version - 1) / CLIENT_KNOBS->LOG_RANGE_BLOCK_SIZE; - uint64_t v = bigEndian64(version); - uint32_t data = vblock & 0xffffffff; - uint8_t hash = (uint8_t)hashlittle(&data, sizeof(uint32_t), 0); - Key k1 = StringRef((uint8_t*)&v, sizeof(uint64_t)).withPrefix(StringRef(&hash, sizeof(uint8_t))); - Key k2 = k1.withPrefix(backupUid); - return k2.withPrefix(applyLogKeys.begin); -} + } + void a_callback_fire(ActorCallback< DecodeBackupLogValueActor, 2, TextAndHeaderCipherKeys >*,TextAndHeaderCipherKeys && value) + { + fdb_probe_actor_enter("decodeBackupLogValue", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2loopBody1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("decodeBackupLogValue", reinterpret_cast(this), 2); -Key getLogKey(Version version, Key backupUid) { - int64_t vblock = (version - 1) / CLIENT_KNOBS->LOG_RANGE_BLOCK_SIZE; - uint64_t v = bigEndian64(version); - uint32_t data = vblock & 0xffffffff; - uint8_t hash = (uint8_t)hashlittle(&data, sizeof(uint32_t), 0); - Key k1 = StringRef((uint8_t*)&v, sizeof(uint64_t)).withPrefix(StringRef(&hash, sizeof(uint8_t))); - Key k2 = k1.withPrefix(backupUid); - return k2.withPrefix(backupLogKeys.begin); -} + } + void a_callback_error(ActorCallback< DecodeBackupLogValueActor, 2, TextAndHeaderCipherKeys >*,Error err) + { + fdb_probe_actor_enter("decodeBackupLogValue", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("decodeBackupLogValue", reinterpret_cast(this), 2); -Version getLogKeyVersion(Key key) { - return bigEndian64(*(int64_t*)(key.begin() + backupLogPrefixBytes + sizeof(UID) + sizeof(uint8_t))); -} + } + int a_body1cont2loopBody1cont10(int loopDepth) + { + try { + loopDepth = a_body1cont2loopBody1cont4(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), std::max(0, loopDepth - 1)); + } -// Given a key from one of the ranges returned by get_log_ranges, -// returns(version, part) where version is the database version number of -// the transaction log data in the value, and part is 0 for the first such -// data for a given version, 1 for the second block of data, etc. -std::pair decodeBKMutationLogKey(Key key) { - return std::make_pair( - getLogKeyVersion(key), - bigEndian32(*(int32_t*)(key.begin() + backupLogPrefixBytes + sizeof(UID) + sizeof(uint8_t) + sizeof(int64_t)))); -} + return loopDepth; + } + int a_body1cont8(int loopDepth) + { + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } -void decodeBackupLogValue(Arena& arena, - VectorRef& result, - int& mutationSize, - StringRef value, - StringRef addPrefix, - StringRef removePrefix, - Version version, - Reference> key_version) { - try { - uint64_t offset(0); - uint64_t protocolVersion = 0; - memcpy(&protocolVersion, value.begin(), sizeof(uint64_t)); - offset += sizeof(uint64_t); - if (protocolVersion <= 0x0FDB00A200090001) { - TraceEvent(SevError, "DecodeBackupLogValue") - .detail("IncompatibleProtocolVersion", protocolVersion) - .detail("ValueSize", value.size()) - .detail("Value", value); - throw incompatible_protocol_version(); - } - - uint32_t totalBytes = 0; - memcpy(&totalBytes, value.begin() + offset, sizeof(uint32_t)); - offset += sizeof(uint32_t); - uint32_t consumed = 0; - - if (totalBytes + offset > value.size()) - throw restore_missing_data(); - - int originalOffset = offset; - - while (consumed < totalBytes) { - uint32_t type = 0; - memcpy(&type, value.begin() + offset, sizeof(uint32_t)); - offset += sizeof(uint32_t); - uint32_t len1 = 0; - memcpy(&len1, value.begin() + offset, sizeof(uint32_t)); - offset += sizeof(uint32_t); - uint32_t len2 = 0; - memcpy(&len2, value.begin() + offset, sizeof(uint32_t)); - offset += sizeof(uint32_t); - - ASSERT(offset + len1 + len2 <= value.size() && isValidMutationType(type)); - - MutationRef logValue; - Arena tempArena; - logValue.type = type; - logValue.param1 = value.substr(offset, len1); - offset += len1; - logValue.param2 = value.substr(offset, len2); - offset += len2; - - if (logValue.type == MutationRef::ClearRange) { - KeyRangeRef range(logValue.param1, logValue.param2); - auto ranges = key_version->intersectingRanges(range); - for (auto r : ranges) { - if (version > r.value() && r.value() != invalidVersion) { - KeyRef minKey = std::min(r.range().end, range.end); - if (minKey == (removePrefix == StringRef() ? normalKeys.end : strinc(removePrefix))) { - logValue.param1 = std::max(r.range().begin, range.begin); - if (removePrefix.size()) { - logValue.param1 = logValue.param1.removePrefix(removePrefix); - } - if (addPrefix.size()) { - logValue.param1 = logValue.param1.withPrefix(addPrefix, tempArena); - } - logValue.param2 = addPrefix == StringRef() ? normalKeys.end : strinc(addPrefix, tempArena); - result.push_back_deep(arena, logValue); - mutationSize += logValue.expectedSize(); - } else { - logValue.param1 = std::max(r.range().begin, range.begin); - logValue.param2 = minKey; - if (removePrefix.size()) { - logValue.param1 = logValue.param1.removePrefix(removePrefix); - logValue.param2 = logValue.param2.removePrefix(removePrefix); - } - if (addPrefix.size()) { - logValue.param1 = logValue.param1.withPrefix(addPrefix, tempArena); - logValue.param2 = logValue.param2.withPrefix(addPrefix, tempArena); - } - result.push_back_deep(arena, logValue); - mutationSize += logValue.expectedSize(); - } - } - } - } else { - Version ver = key_version->rangeContaining(logValue.param1).value(); - //TraceEvent("ApplyMutation").detail("LogValue", logValue).detail("Version", version).detail("Ver", ver).detail("Apply", version > ver && ver != invalidVersion); - if (version > ver && ver != invalidVersion) { - if (removePrefix.size()) { - logValue.param1 = logValue.param1.removePrefix(removePrefix); - } - if (addPrefix.size()) { - logValue.param1 = logValue.param1.withPrefix(addPrefix, tempArena); - } - result.push_back_deep(arena, logValue); - mutationSize += logValue.expectedSize(); - } - } + return loopDepth; + } + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Arena* arena; + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + VectorRef* result; + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + VectorRef>* encryptedResult; + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + int* mutationSize; + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + bool* tenantMapChanging; + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Standalone value; + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Key addPrefix; + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Key removePrefix; + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Version version; + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Reference> key_version; + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Database cx; + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + std::map* tenantMap; + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + bool provisionalProxy; + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + uint64_t offset; + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + uint32_t totalBytes; + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + uint32_t consumed; + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + int originalOffset; + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + DatabaseConfiguration config; + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + KeyRangeRef tenantMapRange; + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + uint32_t len1; + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + uint32_t len2; + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + MutationRef logValue; + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Arena tempArena; + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Optional encryptedLogValue; + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + EncryptCipherDomainId domainId; + #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" +}; +// This generated class is to be used only via decodeBackupLogValue() + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +class DecodeBackupLogValueActor final : public Actor, public ActorCallback< DecodeBackupLogValueActor, 0, DatabaseConfiguration >, public ActorCallback< DecodeBackupLogValueActor, 1, TextAndHeaderCipherKeys >, public ActorCallback< DecodeBackupLogValueActor, 2, TextAndHeaderCipherKeys >, public FastAllocated, public DecodeBackupLogValueActorState { + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DecodeBackupLogValueActor, 0, DatabaseConfiguration >; +friend struct ActorCallback< DecodeBackupLogValueActor, 1, TextAndHeaderCipherKeys >; +friend struct ActorCallback< DecodeBackupLogValueActor, 2, TextAndHeaderCipherKeys >; + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + DecodeBackupLogValueActor(Arena* const& arena,VectorRef* const& result,VectorRef>* const& encryptedResult,int* const& mutationSize,bool* const& tenantMapChanging,Standalone const& value,Key const& addPrefix,Key const& removePrefix,Version const& version,Reference> const& key_version,Database const& cx,std::map* const& tenantMap,bool const& provisionalProxy) + #line 1129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + : Actor(), + DecodeBackupLogValueActorState(arena, result, encryptedResult, mutationSize, tenantMapChanging, value, addPrefix, removePrefix, version, key_version, cx, tenantMap, provisionalProxy) + { + fdb_probe_actor_enter("decodeBackupLogValue", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("decodeBackupLogValue"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("decodeBackupLogValue", reinterpret_cast(this), -1); - consumed += BackupAgentBase::logHeaderSize + len1 + len2; + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DecodeBackupLogValueActor, 0, DatabaseConfiguration >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DecodeBackupLogValueActor, 1, TextAndHeaderCipherKeys >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< DecodeBackupLogValueActor, 2, TextAndHeaderCipherKeys >*)0, actor_cancelled()); break; } - ASSERT(consumed == totalBytes); - if (value.size() != offset) { - TraceEvent(SevError, "BA_DecodeBackupLogValue") - .detail("UnexpectedExtraDataSize", value.size()) - .detail("Offset", offset) - .detail("TotalBytes", totalBytes) - .detail("Consumed", consumed) - .detail("OriginalOffset", originalOffset); - throw restore_corrupted_data(); - } - } catch (Error& e) { - TraceEvent(e.code() == error_code_restore_missing_data ? SevWarn : SevError, "BA_DecodeBackupLogValue") - .error(e) - .GetLastError() - .detail("ValueSize", value.size()) - .detail("Value", value); - throw; } +}; +} + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +[[nodiscard]] static Future decodeBackupLogValue( Arena* const& arena, VectorRef* const& result, VectorRef>* const& encryptedResult, int* const& mutationSize, bool* const& tenantMapChanging, Standalone const& value, Key const& addPrefix, Key const& removePrefix, Version const& version, Reference> const& key_version, Database const& cx, std::map* const& tenantMap, bool const& provisionalProxy ) { + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + return Future(new DecodeBackupLogValueActor(arena, result, encryptedResult, mutationSize, tenantMapChanging, value, addPrefix, removePrefix, version, key_version, cx, tenantMap, provisionalProxy)); + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } +#line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + static double lastErrorTime = 0; void logErrorWorker(Reference tr, Key keyErrors, std::string message) { @@ -402,41 +1184,41 @@ Future logError(Reference tr, Key keyErrors, co return logError(tr->getDatabase(), keyErrors, message); } - #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" namespace { // This generated class is to be used only via readCommitted() - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" template - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" class ReadCommittedActorState { - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ReadCommittedActorState(Database const& cx,PromiseStream const& results,Reference const& lock,KeyRangeRef const& range,Terminator const& terminator,AccessSystemKeys const& systemAccess,LockAware const& lockAware) - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" : cx(cx), - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" results(results), - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" lock(lock), - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" range(range), - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" terminator(terminator), - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" systemAccess(systemAccess), - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" lockAware(lockAware), - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" begin(firstGreaterOrEqual(range.begin)), - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" end(firstGreaterOrEqual(range.end)), - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr(cx), - #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" releaser() - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { fdb_probe_actor_create("readCommitted", reinterpret_cast(this)); @@ -449,9 +1231,9 @@ class ReadCommittedActorState { int a_body1(int loopDepth=0) { try { - #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ; - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -480,36 +1262,36 @@ class ReadCommittedActorState { int a_body1loopBody1(int loopDepth) { try { - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - limits = GetRangeLimits(GetRangeLimits::ROW_LIMIT_UNLIMITED, (g_network->isSimulated() && !g_simulator.speedUpSimulation) ? CLIENT_KNOBS->BACKUP_SIMULATED_LIMIT_BYTES : CLIENT_KNOBS->BACKUP_GET_RANGE_LIMIT_BYTES); - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + limits = GetRangeLimits(GetRangeLimits::ROW_LIMIT_UNLIMITED, (g_network->isSimulated() && !g_simulator->speedUpSimulation) ? CLIENT_KNOBS->BACKUP_SIMULATED_LIMIT_BYTES : CLIENT_KNOBS->BACKUP_GET_RANGE_LIMIT_BYTES); + #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (systemAccess) - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (lockAware) - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" releaser.release(); - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_0 = lock->take(TaskPriority::DefaultYield, limits.bytes + CLIENT_KNOBS->VALUE_SIZE_LIMIT + CLIENT_KNOBS->SYSTEM_KEY_SIZE_LIMIT); - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -529,27 +1311,27 @@ class ReadCommittedActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (e.code() == error_code_transaction_too_old) - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr.fullReset(); - #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1Catch1cont1(loopDepth); } else { - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_3 = tr.onError(e); - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } } @@ -563,36 +1345,36 @@ class ReadCommittedActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" releaser = FlowLock::Releaser( *lock, limits.bytes + CLIENT_KNOBS->VALUE_SIZE_LIMIT + CLIENT_KNOBS->SYSTEM_KEY_SIZE_LIMIT); - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_1 = tr.getRange(begin, end, limits); - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" releaser = FlowLock::Releaser( *lock, limits.bytes + CLIENT_KNOBS->VALUE_SIZE_LIMIT + CLIENT_KNOBS->SYSTEM_KEY_SIZE_LIMIT); - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_1 = tr.getRange(begin, end, limits); - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -662,36 +1444,36 @@ class ReadCommittedActorState { } int a_body1loopBody1cont5(int loopDepth) { - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (values.size() > 1 && BUGGIFY) - #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" RangeResult copy; - #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" for(int i = 0;i < values.size() / 2;i++) { - #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" copy.push_back_deep(copy.arena(), values[i]); - #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" values = copy; - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" values.more = true; - #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (deterministicRandom()->random01() < 0.5) - #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_2 = delay(6.0); - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } else @@ -708,9 +1490,9 @@ class ReadCommittedActorState { } int a_body1loopBody1cont2when1(RangeResult const& __values,int loopDepth) { - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" values = __values; - #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; @@ -775,35 +1557,35 @@ class ReadCommittedActorState { } int a_body1loopBody1cont6(int loopDepth) { - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" releaser.remaining -= values.expectedSize(); - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ASSERT(releaser.remaining >= 0); - #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" results.send(RangeResultWithVersion(values, tr.getReadVersion().get())); - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (values.size() > 0) - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" begin = firstGreaterThan(values.end()[-1].key); - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!values.more && !limits.isReached()) - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (terminator) - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" results.sendError(end_of_stream()); - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReadCommittedActorState(); static_cast(this)->destroy(); return 0; } - #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ReadCommittedActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -988,38 +1770,38 @@ class ReadCommittedActorState { fdb_probe_actor_exit("readCommitted", reinterpret_cast(this), 3); } - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Database cx; - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" PromiseStream results; - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Reference lock; - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" KeyRangeRef range; - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Terminator terminator; - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" AccessSystemKeys systemAccess; - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" LockAware lockAware; - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" KeySelector begin; - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" KeySelector end; - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Transaction tr; - #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" FlowLock::Releaser releaser; - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" GetRangeLimits limits; - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" RangeResult values; - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" }; // This generated class is to be used only via readCommitted() - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" class ReadCommittedActor final : public Actor, public ActorCallback< ReadCommittedActor, 0, Void >, public ActorCallback< ReadCommittedActor, 1, RangeResult >, public ActorCallback< ReadCommittedActor, 2, Void >, public ActorCallback< ReadCommittedActor, 3, Void >, public FastAllocated, public ReadCommittedActorState { - #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1031,9 +1813,9 @@ friend struct ActorCallback< ReadCommittedActor, 0, Void >; friend struct ActorCallback< ReadCommittedActor, 1, RangeResult >; friend struct ActorCallback< ReadCommittedActor, 2, Void >; friend struct ActorCallback< ReadCommittedActor, 3, Void >; - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ReadCommittedActor(Database const& cx,PromiseStream const& results,Reference const& lock,KeyRangeRef const& range,Terminator const& terminator,AccessSystemKeys const& systemAccess,LockAware const& lockAware) - #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" : Actor(), ReadCommittedActorState(cx, results, lock, range, terminator, systemAccess, lockAware) { @@ -1060,58 +1842,58 @@ friend struct ActorCallback< ReadCommittedActor, 3, Void >; } }; } - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" [[nodiscard]] Future readCommitted( Database const& cx, PromiseStream const& results, Reference const& lock, KeyRangeRef const& range, Terminator const& terminator, AccessSystemKeys const& systemAccess, LockAware const& lockAware ) { - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" return Future(new ReadCommittedActor(cx, results, lock, range, terminator, systemAccess, lockAware)); - #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } -#line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +#line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" namespace { // This generated class is to be used only via readCommitted() - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" template - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" class ReadCommittedActor1State { - #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ReadCommittedActor1State(Database const& cx,PromiseStream const& results,Future const& active,Reference const& lock,KeyRangeRef const& range,std::function(Key key)> const& groupBy,Terminator const& terminator,AccessSystemKeys const& systemAccess,LockAware const& lockAware) - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" : cx(cx), - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" results(results), - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" active(active), - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" lock(lock), - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" range(range), - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" groupBy(groupBy), - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" terminator(terminator), - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" systemAccess(systemAccess), - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" lockAware(lockAware), - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" nextKey(firstGreaterOrEqual(range.begin)), - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" end(firstGreaterOrEqual(range.end)), - #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rcGroup(RCGroup()), - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" skipGroup(ULLONG_MAX), - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr(cx), - #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" releaser() - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { fdb_probe_actor_create("readCommitted", reinterpret_cast(this)); @@ -1124,9 +1906,9 @@ class ReadCommittedActor1State { int a_body1(int loopDepth=0) { try { - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ; - #line 1129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1155,34 +1937,34 @@ class ReadCommittedActor1State { int a_body1loopBody1(int loopDepth) { try { - #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - limits = GetRangeLimits(GetRangeLimits::ROW_LIMIT_UNLIMITED, (g_network->isSimulated() && !g_simulator.speedUpSimulation) ? CLIENT_KNOBS->BACKUP_SIMULATED_LIMIT_BYTES : CLIENT_KNOBS->BACKUP_GET_RANGE_LIMIT_BYTES); - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + limits = GetRangeLimits(GetRangeLimits::ROW_LIMIT_UNLIMITED, (g_network->isSimulated() && !g_simulator->speedUpSimulation) ? CLIENT_KNOBS->BACKUP_SIMULATED_LIMIT_BYTES : CLIENT_KNOBS->BACKUP_GET_RANGE_LIMIT_BYTES); + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (systemAccess) - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (lockAware) - #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_0 = tr.getRange(nextKey, end, limits); - #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1202,27 +1984,27 @@ class ReadCommittedActor1State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (e.code() == error_code_transaction_too_old) - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr.fullReset(); - #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1Catch1cont1(loopDepth); } else { - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_4 = tr.onError(e); - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } } @@ -1236,36 +2018,36 @@ class ReadCommittedActor1State { } int a_body1loopBody1cont2(int loopDepth) { - #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (rangevalue.size() > 1 && BUGGIFY) - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" RangeResult copy; - #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" for(int i = 0;i < rangevalue.size() / 2;i++) { - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" copy.push_back_deep(copy.arena(), rangevalue[i]); - #line 1249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rangevalue = copy; - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rangevalue.more = true; - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (deterministicRandom()->random01() < 0.5) - #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_1 = delay(6.0); - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } else @@ -1282,9 +2064,9 @@ class ReadCommittedActor1State { } int a_body1loopBody1when1(RangeResult const& __rangevalue,int loopDepth) { - #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rangevalue = __rangevalue; - #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; @@ -1349,16 +2131,16 @@ class ReadCommittedActor1State { } int a_body1loopBody1cont5(int loopDepth) { - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_2 = active; - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1446,36 +2228,36 @@ class ReadCommittedActor1State { } int a_body1loopBody1cont9(Void const& _,int loopDepth) { - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" releaser.release(); - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_3 = lock->take(TaskPriority::DefaultYield, rangevalue.expectedSize() + rcGroup.items.expectedSize()); - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont9when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont9(Void && _,int loopDepth) { - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" releaser.release(); - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_3 = lock->take(TaskPriority::DefaultYield, rangevalue.expectedSize() + rcGroup.items.expectedSize()); - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont9when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1545,182 +2327,182 @@ class ReadCommittedActor1State { } int a_body1loopBody1cont10(Void const& _,int loopDepth) { - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" releaser = FlowLock::Releaser(*lock, rangevalue.expectedSize() + rcGroup.items.expectedSize()); - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" for( auto& s : rangevalue ) { - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" uint64_t groupKey = groupBy(s.key).first; - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (groupKey != skipGroup) - #line 1556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (rcGroup.version == -1) - #line 1560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rcGroup.version = tr.getReadVersion().get(); - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rcGroup.groupKey = groupKey; - #line 1566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } else { - #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (rcGroup.groupKey != groupKey) - #line 1572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" releaser.remaining -= rcGroup.items .expectedSize(); - #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ASSERT(releaser.remaining >= 0); - #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" results.send(rcGroup); - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" nextKey = firstGreaterThan(rcGroup.items.end()[-1].key); - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" skipGroup = rcGroup.groupKey; - #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rcGroup = RCGroup(); - #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rcGroup.version = tr.getReadVersion().get(); - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rcGroup.groupKey = groupKey; - #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } } - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rcGroup.items.push_back_deep(rcGroup.items.arena(), s); - #line 1595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } } - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!rangevalue.more) - #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (rcGroup.version != -1) - #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" releaser.remaining -= rcGroup.items .expectedSize(); - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ASSERT(releaser.remaining >= 0); - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" results.send(rcGroup); - #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (terminator) - #line 1616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" results.sendError(end_of_stream()); - #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReadCommittedActor1State(); static_cast(this)->destroy(); return 0; } - #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ReadCommittedActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" nextKey = firstGreaterThan(rangevalue.end()[-1].key); - #line 1632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1cont10cont10(loopDepth); return loopDepth; } int a_body1loopBody1cont10(Void && _,int loopDepth) { - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" releaser = FlowLock::Releaser(*lock, rangevalue.expectedSize() + rcGroup.items.expectedSize()); - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" for( auto& s : rangevalue ) { - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" uint64_t groupKey = groupBy(s.key).first; - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (groupKey != skipGroup) - #line 1647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (rcGroup.version == -1) - #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rcGroup.version = tr.getReadVersion().get(); - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rcGroup.groupKey = groupKey; - #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } else { - #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (rcGroup.groupKey != groupKey) - #line 1663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" releaser.remaining -= rcGroup.items .expectedSize(); - #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ASSERT(releaser.remaining >= 0); - #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" results.send(rcGroup); - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" nextKey = firstGreaterThan(rcGroup.items.end()[-1].key); - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" skipGroup = rcGroup.groupKey; - #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rcGroup = RCGroup(); - #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rcGroup.version = tr.getReadVersion().get(); - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rcGroup.groupKey = groupKey; - #line 1681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } } - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rcGroup.items.push_back_deep(rcGroup.items.arena(), s); - #line 1686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } } - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!rangevalue.more) - #line 1691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (rcGroup.version != -1) - #line 1695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" releaser.remaining -= rcGroup.items .expectedSize(); - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ASSERT(releaser.remaining >= 0); - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" results.send(rcGroup); - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (terminator) - #line 1707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" results.sendError(end_of_stream()); - #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReadCommittedActor1State(); static_cast(this)->destroy(); return 0; } - #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ReadCommittedActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" nextKey = firstGreaterThan(rangevalue.end()[-1].key); - #line 1723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1cont10cont10(loopDepth); return loopDepth; @@ -1882,46 +2664,46 @@ class ReadCommittedActor1State { fdb_probe_actor_exit("readCommitted", reinterpret_cast(this), 4); } - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Database cx; - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" PromiseStream results; - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Future active; - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Reference lock; - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" KeyRangeRef range; - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" std::function(Key key)> groupBy; - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Terminator terminator; - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" AccessSystemKeys systemAccess; - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" LockAware lockAware; - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" KeySelector nextKey; - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" KeySelector end; - #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" RCGroup rcGroup; - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" uint64_t skipGroup; - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Transaction tr; - #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" FlowLock::Releaser releaser; - #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" GetRangeLimits limits; - #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" RangeResult rangevalue; - #line 1919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" }; // This generated class is to be used only via readCommitted() - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" class ReadCommittedActor1 final : public Actor, public ActorCallback< ReadCommittedActor1, 0, RangeResult >, public ActorCallback< ReadCommittedActor1, 1, Void >, public ActorCallback< ReadCommittedActor1, 2, Void >, public ActorCallback< ReadCommittedActor1, 3, Void >, public ActorCallback< ReadCommittedActor1, 4, Void >, public FastAllocated, public ReadCommittedActor1State { - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1934,19 +2716,289 @@ friend struct ActorCallback< ReadCommittedActor1, 1, Void >; friend struct ActorCallback< ReadCommittedActor1, 2, Void >; friend struct ActorCallback< ReadCommittedActor1, 3, Void >; friend struct ActorCallback< ReadCommittedActor1, 4, Void >; - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ReadCommittedActor1(Database const& cx,PromiseStream const& results,Future const& active,Reference const& lock,KeyRangeRef const& range,std::function(Key key)> const& groupBy,Terminator const& terminator,AccessSystemKeys const& systemAccess,LockAware const& lockAware) - #line 1939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + : Actor(), + ReadCommittedActor1State(cx, results, active, lock, range, groupBy, terminator, systemAccess, lockAware) + { + fdb_probe_actor_enter("readCommitted", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("readCommitted"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("readCommitted", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ReadCommittedActor1, 0, RangeResult >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ReadCommittedActor1, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ReadCommittedActor1, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< ReadCommittedActor1, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< ReadCommittedActor1, 4, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +[[nodiscard]] Future readCommitted( Database const& cx, PromiseStream const& results, Future const& active, Reference const& lock, KeyRangeRef const& range, std::function(Key key)> const& groupBy, Terminator const& terminator, AccessSystemKeys const& systemAccess, LockAware const& lockAware ) { + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + return Future(new ReadCommittedActor1(cx, results, active, lock, range, groupBy, terminator, systemAccess, lockAware)); + #line 2753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" +} + +#line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + +Future readCommitted(Database cx, + PromiseStream results, + Reference lock, + KeyRangeRef range, + std::function(Key key)> groupBy) { + return readCommitted( + cx, results, Void(), lock, range, groupBy, Terminator::True, AccessSystemKeys::True, LockAware::True); +} + + #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" +namespace { +// This generated class is to be used only via sendCommitTransactionRequest() + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +template + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +class SendCommitTransactionRequestActorState { + #line 2774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" +public: + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + SendCommitTransactionRequestActorState(CommitTransactionRequest const& req,Key const& uid,Version const& newBeginVersion,Key const& rangeBegin,NotifiedVersion* const& committedVersion,int* const& totalBytes,int* const& mutationSize,PromiseStream> const& addActor,FlowLock* const& commitLock,PublicRequestStream const& commit) + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + : req(req), + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + uid(uid), + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + newBeginVersion(newBeginVersion), + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + rangeBegin(rangeBegin), + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + committedVersion(committedVersion), + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + totalBytes(totalBytes), + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + mutationSize(mutationSize), + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + addActor(addActor), + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + commitLock(commitLock), + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + commit(commit) + #line 2799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + fdb_probe_actor_create("sendCommitTransactionRequest", reinterpret_cast(this)); + + } + ~SendCommitTransactionRequestActorState() + { + fdb_probe_actor_destroy("sendCommitTransactionRequest", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Key applyBegin = uid.withPrefix(applyMutationsBeginRange.begin); + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Key versionKey = BinaryWriter::toValue(newBeginVersion, Unversioned()); + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Key rangeEnd = getApplyKey(newBeginVersion, uid); + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + req.transaction.mutations.push_back_deep(req.arena, MutationRef(MutationRef::SetValue, applyBegin, versionKey)); + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + req.transaction.encryptedMutations.push_back_deep(req.arena, Optional()); + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + req.transaction.write_conflict_ranges.push_back_deep(req.arena, singleKeyRange(applyBegin)); + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + req.transaction.mutations.push_back_deep(req.arena, MutationRef(MutationRef::ClearRange, rangeBegin, rangeEnd)); + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + req.transaction.encryptedMutations.push_back_deep(req.arena, Optional()); + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + req.transaction.write_conflict_ranges.push_back_deep(req.arena, singleKeyRange(rangeBegin)); + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + req.transaction.read_snapshot = committedVersion->get(); + #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + req.flags = req.flags | CommitTransactionRequest::FLAG_IS_LOCK_AWARE; + #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + *totalBytes += *mutationSize; + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + StrictFuture __when_expr_0 = commitLock->take(TaskPriority::DefaultYield, *mutationSize); + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~SendCommitTransactionRequestActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + addActor.send(commitLock->releaseWhen(success(commit.getReply(req)), *mutationSize)); + #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SendCommitTransactionRequestActorState(); static_cast(this)->destroy(); return 0; } + #line 2870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~SendCommitTransactionRequestActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + addActor.send(commitLock->releaseWhen(success(commit.getReply(req)), *mutationSize)); + #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SendCommitTransactionRequestActorState(); static_cast(this)->destroy(); return 0; } + #line 2884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~SendCommitTransactionRequestActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SendCommitTransactionRequestActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SendCommitTransactionRequestActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("sendCommitTransactionRequest", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sendCommitTransactionRequest", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< SendCommitTransactionRequestActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("sendCommitTransactionRequest", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sendCommitTransactionRequest", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< SendCommitTransactionRequestActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("sendCommitTransactionRequest", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sendCommitTransactionRequest", reinterpret_cast(this), 0); + + } + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + CommitTransactionRequest req; + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Key uid; + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Version newBeginVersion; + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Key rangeBegin; + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + NotifiedVersion* committedVersion; + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + int* totalBytes; + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + int* mutationSize; + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + PromiseStream> addActor; + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + FlowLock* commitLock; + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + PublicRequestStream commit; + #line 2975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" +}; +// This generated class is to be used only via sendCommitTransactionRequest() + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +class SendCommitTransactionRequestActor final : public Actor, public ActorCallback< SendCommitTransactionRequestActor, 0, Void >, public FastAllocated, public SendCommitTransactionRequestActorState { + #line 2980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< SendCommitTransactionRequestActor, 0, Void >; + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + SendCommitTransactionRequestActor(CommitTransactionRequest const& req,Key const& uid,Version const& newBeginVersion,Key const& rangeBegin,NotifiedVersion* const& committedVersion,int* const& totalBytes,int* const& mutationSize,PromiseStream> const& addActor,FlowLock* const& commitLock,PublicRequestStream const& commit) + #line 2991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" : Actor(), - ReadCommittedActor1State(cx, results, active, lock, range, groupBy, terminator, systemAccess, lockAware) + SendCommitTransactionRequestActorState(req, uid, newBeginVersion, rangeBegin, committedVersion, totalBytes, mutationSize, addActor, commitLock, commit) { - fdb_probe_actor_enter("readCommitted", reinterpret_cast(this), -1); + fdb_probe_actor_enter("sendCommitTransactionRequest", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("readCommitted"); + this->lineage.setActorName("sendCommitTransactionRequest"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("readCommitted", reinterpret_cast(this), -1); + fdb_probe_actor_exit("sendCommitTransactionRequest", reinterpret_cast(this), -1); } void cancel() override @@ -1954,94 +3006,85 @@ friend struct ActorCallback< ReadCommittedActor1, 4, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ReadCommittedActor1, 0, RangeResult >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< ReadCommittedActor1, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< ReadCommittedActor1, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< ReadCommittedActor1, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< ReadCommittedActor1, 4, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< SendCommitTransactionRequestActor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" -[[nodiscard]] Future readCommitted( Database const& cx, PromiseStream const& results, Future const& active, Reference const& lock, KeyRangeRef const& range, std::function(Key key)> const& groupBy, Terminator const& terminator, AccessSystemKeys const& systemAccess, LockAware const& lockAware ) { - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - return Future(new ReadCommittedActor1(cx, results, active, lock, range, groupBy, terminator, systemAccess, lockAware)); - #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +[[nodiscard]] Future sendCommitTransactionRequest( CommitTransactionRequest const& req, Key const& uid, Version const& newBeginVersion, Key const& rangeBegin, NotifiedVersion* const& committedVersion, int* const& totalBytes, int* const& mutationSize, PromiseStream> const& addActor, FlowLock* const& commitLock, PublicRequestStream const& commit ) { + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + return Future(new SendCommitTransactionRequestActor(req, uid, newBeginVersion, rangeBegin, committedVersion, totalBytes, mutationSize, addActor, commitLock, commit)); + #line 3019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } -#line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - -Future readCommitted(Database cx, - PromiseStream results, - Reference lock, - KeyRangeRef range, - std::function(Key key)> groupBy) { - return readCommitted( - cx, results, Void(), lock, range, groupBy, Terminator::True, AccessSystemKeys::True, LockAware::True); -} +#line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - #line 1985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" namespace { -// This generated class is to be used only via dumpData() - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" -template - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" -class DumpDataActorState { - #line 1992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" +// This generated class is to be used only via kvMutationLogToTransactions() + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +template + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +class KvMutationLogToTransactionsActorState { + #line 3031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - DumpDataActorState(Database const& cx,PromiseStream const& results,Reference const& lock,Key const& uid,Key const& addPrefix,Key const& removePrefix,RequestStream const& commit,NotifiedVersion* const& committedVersion,Optional const& endVersion,Key const& rangeBegin,PromiseStream> const& addActor,FlowLock* const& commitLock,Reference> const& keyVersion) - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + KvMutationLogToTransactionsActorState(Database const& cx,PromiseStream const& results,Reference const& lock,Key const& uid,Key const& addPrefix,Key const& removePrefix,PublicRequestStream const& commit,NotifiedVersion* const& committedVersion,Optional const& endVersion,Key const& rangeBegin,PromiseStream> const& addActor,FlowLock* const& commitLock,Reference> const& keyVersion,std::map* const& tenantMap,bool const& provisionalProxy) + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" : cx(cx), - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" results(results), - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" lock(lock), - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" uid(uid), - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" addPrefix(addPrefix), - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" removePrefix(removePrefix), - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" commit(commit), - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" committedVersion(committedVersion), - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" endVersion(endVersion), - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rangeBegin(rangeBegin), - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" addActor(addActor), - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" commitLock(commitLock), - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" keyVersion(keyVersion), - #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + tenantMap(tenantMap), + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + provisionalProxy(provisionalProxy), + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" lastVersion(invalidVersion), - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" endOfStream(false), - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" totalBytes(0) - #line 2029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - fdb_probe_actor_create("dumpData", reinterpret_cast(this)); + fdb_probe_actor_create("kvMutationLogToTransactions", reinterpret_cast(this)); } - ~DumpDataActorState() + ~KvMutationLogToTransactionsActorState() { - fdb_probe_actor_destroy("dumpData", reinterpret_cast(this)); + fdb_probe_actor_destroy("kvMutationLogToTransactions", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ; - #line 2044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2054,8 +3097,8 @@ class DumpDataActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~DumpDataActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~KvMutationLogToTransactionsActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; @@ -2069,51 +3112,33 @@ class DumpDataActorState { } int a_body1loopBody1(int loopDepth) { - #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" req = CommitTransactionRequest(); - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" newBeginVersion = invalidVersion; - #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" mutationSize = 0; - #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + tenantMapChanging = false; + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ; - #line 2080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1cont1(int loopDepth) { - #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - Key applyBegin = uid.withPrefix(applyMutationsBeginRange.begin); - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - Key versionKey = BinaryWriter::toValue(newBeginVersion, Unversioned()); - #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - Key rangeEnd = getApplyKey(newBeginVersion, uid); - #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - req.transaction.mutations.push_back_deep(req.arena, MutationRef(MutationRef::SetValue, applyBegin, versionKey)); - #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - req.transaction.write_conflict_ranges.push_back_deep(req.arena, singleKeyRange(applyBegin)); - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - req.transaction.mutations.push_back_deep(req.arena, MutationRef(MutationRef::ClearRange, rangeBegin, rangeEnd)); - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - req.transaction.write_conflict_ranges.push_back_deep(req.arena, singleKeyRange(rangeBegin)); - #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - req.transaction.read_snapshot = committedVersion->get(); - #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - req.flags = req.flags | CommitTransactionRequest::FLAG_IS_LOCK_AWARE; - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - totalBytes += mutationSize; - #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - StrictFuture __when_expr_1 = commitLock->take(TaskPriority::DefaultYield, mutationSize); - #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + StrictFuture __when_expr_3 = sendCommitTransactionRequest(req, uid, newBeginVersion, rangeBegin, committedVersion, &totalBytes, &mutationSize, addActor, commitLock, commit); + #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2128,16 +3153,16 @@ class DumpDataActorState { int a_body1loopBody1loopBody1(int loopDepth) { try { - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" FutureStream __when_expr_0 = results.getFuture(); - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1loopBody1when1(__when_expr_0.pop(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2170,38 +3195,38 @@ class DumpDataActorState { int a_body1loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (e.code() == error_code_end_of_stream) - #line 2175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (endVersion.present() && endVersion.get() > lastVersion && endVersion.get() > newBeginVersion) - #line 2179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" newBeginVersion = endVersion.get(); - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (newBeginVersion == invalidVersion) - #line 2187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(totalBytes); this->~DumpDataActorState(); static_cast(this)->destroy(); return 0; } - #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" - new (&static_cast(this)->SAV< int >::value()) int(std::move(totalBytes)); // state_var_RVO - this->~DumpDataActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(totalBytes); this->~KvMutationLogToTransactionsActorState(); static_cast(this)->destroy(); return 0; } + #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + new (&static_cast(this)->SAV< int >::value()) int(std::move(totalBytes)); // state_var_RVO + this->~KvMutationLogToTransactionsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" endOfStream = true; - #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 2)); - #line 2204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 2)); @@ -2211,110 +3236,328 @@ class DumpDataActorState { return loopDepth; } - int a_body1loopBody1loopBody1cont2(RCGroup const& group,int loopDepth) + int a_body1loopBody1loopBody1cont2(int loopDepth) { - #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + curReq = CommitTransactionRequest(); + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" lock->release(group.items.expectedSize()); - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + curBatchMutationSize = 0; + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + tenantMapChanging = false; + #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" BinaryWriter bw(Unversioned()); - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" for(int i = 0;i < group.items.size();++i) { - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" bw.serializeBytes(group.items[i].value); - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - decodeBackupLogValue(req.arena, req.transaction.mutations, mutationSize, bw.toValue(), addPrefix, removePrefix, group.groupKey, keyVersion); - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - newBeginVersion = group.groupKey + 1; - #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - if (mutationSize >= CLIENT_KNOBS->BACKUP_LOG_WRITE_BATCH_MAX_SIZE) - #line 2232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + Standalone value = bw.toValue(); + #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + StrictFuture __when_expr_1 = decodeBackupLogValue(&curReq.arena, &curReq.transaction.mutations, &curReq.transaction.encryptedMutations, &curBatchMutationSize, &tenantMapChanging, value, addPrefix, removePrefix, group.groupKey, keyVersion, cx, tenantMap, provisionalProxy); + #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1loopBody1when1(RCGroup const& __group,int loopDepth) + { + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + group = __group; + #line 3277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = a_body1loopBody1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1when1(RCGroup && __group,int loopDepth) + { + group = std::move(__group); + loopDepth = a_body1loopBody1loopBody1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorSingleCallback< KvMutationLogToTransactionsActor, 0, RCGroup >::remove(); + + } + void a_callback_fire(ActorSingleCallback< KvMutationLogToTransactionsActor, 0, RCGroup >*,RCGroup const& value) + { + fdb_probe_actor_enter("kvMutationLogToTransactions", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("kvMutationLogToTransactions", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorSingleCallback< KvMutationLogToTransactionsActor, 0, RCGroup >*,RCGroup && value) + { + fdb_probe_actor_enter("kvMutationLogToTransactions", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("kvMutationLogToTransactions", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorSingleCallback< KvMutationLogToTransactionsActor, 0, RCGroup >*,Error err) + { + fdb_probe_actor_enter("kvMutationLogToTransactions", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("kvMutationLogToTransactions", reinterpret_cast(this), 0); + + } + int a_body1loopBody1loopBody1cont3(Void const& _,int loopDepth) + { + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (tenantMapChanging && req.transaction.mutations.size()) + #line 3344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + TraceEvent("MutationLogRestoreTenantMapChanging").detail("BeginVersion", newBeginVersion); + #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + CODE_PROBE(true, "mutation log tenant map changing"); + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + StrictFuture __when_expr_2 = sendCommitTransactionRequest(req, uid, newBeginVersion, rangeBegin, committedVersion, &totalBytes, &mutationSize, addActor, commitLock, commit); + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1loopBody1cont5(loopDepth); } - loopDepth = a_body1loopBody1loopBody1cont6(loopDepth); return loopDepth; } - int a_body1loopBody1loopBody1cont2(RCGroup && group,int loopDepth) + int a_body1loopBody1loopBody1cont3(Void && _,int loopDepth) { - #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - lock->release(group.items.expectedSize()); - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - BinaryWriter bw(Unversioned()); - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - for(int i = 0;i < group.items.size();++i) { - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - bw.serializeBytes(group.items[i].value); - #line 2250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (tenantMapChanging && req.transaction.mutations.size()) + #line 3373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + { + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + TraceEvent("MutationLogRestoreTenantMapChanging").detail("BeginVersion", newBeginVersion); + #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + CODE_PROBE(true, "mutation log tenant map changing"); + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + StrictFuture __when_expr_2 = sendCommitTransactionRequest(req, uid, newBeginVersion, rangeBegin, committedVersion, &totalBytes, &mutationSize, addActor, commitLock, commit); + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = 0; } - #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - decodeBackupLogValue(req.arena, req.transaction.mutations, mutationSize, bw.toValue(), addPrefix, removePrefix, group.groupKey, keyVersion); - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + else + { + loopDepth = a_body1loopBody1loopBody1cont5(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< KvMutationLogToTransactionsActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< KvMutationLogToTransactionsActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("kvMutationLogToTransactions", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("kvMutationLogToTransactions", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< KvMutationLogToTransactionsActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("kvMutationLogToTransactions", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("kvMutationLogToTransactions", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< KvMutationLogToTransactionsActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("kvMutationLogToTransactions", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("kvMutationLogToTransactions", reinterpret_cast(this), 1); + + } + int a_body1loopBody1loopBody1cont5(int loopDepth) + { + #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + i = int(); + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + for(i = 0;i < curReq.transaction.mutations.size();i++) { + #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + req.transaction.mutations.push_back_deep(req.arena, curReq.transaction.mutations[i]); + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + req.transaction.encryptedMutations.push_back_deep(req.arena, curReq.transaction.encryptedMutations[i]); + #line 3471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + } + #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + mutationSize += curBatchMutationSize; + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" newBeginVersion = group.groupKey + 1; - #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - if (mutationSize >= CLIENT_KNOBS->BACKUP_LOG_WRITE_BATCH_MAX_SIZE) - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (tenantMapChanging || mutationSize >= CLIENT_KNOBS->BACKUP_LOG_WRITE_BATCH_MAX_SIZE) + #line 3479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - loopDepth = a_body1loopBody1loopBody1cont6(loopDepth); + loopDepth = a_body1loopBody1loopBody1cont11(loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1cont6(Void const& _,int loopDepth) + { + #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + req = CommitTransactionRequest(); + #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + mutationSize = 0; + #line 3493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = a_body1loopBody1loopBody1cont5(loopDepth); return loopDepth; } - int a_body1loopBody1loopBody1when1(RCGroup const& group,int loopDepth) + int a_body1loopBody1loopBody1cont6(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1loopBody1cont2(group, loopDepth); + #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + req = CommitTransactionRequest(); + #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + mutationSize = 0; + #line 3504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + loopDepth = a_body1loopBody1loopBody1cont5(loopDepth); return loopDepth; } - int a_body1loopBody1loopBody1when1(RCGroup && group,int loopDepth) + int a_body1loopBody1loopBody1cont3when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1loopBody1cont2(std::move(group), loopDepth); + loopDepth = a_body1loopBody1loopBody1cont6(_, loopDepth); return loopDepth; } - void a_exitChoose1() + int a_body1loopBody1loopBody1cont3when1(Void && _,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorSingleCallback< DumpDataActor, 0, RCGroup >::remove(); + loopDepth = a_body1loopBody1loopBody1cont6(std::move(_), loopDepth); + return loopDepth; } - void a_callback_fire(ActorSingleCallback< DumpDataActor, 0, RCGroup >*,RCGroup const& value) + void a_exitChoose3() { - fdb_probe_actor_enter("dumpData", reinterpret_cast(this), 0); - a_exitChoose1(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< KvMutationLogToTransactionsActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< KvMutationLogToTransactionsActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("kvMutationLogToTransactions", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1loopBody1when1(value, 0); + a_body1loopBody1loopBody1cont3when1(value, 0); } catch (Error& error) { a_body1loopBody1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("dumpData", reinterpret_cast(this), 0); + fdb_probe_actor_exit("kvMutationLogToTransactions", reinterpret_cast(this), 2); } - void a_callback_fire(ActorSingleCallback< DumpDataActor, 0, RCGroup >*,RCGroup && value) + void a_callback_fire(ActorCallback< KvMutationLogToTransactionsActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("dumpData", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("kvMutationLogToTransactions", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1loopBody1when1(std::move(value), 0); + a_body1loopBody1loopBody1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1loopBody1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("dumpData", reinterpret_cast(this), 0); + fdb_probe_actor_exit("kvMutationLogToTransactions", reinterpret_cast(this), 2); } - void a_callback_error(ActorSingleCallback< DumpDataActor, 0, RCGroup >*,Error err) + void a_callback_error(ActorCallback< KvMutationLogToTransactionsActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("dumpData", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("kvMutationLogToTransactions", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1loopBody1loopBody1Catch1(err, 0); } @@ -2323,10 +3566,10 @@ class DumpDataActorState { } catch (...) { a_body1loopBody1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("dumpData", reinterpret_cast(this), 0); + fdb_probe_actor_exit("kvMutationLogToTransactions", reinterpret_cast(this), 2); } - int a_body1loopBody1loopBody1cont6(int loopDepth) + int a_body1loopBody1loopBody1cont11(int loopDepth) { try { loopDepth = a_body1loopBody1loopBody1cont1(loopDepth); @@ -2341,18 +3584,16 @@ class DumpDataActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - addActor.send(commitLock->releaseWhen(success(commit.getReply(req)), mutationSize)); - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (endOfStream) - #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(totalBytes); this->~DumpDataActorState(); static_cast(this)->destroy(); return 0; } - #line 2352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" - new (&static_cast(this)->SAV< int >::value()) int(std::move(totalBytes)); // state_var_RVO - this->~DumpDataActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(totalBytes); this->~KvMutationLogToTransactionsActorState(); static_cast(this)->destroy(); return 0; } + #line 3593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + new (&static_cast(this)->SAV< int >::value()) int(std::move(totalBytes)); // state_var_RVO + this->~KvMutationLogToTransactionsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } if (loopDepth == 0) return a_body1loopHead1(0); @@ -2361,18 +3602,16 @@ class DumpDataActorState { } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - addActor.send(commitLock->releaseWhen(success(commit.getReply(req)), mutationSize)); - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (endOfStream) - #line 2368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(totalBytes); this->~DumpDataActorState(); static_cast(this)->destroy(); return 0; } - #line 2372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" - new (&static_cast(this)->SAV< int >::value()) int(std::move(totalBytes)); // state_var_RVO - this->~DumpDataActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(totalBytes); this->~KvMutationLogToTransactionsActorState(); static_cast(this)->destroy(); return 0; } + #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + new (&static_cast(this)->SAV< int >::value()) int(std::move(totalBytes)); // state_var_RVO + this->~KvMutationLogToTransactionsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } if (loopDepth == 0) return a_body1loopHead1(0); @@ -2391,16 +3630,16 @@ class DumpDataActorState { return loopDepth; } - void a_exitChoose2() + void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DumpDataActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< KvMutationLogToTransactionsActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< DumpDataActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< KvMutationLogToTransactionsActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("dumpData", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("kvMutationLogToTransactions", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1loopBody1cont1when1(value, 0); } @@ -2409,13 +3648,13 @@ class DumpDataActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("dumpData", reinterpret_cast(this), 1); + fdb_probe_actor_exit("kvMutationLogToTransactions", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< DumpDataActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< KvMutationLogToTransactionsActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("dumpData", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("kvMutationLogToTransactions", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1loopBody1cont1when1(std::move(value), 0); } @@ -2424,13 +3663,13 @@ class DumpDataActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("dumpData", reinterpret_cast(this), 1); + fdb_probe_actor_exit("kvMutationLogToTransactions", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< DumpDataActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< KvMutationLogToTransactionsActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("dumpData", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("kvMutationLogToTransactions", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -2439,75 +3678,91 @@ class DumpDataActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("dumpData", reinterpret_cast(this), 1); + fdb_probe_actor_exit("kvMutationLogToTransactions", reinterpret_cast(this), 3); } - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Database cx; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" PromiseStream results; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Reference lock; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key uid; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key addPrefix; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key removePrefix; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - RequestStream commit; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + PublicRequestStream commit; + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" NotifiedVersion* committedVersion; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Optional endVersion; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key rangeBegin; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" PromiseStream> addActor; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" FlowLock* commitLock; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Reference> keyVersion; - #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + std::map* tenantMap; + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + bool provisionalProxy; + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version lastVersion; - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" bool endOfStream; - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" int totalBytes; - #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" CommitTransactionRequest req; - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version newBeginVersion; - #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" int mutationSize; - #line 2483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + bool tenantMapChanging; + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + RCGroup group; + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + CommitTransactionRequest curReq; + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + int curBatchMutationSize; + #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + int i; + #line 3736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" }; -// This generated class is to be used only via dumpData() - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" -class DumpDataActor final : public Actor, public ActorSingleCallback< DumpDataActor, 0, RCGroup >, public ActorCallback< DumpDataActor, 1, Void >, public FastAllocated, public DumpDataActorState { - #line 2488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" +// This generated class is to be used only via kvMutationLogToTransactions() + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +class KvMutationLogToTransactionsActor final : public Actor, public ActorSingleCallback< KvMutationLogToTransactionsActor, 0, RCGroup >, public ActorCallback< KvMutationLogToTransactionsActor, 1, Void >, public ActorCallback< KvMutationLogToTransactionsActor, 2, Void >, public ActorCallback< KvMutationLogToTransactionsActor, 3, Void >, public FastAllocated, public KvMutationLogToTransactionsActorState { + #line 3741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorSingleCallback< DumpDataActor, 0, RCGroup >; -friend struct ActorCallback< DumpDataActor, 1, Void >; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - DumpDataActor(Database const& cx,PromiseStream const& results,Reference const& lock,Key const& uid,Key const& addPrefix,Key const& removePrefix,RequestStream const& commit,NotifiedVersion* const& committedVersion,Optional const& endVersion,Key const& rangeBegin,PromiseStream> const& addActor,FlowLock* const& commitLock,Reference> const& keyVersion) - #line 2500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" +friend struct ActorSingleCallback< KvMutationLogToTransactionsActor, 0, RCGroup >; +friend struct ActorCallback< KvMutationLogToTransactionsActor, 1, Void >; +friend struct ActorCallback< KvMutationLogToTransactionsActor, 2, Void >; +friend struct ActorCallback< KvMutationLogToTransactionsActor, 3, Void >; + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + KvMutationLogToTransactionsActor(Database const& cx,PromiseStream const& results,Reference const& lock,Key const& uid,Key const& addPrefix,Key const& removePrefix,PublicRequestStream const& commit,NotifiedVersion* const& committedVersion,Optional const& endVersion,Key const& rangeBegin,PromiseStream> const& addActor,FlowLock* const& commitLock,Reference> const& keyVersion,std::map* const& tenantMap,bool const& provisionalProxy) + #line 3755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" : Actor(), - DumpDataActorState(cx, results, lock, uid, addPrefix, removePrefix, commit, committedVersion, endVersion, rangeBegin, addActor, commitLock, keyVersion) + KvMutationLogToTransactionsActorState(cx, results, lock, uid, addPrefix, removePrefix, commit, committedVersion, endVersion, rangeBegin, addActor, commitLock, keyVersion, tenantMap, provisionalProxy) { - fdb_probe_actor_enter("dumpData", reinterpret_cast(this), -1); + fdb_probe_actor_enter("kvMutationLogToTransactions", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("dumpData"); + this->lineage.setActorName("kvMutationLogToTransactions"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("dumpData", reinterpret_cast(this), -1); + fdb_probe_actor_exit("kvMutationLogToTransactions", reinterpret_cast(this), -1); } void cancel() override @@ -2515,49 +3770,51 @@ friend struct ActorCallback< DumpDataActor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorSingleCallback< DumpDataActor, 0, RCGroup >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< DumpDataActor, 1, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorSingleCallback< KvMutationLogToTransactionsActor, 0, RCGroup >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< KvMutationLogToTransactionsActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< KvMutationLogToTransactionsActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< KvMutationLogToTransactionsActor, 3, Void >*)0, actor_cancelled()); break; } } }; } - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" -[[nodiscard]] Future dumpData( Database const& cx, PromiseStream const& results, Reference const& lock, Key const& uid, Key const& addPrefix, Key const& removePrefix, RequestStream const& commit, NotifiedVersion* const& committedVersion, Optional const& endVersion, Key const& rangeBegin, PromiseStream> const& addActor, FlowLock* const& commitLock, Reference> const& keyVersion ) { - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - return Future(new DumpDataActor(cx, results, lock, uid, addPrefix, removePrefix, commit, committedVersion, endVersion, rangeBegin, addActor, commitLock, keyVersion)); - #line 2529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +[[nodiscard]] Future kvMutationLogToTransactions( Database const& cx, PromiseStream const& results, Reference const& lock, Key const& uid, Key const& addPrefix, Key const& removePrefix, PublicRequestStream const& commit, NotifiedVersion* const& committedVersion, Optional const& endVersion, Key const& rangeBegin, PromiseStream> const& addActor, FlowLock* const& commitLock, Reference> const& keyVersion, std::map* const& tenantMap, bool const& provisionalProxy ) { + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + return Future(new KvMutationLogToTransactionsActor(cx, results, lock, uid, addPrefix, removePrefix, commit, committedVersion, endVersion, rangeBegin, addActor, commitLock, keyVersion, tenantMap, provisionalProxy)); + #line 3786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } -#line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +#line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" namespace { // This generated class is to be used only via coalesceKeyVersionCache() - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" template - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" class CoalesceKeyVersionCacheActorState { - #line 2541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - CoalesceKeyVersionCacheActorState(Key const& uid,Version const& endVersion,Reference> const& keyVersion,RequestStream const& commit,NotifiedVersion* const& committedVersion,PromiseStream> const& addActor,FlowLock* const& commitLock) - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + CoalesceKeyVersionCacheActorState(Key const& uid,Version const& endVersion,Reference> const& keyVersion,PublicRequestStream const& commit,NotifiedVersion* const& committedVersion,PromiseStream> const& addActor,FlowLock* const& commitLock) + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" : uid(uid), - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" endVersion(endVersion), - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" keyVersion(keyVersion), - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" commit(commit), - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" committedVersion(committedVersion), - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" addActor(addActor), - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" commitLock(commitLock) - #line 2560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { fdb_probe_actor_create("coalesceKeyVersionCache", reinterpret_cast(this)); @@ -2570,78 +3827,78 @@ class CoalesceKeyVersionCacheActorState { int a_body1(int loopDepth=0) { try { - #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version lastVersion = -1000; - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" int64_t removed = 0; - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" req = CommitTransactionRequest(); - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" mutationSize = 0; - #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key mapPrefix = uid.withPrefix(applyMutationsKeyVersionMapRange.begin); - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" for( auto it : keyVersion->ranges() ) { - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (lastVersion == -1000) - #line 2587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" lastVersion = it.value(); - #line 2591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } else { - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version ver = it.value(); - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (ver < endVersion && lastVersion < endVersion && ver != invalidVersion && lastVersion != invalidVersion) - #line 2599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key removeKey = it.range().begin.withPrefix(mapPrefix); - #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key removeEnd = keyAfter(removeKey); - #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" req.transaction.mutations.push_back_deep(req.arena, MutationRef(MutationRef::ClearRange, removeKey, removeEnd)); - #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" mutationSize += removeKey.size() + removeEnd.size(); - #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" removed--; - #line 2611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } else { - #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" lastVersion = ver; - #line 2617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } } } - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (removed != 0) - #line 2623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key countKey = uid.withPrefix(applyMutationsKeyVersionCountRange.begin); - #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" req.transaction.write_conflict_ranges.push_back_deep(req.arena, singleKeyRange(countKey)); - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" req.transaction.mutations.push_back_deep( req.arena, MutationRef(MutationRef::AddValue, countKey, StringRef((uint8_t*)&removed, 8))); - #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" req.transaction.read_snapshot = committedVersion->get(); - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" req.flags = req.flags | CommitTransactionRequest::FLAG_IS_LOCK_AWARE; - #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_0 = commitLock->take(TaskPriority::DefaultYield, mutationSize); - #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } else @@ -2667,9 +3924,9 @@ class CoalesceKeyVersionCacheActorState { } int a_body1cont1(int loopDepth) { - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CoalesceKeyVersionCacheActorState(); static_cast(this)->destroy(); return 0; } - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CoalesceKeyVersionCacheActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2679,18 +3936,18 @@ class CoalesceKeyVersionCacheActorState { } int a_body1cont7(Void const& _,int loopDepth) { - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" addActor.send(commitLock->releaseWhen(success(commit.getReply(req)), mutationSize)); - #line 2684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } int a_body1cont7(Void && _,int loopDepth) { - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" addActor.send(commitLock->releaseWhen(success(commit.getReply(req)), mutationSize)); - #line 2693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 3950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -2758,30 +4015,30 @@ class CoalesceKeyVersionCacheActorState { fdb_probe_actor_exit("coalesceKeyVersionCache", reinterpret_cast(this), 0); } - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key uid; - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version endVersion; - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Reference> keyVersion; - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - RequestStream commit; - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + PublicRequestStream commit; + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" NotifiedVersion* committedVersion; - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" PromiseStream> addActor; - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" FlowLock* commitLock; - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" CommitTransactionRequest req; - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" int64_t mutationSize; - #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" }; // This generated class is to be used only via coalesceKeyVersionCache() - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" class CoalesceKeyVersionCacheActor final : public Actor, public ActorCallback< CoalesceKeyVersionCacheActor, 0, Void >, public FastAllocated, public CoalesceKeyVersionCacheActorState { - #line 2784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2790,9 +4047,9 @@ class CoalesceKeyVersionCacheActor final : public Actor, public ActorCallb void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< CoalesceKeyVersionCacheActor, 0, Void >; - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - CoalesceKeyVersionCacheActor(Key const& uid,Version const& endVersion,Reference> const& keyVersion,RequestStream const& commit,NotifiedVersion* const& committedVersion,PromiseStream> const& addActor,FlowLock* const& commitLock) - #line 2795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + CoalesceKeyVersionCacheActor(Key const& uid,Version const& endVersion,Reference> const& keyVersion,PublicRequestStream const& commit,NotifiedVersion* const& committedVersion,PromiseStream> const& addActor,FlowLock* const& commitLock) + #line 4052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" : Actor(), CoalesceKeyVersionCacheActorState(uid, endVersion, keyVersion, commit, committedVersion, addActor, commitLock) { @@ -2816,54 +4073,58 @@ friend struct ActorCallback< CoalesceKeyVersionCacheActor, 0, Void >; } }; } - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" -[[nodiscard]] Future coalesceKeyVersionCache( Key const& uid, Version const& endVersion, Reference> const& keyVersion, RequestStream const& commit, NotifiedVersion* const& committedVersion, PromiseStream> const& addActor, FlowLock* const& commitLock ) { - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +[[nodiscard]] Future coalesceKeyVersionCache( Key const& uid, Version const& endVersion, Reference> const& keyVersion, PublicRequestStream const& commit, NotifiedVersion* const& committedVersion, PromiseStream> const& addActor, FlowLock* const& commitLock ) { + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" return Future(new CoalesceKeyVersionCacheActor(uid, endVersion, keyVersion, commit, committedVersion, addActor, commitLock)); - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } -#line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +#line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" namespace { // This generated class is to be used only via applyMutations() - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" template - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" class ApplyMutationsActorState { - #line 2835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - ApplyMutationsActorState(Database const& cx,Key const& uid,Key const& addPrefix,Key const& removePrefix,Version const& beginVersion,Version* const& endVersion,RequestStream const& commit,NotifiedVersion* const& committedVersion,Reference> const& keyVersion) - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + ApplyMutationsActorState(Database const& cx,Key const& uid,Key const& addPrefix,Key const& removePrefix,Version const& beginVersion,Version* const& endVersion,PublicRequestStream const& commit,NotifiedVersion* const& committedVersion,Reference> const& keyVersion,std::map* const& tenantMap,bool const& provisionalProxy) + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" : cx(cx), - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" uid(uid), - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" addPrefix(addPrefix), - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" removePrefix(removePrefix), - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" beginVersion(beginVersion), - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" endVersion(endVersion), - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" commit(commit), - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" committedVersion(committedVersion), - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" keyVersion(keyVersion), - #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + tenantMap(tenantMap), + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + provisionalProxy(provisionalProxy), + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" commitLock(CLIENT_KNOBS->BACKUP_LOCK_BYTES), - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" addActor(), - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" error(actorCollection(addActor.getFuture())), - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" maxBytes(CLIENT_KNOBS->APPLY_MIN_LOCK_BYTES) - #line 2866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { fdb_probe_actor_create("applyMutations", reinterpret_cast(this)); @@ -2876,13 +4137,13 @@ class ApplyMutationsActorState { int a_body1(int loopDepth=0) { try { - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" keyVersion->insert(metadataVersionKey, 0); - #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" try { - #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ; - #line 2885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2910,11 +4171,11 @@ class ApplyMutationsActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" TraceEvent(e.code() == error_code_restore_missing_data ? SevWarnAlways : SevError, "ApplyMutationsError") .error(e); - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 2917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -2933,20 +4194,20 @@ class ApplyMutationsActorState { } int a_body1loopBody1(int loopDepth) { - #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (beginVersion >= *endVersion) - #line 2938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_0 = commitLock.take(TaskPriority::DefaultYield, CLIENT_KNOBS->BACKUP_LOCK_BYTES); - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } else @@ -2958,50 +4219,50 @@ class ApplyMutationsActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" int rangeCount = std::max(1, CLIENT_KNOBS->APPLY_MAX_LOCK_BYTES / maxBytes); - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" newEndVersion = std::min(*endVersion, ((beginVersion / CLIENT_KNOBS->APPLY_BLOCK_SIZE) + rangeCount) * CLIENT_KNOBS->APPLY_BLOCK_SIZE); - #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ranges = getApplyRanges(beginVersion, newEndVersion, uid); - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" idx = size_t(); - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" results = std::vector>(); - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rc = std::vector>(); - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" locks = std::vector>(); - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" for(int i = 0;i < ranges.size();++i) { - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" results.push_back(PromiseStream()); - #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" locks.push_back(makeReference( std::max(CLIENT_KNOBS->APPLY_MAX_LOCK_BYTES / ranges.size(), CLIENT_KNOBS->APPLY_MIN_LOCK_BYTES))); - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" rc.push_back(readCommitted(cx, results[i], locks[i], ranges[i], decodeBKMutationLogKey)); - #line 2983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" maxBytes = std::max(maxBytes * CLIENT_KNOBS->APPLY_MAX_DECAY_RATE, CLIENT_KNOBS->APPLY_MIN_LOCK_BYTES); - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" idx = 0; - #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" commitLock.release(CLIENT_KNOBS->BACKUP_LOCK_BYTES); - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (beginVersion >= *endVersion) - #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ApplyMutationsActorState(); static_cast(this)->destroy(); return 0; } - #line 3004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ApplyMutationsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3013,15 +4274,15 @@ class ApplyMutationsActorState { } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" commitLock.release(CLIENT_KNOBS->BACKUP_LOCK_BYTES); - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (beginVersion >= *endVersion) - #line 3020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ApplyMutationsActorState(); static_cast(this)->destroy(); return 0; } - #line 3024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ApplyMutationsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3096,16 +4357,16 @@ class ApplyMutationsActorState { } int a_body1loopBody1cont5(int loopDepth) { - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_2 = coalesceKeyVersionCache( uid, newEndVersion, keyVersion, commit, committedVersion, addActor, &commitLock); - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont5when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3119,22 +4380,22 @@ class ApplyMutationsActorState { } int a_body1loopBody1cont1loopBody1(int loopDepth) { - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!(idx < ranges.size())) - #line 3124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - StrictFuture __when_expr_1 = dumpData(cx, results[idx], locks[idx], uid, addPrefix, removePrefix, commit, committedVersion, idx == ranges.size() - 1 ? newEndVersion : Optional(), ranges[idx].begin, addActor, &commitLock, keyVersion); - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + StrictFuture __when_expr_1 = kvMutationLogToTransactions(cx, results[idx], locks[idx], uid, addPrefix, removePrefix, commit, committedVersion, idx == ranges.size() - 1 ? newEndVersion : Optional(), ranges[idx].begin, addActor, &commitLock, keyVersion, tenantMap, provisionalProxy); + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 3132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3154,38 +4415,38 @@ class ApplyMutationsActorState { } int a_body1loopBody1cont1loopBody1cont1(int const& bytes,int loopDepth) { - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" maxBytes = std::max(CLIENT_KNOBS->APPLY_MAX_INCREASE_FACTOR * bytes, maxBytes); - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (error.isError()) - #line 3161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" return a_body1Catch2(error.getError(), std::max(0, loopDepth - 2)); - #line 3165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ++idx; - #line 3169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1cont1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1loopBody1cont1(int && bytes,int loopDepth) { - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" maxBytes = std::max(CLIENT_KNOBS->APPLY_MAX_INCREASE_FACTOR * bytes, maxBytes); - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (error.isError()) - #line 3180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" return a_body1Catch2(error.getError(), std::max(0, loopDepth - 2)); - #line 3184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ++idx; - #line 3188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1cont1loopHead1(0); return loopDepth; @@ -3255,22 +4516,22 @@ class ApplyMutationsActorState { } int a_body1loopBody1cont7(Void const& _,int loopDepth) { - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" beginVersion = newEndVersion; - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (BUGGIFY) - #line 3262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_3 = delay(2.0); - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont7when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } else @@ -3282,22 +4543,22 @@ class ApplyMutationsActorState { } int a_body1loopBody1cont7(Void && _,int loopDepth) { - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" beginVersion = newEndVersion; - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (BUGGIFY) - #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_3 = delay(2.0); - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont7when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } else @@ -3451,50 +4712,54 @@ class ApplyMutationsActorState { fdb_probe_actor_exit("applyMutations", reinterpret_cast(this), 3); } - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Database cx; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key uid; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key addPrefix; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key removePrefix; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version beginVersion; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version* endVersion; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - RequestStream commit; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + PublicRequestStream commit; + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" NotifiedVersion* committedVersion; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Reference> keyVersion; - #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + std::map* tenantMap; + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + bool provisionalProxy; + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" FlowLock commitLock; - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" PromiseStream> addActor; - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Future error; - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" int maxBytes; - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version newEndVersion; - #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Standalone> ranges; - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" size_t idx; - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" std::vector> results; - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" std::vector> rc; - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" std::vector> locks; - #line 3492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" }; // This generated class is to be used only via applyMutations() - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" class ApplyMutationsActor final : public Actor, public ActorCallback< ApplyMutationsActor, 0, Void >, public ActorCallback< ApplyMutationsActor, 1, int >, public ActorCallback< ApplyMutationsActor, 2, Void >, public ActorCallback< ApplyMutationsActor, 3, Void >, public FastAllocated, public ApplyMutationsActorState { - #line 3497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3506,11 +4771,11 @@ friend struct ActorCallback< ApplyMutationsActor, 0, Void >; friend struct ActorCallback< ApplyMutationsActor, 1, int >; friend struct ActorCallback< ApplyMutationsActor, 2, Void >; friend struct ActorCallback< ApplyMutationsActor, 3, Void >; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - ApplyMutationsActor(Database const& cx,Key const& uid,Key const& addPrefix,Key const& removePrefix,Version const& beginVersion,Version* const& endVersion,RequestStream const& commit,NotifiedVersion* const& committedVersion,Reference> const& keyVersion) - #line 3511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + ApplyMutationsActor(Database const& cx,Key const& uid,Key const& addPrefix,Key const& removePrefix,Version const& beginVersion,Version* const& endVersion,PublicRequestStream const& commit,NotifiedVersion* const& committedVersion,Reference> const& keyVersion,std::map* const& tenantMap,bool const& provisionalProxy) + #line 4776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" : Actor(), - ApplyMutationsActorState(cx, uid, addPrefix, removePrefix, beginVersion, endVersion, commit, committedVersion, keyVersion) + ApplyMutationsActorState(cx, uid, addPrefix, removePrefix, beginVersion, endVersion, commit, committedVersion, keyVersion, tenantMap, provisionalProxy) { fdb_probe_actor_enter("applyMutations", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -3535,44 +4800,44 @@ friend struct ActorCallback< ApplyMutationsActor, 3, Void >; } }; } - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" -[[nodiscard]] Future applyMutations( Database const& cx, Key const& uid, Key const& addPrefix, Key const& removePrefix, Version const& beginVersion, Version* const& endVersion, RequestStream const& commit, NotifiedVersion* const& committedVersion, Reference> const& keyVersion ) { - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - return Future(new ApplyMutationsActor(cx, uid, addPrefix, removePrefix, beginVersion, endVersion, commit, committedVersion, keyVersion)); - #line 3542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +[[nodiscard]] Future applyMutations( Database const& cx, Key const& uid, Key const& addPrefix, Key const& removePrefix, Version const& beginVersion, Version* const& endVersion, PublicRequestStream const& commit, NotifiedVersion* const& committedVersion, Reference> const& keyVersion, std::map* const& tenantMap, bool const& provisionalProxy ) { + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + return Future(new ApplyMutationsActor(cx, uid, addPrefix, removePrefix, beginVersion, endVersion, commit, committedVersion, keyVersion, tenantMap, provisionalProxy)); + #line 4807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } -#line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +#line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - #line 3547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" namespace { // This generated class is to be used only via _eraseLogData() - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" template - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" class _eraseLogDataActorState { - #line 3554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" _eraseLogDataActorState(Reference const& tr,Key const& logUidValue,Key const& destUidValue,Optional const& endVersion,CheckBackupUID const& checkBackupUid,Version const& backupUid) - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" : tr(tr), - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" logUidValue(logUidValue), - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" destUidValue(destUidValue), - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" endVersion(endVersion), - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" checkBackupUid(checkBackupUid), - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" backupUid(backupUid), - #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" backupLatestVersionsPath(destUidValue.withPrefix(backupLatestVersionsPrefix)), - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" backupLatestVersionsKey(logUidValue.withPrefix(backupLatestVersionsPath)) - #line 3575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { fdb_probe_actor_create("_eraseLogData", reinterpret_cast(this)); @@ -3585,38 +4850,38 @@ class _eraseLogDataActorState { int a_body1(int loopDepth=0) { try { - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!destUidValue.size()) - #line 3590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!static_cast<_eraseLogDataActor*>(this)->SAV::futures) { (void)(Void()); this->~_eraseLogDataActorState(); static_cast<_eraseLogDataActor*>(this)->destroy(); return 0; } - #line 3594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" new (&static_cast<_eraseLogDataActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_eraseLogDataActorState(); static_cast<_eraseLogDataActor*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (checkBackupUid) - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Subspace sourceStates = Subspace(databaseBackupPrefixRange.begin).get(BackupAgentBase::keySourceStates).get(logUidValue); - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture> __when_expr_0 = tr->get(sourceStates.pack(DatabaseBackupAgent::keyFolderId)); - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast<_eraseLogDataActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_eraseLogDataActor*>(this)->actor_wait_state = 1; - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast<_eraseLogDataActor*>(this))); - #line 3619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } else @@ -3642,29 +4907,29 @@ class _eraseLogDataActorState { } int a_body1cont1(int loopDepth) { - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_1 = tr->getRange(KeyRangeRef(backupLatestVersionsPath, strinc(backupLatestVersionsPath)), CLIENT_KNOBS->TOO_MANY); - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast<_eraseLogDataActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_eraseLogDataActor*>(this)->actor_wait_state = 2; - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_eraseLogDataActor*>(this))); - #line 3654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(Optional const& v,int loopDepth) { - #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (v.present() && BinaryReader::fromStringRef(v.get(), Unversioned()) > backupUid) - #line 3663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!static_cast<_eraseLogDataActor*>(this)->SAV::futures) { (void)(Void()); this->~_eraseLogDataActorState(); static_cast<_eraseLogDataActor*>(this)->destroy(); return 0; } - #line 3667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" new (&static_cast<_eraseLogDataActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_eraseLogDataActorState(); static_cast<_eraseLogDataActor*>(this)->finishSendAndDelPromiseRef(); @@ -3676,13 +4941,13 @@ class _eraseLogDataActorState { } int a_body1cont3(Optional && v,int loopDepth) { - #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (v.present() && BinaryReader::fromStringRef(v.get(), Unversioned()) > backupUid) - #line 3681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!static_cast<_eraseLogDataActor*>(this)->SAV::futures) { (void)(Void()); this->~_eraseLogDataActorState(); static_cast<_eraseLogDataActor*>(this)->destroy(); return 0; } - #line 3685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 4950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" new (&static_cast<_eraseLogDataActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_eraseLogDataActorState(); static_cast<_eraseLogDataActor*>(this)->finishSendAndDelPromiseRef(); @@ -3757,187 +5022,171 @@ class _eraseLogDataActorState { } int a_body1cont6(int loopDepth) { - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" currBeginVersion = invalidVersion; - #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" for( auto backupVersion : backupVersions ) { - #line 830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key currLogUidValue = backupVersion.key.removePrefix(backupLatestVersionsPrefix).removePrefix(destUidValue); - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (currLogUidValue == logUidValue) - #line 3768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" currBeginVersion = BinaryReader::fromStringRef(backupVersion.value, Unversioned()); - #line 3772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" break; } } - #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (currBeginVersion == invalidVersion) - #line 3778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!static_cast<_eraseLogDataActor*>(this)->SAV::futures) { (void)(Void()); this->~_eraseLogDataActorState(); static_cast<_eraseLogDataActor*>(this)->destroy(); return 0; } - #line 3782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" new (&static_cast<_eraseLogDataActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_eraseLogDataActorState(); static_cast<_eraseLogDataActor*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" currEndVersion = std::numeric_limits::max(); - #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (endVersion.present()) - #line 3792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" currEndVersion = std::min(currEndVersion, endVersion.get()); - #line 3796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" nextSmallestVersion = currEndVersion; - #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" bool clearLogRangesRequired = true; - #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (backupVersions.size() > 1) - #line 3804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" for( auto backupVersion : backupVersions ) { - #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key currLogUidValue = backupVersion.key.removePrefix(backupLatestVersionsPrefix).removePrefix(destUidValue); - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version currVersion = BinaryReader::fromStringRef(backupVersion.value, Unversioned()); - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (currLogUidValue == logUidValue) - #line 3814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { continue; } else { - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (currVersion > currBeginVersion) - #line 3822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" nextSmallestVersion = std::min(currVersion, nextSmallestVersion); - #line 3826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } else { - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" clearLogRangesRequired = false; - #line 3832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" break; } } } } - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (endVersion.present() || backupVersions.size() != 1 || BUGGIFY) - #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!endVersion.present()) - #line 3844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->clear(backupLatestVersionsKey); - #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (backupVersions.size() == 1) - #line 3850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->clear(prefixRange(destUidValue.withPrefix(logRangesRange.begin))); - #line 3854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } } else { - #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->set(backupLatestVersionsKey, BinaryWriter::toValue(currEndVersion, Unversioned())); - #line 3861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (clearLogRangesRequired) - #line 3865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if ((nextSmallestVersion - currBeginVersion) / CLIENT_KNOBS->LOG_RANGE_BLOCK_SIZE >= std::numeric_limits::max() || BUGGIFY) - #line 3869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key baLogRangePrefix = destUidValue.withPrefix(backupLogKeys.begin); - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" for(int h = 0;h <= std::numeric_limits::max();h++) { - #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" uint64_t bv = bigEndian64(Version(0)); - #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" uint64_t ev = bigEndian64(nextSmallestVersion); - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" uint8_t h1 = h; - #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key vblockPrefix = StringRef(&h1, sizeof(uint8_t)).withPrefix(baLogRangePrefix); - #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - KeyRange range = KeyRangeRef(StringRef((uint8_t*)&bv, sizeof(uint64_t)).withPrefix(vblockPrefix), StringRef((uint8_t*)&ev, sizeof(uint64_t)).withPrefix(vblockPrefix)); - #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - tr->clear(range); - #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - if (CLIENT_KNOBS->BACKUP_AGENT_VERBOSE_LOGGING) - #line 3889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" - { - #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - TraceEvent("EraseLogDataClearLogRanges") .detail("Range", range) .detail("Begin", 0) .detail("End", nextSmallestVersion) .detail("HexRangeBegin", range.begin.toHex()) .detail("HexRangeEnd", range.end.toHex()); - #line 3893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" - } + #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + tr->clear(KeyRangeRef(StringRef((uint8_t*)&bv, sizeof(uint64_t)).withPrefix(vblockPrefix), StringRef((uint8_t*)&ev, sizeof(uint64_t)).withPrefix(vblockPrefix))); + #line 5150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } } else { - #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Standalone> ranges = getLogRanges(currBeginVersion, nextSmallestVersion, destUidValue); - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" for( auto& range : ranges ) { - #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->clear(range); - #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - if (CLIENT_KNOBS->BACKUP_AGENT_VERBOSE_LOGGING) - #line 3907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" - { - #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - TraceEvent("EraseLogDataClearLogRanges") .detail("Range", range) .detail("Begin", currBeginVersion) .detail("End", nextSmallestVersion) .detail("HexRangeBegin", range.begin.toHex()) .detail("HexRangeEnd", range.end.toHex()); - #line 3911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" - } + #line 5161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } } } } else { - #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->clear(prefixRange(backupLatestVersionsPath)); - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->clear(prefixRange(destUidValue.withPrefix(backupLogKeys.begin))); - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->clear(prefixRange(destUidValue.withPrefix(logRangesRange.begin))); - #line 3925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!endVersion.present() && backupVersions.size() == 1) - #line 3929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_2 = tr->getRange(KeyRangeRef(destUidLookupPrefix, strinc(destUidLookupPrefix)), CLIENT_KNOBS->TOO_MANY); - #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast<_eraseLogDataActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont6when1(__when_expr_2.get(), loopDepth); }; static_cast<_eraseLogDataActor*>(this)->actor_wait_state = 3; - #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_eraseLogDataActor*>(this))); - #line 3940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } else @@ -3949,9 +5198,9 @@ class _eraseLogDataActorState { } int a_body1cont1when1(RangeResult const& __backupVersions,int loopDepth) { - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" backupVersions = __backupVersions; - #line 3954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1cont6(loopDepth); return loopDepth; @@ -4016,9 +5265,9 @@ class _eraseLogDataActorState { } int a_body1cont7(int loopDepth) { - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!static_cast<_eraseLogDataActor*>(this)->SAV::futures) { (void)(Void()); this->~_eraseLogDataActorState(); static_cast<_eraseLogDataActor*>(this)->destroy(); return 0; } - #line 4021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" new (&static_cast<_eraseLogDataActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_eraseLogDataActorState(); static_cast<_eraseLogDataActor*>(this)->finishSendAndDelPromiseRef(); @@ -4026,34 +5275,34 @@ class _eraseLogDataActorState { return loopDepth; } - int a_body1cont30(RangeResult const& existingDestUidValues,int loopDepth) + int a_body1cont28(RangeResult const& existingDestUidValues,int loopDepth) { - #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" for( auto it : existingDestUidValues ) { - #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (it.value == destUidValue) - #line 4035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->clear(it.key); - #line 4039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } } loopDepth = a_body1cont7(loopDepth); return loopDepth; } - int a_body1cont30(RangeResult && existingDestUidValues,int loopDepth) + int a_body1cont28(RangeResult && existingDestUidValues,int loopDepth) { - #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" for( auto it : existingDestUidValues ) { - #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (it.value == destUidValue) - #line 4052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->clear(it.key); - #line 4056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } } loopDepth = a_body1cont7(loopDepth); @@ -4062,13 +5311,13 @@ class _eraseLogDataActorState { } int a_body1cont6when1(RangeResult const& existingDestUidValues,int loopDepth) { - loopDepth = a_body1cont30(existingDestUidValues, loopDepth); + loopDepth = a_body1cont28(existingDestUidValues, loopDepth); return loopDepth; } int a_body1cont6when1(RangeResult && existingDestUidValues,int loopDepth) { - loopDepth = a_body1cont30(std::move(existingDestUidValues), loopDepth); + loopDepth = a_body1cont28(std::move(existingDestUidValues), loopDepth); return loopDepth; } @@ -4123,36 +5372,36 @@ class _eraseLogDataActorState { fdb_probe_actor_exit("_eraseLogData", reinterpret_cast(this), 2); } - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Reference tr; - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key logUidValue; - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key destUidValue; - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Optional endVersion; - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" CheckBackupUID checkBackupUid; - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version backupUid; - #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key backupLatestVersionsPath; - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key backupLatestVersionsKey; - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" RangeResult backupVersions; - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version currBeginVersion; - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version currEndVersion; - #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version nextSmallestVersion; - #line 4150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" }; // This generated class is to be used only via _eraseLogData() - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" class _eraseLogDataActor final : public Actor, public ActorCallback< _eraseLogDataActor, 0, Optional >, public ActorCallback< _eraseLogDataActor, 1, RangeResult >, public ActorCallback< _eraseLogDataActor, 2, RangeResult >, public FastAllocated<_eraseLogDataActor>, public _eraseLogDataActorState<_eraseLogDataActor> { - #line 4155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: using FastAllocated<_eraseLogDataActor>::operator new; using FastAllocated<_eraseLogDataActor>::operator delete; @@ -4163,9 +5412,9 @@ class _eraseLogDataActor final : public Actor, public ActorCallback< _eras friend struct ActorCallback< _eraseLogDataActor, 0, Optional >; friend struct ActorCallback< _eraseLogDataActor, 1, RangeResult >; friend struct ActorCallback< _eraseLogDataActor, 2, RangeResult >; - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" _eraseLogDataActor(Reference const& tr,Key const& logUidValue,Key const& destUidValue,Optional const& endVersion,CheckBackupUID const& checkBackupUid,Version const& backupUid) - #line 4168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" : Actor(), _eraseLogDataActorState<_eraseLogDataActor>(tr, logUidValue, destUidValue, endVersion, checkBackupUid, backupUid) { @@ -4191,14 +5440,14 @@ friend struct ActorCallback< _eraseLogDataActor, 2, RangeResult >; } }; } - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" [[nodiscard]] static Future _eraseLogData( Reference const& tr, Key const& logUidValue, Key const& destUidValue, Optional const& endVersion, CheckBackupUID const& checkBackupUid, Version const& backupUid ) { - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" return Future(new _eraseLogDataActor(tr, logUidValue, destUidValue, endVersion, checkBackupUid, backupUid)); - #line 4198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } -#line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +#line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Future eraseLogData(Reference tr, Key logUidValue, @@ -4209,33 +5458,33 @@ Future eraseLogData(Reference tr, return _eraseLogData(tr, logUidValue, destUidValue, endVersion, checkBackupUid, backupUid); } - #line 4212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" namespace { // This generated class is to be used only via cleanupLogMutations() - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" template - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" class CleanupLogMutationsActorState { - #line 4219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" CleanupLogMutationsActorState(Database const& cx,Value const& destUidValue,bool const& deleteData) - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" : cx(cx), - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" destUidValue(destUidValue), - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" deleteData(deleteData), - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" backupLatestVersionsPath(destUidValue.withPrefix(backupLatestVersionsPrefix)), - #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr(new ReadYourWritesTransaction(cx)), - #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" removingLogUid(), - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" loggedLogUids() - #line 4238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { fdb_probe_actor_create("cleanupLogMutations", reinterpret_cast(this)); @@ -4248,9 +5497,9 @@ class CleanupLogMutationsActorState { int a_body1(int loopDepth=0) { try { - #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ; - #line 4253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -4279,20 +5528,20 @@ class CleanupLogMutationsActorState { int a_body1loopBody1(int loopDepth) { try { - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_0 = tr->getRange( KeyRangeRef(backupLatestVersionsPath, strinc(backupLatestVersionsPath)), CLIENT_KNOBS->TOO_MANY); - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4312,16 +5561,16 @@ class CleanupLogMutationsActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_4 = tr->onError(e); - #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4334,26 +5583,26 @@ class CleanupLogMutationsActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" readVer = tr->getReadVersion().get(); - #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" minVersion = std::numeric_limits::max(); - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" minVersionLogUid = Key(); - #line 973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" backupIdx = 0; - #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ; - #line 4347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1cont2loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1when1(RangeResult const& __backupVersions,int loopDepth) { - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" backupVersions = __backupVersions; - #line 4356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; @@ -4418,62 +5667,62 @@ class CleanupLogMutationsActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (deleteData) - #line 4423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (readVer - minVersion > CLIENT_KNOBS->MIN_CLEANUP_SECONDS * CLIENT_KNOBS->CORE_VERSIONSPERSECOND && (!removingLogUid.present() || minVersionLogUid == removingLogUid.get())) - #line 4427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" removingLogUid = minVersionLogUid; - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_2 = eraseLogData(tr, minVersionLogUid, destUidValue); - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } else { - #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (removingLogUid.present() && minVersionLogUid != removingLogUid.get()) - #line 4447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" printf("\nWARNING: The oldest tag was possibly removed, run again without `--delete-data' to " "check.\n\n"); - #line 4451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } else { - #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" printf("\nWARNING: Did not delete data because the tag is not at least %.4f hours behind. Change " "`--min-cleanup-seconds' to adjust this threshold.\n\n", CLIENT_KNOBS->MIN_CLEANUP_SECONDS / 3600.0); - #line 4457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } loopDepth = a_body1loopBody1cont5(loopDepth); } } else { - #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (readVer - minVersion > CLIENT_KNOBS->MIN_CLEANUP_SECONDS * CLIENT_KNOBS->CORE_VERSIONSPERSECOND) - #line 4466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" printf("\nPassing `--delete-data' would delete the tag that is %.4f hours behind.\n\n", (readVer - minVersion) / (3600.0 * CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); - #line 4470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } else { - #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" printf("\nPassing `--delete-data' would not delete the tag that is %.4f hours behind. Change " "`--min-cleanup-seconds' to adjust the cleanup threshold.\n\n", (readVer - minVersion) / (3600.0 * CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); - #line 4476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } loopDepth = a_body1loopBody1cont4(loopDepth); } @@ -4489,44 +5738,44 @@ class CleanupLogMutationsActorState { } int a_body1loopBody1cont2loopBody1(int loopDepth) { - #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!(backupIdx < backupVersions.size())) - #line 4494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { return a_body1loopBody1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" currVersion = BinaryReader::fromStringRef(backupVersions[backupIdx].value, Unversioned()); - #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" currLogUid = backupVersions[backupIdx].key.removePrefix(backupLatestVersionsPrefix).removePrefix(destUidValue); - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (currVersion < minVersion) - #line 4504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" minVersionLogUid = currLogUid; - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" minVersion = currVersion; - #line 4510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } - #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!loggedLogUids.count(currLogUid)) - #line 4514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" foundDRKey = tr->get(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keySourceStates) .get(currLogUid) .pack(DatabaseBackupAgent::keyStateStatus)); - #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - foundBackupKey = tr->get(Subspace(currLogUid.withPrefix(LiteralStringRef("uid->config/")) .withPrefix(fileBackupPrefixRange.begin)) .pack(LiteralStringRef("stateEnum"))); - #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + foundBackupKey = tr->get( Subspace(currLogUid.withPrefix("uid->config/"_sr).withPrefix(fileBackupPrefixRange.begin)) .pack("stateEnum"_sr)); + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_1 = success(foundDRKey) && success(foundBackupKey); - #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } else @@ -4551,99 +5800,99 @@ class CleanupLogMutationsActorState { } int a_body1loopBody1cont2loopBody1cont1(int loopDepth) { - #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" backupIdx++; - #line 4556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1cont2loopHead1(0); return loopDepth; } int a_body1loopBody1cont2loopBody1cont4(Void const& _,int loopDepth) { - #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (foundDRKey.get().present() && foundBackupKey.get().present()) - #line 4565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" printf("WARNING: Found a tag that looks like both a backup and a DR. This tag is %.4f hours " "behind.\n", (readVer - currVersion) / (3600.0 * CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); - #line 4569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } else { - #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (foundDRKey.get().present() && !foundBackupKey.get().present()) - #line 4575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" printf("Found a DR that is %.4f hours behind.\n", (readVer - currVersion) / (3600.0 * CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); - #line 4579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } else { - #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!foundDRKey.get().present() && foundBackupKey.get().present()) - #line 4585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" printf("Found a Backup that is %.4f hours behind.\n", (readVer - currVersion) / (3600.0 * CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); - #line 4589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } else { - #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" printf("WARNING: Found an unknown tag that is %.4f hours behind.\n", (readVer - currVersion) / (3600.0 * CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); - #line 4595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } } } - #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" loggedLogUids.insert(currLogUid); - #line 4601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1cont2loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1cont2loopBody1cont4(Void && _,int loopDepth) { - #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (foundDRKey.get().present() && foundBackupKey.get().present()) - #line 4610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" printf("WARNING: Found a tag that looks like both a backup and a DR. This tag is %.4f hours " "behind.\n", (readVer - currVersion) / (3600.0 * CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } else { - #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (foundDRKey.get().present() && !foundBackupKey.get().present()) - #line 4620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" printf("Found a DR that is %.4f hours behind.\n", (readVer - currVersion) / (3600.0 * CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); - #line 4624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } else { - #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!foundDRKey.get().present() && foundBackupKey.get().present()) - #line 4630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" printf("Found a Backup that is %.4f hours behind.\n", (readVer - currVersion) / (3600.0 * CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); - #line 4634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } else { - #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" printf("WARNING: Found an unknown tag that is %.4f hours behind.\n", (readVer - currVersion) / (3600.0 * CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); - #line 4640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } } } - #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" loggedLogUids.insert(currLogUid); - #line 4646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1cont2loopBody1cont1(loopDepth); return loopDepth; @@ -4713,9 +5962,9 @@ class CleanupLogMutationsActorState { } int a_body1loopBody1cont4(int loopDepth) { - #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CleanupLogMutationsActorState(); static_cast(this)->destroy(); return 0; } - #line 4718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CleanupLogMutationsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4731,32 +5980,32 @@ class CleanupLogMutationsActorState { } int a_body1loopBody1cont6(Void const& _,int loopDepth) { - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_3 = tr->commit(); - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 5992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont6(Void && _,int loopDepth) { - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_3 = tr->commit(); - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4826,18 +6075,18 @@ class CleanupLogMutationsActorState { } int a_body1loopBody1cont7(Void const& _,int loopDepth) { - #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" printf("\nSuccessfully removed the tag that was %.4f hours behind.\n\n", (readVer - minVersion) / (3600.0 * CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); - #line 4831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; } int a_body1loopBody1cont7(Void && _,int loopDepth) { - #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" printf("\nSuccessfully removed the tag that was %.4f hours behind.\n\n", (readVer - minVersion) / (3600.0 * CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); - #line 4840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; @@ -4980,44 +6229,44 @@ class CleanupLogMutationsActorState { fdb_probe_actor_exit("cleanupLogMutations", reinterpret_cast(this), 4); } - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Database cx; - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Value destUidValue; - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" bool deleteData; - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key backupLatestVersionsPath; - #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Reference tr; - #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Optional removingLogUid; - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" std::set loggedLogUids; - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" RangeResult backupVersions; - #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version readVer; - #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version minVersion; - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key minVersionLogUid; - #line 973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" int backupIdx; - #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Version currVersion; - #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Key currLogUid; - #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Future> foundDRKey; - #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Future> foundBackupKey; - #line 5015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" }; // This generated class is to be used only via cleanupLogMutations() - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" class CleanupLogMutationsActor final : public Actor, public ActorCallback< CleanupLogMutationsActor, 0, RangeResult >, public ActorCallback< CleanupLogMutationsActor, 1, Void >, public ActorCallback< CleanupLogMutationsActor, 2, Void >, public ActorCallback< CleanupLogMutationsActor, 3, Void >, public ActorCallback< CleanupLogMutationsActor, 4, Void >, public FastAllocated, public CleanupLogMutationsActorState { - #line 5020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5030,9 +6279,9 @@ friend struct ActorCallback< CleanupLogMutationsActor, 1, Void >; friend struct ActorCallback< CleanupLogMutationsActor, 2, Void >; friend struct ActorCallback< CleanupLogMutationsActor, 3, Void >; friend struct ActorCallback< CleanupLogMutationsActor, 4, Void >; - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" CleanupLogMutationsActor(Database const& cx,Value const& destUidValue,bool const& deleteData) - #line 5035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" : Actor(), CleanupLogMutationsActorState(cx, destUidValue, deleteData) { @@ -5060,34 +6309,34 @@ friend struct ActorCallback< CleanupLogMutationsActor, 4, Void >; } }; } - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" [[nodiscard]] Future cleanupLogMutations( Database const& cx, Value const& destUidValue, bool const& deleteData ) { - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" return Future(new CleanupLogMutationsActor(cx, destUidValue, deleteData)); - #line 5067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } -#line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +#line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - #line 5072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" namespace { // This generated class is to be used only via cleanupBackup() - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" template - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" class CleanupBackupActorState { - #line 5079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" CleanupBackupActorState(Database const& cx,DeleteData const& deleteData) - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" : cx(cx), - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" deleteData(deleteData), - #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr(new ReadYourWritesTransaction(cx)) - #line 5090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { fdb_probe_actor_create("cleanupBackup", reinterpret_cast(this)); @@ -5100,9 +6349,9 @@ class CleanupBackupActorState { int a_body1(int loopDepth=0) { try { - #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ; - #line 5105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -5131,20 +6380,20 @@ class CleanupBackupActorState { int a_body1loopBody1(int loopDepth) { try { - #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_0 = tr->getRange(KeyRangeRef(destUidLookupPrefix, strinc(destUidLookupPrefix)), CLIENT_KNOBS->TOO_MANY); - #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 5142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5164,16 +6413,16 @@ class CleanupBackupActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_2 = tr->onError(e); - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5186,18 +6435,18 @@ class CleanupBackupActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" RangeForbody1loopBody1cont2Iterator0 = std::begin(destUids); - #line 5191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1cont2loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1when1(RangeResult const& __destUids,int loopDepth) { - #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" destUids = __destUids; - #line 5200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; @@ -5262,9 +6511,9 @@ class CleanupBackupActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 1059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CleanupBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 5267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CleanupBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5281,26 +6530,26 @@ class CleanupBackupActorState { } int a_body1loopBody1cont2loopBody1(int loopDepth) { - #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (!(RangeForbody1loopBody1cont2Iterator0 != std::end(destUids))) - #line 5286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { return a_body1loopBody1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" auto destUid = *RangeForbody1loopBody1cont2Iterator0; - #line 5292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" { - #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" StrictFuture __when_expr_1 = cleanupLogMutations(cx, destUid.value, deleteData); - #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" loopDepth = 0; } @@ -5321,9 +6570,9 @@ class CleanupBackupActorState { } int a_body1loopBody1cont2loopBody1cont1(int loopDepth) { - #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" ++RangeForbody1loopBody1cont2Iterator0; - #line 5326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1cont2loopHead1(0); return loopDepth; @@ -5478,22 +6727,22 @@ class CleanupBackupActorState { fdb_probe_actor_exit("cleanupBackup", reinterpret_cast(this), 2); } - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Database cx; - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" DeleteData deleteData; - #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" Reference tr; - #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" RangeResult destUids; - #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" decltype(std::begin(std::declval())) RangeForbody1loopBody1cont2Iterator0; - #line 5491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" }; // This generated class is to be used only via cleanupBackup() - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" class CleanupBackupActor final : public Actor, public ActorCallback< CleanupBackupActor, 0, RangeResult >, public ActorCallback< CleanupBackupActor, 1, Void >, public ActorCallback< CleanupBackupActor, 2, Void >, public FastAllocated, public CleanupBackupActorState { - #line 5496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5504,9 +6753,9 @@ class CleanupBackupActor final : public Actor, public ActorCallback< Clean friend struct ActorCallback< CleanupBackupActor, 0, RangeResult >; friend struct ActorCallback< CleanupBackupActor, 1, Void >; friend struct ActorCallback< CleanupBackupActor, 2, Void >; - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" CleanupBackupActor(Database const& cx,DeleteData const& deleteData) - #line 5509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" : Actor(), CleanupBackupActorState(cx, deleteData) { @@ -5532,14 +6781,14 @@ friend struct ActorCallback< CleanupBackupActor, 2, Void >; } }; } - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" [[nodiscard]] Future cleanupBackup( Database const& cx, DeleteData const& deleteData ) { - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" return Future(new CleanupBackupActor(cx, deleteData)); - #line 5539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" + #line 6788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.g.cpp" } -#line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" +#line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgentBase.actor.cpp" // Convert the status text to an enumerated value BackupAgentBase::EnumState BackupAgentBase::getState(std::string const& stateText) { @@ -5661,3 +6910,40 @@ Standalone BackupAgentBase::getCurrentTime() { } std::string const BackupAgentBase::defaultTagName = "default"; + +void addDefaultBackupRanges(Standalone>& backupKeys) { + backupKeys.push_back_deep(backupKeys.arena(), normalKeys); + + for (auto& r : getSystemBackupRanges()) { + backupKeys.push_back_deep(backupKeys.arena(), r); + } +} + +VectorRef const& getSystemBackupRanges() { + static Standalone> systemBackupRanges; + if (systemBackupRanges.empty()) { + systemBackupRanges.push_back_deep(systemBackupRanges.arena(), prefixRange(TenantMetadata::subspace())); + systemBackupRanges.push_back_deep(systemBackupRanges.arena(), + singleKeyRange(metacluster::metadata::metaclusterRegistration().key)); + systemBackupRanges.push_back_deep(systemBackupRanges.arena(), tagQuotaKeys); + systemBackupRanges.push_back_deep(systemBackupRanges.arena(), blobRangeKeys); + } + + return systemBackupRanges; +} + +KeyRangeMap const& systemBackupMutationMask() { + static KeyRangeMap mask; + if (mask.size() == 1) { + for (auto r : getSystemBackupRanges()) { + mask.insert(r, true); + } + } + + return mask; +} + +KeyRangeRef const& getDefaultBackupSharedRange() { + static KeyRangeRef defaultSharedRange(""_sr, ""_sr); + return defaultSharedRange; +} diff --git a/src/fdbclient/BackupContainer.actor.cpp b/src/fdbclient/BackupContainer.actor.cpp index f0fc8a0..48b8a15 100644 --- a/src/fdbclient/BackupContainer.actor.cpp +++ b/src/fdbclient/BackupContainer.actor.cpp @@ -37,15 +37,17 @@ #include "fdbrpc/simulator.h" #include "flow/Platform.h" #include "fdbclient/AsyncFileS3BlobStore.actor.h" +#ifdef BUILD_AZURE_BACKUP #include "fdbclient/BackupContainerAzureBlobStore.h" +#endif #include "fdbclient/BackupContainerFileSystem.h" #include "fdbclient/BackupContainerLocalDirectory.h" #include "fdbclient/BackupContainerS3BlobStore.h" #include "fdbclient/Status.h" #include "fdbclient/SystemData.h" #include "fdbclient/ReadYourWrites.h" -#include "fdbclient/KeyBackedTypes.h" -#include "fdbclient/RunTransaction.actor.h" +#include "fdbclient/KeyBackedTypes.actor.h" +#include "fdbclient/RunRYWTransaction.actor.h" #include #include #include @@ -290,16 +292,51 @@ Reference IBackupContainer::openContainer(const std::string& u for (auto c : resource) if (!isalnum(c) && c != '_' && c != '-' && c != '.' && c != '/') throw backup_invalid_url(); - r = makeReference(bstore, resource, backupParams, encryptionKeyFileName); + r = makeReference(bstore, resource, backupParams, encryptionKeyFileName, true); } #ifdef BUILD_AZURE_BACKUP else if (u.startsWith("azure://"_sr)) { u.eat("azure://"_sr); - auto accountName = u.eat("@"_sr).toString(); - auto endpoint = u.eat("/"_sr).toString(); - auto containerName = u.eat("/"_sr).toString(); - r = makeReference( - endpoint, accountName, containerName, encryptionKeyFileName); + auto address = u.eat("/"_sr); + if (address.endsWith(std::string(azure::storage_lite::constants::default_endpoint_suffix))) { + CODE_PROBE(true, "Azure backup url with standard azure storage account endpoint"); + // ..core.windows.net/ + auto endPoint = address.toString(); + auto accountName = address.eat("."_sr).toString(); + auto containerName = u.eat("/"_sr).toString(); + r = makeReference( + endPoint, accountName, containerName, encryptionKeyFileName); + } else { + // resolve the network address if necessary + std::string endpoint(address.toString()); + Optional parsedAddress = NetworkAddress::parseOptional(endpoint); + if (!parsedAddress.present()) { + try { + auto hostname = Hostname::parse(endpoint); + auto resolvedAddress = hostname.resolveBlocking(); + if (resolvedAddress.present()) { + CODE_PROBE(true, "Azure backup url with hostname in the endpoint"); + parsedAddress = resolvedAddress.get(); + } + } catch (Error& e) { + TraceEvent(SevError, "InvalidAzureBackupUrl").error(e).detail("Endpoint", endpoint); + throw backup_invalid_url(); + } + } + if (!parsedAddress.present()) { + TraceEvent(SevError, "InvalidAzureBackupUrl").detail("Endpoint", endpoint); + throw backup_invalid_url(); + } + auto accountName = u.eat("/"_sr).toString(); + // Avoid including ":tls" and "(fromHostname)" + // note: the endpoint needs to contain the account name + // so either ".blob.core.windows.net" or ":/" + endpoint = + fmt::format("{}/{}", formatIpPort(parsedAddress.get().ip, parsedAddress.get().port), accountName); + auto containerName = u.eat("/"_sr).toString(); + r = makeReference( + endpoint, accountName, containerName, encryptionKeyFileName); + } } #endif else { @@ -348,7 +385,7 @@ ACTOR Future> listContainers_impl(std::string baseURL, } // Create a dummy container to parse the backup-specific parameters from the URL and get a final bucket name - BackupContainerS3BlobStore dummy(bstore, "dummy", backupParams, {}); + BackupContainerS3BlobStore dummy(bstore, "dummy", backupParams, {}, true); std::vector results = wait(BackupContainerS3BlobStore::listURLs(bstore, dummy.getBucket())); return results; @@ -400,21 +437,21 @@ ACTOR Future timeKeeperVersionFromDatetime(std::string datetime, Databa try { tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr->setOption(FDBTransactionOptions::LOCK_AWARE); - state std::vector> results = + state KeyBackedRangeResult> rangeResult = wait(versionMap.getRange(tr, 0, time, 1, Snapshot::False, Reverse::True)); - if (results.size() != 1) { + if (rangeResult.results.size() != 1) { // No key less than time was found in the database // Look for a key >= time. - wait(store(results, versionMap.getRange(tr, time, std::numeric_limits::max(), 1))); + wait(store(rangeResult, versionMap.getRange(tr, time, std::numeric_limits::max(), 1))); - if (results.size() != 1) { + if (rangeResult.results.size() != 1) { fprintf(stderr, "ERROR: Unable to calculate a version for given date/time.\n"); throw backup_error(); } } // Adjust version found by the delta between time and the time found and min with 0. - auto& result = results[0]; + auto& result = rangeResult.results[0]; return std::max(0, result.second + (time - result.first) * CLIENT_KNOBS->CORE_VERSIONSPERSECOND); } catch (Error& e) { @@ -439,21 +476,21 @@ ACTOR Future> timeKeeperEpochsFromVersion(Version v, Reference mid = (min + max + 1) / 2; // ceiling // Find the highest time < mid - state std::vector> results = + state KeyBackedRangeResult> rangeResult = wait(versionMap.getRange(tr, min, mid, 1, Snapshot::False, Reverse::True)); - if (results.size() != 1) { + if (rangeResult.results.size() != 1) { if (mid == min) { // There aren't any records having a version < v, so just look for any record having a time < now // and base a result on it - wait(store(results, versionMap.getRange(tr, 0, (int64_t)now(), 1))); + wait(store(rangeResult, versionMap.getRange(tr, 0, (int64_t)now(), 1))); - if (results.size() != 1) { + if (rangeResult.results.size() != 1) { // There aren't any timekeeper records to base a result on so return nothing return Optional(); } - found = results[0]; + found = rangeResult.results[0]; break; } @@ -461,7 +498,7 @@ ACTOR Future> timeKeeperEpochsFromVersion(Version v, Reference continue; } - found = results[0]; + found = rangeResult.results[0]; if (v < found.second) { max = found.first; diff --git a/src/fdbclient/BackupContainer.actor.g.cpp b/src/fdbclient/BackupContainer.actor.g.cpp index 2590628..4e02b3c 100644 --- a/src/fdbclient/BackupContainer.actor.g.cpp +++ b/src/fdbclient/BackupContainer.actor.g.cpp @@ -39,15 +39,17 @@ #include "fdbrpc/simulator.h" #include "flow/Platform.h" #include "fdbclient/AsyncFileS3BlobStore.actor.h" +#ifdef BUILD_AZURE_BACKUP #include "fdbclient/BackupContainerAzureBlobStore.h" +#endif #include "fdbclient/BackupContainerFileSystem.h" #include "fdbclient/BackupContainerLocalDirectory.h" #include "fdbclient/BackupContainerS3BlobStore.h" #include "fdbclient/Status.h" #include "fdbclient/SystemData.h" #include "fdbclient/ReadYourWrites.h" -#include "fdbclient/KeyBackedTypes.h" -#include "fdbclient/RunTransaction.actor.h" +#include "fdbclient/KeyBackedTypes.actor.h" +#include "fdbclient/RunRYWTransaction.actor.h" #include #include #include @@ -55,24 +57,24 @@ namespace IBackupFile_impl { - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" // This generated class is to be used only via appendStringRefWithLen() - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" template - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" class AppendStringRefWithLenActorState { - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" public: - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" AppendStringRefWithLenActorState(Reference const& file,Standalone const& s) - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" : file(file), - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" s(s), - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" lenBuf(bigEndian32((uint32_t)s.size())) - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { fdb_probe_actor_create("appendStringRefWithLen", reinterpret_cast(this)); @@ -85,16 +87,16 @@ class AppendStringRefWithLenActorState { int a_body1(int loopDepth=0) { try { - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" StrictFuture __when_expr_0 = file->append(&lenBuf, sizeof(lenBuf)); - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -115,32 +117,32 @@ class AppendStringRefWithLenActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" StrictFuture __when_expr_1 = file->append(s.begin(), s.size()); - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" StrictFuture __when_expr_1 = file->append(s.begin(), s.size()); - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -210,9 +212,9 @@ class AppendStringRefWithLenActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AppendStringRefWithLenActorState(); static_cast(this)->destroy(); return 0; } - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AppendStringRefWithLenActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -222,9 +224,9 @@ class AppendStringRefWithLenActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AppendStringRefWithLenActorState(); static_cast(this)->destroy(); return 0; } - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AppendStringRefWithLenActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -295,18 +297,18 @@ class AppendStringRefWithLenActorState { fdb_probe_actor_exit("appendStringRefWithLen", reinterpret_cast(this), 1); } - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" Reference file; - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" Standalone s; - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" uint32_t lenBuf; - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" }; // This generated class is to be used only via appendStringRefWithLen() - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" class AppendStringRefWithLenActor final : public Actor, public ActorCallback< AppendStringRefWithLenActor, 0, Void >, public ActorCallback< AppendStringRefWithLenActor, 1, Void >, public FastAllocated, public AppendStringRefWithLenActorState { - #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -316,9 +318,9 @@ class AppendStringRefWithLenActor final : public Actor, public ActorCallba #pragma clang diagnostic pop friend struct ActorCallback< AppendStringRefWithLenActor, 0, Void >; friend struct ActorCallback< AppendStringRefWithLenActor, 1, Void >; - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" AppendStringRefWithLenActor(Reference const& file,Standalone const& s) - #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" : Actor(), AppendStringRefWithLenActorState(file, s) { @@ -342,14 +344,14 @@ friend struct ActorCallback< AppendStringRefWithLenActor, 1, Void >; } }; - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" [[nodiscard]] Future appendStringRefWithLen( Reference const& file, Standalone const& s ) { - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" return Future(new AppendStringRefWithLenActor(file, s)); - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" } -#line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" +#line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" } // namespace IBackupFile_impl @@ -581,16 +583,51 @@ Reference IBackupContainer::openContainer(const std::string& u for (auto c : resource) if (!isalnum(c) && c != '_' && c != '-' && c != '.' && c != '/') throw backup_invalid_url(); - r = makeReference(bstore, resource, backupParams, encryptionKeyFileName); + r = makeReference(bstore, resource, backupParams, encryptionKeyFileName, true); } #ifdef BUILD_AZURE_BACKUP else if (u.startsWith("azure://"_sr)) { u.eat("azure://"_sr); - auto accountName = u.eat("@"_sr).toString(); - auto endpoint = u.eat("/"_sr).toString(); - auto containerName = u.eat("/"_sr).toString(); - r = makeReference( - endpoint, accountName, containerName, encryptionKeyFileName); + auto address = u.eat("/"_sr); + if (address.endsWith(std::string(azure::storage_lite::constants::default_endpoint_suffix))) { + CODE_PROBE(true, "Azure backup url with standard azure storage account endpoint"); + // ..core.windows.net/ + auto endPoint = address.toString(); + auto accountName = address.eat("."_sr).toString(); + auto containerName = u.eat("/"_sr).toString(); + r = makeReference( + endPoint, accountName, containerName, encryptionKeyFileName); + } else { + // resolve the network address if necessary + std::string endpoint(address.toString()); + Optional parsedAddress = NetworkAddress::parseOptional(endpoint); + if (!parsedAddress.present()) { + try { + auto hostname = Hostname::parse(endpoint); + auto resolvedAddress = hostname.resolveBlocking(); + if (resolvedAddress.present()) { + CODE_PROBE(true, "Azure backup url with hostname in the endpoint"); + parsedAddress = resolvedAddress.get(); + } + } catch (Error& e) { + TraceEvent(SevError, "InvalidAzureBackupUrl").error(e).detail("Endpoint", endpoint); + throw backup_invalid_url(); + } + } + if (!parsedAddress.present()) { + TraceEvent(SevError, "InvalidAzureBackupUrl").detail("Endpoint", endpoint); + throw backup_invalid_url(); + } + auto accountName = u.eat("/"_sr).toString(); + // Avoid including ":tls" and "(fromHostname)" + // note: the endpoint needs to contain the account name + // so either ".blob.core.windows.net" or ":/" + endpoint = + fmt::format("{}/{}", formatIpPort(parsedAddress.get().ip, parsedAddress.get().port), accountName); + auto containerName = u.eat("/"_sr).toString(); + r = makeReference( + endpoint, accountName, containerName, encryptionKeyFileName); + } } #endif else { @@ -618,23 +655,23 @@ Reference IBackupContainer::openContainer(const std::string& u // Get a list of URLS to backup containers based on some a shorter URL. This function knows about some set of supported // URL types which support this sort of backup discovery. - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" namespace { // This generated class is to be used only via listContainers_impl() - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" template - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" class ListContainers_implActorState { - #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" public: - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" ListContainers_implActorState(std::string const& baseURL,Optional const& proxy) - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" : baseURL(baseURL), - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" proxy(proxy) - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { fdb_probe_actor_create("listContainers_impl", reinterpret_cast(this)); @@ -648,67 +685,67 @@ class ListContainers_implActorState { { try { try { - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" StringRef u(baseURL); - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (u.startsWith("file://"_sr)) - #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" StrictFuture> __when_expr_0 = BackupContainerLocalDirectory::listURLs(baseURL); - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" loopDepth = 0; } else { - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (u.startsWith("blobstore://"_sr)) - #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" std::string resource; - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" S3BlobStoreEndpoint::ParametersT backupParams; - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" Reference bstore = S3BlobStoreEndpoint::fromString( baseURL, proxy, &resource, &IBackupContainer::lastOpenError, &backupParams); - #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (!resource.empty()) - #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" TraceEvent(SevWarn, "BackupContainer") .detail("Description", "Invalid backup container base URL, resource aka path should be blank.") .detail("URL", baseURL); - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" return a_body1Catch2(backup_invalid_url(), loopDepth); - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" } - #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - BackupContainerS3BlobStore dummy(bstore, "dummy", backupParams, {}); - #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + BackupContainerS3BlobStore dummy(bstore, "dummy", backupParams, {}, true); + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" StrictFuture> __when_expr_1 = BackupContainerS3BlobStore::listURLs(bstore, dummy.getBucket()); - #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" loopDepth = 0; } else { - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" IBackupContainer::lastOpenError = "invalid URL prefix"; - #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" return a_body1Catch2(backup_invalid_url(), loopDepth); - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" } } } @@ -737,33 +774,33 @@ class ListContainers_implActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (e.code() == error_code_actor_cancelled) - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" } - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" TraceEvent m(SevWarn, "BackupContainer"); - #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" m.error(e); - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" m.detail("Description", "Invalid backup container URL prefix. See help."); - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" m.detail("URL", baseURL); - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (e.code() == error_code_backup_invalid_url) - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" m.detail("LastOpenError", IBackupContainer::lastOpenError); - #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" } - #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -775,9 +812,9 @@ class ListContainers_implActorState { } int a_body1cont3(std::vector const& results,int loopDepth) { - #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~ListContainers_implActorState(); static_cast(this)->destroy(); return 0; } - #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); this->~ListContainers_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -787,9 +824,9 @@ class ListContainers_implActorState { } int a_body1cont3(std::vector && results,int loopDepth) { - #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~ListContainers_implActorState(); static_cast(this)->destroy(); return 0; } - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); this->~ListContainers_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -862,9 +899,9 @@ class ListContainers_implActorState { } int a_body1cont6(std::vector const& results,int loopDepth) { - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~ListContainers_implActorState(); static_cast(this)->destroy(); return 0; } - #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); this->~ListContainers_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -874,9 +911,9 @@ class ListContainers_implActorState { } int a_body1cont6(std::vector && results,int loopDepth) { - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~ListContainers_implActorState(); static_cast(this)->destroy(); return 0; } - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); this->~ListContainers_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -947,16 +984,16 @@ class ListContainers_implActorState { fdb_probe_actor_exit("listContainers_impl", reinterpret_cast(this), 1); } - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" std::string baseURL; - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" Optional proxy; - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" }; // This generated class is to be used only via listContainers_impl() - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" class ListContainers_implActor final : public Actor>, public ActorCallback< ListContainers_implActor, 0, std::vector >, public ActorCallback< ListContainers_implActor, 1, std::vector >, public FastAllocated, public ListContainers_implActorState { - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -966,9 +1003,9 @@ class ListContainers_implActor final : public Actor>, p #pragma clang diagnostic pop friend struct ActorCallback< ListContainers_implActor, 0, std::vector >; friend struct ActorCallback< ListContainers_implActor, 1, std::vector >; - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" ListContainers_implActor(std::string const& baseURL,Optional const& proxy) - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" : Actor>(), ListContainers_implActorState(baseURL, proxy) { @@ -993,43 +1030,43 @@ friend struct ActorCallback< ListContainers_implActor, 1, std::vector> listContainers_impl( std::string const& baseURL, Optional const& proxy ) { - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" return Future>(new ListContainers_implActor(baseURL, proxy)); - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" } -#line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" +#line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" Future> IBackupContainer::listContainers(const std::string& baseURL, const Optional& proxy) { return listContainers_impl(baseURL, proxy); } - #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" namespace { // This generated class is to be used only via timeKeeperVersionFromDatetime() - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" template - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" class TimeKeeperVersionFromDatetimeActorState { - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" public: - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" TimeKeeperVersionFromDatetimeActorState(std::string const& datetime,Database const& db) - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" : datetime(datetime), - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" db(db), - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" versionMap(timeKeeperPrefixRange.begin), - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" tr(makeReference(db)), - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" time(BackupAgentBase::parseTime(datetime)) - #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { fdb_probe_actor_create("timeKeeperVersionFromDatetime", reinterpret_cast(this)); @@ -1042,19 +1079,19 @@ class TimeKeeperVersionFromDatetimeActorState { int a_body1(int loopDepth=0) { try { - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (time < 0) - #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" fprintf( stderr, "ERROR: Incorrect date/time or format. Format is %s.\n", BackupAgentBase::timeFormat().c_str()); - #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" return a_body1Catch1(backup_error(), loopDepth); - #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" } - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" ; - #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1083,20 +1120,20 @@ class TimeKeeperVersionFromDatetimeActorState { int a_body1loopBody1(int loopDepth) { try { - #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - StrictFuture>> __when_expr_0 = versionMap.getRange(tr, 0, time, 1, Snapshot::False, Reverse::True); - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + StrictFuture>> __when_expr_0 = versionMap.getRange(tr, 0, time, 1, Snapshot::False, Reverse::True); + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); - #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 1136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1116,16 +1153,16 @@ class TimeKeeperVersionFromDatetimeActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" StrictFuture __when_expr_2 = tr->onError(e); - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1138,20 +1175,20 @@ class TimeKeeperVersionFromDatetimeActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - if (results.size() != 1) - #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + if (rangeResult.results.size() != 1) + #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - StrictFuture __when_expr_1 = store(results, versionMap.getRange(tr, time, std::numeric_limits::max(), 1)); - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + StrictFuture __when_expr_1 = store(rangeResult, versionMap.getRange(tr, time, std::numeric_limits::max(), 1)); + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" loopDepth = 0; } else @@ -1161,18 +1198,18 @@ class TimeKeeperVersionFromDatetimeActorState { return loopDepth; } - int a_body1loopBody1when1(std::vector> const& __results,int loopDepth) + int a_body1loopBody1when1(KeyBackedRangeResult> const& __rangeResult,int loopDepth) { - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - results = __results; - #line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + rangeResult = __rangeResult; + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } - int a_body1loopBody1when1(std::vector> && __results,int loopDepth) + int a_body1loopBody1when1(KeyBackedRangeResult> && __rangeResult,int loopDepth) { - results = std::move(__results); + rangeResult = std::move(__rangeResult); loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; @@ -1180,10 +1217,10 @@ class TimeKeeperVersionFromDatetimeActorState { void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TimeKeeperVersionFromDatetimeActor, 0, std::vector> >::remove(); + static_cast(this)->ActorCallback< TimeKeeperVersionFromDatetimeActor, 0, KeyBackedRangeResult> >::remove(); } - void a_callback_fire(ActorCallback< TimeKeeperVersionFromDatetimeActor, 0, std::vector> >*,std::vector> const& value) + void a_callback_fire(ActorCallback< TimeKeeperVersionFromDatetimeActor, 0, KeyBackedRangeResult> >*,KeyBackedRangeResult> const& value) { fdb_probe_actor_enter("timeKeeperVersionFromDatetime", reinterpret_cast(this), 0); a_exitChoose1(); @@ -1198,7 +1235,7 @@ class TimeKeeperVersionFromDatetimeActorState { fdb_probe_actor_exit("timeKeeperVersionFromDatetime", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< TimeKeeperVersionFromDatetimeActor, 0, std::vector> >*,std::vector> && value) + void a_callback_fire(ActorCallback< TimeKeeperVersionFromDatetimeActor, 0, KeyBackedRangeResult> >*,KeyBackedRangeResult> && value) { fdb_probe_actor_enter("timeKeeperVersionFromDatetime", reinterpret_cast(this), 0); a_exitChoose1(); @@ -1213,7 +1250,7 @@ class TimeKeeperVersionFromDatetimeActorState { fdb_probe_actor_exit("timeKeeperVersionFromDatetime", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< TimeKeeperVersionFromDatetimeActor, 0, std::vector> >*,Error err) + void a_callback_error(ActorCallback< TimeKeeperVersionFromDatetimeActor, 0, KeyBackedRangeResult> >*,Error err) { fdb_probe_actor_enter("timeKeeperVersionFromDatetime", reinterpret_cast(this), 0); a_exitChoose1(); @@ -1230,11 +1267,11 @@ class TimeKeeperVersionFromDatetimeActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - auto& result = results[0]; - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + auto& result = rangeResult.results[0]; + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(std::max(0, result.second + (time - result.first) * CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); this->~TimeKeeperVersionFromDatetimeActorState(); static_cast(this)->destroy(); return 0; } - #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" new (&static_cast(this)->SAV< Version >::value()) Version(std::max(0, result.second + (time - result.first) * CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); this->~TimeKeeperVersionFromDatetimeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1244,15 +1281,15 @@ class TimeKeeperVersionFromDatetimeActorState { } int a_body1loopBody1cont4(Void const& _,int loopDepth) { - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - if (results.size() != 1) - #line 1249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + if (rangeResult.results.size() != 1) + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" fprintf(stderr, "ERROR: Unable to calculate a version for given date/time.\n"); - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" return a_body1loopBody1Catch1(backup_error(), loopDepth); - #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" } loopDepth = a_body1loopBody1cont3(loopDepth); @@ -1260,15 +1297,15 @@ class TimeKeeperVersionFromDatetimeActorState { } int a_body1loopBody1cont4(Void && _,int loopDepth) { - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - if (results.size() != 1) - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + if (rangeResult.results.size() != 1) + #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" fprintf(stderr, "ERROR: Unable to calculate a version for given date/time.\n"); - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" return a_body1loopBody1Catch1(backup_error(), loopDepth); - #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" } loopDepth = a_body1loopBody1cont3(loopDepth); @@ -1412,24 +1449,24 @@ class TimeKeeperVersionFromDatetimeActorState { fdb_probe_actor_exit("timeKeeperVersionFromDatetime", reinterpret_cast(this), 2); } - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" std::string datetime; - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" Database db; - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" KeyBackedMap versionMap; - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" Reference tr; - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" int64_t time; - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - std::vector> results; - #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + KeyBackedRangeResult> rangeResult; + #line 1464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" }; // This generated class is to be used only via timeKeeperVersionFromDatetime() - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" -class TimeKeeperVersionFromDatetimeActor final : public Actor, public ActorCallback< TimeKeeperVersionFromDatetimeActor, 0, std::vector> >, public ActorCallback< TimeKeeperVersionFromDatetimeActor, 1, Void >, public ActorCallback< TimeKeeperVersionFromDatetimeActor, 2, Void >, public FastAllocated, public TimeKeeperVersionFromDatetimeActorState { - #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" +class TimeKeeperVersionFromDatetimeActor final : public Actor, public ActorCallback< TimeKeeperVersionFromDatetimeActor, 0, KeyBackedRangeResult> >, public ActorCallback< TimeKeeperVersionFromDatetimeActor, 1, Void >, public ActorCallback< TimeKeeperVersionFromDatetimeActor, 2, Void >, public FastAllocated, public TimeKeeperVersionFromDatetimeActorState { + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1437,12 +1474,12 @@ class TimeKeeperVersionFromDatetimeActor final : public Actor, public A #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< TimeKeeperVersionFromDatetimeActor, 0, std::vector> >; +friend struct ActorCallback< TimeKeeperVersionFromDatetimeActor, 0, KeyBackedRangeResult> >; friend struct ActorCallback< TimeKeeperVersionFromDatetimeActor, 1, Void >; friend struct ActorCallback< TimeKeeperVersionFromDatetimeActor, 2, Void >; - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" TimeKeeperVersionFromDatetimeActor(std::string const& datetime,Database const& db) - #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" : Actor(), TimeKeeperVersionFromDatetimeActorState(datetime, db) { @@ -1460,7 +1497,7 @@ friend struct ActorCallback< TimeKeeperVersionFromDatetimeActor, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< TimeKeeperVersionFromDatetimeActor, 0, std::vector> >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< TimeKeeperVersionFromDatetimeActor, 0, KeyBackedRangeResult> >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< TimeKeeperVersionFromDatetimeActor, 1, Void >*)0, actor_cancelled()); break; case 3: this->a_callback_error((ActorCallback< TimeKeeperVersionFromDatetimeActor, 2, Void >*)0, actor_cancelled()); break; } @@ -1468,42 +1505,42 @@ friend struct ActorCallback< TimeKeeperVersionFromDatetimeActor, 2, Void >; } }; } - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" [[nodiscard]] Future timeKeeperVersionFromDatetime( std::string const& datetime, Database const& db ) { - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" return Future(new TimeKeeperVersionFromDatetimeActor(datetime, db)); - #line 1475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" } -#line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" +#line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" namespace { // This generated class is to be used only via timeKeeperEpochsFromVersion() - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" template - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" class TimeKeeperEpochsFromVersionActorState { - #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" public: - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" TimeKeeperEpochsFromVersionActorState(Version const& v,Reference const& tr) - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" : v(v), - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" tr(tr), - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" versionMap(timeKeeperPrefixRange.begin), - #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" min(0), - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" max((int64_t)now()), - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" mid(), - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" found() - #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { fdb_probe_actor_create("timeKeeperEpochsFromVersion", reinterpret_cast(this)); @@ -1516,13 +1553,13 @@ class TimeKeeperEpochsFromVersionActorState { int a_body1(int loopDepth=0) { try { - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" ; - #line 1525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1543,9 +1580,9 @@ class TimeKeeperEpochsFromVersionActorState { } int a_body1cont1(int loopDepth) { - #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(found.first + (v - found.second) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); this->~TimeKeeperEpochsFromVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(found.first + (v - found.second) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); this->~TimeKeeperEpochsFromVersionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1562,18 +1599,18 @@ class TimeKeeperEpochsFromVersionActorState { } int a_body1loopBody1(int loopDepth) { - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" mid = (min + max + 1) / 2; - #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - StrictFuture>> __when_expr_0 = versionMap.getRange(tr, min, mid, 1, Snapshot::False, Reverse::True); - #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + StrictFuture>> __when_expr_0 = versionMap.getRange(tr, min, mid, 1, Snapshot::False, Reverse::True); + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 1613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1593,24 +1630,24 @@ class TimeKeeperEpochsFromVersionActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - if (results.size() != 1) - #line 1598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + if (rangeResult.results.size() != 1) + #line 1635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (mid == min) - #line 1602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - StrictFuture __when_expr_1 = store(results, versionMap.getRange(tr, 0, (int64_t)now(), 1)); - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + StrictFuture __when_expr_1 = store(rangeResult, versionMap.getRange(tr, 0, (int64_t)now(), 1)); + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" loopDepth = 0; } else @@ -1625,18 +1662,18 @@ class TimeKeeperEpochsFromVersionActorState { return loopDepth; } - int a_body1loopBody1when1(std::vector> const& __results,int loopDepth) + int a_body1loopBody1when1(KeyBackedRangeResult> const& __rangeResult,int loopDepth) { - #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - results = __results; - #line 1632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + rangeResult = __rangeResult; + #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1when1(std::vector> && __results,int loopDepth) + int a_body1loopBody1when1(KeyBackedRangeResult> && __rangeResult,int loopDepth) { - results = std::move(__results); + rangeResult = std::move(__rangeResult); loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -1644,10 +1681,10 @@ class TimeKeeperEpochsFromVersionActorState { void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TimeKeeperEpochsFromVersionActor, 0, std::vector> >::remove(); + static_cast(this)->ActorCallback< TimeKeeperEpochsFromVersionActor, 0, KeyBackedRangeResult> >::remove(); } - void a_callback_fire(ActorCallback< TimeKeeperEpochsFromVersionActor, 0, std::vector> >*,std::vector> const& value) + void a_callback_fire(ActorCallback< TimeKeeperEpochsFromVersionActor, 0, KeyBackedRangeResult> >*,KeyBackedRangeResult> const& value) { fdb_probe_actor_enter("timeKeeperEpochsFromVersion", reinterpret_cast(this), 0); a_exitChoose1(); @@ -1662,7 +1699,7 @@ class TimeKeeperEpochsFromVersionActorState { fdb_probe_actor_exit("timeKeeperEpochsFromVersion", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< TimeKeeperEpochsFromVersionActor, 0, std::vector> >*,std::vector> && value) + void a_callback_fire(ActorCallback< TimeKeeperEpochsFromVersionActor, 0, KeyBackedRangeResult> >*,KeyBackedRangeResult> && value) { fdb_probe_actor_enter("timeKeeperEpochsFromVersion", reinterpret_cast(this), 0); a_exitChoose1(); @@ -1677,7 +1714,7 @@ class TimeKeeperEpochsFromVersionActorState { fdb_probe_actor_exit("timeKeeperEpochsFromVersion", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< TimeKeeperEpochsFromVersionActor, 0, std::vector> >*,Error err) + void a_callback_error(ActorCallback< TimeKeeperEpochsFromVersionActor, 0, KeyBackedRangeResult> >*,Error err) { fdb_probe_actor_enter("timeKeeperEpochsFromVersion", reinterpret_cast(this), 0); a_exitChoose1(); @@ -1694,27 +1731,27 @@ class TimeKeeperEpochsFromVersionActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - found = results[0]; - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + found = rangeResult.results[0]; + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (v < found.second) - #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { - #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" max = found.first; - #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" } else { - #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (found.first == min) - #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" min = found.first; - #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" } if (loopDepth == 0) return a_body1loopHead1(0); @@ -1722,51 +1759,51 @@ class TimeKeeperEpochsFromVersionActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" min = mid; - #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" return a_body1loopHead1(loopDepth); // continue return loopDepth; } int a_body1loopBody1cont4(Void const& _,int loopDepth) { - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - if (results.size() != 1) - #line 1736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + if (rangeResult.results.size() != 1) + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~TimeKeeperEpochsFromVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 1740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~TimeKeeperEpochsFromVersionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - found = results[0]; - #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + found = rangeResult.results[0]; + #line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1loopBody1cont4(Void && _,int loopDepth) { - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - if (results.size() != 1) - #line 1757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + if (rangeResult.results.size() != 1) + #line 1794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" { - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~TimeKeeperEpochsFromVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 1761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~TimeKeeperEpochsFromVersionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - found = results[0]; - #line 1769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + found = rangeResult.results[0]; + #line 1806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -1834,28 +1871,28 @@ class TimeKeeperEpochsFromVersionActorState { fdb_probe_actor_exit("timeKeeperEpochsFromVersion", reinterpret_cast(this), 1); } - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" Version v; - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" Reference tr; - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" KeyBackedMap versionMap; - #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" int64_t min; - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" int64_t max; - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" int64_t mid; - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" std::pair found; - #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" - std::vector> results; - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + KeyBackedRangeResult> rangeResult; + #line 1890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" }; // This generated class is to be used only via timeKeeperEpochsFromVersion() - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" -class TimeKeeperEpochsFromVersionActor final : public Actor>, public ActorCallback< TimeKeeperEpochsFromVersionActor, 0, std::vector> >, public ActorCallback< TimeKeeperEpochsFromVersionActor, 1, Void >, public FastAllocated, public TimeKeeperEpochsFromVersionActorState { - #line 1858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" +class TimeKeeperEpochsFromVersionActor final : public Actor>, public ActorCallback< TimeKeeperEpochsFromVersionActor, 0, KeyBackedRangeResult> >, public ActorCallback< TimeKeeperEpochsFromVersionActor, 1, Void >, public FastAllocated, public TimeKeeperEpochsFromVersionActorState { + #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1863,11 +1900,11 @@ class TimeKeeperEpochsFromVersionActor final : public Actor>, #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< TimeKeeperEpochsFromVersionActor, 0, std::vector> >; +friend struct ActorCallback< TimeKeeperEpochsFromVersionActor, 0, KeyBackedRangeResult> >; friend struct ActorCallback< TimeKeeperEpochsFromVersionActor, 1, Void >; - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" TimeKeeperEpochsFromVersionActor(Version const& v,Reference const& tr) - #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" : Actor>(), TimeKeeperEpochsFromVersionActorState(v, tr) { @@ -1885,18 +1922,18 @@ friend struct ActorCallback< TimeKeeperEpochsFromVersionActor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< TimeKeeperEpochsFromVersionActor, 0, std::vector> >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< TimeKeeperEpochsFromVersionActor, 0, KeyBackedRangeResult> >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< TimeKeeperEpochsFromVersionActor, 1, Void >*)0, actor_cancelled()); break; } } }; } - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" [[nodiscard]] Future> timeKeeperEpochsFromVersion( Version const& v, Reference const& tr ) { - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" return Future>(new TimeKeeperEpochsFromVersionActor(v, tr)); - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" + #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.g.cpp" } -#line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" +#line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainer.actor.cpp" diff --git a/src/fdbclient/BackupContainerFileSystem.actor.cpp b/src/fdbclient/BackupContainerFileSystem.actor.cpp index 1a1e1fc..62d35d8 100644 --- a/src/fdbclient/BackupContainerFileSystem.actor.cpp +++ b/src/fdbclient/BackupContainerFileSystem.actor.cpp @@ -19,7 +19,11 @@ */ #include "fdbclient/BackupAgent.actor.h" +#include "fdbclient/BackupContainer.h" +#include "flow/BooleanParam.h" +#ifdef BUILD_AZURE_BACKUP #include "fdbclient/BackupContainerAzureBlobStore.h" +#endif #include "fdbclient/BackupContainerFileSystem.h" #include "fdbclient/BackupContainerLocalDirectory.h" #include "fdbclient/BackupContainerS3BlobStore.h" @@ -157,7 +161,8 @@ class BackupContainerFileSystemImpl { ACTOR static Future writeKeyspaceSnapshotFile(Reference bc, std::vector fileNames, std::vector> beginEndKeys, - int64_t totalBytes) { + int64_t totalBytes, + IncludeKeyRangeMap includeKeyRangeMap) { ASSERT(!fileNames.empty() && fileNames.size() == beginEndKeys.size()); state Version minVer = std::numeric_limits::max(); @@ -186,11 +191,13 @@ class BackupContainerFileSystemImpl { doc.create("beginVersion") = minVer; doc.create("endVersion") = maxVer; - auto ranges = doc.subDoc("keyRanges"); - for (int i = 0; i < beginEndKeys.size(); i++) { - auto fileDoc = ranges.subDoc(fileNames[i], /*split=*/false); - fileDoc.create("beginKey") = beginEndKeys[i].first.toString(); - fileDoc.create("endKey") = beginEndKeys[i].second.toString(); + if (includeKeyRangeMap) { + auto ranges = doc.subDoc("keyRanges"); + for (int i = 0; i < beginEndKeys.size(); i++) { + auto fileDoc = ranges.subDoc(fileNames[i], /*split=*/false); + fileDoc.create("beginKey") = beginEndKeys[i].first.toString(); + fileDoc.create("endKey") = beginEndKeys[i].second.toString(); + } } wait(yield()); @@ -939,13 +946,9 @@ class BackupContainerFileSystemImpl { std::pair, std::map> results = wait(bc->readKeyspaceSnapshot(snapshots[i])); - // Old backup does not have metadata about key ranges and can not be filtered with key ranges. - if (keyRangesFilter.size() && results.second.empty() && !results.first.empty()) { - throw backup_not_filterable_with_key_ranges(); - } - - // Filter by keyRangesFilter. - if (keyRangesFilter.empty()) { + // If there is no key ranges filter for the restore OR if the snapshot contains no per-file key range info + // then return all of the range files + if (keyRangesFilter.empty() || results.second.empty()) { restorable.ranges = std::move(results.first); restorable.keyRanges = std::move(results.second); minKeyRangeVersion = snapshots[i].beginVersion; @@ -972,19 +975,6 @@ class BackupContainerFileSystemImpl { continue; restorable.snapshot = snapshots[i]; - // TODO: Reenable the sanity check after TooManyFiles error is resolved - if (false && g_network->isSimulated()) { - // Sanity check key ranges - state std::map::iterator rit; - for (rit = restorable.keyRanges.begin(); rit != restorable.keyRanges.end(); rit++) { - auto it = std::find_if(restorable.ranges.begin(), - restorable.ranges.end(), - [file = rit->first](const RangeFile f) { return f.fileName == file; }); - ASSERT(it != restorable.ranges.end()); - KeyRange result = wait(bc->getSnapshotFileKeyRange(*it)); - ASSERT(rit->second.begin <= result.begin && rit->second.end >= result.end); - } - } // No logs needed if there is a complete filtered key space snapshot at the target version. if (minKeyRangeVersion == maxKeyRangeVersion && maxKeyRangeVersion == restorable.targetVersion) { @@ -1129,7 +1119,16 @@ class BackupContainerFileSystemImpl { return false; } -#if ENCRYPTION_ENABLED + // fallback for using existing write api if the underlying blob store doesn't support efficient writeEntireFile + ACTOR static Future writeEntireFileFallback(Reference bc, + std::string fileName, + std::string fileContents) { + state Reference objectFile = wait(bc->writeFile(fileName)); + wait(objectFile->append(&fileContents[0], fileContents.size())); + wait(objectFile->finish()); + return Void(); + } + ACTOR static Future createTestEncryptionKeyFile(std::string filename) { state Reference keyFile = wait(IAsyncFileSystem::filesystem()->open( filename, @@ -1165,7 +1164,6 @@ class BackupContainerFileSystemImpl { ASSERT_EQ(bytesRead, cipherKey->size()); return Void(); } -#endif // ENCRYPTION_ENABLED }; // class BackupContainerFileSystemImpl @@ -1219,9 +1217,10 @@ BackupContainerFileSystem::readKeyspaceSnapshot(KeyspaceSnapshotFile snapshot) { Future BackupContainerFileSystem::writeKeyspaceSnapshotFile(const std::vector& fileNames, const std::vector>& beginEndKeys, - int64_t totalBytes) { + int64_t totalBytes, + IncludeKeyRangeMap includeKeyRangeMap) { return BackupContainerFileSystemImpl::writeKeyspaceSnapshotFile( - Reference::addRef(this), fileNames, beginEndKeys, totalBytes); + Reference::addRef(this), fileNames, beginEndKeys, totalBytes, includeKeyRangeMap); }; Future> BackupContainerFileSystem::listLogFiles(Version beginVersion, @@ -1350,7 +1349,9 @@ Future BackupContainerFileSystem::expireData(Version expireEndVersion, Reference::addRef(this), expireEndVersion, force, progress, restorableBeginVersion); } -ACTOR static Future getSnapshotFileKeyRange_impl(Reference bc, RangeFile file) { +ACTOR static Future getSnapshotFileKeyRange_impl(Reference bc, + RangeFile file, + Database cx) { state int readFileRetries = 0; state bool beginKeySet = false; state Key beginKey; @@ -1362,7 +1363,8 @@ ACTOR static Future getSnapshotFileKeyRange_impl(Reference(file.blockSize, file.fileSize - j); - Standalone> blockData = wait(fileBackup::decodeRangeFileBlock(inFile, j, len)); + Standalone> blockData = + wait(fileBackup::decodeRangeFileBlock(inFile, j, len, cx)); if (!beginKeySet) { beginKey = blockData.front().key; beginKeySet = true; @@ -1435,9 +1437,9 @@ ACTOR static Future> readVersionProperty(Reference BackupContainerFileSystem::getSnapshotFileKeyRange(const RangeFile& file) { +Future BackupContainerFileSystem::getSnapshotFileKeyRange(const RangeFile& file, Database cx) { ASSERT(g_network->isSimulated()); - return getSnapshotFileKeyRange_impl(Reference::addRef(this), file); + return getSnapshotFileKeyRange_impl(Reference::addRef(this), file, cx); } Future> BackupContainerFileSystem::getRestoreSet(Version targetVersion, @@ -1480,21 +1482,19 @@ Future BackupContainerFileSystem::encryptionSetupComplete() const { return encryptionSetupFuture; } +Future BackupContainerFileSystem::writeEntireFileFallback(const std::string& fileName, + const std::string& fileContents) { + return BackupContainerFileSystemImpl::writeEntireFileFallback( + Reference::addRef(this), fileName, fileContents); +} + void BackupContainerFileSystem::setEncryptionKey(Optional const& encryptionKeyFileName) { if (encryptionKeyFileName.present()) { -#if ENCRYPTION_ENABLED encryptionSetupFuture = BackupContainerFileSystemImpl::readEncryptionKey(encryptionKeyFileName.get()); -#else - encryptionSetupFuture = Void(); -#endif } } Future BackupContainerFileSystem::createTestEncryptionKeyFile(std::string const& filename) { -#if ENCRYPTION_ENABLED return BackupContainerFileSystemImpl::createTestEncryptionKeyFile(filename); -#else - return Void(); -#endif } // Get a BackupContainerFileSystem based on a container URL string @@ -1503,7 +1503,8 @@ Future BackupContainerFileSystem::createTestEncryptionKeyFile(std::string Reference BackupContainerFileSystem::openContainerFS( const std::string& url, const Optional& proxy, - const Optional& encryptionKeyFileName) { + const Optional& encryptionKeyFileName, + bool isBackup) { static std::map> m_cache; Reference& r = m_cache[url]; @@ -1536,16 +1537,52 @@ Reference BackupContainerFileSystem::openContainerFS( for (auto c : resource) if (!isalnum(c) && c != '_' && c != '-' && c != '.' && c != '/') throw backup_invalid_url(); - r = makeReference(bstore, resource, backupParams, encryptionKeyFileName); + r = makeReference( + bstore, resource, backupParams, encryptionKeyFileName, isBackup); } #ifdef BUILD_AZURE_BACKUP else if (u.startsWith("azure://"_sr)) { u.eat("azure://"_sr); - auto accountName = u.eat("@"_sr).toString(); - auto endpoint = u.eat("/"_sr).toString(); - auto containerName = u.eat("/"_sr).toString(); - r = makeReference( - endpoint, accountName, containerName, encryptionKeyFileName); + auto address = u.eat("/"_sr); + if (address.endsWith(std::string(azure::storage_lite::constants::default_endpoint_suffix))) { + CODE_PROBE(true, "Azure backup url with standard azure storage account endpoint"); + // ..core.windows.net/ + auto endPoint = address.toString(); + auto accountName = address.eat("."_sr).toString(); + auto containerName = u.eat("/"_sr).toString(); + r = makeReference( + endPoint, accountName, containerName, encryptionKeyFileName); + } else { + // resolve the network address if necessary + std::string endpoint(address.toString()); + Optional parsedAddress = NetworkAddress::parseOptional(endpoint); + if (!parsedAddress.present()) { + try { + auto hostname = Hostname::parse(endpoint); + auto resolvedAddress = hostname.resolveBlocking(); + if (resolvedAddress.present()) { + CODE_PROBE(true, "Azure backup url with hostname in the endpoint"); + parsedAddress = resolvedAddress.get(); + } + } catch (Error& e) { + TraceEvent(SevError, "InvalidAzureBackupUrl").error(e).detail("Endpoint", endpoint); + throw backup_invalid_url(); + } + } + if (!parsedAddress.present()) { + TraceEvent(SevError, "InvalidAzureBackupUrl").detail("Endpoint", endpoint); + throw backup_invalid_url(); + } + auto accountName = u.eat("/"_sr).toString(); + // Avoid including ":tls" and "(fromHostname)" + // note: the endpoint needs to contain the account name + // so either ".blob.core.windows.net" or ":/" + endpoint = + fmt::format("{}/{}", formatIpPort(parsedAddress.get().ip, parsedAddress.get().port), accountName); + auto containerName = u.eat("/"_sr).toString(); + r = makeReference( + endpoint, accountName, containerName, encryptionKeyFileName); + } } #endif else { @@ -1680,7 +1717,7 @@ ACTOR Future testBackupContainer(std::string url, // List of sizes to use to test edge cases on underlying file implementations state std::vector fileSizes = { 0 }; - if (StringRef(url).startsWith(LiteralStringRef("blob"))) { + if (StringRef(url).startsWith("blob"_sr)) { fileSizes.push_back(CLIENT_KNOBS->BLOBSTORE_MULTIPART_MIN_PART_SIZE); fileSizes.push_back(CLIENT_KNOBS->BLOBSTORE_MULTIPART_MIN_PART_SIZE + 10); } @@ -1688,8 +1725,8 @@ ACTOR Future testBackupContainer(std::string url, loop { state Version logStart = v; state int kvfiles = deterministicRandom()->randomInt(0, 3); - state Key begin = LiteralStringRef(""); - state Key end = LiteralStringRef(""); + state Key begin = ""_sr; + state Key end = ""_sr; state int blockSize = 3 * sizeof(uint32_t) + begin.size() + end.size() + 8; while (kvfiles > 0) { @@ -1714,8 +1751,10 @@ ACTOR Future testBackupContainer(std::string url, wait(testWriteSnapshotFile(range, begin, end, blockSize)); if (deterministicRandom()->random01() < .2) { - writes.push_back(c->writeKeyspaceSnapshotFile( - snapshots.rbegin()->second, snapshotBeginEndKeys.rbegin()->second, snapshotSizes.rbegin()->second)); + writes.push_back(c->writeKeyspaceSnapshotFile(snapshots.rbegin()->second, + snapshotBeginEndKeys.rbegin()->second, + snapshotSizes.rbegin()->second, + IncludeKeyRangeMap(BUGGIFY))); snapshots[v] = {}; snapshotBeginEndKeys[v] = {}; snapshotSizes[v] = 0; diff --git a/src/fdbclient/BackupContainerFileSystem.actor.g.cpp b/src/fdbclient/BackupContainerFileSystem.actor.g.cpp index c658a90..09a2596 100644 --- a/src/fdbclient/BackupContainerFileSystem.actor.g.cpp +++ b/src/fdbclient/BackupContainerFileSystem.actor.g.cpp @@ -21,7 +21,11 @@ */ #include "fdbclient/BackupAgent.actor.h" +#include "fdbclient/BackupContainer.h" +#include "flow/BooleanParam.h" +#ifdef BUILD_AZURE_BACKUP #include "fdbclient/BackupContainerAzureBlobStore.h" +#endif #include "fdbclient/BackupContainerFileSystem.h" #include "fdbclient/BackupContainerLocalDirectory.h" #include "fdbclient/BackupContainerS3BlobStore.h" @@ -38,22 +42,22 @@ class BackupContainerFileSystemImpl { public: // TODO: Do this more efficiently, as the range file list for a snapshot could potentially be hundreds of // megabytes. - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" // This generated class is to be used only via readKeyspaceSnapshot() - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" template - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class ReadKeyspaceSnapshotActorState { - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ReadKeyspaceSnapshotActorState(Reference const& bc,KeyspaceSnapshotFile const& snapshot) - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : bc(bc), - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshot(snapshot) - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { fdb_probe_actor_create("readKeyspaceSnapshot", reinterpret_cast(this)); @@ -66,16 +70,16 @@ class ReadKeyspaceSnapshotActorState { int a_body1(int loopDepth=0) { try { - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_0 = bc->listRangeFiles(snapshot.beginVersion, snapshot.endVersion); - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -96,48 +100,48 @@ class ReadKeyspaceSnapshotActorState { } int a_body1cont1(std::vector const& files,int loopDepth) { - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" rangeIndex = std::map(); - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto& f : files ) { - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" rangeIndex[f.fileName] = std::move(f); - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_1 = bc->readFile(snapshot.fileName); - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(std::vector && files,int loopDepth) { - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" rangeIndex = std::map(); - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto& f : files ) { - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" rangeIndex[f.fileName] = std::move(f); - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_1 = bc->readFile(snapshot.fileName); - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -207,25 +211,25 @@ class ReadKeyspaceSnapshotActorState { } int a_body1cont2(int loopDepth) { - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_2 = f->size(); - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1when1(Reference const& __f,int loopDepth) { - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" f = __f; - #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -290,36 +294,36 @@ class ReadKeyspaceSnapshotActorState { } int a_body1cont4(int64_t const& size,int loopDepth) { - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" buf = makeString(size); - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_3 = success(f->read(mutateString(buf), buf.size(), 0)); - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4(int64_t && size,int loopDepth) { - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" buf = makeString(size); - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_3 = success(f->read(mutateString(buf), buf.size(), 0)); - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -389,119 +393,119 @@ class ReadKeyspaceSnapshotActorState { } int a_body1cont5(Void const& _,int loopDepth) { - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" json_spirit::mValue json; - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" json_spirit::read_string(buf.toString(), json); - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" JSONDoc doc(json); - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version v; - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!doc.tryGet("beginVersion", v) || v != snapshot.beginVersion) - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(restore_corrupted_data(), loopDepth); - #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!doc.tryGet("endVersion", v) || v != snapshot.endVersion) - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(restore_corrupted_data(), loopDepth); - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" json_spirit::mValue& filesArray = doc.create("files"); - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (filesArray.type() != json_spirit::array_type) - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(restore_corrupted_data(), loopDepth); - #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector results; - #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int missing = 0; - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto const& fileValue : filesArray.get_array() ) { - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (fileValue.type() != json_spirit::str_type) - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(restore_corrupted_data(), loopDepth); - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" auto i = rangeIndex.find(fileValue.get_str()); - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (i == rangeIndex.end()) - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - TraceEvent(SevError, "FileRestoreMissingRangeFile") .detail("URL", bc->getURL()) .detail("File", fileValue.get_str()); #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + TraceEvent(SevError, "FileRestoreMissingRangeFile") .detail("URL", bc->getURL()) .detail("File", fileValue.get_str()); + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ++missing; - #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (missing == 0) - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" results.push_back(i->second); - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (missing > 0) - #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - TraceEvent(SevError, "FileRestoreMissingRangeFileSummary") .detail("URL", bc->getURL()) .detail("Count", missing); #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + TraceEvent(SevError, "FileRestoreMissingRangeFileSummary") .detail("URL", bc->getURL()) .detail("Count", missing); + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(restore_missing_data(), loopDepth); - #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::map fileKeyRanges; - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" JSONDoc ranges = doc.subDoc("keyRanges"); - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto i : ranges.obj() ) { - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" const std::string& filename = i.first; - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" JSONDoc fields(i.second); - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::string begin, end; - #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (fields.tryGet("beginKey", begin) && fields.tryGet("endKey", end)) - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - TraceEvent("ManifestFields") .detail("File", filename) .detail("Begin", printable(StringRef(begin))) .detail("End", printable(StringRef(end))); #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + TraceEvent("ManifestFields") .detail("File", filename) .detail("Begin", printable(StringRef(begin))) .detail("End", printable(StringRef(end))); + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" fileKeyRanges.emplace(filename, KeyRange(KeyRangeRef(StringRef(begin), StringRef(end)))); - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } else { - #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent("MalFormattedManifest").detail("Key", filename); - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(restore_corrupted_data(), loopDepth); - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV, std::map>>::futures) { (void)(std::make_pair(results, fileKeyRanges)); this->~ReadKeyspaceSnapshotActorState(); static_cast(this)->destroy(); return 0; } - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< std::pair, std::map> >::value()) std::pair, std::map>(std::make_pair(results, fileKeyRanges)); this->~ReadKeyspaceSnapshotActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -511,119 +515,119 @@ class ReadKeyspaceSnapshotActorState { } int a_body1cont5(Void && _,int loopDepth) { - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" json_spirit::mValue json; - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" json_spirit::read_string(buf.toString(), json); - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" JSONDoc doc(json); - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version v; - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!doc.tryGet("beginVersion", v) || v != snapshot.beginVersion) - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(restore_corrupted_data(), loopDepth); - #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!doc.tryGet("endVersion", v) || v != snapshot.endVersion) - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(restore_corrupted_data(), loopDepth); - #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" json_spirit::mValue& filesArray = doc.create("files"); - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (filesArray.type() != json_spirit::array_type) - #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(restore_corrupted_data(), loopDepth); - #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector results; - #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int missing = 0; - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto const& fileValue : filesArray.get_array() ) { - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (fileValue.type() != json_spirit::str_type) - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(restore_corrupted_data(), loopDepth); - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" auto i = rangeIndex.find(fileValue.get_str()); - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (i == rangeIndex.end()) - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - TraceEvent(SevError, "FileRestoreMissingRangeFile") .detail("URL", bc->getURL()) .detail("File", fileValue.get_str()); #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + TraceEvent(SevError, "FileRestoreMissingRangeFile") .detail("URL", bc->getURL()) .detail("File", fileValue.get_str()); + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ++missing; - #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (missing == 0) - #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" results.push_back(i->second); - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (missing > 0) - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - TraceEvent(SevError, "FileRestoreMissingRangeFileSummary") .detail("URL", bc->getURL()) .detail("Count", missing); #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + TraceEvent(SevError, "FileRestoreMissingRangeFileSummary") .detail("URL", bc->getURL()) .detail("Count", missing); + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(restore_missing_data(), loopDepth); - #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::map fileKeyRanges; - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" JSONDoc ranges = doc.subDoc("keyRanges"); - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto i : ranges.obj() ) { - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" const std::string& filename = i.first; - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" JSONDoc fields(i.second); - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::string begin, end; - #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (fields.tryGet("beginKey", begin) && fields.tryGet("endKey", end)) - #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - TraceEvent("ManifestFields") .detail("File", filename) .detail("Begin", printable(StringRef(begin))) .detail("End", printable(StringRef(end))); #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + TraceEvent("ManifestFields") .detail("File", filename) .detail("Begin", printable(StringRef(begin))) .detail("End", printable(StringRef(end))); + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" fileKeyRanges.emplace(filename, KeyRange(KeyRangeRef(StringRef(begin), StringRef(end)))); - #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } else { - #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent("MalFormattedManifest").detail("Key", filename); - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(restore_corrupted_data(), loopDepth); - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV, std::map>>::futures) { (void)(std::make_pair(results, fileKeyRanges)); this->~ReadKeyspaceSnapshotActorState(); static_cast(this)->destroy(); return 0; } - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< std::pair, std::map> >::value()) std::pair, std::map>(std::make_pair(results, fileKeyRanges)); this->~ReadKeyspaceSnapshotActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -694,22 +698,22 @@ class ReadKeyspaceSnapshotActorState { fdb_probe_actor_exit("readKeyspaceSnapshot", reinterpret_cast(this), 3); } - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference bc; - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" KeyspaceSnapshotFile snapshot; - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::map rangeIndex; - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference f; - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Standalone buf; - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; // This generated class is to be used only via readKeyspaceSnapshot() - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class ReadKeyspaceSnapshotActor final : public Actor, std::map>>, public ActorCallback< ReadKeyspaceSnapshotActor, 0, std::vector >, public ActorCallback< ReadKeyspaceSnapshotActor, 1, Reference >, public ActorCallback< ReadKeyspaceSnapshotActor, 2, int64_t >, public ActorCallback< ReadKeyspaceSnapshotActor, 3, Void >, public FastAllocated, public ReadKeyspaceSnapshotActorState { - #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -721,9 +725,9 @@ friend struct ActorCallback< ReadKeyspaceSnapshotActor, 0, std::vector >; friend struct ActorCallback< ReadKeyspaceSnapshotActor, 2, int64_t >; friend struct ActorCallback< ReadKeyspaceSnapshotActor, 3, Void >; - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ReadKeyspaceSnapshotActor(Reference const& bc,KeyspaceSnapshotFile const& snapshot) - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor, std::map>>(), ReadKeyspaceSnapshotActorState(bc, snapshot) { @@ -749,14 +753,14 @@ friend struct ActorCallback< ReadKeyspaceSnapshotActor, 3, Void >; } }; - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" [[nodiscard]] static Future, std::map>> readKeyspaceSnapshot( Reference const& bc, KeyspaceSnapshotFile const& snapshot ) { - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return Future, std::map>>(new ReadKeyspaceSnapshotActor(bc, snapshot)); - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -#line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" // Backup log types static constexpr Version NON_PARTITIONED_MUTATION_LOG = 0; @@ -792,26 +796,28 @@ friend struct ActorCallback< ReadKeyspaceSnapshotActor, 3, Void >; return false; } - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" // This generated class is to be used only via writeKeyspaceSnapshotFile() - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" template - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class WriteKeyspaceSnapshotFileActorState { - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - WriteKeyspaceSnapshotFileActorState(Reference const& bc,std::vector const& fileNames,std::vector> const& beginEndKeys,int64_t const& totalBytes) - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + WriteKeyspaceSnapshotFileActorState(Reference const& bc,std::vector const& fileNames,std::vector> const& beginEndKeys,int64_t const& totalBytes,IncludeKeyRangeMap const& includeKeyRangeMap) + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : bc(bc), - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" fileNames(fileNames), - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" beginEndKeys(beginEndKeys), - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - totalBytes(totalBytes) - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + totalBytes(totalBytes), + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + includeKeyRangeMap(includeKeyRangeMap) + #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { fdb_probe_actor_create("writeKeyspaceSnapshotFile", reinterpret_cast(this)); @@ -824,19 +830,19 @@ class WriteKeyspaceSnapshotFileActorState { int a_body1(int loopDepth=0) { try { - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(!fileNames.empty() && fileNames.size() == beginEndKeys.size()); - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" minVer = std::numeric_limits::max(); - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" maxVer = 0; - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" rf = RangeFile(); - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" fileArray = json_spirit::mArray(); - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" RangeForbody1Iterator0 = std::begin(fileNames); - #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -857,40 +863,45 @@ class WriteKeyspaceSnapshotFileActorState { } int a_body1cont1(int loopDepth) { - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - json = json_spirit::mValue(); - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - doc = JSONDoc(json); - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - doc.create("files") = std::move(fileArray); - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - doc.create("totalBytes") = totalBytes; #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - doc.create("beginVersion") = minVer; + json = json_spirit::mValue(); #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - doc.create("endVersion") = maxVer; + doc = JSONDoc(json); #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - auto ranges = doc.subDoc("keyRanges"); + doc.create("files") = std::move(fileArray); #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - for(int i = 0;i < beginEndKeys.size();i++) { + doc.create("totalBytes") = totalBytes; #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - auto fileDoc = ranges.subDoc(fileNames[i], false); + doc.create("beginVersion") = minVer; #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - fileDoc.create("beginKey") = beginEndKeys[i].first.toString(); - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - fileDoc.create("endKey") = beginEndKeys[i].second.toString(); - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - } + doc.create("endVersion") = maxVer; + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (includeKeyRangeMap) + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + { + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + auto ranges = doc.subDoc("keyRanges"); #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + for(int i = 0;i < beginEndKeys.size();i++) { + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + auto fileDoc = ranges.subDoc(fileNames[i], false); + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + fileDoc.create("beginKey") = beginEndKeys[i].first.toString(); + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + fileDoc.create("endKey") = beginEndKeys[i].second.toString(); + #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + } + } + #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_1 = yield(); - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -904,55 +915,55 @@ class WriteKeyspaceSnapshotFileActorState { } int a_body1loopBody1(int loopDepth) { - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!(RangeForbody1Iterator0 != std::end(fileNames))) - #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" const auto& f = *RangeForbody1Iterator0; - #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (pathToRangeFile(rf, f, 0)) - #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" fileArray.push_back(f); - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (rf.version < minVer) - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" minVer = rf.version; - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (rf.version > maxVer) - #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" maxVer = rf.version; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } else { - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(restore_unknown_file_type(), std::max(0, loopDepth - 1)); - #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_0 = yield(); - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } @@ -973,9 +984,9 @@ class WriteKeyspaceSnapshotFileActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ++RangeForbody1Iterator0; - #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -1057,36 +1068,36 @@ class WriteKeyspaceSnapshotFileActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" docString = json_spirit::write_string(json); - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_2 = bc->writeFile(format("snapshots/snapshot,%lld,%lld,%lld", minVer, maxVer, totalBytes)); - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" docString = json_spirit::write_string(json); - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_2 = bc->writeFile(format("snapshots/snapshot,%lld,%lld,%lld", minVer, maxVer, totalBytes)); - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1154,35 +1165,35 @@ class WriteKeyspaceSnapshotFileActorState { fdb_probe_actor_exit("writeKeyspaceSnapshotFile", reinterpret_cast(this), 1); } - int a_body1cont4(int loopDepth) + int a_body1cont5(int loopDepth) { - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_3 = f->append(docString.data(), docString.size()); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; + #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2when1(Reference const& __f,int loopDepth) { - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" f = __f; - #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - loopDepth = a_body1cont4(loopDepth); + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + loopDepth = a_body1cont5(loopDepth); return loopDepth; } int a_body1cont2when1(Reference && __f,int loopDepth) { f = std::move(__f); - loopDepth = a_body1cont4(loopDepth); + loopDepth = a_body1cont5(loopDepth); return loopDepth; } @@ -1237,47 +1248,47 @@ class WriteKeyspaceSnapshotFileActorState { fdb_probe_actor_exit("writeKeyspaceSnapshotFile", reinterpret_cast(this), 2); } - int a_body1cont5(Void const& _,int loopDepth) + int a_body1cont6(Void const& _,int loopDepth) { - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_4 = f->finish(); - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5when1(__when_expr_4.get(), loopDepth); }; + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont5(Void && _,int loopDepth) + int a_body1cont6(Void && _,int loopDepth) { - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_4 = f->finish(); - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5when1(__when_expr_4.get(), loopDepth); }; + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont4when1(Void const& _,int loopDepth) + int a_body1cont5when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont5(_, loopDepth); + loopDepth = a_body1cont6(_, loopDepth); return loopDepth; } - int a_body1cont4when1(Void && _,int loopDepth) + int a_body1cont5when1(Void && _,int loopDepth) { - loopDepth = a_body1cont5(std::move(_), loopDepth); + loopDepth = a_body1cont6(std::move(_), loopDepth); return loopDepth; } @@ -1292,7 +1303,7 @@ class WriteKeyspaceSnapshotFileActorState { fdb_probe_actor_enter("writeKeyspaceSnapshotFile", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont4when1(value, 0); + a_body1cont5when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -1307,7 +1318,7 @@ class WriteKeyspaceSnapshotFileActorState { fdb_probe_actor_enter("writeKeyspaceSnapshotFile", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont4when1(std::move(value), 0); + a_body1cont5when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -1332,11 +1343,11 @@ class WriteKeyspaceSnapshotFileActorState { fdb_probe_actor_exit("writeKeyspaceSnapshotFile", reinterpret_cast(this), 3); } - int a_body1cont6(Void const& _,int loopDepth) + int a_body1cont7(Void const& _,int loopDepth) { - #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKeyspaceSnapshotFileActorState(); static_cast(this)->destroy(); return 0; } - #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WriteKeyspaceSnapshotFileActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1344,11 +1355,11 @@ class WriteKeyspaceSnapshotFileActorState { return loopDepth; } - int a_body1cont6(Void && _,int loopDepth) + int a_body1cont7(Void && _,int loopDepth) { - #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKeyspaceSnapshotFileActorState(); static_cast(this)->destroy(); return 0; } - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WriteKeyspaceSnapshotFileActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1356,15 +1367,15 @@ class WriteKeyspaceSnapshotFileActorState { return loopDepth; } - int a_body1cont5when1(Void const& _,int loopDepth) + int a_body1cont6when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont6(_, loopDepth); + loopDepth = a_body1cont7(_, loopDepth); return loopDepth; } - int a_body1cont5when1(Void && _,int loopDepth) + int a_body1cont6when1(Void && _,int loopDepth) { - loopDepth = a_body1cont6(std::move(_), loopDepth); + loopDepth = a_body1cont7(std::move(_), loopDepth); return loopDepth; } @@ -1379,7 +1390,7 @@ class WriteKeyspaceSnapshotFileActorState { fdb_probe_actor_enter("writeKeyspaceSnapshotFile", reinterpret_cast(this), 4); a_exitChoose5(); try { - a_body1cont5when1(value, 0); + a_body1cont6when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -1394,7 +1405,7 @@ class WriteKeyspaceSnapshotFileActorState { fdb_probe_actor_enter("writeKeyspaceSnapshotFile", reinterpret_cast(this), 4); a_exitChoose5(); try { - a_body1cont5when1(std::move(value), 0); + a_body1cont6when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -1419,38 +1430,40 @@ class WriteKeyspaceSnapshotFileActorState { fdb_probe_actor_exit("writeKeyspaceSnapshotFile", reinterpret_cast(this), 4); } - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference bc; - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector fileNames; - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector> beginEndKeys; - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int64_t totalBytes; - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + IncludeKeyRangeMap includeKeyRangeMap; + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version minVer; - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version maxVer; - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" RangeFile rf; - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" json_spirit::mArray fileArray; - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" decltype(std::begin(std::declval>())) RangeForbody1Iterator0; - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" json_spirit::mValue json; - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" JSONDoc doc; - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::string docString; - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference f; - #line 1448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; // This generated class is to be used only via writeKeyspaceSnapshotFile() - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class WriteKeyspaceSnapshotFileActor final : public Actor, public ActorCallback< WriteKeyspaceSnapshotFileActor, 0, Void >, public ActorCallback< WriteKeyspaceSnapshotFileActor, 1, Void >, public ActorCallback< WriteKeyspaceSnapshotFileActor, 2, Reference >, public ActorCallback< WriteKeyspaceSnapshotFileActor, 3, Void >, public ActorCallback< WriteKeyspaceSnapshotFileActor, 4, Void >, public FastAllocated, public WriteKeyspaceSnapshotFileActorState { - #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1463,11 +1476,11 @@ friend struct ActorCallback< WriteKeyspaceSnapshotFileActor, 1, Void >; friend struct ActorCallback< WriteKeyspaceSnapshotFileActor, 2, Reference >; friend struct ActorCallback< WriteKeyspaceSnapshotFileActor, 3, Void >; friend struct ActorCallback< WriteKeyspaceSnapshotFileActor, 4, Void >; - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - WriteKeyspaceSnapshotFileActor(Reference const& bc,std::vector const& fileNames,std::vector> const& beginEndKeys,int64_t const& totalBytes) - #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + WriteKeyspaceSnapshotFileActor(Reference const& bc,std::vector const& fileNames,std::vector> const& beginEndKeys,int64_t const& totalBytes,IncludeKeyRangeMap const& includeKeyRangeMap) + #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), - WriteKeyspaceSnapshotFileActorState(bc, fileNames, beginEndKeys, totalBytes) + WriteKeyspaceSnapshotFileActorState(bc, fileNames, beginEndKeys, totalBytes, includeKeyRangeMap) { fdb_probe_actor_enter("writeKeyspaceSnapshotFile", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -1492,41 +1505,41 @@ friend struct ActorCallback< WriteKeyspaceSnapshotFileActor, 4, Void >; } }; - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -[[nodiscard]] static Future writeKeyspaceSnapshotFile( Reference const& bc, std::vector const& fileNames, std::vector> const& beginEndKeys, int64_t const& totalBytes ) { - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - return Future(new WriteKeyspaceSnapshotFileActor(bc, fileNames, beginEndKeys, totalBytes)); - #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +[[nodiscard]] static Future writeKeyspaceSnapshotFile( Reference const& bc, std::vector const& fileNames, std::vector> const& beginEndKeys, int64_t const& totalBytes, IncludeKeyRangeMap const& includeKeyRangeMap ) { + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + return Future(new WriteKeyspaceSnapshotFileActor(bc, fileNames, beginEndKeys, totalBytes, includeKeyRangeMap)); + #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -#line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" // This generated class is to be used only via dumpFileList() - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" template - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class DumpFileListActorState { - #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" DumpFileListActorState(Reference const& bc,Version const& begin,Version const& end) - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : bc(bc), - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" begin(begin), - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" end(end), - #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" fRanges(bc->listRangeFiles(begin, end)), - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" fSnapshots(bc->listKeyspaceSnapshots(begin, end)), - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs(), - #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" pLogs() - #line 1529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { fdb_probe_actor_create("dumpFileList", reinterpret_cast(this)); @@ -1539,16 +1552,16 @@ class DumpFileListActorState { int a_body1(int loopDepth=0) { try { - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_0 = success(fRanges) && success(fSnapshots) && store(logs, bc->listLogFiles(begin, end, false)) && store(pLogs, bc->listLogFiles(begin, end, true)); - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1569,11 +1582,11 @@ class DumpFileListActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs.insert(logs.end(), std::make_move_iterator(pLogs.begin()), std::make_move_iterator(pLogs.end())); - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(BackupFileList({ fRanges.get(), std::move(logs), fSnapshots.get() })); this->~DumpFileListActorState(); static_cast(this)->destroy(); return 0; } - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< BackupFileList >::value()) BackupFileList(BackupFileList({ fRanges.get(), std::move(logs), fSnapshots.get() })); this->~DumpFileListActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1583,11 +1596,11 @@ class DumpFileListActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs.insert(logs.end(), std::make_move_iterator(pLogs.begin()), std::make_move_iterator(pLogs.end())); - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(BackupFileList({ fRanges.get(), std::move(logs), fSnapshots.get() })); this->~DumpFileListActorState(); static_cast(this)->destroy(); return 0; } - #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< BackupFileList >::value()) BackupFileList(BackupFileList({ fRanges.get(), std::move(logs), fSnapshots.get() })); this->~DumpFileListActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1658,26 +1671,26 @@ class DumpFileListActorState { fdb_probe_actor_exit("dumpFileList", reinterpret_cast(this), 0); } - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference bc; - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version begin; - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version end; - #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Future> fRanges; - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Future> fSnapshots; - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector logs; - #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector pLogs; - #line 1675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; // This generated class is to be used only via dumpFileList() - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class DumpFileListActor final : public Actor, public ActorCallback< DumpFileListActor, 0, Void >, public FastAllocated, public DumpFileListActorState { - #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1686,9 +1699,9 @@ class DumpFileListActor final : public Actor, public ActorCallba void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< DumpFileListActor, 0, Void >; - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" DumpFileListActor(Reference const& bc,Version const& begin,Version const& end) - #line 1691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), DumpFileListActorState(bc, begin, end) { @@ -1711,14 +1724,14 @@ friend struct ActorCallback< DumpFileListActor, 0, Void >; } }; - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" [[nodiscard]] static Future dumpFileList( Reference const& bc, Version const& begin, Version const& end ) { - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return Future(new DumpFileListActor(bc, begin, end)); - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -#line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" static Version resolveRelativeVersion(Optional max, Version v, const char* name, Error e) { if (v == invalidVersion) { @@ -1905,26 +1918,26 @@ friend struct ActorCallback< DumpFileListActor, 0, Void >; } } - #line 1908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" // This generated class is to be used only via describeBackup() - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" template - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class DescribeBackupActorState { - #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" DescribeBackupActorState(Reference const& bc,bool const& deepScan,Version const& logStartVersionOverride) - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : bc(bc), - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" deepScan(deepScan), - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logStartVersionOverride(logStartVersionOverride), - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc() - #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { fdb_probe_actor_create("describeBackup", reinterpret_cast(this)); @@ -1937,22 +1950,22 @@ class DescribeBackupActorState { int a_body1(int loopDepth=0) { try { - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.url = bc->getURL(); - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.proxy = bc->getProxy(); - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent("BackupContainerDescribe1") .detail("URL", bc->getURL()) .detail("LogStartVersionOverride", logStartVersionOverride); - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_0 = bc->exists(); - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1973,30 +1986,30 @@ class DescribeBackupActorState { } int a_body1cont1(bool const& e,int loopDepth) { - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!e) - #line 1978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent(SevWarnAlways, "BackupContainerDoesNotExist").detail("URL", bc->getURL()); - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(backup_does_not_exist(), loopDepth); - #line 1984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (logStartVersionOverride != invalidVersion && logStartVersionOverride < 0) - #line 1988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_1 = bc->describeBackup(false, invalidVersion); - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -2008,30 +2021,30 @@ class DescribeBackupActorState { } int a_body1cont1(bool && e,int loopDepth) { - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!e) - #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent(SevWarnAlways, "BackupContainerDoesNotExist").detail("URL", bc->getURL()); - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(backup_does_not_exist(), loopDepth); - #line 2019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (logStartVersionOverride != invalidVersion && logStartVersionOverride < 0) - #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_1 = bc->describeBackup(false, invalidVersion); - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -2106,62 +2119,62 @@ class DescribeBackupActorState { } int a_body1cont2(int loopDepth) { - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaLogBegin = Optional(); - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaLogEnd = Optional(); - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaExpiredEnd = Optional(); - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaUnreliableEnd = Optional(); - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaLogType = Optional(); - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector> metaReads; - #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaReads.push_back(store(metaExpiredEnd, bc->expiredEndVersion().get())); - #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaReads.push_back(store(metaUnreliableEnd, bc->unreliableEndVersion().get())); - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaReads.push_back(store(metaLogType, bc->logType().get())); - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!deepScan) - #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaReads.push_back(store(metaLogBegin, bc->logBeginVersion().get())); - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaReads.push_back(store(metaLogEnd, bc->logEndVersion().get())); - #line 2135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_2 = waitForAll(metaReads); - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4(BackupDescription const& tmp,int loopDepth) { - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logStartVersionOverride = resolveRelativeVersion( tmp.maxLogEnd, logStartVersionOverride, "LogStartVersionOverride", invalid_option_value()); - #line 2155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; } int a_body1cont4(BackupDescription && tmp,int loopDepth) { - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logStartVersionOverride = resolveRelativeVersion( tmp.maxLogEnd, logStartVersionOverride, "LogStartVersionOverride", invalid_option_value()); - #line 2164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -2231,148 +2244,148 @@ class DescribeBackupActorState { } int a_body1cont6(Void const& _,int loopDepth) { - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent("BackupContainerDescribe2") .detail("URL", bc->getURL()) .detail("LogStartVersionOverride", logStartVersionOverride) .detail("ExpiredEndVersion", metaExpiredEnd.orDefault(invalidVersion)) .detail("UnreliableEndVersion", metaUnreliableEnd.orDefault(invalidVersion)) .detail("LogBeginVersion", metaLogBegin.orDefault(invalidVersion)) .detail("LogEndVersion", metaLogEnd.orDefault(invalidVersion)) .detail("LogType", metaLogType.orDefault(-1)); - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (logStartVersionOverride != invalidVersion && metaUnreliableEnd.orDefault(invalidVersion) < logStartVersionOverride) - #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaUnreliableEnd = logStartVersionOverride; - #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!metaLogBegin.present() || !metaLogEnd.present() || metaLogEnd.get() <= metaLogBegin.get() || metaLogEnd.get() < metaExpiredEnd.orDefault(invalidVersion) || metaLogEnd.get() < metaUnreliableEnd.orDefault(invalidVersion)) - #line 2246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - TraceEvent(SevWarnAlways, "BackupContainerMetadataInvalid") .detail("URL", bc->getURL()) .detail("ExpiredEndVersion", metaExpiredEnd.orDefault(invalidVersion)) .detail("UnreliableEndVersion", metaUnreliableEnd.orDefault(invalidVersion)) .detail("LogBeginVersion", metaLogBegin.orDefault(invalidVersion)) .detail("LogEndVersion", metaLogEnd.orDefault(invalidVersion)); #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + TraceEvent(SevWarnAlways, "BackupContainerMetadataInvalid") .detail("URL", bc->getURL()) .detail("ExpiredEndVersion", metaExpiredEnd.orDefault(invalidVersion)) .detail("UnreliableEndVersion", metaUnreliableEnd.orDefault(invalidVersion)) .detail("LogBeginVersion", metaLogBegin.orDefault(invalidVersion)) .detail("LogEndVersion", metaLogEnd.orDefault(invalidVersion)); + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaLogBegin = Optional(); - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaLogEnd = Optional(); - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!metaUnreliableEnd.present() || metaUnreliableEnd.get() < metaExpiredEnd.orDefault(0)) - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaUnreliableEnd = metaExpiredEnd; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.unreliableEndVersion = metaUnreliableEnd; - #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.expiredEndVersion = metaExpiredEnd; - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" scanBegin = desc.unreliableEndVersion.orDefault(0); - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" scanEnd = std::numeric_limits::max(); - #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (metaLogBegin.present() && metaLogEnd.present()) - #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.minLogBegin = std::max(metaLogBegin.get(), desc.unreliableEndVersion.orDefault(0)); - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.maxLogEnd = metaLogEnd.get(); - #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.contiguousLogEnd = desc.maxLogEnd; - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" scanBegin = desc.contiguousLogEnd.get(); - #line 2284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs = std::vector(); - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" plogs = std::vector(); - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent("BackupContainerListFiles").detail("URL", bc->getURL()); - #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_3 = store(logs, bc->listLogFiles(scanBegin, scanEnd, false)) && store(plogs, bc->listLogFiles(scanBegin, scanEnd, true)) && store(desc.snapshots, bc->listKeyspaceSnapshots()); - #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont6(Void && _,int loopDepth) { - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent("BackupContainerDescribe2") .detail("URL", bc->getURL()) .detail("LogStartVersionOverride", logStartVersionOverride) .detail("ExpiredEndVersion", metaExpiredEnd.orDefault(invalidVersion)) .detail("UnreliableEndVersion", metaUnreliableEnd.orDefault(invalidVersion)) .detail("LogBeginVersion", metaLogBegin.orDefault(invalidVersion)) .detail("LogEndVersion", metaLogEnd.orDefault(invalidVersion)) .detail("LogType", metaLogType.orDefault(-1)); - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (logStartVersionOverride != invalidVersion && metaUnreliableEnd.orDefault(invalidVersion) < logStartVersionOverride) - #line 2312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaUnreliableEnd = logStartVersionOverride; - #line 2316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!metaLogBegin.present() || !metaLogEnd.present() || metaLogEnd.get() <= metaLogBegin.get() || metaLogEnd.get() < metaExpiredEnd.orDefault(invalidVersion) || metaLogEnd.get() < metaUnreliableEnd.orDefault(invalidVersion)) - #line 2320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - TraceEvent(SevWarnAlways, "BackupContainerMetadataInvalid") .detail("URL", bc->getURL()) .detail("ExpiredEndVersion", metaExpiredEnd.orDefault(invalidVersion)) .detail("UnreliableEndVersion", metaUnreliableEnd.orDefault(invalidVersion)) .detail("LogBeginVersion", metaLogBegin.orDefault(invalidVersion)) .detail("LogEndVersion", metaLogEnd.orDefault(invalidVersion)); #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + TraceEvent(SevWarnAlways, "BackupContainerMetadataInvalid") .detail("URL", bc->getURL()) .detail("ExpiredEndVersion", metaExpiredEnd.orDefault(invalidVersion)) .detail("UnreliableEndVersion", metaUnreliableEnd.orDefault(invalidVersion)) .detail("LogBeginVersion", metaLogBegin.orDefault(invalidVersion)) .detail("LogEndVersion", metaLogEnd.orDefault(invalidVersion)); + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaLogBegin = Optional(); - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaLogEnd = Optional(); - #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!metaUnreliableEnd.present() || metaUnreliableEnd.get() < metaExpiredEnd.orDefault(0)) - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" metaUnreliableEnd = metaExpiredEnd; - #line 2336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.unreliableEndVersion = metaUnreliableEnd; - #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.expiredEndVersion = metaExpiredEnd; - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" scanBegin = desc.unreliableEndVersion.orDefault(0); - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" scanEnd = std::numeric_limits::max(); - #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (metaLogBegin.present() && metaLogEnd.present()) - #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.minLogBegin = std::max(metaLogBegin.get(), desc.unreliableEndVersion.orDefault(0)); - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.maxLogEnd = metaLogEnd.get(); - #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.contiguousLogEnd = desc.maxLogEnd; - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" scanBegin = desc.contiguousLogEnd.get(); - #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs = std::vector(); - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" plogs = std::vector(); - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent("BackupContainerListFiles").detail("URL", bc->getURL()); - #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_3 = store(logs, bc->listLogFiles(scanBegin, scanEnd, false)) && store(plogs, bc->listLogFiles(scanBegin, scanEnd, true)) && store(desc.snapshots, bc->listKeyspaceSnapshots()); - #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2442,111 +2455,111 @@ class DescribeBackupActorState { } int a_body1cont8(Void const& _,int loopDepth) { - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent("BackupContainerListFiles") .detail("URL", bc->getURL()) .detail("LogFiles", logs.size()) .detail("PLogsFiles", plogs.size()) .detail("Snapshots", desc.snapshots.size()); - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (plogs.size() > 0) - #line 2449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.partitioned = true; - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs.swap(plogs); - #line 2455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } else { - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.partitioned = metaLogType.present() && metaLogType.get() == BackupContainerFileSystemImpl::PARTITIONED_MUTATION_LOG; - #line 2461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(logs.begin(), logs.end()); - #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!logs.empty()) - #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.maxLogEnd = logs.rbegin()->endVersion; - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!desc.contiguousLogEnd.present()) - #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.minLogBegin = logs.begin()->beginVersion; - #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (desc.partitioned) - #line 2479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.contiguousLogEnd = logs.begin()->beginVersion; - #line 2483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } else { - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.contiguousLogEnd = logs.begin()->endVersion; - #line 2489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (desc.partitioned) - #line 2494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" updatePartitionedLogsContinuousEnd(&desc, logs, scanBegin, scanEnd); - #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } else { - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version& end = desc.contiguousLogEnd.get(); - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" computeRestoreEndVersion(logs, nullptr, &end, std::numeric_limits::max()); - #line 2506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (logStartVersionOverride == invalidVersion) - #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { try { - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" updates = Void(); - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (desc.minLogBegin.present() && metaLogBegin != desc.minLogBegin) - #line 2518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" updates = updates && bc->logBeginVersion().set(desc.minLogBegin.get()); - #line 2522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (desc.contiguousLogEnd.present() && metaLogEnd != desc.contiguousLogEnd) - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" updates = updates && bc->logEndVersion().set(desc.contiguousLogEnd.get()); - #line 2530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!metaLogType.present()) - #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" updates = updates && bc->logType().set(desc.partitioned ? BackupContainerFileSystemImpl::PARTITIONED_MUTATION_LOG : BackupContainerFileSystemImpl::NON_PARTITIONED_MUTATION_LOG); - #line 2538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_4 = updates; - #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont8Catch1(actor_cancelled(), loopDepth); - #line 2544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont8Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont8when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2564,111 +2577,111 @@ class DescribeBackupActorState { } int a_body1cont8(Void && _,int loopDepth) { - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent("BackupContainerListFiles") .detail("URL", bc->getURL()) .detail("LogFiles", logs.size()) .detail("PLogsFiles", plogs.size()) .detail("Snapshots", desc.snapshots.size()); - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (plogs.size() > 0) - #line 2571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.partitioned = true; - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs.swap(plogs); - #line 2577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } else { - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.partitioned = metaLogType.present() && metaLogType.get() == BackupContainerFileSystemImpl::PARTITIONED_MUTATION_LOG; - #line 2583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(logs.begin(), logs.end()); - #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!logs.empty()) - #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.maxLogEnd = logs.rbegin()->endVersion; - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!desc.contiguousLogEnd.present()) - #line 2595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.minLogBegin = logs.begin()->beginVersion; - #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (desc.partitioned) - #line 2601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.contiguousLogEnd = logs.begin()->beginVersion; - #line 2605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } else { - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.contiguousLogEnd = logs.begin()->endVersion; - #line 2611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (desc.partitioned) - #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" updatePartitionedLogsContinuousEnd(&desc, logs, scanBegin, scanEnd); - #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } else { - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version& end = desc.contiguousLogEnd.get(); - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" computeRestoreEndVersion(logs, nullptr, &end, std::numeric_limits::max()); - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (logStartVersionOverride == invalidVersion) - #line 2633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { try { - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" updates = Void(); - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (desc.minLogBegin.present() && metaLogBegin != desc.minLogBegin) - #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" updates = updates && bc->logBeginVersion().set(desc.minLogBegin.get()); - #line 2644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (desc.contiguousLogEnd.present() && metaLogEnd != desc.contiguousLogEnd) - #line 2648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" updates = updates && bc->logEndVersion().set(desc.contiguousLogEnd.get()); - #line 2652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!metaLogType.present()) - #line 2656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" updates = updates && bc->logType().set(desc.partitioned ? BackupContainerFileSystemImpl::PARTITIONED_MUTATION_LOG : BackupContainerFileSystemImpl::NON_PARTITIONED_MUTATION_LOG); - #line 2660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_4 = updates; - #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont8Catch1(actor_cancelled(), loopDepth); - #line 2666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont8Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont8when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2749,79 +2762,79 @@ class DescribeBackupActorState { } int a_body1cont13(int loopDepth) { - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto& s : desc.snapshots ) { - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" s.restorable = true; - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (s.beginVersion != s.endVersion) - #line 2758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!desc.minLogBegin.present() || desc.minLogBegin.get() > s.beginVersion) - #line 2762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" s.restorable = false; - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!desc.contiguousLogEnd.present() || desc.contiguousLogEnd.get() <= s.endVersion) - #line 2770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" s.restorable = false; - #line 2774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.snapshotBytes += s.totalSize; - #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (s.beginVersion == s.endVersion) - #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!desc.minRestorableVersion.present() || s.endVersion < desc.minRestorableVersion.get()) - #line 2785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.minRestorableVersion = s.endVersion; - #line 2789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!desc.maxRestorableVersion.present() || s.endVersion > desc.maxRestorableVersion.get()) - #line 2793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.maxRestorableVersion = s.endVersion; - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (desc.minLogBegin.present() && s.beginVersion >= desc.minLogBegin.get() && s.endVersion < desc.contiguousLogEnd.get()) - #line 2802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!desc.minRestorableVersion.present() || s.endVersion < desc.minRestorableVersion.get()) - #line 2806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.minRestorableVersion = s.endVersion; - #line 2810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!desc.maxRestorableVersion.present() || (desc.contiguousLogEnd.get() - 1) > desc.maxRestorableVersion.get()) - #line 2814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc.maxRestorableVersion = desc.contiguousLogEnd.get() - 1; - #line 2818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } } - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(desc); this->~DescribeBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< BackupDescription >::value()) BackupDescription(std::move(desc)); // state_var_RVO this->~DescribeBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2838,17 +2851,17 @@ class DescribeBackupActorState { int a_body1cont8Catch1(const Error& e,int loopDepth=0) { try { - #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (e.code() == error_code_actor_cancelled) - #line 2843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent(SevWarn, "BackupContainerMetadataUpdateFailure").error(e).detail("URL", bc->getURL()); - #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont22(loopDepth); } catch (Error& error) { @@ -2947,40 +2960,40 @@ class DescribeBackupActorState { return loopDepth; } - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference bc; - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" bool deepScan; - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version logStartVersionOverride; - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" BackupDescription desc; - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Optional metaLogBegin; - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Optional metaLogEnd; - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Optional metaExpiredEnd; - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Optional metaUnreliableEnd; - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Optional metaLogType; - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version scanBegin; - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version scanEnd; - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector logs; - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector plogs; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Future updates; - #line 2978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; // This generated class is to be used only via describeBackup() - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class DescribeBackupActor final : public Actor, public ActorCallback< DescribeBackupActor, 0, bool >, public ActorCallback< DescribeBackupActor, 1, BackupDescription >, public ActorCallback< DescribeBackupActor, 2, Void >, public ActorCallback< DescribeBackupActor, 3, Void >, public ActorCallback< DescribeBackupActor, 4, Void >, public FastAllocated, public DescribeBackupActorState { - #line 2983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 2996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2993,9 +3006,9 @@ friend struct ActorCallback< DescribeBackupActor, 1, BackupDescription >; friend struct ActorCallback< DescribeBackupActor, 2, Void >; friend struct ActorCallback< DescribeBackupActor, 3, Void >; friend struct ActorCallback< DescribeBackupActor, 4, Void >; - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" DescribeBackupActor(Reference const& bc,bool const& deepScan,Version const& logStartVersionOverride) - #line 2998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), DescribeBackupActorState(bc, deepScan, logStartVersionOverride) { @@ -3022,37 +3035,37 @@ friend struct ActorCallback< DescribeBackupActor, 4, Void >; } }; - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" [[nodiscard]] static Future describeBackup( Reference const& bc, bool const& deepScan, Version const& logStartVersionOverride ) { - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return Future(new DescribeBackupActor(bc, deepScan, logStartVersionOverride)); - #line 3029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -#line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 3034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" // This generated class is to be used only via expireData() - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" template - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class ExpireDataActorState { - #line 3040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ExpireDataActorState(Reference const& bc,Version const& expireEndVersion,bool const& force,IBackupContainer::ExpireProgress* const& progress,Version const& restorableBeginVersion) - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : bc(bc), - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" expireEndVersion(expireEndVersion), - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" force(force), - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" progress(progress), - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorableBeginVersion(restorableBeginVersion) - #line 3055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { fdb_probe_actor_create("expireData", reinterpret_cast(this)); @@ -3065,28 +3078,28 @@ class ExpireDataActorState { int a_body1(int loopDepth=0) { try { - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (progress != nullptr) - #line 3070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" progress->step = "Describing backup"; - #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" progress->total = 0; - #line 3076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent("BackupContainerFileSystemExpire1") .detail("URL", bc->getURL()) .detail("ExpireEndVersion", expireEndVersion) .detail("RestorableBeginVersion", restorableBeginVersion); - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_0 = bc->describeBackup(false, expireEndVersion); - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3107,89 +3120,89 @@ class ExpireDataActorState { } int a_body1cont1(int loopDepth) { - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" expireEndVersion = resolveRelativeVersion(desc.maxLogEnd, expireEndVersion, "ExpireEndVersion", invalid_option_value()); - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorableBeginVersion = resolveRelativeVersion( desc.maxLogEnd, restorableBeginVersion, "RestorableBeginVersion", invalid_option_value()); - #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (restorableBeginVersion < expireEndVersion) - #line 3116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(backup_cannot_expire(), loopDepth); - #line 3120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (expireEndVersion <= desc.expiredEndVersion.orDefault(invalidVersion)) - #line 3124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ExpireDataActorState(); static_cast(this)->destroy(); return 0; } - #line 3128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ExpireDataActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" forceNeeded = true; - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( KeyspaceSnapshotFile& s : desc.snapshots ) { - #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (s.restorable.orDefault(false) && s.beginVersion >= expireEndVersion && s.endVersion <= restorableBeginVersion) - #line 3140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" forceNeeded = false; - #line 3144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" break; } } - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (forceNeeded && !force) - #line 3150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(backup_cannot_expire(), loopDepth); - #line 3154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" scanBegin = desc.expiredEndVersion.orDefault(0); - #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent("BackupContainerFileSystemExpire2") .detail("URL", bc->getURL()) .detail("ExpireEndVersion", expireEndVersion) .detail("RestorableBeginVersion", restorableBeginVersion) .detail("ScanBeginVersion", scanBegin); - #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs = std::vector(); - #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" pLogs = std::vector(); - #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ranges = std::vector(); - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (progress != nullptr) - #line 3168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" progress->step = "Listing files"; - #line 3172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_1 = store(logs, bc->listLogFiles(scanBegin, expireEndVersion - 1, false)) && store(pLogs, bc->listLogFiles(scanBegin, expireEndVersion - 1, true)) && store(ranges, bc->listRangeFiles(scanBegin, expireEndVersion - 1)); - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(BackupDescription const& __desc,int loopDepth) { - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc = __desc; - #line 3192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -3254,198 +3267,198 @@ class ExpireDataActorState { } int a_body1cont3(Void const& _,int loopDepth) { - #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs.insert(logs.end(), std::make_move_iterator(pLogs.begin()), std::make_move_iterator(pLogs.end())); - #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" newLogBeginVersion = Optional(); - #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!logs.empty()) - #line 3263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" LogFile& last = *std::max_element(logs.begin(), logs.end()); - #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (last.endVersion == expireEndVersion) - #line 3269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" newLogBeginVersion = expireEndVersion; - #line 3273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } else { - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (last.endVersion > expireEndVersion) - #line 3279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" newLogBeginVersion = last.beginVersion; - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" last = LogFile(); - #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" expireEndVersion = newLogBeginVersion.get(); - #line 3287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } } - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" toDelete = std::vector(); - #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto const& f : logs ) { - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!f.fileName.empty()) - #line 3297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" toDelete.push_back(std::move(f.fileName)); - #line 3301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs.clear(); - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto const& f : ranges ) { - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (f.version < expireEndVersion) - #line 3310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" toDelete.push_back(std::move(f.fileName)); - #line 3314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ranges.clear(); - #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto const& f : desc.snapshots ) { - #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (f.endVersion < expireEndVersion) - #line 3323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" toDelete.push_back(std::move(f.fileName)); - #line 3327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc = BackupDescription(); - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (progress != nullptr) - #line 3334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" progress->step = "Initial metadata update"; - #line 3338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_2 = bc->unreliableEndVersion().get(); - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs.insert(logs.end(), std::make_move_iterator(pLogs.begin()), std::make_move_iterator(pLogs.end())); - #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" newLogBeginVersion = Optional(); - #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!logs.empty()) - #line 3362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" LogFile& last = *std::max_element(logs.begin(), logs.end()); - #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (last.endVersion == expireEndVersion) - #line 3368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" newLogBeginVersion = expireEndVersion; - #line 3372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } else { - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (last.endVersion > expireEndVersion) - #line 3378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" newLogBeginVersion = last.beginVersion; - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" last = LogFile(); - #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" expireEndVersion = newLogBeginVersion.get(); - #line 3386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } } - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" toDelete = std::vector(); - #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto const& f : logs ) { - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!f.fileName.empty()) - #line 3396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" toDelete.push_back(std::move(f.fileName)); - #line 3400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs.clear(); - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto const& f : ranges ) { - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (f.version < expireEndVersion) - #line 3409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" toDelete.push_back(std::move(f.fileName)); - #line 3413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ranges.clear(); - #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto const& f : desc.snapshots ) { - #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (f.endVersion < expireEndVersion) - #line 3422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" toDelete.push_back(std::move(f.fileName)); - #line 3426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc = BackupDescription(); - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (progress != nullptr) - #line 3433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" progress->step = "Initial metadata update"; - #line 3437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_2 = bc->unreliableEndVersion().get(); - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3515,20 +3528,20 @@ class ExpireDataActorState { } int a_body1cont10(Optional const& metaUnreliableEnd,int loopDepth) { - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (metaUnreliableEnd.orDefault(0) < expireEndVersion) - #line 3520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_3 = bc->unreliableEndVersion().set(expireEndVersion); - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont10when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -3540,20 +3553,20 @@ class ExpireDataActorState { } int a_body1cont10(Optional && metaUnreliableEnd,int loopDepth) { - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (metaUnreliableEnd.orDefault(0) < expireEndVersion) - #line 3545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_3 = bc->unreliableEndVersion().set(expireEndVersion); - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont10when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -3628,23 +3641,23 @@ class ExpireDataActorState { } int a_body1cont10cont1(int loopDepth) { - #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (progress != nullptr) - #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" progress->step = "Deleting files"; - #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" progress->total = toDelete.size(); - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" progress->done = 0; - #line 3641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" deleteFutures = std::list>(); - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ; - #line 3647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont10cont1loopHead1(loopDepth); return loopDepth; @@ -3726,26 +3739,26 @@ class ExpireDataActorState { } int a_body1cont10cont3(int loopDepth) { - #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (progress != nullptr) - #line 3731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" progress->step = "Final metadata update"; - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" progress->total = 0; - #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_5 = bc->expiredEndVersion().get(); - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont10cont3when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3759,25 +3772,25 @@ class ExpireDataActorState { } int a_body1cont10cont1loopBody1(int loopDepth) { - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!(!toDelete.empty() || !deleteFutures.empty())) - #line 3764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { return a_body1cont10cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for(;!toDelete.empty() && deleteFutures.size() < CLIENT_KNOBS->BACKUP_CONCURRENT_DELETES;) { - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" deleteFutures.push_back(bc->deleteFile(toDelete.back())); - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" toDelete.pop_back(); - #line 3774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" targetFuturesSize = toDelete.empty() ? 0 : (CLIENT_KNOBS->BACKUP_CONCURRENT_DELETES - 1); - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ; - #line 3780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont10cont1loopBody1loopHead1(loopDepth); return loopDepth; @@ -3810,22 +3823,22 @@ class ExpireDataActorState { } int a_body1cont10cont1loopBody1loopBody1(int loopDepth) { - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!(deleteFutures.size() > targetFuturesSize)) - #line 3815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { return a_body1cont10cont1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_4 = deleteFutures.front(); - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 3823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 2)); else return a_body1cont10cont1loopBody1loopBody1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3845,34 +3858,34 @@ class ExpireDataActorState { } int a_body1cont10cont1loopBody1loopBody1cont1(Void const& _,int loopDepth) { - #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (progress != nullptr) - #line 3850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ++progress->done; - #line 3854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" deleteFutures.pop_front(); - #line 3858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (loopDepth == 0) return a_body1cont10cont1loopBody1loopHead1(0); return loopDepth; } int a_body1cont10cont1loopBody1loopBody1cont1(Void && _,int loopDepth) { - #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (progress != nullptr) - #line 3867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ++progress->done; - #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" deleteFutures.pop_front(); - #line 3875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (loopDepth == 0) return a_body1cont10cont1loopBody1loopHead1(0); return loopDepth; @@ -3942,20 +3955,20 @@ class ExpireDataActorState { } int a_body1cont10cont5(Optional const& metaExpiredEnd,int loopDepth) { - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (metaExpiredEnd.orDefault(0) < expireEndVersion) - #line 3947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_6 = bc->expiredEndVersion().set(expireEndVersion); - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont10cont5when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -3967,20 +3980,20 @@ class ExpireDataActorState { } int a_body1cont10cont5(Optional && metaExpiredEnd,int loopDepth) { - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (metaExpiredEnd.orDefault(0) < expireEndVersion) - #line 3972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_6 = bc->expiredEndVersion().set(expireEndVersion); - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont10cont5when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 3996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -4055,9 +4068,9 @@ class ExpireDataActorState { } int a_body1cont10cont7(int loopDepth) { - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ExpireDataActorState(); static_cast(this)->destroy(); return 0; } - #line 4060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ExpireDataActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4140,42 +4153,42 @@ class ExpireDataActorState { fdb_probe_actor_exit("expireData", reinterpret_cast(this), 6); } - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference bc; - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version expireEndVersion; - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" bool force; - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" IBackupContainer::ExpireProgress* progress; - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version restorableBeginVersion; - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" BackupDescription desc; - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" bool forceNeeded; - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version scanBegin; - #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector logs; - #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector pLogs; - #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector ranges; - #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Optional newLogBeginVersion; - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector toDelete; - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::list> deleteFutures; - #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int targetFuturesSize; - #line 4173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; // This generated class is to be used only via expireData() - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class ExpireDataActor final : public Actor, public ActorCallback< ExpireDataActor, 0, BackupDescription >, public ActorCallback< ExpireDataActor, 1, Void >, public ActorCallback< ExpireDataActor, 2, Optional >, public ActorCallback< ExpireDataActor, 3, Void >, public ActorCallback< ExpireDataActor, 4, Void >, public ActorCallback< ExpireDataActor, 5, Optional >, public ActorCallback< ExpireDataActor, 6, Void >, public FastAllocated, public ExpireDataActorState { - #line 4178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4190,9 +4203,9 @@ friend struct ActorCallback< ExpireDataActor, 3, Void >; friend struct ActorCallback< ExpireDataActor, 4, Void >; friend struct ActorCallback< ExpireDataActor, 5, Optional >; friend struct ActorCallback< ExpireDataActor, 6, Void >; - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ExpireDataActor(Reference const& bc,Version const& expireEndVersion,bool const& force,IBackupContainer::ExpireProgress* const& progress,Version const& restorableBeginVersion) - #line 4195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), ExpireDataActorState(bc, expireEndVersion, force, progress, restorableBeginVersion) { @@ -4221,14 +4234,14 @@ friend struct ActorCallback< ExpireDataActor, 6, Void >; } }; - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" [[nodiscard]] static Future expireData( Reference const& bc, Version const& expireEndVersion, bool const& force, IBackupContainer::ExpireProgress* const& progress, Version const& restorableBeginVersion ) { - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return Future(new ExpireDataActor(bc, expireEndVersion, force, progress, restorableBeginVersion)); - #line 4228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -#line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" // Returns true if logs are continuous in the range [begin, end]. // "files" should be pre-sorted according to version order. @@ -4310,28 +4323,28 @@ friend struct ActorCallback< ExpireDataActor, 6, Void >; // If "logsOnly" is true, then only log files are returned and "keyRangesFilter" is ignored, // because the log can contain mutations of the whole key space, unlike range files that each // is limited to a smaller key range. - #line 4313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" // This generated class is to be used only via getRestoreSet() - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" template - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class GetRestoreSetActorState { - #line 4319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" GetRestoreSetActorState(Reference const& bc,Version const& targetVersion,VectorRef const& keyRangesFilter,bool const& logsOnly = false,Version const& beginVersion = invalidVersion) - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : bc(bc), - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" targetVersion(targetVersion), - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" keyRangesFilter(keyRangesFilter), - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logsOnly(logsOnly), - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" beginVersion(beginVersion) - #line 4334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { fdb_probe_actor_create("getRestoreSet", reinterpret_cast(this)); @@ -4344,34 +4357,34 @@ class GetRestoreSetActorState { int a_body1(int loopDepth=0) { try { - #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( const auto& range : keyRangesFilter ) { - #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent("BackupContainerGetRestoreSet").detail("RangeFilter", printable(range)); - #line 4351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (logsOnly) - #line 4355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorableSet = RestorableFileSet(); - #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorableSet.targetVersion = targetVersion; - #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logFiles = std::vector(); - #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version begin = beginVersion == invalidVersion ? 0 : beginVersion; - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_0 = store(logFiles, bc->listLogFiles(begin, targetVersion, false)); - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -4397,31 +4410,31 @@ class GetRestoreSetActorState { } int a_body1cont1(int loopDepth) { - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_1 = bc->listKeyspaceSnapshots(); - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(Void const& _,int loopDepth) { - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(logFiles.begin(), logFiles.end()); - #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!logFiles.empty()) - #line 4420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(getRestoreSetFromLogs(logFiles, targetVersion, restorableSet)); this->~GetRestoreSetActorState(); static_cast(this)->destroy(); return 0; } - #line 4424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(getRestoreSetFromLogs(logFiles, targetVersion, restorableSet)); this->~GetRestoreSetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4433,15 +4446,15 @@ class GetRestoreSetActorState { } int a_body1cont3(Void && _,int loopDepth) { - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(logFiles.begin(), logFiles.end()); - #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!logFiles.empty()) - #line 4440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(getRestoreSetFromLogs(logFiles, targetVersion, restorableSet)); this->~GetRestoreSetActorState(); static_cast(this)->destroy(); return 0; } - #line 4444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(getRestoreSetFromLogs(logFiles, targetVersion, restorableSet)); this->~GetRestoreSetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4516,20 +4529,20 @@ class GetRestoreSetActorState { } int a_body1cont6(int loopDepth) { - #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" i = snapshots.size() - 1; - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ; - #line 4523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont6loopHead1(loopDepth); return loopDepth; } int a_body1cont1when1(std::vector const& __snapshots,int loopDepth) { - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshots = __snapshots; - #line 4532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont6(loopDepth); return loopDepth; @@ -4594,9 +4607,9 @@ class GetRestoreSetActorState { } int a_body1cont7(int loopDepth) { - #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GetRestoreSetActorState(); static_cast(this)->destroy(); return 0; } - #line 4599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~GetRestoreSetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4613,34 +4626,34 @@ class GetRestoreSetActorState { } int a_body1cont6loopBody1(int loopDepth) { - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!(i >= 0)) - #line 4618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { return a_body1cont6break1(loopDepth==0?0:loopDepth-1); // break } - #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (targetVersion >= 0 && snapshots[i].beginVersion > targetVersion) - #line 4624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { return a_body1cont6continue1(loopDepth); // continue } - #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable = RestorableFileSet(); - #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" minKeyRangeVersion = MAX_VERSION; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" maxKeyRangeVersion = -1; - #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture, std::map>> __when_expr_2 = bc->readKeyspaceSnapshot(snapshots[i]); - #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont6loopBody1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast, std::map> >*>(static_cast(this))); - #line 4643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4660,178 +4673,194 @@ class GetRestoreSetActorState { } int a_body1cont6continue1(int loopDepth) { - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" i--; - #line 4665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (loopDepth == 0) return a_body1cont6loopHead1(0); return loopDepth; } int a_body1cont6loopBody1cont1(std::pair, std::map> const& results,int loopDepth) { - #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (keyRangesFilter.size() && results.second.empty() && !results.first.empty()) - #line 4674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - { - #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - return a_body1Catch1(backup_not_filterable_with_key_ranges(), std::max(0, loopDepth - 1)); - #line 4678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - } - #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (keyRangesFilter.empty()) - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (keyRangesFilter.empty() || results.second.empty()) + #line 4687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.ranges = std::move(results.first); - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.keyRanges = std::move(results.second); - #line 951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" minKeyRangeVersion = snapshots[i].beginVersion; - #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" maxKeyRangeVersion = snapshots[i].endVersion; - #line 4692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } else { - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( const auto& rangeFile : results.first ) { - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" const auto& keyRange = results.second.at(rangeFile.fileName); - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (keyRange.intersects(keyRangesFilter)) - #line 4702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.ranges.push_back(rangeFile); - #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.keyRanges[rangeFile.fileName] = keyRange; - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" minKeyRangeVersion = std::min(minKeyRangeVersion, rangeFile.version); - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" maxKeyRangeVersion = std::max(maxKeyRangeVersion, rangeFile.version); - #line 4712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (restorable.ranges.empty()) - #line 4717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(backup_not_overlapped_with_keys_filter(), std::max(0, loopDepth - 1)); - #line 4721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.targetVersion = targetVersion == latestVersion ? maxKeyRangeVersion : targetVersion; - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (restorable.targetVersion < maxKeyRangeVersion) - #line 4728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { return a_body1cont6continue1(loopDepth); // continue } - #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.snapshot = snapshots[i]; - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (false && g_network->isSimulated()) - #line 4736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - { - #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - rit = std::map::iterator(); - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - rit = restorable.keyRanges.begin(); - #line 4742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - loopDepth = a_body1cont6loopBody1cont1loopHead1(loopDepth); - } - else + #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (minKeyRangeVersion == maxKeyRangeVersion && maxKeyRangeVersion == restorable.targetVersion) + #line 4741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - loopDepth = a_body1cont6loopBody1cont4(loopDepth); + #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + restorable.continuousBeginVersion = restorable.continuousEndVersion = invalidVersion; + #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + TraceEvent("BackupContainerGetRestorableFilesWithoutLogs") .detail("KeyRangeVersion", restorable.targetVersion) .detail("NumberOfRangeFiles", restorable.ranges.size()) .detail("KeyRangesFilter", printable(keyRangesFilter)); + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(Optional(restorable)); this->~GetRestoreSetActorState(); static_cast(this)->destroy(); return 0; } + #line 4749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(restorable)); + this->~GetRestoreSetActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } + #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + logs = std::vector(); + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + plogs = std::vector(); + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + StrictFuture __when_expr_3 = store(logs, bc->listLogFiles(minKeyRangeVersion, restorable.targetVersion, false)) && store(plogs, bc->listLogFiles(minKeyRangeVersion, restorable.targetVersion, true)); + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 4763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont6loopBody1cont1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + loopDepth = 0; return loopDepth; } int a_body1cont6loopBody1cont1(std::pair, std::map> && results,int loopDepth) { - #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (keyRangesFilter.size() && results.second.empty() && !results.first.empty()) - #line 4756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - { - #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - return a_body1Catch1(backup_not_filterable_with_key_ranges(), std::max(0, loopDepth - 1)); - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - } - #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (keyRangesFilter.empty()) - #line 4764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (keyRangesFilter.empty() || results.second.empty()) + #line 4777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.ranges = std::move(results.first); - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.keyRanges = std::move(results.second); - #line 951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" minKeyRangeVersion = snapshots[i].beginVersion; - #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" maxKeyRangeVersion = snapshots[i].endVersion; - #line 4774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } else { - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( const auto& rangeFile : results.first ) { - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" const auto& keyRange = results.second.at(rangeFile.fileName); - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (keyRange.intersects(keyRangesFilter)) - #line 4784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.ranges.push_back(rangeFile); - #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.keyRanges[rangeFile.fileName] = keyRange; - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" minKeyRangeVersion = std::min(minKeyRangeVersion, rangeFile.version); - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" maxKeyRangeVersion = std::max(maxKeyRangeVersion, rangeFile.version); - #line 4794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (restorable.ranges.empty()) - #line 4799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(backup_not_overlapped_with_keys_filter(), std::max(0, loopDepth - 1)); - #line 4803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.targetVersion = targetVersion == latestVersion ? maxKeyRangeVersion : targetVersion; - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (restorable.targetVersion < maxKeyRangeVersion) - #line 4810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { return a_body1cont6continue1(loopDepth); // continue } - #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.snapshot = snapshots[i]; - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (false && g_network->isSimulated()) - #line 4818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - { - #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - rit = std::map::iterator(); - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - rit = restorable.keyRanges.begin(); - #line 4824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - loopDepth = a_body1cont6loopBody1cont1loopHead1(loopDepth); - } - else + #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (minKeyRangeVersion == maxKeyRangeVersion && maxKeyRangeVersion == restorable.targetVersion) + #line 4831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - loopDepth = a_body1cont6loopBody1cont4(loopDepth); + #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + restorable.continuousBeginVersion = restorable.continuousEndVersion = invalidVersion; + #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + TraceEvent("BackupContainerGetRestorableFilesWithoutLogs") .detail("KeyRangeVersion", restorable.targetVersion) .detail("NumberOfRangeFiles", restorable.ranges.size()) .detail("KeyRangesFilter", printable(keyRangesFilter)); + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(Optional(restorable)); this->~GetRestoreSetActorState(); static_cast(this)->destroy(); return 0; } + #line 4839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(restorable)); + this->~GetRestoreSetActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } - - return loopDepth; - } - int a_body1cont6loopBody1when1(std::pair, std::map> const& results,int loopDepth) + #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + logs = std::vector(); + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + plogs = std::vector(); + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + StrictFuture __when_expr_3 = store(logs, bc->listLogFiles(minKeyRangeVersion, restorable.targetVersion, false)) && store(plogs, bc->listLogFiles(minKeyRangeVersion, restorable.targetVersion, true)); + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 4853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont6loopBody1cont1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont6loopBody1when1(std::pair, std::map> const& results,int loopDepth) { loopDepth = a_body1cont6loopBody1cont1(results, loopDepth); @@ -4894,353 +4923,180 @@ class GetRestoreSetActorState { fdb_probe_actor_exit("getRestoreSet", reinterpret_cast(this), 2); } - int a_body1cont6loopBody1cont4(int loopDepth) - { - #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (minKeyRangeVersion == maxKeyRangeVersion && maxKeyRangeVersion == restorable.targetVersion) - #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - { - #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - restorable.continuousBeginVersion = restorable.continuousEndVersion = invalidVersion; - #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - TraceEvent("BackupContainerGetRestorableFilesWithoutLogs") .detail("KeyRangeVersion", restorable.targetVersion) .detail("NumberOfRangeFiles", restorable.ranges.size()) .detail("KeyRangesFilter", printable(keyRangesFilter)); - #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(Optional(restorable)); this->~GetRestoreSetActorState(); static_cast(this)->destroy(); return 0; } - #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(restorable)); - this->~GetRestoreSetActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - logs = std::vector(); - #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - plogs = std::vector(); - #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - StrictFuture __when_expr_4 = store(logs, bc->listLogFiles(minKeyRangeVersion, restorable.targetVersion, false)) && store(plogs, bc->listLogFiles(minKeyRangeVersion, restorable.targetVersion, true)); - #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont6loopBody1cont4when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont6loopBody1cont12(int loopDepth) - { - loopDepth = a_body1cont6loopBody1cont4(loopDepth); - - return loopDepth; - } - int a_body1cont6loopBody1cont1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont6loopBody1cont1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1cont6loopBody1cont1loopBody1(int loopDepth) - { - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (!(rit != restorable.keyRanges.end())) - #line 4950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - { - return a_body1cont6loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break - } - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - auto it = std::find_if(restorable.ranges.begin(), restorable.ranges.end(), [file = rit->first](const RangeFile f) { return f.fileName == file; }); - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - ASSERT(it != restorable.ranges.end()); - #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - StrictFuture __when_expr_3 = bc->getSnapshotFileKeyRange(*it); - #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 4962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 2)); else return a_body1cont6loopBody1cont1loopBody1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont6loopBody1cont1break1(int loopDepth) - { - try { - return a_body1cont6loopBody1cont12(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - int a_body1cont6loopBody1cont1loopBody1cont1(KeyRange const& result,int loopDepth) - { - #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - ASSERT(rit->second.begin <= result.begin && rit->second.end >= result.end); - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - rit++; - #line 4991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - if (loopDepth == 0) return a_body1cont6loopBody1cont1loopHead1(0); - - return loopDepth; - } - int a_body1cont6loopBody1cont1loopBody1cont1(KeyRange && result,int loopDepth) - { - #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - ASSERT(rit->second.begin <= result.begin && rit->second.end >= result.end); - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - rit++; - #line 5002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - if (loopDepth == 0) return a_body1cont6loopBody1cont1loopHead1(0); - - return loopDepth; - } - int a_body1cont6loopBody1cont1loopBody1when1(KeyRange const& result,int loopDepth) - { - loopDepth = a_body1cont6loopBody1cont1loopBody1cont1(result, loopDepth); - - return loopDepth; - } - int a_body1cont6loopBody1cont1loopBody1when1(KeyRange && result,int loopDepth) - { - loopDepth = a_body1cont6loopBody1cont1loopBody1cont1(std::move(result), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRestoreSetActor, 3, KeyRange >::remove(); - - } - void a_callback_fire(ActorCallback< GetRestoreSetActor, 3, KeyRange >*,KeyRange const& value) - { - fdb_probe_actor_enter("getRestoreSet", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont6loopBody1cont1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getRestoreSet", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< GetRestoreSetActor, 3, KeyRange >*,KeyRange && value) - { - fdb_probe_actor_enter("getRestoreSet", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont6loopBody1cont1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getRestoreSet", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< GetRestoreSetActor, 3, KeyRange >*,Error err) - { - fdb_probe_actor_enter("getRestoreSet", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getRestoreSet", reinterpret_cast(this), 3); - - } - int a_body1cont6loopBody1cont13(Void const& _,int loopDepth) + int a_body1cont6loopBody1cont4(Void const& _,int loopDepth) { - #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (plogs.size() > 0) - #line 5074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs.swap(plogs); - #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(logs.begin(), logs.end(), [](const LogFile& a, const LogFile& b) { return std::tie(a.tagId, a.beginVersion, a.endVersion) < std::tie(b.tagId, b.beginVersion, b.endVersion); }); - #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector filtered = filterDuplicates(logs); - #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.logs.swap(filtered); - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(restorable.logs.begin(), restorable.logs.end()); - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (isPartitionedLogsContinuous(restorable.logs, minKeyRangeVersion, restorable.targetVersion)) - #line 5088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.continuousBeginVersion = minKeyRangeVersion; - #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.continuousEndVersion = restorable.targetVersion + 1; - #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional(restorable)); this->~GetRestoreSetActorState(); static_cast(this)->destroy(); return 0; } - #line 5096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(restorable)); this->~GetRestoreSetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GetRestoreSetActorState(); static_cast(this)->destroy(); return 0; } - #line 5104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~GetRestoreSetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(logs.begin(), logs.end()); - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!logs.empty() && logs.front().beginVersion <= minKeyRangeVersion) - #line 5114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(getRestoreSetFromLogs(logs, targetVersion, restorable)); this->~GetRestoreSetActorState(); static_cast(this)->destroy(); return 0; } - #line 5118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(getRestoreSetFromLogs(logs, targetVersion, restorable)); this->~GetRestoreSetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" i--; - #line 5126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (loopDepth == 0) return a_body1cont6loopHead1(0); return loopDepth; } - int a_body1cont6loopBody1cont13(Void && _,int loopDepth) + int a_body1cont6loopBody1cont4(Void && _,int loopDepth) { - #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (plogs.size() > 0) - #line 5135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 4991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs.swap(plogs); - #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(logs.begin(), logs.end(), [](const LogFile& a, const LogFile& b) { return std::tie(a.tagId, a.beginVersion, a.endVersion) < std::tie(b.tagId, b.beginVersion, b.endVersion); }); - #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector filtered = filterDuplicates(logs); - #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.logs.swap(filtered); - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(restorable.logs.begin(), restorable.logs.end()); - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (isPartitionedLogsContinuous(restorable.logs, minKeyRangeVersion, restorable.targetVersion)) - #line 5149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.continuousBeginVersion = minKeyRangeVersion; - #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" restorable.continuousEndVersion = restorable.targetVersion + 1; - #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional(restorable)); this->~GetRestoreSetActorState(); static_cast(this)->destroy(); return 0; } - #line 5157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(restorable)); this->~GetRestoreSetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GetRestoreSetActorState(); static_cast(this)->destroy(); return 0; } - #line 5165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~GetRestoreSetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(logs.begin(), logs.end()); - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!logs.empty() && logs.front().beginVersion <= minKeyRangeVersion) - #line 5175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(getRestoreSetFromLogs(logs, targetVersion, restorable)); this->~GetRestoreSetActorState(); static_cast(this)->destroy(); return 0; } - #line 5179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(getRestoreSetFromLogs(logs, targetVersion, restorable)); this->~GetRestoreSetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" i--; - #line 5187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (loopDepth == 0) return a_body1cont6loopHead1(0); return loopDepth; } - int a_body1cont6loopBody1cont4when1(Void const& _,int loopDepth) + int a_body1cont6loopBody1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont6loopBody1cont13(_, loopDepth); + loopDepth = a_body1cont6loopBody1cont4(_, loopDepth); return loopDepth; } - int a_body1cont6loopBody1cont4when1(Void && _,int loopDepth) + int a_body1cont6loopBody1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont6loopBody1cont13(std::move(_), loopDepth); + loopDepth = a_body1cont6loopBody1cont4(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose5() + void a_exitChoose4() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRestoreSetActor, 4, Void >::remove(); + static_cast(this)->ActorCallback< GetRestoreSetActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< GetRestoreSetActor, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetRestoreSetActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("getRestoreSet", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getRestoreSet", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont6loopBody1cont4when1(value, 0); + a_body1cont6loopBody1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRestoreSet", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getRestoreSet", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< GetRestoreSetActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetRestoreSetActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("getRestoreSet", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getRestoreSet", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont6loopBody1cont4when1(std::move(value), 0); + a_body1cont6loopBody1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRestoreSet", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getRestoreSet", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< GetRestoreSetActor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< GetRestoreSetActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("getRestoreSet", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getRestoreSet", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -5249,45 +5105,43 @@ class GetRestoreSetActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRestoreSet", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getRestoreSet", reinterpret_cast(this), 3); } - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference bc; - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version targetVersion; - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" VectorRef keyRangesFilter; - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" bool logsOnly; - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version beginVersion; - #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" RestorableFileSet restorableSet; - #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector logFiles; - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector snapshots; - #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - int i; #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + int i; + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" RestorableFileSet restorable; - #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version minKeyRangeVersion; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version maxKeyRangeVersion; - #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - std::map::iterator rit; - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector logs; - #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector plogs; - #line 5285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; // This generated class is to be used only via getRestoreSet() - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -class GetRestoreSetActor final : public Actor>, public ActorCallback< GetRestoreSetActor, 0, Void >, public ActorCallback< GetRestoreSetActor, 1, std::vector >, public ActorCallback< GetRestoreSetActor, 2, std::pair, std::map> >, public ActorCallback< GetRestoreSetActor, 3, KeyRange >, public ActorCallback< GetRestoreSetActor, 4, Void >, public FastAllocated, public GetRestoreSetActorState { - #line 5290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class GetRestoreSetActor final : public Actor>, public ActorCallback< GetRestoreSetActor, 0, Void >, public ActorCallback< GetRestoreSetActor, 1, std::vector >, public ActorCallback< GetRestoreSetActor, 2, std::pair, std::map> >, public ActorCallback< GetRestoreSetActor, 3, Void >, public FastAllocated, public GetRestoreSetActorState { + #line 5144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5298,11 +5152,10 @@ class GetRestoreSetActor final : public Actor>, publ friend struct ActorCallback< GetRestoreSetActor, 0, Void >; friend struct ActorCallback< GetRestoreSetActor, 1, std::vector >; friend struct ActorCallback< GetRestoreSetActor, 2, std::pair, std::map> >; -friend struct ActorCallback< GetRestoreSetActor, 3, KeyRange >; -friend struct ActorCallback< GetRestoreSetActor, 4, Void >; - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +friend struct ActorCallback< GetRestoreSetActor, 3, Void >; + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" GetRestoreSetActor(Reference const& bc,Version const& targetVersion,VectorRef const& keyRangesFilter,bool const& logsOnly = false,Version const& beginVersion = invalidVersion) - #line 5305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor>(), GetRestoreSetActorState(bc, targetVersion, keyRangesFilter, logsOnly, beginVersion) { @@ -5323,20 +5176,19 @@ friend struct ActorCallback< GetRestoreSetActor, 4, Void >; case 1: this->a_callback_error((ActorCallback< GetRestoreSetActor, 0, Void >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< GetRestoreSetActor, 1, std::vector >*)0, actor_cancelled()); break; case 3: this->a_callback_error((ActorCallback< GetRestoreSetActor, 2, std::pair, std::map> >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< GetRestoreSetActor, 3, KeyRange >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< GetRestoreSetActor, 4, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< GetRestoreSetActor, 3, Void >*)0, actor_cancelled()); break; } } }; - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" [[nodiscard]] static Future> getRestoreSet( Reference const& bc, Version const& targetVersion, VectorRef const& keyRangesFilter, bool const& logsOnly = false, Version const& beginVersion = invalidVersion ) { - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return Future>(new GetRestoreSetActor(bc, targetVersion, keyRangesFilter, logsOnly, beginVersion)); - #line 5336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -#line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" static std::string versionFolderString(Version v, int smallestBucket) { ASSERT_LT(smallestBucket, 14); @@ -5430,24 +5282,407 @@ friend struct ActorCallback< GetRestoreSetActor, 4, Void >; out = f; return true; } - return false; + return false; + } + + // fallback for using existing write api if the underlying blob store doesn't support efficient writeEntireFile + #line 5289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +// This generated class is to be used only via writeEntireFileFallback() + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +template + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class WriteEntireFileFallbackActorState { + #line 5295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +public: + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + WriteEntireFileFallbackActorState(Reference const& bc,std::string const& fileName,std::string const& fileContents) + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + : bc(bc), + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + fileName(fileName), + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + fileContents(fileContents) + #line 5306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + { + fdb_probe_actor_create("writeEntireFileFallback", reinterpret_cast(this)); + + } + ~WriteEntireFileFallbackActorState() + { + fdb_probe_actor_destroy("writeEntireFileFallback", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + StrictFuture> __when_expr_0 = bc->writeFile(fileName); + #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 5328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~WriteEntireFileFallbackActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + StrictFuture __when_expr_1 = objectFile->append(&fileContents[0], fileContents.size()); + #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Reference const& __objectFile,int loopDepth) + { + #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + objectFile = __objectFile; + #line 5367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Reference && __objectFile,int loopDepth) + { + objectFile = std::move(__objectFile); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteEntireFileFallbackActor, 0, Reference >::remove(); + + } + void a_callback_fire(ActorCallback< WriteEntireFileFallbackActor, 0, Reference >*,Reference const& value) + { + fdb_probe_actor_enter("writeEntireFileFallback", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeEntireFileFallback", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< WriteEntireFileFallbackActor, 0, Reference >*,Reference && value) + { + fdb_probe_actor_enter("writeEntireFileFallback", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeEntireFileFallback", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< WriteEntireFileFallbackActor, 0, Reference >*,Error err) + { + fdb_probe_actor_enter("writeEntireFileFallback", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeEntireFileFallback", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + StrictFuture __when_expr_2 = objectFile->finish(); + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + StrictFuture __when_expr_2 = objectFile->finish(); + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteEntireFileFallbackActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WriteEntireFileFallbackActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("writeEntireFileFallback", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeEntireFileFallback", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< WriteEntireFileFallbackActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("writeEntireFileFallback", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeEntireFileFallback", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< WriteEntireFileFallbackActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("writeEntireFileFallback", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeEntireFileFallback", reinterpret_cast(this), 1); + + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 1129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteEntireFileFallbackActorState(); static_cast(this)->destroy(); return 0; } + #line 5529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteEntireFileFallbackActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 1129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteEntireFileFallbackActorState(); static_cast(this)->destroy(); return 0; } + #line 5541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteEntireFileFallbackActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteEntireFileFallbackActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WriteEntireFileFallbackActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("writeEntireFileFallback", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeEntireFileFallback", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< WriteEntireFileFallbackActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("writeEntireFileFallback", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeEntireFileFallback", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< WriteEntireFileFallbackActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("writeEntireFileFallback", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeEntireFileFallback", reinterpret_cast(this), 2); + + } + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + Reference bc; + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + std::string fileName; + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + std::string fileContents; + #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + Reference objectFile; + #line 5620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +}; +// This generated class is to be used only via writeEntireFileFallback() + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class WriteEntireFileFallbackActor final : public Actor, public ActorCallback< WriteEntireFileFallbackActor, 0, Reference >, public ActorCallback< WriteEntireFileFallbackActor, 1, Void >, public ActorCallback< WriteEntireFileFallbackActor, 2, Void >, public FastAllocated, public WriteEntireFileFallbackActorState { + #line 5625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< WriteEntireFileFallbackActor, 0, Reference >; +friend struct ActorCallback< WriteEntireFileFallbackActor, 1, Void >; +friend struct ActorCallback< WriteEntireFileFallbackActor, 2, Void >; + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + WriteEntireFileFallbackActor(Reference const& bc,std::string const& fileName,std::string const& fileContents) + #line 5638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + : Actor(), + WriteEntireFileFallbackActorState(bc, fileName, fileContents) + { + fdb_probe_actor_enter("writeEntireFileFallback", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("writeEntireFileFallback"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("writeEntireFileFallback", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< WriteEntireFileFallbackActor, 0, Reference >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WriteEntireFileFallbackActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< WriteEntireFileFallbackActor, 2, Void >*)0, actor_cancelled()); break; + } + } +}; + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +[[nodiscard]] static Future writeEntireFileFallback( Reference const& bc, std::string const& fileName, std::string const& fileContents ) { + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + return Future(new WriteEntireFileFallbackActor(bc, fileName, fileContents)); + #line 5667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +} + +#line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -#if ENCRYPTION_ENABLED - #line 5437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" // This generated class is to be used only via createTestEncryptionKeyFile() - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" template - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class CreateTestEncryptionKeyFileActorState { - #line 5443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" CreateTestEncryptionKeyFileActorState(std::string const& filename) - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : filename(filename) - #line 5450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { fdb_probe_actor_create("createTestEncryptionKeyFile", reinterpret_cast(this)); @@ -5460,16 +5695,16 @@ class CreateTestEncryptionKeyFileActorState { int a_body1(int loopDepth=0) { try { - #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_0 = IAsyncFileSystem::filesystem()->open( filename, IAsyncFile::OPEN_ATOMIC_WRITE_AND_CREATE | IAsyncFile::OPEN_READWRITE | IAsyncFile::OPEN_CREATE, 0600); - #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5490,31 +5725,31 @@ class CreateTestEncryptionKeyFileActorState { } int a_body1cont1(int loopDepth) { - #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StreamCipherKey testKey(AES_256_KEY_LENGTH); - #line 1139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" testKey.initializeRandomTestKey(); - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" keyFile->write(testKey.data(), testKey.size(), 0); - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_1 = keyFile->sync(); - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(Reference const& __keyFile,int loopDepth) { - #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" keyFile = __keyFile; - #line 5517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -5579,9 +5814,9 @@ class CreateTestEncryptionKeyFileActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CreateTestEncryptionKeyFileActorState(); static_cast(this)->destroy(); return 0; } - #line 5584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CreateTestEncryptionKeyFileActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5591,9 +5826,9 @@ class CreateTestEncryptionKeyFileActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CreateTestEncryptionKeyFileActorState(); static_cast(this)->destroy(); return 0; } - #line 5596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CreateTestEncryptionKeyFileActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5664,16 +5899,16 @@ class CreateTestEncryptionKeyFileActorState { fdb_probe_actor_exit("createTestEncryptionKeyFile", reinterpret_cast(this), 1); } - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::string filename; - #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference keyFile; - #line 5671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; // This generated class is to be used only via createTestEncryptionKeyFile() - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class CreateTestEncryptionKeyFileActor final : public Actor, public ActorCallback< CreateTestEncryptionKeyFileActor, 0, Reference >, public ActorCallback< CreateTestEncryptionKeyFileActor, 1, Void >, public FastAllocated, public CreateTestEncryptionKeyFileActorState { - #line 5676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5683,9 +5918,9 @@ class CreateTestEncryptionKeyFileActor final : public Actor, public ActorC #pragma clang diagnostic pop friend struct ActorCallback< CreateTestEncryptionKeyFileActor, 0, Reference >; friend struct ActorCallback< CreateTestEncryptionKeyFileActor, 1, Void >; - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" CreateTestEncryptionKeyFileActor(std::string const& filename) - #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), CreateTestEncryptionKeyFileActorState(filename) { @@ -5709,33 +5944,33 @@ friend struct ActorCallback< CreateTestEncryptionKeyFileActor, 1, Void >; } }; - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" [[nodiscard]] static Future createTestEncryptionKeyFile( std::string const& filename ) { - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return Future(new CreateTestEncryptionKeyFileActor(filename)); - #line 5716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -#line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 5721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" // This generated class is to be used only via readEncryptionKey() - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" template - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class ReadEncryptionKeyActorState { - #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ReadEncryptionKeyActorState(std::string const& encryptionKeyFileName) - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : encryptionKeyFileName(encryptionKeyFileName), - #line 1146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" keyFile(), - #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" cipherKey(StreamCipherKey::getGlobalCipherKey()) - #line 5738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { fdb_probe_actor_create("readEncryptionKey", reinterpret_cast(this)); @@ -5749,16 +5984,16 @@ class ReadEncryptionKeyActorState { { try { try { - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_0 = IAsyncFileSystem::filesystem()->open(encryptionKeyFileName, 0x0, 0400); - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 5756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 5996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5785,16 +6020,16 @@ class ReadEncryptionKeyActorState { } int a_body1cont1(int loopDepth) { - #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_1 = keyFile->read(cipherKey->data(), cipherKey->size(), 0); - #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -5802,11 +6037,11 @@ class ReadEncryptionKeyActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent(SevWarnAlways, "FailedToOpenEncryptionKeyFile") .error(e) .detail("FileName", encryptionKeyFileName); - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 5809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -5818,18 +6053,18 @@ class ReadEncryptionKeyActorState { } int a_body1cont2(Reference const& _keyFile,int loopDepth) { - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" keyFile = _keyFile; - #line 5823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont4(loopDepth); return loopDepth; } int a_body1cont2(Reference && _keyFile,int loopDepth) { - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" keyFile = _keyFile; - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont4(loopDepth); return loopDepth; @@ -5912,21 +6147,21 @@ class ReadEncryptionKeyActorState { } int a_body1cont5(int const& bytesRead,int loopDepth) { - #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (bytesRead != cipherKey->size()) - #line 5917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent(SevWarnAlways, "InvalidEncryptionKeyFileSize") .detail("ExpectedSize", cipherKey->size()) .detail("ActualSize", bytesRead); - #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(invalid_encryption_key_file(), loopDepth); - #line 5923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(bytesRead, cipherKey->size()); - #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReadEncryptionKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 5929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ReadEncryptionKeyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5936,21 +6171,21 @@ class ReadEncryptionKeyActorState { } int a_body1cont5(int && bytesRead,int loopDepth) { - #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (bytesRead != cipherKey->size()) - #line 5941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent(SevWarnAlways, "InvalidEncryptionKeyFileSize") .detail("ExpectedSize", cipherKey->size()) .detail("ActualSize", bytesRead); - #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(invalid_encryption_key_file(), loopDepth); - #line 5947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(bytesRead, cipherKey->size()); - #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReadEncryptionKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 5953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ReadEncryptionKeyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6021,18 +6256,18 @@ class ReadEncryptionKeyActorState { fdb_probe_actor_exit("readEncryptionKey", reinterpret_cast(this), 1); } - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::string encryptionKeyFileName; - #line 1146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference keyFile; - #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StreamCipherKey const* cipherKey; - #line 6030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; // This generated class is to be used only via readEncryptionKey() - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class ReadEncryptionKeyActor final : public Actor, public ActorCallback< ReadEncryptionKeyActor, 0, Reference >, public ActorCallback< ReadEncryptionKeyActor, 1, int >, public FastAllocated, public ReadEncryptionKeyActorState { - #line 6035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6042,9 +6277,9 @@ class ReadEncryptionKeyActor final : public Actor, public ActorCallback< R #pragma clang diagnostic pop friend struct ActorCallback< ReadEncryptionKeyActor, 0, Reference >; friend struct ActorCallback< ReadEncryptionKeyActor, 1, int >; - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ReadEncryptionKeyActor(std::string const& encryptionKeyFileName) - #line 6047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), ReadEncryptionKeyActorState(encryptionKeyFileName) { @@ -6068,15 +6303,14 @@ friend struct ActorCallback< ReadEncryptionKeyActor, 1, int >; } }; - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" [[nodiscard]] static Future readEncryptionKey( std::string const& encryptionKeyFileName ) { - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return Future(new ReadEncryptionKeyActor(encryptionKeyFileName)); - #line 6075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -#line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -#endif // ENCRYPTION_ENABLED +#line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" }; // class BackupContainerFileSystemImpl @@ -6130,9 +6364,10 @@ BackupContainerFileSystem::readKeyspaceSnapshot(KeyspaceSnapshotFile snapshot) { Future BackupContainerFileSystem::writeKeyspaceSnapshotFile(const std::vector& fileNames, const std::vector>& beginEndKeys, - int64_t totalBytes) { + int64_t totalBytes, + IncludeKeyRangeMap includeKeyRangeMap) { return BackupContainerFileSystemImpl::writeKeyspaceSnapshotFile( - Reference::addRef(this), fileNames, beginEndKeys, totalBytes); + Reference::addRef(this), fileNames, beginEndKeys, totalBytes, includeKeyRangeMap); }; Future> BackupContainerFileSystem::listLogFiles(Version beginVersion, @@ -6261,31 +6496,33 @@ Future BackupContainerFileSystem::expireData(Version expireEndVersion, Reference::addRef(this), expireEndVersion, force, progress, restorableBeginVersion); } - #line 6264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" namespace { // This generated class is to be used only via getSnapshotFileKeyRange_impl() - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" template - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class GetSnapshotFileKeyRange_implActorState { - #line 6271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - GetSnapshotFileKeyRange_implActorState(Reference const& bc,RangeFile const& file) - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + GetSnapshotFileKeyRange_implActorState(Reference const& bc,RangeFile const& file,Database const& cx) + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : bc(bc), - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" file(file), - #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - readFileRetries(0), + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + cx(cx), #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - beginKeySet(false), + readFileRetries(0), #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - beginKey(), + beginKeySet(false), #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + beginKey(), + #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" endKey() - #line 6288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { fdb_probe_actor_create("getSnapshotFileKeyRange_impl", reinterpret_cast(this)); @@ -6298,9 +6535,9 @@ class GetSnapshotFileKeyRange_implActorState { int a_body1(int loopDepth=0) { try { - #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ; - #line 6303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -6321,9 +6558,9 @@ class GetSnapshotFileKeyRange_implActorState { } int a_body1cont1(int loopDepth) { - #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(KeyRange(KeyRangeRef(beginKey, endKey))); this->~GetSnapshotFileKeyRange_implActorState(); static_cast(this)->destroy(); return 0; } - #line 6326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< KeyRange >::value()) KeyRange(KeyRange(KeyRangeRef(beginKey, endKey))); this->~GetSnapshotFileKeyRange_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6341,16 +6578,16 @@ class GetSnapshotFileKeyRange_implActorState { int a_body1loopBody1(int loopDepth) { try { - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_0 = bc->readFile(file.fileName); - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 6348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 6353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6383,43 +6620,43 @@ class GetSnapshotFileKeyRange_implActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (e.code() == error_code_restore_bad_read || e.code() == error_code_restore_unsupported_file_version || e.code() == error_code_restore_corrupted_data_padding) - #line 6388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent(SevError, "BackupContainerGetSnapshotFileKeyRange").error(e); - #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 6394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } else { - #line 1378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (e.code() == error_code_http_request_failed || e.code() == error_code_connection_failed || e.code() == error_code_timed_out || e.code() == error_code_lookup_failed) - #line 6400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent(SevWarnAlways, "BackupContainerGetSnapshotFileKeyRangeConnectionFailure") .error(e) .detail("Retries", ++readFileRetries); - #line 1384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_2 = delayJittered(0.1); - #line 1384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else { - #line 1386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent(SevError, "BackupContainerGetSnapshotFileKeyRangeUnexpectedError").error(e); - #line 1387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 6422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } } @@ -6433,22 +6670,22 @@ class GetSnapshotFileKeyRange_implActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - beginKeySet = false; #line 1362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - j = 0; + beginKeySet = false; #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + j = 0; + #line 1364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ; - #line 6442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1loopBody1cont2loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1when1(Reference const& __inFile,int loopDepth) { - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" inFile = __inFile; - #line 6451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; @@ -6526,24 +6763,24 @@ class GetSnapshotFileKeyRange_implActorState { } int a_body1loopBody1cont2loopBody1(int loopDepth) { - #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!(j < file.fileSize)) - #line 6531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { return a_body1loopBody1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 1364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - int64_t len = std::min(file.blockSize, file.fileSize - j); - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - StrictFuture>> __when_expr_1 = fileBackup::decodeRangeFileBlock(inFile, j, len); #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + int64_t len = std::min(file.blockSize, file.fileSize - j); + #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + StrictFuture>> __when_expr_1 = fileBackup::decodeRangeFileBlock(inFile, j, len, cx); + #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast> >*>(static_cast(this))); - #line 6546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -6563,42 +6800,42 @@ class GetSnapshotFileKeyRange_implActorState { } int a_body1loopBody1cont2loopBody1cont1(Standalone> const& blockData,int loopDepth) { - #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!beginKeySet) - #line 6568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" beginKey = blockData.front().key; - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" beginKeySet = true; - #line 6574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" endKey = blockData.back().key; - #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" j += file.blockSize; - #line 6580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1cont2loopHead1(0); return loopDepth; } int a_body1loopBody1cont2loopBody1cont1(Standalone> && blockData,int loopDepth) { - #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!beginKeySet) - #line 6589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" beginKey = blockData.front().key; - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" beginKeySet = true; - #line 6595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" endKey = blockData.back().key; - #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" j += file.blockSize; - #line 6601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 6838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1cont2loopHead1(0); return loopDepth; @@ -6753,28 +6990,30 @@ class GetSnapshotFileKeyRange_implActorState { fdb_probe_actor_exit("getSnapshotFileKeyRange_impl", reinterpret_cast(this), 2); } - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference bc; - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" RangeFile file; - #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - int readFileRetries; + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + Database cx; #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - bool beginKeySet; + int readFileRetries; #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - Key beginKey; + bool beginKeySet; #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + Key beginKey; + #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Key endKey; - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference inFile; - #line 1362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int64_t j; - #line 6772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; // This generated class is to be used only via getSnapshotFileKeyRange_impl() - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class GetSnapshotFileKeyRange_implActor final : public Actor, public ActorCallback< GetSnapshotFileKeyRange_implActor, 0, Reference >, public ActorCallback< GetSnapshotFileKeyRange_implActor, 1, Standalone> >, public ActorCallback< GetSnapshotFileKeyRange_implActor, 2, Void >, public FastAllocated, public GetSnapshotFileKeyRange_implActorState { - #line 6777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6785,11 +7024,11 @@ class GetSnapshotFileKeyRange_implActor final : public Actor, public A friend struct ActorCallback< GetSnapshotFileKeyRange_implActor, 0, Reference >; friend struct ActorCallback< GetSnapshotFileKeyRange_implActor, 1, Standalone> >; friend struct ActorCallback< GetSnapshotFileKeyRange_implActor, 2, Void >; - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - GetSnapshotFileKeyRange_implActor(Reference const& bc,RangeFile const& file) - #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + GetSnapshotFileKeyRange_implActor(Reference const& bc,RangeFile const& file,Database const& cx) + #line 7029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), - GetSnapshotFileKeyRange_implActorState(bc, file) + GetSnapshotFileKeyRange_implActorState(bc, file, cx) { fdb_probe_actor_enter("getSnapshotFileKeyRange_impl", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -6813,34 +7052,34 @@ friend struct ActorCallback< GetSnapshotFileKeyRange_implActor, 2, Void >; } }; } - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -[[nodiscard]] static Future getSnapshotFileKeyRange_impl( Reference const& bc, RangeFile const& file ) { - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - return Future(new GetSnapshotFileKeyRange_implActor(bc, file)); - #line 6820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +[[nodiscard]] static Future getSnapshotFileKeyRange_impl( Reference const& bc, RangeFile const& file, Database const& cx ) { + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + return Future(new GetSnapshotFileKeyRange_implActor(bc, file, cx)); + #line 7059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -#line 1393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 6825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" namespace { // This generated class is to be used only via writeVersionProperty() - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" template - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class WriteVersionPropertyActorState { - #line 6832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" WriteVersionPropertyActorState(Reference const& bc,std::string const& path,Version const& v) - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : bc(bc), - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" path(path), - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" v(v) - #line 6843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { fdb_probe_actor_create("writeVersionProperty", reinterpret_cast(this)); @@ -6854,16 +7093,16 @@ class WriteVersionPropertyActorState { { try { try { - #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_0 = bc->writeFile(path); - #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 6861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 6866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6891,11 +7130,11 @@ class WriteVersionPropertyActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent(SevWarn, "BackupContainerWritePropertyFailed") .error(e) .detail("URL", bc->getURL()) .detail("Path", path); - #line 1406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 6898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -6907,27 +7146,27 @@ class WriteVersionPropertyActorState { } int a_body1cont2(int loopDepth) { - #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::string s = format("%lld", v); - #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_1 = f->append(s.data(), s.size()); - #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 6916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(Reference const& __f,int loopDepth) { - #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" f = __f; - #line 6930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -6992,32 +7231,32 @@ class WriteVersionPropertyActorState { } int a_body1cont3(Void const& _,int loopDepth) { - #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_2 = f->finish(); - #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 6999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_2 = f->finish(); - #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 7015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -7087,9 +7326,9 @@ class WriteVersionPropertyActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteVersionPropertyActorState(); static_cast(this)->destroy(); return 0; } - #line 7092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WriteVersionPropertyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7099,9 +7338,9 @@ class WriteVersionPropertyActorState { } int a_body1cont4(Void && _,int loopDepth) { - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteVersionPropertyActorState(); static_cast(this)->destroy(); return 0; } - #line 7104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WriteVersionPropertyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7172,20 +7411,20 @@ class WriteVersionPropertyActorState { fdb_probe_actor_exit("writeVersionProperty", reinterpret_cast(this), 2); } - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference bc; - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::string path; - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - Version v; #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + Version v; + #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference f; - #line 7183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; // This generated class is to be used only via writeVersionProperty() - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class WriteVersionPropertyActor final : public Actor, public ActorCallback< WriteVersionPropertyActor, 0, Reference >, public ActorCallback< WriteVersionPropertyActor, 1, Void >, public ActorCallback< WriteVersionPropertyActor, 2, Void >, public FastAllocated, public WriteVersionPropertyActorState { - #line 7188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7196,9 +7435,9 @@ class WriteVersionPropertyActor final : public Actor, public ActorCallback friend struct ActorCallback< WriteVersionPropertyActor, 0, Reference >; friend struct ActorCallback< WriteVersionPropertyActor, 1, Void >; friend struct ActorCallback< WriteVersionPropertyActor, 2, Void >; - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" WriteVersionPropertyActor(Reference const& bc,std::string const& path,Version const& v) - #line 7201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), WriteVersionPropertyActorState(bc, path, v) { @@ -7224,32 +7463,32 @@ friend struct ActorCallback< WriteVersionPropertyActor, 2, Void >; } }; } - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" [[nodiscard]] static Future writeVersionProperty( Reference const& bc, std::string const& path, Version const& v ) { - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return Future(new WriteVersionPropertyActor(bc, path, v)); - #line 7231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -#line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 7236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" namespace { // This generated class is to be used only via readVersionProperty() - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" template - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class ReadVersionPropertyActorState { - #line 7243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ReadVersionPropertyActorState(Reference const& bc,std::string const& path) - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : bc(bc), - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" path(path) - #line 7252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { fdb_probe_actor_create("readVersionProperty", reinterpret_cast(this)); @@ -7263,16 +7502,16 @@ class ReadVersionPropertyActorState { { try { try { - #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_0 = bc->readFile(path); - #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 7270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 7275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7300,23 +7539,23 @@ class ReadVersionPropertyActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 1426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (e.code() == error_code_file_not_found) - #line 7305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~ReadVersionPropertyActorState(); static_cast(this)->destroy(); return 0; } - #line 7309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~ReadVersionPropertyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TraceEvent(SevWarn, "BackupContainerReadPropertyFailed") .error(e) .detail("URL", bc->getURL()) .detail("Path", path); - #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 7319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -7328,25 +7567,25 @@ class ReadVersionPropertyActorState { } int a_body1cont2(int loopDepth) { - #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_1 = f->size(); - #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 7335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(Reference const& __f,int loopDepth) { - #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" f = __f; - #line 7349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -7411,29 +7650,29 @@ class ReadVersionPropertyActorState { } int a_body1cont3(int loopDepth) { - #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" s = std::string(); - #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" s.resize(size); - #line 1416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_2 = f->read((uint8_t*)s.data(), size, 0); - #line 1416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 7422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2when1(int64_t const& __size,int loopDepth) { - #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" size = __size; - #line 7436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; @@ -7498,53 +7737,53 @@ class ReadVersionPropertyActorState { } int a_body1cont4(int const& rs,int loopDepth) { - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version v; - #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int len; - #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (rs == size && sscanf(s.c_str(), "%" SCNd64 "%n", &v, &len) == 1 && len == size) - #line 7507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(v); this->~ReadVersionPropertyActorState(); static_cast(this)->destroy(); return 0; } - #line 7511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(v); this->~ReadVersionPropertyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - TraceEvent(SevWarn, "BackupContainerInvalidProperty").detail("URL", bc->getURL()).detail("Path", path); #line 1424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + TraceEvent(SevWarn, "BackupContainerInvalidProperty").detail("URL", bc->getURL()).detail("Path", path); + #line 1426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch2(backup_invalid_info(), loopDepth); - #line 7521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" return loopDepth; } int a_body1cont4(int && rs,int loopDepth) { - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version v; - #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int len; - #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (rs == size && sscanf(s.c_str(), "%" SCNd64 "%n", &v, &len) == 1 && len == size) - #line 7533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(v); this->~ReadVersionPropertyActorState(); static_cast(this)->destroy(); return 0; } - #line 7537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(v); this->~ReadVersionPropertyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - TraceEvent(SevWarn, "BackupContainerInvalidProperty").detail("URL", bc->getURL()).detail("Path", path); #line 1424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + TraceEvent(SevWarn, "BackupContainerInvalidProperty").detail("URL", bc->getURL()).detail("Path", path); + #line 1426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch2(backup_invalid_info(), loopDepth); - #line 7547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" return loopDepth; } @@ -7611,22 +7850,22 @@ class ReadVersionPropertyActorState { fdb_probe_actor_exit("readVersionProperty", reinterpret_cast(this), 2); } - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference bc; - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - std::string path; #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + std::string path; + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference f; - #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int64_t size; - #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::string s; - #line 7624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; // This generated class is to be used only via readVersionProperty() - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class ReadVersionPropertyActor final : public Actor>, public ActorCallback< ReadVersionPropertyActor, 0, Reference >, public ActorCallback< ReadVersionPropertyActor, 1, int64_t >, public ActorCallback< ReadVersionPropertyActor, 2, int >, public FastAllocated, public ReadVersionPropertyActorState { - #line 7629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7637,9 +7876,9 @@ class ReadVersionPropertyActor final : public Actor>, public A friend struct ActorCallback< ReadVersionPropertyActor, 0, Reference >; friend struct ActorCallback< ReadVersionPropertyActor, 1, int64_t >; friend struct ActorCallback< ReadVersionPropertyActor, 2, int >; - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ReadVersionPropertyActor(Reference const& bc,std::string const& path) - #line 7642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor>(), ReadVersionPropertyActorState(bc, path) { @@ -7665,18 +7904,18 @@ friend struct ActorCallback< ReadVersionPropertyActor, 2, int >; } }; } - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" [[nodiscard]] static Future> readVersionProperty( Reference const& bc, std::string const& path ) { - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return Future>(new ReadVersionPropertyActor(bc, path)); - #line 7672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 7911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -#line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -Future BackupContainerFileSystem::getSnapshotFileKeyRange(const RangeFile& file) { +Future BackupContainerFileSystem::getSnapshotFileKeyRange(const RangeFile& file, Database cx) { ASSERT(g_network->isSimulated()); - return getSnapshotFileKeyRange_impl(Reference::addRef(this), file); + return getSnapshotFileKeyRange_impl(Reference::addRef(this), file, cx); } Future> BackupContainerFileSystem::getRestoreSet(Version targetVersion, @@ -7719,21 +7958,19 @@ Future BackupContainerFileSystem::encryptionSetupComplete() const { return encryptionSetupFuture; } +Future BackupContainerFileSystem::writeEntireFileFallback(const std::string& fileName, + const std::string& fileContents) { + return BackupContainerFileSystemImpl::writeEntireFileFallback( + Reference::addRef(this), fileName, fileContents); +} + void BackupContainerFileSystem::setEncryptionKey(Optional const& encryptionKeyFileName) { if (encryptionKeyFileName.present()) { -#if ENCRYPTION_ENABLED encryptionSetupFuture = BackupContainerFileSystemImpl::readEncryptionKey(encryptionKeyFileName.get()); -#else - encryptionSetupFuture = Void(); -#endif } } Future BackupContainerFileSystem::createTestEncryptionKeyFile(std::string const& filename) { -#if ENCRYPTION_ENABLED return BackupContainerFileSystemImpl::createTestEncryptionKeyFile(filename); -#else - return Void(); -#endif } // Get a BackupContainerFileSystem based on a container URL string @@ -7742,7 +7979,8 @@ Future BackupContainerFileSystem::createTestEncryptionKeyFile(std::string Reference BackupContainerFileSystem::openContainerFS( const std::string& url, const Optional& proxy, - const Optional& encryptionKeyFileName) { + const Optional& encryptionKeyFileName, + bool isBackup) { static std::map> m_cache; Reference& r = m_cache[url]; @@ -7775,16 +8013,52 @@ Reference BackupContainerFileSystem::openContainerFS( for (auto c : resource) if (!isalnum(c) && c != '_' && c != '-' && c != '.' && c != '/') throw backup_invalid_url(); - r = makeReference(bstore, resource, backupParams, encryptionKeyFileName); + r = makeReference( + bstore, resource, backupParams, encryptionKeyFileName, isBackup); } #ifdef BUILD_AZURE_BACKUP else if (u.startsWith("azure://"_sr)) { u.eat("azure://"_sr); - auto accountName = u.eat("@"_sr).toString(); - auto endpoint = u.eat("/"_sr).toString(); - auto containerName = u.eat("/"_sr).toString(); - r = makeReference( - endpoint, accountName, containerName, encryptionKeyFileName); + auto address = u.eat("/"_sr); + if (address.endsWith(std::string(azure::storage_lite::constants::default_endpoint_suffix))) { + CODE_PROBE(true, "Azure backup url with standard azure storage account endpoint"); + // ..core.windows.net/ + auto endPoint = address.toString(); + auto accountName = address.eat("."_sr).toString(); + auto containerName = u.eat("/"_sr).toString(); + r = makeReference( + endPoint, accountName, containerName, encryptionKeyFileName); + } else { + // resolve the network address if necessary + std::string endpoint(address.toString()); + Optional parsedAddress = NetworkAddress::parseOptional(endpoint); + if (!parsedAddress.present()) { + try { + auto hostname = Hostname::parse(endpoint); + auto resolvedAddress = hostname.resolveBlocking(); + if (resolvedAddress.present()) { + CODE_PROBE(true, "Azure backup url with hostname in the endpoint"); + parsedAddress = resolvedAddress.get(); + } + } catch (Error& e) { + TraceEvent(SevError, "InvalidAzureBackupUrl").error(e).detail("Endpoint", endpoint); + throw backup_invalid_url(); + } + } + if (!parsedAddress.present()) { + TraceEvent(SevError, "InvalidAzureBackupUrl").detail("Endpoint", endpoint); + throw backup_invalid_url(); + } + auto accountName = u.eat("/"_sr).toString(); + // Avoid including ":tls" and "(fromHostname)" + // note: the endpoint needs to contain the account name + // so either ".blob.core.windows.net" or ":/" + endpoint = + fmt::format("{}/{}", formatIpPort(parsedAddress.get().ip, parsedAddress.get().port), accountName); + auto containerName = u.eat("/"_sr).toString(); + r = makeReference( + endpoint, accountName, containerName, encryptionKeyFileName); + } } #endif else { @@ -7821,28 +8095,28 @@ int chooseFileSize(std::vector& sizes) { return deterministicRandom()->randomInt(0, 2e6); } - #line 7824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" // This generated class is to be used only via writeAndVerifyFile() - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" template - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class WriteAndVerifyFileActorState { - #line 7830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" WriteAndVerifyFileActorState(Reference const& c,Reference const& f,int const& size,FlowLock* const& lock) - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : c(c), - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" f(f), - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" size(size), - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" lock(lock), - #line 1589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" content() - #line 7845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { fdb_probe_actor_create("writeAndVerifyFile", reinterpret_cast(this)); @@ -7855,16 +8129,16 @@ class WriteAndVerifyFileActorState { int a_body1(int loopDepth=0) { try { - #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_0 = lock->take(TaskPriority::DefaultYield, size); - #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7885,46 +8159,46 @@ class WriteAndVerifyFileActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" releaser = FlowLock::Releaser(*lock, size); - #line 1594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" printf("writeAndVerify size=%d file=%s\n", size, f->getFileName().c_str()); - #line 1595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" content.resize(content.arena(), size); - #line 1596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for(int i = 0;i < content.size();++i) { - #line 1597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" content[i] = (uint8_t)deterministicRandom()->randomInt(0, 256); - #line 7898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" sendBuf = content; - #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ; - #line 7904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" releaser = FlowLock::Releaser(*lock, size); - #line 1594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" printf("writeAndVerify size=%d file=%s\n", size, f->getFileName().c_str()); - #line 1595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" content.resize(content.arena(), size); - #line 1596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for(int i = 0;i < content.size();++i) { - #line 1597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" content[i] = (uint8_t)deterministicRandom()->randomInt(0, 256); - #line 7921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" sendBuf = content; - #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ; - #line 7927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -7994,16 +8268,16 @@ class WriteAndVerifyFileActorState { } int a_body1cont2(int loopDepth) { - #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_2 = f->finish(); - #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -8017,24 +8291,24 @@ class WriteAndVerifyFileActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!(sendBuf.size() > 0)) - #line 8022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" n = std::min(sendBuf.size(), deterministicRandom()->randomInt(1, 16384)); - #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_1 = f->append(sendBuf.begin(), n); - #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 8032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -8054,18 +8328,18 @@ class WriteAndVerifyFileActorState { } int a_body1cont1loopBody1cont1(Void const& _,int loopDepth) { - #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" sendBuf.pop_front(n); - #line 8059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; } int a_body1cont1loopBody1cont1(Void && _,int loopDepth) { - #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" sendBuf.pop_front(n); - #line 8068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; @@ -8135,32 +8409,32 @@ class WriteAndVerifyFileActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_3 = c->readFile(f->getFileName()); - #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 8147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4(Void && _,int loopDepth) { - #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_3 = c->readFile(f->getFileName()); - #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 8163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -8230,25 +8504,25 @@ class WriteAndVerifyFileActorState { } int a_body1cont5(int loopDepth) { - #line 1609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_4 = inputFile->size(); - #line 1609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 1609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4when1(Reference const& __inputFile,int loopDepth) { - #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" inputFile = __inputFile; - #line 8251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont5(loopDepth); return loopDepth; @@ -8313,26 +8587,26 @@ class WriteAndVerifyFileActorState { } int a_body1cont6(int64_t const& fileSize,int loopDepth) { - #line 1610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(size, fileSize); - #line 1611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (size > 0) - #line 8320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" buf = Standalone>(); - #line 1613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" buf.resize(buf.arena(), fileSize); - #line 1614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_5 = inputFile->read(buf.begin(), buf.size(), 0); - #line 1614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont6when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 1614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -8344,26 +8618,26 @@ class WriteAndVerifyFileActorState { } int a_body1cont6(int64_t && fileSize,int loopDepth) { - #line 1610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(size, fileSize); - #line 1611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (size > 0) - #line 8351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" buf = Standalone>(); - #line 1613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" buf.resize(buf.arena(), fileSize); - #line 1614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_5 = inputFile->read(buf.begin(), buf.size(), 0); - #line 1614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont6when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 1614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -8438,9 +8712,9 @@ class WriteAndVerifyFileActorState { } int a_body1cont7(int loopDepth) { - #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteAndVerifyFileActorState(); static_cast(this)->destroy(); return 0; } - #line 8443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WriteAndVerifyFileActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8450,22 +8724,22 @@ class WriteAndVerifyFileActorState { } int a_body1cont8(int const& b,int loopDepth) { - #line 1615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(b, buf.size()); - #line 1616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(buf == content); - #line 8457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont7(loopDepth); return loopDepth; } int a_body1cont8(int && b,int loopDepth) { - #line 1615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(b, buf.size()); - #line 1616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(buf == content); - #line 8468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont7(loopDepth); return loopDepth; @@ -8533,32 +8807,32 @@ class WriteAndVerifyFileActorState { fdb_probe_actor_exit("writeAndVerifyFile", reinterpret_cast(this), 5); } - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference c; - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference f; - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int size; - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" FlowLock* lock; - #line 1589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Standalone> content; - #line 1592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" FlowLock::Releaser releaser; - #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" VectorRef sendBuf; - #line 1602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int n; - #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference inputFile; - #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Standalone> buf; - #line 8556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; // This generated class is to be used only via writeAndVerifyFile() - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class WriteAndVerifyFileActor final : public Actor, public ActorCallback< WriteAndVerifyFileActor, 0, Void >, public ActorCallback< WriteAndVerifyFileActor, 1, Void >, public ActorCallback< WriteAndVerifyFileActor, 2, Void >, public ActorCallback< WriteAndVerifyFileActor, 3, Reference >, public ActorCallback< WriteAndVerifyFileActor, 4, int64_t >, public ActorCallback< WriteAndVerifyFileActor, 5, int >, public FastAllocated, public WriteAndVerifyFileActorState { - #line 8561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8572,9 +8846,9 @@ friend struct ActorCallback< WriteAndVerifyFileActor, 2, Void >; friend struct ActorCallback< WriteAndVerifyFileActor, 3, Reference >; friend struct ActorCallback< WriteAndVerifyFileActor, 4, int64_t >; friend struct ActorCallback< WriteAndVerifyFileActor, 5, int >; - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" WriteAndVerifyFileActor(Reference const& c,Reference const& f,int const& size,FlowLock* const& lock) - #line 8577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), WriteAndVerifyFileActorState(c, f, size, lock) { @@ -8602,14 +8876,14 @@ friend struct ActorCallback< WriteAndVerifyFileActor, 5, int >; } }; - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" [[nodiscard]] Future writeAndVerifyFile( Reference const& c, Reference const& f, int const& size, FlowLock* const& lock ) { - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return Future(new WriteAndVerifyFileActor(c, f, size, lock)); - #line 8609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -#line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" // Randomly advance version by up to 1 second of versions Version nextVersion(Version v) { @@ -8618,26 +8892,26 @@ Version nextVersion(Version v) { } // Write a snapshot file with only begin & end key - #line 8621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" // This generated class is to be used only via testWriteSnapshotFile() - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" template - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class TestWriteSnapshotFileActorState { - #line 8627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TestWriteSnapshotFileActorState(Reference const& file,Key const& begin,Key const& end,uint32_t const& blockSize) - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : file(file), - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" begin(begin), - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" end(end), - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" blockSize(blockSize) - #line 8640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { fdb_probe_actor_create("testWriteSnapshotFile", reinterpret_cast(this)); @@ -8650,20 +8924,20 @@ class TestWriteSnapshotFileActorState { int a_body1(int loopDepth=0) { try { - #line 1629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_GT(blockSize, 3 * sizeof(uint32_t) + begin.size() + end.size()); - #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" uint32_t fileVersion = BACKUP_AGENT_SNAPSHOT_FILE_VERSION; - #line 1633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_0 = file->append((uint8_t*)&fileVersion, sizeof(fileVersion)); - #line 1633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8684,32 +8958,32 @@ class TestWriteSnapshotFileActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_1 = file->appendStringRefWithLen(begin); - #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_1 = file->appendStringRefWithLen(begin); - #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 8986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -8779,32 +9053,32 @@ class TestWriteSnapshotFileActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_2 = file->appendStringRefWithLen(end); - #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_2 = file->appendStringRefWithLen(end); - #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -8874,24 +9148,24 @@ class TestWriteSnapshotFileActorState { } int a_body1cont3(Void const& _,int loopDepth) { - #line 1641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int bytesLeft = blockSize - file->size(); - #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (bytesLeft > 0) - #line 8881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Value paddings = fileBackup::makePadding(bytesLeft); - #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_3 = file->append(paddings.begin(), bytesLeft); - #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -8903,24 +9177,24 @@ class TestWriteSnapshotFileActorState { } int a_body1cont3(Void && _,int loopDepth) { - #line 1641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int bytesLeft = blockSize - file->size(); - #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (bytesLeft > 0) - #line 8910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Value paddings = fileBackup::makePadding(bytesLeft); - #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_3 = file->append(paddings.begin(), bytesLeft); - #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -8995,16 +9269,16 @@ class TestWriteSnapshotFileActorState { } int a_body1cont4(int loopDepth) { - #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_4 = file->finish(); - #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9086,9 +9360,9 @@ class TestWriteSnapshotFileActorState { } int a_body1cont6(Void const& _,int loopDepth) { - #line 1647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TestWriteSnapshotFileActorState(); static_cast(this)->destroy(); return 0; } - #line 9091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TestWriteSnapshotFileActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9098,9 +9372,9 @@ class TestWriteSnapshotFileActorState { } int a_body1cont6(Void && _,int loopDepth) { - #line 1647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TestWriteSnapshotFileActorState(); static_cast(this)->destroy(); return 0; } - #line 9103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TestWriteSnapshotFileActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9171,20 +9445,20 @@ class TestWriteSnapshotFileActorState { fdb_probe_actor_exit("testWriteSnapshotFile", reinterpret_cast(this), 4); } - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference file; - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Key begin; - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Key end; - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" uint32_t blockSize; - #line 9182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; // This generated class is to be used only via testWriteSnapshotFile() - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class TestWriteSnapshotFileActor final : public Actor, public ActorCallback< TestWriteSnapshotFileActor, 0, Void >, public ActorCallback< TestWriteSnapshotFileActor, 1, Void >, public ActorCallback< TestWriteSnapshotFileActor, 2, Void >, public ActorCallback< TestWriteSnapshotFileActor, 3, Void >, public ActorCallback< TestWriteSnapshotFileActor, 4, Void >, public FastAllocated, public TestWriteSnapshotFileActorState { - #line 9187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9197,9 +9471,9 @@ friend struct ActorCallback< TestWriteSnapshotFileActor, 1, Void >; friend struct ActorCallback< TestWriteSnapshotFileActor, 2, Void >; friend struct ActorCallback< TestWriteSnapshotFileActor, 3, Void >; friend struct ActorCallback< TestWriteSnapshotFileActor, 4, Void >; - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TestWriteSnapshotFileActor(Reference const& file,Key const& begin,Key const& end,uint32_t const& blockSize) - #line 9202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), TestWriteSnapshotFileActorState(file, begin, end, blockSize) { @@ -9226,35 +9500,35 @@ friend struct ActorCallback< TestWriteSnapshotFileActor, 4, Void >; } }; - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" [[nodiscard]] static Future testWriteSnapshotFile( Reference const& file, Key const& begin, Key const& end, uint32_t const& blockSize ) { - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return Future(new TestWriteSnapshotFileActor(file, begin, end, blockSize)); - #line 9233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -#line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 1686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 9238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" // This generated class is to be used only via testBackupContainer() - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" template - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class TestBackupContainerActorState { - #line 9244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TestBackupContainerActorState(std::string const& url,Optional const& proxy,Optional const& encryptionKeyFileName) - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : url(url), - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" proxy(proxy), - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" encryptionKeyFileName(encryptionKeyFileName), - #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" lock(100e6) - #line 9257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { fdb_probe_actor_create("testBackupContainer", reinterpret_cast(this)); @@ -9267,20 +9541,20 @@ class TestBackupContainerActorState { int a_body1(int loopDepth=0) { try { - #line 1655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (encryptionKeyFileName.present()) - #line 9272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_0 = BackupContainerFileSystem::createTestEncryptionKeyFile(encryptionKeyFileName.get()); - #line 1656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -9306,22 +9580,22 @@ class TestBackupContainerActorState { } int a_body1cont1(int loopDepth) { - #line 1659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" printf("BackupContainerTest URL %s\n", url.c_str()); - #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" c = IBackupContainer::openContainer(url, proxy, encryptionKeyFileName); - #line 9313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" try { - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_1 = c->deleteContainer(); - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 9319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9409,16 +9683,16 @@ class TestBackupContainerActorState { } int a_body1cont3(int loopDepth) { - #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_2 = c->create(); - #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9426,13 +9700,13 @@ class TestBackupContainerActorState { int a_body1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 1667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (e.code() != error_code_backup_invalid_url && e.code() != error_code_backup_does_not_exist) - #line 9431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 9435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } loopDepth = a_body1cont3(loopDepth); } @@ -9534,70 +9808,70 @@ class TestBackupContainerActorState { } int a_body1cont6(Void const& _,int loopDepth) { - #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" writes = std::vector>(); - #line 1674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshots = std::map>(); - #line 1675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshotSizes = std::map(); - #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshotBeginEndKeys = std::map>>(); - #line 1677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" nRangeFiles = 0; - #line 1678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs = std::map(); - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" v = deterministicRandom()->randomInt64(0, std::numeric_limits::max() / 2); - #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" fileSizes = { 0 }; - #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (StringRef(url).startsWith(LiteralStringRef("blob"))) - #line 9555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (StringRef(url).startsWith("blob"_sr)) + #line 9829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" fileSizes.push_back(CLIENT_KNOBS->BLOBSTORE_MULTIPART_MIN_PART_SIZE); - #line 1685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" fileSizes.push_back(CLIENT_KNOBS->BLOBSTORE_MULTIPART_MIN_PART_SIZE + 10); - #line 9561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 1688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ; - #line 9565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont6loopHead1(loopDepth); return loopDepth; } int a_body1cont6(Void && _,int loopDepth) { - #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" writes = std::vector>(); - #line 1674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshots = std::map>(); - #line 1675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshotSizes = std::map(); - #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshotBeginEndKeys = std::map>>(); - #line 1677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" nRangeFiles = 0; - #line 1678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs = std::map(); - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" v = deterministicRandom()->randomInt64(0, std::numeric_limits::max() / 2); - #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" fileSizes = { 0 }; - #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (StringRef(url).startsWith(LiteralStringRef("blob"))) - #line 9590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (StringRef(url).startsWith("blob"_sr)) + #line 9864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" fileSizes.push_back(CLIENT_KNOBS->BLOBSTORE_MULTIPART_MIN_PART_SIZE); - #line 1685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" fileSizes.push_back(CLIENT_KNOBS->BLOBSTORE_MULTIPART_MIN_PART_SIZE + 10); - #line 9596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 1688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ; - #line 9600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont6loopHead1(loopDepth); return loopDepth; @@ -9667,16 +9941,16 @@ class TestBackupContainerActorState { } int a_body1cont7(int loopDepth) { - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_6 = waitForAll(writes); - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont7when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9690,19 +9964,19 @@ class TestBackupContainerActorState { } int a_body1cont6loopBody1(int loopDepth) { - #line 1689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logStart = v; - #line 1690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" kvfiles = deterministicRandom()->randomInt(0, 3); - #line 1691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - begin = LiteralStringRef(""); - #line 1692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - end = LiteralStringRef(""); - #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + begin = ""_sr; + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + end = ""_sr; + #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" blockSize = 3 * sizeof(uint32_t) + begin.size() + end.size() + 8; - #line 1695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ; - #line 9705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 9979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont6loopBody1loopHead1(loopDepth); return loopDepth; @@ -9722,24 +9996,24 @@ class TestBackupContainerActorState { } int a_body1cont6loopBody1cont1(int loopDepth) { - #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (logStart == v || deterministicRandom()->coinflip()) - #line 9727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" v = nextVersion(v); - #line 9731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_5 = c->writeLogFile(logStart, v, 10); - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 9737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont6loopBody1cont1when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 9742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9753,41 +10027,41 @@ class TestBackupContainerActorState { } int a_body1cont6loopBody1loopBody1(int loopDepth) { - #line 1695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!(kvfiles > 0)) - #line 9758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { return a_body1cont6loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (snapshots.empty()) - #line 9764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshots[v] = {}; - #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshotBeginEndKeys[v] = {}; - #line 1699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshotSizes[v] = 0; - #line 1700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (deterministicRandom()->coinflip()) - #line 9774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" v = nextVersion(v); - #line 9778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } } - #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_3 = c->writeRangeFile(snapshots.rbegin()->first, 0, v, blockSize); - #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 9785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 2)); else return a_body1cont6loopBody1loopBody1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 9790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9807,56 +10081,56 @@ class TestBackupContainerActorState { } int a_body1cont6loopBody1loopBody1cont1(Reference const& range,int loopDepth) { - #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ++nRangeFiles; - #line 1706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" v = nextVersion(v); - #line 1707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshots.rbegin()->second.push_back(range->getFileName()); - #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshotBeginEndKeys.rbegin()->second.emplace_back(begin, end); - #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int size = chooseFileSize(fileSizes); - #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshotSizes.rbegin()->second += size; - #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_4 = testWriteSnapshotFile(range, begin, end, blockSize); - #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 9826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 2)); else return a_body1cont6loopBody1loopBody1cont1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont6loopBody1loopBody1cont1(Reference && range,int loopDepth) { - #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ++nRangeFiles; - #line 1706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" v = nextVersion(v); - #line 1707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshots.rbegin()->second.push_back(range->getFileName()); - #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshotBeginEndKeys.rbegin()->second.emplace_back(begin, end); - #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int size = chooseFileSize(fileSizes); - #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshotSizes.rbegin()->second += size; - #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_4 = testWriteSnapshotFile(range, begin, end, blockSize); - #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 9854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 2)); else return a_body1cont6loopBody1loopBody1cont1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9926,48 +10200,48 @@ class TestBackupContainerActorState { } int a_body1cont6loopBody1loopBody1cont5(Void const& _,int loopDepth) { - #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (deterministicRandom()->random01() < .2) - #line 9931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - writes.push_back(c->writeKeyspaceSnapshotFile( snapshots.rbegin()->second, snapshotBeginEndKeys.rbegin()->second, snapshotSizes.rbegin()->second)); - #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + writes.push_back(c->writeKeyspaceSnapshotFile(snapshots.rbegin()->second, snapshotBeginEndKeys.rbegin()->second, snapshotSizes.rbegin()->second, IncludeKeyRangeMap(BUGGIFY))); + #line 1758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshots[v] = {}; - #line 1720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshotBeginEndKeys[v] = {}; - #line 1721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshotSizes[v] = 0; - #line 9941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" return a_body1cont6loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" --kvfiles; - #line 9946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (loopDepth == 0) return a_body1cont6loopBody1loopHead1(0); return loopDepth; } int a_body1cont6loopBody1loopBody1cont5(Void && _,int loopDepth) { - #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (deterministicRandom()->random01() < .2) - #line 9955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - writes.push_back(c->writeKeyspaceSnapshotFile( snapshots.rbegin()->second, snapshotBeginEndKeys.rbegin()->second, snapshotSizes.rbegin()->second)); - #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + writes.push_back(c->writeKeyspaceSnapshotFile(snapshots.rbegin()->second, snapshotBeginEndKeys.rbegin()->second, snapshotSizes.rbegin()->second, IncludeKeyRangeMap(BUGGIFY))); + #line 1758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshots[v] = {}; - #line 1720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshotBeginEndKeys[v] = {}; - #line 1721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshotSizes[v] = 0; - #line 9965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" return a_body1cont6loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" --kvfiles; - #line 9970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (loopDepth == 0) return a_body1cont6loopBody1loopHead1(0); return loopDepth; @@ -10037,19 +10311,19 @@ class TestBackupContainerActorState { } int a_body1cont6loopBody1cont2(int loopDepth) { - #line 1732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" logs[logStart] = log->getFileName(); - #line 1733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int size = chooseFileSize(fileSizes); - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" writes.push_back(writeAndVerifyFile(c, log, size, &lock)); - #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (fileSizes.empty() && !snapshots.empty() && snapshots.rbegin()->second.empty() && deterministicRandom()->random01() < .2) - #line 10048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" snapshots.erase(snapshots.rbegin()->first); - #line 10052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" return a_body1cont6break1(loopDepth==0?0:loopDepth-1); // break } if (loopDepth == 0) return a_body1cont6loopHead1(0); @@ -10058,9 +10332,9 @@ class TestBackupContainerActorState { } int a_body1cont6loopBody1cont1when1(Reference const& __log,int loopDepth) { - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" log = __log; - #line 10063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont6loopBody1cont2(loopDepth); return loopDepth; @@ -10125,32 +10399,32 @@ class TestBackupContainerActorState { } int a_body1cont9(Void const& _,int loopDepth) { - #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_7 = c->dumpFileList(); - #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont9when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont9(Void && _,int loopDepth) { - #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_7 = c->dumpFileList(); - #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont9when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -10220,31 +10494,31 @@ class TestBackupContainerActorState { } int a_body1cont10(int loopDepth) { - #line 1747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(listing.ranges.size(), nRangeFiles); - #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(listing.logs.size(), logs.size()); - #line 1749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(listing.snapshots.size(), snapshots.size()); - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_8 = c->describeBackup(); - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont10when1(__when_expr_8.get(), loopDepth); }; static_cast(this)->actor_wait_state = 9; - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont9when1(BackupFileList const& __listing,int loopDepth) { - #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" listing = __listing; - #line 10247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont10(loopDepth); return loopDepth; @@ -10309,22 +10583,22 @@ class TestBackupContainerActorState { } int a_body1cont10cont1(int loopDepth) { - #line 1752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" printf("\n%s\n", desc.toString().c_str()); - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" i = 0; - #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ; - #line 10318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont10cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont10when1(BackupDescription const& __desc,int loopDepth) { - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" desc = __desc; - #line 10327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont10cont1(loopDepth); return loopDepth; @@ -10389,18 +10663,18 @@ class TestBackupContainerActorState { } int a_body1cont10cont2(int loopDepth) { - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" printf("DELETING\n"); - #line 1789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_14 = c->deleteContainer(); - #line 1789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_14.isReady()) { if (__when_expr_14.isError()) return a_body1Catch1(__when_expr_14.getError(), loopDepth); else return a_body1cont10cont2when1(__when_expr_14.get(), loopDepth); }; static_cast(this)->actor_wait_state = 15; - #line 1789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_14.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -10414,23 +10688,23 @@ class TestBackupContainerActorState { } int a_body1cont10cont1loopBody1(int loopDepth) { - #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!(i < listing.snapshots.size())) - #line 10419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { return a_body1cont10cont1break1(loopDepth==0?0:loopDepth-1); // break } { - #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_9 = c->getRestoreSet(desc.maxRestorableVersion.get()); - #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 10428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), std::max(0, loopDepth - 1)); else return a_body1cont10cont1loopBody1when1(__when_expr_9.get(), loopDepth); }; static_cast(this)->actor_wait_state = 10; - #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 10433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } @@ -10452,16 +10726,16 @@ class TestBackupContainerActorState { int a_body1cont10cont1loopBody1cont1(int loopDepth) { { - #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_10 = c->getRestoreSet(listing.snapshots[i].endVersion); - #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 10459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1Catch1(__when_expr_10.getError(), std::max(0, loopDepth - 1)); else return a_body1cont10cont1loopBody1cont1when1(__when_expr_10.get(), loopDepth); }; static_cast(this)->actor_wait_state = 11; - #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 10464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } @@ -10469,18 +10743,18 @@ class TestBackupContainerActorState { } int a_body1cont10cont1loopBody1cont3(Optional const& rest,int loopDepth) { - #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(rest.present()); - #line 10474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont10cont1loopBody1cont1(loopDepth); return loopDepth; } int a_body1cont10cont1loopBody1cont3(Optional && rest,int loopDepth) { - #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(rest.present()); - #line 10483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont10cont1loopBody1cont1(loopDepth); return loopDepth; @@ -10550,40 +10824,40 @@ class TestBackupContainerActorState { } int a_body1cont10cont1loopBody1cont5(int loopDepth) { - #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" expireVersion = listing.snapshots[i].endVersion; - #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" fmt::print("EXPIRE TO {}\n", expireVersion); - #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" f = c->expireData(expireVersion); - #line 1775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_11 = ready(f); - #line 1775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 10563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1Catch1(__when_expr_11.getError(), std::max(0, loopDepth - 1)); else return a_body1cont10cont1loopBody1cont5when1(__when_expr_11.get(), loopDepth); }; static_cast(this)->actor_wait_state = 12; - #line 1775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_11.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont10cont1loopBody1cont6(Optional const& rest,int loopDepth) { - #line 1766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(rest.present()); - #line 10577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont10cont1loopBody1cont5(loopDepth); return loopDepth; } int a_body1cont10cont1loopBody1cont6(Optional && rest,int loopDepth) { - #line 1766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(rest.present()); - #line 10586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = a_body1cont10cont1loopBody1cont5(loopDepth); return loopDepth; @@ -10653,24 +10927,24 @@ class TestBackupContainerActorState { } int a_body1cont10cont1loopBody1cont8(Void const& _,int loopDepth) { - #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (f.isError()) - #line 10658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(f.getError().code(), error_code_backup_cannot_expire); - #line 1780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(i, listing.snapshots.size() - 1); - #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_12 = c->expireData(expireVersion, true); - #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 10668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_12.isReady()) { if (__when_expr_12.isError()) return a_body1Catch1(__when_expr_12.getError(), std::max(0, loopDepth - 1)); else return a_body1cont10cont1loopBody1cont8when1(__when_expr_12.get(), loopDepth); }; static_cast(this)->actor_wait_state = 13; - #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_12.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -10682,24 +10956,24 @@ class TestBackupContainerActorState { } int a_body1cont10cont1loopBody1cont8(Void && _,int loopDepth) { - #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (f.isError()) - #line 10687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(f.getError().code(), error_code_backup_cannot_expire); - #line 1780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(i, listing.snapshots.size() - 1); - #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_12 = c->expireData(expireVersion, true); - #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 10697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_12.isReady()) { if (__when_expr_12.isError()) return a_body1Catch1(__when_expr_12.getError(), std::max(0, loopDepth - 1)); else return a_body1cont10cont1loopBody1cont8when1(__when_expr_12.get(), loopDepth); }; static_cast(this)->actor_wait_state = 13; - #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_12.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 10976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -10774,16 +11048,16 @@ class TestBackupContainerActorState { } int a_body1cont10cont1loopBody1cont9(int loopDepth) { - #line 1784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_13 = c->describeBackup(); - #line 1784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 10781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_13.isReady()) { if (__when_expr_13.isError()) return a_body1Catch1(__when_expr_13.getError(), std::max(0, loopDepth - 1)); else return a_body1cont10cont1loopBody1cont9when1(__when_expr_13.get(), loopDepth); }; static_cast(this)->actor_wait_state = 14; - #line 1784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_13.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -10865,22 +11139,22 @@ class TestBackupContainerActorState { } int a_body1cont10cont1loopBody1cont11(BackupDescription const& d,int loopDepth) { - #line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" printf("\n%s\n", d.toString().c_str()); - #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ++i; - #line 10872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (loopDepth == 0) return a_body1cont10cont1loopHead1(0); return loopDepth; } int a_body1cont10cont1loopBody1cont11(BackupDescription && d,int loopDepth) { - #line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" printf("\n%s\n", d.toString().c_str()); - #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ++i; - #line 10883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (loopDepth == 0) return a_body1cont10cont1loopHead1(0); return loopDepth; @@ -10950,36 +11224,36 @@ class TestBackupContainerActorState { } int a_body1cont10cont3(Void const& _,int loopDepth) { - #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" d = c->describeBackup(); - #line 1792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_15 = ready(d); - #line 1792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_15.isReady()) { if (__when_expr_15.isError()) return a_body1Catch1(__when_expr_15.getError(), loopDepth); else return a_body1cont10cont3when1(__when_expr_15.get(), loopDepth); }; static_cast(this)->actor_wait_state = 16; - #line 1792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_15.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont10cont3(Void && _,int loopDepth) { - #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" d = c->describeBackup(); - #line 1792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_15 = ready(d); - #line 1792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_15.isReady()) { if (__when_expr_15.isError()) return a_body1Catch1(__when_expr_15.getError(), loopDepth); else return a_body1cont10cont3when1(__when_expr_15.get(), loopDepth); }; static_cast(this)->actor_wait_state = 16; - #line 1792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_15.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -11049,36 +11323,36 @@ class TestBackupContainerActorState { } int a_body1cont10cont4(Void const& _,int loopDepth) { - #line 1793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(d.isError() && d.getError().code() == error_code_backup_does_not_exist); - #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_16 = c->dumpFileList(); - #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_16.isReady()) { if (__when_expr_16.isError()) return a_body1Catch1(__when_expr_16.getError(), loopDepth); else return a_body1cont10cont4when1(__when_expr_16.get(), loopDepth); }; static_cast(this)->actor_wait_state = 17; - #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_16.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont10cont4(Void && _,int loopDepth) { - #line 1793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(d.isError() && d.getError().code() == error_code_backup_does_not_exist); - #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_16 = c->dumpFileList(); - #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_16.isReady()) { if (__when_expr_16.isError()) return a_body1Catch1(__when_expr_16.getError(), loopDepth); else return a_body1cont10cont4when1(__when_expr_16.get(), loopDepth); }; static_cast(this)->actor_wait_state = 17; - #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" __when_expr_16.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -11148,17 +11422,17 @@ class TestBackupContainerActorState { } int a_body1cont10cont5(BackupFileList const& empty,int loopDepth) { - #line 1796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(empty.ranges.size(), 0); - #line 1797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(empty.logs.size(), 0); - #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(empty.snapshots.size(), 0); - #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" printf("BackupContainerTest URL=%s PASSED.\n", url.c_str()); - #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TestBackupContainerActorState(); static_cast(this)->destroy(); return 0; } - #line 11161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TestBackupContainerActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11168,17 +11442,17 @@ class TestBackupContainerActorState { } int a_body1cont10cont5(BackupFileList && empty,int loopDepth) { - #line 1796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(empty.ranges.size(), 0); - #line 1797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(empty.logs.size(), 0); - #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT_EQ(empty.snapshots.size(), 0); - #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" printf("BackupContainerTest URL=%s PASSED.\n", url.c_str()); - #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TestBackupContainerActorState(); static_cast(this)->destroy(); return 0; } - #line 11181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TestBackupContainerActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11249,62 +11523,62 @@ class TestBackupContainerActorState { fdb_probe_actor_exit("testBackupContainer", reinterpret_cast(this), 16); } - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::string url; - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Optional proxy; - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Optional encryptionKeyFileName; - #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" FlowLock lock; - #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference c; - #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector> writes; - #line 1674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::map> snapshots; - #line 1675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::map snapshotSizes; - #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::map>> snapshotBeginEndKeys; - #line 1677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int nRangeFiles; - #line 1678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::map logs; - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version v; - #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector fileSizes; - #line 1689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version logStart; - #line 1690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int kvfiles; - #line 1691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Key begin; - #line 1692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Key end; - #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int blockSize; - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Reference log; - #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" BackupFileList listing; - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" BackupDescription desc; - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int i; - #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Version expireVersion; - #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Future f; - #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" Future d; - #line 11302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; // This generated class is to be used only via testBackupContainer() - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" class TestBackupContainerActor final : public Actor, public ActorCallback< TestBackupContainerActor, 0, Void >, public ActorCallback< TestBackupContainerActor, 1, Void >, public ActorCallback< TestBackupContainerActor, 2, Void >, public ActorCallback< TestBackupContainerActor, 3, Reference >, public ActorCallback< TestBackupContainerActor, 4, Void >, public ActorCallback< TestBackupContainerActor, 5, Reference >, public ActorCallback< TestBackupContainerActor, 6, Void >, public ActorCallback< TestBackupContainerActor, 7, BackupFileList >, public ActorCallback< TestBackupContainerActor, 8, BackupDescription >, public ActorCallback< TestBackupContainerActor, 9, Optional >, public ActorCallback< TestBackupContainerActor, 10, Optional >, public ActorCallback< TestBackupContainerActor, 11, Void >, public ActorCallback< TestBackupContainerActor, 12, Void >, public ActorCallback< TestBackupContainerActor, 13, BackupDescription >, public ActorCallback< TestBackupContainerActor, 14, Void >, public ActorCallback< TestBackupContainerActor, 15, Void >, public ActorCallback< TestBackupContainerActor, 16, BackupFileList >, public FastAllocated, public TestBackupContainerActorState { - #line 11307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -11329,9 +11603,9 @@ friend struct ActorCallback< TestBackupContainerActor, 13, BackupDescription >; friend struct ActorCallback< TestBackupContainerActor, 14, Void >; friend struct ActorCallback< TestBackupContainerActor, 15, Void >; friend struct ActorCallback< TestBackupContainerActor, 16, BackupFileList >; - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" TestBackupContainerActor(std::string const& url,Optional const& proxy,Optional const& encryptionKeyFileName) - #line 11334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), TestBackupContainerActorState(url, proxy, encryptionKeyFileName) { @@ -11370,51 +11644,51 @@ friend struct ActorCallback< TestBackupContainerActor, 16, BackupFileList >; } }; - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" [[nodiscard]] Future testBackupContainer( std::string const& url, Optional const& proxy, Optional const& encryptionKeyFileName ) { - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" return Future(new TestBackupContainerActor(url, proxy, encryptionKeyFileName)); - #line 11377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -#line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" -// This generated class is to be used only via flowTestCase1805() - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -template - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -class FlowTestCase1805ActorState { - #line 11388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +// This generated class is to be used only via flowTestCase1844() + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +template + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class FlowTestCase1844ActorState { + #line 11662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - FlowTestCase1805ActorState(UnitTestParameters const& params) - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + FlowTestCase1844ActorState(UnitTestParameters const& params) + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : params(params) - #line 11395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1805", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1844", reinterpret_cast(this)); } - ~FlowTestCase1805ActorState() + ~FlowTestCase1844ActorState() { - fdb_probe_actor_destroy("flowTestCase1805", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1844", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_0 = testBackupContainer(format("file://%s/fdb_backups/%llx", params.getDataDir().c_str(), timer_int()), {}, {}); - #line 1806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 11686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 11691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11427,32 +11701,32 @@ class FlowTestCase1805ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1805ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1844ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(Void const& _,int loopDepth) { - #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1805ActorState(); static_cast(this)->destroy(); return 0; } - #line 11440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1805ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1844ActorState(); static_cast(this)->destroy(); return 0; } + #line 11714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1844ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1805ActorState(); static_cast(this)->destroy(); return 0; } - #line 11452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1805ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1844ActorState(); static_cast(this)->destroy(); return 0; } + #line 11726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1844ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -11471,13 +11745,13 @@ class FlowTestCase1805ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1805Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1844Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1805Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1844Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1805", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1844", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -11487,12 +11761,12 @@ class FlowTestCase1805ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1805", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1844", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase1805Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1844Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1805", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1844", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -11502,12 +11776,12 @@ class FlowTestCase1805ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1805", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1844", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase1805Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1844Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1805", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1844", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -11517,38 +11791,38 @@ class FlowTestCase1805ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1805", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1844", reinterpret_cast(this), 0); } - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" UnitTestParameters params; - #line 11525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1805() - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -class FlowTestCase1805Actor final : public Actor, public ActorCallback< FlowTestCase1805Actor, 0, Void >, public FastAllocated, public FlowTestCase1805ActorState { - #line 11530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +// This generated class is to be used only via flowTestCase1844() + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class FlowTestCase1844Actor final : public Actor, public ActorCallback< FlowTestCase1844Actor, 0, Void >, public FastAllocated, public FlowTestCase1844ActorState { + #line 11804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase1805Actor, 0, Void >; - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - FlowTestCase1805Actor(UnitTestParameters const& params) - #line 11541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +friend struct ActorCallback< FlowTestCase1844Actor, 0, Void >; + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + FlowTestCase1844Actor(UnitTestParameters const& params) + #line 11815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), - FlowTestCase1805ActorState(params) + FlowTestCase1844ActorState(params) { - fdb_probe_actor_enter("flowTestCase1805", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1844", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1805"); + this->lineage.setActorName("flowTestCase1844"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1805", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1844", reinterpret_cast(this), -1); } void cancel() override @@ -11556,57 +11830,57 @@ friend struct ActorCallback< FlowTestCase1805Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase1805Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase1844Actor, 0, Void >*)0, actor_cancelled()); break; } } }; - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -static Future flowTestCase1805( UnitTestParameters const& params ) { - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - return Future(new FlowTestCase1805Actor(params)); - #line 11568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +static Future flowTestCase1844( UnitTestParameters const& params ) { + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + return Future(new FlowTestCase1844Actor(params)); + #line 11842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1805, "/backup/containers/localdir/unencrypted") +ACTOR_TEST_CASE(flowTestCase1844, "/backup/containers/localdir/unencrypted") -#line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 1848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 11574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" -// This generated class is to be used only via flowTestCase1810() - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -template - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -class FlowTestCase1810ActorState { - #line 11580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +// This generated class is to be used only via flowTestCase1849() + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +template + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class FlowTestCase1849ActorState { + #line 11854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - FlowTestCase1810ActorState(UnitTestParameters const& params) - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + FlowTestCase1849ActorState(UnitTestParameters const& params) + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : params(params) - #line 11587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1810", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1849", reinterpret_cast(this)); } - ~FlowTestCase1810ActorState() + ~FlowTestCase1849ActorState() { - fdb_probe_actor_destroy("flowTestCase1810", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1849", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_0 = testBackupContainer(format("file://%s/fdb_backups/%llx", params.getDataDir().c_str(), timer_int()), {}, format("%s/test_encryption_key", params.getDataDir().c_str())); - #line 1811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 11878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 11883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11619,32 +11893,32 @@ class FlowTestCase1810ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1810ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1849ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(Void const& _,int loopDepth) { - #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1810ActorState(); static_cast(this)->destroy(); return 0; } - #line 11632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1810ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1849ActorState(); static_cast(this)->destroy(); return 0; } + #line 11906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1849ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1810ActorState(); static_cast(this)->destroy(); return 0; } - #line 11644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1810ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1849ActorState(); static_cast(this)->destroy(); return 0; } + #line 11918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1849ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -11663,13 +11937,13 @@ class FlowTestCase1810ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1810Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1849Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1810Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1849Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1810", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1849", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -11679,12 +11953,12 @@ class FlowTestCase1810ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1810", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1849", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase1810Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1849Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1810", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1849", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -11694,12 +11968,12 @@ class FlowTestCase1810ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1810", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1849", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase1810Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1849Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1810", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1849", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -11709,38 +11983,38 @@ class FlowTestCase1810ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1810", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1849", reinterpret_cast(this), 0); } - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" UnitTestParameters params; - #line 11717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 11991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1810() - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -class FlowTestCase1810Actor final : public Actor, public ActorCallback< FlowTestCase1810Actor, 0, Void >, public FastAllocated, public FlowTestCase1810ActorState { - #line 11722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +// This generated class is to be used only via flowTestCase1849() + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class FlowTestCase1849Actor final : public Actor, public ActorCallback< FlowTestCase1849Actor, 0, Void >, public FastAllocated, public FlowTestCase1849ActorState { + #line 11996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase1810Actor, 0, Void >; - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - FlowTestCase1810Actor(UnitTestParameters const& params) - #line 11733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +friend struct ActorCallback< FlowTestCase1849Actor, 0, Void >; + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + FlowTestCase1849Actor(UnitTestParameters const& params) + #line 12007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), - FlowTestCase1810ActorState(params) + FlowTestCase1849ActorState(params) { - fdb_probe_actor_enter("flowTestCase1810", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1849", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1810"); + this->lineage.setActorName("flowTestCase1849"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1810", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1849", reinterpret_cast(this), -1); } void cancel() override @@ -11748,65 +12022,65 @@ friend struct ActorCallback< FlowTestCase1810Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase1810Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase1849Actor, 0, Void >*)0, actor_cancelled()); break; } } }; - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -static Future flowTestCase1810( UnitTestParameters const& params ) { - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - return Future(new FlowTestCase1810Actor(params)); - #line 11760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +static Future flowTestCase1849( UnitTestParameters const& params ) { + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + return Future(new FlowTestCase1849Actor(params)); + #line 12034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1810, "/backup/containers/localdir/encrypted") +ACTOR_TEST_CASE(flowTestCase1849, "/backup/containers/localdir/encrypted") -#line 1816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 1855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 11766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" -// This generated class is to be used only via flowTestCase1817() - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -template - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -class FlowTestCase1817ActorState { - #line 11772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +// This generated class is to be used only via flowTestCase1856() + #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +template + #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class FlowTestCase1856ActorState { + #line 12046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - FlowTestCase1817ActorState(UnitTestParameters const& params) - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + FlowTestCase1856ActorState(UnitTestParameters const& params) + #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : params(params) - #line 11779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1817", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1856", reinterpret_cast(this)); } - ~FlowTestCase1817ActorState() + ~FlowTestCase1856ActorState() { - fdb_probe_actor_destroy("flowTestCase1817", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1856", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!g_network->isSimulated()) - #line 11794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" const char* url = getenv("FDB_TEST_BACKUP_URL"); - #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(url != nullptr); - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture __when_expr_0 = testBackupContainer(url, {}, {}); - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 12078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 12083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -11824,20 +12098,20 @@ class FlowTestCase1817ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1817ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1856ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 1823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1817ActorState(); static_cast(this)->destroy(); return 0; } - #line 11837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1817ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1856ActorState(); static_cast(this)->destroy(); return 0; } + #line 12111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1856ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -11868,13 +12142,13 @@ class FlowTestCase1817ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1817Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1856Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1817Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1856Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1817", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1856", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -11884,12 +12158,12 @@ class FlowTestCase1817ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1817", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1856", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase1817Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1856Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1817", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1856", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -11899,12 +12173,12 @@ class FlowTestCase1817ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1817", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1856", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase1817Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1856Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1817", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1856", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -11914,38 +12188,38 @@ class FlowTestCase1817ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1817", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1856", reinterpret_cast(this), 0); } - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" UnitTestParameters params; - #line 11922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1817() - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -class FlowTestCase1817Actor final : public Actor, public ActorCallback< FlowTestCase1817Actor, 0, Void >, public FastAllocated, public FlowTestCase1817ActorState { - #line 11927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +// This generated class is to be used only via flowTestCase1856() + #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class FlowTestCase1856Actor final : public Actor, public ActorCallback< FlowTestCase1856Actor, 0, Void >, public FastAllocated, public FlowTestCase1856ActorState { + #line 12201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase1817Actor, 0, Void >; - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - FlowTestCase1817Actor(UnitTestParameters const& params) - #line 11938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +friend struct ActorCallback< FlowTestCase1856Actor, 0, Void >; + #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + FlowTestCase1856Actor(UnitTestParameters const& params) + #line 12212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), - FlowTestCase1817ActorState(params) + FlowTestCase1856ActorState(params) { - fdb_probe_actor_enter("flowTestCase1817", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1856", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1817"); + this->lineage.setActorName("flowTestCase1856"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1817", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1856", reinterpret_cast(this), -1); } void cancel() override @@ -11953,67 +12227,67 @@ friend struct ActorCallback< FlowTestCase1817Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase1817Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase1856Actor, 0, Void >*)0, actor_cancelled()); break; } } }; - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -static Future flowTestCase1817( UnitTestParameters const& params ) { - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - return Future(new FlowTestCase1817Actor(params)); - #line 11965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +static Future flowTestCase1856( UnitTestParameters const& params ) { + #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + return Future(new FlowTestCase1856Actor(params)); + #line 12239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1817, "/backup/containers/url") +ACTOR_TEST_CASE(flowTestCase1856, "/backup/containers/url") -#line 1825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 11971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" -// This generated class is to be used only via flowTestCase1826() - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -template - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -class FlowTestCase1826ActorState { - #line 11977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +// This generated class is to be used only via flowTestCase1865() + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +template + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class FlowTestCase1865ActorState { + #line 12251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - FlowTestCase1826ActorState(UnitTestParameters const& params) - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + FlowTestCase1865ActorState(UnitTestParameters const& params) + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : params(params) - #line 11984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1826", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1865", reinterpret_cast(this)); } - ~FlowTestCase1826ActorState() + ~FlowTestCase1865ActorState() { - fdb_probe_actor_destroy("flowTestCase1826", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1865", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" if (!g_network->isSimulated()) - #line 11999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - #line 1828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" url = getenv("FDB_TEST_BACKUP_URL"); - #line 1829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(url != nullptr); - #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" printf("Listing %s\n", url); - #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" StrictFuture> __when_expr_0 = IBackupContainer::listContainers(url, {}); - #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 12285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 12016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 12290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" loopDepth = 0; } else @@ -12031,31 +12305,31 @@ class FlowTestCase1826ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1826ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1865ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 1836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1826ActorState(); static_cast(this)->destroy(); return 0; } - #line 12044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1826ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1865ActorState(); static_cast(this)->destroy(); return 0; } + #line 12318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1865ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont2(std::vector const& urls,int loopDepth) { - #line 1832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto& u : urls ) { - #line 1833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" printf("%s\n", u.c_str()); - #line 12058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } loopDepth = a_body1cont1(loopDepth); @@ -12063,11 +12337,11 @@ class FlowTestCase1826ActorState { } int a_body1cont2(std::vector && urls,int loopDepth) { - #line 1832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for( auto& u : urls ) { - #line 1833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" printf("%s\n", u.c_str()); - #line 12070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } loopDepth = a_body1cont1(loopDepth); @@ -12087,13 +12361,13 @@ class FlowTestCase1826ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1826Actor, 0, std::vector >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1865Actor, 0, std::vector >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1826Actor, 0, std::vector >*,std::vector const& value) + void a_callback_fire(ActorCallback< FlowTestCase1865Actor, 0, std::vector >*,std::vector const& value) { - fdb_probe_actor_enter("flowTestCase1826", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1865", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -12103,12 +12377,12 @@ class FlowTestCase1826ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1826", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1865", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase1826Actor, 0, std::vector >*,std::vector && value) + void a_callback_fire(ActorCallback< FlowTestCase1865Actor, 0, std::vector >*,std::vector && value) { - fdb_probe_actor_enter("flowTestCase1826", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1865", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -12118,12 +12392,12 @@ class FlowTestCase1826ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1826", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1865", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase1826Actor, 0, std::vector >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1865Actor, 0, std::vector >*,Error err) { - fdb_probe_actor_enter("flowTestCase1826", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1865", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -12133,40 +12407,40 @@ class FlowTestCase1826ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1826", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1865", reinterpret_cast(this), 0); } - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" UnitTestParameters params; - #line 1828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" const char* url; - #line 12143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1826() - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -class FlowTestCase1826Actor final : public Actor, public ActorCallback< FlowTestCase1826Actor, 0, std::vector >, public FastAllocated, public FlowTestCase1826ActorState { - #line 12148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +// This generated class is to be used only via flowTestCase1865() + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class FlowTestCase1865Actor final : public Actor, public ActorCallback< FlowTestCase1865Actor, 0, std::vector >, public FastAllocated, public FlowTestCase1865ActorState { + #line 12422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase1826Actor, 0, std::vector >; - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - FlowTestCase1826Actor(UnitTestParameters const& params) - #line 12159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +friend struct ActorCallback< FlowTestCase1865Actor, 0, std::vector >; + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + FlowTestCase1865Actor(UnitTestParameters const& params) + #line 12433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), - FlowTestCase1826ActorState(params) + FlowTestCase1865ActorState(params) { - fdb_probe_actor_enter("flowTestCase1826", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1865", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1826"); + this->lineage.setActorName("flowTestCase1865"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1826", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1865", reinterpret_cast(this), -1); } void cancel() override @@ -12174,71 +12448,71 @@ friend struct ActorCallback< FlowTestCase1826Actor, 0, std::vector auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase1826Actor, 0, std::vector >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase1865Actor, 0, std::vector >*)0, actor_cancelled()); break; } } }; - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -static Future flowTestCase1826( UnitTestParameters const& params ) { - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - return Future(new FlowTestCase1826Actor(params)); - #line 12186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +static Future flowTestCase1865( UnitTestParameters const& params ) { + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + return Future(new FlowTestCase1865Actor(params)); + #line 12460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1826, "/backup/containers_list") +ACTOR_TEST_CASE(flowTestCase1865, "/backup/containers_list") -#line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 1877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 12192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" -// This generated class is to be used only via flowTestCase1839() - #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -template - #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -class FlowTestCase1839ActorState { - #line 12198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +// This generated class is to be used only via flowTestCase1878() + #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +template + #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class FlowTestCase1878ActorState { + #line 12472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - FlowTestCase1839ActorState(UnitTestParameters const& params) - #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + FlowTestCase1878ActorState(UnitTestParameters const& params) + #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : params(params) - #line 12205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1839", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1878", reinterpret_cast(this)); } - ~FlowTestCase1839ActorState() + ~FlowTestCase1878ActorState() { - fdb_probe_actor_destroy("flowTestCase1839", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1878", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" for(int i = 0;i < 1000;++i) { - #line 1842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" int64_t ts = deterministicRandom()->randomInt64(0, std::numeric_limits::max()); - #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupAgentBase::parseTime(BackupAgentBase::formatTime(ts)) == ts); - #line 12224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } - #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupAgentBase::parseTime("2019/03/18.17:51:11-0600") == BackupAgentBase::parseTime("2019/03/18.16:51:11-0700")); - #line 1848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupAgentBase::parseTime("2019/03/31.22:45:07-0700") == BackupAgentBase::parseTime("2019/04/01.03:45:07-0200")); - #line 1850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupAgentBase::parseTime("2019/03/31.22:45:07+0000") == BackupAgentBase::parseTime("2019/04/01.03:45:07+0500")); - #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupAgentBase::parseTime("2019/03/31.22:45:07+0030") == BackupAgentBase::parseTime("2019/04/01.03:45:07+0530")); - #line 1854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupAgentBase::parseTime("2019/03/31.22:45:07+0030") == BackupAgentBase::parseTime("2019/04/01.04:00:07+0545")); - #line 1857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1839ActorState(); static_cast(this)->destroy(); return 0; } - #line 12238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1839ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1878ActorState(); static_cast(this)->destroy(); return 0; } + #line 12512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1878ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -12251,40 +12525,40 @@ class FlowTestCase1839ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1839ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1878ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" UnitTestParameters params; - #line 12262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1839() - #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -class FlowTestCase1839Actor final : public Actor, public FastAllocated, public FlowTestCase1839ActorState { - #line 12267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +// This generated class is to be used only via flowTestCase1878() + #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class FlowTestCase1878Actor final : public Actor, public FastAllocated, public FlowTestCase1878ActorState { + #line 12541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - FlowTestCase1839Actor(UnitTestParameters const& params) - #line 12277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + FlowTestCase1878Actor(UnitTestParameters const& params) + #line 12551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), - FlowTestCase1839ActorState(params) + FlowTestCase1878ActorState(params) { - fdb_probe_actor_enter("flowTestCase1839", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1878", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1839"); + this->lineage.setActorName("flowTestCase1878"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1839", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1878", reinterpret_cast(this), -1); } void cancel() override @@ -12296,138 +12570,138 @@ class FlowTestCase1839Actor final : public Actor, public FastAllocated flowTestCase1839( UnitTestParameters const& params ) { - #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - return Future(new FlowTestCase1839Actor(params)); - #line 12303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +static Future flowTestCase1878( UnitTestParameters const& params ) { + #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + return Future(new FlowTestCase1878Actor(params)); + #line 12577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1839, "/backup/time") +ACTOR_TEST_CASE(flowTestCase1878, "/backup/time") -#line 1859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 1898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 12309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" -// This generated class is to be used only via flowTestCase1860() - #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -template - #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -class FlowTestCase1860ActorState { - #line 12315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +// This generated class is to be used only via flowTestCase1899() + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +template + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class FlowTestCase1899ActorState { + #line 12589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - FlowTestCase1860ActorState(UnitTestParameters const& params) - #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + FlowTestCase1899ActorState(UnitTestParameters const& params) + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" : params(params) - #line 12322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1860", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1899", reinterpret_cast(this)); } - ~FlowTestCase1860ActorState() + ~FlowTestCase1899ActorState() { - fdb_probe_actor_destroy("flowTestCase1860", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1899", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::vector files; - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" files.push_back({ 0, 100, 10, "file1", 100, 0, 2 }); - #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(!BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 0, 99)); - #line 1866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::getPartitionedLogsContinuousEndVersion(files, 0) == 0); - #line 1868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" files.push_back({ 0, 100, 10, "file2", 200, 1, 2 }); - #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(files.begin(), files.end()); - #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 0, 99)); - #line 1871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(!BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 0, 100)); - #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::getPartitionedLogsContinuousEndVersion(files, 0) == 99); - #line 1875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" files.push_back({ 100, 200, 10, "file3", 200, 0, 3 }); - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" files.push_back({ 100, 250, 10, "file4", 200, 1, 3 }); - #line 1877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(files.begin(), files.end()); - #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 0, 99)); - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(!BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 0, 100)); - #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(!BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 50, 150)); - #line 1881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::getPartitionedLogsContinuousEndVersion(files, 0) == 99); - #line 1883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" files.push_back({ 100, 300, 10, "file5", 200, 2, 3 }); - #line 1884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(files.begin(), files.end()); - #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 50, 150)); - #line 1886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(!BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 50, 200)); - #line 1887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 10, 199)); - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::getPartitionedLogsContinuousEndVersion(files, 0) == 199); - #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::getPartitionedLogsContinuousEndVersion(files, 100) == 199); - #line 1891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" files.push_back({ 250, 300, 10, "file6", 200, 0, 3 }); - #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(files.begin(), files.end()); - #line 1893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(!BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 50, 240)); - #line 1894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(!BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 100, 280)); - #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::getPartitionedLogsContinuousEndVersion(files, 99) == 199); - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" files.push_back({ 250, 300, 10, "file7", 200, 1, 3 }); - #line 1898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(files.begin(), files.end()); - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(!BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 100, 280)); - #line 1901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" files.push_back({ 200, 250, 10, "file8", 200, 0, 3 }); - #line 1902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(files.begin(), files.end()); - #line 1903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 0, 299)); - #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 100, 280)); - #line 1905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::getPartitionedLogsContinuousEndVersion(files, 150) == 299); - #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" files.push_back({ 300, 400, 10, "file10", 200, 0, 1 }); - #line 1910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" std::sort(files.begin(), files.end()); - #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 0, 399)); - #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 100, 399)); - #line 1913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 150, 399)); - #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::isPartitionedLogsContinuous(files, 250, 399)); - #line 1915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::getPartitionedLogsContinuousEndVersion(files, 0) == 399); - #line 1916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::getPartitionedLogsContinuousEndVersion(files, 99) == 399); - #line 1917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" ASSERT(BackupContainerFileSystemImpl::getPartitionedLogsContinuousEndVersion(files, 250) == 399); - #line 1919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1860ActorState(); static_cast(this)->destroy(); return 0; } - #line 12427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1860ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1899ActorState(); static_cast(this)->destroy(); return 0; } + #line 12701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1899ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -12440,40 +12714,40 @@ class FlowTestCase1860ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1860ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1899ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" UnitTestParameters params; - #line 12451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 12725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1860() - #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" -class FlowTestCase1860Actor final : public Actor, public FastAllocated, public FlowTestCase1860ActorState { - #line 12456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" +// This generated class is to be used only via flowTestCase1899() + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +class FlowTestCase1899Actor final : public Actor, public FastAllocated, public FlowTestCase1899ActorState { + #line 12730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - FlowTestCase1860Actor(UnitTestParameters const& params) - #line 12466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + FlowTestCase1899Actor(UnitTestParameters const& params) + #line 12740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" : Actor(), - FlowTestCase1860ActorState(params) + FlowTestCase1899ActorState(params) { - fdb_probe_actor_enter("flowTestCase1860", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1899", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1860"); + this->lineage.setActorName("flowTestCase1899"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1860", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1899", reinterpret_cast(this), -1); } void cancel() override @@ -12485,14 +12759,14 @@ class FlowTestCase1860Actor final : public Actor, public FastAllocated flowTestCase1860( UnitTestParameters const& params ) { - #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" - return Future(new FlowTestCase1860Actor(params)); - #line 12492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +static Future flowTestCase1899( UnitTestParameters const& params ) { + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" + return Future(new FlowTestCase1899Actor(params)); + #line 12766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1860, "/backup/continuous") +ACTOR_TEST_CASE(flowTestCase1899, "/backup/continuous") -#line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" +#line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerFileSystem.actor.cpp" } // namespace backup_test diff --git a/src/fdbclient/BackupContainerLocalDirectory.actor.cpp b/src/fdbclient/BackupContainerLocalDirectory.actor.cpp index 3dd9632..8d2b509 100644 --- a/src/fdbclient/BackupContainerLocalDirectory.actor.cpp +++ b/src/fdbclient/BackupContainerLocalDirectory.actor.cpp @@ -20,10 +20,12 @@ #include "fdbclient/BackupContainerLocalDirectory.h" #include "fdbrpc/AsyncFileReadAhead.actor.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" +#include "flow/FaultInjection.h" #include "flow/Platform.actor.h" #include "flow/Platform.h" #include "fdbrpc/simulator.h" +#include "fdbrpc/SimulatorProcessInfo.h" #include "flow/actorcompiler.h" // This must be the last #include. namespace { @@ -66,6 +68,8 @@ class BackupFile : public IBackupFile, ReferenceCounted { Future r = uncancellable(holdWhile(old, m_file->write(old.begin(), size, m_writeOffset))); m_writeOffset += size; + INJECT_BLOB_FAULT(http_request_failed, "BackupContainerLocalDirectory::flush"); + return r; } @@ -76,6 +80,9 @@ class BackupFile : public IBackupFile, ReferenceCounted { std::string name = f->m_file->getFilename(); f->m_file.clear(); wait(IAsyncFileSystem::filesystem()->renameFile(name, f->m_finalFullPath)); + + INJECT_BLOB_FAULT(http_request_failed, "BackupContainerLocalDirectory::finish"); + return Void(); } @@ -103,19 +110,20 @@ ACTOR static Future listFiles_impl(st // Remove .lnk files from results, they are a side effect of a backup that was *read* during simulation. See // openFile() above for more info on why they are created. if (g_network->isSimulated()) - files.erase( - std::remove_if(files.begin(), - files.end(), - [](std::string const& f) { return StringRef(f).endsWith(LiteralStringRef(".lnk")); }), - files.end()); + files.erase(std::remove_if(files.begin(), + files.end(), + [](std::string const& f) { return StringRef(f).endsWith(".lnk"_sr); }), + files.end()); for (const auto& f : files) { // Hide .part or .temp files. StringRef s(f); - if (!s.endsWith(LiteralStringRef(".part")) && !s.endsWith(LiteralStringRef(".temp"))) + if (!s.endsWith(".part"_sr) && !s.endsWith(".temp"_sr)) results.push_back({ f.substr(m_path.size() + 1), ::fileSize(f) }); } + INJECT_BLOB_FAULT(http_request_failed, "BackupContainerLocalDirectory::listFiles"); + return results; } @@ -150,15 +158,19 @@ BackupContainerLocalDirectory::BackupContainerLocalDirectory(const std::string& std::string absolutePath = abspath(path); if (!g_network->isSimulated() && path != absolutePath) { - TraceEvent(SevWarn, "BackupContainerLocalDirectory") - .detail("Description", "Backup path must be absolute (e.g. file:///some/path)") - .detail("URL", url) - .detail("Path", path) - .detail("AbsolutePath", absolutePath); - // throw io_error(); - IBackupContainer::lastOpenError = - format("Backup path '%s' must be the absolute path '%s'", path.c_str(), absolutePath.c_str()); - throw backup_invalid_url(); + if (CLIENT_KNOBS->BACKUP_CONTAINER_LOCAL_ALLOW_RELATIVE_PATH) { + path = absolutePath; + } else { + TraceEvent(SevWarn, "BackupContainerLocalDirectory") + .detail("Description", "Backup path must be absolute (e.g. file:///some/path)") + .detail("URL", url) + .detail("Path", path) + .detail("AbsolutePath", absolutePath); + // throw io_error(); + IBackupContainer::lastOpenError = + format("Backup path '%s' must be the absolute path '%s'", path.c_str(), absolutePath.c_str()); + throw backup_invalid_url(); + } } // Finalized path written to will be will be /backup- @@ -177,12 +189,19 @@ Future> BackupContainerLocalDirectory::listURLs(const s // Remove trailing slashes on path path.erase(path.find_last_not_of("\\/") + 1); - if (!g_network->isSimulated() && path != abspath(path)) { - TraceEvent(SevWarn, "BackupContainerLocalDirectory") - .detail("Description", "Backup path must be absolute (e.g. file:///some/path)") - .detail("URL", url) - .detail("Path", path); - throw io_error(); + std::string absolutePath = abspath(path); + + if (!g_network->isSimulated() && path != absolutePath) { + if (CLIENT_KNOBS->BACKUP_CONTAINER_LOCAL_ALLOW_RELATIVE_PATH) { + path = absolutePath; + } else { + TraceEvent(SevWarn, "BackupContainerLocalDirectory") + .detail("Description", "Backup path must be absolute (e.g. file:///some/path)") + .detail("URL", url) + .detail("Path", path) + .detail("AbsolutePath", absolutePath); + throw io_error(); + } } std::vector dirs = platform::listDirectories(path); std::vector results; @@ -217,6 +236,7 @@ Future> BackupContainerLocalDirectory::readFile(const std: if (usesEncryption()) { flags |= IAsyncFile::OPEN_ENCRYPTED; } + INJECT_BLOB_FAULT(http_request_failed, "BackupContainerLocalDirectory::readFile"); // Simulation does not properly handle opening the same file from multiple machines using a shared filesystem, // so create a symbolic link to make each file opening appear to be unique. This could also work in production // but only if the source directory is writeable which shouldn't be required for a restore. @@ -227,10 +247,10 @@ Future> BackupContainerLocalDirectory::readFile(const std: throw file_not_found(); } - if (g_simulator.getCurrentProcess()->uid == UID()) { + if (g_simulator->getCurrentProcess()->uid == UID()) { TraceEvent(SevError, "BackupContainerReadFileOnUnsetProcessID").log(); } - std::string uniquePath = fullPath + "." + g_simulator.getCurrentProcess()->uid.toString() + ".lnk"; + std::string uniquePath = fullPath + "." + g_simulator->getCurrentProcess()->uid.toString() + ".lnk"; unlink(uniquePath.c_str()); ASSERT(symlink(basename(path).c_str(), uniquePath.c_str()) == 0); fullPath = uniquePath; @@ -268,6 +288,7 @@ Future> BackupContainerLocalDirectory::readFile(const std: } Future> BackupContainerLocalDirectory::writeFile(const std::string& path) { + INJECT_BLOB_FAULT(http_request_failed, "BackupContainerLocalDirectory::writeFile"); int flags = IAsyncFile::OPEN_NO_AIO | IAsyncFile::OPEN_UNCACHED | IAsyncFile::OPEN_CREATE | IAsyncFile::OPEN_ATOMIC_WRITE_AND_CREATE | IAsyncFile::OPEN_READWRITE; if (usesEncryption()) { @@ -280,8 +301,13 @@ Future> BackupContainerLocalDirectory::writeFile(const st return map(f, [=](Reference f) { return Reference(new BackupFile(path, f, fullPath)); }); } +Future BackupContainerLocalDirectory::writeEntireFile(const std::string& path, const std::string& contents) { + return writeEntireFileFallback(path, contents); +} + Future BackupContainerLocalDirectory::deleteFile(const std::string& path) { ::deleteFile(joinPath(m_path, path)); + INJECT_BLOB_FAULT(http_request_failed, "BackupContainerLocalDirectory::deleteFile"); return Void(); } diff --git a/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp b/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp index 3517d8f..32fd751 100644 --- a/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp +++ b/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp @@ -22,10 +22,12 @@ #include "fdbclient/BackupContainerLocalDirectory.h" #include "fdbrpc/AsyncFileReadAhead.actor.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" +#include "flow/FaultInjection.h" #include "flow/Platform.actor.h" #include "flow/Platform.h" #include "fdbrpc/simulator.h" +#include "fdbrpc/SimulatorProcessInfo.h" #include "flow/actorcompiler.h" // This must be the last #include. namespace { @@ -68,23 +70,25 @@ class BackupFile : public IBackupFile, ReferenceCounted { Future r = uncancellable(holdWhile(old, m_file->write(old.begin(), size, m_writeOffset))); m_writeOffset += size; + INJECT_BLOB_FAULT(http_request_failed, "BackupContainerLocalDirectory::flush"); + return r; } - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" // This generated class is to be used only via finish_impl() - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" template - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" class Finish_implActorState { - #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" public: - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" Finish_implActorState(Reference const& f) - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" : f(f) - #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" { fdb_probe_actor_create("finish_impl", reinterpret_cast(this)); @@ -97,16 +101,16 @@ class Finish_implActorState { int a_body1(int loopDepth=0) { try { - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" StrictFuture __when_expr_0 = f->flush(f->m_buffer.size()); - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -127,32 +131,32 @@ class Finish_implActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" StrictFuture __when_expr_1 = f->m_file->truncate(f->size()); - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" StrictFuture __when_expr_1 = f->m_file->truncate(f->size()); - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -222,32 +226,32 @@ class Finish_implActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" StrictFuture __when_expr_2 = f->m_file->sync(); - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" StrictFuture __when_expr_2 = f->m_file->sync(); - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -317,40 +321,40 @@ class Finish_implActorState { } int a_body1cont3(Void const& _,int loopDepth) { - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" std::string name = f->m_file->getFilename(); - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" f->m_file.clear(); - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" StrictFuture __when_expr_3 = IAsyncFileSystem::filesystem()->renameFile(name, f->m_finalFullPath); - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" std::string name = f->m_file->getFilename(); - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" f->m_file.clear(); - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" StrictFuture __when_expr_3 = IAsyncFileSystem::filesystem()->renameFile(name, f->m_finalFullPath); - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -420,9 +424,11 @@ class Finish_implActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + INJECT_BLOB_FAULT(http_request_failed, "BackupContainerLocalDirectory::finish"); + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Finish_implActorState(); static_cast(this)->destroy(); return 0; } - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Finish_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -432,9 +438,11 @@ class Finish_implActorState { } int a_body1cont4(Void && _,int loopDepth) { - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + INJECT_BLOB_FAULT(http_request_failed, "BackupContainerLocalDirectory::finish"); + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Finish_implActorState(); static_cast(this)->destroy(); return 0; } - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Finish_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -505,14 +513,14 @@ class Finish_implActorState { fdb_probe_actor_exit("finish_impl", reinterpret_cast(this), 3); } - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" Reference f; - #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" }; // This generated class is to be used only via finish_impl() - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" class Finish_implActor final : public Actor, public ActorCallback< Finish_implActor, 0, Void >, public ActorCallback< Finish_implActor, 1, Void >, public ActorCallback< Finish_implActor, 2, Void >, public ActorCallback< Finish_implActor, 3, Void >, public FastAllocated, public Finish_implActorState { - #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -524,9 +532,9 @@ friend struct ActorCallback< Finish_implActor, 0, Void >; friend struct ActorCallback< Finish_implActor, 1, Void >; friend struct ActorCallback< Finish_implActor, 2, Void >; friend struct ActorCallback< Finish_implActor, 3, Void >; - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" Finish_implActor(Reference const& f) - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" : Actor(), Finish_implActorState(f) { @@ -552,14 +560,14 @@ friend struct ActorCallback< Finish_implActor, 3, Void >; } }; - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" [[nodiscard]] static Future finish_impl( Reference const& f ) { - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" return Future(new Finish_implActor(f)); - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" } -#line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" +#line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" int64_t size() const override { return m_buffer.size() + m_writeOffset; } @@ -576,24 +584,24 @@ friend struct ActorCallback< Finish_implActor, 3, Void >; int m_blockSize; }; - #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" // This generated class is to be used only via listFiles_impl() - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" template - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" class ListFiles_implActorState { - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" public: - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" ListFiles_implActorState(std::string const& path,std::string const& m_path) - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" : path(path), - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" m_path(m_path), - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" files() - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" { fdb_probe_actor_create("listFiles_impl", reinterpret_cast(this)); @@ -606,16 +614,16 @@ class ListFiles_implActorState { int a_body1(int loopDepth=0) { try { - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" StrictFuture __when_expr_0 = platform::findFilesRecursivelyAsync(joinPath(m_path, path), &files); - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -636,32 +644,34 @@ class ListFiles_implActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" BackupContainerFileSystem::FilesAndSizesT results; - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" if (g_network->isSimulated()) - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" { - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" - files.erase( std::remove_if(files.begin(), files.end(), [](std::string const& f) { return StringRef(f).endsWith(LiteralStringRef(".lnk")); }), files.end()); - #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + files.erase(std::remove_if(files.begin(), files.end(), [](std::string const& f) { return StringRef(f).endsWith(".lnk"_sr); }), files.end()); + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" } - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" for( const auto& f : files ) { - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" StringRef s(f); - #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" - if (!s.endsWith(LiteralStringRef(".part")) && !s.endsWith(LiteralStringRef(".temp"))) - #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + if (!s.endsWith(".part"_sr) && !s.endsWith(".temp"_sr)) + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" { - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" results.push_back({ f.substr(m_path.size() + 1), ::fileSize(f) }); - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" } } - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + INJECT_BLOB_FAULT(http_request_failed, "BackupContainerLocalDirectory::listFiles"); + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(results); this->~ListFiles_implActorState(); static_cast(this)->destroy(); return 0; } - #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" new (&static_cast(this)->SAV< BackupContainerFileSystem::FilesAndSizesT >::value()) BackupContainerFileSystem::FilesAndSizesT(results); this->~ListFiles_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -671,32 +681,34 @@ class ListFiles_implActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" BackupContainerFileSystem::FilesAndSizesT results; - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" if (g_network->isSimulated()) - #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" { - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" - files.erase( std::remove_if(files.begin(), files.end(), [](std::string const& f) { return StringRef(f).endsWith(LiteralStringRef(".lnk")); }), files.end()); - #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + files.erase(std::remove_if(files.begin(), files.end(), [](std::string const& f) { return StringRef(f).endsWith(".lnk"_sr); }), files.end()); + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" } - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" for( const auto& f : files ) { - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" StringRef s(f); - #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" - if (!s.endsWith(LiteralStringRef(".part")) && !s.endsWith(LiteralStringRef(".temp"))) - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + if (!s.endsWith(".part"_sr) && !s.endsWith(".temp"_sr)) + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" { - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" results.push_back({ f.substr(m_path.size() + 1), ::fileSize(f) }); - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" } } - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + INJECT_BLOB_FAULT(http_request_failed, "BackupContainerLocalDirectory::listFiles"); + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(results); this->~ListFiles_implActorState(); static_cast(this)->destroy(); return 0; } - #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" new (&static_cast(this)->SAV< BackupContainerFileSystem::FilesAndSizesT >::value()) BackupContainerFileSystem::FilesAndSizesT(results); this->~ListFiles_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -767,18 +779,18 @@ class ListFiles_implActorState { fdb_probe_actor_exit("listFiles_impl", reinterpret_cast(this), 0); } - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" std::string path; - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" std::string m_path; - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" std::vector files; - #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" }; // This generated class is to be used only via listFiles_impl() - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" class ListFiles_implActor final : public Actor, public ActorCallback< ListFiles_implActor, 0, Void >, public FastAllocated, public ListFiles_implActorState { - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -787,9 +799,9 @@ class ListFiles_implActor final : public Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ListFiles_implActor, 0, Void >; - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" ListFiles_implActor(std::string const& path,std::string const& m_path) - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" : Actor(), ListFiles_implActorState(path, m_path) { @@ -812,14 +824,14 @@ friend struct ActorCallback< ListFiles_implActor, 0, Void >; } }; - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" [[nodiscard]] static Future listFiles_impl( std::string const& path, std::string const& m_path ) { - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" return Future(new ListFiles_implActor(path, m_path)); - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" + #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.g.cpp" } -#line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" +#line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerLocalDirectory.actor.cpp" } // namespace @@ -852,15 +864,19 @@ BackupContainerLocalDirectory::BackupContainerLocalDirectory(const std::string& std::string absolutePath = abspath(path); if (!g_network->isSimulated() && path != absolutePath) { - TraceEvent(SevWarn, "BackupContainerLocalDirectory") - .detail("Description", "Backup path must be absolute (e.g. file:///some/path)") - .detail("URL", url) - .detail("Path", path) - .detail("AbsolutePath", absolutePath); - // throw io_error(); - IBackupContainer::lastOpenError = - format("Backup path '%s' must be the absolute path '%s'", path.c_str(), absolutePath.c_str()); - throw backup_invalid_url(); + if (CLIENT_KNOBS->BACKUP_CONTAINER_LOCAL_ALLOW_RELATIVE_PATH) { + path = absolutePath; + } else { + TraceEvent(SevWarn, "BackupContainerLocalDirectory") + .detail("Description", "Backup path must be absolute (e.g. file:///some/path)") + .detail("URL", url) + .detail("Path", path) + .detail("AbsolutePath", absolutePath); + // throw io_error(); + IBackupContainer::lastOpenError = + format("Backup path '%s' must be the absolute path '%s'", path.c_str(), absolutePath.c_str()); + throw backup_invalid_url(); + } } // Finalized path written to will be will be /backup- @@ -879,12 +895,19 @@ Future> BackupContainerLocalDirectory::listURLs(const s // Remove trailing slashes on path path.erase(path.find_last_not_of("\\/") + 1); - if (!g_network->isSimulated() && path != abspath(path)) { - TraceEvent(SevWarn, "BackupContainerLocalDirectory") - .detail("Description", "Backup path must be absolute (e.g. file:///some/path)") - .detail("URL", url) - .detail("Path", path); - throw io_error(); + std::string absolutePath = abspath(path); + + if (!g_network->isSimulated() && path != absolutePath) { + if (CLIENT_KNOBS->BACKUP_CONTAINER_LOCAL_ALLOW_RELATIVE_PATH) { + path = absolutePath; + } else { + TraceEvent(SevWarn, "BackupContainerLocalDirectory") + .detail("Description", "Backup path must be absolute (e.g. file:///some/path)") + .detail("URL", url) + .detail("Path", path) + .detail("AbsolutePath", absolutePath); + throw io_error(); + } } std::vector dirs = platform::listDirectories(path); std::vector results; @@ -919,6 +942,7 @@ Future> BackupContainerLocalDirectory::readFile(const std: if (usesEncryption()) { flags |= IAsyncFile::OPEN_ENCRYPTED; } + INJECT_BLOB_FAULT(http_request_failed, "BackupContainerLocalDirectory::readFile"); // Simulation does not properly handle opening the same file from multiple machines using a shared filesystem, // so create a symbolic link to make each file opening appear to be unique. This could also work in production // but only if the source directory is writeable which shouldn't be required for a restore. @@ -929,10 +953,10 @@ Future> BackupContainerLocalDirectory::readFile(const std: throw file_not_found(); } - if (g_simulator.getCurrentProcess()->uid == UID()) { + if (g_simulator->getCurrentProcess()->uid == UID()) { TraceEvent(SevError, "BackupContainerReadFileOnUnsetProcessID").log(); } - std::string uniquePath = fullPath + "." + g_simulator.getCurrentProcess()->uid.toString() + ".lnk"; + std::string uniquePath = fullPath + "." + g_simulator->getCurrentProcess()->uid.toString() + ".lnk"; unlink(uniquePath.c_str()); ASSERT(symlink(basename(path).c_str(), uniquePath.c_str()) == 0); fullPath = uniquePath; @@ -970,6 +994,7 @@ Future> BackupContainerLocalDirectory::readFile(const std: } Future> BackupContainerLocalDirectory::writeFile(const std::string& path) { + INJECT_BLOB_FAULT(http_request_failed, "BackupContainerLocalDirectory::writeFile"); int flags = IAsyncFile::OPEN_NO_AIO | IAsyncFile::OPEN_UNCACHED | IAsyncFile::OPEN_CREATE | IAsyncFile::OPEN_ATOMIC_WRITE_AND_CREATE | IAsyncFile::OPEN_READWRITE; if (usesEncryption()) { @@ -982,8 +1007,13 @@ Future> BackupContainerLocalDirectory::writeFile(const st return map(f, [=](Reference f) { return Reference(new BackupFile(path, f, fullPath)); }); } +Future BackupContainerLocalDirectory::writeEntireFile(const std::string& path, const std::string& contents) { + return writeEntireFileFallback(path, contents); +} + Future BackupContainerLocalDirectory::deleteFile(const std::string& path) { ::deleteFile(joinPath(m_path, path)); + INJECT_BLOB_FAULT(http_request_failed, "BackupContainerLocalDirectory::deleteFile"); return Void(); } diff --git a/src/fdbclient/BackupContainerS3BlobStore.actor.cpp b/src/fdbclient/BackupContainerS3BlobStore.actor.cpp index 2240cc6..afdb2ad 100644 --- a/src/fdbclient/BackupContainerS3BlobStore.actor.cpp +++ b/src/fdbclient/BackupContainerS3BlobStore.actor.cpp @@ -20,9 +20,7 @@ #include "fdbclient/AsyncFileS3BlobStore.actor.h" #include "fdbclient/BackupContainerS3BlobStore.h" -#if (!defined(TLS_DISABLED) && !defined(_WIN32)) #include "fdbrpc/AsyncFileEncrypted.h" -#endif #include "fdbrpc/AsyncFileReadAhead.actor.h" #include "flow/actorcompiler.h" // This must be the last #include. @@ -134,19 +132,32 @@ const std::string BackupContainerS3BlobStoreImpl::DATAFOLDER = "data"; const std::string BackupContainerS3BlobStoreImpl::INDEXFOLDER = "backups"; std::string BackupContainerS3BlobStore::dataPath(const std::string& path) { - return BackupContainerS3BlobStoreImpl::DATAFOLDER + "/" + m_name + "/" + path; + // if backup, include the backup data prefix. + // if m_name ends in a trailing slash, don't add another + std::string dataPath = ""; + if (isBackup) { + dataPath = BackupContainerS3BlobStoreImpl::DATAFOLDER + "/"; + } + if (!m_name.empty() && m_name.back() == '/') { + dataPath += m_name + path; + } else { + dataPath += m_name + "/" + path; + } + return dataPath; } // Get the path of the backups's index entry std::string BackupContainerS3BlobStore::indexEntry() { + ASSERT(isBackup); return BackupContainerS3BlobStoreImpl::INDEXFOLDER + "/" + m_name; } BackupContainerS3BlobStore::BackupContainerS3BlobStore(Reference bstore, const std::string& name, const S3BlobStoreEndpoint::ParametersT& params, - const Optional& encryptionKeyFileName) - : m_bstore(bstore), m_name(name), m_bucket("FDB_BACKUPS_V2") { + const Optional& encryptionKeyFileName, + bool isBackup) + : m_bstore(bstore), m_name(name), m_bucket("FDB_BACKUPS_V2"), isBackup(isBackup) { setEncryptionKey(encryptionKeyFileName); // Currently only one parameter is supported, "bucket" for (const auto& [name, value] : params) { @@ -174,16 +185,16 @@ std::string BackupContainerS3BlobStore::getURLFormat() { Future> BackupContainerS3BlobStore::readFile(const std::string& path) { Reference f = makeReference(m_bstore, m_bucket, dataPath(path)); -#if ENCRYPTION_ENABLED if (usesEncryption()) { f = makeReference(f, AsyncFileEncrypted::Mode::READ_ONLY); } -#endif - f = makeReference(f, - m_bstore->knobs.read_block_size, - m_bstore->knobs.read_ahead_blocks, - m_bstore->knobs.concurrent_reads_per_file, - m_bstore->knobs.read_cache_blocks_per_file); + if (m_bstore->knobs.enable_read_cache) { + f = makeReference(f, + m_bstore->knobs.read_block_size, + m_bstore->knobs.read_ahead_blocks, + m_bstore->knobs.concurrent_reads_per_file, + m_bstore->knobs.read_cache_blocks_per_file); + } return f; } @@ -194,14 +205,16 @@ Future> BackupContainerS3BlobStore::listURLs(Reference< Future> BackupContainerS3BlobStore::writeFile(const std::string& path) { Reference f = makeReference(m_bstore, m_bucket, dataPath(path)); -#if ENCRYPTION_ENABLED if (usesEncryption()) { f = makeReference(f, AsyncFileEncrypted::Mode::APPEND_ONLY); } -#endif return Future>(makeReference(path, f)); } +Future BackupContainerS3BlobStore::writeEntireFile(const std::string& path, const std::string& fileContents) { + return m_bstore->writeEntireFile(m_bucket, dataPath(path), fileContents); +} + Future BackupContainerS3BlobStore::deleteFile(const std::string& path) { return m_bstore->deleteObject(m_bucket, dataPath(path)); } diff --git a/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp b/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp index 7110379..bff8403 100644 --- a/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp +++ b/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp @@ -22,9 +22,7 @@ #include "fdbclient/AsyncFileS3BlobStore.actor.h" #include "fdbclient/BackupContainerS3BlobStore.h" -#if (!defined(TLS_DISABLED) && !defined(_WIN32)) #include "fdbrpc/AsyncFileEncrypted.h" -#endif #include "fdbrpc/AsyncFileReadAhead.actor.h" #include "flow/actorcompiler.h" // This must be the last #include. @@ -37,24 +35,24 @@ class BackupContainerS3BlobStoreImpl { // number of slashes so the backup names are kept in a separate folder tree from their actual data. static const std::string INDEXFOLDER; - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" // This generated class is to be used only via listURLs() - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" template - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" class ListURLsActorState { - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" public: - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" ListURLsActorState(Reference const& bstore,std::string const& bucket) - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" : bstore(bstore), - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" bucket(bucket), - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" basePath(INDEXFOLDER + '/') - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" { fdb_probe_actor_create("listURLs", reinterpret_cast(this)); @@ -67,16 +65,16 @@ class ListURLsActorState { int a_body1(int loopDepth=0) { try { - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" StrictFuture __when_expr_0 = bstore->listObjects(bucket, basePath); - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -97,17 +95,17 @@ class ListURLsActorState { } int a_body1cont1(S3BlobStoreEndpoint::ListResult const& contents,int loopDepth) { - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" std::vector results; - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" for( const auto& f : contents.objects ) { - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" results.push_back( bstore->getResourceURL(f.name.substr(basePath.size()), format("bucket=%s", bucket.c_str()))); - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" } - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~ListURLsActorState(); static_cast(this)->destroy(); return 0; } - #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); this->~ListURLsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -117,17 +115,17 @@ class ListURLsActorState { } int a_body1cont1(S3BlobStoreEndpoint::ListResult && contents,int loopDepth) { - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" std::vector results; - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" for( const auto& f : contents.objects ) { - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" results.push_back( bstore->getResourceURL(f.name.substr(basePath.size()), format("bucket=%s", bucket.c_str()))); - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" } - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~ListURLsActorState(); static_cast(this)->destroy(); return 0; } - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); this->~ListURLsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -198,18 +196,18 @@ class ListURLsActorState { fdb_probe_actor_exit("listURLs", reinterpret_cast(this), 0); } - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" Reference bstore; - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" std::string bucket; - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" std::string basePath; - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" }; // This generated class is to be used only via listURLs() - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" class ListURLsActor final : public Actor>, public ActorCallback< ListURLsActor, 0, S3BlobStoreEndpoint::ListResult >, public FastAllocated, public ListURLsActorState { - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -218,9 +216,9 @@ class ListURLsActor final : public Actor>, public Actor void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ListURLsActor, 0, S3BlobStoreEndpoint::ListResult >; - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" ListURLsActor(Reference const& bstore,std::string const& bucket) - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" : Actor>(), ListURLsActorState(bstore, bucket) { @@ -243,14 +241,14 @@ friend struct ActorCallback< ListURLsActor, 0, S3BlobStoreEndpoint::ListResult > } }; - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" [[nodiscard]] static Future> listURLs( Reference const& bstore, std::string const& bucket ) { - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" return Future>(new ListURLsActor(bstore, bucket)); - #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" } -#line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" +#line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" class BackupFile : public IBackupFile, ReferenceCounted { public: @@ -281,26 +279,26 @@ friend struct ActorCallback< ListURLsActor, 0, S3BlobStoreEndpoint::ListResult > int64_t m_offset; }; - #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" // This generated class is to be used only via listFiles() - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" template - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" class ListFilesActorState { - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" public: - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" ListFilesActorState(Reference const& bc,std::string const& path,std::function const& pathFilter) - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" : bc(bc), - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" path(path), - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" pathFilter(pathFilter), - #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" prefixTrim(bc->dataPath("").size()) - #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" { fdb_probe_actor_create("listFiles", reinterpret_cast(this)); @@ -313,18 +311,18 @@ class ListFilesActorState { int a_body1(int loopDepth=0) { try { - #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" std::function rawPathFilter = [=](const std::string& folderPath) { ASSERT(folderPath.size() >= prefixTrim); return pathFilter(folderPath.substr(prefixTrim)); }; - #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" StrictFuture __when_expr_0 = bc->m_bstore->listObjects( bc->m_bucket, bc->dataPath(path), '/', std::numeric_limits::max(), rawPathFilter); - #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -345,19 +343,19 @@ class ListFilesActorState { } int a_body1cont1(int loopDepth) { - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" BackupContainerFileSystem::FilesAndSizesT files; - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" for( const auto& o : result.objects ) { - #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" ASSERT(o.name.size() >= prefixTrim); - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" files.push_back({ o.name.substr(prefixTrim), o.size }); - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" } - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(files); this->~ListFilesActorState(); static_cast(this)->destroy(); return 0; } - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" new (&static_cast(this)->SAV< BackupContainerFileSystem::FilesAndSizesT >::value()) BackupContainerFileSystem::FilesAndSizesT(files); this->~ListFilesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -367,9 +365,9 @@ class ListFilesActorState { } int a_body1when1(S3BlobStoreEndpoint::ListResult const& __result,int loopDepth) { - #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" result = __result; - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -432,22 +430,22 @@ class ListFilesActorState { fdb_probe_actor_exit("listFiles", reinterpret_cast(this), 0); } - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" Reference bc; - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" std::string path; - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" std::function pathFilter; - #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" int prefixTrim; - #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" S3BlobStoreEndpoint::ListResult result; - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" }; // This generated class is to be used only via listFiles() - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" class ListFilesActor final : public Actor, public ActorCallback< ListFilesActor, 0, S3BlobStoreEndpoint::ListResult >, public FastAllocated, public ListFilesActorState { - #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -456,9 +454,9 @@ class ListFilesActor final : public Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ListFilesActor, 0, S3BlobStoreEndpoint::ListResult >; - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" ListFilesActor(Reference const& bc,std::string const& path,std::function const& pathFilter) - #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" : Actor(), ListFilesActorState(bc, path, pathFilter) { @@ -481,29 +479,29 @@ friend struct ActorCallback< ListFilesActor, 0, S3BlobStoreEndpoint::ListResult } }; - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" [[nodiscard]] static Future listFiles( Reference const& bc, std::string const& path, std::function const& pathFilter ) { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" return Future(new ListFilesActor(bc, path, pathFilter)); - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" } -#line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" +#line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" - #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" // This generated class is to be used only via create() - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" template - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" class CreateActorState { - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" public: - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" CreateActorState(Reference const& bc) - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" : bc(bc) - #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" { fdb_probe_actor_create("create", reinterpret_cast(this)); @@ -516,16 +514,16 @@ class CreateActorState { int a_body1(int loopDepth=0) { try { - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" StrictFuture __when_expr_0 = bc->m_bstore->createBucket(bc->m_bucket); - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -546,32 +544,32 @@ class CreateActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" StrictFuture __when_expr_1 = bc->m_bstore->objectExists(bc->m_bucket, bc->indexEntry()); - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" StrictFuture __when_expr_1 = bc->m_bstore->objectExists(bc->m_bucket, bc->indexEntry()); - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -641,20 +639,20 @@ class CreateActorState { } int a_body1cont2(bool const& exists,int loopDepth) { - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (!exists) - #line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" { - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" StrictFuture __when_expr_2 = bc->m_bstore->writeEntireFile(bc->m_bucket, bc->indexEntry(), ""); - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" loopDepth = 0; } else @@ -666,20 +664,20 @@ class CreateActorState { } int a_body1cont2(bool && exists,int loopDepth) { - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (!exists) - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" { - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" StrictFuture __when_expr_2 = bc->m_bstore->writeEntireFile(bc->m_bucket, bc->indexEntry(), ""); - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" loopDepth = 0; } else @@ -754,20 +752,20 @@ class CreateActorState { } int a_body1cont3(int loopDepth) { - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (bc->usesEncryption()) - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" { - #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" StrictFuture __when_expr_3 = bc->encryptionSetupComplete(); - #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" loopDepth = 0; } else @@ -854,9 +852,9 @@ class CreateActorState { } int a_body1cont5(int loopDepth) { - #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CreateActorState(); static_cast(this)->destroy(); return 0; } - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CreateActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -939,14 +937,14 @@ class CreateActorState { fdb_probe_actor_exit("create", reinterpret_cast(this), 3); } - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" Reference bc; - #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" }; // This generated class is to be used only via create() - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" class CreateActor final : public Actor, public ActorCallback< CreateActor, 0, Void >, public ActorCallback< CreateActor, 1, bool >, public ActorCallback< CreateActor, 2, Void >, public ActorCallback< CreateActor, 3, Void >, public FastAllocated, public CreateActorState { - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -958,9 +956,9 @@ friend struct ActorCallback< CreateActor, 0, Void >; friend struct ActorCallback< CreateActor, 1, bool >; friend struct ActorCallback< CreateActor, 2, Void >; friend struct ActorCallback< CreateActor, 3, Void >; - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" CreateActor(Reference const& bc) - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" : Actor(), CreateActorState(bc) { @@ -986,31 +984,31 @@ friend struct ActorCallback< CreateActor, 3, Void >; } }; - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" [[nodiscard]] static Future create( Reference const& bc ) { - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" return Future(new CreateActor(bc)); - #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" } -#line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" +#line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" - #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" // This generated class is to be used only via deleteContainer() - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" template - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" class DeleteContainerActorState { - #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" public: - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" DeleteContainerActorState(Reference const& bc,int* const& pNumDeleted) - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" : bc(bc), - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" pNumDeleted(pNumDeleted) - #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" { fdb_probe_actor_create("deleteContainer", reinterpret_cast(this)); @@ -1023,16 +1021,16 @@ class DeleteContainerActorState { int a_body1(int loopDepth=0) { try { - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" StrictFuture __when_expr_0 = bc->exists(); - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1053,52 +1051,52 @@ class DeleteContainerActorState { } int a_body1cont1(bool const& e,int loopDepth) { - #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (!e) - #line 1058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" { - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" TraceEvent(SevWarnAlways, "BackupContainerDoesNotExist").detail("URL", bc->getURL()); - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" return a_body1Catch1(backup_does_not_exist(), loopDepth); - #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" } - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" StrictFuture __when_expr_1 = bc->m_bstore->deleteRecursively(bc->m_bucket, bc->dataPath(""), pNumDeleted); - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(bool && e,int loopDepth) { - #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (!e) - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" { - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" TraceEvent(SevWarnAlways, "BackupContainerDoesNotExist").detail("URL", bc->getURL()); - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" return a_body1Catch1(backup_does_not_exist(), loopDepth); - #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" } - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" StrictFuture __when_expr_1 = bc->m_bstore->deleteRecursively(bc->m_bucket, bc->dataPath(""), pNumDeleted); - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1168,32 +1166,32 @@ class DeleteContainerActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" StrictFuture __when_expr_2 = bc->m_bstore->deleteObject(bc->m_bucket, bc->indexEntry()); - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" StrictFuture __when_expr_2 = bc->m_bstore->deleteObject(bc->m_bucket, bc->indexEntry()); - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1263,9 +1261,9 @@ class DeleteContainerActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteContainerActorState(); static_cast(this)->destroy(); return 0; } - #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DeleteContainerActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1275,9 +1273,9 @@ class DeleteContainerActorState { } int a_body1cont4(Void && _,int loopDepth) { - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteContainerActorState(); static_cast(this)->destroy(); return 0; } - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DeleteContainerActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1348,16 +1346,16 @@ class DeleteContainerActorState { fdb_probe_actor_exit("deleteContainer", reinterpret_cast(this), 2); } - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" Reference bc; - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" int* pNumDeleted; - #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" }; // This generated class is to be used only via deleteContainer() - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" class DeleteContainerActor final : public Actor, public ActorCallback< DeleteContainerActor, 0, bool >, public ActorCallback< DeleteContainerActor, 1, Void >, public ActorCallback< DeleteContainerActor, 2, Void >, public FastAllocated, public DeleteContainerActorState { - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1368,9 +1366,9 @@ class DeleteContainerActor final : public Actor, public ActorCallback< Del friend struct ActorCallback< DeleteContainerActor, 0, bool >; friend struct ActorCallback< DeleteContainerActor, 1, Void >; friend struct ActorCallback< DeleteContainerActor, 2, Void >; - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" DeleteContainerActor(Reference const& bc,int* const& pNumDeleted) - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" : Actor(), DeleteContainerActorState(bc, pNumDeleted) { @@ -1395,33 +1393,46 @@ friend struct ActorCallback< DeleteContainerActor, 2, Void >; } }; - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" [[nodiscard]] static Future deleteContainer( Reference const& bc, int* const& pNumDeleted ) { - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" return Future(new DeleteContainerActor(bc, pNumDeleted)); - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" + #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.g.cpp" } -#line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" +#line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupContainerS3BlobStore.actor.cpp" }; const std::string BackupContainerS3BlobStoreImpl::DATAFOLDER = "data"; const std::string BackupContainerS3BlobStoreImpl::INDEXFOLDER = "backups"; std::string BackupContainerS3BlobStore::dataPath(const std::string& path) { - return BackupContainerS3BlobStoreImpl::DATAFOLDER + "/" + m_name + "/" + path; + // if backup, include the backup data prefix. + // if m_name ends in a trailing slash, don't add another + std::string dataPath = ""; + if (isBackup) { + dataPath = BackupContainerS3BlobStoreImpl::DATAFOLDER + "/"; + } + if (!m_name.empty() && m_name.back() == '/') { + dataPath += m_name + path; + } else { + dataPath += m_name + "/" + path; + } + return dataPath; } // Get the path of the backups's index entry std::string BackupContainerS3BlobStore::indexEntry() { + ASSERT(isBackup); return BackupContainerS3BlobStoreImpl::INDEXFOLDER + "/" + m_name; } BackupContainerS3BlobStore::BackupContainerS3BlobStore(Reference bstore, const std::string& name, const S3BlobStoreEndpoint::ParametersT& params, - const Optional& encryptionKeyFileName) - : m_bstore(bstore), m_name(name), m_bucket("FDB_BACKUPS_V2") { + const Optional& encryptionKeyFileName, + bool isBackup) + : m_bstore(bstore), m_name(name), m_bucket("FDB_BACKUPS_V2"), isBackup(isBackup) { setEncryptionKey(encryptionKeyFileName); // Currently only one parameter is supported, "bucket" for (const auto& [name, value] : params) { @@ -1449,16 +1460,16 @@ std::string BackupContainerS3BlobStore::getURLFormat() { Future> BackupContainerS3BlobStore::readFile(const std::string& path) { Reference f = makeReference(m_bstore, m_bucket, dataPath(path)); -#if ENCRYPTION_ENABLED if (usesEncryption()) { f = makeReference(f, AsyncFileEncrypted::Mode::READ_ONLY); } -#endif - f = makeReference(f, - m_bstore->knobs.read_block_size, - m_bstore->knobs.read_ahead_blocks, - m_bstore->knobs.concurrent_reads_per_file, - m_bstore->knobs.read_cache_blocks_per_file); + if (m_bstore->knobs.enable_read_cache) { + f = makeReference(f, + m_bstore->knobs.read_block_size, + m_bstore->knobs.read_ahead_blocks, + m_bstore->knobs.concurrent_reads_per_file, + m_bstore->knobs.read_cache_blocks_per_file); + } return f; } @@ -1469,14 +1480,16 @@ Future> BackupContainerS3BlobStore::listURLs(Reference< Future> BackupContainerS3BlobStore::writeFile(const std::string& path) { Reference f = makeReference(m_bstore, m_bucket, dataPath(path)); -#if ENCRYPTION_ENABLED if (usesEncryption()) { f = makeReference(f, AsyncFileEncrypted::Mode::APPEND_ONLY); } -#endif return Future>(makeReference(path, f)); } +Future BackupContainerS3BlobStore::writeEntireFile(const std::string& path, const std::string& fileContents) { + return m_bstore->writeEntireFile(m_bucket, dataPath(path), fileContents); +} + Future BackupContainerS3BlobStore::deleteFile(const std::string& path) { return m_bstore->deleteObject(m_bucket, dataPath(path)); } diff --git a/src/fdbclient/BlobCipher.cpp b/src/fdbclient/BlobCipher.cpp new file mode 100644 index 0000000..98e1061 --- /dev/null +++ b/src/fdbclient/BlobCipher.cpp @@ -0,0 +1,3159 @@ +/* + * BlobCipher.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/BlobCipher.h" + +#include "fdbclient/FDBTypes.h" +#include "fdbclient/Knobs.h" + +#include "flow/Arena.h" +#include "flow/EncryptUtils.h" +#include "flow/FileIdentifier.h" +#include "flow/FastRef.h" +#include "flow/IndexedSet.h" +#include "flow/flow.h" +#include "flow/Error.h" +#include "flow/Knobs.h" +#include "flow/IRandom.h" +#include "flow/ITrace.h" +#include "flow/ObjectSerializer.h" +#include "flow/Platform.h" +#include "flow/ProtocolVersion.h" +#include "flow/network.h" +#include "flow/serialize.h" +#include "flow/Trace.h" +#include "flow/UnitTest.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef _WIN32 +#include +#else +#include +#endif + +#define BLOB_CIPHER_DEBUG DEBUG_ENCRYPT_KEY_CIPHER + +namespace { +void validateEncryptHeaderFlagVersion(const int flagsVersion) { + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + + if (flagsVersion > CLIENT_KNOBS->ENCRYPT_HEADER_FLAGS_VERSION) { + TraceEvent("EncryptHeaderUnsupportedFlagVersion") + .detail("MaxSupportedVersion", CLIENT_KNOBS->ENCRYPT_HEADER_FLAGS_VERSION) + .detail("Version", flagsVersion); + throw not_implemented(); + } +} + +void validateEncryptHeaderAlgoHeaderVersion(const EncryptCipherMode cipherMode, + const EncryptAuthTokenMode authMode, + const EncryptAuthTokenAlgo authAlgo, + const int version) { + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + + if (cipherMode != ENCRYPT_CIPHER_MODE_AES_256_CTR) { + TraceEvent("EncryptHeaderUnsupportedEncryptCipherMode") + .detail("MaxSupportedVersion", CLIENT_KNOBS->ENCRYPT_HEADER_FLAGS_VERSION) + .detail("CipherMode", cipherMode); + throw not_implemented(); + } + + int maxSupportedVersion = -1; + if (authMode == ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) { + maxSupportedVersion = CLIENT_KNOBS->ENCRYPT_HEADER_AES_CTR_NO_AUTH_VERSION; + } else { + ASSERT_EQ(authMode, ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE); + + if (authAlgo == ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA) { + maxSupportedVersion = CLIENT_KNOBS->ENCRYPT_HEADER_AES_CTR_HMAC_SHA_AUTH_VERSION; + } else if (authAlgo == ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC) { + maxSupportedVersion = CLIENT_KNOBS->ENCRYPT_HEADER_AES_CTR_AES_CMAC_AUTH_VERSION; + } else { + // Unknown encryption authentication algo + } + } + + if (version > maxSupportedVersion || maxSupportedVersion == -1) { + TraceEvent("EncryptHeaderUnsupportedEncryptAuthToken") + .detail("CipherMode", cipherMode) + .detail("AuthMode", authMode) + .detail("AuthAlgo", authAlgo) + .detail("AlgoHeaderVersion", version) + .detail("MaxSsupportedVersion", maxSupportedVersion); + throw not_implemented(); + } +} +} // namespace + +// BlobCipherEncryptHeaderRef + +uint32_t BlobCipherEncryptHeaderRef::getHeaderSize(const int flagVersion, + const int algoVersion, + const EncryptCipherMode cipherMode, + const EncryptAuthTokenMode authMode, + const EncryptAuthTokenAlgo authAlgo) { + if (flagVersion != 1) { + TraceEvent("BlobCipherGetHeaderSizeInvalidFlagVersion").detail("FlagVersion", flagVersion); + throw not_implemented(); + } + if (algoVersion != 1) { + TraceEvent("BlobCipherGetHeaderSizeInvalidAlgoVersion").detail("AlgoVersion", algoVersion); + throw not_implemented(); + } + + uint32_t total = sizeof(BlobCipherEncryptHeaderFlagsV1) + 2; // 2 bytes of std::variant index + + if (cipherMode != ENCRYPT_CIPHER_MODE_AES_256_CTR) { + throw not_implemented(); + } + + if (authMode == ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) { + total += AesCtrNoAuth::getSize(); + } else { + if (authAlgo == ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA) { + total += AesCtrWithHmac::getSize(); + } else { + ASSERT_EQ(authAlgo, ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC); + total += AesCtrWithCmac::getSize(); + } + } + return total; +} + +const uint8_t* BlobCipherEncryptHeaderRef::getIV() const { + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + + validateEncryptHeaderFlagVersion(flagsVersion()); + ASSERT_EQ(flagsVersion(), 1); + + BlobCipherEncryptHeaderFlagsV1 flags = std::get(this->flags); + + validateEncryptHeaderAlgoHeaderVersion((EncryptCipherMode)flags.encryptMode, + (EncryptAuthTokenMode)flags.authTokenMode, + (EncryptAuthTokenAlgo)flags.authTokenAlgo, + algoHeaderVersion()); + ASSERT_EQ(algoHeaderVersion(), 1); + + return std::visit([](auto& h) { return h.v1.iv; }, algoHeader); +} + +template +inline constexpr bool always_false_v = false; + +const EncryptHeaderCipherDetails BlobCipherEncryptHeaderRef::getCipherDetails() const { + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + + validateEncryptHeaderFlagVersion(flagsVersion()); + ASSERT_EQ(flagsVersion(), 1); + + BlobCipherEncryptHeaderFlagsV1 flags = std::get(this->flags); + + validateEncryptHeaderAlgoHeaderVersion((EncryptCipherMode)flags.encryptMode, + (EncryptAuthTokenMode)flags.authTokenMode, + (EncryptAuthTokenAlgo)flags.authTokenAlgo, + algoHeaderVersion()); + ASSERT_EQ(algoHeaderVersion(), 1); + + // TODO: Replace with "Overload visitor pattern" someday. + return std::visit( + [](auto&& h) { + using T = std::decay_t; + if constexpr (std::is_same_v) { + return EncryptHeaderCipherDetails(h.v1.cipherTextDetails); + } else if constexpr (std::is_same_v || std::is_same_v) { + return EncryptHeaderCipherDetails(h.v1.cipherTextDetails, h.v1.cipherHeaderDetails); + } else { + static_assert(always_false_v, "Unknown encryption authentication"); + } + }, + algoHeader); +} + +EncryptAuthTokenMode BlobCipherEncryptHeaderRef::getAuthTokenMode() const { + // TODO: Replace with "Overload visitor pattern" someday. + return std::visit( + [](auto&& f) { + using T = std::decay_t; + if constexpr (std::is_same_v) { + return (EncryptAuthTokenMode)f.authTokenMode; + } else { + static_assert(always_false_v, "Unknown encryption flag header"); + } + }, + flags); +} + +EncryptCipherDomainId BlobCipherEncryptHeaderRef::getDomainId() const { + return std::visit([](auto& h) { return h.v1.cipherTextDetails.encryptDomainId; }, algoHeader); +} + +EncryptHeaderCipherKCVs BlobCipherEncryptHeaderRef::getKCVs() const { + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + + validateEncryptHeaderFlagVersion(flagsVersion()); + ASSERT_EQ(flagsVersion(), 1); + + BlobCipherEncryptHeaderFlagsV1 flags = std::get(this->flags); + + validateEncryptHeaderAlgoHeaderVersion((EncryptCipherMode)flags.encryptMode, + (EncryptAuthTokenMode)flags.authTokenMode, + (EncryptAuthTokenAlgo)flags.authTokenAlgo, + algoHeaderVersion()); + ASSERT_EQ(algoHeaderVersion(), 1); + + // TODO: Replace with "Overload visitor pattern" someday. + return std::visit( + [](auto&& h) { + using T = std::decay_t; + if constexpr (std::is_same_v) { + return EncryptHeaderCipherKCVs(h.v1.textKCV); + } else if constexpr (std::is_same_v || std::is_same_v) { + return EncryptHeaderCipherKCVs(h.v1.textKCV, h.v1.headerKCV); + } else { + static_assert(always_false_v, "Unknown encryption authentication"); + } + }, + algoHeader); +} + +void BlobCipherEncryptHeaderRef::validateEncryptionHeaderDetails(const BlobCipherDetails& textCipherDetails, + const BlobCipherDetails& headerCipherDetails, + const EncryptHeaderCipherKCVs& kcvs, + const StringRef& ivRef) const { + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + + validateEncryptHeaderFlagVersion(flagsVersion()); + ASSERT_EQ(flagsVersion(), 1); + + BlobCipherEncryptHeaderFlagsV1 flags = std::get(this->flags); + + validateEncryptHeaderAlgoHeaderVersion((EncryptCipherMode)flags.encryptMode, + (EncryptAuthTokenMode)flags.authTokenMode, + (EncryptAuthTokenAlgo)flags.authTokenAlgo, + algoHeaderVersion()); + ASSERT_EQ(algoHeaderVersion(), 1); + + BlobCipherDetails persistedTextCipherDetails; + BlobCipherDetails persistedHeaderCipherDetails; + uint8_t* persistedIV = nullptr; + EncryptCipherKeyCheckValue persistedTextKCV; + Optional persistedHeaderKCV; + + // TODO: Replace with "Overload visitor pattern" someday. + return std::visit( + [&persistedTextCipherDetails, + &persistedHeaderCipherDetails, + &persistedIV, + &persistedTextKCV, + &persistedHeaderKCV](auto&& h) { + using T = std::decay_t; + if constexpr (std::is_same_v) { + persistedTextCipherDetails = h.v1.cipherTextDetails; + persistedIV = (uint8_t*)&h.v1.iv[0]; + persistedTextKCV = h.v1.textKCV; + } else if constexpr (std::is_same_v || std::is_same_v) { + persistedTextCipherDetails = h.v1.cipherTextDetails; + persistedHeaderCipherDetails = h.v1.cipherHeaderDetails; + persistedIV = (uint8_t*)&h.v1.iv[0]; + persistedTextKCV = h.v1.textKCV; + persistedHeaderKCV = h.v1.headerKCV; + } else { + static_assert(always_false_v, "Unknown encryption authentication"); + } + }, + algoHeader); + + // Validate encryption header 'cipherHeader' details sanity + if (flags.authTokenMode != ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE && + headerCipherDetails != persistedHeaderCipherDetails) { + TraceEvent(SevError, "ValidateEncryptHeaderMismatch") + .detail("HeaderDomainId", headerCipherDetails.encryptDomainId) + .detail("PersistedHeaderDomainId", persistedHeaderCipherDetails.encryptDomainId) + .detail("HeaderBaseCipherId", headerCipherDetails.baseCipherId) + .detail("ExpectedHeaderBaseCipherId", persistedHeaderCipherDetails.baseCipherId) + .detail("HeaderSalt", headerCipherDetails.salt) + .detail("ExpectedHeaderSalt", persistedHeaderCipherDetails.salt); + throw encrypt_header_metadata_mismatch(); + } + // Validate encryption header 'cipherText' details sanity + if (textCipherDetails != persistedTextCipherDetails) { + TraceEvent(SevError, "ValidateEncryptHeaderMismatch") + .detail("TextDomainId", textCipherDetails.encryptDomainId) + .detail("PersistedTextDomainId", persistedTextCipherDetails.encryptDomainId) + .detail("TextBaseCipherId", textCipherDetails.baseCipherId) + .detail("PersistedTextBaseCipherId", persistedTextCipherDetails.encryptDomainId) + .detail("TextSalt", textCipherDetails.salt) + .detail("PersistedTextSalt", persistedTextCipherDetails.salt); + throw encrypt_header_metadata_mismatch(); + } + // Validate 'Initialization Vector' sanity + if (memcmp(ivRef.begin(), persistedIV, AES_256_IV_LENGTH) != 0) { + TraceEvent(SevError, "EncryptionHeaderIVMismatch") + .detail("IVChecksum", XXH3_64bits(ivRef.begin(), ivRef.size())) + .detail("ExpectedIVChecksum", XXH3_64bits(persistedIV, AES_256_IV_LENGTH)); + throw encrypt_header_metadata_mismatch(); + } + + // Validate baseCipher KCVs + if (persistedTextKCV != kcvs.textKCV) { + TraceEvent(SevError, "EncryptionHeadeTextKCVMismatch") + .detail("Persisted", persistedTextKCV) + .detail("Expected", kcvs.textKCV); + throw encrypt_key_check_value_mismatch(); + } + if (persistedHeaderKCV.present()) { + if (!kcvs.headerKCV.present()) { + TraceEvent(SevError, "EncryptionHeadeMissingHeaderKCV"); + throw encrypt_key_check_value_mismatch(); + } + if (persistedHeaderKCV.get() != kcvs.headerKCV.get()) { + TraceEvent(SevError, "EncryptionHeadeTextKCVMismatch") + .detail("Persisted", persistedTextKCV) + .detail("Expected", kcvs.textKCV); + throw encrypt_key_check_value_mismatch(); + } + } +} + +// BlobCipherMetrics methods + +BlobCipherMetrics::CounterSet::CounterSet(CounterCollection& cc, std::string name) + : encryptCPUTimeNS(name + "EncryptCPUTimeNS", cc), decryptCPUTimeNS(name + "DecryptCPUTimeNS", cc), + getCipherKeysLatency(name + "GetCipherKeysLatency", + UID(), + FLOW_KNOBS->ENCRYPT_KEY_CACHE_LATENCY_LOGGING_INTERVAL, + FLOW_KNOBS->ENCRYPT_KEY_CACHE_LOGGING_SKETCH_ACCURACY), + getLatestCipherKeysLatency(name + "GetLatestCipherKeysLatency", + UID(), + FLOW_KNOBS->ENCRYPT_KEY_CACHE_LATENCY_LOGGING_INTERVAL, + FLOW_KNOBS->ENCRYPT_KEY_CACHE_LOGGING_SKETCH_ACCURACY) {} + +BlobCipherMetrics::BlobCipherMetrics() + : cc("BlobCipher"), cipherKeyCacheHit("CipherKeyCacheHit", cc), cipherKeyCacheMiss("CipherKeyCacheMiss", cc), + cipherKeyCacheExpired("CipherKeyCacheExpired", cc), latestCipherKeyCacheHit("LatestCipherKeyCacheHit", cc), + latestCipherKeyCacheMiss("LatestCipherKeyCacheMiss", cc), + latestCipherKeyCacheNeedsRefresh("LatestCipherKeyCacheNeedsRefresh", cc), + getCipherKeysLatency("GetCipherKeysLatency", + UID(), + FLOW_KNOBS->ENCRYPT_KEY_CACHE_LATENCY_LOGGING_INTERVAL, + FLOW_KNOBS->ENCRYPT_KEY_CACHE_LOGGING_SKETCH_ACCURACY), + getLatestCipherKeysLatency("GetLatestCipherKeysLatency", + UID(), + FLOW_KNOBS->ENCRYPT_KEY_CACHE_LATENCY_LOGGING_INTERVAL, + FLOW_KNOBS->ENCRYPT_KEY_CACHE_LOGGING_SKETCH_ACCURACY), + getBlobMetadataLatency("GetBlobMetadataLatency", + UID(), + FLOW_KNOBS->ENCRYPT_KEY_CACHE_LATENCY_LOGGING_INTERVAL, + FLOW_KNOBS->ENCRYPT_KEY_CACHE_LOGGING_SKETCH_ACCURACY), + counterSets({ CounterSet(cc, "TLog"), + CounterSet(cc, "TLogPostResolution"), + CounterSet(cc, "KVMemory"), + CounterSet(cc, "KVRedwood"), + CounterSet(cc, "BlobGranule"), + CounterSet(cc, "Backup"), + CounterSet(cc, "Restore"), + CounterSet(cc, "Test") }) { + specialCounter(cc, "CacheSize", []() { return BlobCipherKeyCache::getInstance()->getSize(); }); + traceFuture = cc.traceCounters("BlobCipherMetrics", UID(), FLOW_KNOBS->ENCRYPT_KEY_CACHE_LOGGING_INTERVAL); +} + +std::string toString(BlobCipherMetrics::UsageType type) { + switch (type) { + case BlobCipherMetrics::UsageType::TLOG: + return "TLog"; + case BlobCipherMetrics::UsageType::TLOG_POST_RESOLUTION: + return "TLogPostResolution"; + case BlobCipherMetrics::UsageType::KV_MEMORY: + return "KVMemory"; + case BlobCipherMetrics::UsageType::KV_REDWOOD: + return "KVRedwood"; + case BlobCipherMetrics::UsageType::BLOB_GRANULE: + return "BlobGranule"; + case BlobCipherMetrics::UsageType::BACKUP: + return "Backup"; + case BlobCipherMetrics::UsageType::RESTORE: + return "Restore"; + case BlobCipherMetrics::UsageType::TEST: + return "Test"; + default: + ASSERT(false); + return ""; + } +} + +// BlobCipherKey class methods + +BlobCipherKey::BlobCipherKey(const EncryptCipherDomainId& domainId, + const EncryptCipherBaseKeyId& baseCiphId, + const uint8_t* baseCiph, + const int baseCiphLen, + const EncryptCipherKeyCheckValue baseCiphKCV, + const int64_t refreshAt, + const int64_t expireAt) { + // Salt generated is used while applying HMAC Key derivation, hence, not using crypto-secure hash algorithm is + // ok. Further, 'deterministic' salt generation is used to preserve simulation determinism properties. + EncryptCipherRandomSalt salt; + if (g_network->isSimulated()) { + salt = deterministicRandom()->randomUInt64(); + } else { + salt = nondeterministicRandom()->randomUInt64(); + } + + // Support two type of CipherKeys: 'revocable' & 'non-revocable' ciphers. + // In all cases, either cipherKey never expires i.e. refreshAt == infinite, or, refreshAt needs <= expireAt + // timestamp. + ASSERT(refreshAt == std::numeric_limits::max() || (refreshAt <= expireAt)); + + initKey(domainId, baseCiphId, baseCiph, baseCiphLen, baseCiphKCV, salt, refreshAt, expireAt); +} + +BlobCipherKey::BlobCipherKey(const EncryptCipherDomainId& domainId, + const EncryptCipherBaseKeyId& baseCiphId, + const uint8_t* baseCiph, + const int baseCiphLen, + const EncryptCipherKeyCheckValue baseCiphKCV, + const EncryptCipherRandomSalt& salt, + const int64_t refreshAt, + const int64_t expireAt) { + initKey(domainId, baseCiphId, baseCiph, baseCiphLen, baseCiphKCV, salt, refreshAt, expireAt); +} + +void BlobCipherKey::initKey(const EncryptCipherDomainId& domainId, + const EncryptCipherBaseKeyId& baseCiphId, + const uint8_t* baseCiph, + const int baseCiphLen, + const EncryptCipherKeyCheckValue baseCiphKCV, + const EncryptCipherRandomSalt& salt, + const int64_t refreshAt, + const int64_t expireAt) { + if (baseCiphLen > MAX_BASE_CIPHER_LEN) { + // HMAC_SHA digest generation accepts upto MAX_BASE_CIPHER_LEN key-buffer, longer keys are truncated and weakens + // the security guarantees. + TraceEvent(SevWarnAlways, "MaxBaseCipherKeyLimit") + .detail("MaxAllowed", MAX_BASE_CIPHER_LEN) + .detail("BaseCipherLen", baseCiphLen); + CODE_PROBE(true, "Encryption max base cipher len violation"); + throw encrypt_max_base_cipher_len(); + } + + const EncryptCipherKeyCheckValue computedKCV = Sha256KCV().computeKCV(baseCiph, baseCiphLen); + if (computedKCV != baseCiphKCV) { + TraceEvent(SevWarnAlways, "BlobCipherKeyInitBaseCipherKCVMismatch") + .detail("DomId", domainId) + .detail("BaseCipherId", baseCiphId) + .detail("Computed", computedKCV) + .detail("BaseCipherKCV", baseCipherKCV); + throw encrypt_ops_error(); + } + + // Set the base encryption key properties + baseCipher = std::make_unique(baseCiphLen); + memcpy(baseCipher.get(), baseCiph, baseCiphLen); + baseCipherLen = baseCiphLen; + baseCipherKCV = baseCiphKCV; + baseCipherId = baseCiphId; + // Set the encryption domain for the base encryption key + encryptDomainId = domainId; + randomSalt = salt; + // derive the encryption key + cipher = std::make_unique(AES_256_KEY_LENGTH); + memset(cipher.get(), 0, AES_256_KEY_LENGTH); + applyHmacSha256Derivation(); + // update cipher 'refresh' and 'expire' TS + refreshAtTS = refreshAt; + expireAtTS = expireAt; + +#if BLOB_CIPHER_DEBUG + TraceEvent(SevDebug, "BlobCipherKeyInit") + .detail("DomainId", domainId) + .detail("BaseCipherId", baseCipherId) + .detail("BaseCipherLen", baseCipherLen) + .detail("RandomSalt", randomSalt) + .detail("RefreshAt", refreshAtTS) + .detail("ExpireAtTS", expireAtTS) + .detail("BaseCipherKCV", baseCipherKCV); +#endif +} + +void BlobCipherKey::applyHmacSha256Derivation() { + Arena arena; + uint8_t buf[baseCipherLen + sizeof(EncryptCipherRandomSalt)]; + memcpy(&buf[0], baseCipher.get(), baseCipherLen); + memcpy(&buf[0] + baseCipherLen, &randomSalt, sizeof(EncryptCipherRandomSalt)); + HmacSha256DigestGen hmacGen(baseCipher.get(), baseCipherLen); + unsigned int digestLen = hmacGen.digest( + { { &buf[0], baseCipherLen + sizeof(EncryptCipherRandomSalt) } }, cipher.get(), AUTH_TOKEN_HMAC_SHA_SIZE); + if (digestLen < AES_256_KEY_LENGTH) { + memcpy(cipher.get() + digestLen, buf, AES_256_KEY_LENGTH - digestLen); + } +} + +void BlobCipherKey::reset() { + memset(baseCipher.get(), 0, baseCipherLen); + memset(cipher.get(), 0, AES_256_KEY_LENGTH); +} + +// BlobKeyIdCache class methods + +BlobCipherKeyIdCache::BlobCipherKeyIdCache(EncryptCipherDomainId dId, size_t* sizeStat) + : domainId(dId), latestBaseCipherKeyId(), latestRandomSalt(), sizeStat(sizeStat) { + ASSERT(sizeStat != nullptr); + TraceEvent(SevInfo, "BlobCipherKeyIdCacheInit").detail("DomainId", domainId); +} + +BlobCipherKeyIdCacheKey BlobCipherKeyIdCache::getCacheKey(const EncryptCipherBaseKeyId& baseCipherKeyId, + const EncryptCipherRandomSalt& salt) { + if (baseCipherKeyId == INVALID_ENCRYPT_CIPHER_KEY_ID || salt == INVALID_ENCRYPT_RANDOM_SALT) { + throw encrypt_invalid_id(); + } + return std::make_pair(baseCipherKeyId, salt); +} + +Reference BlobCipherKeyIdCache::getLatestCipherKey() { + if (!latestBaseCipherKeyId.present()) { + return Reference(); + } + + ASSERT_NE(latestBaseCipherKeyId.get(), INVALID_ENCRYPT_CIPHER_KEY_ID); + ASSERT(latestRandomSalt.present()); + ASSERT_NE(latestRandomSalt.get(), INVALID_ENCRYPT_RANDOM_SALT); + + Reference latest = getCipherByBaseCipherId(latestBaseCipherKeyId.get(), latestRandomSalt.get()); + if (!latest.isValid()) { + // Cipher already 'expired' + return Reference(); + } + + ASSERT(!latest->isExpired()); + ASSERT_EQ(latest->getBaseCipherId(), latestBaseCipherKeyId.get()); + ASSERT_EQ(latest->getSalt(), latestRandomSalt.get()); + + if (latest->needsRefresh()) { +#if BLOB_CIPHER_DEBUG + TraceEvent(SevDebug, "BlobCipherGetLatestNeedsRefresh") + .detail("DomainId", domainId) + .detail("Now", now()) + .detail("RefreshAt", latest->getRefreshAtTS()) + .detail("ExpireAt", latest->getExpireAtTS()); +#endif + ++BlobCipherMetrics::getInstance()->latestCipherKeyCacheNeedsRefresh; + latestBaseCipherKeyId.reset(); + latestRandomSalt.reset(); + return Reference(); + } + return latest; +} + +Reference BlobCipherKeyIdCache::getCipherByBaseCipherId(const EncryptCipherBaseKeyId& baseCipherKeyId, + const EncryptCipherRandomSalt& salt) { + BlobCipherKeyIdCacheMapCItr itr = keyIdCache.find(getCacheKey(baseCipherKeyId, salt)); + if (itr == keyIdCache.end()) { + return Reference(); + } + + if (itr->second->isExpired()) { +#if BLOB_CIPHER_DEBUG + TraceEvent(SevDebug, "BlobCipherGetCipherExpired") + .detail("DomainId", domainId) + .detail("BaseCipherId", itr->second->getBaseCipherId()) + .detail("Now", now()) + .detail("ExpireAt", itr->second->getExpireAtTS()); +#endif + ++BlobCipherMetrics::getInstance()->cipherKeyCacheExpired; + // remove the expired key from the cache + keyIdCache.erase(itr); + return Reference(); + } + return itr->second; +} + +Reference BlobCipherKeyIdCache::insertBaseCipherKey(const EncryptCipherBaseKeyId& baseCipherId, + const uint8_t* baseCipher, + const int baseCipherLen, + const EncryptCipherKeyCheckValue baseCipherKCV, + const int64_t refreshAt, + const int64_t expireAt) { + ASSERT_GT(baseCipherId, INVALID_ENCRYPT_CIPHER_KEY_ID); + ASSERT_GT(baseCipherLen, 0); + + // BaseCipherKeys are immutable, given the routine invocation updates 'latestCipher', + // ensure no key-tampering is done + Reference latestCipherKey = getLatestCipherKey(); + if (latestCipherKey.isValid() && latestCipherKey->getBaseCipherId() == baseCipherId) { + if (memcmp(latestCipherKey->rawBaseCipher(), baseCipher, baseCipherLen) == 0) { +#if BLOB_CIPHER_DEBUG + TraceEvent(SevDebug, "InsertBaseCipherKeyAlreadyPresent") + .detail("BaseCipherKeyId", baseCipherId) + .detail("DomainId", domainId) + .detail("BaseCipherKCV", baseCipherKCV); +#endif + + // Key is already present; nothing more to do. + return latestCipherKey; + } else { + TraceEvent(SevInfo, "BlobCipherUpdatetBaseCipherKey") + .detail("BaseCipherKeyId", baseCipherId) + .detail("DomainId", domainId); + throw encrypt_update_cipher(); + } + } + + // Logging only tracks newly inserted cipher in the cache + // Approach limits the logging to two instances when new cipher gets added to the cache, two + // possible scenarios could be: + // 1. Cold start - cache getting warmed up + // 2. New cipher - new Tenant and/or KMS driven key-rotation + // Frequency of the log is governed by KMS driven `refreshAt` interval which is usually a long duration (days if + // not months) + TraceEvent(SevInfo, "BlobCipherKeyInsertBaseCipherKeyLatest") + .detail("DomainId", domainId) + .detail("BaseCipherId", baseCipherId) + .detail("BaseCipherLen", baseCipherLen) + .detail("BaseCipherKCV", baseCipherKCV) + .detail("RefreshAt", refreshAt) + .detail("ExpireAt", expireAt); + + Reference cipherKey = makeReference( + domainId, baseCipherId, baseCipher, baseCipherLen, baseCipherKCV, refreshAt, expireAt); + BlobCipherKeyIdCacheKey cacheKey = getCacheKey(cipherKey->getBaseCipherId(), cipherKey->getSalt()); + auto result = keyIdCache.emplace(cacheKey, cipherKey); + ASSERT(result.second); + + // Update the latest BaseCipherKeyId for the given encryption domain + latestBaseCipherKeyId = baseCipherId; + latestRandomSalt = cipherKey->getSalt(); + + (*sizeStat)++; + return cipherKey; +} + +Reference BlobCipherKeyIdCache::insertBaseCipherKey(const EncryptCipherBaseKeyId& baseCipherId, + const uint8_t* baseCipher, + const int baseCipherLen, + const EncryptCipherKeyCheckValue baseCipherKCV, + const EncryptCipherRandomSalt& salt, + const int64_t refreshAt, + const int64_t expireAt) { + ASSERT_NE(baseCipherId, INVALID_ENCRYPT_CIPHER_KEY_ID); + ASSERT_NE(salt, INVALID_ENCRYPT_RANDOM_SALT); + ASSERT_GT(baseCipherLen, 0); + + BlobCipherKeyIdCacheKey cacheKey = getCacheKey(baseCipherId, salt); + + // BaseCipherKeys are immutable, ensure that cached value doesn't get updated. + BlobCipherKeyIdCacheMapCItr itr = keyIdCache.find(cacheKey); + if (itr != keyIdCache.end()) { + if (memcmp(itr->second->rawBaseCipher(), baseCipher, baseCipherLen) == 0) { +#if BLOB_CIPHER_DEBUG + TraceEvent(SevDebug, "InsertBaseCipherKeyAlreadyPresent") + .detail("BaseCipherKeyId", baseCipherId) + .detail("DomainId", domainId) + .detail("BaseCipherKCV", baseCipherKCV); +#endif + + // Key is already present; nothing more to do. + return itr->second; + } else { + TraceEvent(SevInfo, "BlobCipherUpdateBaseCipherKey") + .detail("BaseCipherKeyId", baseCipherId) + .detail("DomainId", domainId); + throw encrypt_update_cipher(); + } + } + + // Logging only tracks newly inserted cipher in the cache + // possible scenarios could be: + // 1. Cold start - cache getting warmed up + // 2. New cipher - new Tenant and/or KMS driven key-rotation + // Frequency of the log is governed by KMS driven `refreshAt` interval which is usually a long duration (days if + // not months) + TraceEvent(SevInfo, "BlobCipherKeyInsertBaseCipherKey") + .detail("DomainId", domainId) + .detail("BaseCipherId", baseCipherId) + .detail("BaseCipherLen", baseCipherLen) + .detail("BaseCipherKCV", baseCipherKCV) + .detail("Salt", salt) + .detail("RefreshAt", refreshAt) + .detail("ExpireAt", expireAt); + + Reference cipherKey = makeReference( + domainId, baseCipherId, baseCipher, baseCipherLen, baseCipherKCV, salt, refreshAt, expireAt); + auto result = keyIdCache.emplace(cacheKey, cipherKey); + ASSERT(result.second); + + (*sizeStat)++; + return cipherKey; +} + +void BlobCipherKeyIdCache::cleanup() { + for (auto& keyItr : keyIdCache) { + keyItr.second->reset(); + } + + keyIdCache.clear(); +} + +std::vector> BlobCipherKeyIdCache::getAllCipherKeys() { + std::vector> cipherKeys; + for (auto& keyItr : keyIdCache) { + cipherKeys.push_back(keyItr.second); + } + return cipherKeys; +} + +// BlobCipherKeyCache class methods + +Reference BlobCipherKeyCache::insertCipherKey(const EncryptCipherDomainId& domainId, + const EncryptCipherBaseKeyId& baseCipherId, + const uint8_t* baseCipher, + const int baseCipherLen, + const EncryptCipherKeyCheckValue baseCipherKCV, + const int64_t refreshAt, + const int64_t expireAt) { + if (domainId == INVALID_ENCRYPT_DOMAIN_ID || baseCipherId == INVALID_ENCRYPT_CIPHER_KEY_ID) { + throw encrypt_invalid_id(); + } + + Reference cipherKey; + + try { + auto domainItr = domainCacheMap.find(domainId); + if (domainItr == domainCacheMap.end()) { + // Add mapping to track new encryption domain + Reference keyIdCache = makeReference(domainId, &size); + cipherKey = keyIdCache->insertBaseCipherKey( + baseCipherId, baseCipher, baseCipherLen, baseCipherKCV, refreshAt, expireAt); + domainCacheMap.emplace(domainId, keyIdCache); + } else { + // Track new baseCipher keys + Reference keyIdCache = domainItr->second; + cipherKey = keyIdCache->insertBaseCipherKey( + baseCipherId, baseCipher, baseCipherLen, baseCipherKCV, refreshAt, expireAt); + } + } catch (Error& e) { + TraceEvent(SevWarn, "BlobCipherInsertCipherKeyFailed") + .detail("BaseCipherKeyId", baseCipherId) + .detail("DomainId", domainId); + throw; + } + return cipherKey; +} + +Reference BlobCipherKeyCache::insertCipherKey(const EncryptCipherDomainId& domainId, + const EncryptCipherBaseKeyId& baseCipherId, + const uint8_t* baseCipher, + const int baseCipherLen, + const EncryptCipherKeyCheckValue baseCipherKCV, + const EncryptCipherRandomSalt& salt, + const int64_t refreshAt, + const int64_t expireAt) { + if (domainId == INVALID_ENCRYPT_DOMAIN_ID || baseCipherId == INVALID_ENCRYPT_CIPHER_KEY_ID || + salt == INVALID_ENCRYPT_RANDOM_SALT) { + throw encrypt_invalid_id(); + } + + Reference cipherKey; + try { + auto domainItr = domainCacheMap.find(domainId); + if (domainItr == domainCacheMap.end()) { + // Add mapping to track new encryption domain + Reference keyIdCache = makeReference(domainId, &size); + cipherKey = keyIdCache->insertBaseCipherKey( + baseCipherId, baseCipher, baseCipherLen, baseCipherKCV, salt, refreshAt, expireAt); + domainCacheMap.emplace(domainId, keyIdCache); + } else { + // Track new baseCipher keys + Reference keyIdCache = domainItr->second; + cipherKey = keyIdCache->insertBaseCipherKey( + baseCipherId, baseCipher, baseCipherLen, baseCipherKCV, salt, refreshAt, expireAt); + } + } catch (Error& e) { + TraceEvent(SevWarn, "BlobCipherInsertCipherKeyFailed") + .detail("BaseCipherKeyId", baseCipherId) + .detail("DomainId", domainId) + .detail("Salt", salt); + throw; + } + return cipherKey; +} + +Reference BlobCipherKeyCache::getLatestCipherKey(const EncryptCipherDomainId& domainId) { + if (domainId == INVALID_ENCRYPT_DOMAIN_ID) { + TraceEvent(SevWarn, "BlobCipherGetLatestCipherKeyInvalidID").detail("DomainId", domainId); + throw encrypt_invalid_id(); + } + auto domainItr = domainCacheMap.find(domainId); + if (domainItr == domainCacheMap.end()) { + TraceEvent(SevInfo, "BlobCipherGetLatestCipherKeyDomainNotFound").detail("DomainId", domainId); + return Reference(); + } + + Reference keyIdCache = domainItr->second; + Reference cipherKey = keyIdCache->getLatestCipherKey(); + + cipherKey.isValid() ? ++BlobCipherMetrics::getInstance()->latestCipherKeyCacheHit + : ++BlobCipherMetrics::getInstance()->latestCipherKeyCacheMiss; + return cipherKey; +} + +Reference BlobCipherKeyCache::getCipherKey(const EncryptCipherDomainId& domainId, + const EncryptCipherBaseKeyId& baseCipherId, + const EncryptCipherRandomSalt& salt) { + auto domainItr = domainCacheMap.find(domainId); + if (domainItr == domainCacheMap.end()) { + return Reference(); + } + + Reference keyIdCache = domainItr->second; + Reference cipherKey = keyIdCache->getCipherByBaseCipherId(baseCipherId, salt); + + cipherKey.isValid() ? ++BlobCipherMetrics::getInstance()->cipherKeyCacheHit + : ++BlobCipherMetrics::getInstance()->cipherKeyCacheMiss; + + return cipherKey; +} + +void BlobCipherKeyCache::resetEncryptDomainId(const EncryptCipherDomainId domainId) { + auto domainItr = domainCacheMap.find(domainId); + if (domainItr == domainCacheMap.end()) { + return; + } + + Reference keyIdCache = domainItr->second; + ASSERT(keyIdCache->getSize() <= size); + size -= keyIdCache->getSize(); + keyIdCache->cleanup(); + TraceEvent(SevInfo, "BlobCipherResetEncryptDomainId").detail("DomainId", domainId); +} + +void BlobCipherKeyCache::cleanup() noexcept { + Reference instance = BlobCipherKeyCache::getInstance(); + + TraceEvent(SevInfo, "BlobCipherKeyCacheCleanup").log(); + + for (auto& domainItr : instance->domainCacheMap) { + Reference keyIdCache = domainItr.second; + keyIdCache->cleanup(); + TraceEvent(SevInfo, "BlobCipherKeyCacheCleanup").detail("DomainId", domainItr.first); + } + + instance->domainCacheMap.clear(); + instance->size = 0; +} + +std::vector> BlobCipherKeyCache::getAllCiphers(const EncryptCipherDomainId& domainId) { + auto domainItr = domainCacheMap.find(domainId); + if (domainItr == domainCacheMap.end()) { + return {}; + } + + Reference keyIdCache = domainItr->second; + return keyIdCache->getAllCipherKeys(); +} + +int getEncryptCurrentAlgoHeaderVersion(const EncryptAuthTokenMode mode, const EncryptAuthTokenAlgo algo) { + if (mode == EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) { + return CLIENT_KNOBS->ENCRYPT_HEADER_AES_CTR_NO_AUTH_VERSION; + } else { + ASSERT_EQ(mode, EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE); + if (algo == ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC) { + return CLIENT_KNOBS->ENCRYPT_HEADER_AES_CTR_AES_CMAC_AUTH_VERSION; + } else { + ASSERT_EQ(algo, ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA); + return CLIENT_KNOBS->ENCRYPT_HEADER_AES_CTR_HMAC_SHA_AUTH_VERSION; + } + } +} + +void BlobCipherDetails::validateCipherDetailsWithCipherKey(Reference cipherKey) { + if (!(baseCipherId == cipherKey->getBaseCipherId() && encryptDomainId == cipherKey->getDomainId() && + salt == cipherKey->getSalt())) { + TraceEvent(SevWarn, "EncryptionHeaderCipherMismatch") + .detail("TextDomainId", cipherKey->getDomainId()) + .detail("ExpectedTextDomainId", encryptDomainId) + .detail("TextBaseCipherId", cipherKey->getBaseCipherId()) + .detail("ExpectedTextBaseCipherId", baseCipherId) + .detail("TextSalt", cipherKey->getSalt()) + .detail("ExpectedTextSalt", salt); + throw encrypt_header_metadata_mismatch(); + } +} + +// EncryptBlobCipherAes265Ctr class methods + +EncryptBlobCipherAes265Ctr::EncryptBlobCipherAes265Ctr(Reference tCipherKey, + Optional> hCipherKeyOpt, + const uint8_t* cipherIV, + const int ivLen, + const EncryptAuthTokenMode mode, + BlobCipherMetrics::UsageType usageType) + : ctx(EVP_CIPHER_CTX_new()), textCipherKey(tCipherKey), headerCipherKeyOpt(hCipherKeyOpt), authTokenMode(mode), + usageType(usageType) { + ASSERT_EQ(ivLen, AES_256_IV_LENGTH); + authTokenAlgo = getAuthTokenAlgoFromMode(authTokenMode); + memcpy(&iv[0], cipherIV, ivLen); + init(); +} + +EncryptBlobCipherAes265Ctr::EncryptBlobCipherAes265Ctr(Reference tCipherKey, + Optional> hCipherKeyOpt, + const uint8_t* cipherIV, + const int ivLen, + const EncryptAuthTokenMode mode, + const EncryptAuthTokenAlgo algo, + BlobCipherMetrics::UsageType usageType) + : ctx(EVP_CIPHER_CTX_new()), textCipherKey(tCipherKey), headerCipherKeyOpt(hCipherKeyOpt), authTokenMode(mode), + authTokenAlgo(algo), usageType(usageType) { + ASSERT_EQ(ivLen, AES_256_IV_LENGTH); + memcpy(&iv[0], cipherIV, ivLen); + init(); +} + +EncryptBlobCipherAes265Ctr::EncryptBlobCipherAes265Ctr(Reference tCipherKey, + Optional> hCipherKeyOpt, + const EncryptAuthTokenMode mode, + BlobCipherMetrics::UsageType usageType) + : ctx(EVP_CIPHER_CTX_new()), textCipherKey(tCipherKey), headerCipherKeyOpt(hCipherKeyOpt), authTokenMode(mode), + usageType(usageType) { + authTokenAlgo = getAuthTokenAlgoFromMode(authTokenMode); + deterministicRandom()->randomBytes(iv, AES_256_IV_LENGTH); + init(); +} + +EncryptBlobCipherAes265Ctr::EncryptBlobCipherAes265Ctr(Reference tCipherKey, + Optional> hCipherKeyOpt, + const EncryptAuthTokenMode mode, + const EncryptAuthTokenAlgo algo, + BlobCipherMetrics::UsageType usageType) + : ctx(EVP_CIPHER_CTX_new()), textCipherKey(tCipherKey), headerCipherKeyOpt(hCipherKeyOpt), authTokenMode(mode), + authTokenAlgo(algo), usageType(usageType) { + deterministicRandom()->randomBytes(iv, AES_256_IV_LENGTH); + init(); +} + +void EncryptBlobCipherAes265Ctr::init() { + ASSERT(textCipherKey.isValid()); + if (FLOW_KNOBS->ENCRYPT_HEADER_AUTH_TOKEN_ENABLED) { + ASSERT(headerCipherKeyOpt.present() && headerCipherKeyOpt.get().isValid()); + } + + if (!isEncryptHeaderAuthTokenDetailsValid(authTokenMode, authTokenAlgo)) { + TraceEvent(SevWarn, "InvalidAuthTokenDetails") + .detail("TokenMode", authTokenMode) + .detail("TokenAlgo", authTokenAlgo); + throw internal_error(); + } + + if (ctx == nullptr) { + throw encrypt_ops_error(); + } + if (EVP_EncryptInit_ex(ctx, EVP_aes_256_ctr(), nullptr, nullptr, nullptr) != 1) { + throw encrypt_ops_error(); + } + if (EVP_EncryptInit_ex(ctx, nullptr, nullptr, textCipherKey.getPtr()->data(), iv) != 1) { + throw encrypt_ops_error(); + } +} + +template +void EncryptBlobCipherAes265Ctr::setCipherAlgoHeaderWithAuthV1(const uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeaderFlagsV1& flags, + BlobCipherEncryptHeaderRef* headerRef) { + ASSERT(headerCipherKeyOpt.present() && headerCipherKeyOpt.get().isValid()); + + // Construct algorithm specific details except 'authToken', serialize the details into 'headerRef' to allow + // authToken generation + AesCtrWithAuthV1 algoHeader( + BlobCipherDetails(textCipherKey->getDomainId(), textCipherKey->getBaseCipherId(), textCipherKey->getSalt()), + textCipherKey->getBaseCipherKCV(), + BlobCipherDetails(headerCipherKeyOpt.get()->getDomainId(), + headerCipherKeyOpt.get()->getBaseCipherId(), + headerCipherKeyOpt.get()->getSalt()), + headerCipherKeyOpt.get()->getBaseCipherKCV(), + iv, + AES_256_IV_LENGTH); + headerRef->algoHeader = AesCtrWithAuth(algoHeader); + // compute the authentication token + Standalone serialized = BlobCipherEncryptHeaderRef::toStringRef(*headerRef); + uint8_t computed[Params::authTokenSize]{ + 0, + }; + computeAuthToken({ { ciphertext, ciphertextLen }, { serialized.begin(), serialized.size() } }, + headerCipherKeyOpt.get()->rawCipher(), + AES_256_KEY_LENGTH, + &computed[0], + (EncryptAuthTokenAlgo)flags.authTokenAlgo, + AUTH_TOKEN_MAX_SIZE); + memcpy(&algoHeader.authToken[0], &computed[0], Params::authTokenSize); + + // Populate headerRef algorithm specific header details + headerRef->algoHeader = algoHeader; +} + +void EncryptBlobCipherAes265Ctr::setCipherAlgoHeaderNoAuthV1(const BlobCipherEncryptHeaderFlagsV1& flags, + BlobCipherEncryptHeaderRef* headerRef) { + ASSERT_EQ(flags.authTokenMode, EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE); + + AesCtrNoAuthV1 aesCtrNoAuth( + BlobCipherDetails(textCipherKey->getDomainId(), textCipherKey->getBaseCipherId(), textCipherKey->getSalt()), + textCipherKey->getBaseCipherKCV(), + iv, + AES_256_IV_LENGTH); + headerRef->algoHeader = AesCtrNoAuth(aesCtrNoAuth); +} + +void EncryptBlobCipherAes265Ctr::setCipherAlgoHeaderV1(const uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeaderFlagsV1& flags, + BlobCipherEncryptHeaderRef* headerRef) { + ASSERT_EQ(1, + getEncryptCurrentAlgoHeaderVersion((EncryptAuthTokenMode)flags.authTokenMode, + (EncryptAuthTokenAlgo)flags.authTokenAlgo)); + + if (flags.authTokenMode == EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) { + setCipherAlgoHeaderNoAuthV1(flags, headerRef); + } else if (flags.authTokenAlgo == ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC) { + setCipherAlgoHeaderWithAuthV1(ciphertext, ciphertextLen, flags, headerRef); + } else { + ASSERT_EQ(flags.authTokenAlgo, ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA); + setCipherAlgoHeaderWithAuthV1(ciphertext, ciphertextLen, flags, headerRef); + } +} + +void EncryptBlobCipherAes265Ctr::updateEncryptHeaderFlagsV1(BlobCipherEncryptHeaderRef* headerRef, + BlobCipherEncryptHeaderFlagsV1* flags) { + + // Populate encryption header flags details + flags->encryptMode = ENCRYPT_CIPHER_MODE_AES_256_CTR; + flags->authTokenMode = authTokenMode; + flags->authTokenAlgo = authTokenAlgo; + headerRef->flags = *flags; +} + +void EncryptBlobCipherAes265Ctr::updateEncryptHeader(const uint8_t* ciphertext, + const int ciphertextLen, + BlobCipherEncryptHeaderRef* headerRef) { + ASSERT_LE(CLIENT_KNOBS->ENCRYPT_HEADER_FLAGS_VERSION, std::numeric_limits::max()); + ASSERT_EQ(1, CLIENT_KNOBS->ENCRYPT_HEADER_FLAGS_VERSION); + + // update header flags + BlobCipherEncryptHeaderFlagsV1 flags; + updateEncryptHeaderFlagsV1(headerRef, &flags); + + // update cipher algo header + int algoHeaderVersion = getEncryptCurrentAlgoHeaderVersion(authTokenMode, authTokenAlgo); + ASSERT_EQ(algoHeaderVersion, 1); + setCipherAlgoHeaderV1(ciphertext, ciphertextLen, flags, headerRef); +} + +void EncryptBlobCipherAes265Ctr::updateEncryptHeader(const uint8_t* ciphertext, + const int ciphertextLen, + BlobCipherEncryptHeader* header) { + // Populate encryption header flags details + header->flags.size = sizeof(BlobCipherEncryptHeader); + header->flags.headerVersion = EncryptBlobCipherAes265Ctr::ENCRYPT_HEADER_VERSION; + header->flags.encryptMode = ENCRYPT_CIPHER_MODE_AES_256_CTR; + header->flags.authTokenMode = authTokenMode; + header->flags.authTokenAlgo = authTokenAlgo; + + // Ensure encryption header authToken details sanity + ASSERT(isEncryptHeaderAuthTokenDetailsValid(authTokenMode, authTokenAlgo)); + + // Populate cipherText encryption-key details + header->cipherTextDetails = textCipherKey->details(); + header->textKCV = textCipherKey->getBaseCipherKCV(); + // Populate header encryption-key details + if (authTokenMode != ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) { + header->cipherHeaderDetails = headerCipherKeyOpt.get()->details(); + header->headerKCV = headerCipherKeyOpt.get()->getBaseCipherKCV(); + } else { + header->cipherHeaderDetails = BlobCipherDetails(); + header->headerKCV = 0; + ASSERT_EQ(INVALID_ENCRYPT_DOMAIN_ID, header->cipherHeaderDetails.encryptDomainId); + ASSERT_EQ(INVALID_ENCRYPT_CIPHER_KEY_ID, header->cipherHeaderDetails.baseCipherId); + ASSERT_EQ(INVALID_ENCRYPT_RANDOM_SALT, header->cipherHeaderDetails.salt); + } + + memcpy(&header->iv[0], &iv[0], AES_256_IV_LENGTH); + + if (authTokenMode == EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) { + // No header 'authToken' generation needed. + } else { + + // Populate header authToken details + ASSERT_EQ(header->flags.authTokenMode, EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE); + + computeAuthToken({ { ciphertext, ciphertextLen }, + { reinterpret_cast(header), sizeof(BlobCipherEncryptHeader) } }, + headerCipherKeyOpt.get()->rawCipher(), + AES_256_KEY_LENGTH, + &header->singleAuthToken.authToken[0], + (EncryptAuthTokenAlgo)header->flags.authTokenAlgo, + AUTH_TOKEN_MAX_SIZE); + } +} + +StringRef EncryptBlobCipherAes265Ctr::encrypt(const uint8_t* plaintext, + const int plaintextLen, + BlobCipherEncryptHeaderRef* headerRef, + Arena& arena) { + double startTime = 0.0; + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + startTime = timer_monotonic(); + } + + const int allocSize = plaintextLen + AES_BLOCK_SIZE; + StringRef encryptBuf = makeString(allocSize, arena); + uint8_t* ciphertext = mutateString(encryptBuf); + + int bytes{ 0 }; + if (EVP_EncryptUpdate(ctx, ciphertext, &bytes, plaintext, plaintextLen) != 1) { + TraceEvent(SevWarn, "BlobCipherEncryptUpdateFailed") + .detail("BaseCipherId", textCipherKey->getBaseCipherId()) + .detail("EncryptDomainId", textCipherKey->getDomainId()); + throw encrypt_ops_error(); + } + + int finalBytes{ 0 }; + if (EVP_EncryptFinal_ex(ctx, ciphertext + bytes, &finalBytes) != 1) { + TraceEvent(SevWarn, "BlobCipherEncryptFinalFailed") + .detail("BaseCipherId", textCipherKey->getBaseCipherId()) + .detail("EncryptDomainId", textCipherKey->getDomainId()); + throw encrypt_ops_error(); + } + if ((bytes + finalBytes) != plaintextLen) { + TraceEvent(SevWarn, "BlobCipherEncryptUnexpectedCipherLen") + .detail("PlaintextLen", plaintextLen) + .detail("EncryptedBufLen", bytes + finalBytes); + throw encrypt_ops_error(); + } + + // Ensure encryption header authToken details sanity + ASSERT(isEncryptHeaderAuthTokenDetailsValid(authTokenMode, authTokenAlgo)); + updateEncryptHeader(ciphertext, plaintextLen, headerRef); + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + BlobCipherMetrics::counters(usageType).encryptCPUTimeNS += int64_t((timer_monotonic() - startTime) * 1e9); + } + + CODE_PROBE(authTokenMode == EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE, + "ConfigurableEncryption: Encryption with Auth token generation disabled"); + CODE_PROBE(authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA, + "ConfigurableEncryption: Encryption with HMAC_SHA Auth token generation"); + CODE_PROBE(authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC, + "ConfigurableEncryption: Encryption with AES_CMAC Auth token generation"); + + // discard the extra buffer allocated to account for AES_BLOCK_SIZE encryption assist + return encryptBuf.substr(0, plaintextLen); +} + +void EncryptBlobCipherAes265Ctr::encryptInplace(uint8_t* plaintext, + const int plaintextLen, + BlobCipherEncryptHeaderRef* headerRef) { + double startTime = 0.0; + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + startTime = timer_monotonic(); + } + + int bytes{ 0 }; + if (EVP_EncryptUpdate(ctx, plaintext, &bytes, plaintext, plaintextLen) != 1) { + TraceEvent(SevWarn, "BlobCipherInplaceEncryptUpdateFailed") + .detail("BaseCipherId", textCipherKey->getBaseCipherId()) + .detail("EncryptDomainId", textCipherKey->getDomainId()); + throw encrypt_ops_error(); + } + + // Padding should be 0 for AES CTR mode, so encryptUpdate() should encrypt all the data + if (bytes != plaintextLen) { + TraceEvent(SevWarn, "BlobCipherInplaceEncryptUnexpectedCipherLen") + .detail("PlaintextLen", plaintextLen) + .detail("EncryptedBufLen", bytes); + throw encrypt_ops_error(); + } + + if (EVP_CIPHER_CTX_reset(ctx) != 1) { + TraceEvent(SevWarn, "BlobCipherInplaceEncryptCTXResetFailed") + .detail("BaseCipherId", textCipherKey->getBaseCipherId()) + .detail("EncryptDomainId", textCipherKey->getDomainId()); + throw encrypt_ops_error(); + } + + // Ensure encryption header authToken details sanity + ASSERT(isEncryptHeaderAuthTokenDetailsValid(authTokenMode, authTokenAlgo)); + updateEncryptHeader(plaintext, plaintextLen, headerRef); + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + BlobCipherMetrics::counters(usageType).encryptCPUTimeNS += int64_t((timer_monotonic() - startTime) * 1e9); + } + + CODE_PROBE(authTokenMode == EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE, + "encryptInplace: ConfigurableEncryption: Encryption with Auth token generation disabled"); + CODE_PROBE(authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA, + "encryptInplace: ConfigurableEncryption: Encryption with HMAC_SHA Auth token generation"); + CODE_PROBE(authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC, + "encryptInplace: ConfigurableEncryption: Encryption with AES_CMAC Auth token generation"); +} + +Reference EncryptBlobCipherAes265Ctr::encrypt(const uint8_t* plaintext, + const int plaintextLen, + BlobCipherEncryptHeader* header, + Arena& arena) { + double startTime = 0.0; + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + startTime = timer_monotonic(); + } + + memset(reinterpret_cast(header), 0, sizeof(BlobCipherEncryptHeader)); + + // Alloc buffer computation accounts for 'header authentication' generation scheme. If single-auth-token needs + // to be generated, allocate buffer sufficient to append header to the cipherText optimizing memcpy cost. + + const int allocSize = plaintextLen + AES_BLOCK_SIZE; + Reference encryptBuf = makeReference(allocSize, arena); + uint8_t* ciphertext = encryptBuf->begin(); + + int bytes{ 0 }; + if (EVP_EncryptUpdate(ctx, ciphertext, &bytes, plaintext, plaintextLen) != 1) { + TraceEvent(SevWarn, "BlobCipherEncryptUpdateFailed") + .detail("BaseCipherId", textCipherKey->getBaseCipherId()) + .detail("EncryptDomainId", textCipherKey->getDomainId()); + throw encrypt_ops_error(); + } + + int finalBytes{ 0 }; + if (EVP_EncryptFinal_ex(ctx, ciphertext + bytes, &finalBytes) != 1) { + TraceEvent(SevWarn, "BlobCipherEncryptFinalFailed") + .detail("BaseCipherId", textCipherKey->getBaseCipherId()) + .detail("EncryptDomainId", textCipherKey->getDomainId()); + throw encrypt_ops_error(); + } + + if ((bytes + finalBytes) != plaintextLen) { + TraceEvent(SevWarn, "BlobCipherEncryptUnexpectedCipherLen") + .detail("PlaintextLen", plaintextLen) + .detail("EncryptedBufLen", bytes + finalBytes); + throw encrypt_ops_error(); + } + + updateEncryptHeader(ciphertext, plaintextLen, header); + + encryptBuf->setLogicalSize(plaintextLen); + + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + BlobCipherMetrics::counters(usageType).encryptCPUTimeNS += int64_t((timer_monotonic() - startTime) * 1e9); + } + + CODE_PROBE(true, "BlobCipher data encryption"); + CODE_PROBE(header->flags.authTokenAlgo == EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE, + "Encryption authentication disabled"); + CODE_PROBE(header->flags.authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA, + "HMAC_SHA Auth token generation"); + CODE_PROBE(header->flags.authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC, + "AES_CMAC Auth token generation"); + + return encryptBuf; +} + +void EncryptBlobCipherAes265Ctr::encryptInplace(uint8_t* plaintext, + const int plaintextLen, + BlobCipherEncryptHeader* header) { + double startTime = 0.0; + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + startTime = timer_monotonic(); + } + + memset(reinterpret_cast(header), 0, sizeof(BlobCipherEncryptHeader)); + + int bytes{ 0 }; + if (EVP_EncryptUpdate(ctx, plaintext, &bytes, plaintext, plaintextLen) != 1) { + TraceEvent(SevWarn, "BlobCipherInplaceEncryptUpdateFailed") + .detail("BaseCipherId", textCipherKey->getBaseCipherId()) + .detail("EncryptDomainId", textCipherKey->getDomainId()); + throw encrypt_ops_error(); + } + + // Padding should be 0 for AES CTR mode, so encryptUpdate() should encrypt all the data + if (bytes != plaintextLen) { + TraceEvent(SevWarn, "BlobCipherInplaceEncryptUnexpectedCipherLen") + .detail("PlaintextLen", plaintextLen) + .detail("EncryptedBufLen", bytes); + throw encrypt_ops_error(); + } + + if (EVP_CIPHER_CTX_reset(ctx) != 1) { + TraceEvent(SevWarn, "BlobCipherInplaceEncryptCTXResetFailed") + .detail("BaseCipherId", textCipherKey->getBaseCipherId()) + .detail("EncryptDomainId", textCipherKey->getDomainId()); + throw encrypt_ops_error(); + } + + updateEncryptHeader(plaintext, plaintextLen, header); + + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + BlobCipherMetrics::counters(usageType).encryptCPUTimeNS += int64_t((timer_monotonic() - startTime) * 1e9); + } + + CODE_PROBE(true, "encryptInplace: BlobCipher data encryption"); + CODE_PROBE(header->flags.authTokenAlgo == EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE, + "encryptInplace: Encryption authentication disabled"); + CODE_PROBE(header->flags.authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA, + "encryptInplace: HMAC_SHA Auth token generation"); + CODE_PROBE(header->flags.authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC, + "encryptInplace: AES_CMAC Auth token generation"); +} + +EncryptBlobCipherAes265Ctr::~EncryptBlobCipherAes265Ctr() { + if (ctx != nullptr) { + EVP_CIPHER_CTX_free(ctx); + } +} + +// DecryptBlobCipherAes256Ctr class methods + +DecryptBlobCipherAes256Ctr::DecryptBlobCipherAes256Ctr(Reference tCipherKey, + Optional> hCipherKeyOpt, + const uint8_t* iv, + BlobCipherMetrics::UsageType usageType) + : ctx(EVP_CIPHER_CTX_new()), usageType(usageType), textCipherKey(tCipherKey), headerCipherKeyOpt(hCipherKeyOpt), + authTokensValidationDone(false) { + if (ctx == nullptr) { + throw encrypt_ops_error(); + } + if (!EVP_DecryptInit_ex(ctx, EVP_aes_256_ctr(), nullptr, nullptr, nullptr)) { + throw encrypt_ops_error(); + } + if (!EVP_DecryptInit_ex(ctx, nullptr, nullptr, tCipherKey.getPtr()->data(), iv)) { + throw encrypt_ops_error(); + } +} + +template +void DecryptBlobCipherAes256Ctr::validateAuthTokenV1(const uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeaderFlagsV1& flags, + const BlobCipherEncryptHeaderRef& headerRef) { + ASSERT_EQ(flags.encryptMode, ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE); + ASSERT_LE(Params::authTokenSize, AUTH_TOKEN_MAX_SIZE); + ASSERT(headerCipherKeyOpt.present() && headerCipherKeyOpt.get().isValid()); + + Arena tmpArena; + uint8_t persisted[Params::authTokenSize]; + uint8_t computed[Params::authTokenSize]{ + 0, + }; + + // prepare the payload {cipherText + encryptionHeader} + // ensure the 'authToken' is reset before computing the 'authentication token' + BlobCipherEncryptHeaderRef headerRefCopy = BlobCipherEncryptHeaderRef(headerRef); + + AesCtrWithAuth algoHeaderCopy = std::get>(headerRefCopy.algoHeader); + // preserve the 'persisted' token for future validation before reseting the field + memcpy(&persisted[0], &algoHeaderCopy.v1.authToken[0], Params::authTokenSize); + memset(&algoHeaderCopy.v1.authToken[0], 0, Params::authTokenSize); + + headerRefCopy.algoHeader = algoHeaderCopy; + Standalone serializedHeader = BlobCipherEncryptHeaderRef::toStringRef(headerRefCopy); + computeAuthToken({ { ciphertext, ciphertextLen }, { serializedHeader.begin(), serializedHeader.size() } }, + headerCipherKeyOpt.get()->rawCipher(), + AES_256_KEY_LENGTH, + &computed[0], + (EncryptAuthTokenAlgo)flags.authTokenAlgo, + AUTH_TOKEN_MAX_SIZE); + + if (memcmp(&persisted[0], &computed[0], Params::authTokenSize) != 0) { + TraceEvent(SevWarn, "BlobCipherVerifyEncryptBlobHeaderAuthTokenMismatch") + .detail("HeaderFlagsVersion", headerRef.flagsVersion()) + .detail("HeaderMode", flags.encryptMode) + .detail("SingleAuthToken", StringRef(tmpArena, persisted, Params::authTokenSize)) + .detail("ComputedSingleAuthToken", StringRef(tmpArena, computed, Params::authTokenSize)); + + CODE_PROBE(flags.authTokenAlgo == ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA, + "ConfigurableEncryption: AuthToken value mismatch - HMAC_SHA auth token generation"); + CODE_PROBE(flags.authTokenAlgo == ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC, + "ConfigurableEncryption: AuthToken value mismatch - AES_CMAC auth token generation"); + + throw encrypt_header_authtoken_mismatch(); + } +} + +void DecryptBlobCipherAes256Ctr::validateHeaderSingleAuthTokenV1(const uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeaderFlagsV1& flags, + const BlobCipherEncryptHeaderRef& headerRef) { + // prepare the payload {cipherText + encryptionHeader} + // ensure the 'authToken' is reset before computing the 'authentication token' + + if (flags.authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC) { + validateAuthTokenV1(ciphertext, ciphertextLen, flags, headerRef); + } else { + ASSERT_EQ(flags.authTokenAlgo, EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA); + validateAuthTokenV1(ciphertext, ciphertextLen, flags, headerRef); + } +} + +void DecryptBlobCipherAes256Ctr::validateAuthTokensV1(const uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeaderFlagsV1& flags, + const BlobCipherEncryptHeaderRef& headerRef) { + if (flags.authTokenMode == EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) { + // No embedded 'authToken'; do nothing + return; + } + + ASSERT_EQ(flags.authTokenMode, EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE); + validateHeaderSingleAuthTokenV1(ciphertext, ciphertextLen, flags, headerRef); + authTokensValidationDone = true; +} + +void DecryptBlobCipherAes256Ctr::validateEncryptHeaderFlagsV1(const uint32_t headerVersion, + const BlobCipherEncryptHeaderFlagsV1& flags) { + // validate header flag sanity + if (flags.encryptMode != EncryptCipherMode::ENCRYPT_CIPHER_MODE_AES_256_CTR || + !isEncryptHeaderAuthTokenModeValid((EncryptAuthTokenMode)flags.authTokenMode)) { + TraceEvent(SevWarn, "BlobCipherVerifyEncryptBlobHeader") + .detail("HeaderVersion", headerVersion) + .detail("ExpectedVersion", CLIENT_KNOBS->ENCRYPT_HEADER_FLAGS_VERSION) + .detail("EncryptCipherMode", flags.encryptMode) + .detail("ExpectedCipherMode", EncryptCipherMode::ENCRYPT_CIPHER_MODE_AES_256_CTR) + .detail("EncryptHeaderAuthTokenMode", flags.authTokenMode); + + CODE_PROBE(true, "ConfigurableEncryption: Encryption header metadata mismatch"); + + throw encrypt_header_metadata_mismatch(); + } +} + +void DecryptBlobCipherAes256Ctr::vaidateEncryptHeaderCipherKCVs(const BlobCipherEncryptHeaderRef& headerRef, + const BlobCipherEncryptHeaderFlagsV1& flags) { + const EncryptHeaderCipherKCVs kcvs = headerRef.getKCVs(); + Sha256KCV::checkEqual(textCipherKey, kcvs.textKCV); + if (flags.authTokenMode != ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) { + if (!kcvs.headerKCV.present()) { + TraceEvent(SevWarnAlways, "MissingHeaderKCV"); + throw encrypt_key_check_value_mismatch(); + } + Sha256KCV::checkEqual(headerCipherKeyOpt.get(), kcvs.headerKCV.get()); + } +} + +void DecryptBlobCipherAes256Ctr::validateEncryptHeader(const uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeaderRef& headerRef, + EncryptAuthTokenMode* authTokenMode, + EncryptAuthTokenAlgo* authTokenAlgo) { + // FlagsVersion is computed based on std::variant available index + ASSERT_EQ(headerRef.flagsVersion(), 1); + + BlobCipherEncryptHeaderFlagsV1 flags = std::get(headerRef.flags); + validateEncryptHeaderFlagsV1(headerRef.flagsVersion(), flags); + vaidateEncryptHeaderCipherKCVs(headerRef, flags); + validateAuthTokensV1(ciphertext, ciphertextLen, flags, headerRef); + + *authTokenMode = (EncryptAuthTokenMode)flags.authTokenMode; + *authTokenAlgo = (EncryptAuthTokenAlgo)flags.authTokenAlgo; +} + +StringRef DecryptBlobCipherAes256Ctr::decrypt(const uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeaderRef& headerRef, + Arena& arena) { + double startTime = 0.0; + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + startTime = timer_monotonic(); + } + + EncryptAuthTokenMode authTokenMode; + EncryptAuthTokenAlgo authTokenAlgo; + validateEncryptHeader(ciphertext, ciphertextLen, headerRef, &authTokenMode, &authTokenAlgo); + + const int allocSize = ciphertextLen + AES_BLOCK_SIZE; + StringRef decrypted = makeString(allocSize, arena); + + uint8_t* plaintext = mutateString(decrypted); + int bytesDecrypted{ 0 }; + if (!EVP_DecryptUpdate(ctx, plaintext, &bytesDecrypted, ciphertext, ciphertextLen)) { + TraceEvent(SevWarn, "BlobCipherDecryptUpdateFailed") + .detail("BaseCipherId", textCipherKey->getBaseCipherId()) + .detail("EncryptDomainId", textCipherKey->getDomainId()); + throw encrypt_ops_error(); + } + + int finalBlobBytes{ 0 }; + if (EVP_DecryptFinal_ex(ctx, plaintext + bytesDecrypted, &finalBlobBytes) <= 0) { + TraceEvent(SevWarn, "BlobCipherDecryptFinalFailed") + .detail("BaseCipherId", textCipherKey->getBaseCipherId()) + .detail("EncryptDomainId", textCipherKey->getDomainId()); + throw encrypt_ops_error(); + } + + if ((bytesDecrypted + finalBlobBytes) != ciphertextLen) { + TraceEvent(SevWarn, "BlobCipherEncryptUnexpectedPlaintextLen") + .detail("CiphertextLen", ciphertextLen) + .detail("DecryptedBufLen", bytesDecrypted + finalBlobBytes); + throw encrypt_ops_error(); + } + + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + BlobCipherMetrics::counters(usageType).decryptCPUTimeNS += int64_t((timer_monotonic() - startTime) * 1e9); + } + + CODE_PROBE(authTokenMode == EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE, + "ConfigurableEncryption: Decryption with Auth token generation disabled"); + CODE_PROBE(authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA, + "ConfigurableEncryption: Decryption with HMAC_SHA Auth token generation"); + CODE_PROBE(authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC, + "ConfigurableEncryption: Decryption with AES_CMAC Auth token generation"); + + // discard the extra buffer allocated to account AES_BLOCK_SIZE decryption assist + return decrypted.substr(0, ciphertextLen); +} + +void DecryptBlobCipherAes256Ctr::verifyHeaderSingleAuthToken(const uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeader& header) { + ASSERT(headerCipherKeyOpt.present() && headerCipherKeyOpt.get().isValid()); + // prepare the payload {cipherText + encryptionHeader} + // ensure the 'authToken' is reset before computing the 'authentication token' + BlobCipherEncryptHeader headerCopy; + memcpy(reinterpret_cast(&headerCopy), + reinterpret_cast(&header), + sizeof(BlobCipherEncryptHeader)); + memset(reinterpret_cast(&headerCopy.singleAuthToken), 0, AUTH_TOKEN_MAX_SIZE); + uint8_t computed[AUTH_TOKEN_MAX_SIZE]{ + 0, + }; + computeAuthToken({ { ciphertext, ciphertextLen }, + { reinterpret_cast(&headerCopy), sizeof(BlobCipherEncryptHeader) } }, + headerCipherKeyOpt.get()->rawCipher(), + AES_256_KEY_LENGTH, + &computed[0], + (EncryptAuthTokenAlgo)header.flags.authTokenAlgo, + AUTH_TOKEN_MAX_SIZE); + + int authTokenSize = getEncryptHeaderAuthTokenSize(header.flags.authTokenAlgo); + ASSERT_LE(authTokenSize, AUTH_TOKEN_MAX_SIZE); + if (memcmp(&header.singleAuthToken.authToken[0], &computed[0], authTokenSize) != 0) { + TraceEvent(SevWarn, "BlobCipherVerifyEncryptBlobHeaderAuthTokenMismatch") + .detail("HeaderVersion", header.flags.headerVersion) + .detail("HeaderMode", header.flags.encryptMode) + .detail("SingleAuthToken", StringRef(&header.singleAuthToken.authToken[0], AUTH_TOKEN_MAX_SIZE).toString()) + .detail("ComputedSingleAuthToken", StringRef(computed, AUTH_TOKEN_MAX_SIZE)); + + CODE_PROBE(header.flags.authTokenAlgo == ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA, + "AuthToken size mismatch - HMAC_SHA auth token generation"); + CODE_PROBE(header.flags.authTokenAlgo == ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC, + "AuthToken size mismatch - AES_CMAC auth token generation"); + + throw encrypt_header_authtoken_mismatch(); + } +} + +void DecryptBlobCipherAes256Ctr::verifyAuthTokens(const uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeader& header) { + ASSERT_EQ(header.flags.authTokenMode, EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE); + verifyHeaderSingleAuthToken(ciphertext, ciphertextLen, header); + + authTokensValidationDone = true; +} + +void DecryptBlobCipherAes256Ctr::verifyEncryptHeaderMetadata(const BlobCipherEncryptHeader& header) { + // validate header flag sanity + if (header.flags.headerVersion != EncryptBlobCipherAes265Ctr::ENCRYPT_HEADER_VERSION || + header.flags.encryptMode != EncryptCipherMode::ENCRYPT_CIPHER_MODE_AES_256_CTR || + !isEncryptHeaderAuthTokenModeValid((EncryptAuthTokenMode)header.flags.authTokenMode)) { + TraceEvent(SevWarn, "BlobCipherVerifyEncryptBlobHeader") + .detail("HeaderVersion", header.flags.headerVersion) + .detail("ExpectedVersion", EncryptBlobCipherAes265Ctr::ENCRYPT_HEADER_VERSION) + .detail("EncryptCipherMode", header.flags.encryptMode) + .detail("ExpectedCipherMode", EncryptCipherMode::ENCRYPT_CIPHER_MODE_AES_256_CTR) + .detail("EncryptHeaderAuthTokenMode", header.flags.authTokenMode); + + CODE_PROBE(true, "Encryption header metadata mismatch"); + + throw encrypt_header_metadata_mismatch(); + } + + Sha256KCV::checkEqual(textCipherKey, header.textKCV); + if (header.flags.authTokenMode != ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) { + Sha256KCV::checkEqual(headerCipherKeyOpt.get(), header.headerKCV); + } +} + +Reference DecryptBlobCipherAes256Ctr::decrypt(const uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeader& header, + Arena& arena) { + double startTime = 0.0; + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + startTime = timer_monotonic(); + } + + verifyEncryptHeaderMetadata(header); + + if (header.flags.authTokenMode != EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE && + (!headerCipherKeyOpt.present() || !headerCipherKeyOpt.get().isValid())) { + TraceEvent(SevWarn, "BlobCipherDecryptInvalidHeaderCipherKey") + .detail("AuthTokenMode", header.flags.authTokenMode); + throw encrypt_ops_error(); + } + + const int allocSize = ciphertextLen + AES_BLOCK_SIZE; + Reference decrypted = makeReference(allocSize, arena); + + if (header.flags.authTokenMode != EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) { + verifyAuthTokens(ciphertext, ciphertextLen, header); + ASSERT(authTokensValidationDone); + } + + uint8_t* plaintext = decrypted->begin(); + int bytesDecrypted{ 0 }; + if (!EVP_DecryptUpdate(ctx, plaintext, &bytesDecrypted, ciphertext, ciphertextLen)) { + TraceEvent(SevWarn, "BlobCipherDecryptUpdateFailed") + .detail("BaseCipherId", header.cipherTextDetails.baseCipherId) + .detail("EncryptDomainId", header.cipherTextDetails.encryptDomainId); + throw encrypt_ops_error(); + } + + int finalBlobBytes{ 0 }; + if (EVP_DecryptFinal_ex(ctx, plaintext + bytesDecrypted, &finalBlobBytes) <= 0) { + TraceEvent(SevWarn, "BlobCipherDecryptFinalFailed") + .detail("BaseCipherId", header.cipherTextDetails.baseCipherId) + .detail("EncryptDomainId", header.cipherTextDetails.encryptDomainId); + throw encrypt_ops_error(); + } + + if ((bytesDecrypted + finalBlobBytes) != ciphertextLen) { + TraceEvent(SevWarn, "BlobCipherEncryptUnexpectedPlaintextLen") + .detail("CiphertextLen", ciphertextLen) + .detail("DecryptedBufLen", bytesDecrypted + finalBlobBytes); + throw encrypt_ops_error(); + } + + decrypted->setLogicalSize(ciphertextLen); + + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + BlobCipherMetrics::counters(usageType).decryptCPUTimeNS += int64_t((timer_monotonic() - startTime) * 1e9); + } + + CODE_PROBE(true, "BlobCipher data decryption"); + CODE_PROBE(header.flags.authTokenAlgo == EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE, + "Decryption authentication disabled"); + CODE_PROBE(header.flags.authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA, + "Decryption HMAC_SHA Auth token verification"); + CODE_PROBE(header.flags.authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC, + "Decryption AES_CMAC Auth token verification"); + + return decrypted; +} + +void DecryptBlobCipherAes256Ctr::decryptInplace(uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeader& header) { + double startTime = 0.0; + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + startTime = timer_monotonic(); + } + + verifyEncryptHeaderMetadata(header); + + if (header.flags.authTokenMode != EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE && + (!headerCipherKeyOpt.present() || !headerCipherKeyOpt.get().isValid())) { + TraceEvent(SevWarn, "BlobCipherDecryptInvalidHeaderCipherKey") + .detail("AuthTokenMode", header.flags.authTokenMode); + throw encrypt_ops_error(); + } + + if (header.flags.authTokenMode != EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) { + verifyAuthTokens(ciphertext, ciphertextLen, header); + ASSERT(authTokensValidationDone); + } + + int bytesDecrypted{ 0 }; + if (!EVP_DecryptUpdate(ctx, ciphertext, &bytesDecrypted, ciphertext, ciphertextLen)) { + TraceEvent(SevWarn, "BlobCipherDecryptUpdateFailed") + .detail("BaseCipherId", header.cipherTextDetails.baseCipherId) + .detail("EncryptDomainId", header.cipherTextDetails.encryptDomainId); + throw encrypt_ops_error(); + } + + // Padding should be 0 for AES CTR mode, so DecryptUpdate() should decrypt all the data + if (bytesDecrypted != ciphertextLen) { + TraceEvent(SevWarn, "BlobCipherEncryptUnexpectedPlaintextLen") + .detail("CiphertextLen", ciphertextLen) + .detail("DecryptedBufLen", bytesDecrypted); + throw encrypt_ops_error(); + } + + if (EVP_CIPHER_CTX_reset(ctx) != 1) { + TraceEvent(SevWarn, "BlobCipherDecryptCTXResetFailed") + .detail("BaseCipherId", textCipherKey->getBaseCipherId()) + .detail("EncryptDomainId", textCipherKey->getDomainId()); + throw encrypt_ops_error(); + } + + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + BlobCipherMetrics::counters(usageType).decryptCPUTimeNS += int64_t((timer_monotonic() - startTime) * 1e9); + } + + CODE_PROBE(true, "decryptInplace: BlobCipher data decryption"); + CODE_PROBE(header.flags.authTokenAlgo == EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE, + "decryptInplace: Decryption authentication disabled"); + CODE_PROBE(header.flags.authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA, + "decryptInplace: Decryption HMAC_SHA Auth token verification"); + CODE_PROBE(header.flags.authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC, + "decryptInplace: Decryption AES_CMAC Auth token verification"); +} + +void DecryptBlobCipherAes256Ctr::decryptInplace(uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeaderRef& headerRef) { + double startTime = 0.0; + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + startTime = timer_monotonic(); + } + + EncryptAuthTokenMode authTokenMode; + EncryptAuthTokenAlgo authTokenAlgo; + validateEncryptHeader(ciphertext, ciphertextLen, headerRef, &authTokenMode, &authTokenAlgo); + + int bytesDecrypted{ 0 }; + if (!EVP_DecryptUpdate(ctx, ciphertext, &bytesDecrypted, ciphertext, ciphertextLen)) { + TraceEvent(SevWarn, "BlobCipherDecryptUpdateFailed") + .detail("BaseCipherId", textCipherKey->getBaseCipherId()) + .detail("EncryptDomainId", textCipherKey->getDomainId()); + throw encrypt_ops_error(); + } + + // Padding should be 0 for AES CTR mode, so DecryptUpdate() should decrypt all the data + if (bytesDecrypted != ciphertextLen) { + TraceEvent(SevWarn, "BlobCipherEncryptUnexpectedPlaintextLen") + .detail("CiphertextLen", ciphertextLen) + .detail("DecryptedBufLen", bytesDecrypted); + throw encrypt_ops_error(); + } + + if (EVP_CIPHER_CTX_reset(ctx) != 1) { + TraceEvent(SevWarn, "BlobCipherDecryptCTXResetFailed") + .detail("BaseCipherId", textCipherKey->getBaseCipherId()) + .detail("EncryptDomainId", textCipherKey->getDomainId()); + throw encrypt_ops_error(); + } + + if (CLIENT_KNOBS->ENABLE_ENCRYPTION_CPU_TIME_LOGGING) { + BlobCipherMetrics::counters(usageType).decryptCPUTimeNS += int64_t((timer_monotonic() - startTime) * 1e9); + } + + CODE_PROBE(authTokenMode == EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE, + "decryptInplace: ConfigurableEncryption: Decryption with Auth token generation disabled"); + CODE_PROBE(authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA, + "decryptInplace: ConfigurableEncryption: Decryption with HMAC_SHA Auth token generation"); + CODE_PROBE(authTokenAlgo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC, + "decryptInplace: ConfigurableEncryption: Decryption with AES_CMAC Auth token generation"); +} + +DecryptBlobCipherAes256Ctr::~DecryptBlobCipherAes256Ctr() { + if (ctx != nullptr) { + EVP_CIPHER_CTX_free(ctx); + } +} + +// HmacSha256DigestGen class methods + +HmacSha256DigestGen::HmacSha256DigestGen(const unsigned char* key, size_t len) : ctx(HMAC_CTX_new()) { + if (!HMAC_Init_ex(ctx, key, len, EVP_sha256(), nullptr)) { + throw encrypt_ops_error(); + } +} + +HmacSha256DigestGen::~HmacSha256DigestGen() { + if (ctx != nullptr) { + HMAC_CTX_free(ctx); + } +} + +unsigned int HmacSha256DigestGen::digest(const std::vector>& payload, + unsigned char* buf, + unsigned int bufLen) { + ASSERT_EQ(bufLen, HMAC_size(ctx)); + + for (const auto& p : payload) { + if (HMAC_Update(ctx, p.first, p.second) != 1) { + throw encrypt_ops_error(); + } + } + + unsigned int digestLen = 0; + if (HMAC_Final(ctx, buf, &digestLen) != 1) { + throw encrypt_ops_error(); + } + + CODE_PROBE(true, "HMAC_SHA Digest generation"); + + return digestLen; +} + +// Aes256CtrCmacDigestGen methods +Aes256CmacDigestGen::Aes256CmacDigestGen(const unsigned char* key, size_t keylen) : ctx(CMAC_CTX_new()) { + ASSERT_EQ(keylen, AES_256_KEY_LENGTH); + + if (ctx == nullptr) { + throw encrypt_ops_error(); + } + if (!CMAC_Init(ctx, key, keylen, EVP_aes_256_cbc(), NULL)) { + throw encrypt_ops_error(); + } +} + +size_t Aes256CmacDigestGen::digest(const std::vector>& payload, + uint8_t* digest, + int digestlen) { + ASSERT(ctx != nullptr); + ASSERT_GE(digestlen, AUTH_TOKEN_AES_CMAC_SIZE); + + for (const auto& p : payload) { + if (!CMAC_Update(ctx, p.first, p.second)) { + throw encrypt_ops_error(); + } + } + size_t ret; + if (!CMAC_Final(ctx, digest, &ret)) { + throw encrypt_ops_error(); + } + + return ret; +} + +Aes256CmacDigestGen::~Aes256CmacDigestGen() { + if (ctx != nullptr) { + CMAC_CTX_free(ctx); + } +} + +void computeAuthToken(const std::vector>& payload, + const uint8_t* key, + const int keyLen, + unsigned char* digestBuf, + const EncryptAuthTokenAlgo algo, + unsigned int digestBufMaxSz) { + ASSERT_EQ(digestBufMaxSz, AUTH_TOKEN_MAX_SIZE); + ASSERT_EQ(keyLen, AES_256_KEY_LENGTH); + ASSERT(isEncryptHeaderAuthTokenAlgoValid(algo)); + + int authTokenSz = getEncryptHeaderAuthTokenSize(algo); + ASSERT_LE(authTokenSz, AUTH_TOKEN_MAX_SIZE); + + if (algo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA) { + ASSERT_EQ(authTokenSz, AUTH_TOKEN_HMAC_SHA_SIZE); + + HmacSha256DigestGen hmacGenerator(key, keyLen); + unsigned int digestLen = hmacGenerator.digest(payload, digestBuf, authTokenSz); + + ASSERT_EQ(digestLen, authTokenSz); + } else if (algo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC) { + ASSERT_EQ(authTokenSz, AUTH_TOKEN_AES_CMAC_SIZE); + + Aes256CmacDigestGen cmacGenerator(key, keyLen); + size_t digestLen = cmacGenerator.digest(payload, digestBuf, authTokenSz); + + ASSERT_EQ(digestLen, authTokenSz); + } else { + throw not_implemented(); + } +} + +EncryptAuthTokenMode getEncryptAuthTokenMode(const EncryptAuthTokenMode mode) { + // Override mode if authToken isn't enabled + return FLOW_KNOBS->ENCRYPT_HEADER_AUTH_TOKEN_ENABLED ? mode + : EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE; +} + +Sha256KCV::Sha256KCV() : ctx(EVP_MD_CTX_new()) { + if (ctx == nullptr) { + TraceEvent(SevError, "ComputeSha256AllocFailed"); + throw encrypt_ops_error(); + } +} + +Sha256KCV::~Sha256KCV() { + if (ctx != nullptr) { + EVP_MD_CTX_free(ctx); + } +} + +EncryptCipherKeyCheckValue Sha256KCV::computeKCV(const uint8_t* cipher, const int len) { + if (!EVP_DigestInit_ex(ctx, EVP_sha256(), NULL)) { + TraceEvent(SevWarnAlways, "ComputeSha256DigestInitFailed"); + throw encrypt_ops_error(); + } + + if (!EVP_DigestUpdate(ctx, cipher, len)) { + TraceEvent(SevWarnAlways, "ComputeSha256DigestUpdateFailed"); + throw encrypt_ops_error(); + } + + unsigned char sha256[EVP_MAX_MD_SIZE]; + unsigned int sha256Len; + if (!EVP_DigestFinal_ex(ctx, sha256, &sha256Len)) { + TraceEvent(SevWarnAlways, "ComputeSha256DigestFinalFailed"); + throw encrypt_ops_error(); + } + + // KeyValueCheck token allows FDB code to sanitize 'baseCipher' buffer, an external input to FDB. Given the token is + // NOT meant to protect against any tampering attack, it is OK to truncate generated SHA256 KCV. + + ASSERT_LE(sizeof(EncryptCipherKeyCheckValue), EVP_MAX_MD_SIZE); + EncryptCipherKeyCheckValue kcv; + std::memcpy((uint8_t*)&kcv, sha256, sizeof(EncryptCipherKeyCheckValue)); + +#if BLOB_CIPHER_DEBUG + TraceEvent("ComputeSha256KCV").detail("KCV", kcv); +#endif + + CODE_PROBE(true, "Sha256 KCV generation done"); + return kcv; +} + +void Sha256KCV::checkEqual(const Reference& cipher, const EncryptCipherKeyCheckValue persisted) { + ASSERT(cipher.isValid()); + +#if BLOB_CIPHER_DEBUG + TraceEvent(SevDebug, "Sha256KCVCheckEqual") + .detail("CipherKCV", cipher->getBaseCipherKCV()) + .detail("Persisted", persisted); +#endif + + if (cipher->getBaseCipherKCV() != persisted) { + CODE_PROBE(true, "Sha256 Key Check Value mismatch"); + TraceEvent(SevWarnAlways, "Sha256KCVMismatch") + .detail("Computed", cipher->getBaseCipherKCV()) + .detail("Persited", persisted) + .detail("DomainId", cipher->getDomainId()) + .detail("BaseCipherId", cipher->getBaseCipherId()); + throw encrypt_key_check_value_mismatch(); + } + CODE_PROBE(true, "Sha256 KCV validation done"); +} + +// Only used to link unit tests +void forceLinkBlobCipherTests() {} + +// Tests cases includes: +// 1. Populate cache by inserting 'baseCipher' details for new encryptionDomainIds +// 2. Random lookup for cipherKeys and content validation +// 3. Inserting of 'identical' cipherKey (already cached) more than once works as desired. +// 4. Inserting of 'non-identical' cipherKey (already cached) more than once works as desired. +// 5. Validation encryption ops (correctness): +// 5.1. Encrypt a buffer followed by decryption of the buffer, validate the contents. +// 5.2. Simulate anomalies such as: EncryptionHeader corruption, authToken mismatch / encryptionMode mismatch etc. +// 6. Cache cleanup +// 6.1 cleanup cipherKeys by given encryptDomainId +// 6.2. Cleanup all cached cipherKeys + +namespace { +// Construct a dummy External Key Manager representation and populate with some keys +class BaseCipher : public ReferenceCounted, NonCopyable { +public: + EncryptCipherDomainId domainId; + int len; + EncryptCipherBaseKeyId keyId; + std::unique_ptr key; + EncryptCipherKeyCheckValue kcv; + int64_t refreshAt; + int64_t expireAt; + EncryptCipherRandomSalt generatedSalt; + + BaseCipher(const EncryptCipherDomainId& dId, + const EncryptCipherBaseKeyId& kId, + const int64_t rAt, + const int64_t eAt) + : domainId(dId), len(deterministicRandom()->randomInt(4, MAX_BASE_CIPHER_LEN + 1)), keyId(kId), + key(std::make_unique(len)), refreshAt(rAt), expireAt(eAt) { + deterministicRandom()->randomBytes(key.get(), len); + kcv = Sha256KCV().computeKCV(key.get(), len); + } +}; + +Reference corruptCipherKey(const Reference& cipherKey) { + std::unique_ptr corruptedBaseCipher = std::make_unique(cipherKey->getBaseCipherLen()); + memcpy(corruptedBaseCipher.get(), cipherKey->rawBaseCipher(), cipherKey->getBaseCipherLen()); + const int idx = deterministicRandom()->randomInt(0, cipherKey->getBaseCipherLen()); + corruptedBaseCipher.get()[idx]++; + const EncryptCipherKeyCheckValue baseCipherKCV = + Sha256KCV().computeKCV(corruptedBaseCipher.get(), cipherKey->getBaseCipherLen()); + return makeReference(cipherKey->getDomainId(), + cipherKey->getBaseCipherId(), + corruptedBaseCipher.get(), + cipherKey->getBaseCipherLen(), + baseCipherKCV, + cipherKey->getRefreshAtTS(), + cipherKey->getExpireAtTS()); +} + +using BaseKeyMap = std::unordered_map>; +using DomainKeyMap = std::unordered_map; + +} // namespace + +void testMaxBaseCipherLen() { + TraceEvent("TestMaxBaseCipherLenStart"); + try { + const int baseCipherLen = deterministicRandom()->randomInt(MAX_BASE_CIPHER_LEN + 1, MAX_BASE_CIPHER_LEN + 10); + uint8_t baseCipher[baseCipherLen]; + deterministicRandom()->randomBytes(&baseCipher[0], baseCipherLen); + const EncryptCipherKeyCheckValue baseCipherKCV = Sha256KCV().computeKCV(&baseCipher[0], baseCipherLen); + Reference cipher = makeReference(1, + 1, + &baseCipher[0], + baseCipherLen, + baseCipherKCV, + std::numeric_limits::max(), + std::numeric_limits::max()); + ASSERT(false); // error expected + } catch (Error& e) { + ASSERT_EQ(e.code(), error_code_encrypt_max_base_cipher_len); + } + TraceEvent("TestMaxBaseCipherLenDone"); +} + +void testKeyCacheEssentials(DomainKeyMap& domainKeyMap, + const int minDomainId, + const int maxDomainId, + const int minBaseCipherKeyId) { + TraceEvent("TestCacheEssentialsStart"); + + Reference cipherKeyCache = BlobCipherKeyCache::getInstance(); + + // validate getLatestCipherKey return empty when there's no cipher key + TraceEvent("BlobCipherTestLatestKeyNotExists").log(); + try { + cipherKeyCache->getLatestCipherKey(INVALID_ENCRYPT_DOMAIN_ID); + ASSERT(false); // shouldn't get here + } catch (Error& e) { + ASSERT_EQ(e.code(), error_code_encrypt_invalid_id); + } + + // insert BlobCipher keys into BlobCipherKeyCache map and validate + TraceEvent("TestInsertKeys").log(); + for (auto& domainItr : domainKeyMap) { + for (auto& baseKeyItr : domainItr.second) { + Reference baseCipher = baseKeyItr.second; + + cipherKeyCache->insertCipherKey(baseCipher->domainId, + baseCipher->keyId, + baseCipher->key.get(), + baseCipher->len, + baseCipher->kcv, + baseCipher->refreshAt, + baseCipher->expireAt); + Reference fetchedKey = cipherKeyCache->getLatestCipherKey(baseCipher->domainId); + baseCipher->generatedSalt = fetchedKey->getSalt(); + } + } + // insert EncryptHeader BlobCipher key + Reference headerBaseCipher = makeReference( + ENCRYPT_HEADER_DOMAIN_ID, 1, std::numeric_limits::max(), std::numeric_limits::max()); + cipherKeyCache->insertCipherKey(headerBaseCipher->domainId, + headerBaseCipher->keyId, + headerBaseCipher->key.get(), + headerBaseCipher->len, + headerBaseCipher->kcv, + headerBaseCipher->refreshAt, + headerBaseCipher->expireAt); + + TraceEvent("TestInsertKeysDone").log(); + + // validate the cipherKey lookups work as desired + for (auto& domainItr : domainKeyMap) { + for (auto& baseKeyItr : domainItr.second) { + Reference baseCipher = baseKeyItr.second; + Reference cipherKey = + cipherKeyCache->getCipherKey(baseCipher->domainId, baseCipher->keyId, baseCipher->generatedSalt); + ASSERT(cipherKey.isValid()); + // validate common cipher properties - domainId, baseCipherId, baseCipherLen, rawBaseCipher + ASSERT_EQ(cipherKey->getBaseCipherId(), baseCipher->keyId); + ASSERT_EQ(cipherKey->getDomainId(), baseCipher->domainId); + ASSERT_EQ(cipherKey->getBaseCipherLen(), baseCipher->len); + // ensure that baseCipher matches with the cached information + ASSERT_EQ(std::memcmp(cipherKey->rawBaseCipher(), baseCipher->key.get(), cipherKey->getBaseCipherLen()), 0); + // validate the encryption derivation + const int len = std::min(AES_256_KEY_LENGTH, cipherKey->getBaseCipherLen()); + ASSERT_NE(std::memcmp(cipherKey->rawCipher(), baseCipher->key.get(), len), 0); + } + } + TraceEvent("TestLooksupDone").log(); + + // Ensure attemtping to insert existing cipherKey (identical) more than once is treated as a NOP + try { + Reference baseCipher = domainKeyMap[minDomainId][minBaseCipherKeyId]; + cipherKeyCache->insertCipherKey(baseCipher->domainId, + baseCipher->keyId, + baseCipher->key.get(), + baseCipher->len, + baseCipher->kcv, + std::numeric_limits::max(), + std::numeric_limits::max()); + } catch (Error& e) { + throw; + } + TraceEvent("TestReinsertIdempotentKeyDone").log(); + + // Ensure attemtping to insert an existing cipherKey (modified) fails with appropriate error + try { + Reference baseCipher = domainKeyMap[minDomainId][minBaseCipherKeyId]; + uint8_t rawCipher[baseCipher->len]; + memcpy(rawCipher, baseCipher->key.get(), baseCipher->len); + // modify cipherKey by flipping a bit + const int idx = deterministicRandom()->randomInt(0, baseCipher->len); + rawCipher[idx]++; + cipherKeyCache->insertCipherKey(baseCipher->domainId, + baseCipher->keyId, + &rawCipher[0], + baseCipher->len, + baseCipher->kcv, + std::numeric_limits::max(), + std::numeric_limits::max()); + } catch (Error& e) { + if (e.code() != error_code_encrypt_update_cipher) { + throw; + } + TraceEvent("TestReinsertNonIdempotentKeyDone"); + } + + TraceEvent("TestCacheEssentialsEnd"); +} + +void testKeyCacheRefreshExpireCipherKey(DomainKeyMap& domainKeyMap, const int maxDomainId) { + TraceEvent("BlobCipherCacheRefreshCipherKey"); + + Reference cipherKeyCache = BlobCipherKeyCache::getInstance(); + EncryptCipherDomainId domId = maxDomainId + 1; + Reference cipherKey = cipherKeyCache->getLatestCipherKey(domId); + ASSERT(!cipherKey.isValid()); + + Standalone baseCipher = makeString(4); + deterministicRandom()->randomBytes(mutateString(baseCipher), 4); + EncryptCipherKeyCheckValue baseCipherKCV = Sha256KCV().computeKCV(baseCipher.begin(), baseCipher.size()); + + Counter::Value expectedNeedRefreshCount = + BlobCipherMetrics::getInstance()->latestCipherKeyCacheNeedsRefresh.getValue(); + Counter::Value expectedLatestHitCount = BlobCipherMetrics::getInstance()->latestCipherKeyCacheHit.getValue(); + Counter::Value expectedLatestMissCount = BlobCipherMetrics::getInstance()->cipherKeyCacheMiss.getValue(); + Counter::Value expectedMissCount = BlobCipherMetrics::getInstance()->cipherKeyCacheMiss.getValue(); + Counter::Value expectedHitCount = BlobCipherMetrics::getInstance()->cipherKeyCacheHit.getValue(); + Counter::Value expectedExpiredKeys = BlobCipherMetrics::getInstance()->cipherKeyCacheExpired.getValue(); + // Insert key that needs refresh + int64_t refreshAt = now() - 1; + int64_t expireAt = std::numeric_limits::max(); + Reference inserted = cipherKeyCache->insertCipherKey( + domId, 1, baseCipher.begin(), baseCipher.size(), baseCipherKCV, refreshAt, expireAt); + EncryptCipherRandomSalt salt = inserted->getSalt(); + + Reference cipher = cipherKeyCache->getLatestCipherKey(domId); + expectedLatestMissCount++; + expectedNeedRefreshCount++; + // Ensure cache return an invalid cipher + ASSERT(!cipher.isValid()); + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheNeedsRefresh.getValue(), expectedNeedRefreshCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheMiss.getValue(), expectedLatestMissCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheHit.getValue(), expectedLatestHitCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheMiss.getValue(), expectedMissCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheHit.getValue(), expectedHitCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheExpired.getValue(), expectedExpiredKeys); + + // Ensure point-lookup still returns valid key + cipher = cipherKeyCache->getCipherKey(domId, 1, salt); + expectedHitCount++; + ASSERT(cipher.isValid()); + ASSERT_EQ(cipher->getDomainId(), domId); + ASSERT_EQ(cipher->getBaseCipherId(), 1); + ASSERT_EQ(cipher->getBaseCipherLen(), 4); + ASSERT_EQ(memcmp(cipher->rawBaseCipher(), baseCipher.begin(), 4), 0); + ASSERT_EQ(cipher->getRefreshAtTS(), refreshAt); + ASSERT_EQ(cipher->getExpireAtTS(), expireAt); + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheNeedsRefresh.getValue(), expectedNeedRefreshCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheMiss.getValue(), expectedLatestMissCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheHit.getValue(), expectedLatestHitCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheMiss.getValue(), expectedMissCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheHit.getValue(), expectedHitCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheExpired.getValue(), expectedExpiredKeys); + + // Re-insert same key with same 'baseCipherId' and cache should accept it + refreshAt = now() + 5; + expireAt = now() + 10; // limit the expiry of the cipher + Reference insertAgain = cipherKeyCache->insertCipherKey( + domId, 1, baseCipher.begin(), baseCipher.size(), baseCipherKCV, refreshAt, expireAt); + salt = insertAgain->getSalt(); + cipher = cipherKeyCache->getLatestCipherKey(domId); + expectedLatestHitCount++; + ASSERT(cipher.isValid()); + ASSERT_EQ(cipher->getDomainId(), domId); + ASSERT_EQ(cipher->getBaseCipherId(), 1); + ASSERT_EQ(cipher->getBaseCipherLen(), 4); + ASSERT_EQ(memcmp(cipher->rawBaseCipher(), baseCipher.begin(), 4), 0); + ASSERT_EQ(cipher->getRefreshAtTS(), refreshAt); + ASSERT_EQ(cipher->getExpireAtTS(), expireAt); + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheNeedsRefresh.getValue(), expectedNeedRefreshCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheMiss.getValue(), expectedLatestMissCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheHit.getValue(), expectedLatestHitCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheMiss.getValue(), expectedMissCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheHit.getValue(), expectedHitCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheExpired.getValue(), expectedExpiredKeys); + + // Insert an expired cipherkey + domId++; + expireAt = now() - 100; + refreshAt = expireAt - 10; + inserted = cipherKeyCache->insertCipherKey( + domId, 1, baseCipher.begin(), baseCipher.size(), baseCipherKCV, refreshAt, expireAt); + salt = inserted->getSalt(); + + // Ensure getLatestCipher desired behavior + cipher = cipherKeyCache->getLatestCipherKey(domId); + ASSERT(!cipher.isValid()); + // Already expired key, hence, getLookupByBaseCipher would fail, hence, NOT increment 'needsRefresh' counter + expectedLatestMissCount++; + expectedExpiredKeys++; + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheNeedsRefresh.getValue(), expectedNeedRefreshCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheMiss.getValue(), expectedLatestMissCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheHit.getValue(), expectedLatestHitCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheMiss.getValue(), expectedMissCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheHit.getValue(), expectedHitCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheExpired.getValue(), expectedExpiredKeys); + + // Ensure getCipher desired behavior + inserted = cipherKeyCache->insertCipherKey( + domId, 1, baseCipher.begin(), baseCipher.size(), baseCipherKCV, refreshAt, expireAt); + salt = inserted->getSalt(); + cipher = cipherKeyCache->getCipherKey(domId, 1, salt); + ASSERT(!cipher.isValid()); + expectedMissCount++; + expectedExpiredKeys++; + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheNeedsRefresh.getValue(), expectedNeedRefreshCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheMiss.getValue(), expectedLatestMissCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->latestCipherKeyCacheHit.getValue(), expectedLatestHitCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheMiss.getValue(), expectedMissCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheHit.getValue(), expectedHitCount); + ASSERT_EQ(BlobCipherMetrics::getInstance()->cipherKeyCacheExpired.getValue(), expectedExpiredKeys); +} + +void testNoAuthMode(const int minDomainId) { + TraceEvent("TestNoAuthModeStart"); + + Reference cipherKeyCache = BlobCipherKeyCache::getInstance(); + + // Validate Encryption ops + Reference cipherKey = cipherKeyCache->getLatestCipherKey(minDomainId); + Reference headerCipherKey = cipherKeyCache->getLatestCipherKey(ENCRYPT_HEADER_DOMAIN_ID); + const int bufLen = deterministicRandom()->randomInt(786, 2127) + 512; + uint8_t orgData[bufLen]; + deterministicRandom()->randomBytes(&orgData[0], bufLen); + + Arena arena; + uint8_t iv[AES_256_IV_LENGTH]; + deterministicRandom()->randomBytes(&iv[0], AES_256_IV_LENGTH); + + EncryptBlobCipherAes265Ctr encryptor(cipherKey, + headerCipherKey, + iv, + AES_256_IV_LENGTH, + EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE, + BlobCipherMetrics::TEST); + BlobCipherEncryptHeader header; + Reference encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); + + ASSERT_EQ(encrypted->getLogicalSize(), bufLen); + ASSERT_NE(memcmp(&orgData[0], encrypted->begin(), bufLen), 0); + ASSERT_EQ(header.flags.headerVersion, EncryptBlobCipherAes265Ctr::ENCRYPT_HEADER_VERSION); + ASSERT_EQ(header.flags.encryptMode, EncryptCipherMode::ENCRYPT_CIPHER_MODE_AES_256_CTR); + ASSERT_EQ(header.flags.authTokenMode, EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE); + + TraceEvent("TestNoAuthEncryptDone") + .detail("HeaderVersion", header.flags.headerVersion) + .detail("HeaderEncryptMode", header.flags.encryptMode) + .detail("HeaderEncryptAuthTokenMode", header.flags.authTokenMode) + .detail("HeaderEncryptAuthTokenAlgo", header.flags.authTokenAlgo) + .detail("DomainId", header.cipherTextDetails.encryptDomainId) + .detail("BaseCipherId", header.cipherTextDetails.baseCipherId); + + Reference tCipherKey = cipherKeyCache->getCipherKey( + header.cipherTextDetails.encryptDomainId, header.cipherTextDetails.baseCipherId, header.cipherTextDetails.salt); + ASSERT(tCipherKey->isEqual(cipherKey)); + DecryptBlobCipherAes256Ctr decryptor( + tCipherKey, Reference(), &header.iv[0], BlobCipherMetrics::TEST); + + Reference decrypted = decryptor.decrypt(encrypted->begin(), bufLen, header, arena); + ASSERT_EQ(decrypted->getLogicalSize(), bufLen); + ASSERT_EQ(memcmp(decrypted->begin(), &orgData[0], bufLen), 0); + + TraceEvent("TestNoAuthDecryptDone"); + + // induce encryption header corruption - headerVersion corrupted + BlobCipherEncryptHeader headerCopy; + memcpy(reinterpret_cast(&headerCopy), + reinterpret_cast(&header), + sizeof(BlobCipherEncryptHeader)); + headerCopy.flags.headerVersion += 1; + try { + encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); + DecryptBlobCipherAes256Ctr decryptor( + tCipherKey, Reference(), header.iv, BlobCipherMetrics::TEST); + decrypted = decryptor.decrypt(encrypted->begin(), bufLen, headerCopy, arena); + ASSERT(false); // error expected + } catch (Error& e) { + if (e.code() != error_code_encrypt_header_metadata_mismatch) { + throw; + } + TraceEvent("TestNoAuthHeaderVersionCorruptionDone"); + } + + // induce encryption header corruption - encryptionMode corrupted + memcpy(reinterpret_cast(&headerCopy), + reinterpret_cast(&header), + sizeof(BlobCipherEncryptHeader)); + headerCopy.flags.encryptMode += 1; + try { + encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); + DecryptBlobCipherAes256Ctr decryptor( + tCipherKey, Reference(), header.iv, BlobCipherMetrics::TEST); + decrypted = decryptor.decrypt(encrypted->begin(), bufLen, headerCopy, arena); + ASSERT(false); // error expected + } catch (Error& e) { + if (e.code() != error_code_encrypt_header_metadata_mismatch) { + throw; + } + TraceEvent("TestNoAuthEncryptModeCorruptionDone"); + } + + // induce encrypted buffer payload corruption + try { + encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); + uint8_t temp[bufLen]; + deterministicRandom()->randomBytes(&temp[0], bufLen); + memcpy(encrypted->begin(), &temp[0], bufLen); + int tIdx = deterministicRandom()->randomInt(0, bufLen - 1); + temp[tIdx] += 1; + DecryptBlobCipherAes256Ctr decryptor( + tCipherKey, Reference(), header.iv, BlobCipherMetrics::TEST); + decrypted = decryptor.decrypt(&temp[0], bufLen, header, arena); + TraceEvent("TestNoAuthEncryptPayloadCorruptionDone"); + } catch (Error& e) { + // No authToken, hence, no corruption detection supported + ASSERT(false); + } + + // induce baseCipher corruption + try { + encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); + Reference corruptedCipher = corruptCipherKey(tCipherKey); + DecryptBlobCipherAes256Ctr decryptor( + corruptedCipher, Reference(), header.iv, BlobCipherMetrics::TEST); + decrypted = decryptor.decrypt(encrypted->begin(), bufLen, header, arena); + ASSERT(false); // error expected + } catch (Error& e) { + ASSERT_EQ(e.code(), error_code_encrypt_key_check_value_mismatch); + TraceEvent("TestNoAuthEncryptBaseCipherCorruptionDone"); + } + + TraceEvent("BlobCipherTestNoAuthModeDone"); +} + +void testConfigurableEncryptionBlobCipherHeaderFlagsV1Ser() { + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + + Arena arena; + + // Version-1 + BlobCipherEncryptHeaderFlagsV1 flags( + ENCRYPT_CIPHER_MODE_AES_256_CTR, getRandomAuthTokenMode(), getRandomAuthTokenAlgo()); + Standalone ser = BlobCipherEncryptHeaderFlagsV1::toStringRef(flags, arena); + ASSERT_EQ(ser.size(), sizeof(flags)); +} + +void testConfigurableEncryptionAesCtrNoAuthV1Ser(const int minDomainId) { + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + + Arena arena; + BlobCipherEncryptHeaderRef headerRef; + uint32_t size = 0; + + BlobCipherEncryptHeaderFlagsV1 flags = BlobCipherEncryptHeaderFlagsV1( + ENCRYPT_CIPHER_MODE_AES_256_CTR, ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE, ENCRYPT_HEADER_AUTH_TOKEN_ALGO_NONE); + size += sizeof(BlobCipherEncryptHeaderFlagsV1) + 2; + headerRef.flags = flags; + + AesCtrNoAuth noAuth; + noAuth.v1.cipherTextDetails = BlobCipherDetails(1, 2, 23); + deterministicRandom()->randomBytes(&noAuth.v1.iv[0], AES_256_IV_LENGTH); + Standalone serAlgo = AesCtrNoAuth::toStringRef(noAuth); + ASSERT_EQ(serAlgo.size(), sizeof(noAuth)); + + size += AesCtrNoAuth::getSize(); + + headerRef.algoHeader = noAuth; + Standalone serHeader = BlobCipherEncryptHeaderRef::toStringRef(headerRef); + ASSERT_EQ(serHeader.size(), size); + ASSERT_EQ(size, + BlobCipherEncryptHeaderRef::getHeaderSize(headerRef.flagsVersion(), + headerRef.algoHeaderVersion(), + (EncryptCipherMode)flags.encryptMode, + (EncryptAuthTokenMode)flags.authTokenMode, + (EncryptAuthTokenAlgo)flags.authTokenAlgo)); +} + +template +void testConfigurableEncryptionAesCtrWithAuthSer(const int minDomainId) { + constexpr bool isHmac = std::is_same_v; + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + + Arena arena; + BlobCipherEncryptHeaderRef headerRef; + uint32_t size = 0; + + BlobCipherEncryptHeaderFlagsV1 flags = BlobCipherEncryptHeaderFlagsV1( + ENCRYPT_CIPHER_MODE_AES_256_CTR, + ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE, + isHmac ? ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA : ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC); + size += sizeof(BlobCipherEncryptHeaderFlagsV1) + 2; + + headerRef.flags = flags; + + AesCtrWithAuth withAuth; + withAuth.v1.cipherTextDetails = BlobCipherDetails(1, 2, 23); + withAuth.v1.cipherHeaderDetails = BlobCipherDetails(ENCRYPT_HEADER_DOMAIN_ID, 2, 23); + deterministicRandom()->randomBytes(&withAuth.v1.iv[0], AES_256_IV_LENGTH); + deterministicRandom()->randomBytes(&withAuth.v1.authToken[0], Params::authTokenSize); + Standalone serAlgo = AesCtrWithAuth::toStringRef(withAuth); + ASSERT_EQ(serAlgo.size(), sizeof(withAuth)); + + size += AesCtrWithAuth::getSize(); + + headerRef.algoHeader = withAuth; + Standalone serHeader = BlobCipherEncryptHeaderRef::toStringRef(headerRef); + ASSERT_EQ(serHeader.size(), size); + ASSERT_EQ(size, + BlobCipherEncryptHeaderRef::getHeaderSize(headerRef.flagsVersion(), + headerRef.algoHeaderVersion(), + (EncryptCipherMode)flags.encryptMode, + (EncryptAuthTokenMode)flags.authTokenMode, + (EncryptAuthTokenAlgo)flags.authTokenAlgo)); +} + +void testConfigurableEncryptionHeaderNoAuthMode(const int minDomainId) { + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + + TraceEvent("TestConfigurableEncryptionHeader").detail("Mode", "No-Auth"); + + Reference cipherKeyCache = BlobCipherKeyCache::getInstance(); + + // Validate Encryption ops + Reference cipherKey = cipherKeyCache->getLatestCipherKey(minDomainId); + Reference headerCipherKey = cipherKeyCache->getLatestCipherKey(ENCRYPT_HEADER_DOMAIN_ID); + const int bufLen = deterministicRandom()->randomInt(786, 2127) + 512; + uint8_t orgData[bufLen]; + deterministicRandom()->randomBytes(&orgData[0], bufLen); + + Arena arena; + uint8_t iv[AES_256_IV_LENGTH]; + deterministicRandom()->randomBytes(&iv[0], AES_256_IV_LENGTH); + + EncryptBlobCipherAes265Ctr encryptor(cipherKey, + headerCipherKey, + iv, + AES_256_IV_LENGTH, + EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE, + BlobCipherMetrics::TEST); + + BlobCipherEncryptHeaderRef headerRef; + encryptor.encrypt(&orgData[0], bufLen, &headerRef, arena); + + ASSERT_EQ(headerRef.flagsVersion(), 1); + BlobCipherEncryptHeaderFlagsV1 flags = std::get(headerRef.flags); + ASSERT_EQ(flags.authTokenMode, headerRef.getAuthTokenMode()); + AesCtrNoAuth noAuth = std::get(headerRef.algoHeader); + + const uint8_t* headerIV = headerRef.getIV(); + ASSERT_EQ(memcmp(&headerIV[0], &iv[0], AES_256_IV_LENGTH), 0); + + EncryptHeaderCipherDetails validateDetails = headerRef.getCipherDetails(); + ASSERT(validateDetails.textCipherDetails.isValid() && + validateDetails.textCipherDetails == + BlobCipherDetails(cipherKey->getDomainId(), cipherKey->getBaseCipherId(), cipherKey->getSalt())); + ASSERT(!validateDetails.headerCipherDetails.present()); + + Standalone serHeaderRef = BlobCipherEncryptHeaderRef::toStringRef(headerRef); + BlobCipherEncryptHeaderRef validateHeader = BlobCipherEncryptHeaderRef::fromStringRef(serHeaderRef); + BlobCipherEncryptHeaderFlagsV1 validateFlags = std::get(validateHeader.flags); + ASSERT(validateFlags == flags); + + AesCtrNoAuth validateAlgo = std::get(validateHeader.algoHeader); + ASSERT(validateAlgo.v1.cipherTextDetails == noAuth.v1.cipherTextDetails); + ASSERT_EQ(memcmp(&validateAlgo.v1.iv[0], &noAuth.v1.iv[0], AES_256_IV_LENGTH), 0); + + TraceEvent("NoAuthHeaderSize") + .detail("Flags", sizeof(flags)) + .detail("AlgoHeader", noAuth.getSize()) + .detail("TotalHeader", serHeaderRef.size()); + + TraceEvent("TestConfigurableEncryptionHeader").detail("Mode", "No-Auth"); +} + +void testConfigurableEncryptionNoAuthMode(const int minDomainId) { + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + + TraceEvent("TestConfigurableEncryptionNoAuthModeStart"); + + Reference cipherKeyCache = BlobCipherKeyCache::getInstance(); + + // Validate Encryption ops + Reference cipherKey = cipherKeyCache->getLatestCipherKey(minDomainId); + Reference headerCipherKey = cipherKeyCache->getLatestCipherKey(ENCRYPT_HEADER_DOMAIN_ID); + const int bufLen = deterministicRandom()->randomInt(786, 2127) + 512; + uint8_t orgData[bufLen]; + deterministicRandom()->randomBytes(&orgData[0], bufLen); + + Arena arena; + uint8_t iv[AES_256_IV_LENGTH]; + deterministicRandom()->randomBytes(&iv[0], AES_256_IV_LENGTH); + + EncryptBlobCipherAes265Ctr encryptor(cipherKey, + headerCipherKey, + iv, + AES_256_IV_LENGTH, + EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE, + BlobCipherMetrics::TEST); + + BlobCipherEncryptHeaderRef headerRef; + StringRef encryptedBuf = encryptor.encrypt(&orgData[0], bufLen, &headerRef, arena); + + // validate header version details + AesCtrNoAuth noAuth = std::get(headerRef.algoHeader); + Reference tCipherKey = cipherKeyCache->getCipherKey(noAuth.v1.cipherTextDetails.encryptDomainId, + noAuth.v1.cipherTextDetails.baseCipherId, + noAuth.v1.cipherTextDetails.salt); + ASSERT(tCipherKey->isEqual(cipherKey)); + DecryptBlobCipherAes256Ctr decryptor( + tCipherKey, Reference(), &noAuth.v1.iv[0], BlobCipherMetrics::TEST); + + StringRef decryptedBuf = decryptor.decrypt(encryptedBuf.begin(), encryptedBuf.size(), headerRef, arena); + ASSERT_EQ(decryptedBuf.size(), bufLen); + ASSERT_EQ(memcmp(decryptedBuf.begin(), &orgData[0], bufLen), 0); + + TraceEvent("TestConfigurableEncryptionNoAuthDecryptDone") + .detail("HeaderFlagsVersion", headerRef.flagsVersion()) + .detail("AlgoHeaderVersion", headerRef.algoHeaderVersion()) + .detail("HeaderEncryptMode", ENCRYPT_CIPHER_MODE_AES_256_CTR) + .detail("HeaderEncryptAuthTokenMode", ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) + .detail("HeaderEncryptAuthTokenAlgo", ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) + .detail("DomainId", noAuth.v1.cipherTextDetails.encryptDomainId) + .detail("BaseCipherId", noAuth.v1.cipherTextDetails.baseCipherId) + .detail("Salt", noAuth.v1.cipherTextDetails.salt); + + // induce encryption header corruption - encryptionMode corrupted + BlobCipherEncryptHeaderRef corruptedHeaderRef = BlobCipherEncryptHeaderRef(headerRef); + BlobCipherEncryptHeaderFlagsV1 corruptedFlags = std::get(headerRef.flags); + corruptedFlags.encryptMode += 1; + corruptedHeaderRef.flags = corruptedFlags; + try { + encryptedBuf = encryptor.encrypt(&orgData[0], bufLen, &headerRef, arena); + DecryptBlobCipherAes256Ctr decryptor(tCipherKey, Reference(), &iv[0], BlobCipherMetrics::TEST); + decryptedBuf = decryptor.decrypt(encryptedBuf.begin(), bufLen, corruptedHeaderRef, arena); + ASSERT(false); // error expected + } catch (Error& e) { + if (e.code() != error_code_encrypt_header_metadata_mismatch) { + throw; + } + TraceEvent("TestConfigurableEncryptionNoAuthHeaderCorruptionDone"); + } + + // induce encrypted buffer payload corruption + try { + encryptedBuf = encryptor.encrypt(&orgData[0], bufLen, &headerRef, arena); + uint8_t temp[bufLen]; + deterministicRandom()->randomBytes(&temp[0], bufLen); + memcpy((void*)encryptedBuf.begin(), &temp[0], bufLen); + int tIdx = deterministicRandom()->randomInt(0, bufLen - 1); + temp[tIdx] += 1; + DecryptBlobCipherAes256Ctr decryptor(tCipherKey, Reference(), &iv[0], BlobCipherMetrics::TEST); + decryptedBuf = decryptor.decrypt(&temp[0], bufLen, headerRef, arena); + ASSERT_NE(memcmp(decryptedBuf.begin(), &orgData[0], bufLen), 0); + TraceEvent("TestConfigurableEncryptionNoAuthPayloadCorruptionDone"); + } catch (Error& e) { + // No authToken, hence, no corruption detection supported + ASSERT(false); + } + + // induce baseCipher corruption + try { + Reference corruptedTextCipher = corruptCipherKey(tCipherKey); + encryptedBuf = encryptor.encrypt(&orgData[0], bufLen, &headerRef, arena); + DecryptBlobCipherAes256Ctr decryptor( + corruptedTextCipher, Reference(), &iv[0], BlobCipherMetrics::TEST); + decryptedBuf = decryptor.decrypt(encryptedBuf.begin(), bufLen, headerRef, arena); + ASSERT(false); // error expected + } catch (Error& e) { + ASSERT_EQ(e.code(), error_code_encrypt_key_check_value_mismatch); + TraceEvent("TestConfigurableEncryptionNoAuthBaseCipherCorruptionDone"); + } + + TraceEvent("ConfigurableEncryptionNoAuthDone"); +} + +// validate basic encrypt followed by decrypt operation for AUTH_TOKEN_MODE_SINGLE +// HMAC_SHA authToken algorithm +template +void testSingleAuthMode(const int minDomainId) { + constexpr bool isHmac = std::is_same_v; + const std::string authAlgoStr = isHmac ? "HMAC-SHA" : "AES-CMAC"; + const EncryptAuthTokenAlgo authAlgo = isHmac ? EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA + : EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC; + + TraceEvent("TestSingleAuthTokenStart").detail("Mode", authAlgoStr); + + Reference cipherKeyCache = BlobCipherKeyCache::getInstance(); + + // Validate Encryption ops + Reference cipherKey = cipherKeyCache->getLatestCipherKey(minDomainId); + Reference headerCipherKey = cipherKeyCache->getLatestCipherKey(ENCRYPT_HEADER_DOMAIN_ID); + const int bufLen = deterministicRandom()->randomInt(786, 2127) + 512; + Arena arena; + uint8_t iv[AES_256_IV_LENGTH]; + deterministicRandom()->randomBytes(&iv[0], AES_256_IV_LENGTH); + uint8_t orgData[bufLen]; + deterministicRandom()->randomBytes(&orgData[0], bufLen); + + EncryptBlobCipherAes265Ctr encryptor(cipherKey, + headerCipherKey, + iv, + AES_256_IV_LENGTH, + EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE, + authAlgo, + BlobCipherMetrics::TEST); + BlobCipherEncryptHeader header; + Reference encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); + + ASSERT_EQ(encrypted->getLogicalSize(), bufLen); + ASSERT_NE(memcmp(&orgData[0], encrypted->begin(), bufLen), 0); + ASSERT_EQ(header.flags.headerVersion, EncryptBlobCipherAes265Ctr::ENCRYPT_HEADER_VERSION); + ASSERT_EQ(header.flags.encryptMode, ENCRYPT_CIPHER_MODE_AES_256_CTR); + ASSERT_EQ(header.flags.authTokenMode, EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE); + ASSERT_EQ(header.flags.authTokenAlgo, authAlgo); + + TraceEvent("TestSingleAuthTokenEncryptDone") + .detail("HeaderVersion", header.flags.headerVersion) + .detail("HeaderEncryptMode", header.flags.encryptMode) + .detail("HeaderEncryptAuthTokenMode", header.flags.authTokenMode) + .detail("HeaderEncryptAuthTokenAlgo", header.flags.authTokenAlgo) + .detail("DomainId", header.cipherTextDetails.encryptDomainId) + .detail("BaseCipherId", header.cipherTextDetails.baseCipherId) + .detail("HeaderAuthToken", + StringRef(arena, &header.singleAuthToken.authToken[0], Params::authTokenSize).toString()); + + Reference tCipherKey = cipherKeyCache->getCipherKey( + header.cipherTextDetails.encryptDomainId, header.cipherTextDetails.baseCipherId, header.cipherTextDetails.salt); + Reference hCipherKey = cipherKeyCache->getCipherKey(header.cipherHeaderDetails.encryptDomainId, + header.cipherHeaderDetails.baseCipherId, + header.cipherHeaderDetails.salt); + ASSERT(tCipherKey->isEqual(cipherKey)); + DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, header.iv, BlobCipherMetrics::TEST); + Reference decrypted = decryptor.decrypt(encrypted->begin(), bufLen, header, arena); + + ASSERT_EQ(decrypted->getLogicalSize(), bufLen); + ASSERT_EQ(memcmp(decrypted->begin(), &orgData[0], bufLen), 0); + + TraceEvent("TestSingleAuthTokenDecryptDone").detail("Mode", authAlgoStr); + + // induce encryption header corruption - headerVersion corrupted + BlobCipherEncryptHeader headerCopy; + encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); + memcpy(reinterpret_cast(&headerCopy), + reinterpret_cast(&header), + sizeof(BlobCipherEncryptHeader)); + headerCopy.flags.headerVersion += 1; + try { + DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, header.iv, BlobCipherMetrics::TEST); + decrypted = decryptor.decrypt(encrypted->begin(), bufLen, headerCopy, arena); + ASSERT(false); // error expected + } catch (Error& e) { + if (e.code() != error_code_encrypt_header_metadata_mismatch) { + throw; + } + TraceEvent("TestSingleAuthTokenHeaderVersionCorruptionDone").detail("Mode", authAlgoStr); + } + + // induce encryption header corruption - encryptionMode corrupted + encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); + memcpy(reinterpret_cast(&headerCopy), + reinterpret_cast(&header), + sizeof(BlobCipherEncryptHeader)); + headerCopy.flags.encryptMode += 1; + try { + DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, header.iv, BlobCipherMetrics::TEST); + decrypted = decryptor.decrypt(encrypted->begin(), bufLen, headerCopy, arena); + ASSERT(false); // error expected + } catch (Error& e) { + if (e.code() != error_code_encrypt_header_metadata_mismatch) { + throw; + } + TraceEvent("TestSingleAuthTokenEncryptModeCorruptionDone").detail("Mode", authAlgoStr); + } + + // induce encryption header corruption - authToken mismatch + encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); + memcpy(reinterpret_cast(&headerCopy), + reinterpret_cast(&header), + sizeof(BlobCipherEncryptHeader)); + int hIdx = deterministicRandom()->randomInt(0, Params::authTokenSize - 1); + headerCopy.singleAuthToken.authToken[hIdx] += 1; + try { + DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, header.iv, BlobCipherMetrics::TEST); + decrypted = decryptor.decrypt(encrypted->begin(), bufLen, headerCopy, arena); + ASSERT(false); // error expected + } catch (Error& e) { + if (e.code() != error_code_encrypt_header_authtoken_mismatch) { + throw; + } + TraceEvent("TestSingleAuthTokenAuthTokenMismatchDone").detail("Mode", authAlgoStr); + } + + // induce encrypted buffer payload corruption + try { + encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); + uint8_t temp[bufLen]; + deterministicRandom()->randomBytes(temp, bufLen); + memcpy(encrypted->begin(), &temp[0], bufLen); + int tIdx = deterministicRandom()->randomInt(0, bufLen - 1); + temp[tIdx] += 1; + DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, header.iv, BlobCipherMetrics::TEST); + decrypted = decryptor.decrypt(&temp[0], bufLen, header, arena); + } catch (Error& e) { + if (e.code() != error_code_encrypt_header_authtoken_mismatch) { + throw; + } + TraceEvent("TestSingleAuthTokenPayloadCorruptionDone").detail("Mode", authAlgoStr); + } + + // induce baseCipher corruption + try { + const bool corruptTextCipher = deterministicRandom()->coinflip(); + encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); + if (corruptTextCipher) { + Reference corruptedCipher = corruptCipherKey(tCipherKey); + DecryptBlobCipherAes256Ctr decryptor(corruptedCipher, hCipherKey, header.iv, BlobCipherMetrics::TEST); + decrypted = decryptor.decrypt(encrypted->begin(), bufLen, header, arena); + } else { + Reference corruptedCipher = corruptCipherKey(hCipherKey); + DecryptBlobCipherAes256Ctr decryptor(tCipherKey, corruptedCipher, header.iv, BlobCipherMetrics::TEST); + decrypted = decryptor.decrypt(encrypted->begin(), bufLen, header, arena); + } + ASSERT(false); // error expected + } catch (Error& e) { + ASSERT_EQ(e.code(), error_code_encrypt_key_check_value_mismatch); + TraceEvent("TestSingleAuthTokenBaseCipherCorruptionDone").detail("Mode", authAlgoStr); + } + + TraceEvent("BlobCipherTestSingleAuthTokenEnd").detail("Mode", authAlgoStr); +} + +template +void testConfigurableEncryptionHeaderSingleAuthMode(int minDomainId) { + constexpr bool isHmac = std::is_same_v; + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + + TraceEvent("TestEncryptionHeaderStart").detail("Mode", isHmac ? "HMAC_SHA" : "AES-CMAC"); + + Reference cipherKeyCache = BlobCipherKeyCache::getInstance(); + + // Validate Encryption ops + Reference cipherKey = cipherKeyCache->getLatestCipherKey(minDomainId); + Reference headerCipherKey = cipherKeyCache->getLatestCipherKey(ENCRYPT_HEADER_DOMAIN_ID); + const int bufLen = deterministicRandom()->randomInt(786, 2127) + 512; + Arena arena; + uint8_t iv[AES_256_IV_LENGTH]; + deterministicRandom()->randomBytes(&iv[0], AES_256_IV_LENGTH); + uint8_t orgData[bufLen]; + deterministicRandom()->randomBytes(&orgData[0], bufLen); + + EncryptBlobCipherAes265Ctr encryptor(cipherKey, + headerCipherKey, + iv, + AES_256_IV_LENGTH, + EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE, + std::is_same_v + ? EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA + : EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC, + BlobCipherMetrics::TEST); + BlobCipherEncryptHeaderRef headerRef; + encryptor.encrypt(&orgData[0], bufLen, &headerRef, arena); + + ASSERT_EQ(headerRef.flagsVersion(), 1); + BlobCipherEncryptHeaderFlagsV1 flags = std::get(headerRef.flags); + ASSERT_EQ(flags.authTokenMode, headerRef.getAuthTokenMode()); + AesCtrWithAuth algoHeader = std::get>(headerRef.algoHeader); + + const uint8_t* headerIV = headerRef.getIV(); + ASSERT_EQ(memcmp(&headerIV[0], &iv[0], AES_256_IV_LENGTH), 0); + + EncryptHeaderCipherDetails validateDetails = headerRef.getCipherDetails(); + ASSERT(validateDetails.textCipherDetails.isValid() && + validateDetails.textCipherDetails == + BlobCipherDetails(cipherKey->getDomainId(), cipherKey->getBaseCipherId(), cipherKey->getSalt())); + ASSERT(validateDetails.headerCipherDetails.present() && validateDetails.headerCipherDetails.get().isValid() && + validateDetails.headerCipherDetails.get() == BlobCipherDetails(headerCipherKey->getDomainId(), + headerCipherKey->getBaseCipherId(), + headerCipherKey->getSalt())); + + Standalone serHeaderRef = BlobCipherEncryptHeaderRef::toStringRef(headerRef); + BlobCipherEncryptHeaderRef validateHeader = BlobCipherEncryptHeaderRef::fromStringRef(serHeaderRef); + BlobCipherEncryptHeaderFlagsV1 validateFlags = std::get(validateHeader.flags); + ASSERT(validateFlags == flags); + + AesCtrWithAuth validateAlgo = std::get>(validateHeader.algoHeader); + ASSERT(validateAlgo.v1.cipherTextDetails == algoHeader.v1.cipherTextDetails); + ASSERT(validateAlgo.v1.cipherHeaderDetails == algoHeader.v1.cipherHeaderDetails); + ASSERT_EQ(memcmp(&iv[0], &validateAlgo.v1.iv[0], AES_256_IV_LENGTH), 0); + ASSERT_EQ(memcmp(&algoHeader.v1.authToken[0], &validateAlgo.v1.authToken[0], Params::authTokenSize), 0); + + TraceEvent("HeaderSize") + .detail("Flags", sizeof(flags)) + .detail("AlgoHeader", algoHeader.getSize()) + .detail("TotalHeader", serHeaderRef.size()); + + TraceEvent("TestEncryptionHeaderEnd").detail("Mode", isHmac ? "HMAC_SHA" : "AES-CMAC"); +} + +// validate basic encrypt followed by decrypt operation for AUTH_TOKEN_MODE_SINGLE +template +void testConfigurableEncryptionSingleAuthMode(const int minDomainId) { + constexpr bool isHmac = std::is_same_v; + const std::string authAlgoStr = isHmac ? "HMAC-SHA" : "AES-CMAC"; + const EncryptAuthTokenAlgo authAlgo = isHmac ? EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA + : EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC; + const int algoHeaderVersion = isHmac ? CLIENT_KNOBS->ENCRYPT_HEADER_AES_CTR_HMAC_SHA_AUTH_VERSION + : CLIENT_KNOBS->ENCRYPT_HEADER_AES_CTR_AES_CMAC_AUTH_VERSION; + + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + + TraceEvent("TestConfigurableEncryptionSingleAuthStart").detail("Mode", authAlgoStr); + + Reference cipherKeyCache = BlobCipherKeyCache::getInstance(); + + // Validate Encryption ops + Reference cipherKey = cipherKeyCache->getLatestCipherKey(minDomainId); + Reference headerCipherKey = cipherKeyCache->getLatestCipherKey(ENCRYPT_HEADER_DOMAIN_ID); + const int bufLen = deterministicRandom()->randomInt(786, 2127) + 512; + Arena arena; + uint8_t iv[AES_256_IV_LENGTH]; + deterministicRandom()->randomBytes(&iv[0], AES_256_IV_LENGTH); + uint8_t orgData[bufLen]; + deterministicRandom()->randomBytes(&orgData[0], bufLen); + + EncryptBlobCipherAes265Ctr encryptor(cipherKey, + headerCipherKey, + iv, + AES_256_IV_LENGTH, + EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE, + authAlgo, + BlobCipherMetrics::TEST); + BlobCipherEncryptHeaderRef headerRef; + StringRef encryptedBuf = encryptor.encrypt(&orgData[0], bufLen, &headerRef, arena); + + ASSERT_EQ(encryptedBuf.size(), bufLen); + ASSERT_NE(memcmp(&orgData[0], encryptedBuf.begin(), bufLen), 0); + ASSERT_EQ(headerRef.flagsVersion(), CLIENT_KNOBS->ENCRYPT_HEADER_FLAGS_VERSION); + ASSERT_EQ(headerRef.algoHeaderVersion(), algoHeaderVersion); + + // validate flags + BlobCipherEncryptHeaderFlagsV1 flags = std::get(headerRef.flags); + ASSERT_EQ(flags.encryptMode, EncryptCipherMode::ENCRYPT_CIPHER_MODE_AES_256_CTR); + ASSERT_EQ(flags.authTokenMode, EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE); + ASSERT_EQ(flags.authTokenAlgo, authAlgo); + + // validate IV + AesCtrWithAuth withAuth = std::get>(headerRef.algoHeader); + ASSERT_EQ(memcmp(&iv[0], &withAuth.v1.iv[0], AES_256_IV_LENGTH), 0); + ASSERT_NE(memcmp(&orgData[0], encryptedBuf.begin(), bufLen), 0); + // validate cipherKey details + ASSERT_EQ(withAuth.v1.cipherTextDetails.encryptDomainId, cipherKey->getDomainId()); + ASSERT_EQ(withAuth.v1.cipherTextDetails.baseCipherId, cipherKey->getBaseCipherId()); + ASSERT_EQ(withAuth.v1.cipherTextDetails.salt, cipherKey->getSalt()); + ASSERT_EQ(withAuth.v1.cipherHeaderDetails.encryptDomainId, headerCipherKey->getDomainId()); + ASSERT_EQ(withAuth.v1.cipherHeaderDetails.baseCipherId, headerCipherKey->getBaseCipherId()); + ASSERT_EQ(withAuth.v1.cipherHeaderDetails.salt, headerCipherKey->getSalt()); + + Reference tCipherKey = cipherKeyCache->getCipherKey(withAuth.v1.cipherTextDetails.encryptDomainId, + withAuth.v1.cipherTextDetails.baseCipherId, + withAuth.v1.cipherTextDetails.salt); + Reference hCipherKey = cipherKeyCache->getCipherKey(withAuth.v1.cipherHeaderDetails.encryptDomainId, + withAuth.v1.cipherHeaderDetails.baseCipherId, + withAuth.v1.cipherHeaderDetails.salt); + ASSERT(tCipherKey->isEqual(cipherKey)); + ASSERT(hCipherKey->isEqual(headerCipherKey)); + DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, &withAuth.v1.iv[0], BlobCipherMetrics::TEST); + StringRef decryptedBuf = decryptor.decrypt(encryptedBuf.begin(), bufLen, headerRef, arena); + + ASSERT_EQ(decryptedBuf.size(), bufLen); + ASSERT_EQ(memcmp(decryptedBuf.begin(), &orgData[0], bufLen), 0); + + TraceEvent("TestConfigurableEncryptSingleAuthDecryptDone") + .detail("HeaderFlagsVersion", headerRef.flagsVersion()) + .detail("AlgoHeaderVersion", headerRef.algoHeaderVersion()) + .detail("HeaderEncryptMode", flags.encryptMode) + .detail("HeaderEncryptAuthTokenMode", flags.authTokenMode) + .detail("HeaderEncryptAuthTokenAlgo", flags.authTokenAlgo) + .detail("TextDomainId", withAuth.v1.cipherTextDetails.encryptDomainId) + .detail("TextBaseCipherId", withAuth.v1.cipherTextDetails.baseCipherId) + .detail("TextSalt", withAuth.v1.cipherTextDetails.salt) + .detail("HeaderDomainId", withAuth.v1.cipherHeaderDetails.encryptDomainId) + .detail("HeaderBaseCipherId", withAuth.v1.cipherHeaderDetails.baseCipherId) + .detail("HeaderSalt", withAuth.v1.cipherHeaderDetails.salt); + + // induce encryption header corruption - encryptionMode corrupted + BlobCipherEncryptHeaderRef corruptedHeaderRef = BlobCipherEncryptHeaderRef(headerRef); + BlobCipherEncryptHeaderFlagsV1 corruptedFlags = std::get(headerRef.flags); + corruptedFlags.encryptMode += 1; + corruptedHeaderRef.flags = corruptedFlags; + try { + encryptedBuf = encryptor.encrypt(&orgData[0], bufLen, &headerRef, arena); + DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, &iv[0], BlobCipherMetrics::TEST); + decryptedBuf = decryptor.decrypt(encryptedBuf.begin(), bufLen, corruptedHeaderRef, arena); + ASSERT(false); // error expected + } catch (Error& e) { + if (e.code() != error_code_encrypt_header_metadata_mismatch) { + throw; + } + TraceEvent("TestConfigurableEncryptionCorruptEncryptModeDone").detail("Mode", authAlgoStr); + } + + // induce encrypted buffer payload corruption + try { + encryptedBuf = encryptor.encrypt(&orgData[0], bufLen, &headerRef, arena); + uint8_t temp[bufLen]; + deterministicRandom()->randomBytes(temp, bufLen); + memcpy((void*)encryptedBuf.begin(), &temp[0], bufLen); + int tIdx = deterministicRandom()->randomInt(0, bufLen - 1); + temp[tIdx] += 1; + DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, &iv[0], BlobCipherMetrics::TEST); + decryptedBuf = decryptor.decrypt(&temp[0], bufLen, headerRef, arena); + ASSERT_NE(memcmp(decryptedBuf.begin(), &orgData[0], bufLen), 0); + } catch (Error& e) { + if (e.code() != error_code_encrypt_header_authtoken_mismatch) { + throw; + } + TraceEvent("TestConfigurableEncryptionCorruptPayloadDone").detail("Mode", authAlgoStr); + } + + // induce baseCipher payload corruption + try { + const bool corruptTextCipher = deterministicRandom()->coinflip(); + encryptedBuf = encryptor.encrypt(&orgData[0], bufLen, &headerRef, arena); + if (corruptTextCipher) { + Reference corruptedCipher = corruptCipherKey(tCipherKey); + DecryptBlobCipherAes256Ctr decryptor(corruptedCipher, hCipherKey, &iv[0], BlobCipherMetrics::TEST); + decryptedBuf = decryptor.decrypt(encryptedBuf.begin(), bufLen, headerRef, arena); + } else { + Reference corruptedCipher = corruptCipherKey(hCipherKey); + DecryptBlobCipherAes256Ctr decryptor(tCipherKey, corruptedCipher, &iv[0], BlobCipherMetrics::TEST); + decryptedBuf = decryptor.decrypt(encryptedBuf.begin(), bufLen, headerRef, arena); + } + ASSERT(false); // error expected + } catch (Error& e) { + ASSERT_EQ(e.code(), error_code_encrypt_key_check_value_mismatch); + TraceEvent("TestConfigurableEncryptionBaseCipherCorruptionDone").detail("Mode", authAlgoStr); + } + + TraceEvent("TestSingleAuthTokenConfigurableEncryptionEnd").detail("Mode", authAlgoStr); +} + +void testKeyCacheCleanup(const int minDomainId, const int maxDomainId) { + TraceEvent("BlobCipherTestKeyCacheCleanupStart"); + + Reference cipherKeyCache = BlobCipherKeyCache::getInstance(); + // Validate dropping encryptDomainId cached keys + const EncryptCipherDomainId candidate = deterministicRandom()->randomInt(minDomainId, maxDomainId); + cipherKeyCache->resetEncryptDomainId(candidate); + std::vector> cachedKeys = cipherKeyCache->getAllCiphers(candidate); + ASSERT(cachedKeys.empty()); + + // Validate dropping all cached cipherKeys + cipherKeyCache->cleanup(); + for (int dId = minDomainId; dId < maxDomainId; dId++) { + std::vector> cachedKeys = cipherKeyCache->getAllCiphers(dId); + ASSERT(cachedKeys.empty()); + } + + TraceEvent("BlobCipherTestKeyCacheCleanupDone"); +} + +void testEncryptInplaceNoAuthMode(const int minDomainId) { + TraceEvent("EncryptInplaceStart"); + + auto& g_knobs = IKnobCollection::getMutableGlobalKnobCollection(); + g_knobs.setKnob("encrypt_inplace_enabled", KnobValueRef::create(bool{ true })); + + Reference cipherKeyCache = BlobCipherKeyCache::getInstance(); + + // Validate Encryption ops + Reference cipherKey = cipherKeyCache->getLatestCipherKey(minDomainId); + Reference headerCipherKey = cipherKeyCache->getLatestCipherKey(ENCRYPT_HEADER_DOMAIN_ID); + const int bufLen = deterministicRandom()->randomInt(786, 2127) + 512; + // allocate the data align with AES_BLOCK_SIZE, encryption starts from orgData[1] so it's not aligned. + alignas(AES_BLOCK_SIZE) uint8_t orgData[bufLen + 1]; + uint8_t* plaintext = &orgData[1]; + deterministicRandom()->randomBytes(plaintext, bufLen); + uint8_t dataClone[bufLen]; + memcpy(dataClone, plaintext, bufLen); + + Arena arena; + uint8_t iv[AES_256_IV_LENGTH]; + deterministicRandom()->randomBytes(&iv[0], AES_256_IV_LENGTH); + + EncryptBlobCipherAes265Ctr encryptor(cipherKey, + headerCipherKey, + iv, + AES_256_IV_LENGTH, + EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE, + BlobCipherMetrics::TEST); + + BlobCipherEncryptHeaderRef headerRef; + encryptor.encryptInplace(plaintext, bufLen, &headerRef); + + // validate header version details + AesCtrNoAuth noAuth = std::get(headerRef.algoHeader); + Reference tCipherKey = cipherKeyCache->getCipherKey(noAuth.v1.cipherTextDetails.encryptDomainId, + noAuth.v1.cipherTextDetails.baseCipherId, + noAuth.v1.cipherTextDetails.salt); + ASSERT(tCipherKey->isEqual(cipherKey)); + DecryptBlobCipherAes256Ctr decryptor( + tCipherKey, Reference(), &noAuth.v1.iv[0], BlobCipherMetrics::TEST); + + decryptor.decryptInplace(plaintext, bufLen, headerRef); + ASSERT_EQ(memcmp(dataClone, plaintext, bufLen), 0); + + TraceEvent("EncryptInplaceDone"); +} + +template +void testEncryptInplaceSingleAuthMode(const int minDomainId) { + constexpr bool isHmac = std::is_same_v; + const std::string authAlgoStr = isHmac ? "HMAC-SHA" : "AES-CMAC"; + const EncryptAuthTokenAlgo authAlgo = isHmac ? EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA + : EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC; + + TraceEvent("BlobCipherTestEncryptInplaceSingleAuthStart").detail("Mode", authAlgoStr); + + Reference cipherKeyCache = BlobCipherKeyCache::getInstance(); + + // Validate Encryption ops + Reference cipherKey = cipherKeyCache->getLatestCipherKey(minDomainId); + Reference headerCipherKey = cipherKeyCache->getLatestCipherKey(ENCRYPT_HEADER_DOMAIN_ID); + const int bufLen = deterministicRandom()->randomInt(786, 2127) + 512; + Arena arena; + uint8_t iv[AES_256_IV_LENGTH]; + deterministicRandom()->randomBytes(&iv[0], AES_256_IV_LENGTH); + uint8_t orgData[bufLen + 100]; + memset(orgData + bufLen, 0, 100); + deterministicRandom()->randomBytes(&orgData[0], bufLen); + uint8_t dataClone[bufLen]; + memcpy(dataClone, orgData, bufLen); + + EncryptBlobCipherAes265Ctr encryptor(cipherKey, + headerCipherKey, + iv, + AES_256_IV_LENGTH, + EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE, + authAlgo, + BlobCipherMetrics::TEST); + BlobCipherEncryptHeader header; + encryptor.encryptInplace(&orgData[0], bufLen, &header); + uint8_t empty_buff[100]; + memset(empty_buff, 0, 100); + + Reference tCipherKey = cipherKeyCache->getCipherKey( + header.cipherTextDetails.encryptDomainId, header.cipherTextDetails.baseCipherId, header.cipherTextDetails.salt); + Reference hCipherKey = cipherKeyCache->getCipherKey(header.cipherHeaderDetails.encryptDomainId, + header.cipherHeaderDetails.baseCipherId, + header.cipherHeaderDetails.salt); + + DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, header.iv, BlobCipherMetrics::TEST); + decryptor.decryptInplace(&orgData[0], bufLen, header); + ASSERT_EQ(memcmp(dataClone, &orgData[0], bufLen), 0); + + TraceEvent("BlobCipherTestEncryptInplaceSingleAuthEnd").detail("Mode", authAlgoStr); +} + +TEST_CASE("/blobCipher") { + DomainKeyMap domainKeyMap; + auto& g_knobs = IKnobCollection::getMutableGlobalKnobCollection(); + g_knobs.setKnob("enable_configurable_encryption", KnobValueRef::create(bool{ true })); + + const EncryptCipherDomainId minDomainId = 1; + const EncryptCipherDomainId maxDomainId = deterministicRandom()->randomInt(minDomainId, minDomainId + 10) + 5; + const EncryptCipherBaseKeyId minBaseCipherKeyId = 100; + const EncryptCipherBaseKeyId maxBaseCipherKeyId = + deterministicRandom()->randomInt(minBaseCipherKeyId, minBaseCipherKeyId + 50) + 15; + for (int dId = minDomainId; dId <= maxDomainId; dId++) { + for (int kId = minBaseCipherKeyId; kId <= maxBaseCipherKeyId; kId++) { + domainKeyMap[dId].emplace( + kId, + makeReference( + dId, kId, std::numeric_limits::max(), std::numeric_limits::max())); + } + } + ASSERT_EQ(domainKeyMap.size(), maxDomainId); + + testMaxBaseCipherLen(); + + testKeyCacheEssentials(domainKeyMap, minDomainId, maxDomainId, minBaseCipherKeyId); + testKeyCacheRefreshExpireCipherKey(domainKeyMap, maxDomainId); + + testConfigurableEncryptionBlobCipherHeaderFlagsV1Ser(); + testConfigurableEncryptionAesCtrNoAuthV1Ser(minDomainId); + testConfigurableEncryptionAesCtrWithAuthSer(minDomainId); + testConfigurableEncryptionAesCtrWithAuthSer(minDomainId); + + testConfigurableEncryptionHeaderNoAuthMode(minDomainId); + testConfigurableEncryptionHeaderSingleAuthMode(minDomainId); + testConfigurableEncryptionHeaderSingleAuthMode(minDomainId); + + testNoAuthMode(minDomainId); + testSingleAuthMode(minDomainId); + testSingleAuthMode(minDomainId); + + testConfigurableEncryptionNoAuthMode(minDomainId); + testConfigurableEncryptionSingleAuthMode(minDomainId); + testConfigurableEncryptionSingleAuthMode(minDomainId); + + testEncryptInplaceNoAuthMode(minDomainId); + testEncryptInplaceSingleAuthMode(minDomainId); + testEncryptInplaceSingleAuthMode(minDomainId); + + testKeyCacheCleanup(minDomainId, maxDomainId); + + return Void(); +} diff --git a/src/fdbclient/BlobConnectionProvider.cpp b/src/fdbclient/BlobConnectionProvider.cpp new file mode 100644 index 0000000..76e3029 --- /dev/null +++ b/src/fdbclient/BlobConnectionProvider.cpp @@ -0,0 +1,167 @@ +/* + * BlobConnectionProvider.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include + +#include "flow/IRandom.h" +#include "fdbclient/BlobConnectionProvider.h" + +struct SingleBlobConnectionProvider : BlobConnectionProvider { +public: + std::pair, std::string> createForWrite(std::string newFileName) { + return std::pair(conn, newFileName); + } + + Reference getForRead(std::string filePath) { return conn; } + + SingleBlobConnectionProvider(std::string url, bool useBackupPath) { + conn = BackupContainerFileSystem::openContainerFS(url, {}, {}, useBackupPath); + } + + bool needsRefresh() const { return false; } + + bool isExpired() const { return false; } + + void update(Standalone newBlobMetadata) { ASSERT(false); } + +private: + Reference conn; +}; + +struct PartitionedBlobConnectionProvider : BlobConnectionProvider { + std::pair, std::string> createForWrite(std::string newFileName) { + // choose a partition randomly, to distribute load + int writePartition = deterministicRandom()->randomInt(0, metadata.partitions.size()); + return std::pair(conn, metadata.partitions[writePartition].toString() + newFileName); + } + + Reference getForRead(std::string filePath) { + CODE_PROBE(isExpired(), "partitioned blob connection using expired blob metadata for read!"); + return conn; + } + + void updateMetadata(const Standalone& newMetadata, bool checkPrevious) { + ASSERT(newMetadata.base.present()); + ASSERT(newMetadata.partitions.size() >= 2); + for (auto& it : newMetadata.partitions) { + // these should be suffixes, not whole blob urls + ASSERT(it.toString().find("://") == std::string::npos); + } + if (checkPrevious) { + if (newMetadata.expireAt <= metadata.expireAt) { + return; + } + // FIXME: validate only the credentials changed and the location is the same + ASSERT(newMetadata.partitions.size() == metadata.partitions.size()); + for (int i = 0; i < newMetadata.partitions.size(); i++) { + ASSERT(newMetadata.partitions[i] == metadata.partitions[i]); + } + } + metadata = newMetadata; + conn = BackupContainerFileSystem::openContainerFS(metadata.base.get().toString(), {}, {}, false); + } + + PartitionedBlobConnectionProvider(const Standalone metadata) { + updateMetadata(metadata, false); + } + + bool needsRefresh() const { return now() >= metadata.refreshAt; } + + bool isExpired() const { return now() >= metadata.expireAt; } + + void update(Standalone newBlobMetadata) { updateMetadata(newBlobMetadata, true); } + +private: + Standalone metadata; + Reference conn; +}; + +// Could always include number of partitions as validation in sanity check or something? +// Ex: partition_numPartitions/filename instead of partition/filename +struct StorageLocationBlobConnectionProvider : BlobConnectionProvider { + std::pair, std::string> createForWrite(std::string newFileName) { + // choose a partition randomly, to distribute load + int writePartition = deterministicRandom()->randomInt(0, partitions.size()); + // include partition information in the filename + return std::pair(partitions[writePartition], std::to_string(writePartition) + "/" + newFileName); + } + + Reference getForRead(std::string filePath) { + CODE_PROBE(isExpired(), "storage location blob connection using expired blob metadata for read!"); + size_t slash = filePath.find("/"); + ASSERT(slash != std::string::npos); + int partition = stoi(filePath.substr(0, slash)); + ASSERT(partition >= 0); + ASSERT(partition < partitions.size()); + return partitions[partition]; + } + + void updateMetadata(const Standalone& newMetadata, bool checkPrevious) { + ASSERT(!newMetadata.base.present()); + ASSERT(newMetadata.partitions.size() >= 2); + if (checkPrevious) { + // FIXME: validate only the credentials changed and the locations are the same + ASSERT(newMetadata.partitions.size() == partitions.size()); + if (newMetadata.expireAt <= metadata.expireAt) { + return; + } + } + metadata = newMetadata; + partitions.clear(); + for (auto& it : metadata.partitions) { + // these should be whole blob urls + ASSERT(it.toString().find("://") != std::string::npos); + partitions.push_back(BackupContainerFileSystem::openContainerFS(it.toString(), {}, {}, false)); + } + } + + StorageLocationBlobConnectionProvider(const Standalone metadata) { + updateMetadata(metadata, false); + } + + bool needsRefresh() const { return now() >= metadata.refreshAt; } + + bool isExpired() const { return now() >= metadata.expireAt; } + + void update(Standalone newBlobMetadata) { updateMetadata(newBlobMetadata, true); } + +private: + Standalone metadata; + std::vector> partitions; +}; + +Reference BlobConnectionProvider::newBlobConnectionProvider(std::string blobUrl) { + // still use backup mode path for backwards compatibility with 71.2 + return makeReference(blobUrl, true); +} + +Reference BlobConnectionProvider::newBlobConnectionProvider( + Standalone blobMetadata) { + if (blobMetadata.partitions.empty()) { + return makeReference(blobMetadata.base.get().toString(), false); + } else { + ASSERT(blobMetadata.partitions.size() >= 2); + if (blobMetadata.base.present()) { + return makeReference(blobMetadata); + } else { + return makeReference(blobMetadata); + } + } +} \ No newline at end of file diff --git a/src/fdbclient/BlobGranuleCommon.cpp b/src/fdbclient/BlobGranuleCommon.cpp new file mode 100644 index 0000000..44f32bc --- /dev/null +++ b/src/fdbclient/BlobGranuleCommon.cpp @@ -0,0 +1,45 @@ +/* + * BlobGranuleCommon.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/BlobGranuleCommon.h" + +BlobGranuleSummaryRef summarizeGranuleChunk(Arena& ar, const BlobGranuleChunkRef& chunk) { + BlobGranuleSummaryRef summary; + ASSERT(chunk.snapshotFile.present()); + ASSERT(chunk.snapshotVersion != invalidVersion); + ASSERT(chunk.includedVersion >= chunk.snapshotVersion); + ASSERT(chunk.newDeltas.empty()); + + if (chunk.tenantPrefix.present()) { + summary.keyRange = KeyRangeRef(ar, chunk.keyRange.removePrefix(chunk.tenantPrefix.get())); + } else { + summary.keyRange = KeyRangeRef(ar, chunk.keyRange); + } + + summary.snapshotVersion = chunk.snapshotVersion; + summary.snapshotSize = chunk.snapshotFile.get().length; + summary.deltaVersion = chunk.includedVersion; + summary.deltaSize = 0; + for (auto& it : chunk.deltaFiles) { + summary.deltaSize += it.length; + } + + return summary; +} \ No newline at end of file diff --git a/src/fdbclient/BlobGranuleCommon.h b/src/fdbclient/BlobGranuleCommon.h deleted file mode 100644 index 9707432..0000000 --- a/src/fdbclient/BlobGranuleCommon.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * BlobGranuleCommon.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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. - */ - -#ifndef FDBCLIENT_BLOBGRANULECOMMON_H -#define FDBCLIENT_BLOBGRANULECOMMON_H -#pragma once - -#include - -#include "fdbclient/CommitTransaction.h" -#include "fdbclient/FDBTypes.h" - -// file format of actual blob files -struct GranuleSnapshot : VectorRef { - - constexpr static FileIdentifier file_identifier = 1300395; - - template - void serialize(Ar& ar) { - serializer(ar, ((VectorRef&)*this)); - } -}; - -struct GranuleDeltas : VectorRef { - constexpr static FileIdentifier file_identifier = 8563013; - - template - void serialize(Ar& ar) { - serializer(ar, ((VectorRef&)*this)); - } -}; - -struct BlobFilePointerRef { - constexpr static FileIdentifier file_identifier = 5253554; - StringRef filename; - int64_t offset; - int64_t length; - int64_t fullFileLength; - - BlobFilePointerRef() {} - BlobFilePointerRef(Arena& to, const std::string& filename, int64_t offset, int64_t length, int64_t fullFileLength) - : filename(to, filename), offset(offset), length(length), fullFileLength(fullFileLength) {} - - template - void serialize(Ar& ar) { - serializer(ar, filename, offset, length, fullFileLength); - } - - std::string toString() const { - std::stringstream ss; - ss << filename.toString() << ":" << offset << ":" << length << ":" << fullFileLength; - return std::move(ss).str(); - } -}; - -// the assumption of this response is that the client will deserialize the files and apply the mutations themselves -// TODO could filter out delta files that don't intersect the key range being requested? -// TODO since client request passes version, we don't need to include the version of each mutation in the response if we -// pruned it there -struct BlobGranuleChunkRef { - constexpr static FileIdentifier file_identifier = 865198; - KeyRangeRef keyRange; - Version includedVersion; - Version snapshotVersion; - Optional snapshotFile; // not set if it's an incremental read - VectorRef deltaFiles; - GranuleDeltas newDeltas; - - template - void serialize(Ar& ar) { - serializer(ar, keyRange, includedVersion, snapshotVersion, snapshotFile, deltaFiles, newDeltas); - } -}; - -enum BlobGranuleSplitState { Unknown = 0, Initialized = 1, Assigned = 2, Done = 3 }; - -struct BlobGranuleHistoryValue { - constexpr static FileIdentifier file_identifier = 991434; - UID granuleID; - VectorRef> parentGranules; - - template - void serialize(Ar& ar) { - serializer(ar, granuleID, parentGranules); - } -}; - -#endif diff --git a/src/fdbclient/BlobGranuleFiles.cpp b/src/fdbclient/BlobGranuleFiles.cpp index 65e2e99..24063e6 100644 --- a/src/fdbclient/BlobGranuleFiles.cpp +++ b/src/fdbclient/BlobGranuleFiles.cpp @@ -18,469 +18,3615 @@ * limitations under the License. */ -#include - -#include "fmt/format.h" -#include "flow/serialize.h" #include "fdbclient/BlobGranuleFiles.h" + +#include "fdbclient/BlobCipher.h" +#include "fdbclient/BlobGranuleCommon.h" +#include "fdbclient/ClientKnobs.h" +#include "fdbclient/CommitTransaction.h" #include "fdbclient/Knobs.h" #include "fdbclient/SystemData.h" // for allKeys unit test - could remove + +#include "flow/Arena.h" +#include "flow/CompressionUtils.h" +#include "flow/DeterministicRandom.h" +#include "flow/EncryptUtils.h" +#include "flow/IRandom.h" +#include "flow/Knobs.h" +#include "flow/Trace.h" +#include "flow/serialize.h" #include "flow/UnitTest.h" -#define BG_READ_DEBUG false +#include "fmt/format.h" + +#include +#include // for perf microbenchmark +#include +#include -// FIXME: implement actual proper file format for this +#define BG_READ_DEBUG false +#define BG_FILES_TEST_DEBUG false // Implements granule file parsing and materialization with normal c++ functions (non-actors) so that this can be used // outside the FDB network thread. -static Arena loadSnapshotFile(const StringRef& snapshotData, - KeyRangeRef keyRange, - std::map& dataMap) { +// File Format stuff + +// Version info for file format of chunked files. +uint16_t LATEST_BG_FORMAT_VERSION = 1; +uint16_t MIN_SUPPORTED_BG_FORMAT_VERSION = 1; + +// TODO combine with SystemData? These don't actually have to match though + +const uint8_t SNAPSHOT_FILE_TYPE = 'S'; +const uint8_t DELTA_FILE_TYPE = 'D'; + +// Deltas in key order - Arena parseArena; - GranuleSnapshot snapshot; - ObjectReader reader(snapshotData.begin(), Unversioned()); - reader.deserialize(FileIdentifierFor::value, snapshot, parseArena); +// For key-ordered delta files, the format for both sets and range clears is that you store boundaries ordered by key. +// Each boundary has a corresponding key, zero or more versioned updates (ValueAndVersionRef), and optionally a clear +// from keyAfter(key) to the next boundary, at a version. +// A streaming merge is more efficient than applying deltas one by one to restore to a later version from the snapshot. +// The concept of this versioned mutation boundaries is repurposed directly from a prior version of redwood, back when +// it supported versioned data. +struct ValueAndVersionRef { + Version version; + MutationRef::Type op; // only set/clear + ValueRef value; // only present for set - // TODO REMOVE sanity check eventually - for (int i = 0; i < snapshot.size() - 1; i++) { - if (snapshot[i].key >= snapshot[i + 1].key) { - printf("BG SORT ORDER VIOLATION IN SNAPSHOT FILE: '%s', '%s'\n", - snapshot[i].key.printable().c_str(), - snapshot[i + 1].key.printable().c_str()); + ValueAndVersionRef() {} + // create clear + explicit ValueAndVersionRef(Version version) : version(version), op(MutationRef::Type::ClearRange) {} + // create set + explicit ValueAndVersionRef(Version version, ValueRef value) + : version(version), op(MutationRef::Type::SetValue), value(value) {} + ValueAndVersionRef(Arena& arena, const ValueAndVersionRef& copyFrom) + : version(copyFrom.version), op(copyFrom.op), value(arena, copyFrom.value) {} + + bool isSet() const { return op == MutationRef::SetValue; } + bool isClear() const { return op == MutationRef::ClearRange; } + + int totalSize() const { return sizeof(ValueAndVersionRef) + value.size(); } + int expectedSize() const { return value.size(); } + + struct OrderByVersion { + bool operator()(ValueAndVersionRef const& a, ValueAndVersionRef const& b) const { + return a.version < b.version; } - ASSERT(snapshot[i].key < snapshot[i + 1].key); + }; + + template + void serialize(Ar& ar) { + serializer(ar, version, op, value); } +}; - int i = 0; - while (i < snapshot.size() && snapshot[i].key < keyRange.begin) { - /*if (snapshot.size() < 10) { // debug - printf(" Pruning %s < %s\n", snapshot[i].key.printable().c_str(), keyRange.begin.printable().c_str()); - }*/ - i++; +// Effectively the single DeltaBoundaryRef reduced to one update, but also with the key and clear after information. +// Sometimes at a given version, the boundary may only be necessary to represent a clear version after this key, or just +// an update/clear to this key, or both. +struct ParsedDeltaBoundaryRef { + KeyRef key; + MutationRef::Type op; // SetValue, ClearRange, or NoOp + ValueRef value; // null unless op == SetValue + bool clearAfter; + + // op constructor + ParsedDeltaBoundaryRef() {} + explicit ParsedDeltaBoundaryRef(KeyRef key, bool clearAfter, const ValueAndVersionRef& valueAndVersion) + : key(key), op(valueAndVersion.op), value(valueAndVersion.value), clearAfter(clearAfter) {} + // noop constructor + explicit ParsedDeltaBoundaryRef(KeyRef key, bool clearAfter) + : key(key), op(MutationRef::Type::NoOp), clearAfter(clearAfter) {} + // from snapshot set constructor + explicit ParsedDeltaBoundaryRef(const KeyValueRef& kv) + : key(kv.key), op(MutationRef::Type::SetValue), value(kv.value), clearAfter(false) {} + + ParsedDeltaBoundaryRef(Arena& arena, const ParsedDeltaBoundaryRef& copyFrom) + : key(arena, copyFrom.key), op(copyFrom.op), clearAfter(copyFrom.clearAfter) { + if (copyFrom.isSet()) { + value = StringRef(arena, copyFrom.value); + } } - while (i < snapshot.size() && snapshot[i].key < keyRange.end) { - dataMap.insert({ snapshot[i].key, snapshot[i].value }); - /*if (snapshot.size() < 10) { // debug - printf(" Including %s\n", snapshot[i].key.printable().c_str()); - }*/ - i++; + + bool isSet() const { return op == MutationRef::SetValue; } + bool isClear() const { return op == MutationRef::ClearRange; } + bool isNoOp() const { return op == MutationRef::NoOp; } + bool redundant(bool prevClearAfter) const { return op == MutationRef::Type::NoOp && clearAfter == prevClearAfter; } +}; + +struct DeltaBoundaryRef { + // key + KeyRef key; + // updates to exactly this key + VectorRef values; + // clear version from keyAfter(key) up to the next boundary + Optional clearVersion; + + DeltaBoundaryRef() {} + DeltaBoundaryRef(Arena& ar, const DeltaBoundaryRef& copyFrom) + : key(ar, copyFrom.key), values(ar, copyFrom.values), clearVersion(copyFrom.clearVersion) {} + + int totalSize() { return sizeof(DeltaBoundaryRef) + key.expectedSize() + values.expectedSize(); } + int expectedSize() const { return key.expectedSize() + values.expectedSize(); } + + template + void serialize(Ar& ar) { + serializer(ar, key, values, clearVersion); } - /*if (snapshot.size() < 10) { // debug - while (i < snapshot.size()) { - printf(" Pruning %s >= %s\n", snapshot[i].key.printable().c_str(), keyRange.end.printable().c_str()); - i++; - } - }*/ - if (BG_READ_DEBUG) { - fmt::print("Started with {0} rows from snapshot after pruning to [{1} - {2})\n", - dataMap.size(), - keyRange.begin.printable(), - keyRange.end.printable()); +}; + +struct GranuleSortedDeltas { + constexpr static FileIdentifier file_identifier = 8183903; + + VectorRef boundaries; + + template + void serialize(Ar& ar) { + serializer(ar, boundaries); } +}; - return parseArena; -} +struct ChildBlockPointerRef { + StringRef key; + uint32_t offset; -static void applyDelta(KeyRangeRef keyRange, MutationRef m, std::map& dataMap) { - if (m.type == MutationRef::ClearRange) { - if (m.param2 <= keyRange.begin || m.param1 >= keyRange.end) { - return; - } - // keyRange is inclusive on start, lower_bound is inclusive with the argument, and erase is inclusive for the - // begin. So if lower bound didn't find the exact key, we need to go up one so it doesn't erase an extra key - // outside the range. - std::map::iterator itStart = dataMap.lower_bound(m.param1); - if (itStart != dataMap.end() && itStart->first < m.param1) { - itStart++; - } + ChildBlockPointerRef() {} + explicit ChildBlockPointerRef(StringRef key, uint32_t offset) : key(key), offset(offset) {} + explicit ChildBlockPointerRef(Arena& arena, StringRef key, uint32_t offset) : key(arena, key), offset(offset) {} - // keyRange is exclusive on end, lower bound is inclusive with the argument, and erase is exclusive for the end - // key. So if lower bound didn't find the exact key, we need to go up one so it doesn't skip the last key it - // should erase - std::map::iterator itEnd = dataMap.lower_bound(m.param2); - if (itEnd != dataMap.end() && itEnd->first < m.param2) { - itEnd++; - } - dataMap.erase(itStart, itEnd); - } else { - // We don't need atomics here since eager reads handles it - ASSERT(m.type == MutationRef::SetValue); - if (m.param1 < keyRange.begin || m.param1 >= keyRange.end) { - return; - } + template + void serialize(Ar& ar) { + serializer(ar, key, offset); + } - std::map::iterator it = dataMap.find(m.param1); - if (it == dataMap.end()) { - dataMap.insert({ m.param1, m.param2 }); - } else { - it->second = m.param2; + struct OrderByKey { + bool operator()(ChildBlockPointerRef const& a, ChildBlockPointerRef const& b) const { return a.key < b.key; } + }; + + struct OrderByKeyCommonPrefix { + int prefixLen; + OrderByKeyCommonPrefix(int prefixLen) : prefixLen(prefixLen) {} + bool operator()(ChildBlockPointerRef const& a, ChildBlockPointerRef const& b) const { + return a.key.compareSuffix(b.key, prefixLen); } - } + }; +}; + +namespace { +BlobGranuleFileEncryptionKeys getEncryptBlobCipherKey(const BlobGranuleCipherKeysCtx cipherKeysCtx) { + BlobGranuleFileEncryptionKeys eKeys; + + // Cipher key reconstructed is 'never' inserted into BlobCipherKey cache, choose 'neverExpire' + eKeys.textCipherKey = makeReference(cipherKeysCtx.textCipherKey.encryptDomainId, + cipherKeysCtx.textCipherKey.baseCipherId, + cipherKeysCtx.textCipherKey.baseCipher.begin(), + cipherKeysCtx.textCipherKey.baseCipher.size(), + cipherKeysCtx.textCipherKey.baseCipherKCV, + cipherKeysCtx.textCipherKey.salt, + std::numeric_limits::max(), + std::numeric_limits::max()); + eKeys.headerCipherKey = makeReference(cipherKeysCtx.headerCipherKey.encryptDomainId, + cipherKeysCtx.headerCipherKey.baseCipherId, + cipherKeysCtx.headerCipherKey.baseCipher.begin(), + cipherKeysCtx.headerCipherKey.baseCipher.size(), + cipherKeysCtx.headerCipherKey.baseCipherKCV, + cipherKeysCtx.headerCipherKey.salt, + std::numeric_limits::max(), + std::numeric_limits::max()); + + return eKeys; } -static void applyDeltas(const GranuleDeltas& deltas, - KeyRangeRef keyRange, - Version beginVersion, - Version readVersion, - Version& lastFileEndVersion, - std::map& dataMap) { - if (deltas.empty()) { - return; +void validateEncryptionHeaderDetails(const BlobGranuleFileEncryptionKeys& eKeys, + const BlobCipherEncryptHeader& header, + const StringRef& ivRef) { + // Validate encryption header 'cipherHeader' details sanity + if (header.cipherHeaderDetails.isValid() && header.cipherHeaderDetails != eKeys.headerCipherKey->details()) { + TraceEvent(SevError, "EncryptionHeader_CipherHeaderMismatch") + .detail("HeaderDomainId", eKeys.headerCipherKey->getDomainId()) + .detail("ExpectedHeaderDomainId", header.cipherHeaderDetails.encryptDomainId) + .detail("HeaderBaseCipherId", eKeys.headerCipherKey->getBaseCipherId()) + .detail("ExpectedHeaderBaseCipherId", header.cipherHeaderDetails.baseCipherId) + .detail("HeaderSalt", eKeys.headerCipherKey->getSalt()) + .detail("ExpectedHeaderSalt", header.cipherHeaderDetails.salt); + throw encrypt_header_metadata_mismatch(); } - // check that consecutive delta file versions are disjoint - ASSERT(lastFileEndVersion < deltas.front().version); - - const MutationsAndVersionRef* mutationIt = deltas.begin(); - // prune beginVersion if necessary - if (beginVersion > deltas.front().version) { - ASSERT(beginVersion <= deltas.back().version); - // binary search for beginVersion - mutationIt = std::lower_bound(deltas.begin(), - deltas.end(), - MutationsAndVersionRef(beginVersion, 0), - MutationsAndVersionRef::OrderByVersion()); + // Validate encryption header 'cipherText' details sanity + if (!header.cipherTextDetails.isValid() || header.cipherTextDetails != eKeys.textCipherKey->details()) { + TraceEvent(SevError, "EncryptionHeader_CipherTextMismatch") + .detail("TextDomainId", eKeys.textCipherKey->getDomainId()) + .detail("ExpectedTextDomainId", header.cipherTextDetails.encryptDomainId) + .detail("TextBaseCipherId", eKeys.textCipherKey->getBaseCipherId()) + .detail("ExpectedTextBaseCipherId", header.cipherTextDetails.baseCipherId) + .detail("TextSalt", eKeys.textCipherKey->getSalt()) + .detail("ExpectedTextSalt", header.cipherTextDetails.salt); + throw encrypt_header_metadata_mismatch(); + } + // Validate 'Initialization Vector' sanity + if (memcmp(ivRef.begin(), &header.iv[0], AES_256_IV_LENGTH) != 0) { + TraceEvent(SevError, "EncryptionHeader_IVMismatch") + .detail("IVChecksum", XXH3_64bits(ivRef.begin(), ivRef.size())) + .detail("ExpectedIVChecksum", XXH3_64bits(&header.iv[0], AES_256_IV_LENGTH)); + throw encrypt_header_metadata_mismatch(); } +} - while (mutationIt != deltas.end()) { - if (mutationIt->version > readVersion) { - lastFileEndVersion = readVersion; - return; - } - for (auto& m : mutationIt->mutations) { - applyDelta(keyRange, m, dataMap); - } - mutationIt++; +void validateEncryptionHeaderDetails(const BlobGranuleFileEncryptionKeys& eKeys, + const BlobCipherEncryptHeaderRef& headerRef, + const StringRef& ivRef) { + ASSERT(eKeys.textCipherKey.isValid()); + EncryptHeaderCipherKCVs kcvs; + + kcvs.textKCV = eKeys.textCipherKey->getBaseCipherKCV(); + if (eKeys.headerCipherKey.isValid()) { + kcvs.headerKCV = eKeys.headerCipherKey->getBaseCipherKCV(); } - lastFileEndVersion = deltas.back().version; + headerRef.validateEncryptionHeaderDetails(eKeys.textCipherKey->details(), + eKeys.headerCipherKey.isValid() ? eKeys.headerCipherKey->details() + : BlobCipherDetails(), + kcvs, + ivRef); } -static Arena loadDeltaFile(StringRef deltaData, - KeyRangeRef keyRange, - Version beginVersion, - Version readVersion, - Version& lastFileEndVersion, - std::map& dataMap) { - Arena parseArena; - GranuleDeltas deltas; - ObjectReader reader(deltaData.begin(), Unversioned()); - reader.deserialize(FileIdentifierFor::value, deltas, parseArena); +} // namespace - if (BG_READ_DEBUG) { - fmt::print("Parsed {} deltas from file\n", deltas.size()); +struct IndexBlock { + constexpr static FileIdentifier file_identifier = 6525412; + + // Serializable fields + VectorRef children; + + template + void serialize(Ar& ar) { + serializer(ar, children); } +}; - // TODO REMOVE sanity check - for (int i = 0; i < deltas.size() - 1; i++) { - if (deltas[i].version > deltas[i + 1].version) { - fmt::print( - "BG VERSION ORDER VIOLATION IN DELTA FILE: '{0}', '{1}'\n", deltas[i].version, deltas[i + 1].version); +struct IndexBlockRef { + constexpr static FileIdentifier file_identifier = 1945731; + + // Serialized fields + Optional encryptHeaderRef; + // Encrypted/unencrypted IndexBlock + StringRef buffer; + + // Non-serializable fields + IndexBlock block; + + void encrypt(const BlobGranuleCipherKeysCtx cipherKeysCtx, Arena& arena) { + BlobGranuleFileEncryptionKeys eKeys = getEncryptBlobCipherKey(cipherKeysCtx); + ASSERT(eKeys.headerCipherKey.isValid() && eKeys.textCipherKey.isValid()); + + if (BG_ENCRYPT_COMPRESS_DEBUG) { + XXH64_hash_t chksum = XXH3_64bits(buffer.begin(), buffer.size()); + TraceEvent(SevDebug, "IndexBlockEncrypt_Before").detail("Chksum", chksum); + } + + Value serializedBuff = ObjectWriter::toValue(block, IncludeVersion(ProtocolVersion::withBlobGranuleFile())); + EncryptBlobCipherAes265Ctr encryptor( + eKeys.textCipherKey, + eKeys.headerCipherKey, + cipherKeysCtx.ivRef.begin(), + AES_256_IV_LENGTH, + getEncryptAuthTokenMode(EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE), + BlobCipherMetrics::BLOB_GRANULE); + if (CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION) { + BlobCipherEncryptHeaderRef headerRef; + buffer = encryptor.encrypt( + serializedBuff.contents().begin(), serializedBuff.contents().size(), &headerRef, arena); + Standalone serialized = BlobCipherEncryptHeaderRef::toStringRef(headerRef); + arena.dependsOn(serialized.arena()); + encryptHeaderRef = serialized; + } else { + BlobCipherEncryptHeader header; + buffer = + encryptor.encrypt(serializedBuff.contents().begin(), serializedBuff.contents().size(), &header, arena) + ->toStringRef(); + encryptHeaderRef = BlobCipherEncryptHeader::toStringRef(header, arena); + } + + if (BG_ENCRYPT_COMPRESS_DEBUG) { + XXH64_hash_t chksum = XXH3_64bits(buffer.begin(), buffer.size()); + TraceEvent(SevDebug, "IndexBlockEncrypt_After").detail("Chksum", chksum); } - ASSERT(deltas[i].version <= deltas[i + 1].version); } - applyDeltas(deltas, keyRange, beginVersion, readVersion, lastFileEndVersion, dataMap); - return parseArena; -} + static void decrypt(const BlobGranuleCipherKeysCtx cipherKeysCtx, IndexBlockRef& idxRef, Arena& arena) { + BlobGranuleFileEncryptionKeys eKeys = getEncryptBlobCipherKey(cipherKeysCtx); -RangeResult materializeBlobGranule(const BlobGranuleChunkRef& chunk, - KeyRangeRef keyRange, - Version beginVersion, - Version readVersion, - Optional snapshotData, - StringRef deltaFileData[]) { - // TODO REMOVE with early replying - ASSERT(readVersion == chunk.includedVersion); + ASSERT(eKeys.headerCipherKey.isValid() && eKeys.textCipherKey.isValid()); + ASSERT(idxRef.encryptHeaderRef.present()); - // Arena to hold all allocations for applying deltas. Most of it, and the arenas produced by reading the files, - // will likely be tossed if there are a significant number of mutations, so we copy at the end instead of doing a - // dependsOn. - // FIXME: probably some threshold of a small percentage of the data is actually changed, where it makes sense to - // just to dependsOn instead of copy, to use a little extra memory footprint to help cpu? - Arena arena; - std::map dataMap; - Version lastFileEndVersion = invalidVersion; + if (BG_ENCRYPT_COMPRESS_DEBUG) { + XXH64_hash_t chksum = XXH3_64bits(idxRef.buffer.begin(), idxRef.buffer.size()); + TraceEvent(SevDebug, "IndexBlockEncrypt_Before").detail("Chksum", chksum); + } + StringRef decrypted; + if (CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION) { + BlobCipherEncryptHeaderRef headerRef = + BlobCipherEncryptHeaderRef::fromStringRef(idxRef.encryptHeaderRef.get()); + validateEncryptionHeaderDetails(eKeys, headerRef, cipherKeysCtx.ivRef); + DecryptBlobCipherAes256Ctr decryptor(eKeys.textCipherKey, + eKeys.headerCipherKey, + cipherKeysCtx.ivRef.begin(), + BlobCipherMetrics::BLOB_GRANULE); + decrypted = decryptor.decrypt(idxRef.buffer.begin(), idxRef.buffer.size(), headerRef, arena); + } else { + BlobCipherEncryptHeader header = BlobCipherEncryptHeader::fromStringRef(idxRef.encryptHeaderRef.get()); + validateEncryptionHeaderDetails(eKeys, header, cipherKeysCtx.ivRef); + DecryptBlobCipherAes256Ctr decryptor(eKeys.textCipherKey, + eKeys.headerCipherKey, + cipherKeysCtx.ivRef.begin(), + BlobCipherMetrics::BLOB_GRANULE); + decrypted = decryptor.decrypt(idxRef.buffer.begin(), idxRef.buffer.size(), header, arena)->toStringRef(); + } - if (snapshotData.present()) { - Arena snapshotArena = loadSnapshotFile(snapshotData.get(), keyRange, dataMap); - arena.dependsOn(snapshotArena); - } + if (BG_ENCRYPT_COMPRESS_DEBUG) { + XXH64_hash_t chksum = XXH3_64bits(decrypted.begin(), decrypted.size()); + TraceEvent(SevDebug, "IndexBlockEncrypt_After").detail("Chksum", chksum); + } - if (BG_READ_DEBUG) { - fmt::print("Applying {} delta files\n", chunk.deltaFiles.size()); + ObjectReader dataReader(decrypted.begin(), IncludeVersion()); + dataReader.deserialize(FileIdentifierFor::value, idxRef.block, arena); } - for (int deltaIdx = 0; deltaIdx < chunk.deltaFiles.size(); deltaIdx++) { - Arena deltaArena = - loadDeltaFile(deltaFileData[deltaIdx], keyRange, beginVersion, readVersion, lastFileEndVersion, dataMap); - arena.dependsOn(deltaArena); + + void init(Optional cipherKeysCtx, Arena& arena) { + if (encryptHeaderRef.present()) { + ASSERT(cipherKeysCtx.present()); + + decrypt(cipherKeysCtx.get(), *this, arena); + } else { + if (BG_ENCRYPT_COMPRESS_DEBUG) { + TraceEvent("IndexBlockSize").detail("Sz", buffer.size()); + } + + ObjectReader dataReader(buffer.begin(), IncludeVersion()); + dataReader.deserialize(FileIdentifierFor::value, block, arena); + } } - if (BG_READ_DEBUG) { - fmt::print("Applying {} memory deltas\n", chunk.newDeltas.size()); + + void finalize(Optional cipherKeysCtx, Arena& arena) { + if (cipherKeysCtx.present()) { + // IndexBlock childBlock pointers offsets are relative to IndexBlock endOffset instead of file start offset. + // Compressing indexBlock will need offset recalculation (circular depedency). IndexBlock size is bounded by + // number of chunks and sizeof(KeyPrefix), 'not' compressing IndexBlock shouldn't cause significant file + // size bloat. + CODE_PROBE(true, "encrypting index block"); + ASSERT(cipherKeysCtx.present()); + encrypt(cipherKeysCtx.get(), arena); + } else { + encryptHeaderRef.reset(); + buffer = StringRef( + arena, ObjectWriter::toValue(block, IncludeVersion(ProtocolVersion::withBlobGranuleFile())).contents()); + } + + if (BG_ENCRYPT_COMPRESS_DEBUG) { + TraceEvent(SevDebug, "IndexBlockSize") + .detail("Sz", buffer.size()) + .detail("Encrypted", cipherKeysCtx.present()); + } } - applyDeltas(chunk.newDeltas, keyRange, beginVersion, readVersion, lastFileEndVersion, dataMap); - RangeResult ret; - for (auto& it : dataMap) { - ret.push_back_deep(ret.arena(), KeyValueRef(it.first, it.second)); + template + void serialize(Ar& ar) { + serializer(ar, encryptHeaderRef, buffer); } +}; - return ret; -} +// On-disk and/or in-memory representation of a IndexBlobGranuleFile 'chunk'. +// +// Encryption: A 'chunk' gets encrypted before getting persisted if enabled. Encryption header is persisted along with +// the chunk data to assist decryption on reads. +// +// Compression: A 'chunk' gets compressed before getting persisted if enabled. Compression filter (algorithm) +// information is persisted as part of 'chunk metadata' to assist decompression on reads. -struct GranuleLoadIds { - Optional snapshotId; - std::vector deltaIds; -}; +struct IndexBlobGranuleFileChunkRef { + constexpr static FileIdentifier file_identifier = 2814019; -static void startLoad(const ReadBlobGranuleContext granuleContext, - const BlobGranuleChunkRef& chunk, - GranuleLoadIds& loadIds) { + // Serialized fields + Optional compressionFilter; + Optional encryptHeaderRef; + // encrypted and/or compressed chunk; + StringRef buffer; - // Start load process for all files in chunk - if (chunk.snapshotFile.present()) { - std::string snapshotFname = chunk.snapshotFile.get().filename.toString(); - // FIXME: remove when we implement file multiplexing - ASSERT(chunk.snapshotFile.get().offset == 0); - ASSERT(chunk.snapshotFile.get().length == chunk.snapshotFile.get().fullFileLength); - loadIds.snapshotId = granuleContext.start_load_f(snapshotFname.c_str(), - snapshotFname.size(), - chunk.snapshotFile.get().offset, - chunk.snapshotFile.get().length, - chunk.snapshotFile.get().fullFileLength, - granuleContext.userContext); - } - loadIds.deltaIds.reserve(chunk.deltaFiles.size()); - for (int deltaFileIdx = 0; deltaFileIdx < chunk.deltaFiles.size(); deltaFileIdx++) { - std::string deltaFName = chunk.deltaFiles[deltaFileIdx].filename.toString(); - // FIXME: remove when we implement file multiplexing - ASSERT(chunk.deltaFiles[deltaFileIdx].offset == 0); - ASSERT(chunk.deltaFiles[deltaFileIdx].length == chunk.deltaFiles[deltaFileIdx].fullFileLength); - int64_t deltaLoadId = granuleContext.start_load_f(deltaFName.c_str(), - deltaFName.size(), - chunk.deltaFiles[deltaFileIdx].offset, - chunk.deltaFiles[deltaFileIdx].length, - chunk.deltaFiles[deltaFileIdx].fullFileLength, - granuleContext.userContext); - loadIds.deltaIds.push_back(deltaLoadId); - } -} + // Non-serialized + Optional chunkBytes; -ErrorOr loadAndMaterializeBlobGranules(const Standalone>& files, - const KeyRangeRef& keyRange, - Version beginVersion, - Version readVersion, - ReadBlobGranuleContext granuleContext) { - int64_t parallelism = granuleContext.granuleParallelism; - if (parallelism < 1) { - parallelism = 1; - } - if (parallelism >= CLIENT_KNOBS->BG_MAX_GRANULE_PARALLELISM) { - parallelism = CLIENT_KNOBS->BG_MAX_GRANULE_PARALLELISM; - } + static void encrypt(const BlobGranuleCipherKeysCtx& cipherKeysCtx, + IndexBlobGranuleFileChunkRef& chunkRef, + Arena& arena) { + BlobGranuleFileEncryptionKeys eKeys = getEncryptBlobCipherKey(cipherKeysCtx); - GranuleLoadIds loadIds[files.size()]; + ASSERT(eKeys.headerCipherKey.isValid() && eKeys.textCipherKey.isValid()); - // Kick off first file reads if parallelism > 1 - for (int i = 0; i < parallelism - 1 && i < files.size(); i++) { - startLoad(granuleContext, files[i], loadIds[i]); + if (BG_ENCRYPT_COMPRESS_DEBUG) { + XXH64_hash_t chksum = XXH3_64bits(chunkRef.buffer.begin(), chunkRef.buffer.size()); + TraceEvent(SevDebug, "BlobChunkEncrypt_Before").detail("Chksum", chksum); + } + + EncryptBlobCipherAes265Ctr encryptor( + eKeys.textCipherKey, + eKeys.headerCipherKey, + cipherKeysCtx.ivRef.begin(), + AES_256_IV_LENGTH, + getEncryptAuthTokenMode(EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE), + BlobCipherMetrics::BLOB_GRANULE); + if (CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION) { + BlobCipherEncryptHeaderRef headerRef; + chunkRef.buffer = encryptor.encrypt(chunkRef.buffer.begin(), chunkRef.buffer.size(), &headerRef, arena); + Standalone serialized = BlobCipherEncryptHeaderRef::toStringRef(headerRef); + arena.dependsOn(serialized.arena()); + chunkRef.encryptHeaderRef = serialized; + } else { + BlobCipherEncryptHeader header; + chunkRef.buffer = + encryptor.encrypt(chunkRef.buffer.begin(), chunkRef.buffer.size(), &header, arena)->toStringRef(); + chunkRef.encryptHeaderRef = BlobCipherEncryptHeader::toStringRef(header, arena); + } + + if (BG_ENCRYPT_COMPRESS_DEBUG) { + XXH64_hash_t chksum = XXH3_64bits(chunkRef.buffer.begin(), chunkRef.buffer.size()); + TraceEvent(SevDebug, "BlobChunkEncrypt_After").detail("Chksum", chksum); + } } - try { - RangeResult results; - for (int chunkIdx = 0; chunkIdx < files.size(); chunkIdx++) { - // Kick off files for this granule if parallelism == 1, or future granule if parallelism > 1 - if (chunkIdx + parallelism - 1 < files.size()) { - startLoad(granuleContext, files[chunkIdx + parallelism - 1], loadIds[chunkIdx + parallelism - 1]); - } + static StringRef decrypt(const BlobGranuleCipherKeysCtx& cipherKeysCtx, + const IndexBlobGranuleFileChunkRef& chunkRef, + Arena& arena) { + BlobGranuleFileEncryptionKeys eKeys = getEncryptBlobCipherKey(cipherKeysCtx); - RangeResult chunkRows; + ASSERT(eKeys.headerCipherKey.isValid() && eKeys.textCipherKey.isValid()); + ASSERT(chunkRef.encryptHeaderRef.present()); - // once all loads kicked off, load data for chunk - Optional snapshotData; - if (files[chunkIdx].snapshotFile.present()) { - snapshotData = - StringRef(granuleContext.get_load_f(loadIds[chunkIdx].snapshotId.get(), granuleContext.userContext), - files[chunkIdx].snapshotFile.get().length); - if (!snapshotData.get().begin()) { - return ErrorOr(blob_granule_file_load_error()); - } - } + if (BG_ENCRYPT_COMPRESS_DEBUG) { + XXH64_hash_t chksum = XXH3_64bits(chunkRef.buffer.begin(), chunkRef.buffer.size()); + TraceEvent(SevDebug, "BlobChunkDecrypt_Before").detail("Chksum", chksum); + } - StringRef deltaData[files[chunkIdx].deltaFiles.size()]; - for (int i = 0; i < files[chunkIdx].deltaFiles.size(); i++) { - deltaData[i] = - StringRef(granuleContext.get_load_f(loadIds[chunkIdx].deltaIds[i], granuleContext.userContext), - files[chunkIdx].deltaFiles[i].length); - // null data is error - if (!deltaData[i].begin()) { - return ErrorOr(blob_granule_file_load_error()); - } - } + StringRef decrypted; + if (CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION) { + BlobCipherEncryptHeaderRef headerRef = + BlobCipherEncryptHeaderRef::fromStringRef(chunkRef.encryptHeaderRef.get()); + validateEncryptionHeaderDetails(eKeys, headerRef, cipherKeysCtx.ivRef); + DecryptBlobCipherAes256Ctr decryptor(eKeys.textCipherKey, + eKeys.headerCipherKey, + cipherKeysCtx.ivRef.begin(), + BlobCipherMetrics::BLOB_GRANULE); + decrypted = decryptor.decrypt(chunkRef.buffer.begin(), chunkRef.buffer.size(), headerRef, arena); + } else { + BlobCipherEncryptHeader header = BlobCipherEncryptHeader::fromStringRef(chunkRef.encryptHeaderRef.get()); + validateEncryptionHeaderDetails(eKeys, header, cipherKeysCtx.ivRef); + DecryptBlobCipherAes256Ctr decryptor(eKeys.textCipherKey, + eKeys.headerCipherKey, + cipherKeysCtx.ivRef.begin(), + BlobCipherMetrics::BLOB_GRANULE); + decrypted = + decryptor.decrypt(chunkRef.buffer.begin(), chunkRef.buffer.size(), header, arena)->toStringRef(); + } - // materialize rows from chunk - chunkRows = - materializeBlobGranule(files[chunkIdx], keyRange, beginVersion, readVersion, snapshotData, deltaData); + if (BG_ENCRYPT_COMPRESS_DEBUG) { + XXH64_hash_t chksum = XXH3_64bits(decrypted.begin(), decrypted.size()); + TraceEvent(SevDebug, "BlobChunkDecrypt_After").detail("Chksum", chksum); + } - results.arena().dependsOn(chunkRows.arena()); - results.append(results.arena(), chunkRows.begin(), chunkRows.size()); + return decrypted; + } - if (loadIds[chunkIdx].snapshotId.present()) { - granuleContext.free_load_f(loadIds[chunkIdx].snapshotId.get(), granuleContext.userContext); - } - for (int i = 0; i < loadIds[chunkIdx].deltaIds.size(); i++) { - granuleContext.free_load_f(loadIds[chunkIdx].deltaIds[i], granuleContext.userContext); - } + static void compress(IndexBlobGranuleFileChunkRef& chunkRef, + const Value& chunk, + const CompressionFilter compFilter, + Arena& arena) { + chunkRef.compressionFilter = compFilter; + chunkRef.buffer = CompressionUtils::compress(chunkRef.compressionFilter.get(), + chunk.contents(), + CompressionUtils::getDefaultCompressionLevel(compFilter), + arena); + + if (BG_ENCRYPT_COMPRESS_DEBUG) { + XXH64_hash_t chunkChksum = XXH3_64bits(chunk.contents().begin(), chunk.contents().size()); + XXH64_hash_t chksum = XXH3_64bits(chunkRef.buffer.begin(), chunkRef.buffer.size()); + TraceEvent("CompressBlobChunk") + .detail("Filter", CompressionUtils::toString(chunkRef.compressionFilter.get())) + .detail("ChkSumBefore", chunkChksum) + .detail("ChkSumAfter", chksum); } - return ErrorOr(results); - } catch (Error& e) { - return ErrorOr(e); } -} -TEST_CASE("/blobgranule/files/applyDelta") { - printf("Testing blob granule delta applying\n"); - Arena a; + static StringRef decompress(const IndexBlobGranuleFileChunkRef& chunkRef, Arena& arena) { + ASSERT(chunkRef.compressionFilter.present()); + return CompressionUtils::decompress(chunkRef.compressionFilter.get(), chunkRef.chunkBytes.get(), arena); + } - // do this 2 phase arena creation of string refs instead of LiteralStringRef because there is no char* StringRef - // constructor, and valgrind might complain if the stringref data isn't in the arena - std::string sk_a = "A"; - std::string sk_ab = "AB"; - std::string sk_b = "B"; - std::string sk_c = "C"; - std::string sk_z = "Z"; - std::string sval1 = "1"; - std::string sval2 = "2"; - - StringRef k_a = StringRef(a, sk_a); - StringRef k_ab = StringRef(a, sk_ab); - StringRef k_b = StringRef(a, sk_b); - StringRef k_c = StringRef(a, sk_c); - StringRef k_z = StringRef(a, sk_z); - StringRef val1 = StringRef(a, sval1); - StringRef val2 = StringRef(a, sval2); + static Value toBytes(Optional cipherKeysCtx, + Optional compFilter, + const Value& chunk, + Arena& arena) { + IndexBlobGranuleFileChunkRef chunkRef; - std::map data; - data.insert({ k_a, val1 }); - data.insert({ k_ab, val1 }); - data.insert({ k_b, val1 }); + if (compFilter.present()) { + IndexBlobGranuleFileChunkRef::compress(chunkRef, chunk, compFilter.get(), arena); + } else { + chunkRef.buffer = StringRef(arena, chunk.contents()); + } - std::map correctData = data; - std::map originalData = data; + if (cipherKeysCtx.present()) { + CODE_PROBE(true, "encrypting granule chunk"); + IndexBlobGranuleFileChunkRef::encrypt(cipherKeysCtx.get(), chunkRef, arena); + } - ASSERT(data == correctData); + if (BG_ENCRYPT_COMPRESS_DEBUG) { + TraceEvent(SevDebug, "GenerateBlobGranuleFileChunk") + .detail("Encrypt", cipherKeysCtx.present()) + .detail("Compress", compFilter.present()) + .detail("CompFilter", + compFilter.present() ? CompressionUtils::toString(compFilter.get()) + : CompressionUtils::toString(CompressionFilter::NONE)); + } - // test all clear permutations + return ObjectWriter::toValue(chunkRef, IncludeVersion(ProtocolVersion::withBlobGranuleFile())); + } - MutationRef mClearEverything(MutationRef::ClearRange, allKeys.begin, allKeys.end); - data = originalData; - correctData = originalData; - applyDelta(allKeys, mClearEverything, data); - correctData.clear(); - ASSERT(data == correctData); + static IndexBlobGranuleFileChunkRef fromBytes(Optional cipherKeysCtx, + StringRef buffer, + Arena& arena) { + IndexBlobGranuleFileChunkRef chunkRef; + ObjectReader dataReader(buffer.begin(), IncludeVersion()); + dataReader.deserialize(FileIdentifierFor::value, chunkRef, arena); - MutationRef mClearEverything2(MutationRef::ClearRange, allKeys.begin, k_c); - data = originalData; - correctData = originalData; + if (chunkRef.encryptHeaderRef.present()) { + ASSERT(cipherKeysCtx.present()); + chunkRef.chunkBytes = IndexBlobGranuleFileChunkRef::decrypt(cipherKeysCtx.get(), chunkRef, arena); + } else { + chunkRef.chunkBytes = chunkRef.buffer; + } + + if (chunkRef.compressionFilter.present()) { + chunkRef.chunkBytes = IndexBlobGranuleFileChunkRef::decompress(chunkRef, arena); + } else if (!chunkRef.chunkBytes.present()) { + // 'Encryption' & 'Compression' aren't enabled. + chunkRef.chunkBytes = chunkRef.buffer; + } + + ASSERT(chunkRef.chunkBytes.present()); + + if (BG_ENCRYPT_COMPRESS_DEBUG) { + TraceEvent(SevDebug, "ParseBlobGranuleFileChunk") + .detail("Encrypted", chunkRef.encryptHeaderRef.present()) + .detail("Compressed", chunkRef.compressionFilter.present()) + .detail("CompFilter", + chunkRef.compressionFilter.present() + ? CompressionUtils::toString(chunkRef.compressionFilter.get()) + : CompressionUtils::toString(CompressionFilter::NONE)); + } + + return chunkRef; + } + + template + void serialize(Ar& ar) { + serializer(ar, compressionFilter, encryptHeaderRef, buffer); + } +}; + +/* + * A file header for a key-ordered file that is chunked on disk, where each chunk is a disjoint key range of data. + */ +struct IndexedBlobGranuleFile { + constexpr static FileIdentifier file_identifier = 3828201; + // serialized fields + uint16_t formatVersion; + uint8_t fileType; + Optional filter; // not used currently + + IndexBlockRef indexBlockRef; + int chunkStartOffset; + + // Non-serialized member fields + StringRef fileBytes; + + void init(uint8_t fType, const Optional cipherKeysCtx) { + formatVersion = LATEST_BG_FORMAT_VERSION; + fileType = fType; + chunkStartOffset = -1; + } + + void init(const StringRef& fBytes, Arena& arena, const Optional cipherKeysCtx) { + ASSERT(chunkStartOffset > 0); + + fileBytes = fBytes; + indexBlockRef.init(cipherKeysCtx, arena); + } + + static Standalone fromFileBytes(const StringRef& fileBytes, + const Optional cipherKeysCtx) { + // parse index block at head of file + Arena arena; + IndexedBlobGranuleFile file; + ObjectReader dataReader(fileBytes.begin(), IncludeVersion()); + dataReader.deserialize(FileIdentifierFor::value, file, arena); + + file.init(fileBytes, arena, cipherKeysCtx); + + // do sanity checks + if (file.formatVersion > LATEST_BG_FORMAT_VERSION || file.formatVersion < MIN_SUPPORTED_BG_FORMAT_VERSION) { + TraceEvent(SevWarn, "BlobGranuleFileInvalidFormatVersion") + .suppressFor(5.0) + .detail("FoundFormatVersion", file.formatVersion) + .detail("MinSupported", MIN_SUPPORTED_BG_FORMAT_VERSION) + .detail("LatestSupported", LATEST_BG_FORMAT_VERSION); + throw unsupported_format_version(); + } + ASSERT(file.fileType == SNAPSHOT_FILE_TYPE || file.fileType == DELTA_FILE_TYPE); + + return Standalone(file, arena); + } + + ChildBlockPointerRef* findStartBlock(const KeyRef& beginKey) const { + ChildBlockPointerRef searchKey(beginKey, 0); + ChildBlockPointerRef* startBlock = (ChildBlockPointerRef*)std::lower_bound(indexBlockRef.block.children.begin(), + indexBlockRef.block.children.end(), + searchKey, + ChildBlockPointerRef::OrderByKey()); + + if (startBlock != indexBlockRef.block.children.end() && startBlock != indexBlockRef.block.children.begin() && + beginKey < startBlock->key) { + startBlock--; + } else if (startBlock == indexBlockRef.block.children.end()) { + startBlock--; + } + + return startBlock; + } + + // FIXME: implement some sort of iterator type interface? + template + Standalone getChild(const ChildBlockPointerRef* childPointer, + Optional cipherKeysCtx, + int startOffset) { + ASSERT(childPointer != indexBlockRef.block.children.end()); + const ChildBlockPointerRef* nextPointer = childPointer + 1; + ASSERT(nextPointer != indexBlockRef.block.children.end()); + + size_t blockSize = nextPointer->offset - childPointer->offset; + // Account for IndexBlockRef size for chunk offset computation + StringRef childData(fileBytes.begin() + childPointer->offset + startOffset, blockSize); + + if (BG_ENCRYPT_COMPRESS_DEBUG) { + TraceEvent(SevDebug, "GetChild") + .detail("BlkSize", blockSize) + .detail("Offset", childPointer->offset) + .detail("StartOffset", chunkStartOffset); + } + + Arena childArena; + IndexBlobGranuleFileChunkRef chunkRef = + IndexBlobGranuleFileChunkRef::fromBytes(cipherKeysCtx, childData, childArena); + + // TODO implement some sort of decrypted+decompressed+deserialized cache, if this object gets reused? + + BinaryReader br(chunkRef.chunkBytes.get(), IncludeVersion()); + Standalone child; + br >> child; + return child; + } + + template + void serialize(Ar& ar) { + serializer(ar, formatVersion, fileType, filter, indexBlockRef, chunkStartOffset); + } +}; + +// Since ObjectReader doesn't update read offset after reading, we have to make the block offsets absolute offsets by +// serializing once, adding the serialized size to each offset, and serializing again. This relies on the fact that +// ObjectWriter/flatbuffers uses fixed size integers instead of variable size. + +Value serializeIndexBlock(Standalone& file, Optional cipherKeysCtx) { + file.indexBlockRef.finalize(cipherKeysCtx, file.arena()); + + Value serialized = ObjectWriter::toValue(file, IncludeVersion(ProtocolVersion::withBlobGranuleFile())); + file.chunkStartOffset = serialized.contents().size(); + + if (BG_ENCRYPT_COMPRESS_DEBUG) { + TraceEvent(SevDebug, "SerializeIndexBlock").detail("StartOffset", file.chunkStartOffset); + } + + return ObjectWriter::toValue(file, IncludeVersion(ProtocolVersion::withBlobGranuleFile())); +} + +Value serializeFileFromChunks(Standalone& file, + Optional cipherKeysCtx, + std::vector& chunks, + int previousChunkBytes) { + Value indexBlockBytes = serializeIndexBlock(file, cipherKeysCtx); + int32_t indexSize = indexBlockBytes.size(); + chunks[0] = indexBlockBytes; + + // TODO: write this directly to stream to avoid extra copy? + Arena ret; + + size_t size = indexSize + previousChunkBytes; + uint8_t* buffer = new (ret) uint8_t[size]; + uint8_t* bufferStart = buffer; + + int idx = 0; + for (auto& it : chunks) { + if (BG_ENCRYPT_COMPRESS_DEBUG) { + TraceEvent(SevDebug, "SerializeFile") + .detail("ChunkIdx", idx++) + .detail("Size", it.size()) + .detail("Offset", buffer - bufferStart); + } + buffer = it.copyTo(buffer); + } + ASSERT(size == buffer - bufferStart); + + return Standalone(StringRef(bufferStart, size), ret); +} + +// TODO: this should probably be in actor file with yields? - move writing logic to separate actor file in server? +// TODO: optimize memory copying +// TODO: sanity check no oversized files +Value serializeChunkedSnapshot(const Standalone& fileNameRef, + const Standalone& snapshot, + int targetChunkBytes, + Optional compressFilter, + Optional cipherKeysCtx, + bool isSnapshotSorted) { + + if (BG_ENCRYPT_COMPRESS_DEBUG) { + TraceEvent(SevDebug, "SerializeChunkedSnapshot") + .detail("FileName", fileNameRef.toString()) + .detail("Encrypted", cipherKeysCtx.present()) + .detail("Compressed", compressFilter.present()); + } + + CODE_PROBE(compressFilter.present(), "serializing compressed snapshot file"); + CODE_PROBE(cipherKeysCtx.present(), "serializing encrypted snapshot file"); + Standalone file; + + file.init(SNAPSHOT_FILE_TYPE, cipherKeysCtx); + + size_t currentChunkBytesEstimate = 0; + size_t previousChunkBytes = 0; + + std::vector chunks; + chunks.push_back(Value()); // dummy value for index block + Standalone currentChunk; + + for (int i = 0; i < snapshot.size(); i++) { + // TODO REMOVE sanity check + if (i > 0 && isSnapshotSorted) { + ASSERT(snapshot[i - 1].key < snapshot[i].key); + } + + currentChunk.push_back_deep(currentChunk.arena(), snapshot[i]); + currentChunkBytesEstimate += snapshot[i].expectedSize(); + + if (currentChunkBytesEstimate >= targetChunkBytes || i == snapshot.size() - 1) { + Value serialized = + BinaryWriter::toValue(currentChunk, IncludeVersion(ProtocolVersion::withBlobGranuleFile())); + Value chunkBytes = + IndexBlobGranuleFileChunkRef::toBytes(cipherKeysCtx, compressFilter, serialized, file.arena()); + chunks.push_back(chunkBytes); + // TODO remove validation + if (!file.indexBlockRef.block.children.empty() && isSnapshotSorted) { + ASSERT(file.indexBlockRef.block.children.back().key < currentChunk.begin()->key); + } + file.indexBlockRef.block.children.emplace_back_deep( + file.arena(), currentChunk.begin()->key, previousChunkBytes); + + if (BG_ENCRYPT_COMPRESS_DEBUG) { + TraceEvent(SevDebug, "ChunkSize") + .detail("ChunkBytes", chunkBytes.size()) + .detail("PrvChunkBytes", previousChunkBytes); + } + + previousChunkBytes += chunkBytes.size(); + currentChunkBytesEstimate = 0; + currentChunk = Standalone(); + } + } + ASSERT(currentChunk.empty()); + // push back dummy last chunk to get last chunk size, and to know last key in last block without having to read it + if (!snapshot.empty()) { + file.indexBlockRef.block.children.emplace_back_deep( + file.arena(), keyAfter(snapshot.back().key), previousChunkBytes); + } + + return serializeFileFromChunks(file, cipherKeysCtx, chunks, previousChunkBytes); +} + +// TODO: use redwood prefix trick to optimize cpu comparison +static Standalone> loadSnapshotFile( + const Standalone& fileName, + const StringRef& snapshotData, + const KeyRangeRef& keyRange, + Optional cipherKeysCtx) { + Standalone> results; + + if (BG_ENCRYPT_COMPRESS_DEBUG) { + TraceEvent(SevDebug, "LoadChunkedSnapshot") + .detail("FileName", fileName.toString()) + .detail("RangeBegin", keyRange.begin.printable()) + .detail("RangeEnd", keyRange.end.printable()) + .detail("Encrypted", cipherKeysCtx.present()); + } + + Standalone file = IndexedBlobGranuleFile::fromFileBytes(snapshotData, cipherKeysCtx); + + ASSERT(file.fileType == SNAPSHOT_FILE_TYPE); + ASSERT(file.chunkStartOffset > 0); + + // empty snapshot file + if (file.indexBlockRef.block.children.empty()) { + return results; + } + + ASSERT(file.indexBlockRef.block.children.size() >= 2); + + // find range of blocks needed to read + ChildBlockPointerRef* currentBlock = file.findStartBlock(keyRange.begin); + + if (currentBlock == (file.indexBlockRef.block.children.end() - 1) || keyRange.end <= currentBlock->key) { + return results; + } + + bool lastBlock = false; + + // FIXME: shared prefix for key comparison + while (!lastBlock) { + auto nextBlock = currentBlock; + nextBlock++; + lastBlock = (nextBlock == (file.indexBlockRef.block.children.end() - 1)) || (keyRange.end <= nextBlock->key); + Standalone dataBlock = + file.getChild(currentBlock, cipherKeysCtx, file.chunkStartOffset); + ASSERT(!dataBlock.empty()); + ASSERT(currentBlock->key == dataBlock.front().key); + + bool anyRows = false; + for (auto& entry : dataBlock) { + if (!results.empty() && !lastBlock) { + // no key comparisons needed + results.emplace_back(results.arena(), entry); + anyRows = true; + } else if ((!results.empty() || entry.key >= keyRange.begin) && (!lastBlock || entry.key < keyRange.end)) { + results.emplace_back(results.arena(), entry); + anyRows = true; + } else if (!results.empty() && lastBlock) { + break; + } + } + if (anyRows) { + results.arena().dependsOn(dataBlock.arena()); + } + currentBlock++; + } + + return results; +} + +typedef std::map> SortedDeltasT; + +// FIXME: optimize all of this with common prefix comparison stuff +SortedDeltasT::iterator insertMutationBoundary(SortedDeltasT& deltasByKey, const KeyRef& boundary) { + // Find the first split point in buffer that is >= key + auto it = deltasByKey.lower_bound(boundary); + + // Since the map contains fileRange already, we had to have found something + ASSERT(it != deltasByKey.end()); + if (it->first == boundary) { + return it; + } + + // new boundary, using find as insert hint + it = deltasByKey.insert(it, { boundary, Standalone() }); + + // look back at previous entry to see if this boundary is already cleared to at a prior version + ASSERT(it != deltasByKey.begin()); + auto itPrev = it; + --itPrev; + + if (itPrev->second.clearVersion.present()) { + it->second.clearVersion = itPrev->second.clearVersion; + it->second.values.push_back(it->second.arena(), ValueAndVersionRef(it->second.clearVersion.get())); + } + + return it; +} + +void updateMutationBoundary(Standalone& boundary, const ValueAndVersionRef& update) { + if (update.isSet()) { + if (boundary.values.empty() || boundary.values.back().version < update.version) { + // duplicate same set even if it's the same as the last one, so beginVersion reads still get updates + boundary.values.push_back(boundary.arena(), update); + } else { + CODE_PROBE(true, "multiple boundary updates at same version (set)"); + // preserve inter-mutation order by replacing this one + boundary.values.back() = update; + } + } else { + if (boundary.values.empty() || + (boundary.values.back().isSet() && boundary.values.back().version < update.version)) { + // don't duplicate single-key clears in order if previous was also a clear, since it's a no-op when starting + // with beginVersion + boundary.values.push_back(boundary.arena(), update); + } else if (!boundary.values.empty() && boundary.values.back().version == update.version) { + CODE_PROBE(true, "multiple boundary updates at same version (clear)"); + if (boundary.values.back().isSet()) { + // if the last 2 updates were clear @ v1 and set @ v2, and we now have a clear at v2, just pop off the + // set and leave the previous clear. Otherwise, just set the last set to a clear + if (boundary.values.size() >= 2 && boundary.values[boundary.values.size() - 2].isClear()) { + CODE_PROBE(true, "clear then set/clear at same version optimization"); + boundary.values.pop_back(); + } else { + boundary.values.back() = update; + } + } // else we have 2 consecutive clears at this version, no-op + } + } +} + +void insertSortedDelta(const MutationRef& m, + const Version version, + const KeyRangeRef& fileRange, + SortedDeltasT& deltasByKey) { + // TODO REMOVE validation + ASSERT(fileRange.contains(m.param1)); + if (m.type == MutationRef::ClearRange) { + ASSERT(m.param2 <= fileRange.end); + // handle single key clear more efficiently + if (equalsKeyAfter(m.param1, m.param2)) { + SortedDeltasT::iterator key = insertMutationBoundary(deltasByKey, m.param1); + updateMutationBoundary(key->second, ValueAndVersionRef(version)); + } else { + // Update each boundary in the cleared range + SortedDeltasT::iterator begin = insertMutationBoundary(deltasByKey, m.param1); + SortedDeltasT::iterator end = insertMutationBoundary(deltasByKey, m.param2); + while (begin != end) { + // Set the rangeClearedVersion if not set + if (!begin->second.clearVersion.present()) { + begin->second.clearVersion = version; + } + + // Add a clear to values if it's empty or the last item is not a clear + if (begin->second.values.empty() || begin->second.values.back().isSet()) { + updateMutationBoundary(begin->second, ValueAndVersionRef(version)); + } + ++begin; + } + } + } else { + Standalone& bound = insertMutationBoundary(deltasByKey, m.param1)->second; + updateMutationBoundary(bound, ValueAndVersionRef(version, m.param2)); + } +} + +// TODO: investigate more cpu-efficient sorting methods. Potential options: +// 1) Replace std::map with ART mutation buffer +// 2) sort updates and clear endpoints by (key, version), and keep track of active clears. +void sortDeltasByKey(const Standalone& deltasByVersion, + const KeyRangeRef& fileRange, + SortedDeltasT& deltasByKey) { + if (deltasByVersion.empty()) { + return; + } + if (deltasByKey.empty()) { + deltasByKey.insert({ fileRange.begin, Standalone() }); + deltasByKey.insert({ fileRange.end, Standalone() }); + } + for (auto& it : deltasByVersion) { + for (auto& m : it.mutations) { + insertSortedDelta(m, it.version, fileRange, deltasByKey); + } + } + + // TODO: could do a scan through map and coalesce clears (if any boundaries with exactly 1 mutation (clear) and same + // clearVersion as previous guy) +} + +void sortDeltasByKey(const Standalone& deltasByVersion, const KeyRangeRef& fileRange) { + SortedDeltasT deltasByKey; + sortDeltasByKey(deltasByVersion, fileRange, deltasByKey); +} + +// FIXME: Could maybe reduce duplicated code between this and chunkedSnapshot for chunking +Value serializeChunkedDeltaFile(const Standalone& fileNameRef, + const Standalone& deltas, + const KeyRangeRef& fileRange, + int chunkSize, + Optional compressFilter, + Optional cipherKeysCtx) { + if (BG_ENCRYPT_COMPRESS_DEBUG) { + TraceEvent(SevDebug, "SerializeChunkedDelta") + .detail("Filename", fileNameRef.toString()) + .detail("RangeBegin", fileRange.begin.printable()) + .detail("RangeEnd", fileRange.end.printable()) + .detail("Encrypted", cipherKeysCtx.present()) + .detail("Compressed", compressFilter.present()); + } + + CODE_PROBE(compressFilter.present(), "serializing compressed delta file"); + CODE_PROBE(cipherKeysCtx.present(), "serializing encrypted delta file"); + Standalone file; + + file.init(DELTA_FILE_TYPE, cipherKeysCtx); + + // build in-memory version of boundaries - TODO separate functions + SortedDeltasT boundaries; + sortDeltasByKey(deltas, fileRange, boundaries); + + std::vector chunks; + chunks.push_back(Value()); // dummy value for index block + + Standalone currentChunk; + size_t currentChunkBytesEstimate = 0; + size_t previousChunkBytes = 0; + + // TODO REMOVE - for validation + KeyRef lastKey; + int i = 0; + for (auto& it : boundaries) { + // TODO REMOVE sanity check + if (i > 0) { + ASSERT(lastKey < it.first); + } + lastKey = it.first; + it.second.key = it.first; + + currentChunk.boundaries.push_back_deep(currentChunk.arena(), it.second); + currentChunkBytesEstimate += it.second.totalSize(); + + if (currentChunkBytesEstimate >= chunkSize || i == boundaries.size() - 1) { + Value serialized = + BinaryWriter::toValue(currentChunk, IncludeVersion(ProtocolVersion::withBlobGranuleFile())); + Value chunkBytes = + IndexBlobGranuleFileChunkRef::toBytes(cipherKeysCtx, compressFilter, serialized, file.arena()); + chunks.push_back(chunkBytes); + + // TODO remove validation + if (!file.indexBlockRef.block.children.empty()) { + ASSERT(file.indexBlockRef.block.children.back().key < currentChunk.boundaries.begin()->key); + } + file.indexBlockRef.block.children.emplace_back_deep( + file.arena(), currentChunk.boundaries.begin()->key, previousChunkBytes); + + if (BG_ENCRYPT_COMPRESS_DEBUG) { + TraceEvent(SevDebug, "ChunkSize") + .detail("ChunkBytes", chunkBytes.size()) + .detail("PrvChunkBytes", previousChunkBytes); + } + + previousChunkBytes += chunkBytes.size(); + currentChunkBytesEstimate = 0; + currentChunk = Standalone(); + } + i++; + } + ASSERT(currentChunk.boundaries.empty()); + if (!deltas.empty()) { + file.indexBlockRef.block.children.emplace_back_deep(file.arena(), fileRange.end, previousChunkBytes); + } + + return serializeFileFromChunks(file, cipherKeysCtx, chunks, previousChunkBytes); +} + +ParsedDeltaBoundaryRef deltaAtVersion(const DeltaBoundaryRef& delta, Version beginVersion, Version readVersion) { + bool clearAfter = delta.clearVersion.present() && readVersion >= delta.clearVersion.get() && + beginVersion <= delta.clearVersion.get(); + if (delta.values.empty()) { + return ParsedDeltaBoundaryRef(delta.key, clearAfter); + } else if (readVersion >= delta.values.back().version && beginVersion <= delta.values.back().version) { + // for all but zero or one delta files, readVersion >= the entire delta file. optimize this case + return ParsedDeltaBoundaryRef(delta.key, clearAfter, delta.values.back()); + } + auto valueAtVersion = std::lower_bound(delta.values.begin(), + delta.values.end(), + ValueAndVersionRef(readVersion), + ValueAndVersionRef::OrderByVersion()); + if (valueAtVersion == delta.values.begin() && readVersion < valueAtVersion->version) { + // deltas are all higher than read version + return ParsedDeltaBoundaryRef(delta.key, clearAfter); + } + // lower_bound() found version >= readVersion, so if we're at the end or it's not equal, go back one + if (valueAtVersion == delta.values.end() || valueAtVersion->version > readVersion) { + valueAtVersion--; + } + ASSERT(readVersion >= valueAtVersion->version); + // now, handle beginVersion (if update < beginVersion, it's a noop) + if (valueAtVersion->version < beginVersion) { + return ParsedDeltaBoundaryRef(delta.key, clearAfter); + } else { + return ParsedDeltaBoundaryRef(delta.key, clearAfter, *valueAtVersion); + } +} + +// The arena owns the BoundaryDeltaRef struct data but the StringRef pointers point to data in deltaData, to avoid extra +// copying +Standalone> loadChunkedDeltaFile(const Standalone& fileNameRef, + const StringRef& deltaData, + const KeyRangeRef& keyRange, + Version beginVersion, + Version readVersion, + Optional cipherKeysCtx, + bool& startClear) { + Standalone> deltas; + Standalone file = IndexedBlobGranuleFile::fromFileBytes(deltaData, cipherKeysCtx); + + ASSERT(file.fileType == DELTA_FILE_TYPE); + ASSERT(file.chunkStartOffset > 0); + + // empty delta file + if (file.indexBlockRef.block.children.empty()) { + return deltas; + } + + ASSERT(file.indexBlockRef.block.children.size() >= 2); + + // find range of blocks needed to read + ChildBlockPointerRef* currentBlock = file.findStartBlock(keyRange.begin); + + if (currentBlock == (file.indexBlockRef.block.children.end() - 1) || keyRange.end <= currentBlock->key) { + // empty, done + return deltas; + } + + // FIXME: shared prefix for key comparison + // FIXME: could cpu optimize first block a bit more by seeking right to start + bool lastBlock = false; + bool prevClearAfter = false; + while (!lastBlock) { + auto nextBlock = currentBlock; + nextBlock++; + lastBlock = (nextBlock == file.indexBlockRef.block.children.end() - 1) || keyRange.end <= nextBlock->key; + + Standalone deltaBlock = + file.getChild(currentBlock, cipherKeysCtx, file.chunkStartOffset); + ASSERT(!deltaBlock.boundaries.empty()); + ASSERT(currentBlock->key == deltaBlock.boundaries.front().key); + + // TODO refactor this into function to share with memory deltas + bool blockMemoryUsed = false; + + for (auto& entry : deltaBlock.boundaries) { + ParsedDeltaBoundaryRef boundary = deltaAtVersion(entry, beginVersion, readVersion); + if (deltas.empty() && entry.key < keyRange.begin) { + startClear = boundary.clearAfter; + prevClearAfter = boundary.clearAfter; + } else if (!lastBlock || entry.key < keyRange.end) { + if (!boundary.redundant(prevClearAfter)) { + deltas.push_back(deltas.arena(), boundary); + blockMemoryUsed = true; + prevClearAfter = boundary.clearAfter; + } + } else { + // TODO REMOVE validation + ASSERT(lastBlock); + break; + } + } + if (blockMemoryUsed) { + deltas.arena().dependsOn(deltaBlock.arena()); + } + currentBlock++; + } + + // TODO REMOVE eventually? order sanity check for parsed deltas + for (int i = 0; i < deltas.size() - 1; i++) { + ASSERT(deltas[i].key < deltas[i + 1].key); + } + + return deltas; +} + +static void applyDelta(const KeyRangeRef& keyRange, const MutationRef& m, std::map& dataMap) { + if (m.type == MutationRef::ClearRange) { + if (m.param2 <= keyRange.begin || m.param1 >= keyRange.end) { + return; + } + // keyRange is inclusive on start, lower_bound is inclusive with the argument, and erase is inclusive for the + // begin. So if lower bound didn't find the exact key, we need to go up one so it doesn't erase an extra key + // outside the range. + std::map::iterator itStart = dataMap.lower_bound(m.param1); + if (itStart != dataMap.end() && itStart->first < m.param1) { + itStart++; + } + + // keyRange is exclusive on end, lower bound is inclusive with the argument, and erase is exclusive for the end + // key. So if lower bound didn't find the exact key, we need to go up one so it doesn't skip the last key it + // should erase + std::map::iterator itEnd = dataMap.lower_bound(m.param2); + if (itEnd != dataMap.end() && itEnd->first < m.param2) { + itEnd++; + } + dataMap.erase(itStart, itEnd); + } else { + // We don't need atomics here since eager reads handles it + ASSERT(m.type == MutationRef::SetValue); + if (m.param1 < keyRange.begin || m.param1 >= keyRange.end) { + return; + } + + std::map::iterator it = dataMap.find(m.param1); + if (it == dataMap.end()) { + dataMap.insert({ m.param1, m.param2 }); + } else { + it->second = m.param2; + } + } +} + +static void applyDeltasByVersion(const GranuleDeltas& deltas, + const KeyRangeRef& keyRange, + Version beginVersion, + Version readVersion, + Version& lastFileEndVersion, + std::map& dataMap) { + if (deltas.empty()) { + return; + } + // check that consecutive delta file versions are disjoint + ASSERT(lastFileEndVersion < deltas.front().version); + + const MutationsAndVersionRef* mutationIt = deltas.begin(); + // prune beginVersion if necessary + if (beginVersion > deltas.front().version) { + if (beginVersion > deltas.back().version) { + // can happen with force flush + mutationIt = deltas.end(); + } else { + // binary search for beginVersion + mutationIt = std::lower_bound(deltas.begin(), + deltas.end(), + MutationsAndVersionRef(beginVersion, 0), + MutationsAndVersionRef::OrderByVersion()); + } + } + + while (mutationIt != deltas.end()) { + if (mutationIt->version > readVersion) { + lastFileEndVersion = readVersion; + return; + } + for (auto& m : mutationIt->mutations) { + applyDelta(keyRange, m, dataMap); + } + mutationIt++; + } + lastFileEndVersion = deltas.back().version; +} + +// TODO: could optimize this slightly to avoid tracking multiple updates for the same key at all since it's always then +// collapsed to the last one +Standalone> sortMemoryDeltas(const GranuleDeltas& memoryDeltas, + const KeyRangeRef& granuleRange, + const KeyRangeRef& readRange, + Version beginVersion, + Version readVersion) { + ASSERT(!memoryDeltas.empty()); + + // filter by request range first + SortedDeltasT versionedBoundaries; + if (versionedBoundaries.empty()) { + versionedBoundaries.insert({ readRange.begin, Standalone() }); + versionedBoundaries.insert({ readRange.end, Standalone() }); + } + for (auto& it : memoryDeltas) { + for (auto& m : it.mutations) { + if (m.type == MutationRef::ClearRange) { + if (m.param2 > readRange.begin && m.param1 < readRange.end) { + KeyRangeRef clearRangeClipped = readRange & KeyRangeRef(m.param1, m.param2); + MutationRef clearClipped( + MutationRef::Type::ClearRange, clearRangeClipped.begin, clearRangeClipped.end); + insertSortedDelta(clearClipped, it.version, granuleRange, versionedBoundaries); + } + } else { + ASSERT(m.type == MutationRef::SetValue); + if (readRange.contains(m.param1)) { + insertSortedDelta(m, it.version, granuleRange, versionedBoundaries); + } + } + } + } + + // parse and collapse based on version + bool prevClearAfter = false; + Standalone> deltas; + + // remove extra ranges inserted from clears that partially overlap read range + auto itBegin = versionedBoundaries.begin(); + while (itBegin->first < readRange.begin) { + ++itBegin; + } + auto itEnd = versionedBoundaries.end(); + itEnd--; + while (itEnd->first > readRange.end) { + itEnd--; + } + itEnd++; + + while (itBegin != itEnd) { + itBegin->second.key = itBegin->first; + ParsedDeltaBoundaryRef boundary = deltaAtVersion(itBegin->second, beginVersion, readVersion); + if (!boundary.redundant(prevClearAfter)) { + deltas.push_back_deep(deltas.arena(), boundary); + prevClearAfter = boundary.clearAfter; + } + ++itBegin; + } + + return deltas; +} + +// does a sorted merge of the delta streams. +// In terms of write precedence, streams[i] < streams[i+1] +// Handles range clears by tracking the active clears when they start +struct MergeStreamNext { + KeyRef key; + int16_t streamIdx; + int dataIdx; +}; + +// the sort order is logically lower by key, and then higher by streamIdx +// because a priority queue is backwards, we invert that +struct OrderForPriorityQueue { + int commonPrefixLen; + OrderForPriorityQueue(int commonPrefixLen) : commonPrefixLen(commonPrefixLen) {} + + bool operator()(MergeStreamNext const& a, MergeStreamNext const& b) const { + int keyCmp = a.key.compareSuffix(b.key, commonPrefixLen); + if (keyCmp != 0) { + return keyCmp > 0; // reverse + } + return a.streamIdx < b.streamIdx; + } +}; + +typedef std::priority_queue, OrderForPriorityQueue> MergePQ; + +static RangeResult mergeDeltaStreams(const BlobGranuleChunkRef& chunk, + const std::vector>>& streams, + const std::vector startClears, + GranuleMaterializeStats& stats) { + ASSERT(streams.size() < std::numeric_limits::max()); + ASSERT(startClears.size() == streams.size()); + + if (streams.empty()) { + return RangeResult{}; + } + + int prefixLen = commonPrefixLength(chunk.keyRange.begin, chunk.keyRange.end); + + // next element for each stream + MergePQ next = MergePQ(OrderForPriorityQueue(prefixLen)); + + // efficiently find the highest stream's active clear + std::set> activeClears; + int16_t maxActiveClear = -1; + + // trade off memory for cpu performance by assuming all inserts + RangeResult result; + int maxExpectedSize = 0; + + // check if a given stream is actively clearing + bool clearActive[streams.size()]; + for (int16_t i = 0; i < streams.size(); i++) { + clearActive[i] = startClears[i]; + if (startClears[i]) { + activeClears.insert(i); + maxActiveClear = i; + } + if (streams[i].empty()) { + // single clear that entirely encases partial read bounds + ASSERT(clearActive[i]); + } else { + MergeStreamNext item; + item.key = streams[i][0].key; + item.streamIdx = i; + item.dataIdx = 0; + next.push(item); + maxExpectedSize += streams[i].size(); + result.arena().dependsOn(streams[i].arena()); + } + } + result.reserve(result.arena(), maxExpectedSize); + + std::vector cur; + cur.reserve(streams.size()); + while (!next.empty()) { + cur.clear(); + cur.push_back(next.top()); + next.pop(); + + // next.top().key == cur.front().key but with suffix comparison + while (!next.empty() && cur.front().key.compareSuffix(next.top().key, prefixLen) == 0) { + cur.push_back(next.top()); + next.pop(); + } + + // un-set clears and find latest value for key (if present) + bool foundValue = false; + bool includesSnapshot = cur.back().streamIdx == 0 && chunk.snapshotFile.present(); + for (auto& it : cur) { + auto& v = streams[it.streamIdx][it.dataIdx]; + if (clearActive[it.streamIdx]) { + clearActive[it.streamIdx] = false; + activeClears.erase(it.streamIdx); + if (it.streamIdx == maxActiveClear) { + // re-get max active clear + maxActiveClear = activeClears.empty() ? -1 : *activeClears.begin(); + } + } + + // find value for this key (if any) + if (!foundValue && !v.isNoOp()) { + foundValue = true; + // if it's a clear, or maxActiveClear is higher, no value for this key + if (v.isSet() && maxActiveClear < it.streamIdx) { + KeyRef finalKey = + chunk.tenantPrefix.present() ? v.key.removePrefix(chunk.tenantPrefix.get()) : v.key; + result.push_back(result.arena(), KeyValueRef(finalKey, v.value)); + if (!includesSnapshot) { + stats.rowsInserted++; + } else if (it.streamIdx > 0) { + stats.rowsUpdated++; + } + } else if (includesSnapshot) { + stats.rowsCleared++; + } + } + } + + // advance streams and start clearAfter + for (auto& it : cur) { + if (streams[it.streamIdx][it.dataIdx].clearAfter) { + clearActive[it.streamIdx] = true; + activeClears.insert(it.streamIdx); + maxActiveClear = std::max(maxActiveClear, it.streamIdx); + } + // TODO: implement skipping if large clear!! + // if (maxClearIdx > it.streamIdx) - skip + it.dataIdx++; + if (it.dataIdx < streams[it.streamIdx].size()) { + it.key = streams[it.streamIdx][it.dataIdx].key; + next.push(it); + } + } + } + + // FIXME: if memory assumption was wrong and result is significantly smaller than total input size, could copy it + // with push_back_deep to a new result. This is rare though + + stats.outputBytes += result.expectedSize(); + + return result; +} + +RangeResult materializeJustSnapshot(const BlobGranuleChunkRef& chunk, + Optional snapshotData, + const KeyRange& requestRange, + GranuleMaterializeStats& stats) { + stats.inputBytes += snapshotData.get().size(); + + Standalone> snapshotRows = loadSnapshotFile( + chunk.snapshotFile.get().filename, snapshotData.get(), requestRange, chunk.snapshotFile.get().cipherKeysCtx); + RangeResult result; + if (!snapshotRows.empty()) { + result.arena().dependsOn(snapshotRows.arena()); + result.reserve(result.arena(), snapshotRows.size()); + for (auto& it : snapshotRows) { + // TODO REMOVE validation + ASSERT(it.op == MutationRef::Type::SetValue); + KeyRef finalKey = chunk.tenantPrefix.present() ? it.key.removePrefix(chunk.tenantPrefix.get()) : it.key; + result.push_back(result.arena(), KeyValueRef(finalKey, it.value)); + } + stats.outputBytes += result.expectedSize(); + stats.snapshotRows += result.size(); + } + + return result; +} + +RangeResult materializeBlobGranule(const BlobGranuleChunkRef& chunk, + KeyRangeRef keyRange, + Version beginVersion, + Version readVersion, + Optional snapshotData, + const std::vector& deltaFileData, + GranuleMaterializeStats& stats) { + // TODO REMOVE with early replying + ASSERT(readVersion == chunk.includedVersion); + Version lastFileVersion = 0; + + // Arena to hold all allocations for applying deltas. Most of it, and the arenas produced by reading the files, + // will likely be tossed if there are a significant number of mutations, so we copy at the end instead of doing a + // dependsOn. + // FIXME: probably some threshold of a small percentage of the data is actually changed, where it makes sense to + // just to dependsOn instead of copy, to use a little extra memory footprint to help cpu? + Arena arena; + KeyRange requestRange; + if (chunk.tenantPrefix.present()) { + requestRange = keyRange.withPrefix(chunk.tenantPrefix.get()); + } else { + requestRange = keyRange; + } + + // fast case for only-snapshot read + if (chunk.snapshotFile.present() && chunk.deltaFiles.empty() && chunk.newDeltas.empty()) { + return materializeJustSnapshot(chunk, snapshotData, requestRange, stats); + } + + std::vector>> streams; + std::vector startClears; + // +1 for possible snapshot, +1 for possible memory deltas + streams.reserve(chunk.deltaFiles.size() + 2); + + if (snapshotData.present()) { + stats.inputBytes += snapshotData.get().size(); + ASSERT(chunk.snapshotFile.present()); + Standalone> snapshotRows = + loadSnapshotFile(chunk.snapshotFile.get().filename, + snapshotData.get(), + requestRange, + chunk.snapshotFile.get().cipherKeysCtx); + if (!snapshotRows.empty()) { + streams.push_back(snapshotRows); + startClears.push_back(false); + arena.dependsOn(streams.back().arena()); + stats.snapshotRows += snapshotRows.size(); + } + ASSERT_WE_THINK(lastFileVersion < chunk.snapshotFile.get().fileVersion); + lastFileVersion = chunk.snapshotFile.get().fileVersion; + } else { + ASSERT(!chunk.snapshotFile.present()); + } + + if (BG_READ_DEBUG) { + fmt::print("Applying {} delta files\n", chunk.deltaFiles.size()); + } + ASSERT(chunk.deltaFiles.size() == deltaFileData.size()); + for (int deltaIdx = 0; deltaIdx < chunk.deltaFiles.size(); deltaIdx++) { + stats.inputBytes += deltaFileData[deltaIdx].size(); + bool startClear = false; + auto deltaRows = loadChunkedDeltaFile(chunk.deltaFiles[deltaIdx].filename, + deltaFileData[deltaIdx], + requestRange, + beginVersion, + readVersion, + chunk.deltaFiles[deltaIdx].cipherKeysCtx, + startClear); + if (startClear || !deltaRows.empty()) { + streams.push_back(deltaRows); + startClears.push_back(startClear); + arena.dependsOn(streams.back().arena()); + } + arena.dependsOn(deltaRows.arena()); + + ASSERT_WE_THINK(lastFileVersion < chunk.deltaFiles[deltaIdx].fileVersion); + lastFileVersion = chunk.deltaFiles[deltaIdx].fileVersion; + } + if (BG_READ_DEBUG) { + fmt::print("Applying {} memory deltas\n", chunk.newDeltas.size()); + } + if (!chunk.newDeltas.empty()) { + stats.inputBytes += chunk.newDeltas.expectedSize(); + // TODO REMOVE validation + ASSERT_WE_THINK(lastFileVersion < chunk.newDeltas.front().version); + ASSERT(beginVersion <= chunk.newDeltas.front().version); + ASSERT(readVersion >= chunk.newDeltas.back().version); + auto memoryRows = sortMemoryDeltas(chunk.newDeltas, chunk.keyRange, requestRange, beginVersion, readVersion); + if (!memoryRows.empty()) { + streams.push_back(memoryRows); + startClears.push_back(false); + arena.dependsOn(streams.back().arena()); + } + } + + return mergeDeltaStreams(chunk, streams, startClears, stats); +} + +struct GranuleLoadFreeHandle : NonCopyable, ReferenceCounted { + const ReadBlobGranuleContext* granuleContext; + int64_t loadId; + + GranuleLoadFreeHandle(const ReadBlobGranuleContext* granuleContext, int64_t loadId) + : granuleContext(granuleContext), loadId(loadId) {} + + ~GranuleLoadFreeHandle() { granuleContext->free_load_f(loadId, granuleContext->userContext); } +}; + +struct GranuleLoadIds { + Optional snapshotId; + std::vector deltaIds; + std::vector> freeHandles; +}; + +static void startLoad(const ReadBlobGranuleContext* granuleContext, + const BlobGranuleChunkRef& chunk, + GranuleLoadIds& loadIds) { + + // Start load process for all files in chunk + if (chunk.snapshotFile.present()) { + std::string snapshotFname = chunk.snapshotFile.get().filename.toString(); + // FIXME: remove when we implement file multiplexing + ASSERT(chunk.snapshotFile.get().offset == 0); + ASSERT(chunk.snapshotFile.get().length == chunk.snapshotFile.get().fullFileLength); + loadIds.snapshotId = granuleContext->start_load_f(snapshotFname.c_str(), + snapshotFname.size(), + chunk.snapshotFile.get().offset, + chunk.snapshotFile.get().length, + chunk.snapshotFile.get().fullFileLength, + granuleContext->userContext); + loadIds.freeHandles.push_back(makeReference(granuleContext, loadIds.snapshotId.get())); + } + loadIds.deltaIds.reserve(chunk.deltaFiles.size()); + for (int deltaFileIdx = 0; deltaFileIdx < chunk.deltaFiles.size(); deltaFileIdx++) { + std::string deltaFName = chunk.deltaFiles[deltaFileIdx].filename.toString(); + // FIXME: remove when we implement file multiplexing + ASSERT(chunk.deltaFiles[deltaFileIdx].offset == 0); + ASSERT(chunk.deltaFiles[deltaFileIdx].length == chunk.deltaFiles[deltaFileIdx].fullFileLength); + int64_t deltaLoadId = granuleContext->start_load_f(deltaFName.c_str(), + deltaFName.size(), + chunk.deltaFiles[deltaFileIdx].offset, + chunk.deltaFiles[deltaFileIdx].length, + chunk.deltaFiles[deltaFileIdx].fullFileLength, + granuleContext->userContext); + loadIds.deltaIds.push_back(deltaLoadId); + loadIds.freeHandles.push_back(makeReference(granuleContext, deltaLoadId)); + } +} + +ErrorOr loadAndMaterializeBlobGranules(const Standalone>& files, + const KeyRangeRef& keyRange, + Version beginVersion, + Version readVersion, + ReadBlobGranuleContext granuleContext, + GranuleMaterializeStats& stats) { + int64_t parallelism = granuleContext.granuleParallelism; + if (parallelism < 1) { + parallelism = 1; + } + if (parallelism >= CLIENT_KNOBS->BG_MAX_GRANULE_PARALLELISM) { + parallelism = CLIENT_KNOBS->BG_MAX_GRANULE_PARALLELISM; + } + + GranuleLoadIds loadIds[files.size()]; + + try { + // Kick off first file reads if parallelism > 1 + for (int i = 0; i < parallelism - 1 && i < files.size(); i++) { + startLoad(&granuleContext, files[i], loadIds[i]); + } + RangeResult results; + for (int chunkIdx = 0; chunkIdx < files.size(); chunkIdx++) { + // Kick off files for this granule if parallelism == 1, or future granule if parallelism > 1 + if (chunkIdx + parallelism - 1 < files.size()) { + startLoad(&granuleContext, files[chunkIdx + parallelism - 1], loadIds[chunkIdx + parallelism - 1]); + } + + RangeResult chunkRows; + + // once all loads kicked off, load data for chunk + Optional snapshotData; + if (files[chunkIdx].snapshotFile.present()) { + snapshotData = + StringRef(granuleContext.get_load_f(loadIds[chunkIdx].snapshotId.get(), granuleContext.userContext), + files[chunkIdx].snapshotFile.get().length); + if (!snapshotData.get().begin()) { + return ErrorOr(blob_granule_file_load_error()); + } + } + + std::vector deltaData; + deltaData.resize(files[chunkIdx].deltaFiles.size()); + for (int i = 0; i < files[chunkIdx].deltaFiles.size(); i++) { + deltaData[i] = + StringRef(granuleContext.get_load_f(loadIds[chunkIdx].deltaIds[i], granuleContext.userContext), + files[chunkIdx].deltaFiles[i].length); + // null data is error + if (!deltaData[i].begin()) { + return ErrorOr(blob_granule_file_load_error()); + } + } + + // materialize rows from chunk + chunkRows = materializeBlobGranule( + files[chunkIdx], keyRange, beginVersion, readVersion, snapshotData, deltaData, stats); + + results.arena().dependsOn(chunkRows.arena()); + results.append(results.arena(), chunkRows.begin(), chunkRows.size()); + + // free once done by forcing FreeHandles to trigger + loadIds[chunkIdx].freeHandles.clear(); + } + return ErrorOr(results); + } catch (Error& e) { + return ErrorOr(e); + } +} + +// just for client passthrough. reads all key-value pairs from a snapshot file, and all mutations from a delta file +RangeResult bgReadSnapshotFile(const StringRef& data, + Optional tenantPrefix, + Optional encryptionCtx, + const KeyRangeRef& keys) { + Standalone fname = "f"_sr; + Standalone> results = loadSnapshotFile(fname, data, keys, encryptionCtx); + RangeResult snapshot; + snapshot.reserve(snapshot.arena(), results.size()); + snapshot.arena().dependsOn(results.arena()); + for (auto& it : results) { + // FIXME: remove validation at some point + if (tenantPrefix.present()) { + ASSERT(it.key.startsWith(tenantPrefix.get())); + snapshot.emplace_back(snapshot.arena(), it.key.removePrefix(tenantPrefix.get()), it.value); + } else { + snapshot.emplace_back(snapshot.arena(), it.key, it.value); + } + } + return snapshot; +} + +// FIXME: refactor if possible, just copy-pasted from loadChunkedDeltaFile for prototyping +Standalone> bgReadDeltaFile(const StringRef& deltaData, + Optional tenantPrefix, + Optional encryptionCtx) { + Standalone> deltas; + Standalone file = IndexedBlobGranuleFile::fromFileBytes(deltaData, encryptionCtx); + + ASSERT(file.fileType == DELTA_FILE_TYPE); + ASSERT(file.chunkStartOffset > 0); + + // empty delta file + if (file.indexBlockRef.block.children.empty()) { + return deltas; + } + + ASSERT(file.indexBlockRef.block.children.size() >= 2); + + // find range of blocks needed to read + ChildBlockPointerRef* currentBlock = file.indexBlockRef.block.children.begin(); + + bool lastBlock = false; + bool prevClearAfter = false; + KeyRef prevClearAfterKey; + Version prevClearAfterVersion; + while (!lastBlock) { + auto nextBlock = currentBlock; + nextBlock++; + lastBlock = (nextBlock == file.indexBlockRef.block.children.end() - 1); + + Standalone deltaBlock = + file.getChild(currentBlock, encryptionCtx, file.chunkStartOffset); + ASSERT(!deltaBlock.boundaries.empty()); + ASSERT(currentBlock->key == deltaBlock.boundaries.front().key); + + for (auto& entry : deltaBlock.boundaries) { + if (prevClearAfter) { + if (tenantPrefix.present()) { + ASSERT(entry.key.startsWith(tenantPrefix.get())); + ASSERT(prevClearAfterKey.startsWith(tenantPrefix.get())); + deltas.emplace_back(deltas.arena(), + MutationRef::Type::ClearRange, + prevClearAfterVersion, + prevClearAfterKey.removePrefix(tenantPrefix.get()), + entry.key.removePrefix(tenantPrefix.get())); + } else { + deltas.emplace_back(deltas.arena(), + MutationRef::Type::ClearRange, + prevClearAfterVersion, + prevClearAfterKey, + entry.key); + } + } + prevClearAfter = entry.clearVersion.present(); + if (prevClearAfter) { + prevClearAfterVersion = entry.clearVersion.get(); + prevClearAfterKey = entry.key; + } + + for (auto& v : entry.values) { + if (v.op == MutationRef::Type::ClearRange) { + if (entry.clearVersion.present() && v.version == entry.clearVersion.get()) { + // we'll handle that in the next loop with prevClearAfter + continue; + } + if (tenantPrefix.present()) { + ASSERT(entry.key.startsWith(tenantPrefix.get())); + deltas.emplace_back(deltas.arena(), + MutationRef::Type::ClearRange, + v.version, + entry.key.removePrefix(tenantPrefix.get()), + keyAfter(entry.key.removePrefix(tenantPrefix.get()), deltas.arena())); + } else { + deltas.emplace_back(deltas.arena(), + MutationRef::Type::ClearRange, + v.version, + entry.key, + keyAfter(entry.key, deltas.arena())); + } + + } else { + ASSERT(v.op == MutationRef::Type::SetValue); + if (tenantPrefix.present()) { + ASSERT(entry.key.startsWith(tenantPrefix.get())); + deltas.emplace_back(deltas.arena(), + MutationRef::Type::SetValue, + v.version, + entry.key.removePrefix(tenantPrefix.get()), + v.value); + } else { + deltas.emplace_back(deltas.arena(), MutationRef::Type::SetValue, v.version, entry.key, v.value); + } + } + } + } + deltas.arena().dependsOn(deltaBlock.arena()); + currentBlock++; + } + return deltas; +} + +std::string randomBGFilename(UID blobWorkerID, UID granuleID, Version version, std::string suffix) { + // Start with random bytes to avoid metadata hotspotting + // Worker ID for uniqueness and attribution + // Granule ID for uniqueness and attribution + // Version for uniqueness and possible future use + return deterministicRandom()->randomUniqueID().shortString().substr(0, 8) + "_" + + blobWorkerID.shortString().substr(0, 8) + "_" + granuleID.shortString() + "_V" + std::to_string(version) + + suffix; +} + +namespace { +const EncryptCipherDomainId encryptDomainId = deterministicRandom()->randomInt64(786, 7860); +const EncryptCipherBaseKeyId encryptBaseCipherId = deterministicRandom()->randomUInt64(); +const EncryptCipherRandomSalt encryptSalt = deterministicRandom()->randomUInt64(); + +Standalone getBaseCipher() { + Standalone baseCipher = makeString(deterministicRandom()->randomInt(4, MAX_BASE_CIPHER_LEN + 1)); + deterministicRandom()->randomBytes(mutateString(baseCipher), baseCipher.size()); + return baseCipher; +} + +const Standalone encryptBaseCipher = getBaseCipher(); + +BlobGranuleCipherKeysCtx getCipherKeysCtx(Arena& arena) { + BlobGranuleCipherKeysCtx cipherKeysCtx; + const EncryptCipherKeyCheckValue cipherKCV = + Sha256KCV().computeKCV(encryptBaseCipher.begin(), encryptBaseCipher.size()); + + cipherKeysCtx.textCipherKey.encryptDomainId = encryptDomainId; + cipherKeysCtx.textCipherKey.baseCipherId = encryptBaseCipherId; + cipherKeysCtx.textCipherKey.baseCipherKCV = cipherKCV; + cipherKeysCtx.textCipherKey.salt = encryptSalt; + cipherKeysCtx.textCipherKey.baseCipher = StringRef(arena, encryptBaseCipher); + + cipherKeysCtx.headerCipherKey.encryptDomainId = SYSTEM_KEYSPACE_ENCRYPT_DOMAIN_ID; + cipherKeysCtx.headerCipherKey.baseCipherId = encryptBaseCipherId; + cipherKeysCtx.headerCipherKey.baseCipherKCV = cipherKCV; + cipherKeysCtx.headerCipherKey.salt = encryptSalt; + cipherKeysCtx.headerCipherKey.baseCipher = StringRef(arena, encryptBaseCipher); + + cipherKeysCtx.ivRef = makeString(AES_256_IV_LENGTH, arena); + deterministicRandom()->randomBytes(mutateString(cipherKeysCtx.ivRef), AES_256_IV_LENGTH); + + return cipherKeysCtx; +} + +} // namespace + +TEST_CASE("/blobgranule/files/applyDelta") { + printf("Testing blob granule delta applying\n"); + Arena a; + + StringRef k_a = StringRef(a, "A"_sr); + StringRef k_ab = StringRef(a, "AB"_sr); + StringRef k_b = StringRef(a, "B"_sr); + StringRef k_c = StringRef(a, "C"_sr); + StringRef k_z = StringRef(a, "Z"_sr); + StringRef val1 = StringRef(a, "1"_sr); + StringRef val2 = StringRef(a, "2"_sr); + + std::map data; + data.insert({ k_a, val1 }); + data.insert({ k_ab, val1 }); + data.insert({ k_b, val1 }); + + std::map correctData = data; + std::map originalData = data; + + ASSERT(data == correctData); + + // test all clear permutations + + MutationRef mClearEverything(MutationRef::ClearRange, allKeys.begin, allKeys.end); + data = originalData; + correctData = originalData; + applyDelta(allKeys, mClearEverything, data); + correctData.clear(); + ASSERT(data == correctData); + + MutationRef mClearEverything2(MutationRef::ClearRange, allKeys.begin, k_c); + data = originalData; + correctData = originalData; applyDelta(allKeys, mClearEverything2, data); correctData.clear(); ASSERT(data == correctData); - MutationRef mClearEverything3(MutationRef::ClearRange, k_a, allKeys.end); - data = originalData; - correctData = originalData; - applyDelta(allKeys, mClearEverything3, data); - correctData.clear(); - ASSERT(data == correctData); + MutationRef mClearEverything3(MutationRef::ClearRange, k_a, allKeys.end); + data = originalData; + correctData = originalData; + applyDelta(allKeys, mClearEverything3, data); + correctData.clear(); + ASSERT(data == correctData); + + MutationRef mClearEverything4(MutationRef::ClearRange, k_a, k_c); + data = originalData; + correctData = originalData; + applyDelta(allKeys, mClearEverything, data); + correctData.clear(); + ASSERT(data == correctData); + + MutationRef mClearFirst(MutationRef::ClearRange, k_a, k_ab); + data = originalData; + correctData = originalData; + applyDelta(allKeys, mClearFirst, data); + correctData.erase(k_a); + ASSERT(data == correctData); + + MutationRef mClearSecond(MutationRef::ClearRange, k_ab, k_b); + data = originalData; + correctData = originalData; + applyDelta(allKeys, mClearSecond, data); + correctData.erase(k_ab); + ASSERT(data == correctData); + + MutationRef mClearThird(MutationRef::ClearRange, k_b, k_c); + data = originalData; + correctData = originalData; + applyDelta(allKeys, mClearThird, data); + correctData.erase(k_b); + ASSERT(data == correctData); + + MutationRef mClearFirst2(MutationRef::ClearRange, k_a, k_b); + data = originalData; + correctData = originalData; + applyDelta(allKeys, mClearFirst2, data); + correctData.erase(k_a); + correctData.erase(k_ab); + ASSERT(data == correctData); + + MutationRef mClearLast2(MutationRef::ClearRange, k_ab, k_c); + data = originalData; + correctData = originalData; + applyDelta(allKeys, mClearLast2, data); + correctData.erase(k_ab); + correctData.erase(k_b); + ASSERT(data == correctData); + + // test set data + MutationRef mSetA(MutationRef::SetValue, k_a, val2); + data = originalData; + correctData = originalData; + applyDelta(allKeys, mSetA, data); + correctData[k_a] = val2; + ASSERT(data == correctData); + + MutationRef mSetAB(MutationRef::SetValue, k_ab, val2); + data = originalData; + correctData = originalData; + applyDelta(allKeys, mSetAB, data); + correctData[k_ab] = val2; + ASSERT(data == correctData); + + MutationRef mSetB(MutationRef::SetValue, k_b, val2); + data = originalData; + correctData = originalData; + applyDelta(allKeys, mSetB, data); + correctData[k_b] = val2; + ASSERT(data == correctData); + + MutationRef mSetC(MutationRef::SetValue, k_c, val2); + data = originalData; + correctData = originalData; + applyDelta(allKeys, mSetC, data); + correctData[k_c] = val2; + ASSERT(data == correctData); + + // test pruning deltas that are outside of the key range + + MutationRef mSetZ(MutationRef::SetValue, k_z, val2); + data = originalData; + applyDelta(KeyRangeRef(k_a, k_c), mSetZ, data); + ASSERT(data == originalData); + + applyDelta(KeyRangeRef(k_ab, k_c), mSetA, data); + ASSERT(data == originalData); + + applyDelta(KeyRangeRef(k_ab, k_c), mClearFirst, data); + ASSERT(data == originalData); + + applyDelta(KeyRangeRef(k_a, k_ab), mClearThird, data); + ASSERT(data == originalData); + + return Void(); +} + +void checkDeltaAtVersion(const ParsedDeltaBoundaryRef& expected, + const DeltaBoundaryRef& boundary, + Version beginVersion, + Version readVersion) { + ParsedDeltaBoundaryRef actual = deltaAtVersion(boundary, beginVersion, readVersion); + ASSERT(expected.clearAfter == actual.clearAfter); + ASSERT(expected.op == actual.op); + if (expected.isSet()) { + ASSERT(expected.value == actual.value); + } else { + ASSERT(actual.value.empty()); + } +} + +TEST_CASE("/blobgranule/files/deltaAtVersion") { + Arena ar; + std::string keyStr = "k"; + std::string aStr = "a"; + + KeyRef key(ar, keyStr); + ValueAndVersionRef vv_a_3(3, ValueRef(ar, aStr)); + ValueAndVersionRef vv_clear_5(5); + + ParsedDeltaBoundaryRef resultEmpty(key, false); + ParsedDeltaBoundaryRef resultEmptyWithClear(key, true); + ParsedDeltaBoundaryRef resultSetA(key, false, vv_a_3); + ParsedDeltaBoundaryRef resultClearA(key, true, vv_clear_5); + + // test empty boundary ref + DeltaBoundaryRef boundaryEmpty; + boundaryEmpty.key = key; + checkDeltaAtVersion(resultEmpty, boundaryEmpty, 0, 2); + + // test empty boundary with clear + DeltaBoundaryRef boundaryEmptyWithClear; + boundaryEmptyWithClear.key = key; + boundaryEmptyWithClear.clearVersion = 5; + + // higher read version includes clear + checkDeltaAtVersion(resultEmptyWithClear, boundaryEmptyWithClear, 0, 5); + checkDeltaAtVersion(resultEmptyWithClear, boundaryEmptyWithClear, 0, 10); + checkDeltaAtVersion(resultEmptyWithClear, boundaryEmptyWithClear, 2, 5); + checkDeltaAtVersion(resultEmptyWithClear, boundaryEmptyWithClear, 2, 10); + checkDeltaAtVersion(resultEmptyWithClear, boundaryEmptyWithClear, 5, 10); + checkDeltaAtVersion(resultEmptyWithClear, boundaryEmptyWithClear, 5, 5); + + // lower read version does not include clear + checkDeltaAtVersion(resultEmpty, boundaryEmptyWithClear, 0, 4); + checkDeltaAtVersion(resultEmpty, boundaryEmptyWithClear, 3, 4); + + // higher read version but also higher beginVersion does not include clear + checkDeltaAtVersion(resultEmpty, boundaryEmptyWithClear, 6, 10); + + // check values + DeltaBoundaryRef fullBoundary; + fullBoundary.key = key; + fullBoundary.values.push_back(ar, vv_a_3); + fullBoundary.values.push_back(ar, vv_clear_5); + fullBoundary.clearVersion = 5; + + checkDeltaAtVersion(resultEmpty, fullBoundary, 0, 2); + checkDeltaAtVersion(resultEmpty, fullBoundary, 6, 10); + checkDeltaAtVersion(resultEmpty, fullBoundary, 4, 4); + + checkDeltaAtVersion(resultSetA, fullBoundary, 0, 3); + checkDeltaAtVersion(resultSetA, fullBoundary, 3, 4); + + checkDeltaAtVersion(resultClearA, fullBoundary, 0, 5); + checkDeltaAtVersion(resultClearA, fullBoundary, 0, 10); + checkDeltaAtVersion(resultClearA, fullBoundary, 3, 5); + checkDeltaAtVersion(resultClearA, fullBoundary, 4, 5); + + return Void(); +} + +void checkSnapshotEmpty(const Value& serialized, Key begin, Key end, Optional cipherKeysCtx) { + Standalone fileNameRef = StringRef(); + Standalone> result = + loadSnapshotFile(fileNameRef, serialized, KeyRangeRef(begin, end), cipherKeysCtx); + ASSERT(result.empty()); +} + +// endIdx is exclusive +void checkSnapshotRead(const Standalone& fileNameRef, + const Standalone& snapshot, + const Value& serialized, + int beginIdx, + int endIdx, + Optional cipherKeysCtx) { + ASSERT(beginIdx < endIdx); + ASSERT(endIdx <= snapshot.size()); + KeyRef beginKey = snapshot[beginIdx].key; + Key endKey = endIdx == snapshot.size() ? keyAfter(snapshot.back().key) : snapshot[endIdx].key; + KeyRangeRef range(beginKey, endKey); + + fmt::print("Reading [{0} - {1})\n", beginKey.printable(), endKey.printable()); + + Standalone> result = + loadSnapshotFile(fileNameRef, serialized, range, cipherKeysCtx); + + if (result.size() != endIdx - beginIdx) { + fmt::print("Read {0} rows != {1}\n", result.size(), endIdx - beginIdx); + } + + if (BG_FILES_TEST_DEBUG) { + fmt::print("Expected Data {0}:\n", result.size()); + for (auto& it : result) { + fmt::print(" {0}=\n", it.key.printable()); + } + fmt::print("Actual Data {0}:\n", endIdx - beginIdx); + for (int i = beginIdx; i < endIdx; i++) { + fmt::print(" {0}=\n", snapshot[i].key.printable()); + } + } + + ASSERT(result.size() == endIdx - beginIdx); + for (auto& it : result) { + ASSERT(it.isSet()); + if (it.key != snapshot[beginIdx].key) { + fmt::print("Key {0} != {1}\n", it.key.printable(), snapshot[beginIdx].key.printable()); + } + ASSERT(it.key == snapshot[beginIdx].key); + if (it.key != snapshot[beginIdx].key) { + fmt::print("Value {0} != {1} for Key {2}\n", + it.value.printable(), + snapshot[beginIdx].value.printable(), + it.key.printable()); + } + ASSERT(it.value == snapshot[beginIdx].value); + beginIdx++; + } +} + +namespace { + +size_t uidSize = 32; + +struct KeyValueGen { + Arena ar; + std::string sharedPrefix; + int targetKeyLength; + int targetValueLength; + std::set usedKeys; + std::vector usedKeysList; + double clearFrequency; + double clearUnsetFrequency; + double updateExistingKeyFrequency; + int minVersionIncrease; + int maxVersionIncrease; + int targetMutationsPerDelta; + KeyRange allRange; + + // start at higher version to allow snapshot files to have version 1 + Version version = 10; + + // encryption/compression settings + // TODO: possibly different cipher keys or meta context per file? + Optional cipherKeys; + Optional compressFilter; + + KeyValueGen() { + sharedPrefix = deterministicRandom()->randomUniqueID().toString(); + ASSERT(sharedPrefix.size() == uidSize); + int sharedPrefixLen = deterministicRandom()->randomInt(0, uidSize); + targetKeyLength = deterministicRandom()->randomInt(4, uidSize); + sharedPrefix = sharedPrefix.substr(0, sharedPrefixLen) + "_"; + targetValueLength = deterministicRandom()->randomExp(0, 12); + allRange = KeyRangeRef(StringRef(sharedPrefix), + sharedPrefix.size() == 0 ? "\xff"_sr : strinc(StringRef(sharedPrefix))); + + if (deterministicRandom()->coinflip()) { + clearFrequency = 0.0; + clearUnsetFrequency = 0.0; + } else { + clearFrequency = deterministicRandom()->random01() / 2; + // clearing an unset value has no effect on the results, we mostly just want to make sure the format doesn't + // barf + clearUnsetFrequency = deterministicRandom()->random01() / 10; + } + if (deterministicRandom()->random01() < 0.2) { + // no updates, only new writes + updateExistingKeyFrequency = 0.0; + } else { + updateExistingKeyFrequency = deterministicRandom()->random01(); + } + if (deterministicRandom()->coinflip()) { + // sequential versions + minVersionIncrease = 1; + maxVersionIncrease = 2; + } else { + minVersionIncrease = deterministicRandom()->randomExp(0, 25); + maxVersionIncrease = minVersionIncrease + deterministicRandom()->randomExp(0, 25); + } + if (deterministicRandom()->coinflip()) { + targetMutationsPerDelta = 1; + } else { + targetMutationsPerDelta = deterministicRandom()->randomExp(1, 5); + } + + if (deterministicRandom()->coinflip()) { + cipherKeys = getCipherKeysCtx(ar); + } + if (deterministicRandom()->coinflip()) { + compressFilter = CompressionUtils::getRandomFilter(); + } + } + + Optional newKey() { + for (int nAttempt = 0; nAttempt < 1000; nAttempt++) { + size_t keySize = deterministicRandom()->randomInt(targetKeyLength / 2, targetKeyLength * 3 / 2); + keySize = std::min(keySize, uidSize); + std::string key = sharedPrefix + deterministicRandom()->randomUniqueID().toString().substr(0, keySize); + if (usedKeys.insert(key).second) { + StringRef k(ar, key); + usedKeysList.push_back(k); + return k; + } + } + return {}; + } + + StringRef value() { + int valueSize = deterministicRandom()->randomInt(targetValueLength / 2, targetValueLength * 3 / 2); + std::string value = deterministicRandom()->randomUniqueID().toString(); + if (value.size() > valueSize) { + value = value.substr(0, valueSize); + } + if (value.size() < valueSize) { + // repeated string so it's compressible + value += std::string(valueSize - value.size(), 'x'); + } + return StringRef(ar, value); + } + + KeyRef randomUsedKey() const { return usedKeysList[deterministicRandom()->randomInt(0, usedKeysList.size())]; } + + KeyRange randomKeyRange() const { + ASSERT(!usedKeysList.empty()); + Key begin = randomUsedKey(); + if (deterministicRandom()->coinflip()) { + begin = keyAfter(begin); + } + if (usedKeysList.size() == 1) { + return KeyRange(KeyRangeRef(begin, keyAfter(begin))); + } else { + Key end = begin; + while (end == begin) { + end = randomUsedKey(); + } + if (deterministicRandom()->coinflip()) { + end = keyAfter(end); + } + if (begin < end) { + return KeyRangeRef(begin, end); + } else { + return KeyRangeRef(end, begin); + } + } + } + + StringRef keyForUpdate(double probUseExisting) { + if (!usedKeysList.empty() && deterministicRandom()->random01() < probUseExisting) { + return randomUsedKey(); + } else { + auto k = newKey(); + if (k.present()) { + return k.get(); + } else { + // use existing key instead + ASSERT(!usedKeysList.empty()); + return randomUsedKey(); + } + } + } + + Version nextVersion() { + Version jump = deterministicRandom()->randomInt(minVersionIncrease, maxVersionIncrease); + version += jump; + return version; + } + + MutationRef newMutation() { + if (deterministicRandom()->random01() < clearFrequency) { + // The algorithm for generating clears of varying sizes is, to generate clear sizes based on an exponential + // distribution, such that the expected value of the clear size is 2. + int clearWidth = 1; + while (clearWidth < usedKeys.size() && deterministicRandom()->coinflip()) { + clearWidth *= 2; + } + bool clearPastEnd = deterministicRandom()->coinflip(); + if (clearPastEnd) { + clearWidth--; + } + StringRef begin = keyForUpdate(1.0 - clearUnsetFrequency); + std::string beginStr = begin.toString(); + auto it = usedKeys.find(beginStr); + ASSERT(it != usedKeys.end()); + while (it != usedKeys.end() && clearWidth > 0) { + it++; + clearWidth--; + } + if (it == usedKeys.end()) { + it--; + clearPastEnd = true; + } + std::string endKey = *it; + if (clearPastEnd) { + Key end = keyAfter(StringRef(ar, endKey)); + ar.dependsOn(end.arena()); + return MutationRef(MutationRef::ClearRange, begin, end); + } else { + // clear up to end + return MutationRef(MutationRef::ClearRange, begin, StringRef(ar, endKey)); + } + + } else { + return MutationRef(MutationRef::SetValue, keyForUpdate(updateExistingKeyFrequency), value()); + } + } + + MutationsAndVersionRef newDelta() { + Version v = nextVersion(); + int mutationCount = deterministicRandom()->randomInt(1, targetMutationsPerDelta * 2); + MutationsAndVersionRef ret(v, v); + for (int i = 0; i < mutationCount; i++) { + ret.mutations.push_back(ar, newMutation()); + } + return ret; + } +}; + +} // namespace + +Standalone genSnapshot(KeyValueGen& kvGen, int targetDataBytes) { + Standalone data; + int totalDataBytes = 0; + while (totalDataBytes < targetDataBytes) { + Optional key = kvGen.newKey(); + if (!key.present()) { + break; + } + StringRef value = kvGen.value(); + + data.push_back_deep(data.arena(), KeyValueRef(KeyRef(key.get()), ValueRef(value))); + totalDataBytes += key.get().size() + value.size(); + } + + std::sort(data.begin(), data.end(), KeyValueRef::OrderByKey()); + return data; +} + +Standalone genDeltas(KeyValueGen& kvGen, int targetBytes) { + Standalone data; + int totalDataBytes = 0; + while (totalDataBytes < targetBytes) { + data.push_back(data.arena(), kvGen.newDelta()); + totalDataBytes += data.back().expectedSize(); + } + return data; +} + +TEST_CASE("/blobgranule/files/validateEncryptionCompression") { + KeyValueGen kvGen; + + int targetSnapshotChunks = deterministicRandom()->randomExp(0, 9); + int targetDeltaChunks = deterministicRandom()->randomExp(0, 8); + int targetDataBytes = deterministicRandom()->randomExp(12, 25); + int targetSnapshotBytes = (int)(deterministicRandom()->randomInt(0, targetDataBytes)); + int targetDeltaBytes = targetDataBytes - targetSnapshotBytes; + + int targetSnapshotChunkSize = targetSnapshotBytes / targetSnapshotChunks; + int targetDeltaChunkSize = targetDeltaBytes / targetDeltaChunks; + + Standalone snapshotData = genSnapshot(kvGen, targetSnapshotBytes); + Standalone deltaData = genDeltas(kvGen, targetDeltaBytes); + fmt::print("{0} snapshot rows and {1} deltas\n", snapshotData.size(), deltaData.size()); + + Standalone fileNameRef = StringRef(); + + Arena ar; + BlobGranuleCipherKeysCtx cipherKeys = getCipherKeysCtx(ar); + std::vector encryptionModes = { false, true }; + std::vector> compressionModes; + compressionModes.insert( + compressionModes.end(), CompressionUtils::supportedFilters.begin(), CompressionUtils::supportedFilters.end()); + + std::vector snapshotValues; + for (bool encryptionMode : encryptionModes) { + Optional keys = encryptionMode ? cipherKeys : Optional(); + for (auto& compressionMode : compressionModes) { + Value v = + serializeChunkedSnapshot(fileNameRef, snapshotData, targetSnapshotChunkSize, compressionMode, keys); + fmt::print("snapshot({0}, {1}): {2}\n", + encryptionMode, + compressionMode.present() ? CompressionUtils::toString(compressionMode.get()) : "", + v.size()); + for (auto& v2 : snapshotValues) { + ASSERT(v != v2); + } + snapshotValues.push_back(v); + } + } + fmt::print("Validated {0} encryption/compression combos for snapshot\n", snapshotValues.size()); + + std::vector deltaValues; + for (bool encryptionMode : encryptionModes) { + Optional keys = encryptionMode ? cipherKeys : Optional(); + for (auto& compressionMode : compressionModes) { + Value v = serializeChunkedDeltaFile( + fileNameRef, deltaData, kvGen.allRange, targetDeltaChunkSize, compressionMode, keys); + fmt::print("delta({0}, {1}): {2}\n", + encryptionMode, + compressionMode.present() ? CompressionUtils::toString(compressionMode.get()) : "", + v.size()); + for (auto& v2 : deltaValues) { + ASSERT(v != v2); + } + deltaValues.push_back(v); + } + } + fmt::print("Validated {0} encryption/compression combos for delta\n", deltaValues.size()); + + return Void(); +} + +TEST_CASE("/blobgranule/files/snapshotFormatUnitTest") { + // snapshot files are likely to have a non-trivial shared prefix since they're for a small contiguous key range + KeyValueGen kvGen; + + int targetChunks = deterministicRandom()->randomExp(0, 9); + int targetDataBytes = deterministicRandom()->randomExp(0, 25); + int targetChunkSize = targetDataBytes / targetChunks; + Standalone fnameRef = StringRef(std::string("test")); + + Standalone data = genSnapshot(kvGen, targetDataBytes); + + int maxExp = 0; + while (1 << maxExp < data.size()) { + maxExp++; + } + maxExp--; + + fmt::print("Validating snapshot data is sorted\n"); + for (int i = 0; i < data.size() - 1; i++) { + ASSERT(data[i].key < data[i + 1].key); + } + + fmt::print("Constructing snapshot with {0} rows, {1} chunks\n", data.size(), targetChunks); + + Value serialized = + serializeChunkedSnapshot(fnameRef, data, targetChunkSize, kvGen.compressFilter, kvGen.cipherKeys); + + fmt::print("Snapshot serialized! {0} bytes\n", serialized.size()); + + fmt::print("Validating snapshot data is sorted again\n"); + for (int i = 0; i < data.size() - 1; i++) { + ASSERT(data[i].key < data[i + 1].key); + } + + fmt::print("Initial read starting\n"); + + checkSnapshotRead(fnameRef, data, serialized, 0, data.size(), kvGen.cipherKeys); + + fmt::print("Initial read complete\n"); + + if (data.size() > 1) { + for (int i = 0; i < std::min(100, data.size() * 2); i++) { + int width = deterministicRandom()->randomExp(0, maxExp); + ASSERT(width <= data.size()); + int start = deterministicRandom()->randomInt(0, data.size() - width); + checkSnapshotRead(fnameRef, data, serialized, start, start + width, kvGen.cipherKeys); + } + + fmt::print("Doing empty checks\n"); + int randomIdx = deterministicRandom()->randomInt(0, data.size() - 1); + checkSnapshotEmpty(serialized, keyAfter(data[randomIdx].key), data[randomIdx + 1].key, kvGen.cipherKeys); + } else { + fmt::print("Doing empty checks\n"); + } + + checkSnapshotEmpty(serialized, normalKeys.begin, data.front().key, kvGen.cipherKeys); + checkSnapshotEmpty(serialized, normalKeys.begin, "\x00"_sr, kvGen.cipherKeys); + checkSnapshotEmpty(serialized, keyAfter(data.back().key), normalKeys.end, kvGen.cipherKeys); + checkSnapshotEmpty(serialized, "\xfe"_sr, normalKeys.end, kvGen.cipherKeys); + + fmt::print("Snapshot format test done!\n"); + + return Void(); +} + +void checkDeltaRead(const KeyValueGen& kvGen, + const KeyRangeRef& range, + Version beginVersion, + Version readVersion, + const Standalone& data, + const std::vector& serialized) { + ASSERT_EQ(serialized.size(), 1); + + // expected answer + std::map expectedData; + Version lastFileEndVersion = 0; + GranuleMaterializeStats stats; + + fmt::print("Delta Read [{0} - {1}) @ {2} - {3}\n", + range.begin.printable(), + range.end.printable(), + beginVersion, + readVersion); + + applyDeltasByVersion(data, range, beginVersion, readVersion, lastFileEndVersion, expectedData); + + // actual answer + std::string filename = randomBGFilename( + deterministicRandom()->randomUniqueID(), deterministicRandom()->randomUniqueID(), readVersion, ".delta"); + Standalone chunk; + chunk.deltaFiles.emplace_back_deep( + chunk.arena(), filename, 0, serialized[0].size(), serialized[0].size(), 1, kvGen.cipherKeys); + chunk.keyRange = kvGen.allRange; + chunk.includedVersion = readVersion; + chunk.snapshotVersion = invalidVersion; + + RangeResult actualData = materializeBlobGranule(chunk, range, beginVersion, readVersion, {}, serialized, stats); + + if (expectedData.size() != actualData.size()) { + fmt::print("Expected Data {0}:\n", expectedData.size()); + /*for (auto& it : expectedData) { + fmt::print(" {0}=\n", it.first.printable()); + }*/ + fmt::print("Actual Data {0}:\n", actualData.size()); + /*for (auto& it : actualData) { + fmt::print(" {0}=\n", it.key.printable()); + }*/ + } + + ASSERT(expectedData.size() == actualData.size()); + int i = 0; + for (auto& it : expectedData) { + ASSERT(it.first == actualData[i].key); + ASSERT(it.second == actualData[i].value); + i++; + } +} + +static std::tuple randomizeKeyAndVersions(const KeyValueGen& kvGen, + const Standalone data) { + // either randomize just keyrange, just version range, or both + double rand = deterministicRandom()->randomInt(0, 3); + bool randomizeKeyRange = rand == 0 || rand == 2; + bool randomizeVersionRange = rand == 1 || rand == 2; + KeyRange readRange = kvGen.allRange; + Version beginVersion = 0; + Version readVersion = data.back().version; + + if (randomizeKeyRange) { + readRange = kvGen.randomKeyRange(); + } + + if (randomizeVersionRange) { + if (deterministicRandom()->coinflip()) { + beginVersion = 0; + } else { + beginVersion = data[deterministicRandom()->randomInt(0, data.size())].version; + beginVersion += deterministicRandom()->randomInt(0, 3) - 1; // randomize between -1, 0, and +1 + } + readVersion = data[deterministicRandom()->randomInt(0, data.size())].version; + readVersion += deterministicRandom()->randomInt(0, 3) - 1; // randomize between -1, 0, and +1 + if (readVersion < beginVersion) { + std::swap(beginVersion, readVersion); + } + } + + return { readRange, beginVersion, readVersion }; +} + +TEST_CASE("/blobgranule/files/deltaFormatUnitTest") { + KeyValueGen kvGen; + Standalone fileNameRef = StringRef(std::string("test")); + + int targetChunks = deterministicRandom()->randomExp(0, 8); + int targetDataBytes = deterministicRandom()->randomExp(0, 21); + int targetChunkSize = targetDataBytes / targetChunks; + + Standalone data = genDeltas(kvGen, targetDataBytes); + + fmt::print("Deltas ({0})\n", data.size()); + /*for (auto& it : data) { + fmt::print(" {0}) ({1})\n", it.version, it.mutations.size()); + for (auto& it2 : it.mutations) { + if (it2.type == MutationRef::Type::SetValue) { + fmt::print(" {0}=\n", it2.param1.printable()); + } else { + fmt::print(" {0} - {1}\n", it2.param1.printable(), it2.param2.printable()); + } + } + }*/ + Value serialized = serializeChunkedDeltaFile( + fileNameRef, data, kvGen.allRange, targetChunkSize, kvGen.compressFilter, kvGen.cipherKeys); + std::vector deltaPtr{ serialized }; + + // check whole file + checkDeltaRead(kvGen, kvGen.allRange, 0, data.back().version, data, deltaPtr); + + for (int i = 0; i < std::min((size_t)100, kvGen.usedKeysList.size() * data.size()); i++) { + auto params = randomizeKeyAndVersions(kvGen, data); + checkDeltaRead(kvGen, std::get<0>(params), std::get<1>(params), std::get<2>(params), data, deltaPtr); + } + + return Void(); +} + +void checkGranuleRead(const KeyValueGen& kvGen, + const KeyRangeRef& range, + Version beginVersion, + Version readVersion, + const Standalone& snapshotData, + const Standalone& deltaData, + const Value& serializedSnapshot, + const std::vector>& serializedDeltas, + const Standalone& inMemoryDeltas) { + // expected answer + std::map expectedData; + if (beginVersion == 0) { + for (auto& it : snapshotData) { + if (range.contains(it.key)) { + expectedData.insert({ it.key, it.value }); + } + } + } + Version lastFileEndVersion = 0; + applyDeltasByVersion(deltaData, range, beginVersion, readVersion, lastFileEndVersion, expectedData); + GranuleMaterializeStats stats; + + // actual answer + Standalone chunk; + if (beginVersion == 0) { + std::string snapshotFilename = randomBGFilename( + deterministicRandom()->randomUniqueID(), deterministicRandom()->randomUniqueID(), 0, ".snapshot"); + chunk.snapshotFile = BlobFilePointerRef(chunk.arena(), + snapshotFilename, + 0, + serializedSnapshot.size(), + serializedSnapshot.size(), + 1, + kvGen.cipherKeys); + } + int deltaIdx = 0; + while (deltaIdx < serializedDeltas.size() && serializedDeltas[deltaIdx].first < beginVersion) { + deltaIdx++; + } + std::vector deltaPtrsVector; + while (deltaIdx < serializedDeltas.size()) { + std::string deltaFilename = randomBGFilename( + deterministicRandom()->randomUniqueID(), deterministicRandom()->randomUniqueID(), readVersion, ".delta"); + size_t fsize = serializedDeltas[deltaIdx].second.size(); + chunk.deltaFiles.emplace_back_deep( + chunk.arena(), deltaFilename, 0, fsize, fsize, serializedDeltas[deltaIdx].first, kvGen.cipherKeys); + deltaPtrsVector.push_back(serializedDeltas[deltaIdx].second); + + if (serializedDeltas[deltaIdx].first >= readVersion) { + break; + } + deltaIdx++; + } + + // add in memory deltas + chunk.arena().dependsOn(inMemoryDeltas.arena()); + for (auto& it : inMemoryDeltas) { + if (beginVersion <= it.version && it.version <= readVersion) { + chunk.newDeltas.push_back(chunk.arena(), it); + } + } + + chunk.keyRange = kvGen.allRange; + chunk.includedVersion = readVersion; + chunk.snapshotVersion = (beginVersion == 0) ? 0 : invalidVersion; - MutationRef mClearEverything4(MutationRef::ClearRange, k_a, k_c); - data = originalData; - correctData = originalData; - applyDelta(allKeys, mClearEverything, data); - correctData.clear(); - ASSERT(data == correctData); + Optional snapshotPtr; + if (beginVersion == 0) { + snapshotPtr = serializedSnapshot; + } + RangeResult actualData = + materializeBlobGranule(chunk, range, beginVersion, readVersion, snapshotPtr, deltaPtrsVector, stats); - MutationRef mClearFirst(MutationRef::ClearRange, k_a, k_ab); - data = originalData; - correctData = originalData; - applyDelta(allKeys, mClearFirst, data); - correctData.erase(k_a); - ASSERT(data == correctData); + if (expectedData.size() != actualData.size()) { + fmt::print("Expected Size {0} != Actual Size {1}\n", expectedData.size(), actualData.size()); + } + if (BG_FILES_TEST_DEBUG) { + fmt::print("Expected Data {0}:\n", expectedData.size()); + for (auto& it : expectedData) { + fmt::print(" {0}=\n", it.first.printable()); + } + fmt::print("Actual Data {0}:\n", actualData.size()); + for (auto& it : actualData) { + fmt::print(" {0}=\n", it.key.printable()); + } + } - MutationRef mClearSecond(MutationRef::ClearRange, k_ab, k_b); - data = originalData; - correctData = originalData; - applyDelta(allKeys, mClearSecond, data); - correctData.erase(k_ab); - ASSERT(data == correctData); + ASSERT(expectedData.size() == actualData.size()); + int i = 0; + for (auto& it : expectedData) { + if (it.first != actualData[i].key) { + fmt::print("expected {0} != actual {1}\n", it.first.printable(), actualData[i].key.printable()); + } + ASSERT(it.first == actualData[i].key); + ASSERT(it.second == actualData[i].value); + i++; + } +} - MutationRef mClearThird(MutationRef::ClearRange, k_b, k_c); - data = originalData; - correctData = originalData; - applyDelta(allKeys, mClearThird, data); - correctData.erase(k_b); - ASSERT(data == correctData); +TEST_CASE("/blobgranule/files/granuleReadUnitTest") { + KeyValueGen kvGen; + Standalone fileNameRef = StringRef(std::string("testSnap")); + + int targetSnapshotChunks = deterministicRandom()->randomExp(0, 9); + int targetDeltaChunks = deterministicRandom()->randomExp(0, 8); + int targetDataBytes = deterministicRandom()->randomExp(12, 25); + int targetSnapshotBytes = (int)(deterministicRandom()->randomInt(0, targetDataBytes)); + int targetDeltaBytes = targetDataBytes - targetSnapshotBytes; + + if (BG_FILES_TEST_DEBUG) { + fmt::print("Snapshot Chunks: {0}\nDelta Chunks: {1}\nSnapshot Bytes: {2}\nDelta Bytes: {3}\n", + targetSnapshotChunks, + targetDeltaChunks, + targetSnapshotBytes, + targetDeltaBytes); + } - MutationRef mClearFirst2(MutationRef::ClearRange, k_a, k_b); - data = originalData; - correctData = originalData; - applyDelta(allKeys, mClearFirst2, data); - correctData.erase(k_a); - correctData.erase(k_ab); - ASSERT(data == correctData); + int targetSnapshotChunkSize = targetSnapshotBytes / targetSnapshotChunks; + int targetDeltaChunkSize = targetDeltaBytes / targetDeltaChunks; - MutationRef mClearLast2(MutationRef::ClearRange, k_ab, k_c); - data = originalData; - correctData = originalData; - applyDelta(allKeys, mClearLast2, data); - correctData.erase(k_ab); - correctData.erase(k_b); - ASSERT(data == correctData); + Standalone snapshotData = genSnapshot(kvGen, targetSnapshotBytes); + if (BG_FILES_TEST_DEBUG) { + fmt::print("Snapshot data: {0}\n", snapshotData.size()); + for (auto& it : snapshotData) { + fmt::print(" {0}=\n", it.key.printable()); + } + } + Standalone deltaData = genDeltas(kvGen, targetDeltaBytes); + fmt::print("{0} snapshot rows and {1} deltas\n", snapshotData.size(), deltaData.size()); + + if (BG_FILES_TEST_DEBUG) { + fmt::print("Delta data: {0}\n", deltaData.size()); + for (auto& it : deltaData) { + fmt::print(" {0}) ({1})\n", it.version, it.mutations.size()); + for (auto& it2 : it.mutations) { + if (it2.type == MutationRef::Type::SetValue) { + fmt::print(" {0}=\n", it2.param1.printable()); + } else { + fmt::print(" {0} - {1}\n", it2.param1.printable(), it2.param2.printable()); + } + } + } + } - // test set data - MutationRef mSetA(MutationRef::SetValue, k_a, val2); - data = originalData; - correctData = originalData; - applyDelta(allKeys, mSetA, data); - correctData[k_a] = val2; - ASSERT(data == correctData); + Value serializedSnapshot = serializeChunkedSnapshot( + fileNameRef, snapshotData, targetSnapshotChunkSize, kvGen.compressFilter, kvGen.cipherKeys); + + // split deltas up across multiple files + int deltaFiles = std::min(deltaData.size(), deterministicRandom()->randomInt(1, 21)); + int deltasPerFile = deltaData.size() / deltaFiles + 1; + std::vector> serializedDeltaFiles; + Standalone inMemoryDeltas; + serializedDeltaFiles.reserve(deltaFiles); + for (int i = 0; i < deltaFiles; i++) { + Standalone fileData; + int j; + for (j = i * deltasPerFile; j < (i + 1) * deltasPerFile && j < deltaData.size(); j++) { + fileData.push_back_deep(fileData.arena(), deltaData[j]); + } + if (!fileData.empty()) { + if (j == deltaData.size() && deterministicRandom()->coinflip()) { + // if it's the last set of deltas, sometimes make them the memory deltas instead + fmt::print("Memory Deltas {0} - {1}\n", fileData.front().version, fileData.back().version); + inMemoryDeltas = fileData; + } else { + fmt::print("Delta file {0} - {1}\n", fileData.front().version, fileData.back().version); + Standalone fileNameRef = StringRef("delta" + std::to_string(i)); + Value serializedDelta = serializeChunkedDeltaFile(fileNameRef, + fileData, + kvGen.allRange, + targetDeltaChunkSize, + kvGen.compressFilter, + kvGen.cipherKeys); + serializedDeltaFiles.emplace_back(fileData.back().version, serializedDelta); + } + } + } - MutationRef mSetAB(MutationRef::SetValue, k_ab, val2); - data = originalData; - correctData = originalData; - applyDelta(allKeys, mSetAB, data); - correctData[k_ab] = val2; - ASSERT(data == correctData); + fmt::print("Full test\n"); + checkGranuleRead(kvGen, + kvGen.allRange, + 0, + deltaData.back().version, + snapshotData, + deltaData, + serializedSnapshot, + serializedDeltaFiles, + inMemoryDeltas); + + // prevent overflow by doing min before multiply + int maxRuns = 100; + int snapshotAndDeltaSize = 5 + std::min(maxRuns, snapshotData.size()) * std::min(maxRuns, deltaData.size()); + int lim = std::min(maxRuns, snapshotAndDeltaSize); + for (int i = 0; i < lim; i++) { + auto params = randomizeKeyAndVersions(kvGen, deltaData); + fmt::print("Partial test {0}: [{1} - {2}) @ {3} - {4}\n", + i, + std::get<0>(params).begin.printable(), + std::get<0>(params).end.printable(), + std::get<1>(params), + std::get<2>(params)); + checkGranuleRead(kvGen, + std::get<0>(params), + std::get<1>(params), + std::get<2>(params), + snapshotData, + deltaData, + serializedSnapshot, + serializedDeltaFiles, + inMemoryDeltas); + } - MutationRef mSetB(MutationRef::SetValue, k_b, val2); - data = originalData; - correctData = originalData; - applyDelta(allKeys, mSetB, data); - correctData[k_b] = val2; - ASSERT(data == correctData); + return Void(); +} - MutationRef mSetC(MutationRef::SetValue, k_c, val2); - data = originalData; - correctData = originalData; - applyDelta(allKeys, mSetC, data); - correctData[k_c] = val2; - ASSERT(data == correctData); +namespace { +MutationsAndVersionRef singleMutation(Version v, + MutationRef::Type type, + Arena& ar, + const StringRef& param1, + const StringRef& param2) { + MutationsAndVersionRef ref(v, v); + ref.mutations.emplace_back(ar, type, param1, param2); + return ref; +} - // test pruning deltas that are outside of the key range +void checkMutations(const Standalone>& expected, + const Standalone>& actual) { + ASSERT(expected.size() == actual.size()); + for (int i = 0; i < expected.size(); i++) { + ASSERT(expected[i].version == actual[i].version); + ASSERT(expected[i].type == actual[i].type); + ASSERT(expected[i].param1 == actual[i].param1); + ASSERT(expected[i].param2 == actual[i].param2); + } +} +} // namespace - MutationRef mSetZ(MutationRef::SetValue, k_z, val2); - data = originalData; - applyDelta(KeyRangeRef(k_a, k_c), mSetZ, data); - ASSERT(data == originalData); +/* +Input mutations: +Set A=5 @ 100 +Clear [A - C) @ 200 +Set E=6 @ 300 +Set A=7 @ 400 +Clear [A - E) @ 500 +Clear [E - E\x00) @ 600 (single key clear) + +Output mutations: +Set A=5 @ 100 +Set A=7 @ 400 +Clear [A - A\x00) @ 500 +Clear [A - C) @ 200 +Clear [C - C\x00] @ 500 +Set E=6 @ 300 +Clear [E - E\x00) @ 600 +*/ +TEST_CASE("/blobgranule/files/bgReadDeltaFile") { + + KeyValueGen kvGen; + Arena ar; + Standalone strA = "A"_sr; + Standalone strC = "C"_sr; + Standalone strE = "E"_sr; + + Standalone strAfterA = keyAfter(strA); + Standalone strAfterE = keyAfter(strE); + + Standalone str5 = "5"_sr; + Standalone str6 = "6"_sr; + Standalone str7 = "7"_sr; + + bool addTenantPrefix = deterministicRandom()->coinflip(); + KeyRef tenantPrefix = addTenantPrefix ? "12345678"_sr : ""_sr; + + // make tenant versions + Standalone t_strA = strA.withPrefix(tenantPrefix); + Standalone t_strC = strC.withPrefix(tenantPrefix); + Standalone t_strE = strE.withPrefix(tenantPrefix); + Standalone t_strAfterA = strAfterA.withPrefix(tenantPrefix); + Standalone t_strAfterE = strAfterE.withPrefix(tenantPrefix); + + Standalone originalMutations; + originalMutations.push_back(ar, singleMutation(100, MutationRef::Type::SetValue, ar, t_strA, str5)); + originalMutations.push_back(ar, singleMutation(200, MutationRef::Type::ClearRange, ar, t_strA, t_strC)); + originalMutations.push_back(ar, singleMutation(300, MutationRef::Type::SetValue, ar, t_strE, str6)); + originalMutations.push_back(ar, singleMutation(400, MutationRef::Type::SetValue, ar, t_strA, str7)); + originalMutations.push_back(ar, singleMutation(500, MutationRef::Type::ClearRange, ar, t_strA, t_strE)); + originalMutations.push_back(ar, singleMutation(600, MutationRef::Type::ClearRange, ar, t_strE, t_strAfterE)); + + Standalone> expectedMutations; + expectedMutations.emplace_back(ar, MutationRef::Type::SetValue, 100, strA, str5); + expectedMutations.emplace_back(ar, MutationRef::Type::SetValue, 400, strA, str7); + expectedMutations.emplace_back(ar, MutationRef::Type::ClearRange, 500, strA, strAfterA); + expectedMutations.emplace_back(ar, MutationRef::Type::ClearRange, 200, strA, strC); + expectedMutations.emplace_back(ar, MutationRef::Type::ClearRange, 500, strC, strE); + expectedMutations.emplace_back(ar, MutationRef::Type::SetValue, 300, strE, str6); + expectedMutations.emplace_back(ar, MutationRef::Type::ClearRange, 600, strE, strAfterE); + + for (int chunkSize = 1; chunkSize <= 32 * 1024; chunkSize *= 2) { + Value serialized = serializeChunkedDeltaFile(strA, + originalMutations, + KeyRangeRef(t_strA, t_strAfterE), + chunkSize, + kvGen.compressFilter, + kvGen.cipherKeys); + Standalone> actualMutations = + bgReadDeltaFile(serialized, addTenantPrefix ? tenantPrefix : Optional(), kvGen.cipherKeys); + + checkMutations(expectedMutations, actualMutations); + } - applyDelta(KeyRangeRef(k_ab, k_c), mSetA, data); - ASSERT(data == originalData); + return Void(); +} - applyDelta(KeyRangeRef(k_ab, k_c), mClearFirst, data); - ASSERT(data == originalData); +// performance micro-benchmarks - applyDelta(KeyRangeRef(k_a, k_ab), mClearThird, data); - ASSERT(data == originalData); +struct FileSet { + std::tuple> snapshotFile; + std::vector>> deltaFiles; + Key commonPrefix; + KeyRange range; +}; + +std::pair parseFilename(const std::string& fname) { + auto dotPos = fname.find("."); + ASSERT(dotPos > 0); + std::string type = fname.substr(dotPos + 1); + ASSERT(type == "snapshot" || type == "delta"); + auto lastUnderscorePos = fname.rfind("_"); + ASSERT('V' == fname[lastUnderscorePos + 1]); + std::string versionString = fname.substr(lastUnderscorePos + 2, dotPos); + Version version = std::stoll(versionString); + return { type, version }; +} + +Value loadFileData(std::string filename) { + std::ifstream input(filename, std::ios::binary); + ASSERT(input.good()); + + // copies all data into buffer + std::vector buffer(std::istreambuf_iterator(input), {}); + Value v(StringRef(&buffer[0], buffer.size())); + fmt::print("Loaded {0} file bytes from {1}\n", v.size(), filename); + + input.close(); + return v; +} + +struct CommonPrefixStats { + // for computing common prefix details and stats + Key key; + int len = -1; + int64_t totalKeySize = 0; + int totalKeys = 0; + int minKeySize = 1000000000; + int maxKeySize = 0; + int64_t logicalBytes = 0; + int64_t totalLogicalBytes = 0; + + int deltas = 0; + int deltasSet = 0; + int deltasClear = 0; + int deltasNoOp = 0; + int deltasClearAfter = 0; + + void addKey(const KeyRef& k) { + if (len == -1) { + key = k; + len = k.size(); + } else { + len = std::min(len, commonPrefixLength(k, key)); + } + totalKeys++; + totalKeySize += k.size(); + minKeySize = std::min(minKeySize, k.size()); + maxKeySize = std::max(maxKeySize, k.size()); + } + + void addKeyValue(const KeyRef& k, const ValueRef& v) { + addKey(k); + logicalBytes += k.size(); + logicalBytes += v.size(); + } + + void addBoundary(const ParsedDeltaBoundaryRef& d) { + addKey(d.key); + + deltas++; + if (d.isSet()) { + deltasSet++; + logicalBytes += d.value.size(); + } else if (d.isClear()) { + deltasClear++; + } else { + ASSERT(d.isNoOp()); + deltasNoOp++; + } + if (d.clearAfter) { + deltasClearAfter++; + } + } + + void doneFile() { + totalLogicalBytes += logicalBytes; + fmt::print("Logical Size: {0}\n", logicalBytes); + logicalBytes = 0; + } + + Key done() { + doneFile(); + ASSERT(len >= 0); + fmt::print("Common prefix: {0}\nCommon Prefix Length: {1}\nAverage Key Size: {2}\nMin Key Size: {3}, Max Key " + "Size: {4}\n", + key.substr(0, len).printable(), + len, + totalKeySize / totalKeys, + minKeySize, + maxKeySize); + + if (deltas > 0) { + fmt::print("Delta stats: {0} deltas, {1} sets, {2} clears, {3} noops, {4} clearAfters\n", + deltas, + deltasSet, + deltasClear, + deltasNoOp, + deltasClearAfter); + } + fmt::print("Logical Size: {0}\n", totalLogicalBytes); + return key.substr(0, len); + } +}; + +FileSet loadFileSet(std::string basePath, const std::vector& filenames, bool newFormat) { + FileSet files; + CommonPrefixStats stats; + for (int i = 0; i < filenames.size(); i++) { + auto parts = parseFilename(filenames[i]); + std::string type = parts.first; + Version version = parts.second; + if (type == "snapshot") { + std::string fpath = basePath + filenames[i]; + Value data = loadFileData(fpath); + + Standalone parsed; + if (!newFormat) { + Arena arena; + GranuleSnapshot file; + ObjectReader dataReader(data.begin(), Unversioned()); + dataReader.deserialize(FileIdentifierFor::value, file, arena); + parsed = Standalone(file, arena); + fmt::print("Loaded {0} rows from snapshot file\n", parsed.size()); + + for (auto& it : parsed) { + stats.addKeyValue(it.key, it.value); + } + } else { + Standalone> res = loadSnapshotFile(""_sr, data, normalKeys, {}); + fmt::print("Loaded {0} rows from snapshot file\n", res.size()); + for (auto& it : res) { + stats.addKeyValue(it.key, it.value); + } + } + + files.snapshotFile = { filenames[i], version, data, parsed }; + + } else { + std::string fpath = basePath + filenames[i]; + Value data = loadFileData(fpath); + + if (!newFormat) { + Arena arena; + GranuleDeltas file; + ObjectReader dataReader(data.begin(), Unversioned()); + dataReader.deserialize(FileIdentifierFor::value, file, arena); + Standalone parsed(file, arena); + + fmt::print("Loaded {0} deltas from delta file\n", parsed.size()); + files.deltaFiles.push_back({ filenames[i], version, data, parsed }); + + for (auto& it : parsed) { + for (auto& it2 : it.mutations) { + stats.addKey(it2.param1); + if (it2.type == MutationRef::Type::ClearRange) { + stats.addKey(it2.param2); + } + } + } + } else { + bool startClear = false; + Standalone> res = + loadChunkedDeltaFile(""_sr, data, normalKeys, 0, version, {}, startClear); + ASSERT(!startClear); + + Standalone parsed; + fmt::print("Loaded {0} boundaries from delta file\n", res.size()); + files.deltaFiles.push_back({ filenames[i], version, data, parsed }); + + for (auto& it : res) { + stats.addBoundary(it); + } + } + } + stats.doneFile(); + } + + files.commonPrefix = stats.done(); + if (files.commonPrefix.size() == 0) { + files.range = normalKeys; + } else { + files.range = KeyRangeRef(files.commonPrefix, strinc(files.commonPrefix)); + } + fmt::print("Range: [{0} - {1})\n", files.range.begin.printable(), files.range.end.printable()); + + return files; +} + +int WRITE_RUNS = 5; + +std::pair doSnapshotWriteBench(const Standalone& data, + bool chunked, + Optional cipherKeys, + Optional compressionFilter) { + Standalone fileNameRef = StringRef(); + int64_t serializedBytes = 0; + double elapsed = -timer_monotonic(); + for (int runI = 0; runI < WRITE_RUNS; runI++) { + if (!chunked) { + serializedBytes = ObjectWriter::toValue(data, Unversioned()).size(); + } else { + serializedBytes = + serializeChunkedSnapshot(fileNameRef, data, 64 * 1024, compressionFilter, cipherKeys).size(); + } + } + elapsed += timer_monotonic(); + elapsed /= WRITE_RUNS; + return { serializedBytes, elapsed }; +} + +std::pair doDeltaWriteBench(const Standalone& data, + const KeyRangeRef& fileRange, + bool chunked, + Optional cipherKeys, + Optional compressionFilter) { + Standalone fileNameRef = StringRef(); + int64_t serializedBytes = 0; + double elapsed = -timer_monotonic(); + for (int runI = 0; runI < WRITE_RUNS; runI++) { + if (!chunked) { + serializedBytes = ObjectWriter::toValue(data, Unversioned()).size(); + } else { + serializedBytes = + serializeChunkedDeltaFile(fileNameRef, data, fileRange, 32 * 1024, compressionFilter, cipherKeys) + .size(); + } + } + elapsed += timer_monotonic(); + elapsed /= WRITE_RUNS; + return { serializedBytes, elapsed }; +} + +void chunkFromFileSet(const FileSet& fileSet, + Standalone& chunk, + std::vector& deltaPtrs, + Version readVersion, + Optional keys, + int numDeltaFiles) { + size_t snapshotSize = std::get<3>(fileSet.snapshotFile).size(); + chunk.snapshotFile = + BlobFilePointerRef(chunk.arena(), std::get<0>(fileSet.snapshotFile), 0, snapshotSize, snapshotSize, 1, keys); + + for (int i = 0; i < numDeltaFiles; i++) { + size_t deltaSize = std::get<3>(fileSet.deltaFiles[i]).size(); + chunk.deltaFiles.emplace_back_deep( + chunk.arena(), std::get<0>(fileSet.deltaFiles[i]), 0, deltaSize, deltaSize, 2 + i, keys); + deltaPtrs[i] = std::get<2>(fileSet.deltaFiles[i]); + } + + chunk.keyRange = fileSet.range; + chunk.includedVersion = readVersion; + chunk.snapshotVersion = std::get<1>(fileSet.snapshotFile); +} + +FileSet rewriteChunkedFileSet(const FileSet& fileSet, + Optional keys, + Optional compressionFilter) { + Standalone fileNameRef = StringRef(); + FileSet newFiles; + newFiles.snapshotFile = fileSet.snapshotFile; + newFiles.deltaFiles = fileSet.deltaFiles; + newFiles.commonPrefix = fileSet.commonPrefix; + newFiles.range = fileSet.range; + + std::get<2>(newFiles.snapshotFile) = + serializeChunkedSnapshot(fileNameRef, std::get<3>(newFiles.snapshotFile), 64 * 1024, compressionFilter, keys); + for (auto& deltaFile : newFiles.deltaFiles) { + std::get<2>(deltaFile) = serializeChunkedDeltaFile( + fileNameRef, std::get<3>(deltaFile), fileSet.range, 32 * 1024, compressionFilter, keys); + } + + return newFiles; +} + +int READ_RUNS = 20; +std::pair doReadBench(const FileSet& fileSet, + bool chunked, + KeyRange readRange, + bool clearAllAtEnd, + Optional keys, + int numDeltaFiles, + bool printStats = false) { + Version readVersion = std::get<1>(fileSet.deltaFiles.back()); + + Standalone chunk; + GranuleMaterializeStats stats; + ASSERT(numDeltaFiles >= 0 && numDeltaFiles <= fileSet.deltaFiles.size()); + std::vector deltaPtrs(numDeltaFiles); + + MutationRef clearAllAtEndMutation; + if (clearAllAtEnd) { + clearAllAtEndMutation = MutationRef(MutationRef::Type::ClearRange, readRange.begin, readRange.end); + } + if (chunked) { + chunkFromFileSet(fileSet, chunk, deltaPtrs, readVersion, keys, numDeltaFiles); + if (clearAllAtEnd) { + readVersion++; + MutationsAndVersionRef lastDelta; + lastDelta.version = readVersion; + lastDelta.mutations.push_back(chunk.arena(), clearAllAtEndMutation); + chunk.includedVersion = readVersion; + + chunk.newDeltas.push_back_deep(chunk.arena(), lastDelta); + } + } + + int64_t serializedBytes = 0; + double elapsed = -timer_monotonic(); + for (int runI = 0; runI < READ_RUNS; runI++) { + if (!chunked) { + std::map data; + for (auto& it : std::get<3>(fileSet.snapshotFile)) { + data.insert({ it.key, it.value }); + } + Version lastFileEndVersion = 0; + for (auto& deltaFile : fileSet.deltaFiles) { + applyDeltasByVersion(std::get<3>(deltaFile), readRange, 0, readVersion, lastFileEndVersion, data); + } + if (clearAllAtEnd) { + applyDelta(readRange, clearAllAtEndMutation, data); + } + RangeResult actualData; + for (auto& it : data) { + actualData.push_back_deep(actualData.arena(), KeyValueRef(it.first, it.second)); + } + serializedBytes += actualData.expectedSize(); + } else { + RangeResult actualData = materializeBlobGranule( + chunk, readRange, 0, readVersion, std::get<2>(fileSet.snapshotFile), deltaPtrs, stats); + serializedBytes += actualData.expectedSize(); + } + } + elapsed += timer_monotonic(); + elapsed /= READ_RUNS; + serializedBytes /= READ_RUNS; + + if (printStats) { + fmt::print("Materialize stats:\n"); + fmt::print(" Input bytes: {0}\n", stats.inputBytes / READ_RUNS); + fmt::print(" Output bytes: {0}\n", stats.outputBytes / READ_RUNS); + fmt::print(" Write Amp: {0}\n", (1.0 * stats.inputBytes) / stats.outputBytes); + fmt::print(" Snapshot Rows: {0}\n", stats.snapshotRows / READ_RUNS); + fmt::print(" Rows Cleared: {0}\n", stats.rowsCleared / READ_RUNS); + fmt::print(" Rows Inserted: {0}\n", stats.rowsInserted / READ_RUNS); + fmt::print(" Rows Updated: {0}\n", stats.rowsUpdated / READ_RUNS); + } + + return { serializedBytes, elapsed }; +} + +void printMetrics(int64_t diskBytes, double elapsed, int64_t processesBytes, int64_t logicalSize) { + double storageAmp = (1.0 * diskBytes) / logicalSize; + + double MBperCPUsec = (elapsed == 0.0) ? 0.0 : (processesBytes / 1024.0 / 1024.0) / elapsed; + fmt::print("{}", fmt::format(" {:.6} {:.6}", storageAmp, MBperCPUsec)); +} + +TEST_CASE("!/blobgranule/files/benchFromFiles") { + std::string basePath = "SET_ME"; + std::vector> fileSetNames = { { "SET_ME" } }; + Arena ar; + BlobGranuleCipherKeysCtx cipherKeys = getCipherKeysCtx(ar); + std::vector chunkModes = { false, true }; + std::vector encryptionModes = { false, true }; + std::vector> compressionModes; + compressionModes.push_back({}); + compressionModes.insert( + compressionModes.end(), CompressionUtils::supportedFilters.begin(), CompressionUtils::supportedFilters.end()); + + std::vector runNames = { "logical" }; + std::vector> snapshotMetrics; + std::vector> deltaMetrics; + + std::vector fileSets; + int64_t logicalSnapshotSize = 0; + int64_t logicalDeltaSize = 0; + for (auto& it : fileSetNames) { + FileSet fileSet = loadFileSet(basePath, it, false); + fileSets.push_back(fileSet); + logicalSnapshotSize += std::get<3>(fileSet.snapshotFile).expectedSize(); + for (auto& deltaFile : fileSet.deltaFiles) { + logicalDeltaSize += std::get<3>(deltaFile).expectedSize(); + } + } + snapshotMetrics.push_back({ logicalSnapshotSize, 0.0 }); + deltaMetrics.push_back({ logicalDeltaSize, 0.0 }); + + for (bool chunk : chunkModes) { + for (bool encrypt : encryptionModes) { + if (!chunk && encrypt) { + continue; + } + Optional keys = encrypt ? cipherKeys : Optional(); + for (auto& compressionFilter : compressionModes) { + if (!chunk && compressionFilter.present()) { + continue; + } + if (compressionFilter.present() && CompressionFilter::NONE == compressionFilter.get()) { + continue; + } + + std::string name; + if (!chunk) { + name = "old"; + } else { + if (encrypt) { + name += "ENC"; + } + if (compressionFilter.present() && compressionFilter.get() != CompressionFilter::NONE) { + name += "CMP"; + } + if (name.empty()) { + name = "chunked"; + } + } + runNames.push_back(name); + int64_t snapshotTotalBytes = 0; + double snapshotTotalElapsed = 0.0; + for (auto& fileSet : fileSets) { + auto res = doSnapshotWriteBench(std::get<3>(fileSet.snapshotFile), chunk, keys, compressionFilter); + snapshotTotalBytes += res.first; + snapshotTotalElapsed += res.second; + } + snapshotMetrics.push_back({ snapshotTotalBytes, snapshotTotalElapsed }); + + int64_t deltaTotalBytes = 0; + double deltaTotalElapsed = 0.0; + for (auto& fileSet : fileSets) { + for (auto& deltaFile : fileSet.deltaFiles) { + auto res = + doDeltaWriteBench(std::get<3>(deltaFile), fileSet.range, chunk, keys, compressionFilter); + deltaTotalBytes += res.first; + deltaTotalElapsed += res.second; + } + } + deltaMetrics.push_back({ deltaTotalBytes, deltaTotalElapsed }); + } + } + } + + fmt::print("\n\n\n\nWrite Results:\n"); + + ASSERT(runNames.size() == snapshotMetrics.size()); + ASSERT(runNames.size() == deltaMetrics.size()); + for (int i = 0; i < runNames.size(); i++) { + fmt::print("{0}", runNames[i]); + + printMetrics( + snapshotMetrics[i].first, snapshotMetrics[i].second, snapshotMetrics[i].first, snapshotMetrics[0].first); + printMetrics(deltaMetrics[i].first, deltaMetrics[i].second, deltaMetrics[i].first, deltaMetrics[0].first); + + int64_t logicalTotalBytes = snapshotMetrics[0].first + deltaMetrics[0].first; + int64_t totalBytes = deltaMetrics[i].first + snapshotMetrics[i].first; + double logicalTotalElapsed = (snapshotMetrics[i].second == 0.0 || deltaMetrics[i].second == 0.0) + ? 0.0 + : snapshotMetrics[i].second + deltaMetrics[i].second; + printMetrics(totalBytes, logicalTotalElapsed, deltaMetrics[i].first, logicalTotalBytes); + + fmt::print("\n"); + } + + std::vector readRunNames = {}; + std::vector> readMetrics; + + bool doEdgeCaseReadTests = false; + bool doVaryingDeltaTests = false; + std::vector clearAllReadMetrics; + std::vector readSingleKeyMetrics; + std::vector>> varyingDeltaMetrics; + + size_t maxDeltaFiles = 100000; + for (auto& f : fileSets) { + maxDeltaFiles = std::min(maxDeltaFiles, f.deltaFiles.size()); + } + + for (bool chunk : chunkModes) { + for (bool encrypt : encryptionModes) { + if (!chunk && encrypt) { + continue; + } + + Optional keys = encrypt ? cipherKeys : Optional(); + for (auto& compressionFilter : compressionModes) { + if (!chunk && compressionFilter.present()) { + continue; + } + if (compressionFilter.present() && CompressionFilter::NONE == compressionFilter.get()) { + continue; + } + std::string name; + if (!chunk) { + name = "old"; + } else { + if (encrypt) { + name += "ENC"; + } + if (compressionFilter.present() && compressionFilter.get() != CompressionFilter::NONE) { + name += "CMP"; + } + if (name.empty()) { + name = "chunked"; + } + } + readRunNames.push_back(name); + + int64_t totalBytesRead = 0; + double totalElapsed = 0.0; + double totalElapsedClearAll = 0.0; + double totalElapsedSingleKey = 0.0; + std::vector> varyingDeltas; + for (int i = 0; i <= maxDeltaFiles; i++) { + varyingDeltas.push_back({ 0, 0.0 }); + } + for (auto& fileSet : fileSets) { + FileSet newFileSet; + if (!chunk) { + newFileSet = fileSet; + } else { + newFileSet = rewriteChunkedFileSet(fileSet, keys, compressionFilter); + } + + auto res = doReadBench(newFileSet, chunk, fileSet.range, false, keys, newFileSet.deltaFiles.size()); + totalBytesRead += res.first; + totalElapsed += res.second; + + if (doEdgeCaseReadTests) { + totalElapsedClearAll += + doReadBench(newFileSet, chunk, fileSet.range, true, keys, newFileSet.deltaFiles.size()) + .second; + Key k = std::get<3>(fileSet.snapshotFile).front().key; + KeyRange singleKeyRange(KeyRangeRef(k, keyAfter(k))); + totalElapsedSingleKey += + doReadBench(newFileSet, chunk, singleKeyRange, false, keys, newFileSet.deltaFiles.size()) + .second; + } + + if (doVaryingDeltaTests && chunk) { + for (int i = 0; i <= maxDeltaFiles; i++) { + auto r = doReadBench(newFileSet, chunk, fileSet.range, false, keys, i); + varyingDeltas[i].first += r.first; + varyingDeltas[i].second += r.second; + } + } + } + readMetrics.push_back({ totalBytesRead, totalElapsed }); + + if (doEdgeCaseReadTests) { + clearAllReadMetrics.push_back(totalElapsedClearAll); + readSingleKeyMetrics.push_back(totalElapsedSingleKey); + } + if (doVaryingDeltaTests) { + varyingDeltaMetrics.push_back(varyingDeltas); + } + } + } + } + + fmt::print("\n\nRead Results:\n"); + + ASSERT(readRunNames.size() == readMetrics.size()); + for (int i = 0; i < readRunNames.size(); i++) { + fmt::print("{0}", readRunNames[i]); + + double MBperCPUsec = (readMetrics[i].first / 1024.0 / 1024.0) / readMetrics[i].second; + fmt::print(" {:.6}", MBperCPUsec); + + fmt::print("\n"); + } + + if (doEdgeCaseReadTests) { + ASSERT(readRunNames.size() == clearAllReadMetrics.size()); + ASSERT(readRunNames.size() == readSingleKeyMetrics.size()); + fmt::print("\n\nEdge Case Read Results:\n"); + + for (int i = 0; i < readRunNames.size(); i++) { + fmt::print("{0}", readRunNames[i]); + + // use MB from full read test but elapsed from these tests so the numbers make sense relatively + double MBperCPUsecClearAll = (readMetrics[i].first / 1024.0 / 1024.0) / clearAllReadMetrics[i]; + double MBperCPUsecSingleKey = (readMetrics[i].first / 1024.0 / 1024.0) / readSingleKeyMetrics[i]; + fmt::print(" {:.6} {:.6}", MBperCPUsecClearAll, MBperCPUsecSingleKey); + + fmt::print("\n"); + } + } + + if (doVaryingDeltaTests) { + ASSERT(readRunNames.size() == varyingDeltaMetrics.size()); + fmt::print("\n\nVarying Deltas Read Results:\nDF#\t"); + for (int i = 0; i <= maxDeltaFiles; i++) { + fmt::print("{0}\t", i); + } + fmt::print("\n"); + + for (int i = 0; i < readRunNames.size(); i++) { + fmt::print("{0}", readRunNames[i]); + + for (auto& it : varyingDeltaMetrics[i]) { + double MBperCPUsec = (it.first / 1024.0 / 1024.0) / it.second; + fmt::print("\t{:.6}", MBperCPUsec); + } + fmt::print("\n"); + } + } + + fmt::print("\n\nCombined Results:\n"); + ASSERT(readRunNames.size() == runNames.size() - 1); + for (int i = 0; i < readRunNames.size(); i++) { + fmt::print("{0}", readRunNames[i]); + int64_t logicalBytes = deltaMetrics[i + 1].first; + double totalElapsed = snapshotMetrics[i + 1].second + deltaMetrics[i + 1].second + readMetrics[i].second; + double MBperCPUsec = (logicalBytes / 1024.0 / 1024.0) / totalElapsed; + fmt::print(" {:.6}", MBperCPUsec); + + fmt::print("\n"); + } + + fmt::print("\n\nBenchmark Complete!\n"); + + return Void(); +} + +TEST_CASE("!/blobgranule/files/repeatFromFiles") { + std::string basePath = "SET_ME"; + std::vector> fileSetNames = { { "SET_ME" } }; + + int64_t totalBytesRead = 0; + double totalElapsed = 0.0; + for (auto& it : fileSetNames) { + FileSet fileSet = loadFileSet(basePath, it, true); + auto res = doReadBench(fileSet, true, fileSet.range, false, {}, fileSet.deltaFiles.size(), true); + totalBytesRead += res.first; + totalElapsed += res.second; + } + + double MBperCPUsec = (totalBytesRead / 1024.0 / 1024.0) / totalElapsed; + fmt::print("Read Results: {:.6} MB/cpusec\n", MBperCPUsec); return Void(); -} \ No newline at end of file +} diff --git a/src/fdbclient/BlobGranuleFiles.h b/src/fdbclient/BlobGranuleFiles.h deleted file mode 100644 index f6c7f59..0000000 --- a/src/fdbclient/BlobGranuleFiles.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * BlobGranuleFiles.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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. - */ - -#ifndef FDBCLIENT_BLOBGRANULEFILES_H -#define FDBCLIENT_BLOBGRANULEFILES_H - -// This file contains functions for readers who want to materialize blob granules from the underlying files - -#include "fdbclient/BlobGranuleCommon.h" - -ErrorOr loadAndMaterializeBlobGranules(const Standalone>& files, - const KeyRangeRef& keyRange, - Version beginVersion, - Version readVersion, - ReadBlobGranuleContext granuleContext); - -RangeResult materializeBlobGranule(const BlobGranuleChunkRef& chunk, - KeyRangeRef keyRange, - Version beginVersion, - Version readVersion, - Optional snapshotData, - StringRef deltaFileData[]); - -#endif \ No newline at end of file diff --git a/src/fdbclient/BlobGranuleReader.actor.cpp b/src/fdbclient/BlobGranuleReader.actor.cpp index 411611b..e05ff85 100644 --- a/src/fdbclient/BlobGranuleReader.actor.cpp +++ b/src/fdbclient/BlobGranuleReader.actor.cpp @@ -31,23 +31,16 @@ #include "fdbclient/FDBTypes.h" #include "flow/actorcompiler.h" // This must be the last #include. -// TODO more efficient data structure besides std::map? PTree is unnecessary since this isn't versioned, but some other -// sorted thing could work. And if it used arenas it'd probably be more efficient with allocations, since everything -// else is in 1 arena and discarded at the end. - -// TODO could refactor the file reading code from here and the delta file function into another actor, -// then this part would also be testable? but meh - -ACTOR Future> readFile(Reference bstore, BlobFilePointerRef f) { +ACTOR Future> readFile(Reference bstoreProvider, BlobFilePointerRef f) { try { state Arena arena; - // printf("Starting read of snapshot file %s\n", filename.c_str()); - state Reference reader = wait(bstore->readFile(f.filename.toString())); - // printf("Got snapshot file size %lld\n", size); + std::string fname = f.filename.toString(); + state Reference bstore = bstoreProvider->getForRead(fname); + state Reference reader = wait(bstore->readFile(fname)); + state uint8_t* data = new (arena) uint8_t[f.length]; - // printf("Reading %lld bytes from snapshot file %s\n", size, filename.c_str()); + int readSize = wait(reader->read(data, f.length, f.offset)); - // printf("Read %lld bytes from snapshot file %s\n", readSize, filename.c_str()); ASSERT(f.length == readSize); StringRef dataRef(data, f.length); @@ -66,7 +59,7 @@ ACTOR Future readBlobGranule(BlobGranuleChunkRef chunk, KeyRangeRef keyRange, Version beginVersion, Version readVersion, - Reference bstore, + Reference bstore, Optional stats) { // TODO REMOVE with early replying @@ -100,17 +93,19 @@ ACTOR Future readBlobGranule(BlobGranuleChunkRef chunk, } state int numDeltaFiles = chunk.deltaFiles.size(); - state StringRef* deltaData = new (arena) StringRef[numDeltaFiles]; + state std::vector deltaData; state int deltaIdx; - // for (Future> deltaFuture : readDeltaFutures) { + deltaData.reserve(numDeltaFiles); for (deltaIdx = 0; deltaIdx < numDeltaFiles; deltaIdx++) { Standalone data = wait(readDeltaFutures[deltaIdx]); - deltaData[deltaIdx] = data; + deltaData.push_back(data); arena.dependsOn(data.arena()); } - return materializeBlobGranule(chunk, keyRange, beginVersion, readVersion, snapshotData, deltaData); + // TODO do something useful with stats? + GranuleMaterializeStats stats; + return materializeBlobGranule(chunk, keyRange, beginVersion, readVersion, snapshotData, deltaData, stats); } catch (Error& e) { throw e; @@ -120,7 +115,7 @@ ACTOR Future readBlobGranule(BlobGranuleChunkRef chunk, // TODO probably should add things like limit/bytelimit at some point? ACTOR Future readBlobGranules(BlobGranuleFileRequest request, BlobGranuleFileReply reply, - Reference bstore, + Reference bstore, PromiseStream results) { // TODO for large amount of chunks, this should probably have some sort of buffer limit like ReplyPromiseStream. // Maybe just use ReplyPromiseStream instead of PromiseStream? @@ -138,3 +133,106 @@ ACTOR Future readBlobGranules(BlobGranuleFileRequest request, return Void(); } + +// Return true if a given range is fully covered by blob chunks +bool isRangeFullyCovered(KeyRange range, Standalone> blobChunks) { + std::vector blobRanges; + for (const BlobGranuleChunkRef& chunk : blobChunks) { + blobRanges.push_back(chunk.keyRange); + } + return range.isCovered(blobRanges); +} + +void testAddChunkRange(KeyRef begin, KeyRef end, Standalone>& chunks) { + BlobGranuleChunkRef chunk; + chunk.keyRange = KeyRangeRef(begin, end); + chunks.push_back(chunks.arena(), chunk); +} + +TEST_CASE("/fdbserver/blobgranule/isRangeCoveredByBlob") { + Standalone> chunks; + // chunk1 key_a1 - key_a9 + testAddChunkRange("key_a1"_sr, "key_a9"_sr, chunks); + // chunk2 key_b1 - key_b9 + testAddChunkRange("key_b1"_sr, "key_b9"_sr, chunks); + + // check empty range. not covered + { ASSERT(isRangeFullyCovered(KeyRangeRef(), chunks) == false); } + + // check empty chunks. not covered + { + Standalone> empyChunks; + ASSERT(isRangeFullyCovered(KeyRangeRef(), empyChunks) == false); + } + + // check '' to \xff + { ASSERT(isRangeFullyCovered(KeyRangeRef(""_sr, "\xff"_sr), chunks) == false); } + + // check {key_a1, key_a9} + { ASSERT(isRangeFullyCovered(KeyRangeRef("key_a1"_sr, "key_a9"_sr), chunks)); } + + // check {key_a1, key_a3} + { ASSERT(isRangeFullyCovered(KeyRangeRef("key_a1"_sr, "key_a3"_sr), chunks)); } + + // check {key_a0, key_a3} + { ASSERT(isRangeFullyCovered(KeyRangeRef("key_a0"_sr, "key_a3"_sr), chunks) == false); } + + // check {key_a5, key_b2} + { + auto range = KeyRangeRef("key_a5"_sr, "key_b5"_sr); + ASSERT(isRangeFullyCovered(range, chunks) == false); + ASSERT(range.begin == "key_a5"_sr); + ASSERT(range.end == "key_b5"_sr); + } + + // check continued chunks + { + Standalone> continuedChunks; + testAddChunkRange("key_a1"_sr, "key_a9"_sr, continuedChunks); + testAddChunkRange("key_a9"_sr, "key_b1"_sr, continuedChunks); + testAddChunkRange("key_b1"_sr, "key_b9"_sr, continuedChunks); + ASSERT(isRangeFullyCovered(KeyRangeRef("key_a1"_sr, "key_b9"_sr), continuedChunks)); + } + + // check functionality of isCovered() + { + std::vector ranges; + ranges.push_back(KeyRangeRef("key_a"_sr, "key_b"_sr)); + ranges.push_back(KeyRangeRef("key_x"_sr, "key_y"_sr)); + ASSERT(KeyRangeRef("key_x"_sr, "key_y"_sr).isCovered(ranges)); + + ranges.clear(); + ranges.push_back(KeyRangeRef("key_a"_sr, "key_b"_sr)); + ranges.push_back(KeyRangeRef("key_v"_sr, "key_y"_sr)); + ASSERT(KeyRangeRef("key_x"_sr, "key_y"_sr).isCovered(ranges)); + + ranges.clear(); + ranges.push_back(KeyRangeRef("key_a"_sr, "key_b"_sr)); + ranges.push_back(KeyRangeRef("key_x"_sr, "key_xa"_sr)); + ranges.push_back(KeyRangeRef("key_xa"_sr, "key_ya"_sr)); + ASSERT(KeyRangeRef("key_x"_sr, "key_y"_sr).isCovered(ranges)); + + ranges.clear(); + ranges.push_back(KeyRangeRef("key_a"_sr, "key_b"_sr)); + ranges.push_back(KeyRangeRef("key_x"_sr, "key_xa"_sr)); + ranges.push_back(KeyRangeRef("key_xa"_sr, "key_xb"_sr)); + ASSERT(!KeyRangeRef("key_x"_sr, "key_y"_sr).isCovered(ranges)); + + ranges.clear(); + ranges.push_back(KeyRangeRef("key_a"_sr, "key_b"_sr)); + ranges.push_back(KeyRangeRef("key_x"_sr, "key_xa"_sr)); + ASSERT(!KeyRangeRef("key_x"_sr, "key_y"_sr).isCovered(ranges)); + + ranges.clear(); + ranges.push_back(KeyRangeRef("key_a"_sr, "key_b"_sr)); + ranges.push_back(KeyRangeRef("key_xa"_sr, "key_y"_sr)); + ASSERT(!KeyRangeRef("key_x"_sr, "key_y"_sr).isCovered(ranges)); + + ranges.clear(); + ranges.push_back(KeyRangeRef("key_a"_sr, "key_b"_sr)); + ranges.push_back(KeyRangeRef("key_x"_sr, "key_y"_sr)); + ASSERT(!KeyRangeRef("key_a"_sr, "key_y"_sr).isCovered(ranges)); + } + + return Void(); +} diff --git a/src/fdbclient/BlobGranuleReader.actor.g.cpp b/src/fdbclient/BlobGranuleReader.actor.g.cpp index 15af24d..3d13b6d 100644 --- a/src/fdbclient/BlobGranuleReader.actor.g.cpp +++ b/src/fdbclient/BlobGranuleReader.actor.g.cpp @@ -33,30 +33,23 @@ #include "fdbclient/FDBTypes.h" #include "flow/actorcompiler.h" // This must be the last #include. -// TODO more efficient data structure besides std::map? PTree is unnecessary since this isn't versioned, but some other -// sorted thing could work. And if it used arenas it'd probably be more efficient with allocations, since everything -// else is in 1 arena and discarded at the end. - -// TODO could refactor the file reading code from here and the delta file function into another actor, -// then this part would also be testable? but meh - - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" namespace { // This generated class is to be used only via readFile() - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" template - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" class ReadFileActorState { - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" public: - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - ReadFileActorState(Reference const& bstore,BlobFilePointerRef const& f) - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - : bstore(bstore), - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ReadFileActorState(Reference const& bstoreProvider,BlobFilePointerRef const& f) + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + : bstoreProvider(bstoreProvider), + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" f(f) - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" { fdb_probe_actor_create("readFile", reinterpret_cast(this)); @@ -70,18 +63,22 @@ class ReadFileActorState { { try { try { - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" arena = Arena(); - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - StrictFuture> __when_expr_0 = bstore->readFile(f.filename.toString()); - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + std::string fname = f.filename.toString(); + #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + bstore = bstoreProvider->getForRead(fname); + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + StrictFuture> __when_expr_0 = bstore->readFile(fname); + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -109,9 +106,9 @@ class ReadFileActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -123,27 +120,27 @@ class ReadFileActorState { } int a_body1cont2(int loopDepth) { - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" data = new (arena) uint8_t[f.length]; - #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" StrictFuture __when_expr_1 = reader->read(data, f.length, f.offset); - #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(Reference const& __reader,int loopDepth) { - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" reader = __reader; - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -208,13 +205,13 @@ class ReadFileActorState { } int a_body1cont3(int const& readSize,int loopDepth) { - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" ASSERT(f.length == readSize); - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" StringRef dataRef(data, f.length); - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Standalone(dataRef, arena)); this->~ReadFileActorState(); static_cast(this)->destroy(); return 0; } - #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" new (&static_cast(this)->SAV< Standalone >::value()) Standalone(Standalone(dataRef, arena)); this->~ReadFileActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -224,13 +221,13 @@ class ReadFileActorState { } int a_body1cont3(int && readSize,int loopDepth) { - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" ASSERT(f.length == readSize); - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" StringRef dataRef(data, f.length); - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Standalone(dataRef, arena)); this->~ReadFileActorState(); static_cast(this)->destroy(); return 0; } - #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" new (&static_cast(this)->SAV< Standalone >::value()) Standalone(Standalone(dataRef, arena)); this->~ReadFileActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -301,22 +298,24 @@ class ReadFileActorState { fdb_probe_actor_exit("readFile", reinterpret_cast(this), 1); } - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - Reference bstore; - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + Reference bstoreProvider; + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" BlobFilePointerRef f; - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" Arena arena; - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + Reference bstore; + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" Reference reader; - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" uint8_t* data; - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" }; // This generated class is to be used only via readFile() - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" class ReadFileActor final : public Actor>, public ActorCallback< ReadFileActor, 0, Reference >, public ActorCallback< ReadFileActor, 1, int >, public FastAllocated, public ReadFileActorState { - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -326,11 +325,11 @@ class ReadFileActor final : public Actor>, public ActorCal #pragma clang diagnostic pop friend struct ActorCallback< ReadFileActor, 0, Reference >; friend struct ActorCallback< ReadFileActor, 1, int >; - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - ReadFileActor(Reference const& bstore,BlobFilePointerRef const& f) - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ReadFileActor(Reference const& bstoreProvider,BlobFilePointerRef const& f) + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" : Actor>(), - ReadFileActorState(bstore, f) + ReadFileActorState(bstoreProvider, f) { fdb_probe_actor_enter("readFile", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -353,45 +352,45 @@ friend struct ActorCallback< ReadFileActor, 1, int >; } }; } - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" -[[nodiscard]] Future> readFile( Reference const& bstore, BlobFilePointerRef const& f ) { - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - return Future>(new ReadFileActor(bstore, f)); - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" +[[nodiscard]] Future> readFile( Reference const& bstoreProvider, BlobFilePointerRef const& f ) { + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + return Future>(new ReadFileActor(bstoreProvider, f)); + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" } -#line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" +#line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" // TODO: improve the interface of this function so that it doesn't need // to be passed the entire BlobWorkerStats object // FIXME: probably want to chunk this up with yields to avoid slow task for blob worker re-snapshotting by calling the // sub-functions that BlobGranuleFiles actually exposes? - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" namespace { // This generated class is to be used only via readBlobGranule() - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" template - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" class ReadBlobGranuleActorState { - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" public: - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - ReadBlobGranuleActorState(BlobGranuleChunkRef const& chunk,KeyRangeRef const& keyRange,Version const& beginVersion,Version const& readVersion,Reference const& bstore,Optional const& stats) - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ReadBlobGranuleActorState(BlobGranuleChunkRef const& chunk,KeyRangeRef const& keyRange,Version const& beginVersion,Version const& readVersion,Reference const& bstore,Optional const& stats) + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" : chunk(chunk), - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" keyRange(keyRange), - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" beginVersion(beginVersion), - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" readVersion(readVersion), - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" bstore(bstore), - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" stats(stats) - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" { fdb_probe_actor_create("readBlobGranule", reinterpret_cast(this)); @@ -404,62 +403,62 @@ class ReadBlobGranuleActorState { int a_body1(int loopDepth=0) { try { - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" ASSERT(readVersion == chunk.includedVersion); - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" arena = Arena(); - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" try { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" Future> readSnapshotFuture; - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" if (chunk.snapshotFile.present()) - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" { - #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" readSnapshotFuture = readFile(bstore, chunk.snapshotFile.get()); - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" if (stats.present()) - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" { - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" ++stats.get()->s3GetReqs; - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" } } - #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" readDeltaFutures = std::vector>>(); - #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" readDeltaFutures.reserve(chunk.deltaFiles.size()); - #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" for( BlobFilePointerRef deltaFile : chunk.deltaFiles ) { - #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" readDeltaFutures.push_back(readFile(bstore, deltaFile)); - #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" if (stats.present()) - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" { - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" ++stats.get()->s3GetReqs; - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" } } - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" snapshotData = Optional(); - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" if (chunk.snapshotFile.present()) - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" { - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" StrictFuture> __when_expr_0 = readSnapshotFuture; - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" loopDepth = 0; } else @@ -492,9 +491,9 @@ class ReadBlobGranuleActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -506,35 +505,37 @@ class ReadBlobGranuleActorState { } int a_body1cont2(int loopDepth) { - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" numDeltaFiles = chunk.deltaFiles.size(); - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - deltaData = new (arena) StringRef[numDeltaFiles]; - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + deltaData = std::vector(); + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" deltaIdx = int(); - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + deltaData.reserve(numDeltaFiles); + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" deltaIdx = 0; - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" loopDepth = a_body1cont2loopHead1(loopDepth); return loopDepth; } int a_body1cont7(int loopDepth) { - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" arena.dependsOn(s.arena()); - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" snapshotData = s; - #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; } int a_body1when1(Standalone const& __s,int loopDepth) { - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" s = __s; - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" loopDepth = a_body1cont7(loopDepth); return loopDepth; @@ -599,10 +600,12 @@ class ReadBlobGranuleActorState { } int a_body1cont9(int loopDepth) { - #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(materializeBlobGranule(chunk, keyRange, beginVersion, readVersion, snapshotData, deltaData)); this->~ReadBlobGranuleActorState(); static_cast(this)->destroy(); return 0; } - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" - new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(materializeBlobGranule(chunk, keyRange, beginVersion, readVersion, snapshotData, deltaData)); + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + GranuleMaterializeStats stats; + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(materializeBlobGranule(chunk, keyRange, beginVersion, readVersion, snapshotData, deltaData, stats)); this->~ReadBlobGranuleActorState(); static_cast(this)->destroy(); return 0; } + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(materializeBlobGranule(chunk, keyRange, beginVersion, readVersion, snapshotData, deltaData, stats)); this->~ReadBlobGranuleActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -618,22 +621,22 @@ class ReadBlobGranuleActorState { } int a_body1cont2loopBody1(int loopDepth) { - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" if (!(deltaIdx < numDeltaFiles)) - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" { return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" StrictFuture> __when_expr_1 = readDeltaFutures[deltaIdx]; - #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -653,26 +656,26 @@ class ReadBlobGranuleActorState { } int a_body1cont2loopBody1cont1(Standalone const& data,int loopDepth) { - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - deltaData[deltaIdx] = data; - #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + deltaData.push_back(data); + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" arena.dependsOn(data.arena()); - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" deltaIdx++; - #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" if (loopDepth == 0) return a_body1cont2loopHead1(0); return loopDepth; } int a_body1cont2loopBody1cont1(Standalone && data,int loopDepth) { - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - deltaData[deltaIdx] = data; - #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + deltaData.push_back(data); + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" arena.dependsOn(data.arena()); - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" deltaIdx++; - #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" if (loopDepth == 0) return a_body1cont2loopHead1(0); return loopDepth; @@ -740,38 +743,38 @@ class ReadBlobGranuleActorState { fdb_probe_actor_exit("readBlobGranule", reinterpret_cast(this), 1); } - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" BlobGranuleChunkRef chunk; - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" KeyRangeRef keyRange; - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" Version beginVersion; - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" Version readVersion; - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - Reference bstore; - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + Reference bstore; + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" Optional stats; - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" Arena arena; - #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" std::vector>> readDeltaFutures; - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" Optional snapshotData; - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" Standalone s; - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" int numDeltaFiles; - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - StringRef* deltaData; - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + std::vector deltaData; + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" int deltaIdx; - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" }; // This generated class is to be used only via readBlobGranule() - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" class ReadBlobGranuleActor final : public Actor, public ActorCallback< ReadBlobGranuleActor, 0, Standalone >, public ActorCallback< ReadBlobGranuleActor, 1, Standalone >, public FastAllocated, public ReadBlobGranuleActorState { - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -781,9 +784,9 @@ class ReadBlobGranuleActor final : public Actor, public ActorCallba #pragma clang diagnostic pop friend struct ActorCallback< ReadBlobGranuleActor, 0, Standalone >; friend struct ActorCallback< ReadBlobGranuleActor, 1, Standalone >; - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - ReadBlobGranuleActor(BlobGranuleChunkRef const& chunk,KeyRangeRef const& keyRange,Version const& beginVersion,Version const& readVersion,Reference const& bstore,Optional const& stats) - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ReadBlobGranuleActor(BlobGranuleChunkRef const& chunk,KeyRangeRef const& keyRange,Version const& beginVersion,Version const& readVersion,Reference const& bstore,Optional const& stats) + #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" : Actor(), ReadBlobGranuleActorState(chunk, keyRange, beginVersion, readVersion, bstore, stats) { @@ -808,37 +811,37 @@ friend struct ActorCallback< ReadBlobGranuleActor, 1, Standalone >; } }; } - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" -[[nodiscard]] Future readBlobGranule( BlobGranuleChunkRef const& chunk, KeyRangeRef const& keyRange, Version const& beginVersion, Version const& readVersion, Reference const& bstore, Optional const& stats ) { - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" +[[nodiscard]] Future readBlobGranule( BlobGranuleChunkRef const& chunk, KeyRangeRef const& keyRange, Version const& beginVersion, Version const& readVersion, Reference const& bstore, Optional const& stats ) { + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" return Future(new ReadBlobGranuleActor(chunk, keyRange, beginVersion, readVersion, bstore, stats)); - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" } -#line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" +#line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" // TODO probably should add things like limit/bytelimit at some point? - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" namespace { // This generated class is to be used only via readBlobGranules() - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" template - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" class ReadBlobGranulesActorState { - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" public: - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - ReadBlobGranulesActorState(BlobGranuleFileRequest const& request,BlobGranuleFileReply const& reply,Reference const& bstore,PromiseStream const& results) - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ReadBlobGranulesActorState(BlobGranuleFileRequest const& request,BlobGranuleFileReply const& reply,Reference const& bstore,PromiseStream const& results) + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" : request(request), - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" reply(reply), - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" bstore(bstore), - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" results(results) - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" { fdb_probe_actor_create("readBlobGranules", reinterpret_cast(this)); @@ -852,11 +855,11 @@ class ReadBlobGranulesActorState { { try { try { - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" i = int(); - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" i = 0; - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -883,9 +886,9 @@ class ReadBlobGranulesActorState { } int a_body1cont1(int loopDepth) { - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReadBlobGranulesActorState(); static_cast(this)->destroy(); return 0; } - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ReadBlobGranulesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -896,9 +899,9 @@ class ReadBlobGranulesActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" results.sendError(e); - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); } catch (Error& error) { @@ -911,9 +914,9 @@ class ReadBlobGranulesActorState { } int a_body1cont2(int loopDepth) { - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" results.sendError(end_of_stream()); - #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" loopDepth = a_body1cont4(loopDepth); return loopDepth; @@ -927,22 +930,22 @@ class ReadBlobGranulesActorState { } int a_body1loopBody1(int loopDepth) { - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" if (!(i < reply.chunks.size())) - #line 932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" StrictFuture __when_expr_0 = readBlobGranule(reply.chunks[i], request.keyRange, request.beginVersion, request.readVersion, bstore); - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -962,22 +965,22 @@ class ReadBlobGranulesActorState { } int a_body1loopBody1cont1(RangeResult const& chunkResult,int loopDepth) { - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" results.send(std::move(chunkResult)); - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" i++; - #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(RangeResult && chunkResult,int loopDepth) { - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" results.send(std::move(chunkResult)); - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" i++; - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -1058,22 +1061,22 @@ class ReadBlobGranulesActorState { return loopDepth; } - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" BlobGranuleFileRequest request; - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" BlobGranuleFileReply reply; - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - Reference bstore; - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + Reference bstore; + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" PromiseStream results; - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" int i; - #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" }; // This generated class is to be used only via readBlobGranules() - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" class ReadBlobGranulesActor final : public Actor, public ActorCallback< ReadBlobGranulesActor, 0, RangeResult >, public FastAllocated, public ReadBlobGranulesActorState { - #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1082,9 +1085,9 @@ class ReadBlobGranulesActor final : public Actor, public ActorCallback< Re void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ReadBlobGranulesActor, 0, RangeResult >; - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" - ReadBlobGranulesActor(BlobGranuleFileRequest const& request,BlobGranuleFileReply const& reply,Reference const& bstore,PromiseStream const& results) - #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ReadBlobGranulesActor(BlobGranuleFileRequest const& request,BlobGranuleFileReply const& reply,Reference const& bstore,PromiseStream const& results) + #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" : Actor(), ReadBlobGranulesActorState(request, reply, bstore, results) { @@ -1108,11 +1111,253 @@ friend struct ActorCallback< ReadBlobGranulesActor, 0, RangeResult >; } }; } - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" -[[nodiscard]] Future readBlobGranules( BlobGranuleFileRequest const& request, BlobGranuleFileReply const& reply, Reference const& bstore, PromiseStream const& results ) { - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" +[[nodiscard]] Future readBlobGranules( BlobGranuleFileRequest const& request, BlobGranuleFileReply const& reply, Reference const& bstore, PromiseStream const& results ) { + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" return Future(new ReadBlobGranulesActor(request, reply, bstore, results)); - #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" +} + +#line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + +// Return true if a given range is fully covered by blob chunks +bool isRangeFullyCovered(KeyRange range, Standalone> blobChunks) { + std::vector blobRanges; + for (const BlobGranuleChunkRef& chunk : blobChunks) { + blobRanges.push_back(chunk.keyRange); + } + return range.isCovered(blobRanges); +} + +void testAddChunkRange(KeyRef begin, KeyRef end, Standalone>& chunks) { + BlobGranuleChunkRef chunk; + chunk.keyRange = KeyRangeRef(begin, end); + chunks.push_back(chunks.arena(), chunk); +} + + #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase152() + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" +template + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" +class FlowTestCase152ActorState { + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" +public: + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + FlowTestCase152ActorState(UnitTestParameters const& params) + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + : params(params) + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase152", reinterpret_cast(this)); + + } + ~FlowTestCase152ActorState() + { + fdb_probe_actor_destroy("flowTestCase152", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + Standalone> chunks; + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + testAddChunkRange("key_a1"_sr, "key_a9"_sr, chunks); + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + testAddChunkRange("key_b1"_sr, "key_b9"_sr, chunks); + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + { + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(isRangeFullyCovered(KeyRangeRef(), chunks) == false); + #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + } + { + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + Standalone> empyChunks; + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(isRangeFullyCovered(KeyRangeRef(), empyChunks) == false); + #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + } + { + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(isRangeFullyCovered(KeyRangeRef(""_sr, "\xff"_sr), chunks) == false); + #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + } + { + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(isRangeFullyCovered(KeyRangeRef("key_a1"_sr, "key_a9"_sr), chunks)); + #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + } + { + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(isRangeFullyCovered(KeyRangeRef("key_a1"_sr, "key_a3"_sr), chunks)); + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + } + { + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(isRangeFullyCovered(KeyRangeRef("key_a0"_sr, "key_a3"_sr), chunks) == false); + #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + } + { + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + auto range = KeyRangeRef("key_a5"_sr, "key_b5"_sr); + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(isRangeFullyCovered(range, chunks) == false); + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(range.begin == "key_a5"_sr); + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(range.end == "key_b5"_sr); + #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + } + { + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + Standalone> continuedChunks; + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + testAddChunkRange("key_a1"_sr, "key_a9"_sr, continuedChunks); + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + testAddChunkRange("key_a9"_sr, "key_b1"_sr, continuedChunks); + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + testAddChunkRange("key_b1"_sr, "key_b9"_sr, continuedChunks); + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(isRangeFullyCovered(KeyRangeRef("key_a1"_sr, "key_b9"_sr), continuedChunks)); + #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + } + { + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + std::vector ranges; + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_a"_sr, "key_b"_sr)); + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_x"_sr, "key_y"_sr)); + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(KeyRangeRef("key_x"_sr, "key_y"_sr).isCovered(ranges)); + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.clear(); + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_a"_sr, "key_b"_sr)); + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_v"_sr, "key_y"_sr)); + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(KeyRangeRef("key_x"_sr, "key_y"_sr).isCovered(ranges)); + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.clear(); + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_a"_sr, "key_b"_sr)); + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_x"_sr, "key_xa"_sr)); + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_xa"_sr, "key_ya"_sr)); + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(KeyRangeRef("key_x"_sr, "key_y"_sr).isCovered(ranges)); + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.clear(); + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_a"_sr, "key_b"_sr)); + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_x"_sr, "key_xa"_sr)); + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_xa"_sr, "key_xb"_sr)); + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(!KeyRangeRef("key_x"_sr, "key_y"_sr).isCovered(ranges)); + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.clear(); + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_a"_sr, "key_b"_sr)); + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_x"_sr, "key_xa"_sr)); + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(!KeyRangeRef("key_x"_sr, "key_y"_sr).isCovered(ranges)); + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.clear(); + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_a"_sr, "key_b"_sr)); + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_xa"_sr, "key_y"_sr)); + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(!KeyRangeRef("key_x"_sr, "key_y"_sr).isCovered(ranges)); + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.clear(); + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_a"_sr, "key_b"_sr)); + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ranges.push_back(KeyRangeRef("key_x"_sr, "key_y"_sr)); + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + ASSERT(!KeyRangeRef("key_a"_sr, "key_y"_sr).isCovered(ranges)); + #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + } + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase152ActorState(); static_cast(this)->destroy(); return 0; } + #line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase152ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase152ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + UnitTestParameters params; + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase152() + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" +class FlowTestCase152Actor final : public Actor, public FastAllocated, public FlowTestCase152ActorState { + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + FlowTestCase152Actor(UnitTestParameters const& params) + #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" + : Actor(), + FlowTestCase152ActorState(params) + { + fdb_probe_actor_enter("flowTestCase152", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase152"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase152", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" +static Future flowTestCase152( UnitTestParameters const& params ) { + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" + return Future(new FlowTestCase152Actor(params)); + #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.cpp" } +ACTOR_TEST_CASE(flowTestCase152, "/fdbserver/blobgranule/isRangeCoveredByBlob") -#line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" +#line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.cpp" diff --git a/src/fdbclient/BlobMetadataUtils.cpp b/src/fdbclient/BlobMetadataUtils.cpp new file mode 100644 index 0000000..a8c8480 --- /dev/null +++ b/src/fdbclient/BlobMetadataUtils.cpp @@ -0,0 +1,107 @@ +/* + * BlobMetadataUtils.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/BlobMetadataUtils.h" + +#include "fmt/format.h" +#include "flow/IRandom.h" +#include "flow/flow.h" +#include "fdbclient/Knobs.h" +#include "flow/IConnection.h" +#include "fdbclient/S3BlobStore.h" + +std::string buildPartitionPath(const std::string& url, const std::string& partition) { + ASSERT(!partition.empty()); + ASSERT(partition.front() != '/'); + ASSERT(partition.back() == '/'); + StringRef u(url); + if (u.startsWith("file://"_sr)) { + ASSERT(u.endsWith("/"_sr)); + return url + partition; + } else if (u.startsWith("blobstore://"_sr)) { + std::string resource; + std::string lastOpenError; + S3BlobStoreEndpoint::ParametersT backupParams; + + std::string urlCopy = url; + + Reference bstore = + S3BlobStoreEndpoint::fromString(url, {}, &resource, &lastOpenError, &backupParams); + + ASSERT(!resource.empty()); + ASSERT(resource.back() != '/'); + size_t resourceStart = url.find(resource); + ASSERT(resourceStart != std::string::npos); + + return urlCopy.insert(resourceStart + resource.size(), "/" + partition); + } else { + // FIXME: support azure + throw backup_invalid_url(); + } +} + +// FIXME: make this (more) deterministic outside of simulation for FDBPerfKmsConnector +Standalone createRandomTestBlobMetadata(const std::string& baseUrl, + BlobMetadataDomainId domainId) { + Standalone metadata; + metadata.domainId = domainId; + // 0 == no partition, 1 == suffix partitioned, 2 == storage location partitioned + int type = deterministicRandom()->randomInt(0, 3); + int partitionCount = (type == 0) ? 0 : deterministicRandom()->randomInt(2, 12); + TraceEvent ev(SevDebug, "SimBlobMetadata"); + ev.detail("DomainId", domainId).detail("TypeNum", type).detail("PartitionCount", partitionCount); + if (type == 0) { + // single storage location + std::string partition = std::to_string(domainId) + "/"; + metadata.base = StringRef(metadata.arena(), buildPartitionPath(baseUrl, partition)); + ev.detail("Base", metadata.base); + } + if (type == 1) { + // simulate hash prefixing in s3 + metadata.base = StringRef(metadata.arena(), baseUrl); + ev.detail("Base", metadata.base); + for (int i = 0; i < partitionCount; i++) { + metadata.partitions.push_back_deep(metadata.arena(), + deterministicRandom()->randomUniqueID().shortString() + "-" + + std::to_string(domainId) + "/"); + ev.detail("P" + std::to_string(i), metadata.partitions.back()); + } + } + if (type == 2) { + // simulate separate storage location per partition + for (int i = 0; i < partitionCount; i++) { + std::string partition = std::to_string(domainId) + "_" + std::to_string(i) + "/"; + metadata.partitions.push_back_deep(metadata.arena(), buildPartitionPath(baseUrl, partition)); + ev.detail("P" + std::to_string(i), metadata.partitions.back()); + } + } + + // set random refresh + expire time + if (deterministicRandom()->coinflip()) { + metadata.refreshAt = now() + deterministicRandom()->random01() * CLIENT_KNOBS->BLOB_METADATA_REFRESH_INTERVAL; + metadata.expireAt = + metadata.refreshAt + deterministicRandom()->random01() * CLIENT_KNOBS->BLOB_METADATA_REFRESH_INTERVAL; + } else { + metadata.refreshAt = std::numeric_limits::max(); + metadata.expireAt = metadata.refreshAt; + } + + return metadata; +} \ No newline at end of file diff --git a/src/fdbclient/BlobWorkerCommon.h b/src/fdbclient/BlobWorkerCommon.h deleted file mode 100644 index 061213e..0000000 --- a/src/fdbclient/BlobWorkerCommon.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * BlobWorkerCommon.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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. - */ - -#ifndef FDBCLIENT_BLOBWORKERCOMMON_H -#define FDBCLIENT_BLOBWORKERCOMMON_H - -#include "fdbrpc/Stats.h" - -struct BlobWorkerStats { - CounterCollection cc; - Counter s3PutReqs, s3GetReqs, s3DeleteReqs; - Counter deltaFilesWritten, snapshotFilesWritten; - Counter deltaBytesWritten, snapshotBytesWritten; - Counter bytesReadFromFDBForInitialSnapshot; - Counter bytesReadFromS3ForCompaction; - Counter rangeAssignmentRequests, readRequests; - Counter wrongShardServer; - Counter changeFeedInputBytes; - Counter readReqTotalFilesReturned; - Counter readReqDeltaBytesReturned; - Counter commitVersionChecks; - Counter granuleUpdateErrors; - Counter granuleRequestTimeouts; - Counter readRequestsWithBegin; - Counter readRequestsCollapsed; - - int numRangesAssigned; - int mutationBytesBuffered; - int activeReadRequests; - int granulesPendingSplitCheck; - - Future logger; - - // Current stats maintained for a given blob worker process - explicit BlobWorkerStats(UID id, double interval) - : cc("BlobWorkerStats", id.toString()), - - s3PutReqs("S3PutReqs", cc), s3GetReqs("S3GetReqs", cc), s3DeleteReqs("S3DeleteReqs", cc), - deltaFilesWritten("DeltaFilesWritten", cc), snapshotFilesWritten("SnapshotFilesWritten", cc), - deltaBytesWritten("DeltaBytesWritten", cc), snapshotBytesWritten("SnapshotBytesWritten", cc), - bytesReadFromFDBForInitialSnapshot("BytesReadFromFDBForInitialSnapshot", cc), - bytesReadFromS3ForCompaction("BytesReadFromS3ForCompaction", cc), - rangeAssignmentRequests("RangeAssignmentRequests", cc), readRequests("ReadRequests", cc), - wrongShardServer("WrongShardServer", cc), changeFeedInputBytes("RangeFeedInputBytes", cc), - readReqTotalFilesReturned("ReadReqTotalFilesReturned", cc), - readReqDeltaBytesReturned("ReadReqDeltaBytesReturned", cc), commitVersionChecks("CommitVersionChecks", cc), - granuleUpdateErrors("GranuleUpdateErrors", cc), granuleRequestTimeouts("GranuleRequestTimeouts", cc), - readRequestsWithBegin("ReadRequestsWithBegin", cc), readRequestsCollapsed("ReadRequestsCollapsed", cc), - numRangesAssigned(0), mutationBytesBuffered(0), activeReadRequests(0), granulesPendingSplitCheck(0) { - specialCounter(cc, "NumRangesAssigned", [this]() { return this->numRangesAssigned; }); - specialCounter(cc, "MutationBytesBuffered", [this]() { return this->mutationBytesBuffered; }); - specialCounter(cc, "ActiveReadRequests", [this]() { return this->activeReadRequests; }); - specialCounter(cc, "GranulesPendingSplitCheck", [this]() { return this->granulesPendingSplitCheck; }); - - logger = traceCounters("BlobWorkerMetrics", id, interval, &cc, "BlobWorkerMetrics"); - } -}; - -#endif \ No newline at end of file diff --git a/src/fdbclient/BuildFlags.h.in b/src/fdbclient/BuildFlags.h.in index 6f94c54..b55c7e5 100644 --- a/src/fdbclient/BuildFlags.h.in +++ b/src/fdbclient/BuildFlags.h.in @@ -33,6 +33,9 @@ #define C_VERSION_MINOR 0 #endif +const char* kDate = __DATE__; +const char* kTime = __TIME__; + // FDB info. const std::string kGitHash = "@CURRENT_GIT_VERSION_WNL@"; const std::string kFdbVersion = "@FDB_VERSION@"; @@ -43,7 +46,7 @@ const std::string kArch = "@CMAKE_SYSTEM@"; const std::string kCompiler = "@CMAKE_CXX_COMPILER_ID@"; // Library versions. -const std::string kBoostVersion = "@Boost_LIB_VERSION@"; +const std::string kBoostVersion = BOOST_LIB_VERSION; // Build info and flags. const std::string kCMakeVersion = "@CMAKE_VERSION@"; @@ -61,6 +64,9 @@ std::string jsonBuildInformation() { json_spirit::mValue json; JSONDoc doc(json); + doc.create("build_date") = kDate; + doc.create("build_time") = kTime; + doc.create("git_hash") = kGitHash; doc.create("fdb_version") = kFdbVersion; diff --git a/src/fdbclient/CMakeLists.txt b/src/fdbclient/CMakeLists.txt index 4bc0ab2..229eb78 100644 --- a/src/fdbclient/CMakeLists.txt +++ b/src/fdbclient/CMakeLists.txt @@ -3,6 +3,7 @@ glob_flow_source(FDBCLIENT_SRC) list(APPEND FDBCLIENT_SRC sha1/SHA1.cpp) add_library(fdbclient STATIC ${FDBCLIENT_SRC}) +target_include_directories(fdbclient PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) target_link_libraries(fdbclient PRIVATE fdbrpc diff --git a/src/fdbclient/ClientKnobs.cpp b/src/fdbclient/ClientKnobs.cpp index 13f2d9d..bd76bb6 100644 --- a/src/fdbclient/ClientKnobs.cpp +++ b/src/fdbclient/ClientKnobs.cpp @@ -22,7 +22,9 @@ #include "fdbclient/FDBTypes.h" #include "fdbclient/SystemData.h" #include "fdbclient/Tenant.h" +#include "flow/IRandom.h" #include "flow/UnitTest.h" +#include "flow/flow.h" #define init(...) KNOB_FN(__VA_ARGS__, INIT_ATOMIC_KNOB, INIT_KNOB)(__VA_ARGS__) @@ -41,10 +43,6 @@ void ClientKnobs::initialize(Randomize randomize) { init( FAILURE_MAX_DELAY, 5.0 ); init( FAILURE_MIN_DELAY, 4.0 ); if( randomize && BUGGIFY ) FAILURE_MIN_DELAY = 1.0; - init( FAILURE_TIMEOUT_DELAY, FAILURE_MIN_DELAY ); - init( CLIENT_FAILURE_TIMEOUT_DELAY, FAILURE_MIN_DELAY ); - init( FAILURE_EMERGENCY_DELAY, 30.0 ); - init( FAILURE_MAX_GENERATIONS, 10 ); init( RECOVERY_DELAY_START_GENERATION, 70 ); init( RECOVERY_DELAY_SECONDS_PER_GENERATION, 60.0 ); init( MAX_GENERATIONS, 100 ); @@ -64,7 +62,7 @@ void ClientKnobs::initialize(Randomize randomize) { init( WRONG_SHARD_SERVER_DELAY, .01 ); if( randomize && BUGGIFY ) WRONG_SHARD_SERVER_DELAY = deterministicRandom()->random01(); // FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY; // SOMEDAY: This delay can limit performance of retrieving data when the cache is mostly wrong (e.g. dumping the database after a test) init( FUTURE_VERSION_RETRY_DELAY, .01 ); if( randomize && BUGGIFY ) FUTURE_VERSION_RETRY_DELAY = deterministicRandom()->random01();// FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY; init( GRV_ERROR_RETRY_DELAY, 5.0 ); if( randomize && BUGGIFY ) GRV_ERROR_RETRY_DELAY = 0.01 + 5 * deterministicRandom()->random01(); - init( UNKNOWN_TENANT_RETRY_DELAY, 0.0 ); if( randomize && BUGGIFY ) UNKNOWN_TENANT_RETRY_DELAY = deterministicRandom()->random01(); + init( UNKNOWN_TENANT_RETRY_DELAY, .01 ); if( randomize && BUGGIFY ) UNKNOWN_TENANT_RETRY_DELAY = 0.01 + deterministicRandom()->random01(); init( REPLY_BYTE_LIMIT, 80000 ); init( DEFAULT_BACKOFF, .01 ); if( randomize && BUGGIFY ) DEFAULT_BACKOFF = deterministicRandom()->random01(); init( DEFAULT_MAX_BACKOFF, 1.0 ); @@ -82,9 +80,13 @@ void ClientKnobs::initialize(Randomize randomize) { init( METADATA_VERSION_CACHE_SIZE, 1000 ); init( CHANGE_FEED_LOCATION_LIMIT, 10000 ); init( CHANGE_FEED_CACHE_SIZE, 100000 ); if( randomize && BUGGIFY ) CHANGE_FEED_CACHE_SIZE = 1; - init( CHANGE_FEED_POP_TIMEOUT, 5.0 ); + init( CHANGE_FEED_POP_TIMEOUT, 10.0 ); init( CHANGE_FEED_STREAM_MIN_BYTES, 1e4 ); if( randomize && BUGGIFY ) CHANGE_FEED_STREAM_MIN_BYTES = 1; - init( TENANT_PREFIX_SIZE_LIMIT, 28 ); ASSERT(TENANT_PREFIX_SIZE_LIMIT >= TenantMapEntry::ROOT_PREFIX_SIZE); // includes 8-byte ID and optional tenant subspace + init( CHANGE_FEED_START_INTERVAL, 20.0 ); if( randomize && BUGGIFY ) CHANGE_FEED_START_INTERVAL = 10.0; + init( CHANGE_FEED_COALESCE_LOCATIONS, false ); if( randomize && BUGGIFY ) CHANGE_FEED_COALESCE_LOCATIONS = false; + init( CHANGE_FEED_CACHE_FLUSH_BYTES, 10e6 ); if( randomize && BUGGIFY ) CHANGE_FEED_CACHE_FLUSH_BYTES = deterministicRandom()->randomInt64(1, 1e6); + init( CHANGE_FEED_CACHE_EXPIRE_TIME, 60.0 ); if( randomize && BUGGIFY ) CHANGE_FEED_CACHE_EXPIRE_TIME = 1.0; + init( CHANGE_FEED_CACHE_LIMIT_BYTES, 500000 ); if( randomize && BUGGIFY ) CHANGE_FEED_CACHE_LIMIT_BYTES = 50000; init( MAX_BATCH_SIZE, 1000 ); if( randomize && BUGGIFY ) MAX_BATCH_SIZE = 1; init( GRV_BATCH_TIMEOUT, 0.005 ); if( randomize && BUGGIFY ) GRV_BATCH_TIMEOUT = 0.1; @@ -95,8 +97,6 @@ void ClientKnobs::initialize(Randomize randomize) { init( LOCATION_CACHE_EVICTION_SIZE_SIM, 10 ); if( randomize && BUGGIFY ) LOCATION_CACHE_EVICTION_SIZE_SIM = 3; init( LOCATION_CACHE_ENDPOINT_FAILURE_GRACE_PERIOD, 60 ); init( LOCATION_CACHE_FAILED_ENDPOINT_RETRY_INTERVAL, 60 ); - init( TENANT_CACHE_EVICTION_SIZE, 100000 ); - init( TENANT_CACHE_EVICTION_SIZE_SIM, 10 ); if( randomize && BUGGIFY ) TENANT_CACHE_EVICTION_SIZE_SIM = 3; init( GET_RANGE_SHARD_LIMIT, 2 ); init( WARM_RANGE_SHARD_LIMIT, 100 ); @@ -160,8 +160,6 @@ void ClientKnobs::initialize(Randomize randomize) { init( BACKUP_AGGREGATE_POLL_RATE_UPDATE_INTERVAL, 60); init( BACKUP_AGGREGATE_POLL_RATE, 2.0 ); // polls per second target for all agents on the cluster init( BACKUP_LOG_WRITE_BATCH_MAX_SIZE, 1e6 ); //Must be much smaller than TRANSACTION_SIZE_LIMIT - init( BACKUP_LOG_ATOMIC_OPS_SIZE, 1000 ); - init( BACKUP_OPERATION_COST_OVERHEAD, 50 ); init( BACKUP_MAX_LOG_RANGES, 21 ); if( randomize && BUGGIFY ) BACKUP_MAX_LOG_RANGES = 4; init( BACKUP_SIM_COPY_LOG_RANGES, 100 ); init( BACKUP_VERSION_DELAY, 5*CORE_VERSIONSPERSECOND ); @@ -195,7 +193,9 @@ void ClientKnobs::initialize(Randomize randomize) { init( BACKUP_STATUS_JITTER, 0.05 ); init( MIN_CLEANUP_SECONDS, 3600.0 ); init( FASTRESTORE_ATOMICOP_WEIGHT, 1 ); if( randomize && BUGGIFY ) { FASTRESTORE_ATOMICOP_WEIGHT = deterministicRandom()->random01() * 200 + 1; } - init( BACKUP_AGENT_VERBOSE_LOGGING, false ); if (randomize && BUGGIFY) { BACKUP_AGENT_VERBOSE_LOGGING = true; } + init( RESTORE_RANGES_READ_BATCH, 10000 ); + init( BLOB_GRANULE_RESTORE_CHECK_INTERVAL, 10 ); + init( BACKUP_CONTAINER_LOCAL_ALLOW_RELATIVE_PATH, false ); // Configuration init( DEFAULT_AUTO_COMMIT_PROXIES, 3 ); @@ -205,10 +205,13 @@ void ClientKnobs::initialize(Randomize randomize) { init( DEFAULT_COMMIT_GRV_PROXIES_RATIO, 3 ); init( DEFAULT_MAX_GRV_PROXIES, 4 ); + init( GLOBAL_CONFIG_REFRESH_BACKOFF, 0.5 ); + init( GLOBAL_CONFIG_REFRESH_MAX_BACKOFF, 60.0 ); + init( GLOBAL_CONFIG_REFRESH_TIMEOUT, 10.0 ); + init( IS_ACCEPTABLE_DELAY, 1.5 ); init( HTTP_REQUEST_AWS_V4_HEADER, true ); - init( HTTP_RESPONSE_SKIP_VERIFY_CHECKSUM_FOR_PARTIAL_CONTENT, false ); init( BLOBSTORE_ENCRYPTION_TYPE, "" ); init( BLOBSTORE_CONNECT_TRIES, 10 ); init( BLOBSTORE_CONNECT_TIMEOUT, 10 ); @@ -222,11 +225,17 @@ void ClientKnobs::initialize(Randomize randomize) { init( BLOBSTORE_CONCURRENT_WRITES_PER_FILE, 5 ); init( BLOBSTORE_CONCURRENT_READS_PER_FILE, 3 ); + init( BLOBSTORE_ENABLE_READ_CACHE, true ); init( BLOBSTORE_READ_BLOCK_SIZE, 1024 * 1024 ); init( BLOBSTORE_READ_AHEAD_BLOCKS, 0 ); init( BLOBSTORE_READ_CACHE_BLOCKS_PER_FILE, 2 ); init( BLOBSTORE_MULTIPART_MAX_PART_SIZE, 20000000 ); init( BLOBSTORE_MULTIPART_MIN_PART_SIZE, 5242880 ); + init( BLOBSTORE_GLOBAL_CONNECTION_POOL, false ); + init( BLOBSTORE_ENABLE_LOGGING, true ); + init( BLOBSTORE_STATS_LOGGING_INTERVAL, 10.0 ); + init( BLOBSTORE_LATENCY_LOGGING_INTERVAL, 120.0 ); + init( BLOBSTORE_LATENCY_LOGGING_ACCURACY, 0.01 ); // These are basically unlimited by default but can be used to reduce blob IO if needed init( BLOBSTORE_REQUESTS_PER_SECOND, 200 ); @@ -265,25 +274,52 @@ void ClientKnobs::initialize(Randomize randomize) { // transaction tags init( MAX_TAGS_PER_TRANSACTION, 5 ); - init( MAX_TRANSACTION_TAG_LENGTH, 16 ); + init( MAX_TRANSACTION_TAG_LENGTH, 255 ); init( COMMIT_SAMPLE_COST, 100 ); if( randomize && BUGGIFY ) COMMIT_SAMPLE_COST = 10; - init( WRITE_COST_BYTE_FACTOR, 16384 ); if( randomize && BUGGIFY ) WRITE_COST_BYTE_FACTOR = 4096; init( INCOMPLETE_SHARD_PLUS, 4096 ); init( READ_TAG_SAMPLE_RATE, 0.01 ); if( randomize && BUGGIFY ) READ_TAG_SAMPLE_RATE = 1.0; // Communicated to clients from cluster init( TAG_THROTTLE_SMOOTHING_WINDOW, 2.0 ); init( TAG_THROTTLE_RECHECK_INTERVAL, 5.0 ); if( randomize && BUGGIFY ) TAG_THROTTLE_RECHECK_INTERVAL = 0.0; init( TAG_THROTTLE_EXPIRATION_INTERVAL, 60.0 ); if( randomize && BUGGIFY ) TAG_THROTTLE_EXPIRATION_INTERVAL = 1.0; + init( TAG_THROTTLING_PAGE_SIZE, 4096 ); if( randomize && BUGGIFY ) TAG_THROTTLING_PAGE_SIZE = 4096; + init( GLOBAL_TAG_THROTTLING_RW_FUNGIBILITY_RATIO, 4.0 ); + init( PROXY_MAX_TAG_THROTTLE_DURATION, 5.0 ); if( randomize && BUGGIFY ) PROXY_MAX_TAG_THROTTLE_DURATION = 0.5; // busyness reporting init( BUSYNESS_SPIKE_START_THRESHOLD, 0.100 ); init( BUSYNESS_SPIKE_SATURATED_THRESHOLD, 0.500 ); - // multi-version client control - init( MVC_CLIENTLIB_CHUNK_SIZE, 8*1024 ); - init( MVC_CLIENTLIB_CHUNKS_PER_TRANSACTION, 32 ); - // Blob granules init( BG_MAX_GRANULE_PARALLELISM, 10 ); + init( BG_TOO_MANY_GRANULES, 20000 ); + init( BLOB_METADATA_REFRESH_INTERVAL, 3600 ); if ( randomize && BUGGIFY ) { BLOB_METADATA_REFRESH_INTERVAL = deterministicRandom()->randomInt(5, 120); } + init( ENABLE_BLOB_GRANULE_FILE_LOGICAL_SIZE, false ); if ( randomize && BUGGIFY ) { ENABLE_BLOB_GRANULE_FILE_LOGICAL_SIZE = true; } + + init( CHANGE_QUORUM_BAD_STATE_RETRY_TIMES, 3 ); + init( CHANGE_QUORUM_BAD_STATE_RETRY_DELAY, 2.0 ); + + // Tenants and Metacluster + init( MAX_TENANTS_PER_CLUSTER, 1e6 ); + init( TENANT_TOMBSTONE_CLEANUP_INTERVAL, 60 ); if ( randomize && BUGGIFY ) TENANT_TOMBSTONE_CLEANUP_INTERVAL = deterministicRandom()->random01() * 30; + init( MAX_DATA_CLUSTERS, 1e5 ); + init( REMOVE_CLUSTER_TENANT_BATCH_SIZE, 1e4 ); if ( randomize && BUGGIFY ) REMOVE_CLUSTER_TENANT_BATCH_SIZE = 1; + init( METACLUSTER_ASSIGNMENT_CLUSTERS_TO_CHECK, 5 ); if ( randomize && BUGGIFY ) METACLUSTER_ASSIGNMENT_CLUSTERS_TO_CHECK = 1; + init( METACLUSTER_ASSIGNMENT_FIRST_CHOICE_DELAY, 1.0 ); if ( randomize && BUGGIFY ) METACLUSTER_ASSIGNMENT_FIRST_CHOICE_DELAY = deterministicRandom()->random01() * 60; + init( METACLUSTER_ASSIGNMENT_AVAILABILITY_TIMEOUT, 10.0 ); if ( randomize && BUGGIFY ) METACLUSTER_ASSIGNMENT_AVAILABILITY_TIMEOUT = 1 + deterministicRandom()->random01() * 59; + init( METACLUSTER_RESTORE_BATCH_SIZE, 1000 ); if ( randomize && BUGGIFY ) METACLUSTER_RESTORE_BATCH_SIZE = 1 + deterministicRandom()->randomInt(0, 3); + init( TENANT_ENTRY_CACHE_LIST_REFRESH_INTERVAL, 2 ); if( randomize && BUGGIFY ) TENANT_ENTRY_CACHE_LIST_REFRESH_INTERVAL = deterministicRandom()->randomInt(1, 10); + init( CLIENT_ENABLE_USING_CLUSTER_ID_KEY, false ); + + init( ENABLE_ENCRYPTION_CPU_TIME_LOGGING, false ); + init( SIMULATION_EKP_TENANT_IDS_TO_DROP, "-1" ); + init( ENABLE_CONFIGURABLE_ENCRYPTION, true ); + init( ENCRYPT_HEADER_FLAGS_VERSION, 1 ); + init( ENCRYPT_HEADER_AES_CTR_NO_AUTH_VERSION, 1 ); + init( ENCRYPT_HEADER_AES_CTR_AES_CMAC_AUTH_VERSION, 1 ); + init( ENCRYPT_HEADER_AES_CTR_HMAC_SHA_AUTH_VERSION, 1 ); + + init( REST_KMS_ALLOW_NOT_SECURE_CONNECTION, false ); if ( randomize && BUGGIFY ) REST_KMS_ALLOW_NOT_SECURE_CONNECTION = !REST_KMS_ALLOW_NOT_SECURE_CONNECTION; + init( SIM_KMS_VAULT_MAX_KEYS, 4096 ); // clang-format on } diff --git a/src/fdbclient/ClientStatusReport.cpp b/src/fdbclient/ClientStatusReport.cpp new file mode 100644 index 0000000..9a3709f --- /dev/null +++ b/src/fdbclient/ClientStatusReport.cpp @@ -0,0 +1,173 @@ +/* + * ClientStatusReport.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/CommitProxyInterface.h" +#include "fdbclient/CoordinationInterface.h" +#include "fdbclient/DatabaseContext.h" +#include "fdbrpc/FlowTransport.h" +#include "fdbclient/json_spirit/json_spirit_value.h" +#include "fdbclient/json_spirit/json_spirit_writer_template.h" +#include + +namespace { + +class ClientReportGenerator { +public: + ClientReportGenerator(DatabaseContext& cx) : cx(cx), healthy(true), numConnectionsFailed(0) {} + + Standalone generateReport() { + if (cx.isError()) { + statusObj["InitializationError"] = cx.deferredError.code(); + healthy = false; + } else { + reportCoordinators(); + reportClientInfo(); + reportStorageServers(); + reportConnections(); + statusObj["Healthy"] = healthy; + } + return StringRef(json_spirit::write_string(json_spirit::mValue(statusObj))); + } + +private: + void reportCoordinators() { + auto& connRecord = cx.connectionRecord->get(); + ClusterConnectionString cs = connRecord->getConnectionString(); + json_spirit::mArray coordArray; + for (const auto& hostName : cs.hostnames) { + coordArray.push_back(hostName.toString()); + } + for (const auto& addr : cs.coords) { + coordArray.push_back(addr.toString()); + serverAddresses.insert(addr); + } + statusObj["Coordinators"] = coordArray; + if (cx.coordinator->get().present()) { + statusObj["CurrentCoordinator"] = cx.coordinator->get().get().getAddressString(); + } + + // Update health status + if (cs.hostnames.size() + cs.coords.size() == 0) { + healthy = false; + } + if (!cx.coordinator->get().present()) { + healthy = false; + } + } + + void reportClientInfo() { + auto& clientInfo = cx.clientInfo->get(); + statusObj["ClusterID"] = clientInfo.clusterId.toString(); + json_spirit::mArray grvProxyArr; + for (const auto& grvProxy : clientInfo.grvProxies) { + serverAddresses.insert(grvProxy.address()); + grvProxyArr.push_back(grvProxy.address().toString()); + } + statusObj["GrvProxies"] = grvProxyArr; + json_spirit::mArray commitProxyArr; + for (const auto& commitProxy : clientInfo.commitProxies) { + serverAddresses.insert(commitProxy.address()); + commitProxyArr.push_back(commitProxy.address().toString()); + } + statusObj["CommitProxies"] = commitProxyArr; + + // Update health status + if (clientInfo.grvProxies.size() == 0 || clientInfo.commitProxies.size() == 0) { + healthy = false; + } + } + + void reportStorageServers() { + json_spirit::mArray storageServerArr; + for (const auto& [ssid, serverInfo] : cx.server_interf) { + json_spirit::mObject serverDesc; + serverDesc["SSID"] = ssid.toString(); + serverDesc["Address"] = serverInfo->interf.address().toString(); + serverAddresses.insert(serverInfo->interf.address()); + storageServerArr.push_back(serverDesc); + } + statusObj["StorageServers"] = storageServerArr; + } + + void reportConnections() { + json_spirit::mArray connectionArr; + for (const auto& addr : serverAddresses) { + connectionArr.push_back(connectionStatusReport(addr)); + } + statusObj["Connections"] = connectionArr; + statusObj["NumConnectionsFailed"] = numConnectionsFailed; + + // Update health status + if (numConnectionsFailed > 0) { + healthy = false; + } + } + + json_spirit::mObject connectionStatusReport(const NetworkAddress& address) { + json_spirit::mObject connStatus; + connStatus["Address"] = address.toString(); + + auto& peers = FlowTransport::transport().getAllPeers(); + auto peerIter = peers.find(address); + + bool failed = IFailureMonitor::failureMonitor().getState(address).isFailed(); + if (failed) { + connStatus["Status"] = "failed"; + numConnectionsFailed++; + } else if (peerIter == peers.end()) { + connStatus["Status"] = "disconnected"; + } else { + connStatus["Status"] = peerIter->second->connected ? "connected" : "connecting"; + } + if (peerIter != peers.end()) { + auto peer = peerIter->second; + double currTime = now(); + connStatus["ConnectFailedCount"] = peer->connectFailedCount; + connStatus["Compatible"] = peer->compatible; + connStatus["LastConnectTime"] = currTime - peer->lastConnectTime; + connStatus["PingCount"] = peer->pingLatencies.getPopulationSize(); + connStatus["PingTimeoutCount"] = peer->timeoutCount; + auto lastLoggedTime = (peer->lastLoggedTime > 0.0) ? peer->lastLoggedTime : peer->lastConnectTime; + connStatus["BytesSampleTime"] = currTime - lastLoggedTime; + connStatus["BytesReceived"] = peer->bytesReceived; + connStatus["BytesSent"] = peer->bytesSent; + auto protocolVersion = peer->protocolVersion->get(); + if (protocolVersion.present()) { + connStatus["ProtocolVersion"] = format("%llx", protocolVersion.get().version()); + } + } + + return connStatus; + } + + DatabaseContext& cx; + json_spirit::mObject statusObj; + std::set serverAddresses; + int numConnectionsFailed; + bool healthy; +}; + +} // namespace + +// Get client-side status information +Standalone DatabaseContext::getClientStatus() { + ClientReportGenerator generator(*this); + return generator.generateReport(); +} \ No newline at end of file diff --git a/src/fdbclient/ClusterConnectionFile.actor.cpp b/src/fdbclient/ClusterConnectionFile.actor.cpp index 01ecba2..59b1aab 100644 --- a/src/fdbclient/ClusterConnectionFile.actor.cpp +++ b/src/fdbclient/ClusterConnectionFile.actor.cpp @@ -40,6 +40,16 @@ ClusterConnectionFile::ClusterConnectionFile(std::string const& filename, Cluste cs = contents; } +// Creates a cluster file from the given filename. If the filename is empty, attempts to load the default +// cluster file instead. +Reference ClusterConnectionFile::openOrDefault(std::string const& filename) { + return makeReference(lookupClusterFileName(filename).first); +} + +Reference ClusterConnectionFile::openOrDefault(const char* filename) { + return openOrDefault(std::string(filename == nullptr ? "" : filename)); +} + // Sets the connections string held by this object and persists it. Future ClusterConnectionFile::setAndPersistConnectionString(ClusterConnectionString const& conn) { ASSERT(filename.size()); diff --git a/src/fdbclient/ClusterConnectionFile.actor.g.cpp b/src/fdbclient/ClusterConnectionFile.actor.g.cpp index 7f53086..8818c57 100644 --- a/src/fdbclient/ClusterConnectionFile.actor.g.cpp +++ b/src/fdbclient/ClusterConnectionFile.actor.g.cpp @@ -42,6 +42,16 @@ ClusterConnectionFile::ClusterConnectionFile(std::string const& filename, Cluste cs = contents; } +// Creates a cluster file from the given filename. If the filename is empty, attempts to load the default +// cluster file instead. +Reference ClusterConnectionFile::openOrDefault(std::string const& filename) { + return makeReference(lookupClusterFileName(filename).first); +} + +Reference ClusterConnectionFile::openOrDefault(const char* filename) { + return openOrDefault(std::string(filename == nullptr ? "" : filename)); +} + // Sets the connections string held by this object and persists it. Future ClusterConnectionFile::setAndPersistConnectionString(ClusterConnectionString const& conn) { ASSERT(filename.size()); diff --git a/src/fdbclient/CommitProxyInterface.cpp b/src/fdbclient/CommitProxyInterface.cpp new file mode 100644 index 0000000..4e80be3 --- /dev/null +++ b/src/fdbclient/CommitProxyInterface.cpp @@ -0,0 +1,15 @@ +#include "fdbclient/CommitProxyInterface.h" +#include "fdbclient/CoordinationInterface.h" +#include "fdbclient/GetEncryptCipherKeys_impl.actor.h" + +// Instantiate ClientDBInfo related tempates +template class ReplyPromise; +template class ReplyPromise>; +template class GetEncryptCipherKeys; + +// Instantiate OpenDatabaseCoordRequest related templates +template struct NetNotifiedQueue; + +// Instantiate GetKeyServerLocationsReply related templates +template class ReplyPromise; +template struct NetSAV; \ No newline at end of file diff --git a/src/fdbclient/CommitTransaction.h b/src/fdbclient/CommitTransaction.h deleted file mode 100644 index 53c87c4..0000000 --- a/src/fdbclient/CommitTransaction.h +++ /dev/null @@ -1,261 +0,0 @@ -/* - * CommitTransaction.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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. - */ - -#ifndef FLOW_FDBCLIENT_COMMITTRANSACTION_H -#define FLOW_FDBCLIENT_COMMITTRANSACTION_H -#pragma once - -#include "fdbclient/FDBTypes.h" -#include "fdbclient/Knobs.h" - -// The versioned message has wire format : -1, version, messages -static const int32_t VERSION_HEADER = -1; - -static const char* typeString[] = { "SetValue", - "ClearRange", - "AddValue", - "DebugKeyRange", - "DebugKey", - "NoOp", - "And", - "Or", - "Xor", - "AppendIfFits", - "AvailableForReuse", - "Reserved_For_LogProtocolMessage", - "Max", - "Min", - "SetVersionstampedKey", - "SetVersionstampedValue", - "ByteMin", - "ByteMax", - "MinV2", - "AndV2", - "CompareAndClear", - "Reserved_For_SpanContextMessage", - "MAX_ATOMIC_OP" }; - -struct MutationRef { - static const int OVERHEAD_BYTES = 12; // 12 is the size of Header in MutationList entries - enum Type : uint8_t { - SetValue = 0, - ClearRange, - AddValue, - DebugKeyRange, - DebugKey, - NoOp, - And, - Or, - Xor, - AppendIfFits, - AvailableForReuse, - Reserved_For_LogProtocolMessage /* See fdbserver/LogProtocolMessage.h */, - Max, - Min, - SetVersionstampedKey, - SetVersionstampedValue, - ByteMin, - ByteMax, - MinV2, - AndV2, - CompareAndClear, - Reserved_For_SpanContextMessage /* See fdbserver/SpanContextMessage.h */, - MAX_ATOMIC_OP - }; - // This is stored this way for serialization purposes. - uint8_t type; - StringRef param1, param2; - - MutationRef() {} - MutationRef(Type t, StringRef a, StringRef b) : type(t), param1(a), param2(b) {} - MutationRef(Arena& to, Type t, StringRef a, StringRef b) : type(t), param1(to, a), param2(to, b) {} - MutationRef(Arena& to, const MutationRef& from) - : type(from.type), param1(to, from.param1), param2(to, from.param2) {} - int totalSize() const { return OVERHEAD_BYTES + param1.size() + param2.size(); } - int expectedSize() const { return param1.size() + param2.size(); } - int weightedTotalSize() const { - // AtomicOp can cause more workload to FDB cluster than the same-size set mutation; - // Amplify atomicOp size to consider such extra workload. - // A good value for FASTRESTORE_ATOMICOP_WEIGHT needs experimental evaluations. - if (isAtomicOp()) { - return totalSize() * CLIENT_KNOBS->FASTRESTORE_ATOMICOP_WEIGHT; - } else { - return totalSize(); - } - } - - std::string toString() const { - return format("code: %s param1: %s param2: %s", - type < MutationRef::MAX_ATOMIC_OP ? typeString[(int)type] : "Unset", - printable(param1).c_str(), - printable(param2).c_str()); - } - - bool isAtomicOp() const { return (ATOMIC_MASK & (1 << type)) != 0; } - - template - void serialize(Ar& ar) { - if (ar.isSerializing && type == ClearRange && equalsKeyAfter(param1, param2)) { - StringRef empty; - serializer(ar, type, param2, empty); - } else { - serializer(ar, type, param1, param2); - } - if (ar.isDeserializing && type == ClearRange && param2 == StringRef() && param1 != StringRef()) { - ASSERT(param1[param1.size() - 1] == '\x00'); - param2 = param1; - param1 = param2.substr(0, param2.size() - 1); - } - } - - // These masks define which mutation types have particular properties (they are used to implement - // isSingleKeyMutation() etc) - enum { - ATOMIC_MASK = (1 << AddValue) | (1 << And) | (1 << Or) | (1 << Xor) | (1 << AppendIfFits) | (1 << Max) | - (1 << Min) | (1 << SetVersionstampedKey) | (1 << SetVersionstampedValue) | (1 << ByteMin) | - (1 << ByteMax) | (1 << MinV2) | (1 << AndV2) | (1 << CompareAndClear), - SINGLE_KEY_MASK = ATOMIC_MASK | (1 << SetValue), - NON_ASSOCIATIVE_MASK = (1 << AddValue) | (1 << Or) | (1 << Xor) | (1 << Max) | (1 << Min) | - (1 << SetVersionstampedKey) | (1 << SetVersionstampedValue) | (1 << MinV2) | - (1 << CompareAndClear) - }; -}; - -template <> -struct Traceable : std::true_type { - static std::string toString(MutationRef const& value) { return value.toString(); } -}; - -static inline std::string getTypeString(MutationRef::Type type) { - return type < MutationRef::MAX_ATOMIC_OP ? typeString[(int)type] : "Unset"; -} - -static inline std::string getTypeString(uint8_t type) { - return type < MutationRef::MAX_ATOMIC_OP ? typeString[type] : "Unset"; -} - -// A 'single key mutation' is one which affects exactly the value of the key specified by its param1 -static inline bool isSingleKeyMutation(MutationRef::Type type) { - return (MutationRef::SINGLE_KEY_MASK & (1 << type)) != 0; -} - -// Returns true if the given type can be safely cast to MutationRef::Type and used as a parameter to -// isSingleKeyMutation, isAtomicOp, etc. It does NOT mean that the type is a valid type of a MutationRef in any -// particular context. -static inline bool isValidMutationType(uint32_t type) { - return (type < MutationRef::MAX_ATOMIC_OP); -} - -// An 'atomic operation' is a single key mutation which sets the key specified by its param1 to a -// nontrivial function of the previous value of the key and param2, and thus requires a -// read/modify/write to implement. (Basically a single key mutation other than a set) -static inline bool isAtomicOp(MutationRef::Type mutationType) { - return (MutationRef::ATOMIC_MASK & (1 << mutationType)) != 0; -} - -// Returns true for operations which do not obey the associative law (i.e. a*(b*c) == (a*b)*c) in all cases -// unless a, b, and c have equal lengths, in which case even these operations are associative. -static inline bool isNonAssociativeOp(MutationRef::Type mutationType) { - return (MutationRef::NON_ASSOCIATIVE_MASK & (1 << mutationType)) != 0; -} - -struct CommitTransactionRef { - CommitTransactionRef() = default; - CommitTransactionRef(Arena& a, const CommitTransactionRef& from) - : read_conflict_ranges(a, from.read_conflict_ranges), write_conflict_ranges(a, from.write_conflict_ranges), - mutations(a, from.mutations), read_snapshot(from.read_snapshot), - report_conflicting_keys(from.report_conflicting_keys), lock_aware(from.lock_aware), - spanContext(from.spanContext) {} - - VectorRef read_conflict_ranges; - VectorRef write_conflict_ranges; - VectorRef mutations; // metadata mutations - Version read_snapshot = 0; - bool report_conflicting_keys = false; - bool lock_aware = false; // set when metadata mutations are present - Optional spanContext; - - template - force_inline void serialize(Ar& ar) { - if constexpr (is_fb_function) { - serializer(ar, - read_conflict_ranges, - write_conflict_ranges, - mutations, - read_snapshot, - report_conflicting_keys, - lock_aware, - spanContext); - } else { - serializer(ar, read_conflict_ranges, write_conflict_ranges, mutations, read_snapshot); - if (ar.protocolVersion().hasReportConflictingKeys()) { - serializer(ar, report_conflicting_keys); - } - if (ar.protocolVersion().hasResolverPrivateMutations()) { - serializer(ar, lock_aware, spanContext); - } - } - } - - // Convenience for internal code required to manipulate these without the Native API - void set(Arena& arena, KeyRef const& key, ValueRef const& value) { - mutations.push_back_deep(arena, MutationRef(MutationRef::SetValue, key, value)); - write_conflict_ranges.push_back(arena, singleKeyRange(key, arena)); - } - - void clear(Arena& arena, KeyRangeRef const& keys) { - mutations.push_back_deep(arena, MutationRef(MutationRef::ClearRange, keys.begin, keys.end)); - write_conflict_ranges.push_back_deep(arena, keys); - } - - size_t expectedSize() const { - return read_conflict_ranges.expectedSize() + write_conflict_ranges.expectedSize() + mutations.expectedSize(); - } -}; - -struct MutationsAndVersionRef { - VectorRef mutations; - Version version = invalidVersion; - Version knownCommittedVersion = invalidVersion; - - MutationsAndVersionRef() {} - explicit MutationsAndVersionRef(Version version, Version knownCommittedVersion) - : version(version), knownCommittedVersion(knownCommittedVersion) {} - MutationsAndVersionRef(VectorRef mutations, Version version, Version knownCommittedVersion) - : mutations(mutations), version(version), knownCommittedVersion(knownCommittedVersion) {} - MutationsAndVersionRef(Arena& to, VectorRef mutations, Version version, Version knownCommittedVersion) - : mutations(to, mutations), version(version), knownCommittedVersion(knownCommittedVersion) {} - MutationsAndVersionRef(Arena& to, const MutationsAndVersionRef& from) - : mutations(to, from.mutations), version(from.version), knownCommittedVersion(from.knownCommittedVersion) {} - int expectedSize() const { return mutations.expectedSize(); } - - struct OrderByVersion { - bool operator()(MutationsAndVersionRef const& a, MutationsAndVersionRef const& b) const { - return a.version < b.version; - } - }; - - template - void serialize(Ar& ar) { - serializer(ar, mutations, version, knownCommittedVersion); - } -}; - -#endif diff --git a/src/fdbclient/ConfigKnobs.cpp b/src/fdbclient/ConfigKnobs.cpp index 03b4b09..6b20c5f 100644 --- a/src/fdbclient/ConfigKnobs.cpp +++ b/src/fdbclient/ConfigKnobs.cpp @@ -44,19 +44,20 @@ ConfigKey ConfigKeyRef::decodeKey(KeyRef const& key) { } Value KnobValueRef::ToValueFunc::operator()(int v) const { - return BinaryWriter::toValue(v, Unversioned()); + // return BinaryWriter::toValue(v, Unversioned()); + return Tuple::makeTuple(v).pack(); } Value KnobValueRef::ToValueFunc::operator()(int64_t v) const { - return BinaryWriter::toValue(v, Unversioned()); + return Tuple::makeTuple(v).pack(); } Value KnobValueRef::ToValueFunc::operator()(bool v) const { - return BinaryWriter::toValue(v, Unversioned()); + return Tuple::makeTuple(v).pack(); } Value KnobValueRef::ToValueFunc::operator()(ValueRef v) const { - return v; + return Tuple::makeTuple(v).pack(); } Value KnobValueRef::ToValueFunc::operator()(double v) const { - return BinaryWriter::toValue(v, Unversioned()); + return Tuple::makeTuple(v).pack(); } KnobValue KnobValueRef::CreatorFunc::operator()(NoKnobFound) const { @@ -144,10 +145,7 @@ std::string configDBTypeToString(ConfigDBType configDBType) { } TEST_CASE("/fdbclient/ConfigDB/ConfigKey/EncodeDecode") { - Tuple tuple; - tuple << "class-A"_sr - << "test_long"_sr; - auto packed = tuple.pack(); + auto packed = Tuple::makeTuple("class-A"_sr, "test_long"_sr).pack(); auto unpacked = ConfigKeyRef::decodeKey(packed); ASSERT(unpacked.configClass.get() == "class-A"_sr); ASSERT(unpacked.knobName == "test_long"_sr); @@ -169,18 +167,8 @@ void decodeFailureTest(KeyRef key) { } // namespace TEST_CASE("/fdbclient/ConfigDB/ConfigKey/DecodeFailure") { - { - Tuple tuple; - tuple << "s1"_sr - << "s2"_sr - << "s3"_sr; - decodeFailureTest(tuple.pack()); - } - { - Tuple tuple; - tuple << "s1"_sr << 5; - decodeFailureTest(tuple.pack()); - } + decodeFailureTest(Tuple::makeTuple("s1"_sr, "s2"_sr, "s3"_sr).pack()); + decodeFailureTest(Tuple::makeTuple("s1"_sr, 5).pack()); decodeFailureTest("non-tuple-key"_sr); return Void(); } diff --git a/src/fdbclient/AutoPublicAddress.cpp b/src/fdbclient/CoordinationInterface.cpp similarity index 83% rename from src/fdbclient/AutoPublicAddress.cpp rename to src/fdbclient/CoordinationInterface.cpp index 5b80564..4475bae 100644 --- a/src/fdbclient/AutoPublicAddress.cpp +++ b/src/fdbclient/CoordinationInterface.cpp @@ -21,17 +21,21 @@ #include "flow/Platform.h" #include +#ifndef BOOST_SYSTEM_NO_LIB #define BOOST_SYSTEM_NO_LIB +#endif +#ifndef BOOST_DATE_TIME_NO_LIB #define BOOST_DATE_TIME_NO_LIB +#endif +#ifndef BOOST_REGEX_NO_LIB #define BOOST_REGEX_NO_LIB +#endif #include "boost/asio.hpp" #include "fdbclient/CoordinationInterface.h" -// Determine public IP address by calling the first available coordinator. -// If fail connecting all coordinators, throw bind_failed(). -IPAddress determinePublicIPAutomatically(ClusterConnectionString& ccs) { - int size = ccs.coords.size() + ccs.hostnames.size(); +IPAddress ClusterConnectionString::determineLocalSourceIP() const { + int size = coords.size() + hostnames.size(); int index = 0; loop { try { @@ -42,10 +46,10 @@ IPAddress determinePublicIPAutomatically(ClusterConnectionString& ccs) { NetworkAddress coordAddr; // Try coords first, because they don't need to be resolved. - if (index < ccs.coords.size()) { - coordAddr = ccs.coords[index]; + if (index < coords.size()) { + coordAddr = coords[index]; } else { - Hostname& h = ccs.hostnames[index - ccs.coords.size()]; + const Hostname& h = hostnames[index - coords.size()]; Optional resolvedAddr = h.resolveBlocking(); if (!resolvedAddr.present()) { throw lookup_failed(); diff --git a/src/fdbclient/DataDistributionConfig.actor.cpp b/src/fdbclient/DataDistributionConfig.actor.cpp new file mode 100644 index 0000000..3050449 --- /dev/null +++ b/src/fdbclient/DataDistributionConfig.actor.cpp @@ -0,0 +1,57 @@ +/* + * DataDistributionConfig.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/DataDistributionConfig.actor.h" +#include "fdbclient/json_spirit/json_spirit_value.h" +#include "flow/actorcompiler.h" // This must be the last #include. + +json_spirit::mValue DDConfiguration::toJSON(RangeConfigMapSnapshot const& config, bool includeDefaultRanges) { + json_spirit::mObject doc; + json_spirit::mArray& ranges = (doc["ranges"] = json_spirit::mArray()).get_array(); + int defaultRanges = 0; + int configuredRanges = 0; + + // Range config with no options set + DDRangeConfig defaultRangeConfig; + + // Add each non-default configured range to the output ranges doc + for (auto const& rv : config.ranges()) { + bool configured = rv.value() != defaultRangeConfig; + if (configured) { + ++configuredRanges; + } else { + ++defaultRanges; + } + + if (includeDefaultRanges || configured) { + json_spirit::mObject range; + range["begin"] = rv.range().begin.toString(); + range["end"] = rv.range().end.toString(); + range["configuration"] = rv.value().toJSON(); + ranges.push_back(std::move(range)); + } + } + + doc["numConfiguredRanges"] = configuredRanges; + doc["numDefaultRanges"] = defaultRanges; + doc["numBoundaries"] = (int)config.map.size(); + + return doc; +} diff --git a/src/fdbclient/DataDistributionConfig.actor.g.cpp b/src/fdbclient/DataDistributionConfig.actor.g.cpp new file mode 100644 index 0000000..4d5f6fa --- /dev/null +++ b/src/fdbclient/DataDistributionConfig.actor.g.cpp @@ -0,0 +1,59 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DataDistributionConfig.actor.cpp" +/* + * DataDistributionConfig.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/DataDistributionConfig.actor.h" +#include "fdbclient/json_spirit/json_spirit_value.h" +#include "flow/actorcompiler.h" // This must be the last #include. + +json_spirit::mValue DDConfiguration::toJSON(RangeConfigMapSnapshot const& config, bool includeDefaultRanges) { + json_spirit::mObject doc; + json_spirit::mArray& ranges = (doc["ranges"] = json_spirit::mArray()).get_array(); + int defaultRanges = 0; + int configuredRanges = 0; + + // Range config with no options set + DDRangeConfig defaultRangeConfig; + + // Add each non-default configured range to the output ranges doc + for (auto const& rv : config.ranges()) { + bool configured = rv.value() != defaultRangeConfig; + if (configured) { + ++configuredRanges; + } else { + ++defaultRanges; + } + + if (includeDefaultRanges || configured) { + json_spirit::mObject range; + range["begin"] = rv.range().begin.toString(); + range["end"] = rv.range().end.toString(); + range["configuration"] = rv.value().toJSON(); + ranges.push_back(std::move(range)); + } + } + + doc["numConfiguredRanges"] = configuredRanges; + doc["numDefaultRanges"] = defaultRanges; + doc["numBoundaries"] = (int)config.map.size(); + + return doc; +} diff --git a/src/fdbclient/DatabaseBackupAgent.actor.cpp b/src/fdbclient/DatabaseBackupAgent.actor.cpp index 17c588b..4cc18ee 100644 --- a/src/fdbclient/DatabaseBackupAgent.actor.cpp +++ b/src/fdbclient/DatabaseBackupAgent.actor.cpp @@ -26,22 +26,24 @@ #include "fdbclient/NativeAPI.actor.h" #include #include -#include "fdbrpc/IAsyncFile.h" +#include "fdbrpc/simulator.h" +#include "flow/IAsyncFile.h" +#include "flow/flow.h" #include "flow/genericactors.actor.h" #include "flow/Hash3.h" #include #include "fdbclient/ManagementAPI.actor.h" -#include "fdbclient/KeyBackedTypes.h" +#include "fdbclient/KeyBackedTypes.actor.h" #include #include #include "flow/actorcompiler.h" // has to be last include -const Key DatabaseBackupAgent::keyAddPrefix = LiteralStringRef("add_prefix"); -const Key DatabaseBackupAgent::keyRemovePrefix = LiteralStringRef("remove_prefix"); -const Key DatabaseBackupAgent::keyRangeVersions = LiteralStringRef("range_versions"); -const Key DatabaseBackupAgent::keyCopyStop = LiteralStringRef("copy_stop"); -const Key DatabaseBackupAgent::keyDatabasesInSync = LiteralStringRef("databases_in_sync"); +const Key DatabaseBackupAgent::keyAddPrefix = "add_prefix"_sr; +const Key DatabaseBackupAgent::keyRemovePrefix = "remove_prefix"_sr; +const Key DatabaseBackupAgent::keyRangeVersions = "range_versions"_sr; +const Key DatabaseBackupAgent::keyCopyStop = "copy_stop"_sr; +const Key DatabaseBackupAgent::keyDatabasesInSync = "databases_in_sync"_sr; const int DatabaseBackupAgent::LATEST_DR_VERSION = 1; DatabaseBackupAgent::DatabaseBackupAgent() @@ -75,14 +77,13 @@ DatabaseBackupAgent::DatabaseBackupAgent(Database src) class DRConfig { public: DRConfig(UID uid = UID()) - : uid(uid), - configSpace(uidPrefixKey(LiteralStringRef("uid->config/").withPrefix(databaseBackupPrefixRange.begin), uid)) {} + : uid(uid), configSpace(uidPrefixKey("uid->config/"_sr.withPrefix(databaseBackupPrefixRange.begin), uid)) {} DRConfig(Reference task) : DRConfig(BinaryReader::fromStringRef(task->params[BackupAgentBase::keyConfigLogUid], Unversioned())) {} - KeyBackedBinaryValue rangeBytesWritten() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue rangeBytesWritten() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedBinaryValue logBytesWritten() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue logBytesWritten() { return configSpace.pack(__FUNCTION__sr); } void clear(Reference tr) { tr->clear(configSpace.range()); } @@ -137,7 +138,7 @@ struct BackupRangeTaskFunc : TaskFuncBase { static constexpr uint32_t version = 1; static struct { - static TaskParam bytesWritten() { return LiteralStringRef(__FUNCTION__); } + static TaskParam bytesWritten() { return __FUNCTION__sr; } } Params; static const Key keyAddBackupRangeTasks; @@ -203,7 +204,7 @@ struct BackupRangeTaskFunc : TaskFuncBase { task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } ACTOR static Future _execute(Database cx, @@ -362,8 +363,10 @@ struct BackupRangeTaskFunc : TaskFuncBase { if ((!prevAdjacent || !nextAdjacent) && rangeCount > ((prevAdjacent || nextAdjacent) ? CLIENT_KNOBS->BACKUP_MAP_KEY_UPPER_LIMIT - : CLIENT_KNOBS->BACKUP_MAP_KEY_LOWER_LIMIT)) { - TEST(true); // range insert delayed because too versionMap is too large + : CLIENT_KNOBS->BACKUP_MAP_KEY_LOWER_LIMIT) && + (!g_network->isSimulated() || + (isBuggifyEnabled(BuggifyType::General) && !g_simulator->speedUpSimulation))) { + CODE_PROBE(true, "range insert delayed because versionMap is too large"); if (rangeCount > CLIENT_KNOBS->BACKUP_MAP_KEY_UPPER_LIMIT) TraceEvent(SevWarnAlways, "DBA_KeyRangeMapTooLarge").log(); @@ -405,10 +408,10 @@ struct BackupRangeTaskFunc : TaskFuncBase { break; if (backupVersions.get()[versionLoc + 1].key == - (removePrefix == StringRef() ? normalKeys.end : strinc(removePrefix))) { + (removePrefix == StringRef() ? allKeys.end : strinc(removePrefix))) { tr->clear(KeyRangeRef( backupVersions.get()[versionLoc].key.removePrefix(removePrefix).withPrefix(addPrefix), - addPrefix == StringRef() ? normalKeys.end : strinc(addPrefix))); + addPrefix == StringRef() ? allKeys.end : strinc(addPrefix))); } else { tr->clear(KeyRangeRef(backupVersions.get()[versionLoc].key, backupVersions.get()[versionLoc + 1].key) @@ -536,9 +539,9 @@ struct BackupRangeTaskFunc : TaskFuncBase { return Void(); } }; -StringRef BackupRangeTaskFunc::name = LiteralStringRef("dr_backup_range"); -const Key BackupRangeTaskFunc::keyAddBackupRangeTasks = LiteralStringRef("addBackupRangeTasks"); -const Key BackupRangeTaskFunc::keyBackupRangeBeginKey = LiteralStringRef("backupRangeBeginKey"); +StringRef BackupRangeTaskFunc::name = "dr_backup_range"_sr; +const Key BackupRangeTaskFunc::keyAddBackupRangeTasks = "addBackupRangeTasks"_sr; +const Key BackupRangeTaskFunc::keyBackupRangeBeginKey = "backupRangeBeginKey"_sr; REGISTER_TASKFUNC(BackupRangeTaskFunc); struct FinishFullBackupTaskFunc : TaskFuncBase { @@ -588,7 +591,7 @@ struct FinishFullBackupTaskFunc : TaskFuncBase { task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } StringRef getName() const override { return name; }; @@ -606,7 +609,7 @@ struct FinishFullBackupTaskFunc : TaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef FinishFullBackupTaskFunc::name = LiteralStringRef("dr_finish_full_backup"); +StringRef FinishFullBackupTaskFunc::name = "dr_finish_full_backup"_sr; REGISTER_TASKFUNC(FinishFullBackupTaskFunc); struct EraseLogRangeTaskFunc : TaskFuncBase { @@ -683,7 +686,7 @@ struct EraseLogRangeTaskFunc : TaskFuncBase { task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } ACTOR static Future _finish(Reference tr, @@ -697,7 +700,7 @@ struct EraseLogRangeTaskFunc : TaskFuncBase { return Void(); } }; -StringRef EraseLogRangeTaskFunc::name = LiteralStringRef("dr_erase_log_range"); +StringRef EraseLogRangeTaskFunc::name = "dr_erase_log_range"_sr; REGISTER_TASKFUNC(EraseLogRangeTaskFunc); struct CopyLogRangeTaskFunc : TaskFuncBase { @@ -705,7 +708,7 @@ struct CopyLogRangeTaskFunc : TaskFuncBase { static constexpr uint32_t version = 1; static struct { - static TaskParam bytesWritten() { return LiteralStringRef(__FUNCTION__); } + static TaskParam bytesWritten() { return __FUNCTION__sr; } } Params; static const Key keyNextBeginVersion; @@ -958,7 +961,7 @@ struct CopyLogRangeTaskFunc : TaskFuncBase { task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } ACTOR static Future _finish(Reference tr, @@ -989,8 +992,8 @@ struct CopyLogRangeTaskFunc : TaskFuncBase { return Void(); } }; -StringRef CopyLogRangeTaskFunc::name = LiteralStringRef("dr_copy_log_range"); -const Key CopyLogRangeTaskFunc::keyNextBeginVersion = LiteralStringRef("nextBeginVersion"); +StringRef CopyLogRangeTaskFunc::name = "dr_copy_log_range"_sr; +const Key CopyLogRangeTaskFunc::keyNextBeginVersion = "nextBeginVersion"_sr; REGISTER_TASKFUNC(CopyLogRangeTaskFunc); struct CopyLogsTaskFunc : TaskFuncBase { @@ -1125,7 +1128,7 @@ struct CopyLogsTaskFunc : TaskFuncBase { task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } StringRef getName() const override { return name; }; @@ -1143,7 +1146,7 @@ struct CopyLogsTaskFunc : TaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef CopyLogsTaskFunc::name = LiteralStringRef("dr_copy_logs"); +StringRef CopyLogsTaskFunc::name = "dr_copy_logs"_sr; REGISTER_TASKFUNC(CopyLogsTaskFunc); struct FinishedFullBackupTaskFunc : TaskFuncBase { @@ -1235,7 +1238,7 @@ struct FinishedFullBackupTaskFunc : TaskFuncBase { task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } ACTOR static Future _finish(Reference tr, @@ -1283,8 +1286,8 @@ struct FinishedFullBackupTaskFunc : TaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef FinishedFullBackupTaskFunc::name = LiteralStringRef("dr_finished_full_backup"); -const Key FinishedFullBackupTaskFunc::keyInsertTask = LiteralStringRef("insertTask"); +StringRef FinishedFullBackupTaskFunc::name = "dr_finished_full_backup"_sr; +const Key FinishedFullBackupTaskFunc::keyInsertTask = "insertTask"_sr; REGISTER_TASKFUNC(FinishedFullBackupTaskFunc); struct CopyDiffLogsTaskFunc : TaskFuncBase { @@ -1396,7 +1399,7 @@ struct CopyDiffLogsTaskFunc : TaskFuncBase { task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } StringRef getName() const override { return name; }; @@ -1414,7 +1417,7 @@ struct CopyDiffLogsTaskFunc : TaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef CopyDiffLogsTaskFunc::name = LiteralStringRef("dr_copy_diff_logs"); +StringRef CopyDiffLogsTaskFunc::name = "dr_copy_diff_logs"_sr; REGISTER_TASKFUNC(CopyDiffLogsTaskFunc); // Skip unneeded EraseLogRangeTaskFunc in 5.1 @@ -1446,7 +1449,7 @@ struct SkipOldEraseLogRangeTaskFunc : TaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef SkipOldEraseLogRangeTaskFunc::name = LiteralStringRef("dr_skip_legacy_task"); +StringRef SkipOldEraseLogRangeTaskFunc::name = "dr_skip_legacy_task"_sr; REGISTER_TASKFUNC(SkipOldEraseLogRangeTaskFunc); REGISTER_TASKFUNC_ALIAS(SkipOldEraseLogRangeTaskFunc, db_erase_log_range); @@ -1456,7 +1459,7 @@ struct OldCopyLogRangeTaskFunc : TaskFuncBase { static constexpr uint32_t version = 1; static struct { - static TaskParam bytesWritten() { return LiteralStringRef(__FUNCTION__); } + static TaskParam bytesWritten() { return __FUNCTION__sr; } } Params; static const Key keyNextBeginVersion; @@ -1652,7 +1655,7 @@ struct OldCopyLogRangeTaskFunc : TaskFuncBase { task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } ACTOR static Future _finish(Reference tr, @@ -1683,8 +1686,8 @@ struct OldCopyLogRangeTaskFunc : TaskFuncBase { return Void(); } }; -StringRef OldCopyLogRangeTaskFunc::name = LiteralStringRef("db_copy_log_range"); -const Key OldCopyLogRangeTaskFunc::keyNextBeginVersion = LiteralStringRef("nextBeginVersion"); +StringRef OldCopyLogRangeTaskFunc::name = "db_copy_log_range"_sr; +const Key OldCopyLogRangeTaskFunc::keyNextBeginVersion = "nextBeginVersion"_sr; REGISTER_TASKFUNC(OldCopyLogRangeTaskFunc); struct AbortOldBackupTaskFunc : TaskFuncBase { @@ -1753,7 +1756,7 @@ struct AbortOldBackupTaskFunc : TaskFuncBase { task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } StringRef getName() const override { return name; }; @@ -1771,7 +1774,7 @@ struct AbortOldBackupTaskFunc : TaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef AbortOldBackupTaskFunc::name = LiteralStringRef("dr_abort_legacy_backup"); +StringRef AbortOldBackupTaskFunc::name = "dr_abort_legacy_backup"_sr; REGISTER_TASKFUNC(AbortOldBackupTaskFunc); REGISTER_TASKFUNC_ALIAS(AbortOldBackupTaskFunc, db_backup_range); REGISTER_TASKFUNC_ALIAS(AbortOldBackupTaskFunc, db_finish_full_backup); @@ -1834,13 +1837,16 @@ struct CopyDiffLogsUpgradeTaskFunc : TaskFuncBase { return Void(); } - if (backupRanges.size() == 1) { + if (backupRanges.size() == 1 || isDefaultBackup(backupRanges)) { RangeResult existingDestUidValues = wait(srcTr->getRange( KeyRangeRef(destUidLookupPrefix, strinc(destUidLookupPrefix)), CLIENT_KNOBS->TOO_MANY)); bool found = false; + KeyRangeRef targetRange = + (backupRanges.size() == 1) ? backupRanges[0] : getDefaultBackupSharedRange(); for (auto it : existingDestUidValues) { - if (BinaryReader::fromStringRef(it.key.removePrefix(destUidLookupPrefix), - IncludeVersion()) == backupRanges[0]) { + KeyRange uidRange = BinaryReader::fromStringRef( + it.key.removePrefix(destUidLookupPrefix), IncludeVersion()); + if (uidRange == targetRange) { if (destUidValue != it.value) { // existing backup/DR is running return Void(); @@ -1856,7 +1862,7 @@ struct CopyDiffLogsUpgradeTaskFunc : TaskFuncBase { } srcTr->set( - BinaryWriter::toValue(backupRanges[0], IncludeVersion(ProtocolVersion::withSharedMutations())) + BinaryWriter::toValue(targetRange, IncludeVersion(ProtocolVersion::withSharedMutations())) .withPrefix(destUidLookupPrefix), destUidValue); } @@ -1918,7 +1924,7 @@ struct CopyDiffLogsUpgradeTaskFunc : TaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef CopyDiffLogsUpgradeTaskFunc::name = LiteralStringRef("db_copy_diff_logs"); +StringRef CopyDiffLogsUpgradeTaskFunc::name = "db_copy_diff_logs"_sr; REGISTER_TASKFUNC(CopyDiffLogsUpgradeTaskFunc); struct BackupRestorableTaskFunc : TaskFuncBase { @@ -2031,7 +2037,7 @@ struct BackupRestorableTaskFunc : TaskFuncBase { task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } StringRef getName() const override { return name; }; @@ -2049,7 +2055,7 @@ struct BackupRestorableTaskFunc : TaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef BackupRestorableTaskFunc::name = LiteralStringRef("dr_backup_restorable"); +StringRef BackupRestorableTaskFunc::name = "dr_backup_restorable"_sr; REGISTER_TASKFUNC(BackupRestorableTaskFunc); struct StartFullBackupTaskFunc : TaskFuncBase { @@ -2078,24 +2084,29 @@ struct StartFullBackupTaskFunc : TaskFuncBase { srcTr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); // Initialize destUid - if (backupRanges.size() == 1) { + if (backupRanges.size() == 1 || isDefaultBackup(backupRanges)) { RangeResult existingDestUidValues = wait(srcTr->getRange( KeyRangeRef(destUidLookupPrefix, strinc(destUidLookupPrefix)), CLIENT_KNOBS->TOO_MANY)); + KeyRangeRef targetRange = + (backupRanges.size() == 1) ? backupRanges[0] : getDefaultBackupSharedRange(); bool found = false; for (auto it : existingDestUidValues) { - if (BinaryReader::fromStringRef(it.key.removePrefix(destUidLookupPrefix), - IncludeVersion()) == backupRanges[0]) { + KeyRange uidRange = BinaryReader::fromStringRef( + it.key.removePrefix(destUidLookupPrefix), IncludeVersion()); + if (uidRange == targetRange) { destUidValue = it.value; found = true; + CODE_PROBE(targetRange == getDefaultBackupSharedRange(), + "DR mutation sharing with default backup"); break; } } if (!found) { destUidValue = BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned()); - srcTr->set(BinaryWriter::toValue(backupRanges[0], - IncludeVersion(ProtocolVersion::withSharedMutations())) - .withPrefix(destUidLookupPrefix), - destUidValue); + srcTr->set( + BinaryWriter::toValue(targetRange, IncludeVersion(ProtocolVersion::withSharedMutations())) + .withPrefix(destUidLookupPrefix), + destUidValue); } } @@ -2281,7 +2292,7 @@ struct StartFullBackupTaskFunc : TaskFuncBase { task->params[BackupAgentBase::keyConfigBackupRanges] = keyConfigBackupRanges; task->params[BackupAgentBase::keyTagName] = tagName; task->params[DatabaseBackupAgent::keyDatabasesInSync] = - backupAction == DatabaseBackupAgent::PreBackupAction::NONE ? LiteralStringRef("t") : LiteralStringRef("f"); + backupAction == DatabaseBackupAgent::PreBackupAction::NONE ? "t"_sr : "f"_sr; if (!waitFor) { return taskBucket->addTask(tr, @@ -2301,7 +2312,7 @@ struct StartFullBackupTaskFunc : TaskFuncBase { .get(logUid) .pack(BackupAgentBase::keyFolderId), task->params[BackupAgentBase::keyFolderId])); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } StringRef getName() const override { return name; }; @@ -2319,7 +2330,7 @@ struct StartFullBackupTaskFunc : TaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef StartFullBackupTaskFunc::name = LiteralStringRef("dr_start_full_backup"); +StringRef StartFullBackupTaskFunc::name = "dr_start_full_backup"_sr; REGISTER_TASKFUNC(StartFullBackupTaskFunc); } // namespace dbBackup @@ -2625,7 +2636,7 @@ class DatabaseBackupAgentImpl { int64_t startCount = 0; state Key mapPrefix = logUidValue.withPrefix(applyMutationsKeyVersionMapRange.begin); - Key mapEnd = normalKeys.end.withPrefix(mapPrefix); + Key mapEnd = allKeys.end.withPrefix(mapPrefix); tr->set(logUidValue.withPrefix(applyMutationsAddPrefixRange.begin), addPrefix); tr->set(logUidValue.withPrefix(applyMutationsRemovePrefixRange.begin), removePrefix); tr->set(logUidValue.withPrefix(applyMutationsKeyVersionCountRange.begin), StringRef((uint8_t*)&startCount, 8)); @@ -2780,7 +2791,7 @@ class DatabaseBackupAgentImpl { Version destVersion = wait(tr3.getReadVersion()); TraceEvent("DBA_SwitchoverVersionUpgrade").detail("Src", commitVersion).detail("Dest", destVersion); if (destVersion <= commitVersion) { - TEST(true); // Forcing dest backup cluster to higher version + CODE_PROBE(true, "Forcing dest backup cluster to higher version"); tr3.set(minRequiredCommitVersionKey, BinaryWriter::toValue(commitVersion + 1, Unversioned())); wait(tr3.commit()); } else { @@ -2933,7 +2944,7 @@ class DatabaseBackupAgentImpl { Version applied = BinaryReader::fromStringRef(lastApplied.get(), Unversioned()); TraceEvent("DBA_AbortVersionUpgrade").detail("Src", applied).detail("Dest", current); if (current <= applied) { - TEST(true); // Upgrading version of local database. + CODE_PROBE(true, "Upgrading version of local database."); // The +1 is because we want to make sure that a versionstamped operation can't reuse // the same version as an already-applied transaction. tr->set(minRequiredCommitVersionKey, BinaryWriter::toValue(applied + 1, Unversioned())); @@ -3061,6 +3072,9 @@ class DatabaseBackupAgentImpl { loop { try { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + wait(success(tr->getReadVersion())); // get the read version before getting a version from the source // database to prevent the time differential from going negative @@ -3072,9 +3086,6 @@ class DatabaseBackupAgentImpl { state UID logUid = wait(backupAgent->getLogUid(tr, tagName)); - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - state Future> fPaused = tr->get(backupAgent->taskBucket->getPauseKey()); state Future fErrorValues = errorLimit > 0 diff --git a/src/fdbclient/DatabaseBackupAgent.actor.g.cpp b/src/fdbclient/DatabaseBackupAgent.actor.g.cpp index c1848d5..29691ec 100644 --- a/src/fdbclient/DatabaseBackupAgent.actor.g.cpp +++ b/src/fdbclient/DatabaseBackupAgent.actor.g.cpp @@ -28,22 +28,24 @@ #include "fdbclient/NativeAPI.actor.h" #include #include -#include "fdbrpc/IAsyncFile.h" +#include "fdbrpc/simulator.h" +#include "flow/IAsyncFile.h" +#include "flow/flow.h" #include "flow/genericactors.actor.h" #include "flow/Hash3.h" #include #include "fdbclient/ManagementAPI.actor.h" -#include "fdbclient/KeyBackedTypes.h" +#include "fdbclient/KeyBackedTypes.actor.h" #include #include #include "flow/actorcompiler.h" // has to be last include -const Key DatabaseBackupAgent::keyAddPrefix = LiteralStringRef("add_prefix"); -const Key DatabaseBackupAgent::keyRemovePrefix = LiteralStringRef("remove_prefix"); -const Key DatabaseBackupAgent::keyRangeVersions = LiteralStringRef("range_versions"); -const Key DatabaseBackupAgent::keyCopyStop = LiteralStringRef("copy_stop"); -const Key DatabaseBackupAgent::keyDatabasesInSync = LiteralStringRef("databases_in_sync"); +const Key DatabaseBackupAgent::keyAddPrefix = "add_prefix"_sr; +const Key DatabaseBackupAgent::keyRemovePrefix = "remove_prefix"_sr; +const Key DatabaseBackupAgent::keyRangeVersions = "range_versions"_sr; +const Key DatabaseBackupAgent::keyCopyStop = "copy_stop"_sr; +const Key DatabaseBackupAgent::keyDatabasesInSync = "databases_in_sync"_sr; const int DatabaseBackupAgent::LATEST_DR_VERSION = 1; DatabaseBackupAgent::DatabaseBackupAgent() @@ -77,14 +79,13 @@ DatabaseBackupAgent::DatabaseBackupAgent(Database src) class DRConfig { public: DRConfig(UID uid = UID()) - : uid(uid), - configSpace(uidPrefixKey(LiteralStringRef("uid->config/").withPrefix(databaseBackupPrefixRange.begin), uid)) {} + : uid(uid), configSpace(uidPrefixKey("uid->config/"_sr.withPrefix(databaseBackupPrefixRange.begin), uid)) {} DRConfig(Reference task) : DRConfig(BinaryReader::fromStringRef(task->params[BackupAgentBase::keyConfigLogUid], Unversioned())) {} - KeyBackedBinaryValue rangeBytesWritten() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue rangeBytesWritten() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedBinaryValue logBytesWritten() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue logBytesWritten() { return configSpace.pack(__FUNCTION__sr); } void clear(Reference tr) { tr->clear(configSpace.range()); } @@ -111,26 +112,26 @@ bool copyDefaultParameters(Reference source, Reference dest) { return false; } - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via checkTaskVersion() - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class CheckTaskVersionActorState { - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" CheckTaskVersionActorState(Tr const& tr,Reference const& task,StringRef const& name,uint32_t const& version) - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" name(name), - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" version(version) - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("checkTaskVersion", reinterpret_cast(this)); @@ -143,24 +144,24 @@ class CheckTaskVersionActorState { int a_body1(int loopDepth=0) { try { - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - uint32_t taskVersion = task->getVersion(); #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + uint32_t taskVersion = task->getVersion(); + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (taskVersion > version) - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent(SevError, "BA_BackupRangeTaskFuncExecute") .detail("TaskVersion", taskVersion) .detail("Name", name) .detail("Version", version); - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = logError(tr, Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyErrors) .pack(task->params[BackupAgentBase::keyConfigLogUid]), format("ERROR: %s task version `%lu' is greater than supported version `%lu'", task->params[Task::reservedTaskParamKeyType].toString().c_str(), (unsigned long)taskVersion, (unsigned long)version)); - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -186,9 +187,9 @@ class CheckTaskVersionActorState { } int a_body1cont1(int loopDepth) { - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckTaskVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CheckTaskVersionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -198,17 +199,17 @@ class CheckTaskVersionActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(task_invalid_version(), loopDepth); - #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(task_invalid_version(), loopDepth); - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return loopDepth; } @@ -275,22 +276,22 @@ class CheckTaskVersionActorState { fdb_probe_actor_exit("checkTaskVersion", reinterpret_cast(this), 0); } - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Tr tr; - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StringRef name; - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" uint32_t version; - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via checkTaskVersion() - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class CheckTaskVersionActor final : public Actor, public ActorCallback< CheckTaskVersionActor, 0, Void >, public FastAllocated>, public CheckTaskVersionActorState> { - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -299,9 +300,9 @@ class CheckTaskVersionActor final : public Actor, public ActorCallback< Ch void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< CheckTaskVersionActor, 0, Void >; - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" CheckTaskVersionActor(Tr const& tr,Reference const& task,StringRef const& name,uint32_t const& version) - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), CheckTaskVersionActorState>(tr, task, name, version) { @@ -324,23 +325,23 @@ friend struct ActorCallback< CheckTaskVersionActor, 0, Void >; } }; - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] Future checkTaskVersion( Tr const& tr, Reference const& task, StringRef const& name, uint32_t const& version ) { - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new CheckTaskVersionActor(tr, task, name, version)); - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" struct BackupRangeTaskFunc : TaskFuncBase { static StringRef name; static constexpr uint32_t version = 1; static struct { - static TaskParam bytesWritten() { return LiteralStringRef(__FUNCTION__); } + static TaskParam bytesWritten() { return __FUNCTION__sr; } } Params; static const Key keyAddBackupRangeTasks; @@ -361,26 +362,26 @@ struct BackupRangeTaskFunc : TaskFuncBase { return _finish(tr, tb, fb, task); }; - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via getBlockOfShards() - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class GetBlockOfShardsActorState { - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" GetBlockOfShardsActorState(Reference const& tr,Key const& beginKey,Key const& endKey,int const& limit) - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginKey(beginKey), - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endKey(endKey), - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" limit(limit) - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("getBlockOfShards", reinterpret_cast(this)); @@ -393,22 +394,22 @@ class GetBlockOfShardsActorState { int a_body1(int loopDepth=0) { try { - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - results = Standalone>(); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + results = Standalone>(); + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = tr->getRange( KeyRangeRef(keyAfter(beginKey.withPrefix(keyServersPrefix)), endKey.withPrefix(keyServersPrefix)), limit); - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -429,17 +430,17 @@ class GetBlockOfShardsActorState { } int a_body1cont1(RangeResult const& values,int loopDepth) { - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - for( auto& s : values ) { #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - KeyRef k = s.key.removePrefix(keyServersPrefix); + for( auto& s : values ) { #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + KeyRef k = s.key.removePrefix(keyServersPrefix); + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" results.push_back_deep(results.arena(), k); - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetBlockOfShardsActorState(); static_cast(this)->destroy(); return 0; } - #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO this->~GetBlockOfShardsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -449,17 +450,17 @@ class GetBlockOfShardsActorState { } int a_body1cont1(RangeResult && values,int loopDepth) { - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - for( auto& s : values ) { #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - KeyRef k = s.key.removePrefix(keyServersPrefix); + for( auto& s : values ) { #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + KeyRef k = s.key.removePrefix(keyServersPrefix); + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" results.push_back_deep(results.arena(), k); - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetBlockOfShardsActorState(); static_cast(this)->destroy(); return 0; } - #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO this->~GetBlockOfShardsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -530,22 +531,22 @@ class GetBlockOfShardsActorState { fdb_probe_actor_exit("getBlockOfShards", reinterpret_cast(this), 0); } - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key beginKey; - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key endKey; - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int limit; - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Standalone> results; - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via getBlockOfShards() - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class GetBlockOfShardsActor final : public Actor>>, public ActorCallback< GetBlockOfShardsActor, 0, RangeResult >, public FastAllocated, public GetBlockOfShardsActorState { - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -554,9 +555,9 @@ class GetBlockOfShardsActor final : public Actor>>, void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetBlockOfShardsActor, 0, RangeResult >; - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" GetBlockOfShardsActor(Reference const& tr,Key const& beginKey,Key const& endKey,int const& limit) - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor>>(), GetBlockOfShardsActorState(tr, beginKey, endKey, limit) { @@ -579,41 +580,41 @@ friend struct ActorCallback< GetBlockOfShardsActor, 0, RangeResult >; } }; - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future>> getBlockOfShards( Reference const& tr, Key const& beginKey, Key const& endKey, int const& limit ) { - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future>>(new GetBlockOfShardsActor(tr, beginKey, endKey, limit)); - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActorState { - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActorState(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,Key const& begin,Key const& end,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" parentTask(parentTask), - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" begin(begin), - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" end(end), - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" completionKey(completionKey), - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" waitFor(waitFor) - #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -626,16 +627,16 @@ class AddTaskActorState { int a_body1(int loopDepth=0) { try { - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -656,72 +657,72 @@ class AddTaskActorState { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(BackupRangeTaskFunc::name, BackupRangeTaskFunc::version, doneKey); - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - task->params[BackupAgentBase::keyBeginKey] = begin; #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + task->params[BackupAgentBase::keyBeginKey] = begin; + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::keyEndKey] = end; - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(BackupRangeTaskFunc::name, BackupRangeTaskFunc::version, doneKey); - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - task->params[BackupAgentBase::keyBeginKey] = begin; #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + task->params[BackupAgentBase::keyBeginKey] = begin; + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::keyEndKey] = end; - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -791,10 +792,10 @@ class AddTaskActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActorState(); static_cast(this)->destroy(); return 0; } + #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -803,10 +804,10 @@ class AddTaskActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActorState(); static_cast(this)->destroy(); return 0; } + #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -876,26 +877,26 @@ class AddTaskActorState { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 1); } - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference parentTask; - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key begin; - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key end; - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference waitFor; - #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor final : public Actor, public ActorCallback< AddTaskActor, 0, Key >, public ActorCallback< AddTaskActor, 1, Void >, public FastAllocated, public AddTaskActorState { - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -905,9 +906,9 @@ class AddTaskActor final : public Actor, public ActorCallback< AddTaskActor #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor, 0, Key >; friend struct ActorCallback< AddTaskActor, 1, Void >; - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,Key const& begin,Key const& end,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), AddTaskActorState(tr, taskBucket, parentTask, begin, end, completionKey, waitFor) { @@ -931,39 +932,39 @@ friend struct ActorCallback< AddTaskActor, 1, Void >; } }; - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, Key const& begin, Key const& end, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new AddTaskActor(tr, taskBucket, parentTask, begin, end, completionKey, waitFor)); - #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActorState { - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActorState(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : cx(cx), - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - lock(new FlowLock(CLIENT_KNOBS->BACKUP_LOCK_BYTES)), #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + lock(new FlowLock(CLIENT_KNOBS->BACKUP_LOCK_BYTES)), + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" conf(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(task->params[BackupAgentBase::keyConfigLogUid])) - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -976,16 +977,16 @@ class _executeActorState { int a_body1(int loopDepth=0) { try { - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(cx, task, BackupRangeTaskFunc::name, BackupRangeTaskFunc::version); - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor*>(this)->actor_wait_state = 1; - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1006,32 +1007,32 @@ class _executeActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture>> __when_expr_1 = runRYWTransaction(taskBucket->src, [=](Reference tr) { return getBlockOfShards(tr, task->params[DatabaseBackupAgent::keyBeginKey], task->params[DatabaseBackupAgent::keyEndKey], CLIENT_KNOBS->BACKUP_SHARD_TASK_LIMIT); }); - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor*>(this)->actor_wait_state = 2; - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast> >*>(static_cast<_executeActor*>(this))); - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture>> __when_expr_1 = runRYWTransaction(taskBucket->src, [=](Reference tr) { return getBlockOfShards(tr, task->params[DatabaseBackupAgent::keyBeginKey], task->params[DatabaseBackupAgent::keyEndKey], CLIENT_KNOBS->BACKUP_SHARD_TASK_LIMIT); }); - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor*>(this)->actor_wait_state = 2; - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast> >*>(static_cast<_executeActor*>(this))); - #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1101,94 +1102,94 @@ class _executeActorState { } int a_body1cont2(Standalone> const& keys,int loopDepth) { - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (keys.size() > 0) - #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - task->params[BackupRangeTaskFunc::keyAddBackupRangeTasks] = BinaryWriter::toValue(keys, IncludeVersion()); #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + task->params[BackupRangeTaskFunc::keyAddBackupRangeTasks] = BinaryWriter::toValue(keys, IncludeVersion()); + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - timeout = now() + CLIENT_KNOBS->BACKUP_RANGE_TIMEOUT; #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - addPrefix = task->params[DatabaseBackupAgent::keyAddPrefix]; + timeout = now() + CLIENT_KNOBS->BACKUP_RANGE_TIMEOUT; #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + addPrefix = task->params[DatabaseBackupAgent::keyAddPrefix]; + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" removePrefix = task->params[DatabaseBackupAgent::keyRemovePrefix]; - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" range = KeyRange(KeyRangeRef(task->params[BackupAgentBase::keyBeginKey], task->params[BackupAgentBase::keyEndKey])); - #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" results = PromiseStream(); - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rc = readCommitted( taskBucket->src, results, lock, range, Terminator::True, AccessSystemKeys::True, LockAware::True); - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - rangeBegin = range.begin; #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - rangeEnd = Key(); + rangeBegin = range.begin; #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - endOfStream = false; + rangeEnd = Key(); #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - nextValues = RangeResultWithVersion(); + endOfStream = false; #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - nextValuesSize = 0; + nextValues = RangeResultWithVersion(); #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - nextValues.second = invalidVersion; + nextValuesSize = 0; #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + nextValues.second = invalidVersion; + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopHead1(loopDepth); return loopDepth; } int a_body1cont2(Standalone> && keys,int loopDepth) { - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (keys.size() > 0) - #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - task->params[BackupRangeTaskFunc::keyAddBackupRangeTasks] = BinaryWriter::toValue(keys, IncludeVersion()); #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + task->params[BackupRangeTaskFunc::keyAddBackupRangeTasks] = BinaryWriter::toValue(keys, IncludeVersion()); + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - timeout = now() + CLIENT_KNOBS->BACKUP_RANGE_TIMEOUT; #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - addPrefix = task->params[DatabaseBackupAgent::keyAddPrefix]; + timeout = now() + CLIENT_KNOBS->BACKUP_RANGE_TIMEOUT; #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + addPrefix = task->params[DatabaseBackupAgent::keyAddPrefix]; + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" removePrefix = task->params[DatabaseBackupAgent::keyRemovePrefix]; - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" range = KeyRange(KeyRangeRef(task->params[BackupAgentBase::keyBeginKey], task->params[BackupAgentBase::keyEndKey])); - #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" results = PromiseStream(); - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rc = readCommitted( taskBucket->src, results, lock, range, Terminator::True, AccessSystemKeys::True, LockAware::True); - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - rangeBegin = range.begin; #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - rangeEnd = Key(); + rangeBegin = range.begin; #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - endOfStream = false; + rangeEnd = Key(); #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - nextValues = RangeResultWithVersion(); + endOfStream = false; #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - nextValuesSize = 0; + nextValues = RangeResultWithVersion(); #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - nextValues.second = invalidVersion; + nextValuesSize = 0; #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + nextValues.second = invalidVersion; + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopHead1(loopDepth); return loopDepth; @@ -1265,35 +1266,35 @@ class _executeActorState { } int a_body1cont2loopBody1(int loopDepth) { - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (endOfStream && nextValues.second == invalidVersion) - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - values = std::move(nextValues); #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - valuesSize = nextValuesSize; + values = std::move(nextValues); #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - nextValues = RangeResultWithVersion(); + valuesSize = nextValuesSize; #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - nextValues.second = invalidVersion; + nextValues = RangeResultWithVersion(); #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + nextValues.second = invalidVersion; + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextValuesSize = 0; - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!endOfStream) - #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopBody1loopHead1(loopDepth); } else @@ -1305,31 +1306,31 @@ class _executeActorState { } int a_body1cont2loopBody1cont1(int loopDepth) { - #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (now() >= timeout) - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - task->params[BackupRangeTaskFunc::keyBackupRangeBeginKey] = rangeBegin; #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + task->params[BackupRangeTaskFunc::keyBackupRangeBeginKey] = rangeBegin; + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rangeEnd = values.first.more ? keyAfter(values.first.end()[-1].key) : range.end; - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - valueLoc = 0; #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - committedValueLoc = 0; + valueLoc = 0; #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - tr = makeReference(cx); + committedValueLoc = 0; #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + tr = makeReference(cx); + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopBody1cont1loopHead1(loopDepth); return loopDepth; @@ -1350,16 +1351,16 @@ class _executeActorState { int a_body1cont2loopBody1loopBody1(int loopDepth) { try { - #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" FutureStream __when_expr_2 = results.getFuture(); - #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont2loopBody1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2loopBody1loopBody1when1(__when_expr_2.pop(), loopDepth); }; static_cast<_executeActor*>(this)->actor_wait_state = 3; - #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 1362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1392,46 +1393,46 @@ class _executeActorState { int a_body1cont2loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - err = e; #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + err = e; + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (err.code() == error_code_actor_cancelled) - #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(err, std::max(0, loopDepth - 2)); - #line 1403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (err.code() == error_code_end_of_stream) - #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - endOfStream = true; #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + endOfStream = true; + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (values.second != invalidVersion) - #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { return a_body1cont2loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = logError(cx, Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyErrors) .pack(task->params[BackupAgentBase::keyConfigLogUid]), format("ERROR: %s", err.what())); - #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 2)); else return a_body1cont2loopBody1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor*>(this)->actor_wait_state = 4; - #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1444,86 +1445,86 @@ class _executeActorState { } int a_body1cont2loopBody1loopBody1cont2(RangeResultWithVersion const& v,int loopDepth) { - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - int64_t resultSize = v.first.expectedSize(); #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + int64_t resultSize = v.first.expectedSize(); + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lock->release(resultSize); - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (values.second == invalidVersion) - #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" values = v; - #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } else { - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if ((values.second != v.second) || (valuesSize > 0 && resultSize > 0 && valuesSize + resultSize > CLIENT_KNOBS->BACKUP_LOG_WRITE_BATCH_MAX_SIZE)) - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - nextValues = v; #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + nextValues = v; + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextValuesSize = resultSize; - #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1cont2loopBody1break1(loopDepth==0?0:loopDepth-1); // break } else { - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - values.first.append_deep(values.first.arena(), v.first.begin(), v.first.size()); #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + values.first.append_deep(values.first.arena(), v.first.begin(), v.first.size()); + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" values.first.more = v.first.more; - #line 1478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } - #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" valuesSize += resultSize; - #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopBody1loopBody1cont8(loopDepth); return loopDepth; } int a_body1cont2loopBody1loopBody1cont2(RangeResultWithVersion && v,int loopDepth) { - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - int64_t resultSize = v.first.expectedSize(); #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + int64_t resultSize = v.first.expectedSize(); + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lock->release(resultSize); - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (values.second == invalidVersion) - #line 1496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" values = v; - #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } else { - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if ((values.second != v.second) || (valuesSize > 0 && resultSize > 0 && valuesSize + resultSize > CLIENT_KNOBS->BACKUP_LOG_WRITE_BATCH_MAX_SIZE)) - #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - nextValues = v; #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + nextValues = v; + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextValuesSize = resultSize; - #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1cont2loopBody1break1(loopDepth==0?0:loopDepth-1); // break } else { - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - values.first.append_deep(values.first.arena(), v.first.begin(), v.first.size()); #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + values.first.append_deep(values.first.arena(), v.first.begin(), v.first.size()); + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" values.first.more = v.first.more; - #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } - #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" valuesSize += resultSize; - #line 1526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopBody1loopBody1cont8(loopDepth); return loopDepth; @@ -1606,17 +1607,17 @@ class _executeActorState { } int a_body1cont2loopBody1loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(err, std::max(0, loopDepth - 2)); - #line 1611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return loopDepth; } int a_body1cont2loopBody1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(err, std::max(0, loopDepth - 2)); - #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return loopDepth; } @@ -1685,9 +1686,9 @@ class _executeActorState { } int a_body1cont2loopBody1cont4(int loopDepth) { - #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rangeBegin = rangeEnd; - #line 1690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont2loopHead1(0); return loopDepth; @@ -1702,38 +1703,38 @@ class _executeActorState { int a_body1cont2loopBody1cont1loopBody1(int loopDepth) { try { - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - tr->reset(); #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->reset(); #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" prefix = task->params[BackupAgentBase::keyConfigLogUid].withPrefix( applyMutationsKeyVersionMapRange.begin); - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rangeCountKey = task->params[BackupAgentBase::keyConfigLogUid].withPrefix( applyMutationsKeyVersionCountRange.begin); - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupVersions = krmGetRanges(tr, prefix, KeyRangeRef(rangeBegin, rangeEnd), BUGGIFY ? 2 : 2000, 1e5); - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logVersionValue = tr->get(task->params[BackupAgentBase::keyConfigLogUid].withPrefix(applyMutationsEndRange.begin), Snapshot::True); - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - rangeCountValue = tr->get(rangeCountKey, Snapshot::True); #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + rangeCountValue = tr->get(rangeCountKey, Snapshot::True); + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" prevRange = tr->getRange(firstGreaterOrEqual(prefix), lastLessOrEqual(rangeBegin.withPrefix(prefix)), 1, Snapshot::True, Reverse::True); - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextRange = tr->getRange(firstGreaterOrEqual(rangeEnd.withPrefix(prefix)), firstGreaterOrEqual(strinc(prefix)), 1, Snapshot::True, Reverse::False); - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" verified = taskBucket->keepRunning(tr, task); - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = checkDatabaseLock(tr, BinaryReader::fromStringRef( task->params[BackupAgentBase::keyConfigLogUid], Unversioned())); - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont2loopBody1cont1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont2loopBody1cont1loopBody1when1(__when_expr_4.get(), loopDepth); }; static_cast<_executeActor*>(this)->actor_wait_state = 5; - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 1736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1766,16 +1767,16 @@ class _executeActorState { int a_body1cont2loopBody1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_9 = tr->onError(e); - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), std::max(0, loopDepth - 2)); else return a_body1cont2loopBody1cont1loopBody1Catch1when1(__when_expr_9.get(), loopDepth); }; static_cast<_executeActor*>(this)->actor_wait_state = 10; - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1788,32 +1789,32 @@ class _executeActorState { } int a_body1cont2loopBody1cont1loopBody1cont2(Void const& _,int loopDepth) { - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_5 = success(backupVersions) && success(logVersionValue) && success(rangeCountValue) && success(prevRange) && success(nextRange) && success(verified); - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont2loopBody1cont1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2loopBody1cont1loopBody1cont2when1(__when_expr_5.get(), loopDepth); }; static_cast<_executeActor*>(this)->actor_wait_state = 6; - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2loopBody1cont1loopBody1cont2(Void && _,int loopDepth) { - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_5 = success(backupVersions) && success(logVersionValue) && success(rangeCountValue) && success(prevRange) && success(nextRange) && success(verified); - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont2loopBody1cont1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2loopBody1cont1loopBody1cont2when1(__when_expr_5.get(), loopDepth); }; static_cast<_executeActor*>(this)->actor_wait_state = 6; - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 1816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1883,46 +1884,46 @@ class _executeActorState { } int a_body1cont2loopBody1cont1loopBody1cont3(Void const& _,int loopDepth) { - #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - int64_t rangeCount = 0; #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + int64_t rangeCount = 0; + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (rangeCountValue.get().present()) - #line 1890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - ASSERT(rangeCountValue.get().get().size() == sizeof(int64_t)); #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + ASSERT(rangeCountValue.get().get().size() == sizeof(int64_t)); + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" memcpy(&rangeCount, rangeCountValue.get().get().begin(), rangeCountValue.get().get().size()); - #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool prevAdjacent = prevRange.get().size() && prevRange.get()[0].value.size() && BinaryReader::fromStringRef(prevRange.get()[0].value, Unversioned()) != invalidVersion; - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool nextAdjacent = nextRange.get().size() && nextRange.get()[0].value.size() && BinaryReader::fromStringRef(nextRange.get()[0].value, Unversioned()) != invalidVersion; - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if ((!prevAdjacent || !nextAdjacent) && rangeCount > ((prevAdjacent || nextAdjacent) ? CLIENT_KNOBS->BACKUP_MAP_KEY_UPPER_LIMIT : CLIENT_KNOBS->BACKUP_MAP_KEY_LOWER_LIMIT)) - #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if ((!prevAdjacent || !nextAdjacent) && rangeCount > ((prevAdjacent || nextAdjacent) ? CLIENT_KNOBS->BACKUP_MAP_KEY_UPPER_LIMIT : CLIENT_KNOBS->BACKUP_MAP_KEY_LOWER_LIMIT) && (!g_network->isSimulated() || (isBuggifyEnabled(BuggifyType::General) && !g_simulator->speedUpSimulation))) + #line 1905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - TEST(true); - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + CODE_PROBE(true, "range insert delayed because versionMap is too large"); + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (rangeCount > CLIENT_KNOBS->BACKUP_MAP_KEY_UPPER_LIMIT) - #line 1910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent(SevWarnAlways, "DBA_KeyRangeMapTooLarge").log(); - #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = delay(1); - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont2loopBody1cont1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont2loopBody1cont1loopBody1cont3when1(__when_expr_6.get(), loopDepth); }; static_cast<_executeActor*>(this)->actor_wait_state = 7; - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 1925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -1934,46 +1935,46 @@ class _executeActorState { } int a_body1cont2loopBody1cont1loopBody1cont3(Void && _,int loopDepth) { - #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - int64_t rangeCount = 0; #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + int64_t rangeCount = 0; + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (rangeCountValue.get().present()) - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - ASSERT(rangeCountValue.get().get().size() == sizeof(int64_t)); #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + ASSERT(rangeCountValue.get().get().size() == sizeof(int64_t)); + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" memcpy(&rangeCount, rangeCountValue.get().get().begin(), rangeCountValue.get().get().size()); - #line 1947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool prevAdjacent = prevRange.get().size() && prevRange.get()[0].value.size() && BinaryReader::fromStringRef(prevRange.get()[0].value, Unversioned()) != invalidVersion; - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool nextAdjacent = nextRange.get().size() && nextRange.get()[0].value.size() && BinaryReader::fromStringRef(nextRange.get()[0].value, Unversioned()) != invalidVersion; - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if ((!prevAdjacent || !nextAdjacent) && rangeCount > ((prevAdjacent || nextAdjacent) ? CLIENT_KNOBS->BACKUP_MAP_KEY_UPPER_LIMIT : CLIENT_KNOBS->BACKUP_MAP_KEY_LOWER_LIMIT)) - #line 1955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if ((!prevAdjacent || !nextAdjacent) && rangeCount > ((prevAdjacent || nextAdjacent) ? CLIENT_KNOBS->BACKUP_MAP_KEY_UPPER_LIMIT : CLIENT_KNOBS->BACKUP_MAP_KEY_LOWER_LIMIT) && (!g_network->isSimulated() || (isBuggifyEnabled(BuggifyType::General) && !g_simulator->speedUpSimulation))) + #line 1956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - TEST(true); - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + CODE_PROBE(true, "range insert delayed because versionMap is too large"); + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (rangeCount > CLIENT_KNOBS->BACKUP_MAP_KEY_UPPER_LIMIT) - #line 1961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent(SevWarnAlways, "DBA_KeyRangeMapTooLarge").log(); - #line 1965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = delay(1); - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont2loopBody1cont1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont2loopBody1cont1loopBody1cont3when1(__when_expr_6.get(), loopDepth); }; static_cast<_executeActor*>(this)->actor_wait_state = 7; - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -2048,114 +2049,114 @@ class _executeActorState { } int a_body1cont2loopBody1cont1loopBody1cont4(int loopDepth) { - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version logVersion = logVersionValue.get().present() ? BinaryReader::fromStringRef(logVersionValue.get().get(), Unversioned()) : ::invalidVersion; - #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (logVersion >= values.second) - #line 2055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupRangeTaskFunc::keyBackupRangeBeginKey] = rangeBegin; - #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 2061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace krv(conf.get(DatabaseBackupAgent::keyRangeVersions)); - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" versionRange = singleKeyRange(krv.pack(values.second)); - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->addReadConflictRange(versionRange); - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->addWriteConflictRange(versionRange); - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int versionLoc = 0; - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector> setRanges; - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bytesSet = 0; - #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for(;;) { - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for(;versionLoc < backupVersions.get().size() - 1 && (backupVersions.get()[versionLoc].value.size() < sizeof(Version) || BinaryReader::fromStringRef(backupVersions.get()[versionLoc].value, Unversioned()) != invalidVersion);) { - #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" versionLoc++; - #line 2087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (versionLoc == backupVersions.get().size() - 1) - #line 2091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { break; } - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (backupVersions.get()[versionLoc + 1].key == (removePrefix == StringRef() ? normalKeys.end : strinc(removePrefix))) - #line 2097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (backupVersions.get()[versionLoc + 1].key == (removePrefix == StringRef() ? allKeys.end : strinc(removePrefix))) + #line 2098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - tr->clear(KeyRangeRef( backupVersions.get()[versionLoc].key.removePrefix(removePrefix).withPrefix(addPrefix), addPrefix == StringRef() ? normalKeys.end : strinc(addPrefix))); - #line 2101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + tr->clear(KeyRangeRef( backupVersions.get()[versionLoc].key.removePrefix(removePrefix).withPrefix(addPrefix), addPrefix == StringRef() ? allKeys.end : strinc(addPrefix))); + #line 2102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } else { - #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(KeyRangeRef(backupVersions.get()[versionLoc].key, backupVersions.get()[versionLoc + 1].key) .removePrefix(removePrefix) .withPrefix(addPrefix)); - #line 2107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" setRanges.push_back(krmSetRange( tr, prefix, KeyRangeRef(backupVersions.get()[versionLoc].key, backupVersions.get()[versionLoc + 1].key), BinaryWriter::toValue(values.second, Unversioned()))); - #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int64_t added = 1; - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->atomicOp(rangeCountKey, StringRef((uint8_t*)&added, 8), MutationRef::AddValue); - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for(;valueLoc < values.first.size();++valueLoc) { - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (values.first[valueLoc].key >= backupVersions.get()[versionLoc + 1].key) - #line 2119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { break; } - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (values.first[valueLoc].key >= backupVersions.get()[versionLoc].key) - #line 2125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(values.first[valueLoc].key.removePrefix(removePrefix).withPrefix(addPrefix), values.first[valueLoc].value); - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bytesSet += values.first[valueLoc].expectedSize() - removePrefix.expectedSize() + addPrefix.expectedSize(); - #line 2131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" versionLoc++; - #line 2136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_7 = waitForAll(setRanges); - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont2loopBody1cont1loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont2loopBody1cont1loopBody1cont4when1(__when_expr_7.get(), loopDepth); }; static_cast<_executeActor*>(this)->actor_wait_state = 8; - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2loopBody1cont1loopBody1cont6(Void const& _,int loopDepth) { - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupRangeTaskFunc::keyBackupRangeBeginKey] = rangeBegin; - #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 2158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); @@ -2165,11 +2166,11 @@ class _executeActorState { } int a_body1cont2loopBody1cont1loopBody1cont6(Void && _,int loopDepth) { - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupRangeTaskFunc::keyBackupRangeBeginKey] = rangeBegin; - #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); @@ -2242,32 +2243,32 @@ class _executeActorState { } int a_body1cont2loopBody1cont1loopBody1cont9(Void const& _,int loopDepth) { - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_8 = tr->commit(); - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont2loopBody1cont1loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont2loopBody1cont1loopBody1cont9when1(__when_expr_8.get(), loopDepth); }; static_cast<_executeActor*>(this)->actor_wait_state = 9; - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2loopBody1cont1loopBody1cont9(Void && _,int loopDepth) { - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_8 = tr->commit(); - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont2loopBody1cont1loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont2loopBody1cont1loopBody1cont9when1(__when_expr_8.get(), loopDepth); }; static_cast<_executeActor*>(this)->actor_wait_state = 9; - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 2270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2337,19 +2338,19 @@ class _executeActorState { } int a_body1cont2loopBody1cont1loopBody1cont19(Void const& _,int loopDepth) { - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - Params.bytesWritten().set(task, Params.bytesWritten().getOrDefault(task) + bytesSet); #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + Params.bytesWritten().set(task, Params.bytesWritten().getOrDefault(task) + bytesSet); + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupVersions.get().more) - #line 2344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->reset(); - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" committedValueLoc = valueLoc; - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rangeBegin = backupVersions.get().end()[-1].key; - #line 2352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } else { @@ -2361,19 +2362,19 @@ class _executeActorState { } int a_body1cont2loopBody1cont1loopBody1cont19(Void && _,int loopDepth) { - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - Params.bytesWritten().set(task, Params.bytesWritten().getOrDefault(task) + bytesSet); #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + Params.bytesWritten().set(task, Params.bytesWritten().getOrDefault(task) + bytesSet); + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupVersions.get().more) - #line 2368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->reset(); - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" committedValueLoc = valueLoc; - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rangeBegin = backupVersions.get().end()[-1].key; - #line 2376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } else { @@ -2461,18 +2462,18 @@ class _executeActorState { } int a_body1cont2loopBody1cont1loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" valueLoc = committedValueLoc; - #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopBody1cont1loopBody1cont1(loopDepth); return loopDepth; } int a_body1cont2loopBody1cont1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" valueLoc = committedValueLoc; - #line 2475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopBody1cont1loopBody1cont1(loopDepth); return loopDepth; @@ -2540,78 +2541,78 @@ class _executeActorState { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 9); } - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - Reference lock; #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + Reference lock; + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace conf; - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - double timeout; #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - Key addPrefix; + double timeout; #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + Key addPrefix; + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key removePrefix; - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" KeyRange range; - #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" PromiseStream results; - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future rc; - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - Key rangeBegin; #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - Key rangeEnd; + Key rangeBegin; #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - bool endOfStream; + Key rangeEnd; #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - RangeResultWithVersion nextValues; + bool endOfStream; #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + RangeResultWithVersion nextValues; + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int64_t nextValuesSize; - #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - RangeResultWithVersion values; #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + RangeResultWithVersion values; + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int64_t valuesSize; - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Error err; - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - int valueLoc; #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - int committedValueLoc; + int valueLoc; #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + int committedValueLoc; + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key prefix; - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key rangeCountKey; - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future backupVersions; - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future> logVersionValue; - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - Future> rangeCountValue; #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + Future> rangeCountValue; + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future prevRange; - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future nextRange; - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future verified; - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" KeyRange versionRange; - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int64_t bytesSet; - #line 2609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor final : public Actor, public ActorCallback< _executeActor, 0, Void >, public ActorCallback< _executeActor, 1, Standalone> >, public ActorSingleCallback< _executeActor, 2, RangeResultWithVersion >, public ActorCallback< _executeActor, 3, Void >, public ActorCallback< _executeActor, 4, Void >, public ActorCallback< _executeActor, 5, Void >, public ActorCallback< _executeActor, 6, Void >, public ActorCallback< _executeActor, 7, Void >, public ActorCallback< _executeActor, 8, Void >, public ActorCallback< _executeActor, 9, Void >, public FastAllocated<_executeActor>, public _executeActorState<_executeActor> { - #line 2614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor>::operator new; using FastAllocated<_executeActor>::operator delete; @@ -2629,9 +2630,9 @@ friend struct ActorCallback< _executeActor, 6, Void >; friend struct ActorCallback< _executeActor, 7, Void >; friend struct ActorCallback< _executeActor, 8, Void >; friend struct ActorCallback< _executeActor, 9, Void >; - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 2634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _executeActorState<_executeActor>(cx, taskBucket, futureBucket, task) { @@ -2663,39 +2664,39 @@ friend struct ActorCallback< _executeActor, 9, Void >; } }; - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _executeActor(cx, taskBucket, futureBucket, task)); - #line 2670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 2675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via startBackupRangeInternal() - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class StartBackupRangeInternalActorState { - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StartBackupRangeInternalActorState(Reference const& tr,Standalone> const& keys,Reference const& taskBucket,Reference const& futureBucket,Reference const& task,Reference const& onDone) - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" keys(keys), - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" onDone(onDone) - #line 2698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("startBackupRangeInternal", reinterpret_cast(this)); @@ -2708,46 +2709,46 @@ class StartBackupRangeInternalActorState { int a_body1(int loopDepth=0) { try { - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextKey = task->params[BackupAgentBase::keyBeginKey]; - #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector> addTaskVector; - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for(int idx = 0;idx < keys.size();++idx) { - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (nextKey != keys[idx]) - #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addTaskVector.push_back( addTask(tr, taskBucket, task, nextKey, keys[idx], TaskCompletionKey::joinWith(onDone))); - #line 2727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextKey = keys[idx]; - #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (nextKey != task->params[BackupAgentBase::keyEndKey]) - #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addTaskVector.push_back(addTask(tr, taskBucket, task, nextKey, task->params[BackupAgentBase::keyEndKey], TaskCompletionKey::joinWith(onDone))); - #line 2739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = waitForAll(addTaskVector); - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2768,9 +2769,9 @@ class StartBackupRangeInternalActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~StartBackupRangeInternalActorState(); static_cast(this)->destroy(); return 0; } - #line 2773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~StartBackupRangeInternalActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2780,9 +2781,9 @@ class StartBackupRangeInternalActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~StartBackupRangeInternalActorState(); static_cast(this)->destroy(); return 0; } - #line 2785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~StartBackupRangeInternalActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2853,26 +2854,26 @@ class StartBackupRangeInternalActorState { fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 0); } - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Standalone> keys; - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference onDone; - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key nextKey; - #line 2870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via startBackupRangeInternal() - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class StartBackupRangeInternalActor final : public Actor, public ActorCallback< StartBackupRangeInternalActor, 0, Void >, public FastAllocated, public StartBackupRangeInternalActorState { - #line 2875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2881,9 +2882,9 @@ class StartBackupRangeInternalActor final : public Actor, public ActorCall void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< StartBackupRangeInternalActor, 0, Void >; - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StartBackupRangeInternalActor(Reference const& tr,Standalone> const& keys,Reference const& taskBucket,Reference const& futureBucket,Reference const& task,Reference const& onDone) - #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), StartBackupRangeInternalActorState(tr, keys, taskBucket, futureBucket, task, onDone) { @@ -2906,37 +2907,37 @@ friend struct ActorCallback< StartBackupRangeInternalActor, 0, Void >; } }; - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future startBackupRangeInternal( Reference const& tr, Standalone> const& keys, Reference const& taskBucket, Reference const& futureBucket, Reference const& task, Reference const& onDone ) { - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new StartBackupRangeInternalActor(tr, keys, taskBucket, futureBucket, task, onDone)); - #line 2913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActorState { - #line 2924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActorState(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskFuture(futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone])) - #line 2939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -2949,60 +2950,60 @@ class _finishActorState { int a_body1(int loopDepth=0) { try { - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DRConfig config(task); - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int64_t bytesWritten = Params.bytesWritten().getOrDefault(task); - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" config.rangeBytesWritten().atomicOp(tr, bytesWritten, MutationRef::AddValue); - #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (task->params.find(BackupRangeTaskFunc::keyAddBackupRangeTasks) != task->params.end()) - #line 2960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = startBackupRangeInternal( tr, BinaryReader::fromStringRef>>( task->params[BackupRangeTaskFunc::keyAddBackupRangeTasks], IncludeVersion()), taskBucket, futureBucket, task, taskFuture) && taskBucket->finish(tr, task); - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor*>(this)->actor_wait_state = 1; - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor*>(this))); - #line 2971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (task->params.find(BackupRangeTaskFunc::keyBackupRangeBeginKey) != task->params.end() && task->params[BackupRangeTaskFunc::keyBackupRangeBeginKey] < task->params[BackupAgentBase::keyEndKey]) - #line 2978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ASSERT(taskFuture->key.size() > 0); - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = success(BackupRangeTaskFunc::addTask(tr, taskBucket, task, task->params[BackupRangeTaskFunc::keyBackupRangeBeginKey], task->params[BackupAgentBase::keyEndKey], TaskCompletionKey::signal(taskFuture->key))) && taskBucket->finish(tr, task); - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor*>(this)->actor_wait_state = 2; - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor*>(this))); - #line 2991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = taskFuture->set(tr, taskBucket) && taskBucket->finish(tr, task); - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1when3(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor*>(this)->actor_wait_state = 3; - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor*>(this))); - #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } } @@ -3025,9 +3026,9 @@ class _finishActorState { } int a_body1cont1(int loopDepth) { - #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor*>(this)->SAV::futures) { (void)(Void()); this->~_finishActorState(); static_cast<_finishActor*>(this)->destroy(); return 0; } - #line 3030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActorState(); static_cast<_finishActor*>(this)->finishSendAndDelPromiseRef(); @@ -3266,22 +3267,22 @@ class _finishActorState { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); } - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskFuture; - #line 3279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor final : public Actor, public ActorCallback< _finishActor, 0, Void >, public ActorCallback< _finishActor, 1, Void >, public ActorCallback< _finishActor, 2, Void >, public FastAllocated<_finishActor>, public _finishActorState<_finishActor> { - #line 3284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor>::operator new; using FastAllocated<_finishActor>::operator delete; @@ -3292,9 +3293,9 @@ class _finishActor final : public Actor, public ActorCallback< _finishActo friend struct ActorCallback< _finishActor, 0, Void >; friend struct ActorCallback< _finishActor, 1, Void >; friend struct ActorCallback< _finishActor, 2, Void >; - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 3297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _finishActorState<_finishActor>(tr, taskBucket, futureBucket, task) { @@ -3319,46 +3320,46 @@ friend struct ActorCallback< _finishActor, 2, Void >; } }; - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _finishActor(tr, taskBucket, futureBucket, task)); - #line 3326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" }; -StringRef BackupRangeTaskFunc::name = LiteralStringRef("dr_backup_range"); -const Key BackupRangeTaskFunc::keyAddBackupRangeTasks = LiteralStringRef("addBackupRangeTasks"); -const Key BackupRangeTaskFunc::keyBackupRangeBeginKey = LiteralStringRef("backupRangeBeginKey"); +StringRef BackupRangeTaskFunc::name = "dr_backup_range"_sr; +const Key BackupRangeTaskFunc::keyAddBackupRangeTasks = "addBackupRangeTasks"_sr; +const Key BackupRangeTaskFunc::keyBackupRangeBeginKey = "backupRangeBeginKey"_sr; REGISTER_TASKFUNC(BackupRangeTaskFunc); struct FinishFullBackupTaskFunc : TaskFuncBase { static StringRef name; static constexpr uint32_t version = 1; - #line 3340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor1State { - #line 3346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor1State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" states(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyStates) .get(task->params[BackupAgentBase::keyConfigLogUid])) - #line 3361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -3371,16 +3372,16 @@ class _finishActor1State { int a_body1(int loopDepth=0) { try { - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(tr, task, FinishFullBackupTaskFunc::name, FinishFullBackupTaskFunc::version); - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor1*>(this)->actor_wait_state = 1; - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor1*>(this))); - #line 3383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3401,40 +3402,40 @@ class _finishActor1State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Transaction srcTr(taskBucket->src); - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = srcTr.getReadVersion(); - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor1*>(this)->actor_wait_state = 2; - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor1*>(this))); - #line 3417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Transaction srcTr(taskBucket->src); - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = srcTr.getReadVersion(); - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor1*>(this)->actor_wait_state = 2; - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor1*>(this))); - #line 3437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3504,40 +3505,40 @@ class _finishActor1State { } int a_body1cont2(Version const& readVersion,int loopDepth) { - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(states.pack(DatabaseBackupAgent::keyCopyStop), BinaryWriter::toValue(readVersion, Unversioned())); - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_FinishFullBackup").detail("CopyStop", readVersion); - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = taskBucket->finish(tr, task); - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor1*>(this)->actor_wait_state = 3; - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor1*>(this))); - #line 3520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Version && readVersion,int loopDepth) { - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(states.pack(DatabaseBackupAgent::keyCopyStop), BinaryWriter::toValue(readVersion, Unversioned())); - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_FinishFullBackup").detail("CopyStop", readVersion); - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = taskBucket->finish(tr, task); - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor1*>(this)->actor_wait_state = 3; - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor1*>(this))); - #line 3540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3607,9 +3608,9 @@ class _finishActor1State { } int a_body1cont3(Void const& _,int loopDepth) { - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor1*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor1State(); static_cast<_finishActor1*>(this)->destroy(); return 0; } - #line 3612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor1*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor1State(); static_cast<_finishActor1*>(this)->finishSendAndDelPromiseRef(); @@ -3619,9 +3620,9 @@ class _finishActor1State { } int a_body1cont3(Void && _,int loopDepth) { - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor1*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor1State(); static_cast<_finishActor1*>(this)->destroy(); return 0; } - #line 3624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor1*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor1State(); static_cast<_finishActor1*>(this)->finishSendAndDelPromiseRef(); @@ -3692,22 +3693,22 @@ class _finishActor1State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); } - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace states; - #line 3705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor1 final : public Actor, public ActorCallback< _finishActor1, 0, Void >, public ActorCallback< _finishActor1, 1, Version >, public ActorCallback< _finishActor1, 2, Void >, public FastAllocated<_finishActor1>, public _finishActor1State<_finishActor1> { - #line 3710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor1>::operator new; using FastAllocated<_finishActor1>::operator delete; @@ -3718,9 +3719,9 @@ class _finishActor1 final : public Actor, public ActorCallback< _finishAct friend struct ActorCallback< _finishActor1, 0, Void >; friend struct ActorCallback< _finishActor1, 1, Version >; friend struct ActorCallback< _finishActor1, 2, Void >; - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor1(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _finishActor1State<_finishActor1>(tr, taskBucket, futureBucket, task) { @@ -3745,37 +3746,37 @@ friend struct ActorCallback< _finishActor1, 2, Void >; } }; - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _finishActor1(tr, taskBucket, futureBucket, task)); - #line 3752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor1State { - #line 3763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor1State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" parentTask(parentTask), - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" completionKey(completionKey), - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" waitFor(waitFor) - #line 3778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -3788,16 +3789,16 @@ class AddTaskActor1State { int a_body1(int loopDepth=0) { try { - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3818,64 +3819,64 @@ class AddTaskActor1State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(FinishFullBackupTaskFunc::name, FinishFullBackupTaskFunc::version, doneKey); - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 3827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor1State(); static_cast(this)->destroy(); return 0; } - #line 3831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(FinishFullBackupTaskFunc::name, FinishFullBackupTaskFunc::version, doneKey); - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 3859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor1State(); static_cast(this)->destroy(); return 0; } - #line 3863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 3879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3945,10 +3946,10 @@ class AddTaskActor1State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor1State(); static_cast(this)->destroy(); return 0; } - #line 3950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor1State(); static_cast(this)->destroy(); return 0; } + #line 3951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -3957,10 +3958,10 @@ class AddTaskActor1State { } int a_body1cont2(Void && _,int loopDepth) { - #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor1State(); static_cast(this)->destroy(); return 0; } - #line 3962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor1State(); static_cast(this)->destroy(); return 0; } + #line 3963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -4030,22 +4031,22 @@ class AddTaskActor1State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 1); } - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference parentTask; - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference waitFor; - #line 4043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor1 final : public Actor, public ActorCallback< AddTaskActor1, 0, Key >, public ActorCallback< AddTaskActor1, 1, Void >, public FastAllocated, public AddTaskActor1State { - #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4055,9 +4056,9 @@ class AddTaskActor1 final : public Actor, public ActorCallback< AddTaskActo #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor1, 0, Key >; friend struct ActorCallback< AddTaskActor1, 1, Void >; - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor1(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 4060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), AddTaskActor1State(tr, taskBucket, parentTask, completionKey, waitFor) { @@ -4081,14 +4082,14 @@ friend struct ActorCallback< AddTaskActor1, 1, Void >; } }; - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new AddTaskActor1(tr, taskBucket, parentTask, completionKey, waitFor)); - #line 4088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StringRef getName() const override { return name; }; @@ -4105,7 +4106,7 @@ friend struct ActorCallback< AddTaskActor1, 1, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef FinishFullBackupTaskFunc::name = LiteralStringRef("dr_finish_full_backup"); +StringRef FinishFullBackupTaskFunc::name = "dr_finish_full_backup"_sr; REGISTER_TASKFUNC(FinishFullBackupTaskFunc); struct EraseLogRangeTaskFunc : TaskFuncBase { @@ -4127,28 +4128,28 @@ struct EraseLogRangeTaskFunc : TaskFuncBase { return _finish(tr, tb, fb, task); }; - #line 4130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor1State { - #line 4136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor1State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : cx(cx), - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lock(CLIENT_KNOBS->BACKUP_LOCK_BYTES) - #line 4151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -4161,16 +4162,16 @@ class _executeActor1State { int a_body1(int loopDepth=0) { try { - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(cx, task, EraseLogRangeTaskFunc::name, EraseLogRangeTaskFunc::version); - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 1; - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 4173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4191,22 +4192,22 @@ class _executeActor1State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(taskBucket->src)); - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 4198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(taskBucket->src)); - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 4209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -4284,18 +4285,18 @@ class _executeActor1State { int a_body1cont1loopBody1(int loopDepth) { try { - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version endVersion = BinaryReader::fromStringRef( task->params[DatabaseBackupAgent::keyEndVersion], Unversioned()); - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = eraseLogData( tr, task->params[BackupAgentBase::keyConfigLogUid], task->params[BackupAgentBase::destUid], Optional(endVersion), CheckBackupUID::True, BinaryReader::fromStringRef(task->params[BackupAgentBase::keyFolderId], Unversioned())); - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 2; - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 4298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4315,16 +4316,16 @@ class _executeActor1State { int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = tr->onError(e); - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 4; - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 4327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4337,32 +4338,32 @@ class _executeActor1State { } int a_body1cont1loopBody1cont2(Void const& _,int loopDepth) { - #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr->commit(); - #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 3; - #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 4349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont2(Void && _,int loopDepth) { - #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr->commit(); - #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 3; - #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 4365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4432,9 +4433,9 @@ class _executeActor1State { } int a_body1cont1loopBody1cont3(Void const& _,int loopDepth) { - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor1*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor1State(); static_cast<_executeActor1*>(this)->destroy(); return 0; } - #line 4437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor1*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor1State(); static_cast<_executeActor1*>(this)->finishSendAndDelPromiseRef(); @@ -4444,9 +4445,9 @@ class _executeActor1State { } int a_body1cont1loopBody1cont3(Void && _,int loopDepth) { - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor1*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor1State(); static_cast<_executeActor1*>(this)->destroy(); return 0; } - #line 4449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor1*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor1State(); static_cast<_executeActor1*>(this)->finishSendAndDelPromiseRef(); @@ -4592,24 +4593,24 @@ class _executeActor1State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 3); } - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" FlowLock lock; - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 4607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor1 final : public Actor, public ActorCallback< _executeActor1, 0, Void >, public ActorCallback< _executeActor1, 1, Void >, public ActorCallback< _executeActor1, 2, Void >, public ActorCallback< _executeActor1, 3, Void >, public FastAllocated<_executeActor1>, public _executeActor1State<_executeActor1> { - #line 4612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor1>::operator new; using FastAllocated<_executeActor1>::operator delete; @@ -4621,9 +4622,9 @@ friend struct ActorCallback< _executeActor1, 0, Void >; friend struct ActorCallback< _executeActor1, 1, Void >; friend struct ActorCallback< _executeActor1, 2, Void >; friend struct ActorCallback< _executeActor1, 3, Void >; - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor1(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 4626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _executeActor1State<_executeActor1>(cx, taskBucket, futureBucket, task) { @@ -4649,39 +4650,39 @@ friend struct ActorCallback< _executeActor1, 3, Void >; } }; - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _executeActor1(cx, taskBucket, futureBucket, task)); - #line 4656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 4661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor2State { - #line 4667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor2State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,Version const& endVersion,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" parentTask(parentTask), - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endVersion(endVersion), - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" completionKey(completionKey), - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" waitFor(waitFor) - #line 4684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -4694,16 +4695,16 @@ class AddTaskActor2State { int a_body1(int loopDepth=0) { try { - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4724,72 +4725,72 @@ class AddTaskActor2State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(EraseLogRangeTaskFunc::name, EraseLogRangeTaskFunc::version, doneKey, 1); - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyBeginVersion] = BinaryWriter::toValue(1, Unversioned()); - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyEndVersion] = BinaryWriter::toValue(endVersion, Unversioned()); - #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 4737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor2State(); static_cast(this)->destroy(); return 0; } - #line 4741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(EraseLogRangeTaskFunc::name, EraseLogRangeTaskFunc::version, doneKey, 1); - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyBeginVersion] = BinaryWriter::toValue(1, Unversioned()); - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyEndVersion] = BinaryWriter::toValue(endVersion, Unversioned()); - #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 4773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor2State(); static_cast(this)->destroy(); return 0; } - #line 4777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4859,10 +4860,10 @@ class AddTaskActor2State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor2State(); static_cast(this)->destroy(); return 0; } - #line 4864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor2State(); static_cast(this)->destroy(); return 0; } + #line 4865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -4871,10 +4872,10 @@ class AddTaskActor2State { } int a_body1cont2(Void && _,int loopDepth) { - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor2State(); static_cast(this)->destroy(); return 0; } - #line 4876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor2State(); static_cast(this)->destroy(); return 0; } + #line 4877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -4944,24 +4945,24 @@ class AddTaskActor2State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 1); } - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference parentTask; - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version endVersion; - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference waitFor; - #line 4959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor2 final : public Actor, public ActorCallback< AddTaskActor2, 0, Key >, public ActorCallback< AddTaskActor2, 1, Void >, public FastAllocated, public AddTaskActor2State { - #line 4964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4971,9 +4972,9 @@ class AddTaskActor2 final : public Actor, public ActorCallback< AddTaskActo #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor2, 0, Key >; friend struct ActorCallback< AddTaskActor2, 1, Void >; - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor2(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,Version const& endVersion,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 4976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 4977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), AddTaskActor2State(tr, taskBucket, parentTask, endVersion, completionKey, waitFor) { @@ -4997,37 +4998,37 @@ friend struct ActorCallback< AddTaskActor2, 1, Void >; } }; - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, Version const& endVersion, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new AddTaskActor2(tr, taskBucket, parentTask, endVersion, completionKey, waitFor)); - #line 5004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor2State { - #line 5015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor2State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskFuture(futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone])) - #line 5030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -5040,16 +5041,16 @@ class _finishActor2State { int a_body1(int loopDepth=0) { try { - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = taskFuture->set(tr, taskBucket) && taskBucket->finish(tr, task); - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor2*>(this)->actor_wait_state = 1; - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor2*>(this))); - #line 5052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5070,9 +5071,9 @@ class _finishActor2State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor2*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor2State(); static_cast<_finishActor2*>(this)->destroy(); return 0; } - #line 5075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor2*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor2State(); static_cast<_finishActor2*>(this)->finishSendAndDelPromiseRef(); @@ -5082,9 +5083,9 @@ class _finishActor2State { } int a_body1cont1(Void && _,int loopDepth) { - #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor2*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor2State(); static_cast<_finishActor2*>(this)->destroy(); return 0; } - #line 5087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor2*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor2State(); static_cast<_finishActor2*>(this)->finishSendAndDelPromiseRef(); @@ -5155,22 +5156,22 @@ class _finishActor2State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); } - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskFuture; - #line 5168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor2 final : public Actor, public ActorCallback< _finishActor2, 0, Void >, public FastAllocated<_finishActor2>, public _finishActor2State<_finishActor2> { - #line 5173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor2>::operator new; using FastAllocated<_finishActor2>::operator delete; @@ -5179,9 +5180,9 @@ class _finishActor2 final : public Actor, public ActorCallback< _finishAct void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< _finishActor2, 0, Void >; - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor2(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 5184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _finishActor2State<_finishActor2>(tr, taskBucket, futureBucket, task) { @@ -5204,16 +5205,16 @@ friend struct ActorCallback< _finishActor2, 0, Void >; } }; - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _finishActor2(tr, taskBucket, futureBucket, task)); - #line 5211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" }; -StringRef EraseLogRangeTaskFunc::name = LiteralStringRef("dr_erase_log_range"); +StringRef EraseLogRangeTaskFunc::name = "dr_erase_log_range"_sr; REGISTER_TASKFUNC(EraseLogRangeTaskFunc); struct CopyLogRangeTaskFunc : TaskFuncBase { @@ -5221,7 +5222,7 @@ struct CopyLogRangeTaskFunc : TaskFuncBase { static constexpr uint32_t version = 1; static struct { - static TaskParam bytesWritten() { return LiteralStringRef(__FUNCTION__); } + static TaskParam bytesWritten() { return __FUNCTION__sr; } } Params; static const Key keyNextBeginVersion; @@ -5243,44 +5244,44 @@ struct CopyLogRangeTaskFunc : TaskFuncBase { // store mutation data from results until the end of stream or the timeout. If breaks on timeout returns the first // uncopied version - #line 5246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via dumpData() - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class DumpDataActorState { - #line 5252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DumpDataActorState(Database const& cx,Reference const& task,PromiseStream const& results,FlowLock* const& lock,Reference const& tb,double const& breakTime) - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : cx(cx), - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" results(results), - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lock(lock), - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tb(tb), - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" breakTime(breakTime), - #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endOfStream(false), - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - conf(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(task->params[BackupAgentBase::keyConfigLogUid])), #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + conf(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(task->params[BackupAgentBase::keyConfigLogUid])), + #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutations(), - #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" isTimeoutOccured(false), - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lastKey(), - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lastVersion(), - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutationSize(0) - #line 5283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("dumpData", reinterpret_cast(this)); @@ -5293,9 +5294,9 @@ class DumpDataActorState { int a_body1(int loopDepth=0) { try { - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 5298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -5324,33 +5325,33 @@ class DumpDataActorState { int a_body1loopBody1(int loopDepth) { try { - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (endOfStream && !nextMutationSize) - #line 5329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~DumpDataActorState(); static_cast(this)->destroy(); return 0; } - #line 5333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~DumpDataActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" mutations = std::move(nextMutations); - #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" mutationSize = nextMutationSize; - #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutations = std::vector(); - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutationSize = 0; - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!endOfStream) - #line 5349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 5353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1loopHead1(loopDepth); } else @@ -5375,26 +5376,26 @@ class DumpDataActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (e.code() == error_code_actor_cancelled || e.code() == error_code_backup_error) - #line 5380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 5384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" err = e; - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = logError(cx, Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyErrors) .pack(task->params[BackupAgentBase::keyConfigLogUid]), format("ERROR: Failed to dump mutations because of error %s", err.what())); - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5407,13 +5408,13 @@ class DumpDataActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextVersionAfterBreak = Optional(); - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = Transaction(cx); - #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 5416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont2loopHead1(loopDepth); return loopDepth; @@ -5434,16 +5435,16 @@ class DumpDataActorState { int a_body1loopBody1loopBody1(int loopDepth) { try { - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" FutureStream __when_expr_0 = results.getFuture(); - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 5441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1loopBody1when1(__when_expr_0.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5476,20 +5477,20 @@ class DumpDataActorState { int a_body1loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" error = e; - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (e.code() == error_code_end_of_stream) - #line 5483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endOfStream = true; - #line 5487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1loopBody1Catch1(error, std::max(0, loopDepth - 1)); - #line 5492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1loopBody1Catch1(error, std::max(0, loopDepth - 1)); @@ -5501,52 +5502,52 @@ class DumpDataActorState { } int a_body1loopBody1loopBody1cont2(RCGroup const& group,int loopDepth) { - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lock->release(group.items.expectedSize()); - #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int vecSize = group.items.expectedSize(); - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (mutationSize + vecSize >= CLIENT_KNOBS->BACKUP_LOG_WRITE_BATCH_MAX_SIZE) - #line 5510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutations.push_back(group.items); - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutationSize = vecSize; - #line 5516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" mutations.push_back(group.items); - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" mutationSize += vecSize; - #line 5523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1loopBody1cont5(loopDepth); return loopDepth; } int a_body1loopBody1loopBody1cont2(RCGroup && group,int loopDepth) { - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lock->release(group.items.expectedSize()); - #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int vecSize = group.items.expectedSize(); - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (mutationSize + vecSize >= CLIENT_KNOBS->BACKUP_LOG_WRITE_BATCH_MAX_SIZE) - #line 5536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutations.push_back(group.items); - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutationSize = vecSize; - #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" mutations.push_back(group.items); - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" mutationSize += vecSize; - #line 5549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1loopBody1cont5(loopDepth); return loopDepth; @@ -5629,27 +5630,27 @@ class DumpDataActorState { } int a_body1loopBody1cont5(int loopDepth) { - #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (nextVersionAfterBreak.present()) - #line 5634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(nextVersionAfterBreak); this->~DumpDataActorState(); static_cast(this)->destroy(); return 0; } - #line 5638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(nextVersionAfterBreak)); // state_var_RVO this->~DumpDataActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!isTimeoutOccured && timer_monotonic() >= breakTime && lastKey.present()) - #line 5646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lastVersion = getLogKeyVersion(lastKey.get()); - #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" isTimeoutOccured = true; - #line 5652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } loopDepth = a_body1loopBody1cont9(loopDepth); @@ -5665,20 +5666,20 @@ class DumpDataActorState { int a_body1loopBody1cont2loopBody1(int loopDepth) { try { - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.trState->options.sizeLimit = 2 * CLIENT_KNOBS->TRANSACTION_SIZE_LIMIT; - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = checkDatabaseLock(&tr, BinaryReader::fromStringRef( task->params[BackupAgentBase::keyConfigLogUid], Unversioned())); - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 5676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont2loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5711,16 +5712,16 @@ class DumpDataActorState { int a_body1loopBody1cont2loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = tr.onError(e); - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5733,118 +5734,118 @@ class DumpDataActorState { } int a_body1loopBody1cont2loopBody1cont2(Void const& _,int loopDepth) { - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bytesSet = 0; - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool first = true; - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto m : mutations ) { - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto kv : m ) { - #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (isTimeoutOccured) - #line 5746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version newVersion = getLogKeyVersion(kv.key); - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (newVersion > lastVersion) - #line 5752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextVersionAfterBreak = newVersion; - #line 5756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" break; } } - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (first) - #line 5762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.addReadConflictRange(singleKeyRange(kv.key)); - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" first = false; - #line 5768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.set(kv.key.removePrefix(backupLogKeys.begin) .removePrefix(task->params[BackupAgentBase::destUid]) .withPrefix(task->params[BackupAgentBase::keyConfigLogUid]) .withPrefix(applyLogKeys.begin), kv.value); - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bytesSet += kv.expectedSize() - backupLogKeys.begin.expectedSize() + applyLogKeys.begin.expectedSize(); - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lastKey = kv.key; - #line 5776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr.commit(); - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 5783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont2loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2loopBody1cont2(Void && _,int loopDepth) { - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bytesSet = 0; - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool first = true; - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto m : mutations ) { - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto kv : m ) { - #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (isTimeoutOccured) - #line 5805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version newVersion = getLogKeyVersion(kv.key); - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (newVersion > lastVersion) - #line 5811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextVersionAfterBreak = newVersion; - #line 5815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" break; } } - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (first) - #line 5821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.addReadConflictRange(singleKeyRange(kv.key)); - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" first = false; - #line 5827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.set(kv.key.removePrefix(backupLogKeys.begin) .removePrefix(task->params[BackupAgentBase::destUid]) .withPrefix(task->params[BackupAgentBase::keyConfigLogUid]) .withPrefix(applyLogKeys.begin), kv.value); - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bytesSet += kv.expectedSize() - backupLogKeys.begin.expectedSize() + applyLogKeys.begin.expectedSize(); - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lastKey = kv.key; - #line 5835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr.commit(); - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 5842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont2loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -5914,18 +5915,18 @@ class DumpDataActorState { } int a_body1loopBody1cont2loopBody1cont3(Void const& _,int loopDepth) { - #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Params.bytesWritten().set(task, Params.bytesWritten().getOrDefault(task) + bytesSet); - #line 5919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1loopBody1cont2break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1loopBody1cont2loopBody1cont3(Void && _,int loopDepth) { - #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Params.bytesWritten().set(task, Params.bytesWritten().getOrDefault(task) + bytesSet); - #line 5928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 5929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1loopBody1cont2break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -6083,17 +6084,17 @@ class DumpDataActorState { } int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(err, std::max(0, loopDepth - 1)); - #line 6088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return loopDepth; } int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(err, std::max(0, loopDepth - 1)); - #line 6096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return loopDepth; } @@ -6160,52 +6161,52 @@ class DumpDataActorState { fdb_probe_actor_exit("dumpData", reinterpret_cast(this), 4); } - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" PromiseStream results; - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" FlowLock* lock; - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tb; - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" double breakTime; - #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool endOfStream; - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - Subspace conf; #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + Subspace conf; + #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector nextMutations; - #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool isTimeoutOccured; - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Optional lastKey; - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version lastVersion; - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int64_t nextMutationSize; - #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector mutations; - #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int64_t mutationSize; - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Error error; - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Optional nextVersionAfterBreak; - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Transaction tr; - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int64_t bytesSet; - #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Error err; - #line 6203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via dumpData() - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class DumpDataActor final : public Actor>, public ActorSingleCallback< DumpDataActor, 0, RCGroup >, public ActorCallback< DumpDataActor, 1, Void >, public ActorCallback< DumpDataActor, 2, Void >, public ActorCallback< DumpDataActor, 3, Void >, public ActorCallback< DumpDataActor, 4, Void >, public FastAllocated, public DumpDataActorState { - #line 6208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6218,9 +6219,9 @@ friend struct ActorCallback< DumpDataActor, 1, Void >; friend struct ActorCallback< DumpDataActor, 2, Void >; friend struct ActorCallback< DumpDataActor, 3, Void >; friend struct ActorCallback< DumpDataActor, 4, Void >; - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DumpDataActor(Database const& cx,Reference const& task,PromiseStream const& results,FlowLock* const& lock,Reference const& tb,double const& breakTime) - #line 6223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor>(), DumpDataActorState(cx, task, results, lock, tb, breakTime) { @@ -6247,35 +6248,35 @@ friend struct ActorCallback< DumpDataActor, 4, Void >; } }; - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future> dumpData( Database const& cx, Reference const& task, PromiseStream const& results, FlowLock* const& lock, Reference const& tb, double const& breakTime ) { - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future>(new DumpDataActor(cx, task, results, lock, tb, breakTime)); - #line 6254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 6259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor2State { - #line 6265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor2State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : cx(cx), - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task) - #line 6278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -6288,16 +6289,16 @@ class _executeActor2State { int a_body1(int loopDepth=0) { try { - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(cx, task, CopyLogRangeTaskFunc::name, CopyLogRangeTaskFunc::version); - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 1; - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor2*>(this))); - #line 6300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6318,62 +6319,62 @@ class _executeActor2State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyBeginVersion], Unversioned()); - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - endVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyEndVersion], Unversioned()); #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + endVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyEndVersion], Unversioned()); + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version newEndVersion = std::min(endVersion, (((beginVersion - 1) / CLIENT_KNOBS->COPY_LOG_BLOCK_SIZE) + 1 + CLIENT_KNOBS->COPY_LOG_BLOCKS_PER_TASK + (g_network->isSimulated() ? CLIENT_KNOBS->BACKUP_SIM_COPY_LOG_RANGES : 0)) * CLIENT_KNOBS->COPY_LOG_BLOCK_SIZE); - #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ranges = getLogRanges( beginVersion, newEndVersion, task->params[BackupAgentBase::destUid], CLIENT_KNOBS->COPY_LOG_BLOCK_SIZE); - #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nRanges = ranges.size(); - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" results = std::vector>(); - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rc = std::vector>(); - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" locks = std::vector>(); - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextVersion = beginVersion; - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" breakTime = timer_monotonic() + CLIENT_KNOBS->COPY_LOG_TASK_DURATION_NANOS; - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rangeN = 0; - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 6345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyBeginVersion], Unversioned()); - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - endVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyEndVersion], Unversioned()); #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + endVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyEndVersion], Unversioned()); + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version newEndVersion = std::min(endVersion, (((beginVersion - 1) / CLIENT_KNOBS->COPY_LOG_BLOCK_SIZE) + 1 + CLIENT_KNOBS->COPY_LOG_BLOCKS_PER_TASK + (g_network->isSimulated() ? CLIENT_KNOBS->BACKUP_SIM_COPY_LOG_RANGES : 0)) * CLIENT_KNOBS->COPY_LOG_BLOCK_SIZE); - #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ranges = getLogRanges( beginVersion, newEndVersion, task->params[BackupAgentBase::destUid], CLIENT_KNOBS->COPY_LOG_BLOCK_SIZE); - #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nRanges = ranges.size(); - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" results = std::vector>(); - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rc = std::vector>(); - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" locks = std::vector>(); - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextVersion = beginVersion; - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" breakTime = timer_monotonic() + CLIENT_KNOBS->COPY_LOG_TASK_DURATION_NANOS; - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rangeN = 0; - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 6376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -6443,17 +6444,17 @@ class _executeActor2State { } int a_body1cont2(int loopDepth) { - #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (nextVersion < endVersion) - #line 6448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[CopyLogRangeTaskFunc::keyNextBeginVersion] = BinaryWriter::toValue(nextVersion, Unversioned()); - #line 6452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor2*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor2State(); static_cast<_executeActor2*>(this)->destroy(); return 0; } - #line 6456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor2*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor2State(); static_cast<_executeActor2*>(this)->finishSendAndDelPromiseRef(); @@ -6470,34 +6471,34 @@ class _executeActor2State { } int a_body1cont1loopBody1(int loopDepth) { - #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (rangeN >= nRanges) - #line 6475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int prefetchTo = std::min(rangeN + CLIENT_KNOBS->COPY_LOG_PREFETCH_BLOCKS, nRanges); - #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for(int j = results.size();j < prefetchTo;j++) { - #line 894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" results.push_back(PromiseStream()); - #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" locks.push_back(makeReference(CLIENT_KNOBS->COPY_LOG_READ_AHEAD_BYTES)); - #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rc.push_back(readCommitted(taskBucket->src, results[j], Future(Void()), locks[j], ranges[j], decodeBKMutationLogKey, Terminator::True, AccessSystemKeys::True, LockAware::True)); - #line 6489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_1 = dumpData(cx, task, results[rangeN], locks[rangeN].getPtr(), taskBucket, breakTime); - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 2; - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast<_executeActor2*>(this))); - #line 6500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -6517,54 +6518,54 @@ class _executeActor2State { } int a_body1cont1loopBody1cont1(Optional const& nextVersionBr,int loopDepth) { - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (nextVersionBr.present()) - #line 6522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextVersion = nextVersionBr.get(); - #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent(SevInfo, "CopyLogRangeTaskFuncAborted") .detail("DurationNanos", CLIENT_KNOBS->COPY_LOG_TASK_DURATION_NANOS) .detail("RangeN", rangeN) .detail("BytesWritten", Params.bytesWritten().getOrDefault(task)); - #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for(int j = results.size();--j >= rangeN;) { - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rc[j].cancel(); - #line 6532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextVersion = getLogKeyVersion(ranges[rangeN].end); - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rangeN++; - #line 6540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; } int a_body1cont1loopBody1cont1(Optional && nextVersionBr,int loopDepth) { - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (nextVersionBr.present()) - #line 6549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextVersion = nextVersionBr.get(); - #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent(SevInfo, "CopyLogRangeTaskFuncAborted") .detail("DurationNanos", CLIENT_KNOBS->COPY_LOG_TASK_DURATION_NANOS) .detail("RangeN", rangeN) .detail("BytesWritten", Params.bytesWritten().getOrDefault(task)); - #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for(int j = results.size();--j >= rangeN;) { - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rc[j].cancel(); - #line 6559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextVersion = getLogKeyVersion(ranges[rangeN].end); - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rangeN++; - #line 6567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; @@ -6632,40 +6633,40 @@ class _executeActor2State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); } - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version beginVersion; - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version endVersion; - #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Standalone> ranges; - #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int nRanges; - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector> results; - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector> rc; - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector> locks; - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version nextVersion; - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" double breakTime; - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int rangeN; - #line 6663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor2 final : public Actor, public ActorCallback< _executeActor2, 0, Void >, public ActorCallback< _executeActor2, 1, Optional >, public FastAllocated<_executeActor2>, public _executeActor2State<_executeActor2> { - #line 6668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor2>::operator new; using FastAllocated<_executeActor2>::operator delete; @@ -6675,9 +6676,9 @@ class _executeActor2 final : public Actor, public ActorCallback< _executeA #pragma clang diagnostic pop friend struct ActorCallback< _executeActor2, 0, Void >; friend struct ActorCallback< _executeActor2, 1, Optional >; - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor2(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 6680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _executeActor2State<_executeActor2>(cx, taskBucket, futureBucket, task) { @@ -6701,41 +6702,41 @@ friend struct ActorCallback< _executeActor2, 1, Optional >; } }; - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _executeActor2(cx, taskBucket, futureBucket, task)); - #line 6708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 6713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor3State { - #line 6719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor3State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,Version const& beginVersion,Version const& endVersion,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" parentTask(parentTask), - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion(beginVersion), - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endVersion(endVersion), - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" completionKey(completionKey), - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" waitFor(waitFor) - #line 6738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -6748,16 +6749,16 @@ class AddTaskActor3State { int a_body1(int loopDepth=0) { try { - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6778,72 +6779,72 @@ class AddTaskActor3State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(CopyLogRangeTaskFunc::name, CopyLogRangeTaskFunc::version, doneKey, 1); - #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyBeginVersion] = BinaryWriter::toValue(beginVersion, Unversioned()); - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyEndVersion] = BinaryWriter::toValue(endVersion, Unversioned()); - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 6791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor3State(); static_cast(this)->destroy(); return 0; } - #line 6795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor3State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(CopyLogRangeTaskFunc::name, CopyLogRangeTaskFunc::version, doneKey, 1); - #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyBeginVersion] = BinaryWriter::toValue(beginVersion, Unversioned()); - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyEndVersion] = BinaryWriter::toValue(endVersion, Unversioned()); - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 6827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor3State(); static_cast(this)->destroy(); return 0; } - #line 6831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor3State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 6847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -6913,10 +6914,10 @@ class AddTaskActor3State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor3State(); static_cast(this)->destroy(); return 0; } - #line 6918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor3State(); static_cast(this)->destroy(); return 0; } + #line 6919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor3State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -6925,10 +6926,10 @@ class AddTaskActor3State { } int a_body1cont2(Void && _,int loopDepth) { - #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor3State(); static_cast(this)->destroy(); return 0; } - #line 6930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor3State(); static_cast(this)->destroy(); return 0; } + #line 6931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor3State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -6998,26 +6999,26 @@ class AddTaskActor3State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 1); } - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference parentTask; - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version beginVersion; - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version endVersion; - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference waitFor; - #line 7015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor3 final : public Actor, public ActorCallback< AddTaskActor3, 0, Key >, public ActorCallback< AddTaskActor3, 1, Void >, public FastAllocated, public AddTaskActor3State { - #line 7020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7027,9 +7028,9 @@ class AddTaskActor3 final : public Actor, public ActorCallback< AddTaskActo #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor3, 0, Key >; friend struct ActorCallback< AddTaskActor3, 1, Void >; - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor3(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,Version const& beginVersion,Version const& endVersion,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 7032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), AddTaskActor3State(tr, taskBucket, parentTask, beginVersion, endVersion, completionKey, waitFor) { @@ -7053,39 +7054,39 @@ friend struct ActorCallback< AddTaskActor3, 1, Void >; } }; - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, Version const& beginVersion, Version const& endVersion, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new AddTaskActor3(tr, taskBucket, parentTask, beginVersion, endVersion, completionKey, waitFor)); - #line 7060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 7065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor3State { - #line 7071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor3State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endVersion(BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyEndVersion], Unversioned())), - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskFuture(futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone])) - #line 7088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -7098,42 +7099,42 @@ class _finishActor3State { int a_body1(int loopDepth=0) { try { - #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DRConfig config(task); - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int64_t bytesWritten = Params.bytesWritten().getOrDefault(task); - #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" config.logBytesWritten().atomicOp(tr, bytesWritten, MutationRef::AddValue); - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (task->params.find(CopyLogRangeTaskFunc::keyNextBeginVersion) != task->params.end()) - #line 7109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextVersion = BinaryReader::fromStringRef( task->params[CopyLogRangeTaskFunc::keyNextBeginVersion], Unversioned()); - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = success(CopyLogRangeTaskFunc::addTask( tr, taskBucket, task, nextVersion, endVersion, TaskCompletionKey::signal(taskFuture->key))) && taskBucket->finish(tr, task); - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor3*>(this)->actor_wait_state = 1; - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor3*>(this))); - #line 7122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = taskFuture->set(tr, taskBucket) && taskBucket->finish(tr, task); - #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor3*>(this)->actor_wait_state = 2; - #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor3*>(this))); - #line 7136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } } @@ -7155,9 +7156,9 @@ class _finishActor3State { } int a_body1cont1(int loopDepth) { - #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor3*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor3State(); static_cast<_finishActor3*>(this)->destroy(); return 0; } - #line 7160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor3*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor3State(); static_cast<_finishActor3*>(this)->finishSendAndDelPromiseRef(); @@ -7315,26 +7316,26 @@ class _finishActor3State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); } - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version endVersion; - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskFuture; - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version nextVersion; - #line 7332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor3 final : public Actor, public ActorCallback< _finishActor3, 0, Void >, public ActorCallback< _finishActor3, 1, Void >, public FastAllocated<_finishActor3>, public _finishActor3State<_finishActor3> { - #line 7337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor3>::operator new; using FastAllocated<_finishActor3>::operator delete; @@ -7344,9 +7345,9 @@ class _finishActor3 final : public Actor, public ActorCallback< _finishAct #pragma clang diagnostic pop friend struct ActorCallback< _finishActor3, 0, Void >; friend struct ActorCallback< _finishActor3, 1, Void >; - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor3(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 7349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _finishActor3State<_finishActor3>(tr, taskBucket, futureBucket, task) { @@ -7370,47 +7371,47 @@ friend struct ActorCallback< _finishActor3, 1, Void >; } }; - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _finishActor3(tr, taskBucket, futureBucket, task)); - #line 7377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" }; -StringRef CopyLogRangeTaskFunc::name = LiteralStringRef("dr_copy_log_range"); -const Key CopyLogRangeTaskFunc::keyNextBeginVersion = LiteralStringRef("nextBeginVersion"); +StringRef CopyLogRangeTaskFunc::name = "dr_copy_log_range"_sr; +const Key CopyLogRangeTaskFunc::keyNextBeginVersion = "nextBeginVersion"_sr; REGISTER_TASKFUNC(CopyLogRangeTaskFunc); struct CopyLogsTaskFunc : TaskFuncBase { static StringRef name; static constexpr uint32_t version = 1; - #line 7390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor4State { - #line 7396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor4State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - conf(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(task->params[BackupAgentBase::keyConfigLogUid])), #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + conf(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(task->params[BackupAgentBase::keyConfigLogUid])), + #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" states(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyStates) .get(task->params[BackupAgentBase::keyConfigLogUid])) - #line 7413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -7423,16 +7424,16 @@ class _finishActor4State { int a_body1(int loopDepth=0) { try { - #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(tr, task, CopyLogsTaskFunc::name, CopyLogsTaskFunc::version); - #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 1; - #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 7435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7453,56 +7454,56 @@ class _finishActor4State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyBeginVersion], Unversioned()); - #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" prevBeginVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyPrevBeginVersion], Unversioned()); - #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" fStopValue = tr->get(states.pack(DatabaseBackupAgent::keyCopyStop)); - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - fAppliedValue = tr->get(task->params[BackupAgentBase::keyConfigLogUid].withPrefix(applyMutationsBeginRange.begin)); #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + fAppliedValue = tr->get(task->params[BackupAgentBase::keyConfigLogUid].withPrefix(applyMutationsBeginRange.begin)); + #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Transaction srcTr(taskBucket->src); - #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = srcTr.getReadVersion(); - #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 2; - #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 7477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyBeginVersion], Unversioned()); - #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" prevBeginVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyPrevBeginVersion], Unversioned()); - #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" fStopValue = tr->get(states.pack(DatabaseBackupAgent::keyCopyStop)); - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - fAppliedValue = tr->get(task->params[BackupAgentBase::keyConfigLogUid].withPrefix(applyMutationsBeginRange.begin)); #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + fAppliedValue = tr->get(task->params[BackupAgentBase::keyConfigLogUid].withPrefix(applyMutationsBeginRange.begin)); + #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Transaction srcTr(taskBucket->src); - #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = srcTr.getReadVersion(); - #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 2; - #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 7505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -7572,22 +7573,22 @@ class _finishActor4State { } int a_body1cont2(int loopDepth) { - #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" onDone = futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone]); - #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (endVersion <= beginVersion) - #line 7579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY); - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 3; - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 7590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -7599,9 +7600,9 @@ class _finishActor4State { } int a_body1cont1when1(Version const& __endVersion,int loopDepth) { - #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endVersion = __endVersion; - #line 7604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -7666,48 +7667,48 @@ class _finishActor4State { } int a_body1cont3(int loopDepth) { - #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_5 = fAppliedValue; - #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont3when1(__when_expr_5.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 6; - #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast >*>(static_cast<_finishActor4*>(this))); - #line 7678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4(Void const& _,int loopDepth) { - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = success(CopyLogsTaskFunc::addTask( tr, taskBucket, task, prevBeginVersion, beginVersion, TaskCompletionKey::signal(onDone))); - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 4; - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 7694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4(Void && _,int loopDepth) { - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = success(CopyLogsTaskFunc::addTask( tr, taskBucket, task, prevBeginVersion, beginVersion, TaskCompletionKey::signal(onDone))); - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 4; - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 7710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -7777,32 +7778,32 @@ class _finishActor4State { } int a_body1cont5(Void const& _,int loopDepth) { - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = taskBucket->finish(tr, task); - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 5; - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 7789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont5(Void && _,int loopDepth) { - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = taskBucket->finish(tr, task); - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 5; - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 7805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -7872,9 +7873,9 @@ class _finishActor4State { } int a_body1cont6(Void const& _,int loopDepth) { - #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor4*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor4State(); static_cast<_finishActor4*>(this)->destroy(); return 0; } - #line 7877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor4*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor4State(); static_cast<_finishActor4*>(this)->finishSendAndDelPromiseRef(); @@ -7884,9 +7885,9 @@ class _finishActor4State { } int a_body1cont6(Void && _,int loopDepth) { - #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor4*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor4State(); static_cast<_finishActor4*>(this)->destroy(); return 0; } - #line 7889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor4*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor4State(); static_cast<_finishActor4*>(this)->finishSendAndDelPromiseRef(); @@ -7959,60 +7960,60 @@ class _finishActor4State { } int a_body1cont8(Optional const& appliedValue,int loopDepth) { - #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - appliedVersion = appliedValue.present() ? BinaryReader::fromStringRef(appliedValue.get(), Unversioned()) : 100; #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + appliedVersion = appliedValue.present() ? BinaryReader::fromStringRef(appliedValue.get(), Unversioned()) : 100; + #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" applyVersion = std::max(appliedVersion, beginVersion - CLIENT_KNOBS->BACKUP_VERSION_DELAY); - #line 1040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace krv = conf.get(DatabaseBackupAgent::keyRangeVersions); - #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" KeyRange versionRange = KeyRangeRef(krv.pack(0), krv.pack(applyVersion + 1)); - #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->addReadConflictRange(versionRange); - #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->addWriteConflictRange(versionRange); - #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - tr->set(task->params[BackupAgentBase::keyConfigLogUid].withPrefix(applyMutationsEndRange.begin), BinaryWriter::toValue(applyVersion, Unversioned())); #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + tr->set(task->params[BackupAgentBase::keyConfigLogUid].withPrefix(applyMutationsEndRange.begin), BinaryWriter::toValue(applyVersion, Unversioned())); + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_6 = fStopValue; - #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont8when1(__when_expr_6.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 7; - #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast >*>(static_cast<_finishActor4*>(this))); - #line 7985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 7986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont8(Optional && appliedValue,int loopDepth) { - #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - appliedVersion = appliedValue.present() ? BinaryReader::fromStringRef(appliedValue.get(), Unversioned()) : 100; #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + appliedVersion = appliedValue.present() ? BinaryReader::fromStringRef(appliedValue.get(), Unversioned()) : 100; + #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" applyVersion = std::max(appliedVersion, beginVersion - CLIENT_KNOBS->BACKUP_VERSION_DELAY); - #line 1040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace krv = conf.get(DatabaseBackupAgent::keyRangeVersions); - #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" KeyRange versionRange = KeyRangeRef(krv.pack(0), krv.pack(applyVersion + 1)); - #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->addReadConflictRange(versionRange); - #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->addWriteConflictRange(versionRange); - #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - tr->set(task->params[BackupAgentBase::keyConfigLogUid].withPrefix(applyMutationsEndRange.begin), BinaryWriter::toValue(applyVersion, Unversioned())); #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + tr->set(task->params[BackupAgentBase::keyConfigLogUid].withPrefix(applyMutationsEndRange.begin), BinaryWriter::toValue(applyVersion, Unversioned())); + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_6 = fStopValue; - #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont8when1(__when_expr_6.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 7; - #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast >*>(static_cast<_finishActor4*>(this))); - #line 8015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -8082,70 +8083,70 @@ class _finishActor4State { } int a_body1cont9(Optional const& stopValue,int loopDepth) { - #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - stopVersionData = stopValue.present() ? BinaryReader::fromStringRef(stopValue.get(), Unversioned()) : -1; #line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + stopVersionData = stopValue.present() ? BinaryReader::fromStringRef(stopValue.get(), Unversioned()) : -1; + #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (endVersion - beginVersion > deterministicRandom()->randomInt64(0, CLIENT_KNOBS->BACKUP_VERSION_DELAY)) - #line 8089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_CopyLogs") .detail("BeginVersion", beginVersion) .detail("ApplyVersion", applyVersion) .detail("EndVersion", endVersion) .detail("StopVersionData", stopVersionData) .detail("LogUID", task->params[BackupAgentBase::keyConfigLogUid]); - #line 8093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if ((stopVersionData == -1) || (stopVersionData >= applyVersion)) - #line 8097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" allPartsDone = futureBucket->future(tr); - #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector> addTaskVector; - #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addTaskVector.push_back(CopyLogsTaskFunc::addTask( tr, taskBucket, task, beginVersion, endVersion, TaskCompletionKey::signal(onDone), allPartsDone)); - #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int blockSize = std::max( 1, ((endVersion - beginVersion) / CLIENT_KNOBS->BACKUP_COPY_TASKS) / CLIENT_KNOBS->BACKUP_BLOCK_SIZE); - #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - for(int64_t vblock = beginVersion / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock < (endVersion + CLIENT_KNOBS->BACKUP_BLOCK_SIZE - 1) / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock += blockSize) { #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + for(int64_t vblock = beginVersion / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock < (endVersion + CLIENT_KNOBS->BACKUP_BLOCK_SIZE - 1) / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock += blockSize) { + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addTaskVector.push_back(CopyLogRangeTaskFunc::addTask( tr, taskBucket, task, std::max(beginVersion, vblock * CLIENT_KNOBS->BACKUP_BLOCK_SIZE), std::min(endVersion, (vblock + blockSize) * CLIENT_KNOBS->BACKUP_BLOCK_SIZE), TaskCompletionKey::joinWith(allPartsDone))); - #line 8111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (prevBeginVersion > 0) - #line 8115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addTaskVector.push_back(EraseLogRangeTaskFunc::addTask( tr, taskBucket, task, beginVersion, TaskCompletionKey::joinWith(allPartsDone))); - #line 8119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_7 = waitForAll(addTaskVector) && taskBucket->finish(tr, task); - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont9when1(__when_expr_7.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 8; - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 8130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (appliedVersion < applyVersion) - #line 8137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_8 = delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY); - #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont9when2(__when_expr_8.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 9; - #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 8148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -8158,70 +8159,70 @@ class _finishActor4State { } int a_body1cont9(Optional && stopValue,int loopDepth) { - #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - stopVersionData = stopValue.present() ? BinaryReader::fromStringRef(stopValue.get(), Unversioned()) : -1; #line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + stopVersionData = stopValue.present() ? BinaryReader::fromStringRef(stopValue.get(), Unversioned()) : -1; + #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (endVersion - beginVersion > deterministicRandom()->randomInt64(0, CLIENT_KNOBS->BACKUP_VERSION_DELAY)) - #line 8165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_CopyLogs") .detail("BeginVersion", beginVersion) .detail("ApplyVersion", applyVersion) .detail("EndVersion", endVersion) .detail("StopVersionData", stopVersionData) .detail("LogUID", task->params[BackupAgentBase::keyConfigLogUid]); - #line 8169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if ((stopVersionData == -1) || (stopVersionData >= applyVersion)) - #line 8173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" allPartsDone = futureBucket->future(tr); - #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector> addTaskVector; - #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addTaskVector.push_back(CopyLogsTaskFunc::addTask( tr, taskBucket, task, beginVersion, endVersion, TaskCompletionKey::signal(onDone), allPartsDone)); - #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int blockSize = std::max( 1, ((endVersion - beginVersion) / CLIENT_KNOBS->BACKUP_COPY_TASKS) / CLIENT_KNOBS->BACKUP_BLOCK_SIZE); - #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - for(int64_t vblock = beginVersion / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock < (endVersion + CLIENT_KNOBS->BACKUP_BLOCK_SIZE - 1) / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock += blockSize) { #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + for(int64_t vblock = beginVersion / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock < (endVersion + CLIENT_KNOBS->BACKUP_BLOCK_SIZE - 1) / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock += blockSize) { + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addTaskVector.push_back(CopyLogRangeTaskFunc::addTask( tr, taskBucket, task, std::max(beginVersion, vblock * CLIENT_KNOBS->BACKUP_BLOCK_SIZE), std::min(endVersion, (vblock + blockSize) * CLIENT_KNOBS->BACKUP_BLOCK_SIZE), TaskCompletionKey::joinWith(allPartsDone))); - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (prevBeginVersion > 0) - #line 8191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addTaskVector.push_back(EraseLogRangeTaskFunc::addTask( tr, taskBucket, task, beginVersion, TaskCompletionKey::joinWith(allPartsDone))); - #line 8195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_7 = waitForAll(addTaskVector) && taskBucket->finish(tr, task); - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont9when1(__when_expr_7.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 8; - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 8206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (appliedVersion < applyVersion) - #line 8213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_8 = delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY); - #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont9when2(__when_expr_8.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 9; - #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 8224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -8297,9 +8298,9 @@ class _finishActor4State { } int a_body1cont10(int loopDepth) { - #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor4*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor4State(); static_cast<_finishActor4*>(this)->destroy(); return 0; } - #line 8302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor4*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor4State(); static_cast<_finishActor4*>(this)->finishSendAndDelPromiseRef(); @@ -8384,48 +8385,48 @@ class _finishActor4State { } int a_body1cont15(int loopDepth) { - #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_11 = onDone->set(tr, taskBucket) && taskBucket->finish(tr, task); - #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1Catch1(__when_expr_11.getError(), loopDepth); else return a_body1cont15when1(__when_expr_11.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 12; - #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_11.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 8396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont16(Void const& _,int loopDepth) { - #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_9 = success(CopyLogsTaskFunc::addTask( tr, taskBucket, task, prevBeginVersion, beginVersion, TaskCompletionKey::signal(onDone))); - #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1cont16when1(__when_expr_9.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 10; - #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 8412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont16(Void && _,int loopDepth) { - #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_9 = success(CopyLogsTaskFunc::addTask( tr, taskBucket, task, prevBeginVersion, beginVersion, TaskCompletionKey::signal(onDone))); - #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1cont16when1(__when_expr_9.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 10; - #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 8428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -8495,32 +8496,32 @@ class _finishActor4State { } int a_body1cont16cont1(Void const& _,int loopDepth) { - #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_10 = taskBucket->finish(tr, task); - #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont16cont1when1(__when_expr_10.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 11; - #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 8507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont16cont1(Void && _,int loopDepth) { - #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_10 = taskBucket->finish(tr, task); - #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont16cont1when1(__when_expr_10.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 11; - #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 8523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -8590,9 +8591,9 @@ class _finishActor4State { } int a_body1cont16cont2(Void const& _,int loopDepth) { - #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor4*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor4State(); static_cast<_finishActor4*>(this)->destroy(); return 0; } - #line 8595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor4*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor4State(); static_cast<_finishActor4*>(this)->finishSendAndDelPromiseRef(); @@ -8602,9 +8603,9 @@ class _finishActor4State { } int a_body1cont16cont2(Void && _,int loopDepth) { - #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor4*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor4State(); static_cast<_finishActor4*>(this)->destroy(); return 0; } - #line 8607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor4*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor4State(); static_cast<_finishActor4*>(this)->finishSendAndDelPromiseRef(); @@ -8677,18 +8678,18 @@ class _finishActor4State { } int a_body1cont15cont1(Void const& _,int loopDepth) { - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(states.pack(DatabaseBackupAgent::keyStateStop), BinaryWriter::toValue(beginVersion, Unversioned())); - #line 8682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont10(loopDepth); return loopDepth; } int a_body1cont15cont1(Void && _,int loopDepth) { - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(states.pack(DatabaseBackupAgent::keyStateStop), BinaryWriter::toValue(beginVersion, Unversioned())); - #line 8691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont10(loopDepth); return loopDepth; @@ -8756,44 +8757,44 @@ class _finishActor4State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 11); } - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - Subspace conf; #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + Subspace conf; + #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace states; - #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version beginVersion; - #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version prevBeginVersion; - #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future> fStopValue; - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future> fAppliedValue; - #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version endVersion; - #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference onDone; - #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - Version appliedVersion; #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + Version appliedVersion; + #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version applyVersion; - #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version stopVersionData; - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference allPartsDone; - #line 8791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor4 final : public Actor, public ActorCallback< _finishActor4, 0, Void >, public ActorCallback< _finishActor4, 1, Version >, public ActorCallback< _finishActor4, 2, Void >, public ActorCallback< _finishActor4, 3, Void >, public ActorCallback< _finishActor4, 4, Void >, public ActorCallback< _finishActor4, 5, Optional >, public ActorCallback< _finishActor4, 6, Optional >, public ActorCallback< _finishActor4, 7, Void >, public ActorCallback< _finishActor4, 8, Void >, public ActorCallback< _finishActor4, 9, Void >, public ActorCallback< _finishActor4, 10, Void >, public ActorCallback< _finishActor4, 11, Void >, public FastAllocated<_finishActor4>, public _finishActor4State<_finishActor4> { - #line 8796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor4>::operator new; using FastAllocated<_finishActor4>::operator delete; @@ -8813,9 +8814,9 @@ friend struct ActorCallback< _finishActor4, 8, Void >; friend struct ActorCallback< _finishActor4, 9, Void >; friend struct ActorCallback< _finishActor4, 10, Void >; friend struct ActorCallback< _finishActor4, 11, Void >; - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor4(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 8818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _finishActor4State<_finishActor4>(tr, taskBucket, futureBucket, task) { @@ -8849,41 +8850,41 @@ friend struct ActorCallback< _finishActor4, 11, Void >; } }; - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _finishActor4(tr, taskBucket, futureBucket, task)); - #line 8856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 8861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor4State { - #line 8867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor4State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,Version const& prevBeginVersion,Version const& beginVersion,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" parentTask(parentTask), - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" prevBeginVersion(prevBeginVersion), - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion(beginVersion), - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" completionKey(completionKey), - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" waitFor(waitFor) - #line 8886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -8896,16 +8897,16 @@ class AddTaskActor4State { int a_body1(int loopDepth=0) { try { - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8926,72 +8927,72 @@ class AddTaskActor4State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(CopyLogsTaskFunc::name, CopyLogsTaskFunc::version, doneKey, 1); - #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::keyBeginVersion] = BinaryWriter::toValue(beginVersion, Unversioned()); - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyPrevBeginVersion] = BinaryWriter::toValue(prevBeginVersion, Unversioned()); - #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 8939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor4State(); static_cast(this)->destroy(); return 0; } - #line 8943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor4State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(CopyLogsTaskFunc::name, CopyLogsTaskFunc::version, doneKey, 1); - #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::keyBeginVersion] = BinaryWriter::toValue(beginVersion, Unversioned()); - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyPrevBeginVersion] = BinaryWriter::toValue(prevBeginVersion, Unversioned()); - #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 8975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor4State(); static_cast(this)->destroy(); return 0; } - #line 8979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor4State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 8995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9061,10 +9062,10 @@ class AddTaskActor4State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor4State(); static_cast(this)->destroy(); return 0; } - #line 9066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor4State(); static_cast(this)->destroy(); return 0; } + #line 9067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor4State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -9073,10 +9074,10 @@ class AddTaskActor4State { } int a_body1cont2(Void && _,int loopDepth) { - #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor4State(); static_cast(this)->destroy(); return 0; } - #line 9078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor4State(); static_cast(this)->destroy(); return 0; } + #line 9079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor4State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -9146,26 +9147,26 @@ class AddTaskActor4State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 1); } - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference parentTask; - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version prevBeginVersion; - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version beginVersion; - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference waitFor; - #line 9163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor4 final : public Actor, public ActorCallback< AddTaskActor4, 0, Key >, public ActorCallback< AddTaskActor4, 1, Void >, public FastAllocated, public AddTaskActor4State { - #line 9168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9175,9 +9176,9 @@ class AddTaskActor4 final : public Actor, public ActorCallback< AddTaskActo #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor4, 0, Key >; friend struct ActorCallback< AddTaskActor4, 1, Void >; - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor4(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,Version const& prevBeginVersion,Version const& beginVersion,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 9180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), AddTaskActor4State(tr, taskBucket, parentTask, prevBeginVersion, beginVersion, completionKey, waitFor) { @@ -9201,14 +9202,14 @@ friend struct ActorCallback< AddTaskActor4, 1, Void >; } }; - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, Version const& prevBeginVersion, Version const& beginVersion, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new AddTaskActor4(tr, taskBucket, parentTask, prevBeginVersion, beginVersion, completionKey, waitFor)); - #line 9208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StringRef getName() const override { return name; }; @@ -9225,7 +9226,7 @@ friend struct ActorCallback< AddTaskActor4, 1, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef CopyLogsTaskFunc::name = LiteralStringRef("dr_copy_logs"); +StringRef CopyLogsTaskFunc::name = "dr_copy_logs"_sr; REGISTER_TASKFUNC(CopyLogsTaskFunc); struct FinishedFullBackupTaskFunc : TaskFuncBase { @@ -9235,28 +9236,28 @@ struct FinishedFullBackupTaskFunc : TaskFuncBase { StringRef getName() const override { return name; }; - #line 9238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor3State { - #line 9244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor3State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : cx(cx), - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" sourceStates(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keySourceStates) .get(task->params[BackupAgentBase::keyConfigLogUid])) - #line 9259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -9269,16 +9270,16 @@ class _executeActor3State { int a_body1(int loopDepth=0) { try { - #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(cx, task, FinishedFullBackupTaskFunc::name, FinishedFullBackupTaskFunc::version); - #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor3*>(this)->actor_wait_state = 1; - #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); - #line 9281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9299,22 +9300,22 @@ class _executeActor3State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr2 = Transaction(cx); - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 9306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr2 = Transaction(cx); - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 9317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -9384,17 +9385,17 @@ class _executeActor3State { } int a_body1cont2(int loopDepth) { - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(taskBucket->src)); - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUidValue = task->params[DatabaseBackupAgent::keyConfigLogUid]; - #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUidValue = task->params[BackupAgentBase::destUid]; - #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - backupUid = BinaryReader::fromStringRef(task->params[BackupAgentBase::keyFolderId], Unversioned()); #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + backupUid = BinaryReader::fromStringRef(task->params[BackupAgentBase::keyFolderId], Unversioned()); + #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 9397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopHead1(loopDepth); return loopDepth; @@ -9409,18 +9410,18 @@ class _executeActor3State { int a_body1cont1loopBody1(int loopDepth) { try { - #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr2.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_1 = tr2.get(task->params[BackupAgentBase::keyConfigLogUid].withPrefix(applyMutationsBeginRange.begin)); - #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 9418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor3*>(this)->actor_wait_state = 2; - #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast<_executeActor3*>(this))); - #line 9423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9453,16 +9454,16 @@ class _executeActor3State { int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = tr2.onError(e); - #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 9460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast<_executeActor3*>(this)->actor_wait_state = 5; - #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); - #line 9465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9475,36 +9476,36 @@ class _executeActor3State { } int a_body1cont1loopBody1cont2(Optional const& beginValue,int loopDepth) { - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" appliedVersion = beginValue.present() ? BinaryReader::fromStringRef(beginValue.get(), Unversioned()) : -1; - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_2 = tr2.get(task->params[BackupAgentBase::keyConfigLogUid].withPrefix(applyMutationsEndRange.begin)); - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor3*>(this)->actor_wait_state = 3; - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast<_executeActor3*>(this))); - #line 9489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont2(Optional && beginValue,int loopDepth) { - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" appliedVersion = beginValue.present() ? BinaryReader::fromStringRef(beginValue.get(), Unversioned()) : -1; - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_2 = tr2.get(task->params[BackupAgentBase::keyConfigLogUid].withPrefix(applyMutationsEndRange.begin)); - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 9502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor3*>(this)->actor_wait_state = 3; - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast<_executeActor3*>(this))); - #line 9507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9574,22 +9575,22 @@ class _executeActor3State { } int a_body1cont1loopBody1cont3(Optional const& endValue,int loopDepth) { - #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version endVersion = endValue.present() ? BinaryReader::fromStringRef(endValue.get(), Unversioned()) : -1; - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (appliedVersion < endVersion) - #line 9581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY); - #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 9587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor3*>(this)->actor_wait_state = 4; - #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); - #line 9592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -9601,22 +9602,22 @@ class _executeActor3State { } int a_body1cont1loopBody1cont3(Optional && endValue,int loopDepth) { - #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version endVersion = endValue.present() ? BinaryReader::fromStringRef(endValue.get(), Unversioned()) : -1; - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (appliedVersion < endVersion) - #line 9608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY); - #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 9614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor3*>(this)->actor_wait_state = 4; - #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); - #line 9619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -9697,11 +9698,11 @@ class _executeActor3State { } int a_body1cont1loopBody1cont5(Void const& _,int loopDepth) { - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[FinishedFullBackupTaskFunc::keyInsertTask] = StringRef(); - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor3*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->destroy(); return 0; } - #line 9704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor3*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->finishSendAndDelPromiseRef(); @@ -9711,11 +9712,11 @@ class _executeActor3State { } int a_body1cont1loopBody1cont5(Void && _,int loopDepth) { - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[FinishedFullBackupTaskFunc::keyInsertTask] = StringRef(); - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor3*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->destroy(); return 0; } - #line 9718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor3*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->finishSendAndDelPromiseRef(); @@ -9871,20 +9872,20 @@ class _executeActor3State { int a_body1cont2loopBody1(int loopDepth) { try { - #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_5 = tr->get(sourceStates.pack(DatabaseBackupAgent::keyFolderId)); - #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 9882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont2loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2loopBody1when1(__when_expr_5.get(), loopDepth); }; static_cast<_executeActor3*>(this)->actor_wait_state = 6; - #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast >*>(static_cast<_executeActor3*>(this))); - #line 9887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9904,16 +9905,16 @@ class _executeActor3State { int a_body1cont2loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_8 = tr->onError(e); - #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 9911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1Catch1when1(__when_expr_8.get(), loopDepth); }; static_cast<_executeActor3*>(this)->actor_wait_state = 9; - #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); - #line 9916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9926,56 +9927,56 @@ class _executeActor3State { } int a_body1cont2loopBody1cont2(Optional const& v,int loopDepth) { - #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (v.present() && BinaryReader::fromStringRef(v.get(), Unversioned()) > BinaryReader::fromStringRef( task->params[DatabaseBackupAgent::keyFolderId], Unversioned())) - #line 9931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor3*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->destroy(); return 0; } - #line 9935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor3*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = eraseLogData(tr, logUidValue, destUidValue, Optional(), CheckBackupUID::True, backupUid); - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 9945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont2loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_6.get(), loopDepth); }; static_cast<_executeActor3*>(this)->actor_wait_state = 7; - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); - #line 9950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2loopBody1cont2(Optional && v,int loopDepth) { - #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (v.present() && BinaryReader::fromStringRef(v.get(), Unversioned()) > BinaryReader::fromStringRef( task->params[DatabaseBackupAgent::keyFolderId], Unversioned())) - #line 9959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor3*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->destroy(); return 0; } - #line 9963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor3*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = eraseLogData(tr, logUidValue, destUidValue, Optional(), CheckBackupUID::True, backupUid); - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 9973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont2loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_6.get(), loopDepth); }; static_cast<_executeActor3*>(this)->actor_wait_state = 7; - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); - #line 9978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 9979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -10045,32 +10046,32 @@ class _executeActor3State { } int a_body1cont2loopBody1cont3(Void const& _,int loopDepth) { - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_7 = tr->commit(); - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 10052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont2loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont2loopBody1cont3when1(__when_expr_7.get(), loopDepth); }; static_cast<_executeActor3*>(this)->actor_wait_state = 8; - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); - #line 10057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2loopBody1cont3(Void && _,int loopDepth) { - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_7 = tr->commit(); - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 10068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont2loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont2loopBody1cont3when1(__when_expr_7.get(), loopDepth); }; static_cast<_executeActor3*>(this)->actor_wait_state = 8; - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); - #line 10073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -10140,9 +10141,9 @@ class _executeActor3State { } int a_body1cont2loopBody1cont5(Void const& _,int loopDepth) { - #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor3*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->destroy(); return 0; } - #line 10145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor3*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->finishSendAndDelPromiseRef(); @@ -10152,9 +10153,9 @@ class _executeActor3State { } int a_body1cont2loopBody1cont5(Void && _,int loopDepth) { - #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor3*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->destroy(); return 0; } - #line 10157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor3*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->finishSendAndDelPromiseRef(); @@ -10300,34 +10301,34 @@ class _executeActor3State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 8); } - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace sourceStates; - #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Transaction tr2; - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version appliedVersion; - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key logUidValue; - #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key destUidValue; - #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version backupUid; - #line 10325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor3 final : public Actor, public ActorCallback< _executeActor3, 0, Void >, public ActorCallback< _executeActor3, 1, Optional >, public ActorCallback< _executeActor3, 2, Optional >, public ActorCallback< _executeActor3, 3, Void >, public ActorCallback< _executeActor3, 4, Void >, public ActorCallback< _executeActor3, 5, Optional >, public ActorCallback< _executeActor3, 6, Void >, public ActorCallback< _executeActor3, 7, Void >, public ActorCallback< _executeActor3, 8, Void >, public FastAllocated<_executeActor3>, public _executeActor3State<_executeActor3> { - #line 10330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor3>::operator new; using FastAllocated<_executeActor3>::operator delete; @@ -10344,9 +10345,9 @@ friend struct ActorCallback< _executeActor3, 5, Optional >; friend struct ActorCallback< _executeActor3, 6, Void >; friend struct ActorCallback< _executeActor3, 7, Void >; friend struct ActorCallback< _executeActor3, 8, Void >; - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor3(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 10349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _executeActor3State<_executeActor3>(cx, taskBucket, futureBucket, task) { @@ -10377,37 +10378,37 @@ friend struct ActorCallback< _executeActor3, 8, Void >; } }; - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _executeActor3(cx, taskBucket, futureBucket, task)); - #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 10389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor5State { - #line 10395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor5State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" parentTask(parentTask), - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" completionKey(completionKey), - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" waitFor(waitFor) - #line 10410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -10420,16 +10421,16 @@ class AddTaskActor5State { int a_body1(int loopDepth=0) { try { - #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -10450,64 +10451,64 @@ class AddTaskActor5State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(FinishedFullBackupTaskFunc::name, FinishedFullBackupTaskFunc::version, doneKey); - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 10459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor5State(); static_cast(this)->destroy(); return 0; } - #line 10463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor5State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(FinishedFullBackupTaskFunc::name, FinishedFullBackupTaskFunc::version, doneKey); - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 10491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor5State(); static_cast(this)->destroy(); return 0; } - #line 10495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor5State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -10577,10 +10578,10 @@ class AddTaskActor5State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor5State(); static_cast(this)->destroy(); return 0; } - #line 10582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor5State(); static_cast(this)->destroy(); return 0; } + #line 10583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor5State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -10589,10 +10590,10 @@ class AddTaskActor5State { } int a_body1cont2(Void && _,int loopDepth) { - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor5State(); static_cast(this)->destroy(); return 0; } - #line 10594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor5State(); static_cast(this)->destroy(); return 0; } + #line 10595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor5State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -10662,22 +10663,22 @@ class AddTaskActor5State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 1); } - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference parentTask; - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference waitFor; - #line 10675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor5 final : public Actor, public ActorCallback< AddTaskActor5, 0, Key >, public ActorCallback< AddTaskActor5, 1, Void >, public FastAllocated, public AddTaskActor5State { - #line 10680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -10687,9 +10688,9 @@ class AddTaskActor5 final : public Actor, public ActorCallback< AddTaskActo #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor5, 0, Key >; friend struct ActorCallback< AddTaskActor5, 1, Void >; - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor5(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 10692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), AddTaskActor5State(tr, taskBucket, parentTask, completionKey, waitFor) { @@ -10713,39 +10714,39 @@ friend struct ActorCallback< AddTaskActor5, 1, Void >; } }; - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new AddTaskActor5(tr, taskBucket, parentTask, completionKey, waitFor)); - #line 10720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 10725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor5State { - #line 10731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor5State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - conf(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(task->params[BackupAgentBase::keyConfigLogUid])), #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + conf(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(task->params[BackupAgentBase::keyConfigLogUid])), + #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" states(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyStates) .get(task->params[BackupAgentBase::keyConfigLogUid])) - #line 10748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -10758,22 +10759,22 @@ class _finishActor5State { int a_body1(int loopDepth=0) { try { - #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (task->params.find(FinishedFullBackupTaskFunc::keyInsertTask) != task->params.end()) - #line 10763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" onDone = futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone]); - #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = success(FinishedFullBackupTaskFunc::addTask(tr, taskBucket, task, TaskCompletionKey::signal(onDone))); - #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor5*>(this)->actor_wait_state = 1; - #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor5*>(this))); - #line 10776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -10799,60 +10800,60 @@ class _finishActor5State { } int a_body1cont1(int loopDepth) { - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); - #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID logUid = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyConfigLogUid], Unversioned()); - #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key logsPath = uidPrefixKey(applyLogKeys.begin, logUid); - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(KeyRangeRef(logsPath, strinc(logsPath))); - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(conf.range()); - #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - tr->set(states.pack(DatabaseBackupAgent::keyStateStatus), StringRef(BackupAgentBase::getStateText(EBackupState::STATE_COMPLETED))); #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + tr->set(states.pack(DatabaseBackupAgent::keyStateStatus), StringRef(BackupAgentBase::getStateText(EBackupState::STATE_COMPLETED))); + #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = taskBucket->finish(tr, task); - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor5*>(this)->actor_wait_state = 3; - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor5*>(this))); - #line 10823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void const& _,int loopDepth) { - #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = taskBucket->finish(tr, task); - #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor5*>(this)->actor_wait_state = 2; - #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor5*>(this))); - #line 10839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = taskBucket->finish(tr, task); - #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor5*>(this)->actor_wait_state = 2; - #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor5*>(this))); - #line 10855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -10922,9 +10923,9 @@ class _finishActor5State { } int a_body1cont3(Void const& _,int loopDepth) { - #line 1256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor5*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor5State(); static_cast<_finishActor5*>(this)->destroy(); return 0; } - #line 10927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor5*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor5State(); static_cast<_finishActor5*>(this)->finishSendAndDelPromiseRef(); @@ -10934,9 +10935,9 @@ class _finishActor5State { } int a_body1cont3(Void && _,int loopDepth) { - #line 1256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor5*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor5State(); static_cast<_finishActor5*>(this)->destroy(); return 0; } - #line 10939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 10940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor5*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor5State(); static_cast<_finishActor5*>(this)->finishSendAndDelPromiseRef(); @@ -11009,9 +11010,9 @@ class _finishActor5State { } int a_body1cont5(Void const& _,int loopDepth) { - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor5*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor5State(); static_cast<_finishActor5*>(this)->destroy(); return 0; } - #line 11014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor5*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor5State(); static_cast<_finishActor5*>(this)->finishSendAndDelPromiseRef(); @@ -11021,9 +11022,9 @@ class _finishActor5State { } int a_body1cont5(Void && _,int loopDepth) { - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor5*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor5State(); static_cast<_finishActor5*>(this)->destroy(); return 0; } - #line 11026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor5*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor5State(); static_cast<_finishActor5*>(this)->finishSendAndDelPromiseRef(); @@ -11094,26 +11095,26 @@ class _finishActor5State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); } - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - Subspace conf; #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + Subspace conf; + #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace states; - #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference onDone; - #line 11111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor5 final : public Actor, public ActorCallback< _finishActor5, 0, Void >, public ActorCallback< _finishActor5, 1, Void >, public ActorCallback< _finishActor5, 2, Void >, public FastAllocated<_finishActor5>, public _finishActor5State<_finishActor5> { - #line 11116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor5>::operator new; using FastAllocated<_finishActor5>::operator delete; @@ -11124,9 +11125,9 @@ class _finishActor5 final : public Actor, public ActorCallback< _finishAct friend struct ActorCallback< _finishActor5, 0, Void >; friend struct ActorCallback< _finishActor5, 1, Void >; friend struct ActorCallback< _finishActor5, 2, Void >; - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor5(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 11129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _finishActor5State<_finishActor5>(tr, taskBucket, futureBucket, task) { @@ -11151,14 +11152,14 @@ friend struct ActorCallback< _finishActor5, 2, Void >; } }; - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _finishActor5(tr, taskBucket, futureBucket, task)); - #line 11158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future execute(Database cx, Reference tb, @@ -11173,38 +11174,38 @@ friend struct ActorCallback< _finishActor5, 2, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef FinishedFullBackupTaskFunc::name = LiteralStringRef("dr_finished_full_backup"); -const Key FinishedFullBackupTaskFunc::keyInsertTask = LiteralStringRef("insertTask"); +StringRef FinishedFullBackupTaskFunc::name = "dr_finished_full_backup"_sr; +const Key FinishedFullBackupTaskFunc::keyInsertTask = "insertTask"_sr; REGISTER_TASKFUNC(FinishedFullBackupTaskFunc); struct CopyDiffLogsTaskFunc : TaskFuncBase { static StringRef name; static constexpr uint32_t version = 1; - #line 11184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor6State { - #line 11190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor6State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - conf(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(task->params[BackupAgentBase::keyConfigLogUid])), #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + conf(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(task->params[BackupAgentBase::keyConfigLogUid])), + #line 1304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" states(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyStates) .get(task->params[BackupAgentBase::keyConfigLogUid])) - #line 11207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -11217,16 +11218,16 @@ class _finishActor6State { int a_body1(int loopDepth=0) { try { - #line 1304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(tr, task, CopyDiffLogsTaskFunc::name, CopyDiffLogsTaskFunc::version); - #line 1304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 1; - #line 1304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 11229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11247,52 +11248,52 @@ class _finishActor6State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyBeginVersion], Unversioned()); - #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" prevBeginVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyPrevBeginVersion], Unversioned()); - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" fStopWhenDone = tr->get(conf.pack(DatabaseBackupAgent::keyConfigStopWhenDoneKey)); - #line 1312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Transaction srcTr(taskBucket->src); - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = srcTr.getReadVersion(); - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 2; - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 11269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyBeginVersion], Unversioned()); - #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" prevBeginVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyPrevBeginVersion], Unversioned()); - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" fStopWhenDone = tr->get(conf.pack(DatabaseBackupAgent::keyConfigStopWhenDoneKey)); - #line 1312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Transaction srcTr(taskBucket->src); - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = srcTr.getReadVersion(); - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 2; - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 11295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -11362,22 +11363,22 @@ class _finishActor6State { } int a_body1cont2(int loopDepth) { - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" onDone = futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone]); - #line 1318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (endVersion <= beginVersion) - #line 11369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY); - #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 3; - #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 11380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -11389,9 +11390,9 @@ class _finishActor6State { } int a_body1cont1when1(Version const& __endVersion,int loopDepth) { - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endVersion = __endVersion; - #line 11394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -11456,50 +11457,50 @@ class _finishActor6State { } int a_body1cont3(int loopDepth) { - #line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(task->params[BackupAgentBase::keyConfigLogUid].withPrefix(applyMutationsEndRange.begin), BinaryWriter::toValue(beginVersion, Unversioned())); - #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_5 = fStopWhenDone; - #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont3when1(__when_expr_5.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 6; - #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast >*>(static_cast<_finishActor6*>(this))); - #line 11470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4(Void const& _,int loopDepth) { - #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = success(CopyDiffLogsTaskFunc::addTask( tr, taskBucket, task, prevBeginVersion, beginVersion, TaskCompletionKey::signal(onDone))); - #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 4; - #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 11486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4(Void && _,int loopDepth) { - #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = success(CopyDiffLogsTaskFunc::addTask( tr, taskBucket, task, prevBeginVersion, beginVersion, TaskCompletionKey::signal(onDone))); - #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 4; - #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 11502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -11569,32 +11570,32 @@ class _finishActor6State { } int a_body1cont5(Void const& _,int loopDepth) { - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = taskBucket->finish(tr, task); - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 5; - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 11581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont5(Void && _,int loopDepth) { - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = taskBucket->finish(tr, task); - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 5; - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 11597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -11664,9 +11665,9 @@ class _finishActor6State { } int a_body1cont6(Void const& _,int loopDepth) { - #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor6*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor6State(); static_cast<_finishActor6*>(this)->destroy(); return 0; } - #line 11669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor6*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor6State(); static_cast<_finishActor6*>(this)->finishSendAndDelPromiseRef(); @@ -11676,9 +11677,9 @@ class _finishActor6State { } int a_body1cont6(Void && _,int loopDepth) { - #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor6*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor6State(); static_cast<_finishActor6*>(this)->destroy(); return 0; } - #line 11681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor6*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor6State(); static_cast<_finishActor6*>(this)->finishSendAndDelPromiseRef(); @@ -11751,66 +11752,66 @@ class _finishActor6State { } int a_body1cont8(Optional const& stopWhenDone,int loopDepth) { - #line 1330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (endVersion - beginVersion > deterministicRandom()->randomInt64(0, CLIENT_KNOBS->BACKUP_VERSION_DELAY)) - #line 11756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_CopyDiffLogs") .detail("BeginVersion", beginVersion) .detail("EndVersion", endVersion) .detail("LogUID", task->params[BackupAgentBase::keyConfigLogUid]); - #line 11760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - tr->set(StringRef(states.pack(DatabaseBackupAgent::keyStateLogBeginVersion)), BinaryWriter::toValue(beginVersion, Unversioned())); #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + tr->set(StringRef(states.pack(DatabaseBackupAgent::keyStateLogBeginVersion)), BinaryWriter::toValue(beginVersion, Unversioned())); + #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!stopWhenDone.present()) - #line 11766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" allPartsDone = futureBucket->future(tr); - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector> addTaskVector; - #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addTaskVector.push_back(CopyDiffLogsTaskFunc::addTask( tr, taskBucket, task, beginVersion, endVersion, TaskCompletionKey::signal(onDone), allPartsDone)); - #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int blockSize = std::max( 1, ((endVersion - beginVersion) / CLIENT_KNOBS->BACKUP_COPY_TASKS) / CLIENT_KNOBS->BACKUP_BLOCK_SIZE); - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - for(int64_t vblock = beginVersion / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock < (endVersion + CLIENT_KNOBS->BACKUP_BLOCK_SIZE - 1) / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock += blockSize) { #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + for(int64_t vblock = beginVersion / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock < (endVersion + CLIENT_KNOBS->BACKUP_BLOCK_SIZE - 1) / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock += blockSize) { + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addTaskVector.push_back(CopyLogRangeTaskFunc::addTask( tr, taskBucket, task, std::max(beginVersion, vblock * CLIENT_KNOBS->BACKUP_BLOCK_SIZE), std::min(endVersion, (vblock + blockSize) * CLIENT_KNOBS->BACKUP_BLOCK_SIZE), TaskCompletionKey::joinWith(allPartsDone))); - #line 11780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (prevBeginVersion > 0) - #line 11784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addTaskVector.push_back(EraseLogRangeTaskFunc::addTask( tr, taskBucket, task, beginVersion, TaskCompletionKey::joinWith(allPartsDone))); - #line 11788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = waitForAll(addTaskVector) && taskBucket->finish(tr, task); - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont8when1(__when_expr_6.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 7; - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 11799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_7 = onDone->set(tr, taskBucket) && taskBucket->finish(tr, task); - #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont8when2(__when_expr_7.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 8; - #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 11813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -11818,66 +11819,66 @@ class _finishActor6State { } int a_body1cont8(Optional && stopWhenDone,int loopDepth) { - #line 1330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (endVersion - beginVersion > deterministicRandom()->randomInt64(0, CLIENT_KNOBS->BACKUP_VERSION_DELAY)) - #line 11823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_CopyDiffLogs") .detail("BeginVersion", beginVersion) .detail("EndVersion", endVersion) .detail("LogUID", task->params[BackupAgentBase::keyConfigLogUid]); - #line 11827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - tr->set(StringRef(states.pack(DatabaseBackupAgent::keyStateLogBeginVersion)), BinaryWriter::toValue(beginVersion, Unversioned())); #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + tr->set(StringRef(states.pack(DatabaseBackupAgent::keyStateLogBeginVersion)), BinaryWriter::toValue(beginVersion, Unversioned())); + #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!stopWhenDone.present()) - #line 11833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" allPartsDone = futureBucket->future(tr); - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector> addTaskVector; - #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addTaskVector.push_back(CopyDiffLogsTaskFunc::addTask( tr, taskBucket, task, beginVersion, endVersion, TaskCompletionKey::signal(onDone), allPartsDone)); - #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int blockSize = std::max( 1, ((endVersion - beginVersion) / CLIENT_KNOBS->BACKUP_COPY_TASKS) / CLIENT_KNOBS->BACKUP_BLOCK_SIZE); - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - for(int64_t vblock = beginVersion / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock < (endVersion + CLIENT_KNOBS->BACKUP_BLOCK_SIZE - 1) / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock += blockSize) { #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + for(int64_t vblock = beginVersion / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock < (endVersion + CLIENT_KNOBS->BACKUP_BLOCK_SIZE - 1) / CLIENT_KNOBS->BACKUP_BLOCK_SIZE;vblock += blockSize) { + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addTaskVector.push_back(CopyLogRangeTaskFunc::addTask( tr, taskBucket, task, std::max(beginVersion, vblock * CLIENT_KNOBS->BACKUP_BLOCK_SIZE), std::min(endVersion, (vblock + blockSize) * CLIENT_KNOBS->BACKUP_BLOCK_SIZE), TaskCompletionKey::joinWith(allPartsDone))); - #line 11847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (prevBeginVersion > 0) - #line 11851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addTaskVector.push_back(EraseLogRangeTaskFunc::addTask( tr, taskBucket, task, beginVersion, TaskCompletionKey::joinWith(allPartsDone))); - #line 11855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = waitForAll(addTaskVector) && taskBucket->finish(tr, task); - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont8when1(__when_expr_6.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 7; - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 11866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_7 = onDone->set(tr, taskBucket) && taskBucket->finish(tr, task); - #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont8when2(__when_expr_7.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 8; - #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 11880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -11948,9 +11949,9 @@ class _finishActor6State { } int a_body1cont9(int loopDepth) { - #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor6*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor6State(); static_cast<_finishActor6*>(this)->destroy(); return 0; } - #line 11953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 11954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor6*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor6State(); static_cast<_finishActor6*>(this)->finishSendAndDelPromiseRef(); @@ -12108,36 +12109,36 @@ class _finishActor6State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 7); } - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - Subspace conf; #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + Subspace conf; + #line 1304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace states; - #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version beginVersion; - #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version prevBeginVersion; - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future> fStopWhenDone; - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version endVersion; - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference onDone; - #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference allPartsDone; - #line 12135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor6 final : public Actor, public ActorCallback< _finishActor6, 0, Void >, public ActorCallback< _finishActor6, 1, Version >, public ActorCallback< _finishActor6, 2, Void >, public ActorCallback< _finishActor6, 3, Void >, public ActorCallback< _finishActor6, 4, Void >, public ActorCallback< _finishActor6, 5, Optional >, public ActorCallback< _finishActor6, 6, Void >, public ActorCallback< _finishActor6, 7, Void >, public FastAllocated<_finishActor6>, public _finishActor6State<_finishActor6> { - #line 12140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor6>::operator new; using FastAllocated<_finishActor6>::operator delete; @@ -12153,9 +12154,9 @@ friend struct ActorCallback< _finishActor6, 4, Void >; friend struct ActorCallback< _finishActor6, 5, Optional >; friend struct ActorCallback< _finishActor6, 6, Void >; friend struct ActorCallback< _finishActor6, 7, Void >; - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor6(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 12158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _finishActor6State<_finishActor6>(tr, taskBucket, futureBucket, task) { @@ -12185,41 +12186,41 @@ friend struct ActorCallback< _finishActor6, 7, Void >; } }; - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _finishActor6(tr, taskBucket, futureBucket, task)); - #line 12192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 12197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor6State { - #line 12203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor6State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,Version const& prevBeginVersion,Version const& beginVersion,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" parentTask(parentTask), - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" prevBeginVersion(prevBeginVersion), - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion(beginVersion), - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" completionKey(completionKey), - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" waitFor(waitFor) - #line 12222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -12232,16 +12233,16 @@ class AddTaskActor6State { int a_body1(int loopDepth=0) { try { - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -12262,72 +12263,72 @@ class AddTaskActor6State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(CopyDiffLogsTaskFunc::name, CopyDiffLogsTaskFunc::version, doneKey, 1); - #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 1384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyBeginVersion] = BinaryWriter::toValue(beginVersion, Unversioned()); - #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyPrevBeginVersion] = BinaryWriter::toValue(prevBeginVersion, Unversioned()); - #line 1387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 12275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor6State(); static_cast(this)->destroy(); return 0; } - #line 12279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor6State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(CopyDiffLogsTaskFunc::name, CopyDiffLogsTaskFunc::version, doneKey, 1); - #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 1384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyBeginVersion] = BinaryWriter::toValue(beginVersion, Unversioned()); - #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyPrevBeginVersion] = BinaryWriter::toValue(prevBeginVersion, Unversioned()); - #line 1387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 12311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor6State(); static_cast(this)->destroy(); return 0; } - #line 12315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor6State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -12397,10 +12398,10 @@ class AddTaskActor6State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor6State(); static_cast(this)->destroy(); return 0; } - #line 12402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor6State(); static_cast(this)->destroy(); return 0; } + #line 12403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor6State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -12409,10 +12410,10 @@ class AddTaskActor6State { } int a_body1cont2(Void && _,int loopDepth) { - #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor6State(); static_cast(this)->destroy(); return 0; } - #line 12414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor6State(); static_cast(this)->destroy(); return 0; } + #line 12415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor6State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -12482,26 +12483,26 @@ class AddTaskActor6State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 1); } - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference parentTask; - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version prevBeginVersion; - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version beginVersion; - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference waitFor; - #line 12499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor6 final : public Actor, public ActorCallback< AddTaskActor6, 0, Key >, public ActorCallback< AddTaskActor6, 1, Void >, public FastAllocated, public AddTaskActor6State { - #line 12504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -12511,9 +12512,9 @@ class AddTaskActor6 final : public Actor, public ActorCallback< AddTaskActo #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor6, 0, Key >; friend struct ActorCallback< AddTaskActor6, 1, Void >; - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor6(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,Version const& prevBeginVersion,Version const& beginVersion,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 12516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), AddTaskActor6State(tr, taskBucket, parentTask, prevBeginVersion, beginVersion, completionKey, waitFor) { @@ -12537,14 +12538,14 @@ friend struct ActorCallback< AddTaskActor6, 1, Void >; } }; - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, Version const& prevBeginVersion, Version const& beginVersion, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new AddTaskActor6(tr, taskBucket, parentTask, prevBeginVersion, beginVersion, completionKey, waitFor)); - #line 12544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StringRef getName() const override { return name; }; @@ -12561,7 +12562,7 @@ friend struct ActorCallback< AddTaskActor6, 1, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef CopyDiffLogsTaskFunc::name = LiteralStringRef("dr_copy_diff_logs"); +StringRef CopyDiffLogsTaskFunc::name = "dr_copy_diff_logs"_sr; REGISTER_TASKFUNC(CopyDiffLogsTaskFunc); // Skip unneeded EraseLogRangeTaskFunc in 5.1 @@ -12569,28 +12570,28 @@ struct SkipOldEraseLogRangeTaskFunc : TaskFuncBase { static StringRef name; static constexpr uint32_t version = 1; - #line 12572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor7State { - #line 12578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor7State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskFuture(futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone])) - #line 12593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -12603,16 +12604,16 @@ class _finishActor7State { int a_body1(int loopDepth=0) { try { - #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = taskFuture->set(tr, taskBucket) && taskBucket->finish(tr, task); - #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor7*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor7*>(this)->actor_wait_state = 1; - #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor7*>(this))); - #line 12615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -12633,9 +12634,9 @@ class _finishActor7State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor7*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor7State(); static_cast<_finishActor7*>(this)->destroy(); return 0; } - #line 12638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor7*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor7State(); static_cast<_finishActor7*>(this)->finishSendAndDelPromiseRef(); @@ -12645,9 +12646,9 @@ class _finishActor7State { } int a_body1cont1(Void && _,int loopDepth) { - #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor7*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor7State(); static_cast<_finishActor7*>(this)->destroy(); return 0; } - #line 12650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor7*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor7State(); static_cast<_finishActor7*>(this)->finishSendAndDelPromiseRef(); @@ -12718,22 +12719,22 @@ class _finishActor7State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); } - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskFuture; - #line 12731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor7 final : public Actor, public ActorCallback< _finishActor7, 0, Void >, public FastAllocated<_finishActor7>, public _finishActor7State<_finishActor7> { - #line 12736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor7>::operator new; using FastAllocated<_finishActor7>::operator delete; @@ -12742,9 +12743,9 @@ class _finishActor7 final : public Actor, public ActorCallback< _finishAct void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< _finishActor7, 0, Void >; - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor7(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 12747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _finishActor7State<_finishActor7>(tr, taskBucket, futureBucket, task) { @@ -12767,14 +12768,14 @@ friend struct ActorCallback< _finishActor7, 0, Void >; } }; - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _finishActor7(tr, taskBucket, futureBucket, task)); - #line 12774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StringRef getName() const override { return name; }; @@ -12791,7 +12792,7 @@ friend struct ActorCallback< _finishActor7, 0, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef SkipOldEraseLogRangeTaskFunc::name = LiteralStringRef("dr_skip_legacy_task"); +StringRef SkipOldEraseLogRangeTaskFunc::name = "dr_skip_legacy_task"_sr; REGISTER_TASKFUNC(SkipOldEraseLogRangeTaskFunc); REGISTER_TASKFUNC_ALIAS(SkipOldEraseLogRangeTaskFunc, db_erase_log_range); @@ -12801,7 +12802,7 @@ struct OldCopyLogRangeTaskFunc : TaskFuncBase { static constexpr uint32_t version = 1; static struct { - static TaskParam bytesWritten() { return LiteralStringRef(__FUNCTION__); } + static TaskParam bytesWritten() { return __FUNCTION__sr; } } Params; static const Key keyNextBeginVersion; @@ -12821,36 +12822,36 @@ struct OldCopyLogRangeTaskFunc : TaskFuncBase { return _finish(tr, tb, fb, task); }; - #line 12824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via dumpData() - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class DumpDataActor1State { - #line 12830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DumpDataActor1State(Database const& cx,Reference const& task,PromiseStream const& results,FlowLock* const& lock,Reference const& tb) - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : cx(cx), - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" results(results), - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lock(lock), - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tb(tb), - #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endOfStream(false), - #line 1485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" conf(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(task->params[BackupAgentBase::keyConfigLogUid])), - #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutations(), - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutationSize(0) - #line 12853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("dumpData", reinterpret_cast(this)); @@ -12863,9 +12864,9 @@ class DumpDataActor1State { int a_body1(int loopDepth=0) { try { - #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 12868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -12894,33 +12895,33 @@ class DumpDataActor1State { int a_body1loopBody1(int loopDepth) { try { - #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (endOfStream && !nextMutationSize) - #line 12899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DumpDataActor1State(); static_cast(this)->destroy(); return 0; } - #line 12903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DumpDataActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" mutations = std::move(nextMutations); - #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" mutationSize = nextMutationSize; - #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutations = std::vector(); - #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutationSize = 0; - #line 1502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!endOfStream) - #line 12919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 12923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1loopHead1(loopDepth); } else @@ -12945,26 +12946,26 @@ class DumpDataActor1State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (e.code() == error_code_actor_cancelled || e.code() == error_code_backup_error) - #line 12950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 12954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" err = e; - #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = logError(cx, Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyErrors) .pack(task->params[BackupAgentBase::keyConfigLogUid]), format("ERROR: Failed to dump mutations because of error %s", err.what())); - #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 12962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -12977,11 +12978,11 @@ class DumpDataActor1State { } int a_body1loopBody1cont2(int loopDepth) { - #line 1530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = Transaction(cx); - #line 1532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 12984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 12985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont2loopHead1(loopDepth); return loopDepth; @@ -13002,16 +13003,16 @@ class DumpDataActor1State { int a_body1loopBody1loopBody1(int loopDepth) { try { - #line 1505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" FutureStream __when_expr_0 = results.getFuture(); - #line 1505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 13009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1loopBody1when1(__when_expr_0.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13044,20 +13045,20 @@ class DumpDataActor1State { int a_body1loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" error = e; - #line 1520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (e.code() == error_code_end_of_stream) - #line 13051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endOfStream = true; - #line 13055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1loopBody1Catch1(error, std::max(0, loopDepth - 1)); - #line 13060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1loopBody1Catch1(error, std::max(0, loopDepth - 1)); @@ -13069,52 +13070,52 @@ class DumpDataActor1State { } int a_body1loopBody1loopBody1cont2(RCGroup const& group,int loopDepth) { - #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lock->release(group.items.expectedSize()); - #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int vecSize = group.items.expectedSize(); - #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (mutationSize + vecSize >= CLIENT_KNOBS->BACKUP_LOG_WRITE_BATCH_MAX_SIZE) - #line 13078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutations.push_back(group.items); - #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutationSize = vecSize; - #line 13084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" mutations.push_back(group.items); - #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" mutationSize += vecSize; - #line 13091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1loopBody1cont5(loopDepth); return loopDepth; } int a_body1loopBody1loopBody1cont2(RCGroup && group,int loopDepth) { - #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lock->release(group.items.expectedSize()); - #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int vecSize = group.items.expectedSize(); - #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (mutationSize + vecSize >= CLIENT_KNOBS->BACKUP_LOG_WRITE_BATCH_MAX_SIZE) - #line 13104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutations.push_back(group.items); - #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextMutationSize = vecSize; - #line 13110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" mutations.push_back(group.items); - #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" mutationSize += vecSize; - #line 13117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1loopBody1cont5(loopDepth); return loopDepth; @@ -13211,20 +13212,20 @@ class DumpDataActor1State { int a_body1loopBody1cont2loopBody1(int loopDepth) { try { - #line 1534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.trState->options.sizeLimit = 2 * CLIENT_KNOBS->TRANSACTION_SIZE_LIMIT; - #line 1536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = checkDatabaseLock(&tr, BinaryReader::fromStringRef( task->params[BackupAgentBase::keyConfigLogUid], Unversioned())); - #line 1536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 13222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont2loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13257,16 +13258,16 @@ class DumpDataActor1State { int a_body1loopBody1cont2loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = tr.onError(e); - #line 1559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 13264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13279,82 +13280,82 @@ class DumpDataActor1State { } int a_body1loopBody1cont2loopBody1cont2(Void const& _,int loopDepth) { - #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bytesSet = 0; - #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool first = true; - #line 1542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto m : mutations ) { - #line 1543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto kv : m ) { - #line 1544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (first) - #line 13292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.addReadConflictRange(singleKeyRange(kv.key)); - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" first = false; - #line 13298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.set(kv.key.removePrefix(backupLogKeys.begin).withPrefix(applyLogKeys.begin), kv.value); - #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bytesSet += kv.expectedSize() - backupLogKeys.begin.expectedSize() + applyLogKeys.begin.expectedSize(); - #line 13304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } - #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr.commit(); - #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 13311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont2loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2loopBody1cont2(Void && _,int loopDepth) { - #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bytesSet = 0; - #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool first = true; - #line 1542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto m : mutations ) { - #line 1543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto kv : m ) { - #line 1544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (first) - #line 13333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.addReadConflictRange(singleKeyRange(kv.key)); - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" first = false; - #line 13339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.set(kv.key.removePrefix(backupLogKeys.begin).withPrefix(applyLogKeys.begin), kv.value); - #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bytesSet += kv.expectedSize() - backupLogKeys.begin.expectedSize() + applyLogKeys.begin.expectedSize(); - #line 13345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } - #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr.commit(); - #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 13352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont2loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -13424,18 +13425,18 @@ class DumpDataActor1State { } int a_body1loopBody1cont2loopBody1cont3(Void const& _,int loopDepth) { - #line 1556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Params.bytesWritten().set(task, Params.bytesWritten().getOrDefault(task) + bytesSet); - #line 13429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1loopBody1cont2break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1loopBody1cont2loopBody1cont3(Void && _,int loopDepth) { - #line 1556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Params.bytesWritten().set(task, Params.bytesWritten().getOrDefault(task) + bytesSet); - #line 13438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1loopBody1cont2break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -13593,17 +13594,17 @@ class DumpDataActor1State { } int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(err, std::max(0, loopDepth - 1)); - #line 13598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return loopDepth; } int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(err, std::max(0, loopDepth - 1)); - #line 13606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return loopDepth; } @@ -13670,42 +13671,42 @@ class DumpDataActor1State { fdb_probe_actor_exit("dumpData", reinterpret_cast(this), 4); } - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" PromiseStream results; - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" FlowLock* lock; - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tb; - #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool endOfStream; - #line 1485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace conf; - #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector nextMutations; - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int64_t nextMutationSize; - #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector mutations; - #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int64_t mutationSize; - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Error error; - #line 1530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Transaction tr; - #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int64_t bytesSet; - #line 1566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Error err; - #line 13703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via dumpData() - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class DumpDataActor1 final : public Actor, public ActorSingleCallback< DumpDataActor1, 0, RCGroup >, public ActorCallback< DumpDataActor1, 1, Void >, public ActorCallback< DumpDataActor1, 2, Void >, public ActorCallback< DumpDataActor1, 3, Void >, public ActorCallback< DumpDataActor1, 4, Void >, public FastAllocated, public DumpDataActor1State { - #line 13708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -13718,9 +13719,9 @@ friend struct ActorCallback< DumpDataActor1, 1, Void >; friend struct ActorCallback< DumpDataActor1, 2, Void >; friend struct ActorCallback< DumpDataActor1, 3, Void >; friend struct ActorCallback< DumpDataActor1, 4, Void >; - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DumpDataActor1(Database const& cx,Reference const& task,PromiseStream const& results,FlowLock* const& lock,Reference const& tb) - #line 13723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), DumpDataActor1State(cx, task, results, lock, tb) { @@ -13747,37 +13748,37 @@ friend struct ActorCallback< DumpDataActor1, 4, Void >; } }; - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future dumpData( Database const& cx, Reference const& task, PromiseStream const& results, FlowLock* const& lock, Reference const& tb ) { - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new DumpDataActor1(cx, task, results, lock, tb)); - #line 13754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 13759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor4State { - #line 13765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor4State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : cx(cx), - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 1582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lock(new FlowLock(CLIENT_KNOBS->BACKUP_LOCK_BYTES)) - #line 13780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -13790,16 +13791,16 @@ class _executeActor4State { int a_body1(int loopDepth=0) { try { - #line 1584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(cx, task, OldCopyLogRangeTaskFunc::name, OldCopyLogRangeTaskFunc::version); - #line 1584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 1; - #line 1584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 13802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13820,80 +13821,80 @@ class _executeActor4State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyBeginVersion], Unversioned()); - #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyEndVersion], Unversioned()); - #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" newEndVersion = std::min(endVersion, (((beginVersion - 1) / CLIENT_KNOBS->BACKUP_BLOCK_SIZE) + 2 + (g_network->isSimulated() ? CLIENT_KNOBS->BACKUP_SIM_COPY_LOG_RANGES : 0)) * CLIENT_KNOBS->BACKUP_BLOCK_SIZE); - #line 1596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ranges = getLogRanges(beginVersion, newEndVersion, task->params[BackupAgentBase::keyConfigLogUid], CLIENT_KNOBS->BACKUP_BLOCK_SIZE); - #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" results = std::vector>(); - #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rc = std::vector>(); - #line 1602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" dump = std::vector>(); - #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for(int i = 0;i < ranges.size();++i) { - #line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" results.push_back(PromiseStream()); - #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rc.push_back(readCommitted(taskBucket->src, results[i], Future(Void()), lock, ranges[i], decodeBKMutationLogKey, Terminator::True, AccessSystemKeys::True, LockAware::True)); - #line 1615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" dump.push_back(dumpData(cx, task, results[i], lock.getPtr(), taskBucket)); - #line 13845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitForAll(dump); - #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 2; - #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 13856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyBeginVersion], Unversioned()); - #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyEndVersion], Unversioned()); - #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" newEndVersion = std::min(endVersion, (((beginVersion - 1) / CLIENT_KNOBS->BACKUP_BLOCK_SIZE) + 2 + (g_network->isSimulated() ? CLIENT_KNOBS->BACKUP_SIM_COPY_LOG_RANGES : 0)) * CLIENT_KNOBS->BACKUP_BLOCK_SIZE); - #line 1596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ranges = getLogRanges(beginVersion, newEndVersion, task->params[BackupAgentBase::keyConfigLogUid], CLIENT_KNOBS->BACKUP_BLOCK_SIZE); - #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" results = std::vector>(); - #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rc = std::vector>(); - #line 1602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" dump = std::vector>(); - #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for(int i = 0;i < ranges.size();++i) { - #line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" results.push_back(PromiseStream()); - #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rc.push_back(readCommitted(taskBucket->src, results[i], Future(Void()), lock, ranges[i], decodeBKMutationLogKey, Terminator::True, AccessSystemKeys::True, LockAware::True)); - #line 1615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" dump.push_back(dumpData(cx, task, results[i], lock.getPtr(), taskBucket)); - #line 13885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitForAll(dump); - #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 2; - #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 13896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -13963,17 +13964,17 @@ class _executeActor4State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (newEndVersion < endVersion) - #line 13968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[OldCopyLogRangeTaskFunc::keyNextBeginVersion] = BinaryWriter::toValue(newEndVersion, Unversioned()); - #line 13972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor4*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor4State(); static_cast<_executeActor4*>(this)->destroy(); return 0; } - #line 13976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor4*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor4State(); static_cast<_executeActor4*>(this)->finishSendAndDelPromiseRef(); @@ -13983,17 +13984,17 @@ class _executeActor4State { } int a_body1cont2(Void && _,int loopDepth) { - #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (newEndVersion < endVersion) - #line 13988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[OldCopyLogRangeTaskFunc::keyNextBeginVersion] = BinaryWriter::toValue(newEndVersion, Unversioned()); - #line 13992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 1625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor4*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor4State(); static_cast<_executeActor4*>(this)->destroy(); return 0; } - #line 13996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 13997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor4*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor4State(); static_cast<_executeActor4*>(this)->finishSendAndDelPromiseRef(); @@ -14064,36 +14065,36 @@ class _executeActor4State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); } - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 1582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference lock; - #line 1586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version beginVersion; - #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version endVersion; - #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version newEndVersion; - #line 1596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Standalone> ranges; - #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector> results; - #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector> rc; - #line 1602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector> dump; - #line 14091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor4 final : public Actor, public ActorCallback< _executeActor4, 0, Void >, public ActorCallback< _executeActor4, 1, Void >, public FastAllocated<_executeActor4>, public _executeActor4State<_executeActor4> { - #line 14096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor4>::operator new; using FastAllocated<_executeActor4>::operator delete; @@ -14103,9 +14104,9 @@ class _executeActor4 final : public Actor, public ActorCallback< _executeA #pragma clang diagnostic pop friend struct ActorCallback< _executeActor4, 0, Void >; friend struct ActorCallback< _executeActor4, 1, Void >; - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor4(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 14108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _executeActor4State<_executeActor4>(cx, taskBucket, futureBucket, task) { @@ -14129,41 +14130,41 @@ friend struct ActorCallback< _executeActor4, 1, Void >; } }; - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _executeActor4(cx, taskBucket, futureBucket, task)); - #line 14136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 14141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor7State { - #line 14147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor7State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,Version const& beginVersion,Version const& endVersion,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" parentTask(parentTask), - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion(beginVersion), - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endVersion(endVersion), - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" completionKey(completionKey), - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" waitFor(waitFor) - #line 14166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -14176,16 +14177,16 @@ class AddTaskActor7State { int a_body1(int loopDepth=0) { try { - #line 1635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 1635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 14188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -14206,72 +14207,72 @@ class AddTaskActor7State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(OldCopyLogRangeTaskFunc::name, OldCopyLogRangeTaskFunc::version, doneKey, 1); - #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyBeginVersion] = BinaryWriter::toValue(beginVersion, Unversioned()); - #line 1641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyEndVersion] = BinaryWriter::toValue(endVersion, Unversioned()); - #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 14219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor7State(); static_cast(this)->destroy(); return 0; } - #line 14223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor7State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 14238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(OldCopyLogRangeTaskFunc::name, OldCopyLogRangeTaskFunc::version, doneKey, 1); - #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyBeginVersion] = BinaryWriter::toValue(beginVersion, Unversioned()); - #line 1641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyEndVersion] = BinaryWriter::toValue(endVersion, Unversioned()); - #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 14255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor7State(); static_cast(this)->destroy(); return 0; } - #line 14259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor7State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 14274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -14341,10 +14342,10 @@ class AddTaskActor7State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 1655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor7State(); static_cast(this)->destroy(); return 0; } - #line 14346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor7State(); static_cast(this)->destroy(); return 0; } + #line 14347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor7State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -14353,10 +14354,10 @@ class AddTaskActor7State { } int a_body1cont2(Void && _,int loopDepth) { - #line 1655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor7State(); static_cast(this)->destroy(); return 0; } - #line 14358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor7State(); static_cast(this)->destroy(); return 0; } + #line 14359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor7State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -14426,26 +14427,26 @@ class AddTaskActor7State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 1); } - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference parentTask; - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version beginVersion; - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version endVersion; - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference waitFor; - #line 14443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor7 final : public Actor, public ActorCallback< AddTaskActor7, 0, Key >, public ActorCallback< AddTaskActor7, 1, Void >, public FastAllocated, public AddTaskActor7State { - #line 14448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -14455,9 +14456,9 @@ class AddTaskActor7 final : public Actor, public ActorCallback< AddTaskActo #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor7, 0, Key >; friend struct ActorCallback< AddTaskActor7, 1, Void >; - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor7(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,Version const& beginVersion,Version const& endVersion,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 14460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), AddTaskActor7State(tr, taskBucket, parentTask, beginVersion, endVersion, completionKey, waitFor) { @@ -14481,39 +14482,39 @@ friend struct ActorCallback< AddTaskActor7, 1, Void >; } }; - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, Version const& beginVersion, Version const& endVersion, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new AddTaskActor7(tr, taskBucket, parentTask, beginVersion, endVersion, completionKey, waitFor)); - #line 14488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 14493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor8State { - #line 14499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor8State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 1663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endVersion(BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyEndVersion], Unversioned())), - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskFuture(futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone])) - #line 14516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -14526,42 +14527,42 @@ class _finishActor8State { int a_body1(int loopDepth=0) { try { - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DRConfig config(task); - #line 1670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int64_t bytesWritten = Params.bytesWritten().getOrDefault(task); - #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" config.logBytesWritten().atomicOp(tr, bytesWritten, MutationRef::AddValue); - #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (task->params.find(OldCopyLogRangeTaskFunc::keyNextBeginVersion) != task->params.end()) - #line 14537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" nextVersion = BinaryReader::fromStringRef( task->params[OldCopyLogRangeTaskFunc::keyNextBeginVersion], Unversioned()); - #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = success(OldCopyLogRangeTaskFunc::addTask( tr, taskBucket, task, nextVersion, endVersion, TaskCompletionKey::signal(taskFuture->key))) && taskBucket->finish(tr, task); - #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor8*>(this)->actor_wait_state = 1; - #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor8*>(this))); - #line 14550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = taskFuture->set(tr, taskBucket) && taskBucket->finish(tr, task); - #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor8*>(this)->actor_wait_state = 2; - #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor8*>(this))); - #line 14564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } } @@ -14583,9 +14584,9 @@ class _finishActor8State { } int a_body1cont1(int loopDepth) { - #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor8*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor8State(); static_cast<_finishActor8*>(this)->destroy(); return 0; } - #line 14588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor8*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor8State(); static_cast<_finishActor8*>(this)->finishSendAndDelPromiseRef(); @@ -14743,26 +14744,26 @@ class _finishActor8State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); } - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 1663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version endVersion; - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskFuture; - #line 1674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version nextVersion; - #line 14760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor8 final : public Actor, public ActorCallback< _finishActor8, 0, Void >, public ActorCallback< _finishActor8, 1, Void >, public FastAllocated<_finishActor8>, public _finishActor8State<_finishActor8> { - #line 14765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor8>::operator new; using FastAllocated<_finishActor8>::operator delete; @@ -14772,9 +14773,9 @@ class _finishActor8 final : public Actor, public ActorCallback< _finishAct #pragma clang diagnostic pop friend struct ActorCallback< _finishActor8, 0, Void >; friend struct ActorCallback< _finishActor8, 1, Void >; - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor8(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 14777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _finishActor8State<_finishActor8>(tr, taskBucket, futureBucket, task) { @@ -14798,49 +14799,49 @@ friend struct ActorCallback< _finishActor8, 1, Void >; } }; - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _finishActor8(tr, taskBucket, futureBucket, task)); - #line 14805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" }; -StringRef OldCopyLogRangeTaskFunc::name = LiteralStringRef("db_copy_log_range"); -const Key OldCopyLogRangeTaskFunc::keyNextBeginVersion = LiteralStringRef("nextBeginVersion"); +StringRef OldCopyLogRangeTaskFunc::name = "db_copy_log_range"_sr; +const Key OldCopyLogRangeTaskFunc::keyNextBeginVersion = "nextBeginVersion"_sr; REGISTER_TASKFUNC(OldCopyLogRangeTaskFunc); struct AbortOldBackupTaskFunc : TaskFuncBase { static StringRef name; static constexpr uint32_t version = 1; - #line 14818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor5State { - #line 14824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor5State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : cx(cx), - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcDrAgent(taskBucket->src), - #line 1699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr(new ReadYourWritesTransaction(cx)), - #line 1700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagNameKey() - #line 14843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -14853,9 +14854,9 @@ class _executeActor5State { int a_body1(int loopDepth=0) { try { - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 14858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -14876,18 +14877,18 @@ class _executeActor5State { } int a_body1cont1(int loopDepth) { - #line 1720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_AbortOldBackup").detail("TagName", tagNameKey.printable()); - #line 1721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = srcDrAgent.abortBackup(cx, tagNameKey, PartialBackup::False, AbortOldBackup::True); - #line 1721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor5*>(this)->actor_wait_state = 3; - #line 1721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); - #line 14890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -14902,22 +14903,22 @@ class _executeActor5State { int a_body1loopBody1(int loopDepth) { try { - #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key tagPath = srcDrAgent.states.get(task->params[DatabaseBackupAgent::keyConfigLogUid]) .pack(BackupAgentBase::keyConfigBackupTag); - #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_0 = tr->get(tagPath); - #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 14915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor5*>(this)->actor_wait_state = 1; - #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast<_executeActor5*>(this))); - #line 14920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -14950,16 +14951,16 @@ class _executeActor5State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = tr->onError(e); - #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 14957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor5*>(this)->actor_wait_state = 2; - #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); - #line 14962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -14972,42 +14973,42 @@ class _executeActor5State { } int a_body1loopBody1cont2(Optional const& tagName,int loopDepth) { - #line 1709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!tagName.present()) - #line 14977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor5*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor5State(); static_cast<_executeActor5*>(this)->destroy(); return 0; } - #line 14981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor5*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor5State(); static_cast<_executeActor5*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagNameKey = tagName.get(); - #line 14989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1loopBody1cont2(Optional && tagName,int loopDepth) { - #line 1709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!tagName.present()) - #line 14998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 14999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor5*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor5State(); static_cast<_executeActor5*>(this)->destroy(); return 0; } - #line 15002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor5*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor5State(); static_cast<_executeActor5*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagNameKey = tagName.get(); - #line 15010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -15152,9 +15153,9 @@ class _executeActor5State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 1723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor5*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor5State(); static_cast<_executeActor5*>(this)->destroy(); return 0; } - #line 15157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor5*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor5State(); static_cast<_executeActor5*>(this)->finishSendAndDelPromiseRef(); @@ -15164,9 +15165,9 @@ class _executeActor5State { } int a_body1cont2(Void && _,int loopDepth) { - #line 1723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor5*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor5State(); static_cast<_executeActor5*>(this)->destroy(); return 0; } - #line 15169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor5*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor5State(); static_cast<_executeActor5*>(this)->finishSendAndDelPromiseRef(); @@ -15237,26 +15238,26 @@ class _executeActor5State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); } - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent srcDrAgent; - #line 1699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key tagNameKey; - #line 15254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor5 final : public Actor, public ActorCallback< _executeActor5, 0, Optional >, public ActorCallback< _executeActor5, 1, Void >, public ActorCallback< _executeActor5, 2, Void >, public FastAllocated<_executeActor5>, public _executeActor5State<_executeActor5> { - #line 15259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor5>::operator new; using FastAllocated<_executeActor5>::operator delete; @@ -15267,9 +15268,9 @@ class _executeActor5 final : public Actor, public ActorCallback< _executeA friend struct ActorCallback< _executeActor5, 0, Optional >; friend struct ActorCallback< _executeActor5, 1, Void >; friend struct ActorCallback< _executeActor5, 2, Void >; - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor5(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 15272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _executeActor5State<_executeActor5>(cx, taskBucket, futureBucket, task) { @@ -15294,35 +15295,35 @@ friend struct ActorCallback< _executeActor5, 2, Void >; } }; - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _executeActor5(cx, taskBucket, futureBucket, task)); - #line 15301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 15306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor9State { - #line 15312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor9State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task) - #line 15325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -15335,16 +15336,16 @@ class _finishActor9State { int a_body1(int loopDepth=0) { try { - #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = taskBucket->finish(tr, task); - #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor9*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 15342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor9*>(this)->actor_wait_state = 1; - #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor9*>(this))); - #line 15347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -15365,9 +15366,9 @@ class _finishActor9State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor9*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor9State(); static_cast<_finishActor9*>(this)->destroy(); return 0; } - #line 15370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor9*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor9State(); static_cast<_finishActor9*>(this)->finishSendAndDelPromiseRef(); @@ -15377,9 +15378,9 @@ class _finishActor9State { } int a_body1cont1(Void && _,int loopDepth) { - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor9*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor9State(); static_cast<_finishActor9*>(this)->destroy(); return 0; } - #line 15382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor9*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor9State(); static_cast<_finishActor9*>(this)->finishSendAndDelPromiseRef(); @@ -15450,20 +15451,20 @@ class _finishActor9State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); } - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 15461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor9 final : public Actor, public ActorCallback< _finishActor9, 0, Void >, public FastAllocated<_finishActor9>, public _finishActor9State<_finishActor9> { - #line 15466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor9>::operator new; using FastAllocated<_finishActor9>::operator delete; @@ -15472,9 +15473,9 @@ class _finishActor9 final : public Actor, public ActorCallback< _finishAct void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< _finishActor9, 0, Void >; - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor9(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 15477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _finishActor9State<_finishActor9>(tr, taskBucket, futureBucket, task) { @@ -15497,37 +15498,37 @@ friend struct ActorCallback< _finishActor9, 0, Void >; } }; - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _finishActor9(tr, taskBucket, futureBucket, task)); - #line 15504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 15509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor8State { - #line 15515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor8State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" parentTask(parentTask), - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" completionKey(completionKey), - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" waitFor(waitFor) - #line 15530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -15540,16 +15541,16 @@ class AddTaskActor8State { int a_body1(int loopDepth=0) { try { - #line 1739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 1739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 15547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -15570,64 +15571,64 @@ class AddTaskActor8State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 1740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(AbortOldBackupTaskFunc::name, AbortOldBackupTaskFunc::version, doneKey, 1); - #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 15579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor8State(); static_cast(this)->destroy(); return 0; } - #line 15583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor8State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 15593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 1740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(AbortOldBackupTaskFunc::name, AbortOldBackupTaskFunc::version, doneKey, 1); - #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 15611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor8State(); static_cast(this)->destroy(); return 0; } - #line 15615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor8State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 15625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -15697,10 +15698,10 @@ class AddTaskActor8State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor8State(); static_cast(this)->destroy(); return 0; } - #line 15702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor8State(); static_cast(this)->destroy(); return 0; } + #line 15703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor8State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -15709,10 +15710,10 @@ class AddTaskActor8State { } int a_body1cont2(Void && _,int loopDepth) { - #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor8State(); static_cast(this)->destroy(); return 0; } - #line 15714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor8State(); static_cast(this)->destroy(); return 0; } + #line 15715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor8State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -15782,22 +15783,22 @@ class AddTaskActor8State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 1); } - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference parentTask; - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference waitFor; - #line 15795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor8 final : public Actor, public ActorCallback< AddTaskActor8, 0, Key >, public ActorCallback< AddTaskActor8, 1, Void >, public FastAllocated, public AddTaskActor8State { - #line 15800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -15807,9 +15808,9 @@ class AddTaskActor8 final : public Actor, public ActorCallback< AddTaskActo #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor8, 0, Key >; friend struct ActorCallback< AddTaskActor8, 1, Void >; - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor8(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 15812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), AddTaskActor8State(tr, taskBucket, parentTask, completionKey, waitFor) { @@ -15833,14 +15834,14 @@ friend struct ActorCallback< AddTaskActor8, 1, Void >; } }; - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new AddTaskActor8(tr, taskBucket, parentTask, completionKey, waitFor)); - #line 15840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StringRef getName() const override { return name; }; @@ -15857,7 +15858,7 @@ friend struct ActorCallback< AddTaskActor8, 1, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef AbortOldBackupTaskFunc::name = LiteralStringRef("dr_abort_legacy_backup"); +StringRef AbortOldBackupTaskFunc::name = "dr_abort_legacy_backup"_sr; REGISTER_TASKFUNC(AbortOldBackupTaskFunc); REGISTER_TASKFUNC_ALIAS(AbortOldBackupTaskFunc, db_backup_range); REGISTER_TASKFUNC_ALIAS(AbortOldBackupTaskFunc, db_finish_full_backup); @@ -15871,32 +15872,32 @@ struct CopyDiffLogsUpgradeTaskFunc : TaskFuncBase { static StringRef name; static constexpr uint32_t version = 1; - #line 15874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor6State { - #line 15880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor6State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : cx(cx), - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 1792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUidValue(task->params[DatabaseBackupAgent::keyConfigLogUid]), - #line 1793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" sourceStates(Subspace(databaseBackupPrefixRange.begin).get(BackupAgentBase::keySourceStates).get(logUidValue)), - #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" config(Subspace(databaseBackupPrefixRange.begin).get(BackupAgentBase::keyConfig).get(logUidValue)) - #line 15899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -15909,16 +15910,16 @@ class _executeActor6State { int a_body1(int loopDepth=0) { try { - #line 1797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(cx, task, CopyDiffLogsUpgradeTaskFunc::name, CopyDiffLogsUpgradeTaskFunc::version); - #line 1797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 15916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 1; - #line 1797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 15921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -15939,26 +15940,26 @@ class _executeActor6State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRanges = Standalone>(); - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 15948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRanges = Standalone>(); - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 15961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 15962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -16028,13 +16029,13 @@ class _executeActor6State { } int a_body1cont2(int loopDepth) { - #line 1823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUidValue = Key(logUidValue); - #line 1824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr = Reference(new ReadYourWritesTransaction(taskBucket->src)); - #line 1825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 16037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopHead1(loopDepth); return loopDepth; @@ -16049,22 +16050,22 @@ class _executeActor6State { int a_body1cont1loopBody1(int loopDepth) { try { - #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future verified = taskBucket->keepRunning(tr, task); - #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = verified; - #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 16062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 2; - #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 16067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -16097,16 +16098,16 @@ class _executeActor6State { int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = tr->onError(e); - #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 16104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 4; - #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 16109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -16119,32 +16120,32 @@ class _executeActor6State { } int a_body1cont1loopBody1cont2(Void const& _,int loopDepth) { - #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_2 = tr->get(config.pack(BackupAgentBase::keyConfigBackupRanges)); - #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 16126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 3; - #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast<_executeActor6*>(this))); - #line 16131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont2(Void && _,int loopDepth) { - #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_2 = tr->get(config.pack(BackupAgentBase::keyConfigBackupRanges)); - #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 16142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 3; - #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast<_executeActor6*>(this))); - #line 16147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -16214,46 +16215,46 @@ class _executeActor6State { } int a_body1cont1loopBody1cont3(Optional const& backupKeysPacked,int loopDepth) { - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!backupKeysPacked.present()) - #line 16219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor6*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor6State(); static_cast<_executeActor6*>(this)->destroy(); return 0; } - #line 16223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor6*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor6State(); static_cast<_executeActor6*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" BinaryReader br(backupKeysPacked.get(), IncludeVersion()); - #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" br >> backupRanges; - #line 16233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1cont1loopBody1cont3(Optional && backupKeysPacked,int loopDepth) { - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!backupKeysPacked.present()) - #line 16242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor6*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor6State(); static_cast<_executeActor6*>(this)->destroy(); return 0; } - #line 16246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor6*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor6State(); static_cast<_executeActor6*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" BinaryReader br(backupKeysPacked.get(), IncludeVersion()); - #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" br >> backupRanges; - #line 16256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -16398,13 +16399,13 @@ class _executeActor6State { } int a_body1cont3(int loopDepth) { - #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::destUid] = destUidValue; - #line 1874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ASSERT(destUidValue == logUidValue); - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor6*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor6State(); static_cast<_executeActor6*>(this)->destroy(); return 0; } - #line 16407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor6*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor6State(); static_cast<_executeActor6*>(this)->finishSendAndDelPromiseRef(); @@ -16422,20 +16423,20 @@ class _executeActor6State { int a_body1cont2loopBody1(int loopDepth) { try { - #line 1827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_4 = srcTr->get(sourceStates.pack(DatabaseBackupAgent::keyFolderId)); - #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 16433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont2loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont2loopBody1when1(__when_expr_4.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 5; - #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast >*>(static_cast<_executeActor6*>(this))); - #line 16438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -16468,16 +16469,16 @@ class _executeActor6State { int a_body1cont2loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_7 = srcTr->onError(e); - #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 16475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1Catch1when1(__when_expr_7.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 8; - #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 16480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -16490,32 +16491,32 @@ class _executeActor6State { } int a_body1cont2loopBody1cont2(int loopDepth) { - #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (v.present() && BinaryReader::fromStringRef(v.get(), Unversioned()) > BinaryReader::fromStringRef( task->params[DatabaseBackupAgent::keyFolderId], Unversioned())) - #line 16495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor6*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor6State(); static_cast<_executeActor6*>(this)->destroy(); return 0; } - #line 16499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor6*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor6State(); static_cast<_executeActor6*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (backupRanges.size() == 1) - #line 16507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (backupRanges.size() == 1 || isDefaultBackup(backupRanges)) + #line 16508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_5 = srcTr->getRange( KeyRangeRef(destUidLookupPrefix, strinc(destUidLookupPrefix)), CLIENT_KNOBS->TOO_MANY); - #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 16513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont2loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_5.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 6; - #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 16518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -16527,9 +16528,9 @@ class _executeActor6State { } int a_body1cont2loopBody1when1(Optional const& __v,int loopDepth) { - #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" v = __v; - #line 16532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopBody1cont2(loopDepth); return loopDepth; @@ -16594,41 +16595,45 @@ class _executeActor6State { } int a_body1cont2loopBody1cont3(int loopDepth) { - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key versionKey = logUidValue.withPrefix(destUidValue).withPrefix(backupLatestVersionsPrefix); - #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->set(versionKey, task->params[DatabaseBackupAgent::keyBeginVersion]); - #line 1866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = srcTr->commit(); - #line 1866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 16605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont2loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont2loopBody1cont3when1(__when_expr_6.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 7; - #line 1866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 16610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2loopBody1cont5(RangeResult const& existingDestUidValues,int loopDepth) { - #line 1840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool found = false; - #line 1841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + KeyRangeRef targetRange = (backupRanges.size() == 1) ? backupRanges[0] : getDefaultBackupSharedRange(); + #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto it : existingDestUidValues ) { - #line 1842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (BinaryReader::fromStringRef(it.key.removePrefix(destUidLookupPrefix), IncludeVersion()) == backupRanges[0]) - #line 16623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + KeyRange uidRange = BinaryReader::fromStringRef( it.key.removePrefix(destUidLookupPrefix), IncludeVersion()); + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (uidRange == targetRange) + #line 16628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (destUidValue != it.value) - #line 16627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor6*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor6State(); static_cast<_executeActor6*>(this)->destroy(); return 0; } - #line 16631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor6*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor6State(); static_cast<_executeActor6*>(this)->finishSendAndDelPromiseRef(); @@ -16636,43 +16641,47 @@ class _executeActor6State { } else { - #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" found = true; - #line 16641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" break; } } } - #line 1854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (found) - #line 16648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 1858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - srcTr->set( BinaryWriter::toValue(backupRanges[0], IncludeVersion(ProtocolVersion::withSharedMutations())) .withPrefix(destUidLookupPrefix), destUidValue); - #line 16654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + srcTr->set( BinaryWriter::toValue(targetRange, IncludeVersion(ProtocolVersion::withSharedMutations())) .withPrefix(destUidLookupPrefix), destUidValue); + #line 16659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopBody1cont3(loopDepth); return loopDepth; } int a_body1cont2loopBody1cont5(RangeResult && existingDestUidValues,int loopDepth) { - #line 1840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool found = false; - #line 1841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + KeyRangeRef targetRange = (backupRanges.size() == 1) ? backupRanges[0] : getDefaultBackupSharedRange(); + #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto it : existingDestUidValues ) { - #line 1842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (BinaryReader::fromStringRef(it.key.removePrefix(destUidLookupPrefix), IncludeVersion()) == backupRanges[0]) - #line 16667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + KeyRange uidRange = BinaryReader::fromStringRef( it.key.removePrefix(destUidLookupPrefix), IncludeVersion()); + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (uidRange == targetRange) + #line 16676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (destUidValue != it.value) - #line 16671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor6*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor6State(); static_cast<_executeActor6*>(this)->destroy(); return 0; } - #line 16675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor6*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor6State(); static_cast<_executeActor6*>(this)->finishSendAndDelPromiseRef(); @@ -16680,22 +16689,22 @@ class _executeActor6State { } else { - #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" found = true; - #line 16685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" break; } } } - #line 1854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (found) - #line 16692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 1858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - srcTr->set( BinaryWriter::toValue(backupRanges[0], IncludeVersion(ProtocolVersion::withSharedMutations())) .withPrefix(destUidLookupPrefix), destUidValue); - #line 16698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + srcTr->set( BinaryWriter::toValue(targetRange, IncludeVersion(ProtocolVersion::withSharedMutations())) .withPrefix(destUidLookupPrefix), destUidValue); + #line 16707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopBody1cont3(loopDepth); return loopDepth; @@ -16913,36 +16922,36 @@ class _executeActor6State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 7); } - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 1792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key logUidValue; - #line 1793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace sourceStates; - #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace config; - #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Standalone> backupRanges; - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key destUidValue; - #line 1824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference srcTr; - #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Optional v; - #line 16940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor6 final : public Actor, public ActorCallback< _executeActor6, 0, Void >, public ActorCallback< _executeActor6, 1, Void >, public ActorCallback< _executeActor6, 2, Optional >, public ActorCallback< _executeActor6, 3, Void >, public ActorCallback< _executeActor6, 4, Optional >, public ActorCallback< _executeActor6, 5, RangeResult >, public ActorCallback< _executeActor6, 6, Void >, public ActorCallback< _executeActor6, 7, Void >, public FastAllocated<_executeActor6>, public _executeActor6State<_executeActor6> { - #line 16945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor6>::operator new; using FastAllocated<_executeActor6>::operator delete; @@ -16958,9 +16967,9 @@ friend struct ActorCallback< _executeActor6, 4, Optional >; friend struct ActorCallback< _executeActor6, 5, RangeResult >; friend struct ActorCallback< _executeActor6, 6, Void >; friend struct ActorCallback< _executeActor6, 7, Void >; - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor6(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 16963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 16972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _executeActor6State<_executeActor6>(cx, taskBucket, futureBucket, task) { @@ -16990,35 +16999,35 @@ friend struct ActorCallback< _executeActor6, 7, Void >; } }; - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _executeActor6(cx, taskBucket, futureBucket, task)); - #line 16997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 17002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor10State { - #line 17008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor10State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task) - #line 17021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -17031,16 +17040,16 @@ class _finishActor10State { int a_body1(int loopDepth=0) { try { - #line 1883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(tr, task, CopyDiffLogsUpgradeTaskFunc::name, CopyDiffLogsUpgradeTaskFunc::version); - #line 1883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor10*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor10*>(this)->actor_wait_state = 1; - #line 1883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); - #line 17043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -17061,46 +17070,46 @@ class _finishActor10State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" onDone = futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone]); - #line 1886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (task->params[BackupAgentBase::destUid].size() == 0) - #line 17068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_CopyDiffLogsUpgradeTaskFuncAbortInUpgrade").log(); - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = success(AbortOldBackupTaskFunc::addTask(tr, taskBucket, task, TaskCompletionKey::signal(onDone))); - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor10*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor10*>(this)->actor_wait_state = 2; - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); - #line 17081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 1890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version beginVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyBeginVersion], Unversioned()); - #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace config = Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(task->params[DatabaseBackupAgent::keyConfigLogUid]); - #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(config.pack(BackupAgentBase::destUid), task->params[BackupAgentBase::destUid]); - #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(config.pack(BackupAgentBase::keyDrVersion), BinaryWriter::toValue(DatabaseBackupAgent::LATEST_DR_VERSION, Unversioned())); - #line 1898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = success(CopyDiffLogsTaskFunc::addTask( tr, taskBucket, task, 0, beginVersion, TaskCompletionKey::signal(onDone))); - #line 1898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor10*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor10*>(this)->actor_wait_state = 3; - #line 1898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); - #line 17103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -17108,46 +17117,46 @@ class _finishActor10State { } int a_body1cont1(Void && _,int loopDepth) { - #line 1884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" onDone = futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone]); - #line 1886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (task->params[BackupAgentBase::destUid].size() == 0) - #line 17115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_CopyDiffLogsUpgradeTaskFuncAbortInUpgrade").log(); - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = success(AbortOldBackupTaskFunc::addTask(tr, taskBucket, task, TaskCompletionKey::signal(onDone))); - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor10*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor10*>(this)->actor_wait_state = 2; - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); - #line 17128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 1890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version beginVersion = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyBeginVersion], Unversioned()); - #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace config = Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(task->params[DatabaseBackupAgent::keyConfigLogUid]); - #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(config.pack(BackupAgentBase::destUid), task->params[BackupAgentBase::destUid]); - #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(config.pack(BackupAgentBase::keyDrVersion), BinaryWriter::toValue(DatabaseBackupAgent::LATEST_DR_VERSION, Unversioned())); - #line 1898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = success(CopyDiffLogsTaskFunc::addTask( tr, taskBucket, task, 0, beginVersion, TaskCompletionKey::signal(onDone))); - #line 1898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor10*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor10*>(this)->actor_wait_state = 3; - #line 1898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); - #line 17150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -17218,16 +17227,16 @@ class _finishActor10State { } int a_body1cont2(int loopDepth) { - #line 1902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = taskBucket->finish(tr, task); - #line 1902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor10*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont2when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor10*>(this)->actor_wait_state = 4; - #line 1902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); - #line 17230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -17384,9 +17393,9 @@ class _finishActor10State { } int a_body1cont5(Void const& _,int loopDepth) { - #line 1903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor10*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor10State(); static_cast<_finishActor10*>(this)->destroy(); return 0; } - #line 17389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor10*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor10State(); static_cast<_finishActor10*>(this)->finishSendAndDelPromiseRef(); @@ -17396,9 +17405,9 @@ class _finishActor10State { } int a_body1cont5(Void && _,int loopDepth) { - #line 1903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor10*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor10State(); static_cast<_finishActor10*>(this)->destroy(); return 0; } - #line 17401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor10*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor10State(); static_cast<_finishActor10*>(this)->finishSendAndDelPromiseRef(); @@ -17469,22 +17478,22 @@ class _finishActor10State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 3); } - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 1884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference onDone; - #line 17482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor10 final : public Actor, public ActorCallback< _finishActor10, 0, Void >, public ActorCallback< _finishActor10, 1, Void >, public ActorCallback< _finishActor10, 2, Void >, public ActorCallback< _finishActor10, 3, Void >, public FastAllocated<_finishActor10>, public _finishActor10State<_finishActor10> { - #line 17487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor10>::operator new; using FastAllocated<_finishActor10>::operator delete; @@ -17496,9 +17505,9 @@ friend struct ActorCallback< _finishActor10, 0, Void >; friend struct ActorCallback< _finishActor10, 1, Void >; friend struct ActorCallback< _finishActor10, 2, Void >; friend struct ActorCallback< _finishActor10, 3, Void >; - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor10(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 17501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _finishActor10State<_finishActor10>(tr, taskBucket, futureBucket, task) { @@ -17524,14 +17533,14 @@ friend struct ActorCallback< _finishActor10, 3, Void >; } }; - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _finishActor10(tr, taskBucket, futureBucket, task)); - #line 17531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StringRef getName() const override { return name; }; @@ -17548,35 +17557,35 @@ friend struct ActorCallback< _finishActor10, 3, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef CopyDiffLogsUpgradeTaskFunc::name = LiteralStringRef("db_copy_diff_logs"); +StringRef CopyDiffLogsUpgradeTaskFunc::name = "db_copy_diff_logs"_sr; REGISTER_TASKFUNC(CopyDiffLogsUpgradeTaskFunc); struct BackupRestorableTaskFunc : TaskFuncBase { static StringRef name; static constexpr uint32_t version = 1; - #line 17558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor7State { - #line 17564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor7State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : cx(cx), - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 1932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" sourceStates(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keySourceStates) .get(task->params[BackupAgentBase::keyConfigLogUid])) - #line 17579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -17589,16 +17598,16 @@ class _executeActor7State { int a_body1(int loopDepth=0) { try { - #line 1935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(cx, task, BackupRestorableTaskFunc::name, BackupRestorableTaskFunc::version); - #line 1935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 1; - #line 1935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 17601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -17619,22 +17628,22 @@ class _executeActor7State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = Transaction(taskBucket->src); - #line 1937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 17626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = Transaction(taskBucket->src); - #line 1937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 17637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -17712,24 +17721,24 @@ class _executeActor7State { int a_body1cont1loopBody1(int loopDepth) { try { - #line 1939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.addReadConflictRange(singleKeyRange(sourceStates.pack(DatabaseBackupAgent::keyStateStatus))); - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.set(sourceStates.pack(DatabaseBackupAgent::keyStateStatus), StringRef(BackupAgentBase::getStateText(EBackupState::STATE_RUNNING_DIFFERENTIAL))); - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key versionKey = task->params[DatabaseBackupAgent::keyConfigLogUid] .withPrefix(task->params[BackupAgentBase::destUid]) .withPrefix(backupLatestVersionsPrefix); - #line 1947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_1 = tr.get(versionKey); - #line 1947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 17727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 2; - #line 1947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast<_executeActor7*>(this))); - #line 17732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -17749,16 +17758,16 @@ class _executeActor7State { int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = tr.onError(e); - #line 1957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 17756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 4; - #line 1957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 17761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -17771,60 +17780,60 @@ class _executeActor7State { } int a_body1cont1loopBody1cont2(Optional const& prevBeginVersion,int loopDepth) { - #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!prevBeginVersion.present()) - #line 17776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor7*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor7State(); static_cast<_executeActor7*>(this)->destroy(); return 0; } - #line 17780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor7*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor7State(); static_cast<_executeActor7*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyPrevBeginVersion] = prevBeginVersion.get(); - #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr.commit(); - #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 17792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 3; - #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 17797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont2(Optional && prevBeginVersion,int loopDepth) { - #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!prevBeginVersion.present()) - #line 17806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor7*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor7State(); static_cast<_executeActor7*>(this)->destroy(); return 0; } - #line 17810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor7*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor7State(); static_cast<_executeActor7*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyPrevBeginVersion] = prevBeginVersion.get(); - #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr.commit(); - #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 17822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 3; - #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 17827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -17894,9 +17903,9 @@ class _executeActor7State { } int a_body1cont1loopBody1cont3(Void const& _,int loopDepth) { - #line 1955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor7*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor7State(); static_cast<_executeActor7*>(this)->destroy(); return 0; } - #line 17899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor7*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor7State(); static_cast<_executeActor7*>(this)->finishSendAndDelPromiseRef(); @@ -17906,9 +17915,9 @@ class _executeActor7State { } int a_body1cont1loopBody1cont3(Void && _,int loopDepth) { - #line 1955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor7*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor7State(); static_cast<_executeActor7*>(this)->destroy(); return 0; } - #line 17911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 17920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor7*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor7State(); static_cast<_executeActor7*>(this)->finishSendAndDelPromiseRef(); @@ -18054,24 +18063,24 @@ class _executeActor7State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 3); } - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 1932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace sourceStates; - #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Transaction tr; - #line 18069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor7 final : public Actor, public ActorCallback< _executeActor7, 0, Void >, public ActorCallback< _executeActor7, 1, Optional >, public ActorCallback< _executeActor7, 2, Void >, public ActorCallback< _executeActor7, 3, Void >, public FastAllocated<_executeActor7>, public _executeActor7State<_executeActor7> { - #line 18074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor7>::operator new; using FastAllocated<_executeActor7>::operator delete; @@ -18083,9 +18092,9 @@ friend struct ActorCallback< _executeActor7, 0, Void >; friend struct ActorCallback< _executeActor7, 1, Optional >; friend struct ActorCallback< _executeActor7, 2, Void >; friend struct ActorCallback< _executeActor7, 3, Void >; - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor7(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 18088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _executeActor7State<_executeActor7>(cx, taskBucket, futureBucket, task) { @@ -18111,39 +18120,39 @@ friend struct ActorCallback< _executeActor7, 3, Void >; } }; - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _executeActor7(cx, taskBucket, futureBucket, task)); - #line 18118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 1961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 18123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor11State { - #line 18129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor11State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 1966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" conf(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(task->params[BackupAgentBase::keyConfigLogUid])), - #line 1969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" states(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyStates) .get(task->params[BackupAgentBase::keyConfigLogUid])) - #line 18146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -18156,16 +18165,16 @@ class _finishActor11State { int a_body1(int loopDepth=0) { try { - #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(tr, task, BackupRestorableTaskFunc::name, BackupRestorableTaskFunc::version); - #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor11*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor11*>(this)->actor_wait_state = 1; - #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor11*>(this))); - #line 18168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -18186,36 +18195,36 @@ class _finishActor11State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" onDone = futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone]); - #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_1 = tr->get(states.pack(DatabaseBackupAgent::keyStateStop)); - #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor11*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor11*>(this)->actor_wait_state = 2; - #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast<_finishActor11*>(this))); - #line 18200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" onDone = futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone]); - #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_1 = tr->get(states.pack(DatabaseBackupAgent::keyStateStop)); - #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor11*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor11*>(this)->actor_wait_state = 2; - #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast<_finishActor11*>(this))); - #line 18218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -18285,27 +18294,27 @@ class _finishActor11State { } int a_body1cont2(int loopDepth) { - #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" restoreVersion = stopValue.present() ? BinaryReader::fromStringRef(stopValue.get(), Unversioned()) : -1; - #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_2 = tr->get(conf.pack(DatabaseBackupAgent::keyConfigStopWhenDoneKey)); - #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor11*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor11*>(this)->actor_wait_state = 3; - #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast<_finishActor11*>(this))); - #line 18299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1when1(Optional const& __stopValue,int loopDepth) { - #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" stopValue = __stopValue; - #line 18308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -18370,44 +18379,44 @@ class _finishActor11State { } int a_body1cont3(int loopDepth) { - #line 1981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" allPartsDone = Reference(); - #line 1983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - TraceEvent("DBA_Complete") .detail("RestoreVersion", restoreVersion) .detail("Differential", stopWhenDone.present()) .detail("LogUID", task->params[BackupAgentBase::keyConfigLogUid]); #line 1989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + TraceEvent("DBA_Complete") .detail("RestoreVersion", restoreVersion) .detail("Differential", stopWhenDone.present()) .detail("LogUID", task->params[BackupAgentBase::keyConfigLogUid]); + #line 1995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (stopWhenDone.present()) - #line 18379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 1991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = success(FinishedFullBackupTaskFunc::addTask(tr, taskBucket, task, TaskCompletionKey::noSignal())); - #line 1991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor11*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor11*>(this)->actor_wait_state = 4; - #line 1991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor11*>(this))); - #line 18390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(states.pack(DatabaseBackupAgent::keyStateStatus), StringRef(BackupAgentBase::getStateText(EBackupState::STATE_RUNNING_DIFFERENTIAL))); - #line 1996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" allPartsDone = futureBucket->future(tr); - #line 1998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version prevBeginVersion = BinaryReader::fromStringRef( task->params[DatabaseBackupAgent::keyPrevBeginVersion], Unversioned()); - #line 2000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = success(CopyDiffLogsTaskFunc::addTask( tr, taskBucket, task, prevBeginVersion, restoreVersion, TaskCompletionKey::joinWith(allPartsDone))); - #line 2000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor11*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont3when2(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor11*>(this)->actor_wait_state = 5; - #line 2000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor11*>(this))); - #line 18410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -18415,9 +18424,9 @@ class _finishActor11State { } int a_body1cont2when1(Optional const& __stopWhenDone,int loopDepth) { - #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" stopWhenDone = __stopWhenDone; - #line 18420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; @@ -18482,16 +18491,16 @@ class _finishActor11State { } int a_body1cont4(int loopDepth) { - #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = taskBucket->finish(tr, task); - #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor11*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont4when1(__when_expr_6.get(), loopDepth); }; static_cast<_finishActor11*>(this)->actor_wait_state = 7; - #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_finishActor11*>(this))); - #line 18494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -18573,32 +18582,32 @@ class _finishActor11State { } int a_body1cont6(Void const& _,int loopDepth) { - #line 2004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_5 = success(FinishedFullBackupTaskFunc::addTask( tr, taskBucket, task, TaskCompletionKey::noSignal(), allPartsDone)); - #line 2004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor11*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont6when1(__when_expr_5.get(), loopDepth); }; static_cast<_finishActor11*>(this)->actor_wait_state = 6; - #line 2004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_finishActor11*>(this))); - #line 18585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont6(Void && _,int loopDepth) { - #line 2004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_5 = success(FinishedFullBackupTaskFunc::addTask( tr, taskBucket, task, TaskCompletionKey::noSignal(), allPartsDone)); - #line 2004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor11*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont6when1(__when_expr_5.get(), loopDepth); }; static_cast<_finishActor11*>(this)->actor_wait_state = 6; - #line 2004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_finishActor11*>(this))); - #line 18601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -18743,9 +18752,9 @@ class _finishActor11State { } int a_body1cont8(Void const& _,int loopDepth) { - #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor11*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor11State(); static_cast<_finishActor11*>(this)->destroy(); return 0; } - #line 18748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor11*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor11State(); static_cast<_finishActor11*>(this)->finishSendAndDelPromiseRef(); @@ -18755,9 +18764,9 @@ class _finishActor11State { } int a_body1cont8(Void && _,int loopDepth) { - #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor11*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor11State(); static_cast<_finishActor11*>(this)->destroy(); return 0; } - #line 18760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor11*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor11State(); static_cast<_finishActor11*>(this)->finishSendAndDelPromiseRef(); @@ -18828,34 +18837,34 @@ class _finishActor11State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 6); } - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 1966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace conf; - #line 1969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace states; - #line 1974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference onDone; - #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Optional stopValue; - #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version restoreVersion; - #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Optional stopWhenDone; - #line 1981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference allPartsDone; - #line 18853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor11 final : public Actor, public ActorCallback< _finishActor11, 0, Void >, public ActorCallback< _finishActor11, 1, Optional >, public ActorCallback< _finishActor11, 2, Optional >, public ActorCallback< _finishActor11, 3, Void >, public ActorCallback< _finishActor11, 4, Void >, public ActorCallback< _finishActor11, 5, Void >, public ActorCallback< _finishActor11, 6, Void >, public FastAllocated<_finishActor11>, public _finishActor11State<_finishActor11> { - #line 18858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor11>::operator new; using FastAllocated<_finishActor11>::operator delete; @@ -18870,9 +18879,9 @@ friend struct ActorCallback< _finishActor11, 3, Void >; friend struct ActorCallback< _finishActor11, 4, Void >; friend struct ActorCallback< _finishActor11, 5, Void >; friend struct ActorCallback< _finishActor11, 6, Void >; - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor11(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 18875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _finishActor11State<_finishActor11>(tr, taskBucket, futureBucket, task) { @@ -18901,37 +18910,37 @@ friend struct ActorCallback< _finishActor11, 6, Void >; } }; - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _finishActor11(tr, taskBucket, futureBucket, task)); - #line 18908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 2011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 18913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor9State { - #line 18919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor9State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" parentTask(parentTask), - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" completionKey(completionKey), - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" waitFor(waitFor) - #line 18934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -18944,16 +18953,16 @@ class AddTaskActor9State { int a_body1(int loopDepth=0) { try { - #line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 18956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -18974,64 +18983,64 @@ class AddTaskActor9State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(BackupRestorableTaskFunc::name, BackupRestorableTaskFunc::version, doneKey); - #line 2020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 18983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor9State(); static_cast(this)->destroy(); return 0; } - #line 18987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 18996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor9State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 2029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(BackupRestorableTaskFunc::name, BackupRestorableTaskFunc::version, doneKey); - #line 2020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" copyDefaultParameters(parentTask, task); - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 19015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor9State(); static_cast(this)->destroy(); return 0; } - #line 19019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor9State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, parentTask->params[Task::reservedTaskParamValidKey], task->params[BackupAgentBase::keyFolderId]); - #line 2029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 19029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -19101,10 +19110,10 @@ class AddTaskActor9State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor9State(); static_cast(this)->destroy(); return 0; } - #line 19106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 2040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor9State(); static_cast(this)->destroy(); return 0; } + #line 19115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor9State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -19113,10 +19122,10 @@ class AddTaskActor9State { } int a_body1cont2(Void && _,int loopDepth) { - #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor9State(); static_cast(this)->destroy(); return 0; } - #line 19118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 2040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor9State(); static_cast(this)->destroy(); return 0; } + #line 19127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor9State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -19186,22 +19195,22 @@ class AddTaskActor9State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 1); } - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference parentTask; - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference waitFor; - #line 19199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor9 final : public Actor, public ActorCallback< AddTaskActor9, 0, Key >, public ActorCallback< AddTaskActor9, 1, Void >, public FastAllocated, public AddTaskActor9State { - #line 19204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -19211,9 +19220,9 @@ class AddTaskActor9 final : public Actor, public ActorCallback< AddTaskActo #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor9, 0, Key >; friend struct ActorCallback< AddTaskActor9, 1, Void >; - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor9(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 19216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), AddTaskActor9State(tr, taskBucket, parentTask, completionKey, waitFor) { @@ -19237,14 +19246,14 @@ friend struct ActorCallback< AddTaskActor9, 1, Void >; } }; - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new AddTaskActor9(tr, taskBucket, parentTask, completionKey, waitFor)); - #line 19244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 2036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 2042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StringRef getName() const override { return name; }; @@ -19261,37 +19270,37 @@ friend struct ActorCallback< AddTaskActor9, 1, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef BackupRestorableTaskFunc::name = LiteralStringRef("dr_backup_restorable"); +StringRef BackupRestorableTaskFunc::name = "dr_backup_restorable"_sr; REGISTER_TASKFUNC(BackupRestorableTaskFunc); struct StartFullBackupTaskFunc : TaskFuncBase { static StringRef name; static constexpr uint32_t version = 1; - #line 19271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor8State { - #line 19277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor8State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : cx(cx), - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 2063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUidValue(task->params[DatabaseBackupAgent::keyConfigLogUid]), - #line 2064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" sourceStates(Subspace(databaseBackupPrefixRange.begin).get(BackupAgentBase::keySourceStates).get(logUidValue)) - #line 19294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -19304,16 +19313,16 @@ class _executeActor8State { int a_body1(int loopDepth=0) { try { - #line 2066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(cx, task, StartFullBackupTaskFunc::name, StartFullBackupTaskFunc::version); - #line 2066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 19311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 1; - #line 2066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor8*>(this))); - #line 19316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -19334,34 +19343,34 @@ class _executeActor8State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 2067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUidValue = Key(logUidValue); - #line 2069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRanges = BinaryReader::fromStringRef>>( task->params[DatabaseBackupAgent::keyConfigBackupRanges], IncludeVersion()); - #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersionKey = Key(); - #line 2074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr = Reference(new ReadYourWritesTransaction(taskBucket->src)); - #line 2075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 19347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 2067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUidValue = Key(logUidValue); - #line 2069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRanges = BinaryReader::fromStringRef>>( task->params[DatabaseBackupAgent::keyConfigBackupRanges], IncludeVersion()); - #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersionKey = Key(); - #line 2074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr = Reference(new ReadYourWritesTransaction(taskBucket->src)); - #line 2075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 19364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -19431,9 +19440,9 @@ class _executeActor8State { } int a_body1cont2(int loopDepth) { - #line 2120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 19436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopHead1(loopDepth); return loopDepth; @@ -19448,24 +19457,24 @@ class _executeActor8State { int a_body1cont1loopBody1(int loopDepth) { try { - #line 2077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (backupRanges.size() == 1) - #line 19457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (backupRanges.size() == 1 || isDefaultBackup(backupRanges)) + #line 19466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = srcTr->getRange( KeyRangeRef(destUidLookupPrefix, strinc(destUidLookupPrefix)), CLIENT_KNOBS->TOO_MANY); - #line 2082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 19463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 2; - #line 2082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor8*>(this))); - #line 19468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -19503,16 +19512,16 @@ class _executeActor8State { int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_5 = srcTr->onError(e); - #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 19510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_5.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 6; - #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_executeActor8*>(this))); - #line 19515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -19525,47 +19534,53 @@ class _executeActor8State { } int a_body1cont1loopBody1cont2(int loopDepth) { - #line 2102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = srcTr->getReadVersion(); - #line 2102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 19532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 3; - #line 2102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor8*>(this))); - #line 19537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont3(RangeResult const& existingDestUidValues,int loopDepth) { - #line 2084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + KeyRangeRef targetRange = (backupRanges.size() == 1) ? backupRanges[0] : getDefaultBackupSharedRange(); + #line 2092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool found = false; - #line 2085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto it : existingDestUidValues ) { - #line 2086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (BinaryReader::fromStringRef(it.key.removePrefix(destUidLookupPrefix), IncludeVersion()) == backupRanges[0]) - #line 19550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + KeyRange uidRange = BinaryReader::fromStringRef( it.key.removePrefix(destUidLookupPrefix), IncludeVersion()); + #line 2096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (uidRange == targetRange) + #line 19563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUidValue = it.value; - #line 2089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" found = true; - #line 19556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + CODE_PROBE(targetRange == getDefaultBackupSharedRange(), "DR mutation sharing with default backup"); + #line 19571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" break; } } - #line 2093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!found) - #line 19562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUidValue = BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned()); - #line 2095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - srcTr->set(BinaryWriter::toValue(backupRanges[0], IncludeVersion(ProtocolVersion::withSharedMutations())) .withPrefix(destUidLookupPrefix), destUidValue); - #line 19568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + srcTr->set( BinaryWriter::toValue(targetRange, IncludeVersion(ProtocolVersion::withSharedMutations())) .withPrefix(destUidLookupPrefix), destUidValue); + #line 19583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } loopDepth = a_body1cont1loopBody1cont2(loopDepth); @@ -19573,31 +19588,37 @@ class _executeActor8State { } int a_body1cont1loopBody1cont3(RangeResult && existingDestUidValues,int loopDepth) { - #line 2084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + KeyRangeRef targetRange = (backupRanges.size() == 1) ? backupRanges[0] : getDefaultBackupSharedRange(); + #line 2092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bool found = false; - #line 2085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto it : existingDestUidValues ) { - #line 2086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (BinaryReader::fromStringRef(it.key.removePrefix(destUidLookupPrefix), IncludeVersion()) == backupRanges[0]) - #line 19582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + KeyRange uidRange = BinaryReader::fromStringRef( it.key.removePrefix(destUidLookupPrefix), IncludeVersion()); + #line 2096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (uidRange == targetRange) + #line 19601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUidValue = it.value; - #line 2089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" found = true; - #line 19588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + CODE_PROBE(targetRange == getDefaultBackupSharedRange(), "DR mutation sharing with default backup"); + #line 19609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" break; } } - #line 2093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!found) - #line 19594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUidValue = BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned()); - #line 2095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - srcTr->set(BinaryWriter::toValue(backupRanges[0], IncludeVersion(ProtocolVersion::withSharedMutations())) .withPrefix(destUidLookupPrefix), destUidValue); - #line 19600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 2106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + srcTr->set( BinaryWriter::toValue(targetRange, IncludeVersion(ProtocolVersion::withSharedMutations())) .withPrefix(destUidLookupPrefix), destUidValue); + #line 19621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } loopDepth = a_body1cont1loopBody1cont2(loopDepth); @@ -19668,40 +19689,40 @@ class _executeActor8State { } int a_body1cont1loopBody1cont8(Version const& bVersion,int loopDepth) { - #line 2103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersionKey = BinaryWriter::toValue(bVersion, Unversioned()); - #line 2105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" versionKey = logUidValue.withPrefix(destUidValue).withPrefix(backupLatestVersionsPrefix); - #line 2106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_3 = srcTr->get(versionKey); - #line 2106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 19679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont8when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 4; - #line 2106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast<_executeActor8*>(this))); - #line 19684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont8(Version && bVersion,int loopDepth) { - #line 2103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersionKey = BinaryWriter::toValue(bVersion, Unversioned()); - #line 2105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" versionKey = logUidValue.withPrefix(destUidValue).withPrefix(backupLatestVersionsPrefix); - #line 2106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_3 = srcTr->get(versionKey); - #line 2106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 19699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont8when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 4; - #line 2106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast<_executeActor8*>(this))); - #line 19704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -19771,52 +19792,52 @@ class _executeActor8State { } int a_body1cont1loopBody1cont9(Optional const& versionRecord,int loopDepth) { - #line 2107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!versionRecord.present()) - #line 19776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->set(versionKey, beginVersionKey); - #line 19780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::destUid] = destUidValue; - #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = srcTr->commit(); - #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 19788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont1loopBody1cont9when1(__when_expr_4.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 5; - #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor8*>(this))); - #line 19793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont9(Optional && versionRecord,int loopDepth) { - #line 2107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!versionRecord.present()) - #line 19802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->set(versionKey, beginVersionKey); - #line 19806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::destUid] = destUidValue; - #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = srcTr->commit(); - #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 19814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont1loopBody1cont9when1(__when_expr_4.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 5; - #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor8*>(this))); - #line 19819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 19840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -20036,11 +20057,11 @@ class _executeActor8State { } int a_body1cont3(int loopDepth) { - #line 2151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr2 = Reference(new ReadYourWritesTransaction(taskBucket->src)); - #line 2152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 20043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont3loopHead1(loopDepth); return loopDepth; @@ -20054,26 +20075,26 @@ class _executeActor8State { } int a_body1cont2loopBody1(int loopDepth) { - #line 2121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 20059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" try { - #line 2123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" verified = taskBucket->keepRunning(tr, task); - #line 2126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = verified; - #line 2126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont2loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont2loopBody1when1(__when_expr_6.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 7; - #line 2126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor8*>(this))); - #line 20076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -20106,18 +20127,18 @@ class _executeActor8State { int a_body1cont2loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("SetDestUidOrBeginVersionError").errorUnsuppressed(e); - #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_9 = tr->onError(e); - #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 20115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1Catch1when1(__when_expr_9.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 10; - #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_executeActor8*>(this))); - #line 20120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -20130,40 +20151,40 @@ class _executeActor8State { } int a_body1cont2loopBody1cont2(Void const& _,int loopDepth) { - #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" config = Subspace(databaseBackupPrefixRange.begin).get(BackupAgentBase::keyConfig).get(logUidValue); - #line 2131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(config.pack(BackupAgentBase::destUid), task->params[BackupAgentBase::destUid]); - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_7 = tr->get(config.pack(BackupAgentBase::backupStartVersion)); - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont2loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_7.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 8; - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast >*>(static_cast<_executeActor8*>(this))); - #line 20146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2loopBody1cont2(Void && _,int loopDepth) { - #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" config = Subspace(databaseBackupPrefixRange.begin).get(BackupAgentBase::keyConfig).get(logUidValue); - #line 2131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(config.pack(BackupAgentBase::destUid), task->params[BackupAgentBase::destUid]); - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_7 = tr->get(config.pack(BackupAgentBase::backupStartVersion)); - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont2loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_7.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 8; - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast >*>(static_cast<_executeActor8*>(this))); - #line 20166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -20233,64 +20254,64 @@ class _executeActor8State { } int a_body1cont2loopBody1cont3(Optional const& backupStartVersion,int loopDepth) { - #line 2135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupStartVersion.present()) - #line 20238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersionKey = backupStartVersion.get(); - #line 20242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } else { - #line 2138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(config.pack(BackupAgentBase::backupStartVersion), beginVersionKey); - #line 20248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::keyBeginVersion] = beginVersionKey; - #line 2143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_8 = tr->commit(); - #line 2143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont2loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont2loopBody1cont3when1(__when_expr_8.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 9; - #line 2143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor8*>(this))); - #line 20261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2loopBody1cont3(Optional && backupStartVersion,int loopDepth) { - #line 2135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupStartVersion.present()) - #line 20270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersionKey = backupStartVersion.get(); - #line 20274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } else { - #line 2138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(config.pack(BackupAgentBase::backupStartVersion), beginVersionKey); - #line 20280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::keyBeginVersion] = beginVersionKey; - #line 2143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_8 = tr->commit(); - #line 2143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont2loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont2loopBody1cont3when1(__when_expr_8.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 9; - #line 2143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor8*>(this))); - #line 20293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -20510,11 +20531,11 @@ class _executeActor8State { } int a_body1cont4(int loopDepth) { - #line 2188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr3 = Reference(new ReadYourWritesTransaction(taskBucket->src)); - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 20517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont4loopHead1(loopDepth); return loopDepth; @@ -20529,20 +20550,20 @@ class _executeActor8State { int a_body1cont3loopBody1(int loopDepth) { try { - #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr2->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr2->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_10 = srcTr2->get(sourceStates.pack(DatabaseBackupAgent::keyFolderId)); - #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1cont3loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont3loopBody1when1(__when_expr_10.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 11; - #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast >*>(static_cast<_executeActor8*>(this))); - #line 20545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -20575,16 +20596,16 @@ class _executeActor8State { int a_body1cont3loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_12 = srcTr2->onError(e); - #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 20582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_12.isReady()) { if (__when_expr_12.isError()) return a_body1Catch1(__when_expr_12.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1Catch1when1(__when_expr_12.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 13; - #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_12.addCallbackAndClear(static_cast*>(static_cast<_executeActor8*>(this))); - #line 20587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -20597,51 +20618,51 @@ class _executeActor8State { } int a_body1cont3loopBody1cont2(int loopDepth) { - #line 2159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (v.present() && BinaryReader::fromStringRef(v.get(), Unversioned()) >= BinaryReader::fromStringRef( task->params[DatabaseBackupAgent::keyFolderId], Unversioned())) - #line 20602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor8*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor8State(); static_cast<_executeActor8*>(this)->destroy(); return 0; } - #line 20606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor8*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor8State(); static_cast<_executeActor8*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr2->set(Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keySourceTagName) .pack(task->params[BackupAgentBase::keyTagName]), logUidValue); - #line 2168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr2->set(sourceStates.pack(DatabaseBackupAgent::keyFolderId), task->params[DatabaseBackupAgent::keyFolderId]); - #line 2170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr2->set(sourceStates.pack(DatabaseBackupAgent::keyStateStatus), StringRef(BackupAgentBase::getStateText(EBackupState::STATE_RUNNING))); - #line 2173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destPath = destUidValue.withPrefix(backupLogKeys.begin); - #line 2175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto& backupRange : backupRanges ) { - #line 2176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr2->set(logRangesEncodeKey(backupRange.begin, BinaryReader::fromStringRef(destUidValue, Unversioned())), logRangesEncodeValue(backupRange.end, destPath)); - #line 20624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_11 = srcTr2->commit(); - #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1cont3loopBody1Catch1(__when_expr_11.getError(), loopDepth); else return a_body1cont3loopBody1cont2when1(__when_expr_11.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 12; - #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_11.addCallbackAndClear(static_cast*>(static_cast<_executeActor8*>(this))); - #line 20635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3loopBody1when1(Optional const& __v,int loopDepth) { - #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" v = __v; - #line 20644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont3loopBody1cont2(loopDepth); return loopDepth; @@ -20856,9 +20877,9 @@ class _executeActor8State { } int a_body1cont5(int loopDepth) { - #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_executeActor8*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor8State(); static_cast<_executeActor8*>(this)->destroy(); return 0; } - #line 20861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_executeActor8*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor8State(); static_cast<_executeActor8*>(this)->finishSendAndDelPromiseRef(); @@ -20876,22 +20897,22 @@ class _executeActor8State { int a_body1cont4loopBody1(int loopDepth) { try { - #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr3->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr3->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr3->atomicOp(metadataVersionKey, metadataVersionRequiredValue, MutationRef::SetVersionstampedValue); - #line 2196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_13 = srcTr3->commit(); - #line 2196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_13.isReady()) { if (__when_expr_13.isError()) return a_body1cont4loopBody1Catch1(__when_expr_13.getError(), loopDepth); else return a_body1cont4loopBody1when1(__when_expr_13.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 14; - #line 2196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_13.addCallbackAndClear(static_cast*>(static_cast<_executeActor8*>(this))); - #line 20894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -20924,16 +20945,16 @@ class _executeActor8State { int a_body1cont4loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_14 = srcTr3->onError(e); - #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_executeActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 20931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_14.isReady()) { if (__when_expr_14.isError()) return a_body1Catch1(__when_expr_14.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1Catch1when1(__when_expr_14.get(), loopDepth); }; static_cast<_executeActor8*>(this)->actor_wait_state = 15; - #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_14.addCallbackAndClear(static_cast*>(static_cast<_executeActor8*>(this))); - #line 20936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 20957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -21094,48 +21115,48 @@ class _executeActor8State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 14); } - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 2063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key logUidValue; - #line 2064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace sourceStates; - #line 2067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key destUidValue; - #line 2069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Standalone> backupRanges; - #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key beginVersionKey; - #line 2074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference srcTr; - #line 2105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key versionKey; - #line 2121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 2125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future verified; - #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace config; - #line 2151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference srcTr2; - #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Optional v; - #line 2173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key destPath; - #line 2188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference srcTr3; - #line 21133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _executeActor8 final : public Actor, public ActorCallback< _executeActor8, 0, Void >, public ActorCallback< _executeActor8, 1, RangeResult >, public ActorCallback< _executeActor8, 2, Version >, public ActorCallback< _executeActor8, 3, Optional >, public ActorCallback< _executeActor8, 4, Void >, public ActorCallback< _executeActor8, 5, Void >, public ActorCallback< _executeActor8, 6, Void >, public ActorCallback< _executeActor8, 7, Optional >, public ActorCallback< _executeActor8, 8, Void >, public ActorCallback< _executeActor8, 9, Void >, public ActorCallback< _executeActor8, 10, Optional >, public ActorCallback< _executeActor8, 11, Void >, public ActorCallback< _executeActor8, 12, Void >, public ActorCallback< _executeActor8, 13, Void >, public ActorCallback< _executeActor8, 14, Void >, public FastAllocated<_executeActor8>, public _executeActor8State<_executeActor8> { - #line 21138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor8>::operator new; using FastAllocated<_executeActor8>::operator delete; @@ -21158,9 +21179,9 @@ friend struct ActorCallback< _executeActor8, 11, Void >; friend struct ActorCallback< _executeActor8, 12, Void >; friend struct ActorCallback< _executeActor8, 13, Void >; friend struct ActorCallback< _executeActor8, 14, Void >; - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _executeActor8(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 21163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _executeActor8State<_executeActor8>(cx, taskBucket, futureBucket, task) { @@ -21197,45 +21218,45 @@ friend struct ActorCallback< _executeActor8, 14, Void >; } }; - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _executeActor8(cx, taskBucket, futureBucket, task)); - #line 21204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 2205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 2216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 21209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor12State { - #line 21215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor12State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task(task), - #line 2210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUidValue(task->params[BackupAgentBase::keyConfigLogUid]), - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" states(Subspace(databaseBackupPrefixRange.begin).get(BackupAgentBase::keyStates).get(logUidValue)), - #line 2213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" config(Subspace(databaseBackupPrefixRange.begin).get(BackupAgentBase::keyConfig).get(logUidValue)), - #line 2216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion(BinaryReader::fromStringRef(task->params[BackupAgentBase::keyBeginVersion], Unversioned())), - #line 2218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRanges(BinaryReader::fromStringRef>>( task->params[DatabaseBackupAgent::keyConfigBackupRanges], IncludeVersion())) - #line 21238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -21248,32 +21269,32 @@ class _finishActor12State { int a_body1(int loopDepth=0) { try { - #line 2222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(logUidValue.withPrefix(applyMutationsBeginRange.begin), BinaryWriter::toValue(beginVersion, Unversioned())); - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(logUidValue.withPrefix(applyMutationsEndRange.begin), BinaryWriter::toValue(beginVersion, Unversioned())); - #line 2226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(states.pack(DatabaseBackupAgent::keyStateStatus), StringRef(BackupAgentBase::getStateText(EBackupState::STATE_RUNNING))); - #line 2229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" kvBackupRangeComplete = futureBucket->future(tr); - #line 2230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" kvBackupComplete = futureBucket->future(tr); - #line 2231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" rangeCount = 0; - #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (task->params[DatabaseBackupAgent::keyDatabasesInSync] != std::string("t")) - #line 21265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 21269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } else { - #line 2243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" kvBackupRangeComplete->set(tr, taskBucket); - #line 21276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); } } @@ -21295,16 +21316,16 @@ class _finishActor12State { } int a_body1cont1(int loopDepth) { - #line 2247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = success(FinishFullBackupTaskFunc::addTask( tr, taskBucket, task, TaskCompletionKey::noSignal(), kvBackupRangeComplete)); - #line 2247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor12*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor12*>(this)->actor_wait_state = 2; - #line 2247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor12*>(this))); - #line 21307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -21324,22 +21345,22 @@ class _finishActor12State { } int a_body1loopBody1(int loopDepth) { - #line 2234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!(rangeCount < backupRanges.size())) - #line 21329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 2235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = success(BackupRangeTaskFunc::addTask(tr, taskBucket, task, backupRanges[rangeCount].begin, backupRanges[rangeCount].end, TaskCompletionKey::joinWith(kvBackupRangeComplete))); - #line 2235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor12*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 21337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor12*>(this)->actor_wait_state = 1; - #line 2235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor12*>(this))); - #line 21342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -21359,18 +21380,18 @@ class _finishActor12State { } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 2234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ++rangeCount; - #line 21364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 2234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ++rangeCount; - #line 21373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -21440,32 +21461,32 @@ class _finishActor12State { } int a_body1cont4(Void const& _,int loopDepth) { - #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = success(CopyLogsTaskFunc::addTask( tr, taskBucket, task, 0, beginVersion, TaskCompletionKey::joinWith(kvBackupComplete))); - #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor12*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont4when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor12*>(this)->actor_wait_state = 3; - #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor12*>(this))); - #line 21452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4(Void && _,int loopDepth) { - #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = success(CopyLogsTaskFunc::addTask( tr, taskBucket, task, 0, beginVersion, TaskCompletionKey::joinWith(kvBackupComplete))); - #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor12*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont4when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor12*>(this)->actor_wait_state = 3; - #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor12*>(this))); - #line 21468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -21535,32 +21556,32 @@ class _finishActor12State { } int a_body1cont5(Void const& _,int loopDepth) { - #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = success( BackupRestorableTaskFunc::addTask(tr, taskBucket, task, TaskCompletionKey::noSignal(), kvBackupComplete)); - #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor12*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor12*>(this)->actor_wait_state = 4; - #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor12*>(this))); - #line 21547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont5(Void && _,int loopDepth) { - #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = success( BackupRestorableTaskFunc::addTask(tr, taskBucket, task, TaskCompletionKey::noSignal(), kvBackupComplete)); - #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor12*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor12*>(this)->actor_wait_state = 4; - #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor12*>(this))); - #line 21563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -21630,32 +21651,32 @@ class _finishActor12State { } int a_body1cont6(Void const& _,int loopDepth) { - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = taskBucket->finish(tr, task); - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor12*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor12*>(this)->actor_wait_state = 5; - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor12*>(this))); - #line 21642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont6(Void && _,int loopDepth) { - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = taskBucket->finish(tr, task); - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast<_finishActor12*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor12*>(this)->actor_wait_state = 5; - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor12*>(this))); - #line 21658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -21725,9 +21746,9 @@ class _finishActor12State { } int a_body1cont7(Void const& _,int loopDepth) { - #line 2259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor12*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor12State(); static_cast<_finishActor12*>(this)->destroy(); return 0; } - #line 21730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor12*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor12State(); static_cast<_finishActor12*>(this)->finishSendAndDelPromiseRef(); @@ -21737,9 +21758,9 @@ class _finishActor12State { } int a_body1cont7(Void && _,int loopDepth) { - #line 2259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast<_finishActor12*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor12State(); static_cast<_finishActor12*>(this)->destroy(); return 0; } - #line 21742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast<_finishActor12*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor12State(); static_cast<_finishActor12*>(this)->finishSendAndDelPromiseRef(); @@ -21810,36 +21831,36 @@ class _finishActor12State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 4); } - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference futureBucket; - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference task; - #line 2210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key logUidValue; - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace states; - #line 2213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Subspace config; - #line 2216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version beginVersion; - #line 2218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - Standalone> backupRanges; #line 2229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + Standalone> backupRanges; + #line 2240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference kvBackupRangeComplete; - #line 2230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference kvBackupComplete; - #line 2231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int rangeCount; - #line 21837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class _finishActor12 final : public Actor, public ActorCallback< _finishActor12, 0, Void >, public ActorCallback< _finishActor12, 1, Void >, public ActorCallback< _finishActor12, 2, Void >, public ActorCallback< _finishActor12, 3, Void >, public ActorCallback< _finishActor12, 4, Void >, public FastAllocated<_finishActor12>, public _finishActor12State<_finishActor12> { - #line 21842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor12>::operator new; using FastAllocated<_finishActor12>::operator delete; @@ -21852,9 +21873,9 @@ friend struct ActorCallback< _finishActor12, 1, Void >; friend struct ActorCallback< _finishActor12, 2, Void >; friend struct ActorCallback< _finishActor12, 3, Void >; friend struct ActorCallback< _finishActor12, 4, Void >; - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" _finishActor12(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 21857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), _finishActor12State<_finishActor12>(tr, taskBucket, futureBucket, task) { @@ -21881,49 +21902,49 @@ friend struct ActorCallback< _finishActor12, 4, Void >; } }; - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new _finishActor12(tr, taskBucket, futureBucket, task)); - #line 21888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 2261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 21893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor10State { - #line 21899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor10State(Reference const& tr,Reference const& taskBucket,Key const& logUid,Key const& backupUid,Key const& keyAddPrefix,Key const& keyRemovePrefix,Key const& keyConfigBackupRanges,Key const& tagName,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference(),DatabaseBackupAgent::PreBackupAction const& backupAction = DatabaseBackupAgent::PreBackupAction::VERIFY) - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : tr(tr), - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid(logUid), - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupUid(backupUid), - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" keyAddPrefix(keyAddPrefix), - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" keyRemovePrefix(keyRemovePrefix), - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" keyConfigBackupRanges(keyConfigBackupRanges), - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagName(tagName), - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" completionKey(completionKey), - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" waitFor(waitFor), - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupAction(backupAction) - #line 21926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -21936,16 +21957,16 @@ class AddTaskActor10State { int a_body1(int loopDepth=0) { try { - #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 21948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 21969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -21966,88 +21987,88 @@ class AddTaskActor10State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 2275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(StartFullBackupTaskFunc::name, StartFullBackupTaskFunc::version, doneKey); - #line 2277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::keyFolderId] = backupUid; - #line 2278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::keyConfigLogUid] = logUid; - #line 2279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyAddPrefix] = keyAddPrefix; - #line 2280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyRemovePrefix] = keyRemovePrefix; - #line 2281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::keyConfigBackupRanges] = keyConfigBackupRanges; - #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::keyTagName] = tagName; - #line 2283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - task->params[DatabaseBackupAgent::keyDatabasesInSync] = backupAction == DatabaseBackupAgent::PreBackupAction::NONE ? LiteralStringRef("t") : LiteralStringRef("f"); - #line 2286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + task->params[DatabaseBackupAgent::keyDatabasesInSync] = backupAction == DatabaseBackupAgent::PreBackupAction::NONE ? "t"_sr : "f"_sr; + #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 21987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(logUid) .pack(BackupAgentBase::keyFolderId), task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor10State(); static_cast(this)->destroy(); return 0; } - #line 21991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(logUid) .pack(BackupAgentBase::keyFolderId), task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor10State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(logUid) .pack(BackupAgentBase::keyFolderId), task->params[BackupAgentBase::keyFolderId]); - #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 22001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 22006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 2275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" auto task = makeReference(StartFullBackupTaskFunc::name, StartFullBackupTaskFunc::version, doneKey); - #line 2277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::keyFolderId] = backupUid; - #line 2278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::keyConfigLogUid] = logUid; - #line 2279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyAddPrefix] = keyAddPrefix; - #line 2280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[DatabaseBackupAgent::keyRemovePrefix] = keyRemovePrefix; - #line 2281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::keyConfigBackupRanges] = keyConfigBackupRanges; - #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" task->params[BackupAgentBase::keyTagName] = tagName; - #line 2283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - task->params[DatabaseBackupAgent::keyDatabasesInSync] = backupAction == DatabaseBackupAgent::PreBackupAction::NONE ? LiteralStringRef("t") : LiteralStringRef("f"); - #line 2286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + task->params[DatabaseBackupAgent::keyDatabasesInSync] = backupAction == DatabaseBackupAgent::PreBackupAction::NONE ? "t"_sr : "f"_sr; + #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!waitFor) - #line 22031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task, Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(logUid) .pack(BackupAgentBase::keyFolderId), task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor10State(); static_cast(this)->destroy(); return 0; } - #line 22035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task, Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(logUid) .pack(BackupAgentBase::keyFolderId), task->params[BackupAgentBase::keyFolderId])); this->~AddTaskActor10State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = waitFor->onSetAddTask(tr, taskBucket, task, Subspace(databaseBackupPrefixRange.begin) .get(BackupAgentBase::keyConfig) .get(logUid) .pack(BackupAgentBase::keyFolderId), task->params[BackupAgentBase::keyFolderId]); - #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 22045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 22050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -22117,10 +22138,10 @@ class AddTaskActor10State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 2304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor10State(); static_cast(this)->destroy(); return 0; } - #line 22122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor10State(); static_cast(this)->destroy(); return 0; } + #line 22143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor10State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -22129,10 +22150,10 @@ class AddTaskActor10State { } int a_body1cont2(Void && _,int loopDepth) { - #line 2304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor10State(); static_cast(this)->destroy(); return 0; } - #line 22134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor10State(); static_cast(this)->destroy(); return 0; } + #line 22155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor10State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -22202,34 +22223,34 @@ class AddTaskActor10State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 1); } - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference taskBucket; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key logUid; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key backupUid; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key keyAddPrefix; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key keyRemovePrefix; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key keyConfigBackupRanges; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key tagName; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference waitFor; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent::PreBackupAction backupAction; - #line 22227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AddTaskActor10 final : public Actor, public ActorCallback< AddTaskActor10, 0, Key >, public ActorCallback< AddTaskActor10, 1, Void >, public FastAllocated, public AddTaskActor10State { - #line 22232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -22239,9 +22260,9 @@ class AddTaskActor10 final : public Actor, public ActorCallback< AddTaskAct #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor10, 0, Key >; friend struct ActorCallback< AddTaskActor10, 1, Void >; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AddTaskActor10(Reference const& tr,Reference const& taskBucket,Key const& logUid,Key const& backupUid,Key const& keyAddPrefix,Key const& keyRemovePrefix,Key const& keyConfigBackupRanges,Key const& tagName,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference(),DatabaseBackupAgent::PreBackupAction const& backupAction = DatabaseBackupAgent::PreBackupAction::VERIFY) - #line 22244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), AddTaskActor10State(tr, taskBucket, logUid, backupUid, keyAddPrefix, keyRemovePrefix, keyConfigBackupRanges, tagName, completionKey, waitFor, backupAction) { @@ -22265,14 +22286,14 @@ friend struct ActorCallback< AddTaskActor10, 1, Void >; } }; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Key const& logUid, Key const& backupUid, Key const& keyAddPrefix, Key const& keyRemovePrefix, Key const& keyConfigBackupRanges, Key const& tagName, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference(), DatabaseBackupAgent::PreBackupAction const& backupAction = DatabaseBackupAgent::PreBackupAction::VERIFY ) { - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new AddTaskActor10(tr, taskBucket, logUid, backupUid, keyAddPrefix, keyRemovePrefix, keyConfigBackupRanges, tagName, completionKey, waitFor, backupAction)); - #line 22272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 2306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 2317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StringRef getName() const override { return name; }; @@ -22289,7 +22310,7 @@ friend struct ActorCallback< AddTaskActor10, 1, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef StartFullBackupTaskFunc::name = LiteralStringRef("dr_start_full_backup"); +StringRef StartFullBackupTaskFunc::name = "dr_start_full_backup"_sr; REGISTER_TASKFUNC(StartFullBackupTaskFunc); } // namespace dbBackup @@ -22388,24 +22409,24 @@ class DatabaseBackupAgentImpl { public: static constexpr int MAX_RESTORABLE_FILE_METASECTION_BYTES = 1024 * 8; - #line 22391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via waitUpgradeToLatestDrVersion() - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class WaitUpgradeToLatestDrVersionActorState { - #line 22397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" WaitUpgradeToLatestDrVersionActorState(DatabaseBackupAgent* const& backupAgent,Database const& cx,Key const& tagName) - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" cx(cx), - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagName(tagName) - #line 22408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("waitUpgradeToLatestDrVersion", reinterpret_cast(this)); @@ -22418,16 +22439,16 @@ class WaitUpgradeToLatestDrVersionActorState { int a_body1(int loopDepth=0) { try { - #line 2422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = backupAgent->getLogUid(cx, tagName); - #line 2422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 22425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 22430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -22448,22 +22469,22 @@ class WaitUpgradeToLatestDrVersionActorState { } int a_body1cont1(int loopDepth) { - #line 2423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" drVersionKey = backupAgent->config.get(BinaryWriter::toValue(logUid, Unversioned())) .pack(DatabaseBackupAgent::keyDrVersion); - #line 2426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DRU_WatchLatestDrVersion") .detail("DrVersionKey", drVersionKey.printable()) .detail("LogUid", BinaryWriter::toValue(logUid, Unversioned()).printable()); - #line 2430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 22457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1when1(UID const& __logUid,int loopDepth) { - #line 2422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid = __logUid; - #line 22466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -22535,11 +22556,11 @@ class WaitUpgradeToLatestDrVersionActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 2433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 22542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopBody1loopHead1(loopDepth); return loopDepth; @@ -22560,20 +22581,20 @@ class WaitUpgradeToLatestDrVersionActorState { int a_body1cont1loopBody1loopBody1(int loopDepth) { try { - #line 2435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_1 = tr->get(drVersionKey); - #line 2437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 22571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 22576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -22606,16 +22627,16 @@ class WaitUpgradeToLatestDrVersionActorState { int a_body1cont1loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = tr->onError(e); - #line 2455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 22613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 2)); else return a_body1cont1loopBody1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 2455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 22618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -22628,64 +22649,64 @@ class WaitUpgradeToLatestDrVersionActorState { } int a_body1cont1loopBody1loopBody1cont2(Optional const& drVersion,int loopDepth) { - #line 2439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DRU_VersionCheck") .detail("Current", drVersion.present() ? BinaryReader::fromStringRef(drVersion.get(), Unversioned()) : -1) .detail("Expected", DatabaseBackupAgent::LATEST_DR_VERSION) .detail("LogUid", BinaryWriter::toValue(logUid, Unversioned()).printable()); - #line 2445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (drVersion.present() && BinaryReader::fromStringRef(drVersion.get(), Unversioned()) == DatabaseBackupAgent::LATEST_DR_VERSION) - #line 22635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitUpgradeToLatestDrVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 22639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitUpgradeToLatestDrVersionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" watchDrVersionFuture = tr->watch(drVersionKey); - #line 2451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr->commit(); - #line 2451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 22651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 22656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1loopBody1cont2(Optional && drVersion,int loopDepth) { - #line 2439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DRU_VersionCheck") .detail("Current", drVersion.present() ? BinaryReader::fromStringRef(drVersion.get(), Unversioned()) : -1) .detail("Expected", DatabaseBackupAgent::LATEST_DR_VERSION) .detail("LogUid", BinaryWriter::toValue(logUid, Unversioned()).printable()); - #line 2445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (drVersion.present() && BinaryReader::fromStringRef(drVersion.get(), Unversioned()) == DatabaseBackupAgent::LATEST_DR_VERSION) - #line 22667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitUpgradeToLatestDrVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 22671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitUpgradeToLatestDrVersionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" watchDrVersionFuture = tr->watch(drVersionKey); - #line 2451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr->commit(); - #line 2451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 22683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 22688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -22755,32 +22776,32 @@ class WaitUpgradeToLatestDrVersionActorState { } int a_body1cont1loopBody1loopBody1cont3(Void const& _,int loopDepth) { - #line 2452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = watchDrVersionFuture; - #line 2452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 22762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 2452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 22767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1loopBody1cont3(Void && _,int loopDepth) { - #line 2452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = watchDrVersionFuture; - #line 2452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 22778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 2452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 22783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 22804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -22998,26 +23019,26 @@ class WaitUpgradeToLatestDrVersionActorState { fdb_probe_actor_exit("waitUpgradeToLatestDrVersion", reinterpret_cast(this), 4); } - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent* backupAgent; - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key tagName; - #line 2422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID logUid; - #line 2423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key drVersionKey; - #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 2450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future watchDrVersionFuture; - #line 23015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via waitUpgradeToLatestDrVersion() - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class WaitUpgradeToLatestDrVersionActor final : public Actor, public ActorCallback< WaitUpgradeToLatestDrVersionActor, 0, UID >, public ActorCallback< WaitUpgradeToLatestDrVersionActor, 1, Optional >, public ActorCallback< WaitUpgradeToLatestDrVersionActor, 2, Void >, public ActorCallback< WaitUpgradeToLatestDrVersionActor, 3, Void >, public ActorCallback< WaitUpgradeToLatestDrVersionActor, 4, Void >, public FastAllocated, public WaitUpgradeToLatestDrVersionActorState { - #line 23020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -23030,9 +23051,9 @@ friend struct ActorCallback< WaitUpgradeToLatestDrVersionActor, 1, Optional; friend struct ActorCallback< WaitUpgradeToLatestDrVersionActor, 3, Void >; friend struct ActorCallback< WaitUpgradeToLatestDrVersionActor, 4, Void >; - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" WaitUpgradeToLatestDrVersionActor(DatabaseBackupAgent* const& backupAgent,Database const& cx,Key const& tagName) - #line 23035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), WaitUpgradeToLatestDrVersionActorState(backupAgent, cx, tagName) { @@ -23059,38 +23080,38 @@ friend struct ActorCallback< WaitUpgradeToLatestDrVersionActor, 4, Void >; } }; - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future waitUpgradeToLatestDrVersion( DatabaseBackupAgent* const& backupAgent, Database const& cx, Key const& tagName ) { - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new WaitUpgradeToLatestDrVersionActor(backupAgent, cx, tagName)); - #line 23066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 2460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 2471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" // This method will return the final status of the backup - #line 23072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via waitBackup() - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class WaitBackupActorState { - #line 23078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" WaitBackupActorState(DatabaseBackupAgent* const& backupAgent,Database const& cx,Key const& tagName,StopWhenDone const& stopWhenDone) - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" cx(cx), - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagName(tagName), - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" stopWhenDone(stopWhenDone), - #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backTrace() - #line 23093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("waitBackup", reinterpret_cast(this)); @@ -23103,16 +23124,16 @@ class WaitBackupActorState { int a_body1(int loopDepth=0) { try { - #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = backupAgent->getLogUid(cx, tagName); - #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 23115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -23133,20 +23154,20 @@ class WaitBackupActorState { } int a_body1cont1(int loopDepth) { - #line 2468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusKey = backupAgent->states.get(BinaryWriter::toValue(logUid, Unversioned())) .pack(DatabaseBackupAgent::keyStateStatus); - #line 2471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 23140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1when1(UID const& __logUid,int loopDepth) { - #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid = __logUid; - #line 23149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -23218,24 +23239,24 @@ class WaitBackupActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 2472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 23227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" try { - #line 2477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = backupAgent->getStateValue(tr, logUid); - #line 2477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 23233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 23238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -23255,16 +23276,16 @@ class WaitBackupActorState { int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = tr->onError(e); - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 23262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 23267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -23277,51 +23298,51 @@ class WaitBackupActorState { } int a_body1cont1loopBody1cont2(int loopDepth) { - #line 2480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!DatabaseBackupAgent::isRunnable(status) || EBackupState::STATE_PARTIALLY_ABORTED == status) - #line 23282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(status); this->~WaitBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 23286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< EBackupState >::value()) EBackupState(std::move(status)); // state_var_RVO this->~WaitBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if ((!stopWhenDone) && (EBackupState::STATE_RUNNING_DIFFERENTIAL == status)) - #line 23294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(status); this->~WaitBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 23298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< EBackupState >::value()) EBackupState(std::move(status)); // state_var_RVO this->~WaitBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" watchFuture = tr->watch(statusKey); - #line 2490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr->commit(); - #line 2490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 23310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 23315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1when1(EBackupState const& __status,int loopDepth) { - #line 2477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" status = __status; - #line 23324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont2(loopDepth); return loopDepth; @@ -23386,32 +23407,32 @@ class WaitBackupActorState { } int a_body1cont1loopBody1cont3(Void const& _,int loopDepth) { - #line 2491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = watchFuture; - #line 2491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 23393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 2491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 23398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont3(Void && _,int loopDepth) { - #line 2491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = watchFuture; - #line 2491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 23409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 2491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 23414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -23642,32 +23663,32 @@ class WaitBackupActorState { fdb_probe_actor_exit("waitBackup", reinterpret_cast(this), 4); } - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent* backupAgent; - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key tagName; - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StopWhenDone stopWhenDone; - #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::string backTrace; - #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID logUid; - #line 2468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key statusKey; - #line 2472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 2477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" EBackupState status; - #line 2489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future watchFuture; - #line 23665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via waitBackup() - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class WaitBackupActor final : public Actor, public ActorCallback< WaitBackupActor, 0, UID >, public ActorCallback< WaitBackupActor, 1, EBackupState >, public ActorCallback< WaitBackupActor, 2, Void >, public ActorCallback< WaitBackupActor, 3, Void >, public ActorCallback< WaitBackupActor, 4, Void >, public FastAllocated, public WaitBackupActorState { - #line 23670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -23680,9 +23701,9 @@ friend struct ActorCallback< WaitBackupActor, 1, EBackupState >; friend struct ActorCallback< WaitBackupActor, 2, Void >; friend struct ActorCallback< WaitBackupActor, 3, Void >; friend struct ActorCallback< WaitBackupActor, 4, Void >; - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" WaitBackupActor(DatabaseBackupAgent* const& backupAgent,Database const& cx,Key const& tagName,StopWhenDone const& stopWhenDone) - #line 23685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), WaitBackupActorState(backupAgent, cx, tagName, stopWhenDone) { @@ -23709,34 +23730,34 @@ friend struct ActorCallback< WaitBackupActor, 4, Void >; } }; - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future waitBackup( DatabaseBackupAgent* const& backupAgent, Database const& cx, Key const& tagName, StopWhenDone const& stopWhenDone ) { - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new WaitBackupActor(backupAgent, cx, tagName, stopWhenDone)); - #line 23716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 2497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" // This method will return the final status of the backup - #line 23722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via waitSubmitted() - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class WaitSubmittedActorState { - #line 23728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" WaitSubmittedActorState(DatabaseBackupAgent* const& backupAgent,Database const& cx,Key const& tagName) - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" cx(cx), - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagName(tagName) - #line 23739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("waitSubmitted", reinterpret_cast(this)); @@ -23749,16 +23770,16 @@ class WaitSubmittedActorState { int a_body1(int loopDepth=0) { try { - #line 2500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = backupAgent->getLogUid(cx, tagName); - #line 2500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 23761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -23779,20 +23800,20 @@ class WaitSubmittedActorState { } int a_body1cont1(int loopDepth) { - #line 2501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusKey = backupAgent->states.get(BinaryWriter::toValue(logUid, Unversioned())) .pack(DatabaseBackupAgent::keyStateStatus); - #line 2504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 23786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1when1(UID const& __logUid,int loopDepth) { - #line 2500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid = __logUid; - #line 23795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -23864,24 +23885,24 @@ class WaitSubmittedActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 2505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 2506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 23873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" try { - #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = backupAgent->getStateValue(tr, logUid); - #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 23879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 23884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -23901,16 +23922,16 @@ class WaitSubmittedActorState { int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = tr->onError(e); - #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 23908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 23913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -23923,39 +23944,39 @@ class WaitSubmittedActorState { } int a_body1cont1loopBody1cont2(int loopDepth) { - #line 2513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (EBackupState::STATE_SUBMITTED != status) - #line 23928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(status); this->~WaitSubmittedActorState(); static_cast(this)->destroy(); return 0; } - #line 23932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< EBackupState >::value()) EBackupState(std::move(status)); // state_var_RVO this->~WaitSubmittedActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" watchFuture = tr->watch(statusKey); - #line 2518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr->commit(); - #line 2518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 23944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 23949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1when1(EBackupState const& __status,int loopDepth) { - #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" status = __status; - #line 23958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 23979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont2(loopDepth); return loopDepth; @@ -24020,32 +24041,32 @@ class WaitSubmittedActorState { } int a_body1cont1loopBody1cont3(Void const& _,int loopDepth) { - #line 2519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = watchFuture; - #line 2519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 24027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 2519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont3(Void && _,int loopDepth) { - #line 2519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = watchFuture; - #line 2519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 24043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 2519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -24276,28 +24297,28 @@ class WaitSubmittedActorState { fdb_probe_actor_exit("waitSubmitted", reinterpret_cast(this), 4); } - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent* backupAgent; - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key tagName; - #line 2500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID logUid; - #line 2501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key statusKey; - #line 2505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" EBackupState status; - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future watchFuture; - #line 24295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via waitSubmitted() - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class WaitSubmittedActor final : public Actor, public ActorCallback< WaitSubmittedActor, 0, UID >, public ActorCallback< WaitSubmittedActor, 1, EBackupState >, public ActorCallback< WaitSubmittedActor, 2, Void >, public ActorCallback< WaitSubmittedActor, 3, Void >, public ActorCallback< WaitSubmittedActor, 4, Void >, public FastAllocated, public WaitSubmittedActorState { - #line 24300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -24310,9 +24331,9 @@ friend struct ActorCallback< WaitSubmittedActor, 1, EBackupState >; friend struct ActorCallback< WaitSubmittedActor, 2, Void >; friend struct ActorCallback< WaitSubmittedActor, 3, Void >; friend struct ActorCallback< WaitSubmittedActor, 4, Void >; - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" WaitSubmittedActor(DatabaseBackupAgent* const& backupAgent,Database const& cx,Key const& tagName) - #line 24315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), WaitSubmittedActorState(backupAgent, cx, tagName) { @@ -24339,49 +24360,49 @@ friend struct ActorCallback< WaitSubmittedActor, 4, Void >; } }; - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future waitSubmitted( DatabaseBackupAgent* const& backupAgent, Database const& cx, Key const& tagName ) { - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new WaitSubmittedActor(backupAgent, cx, tagName)); - #line 24346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 2525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 24351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via submitBackup() - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class SubmitBackupActorState { - #line 24357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" SubmitBackupActorState(DatabaseBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName,Standalone> const& backupRanges,StopWhenDone const& stopWhenDone,Key const& addPrefix,Key const& removePrefix,LockDB const& lockDB,DatabaseBackupAgent::PreBackupAction const& backupAction) - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr(tr), - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagName(tagName), - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRanges(backupRanges), - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" stopWhenDone(stopWhenDone), - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addPrefix(addPrefix), - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" removePrefix(removePrefix), - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" lockDB(lockDB), - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupAction(backupAction), - #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid(deterministicRandom()->randomUniqueID()), - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUidValue(BinaryWriter::toValue(logUid, Unversioned())) - #line 24384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("submitBackup", reinterpret_cast(this)); @@ -24394,16 +24415,16 @@ class SubmitBackupActorState { int a_body1(int loopDepth=0) { try { - #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = backupAgent->getLogUid(tr, tagName); - #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -24424,31 +24445,31 @@ class SubmitBackupActorState { } int a_body1cont1(int loopDepth) { - #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); - #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = backupAgent->getStateValue(tr, logUidCurrent); - #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(UID const& __logUidCurrent,int loopDepth) { - #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUidCurrent = __logUidCurrent; - #line 24451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -24513,43 +24534,43 @@ class SubmitBackupActorState { } int a_body1cont2(int loopDepth) { - #line 2549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (DatabaseBackupAgent::isRunnable(status)) - #line 24518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(backup_duplicate(), loopDepth); - #line 24522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (logUidCurrent.isValid()) - #line 24526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid = logUidCurrent; - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUidValue = BinaryWriter::toValue(logUid, Unversioned()); - #line 24532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_2 = tr->get(backupAgent->states.get(logUidValue).pack(DatabaseBackupAgent::keyFolderId)); - #line 2558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 24543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1when1(EBackupState const& __status,int loopDepth) { - #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" status = __status; - #line 24552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -24614,76 +24635,76 @@ class SubmitBackupActorState { } int a_body1cont3(Optional const& v,int loopDepth) { - #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version uidVersion = 0; - #line 2560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (v.present()) - #line 24621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" uidVersion = BinaryReader::fromStringRef(v.get(), Unversioned()) + 1; - #line 24625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupUid = BinaryWriter::toValue(uidVersion, Unversioned()); - #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" KeyRangeMap backupRangeSet; - #line 2565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto& backupRange : backupRanges ) { - #line 2566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRangeSet.insert(backupRange, 1); - #line 24635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRangeSet.coalesce(allKeys); - #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRanges = Standalone>(); - #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto& backupRange : backupRangeSet.ranges() ) { - #line 2573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupRange.value()) - #line 24645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRanges.push_back_deep(backupRanges.arena(), backupRange.range()); - #line 24649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } - #line 2578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupAction == DatabaseBackupAgent::PreBackupAction::VERIFY) - #line 24654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupIntoResults = std::vector>(); - #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto& backupRange : backupRanges ) { - #line 2582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupIntoResults.push_back( tr->getRange(backupRange.removePrefix(removePrefix).withPrefix(addPrefix), 1)); - #line 24662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = waitForAll(backupIntoResults); - #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 2592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupAction == DatabaseBackupAgent::PreBackupAction::CLEAR) - #line 24680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto& backupRange : backupRanges ) { - #line 2595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(backupRange.removePrefix(removePrefix).withPrefix(addPrefix)); - #line 24686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } loopDepth = a_body1cont6(loopDepth); @@ -24693,76 +24714,76 @@ class SubmitBackupActorState { } int a_body1cont3(Optional && v,int loopDepth) { - #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version uidVersion = 0; - #line 2560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (v.present()) - #line 24700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" uidVersion = BinaryReader::fromStringRef(v.get(), Unversioned()) + 1; - #line 24704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupUid = BinaryWriter::toValue(uidVersion, Unversioned()); - #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" KeyRangeMap backupRangeSet; - #line 2565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto& backupRange : backupRanges ) { - #line 2566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRangeSet.insert(backupRange, 1); - #line 24714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRangeSet.coalesce(allKeys); - #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRanges = Standalone>(); - #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto& backupRange : backupRangeSet.ranges() ) { - #line 2573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupRange.value()) - #line 24724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRanges.push_back_deep(backupRanges.arena(), backupRange.range()); - #line 24728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } - #line 2578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupAction == DatabaseBackupAgent::PreBackupAction::VERIFY) - #line 24733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupIntoResults = std::vector>(); - #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto& backupRange : backupRanges ) { - #line 2582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupIntoResults.push_back( tr->getRange(backupRange.removePrefix(removePrefix).withPrefix(addPrefix), 1)); - #line 24741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = waitForAll(backupIntoResults); - #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 2592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupAction == DatabaseBackupAgent::PreBackupAction::CLEAR) - #line 24759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto& backupRange : backupRanges ) { - #line 2595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(backupRange.removePrefix(removePrefix).withPrefix(addPrefix)); - #line 24765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } loopDepth = a_body1cont6(loopDepth); @@ -24835,76 +24856,76 @@ class SubmitBackupActorState { } int a_body1cont6(int loopDepth) { - #line 2600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(backupAgent->config.get(logUidValue).range()); - #line 2601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(backupAgent->states.get(logUidValue).range()); - #line 2602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(backupAgent->errors.range()); - #line 2604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(backupAgent->tagNames.pack(tagName), logUidValue); - #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DRConfig(logUid).clear(tr); - #line 2608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(backupAgent->config.get(logUidValue).pack(DatabaseBackupAgent::keyDrVersion), BinaryWriter::toValue(DatabaseBackupAgent::LATEST_DR_VERSION, Unversioned())); - #line 2610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(backupAgent->config.get(logUidValue).pack(DatabaseBackupAgent::keyAddPrefix), addPrefix); - #line 2611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(backupAgent->config.get(logUidValue).pack(DatabaseBackupAgent::keyRemovePrefix), removePrefix); - #line 2612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(backupAgent->states.get(logUidValue).pack(DatabaseBackupAgent::keyConfigBackupTag), tagName); - #line 2613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(backupAgent->config.get(logUidValue).pack(DatabaseBackupAgent::keyConfigLogUid), logUidValue); - #line 2614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(backupAgent->config.get(logUidValue).pack(DatabaseBackupAgent::keyFolderId), backupUid); - #line 2615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(backupAgent->states.get(logUidValue).pack(DatabaseBackupAgent::keyFolderId), backupUid); - #line 2617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(backupAgent->config.get(logUidValue).pack(DatabaseBackupAgent::keyConfigBackupRanges), BinaryWriter::toValue(backupRanges, IncludeVersion(ProtocolVersion::withDRBackupRanges()))); - #line 2619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(backupAgent->states.get(logUidValue).pack(DatabaseBackupAgent::keyStateStatus), StringRef(BackupAgentBase::getStateText(EBackupState::STATE_SUBMITTED))); - #line 2621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (stopWhenDone) - #line 24868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(backupAgent->config.get(logUidValue).pack(DatabaseBackupAgent::keyConfigStopWhenDoneKey), StringRef()); - #line 24872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int64_t startCount = 0; - #line 2627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" mapPrefix = logUidValue.withPrefix(applyMutationsKeyVersionMapRange.begin); - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - Key mapEnd = normalKeys.end.withPrefix(mapPrefix); - #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + Key mapEnd = allKeys.end.withPrefix(mapPrefix); + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(logUidValue.withPrefix(applyMutationsAddPrefixRange.begin), addPrefix); - #line 2630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(logUidValue.withPrefix(applyMutationsRemovePrefixRange.begin), removePrefix); - #line 2631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(logUidValue.withPrefix(applyMutationsKeyVersionCountRange.begin), StringRef((uint8_t*)&startCount, 8)); - #line 2632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(KeyRangeRef(mapPrefix, mapEnd)); - #line 2634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" readVersion = invalidVersion; - #line 2635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupAction == DatabaseBackupAgent::PreBackupAction::NONE) - #line 24892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Transaction readTransaction(backupAgent->taskBucket->src); - #line 2637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" readTransaction.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = readTransaction.getReadVersion(); - #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -24916,15 +24937,15 @@ class SubmitBackupActorState { } int a_body1cont11(Void const& _,int loopDepth) { - #line 2586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto result : backupIntoResults ) { - #line 2587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (result.get().size() > 0) - #line 24923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(restore_destination_not_empty(), loopDepth); - #line 24927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } loopDepth = a_body1cont6(loopDepth); @@ -24933,15 +24954,15 @@ class SubmitBackupActorState { } int a_body1cont11(Void && _,int loopDepth) { - #line 2586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto result : backupIntoResults ) { - #line 2587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (result.get().size() > 0) - #line 24940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(restore_destination_not_empty(), loopDepth); - #line 24944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 24965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } loopDepth = a_body1cont6(loopDepth); @@ -25013,36 +25034,36 @@ class SubmitBackupActorState { } int a_body1cont16(int loopDepth) { - #line 2641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(mapPrefix, BinaryWriter::toValue(readVersion, Unversioned())); - #line 2643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_5 = dbBackup::StartFullBackupTaskFunc::addTask( tr, backupAgent->taskBucket, logUidValue, backupUid, addPrefix, removePrefix, BinaryWriter::toValue(backupRanges, IncludeVersion(ProtocolVersion::withDRBackupRanges())), tagName, TaskCompletionKey::noSignal(), Reference(), backupAction); - #line 2643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont16when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 2643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont18(Version const& _,int loopDepth) { - #line 2639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" readVersion = _; - #line 25036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont16(loopDepth); return loopDepth; } int a_body1cont18(Version && _,int loopDepth) { - #line 2639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" readVersion = _; - #line 25045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont16(loopDepth); return loopDepth; @@ -25112,34 +25133,34 @@ class SubmitBackupActorState { } int a_body1cont16cont1(Key const& taskKey,int loopDepth) { - #line 2656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (lockDB) - #line 25117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = lockDatabase(tr, logUid); - #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont16cont1when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 2659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_7 = checkDatabaseLock(tr, logUid); - #line 2659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont16cont1when2(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 2659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -25147,34 +25168,34 @@ class SubmitBackupActorState { } int a_body1cont16cont1(Key && taskKey,int loopDepth) { - #line 2656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (lockDB) - #line 25152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = lockDatabase(tr, logUid); - #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont16cont1when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 2659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_7 = checkDatabaseLock(tr, logUid); - #line 2659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont16cont1when2(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 2659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -25245,11 +25266,11 @@ class SubmitBackupActorState { } int a_body1cont16cont2(int loopDepth) { - #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_Submit") .detail("LogUid", logUid) .detail("Lock", lockDB) .detail("LogUID", logUidValue) .detail("Tag", tagName) .detail("Key", backupAgent->states.get(logUidValue).pack(DatabaseBackupAgent::keyFolderId)) .detail("MapPrefix", mapPrefix); - #line 2669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SubmitBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 25252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SubmitBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -25407,46 +25428,46 @@ class SubmitBackupActorState { fdb_probe_actor_exit("submitBackup", reinterpret_cast(this), 7); } - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent* backupAgent; - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key tagName; - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Standalone> backupRanges; - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StopWhenDone stopWhenDone; - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key addPrefix; - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key removePrefix; - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" LockDB lockDB; - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent::PreBackupAction backupAction; - #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID logUid; - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key logUidValue; - #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID logUidCurrent; - #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" EBackupState status; - #line 2562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Standalone backupUid; - #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::vector> backupIntoResults; - #line 2627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key mapPrefix; - #line 2634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version readVersion; - #line 25444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via submitBackup() - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class SubmitBackupActor final : public Actor, public ActorCallback< SubmitBackupActor, 0, UID >, public ActorCallback< SubmitBackupActor, 1, EBackupState >, public ActorCallback< SubmitBackupActor, 2, Optional >, public ActorCallback< SubmitBackupActor, 3, Void >, public ActorCallback< SubmitBackupActor, 4, Version >, public ActorCallback< SubmitBackupActor, 5, Key >, public ActorCallback< SubmitBackupActor, 6, Void >, public ActorCallback< SubmitBackupActor, 7, Void >, public FastAllocated, public SubmitBackupActorState { - #line 25449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -25462,9 +25483,9 @@ friend struct ActorCallback< SubmitBackupActor, 4, Version >; friend struct ActorCallback< SubmitBackupActor, 5, Key >; friend struct ActorCallback< SubmitBackupActor, 6, Void >; friend struct ActorCallback< SubmitBackupActor, 7, Void >; - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" SubmitBackupActor(DatabaseBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName,Standalone> const& backupRanges,StopWhenDone const& stopWhenDone,Key const& addPrefix,Key const& removePrefix,LockDB const& lockDB,DatabaseBackupAgent::PreBackupAction const& backupAction) - #line 25467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), SubmitBackupActorState(backupAgent, tr, tagName, backupRanges, stopWhenDone, addPrefix, removePrefix, lockDB, backupAction) { @@ -25494,33 +25515,33 @@ friend struct ActorCallback< SubmitBackupActor, 7, Void >; } }; - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future submitBackup( DatabaseBackupAgent* const& backupAgent, Reference const& tr, Key const& tagName, Standalone> const& backupRanges, StopWhenDone const& stopWhenDone, Key const& addPrefix, Key const& removePrefix, LockDB const& lockDB, DatabaseBackupAgent::PreBackupAction const& backupAction ) { - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new SubmitBackupActor(backupAgent, tr, tagName, backupRanges, stopWhenDone, addPrefix, removePrefix, lockDB, backupAction)); - #line 25501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 2671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 2682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 25506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via unlockBackup() - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class UnlockBackupActorState { - #line 25512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UnlockBackupActorState(DatabaseBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName) - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr(tr), - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagName(tagName) - #line 25523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("unlockBackup", reinterpret_cast(this)); @@ -25533,16 +25554,16 @@ class UnlockBackupActorState { int a_body1(int loopDepth=0) { try { - #line 2675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = backupAgent->getLogUid(tr, tagName); - #line 2675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -25563,32 +25584,32 @@ class UnlockBackupActorState { } int a_body1cont1(UID const& logUid,int loopDepth) { - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = unlockDatabase(tr, logUid); - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(UID && logUid,int loopDepth) { - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = unlockDatabase(tr, logUid); - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -25658,11 +25679,11 @@ class UnlockBackupActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 2677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_Unlock").detail("Tag", tagName); - #line 2678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UnlockBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 25665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~UnlockBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -25672,11 +25693,11 @@ class UnlockBackupActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 2677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_Unlock").detail("Tag", tagName); - #line 2678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UnlockBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 25679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~UnlockBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -25747,18 +25768,18 @@ class UnlockBackupActorState { fdb_probe_actor_exit("unlockBackup", reinterpret_cast(this), 1); } - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent* backupAgent; - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key tagName; - #line 25756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via unlockBackup() - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class UnlockBackupActor final : public Actor, public ActorCallback< UnlockBackupActor, 0, UID >, public ActorCallback< UnlockBackupActor, 1, Void >, public FastAllocated, public UnlockBackupActorState { - #line 25761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -25768,9 +25789,9 @@ class UnlockBackupActor final : public Actor, public ActorCallback< Unlock #pragma clang diagnostic pop friend struct ActorCallback< UnlockBackupActor, 0, UID >; friend struct ActorCallback< UnlockBackupActor, 1, Void >; - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UnlockBackupActor(DatabaseBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName) - #line 25773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), UnlockBackupActorState(backupAgent, tr, tagName) { @@ -25794,43 +25815,43 @@ friend struct ActorCallback< UnlockBackupActor, 1, Void >; } }; - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future unlockBackup( DatabaseBackupAgent* const& backupAgent, Reference const& tr, Key const& tagName ) { - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new UnlockBackupActor(backupAgent, tr, tagName)); - #line 25801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 2680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 2691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 25806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via atomicSwitchover() - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AtomicSwitchoverActorState { - #line 25812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AtomicSwitchoverActorState(DatabaseBackupAgent* const& backupAgent,Database const& dest,Key const& tagName,Standalone> const& backupRanges,Key const& addPrefix,Key const& removePrefix,ForceAction const& forceAction) - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" dest(dest), - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagName(tagName), - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRanges(backupRanges), - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" addPrefix(addPrefix), - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" removePrefix(removePrefix), - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" forceAction(forceAction), - #line 2688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" drAgent(dest) - #line 25833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("atomicSwitchover", reinterpret_cast(this)); @@ -25843,16 +25864,16 @@ class AtomicSwitchoverActorState { int a_body1(int loopDepth=0) { try { - #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = backupAgent->getLogUid(dest, tagName); - #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -25873,25 +25894,25 @@ class AtomicSwitchoverActorState { } int a_body1cont1(int loopDepth) { - #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = backupAgent->getStateValue(dest, destlogUid); - #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(UID const& __destlogUid,int loopDepth) { - #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destlogUid = __destlogUid; - #line 25894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -25956,30 +25977,30 @@ class AtomicSwitchoverActorState { } int a_body1cont2(int loopDepth) { - #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverStart").detail("Status", status); - #line 2693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (status != EBackupState::STATE_RUNNING_DIFFERENTIAL && status != EBackupState::STATE_COMPLETED) - #line 25963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(backup_duplicate(), loopDepth); - #line 25967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!g_network->isSimulated() && !forceAction) - #line 25971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = StatusClient::statusFetcher(backupAgent->taskBucket->src); - #line 2698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 25998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -25991,9 +26012,9 @@ class AtomicSwitchoverActorState { } int a_body1cont1when1(EBackupState const& __status,int loopDepth) { - #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" status = __status; - #line 25996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -26058,45 +26079,45 @@ class AtomicSwitchoverActorState { } int a_body1cont3(int loopDepth) { - #line 2703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid = deterministicRandom()->randomUniqueID(); - #line 2704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUidValue = BinaryWriter::toValue(logUid, Unversioned()); - #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = drAgent.getLogUid(backupAgent->taskBucket->src, tagName); - #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 26069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont3when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 26074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont5(int loopDepth) { - #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = StatusClient::statusFetcher(dest); - #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 26085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 26090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2when1(StatusObject const& __srcStatus,int loopDepth) { - #line 2698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcStatus = __srcStatus; - #line 26099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont5(loopDepth); return loopDepth; @@ -26161,18 +26182,18 @@ class AtomicSwitchoverActorState { } int a_body1cont6(StatusObject const& destStatus,int loopDepth) { - #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" checkAtomicSwitchOverConfig(srcStatus, destStatus, tagName); - #line 26166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; } int a_body1cont6(StatusObject && destStatus,int loopDepth) { - #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" checkAtomicSwitchOverConfig(srcStatus, destStatus, tagName); - #line 26175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; @@ -26242,32 +26263,32 @@ class AtomicSwitchoverActorState { } int a_body1cont8(int loopDepth) { - #line 2707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (logUidCurrent.isValid()) - #line 26247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid = logUidCurrent; - #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUidValue = BinaryWriter::toValue(logUid, Unversioned()); - #line 26253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = Transaction(backupAgent->taskBucket->src); - #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" commitVersion = Version(); - #line 2715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 26261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont8loopHead1(loopDepth); return loopDepth; } int a_body1cont3when1(UID const& __logUidCurrent,int loopDepth) { - #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUidCurrent = __logUidCurrent; - #line 26270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont8(loopDepth); return loopDepth; @@ -26332,13 +26353,13 @@ class AtomicSwitchoverActorState { } int a_body1cont9(int loopDepth) { - #line 2727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverLocked").detail("Version", commitVersion); - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr2 = ReadYourWritesTransaction(dest); - #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 26341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont9loopHead1(loopDepth); return loopDepth; @@ -26353,16 +26374,16 @@ class AtomicSwitchoverActorState { int a_body1cont8loopBody1(int loopDepth) { try { - #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_5 = lockDatabase(&tr, logUid); - #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont8loopBody1Catch1(actor_cancelled(), loopDepth); - #line 26360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont8loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont8loopBody1when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 26365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -26395,16 +26416,16 @@ class AtomicSwitchoverActorState { int a_body1cont8loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_7 = tr.onError(e); - #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 26402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody1Catch1when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 26407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -26417,36 +26438,36 @@ class AtomicSwitchoverActorState { } int a_body1cont8loopBody1cont2(Void const& _,int loopDepth) { - #line 2718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.set(backupAgent->tagNames.pack(tagName), logUidValue); - #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = tr.commit(); - #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont8loopBody1Catch1(actor_cancelled(), loopDepth); - #line 26426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont8loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont8loopBody1cont2when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 26431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont8loopBody1cont2(Void && _,int loopDepth) { - #line 2718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr.set(backupAgent->tagNames.pack(tagName), logUidValue); - #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = tr.commit(); - #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont8loopBody1Catch1(actor_cancelled(), loopDepth); - #line 26444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont8loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont8loopBody1cont2when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 26449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -26516,18 +26537,18 @@ class AtomicSwitchoverActorState { } int a_body1cont8loopBody1cont3(Void const& _,int loopDepth) { - #line 2720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" commitVersion = tr.getCommittedVersion(); - #line 26521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1cont8break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1cont8loopBody1cont3(Void && _,int loopDepth) { - #line 2720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" commitVersion = tr.getCommittedVersion(); - #line 26530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1cont8break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -26672,20 +26693,20 @@ class AtomicSwitchoverActorState { } int a_body1cont11(int loopDepth) { - #line 2762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverReady").log(); - #line 26677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" try { - #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_13 = backupAgent->discontinueBackup(dest, tagName); - #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont11Catch1(actor_cancelled(), loopDepth); - #line 26683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_13.isReady()) { if (__when_expr_13.isError()) return a_body1cont11Catch1(__when_expr_13.getError(), loopDepth); else return a_body1cont11when1(__when_expr_13.get(), loopDepth); }; static_cast(this)->actor_wait_state = 14; - #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_13.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 26688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -26706,20 +26727,20 @@ class AtomicSwitchoverActorState { int a_body1cont9loopBody1(int loopDepth) { try { - #line 2733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr2.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr2.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_8 = tr2.get(backupAgent->states.get(BinaryWriter::toValue(destlogUid, Unversioned())) .pack(DatabaseBackupAgent::keyFolderId)); - #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont9loopBody1Catch1(actor_cancelled(), loopDepth); - #line 26717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont9loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont9loopBody1when1(__when_expr_8.get(), loopDepth); }; static_cast(this)->actor_wait_state = 9; - #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 26722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -26752,16 +26773,16 @@ class AtomicSwitchoverActorState { int a_body1cont9loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_12 = tr2.onError(e); - #line 2758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 26759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_12.isReady()) { if (__when_expr_12.isError()) return a_body1Catch1(__when_expr_12.getError(), std::max(0, loopDepth - 1)); else return a_body1cont9loopBody1Catch1when1(__when_expr_12.get(), loopDepth); }; static_cast(this)->actor_wait_state = 13; - #line 2758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_12.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 26764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -26774,35 +26795,35 @@ class AtomicSwitchoverActorState { } int a_body1cont9loopBody1cont2(int loopDepth) { - #line 2738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverBackupUID") .detail("Uid", backupUid) .detail("Key", backupAgent->states.get(BinaryWriter::toValue(destlogUid, Unversioned())) .pack(DatabaseBackupAgent::keyFolderId)); - #line 2743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!backupUid.present()) - #line 26781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1cont9loopBody1Catch1(backup_duplicate(), loopDepth); - #line 26785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_9 = tr2.get( BinaryWriter::toValue(destlogUid, Unversioned()).withPrefix(applyMutationsBeginRange.begin)); - #line 2745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont9loopBody1Catch1(actor_cancelled(), loopDepth); - #line 26791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1cont9loopBody1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1cont9loopBody1cont2when1(__when_expr_9.get(), loopDepth); }; static_cast(this)->actor_wait_state = 10; - #line 2745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 26796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont9loopBody1when1(Optional const& __backupUid,int loopDepth) { - #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupUid = __backupUid; - #line 26805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont9loopBody1cont2(loopDepth); return loopDepth; @@ -26867,52 +26888,52 @@ class AtomicSwitchoverActorState { } int a_body1cont9loopBody1cont3(Optional const& v,int loopDepth) { - #line 2747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverVersion") .detail("Version", v.present() ? BinaryReader::fromStringRef(v.get(), Unversioned()) : 0); - #line 2749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (v.present() && BinaryReader::fromStringRef(v.get(), Unversioned()) >= commitVersion) - #line 26874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { return a_body1cont9break1(loopDepth==0?0:loopDepth-1); // break } - #line 2752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" versionWatch = tr2.watch( BinaryWriter::toValue(destlogUid, Unversioned()).withPrefix(applyMutationsBeginRange.begin)); - #line 2754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_10 = tr2.commit(); - #line 2754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont9loopBody1Catch1(actor_cancelled(), loopDepth); - #line 26884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1cont9loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont9loopBody1cont3when1(__when_expr_10.get(), loopDepth); }; static_cast(this)->actor_wait_state = 11; - #line 2754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 26889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont9loopBody1cont3(Optional && v,int loopDepth) { - #line 2747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverVersion") .detail("Version", v.present() ? BinaryReader::fromStringRef(v.get(), Unversioned()) : 0); - #line 2749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (v.present() && BinaryReader::fromStringRef(v.get(), Unversioned()) >= commitVersion) - #line 26900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { return a_body1cont9break1(loopDepth==0?0:loopDepth-1); // break } - #line 2752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" versionWatch = tr2.watch( BinaryWriter::toValue(destlogUid, Unversioned()).withPrefix(applyMutationsBeginRange.begin)); - #line 2754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_10 = tr2.commit(); - #line 2754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont9loopBody1Catch1(actor_cancelled(), loopDepth); - #line 26910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1cont9loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont9loopBody1cont3when1(__when_expr_10.get(), loopDepth); }; static_cast(this)->actor_wait_state = 11; - #line 2754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 26915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 26936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -26982,32 +27003,32 @@ class AtomicSwitchoverActorState { } int a_body1cont9loopBody1cont5(Void const& _,int loopDepth) { - #line 2755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_11 = versionWatch; - #line 2755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont9loopBody1Catch1(actor_cancelled(), loopDepth); - #line 26989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1cont9loopBody1Catch1(__when_expr_11.getError(), loopDepth); else return a_body1cont9loopBody1cont5when1(__when_expr_11.get(), loopDepth); }; static_cast(this)->actor_wait_state = 12; - #line 2755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_11.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 26994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont9loopBody1cont5(Void && _,int loopDepth) { - #line 2755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_11 = versionWatch; - #line 2755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont9loopBody1Catch1(actor_cancelled(), loopDepth); - #line 27005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1cont9loopBody1Catch1(__when_expr_11.getError(), loopDepth); else return a_body1cont9loopBody1cont5when1(__when_expr_11.get(), loopDepth); }; static_cast(this)->actor_wait_state = 12; - #line 2755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_11.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -27077,18 +27098,18 @@ class AtomicSwitchoverActorState { } int a_body1cont9loopBody1cont7(Void const& _,int loopDepth) { - #line 2756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr2.reset(); - #line 27082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont9loopBody1cont9(loopDepth); return loopDepth; } int a_body1cont9loopBody1cont7(Void && _,int loopDepth) { - #line 2756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr2.reset(); - #line 27091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont9loopBody1cont9(loopDepth); return loopDepth; @@ -27246,16 +27267,16 @@ class AtomicSwitchoverActorState { } int a_body1cont11cont1(int loopDepth) { - #line 2771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_14 = success(backupAgent->waitBackup(dest, tagName, StopWhenDone::True)); - #line 2771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 27253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_14.isReady()) { if (__when_expr_14.isError()) return a_body1Catch1(__when_expr_14.getError(), loopDepth); else return a_body1cont11cont1when1(__when_expr_14.get(), loopDepth); }; static_cast(this)->actor_wait_state = 15; - #line 2771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_14.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -27263,13 +27284,13 @@ class AtomicSwitchoverActorState { int a_body1cont11Catch1(const Error& e,int loopDepth=0) { try { - #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (e.code() != error_code_backup_duplicate && e.code() != error_code_backup_unneeded) - #line 27268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 27272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } loopDepth = a_body1cont11cont1(loopDepth); } @@ -27371,26 +27392,26 @@ class AtomicSwitchoverActorState { } int a_body1cont11cont4(Void const& _,int loopDepth) { - #line 2773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverStopped").log(); - #line 2775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr3 = ReadYourWritesTransaction(dest); - #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 27380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont11cont4loopHead1(loopDepth); return loopDepth; } int a_body1cont11cont4(Void && _,int loopDepth) { - #line 2773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverStopped").log(); - #line 2775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr3 = ReadYourWritesTransaction(dest); - #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 27393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont11cont4loopHead1(loopDepth); return loopDepth; @@ -27460,20 +27481,20 @@ class AtomicSwitchoverActorState { } int a_body1cont11cont5(int loopDepth) { - #line 2794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverVersionUpgraded").log(); - #line 27465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" try { - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_18 = drAgent.submitBackup(backupAgent->taskBucket->src, tagName, backupRanges, StopWhenDone::False, addPrefix, removePrefix, LockDB::True, DatabaseBackupAgent::PreBackupAction::NONE); - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont11cont5Catch1(actor_cancelled(), loopDepth); - #line 27471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_18.isReady()) { if (__when_expr_18.isError()) return a_body1cont11cont5Catch1(__when_expr_18.getError(), loopDepth); else return a_body1cont11cont5when1(__when_expr_18.get(), loopDepth); }; static_cast(this)->actor_wait_state = 19; - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_18.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -27494,20 +27515,20 @@ class AtomicSwitchoverActorState { int a_body1cont11cont4loopBody1(int loopDepth) { try { - #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr3.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr3.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_15 = tr3.getReadVersion(); - #line 2780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont11cont4loopBody1Catch1(actor_cancelled(), loopDepth); - #line 27505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_15.isReady()) { if (__when_expr_15.isError()) return a_body1cont11cont4loopBody1Catch1(__when_expr_15.getError(), loopDepth); else return a_body1cont11cont4loopBody1when1(__when_expr_15.get(), loopDepth); }; static_cast(this)->actor_wait_state = 16; - #line 2780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_15.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -27540,16 +27561,16 @@ class AtomicSwitchoverActorState { int a_body1cont11cont4loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_17 = tr3.onError(e); - #line 2790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 27547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_17.isReady()) { if (__when_expr_17.isError()) return a_body1Catch1(__when_expr_17.getError(), std::max(0, loopDepth - 1)); else return a_body1cont11cont4loopBody1Catch1when1(__when_expr_17.get(), loopDepth); }; static_cast(this)->actor_wait_state = 18; - #line 2790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_17.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -27562,26 +27583,26 @@ class AtomicSwitchoverActorState { } int a_body1cont11cont4loopBody1cont2(Version const& destVersion,int loopDepth) { - #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverVersionUpgrade").detail("Src", commitVersion).detail("Dest", destVersion); - #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (destVersion <= commitVersion) - #line 27569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - TEST(true); - #line 2784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + CODE_PROBE(true, "Forcing dest backup cluster to higher version"); + #line 2795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr3.set(minRequiredCommitVersionKey, BinaryWriter::toValue(commitVersion + 1, Unversioned())); - #line 2785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_16 = tr3.commit(); - #line 2785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont11cont4loopBody1Catch1(actor_cancelled(), loopDepth); - #line 27579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_16.isReady()) { if (__when_expr_16.isError()) return a_body1cont11cont4loopBody1Catch1(__when_expr_16.getError(), loopDepth); else return a_body1cont11cont4loopBody1cont2when1(__when_expr_16.get(), loopDepth); }; static_cast(this)->actor_wait_state = 17; - #line 2785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_16.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -27593,26 +27614,26 @@ class AtomicSwitchoverActorState { } int a_body1cont11cont4loopBody1cont2(Version && destVersion,int loopDepth) { - #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverVersionUpgrade").detail("Src", commitVersion).detail("Dest", destVersion); - #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (destVersion <= commitVersion) - #line 27600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - TEST(true); - #line 2784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + CODE_PROBE(true, "Forcing dest backup cluster to higher version"); + #line 2795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr3.set(minRequiredCommitVersionKey, BinaryWriter::toValue(commitVersion + 1, Unversioned())); - #line 2785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_16 = tr3.commit(); - #line 2785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont11cont4loopBody1Catch1(actor_cancelled(), loopDepth); - #line 27610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_16.isReady()) { if (__when_expr_16.isError()) return a_body1cont11cont4loopBody1Catch1(__when_expr_16.getError(), loopDepth); else return a_body1cont11cont4loopBody1cont2when1(__when_expr_16.get(), loopDepth); }; static_cast(this)->actor_wait_state = 17; - #line 2785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_16.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -27856,18 +27877,18 @@ class AtomicSwitchoverActorState { } int a_body1cont11cont6(int loopDepth) { - #line 2810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverSubmitted").log(); - #line 2812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_19 = success(drAgent.waitSubmitted(backupAgent->taskBucket->src, tagName)); - #line 2812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 27865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_19.isReady()) { if (__when_expr_19.isError()) return a_body1Catch1(__when_expr_19.getError(), loopDepth); else return a_body1cont11cont6when1(__when_expr_19.get(), loopDepth); }; static_cast(this)->actor_wait_state = 20; - #line 2812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_19.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -27875,13 +27896,13 @@ class AtomicSwitchoverActorState { int a_body1cont11cont5Catch1(const Error& e,int loopDepth=0) { try { - #line 2806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (e.code() != error_code_backup_duplicate) - #line 27880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 27884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 27905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } loopDepth = a_body1cont11cont6(loopDepth); } @@ -27983,36 +28004,36 @@ class AtomicSwitchoverActorState { } int a_body1cont11cont9(Void const& _,int loopDepth) { - #line 2814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverStarted").log(); - #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_20 = backupAgent->unlockBackup(dest, tagName); - #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 27992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_20.isReady()) { if (__when_expr_20.isError()) return a_body1Catch1(__when_expr_20.getError(), loopDepth); else return a_body1cont11cont9when1(__when_expr_20.get(), loopDepth); }; static_cast(this)->actor_wait_state = 21; - #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_20.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont11cont9(Void && _,int loopDepth) { - #line 2814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverStarted").log(); - #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_20 = backupAgent->unlockBackup(dest, tagName); - #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 28010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_20.isReady()) { if (__when_expr_20.isError()) return a_body1Catch1(__when_expr_20.getError(), loopDepth); else return a_body1cont11cont9when1(__when_expr_20.get(), loopDepth); }; static_cast(this)->actor_wait_state = 21; - #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_20.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 28015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -28082,11 +28103,11 @@ class AtomicSwitchoverActorState { } int a_body1cont11cont10(Void const& _,int loopDepth) { - #line 2818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverUnlocked").log(); - #line 2820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AtomicSwitchoverActorState(); static_cast(this)->destroy(); return 0; } - #line 28089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AtomicSwitchoverActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -28096,11 +28117,11 @@ class AtomicSwitchoverActorState { } int a_body1cont11cont10(Void && _,int loopDepth) { - #line 2818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_SwitchoverUnlocked").log(); - #line 2820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AtomicSwitchoverActorState(); static_cast(this)->destroy(); return 0; } - #line 28103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AtomicSwitchoverActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -28171,52 +28192,52 @@ class AtomicSwitchoverActorState { fdb_probe_actor_exit("atomicSwitchover", reinterpret_cast(this), 20); } - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent* backupAgent; - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database dest; - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key tagName; - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Standalone> backupRanges; - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key addPrefix; - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key removePrefix; - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ForceAction forceAction; - #line 2688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent drAgent; - #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID destlogUid; - #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" EBackupState status; - #line 2698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StatusObject srcStatus; - #line 2703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID logUid; - #line 2704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key logUidValue; - #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID logUidCurrent; - #line 2713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Transaction tr; - #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version commitVersion; - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ReadYourWritesTransaction tr2; - #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Optional backupUid; - #line 2752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future versionWatch; - #line 2775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ReadYourWritesTransaction tr3; - #line 28214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via atomicSwitchover() - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AtomicSwitchoverActor final : public Actor, public ActorCallback< AtomicSwitchoverActor, 0, UID >, public ActorCallback< AtomicSwitchoverActor, 1, EBackupState >, public ActorCallback< AtomicSwitchoverActor, 2, StatusObject >, public ActorCallback< AtomicSwitchoverActor, 3, StatusObject >, public ActorCallback< AtomicSwitchoverActor, 4, UID >, public ActorCallback< AtomicSwitchoverActor, 5, Void >, public ActorCallback< AtomicSwitchoverActor, 6, Void >, public ActorCallback< AtomicSwitchoverActor, 7, Void >, public ActorCallback< AtomicSwitchoverActor, 8, Optional >, public ActorCallback< AtomicSwitchoverActor, 9, Optional >, public ActorCallback< AtomicSwitchoverActor, 10, Void >, public ActorCallback< AtomicSwitchoverActor, 11, Void >, public ActorCallback< AtomicSwitchoverActor, 12, Void >, public ActorCallback< AtomicSwitchoverActor, 13, Void >, public ActorCallback< AtomicSwitchoverActor, 14, Void >, public ActorCallback< AtomicSwitchoverActor, 15, Version >, public ActorCallback< AtomicSwitchoverActor, 16, Void >, public ActorCallback< AtomicSwitchoverActor, 17, Void >, public ActorCallback< AtomicSwitchoverActor, 18, Void >, public ActorCallback< AtomicSwitchoverActor, 19, Void >, public ActorCallback< AtomicSwitchoverActor, 20, Void >, public FastAllocated, public AtomicSwitchoverActorState { - #line 28219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -28245,9 +28266,9 @@ friend struct ActorCallback< AtomicSwitchoverActor, 17, Void >; friend struct ActorCallback< AtomicSwitchoverActor, 18, Void >; friend struct ActorCallback< AtomicSwitchoverActor, 19, Void >; friend struct ActorCallback< AtomicSwitchoverActor, 20, Void >; - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AtomicSwitchoverActor(DatabaseBackupAgent* const& backupAgent,Database const& dest,Key const& tagName,Standalone> const& backupRanges,Key const& addPrefix,Key const& removePrefix,ForceAction const& forceAction) - #line 28250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), AtomicSwitchoverActorState(backupAgent, dest, tagName, backupRanges, addPrefix, removePrefix, forceAction) { @@ -28290,33 +28311,33 @@ friend struct ActorCallback< AtomicSwitchoverActor, 20, Void >; } }; - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future atomicSwitchover( DatabaseBackupAgent* const& backupAgent, Database const& dest, Key const& tagName, Standalone> const& backupRanges, Key const& addPrefix, Key const& removePrefix, ForceAction const& forceAction ) { - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new AtomicSwitchoverActor(backupAgent, dest, tagName, backupRanges, addPrefix, removePrefix, forceAction)); - #line 28297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 2822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 2833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 28302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via discontinueBackup() - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class DiscontinueBackupActorState { - #line 28308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DiscontinueBackupActorState(DatabaseBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName) - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr(tr), - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagName(tagName) - #line 28319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("discontinueBackup", reinterpret_cast(this)); @@ -28329,18 +28350,18 @@ class DiscontinueBackupActorState { int a_body1(int loopDepth=0) { try { - #line 2826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = backupAgent->getLogUid(tr, tagName); - #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 28338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 28343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -28361,25 +28382,25 @@ class DiscontinueBackupActorState { } int a_body1cont1(int loopDepth) { - #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = backupAgent->getStateValue(tr, logUid); - #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 28368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 28373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(UID const& __logUid,int loopDepth) { - #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid = __logUid; - #line 28382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -28444,35 +28465,35 @@ class DiscontinueBackupActorState { } int a_body1cont2(int loopDepth) { - #line 2830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_Discontinue").detail("Status", status); - #line 2831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!DatabaseBackupAgent::isRunnable(status)) - #line 28451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(backup_unneeded(), loopDepth); - #line 28455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_2 = tr->get(backupAgent->config.get(BinaryWriter::toValue(logUid, Unversioned())) .pack(DatabaseBackupAgent::keyConfigStopWhenDoneKey)); - #line 2835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 28461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 28466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1when1(EBackupState const& __status,int loopDepth) { - #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" status = __status; - #line 28475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -28537,23 +28558,23 @@ class DiscontinueBackupActorState { } int a_body1cont3(int loopDepth) { - #line 2839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (stopWhenDoneValue.present()) - #line 28542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1Catch1(backup_duplicate(), loopDepth); - #line 28546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(backupAgent->config.get(BinaryWriter::toValue(logUid, Unversioned())) .pack(BackupAgentBase::keyConfigStopWhenDoneKey), StringRef()); - #line 2849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DiscontinueBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 28556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DiscontinueBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -28563,9 +28584,9 @@ class DiscontinueBackupActorState { } int a_body1cont2when1(Optional const& __stopWhenDoneValue,int loopDepth) { - #line 2835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" stopWhenDoneValue = __stopWhenDoneValue; - #line 28568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; @@ -28628,24 +28649,24 @@ class DiscontinueBackupActorState { fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 2); } - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent* backupAgent; - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key tagName; - #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID logUid; - #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" EBackupState status; - #line 2835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Optional stopWhenDoneValue; - #line 28643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via discontinueBackup() - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class DiscontinueBackupActor final : public Actor, public ActorCallback< DiscontinueBackupActor, 0, UID >, public ActorCallback< DiscontinueBackupActor, 1, EBackupState >, public ActorCallback< DiscontinueBackupActor, 2, Optional >, public FastAllocated, public DiscontinueBackupActorState { - #line 28648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -28656,9 +28677,9 @@ class DiscontinueBackupActor final : public Actor, public ActorCallback< D friend struct ActorCallback< DiscontinueBackupActor, 0, UID >; friend struct ActorCallback< DiscontinueBackupActor, 1, EBackupState >; friend struct ActorCallback< DiscontinueBackupActor, 2, Optional >; - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DiscontinueBackupActor(DatabaseBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName) - #line 28661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), DiscontinueBackupActorState(backupAgent, tr, tagName) { @@ -28683,49 +28704,49 @@ friend struct ActorCallback< DiscontinueBackupActor, 2, Optional >; } }; - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future discontinueBackup( DatabaseBackupAgent* const& backupAgent, Reference const& tr, Key const& tagName ) { - #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new DiscontinueBackupActor(backupAgent, tr, tagName)); - #line 28690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 28695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via abortBackup() - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AbortBackupActorState { - #line 28701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AbortBackupActorState(DatabaseBackupAgent* const& backupAgent,Database const& cx,Key const& tagName,PartialBackup const& partial,AbortOldBackup const& abortOldBackup,DstOnly const& dstOnly,WaitForDestUID const& waitForDestUID) - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" cx(cx), - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagName(tagName), - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" partial(partial), - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" abortOldBackup(abortOldBackup), - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" dstOnly(dstOnly), - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" waitForDestUID(waitForDestUID), - #line 2859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr(new ReadYourWritesTransaction(cx)), - #line 2860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUidValue(), - #line 2861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUid(), - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupUid() - #line 28728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("abortBackup", reinterpret_cast(this)); @@ -28738,9 +28759,9 @@ class AbortBackupActorState { int a_body1(int loopDepth=0) { try { - #line 2864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 28743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -28761,11 +28782,11 @@ class AbortBackupActorState { } int a_body1cont1(int loopDepth) { - #line 2916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = makeReference(cx); - #line 2917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 28768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -28780,22 +28801,22 @@ class AbortBackupActorState { int a_body1loopBody1(int loopDepth) { try { - #line 2866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); - #line 2870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = backupAgent->getLogUid(tr, tagName); - #line 2870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 28793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 28798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -28828,18 +28849,18 @@ class AbortBackupActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_AbortError").errorUnsuppressed(e); - #line 2912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_4 = tr->onError(e); - #line 2912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 28837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 2912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 28842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -28852,48 +28873,48 @@ class AbortBackupActorState { } int a_body1loopBody1cont2(UID const& _logUid,int loopDepth) { - #line 2871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid = _logUid; - #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUidValue = BinaryWriter::toValue(logUid, Unversioned()); - #line 2874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusFuture = backupAgent->getStateValue(tr, logUid); - #line 2875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUidFuture = backupAgent->getDestUid(tr, logUid); - #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = success(statusFuture) && success(destUidFuture); - #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 28867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 28872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(UID && _logUid,int loopDepth) { - #line 2871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid = _logUid; - #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUidValue = BinaryWriter::toValue(logUid, Unversioned()); - #line 2874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusFuture = backupAgent->getStateValue(tr, logUid); - #line 2875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUidFuture = backupAgent->getDestUid(tr, logUid); - #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = success(statusFuture) && success(destUidFuture); - #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 28891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 28896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -28963,94 +28984,94 @@ class AbortBackupActorState { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 2878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" EBackupState status = statusFuture.get(); - #line 2879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!backupAgent->isRunnable(status)) - #line 28970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1loopBody1Catch1(backup_unneeded(), loopDepth); - #line 28974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 28995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID destUid = destUidFuture.get(); - #line 2883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (destUid.isValid()) - #line 28980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUidValue = BinaryWriter::toValue(destUid, Unversioned()); - #line 28984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } else { - #line 2885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (destUidValue.size() == 0 && waitForDestUID) - #line 28990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1loopBody1Catch1(not_committed(), loopDepth); - #line 28994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } - #line 2892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_2 = tr->get(backupAgent->states.get(logUidValue).pack(DatabaseBackupAgent::keyFolderId)); - #line 2892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 29001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 29006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 2878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" EBackupState status = statusFuture.get(); - #line 2879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!backupAgent->isRunnable(status)) - #line 29017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1loopBody1Catch1(backup_unneeded(), loopDepth); - #line 29021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 2882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID destUid = destUidFuture.get(); - #line 2883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (destUid.isValid()) - #line 29027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUidValue = BinaryWriter::toValue(destUid, Unversioned()); - #line 29031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } else { - #line 2885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (destUidValue.size() == 0 && waitForDestUID) - #line 29037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return a_body1loopBody1Catch1(not_committed(), loopDepth); - #line 29041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } - #line 2892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_2 = tr->get(backupAgent->states.get(logUidValue).pack(DatabaseBackupAgent::keyFolderId)); - #line 2892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 29048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 29053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -29120,52 +29141,52 @@ class AbortBackupActorState { } int a_body1loopBody1cont4(Optional const& _backupUid,int loopDepth) { - #line 2894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupUid = _backupUid.get(); - #line 2897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(backupAgent->config.get(logUidValue).range()); - #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(logUidValue.withPrefix(applyMutationsEndRange.begin)); - #line 2902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(prefixRange(logUidValue.withPrefix(applyLogKeys.begin))); - #line 2904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(StringRef(backupAgent->states.get(logUidValue).pack(DatabaseBackupAgent::keyStateStatus)), StringRef(DatabaseBackupAgent::getStateText(EBackupState::STATE_PARTIALLY_ABORTED))); - #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = tr->commit(); - #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 29137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont4(Optional && _backupUid,int loopDepth) { - #line 2894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupUid = _backupUid.get(); - #line 2897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(backupAgent->config.get(logUidValue).range()); - #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(logUidValue.withPrefix(applyMutationsEndRange.begin)); - #line 2902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->clear(prefixRange(logUidValue.withPrefix(applyLogKeys.begin))); - #line 2904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(StringRef(backupAgent->states.get(logUidValue).pack(DatabaseBackupAgent::keyStateStatus)), StringRef(DatabaseBackupAgent::getStateText(EBackupState::STATE_PARTIALLY_ABORTED))); - #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_3 = tr->commit(); - #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 29163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -29235,18 +29256,18 @@ class AbortBackupActorState { } int a_body1loopBody1cont9(Void const& _,int loopDepth) { - #line 2908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_Abort").detail("CommitVersion", tr->getCommittedVersion()); - #line 29240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1loopBody1cont9(Void && _,int loopDepth) { - #line 2908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_Abort").detail("CommitVersion", tr->getCommittedVersion()); - #line 29249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -29391,21 +29412,21 @@ class AbortBackupActorState { } int a_body1cont2(int loopDepth) { - #line 2957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!dstOnly) - #line 29396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" partialTimeout = partial ? delay(30.0) : Never(); - #line 2959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr = Reference(new ReadYourWritesTransaction(backupAgent->taskBucket->src)); - #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion = Version(); - #line 2962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endVersion = Version(); - #line 2964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 29408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopHead1(loopDepth); } else @@ -29424,24 +29445,24 @@ class AbortBackupActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); - #line 29433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" try { - #line 2930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_5 = tr->get(logUidValue.withPrefix(applyMutationsBeginRange.begin)); - #line 2930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 29439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 2930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 29444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -29474,16 +29495,16 @@ class AbortBackupActorState { int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_7 = tr->onError(e); - #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 29481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -29496,86 +29517,86 @@ class AbortBackupActorState { } int a_body1cont1loopBody1cont2(Optional const& lastApplied,int loopDepth) { - #line 2931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (lastApplied.present()) - #line 29501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version current = tr->getReadVersion().get(); - #line 2933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version applied = BinaryReader::fromStringRef(lastApplied.get(), Unversioned()); - #line 2934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_AbortVersionUpgrade").detail("Src", applied).detail("Dest", current); - #line 2935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (current <= applied) - #line 29511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - TEST(true); - #line 2939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + CODE_PROBE(true, "Upgrading version of local database."); + #line 2950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(minRequiredCommitVersionKey, BinaryWriter::toValue(applied + 1, Unversioned())); - #line 29517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } else { - #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->addWriteConflictRange(singleKeyRange(minRequiredCommitVersionKey)); - #line 29523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } - #line 2950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = tr->commit(); - #line 2950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 29530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 2950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont2(Optional && lastApplied,int loopDepth) { - #line 2931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (lastApplied.present()) - #line 29544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version current = tr->getReadVersion().get(); - #line 2933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version applied = BinaryReader::fromStringRef(lastApplied.get(), Unversioned()); - #line 2934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" TraceEvent("DBA_AbortVersionUpgrade").detail("Src", applied).detail("Dest", current); - #line 2935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (current <= applied) - #line 29554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - TEST(true); - #line 2939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + CODE_PROBE(true, "Upgrading version of local database."); + #line 2950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(minRequiredCommitVersionKey, BinaryWriter::toValue(applied + 1, Unversioned())); - #line 29560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } else { - #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->addWriteConflictRange(singleKeyRange(minRequiredCommitVersionKey)); - #line 29566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } - #line 2950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_6 = tr->commit(); - #line 2950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 29573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 2950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -29795,11 +29816,11 @@ class AbortBackupActorState { } int a_body1cont3(int loopDepth) { - #line 3029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr = makeReference(cx); - #line 3030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 29802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont3loopHead1(loopDepth); return loopDepth; @@ -29820,22 +29841,22 @@ class AbortBackupActorState { int a_body1cont2loopBody1(int loopDepth) { try { - #line 2966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupVersionF = srcTr->get(backupAgent->sourceStates.get(logUidValue).pack(DatabaseBackupAgent::keyFolderId)); - #line 2970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_8 = success(backupVersionF) || partialTimeout; - #line 2970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 29833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont2loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont2loopBody1when1(__when_expr_8.get(), loopDepth); }; static_cast(this)->actor_wait_state = 9; - #line 2970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -29868,16 +29889,16 @@ class AbortBackupActorState { int a_body1cont2loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 3024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_12 = srcTr->onError(e); - #line 3024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 29875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_12.isReady()) { if (__when_expr_12.isError()) return a_body1Catch1(__when_expr_12.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1Catch1when1(__when_expr_12.get(), loopDepth); }; static_cast(this)->actor_wait_state = 13; - #line 3024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_12.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -29890,106 +29911,106 @@ class AbortBackupActorState { } int a_body1cont2loopBody1cont2(Void const& _,int loopDepth) { - #line 2971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (partialTimeout.isReady()) - #line 29895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 29899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AbortBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupVersionF.get().present() && BinaryReader::fromStringRef(backupVersionF.get().get(), Unversioned()) > BinaryReader::fromStringRef(backupUid, Unversioned())) - #line 29907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 2981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (abortOldBackup) - #line 29913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->set(backupAgent->sourceStates.pack(DatabaseBackupAgent::keyStateStatus), StringRef(BackupAgentBase::getStateText(EBackupState::STATE_ABORTED))); - #line 2984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->set(backupAgent->sourceStates.get(logUidValue).pack(DatabaseBackupAgent::keyFolderId), backupUid); - #line 2986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->clear(prefixRange(logUidValue.withPrefix(backupLogKeys.begin))); - #line 2987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->clear(prefixRange(logUidValue.withPrefix(logRangesRange.begin))); - #line 29923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 2991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key latestVersionKey = logUidValue.withPrefix(destUidValue.withPrefix(backupLatestVersionsPrefix)); - #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bVersionF = srcTr->get(latestVersionKey); - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_9 = success(bVersionF) || partialTimeout; - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 29934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1cont2loopBody1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_9.get(), loopDepth); }; static_cast(this)->actor_wait_state = 10; - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2loopBody1cont2(Void && _,int loopDepth) { - #line 2971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (partialTimeout.isReady()) - #line 29948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 29952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AbortBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupVersionF.get().present() && BinaryReader::fromStringRef(backupVersionF.get().get(), Unversioned()) > BinaryReader::fromStringRef(backupUid, Unversioned())) - #line 29960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 2981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (abortOldBackup) - #line 29966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->set(backupAgent->sourceStates.pack(DatabaseBackupAgent::keyStateStatus), StringRef(BackupAgentBase::getStateText(EBackupState::STATE_ABORTED))); - #line 2984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->set(backupAgent->sourceStates.get(logUidValue).pack(DatabaseBackupAgent::keyFolderId), backupUid); - #line 2986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->clear(prefixRange(logUidValue.withPrefix(backupLogKeys.begin))); - #line 2987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->clear(prefixRange(logUidValue.withPrefix(logRangesRange.begin))); - #line 29976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 29997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 2991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key latestVersionKey = logUidValue.withPrefix(destUidValue.withPrefix(backupLatestVersionsPrefix)); - #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" bVersionF = srcTr->get(latestVersionKey); - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_9 = success(bVersionF) || partialTimeout; - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 29987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1cont2loopBody1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_9.get(), loopDepth); }; static_cast(this)->actor_wait_state = 10; - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -30059,88 +30080,88 @@ class AbortBackupActorState { } int a_body1cont2loopBody1cont3(Void const& _,int loopDepth) { - #line 2995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (partialTimeout.isReady()) - #line 30064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 30068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AbortBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (bVersionF.get().present()) - #line 30076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion = BinaryReader::fromStringRef(bVersionF.get().get(), Unversioned()); - #line 30080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } else { return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->set(backupAgent->sourceStates.pack(DatabaseBackupAgent::keyStateStatus), StringRef(DatabaseBackupAgent::getStateText(EBackupState::STATE_PARTIALLY_ABORTED))); - #line 3007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->set(backupAgent->sourceStates.get(logUidValue).pack(DatabaseBackupAgent::keyFolderId), backupUid); - #line 3010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_10 = eraseLogData(srcTr, logUidValue, destUidValue) || partialTimeout; - #line 3010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 30094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1cont2loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont2loopBody1cont3when1(__when_expr_10.get(), loopDepth); }; static_cast(this)->actor_wait_state = 11; - #line 3010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 30099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2loopBody1cont3(Void && _,int loopDepth) { - #line 2995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (partialTimeout.isReady()) - #line 30108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 2996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 30112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AbortBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (bVersionF.get().present()) - #line 30120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" beginVersion = BinaryReader::fromStringRef(bVersionF.get().get(), Unversioned()); - #line 30124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } else { return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->set(backupAgent->sourceStates.pack(DatabaseBackupAgent::keyStateStatus), StringRef(DatabaseBackupAgent::getStateText(EBackupState::STATE_PARTIALLY_ABORTED))); - #line 3007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcTr->set(backupAgent->sourceStates.get(logUidValue).pack(DatabaseBackupAgent::keyFolderId), backupUid); - #line 3010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_10 = eraseLogData(srcTr, logUidValue, destUidValue) || partialTimeout; - #line 3010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 30138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1cont2loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont2loopBody1cont3when1(__when_expr_10.get(), loopDepth); }; static_cast(this)->actor_wait_state = 11; - #line 3010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 30143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -30210,56 +30231,56 @@ class AbortBackupActorState { } int a_body1cont2loopBody1cont7(Void const& _,int loopDepth) { - #line 3011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (partialTimeout.isReady()) - #line 30215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 30219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AbortBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_11 = srcTr->commit() || partialTimeout; - #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 30229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1cont2loopBody1Catch1(__when_expr_11.getError(), loopDepth); else return a_body1cont2loopBody1cont7when1(__when_expr_11.get(), loopDepth); }; static_cast(this)->actor_wait_state = 12; - #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_11.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 30234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2loopBody1cont7(Void && _,int loopDepth) { - #line 3011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (partialTimeout.isReady()) - #line 30243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 30247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AbortBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_11 = srcTr->commit() || partialTimeout; - #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 30257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1cont2loopBody1Catch1(__when_expr_11.getError(), loopDepth); else return a_body1cont2loopBody1cont7when1(__when_expr_11.get(), loopDepth); }; static_cast(this)->actor_wait_state = 12; - #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_11.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 30262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -30329,42 +30350,42 @@ class AbortBackupActorState { } int a_body1cont2loopBody1cont11(Void const& _,int loopDepth) { - #line 3016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (partialTimeout.isReady()) - #line 30334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 30338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AbortBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endVersion = srcTr->getCommittedVersion() + 1; - #line 30346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1cont2loopBody1cont11(Void && _,int loopDepth) { - #line 3016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (partialTimeout.isReady()) - #line 30355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 30359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AbortBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" endVersion = srcTr->getCommittedVersion() + 1; - #line 30367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -30517,20 +30538,20 @@ class AbortBackupActorState { int a_body1cont3loopBody1(int loopDepth) { try { - #line 3032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 3033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_13 = tr->get(StringRef(backupAgent->config.get(logUidValue).pack(DatabaseBackupAgent::keyFolderId))); - #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 30528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_13.isReady()) { if (__when_expr_13.isError()) return a_body1cont3loopBody1Catch1(__when_expr_13.getError(), loopDepth); else return a_body1cont3loopBody1when1(__when_expr_13.get(), loopDepth); }; static_cast(this)->actor_wait_state = 14; - #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_13.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 30533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -30550,16 +30571,16 @@ class AbortBackupActorState { int a_body1cont3loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 3048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_15 = tr->onError(e); - #line 3048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 30557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_15.isReady()) { if (__when_expr_15.isError()) return a_body1Catch1(__when_expr_15.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1Catch1when1(__when_expr_15.get(), loopDepth); }; static_cast(this)->actor_wait_state = 16; - #line 3048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_15.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 30562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -30572,60 +30593,60 @@ class AbortBackupActorState { } int a_body1cont3loopBody1cont2(Optional const& v,int loopDepth) { - #line 3037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (v.present()) - #line 30577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 30581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AbortBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(StringRef(backupAgent->states.get(logUidValue).pack(DatabaseBackupAgent::keyStateStatus)), StringRef(DatabaseBackupAgent::getStateText(EBackupState::STATE_ABORTED))); - #line 3044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_14 = tr->commit(); - #line 3044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 30593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_14.isReady()) { if (__when_expr_14.isError()) return a_body1cont3loopBody1Catch1(__when_expr_14.getError(), loopDepth); else return a_body1cont3loopBody1cont2when1(__when_expr_14.get(), loopDepth); }; static_cast(this)->actor_wait_state = 15; - #line 3044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_14.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 30598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3loopBody1cont2(Optional && v,int loopDepth) { - #line 3037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (v.present()) - #line 30607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 30611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AbortBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->set(StringRef(backupAgent->states.get(logUidValue).pack(DatabaseBackupAgent::keyStateStatus)), StringRef(DatabaseBackupAgent::getStateText(EBackupState::STATE_ABORTED))); - #line 3044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_14 = tr->commit(); - #line 3044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 30623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_14.isReady()) { if (__when_expr_14.isError()) return a_body1cont3loopBody1Catch1(__when_expr_14.getError(), loopDepth); else return a_body1cont3loopBody1cont2when1(__when_expr_14.get(), loopDepth); }; static_cast(this)->actor_wait_state = 15; - #line 3044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_14.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 30628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -30695,9 +30716,9 @@ class AbortBackupActorState { } int a_body1cont3loopBody1cont3(Void const& _,int loopDepth) { - #line 3046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 30700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AbortBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -30707,9 +30728,9 @@ class AbortBackupActorState { } int a_body1cont3loopBody1cont3(Void && _,int loopDepth) { - #line 3046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 30712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AbortBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -30855,50 +30876,50 @@ class AbortBackupActorState { fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 15); } - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent* backupAgent; - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key tagName; - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" PartialBackup partial; - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AbortOldBackup abortOldBackup; - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DstOnly dstOnly; - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" WaitForDestUID waitForDestUID; - #line 2859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 2860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key logUidValue, destUidValue; - #line 2861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID logUid, destUid; - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Value backupUid; - #line 2874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future statusFuture; - #line 2875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future destUidFuture; - #line 2958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future partialTimeout; - #line 2959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference srcTr; - #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version beginVersion; - #line 2962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version endVersion; - #line 2968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future> backupVersionF; - #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future> bVersionF; - #line 30896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via abortBackup() - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class AbortBackupActor final : public Actor, public ActorCallback< AbortBackupActor, 0, UID >, public ActorCallback< AbortBackupActor, 1, Void >, public ActorCallback< AbortBackupActor, 2, Optional >, public ActorCallback< AbortBackupActor, 3, Void >, public ActorCallback< AbortBackupActor, 4, Void >, public ActorCallback< AbortBackupActor, 5, Optional >, public ActorCallback< AbortBackupActor, 6, Void >, public ActorCallback< AbortBackupActor, 7, Void >, public ActorCallback< AbortBackupActor, 8, Void >, public ActorCallback< AbortBackupActor, 9, Void >, public ActorCallback< AbortBackupActor, 10, Void >, public ActorCallback< AbortBackupActor, 11, Void >, public ActorCallback< AbortBackupActor, 12, Void >, public ActorCallback< AbortBackupActor, 13, Optional >, public ActorCallback< AbortBackupActor, 14, Void >, public ActorCallback< AbortBackupActor, 15, Void >, public FastAllocated, public AbortBackupActorState { - #line 30901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -30922,9 +30943,9 @@ friend struct ActorCallback< AbortBackupActor, 12, Void >; friend struct ActorCallback< AbortBackupActor, 13, Optional >; friend struct ActorCallback< AbortBackupActor, 14, Void >; friend struct ActorCallback< AbortBackupActor, 15, Void >; - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" AbortBackupActor(DatabaseBackupAgent* const& backupAgent,Database const& cx,Key const& tagName,PartialBackup const& partial,AbortOldBackup const& abortOldBackup,DstOnly const& dstOnly,WaitForDestUID const& waitForDestUID) - #line 30927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), AbortBackupActorState(backupAgent, cx, tagName, partial, abortOldBackup, dstOnly, waitForDestUID) { @@ -30962,37 +30983,37 @@ friend struct ActorCallback< AbortBackupActor, 15, Void >; } }; - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future abortBackup( DatabaseBackupAgent* const& backupAgent, Database const& cx, Key const& tagName, PartialBackup const& partial, AbortOldBackup const& abortOldBackup, DstOnly const& dstOnly, WaitForDestUID const& waitForDestUID ) { - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new AbortBackupActor(backupAgent, cx, tagName, partial, abortOldBackup, dstOnly, waitForDestUID)); - #line 30969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 3052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 3063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 30974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 30995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via getStatus() - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class GetStatusActorState { - #line 30980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" GetStatusActorState(DatabaseBackupAgent* const& backupAgent,Database const& cx,int const& errorLimit,Key const& tagName) - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" cx(cx), - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" errorLimit(errorLimit), - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagName(tagName), - #line 3057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr(new ReadYourWritesTransaction(cx)) - #line 30995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("getStatus", reinterpret_cast(this)); @@ -31005,15 +31026,15 @@ class GetStatusActorState { int a_body1(int loopDepth=0) { try { - #line 3058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 3059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusText = std::string(); - #line 3060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" retries = 0; - #line 3062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" ; - #line 31016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -31034,9 +31055,9 @@ class GetStatusActorState { } int a_body1cont1(int loopDepth) { - #line 3213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(statusText); this->~GetStatusActorState(); static_cast(this)->destroy(); return 0; } - #line 31039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< std::string >::value()) std::string(std::move(statusText)); // state_var_RVO this->~GetStatusActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -31054,16 +31075,20 @@ class GetStatusActorState { int a_body1loopBody1(int loopDepth) { try { - #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 3076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 3078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_0 = success(tr->getReadVersion()); - #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 31061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 31066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -31096,32 +31121,32 @@ class GetStatusActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 3204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" retries++; - #line 3205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (retries > 5) - #line 31103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusText += format("\nWARNING: Could not fetch full DR status: %s\n", e.name()); - #line 3207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(statusText); this->~GetStatusActorState(); static_cast(this)->destroy(); return 0; } - #line 31109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< std::string >::value()) std::string(std::move(statusText)); // state_var_RVO this->~GetStatusActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_12 = tr->onError(e); - #line 3209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 31119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_12.isReady()) { if (__when_expr_12.isError()) return a_body1Catch1(__when_expr_12.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_12.get(), loopDepth); }; static_cast(this)->actor_wait_state = 13; - #line 3209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_12.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 31124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -31134,48 +31159,48 @@ class GetStatusActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 3067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" scrTr = Transaction(backupAgent->taskBucket->src); - #line 3068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" scrTr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 3069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcReadVersion = scrTr.getReadVersion(); - #line 3071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusText = ""; - #line 3073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = backupAgent->getLogUid(tr, tagName); - #line 3073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 31149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 31154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 3067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" scrTr = Transaction(backupAgent->taskBucket->src); - #line 3068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" scrTr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 3069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" srcReadVersion = scrTr.getReadVersion(); - #line 3071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusText = ""; - #line 3073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_1 = backupAgent->getLogUid(tr, tagName); - #line 3073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 31173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 31178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -31245,45 +31270,41 @@ class GetStatusActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 3075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 3076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 3078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" fPaused = tr->get(backupAgent->taskBucket->getPauseKey()); - #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" fErrorValues = errorLimit > 0 ? tr->getRange(backupAgent->errors.get(BinaryWriter::toValue(logUid, Unversioned())).range(), errorLimit, Snapshot::False, Reverse::True) : Future(); - #line 3086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" fBackupUid = tr->get(backupAgent->states.get(BinaryWriter::toValue(logUid, Unversioned())) .pack(DatabaseBackupAgent::keyFolderId)); - #line 3089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" fBackupVerison = tr->get(BinaryWriter::toValue(logUid, Unversioned()).withPrefix(applyMutationsBeginRange.begin)); - #line 3091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" fTagName = tr->get(backupAgent->states.get(BinaryWriter::toValue(logUid, Unversioned())) .pack(BackupAgentBase::keyConfigBackupTag)); - #line 3094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" fStopVersionKey = tr->get(backupAgent->states.get(BinaryWriter::toValue(logUid, Unversioned())) .pack(BackupAgentBase::keyStateStop)); - #line 3097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" fBackupKeysPacked = tr->get(backupAgent->config.get(BinaryWriter::toValue(logUid, Unversioned())) .pack(BackupAgentBase::keyConfigBackupRanges)); - #line 3100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" flogVersionKey = tr->get(backupAgent->states.get(BinaryWriter::toValue(logUid, Unversioned())) .pack(BackupAgentBase::keyStateLogBeginVersion)); - #line 3104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_2 = backupAgent->getStateValue(tr, logUid); - #line 3104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 31272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 3104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 31277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2when1(UID const& __logUid,int loopDepth) { - #line 3073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid = __logUid; - #line 31286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; @@ -31348,29 +31369,29 @@ class GetStatusActorState { } int a_body1loopBody1cont4(int loopDepth) { - #line 3106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupState == EBackupState::STATE_NEVERRAN) - #line 31353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusText += "No previous backups found.\n"; - #line 31357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont5(loopDepth); } else { - #line 3109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagNameDisplay = std::string(); - #line 3110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_3 = fTagName; - #line 3110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 31368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 3110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 31373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -31378,9 +31399,9 @@ class GetStatusActorState { } int a_body1loopBody1cont3when1(EBackupState const& __backupState,int loopDepth) { - #line 3104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupState = __backupState; - #line 31383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont4(loopDepth); return loopDepth; @@ -31445,20 +31466,20 @@ class GetStatusActorState { } int a_body1loopBody1cont5(int loopDepth) { - #line 3167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (errorLimit > 0) - #line 31450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_7 = fErrorValues; - #line 3168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 31456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 3168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 31461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -31470,48 +31491,48 @@ class GetStatusActorState { } int a_body1loopBody1cont7(Optional const& tagName,int loopDepth) { - #line 3113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (tagName.present()) - #line 31475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagNameDisplay = tagName.get().toString(); - #line 31479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_4 = fStopVersionKey; - #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 31485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont7when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 31490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont7(Optional && tagName,int loopDepth) { - #line 3113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (tagName.present()) - #line 31499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagNameDisplay = tagName.get().toString(); - #line 31503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_4 = fStopVersionKey; - #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 31509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont7when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 31514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -31581,25 +31602,25 @@ class GetStatusActorState { } int a_body1loopBody1cont8(int loopDepth) { - #line 3118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_5 = flogVersionKey; - #line 3118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 31588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont8when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 3118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 31593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont7when1(Optional const& __stopVersionKey,int loopDepth) { - #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" stopVersionKey = __stopVersionKey; - #line 31602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont8(loopDepth); return loopDepth; @@ -31664,36 +31685,36 @@ class GetStatusActorState { } int a_body1loopBody1cont10(Optional const& logVersionKey,int loopDepth) { - #line 3119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logVersionText = ". Last log version is " + (logVersionKey.present() ? format("%lld", BinaryReader::fromStringRef(logVersionKey.get(), Unversioned())) : "unset"); - #line 3124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_6 = fBackupKeysPacked; - #line 3124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 31673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1loopBody1cont10when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 3124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 31678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont10(Optional && logVersionKey,int loopDepth) { - #line 3119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logVersionText = ". Last log version is " + (logVersionKey.present() ? format("%lld", BinaryReader::fromStringRef(logVersionKey.get(), Unversioned())) : "unset"); - #line 3124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_6 = fBackupKeysPacked; - #line 3124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 31691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1loopBody1cont10when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 3124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 31696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -31763,42 +31784,42 @@ class GetStatusActorState { } int a_body1loopBody1cont10cont1(Optional const& backupKeysPacked,int loopDepth) { - #line 3126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRanges = Standalone>(); - #line 3127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupKeysPacked.present()) - #line 31770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" BinaryReader br(backupKeysPacked.get(), IncludeVersion()); - #line 3129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" br >> backupRanges; - #line 31776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 3132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" switch (backupState) { case EBackupState::STATE_SUBMITTED: statusText += "The DR on tag `" + tagNameDisplay + "' is NOT a complete copy of the primary database (just started).\n"; break; case EBackupState::STATE_RUNNING: statusText += "The DR on tag `" + tagNameDisplay + "' is NOT a complete copy of the primary database.\n"; break; case EBackupState::STATE_RUNNING_DIFFERENTIAL: statusText += "The DR on tag `" + tagNameDisplay + "' is a complete copy of the primary database" + logVersionText + ".\n"; break; case EBackupState::STATE_COMPLETED: { Version stopVersion = stopVersionKey.present() ? BinaryReader::fromStringRef(stopVersionKey.get(), Unversioned()) : -1; statusText += "The previous DR on tag `" + tagNameDisplay + "' completed at version " + format("%lld", stopVersion) + ".\n"; } break; case EBackupState::STATE_PARTIALLY_ABORTED: { statusText += "The previous DR on tag `" + tagNameDisplay + "' " + BackupAgentBase::getStateText(backupState) + logVersionText + ".\n"; statusText += "Abort the DR with --cleanup before starting a new DR.\n"; break; } default: statusText += "The previous DR on tag `" + tagNameDisplay + "' " + BackupAgentBase::getStateText(backupState) + logVersionText + ".\n"; break; }; - #line 31780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; } int a_body1loopBody1cont10cont1(Optional && backupKeysPacked,int loopDepth) { - #line 3126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" backupRanges = Standalone>(); - #line 3127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupKeysPacked.present()) - #line 31791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" BinaryReader br(backupKeysPacked.get(), IncludeVersion()); - #line 3129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" br >> backupRanges; - #line 31797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } - #line 3132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" switch (backupState) { case EBackupState::STATE_SUBMITTED: statusText += "The DR on tag `" + tagNameDisplay + "' is NOT a complete copy of the primary database (just started).\n"; break; case EBackupState::STATE_RUNNING: statusText += "The DR on tag `" + tagNameDisplay + "' is NOT a complete copy of the primary database.\n"; break; case EBackupState::STATE_RUNNING_DIFFERENTIAL: statusText += "The DR on tag `" + tagNameDisplay + "' is a complete copy of the primary database" + logVersionText + ".\n"; break; case EBackupState::STATE_COMPLETED: { Version stopVersion = stopVersionKey.present() ? BinaryReader::fromStringRef(stopVersionKey.get(), Unversioned()) : -1; statusText += "The previous DR on tag `" + tagNameDisplay + "' completed at version " + format("%lld", stopVersion) + ".\n"; } break; case EBackupState::STATE_PARTIALLY_ABORTED: { statusText += "The previous DR on tag `" + tagNameDisplay + "' " + BackupAgentBase::getStateText(backupState) + logVersionText + ".\n"; statusText += "Abort the DR with --cleanup before starting a new DR.\n"; break; } default: statusText += "The previous DR on tag `" + tagNameDisplay + "' " + BackupAgentBase::getStateText(backupState) + logVersionText + ".\n"; break; }; - #line 31801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; @@ -31868,33 +31889,33 @@ class GetStatusActorState { } int a_body1loopBody1cont11(int loopDepth) { - #line 3185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_8 = fBackupUid; - #line 3185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 31875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1loopBody1cont11when1(__when_expr_8.get(), loopDepth); }; static_cast(this)->actor_wait_state = 9; - #line 3185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 31880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont12(RangeResult const& values,int loopDepth) { - #line 3171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (values.size() > 0) - #line 31889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusText += (values.size() < errorLimit) ? "WARNING: Some DR agents have reported issues:\n" : "WARNING: Some DR agents have reported issues (printing " + std::to_string(errorLimit) + "):\n"; - #line 3178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto& s : values ) { - #line 3179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusText += " " + printable(s.value) + "\n"; - #line 31897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } loopDepth = a_body1loopBody1cont11(loopDepth); @@ -31903,17 +31924,17 @@ class GetStatusActorState { } int a_body1loopBody1cont12(RangeResult && values,int loopDepth) { - #line 3171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (values.size() > 0) - #line 31908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusText += (values.size() < errorLimit) ? "WARNING: Some DR agents have reported issues:\n" : "WARNING: Some DR agents have reported issues (printing " + std::to_string(errorLimit) + "):\n"; - #line 3178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" for( auto& s : values ) { - #line 3179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusText += " " + printable(s.value) + "\n"; - #line 31916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 31937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } } loopDepth = a_body1loopBody1cont11(loopDepth); @@ -31985,20 +32006,20 @@ class GetStatusActorState { } int a_body1loopBody1cont11cont1(Optional const& backupUid,int loopDepth) { - #line 3186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupUid.present()) - #line 31990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_9 = fBackupVerison; - #line 3187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 31996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1loopBody1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1loopBody1cont11cont1when1(__when_expr_9.get(), loopDepth); }; static_cast(this)->actor_wait_state = 10; - #line 3187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 32001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -32010,20 +32031,20 @@ class GetStatusActorState { } int a_body1loopBody1cont11cont1(Optional && backupUid,int loopDepth) { - #line 3186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (backupUid.present()) - #line 32015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_9 = fBackupVerison; - #line 3187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 32021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1loopBody1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1loopBody1cont11cont1when1(__when_expr_9.get(), loopDepth); }; static_cast(this)->actor_wait_state = 10; - #line 3187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 32026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -32098,38 +32119,38 @@ class GetStatusActorState { } int a_body1loopBody1cont11cont2(int loopDepth) { - #line 3197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_11 = fPaused; - #line 3197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 32105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1loopBody1Catch1(__when_expr_11.getError(), loopDepth); else return a_body1loopBody1cont11cont2when1(__when_expr_11.get(), loopDepth); }; static_cast(this)->actor_wait_state = 12; - #line 3197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_11.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 32110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont11cont3(Optional const& v,int loopDepth) { - #line 3188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (v.present()) - #line 32119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destApplyBegin = BinaryReader::fromStringRef(v.get(), Unversioned()); - #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_10 = srcReadVersion; - #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 32127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1loopBody1cont11cont3when1(__when_expr_10.get(), loopDepth); }; static_cast(this)->actor_wait_state = 11; - #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 32132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -32141,22 +32162,22 @@ class GetStatusActorState { } int a_body1loopBody1cont11cont3(Optional && v,int loopDepth) { - #line 3188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (v.present()) - #line 32146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destApplyBegin = BinaryReader::fromStringRef(v.get(), Unversioned()); - #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture __when_expr_10 = srcReadVersion; - #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 32154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1loopBody1cont11cont3when1(__when_expr_10.get(), loopDepth); }; static_cast(this)->actor_wait_state = 11; - #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 32159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -32237,22 +32258,22 @@ class GetStatusActorState { } int a_body1loopBody1cont11cont5(Version const& sourceVersion,int loopDepth) { - #line 3191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" double secondsBehind = ((double)(sourceVersion - destApplyBegin)) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND; - #line 3193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusText += format("\nThe DR is %.6f seconds behind.\n", secondsBehind); - #line 32244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont11cont4(loopDepth); return loopDepth; } int a_body1loopBody1cont11cont5(Version && sourceVersion,int loopDepth) { - #line 3191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" double secondsBehind = ((double)(sourceVersion - destApplyBegin)) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND; - #line 3193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusText += format("\nThe DR is %.6f seconds behind.\n", secondsBehind); - #line 32255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont11cont4(loopDepth); return loopDepth; @@ -32322,13 +32343,13 @@ class GetStatusActorState { } int a_body1loopBody1cont11cont7(Optional const& paused,int loopDepth) { - #line 3198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (paused.present()) - #line 32327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusText += format("\nAll DR agents have been paused.\n"); - #line 32331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } return a_body1break1(loopDepth==0?0:loopDepth-1); // break @@ -32336,13 +32357,13 @@ class GetStatusActorState { } int a_body1loopBody1cont11cont7(Optional && paused,int loopDepth) { - #line 3198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (paused.present()) - #line 32341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { - #line 3199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusText += format("\nAll DR agents have been paused.\n"); - #line 32345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } return a_body1break1(loopDepth==0?0:loopDepth-1); // break @@ -32486,60 +32507,60 @@ class GetStatusActorState { fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 12); } - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent* backupAgent; - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Database cx; - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int errorLimit; - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key tagName; - #line 3057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 3059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::string statusText; - #line 3060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" int retries; - #line 3067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Transaction scrTr; - #line 3069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future srcReadVersion; - #line 3073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID logUid; - #line 3078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future> fPaused; - #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future fErrorValues; - #line 3086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future> fBackupUid; - #line 3089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future> fBackupVerison; - #line 3091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future> fTagName; - #line 3094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future> fStopVersionKey; - #line 3097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future> fBackupKeysPacked; - #line 3100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Future> flogVersionKey; - #line 3104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" EBackupState backupState; - #line 3109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::string tagNameDisplay; - #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Optional stopVersionKey; - #line 3119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" std::string logVersionText; - #line 3126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Standalone> backupRanges; - #line 3189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Version destApplyBegin; - #line 32537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via getStatus() - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class GetStatusActor final : public Actor, public ActorCallback< GetStatusActor, 0, Void >, public ActorCallback< GetStatusActor, 1, UID >, public ActorCallback< GetStatusActor, 2, EBackupState >, public ActorCallback< GetStatusActor, 3, Optional >, public ActorCallback< GetStatusActor, 4, Optional >, public ActorCallback< GetStatusActor, 5, Optional >, public ActorCallback< GetStatusActor, 6, Optional >, public ActorCallback< GetStatusActor, 7, RangeResult >, public ActorCallback< GetStatusActor, 8, Optional >, public ActorCallback< GetStatusActor, 9, Optional >, public ActorCallback< GetStatusActor, 10, Version >, public ActorCallback< GetStatusActor, 11, Optional >, public ActorCallback< GetStatusActor, 12, Void >, public FastAllocated, public GetStatusActorState { - #line 32542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -32560,9 +32581,9 @@ friend struct ActorCallback< GetStatusActor, 9, Optional >; friend struct ActorCallback< GetStatusActor, 10, Version >; friend struct ActorCallback< GetStatusActor, 11, Optional >; friend struct ActorCallback< GetStatusActor, 12, Void >; - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" GetStatusActor(DatabaseBackupAgent* const& backupAgent,Database const& cx,int const& errorLimit,Key const& tagName) - #line 32565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), GetStatusActorState(backupAgent, cx, errorLimit, tagName) { @@ -32597,35 +32618,35 @@ friend struct ActorCallback< GetStatusActor, 12, Void >; } }; - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future getStatus( DatabaseBackupAgent* const& backupAgent, Database const& cx, int const& errorLimit, Key const& tagName ) { - #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new GetStatusActor(backupAgent, cx, errorLimit, tagName)); - #line 32604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 3226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 32609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via getStateValue() - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class GetStateValueActorState { - #line 32615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" GetStateValueActorState(DatabaseBackupAgent* const& backupAgent,Reference const& tr,UID const& logUid,Snapshot const& snapshot) - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr(tr), - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid(logUid), - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" snapshot(snapshot) - #line 32628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("getStateValue", reinterpret_cast(this)); @@ -32638,22 +32659,22 @@ class GetStateValueActorState { int a_body1(int loopDepth=0) { try { - #line 3220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 3222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" statusKey = backupAgent->states.get(BinaryWriter::toValue(logUid, Unversioned())) .pack(DatabaseBackupAgent::keyStateStatus); - #line 3224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_0 = tr->get(statusKey, snapshot); - #line 3224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 32651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 32656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -32674,9 +32695,9 @@ class GetStateValueActorState { } int a_body1cont1(Optional const& status,int loopDepth) { - #line 3226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)((!status.present()) ? EBackupState::STATE_NEVERRAN : BackupAgentBase::getState(status.get().toString())); this->~GetStateValueActorState(); static_cast(this)->destroy(); return 0; } - #line 32679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< EBackupState >::value()) EBackupState((!status.present()) ? EBackupState::STATE_NEVERRAN : BackupAgentBase::getState(status.get().toString())); this->~GetStateValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -32686,9 +32707,9 @@ class GetStateValueActorState { } int a_body1cont1(Optional && status,int loopDepth) { - #line 3226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)((!status.present()) ? EBackupState::STATE_NEVERRAN : BackupAgentBase::getState(status.get().toString())); this->~GetStateValueActorState(); static_cast(this)->destroy(); return 0; } - #line 32691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< EBackupState >::value()) EBackupState((!status.present()) ? EBackupState::STATE_NEVERRAN : BackupAgentBase::getState(status.get().toString())); this->~GetStateValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -32759,22 +32780,22 @@ class GetStateValueActorState { fdb_probe_actor_exit("getStateValue", reinterpret_cast(this), 0); } - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent* backupAgent; - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID logUid; - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Snapshot snapshot; - #line 3222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key statusKey; - #line 32772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via getStateValue() - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class GetStateValueActor final : public Actor, public ActorCallback< GetStateValueActor, 0, Optional >, public FastAllocated, public GetStateValueActorState { - #line 32777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -32783,9 +32804,9 @@ class GetStateValueActor final : public Actor, public ActorCallbac void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetStateValueActor, 0, Optional >; - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" GetStateValueActor(DatabaseBackupAgent* const& backupAgent,Reference const& tr,UID const& logUid,Snapshot const& snapshot) - #line 32788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), GetStateValueActorState(backupAgent, tr, logUid, snapshot) { @@ -32808,35 +32829,35 @@ friend struct ActorCallback< GetStateValueActor, 0, Optional >; } }; - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future getStateValue( DatabaseBackupAgent* const& backupAgent, Reference const& tr, UID const& logUid, Snapshot const& snapshot ) { - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new GetStateValueActor(backupAgent, tr, logUid, snapshot)); - #line 32815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 3228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 3239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 32820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via getDestUid() - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class GetDestUidActorState { - #line 32826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" GetDestUidActorState(DatabaseBackupAgent* const& backupAgent,Reference const& tr,UID const& logUid,Snapshot const& snapshot) - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr(tr), - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid(logUid), - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" snapshot(snapshot) - #line 32839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("getDestUid", reinterpret_cast(this)); @@ -32849,22 +32870,22 @@ class GetDestUidActorState { int a_body1(int loopDepth=0) { try { - #line 3233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 3234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 3235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" destUidKey = backupAgent->config.get(BinaryWriter::toValue(logUid, Unversioned())).pack(BackupAgentBase::destUid); - #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_0 = tr->get(destUidKey, snapshot); - #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 32862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 32867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -32885,9 +32906,9 @@ class GetDestUidActorState { } int a_body1cont1(Optional const& destUid,int loopDepth) { - #line 3239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)((destUid.present()) ? BinaryReader::fromStringRef(destUid.get(), Unversioned()) : UID()); this->~GetDestUidActorState(); static_cast(this)->destroy(); return 0; } - #line 32890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< UID >::value()) UID((destUid.present()) ? BinaryReader::fromStringRef(destUid.get(), Unversioned()) : UID()); this->~GetDestUidActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -32897,9 +32918,9 @@ class GetDestUidActorState { } int a_body1cont1(Optional && destUid,int loopDepth) { - #line 3239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)((destUid.present()) ? BinaryReader::fromStringRef(destUid.get(), Unversioned()) : UID()); this->~GetDestUidActorState(); static_cast(this)->destroy(); return 0; } - #line 32902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 32923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< UID >::value()) UID((destUid.present()) ? BinaryReader::fromStringRef(destUid.get(), Unversioned()) : UID()); this->~GetDestUidActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -32970,22 +32991,22 @@ class GetDestUidActorState { fdb_probe_actor_exit("getDestUid", reinterpret_cast(this), 0); } - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent* backupAgent; - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" UID logUid; - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Snapshot snapshot; - #line 3235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key destUidKey; - #line 32983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via getDestUid() - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class GetDestUidActor final : public Actor, public ActorCallback< GetDestUidActor, 0, Optional >, public FastAllocated, public GetDestUidActorState { - #line 32988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -32994,9 +33015,9 @@ class GetDestUidActor final : public Actor, public ActorCallback< GetDestUi void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetDestUidActor, 0, Optional >; - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" GetDestUidActor(DatabaseBackupAgent* const& backupAgent,Reference const& tr,UID const& logUid,Snapshot const& snapshot) - #line 32999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), GetDestUidActorState(backupAgent, tr, logUid, snapshot) { @@ -33019,35 +33040,35 @@ friend struct ActorCallback< GetDestUidActor, 0, Optional >; } }; - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future getDestUid( DatabaseBackupAgent* const& backupAgent, Reference const& tr, UID const& logUid, Snapshot const& snapshot ) { - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new GetDestUidActor(backupAgent, tr, logUid, snapshot)); - #line 33026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 3241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 3252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 33031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" // This generated class is to be used only via getLogUid() - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" template - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class GetLogUidActorState { - #line 33037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" GetLogUidActorState(DatabaseBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName,Snapshot const& snapshot) - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr(tr), - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tagName(tagName), - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" snapshot(snapshot) - #line 33050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" { fdb_probe_actor_create("getLogUid", reinterpret_cast(this)); @@ -33060,20 +33081,20 @@ class GetLogUidActorState { int a_body1(int loopDepth=0) { try { - #line 3246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 3247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 3248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" StrictFuture> __when_expr_0 = tr->get(backupAgent->tagNames.pack(tagName), snapshot); - #line 3248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 33071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 33076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -33094,9 +33115,9 @@ class GetLogUidActorState { } int a_body1cont1(int loopDepth) { - #line 3250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)((logUid.present()) ? BinaryReader::fromStringRef(logUid.get(), Unversioned()) : UID()); this->~GetLogUidActorState(); static_cast(this)->destroy(); return 0; } - #line 33099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< UID >::value()) UID((logUid.present()) ? BinaryReader::fromStringRef(logUid.get(), Unversioned()) : UID()); this->~GetLogUidActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -33106,9 +33127,9 @@ class GetLogUidActorState { } int a_body1when1(Optional const& __logUid,int loopDepth) { - #line 3248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" logUid = __logUid; - #line 33111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -33171,22 +33192,22 @@ class GetLogUidActorState { fdb_probe_actor_exit("getLogUid", reinterpret_cast(this), 0); } - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" DatabaseBackupAgent* backupAgent; - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Reference tr; - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Key tagName; - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Snapshot snapshot; - #line 3248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" Optional logUid; - #line 33184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" }; // This generated class is to be used only via getLogUid() - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" class GetLogUidActor final : public Actor, public ActorCallback< GetLogUidActor, 0, Optional >, public FastAllocated, public GetLogUidActorState { - #line 33189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -33195,9 +33216,9 @@ class GetLogUidActor final : public Actor, public ActorCallback< GetLogUidA void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetLogUidActor, 0, Optional >; - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" GetLogUidActor(DatabaseBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName,Snapshot const& snapshot) - #line 33200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" : Actor(), GetLogUidActorState(backupAgent, tr, tagName, snapshot) { @@ -33220,14 +33241,14 @@ friend struct ActorCallback< GetLogUidActor, 0, Optional >; } }; - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" [[nodiscard]] static Future getLogUid( DatabaseBackupAgent* const& backupAgent, Reference const& tr, Key const& tagName, Snapshot const& snapshot ) { - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" return Future(new GetLogUidActor(backupAgent, tr, tagName, snapshot)); - #line 33227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" + #line 33248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.g.cpp" } -#line 3252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" +#line 3263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/DatabaseBackupAgent.actor.cpp" }; Future DatabaseBackupAgent::unlockBackup(Reference tr, Key tagName) { diff --git a/src/fdbclient/DatabaseConfiguration.cpp b/src/fdbclient/DatabaseConfiguration.cpp index e2050f6..75fcf68 100644 --- a/src/fdbclient/DatabaseConfiguration.cpp +++ b/src/fdbclient/DatabaseConfiguration.cpp @@ -19,8 +19,10 @@ */ #include "fdbclient/DatabaseConfiguration.h" +#include "fdbclient/FDBTypes.h" #include "fdbclient/SystemData.h" #include "flow/ITrace.h" +#include "flow/Platform.h" #include "flow/Trace.h" #include "flow/genericactors.actor.h" #include "flow/UnitTest.h" @@ -54,6 +56,7 @@ void DatabaseConfiguration::resetInternal() { storageMigrationType = StorageMigrationType::DEFAULT; blobGranulesEnabled = false; tenantMode = TenantMode::DISABLED; + encryptionAtRestMode = EncryptionAtRestMode::DISABLED; } int toInt(ValueRef const& v) { @@ -65,6 +68,16 @@ void parse(int* i, ValueRef const& v) { *i = atoi(v.toString().c_str()); } +void parse(int64_t* i, ValueRef const& v) { + // FIXME: Sanity checking + *i = atoll(v.toString().c_str()); +} + +void parse(double* i, ValueRef const& v) { + // FIXME: Sanity checking + *i = atof(v.toString().c_str()); +} + void parseReplicationPolicy(Reference* policy, ValueRef const& v) { BinaryReader reader(v, IncludeVersion()); serializeReplicationPolicy(reader, *policy); @@ -214,7 +227,8 @@ bool DatabaseConfiguration::isValid() const { (perpetualStorageWiggleSpeed == 0 || perpetualStorageWiggleSpeed == 1) && isValidPerpetualStorageWiggleLocality(perpetualStorageWiggleLocality) && storageMigrationType != StorageMigrationType::UNSET && tenantMode >= TenantMode::DISABLED && - tenantMode < TenantMode::END)) { + tenantMode < TenantMode::END && encryptionAtRestMode >= EncryptionAtRestMode::DISABLED && + encryptionAtRestMode < EncryptionAtRestMode::END)) { return false; } std::set dcIds; @@ -242,6 +256,9 @@ bool DatabaseConfiguration::isValid() const { return true; } +// The database configuration is what we desired state of the cluster, which may be different from ongoing cluster +// states. For example, the real count of roles, which is reported in each process, can differ from the desired role +// count. StatusObject DatabaseConfiguration::toJSON(bool noPolicies) const { StatusObject result; @@ -292,47 +309,12 @@ StatusObject DatabaseConfiguration::toJSON(bool noPolicies) const { result["log_version"] = (int)tLogVersion; } - if (tLogDataStoreType == KeyValueStoreType::SSD_BTREE_V1 && - storageServerStoreType == KeyValueStoreType::SSD_BTREE_V1) { - result["storage_engine"] = "ssd-1"; - } else if (tLogDataStoreType == KeyValueStoreType::SSD_BTREE_V2 && - storageServerStoreType == KeyValueStoreType::SSD_BTREE_V2) { - result["storage_engine"] = "ssd-2"; - } else if (tLogDataStoreType == KeyValueStoreType::SSD_BTREE_V2 && - storageServerStoreType == KeyValueStoreType::SSD_REDWOOD_V1) { - result["storage_engine"] = "ssd-redwood-1-experimental"; - } else if (tLogDataStoreType == KeyValueStoreType::SSD_BTREE_V2 && - storageServerStoreType == KeyValueStoreType::SSD_ROCKSDB_V1) { - result["storage_engine"] = "ssd-rocksdb-v1"; - } else if (tLogDataStoreType == KeyValueStoreType::MEMORY && storageServerStoreType == KeyValueStoreType::MEMORY) { - result["storage_engine"] = "memory-1"; - } else if (tLogDataStoreType == KeyValueStoreType::SSD_BTREE_V2 && - storageServerStoreType == KeyValueStoreType::MEMORY_RADIXTREE) { - result["storage_engine"] = "memory-radixtree-beta"; - } else if (tLogDataStoreType == KeyValueStoreType::SSD_BTREE_V2 && - storageServerStoreType == KeyValueStoreType::MEMORY) { - result["storage_engine"] = "memory-2"; - } else { - result["storage_engine"] = "custom"; - } + result["log_engine"] = tLogDataStoreType.toString(); + result["storage_engine"] = storageServerStoreType.toString(); if (desiredTSSCount > 0) { result["tss_count"] = desiredTSSCount; - if (testingStorageServerStoreType == KeyValueStoreType::SSD_BTREE_V1) { - result["tss_storage_engine"] = "ssd-1"; - } else if (testingStorageServerStoreType == KeyValueStoreType::SSD_BTREE_V2) { - result["tss_storage_engine"] = "ssd-2"; - } else if (testingStorageServerStoreType == KeyValueStoreType::SSD_REDWOOD_V1) { - result["tss_storage_engine"] = "ssd-redwood-1-experimental"; - } else if (testingStorageServerStoreType == KeyValueStoreType::SSD_ROCKSDB_V1) { - result["tss_storage_engine"] = "ssd-rocksdb-v1"; - } else if (testingStorageServerStoreType == KeyValueStoreType::MEMORY_RADIXTREE) { - result["tss_storage_engine"] = "memory-radixtree-beta"; - } else if (testingStorageServerStoreType == KeyValueStoreType::MEMORY) { - result["tss_storage_engine"] = "memory-2"; - } else { - result["tss_storage_engine"] = "custom"; - } + result["tss_storage_engine"] = testingStorageServerStoreType.toString(); } result["log_spill"] = (int)tLogSpillType; @@ -354,30 +336,19 @@ StatusObject DatabaseConfiguration::toJSON(bool noPolicies) const { result["regions"] = getRegionJSON(); } + result["logs"] = getDesiredLogs(); + + auto cpCount = getDesiredCommitProxies(); + result["commit_proxies"] = cpCount; + + auto grvCount = getDesiredGrvProxies(); + result["grv_proxies"] = grvCount; + // Add to the `proxies` count for backwards compatibility with tools built before 7.0. - int32_t proxyCount = -1; - if (desiredTLogCount != -1 || isOverridden("logs")) { - result["logs"] = desiredTLogCount; - } - if (commitProxyCount != -1 || isOverridden("commit_proxies")) { - result["commit_proxies"] = commitProxyCount; - if (proxyCount != -1) { - proxyCount += commitProxyCount; - } else { - proxyCount = commitProxyCount; - } - } - if (grvProxyCount != -1 || isOverridden("grv_proxies")) { - result["grv_proxies"] = grvProxyCount; - if (proxyCount != -1) { - proxyCount += grvProxyCount; - } else { - proxyCount = grvProxyCount; - } - } - if (resolverCount != -1 || isOverridden("resolvers")) { - result["resolvers"] = resolverCount; - } + result["proxies"] = cpCount + grvCount; + + result["resolvers"] = getDesiredResolvers(); + if (desiredLogRouterCount != -1 || isOverridden("log_routers")) { result["log_routers"] = desiredLogRouterCount; } @@ -387,6 +358,8 @@ StatusObject DatabaseConfiguration::toJSON(bool noPolicies) const { if (repopulateRegionAntiQuorum != 0 || isOverridden("repopulate_anti_quorum")) { result["repopulate_anti_quorum"] = repopulateRegionAntiQuorum; } + + // only report the auto values when they're different from default if (autoCommitProxyCount != CLIENT_KNOBS->DEFAULT_AUTO_COMMIT_PROXIES || isOverridden("auto_commit_proxies")) { result["auto_commit_proxies"] = autoCommitProxyCount; } @@ -399,9 +372,6 @@ StatusObject DatabaseConfiguration::toJSON(bool noPolicies) const { if (autoDesiredTLogCount != CLIENT_KNOBS->DEFAULT_AUTO_LOGS || isOverridden("auto_logs")) { result["auto_logs"] = autoDesiredTLogCount; } - if (proxyCount != -1) { - result["proxies"] = proxyCount; - } result["backup_worker_enabled"] = (int32_t)backupWorkerEnabled; result["perpetual_storage_wiggle"] = perpetualStorageWiggleSpeed; @@ -412,6 +382,67 @@ StatusObject DatabaseConfiguration::toJSON(bool noPolicies) const { result["storage_migration_type"] = storageMigrationType.toString(); result["blob_granules_enabled"] = (int32_t)blobGranulesEnabled; result["tenant_mode"] = tenantMode.toString(); + result["encryption_at_rest_mode"] = encryptionAtRestMode.toString(); + return result; +} + +std::string DatabaseConfiguration::configureStringFromJSON(const StatusObject& json) { + std::string result; + + for (auto kv : json) { + // These JSON properties are ignored for some reason. This behavior is being maintained in a refactor + // of this code and the old code gave no reasoning. + static std::set ignore = { "tss_storage_engine", "perpetual_storage_wiggle_locality" }; + if (ignore.contains(kv.first)) { + continue; + } + + result += " "; + // All integers are assumed to be actual DatabaseConfig keys and are set with + // the hidden ":=" syntax of the configure command. + if (kv.second.type() == json_spirit::int_type) { + result += kv.first + ":=" + format("%d", kv.second.get_int()); + } else if (kv.second.type() == json_spirit::str_type) { + // For string values, some properties can set with a "=" syntax in "configure" + // Such properites are listed here: + static std::set directSet = { + "storage_migration_type", "tenant_mode", "encryption_at_rest_mode", + "storage_engine", "log_engine", "perpetual_storage_wiggle_engine" + }; + + if (directSet.contains(kv.first)) { + result += kv.first + "=" + kv.second.get_str(); + } else { + // For the rest, it is assumed that the property name is meaningless and the value string + // is a standalone 'configure' command which has the identical effect. + // TODO: Fix this terrible legacy behavior which probably isn't compatible with + // some of the more recently added configuration and options. + result += kv.second.get_str(); + } + } else if (kv.second.type() == json_spirit::array_type) { + // Array properties convert to = + result += kv.first + "=" + + json_spirit::write_string(json_spirit::mValue(kv.second.get_array()), + json_spirit::Output_options::none); + } else { + throw invalid_config_db_key(); + } + } + + // The log_engine setting requires some special handling because it was not included in the JSON form of a + // DatabaseConfiguration until FDB 7.3. This means that configuring a new database using a JSON config object from + // an older version will now fail because it lacks an explicit log_engine setting. Previously, the log_engine would + // be set indirectly because the "storage_engine=" property from JSON would convert to a standalone + // "" command in the output, and each engine name exists as a command which sets both the + // log and storage engines, with the log engine normally being ssd-2. + // The storage_engine and log_engine JSON properties now explicitly indicate their engine types and map to configure + // commands of the same name. So, to support configuring a new database with an older JSON config without an + // explicit log_engine we simply add " log_engine=ssd-2" to the output string if the input JSON did not contain a + // log_engine. + if (!json.contains("log_engine")) { + result += " log_engine=ssd-2"; + } + return result; } @@ -545,107 +576,106 @@ bool DatabaseConfiguration::setInternal(KeyRef key, ValueRef value) { KeyRef ck = key.removePrefix(configKeysPrefix); int type; - if (ck == LiteralStringRef("initialized")) { + if (ck == "initialized"_sr) { initialized = true; - } else if (ck == LiteralStringRef("commit_proxies")) { + } else if (ck == "commit_proxies"_sr) { commitProxyCount = toInt(value); if (commitProxyCount == -1) overwriteProxiesCount(); - } else if (ck == LiteralStringRef("grv_proxies")) { + } else if (ck == "grv_proxies"_sr) { grvProxyCount = toInt(value); if (grvProxyCount == -1) overwriteProxiesCount(); - } else if (ck == LiteralStringRef("resolvers")) { + } else if (ck == "resolvers"_sr) { parse(&resolverCount, value); - } else if (ck == LiteralStringRef("logs")) { + } else if (ck == "logs"_sr) { parse(&desiredTLogCount, value); - } else if (ck == LiteralStringRef("log_replicas")) { + } else if (ck == "log_replicas"_sr) { parse(&tLogReplicationFactor, value); tLogWriteAntiQuorum = std::min(tLogWriteAntiQuorum, tLogReplicationFactor / 2); - } else if (ck == LiteralStringRef("log_anti_quorum")) { + } else if (ck == "log_anti_quorum"_sr) { parse(&tLogWriteAntiQuorum, value); if (tLogReplicationFactor > 0) { tLogWriteAntiQuorum = std::min(tLogWriteAntiQuorum, tLogReplicationFactor / 2); } - } else if (ck == LiteralStringRef("storage_replicas")) { + } else if (ck == "storage_replicas"_sr) { parse(&storageTeamSize, value); - } else if (ck == LiteralStringRef("tss_count")) { + } else if (ck == "tss_count"_sr) { parse(&desiredTSSCount, value); - } else if (ck == LiteralStringRef("log_version")) { + } else if (ck == "log_version"_sr) { parse((&type), value); type = std::max((int)TLogVersion::MIN_RECRUITABLE, type); type = std::min((int)TLogVersion::MAX_SUPPORTED, type); tLogVersion = (TLogVersion::Version)type; - } else if (ck == LiteralStringRef("log_engine")) { + } else if (ck == "log_engine"_sr) { parse((&type), value); tLogDataStoreType = (KeyValueStoreType::StoreType)type; - // TODO: Remove this once Redwood works as a log engine - if (tLogDataStoreType == KeyValueStoreType::SSD_REDWOOD_V1) { + // It makes no sense to use a memory based engine to spill data that doesn't fit in memory + // so change these to an ssd-2 + if (tLogDataStoreType == KeyValueStoreType::MEMORY || + tLogDataStoreType == KeyValueStoreType::MEMORY_RADIXTREE) { tLogDataStoreType = KeyValueStoreType::SSD_BTREE_V2; } - // TODO: Remove this once memroy radix tree works as a log engine - if (tLogDataStoreType == KeyValueStoreType::MEMORY_RADIXTREE) { - tLogDataStoreType = KeyValueStoreType::SSD_BTREE_V2; - } - } else if (ck == LiteralStringRef("log_spill")) { + } else if (ck == "log_spill"_sr) { parse((&type), value); tLogSpillType = (TLogSpillType::SpillType)type; - } else if (ck == LiteralStringRef("storage_engine")) { + } else if (ck == "storage_engine"_sr) { parse((&type), value); storageServerStoreType = (KeyValueStoreType::StoreType)type; - } else if (ck == LiteralStringRef("tss_storage_engine")) { + } else if (ck == "tss_storage_engine"_sr) { parse((&type), value); testingStorageServerStoreType = (KeyValueStoreType::StoreType)type; - } else if (ck == LiteralStringRef("auto_commit_proxies")) { + } else if (ck == "auto_commit_proxies"_sr) { parse(&autoCommitProxyCount, value); - } else if (ck == LiteralStringRef("auto_grv_proxies")) { + } else if (ck == "auto_grv_proxies"_sr) { parse(&autoGrvProxyCount, value); - } else if (ck == LiteralStringRef("auto_resolvers")) { + } else if (ck == "auto_resolvers"_sr) { parse(&autoResolverCount, value); - } else if (ck == LiteralStringRef("auto_logs")) { + } else if (ck == "auto_logs"_sr) { parse(&autoDesiredTLogCount, value); - } else if (ck == LiteralStringRef("storage_replication_policy")) { + } else if (ck == "storage_replication_policy"_sr) { parseReplicationPolicy(&storagePolicy, value); - } else if (ck == LiteralStringRef("log_replication_policy")) { + } else if (ck == "log_replication_policy"_sr) { parseReplicationPolicy(&tLogPolicy, value); - } else if (ck == LiteralStringRef("log_routers")) { + } else if (ck == "log_routers"_sr) { parse(&desiredLogRouterCount, value); - } else if (ck == LiteralStringRef("remote_logs")) { + } else if (ck == "remote_logs"_sr) { parse(&remoteDesiredTLogCount, value); - } else if (ck == LiteralStringRef("remote_log_replicas")) { + } else if (ck == "remote_log_replicas"_sr) { parse(&remoteTLogReplicationFactor, value); - } else if (ck == LiteralStringRef("remote_log_policy")) { + } else if (ck == "remote_log_policy"_sr) { parseReplicationPolicy(&remoteTLogPolicy, value); - } else if (ck == LiteralStringRef("backup_worker_enabled")) { + } else if (ck == "backup_worker_enabled"_sr) { parse((&type), value); backupWorkerEnabled = (type != 0); - } else if (ck == LiteralStringRef("usable_regions")) { + } else if (ck == "usable_regions"_sr) { parse(&usableRegions, value); - } else if (ck == LiteralStringRef("repopulate_anti_quorum")) { + } else if (ck == "repopulate_anti_quorum"_sr) { parse(&repopulateRegionAntiQuorum, value); - } else if (ck == LiteralStringRef("regions")) { + } else if (ck == "regions"_sr) { parse(®ions, value); - } else if (ck == LiteralStringRef("perpetual_storage_wiggle")) { + } else if (ck == "perpetual_storage_wiggle"_sr) { parse(&perpetualStorageWiggleSpeed, value); - } else if (ck == LiteralStringRef("perpetual_storage_wiggle_locality")) { + } else if (ck == "perpetual_storage_wiggle_locality"_sr) { if (!isValidPerpetualStorageWiggleLocality(value.toString())) { return false; } perpetualStorageWiggleLocality = value.toString(); - } else if (ck == LiteralStringRef("perpetual_storage_wiggle_engine")) { + } else if (ck == "perpetual_storage_wiggle_engine"_sr) { parse((&type), value); perpetualStoreType = (KeyValueStoreType::StoreType)type; - } else if (ck == LiteralStringRef("storage_migration_type")) { + } else if (ck == "storage_migration_type"_sr) { parse((&type), value); storageMigrationType = (StorageMigrationType::MigrationType)type; - } else if (ck == LiteralStringRef("tenant_mode")) { - parse((&type), value); - tenantMode = (TenantMode::Mode)type; - } else if (ck == LiteralStringRef("proxies")) { + } else if (ck == "tenant_mode"_sr) { + tenantMode = TenantMode::fromValue(value); + } else if (ck == "proxies"_sr) { overwriteProxiesCount(); - } else if (ck == LiteralStringRef("blob_granules_enabled")) { + } else if (ck == "blob_granules_enabled"_sr) { parse((&type), value); blobGranulesEnabled = (type != 0); + } else if (ck == "encryption_at_rest_mode"_sr) { + encryptionAtRestMode = EncryptionAtRestMode::fromValueRef(Optional(value)); } else if (ck.startsWith("excluded/"_sr)) { // excluded servers: don't keep the state internally } else { @@ -707,7 +737,7 @@ Optional DatabaseConfiguration::get(KeyRef key) const { } } -bool DatabaseConfiguration::isExcludedServer(NetworkAddressList a) const { +bool DatabaseConfiguration::isExcludedServer(NetworkAddressList a, const LocalityData& locality) const { return get(encodeExcludedServersKey(AddressExclusion(a.address.ip, a.address.port))).present() || get(encodeExcludedServersKey(AddressExclusion(a.address.ip))).present() || get(encodeFailedServersKey(AddressExclusion(a.address.ip, a.address.port))).present() || @@ -718,7 +748,8 @@ bool DatabaseConfiguration::isExcludedServer(NetworkAddressList a) const { get(encodeExcludedServersKey(AddressExclusion(a.secondaryAddress.get().ip))).present() || get(encodeFailedServersKey(AddressExclusion(a.secondaryAddress.get().ip, a.secondaryAddress.get().port))) .present() || - get(encodeFailedServersKey(AddressExclusion(a.secondaryAddress.get().ip))).present())); + get(encodeFailedServersKey(AddressExclusion(a.secondaryAddress.get().ip))).present())) || + isExcludedLocality(locality); } std::set DatabaseConfiguration::getExcludedServers() const { const_cast(this)->makeConfigurationImmutable(); diff --git a/src/fdbclient/DatabaseContext.cpp b/src/fdbclient/DatabaseContext.cpp new file mode 100644 index 0000000..c6ff8ff --- /dev/null +++ b/src/fdbclient/DatabaseContext.cpp @@ -0,0 +1,79 @@ +/* + * DatabaseContext.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/DatabaseContext.h" + +Reference DatabaseContext::getWatchMetadata(int64_t tenantId, KeyRef key) const { + const auto it = watchMap.find(std::make_pair(tenantId, key)); + if (it == watchMap.end()) + return Reference(); + return it->second; +} + +void DatabaseContext::setWatchMetadata(Reference metadata) { + const WatchMapKey key(metadata->parameters->tenant.tenantId, metadata->parameters->key); + watchMap[key] = metadata; + // NOTE Here we do *NOT* update/reset the reference count for the key, see the source code in getWatchFuture. + // Basically the reference count could be increased, or the same watch is refreshed, or the watch might be cancelled +} + +int32_t DatabaseContext::increaseWatchRefCount(const int64_t tenantID, KeyRef key, const Version& version) { + const WatchMapKey mapKey(tenantID, key); + watchCounterMap[mapKey].insert(version); + return watchCounterMap[mapKey].size(); +} + +int32_t DatabaseContext::decreaseWatchRefCount(const int64_t tenantID, KeyRef key, const Version& version) { + const WatchMapKey mapKey(tenantID, key); + auto mapKeyIter = watchCounterMap.find(mapKey); + if (mapKeyIter == std::end(watchCounterMap)) { + // Key does not exist. The metadata might be removed by deleteWatchMetadata already. + return 0; + } + + auto& versionSet = mapKeyIter->second; + auto versionIter = versionSet.find(version); + + if (versionIter == std::end(versionSet)) { + // Version not found, the watch might be cleared before. + return versionSet.size(); + } + versionSet.erase(versionIter); + + const auto count = versionSet.size(); + // The metadata might be deleted somewhere else, before calling this decreaseWatchRefCount + if (auto metadata = getWatchMetadata(tenantID, key); metadata.isValid() && versionSet.size() == 0) { + // It is a *must* to cancel the watchFutureSS manually. watchFutureSS waits for watchStorageServerResp, which + // holds a reference to the metadata. If the ACTOR is not cancelled, it indirectly holds a Future waiting for + // itself. + metadata->watchFutureSS.cancel(); + deleteWatchMetadata(tenantID, key); + } + + return count; +} + +void DatabaseContext::deleteWatchMetadata(int64_t tenantId, KeyRef key, bool removeReferenceCount) { + const WatchMapKey mapKey(tenantId, key); + watchMap.erase(mapKey); + if (removeReferenceCount) { + watchCounterMap.erase(mapKey); + } +} diff --git a/src/fdbclient/FDBAWSCredentialsProvider.h b/src/fdbclient/FDBAWSCredentialsProvider.cpp similarity index 78% rename from src/fdbclient/FDBAWSCredentialsProvider.h rename to src/fdbclient/FDBAWSCredentialsProvider.cpp index f09e2f8..304b1fc 100644 --- a/src/fdbclient/FDBAWSCredentialsProvider.h +++ b/src/fdbclient/FDBAWSCredentialsProvider.cpp @@ -1,5 +1,6 @@ + /* - * FDBAWSCredentialsProvider.h + * FDBAWSCredentialsProvider.cpp * * This source file is part of the FoundationDB open source project * @@ -18,20 +19,16 @@ * limitations under the License. */ -#if (!defined FDB_AWS_CREDENTIALS_PROVIDER_H) && (defined BUILD_AWS_BACKUP) -#define FDB_AWS_CREDENTIALS_PROVIDER_H -#pragma once - -#include "aws/core/Aws.h" -#include "aws/core/auth/AWSCredentialsProviderChain.h" +#include "fdbclient/FDBAWSCredentialsProvider.h" +#include "fdbclient/Tracing.h" -// Singleton -namespace FDBAWSCredentialsProvider { -bool doneInit = false; +#ifdef WITH_AWS_BACKUP // You're supposed to call AWS::ShutdownAPI(options); once done // But we want this to live for the lifetime of the process, so we don't do that -static Aws::Auth::AWSCredentials getAwsCredentials() { +namespace FDBAWSCredentialsProvider { +Aws::Auth::AWSCredentials getAwsCredentials() { + static bool doneInit = false; if (!doneInit) { doneInit = true; Aws::SDKOptions options; diff --git a/src/fdbclient/FDBOptions.g.cpp b/src/fdbclient/FDBOptions.g.cpp index c45ea9d..c8bc77c 100644 --- a/src/fdbclient/FDBOptions.g.cpp +++ b/src/fdbclient/FDBOptions.g.cpp @@ -3,166 +3,185 @@ FDBOptionInfoMap FDBNetworkOptions::optionInfo; void FDBNetworkOptions::init() { - ADD_OPTION_INFO(FDBNetworkOptions, LOCAL_ADDRESS, "LOCAL_ADDRESS", "Deprecated", "(String) IP:PORT", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, CLUSTER_FILE, "CLUSTER_FILE", "Deprecated", "(String) path to cluster file", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, TRACE_ENABLE, "TRACE_ENABLE", "Enables trace output to a file in a directory of the clients choosing", "(String) path to output directory (or NULL for current working directory)", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, TRACE_ROLL_SIZE, "TRACE_ROLL_SIZE", "Sets the maximum size in bytes of a single trace output file. This value should be in the range ``[0, INT64_MAX]``. If the value is set to 0, there is no limit on individual file size. The default is a maximum size of 10,485,760 bytes.", "(Int) max size of a single trace output file", true, false, false, -1, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBNetworkOptions, TRACE_MAX_LOGS_SIZE, "TRACE_MAX_LOGS_SIZE", "Sets the maximum size of all the trace output files put together. This value should be in the range ``[0, INT64_MAX]``. If the value is set to 0, there is no limit on the total size of the files. The default is a maximum size of 104,857,600 bytes. If the default roll size is used, this means that a maximum of 10 trace files will be written at a time.", "(Int) max total size of trace files", true, false, false, -1, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBNetworkOptions, TRACE_LOG_GROUP, "TRACE_LOG_GROUP", "Sets the 'LogGroup' attribute with the specified value for all events in the trace output files. The default log group is 'default'.", "(String) value of the LogGroup attribute", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, TRACE_FORMAT, "TRACE_FORMAT", "Select the format of the log files. xml (the default) and json are supported.", "(String) Format of trace files", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, TRACE_CLOCK_SOURCE, "TRACE_CLOCK_SOURCE", "Select clock source for trace files. now (the default) or realtime are supported.", "(String) Trace clock source", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, TRACE_FILE_IDENTIFIER, "TRACE_FILE_IDENTIFIER", "Once provided, this string will be used to replace the port/PID in the log file names.", "(String) The identifier that will be part of all trace file names", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, TRACE_PARTIAL_FILE_SUFFIX, "TRACE_PARTIAL_FILE_SUFFIX", "Set file suffix for partially written log files.", "(String) Append this suffix to partially written log files. When a log file is complete, it is renamed to remove the suffix. No separator is added between the file and the suffix. If you want to add a file extension, you should include the separator - e.g. '.tmp' instead of 'tmp' to add the 'tmp' extension.", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, KNOB, "KNOB", "Set internal tuning or debugging knobs", "(String) knob_name=knob_value", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, TLS_PLUGIN, "TLS_PLUGIN", "Deprecated", "(String) file path or linker-resolved name", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, TLS_CERT_BYTES, "TLS_CERT_BYTES", "Set the certificate chain", "(Bytes) certificates", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBNetworkOptions, TLS_CERT_PATH, "TLS_CERT_PATH", "Set the file from which to load the certificate chain", "(String) file path", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, TLS_KEY_BYTES, "TLS_KEY_BYTES", "Set the private key corresponding to your own certificate", "(Bytes) key", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBNetworkOptions, TLS_KEY_PATH, "TLS_KEY_PATH", "Set the file from which to load the private key corresponding to your own certificate", "(String) file path", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, TLS_VERIFY_PEERS, "TLS_VERIFY_PEERS", "Set the peer certificate field verification criteria", "(Bytes) verification pattern", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBNetworkOptions, BUGGIFY_ENABLE, "BUGGIFY_ENABLE", "", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBNetworkOptions, BUGGIFY_DISABLE, "BUGGIFY_DISABLE", "", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBNetworkOptions, BUGGIFY_SECTION_ACTIVATED_PROBABILITY, "BUGGIFY_SECTION_ACTIVATED_PROBABILITY", "Set the probability of a BUGGIFY section being active for the current execution. Only applies to code paths first traversed AFTER this option is changed.", "(Int) probability expressed as a percentage between 0 and 100", true, false, false, -1, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBNetworkOptions, BUGGIFY_SECTION_FIRED_PROBABILITY, "BUGGIFY_SECTION_FIRED_PROBABILITY", "Set the probability of an active BUGGIFY section being fired", "(Int) probability expressed as a percentage between 0 and 100", true, false, false, -1, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBNetworkOptions, TLS_CA_BYTES, "TLS_CA_BYTES", "Set the ca bundle", "(Bytes) ca bundle", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBNetworkOptions, TLS_CA_PATH, "TLS_CA_PATH", "Set the file from which to load the certificate authority bundle", "(String) file path", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, TLS_PASSWORD, "TLS_PASSWORD", "Set the passphrase for encrypted private key. Password should be set before setting the key for the password to be used.", "(String) key passphrase", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, DISABLE_MULTI_VERSION_CLIENT_API, "DISABLE_MULTI_VERSION_CLIENT_API", "Disables the multi-version client API and instead uses the local client directly. Must be set before setting up the network.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBNetworkOptions, CALLBACKS_ON_EXTERNAL_THREADS, "CALLBACKS_ON_EXTERNAL_THREADS", "If set, callbacks from external client libraries can be called from threads created by the FoundationDB client library. Otherwise, callbacks will be called from either the thread used to add the callback or the network thread. Setting this option can improve performance when connected using an external client, but may not be safe to use in all environments. Must be set before setting up the network. WARNING: This feature is considered experimental at this time.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBNetworkOptions, EXTERNAL_CLIENT_LIBRARY, "EXTERNAL_CLIENT_LIBRARY", "Adds an external client library for use by the multi-version client API. Must be set before setting up the network.", "(String) path to client library", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, EXTERNAL_CLIENT_DIRECTORY, "EXTERNAL_CLIENT_DIRECTORY", "Searches the specified path for dynamic libraries and adds them to the list of client libraries for use by the multi-version client API. Must be set before setting up the network.", "(String) path to directory containing client libraries", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, DISABLE_LOCAL_CLIENT, "DISABLE_LOCAL_CLIENT", "Prevents connections through the local client, allowing only connections through externally loaded client libraries.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBNetworkOptions, CLIENT_THREADS_PER_VERSION, "CLIENT_THREADS_PER_VERSION", "Spawns multiple worker threads for each version of the client that is loaded. Setting this to a number greater than one implies disable_local_client.", "(Int) Number of client threads to be spawned. Each cluster will be serviced by a single client thread.", true, false, false, -1, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBNetworkOptions, RETAIN_CLIENT_LIBRARY_COPIES, "RETAIN_CLIENT_LIBRARY_COPIES", "Retain temporary external client library copies that are created for enabling multi-threading.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBNetworkOptions, DISABLE_CLIENT_STATISTICS_LOGGING, "DISABLE_CLIENT_STATISTICS_LOGGING", "Disables logging of client statistics, such as sampled transaction activity.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBNetworkOptions, ENABLE_SLOW_TASK_PROFILING, "ENABLE_SLOW_TASK_PROFILING", "Deprecated", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBNetworkOptions, ENABLE_RUN_LOOP_PROFILING, "ENABLE_RUN_LOOP_PROFILING", "Enables debugging feature to perform run loop profiling. Requires trace logging to be enabled. WARNING: this feature is not recommended for use in production.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBNetworkOptions, CLIENT_BUGGIFY_ENABLE, "CLIENT_BUGGIFY_ENABLE", "Enable client buggify - will make requests randomly fail (intended for client testing)", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBNetworkOptions, CLIENT_BUGGIFY_DISABLE, "CLIENT_BUGGIFY_DISABLE", "Disable client buggify", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBNetworkOptions, CLIENT_BUGGIFY_SECTION_ACTIVATED_PROBABILITY, "CLIENT_BUGGIFY_SECTION_ACTIVATED_PROBABILITY", "Set the probability of a CLIENT_BUGGIFY section being active for the current execution.", "(Int) probability expressed as a percentage between 0 and 100", true, false, false, -1, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBNetworkOptions, CLIENT_BUGGIFY_SECTION_FIRED_PROBABILITY, "CLIENT_BUGGIFY_SECTION_FIRED_PROBABILITY", "Set the probability of an active CLIENT_BUGGIFY section being fired. A section will only fire if it was activated", "(Int) probability expressed as a percentage between 0 and 100", true, false, false, -1, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBNetworkOptions, DISTRIBUTED_CLIENT_TRACER, "DISTRIBUTED_CLIENT_TRACER", "Set a tracer to run on the client. Should be set to the same value as the tracer set on the server.", "(String) Distributed tracer type. Choose from none, log_file, or network_lossy", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, SUPPORTED_CLIENT_VERSIONS, "SUPPORTED_CLIENT_VERSIONS", "This option is set automatically to communicate the list of supported clients to the active client.", "(String) [release version],[source version],[protocol version];...", true, true, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBNetworkOptions, EXTERNAL_CLIENT, "EXTERNAL_CLIENT", "This option is set automatically on all clients loaded externally using the multi-version API.", "Option takes no parameter", false, true, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBNetworkOptions, EXTERNAL_CLIENT_TRANSPORT_ID, "EXTERNAL_CLIENT_TRANSPORT_ID", "This option tells a child on a multiversion client what transport ID to use.", "(Int) Transport ID for the child connection", true, true, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBNetworkOptions, LOCAL_ADDRESS, "LOCAL_ADDRESS", "Deprecated", "(String) IP:PORT", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, CLUSTER_FILE, "CLUSTER_FILE", "Deprecated", "(String) path to cluster file", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, TRACE_ENABLE, "TRACE_ENABLE", "Enables trace output to a file in a directory of the clients choosing", "(String) path to output directory (or NULL for current working directory)", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, TRACE_ROLL_SIZE, "TRACE_ROLL_SIZE", "Sets the maximum size in bytes of a single trace output file. This value should be in the range ``[0, INT64_MAX]``. If the value is set to 0, there is no limit on individual file size. The default is a maximum size of 10,485,760 bytes.", "(Int) max size of a single trace output file", true, false, false, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBNetworkOptions, TRACE_MAX_LOGS_SIZE, "TRACE_MAX_LOGS_SIZE", "Sets the maximum size of all the trace output files put together. This value should be in the range ``[0, INT64_MAX]``. If the value is set to 0, there is no limit on the total size of the files. The default is a maximum size of 104,857,600 bytes. If the default roll size is used, this means that a maximum of 10 trace files will be written at a time.", "(Int) max total size of trace files", true, false, false, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBNetworkOptions, TRACE_LOG_GROUP, "TRACE_LOG_GROUP", "Sets the 'LogGroup' attribute with the specified value for all events in the trace output files. The default log group is 'default'.", "(String) value of the LogGroup attribute", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, TRACE_FORMAT, "TRACE_FORMAT", "Select the format of the log files. xml (the default) and json are supported.", "(String) Format of trace files", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, TRACE_CLOCK_SOURCE, "TRACE_CLOCK_SOURCE", "Select clock source for trace files. now (the default) or realtime are supported.", "(String) Trace clock source", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, TRACE_FILE_IDENTIFIER, "TRACE_FILE_IDENTIFIER", "Once provided, this string will be used to replace the port/PID in the log file names.", "(String) The identifier that will be part of all trace file names", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, TRACE_SHARE_AMONG_CLIENT_THREADS, "TRACE_SHARE_AMONG_CLIENT_THREADS", "Use the same base trace file name for all client threads as it did before version 7.2. The current default behavior is to use distinct trace file names for client threads by including their version and thread index.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, TRACE_INITIALIZE_ON_SETUP, "TRACE_INITIALIZE_ON_SETUP", "Initialize trace files on network setup, determine the local IP later. Otherwise tracing is initialized when opening the first database.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, TRACE_PARTIAL_FILE_SUFFIX, "TRACE_PARTIAL_FILE_SUFFIX", "Set file suffix for partially written log files.", "(String) Append this suffix to partially written log files. When a log file is complete, it is renamed to remove the suffix. No separator is added between the file and the suffix. If you want to add a file extension, you should include the separator - e.g. '.tmp' instead of 'tmp' to add the 'tmp' extension.", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, KNOB, "KNOB", "Set internal tuning or debugging knobs", "(String) knob_name=knob_value", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, TLS_PLUGIN, "TLS_PLUGIN", "Deprecated", "(String) file path or linker-resolved name", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, TLS_CERT_BYTES, "TLS_CERT_BYTES", "Set the certificate chain", "(Bytes) certificates", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBNetworkOptions, TLS_CERT_PATH, "TLS_CERT_PATH", "Set the file from which to load the certificate chain", "(String) file path", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, TLS_KEY_BYTES, "TLS_KEY_BYTES", "Set the private key corresponding to your own certificate", "(Bytes) key", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBNetworkOptions, TLS_KEY_PATH, "TLS_KEY_PATH", "Set the file from which to load the private key corresponding to your own certificate", "(String) file path", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, TLS_VERIFY_PEERS, "TLS_VERIFY_PEERS", "Set the peer certificate field verification criteria", "(Bytes) verification pattern", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBNetworkOptions, BUGGIFY_ENABLE, "BUGGIFY_ENABLE", "", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, BUGGIFY_DISABLE, "BUGGIFY_DISABLE", "", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, BUGGIFY_SECTION_ACTIVATED_PROBABILITY, "BUGGIFY_SECTION_ACTIVATED_PROBABILITY", "Set the probability of a BUGGIFY section being active for the current execution. Only applies to code paths first traversed AFTER this option is changed.", "(Int) probability expressed as a percentage between 0 and 100", true, false, false, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBNetworkOptions, BUGGIFY_SECTION_FIRED_PROBABILITY, "BUGGIFY_SECTION_FIRED_PROBABILITY", "Set the probability of an active BUGGIFY section being fired", "(Int) probability expressed as a percentage between 0 and 100", true, false, false, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBNetworkOptions, TLS_CA_BYTES, "TLS_CA_BYTES", "Set the ca bundle", "(Bytes) ca bundle", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBNetworkOptions, TLS_CA_PATH, "TLS_CA_PATH", "Set the file from which to load the certificate authority bundle", "(String) file path", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, TLS_PASSWORD, "TLS_PASSWORD", "Set the passphrase for encrypted private key. Password should be set before setting the key for the password to be used.", "(String) key passphrase", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, DISABLE_MULTI_VERSION_CLIENT_API, "DISABLE_MULTI_VERSION_CLIENT_API", "Disables the multi-version client API and instead uses the local client directly. Must be set before setting up the network.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, CALLBACKS_ON_EXTERNAL_THREADS, "CALLBACKS_ON_EXTERNAL_THREADS", "If set, callbacks from external client libraries can be called from threads created by the FoundationDB client library. Otherwise, callbacks will be called from either the thread used to add the callback or the network thread. Setting this option can improve performance when connected using an external client, but may not be safe to use in all environments. Must be set before setting up the network. WARNING: This feature is considered experimental at this time.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, EXTERNAL_CLIENT_LIBRARY, "EXTERNAL_CLIENT_LIBRARY", "Adds an external client library for use by the multi-version client API. Must be set before setting up the network.", "(String) path to client library", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, EXTERNAL_CLIENT_DIRECTORY, "EXTERNAL_CLIENT_DIRECTORY", "Searches the specified path for dynamic libraries and adds them to the list of client libraries for use by the multi-version client API. Must be set before setting up the network.", "(String) path to directory containing client libraries", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, DISABLE_LOCAL_CLIENT, "DISABLE_LOCAL_CLIENT", "Prevents connections through the local client, allowing only connections through externally loaded client libraries.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, CLIENT_THREADS_PER_VERSION, "CLIENT_THREADS_PER_VERSION", "Spawns multiple worker threads for each version of the client that is loaded. Setting this to a number greater than one implies disable_local_client.", "(Int) Number of client threads to be spawned. Each cluster will be serviced by a single client thread.", true, false, false, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBNetworkOptions, FUTURE_VERSION_CLIENT_LIBRARY, "FUTURE_VERSION_CLIENT_LIBRARY", "Adds an external client library to be used with a future version protocol. This option can be used testing purposes only!", "(String) path to client library", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, RETAIN_CLIENT_LIBRARY_COPIES, "RETAIN_CLIENT_LIBRARY_COPIES", "Retain temporary external client library copies that are created for enabling multi-threading.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, IGNORE_EXTERNAL_CLIENT_FAILURES, "IGNORE_EXTERNAL_CLIENT_FAILURES", "Ignore the failure to initialize some of the external clients", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, FAIL_INCOMPATIBLE_CLIENT, "FAIL_INCOMPATIBLE_CLIENT", "Fail with an error if there is no client matching the server version the client is connecting to", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, DISABLE_CLIENT_STATISTICS_LOGGING, "DISABLE_CLIENT_STATISTICS_LOGGING", "Disables logging of client statistics, such as sampled transaction activity.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, ENABLE_SLOW_TASK_PROFILING, "ENABLE_SLOW_TASK_PROFILING", "Deprecated", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, ENABLE_RUN_LOOP_PROFILING, "ENABLE_RUN_LOOP_PROFILING", "Enables debugging feature to perform run loop profiling. Requires trace logging to be enabled. WARNING: this feature is not recommended for use in production.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, DISABLE_CLIENT_BYPASS, "DISABLE_CLIENT_BYPASS", "Prevents the multi-version client API from being disabled, even if no external clients are configured. This option is required to use GRV caching.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, CLIENT_BUGGIFY_ENABLE, "CLIENT_BUGGIFY_ENABLE", "Enable client buggify - will make requests randomly fail (intended for client testing)", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, CLIENT_BUGGIFY_DISABLE, "CLIENT_BUGGIFY_DISABLE", "Disable client buggify", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, CLIENT_BUGGIFY_SECTION_ACTIVATED_PROBABILITY, "CLIENT_BUGGIFY_SECTION_ACTIVATED_PROBABILITY", "Set the probability of a CLIENT_BUGGIFY section being active for the current execution.", "(Int) probability expressed as a percentage between 0 and 100", true, false, false, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBNetworkOptions, CLIENT_BUGGIFY_SECTION_FIRED_PROBABILITY, "CLIENT_BUGGIFY_SECTION_FIRED_PROBABILITY", "Set the probability of an active CLIENT_BUGGIFY section being fired. A section will only fire if it was activated", "(Int) probability expressed as a percentage between 0 and 100", true, false, false, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBNetworkOptions, DISTRIBUTED_CLIENT_TRACER, "DISTRIBUTED_CLIENT_TRACER", "Set a tracer to run on the client. Should be set to the same value as the tracer set on the server.", "(String) Distributed tracer type. Choose from none, log_file, or network_lossy", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, CLIENT_TMP_DIR, "CLIENT_TMP_DIR", "Sets the directory for storing temporary files created by FDB client, such as temporary copies of client libraries. Defaults to /tmp", "(String) Client directory for temporary files. ", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, SUPPORTED_CLIENT_VERSIONS, "SUPPORTED_CLIENT_VERSIONS", "This option is set automatically to communicate the list of supported clients to the active client.", "(String) [release version],[source version],[protocol version];...", true, true, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBNetworkOptions, EXTERNAL_CLIENT, "EXTERNAL_CLIENT", "This option is set automatically on all clients loaded externally using the multi-version API.", "Option takes no parameter", false, true, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBNetworkOptions, EXTERNAL_CLIENT_TRANSPORT_ID, "EXTERNAL_CLIENT_TRANSPORT_ID", "This option tells a child on a multiversion client what transport ID to use.", "(Int) Transport ID for the child connection", true, true, false, false, -1, FDBOptionInfo::ParamType::Int) } FDBOptionInfoMap FDBDatabaseOptions::optionInfo; void FDBDatabaseOptions::init() { - ADD_OPTION_INFO(FDBDatabaseOptions, LOCATION_CACHE_SIZE, "LOCATION_CACHE_SIZE", "Set the size of the client location cache. Raising this value can boost performance in very large databases where clients access data in a near-random pattern. Defaults to 100000.", "(Int) Max location cache entries", true, false, false, -1, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBDatabaseOptions, MAX_WATCHES, "MAX_WATCHES", "Set the maximum number of watches allowed to be outstanding on a database connection. Increasing this number could result in increased resource usage. Reducing this number will not cancel any outstanding watches. Defaults to 10000 and cannot be larger than 1000000.", "(Int) Max outstanding watches", true, false, false, -1, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBDatabaseOptions, MACHINE_ID, "MACHINE_ID", "Specify the machine ID that was passed to fdbserver processes running on the same machine as this client, for better location-aware load balancing.", "(String) Hexadecimal ID", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBDatabaseOptions, DATACENTER_ID, "DATACENTER_ID", "Specify the datacenter ID that was passed to fdbserver processes running in the same datacenter as this client, for better location-aware load balancing.", "(String) Hexadecimal ID", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBDatabaseOptions, SNAPSHOT_RYW_ENABLE, "SNAPSHOT_RYW_ENABLE", "Snapshot read operations will see the results of writes done in the same transaction. This is the default behavior.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBDatabaseOptions, SNAPSHOT_RYW_DISABLE, "SNAPSHOT_RYW_DISABLE", "Snapshot read operations will not see the results of writes done in the same transaction. This was the default behavior prior to API version 300.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_LOGGING_MAX_FIELD_LENGTH, "TRANSACTION_LOGGING_MAX_FIELD_LENGTH", "Sets the maximum escaped length of key and value fields to be logged to the trace file via the LOG_TRANSACTION option. This sets the ``transaction_logging_max_field_length`` option of each transaction created by this database. See the transaction option description for more information.", "(Int) Maximum length of escaped key and value fields.", true, false, false, 405, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_TIMEOUT, "TRANSACTION_TIMEOUT", "Set a timeout in milliseconds which, when elapsed, will cause each transaction automatically to be cancelled. This sets the ``timeout`` option of each transaction created by this database. See the transaction option description for more information. Using this option requires that the API version is 610 or higher.", "(Int) value in milliseconds of timeout", true, false, false, 500, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_RETRY_LIMIT, "TRANSACTION_RETRY_LIMIT", "Set a maximum number of retries after which additional calls to ``onError`` will throw the most recently seen error code. This sets the ``retry_limit`` option of each transaction created by this database. See the transaction option description for more information.", "(Int) number of times to retry", true, false, false, 501, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_MAX_RETRY_DELAY, "TRANSACTION_MAX_RETRY_DELAY", "Set the maximum amount of backoff delay incurred in the call to ``onError`` if the error is retryable. This sets the ``max_retry_delay`` option of each transaction created by this database. See the transaction option description for more information.", "(Int) value in milliseconds of maximum delay", true, false, false, 502, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_SIZE_LIMIT, "TRANSACTION_SIZE_LIMIT", "Set the maximum transaction size in bytes. This sets the ``size_limit`` option on each transaction created by this database. See the transaction option description for more information.", "(Int) value in bytes", true, false, false, 503, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_CAUSAL_READ_RISKY, "TRANSACTION_CAUSAL_READ_RISKY", "The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock.", "Option takes no parameter", false, false, false, 20, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_INCLUDE_PORT_IN_ADDRESS, "TRANSACTION_INCLUDE_PORT_IN_ADDRESS", "Deprecated. Addresses returned by get_addresses_for_key include the port when enabled. As of api version 630, this option is enabled by default and setting this has no effect.", "Option takes no parameter", false, false, false, 23, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_BYPASS_UNREADABLE, "TRANSACTION_BYPASS_UNREADABLE", "Allows ``get`` operations to read from sections of keyspace that have become unreadable because of versionstamp operations. This sets the ``bypass_unreadable`` option of each transaction created by this database. See the transaction option description for more information.", "Option takes no parameter", false, false, false, 1100, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBDatabaseOptions, USE_CONFIG_DATABASE, "USE_CONFIG_DATABASE", "Use configuration database.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBDatabaseOptions, TEST_CAUSAL_READ_RISKY, "TEST_CAUSAL_READ_RISKY", "An integer between 0 and 100 (default is 0) expressing the probability that a client will verify it can't read stale data whenever it detects a recovery.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBDatabaseOptions, LOCATION_CACHE_SIZE, "LOCATION_CACHE_SIZE", "Set the size of the client location cache. Raising this value can boost performance in very large databases where clients access data in a near-random pattern. Defaults to 100000.", "(Int) Max location cache entries", true, false, false, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBDatabaseOptions, MAX_WATCHES, "MAX_WATCHES", "Set the maximum number of watches allowed to be outstanding on a database connection. Increasing this number could result in increased resource usage. Reducing this number will not cancel any outstanding watches. Defaults to 10000 and cannot be larger than 1000000.", "(Int) Max outstanding watches", true, false, false, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBDatabaseOptions, MACHINE_ID, "MACHINE_ID", "Specify the machine ID that was passed to fdbserver processes running on the same machine as this client, for better location-aware load balancing.", "(String) Hexadecimal ID", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBDatabaseOptions, DATACENTER_ID, "DATACENTER_ID", "Specify the datacenter ID that was passed to fdbserver processes running in the same datacenter as this client, for better location-aware load balancing.", "(String) Hexadecimal ID", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBDatabaseOptions, SNAPSHOT_RYW_ENABLE, "SNAPSHOT_RYW_ENABLE", "Snapshot read operations will see the results of writes done in the same transaction. This is the default behavior.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBDatabaseOptions, SNAPSHOT_RYW_DISABLE, "SNAPSHOT_RYW_DISABLE", "Snapshot read operations will not see the results of writes done in the same transaction. This was the default behavior prior to API version 300.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_LOGGING_MAX_FIELD_LENGTH, "TRANSACTION_LOGGING_MAX_FIELD_LENGTH", "Sets the maximum escaped length of key and value fields to be logged to the trace file via the LOG_TRANSACTION option. This sets the ``transaction_logging_max_field_length`` option of each transaction created by this database. See the transaction option description for more information.", "(Int) Maximum length of escaped key and value fields.", true, false, false, false, 405, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_TIMEOUT, "TRANSACTION_TIMEOUT", "Set a timeout in milliseconds which, when elapsed, will cause each transaction automatically to be cancelled. This sets the ``timeout`` option of each transaction created by this database. See the transaction option description for more information. Using this option requires that the API version is 610 or higher.", "(Int) value in milliseconds of timeout", true, false, false, false, 500, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_RETRY_LIMIT, "TRANSACTION_RETRY_LIMIT", "Set a maximum number of retries after which additional calls to ``onError`` will throw the most recently seen error code. This sets the ``retry_limit`` option of each transaction created by this database. See the transaction option description for more information.", "(Int) number of times to retry", true, false, false, false, 501, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_MAX_RETRY_DELAY, "TRANSACTION_MAX_RETRY_DELAY", "Set the maximum amount of backoff delay incurred in the call to ``onError`` if the error is retryable. This sets the ``max_retry_delay`` option of each transaction created by this database. See the transaction option description for more information.", "(Int) value in milliseconds of maximum delay", true, false, false, false, 502, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_SIZE_LIMIT, "TRANSACTION_SIZE_LIMIT", "Set the maximum transaction size in bytes. This sets the ``size_limit`` option on each transaction created by this database. See the transaction option description for more information.", "(Int) value in bytes", true, false, false, false, 503, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_CAUSAL_READ_RISKY, "TRANSACTION_CAUSAL_READ_RISKY", "The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock.", "Option takes no parameter", false, false, false, false, 20, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_INCLUDE_PORT_IN_ADDRESS, "TRANSACTION_INCLUDE_PORT_IN_ADDRESS", "Deprecated. Addresses returned by get_addresses_for_key include the port when enabled. As of api version 630, this option is enabled by default and setting this has no effect.", "Option takes no parameter", false, false, false, false, 23, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_AUTOMATIC_IDEMPOTENCY, "TRANSACTION_AUTOMATIC_IDEMPOTENCY", "Set a random idempotency id for all transactions. See the transaction option description for more information. This feature is in development and not ready for general use.", "Option takes no parameter", false, false, false, false, 505, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_BYPASS_UNREADABLE, "TRANSACTION_BYPASS_UNREADABLE", "Allows ``get`` operations to read from sections of keyspace that have become unreadable because of versionstamp operations. This sets the ``bypass_unreadable`` option of each transaction created by this database. See the transaction option description for more information.", "Option takes no parameter", false, false, false, false, 1100, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_USED_DURING_COMMIT_PROTECTION_DISABLE, "TRANSACTION_USED_DURING_COMMIT_PROTECTION_DISABLE", "By default, operations that are performed on a transaction while it is being committed will not only fail themselves, but they will attempt to fail other in-flight operations (such as the commit) as well. This behavior is intended to help developers discover situations where operations could be unintentionally executed after the transaction has been reset. Setting this option removes that protection, causing only the offending operation to fail.", "Option takes no parameter", false, false, false, false, 701, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBDatabaseOptions, TRANSACTION_REPORT_CONFLICTING_KEYS, "TRANSACTION_REPORT_CONFLICTING_KEYS", "Enables conflicting key reporting on all transactions, allowing them to retrieve the keys that are conflicting with other transactions.", "Option takes no parameter", false, false, false, false, 712, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBDatabaseOptions, USE_CONFIG_DATABASE, "USE_CONFIG_DATABASE", "Use configuration database.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBDatabaseOptions, TEST_CAUSAL_READ_RISKY, "TEST_CAUSAL_READ_RISKY", "Enables verification of causal read risky by checking whether clients are able to read stale data when they detect a recovery, and logging an error if so.", "(Int) integer between 0 and 100 expressing the probability a client will verify it can't read stale data", true, false, false, false, -1, FDBOptionInfo::ParamType::Int) } FDBOptionInfoMap FDBTransactionOptions::optionInfo; void FDBTransactionOptions::init() { - ADD_OPTION_INFO(FDBTransactionOptions, CAUSAL_WRITE_RISKY, "CAUSAL_WRITE_RISKY", "The transaction, if not self-conflicting, may be committed a second time after commit succeeds, in the event of a fault", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, CAUSAL_READ_RISKY, "CAUSAL_READ_RISKY", "The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, CAUSAL_READ_DISABLE, "CAUSAL_READ_DISABLE", "", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, INCLUDE_PORT_IN_ADDRESS, "INCLUDE_PORT_IN_ADDRESS", "Addresses returned by get_addresses_for_key include the port when enabled. As of api version 630, this option is enabled by default and setting this has no effect.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, NEXT_WRITE_NO_WRITE_CONFLICT_RANGE, "NEXT_WRITE_NO_WRITE_CONFLICT_RANGE", "The next write performed on this transaction will not generate a write conflict range. As a result, other transactions which read the key(s) being modified by the next write will not conflict with this transaction. Care needs to be taken when using this option on a transaction that is shared between multiple threads. When setting this option, write conflict ranges will be disabled on the next write operation, regardless of what thread it is on.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, COMMIT_ON_FIRST_PROXY, "COMMIT_ON_FIRST_PROXY", "Committing this transaction will bypass the normal load balancing across commit proxies and go directly to the specifically nominated 'first commit proxy'.", "Option takes no parameter", false, true, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, CHECK_WRITES_ENABLE, "CHECK_WRITES_ENABLE", "", "Option takes no parameter", false, true, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, READ_YOUR_WRITES_DISABLE, "READ_YOUR_WRITES_DISABLE", "Reads performed by a transaction will not see any prior mutations that occured in that transaction, instead seeing the value which was in the database at the transaction's read version. This option may provide a small performance benefit for the client, but also disables a number of client-side optimizations which are beneficial for transactions which tend to read and write the same keys within a single transaction. It is an error to set this option after performing any reads or writes on the transaction.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, READ_AHEAD_DISABLE, "READ_AHEAD_DISABLE", "Deprecated", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, DURABILITY_DATACENTER, "DURABILITY_DATACENTER", "", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, DURABILITY_RISKY, "DURABILITY_RISKY", "", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, DURABILITY_DEV_NULL_IS_WEB_SCALE, "DURABILITY_DEV_NULL_IS_WEB_SCALE", "Deprecated", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, PRIORITY_SYSTEM_IMMEDIATE, "PRIORITY_SYSTEM_IMMEDIATE", "Specifies that this transaction should be treated as highest priority and that lower priority transactions should block behind this one. Use is discouraged outside of low-level tools", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, PRIORITY_BATCH, "PRIORITY_BATCH", "Specifies that this transaction should be treated as low priority and that default priority transactions will be processed first. Batch priority transactions will also be throttled at load levels smaller than for other types of transactions and may be fully cut off in the event of machine failures. Useful for doing batch work simultaneously with latency-sensitive work", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, INITIALIZE_NEW_DATABASE, "INITIALIZE_NEW_DATABASE", "This is a write-only transaction which sets the initial configuration. This option is designed for use by database system tools only.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, ACCESS_SYSTEM_KEYS, "ACCESS_SYSTEM_KEYS", "Allows this transaction to read and modify system keys (those that start with the byte 0xFF). Implies raw_access.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, READ_SYSTEM_KEYS, "READ_SYSTEM_KEYS", "Allows this transaction to read system keys (those that start with the byte 0xFF). Implies raw_access.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, RAW_ACCESS, "RAW_ACCESS", "Allows this transaction to access the raw key-space when tenant mode is on.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, DEBUG_DUMP, "DEBUG_DUMP", "", "Option takes no parameter", false, true, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, DEBUG_RETRY_LOGGING, "DEBUG_RETRY_LOGGING", "", "(String) Optional transaction name", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBTransactionOptions, TRANSACTION_LOGGING_ENABLE, "TRANSACTION_LOGGING_ENABLE", "Deprecated", "(String) String identifier to be used in the logs when tracing this transaction. The identifier must not exceed 100 characters.", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBTransactionOptions, DEBUG_TRANSACTION_IDENTIFIER, "DEBUG_TRANSACTION_IDENTIFIER", "Sets a client provided identifier for the transaction that will be used in scenarios like tracing or profiling. Client trace logging or transaction profiling must be separately enabled.", "(String) String identifier to be used when tracing or profiling this transaction. The identifier must not exceed 100 characters.", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBTransactionOptions, LOG_TRANSACTION, "LOG_TRANSACTION", "Enables tracing for this transaction and logs results to the client trace logs. The DEBUG_TRANSACTION_IDENTIFIER option must be set before using this option, and client trace logging must be enabled to get log output.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, TRANSACTION_LOGGING_MAX_FIELD_LENGTH, "TRANSACTION_LOGGING_MAX_FIELD_LENGTH", "Sets the maximum escaped length of key and value fields to be logged to the trace file via the LOG_TRANSACTION option, after which the field will be truncated. A negative value disables truncation.", "(Int) Maximum length of escaped key and value fields.", true, false, false, -1, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBTransactionOptions, SERVER_REQUEST_TRACING, "SERVER_REQUEST_TRACING", "Sets an identifier for server tracing of this transaction. When committed, this identifier triggers logging when each part of the transaction authority encounters it, which is helpful in diagnosing slowness in misbehaving clusters. The identifier is randomly generated. When there is also a debug_transaction_identifier, both IDs are logged together.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, TIMEOUT, "TIMEOUT", "Set a timeout in milliseconds which, when elapsed, will cause the transaction automatically to be cancelled. Valid parameter values are ``[0, INT_MAX]``. If set to 0, will disable all timeouts. All pending and any future uses of the transaction will throw an exception. The transaction can be used again after it is reset. Prior to API version 610, like all other transaction options, the timeout must be reset after a call to ``onError``. If the API version is 610 or greater, the timeout is not reset after an ``onError`` call. This allows the user to specify a longer timeout on specific transactions than the default timeout specified through the ``transaction_timeout`` database option without the shorter database timeout cancelling transactions that encounter a retryable error. Note that at all API versions, it is safe and legal to set the timeout each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option.", "(Int) value in milliseconds of timeout", true, false, true, -1, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBTransactionOptions, RETRY_LIMIT, "RETRY_LIMIT", "Set a maximum number of retries after which additional calls to ``onError`` will throw the most recently seen error code. Valid parameter values are ``[-1, INT_MAX]``. If set to -1, will disable the retry limit. Prior to API version 610, like all other transaction options, the retry limit must be reset after a call to ``onError``. If the API version is 610 or greater, the retry limit is not reset after an ``onError`` call. Note that at all API versions, it is safe and legal to set the retry limit each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option.", "(Int) number of times to retry", true, false, true, -1, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBTransactionOptions, MAX_RETRY_DELAY, "MAX_RETRY_DELAY", "Set the maximum amount of backoff delay incurred in the call to ``onError`` if the error is retryable. Defaults to 1000 ms. Valid parameter values are ``[0, INT_MAX]``. If the maximum retry delay is less than the current retry delay of the transaction, then the current retry delay will be clamped to the maximum retry delay. Prior to API version 610, like all other transaction options, the maximum retry delay must be reset after a call to ``onError``. If the API version is 610 or greater, the retry limit is not reset after an ``onError`` call. Note that at all API versions, it is safe and legal to set the maximum retry delay each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option.", "(Int) value in milliseconds of maximum delay", true, false, true, -1, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBTransactionOptions, SIZE_LIMIT, "SIZE_LIMIT", "Set the transaction size limit in bytes. The size is calculated by combining the sizes of all keys and values written or mutated, all key ranges cleared, and all read and write conflict ranges. (In other words, it includes the total size of all data included in the request to the cluster to commit the transaction.) Large transactions can cause performance problems on FoundationDB clusters, so setting this limit to a smaller value than the default can help prevent the client from accidentally degrading the cluster's performance. This value must be at least 32 and cannot be set to higher than 10,000,000, the default transaction size limit.", "(Int) value in bytes", true, false, false, -1, FDBOptionInfo::ParamType::Int) - ADD_OPTION_INFO(FDBTransactionOptions, SNAPSHOT_RYW_ENABLE, "SNAPSHOT_RYW_ENABLE", "Snapshot read operations will see the results of writes done in the same transaction. This is the default behavior.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, SNAPSHOT_RYW_DISABLE, "SNAPSHOT_RYW_DISABLE", "Snapshot read operations will not see the results of writes done in the same transaction. This was the default behavior prior to API version 300.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, LOCK_AWARE, "LOCK_AWARE", "The transaction can read and write to locked databases, and is responsible for checking that it took the lock.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, USED_DURING_COMMIT_PROTECTION_DISABLE, "USED_DURING_COMMIT_PROTECTION_DISABLE", "By default, operations that are performed on a transaction while it is being committed will not only fail themselves, but they will attempt to fail other in-flight operations (such as the commit) as well. This behavior is intended to help developers discover situations where operations could be unintentionally executed after the transaction has been reset. Setting this option removes that protection, causing only the offending operation to fail.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, READ_LOCK_AWARE, "READ_LOCK_AWARE", "The transaction can read from locked databases.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, FIRST_IN_BATCH, "FIRST_IN_BATCH", "No other transactions will be applied before this transaction within the same commit version.", "Option takes no parameter", false, true, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, USE_PROVISIONAL_PROXIES, "USE_PROVISIONAL_PROXIES", "This option should only be used by tools which change the database configuration.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, REPORT_CONFLICTING_KEYS, "REPORT_CONFLICTING_KEYS", "The transaction can retrieve keys that are conflicting with other transactions.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, SPECIAL_KEY_SPACE_RELAXED, "SPECIAL_KEY_SPACE_RELAXED", "By default, the special key space will only allow users to read from exactly one module (a subspace in the special key space). Use this option to allow reading from zero or more modules. Users who set this option should be prepared for new modules, which may have different behaviors than the modules they're currently reading. For example, a new module might block or return an error.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, SPECIAL_KEY_SPACE_ENABLE_WRITES, "SPECIAL_KEY_SPACE_ENABLE_WRITES", "By default, users are not allowed to write to special keys. Enable this option will implicitly enable all options required to achieve the configuration change.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, TAG, "TAG", "Adds a tag to the transaction that can be used to apply manual targeted throttling. At most 5 tags can be set on a transaction.", "(String) String identifier used to associated this transaction with a throttling group. Must not exceed 16 characters.", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBTransactionOptions, AUTO_THROTTLE_TAG, "AUTO_THROTTLE_TAG", "Adds a tag to the transaction that can be used to apply manual or automatic targeted throttling. At most 5 tags can be set on a transaction.", "(String) String identifier used to associated this transaction with a throttling group. Must not exceed 16 characters.", true, false, false, -1, FDBOptionInfo::ParamType::String) - ADD_OPTION_INFO(FDBTransactionOptions, SPAN_PARENT, "SPAN_PARENT", "Adds a parent to the Span of this transaction. Used for transaction tracing. A span can be identified with any 16 bytes", "(Bytes) A byte string of length 16 used to associate the span of this transaction with a parent", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBTransactionOptions, EXPENSIVE_CLEAR_COST_ESTIMATION_ENABLE, "EXPENSIVE_CLEAR_COST_ESTIMATION_ENABLE", "Asks storage servers for how many bytes a clear key range contains. Otherwise uses the location cache to roughly estimate this.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, BYPASS_UNREADABLE, "BYPASS_UNREADABLE", "Allows ``get`` operations to read from sections of keyspace that have become unreadable because of versionstamp operations. These reads will view versionstamp operations as if they were set operations that did not fill in the versionstamp.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, USE_GRV_CACHE, "USE_GRV_CACHE", "Allows this transaction to use cached GRV from the database context. Defaults to off. Upon first usage, starts a background updater to periodically update the cache to avoid stale read versions.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBTransactionOptions, SKIP_GRV_CACHE, "SKIP_GRV_CACHE", "Specifically instruct this transaction to NOT use cached GRV. Primarily used for the read version cache's background updater to avoid attempting to read a cached entry in specific situations.", "Option takes no parameter", false, true, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, CAUSAL_WRITE_RISKY, "CAUSAL_WRITE_RISKY", "The transaction, if not self-conflicting, may be committed a second time after commit succeeds, in the event of a fault", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, CAUSAL_READ_RISKY, "CAUSAL_READ_RISKY", "The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, CAUSAL_READ_DISABLE, "CAUSAL_READ_DISABLE", "", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, INCLUDE_PORT_IN_ADDRESS, "INCLUDE_PORT_IN_ADDRESS", "Addresses returned by get_addresses_for_key include the port when enabled. As of api version 630, this option is enabled by default and setting this has no effect.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, NEXT_WRITE_NO_WRITE_CONFLICT_RANGE, "NEXT_WRITE_NO_WRITE_CONFLICT_RANGE", "The next write performed on this transaction will not generate a write conflict range. As a result, other transactions which read the key(s) being modified by the next write will not conflict with this transaction. Care needs to be taken when using this option on a transaction that is shared between multiple threads. When setting this option, write conflict ranges will be disabled on the next write operation, regardless of what thread it is on.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, COMMIT_ON_FIRST_PROXY, "COMMIT_ON_FIRST_PROXY", "Committing this transaction will bypass the normal load balancing across commit proxies and go directly to the specifically nominated 'first commit proxy'.", "Option takes no parameter", false, true, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, CHECK_WRITES_ENABLE, "CHECK_WRITES_ENABLE", "", "Option takes no parameter", false, true, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, READ_YOUR_WRITES_DISABLE, "READ_YOUR_WRITES_DISABLE", "Reads performed by a transaction will not see any prior mutations that occured in that transaction, instead seeing the value which was in the database at the transaction's read version. This option may provide a small performance benefit for the client, but also disables a number of client-side optimizations which are beneficial for transactions which tend to read and write the same keys within a single transaction. It is an error to set this option after performing any reads or writes on the transaction.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, READ_AHEAD_DISABLE, "READ_AHEAD_DISABLE", "Deprecated", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, READ_SERVER_SIDE_CACHE_ENABLE, "READ_SERVER_SIDE_CACHE_ENABLE", "Storage server should cache disk blocks needed for subsequent read requests in this transaction. This is the default behavior.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, READ_SERVER_SIDE_CACHE_DISABLE, "READ_SERVER_SIDE_CACHE_DISABLE", "Storage server should not cache disk blocks needed for subsequent read requests in this transaction. This can be used to avoid cache pollution for reads not expected to be repeated.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, READ_PRIORITY_NORMAL, "READ_PRIORITY_NORMAL", "Use normal read priority for subsequent read requests in this transaction. This is the default read priority.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, READ_PRIORITY_LOW, "READ_PRIORITY_LOW", "Use low read priority for subsequent read requests in this transaction.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, READ_PRIORITY_HIGH, "READ_PRIORITY_HIGH", "Use high read priority for subsequent read requests in this transaction.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, DURABILITY_DATACENTER, "DURABILITY_DATACENTER", "", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, DURABILITY_RISKY, "DURABILITY_RISKY", "", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, DURABILITY_DEV_NULL_IS_WEB_SCALE, "DURABILITY_DEV_NULL_IS_WEB_SCALE", "Deprecated", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, PRIORITY_SYSTEM_IMMEDIATE, "PRIORITY_SYSTEM_IMMEDIATE", "Specifies that this transaction should be treated as highest priority and that lower priority transactions should block behind this one. Use is discouraged outside of low-level tools", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, PRIORITY_BATCH, "PRIORITY_BATCH", "Specifies that this transaction should be treated as low priority and that default priority transactions will be processed first. Batch priority transactions will also be throttled at load levels smaller than for other types of transactions and may be fully cut off in the event of machine failures. Useful for doing batch work simultaneously with latency-sensitive work", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, INITIALIZE_NEW_DATABASE, "INITIALIZE_NEW_DATABASE", "This is a write-only transaction which sets the initial configuration. This option is designed for use by database system tools only.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, ACCESS_SYSTEM_KEYS, "ACCESS_SYSTEM_KEYS", "Allows this transaction to read and modify system keys (those that start with the byte 0xFF). Implies raw_access.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, READ_SYSTEM_KEYS, "READ_SYSTEM_KEYS", "Allows this transaction to read system keys (those that start with the byte 0xFF). Implies raw_access.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, RAW_ACCESS, "RAW_ACCESS", "Allows this transaction to access the raw key-space when tenant mode is on.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, BYPASS_STORAGE_QUOTA, "BYPASS_STORAGE_QUOTA", "Allows this transaction to bypass storage quota enforcement. Should only be used for transactions that directly or indirectly decrease the size of the tenant group's data.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, DEBUG_DUMP, "DEBUG_DUMP", "", "Option takes no parameter", false, true, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, DEBUG_RETRY_LOGGING, "DEBUG_RETRY_LOGGING", "", "(String) Optional transaction name", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBTransactionOptions, TRANSACTION_LOGGING_ENABLE, "TRANSACTION_LOGGING_ENABLE", "Deprecated", "(String) String identifier to be used in the logs when tracing this transaction. The identifier must not exceed 100 characters.", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBTransactionOptions, DEBUG_TRANSACTION_IDENTIFIER, "DEBUG_TRANSACTION_IDENTIFIER", "Sets a client provided identifier for the transaction that will be used in scenarios like tracing or profiling. Client trace logging or transaction profiling must be separately enabled.", "(String) String identifier to be used when tracing or profiling this transaction. The identifier must not exceed 100 characters.", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBTransactionOptions, LOG_TRANSACTION, "LOG_TRANSACTION", "Enables tracing for this transaction and logs results to the client trace logs. The DEBUG_TRANSACTION_IDENTIFIER option must be set before using this option, and client trace logging must be enabled to get log output.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, TRANSACTION_LOGGING_MAX_FIELD_LENGTH, "TRANSACTION_LOGGING_MAX_FIELD_LENGTH", "Sets the maximum escaped length of key and value fields to be logged to the trace file via the LOG_TRANSACTION option, after which the field will be truncated. A negative value disables truncation.", "(Int) Maximum length of escaped key and value fields.", true, false, false, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBTransactionOptions, SERVER_REQUEST_TRACING, "SERVER_REQUEST_TRACING", "Sets an identifier for server tracing of this transaction. When committed, this identifier triggers logging when each part of the transaction authority encounters it, which is helpful in diagnosing slowness in misbehaving clusters. The identifier is randomly generated. When there is also a debug_transaction_identifier, both IDs are logged together.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, TIMEOUT, "TIMEOUT", "Set a timeout in milliseconds which, when elapsed, will cause the transaction automatically to be cancelled. Valid parameter values are ``[0, INT_MAX]``. If set to 0, will disable all timeouts. All pending and any future uses of the transaction will throw an exception. The transaction can be used again after it is reset. Prior to API version 610, like all other transaction options, the timeout must be reset after a call to ``onError``. If the API version is 610 or greater, the timeout is not reset after an ``onError`` call. This allows the user to specify a longer timeout on specific transactions than the default timeout specified through the ``transaction_timeout`` database option without the shorter database timeout cancelling transactions that encounter a retryable error. Note that at all API versions, it is safe and legal to set the timeout each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option.", "(Int) value in milliseconds of timeout", true, false, true, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBTransactionOptions, RETRY_LIMIT, "RETRY_LIMIT", "Set a maximum number of retries after which additional calls to ``onError`` will throw the most recently seen error code. Valid parameter values are ``[-1, INT_MAX]``. If set to -1, will disable the retry limit. Prior to API version 610, like all other transaction options, the retry limit must be reset after a call to ``onError``. If the API version is 610 or greater, the retry limit is not reset after an ``onError`` call. Note that at all API versions, it is safe and legal to set the retry limit each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option.", "(Int) number of times to retry", true, false, true, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBTransactionOptions, MAX_RETRY_DELAY, "MAX_RETRY_DELAY", "Set the maximum amount of backoff delay incurred in the call to ``onError`` if the error is retryable. Defaults to 1000 ms. Valid parameter values are ``[0, INT_MAX]``. If the maximum retry delay is less than the current retry delay of the transaction, then the current retry delay will be clamped to the maximum retry delay. Prior to API version 610, like all other transaction options, the maximum retry delay must be reset after a call to ``onError``. If the API version is 610 or greater, the retry limit is not reset after an ``onError`` call. Note that at all API versions, it is safe and legal to set the maximum retry delay each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option.", "(Int) value in milliseconds of maximum delay", true, false, true, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBTransactionOptions, SIZE_LIMIT, "SIZE_LIMIT", "Set the transaction size limit in bytes. The size is calculated by combining the sizes of all keys and values written or mutated, all key ranges cleared, and all read and write conflict ranges. (In other words, it includes the total size of all data included in the request to the cluster to commit the transaction.) Large transactions can cause performance problems on FoundationDB clusters, so setting this limit to a smaller value than the default can help prevent the client from accidentally degrading the cluster's performance. This value must be at least 32 and cannot be set to higher than 10,000,000, the default transaction size limit.", "(Int) value in bytes", true, false, false, false, -1, FDBOptionInfo::ParamType::Int) + ADD_OPTION_INFO(FDBTransactionOptions, IDEMPOTENCY_ID, "IDEMPOTENCY_ID", "Associate this transaction with this ID for the purpose of checking whether or not this transaction has already committed. Must be at least 16 bytes and less than 256 bytes. This feature is in development and not ready for general use. Unless the automatic_idempotency option is set after this option, the client will not automatically attempt to remove this id from the cluster after a successful commit.", "(String) Unique ID", true, true, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBTransactionOptions, AUTOMATIC_IDEMPOTENCY, "AUTOMATIC_IDEMPOTENCY", "Automatically assign a random 16 byte idempotency id for this transaction. Prevents commits from failing with ``commit_unknown_result``. WARNING: If you are also using the multiversion client or transaction timeouts, if either cluster_version_changed or transaction_timed_out was thrown during a commit, then that commit may have already succeeded or may succeed in the future. This feature is in development and not ready for general use.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, SNAPSHOT_RYW_ENABLE, "SNAPSHOT_RYW_ENABLE", "Snapshot read operations will see the results of writes done in the same transaction. This is the default behavior.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, SNAPSHOT_RYW_DISABLE, "SNAPSHOT_RYW_DISABLE", "Snapshot read operations will not see the results of writes done in the same transaction. This was the default behavior prior to API version 300.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, LOCK_AWARE, "LOCK_AWARE", "The transaction can read and write to locked databases, and is responsible for checking that it took the lock.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, USED_DURING_COMMIT_PROTECTION_DISABLE, "USED_DURING_COMMIT_PROTECTION_DISABLE", "By default, operations that are performed on a transaction while it is being committed will not only fail themselves, but they will attempt to fail other in-flight operations (such as the commit) as well. This behavior is intended to help developers discover situations where operations could be unintentionally executed after the transaction has been reset. Setting this option removes that protection, causing only the offending operation to fail.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, READ_LOCK_AWARE, "READ_LOCK_AWARE", "The transaction can read from locked databases.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, FIRST_IN_BATCH, "FIRST_IN_BATCH", "No other transactions will be applied before this transaction within the same commit version.", "Option takes no parameter", false, true, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, USE_PROVISIONAL_PROXIES, "USE_PROVISIONAL_PROXIES", "This option should only be used by tools which change the database configuration.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, REPORT_CONFLICTING_KEYS, "REPORT_CONFLICTING_KEYS", "The transaction can retrieve keys that are conflicting with other transactions.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, SPECIAL_KEY_SPACE_RELAXED, "SPECIAL_KEY_SPACE_RELAXED", "By default, the special key space will only allow users to read from exactly one module (a subspace in the special key space). Use this option to allow reading from zero or more modules. Users who set this option should be prepared for new modules, which may have different behaviors than the modules they're currently reading. For example, a new module might block or return an error.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, SPECIAL_KEY_SPACE_ENABLE_WRITES, "SPECIAL_KEY_SPACE_ENABLE_WRITES", "By default, users are not allowed to write to special keys. Enable this option will implicitly enable all options required to achieve the configuration change.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, TAG, "TAG", "Adds a tag to the transaction that can be used to apply manual targeted throttling. At most 5 tags can be set on a transaction.", "(String) String identifier used to associated this transaction with a throttling group. Must not exceed 16 characters.", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBTransactionOptions, AUTO_THROTTLE_TAG, "AUTO_THROTTLE_TAG", "Adds a tag to the transaction that can be used to apply manual or automatic targeted throttling. At most 5 tags can be set on a transaction.", "(String) String identifier used to associated this transaction with a throttling group. Must not exceed 16 characters.", true, false, false, false, -1, FDBOptionInfo::ParamType::String) + ADD_OPTION_INFO(FDBTransactionOptions, SPAN_PARENT, "SPAN_PARENT", "Adds a parent to the Span of this transaction. Used for transaction tracing. A span can be identified with any 16 bytes", "(Bytes) A byte string of length 16 used to associate the span of this transaction with a parent", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBTransactionOptions, EXPENSIVE_CLEAR_COST_ESTIMATION_ENABLE, "EXPENSIVE_CLEAR_COST_ESTIMATION_ENABLE", "Asks storage servers for how many bytes a clear key range contains. Otherwise uses the location cache to roughly estimate this.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, BYPASS_UNREADABLE, "BYPASS_UNREADABLE", "Allows ``get`` operations to read from sections of keyspace that have become unreadable because of versionstamp operations. These reads will view versionstamp operations as if they were set operations that did not fill in the versionstamp.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, USE_GRV_CACHE, "USE_GRV_CACHE", "Allows this transaction to use cached GRV from the database context. Defaults to off. Upon first usage, starts a background updater to periodically update the cache to avoid stale read versions. The disable_client_bypass option must also be set.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, SKIP_GRV_CACHE, "SKIP_GRV_CACHE", "Specifically instruct this transaction to NOT use cached GRV. Primarily used for the read version cache's background updater to avoid attempting to read a cached entry in specific situations.", "Option takes no parameter", false, true, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBTransactionOptions, AUTHORIZATION_TOKEN, "AUTHORIZATION_TOKEN", "Attach given authorization token to the transaction such that subsequent tenant-aware requests are authorized", "(String) A JSON Web Token authorized to access data belonging to one or more tenants, indicated by 'tenants' claim of the token's payload.", true, false, true, true, -1, FDBOptionInfo::ParamType::String) } FDBOptionInfoMap FDBStreamingModes::optionInfo; void FDBStreamingModes::init() { - ADD_OPTION_INFO(FDBStreamingModes, WANT_ALL, "WANT_ALL", "Client intends to consume the entire range and would like it all transferred as early as possible.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBStreamingModes, ITERATOR, "ITERATOR", "The default. The client doesn't know how much of the range it is likely to used and wants different performance concerns to be balanced. Only a small portion of data is transferred to the client initially (in order to minimize costs if the client doesn't read the entire range), and as the caller iterates over more items in the range larger batches will be transferred in order to minimize latency. After enough iterations, the iterator mode will eventually reach the same byte limit as ``WANT_ALL``", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBStreamingModes, EXACT, "EXACT", "Infrequently used. The client has passed a specific row limit and wants that many rows delivered in a single batch. Because of iterator operation in client drivers make request batches transparent to the user, consider ``WANT_ALL`` StreamingMode instead. A row limit must be specified if this mode is used.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBStreamingModes, SMALL, "SMALL", "Infrequently used. Transfer data in batches small enough to not be much more expensive than reading individual rows, to minimize cost if iteration stops early.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBStreamingModes, MEDIUM, "MEDIUM", "Infrequently used. Transfer data in batches sized in between small and large.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBStreamingModes, LARGE, "LARGE", "Infrequently used. Transfer data in batches large enough to be, in a high-concurrency environment, nearly as efficient as possible. If the client stops iteration early, some disk and network bandwidth may be wasted. The batch size may still be too small to allow a single client to get high throughput from the database, so if that is what you need consider the SERIAL StreamingMode.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBStreamingModes, SERIAL, "SERIAL", "Transfer data in batches large enough that an individual client can get reasonable read bandwidth from the database. If the client stops iteration early, considerable disk and network bandwidth may be wasted.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBStreamingModes, WANT_ALL, "WANT_ALL", "Client intends to consume the entire range and would like it all transferred as early as possible.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBStreamingModes, ITERATOR, "ITERATOR", "The default. The client doesn't know how much of the range it is likely to used and wants different performance concerns to be balanced. Only a small portion of data is transferred to the client initially (in order to minimize costs if the client doesn't read the entire range), and as the caller iterates over more items in the range larger batches will be transferred in order to minimize latency. After enough iterations, the iterator mode will eventually reach the same byte limit as ``WANT_ALL``", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBStreamingModes, EXACT, "EXACT", "Infrequently used. The client has passed a specific row limit and wants that many rows delivered in a single batch. Because of iterator operation in client drivers make request batches transparent to the user, consider ``WANT_ALL`` StreamingMode instead. A row limit must be specified if this mode is used.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBStreamingModes, SMALL, "SMALL", "Infrequently used. Transfer data in batches small enough to not be much more expensive than reading individual rows, to minimize cost if iteration stops early.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBStreamingModes, MEDIUM, "MEDIUM", "Infrequently used. Transfer data in batches sized in between small and large.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBStreamingModes, LARGE, "LARGE", "Infrequently used. Transfer data in batches large enough to be, in a high-concurrency environment, nearly as efficient as possible. If the client stops iteration early, some disk and network bandwidth may be wasted. The batch size may still be too small to allow a single client to get high throughput from the database, so if that is what you need consider the SERIAL StreamingMode.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBStreamingModes, SERIAL, "SERIAL", "Transfer data in batches large enough that an individual client can get reasonable read bandwidth from the database. If the client stops iteration early, considerable disk and network bandwidth may be wasted.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) } FDBOptionInfoMap FDBMutationTypes::optionInfo; void FDBMutationTypes::init() { - ADD_OPTION_INFO(FDBMutationTypes, ADD, "ADD", "Performs an addition of little-endian integers. If the existing value in the database is not present or shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``. The integers to be added must be stored in a little-endian representation. They can be signed in two's complement representation or unsigned. You can add to an integer at a known offset in the value by prepending the appropriate number of zero bytes to ``param`` and padding with zero bytes to match the length of the value. However, this offset technique requires that you know the addition will not cause the integer field within the value to overflow.", "(Bytes) addend", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBMutationTypes, AND, "AND", "Deprecated", "(Bytes) value with which to perform bitwise and", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBMutationTypes, BIT_AND, "BIT_AND", "Performs a bitwise ``and`` operation. If the existing value in the database is not present, then ``param`` is stored in the database. If the existing value in the database is shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``.", "(Bytes) value with which to perform bitwise and", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBMutationTypes, OR, "OR", "Deprecated", "(Bytes) value with which to perform bitwise or", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBMutationTypes, BIT_OR, "BIT_OR", "Performs a bitwise ``or`` operation. If the existing value in the database is not present or shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``.", "(Bytes) value with which to perform bitwise or", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBMutationTypes, XOR, "XOR", "Deprecated", "(Bytes) value with which to perform bitwise xor", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBMutationTypes, BIT_XOR, "BIT_XOR", "Performs a bitwise ``xor`` operation. If the existing value in the database is not present or shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``.", "(Bytes) value with which to perform bitwise xor", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBMutationTypes, APPEND_IF_FITS, "APPEND_IF_FITS", "Appends ``param`` to the end of the existing value already in the database at the given key (or creates the key and sets the value to ``param`` if the key is empty). This will only append the value if the final concatenated value size is less than or equal to the maximum value size (i.e., if it fits). WARNING: No error is surfaced back to the user if the final value is too large because the mutation will not be applied until after the transaction has been committed. Therefore, it is only safe to use this mutation type if one can guarantee that one will keep the total value size under the maximum size.", "(Bytes) value to append to the database value", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBMutationTypes, MAX, "MAX", "Performs a little-endian comparison of byte strings. If the existing value in the database is not present or shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``. The larger of the two values is then stored in the database.", "(Bytes) value to check against database value", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBMutationTypes, MIN, "MIN", "Performs a little-endian comparison of byte strings. If the existing value in the database is not present, then ``param`` is stored in the database. If the existing value in the database is shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``. The smaller of the two values is then stored in the database.", "(Bytes) value to check against database value", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBMutationTypes, SET_VERSIONSTAMPED_KEY, "SET_VERSIONSTAMPED_KEY", "Transforms ``key`` using a versionstamp for the transaction. Sets the transformed key in the database to ``param``. The key is transformed by removing the final four bytes from the key and reading those as a little-Endian 32-bit integer to get a position ``pos``. The 10 bytes of the key from ``pos`` to ``pos + 10`` are replaced with the versionstamp of the transaction used. The first byte of the key is position 0. A versionstamp is a 10 byte, unique, monotonically (but not sequentially) increasing value for each committed transaction. The first 8 bytes are the committed version of the database (serialized in big-Endian order). The last 2 bytes are monotonic in the serialization order for transactions. WARNING: At this time, versionstamps are compatible with the Tuple layer only in the Java, Python, and Go bindings. Also, note that prior to API version 520, the offset was computed from only the final two bytes rather than the final four bytes.", "(Bytes) value to which to set the transformed key", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBMutationTypes, SET_VERSIONSTAMPED_VALUE, "SET_VERSIONSTAMPED_VALUE", "Transforms ``param`` using a versionstamp for the transaction. Sets the ``key`` given to the transformed ``param``. The parameter is transformed by removing the final four bytes from ``param`` and reading those as a little-Endian 32-bit integer to get a position ``pos``. The 10 bytes of the parameter from ``pos`` to ``pos + 10`` are replaced with the versionstamp of the transaction used. The first byte of the parameter is position 0. A versionstamp is a 10 byte, unique, monotonically (but not sequentially) increasing value for each committed transaction. The first 8 bytes are the committed version of the database (serialized in big-Endian order). The last 2 bytes are monotonic in the serialization order for transactions. WARNING: At this time, versionstamps are compatible with the Tuple layer only in the Java, Python, and Go bindings. Also, note that prior to API version 520, the versionstamp was always placed at the beginning of the parameter rather than computing an offset.", "(Bytes) value to versionstamp and set", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBMutationTypes, BYTE_MIN, "BYTE_MIN", "Performs lexicographic comparison of byte strings. If the existing value in the database is not present, then ``param`` is stored. Otherwise the smaller of the two values is then stored in the database.", "(Bytes) value to check against database value", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBMutationTypes, BYTE_MAX, "BYTE_MAX", "Performs lexicographic comparison of byte strings. If the existing value in the database is not present, then ``param`` is stored. Otherwise the larger of the two values is then stored in the database.", "(Bytes) value to check against database value", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) - ADD_OPTION_INFO(FDBMutationTypes, COMPARE_AND_CLEAR, "COMPARE_AND_CLEAR", "Performs an atomic ``compare and clear`` operation. If the existing value in the database is equal to the given value, then given key is cleared.", "(Bytes) Value to compare with", true, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, ADD, "ADD", "Performs an addition of little-endian integers. If the existing value in the database is not present or shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``. The integers to be added must be stored in a little-endian representation. They can be signed in two's complement representation or unsigned. You can add to an integer at a known offset in the value by prepending the appropriate number of zero bytes to ``param`` and padding with zero bytes to match the length of the value. However, this offset technique requires that you know the addition will not cause the integer field within the value to overflow.", "(Bytes) addend", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, AND, "AND", "Deprecated", "(Bytes) value with which to perform bitwise and", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, BIT_AND, "BIT_AND", "Performs a bitwise ``and`` operation. If the existing value in the database is not present, then ``param`` is stored in the database. If the existing value in the database is shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``.", "(Bytes) value with which to perform bitwise and", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, OR, "OR", "Deprecated", "(Bytes) value with which to perform bitwise or", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, BIT_OR, "BIT_OR", "Performs a bitwise ``or`` operation. If the existing value in the database is not present or shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``.", "(Bytes) value with which to perform bitwise or", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, XOR, "XOR", "Deprecated", "(Bytes) value with which to perform bitwise xor", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, BIT_XOR, "BIT_XOR", "Performs a bitwise ``xor`` operation. If the existing value in the database is not present or shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``.", "(Bytes) value with which to perform bitwise xor", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, APPEND_IF_FITS, "APPEND_IF_FITS", "Appends ``param`` to the end of the existing value already in the database at the given key (or creates the key and sets the value to ``param`` if the key is empty). This will only append the value if the final concatenated value size is less than or equal to the maximum value size (i.e., if it fits). WARNING: No error is surfaced back to the user if the final value is too large because the mutation will not be applied until after the transaction has been committed. Therefore, it is only safe to use this mutation type if one can guarantee that one will keep the total value size under the maximum size.", "(Bytes) value to append to the database value", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, MAX, "MAX", "Performs a little-endian comparison of byte strings. If the existing value in the database is not present or shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``. The larger of the two values is then stored in the database.", "(Bytes) value to check against database value", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, MIN, "MIN", "Performs a little-endian comparison of byte strings. If the existing value in the database is not present, then ``param`` is stored in the database. If the existing value in the database is shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``. The smaller of the two values is then stored in the database.", "(Bytes) value to check against database value", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, SET_VERSIONSTAMPED_KEY, "SET_VERSIONSTAMPED_KEY", "Transforms ``key`` using a versionstamp for the transaction. Sets the transformed key in the database to ``param``. The key is transformed by removing the final four bytes from the key and reading those as a little-Endian 32-bit integer to get a position ``pos``. The 10 bytes of the key from ``pos`` to ``pos + 10`` are replaced with the versionstamp of the transaction used. The first byte of the key is position 0. A versionstamp is a 10 byte, unique, monotonically (but not sequentially) increasing value for each committed transaction. The first 8 bytes are the committed version of the database (serialized in big-Endian order). The last 2 bytes are monotonic in the serialization order for transactions. WARNING: At this time, versionstamps are compatible with the Tuple layer only in the Java, Python, and Go bindings. Also, note that prior to API version 520, the offset was computed from only the final two bytes rather than the final four bytes.", "(Bytes) value to which to set the transformed key", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, SET_VERSIONSTAMPED_VALUE, "SET_VERSIONSTAMPED_VALUE", "Transforms ``param`` using a versionstamp for the transaction. Sets the ``key`` given to the transformed ``param``. The parameter is transformed by removing the final four bytes from ``param`` and reading those as a little-Endian 32-bit integer to get a position ``pos``. The 10 bytes of the parameter from ``pos`` to ``pos + 10`` are replaced with the versionstamp of the transaction used. The first byte of the parameter is position 0. A versionstamp is a 10 byte, unique, monotonically (but not sequentially) increasing value for each committed transaction. The first 8 bytes are the committed version of the database (serialized in big-Endian order). The last 2 bytes are monotonic in the serialization order for transactions. WARNING: At this time, versionstamps are compatible with the Tuple layer only in the Java, Python, and Go bindings. Also, note that prior to API version 520, the versionstamp was always placed at the beginning of the parameter rather than computing an offset.", "(Bytes) value to versionstamp and set", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, BYTE_MIN, "BYTE_MIN", "Performs lexicographic comparison of byte strings. If the existing value in the database is not present, then ``param`` is stored. Otherwise the smaller of the two values is then stored in the database.", "(Bytes) value to check against database value", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, BYTE_MAX, "BYTE_MAX", "Performs lexicographic comparison of byte strings. If the existing value in the database is not present, then ``param`` is stored. Otherwise the larger of the two values is then stored in the database.", "(Bytes) value to check against database value", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) + ADD_OPTION_INFO(FDBMutationTypes, COMPARE_AND_CLEAR, "COMPARE_AND_CLEAR", "Performs an atomic ``compare and clear`` operation. If the existing value in the database is equal to the given value, then given key is cleared.", "(Bytes) Value to compare with", true, false, false, false, -1, FDBOptionInfo::ParamType::Bytes) } FDBOptionInfoMap FDBConflictRangeTypes::optionInfo; void FDBConflictRangeTypes::init() { - ADD_OPTION_INFO(FDBConflictRangeTypes, READ, "READ", "Used to add a read conflict range", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBConflictRangeTypes, WRITE, "WRITE", "Used to add a write conflict range", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBConflictRangeTypes, READ, "READ", "Used to add a read conflict range", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBConflictRangeTypes, WRITE, "WRITE", "Used to add a write conflict range", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) } FDBOptionInfoMap FDBErrorPredicates::optionInfo; void FDBErrorPredicates::init() { - ADD_OPTION_INFO(FDBErrorPredicates, RETRYABLE, "RETRYABLE", "Returns ``true`` if the error indicates the operations in the transactions should be retried because of transient error.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBErrorPredicates, MAYBE_COMMITTED, "MAYBE_COMMITTED", "Returns ``true`` if the error indicates the transaction may have succeeded, though not in a way the system can verify.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) - ADD_OPTION_INFO(FDBErrorPredicates, RETRYABLE_NOT_COMMITTED, "RETRYABLE_NOT_COMMITTED", "Returns ``true`` if the error indicates the transaction has not committed, though in a way that can be retried.", "Option takes no parameter", false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBErrorPredicates, RETRYABLE, "RETRYABLE", "Returns ``true`` if the error indicates the operations in the transactions should be retried because of transient error.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBErrorPredicates, MAYBE_COMMITTED, "MAYBE_COMMITTED", "Returns ``true`` if the error indicates the transaction may have succeeded, though not in a way the system can verify.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) + ADD_OPTION_INFO(FDBErrorPredicates, RETRYABLE_NOT_COMMITTED, "RETRYABLE_NOT_COMMITTED", "Returns ``true`` if the error indicates the transaction has not committed, though in a way that can be retried.", "Option takes no parameter", false, false, false, false, -1, FDBOptionInfo::ParamType::None) } diff --git a/src/fdbclient/FDBTypes.cpp b/src/fdbclient/FDBTypes.cpp index a975dbe..1d39085 100644 --- a/src/fdbclient/FDBTypes.cpp +++ b/src/fdbclient/FDBTypes.cpp @@ -21,6 +21,17 @@ #include "fdbclient/FDBTypes.h" #include "fdbclient/Knobs.h" #include "fdbclient/NativeAPI.actor.h" +#include + +KeyRangeRef toPrefixRelativeRange(KeyRangeRef range, Optional prefix) { + if (!prefix.present() || prefix.get().empty()) { + return range; + } else { + KeyRef begin = range.begin.startsWith(prefix.get()) ? range.begin.removePrefix(prefix.get()) : allKeys.begin; + KeyRef end = range.end.startsWith(prefix.get()) ? range.end.removePrefix(prefix.get()) : allKeys.end; + return KeyRangeRef(begin, end); + } +} KeyRef keyBetween(const KeyRangeRef& keys) { int pos = 0; // will be the position of the first difference between keys.begin and keys.end @@ -40,6 +51,82 @@ KeyRef keyBetween(const KeyRangeRef& keys) { return keys.end; } +Key randomKeyBetween(const KeyRangeRef& keys) { + if (keys.empty() || keys.singleKeyRange()) { + return keys.end; + } + + KeyRef begin = keys.begin; + KeyRef end = keys.end; + ASSERT(begin < end); + if (begin.size() < end.size()) { + // randomly append a char + uint8_t maxChar = end[begin.size()] > 0 ? end[begin.size()] : end[begin.size()] + 1; + uint8_t newChar = deterministicRandom()->randomInt(0, maxChar); + return begin.withSuffix(StringRef(&newChar, 1)); + } + + int pos = 0; // will be the position of the first difference between keys.begin and keys.end + for (; pos < end.size() && pos < CLIENT_KNOBS->KEY_SIZE_LIMIT; pos++) { + if (keys.begin[pos] != keys.end[pos]) { + break; + } + } + ASSERT_LT(pos, end.size()); // otherwise, begin >= end + + // find the lowest char in range begin[pos+1, begin.size()) that is not \xff (255) + int lowest = begin.size() - 1; + for (; lowest > pos; lowest--) { + if (begin[lowest] < 255) { + Key res = begin; + uint8_t* ptr = mutateString(res); + *(ptr + lowest) = (uint8_t)deterministicRandom()->randomInt(begin[lowest] + 1, 256); + return res; + } + } + + if (begin[pos] + 1 < end[pos]) { + Key res = begin; + uint8_t* ptr = mutateString(res); + *(ptr + pos) = (uint8_t)deterministicRandom()->randomInt(begin[pos] + 1, end[pos]); + return res; + } + + if (begin.size() + 1 < CLIENT_KNOBS->KEY_SIZE_LIMIT) { + // randomly append a char + uint8_t newChar = deterministicRandom()->randomInt(1, 255); + return begin.withSuffix(StringRef(&newChar, 1)); + } + + // no possible result + return end; +} + +TEST_CASE("/KeyRangeUtil/randomKeyBetween") { + Key begin = "qwert"_sr; + Key end = "qwertyu"_sr; + Key res; + for (int i = 0; i < 10; ++i) { + res = randomKeyBetween(KeyRangeRef(begin, end)); + ASSERT(res > begin); + ASSERT(res < end); + } + + begin = "q"_sr; + end = "q\x00"_sr; + res = randomKeyBetween(KeyRangeRef(begin, end)); + ASSERT(res == end); + + begin = "aaaaaaa"_sr; + end = "b"_sr; + for (int i = 0; i < 10; ++i) { + res = randomKeyBetween(KeyRangeRef(begin, end)); + ASSERT(res > begin); + ASSERT(res < end); + } + return Void(); +} + void KeySelectorRef::setKey(KeyRef const& key) { // There are no keys in the database with size greater than the max key size, so if this key selector has a key // which is large, then we can translate it to an equivalent key selector with a smaller key @@ -75,4 +162,239 @@ std::string describe(const std::string& s) { std::string describe(UID const& item) { return item.shortString(); +} + +TEST_CASE("/KeyRangeUtil/KeyRangeComplement") { + Key begin = "b"_sr; + Key end = "y"_sr; + KeyRangeRef range(begin, end); + + { + Key b = "c"_sr; + Key e = "f"_sr; + std::vector result = range - KeyRangeRef(b, e); + ASSERT(result.size() == 2); + ASSERT(result[0] == KeyRangeRef("b"_sr, "c"_sr)); + ASSERT(result[1] == KeyRangeRef("f"_sr, "y"_sr)); + } + + { + Key b = "1"_sr; + Key e = "9"_sr; + std::vector result = range - KeyRangeRef(b, e); + ASSERT(result.size() == 1); + ASSERT(result[0] == KeyRangeRef("b"_sr, "y"_sr)); + } + + { + Key b = "a"_sr; + Key e = "f"_sr; + std::vector result = range - KeyRangeRef(b, e); + ASSERT(result.size() == 1); + ASSERT(result[0] == KeyRangeRef("f"_sr, "y"_sr)); + } + + { + Key b = "f"_sr; + Key e = "z"_sr; + std::vector result = range - KeyRangeRef(b, e); + ASSERT(result.size() == 1); + ASSERT(result[0] == KeyRangeRef("b"_sr, "f"_sr)); + } + + { + Key b = "a"_sr; + Key e = "z"_sr; + std::vector result = range - KeyRangeRef(b, e); + ASSERT(result.size() == 0); + } + + return Void(); +} + +std::string KeyValueStoreType::getStoreTypeStr(const StoreType& storeType) { + switch (storeType) { + case SSD_BTREE_V1: + return "ssd-1"; + case SSD_BTREE_V2: + return "ssd-2"; + case SSD_REDWOOD_V1: + return "ssd-redwood-1"; + case SSD_ROCKSDB_V1: + return "ssd-rocksdb-v1"; + case SSD_SHARDED_ROCKSDB: + return "ssd-sharded-rocksdb"; + case MEMORY: + return "memory"; + case MEMORY_RADIXTREE: + return "memory-radixtree-beta"; + case NONE: + return "none"; + default: + return "unknown"; + } +} + +KeyValueStoreType KeyValueStoreType::fromString(const std::string& str) { + static std::map names = { { "ssd-1", SSD_BTREE_V1 }, + { "ssd-2", SSD_BTREE_V2 }, + { "ssd", SSD_BTREE_V2 }, + { "redwood", SSD_REDWOOD_V1 }, + { "ssd-redwood-1", SSD_REDWOOD_V1 }, + { "ssd-redwood-1-experimental", SSD_REDWOOD_V1 }, + { "ssd-rocksdb-v1", SSD_ROCKSDB_V1 }, + { "ssd-sharded-rocksdb", SSD_SHARDED_ROCKSDB }, + { "memory", MEMORY }, + { "memory-radixtree-beta", MEMORY_RADIXTREE }, + { "none", NONE } }; + auto it = names.find(str); + if (it == names.end()) { + throw unknown_storage_engine(); + } + return it->second; +} + +TEST_CASE("/PerpetualStorageWiggleLocality/Validation") { + ASSERT(isValidPerpetualStorageWiggleLocality("aaa:bbb")); + ASSERT(isValidPerpetualStorageWiggleLocality("instance_id:FDB0401023121")); + ASSERT(isValidPerpetualStorageWiggleLocality("machineid:pv47p01if-infs11081401.pv.if.apple.com")); + ASSERT(isValidPerpetualStorageWiggleLocality("processid:0b36eaf96eb34b4b702d1bbcb1b49773")); + ASSERT(isValidPerpetualStorageWiggleLocality("zoneid:pv47-1108")); + ASSERT(isValidPerpetualStorageWiggleLocality( + "zoneid:pv47-1108;instance_id:FDB0401023121;processid:0b36eaf96eb34b4b702d1bbcb1b49773;machineid:pv47p01if-" + "infs11081401.pv.if.apple.com")); + ASSERT(isValidPerpetualStorageWiggleLocality("0")); + + ASSERT(!isValidPerpetualStorageWiggleLocality("aaa:bbb;")); + ASSERT(!isValidPerpetualStorageWiggleLocality("aaa:bbb;ccc")); + ASSERT(!isValidPerpetualStorageWiggleLocality("")); + + return Void(); +} + +std::vector, Optional>> ParsePerpetualStorageWiggleLocality( + const std::string& localityKeyValues) { + // parsing format is like "datahall:0<;locality:filter>" + ASSERT(isValidPerpetualStorageWiggleLocality(localityKeyValues)); + + std::vector, Optional>> parsedLocalities; + + if (localityKeyValues == "0") { + return parsedLocalities; + } + + std::vector splitLocalityKeyValues; + boost::split(splitLocalityKeyValues, localityKeyValues, [](char c) { return c == ';'; }); + + for (const auto& localityKeyValue : splitLocalityKeyValues) { + ASSERT(!localityKeyValue.empty()); + + // get key and value from perpetual_storage_wiggle_locality. + int split = localityKeyValue.find(':'); + auto key = Optional(ValueRef((uint8_t*)localityKeyValue.c_str(), split)); + auto value = Optional( + ValueRef((uint8_t*)localityKeyValue.c_str() + split + 1, localityKeyValue.size() - split - 1)); + parsedLocalities.push_back(std::make_pair(key, value)); + } + + return parsedLocalities; +} + +bool localityMatchInList(const std::vector, Optional>>& localityKeyValues, + const LocalityData& locality) { + for (const auto& [localityKey, localityValue] : localityKeyValues) { + if (locality.get(localityKey.get()) == localityValue) { + return true; + } + } + return false; +} + +TEST_CASE("/PerpetualStorageWiggleLocality/ParsePerpetualStorageWiggleLocality") { + { + auto localityKeyValues = ParsePerpetualStorageWiggleLocality("aaa:bbb"); + ASSERT(localityKeyValues.size() == 1); + ASSERT(localityKeyValues[0].first.get() == "aaa"); + ASSERT(localityKeyValues[0].second.get() == "bbb"); + + { + LocalityData locality; + locality.set("aaa"_sr, "bbb"_sr); + ASSERT(localityMatchInList(localityKeyValues, locality)); + } + + { + LocalityData locality; + locality.set("aaa"_sr, "ccc"_sr); + ASSERT(!localityMatchInList(localityKeyValues, locality)); + } + } + + { + auto localityKeyValues = ParsePerpetualStorageWiggleLocality("aaa:bbb;ccc:ddd"); + ASSERT(localityKeyValues.size() == 2); + ASSERT(localityKeyValues[0].first.get() == "aaa"); + ASSERT(localityKeyValues[0].second.get() == "bbb"); + ASSERT(localityKeyValues[1].first.get() == "ccc"); + ASSERT(localityKeyValues[1].second.get() == "ddd"); + + { + LocalityData locality; + locality.set("aaa"_sr, "bbb"_sr); + ASSERT(localityMatchInList(localityKeyValues, locality)); + } + + { + LocalityData locality; + locality.set("ccc"_sr, "ddd"_sr); + ASSERT(localityMatchInList(localityKeyValues, locality)); + } + + { + LocalityData locality; + locality.set("aaa"_sr, "ddd"_sr); + ASSERT(!localityMatchInList(localityKeyValues, locality)); + } + } + + { + auto localityKeyValues = ParsePerpetualStorageWiggleLocality("aaa:111;bbb:222;ccc:3dd"); + ASSERT(localityKeyValues.size() == 3); + ASSERT(localityKeyValues[0].first.get() == "aaa"); + ASSERT(localityKeyValues[0].second.get() == "111"); + ASSERT(localityKeyValues[1].first.get() == "bbb"); + ASSERT(localityKeyValues[1].second.get() == "222"); + ASSERT(localityKeyValues[2].first.get() == "ccc"); + ASSERT(localityKeyValues[2].second.get() == "3dd"); + + { + LocalityData locality; + locality.set("aaa"_sr, "111"_sr); + ASSERT(localityMatchInList(localityKeyValues, locality)); + } + + { + LocalityData locality; + locality.set("bbb"_sr, "222"_sr); + ASSERT(localityMatchInList(localityKeyValues, locality)); + } + + { + LocalityData locality; + locality.set("ccc"_sr, "222"_sr); + ASSERT(!localityMatchInList(localityKeyValues, locality)); + } + } + + { + auto localityKeyValues = ParsePerpetualStorageWiggleLocality("0"); + ASSERT(localityKeyValues.empty()); + + { + LocalityData locality; + locality.set("aaa"_sr, "111"_sr); + ASSERT(!localityMatchInList(localityKeyValues, locality)); + } + } + return Void(); } \ No newline at end of file diff --git a/src/fdbclient/FileBackupAgent.actor.cpp b/src/fdbclient/FileBackupAgent.actor.cpp index 4a8c761..f0f0287 100644 --- a/src/fdbclient/FileBackupAgent.actor.cpp +++ b/src/fdbclient/FileBackupAgent.actor.cpp @@ -18,34 +18,55 @@ * limitations under the License. */ +#include "fdbclient/CommitProxyInterface.h" +#include "fdbclient/DatabaseConfiguration.h" +#include "fdbclient/TenantEntryCache.actor.h" +#include "fdbclient/TenantManagement.actor.h" +#include "fdbrpc/TenantInfo.h" +#include "fdbrpc/simulator.h" +#include "flow/EncryptUtils.h" +#include "flow/FastRef.h" +#include "flow/flow.h" #include "fmt/format.h" #include "fdbclient/BackupAgent.actor.h" #include "fdbclient/BackupContainer.h" +#include "fdbclient/BlobCipher.h" +#include "fdbclient/ClientBooleanParams.h" #include "fdbclient/DatabaseContext.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/GetEncryptCipherKeys.h" +#include "fdbclient/JsonBuilder.h" +#include "fdbclient/KeyBackedTypes.actor.h" +#include "fdbclient/KeyRangeMap.h" #include "fdbclient/Knobs.h" #include "fdbclient/ManagementAPI.actor.h" #include "fdbclient/RestoreInterface.h" #include "fdbclient/Status.h" #include "fdbclient/SystemData.h" -#include "fdbclient/KeyBackedTypes.h" -#include "fdbclient/JsonBuilder.h" +#include "fdbclient/TaskBucket.h" +#include "fdbclient/Tenant.h" +#include "flow/network.h" +#include "flow/Trace.h" #include #include #include -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/genericactors.actor.h" #include "flow/Hash3.h" +#include "flow/xxhash.h" + +#include #include #include #include #include +#include +#include +#include #include "flow/actorcompiler.h" // This must be the last #include. -FDB_DEFINE_BOOLEAN_PARAM(IncrementalBackupOnly); -FDB_DEFINE_BOOLEAN_PARAM(OnlyApplyMutationLogs); - Optional fileBackupAgentProxy = Optional(); #define SevFRTestInfo SevVerbose @@ -92,7 +113,7 @@ std::string secondsToTimeFormat(int64_t seconds) { return format("%lld second(s)", seconds); } -const Key FileBackupAgent::keyLastRestorable = LiteralStringRef("last_restorable"); +const Key FileBackupAgent::keyLastRestorable = "last_restorable"_sr; // For convenience typedef FileBackupAgent::ERestoreState ERestoreState; @@ -100,19 +121,19 @@ typedef FileBackupAgent::ERestoreState ERestoreState; StringRef FileBackupAgent::restoreStateText(ERestoreState id) { switch (id) { case ERestoreState::UNITIALIZED: - return LiteralStringRef("unitialized"); + return "unitialized"_sr; case ERestoreState::QUEUED: - return LiteralStringRef("queued"); + return "queued"_sr; case ERestoreState::STARTING: - return LiteralStringRef("starting"); + return "starting"_sr; case ERestoreState::RUNNING: - return LiteralStringRef("running"); + return "running"_sr; case ERestoreState::COMPLETED: - return LiteralStringRef("completed"); + return "completed"_sr; case ERestoreState::ABORTED: - return LiteralStringRef("aborted"); + return "aborted"_sr; default: - return LiteralStringRef("Unknown"); + return "Unknown"_sr; } } @@ -125,9 +146,9 @@ ACTOR Future> TagUidMap::getAll_impl(TagUidMap* tagsMa Reference tr, Snapshot snapshot) { state Key prefix = tagsMap->prefix; // Copying it here as tagsMap lifetime is not tied to this actor - TagMap::PairsType tagPairs = wait(tagsMap->getRange(tr, std::string(), {}, 1e6, snapshot)); + TagMap::RangeResultType tagPairs = wait(tagsMap->getRange(tr, std::string(), {}, 1e6, snapshot)); std::vector results; - for (auto& p : tagPairs) + for (auto& p : tagPairs.results) results.push_back(KeyBackedTag(p.first, prefix)); return results; } @@ -136,46 +157,45 @@ KeyBackedTag::KeyBackedTag(std::string tagName, StringRef tagMapPrefix) : KeyBackedProperty(TagUidMap(tagMapPrefix).getProperty(tagName)), tagName(tagName), tagMapPrefix(tagMapPrefix) {} -class RestoreConfig : public KeyBackedConfig { +class RestoreConfig : public KeyBackedTaskConfig { public: - RestoreConfig(UID uid = UID()) : KeyBackedConfig(fileRestorePrefixRange.begin, uid) {} - RestoreConfig(Reference task) : KeyBackedConfig(fileRestorePrefixRange.begin, task) {} + RestoreConfig(UID uid = UID()) : KeyBackedTaskConfig(fileRestorePrefixRange.begin, uid) {} + RestoreConfig(Reference task) : KeyBackedTaskConfig(fileRestorePrefixRange.begin, task) {} - KeyBackedProperty stateEnum() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty stateEnum() { return configSpace.pack(__FUNCTION__sr); } Future stateText(Reference tr) { return map(stateEnum().getD(tr), [](ERestoreState s) -> StringRef { return FileBackupAgent::restoreStateText(s); }); } - KeyBackedProperty addPrefix() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - KeyBackedProperty removePrefix() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - KeyBackedProperty onlyApplyMutationLogs() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - KeyBackedProperty inconsistentSnapshotOnly() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty addPrefix() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty removePrefix() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty onlyApplyMutationLogs() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty inconsistentSnapshotOnly() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty unlockDBAfterRestore() { return configSpace.pack(__FUNCTION__sr); } // XXX: Remove restoreRange() once it is safe to remove. It has been changed to restoreRanges - KeyBackedProperty restoreRange() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - KeyBackedProperty> restoreRanges() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } - KeyBackedProperty batchFuture() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - KeyBackedProperty beginVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - KeyBackedProperty restoreVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - KeyBackedProperty firstConsistentVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - - KeyBackedProperty> sourceContainer() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } + KeyBackedProperty restoreRange() { return configSpace.pack(__FUNCTION__sr); } + // XXX: Changed to restoreRangeSet. It can be removed. + KeyBackedProperty> restoreRanges() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedSet restoreRangeSet() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty batchFuture() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty beginVersion() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty restoreVersion() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty firstConsistentVersion() { return configSpace.pack(__FUNCTION__sr); } + + KeyBackedProperty> sourceContainer() { return configSpace.pack(__FUNCTION__sr); } // Get the source container as a bare URL, without creating a container instance - KeyBackedProperty sourceContainerURL() { return configSpace.pack(LiteralStringRef("sourceContainer")); } + KeyBackedProperty sourceContainerURL() { return configSpace.pack("sourceContainer"_sr); } // Total bytes written by all log and range restore tasks. - KeyBackedBinaryValue bytesWritten() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue bytesWritten() { return configSpace.pack(__FUNCTION__sr); } // File blocks that have had tasks created for them by the Dispatch task - KeyBackedBinaryValue filesBlocksDispatched() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue filesBlocksDispatched() { return configSpace.pack(__FUNCTION__sr); } // File blocks whose tasks have finished - KeyBackedBinaryValue fileBlocksFinished() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue fileBlocksFinished() { return configSpace.pack(__FUNCTION__sr); } // Total number of files in the fileMap - KeyBackedBinaryValue fileCount() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue fileCount() { return configSpace.pack(__FUNCTION__sr); } // Total number of file blocks in the fileMap - KeyBackedBinaryValue fileBlockCount() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue fileBlockCount() { return configSpace.pack(__FUNCTION__sr); } Future> getRestoreRangesOrDefault(Reference tr) { return getRestoreRangesOrDefault_impl(this, tr); @@ -183,10 +203,29 @@ class RestoreConfig : public KeyBackedConfig { ACTOR static Future> getRestoreRangesOrDefault_impl(RestoreConfig* self, Reference tr) { - state std::vector ranges = wait(self->restoreRanges().getD(tr)); + state std::vector ranges; + state int batchSize = BUGGIFY ? 1 : CLIENT_KNOBS->RESTORE_RANGES_READ_BATCH; + state Optional begin; + state Arena arena; + loop { + KeyBackedSet::RangeResultType rangeResult = + wait(self->restoreRangeSet().getRange(tr, begin, {}, batchSize)); + ranges.insert(ranges.end(), rangeResult.results.begin(), rangeResult.results.end()); + if (!rangeResult.more) { + break; + } + ASSERT(!rangeResult.results.empty()); + begin = KeyRangeRef(KeyRef(arena, ranges.back().begin), keyAfter(ranges.back().end, arena)); + } + + // fall back to original fields if the new field is empty if (ranges.empty()) { - state KeyRange range = wait(self->restoreRange().getD(tr)); - ranges.push_back(range); + std::vector _ranges = wait(self->restoreRanges().getD(tr)); + ranges = _ranges; + if (ranges.empty()) { + KeyRange range = wait(self->restoreRange().getD(tr)); + ranges.push_back(range); + } } return ranges; } @@ -202,13 +241,7 @@ class RestoreConfig : public KeyBackedConfig { Version endVersion{ ::invalidVersion }; // not meaningful for range files Tuple pack() const { - return Tuple() - .append(version) - .append(StringRef(fileName)) - .append(isRange) - .append(fileSize) - .append(blockSize) - .append(endVersion); + return Tuple::makeTuple(version, fileName, (int)isRange, fileSize, blockSize, endVersion); } static RestoreFile unpack(Tuple const& t) { RestoreFile r; @@ -224,7 +257,7 @@ class RestoreConfig : public KeyBackedConfig { }; typedef KeyBackedSet FileSetT; - FileSetT fileSet() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + FileSetT fileSet() { return configSpace.pack(__FUNCTION__sr); } Future isRunnable(Reference tr) { return map(stateEnum().getD(tr), [](ERestoreState s) -> bool { @@ -271,23 +304,33 @@ class RestoreConfig : public KeyBackedConfig { return getApplyVersionLag_impl(tr, uid); } - void initApplyMutations(Reference tr, Key addPrefix, Key removePrefix) { + void initApplyMutations(Reference tr, + Key addPrefix, + Key removePrefix, + OnlyApplyMutationLogs onlyApplyMutationLogs) { // Set these because they have to match the applyMutations values. this->addPrefix().set(tr, addPrefix); this->removePrefix().set(tr, removePrefix); - clearApplyMutationsKeys(tr); + // Skip applyMutationsKeyVersionCount, applyMutationsKeyVersionMap, applyMutationsEnd, applyMutationsBegin + // for only-apply-mutation-logs restore. They were initialized in preloadApplyMutationsKeyVersionMap + clearApplyMutationsKeys(tr, onlyApplyMutationLogs); // Initialize add/remove prefix, range version map count and set the map's start key to InvalidVersion tr->set(uidPrefixKey(applyMutationsAddPrefixRange.begin, uid), addPrefix); tr->set(uidPrefixKey(applyMutationsRemovePrefixRange.begin, uid), removePrefix); - int64_t startCount = 0; - tr->set(uidPrefixKey(applyMutationsKeyVersionCountRange.begin, uid), StringRef((uint8_t*)&startCount, 8)); - Key mapStart = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); - tr->set(mapStart, BinaryWriter::toValue(invalidVersion, Unversioned())); + + // Skip init applyMutationsKeyVersionCount and applyMutationsKeyVersionMap for only-apply-mutation-logs restore. + // They were initialized in preloadApplyMutationsKeyVersionMap + if (!onlyApplyMutationLogs) { + int64_t startCount = 0; + tr->set(uidPrefixKey(applyMutationsKeyVersionCountRange.begin, uid), StringRef((uint8_t*)&startCount, 8)); + Key mapStart = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); + tr->set(mapStart, BinaryWriter::toValue(invalidVersion, Unversioned())); + } } - void clearApplyMutationsKeys(Reference tr) { + void clearApplyMutationsKeys(Reference tr, bool skipMutationKeyVersionMap = false) { tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); // Clear add/remove prefix keys @@ -295,17 +338,21 @@ class RestoreConfig : public KeyBackedConfig { tr->clear(uidPrefixKey(applyMutationsRemovePrefixRange.begin, uid)); // Clear range version map and count key - tr->clear(uidPrefixKey(applyMutationsKeyVersionCountRange.begin, uid)); - Key mapStart = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); - tr->clear(KeyRangeRef(mapStart, strinc(mapStart))); + if (!skipMutationKeyVersionMap) { + tr->clear(uidPrefixKey(applyMutationsKeyVersionCountRange.begin, uid)); + Key mapStart = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); + tr->clear(KeyRangeRef(mapStart, strinc(mapStart))); + } // Clear any loaded mutations that have not yet been applied Key mutationPrefix = mutationLogPrefix(); tr->clear(KeyRangeRef(mutationPrefix, strinc(mutationPrefix))); - // Clear end and begin versions (intentionally in this order) - tr->clear(uidPrefixKey(applyMutationsEndRange.begin, uid)); - tr->clear(uidPrefixKey(applyMutationsBeginRange.begin, uid)); + if (!skipMutationKeyVersionMap) { + // Clear end and begin versions (intentionally in this order) + tr->clear(uidPrefixKey(applyMutationsEndRange.begin, uid)); + tr->clear(uidPrefixKey(applyMutationsBeginRange.begin, uid)); + } } void setApplyBeginVersion(Reference tr, Version ver) { @@ -466,8 +513,475 @@ Value makePadding(int size) { return pad.substr(0, size); } +struct IRangeFileWriter { +public: + virtual Future padEnd(bool final) = 0; + + virtual Future writeKV(Key k, Value v) = 0; + + virtual Future writeKey(Key k) = 0; + + virtual Future finish() = 0; + + virtual ~IRangeFileWriter() {} +}; + +struct SnapshotFileBackupEncryptionKeys { + Reference textCipherKey; + Optional> headerCipherKey; + StringRef ivRef; +}; + // File Format handlers. -// Both Range and Log formats are designed to be readable starting at any 1MB boundary +// Both Range and Log formats are designed to be readable starting at any BACKUP_RANGEFILE_BLOCK_SIZE boundary +// so they can be read in parallel. +// +// Writer instances must be kept alive while any member actors are in progress. +// +// EncryptedRangeFileWriter must be used as follows: +// 1 - writeKey(key) the queried key range begin +// 2 - writeKV(k, v) each kv pair to restore +// 3 - writeKey(key) the queried key range end +// 4 - finish() +// +// EncryptedRangeFileWriter will insert the required padding, header, and extra +// end/begin keys around the 1MB boundaries as needed. +// +// Example: +// The range a-z is queries and returns c-j which covers 3 blocks across 2 tenants. +// The client code writes keys in this sequence: +// t1a t1c t1d t1e t1f t1g t2h t2i t2j t2z +// +// H = header P = padding a...z = keys v = value | = block boundary +// +// Encoded file: H t1a t1cv t1dv t1ev P | H t1e t1ev t1fv t1gv t2 P | H t2 t2hv t2iv t2jv t2z +// Decoded in blocks yields: +// Block 1: range [t1a, t1e) with kv pairs t1cv, t1dv +// Block 2: range [t1e, t2) with kv pairs t1ev, t1fv, t1gv +// Block 3: range [t2, t2z) with kv pairs t2hv, t2iv, t2jv +// +// NOTE: All blocks except for the final block will have one last +// value which will not be used. This isn't actually a waste since +// if the next KV pair wouldn't fit within the block after the value +// then the space after the final key to the next 1MB boundary would +// just be padding anyway. +// +// NOTE: For the EncryptedRangeFileWriter blocks will be split either on the BACKUP_RANGEFILE_BLOCK_SIZE boundary or +// when a new tenant id is encountered. If a block is split for crossing tenant boundaries then the last key will be +// truncated to just the tenant prefix and the value will be empty (to avoid having sensitive data of one tenant be +// encrypted with a key for a different tenant) +struct EncryptedRangeFileWriter : public IRangeFileWriter { + struct Options { + constexpr static FileIdentifier file_identifier = 3152016; + + bool configurableEncryptionEnabled = false; + + Options() {} + + template + void serialize(Ar& ar) { + serializer(ar, configurableEncryptionEnabled); + } + }; + + EncryptedRangeFileWriter(Database cx, + Arena* arena, + EncryptionAtRestMode encryptMode, + Optional>> tenantCache, + Reference file = Reference(), + int blockSize = 0, + Options options = Options()) + : cx(cx), arena(arena), file(file), encryptMode(encryptMode), tenantCache(tenantCache), blockSize(blockSize), + blockEnd(0), fileVersion(BACKUP_AGENT_ENCRYPTED_SNAPSHOT_FILE_VERSION), options(options) { + buffer = makeString(blockSize); + wPtr = mutateString(buffer); + } + + ACTOR static Future decryptImpl( + Database cx, + std::variant headerVariant, + const uint8_t* dataP, + int64_t dataLen, + Arena* arena) { + Reference const> dbInfo = cx->clientInfo; + if (std::holds_alternative(headerVariant)) { // configurable encryption + state BlobCipherEncryptHeaderRef headerRef = std::get(headerVariant); + TextAndHeaderCipherKeys cipherKeys = wait(GetEncryptCipherKeys::getEncryptCipherKeys( + dbInfo, headerRef, BlobCipherMetrics::RESTORE)); + EncryptHeaderCipherDetails cipherDetails = headerRef.getCipherDetails(); + cipherDetails.textCipherDetails.validateCipherDetailsWithCipherKey(cipherKeys.cipherTextKey); + if (cipherDetails.headerCipherDetails.present()) { + cipherDetails.headerCipherDetails.get().validateCipherDetailsWithCipherKey(cipherKeys.cipherHeaderKey); + } + DecryptBlobCipherAes256Ctr decryptor( + cipherKeys.cipherTextKey, cipherKeys.cipherHeaderKey, headerRef.getIV(), BlobCipherMetrics::RESTORE); + return decryptor.decrypt(dataP, dataLen, headerRef, *arena); + } else { + state BlobCipherEncryptHeader header = std::get(headerVariant); + TextAndHeaderCipherKeys cipherKeys = wait( + GetEncryptCipherKeys::getEncryptCipherKeys(dbInfo, header, BlobCipherMetrics::RESTORE)); + header.cipherTextDetails.validateCipherDetailsWithCipherKey(cipherKeys.cipherTextKey); + if (header.cipherHeaderDetails.isValid()) { + header.cipherHeaderDetails.validateCipherDetailsWithCipherKey(cipherKeys.cipherHeaderKey); + } + DecryptBlobCipherAes256Ctr decryptor( + cipherKeys.cipherTextKey, cipherKeys.cipherHeaderKey, header.iv, BlobCipherMetrics::RESTORE); + return decryptor.decrypt(dataP, dataLen, header, *arena)->toStringRef(); + } + } + + static Future decrypt(Database cx, + std::variant header, + const uint8_t* dataP, + int64_t dataLen, + Arena* arena) { + return decryptImpl(cx, header, dataP, dataLen, arena); + } + + ACTOR static Future> refreshKey(EncryptedRangeFileWriter* self, + EncryptCipherDomainId domainId) { + Reference const> dbInfo = self->cx->clientInfo; + TextAndHeaderCipherKeys cipherKeys = + wait(GetEncryptCipherKeys::getLatestEncryptCipherKeysForDomain( + dbInfo, domainId, BlobCipherMetrics::BACKUP)); + return cipherKeys.cipherTextKey; + } + + ACTOR static Future encrypt(EncryptedRangeFileWriter* self) { + // TODO: HeaderCipher key not needed for 'no authentication encryption' + ASSERT(self->cipherKeys.headerCipherKey.present() && self->cipherKeys.headerCipherKey.get().isValid() && + self->cipherKeys.textCipherKey.isValid()); + // Ensure that the keys we got are still valid before flushing the block + if (self->cipherKeys.headerCipherKey.get()->isExpired() || + self->cipherKeys.headerCipherKey.get()->needsRefresh()) { + Reference cipherKey = + wait(refreshKey(self, self->cipherKeys.headerCipherKey.get()->getDomainId())); + self->cipherKeys.headerCipherKey = cipherKey; + } + if (self->cipherKeys.textCipherKey->isExpired() || self->cipherKeys.textCipherKey->needsRefresh()) { + Reference cipherKey = wait(refreshKey(self, self->cipherKeys.textCipherKey->getDomainId())); + self->cipherKeys.textCipherKey = cipherKey; + } + EncryptBlobCipherAes265Ctr encryptor( + self->cipherKeys.textCipherKey, + self->cipherKeys.headerCipherKey, + self->cipherKeys.ivRef.begin(), + AES_256_IV_LENGTH, + getEncryptAuthTokenMode(EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE), + BlobCipherMetrics::BACKUP); + int64_t payloadSize = self->wPtr - self->dataPayloadStart; + StringRef encryptedData; + if (self->options.configurableEncryptionEnabled) { + BlobCipherEncryptHeaderRef headerRef; + encryptedData = encryptor.encrypt(self->dataPayloadStart, payloadSize, &headerRef, *self->arena); + Standalone serialized = BlobCipherEncryptHeaderRef::toStringRef(headerRef); + self->arena->dependsOn(serialized.arena()); + ASSERT(serialized.size() == self->encryptHeader.size()); + std::memcpy(mutateString(self->encryptHeader), serialized.begin(), self->encryptHeader.size()); + } else { + BlobCipherEncryptHeader header; + encryptedData = + encryptor.encrypt(self->dataPayloadStart, payloadSize, &header, *self->arena)->toStringRef(); + StringRef encryptHeaderStringRef = BlobCipherEncryptHeader::toStringRef(header, *self->arena); + ASSERT(encryptHeaderStringRef.size() == self->encryptHeader.size()); + std::memcpy(mutateString(self->encryptHeader), encryptHeaderStringRef.begin(), self->encryptHeader.size()); + } + + // re-write encrypted data to buffer + std::memcpy(self->dataPayloadStart, encryptedData.begin(), payloadSize); + return Void(); + } + + ACTOR static Future updateEncryptionKeysCtx(EncryptedRangeFileWriter* self, + KeyRef key, + SnapshotBackupUseTenantCache checkTenantCache) { + state EncryptCipherDomainId curDomainId = + wait(getEncryptionDomainDetails(key, self->encryptMode, self->tenantCache, checkTenantCache)); + state Reference const> dbInfo = self->cx->clientInfo; + + // Get text and header cipher key + TextAndHeaderCipherKeys textAndHeaderCipherKeys = + wait(GetEncryptCipherKeys::getLatestEncryptCipherKeysForDomain( + dbInfo, curDomainId, BlobCipherMetrics::BACKUP)); + self->cipherKeys.textCipherKey = textAndHeaderCipherKeys.cipherTextKey; + self->cipherKeys.headerCipherKey = textAndHeaderCipherKeys.cipherHeaderKey; + + // Set ivRef + self->cipherKeys.ivRef = makeString(AES_256_IV_LENGTH, *self->arena); + deterministicRandom()->randomBytes(mutateString(self->cipherKeys.ivRef), AES_256_IV_LENGTH); + return Void(); + } + + // Returns the number of bytes that have been written to the buffer + static int64_t currentBufferSize(EncryptedRangeFileWriter* self) { return self->wPtr - self->buffer.begin(); } + + static int64_t expectedFileSize(EncryptedRangeFileWriter* self) { + // Return what has already been written to file plus the size of the current buffer + // which indicates how many bytes the file will contain once the buffer is written + return self->file->size() + currentBufferSize(self); + } + + static void copyToBuffer(EncryptedRangeFileWriter* self, const void* src, size_t size) { + if (size > 0) { + std::memcpy(self->wPtr, src, size); + self->wPtr += size; + ASSERT(currentBufferSize(self) <= self->blockSize); + } + } + + static void appendStringRefWithLenToBuffer(EncryptedRangeFileWriter* self, StringRef* s) { + // Append the string length followed by the string to the buffer + uint32_t lenBuf = bigEndian32((uint32_t)s->size()); + copyToBuffer(self, &lenBuf, sizeof(lenBuf)); + copyToBuffer(self, s->begin(), s->size()); + } + + ACTOR static Future getEncryptionDomainDetails( + KeyRef key, + EncryptionAtRestMode encryptMode, + Optional>> tenantCache, + SnapshotBackupUseTenantCache checkTenantCache) { + if (isSystemKey(key)) { + return SYSTEM_KEYSPACE_ENCRYPT_DOMAIN_ID; + } + if (key.size() < TenantAPI::PREFIX_SIZE || encryptMode.mode == EncryptionAtRestMode::CLUSTER_AWARE) { + return FDB_DEFAULT_ENCRYPT_DOMAIN_ID; + } + // dealing with domain aware encryption so all keys should belong to a tenant + KeyRef tenantPrefix = KeyRef(key.begin(), TenantAPI::PREFIX_SIZE); + state int64_t tenantId = TenantAPI::prefixToId(tenantPrefix); + // It's possible for the first and last key in a block (when writeKey is called) to not have a valid tenant + // prefix, since they mark the start and end of a range, in that case we denote them as having a default encrypt + // domain for the purpose of encrypting the block + if (checkTenantCache && tenantCache.present()) { + Optional> payload = wait(tenantCache.get()->getById(tenantId)); + if (!payload.present()) { + return FDB_DEFAULT_ENCRYPT_DOMAIN_ID; + } + } + return tenantId; + } + + // Handles the first block and internal blocks. Ends current block if needed. + // The final flag is used in simulation to pad the file's final block to a whole block size + ACTOR static Future newBlock(EncryptedRangeFileWriter* self, + int bytesNeeded, + KeyRef lastKey, + bool writeValue, + bool final = false) { + // Write padding to finish current block if needed + int bytesLeft = self->blockEnd - expectedFileSize(self); + ASSERT(bytesLeft >= 0); + if (bytesLeft > 0) { + state Value paddingFFs = makePadding(bytesLeft); + copyToBuffer(self, paddingFFs.begin(), bytesLeft); + } + + if (expectedFileSize(self) > 0) { + // write buffer to file since block is finished + ASSERT(currentBufferSize(self) == self->blockSize); + wait(encrypt(self)); + wait(self->file->append(self->buffer.begin(), self->blockSize)); + + // reset write pointer to beginning of StringRef + self->wPtr = mutateString(self->buffer); + } + + if (final) { + ASSERT(g_network->isSimulated()); + return Void(); + } + + // Set new blockEnd + self->blockEnd += self->blockSize; + + // write Header + copyToBuffer(self, (uint8_t*)&self->fileVersion, sizeof(self->fileVersion)); + + // write options struct + self->options.configurableEncryptionEnabled = CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION; + Value serialized = + ObjectWriter::toValue(self->options, IncludeVersion(ProtocolVersion::withEncryptedSnapshotBackupFile())); + appendStringRefWithLenToBuffer(self, &serialized); + + // calculate encryption header size + uint32_t headerSize = 0; + if (self->options.configurableEncryptionEnabled) { + EncryptAuthTokenMode authTokenMode = + getEncryptAuthTokenMode(EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE); + EncryptAuthTokenAlgo authTokenAlgo = getAuthTokenAlgoFromMode(authTokenMode); + headerSize = BlobCipherEncryptHeaderRef::getHeaderSize( + CLIENT_KNOBS->ENCRYPT_HEADER_FLAGS_VERSION, + getEncryptCurrentAlgoHeaderVersion(authTokenMode, authTokenAlgo), + ENCRYPT_CIPHER_MODE_AES_256_CTR, + authTokenMode, + authTokenAlgo); + } else { + headerSize = BlobCipherEncryptHeader::headerSize; + } + ASSERT(headerSize > 0); + // write header size to buffer + copyToBuffer(self, (uint8_t*)&headerSize, sizeof(headerSize)); + // leave space for encryption header + self->encryptHeader = StringRef(self->wPtr, headerSize); + self->wPtr += headerSize; + self->dataPayloadStart = self->wPtr; + + // If this is NOT the first block then write duplicate stuff needed from last block + if (self->blockEnd > self->blockSize) { + appendStringRefWithLenToBuffer(self, &lastKey); + appendStringRefWithLenToBuffer(self, &self->lastKey); + if (writeValue) { + appendStringRefWithLenToBuffer(self, &self->lastValue); + } + } + + // There must now be room in the current block for bytesNeeded or the block size is too small + if (expectedFileSize(self) + bytesNeeded > self->blockEnd) { + throw backup_bad_block_size(); + } + + return Void(); + } + + Future padEnd(bool final) { + if (expectedFileSize(this) > 0) { + return newBlock(this, 0, StringRef(), true, final); + } + return Void(); + } + + // Ends the current block if necessary based on bytesNeeded. + ACTOR static Future newBlockIfNeeded(EncryptedRangeFileWriter* self, int bytesNeeded) { + if (expectedFileSize(self) + bytesNeeded > self->blockEnd) { + wait(newBlock(self, bytesNeeded, self->lastKey, true)); + } + return Void(); + } + + ACTOR static Future handleTenantBondary(EncryptedRangeFileWriter* self, + Key k, + Value v, + bool writeValue, + EncryptCipherDomainId curKeyDomainId, + SnapshotBackupUseTenantCache checkTenantCache) { + state KeyRef endKey = k; + // If we are crossing a boundary with a key that has a tenant prefix then truncate it + if (curKeyDomainId != SYSTEM_KEYSPACE_ENCRYPT_DOMAIN_ID && curKeyDomainId != FDB_DEFAULT_ENCRYPT_DOMAIN_ID) { + endKey = StringRef(k.begin(), TenantAPI::PREFIX_SIZE); + } + + state ValueRef newValue = StringRef(); + self->lastKey = k; + self->lastValue = v; + appendStringRefWithLenToBuffer(self, &endKey); + appendStringRefWithLenToBuffer(self, &newValue); + wait(newBlock(self, 0, endKey, writeValue)); + wait(updateEncryptionKeysCtx(self, self->lastKey, checkTenantCache)); + return Void(); + } + + ACTOR static Future finishCurTenantBlockStartNewIfNeeded(EncryptedRangeFileWriter* self, + Key k, + Value v, + bool writeValue, + SnapshotBackupUseTenantCache checkTenantCache) { + // Don't want to start a new block if the current key or previous key is empty + if (self->lastKey.size() == 0 || k.size() == 0) { + return false; + } + state EncryptCipherDomainId curKeyDomainId = + wait(getEncryptionDomainDetails(k, self->encryptMode, self->tenantCache, checkTenantCache)); + state EncryptCipherDomainId prevKeyDomainId = + wait(getEncryptionDomainDetails(self->lastKey, self->encryptMode, self->tenantCache, checkTenantCache)); + if (curKeyDomainId != prevKeyDomainId) { + CODE_PROBE(true, "crossed tenant boundaries"); + wait(handleTenantBondary(self, k, v, writeValue, curKeyDomainId, checkTenantCache)); + return true; + } + return false; + } + + // Start a new block if needed, then write the key and value + ACTOR static Future writeKV_impl(EncryptedRangeFileWriter* self, Key k, Value v) { + if (!self->cipherKeys.headerCipherKey.present() || !self->cipherKeys.headerCipherKey.get().isValid() || + !self->cipherKeys.textCipherKey.isValid()) { + wait(updateEncryptionKeysCtx(self, k, SnapshotBackupUseTenantCache::False)); + } + state int toWrite = sizeof(int32_t) + k.size() + sizeof(int32_t) + v.size(); + wait(newBlockIfNeeded(self, toWrite)); + bool createdNewBlock = + wait(finishCurTenantBlockStartNewIfNeeded(self, k, v, true, SnapshotBackupUseTenantCache::False)); + if (createdNewBlock) { + return Void(); + } + appendStringRefWithLenToBuffer(self, &k); + appendStringRefWithLenToBuffer(self, &v); + self->lastKey = k; + self->lastValue = v; + return Void(); + } + + Future writeKV(Key k, Value v) { return writeKV_impl(this, k, v); } + + // Write begin key or end key. + ACTOR static Future writeKey_impl(EncryptedRangeFileWriter* self, Key k) { + // TODO (Nim): Is it possible to write empty begin and end keys? + if (k.size() > 0 && + (!self->cipherKeys.headerCipherKey.present() || !self->cipherKeys.headerCipherKey.get().isValid() || + !self->cipherKeys.textCipherKey.isValid())) { + wait(updateEncryptionKeysCtx(self, k, SnapshotBackupUseTenantCache::True)); + } + // Need to account for extra "empty" value being written in the case of crossing tenant boundaries + int toWrite = sizeof(uint32_t) + k.size() + sizeof(uint32_t); + wait(newBlockIfNeeded(self, toWrite)); + // We want to check the tenant cache here since the first/last key for a block may not be a valid KV pair (in + // which case we use the default domain) + bool createdNewBlock = + wait(finishCurTenantBlockStartNewIfNeeded(self, k, StringRef(), false, SnapshotBackupUseTenantCache::True)); + if (createdNewBlock) { + return Void(); + } + appendStringRefWithLenToBuffer(self, &k); + self->lastKey = k; + return Void(); + } + + Future writeKey(Key k) { return writeKey_impl(this, k); } + + ACTOR static Future finish_impl(EncryptedRangeFileWriter* self) { + // Write any outstanding bytes to the file + if (currentBufferSize(self) > 0) { + wait(encrypt(self)); + wait(self->file->append(self->buffer.begin(), currentBufferSize(self))); + } + return Void(); + } + + Future finish() { return finish_impl(this); } + + Database cx; + Arena* arena; + EncryptionAtRestMode encryptMode; + Reference file; + Optional>> tenantCache; + int blockSize; + +private: + Standalone buffer; + uint8_t* wPtr; + StringRef encryptHeader; + uint8_t* dataPayloadStart; + int64_t blockEnd; + uint32_t fileVersion; + Options options; + Key lastKey; + Key lastValue; + SnapshotFileBackupEncryptionKeys cipherKeys; +}; + +// File Format handlers. +// Both Range and Log formats are designed to be readable starting at any BACKUP_RANGEFILE_BLOCK_SIZE boundary // so they can be read in parallel. // // Writer instances must be kept alive while any member actors are in progress. @@ -476,6 +990,7 @@ Value makePadding(int size) { // 1 - writeKey(key) the queried key range begin // 2 - writeKV(k, v) each kv pair to restore // 3 - writeKey(key) the queried key range end +// 4 - finish() // // RangeFileWriter will insert the required padding, header, and extra // end/begin keys around the 1MB boundaries as needed. @@ -498,7 +1013,7 @@ Value makePadding(int size) { // if the next KV pair wouldn't fit within the block after the value // then the space after the final key to the next 1MB boundary would // just be padding anyway. -struct RangeFileWriter { +struct RangeFileWriter : public IRangeFileWriter { RangeFileWriter(Reference file = Reference(), int blockSize = 0) : file(file), blockSize(blockSize), blockEnd(0), fileVersion(BACKUP_AGENT_SNAPSHOT_FILE_VERSION) {} @@ -538,10 +1053,10 @@ struct RangeFileWriter { } // Used in simulation only to create backup file sizes which are an integer multiple of the block size - Future padEnd() { + Future padEnd(bool final) { ASSERT(g_network->isSimulated()); if (file->size() > 0) { - return newBlock(this, 0, true); + return newBlock(this, 0, final); } return Void(); } @@ -576,6 +1091,8 @@ struct RangeFileWriter { Future writeKey(Key k) { return writeKey_impl(this, k); } + Future finish() { return Void(); } + Reference file; int blockSize; @@ -586,6 +1103,93 @@ struct RangeFileWriter { Key lastValue; }; +ACTOR static Future decodeKVPairs(StringRefReader* reader, + Standalone>* results, + bool encryptedBlock, + EncryptionAtRestMode encryptMode, + Optional blockDomainId, + Optional>> tenantCache) { + // Read begin key, if this fails then block was invalid. + state uint32_t kLen = reader->consumeNetworkUInt32(); + state const uint8_t* k = reader->consume(kLen); + results->push_back(results->arena(), KeyValueRef(KeyRef(k, kLen), ValueRef())); + state KeyRef prevKey = KeyRef(k, kLen); + state bool done = false; + state Optional prevDomainId; + // Read kv pairs and end key + while (1) { + // Read a key. + kLen = reader->consumeNetworkUInt32(); + k = reader->consume(kLen); + + // make sure that all keys in a block belong to exactly one tenant, + // unless its the last key in which case it can be a truncated (different) tenant prefix + if (encryptedBlock && g_network && g_network->isSimulated()) { + ASSERT(blockDomainId.present()); + state KeyRef curKey = KeyRef(k, kLen); + if (!prevDomainId.present()) { + EncryptCipherDomainId domainId = wait(EncryptedRangeFileWriter::getEncryptionDomainDetails( + prevKey, encryptMode, tenantCache, SnapshotBackupUseTenantCache::False)); + prevDomainId = domainId; + } + state EncryptCipherDomainId curDomainId = wait(EncryptedRangeFileWriter::getEncryptionDomainDetails( + curKey, encryptMode, tenantCache, SnapshotBackupUseTenantCache::False)); + if (!curKey.empty() && !prevKey.empty() && prevDomainId.get() != curDomainId) { + ASSERT(!done); + // Make sure that all tenant specific keys in a block have the correct prefix size + if (curDomainId != SYSTEM_KEYSPACE_ENCRYPT_DOMAIN_ID && curDomainId != FDB_DEFAULT_ENCRYPT_DOMAIN_ID && + curKey.size() != TenantAPI::PREFIX_SIZE) { + ASSERT(tenantCache.present()); + Optional> payload = wait(tenantCache.get()->getById(curDomainId)); + ASSERT(!payload.present()); + } + done = true; + } + // make sure that all keys (except the last key) in a block are encrypted using the correct key.; + if (blockDomainId.get() != FDB_DEFAULT_ENCRYPT_DOMAIN_ID && !prevKey.empty()) { + ASSERT_EQ(prevDomainId.get(), blockDomainId.get()); + } + prevKey = curKey; + prevDomainId = curDomainId; + } + + // If eof reached or first value len byte is 0xFF then a valid block end was reached. + if (reader->eof() || *reader->rptr == 0xFF) { + results->push_back(results->arena(), KeyValueRef(KeyRef(k, kLen), ValueRef())); + break; + } + + // Read a value, which must exist or the block is invalid + state uint32_t vLen = reader->consumeNetworkUInt32(); + state const uint8_t* v = reader->consume(vLen); + if (tenantCache.present() && !isSystemKey(KeyRef(k, kLen))) { + state int64_t tenantId = TenantAPI::extractTenantIdFromKeyRef(StringRef(k, kLen)); + Optional> payload = wait(tenantCache.get()->getById(tenantId)); + // The first and last KV pairs are not restored so if the tenant is not found for the last key then it's ok + // to include it in the restore set + if (!payload.present() && !(reader->eof() || *reader->rptr == 0xFF)) { + TraceEvent(SevWarnAlways, "SnapshotRestoreTenantNotFound").detail("TenantId", tenantId); + CODE_PROBE(true, "Snapshot restore tenant not found"); + } else { + results->push_back(results->arena(), KeyValueRef(KeyRef(k, kLen), ValueRef(v, vLen))); + } + } else { + results->push_back(results->arena(), KeyValueRef(KeyRef(k, kLen), ValueRef(v, vLen))); + } + + // If eof reached or first byte of next key len is 0xFF then a valid block end was reached. + if (reader->eof() || *reader->rptr == 0xFF) + break; + } + + // Make sure any remaining bytes in the block are 0xFF + for (auto b : reader->remainder()) + if (b != 0xFF) + throw restore_corrupted_data_padding(); + + return Void(); +} + static Reference getBackupContainerWithProxy(Reference _bc) { Reference bc = IBackupContainer::openContainer(_bc->getURL(), fileBackupAgentProxy, {}); return bc; @@ -606,13 +1210,8 @@ Standalone> decodeRangeFileBlock(const Standalone> decodeRangeFileBlock(const Standalone> decodeRangeFileBlock(const Standalone>> decodeRangeFileBlock(Reference file, int64_t offset, - int len) { + int len, + Database cx) { state Standalone buf = makeString(len); int rLen = wait(uncancellable(holdWhile(buf, file->read(mutateString(buf), len, offset)))); if (rLen != len) @@ -644,14 +1240,86 @@ ACTOR Future>> decodeRangeFileBlock(Reference< simulateBlobFailure(); + state Standalone> results({}, buf.arena()); + state StringRefReader reader(buf, restore_corrupted_data()); + state Arena arena; + state DatabaseConfiguration config = wait(getDatabaseConfiguration(cx)); + state Optional>> tenantCache; + if (config.tenantMode == TenantMode::REQUIRED) { + tenantCache = makeReference>(cx, TenantEntryCacheRefreshMode::WATCH); + wait(tenantCache.get()->init()); + } + state EncryptionAtRestMode encryptMode = config.encryptionAtRestMode; + state int64_t blockDomainId = TenantInfo::INVALID_TENANT; + try { - return decodeRangeFileBlock(buf); + // Read header, currently only decoding BACKUP_AGENT_SNAPSHOT_FILE_VERSION or + // BACKUP_AGENT_ENCRYPTED_SNAPSHOT_FILE_VERSION + int32_t file_version = reader.consume(); + ASSERT(!encryptMode.isEncryptionEnabled() || file_version == BACKUP_AGENT_ENCRYPTED_SNAPSHOT_FILE_VERSION); + if (file_version == BACKUP_AGENT_SNAPSHOT_FILE_VERSION) { + wait(decodeKVPairs(&reader, &results, false, encryptMode, Optional(), tenantCache)); + } else if (file_version == BACKUP_AGENT_ENCRYPTED_SNAPSHOT_FILE_VERSION) { + CODE_PROBE(true, "decoding encrypted block"); + // decode options struct + state uint32_t optionsLen = reader.consumeNetworkUInt32(); + const uint8_t* o = reader.consume(optionsLen); + StringRef optionsStringRef = StringRef(o, optionsLen); + EncryptedRangeFileWriter::Options options = + ObjectReader::fromStringRef(optionsStringRef, IncludeVersion()); + // read header size + state uint32_t headerLen = reader.consume(); + // read the encryption header + state const uint8_t* headerStart = reader.consume(headerLen); + StringRef headerS = StringRef(headerStart, headerLen); + state std::variant encryptHeader; + if (options.configurableEncryptionEnabled) { + encryptHeader = BlobCipherEncryptHeaderRef::fromStringRef(headerS); + blockDomainId = std::get(encryptHeader) + .getCipherDetails() + .textCipherDetails.encryptDomainId; + } else { + encryptHeader = BlobCipherEncryptHeader::fromStringRef(headerS); + blockDomainId = std::get(encryptHeader).cipherTextDetails.encryptDomainId; + } + + if (config.tenantMode == TenantMode::REQUIRED && !isReservedEncryptDomain(blockDomainId)) { + ASSERT(tenantCache.present()); + Optional> payload = wait(tenantCache.get()->getById(blockDomainId)); + if (!payload.present()) { + throw tenant_not_found(); + } + } + const uint8_t* dataPayloadStart = headerStart + headerLen; + // calculate the total bytes read up to (and including) the header + int64_t bytesRead = sizeof(int32_t) + sizeof(uint32_t) + sizeof(uint32_t) + optionsLen + headerLen; + // get the size of the encrypted payload and decrypt it + int64_t dataLen = len - bytesRead; + StringRef decryptedData = + wait(EncryptedRangeFileWriter::decrypt(cx, encryptHeader, dataPayloadStart, dataLen, &results.arena())); + reader = StringRefReader(decryptedData, restore_corrupted_data()); + wait(decodeKVPairs(&reader, &results, true, encryptMode, blockDomainId, tenantCache)); + } else { + throw restore_unsupported_file_version(); + } + return results; } catch (Error& e) { + if (e.code() == error_code_encrypt_keys_fetch_failed || e.code() == error_code_encrypt_key_not_found) { + ASSERT(!isReservedEncryptDomain(blockDomainId)); + TraceEvent(SevWarnAlways, "SnapshotRestoreEncryptKeyFetchFailed").detail("TenantId", blockDomainId); + CODE_PROBE(true, "Snapshot restore encrypt keys not found"); + } else if (e.code() == error_code_tenant_not_found) { + ASSERT(!isReservedEncryptDomain(blockDomainId)); + TraceEvent(SevWarnAlways, "EncryptedSnapshotRestoreTenantNotFound").detail("TenantId", blockDomainId); + CODE_PROBE(true, "Encrypted Snapshot restore tenant not found"); + } TraceEvent(SevWarn, "FileRestoreDecodeRangeFileBlockFailed") .error(e) .detail("Filename", file->getFilename()) .detail("BlockOffset", offset) - .detail("BlockLen", len); + .detail("BlockLen", len) + .detail("ErrorRelativeOffset", reader.rptr - buf.begin()) + .detail("ErrorAbsoluteOffset", reader.rptr - buf.begin() + offset); throw; } } @@ -760,7 +1428,7 @@ ACTOR Future checkTaskVersion(Database cx, Reference task, StringRef .detail("TaskVersion", taskVersion) .detail("Name", name) .detail("Version", version); - if (KeyBackedConfig::TaskParams.uid().exists(task)) { + if (KeyBackedTaskConfig::TaskParams.uid().exists(task)) { std::string msg = format("%s task version `%lu' is greater than supported version `%lu'", task->params[Task::reservedTaskParamKeyType].toString().c_str(), (unsigned long)taskVersion, @@ -790,8 +1458,7 @@ ACTOR static Future abortFiveZeroBackup(FileBackupAgent* backupAgent, state Subspace statusSpace = backupAgent->subspace.get(BackupAgentBase::keyStates).get(uid.toString()); state Subspace globalConfig = backupAgent->subspace.get(BackupAgentBase::keyConfig).get(uid.toString()); - state Subspace newConfigSpace = - uidPrefixKey(LiteralStringRef("uid->config/").withPrefix(fileBackupPrefixRange.begin), uid); + state Subspace newConfigSpace = uidPrefixKey("uid->config/"_sr.withPrefix(fileBackupPrefixRange.begin), uid); Optional statusStr = wait(tr->get(statusSpace.pack(FileBackupAgent::keyStateStatus))); state EBackupState status = @@ -831,8 +1498,6 @@ struct AbortFiveZeroBackupTask : TaskFuncBase { state FileBackupAgent backupAgent; state std::string tagName = task->params[BackupAgentBase::keyConfigBackupTag].toString(); - TEST(true); // Canceling old backup task - TraceEvent(SevInfo, "FileBackupCancelOldTask") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("TagName", tagName); @@ -862,7 +1527,7 @@ struct AbortFiveZeroBackupTask : TaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef AbortFiveZeroBackupTask::name = LiteralStringRef("abort_legacy_backup"); +StringRef AbortFiveZeroBackupTask::name = "abort_legacy_backup"_sr; REGISTER_TASKFUNC(AbortFiveZeroBackupTask); REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_backup_diff_logs); REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_backup_log_range); @@ -917,8 +1582,6 @@ struct AbortFiveOneBackupTask : TaskFuncBase { state BackupConfig config(task); state std::string tagName = wait(config.tag().getOrThrow(tr)); - TEST(true); // Canceling 5.1 backup task - TraceEvent(SevInfo, "FileBackupCancelFiveOneTask") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("TagName", tagName); @@ -948,7 +1611,7 @@ struct AbortFiveOneBackupTask : TaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef AbortFiveOneBackupTask::name = LiteralStringRef("abort_legacy_backup_5.2"); +StringRef AbortFiveOneBackupTask::name = "abort_legacy_backup_5.2"_sr; REGISTER_TASKFUNC(AbortFiveOneBackupTask); REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_write_range); REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_dispatch_ranges); @@ -987,7 +1650,7 @@ ACTOR static Future addBackupTask(StringRef name, } wait(waitFor->onSetAddTask(tr, taskBucket, task)); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } // Clears the backup ID from "backupStartedKey" to pause backup workers. @@ -1059,9 +1722,9 @@ struct BackupRangeTaskFunc : BackupTaskFuncBase { static constexpr uint32_t version = 1; static struct { - static TaskParam beginKey() { return LiteralStringRef(__FUNCTION__); } - static TaskParam endKey() { return LiteralStringRef(__FUNCTION__); } - static TaskParam addBackupRangeTasks() { return LiteralStringRef(__FUNCTION__); } + static TaskParam beginKey() { return __FUNCTION__sr; } + static TaskParam endKey() { return __FUNCTION__sr; } + static TaskParam addBackupRangeTasks() { return __FUNCTION__sr; } } Params; std::string toString(Reference task) const override { @@ -1086,8 +1749,8 @@ struct BackupRangeTaskFunc : BackupTaskFuncBase { return _finish(tr, tb, fb, task); }; - // Finish (which flushes/syncs) the file, and then in a single transaction, make some range backup progress durable. - // This means: + // Finish (which flushes/syncs) the file, and then in a single transaction, make some range backup progress + // durable. This means: // - increment the backup config's range bytes written // - update the range file map // - update the task begin key @@ -1195,8 +1858,8 @@ struct BackupRangeTaskFunc : BackupTaskFuncBase { .detail("EndKey", Params.endKey().get(task).printable()) .detail("TaskKey", task->key.printable()); - // When a key range task saves the last chunk of progress and then the executor dies, when the task continues - // its beginKey and endKey will be equal but there is no work to be done. + // When a key range task saves the last chunk of progress and then the executor dies, when the task + // continues its beginKey and endKey will be equal but there is no work to be done. if (beginKey == endKey) return Void(); @@ -1209,8 +1872,8 @@ struct BackupRangeTaskFunc : BackupTaskFuncBase { } // Read everything from beginKey to endKey, write it to an output file, run the output file processor, and - // then set on_done. If we are still writing after X seconds, end the output file and insert a new backup_range - // task for the remainder. + // then set on_done. If we are still writing after X seconds, end the output file and insert a new + // backup_range task for the remainder. state Reference outFile; state Version outVersion = invalidVersion; state Key lastKey; @@ -1225,18 +1888,28 @@ struct BackupRangeTaskFunc : BackupTaskFuncBase { Terminator::True, AccessSystemKeys::True, LockAware::True); - state RangeFileWriter rangeFile; + state std::unique_ptr rangeFile; state BackupConfig backup(task); + state Arena arena; - // Don't need to check keepRunning(task) here because we will do that while finishing each output file, but if - // bc is false then clearly the backup is no longer in progress - Reference _bc = wait(backup.backupContainer().getD(cx)); + DatabaseConfiguration config = wait(getDatabaseConfiguration(cx)); + state EncryptionAtRestMode encryptMode = config.encryptionAtRestMode; + state Optional>> tenantCache; + if (encryptMode.mode == EncryptionAtRestMode::DOMAIN_AWARE) { + tenantCache = makeReference>(cx, TenantEntryCacheRefreshMode::WATCH); + wait(tenantCache.get()->init()); + } + + // Don't need to check keepRunning(task) here because we will do that while finishing each output file, but + // if bc is false then clearly the backup is no longer in progress + Reference _bc = wait(backup.backupContainer().getD(cx.getReference())); if (!_bc) { return Void(); } state Reference bc = getBackupContainerWithProxy(_bc); state bool done = false; state int64_t nrKeys = 0; + state Optional encryptionEnabled; loop { state RangeResultWithVersion values; @@ -1251,17 +1924,20 @@ struct BackupRangeTaskFunc : BackupTaskFuncBase { throw; } - // If we've seen a new read version OR hit the end of the stream, then if we were writing a file finish it. + // If we've seen a new read version OR hit the end of the stream, then if we were writing a file finish + // it. if (values.second != outVersion || done) { if (outFile) { - TEST(outVersion != invalidVersion); // Backup range task wrote multiple versions + CODE_PROBE(outVersion != invalidVersion, "Backup range task wrote multiple versions"); state Key nextKey = done ? endKey : keyAfter(lastKey); - wait(rangeFile.writeKey(nextKey)); + wait(rangeFile->writeKey(nextKey)); if (BUGGIFY) { - wait(rangeFile.padEnd()); + wait(rangeFile->padEnd(true)); } + wait(rangeFile->finish()); + bool usedFile = wait( finishRangeFile(outFile, cx, task, taskBucket, KeyRangeRef(beginKey, nextKey), outVersion)); TraceEvent("FileBackupWroteRangeFile") @@ -1284,8 +1960,8 @@ struct BackupRangeTaskFunc : BackupTaskFuncBase { // Start writing a new file after verifying this task should keep running as of a new read version // (which must be >= outVersion) outVersion = values.second; - // block size must be at least large enough for 3 max size keys and 2 max size values + overhead so 250k - // conservatively. + // block size must be at least large enough for 3 max size keys and 2 max size values + overhead so + // 250k conservatively. state int blockSize = BUGGIFY ? deterministicRandom()->randomInt(250e3, 4e6) : CLIENT_KNOBS->BACKUP_RANGEFILE_BLOCK_SIZE; state Version snapshotBeginVersion; @@ -1299,6 +1975,7 @@ struct BackupRangeTaskFunc : BackupTaskFuncBase { wait(taskBucket->keepRunning(tr, task) && storeOrThrow(snapshotBeginVersion, backup.snapshotBeginVersion().get(tr)) && + store(encryptionEnabled, backup.enableSnapshotBackupEncryption().get(tr)) && store(snapshotRangeFileCount, backup.snapshotRangeFileCount().getD(tr))); break; @@ -1311,16 +1988,26 @@ struct BackupRangeTaskFunc : BackupTaskFuncBase { wait(bc->writeRangeFile(snapshotBeginVersion, snapshotRangeFileCount, outVersion, blockSize)); outFile = f; + if (!encryptionEnabled.present() || !encryptionEnabled.get()) { + encryptMode = EncryptionAtRestMode::DISABLED; + } + TraceEvent(SevDebug, "EncryptionMode").detail("EncryptMode", encryptMode.toString()); // Initialize range file writer and write begin key - rangeFile = RangeFileWriter(outFile, blockSize); - wait(rangeFile.writeKey(beginKey)); + if (encryptMode.mode != EncryptionAtRestMode::DISABLED) { + CODE_PROBE(true, "using encrypted snapshot file writer"); + rangeFile = std::make_unique( + cx, &arena, encryptMode, tenantCache, outFile, blockSize); + } else { + rangeFile = std::make_unique(outFile, blockSize); + } + wait(rangeFile->writeKey(beginKey)); } // write kvData to file, update lastKey and key count if (values.first.size() != 0) { state size_t i = 0; for (; i < values.first.size(); ++i) { - wait(rangeFile.writeKV(values.first[i].key, values.first[i].value)); + wait(rangeFile->writeKV(values.first[i].key, values.first[i].value)); } lastKey = values.first.back().key; nrKeys += values.first.size(); @@ -1385,7 +2072,6 @@ struct BackupRangeTaskFunc : BackupTaskFuncBase { Reference futureBucket, Reference task) { state Reference taskFuture = futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone]); - if (Params.addBackupRangeTasks().get(task)) { wait(startBackupRangeInternal(tr, taskBucket, futureBucket, task, taskFuture)); } else { @@ -1404,7 +2090,7 @@ struct BackupRangeTaskFunc : BackupTaskFuncBase { return Void(); } }; -StringRef BackupRangeTaskFunc::name = LiteralStringRef("file_backup_write_range_5.2"); +StringRef BackupRangeTaskFunc::name = "file_backup_write_range_5.2"_sr; REGISTER_TASKFUNC(BackupRangeTaskFunc); struct BackupSnapshotDispatchTask : BackupTaskFuncBase { @@ -1413,11 +2099,11 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { static struct { // Set by Execute, used by Finish - static TaskParam shardsBehind() { return LiteralStringRef(__FUNCTION__); } + static TaskParam shardsBehind() { return __FUNCTION__sr; } // Set by Execute, used by Finish - static TaskParam snapshotFinished() { return LiteralStringRef(__FUNCTION__); } + static TaskParam snapshotFinished() { return __FUNCTION__sr; } // Set by Execute, used by Finish - static TaskParam nextDispatchVersion() { return LiteralStringRef(__FUNCTION__); } + static TaskParam nextDispatchVersion() { return __FUNCTION__sr; } } Params; StringRef getName() const override { return name; }; @@ -1470,12 +2156,12 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { state double startTime = timer(); state Reference tr(new ReadYourWritesTransaction(cx)); - // The shard map will use 3 values classes. Exactly SKIP, exactly DONE, then any number >= NOT_DONE_MIN which - // will mean not done. This is to enable an efficient coalesce() call to squash adjacent ranges which are not - // yet finished to enable efficiently finding random database shards which are not done. + // The shard map will use 3 values classes. Exactly SKIP, exactly DONE, then any number >= NOT_DONE_MIN + // which will mean not done. This is to enable an efficient coalesce() call to squash adjacent ranges which + // are not yet finished to enable efficiently finding random database shards which are not done. state int notDoneSequence = NOT_DONE_MIN; - state KeyRangeMap shardMap(notDoneSequence++, normalKeys.end); - state Key beginKey = normalKeys.begin; + state KeyRangeMap shardMap(notDoneSequence++); + state Key beginKey = allKeys.begin; // Read all shard boundaries and add them to the map loop { @@ -1484,7 +2170,7 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { tr->setOption(FDBTransactionOptions::LOCK_AWARE); state Future>> shardBoundaries = - getBlockOfShards(tr, beginKey, normalKeys.end, CLIENT_KNOBS->TOO_MANY); + getBlockOfShards(tr, beginKey, allKeys.end, CLIENT_KNOBS->TOO_MANY); wait(success(shardBoundaries) && taskBucket->keepRunning(tr, task)); if (shardBoundaries.get().size() == 0) @@ -1529,7 +2215,8 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { store(latestSnapshotEndVersion, config.latestSnapshotEndVersion().get(tr)) && store(recentReadVersion, tr->getReadVersion()) && taskBucket->keepRunning(tr, task)); - // If the snapshot batch future key does not exist, this is the first execution of this dispatch task so + // If the snapshot batch future key does not exist, this is the first execution of this dispatch + // task so // - create and set the snapshot batch future key // - initialize the batch size to 0 // - initialize the target snapshot end version if it is not yet set @@ -1541,7 +2228,8 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { config.snapshotBatchSize().set(tr, snapshotBatchSize.get()); // The dispatch of this batch can take multiple separate executions if the executor fails - // so store a completion key for the dispatch finish() to set when dispatching the batch is done. + // so store a completion key for the dispatch finish() to set when dispatching the batch is + // done. state TaskCompletionKey dispatchCompletionKey = TaskCompletionKey::joinWith(snapshotBatchFuture); // this is a bad hack - but flow doesn't work well with lambda functions and caputring // state variables... @@ -1567,24 +2255,28 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { // Read all dispatched ranges state std::vector> dispatchBoundaries; tr->reset(); - beginKey = normalKeys.begin; + beginKey = allKeys.begin; loop { try { tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr->setOption(FDBTransactionOptions::LOCK_AWARE); - state Future>> bounds = config.snapshotRangeDispatchMap().getRange( - tr, beginKey, keyAfter(normalKeys.end), CLIENT_KNOBS->TOO_MANY); + state Future bounds = + config.snapshotRangeDispatchMap().getRange( + tr, beginKey, keyAfter(allKeys.end), CLIENT_KNOBS->TOO_MANY); wait(success(bounds) && taskBucket->keepRunning(tr, task) && store(recentReadVersion, tr->getReadVersion())); - if (bounds.get().empty()) - break; + if (!bounds.get().results.empty()) { + dispatchBoundaries.reserve(dispatchBoundaries.size() + bounds.get().results.size()); + dispatchBoundaries.insert( + dispatchBoundaries.end(), bounds.get().results.begin(), bounds.get().results.end()); + } - dispatchBoundaries.reserve(dispatchBoundaries.size() + bounds.get().size()); - dispatchBoundaries.insert(dispatchBoundaries.end(), bounds.get().begin(), bounds.get().end()); + if (!bounds.get().more) + break; - beginKey = keyAfter(bounds.get().back().first); + beginKey = keyAfter(bounds.get().results.back().first); tr->reset(); } catch (Error& e) { wait(tr->onError(e)); @@ -1612,8 +2304,8 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { // If this was the end of a dispatched range if (!boundary.second) { - // Ensure that the dispatched boundaries exist AND set all shard ranges in the dispatched range to - // DONE. + // Ensure that the dispatched boundaries exist AND set all shard ranges in the dispatched range + // to DONE. RangeMap::Ranges shardRanges = shardMap.modify(KeyRangeRef(lastKey, boundary.first)); iShard = shardRanges.begin(); @@ -1634,7 +2326,7 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { // Set anything outside the backup ranges to SKIP. We can use insert() here instead of modify() // because it's OK to delete shard boundaries in the skipped ranges. if (backupRanges.size() > 0) { - shardMap.insert(KeyRangeRef(normalKeys.begin, backupRanges.front().begin), SKIP); + shardMap.insert(KeyRangeRef(allKeys.begin, backupRanges.front().begin), SKIP); wait(yield()); for (i = 0; i < backupRanges.size() - 1; ++i) { @@ -1642,7 +2334,7 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { wait(yield()); } - shardMap.insert(KeyRangeRef(backupRanges.back().end, normalKeys.end), SKIP); + shardMap.insert(KeyRangeRef(backupRanges.back().end, allKeys.end), SKIP); wait(yield()); } @@ -1663,7 +2355,7 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { } // Coalesce the shard map to make random selection below more efficient. - shardMap.coalesce(normalKeys); + shardMap.coalesce(allKeys); wait(yield()); // In this context "all" refers to all of the shards relevant for this particular backup @@ -1695,10 +2387,10 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { nextDispatchVersion = recentReadVersion + CLIENT_KNOBS->CORE_VERSIONSPERSECOND * CLIENT_KNOBS->BACKUP_SNAPSHOT_DISPATCH_INTERVAL_SEC; - // If nextDispatchVersion is greater than snapshotTargetEndVersion (which could be in the past) then just use - // the greater of recentReadVersion or snapshotTargetEndVersion. Any range tasks created in this dispatch will - // be scheduled at a random time between recentReadVersion and nextDispatchVersion, - // so nextDispatchVersion shouldn't be less than recentReadVersion. + // If nextDispatchVersion is greater than snapshotTargetEndVersion (which could be in the past) then just + // use the greater of recentReadVersion or snapshotTargetEndVersion. Any range tasks created in this + // dispatch will be scheduled at a random time between recentReadVersion and nextDispatchVersion, so + // nextDispatchVersion shouldn't be less than recentReadVersion. if (nextDispatchVersion > snapshotTargetEndVersion) nextDispatchVersion = std::max(recentReadVersion, snapshotTargetEndVersion); @@ -1718,12 +2410,12 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { state int countShardsToDispatch = std::max(0, countExpectedShardsDone - countShardsDone); // Calculate the number of shards that would have been dispatched by a normal (on-schedule) - // BackupSnapshotDispatchTask given the dispatch window and the start and expected-end versions of the current - // snapshot. + // BackupSnapshotDispatchTask given the dispatch window and the start and expected-end versions of the + // current snapshot. int64_t dispatchWindow = nextDispatchVersion - recentReadVersion; - // If the scheduled snapshot interval is 0 (such as for initial, as-fast-as-possible snapshot) then all shards - // are considered late + // If the scheduled snapshot interval is 0 (such as for initial, as-fast-as-possible snapshot) then all + // shards are considered late int countShardsExpectedPerNormalWindow; if (snapshotScheduledVersionInterval == 0) { countShardsExpectedPerNormalWindow = 0; @@ -1734,8 +2426,8 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { (double(dispatchWindow) / snapshotScheduledVersionInterval) * countAllShards; } - // The number of shards 'behind' the snapshot is the count of how may additional shards beyond normal are being - // dispatched, if any. + // The number of shards 'behind' the snapshot is the count of how may additional shards beyond normal are + // being dispatched, if any. int countShardsBehind = std::max(0, countShardsToDispatch + snapshotBatchSize.get() - countShardsExpectedPerNormalWindow); Params.shardsBehind().set(task, countShardsBehind); @@ -1813,8 +2505,8 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { wait(store(snapshotBatchSize.get(), config.snapshotBatchSize().getOrThrow(tr)) && waitForAll(beginReads) && waitForAll(endReads) && taskBucket->keepRunning(tr, task)); - // Snapshot batch size should be either oldBatchSize or newBatchSize. If new, this transaction is - // already done. + // Snapshot batch size should be either oldBatchSize or newBatchSize. If new, this transaction + // is already done. if (snapshotBatchSize.get() == newBatchSize) { break; } else { @@ -1852,8 +2544,8 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { } Version scheduledVersion = invalidVersion; - // If the next dispatch version is in the future, choose a random version at which to start - // the new task. + // If the next dispatch version is in the future, choose a random version at which to + // start the new task. if (nextDispatchVersion > recentReadVersion) scheduledVersion = recentReadVersion + deterministicRandom()->random01() * (nextDispatchVersion - recentReadVersion); @@ -1879,8 +2571,8 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { .detail("BeginKey", range.begin.printable()) .detail("EndKey", range.end.printable()); } else { - // This shouldn't happen because if the transaction was already done or if another execution - // of this task is making progress it should have been detected above. + // This shouldn't happen because if the transaction was already done or if another + // execution of this task is making progress it should have been detected above. ASSERT(false); } } @@ -1912,9 +2604,9 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { } // This function is just a wrapper for BackupSnapshotManifest::addTask() which is defined below. - // The BackupSnapshotDispatchTask and BackupSnapshotManifest tasks reference each other so in order to keep their - // execute and finish phases defined together inside their class definitions this wrapper is declared here but - // defined after BackupSnapshotManifest is defined. + // The BackupSnapshotDispatchTask and BackupSnapshotManifest tasks reference each other so in order to keep + // their execute and finish phases defined together inside their class definitions this wrapper is declared here + // but defined after BackupSnapshotManifest is defined. static Future addSnapshotManifestTask(Reference tr, Reference taskBucket, Reference parentTask, @@ -1947,9 +2639,9 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { state Reference snapshotFinishedFuture = task->getDoneFuture(futureBucket); - // If the snapshot is finished, the next task is to write a snapshot manifest, otherwise it's another snapshot - // dispatch task. In either case, the task should wait for snapshotBatchFuture. The snapshot done key, passed to - // the current task, is also passed on. + // If the snapshot is finished, the next task is to write a snapshot manifest, otherwise it's another + // snapshot dispatch task. In either case, the task should wait for snapshotBatchFuture. The snapshot done + // key, passed to the current task, is also passed on. if (Params.snapshotFinished().getOrDefault(task, false)) { wait(success(addSnapshotManifestTask( tr, taskBucket, task, TaskCompletionKey::signal(snapshotFinishedFuture), snapshotBatchFuture))); @@ -1971,7 +2663,7 @@ struct BackupSnapshotDispatchTask : BackupTaskFuncBase { return Void(); } }; -StringRef BackupSnapshotDispatchTask::name = LiteralStringRef("file_backup_dispatch_ranges_5.2"); +StringRef BackupSnapshotDispatchTask::name = "file_backup_dispatch_ranges_5.2"_sr; REGISTER_TASKFUNC(BackupSnapshotDispatchTask); struct BackupLogRangeTaskFunc : BackupTaskFuncBase { @@ -1979,10 +2671,10 @@ struct BackupLogRangeTaskFunc : BackupTaskFuncBase { static constexpr uint32_t version = 1; static struct { - static TaskParam addBackupLogRangeTasks() { return LiteralStringRef(__FUNCTION__); } - static TaskParam fileSize() { return LiteralStringRef(__FUNCTION__); } - static TaskParam beginVersion() { return LiteralStringRef(__FUNCTION__); } - static TaskParam endVersion() { return LiteralStringRef(__FUNCTION__); } + static TaskParam addBackupLogRangeTasks() { return __FUNCTION__sr; } + static TaskParam fileSize() { return __FUNCTION__sr; } + static TaskParam beginVersion() { return __FUNCTION__sr; } + static TaskParam endVersion() { return __FUNCTION__sr; } } Params; StringRef getName() const override { return name; }; @@ -2043,10 +2735,10 @@ struct BackupLogRangeTaskFunc : BackupTaskFuncBase { Key destUidValue = wait(config.destUidValue().getOrThrow(tr)); // Get the set of key ranges that hold mutations for (beginVersion, endVersion). They will be queried in - // parallel below and there is a limit on how many we want to process in a single BackupLogRangeTask so if that - // limit is exceeded then set the addBackupLogRangeTasks boolean in Params and stop, signalling the finish() - // step to break up the (beginVersion, endVersion) range into smaller intervals which are then processed by - // individual BackupLogRangeTasks. + // parallel below and there is a limit on how many we want to process in a single BackupLogRangeTask so if + // that limit is exceeded then set the addBackupLogRangeTasks boolean in Params and stop, signalling the + // finish() step to break up the (beginVersion, endVersion) range into smaller intervals which are then + // processed by individual BackupLogRangeTasks. state Standalone> ranges = getLogRanges(beginVersion, endVersion, destUidValue); if (ranges.size() > CLIENT_KNOBS->BACKUP_MAX_LOG_RANGES) { Params.addBackupLogRangeTasks().set(task, true); @@ -2060,9 +2752,9 @@ struct BackupLogRangeTaskFunc : BackupTaskFuncBase { state Reference outFile = wait(bc->writeLogFile(beginVersion, endVersion, blockSize)); state LogFileWriter logFile(outFile, blockSize); - // Query all key ranges covering (beginVersion, endVersion) in parallel, writing their results to the results - // promise stream as they are received. Note that this means the records read from the results stream are not - // likely to be in increasing Version order. + // Query all key ranges covering (beginVersion, endVersion) in parallel, writing their results to the + // results promise stream as they are received. Note that this means the records read from the results + // stream are not likely to be in increasing Version order. state PromiseStream results; state std::vector> rc; @@ -2071,7 +2763,7 @@ struct BackupLogRangeTaskFunc : BackupTaskFuncBase { readCommitted(cx, results, lock, range, Terminator::False, AccessSystemKeys::True, LockAware::True)); } - state Future sendEOS = map(errorOr(waitForAll(rc)), [=](ErrorOr const& result) { + state Future sendEOS = map(errorOr(waitForAll(rc)), [=](ErrorOr const& result) mutable { if (result.isError()) results.sendError(result.getError()); else @@ -2210,7 +2902,7 @@ struct BackupLogRangeTaskFunc : BackupTaskFuncBase { } }; -StringRef BackupLogRangeTaskFunc::name = LiteralStringRef("file_backup_write_logs_5.2"); +StringRef BackupLogRangeTaskFunc::name = "file_backup_write_logs_5.2"_sr; REGISTER_TASKFUNC(BackupLogRangeTaskFunc); // This task stopped being used in 6.2, however the code remains here to handle upgrades. @@ -2220,9 +2912,9 @@ struct EraseLogRangeTaskFunc : BackupTaskFuncBase { StringRef getName() const override { return name; }; static struct { - static TaskParam beginVersion() { return LiteralStringRef(__FUNCTION__); } - static TaskParam endVersion() { return LiteralStringRef(__FUNCTION__); } - static TaskParam destUidValue() { return LiteralStringRef(__FUNCTION__); } + static TaskParam beginVersion() { return __FUNCTION__sr; } + static TaskParam endVersion() { return __FUNCTION__sr; } + static TaskParam destUidValue() { return __FUNCTION__sr; } } Params; ACTOR static Future addTask(Reference tr, @@ -2241,7 +2933,8 @@ struct EraseLogRangeTaskFunc : BackupTaskFuncBase { BackupConfig(logUid), waitFor, [=](Reference task) { - Params.beginVersion().set(task, 1); // FIXME: remove in 6.X, only needed for 5.2 backward compatibility + Params.beginVersion().set(task, + 1); // FIXME: remove in 6.X, only needed for 5.2 backward compatibility Params.endVersion().set(task, endVersion); Params.destUidValue().set(task, destUidValue); }, @@ -2285,7 +2978,7 @@ struct EraseLogRangeTaskFunc : BackupTaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef EraseLogRangeTaskFunc::name = LiteralStringRef("file_backup_erase_logs_5.2"); +StringRef EraseLogRangeTaskFunc::name = "file_backup_erase_logs_5.2"_sr; REGISTER_TASKFUNC(EraseLogRangeTaskFunc); struct BackupLogsDispatchTask : BackupTaskFuncBase { @@ -2293,8 +2986,8 @@ struct BackupLogsDispatchTask : BackupTaskFuncBase { static constexpr uint32_t version = 1; static struct { - static TaskParam prevBeginVersion() { return LiteralStringRef(__FUNCTION__); } - static TaskParam beginVersion() { return LiteralStringRef(__FUNCTION__); } + static TaskParam prevBeginVersion() { return __FUNCTION__sr; } + static TaskParam beginVersion() { return __FUNCTION__sr; } } Params; ACTOR static Future _finish(Reference tr, @@ -2305,9 +2998,6 @@ struct BackupLogsDispatchTask : BackupTaskFuncBase { tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr->setOption(FDBTransactionOptions::LOCK_AWARE); - if (CLIENT_KNOBS->BACKUP_AGENT_VERBOSE_LOGGING) { - tr->debugTransaction(deterministicRandom()->randomUniqueID()); - } state Reference onDone = task->getDoneFuture(futureBucket); state Version prevBeginVersion = Params.prevBeginVersion().get(task); @@ -2366,8 +3056,8 @@ struct BackupLogsDispatchTask : BackupTaskFuncBase { state int priority = latestSnapshotEndVersion.present() ? 1 : 0; if (!partitionedLog.present() || !partitionedLog.get()) { - // Add the initial log range task to read/copy the mutations and the next logs dispatch task which will run - // after this batch is done + // Add the initial log range task to read/copy the mutations and the next logs dispatch task which will + // run after this batch is done wait(success(BackupLogRangeTaskFunc::addTask(tr, taskBucket, task, @@ -2458,7 +3148,7 @@ struct BackupLogsDispatchTask : BackupTaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef BackupLogsDispatchTask::name = LiteralStringRef("file_backup_dispatch_logs_5.2"); +StringRef BackupLogsDispatchTask::name = "file_backup_dispatch_logs_5.2"_sr; REGISTER_TASKFUNC(BackupLogsDispatchTask); struct FileBackupFinishedTask : BackupTaskFuncBase { @@ -2518,14 +3208,14 @@ struct FileBackupFinishedTask : BackupTaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef FileBackupFinishedTask::name = LiteralStringRef("file_backup_finished_5.2"); +StringRef FileBackupFinishedTask::name = "file_backup_finished_5.2"_sr; REGISTER_TASKFUNC(FileBackupFinishedTask); struct BackupSnapshotManifest : BackupTaskFuncBase { static StringRef name; static constexpr uint32_t version = 1; static struct { - static TaskParam endVersion() { return LiteralStringRef(__FUNCTION__); } + static TaskParam endVersion() { return __FUNCTION__sr; } } Params; ACTOR static Future _execute(Database cx, @@ -2534,11 +3224,12 @@ struct BackupSnapshotManifest : BackupTaskFuncBase { Reference task) { state BackupConfig config(task); state Reference bc; + state DatabaseConfiguration dbConfig; state Reference tr(new ReadYourWritesTransaction(cx)); - // Read the entire range file map into memory, then walk it backwards from its last entry to produce a list of - // non overlapping key range files + // Read the entire range file map into memory, then walk it backwards from its last entry to produce a list + // of non overlapping key range files state std::map localmap; state Key startKey; state int batchSize = BUGGIFY ? 1 : 1000000; @@ -2549,6 +3240,7 @@ struct BackupSnapshotManifest : BackupTaskFuncBase { tr->setOption(FDBTransactionOptions::LOCK_AWARE); wait(taskBucket->keepRunning(tr, task)); + wait(store(dbConfig, getDatabaseConfiguration(cx))); if (!bc) { // Backup container must be present if we're still here @@ -2556,25 +3248,25 @@ struct BackupSnapshotManifest : BackupTaskFuncBase { bc = getBackupContainerWithProxy(_bc); } - BackupConfig::RangeFileMapT::PairsType rangeresults = + BackupConfig::RangeFileMapT::RangeResultType rangeresults = wait(config.snapshotRangeFileMap().getRange(tr, startKey, {}, batchSize)); - for (auto& p : rangeresults) { + for (auto& p : rangeresults.results) { localmap.insert(p); } - if (rangeresults.size() < batchSize) + if (!rangeresults.more) break; - startKey = keyAfter(rangeresults.back().first); + startKey = keyAfter(rangeresults.results.back().first); tr->reset(); } catch (Error& e) { wait(tr->onError(e)); } } - std::vector files; - std::vector> beginEndKeys; + state std::vector files; + state std::vector> beginEndKeys; state Version maxVer = 0; state Version minVer = std::numeric_limits::max(); state int64_t totalBytes = 0; @@ -2603,10 +3295,11 @@ struct BackupSnapshotManifest : BackupTaskFuncBase { totalBytes += r.fileSize; // Jump to file that either ends where this file begins or has the greatest end that is less than - // the begin of this file. In other words find the map key that is <= begin of this file. To do this - // find the first end strictly greater than begin and then back up one. + // the begin of this file. In other words find the map key that is <= begin of this file. To do + // this find the first end strictly greater than begin and then back up one. i = localmap.upper_bound(i->second.begin); - // If we get begin then we're done, there are no more ranges that end at or before the last file's begin + // If we get begin then we're done, there are no more ranges that end at or before the last file's + // begin if (i == localmap.begin()) break; --i; @@ -2614,7 +3307,14 @@ struct BackupSnapshotManifest : BackupTaskFuncBase { } Params.endVersion().set(task, maxVer); - wait(bc->writeKeyspaceSnapshotFile(files, beginEndKeys, totalBytes)); + + // Avoid keyRange filtering optimization for 'manifest' files + wait(bc->writeKeyspaceSnapshotFile(files, + beginEndKeys, + totalBytes, + dbConfig.encryptionAtRestMode.isEncryptionEnabled() + ? IncludeKeyRangeMap::False + : IncludeKeyRangeMap::True)); TraceEvent(SevInfo, "FileBackupWroteSnapshotManifest") .detail("BackupUID", config.getUid()) @@ -2708,7 +3408,7 @@ struct BackupSnapshotManifest : BackupTaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef BackupSnapshotManifest::name = LiteralStringRef("file_backup_write_snapshot_manifest_5.2"); +StringRef BackupSnapshotManifest::name = "file_backup_write_snapshot_manifest_5.2"_sr; REGISTER_TASKFUNC(BackupSnapshotManifest); Future BackupSnapshotDispatchTask::addSnapshotManifestTask(Reference tr, @@ -2724,7 +3424,7 @@ struct StartFullBackupTaskFunc : BackupTaskFuncBase { static constexpr uint32_t version = 1; static struct { - static TaskParam beginVersion() { return LiteralStringRef(__FUNCTION__); } + static TaskParam beginVersion() { return __FUNCTION__sr; } } Params; ACTOR static Future _execute(Database cx, @@ -2854,8 +3554,8 @@ struct StartFullBackupTaskFunc : BackupTaskFuncBase { wait(success(BackupLogsDispatchTask::addTask( tr, taskBucket, task, 1, 0, beginVersion, TaskCompletionKey::joinWith(backupFinished)))); - // If a clean stop is requested, the log and snapshot tasks will quit after the backup is restorable, then the - // following task will clean up and set the completed state. + // If a clean stop is requested, the log and snapshot tasks will quit after the backup is restorable, then + // the following task will clean up and set the completed state. wait(success( FileBackupFinishedTask::addTask(tr, taskBucket, task, TaskCompletionKey::noSignal(), backupFinished))); @@ -2894,7 +3594,7 @@ struct StartFullBackupTaskFunc : BackupTaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef StartFullBackupTaskFunc::name = LiteralStringRef("file_backup_start_5.2"); +StringRef StartFullBackupTaskFunc::name = "file_backup_start_5.2"_sr; REGISTER_TASKFUNC(StartFullBackupTaskFunc); struct RestoreCompleteTaskFunc : RestoreTaskFuncBase { @@ -2906,21 +3606,26 @@ struct RestoreCompleteTaskFunc : RestoreTaskFuncBase { state RestoreConfig restore(task); restore.stateEnum().set(tr, ERestoreState::COMPLETED); + state bool unlockDB = wait(restore.unlockDBAfterRestore().getD(tr, Snapshot::False, true)); + tr->atomicOp(metadataVersionKey, metadataVersionRequiredValue, MutationRef::SetVersionstampedValue); // Clear the file map now since it could be huge. restore.fileSet().clear(tr); - // TODO: Validate that the range version map has exactly the restored ranges in it. This means that for any - // restore operation the ranges to restore must be within the backed up ranges, otherwise from the restore - // perspective it will appear that some key ranges were missing and so the backup set is incomplete and the - // restore has failed. This validation cannot be done currently because Restore only supports a single restore - // range but backups can have many ranges. + // TODO: Validate that the range version map has exactly the restored ranges in it. This means that for + // any restore operation the ranges to restore must be within the backed up ranges, otherwise from the + // restore perspective it will appear that some key ranges were missing and so the backup set is incomplete + // and the restore has failed. This validation cannot be done currently because Restore only supports a + // single restore range but backups can have many ranges. - // Clear the applyMutations stuff, including any unapplied mutations from versions beyond the restored version. + // Clear the applyMutations stuff, including any unapplied mutations from versions beyond the restored + // version. restore.clearApplyMutationsKeys(tr); wait(taskBucket->finish(tr, task)); - wait(unlockDatabase(tr, restore.getUid())); + if (unlockDB) { + wait(unlockDatabase(tr, restore.getUid())); + } return Void(); } @@ -2941,7 +3646,7 @@ struct RestoreCompleteTaskFunc : RestoreTaskFuncBase { } wait(waitFor->onSetAddTask(tr, taskBucket, task)); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } static StringRef name; @@ -2961,14 +3666,14 @@ struct RestoreCompleteTaskFunc : RestoreTaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef RestoreCompleteTaskFunc::name = LiteralStringRef("restore_complete"); +StringRef RestoreCompleteTaskFunc::name = "restore_complete"_sr; REGISTER_TASKFUNC(RestoreCompleteTaskFunc); struct RestoreFileTaskFuncBase : RestoreTaskFuncBase { struct InputParams { - static TaskParam inputFile() { return LiteralStringRef(__FUNCTION__); } - static TaskParam readOffset() { return LiteralStringRef(__FUNCTION__); } - static TaskParam readLen() { return LiteralStringRef(__FUNCTION__); } + static TaskParam inputFile() { return __FUNCTION__sr; } + static TaskParam readOffset() { return __FUNCTION__sr; } + static TaskParam readLen() { return __FUNCTION__sr; } } Params; std::string toString(Reference task) const override { @@ -2983,8 +3688,8 @@ struct RestoreRangeTaskFunc : RestoreFileTaskFuncBase { static struct : InputParams { // The range of data that the (possibly empty) data represented, which is set if it intersects the target // restore range - static TaskParam originalFileRange() { return LiteralStringRef(__FUNCTION__); } - static TaskParam> originalFileRanges() { return LiteralStringRef(__FUNCTION__); } + static TaskParam originalFileRange() { return __FUNCTION__sr; } + static TaskParam> originalFileRanges() { return __FUNCTION__sr; } static std::vector getOriginalFileRanges(Reference task) { if (originalFileRanges().exists(task)) { @@ -3005,6 +3710,16 @@ struct RestoreRangeTaskFunc : RestoreFileTaskFuncBase { return returnStr; } + ACTOR static Future _validTenantAccess(KeyRef key, Reference> tenantCache) { + if (isSystemKey(key)) { + return Void(); + } + state int64_t tenantId = TenantAPI::extractTenantIdFromKeyRef(key); + Optional> payload = wait(tenantCache->getById(tenantId)); + ASSERT(payload.present()); + return Void(); + } + ACTOR static Future _execute(Database cx, Reference taskBucket, Reference futureBucket, @@ -3054,7 +3769,26 @@ struct RestoreRangeTaskFunc : RestoreFileTaskFuncBase { } state Reference inFile = wait(bc.get()->readFile(rangeFile.fileName)); - state Standalone> blockData = wait(decodeRangeFileBlock(inFile, readOffset, readLen)); + state Standalone> blockData; + try { + Standalone> data = wait(decodeRangeFileBlock(inFile, readOffset, readLen, cx)); + blockData = data; + } catch (Error& e) { + // It's possible a tenant was deleted and the encrypt key fetch failed + if (e.code() == error_code_encrypt_keys_fetch_failed || e.code() == error_code_tenant_not_found || + e.code() == error_code_encrypt_key_not_found) { + return Void(); + } + throw; + } + state Optional>> tenantCache; + state std::vector> validTenantCheckFutures; + state Arena arena; + state DatabaseConfiguration config = wait(getDatabaseConfiguration(cx)); + if (config.tenantMode == TenantMode::REQUIRED && g_network && g_network->isSimulated()) { + tenantCache = makeReference>(cx, TenantEntryCacheRefreshMode::WATCH); + wait(tenantCache.get()->init()); + } // First and last key are the range for this file state KeyRange fileRange; @@ -3082,16 +3816,16 @@ struct RestoreRangeTaskFunc : RestoreFileTaskFuncBase { state VectorRef data = blockData.slice(rangeStart, rangeEnd); // Shrink file range to be entirely within restoreRange and translate it to the new prefix - // First, use the untranslated file range to create the shrunk original file range which must be used in the - // kv range version map for applying mutations + // First, use the untranslated file range to create the shrunk original file range which must be used in + // the kv range version map for applying mutations state KeyRange originalFileRange = KeyRangeRef(std::max(fileRange.begin, restoreRange.begin), std::min(fileRange.end, restoreRange.end)); originalFileRanges.push_back(originalFileRange); // Now shrink and translate fileRange Key fileEnd = std::min(fileRange.end, restoreRange.end); - if (fileEnd == (removePrefix.get() == StringRef() ? normalKeys.end : strinc(removePrefix.get()))) { - fileEnd = addPrefix.get() == StringRef() ? normalKeys.end : strinc(addPrefix.get()); + if (fileEnd == (removePrefix.get() == StringRef() ? allKeys.end : strinc(removePrefix.get()))) { + fileEnd = addPrefix.get() == StringRef() ? allKeys.end : strinc(addPrefix.get()); } else { fileEnd = fileEnd.removePrefix(removePrefix.get()).withPrefix(addPrefix.get()); } @@ -3129,11 +3863,16 @@ struct RestoreRangeTaskFunc : RestoreFileTaskFuncBase { : data[start].key.removePrefix(removePrefix.get()).withPrefix(addPrefix.get()), (iend == end) ? fileRange.end : data[iend].key.removePrefix(removePrefix.get()).withPrefix(addPrefix.get())); - tr->clear(trRange); for (; i < iend; ++i) { tr->setOption(FDBTransactionOptions::NEXT_WRITE_NO_WRITE_CONFLICT_RANGE); + if (tenantCache.present()) { + validTenantCheckFutures.push_back(_validTenantAccess( + StringRef(arena, + data[i].key.removePrefix(removePrefix.get()).withPrefix(addPrefix.get())), + tenantCache.get())); + } tr->set(data[i].key.removePrefix(removePrefix.get()).withPrefix(addPrefix.get()), data[i].value); } @@ -3149,6 +3888,11 @@ struct RestoreRangeTaskFunc : RestoreFileTaskFuncBase { wait(tr->commit()); + if (!validTenantCheckFutures.empty()) { + waitForAll(validTenantCheckFutures); + validTenantCheckFutures.clear(); + } + TraceEvent("FileRestoreCommittedRange") .suppressFor(60) .detail("RestoreUID", restore.getUid()) @@ -3235,7 +3979,7 @@ struct RestoreRangeTaskFunc : RestoreFileTaskFuncBase { } wait(waitFor->onSetAddTask(tr, taskBucket, task)); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } static StringRef name; @@ -3255,7 +3999,7 @@ struct RestoreRangeTaskFunc : RestoreFileTaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef RestoreRangeTaskFunc::name = LiteralStringRef("restore_range_data"); +StringRef RestoreRangeTaskFunc::name = "restore_range_data"_sr; REGISTER_TASKFUNC(RestoreRangeTaskFunc); // Decodes a mutation log key, which contains (hash, commitVersion, chunkNumber) and @@ -3349,6 +4093,14 @@ bool AccumulatedMutations::isComplete() const { bool AccumulatedMutations::matchesAnyRange(const RangeMapFilters& filters) const { std::vector mutations = decodeMutationLogValue(serializedMutations); for (auto& m : mutations) { + if (m.type == MutationRef::Encrypted) { + // TODO: In order to filter out encrypted mutations that are not relevant to the + // target range, they would have to be decrypted here in order to check relevance + // below, however the staged mutations would still need to remain encrypted for + // staging into the destination database. Without decrypting, we must assume that + // some data could match the range and return true here. + return true; + } if (filters.match(m)) { return true; } @@ -3466,8 +4218,8 @@ struct RestoreLogDataTaskFunc : RestoreFileTaskFuncBase { state Standalone> dataOriginal = wait(decodeMutationLogFileBlock(inFile, readOffset, readLen)); - // Filter the KV pairs extracted from the log file block to remove any records known to not be needed for this - // restore based on the restore range set. + // Filter the KV pairs extracted from the log file block to remove any records known to not be needed for + // this restore based on the restore range set. RangeMapFilters filters(ranges); state std::vector dataFiltered = filterLogMutationKVPairs(dataOriginal, filters); @@ -3542,8 +4294,8 @@ struct RestoreLogDataTaskFunc : RestoreFileTaskFuncBase { state Reference taskFuture = futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone]); - // TODO: Check to see if there is a leak in the FutureBucket since an invalid task (validation key fails) will - // never set its taskFuture. + // TODO: Check to see if there is a leak in the FutureBucket since an invalid task (validation key fails) + // will never set its taskFuture. wait(taskFuture->set(tr, taskBucket) && taskBucket->finish(tr, task)); return Void(); @@ -3571,7 +4323,7 @@ struct RestoreLogDataTaskFunc : RestoreFileTaskFuncBase { } wait(waitFor->onSetAddTask(tr, taskBucket, task)); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } Future execute(Database cx, @@ -3587,7 +4339,7 @@ struct RestoreLogDataTaskFunc : RestoreFileTaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef RestoreLogDataTaskFunc::name = LiteralStringRef("restore_log_data"); +StringRef RestoreLogDataTaskFunc::name = "restore_log_data"_sr; REGISTER_TASKFUNC(RestoreLogDataTaskFunc); struct RestoreDispatchTaskFunc : RestoreTaskFuncBase { @@ -3596,11 +4348,11 @@ struct RestoreDispatchTaskFunc : RestoreTaskFuncBase { StringRef getName() const override { return name; }; static struct { - static TaskParam beginVersion() { return LiteralStringRef(__FUNCTION__); } - static TaskParam beginFile() { return LiteralStringRef(__FUNCTION__); } - static TaskParam beginBlock() { return LiteralStringRef(__FUNCTION__); } - static TaskParam batchSize() { return LiteralStringRef(__FUNCTION__); } - static TaskParam remainingInBatch() { return LiteralStringRef(__FUNCTION__); } + static TaskParam beginVersion() { return __FUNCTION__sr; } + static TaskParam beginFile() { return __FUNCTION__sr; } + static TaskParam beginBlock() { return __FUNCTION__sr; } + static TaskParam batchSize() { return __FUNCTION__sr; } + static TaskParam remainingInBatch() { return __FUNCTION__sr; } } Params; ACTOR static Future _finish(Reference tr, @@ -3651,11 +4403,11 @@ struct RestoreDispatchTaskFunc : RestoreTaskFuncBase { } state std::string beginFile = Params.beginFile().getOrDefault(task); - // Get a batch of files. We're targeting batchSize blocks being dispatched so query for batchSize files (each - // of which is 0 or more blocks). + // Get a batch of files. We're targeting batchSize blocks being dispatched so query for batchSize files + // (each of which is 0 or more blocks). state int taskBatchSize = BUGGIFY ? 1 : CLIENT_KNOBS->RESTORE_DISPATCH_ADDTASK_SIZE; - state RestoreConfig::FileSetT::Values files = - wait(restore.fileSet().getRange(tr, { beginVersion, beginFile }, {}, taskBatchSize)); + state RestoreConfig::FileSetT::RangeResultType files = wait(restore.fileSet().getRange( + tr, Optional({ beginVersion, beginFile }), {}, taskBatchSize)); // allPartsDone will be set once all block tasks in the current batch are finished. state Reference allPartsDone; @@ -3673,9 +4425,9 @@ struct RestoreDispatchTaskFunc : RestoreTaskFuncBase { } // If there were no files to load then this batch is done and restore is almost done. - if (files.size() == 0) { - // If adding to existing batch then blocks could be in progress so create a new Dispatch task that waits for - // them to finish + if (files.results.size() == 0) { + // If adding to existing batch then blocks could be in progress so create a new Dispatch task that waits + // for them to finish if (addingToExistingBatch) { // Setting next begin to restoreVersion + 1 so that any files in the file map at the restore version // won't be dispatched again. @@ -3725,8 +4477,8 @@ struct RestoreDispatchTaskFunc : RestoreTaskFuncBase { .detail("Decision", "restore_complete") .detail("TaskInstance", THIS_ADDR); } else { - // Applying of mutations is not yet finished so wait a small amount of time and then re-add this same - // task. + // Applying of mutations is not yet finished so wait a small amount of time and then re-add this + // same task. wait(delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY)); wait(success(RestoreDispatchTaskFunc::addTask(tr, taskBucket, task, beginVersion, "", 0, batchSize))); @@ -3751,17 +4503,17 @@ struct RestoreDispatchTaskFunc : RestoreTaskFuncBase { // blocks per Dispatch task and target batchSize total per batch but a batch must end on a complete version // boundary so exceed the limit if necessary to reach the end of a version of files. state std::vector> addTaskFutures; - state Version endVersion = files[0].version; + state Version endVersion = files.results[0].version; state int blocksDispatched = 0; state int64_t beginBlock = Params.beginBlock().getOrDefault(task); state int i = 0; - for (; i < files.size(); ++i) { - RestoreConfig::RestoreFile& f = files[i]; + for (; i < files.results.size(); ++i) { + RestoreConfig::RestoreFile& f = files.results[i]; - // Here we are "between versions" (prior to adding the first block of the first file of a new version) so - // this is an opportunity to end the current dispatch batch (which must end on a version boundary) if the - // batch size has been reached or exceeded + // Here we are "between versions" (prior to adding the first block of the first file of a new version) + // so this is an opportunity to end the current dispatch batch (which must end on a version boundary) if + // the batch size has been reached or exceeded if (f.version != endVersion && remainingInBatch <= 0) { // Next start will be at the first version after endVersion at the first file first block ++endVersion; @@ -3823,13 +4575,13 @@ struct RestoreDispatchTaskFunc : RestoreTaskFuncBase { .detail("TaskInstance", THIS_ADDR); } - // If no blocks were dispatched then the next dispatch task should run now and be joined with the allPartsDone - // future + // If no blocks were dispatched then the next dispatch task should run now and be joined with the + // allPartsDone future if (blocksDispatched == 0) { std::string decision; - // If no files were dispatched either then the batch size wasn't large enough to catch all of the files at - // the next lowest non-dispatched version, so increase the batch size. + // If no files were dispatched either then the batch size wasn't large enough to catch all of the files + // at the next lowest non-dispatched version, so increase the batch size. if (i == 0) { batchSize *= 2; decision = "increased_batch_size"; @@ -3872,13 +4624,13 @@ struct RestoreDispatchTaskFunc : RestoreTaskFuncBase { restore.filesBlocksDispatched().atomicOp(tr, blocksDispatched, MutationRef::Type::AddValue); // If beginFile is not empty then we had to stop in the middle of a version (possibly within a file) so we - // cannot end the batch here because we do not know if we got all of the files and blocks from the last version - // queued, so make sure remainingInBatch is at least 1. + // cannot end the batch here because we do not know if we got all of the files and blocks from the last + // version queued, so make sure remainingInBatch is at least 1. if (!beginFile.empty()) remainingInBatch = std::max(1, remainingInBatch); - // If more blocks need to be dispatched in this batch then add a follow-on task that is part of the allPartsDone - // group which will won't wait to run and will add more block tasks. + // If more blocks need to be dispatched in this batch then add a follow-on task that is part of the + // allPartsDone group which will won't wait to run and will add more block tasks. if (remainingInBatch > 0) addTaskFutures.push_back(RestoreDispatchTaskFunc::addTask(tr, taskBucket, @@ -3955,7 +4707,7 @@ struct RestoreDispatchTaskFunc : RestoreTaskFuncBase { } wait(waitFor->onSetAddTask(tr, taskBucket, task)); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } Future execute(Database cx, @@ -3971,7 +4723,7 @@ struct RestoreDispatchTaskFunc : RestoreTaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef RestoreDispatchTaskFunc::name = LiteralStringRef("restore_dispatch"); +StringRef RestoreDispatchTaskFunc::name = "restore_dispatch"_sr; REGISTER_TASKFUNC(RestoreDispatchTaskFunc); ACTOR Future restoreStatus(Reference tr, Key tagName) { @@ -4069,7 +4821,7 @@ struct StartFullRestoreTaskFunc : RestoreTaskFuncBase { static constexpr uint32_t version = 1; static struct { - static TaskParam firstVersion() { return LiteralStringRef(__FUNCTION__); } + static TaskParam firstVersion() { return __FUNCTION__sr; } } Params; // Find all files needed for the restore and save them in the RestoreConfig for the task. @@ -4135,7 +4887,7 @@ struct StartFullRestoreTaskFunc : RestoreTaskFuncBase { .detail("RestoreVersion", restoreVersion) .detail("Dest", destVersion); if (destVersion <= restoreVersion) { - TEST(true); // Forcing restored cluster to higher version + CODE_PROBE(true, "Forcing restored cluster to higher version"); tr->set(minRequiredCommitVersionKey, BinaryWriter::toValue(restoreVersion + 1, Unversioned())); wait(tr->commit()); } else { @@ -4167,8 +4919,8 @@ struct StartFullRestoreTaskFunc : RestoreTaskFuncBase { if (!inconsistentSnapshotOnly) { for (const RangeFile& f : restorable.get().ranges) { files.push_back({ f.version, f.fileName, true, f.blockSize, f.fileSize }); - // In a restore with both snapshots and logs, the firstConsistentVersion is the highest version of - // any range file. + // In a restore with both snapshots and logs, the firstConsistentVersion is the highest version + // of any range file. firstConsistentVersion = std::max(firstConsistentVersion, f.version); } } else { @@ -4281,14 +5033,6 @@ struct StartFullRestoreTaskFunc : RestoreTaskFuncBase { tr, taskBucket, task, 0, "", 0, CLIENT_KNOBS->RESTORE_DISPATCH_BATCH_SIZE))); wait(taskBucket->finish(tr, task)); - state Future> logsOnly = restore.onlyApplyMutationLogs().get(tr); - wait(success(logsOnly)); - if (logsOnly.get().present() && logsOnly.get().get()) { - // If this is an incremental restore, we need to set the applyMutationsMapPrefix - // to the earliest log version so no mutations are missed - Value versionEncoded = BinaryWriter::toValue(Params.firstVersion().get(task), Unversioned()); - wait(krmSetRange(tr, restore.applyMutationsMapPrefix(), normalKeys, versionEncoded)); - } return Void(); } @@ -4313,7 +5057,7 @@ struct StartFullRestoreTaskFunc : RestoreTaskFuncBase { } wait(waitFor->onSetAddTask(tr, taskBucket, task)); - return LiteralStringRef("OnSetAddTask"); + return "OnSetAddTask"_sr; } StringRef getName() const override { return name; }; @@ -4331,7 +5075,7 @@ struct StartFullRestoreTaskFunc : RestoreTaskFuncBase { return _finish(tr, tb, fb, task); }; }; -StringRef StartFullRestoreTaskFunc::name = LiteralStringRef("restore_start"); +StringRef StartFullRestoreTaskFunc::name = "restore_start"_sr; REGISTER_TASKFUNC(StartFullRestoreTaskFunc); } // namespace fileBackup @@ -4554,6 +5298,7 @@ class FileBackupAgentImpl { int snapshotIntervalSeconds, std::string tagName, Standalone> backupRanges, + bool encryptionEnabled, StopWhenDone stopWhenDone, UsePartitionedLog partitionedLog, IncrementalBackupOnly incrementalBackupOnly, @@ -4632,24 +5377,28 @@ class FileBackupAgentImpl { config.clear(tr); state Key destUidValue(BinaryWriter::toValue(uid, Unversioned())); - if (normalizedRanges.size() == 1) { + if (normalizedRanges.size() == 1 || isDefaultBackup(normalizedRanges)) { RangeResult existingDestUidValues = wait( tr->getRange(KeyRangeRef(destUidLookupPrefix, strinc(destUidLookupPrefix)), CLIENT_KNOBS->TOO_MANY)); bool found = false; + KeyRangeRef targetRange = + normalizedRanges.size() == 1 ? normalizedRanges[0] : getDefaultBackupSharedRange(); for (auto it : existingDestUidValues) { - if (BinaryReader::fromStringRef(it.key.removePrefix(destUidLookupPrefix), IncludeVersion()) == - normalizedRanges[0]) { + KeyRange uidRange = + BinaryReader::fromStringRef(it.key.removePrefix(destUidLookupPrefix), IncludeVersion()); + if (uidRange == targetRange) { destUidValue = it.value; found = true; + CODE_PROBE(targetRange == getDefaultBackupSharedRange(), + "Backup mutation sharing with default backup"); break; } } if (!found) { destUidValue = BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned()); - tr->set( - BinaryWriter::toValue(normalizedRanges[0], IncludeVersion(ProtocolVersion::withSharedMutations())) - .withPrefix(destUidLookupPrefix), - destUidValue); + tr->set(BinaryWriter::toValue(targetRange, IncludeVersion(ProtocolVersion::withSharedMutations())) + .withPrefix(destUidLookupPrefix), + destUidValue); } } @@ -4672,6 +5421,7 @@ class FileBackupAgentImpl { config.snapshotIntervalSeconds().set(tr, snapshotIntervalSeconds); config.partitionedLogEnabled().set(tr, partitionedLog); config.incrementalBackupOnly().set(tr, incrementalBackupOnly); + config.enableSnapshotBackupEncryption().set(tr, encryptionEnabled); Key taskKey = wait(fileBackup::StartFullBackupTaskFunc::addTask( tr, backupAgent->taskBucket, uid, TaskCompletionKey::noSignal())); @@ -4689,6 +5439,7 @@ class FileBackupAgentImpl { Key addPrefix, Key removePrefix, LockDB lockDB, + UnlockDB unlockDB, OnlyApplyMutationLogs onlyApplyMutationLogs, InconsistentSnapshotOnly inconsistentSnapshotOnly, Version beginVersion, @@ -4736,14 +5487,16 @@ class FileBackupAgentImpl { oldRestore.clear(tr); } - state int index; - for (index = 0; index < restoreRanges.size(); index++) { - KeyRange restoreIntoRange = KeyRangeRef(restoreRanges[index].begin, restoreRanges[index].end) - .removePrefix(removePrefix) - .withPrefix(addPrefix); - RangeResult existingRows = wait(tr->getRange(restoreIntoRange, 1)); - if (existingRows.size() > 0 && !onlyApplyMutationLogs) { - throw restore_destination_not_empty(); + if (!onlyApplyMutationLogs) { + state int index; + for (index = 0; index < restoreRanges.size(); index++) { + KeyRange restoreIntoRange = KeyRangeRef(restoreRanges[index].begin, restoreRanges[index].end) + .removePrefix(removePrefix) + .withPrefix(addPrefix); + RangeResult existingRows = wait(tr->getRange(restoreIntoRange, 1)); + if (existingRows.size() > 0) { + throw restore_destination_not_empty(); + } } } // Make new restore config @@ -4762,13 +5515,17 @@ class FileBackupAgentImpl { restore.onlyApplyMutationLogs().set(tr, onlyApplyMutationLogs); restore.inconsistentSnapshotOnly().set(tr, inconsistentSnapshotOnly); restore.beginVersion().set(tr, beginVersion); + restore.unlockDBAfterRestore().set(tr, unlockDB); if (BUGGIFY && restoreRanges.size() == 1) { restore.restoreRange().set(tr, restoreRanges[0]); } else { - restore.restoreRanges().set(tr, restoreRanges); + for (auto& range : restoreRanges) { + restore.restoreRangeSet().insert(tr, range); + } } + // this also sets restore.add/removePrefix. - restore.initApplyMutations(tr, addPrefix, removePrefix); + restore.initApplyMutations(tr, addPrefix, removePrefix, onlyApplyMutationLogs); Key taskKey = wait(fileBackup::StartFullRestoreTaskFunc::addTask( tr, backupAgent->taskBucket, uid, TaskCompletionKey::noSignal())); @@ -4924,7 +5681,7 @@ class FileBackupAgentImpl { tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); try { - tr->set(backupPausedKey, pause ? LiteralStringRef("1") : LiteralStringRef("0")); + tr->set(backupPausedKey, pause ? "1"_sr : "0"_sr); wait(tr->commit()); break; } catch (Error& e) { @@ -5095,11 +5852,11 @@ class FileBackupAgentImpl { doc.setKey("CurrentSnapshot", snapshot); } - KeyBackedMap>::PairsType errors = + KeyBackedMap>::RangeResultType errors = wait(config.lastErrorPerType().getRange( tr, 0, std::numeric_limits::max(), CLIENT_KNOBS->TOO_MANY)); JsonBuilderArray errorList; - for (auto& e : errors) { + for (auto& e : errors.results) { std::string msg = e.second.first; Version ver = e.second.second; @@ -5248,13 +6005,13 @@ class FileBackupAgentImpl { // Append the errors, if requested if (showErrors) { - KeyBackedMap>::PairsType errors = + KeyBackedMap>::RangeResultType errors = wait(config.lastErrorPerType().getRange( tr, 0, std::numeric_limits::max(), CLIENT_KNOBS->TOO_MANY)); std::string recentErrors; std::string pastErrors; - for (auto& e : errors) { + for (auto& e : errors.results) { Version v = e.second.second; std::string msg = format( "%s ago : %s\n", @@ -5340,7 +6097,7 @@ class FileBackupAgentImpl { // onlyApplyMutationLogs: only perform incremental restore, by only applying mutation logs // inconsistentSnapshotOnly: Ignore mutation log files during the restore to speedup the process. // When set to true, gives an inconsistent snapshot, thus not recommended - // beginVersion: restore's begin version + // beginVersions: restore's begin version for each range // randomUid: the UID for lock the database ACTOR static Future restore(FileBackupAgent* backupAgent, Database cx, @@ -5349,15 +6106,16 @@ class FileBackupAgentImpl { Key url, Optional proxy, Standalone> ranges, + Standalone> beginVersions, WaitForComplete waitForComplete, Version targetVersion, Verbose verbose, Key addPrefix, Key removePrefix, LockDB lockDB, + UnlockDB unlockDB, OnlyApplyMutationLogs onlyApplyMutationLogs, InconsistentSnapshotOnly inconsistentSnapshotOnly, - Version beginVersion, Optional encryptionKeyFileName, UID randomUid) { // The restore command line tool won't allow ranges to be empty, but correctness workloads somehow might. @@ -5380,6 +6138,10 @@ class FileBackupAgentImpl { targetVersion = desc.contiguousLogEnd.get() - 1; } + state Version beginVersion = invalidVersion; // min begin version for all ranges + if (!beginVersions.empty()) { + beginVersion = *std::min_element(beginVersions.begin(), beginVersions.end()); + } Optional restoreSet = wait(bc->getRestoreSet(targetVersion, ranges, onlyApplyMutationLogs, beginVersion)); @@ -5396,6 +6158,12 @@ class FileBackupAgentImpl { printf("Restoring backup to version: %lld\n", (long long)targetVersion); } + // Preload applyMutationsKeyVersionMap for only-apply-mutation-log restore. It's + // a workaround for case when the map is large and may exceed transaction limit. + if (onlyApplyMutationLogs) { + wait(preloadApplyMutationsKeyVersionMap(cx, randomUid, ranges, beginVersions)); + } + state Reference tr(new ReadYourWritesTransaction(cx)); loop { try { @@ -5411,6 +6179,7 @@ class FileBackupAgentImpl { addPrefix, removePrefix, lockDB, + unlockDB, onlyApplyMutationLogs, inconsistentSnapshotOnly, beginVersion, @@ -5434,6 +6203,82 @@ class FileBackupAgentImpl { return targetVersion; } + ACTOR static Future preloadApplyMutationsKeyVersionMap(Database cx, + UID uid, + Standalone> ranges, + Standalone> versions) { + state Reference tr(new ReadYourWritesTransaction(cx)); + + // Init applyMutationsKeyVersionMap, applyMutationsKeyVersionCount, applyMutationsEnd, applyMutationsBegin + loop { + try { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + + Key mapStart = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); + tr->clear(KeyRangeRef(mapStart, strinc(mapStart))); + int64_t startCount = 0; + tr->set(uidPrefixKey(applyMutationsKeyVersionCountRange.begin, uid), + StringRef((uint8_t*)&startCount, 8)); + tr->set(mapStart, BinaryWriter::toValue(invalidVersion, Unversioned())); + + tr->clear(uidPrefixKey(applyMutationsEndRange.begin, uid)); + tr->clear(uidPrefixKey(applyMutationsBeginRange.begin, uid)); + + // If this is an incremental restore, we need to set the applyMutationsMapPrefix + // to the earliest log version so no mutations are missed + Version beginVersion = *std::min_element(versions.begin(), versions.end()); + Value versionEncoded = BinaryWriter::toValue(beginVersion, Unversioned()); + Key prefix = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); + wait(krmSetRange(tr, prefix, allKeys, versionEncoded)); + + wait(tr->commit()); + break; + } catch (Error& e) { + wait(tr->onError(e)); + } + } + + // Update applyMutationsKeyVersionMap + state int i; + state int stepSize = 1000; + for (i = 0; i < ranges.size(); i += stepSize) { + int end = std::min(i + stepSize, ranges.size()); + wait(preloadApplyMutationsKeyVersionMap(cx, uid, ranges, versions, i, end)); + } + TraceEvent("PreloadApplyMutationsKeyVersionMap", uid).detail("Size", ranges.size()); + return Void(); + } + + ACTOR static Future preloadApplyMutationsKeyVersionMap(Database cx, + UID uid, + Standalone> ranges, + Standalone> versions, + int start, + int end) { + state Reference tr(new ReadYourWritesTransaction(cx)); + loop { + try { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + state int i; + for (i = start; i < end; ++i) { + Version version = versions[i]; + if (version == invalidVersion) { + version = 0; + } + Value versionEncoded = BinaryWriter::toValue(version, Unversioned()); + Key prefix = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); + wait(krmSetRangeCoalescing(tr, prefix, ranges[i], allKeys, versionEncoded)); + } + wait(tr->commit()); + return Void(); + } catch (Error& e) { + wait(tr->onError(e)); + } + } + } + // used for correctness only, locks the database before discontinuing the backup and that same lock is then used // while doing the restore. the tagname of the backup must be the same as the restore. ACTOR static Future atomicRestore(FileBackupAgent* backupAgent, @@ -5446,6 +6291,7 @@ class FileBackupAgentImpl { state Reference ryw_tr = Reference(new ReadYourWritesTransaction(cx)); state BackupConfig backupConfig; + state DatabaseConfiguration config = wait(getDatabaseConfiguration(cx)); loop { try { ryw_tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); @@ -5473,7 +6319,7 @@ class FileBackupAgentImpl { try { // We must get a commit version so add a conflict range that won't likely cause conflicts // but will ensure that the transaction is actually submitted. - tr.addWriteConflictRange(backupConfig.snapshotRangeDispatchMap().space.range()); + tr.addWriteConflictRange(backupConfig.snapshotRangeDispatchMap().subspace); wait(lockDatabase(&tr, randomUid)); wait(tr.commit()); commitVersion = tr.getCommittedVersion(); @@ -5536,8 +6382,8 @@ class FileBackupAgentImpl { } } - Reference _bc = wait(backupConfig.backupContainer().getOrThrow(cx)); - Reference bc = fileBackup::getBackupContainerWithProxy(_bc); + state Reference bc = wait(backupConfig.backupContainer().getOrThrow(cx.getReference())); + bc = fileBackup::getBackupContainerWithProxy(bc); if (fastRestore) { TraceEvent("AtomicParallelRestoreStartRestore").log(); @@ -5563,24 +6409,79 @@ class FileBackupAgentImpl { return -1; } else { TraceEvent("AS_StartRestore").log(); - Version ver = wait(restore(backupAgent, - cx, - cx, - tagName, - KeyRef(bc->getURL()), - bc->getProxy(), - ranges, - WaitForComplete::True, - ::invalidVersion, - Verbose::True, - addPrefix, - removePrefix, - LockDB::True, - OnlyApplyMutationLogs::False, - InconsistentSnapshotOnly::False, - ::invalidVersion, - {}, - randomUid)); + state Standalone> restoreRange; + state Standalone> systemRestoreRange; + for (auto r : ranges) { + if (config.tenantMode != TenantMode::REQUIRED || !r.intersects(getSystemBackupRanges())) { + restoreRange.push_back_deep(restoreRange.arena(), r); + } else { + KeyRangeRef normalKeyRange = r & normalKeys; + KeyRangeRef systemKeyRange = r & systemKeys; + if (!normalKeyRange.empty()) { + restoreRange.push_back_deep(restoreRange.arena(), normalKeyRange); + } + if (!systemKeyRange.empty()) { + systemRestoreRange.push_back_deep(systemRestoreRange.arena(), systemKeyRange); + } + } + } + if (!systemRestoreRange.empty()) { + // restore system keys + wait(success(restore(backupAgent, + cx, + cx, + "system_restore"_sr, + KeyRef(bc->getURL()), + bc->getProxy(), + systemRestoreRange, + {}, + WaitForComplete::True, + ::invalidVersion, + Verbose::True, + addPrefix, + removePrefix, + LockDB::True, + UnlockDB::False, + OnlyApplyMutationLogs::False, + InconsistentSnapshotOnly::False, + {}, + randomUid))); + state Reference rywTransaction = + Reference(new ReadYourWritesTransaction(cx)); + // clear old restore config associated with system keys + loop { + try { + rywTransaction->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + rywTransaction->setOption(FDBTransactionOptions::LOCK_AWARE); + state RestoreConfig oldRestore(randomUid); + oldRestore.clear(rywTransaction); + wait(rywTransaction->commit()); + break; + } catch (Error& e) { + wait(rywTransaction->onError(e)); + } + } + } + // restore user data + state Version ver = wait(restore(backupAgent, + cx, + cx, + tagName, + KeyRef(bc->getURL()), + bc->getProxy(), + restoreRange, + {}, + WaitForComplete::True, + ::invalidVersion, + Verbose::True, + addPrefix, + removePrefix, + LockDB::True, + UnlockDB::True, + OnlyApplyMutationLogs::False, + InconsistentSnapshotOnly::False, + {}, + randomUid)); return ver; } } @@ -5634,15 +6535,16 @@ Future FileBackupAgent::restore(Database cx, Key url, Optional proxy, Standalone> ranges, + Standalone> versions, WaitForComplete waitForComplete, Version targetVersion, Verbose verbose, Key addPrefix, Key removePrefix, LockDB lockDB, + UnlockDB unlockDB, OnlyApplyMutationLogs onlyApplyMutationLogs, InconsistentSnapshotOnly inconsistentSnapshotOnly, - Version beginVersion, Optional const& encryptionKeyFileName) { return FileBackupAgentImpl::restore(this, cx, @@ -5651,19 +6553,118 @@ Future FileBackupAgent::restore(Database cx, url, proxy, ranges, + versions, waitForComplete, targetVersion, verbose, addPrefix, removePrefix, lockDB, + unlockDB, onlyApplyMutationLogs, inconsistentSnapshotOnly, - beginVersion, encryptionKeyFileName, deterministicRandom()->randomUniqueID()); } +Future FileBackupAgent::restore(Database cx, + Optional cxOrig, + Key tagName, + Key url, + Optional proxy, + Standalone> ranges, + WaitForComplete waitForComplete, + Version targetVersion, + Verbose verbose, + Key addPrefix, + Key removePrefix, + LockDB lockDB, + UnlockDB unlockDB, + OnlyApplyMutationLogs onlyApplyMutationLogs, + InconsistentSnapshotOnly inconsistentSnapshotOnly, + Version beginVersion, + Optional const& encryptionKeyFileName) { + Standalone> beginVersions; + for (auto i = 0; i < ranges.size(); ++i) { + beginVersions.push_back(beginVersions.arena(), beginVersion); + } + return restore(cx, + cxOrig, + tagName, + url, + proxy, + ranges, + beginVersions, + waitForComplete, + targetVersion, + verbose, + addPrefix, + removePrefix, + lockDB, + unlockDB, + onlyApplyMutationLogs, + inconsistentSnapshotOnly, + encryptionKeyFileName); +} + +Future FileBackupAgent::restore(Database cx, + Optional cxOrig, + Key tagName, + Key url, + Optional proxy, + WaitForComplete waitForComplete, + Version targetVersion, + Verbose verbose, + KeyRange range, + Key addPrefix, + Key removePrefix, + LockDB lockDB, + OnlyApplyMutationLogs onlyApplyMutationLogs, + InconsistentSnapshotOnly inconsistentSnapshotOnly, + Version beginVersion, + Optional const& encryptionKeyFileName) { + Standalone> rangeRef; + if (range.begin.empty() && range.end.empty()) { + addDefaultBackupRanges(rangeRef); + } else { + rangeRef.push_back_deep(rangeRef.arena(), range); + } + Standalone> versionRef; + versionRef.push_back(versionRef.arena(), beginVersion); + + return restore(cx, + cxOrig, + tagName, + url, + proxy, + rangeRef, + versionRef, + waitForComplete, + targetVersion, + verbose, + addPrefix, + removePrefix, + lockDB, + UnlockDB::True, + onlyApplyMutationLogs, + inconsistentSnapshotOnly, + encryptionKeyFileName); +} + +Future FileBackupAgent::atomicRestore(Database cx, + Key tagName, + KeyRange range, + Key addPrefix, + Key removePrefix) { + Standalone> rangeRef; + if (range.begin.empty() && range.end.empty()) { + addDefaultBackupRanges(rangeRef); + } else { + rangeRef.push_back_deep(rangeRef.arena(), range); + } + return atomicRestore(cx, tagName, rangeRef, addPrefix, removePrefix); +} + Future FileBackupAgent::atomicRestore(Database cx, Key tagName, Standalone> ranges, @@ -5696,6 +6697,7 @@ Future FileBackupAgent::submitBackup(Reference int snapshotIntervalSeconds, std::string const& tagName, Standalone> backupRanges, + bool encryptionEnabled, StopWhenDone stopWhenDone, UsePartitionedLog partitionedLog, IncrementalBackupOnly incrementalBackupOnly, @@ -5708,6 +6710,7 @@ Future FileBackupAgent::submitBackup(Reference snapshotIntervalSeconds, tagName, backupRanges, + encryptionEnabled, stopWhenDone, partitionedLog, incrementalBackupOnly, @@ -5808,7 +6811,7 @@ ACTOR static Future writeKVs(Database cx, Standalone #include #include -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/genericactors.actor.h" #include "flow/Hash3.h" +#include "flow/xxhash.h" + +#include #include #include #include #include +#include +#include +#include #include "flow/actorcompiler.h" // This must be the last #include. -FDB_DEFINE_BOOLEAN_PARAM(IncrementalBackupOnly); -FDB_DEFINE_BOOLEAN_PARAM(OnlyApplyMutationLogs); - Optional fileBackupAgentProxy = Optional(); #define SevFRTestInfo SevVerbose @@ -94,7 +115,7 @@ std::string secondsToTimeFormat(int64_t seconds) { return format("%lld second(s)", seconds); } -const Key FileBackupAgent::keyLastRestorable = LiteralStringRef("last_restorable"); +const Key FileBackupAgent::keyLastRestorable = "last_restorable"_sr; // For convenience typedef FileBackupAgent::ERestoreState ERestoreState; @@ -102,19 +123,19 @@ typedef FileBackupAgent::ERestoreState ERestoreState; StringRef FileBackupAgent::restoreStateText(ERestoreState id) { switch (id) { case ERestoreState::UNITIALIZED: - return LiteralStringRef("unitialized"); + return "unitialized"_sr; case ERestoreState::QUEUED: - return LiteralStringRef("queued"); + return "queued"_sr; case ERestoreState::STARTING: - return LiteralStringRef("starting"); + return "starting"_sr; case ERestoreState::RUNNING: - return LiteralStringRef("running"); + return "running"_sr; case ERestoreState::COMPLETED: - return LiteralStringRef("completed"); + return "completed"_sr; case ERestoreState::ABORTED: - return LiteralStringRef("aborted"); + return "aborted"_sr; default: - return LiteralStringRef("Unknown"); + return "Unknown"_sr; } } @@ -123,26 +144,26 @@ Key FileBackupAgent::getPauseKey() { return backupAgent.taskBucket->getPauseKey(); } - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via getAll_impl() - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class TagUidMap_GetAll_implActorState { - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TagUidMap_GetAll_implActorState(TagUidMap* const& tagsMap,Reference const& tr,Snapshot const& snapshot) - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tagsMap(tagsMap), - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr(tr), - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshot(snapshot), - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" prefix(tagsMap->prefix) - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("getAll_impl", reinterpret_cast(this)); @@ -155,16 +176,16 @@ class TagUidMap_GetAll_implActorState { int a_body1(int loopDepth=0) { try { - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = tagsMap->getRange(tr, std::string(), {}, 1e6, snapshot); - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = tagsMap->getRange(tr, std::string(), {}, 1e6, snapshot); + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -183,19 +204,19 @@ class TagUidMap_GetAll_implActorState { return loopDepth; } - int a_body1cont1(TagMap::PairsType const& tagPairs,int loopDepth) + int a_body1cont1(TagMap::RangeResultType const& tagPairs,int loopDepth) { - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector results; - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for( auto& p : tagPairs ) { - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto& p : tagPairs.results ) { + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" results.push_back(KeyBackedTag(p.first, prefix)); - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~TagUidMap_GetAll_implActorState(); static_cast(this)->destroy(); return 0; } - #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); this->~TagUidMap_GetAll_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -203,19 +224,19 @@ class TagUidMap_GetAll_implActorState { return loopDepth; } - int a_body1cont1(TagMap::PairsType && tagPairs,int loopDepth) + int a_body1cont1(TagMap::RangeResultType && tagPairs,int loopDepth) { - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector results; - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for( auto& p : tagPairs ) { - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto& p : tagPairs.results ) { + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" results.push_back(KeyBackedTag(p.first, prefix)); - #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~TagUidMap_GetAll_implActorState(); static_cast(this)->destroy(); return 0; } - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); this->~TagUidMap_GetAll_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -223,13 +244,13 @@ class TagUidMap_GetAll_implActorState { return loopDepth; } - int a_body1when1(TagMap::PairsType const& tagPairs,int loopDepth) + int a_body1when1(TagMap::RangeResultType const& tagPairs,int loopDepth) { loopDepth = a_body1cont1(tagPairs, loopDepth); return loopDepth; } - int a_body1when1(TagMap::PairsType && tagPairs,int loopDepth) + int a_body1when1(TagMap::RangeResultType && tagPairs,int loopDepth) { loopDepth = a_body1cont1(std::move(tagPairs), loopDepth); @@ -238,10 +259,10 @@ class TagUidMap_GetAll_implActorState { void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::PairsType >::remove(); + static_cast(this)->ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::RangeResultType >::remove(); } - void a_callback_fire(ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::PairsType >*,TagMap::PairsType const& value) + void a_callback_fire(ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::RangeResultType >*,TagMap::RangeResultType const& value) { fdb_probe_actor_enter("getAll_impl", reinterpret_cast(this), 0); a_exitChoose1(); @@ -256,7 +277,7 @@ class TagUidMap_GetAll_implActorState { fdb_probe_actor_exit("getAll_impl", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::PairsType >*,TagMap::PairsType && value) + void a_callback_fire(ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::RangeResultType >*,TagMap::RangeResultType && value) { fdb_probe_actor_enter("getAll_impl", reinterpret_cast(this), 0); a_exitChoose1(); @@ -271,7 +292,7 @@ class TagUidMap_GetAll_implActorState { fdb_probe_actor_exit("getAll_impl", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::PairsType >*,Error err) + void a_callback_error(ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::RangeResultType >*,Error err) { fdb_probe_actor_enter("getAll_impl", reinterpret_cast(this), 0); a_exitChoose1(); @@ -286,20 +307,20 @@ class TagUidMap_GetAll_implActorState { fdb_probe_actor_exit("getAll_impl", reinterpret_cast(this), 0); } - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TagUidMap* tagsMap; - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Snapshot snapshot; - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key prefix; - #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via getAll_impl() - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class TagUidMap_GetAll_implActor final : public Actor>, public ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::PairsType >, public FastAllocated, public TagUidMap_GetAll_implActorState { - #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class TagUidMap_GetAll_implActor final : public Actor>, public ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::RangeResultType >, public FastAllocated, public TagUidMap_GetAll_implActorState { + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -307,10 +328,10 @@ class TagUidMap_GetAll_implActor final : public Actor> #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::PairsType >; - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +friend struct ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::RangeResultType >; + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TagUidMap_GetAll_implActor(TagUidMap* const& tagsMap,Reference const& tr,Snapshot const& snapshot) - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor>(), TagUidMap_GetAll_implActorState(tagsMap, tr, snapshot) { @@ -328,85 +349,92 @@ friend struct ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::PairsType >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::PairsType >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< TagUidMap_GetAll_implActor, 0, TagMap::RangeResultType >*)0, actor_cancelled()); break; } } }; - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] Future> TagUidMap::getAll_impl( TagUidMap* const& tagsMap, Reference const& tr, Snapshot const& snapshot ) { - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future>(new TagUidMap_GetAll_implActor(tagsMap, tr, snapshot)); - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyBackedTag::KeyBackedTag(std::string tagName, StringRef tagMapPrefix) : KeyBackedProperty(TagUidMap(tagMapPrefix).getProperty(tagName)), tagName(tagName), tagMapPrefix(tagMapPrefix) {} -class RestoreConfig : public KeyBackedConfig { +class RestoreConfig : public KeyBackedTaskConfig { public: - RestoreConfig(UID uid = UID()) : KeyBackedConfig(fileRestorePrefixRange.begin, uid) {} - RestoreConfig(Reference task) : KeyBackedConfig(fileRestorePrefixRange.begin, task) {} + RestoreConfig(UID uid = UID()) : KeyBackedTaskConfig(fileRestorePrefixRange.begin, uid) {} + RestoreConfig(Reference task) : KeyBackedTaskConfig(fileRestorePrefixRange.begin, task) {} - KeyBackedProperty stateEnum() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty stateEnum() { return configSpace.pack(__FUNCTION__sr); } Future stateText(Reference tr) { return map(stateEnum().getD(tr), [](ERestoreState s) -> StringRef { return FileBackupAgent::restoreStateText(s); }); } - KeyBackedProperty addPrefix() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - KeyBackedProperty removePrefix() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - KeyBackedProperty onlyApplyMutationLogs() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - KeyBackedProperty inconsistentSnapshotOnly() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty addPrefix() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty removePrefix() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty onlyApplyMutationLogs() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty inconsistentSnapshotOnly() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty unlockDBAfterRestore() { return configSpace.pack(__FUNCTION__sr); } // XXX: Remove restoreRange() once it is safe to remove. It has been changed to restoreRanges - KeyBackedProperty restoreRange() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - KeyBackedProperty> restoreRanges() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } - KeyBackedProperty batchFuture() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - KeyBackedProperty beginVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - KeyBackedProperty restoreVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - KeyBackedProperty firstConsistentVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - - KeyBackedProperty> sourceContainer() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } + KeyBackedProperty restoreRange() { return configSpace.pack(__FUNCTION__sr); } + // XXX: Changed to restoreRangeSet. It can be removed. + KeyBackedProperty> restoreRanges() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedSet restoreRangeSet() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty batchFuture() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty beginVersion() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty restoreVersion() { return configSpace.pack(__FUNCTION__sr); } + KeyBackedProperty firstConsistentVersion() { return configSpace.pack(__FUNCTION__sr); } + + KeyBackedProperty> sourceContainer() { return configSpace.pack(__FUNCTION__sr); } // Get the source container as a bare URL, without creating a container instance - KeyBackedProperty sourceContainerURL() { return configSpace.pack(LiteralStringRef("sourceContainer")); } + KeyBackedProperty sourceContainerURL() { return configSpace.pack("sourceContainer"_sr); } // Total bytes written by all log and range restore tasks. - KeyBackedBinaryValue bytesWritten() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue bytesWritten() { return configSpace.pack(__FUNCTION__sr); } // File blocks that have had tasks created for them by the Dispatch task - KeyBackedBinaryValue filesBlocksDispatched() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue filesBlocksDispatched() { return configSpace.pack(__FUNCTION__sr); } // File blocks whose tasks have finished - KeyBackedBinaryValue fileBlocksFinished() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue fileBlocksFinished() { return configSpace.pack(__FUNCTION__sr); } // Total number of files in the fileMap - KeyBackedBinaryValue fileCount() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue fileCount() { return configSpace.pack(__FUNCTION__sr); } // Total number of file blocks in the fileMap - KeyBackedBinaryValue fileBlockCount() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue fileBlockCount() { return configSpace.pack(__FUNCTION__sr); } Future> getRestoreRangesOrDefault(Reference tr) { return getRestoreRangesOrDefault_impl(this, tr); } - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via getRestoreRangesOrDefault_impl() - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class GetRestoreRangesOrDefault_implActorState { - #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" GetRestoreRangesOrDefault_implActorState(RestoreConfig* const& self,Reference const& tr) - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : self(self), - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr(tr) - #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr(tr), + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ranges(), + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + batchSize(BUGGIFY ? 1 : CLIENT_KNOBS->RESTORE_RANGES_READ_BATCH), + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + begin(), + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + arena() + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("getRestoreRangesOrDefault_impl", reinterpret_cast(this)); @@ -419,17 +447,10 @@ class GetRestoreRangesOrDefault_implActorState { int a_body1(int loopDepth=0) { try { - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_0 = self->restoreRanges().getD(tr); - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -449,20 +470,20 @@ class GetRestoreRangesOrDefault_implActorState { } int a_body1cont1(int loopDepth) { - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (ranges.empty()) - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = self->restoreRange().getD(tr); - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_1 = self->restoreRanges().getD(tr); + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -472,34 +493,104 @@ class GetRestoreRangesOrDefault_implActorState { return loopDepth; } - int a_body1when1(std::vector const& __ranges,int loopDepth) + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) { - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ranges = __ranges; - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture::RangeResultType> __when_expr_0 = self->restoreRangeSet().getRange(tr, begin, {}, batchSize); + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast::RangeResultType >*>(static_cast(this))); + #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1when1(std::vector && __ranges,int loopDepth) + int a_body1break1(int loopDepth) { - ranges = std::move(__ranges); - loopDepth = a_body1cont1(loopDepth); + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(KeyBackedSet::RangeResultType const& rangeResult,int loopDepth) + { + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ranges.insert(ranges.end(), rangeResult.results.begin(), rangeResult.results.end()); + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!rangeResult.more) + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(!rangeResult.results.empty()); + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + begin = KeyRangeRef(KeyRef(arena, ranges.back().begin), keyAfter(ranges.back().end, arena)); + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1(KeyBackedSet::RangeResultType && rangeResult,int loopDepth) + { + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ranges.insert(ranges.end(), rangeResult.results.begin(), rangeResult.results.end()); + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!rangeResult.more) + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(!rangeResult.results.empty()); + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + begin = KeyRangeRef(KeyRef(arena, ranges.back().begin), keyAfter(ranges.back().end, arena)); + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(KeyBackedSet::RangeResultType const& rangeResult,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(rangeResult, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(KeyBackedSet::RangeResultType && rangeResult,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(std::move(rangeResult), loopDepth); return loopDepth; } void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRestoreRangesOrDefault_implActor, 0, std::vector >::remove(); + static_cast(this)->ActorCallback< GetRestoreRangesOrDefault_implActor, 0, KeyBackedSet::RangeResultType >::remove(); } - void a_callback_fire(ActorCallback< GetRestoreRangesOrDefault_implActor, 0, std::vector >*,std::vector const& value) + void a_callback_fire(ActorCallback< GetRestoreRangesOrDefault_implActor, 0, KeyBackedSet::RangeResultType >*,KeyBackedSet::RangeResultType const& value) { fdb_probe_actor_enter("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -509,12 +600,12 @@ class GetRestoreRangesOrDefault_implActorState { fdb_probe_actor_exit("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetRestoreRangesOrDefault_implActor, 0, std::vector >*,std::vector && value) + void a_callback_fire(ActorCallback< GetRestoreRangesOrDefault_implActor, 0, KeyBackedSet::RangeResultType >*,KeyBackedSet::RangeResultType && value) { fdb_probe_actor_enter("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -524,7 +615,7 @@ class GetRestoreRangesOrDefault_implActorState { fdb_probe_actor_exit("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetRestoreRangesOrDefault_implActor, 0, std::vector >*,Error err) + void a_callback_error(ActorCallback< GetRestoreRangesOrDefault_implActor, 0, KeyBackedSet::RangeResultType >*,Error err) { fdb_probe_actor_enter("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 0); a_exitChoose1(); @@ -541,9 +632,9 @@ class GetRestoreRangesOrDefault_implActorState { } int a_body1cont2(int loopDepth) { - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(ranges); this->~GetRestoreRangesOrDefault_implActorState(); static_cast(this)->destroy(); return 0; } - #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::move(ranges)); // state_var_RVO this->~GetRestoreRangesOrDefault_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -551,38 +642,79 @@ class GetRestoreRangesOrDefault_implActorState { return loopDepth; } - int a_body1cont3(int loopDepth) + int a_body1cont3(std::vector const& _ranges,int loopDepth) { - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ranges.push_back(range); - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont2(loopDepth); + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ranges = _ranges; + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (ranges.empty()) + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = self->restoreRange().getD(tr); + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont4(loopDepth); + } return loopDepth; } - int a_body1cont1when1(KeyRange const& __range,int loopDepth) + int a_body1cont3(std::vector && _ranges,int loopDepth) { - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - range = __range; - #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont3(loopDepth); + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ranges = _ranges; + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (ranges.empty()) + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = self->restoreRange().getD(tr); + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont4(loopDepth); + } return loopDepth; } - int a_body1cont1when1(KeyRange && __range,int loopDepth) + int a_body1cont1when1(std::vector const& _ranges,int loopDepth) { - range = std::move(__range); - loopDepth = a_body1cont3(loopDepth); + loopDepth = a_body1cont3(_ranges, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(std::vector && _ranges,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_ranges), loopDepth); return loopDepth; } void a_exitChoose2() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRestoreRangesOrDefault_implActor, 1, KeyRange >::remove(); + static_cast(this)->ActorCallback< GetRestoreRangesOrDefault_implActor, 1, std::vector >::remove(); } - void a_callback_fire(ActorCallback< GetRestoreRangesOrDefault_implActor, 1, KeyRange >*,KeyRange const& value) + void a_callback_fire(ActorCallback< GetRestoreRangesOrDefault_implActor, 1, std::vector >*,std::vector const& value) { fdb_probe_actor_enter("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 1); a_exitChoose2(); @@ -597,7 +729,7 @@ class GetRestoreRangesOrDefault_implActorState { fdb_probe_actor_exit("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< GetRestoreRangesOrDefault_implActor, 1, KeyRange >*,KeyRange && value) + void a_callback_fire(ActorCallback< GetRestoreRangesOrDefault_implActor, 1, std::vector >*,std::vector && value) { fdb_probe_actor_enter("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 1); a_exitChoose2(); @@ -612,7 +744,7 @@ class GetRestoreRangesOrDefault_implActorState { fdb_probe_actor_exit("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< GetRestoreRangesOrDefault_implActor, 1, KeyRange >*,Error err) + void a_callback_error(ActorCallback< GetRestoreRangesOrDefault_implActor, 1, std::vector >*,Error err) { fdb_probe_actor_enter("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 1); a_exitChoose2(); @@ -627,20 +759,111 @@ class GetRestoreRangesOrDefault_implActorState { fdb_probe_actor_exit("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 1); } - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int a_body1cont4(int loopDepth) + { + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont5(KeyRange const& range,int loopDepth) + { + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ranges.push_back(range); + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont5(KeyRange && range,int loopDepth) + { + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ranges.push_back(range); + #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont3when1(KeyRange const& range,int loopDepth) + { + loopDepth = a_body1cont5(range, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(KeyRange && range,int loopDepth) + { + loopDepth = a_body1cont5(std::move(range), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetRestoreRangesOrDefault_implActor, 2, KeyRange >::remove(); + + } + void a_callback_fire(ActorCallback< GetRestoreRangesOrDefault_implActor, 2, KeyRange >*,KeyRange const& value) + { + fdb_probe_actor_enter("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< GetRestoreRangesOrDefault_implActor, 2, KeyRange >*,KeyRange && value) + { + fdb_probe_actor_enter("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< GetRestoreRangesOrDefault_implActor, 2, KeyRange >*,Error err) + { + fdb_probe_actor_enter("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRestoreRangesOrDefault_impl", reinterpret_cast(this), 2); + + } + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig* self; - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector ranges; - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - KeyRange range; - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int batchSize; + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional begin; + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Arena arena; + #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via getRestoreRangesOrDefault_impl() - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class GetRestoreRangesOrDefault_implActor final : public Actor>, public ActorCallback< GetRestoreRangesOrDefault_implActor, 0, std::vector >, public ActorCallback< GetRestoreRangesOrDefault_implActor, 1, KeyRange >, public FastAllocated, public GetRestoreRangesOrDefault_implActorState { - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class GetRestoreRangesOrDefault_implActor final : public Actor>, public ActorCallback< GetRestoreRangesOrDefault_implActor, 0, KeyBackedSet::RangeResultType >, public ActorCallback< GetRestoreRangesOrDefault_implActor, 1, std::vector >, public ActorCallback< GetRestoreRangesOrDefault_implActor, 2, KeyRange >, public FastAllocated, public GetRestoreRangesOrDefault_implActorState { + #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -648,11 +871,12 @@ class GetRestoreRangesOrDefault_implActor final : public Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetRestoreRangesOrDefault_implActor, 0, std::vector >; -friend struct ActorCallback< GetRestoreRangesOrDefault_implActor, 1, KeyRange >; - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +friend struct ActorCallback< GetRestoreRangesOrDefault_implActor, 0, KeyBackedSet::RangeResultType >; +friend struct ActorCallback< GetRestoreRangesOrDefault_implActor, 1, std::vector >; +friend struct ActorCallback< GetRestoreRangesOrDefault_implActor, 2, KeyRange >; + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" GetRestoreRangesOrDefault_implActor(RestoreConfig* const& self,Reference const& tr) - #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor>(), GetRestoreRangesOrDefault_implActorState(self, tr) { @@ -670,20 +894,21 @@ friend struct ActorCallback< GetRestoreRangesOrDefault_implActor, 1, KeyRange >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetRestoreRangesOrDefault_implActor, 0, std::vector >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetRestoreRangesOrDefault_implActor, 1, KeyRange >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetRestoreRangesOrDefault_implActor, 0, KeyBackedSet::RangeResultType >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetRestoreRangesOrDefault_implActor, 1, std::vector >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetRestoreRangesOrDefault_implActor, 2, KeyRange >*)0, actor_cancelled()); break; } } }; - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future> getRestoreRangesOrDefault_impl( RestoreConfig* const& self, Reference const& tr ) { - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future>(new GetRestoreRangesOrDefault_implActor(self, tr)); - #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" // Describes a file to load blocks from during restore. Ordered by version and then fileName to enable // incrementally advancing through the map, saving the version and path of the next starting point. @@ -696,13 +921,7 @@ friend struct ActorCallback< GetRestoreRangesOrDefault_implActor, 1, KeyRange >; Version endVersion{ ::invalidVersion }; // not meaningful for range files Tuple pack() const { - return Tuple() - .append(version) - .append(StringRef(fileName)) - .append(isRange) - .append(fileSize) - .append(blockSize) - .append(endVersion); + return Tuple::makeTuple(version, fileName, (int)isRange, fileSize, blockSize, endVersion); } static RestoreFile unpack(Tuple const& t) { RestoreFile r; @@ -718,7 +937,7 @@ friend struct ActorCallback< GetRestoreRangesOrDefault_implActor, 1, KeyRange >; }; typedef KeyBackedSet FileSetT; - FileSetT fileSet() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + FileSetT fileSet() { return configSpace.pack(__FUNCTION__sr); } Future isRunnable(Reference tr) { return map(stateEnum().getD(tr), [](ERestoreState s) -> bool { @@ -747,26 +966,26 @@ friend struct ActorCallback< GetRestoreRangesOrDefault_implActor, 1, KeyRange >; Key applyMutationsMapPrefix() { return uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); } - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via getApplyVersionLag_impl() - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class GetApplyVersionLag_implActorState { - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" GetApplyVersionLag_implActorState(Reference const& tr,UID const& uid) - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" uid(uid), - #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVal(tr->get(uidPrefixKey(applyMutationsBeginRange.begin, uid), Snapshot::True)), - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" endVal(tr->get(uidPrefixKey(applyMutationsEndRange.begin, uid), Snapshot::True)) - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("getApplyVersionLag_impl", reinterpret_cast(this)); @@ -779,16 +998,16 @@ class GetApplyVersionLag_implActorState { int a_body1(int loopDepth=0) { try { - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = success(beginVal) && success(endVal); - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -809,25 +1028,25 @@ class GetApplyVersionLag_implActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!beginVal.get().present() || !endVal.get().present()) - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(0); this->~GetApplyVersionLag_implActorState(); static_cast(this)->destroy(); return 0; } - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< int64_t >::value()) int64_t(0); this->~GetApplyVersionLag_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version beginVersion = BinaryReader::fromStringRef(beginVal.get().get(), Unversioned()); - #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version endVersion = BinaryReader::fromStringRef(endVal.get().get(), Unversioned()); - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(endVersion - beginVersion); this->~GetApplyVersionLag_implActorState(); static_cast(this)->destroy(); return 0; } - #line 830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< int64_t >::value()) int64_t(endVersion - beginVersion); this->~GetApplyVersionLag_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -837,25 +1056,25 @@ class GetApplyVersionLag_implActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!beginVal.get().present() || !endVal.get().present()) - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(0); this->~GetApplyVersionLag_implActorState(); static_cast(this)->destroy(); return 0; } - #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< int64_t >::value()) int64_t(0); this->~GetApplyVersionLag_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version beginVersion = BinaryReader::fromStringRef(beginVal.get().get(), Unversioned()); - #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version endVersion = BinaryReader::fromStringRef(endVal.get().get(), Unversioned()); - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(endVersion - beginVersion); this->~GetApplyVersionLag_implActorState(); static_cast(this)->destroy(); return 0; } - #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< int64_t >::value()) int64_t(endVersion - beginVersion); this->~GetApplyVersionLag_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -926,20 +1145,20 @@ class GetApplyVersionLag_implActorState { fdb_probe_actor_exit("getApplyVersionLag_impl", reinterpret_cast(this), 0); } - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UID uid; - #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future> beginVal; - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future> endVal; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via getApplyVersionLag_impl() - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class GetApplyVersionLag_implActor final : public Actor, public ActorCallback< GetApplyVersionLag_implActor, 0, Void >, public FastAllocated, public GetApplyVersionLag_implActorState { - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -948,9 +1167,9 @@ class GetApplyVersionLag_implActor final : public Actor, public ActorCa void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetApplyVersionLag_implActor, 0, Void >; - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" GetApplyVersionLag_implActor(Reference const& tr,UID const& uid) - #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), GetApplyVersionLag_implActorState(tr, uid) { @@ -973,36 +1192,46 @@ friend struct ActorCallback< GetApplyVersionLag_implActor, 0, Void >; } }; - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future getApplyVersionLag_impl( Reference const& tr, UID const& uid ) { - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new GetApplyVersionLag_implActor(tr, uid)); - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future getApplyVersionLag(Reference tr) { return getApplyVersionLag_impl(tr, uid); } - void initApplyMutations(Reference tr, Key addPrefix, Key removePrefix) { + void initApplyMutations(Reference tr, + Key addPrefix, + Key removePrefix, + OnlyApplyMutationLogs onlyApplyMutationLogs) { // Set these because they have to match the applyMutations values. this->addPrefix().set(tr, addPrefix); this->removePrefix().set(tr, removePrefix); - clearApplyMutationsKeys(tr); + // Skip applyMutationsKeyVersionCount, applyMutationsKeyVersionMap, applyMutationsEnd, applyMutationsBegin + // for only-apply-mutation-logs restore. They were initialized in preloadApplyMutationsKeyVersionMap + clearApplyMutationsKeys(tr, onlyApplyMutationLogs); // Initialize add/remove prefix, range version map count and set the map's start key to InvalidVersion tr->set(uidPrefixKey(applyMutationsAddPrefixRange.begin, uid), addPrefix); tr->set(uidPrefixKey(applyMutationsRemovePrefixRange.begin, uid), removePrefix); - int64_t startCount = 0; - tr->set(uidPrefixKey(applyMutationsKeyVersionCountRange.begin, uid), StringRef((uint8_t*)&startCount, 8)); - Key mapStart = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); - tr->set(mapStart, BinaryWriter::toValue(invalidVersion, Unversioned())); + + // Skip init applyMutationsKeyVersionCount and applyMutationsKeyVersionMap for only-apply-mutation-logs restore. + // They were initialized in preloadApplyMutationsKeyVersionMap + if (!onlyApplyMutationLogs) { + int64_t startCount = 0; + tr->set(uidPrefixKey(applyMutationsKeyVersionCountRange.begin, uid), StringRef((uint8_t*)&startCount, 8)); + Key mapStart = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); + tr->set(mapStart, BinaryWriter::toValue(invalidVersion, Unversioned())); + } } - void clearApplyMutationsKeys(Reference tr) { + void clearApplyMutationsKeys(Reference tr, bool skipMutationKeyVersionMap = false) { tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); // Clear add/remove prefix keys @@ -1010,17 +1239,21 @@ friend struct ActorCallback< GetApplyVersionLag_implActor, 0, Void >; tr->clear(uidPrefixKey(applyMutationsRemovePrefixRange.begin, uid)); // Clear range version map and count key - tr->clear(uidPrefixKey(applyMutationsKeyVersionCountRange.begin, uid)); - Key mapStart = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); - tr->clear(KeyRangeRef(mapStart, strinc(mapStart))); + if (!skipMutationKeyVersionMap) { + tr->clear(uidPrefixKey(applyMutationsKeyVersionCountRange.begin, uid)); + Key mapStart = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); + tr->clear(KeyRangeRef(mapStart, strinc(mapStart))); + } // Clear any loaded mutations that have not yet been applied Key mutationPrefix = mutationLogPrefix(); tr->clear(KeyRangeRef(mutationPrefix, strinc(mutationPrefix))); - // Clear end and begin versions (intentionally in this order) - tr->clear(uidPrefixKey(applyMutationsEndRange.begin, uid)); - tr->clear(uidPrefixKey(applyMutationsBeginRange.begin, uid)); + if (!skipMutationKeyVersionMap) { + // Clear end and begin versions (intentionally in this order) + tr->clear(uidPrefixKey(applyMutationsEndRange.begin, uid)); + tr->clear(uidPrefixKey(applyMutationsBeginRange.begin, uid)); + } } void setApplyBeginVersion(Reference tr, Version ver) { @@ -1045,22 +1278,22 @@ friend struct ActorCallback< GetApplyVersionLag_implActor, 0, Void >; }); } - #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via getCurrentVersion_impl() - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class GetCurrentVersion_implActorState { - #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" GetCurrentVersion_implActorState(RestoreConfig* const& self,Reference const& tr) - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : self(self), - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr(tr) - #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("getCurrentVersion_impl", reinterpret_cast(this)); @@ -1073,16 +1306,16 @@ class GetCurrentVersion_implActorState { int a_body1(int loopDepth=0) { try { - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = self->stateEnum().getD(tr); - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1103,40 +1336,40 @@ class GetCurrentVersion_implActorState { } int a_body1cont1(int loopDepth) { - #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" version = -1; - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (status == ERestoreState::RUNNING) - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = store(version, self->getApplyBeginVersion(tr)); - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (status == ERestoreState::COMPLETED) - #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = store(version, self->restoreVersion().getD(tr)); - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -1149,9 +1382,9 @@ class GetCurrentVersion_implActorState { } int a_body1when1(ERestoreState const& __status,int loopDepth) { - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" status = __status; - #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -1216,9 +1449,9 @@ class GetCurrentVersion_implActorState { } int a_body1cont2(int loopDepth) { - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(version); this->~GetCurrentVersion_implActorState(); static_cast(this)->destroy(); return 0; } - #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Version >::value()) Version(std::move(version)); // state_var_RVO this->~GetCurrentVersion_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1382,20 +1615,20 @@ class GetCurrentVersion_implActorState { fdb_probe_actor_exit("getCurrentVersion_impl", reinterpret_cast(this), 2); } - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig* self; - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ERestoreState status; - #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version version; - #line 1393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via getCurrentVersion_impl() - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class GetCurrentVersion_implActor final : public Actor, public ActorCallback< GetCurrentVersion_implActor, 0, ERestoreState >, public ActorCallback< GetCurrentVersion_implActor, 1, Void >, public ActorCallback< GetCurrentVersion_implActor, 2, Void >, public FastAllocated, public GetCurrentVersion_implActorState { - #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1406,9 +1639,9 @@ class GetCurrentVersion_implActor final : public Actor, public ActorCal friend struct ActorCallback< GetCurrentVersion_implActor, 0, ERestoreState >; friend struct ActorCallback< GetCurrentVersion_implActor, 1, Void >; friend struct ActorCallback< GetCurrentVersion_implActor, 2, Void >; - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" GetCurrentVersion_implActor(RestoreConfig* const& self,Reference const& tr) - #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), GetCurrentVersion_implActorState(self, tr) { @@ -1433,52 +1666,52 @@ friend struct ActorCallback< GetCurrentVersion_implActor, 2, Void >; } }; - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future getCurrentVersion_impl( RestoreConfig* const& self, Reference const& tr ) { - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new GetCurrentVersion_implActor(self, tr)); - #line 1440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future getCurrentVersion(Reference tr) { return getCurrentVersion_impl(this, tr); } - #line 1449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" [[nodiscard]] static Future getProgress_impl( RestoreConfig const& restore, Reference const& tr ); template friend class RestoreConfig_GetProgress_implActorState; -#line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future getProgress(Reference tr) { return getProgress_impl(*this, tr); } - #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" [[nodiscard]] static Future getFullStatus_impl( RestoreConfig const& restore, Reference const& tr ); template friend class RestoreConfig_GetFullStatus_implActorState; -#line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future getFullStatus(Reference tr) { return getFullStatus_impl(*this, tr); } }; typedef RestoreConfig::RestoreFile RestoreFile; - #line 1466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via getProgress_impl() - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class RestoreConfig_GetProgress_implActorState { - #line 1472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig_GetProgress_implActorState(RestoreConfig const& restore,Reference const& tr) - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : restore(restore), - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr(tr) - #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("getProgress_impl", reinterpret_cast(this)); @@ -1491,44 +1724,44 @@ class RestoreConfig_GetProgress_implActorState { int a_body1(int loopDepth=0) { try { - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" fileCount = restore.fileCount().getD(tr); - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" fileBlockCount = restore.fileBlockCount().getD(tr); - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" fileBlocksDispatched = restore.filesBlocksDispatched().getD(tr); - #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" fileBlocksFinished = restore.fileBlocksFinished().getD(tr); - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bytesWritten = restore.bytesWritten().getD(tr); - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" status = restore.stateText(tr); - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" currentVersion = restore.getCurrentVersion(tr); - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" lag = restore.getApplyVersionLag(tr); - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" firstConsistentVersion = restore.firstConsistentVersion().getD(tr); - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tag = restore.tag().getD(tr); - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" lastError = restore.lastError().getD(tr); - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" uid = restore.getUid(); - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = success(fileCount) && success(fileBlockCount) && success(fileBlocksDispatched) && success(fileBlocksFinished) && success(bytesWritten) && success(status) && success(currentVersion) && success(lag) && success(firstConsistentVersion) && success(tag) && success(lastError); - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1549,21 +1782,21 @@ class RestoreConfig_GetProgress_implActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::string errstr = "None"; - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (lastError.get().second != 0) - #line 1556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" errstr = format("'%s' %" PRId64 "s ago.\n", lastError.get().first.c_str(), (tr->getReadVersion().get() - lastError.get().second) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); - #line 1560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreProgress") .detail("RestoreUID", uid) .detail("Tag", tag.get()) .detail("State", status.get().toString()) .detail("FileCount", fileCount.get()) .detail("FileBlocksFinished", fileBlocksFinished.get()) .detail("FileBlocksTotal", fileBlockCount.get()) .detail("FileBlocksInProgress", fileBlocksDispatched.get() - fileBlocksFinished.get()) .detail("BytesWritten", bytesWritten.get()) .detail("CurrentVersion", currentVersion.get()) .detail("FirstConsistentVersion", firstConsistentVersion.get()) .detail("ApplyLag", lag.get()) .detail("TaskInstance", THIS_ADDR); - #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(format("Tag: %s UID: %s State: %s Blocks: %lld/%lld BlocksInProgress: %lld Files: %lld BytesWritten: " "%lld CurrentVersion: %lld FirstConsistentVersion: %lld ApplyVersionLag: %lld LastError: %s", tag.get().c_str(), uid.toString().c_str(), status.get().toString().c_str(), fileBlocksFinished.get(), fileBlockCount.get(), fileBlocksDispatched.get() - fileBlocksFinished.get(), fileCount.get(), bytesWritten.get(), currentVersion.get(), firstConsistentVersion.get(), lag.get(), errstr.c_str())); this->~RestoreConfig_GetProgress_implActorState(); static_cast(this)->destroy(); return 0; } - #line 1566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< std::string >::value()) std::string(format("Tag: %s UID: %s State: %s Blocks: %lld/%lld BlocksInProgress: %lld Files: %lld BytesWritten: " "%lld CurrentVersion: %lld FirstConsistentVersion: %lld ApplyVersionLag: %lld LastError: %s", tag.get().c_str(), uid.toString().c_str(), status.get().toString().c_str(), fileBlocksFinished.get(), fileBlockCount.get(), fileBlocksDispatched.get() - fileBlocksFinished.get(), fileCount.get(), bytesWritten.get(), currentVersion.get(), firstConsistentVersion.get(), lag.get(), errstr.c_str())); this->~RestoreConfig_GetProgress_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1573,21 +1806,21 @@ class RestoreConfig_GetProgress_implActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::string errstr = "None"; - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (lastError.get().second != 0) - #line 1580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" errstr = format("'%s' %" PRId64 "s ago.\n", lastError.get().first.c_str(), (tr->getReadVersion().get() - lastError.get().second) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); - #line 1584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreProgress") .detail("RestoreUID", uid) .detail("Tag", tag.get()) .detail("State", status.get().toString()) .detail("FileCount", fileCount.get()) .detail("FileBlocksFinished", fileBlocksFinished.get()) .detail("FileBlocksTotal", fileBlockCount.get()) .detail("FileBlocksInProgress", fileBlocksDispatched.get() - fileBlocksFinished.get()) .detail("BytesWritten", bytesWritten.get()) .detail("CurrentVersion", currentVersion.get()) .detail("FirstConsistentVersion", firstConsistentVersion.get()) .detail("ApplyLag", lag.get()) .detail("TaskInstance", THIS_ADDR); - #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(format("Tag: %s UID: %s State: %s Blocks: %lld/%lld BlocksInProgress: %lld Files: %lld BytesWritten: " "%lld CurrentVersion: %lld FirstConsistentVersion: %lld ApplyVersionLag: %lld LastError: %s", tag.get().c_str(), uid.toString().c_str(), status.get().toString().c_str(), fileBlocksFinished.get(), fileBlockCount.get(), fileBlocksDispatched.get() - fileBlocksFinished.get(), fileCount.get(), bytesWritten.get(), currentVersion.get(), firstConsistentVersion.get(), lag.get(), errstr.c_str())); this->~RestoreConfig_GetProgress_implActorState(); static_cast(this)->destroy(); return 0; } - #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< std::string >::value()) std::string(format("Tag: %s UID: %s State: %s Blocks: %lld/%lld BlocksInProgress: %lld Files: %lld BytesWritten: " "%lld CurrentVersion: %lld FirstConsistentVersion: %lld ApplyVersionLag: %lld LastError: %s", tag.get().c_str(), uid.toString().c_str(), status.get().toString().c_str(), fileBlocksFinished.get(), fileBlockCount.get(), fileBlocksDispatched.get() - fileBlocksFinished.get(), fileCount.get(), bytesWritten.get(), currentVersion.get(), firstConsistentVersion.get(), lag.get(), errstr.c_str())); this->~RestoreConfig_GetProgress_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1658,40 +1891,40 @@ class RestoreConfig_GetProgress_implActorState { fdb_probe_actor_exit("getProgress_impl", reinterpret_cast(this), 0); } - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig restore; - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future fileCount; - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future fileBlockCount; - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future fileBlocksDispatched; - #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future fileBlocksFinished; - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future bytesWritten; - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future status; - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future currentVersion; - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future lag; - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future firstConsistentVersion; - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future tag; - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future> lastError; - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UID uid; - #line 1689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via getProgress_impl() - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class RestoreConfig_GetProgress_implActor final : public Actor, public ActorCallback< RestoreConfig_GetProgress_implActor, 0, Void >, public FastAllocated, public RestoreConfig_GetProgress_implActorState { - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1700,9 +1933,9 @@ class RestoreConfig_GetProgress_implActor final : public Actor, pub void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< RestoreConfig_GetProgress_implActor, 0, Void >; - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig_GetProgress_implActor(RestoreConfig const& restore,Reference const& tr) - #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), RestoreConfig_GetProgress_implActorState(restore, tr) { @@ -1725,31 +1958,31 @@ friend struct ActorCallback< RestoreConfig_GetProgress_implActor, 0, Void >; } }; - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] Future RestoreConfig::getProgress_impl( RestoreConfig const& restore, Reference const& tr ) { - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new RestoreConfig_GetProgress_implActor(restore, tr)); - #line 1732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via getFullStatus_impl() - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class RestoreConfig_GetFullStatus_implActorState { - #line 1743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig_GetFullStatus_implActorState(RestoreConfig const& restore,Reference const& tr) - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : restore(restore), - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr(tr) - #line 1752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("getFullStatus_impl", reinterpret_cast(this)); @@ -1762,32 +1995,32 @@ class RestoreConfig_GetFullStatus_implActorState { int a_body1(int loopDepth=0) { try { - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ranges = restore.getRestoreRangesOrDefault(tr); - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addPrefix = restore.addPrefix().getD(tr); - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" removePrefix = restore.removePrefix().getD(tr); - #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" url = restore.sourceContainerURL().getD(tr); - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreVersion = restore.restoreVersion().getD(tr); - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" progress = restore.getProgress(tr); - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = success(ranges) && success(addPrefix) && success(removePrefix) && success(url) && success(restoreVersion) && success(progress); - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1808,21 +2041,21 @@ class RestoreConfig_GetFullStatus_implActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::string returnStr; - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" returnStr = format("%s URL: %s", progress.get().c_str(), url.get().toString().c_str()); - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& range : ranges.get() ) { - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" returnStr += format(" Range: '%s'-'%s'", printable(range.begin).c_str(), printable(range.end).c_str()); - #line 1819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" returnStr += format(" AddPrefix: '%s' RemovePrefix: '%s' Version: %lld", printable(addPrefix.get()).c_str(), printable(removePrefix.get()).c_str(), restoreVersion.get()); - #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(returnStr); this->~RestoreConfig_GetFullStatus_implActorState(); static_cast(this)->destroy(); return 0; } - #line 1825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 2058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< std::string >::value()) std::string(returnStr); this->~RestoreConfig_GetFullStatus_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1832,21 +2065,21 @@ class RestoreConfig_GetFullStatus_implActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::string returnStr; - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" returnStr = format("%s URL: %s", progress.get().c_str(), url.get().toString().c_str()); - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& range : ranges.get() ) { - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" returnStr += format(" Range: '%s'-'%s'", printable(range.begin).c_str(), printable(range.end).c_str()); - #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" returnStr += format(" AddPrefix: '%s' RemovePrefix: '%s' Version: %lld", printable(addPrefix.get()).c_str(), printable(removePrefix.get()).c_str(), restoreVersion.get()); - #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(returnStr); this->~RestoreConfig_GetFullStatus_implActorState(); static_cast(this)->destroy(); return 0; } - #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 2082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< std::string >::value()) std::string(returnStr); this->~RestoreConfig_GetFullStatus_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1917,28 +2150,28 @@ class RestoreConfig_GetFullStatus_implActorState { fdb_probe_actor_exit("getFullStatus_impl", reinterpret_cast(this), 0); } - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig restore; - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future> ranges; - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future addPrefix; - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future removePrefix; - #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future url; - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future restoreVersion; - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future progress; - #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 2169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via getFullStatus_impl() - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class RestoreConfig_GetFullStatus_implActor final : public Actor, public ActorCallback< RestoreConfig_GetFullStatus_implActor, 0, Void >, public FastAllocated, public RestoreConfig_GetFullStatus_implActorState { - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 2174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1947,9 +2180,9 @@ class RestoreConfig_GetFullStatus_implActor final : public Actor, p void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< RestoreConfig_GetFullStatus_implActor, 0, Void >; - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig_GetFullStatus_implActor(RestoreConfig const& restore,Reference const& tr) - #line 1952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 2185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), RestoreConfig_GetFullStatus_implActorState(restore, tr) { @@ -1972,14 +2205,14 @@ friend struct ActorCallback< RestoreConfig_GetFullStatus_implActor, 0, Void >; } }; - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] Future RestoreConfig::getFullStatus_impl( RestoreConfig const& restore, Reference const& tr ) { - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new RestoreConfig_GetFullStatus_implActor(restore, tr)); - #line 1979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 2212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" FileBackupAgent::FileBackupAgent() : subspace(Subspace(fileBackupPrefixRange.begin)) @@ -2006,97 +2239,159 @@ Value makePadding(int size) { return pad.substr(0, size); } +struct IRangeFileWriter { +public: + virtual Future padEnd(bool final) = 0; + + virtual Future writeKV(Key k, Value v) = 0; + + virtual Future writeKey(Key k) = 0; + + virtual Future finish() = 0; + + virtual ~IRangeFileWriter() {} +}; + +struct SnapshotFileBackupEncryptionKeys { + Reference textCipherKey; + Optional> headerCipherKey; + StringRef ivRef; +}; + // File Format handlers. -// Both Range and Log formats are designed to be readable starting at any 1MB boundary +// Both Range and Log formats are designed to be readable starting at any BACKUP_RANGEFILE_BLOCK_SIZE boundary // so they can be read in parallel. // // Writer instances must be kept alive while any member actors are in progress. // -// RangeFileWriter must be used as follows: +// EncryptedRangeFileWriter must be used as follows: // 1 - writeKey(key) the queried key range begin // 2 - writeKV(k, v) each kv pair to restore // 3 - writeKey(key) the queried key range end +// 4 - finish() // -// RangeFileWriter will insert the required padding, header, and extra +// EncryptedRangeFileWriter will insert the required padding, header, and extra // end/begin keys around the 1MB boundaries as needed. // // Example: -// The range a-z is queries and returns c-j which covers 3 blocks. +// The range a-z is queries and returns c-j which covers 3 blocks across 2 tenants. // The client code writes keys in this sequence: -// a c d e f g h i j z +// t1a t1c t1d t1e t1f t1g t2h t2i t2j t2z // // H = header P = padding a...z = keys v = value | = block boundary // -// Encoded file: H a cv dv ev P | H e ev fv gv hv P | H h hv iv jv z +// Encoded file: H t1a t1cv t1dv t1ev P | H t1e t1ev t1fv t1gv t2 P | H t2 t2hv t2iv t2jv t2z // Decoded in blocks yields: -// Block 1: range [a, e) with kv pairs cv, dv -// Block 2: range [e, h) with kv pairs ev, fv, gv -// Block 3: range [h, z) with kv pairs hv, iv, jv +// Block 1: range [t1a, t1e) with kv pairs t1cv, t1dv +// Block 2: range [t1e, t2) with kv pairs t1ev, t1fv, t1gv +// Block 3: range [t2, t2z) with kv pairs t2hv, t2iv, t2jv // // NOTE: All blocks except for the final block will have one last // value which will not be used. This isn't actually a waste since // if the next KV pair wouldn't fit within the block after the value // then the space after the final key to the next 1MB boundary would // just be padding anyway. -struct RangeFileWriter { - RangeFileWriter(Reference file = Reference(), int blockSize = 0) - : file(file), blockSize(blockSize), blockEnd(0), fileVersion(BACKUP_AGENT_SNAPSHOT_FILE_VERSION) {} +// +// NOTE: For the EncryptedRangeFileWriter blocks will be split either on the BACKUP_RANGEFILE_BLOCK_SIZE boundary or +// when a new tenant id is encountered. If a block is split for crossing tenant boundaries then the last key will be +// truncated to just the tenant prefix and the value will be empty (to avoid having sensitive data of one tenant be +// encrypted with a key for a different tenant) +struct EncryptedRangeFileWriter : public IRangeFileWriter { + struct Options { + constexpr static FileIdentifier file_identifier = 3152016; - // Handles the first block and internal blocks. Ends current block if needed. - // The final flag is used in simulation to pad the file's final block to a whole block size - #line 2047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via newBlock() - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class NewBlockActorState { - #line 2053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + bool configurableEncryptionEnabled = false; + + Options() {} + + template + void serialize(Ar& ar) { + serializer(ar, configurableEncryptionEnabled); + } + }; + + EncryptedRangeFileWriter(Database cx, + Arena* arena, + EncryptionAtRestMode encryptMode, + Optional>> tenantCache, + Reference file = Reference(), + int blockSize = 0, + Options options = Options()) + : cx(cx), arena(arena), file(file), encryptMode(encryptMode), tenantCache(tenantCache), blockSize(blockSize), + blockEnd(0), fileVersion(BACKUP_AGENT_ENCRYPTED_SNAPSHOT_FILE_VERSION), options(options) { + buffer = makeString(blockSize); + wPtr = mutateString(buffer); + } + + #line 2326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via decryptImpl() + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class DecryptImplActorState { + #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - NewBlockActorState(RangeFileWriter* const& self,int const& bytesNeeded,bool const& final = false) - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : self(self), - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bytesNeeded(bytesNeeded), - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - final(final) - #line 2064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DecryptImplActorState(Database const& cx,std::variant const& headerVariant,const uint8_t* const& dataP,int64_t const& dataLen,Arena* const& arena) + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : cx(cx), + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + headerVariant(headerVariant), + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + dataP(dataP), + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + dataLen(dataLen), + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + arena(arena) + #line 2347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("newBlock", reinterpret_cast(this)); + fdb_probe_actor_create("decryptImpl", reinterpret_cast(this)); } - ~NewBlockActorState() + ~DecryptImplActorState() { - fdb_probe_actor_destroy("newBlock", reinterpret_cast(this)); + fdb_probe_actor_destroy("decryptImpl", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int bytesLeft = self->blockEnd - self->file->size(); - #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (bytesLeft > 0) - #line 2081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference const> dbInfo = cx->clientInfo; + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (std::holds_alternative(headerVariant)) + #line 2364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - paddingFFs = makePadding(bytesLeft); - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = self->file->append(paddingFFs.begin(), bytesLeft); - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + headerRef = std::get(headerVariant); + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = GetEncryptCipherKeys::getEncryptCipherKeys( dbInfo, headerRef, BlobCipherMetrics::RESTORE); + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1cont1(loopDepth); + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + header = std::get(headerVariant); + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = GetEncryptCipherKeys::getEncryptCipherKeys(dbInfo, header, BlobCipherMetrics::RESTORE); + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } } catch (Error& error) { @@ -2109,77 +2404,85 @@ class NewBlockActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~NewBlockActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~DecryptImplActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(int loopDepth) + int a_body1cont2(TextAndHeaderCipherKeys const& cipherKeys,int loopDepth) { - #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (final) - #line 2122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptHeaderCipherDetails cipherDetails = headerRef.getCipherDetails(); + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + cipherDetails.textCipherDetails.validateCipherDetailsWithCipherKey(cipherKeys.cipherTextKey); + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (cipherDetails.headerCipherDetails.present()) + #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ASSERT(g_network->isSimulated()); - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~NewBlockActorState(); static_cast(this)->destroy(); return 0; } - #line 2128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~NewBlockActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + cipherDetails.headerCipherDetails.get().validateCipherDetailsWithCipherKey(cipherKeys.cipherHeaderKey); + #line 2425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - self->blockEnd += self->blockSize; - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = self->file->append((uint8_t*)&self->fileVersion, sizeof(self->fileVersion)); - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont2(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(loopDepth); + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DecryptBlobCipherAes256Ctr decryptor( cipherKeys.cipherTextKey, cipherKeys.cipherHeaderKey, headerRef.getIV(), BlobCipherMetrics::RESTORE); + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(decryptor.decrypt(dataP, dataLen, headerRef, *arena)); this->~DecryptImplActorState(); static_cast(this)->destroy(); return 0; } + #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< StringRef >::value()) StringRef(decryptor.decrypt(dataP, dataLen, headerRef, *arena)); + this->~DecryptImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont2(Void && _,int loopDepth) + int a_body1cont2(TextAndHeaderCipherKeys && cipherKeys,int loopDepth) { - loopDepth = a_body1cont1(loopDepth); + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptHeaderCipherDetails cipherDetails = headerRef.getCipherDetails(); + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + cipherDetails.textCipherDetails.validateCipherDetailsWithCipherKey(cipherKeys.cipherTextKey); + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (cipherDetails.headerCipherDetails.present()) + #line 2447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + cipherDetails.headerCipherDetails.get().validateCipherDetailsWithCipherKey(cipherKeys.cipherHeaderKey); + #line 2451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DecryptBlobCipherAes256Ctr decryptor( cipherKeys.cipherTextKey, cipherKeys.cipherHeaderKey, headerRef.getIV(), BlobCipherMetrics::RESTORE); + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(decryptor.decrypt(dataP, dataLen, headerRef, *arena)); this->~DecryptImplActorState(); static_cast(this)->destroy(); return 0; } + #line 2457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< StringRef >::value()) StringRef(decryptor.decrypt(dataP, dataLen, headerRef, *arena)); + this->~DecryptImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1when1(TextAndHeaderCipherKeys const& cipherKeys,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + loopDepth = a_body1cont2(cipherKeys, loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1when1(TextAndHeaderCipherKeys && cipherKeys,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont2(std::move(cipherKeys), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< NewBlockActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecryptImplActor, 0, TextAndHeaderCipherKeys >::remove(); } - void a_callback_fire(ActorCallback< NewBlockActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< DecryptImplActor, 0, TextAndHeaderCipherKeys >*,TextAndHeaderCipherKeys const& value) { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 0); + fdb_probe_actor_enter("decryptImpl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -2189,12 +2492,12 @@ class NewBlockActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 0); + fdb_probe_actor_exit("decryptImpl", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< NewBlockActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< DecryptImplActor, 0, TextAndHeaderCipherKeys >*,TextAndHeaderCipherKeys && value) { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 0); + fdb_probe_actor_enter("decryptImpl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -2204,12 +2507,12 @@ class NewBlockActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 0); + fdb_probe_actor_exit("decryptImpl", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< NewBlockActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< DecryptImplActor, 0, TextAndHeaderCipherKeys >*,Error err) { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 0); + fdb_probe_actor_enter("decryptImpl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -2219,110 +2522,108 @@ class NewBlockActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 0); + fdb_probe_actor_exit("decryptImpl", reinterpret_cast(this), 0); } - int a_body1cont3(Void const& _,int loopDepth) + int a_body1cont5(TextAndHeaderCipherKeys const& cipherKeys,int loopDepth) { - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (self->blockEnd > self->blockSize) - #line 2229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = self->file->appendStringRefWithLen(self->lastKey); - #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + header.cipherTextDetails.validateCipherDetailsWithCipherKey(cipherKeys.cipherTextKey); + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (header.cipherHeaderDetails.isValid()) + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - loopDepth = a_body1cont5(loopDepth); + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + header.cipherHeaderDetails.validateCipherDetailsWithCipherKey(cipherKeys.cipherHeaderKey); + #line 2538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DecryptBlobCipherAes256Ctr decryptor( cipherKeys.cipherTextKey, cipherKeys.cipherHeaderKey, header.iv, BlobCipherMetrics::RESTORE); + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(decryptor.decrypt(dataP, dataLen, header, *arena)->toStringRef()); this->~DecryptImplActorState(); static_cast(this)->destroy(); return 0; } + #line 2544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< StringRef >::value()) StringRef(decryptor.decrypt(dataP, dataLen, header, *arena)->toStringRef()); + this->~DecryptImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont3(Void && _,int loopDepth) + int a_body1cont5(TextAndHeaderCipherKeys && cipherKeys,int loopDepth) { - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (self->blockEnd > self->blockSize) - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = self->file->appendStringRefWithLen(self->lastKey); - #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + header.cipherTextDetails.validateCipherDetailsWithCipherKey(cipherKeys.cipherTextKey); + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (header.cipherHeaderDetails.isValid()) + #line 2558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - loopDepth = a_body1cont5(loopDepth); + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + header.cipherHeaderDetails.validateCipherDetailsWithCipherKey(cipherKeys.cipherHeaderKey); + #line 2562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DecryptBlobCipherAes256Ctr decryptor( cipherKeys.cipherTextKey, cipherKeys.cipherHeaderKey, header.iv, BlobCipherMetrics::RESTORE); + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(decryptor.decrypt(dataP, dataLen, header, *arena)->toStringRef()); this->~DecryptImplActorState(); static_cast(this)->destroy(); return 0; } + #line 2568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< StringRef >::value()) StringRef(decryptor.decrypt(dataP, dataLen, header, *arena)->toStringRef()); + this->~DecryptImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1when2(TextAndHeaderCipherKeys const& cipherKeys,int loopDepth) { - loopDepth = a_body1cont3(_, loopDepth); + loopDepth = a_body1cont5(cipherKeys, loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1when2(TextAndHeaderCipherKeys && cipherKeys,int loopDepth) { - loopDepth = a_body1cont3(std::move(_), loopDepth); + loopDepth = a_body1cont5(std::move(cipherKeys), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< NewBlockActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecryptImplActor, 1, TextAndHeaderCipherKeys >::remove(); } - void a_callback_fire(ActorCallback< NewBlockActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< DecryptImplActor, 1, TextAndHeaderCipherKeys >*,TextAndHeaderCipherKeys const& value) { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 1); + fdb_probe_actor_enter("decryptImpl", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(value, 0); + a_body1when2(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 1); + fdb_probe_actor_exit("decryptImpl", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< NewBlockActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< DecryptImplActor, 1, TextAndHeaderCipherKeys >*,TextAndHeaderCipherKeys && value) { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 1); + fdb_probe_actor_enter("decryptImpl", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(std::move(value), 0); + a_body1when2(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 1); + fdb_probe_actor_exit("decryptImpl", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< NewBlockActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< DecryptImplActor, 1, TextAndHeaderCipherKeys >*,Error err) { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 1); + fdb_probe_actor_enter("decryptImpl", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -2332,208 +2633,215 @@ class NewBlockActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 1); + fdb_probe_actor_exit("decryptImpl", reinterpret_cast(this), 1); } - int a_body1cont5(int loopDepth) - { - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (self->file->size() + bytesNeeded > self->blockEnd) - #line 2342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(backup_bad_block_size(), loopDepth); - #line 2346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~NewBlockActorState(); static_cast(this)->destroy(); return 0; } - #line 2350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~NewBlockActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Database cx; + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::variant headerVariant; + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + const uint8_t* dataP; + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t dataLen; + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Arena* arena; + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + BlobCipherEncryptHeaderRef headerRef; + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + BlobCipherEncryptHeader header; + #line 2653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via decryptImpl() + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class DecryptImplActor final : public Actor, public ActorCallback< DecryptImplActor, 0, TextAndHeaderCipherKeys >, public ActorCallback< DecryptImplActor, 1, TextAndHeaderCipherKeys >, public FastAllocated, public DecryptImplActorState { + #line 2658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DecryptImplActor, 0, TextAndHeaderCipherKeys >; +friend struct ActorCallback< DecryptImplActor, 1, TextAndHeaderCipherKeys >; + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DecryptImplActor(Database const& cx,std::variant const& headerVariant,const uint8_t* const& dataP,int64_t const& dataLen,Arena* const& arena) + #line 2670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + DecryptImplActorState(cx, headerVariant, dataP, dataLen, arena) + { + fdb_probe_actor_enter("decryptImpl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("decryptImpl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("decryptImpl", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1cont6(Void const& _,int loopDepth) + void cancel() override { - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_3 = self->file->appendStringRefWithLen(self->lastKey); - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DecryptImplActor, 0, TextAndHeaderCipherKeys >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DecryptImplActor, 1, TextAndHeaderCipherKeys >*)0, actor_cancelled()); break; + } - return loopDepth; } - int a_body1cont6(Void && _,int loopDepth) - { - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_3 = self->file->appendStringRefWithLen(self->lastKey); - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; +}; + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future decryptImpl( Database const& cx, std::variant const& headerVariant, const uint8_t* const& dataP, int64_t const& dataLen, Arena* const& arena ) { + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new DecryptImplActor(cx, headerVariant, dataP, dataLen, arena)); + #line 2698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} - return loopDepth; - } - int a_body1cont3when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont6(_, loopDepth); +#line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return loopDepth; + static Future decrypt(Database cx, + std::variant header, + const uint8_t* dataP, + int64_t dataLen, + Arena* arena) { + return decryptImpl(cx, header, dataP, dataLen, arena); } - int a_body1cont3when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont6(std::move(_), loopDepth); - return loopDepth; - } - void a_exitChoose3() + #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via refreshKey() + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class RefreshKeyActorState { + #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + RefreshKeyActorState(EncryptedRangeFileWriter* const& self,EncryptCipherDomainId const& domainId) + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : self(self), + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + domainId(domainId) + #line 2726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< NewBlockActor, 2, Void >::remove(); + fdb_probe_actor_create("refreshKey", reinterpret_cast(this)); } - void a_callback_fire(ActorCallback< NewBlockActor, 2, Void >*,Void const& value) + ~RefreshKeyActorState() { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 2); + fdb_probe_actor_destroy("refreshKey", reinterpret_cast(this)); } - void a_callback_fire(ActorCallback< NewBlockActor, 2, Void >*,Void && value) + int a_body1(int loopDepth=0) { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 2); - a_exitChoose3(); try { - a_body1cont3when1(std::move(value), 0); + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference const> dbInfo = self->cx->clientInfo; + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = GetEncryptCipherKeys::getLatestEncryptCipherKeysForDomain( dbInfo, domainId, BlobCipherMetrics::BACKUP); + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 2); + return loopDepth; } - void a_callback_error(ActorCallback< NewBlockActor, 2, Void >*,Error err) + int a_body1Catch1(Error error,int loopDepth=0) { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 2); + this->~RefreshKeyActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + return loopDepth; } - int a_body1cont7(Void const& _,int loopDepth) + int a_body1cont1(TextAndHeaderCipherKeys const& cipherKeys,int loopDepth) { - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = self->file->appendStringRefWithLen(self->lastValue); - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont7when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(cipherKeys.cipherTextKey); this->~RefreshKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 2773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(cipherKeys.cipherTextKey); + this->~RefreshKeyActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont7(Void && _,int loopDepth) + int a_body1cont1(TextAndHeaderCipherKeys && cipherKeys,int loopDepth) { - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = self->file->appendStringRefWithLen(self->lastValue); - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont7when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(cipherKeys.cipherTextKey); this->~RefreshKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 2785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(cipherKeys.cipherTextKey); + this->~RefreshKeyActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont6when1(Void const& _,int loopDepth) + int a_body1when1(TextAndHeaderCipherKeys const& cipherKeys,int loopDepth) { - loopDepth = a_body1cont7(_, loopDepth); + loopDepth = a_body1cont1(cipherKeys, loopDepth); return loopDepth; } - int a_body1cont6when1(Void && _,int loopDepth) + int a_body1when1(TextAndHeaderCipherKeys && cipherKeys,int loopDepth) { - loopDepth = a_body1cont7(std::move(_), loopDepth); + loopDepth = a_body1cont1(std::move(cipherKeys), loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< NewBlockActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RefreshKeyActor, 0, TextAndHeaderCipherKeys >::remove(); } - void a_callback_fire(ActorCallback< NewBlockActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< RefreshKeyActor, 0, TextAndHeaderCipherKeys >*,TextAndHeaderCipherKeys const& value) { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("refreshKey", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont6when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 3); + fdb_probe_actor_exit("refreshKey", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< NewBlockActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< RefreshKeyActor, 0, TextAndHeaderCipherKeys >*,TextAndHeaderCipherKeys && value) { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("refreshKey", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont6when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 3); + fdb_probe_actor_exit("refreshKey", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< NewBlockActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< RefreshKeyActor, 0, TextAndHeaderCipherKeys >*,Error err) { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("refreshKey", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1Catch1(err, 0); } @@ -2542,123 +2850,40 @@ class NewBlockActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 3); - - } - int a_body1cont8(Void const& _,int loopDepth) - { - loopDepth = a_body1cont5(loopDepth); + fdb_probe_actor_exit("refreshKey", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1cont8(Void && _,int loopDepth) - { - loopDepth = a_body1cont5(loopDepth); - - return loopDepth; - } - int a_body1cont7when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont8(_, loopDepth); - - return loopDepth; - } - int a_body1cont7when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont8(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose5() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< NewBlockActor, 4, Void >::remove(); - - } - void a_callback_fire(ActorCallback< NewBlockActor, 4, Void >*,Void const& value) - { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont7when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 4); - - } - void a_callback_fire(ActorCallback< NewBlockActor, 4, Void >*,Void && value) - { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont7when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 4); - - } - void a_callback_error(ActorCallback< NewBlockActor, 4, Void >*,Error err) - { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 4); - - } - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - RangeFileWriter* self; - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int bytesNeeded; - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bool final; - #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Value paddingFFs; - #line 2631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptedRangeFileWriter* self; + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptCipherDomainId domainId; + #line 2860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via newBlock() - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class NewBlockActor final : public Actor, public ActorCallback< NewBlockActor, 0, Void >, public ActorCallback< NewBlockActor, 1, Void >, public ActorCallback< NewBlockActor, 2, Void >, public ActorCallback< NewBlockActor, 3, Void >, public ActorCallback< NewBlockActor, 4, Void >, public FastAllocated, public NewBlockActorState { - #line 2636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via refreshKey() + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class RefreshKeyActor final : public Actor>, public ActorCallback< RefreshKeyActor, 0, TextAndHeaderCipherKeys >, public FastAllocated, public RefreshKeyActorState { + #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< NewBlockActor, 0, Void >; -friend struct ActorCallback< NewBlockActor, 1, Void >; -friend struct ActorCallback< NewBlockActor, 2, Void >; -friend struct ActorCallback< NewBlockActor, 3, Void >; -friend struct ActorCallback< NewBlockActor, 4, Void >; - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - NewBlockActor(RangeFileWriter* const& self,int const& bytesNeeded,bool const& final = false) - #line 2651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor(), - NewBlockActorState(self, bytesNeeded, final) +friend struct ActorCallback< RefreshKeyActor, 0, TextAndHeaderCipherKeys >; + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + RefreshKeyActor(EncryptedRangeFileWriter* const& self,EncryptCipherDomainId const& domainId) + #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor>(), + RefreshKeyActorState(self, domainId) { - fdb_probe_actor_enter("newBlock", reinterpret_cast(this), -1); + fdb_probe_actor_enter("refreshKey", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("newBlock"); + this->lineage.setActorName("refreshKey"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("newBlock", reinterpret_cast(this), -1); + fdb_probe_actor_exit("refreshKey", reinterpret_cast(this), -1); } void cancel() override @@ -2666,84 +2891,68 @@ friend struct ActorCallback< NewBlockActor, 4, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< NewBlockActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< NewBlockActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< NewBlockActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< NewBlockActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< NewBlockActor, 4, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< RefreshKeyActor, 0, TextAndHeaderCipherKeys >*)0, actor_cancelled()); break; } } }; - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future newBlock( RangeFileWriter* const& self, int const& bytesNeeded, bool const& final = false ) { - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new NewBlockActor(self, bytesNeeded, final)); - #line 2682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future> refreshKey( EncryptedRangeFileWriter* const& self, EncryptCipherDomainId const& domainId ) { + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future>(new RefreshKeyActor(self, domainId)); + #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - - // Used in simulation only to create backup file sizes which are an integer multiple of the block size - Future padEnd() { - ASSERT(g_network->isSimulated()); - if (file->size() > 0) { - return newBlock(this, 0, true); - } - return Void(); - } - - // Ends the current block if necessary based on bytesNeeded. - Future newBlockIfNeeded(int bytesNeeded) { - if (file->size() + bytesNeeded > blockEnd) - return newBlock(this, bytesNeeded); - return Void(); - } +#line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - // Start a new block if needed, then write the key and value - #line 2704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via writeKV_impl() - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class WriteKV_implActorState { - #line 2710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 2908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via encrypt() + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class EncryptActorState { + #line 2914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - WriteKV_implActorState(RangeFileWriter* const& self,Key const& k,Value const& v) - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : self(self), - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - k(k), - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - v(v) - #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptActorState(EncryptedRangeFileWriter* const& self) + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : self(self) + #line 2921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("writeKV_impl", reinterpret_cast(this)); + fdb_probe_actor_create("encrypt", reinterpret_cast(this)); } - ~WriteKV_implActorState() + ~EncryptActorState() { - fdb_probe_actor_destroy("writeKV_impl", reinterpret_cast(this)); + fdb_probe_actor_destroy("encrypt", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int toWrite = sizeof(int32_t) + k.size() + sizeof(int32_t) + v.size(); - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = self->newBlockIfNeeded(toWrite); - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(self->cipherKeys.headerCipherKey.present() && self->cipherKeys.headerCipherKey.get().isValid() && self->cipherKeys.textCipherKey.isValid()); + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (self->cipherKeys.headerCipherKey.get()->isExpired() || self->cipherKeys.headerCipherKey.get()->needsRefresh()) + #line 2938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_0 = refreshKey(self, self->cipherKeys.headerCipherKey.get()->getDomainId()); + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -2755,65 +2964,76 @@ class WriteKV_implActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~WriteKV_implActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~EncryptActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(Void const& _,int loopDepth) + int a_body1cont1(int loopDepth) { - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = self->file->appendStringRefWithLen(k); - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (self->cipherKeys.textCipherKey->isExpired() || self->cipherKeys.textCipherKey->needsRefresh()) + #line 2977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_1 = refreshKey(self, self->cipherKeys.textCipherKey->getDomainId()); + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont4(loopDepth); + } return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1cont2(Reference const& cipherKey,int loopDepth) { - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = self->file->appendStringRefWithLen(k); - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->cipherKeys.headerCipherKey = cipherKey; + #line 3002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1cont2(Reference && cipherKey,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->cipherKeys.headerCipherKey = cipherKey; + #line 3011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1when1(Reference const& cipherKey,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont2(cipherKey, loopDepth); + + return loopDepth; + } + int a_body1when1(Reference && cipherKey,int loopDepth) + { + loopDepth = a_body1cont2(std::move(cipherKey), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteKV_implActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< EncryptActor, 0, Reference >::remove(); } - void a_callback_fire(ActorCallback< WriteKV_implActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< EncryptActor, 0, Reference >*,Reference const& value) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); + fdb_probe_actor_enter("encrypt", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -2823,12 +3043,12 @@ class WriteKV_implActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); + fdb_probe_actor_exit("encrypt", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< WriteKV_implActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< EncryptActor, 0, Reference >*,Reference && value) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); + fdb_probe_actor_enter("encrypt", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -2838,12 +3058,12 @@ class WriteKV_implActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); + fdb_probe_actor_exit("encrypt", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< WriteKV_implActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< EncryptActor, 0, Reference >*,Error err) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); + fdb_probe_actor_enter("encrypt", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -2853,62 +3073,100 @@ class WriteKV_implActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); + fdb_probe_actor_exit("encrypt", reinterpret_cast(this), 0); } - int a_body1cont2(Void const& _,int loopDepth) + int a_body1cont4(int loopDepth) { - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = self->file->appendStringRefWithLen(v); - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptBlobCipherAes265Ctr encryptor( self->cipherKeys.textCipherKey, self->cipherKeys.headerCipherKey, self->cipherKeys.ivRef.begin(), AES_256_IV_LENGTH, getEncryptAuthTokenMode(EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE), BlobCipherMetrics::BACKUP); + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t payloadSize = self->wPtr - self->dataPayloadStart; + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StringRef encryptedData; + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (self->options.configurableEncryptionEnabled) + #line 3089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + BlobCipherEncryptHeaderRef headerRef; + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptedData = encryptor.encrypt(self->dataPayloadStart, payloadSize, &headerRef, *self->arena); + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Standalone serialized = BlobCipherEncryptHeaderRef::toStringRef(headerRef); + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->arena->dependsOn(serialized.arena()); + #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(serialized.size() == self->encryptHeader.size()); + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::memcpy(mutateString(self->encryptHeader), serialized.begin(), self->encryptHeader.size()); + #line 3103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + else + { + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + BlobCipherEncryptHeader header; + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptedData = encryptor.encrypt(self->dataPayloadStart, payloadSize, &header, *self->arena)->toStringRef(); + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StringRef encryptHeaderStringRef = BlobCipherEncryptHeader::toStringRef(header, *self->arena); + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(encryptHeaderStringRef.size() == self->encryptHeader.size()); + #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::memcpy(mutateString(self->encryptHeader), encryptHeaderStringRef.begin(), self->encryptHeader.size()); + #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::memcpy(self->dataPayloadStart, encryptedData.begin(), payloadSize); + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~EncryptActorState(); static_cast(this)->destroy(); return 0; } + #line 3123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~EncryptActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont2(Void && _,int loopDepth) + int a_body1cont5(Reference const& cipherKey,int loopDepth) { - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = self->file->appendStringRefWithLen(v); - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->cipherKeys.textCipherKey = cipherKey; + #line 3135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont4(loopDepth); return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1cont5(Reference && cipherKey,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->cipherKeys.textCipherKey = cipherKey; + #line 3144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont4(loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1cont1when1(Reference const& cipherKey,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont5(cipherKey, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Reference && cipherKey,int loopDepth) + { + loopDepth = a_body1cont5(std::move(cipherKey), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteKV_implActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< EncryptActor, 1, Reference >::remove(); } - void a_callback_fire(ActorCallback< WriteKV_implActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< EncryptActor, 1, Reference >*,Reference const& value) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); + fdb_probe_actor_enter("encrypt", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -2918,12 +3176,12 @@ class WriteKV_implActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); + fdb_probe_actor_exit("encrypt", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< WriteKV_implActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< EncryptActor, 1, Reference >*,Reference && value) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); + fdb_probe_actor_enter("encrypt", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -2933,12 +3191,12 @@ class WriteKV_implActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); + fdb_probe_actor_exit("encrypt", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< WriteKV_implActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< EncryptActor, 1, Reference >*,Error err) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); + fdb_probe_actor_enter("encrypt", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -2948,139 +3206,39 @@ class WriteKV_implActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); - - } - int a_body1cont3(Void const& _,int loopDepth) - { - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - self->lastKey = k; - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - self->lastValue = v; - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKV_implActorState(); static_cast(this)->destroy(); return 0; } - #line 2962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~WriteKV_implActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont3(Void && _,int loopDepth) - { - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - self->lastKey = k; - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - self->lastValue = v; - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKV_implActorState(); static_cast(this)->destroy(); return 0; } - #line 2978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~WriteKV_implActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont2when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1cont2when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteKV_implActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< WriteKV_implActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont2when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< WriteKV_implActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< WriteKV_implActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); + fdb_probe_actor_exit("encrypt", reinterpret_cast(this), 1); } - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - RangeFileWriter* self; - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key k; - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Value v; - #line 3055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptedRangeFileWriter* self; + #line 3214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via writeKV_impl() - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class WriteKV_implActor final : public Actor, public ActorCallback< WriteKV_implActor, 0, Void >, public ActorCallback< WriteKV_implActor, 1, Void >, public ActorCallback< WriteKV_implActor, 2, Void >, public FastAllocated, public WriteKV_implActorState { - #line 3060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via encrypt() + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class EncryptActor final : public Actor, public ActorCallback< EncryptActor, 0, Reference >, public ActorCallback< EncryptActor, 1, Reference >, public FastAllocated, public EncryptActorState { + #line 3219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< WriteKV_implActor, 0, Void >; -friend struct ActorCallback< WriteKV_implActor, 1, Void >; -friend struct ActorCallback< WriteKV_implActor, 2, Void >; - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - WriteKV_implActor(RangeFileWriter* const& self,Key const& k,Value const& v) - #line 3073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +friend struct ActorCallback< EncryptActor, 0, Reference >; +friend struct ActorCallback< EncryptActor, 1, Reference >; + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptActor(EncryptedRangeFileWriter* const& self) + #line 3231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), - WriteKV_implActorState(self, k, v) + EncryptActorState(self) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), -1); + fdb_probe_actor_enter("encrypt", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("writeKV_impl"); + this->lineage.setActorName("encrypt"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), -1); + fdb_probe_actor_exit("encrypt", reinterpret_cast(this), -1); } void cancel() override @@ -3088,65 +3246,61 @@ friend struct ActorCallback< WriteKV_implActor, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< WriteKV_implActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< WriteKV_implActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< WriteKV_implActor, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< EncryptActor, 0, Reference >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< EncryptActor, 1, Reference >*)0, actor_cancelled()); break; } } }; - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future writeKV_impl( RangeFileWriter* const& self, Key const& k, Value const& v ) { - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new WriteKV_implActor(self, k, v)); - #line 3102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future encrypt( EncryptedRangeFileWriter* const& self ) { + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new EncryptActor(self)); + #line 3259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Future writeKV(Key k, Value v) { return writeKV_impl(this, k, v); } - - // Write begin key or end key. - #line 3110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via writeKey_impl() - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class WriteKey_implActorState { - #line 3116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via updateEncryptionKeysCtx() + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class UpdateEncryptionKeysCtxActorState { + #line 3270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - WriteKey_implActorState(RangeFileWriter* const& self,Key const& k) - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + UpdateEncryptionKeysCtxActorState(EncryptedRangeFileWriter* const& self,KeyRef const& key,SnapshotBackupUseTenantCache const& checkTenantCache) + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : self(self), - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - k(k) - #line 3125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + key(key), + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + checkTenantCache(checkTenantCache) + #line 3281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("writeKey_impl", reinterpret_cast(this)); + fdb_probe_actor_create("updateEncryptionKeysCtx", reinterpret_cast(this)); } - ~WriteKey_implActorState() + ~UpdateEncryptionKeysCtxActorState() { - fdb_probe_actor_destroy("writeKey_impl", reinterpret_cast(this)); + fdb_probe_actor_destroy("updateEncryptionKeysCtx", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int toWrite = sizeof(uint32_t) + k.size(); - #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = self->newBlockIfNeeded(toWrite); - #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = getEncryptionDomainDetails(key, self->encryptMode, self->tenantCache, checkTenantCache); + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3159,65 +3313,55 @@ class WriteKey_implActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~WriteKey_implActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) - { - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = self->file->appendStringRefWithLen(k); - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + this->~UpdateEncryptionKeysCtxActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1cont1(int loopDepth) { - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = self->file->appendStringRefWithLen(k); - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + dbInfo = self->cx->clientInfo; + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = GetEncryptCipherKeys::getLatestEncryptCipherKeysForDomain( dbInfo, curDomainId, BlobCipherMetrics::BACKUP); + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1when1(EncryptCipherDomainId const& __curDomainId,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + curDomainId = __curDomainId; + #line 3344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1when1(EncryptCipherDomainId && __curDomainId,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + curDomainId = std::move(__curDomainId); + loopDepth = a_body1cont1(loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteKey_implActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< UpdateEncryptionKeysCtxActor, 0, EncryptCipherDomainId >::remove(); } - void a_callback_fire(ActorCallback< WriteKey_implActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< UpdateEncryptionKeysCtxActor, 0, EncryptCipherDomainId >*,EncryptCipherDomainId const& value) { - fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 0); + fdb_probe_actor_enter("updateEncryptionKeysCtx", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -3227,12 +3371,12 @@ class WriteKey_implActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 0); + fdb_probe_actor_exit("updateEncryptionKeysCtx", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< WriteKey_implActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< UpdateEncryptionKeysCtxActor, 0, EncryptCipherDomainId >*,EncryptCipherDomainId && value) { - fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 0); + fdb_probe_actor_enter("updateEncryptionKeysCtx", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -3242,12 +3386,12 @@ class WriteKey_implActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 0); + fdb_probe_actor_exit("updateEncryptionKeysCtx", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< WriteKey_implActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< UpdateEncryptionKeysCtxActor, 0, EncryptCipherDomainId >*,Error err) { - fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 0); + fdb_probe_actor_enter("updateEncryptionKeysCtx", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -3257,54 +3401,70 @@ class WriteKey_implActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 0); + fdb_probe_actor_exit("updateEncryptionKeysCtx", reinterpret_cast(this), 0); } - int a_body1cont2(Void const& _,int loopDepth) + int a_body1cont2(TextAndHeaderCipherKeys const& textAndHeaderCipherKeys,int loopDepth) { - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKey_implActorState(); static_cast(this)->destroy(); return 0; } - #line 3267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~WriteKey_implActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->cipherKeys.textCipherKey = textAndHeaderCipherKeys.cipherTextKey; + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->cipherKeys.headerCipherKey = textAndHeaderCipherKeys.cipherHeaderKey; + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->cipherKeys.ivRef = makeString(AES_256_IV_LENGTH, *self->arena); + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + deterministicRandom()->randomBytes(mutateString(self->cipherKeys.ivRef), AES_256_IV_LENGTH); + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateEncryptionKeysCtxActorState(); static_cast(this)->destroy(); return 0; } + #line 3419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~UpdateEncryptionKeysCtxActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1cont2(Void && _,int loopDepth) + int a_body1cont2(TextAndHeaderCipherKeys && textAndHeaderCipherKeys,int loopDepth) { - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKey_implActorState(); static_cast(this)->destroy(); return 0; } - #line 3279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~WriteKey_implActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->cipherKeys.textCipherKey = textAndHeaderCipherKeys.cipherTextKey; + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->cipherKeys.headerCipherKey = textAndHeaderCipherKeys.cipherHeaderKey; + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->cipherKeys.ivRef = makeString(AES_256_IV_LENGTH, *self->arena); + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + deterministicRandom()->randomBytes(mutateString(self->cipherKeys.ivRef), AES_256_IV_LENGTH); + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateEncryptionKeysCtxActorState(); static_cast(this)->destroy(); return 0; } + #line 3439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~UpdateEncryptionKeysCtxActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1cont1when1(TextAndHeaderCipherKeys const& textAndHeaderCipherKeys,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + loopDepth = a_body1cont2(textAndHeaderCipherKeys, loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1cont1when1(TextAndHeaderCipherKeys && textAndHeaderCipherKeys,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont2(std::move(textAndHeaderCipherKeys), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteKey_implActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< UpdateEncryptionKeysCtxActor, 1, TextAndHeaderCipherKeys >::remove(); } - void a_callback_fire(ActorCallback< WriteKey_implActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< UpdateEncryptionKeysCtxActor, 1, TextAndHeaderCipherKeys >*,TextAndHeaderCipherKeys const& value) { - fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 1); + fdb_probe_actor_enter("updateEncryptionKeysCtx", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -3314,12 +3474,12 @@ class WriteKey_implActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 1); + fdb_probe_actor_exit("updateEncryptionKeysCtx", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< WriteKey_implActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< UpdateEncryptionKeysCtxActor, 1, TextAndHeaderCipherKeys >*,TextAndHeaderCipherKeys && value) { - fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 1); + fdb_probe_actor_enter("updateEncryptionKeysCtx", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -3329,12 +3489,12 @@ class WriteKey_implActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 1); + fdb_probe_actor_exit("updateEncryptionKeysCtx", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< WriteKey_implActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< UpdateEncryptionKeysCtxActor, 1, TextAndHeaderCipherKeys >*,Error err) { - fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 1); + fdb_probe_actor_enter("updateEncryptionKeysCtx", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -3344,41 +3504,47 @@ class WriteKey_implActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 1); + fdb_probe_actor_exit("updateEncryptionKeysCtx", reinterpret_cast(this), 1); } - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - RangeFileWriter* self; - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key k; - #line 3354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptedRangeFileWriter* self; + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRef key; + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + SnapshotBackupUseTenantCache checkTenantCache; + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptCipherDomainId curDomainId; + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference const> dbInfo; + #line 3520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via writeKey_impl() - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class WriteKey_implActor final : public Actor, public ActorCallback< WriteKey_implActor, 0, Void >, public ActorCallback< WriteKey_implActor, 1, Void >, public FastAllocated, public WriteKey_implActorState { - #line 3359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via updateEncryptionKeysCtx() + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class UpdateEncryptionKeysCtxActor final : public Actor, public ActorCallback< UpdateEncryptionKeysCtxActor, 0, EncryptCipherDomainId >, public ActorCallback< UpdateEncryptionKeysCtxActor, 1, TextAndHeaderCipherKeys >, public FastAllocated, public UpdateEncryptionKeysCtxActorState { + #line 3525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< WriteKey_implActor, 0, Void >; -friend struct ActorCallback< WriteKey_implActor, 1, Void >; - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - WriteKey_implActor(RangeFileWriter* const& self,Key const& k) - #line 3371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +friend struct ActorCallback< UpdateEncryptionKeysCtxActor, 0, EncryptCipherDomainId >; +friend struct ActorCallback< UpdateEncryptionKeysCtxActor, 1, TextAndHeaderCipherKeys >; + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + UpdateEncryptionKeysCtxActor(EncryptedRangeFileWriter* const& self,KeyRef const& key,SnapshotBackupUseTenantCache const& checkTenantCache) + #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), - WriteKey_implActorState(self, k) + UpdateEncryptionKeysCtxActorState(self, key, checkTenantCache) { - fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), -1); + fdb_probe_actor_enter("updateEncryptionKeysCtx", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("writeKey_impl"); + this->lineage.setActorName("updateEncryptionKeysCtx"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), -1); + fdb_probe_actor_exit("updateEncryptionKeysCtx", reinterpret_cast(this), -1); } void cancel() override @@ -3386,222 +3552,211 @@ friend struct ActorCallback< WriteKey_implActor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< WriteKey_implActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< WriteKey_implActor, 1, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< UpdateEncryptionKeysCtxActor, 0, EncryptCipherDomainId >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< UpdateEncryptionKeysCtxActor, 1, TextAndHeaderCipherKeys >*)0, actor_cancelled()); break; } } }; - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future writeKey_impl( RangeFileWriter* const& self, Key const& k ) { - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new WriteKey_implActor(self, k)); - #line 3399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -} - -#line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - - Future writeKey(Key k) { return writeKey_impl(this, k); } - - Reference file; - int blockSize; - -private: - int64_t blockEnd; - uint32_t fileVersion; - Key lastKey; - Key lastValue; -}; - -static Reference getBackupContainerWithProxy(Reference _bc) { - Reference bc = IBackupContainer::openContainer(_bc->getURL(), fileBackupAgentProxy, {}); - return bc; + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future updateEncryptionKeysCtx( EncryptedRangeFileWriter* const& self, KeyRef const& key, SnapshotBackupUseTenantCache const& checkTenantCache ) { + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new UpdateEncryptionKeysCtxActor(self, key, checkTenantCache)); + #line 3565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -Standalone> decodeRangeFileBlock(const Standalone& buf) { - Standalone> results({}, buf.arena()); - StringRefReader reader(buf, restore_corrupted_data()); - - // Read header, currently only decoding BACKUP_AGENT_SNAPSHOT_FILE_VERSION - if (reader.consume() != BACKUP_AGENT_SNAPSHOT_FILE_VERSION) - throw restore_unsupported_file_version(); +#line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - // Read begin key, if this fails then block was invalid. - uint32_t kLen = reader.consumeNetworkUInt32(); - const uint8_t* k = reader.consume(kLen); - results.push_back(results.arena(), KeyValueRef(KeyRef(k, kLen), ValueRef())); + // Returns the number of bytes that have been written to the buffer + static int64_t currentBufferSize(EncryptedRangeFileWriter* self) { return self->wPtr - self->buffer.begin(); } - // Read kv pairs and end key - while (1) { - // Read a key. - kLen = reader.consumeNetworkUInt32(); - k = reader.consume(kLen); + static int64_t expectedFileSize(EncryptedRangeFileWriter* self) { + // Return what has already been written to file plus the size of the current buffer + // which indicates how many bytes the file will contain once the buffer is written + return self->file->size() + currentBufferSize(self); + } - // If eof reached or first value len byte is 0xFF then a valid block end was reached. - if (reader.eof() || *reader.rptr == 0xFF) { - results.push_back(results.arena(), KeyValueRef(KeyRef(k, kLen), ValueRef())); - break; + static void copyToBuffer(EncryptedRangeFileWriter* self, const void* src, size_t size) { + if (size > 0) { + std::memcpy(self->wPtr, src, size); + self->wPtr += size; + ASSERT(currentBufferSize(self) <= self->blockSize); } - - // Read a value, which must exist or the block is invalid - uint32_t vLen = reader.consumeNetworkUInt32(); - const uint8_t* v = reader.consume(vLen); - results.push_back(results.arena(), KeyValueRef(KeyRef(k, kLen), ValueRef(v, vLen))); - - // If eof reached or first byte of next key len is 0xFF then a valid block end was reached. - if (reader.eof() || *reader.rptr == 0xFF) - break; } - // Make sure any remaining bytes in the block are 0xFF - for (auto b : reader.remainder()) - if (b != 0xFF) - throw restore_corrupted_data_padding(); - - return results; -} + static void appendStringRefWithLenToBuffer(EncryptedRangeFileWriter* self, StringRef* s) { + // Append the string length followed by the string to the buffer + uint32_t lenBuf = bigEndian32((uint32_t)s->size()); + copyToBuffer(self, &lenBuf, sizeof(lenBuf)); + copyToBuffer(self, s->begin(), s->size()); + } - #line 3464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via decodeRangeFileBlock() - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class DecodeRangeFileBlockActorState { - #line 3470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via getEncryptionDomainDetails() + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class GetEncryptionDomainDetailsActorState { + #line 3600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - DecodeRangeFileBlockActorState(Reference const& file,int64_t const& offset,int const& len) - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : file(file), - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - offset(offset), - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - len(len), - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - buf(makeString(len)) - #line 3483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + GetEncryptionDomainDetailsActorState(KeyRef const& key,EncryptionAtRestMode const& encryptMode,Optional>> const& tenantCache,SnapshotBackupUseTenantCache const& checkTenantCache) + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : key(key), + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptMode(encryptMode), + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tenantCache(tenantCache), + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + checkTenantCache(checkTenantCache) + #line 3613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("decodeRangeFileBlock", reinterpret_cast(this)); + fdb_probe_actor_create("getEncryptionDomainDetails", reinterpret_cast(this)); } - ~DecodeRangeFileBlockActorState() + ~GetEncryptionDomainDetailsActorState() { - fdb_probe_actor_destroy("decodeRangeFileBlock", reinterpret_cast(this)); + fdb_probe_actor_destroy("getEncryptionDomainDetails", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = uncancellable(holdWhile(buf, file->read(mutateString(buf), len, offset))); - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~DecodeRangeFileBlockActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(int const& rLen,int loopDepth) - { - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (rLen != len) - #line 3528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(restore_bad_read(), loopDepth); - #line 3532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - simulateBlobFailure(); - #line 3536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - try { - #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV>>::futures) { (void)(decodeRangeFileBlock(buf)); this->~DecodeRangeFileBlockActorState(); static_cast(this)->destroy(); return 0; } - #line 3540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(decodeRangeFileBlock(buf)); - this->~DecodeRangeFileBlockActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (isSystemKey(key)) + #line 3628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(SYSTEM_KEYSPACE_ENCRYPT_DOMAIN_ID); this->~GetEncryptionDomainDetailsActorState(); static_cast(this)->destroy(); return 0; } + #line 3632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< EncryptCipherDomainId >::value()) EncryptCipherDomainId(SYSTEM_KEYSPACE_ENCRYPT_DOMAIN_ID); + this->~GetEncryptionDomainDetailsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (key.size() < TenantAPI::PREFIX_SIZE || encryptMode.mode == EncryptionAtRestMode::CLUSTER_AWARE) + #line 3640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(FDB_DEFAULT_ENCRYPT_DOMAIN_ID); this->~GetEncryptionDomainDetailsActorState(); static_cast(this)->destroy(); return 0; } + #line 3644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< EncryptCipherDomainId >::value()) EncryptCipherDomainId(FDB_DEFAULT_ENCRYPT_DOMAIN_ID); + this->~GetEncryptionDomainDetailsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRef tenantPrefix = KeyRef(key.begin(), TenantAPI::PREFIX_SIZE); + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tenantId = TenantAPI::prefixToId(tenantPrefix); + #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (checkTenantCache && tenantCache.present()) + #line 3656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture>> __when_expr_0 = tenantCache.get()->getById(tenantId); + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 3667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont1(int && rLen,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (rLen != len) - #line 3558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + this->~GetEncryptionDomainDetailsActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(tenantId); this->~GetEncryptionDomainDetailsActorState(); static_cast(this)->destroy(); return 0; } + #line 3695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< EncryptCipherDomainId >::value()) EncryptCipherDomainId(std::move(tenantId)); // state_var_RVO + this->~GetEncryptionDomainDetailsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont4(Optional> const& payload,int loopDepth) + { + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!payload.present()) + #line 3707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(restore_bad_read(), loopDepth); - #line 3562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - simulateBlobFailure(); - #line 3566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - try { - #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV>>::futures) { (void)(decodeRangeFileBlock(buf)); this->~DecodeRangeFileBlockActorState(); static_cast(this)->destroy(); return 0; } - #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(decodeRangeFileBlock(buf)); - this->~DecodeRangeFileBlockActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(FDB_DEFAULT_ENCRYPT_DOMAIN_ID); this->~GetEncryptionDomainDetailsActorState(); static_cast(this)->destroy(); return 0; } + #line 3711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< EncryptCipherDomainId >::value()) EncryptCipherDomainId(FDB_DEFAULT_ENCRYPT_DOMAIN_ID); + this->~GetEncryptionDomainDetailsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont4(Optional> && payload,int loopDepth) + { + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!payload.present()) + #line 3725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(FDB_DEFAULT_ENCRYPT_DOMAIN_ID); this->~GetEncryptionDomainDetailsActorState(); static_cast(this)->destroy(); return 0; } + #line 3729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< EncryptCipherDomainId >::value()) EncryptCipherDomainId(FDB_DEFAULT_ENCRYPT_DOMAIN_ID); + this->~GetEncryptionDomainDetailsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1when1(int const& rLen,int loopDepth) + int a_body1when1(Optional> const& payload,int loopDepth) { - loopDepth = a_body1cont1(rLen, loopDepth); + loopDepth = a_body1cont4(payload, loopDepth); return loopDepth; } - int a_body1when1(int && rLen,int loopDepth) + int a_body1when1(Optional> && payload,int loopDepth) { - loopDepth = a_body1cont1(std::move(rLen), loopDepth); + loopDepth = a_body1cont4(std::move(payload), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DecodeRangeFileBlockActor, 0, int >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetEncryptionDomainDetailsActor, 0, Optional> >::remove(); } - void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 0, int >*,int const& value) + void a_callback_fire(ActorCallback< GetEncryptionDomainDetailsActor, 0, Optional> >*,Optional> const& value) { - fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getEncryptionDomainDetails", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -3611,12 +3766,12 @@ class DecodeRangeFileBlockActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getEncryptionDomainDetails", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 0, int >*,int && value) + void a_callback_fire(ActorCallback< GetEncryptionDomainDetailsActor, 0, Optional> >*,Optional> && value) { - fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getEncryptionDomainDetails", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -3626,12 +3781,12 @@ class DecodeRangeFileBlockActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getEncryptionDomainDetails", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< DecodeRangeFileBlockActor, 0, int >*,Error err) + void a_callback_error(ActorCallback< GetEncryptionDomainDetailsActor, 0, Optional> >*,Error err) { - fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getEncryptionDomainDetails", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -3641,61 +3796,46 @@ class DecodeRangeFileBlockActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 0); - - } - int a_body1cont1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevWarn, "FileRestoreDecodeRangeFileBlockFailed") .error(e) .detail("Filename", file->getFilename()) .detail("BlockOffset", offset) .detail("BlockLen", len); - #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(e, loopDepth); - #line 3654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } + fdb_probe_actor_exit("getEncryptionDomainDetails", reinterpret_cast(this), 0); - return loopDepth; } - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference file; - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int64_t offset; - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int len; - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Standalone buf; - #line 3672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRef key; + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptionAtRestMode encryptMode; + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional>> tenantCache; + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + SnapshotBackupUseTenantCache checkTenantCache; + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t tenantId; + #line 3812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via decodeRangeFileBlock() - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class DecodeRangeFileBlockActor final : public Actor>>, public ActorCallback< DecodeRangeFileBlockActor, 0, int >, public FastAllocated, public DecodeRangeFileBlockActorState { - #line 3677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via getEncryptionDomainDetails() + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class GetEncryptionDomainDetailsActor final : public Actor, public ActorCallback< GetEncryptionDomainDetailsActor, 0, Optional> >, public FastAllocated, public GetEncryptionDomainDetailsActorState { + #line 3817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< DecodeRangeFileBlockActor, 0, int >; - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - DecodeRangeFileBlockActor(Reference const& file,int64_t const& offset,int const& len) - #line 3688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor>>(), - DecodeRangeFileBlockActorState(file, offset, len) +friend struct ActorCallback< GetEncryptionDomainDetailsActor, 0, Optional> >; + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + GetEncryptionDomainDetailsActor(KeyRef const& key,EncryptionAtRestMode const& encryptMode,Optional>> const& tenantCache,SnapshotBackupUseTenantCache const& checkTenantCache) + #line 3828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + GetEncryptionDomainDetailsActorState(key, encryptMode, tenantCache, checkTenantCache) { - fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), -1); + fdb_probe_actor_enter("getEncryptionDomainDetails", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("decodeRangeFileBlock"); + this->lineage.setActorName("getEncryptionDomainDetails"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), -1); + fdb_probe_actor_exit("getEncryptionDomainDetails", reinterpret_cast(this), -1); } void cancel() override @@ -3703,87 +3843,87 @@ friend struct ActorCallback< DecodeRangeFileBlockActor, 0, int >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< DecodeRangeFileBlockActor, 0, int >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetEncryptionDomainDetailsActor, 0, Optional> >*)0, actor_cancelled()); break; } } }; - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] Future>> decodeRangeFileBlock( Reference const& file, int64_t const& offset, int const& len ) { - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future>>(new DecodeRangeFileBlockActor(file, offset, len)); - #line 3715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future getEncryptionDomainDetails( KeyRef const& key, EncryptionAtRestMode const& encryptMode, Optional>> const& tenantCache, SnapshotBackupUseTenantCache const& checkTenantCache ) { + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new GetEncryptionDomainDetailsActor(key, encryptMode, tenantCache, checkTenantCache)); + #line 3855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - -// Very simple format compared to KeyRange files. -// Header, [Key, Value]... Key len -struct LogFileWriter { - LogFileWriter(Reference file = Reference(), int blockSize = 0) - : file(file), blockSize(blockSize), blockEnd(0) {} +#line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - // Start a new block if needed, then write the key and value - #line 3727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via writeKV_impl() - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class WriteKV_implActor1State { - #line 3733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + // Handles the first block and internal blocks. Ends current block if needed. + // The final flag is used in simulation to pad the file's final block to a whole block size + #line 3862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via newBlock() + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class NewBlockActorState { + #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - WriteKV_implActor1State(LogFileWriter* const& self,Key const& k,Value const& v) - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + NewBlockActorState(EncryptedRangeFileWriter* const& self,int const& bytesNeeded,KeyRef const& lastKey,bool const& writeValue,bool const& final = false) + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : self(self), - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - k(k), - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - v(v) - #line 3744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bytesNeeded(bytesNeeded), + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + lastKey(lastKey), + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + writeValue(writeValue), + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + final(final) + #line 3883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("writeKV_impl", reinterpret_cast(this)); + fdb_probe_actor_create("newBlock", reinterpret_cast(this)); } - ~WriteKV_implActor1State() + ~NewBlockActorState() { - fdb_probe_actor_destroy("writeKV_impl", reinterpret_cast(this)); + fdb_probe_actor_destroy("newBlock", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int toWrite = sizeof(int32_t) + k.size() + sizeof(int32_t) + v.size(); - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (self->file->size() + toWrite > self->blockEnd) - #line 3761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int bytesLeft = self->blockEnd - expectedFileSize(self); + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(bytesLeft >= 0); + #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (bytesLeft > 0) + #line 3902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int bytesLeft = self->blockEnd - self->file->size(); - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (bytesLeft > 0) - #line 3767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - paddingFFs = makePadding(bytesLeft); - #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = self->file->append(paddingFFs.begin(), bytesLeft); - #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont2(loopDepth); - } + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + paddingFFs = makePadding(bytesLeft); + #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + copyToBuffer(self, paddingFFs.begin(), bytesLeft); + #line 3908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (expectedFileSize(self) > 0) + #line 3912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(currentBufferSize(self) == self->blockSize); + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = encrypt(self); + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } else { @@ -3800,55 +3940,132 @@ class WriteKV_implActor1State { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~WriteKV_implActor1State(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~NewBlockActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = self->file->appendStringRefWithLen(k); - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont2(int loopDepth) - { - #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (final) + #line 3953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(g_network->isSimulated()); + #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~NewBlockActorState(); static_cast(this)->destroy(); return 0; } + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~NewBlockActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" self->blockEnd += self->blockSize; - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = self->file->append((uint8_t*)&BACKUP_AGENT_MLOG_VERSION, sizeof(BACKUP_AGENT_MLOG_VERSION)); - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + copyToBuffer(self, (uint8_t*)&self->fileVersion, sizeof(self->fileVersion)); + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->options.configurableEncryptionEnabled = CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION; + #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Value serialized = ObjectWriter::toValue(self->options, IncludeVersion(ProtocolVersion::withEncryptedSnapshotBackupFile())); + #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + appendStringRefWithLenToBuffer(self, &serialized); + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + uint32_t headerSize = 0; + #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (self->options.configurableEncryptionEnabled) + #line 3979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptAuthTokenMode authTokenMode = getEncryptAuthTokenMode(EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE); + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptAuthTokenAlgo authTokenAlgo = getAuthTokenAlgoFromMode(authTokenMode); + #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + headerSize = BlobCipherEncryptHeaderRef::getHeaderSize( CLIENT_KNOBS->ENCRYPT_HEADER_FLAGS_VERSION, getEncryptCurrentAlgoHeaderVersion(authTokenMode, authTokenAlgo), ENCRYPT_CIPHER_MODE_AES_256_CTR, authTokenMode, authTokenAlgo); + #line 3987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + else + { + #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + headerSize = BlobCipherEncryptHeader::headerSize; + #line 3993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(headerSize > 0); + #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + copyToBuffer(self, (uint8_t*)&headerSize, sizeof(headerSize)); + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->encryptHeader = StringRef(self->wPtr, headerSize); + #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->wPtr += headerSize; + #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->dataPayloadStart = self->wPtr; + #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (self->blockEnd > self->blockSize) + #line 4007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + appendStringRefWithLenToBuffer(self, &lastKey); + #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + appendStringRefWithLenToBuffer(self, &self->lastKey); + #line 834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (writeValue) + #line 4015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + appendStringRefWithLenToBuffer(self, &self->lastValue); + #line 4019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + } + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (expectedFileSize(self) + bytesNeeded > self->blockEnd) + #line 4024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(backup_bad_block_size(), loopDepth); + #line 4028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~NewBlockActorState(); static_cast(this)->destroy(); return 0; } + #line 4032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~NewBlockActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } int a_body1cont3(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(loopDepth); + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = self->file->append(self->buffer.begin(), self->blockSize); + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont3when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - loopDepth = a_body1cont2(loopDepth); + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = self->file->append(self->buffer.begin(), self->blockSize); + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont3when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } @@ -3866,13 +4083,13 @@ class WriteKV_implActor1State { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteKV_implActor1, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< NewBlockActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< WriteKV_implActor1, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< NewBlockActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -3882,12 +4099,12 @@ class WriteKV_implActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< WriteKV_implActor1, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< NewBlockActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -3897,12 +4114,12 @@ class WriteKV_implActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< WriteKV_implActor1, 0, Void >*,Error err) + void a_callback_error(ActorCallback< NewBlockActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -3912,28 +4129,34 @@ class WriteKV_implActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 0); } int a_body1cont4(Void const& _,int loopDepth) { + #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->wPtr = mutateString(self->buffer); + #line 4139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } int a_body1cont4(Void && _,int loopDepth) { + #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->wPtr = mutateString(self->buffer); + #line 4148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1cont2when1(Void const& _,int loopDepth) + int a_body1cont3when1(Void const& _,int loopDepth) { loopDepth = a_body1cont4(_, loopDepth); return loopDepth; } - int a_body1cont2when1(Void && _,int loopDepth) + int a_body1cont3when1(Void && _,int loopDepth) { loopDepth = a_body1cont4(std::move(_), loopDepth); @@ -3941,43 +4164,43 @@ class WriteKV_implActor1State { } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteKV_implActor1, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< NewBlockActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< WriteKV_implActor1, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< NewBlockActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont2when1(value, 0); + a_body1cont3when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< WriteKV_implActor1, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< NewBlockActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont2when1(std::move(value), 0); + a_body1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< WriteKV_implActor1, 1, Void >*,Error err) + void a_callback_error(ActorCallback< NewBlockActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -3987,196 +4210,220 @@ class WriteKV_implActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 1); } - int a_body1cont5(Void const& _,int loopDepth) + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptedRangeFileWriter* self; + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int bytesNeeded; + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRef lastKey; + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool writeValue; + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool final; + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Value paddingFFs; + #line 4228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via newBlock() + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class NewBlockActor final : public Actor, public ActorCallback< NewBlockActor, 0, Void >, public ActorCallback< NewBlockActor, 1, Void >, public FastAllocated, public NewBlockActorState { + #line 4233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< NewBlockActor, 0, Void >; +friend struct ActorCallback< NewBlockActor, 1, Void >; + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + NewBlockActor(EncryptedRangeFileWriter* const& self,int const& bytesNeeded,KeyRef const& lastKey,bool const& writeValue,bool const& final = false) + #line 4245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + NewBlockActorState(self, bytesNeeded, lastKey, writeValue, final) { - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_3 = self->file->appendStringRefWithLen(v); - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("newBlock"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1cont5(Void && _,int loopDepth) + void cancel() override { - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_3 = self->file->appendStringRefWithLen(v); - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< NewBlockActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< NewBlockActor, 1, Void >*)0, actor_cancelled()); break; + } - return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont5(_, loopDepth); +}; + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future newBlock( EncryptedRangeFileWriter* const& self, int const& bytesNeeded, KeyRef const& lastKey, bool const& writeValue, bool const& final = false ) { + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new NewBlockActor(self, bytesNeeded, lastKey, writeValue, final)); + #line 4273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} - return loopDepth; +#line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + Future padEnd(bool final) { + if (expectedFileSize(this) > 0) { + return newBlock(this, 0, StringRef(), true, final); + } + return Void(); } - int a_body1cont1when1(Void && _,int loopDepth) + + // Ends the current block if necessary based on bytesNeeded. + #line 4286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via newBlockIfNeeded() + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class NewBlockIfNeededActorState { + #line 4292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + NewBlockIfNeededActorState(EncryptedRangeFileWriter* const& self,int const& bytesNeeded) + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : self(self), + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bytesNeeded(bytesNeeded) + #line 4301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - loopDepth = a_body1cont5(std::move(_), loopDepth); + fdb_probe_actor_create("newBlockIfNeeded", reinterpret_cast(this)); - return loopDepth; } - void a_exitChoose3() + ~NewBlockIfNeededActorState() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteKV_implActor1, 2, Void >::remove(); + fdb_probe_actor_destroy("newBlockIfNeeded", reinterpret_cast(this)); } - void a_callback_fire(ActorCallback< WriteKV_implActor1, 2, Void >*,Void const& value) + int a_body1(int loopDepth=0) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); - a_exitChoose3(); try { - a_body1cont1when1(value, 0); + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (expectedFileSize(self) + bytesNeeded > self->blockEnd) + #line 4316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = newBlock(self, bytesNeeded, self->lastKey, true); + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { - a_body1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); + return loopDepth; } - void a_callback_fire(ActorCallback< WriteKV_implActor1, 2, Void >*,Void && value) + int a_body1Catch1(Error error,int loopDepth=0) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); + this->~NewBlockIfNeededActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + return loopDepth; } - void a_callback_error(ActorCallback< WriteKV_implActor1, 2, Void >*,Error err) + int a_body1cont1(int loopDepth) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~NewBlockIfNeededActorState(); static_cast(this)->destroy(); return 0; } + #line 4355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~NewBlockIfNeededActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + return loopDepth; } - int a_body1cont6(Void const& _,int loopDepth) + int a_body1cont2(Void const& _,int loopDepth) { - #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (self->file->size() > self->blockEnd) - #line 4092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(backup_bad_block_size(), loopDepth); - #line 4096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKV_implActor1State(); static_cast(this)->destroy(); return 0; } - #line 4100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~WriteKV_implActor1State(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1cont6(Void && _,int loopDepth) + int a_body1cont2(Void && _,int loopDepth) { - #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (self->file->size() > self->blockEnd) - #line 4112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(backup_bad_block_size(), loopDepth); - #line 4116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKV_implActor1State(); static_cast(this)->destroy(); return 0; } - #line 4120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~WriteKV_implActor1State(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1cont5when1(Void const& _,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont6(_, loopDepth); + loopDepth = a_body1cont2(_, loopDepth); return loopDepth; } - int a_body1cont5when1(Void && _,int loopDepth) + int a_body1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont6(std::move(_), loopDepth); + loopDepth = a_body1cont2(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteKV_implActor1, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< NewBlockIfNeededActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< WriteKV_implActor1, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< NewBlockIfNeededActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("newBlockIfNeeded", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont5when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 3); + fdb_probe_actor_exit("newBlockIfNeeded", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< WriteKV_implActor1, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< NewBlockIfNeededActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("newBlockIfNeeded", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont5when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 3); + fdb_probe_actor_exit("newBlockIfNeeded", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< WriteKV_implActor1, 3, Void >*,Error err) + void a_callback_error(ActorCallback< NewBlockIfNeededActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("newBlockIfNeeded", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1Catch1(err, 0); } @@ -4185,47 +4432,40 @@ class WriteKV_implActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 3); + fdb_probe_actor_exit("newBlockIfNeeded", reinterpret_cast(this), 0); } - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - LogFileWriter* self; - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key k; - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Value v; - #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Value paddingFFs; - #line 4199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptedRangeFileWriter* self; + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int bytesNeeded; + #line 4442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via writeKV_impl() - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class WriteKV_implActor1 final : public Actor, public ActorCallback< WriteKV_implActor1, 0, Void >, public ActorCallback< WriteKV_implActor1, 1, Void >, public ActorCallback< WriteKV_implActor1, 2, Void >, public ActorCallback< WriteKV_implActor1, 3, Void >, public FastAllocated, public WriteKV_implActor1State { - #line 4204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via newBlockIfNeeded() + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class NewBlockIfNeededActor final : public Actor, public ActorCallback< NewBlockIfNeededActor, 0, Void >, public FastAllocated, public NewBlockIfNeededActorState { + #line 4447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< WriteKV_implActor1, 0, Void >; -friend struct ActorCallback< WriteKV_implActor1, 1, Void >; -friend struct ActorCallback< WriteKV_implActor1, 2, Void >; -friend struct ActorCallback< WriteKV_implActor1, 3, Void >; - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - WriteKV_implActor1(LogFileWriter* const& self,Key const& k,Value const& v) - #line 4218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +friend struct ActorCallback< NewBlockIfNeededActor, 0, Void >; + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + NewBlockIfNeededActor(EncryptedRangeFileWriter* const& self,int const& bytesNeeded) + #line 4458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), - WriteKV_implActor1State(self, k, v) + NewBlockIfNeededActorState(self, bytesNeeded) { - fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), -1); + fdb_probe_actor_enter("newBlockIfNeeded", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("writeKV_impl"); + this->lineage.setActorName("newBlockIfNeeded"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), -1); + fdb_probe_actor_exit("newBlockIfNeeded", reinterpret_cast(this), -1); } void cancel() override @@ -4233,105 +4473,86 @@ friend struct ActorCallback< WriteKV_implActor1, 3, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< WriteKV_implActor1, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< WriteKV_implActor1, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< WriteKV_implActor1, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< WriteKV_implActor1, 3, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< NewBlockIfNeededActor, 0, Void >*)0, actor_cancelled()); break; } } }; - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future writeKV_impl( LogFileWriter* const& self, Key const& k, Value const& v ) { - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new WriteKV_implActor1(self, k, v)); - #line 4248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future newBlockIfNeeded( EncryptedRangeFileWriter* const& self, int const& bytesNeeded ) { + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new NewBlockIfNeededActor(self, bytesNeeded)); + #line 4485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - - Future writeKV(Key k, Value v) { return writeKV_impl(this, k, v); } +#line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference file; - int blockSize; + #line 4490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via handleTenantBondary() + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class HandleTenantBondaryActorState { + #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + HandleTenantBondaryActorState(EncryptedRangeFileWriter* const& self,Key const& k,Value const& v,bool const& writeValue,EncryptCipherDomainId const& curKeyDomainId,SnapshotBackupUseTenantCache const& checkTenantCache) + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : self(self), + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + k(k), + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + v(v), + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + writeValue(writeValue), + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + curKeyDomainId(curKeyDomainId), + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + checkTenantCache(checkTenantCache), + #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + endKey(k) + #line 4515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("handleTenantBondary", reinterpret_cast(this)); -private: - int64_t blockEnd; -}; - -Standalone> decodeMutationLogFileBlock(const Standalone& buf) { - Standalone> results({}, buf.arena()); - StringRefReader reader(buf, restore_corrupted_data()); - - // Read header, currently only decoding version BACKUP_AGENT_MLOG_VERSION - if (reader.consume() != BACKUP_AGENT_MLOG_VERSION) - throw restore_unsupported_file_version(); - - // Read k/v pairs. Block ends either at end of last value exactly or with 0xFF as first key len byte. - while (1) { - // If eof reached or first key len bytes is 0xFF then end of block was reached. - if (reader.eof() || *reader.rptr == 0xFF) - break; - - // Read key and value. If anything throws then there is a problem. - uint32_t kLen = reader.consumeNetworkUInt32(); - const uint8_t* k = reader.consume(kLen); - uint32_t vLen = reader.consumeNetworkUInt32(); - const uint8_t* v = reader.consume(vLen); - - results.push_back(results.arena(), KeyValueRef(KeyRef(k, kLen), ValueRef(v, vLen))); - } - - // Make sure any remaining bytes in the block are 0xFF - for (auto b : reader.remainder()) - if (b != 0xFF) - throw restore_corrupted_data_padding(); - - return results; -} - - #line 4293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via decodeMutationLogFileBlock() - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class DecodeMutationLogFileBlockActorState { - #line 4299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -public: - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - DecodeMutationLogFileBlockActorState(Reference const& file,int64_t const& offset,int const& len) - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : file(file), - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - offset(offset), - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - len(len), - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - buf(makeString(len)) - #line 4312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - fdb_probe_actor_create("decodeMutationLogFileBlock", reinterpret_cast(this)); - - } - ~DecodeMutationLogFileBlockActorState() - { - fdb_probe_actor_destroy("decodeMutationLogFileBlock", reinterpret_cast(this)); + } + ~HandleTenantBondaryActorState() + { + fdb_probe_actor_destroy("handleTenantBondary", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = file->read(mutateString(buf), len, offset); - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (curKeyDomainId != SYSTEM_KEYSPACE_ENCRYPT_DOMAIN_ID && curKeyDomainId != FDB_DEFAULT_ENCRYPT_DOMAIN_ID) + #line 4530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + endKey = StringRef(k.begin(), TenantAPI::PREFIX_SIZE); + #line 4534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + newValue = StringRef(); + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->lastKey = k; + #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->lastValue = v; + #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + appendStringRefWithLenToBuffer(self, &endKey); + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + appendStringRefWithLenToBuffer(self, &newValue); + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = newBlock(self, 0, endKey, writeValue); + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4344,87 +4565,65 @@ class DecodeMutationLogFileBlockActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~DecodeMutationLogFileBlockActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~HandleTenantBondaryActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(int const& rLen,int loopDepth) + int a_body1cont1(Void const& _,int loopDepth) { - #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (rLen != len) - #line 4357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(restore_bad_read(), loopDepth); - #line 4361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - try { - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV>>::futures) { (void)(decodeMutationLogFileBlock(buf)); this->~DecodeMutationLogFileBlockActorState(); static_cast(this)->destroy(); return 0; } - #line 4366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(decodeMutationLogFileBlock(buf)); - this->~DecodeMutationLogFileBlockActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = updateEncryptionKeysCtx(self, self->lastKey, checkTenantCache); + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont1(int && rLen,int loopDepth) + int a_body1cont1(Void && _,int loopDepth) { - #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (rLen != len) - #line 4384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(restore_bad_read(), loopDepth); - #line 4388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - try { - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV>>::futures) { (void)(decodeMutationLogFileBlock(buf)); this->~DecodeMutationLogFileBlockActorState(); static_cast(this)->destroy(); return 0; } - #line 4393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(decodeMutationLogFileBlock(buf)); - this->~DecodeMutationLogFileBlockActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = updateEncryptionKeysCtx(self, self->lastKey, checkTenantCache); + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1when1(int const& rLen,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(rLen, loopDepth); + loopDepth = a_body1cont1(_, loopDepth); return loopDepth; } - int a_body1when1(int && rLen,int loopDepth) + int a_body1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(rLen), loopDepth); + loopDepth = a_body1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DecodeMutationLogFileBlockActor, 0, int >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< HandleTenantBondaryActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< DecodeMutationLogFileBlockActor, 0, int >*,int const& value) + void a_callback_fire(ActorCallback< HandleTenantBondaryActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("decodeMutationLogFileBlock", reinterpret_cast(this), 0); + fdb_probe_actor_enter("handleTenantBondary", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -4434,12 +4633,12 @@ class DecodeMutationLogFileBlockActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("decodeMutationLogFileBlock", reinterpret_cast(this), 0); + fdb_probe_actor_exit("handleTenantBondary", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< DecodeMutationLogFileBlockActor, 0, int >*,int && value) + void a_callback_fire(ActorCallback< HandleTenantBondaryActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("decodeMutationLogFileBlock", reinterpret_cast(this), 0); + fdb_probe_actor_enter("handleTenantBondary", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -4449,12 +4648,12 @@ class DecodeMutationLogFileBlockActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("decodeMutationLogFileBlock", reinterpret_cast(this), 0); + fdb_probe_actor_exit("handleTenantBondary", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< DecodeMutationLogFileBlockActor, 0, int >*,Error err) + void a_callback_error(ActorCallback< HandleTenantBondaryActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("decodeMutationLogFileBlock", reinterpret_cast(this), 0); + fdb_probe_actor_enter("handleTenantBondary", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -4464,252 +4663,85 @@ class DecodeMutationLogFileBlockActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("decodeMutationLogFileBlock", reinterpret_cast(this), 0); - - } - int a_body1cont1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevWarn, "FileRestoreCorruptLogFileBlock") .error(e) .detail("Filename", file->getFilename()) .detail("BlockOffset", offset) .detail("BlockLen", len); - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(e, loopDepth); - #line 4477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference file; - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int64_t offset; - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int len; - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Standalone buf; - #line 4495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -}; -// This generated class is to be used only via decodeMutationLogFileBlock() - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class DecodeMutationLogFileBlockActor final : public Actor>>, public ActorCallback< DecodeMutationLogFileBlockActor, 0, int >, public FastAllocated, public DecodeMutationLogFileBlockActorState { - #line 4500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< DecodeMutationLogFileBlockActor, 0, int >; - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - DecodeMutationLogFileBlockActor(Reference const& file,int64_t const& offset,int const& len) - #line 4511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor>>(), - DecodeMutationLogFileBlockActorState(file, offset, len) - { - fdb_probe_actor_enter("decodeMutationLogFileBlock", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("decodeMutationLogFileBlock"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("decodeMutationLogFileBlock", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< DecodeMutationLogFileBlockActor, 0, int >*)0, actor_cancelled()); break; - } - - } -}; - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] Future>> decodeMutationLogFileBlock( Reference const& file, int64_t const& offset, int const& len ) { - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future>>(new DecodeMutationLogFileBlockActor(file, offset, len)); - #line 4538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -} - -#line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - - #line 4543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via checkTaskVersion() - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class CheckTaskVersionActorState { - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -public: - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - CheckTaskVersionActorState(Database const& cx,Reference const& task,StringRef const& name,uint32_t const& version) - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : cx(cx), - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - task(task), - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - name(name), - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - version(version) - #line 4562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - fdb_probe_actor_create("checkTaskVersion", reinterpret_cast(this)); - - } - ~CheckTaskVersionActorState() - { - fdb_probe_actor_destroy("checkTaskVersion", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - uint32_t taskVersion = task->getVersion(); - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (taskVersion > version) - #line 4579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - err = task_invalid_version(); - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevWarn, "BA_BackupRangeTaskFuncExecute") .detail("TaskVersion", taskVersion) .detail("Name", name) .detail("Version", version); - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (KeyBackedConfig::TaskParams.uid().exists(task)) - #line 4587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string msg = format("%s task version `%lu' is greater than supported version `%lu'", task->params[Task::reservedTaskParamKeyType].toString().c_str(), (unsigned long)taskVersion, (unsigned long)version); - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = BackupConfig(task).logError(cx, err, msg); - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont2(loopDepth); - } - } - else - { - loopDepth = a_body1cont1(loopDepth); - } - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~CheckTaskVersionActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(int loopDepth) - { - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckTaskVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 4633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~CheckTaskVersionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont2(int loopDepth) - { - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(err, loopDepth); - #line 4645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + fdb_probe_actor_exit("handleTenantBondary", reinterpret_cast(this), 0); - return loopDepth; } int a_body1cont3(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(loopDepth); + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~HandleTenantBondaryActorState(); static_cast(this)->destroy(); return 0; } + #line 4673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~HandleTenantBondaryActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - loopDepth = a_body1cont2(loopDepth); + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~HandleTenantBondaryActorState(); static_cast(this)->destroy(); return 0; } + #line 4685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~HandleTenantBondaryActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1cont1when1(Void const& _,int loopDepth) { loopDepth = a_body1cont3(_, loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1cont1when1(Void && _,int loopDepth) { loopDepth = a_body1cont3(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CheckTaskVersionActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< HandleTenantBondaryActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< CheckTaskVersionActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< HandleTenantBondaryActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("checkTaskVersion", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("handleTenantBondary", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("checkTaskVersion", reinterpret_cast(this), 0); + fdb_probe_actor_exit("handleTenantBondary", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< CheckTaskVersionActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< HandleTenantBondaryActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("checkTaskVersion", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("handleTenantBondary", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("checkTaskVersion", reinterpret_cast(this), 0); + fdb_probe_actor_exit("handleTenantBondary", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< CheckTaskVersionActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< HandleTenantBondaryActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("checkTaskVersion", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("handleTenantBondary", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -4718,46 +4750,53 @@ class CheckTaskVersionActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("checkTaskVersion", reinterpret_cast(this), 0); + fdb_probe_actor_exit("handleTenantBondary", reinterpret_cast(this), 1); } - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Database cx; - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference task; - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StringRef name; - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - uint32_t version; - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Error err; - #line 4734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptedRangeFileWriter* self; + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key k; + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Value v; + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool writeValue; + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptCipherDomainId curKeyDomainId; + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + SnapshotBackupUseTenantCache checkTenantCache; + #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRef endKey; + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ValueRef newValue; + #line 4772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via checkTaskVersion() - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class CheckTaskVersionActor final : public Actor, public ActorCallback< CheckTaskVersionActor, 0, Void >, public FastAllocated, public CheckTaskVersionActorState { - #line 4739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via handleTenantBondary() + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class HandleTenantBondaryActor final : public Actor, public ActorCallback< HandleTenantBondaryActor, 0, Void >, public ActorCallback< HandleTenantBondaryActor, 1, Void >, public FastAllocated, public HandleTenantBondaryActorState { + #line 4777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< CheckTaskVersionActor, 0, Void >; - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - CheckTaskVersionActor(Database const& cx,Reference const& task,StringRef const& name,uint32_t const& version) - #line 4750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +friend struct ActorCallback< HandleTenantBondaryActor, 0, Void >; +friend struct ActorCallback< HandleTenantBondaryActor, 1, Void >; + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + HandleTenantBondaryActor(EncryptedRangeFileWriter* const& self,Key const& k,Value const& v,bool const& writeValue,EncryptCipherDomainId const& curKeyDomainId,SnapshotBackupUseTenantCache const& checkTenantCache) + #line 4789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), - CheckTaskVersionActorState(cx, task, name, version) + HandleTenantBondaryActorState(self, k, v, writeValue, curKeyDomainId, checkTenantCache) { - fdb_probe_actor_enter("checkTaskVersion", reinterpret_cast(this), -1); + fdb_probe_actor_enter("handleTenantBondary", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("checkTaskVersion"); + this->lineage.setActorName("handleTenantBondary"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("checkTaskVersion", reinterpret_cast(this), -1); + fdb_probe_actor_exit("handleTenantBondary", reinterpret_cast(this), -1); } void cancel() override @@ -4765,66 +4804,77 @@ friend struct ActorCallback< CheckTaskVersionActor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< CheckTaskVersionActor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< HandleTenantBondaryActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< HandleTenantBondaryActor, 1, Void >*)0, actor_cancelled()); break; } } }; - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] Future checkTaskVersion( Database const& cx, Reference const& task, StringRef const& name, uint32_t const& version ) { - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new CheckTaskVersionActor(cx, task, name, version)); - #line 4777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future handleTenantBondary( EncryptedRangeFileWriter* const& self, Key const& k, Value const& v, bool const& writeValue, EncryptCipherDomainId const& curKeyDomainId, SnapshotBackupUseTenantCache const& checkTenantCache ) { + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new HandleTenantBondaryActor(self, k, v, writeValue, curKeyDomainId, checkTenantCache)); + #line 4817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via abortFiveZeroBackup() - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class AbortFiveZeroBackupActorState { - #line 4788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 4822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via finishCurTenantBlockStartNewIfNeeded() + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class FinishCurTenantBlockStartNewIfNeededActorState { + #line 4828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - AbortFiveZeroBackupActorState(FileBackupAgent* const& backupAgent,Reference const& tr,std::string const& tagName) - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : backupAgent(backupAgent), - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr(tr), - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tagName(tagName) - #line 4799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + FinishCurTenantBlockStartNewIfNeededActorState(EncryptedRangeFileWriter* const& self,Key const& k,Value const& v,bool const& writeValue,SnapshotBackupUseTenantCache const& checkTenantCache) + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : self(self), + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + k(k), + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + v(v), + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + writeValue(writeValue), + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + checkTenantCache(checkTenantCache) + #line 4843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("abortFiveZeroBackup", reinterpret_cast(this)); + fdb_probe_actor_create("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this)); } - ~AbortFiveZeroBackupActorState() + ~FinishCurTenantBlockStartNewIfNeededActorState() { - fdb_probe_actor_destroy("abortFiveZeroBackup", reinterpret_cast(this)); + fdb_probe_actor_destroy("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tagNames = backupAgent->subspace.get(BackupAgentBase::keyTagName); - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_0 = tr->get(tagNames.pack(Key(tagName))); - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (self->lastKey.size() == 0 || k.size() == 0) + #line 4858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~FinishCurTenantBlockStartNewIfNeededActorState(); static_cast(this)->destroy(); return 0; } + #line 4862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~FinishCurTenantBlockStartNewIfNeededActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = getEncryptionDomainDetails(k, self->encryptMode, self->tenantCache, checkTenantCache); + #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4837,109 +4887,53 @@ class AbortFiveZeroBackupActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~AbortFiveZeroBackupActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Optional const& uidStr,int loopDepth) - { - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!uidStr.present()) - #line 4850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevWarn, "FileBackupAbortIncompatibleBackup_TagNotFound").detail("TagName", tagName.c_str()); - #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortFiveZeroBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 4856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~AbortFiveZeroBackupActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - uid = BinaryReader::fromStringRef(uidStr.get(), Unversioned()); - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusSpace = backupAgent->subspace.get(BackupAgentBase::keyStates).get(uid.toString()); - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - globalConfig = backupAgent->subspace.get(BackupAgentBase::keyConfig).get(uid.toString()); - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - newConfigSpace = uidPrefixKey(LiteralStringRef("uid->config/").withPrefix(fileBackupPrefixRange.begin), uid); - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_1 = tr->get(statusSpace.pack(FileBackupAgent::keyStateStatus)); - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + this->~FinishCurTenantBlockStartNewIfNeededActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(Optional && uidStr,int loopDepth) + int a_body1cont1(int loopDepth) { - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!uidStr.present()) - #line 4888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevWarn, "FileBackupAbortIncompatibleBackup_TagNotFound").detail("TagName", tagName.c_str()); - #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortFiveZeroBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 4894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~AbortFiveZeroBackupActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - uid = BinaryReader::fromStringRef(uidStr.get(), Unversioned()); - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusSpace = backupAgent->subspace.get(BackupAgentBase::keyStates).get(uid.toString()); - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - globalConfig = backupAgent->subspace.get(BackupAgentBase::keyConfig).get(uid.toString()); - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - newConfigSpace = uidPrefixKey(LiteralStringRef("uid->config/").withPrefix(fileBackupPrefixRange.begin), uid); - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_1 = tr->get(statusSpace.pack(FileBackupAgent::keyStateStatus)); - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = getEncryptionDomainDetails(self->lastKey, self->encryptMode, self->tenantCache, checkTenantCache); + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(Optional const& uidStr,int loopDepth) + int a_body1when1(EncryptCipherDomainId const& __curKeyDomainId,int loopDepth) { - loopDepth = a_body1cont1(uidStr, loopDepth); + #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + curKeyDomainId = __curKeyDomainId; + #line 4916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1when1(Optional && uidStr,int loopDepth) + int a_body1when1(EncryptCipherDomainId && __curKeyDomainId,int loopDepth) { - loopDepth = a_body1cont1(std::move(uidStr), loopDepth); + curKeyDomainId = std::move(__curKeyDomainId); + loopDepth = a_body1cont1(loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AbortFiveZeroBackupActor, 0, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 0, EncryptCipherDomainId >::remove(); } - void a_callback_fire(ActorCallback< AbortFiveZeroBackupActor, 0, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 0, EncryptCipherDomainId >*,EncryptCipherDomainId const& value) { - fdb_probe_actor_enter("abortFiveZeroBackup", reinterpret_cast(this), 0); + fdb_probe_actor_enter("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -4949,12 +4943,12 @@ class AbortFiveZeroBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveZeroBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< AbortFiveZeroBackupActor, 0, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 0, EncryptCipherDomainId >*,EncryptCipherDomainId && value) { - fdb_probe_actor_enter("abortFiveZeroBackup", reinterpret_cast(this), 0); + fdb_probe_actor_enter("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -4964,12 +4958,12 @@ class AbortFiveZeroBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveZeroBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< AbortFiveZeroBackupActor, 0, Optional >*,Error err) + void a_callback_error(ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 0, EncryptCipherDomainId >*,Error err) { - fdb_probe_actor_enter("abortFiveZeroBackup", reinterpret_cast(this), 0); + fdb_probe_actor_enter("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -4979,106 +4973,61 @@ class AbortFiveZeroBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveZeroBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 0); } - int a_body1cont2(Optional const& statusStr,int loopDepth) + int a_body1cont3(int loopDepth) { - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - status = !statusStr.present() ? EBackupState::STATE_NEVERRAN : BackupAgentBase::getState(statusStr.get().toString()); - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevInfo, "FileBackupAbortIncompatibleBackup") .detail("TagName", tagName.c_str()) .detail("Status", BackupAgentBase::getStateText(status)); - #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->clear(singleKeyRange(StringRef(globalConfig.pack(FileBackupAgent::keyFolderId)))); - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key configPath = uidPrefixKey(logRangesRange.begin, uid); - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key logsPath = uidPrefixKey(backupLogKeys.begin, uid); - #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->clear(KeyRangeRef(configPath, strinc(configPath))); - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->clear(KeyRangeRef(logsPath, strinc(logsPath))); - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->clear(newConfigSpace.range()); - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key statusKey = StringRef(statusSpace.pack(FileBackupAgent::keyStateStatus)); - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (backupAgent->isRunnable(status)) - #line 5007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (curKeyDomainId != prevKeyDomainId) + #line 4983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->set(statusKey, StringRef(FileBackupAgent::getStateText(EBackupState::STATE_ABORTED))); - #line 5011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CODE_PROBE(true, "crossed tenant boundaries"); + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = handleTenantBondary(self, k, v, writeValue, curKeyDomainId, checkTenantCache); + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortFiveZeroBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 5015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~AbortFiveZeroBackupActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont2(Optional && statusStr,int loopDepth) - { - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - status = !statusStr.present() ? EBackupState::STATE_NEVERRAN : BackupAgentBase::getState(statusStr.get().toString()); - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevInfo, "FileBackupAbortIncompatibleBackup") .detail("TagName", tagName.c_str()) .detail("Status", BackupAgentBase::getStateText(status)); - #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->clear(singleKeyRange(StringRef(globalConfig.pack(FileBackupAgent::keyFolderId)))); - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key configPath = uidPrefixKey(logRangesRange.begin, uid); - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key logsPath = uidPrefixKey(backupLogKeys.begin, uid); - #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->clear(KeyRangeRef(configPath, strinc(configPath))); - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->clear(KeyRangeRef(logsPath, strinc(logsPath))); - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->clear(newConfigSpace.range()); - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key statusKey = StringRef(statusSpace.pack(FileBackupAgent::keyStateStatus)); - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (backupAgent->isRunnable(status)) - #line 5045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + else { - #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->set(statusKey, StringRef(FileBackupAgent::getStateText(EBackupState::STATE_ABORTED))); - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont4(loopDepth); } - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortFiveZeroBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 5053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~AbortFiveZeroBackupActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; return loopDepth; } - int a_body1cont1when1(Optional const& statusStr,int loopDepth) + int a_body1cont1when1(EncryptCipherDomainId const& __prevKeyDomainId,int loopDepth) { - loopDepth = a_body1cont2(statusStr, loopDepth); + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + prevKeyDomainId = __prevKeyDomainId; + #line 5010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont3(loopDepth); return loopDepth; } - int a_body1cont1when1(Optional && statusStr,int loopDepth) + int a_body1cont1when1(EncryptCipherDomainId && __prevKeyDomainId,int loopDepth) { - loopDepth = a_body1cont2(std::move(statusStr), loopDepth); + prevKeyDomainId = std::move(__prevKeyDomainId); + loopDepth = a_body1cont3(loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AbortFiveZeroBackupActor, 1, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 1, EncryptCipherDomainId >::remove(); } - void a_callback_fire(ActorCallback< AbortFiveZeroBackupActor, 1, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 1, EncryptCipherDomainId >*,EncryptCipherDomainId const& value) { - fdb_probe_actor_enter("abortFiveZeroBackup", reinterpret_cast(this), 1); + fdb_probe_actor_enter("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -5088,12 +5037,12 @@ class AbortFiveZeroBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveZeroBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< AbortFiveZeroBackupActor, 1, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 1, EncryptCipherDomainId >*,EncryptCipherDomainId && value) { - fdb_probe_actor_enter("abortFiveZeroBackup", reinterpret_cast(this), 1); + fdb_probe_actor_enter("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -5103,12 +5052,12 @@ class AbortFiveZeroBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveZeroBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< AbortFiveZeroBackupActor, 1, Optional >*,Error err) + void a_callback_error(ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 1, EncryptCipherDomainId >*,Error err) { - fdb_probe_actor_enter("abortFiveZeroBackup", reinterpret_cast(this), 1); + fdb_probe_actor_enter("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -5118,55 +5067,151 @@ class AbortFiveZeroBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveZeroBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 1); } - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - FileBackupAgent* backupAgent; - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference tr; - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string tagName; - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Subspace tagNames; - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - UID uid; - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Subspace statusSpace; - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Subspace globalConfig; - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Subspace newConfigSpace; - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - EBackupState status; - #line 5142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + int a_body1cont4(int loopDepth) + { + #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~FinishCurTenantBlockStartNewIfNeededActorState(); static_cast(this)->destroy(); return 0; } + #line 5077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~FinishCurTenantBlockStartNewIfNeededActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont5(Void const& _,int loopDepth) + { + #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~FinishCurTenantBlockStartNewIfNeededActorState(); static_cast(this)->destroy(); return 0; } + #line 5089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~FinishCurTenantBlockStartNewIfNeededActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont5(Void && _,int loopDepth) + { + #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~FinishCurTenantBlockStartNewIfNeededActorState(); static_cast(this)->destroy(); return 0; } + #line 5101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~FinishCurTenantBlockStartNewIfNeededActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont5(_, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont5(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), 2); + + } + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptedRangeFileWriter* self; + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key k; + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Value v; + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool writeValue; + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + SnapshotBackupUseTenantCache checkTenantCache; + #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptCipherDomainId curKeyDomainId; + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptCipherDomainId prevKeyDomainId; + #line 5186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via abortFiveZeroBackup() - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class AbortFiveZeroBackupActor final : public Actor, public ActorCallback< AbortFiveZeroBackupActor, 0, Optional >, public ActorCallback< AbortFiveZeroBackupActor, 1, Optional >, public FastAllocated, public AbortFiveZeroBackupActorState { - #line 5147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via finishCurTenantBlockStartNewIfNeeded() + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class FinishCurTenantBlockStartNewIfNeededActor final : public Actor, public ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 0, EncryptCipherDomainId >, public ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 1, EncryptCipherDomainId >, public ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 2, Void >, public FastAllocated, public FinishCurTenantBlockStartNewIfNeededActorState { + #line 5191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< AbortFiveZeroBackupActor, 0, Optional >; -friend struct ActorCallback< AbortFiveZeroBackupActor, 1, Optional >; - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - AbortFiveZeroBackupActor(FileBackupAgent* const& backupAgent,Reference const& tr,std::string const& tagName) - #line 5159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor(), - AbortFiveZeroBackupActorState(backupAgent, tr, tagName) +friend struct ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 0, EncryptCipherDomainId >; +friend struct ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 1, EncryptCipherDomainId >; +friend struct ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 2, Void >; + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + FinishCurTenantBlockStartNewIfNeededActor(EncryptedRangeFileWriter* const& self,Key const& k,Value const& v,bool const& writeValue,SnapshotBackupUseTenantCache const& checkTenantCache) + #line 5204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + FinishCurTenantBlockStartNewIfNeededActorState(self, k, v, writeValue, checkTenantCache) { - fdb_probe_actor_enter("abortFiveZeroBackup", reinterpret_cast(this), -1); + fdb_probe_actor_enter("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("abortFiveZeroBackup"); + this->lineage.setActorName("finishCurTenantBlockStartNewIfNeeded"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("abortFiveZeroBackup", reinterpret_cast(this), -1); + fdb_probe_actor_exit("finishCurTenantBlockStartNewIfNeeded", reinterpret_cast(this), -1); } void cancel() override @@ -5174,74 +5219,73 @@ friend struct ActorCallback< AbortFiveZeroBackupActor, 1, Optional >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< AbortFiveZeroBackupActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< AbortFiveZeroBackupActor, 1, Optional >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 0, EncryptCipherDomainId >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 1, EncryptCipherDomainId >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< FinishCurTenantBlockStartNewIfNeededActor, 2, Void >*)0, actor_cancelled()); break; } } }; - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future abortFiveZeroBackup( FileBackupAgent* const& backupAgent, Reference const& tr, std::string const& tagName ) { - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new AbortFiveZeroBackupActor(backupAgent, tr, tagName)); - #line 5187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future finishCurTenantBlockStartNewIfNeeded( EncryptedRangeFileWriter* const& self, Key const& k, Value const& v, bool const& writeValue, SnapshotBackupUseTenantCache const& checkTenantCache ) { + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new FinishCurTenantBlockStartNewIfNeededActor(self, k, v, writeValue, checkTenantCache)); + #line 5233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -struct AbortFiveZeroBackupTask : TaskFuncBase { - static StringRef name; - #line 5194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via _finish() - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class _finishActorState { - #line 5200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + // Start a new block if needed, then write the key and value + #line 5239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via writeKV_impl() + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class WriteKV_implActorState { + #line 5245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - _finishActorState(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : tr(tr), - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - taskBucket(taskBucket), - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - futureBucket(futureBucket), - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - task(task), - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backupAgent(), - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tagName(task->params[BackupAgentBase::keyConfigBackupTag].toString()) - #line 5217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + WriteKV_implActorState(EncryptedRangeFileWriter* const& self,Key const& k,Value const& v) + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : self(self), + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + k(k), + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + v(v) + #line 5256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("_finish", reinterpret_cast(this)); + fdb_probe_actor_create("writeKV_impl", reinterpret_cast(this)); } - ~_finishActorState() + ~WriteKV_implActorState() { - fdb_probe_actor_destroy("_finish", reinterpret_cast(this)); + fdb_probe_actor_destroy("writeKV_impl", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TEST(true); - #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevInfo, "FileBackupCancelOldTask") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("TagName", tagName); - #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = abortFiveZeroBackup(&backupAgent, tr, tagName); - #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast<_finishActor*>(this)->actor_wait_state = 1; - #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor*>(this))); - #line 5243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!self->cipherKeys.headerCipherKey.present() || !self->cipherKeys.headerCipherKey.get().isValid() || !self->cipherKeys.textCipherKey.isValid()) + #line 5271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = updateEncryptionKeysCtx(self, k, SnapshotBackupUseTenantCache::False); + #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -5253,65 +5297,63 @@ class _finishActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~_finishActorState(); - static_cast<_finishActor*>(this)->sendErrorAndDelPromiseRef(error); + this->~WriteKV_implActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(Void const& _,int loopDepth) + int a_body1cont1(int loopDepth) { - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = taskBucket->finish(tr, task); - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + toWrite = sizeof(int32_t) + k.size() + sizeof(int32_t) + v.size(); + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = newBlockIfNeeded(self, toWrite); + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast<_finishActor*>(this)->actor_wait_state = 2; - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor*>(this))); - #line 5273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1cont2(Void const& _,int loopDepth) { - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = taskBucket->finish(tr, task); - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast<_finishActor*>(this)->actor_wait_state = 2; - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor*>(this))); - #line 5289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); return loopDepth; } int a_body1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + loopDepth = a_body1cont2(_, loopDepth); return loopDepth; } int a_body1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont2(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast<_finishActor*>(this)->actor_wait_state > 0) static_cast<_finishActor*>(this)->actor_wait_state = 0; - static_cast<_finishActor*>(this)->ActorCallback< _finishActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKV_implActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< _finishActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< WriteKV_implActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -5321,12 +5363,12 @@ class _finishActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< _finishActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< WriteKV_implActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -5336,12 +5378,12 @@ class _finishActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< _finishActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< WriteKV_implActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -5351,54 +5393,62 @@ class _finishActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); } - int a_body1cont2(Void const& _,int loopDepth) + int a_body1cont3(Void const& _,int loopDepth) { - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_finishActor*>(this)->SAV::futures) { (void)(Void()); this->~_finishActorState(); static_cast<_finishActor*>(this)->destroy(); return 0; } - #line 5361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_finishActor*>(this)->SAV< Void >::value()) Void(Void()); - this->~_finishActorState(); - static_cast<_finishActor*>(this)->finishSendAndDelPromiseRef(); - return 0; + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = finishCurTenantBlockStartNewIfNeeded(self, k, v, true, SnapshotBackupUseTenantCache::False); + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont2(Void && _,int loopDepth) + int a_body1cont3(Void && _,int loopDepth) { - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_finishActor*>(this)->SAV::futures) { (void)(Void()); this->~_finishActorState(); static_cast<_finishActor*>(this)->destroy(); return 0; } - #line 5373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_finishActor*>(this)->SAV< Void >::value()) Void(Void()); - this->~_finishActorState(); - static_cast<_finishActor*>(this)->finishSendAndDelPromiseRef(); - return 0; + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = finishCurTenantBlockStartNewIfNeeded(self, k, v, true, SnapshotBackupUseTenantCache::False); + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + loopDepth = a_body1cont3(_, loopDepth); return loopDepth; } int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont3(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast<_finishActor*>(this)->actor_wait_state > 0) static_cast<_finishActor*>(this)->actor_wait_state = 0; - static_cast<_finishActor*>(this)->ActorCallback< _finishActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKV_implActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< _finishActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< WriteKV_implActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -5408,12 +5458,12 @@ class _finishActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< _finishActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< WriteKV_implActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -5423,12 +5473,12 @@ class _finishActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< _finishActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< WriteKV_implActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -5438,49 +5488,173 @@ class _finishActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); } - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference tr; - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference taskBucket; - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference futureBucket; - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference task; - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - FileBackupAgent backupAgent; - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string tagName; - #line 5456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + int a_body1cont4(bool const& createdNewBlock,int loopDepth) + { + #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (createdNewBlock) + #line 5498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKV_implActorState(); static_cast(this)->destroy(); return 0; } + #line 5502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteKV_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + appendStringRefWithLenToBuffer(self, &k); + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + appendStringRefWithLenToBuffer(self, &v); + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->lastKey = k; + #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->lastValue = v; + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKV_implActorState(); static_cast(this)->destroy(); return 0; } + #line 5518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteKV_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont4(bool && createdNewBlock,int loopDepth) + { + #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (createdNewBlock) + #line 5530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKV_implActorState(); static_cast(this)->destroy(); return 0; } + #line 5534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteKV_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + appendStringRefWithLenToBuffer(self, &k); + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + appendStringRefWithLenToBuffer(self, &v); + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->lastKey = k; + #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->lastValue = v; + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKV_implActorState(); static_cast(this)->destroy(); return 0; } + #line 5550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteKV_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3when1(bool const& createdNewBlock,int loopDepth) + { + loopDepth = a_body1cont4(createdNewBlock, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(bool && createdNewBlock,int loopDepth) + { + loopDepth = a_body1cont4(std::move(createdNewBlock), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKV_implActor, 2, bool >::remove(); + + } + void a_callback_fire(ActorCallback< WriteKV_implActor, 2, bool >*,bool const& value) + { + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< WriteKV_implActor, 2, bool >*,bool && value) + { + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< WriteKV_implActor, 2, bool >*,Error err) + { + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); + + } + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptedRangeFileWriter* self; + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key k; + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Value v; + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int toWrite; + #line 5629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via _finish() - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class _finishActor final : public Actor, public ActorCallback< _finishActor, 0, Void >, public ActorCallback< _finishActor, 1, Void >, public FastAllocated<_finishActor>, public _finishActorState<_finishActor> { - #line 5461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via writeKV_impl() + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class WriteKV_implActor final : public Actor, public ActorCallback< WriteKV_implActor, 0, Void >, public ActorCallback< WriteKV_implActor, 1, Void >, public ActorCallback< WriteKV_implActor, 2, bool >, public FastAllocated, public WriteKV_implActorState { + #line 5634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated<_finishActor>::operator new; - using FastAllocated<_finishActor>::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< _finishActor, 0, Void >; -friend struct ActorCallback< _finishActor, 1, Void >; - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - _finishActor(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 5473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +friend struct ActorCallback< WriteKV_implActor, 0, Void >; +friend struct ActorCallback< WriteKV_implActor, 1, Void >; +friend struct ActorCallback< WriteKV_implActor, 2, bool >; + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + WriteKV_implActor(EncryptedRangeFileWriter* const& self,Key const& k,Value const& v) + #line 5647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), - _finishActorState<_finishActor>(tr, taskBucket, futureBucket, task) + WriteKV_implActorState(self, k, v) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), -1); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("_finish"); + this->lineage.setActorName("writeKV_impl"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("_finish", reinterpret_cast(this), -1); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), -1); } void cancel() override @@ -5488,99 +5662,73 @@ friend struct ActorCallback< _finishActor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< _finishActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< _finishActor, 1, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< WriteKV_implActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WriteKV_implActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< WriteKV_implActor, 2, bool >*)0, actor_cancelled()); break; } } }; - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new _finishActor(tr, taskBucket, futureBucket, task)); - #line 5501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future writeKV_impl( EncryptedRangeFileWriter* const& self, Key const& k, Value const& v ) { + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new WriteKV_implActor(self, k, v)); + #line 5676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - - StringRef getName() const override { - TraceEvent(SevError, "FileBackupError") - .detail("Cause", "AbortFiveZeroBackupTaskFunc::name() should never be called"); - ASSERT(false); - return StringRef(); - } +#line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Future execute(Database cx, - Reference tb, - Reference fb, - Reference task) override { - return Future(Void()); - }; - Future finish(Reference tr, - Reference tb, - Reference fb, - Reference task) override { - return _finish(tr, tb, fb, task); - }; -}; -StringRef AbortFiveZeroBackupTask::name = LiteralStringRef("abort_legacy_backup"); -REGISTER_TASKFUNC(AbortFiveZeroBackupTask); -REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_backup_diff_logs); -REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_backup_log_range); -REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_backup_logs); -REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_backup_range); -REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_backup_restorable); -REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_finish_full_backup); -REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_finished_full_backup); -REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_start_full_backup); + Future writeKV(Key k, Value v) { return writeKV_impl(this, k, v); } - #line 5537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via abortFiveOneBackup() - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class AbortFiveOneBackupActorState { - #line 5543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + // Write begin key or end key. + #line 5684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via writeKey_impl() + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class WriteKey_implActorState { + #line 5690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - AbortFiveOneBackupActorState(FileBackupAgent* const& backupAgent,Reference const& tr,std::string const& tagName) - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : backupAgent(backupAgent), - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr(tr), - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tagName(tagName) - #line 5554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + WriteKey_implActorState(EncryptedRangeFileWriter* const& self,Key const& k) + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : self(self), + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + k(k) + #line 5699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("abortFiveOneBackup", reinterpret_cast(this)); + fdb_probe_actor_create("writeKey_impl", reinterpret_cast(this)); } - ~AbortFiveOneBackupActorState() + ~WriteKey_implActorState() { - fdb_probe_actor_destroy("abortFiveOneBackup", reinterpret_cast(this)); + fdb_probe_actor_destroy("writeKey_impl", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tag = makeBackupTag(tagName); - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = tag.getOrThrow(tr, Snapshot::False, backup_unneeded()); - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (k.size() > 0 && (!self->cipherKeys.headerCipherKey.present() || !self->cipherKeys.headerCipherKey.get().isValid() || !self->cipherKeys.textCipherKey.isValid())) + #line 5714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = updateEncryptionKeysCtx(self, k, SnapshotBackupUseTenantCache::True); + #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -5592,55 +5740,63 @@ class AbortFiveOneBackupActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~AbortFiveOneBackupActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~WriteKey_implActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config = BackupConfig(current.first); - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = config.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int toWrite = sizeof(uint32_t) + k.size() + sizeof(uint32_t); + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = newBlockIfNeeded(self, toWrite); + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(UidAndAbortedFlagT const& __current,int loopDepth) + int a_body1cont2(Void const& _,int loopDepth) { - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - current = __current; - #line 5623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1when1(UidAndAbortedFlagT && __current,int loopDepth) + int a_body1cont2(Void && _,int loopDepth) { - current = std::move(__current); loopDepth = a_body1cont1(loopDepth); return loopDepth; } - void a_exitChoose1() + int a_body1when1(Void const& _,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AbortFiveOneBackupActor, 0, UidAndAbortedFlagT >::remove(); + loopDepth = a_body1cont2(_, loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< AbortFiveOneBackupActor, 0, UidAndAbortedFlagT >*,UidAndAbortedFlagT const& value) + int a_body1when1(Void && _,int loopDepth) { - fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 0); + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKey_implActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WriteKey_implActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -5650,12 +5806,12 @@ class AbortFiveOneBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< AbortFiveOneBackupActor, 0, UidAndAbortedFlagT >*,UidAndAbortedFlagT && value) + void a_callback_fire(ActorCallback< WriteKey_implActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 0); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -5665,12 +5821,12 @@ class AbortFiveOneBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< AbortFiveOneBackupActor, 0, UidAndAbortedFlagT >*,Error err) + void a_callback_error(ActorCallback< WriteKey_implActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 0); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -5680,82 +5836,62 @@ class AbortFiveOneBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 0); } - int a_body1cont2(EBackupState const& status,int loopDepth) + int a_body1cont3(Void const& _,int loopDepth) { - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!backupAgent->isRunnable(status)) - #line 5690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(backup_unneeded(), loopDepth); - #line 5694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevInfo, "FBA_AbortFileOneBackup") .detail("TagName", tagName.c_str()) .detail("Status", BackupAgentBase::getStateText(status)); - #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = tag.cancel(tr); - #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = finishCurTenantBlockStartNewIfNeeded(self, k, StringRef(), false, SnapshotBackupUseTenantCache::True); + #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont2(EBackupState && status,int loopDepth) + int a_body1cont3(Void && _,int loopDepth) { - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!backupAgent->isRunnable(status)) - #line 5716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(backup_unneeded(), loopDepth); - #line 5720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevInfo, "FBA_AbortFileOneBackup") .detail("TagName", tagName.c_str()) .detail("Status", BackupAgentBase::getStateText(status)); - #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = tag.cancel(tr); - #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = finishCurTenantBlockStartNewIfNeeded(self, k, StringRef(), false, SnapshotBackupUseTenantCache::True); + #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1when1(EBackupState const& status,int loopDepth) + int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(status, loopDepth); + loopDepth = a_body1cont3(_, loopDepth); return loopDepth; } - int a_body1cont1when1(EBackupState && status,int loopDepth) + int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2(std::move(status), loopDepth); + loopDepth = a_body1cont3(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AbortFiveOneBackupActor, 1, EBackupState >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKey_implActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< AbortFiveOneBackupActor, 1, EBackupState >*,EBackupState const& value) + void a_callback_fire(ActorCallback< WriteKey_implActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 1); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -5765,12 +5901,12 @@ class AbortFiveOneBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< AbortFiveOneBackupActor, 1, EBackupState >*,EBackupState && value) + void a_callback_fire(ActorCallback< WriteKey_implActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 1); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -5780,12 +5916,12 @@ class AbortFiveOneBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< AbortFiveOneBackupActor, 1, EBackupState >*,Error err) + void a_callback_error(ActorCallback< WriteKey_implActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 1); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -5795,104 +5931,116 @@ class AbortFiveOneBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 1); } - int a_body1cont3(Void const& _,int loopDepth) + int a_body1cont4(bool const& createdNewBlock,int loopDepth) { - #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key configPath = uidPrefixKey(logRangesRange.begin, config.getUid()); - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key logsPath = uidPrefixKey(backupLogKeys.begin, config.getUid()); - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->clear(KeyRangeRef(configPath, strinc(configPath))); - #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->clear(KeyRangeRef(logsPath, strinc(logsPath))); - #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config.stateEnum().set(tr, EBackupState::STATE_ABORTED); - #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortFiveOneBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 5815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~AbortFiveOneBackupActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (createdNewBlock) + #line 5941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKey_implActorState(); static_cast(this)->destroy(); return 0; } + #line 5945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteKey_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + appendStringRefWithLenToBuffer(self, &k); + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->lastKey = k; + #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKey_implActorState(); static_cast(this)->destroy(); return 0; } + #line 5957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteKey_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1cont3(Void && _,int loopDepth) + int a_body1cont4(bool && createdNewBlock,int loopDepth) { - #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key configPath = uidPrefixKey(logRangesRange.begin, config.getUid()); - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key logsPath = uidPrefixKey(backupLogKeys.begin, config.getUid()); - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->clear(KeyRangeRef(configPath, strinc(configPath))); - #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->clear(KeyRangeRef(logsPath, strinc(logsPath))); - #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config.stateEnum().set(tr, EBackupState::STATE_ABORTED); - #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortFiveOneBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 5837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~AbortFiveOneBackupActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (createdNewBlock) + #line 5969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKey_implActorState(); static_cast(this)->destroy(); return 0; } + #line 5973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteKey_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + appendStringRefWithLenToBuffer(self, &k); + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->lastKey = k; + #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKey_implActorState(); static_cast(this)->destroy(); return 0; } + #line 5985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteKey_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1cont2when1(Void const& _,int loopDepth) + int a_body1cont3when1(bool const& createdNewBlock,int loopDepth) { - loopDepth = a_body1cont3(_, loopDepth); + loopDepth = a_body1cont4(createdNewBlock, loopDepth); return loopDepth; } - int a_body1cont2when1(Void && _,int loopDepth) + int a_body1cont3when1(bool && createdNewBlock,int loopDepth) { - loopDepth = a_body1cont3(std::move(_), loopDepth); + loopDepth = a_body1cont4(std::move(createdNewBlock), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AbortFiveOneBackupActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKey_implActor, 2, bool >::remove(); } - void a_callback_fire(ActorCallback< AbortFiveOneBackupActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< WriteKey_implActor, 2, bool >*,bool const& value) { - fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 2); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2when1(value, 0); + a_body1cont3when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 2); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< AbortFiveOneBackupActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< WriteKey_implActor, 2, bool >*,bool && value) { - fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 2); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2when1(std::move(value), 0); + a_body1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 2); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< AbortFiveOneBackupActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< WriteKey_implActor, 2, bool >*,Error err) { - fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 2); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -5902,50 +6050,42 @@ class AbortFiveOneBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 2); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 2); } - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - FileBackupAgent* backupAgent; - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference tr; - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string tagName; - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - KeyBackedTag tag; - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - UidAndAbortedFlagT current; - #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - BackupConfig config; - #line 5920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptedRangeFileWriter* self; + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key k; + #line 6060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via abortFiveOneBackup() - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class AbortFiveOneBackupActor final : public Actor, public ActorCallback< AbortFiveOneBackupActor, 0, UidAndAbortedFlagT >, public ActorCallback< AbortFiveOneBackupActor, 1, EBackupState >, public ActorCallback< AbortFiveOneBackupActor, 2, Void >, public FastAllocated, public AbortFiveOneBackupActorState { - #line 5925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via writeKey_impl() + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class WriteKey_implActor final : public Actor, public ActorCallback< WriteKey_implActor, 0, Void >, public ActorCallback< WriteKey_implActor, 1, Void >, public ActorCallback< WriteKey_implActor, 2, bool >, public FastAllocated, public WriteKey_implActorState { + #line 6065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< AbortFiveOneBackupActor, 0, UidAndAbortedFlagT >; -friend struct ActorCallback< AbortFiveOneBackupActor, 1, EBackupState >; -friend struct ActorCallback< AbortFiveOneBackupActor, 2, Void >; - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - AbortFiveOneBackupActor(FileBackupAgent* const& backupAgent,Reference const& tr,std::string const& tagName) - #line 5938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +friend struct ActorCallback< WriteKey_implActor, 0, Void >; +friend struct ActorCallback< WriteKey_implActor, 1, Void >; +friend struct ActorCallback< WriteKey_implActor, 2, bool >; + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + WriteKey_implActor(EncryptedRangeFileWriter* const& self,Key const& k) + #line 6078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), - AbortFiveOneBackupActorState(backupAgent, tr, tagName) + WriteKey_implActorState(self, k) { - fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), -1); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("abortFiveOneBackup"); + this->lineage.setActorName("writeKey_impl"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), -1); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), -1); } void cancel() override @@ -5953,71 +6093,70 @@ friend struct ActorCallback< AbortFiveOneBackupActor, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< AbortFiveOneBackupActor, 0, UidAndAbortedFlagT >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< AbortFiveOneBackupActor, 1, EBackupState >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< AbortFiveOneBackupActor, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< WriteKey_implActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WriteKey_implActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< WriteKey_implActor, 2, bool >*)0, actor_cancelled()); break; } } }; - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future abortFiveOneBackup( FileBackupAgent* const& backupAgent, Reference const& tr, std::string const& tagName ) { - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new AbortFiveOneBackupActor(backupAgent, tr, tagName)); - #line 5967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future writeKey_impl( EncryptedRangeFileWriter* const& self, Key const& k ) { + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new WriteKey_implActor(self, k)); + #line 6107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -struct AbortFiveOneBackupTask : TaskFuncBase { - static StringRef name; - #line 5974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via _finish() - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class _finishActor1State { - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + Future writeKey(Key k) { return writeKey_impl(this, k); } + + #line 6114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via finish_impl() + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class Finish_implActorState { + #line 6120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - _finishActor1State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : tr(tr), - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - taskBucket(taskBucket), - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - futureBucket(futureBucket), - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - task(task), - #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backupAgent(), - #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config(task) - #line 5997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Finish_implActorState(EncryptedRangeFileWriter* const& self) + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : self(self) + #line 6127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("_finish", reinterpret_cast(this)); + fdb_probe_actor_create("finish_impl", reinterpret_cast(this)); } - ~_finishActor1State() + ~Finish_implActorState() { - fdb_probe_actor_destroy("_finish", reinterpret_cast(this)); + fdb_probe_actor_destroy("finish_impl", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = config.tag().getOrThrow(tr); - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast<_finishActor1*>(this)->actor_wait_state = 1; - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor1*>(this))); - #line 6019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (currentBufferSize(self) > 0) + #line 6142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = encrypt(self); + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -6029,183 +6168,108 @@ class _finishActor1State { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~_finishActor1State(); - static_cast<_finishActor1*>(this)->sendErrorAndDelPromiseRef(error); + this->~Finish_implActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TEST(true); - #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevInfo, "FileBackupCancelFiveOneTask") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("TagName", tagName); - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = abortFiveOneBackup(&backupAgent, tr, tagName); - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast<_finishActor1*>(this)->actor_wait_state = 2; - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor1*>(this))); - #line 6053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1when1(std::string const& __tagName,int loopDepth) - { - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tagName = __tagName; - #line 6062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); - - return loopDepth; - } - int a_body1when1(std::string && __tagName,int loopDepth) - { - tagName = std::move(__tagName); - loopDepth = a_body1cont1(loopDepth); + #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Finish_implActorState(); static_cast(this)->destroy(); return 0; } + #line 6181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~Finish_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - void a_exitChoose1() - { - if (static_cast<_finishActor1*>(this)->actor_wait_state > 0) static_cast<_finishActor1*>(this)->actor_wait_state = 0; - static_cast<_finishActor1*>(this)->ActorCallback< _finishActor1, 0, std::string >::remove(); - - } - void a_callback_fire(ActorCallback< _finishActor1, 0, std::string >*,std::string const& value) - { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< _finishActor1, 0, std::string >*,std::string && value) - { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< _finishActor1, 0, std::string >*,Error err) - { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); - - } int a_body1cont2(Void const& _,int loopDepth) { - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = taskBucket->finish(tr, task); - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast<_finishActor1*>(this)->actor_wait_state = 3; - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor1*>(this))); - #line 6136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = self->file->append(self->buffer.begin(), currentBufferSize(self)); + #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = taskBucket->finish(tr, task); - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast<_finishActor1*>(this)->actor_wait_state = 3; - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor1*>(this))); - #line 6152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = self->file->append(self->buffer.begin(), currentBufferSize(self)); + #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { loopDepth = a_body1cont2(_, loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1when1(Void && _,int loopDepth) { loopDepth = a_body1cont2(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose1() { - if (static_cast<_finishActor1*>(this)->actor_wait_state > 0) static_cast<_finishActor1*>(this)->actor_wait_state = 0; - static_cast<_finishActor1*>(this)->ActorCallback< _finishActor1, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< Finish_implActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< _finishActor1, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< Finish_implActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("finish_impl", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); + fdb_probe_actor_exit("finish_impl", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< _finishActor1, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< Finish_implActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("finish_impl", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); + fdb_probe_actor_exit("finish_impl", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< _finishActor1, 1, Void >*,Error err) + void a_callback_error(ActorCallback< Finish_implActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("finish_impl", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1Catch1(err, 0); } @@ -6214,30 +6278,18 @@ class _finishActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); + fdb_probe_actor_exit("finish_impl", reinterpret_cast(this), 0); } int a_body1cont3(Void const& _,int loopDepth) { - #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_finishActor1*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor1State(); static_cast<_finishActor1*>(this)->destroy(); return 0; } - #line 6224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_finishActor1*>(this)->SAV< Void >::value()) Void(Void()); - this->~_finishActor1State(); - static_cast<_finishActor1*>(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont1(loopDepth); return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_finishActor1*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor1State(); static_cast<_finishActor1*>(this)->destroy(); return 0; } - #line 6236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_finishActor1*>(this)->SAV< Void >::value()) Void(Void()); - this->~_finishActor1State(); - static_cast<_finishActor1*>(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont1(loopDepth); return loopDepth; } @@ -6253,16 +6305,16 @@ class _finishActor1State { return loopDepth; } - void a_exitChoose3() + void a_exitChoose2() { - if (static_cast<_finishActor1*>(this)->actor_wait_state > 0) static_cast<_finishActor1*>(this)->actor_wait_state = 0; - static_cast<_finishActor1*>(this)->ActorCallback< _finishActor1, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< Finish_implActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< _finishActor1, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< Finish_implActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("finish_impl", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1cont2when1(value, 0); } @@ -6271,13 +6323,13 @@ class _finishActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); + fdb_probe_actor_exit("finish_impl", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< _finishActor1, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< Finish_implActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("finish_impl", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1cont2when1(std::move(value), 0); } @@ -6286,13 +6338,13 @@ class _finishActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); + fdb_probe_actor_exit("finish_impl", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< _finishActor1, 2, Void >*,Error err) + void a_callback_error(ActorCallback< Finish_implActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("finish_impl", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -6301,52 +6353,39 @@ class _finishActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); + fdb_probe_actor_exit("finish_impl", reinterpret_cast(this), 1); } - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference tr; - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference taskBucket; - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference futureBucket; - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference task; - #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - FileBackupAgent backupAgent; - #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - BackupConfig config; - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string tagName; - #line 6321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptedRangeFileWriter* self; + #line 6361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via _finish() - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class _finishActor1 final : public Actor, public ActorCallback< _finishActor1, 0, std::string >, public ActorCallback< _finishActor1, 1, Void >, public ActorCallback< _finishActor1, 2, Void >, public FastAllocated<_finishActor1>, public _finishActor1State<_finishActor1> { - #line 6326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via finish_impl() + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class Finish_implActor final : public Actor, public ActorCallback< Finish_implActor, 0, Void >, public ActorCallback< Finish_implActor, 1, Void >, public FastAllocated, public Finish_implActorState { + #line 6366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated<_finishActor1>::operator new; - using FastAllocated<_finishActor1>::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< _finishActor1, 0, std::string >; -friend struct ActorCallback< _finishActor1, 1, Void >; -friend struct ActorCallback< _finishActor1, 2, Void >; - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - _finishActor1(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 6339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +friend struct ActorCallback< Finish_implActor, 0, Void >; +friend struct ActorCallback< Finish_implActor, 1, Void >; + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Finish_implActor(EncryptedRangeFileWriter* const& self) + #line 6378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), - _finishActor1State<_finishActor1>(tr, taskBucket, futureBucket, task) + Finish_implActorState(self) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), -1); + fdb_probe_actor_enter("finish_impl", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("_finish"); + this->lineage.setActorName("finish_impl"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("_finish", reinterpret_cast(this), -1); + fdb_probe_actor_exit("finish_impl", reinterpret_cast(this), -1); } void cancel() override @@ -6354,113 +6393,136 @@ friend struct ActorCallback< _finishActor1, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< _finishActor1, 0, std::string >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< _finishActor1, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< _finishActor1, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< Finish_implActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< Finish_implActor, 1, Void >*)0, actor_cancelled()); break; } } }; - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new _finishActor1(tr, taskBucket, futureBucket, task)); - #line 6368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future finish_impl( EncryptedRangeFileWriter* const& self ) { + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new Finish_implActor(self)); + #line 6406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StringRef getName() const override { - TraceEvent(SevError, "FileBackupError") - .detail("Cause", "AbortFiveOneBackupTaskFunc::name() should never be called"); - ASSERT(false); - return StringRef(); - } + Future finish() { return finish_impl(this); } - Future execute(Database cx, - Reference tb, - Reference fb, - Reference task) override { - return Future(Void()); - }; - Future finish(Reference tr, - Reference tb, - Reference fb, - Reference task) override { - return _finish(tr, tb, fb, task); - }; + Database cx; + Arena* arena; + EncryptionAtRestMode encryptMode; + Reference file; + Optional>> tenantCache; + int blockSize; + +private: + Standalone buffer; + uint8_t* wPtr; + StringRef encryptHeader; + uint8_t* dataPayloadStart; + int64_t blockEnd; + uint32_t fileVersion; + Options options; + Key lastKey; + Key lastValue; + SnapshotFileBackupEncryptionKeys cipherKeys; }; -StringRef AbortFiveOneBackupTask::name = LiteralStringRef("abort_legacy_backup_5.2"); -REGISTER_TASKFUNC(AbortFiveOneBackupTask); -REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_write_range); -REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_dispatch_ranges); -REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_write_logs); -REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_erase_logs); -REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_dispatch_logs); -REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_finished); -REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_write_snapshot_manifest); -REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_start); -std::function)> NOP_SETUP_TASK_FN = [](Reference task) { /* NOP */ }; - #line 6405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via addBackupTask() - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class AddBackupTaskActorState { - #line 6411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// File Format handlers. +// Both Range and Log formats are designed to be readable starting at any BACKUP_RANGEFILE_BLOCK_SIZE boundary +// so they can be read in parallel. +// +// Writer instances must be kept alive while any member actors are in progress. +// +// RangeFileWriter must be used as follows: +// 1 - writeKey(key) the queried key range begin +// 2 - writeKV(k, v) each kv pair to restore +// 3 - writeKey(key) the queried key range end +// 4 - finish() +// +// RangeFileWriter will insert the required padding, header, and extra +// end/begin keys around the 1MB boundaries as needed. +// +// Example: +// The range a-z is queries and returns c-j which covers 3 blocks. +// The client code writes keys in this sequence: +// a c d e f g h i j z +// +// H = header P = padding a...z = keys v = value | = block boundary +// +// Encoded file: H a cv dv ev P | H e ev fv gv hv P | H h hv iv jv z +// Decoded in blocks yields: +// Block 1: range [a, e) with kv pairs cv, dv +// Block 2: range [e, h) with kv pairs ev, fv, gv +// Block 3: range [h, z) with kv pairs hv, iv, jv +// +// NOTE: All blocks except for the final block will have one last +// value which will not be used. This isn't actually a waste since +// if the next KV pair wouldn't fit within the block after the value +// then the space after the final key to the next 1MB boundary would +// just be padding anyway. +struct RangeFileWriter : public IRangeFileWriter { + RangeFileWriter(Reference file = Reference(), int blockSize = 0) + : file(file), blockSize(blockSize), blockEnd(0), fileVersion(BACKUP_AGENT_SNAPSHOT_FILE_VERSION) {} + + // Handles the first block and internal blocks. Ends current block if needed. + // The final flag is used in simulation to pad the file's final block to a whole block size + #line 6472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via newBlock() + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class NewBlockActor1State { + #line 6478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - AddBackupTaskActorState(StringRef const& name,uint32_t const& version,Reference const& tr,Reference const& taskBucket,TaskCompletionKey const& completionKey,BackupConfig const& config,Reference const& waitFor = Reference(),std::function)> const& setupTaskFn = NOP_SETUP_TASK_FN,int const& priority = 0,SetValidation const& setValidation = SetValidation::True) - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : name(name), - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - version(version), - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr(tr), - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - taskBucket(taskBucket), - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - completionKey(completionKey), - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config(config), - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - waitFor(waitFor), - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - setupTaskFn(setupTaskFn), - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - priority(priority), - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - setValidation(setValidation) - #line 6436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + NewBlockActor1State(RangeFileWriter* const& self,int const& bytesNeeded,bool const& final = false) + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : self(self), + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bytesNeeded(bytesNeeded), + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + final(final) + #line 6489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("addBackupTask", reinterpret_cast(this)); + fdb_probe_actor_create("newBlock", reinterpret_cast(this)); } - ~AddBackupTaskActorState() + ~NewBlockActor1State() { - fdb_probe_actor_destroy("addBackupTask", reinterpret_cast(this)); + fdb_probe_actor_destroy("newBlock", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int bytesLeft = self->blockEnd - self->file->size(); + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (bytesLeft > 0) + #line 6506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + paddingFFs = makePadding(bytesLeft); + #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = self->file->append(paddingFFs.begin(), bytesLeft); + #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -6472,69 +6534,77 @@ class AddBackupTaskActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~AddBackupTaskActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~NewBlockActor1State(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(Key const& doneKey,int loopDepth) + int a_body1cont1(int loopDepth) { - #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - task = Reference(new Task(name, version, doneKey, priority)); - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = config.toTask(tr, task, setValidation); - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (final) + #line 6547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(g_network->isSimulated()); + #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~NewBlockActor1State(); static_cast(this)->destroy(); return 0; } + #line 6553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~NewBlockActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->blockEnd += self->blockSize; + #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = self->file->append((uint8_t*)&self->fileVersion, sizeof(self->fileVersion)); + #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1(Key && doneKey,int loopDepth) + int a_body1cont2(Void const& _,int loopDepth) { - #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - task = Reference(new Task(name, version, doneKey, priority)); - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = config.toTask(tr, task, setValidation); - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1when1(Key const& doneKey,int loopDepth) + int a_body1cont2(Void && _,int loopDepth) { - loopDepth = a_body1cont1(doneKey, loopDepth); + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1when1(Key && doneKey,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(std::move(doneKey), loopDepth); + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AddBackupTaskActor, 0, Key >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< NewBlockActor1, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< AddBackupTaskActor, 0, Key >*,Key const& value) + void a_callback_fire(ActorCallback< NewBlockActor1, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 0); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -6544,12 +6614,12 @@ class AddBackupTaskActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 0); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< AddBackupTaskActor, 0, Key >*,Key && value) + void a_callback_fire(ActorCallback< NewBlockActor1, 0, Void >*,Void && value) { - fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 0); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -6559,12 +6629,12 @@ class AddBackupTaskActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 0); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< AddBackupTaskActor, 0, Key >*,Error err) + void a_callback_error(ActorCallback< NewBlockActor1, 0, Void >*,Error err) { - fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 0); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -6574,90 +6644,80 @@ class AddBackupTaskActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 0); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 0); } - int a_body1cont2(Void const& _,int loopDepth) + int a_body1cont3(Void const& _,int loopDepth) { - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - setupTaskFn(task); - #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!waitFor) - #line 6586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (self->blockEnd > self->blockSize) + #line 6654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task)); this->~AddBackupTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 6590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task)); - this->~AddBackupTaskActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = self->file->appendStringRefWithLen(self->lastKey); + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont5(loopDepth); } - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = waitFor->onSetAddTask(tr, taskBucket, task); - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; return loopDepth; } - int a_body1cont2(Void && _,int loopDepth) + int a_body1cont3(Void && _,int loopDepth) { - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - setupTaskFn(task); - #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!waitFor) - #line 6616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (self->blockEnd > self->blockSize) + #line 6679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task)); this->~AddBackupTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 6620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task)); - this->~AddBackupTaskActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = self->file->appendStringRefWithLen(self->lastKey); + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont5(loopDepth); } - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = waitFor->onSetAddTask(tr, taskBucket, task); - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; return loopDepth; } int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + loopDepth = a_body1cont3(_, loopDepth); return loopDepth; } int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont3(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AddBackupTaskActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< NewBlockActor1, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< AddBackupTaskActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< NewBlockActor1, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 1); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -6667,12 +6727,12 @@ class AddBackupTaskActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 1); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< AddBackupTaskActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< NewBlockActor1, 1, Void >*,Void && value) { - fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 1); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -6682,12 +6742,12 @@ class AddBackupTaskActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 1); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< AddBackupTaskActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< NewBlockActor1, 1, Void >*,Error err) { - fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 1); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -6697,84 +6757,112 @@ class AddBackupTaskActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 1); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 1); } - int a_body1cont3(Void const& _,int loopDepth) + int a_body1cont5(int loopDepth) { - #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddBackupTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 6707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); - this->~AddBackupTaskActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (self->file->size() + bytesNeeded > self->blockEnd) + #line 6767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(backup_bad_block_size(), loopDepth); + #line 6771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~NewBlockActor1State(); static_cast(this)->destroy(); return 0; } + #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~NewBlockActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1cont3(Void && _,int loopDepth) + int a_body1cont6(Void const& _,int loopDepth) { - #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddBackupTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 6719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); - this->~AddBackupTaskActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = self->file->appendStringRefWithLen(self->lastKey); + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont2when1(Void const& _,int loopDepth) + int a_body1cont6(Void && _,int loopDepth) { - loopDepth = a_body1cont3(_, loopDepth); + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = self->file->appendStringRefWithLen(self->lastKey); + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont2when1(Void && _,int loopDepth) + int a_body1cont3when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont3(std::move(_), loopDepth); + loopDepth = a_body1cont6(_, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont6(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AddBackupTaskActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< NewBlockActor1, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< AddBackupTaskActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< NewBlockActor1, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 2); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2when1(value, 0); + a_body1cont3when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 2); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< AddBackupTaskActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< NewBlockActor1, 2, Void >*,Void && value) { - fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 2); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2when1(std::move(value), 0); + a_body1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 2); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< AddBackupTaskActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< NewBlockActor1, 2, Void >*,Error err) { - fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 2); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -6784,288 +6872,168 @@ class AddBackupTaskActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 2); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 2); } - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StringRef name; - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - uint32_t version; - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference tr; - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference taskBucket; - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TaskCompletionKey completionKey; - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - BackupConfig config; - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference waitFor; - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::function)> setupTaskFn; - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int priority; - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - SetValidation setValidation; - #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference task; - #line 6812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -}; -// This generated class is to be used only via addBackupTask() - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class AddBackupTaskActor final : public Actor, public ActorCallback< AddBackupTaskActor, 0, Key >, public ActorCallback< AddBackupTaskActor, 1, Void >, public ActorCallback< AddBackupTaskActor, 2, Void >, public FastAllocated, public AddBackupTaskActorState { - #line 6817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< AddBackupTaskActor, 0, Key >; -friend struct ActorCallback< AddBackupTaskActor, 1, Void >; -friend struct ActorCallback< AddBackupTaskActor, 2, Void >; - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - AddBackupTaskActor(StringRef const& name,uint32_t const& version,Reference const& tr,Reference const& taskBucket,TaskCompletionKey const& completionKey,BackupConfig const& config,Reference const& waitFor = Reference(),std::function)> const& setupTaskFn = NOP_SETUP_TASK_FN,int const& priority = 0,SetValidation const& setValidation = SetValidation::True) - #line 6830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor(), - AddBackupTaskActorState(name, version, tr, taskBucket, completionKey, config, waitFor, setupTaskFn, priority, setValidation) + int a_body1cont7(Void const& _,int loopDepth) { - fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("addBackupTask"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), -1); + #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_4 = self->file->appendStringRefWithLen(self->lastValue); + #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont7when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + return loopDepth; } - void cancel() override + int a_body1cont7(Void && _,int loopDepth) { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< AddBackupTaskActor, 0, Key >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< AddBackupTaskActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< AddBackupTaskActor, 2, Void >*)0, actor_cancelled()); break; - } + #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_4 = self->file->appendStringRefWithLen(self->lastValue); + #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont7when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + return loopDepth; } -}; - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future addBackupTask( StringRef const& name, uint32_t const& version, Reference const& tr, Reference const& taskBucket, TaskCompletionKey const& completionKey, BackupConfig const& config, Reference const& waitFor = Reference(), std::function)> const& setupTaskFn = NOP_SETUP_TASK_FN, int const& priority = 0, SetValidation const& setValidation = SetValidation::True ) { - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new AddBackupTaskActor(name, version, tr, taskBucket, completionKey, config, waitFor, setupTaskFn, priority, setValidation)); - #line 6859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -} - -#line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int a_body1cont6when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont7(_, loopDepth); -// Clears the backup ID from "backupStartedKey" to pause backup workers. - #line 6865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via clearBackupStartID() - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class ClearBackupStartIDActorState { - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -public: - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ClearBackupStartIDActorState(Reference const& tr,UID const& backupUid) - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : tr(tr), - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backupUid(backupUid) - #line 6880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + return loopDepth; + } + int a_body1cont6when1(Void && _,int loopDepth) { - fdb_probe_actor_create("clearBackupStartID", reinterpret_cast(this)); + loopDepth = a_body1cont7(std::move(_), loopDepth); + return loopDepth; } - ~ClearBackupStartIDActorState() + void a_exitChoose4() { - fdb_probe_actor_destroy("clearBackupStartID", reinterpret_cast(this)); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< NewBlockActor1, 3, Void >::remove(); } - int a_body1(int loopDepth=0) + void a_callback_fire(ActorCallback< NewBlockActor1, 3, Void >*,Void const& value) { + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 3); + a_exitChoose4(); try { - #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_0 = tr->get(backupStartedKey); - #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 6902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + a_body1cont6when1(value, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) + void a_callback_fire(ActorCallback< NewBlockActor1, 3, Void >*,Void && value) { - this->~ClearBackupStartIDActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont6when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1cont1(Optional const& started,int loopDepth) + void a_callback_error(ActorCallback< NewBlockActor1, 3, Void >*,Error err) { - #line 997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::vector> ids; - #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (started.present()) - #line 6927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ids = decodeBackupStartedValue(started.get()); - #line 6931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - auto it = std::find_if(ids.begin(), ids.end(), [=](const std::pair& p) { return p.first == backupUid; }); - #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (it != ids.end()) - #line 6937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ids.erase(it); - #line 6941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (ids.empty()) - #line 6945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("ClearBackup").detail("BackupID", backupUid); - #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->clear(backupStartedKey); - #line 6951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); } - else - { - #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->set(backupStartedKey, encodeBackupStartedValue(ids)); - #line 6957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); } - #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ClearBackupStartIDActorState(); static_cast(this)->destroy(); return 0; } - #line 6961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~ClearBackupStartIDActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 3); + + } + int a_body1cont8(Void const& _,int loopDepth) + { + loopDepth = a_body1cont5(loopDepth); return loopDepth; } - int a_body1cont1(Optional && started,int loopDepth) + int a_body1cont8(Void && _,int loopDepth) { - #line 997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::vector> ids; - #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (started.present()) - #line 6975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ids = decodeBackupStartedValue(started.get()); - #line 6979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - auto it = std::find_if(ids.begin(), ids.end(), [=](const std::pair& p) { return p.first == backupUid; }); - #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (it != ids.end()) - #line 6985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ids.erase(it); - #line 6989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (ids.empty()) - #line 6993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("ClearBackup").detail("BackupID", backupUid); - #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->clear(backupStartedKey); - #line 6999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - else - { - #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->set(backupStartedKey, encodeBackupStartedValue(ids)); - #line 7005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ClearBackupStartIDActorState(); static_cast(this)->destroy(); return 0; } - #line 7009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~ClearBackupStartIDActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont5(loopDepth); return loopDepth; } - int a_body1when1(Optional const& started,int loopDepth) + int a_body1cont7when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(started, loopDepth); + loopDepth = a_body1cont8(_, loopDepth); return loopDepth; } - int a_body1when1(Optional && started,int loopDepth) + int a_body1cont7when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(started), loopDepth); + loopDepth = a_body1cont8(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose5() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ClearBackupStartIDActor, 0, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< NewBlockActor1, 4, Void >::remove(); } - void a_callback_fire(ActorCallback< ClearBackupStartIDActor, 0, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< NewBlockActor1, 4, Void >*,Void const& value) { - fdb_probe_actor_enter("clearBackupStartID", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1when1(value, 0); + a_body1cont7when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("clearBackupStartID", reinterpret_cast(this), 0); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< ClearBackupStartIDActor, 0, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< NewBlockActor1, 4, Void >*,Void && value) { - fdb_probe_actor_enter("clearBackupStartID", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1when1(std::move(value), 0); + a_body1cont7when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("clearBackupStartID", reinterpret_cast(this), 0); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< ClearBackupStartIDActor, 0, Optional >*,Error err) + void a_callback_error(ActorCallback< NewBlockActor1, 4, Void >*,Error err) { - fdb_probe_actor_enter("clearBackupStartID", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), 4); + a_exitChoose5(); try { a_body1Catch1(err, 0); } @@ -7074,40 +7042,48 @@ class ClearBackupStartIDActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("clearBackupStartID", reinterpret_cast(this), 0); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), 4); } - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference tr; - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - UID backupUid; - #line 7084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + RangeFileWriter* self; + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int bytesNeeded; + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool final; + #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Value paddingFFs; + #line 7056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via clearBackupStartID() - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class ClearBackupStartIDActor final : public Actor, public ActorCallback< ClearBackupStartIDActor, 0, Optional >, public FastAllocated, public ClearBackupStartIDActorState { - #line 7089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via newBlock() + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class NewBlockActor1 final : public Actor, public ActorCallback< NewBlockActor1, 0, Void >, public ActorCallback< NewBlockActor1, 1, Void >, public ActorCallback< NewBlockActor1, 2, Void >, public ActorCallback< NewBlockActor1, 3, Void >, public ActorCallback< NewBlockActor1, 4, Void >, public FastAllocated, public NewBlockActor1State { + #line 7061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< ClearBackupStartIDActor, 0, Optional >; - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ClearBackupStartIDActor(Reference const& tr,UID const& backupUid) - #line 7100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +friend struct ActorCallback< NewBlockActor1, 0, Void >; +friend struct ActorCallback< NewBlockActor1, 1, Void >; +friend struct ActorCallback< NewBlockActor1, 2, Void >; +friend struct ActorCallback< NewBlockActor1, 3, Void >; +friend struct ActorCallback< NewBlockActor1, 4, Void >; + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + NewBlockActor1(RangeFileWriter* const& self,int const& bytesNeeded,bool const& final = false) + #line 7076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), - ClearBackupStartIDActorState(tr, backupUid) + NewBlockActor1State(self, bytesNeeded, final) { - fdb_probe_actor_enter("clearBackupStartID", reinterpret_cast(this), -1); + fdb_probe_actor_enter("newBlock", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("clearBackupStartID"); + this->lineage.setActorName("newBlock"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("clearBackupStartID", reinterpret_cast(this), -1); + fdb_probe_actor_exit("newBlock", reinterpret_cast(this), -1); } void cancel() override @@ -7115,90 +7091,83 @@ friend struct ActorCallback< ClearBackupStartIDActor, 0, Optional >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ClearBackupStartIDActor, 0, Optional >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< NewBlockActor1, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< NewBlockActor1, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< NewBlockActor1, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< NewBlockActor1, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< NewBlockActor1, 4, Void >*)0, actor_cancelled()); break; } } }; - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future clearBackupStartID( Reference const& tr, UID const& backupUid ) { - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new ClearBackupStartIDActor(tr, backupUid)); - #line 7127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future newBlock( RangeFileWriter* const& self, int const& bytesNeeded, bool const& final = false ) { + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new NewBlockActor1(self, bytesNeeded, final)); + #line 7107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -// Backup and Restore taskFunc definitions will inherit from one of the following classes which -// servers to catch and log to the appropriate config any error that execute/finish didn't catch and log. -struct RestoreTaskFuncBase : TaskFuncBase { - Future handleError(Database cx, Reference task, Error const& error) final { - return RestoreConfig(task).logError( - cx, - error, - format("'%s' on '%s'", error.what(), task->params[Task::reservedTaskParamKeyType].printable().c_str())); + // Used in simulation only to create backup file sizes which are an integer multiple of the block size + Future padEnd(bool final) { + ASSERT(g_network->isSimulated()); + if (file->size() > 0) { + return newBlock(this, 0, final); + } + return Void(); } - virtual std::string toString(Reference task) const { return ""; } -}; -struct BackupTaskFuncBase : TaskFuncBase { - Future handleError(Database cx, Reference task, Error const& error) final { - return BackupConfig(task).logError( - cx, - error, - format("'%s' on '%s'", error.what(), task->params[Task::reservedTaskParamKeyType].printable().c_str())); + // Ends the current block if necessary based on bytesNeeded. + Future newBlockIfNeeded(int bytesNeeded) { + if (file->size() + bytesNeeded > blockEnd) + return newBlock(this, bytesNeeded); + return Void(); } - virtual std::string toString(Reference task) const { return ""; } -}; - #line 7154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via getBlockOfShards() - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class GetBlockOfShardsActorState { - #line 7160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + // Start a new block if needed, then write the key and value + #line 7129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via writeKV_impl() + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class WriteKV_implActor1State { + #line 7135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - GetBlockOfShardsActorState(Reference const& tr,Key const& beginKey,Key const& endKey,int const& limit) - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : tr(tr), - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - beginKey(beginKey), - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - endKey(endKey), - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - limit(limit) - #line 7173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + WriteKV_implActor1State(RangeFileWriter* const& self,Key const& k,Value const& v) + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : self(self), + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + k(k), + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + v(v) + #line 7146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("getBlockOfShards", reinterpret_cast(this)); + fdb_probe_actor_create("writeKV_impl", reinterpret_cast(this)); } - ~GetBlockOfShardsActorState() + ~WriteKV_implActor1State() { - fdb_probe_actor_destroy("getBlockOfShards", reinterpret_cast(this)); + fdb_probe_actor_destroy("writeKV_impl", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - results = Standalone>(); - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = tr->getRange( KeyRangeRef(keyAfter(beginKey.withPrefix(keyServersPrefix)), endKey.withPrefix(keyServersPrefix)), limit); - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int toWrite = sizeof(int32_t) + k.size() + sizeof(int32_t) + v.size(); + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = self->newBlockIfNeeded(toWrite); + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7211,73 +7180,65 @@ class GetBlockOfShardsActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~GetBlockOfShardsActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~WriteKV_implActor1State(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(RangeResult const& values,int loopDepth) + int a_body1cont1(Void const& _,int loopDepth) { - #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for( auto& s : values ) { - #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - KeyRef k = s.key.removePrefix(keyServersPrefix); - #line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - results.push_back_deep(results.arena(), k); - #line 7228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetBlockOfShardsActorState(); static_cast(this)->destroy(); return 0; } - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO - this->~GetBlockOfShardsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = self->file->appendStringRefWithLen(k); + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont1(RangeResult && values,int loopDepth) + int a_body1cont1(Void && _,int loopDepth) { - #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for( auto& s : values ) { - #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - KeyRef k = s.key.removePrefix(keyServersPrefix); - #line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - results.push_back_deep(results.arena(), k); - #line 7248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetBlockOfShardsActorState(); static_cast(this)->destroy(); return 0; } - #line 7252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO - this->~GetBlockOfShardsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = self->file->appendStringRefWithLen(k); + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1when1(RangeResult const& values,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(values, loopDepth); + loopDepth = a_body1cont1(_, loopDepth); return loopDepth; } - int a_body1when1(RangeResult && values,int loopDepth) + int a_body1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(values), loopDepth); + loopDepth = a_body1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetBlockOfShardsActor, 0, RangeResult >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKV_implActor1, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< GetBlockOfShardsActor, 0, RangeResult >*,RangeResult const& value) + void a_callback_fire(ActorCallback< WriteKV_implActor1, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("getBlockOfShards", reinterpret_cast(this), 0); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -7287,12 +7248,12 @@ class GetBlockOfShardsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getBlockOfShards", reinterpret_cast(this), 0); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetBlockOfShardsActor, 0, RangeResult >*,RangeResult && value) + void a_callback_fire(ActorCallback< WriteKV_implActor1, 0, Void >*,Void && value) { - fdb_probe_actor_enter("getBlockOfShards", reinterpret_cast(this), 0); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -7302,12 +7263,12 @@ class GetBlockOfShardsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getBlockOfShards", reinterpret_cast(this), 0); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetBlockOfShardsActor, 0, RangeResult >*,Error err) + void a_callback_error(ActorCallback< WriteKV_implActor1, 0, Void >*,Error err) { - fdb_probe_actor_enter("getBlockOfShards", reinterpret_cast(this), 0); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -7317,46 +7278,234 @@ class GetBlockOfShardsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getBlockOfShards", reinterpret_cast(this), 0); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); } - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference tr; - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key beginKey; - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key endKey; - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int limit; - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Standalone> results; - #line 7333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + int a_body1cont2(Void const& _,int loopDepth) + { + #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = self->file->appendStringRefWithLen(v); + #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = self->file->appendStringRefWithLen(v); + #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKV_implActor1, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WriteKV_implActor1, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< WriteKV_implActor1, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< WriteKV_implActor1, 1, Void >*,Error err) + { + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); + + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 1077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->lastKey = k; + #line 1078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->lastValue = v; + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKV_implActor1State(); static_cast(this)->destroy(); return 0; } + #line 7387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteKV_implActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 1077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->lastKey = k; + #line 1078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->lastValue = v; + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKV_implActor1State(); static_cast(this)->destroy(); return 0; } + #line 7403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteKV_implActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKV_implActor1, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WriteKV_implActor1, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< WriteKV_implActor1, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< WriteKV_implActor1, 2, Void >*,Error err) + { + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); + + } + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + RangeFileWriter* self; + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key k; + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Value v; + #line 7480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via getBlockOfShards() - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class GetBlockOfShardsActor final : public Actor>>, public ActorCallback< GetBlockOfShardsActor, 0, RangeResult >, public FastAllocated, public GetBlockOfShardsActorState { - #line 7338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via writeKV_impl() + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class WriteKV_implActor1 final : public Actor, public ActorCallback< WriteKV_implActor1, 0, Void >, public ActorCallback< WriteKV_implActor1, 1, Void >, public ActorCallback< WriteKV_implActor1, 2, Void >, public FastAllocated, public WriteKV_implActor1State { + #line 7485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetBlockOfShardsActor, 0, RangeResult >; - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - GetBlockOfShardsActor(Reference const& tr,Key const& beginKey,Key const& endKey,int const& limit) - #line 7349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor>>(), - GetBlockOfShardsActorState(tr, beginKey, endKey, limit) +friend struct ActorCallback< WriteKV_implActor1, 0, Void >; +friend struct ActorCallback< WriteKV_implActor1, 1, Void >; +friend struct ActorCallback< WriteKV_implActor1, 2, Void >; + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + WriteKV_implActor1(RangeFileWriter* const& self,Key const& k,Value const& v) + #line 7498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + WriteKV_implActor1State(self, k, v) { - fdb_probe_actor_enter("getBlockOfShards", reinterpret_cast(this), -1); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getBlockOfShards"); + this->lineage.setActorName("writeKV_impl"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("getBlockOfShards", reinterpret_cast(this), -1); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), -1); } void cancel() override @@ -7364,105 +7513,65 @@ friend struct ActorCallback< GetBlockOfShardsActor, 0, RangeResult >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetBlockOfShardsActor, 0, RangeResult >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< WriteKV_implActor1, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WriteKV_implActor1, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< WriteKV_implActor1, 2, Void >*)0, actor_cancelled()); break; } } }; - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future>> getBlockOfShards( Reference const& tr, Key const& beginKey, Key const& endKey, int const& limit ) { - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future>>(new GetBlockOfShardsActor(tr, beginKey, endKey, limit)); - #line 7376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future writeKV_impl( RangeFileWriter* const& self, Key const& k, Value const& v ) { + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new WriteKV_implActor1(self, k, v)); + #line 7527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - -struct BackupRangeTaskFunc : BackupTaskFuncBase { - static StringRef name; - static constexpr uint32_t version = 1; - - static struct { - static TaskParam beginKey() { return LiteralStringRef(__FUNCTION__); } - static TaskParam endKey() { return LiteralStringRef(__FUNCTION__); } - static TaskParam addBackupRangeTasks() { return LiteralStringRef(__FUNCTION__); } - } Params; - - std::string toString(Reference task) const override { - return format("beginKey '%s' endKey '%s' addTasks %d", - Params.beginKey().get(task).printable().c_str(), - Params.endKey().get(task).printable().c_str(), - Params.addBackupRangeTasks().get(task)); - } - - StringRef getName() const override { return name; }; +#line 1081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Future execute(Database cx, - Reference tb, - Reference fb, - Reference task) override { - return _execute(cx, tb, fb, task); - }; - Future finish(Reference tr, - Reference tb, - Reference fb, - Reference task) override { - return _finish(tr, tb, fb, task); - }; + Future writeKV(Key k, Value v) { return writeKV_impl(this, k, v); } - // Finish (which flushes/syncs) the file, and then in a single transaction, make some range backup progress durable. - // This means: - // - increment the backup config's range bytes written - // - update the range file map - // - update the task begin key - // - save/extend the task with the new params - // Returns whether or not the caller should continue executing the task. - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via finishRangeFile() - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class FinishRangeFileActorState { - #line 7426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + // Write begin key or end key. + #line 7535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via writeKey_impl() + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class WriteKey_implActor1State { + #line 7541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - FinishRangeFileActorState(Reference const& file,Database const& cx,Reference const& task,Reference const& taskBucket,KeyRange const& range,Version const& version) - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : file(file), - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - cx(cx), - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - task(task), - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - taskBucket(taskBucket), - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - range(range), - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - version(version) - #line 7443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + WriteKey_implActor1State(RangeFileWriter* const& self,Key const& k) + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : self(self), + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + k(k) + #line 7550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("finishRangeFile", reinterpret_cast(this)); + fdb_probe_actor_create("writeKey_impl", reinterpret_cast(this)); } - ~FinishRangeFileActorState() + ~WriteKey_implActor1State() { - fdb_probe_actor_destroy("finishRangeFile", reinterpret_cast(this)); + fdb_probe_actor_destroy("writeKey_impl", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = file->finish(); - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int toWrite = sizeof(uint32_t) + k.size(); + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = self->newBlockIfNeeded(toWrite); + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7475,76 +7584,40 @@ class FinishRangeFileActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FinishRangeFileActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~WriteKey_implActor1State(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(Void const& _,int loopDepth) { - #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (range.empty()) - #line 7488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(false); this->~FinishRangeFileActorState(); static_cast(this)->destroy(); return 0; } - #line 7492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(false); - this->~FinishRangeFileActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr = Reference(new ReadYourWritesTransaction(cx)); - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backup = BackupConfig(task); - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - usedFile = false; - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = task->extendMutex.take(); - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = self->file->appendStringRefWithLen(k); + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (range.empty()) - #line 7522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(false); this->~FinishRangeFileActorState(); static_cast(this)->destroy(); return 0; } - #line 7526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(false); - this->~FinishRangeFileActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr = Reference(new ReadYourWritesTransaction(cx)); - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backup = BackupConfig(task); - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - usedFile = false; - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = task->extendMutex.take(); - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = self->file->appendStringRefWithLen(k); + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -7563,13 +7636,13 @@ class FinishRangeFileActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FinishRangeFileActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKey_implActor1, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FinishRangeFileActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< WriteKey_implActor1, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 0); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -7579,12 +7652,12 @@ class FinishRangeFileActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 0); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FinishRangeFileActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< WriteKey_implActor1, 0, Void >*,Void && value) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 0); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -7594,12 +7667,12 @@ class FinishRangeFileActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 0); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FinishRangeFileActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< WriteKey_implActor1, 0, Void >*,Error err) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 0); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -7609,28 +7682,30 @@ class FinishRangeFileActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 0); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 0); } int a_body1cont2(Void const& _,int loopDepth) { - #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - releaser = FlowLock::Releaser(task->extendMutex, 1); - #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 7621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont2loopHead1(loopDepth); + #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKey_implActor1State(); static_cast(this)->destroy(); return 0; } + #line 7692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteKey_implActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - releaser = FlowLock::Releaser(task->extendMutex, 1); - #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 7632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont2loopHead1(loopDepth); + #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKey_implActor1State(); static_cast(this)->destroy(); return 0; } + #line 7704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteKey_implActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } @@ -7648,13 +7723,13 @@ class FinishRangeFileActorState { } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FinishRangeFileActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKey_implActor1, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< FinishRangeFileActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< WriteKey_implActor1, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 1); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -7664,12 +7739,12 @@ class FinishRangeFileActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 1); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< FinishRangeFileActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< WriteKey_implActor1, 1, Void >*,Void && value) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 1); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -7679,12 +7754,12 @@ class FinishRangeFileActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 1); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< FinishRangeFileActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< WriteKey_implActor1, 1, Void >*,Error err) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 1); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -7694,61 +7769,129 @@ class FinishRangeFileActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 1); - - } - int a_body1cont4(int loopDepth) - { - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(usedFile); this->~FinishRangeFileActorState(); static_cast(this)->destroy(); return 0; } - #line 7704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(std::move(usedFile)); // state_var_RVO - this->~FinishRangeFileActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1cont2loopHead1(int loopDepth) + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + RangeFileWriter* self; + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key k; + #line 7779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via writeKey_impl() + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class WriteKey_implActor1 final : public Actor, public ActorCallback< WriteKey_implActor1, 0, Void >, public ActorCallback< WriteKey_implActor1, 1, Void >, public FastAllocated, public WriteKey_implActor1State { + #line 7784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< WriteKey_implActor1, 0, Void >; +friend struct ActorCallback< WriteKey_implActor1, 1, Void >; + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + WriteKey_implActor1(RangeFileWriter* const& self,Key const& k) + #line 7796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + WriteKey_implActor1State(self, k) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont2loopBody1(loopDepth); + fdb_probe_actor_enter("writeKey_impl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("writeKey_impl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("writeKey_impl", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1cont2loopBody1(int loopDepth) + void cancel() override { - try { - #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Params.beginKey().set(task, range.end); - #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = taskBucket->extendTimeout(tr, task, UpdateParams::True); - #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 7732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont2loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2loopBody1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont2loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont2loopBody1Catch1(unknown_error(), loopDepth); + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< WriteKey_implActor1, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WriteKey_implActor1, 1, Void >*)0, actor_cancelled()); break; } - return loopDepth; } - int a_body1cont2break1(int loopDepth) - { +}; + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future writeKey_impl( RangeFileWriter* const& self, Key const& k ) { + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new WriteKey_implActor1(self, k)); + #line 7824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + Future writeKey(Key k) { return writeKey_impl(this, k); } + + Future finish() { return Void(); } + + Reference file; + int blockSize; + +private: + int64_t blockEnd; + uint32_t fileVersion; + Key lastKey; + Key lastValue; +}; + + #line 7843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via decodeKVPairs() + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class DecodeKVPairsActorState { + #line 7849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DecodeKVPairsActorState(StringRefReader* const& reader,Standalone>* const& results,bool const& encryptedBlock,EncryptionAtRestMode const& encryptMode,Optional const& blockDomainId,Optional>> const& tenantCache) + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : reader(reader), + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + results(results), + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptedBlock(encryptedBlock), + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptMode(encryptMode), + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + blockDomainId(blockDomainId), + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tenantCache(tenantCache), + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + kLen(reader->consumeNetworkUInt32()), + #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + k(reader->consume(kLen)) + #line 7870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("decodeKVPairs", reinterpret_cast(this)); + + } + ~DecodeKVPairsActorState() + { + fdb_probe_actor_destroy("decodeKVPairs", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { try { - return a_body1cont4(loopDepth); + #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + results->push_back(results->arena(), KeyValueRef(KeyRef(k, kLen), ValueRef())); + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + prevKey = KeyRef(k, kLen); + #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + done = false; + #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + prevDomainId = Optional(); + #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 7893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -7758,382 +7901,561 @@ class FinishRangeFileActorState { return loopDepth; } - int a_body1cont2loopBody1cont1(int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - if (loopDepth == 0) return a_body1cont2loopHead1(0); + this->~DecodeKVPairsActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1cont2loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1cont1(int loopDepth) + { + #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto b : reader->remainder() ) { + #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (b != 0xFF) + #line 7918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(restore_corrupted_data_padding(), loopDepth); + #line 7922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + } + #line 1190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DecodeKVPairsActorState(); static_cast(this)->destroy(); return 0; } + #line 7927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DecodeKVPairsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + kLen = reader->consumeNetworkUInt32(); + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + k = reader->consume(kLen); + #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (encryptedBlock && g_network && g_network->isSimulated()) + #line 7950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(blockDomainId.present()); + #line 1129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + curKey = KeyRef(k, kLen); + #line 1130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!prevDomainId.present()) + #line 7958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = EncryptedRangeFileWriter::getEncryptionDomainDetails( prevKey, encryptMode, tenantCache, SnapshotBackupUseTenantCache::False); + #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 7964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont2(loopDepth); + } + } + else + { + loopDepth = a_body1loopBody1cont1(loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) { try { - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_5 = tr->onError(e); - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1Catch1when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + return a_body1cont1(loopDepth); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont2loopBody1cont2(int loopDepth) + int a_body1loopBody1cont1(int loopDepth) { - #line 1130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backup.rangeBytesWritten().atomicOp(tr, file->size(), MutationRef::AddValue); - #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backup.snapshotRangeFileCount().atomicOp(tr, 1, MutationRef::AddValue); - #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_3 = backup.snapshotRangeFileMap().get(tr, range.end); - #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 7800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont2loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 7805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (reader->eof() || *reader->rptr == 0xFF) + #line 8001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + results->push_back(results->arena(), KeyValueRef(KeyRef(k, kLen), ValueRef())); + #line 8005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + vLen = reader->consumeNetworkUInt32(); + #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + v = reader->consume(vLen); + #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (tenantCache.present() && !isSystemKey(KeyRef(k, kLen))) + #line 8014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tenantId = TenantAPI::extractTenantIdFromKeyRef(StringRef(k, kLen)); + #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture>> __when_expr_3 = tenantCache.get()->getById(tenantId); + #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 8022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 8027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + results->push_back(results->arena(), KeyValueRef(KeyRef(k, kLen), ValueRef(v, vLen))); + #line 8034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont13(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 1135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = EncryptedRangeFileWriter::getEncryptionDomainDetails( curKey, encryptMode, tenantCache, SnapshotBackupUseTenantCache::False); + #line 1135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 8046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 8051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont2loopBody1when1(Version const& __newTimeout,int loopDepth) + int a_body1loopBody1cont3(EncryptCipherDomainId const& domainId,int loopDepth) { - #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - newTimeout = __newTimeout; - #line 7814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont2loopBody1cont2(loopDepth); + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + prevDomainId = domainId; + #line 8060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } - int a_body1cont2loopBody1when1(Version && __newTimeout,int loopDepth) + int a_body1loopBody1cont3(EncryptCipherDomainId && domainId,int loopDepth) { - newTimeout = std::move(__newTimeout); - loopDepth = a_body1cont2loopBody1cont2(loopDepth); + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + prevDomainId = domainId; + #line 8069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } - void a_exitChoose3() + int a_body1loopBody1when1(EncryptCipherDomainId const& domainId,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FinishRangeFileActor, 2, Version >::remove(); + loopDepth = a_body1loopBody1cont3(domainId, loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< FinishRangeFileActor, 2, Version >*,Version const& value) + int a_body1loopBody1when1(EncryptCipherDomainId && domainId,int loopDepth) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 2); - a_exitChoose3(); + loopDepth = a_body1loopBody1cont3(std::move(domainId), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeKVPairsActor, 0, EncryptCipherDomainId >::remove(); + + } + void a_callback_fire(ActorCallback< DecodeKVPairsActor, 0, EncryptCipherDomainId >*,EncryptCipherDomainId const& value) + { + fdb_probe_actor_enter("decodeKVPairs", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont2loopBody1when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 2); + fdb_probe_actor_exit("decodeKVPairs", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FinishRangeFileActor, 2, Version >*,Version && value) + void a_callback_fire(ActorCallback< DecodeKVPairsActor, 0, EncryptCipherDomainId >*,EncryptCipherDomainId && value) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("decodeKVPairs", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont2loopBody1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 2); + fdb_probe_actor_exit("decodeKVPairs", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FinishRangeFileActor, 2, Version >*,Error err) + void a_callback_error(ActorCallback< DecodeKVPairsActor, 0, EncryptCipherDomainId >*,Error err) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("decodeKVPairs", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont2loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 2); + fdb_probe_actor_exit("decodeKVPairs", reinterpret_cast(this), 0); } - int a_body1cont2loopBody1cont3(Optional const& s,int loopDepth) + int a_body1loopBody1cont5(int loopDepth) { - #line 1135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!s.present() || s.get().begin >= range.begin) - #line 7881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!curKey.empty() && !prevKey.empty() && prevDomainId.get() != curDomainId) + #line 8141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backup.snapshotRangeFileMap().set( tr, range.end, { range.begin, version, file->getFileName(), file->size() }); #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - usedFile = true; - #line 7887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + ASSERT(!done); + #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (curDomainId != SYSTEM_KEYSPACE_ENCRYPT_DOMAIN_ID && curDomainId != FDB_DEFAULT_ENCRYPT_DOMAIN_ID && curKey.size() != TenantAPI::PREFIX_SIZE) + #line 8147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(tenantCache.present()); + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture>> __when_expr_2 = tenantCache.get()->getById(curDomainId); + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 8155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont5when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 8160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont7(loopDepth); + } } - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = tr->commit(); - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 7893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont2loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont2loopBody1cont3when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont2loopBody1cont3(Optional && s,int loopDepth) - { - #line 1135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!s.present() || s.get().begin >= range.begin) - #line 7907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + else { - #line 1136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backup.snapshotRangeFileMap().set( tr, range.end, { range.begin, version, file->getFileName(), file->size() }); - #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - usedFile = true; - #line 7913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont6(loopDepth); } - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = tr->commit(); - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 7919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont2loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont2loopBody1cont3when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; return loopDepth; } - int a_body1cont2loopBody1cont2when1(Optional const& s,int loopDepth) + int a_body1loopBody1cont2when1(EncryptCipherDomainId const& __curDomainId,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont3(s, loopDepth); + #line 1135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + curDomainId = __curDomainId; + #line 8179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont2when1(Optional && s,int loopDepth) + int a_body1loopBody1cont2when1(EncryptCipherDomainId && __curDomainId,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont3(std::move(s), loopDepth); + curDomainId = std::move(__curDomainId); + loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FinishRangeFileActor, 3, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeKVPairsActor, 1, EncryptCipherDomainId >::remove(); } - void a_callback_fire(ActorCallback< FinishRangeFileActor, 3, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< DecodeKVPairsActor, 1, EncryptCipherDomainId >*,EncryptCipherDomainId const& value) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("decodeKVPairs", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont2loopBody1cont2when1(value, 0); + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 3); + fdb_probe_actor_exit("decodeKVPairs", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< FinishRangeFileActor, 3, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< DecodeKVPairsActor, 1, EncryptCipherDomainId >*,EncryptCipherDomainId && value) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("decodeKVPairs", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont2loopBody1cont2when1(std::move(value), 0); + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 3); + fdb_probe_actor_exit("decodeKVPairs", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< FinishRangeFileActor, 3, Optional >*,Error err) + void a_callback_error(ActorCallback< DecodeKVPairsActor, 1, EncryptCipherDomainId >*,Error err) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("decodeKVPairs", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont2loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 3); + fdb_probe_actor_exit("decodeKVPairs", reinterpret_cast(this), 1); } - int a_body1cont2loopBody1cont4(Void const& _,int loopDepth) + int a_body1loopBody1cont6(int loopDepth) { - #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - task->timeoutVersion = newTimeout; - #line 7996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break + #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (blockDomainId.get() != FDB_DEFAULT_ENCRYPT_DOMAIN_ID && !prevKey.empty()) + #line 8246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT_EQ(prevDomainId.get(), blockDomainId.get()); + #line 8250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + prevKey = curKey; + #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + prevDomainId = curDomainId; + #line 8256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont4(Void && _,int loopDepth) + int a_body1loopBody1cont7(int loopDepth) { - #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - task->timeoutVersion = newTimeout; - #line 8005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break + #line 1146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + done = true; + #line 8265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont3when1(Void const& _,int loopDepth) + int a_body1loopBody1cont8(Optional> const& payload,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont4(_, loopDepth); + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(!payload.present()); + #line 8274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont7(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont3when1(Void && _,int loopDepth) + int a_body1loopBody1cont8(Optional> && payload,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont4(std::move(_), loopDepth); + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(!payload.present()); + #line 8283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont7(loopDepth); return loopDepth; } - void a_exitChoose5() + int a_body1loopBody1cont5when1(Optional> const& payload,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FinishRangeFileActor, 4, Void >::remove(); + loopDepth = a_body1loopBody1cont8(payload, loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< FinishRangeFileActor, 4, Void >*,Void const& value) + int a_body1loopBody1cont5when1(Optional> && payload,int loopDepth) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 4); - a_exitChoose5(); + loopDepth = a_body1loopBody1cont8(std::move(payload), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeKVPairsActor, 2, Optional> >::remove(); + + } + void a_callback_fire(ActorCallback< DecodeKVPairsActor, 2, Optional> >*,Optional> const& value) + { + fdb_probe_actor_enter("decodeKVPairs", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont2loopBody1cont3when1(value, 0); + a_body1loopBody1cont5when1(value, 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 4); + fdb_probe_actor_exit("decodeKVPairs", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< FinishRangeFileActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< DecodeKVPairsActor, 2, Optional> >*,Optional> && value) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("decodeKVPairs", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont2loopBody1cont3when1(std::move(value), 0); + a_body1loopBody1cont5when1(std::move(value), 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 4); + fdb_probe_actor_exit("decodeKVPairs", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< FinishRangeFileActor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< DecodeKVPairsActor, 2, Optional> >*,Error err) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("decodeKVPairs", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont2loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 4); + fdb_probe_actor_exit("decodeKVPairs", reinterpret_cast(this), 2); } - int a_body1cont2loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1loopBody1cont13(int loopDepth) { - loopDepth = a_body1cont2loopBody1cont1(loopDepth); + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (reader->eof() || *reader->rptr == 0xFF) + #line 8355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1cont2loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1loopBody1cont15(Optional> const& payload,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont1(loopDepth); + #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!payload.present() && !(reader->eof() || *reader->rptr == 0xFF)) + #line 8367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevWarnAlways, "SnapshotRestoreTenantNotFound").detail("TenantId", tenantId); + #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CODE_PROBE(true, "Snapshot restore tenant not found"); + #line 8373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + else + { + #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + results->push_back(results->arena(), KeyValueRef(KeyRef(k, kLen), ValueRef(v, vLen))); + #line 8379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + loopDepth = a_body1loopBody1cont13(loopDepth); return loopDepth; } - int a_body1cont2loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont15(Optional> && payload,int loopDepth) { - loopDepth = a_body1cont2loopBody1Catch1cont1(_, loopDepth); + #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!payload.present() && !(reader->eof() || *reader->rptr == 0xFF)) + #line 8389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevWarnAlways, "SnapshotRestoreTenantNotFound").detail("TenantId", tenantId); + #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CODE_PROBE(true, "Snapshot restore tenant not found"); + #line 8395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + else + { + #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + results->push_back(results->arena(), KeyValueRef(KeyRef(k, kLen), ValueRef(v, vLen))); + #line 8401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + loopDepth = a_body1loopBody1cont13(loopDepth); return loopDepth; } - int a_body1cont2loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1loopBody1cont1when1(Optional> const& payload,int loopDepth) { - loopDepth = a_body1cont2loopBody1Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont15(payload, loopDepth); return loopDepth; } - void a_exitChoose6() + int a_body1loopBody1cont1when1(Optional> && payload,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FinishRangeFileActor, 5, Void >::remove(); + loopDepth = a_body1loopBody1cont15(std::move(payload), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeKVPairsActor, 3, Optional> >::remove(); } - void a_callback_fire(ActorCallback< FinishRangeFileActor, 5, Void >*,Void const& value) + void a_callback_fire(ActorCallback< DecodeKVPairsActor, 3, Optional> >*,Optional> const& value) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("decodeKVPairs", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont2loopBody1Catch1when1(value, 0); + a_body1loopBody1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 5); + fdb_probe_actor_exit("decodeKVPairs", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< FinishRangeFileActor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< DecodeKVPairsActor, 3, Optional> >*,Optional> && value) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("decodeKVPairs", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont2loopBody1Catch1when1(std::move(value), 0); + a_body1loopBody1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 5); + fdb_probe_actor_exit("decodeKVPairs", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< FinishRangeFileActor, 5, Void >*,Error err) + void a_callback_error(ActorCallback< DecodeKVPairsActor, 3, Optional> >*,Error err) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("decodeKVPairs", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -8142,63 +8464,71 @@ class FinishRangeFileActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 5); + fdb_probe_actor_exit("decodeKVPairs", reinterpret_cast(this), 3); } - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference file; - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Database cx; - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference task; - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference taskBucket; - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - KeyRange range; - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version version; - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference tr; - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - BackupConfig backup; - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bool usedFile; - #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - FlowLock::Releaser releaser; - #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version newTimeout; - #line 8170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StringRefReader* reader; + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Standalone>* results; + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool encryptedBlock; + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptionAtRestMode encryptMode; + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional blockDomainId; + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional>> tenantCache; + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + uint32_t kLen; + #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + const uint8_t* k; + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRef prevKey; + #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool done; + #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional prevDomainId; + #line 1129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRef curKey; + #line 1135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptCipherDomainId curDomainId; + #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + uint32_t vLen; + #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + const uint8_t* v; + #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t tenantId; + #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via finishRangeFile() - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class FinishRangeFileActor final : public Actor, public ActorCallback< FinishRangeFileActor, 0, Void >, public ActorCallback< FinishRangeFileActor, 1, Void >, public ActorCallback< FinishRangeFileActor, 2, Version >, public ActorCallback< FinishRangeFileActor, 3, Optional >, public ActorCallback< FinishRangeFileActor, 4, Void >, public ActorCallback< FinishRangeFileActor, 5, Void >, public FastAllocated, public FinishRangeFileActorState { - #line 8175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via decodeKVPairs() + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class DecodeKVPairsActor final : public Actor, public ActorCallback< DecodeKVPairsActor, 0, EncryptCipherDomainId >, public ActorCallback< DecodeKVPairsActor, 1, EncryptCipherDomainId >, public ActorCallback< DecodeKVPairsActor, 2, Optional> >, public ActorCallback< DecodeKVPairsActor, 3, Optional> >, public FastAllocated, public DecodeKVPairsActorState { + #line 8507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FinishRangeFileActor, 0, Void >; -friend struct ActorCallback< FinishRangeFileActor, 1, Void >; -friend struct ActorCallback< FinishRangeFileActor, 2, Version >; -friend struct ActorCallback< FinishRangeFileActor, 3, Optional >; -friend struct ActorCallback< FinishRangeFileActor, 4, Void >; -friend struct ActorCallback< FinishRangeFileActor, 5, Void >; - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - FinishRangeFileActor(Reference const& file,Database const& cx,Reference const& task,Reference const& taskBucket,KeyRange const& range,Version const& version) - #line 8191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor(), - FinishRangeFileActorState(file, cx, task, taskBucket, range, version) +friend struct ActorCallback< DecodeKVPairsActor, 0, EncryptCipherDomainId >; +friend struct ActorCallback< DecodeKVPairsActor, 1, EncryptCipherDomainId >; +friend struct ActorCallback< DecodeKVPairsActor, 2, Optional> >; +friend struct ActorCallback< DecodeKVPairsActor, 3, Optional> >; + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DecodeKVPairsActor(StringRefReader* const& reader,Standalone>* const& results,bool const& encryptedBlock,EncryptionAtRestMode const& encryptMode,Optional const& blockDomainId,Optional>> const& tenantCache) + #line 8521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + DecodeKVPairsActorState(reader, results, encryptedBlock, encryptMode, blockDomainId, tenantCache) { - fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), -1); + fdb_probe_actor_enter("decodeKVPairs", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("finishRangeFile"); + this->lineage.setActorName("decodeKVPairs"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), -1); + fdb_probe_actor_exit("decodeKVPairs", reinterpret_cast(this), -1); } void cancel() override @@ -8206,292 +8536,106 @@ friend struct ActorCallback< FinishRangeFileActor, 5, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FinishRangeFileActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< FinishRangeFileActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< FinishRangeFileActor, 2, Version >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< FinishRangeFileActor, 3, Optional >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< FinishRangeFileActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< FinishRangeFileActor, 5, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< DecodeKVPairsActor, 0, EncryptCipherDomainId >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DecodeKVPairsActor, 1, EncryptCipherDomainId >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< DecodeKVPairsActor, 2, Optional> >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< DecodeKVPairsActor, 3, Optional> >*)0, actor_cancelled()); break; } } }; - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future finishRangeFile( Reference const& file, Database const& cx, Reference const& task, Reference const& taskBucket, KeyRange const& range, Version const& version ) { - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new FinishRangeFileActor(file, cx, task, taskBucket, range, version)); - #line 8223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future decodeKVPairs( StringRefReader* const& reader, Standalone>* const& results, bool const& encryptedBlock, EncryptionAtRestMode const& encryptMode, Optional const& blockDomainId, Optional>> const& tenantCache ) { + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new DecodeKVPairsActor(reader, results, encryptedBlock, encryptMode, blockDomainId, tenantCache)); + #line 8551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 8228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via addTask() - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class AddTaskActorState { - #line 8234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -public: - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - AddTaskActorState(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,int const& priority,Key const& begin,Key const& end,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference(),Version const& scheduledVersion = invalidVersion) - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : tr(tr), - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - taskBucket(taskBucket), - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - parentTask(parentTask), - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - priority(priority), - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - begin(begin), - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - end(end), - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - completionKey(completionKey), - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - waitFor(waitFor), - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - scheduledVersion(scheduledVersion) - #line 8257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - fdb_probe_actor_create("addTask", reinterpret_cast(this)); +static Reference getBackupContainerWithProxy(Reference _bc) { + Reference bc = IBackupContainer::openContainer(_bc->getURL(), fileBackupAgentProxy, {}); + return bc; +} - } - ~AddTaskActorState() - { - fdb_probe_actor_destroy("addTask", reinterpret_cast(this)); +Standalone> decodeRangeFileBlock(const Standalone& buf) { + Standalone> results({}, buf.arena()); + StringRefReader reader(buf, restore_corrupted_data()); - } - int a_body1(int loopDepth=0) - { - try { - #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = addBackupTask( BackupRangeTaskFunc::name, BackupRangeTaskFunc::version, tr, taskBucket, completionKey, BackupConfig(parentTask), waitFor, [=](Reference task) { Params.beginKey().set(task, begin); Params.endKey().set(task, end); Params.addBackupRangeTasks().set(task, false); if (scheduledVersion != invalidVersion) ReservedTaskParams::scheduledVersion().set(task, scheduledVersion); }, priority); - #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + // Read header, currently only decoding BACKUP_AGENT_SNAPSHOT_FILE_VERSION + if (reader.consume() != BACKUP_AGENT_SNAPSHOT_FILE_VERSION) + throw restore_unsupported_file_version(); + + // Read begin key, if this fails then block was invalid. + uint32_t kLen = reader.consumeNetworkUInt32(); + const uint8_t* k = reader.consume(kLen); + results.push_back(results.arena(), KeyValueRef(KeyRef(k, kLen), ValueRef())); + + // Read kv pairs and end key + while (1) { + // If eof reached or first value len byte is 0xFF then a valid block end was reached. + if (reader.eof() || *reader.rptr == 0xFF) { + break; } - return loopDepth; + // Read a value, which must exist or the block is invalid + uint32_t vLen = reader.consumeNetworkUInt32(); + const uint8_t* v = reader.consume(vLen); + results.push_back(results.arena(), KeyValueRef(KeyRef(k, kLen), ValueRef(v, vLen))); } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~AddTaskActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Key const& key,int loopDepth) - { - #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 8302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(key); - this->~AddTaskActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont1(Key && key,int loopDepth) - { - #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 8314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(key); - this->~AddTaskActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1when1(Key const& key,int loopDepth) - { - loopDepth = a_body1cont1(key, loopDepth); - - return loopDepth; - } - int a_body1when1(Key && key,int loopDepth) - { - loopDepth = a_body1cont1(std::move(key), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AddTaskActor, 0, Key >::remove(); - - } - void a_callback_fire(ActorCallback< AddTaskActor, 0, Key >*,Key const& value) - { - fdb_probe_actor_enter("addTask", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< AddTaskActor, 0, Key >*,Key && value) - { - fdb_probe_actor_enter("addTask", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< AddTaskActor, 0, Key >*,Error err) - { - fdb_probe_actor_enter("addTask", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); - - } - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference tr; - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference taskBucket; - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference parentTask; - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int priority; - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key begin; - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key end; - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TaskCompletionKey completionKey; - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference waitFor; - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version scheduledVersion; - #line 8403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -}; -// This generated class is to be used only via addTask() - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class AddTaskActor final : public Actor, public ActorCallback< AddTaskActor, 0, Key >, public FastAllocated, public AddTaskActorState { - #line 8408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< AddTaskActor, 0, Key >; - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - AddTaskActor(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,int const& priority,Key const& begin,Key const& end,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference(),Version const& scheduledVersion = invalidVersion) - #line 8419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor(), - AddTaskActorState(tr, taskBucket, parentTask, priority, begin, end, completionKey, waitFor, scheduledVersion) - { - fdb_probe_actor_enter("addTask", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("addTask"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("addTask", reinterpret_cast(this), -1); - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< AddTaskActor, 0, Key >*)0, actor_cancelled()); break; - } + // Make sure any remaining bytes in the block are 0xFF + for (auto b : reader.remainder()) + if (b != 0xFF) + throw restore_corrupted_data_padding(); - } -}; - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, int const& priority, Key const& begin, Key const& end, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference(), Version const& scheduledVersion = invalidVersion ) { - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new AddTaskActor(tr, taskBucket, parentTask, priority, begin, end, completionKey, waitFor, scheduledVersion)); - #line 8446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + return results; } -#line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - - #line 8451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via _execute() - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class _executeActorState { - #line 8457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 8595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via decodeRangeFileBlock() + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class DecodeRangeFileBlockActorState { + #line 8601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - _executeActorState(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : cx(cx), - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - taskBucket(taskBucket), - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - futureBucket(futureBucket), - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - task(task), - #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - lock(new FlowLock(CLIENT_KNOBS->BACKUP_LOCK_BYTES)) - #line 8472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DecodeRangeFileBlockActorState(Reference const& file,int64_t const& offset,int const& len,Database const& cx) + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : file(file), + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + offset(offset), + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + len(len), + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + cx(cx), + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + buf(makeString(len)) + #line 8616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("_execute", reinterpret_cast(this)); + fdb_probe_actor_create("decodeRangeFileBlock", reinterpret_cast(this)); } - ~_executeActorState() + ~DecodeRangeFileBlockActorState() { - fdb_probe_actor_destroy("_execute", reinterpret_cast(this)); + fdb_probe_actor_destroy("decodeRangeFileBlock", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = checkTaskVersion(cx, task, BackupRangeTaskFunc::name, BackupRangeTaskFunc::version); - #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = uncancellable(holdWhile(buf, file->read(mutateString(buf), len, offset))); + #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 8633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 1; - #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 8494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 8638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8504,101 +8648,97 @@ class _executeActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~_executeActorState(); - static_cast<_executeActor*>(this)->sendErrorAndDelPromiseRef(error); + this->~DecodeRangeFileBlockActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(Void const& _,int loopDepth) + int a_body1cont1(int const& rLen,int loopDepth) { - #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - beginKey = Params.beginKey().get(task); - #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - endKey = Params.endKey().get(task); - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("FileBackupRangeStart") .suppressFor(60) .detail("BackupUID", BackupConfig(task).getUid()) .detail("BeginKey", Params.beginKey().get(task).printable()) .detail("EndKey", Params.endKey().get(task).printable()) .detail("TaskKey", task->key.printable()); - #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (beginKey == endKey) - #line 8523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (rLen != len) + #line 8661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 8527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); - this->~_executeActorState(); - static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); - return 0; + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(restore_bad_read(), loopDepth); + #line 8665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture>> __when_expr_1 = runRYWTransaction( cx, [=](Reference tr) { return getBlockOfShards(tr, beginKey, endKey, 1); }); - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + simulateBlobFailure(); + #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + results = Standalone>({}, buf.arena()); + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + reader = StringRefReader(buf, restore_corrupted_data()); + #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + arena = Arena(); + #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = getDatabaseConfiguration(cx); + #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 8679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 2; - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast> >*>(static_cast<_executeActor*>(this))); - #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 8684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1cont1(int && rLen,int loopDepth) { - #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - beginKey = Params.beginKey().get(task); - #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - endKey = Params.endKey().get(task); - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("FileBackupRangeStart") .suppressFor(60) .detail("BackupUID", BackupConfig(task).getUid()) .detail("BeginKey", Params.beginKey().get(task).printable()) .detail("EndKey", Params.endKey().get(task).printable()) .detail("TaskKey", task->key.printable()); - #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (beginKey == endKey) - #line 8557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (rLen != len) + #line 8693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 8561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); - this->~_executeActorState(); - static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); - return 0; + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(restore_bad_read(), loopDepth); + #line 8697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture>> __when_expr_1 = runRYWTransaction( cx, [=](Reference tr) { return getBlockOfShards(tr, beginKey, endKey, 1); }); - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + simulateBlobFailure(); + #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + results = Standalone>({}, buf.arena()); + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + reader = StringRefReader(buf, restore_corrupted_data()); + #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + arena = Arena(); + #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = getDatabaseConfiguration(cx); + #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 8711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 2; - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast> >*>(static_cast<_executeActor*>(this))); - #line 8576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 8716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1when1(int const& rLen,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + loopDepth = a_body1cont1(rLen, loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1when1(int && rLen,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont1(std::move(rLen), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; - static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeRangeFileBlockActor, 0, int >::remove(); } - void a_callback_fire(ActorCallback< _executeActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 0, int >*,int const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 0); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -8608,12 +8748,12 @@ class _executeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 0); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< _executeActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 0, int >*,int && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 0); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -8623,12 +8763,12 @@ class _executeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 0); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< _executeActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< DecodeRangeFileBlockActor, 0, int >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 0); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -8638,118 +8778,63 @@ class _executeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 0); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 0); } - int a_body1cont2(Standalone> const& keys,int loopDepth) + int a_body1cont2(int loopDepth) { - #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (keys.size() > 0) - #line 8648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tenantCache = Optional>>(); + #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (config.tenantMode == TenantMode::REQUIRED) + #line 8790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Params.addBackupRangeTasks().set(task, true); - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 8654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); - this->~_executeActorState(); - static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); - return 0; + #line 1249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tenantCache = makeReference>(cx, TenantEntryCacheRefreshMode::WATCH); + #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = tenantCache.get()->init(); + #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 8798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 8803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } - #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - outFile = Reference(); - #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - outVersion = invalidVersion; - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - lastKey = Key(); - #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - results = PromiseStream(); - #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - rc = readCommitted(cx, results, lock, KeyRangeRef(beginKey, endKey), Terminator::True, AccessSystemKeys::True, LockAware::True); - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - rangeFile = RangeFileWriter(); - #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backup = BackupConfig(task); - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_2 = backup.backupContainer().getD(cx); - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 3; - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast<_executeActor*>(this))); - #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont2(Standalone> && keys,int loopDepth) - { - #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (keys.size() > 0) - #line 8692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + else { - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Params.addBackupRangeTasks().set(task, true); - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 8698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); - this->~_executeActorState(); - static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont4(loopDepth); } - #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - outFile = Reference(); - #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - outVersion = invalidVersion; - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - lastKey = Key(); - #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - results = PromiseStream(); - #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - rc = readCommitted(cx, results, lock, KeyRangeRef(beginKey, endKey), Terminator::True, AccessSystemKeys::True, LockAware::True); - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - rangeFile = RangeFileWriter(); - #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backup = BackupConfig(task); - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_2 = backup.backupContainer().getD(cx); - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 3; - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast<_executeActor*>(this))); - #line 8727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; return loopDepth; } - int a_body1cont1when1(Standalone> const& keys,int loopDepth) + int a_body1cont1when1(DatabaseConfiguration const& __config,int loopDepth) { - loopDepth = a_body1cont2(keys, loopDepth); + #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config = __config; + #line 8817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont1when1(Standalone> && keys,int loopDepth) + int a_body1cont1when1(DatabaseConfiguration && __config,int loopDepth) { - loopDepth = a_body1cont2(std::move(keys), loopDepth); + config = std::move(__config); + loopDepth = a_body1cont2(loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; - static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 1, Standalone> >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeRangeFileBlockActor, 1, DatabaseConfiguration >::remove(); } - void a_callback_fire(ActorCallback< _executeActor, 1, Standalone> >*,Standalone> const& value) + void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 1, DatabaseConfiguration >*,DatabaseConfiguration const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -8759,12 +8844,12 @@ class _executeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< _executeActor, 1, Standalone> >*,Standalone> && value) + void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 1, DatabaseConfiguration >*,DatabaseConfiguration && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -8774,12 +8859,12 @@ class _executeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< _executeActor, 1, Standalone> >*,Error err) + void a_callback_error(ActorCallback< DecodeRangeFileBlockActor, 1, DatabaseConfiguration >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -8789,84 +8874,151 @@ class _executeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 1); } - int a_body1cont4(Reference const& _bc,int loopDepth) + int a_body1cont4(int loopDepth) { - #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!_bc) - #line 8799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 8803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); - this->~_executeActorState(); - static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); - return 0; + #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptMode = config.encryptionAtRestMode; + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + blockDomainId = TenantInfo::INVALID_TENANT; + #line 8886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + try { + #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int32_t file_version = reader.consume(); + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(!encryptMode.isEncryptionEnabled() || file_version == BACKUP_AGENT_ENCRYPTED_SNAPSHOT_FILE_VERSION); + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (file_version == BACKUP_AGENT_SNAPSHOT_FILE_VERSION) + #line 8894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = decodeKVPairs(&reader, &results, false, encryptMode, Optional(), tenantCache); + #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont4Catch1(actor_cancelled(), loopDepth); + #line 8900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont4Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 8905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (file_version == BACKUP_AGENT_ENCRYPTED_SNAPSHOT_FILE_VERSION) + #line 8912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CODE_PROBE(true, "decoding encrypted block"); + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + optionsLen = reader.consumeNetworkUInt32(); + #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + const uint8_t* o = reader.consume(optionsLen); + #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StringRef optionsStringRef = StringRef(o, optionsLen); + #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptedRangeFileWriter::Options options = ObjectReader::fromStringRef(optionsStringRef, IncludeVersion()); + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + headerLen = reader.consume(); + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + headerStart = reader.consume(headerLen); + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StringRef headerS = StringRef(headerStart, headerLen); + #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptHeader = std::variant(); + #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (options.configurableEncryptionEnabled) + #line 8934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptHeader = BlobCipherEncryptHeaderRef::fromStringRef(headerS); + #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + blockDomainId = std::get(encryptHeader) .getCipherDetails() .textCipherDetails.encryptDomainId; + #line 8940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + else + { + #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptHeader = BlobCipherEncryptHeader::fromStringRef(headerS); + #line 1283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + blockDomainId = std::get(encryptHeader).cipherTextDetails.encryptDomainId; + #line 8948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (config.tenantMode == TenantMode::REQUIRED && !isReservedEncryptDomain(blockDomainId)) + #line 8952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(tenantCache.present()); + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture>> __when_expr_4 = tenantCache.get()->getById(blockDomainId); + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont4Catch1(actor_cancelled(), loopDepth); + #line 8960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont4Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when2(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 8965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont10(loopDepth); + } + } + else + { + #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1cont4Catch1(restore_unsupported_file_version(), loopDepth); + #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + } + } + catch (Error& error) { + loopDepth = a_body1cont4Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont4Catch1(unknown_error(), loopDepth); } - #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bc = getBackupContainerWithProxy(_bc); - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - done = false; - #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - nrKeys = 0; - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 8817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont4loopHead1(loopDepth); return loopDepth; } - int a_body1cont4(Reference && _bc,int loopDepth) + int a_body1cont5(Void const& _,int loopDepth) { - #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!_bc) - #line 8826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 8830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); - this->~_executeActorState(); - static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bc = getBackupContainerWithProxy(_bc); - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - done = false; - #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - nrKeys = 0; - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 8844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont4loopHead1(loopDepth); + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont5(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(loopDepth); return loopDepth; } - int a_body1cont2when1(Reference const& _bc,int loopDepth) + int a_body1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont4(_bc, loopDepth); + loopDepth = a_body1cont5(_, loopDepth); return loopDepth; } - int a_body1cont2when1(Reference && _bc,int loopDepth) + int a_body1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont4(std::move(_bc), loopDepth); + loopDepth = a_body1cont5(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; - static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 2, Reference >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeRangeFileBlockActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< _executeActor, 2, Reference >*,Reference const& value) + void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont2when1(value, 0); @@ -8876,12 +9028,12 @@ class _executeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< _executeActor, 2, Reference >*,Reference && value) + void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont2when1(std::move(value), 0); @@ -8891,12 +9043,12 @@ class _executeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< _executeActor, 2, Reference >*,Error err) + void a_callback_error(ActorCallback< DecodeRangeFileBlockActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -8906,780 +9058,787 @@ class _executeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); - - } - int a_body1cont4loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont4loopBody1(loopDepth); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 2); - return loopDepth; } - int a_body1cont4loopBody1(int loopDepth) + int a_body1cont4Catch1(const Error& e,int loopDepth=0) { - #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - values = RangeResultWithVersion(); - #line 8923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" try { - #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - FutureStream __when_expr_3 = results.getFuture(); - #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); - #line 8929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont4loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4loopBody1when1(__when_expr_3.pop(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 4; - #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 8934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (e.code() == error_code_encrypt_keys_fetch_failed || e.code() == error_code_encrypt_key_not_found) + #line 9069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(!isReservedEncryptDomain(blockDomainId)); + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevWarnAlways, "SnapshotRestoreEncryptKeyFetchFailed").detail("TenantId", blockDomainId); + #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CODE_PROBE(true, "Snapshot restore encrypt keys not found"); + #line 9077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + else + { + #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (e.code() == error_code_tenant_not_found) + #line 9083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(!isReservedEncryptDomain(blockDomainId)); + #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevWarnAlways, "EncryptedSnapshotRestoreTenantNotFound").detail("TenantId", blockDomainId); + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CODE_PROBE(true, "Encrypted Snapshot restore tenant not found"); + #line 9091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + } + #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevWarn, "FileRestoreDecodeRangeFileBlockFailed") .error(e) .detail("Filename", file->getFilename()) .detail("BlockOffset", offset) .detail("BlockLen", len) .detail("ErrorRelativeOffset", reader.rptr - buf.begin()) .detail("ErrorAbsoluteOffset", reader.rptr - buf.begin() + offset); + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 9098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } catch (Error& error) { - loopDepth = a_body1cont4loopBody1Catch1(error, loopDepth); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1cont4loopBody1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont4loopBody1cont1(int loopDepth) + int a_body1cont7(int loopDepth) { - #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (values.second != outVersion || done) - #line 8949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (outFile) - #line 8953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TEST(outVersion != invalidVersion); - #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - nextKey = done ? endKey : keyAfter(lastKey); - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = rangeFile.writeKey(nextKey); - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 8963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1cont1when1(__when_expr_4.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 5; - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 8968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont4loopBody1cont6(loopDepth); - } - } - else - { - loopDepth = a_body1cont4loopBody1cont5(loopDepth); - } + #line 1305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~DecodeRangeFileBlockActorState(); static_cast(this)->destroy(); return 0; } + #line 9112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO + this->~DecodeRangeFileBlockActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont4loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1cont8(Void const& _,int loopDepth) { - try { - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (e.code() == error_code_end_of_stream) - #line 8988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - done = true; - #line 8992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - else - { - #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 8998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - loopDepth = a_body1cont4loopBody1cont1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - int a_body1cont4loopBody1cont2(RangeResultWithVersion const& _values,int loopDepth) - { - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - values = _values; - #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - lock->release(values.first.expectedSize()); - #line 9016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont4loopBody1cont4(loopDepth); + loopDepth = a_body1cont7(loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont2(RangeResultWithVersion && _values,int loopDepth) + int a_body1cont8(Void && _,int loopDepth) { - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - values = _values; - #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - lock->release(values.first.expectedSize()); - #line 9027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont4loopBody1cont4(loopDepth); + loopDepth = a_body1cont7(loopDepth); return loopDepth; } - int a_body1cont4loopBody1when1(RangeResultWithVersion const& _values,int loopDepth) + int a_body1cont4when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont2(_values, loopDepth); + loopDepth = a_body1cont8(_, loopDepth); return loopDepth; } - int a_body1cont4loopBody1when1(RangeResultWithVersion && _values,int loopDepth) + int a_body1cont4when1(Void && _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont2(std::move(_values), loopDepth); + loopDepth = a_body1cont8(std::move(_), loopDepth); return loopDepth; } void a_exitChoose4() { - if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; - static_cast<_executeActor*>(this)->ActorSingleCallback< _executeActor, 3, RangeResultWithVersion >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeRangeFileBlockActor, 3, Void >::remove(); } - void a_callback_fire(ActorSingleCallback< _executeActor, 3, RangeResultWithVersion >*,RangeResultWithVersion const& value) + void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 3); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont4loopBody1when1(value, 0); + a_body1cont4when1(value, 0); } catch (Error& error) { - a_body1cont4loopBody1Catch1(error, 0); + a_body1cont4Catch1(error, 0); } catch (...) { - a_body1cont4loopBody1Catch1(unknown_error(), 0); + a_body1cont4Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 3); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 3); } - void a_callback_fire(ActorSingleCallback< _executeActor, 3, RangeResultWithVersion >*,RangeResultWithVersion && value) + void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 3); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont4loopBody1when1(std::move(value), 0); + a_body1cont4when1(std::move(value), 0); } catch (Error& error) { - a_body1cont4loopBody1Catch1(error, 0); + a_body1cont4Catch1(error, 0); } catch (...) { - a_body1cont4loopBody1Catch1(unknown_error(), 0); + a_body1cont4Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 3); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 3); } - void a_callback_error(ActorSingleCallback< _executeActor, 3, RangeResultWithVersion >*,Error err) + void a_callback_error(ActorCallback< DecodeRangeFileBlockActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 3); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont4loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont4loopBody1Catch1(error, 0); - } catch (...) { - a_body1cont4loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 3); - - } - int a_body1cont4loopBody1cont4(int loopDepth) - { - try { - loopDepth = a_body1cont4loopBody1cont1(loopDepth); + a_body1cont4Catch1(err, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + a_body1cont4Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + a_body1cont4Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1cont4loopBody1cont5(int loopDepth) + int a_body1cont9(int loopDepth) { - #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (values.first.size() != 0) - #line 9112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - i = 0; - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 9118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont4loopBody1cont5loopHead1(loopDepth); - } - else - { - loopDepth = a_body1cont4loopBody1cont13(loopDepth); - } + loopDepth = a_body1cont7(loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont6(int loopDepth) + int a_body1cont10(int loopDepth) { - #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (done) - #line 9132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } - #line 9136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); - this->~_executeActorState(); - static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - outVersion = values.second; - #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - blockSize = BUGGIFY ? deterministicRandom()->randomInt(250e3, 4e6) : CLIENT_KNOBS->BACKUP_RANGEFILE_BLOCK_SIZE; - #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotBeginVersion = Version(); - #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotRangeFileCount = int64_t(); - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr = Reference(new ReadYourWritesTransaction(cx)); + #line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + const uint8_t* dataPayloadStart = headerStart + headerLen; #line 1295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 9154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont4loopBody1cont6loopHead1(loopDepth); + int64_t bytesRead = sizeof(int32_t) + sizeof(uint32_t) + sizeof(uint32_t) + optionsLen + headerLen; + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t dataLen = len - bytesRead; + #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_5 = EncryptedRangeFileWriter::decrypt(cx, encryptHeader, dataPayloadStart, dataLen, &results.arena()); + #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont4Catch1(actor_cancelled(), loopDepth); + #line 9213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont4Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont10when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont4loopBody1cont7(Void const& _,int loopDepth) + int a_body1cont13(Optional> const& payload,int loopDepth) { - #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (BUGGIFY) - #line 9163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_5 = rangeFile.padEnd(); - #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 9169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1cont7when1(__when_expr_5.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 6; - #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 9174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else + #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!payload.present()) + #line 9227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - loopDepth = a_body1cont4loopBody1cont8(loopDepth); + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1cont4Catch1(tenant_not_found(), loopDepth); + #line 9231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } + loopDepth = a_body1cont10(loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont7(Void && _,int loopDepth) + int a_body1cont13(Optional> && payload,int loopDepth) { - #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (BUGGIFY) - #line 9188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_5 = rangeFile.padEnd(); - #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 9194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1cont7when1(__when_expr_5.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 6; - #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 9199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else + #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!payload.present()) + #line 9241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - loopDepth = a_body1cont4loopBody1cont8(loopDepth); + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1cont4Catch1(tenant_not_found(), loopDepth); + #line 9245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } + loopDepth = a_body1cont10(loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont1when1(Void const& _,int loopDepth) + int a_body1cont4when2(Optional> const& payload,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont7(_, loopDepth); + loopDepth = a_body1cont13(payload, loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont1when1(Void && _,int loopDepth) + int a_body1cont4when2(Optional> && payload,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont7(std::move(_), loopDepth); + loopDepth = a_body1cont13(std::move(payload), loopDepth); return loopDepth; } void a_exitChoose5() { - if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; - static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 4, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeRangeFileBlockActor, 4, Optional> >::remove(); } - void a_callback_fire(ActorCallback< _executeActor, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 4, Optional> >*,Optional> const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 4); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 4); a_exitChoose5(); try { - a_body1cont4loopBody1cont1when1(value, 0); + a_body1cont4when2(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont4Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont4Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 4); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< _executeActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 4, Optional> >*,Optional> && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 4); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 4); a_exitChoose5(); try { - a_body1cont4loopBody1cont1when1(std::move(value), 0); + a_body1cont4when2(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont4Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont4Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 4); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< _executeActor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< DecodeRangeFileBlockActor, 4, Optional> >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 4); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 4); a_exitChoose5(); try { - a_body1Catch1(err, 0); + a_body1cont4Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont4Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont4Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 4); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 4); } - int a_body1cont4loopBody1cont8(int loopDepth) + int a_body1cont10cont1(StringRef const& decryptedData,int loopDepth) { - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_6 = finishRangeFile(outFile, cx, task, taskBucket, KeyRangeRef(beginKey, nextKey), outVersion); - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 9278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1cont8when1(__when_expr_6.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 7; - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 9283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + reader = StringRefReader(decryptedData, restore_corrupted_data()); + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_6 = decodeKVPairs(&reader, &results, true, encryptMode, blockDomainId, tenantCache); + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont4Catch1(actor_cancelled(), loopDepth); + #line 9322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont4Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont10cont1when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont4loopBody1cont9(Void const& _,int loopDepth) - { - loopDepth = a_body1cont4loopBody1cont8(loopDepth); - - return loopDepth; - } - int a_body1cont4loopBody1cont9(Void && _,int loopDepth) + int a_body1cont10cont1(StringRef && decryptedData,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont8(loopDepth); + #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + reader = StringRefReader(decryptedData, restore_corrupted_data()); + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_6 = decodeKVPairs(&reader, &results, true, encryptMode, blockDomainId, tenantCache); + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont4Catch1(actor_cancelled(), loopDepth); + #line 9340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont4Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont10cont1when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont4loopBody1cont7when1(Void const& _,int loopDepth) + int a_body1cont10when1(StringRef const& decryptedData,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont9(_, loopDepth); + loopDepth = a_body1cont10cont1(decryptedData, loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont7when1(Void && _,int loopDepth) + int a_body1cont10when1(StringRef && decryptedData,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont9(std::move(_), loopDepth); + loopDepth = a_body1cont10cont1(std::move(decryptedData), loopDepth); return loopDepth; } void a_exitChoose6() { - if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; - static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 5, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeRangeFileBlockActor, 5, StringRef >::remove(); } - void a_callback_fire(ActorCallback< _executeActor, 5, Void >*,Void const& value) + void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 5, StringRef >*,StringRef const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 5); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 5); a_exitChoose6(); try { - a_body1cont4loopBody1cont7when1(value, 0); + a_body1cont10when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont4Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont4Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 5); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 5); } - void a_callback_fire(ActorCallback< _executeActor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 5, StringRef >*,StringRef && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 5); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 5); a_exitChoose6(); try { - a_body1cont4loopBody1cont7when1(std::move(value), 0); + a_body1cont10when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont4Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont4Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 5); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 5); } - void a_callback_error(ActorCallback< _executeActor, 5, Void >*,Error err) + void a_callback_error(ActorCallback< DecodeRangeFileBlockActor, 5, StringRef >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 5); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 5); a_exitChoose6(); try { - a_body1Catch1(err, 0); + a_body1cont4Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont4Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont4Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 5); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 5); } - int a_body1cont4loopBody1cont10(bool const& usedFile,int loopDepth) + int a_body1cont10cont2(Void const& _,int loopDepth) { - #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("FileBackupWroteRangeFile") .suppressFor(60) .detail("BackupUID", backup.getUid()) .detail("Size", outFile->size()) .detail("Keys", nrKeys) .detail("ReadVersion", outVersion) .detail("BeginKey", beginKey.printable()) .detail("EndKey", nextKey.printable()) .detail("AddedFileToMap", usedFile); - #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - nrKeys = 0; - #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - beginKey = nextKey; - #line 9371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont4loopBody1cont6(loopDepth); + loopDepth = a_body1cont9(loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont10(bool && usedFile,int loopDepth) + int a_body1cont10cont2(Void && _,int loopDepth) { - #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("FileBackupWroteRangeFile") .suppressFor(60) .detail("BackupUID", backup.getUid()) .detail("Size", outFile->size()) .detail("Keys", nrKeys) .detail("ReadVersion", outVersion) .detail("BeginKey", beginKey.printable()) .detail("EndKey", nextKey.printable()) .detail("AddedFileToMap", usedFile); - #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - nrKeys = 0; - #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - beginKey = nextKey; - #line 9384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont4loopBody1cont6(loopDepth); + loopDepth = a_body1cont9(loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont8when1(bool const& usedFile,int loopDepth) + int a_body1cont10cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont10(usedFile, loopDepth); + loopDepth = a_body1cont10cont2(_, loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont8when1(bool && usedFile,int loopDepth) + int a_body1cont10cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont10(std::move(usedFile), loopDepth); + loopDepth = a_body1cont10cont2(std::move(_), loopDepth); return loopDepth; } void a_exitChoose7() { - if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; - static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 6, bool >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeRangeFileBlockActor, 6, Void >::remove(); } - void a_callback_fire(ActorCallback< _executeActor, 6, bool >*,bool const& value) + void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 6, Void >*,Void const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 6); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 6); a_exitChoose7(); try { - a_body1cont4loopBody1cont8when1(value, 0); + a_body1cont10cont1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont4Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont4Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 6); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 6); } - void a_callback_fire(ActorCallback< _executeActor, 6, bool >*,bool && value) + void a_callback_fire(ActorCallback< DecodeRangeFileBlockActor, 6, Void >*,Void && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 6); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 6); a_exitChoose7(); try { - a_body1cont4loopBody1cont8when1(std::move(value), 0); + a_body1cont10cont1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont4Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont4Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 6); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 6); } - void a_callback_error(ActorCallback< _executeActor, 6, bool >*,Error err) + void a_callback_error(ActorCallback< DecodeRangeFileBlockActor, 6, Void >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 6); + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), 6); a_exitChoose7(); try { - a_body1Catch1(err, 0); + a_body1cont4Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont4Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont4Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 6); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), 6); } - int a_body1cont4loopBody1cont11(int loopDepth) + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference file; + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t offset; + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int len; + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Database cx; + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Standalone buf; + #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Standalone> results; + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StringRefReader reader; + #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Arena arena; + #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DatabaseConfiguration config; + #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional>> tenantCache; + #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptionAtRestMode encryptMode; + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t blockDomainId; + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + uint32_t optionsLen; + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + uint32_t headerLen; + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + const uint8_t* headerStart; + #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::variant encryptHeader; + #line 9520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via decodeRangeFileBlock() + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class DecodeRangeFileBlockActor final : public Actor>>, public ActorCallback< DecodeRangeFileBlockActor, 0, int >, public ActorCallback< DecodeRangeFileBlockActor, 1, DatabaseConfiguration >, public ActorCallback< DecodeRangeFileBlockActor, 2, Void >, public ActorCallback< DecodeRangeFileBlockActor, 3, Void >, public ActorCallback< DecodeRangeFileBlockActor, 4, Optional> >, public ActorCallback< DecodeRangeFileBlockActor, 5, StringRef >, public ActorCallback< DecodeRangeFileBlockActor, 6, Void >, public FastAllocated, public DecodeRangeFileBlockActorState { + #line 9525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DecodeRangeFileBlockActor, 0, int >; +friend struct ActorCallback< DecodeRangeFileBlockActor, 1, DatabaseConfiguration >; +friend struct ActorCallback< DecodeRangeFileBlockActor, 2, Void >; +friend struct ActorCallback< DecodeRangeFileBlockActor, 3, Void >; +friend struct ActorCallback< DecodeRangeFileBlockActor, 4, Optional> >; +friend struct ActorCallback< DecodeRangeFileBlockActor, 5, StringRef >; +friend struct ActorCallback< DecodeRangeFileBlockActor, 6, Void >; + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DecodeRangeFileBlockActor(Reference const& file,int64_t const& offset,int const& len,Database const& cx) + #line 9542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor>>(), + DecodeRangeFileBlockActorState(file, offset, len, cx) { - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_9 = bc->writeRangeFile(snapshotBeginVersion, snapshotRangeFileCount, outVersion, blockSize); - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 9458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1cont11when1(__when_expr_9.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 10; - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_9.addCallbackAndClear(static_cast >*>(static_cast<_executeActor*>(this))); - #line 9463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_enter("decodeRangeFileBlock", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("decodeRangeFileBlock"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("decodeRangeFileBlock", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1cont4loopBody1cont6loopHead1(int loopDepth) + void cancel() override { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont4loopBody1cont6loopBody1(loopDepth); + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DecodeRangeFileBlockActor, 0, int >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DecodeRangeFileBlockActor, 1, DatabaseConfiguration >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< DecodeRangeFileBlockActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< DecodeRangeFileBlockActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< DecodeRangeFileBlockActor, 4, Optional> >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< DecodeRangeFileBlockActor, 5, StringRef >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< DecodeRangeFileBlockActor, 6, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] Future>> decodeRangeFileBlock( Reference const& file, int64_t const& offset, int const& len, Database const& cx ) { + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future>>(new DecodeRangeFileBlockActor(file, offset, len, cx)); + #line 9575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + +// Very simple format compared to KeyRange files. +// Header, [Key, Value]... Key len +struct LogFileWriter { + LogFileWriter(Reference file = Reference(), int blockSize = 0) + : file(file), blockSize(blockSize), blockEnd(0) {} + + // Start a new block if needed, then write the key and value + #line 9587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via writeKV_impl() + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class WriteKV_implActor2State { + #line 9593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + WriteKV_implActor2State(LogFileWriter* const& self,Key const& k,Value const& v) + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : self(self), + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + k(k), + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + v(v) + #line 9604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("writeKV_impl", reinterpret_cast(this)); + + } + ~WriteKV_implActor2State() + { + fdb_probe_actor_destroy("writeKV_impl", reinterpret_cast(this)); - return loopDepth; } - int a_body1cont4loopBody1cont6loopBody1(int loopDepth) + int a_body1(int loopDepth=0) { try { - #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_7 = taskBucket->keepRunning(tr, task) && storeOrThrow(snapshotBeginVersion, backup.snapshotBeginVersion().get(tr)) && store(snapshotRangeFileCount, backup.snapshotRangeFileCount().getD(tr)); - #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1cont4loopBody1cont6loopBody1Catch1(actor_cancelled(), loopDepth); - #line 9486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont4loopBody1cont6loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont4loopBody1cont6loopBody1when1(__when_expr_7.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 8; - #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 9491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int toWrite = sizeof(int32_t) + k.size() + sizeof(int32_t) + v.size(); + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (self->file->size() + toWrite > self->blockEnd) + #line 9621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int bytesLeft = self->blockEnd - self->file->size(); + #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (bytesLeft > 0) + #line 9627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + paddingFFs = makePadding(bytesLeft); + #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = self->file->append(paddingFFs.begin(), bytesLeft); + #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 9635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont2(loopDepth); + } + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { - loopDepth = a_body1cont4loopBody1cont6loopBody1Catch1(error, loopDepth); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1cont4loopBody1cont6loopBody1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont4loopBody1cont6break1(int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - try { - return a_body1cont4loopBody1cont11(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } + this->~WriteKV_implActor2State(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1cont4loopBody1cont6loopBody1cont1(int loopDepth) + int a_body1cont1(int loopDepth) { - if (loopDepth == 0) return a_body1cont4loopBody1cont6loopHead1(0); + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = self->file->appendStringRefWithLen(k); + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 9675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont4loopBody1cont6loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1cont2(int loopDepth) { - try { - #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_8 = tr->onError(e); - #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 9528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), std::max(0, loopDepth - 2)); else return a_body1cont4loopBody1cont6loopBody1Catch1when1(__when_expr_8.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 9; - #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 9533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 2)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 2)); - } + #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + self->blockEnd += self->blockSize; + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = self->file->append((uint8_t*)&BACKUP_AGENT_MLOG_VERSION, sizeof(BACKUP_AGENT_MLOG_VERSION)); + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 9693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont4loopBody1cont6loopBody1cont2(Void const& _,int loopDepth) + int a_body1cont3(Void const& _,int loopDepth) { - return a_body1cont4loopBody1cont6break1(loopDepth==0?0:loopDepth-1); // break + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont6loopBody1cont2(Void && _,int loopDepth) + int a_body1cont3(Void && _,int loopDepth) { - return a_body1cont4loopBody1cont6break1(loopDepth==0?0:loopDepth-1); // break + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont6loopBody1when1(Void const& _,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont6loopBody1cont2(_, loopDepth); + loopDepth = a_body1cont3(_, loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont6loopBody1when1(Void && _,int loopDepth) + int a_body1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont6loopBody1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont3(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose8() + void a_exitChoose1() { - if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; - static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 7, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKV_implActor2, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< _executeActor, 7, Void >*,Void const& value) + void a_callback_fire(ActorCallback< WriteKV_implActor2, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 7); - a_exitChoose8(); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont4loopBody1cont6loopBody1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { - a_body1cont4loopBody1cont6loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont4loopBody1cont6loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 7); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< _executeActor, 7, Void >*,Void && value) + void a_callback_fire(ActorCallback< WriteKV_implActor2, 0, Void >*,Void && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 7); - a_exitChoose8(); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont4loopBody1cont6loopBody1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { - a_body1cont4loopBody1cont6loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont4loopBody1cont6loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 7); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< _executeActor, 7, Void >*,Error err) + void a_callback_error(ActorCallback< WriteKV_implActor2, 0, Void >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 7); - a_exitChoose8(); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont4loopBody1cont6loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1cont4loopBody1cont6loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont4loopBody1cont6loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 7); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 0); } - int a_body1cont4loopBody1cont6loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1cont4(Void const& _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont6loopBody1cont1(loopDepth); + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont6loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1cont4(Void && _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont6loopBody1cont1(loopDepth); + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont6loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont6loopBody1Catch1cont1(_, loopDepth); + loopDepth = a_body1cont4(_, loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont6loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont6loopBody1Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont4(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose9() + void a_exitChoose2() { - if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; - static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 8, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKV_implActor2, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< _executeActor, 8, Void >*,Void const& value) + void a_callback_fire(ActorCallback< WriteKV_implActor2, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 8); - a_exitChoose9(); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont4loopBody1cont6loopBody1Catch1when1(value, 0); + a_body1cont2when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 8); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< _executeActor, 8, Void >*,Void && value) + void a_callback_fire(ActorCallback< WriteKV_implActor2, 1, Void >*,Void && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 8); - a_exitChoose9(); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont4loopBody1cont6loopBody1Catch1when1(std::move(value), 0); + a_body1cont2when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 8); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< _executeActor, 8, Void >*,Error err) + void a_callback_error(ActorCallback< WriteKV_implActor2, 1, Void >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 8); - a_exitChoose9(); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -9688,101 +9847,93 @@ class _executeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 8); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 1); } - int a_body1cont4loopBody1cont11cont1(Reference const& f,int loopDepth) + int a_body1cont5(Void const& _,int loopDepth) { - #line 1312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - outFile = f; - #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - rangeFile = RangeFileWriter(outFile, blockSize); - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_10 = rangeFile.writeKey(beginKey); - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 9704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1Catch1(__when_expr_10.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1cont11cont1when1(__when_expr_10.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 11; - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_10.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 9709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = self->file->appendStringRefWithLen(v); + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 9859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont4loopBody1cont11cont1(Reference && f,int loopDepth) + int a_body1cont5(Void && _,int loopDepth) { - #line 1312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - outFile = f; - #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - rangeFile = RangeFileWriter(outFile, blockSize); - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_10 = rangeFile.writeKey(beginKey); - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 9724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1Catch1(__when_expr_10.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1cont11cont1when1(__when_expr_10.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 11; - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_10.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 9729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = self->file->appendStringRefWithLen(v); + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 9875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont4loopBody1cont11when1(Reference const& f,int loopDepth) + int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont11cont1(f, loopDepth); + loopDepth = a_body1cont5(_, loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont11when1(Reference && f,int loopDepth) + int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont11cont1(std::move(f), loopDepth); + loopDepth = a_body1cont5(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose10() + void a_exitChoose3() { - if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; - static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 9, Reference >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKV_implActor2, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< _executeActor, 9, Reference >*,Reference const& value) + void a_callback_fire(ActorCallback< WriteKV_implActor2, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 9); - a_exitChoose10(); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont4loopBody1cont11when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 9); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< _executeActor, 9, Reference >*,Reference && value) + void a_callback_fire(ActorCallback< WriteKV_implActor2, 2, Void >*,Void && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 9); - a_exitChoose10(); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont4loopBody1cont11when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 9); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< _executeActor, 9, Reference >*,Error err) + void a_callback_error(ActorCallback< WriteKV_implActor2, 2, Void >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 9); - a_exitChoose10(); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -9791,73 +9942,101 @@ class _executeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 9); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 2); } - int a_body1cont4loopBody1cont11cont2(Void const& _,int loopDepth) + int a_body1cont6(Void const& _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont5(loopDepth); + #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (self->file->size() > self->blockEnd) + #line 9952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(backup_bad_block_size(), loopDepth); + #line 9956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKV_implActor2State(); static_cast(this)->destroy(); return 0; } + #line 9960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteKV_implActor2State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont4loopBody1cont11cont2(Void && _,int loopDepth) + int a_body1cont6(Void && _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont5(loopDepth); + #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (self->file->size() > self->blockEnd) + #line 9972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(backup_bad_block_size(), loopDepth); + #line 9976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKV_implActor2State(); static_cast(this)->destroy(); return 0; } + #line 9980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteKV_implActor2State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont4loopBody1cont11cont1when1(Void const& _,int loopDepth) + int a_body1cont5when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont11cont2(_, loopDepth); + loopDepth = a_body1cont6(_, loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont11cont1when1(Void && _,int loopDepth) + int a_body1cont5when1(Void && _,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont11cont2(std::move(_), loopDepth); + loopDepth = a_body1cont6(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose11() + void a_exitChoose4() { - if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; - static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 10, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteKV_implActor2, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< _executeActor, 10, Void >*,Void const& value) + void a_callback_fire(ActorCallback< WriteKV_implActor2, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 10); - a_exitChoose11(); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont4loopBody1cont11cont1when1(value, 0); + a_body1cont5when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 10); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< _executeActor, 10, Void >*,Void && value) + void a_callback_fire(ActorCallback< WriteKV_implActor2, 3, Void >*,Void && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 10); - a_exitChoose11(); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont4loopBody1cont11cont1when1(std::move(value), 0); + a_body1cont5when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 10); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< _executeActor, 10, Void >*,Error err) + void a_callback_error(ActorCallback< WriteKV_implActor2, 3, Void >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 10); - a_exitChoose11(); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -9866,138 +10045,277 @@ class _executeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 10); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), 3); } - int a_body1cont4loopBody1cont13(int loopDepth) + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + LogFileWriter* self; + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key k; + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Value v; + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Value paddingFFs; + #line 10059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via writeKV_impl() + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class WriteKV_implActor2 final : public Actor, public ActorCallback< WriteKV_implActor2, 0, Void >, public ActorCallback< WriteKV_implActor2, 1, Void >, public ActorCallback< WriteKV_implActor2, 2, Void >, public ActorCallback< WriteKV_implActor2, 3, Void >, public FastAllocated, public WriteKV_implActor2State { + #line 10064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< WriteKV_implActor2, 0, Void >; +friend struct ActorCallback< WriteKV_implActor2, 1, Void >; +friend struct ActorCallback< WriteKV_implActor2, 2, Void >; +friend struct ActorCallback< WriteKV_implActor2, 3, Void >; + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + WriteKV_implActor2(LogFileWriter* const& self,Key const& k,Value const& v) + #line 10078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + WriteKV_implActor2State(self, k, v) { - if (loopDepth == 0) return a_body1cont4loopHead1(0); + fdb_probe_actor_enter("writeKV_impl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("writeKV_impl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("writeKV_impl", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1cont4loopBody1cont14(int loopDepth) + void cancel() override { - #line 1325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - lastKey = values.first.back().key; - #line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - nrKeys += values.first.size(); - #line 9884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont4loopBody1cont13(loopDepth); + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< WriteKV_implActor2, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WriteKV_implActor2, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< WriteKV_implActor2, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< WriteKV_implActor2, 3, Void >*)0, actor_cancelled()); break; + } - return loopDepth; } - int a_body1cont4loopBody1cont5loopHead1(int loopDepth) +}; + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future writeKV_impl( LogFileWriter* const& self, Key const& k, Value const& v ) { + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new WriteKV_implActor2(self, k, v)); + #line 10108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + Future writeKV(Key k, Value v) { return writeKV_impl(this, k, v); } + + Reference file; + int blockSize; + +private: + int64_t blockEnd; +}; + +Standalone> decodeMutationLogFileBlock(const Standalone& buf) { + Standalone> results({}, buf.arena()); + StringRefReader reader(buf, restore_corrupted_data()); + + // Read header, currently only decoding version BACKUP_AGENT_MLOG_VERSION + if (reader.consume() != BACKUP_AGENT_MLOG_VERSION) + throw restore_unsupported_file_version(); + + // Read k/v pairs. Block ends either at end of last value exactly or with 0xFF as first key len byte. + while (1) { + // If eof reached or first key len bytes is 0xFF then end of block was reached. + if (reader.eof() || *reader.rptr == 0xFF) + break; + + // Read key and value. If anything throws then there is a problem. + uint32_t kLen = reader.consumeNetworkUInt32(); + const uint8_t* k = reader.consume(kLen); + uint32_t vLen = reader.consumeNetworkUInt32(); + const uint8_t* v = reader.consume(vLen); + + results.push_back(results.arena(), KeyValueRef(KeyRef(k, kLen), ValueRef(v, vLen))); + } + + // Make sure any remaining bytes in the block are 0xFF + for (auto b : reader.remainder()) + if (b != 0xFF) + throw restore_corrupted_data_padding(); + + return results; +} + + #line 10153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via decodeMutationLogFileBlock() + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class DecodeMutationLogFileBlockActorState { + #line 10159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DecodeMutationLogFileBlockActorState(Reference const& file,int64_t const& offset,int const& len) + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : file(file), + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + offset(offset), + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + len(len), + #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + buf(makeString(len)) + #line 10172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont4loopBody1cont5loopBody1(loopDepth); + fdb_probe_actor_create("decodeMutationLogFileBlock", reinterpret_cast(this)); - return loopDepth; } - int a_body1cont4loopBody1cont5loopBody1(int loopDepth) + ~DecodeMutationLogFileBlockActorState() { - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!(i < values.first.size())) - #line 9900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - return a_body1cont4loopBody1cont5break1(loopDepth==0?0:loopDepth-1); // break - } - #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_11 = rangeFile.writeKV(values.first[i].key, values.first[i].value); - #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 9908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1Catch1(__when_expr_11.getError(), std::max(0, loopDepth - 2)); else return a_body1cont4loopBody1cont5loopBody1when1(__when_expr_11.get(), loopDepth); }; - static_cast<_executeActor*>(this)->actor_wait_state = 12; - #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_11.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); - #line 9913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_destroy("decodeMutationLogFileBlock", reinterpret_cast(this)); - return loopDepth; } - int a_body1cont4loopBody1cont5break1(int loopDepth) + int a_body1(int loopDepth=0) { try { - return a_body1cont4loopBody1cont14(loopDepth); + #line 1406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = file->read(mutateString(buf), len, offset); + #line 1406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 10189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 10194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont4loopBody1cont5loopBody1cont1(Void const& _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ++i; - #line 9935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (loopDepth == 0) return a_body1cont4loopBody1cont5loopHead1(0); + this->~DecodeMutationLogFileBlockActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1cont4loopBody1cont5loopBody1cont1(Void && _,int loopDepth) + int a_body1cont1(int const& rLen,int loopDepth) { - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ++i; - #line 9944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (loopDepth == 0) return a_body1cont4loopBody1cont5loopHead1(0); + #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (rLen != len) + #line 10217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(restore_bad_read(), loopDepth); + #line 10221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + try { + #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(decodeMutationLogFileBlock(buf)); this->~DecodeMutationLogFileBlockActorState(); static_cast(this)->destroy(); return 0; } + #line 10226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(decodeMutationLogFileBlock(buf)); + this->~DecodeMutationLogFileBlockActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1(int && rLen,int loopDepth) + { + #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (rLen != len) + #line 10244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(restore_bad_read(), loopDepth); + #line 10248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + try { + #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(decodeMutationLogFileBlock(buf)); this->~DecodeMutationLogFileBlockActorState(); static_cast(this)->destroy(); return 0; } + #line 10253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(decodeMutationLogFileBlock(buf)); + this->~DecodeMutationLogFileBlockActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1cont4loopBody1cont5loopBody1when1(Void const& _,int loopDepth) + int a_body1when1(int const& rLen,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont5loopBody1cont1(_, loopDepth); + loopDepth = a_body1cont1(rLen, loopDepth); return loopDepth; } - int a_body1cont4loopBody1cont5loopBody1when1(Void && _,int loopDepth) + int a_body1when1(int && rLen,int loopDepth) { - loopDepth = a_body1cont4loopBody1cont5loopBody1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont1(std::move(rLen), loopDepth); return loopDepth; } - void a_exitChoose12() + void a_exitChoose1() { - if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; - static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 11, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DecodeMutationLogFileBlockActor, 0, int >::remove(); } - void a_callback_fire(ActorCallback< _executeActor, 11, Void >*,Void const& value) + void a_callback_fire(ActorCallback< DecodeMutationLogFileBlockActor, 0, int >*,int const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 11); - a_exitChoose12(); + fdb_probe_actor_enter("decodeMutationLogFileBlock", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont4loopBody1cont5loopBody1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 11); + fdb_probe_actor_exit("decodeMutationLogFileBlock", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< _executeActor, 11, Void >*,Void && value) + void a_callback_fire(ActorCallback< DecodeMutationLogFileBlockActor, 0, int >*,int && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 11); - a_exitChoose12(); + fdb_probe_actor_enter("decodeMutationLogFileBlock", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont4loopBody1cont5loopBody1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 11); + fdb_probe_actor_exit("decodeMutationLogFileBlock", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< _executeActor, 11, Void >*,Error err) + void a_callback_error(ActorCallback< DecodeMutationLogFileBlockActor, 0, int >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 11); - a_exitChoose12(); + fdb_probe_actor_enter("decodeMutationLogFileBlock", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1Catch1(err, 0); } @@ -10006,95 +10324,61 @@ class _executeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 11); + fdb_probe_actor_exit("decodeMutationLogFileBlock", reinterpret_cast(this), 0); } - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Database cx; - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference taskBucket; - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference futureBucket; - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference task; - #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference lock; - #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key beginKey; - #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key endKey; - #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference outFile; - #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version outVersion; - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key lastKey; - #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - PromiseStream results; - #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Future rc; - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - RangeFileWriter rangeFile; - #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - BackupConfig backup; - #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference bc; - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bool done; - #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int64_t nrKeys; - #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - RangeResultWithVersion values; - #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key nextKey; - #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int blockSize; - #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version snapshotBeginVersion; - #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int64_t snapshotRangeFileCount; - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference tr; - #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - size_t i; - #line 10060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + int a_body1cont1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevWarn, "FileRestoreCorruptLogFileBlock") .error(e) .detail("Filename", file->getFilename()) .detail("BlockOffset", offset) .detail("BlockLen", len); + #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 10337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference file; + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t offset; + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int len; + #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Standalone buf; + #line 10355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via _execute() - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class _executeActor final : public Actor, public ActorCallback< _executeActor, 0, Void >, public ActorCallback< _executeActor, 1, Standalone> >, public ActorCallback< _executeActor, 2, Reference >, public ActorSingleCallback< _executeActor, 3, RangeResultWithVersion >, public ActorCallback< _executeActor, 4, Void >, public ActorCallback< _executeActor, 5, Void >, public ActorCallback< _executeActor, 6, bool >, public ActorCallback< _executeActor, 7, Void >, public ActorCallback< _executeActor, 8, Void >, public ActorCallback< _executeActor, 9, Reference >, public ActorCallback< _executeActor, 10, Void >, public ActorCallback< _executeActor, 11, Void >, public FastAllocated<_executeActor>, public _executeActorState<_executeActor> { - #line 10065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via decodeMutationLogFileBlock() + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class DecodeMutationLogFileBlockActor final : public Actor>>, public ActorCallback< DecodeMutationLogFileBlockActor, 0, int >, public FastAllocated, public DecodeMutationLogFileBlockActorState { + #line 10360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated<_executeActor>::operator new; - using FastAllocated<_executeActor>::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< _executeActor, 0, Void >; -friend struct ActorCallback< _executeActor, 1, Standalone> >; -friend struct ActorCallback< _executeActor, 2, Reference >; -friend struct ActorSingleCallback< _executeActor, 3, RangeResultWithVersion >; -friend struct ActorCallback< _executeActor, 4, Void >; -friend struct ActorCallback< _executeActor, 5, Void >; -friend struct ActorCallback< _executeActor, 6, bool >; -friend struct ActorCallback< _executeActor, 7, Void >; -friend struct ActorCallback< _executeActor, 8, Void >; -friend struct ActorCallback< _executeActor, 9, Reference >; -friend struct ActorCallback< _executeActor, 10, Void >; -friend struct ActorCallback< _executeActor, 11, Void >; - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - _executeActor(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 10087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor(), - _executeActorState<_executeActor>(cx, taskBucket, futureBucket, task) +friend struct ActorCallback< DecodeMutationLogFileBlockActor, 0, int >; + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DecodeMutationLogFileBlockActor(Reference const& file,int64_t const& offset,int const& len) + #line 10371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor>>(), + DecodeMutationLogFileBlockActorState(file, offset, len) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), -1); + fdb_probe_actor_enter("decodeMutationLogFileBlock", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("_execute"); + this->lineage.setActorName("decodeMutationLogFileBlock"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("_execute", reinterpret_cast(this), -1); + fdb_probe_actor_exit("decodeMutationLogFileBlock", reinterpret_cast(this), -1); } void cancel() override @@ -10102,84 +10386,89 @@ friend struct ActorCallback< _executeActor, 11, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< _executeActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< _executeActor, 1, Standalone> >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< _executeActor, 2, Reference >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorSingleCallback< _executeActor, 3, RangeResultWithVersion >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< _executeActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< _executeActor, 5, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< _executeActor, 6, bool >*)0, actor_cancelled()); break; - case 8: this->a_callback_error((ActorCallback< _executeActor, 7, Void >*)0, actor_cancelled()); break; - case 9: this->a_callback_error((ActorCallback< _executeActor, 8, Void >*)0, actor_cancelled()); break; - case 10: this->a_callback_error((ActorCallback< _executeActor, 9, Reference >*)0, actor_cancelled()); break; - case 11: this->a_callback_error((ActorCallback< _executeActor, 10, Void >*)0, actor_cancelled()); break; - case 12: this->a_callback_error((ActorCallback< _executeActor, 11, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< DecodeMutationLogFileBlockActor, 0, int >*)0, actor_cancelled()); break; } } }; - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new _executeActor(cx, taskBucket, futureBucket, task)); - #line 10125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] Future>> decodeMutationLogFileBlock( Reference const& file, int64_t const& offset, int const& len ) { + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future>>(new DecodeMutationLogFileBlockActor(file, offset, len)); + #line 10398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 1330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 10130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via startBackupRangeInternal() - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class StartBackupRangeInternalActorState { - #line 10136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 10403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via checkTaskVersion() + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class CheckTaskVersionActorState { + #line 10409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StartBackupRangeInternalActorState(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task,Reference const& onDone) - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : tr(tr), - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - taskBucket(taskBucket), - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - futureBucket(futureBucket), - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CheckTaskVersionActorState(Database const& cx,Reference const& task,StringRef const& name,uint32_t const& version) + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : cx(cx), + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - onDone(onDone) - #line 10151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + name(name), + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + version(version) + #line 10422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("startBackupRangeInternal", reinterpret_cast(this)); + fdb_probe_actor_create("checkTaskVersion", reinterpret_cast(this)); } - ~StartBackupRangeInternalActorState() + ~CheckTaskVersionActorState() { - fdb_probe_actor_destroy("startBackupRangeInternal", reinterpret_cast(this)); + fdb_probe_actor_destroy("checkTaskVersion", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - nextKey = Params.beginKey().get(task); - #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - endKey = Params.endKey().get(task); - #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture>> __when_expr_0 = getBlockOfShards(tr, nextKey, endKey, CLIENT_KNOBS->BACKUP_SHARD_TASK_LIMIT); - #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); - #line 10181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 1423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + uint32_t taskVersion = task->getVersion(); + #line 1424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (taskVersion > version) + #line 10439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + err = task_invalid_version(); + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevWarn, "BA_BackupRangeTaskFuncExecute") .detail("TaskVersion", taskVersion) .detail("Name", name) .detail("Version", version); + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (KeyBackedTaskConfig::TaskParams.uid().exists(task)) + #line 10447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string msg = format("%s task version `%lu' is greater than supported version `%lu'", task->params[Task::reservedTaskParamKeyType].toString().c_str(), (unsigned long)taskVersion, (unsigned long)version); + #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = BackupConfig(task).logError(cx, err, msg); + #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 10455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 10460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont2(loopDepth); + } + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -10191,71 +10480,65 @@ class StartBackupRangeInternalActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~StartBackupRangeInternalActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~CheckTaskVersionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::vector> addTaskVector; - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for(int idx = 0;idx < keys.size();++idx) { - #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (nextKey != keys[idx]) - #line 10208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - addTaskVector.push_back(addTask(tr, taskBucket, task, task->getPriority(), nextKey, keys[idx], TaskCompletionKey::joinWith(onDone))); - #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("FileBackupRangeSplit") .suppressFor(60) .detail("BackupUID", BackupConfig(task).getUid()) .detail("BeginKey", Params.beginKey().get(task).printable()) .detail("EndKey", Params.endKey().get(task).printable()) .detail("SliceBeginKey", nextKey.printable()) .detail("SliceEndKey", keys[idx].printable()); - #line 10214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 1362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - nextKey = keys[idx]; - #line 10218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = waitForAll(addTaskVector); - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 1442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckTaskVersionActorState(); static_cast(this)->destroy(); return 0; } + #line 10493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CheckTaskVersionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1when1(Standalone> const& __keys,int loopDepth) + int a_body1cont2(int loopDepth) { - #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - keys = __keys; - #line 10238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); + #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(err, loopDepth); + #line 10505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" return loopDepth; } - int a_body1when1(Standalone> && __keys,int loopDepth) + int a_body1cont3(Void const& _,int loopDepth) { - keys = std::move(__keys); - loopDepth = a_body1cont1(loopDepth); + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< StartBackupRangeInternalActor, 0, Standalone> >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckTaskVersionActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< StartBackupRangeInternalActor, 0, Standalone> >*,Standalone> const& value) + void a_callback_fire(ActorCallback< CheckTaskVersionActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 0); + fdb_probe_actor_enter("checkTaskVersion", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -10265,12 +10548,12 @@ class StartBackupRangeInternalActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 0); + fdb_probe_actor_exit("checkTaskVersion", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< StartBackupRangeInternalActor, 0, Standalone> >*,Standalone> && value) + void a_callback_fire(ActorCallback< CheckTaskVersionActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 0); + fdb_probe_actor_enter("checkTaskVersion", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -10280,12 +10563,12 @@ class StartBackupRangeInternalActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 0); + fdb_probe_actor_exit("checkTaskVersion", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< StartBackupRangeInternalActor, 0, Standalone> >*,Error err) + void a_callback_error(ActorCallback< CheckTaskVersionActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 0); + fdb_probe_actor_enter("checkTaskVersion", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -10295,111 +10578,259 @@ class StartBackupRangeInternalActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 0); + fdb_probe_actor_exit("checkTaskVersion", reinterpret_cast(this), 0); } - int a_body1cont2(Void const& _,int loopDepth) + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Database cx; + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference task; + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StringRef name; + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + uint32_t version; + #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Error err; + #line 10594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via checkTaskVersion() + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class CheckTaskVersionActor final : public Actor, public ActorCallback< CheckTaskVersionActor, 0, Void >, public FastAllocated, public CheckTaskVersionActorState { + #line 10599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CheckTaskVersionActor, 0, Void >; + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CheckTaskVersionActor(Database const& cx,Reference const& task,StringRef const& name,uint32_t const& version) + #line 10610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + CheckTaskVersionActorState(cx, task, name, version) { - #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (nextKey != endKey) - #line 10305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = success(addTask(tr, taskBucket, task, task->getPriority(), nextKey, endKey, TaskCompletionKey::joinWith(onDone), Reference(), task->getPriority())); - #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont5(loopDepth); - } + fdb_probe_actor_enter("checkTaskVersion", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("checkTaskVersion"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("checkTaskVersion", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1cont2(Void && _,int loopDepth) + void cancel() override { - #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (nextKey != endKey) - #line 10330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = success(addTask(tr, taskBucket, task, task->getPriority(), nextKey, endKey, TaskCompletionKey::joinWith(onDone), Reference(), task->getPriority())); - #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont5(loopDepth); + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CheckTaskVersionActor, 0, Void >*)0, actor_cancelled()); break; } - return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) +}; + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] Future checkTaskVersion( Database const& cx, Reference const& task, StringRef const& name, uint32_t const& version ) { + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new CheckTaskVersionActor(cx, task, name, version)); + #line 10637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + #line 10642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via abortFiveZeroBackup() + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class AbortFiveZeroBackupActorState { + #line 10648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + AbortFiveZeroBackupActorState(FileBackupAgent* const& backupAgent,Reference const& tr,std::string const& tagName) + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : backupAgent(backupAgent), + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr(tr), + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tagName(tagName) + #line 10659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - loopDepth = a_body1cont2(_, loopDepth); + fdb_probe_actor_create("abortFiveZeroBackup", reinterpret_cast(this)); - return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + ~AbortFiveZeroBackupActorState() { - loopDepth = a_body1cont2(std::move(_), loopDepth); + fdb_probe_actor_destroy("abortFiveZeroBackup", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 1448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 1449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 1451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tagNames = backupAgent->subspace.get(BackupAgentBase::keyTagName); + #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_0 = tr->get(tagNames.pack(Key(tagName))); + #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 10682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 10687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - void a_exitChoose2() + int a_body1Catch1(Error error,int loopDepth=0) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< StartBackupRangeInternalActor, 1, Void >::remove(); + this->~AbortFiveZeroBackupActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + return loopDepth; } - void a_callback_fire(ActorCallback< StartBackupRangeInternalActor, 1, Void >*,Void const& value) + int a_body1cont1(Optional const& uidStr,int loopDepth) { - fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 1); - a_exitChoose2(); + #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!uidStr.present()) + #line 10710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevWarn, "FileBackupAbortIncompatibleBackup_TagNotFound").detail("TagName", tagName.c_str()); + #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortFiveZeroBackupActorState(); static_cast(this)->destroy(); return 0; } + #line 10716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~AbortFiveZeroBackupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + uid = BinaryReader::fromStringRef(uidStr.get(), Unversioned()); + #line 1459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusSpace = backupAgent->subspace.get(BackupAgentBase::keyStates).get(uid.toString()); + #line 1460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + globalConfig = backupAgent->subspace.get(BackupAgentBase::keyConfig).get(uid.toString()); + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + newConfigSpace = uidPrefixKey("uid->config/"_sr.withPrefix(fileBackupPrefixRange.begin), uid); + #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_1 = tr->get(statusSpace.pack(FileBackupAgent::keyStateStatus)); + #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 10734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 10739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional && uidStr,int loopDepth) + { + #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!uidStr.present()) + #line 10748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevWarn, "FileBackupAbortIncompatibleBackup_TagNotFound").detail("TagName", tagName.c_str()); + #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortFiveZeroBackupActorState(); static_cast(this)->destroy(); return 0; } + #line 10754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~AbortFiveZeroBackupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + uid = BinaryReader::fromStringRef(uidStr.get(), Unversioned()); + #line 1459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusSpace = backupAgent->subspace.get(BackupAgentBase::keyStates).get(uid.toString()); + #line 1460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + globalConfig = backupAgent->subspace.get(BackupAgentBase::keyConfig).get(uid.toString()); + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + newConfigSpace = uidPrefixKey("uid->config/"_sr.withPrefix(fileBackupPrefixRange.begin), uid); + #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_1 = tr->get(statusSpace.pack(FileBackupAgent::keyStateStatus)); + #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 10772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 10777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Optional const& uidStr,int loopDepth) + { + loopDepth = a_body1cont1(uidStr, loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && uidStr,int loopDepth) + { + loopDepth = a_body1cont1(std::move(uidStr), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AbortFiveZeroBackupActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< AbortFiveZeroBackupActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("abortFiveZeroBackup", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 1); + fdb_probe_actor_exit("abortFiveZeroBackup", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< StartBackupRangeInternalActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< AbortFiveZeroBackupActor, 0, Optional >*,Optional && value) { - fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("abortFiveZeroBackup", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 1); + fdb_probe_actor_exit("abortFiveZeroBackup", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< StartBackupRangeInternalActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< AbortFiveZeroBackupActor, 0, Optional >*,Error err) { - fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("abortFiveZeroBackup", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1Catch1(err, 0); } @@ -10408,85 +10839,137 @@ class StartBackupRangeInternalActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 1); + fdb_probe_actor_exit("abortFiveZeroBackup", reinterpret_cast(this), 0); } - int a_body1cont5(int loopDepth) + int a_body1cont2(Optional const& statusStr,int loopDepth) { - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~StartBackupRangeInternalActorState(); static_cast(this)->destroy(); return 0; } - #line 10418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~StartBackupRangeInternalActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + status = !statusStr.present() ? EBackupState::STATE_NEVERRAN : BackupAgentBase::getState(statusStr.get().toString()); + #line 1467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevInfo, "FileBackupAbortIncompatibleBackup") .detail("TagName", tagName.c_str()) .detail("Status", BackupAgentBase::getStateText(status)); + #line 1472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(singleKeyRange(StringRef(globalConfig.pack(FileBackupAgent::keyFolderId)))); + #line 1475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key configPath = uidPrefixKey(logRangesRange.begin, uid); + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key logsPath = uidPrefixKey(backupLogKeys.begin, uid); + #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(KeyRangeRef(configPath, strinc(configPath))); + #line 1478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(KeyRangeRef(logsPath, strinc(logsPath))); + #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(newConfigSpace.range()); + #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key statusKey = StringRef(statusSpace.pack(FileBackupAgent::keyStateStatus)); + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (backupAgent->isRunnable(status)) + #line 10867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->set(statusKey, StringRef(FileBackupAgent::getStateText(EBackupState::STATE_ABORTED))); + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortFiveZeroBackupActorState(); static_cast(this)->destroy(); return 0; } + #line 10875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~AbortFiveZeroBackupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1cont6(Void const& _,int loopDepth) - { - loopDepth = a_body1cont5(loopDepth); - - return loopDepth; - } - int a_body1cont6(Void && _,int loopDepth) + int a_body1cont2(Optional && statusStr,int loopDepth) { - loopDepth = a_body1cont5(loopDepth); + #line 1464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + status = !statusStr.present() ? EBackupState::STATE_NEVERRAN : BackupAgentBase::getState(statusStr.get().toString()); + #line 1467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevInfo, "FileBackupAbortIncompatibleBackup") .detail("TagName", tagName.c_str()) .detail("Status", BackupAgentBase::getStateText(status)); + #line 1472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(singleKeyRange(StringRef(globalConfig.pack(FileBackupAgent::keyFolderId)))); + #line 1475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key configPath = uidPrefixKey(logRangesRange.begin, uid); + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key logsPath = uidPrefixKey(backupLogKeys.begin, uid); + #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(KeyRangeRef(configPath, strinc(configPath))); + #line 1478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(KeyRangeRef(logsPath, strinc(logsPath))); + #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(newConfigSpace.range()); + #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key statusKey = StringRef(statusSpace.pack(FileBackupAgent::keyStateStatus)); + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (backupAgent->isRunnable(status)) + #line 10905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->set(statusKey, StringRef(FileBackupAgent::getStateText(EBackupState::STATE_ABORTED))); + #line 10909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortFiveZeroBackupActorState(); static_cast(this)->destroy(); return 0; } + #line 10913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~AbortFiveZeroBackupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont2when1(Void const& _,int loopDepth) + int a_body1cont1when1(Optional const& statusStr,int loopDepth) { - loopDepth = a_body1cont6(_, loopDepth); + loopDepth = a_body1cont2(statusStr, loopDepth); return loopDepth; } - int a_body1cont2when1(Void && _,int loopDepth) + int a_body1cont1when1(Optional && statusStr,int loopDepth) { - loopDepth = a_body1cont6(std::move(_), loopDepth); + loopDepth = a_body1cont2(std::move(statusStr), loopDepth); return loopDepth; } - void a_exitChoose3() + void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< StartBackupRangeInternalActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AbortFiveZeroBackupActor, 1, Optional >::remove(); } - void a_callback_fire(ActorCallback< StartBackupRangeInternalActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AbortFiveZeroBackupActor, 1, Optional >*,Optional const& value) { - fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("abortFiveZeroBackup", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont2when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 2); + fdb_probe_actor_exit("abortFiveZeroBackup", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< StartBackupRangeInternalActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< AbortFiveZeroBackupActor, 1, Optional >*,Optional && value) { - fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("abortFiveZeroBackup", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont2when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 2); + fdb_probe_actor_exit("abortFiveZeroBackup", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< StartBackupRangeInternalActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< AbortFiveZeroBackupActor, 1, Optional >*,Error err) { - fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("abortFiveZeroBackup", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -10495,54 +10978,55 @@ class StartBackupRangeInternalActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 2); + fdb_probe_actor_exit("abortFiveZeroBackup", reinterpret_cast(this), 1); } - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + FileBackupAgent* backupAgent; + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference taskBucket; - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference futureBucket; - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference task; - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference onDone; - #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key nextKey; - #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key endKey; - #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Standalone> keys; - #line 10517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string tagName; + #line 1451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Subspace tagNames; + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + UID uid; + #line 1459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Subspace statusSpace; + #line 1460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Subspace globalConfig; + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Subspace newConfigSpace; + #line 1464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EBackupState status; + #line 11002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via startBackupRangeInternal() - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class StartBackupRangeInternalActor final : public Actor, public ActorCallback< StartBackupRangeInternalActor, 0, Standalone> >, public ActorCallback< StartBackupRangeInternalActor, 1, Void >, public ActorCallback< StartBackupRangeInternalActor, 2, Void >, public FastAllocated, public StartBackupRangeInternalActorState { - #line 10522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via abortFiveZeroBackup() + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class AbortFiveZeroBackupActor final : public Actor, public ActorCallback< AbortFiveZeroBackupActor, 0, Optional >, public ActorCallback< AbortFiveZeroBackupActor, 1, Optional >, public FastAllocated, public AbortFiveZeroBackupActorState { + #line 11007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< StartBackupRangeInternalActor, 0, Standalone> >; -friend struct ActorCallback< StartBackupRangeInternalActor, 1, Void >; -friend struct ActorCallback< StartBackupRangeInternalActor, 2, Void >; - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StartBackupRangeInternalActor(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task,Reference const& onDone) - #line 10535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +friend struct ActorCallback< AbortFiveZeroBackupActor, 0, Optional >; +friend struct ActorCallback< AbortFiveZeroBackupActor, 1, Optional >; + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + AbortFiveZeroBackupActor(FileBackupAgent* const& backupAgent,Reference const& tr,std::string const& tagName) + #line 11019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), - StartBackupRangeInternalActorState(tr, taskBucket, futureBucket, task, onDone) + AbortFiveZeroBackupActorState(backupAgent, tr, tagName) { - fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), -1); + fdb_probe_actor_enter("abortFiveZeroBackup", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("startBackupRangeInternal"); + this->lineage.setActorName("abortFiveZeroBackup"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), -1); + fdb_probe_actor_exit("abortFiveZeroBackup", reinterpret_cast(this), -1); } void cancel() override @@ -10550,49 +11034,52 @@ friend struct ActorCallback< StartBackupRangeInternalActor, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< StartBackupRangeInternalActor, 0, Standalone> >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< StartBackupRangeInternalActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< StartBackupRangeInternalActor, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< AbortFiveZeroBackupActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< AbortFiveZeroBackupActor, 1, Optional >*)0, actor_cancelled()); break; } } }; - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future startBackupRangeInternal( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task, Reference const& onDone ) { - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new StartBackupRangeInternalActor(tr, taskBucket, futureBucket, task, onDone)); - #line 10564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future abortFiveZeroBackup( FileBackupAgent* const& backupAgent, Reference const& tr, std::string const& tagName ) { + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new AbortFiveZeroBackupActor(backupAgent, tr, tagName)); + #line 11047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 10569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +struct AbortFiveZeroBackupTask : TaskFuncBase { + static StringRef name; + #line 11054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class _finishActor2State { - #line 10575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _finishActorState { + #line 11060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - _finishActor2State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + _finishActorState(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 1387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - taskFuture(futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone])) - #line 10590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backupAgent(), + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tagName(task->params[BackupAgentBase::keyConfigBackupTag].toString()) + #line 11077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); } - ~_finishActor2State() + ~_finishActorState() { fdb_probe_actor_destroy("_finish", reinterpret_cast(this)); @@ -10600,36 +11087,19 @@ class _finishActor2State { int a_body1(int loopDepth=0) { try { - #line 1389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (Params.addBackupRangeTasks().get(task)) - #line 10605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 1390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = startBackupRangeInternal(tr, taskBucket, futureBucket, task, taskFuture); - #line 1390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast<_finishActor2*>(this)->actor_wait_state = 1; - #line 1390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor2*>(this))); - #line 10616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 1392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = taskFuture->set(tr, taskBucket); - #line 1392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; - static_cast<_finishActor2*>(this)->actor_wait_state = 2; - #line 1392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor2*>(this))); - #line 10630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } + #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevInfo, "FileBackupCancelOldTask") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("TagName", tagName); + #line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = abortFiveZeroBackup(&backupAgent, tr, tagName); + #line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_finishActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 11096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast<_finishActor*>(this)->actor_wait_state = 1; + #line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor*>(this))); + #line 11101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -10641,59 +11111,63 @@ class _finishActor2State { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~_finishActor2State(); - static_cast<_finishActor2*>(this)->sendErrorAndDelPromiseRef(error); + this->~_finishActorState(); + static_cast<_finishActor*>(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(int loopDepth) + int a_body1cont1(Void const& _,int loopDepth) { - #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = taskBucket->finish(tr, task); - #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; - static_cast<_finishActor2*>(this)->actor_wait_state = 3; - #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor2*>(this))); - #line 10661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = taskBucket->finish(tr, task); + #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_finishActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 11126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast<_finishActor*>(this)->actor_wait_state = 2; + #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor*>(this))); + #line 11131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont2(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(loopDepth); - - return loopDepth; - } - int a_body1cont2(Void && _,int loopDepth) + int a_body1cont1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(loopDepth); + #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = taskBucket->finish(tr, task); + #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_finishActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 11142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast<_finishActor*>(this)->actor_wait_state = 2; + #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor*>(this))); + #line 11147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } int a_body1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + loopDepth = a_body1cont1(_, loopDepth); return loopDepth; } int a_body1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast<_finishActor2*>(this)->actor_wait_state > 0) static_cast<_finishActor2*>(this)->actor_wait_state = 0; - static_cast<_finishActor2*>(this)->ActorCallback< _finishActor2, 0, Void >::remove(); + if (static_cast<_finishActor*>(this)->actor_wait_state > 0) static_cast<_finishActor*>(this)->actor_wait_state = 0; + static_cast<_finishActor*>(this)->ActorCallback< _finishActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< _finishActor2, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< _finishActor, 0, Void >*,Void const& value) { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); a_exitChoose1(); @@ -10708,7 +11182,7 @@ class _finishActor2State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< _finishActor2, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< _finishActor, 0, Void >*,Void && value) { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); a_exitChoose1(); @@ -10723,7 +11197,7 @@ class _finishActor2State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< _finishActor2, 0, Void >*,Error err) + void a_callback_error(ActorCallback< _finishActor, 0, Void >*,Error err) { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); a_exitChoose1(); @@ -10738,42 +11212,54 @@ class _finishActor2State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); } - int a_body1cont3(Void const& _,int loopDepth) + int a_body1cont2(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(loopDepth); + #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_finishActor*>(this)->SAV::futures) { (void)(Void()); this->~_finishActorState(); static_cast<_finishActor*>(this)->destroy(); return 0; } + #line 11219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_finishActor*>(this)->SAV< Void >::value()) Void(Void()); + this->~_finishActorState(); + static_cast<_finishActor*>(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont3(Void && _,int loopDepth) + int a_body1cont2(Void && _,int loopDepth) { - loopDepth = a_body1cont1(loopDepth); + #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_finishActor*>(this)->SAV::futures) { (void)(Void()); this->~_finishActorState(); static_cast<_finishActor*>(this)->destroy(); return 0; } + #line 11231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_finishActor*>(this)->SAV< Void >::value()) Void(Void()); + this->~_finishActorState(); + static_cast<_finishActor*>(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1when2(Void const& _,int loopDepth) + int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont3(_, loopDepth); + loopDepth = a_body1cont2(_, loopDepth); return loopDepth; } - int a_body1when2(Void && _,int loopDepth) + int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont3(std::move(_), loopDepth); + loopDepth = a_body1cont2(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast<_finishActor2*>(this)->actor_wait_state > 0) static_cast<_finishActor2*>(this)->actor_wait_state = 0; - static_cast<_finishActor2*>(this)->ActorCallback< _finishActor2, 1, Void >::remove(); + if (static_cast<_finishActor*>(this)->actor_wait_state > 0) static_cast<_finishActor*>(this)->actor_wait_state = 0; + static_cast<_finishActor*>(this)->ActorCallback< _finishActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< _finishActor2, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< _finishActor, 1, Void >*,Void const& value) { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1when2(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -10783,12 +11269,12 @@ class _finishActor2State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< _finishActor2, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< _finishActor, 1, Void >*,Void && value) { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1when2(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -10798,7 +11284,7 @@ class _finishActor2State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< _finishActor2, 1, Void >*,Error err) + void a_callback_error(ActorCallback< _finishActor, 1, Void >*,Error err) { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); a_exitChoose2(); @@ -10813,86 +11299,237 @@ class _finishActor2State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); } - int a_body1cont4(Void const& _,int loopDepth) + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference taskBucket; + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference futureBucket; + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference task; + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + FileBackupAgent backupAgent; + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string tagName; + #line 11314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via _finish() + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _finishActor final : public Actor, public ActorCallback< _finishActor, 0, Void >, public ActorCallback< _finishActor, 1, Void >, public FastAllocated<_finishActor>, public _finishActorState<_finishActor> { + #line 11319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated<_finishActor>::operator new; + using FastAllocated<_finishActor>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< _finishActor, 0, Void >; +friend struct ActorCallback< _finishActor, 1, Void >; + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + _finishActor(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) + #line 11331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + _finishActorState<_finishActor>(tr, taskBucket, futureBucket, task) { - #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("FileBackupRangeFinish") .suppressFor(60) .detail("BackupUID", BackupConfig(task).getUid()) .detail("BeginKey", Params.beginKey().get(task).printable()) .detail("EndKey", Params.endKey().get(task).printable()) .detail("TaskKey", task->key.printable()); - #line 1404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_finishActor2*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor2State(); static_cast<_finishActor2*>(this)->destroy(); return 0; } - #line 10822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_finishActor2*>(this)->SAV< Void >::value()) Void(Void()); - this->~_finishActor2State(); - static_cast<_finishActor2*>(this)->finishSendAndDelPromiseRef(); - return 0; + fdb_probe_actor_enter("_finish", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("_finish"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("_finish", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1cont4(Void && _,int loopDepth) + void cancel() override { - #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("FileBackupRangeFinish") .suppressFor(60) .detail("BackupUID", BackupConfig(task).getUid()) .detail("BeginKey", Params.beginKey().get(task).printable()) .detail("EndKey", Params.endKey().get(task).printable()) .detail("TaskKey", task->key.printable()); - #line 1404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_finishActor2*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor2State(); static_cast<_finishActor2*>(this)->destroy(); return 0; } - #line 10836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_finishActor2*>(this)->SAV< Void >::value()) Void(Void()); - this->~_finishActor2State(); - static_cast<_finishActor2*>(this)->finishSendAndDelPromiseRef(); - return 0; + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< _finishActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< _finishActor, 1, Void >*)0, actor_cancelled()); break; + } - return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont4(_, loopDepth); +}; + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new _finishActor(tr, taskBucket, futureBucket, task)); + #line 11359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} - return loopDepth; - } - int a_body1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont4(std::move(_), loopDepth); +#line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return loopDepth; + StringRef getName() const override { + TraceEvent(SevError, "FileBackupError") + .detail("Cause", "AbortFiveZeroBackupTaskFunc::name() should never be called"); + ASSERT(false); + return StringRef(); } - void a_exitChoose3() - { - if (static_cast<_finishActor2*>(this)->actor_wait_state > 0) static_cast<_finishActor2*>(this)->actor_wait_state = 0; - static_cast<_finishActor2*>(this)->ActorCallback< _finishActor2, 2, Void >::remove(); + + Future execute(Database cx, + Reference tb, + Reference fb, + Reference task) override { + return Future(Void()); + }; + Future finish(Reference tr, + Reference tb, + Reference fb, + Reference task) override { + return _finish(tr, tb, fb, task); + }; +}; +StringRef AbortFiveZeroBackupTask::name = "abort_legacy_backup"_sr; +REGISTER_TASKFUNC(AbortFiveZeroBackupTask); +REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_backup_diff_logs); +REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_backup_log_range); +REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_backup_logs); +REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_backup_range); +REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_backup_restorable); +REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_finish_full_backup); +REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_finished_full_backup); +REGISTER_TASKFUNC_ALIAS(AbortFiveZeroBackupTask, file_start_full_backup); + + #line 11395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via abortFiveOneBackup() + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class AbortFiveOneBackupActorState { + #line 11401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + AbortFiveOneBackupActorState(FileBackupAgent* const& backupAgent,Reference const& tr,std::string const& tagName) + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : backupAgent(backupAgent), + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr(tr), + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tagName(tagName) + #line 11412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("abortFiveOneBackup", reinterpret_cast(this)); } - void a_callback_fire(ActorCallback< _finishActor2, 2, Void >*,Void const& value) + ~AbortFiveOneBackupActorState() + { + fdb_probe_actor_destroy("abortFiveOneBackup", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 2); - a_exitChoose3(); try { - a_body1cont1when1(value, 0); + #line 1544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 1545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tag = makeBackupTag(tagName); + #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = tag.getOrThrow(tr, Snapshot::False, backup_unneeded()); + #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 11435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 11440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~AbortFiveOneBackupActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config = BackupConfig(current.first); + #line 1551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = config.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); + #line 1551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 11467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 11472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(UidAndAbortedFlagT const& __current,int loopDepth) + { + #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + current = __current; + #line 11481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(UidAndAbortedFlagT && __current,int loopDepth) + { + current = std::move(__current); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AbortFiveOneBackupActor, 0, UidAndAbortedFlagT >::remove(); + + } + void a_callback_fire(ActorCallback< AbortFiveOneBackupActor, 0, UidAndAbortedFlagT >*,UidAndAbortedFlagT const& value) + { + fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); + fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< _finishActor2, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< AbortFiveOneBackupActor, 0, UidAndAbortedFlagT >*,UidAndAbortedFlagT && value) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); + fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< _finishActor2, 2, Void >*,Error err) + void a_callback_error(ActorCallback< AbortFiveOneBackupActor, 0, UidAndAbortedFlagT >*,Error err) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1Catch1(err, 0); } @@ -10901,244 +11538,220 @@ class _finishActor2State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); + fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 0); } - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference tr; - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference taskBucket; - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference futureBucket; - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference task; - #line 1387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference taskFuture; - #line 10917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -}; -// This generated class is to be used only via _finish() - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class _finishActor2 final : public Actor, public ActorCallback< _finishActor2, 0, Void >, public ActorCallback< _finishActor2, 1, Void >, public ActorCallback< _finishActor2, 2, Void >, public FastAllocated<_finishActor2>, public _finishActor2State<_finishActor2> { - #line 10922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -public: - using FastAllocated<_finishActor2>::operator new; - using FastAllocated<_finishActor2>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< _finishActor2, 0, Void >; -friend struct ActorCallback< _finishActor2, 1, Void >; -friend struct ActorCallback< _finishActor2, 2, Void >; - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - _finishActor2(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 10935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor(), - _finishActor2State<_finishActor2>(tr, taskBucket, futureBucket, task) + int a_body1cont2(EBackupState const& status,int loopDepth) { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("_finish"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("_finish", reinterpret_cast(this), -1); + #line 1553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!backupAgent->isRunnable(status)) + #line 11548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(backup_unneeded(), loopDepth); + #line 11552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevInfo, "FBA_AbortFileOneBackup") .detail("TagName", tagName.c_str()) .detail("Status", BackupAgentBase::getStateText(status)); + #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = tag.cancel(tr); + #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 11560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 11565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + return loopDepth; } - void cancel() override + int a_body1cont2(EBackupState && status,int loopDepth) { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< _finishActor2, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< _finishActor2, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< _finishActor2, 2, Void >*)0, actor_cancelled()); break; + #line 1553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!backupAgent->isRunnable(status)) + #line 11574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(backup_unneeded(), loopDepth); + #line 11578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } + #line 1557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevInfo, "FBA_AbortFileOneBackup") .detail("TagName", tagName.c_str()) .detail("Status", BackupAgentBase::getStateText(status)); + #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = tag.cancel(tr); + #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 11586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 11591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + return loopDepth; } -}; - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new _finishActor2(tr, taskBucket, futureBucket, task)); - #line 10964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -} - -#line 1406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -}; -StringRef BackupRangeTaskFunc::name = LiteralStringRef("file_backup_write_range_5.2"); -REGISTER_TASKFUNC(BackupRangeTaskFunc); - -struct BackupSnapshotDispatchTask : BackupTaskFuncBase { - static StringRef name; - static constexpr uint32_t version = 1; - - static struct { - // Set by Execute, used by Finish - static TaskParam shardsBehind() { return LiteralStringRef(__FUNCTION__); } - // Set by Execute, used by Finish - static TaskParam snapshotFinished() { return LiteralStringRef(__FUNCTION__); } - // Set by Execute, used by Finish - static TaskParam nextDispatchVersion() { return LiteralStringRef(__FUNCTION__); } - } Params; - - StringRef getName() const override { return name; }; + int a_body1cont1when1(EBackupState const& status,int loopDepth) + { + loopDepth = a_body1cont2(status, loopDepth); - Future execute(Database cx, - Reference tb, - Reference fb, - Reference task) override { - return _execute(cx, tb, fb, task); - }; - Future finish(Reference tr, - Reference tb, - Reference fb, - Reference task) override { - return _finish(tr, tb, fb, task); - }; + return loopDepth; + } + int a_body1cont1when1(EBackupState && status,int loopDepth) + { + loopDepth = a_body1cont2(std::move(status), loopDepth); - #line 11000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via addTask() - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class AddTaskActor1State { - #line 11006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -public: - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - AddTaskActor1State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,int const& priority,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference(),Version const& scheduledVersion = invalidVersion) - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : tr(tr), - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - taskBucket(taskBucket), - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - parentTask(parentTask), - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - priority(priority), - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - completionKey(completionKey), - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - waitFor(waitFor), - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - scheduledVersion(scheduledVersion) - #line 11025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + return loopDepth; + } + void a_exitChoose2() { - fdb_probe_actor_create("addTask", reinterpret_cast(this)); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AbortFiveOneBackupActor, 1, EBackupState >::remove(); } - ~AddTaskActor1State() + void a_callback_fire(ActorCallback< AbortFiveOneBackupActor, 1, EBackupState >*,EBackupState const& value) { - fdb_probe_actor_destroy("addTask", reinterpret_cast(this)); + fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 1); } - int a_body1(int loopDepth=0) + void a_callback_fire(ActorCallback< AbortFiveOneBackupActor, 1, EBackupState >*,EBackupState && value) { + fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 1); + a_exitChoose2(); try { - #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = addBackupTask( name, version, tr, taskBucket, completionKey, BackupConfig(parentTask), waitFor, [=](Reference task) { if (scheduledVersion != invalidVersion) ReservedTaskParams::scheduledVersion().set(task, scheduledVersion); }, priority); - #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) + void a_callback_error(ActorCallback< AbortFiveOneBackupActor, 1, EBackupState >*,Error err) { - this->~AddTaskActor1State(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; + fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1cont1(Key const& key,int loopDepth) + int a_body1cont3(Void const& _,int loopDepth) { - #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor1State(); static_cast(this)->destroy(); return 0; } - #line 11070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(key); - this->~AddTaskActor1State(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key configPath = uidPrefixKey(logRangesRange.begin, config.getUid()); + #line 1565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key logsPath = uidPrefixKey(backupLogKeys.begin, config.getUid()); + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(KeyRangeRef(configPath, strinc(configPath))); + #line 1568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(KeyRangeRef(logsPath, strinc(logsPath))); + #line 1570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config.stateEnum().set(tr, EBackupState::STATE_ABORTED); + #line 1572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortFiveOneBackupActorState(); static_cast(this)->destroy(); return 0; } + #line 11673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~AbortFiveOneBackupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1cont1(Key && key,int loopDepth) + int a_body1cont3(Void && _,int loopDepth) { - #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor1State(); static_cast(this)->destroy(); return 0; } - #line 11082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(key); - this->~AddTaskActor1State(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key configPath = uidPrefixKey(logRangesRange.begin, config.getUid()); + #line 1565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key logsPath = uidPrefixKey(backupLogKeys.begin, config.getUid()); + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(KeyRangeRef(configPath, strinc(configPath))); + #line 1568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(KeyRangeRef(logsPath, strinc(logsPath))); + #line 1570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config.stateEnum().set(tr, EBackupState::STATE_ABORTED); + #line 1572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortFiveOneBackupActorState(); static_cast(this)->destroy(); return 0; } + #line 11695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~AbortFiveOneBackupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1when1(Key const& key,int loopDepth) + int a_body1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(key, loopDepth); + loopDepth = a_body1cont3(_, loopDepth); return loopDepth; } - int a_body1when1(Key && key,int loopDepth) + int a_body1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(key), loopDepth); + loopDepth = a_body1cont3(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AddTaskActor1, 0, Key >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AbortFiveOneBackupActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< AddTaskActor1, 0, Key >*,Key const& value) + void a_callback_fire(ActorCallback< AbortFiveOneBackupActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("addTask", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1when1(value, 0); + a_body1cont2when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); + fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< AddTaskActor1, 0, Key >*,Key && value) + void a_callback_fire(ActorCallback< AbortFiveOneBackupActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("addTask", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1when1(std::move(value), 0); + a_body1cont2when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); + fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< AddTaskActor1, 0, Key >*,Error err) + void a_callback_error(ActorCallback< AbortFiveOneBackupActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("addTask", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -11147,50 +11760,50 @@ class AddTaskActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); + fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), 2); } - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + FileBackupAgent* backupAgent; + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference taskBucket; - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference parentTask; - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int priority; - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TaskCompletionKey completionKey; - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference waitFor; - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version scheduledVersion; - #line 11167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string tagName; + #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyBackedTag tag; + #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + UidAndAbortedFlagT current; + #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + BackupConfig config; + #line 11778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via addTask() - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class AddTaskActor1 final : public Actor, public ActorCallback< AddTaskActor1, 0, Key >, public FastAllocated, public AddTaskActor1State { - #line 11172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via abortFiveOneBackup() + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class AbortFiveOneBackupActor final : public Actor, public ActorCallback< AbortFiveOneBackupActor, 0, UidAndAbortedFlagT >, public ActorCallback< AbortFiveOneBackupActor, 1, EBackupState >, public ActorCallback< AbortFiveOneBackupActor, 2, Void >, public FastAllocated, public AbortFiveOneBackupActorState { + #line 11783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< AddTaskActor1, 0, Key >; - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - AddTaskActor1(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,int const& priority,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference(),Version const& scheduledVersion = invalidVersion) - #line 11183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor(), - AddTaskActor1State(tr, taskBucket, parentTask, priority, completionKey, waitFor, scheduledVersion) +friend struct ActorCallback< AbortFiveOneBackupActor, 0, UidAndAbortedFlagT >; +friend struct ActorCallback< AbortFiveOneBackupActor, 1, EBackupState >; +friend struct ActorCallback< AbortFiveOneBackupActor, 2, Void >; + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + AbortFiveOneBackupActor(FileBackupAgent* const& backupAgent,Reference const& tr,std::string const& tagName) + #line 11796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + AbortFiveOneBackupActorState(backupAgent, tr, tagName) { - fdb_probe_actor_enter("addTask", reinterpret_cast(this), -1); + fdb_probe_actor_enter("abortFiveOneBackup", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("addTask"); + this->lineage.setActorName("abortFiveOneBackup"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("addTask", reinterpret_cast(this), -1); + fdb_probe_actor_exit("abortFiveOneBackup", reinterpret_cast(this), -1); } void cancel() override @@ -11198,66 +11811,70 @@ friend struct ActorCallback< AddTaskActor1, 0, Key >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< AddTaskActor1, 0, Key >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< AbortFiveOneBackupActor, 0, UidAndAbortedFlagT >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< AbortFiveOneBackupActor, 1, EBackupState >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< AbortFiveOneBackupActor, 2, Void >*)0, actor_cancelled()); break; } } }; - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, int const& priority, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference(), Version const& scheduledVersion = invalidVersion ) { - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new AddTaskActor1(tr, taskBucket, parentTask, priority, completionKey, waitFor, scheduledVersion)); - #line 11210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future abortFiveOneBackup( FileBackupAgent* const& backupAgent, Reference const& tr, std::string const& tagName ) { + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new AbortFiveOneBackupActor(backupAgent, tr, tagName)); + #line 11825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 1460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - - enum DispatchState { SKIP = 0, DONE = 1, NOT_DONE_MIN = 2 }; +#line 1574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 11217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via _execute() - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class _executeActor1State { - #line 11223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +struct AbortFiveOneBackupTask : TaskFuncBase { + static StringRef name; + #line 11832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via _finish() + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _finishActor1State { + #line 11838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - _executeActor1State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : cx(cx), - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + _finishActor1State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : tr(tr), + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 1467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - lock(new FlowLock(CLIENT_KNOBS->BACKUP_LOCK_BYTES)) - #line 11238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backupAgent(), + #line 1582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config(task) + #line 11855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("_execute", reinterpret_cast(this)); + fdb_probe_actor_create("_finish", reinterpret_cast(this)); } - ~_executeActor1State() + ~_finishActor1State() { - fdb_probe_actor_destroy("_execute", reinterpret_cast(this)); + fdb_probe_actor_destroy("_finish", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = checkTaskVersion(cx, task, name, version); - #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = config.tag().getOrThrow(tr); + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_finishActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 11872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast<_executeActor1*>(this)->actor_wait_state = 1; - #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 11260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast<_finishActor1*>(this)->actor_wait_state = 1; + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor1*>(this))); + #line 11877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11270,71 +11887,55 @@ class _executeActor1State { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~_executeActor1State(); - static_cast<_executeActor1*>(this)->sendErrorAndDelPromiseRef(error); + this->~_finishActor1State(); + static_cast<_finishActor1*>(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(Void const& _,int loopDepth) + int a_body1cont1(int loopDepth) { - #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - startTime = timer(); - #line 1471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr = Reference(new ReadYourWritesTransaction(cx)); - #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - notDoneSequence = NOT_DONE_MIN; - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - shardMap = KeyRangeMap(notDoneSequence++, normalKeys.end); - #line 1478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - beginKey = normalKeys.begin; - #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 11293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont1loopHead1(loopDepth); + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevInfo, "FileBackupCancelFiveOneTask") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("TagName", tagName); + #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = abortFiveOneBackup(&backupAgent, tr, tagName); + #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_finishActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 11904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast<_finishActor1*>(this)->actor_wait_state = 2; + #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor1*>(this))); + #line 11909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1when1(std::string const& __tagName,int loopDepth) { - #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - startTime = timer(); - #line 1471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr = Reference(new ReadYourWritesTransaction(cx)); - #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - notDoneSequence = NOT_DONE_MIN; - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - shardMap = KeyRangeMap(notDoneSequence++, normalKeys.end); - #line 1478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - beginKey = normalKeys.begin; - #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 11312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont1loopHead1(loopDepth); - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(_, loopDepth); + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tagName = __tagName; + #line 11918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1when1(std::string && __tagName,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + tagName = std::move(__tagName); + loopDepth = a_body1cont1(loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast<_executeActor1*>(this)->actor_wait_state > 0) static_cast<_executeActor1*>(this)->actor_wait_state = 0; - static_cast<_executeActor1*>(this)->ActorCallback< _executeActor1, 0, Void >::remove(); + if (static_cast<_finishActor1*>(this)->actor_wait_state > 0) static_cast<_finishActor1*>(this)->actor_wait_state = 0; + static_cast<_finishActor1*>(this)->ActorCallback< _finishActor1, 0, std::string >::remove(); } - void a_callback_fire(ActorCallback< _executeActor1, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< _finishActor1, 0, std::string >*,std::string const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 0); + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -11344,12 +11945,12 @@ class _executeActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 0); + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< _executeActor1, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< _finishActor1, 0, std::string >*,std::string && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 0); + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -11359,12 +11960,12 @@ class _executeActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 0); + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< _executeActor1, 0, Void >*,Error err) + void a_callback_error(ActorCallback< _finishActor1, 0, std::string >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 0); + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -11374,304 +11975,453 @@ class _executeActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 0); + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); } - int a_body1cont2(int loopDepth) + int a_body1cont2(Void const& _,int loopDepth) { - #line 1505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config = BackupConfig(task); - #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - recentReadVersion = Version(); - #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotBeginVersion = Version(); - #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotTargetEndVersion = Version(); - #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotIntervalSeconds = int64_t(); - #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - latestSnapshotEndVersion = Optional(); - #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backupRanges = std::vector(); - #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotBatchFutureKey = Optional(); - #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotBatchFuture = Reference(); - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotBatchSize = Optional(); - #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->reset(); - #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 11406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont2loopHead1(loopDepth); + #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = taskBucket->finish(tr, task); + #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_finishActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 11987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast<_finishActor1*>(this)->actor_wait_state = 3; + #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor1*>(this))); + #line 11992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont1loopHead1(int loopDepth) + int a_body1cont2(Void && _,int loopDepth) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); + #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = taskBucket->finish(tr, task); + #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_finishActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 12003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast<_finishActor1*>(this)->actor_wait_state = 3; + #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor1*>(this))); + #line 12008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont1loopBody1(int loopDepth) + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast<_finishActor1*>(this)->actor_wait_state > 0) static_cast<_finishActor1*>(this)->actor_wait_state = 0; + static_cast<_finishActor1*>(this)->ActorCallback< _finishActor1, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _finishActor1, 1, Void >*,Void const& value) { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); + a_exitChoose2(); try { - #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - shardBoundaries = getBlockOfShards(tr, beginKey, normalKeys.end, CLIENT_KNOBS->TOO_MANY); - #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = success(shardBoundaries) && taskBucket->keepRunning(tr, task); - #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; - static_cast<_executeActor1*>(this)->actor_wait_state = 2; - #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 11436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + a_body1cont1when1(value, 0); } catch (Error& error) { - loopDepth = a_body1cont1loopBody1Catch1(error, loopDepth); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1cont1loopBody1Catch1(unknown_error(), loopDepth); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1cont1break1(int loopDepth) + void a_callback_fire(ActorCallback< _finishActor1, 1, Void >*,Void && value) { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); + a_exitChoose2(); try { - return a_body1cont2(loopDepth); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); - return loopDepth; - } - int a_body1cont1loopBody1cont1(int loopDepth) - { - if (loopDepth == 0) return a_body1cont1loopHead1(0); - - return loopDepth; } - int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) + void a_callback_error(ActorCallback< _finishActor1, 1, Void >*,Error err) { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); + a_exitChoose2(); try { - #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = tr->onError(e); - #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 11473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast<_executeActor1*>(this)->actor_wait_state = 3; - #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 11478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + a_body1Catch1(err, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1cont1loopBody1cont2(Void const& _,int loopDepth) + int a_body1cont3(Void const& _,int loopDepth) { - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (shardBoundaries.get().size() == 0) - #line 11493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break - } - #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for( auto& boundary : shardBoundaries.get() ) { - #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - shardMap.rawInsert(boundary, notDoneSequence++); - #line 11501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - beginKey = keyAfter(shardBoundaries.get().back()); - #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->reset(); - #line 11507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont1loopBody1cont6(loopDepth); + #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_finishActor1*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor1State(); static_cast<_finishActor1*>(this)->destroy(); return 0; } + #line 12080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_finishActor1*>(this)->SAV< Void >::value()) Void(Void()); + this->~_finishActor1State(); + static_cast<_finishActor1*>(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont1loopBody1cont2(Void && _,int loopDepth) + int a_body1cont3(Void && _,int loopDepth) { - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (shardBoundaries.get().size() == 0) - #line 11516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break - } - #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for( auto& boundary : shardBoundaries.get() ) { - #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - shardMap.rawInsert(boundary, notDoneSequence++); - #line 11524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - beginKey = keyAfter(shardBoundaries.get().back()); - #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->reset(); - #line 11530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont1loopBody1cont6(loopDepth); + #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_finishActor1*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor1State(); static_cast<_finishActor1*>(this)->destroy(); return 0; } + #line 12092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_finishActor1*>(this)->SAV< Void >::value()) Void(Void()); + this->~_finishActor1State(); + static_cast<_finishActor1*>(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont1loopBody1when1(Void const& _,int loopDepth) + int a_body1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont2(_, loopDepth); + loopDepth = a_body1cont3(_, loopDepth); return loopDepth; } - int a_body1cont1loopBody1when1(Void && _,int loopDepth) + int a_body1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont3(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose3() { - if (static_cast<_executeActor1*>(this)->actor_wait_state > 0) static_cast<_executeActor1*>(this)->actor_wait_state = 0; - static_cast<_executeActor1*>(this)->ActorCallback< _executeActor1, 1, Void >::remove(); + if (static_cast<_finishActor1*>(this)->actor_wait_state > 0) static_cast<_finishActor1*>(this)->actor_wait_state = 0; + static_cast<_finishActor1*>(this)->ActorCallback< _finishActor1, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< _executeActor1, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< _finishActor1, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont1loopBody1when1(value, 0); + a_body1cont2when1(value, 0); } catch (Error& error) { - a_body1cont1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< _executeActor1, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< _finishActor1, 2, Void >*,Void && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont1loopBody1when1(std::move(value), 0); + a_body1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1cont1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< _executeActor1, 1, Void >*,Error err) + void a_callback_error(ActorCallback< _finishActor1, 2, Void >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1cont1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); } - int a_body1cont1loopBody1cont6(int loopDepth) + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference taskBucket; + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference futureBucket; + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference task; + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + FileBackupAgent backupAgent; + #line 1582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + BackupConfig config; + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string tagName; + #line 12177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via _finish() + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _finishActor1 final : public Actor, public ActorCallback< _finishActor1, 0, std::string >, public ActorCallback< _finishActor1, 1, Void >, public ActorCallback< _finishActor1, 2, Void >, public FastAllocated<_finishActor1>, public _finishActor1State<_finishActor1> { + #line 12182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated<_finishActor1>::operator new; + using FastAllocated<_finishActor1>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< _finishActor1, 0, std::string >; +friend struct ActorCallback< _finishActor1, 1, Void >; +friend struct ActorCallback< _finishActor1, 2, Void >; + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + _finishActor1(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) + #line 12195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + _finishActor1State<_finishActor1>(tr, taskBucket, futureBucket, task) + { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("_finish"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("_finish", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< _finishActor1, 0, std::string >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< _finishActor1, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< _finishActor1, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new _finishActor1(tr, taskBucket, futureBucket, task)); + #line 12224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 1593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + StringRef getName() const override { + TraceEvent(SevError, "FileBackupError") + .detail("Cause", "AbortFiveOneBackupTaskFunc::name() should never be called"); + ASSERT(false); + return StringRef(); + } + + Future execute(Database cx, + Reference tb, + Reference fb, + Reference task) override { + return Future(Void()); + }; + Future finish(Reference tr, + Reference tb, + Reference fb, + Reference task) override { + return _finish(tr, tb, fb, task); + }; +}; +StringRef AbortFiveOneBackupTask::name = "abort_legacy_backup_5.2"_sr; +REGISTER_TASKFUNC(AbortFiveOneBackupTask); +REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_write_range); +REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_dispatch_ranges); +REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_write_logs); +REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_erase_logs); +REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_dispatch_logs); +REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_finished); +REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_write_snapshot_manifest); +REGISTER_TASKFUNC_ALIAS(AbortFiveOneBackupTask, file_backup_start); + +std::function)> NOP_SETUP_TASK_FN = [](Reference task) { /* NOP */ }; + #line 12261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via addBackupTask() + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class AddBackupTaskActorState { + #line 12267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + AddBackupTaskActorState(StringRef const& name,uint32_t const& version,Reference const& tr,Reference const& taskBucket,TaskCompletionKey const& completionKey,BackupConfig const& config,Reference const& waitFor = Reference(),std::function)> const& setupTaskFn = NOP_SETUP_TASK_FN,int const& priority = 0,SetValidation const& setValidation = SetValidation::True) + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : name(name), + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + version(version), + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr(tr), + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + taskBucket(taskBucket), + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + completionKey(completionKey), + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config(config), + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + waitFor(waitFor), + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + setupTaskFn(setupTaskFn), + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + priority(priority), + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + setValidation(setValidation) + #line 12292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("addBackupTask", reinterpret_cast(this)); + + } + ~AddBackupTaskActorState() + { + fdb_probe_actor_destroy("addBackupTask", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) { try { - loopDepth = a_body1cont1loopBody1cont1(loopDepth); + #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 1637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); + #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 12313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 12318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont1loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - loopDepth = a_body1cont1loopBody1cont1(loopDepth); + this->~AddBackupTaskActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1cont1loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1cont1(Key const& doneKey,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont1(loopDepth); + #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + task = Reference(new Task(name, version, doneKey, priority)); + #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = config.toTask(tr, task, setValidation); + #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 12345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 12350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont1(Key && doneKey,int loopDepth) { - loopDepth = a_body1cont1loopBody1Catch1cont1(_, loopDepth); + #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + task = Reference(new Task(name, version, doneKey, priority)); + #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = config.toTask(tr, task, setValidation); + #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 12363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 12368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont1loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1when1(Key const& doneKey,int loopDepth) { - loopDepth = a_body1cont1loopBody1Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont1(doneKey, loopDepth); return loopDepth; } - void a_exitChoose3() + int a_body1when1(Key && doneKey,int loopDepth) { - if (static_cast<_executeActor1*>(this)->actor_wait_state > 0) static_cast<_executeActor1*>(this)->actor_wait_state = 0; - static_cast<_executeActor1*>(this)->ActorCallback< _executeActor1, 2, Void >::remove(); + loopDepth = a_body1cont1(std::move(doneKey), loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< _executeActor1, 2, Void >*,Void const& value) + void a_exitChoose1() { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); - a_exitChoose3(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AddBackupTaskActor, 0, Key >::remove(); + + } + void a_callback_fire(ActorCallback< AddBackupTaskActor, 0, Key >*,Key const& value) + { + fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont1loopBody1Catch1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); + fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< _executeActor1, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< AddBackupTaskActor, 0, Key >*,Key && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont1loopBody1Catch1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); + fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< _executeActor1, 2, Void >*,Error err) + void a_callback_error(ActorCallback< AddBackupTaskActor, 0, Key >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1Catch1(err, 0); } @@ -11680,48 +12430,5535 @@ class _executeActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); + fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 0); } - int a_body1cont3(int loopDepth) + int a_body1cont2(Void const& _,int loopDepth) { - #line 1568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - dispatchBoundaries = std::vector>(); - #line 1569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->reset(); - #line 1570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - beginKey = normalKeys.begin; - #line 1571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 11696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont3loopHead1(loopDepth); + #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + setupTaskFn(task); + #line 1648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!waitFor) + #line 12442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task)); this->~AddBackupTaskActorState(); static_cast(this)->destroy(); return 0; } + #line 12446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task)); + this->~AddBackupTaskActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = waitFor->onSetAddTask(tr, taskBucket, task); + #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 12456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 12461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont2loopHead1(int loopDepth) + int a_body1cont2(Void && _,int loopDepth) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont2loopBody1(loopDepth); + #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + setupTaskFn(task); + #line 1648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!waitFor) + #line 12472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task)); this->~AddBackupTaskActorState(); static_cast(this)->destroy(); return 0; } + #line 12476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task)); + this->~AddBackupTaskActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = waitFor->onSetAddTask(tr, taskBucket, task); + #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 12486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 12491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont2loopBody1(int loopDepth) + int a_body1cont1when1(Void const& _,int loopDepth) { - try { - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_3 = store(snapshotBeginVersion, config.snapshotBeginVersion().getOrThrow(tr)) && store(snapshotTargetEndVersion, config.snapshotTargetEndVersion().getOrThrow(tr)) && store(backupRanges, config.backupRanges().getOrThrow(tr)) && store(snapshotIntervalSeconds, config.snapshotIntervalSeconds().getOrThrow(tr)) && store(snapshotBatchFutureKey, config.snapshotBatchFuture().get(tr)) && store(snapshotBatchSize, config.snapshotBatchSize().get(tr)) && store(latestSnapshotEndVersion, config.latestSnapshotEndVersion().get(tr)) && store(recentReadVersion, tr->getReadVersion()) && taskBucket->keepRunning(tr, task); - #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AddBackupTaskActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AddBackupTaskActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< AddBackupTaskActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< AddBackupTaskActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 1); + + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddBackupTaskActorState(); static_cast(this)->destroy(); return 0; } + #line 12563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); + this->~AddBackupTaskActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddBackupTaskActorState(); static_cast(this)->destroy(); return 0; } + #line 12575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); + this->~AddBackupTaskActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AddBackupTaskActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AddBackupTaskActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< AddBackupTaskActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< AddBackupTaskActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), 2); + + } + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StringRef name; + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + uint32_t version; + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference taskBucket; + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TaskCompletionKey completionKey; + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + BackupConfig config; + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference waitFor; + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::function)> setupTaskFn; + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int priority; + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + SetValidation setValidation; + #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference task; + #line 12668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via addBackupTask() + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class AddBackupTaskActor final : public Actor, public ActorCallback< AddBackupTaskActor, 0, Key >, public ActorCallback< AddBackupTaskActor, 1, Void >, public ActorCallback< AddBackupTaskActor, 2, Void >, public FastAllocated, public AddBackupTaskActorState { + #line 12673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< AddBackupTaskActor, 0, Key >; +friend struct ActorCallback< AddBackupTaskActor, 1, Void >; +friend struct ActorCallback< AddBackupTaskActor, 2, Void >; + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + AddBackupTaskActor(StringRef const& name,uint32_t const& version,Reference const& tr,Reference const& taskBucket,TaskCompletionKey const& completionKey,BackupConfig const& config,Reference const& waitFor = Reference(),std::function)> const& setupTaskFn = NOP_SETUP_TASK_FN,int const& priority = 0,SetValidation const& setValidation = SetValidation::True) + #line 12686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + AddBackupTaskActorState(name, version, tr, taskBucket, completionKey, config, waitFor, setupTaskFn, priority, setValidation) + { + fdb_probe_actor_enter("addBackupTask", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("addBackupTask"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("addBackupTask", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< AddBackupTaskActor, 0, Key >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< AddBackupTaskActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< AddBackupTaskActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future addBackupTask( StringRef const& name, uint32_t const& version, Reference const& tr, Reference const& taskBucket, TaskCompletionKey const& completionKey, BackupConfig const& config, Reference const& waitFor = Reference(), std::function)> const& setupTaskFn = NOP_SETUP_TASK_FN, int const& priority = 0, SetValidation const& setValidation = SetValidation::True ) { + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new AddBackupTaskActor(name, version, tr, taskBucket, completionKey, config, waitFor, setupTaskFn, priority, setValidation)); + #line 12715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 1655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + +// Clears the backup ID from "backupStartedKey" to pause backup workers. + #line 12721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via clearBackupStartID() + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class ClearBackupStartIDActorState { + #line 12727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ClearBackupStartIDActorState(Reference const& tr,UID const& backupUid) + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : tr(tr), + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backupUid(backupUid) + #line 12736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("clearBackupStartID", reinterpret_cast(this)); + + } + ~ClearBackupStartIDActorState() + { + fdb_probe_actor_destroy("clearBackupStartID", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 1659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_0 = tr->get(backupStartedKey); + #line 1659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 12753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 12758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ClearBackupStartIDActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional const& started,int loopDepth) + { + #line 1660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::vector> ids; + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (started.present()) + #line 12783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ids = decodeBackupStartedValue(started.get()); + #line 12787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + auto it = std::find_if(ids.begin(), ids.end(), [=](const std::pair& p) { return p.first == backupUid; }); + #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (it != ids.end()) + #line 12793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ids.erase(it); + #line 12797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (ids.empty()) + #line 12801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("ClearBackup").detail("BackupID", backupUid); + #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(backupStartedKey); + #line 12807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + else + { + #line 1674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->set(backupStartedKey, encodeBackupStartedValue(ids)); + #line 12813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ClearBackupStartIDActorState(); static_cast(this)->destroy(); return 0; } + #line 12817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ClearBackupStartIDActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Optional && started,int loopDepth) + { + #line 1660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::vector> ids; + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (started.present()) + #line 12831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ids = decodeBackupStartedValue(started.get()); + #line 12835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + auto it = std::find_if(ids.begin(), ids.end(), [=](const std::pair& p) { return p.first == backupUid; }); + #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (it != ids.end()) + #line 12841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ids.erase(it); + #line 12845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (ids.empty()) + #line 12849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("ClearBackup").detail("BackupID", backupUid); + #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(backupStartedKey); + #line 12855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + else + { + #line 1674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->set(backupStartedKey, encodeBackupStartedValue(ids)); + #line 12861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ClearBackupStartIDActorState(); static_cast(this)->destroy(); return 0; } + #line 12865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ClearBackupStartIDActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Optional const& started,int loopDepth) + { + loopDepth = a_body1cont1(started, loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && started,int loopDepth) + { + loopDepth = a_body1cont1(std::move(started), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ClearBackupStartIDActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< ClearBackupStartIDActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("clearBackupStartID", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("clearBackupStartID", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ClearBackupStartIDActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("clearBackupStartID", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("clearBackupStartID", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ClearBackupStartIDActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("clearBackupStartID", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("clearBackupStartID", reinterpret_cast(this), 0); + + } + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + UID backupUid; + #line 12940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via clearBackupStartID() + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class ClearBackupStartIDActor final : public Actor, public ActorCallback< ClearBackupStartIDActor, 0, Optional >, public FastAllocated, public ClearBackupStartIDActorState { + #line 12945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ClearBackupStartIDActor, 0, Optional >; + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ClearBackupStartIDActor(Reference const& tr,UID const& backupUid) + #line 12956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + ClearBackupStartIDActorState(tr, backupUid) + { + fdb_probe_actor_enter("clearBackupStartID", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("clearBackupStartID"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("clearBackupStartID", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ClearBackupStartIDActor, 0, Optional >*)0, actor_cancelled()); break; + } + + } +}; + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future clearBackupStartID( Reference const& tr, UID const& backupUid ) { + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new ClearBackupStartIDActor(tr, backupUid)); + #line 12983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 1678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + +// Backup and Restore taskFunc definitions will inherit from one of the following classes which +// servers to catch and log to the appropriate config any error that execute/finish didn't catch and log. +struct RestoreTaskFuncBase : TaskFuncBase { + Future handleError(Database cx, Reference task, Error const& error) final { + return RestoreConfig(task).logError( + cx, + error, + format("'%s' on '%s'", error.what(), task->params[Task::reservedTaskParamKeyType].printable().c_str())); + } + virtual std::string toString(Reference task) const { return ""; } +}; + +struct BackupTaskFuncBase : TaskFuncBase { + Future handleError(Database cx, Reference task, Error const& error) final { + return BackupConfig(task).logError( + cx, + error, + format("'%s' on '%s'", error.what(), task->params[Task::reservedTaskParamKeyType].printable().c_str())); + } + virtual std::string toString(Reference task) const { return ""; } +}; + + #line 13010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via getBlockOfShards() + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class GetBlockOfShardsActorState { + #line 13016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + GetBlockOfShardsActorState(Reference const& tr,Key const& beginKey,Key const& endKey,int const& limit) + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : tr(tr), + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginKey(beginKey), + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + endKey(endKey), + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + limit(limit) + #line 13029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("getBlockOfShards", reinterpret_cast(this)); + + } + ~GetBlockOfShardsActorState() + { + fdb_probe_actor_destroy("getBlockOfShards", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 1706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 1707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + results = Standalone>(); + #line 1709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = tr->getRange( KeyRangeRef(keyAfter(beginKey.withPrefix(keyServersPrefix)), endKey.withPrefix(keyServersPrefix)), limit); + #line 1709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 13052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 13057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetBlockOfShardsActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(RangeResult const& values,int loopDepth) + { + #line 1712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto& s : values ) { + #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRef k = s.key.removePrefix(keyServersPrefix); + #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + results.push_back_deep(results.arena(), k); + #line 13084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetBlockOfShardsActorState(); static_cast(this)->destroy(); return 0; } + #line 13088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO + this->~GetBlockOfShardsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(RangeResult && values,int loopDepth) + { + #line 1712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto& s : values ) { + #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRef k = s.key.removePrefix(keyServersPrefix); + #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + results.push_back_deep(results.arena(), k); + #line 13104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetBlockOfShardsActorState(); static_cast(this)->destroy(); return 0; } + #line 13108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO + this->~GetBlockOfShardsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(RangeResult const& values,int loopDepth) + { + loopDepth = a_body1cont1(values, loopDepth); + + return loopDepth; + } + int a_body1when1(RangeResult && values,int loopDepth) + { + loopDepth = a_body1cont1(std::move(values), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetBlockOfShardsActor, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< GetBlockOfShardsActor, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("getBlockOfShards", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlockOfShards", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetBlockOfShardsActor, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("getBlockOfShards", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlockOfShards", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetBlockOfShardsActor, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("getBlockOfShards", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlockOfShards", reinterpret_cast(this), 0); + + } + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key beginKey; + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key endKey; + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int limit; + #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Standalone> results; + #line 13189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via getBlockOfShards() + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class GetBlockOfShardsActor final : public Actor>>, public ActorCallback< GetBlockOfShardsActor, 0, RangeResult >, public FastAllocated, public GetBlockOfShardsActorState { + #line 13194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetBlockOfShardsActor, 0, RangeResult >; + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + GetBlockOfShardsActor(Reference const& tr,Key const& beginKey,Key const& endKey,int const& limit) + #line 13205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor>>(), + GetBlockOfShardsActorState(tr, beginKey, endKey, limit) + { + fdb_probe_actor_enter("getBlockOfShards", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getBlockOfShards"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getBlockOfShards", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetBlockOfShardsActor, 0, RangeResult >*)0, actor_cancelled()); break; + } + + } +}; + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future>> getBlockOfShards( Reference const& tr, Key const& beginKey, Key const& endKey, int const& limit ) { + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future>>(new GetBlockOfShardsActor(tr, beginKey, endKey, limit)); + #line 13232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + +struct BackupRangeTaskFunc : BackupTaskFuncBase { + static StringRef name; + static constexpr uint32_t version = 1; + + static struct { + static TaskParam beginKey() { return __FUNCTION__sr; } + static TaskParam endKey() { return __FUNCTION__sr; } + static TaskParam addBackupRangeTasks() { return __FUNCTION__sr; } + } Params; + + std::string toString(Reference task) const override { + return format("beginKey '%s' endKey '%s' addTasks %d", + Params.beginKey().get(task).printable().c_str(), + Params.endKey().get(task).printable().c_str(), + Params.addBackupRangeTasks().get(task)); + } + + StringRef getName() const override { return name; }; + + Future execute(Database cx, + Reference tb, + Reference fb, + Reference task) override { + return _execute(cx, tb, fb, task); + }; + Future finish(Reference tr, + Reference tb, + Reference fb, + Reference task) override { + return _finish(tr, tb, fb, task); + }; + + // Finish (which flushes/syncs) the file, and then in a single transaction, make some range backup progress + // durable. This means: + // - increment the backup config's range bytes written + // - update the range file map + // - update the task begin key + // - save/extend the task with the new params + // Returns whether or not the caller should continue executing the task. + #line 13276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via finishRangeFile() + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class FinishRangeFileActorState { + #line 13282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + FinishRangeFileActorState(Reference const& file,Database const& cx,Reference const& task,Reference const& taskBucket,KeyRange const& range,Version const& version) + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : file(file), + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + cx(cx), + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + task(task), + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + taskBucket(taskBucket), + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + range(range), + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + version(version) + #line 13299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("finishRangeFile", reinterpret_cast(this)); + + } + ~FinishRangeFileActorState() + { + fdb_probe_actor_destroy("finishRangeFile", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = file->finish(); + #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 13316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 13321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FinishRangeFileActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 1768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (range.empty()) + #line 13344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~FinishRangeFileActorState(); static_cast(this)->destroy(); return 0; } + #line 13348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~FinishRangeFileActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr = Reference(new ReadYourWritesTransaction(cx)); + #line 1772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backup = BackupConfig(task); + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + usedFile = false; + #line 1777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = task->extendMutex.take(); + #line 1777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 13364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 13369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 1768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (range.empty()) + #line 13378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~FinishRangeFileActorState(); static_cast(this)->destroy(); return 0; } + #line 13382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~FinishRangeFileActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr = Reference(new ReadYourWritesTransaction(cx)); + #line 1772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backup = BackupConfig(task); + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + usedFile = false; + #line 1777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = task->extendMutex.take(); + #line 1777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 13398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 13403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FinishRangeFileActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FinishRangeFileActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FinishRangeFileActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< FinishRangeFileActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + releaser = FlowLock::Releaser(task->extendMutex, 1); + #line 1780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 13477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont2loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + releaser = FlowLock::Releaser(task->extendMutex, 1); + #line 1780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 13488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont2loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FinishRangeFileActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FinishRangeFileActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< FinishRangeFileActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< FinishRangeFileActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 1); + + } + int a_body1cont4(int loopDepth) + { + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(usedFile); this->~FinishRangeFileActorState(); static_cast(this)->destroy(); return 0; } + #line 13560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(std::move(usedFile)); // state_var_RVO + this->~FinishRangeFileActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont2loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1(int loopDepth) + { + try { + #line 1782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 1787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Params.beginKey().set(task, range.end); + #line 1790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = taskBucket->extendTimeout(tr, task, UpdateParams::True); + #line 1790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); + #line 13588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont2loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2loopBody1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 13593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont2loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont2loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2break1(int loopDepth) + { + try { + return a_body1cont4(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1cont2loopHead1(0); + + return loopDepth; + } + int a_body1cont2loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_5 = tr->onError(e); + #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 13630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1Catch1when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 13635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont2loopBody1cont2(int loopDepth) + { + #line 1793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backup.rangeBytesWritten().atomicOp(tr, file->size(), MutationRef::AddValue); + #line 1794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backup.snapshotRangeFileCount().atomicOp(tr, 1, MutationRef::AddValue); + #line 1797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_3 = backup.snapshotRangeFileMap().get(tr, range.end); + #line 1797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); + #line 13656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont2loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 1797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 13661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2loopBody1when1(Version const& __newTimeout,int loopDepth) + { + #line 1790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + newTimeout = __newTimeout; + #line 13670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont2loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1when1(Version && __newTimeout,int loopDepth) + { + newTimeout = std::move(__newTimeout); + loopDepth = a_body1cont2loopBody1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FinishRangeFileActor, 2, Version >::remove(); + + } + void a_callback_fire(ActorCallback< FinishRangeFileActor, 2, Version >*,Version const& value) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< FinishRangeFileActor, 2, Version >*,Version && value) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< FinishRangeFileActor, 2, Version >*,Error err) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 2); + + } + int a_body1cont2loopBody1cont3(Optional const& s,int loopDepth) + { + #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!s.present() || s.get().begin >= range.begin) + #line 13737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backup.snapshotRangeFileMap().set( tr, range.end, { range.begin, version, file->getFileName(), file->size() }); + #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + usedFile = true; + #line 13743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_4 = tr->commit(); + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); + #line 13749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont2loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont2loopBody1cont3when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 13754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2loopBody1cont3(Optional && s,int loopDepth) + { + #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!s.present() || s.get().begin >= range.begin) + #line 13763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backup.snapshotRangeFileMap().set( tr, range.end, { range.begin, version, file->getFileName(), file->size() }); + #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + usedFile = true; + #line 13769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_4 = tr->commit(); + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); + #line 13775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont2loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont2loopBody1cont3when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 13780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2loopBody1cont2when1(Optional const& s,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont3(s, loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1cont2when1(Optional && s,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont3(std::move(s), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FinishRangeFileActor, 3, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< FinishRangeFileActor, 3, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont2loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< FinishRangeFileActor, 3, Optional >*,Optional && value) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont2loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< FinishRangeFileActor, 3, Optional >*,Error err) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont2loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 3); + + } + int a_body1cont2loopBody1cont4(Void const& _,int loopDepth) + { + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + task->timeoutVersion = newTimeout; + #line 13852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1cont2loopBody1cont4(Void && _,int loopDepth) + { + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + task->timeoutVersion = newTimeout; + #line 13861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1cont2loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FinishRangeFileActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FinishRangeFileActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont2loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< FinishRangeFileActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont2loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< FinishRangeFileActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont2loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 4); + + } + int a_body1cont2loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FinishRangeFileActor, 5, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FinishRangeFileActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont2loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< FinishRangeFileActor, 5, Void >*,Void && value) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont2loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< FinishRangeFileActor, 5, Void >*,Error err) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), 5); + + } + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference file; + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Database cx; + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference task; + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference taskBucket; + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRange range; + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version version; + #line 1771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 1772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + BackupConfig backup; + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool usedFile; + #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + FlowLock::Releaser releaser; + #line 1790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version newTimeout; + #line 14026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via finishRangeFile() + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class FinishRangeFileActor final : public Actor, public ActorCallback< FinishRangeFileActor, 0, Void >, public ActorCallback< FinishRangeFileActor, 1, Void >, public ActorCallback< FinishRangeFileActor, 2, Version >, public ActorCallback< FinishRangeFileActor, 3, Optional >, public ActorCallback< FinishRangeFileActor, 4, Void >, public ActorCallback< FinishRangeFileActor, 5, Void >, public FastAllocated, public FinishRangeFileActorState { + #line 14031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< FinishRangeFileActor, 0, Void >; +friend struct ActorCallback< FinishRangeFileActor, 1, Void >; +friend struct ActorCallback< FinishRangeFileActor, 2, Version >; +friend struct ActorCallback< FinishRangeFileActor, 3, Optional >; +friend struct ActorCallback< FinishRangeFileActor, 4, Void >; +friend struct ActorCallback< FinishRangeFileActor, 5, Void >; + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + FinishRangeFileActor(Reference const& file,Database const& cx,Reference const& task,Reference const& taskBucket,KeyRange const& range,Version const& version) + #line 14047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + FinishRangeFileActorState(file, cx, task, taskBucket, range, version) + { + fdb_probe_actor_enter("finishRangeFile", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("finishRangeFile"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("finishRangeFile", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< FinishRangeFileActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FinishRangeFileActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< FinishRangeFileActor, 2, Version >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< FinishRangeFileActor, 3, Optional >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< FinishRangeFileActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< FinishRangeFileActor, 5, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future finishRangeFile( Reference const& file, Database const& cx, Reference const& task, Reference const& taskBucket, KeyRange const& range, Version const& version ) { + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new FinishRangeFileActor(file, cx, task, taskBucket, range, version)); + #line 14079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + #line 14084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via addTask() + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class AddTaskActorState { + #line 14090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + AddTaskActorState(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,int const& priority,Key const& begin,Key const& end,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference(),Version const& scheduledVersion = invalidVersion) + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : tr(tr), + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + taskBucket(taskBucket), + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + parentTask(parentTask), + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + priority(priority), + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + begin(begin), + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + end(end), + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + completionKey(completionKey), + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + waitFor(waitFor), + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + scheduledVersion(scheduledVersion) + #line 14113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("addTask", reinterpret_cast(this)); + + } + ~AddTaskActorState() + { + fdb_probe_actor_destroy("addTask", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 1824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = addBackupTask( BackupRangeTaskFunc::name, BackupRangeTaskFunc::version, tr, taskBucket, completionKey, BackupConfig(parentTask), waitFor, [=](Reference task) { Params.beginKey().set(task, begin); Params.endKey().set(task, end); Params.addBackupRangeTasks().set(task, false); if (scheduledVersion != invalidVersion) ReservedTaskParams::scheduledVersion().set(task, scheduledVersion); }, priority); + #line 1824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 14130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 14135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~AddTaskActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Key const& key,int loopDepth) + { + #line 1840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActorState(); static_cast(this)->destroy(); return 0; } + #line 14158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key(key); + this->~AddTaskActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Key && key,int loopDepth) + { + #line 1840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActorState(); static_cast(this)->destroy(); return 0; } + #line 14170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key(key); + this->~AddTaskActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Key const& key,int loopDepth) + { + loopDepth = a_body1cont1(key, loopDepth); + + return loopDepth; + } + int a_body1when1(Key && key,int loopDepth) + { + loopDepth = a_body1cont1(std::move(key), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AddTaskActor, 0, Key >::remove(); + + } + void a_callback_fire(ActorCallback< AddTaskActor, 0, Key >*,Key const& value) + { + fdb_probe_actor_enter("addTask", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< AddTaskActor, 0, Key >*,Key && value) + { + fdb_probe_actor_enter("addTask", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< AddTaskActor, 0, Key >*,Error err) + { + fdb_probe_actor_enter("addTask", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); + + } + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference taskBucket; + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference parentTask; + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int priority; + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key begin; + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key end; + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TaskCompletionKey completionKey; + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference waitFor; + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version scheduledVersion; + #line 14259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via addTask() + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class AddTaskActor final : public Actor, public ActorCallback< AddTaskActor, 0, Key >, public FastAllocated, public AddTaskActorState { + #line 14264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< AddTaskActor, 0, Key >; + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + AddTaskActor(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,int const& priority,Key const& begin,Key const& end,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference(),Version const& scheduledVersion = invalidVersion) + #line 14275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + AddTaskActorState(tr, taskBucket, parentTask, priority, begin, end, completionKey, waitFor, scheduledVersion) + { + fdb_probe_actor_enter("addTask", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("addTask"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("addTask", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< AddTaskActor, 0, Key >*)0, actor_cancelled()); break; + } + + } +}; + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, int const& priority, Key const& begin, Key const& end, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference(), Version const& scheduledVersion = invalidVersion ) { + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new AddTaskActor(tr, taskBucket, parentTask, priority, begin, end, completionKey, waitFor, scheduledVersion)); + #line 14302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 1842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + #line 14307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via _execute() + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _executeActorState { + #line 14313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + _executeActorState(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : cx(cx), + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + taskBucket(taskBucket), + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + futureBucket(futureBucket), + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + task(task), + #line 1847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + lock(new FlowLock(CLIENT_KNOBS->BACKUP_LOCK_BYTES)) + #line 14328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("_execute", reinterpret_cast(this)); + + } + ~_executeActorState() + { + fdb_probe_actor_destroy("_execute", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = checkTaskVersion(cx, task, BackupRangeTaskFunc::name, BackupRangeTaskFunc::version); + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 14345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 1; + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 14350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~_executeActorState(); + static_cast<_executeActor*>(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 1851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginKey = Params.beginKey().get(task); + #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + endKey = Params.endKey().get(task); + #line 1854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("FileBackupRangeStart") .suppressFor(60) .detail("BackupUID", BackupConfig(task).getUid()) .detail("BeginKey", Params.beginKey().get(task).printable()) .detail("EndKey", Params.endKey().get(task).printable()) .detail("TaskKey", task->key.printable()); + #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (beginKey == endKey) + #line 14379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } + #line 14383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); + this->~_executeActorState(); + static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture>> __when_expr_1 = runRYWTransaction( cx, [=](Reference tr) { return getBlockOfShards(tr, beginKey, endKey, 1); }); + #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 14393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 2; + #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast> >*>(static_cast<_executeActor*>(this))); + #line 14398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 1851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginKey = Params.beginKey().get(task); + #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + endKey = Params.endKey().get(task); + #line 1854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("FileBackupRangeStart") .suppressFor(60) .detail("BackupUID", BackupConfig(task).getUid()) .detail("BeginKey", Params.beginKey().get(task).printable()) .detail("EndKey", Params.endKey().get(task).printable()) .detail("TaskKey", task->key.printable()); + #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (beginKey == endKey) + #line 14413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } + #line 14417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); + this->~_executeActorState(); + static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture>> __when_expr_1 = runRYWTransaction( cx, [=](Reference tr) { return getBlockOfShards(tr, beginKey, endKey, 1); }); + #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 14427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 2; + #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast> >*>(static_cast<_executeActor*>(this))); + #line 14432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _executeActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< _executeActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 0); + + } + int a_body1cont2(Standalone> const& keys,int loopDepth) + { + #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (keys.size() > 0) + #line 14504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Params.addBackupRangeTasks().set(task, true); + #line 1871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } + #line 14510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); + this->~_executeActorState(); + static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + outFile = Reference(); + #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + outVersion = invalidVersion; + #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + lastKey = Key(); + #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + results = PromiseStream(); + #line 1884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rc = readCommitted(cx, results, lock, KeyRangeRef(beginKey, endKey), Terminator::True, AccessSystemKeys::True, LockAware::True); + #line 1891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rangeFile = std::unique_ptr(); + #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backup = BackupConfig(task); + #line 1893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + arena = Arena(); + #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = getDatabaseConfiguration(cx); + #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 14536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 3; + #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 14541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2(Standalone> && keys,int loopDepth) + { + #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (keys.size() > 0) + #line 14550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Params.addBackupRangeTasks().set(task, true); + #line 1871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } + #line 14556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); + this->~_executeActorState(); + static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + outFile = Reference(); + #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + outVersion = invalidVersion; + #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + lastKey = Key(); + #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + results = PromiseStream(); + #line 1884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rc = readCommitted(cx, results, lock, KeyRangeRef(beginKey, endKey), Terminator::True, AccessSystemKeys::True, LockAware::True); + #line 1891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rangeFile = std::unique_ptr(); + #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backup = BackupConfig(task); + #line 1893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + arena = Arena(); + #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = getDatabaseConfiguration(cx); + #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 14582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 3; + #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 14587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(Standalone> const& keys,int loopDepth) + { + loopDepth = a_body1cont2(keys, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Standalone> && keys,int loopDepth) + { + loopDepth = a_body1cont2(std::move(keys), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 1, Standalone> >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor, 1, Standalone> >*,Standalone> const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< _executeActor, 1, Standalone> >*,Standalone> && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< _executeActor, 1, Standalone> >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); + + } + int a_body1cont4(DatabaseConfiguration const& config,int loopDepth) + { + #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptMode = config.encryptionAtRestMode; + #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tenantCache = Optional>>(); + #line 1898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (encryptMode.mode == EncryptionAtRestMode::DOMAIN_AWARE) + #line 14663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tenantCache = makeReference>(cx, TenantEntryCacheRefreshMode::WATCH); + #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = tenantCache.get()->init(); + #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 14671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 4; + #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 14676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont6(loopDepth); + } + + return loopDepth; + } + int a_body1cont4(DatabaseConfiguration && config,int loopDepth) + { + #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptMode = config.encryptionAtRestMode; + #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tenantCache = Optional>>(); + #line 1898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (encryptMode.mode == EncryptionAtRestMode::DOMAIN_AWARE) + #line 14694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tenantCache = makeReference>(cx, TenantEntryCacheRefreshMode::WATCH); + #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = tenantCache.get()->init(); + #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 14702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 4; + #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 14707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont6(loopDepth); + } + + return loopDepth; + } + int a_body1cont2when1(DatabaseConfiguration const& config,int loopDepth) + { + loopDepth = a_body1cont4(config, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(DatabaseConfiguration && config,int loopDepth) + { + loopDepth = a_body1cont4(std::move(config), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 2, DatabaseConfiguration >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor, 2, DatabaseConfiguration >*,DatabaseConfiguration const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< _executeActor, 2, DatabaseConfiguration >*,DatabaseConfiguration && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< _executeActor, 2, DatabaseConfiguration >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); + + } + int a_body1cont6(int loopDepth) + { + #line 1905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_4 = backup.backupContainer().getD(cx.getReference()); + #line 1905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 14786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 5; + #line 1905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast >*>(static_cast<_executeActor*>(this))); + #line 14791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont7(Void const& _,int loopDepth) + { + loopDepth = a_body1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont7(Void && _,int loopDepth) + { + loopDepth = a_body1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont4when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont7(_, loopDepth); + + return loopDepth; + } + int a_body1cont4when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont7(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont4when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< _executeActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont4when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< _executeActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 3); + + } + int a_body1cont8(Reference const& _bc,int loopDepth) + { + #line 1906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!_bc) + #line 14875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } + #line 14879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); + this->~_executeActorState(); + static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bc = getBackupContainerWithProxy(_bc); + #line 1910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + done = false; + #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + nrKeys = 0; + #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptionEnabled = Optional(); + #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 14895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont8(Reference && _bc,int loopDepth) + { + #line 1906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!_bc) + #line 14904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } + #line 14908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); + this->~_executeActorState(); + static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bc = getBackupContainerWithProxy(_bc); + #line 1910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + done = false; + #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + nrKeys = 0; + #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptionEnabled = Optional(); + #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 14924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont6when1(Reference const& _bc,int loopDepth) + { + loopDepth = a_body1cont8(_bc, loopDepth); + + return loopDepth; + } + int a_body1cont6when1(Reference && _bc,int loopDepth) + { + loopDepth = a_body1cont8(std::move(_bc), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 4, Reference >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor, 4, Reference >*,Reference const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont6when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< _executeActor, 4, Reference >*,Reference && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont6when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< _executeActor, 4, Reference >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 4); + + } + int a_body1cont8loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont8loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1(int loopDepth) + { + #line 1915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + values = RangeResultWithVersion(); + #line 15003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + try { + #line 1917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + FutureStream __when_expr_5 = results.getFuture(); + #line 1917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1cont8loopBody1Catch1(actor_cancelled(), loopDepth); + #line 15009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont8loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont8loopBody1when1(__when_expr_5.pop(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 6; + #line 1917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 15014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont8loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont8loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont8loopBody1cont1(int loopDepth) + { + #line 1929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (values.second != outVersion || done) + #line 15029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (outFile) + #line 15033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CODE_PROBE(outVersion != invalidVersion, "Backup range task wrote multiple versions"); + #line 1932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + nextKey = done ? endKey : keyAfter(lastKey); + #line 1933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_6 = rangeFile->writeKey(nextKey); + #line 1933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 15043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody1cont1when1(__when_expr_6.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 7; + #line 1933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 15048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont8loopBody1cont6(loopDepth); + } + } + else + { + loopDepth = a_body1cont8loopBody1cont5(loopDepth); + } + + return loopDepth; + } + int a_body1cont8loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (e.code() == error_code_end_of_stream) + #line 15068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + done = true; + #line 15072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + else + { + #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 15078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + loopDepth = a_body1cont8loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont8loopBody1cont2(RangeResultWithVersion const& _values,int loopDepth) + { + #line 1918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + values = _values; + #line 1919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + lock->release(values.first.expectedSize()); + #line 15096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8loopBody1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont2(RangeResultWithVersion && _values,int loopDepth) + { + #line 1918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + values = _values; + #line 1919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + lock->release(values.first.expectedSize()); + #line 15107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8loopBody1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1when1(RangeResultWithVersion const& _values,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont2(_values, loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1when1(RangeResultWithVersion && _values,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont2(std::move(_values), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorSingleCallback< _executeActor, 5, RangeResultWithVersion >::remove(); + + } + void a_callback_fire(ActorSingleCallback< _executeActor, 5, RangeResultWithVersion >*,RangeResultWithVersion const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont8loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1cont8loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont8loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorSingleCallback< _executeActor, 5, RangeResultWithVersion >*,RangeResultWithVersion && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont8loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont8loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont8loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorSingleCallback< _executeActor, 5, RangeResultWithVersion >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont8loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont8loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont8loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 5); + + } + int a_body1cont8loopBody1cont4(int loopDepth) + { + try { + loopDepth = a_body1cont8loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont8loopBody1cont5(int loopDepth) + { + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (values.first.size() != 0) + #line 15192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + i = 0; + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 15198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8loopBody1cont5loopHead1(loopDepth); + } + else + { + loopDepth = a_body1cont8loopBody1cont13(loopDepth); + } + + return loopDepth; + } + int a_body1cont8loopBody1cont6(int loopDepth) + { + #line 1957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (done) + #line 15212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_executeActor*>(this)->SAV::futures) { (void)(Void()); this->~_executeActorState(); static_cast<_executeActor*>(this)->destroy(); return 0; } + #line 15216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_executeActor*>(this)->SAV< Void >::value()) Void(Void()); + this->~_executeActorState(); + static_cast<_executeActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + outVersion = values.second; + #line 1965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + blockSize = BUGGIFY ? deterministicRandom()->randomInt(250e3, 4e6) : CLIENT_KNOBS->BACKUP_RANGEFILE_BLOCK_SIZE; + #line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotBeginVersion = Version(); + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotRangeFileCount = int64_t(); + #line 1970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr = Reference(new ReadYourWritesTransaction(cx)); + #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 15234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8loopBody1cont6loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont7(Void const& _,int loopDepth) + { + #line 1935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (BUGGIFY) + #line 15243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_7 = rangeFile->padEnd(true); + #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 15249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody1cont7when1(__when_expr_7.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 8; + #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 15254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont8loopBody1cont8(loopDepth); + } + + return loopDepth; + } + int a_body1cont8loopBody1cont7(Void && _,int loopDepth) + { + #line 1935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (BUGGIFY) + #line 15268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_7 = rangeFile->padEnd(true); + #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 15274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody1cont7when1(__when_expr_7.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 8; + #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 15279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont8loopBody1cont8(loopDepth); + } + + return loopDepth; + } + int a_body1cont8loopBody1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont7(_, loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont7(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose7() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 6, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor, 6, Void >*,Void const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1cont8loopBody1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 6); + + } + void a_callback_fire(ActorCallback< _executeActor, 6, Void >*,Void && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1cont8loopBody1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 6); + + } + void a_callback_error(ActorCallback< _executeActor, 6, Void >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 6); + + } + int a_body1cont8loopBody1cont8(int loopDepth) + { + #line 1939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_8 = rangeFile->finish(); + #line 1939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 15358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody1cont8when1(__when_expr_8.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 9; + #line 1939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 15363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont8loopBody1cont9(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont8(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont9(Void && _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont8(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont7when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont9(_, loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont7when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont9(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose8() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 7, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor, 7, Void >*,Void const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 7); + a_exitChoose8(); + try { + a_body1cont8loopBody1cont7when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 7); + + } + void a_callback_fire(ActorCallback< _executeActor, 7, Void >*,Void && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 7); + a_exitChoose8(); + try { + a_body1cont8loopBody1cont7when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 7); + + } + void a_callback_error(ActorCallback< _executeActor, 7, Void >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 7); + a_exitChoose8(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 7); + + } + int a_body1cont8loopBody1cont10(Void const& _,int loopDepth) + { + #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_9 = finishRangeFile(outFile, cx, task, taskBucket, KeyRangeRef(beginKey, nextKey), outVersion); + #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 15449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody1cont10when1(__when_expr_9.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 10; + #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 15454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont8loopBody1cont10(Void && _,int loopDepth) + { + #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_9 = finishRangeFile(outFile, cx, task, taskBucket, KeyRangeRef(beginKey, nextKey), outVersion); + #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 15465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody1cont10when1(__when_expr_9.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 10; + #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 15470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont8loopBody1cont8when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont10(_, loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont8when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont10(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose9() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 8, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor, 8, Void >*,Void const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 8); + a_exitChoose9(); + try { + a_body1cont8loopBody1cont8when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 8); + + } + void a_callback_fire(ActorCallback< _executeActor, 8, Void >*,Void && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 8); + a_exitChoose9(); + try { + a_body1cont8loopBody1cont8when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 8); + + } + void a_callback_error(ActorCallback< _executeActor, 8, Void >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 8); + a_exitChoose9(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 8); + + } + int a_body1cont8loopBody1cont10cont1(bool const& usedFile,int loopDepth) + { + #line 1943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("FileBackupWroteRangeFile") .suppressFor(60) .detail("BackupUID", backup.getUid()) .detail("Size", outFile->size()) .detail("Keys", nrKeys) .detail("ReadVersion", outVersion) .detail("BeginKey", beginKey.printable()) .detail("EndKey", nextKey.printable()) .detail("AddedFileToMap", usedFile); + #line 1953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + nrKeys = 0; + #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginKey = nextKey; + #line 15546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont10cont1(bool && usedFile,int loopDepth) + { + #line 1943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("FileBackupWroteRangeFile") .suppressFor(60) .detail("BackupUID", backup.getUid()) .detail("Size", outFile->size()) .detail("Keys", nrKeys) .detail("ReadVersion", outVersion) .detail("BeginKey", beginKey.printable()) .detail("EndKey", nextKey.printable()) .detail("AddedFileToMap", usedFile); + #line 1953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + nrKeys = 0; + #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginKey = nextKey; + #line 15559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont10when1(bool const& usedFile,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont10cont1(usedFile, loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont10when1(bool && usedFile,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont10cont1(std::move(usedFile), loopDepth); + + return loopDepth; + } + void a_exitChoose10() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 9, bool >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor, 9, bool >*,bool const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 9); + a_exitChoose10(); + try { + a_body1cont8loopBody1cont10when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 9); + + } + void a_callback_fire(ActorCallback< _executeActor, 9, bool >*,bool && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 9); + a_exitChoose10(); + try { + a_body1cont8loopBody1cont10when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 9); + + } + void a_callback_error(ActorCallback< _executeActor, 9, bool >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 9); + a_exitChoose10(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 9); + + } + int a_body1cont8loopBody1cont11(int loopDepth) + { + #line 1987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_12 = bc->writeRangeFile(snapshotBeginVersion, snapshotRangeFileCount, outVersion, blockSize); + #line 1987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 15633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_12.isReady()) { if (__when_expr_12.isError()) return a_body1Catch1(__when_expr_12.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody1cont11when1(__when_expr_12.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 13; + #line 1987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_12.addCallbackAndClear(static_cast >*>(static_cast<_executeActor*>(this))); + #line 15638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont8loopBody1cont6loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont8loopBody1cont6loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont6loopBody1(int loopDepth) + { + try { + #line 1973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 1974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_10 = taskBucket->keepRunning(tr, task) && storeOrThrow(snapshotBeginVersion, backup.snapshotBeginVersion().get(tr)) && store(encryptionEnabled, backup.enableSnapshotBackupEncryption().get(tr)) && store(snapshotRangeFileCount, backup.snapshotRangeFileCount().getD(tr)); + #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1cont8loopBody1cont6loopBody1Catch1(actor_cancelled(), loopDepth); + #line 15661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1cont8loopBody1cont6loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont8loopBody1cont6loopBody1when1(__when_expr_10.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 11; + #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_10.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 15666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont8loopBody1cont6loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont8loopBody1cont6loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont8loopBody1cont6break1(int loopDepth) + { + try { + return a_body1cont8loopBody1cont11(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont8loopBody1cont6loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1cont8loopBody1cont6loopHead1(0); + + return loopDepth; + } + int a_body1cont8loopBody1cont6loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 1983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_11 = tr->onError(e); + #line 1983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); + #line 15703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1Catch1(__when_expr_11.getError(), std::max(0, loopDepth - 2)); else return a_body1cont8loopBody1cont6loopBody1Catch1when1(__when_expr_11.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 12; + #line 1983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_11.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 15708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 2)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 2)); + } + + return loopDepth; + } + int a_body1cont8loopBody1cont6loopBody1cont2(Void const& _,int loopDepth) + { + return a_body1cont8loopBody1cont6break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1cont8loopBody1cont6loopBody1cont2(Void && _,int loopDepth) + { + return a_body1cont8loopBody1cont6break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1cont8loopBody1cont6loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont6loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont6loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont6loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose11() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 10, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor, 10, Void >*,Void const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 10); + a_exitChoose11(); + try { + a_body1cont8loopBody1cont6loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1cont8loopBody1cont6loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont8loopBody1cont6loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 10); + + } + void a_callback_fire(ActorCallback< _executeActor, 10, Void >*,Void && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 10); + a_exitChoose11(); + try { + a_body1cont8loopBody1cont6loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont8loopBody1cont6loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont8loopBody1cont6loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 10); + + } + void a_callback_error(ActorCallback< _executeActor, 10, Void >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 10); + a_exitChoose11(); + try { + a_body1cont8loopBody1cont6loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont8loopBody1cont6loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont8loopBody1cont6loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 10); + + } + int a_body1cont8loopBody1cont6loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont6loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont6loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont6loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont6loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont6loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont6loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont6loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose12() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 11, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor, 11, Void >*,Void const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 11); + a_exitChoose12(); + try { + a_body1cont8loopBody1cont6loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 11); + + } + void a_callback_fire(ActorCallback< _executeActor, 11, Void >*,Void && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 11); + a_exitChoose12(); + try { + a_body1cont8loopBody1cont6loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 11); + + } + void a_callback_error(ActorCallback< _executeActor, 11, Void >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 11); + a_exitChoose12(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 11); + + } + int a_body1cont8loopBody1cont11cont1(Reference const& f,int loopDepth) + { + #line 1989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + outFile = f; + #line 1991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!encryptionEnabled.present() || !encryptionEnabled.get()) + #line 15875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptMode = EncryptionAtRestMode::DISABLED; + #line 15879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevDebug, "EncryptionMode").detail("EncryptMode", encryptMode.toString()); + #line 1996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (encryptMode.mode != EncryptionAtRestMode::DISABLED) + #line 15885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CODE_PROBE(true, "using encrypted snapshot file writer"); + #line 1998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rangeFile = std::make_unique( cx, &arena, encryptMode, tenantCache, outFile, blockSize); + #line 15891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + else + { + #line 2001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rangeFile = std::make_unique(outFile, blockSize); + #line 15897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_13 = rangeFile->writeKey(beginKey); + #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 15903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_13.isReady()) { if (__when_expr_13.isError()) return a_body1Catch1(__when_expr_13.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody1cont11cont1when1(__when_expr_13.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 14; + #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_13.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 15908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont8loopBody1cont11cont1(Reference && f,int loopDepth) + { + #line 1989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + outFile = f; + #line 1991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!encryptionEnabled.present() || !encryptionEnabled.get()) + #line 15919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptMode = EncryptionAtRestMode::DISABLED; + #line 15923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 1994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevDebug, "EncryptionMode").detail("EncryptMode", encryptMode.toString()); + #line 1996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (encryptMode.mode != EncryptionAtRestMode::DISABLED) + #line 15929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CODE_PROBE(true, "using encrypted snapshot file writer"); + #line 1998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rangeFile = std::make_unique( cx, &arena, encryptMode, tenantCache, outFile, blockSize); + #line 15935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + else + { + #line 2001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rangeFile = std::make_unique(outFile, blockSize); + #line 15941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_13 = rangeFile->writeKey(beginKey); + #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 15947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_13.isReady()) { if (__when_expr_13.isError()) return a_body1Catch1(__when_expr_13.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody1cont11cont1when1(__when_expr_13.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 14; + #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_13.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 15952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont8loopBody1cont11when1(Reference const& f,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont11cont1(f, loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont11when1(Reference && f,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont11cont1(std::move(f), loopDepth); + + return loopDepth; + } + void a_exitChoose13() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 12, Reference >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor, 12, Reference >*,Reference const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 12); + a_exitChoose13(); + try { + a_body1cont8loopBody1cont11when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 12); + + } + void a_callback_fire(ActorCallback< _executeActor, 12, Reference >*,Reference && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 12); + a_exitChoose13(); + try { + a_body1cont8loopBody1cont11when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 12); + + } + void a_callback_error(ActorCallback< _executeActor, 12, Reference >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 12); + a_exitChoose13(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 12); + + } + int a_body1cont8loopBody1cont11cont2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont11cont2(Void && _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont11cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont11cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont11cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont11cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose14() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 13, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor, 13, Void >*,Void const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 13); + a_exitChoose14(); + try { + a_body1cont8loopBody1cont11cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 13); + + } + void a_callback_fire(ActorCallback< _executeActor, 13, Void >*,Void && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 13); + a_exitChoose14(); + try { + a_body1cont8loopBody1cont11cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 13); + + } + void a_callback_error(ActorCallback< _executeActor, 13, Void >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 13); + a_exitChoose14(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 13); + + } + int a_body1cont8loopBody1cont13(int loopDepth) + { + if (loopDepth == 0) return a_body1cont8loopHead1(0); + + return loopDepth; + } + int a_body1cont8loopBody1cont14(int loopDepth) + { + #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + lastKey = values.first.back().key; + #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + nrKeys += values.first.size(); + #line 16107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8loopBody1cont13(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont5loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont8loopBody1cont5loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont5loopBody1(int loopDepth) + { + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!(i < values.first.size())) + #line 16123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + return a_body1cont8loopBody1cont5break1(loopDepth==0?0:loopDepth-1); // break + } + #line 2010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_14 = rangeFile->writeKV(values.first[i].key, values.first[i].value); + #line 2010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); + #line 16131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_14.isReady()) { if (__when_expr_14.isError()) return a_body1Catch1(__when_expr_14.getError(), std::max(0, loopDepth - 2)); else return a_body1cont8loopBody1cont5loopBody1when1(__when_expr_14.get(), loopDepth); }; + static_cast<_executeActor*>(this)->actor_wait_state = 15; + #line 2010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_14.addCallbackAndClear(static_cast*>(static_cast<_executeActor*>(this))); + #line 16136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont8loopBody1cont5break1(int loopDepth) + { + try { + return a_body1cont8loopBody1cont14(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont8loopBody1cont5loopBody1cont1(Void const& _,int loopDepth) + { + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ++i; + #line 16158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (loopDepth == 0) return a_body1cont8loopBody1cont5loopHead1(0); + + return loopDepth; + } + int a_body1cont8loopBody1cont5loopBody1cont1(Void && _,int loopDepth) + { + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ++i; + #line 16167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (loopDepth == 0) return a_body1cont8loopBody1cont5loopHead1(0); + + return loopDepth; + } + int a_body1cont8loopBody1cont5loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont5loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont8loopBody1cont5loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont8loopBody1cont5loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose15() + { + if (static_cast<_executeActor*>(this)->actor_wait_state > 0) static_cast<_executeActor*>(this)->actor_wait_state = 0; + static_cast<_executeActor*>(this)->ActorCallback< _executeActor, 14, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor, 14, Void >*,Void const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 14); + a_exitChoose15(); + try { + a_body1cont8loopBody1cont5loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 14); + + } + void a_callback_fire(ActorCallback< _executeActor, 14, Void >*,Void && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 14); + a_exitChoose15(); + try { + a_body1cont8loopBody1cont5loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 14); + + } + void a_callback_error(ActorCallback< _executeActor, 14, Void >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 14); + a_exitChoose15(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 14); + + } + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Database cx; + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference taskBucket; + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference futureBucket; + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference task; + #line 1847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference lock; + #line 1851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key beginKey; + #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key endKey; + #line 1877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference outFile; + #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version outVersion; + #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key lastKey; + #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + PromiseStream results; + #line 1884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Future rc; + #line 1891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::unique_ptr rangeFile; + #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + BackupConfig backup; + #line 1893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Arena arena; + #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EncryptionAtRestMode encryptMode; + #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional>> tenantCache; + #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference bc; + #line 1910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool done; + #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t nrKeys; + #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional encryptionEnabled; + #line 1915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + RangeResultWithVersion values; + #line 1932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key nextKey; + #line 1965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int blockSize; + #line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version snapshotBeginVersion; + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t snapshotRangeFileCount; + #line 1970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + size_t i; + #line 16291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via _execute() + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _executeActor final : public Actor, public ActorCallback< _executeActor, 0, Void >, public ActorCallback< _executeActor, 1, Standalone> >, public ActorCallback< _executeActor, 2, DatabaseConfiguration >, public ActorCallback< _executeActor, 3, Void >, public ActorCallback< _executeActor, 4, Reference >, public ActorSingleCallback< _executeActor, 5, RangeResultWithVersion >, public ActorCallback< _executeActor, 6, Void >, public ActorCallback< _executeActor, 7, Void >, public ActorCallback< _executeActor, 8, Void >, public ActorCallback< _executeActor, 9, bool >, public ActorCallback< _executeActor, 10, Void >, public ActorCallback< _executeActor, 11, Void >, public ActorCallback< _executeActor, 12, Reference >, public ActorCallback< _executeActor, 13, Void >, public ActorCallback< _executeActor, 14, Void >, public FastAllocated<_executeActor>, public _executeActorState<_executeActor> { + #line 16296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated<_executeActor>::operator new; + using FastAllocated<_executeActor>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< _executeActor, 0, Void >; +friend struct ActorCallback< _executeActor, 1, Standalone> >; +friend struct ActorCallback< _executeActor, 2, DatabaseConfiguration >; +friend struct ActorCallback< _executeActor, 3, Void >; +friend struct ActorCallback< _executeActor, 4, Reference >; +friend struct ActorSingleCallback< _executeActor, 5, RangeResultWithVersion >; +friend struct ActorCallback< _executeActor, 6, Void >; +friend struct ActorCallback< _executeActor, 7, Void >; +friend struct ActorCallback< _executeActor, 8, Void >; +friend struct ActorCallback< _executeActor, 9, bool >; +friend struct ActorCallback< _executeActor, 10, Void >; +friend struct ActorCallback< _executeActor, 11, Void >; +friend struct ActorCallback< _executeActor, 12, Reference >; +friend struct ActorCallback< _executeActor, 13, Void >; +friend struct ActorCallback< _executeActor, 14, Void >; + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + _executeActor(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) + #line 16321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + _executeActorState<_executeActor>(cx, taskBucket, futureBucket, task) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("_execute"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< _executeActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< _executeActor, 1, Standalone> >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< _executeActor, 2, DatabaseConfiguration >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< _executeActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< _executeActor, 4, Reference >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorSingleCallback< _executeActor, 5, RangeResultWithVersion >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< _executeActor, 6, Void >*)0, actor_cancelled()); break; + case 8: this->a_callback_error((ActorCallback< _executeActor, 7, Void >*)0, actor_cancelled()); break; + case 9: this->a_callback_error((ActorCallback< _executeActor, 8, Void >*)0, actor_cancelled()); break; + case 10: this->a_callback_error((ActorCallback< _executeActor, 9, bool >*)0, actor_cancelled()); break; + case 11: this->a_callback_error((ActorCallback< _executeActor, 10, Void >*)0, actor_cancelled()); break; + case 12: this->a_callback_error((ActorCallback< _executeActor, 11, Void >*)0, actor_cancelled()); break; + case 13: this->a_callback_error((ActorCallback< _executeActor, 12, Reference >*)0, actor_cancelled()); break; + case 14: this->a_callback_error((ActorCallback< _executeActor, 13, Void >*)0, actor_cancelled()); break; + case 15: this->a_callback_error((ActorCallback< _executeActor, 14, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new _executeActor(cx, taskBucket, futureBucket, task)); + #line 16362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + #line 16367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via startBackupRangeInternal() + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class StartBackupRangeInternalActorState { + #line 16373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StartBackupRangeInternalActorState(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task,Reference const& onDone) + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : tr(tr), + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + taskBucket(taskBucket), + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + futureBucket(futureBucket), + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + task(task), + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + onDone(onDone) + #line 16388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("startBackupRangeInternal", reinterpret_cast(this)); + + } + ~StartBackupRangeInternalActorState() + { + fdb_probe_actor_destroy("startBackupRangeInternal", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 2024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 2025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + nextKey = Params.beginKey().get(task); + #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + endKey = Params.endKey().get(task); + #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture>> __when_expr_0 = getBlockOfShards(tr, nextKey, endKey, CLIENT_KNOBS->BACKUP_SHARD_TASK_LIMIT); + #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 16413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 16418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~StartBackupRangeInternalActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::vector> addTaskVector; + #line 2032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for(int idx = 0;idx < keys.size();++idx) { + #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (nextKey != keys[idx]) + #line 16445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + addTaskVector.push_back(addTask(tr, taskBucket, task, task->getPriority(), nextKey, keys[idx], TaskCompletionKey::joinWith(onDone))); + #line 2041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("FileBackupRangeSplit") .suppressFor(60) .detail("BackupUID", BackupConfig(task).getUid()) .detail("BeginKey", Params.beginKey().get(task).printable()) .detail("EndKey", Params.endKey().get(task).printable()) .detail("SliceBeginKey", nextKey.printable()) .detail("SliceEndKey", keys[idx].printable()); + #line 16451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 2049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + nextKey = keys[idx]; + #line 16455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = waitForAll(addTaskVector); + #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 16461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 16466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Standalone> const& __keys,int loopDepth) + { + #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + keys = __keys; + #line 16475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Standalone> && __keys,int loopDepth) + { + keys = std::move(__keys); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< StartBackupRangeInternalActor, 0, Standalone> >::remove(); + + } + void a_callback_fire(ActorCallback< StartBackupRangeInternalActor, 0, Standalone> >*,Standalone> const& value) + { + fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< StartBackupRangeInternalActor, 0, Standalone> >*,Standalone> && value) + { + fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< StartBackupRangeInternalActor, 0, Standalone> >*,Error err) + { + fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 2054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (nextKey != endKey) + #line 16542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 2056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = success(addTask(tr, taskBucket, task, task->getPriority(), nextKey, endKey, TaskCompletionKey::joinWith(onDone), Reference(), task->getPriority())); + #line 2056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 16548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 2056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 16553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont5(loopDepth); + } + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 2054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (nextKey != endKey) + #line 16567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 2056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = success(addTask(tr, taskBucket, task, task->getPriority(), nextKey, endKey, TaskCompletionKey::joinWith(onDone), Reference(), task->getPriority())); + #line 2056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 16573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 2056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 16578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont5(loopDepth); + } + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< StartBackupRangeInternalActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< StartBackupRangeInternalActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< StartBackupRangeInternalActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< StartBackupRangeInternalActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 1); + + } + int a_body1cont5(int loopDepth) + { + #line 2067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~StartBackupRangeInternalActorState(); static_cast(this)->destroy(); return 0; } + #line 16655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~StartBackupRangeInternalActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont6(Void const& _,int loopDepth) + { + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont6(Void && _,int loopDepth) + { + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont6(_, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont6(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< StartBackupRangeInternalActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< StartBackupRangeInternalActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< StartBackupRangeInternalActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< StartBackupRangeInternalActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), 2); + + } + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference taskBucket; + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference futureBucket; + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference task; + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference onDone; + #line 2025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key nextKey; + #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key endKey; + #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Standalone> keys; + #line 16754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via startBackupRangeInternal() + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class StartBackupRangeInternalActor final : public Actor, public ActorCallback< StartBackupRangeInternalActor, 0, Standalone> >, public ActorCallback< StartBackupRangeInternalActor, 1, Void >, public ActorCallback< StartBackupRangeInternalActor, 2, Void >, public FastAllocated, public StartBackupRangeInternalActorState { + #line 16759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< StartBackupRangeInternalActor, 0, Standalone> >; +friend struct ActorCallback< StartBackupRangeInternalActor, 1, Void >; +friend struct ActorCallback< StartBackupRangeInternalActor, 2, Void >; + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StartBackupRangeInternalActor(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task,Reference const& onDone) + #line 16772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + StartBackupRangeInternalActorState(tr, taskBucket, futureBucket, task, onDone) + { + fdb_probe_actor_enter("startBackupRangeInternal", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("startBackupRangeInternal"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("startBackupRangeInternal", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< StartBackupRangeInternalActor, 0, Standalone> >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< StartBackupRangeInternalActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< StartBackupRangeInternalActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future startBackupRangeInternal( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task, Reference const& onDone ) { + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new StartBackupRangeInternalActor(tr, taskBucket, futureBucket, task, onDone)); + #line 16801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 2069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + #line 16806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via _finish() + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _finishActor2State { + #line 16812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + _finishActor2State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : tr(tr), + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + taskBucket(taskBucket), + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + futureBucket(futureBucket), + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + task(task), + #line 2074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + taskFuture(futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone])) + #line 16827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("_finish", reinterpret_cast(this)); + + } + ~_finishActor2State() + { + fdb_probe_actor_destroy("_finish", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 2075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (Params.addBackupRangeTasks().get(task)) + #line 16842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = startBackupRangeInternal(tr, taskBucket, futureBucket, task, taskFuture); + #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_finishActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 16848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast<_finishActor2*>(this)->actor_wait_state = 1; + #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor2*>(this))); + #line 16853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 2078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = taskFuture->set(tr, taskBucket); + #line 2078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_finishActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 16862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; + static_cast<_finishActor2*>(this)->actor_wait_state = 2; + #line 2078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor2*>(this))); + #line 16867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~_finishActor2State(); + static_cast<_finishActor2*>(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 2081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = taskBucket->finish(tr, task); + #line 2081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_finishActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 16893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast<_finishActor2*>(this)->actor_wait_state = 3; + #line 2081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor2*>(this))); + #line 16898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast<_finishActor2*>(this)->actor_wait_state > 0) static_cast<_finishActor2*>(this)->actor_wait_state = 0; + static_cast<_finishActor2*>(this)->ActorCallback< _finishActor2, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _finishActor2, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _finishActor2, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< _finishActor2, 0, Void >*,Error err) + { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); + + } + int a_body1cont3(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1when2(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast<_finishActor2*>(this)->actor_wait_state > 0) static_cast<_finishActor2*>(this)->actor_wait_state = 0; + static_cast<_finishActor2*>(this)->ActorCallback< _finishActor2, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _finishActor2, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< _finishActor2, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< _finishActor2, 1, Void >*,Error err) + { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); + + } + int a_body1cont4(Void const& _,int loopDepth) + { + #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("FileBackupRangeFinish") .suppressFor(60) .detail("BackupUID", BackupConfig(task).getUid()) .detail("BeginKey", Params.beginKey().get(task).printable()) .detail("EndKey", Params.endKey().get(task).printable()) .detail("TaskKey", task->key.printable()); + #line 2090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_finishActor2*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor2State(); static_cast<_finishActor2*>(this)->destroy(); return 0; } + #line 17059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_finishActor2*>(this)->SAV< Void >::value()) Void(Void()); + this->~_finishActor2State(); + static_cast<_finishActor2*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont4(Void && _,int loopDepth) + { + #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("FileBackupRangeFinish") .suppressFor(60) .detail("BackupUID", BackupConfig(task).getUid()) .detail("BeginKey", Params.beginKey().get(task).printable()) .detail("EndKey", Params.endKey().get(task).printable()) .detail("TaskKey", task->key.printable()); + #line 2090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_finishActor2*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor2State(); static_cast<_finishActor2*>(this)->destroy(); return 0; } + #line 17073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_finishActor2*>(this)->SAV< Void >::value()) Void(Void()); + this->~_finishActor2State(); + static_cast<_finishActor2*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast<_finishActor2*>(this)->actor_wait_state > 0) static_cast<_finishActor2*>(this)->actor_wait_state = 0; + static_cast<_finishActor2*>(this)->ActorCallback< _finishActor2, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _finishActor2, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< _finishActor2, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< _finishActor2, 2, Void >*,Error err) + { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); + + } + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference taskBucket; + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference futureBucket; + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference task; + #line 2074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference taskFuture; + #line 17154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via _finish() + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _finishActor2 final : public Actor, public ActorCallback< _finishActor2, 0, Void >, public ActorCallback< _finishActor2, 1, Void >, public ActorCallback< _finishActor2, 2, Void >, public FastAllocated<_finishActor2>, public _finishActor2State<_finishActor2> { + #line 17159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated<_finishActor2>::operator new; + using FastAllocated<_finishActor2>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< _finishActor2, 0, Void >; +friend struct ActorCallback< _finishActor2, 1, Void >; +friend struct ActorCallback< _finishActor2, 2, Void >; + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + _finishActor2(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) + #line 17172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + _finishActor2State<_finishActor2>(tr, taskBucket, futureBucket, task) + { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("_finish"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("_finish", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< _finishActor2, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< _finishActor2, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< _finishActor2, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new _finishActor2(tr, taskBucket, futureBucket, task)); + #line 17201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 2092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +}; +StringRef BackupRangeTaskFunc::name = "file_backup_write_range_5.2"_sr; +REGISTER_TASKFUNC(BackupRangeTaskFunc); + +struct BackupSnapshotDispatchTask : BackupTaskFuncBase { + static StringRef name; + static constexpr uint32_t version = 1; + + static struct { + // Set by Execute, used by Finish + static TaskParam shardsBehind() { return __FUNCTION__sr; } + // Set by Execute, used by Finish + static TaskParam snapshotFinished() { return __FUNCTION__sr; } + // Set by Execute, used by Finish + static TaskParam nextDispatchVersion() { return __FUNCTION__sr; } + } Params; + + StringRef getName() const override { return name; }; + + Future execute(Database cx, + Reference tb, + Reference fb, + Reference task) override { + return _execute(cx, tb, fb, task); + }; + Future finish(Reference tr, + Reference tb, + Reference fb, + Reference task) override { + return _finish(tr, tb, fb, task); + }; + + #line 17237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via addTask() + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class AddTaskActor1State { + #line 17243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + AddTaskActor1State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,int const& priority,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference(),Version const& scheduledVersion = invalidVersion) + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : tr(tr), + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + taskBucket(taskBucket), + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + parentTask(parentTask), + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + priority(priority), + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + completionKey(completionKey), + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + waitFor(waitFor), + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + scheduledVersion(scheduledVersion) + #line 17262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("addTask", reinterpret_cast(this)); + + } + ~AddTaskActor1State() + { + fdb_probe_actor_destroy("addTask", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 2131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = addBackupTask( name, version, tr, taskBucket, completionKey, BackupConfig(parentTask), waitFor, [=](Reference task) { if (scheduledVersion != invalidVersion) ReservedTaskParams::scheduledVersion().set(task, scheduledVersion); }, priority); + #line 2131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 17279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 2131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 17284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~AddTaskActor1State(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Key const& key,int loopDepth) + { + #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor1State(); static_cast(this)->destroy(); return 0; } + #line 17307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key(key); + this->~AddTaskActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Key && key,int loopDepth) + { + #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor1State(); static_cast(this)->destroy(); return 0; } + #line 17319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key(key); + this->~AddTaskActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Key const& key,int loopDepth) + { + loopDepth = a_body1cont1(key, loopDepth); + + return loopDepth; + } + int a_body1when1(Key && key,int loopDepth) + { + loopDepth = a_body1cont1(std::move(key), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AddTaskActor1, 0, Key >::remove(); + + } + void a_callback_fire(ActorCallback< AddTaskActor1, 0, Key >*,Key const& value) + { + fdb_probe_actor_enter("addTask", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< AddTaskActor1, 0, Key >*,Key && value) + { + fdb_probe_actor_enter("addTask", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< AddTaskActor1, 0, Key >*,Error err) + { + fdb_probe_actor_enter("addTask", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); + + } + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference taskBucket; + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference parentTask; + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int priority; + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TaskCompletionKey completionKey; + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference waitFor; + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version scheduledVersion; + #line 17404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via addTask() + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class AddTaskActor1 final : public Actor, public ActorCallback< AddTaskActor1, 0, Key >, public FastAllocated, public AddTaskActor1State { + #line 17409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< AddTaskActor1, 0, Key >; + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + AddTaskActor1(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,int const& priority,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference(),Version const& scheduledVersion = invalidVersion) + #line 17420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + AddTaskActor1State(tr, taskBucket, parentTask, priority, completionKey, waitFor, scheduledVersion) + { + fdb_probe_actor_enter("addTask", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("addTask"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("addTask", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< AddTaskActor1, 0, Key >*)0, actor_cancelled()); break; + } + + } +}; + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, int const& priority, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference(), Version const& scheduledVersion = invalidVersion ) { + #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new AddTaskActor1(tr, taskBucket, parentTask, priority, completionKey, waitFor, scheduledVersion)); + #line 17447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 2146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + enum DispatchState { SKIP = 0, DONE = 1, NOT_DONE_MIN = 2 }; + + #line 17454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via _execute() + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _executeActor1State { + #line 17460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + _executeActor1State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : cx(cx), + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + taskBucket(taskBucket), + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + futureBucket(futureBucket), + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + task(task), + #line 2153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + lock(new FlowLock(CLIENT_KNOBS->BACKUP_LOCK_BYTES)) + #line 17475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("_execute", reinterpret_cast(this)); + + } + ~_executeActor1State() + { + fdb_probe_actor_destroy("_execute", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = checkTaskVersion(cx, task, name, version); + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 17492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast<_executeActor1*>(this)->actor_wait_state = 1; + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); + #line 17497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~_executeActor1State(); + static_cast<_executeActor1*>(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 2156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + startTime = timer(); + #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr = Reference(new ReadYourWritesTransaction(cx)); + #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + notDoneSequence = NOT_DONE_MIN; + #line 2163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + shardMap = KeyRangeMap(notDoneSequence++); + #line 2164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginKey = allKeys.begin; + #line 2167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 17530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 2156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + startTime = timer(); + #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr = Reference(new ReadYourWritesTransaction(cx)); + #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + notDoneSequence = NOT_DONE_MIN; + #line 2163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + shardMap = KeyRangeMap(notDoneSequence++); + #line 2164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginKey = allKeys.begin; + #line 2167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 17549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast<_executeActor1*>(this)->actor_wait_state > 0) static_cast<_executeActor1*>(this)->actor_wait_state = 0; + static_cast<_executeActor1*>(this)->ActorCallback< _executeActor1, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor1, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _executeActor1, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< _executeActor1, 0, Void >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config = BackupConfig(task); + #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + recentReadVersion = Version(); + #line 2193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotBeginVersion = Version(); + #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotTargetEndVersion = Version(); + #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotIntervalSeconds = int64_t(); + #line 2196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + latestSnapshotEndVersion = Optional(); + #line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backupRanges = std::vector(); + #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotBatchFutureKey = Optional(); + #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotBatchFuture = Reference(); + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotBatchSize = Optional(); + #line 2202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->reset(); + #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 17643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont2loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1(int loopDepth) + { + try { + #line 2169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 2170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + shardBoundaries = getBlockOfShards(tr, beginKey, allKeys.end, CLIENT_KNOBS->TOO_MANY); + #line 2174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = success(shardBoundaries) && taskBucket->keepRunning(tr, task); + #line 2174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 17668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast<_executeActor1*>(this)->actor_wait_state = 2; + #line 2174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); + #line 17673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1break1(int loopDepth) + { + try { + return a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = tr->onError(e); + #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 17710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast<_executeActor1*>(this)->actor_wait_state = 3; + #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); + #line 17715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont1loopBody1cont2(Void const& _,int loopDepth) + { + #line 2176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (shardBoundaries.get().size() == 0) + #line 17730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 2179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto& boundary : shardBoundaries.get() ) { + #line 2180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + shardMap.rawInsert(boundary, notDoneSequence++); + #line 17738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginKey = keyAfter(shardBoundaries.get().back()); + #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->reset(); + #line 17744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont2(Void && _,int loopDepth) + { + #line 2176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (shardBoundaries.get().size() == 0) + #line 17753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 2179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto& boundary : shardBoundaries.get() ) { + #line 2180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + shardMap.rawInsert(boundary, notDoneSequence++); + #line 17761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginKey = keyAfter(shardBoundaries.get().back()); + #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->reset(); + #line 17767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast<_executeActor1*>(this)->actor_wait_state > 0) static_cast<_executeActor1*>(this)->actor_wait_state = 0; + static_cast<_executeActor1*>(this)->ActorCallback< _executeActor1, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor1, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< _executeActor1, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< _executeActor1, 1, Void >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); + + } + int a_body1cont1loopBody1cont6(int loopDepth) + { + try { + loopDepth = a_body1cont1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast<_executeActor1*>(this)->actor_wait_state > 0) static_cast<_executeActor1*>(this)->actor_wait_state = 0; + static_cast<_executeActor1*>(this)->ActorCallback< _executeActor1, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor1, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< _executeActor1, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< _executeActor1, 2, Void >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); + + } + int a_body1cont3(int loopDepth) + { + #line 2256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + dispatchBoundaries = std::vector>(); + #line 2257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->reset(); + #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginKey = allKeys.begin; + #line 2259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 17933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont3loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont2loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont2loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1(int loopDepth) + { + try { + #line 2205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = store(snapshotBeginVersion, config.snapshotBeginVersion().getOrThrow(tr)) && store(snapshotTargetEndVersion, config.snapshotTargetEndVersion().getOrThrow(tr)) && store(backupRanges, config.backupRanges().getOrThrow(tr)) && store(snapshotIntervalSeconds, config.snapshotIntervalSeconds().getOrThrow(tr)) && store(snapshotBatchFutureKey, config.snapshotBatchFuture().get(tr)) && store(snapshotBatchSize, config.snapshotBatchSize().get(tr)) && store(latestSnapshotEndVersion, config.latestSnapshotEndVersion().get(tr)) && store(recentReadVersion, tr->getReadVersion()) && taskBucket->keepRunning(tr, task); + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 17956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont2loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont2loopBody1when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 4; - #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 11724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 17961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11754,16 +17991,16 @@ class _executeActor1State { int a_body1cont2loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_6 = tr->onError(e); - #line 1563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 11761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 17998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1Catch1when1(__when_expr_6.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 7; - #line 1563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 11766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11776,43 +18013,43 @@ class _executeActor1State { } int a_body1cont2loopBody1cont2(Void const& _,int loopDepth) { - #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!snapshotBatchFutureKey.present()) - #line 11781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotBatchFuture = futureBucket->future(tr); - #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotBatchFuture().set(tr, snapshotBatchFuture->pack()); - #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotBatchSize = 0; - #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotBatchSize().set(tr, snapshotBatchSize.get()); - #line 1545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" dispatchCompletionKey = TaskCompletionKey::joinWith(snapshotBatchFuture); - #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" auto cfg = &config; - #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" auto tx = &tr; - #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = map(dispatchCompletionKey.get(tr, taskBucket), [cfg, tx](Key const& k) { cfg->snapshotBatchDispatchDoneKey().set(*tx, k); return Void(); }); - #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont2loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 5; - #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 11806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 1556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(snapshotBatchSize.present()); - #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotBatchFuture = makeReference(futureBucket, snapshotBatchFutureKey.get()); - #line 11815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopBody1cont3(loopDepth); } @@ -11820,43 +18057,43 @@ class _executeActor1State { } int a_body1cont2loopBody1cont2(Void && _,int loopDepth) { - #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!snapshotBatchFutureKey.present()) - #line 11825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotBatchFuture = futureBucket->future(tr); - #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotBatchFuture().set(tr, snapshotBatchFuture->pack()); - #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotBatchSize = 0; - #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotBatchSize().set(tr, snapshotBatchSize.get()); - #line 1545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" dispatchCompletionKey = TaskCompletionKey::joinWith(snapshotBatchFuture); - #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" auto cfg = &config; - #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" auto tx = &tr; - #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = map(dispatchCompletionKey.get(tr, taskBucket), [cfg, tx](Key const& k) { cfg->snapshotBatchDispatchDoneKey().set(*tx, k); return Void(); }); - #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont2loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 5; - #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 11850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 1556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(snapshotBatchSize.present()); - #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotBatchFuture = makeReference(futureBucket, snapshotBatchFutureKey.get()); - #line 11859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopBody1cont3(loopDepth); } @@ -11933,32 +18170,32 @@ class _executeActor1State { } int a_body1cont2loopBody1cont4(Void const& _,int loopDepth) { - #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = tr->commit(); - #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont2loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2loopBody1cont4when1(__when_expr_5.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 6; - #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 11945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2loopBody1cont4(Void && _,int loopDepth) { - #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = tr->commit(); - #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont2loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2loopBody1cont4when1(__when_expr_5.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 6; - #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 11961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -12178,23 +18415,23 @@ class _executeActor1State { } int a_body1cont4(int loopDepth) { - #line 1598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" i = int(); - #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" iShard = RangeMap::iterator(); - #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" iShardEnd = RangeMap::iterator(); - #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (dispatchBoundaries.size() > 0) - #line 12189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" lastValue = false; - #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" lastKey = Key(); - #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" i = 0; - #line 12197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont4loopHead1(loopDepth); } else @@ -12214,22 +18451,22 @@ class _executeActor1State { int a_body1cont3loopBody1(int loopDepth) { try { - #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bounds = config.snapshotRangeDispatchMap().getRange( tr, beginKey, keyAfter(normalKeys.end), CLIENT_KNOBS->TOO_MANY); - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bounds = config.snapshotRangeDispatchMap().getRange( tr, beginKey, keyAfter(allKeys.end), CLIENT_KNOBS->TOO_MANY); + #line 2267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_7 = success(bounds) && taskBucket->keepRunning(tr, task) && store(recentReadVersion, tr->getReadVersion()); - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 12227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont3loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont3loopBody1when1(__when_expr_7.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 8; - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 12232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -12262,16 +18499,16 @@ class _executeActor1State { int a_body1cont3loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_8 = tr->onError(e); - #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 12269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1Catch1when1(__when_expr_8.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 9; - #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 12274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -12284,43 +18521,55 @@ class _executeActor1State { } int a_body1cont3loopBody1cont2(Void const& _,int loopDepth) { - #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (bounds.get().empty()) - #line 12289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 2270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!bounds.get().results.empty()) + #line 18526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 2271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + dispatchBoundaries.reserve(dispatchBoundaries.size() + bounds.get().results.size()); + #line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + dispatchBoundaries.insert( dispatchBoundaries.end(), bounds.get().results.begin(), bounds.get().results.end()); + #line 18532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 2276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!bounds.get().more) + #line 18536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1cont3break1(loopDepth==0?0:loopDepth-1); // break } - #line 1584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - dispatchBoundaries.reserve(dispatchBoundaries.size() + bounds.get().size()); - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - dispatchBoundaries.insert(dispatchBoundaries.end(), bounds.get().begin(), bounds.get().end()); - #line 1587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - beginKey = keyAfter(bounds.get().back().first); - #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginKey = keyAfter(bounds.get().results.back().first); + #line 2280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 12301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont3loopBody1cont5(loopDepth); + #line 18544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont3loopBody1cont6(loopDepth); return loopDepth; } int a_body1cont3loopBody1cont2(Void && _,int loopDepth) { - #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (bounds.get().empty()) - #line 12310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 2270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!bounds.get().results.empty()) + #line 18553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 2271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + dispatchBoundaries.reserve(dispatchBoundaries.size() + bounds.get().results.size()); + #line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + dispatchBoundaries.insert( dispatchBoundaries.end(), bounds.get().results.begin(), bounds.get().results.end()); + #line 18559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 2276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!bounds.get().more) + #line 18563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1cont3break1(loopDepth==0?0:loopDepth-1); // break } - #line 1584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - dispatchBoundaries.reserve(dispatchBoundaries.size() + bounds.get().size()); - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - dispatchBoundaries.insert(dispatchBoundaries.end(), bounds.get().begin(), bounds.get().end()); - #line 1587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - beginKey = keyAfter(bounds.get().back().first); - #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginKey = keyAfter(bounds.get().results.back().first); + #line 2280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 12322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont3loopBody1cont5(loopDepth); + #line 18571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont3loopBody1cont6(loopDepth); return loopDepth; } @@ -12387,7 +18636,7 @@ class _executeActor1State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 7); } - int a_body1cont3loopBody1cont5(int loopDepth) + int a_body1cont3loopBody1cont6(int loopDepth) { try { loopDepth = a_body1cont3loopBody1cont1(loopDepth); @@ -12477,22 +18726,22 @@ class _executeActor1State { } int a_body1cont5(int loopDepth) { - #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (backupRanges.size() > 0) - #line 12482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - shardMap.insert(KeyRangeRef(normalKeys.begin, backupRanges.front().begin), SKIP); - #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + shardMap.insert(KeyRangeRef(allKeys.begin, backupRanges.front().begin), SKIP); + #line 2330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_11 = yield(); - #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1Catch1(__when_expr_11.getError(), loopDepth); else return a_body1cont5when1(__when_expr_11.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 12; - #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_11.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 12495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -12504,9 +18753,9 @@ class _executeActor1State { } int a_body1cont6(int loopDepth) { - #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(lastValue == false); - #line 12509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont5(loopDepth); return loopDepth; @@ -12520,29 +18769,29 @@ class _executeActor1State { } int a_body1cont4loopBody1(int loopDepth) { - #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!(i < dispatchBoundaries.size())) - #line 12525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1cont4break1(loopDepth==0?0:loopDepth-1); // break } - #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" const std::pair& boundary = dispatchBoundaries[i]; - #line 1611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(boundary.second == !lastValue); - #line 1614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!boundary.second) - #line 12535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RangeMap::Ranges shardRanges = shardMap.modify(KeyRangeRef(lastKey, boundary.first)); - #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" iShard = shardRanges.begin(); - #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" iShardEnd = shardRanges.end(); - #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 12545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont4loopBody1loopHead1(loopDepth); } else @@ -12567,20 +18816,20 @@ class _executeActor1State { } int a_body1cont4loopBody1cont1(int loopDepth) { - #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" lastValue = dispatchBoundaries[i].second; - #line 1627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" lastKey = dispatchBoundaries[i].first; - #line 1629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_10 = yield(); - #line 1629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 12578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1Catch1(__when_expr_10.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1cont1when1(__when_expr_10.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 11; - #line 1629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 12583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -12600,24 +18849,24 @@ class _executeActor1State { } int a_body1cont4loopBody1loopBody1(int loopDepth) { - #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!(iShard != iShardEnd)) - #line 12605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1cont4loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" iShard->value() = DONE; - #line 1623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_9 = yield(); - #line 1623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 12615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), std::max(0, loopDepth - 2)); else return a_body1cont4loopBody1loopBody1when1(__when_expr_9.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 10; - #line 1623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 12620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -12637,18 +18886,18 @@ class _executeActor1State { } int a_body1cont4loopBody1loopBody1cont1(Void const& _,int loopDepth) { - #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++iShard; - #line 12642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont4loopBody1loopHead1(0); return loopDepth; } int a_body1cont4loopBody1loopBody1cont1(Void && _,int loopDepth) { - #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++iShard; - #line 12651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont4loopBody1loopHead1(0); return loopDepth; @@ -12718,18 +18967,18 @@ class _executeActor1State { } int a_body1cont4loopBody1cont4(Void const& _,int loopDepth) { - #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++i; - #line 12723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont4loopHead1(0); return loopDepth; } int a_body1cont4loopBody1cont4(Void && _,int loopDepth) { - #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++i; - #line 12732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 18981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont4loopHead1(0); return loopDepth; @@ -12799,37 +19048,37 @@ class _executeActor1State { } int a_body1cont8(int loopDepth) { - #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" countShardsDone = 0; - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" countShardsNotDone = 0; - #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RangeMap::Ranges shardRanges = shardMap.ranges(); - #line 1654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" iShard = shardRanges.begin(); - #line 1655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" iShardEnd = shardRanges.end(); - #line 1656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 12814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont8loopHead1(loopDepth); return loopDepth; } int a_body1cont9(Void const& _,int loopDepth) { - #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" i = 0; - #line 12823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont9loopHead1(loopDepth); return loopDepth; } int a_body1cont9(Void && _,int loopDepth) { - #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" i = 0; - #line 12832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont9loopHead1(loopDepth); return loopDepth; @@ -12899,18 +19148,18 @@ class _executeActor1State { } int a_body1cont10(int loopDepth) { - #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - shardMap.insert(KeyRangeRef(backupRanges.back().end, normalKeys.end), SKIP); - #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + shardMap.insert(KeyRangeRef(backupRanges.back().end, allKeys.end), SKIP); + #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_13 = yield(); - #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_13.isReady()) { if (__when_expr_13.isError()) return a_body1Catch1(__when_expr_13.getError(), loopDepth); else return a_body1cont10when1(__when_expr_13.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 14; - #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_13.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 12913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -12924,24 +19173,24 @@ class _executeActor1State { } int a_body1cont9loopBody1(int loopDepth) { - #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!(i < backupRanges.size() - 1)) - #line 12929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1cont9break1(loopDepth==0?0:loopDepth-1); // break } - #line 1641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" shardMap.insert(KeyRangeRef(backupRanges[i].end, backupRanges[i + 1].begin), SKIP); - #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_12 = yield(); - #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 12939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_12.isReady()) { if (__when_expr_12.isError()) return a_body1Catch1(__when_expr_12.getError(), std::max(0, loopDepth - 1)); else return a_body1cont9loopBody1when1(__when_expr_12.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 13; - #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_12.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 12944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -12961,18 +19210,18 @@ class _executeActor1State { } int a_body1cont9loopBody1cont1(Void const& _,int loopDepth) { - #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++i; - #line 12966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont9loopHead1(0); return loopDepth; } int a_body1cont9loopBody1cont1(Void && _,int loopDepth) { - #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++i; - #line 12975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont9loopHead1(0); return loopDepth; @@ -13117,18 +19366,18 @@ class _executeActor1State { } int a_body1cont11(int loopDepth) { - #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - shardMap.coalesce(normalKeys); - #line 1667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + shardMap.coalesce(allKeys); + #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_15 = yield(); - #line 1667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_15.isReady()) { if (__when_expr_15.isError()) return a_body1Catch1(__when_expr_15.getError(), loopDepth); else return a_body1cont11when1(__when_expr_15.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 16; - #line 1667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_15.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 13131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -13142,41 +19391,41 @@ class _executeActor1State { } int a_body1cont8loopBody1(int loopDepth) { - #line 1656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!(iShard != iShardEnd)) - #line 13147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1cont8break1(loopDepth==0?0:loopDepth-1); // break } - #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (iShard->value() == DONE) - #line 13153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++countShardsDone; - #line 13157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 1659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (iShard->value() >= NOT_DONE_MIN) - #line 13163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++countShardsNotDone; - #line 13167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } } - #line 1662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_14 = yield(); - #line 1662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 13174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_14.isReady()) { if (__when_expr_14.isError()) return a_body1Catch1(__when_expr_14.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody1when1(__when_expr_14.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 15; - #line 1662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_14.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 13179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -13196,18 +19445,18 @@ class _executeActor1State { } int a_body1cont8loopBody1cont1(Void const& _,int loopDepth) { - #line 1656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++iShard; - #line 13201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont8loopHead1(0); return loopDepth; } int a_body1cont8loopBody1cont1(Void && _,int loopDepth) { - #line 1656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++iShard; - #line 13210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont8loopHead1(0); return loopDepth; @@ -13277,198 +19526,198 @@ class _executeActor1State { } int a_body1cont11cont1(Void const& _,int loopDepth) { - #line 1670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" countAllShards = countShardsDone + countShardsNotDone; - #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (countShardsNotDone == 0) - #line 13284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupSnapshotDispatchFinished") .detail("BackupUID", config.getUid()) .detail("AllShards", countAllShards) .detail("ShardsDone", countShardsDone) .detail("ShardsNotDone", countShardsNotDone) .detail("SnapshotBeginVersion", snapshotBeginVersion) .detail("SnapshotTargetEndVersion", snapshotTargetEndVersion) .detail("CurrentVersion", recentReadVersion) .detail("SnapshotIntervalSeconds", snapshotIntervalSeconds); - #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.snapshotFinished().set(task, true); - #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor1*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor1State(); static_cast<_executeActor1*>(this)->destroy(); return 0; } - #line 13292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor1*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor1State(); static_cast<_executeActor1*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nextDispatchVersion = Version(); - #line 1691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (g_network->isSimulated()) - #line 13302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nextDispatchVersion = recentReadVersion + CLIENT_KNOBS->CORE_VERSIONSPERSECOND * (snapshotIntervalSeconds / 5.0); - #line 13306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 1695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nextDispatchVersion = recentReadVersion + CLIENT_KNOBS->CORE_VERSIONSPERSECOND * CLIENT_KNOBS->BACKUP_SNAPSHOT_DISPATCH_INTERVAL_SEC; - #line 13312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (nextDispatchVersion > snapshotTargetEndVersion) - #line 13316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nextDispatchVersion = std::max(recentReadVersion, snapshotTargetEndVersion); - #line 13320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.nextDispatchVersion().set(task, nextDispatchVersion); - #line 1709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" double timeElapsed; - #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version snapshotScheduledVersionInterval = snapshotTargetEndVersion - snapshotBeginVersion; - #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (snapshotTargetEndVersion > snapshotBeginVersion) - #line 13330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" timeElapsed = std::min( 1.0, (double)(nextDispatchVersion - snapshotBeginVersion) / (snapshotScheduledVersionInterval)); - #line 13334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" timeElapsed = 1.0; - #line 13340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" countExpectedShardsDone = countAllShards * timeElapsed; - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" countShardsToDispatch = std::max(0, countExpectedShardsDone - countShardsDone); - #line 1723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t dispatchWindow = nextDispatchVersion - recentReadVersion; - #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int countShardsExpectedPerNormalWindow; - #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (snapshotScheduledVersionInterval == 0) - #line 13352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" countShardsExpectedPerNormalWindow = 0; - #line 13356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 1733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" countShardsExpectedPerNormalWindow = (double(dispatchWindow) / snapshotScheduledVersionInterval) * countAllShards; - #line 13362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int countShardsBehind = std::max(0, countShardsToDispatch + snapshotBatchSize.get() - countShardsExpectedPerNormalWindow); - #line 1741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.shardsBehind().set(task, countShardsBehind); - #line 1743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupSnapshotDispatchStats") .detail("BackupUID", config.getUid()) .detail("AllShards", countAllShards) .detail("ShardsDone", countShardsDone) .detail("ShardsNotDone", countShardsNotDone) .detail("ExpectedShardsDone", countExpectedShardsDone) .detail("ShardsToDispatch", countShardsToDispatch) .detail("ShardsBehind", countShardsBehind) .detail("SnapshotBeginVersion", snapshotBeginVersion) .detail("SnapshotTargetEndVersion", snapshotTargetEndVersion) .detail("NextDispatchVersion", nextDispatchVersion) .detail("CurrentVersion", recentReadVersion) .detail("TimeElapsed", timeElapsed) .detail("SnapshotIntervalSeconds", snapshotIntervalSeconds); - #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 13372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont11cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont11cont1(Void && _,int loopDepth) { - #line 1670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" countAllShards = countShardsDone + countShardsNotDone; - #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (countShardsNotDone == 0) - #line 13383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupSnapshotDispatchFinished") .detail("BackupUID", config.getUid()) .detail("AllShards", countAllShards) .detail("ShardsDone", countShardsDone) .detail("ShardsNotDone", countShardsNotDone) .detail("SnapshotBeginVersion", snapshotBeginVersion) .detail("SnapshotTargetEndVersion", snapshotTargetEndVersion) .detail("CurrentVersion", recentReadVersion) .detail("SnapshotIntervalSeconds", snapshotIntervalSeconds); - #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.snapshotFinished().set(task, true); - #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor1*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor1State(); static_cast<_executeActor1*>(this)->destroy(); return 0; } - #line 13391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor1*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor1State(); static_cast<_executeActor1*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nextDispatchVersion = Version(); - #line 1691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (g_network->isSimulated()) - #line 13401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nextDispatchVersion = recentReadVersion + CLIENT_KNOBS->CORE_VERSIONSPERSECOND * (snapshotIntervalSeconds / 5.0); - #line 13405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 1695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nextDispatchVersion = recentReadVersion + CLIENT_KNOBS->CORE_VERSIONSPERSECOND * CLIENT_KNOBS->BACKUP_SNAPSHOT_DISPATCH_INTERVAL_SEC; - #line 13411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (nextDispatchVersion > snapshotTargetEndVersion) - #line 13415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nextDispatchVersion = std::max(recentReadVersion, snapshotTargetEndVersion); - #line 13419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.nextDispatchVersion().set(task, nextDispatchVersion); - #line 1709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" double timeElapsed; - #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version snapshotScheduledVersionInterval = snapshotTargetEndVersion - snapshotBeginVersion; - #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (snapshotTargetEndVersion > snapshotBeginVersion) - #line 13429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" timeElapsed = std::min( 1.0, (double)(nextDispatchVersion - snapshotBeginVersion) / (snapshotScheduledVersionInterval)); - #line 13433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" timeElapsed = 1.0; - #line 13439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" countExpectedShardsDone = countAllShards * timeElapsed; - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" countShardsToDispatch = std::max(0, countExpectedShardsDone - countShardsDone); - #line 1723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t dispatchWindow = nextDispatchVersion - recentReadVersion; - #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int countShardsExpectedPerNormalWindow; - #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (snapshotScheduledVersionInterval == 0) - #line 13451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" countShardsExpectedPerNormalWindow = 0; - #line 13455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 1733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" countShardsExpectedPerNormalWindow = (double(dispatchWindow) / snapshotScheduledVersionInterval) * countAllShards; - #line 13461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int countShardsBehind = std::max(0, countShardsToDispatch + snapshotBatchSize.get() - countShardsExpectedPerNormalWindow); - #line 1741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.shardsBehind().set(task, countShardsBehind); - #line 1743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupSnapshotDispatchStats") .detail("BackupUID", config.getUid()) .detail("AllShards", countAllShards) .detail("ShardsDone", countShardsDone) .detail("ShardsNotDone", countShardsNotDone) .detail("ExpectedShardsDone", countExpectedShardsDone) .detail("ShardsToDispatch", countShardsToDispatch) .detail("ShardsBehind", countShardsBehind) .detail("SnapshotBeginVersion", snapshotBeginVersion) .detail("SnapshotTargetEndVersion", snapshotTargetEndVersion) .detail("NextDispatchVersion", nextDispatchVersion) .detail("CurrentVersion", recentReadVersion) .detail("TimeElapsed", timeElapsed) .detail("SnapshotIntervalSeconds", snapshotIntervalSeconds); - #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 13471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont11cont1loopHead1(loopDepth); return loopDepth; @@ -13538,19 +19787,19 @@ class _executeActor1State { } int a_body1cont11cont2(int loopDepth) { - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (countShardsNotDone == 0) - #line 13543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupSnapshotDispatchFinished") .detail("BackupUID", config.getUid()) .detail("AllShards", countAllShards) .detail("ShardsDone", countShardsDone) .detail("ShardsNotDone", countShardsNotDone) .detail("SnapshotBeginVersion", snapshotBeginVersion) .detail("SnapshotTargetEndVersion", snapshotTargetEndVersion) .detail("CurrentVersion", recentReadVersion) .detail("SnapshotIntervalSeconds", snapshotIntervalSeconds) .detail("DispatchTimeSeconds", timer() - startTime); - #line 1908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.snapshotFinished().set(task, true); - #line 13549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor1*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor1State(); static_cast<_executeActor1*>(this)->destroy(); return 0; } - #line 13553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor1*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor1State(); static_cast<_executeActor1*>(this)->finishSendAndDelPromiseRef(); @@ -13567,65 +19816,65 @@ class _executeActor1State { } int a_body1cont11cont1loopBody1(int loopDepth) { - #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!(countShardsToDispatch > 0)) - #line 13572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1cont11cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" rangesToAdd = std::vector(); - #line 1764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int taskBatchSize = BUGGIFY ? deterministicRandom()->randomInt(1, countShardsToDispatch + 1) : CLIENT_KNOBS->BACKUP_DISPATCH_ADDTASK_SIZE; - #line 1766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int added = 0; - #line 1768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(;countShardsToDispatch > 0 && added < taskBatchSize && shardMap.size() > 0;) { - #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" auto it = shardMap.randomRange(); - #line 1772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(;1;) { - #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (it->value() >= NOT_DONE_MIN) - #line 13590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" rangesToAdd.push_back(it->range()); - #line 1775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" it->value() = DONE; - #line 1776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" shardMap.coalesce(Key(it->begin())); - #line 1777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++added; - #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++countShardsDone; - #line 1779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" --countShardsToDispatch; - #line 1780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" --countShardsNotDone; - #line 13606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" break; } - #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (it->end() == shardMap.mapEnd) - #line 13611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { break; } - #line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++it; - #line 13617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } } - #line 1789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" oldBatchSize = snapshotBatchSize.get(); - #line 1790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" newBatchSize = oldBatchSize + rangesToAdd.size(); - #line 1793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 1794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 13628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont11cont1loopBody1loopHead1(loopDepth); return loopDepth; @@ -13659,34 +19908,34 @@ class _executeActor1State { int a_body1cont11cont1loopBody1loopBody1(int loopDepth) { try { - #line 1796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupSnapshotDispatchAddingTasks") .suppressFor(2) .detail("TasksToAdd", rangesToAdd.size()) .detail("NewBatchSize", newBatchSize); - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginReads = std::vector>>(); - #line 1806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" endReads = std::vector>>(); - #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& range : rangesToAdd ) { - #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginReads.push_back(config.snapshotRangeDispatchMap().get(tr, range.begin)); - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" endReads.push_back(config.snapshotRangeDispatchMap().get(tr, range.end)); - #line 13678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_16 = store(snapshotBatchSize.get(), config.snapshotBatchSize().getOrThrow(tr)) && waitForAll(beginReads) && waitForAll(endReads) && taskBucket->keepRunning(tr, task); - #line 1813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont11cont1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 13684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_16.isReady()) { if (__when_expr_16.isError()) return a_body1cont11cont1loopBody1loopBody1Catch1(__when_expr_16.getError(), loopDepth); else return a_body1cont11cont1loopBody1loopBody1when1(__when_expr_16.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 17; - #line 1813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_16.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 13689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13719,16 +19968,16 @@ class _executeActor1State { int a_body1cont11cont1loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_19 = tr->onError(e); - #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 13726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_19.isReady()) { if (__when_expr_19.isError()) return a_body1Catch1(__when_expr_19.getError(), std::max(0, loopDepth - 2)); else return a_body1cont11cont1loopBody1loopBody1Catch1when1(__when_expr_19.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 20; - #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_19.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 13731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13741,210 +19990,210 @@ class _executeActor1State { } int a_body1cont11cont1loopBody1loopBody1cont2(Void const& _,int loopDepth) { - #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (snapshotBatchSize.get() == newBatchSize) - #line 13746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 19995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1cont11cont1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } else { - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(snapshotBatchSize.get() == oldBatchSize); - #line 1822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotBatchSize().set(tr, newBatchSize); - #line 1823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotBatchSize = newBatchSize; - #line 1824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotDispatchLastShardsBehind().set(tr, Params.shardsBehind().get(task)); - #line 1825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotDispatchLastVersion().set(tr, tr->getReadVersion().get()); - #line 13762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addTaskFutures = std::vector>(); - #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(i = 0;i < beginReads.size();++i) { - #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyRange& range = rangesToAdd[i]; - #line 1835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional beginValue = config.snapshotRangeDispatchMap().get(tr, range.begin).get(); - #line 1836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional endValue = config.snapshotRangeDispatchMap().get(tr, range.end).get(); - #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(!beginValue.present() || !endValue.present() || beginValue != endValue); - #line 1842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if ((!beginValue.present() || !beginValue.get()) && (!endValue.present() || endValue.get())) - #line 13778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (beginValue.present()) - #line 13782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotRangeDispatchMap().erase(tr, range.begin); - #line 13786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotRangeDispatchMap().set(tr, range.begin, true); - #line 13792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (endValue.present()) - #line 13796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotRangeDispatchMap().erase(tr, range.end); - #line 13800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 1851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotRangeDispatchMap().set(tr, range.end, false); - #line 13806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version scheduledVersion = invalidVersion; - #line 1857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (nextDispatchVersion > recentReadVersion) - #line 13812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" scheduledVersion = recentReadVersion + deterministicRandom()->random01() * (nextDispatchVersion - recentReadVersion); - #line 13816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int priority = latestSnapshotEndVersion.present() ? 0 : 1; - #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addTaskFutures.push_back( success(BackupRangeTaskFunc::addTask(tr, taskBucket, task, priority, range.begin, range.end, TaskCompletionKey::joinWith(snapshotBatchFuture), Reference(), scheduledVersion))); - #line 1874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupSnapshotRangeDispatched") .suppressFor(2) .detail("BackupUID", config.getUid()) .detail("CurrentVersion", recentReadVersion) .detail("ScheduledVersion", scheduledVersion) .detail("BeginKey", range.begin.printable()) .detail("EndKey", range.end.printable()); - #line 13824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 1884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(false); - #line 13830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } } - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_17 = waitForAll(addTaskFutures); - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont11cont1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 13837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_17.isReady()) { if (__when_expr_17.isError()) return a_body1cont11cont1loopBody1loopBody1Catch1(__when_expr_17.getError(), loopDepth); else return a_body1cont11cont1loopBody1loopBody1cont2when1(__when_expr_17.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 18; - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_17.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 13842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont11cont1loopBody1loopBody1cont2(Void && _,int loopDepth) { - #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (snapshotBatchSize.get() == newBatchSize) - #line 13851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1cont11cont1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } else { - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(snapshotBatchSize.get() == oldBatchSize); - #line 1822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotBatchSize().set(tr, newBatchSize); - #line 1823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotBatchSize = newBatchSize; - #line 1824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotDispatchLastShardsBehind().set(tr, Params.shardsBehind().get(task)); - #line 1825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotDispatchLastVersion().set(tr, tr->getReadVersion().get()); - #line 13867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addTaskFutures = std::vector>(); - #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(i = 0;i < beginReads.size();++i) { - #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyRange& range = rangesToAdd[i]; - #line 1835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional beginValue = config.snapshotRangeDispatchMap().get(tr, range.begin).get(); - #line 1836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional endValue = config.snapshotRangeDispatchMap().get(tr, range.end).get(); - #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(!beginValue.present() || !endValue.present() || beginValue != endValue); - #line 1842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if ((!beginValue.present() || !beginValue.get()) && (!endValue.present() || endValue.get())) - #line 13883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (beginValue.present()) - #line 13887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotRangeDispatchMap().erase(tr, range.begin); - #line 13891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotRangeDispatchMap().set(tr, range.begin, true); - #line 13897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (endValue.present()) - #line 13901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotRangeDispatchMap().erase(tr, range.end); - #line 13905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 1851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotRangeDispatchMap().set(tr, range.end, false); - #line 13911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version scheduledVersion = invalidVersion; - #line 1857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (nextDispatchVersion > recentReadVersion) - #line 13917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" scheduledVersion = recentReadVersion + deterministicRandom()->random01() * (nextDispatchVersion - recentReadVersion); - #line 13921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 1862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int priority = latestSnapshotEndVersion.present() ? 0 : 1; - #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addTaskFutures.push_back( success(BackupRangeTaskFunc::addTask(tr, taskBucket, task, priority, range.begin, range.end, TaskCompletionKey::joinWith(snapshotBatchFuture), Reference(), scheduledVersion))); - #line 1874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupSnapshotRangeDispatched") .suppressFor(2) .detail("BackupUID", config.getUid()) .detail("CurrentVersion", recentReadVersion) .detail("ScheduledVersion", scheduledVersion) .detail("BeginKey", range.begin.printable()) .detail("EndKey", range.end.printable()); - #line 13929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 1884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(false); - #line 13935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } } - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_17 = waitForAll(addTaskFutures); - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont11cont1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 13942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_17.isReady()) { if (__when_expr_17.isError()) return a_body1cont11cont1loopBody1loopBody1Catch1(__when_expr_17.getError(), loopDepth); else return a_body1cont11cont1loopBody1loopBody1cont2when1(__when_expr_17.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 18; - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_17.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 13947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -14014,32 +20263,32 @@ class _executeActor1State { } int a_body1cont11cont1loopBody1loopBody1cont4(Void const& _,int loopDepth) { - #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_18 = tr->commit(); - #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont11cont1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 14021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_18.isReady()) { if (__when_expr_18.isError()) return a_body1cont11cont1loopBody1loopBody1Catch1(__when_expr_18.getError(), loopDepth); else return a_body1cont11cont1loopBody1loopBody1cont4when1(__when_expr_18.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 19; - #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_18.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 14026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont11cont1loopBody1loopBody1cont4(Void && _,int loopDepth) { - #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_18 = tr->commit(); - #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor1*>(this)->actor_wait_state < 0) return a_body1cont11cont1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 14037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_18.isReady()) { if (__when_expr_18.isError()) return a_body1cont11cont1loopBody1loopBody1Catch1(__when_expr_18.getError(), loopDepth); else return a_body1cont11cont1loopBody1loopBody1cont4when1(__when_expr_18.get(), loopDepth); }; static_cast<_executeActor1*>(this)->actor_wait_state = 19; - #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_18.addCallbackAndClear(static_cast*>(static_cast<_executeActor1*>(this))); - #line 14042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -14257,94 +20506,94 @@ class _executeActor1State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 19); } - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 1467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference lock; - #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" double startTime; - #line 1471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int notDoneSequence; - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyRangeMap shardMap; - #line 1478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key beginKey; - #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future>> shardBoundaries; - #line 1505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig config; - #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version recentReadVersion; - #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version snapshotBeginVersion; - #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version snapshotTargetEndVersion; - #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t snapshotIntervalSeconds; - #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional latestSnapshotEndVersion; - #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector backupRanges; - #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional snapshotBatchFutureKey; - #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference snapshotBatchFuture; - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional snapshotBatchSize; - #line 1545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TaskCompletionKey dispatchCompletionKey; - #line 1568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector> dispatchBoundaries; - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Future>> bounds; - #line 1598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Future bounds; + #line 2290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int i; - #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RangeMap::iterator iShard; - #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RangeMap::iterator iShardEnd; - #line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bool lastValue; - #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key lastKey; - #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int countShardsDone; - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int countShardsNotDone; - #line 1670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int countAllShards; - #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version nextDispatchVersion; - #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int countExpectedShardsDone; - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int countShardsToDispatch; - #line 1761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector rangesToAdd; - #line 1789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t oldBatchSize; - #line 1790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t newBatchSize; - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector>> beginReads; - #line 1806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector>> endReads; - #line 1828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector> addTaskFutures; - #line 14342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _executeActor1 final : public Actor, public ActorCallback< _executeActor1, 0, Void >, public ActorCallback< _executeActor1, 1, Void >, public ActorCallback< _executeActor1, 2, Void >, public ActorCallback< _executeActor1, 3, Void >, public ActorCallback< _executeActor1, 4, Void >, public ActorCallback< _executeActor1, 5, Void >, public ActorCallback< _executeActor1, 6, Void >, public ActorCallback< _executeActor1, 7, Void >, public ActorCallback< _executeActor1, 8, Void >, public ActorCallback< _executeActor1, 9, Void >, public ActorCallback< _executeActor1, 10, Void >, public ActorCallback< _executeActor1, 11, Void >, public ActorCallback< _executeActor1, 12, Void >, public ActorCallback< _executeActor1, 13, Void >, public ActorCallback< _executeActor1, 14, Void >, public ActorCallback< _executeActor1, 15, Void >, public ActorCallback< _executeActor1, 16, Void >, public ActorCallback< _executeActor1, 17, Void >, public ActorCallback< _executeActor1, 18, Void >, public ActorCallback< _executeActor1, 19, Void >, public FastAllocated<_executeActor1>, public _executeActor1State<_executeActor1> { - #line 14347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor1>::operator new; using FastAllocated<_executeActor1>::operator delete; @@ -14372,9 +20621,9 @@ friend struct ActorCallback< _executeActor1, 16, Void >; friend struct ActorCallback< _executeActor1, 17, Void >; friend struct ActorCallback< _executeActor1, 18, Void >; friend struct ActorCallback< _executeActor1, 19, Void >; - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _executeActor1(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 14377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _executeActor1State<_executeActor1>(cx, taskBucket, futureBucket, task) { @@ -14416,51 +20665,51 @@ friend struct ActorCallback< _executeActor1, 19, Void >; } }; - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _executeActor1(cx, taskBucket, futureBucket, task)); - #line 14423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 1913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 2605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" // This function is just a wrapper for BackupSnapshotManifest::addTask() which is defined below. - // The BackupSnapshotDispatchTask and BackupSnapshotManifest tasks reference each other so in order to keep their - // execute and finish phases defined together inside their class definitions this wrapper is declared here but - // defined after BackupSnapshotManifest is defined. + // The BackupSnapshotDispatchTask and BackupSnapshotManifest tasks reference each other so in order to keep + // their execute and finish phases defined together inside their class definitions this wrapper is declared here + // but defined after BackupSnapshotManifest is defined. static Future addSnapshotManifestTask(Reference tr, Reference taskBucket, Reference parentTask, TaskCompletionKey completionKey, Reference waitFor = Reference()); - #line 14438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor3State { - #line 14444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor3State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config(task), - #line 1931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotBatchFutureKey(), - #line 1932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotBatchDispatchDoneKey() - #line 14463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -14473,16 +20722,16 @@ class _finishActor3State { int a_body1(int loopDepth=0) { try { - #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = store(snapshotBatchFutureKey, config.snapshotBatchFuture().getOrThrow(tr)) && store(snapshotBatchDispatchDoneKey, config.snapshotBatchDispatchDoneKey().getOrThrow(tr)); - #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor3*>(this)->actor_wait_state = 1; - #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor3*>(this))); - #line 14485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -14503,50 +20752,50 @@ class _finishActor3State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotBatchFuture = futureBucket->unpack(snapshotBatchFutureKey); - #line 1938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotBatchDispatchDoneFuture = futureBucket->unpack(snapshotBatchDispatchDoneKey); - #line 1940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotBatchFuture().clear(tr); - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotBatchDispatchDoneKey().clear(tr); - #line 1942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotBatchSize().clear(tr); - #line 1945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotDispatchLastShardsBehind().set(tr, Params.shardsBehind().getOrDefault(task, 0)); - #line 1946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotDispatchLastVersion().set(tr, tr->getReadVersion().get()); - #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotFinishedFuture = task->getDoneFuture(futureBucket); - #line 1953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (Params.snapshotFinished().getOrDefault(task, false)) - #line 14524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = success(addSnapshotManifestTask( tr, taskBucket, task, TaskCompletionKey::signal(snapshotFinishedFuture), snapshotBatchFuture)); - #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor3*>(this)->actor_wait_state = 2; - #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor3*>(this))); - #line 14535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 1957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = success(addTask(tr, taskBucket, task, 1, TaskCompletionKey::signal(snapshotFinishedFuture), snapshotBatchFuture, Params.nextDispatchVersion().get(task))); - #line 1957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor3*>(this)->actor_wait_state = 3; - #line 1957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor3*>(this))); - #line 14549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -14554,50 +20803,50 @@ class _finishActor3State { } int a_body1cont1(Void && _,int loopDepth) { - #line 1937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotBatchFuture = futureBucket->unpack(snapshotBatchFutureKey); - #line 1938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotBatchDispatchDoneFuture = futureBucket->unpack(snapshotBatchDispatchDoneKey); - #line 1940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotBatchFuture().clear(tr); - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotBatchDispatchDoneKey().clear(tr); - #line 1942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotBatchSize().clear(tr); - #line 1945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotDispatchLastShardsBehind().set(tr, Params.shardsBehind().getOrDefault(task, 0)); - #line 1946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotDispatchLastVersion().set(tr, tr->getReadVersion().get()); - #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotFinishedFuture = task->getDoneFuture(futureBucket); - #line 1953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (Params.snapshotFinished().getOrDefault(task, false)) - #line 14575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = success(addSnapshotManifestTask( tr, taskBucket, task, TaskCompletionKey::signal(snapshotFinishedFuture), snapshotBatchFuture)); - #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor3*>(this)->actor_wait_state = 2; - #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor3*>(this))); - #line 14586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 1957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = success(addTask(tr, taskBucket, task, 1, TaskCompletionKey::signal(snapshotFinishedFuture), snapshotBatchFuture, Params.nextDispatchVersion().get(task))); - #line 1957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor3*>(this)->actor_wait_state = 3; - #line 1957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor3*>(this))); - #line 14600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -14668,16 +20917,16 @@ class _finishActor3State { } int a_body1cont2(int loopDepth) { - #line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = snapshotBatchDispatchDoneFuture->set(tr, taskBucket); - #line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont2when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor3*>(this)->actor_wait_state = 4; - #line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor3*>(this))); - #line 14680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 20929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -14834,32 +21083,32 @@ class _finishActor3State { } int a_body1cont5(Void const& _,int loopDepth) { - #line 1969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = taskBucket->finish(tr, task); - #line 1969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor3*>(this)->actor_wait_state = 5; - #line 1969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor3*>(this))); - #line 14846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont5(Void && _,int loopDepth) { - #line 1969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = taskBucket->finish(tr, task); - #line 1969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor3*>(this)->actor_wait_state = 5; - #line 1969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor3*>(this))); - #line 14862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -14929,9 +21178,9 @@ class _finishActor3State { } int a_body1cont6(Void const& _,int loopDepth) { - #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor3*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor3State(); static_cast<_finishActor3*>(this)->destroy(); return 0; } - #line 14934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor3*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor3State(); static_cast<_finishActor3*>(this)->finishSendAndDelPromiseRef(); @@ -14941,9 +21190,9 @@ class _finishActor3State { } int a_body1cont6(Void && _,int loopDepth) { - #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor3*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor3State(); static_cast<_finishActor3*>(this)->destroy(); return 0; } - #line 14946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor3*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor3State(); static_cast<_finishActor3*>(this)->finishSendAndDelPromiseRef(); @@ -15014,32 +21263,32 @@ class _finishActor3State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 4); } - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig config; - #line 1931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key snapshotBatchFutureKey; - #line 1932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key snapshotBatchDispatchDoneKey; - #line 1937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference snapshotBatchFuture; - #line 1938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference snapshotBatchDispatchDoneFuture; - #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference snapshotFinishedFuture; - #line 15037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor3 final : public Actor, public ActorCallback< _finishActor3, 0, Void >, public ActorCallback< _finishActor3, 1, Void >, public ActorCallback< _finishActor3, 2, Void >, public ActorCallback< _finishActor3, 3, Void >, public ActorCallback< _finishActor3, 4, Void >, public FastAllocated<_finishActor3>, public _finishActor3State<_finishActor3> { - #line 15042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor3>::operator new; using FastAllocated<_finishActor3>::operator delete; @@ -15052,9 +21301,9 @@ friend struct ActorCallback< _finishActor3, 1, Void >; friend struct ActorCallback< _finishActor3, 2, Void >; friend struct ActorCallback< _finishActor3, 3, Void >; friend struct ActorCallback< _finishActor3, 4, Void >; - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor3(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 15057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _finishActor3State<_finishActor3>(tr, taskBucket, futureBucket, task) { @@ -15081,16 +21330,16 @@ friend struct ActorCallback< _finishActor3, 4, Void >; } }; - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _finishActor3(tr, taskBucket, futureBucket, task)); - #line 15088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 1973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 2665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" }; -StringRef BackupSnapshotDispatchTask::name = LiteralStringRef("file_backup_dispatch_ranges_5.2"); +StringRef BackupSnapshotDispatchTask::name = "file_backup_dispatch_ranges_5.2"_sr; REGISTER_TASKFUNC(BackupSnapshotDispatchTask); struct BackupLogRangeTaskFunc : BackupTaskFuncBase { @@ -15098,10 +21347,10 @@ struct BackupLogRangeTaskFunc : BackupTaskFuncBase { static constexpr uint32_t version = 1; static struct { - static TaskParam addBackupLogRangeTasks() { return LiteralStringRef(__FUNCTION__); } - static TaskParam fileSize() { return LiteralStringRef(__FUNCTION__); } - static TaskParam beginVersion() { return LiteralStringRef(__FUNCTION__); } - static TaskParam endVersion() { return LiteralStringRef(__FUNCTION__); } + static TaskParam addBackupLogRangeTasks() { return __FUNCTION__sr; } + static TaskParam fileSize() { return __FUNCTION__sr; } + static TaskParam beginVersion() { return __FUNCTION__sr; } + static TaskParam endVersion() { return __FUNCTION__sr; } } Params; StringRef getName() const override { return name; }; @@ -15119,28 +21368,28 @@ struct BackupLogRangeTaskFunc : BackupTaskFuncBase { return _finish(tr, tb, fb, task); }; - #line 15122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _executeActor2State { - #line 15128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _executeActor2State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : cx(cx), - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" lock(new FlowLock(CLIENT_KNOBS->BACKUP_LOCK_BYTES)) - #line 15143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -15153,16 +21402,16 @@ class _executeActor2State { int a_body1(int loopDepth=0) { try { - #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(cx, task, BackupLogRangeTaskFunc::name, BackupLogRangeTaskFunc::version); - #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 15160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 1; - #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor2*>(this))); - #line 15165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -15183,38 +21432,38 @@ class _executeActor2State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 2011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion = Params.beginVersion().get(task); - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" endVersion = Params.endVersion().get(task); - #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config = BackupConfig(task); - #line 2015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc = Reference(); - #line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 15198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 2011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion = Params.beginVersion().get(task); - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" endVersion = Params.endVersion().get(task); - #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config = BackupConfig(task); - #line 2015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc = Reference(); - #line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 15217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -15284,16 +21533,16 @@ class _executeActor2State { } int a_body1cont2(int loopDepth) { - #line 2043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = config.destUidValue().getOrThrow(tr); - #line 2043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 15291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2when1(__when_expr_5.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 6; - #line 2043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_executeActor2*>(this))); - #line 15296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -15307,22 +21556,22 @@ class _executeActor2State { } int a_body1cont1loopBody1(int loopDepth) { - #line 2019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 15314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" try { - #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = taskBucket->keepRunning(tr, task); - #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 15320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 2; - #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor2*>(this))); - #line 15325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -15355,16 +21604,16 @@ class _executeActor2State { int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = tr->onError(e); - #line 2039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 15362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 5; - #line 2039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor2*>(this))); - #line 15367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -15377,20 +21626,20 @@ class _executeActor2State { } int a_body1cont1loopBody1cont2(Void const& _,int loopDepth) { - #line 2025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!bc) - #line 15382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_2 = config.backupContainer().getOrThrow(tr); - #line 2027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 15388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 3; - #line 2027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast<_executeActor2*>(this))); - #line 15393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -15402,20 +21651,20 @@ class _executeActor2State { } int a_body1cont1loopBody1cont2(Void && _,int loopDepth) { - #line 2025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!bc) - #line 15407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_2 = config.backupContainer().getOrThrow(tr); - #line 2027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 15413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 3; - #line 2027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast<_executeActor2*>(this))); - #line 15418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -15490,42 +21739,42 @@ class _executeActor2State { } int a_body1cont1loopBody1cont3(int loopDepth) { - #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version currentVersion = tr->getReadVersion().get(); - #line 2032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (endVersion < currentVersion) - #line 15497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = delay(std::max(CLIENT_KNOBS->BACKUP_RANGE_MINWAIT, (double)(endVersion - currentVersion) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND)); - #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 15505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 4; - #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor2*>(this))); - #line 15510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont4(Reference const& _bc,int loopDepth) { - #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc = getBackupContainerWithProxy(_bc); - #line 15519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont3(loopDepth); return loopDepth; } int a_body1cont1loopBody1cont4(Reference && _bc,int loopDepth) { - #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc = getBackupContainerWithProxy(_bc); - #line 15528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont3(loopDepth); return loopDepth; @@ -15595,18 +21844,18 @@ class _executeActor2State { } int a_body1cont1loopBody1cont6(Void const& _,int loopDepth) { - #line 2037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 15600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont9(loopDepth); return loopDepth; } int a_body1cont1loopBody1cont6(Void && _,int loopDepth) { - #line 2037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 15609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 21858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont9(loopDepth); return loopDepth; @@ -15764,68 +22013,68 @@ class _executeActor2State { } int a_body1cont3(Key const& destUidValue,int loopDepth) { - #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ranges = getLogRanges(beginVersion, endVersion, destUidValue); - #line 2051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (ranges.size() > CLIENT_KNOBS->BACKUP_MAX_LOG_RANGES) - #line 15771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.addBackupLogRangeTasks().set(task, true); - #line 2053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor2*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor2State(); static_cast<_executeActor2*>(this)->destroy(); return 0; } - #line 15777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor2*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor2State(); static_cast<_executeActor2*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" blockSize = BUGGIFY ? deterministicRandom()->randomInt(125e3, 4e6) : CLIENT_KNOBS->BACKUP_LOGFILE_BLOCK_SIZE; - #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_6 = bc->writeLogFile(beginVersion, endVersion, blockSize); - #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 15789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont3when1(__when_expr_6.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 7; - #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast >*>(static_cast<_executeActor2*>(this))); - #line 15794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(Key && destUidValue,int loopDepth) { - #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ranges = getLogRanges(beginVersion, endVersion, destUidValue); - #line 2051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (ranges.size() > CLIENT_KNOBS->BACKUP_MAX_LOG_RANGES) - #line 15805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.addBackupLogRangeTasks().set(task, true); - #line 2053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor2*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor2State(); static_cast<_executeActor2*>(this)->destroy(); return 0; } - #line 15811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor2*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor2State(); static_cast<_executeActor2*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" blockSize = BUGGIFY ? deterministicRandom()->randomInt(125e3, 4e6) : CLIENT_KNOBS->BACKUP_LOGFILE_BLOCK_SIZE; - #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_6 = bc->writeLogFile(beginVersion, endVersion, blockSize); - #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 15823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont3when1(__when_expr_6.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 7; - #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast >*>(static_cast<_executeActor2*>(this))); - #line 15828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -15895,27 +22144,27 @@ class _executeActor2State { } int a_body1cont4(int loopDepth) { - #line 2061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" logFile = LogFileWriter(outFile, blockSize); - #line 2066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" results = PromiseStream(); - #line 2067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" rc = std::vector>(); - #line 2069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& range : ranges ) { - #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" rc.push_back( readCommitted(cx, results, lock, range, Terminator::False, AccessSystemKeys::True, LockAware::True)); - #line 15908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - sendEOS = map(errorOr(waitForAll(rc)), [=](ErrorOr const& result) { if (result.isError()) results.sendError(result.getError()); else results.sendError(end_of_stream()); return Void(); }); - #line 2082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + sendEOS = map(errorOr(waitForAll(rc)), [=](ErrorOr const& result) mutable { if (result.isError()) results.sendError(result.getError()); else results.sendError(end_of_stream()); return Void(); }); + #line 2774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" lastVersion = Version(); - #line 15914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" try { - #line 2084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 15918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont4loopHead1(loopDepth); } catch (Error& error) { @@ -15928,9 +22177,9 @@ class _executeActor2State { } int a_body1cont3when1(Reference const& __outFile,int loopDepth) { - #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" outFile = __outFile; - #line 15933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont4(loopDepth); return loopDepth; @@ -15995,16 +22244,16 @@ class _executeActor2State { } int a_body1cont6(int loopDepth) { - #line 2107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_10 = taskBucket->keepRunning(cx, task); - #line 2107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 16002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont6when1(__when_expr_10.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 11; - #line 2107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast*>(static_cast<_executeActor2*>(this))); - #line 16007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -16012,30 +22261,30 @@ class _executeActor2State { int a_body1cont4Catch1(const Error& e,int loopDepth=0) { try { - #line 2096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (e.code() == error_code_actor_cancelled) - #line 16017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 16021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (e.code() != error_code_end_of_stream) - #line 16025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" err = e; - #line 2101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_9 = config.logError(cx, err, format("Failed to write to file `%s'", outFile->getFileName().c_str())); - #line 2101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 16033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1cont4Catch1when1(__when_expr_9.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 10; - #line 2101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_executeActor2*>(this))); - #line 16038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -16060,38 +22309,38 @@ class _executeActor2State { } int a_body1cont4loopBody1(int loopDepth) { - #line 2085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" FutureStream __when_expr_7 = results.getFuture(); - #line 2085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1cont4Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 16067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont4Catch1(__when_expr_7.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1when1(__when_expr_7.pop(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 8; - #line 2085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor2*>(this))); - #line 16072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4loopBody1cont1(int loopDepth) { - #line 2086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" lock->release(r.first.expectedSize()); - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" i = 0; - #line 2089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 16085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont4loopBody1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont4loopBody1when1(RangeResultWithVersion const& __r,int loopDepth) { - #line 2085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" r = __r; - #line 16094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont4loopBody1cont1(loopDepth); return loopDepth; @@ -16169,22 +22418,22 @@ class _executeActor2State { } int a_body1cont4loopBody1cont1loopBody1(int loopDepth) { - #line 2089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!(i < r.first.size())) - #line 16174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1cont4loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 2091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_8 = logFile.writeKV(r.first[i].key.substr(backupLogPrefixBytes + 16), r.first[i].value); - #line 2091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1cont4Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 16182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont4Catch1(__when_expr_8.getError(), std::max(0, loopDepth - 2)); else return a_body1cont4loopBody1cont1loopBody1when1(__when_expr_8.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 9; - #line 2091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor2*>(this))); - #line 16187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -16204,22 +22453,22 @@ class _executeActor2State { } int a_body1cont4loopBody1cont1loopBody1cont1(Void const& _,int loopDepth) { - #line 2092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" lastVersion = r.second; - #line 2089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++i; - #line 16211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont4loopBody1cont1loopHead1(0); return loopDepth; } int a_body1cont4loopBody1cont1loopBody1cont1(Void && _,int loopDepth) { - #line 2092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" lastVersion = r.second; - #line 2089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++i; - #line 16222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont4loopBody1cont1loopHead1(0); return loopDepth; @@ -16295,17 +22544,17 @@ class _executeActor2State { } int a_body1cont4Catch1cont3(Void const& _,int loopDepth) { - #line 2102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(err, loopDepth); - #line 16300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" return loopDepth; } int a_body1cont4Catch1cont3(Void && _,int loopDepth) { - #line 2102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(err, loopDepth); - #line 16308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" return loopDepth; } @@ -16374,32 +22623,32 @@ class _executeActor2State { } int a_body1cont9(Void const& _,int loopDepth) { - #line 2109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_11 = outFile->finish(); - #line 2109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 16381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1Catch1(__when_expr_11.getError(), loopDepth); else return a_body1cont9when1(__when_expr_11.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 12; - #line 2109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_11.addCallbackAndClear(static_cast*>(static_cast<_executeActor2*>(this))); - #line 16386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont9(Void && _,int loopDepth) { - #line 2109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_11 = outFile->finish(); - #line 2109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 16397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1Catch1(__when_expr_11.getError(), loopDepth); else return a_body1cont9when1(__when_expr_11.get(), loopDepth); }; static_cast<_executeActor2*>(this)->actor_wait_state = 12; - #line 2109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_11.addCallbackAndClear(static_cast*>(static_cast<_executeActor2*>(this))); - #line 16402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -16469,13 +22718,13 @@ class _executeActor2State { } int a_body1cont10(Void const& _,int loopDepth) { - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupWroteLogFile") .suppressFor(60) .detail("BackupUID", config.getUid()) .detail("Size", outFile->size()) .detail("BeginVersion", beginVersion) .detail("EndVersion", endVersion) .detail("LastReadVersion", lastVersion); - #line 2119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.fileSize().set(task, outFile->size()); - #line 2121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor2*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor2State(); static_cast<_executeActor2*>(this)->destroy(); return 0; } - #line 16478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor2*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor2State(); static_cast<_executeActor2*>(this)->finishSendAndDelPromiseRef(); @@ -16485,13 +22734,13 @@ class _executeActor2State { } int a_body1cont10(Void && _,int loopDepth) { - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupWroteLogFile") .suppressFor(60) .detail("BackupUID", config.getUid()) .detail("Size", outFile->size()) .detail("BeginVersion", beginVersion) .detail("EndVersion", endVersion) .detail("LastReadVersion", lastVersion); - #line 2119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.fileSize().set(task, outFile->size()); - #line 2121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor2*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor2State(); static_cast<_executeActor2*>(this)->destroy(); return 0; } - #line 16494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor2*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor2State(); static_cast<_executeActor2*>(this)->finishSendAndDelPromiseRef(); @@ -16562,54 +22811,54 @@ class _executeActor2State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 11); } - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference lock; - #line 2011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version beginVersion; - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version endVersion; - #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig config; - #line 2015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference bc; - #line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> ranges; - #line 2058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int blockSize; - #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference outFile; - #line 2061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" LogFileWriter logFile; - #line 2066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" PromiseStream results; - #line 2067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector> rc; - #line 2074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future sendEOS; - #line 2082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version lastVersion; - #line 2085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RangeResultWithVersion r; - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int i; - #line 2100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Error err; - #line 16607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _executeActor2 final : public Actor, public ActorCallback< _executeActor2, 0, Void >, public ActorCallback< _executeActor2, 1, Void >, public ActorCallback< _executeActor2, 2, Reference >, public ActorCallback< _executeActor2, 3, Void >, public ActorCallback< _executeActor2, 4, Void >, public ActorCallback< _executeActor2, 5, Key >, public ActorCallback< _executeActor2, 6, Reference >, public ActorSingleCallback< _executeActor2, 7, RangeResultWithVersion >, public ActorCallback< _executeActor2, 8, Void >, public ActorCallback< _executeActor2, 9, Void >, public ActorCallback< _executeActor2, 10, Void >, public ActorCallback< _executeActor2, 11, Void >, public FastAllocated<_executeActor2>, public _executeActor2State<_executeActor2> { - #line 16612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor2>::operator new; using FastAllocated<_executeActor2>::operator delete; @@ -16629,9 +22878,9 @@ friend struct ActorCallback< _executeActor2, 8, Void >; friend struct ActorCallback< _executeActor2, 9, Void >; friend struct ActorCallback< _executeActor2, 10, Void >; friend struct ActorCallback< _executeActor2, 11, Void >; - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _executeActor2(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 16634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _executeActor2State<_executeActor2>(cx, taskBucket, futureBucket, task) { @@ -16665,43 +22914,43 @@ friend struct ActorCallback< _executeActor2, 11, Void >; } }; - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _executeActor2(cx, taskBucket, futureBucket, task)); - #line 16672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 2815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 16677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor2State { - #line 16683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor2State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,int const& priority,Version const& beginVersion,Version const& endVersion,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" parentTask(parentTask), - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" priority(priority), - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion(beginVersion), - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" endVersion(endVersion), - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" completionKey(completionKey), - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" waitFor(waitFor) - #line 16704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -16714,16 +22963,16 @@ class AddTaskActor2State { int a_body1(int loopDepth=0) { try { - #line 2132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = addBackupTask( BackupLogRangeTaskFunc::name, BackupLogRangeTaskFunc::version, tr, taskBucket, completionKey, BackupConfig(parentTask), waitFor, [=](Reference task) { Params.beginVersion().set(task, beginVersion); Params.endVersion().set(task, endVersion); Params.addBackupLogRangeTasks().set(task, false); }, priority); - #line 2132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 16721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 16726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -16744,9 +22993,9 @@ class AddTaskActor2State { } int a_body1cont1(Key const& key,int loopDepth) { - #line 2146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor2State(); static_cast(this)->destroy(); return 0; } - #line 16749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 22998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(key); this->~AddTaskActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16756,9 +23005,9 @@ class AddTaskActor2State { } int a_body1cont1(Key && key,int loopDepth) { - #line 2146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor2State(); static_cast(this)->destroy(); return 0; } - #line 16761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(key); this->~AddTaskActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16829,28 +23078,28 @@ class AddTaskActor2State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); } - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference parentTask; - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int priority; - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version beginVersion; - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version endVersion; - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference waitFor; - #line 16848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor2 final : public Actor, public ActorCallback< AddTaskActor2, 0, Key >, public FastAllocated, public AddTaskActor2State { - #line 16853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -16859,9 +23108,9 @@ class AddTaskActor2 final : public Actor, public ActorCallback< AddTaskActo void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor2, 0, Key >; - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor2(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,int const& priority,Version const& beginVersion,Version const& endVersion,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 16864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), AddTaskActor2State(tr, taskBucket, parentTask, priority, beginVersion, endVersion, completionKey, waitFor) { @@ -16884,41 +23133,41 @@ friend struct ActorCallback< AddTaskActor2, 0, Key >; } }; - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, int const& priority, Version const& beginVersion, Version const& endVersion, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 2124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new AddTaskActor2(tr, taskBucket, parentTask, priority, beginVersion, endVersion, completionKey, waitFor)); - #line 16891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 2840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 16896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via startBackupLogRangeInternal() - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class StartBackupLogRangeInternalActorState { - #line 16902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StartBackupLogRangeInternalActorState(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task,Reference const& taskFuture,Version const& beginVersion,Version const& endVersion) - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskFuture(taskFuture), - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion(beginVersion), - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" endVersion(endVersion) - #line 16921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("startBackupLogRangeInternal", reinterpret_cast(this)); @@ -16931,45 +23180,45 @@ class StartBackupLogRangeInternalActorState { int a_body1(int loopDepth=0) { try { - #line 2156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector> addTaskVector; - #line 2160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int tasks = 0; - #line 2161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(int64_t vblock = beginVersion / CLIENT_KNOBS->LOG_RANGE_BLOCK_SIZE;vblock < (endVersion + CLIENT_KNOBS->LOG_RANGE_BLOCK_SIZE - 1) / CLIENT_KNOBS->LOG_RANGE_BLOCK_SIZE;vblock += CLIENT_KNOBS->BACKUP_MAX_LOG_RANGES) { - #line 2164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version bv = std::max(beginVersion, vblock * CLIENT_KNOBS->LOG_RANGE_BLOCK_SIZE); - #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (tasks >= CLIENT_KNOBS->BACKUP_SHARD_TASK_LIMIT) - #line 16948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addTaskVector.push_back(addTask(tr, taskBucket, task, task->getPriority(), bv, endVersion, TaskCompletionKey::joinWith(taskFuture))); - #line 16952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" break; } - #line 2177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version ev = std::min(endVersion, (vblock + CLIENT_KNOBS->BACKUP_MAX_LOG_RANGES) * CLIENT_KNOBS->LOG_RANGE_BLOCK_SIZE); - #line 2179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addTaskVector.push_back( addTask(tr, taskBucket, task, task->getPriority(), bv, ev, TaskCompletionKey::joinWith(taskFuture))); - #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tasks++; - #line 16961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = waitForAll(addTaskVector); - #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 16967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 16972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -16990,9 +23239,9 @@ class StartBackupLogRangeInternalActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~StartBackupLogRangeInternalActorState(); static_cast(this)->destroy(); return 0; } - #line 16995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~StartBackupLogRangeInternalActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -17002,9 +23251,9 @@ class StartBackupLogRangeInternalActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~StartBackupLogRangeInternalActorState(); static_cast(this)->destroy(); return 0; } - #line 17007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~StartBackupLogRangeInternalActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -17075,26 +23324,26 @@ class StartBackupLogRangeInternalActorState { fdb_probe_actor_exit("startBackupLogRangeInternal", reinterpret_cast(this), 0); } - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskFuture; - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version beginVersion; - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version endVersion; - #line 17092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via startBackupLogRangeInternal() - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class StartBackupLogRangeInternalActor final : public Actor, public ActorCallback< StartBackupLogRangeInternalActor, 0, Void >, public FastAllocated, public StartBackupLogRangeInternalActorState { - #line 17097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -17103,9 +23352,9 @@ class StartBackupLogRangeInternalActor final : public Actor, public ActorC void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< StartBackupLogRangeInternalActor, 0, Void >; - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StartBackupLogRangeInternalActor(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task,Reference const& taskFuture,Version const& beginVersion,Version const& endVersion) - #line 17108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), StartBackupLogRangeInternalActorState(tr, taskBucket, futureBucket, task, taskFuture, beginVersion, endVersion) { @@ -17128,43 +23377,43 @@ friend struct ActorCallback< StartBackupLogRangeInternalActor, 0, Void >; } }; - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future startBackupLogRangeInternal( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task, Reference const& taskFuture, Version const& beginVersion, Version const& endVersion ) { - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new StartBackupLogRangeInternalActor(tr, taskBucket, futureBucket, task, taskFuture, beginVersion, endVersion)); - #line 17135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 17140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor4State { - #line 17146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor4State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 2193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion(Params.beginVersion().get(task)), - #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" endVersion(Params.endVersion().get(task)), - #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskFuture(futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone])), - #line 2196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config(task) - #line 17167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -17177,42 +23426,42 @@ class _finishActor4State { int a_body1(int loopDepth=0) { try { - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (Params.fileSize().exists(task)) - #line 17182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.logBytesWritten().atomicOp(tr, Params.fileSize().get(task), MutationRef::AddValue); - #line 17186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (Params.addBackupLogRangeTasks().get(task)) - #line 17190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = startBackupLogRangeInternal(tr, taskBucket, futureBucket, task, taskFuture, beginVersion, endVersion); - #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 1; - #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 17201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 2205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = taskFuture->set(tr, taskBucket); - #line 2205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 2; - #line 2205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 17215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } } @@ -17234,16 +23483,16 @@ class _finishActor4State { } int a_body1cont1(int loopDepth) { - #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = taskBucket->finish(tr, task); - #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor4*>(this)->actor_wait_state = 3; - #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor4*>(this))); - #line 17246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -17400,9 +23649,9 @@ class _finishActor4State { } int a_body1cont5(Void const& _,int loopDepth) { - #line 2209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor4*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor4State(); static_cast<_finishActor4*>(this)->destroy(); return 0; } - #line 17405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor4*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor4State(); static_cast<_finishActor4*>(this)->finishSendAndDelPromiseRef(); @@ -17412,9 +23661,9 @@ class _finishActor4State { } int a_body1cont5(Void && _,int loopDepth) { - #line 2209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor4*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor4State(); static_cast<_finishActor4*>(this)->destroy(); return 0; } - #line 17417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor4*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor4State(); static_cast<_finishActor4*>(this)->finishSendAndDelPromiseRef(); @@ -17485,28 +23734,28 @@ class _finishActor4State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); } - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 2193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version beginVersion; - #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version endVersion; - #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskFuture; - #line 2196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig config; - #line 17504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor4 final : public Actor, public ActorCallback< _finishActor4, 0, Void >, public ActorCallback< _finishActor4, 1, Void >, public ActorCallback< _finishActor4, 2, Void >, public FastAllocated<_finishActor4>, public _finishActor4State<_finishActor4> { - #line 17509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor4>::operator new; using FastAllocated<_finishActor4>::operator delete; @@ -17517,9 +23766,9 @@ class _finishActor4 final : public Actor, public ActorCallback< _finishAct friend struct ActorCallback< _finishActor4, 0, Void >; friend struct ActorCallback< _finishActor4, 1, Void >; friend struct ActorCallback< _finishActor4, 2, Void >; - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor4(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 17522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _finishActor4State<_finishActor4>(tr, taskBucket, futureBucket, task) { @@ -17544,17 +23793,17 @@ friend struct ActorCallback< _finishActor4, 2, Void >; } }; - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _finishActor4(tr, taskBucket, futureBucket, task)); - #line 17551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" }; -StringRef BackupLogRangeTaskFunc::name = LiteralStringRef("file_backup_write_logs_5.2"); +StringRef BackupLogRangeTaskFunc::name = "file_backup_write_logs_5.2"_sr; REGISTER_TASKFUNC(BackupLogRangeTaskFunc); // This task stopped being used in 6.2, however the code remains here to handle upgrades. @@ -17564,37 +23813,37 @@ struct EraseLogRangeTaskFunc : BackupTaskFuncBase { StringRef getName() const override { return name; }; static struct { - static TaskParam beginVersion() { return LiteralStringRef(__FUNCTION__); } - static TaskParam endVersion() { return LiteralStringRef(__FUNCTION__); } - static TaskParam destUidValue() { return LiteralStringRef(__FUNCTION__); } + static TaskParam beginVersion() { return __FUNCTION__sr; } + static TaskParam endVersion() { return __FUNCTION__sr; } + static TaskParam destUidValue() { return __FUNCTION__sr; } } Params; - #line 17572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor3State { - #line 17578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor3State(Reference const& tr,Reference const& taskBucket,UID const& logUid,TaskCompletionKey const& completionKey,Key const& destUidValue,Version const& endVersion = 0,Reference const& waitFor = Reference()) - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" logUid(logUid), - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" completionKey(completionKey), - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" destUidValue(destUidValue), - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" endVersion(endVersion), - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" waitFor(waitFor) - #line 17597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -17607,16 +23856,16 @@ class AddTaskActor3State { int a_body1(int loopDepth=0) { try { - #line 2235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = addBackupTask( EraseLogRangeTaskFunc::name, EraseLogRangeTaskFunc::version, tr, taskBucket, completionKey, BackupConfig(logUid), waitFor, [=](Reference task) { Params.beginVersion().set(task, 1); Params.endVersion().set(task, endVersion); Params.destUidValue().set(task, destUidValue); }, 0, SetValidation::False); - #line 2235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 17619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -17637,9 +23886,9 @@ class AddTaskActor3State { } int a_body1cont1(Key const& key,int loopDepth) { - #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor3State(); static_cast(this)->destroy(); return 0; } - #line 17642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(key); this->~AddTaskActor3State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -17649,9 +23898,9 @@ class AddTaskActor3State { } int a_body1cont1(Key && key,int loopDepth) { - #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor3State(); static_cast(this)->destroy(); return 0; } - #line 17654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(key); this->~AddTaskActor3State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -17722,26 +23971,26 @@ class AddTaskActor3State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); } - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UID logUid; - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key destUidValue; - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version endVersion; - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference waitFor; - #line 17739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor3 final : public Actor, public ActorCallback< AddTaskActor3, 0, Key >, public FastAllocated, public AddTaskActor3State { - #line 17744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 23993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -17750,9 +23999,9 @@ class AddTaskActor3 final : public Actor, public ActorCallback< AddTaskActo void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor3, 0, Key >; - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor3(Reference const& tr,Reference const& taskBucket,UID const& logUid,TaskCompletionKey const& completionKey,Key const& destUidValue,Version const& endVersion = 0,Reference const& waitFor = Reference()) - #line 17755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), AddTaskActor3State(tr, taskBucket, logUid, completionKey, destUidValue, endVersion, waitFor) { @@ -17775,37 +24024,37 @@ friend struct ActorCallback< AddTaskActor3, 0, Key >; } }; - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, UID const& logUid, TaskCompletionKey const& completionKey, Key const& destUidValue, Version const& endVersion = 0, Reference const& waitFor = Reference() ) { - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new AddTaskActor3(tr, taskBucket, logUid, completionKey, destUidValue, endVersion, waitFor)); - #line 17782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 17787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor5State { - #line 17793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor5State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskFuture(futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone])) - #line 17808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -17818,16 +24067,16 @@ class _finishActor5State { int a_body1(int loopDepth=0) { try { - #line 2260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(tr->getDatabase(), task, EraseLogRangeTaskFunc::name, EraseLogRangeTaskFunc::version); - #line 2260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor5*>(this)->actor_wait_state = 1; - #line 2260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor5*>(this))); - #line 17830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -17848,48 +24097,48 @@ class _finishActor5State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" endVersion = Params.endVersion().get(task); - #line 2263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" destUidValue = Params.destUidValue().get(task); - #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config = BackupConfig(task); - #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" logUidValue = config.getUidAsKey(); - #line 2268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = taskFuture->set(tr, taskBucket) && taskBucket->finish(tr, task) && eraseLogData( tr, logUidValue, destUidValue, endVersion != 0 ? Optional(endVersion) : Optional()); - #line 2268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor5*>(this)->actor_wait_state = 2; - #line 2268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor5*>(this))); - #line 17868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" endVersion = Params.endVersion().get(task); - #line 2263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" destUidValue = Params.destUidValue().get(task); - #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config = BackupConfig(task); - #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" logUidValue = config.getUidAsKey(); - #line 2268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = taskFuture->set(tr, taskBucket) && taskBucket->finish(tr, task) && eraseLogData( tr, logUidValue, destUidValue, endVersion != 0 ? Optional(endVersion) : Optional()); - #line 2268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor5*>(this)->actor_wait_state = 2; - #line 2268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor5*>(this))); - #line 17892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -17959,9 +24208,9 @@ class _finishActor5State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor5*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor5State(); static_cast<_finishActor5*>(this)->destroy(); return 0; } - #line 17964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor5*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor5State(); static_cast<_finishActor5*>(this)->finishSendAndDelPromiseRef(); @@ -17971,9 +24220,9 @@ class _finishActor5State { } int a_body1cont2(Void && _,int loopDepth) { - #line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor5*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor5State(); static_cast<_finishActor5*>(this)->destroy(); return 0; } - #line 17976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor5*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor5State(); static_cast<_finishActor5*>(this)->finishSendAndDelPromiseRef(); @@ -18044,30 +24293,30 @@ class _finishActor5State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); } - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskFuture; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version endVersion; - #line 2263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key destUidValue; - #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig config; - #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key logUidValue; - #line 18065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor5 final : public Actor, public ActorCallback< _finishActor5, 0, Void >, public ActorCallback< _finishActor5, 1, Void >, public FastAllocated<_finishActor5>, public _finishActor5State<_finishActor5> { - #line 18070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor5>::operator new; using FastAllocated<_finishActor5>::operator delete; @@ -18077,9 +24326,9 @@ class _finishActor5 final : public Actor, public ActorCallback< _finishAct #pragma clang diagnostic pop friend struct ActorCallback< _finishActor5, 0, Void >; friend struct ActorCallback< _finishActor5, 1, Void >; - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor5(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 18082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _finishActor5State<_finishActor5>(tr, taskBucket, futureBucket, task) { @@ -18103,14 +24352,14 @@ friend struct ActorCallback< _finishActor5, 1, Void >; } }; - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _finishActor5(tr, taskBucket, futureBucket, task)); - #line 18110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 2967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future execute(Database cx, Reference tb, @@ -18125,7 +24374,7 @@ friend struct ActorCallback< _finishActor5, 1, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef EraseLogRangeTaskFunc::name = LiteralStringRef("file_backup_erase_logs_5.2"); +StringRef EraseLogRangeTaskFunc::name = "file_backup_erase_logs_5.2"_sr; REGISTER_TASKFUNC(EraseLogRangeTaskFunc); struct BackupLogsDispatchTask : BackupTaskFuncBase { @@ -18133,30 +24382,30 @@ struct BackupLogsDispatchTask : BackupTaskFuncBase { static constexpr uint32_t version = 1; static struct { - static TaskParam prevBeginVersion() { return LiteralStringRef(__FUNCTION__); } - static TaskParam beginVersion() { return LiteralStringRef(__FUNCTION__); } + static TaskParam prevBeginVersion() { return __FUNCTION__sr; } + static TaskParam beginVersion() { return __FUNCTION__sr; } } Params; - #line 18140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor6State { - #line 18146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor6State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task) - #line 18159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -18169,16 +24418,16 @@ class _finishActor6State { int a_body1(int loopDepth=0) { try { - #line 2304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(tr->getDatabase(), task, BackupLogsDispatchTask::name, BackupLogsDispatchTask::version); - #line 2304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 1; - #line 2304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 18181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -18199,100 +24448,84 @@ class _finishActor6State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 2306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (CLIENT_KNOBS->BACKUP_AGENT_VERBOSE_LOGGING) - #line 18208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 2309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->debugTransaction(deterministicRandom()->randomUniqueID()); - #line 18212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 2312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" onDone = task->getDoneFuture(futureBucket); - #line 2313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" prevBeginVersion = Params.prevBeginVersion().get(task); - #line 2314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion = Params.beginVersion().get(task); - #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config = BackupConfig(task); - #line 2316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.latestLogEndVersion().set(tr, beginVersion); - #line 2318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" stopWhenDone = bool(); - #line 2319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restorableVersion = Optional(); - #line 2320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupState = EBackupState(); - #line 2321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tag = Optional(); - #line 2322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" latestSnapshotEndVersion = Optional(); - #line 2323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" partitionedLog = Optional(); - #line 2325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = store(stopWhenDone, config.stopWhenDone().getOrThrow(tr)) && store(restorableVersion, config.getLatestRestorableVersion(tr)) && store(backupState, config.stateEnum().getOrThrow(tr)) && store(tag, config.tag().get(tr)) && store(latestSnapshotEndVersion, config.latestSnapshotEndVersion().get(tr)) && store(partitionedLog, config.partitionedLogEnabled().get(tr)); - #line 2325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 2; - #line 2325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 18245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 2306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (CLIENT_KNOBS->BACKUP_AGENT_VERBOSE_LOGGING) - #line 18258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 2309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->debugTransaction(deterministicRandom()->randomUniqueID()); - #line 18262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 2312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" onDone = task->getDoneFuture(futureBucket); - #line 2313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" prevBeginVersion = Params.prevBeginVersion().get(task); - #line 2314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion = Params.beginVersion().get(task); - #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config = BackupConfig(task); - #line 2316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.latestLogEndVersion().set(tr, beginVersion); - #line 2318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" stopWhenDone = bool(); - #line 2319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restorableVersion = Optional(); - #line 2320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupState = EBackupState(); - #line 2321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tag = Optional(); - #line 2322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" latestSnapshotEndVersion = Optional(); - #line 2323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" partitionedLog = Optional(); - #line 2325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = store(stopWhenDone, config.stopWhenDone().getOrThrow(tr)) && store(restorableVersion, config.getLatestRestorableVersion(tr)) && store(backupState, config.stateEnum().getOrThrow(tr)) && store(tag, config.tag().get(tr)) && store(latestSnapshotEndVersion, config.latestSnapshotEndVersion().get(tr)) && store(partitionedLog, config.partitionedLogEnabled().get(tr)); - #line 2325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 2; - #line 2325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 18295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -18362,82 +24595,82 @@ class _finishActor6State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (restorableVersion.present() && tag.present()) - #line 18367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" FileBackupAgent().setLastRestorable(tr, StringRef(tag.get()), restorableVersion.get()); - #line 18371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (restorableVersion.present() && backupState != EBackupState::STATE_RUNNING_DIFFERENTIAL) - #line 18375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.stateEnum().set(tr, EBackupState::STATE_RUNNING_DIFFERENTIAL); - #line 18379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (stopWhenDone && restorableVersion.present()) - #line 18383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = onDone->set(tr, taskBucket) && taskBucket->finish(tr, task); - #line 2343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 3; - #line 2343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 18394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1cont4(loopDepth); + loopDepth = a_body1cont3(loopDepth); } return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (restorableVersion.present() && tag.present()) - #line 18408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" FileBackupAgent().setLastRestorable(tr, StringRef(tag.get()), restorableVersion.get()); - #line 18412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (restorableVersion.present() && backupState != EBackupState::STATE_RUNNING_DIFFERENTIAL) - #line 18416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.stateEnum().set(tr, EBackupState::STATE_RUNNING_DIFFERENTIAL); - #line 18420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (stopWhenDone && restorableVersion.present()) - #line 18424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = onDone->set(tr, taskBucket) && taskBucket->finish(tr, task); - #line 2343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 3; - #line 2343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 18435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1cont4(loopDepth); + loopDepth = a_body1cont3(loopDepth); } return loopDepth; @@ -18505,58 +24738,58 @@ class _finishActor6State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); } - int a_body1cont4(int loopDepth) + int a_body1cont3(int loopDepth) { - #line 2353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" endVersion = std::max(tr->getReadVersion().get() + 1, beginVersion + (CLIENT_KNOBS->BACKUP_MAX_LOG_RANGES - 1) * CLIENT_KNOBS->LOG_RANGE_BLOCK_SIZE); - #line 2357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupLogDispatch") .suppressFor(60) .detail("BeginVersion", beginVersion) .detail("EndVersion", endVersion) .detail("RestorableVersion", restorableVersion.orDefault(-1)); - #line 2363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" logDispatchBatchFuture = futureBucket->future(tr); - #line 2366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" priority = latestSnapshotEndVersion.present() ? 1 : 0; - #line 2368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!partitionedLog.present() || !partitionedLog.get()) - #line 18520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = success(BackupLogRangeTaskFunc::addTask(tr, taskBucket, task, priority, beginVersion, endVersion, TaskCompletionKey::joinWith(logDispatchBatchFuture))); - #line 2371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; + #line 24759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 4; - #line 2371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 18531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version scheduledVersion = tr->getReadVersion().get() + CLIENT_KNOBS->BACKUP_POLL_PROGRESS_SECONDS * CLIENT_KNOBS->VERSIONS_PER_SECOND; - #line 2396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_7 = success(BackupLogsDispatchTask::addTask(tr, taskBucket, task, 1, beginVersion, endVersion, TaskCompletionKey::signal(onDone), Reference(), scheduledVersion)); - #line 2396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont4when2(__when_expr_7.get(), loopDepth); }; + #line 24775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont3when2(__when_expr_7.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 8; - #line 2396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 18547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } return loopDepth; } - int a_body1cont7(Void const& _,int loopDepth) + int a_body1cont6(Void const& _,int loopDepth) { - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupLogsDispatchDone") .detail("BackupUID", config.getUid()) .detail("BeginVersion", beginVersion) .detail("RestorableVersion", restorableVersion.orDefault(-1)); - #line 2350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor6*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor6State(); static_cast<_finishActor6*>(this)->destroy(); return 0; } - #line 18559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor6*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor6State(); static_cast<_finishActor6*>(this)->finishSendAndDelPromiseRef(); @@ -18564,13 +24797,13 @@ class _finishActor6State { return loopDepth; } - int a_body1cont7(Void && _,int loopDepth) + int a_body1cont6(Void && _,int loopDepth) { - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupLogsDispatchDone") .detail("BackupUID", config.getUid()) .detail("BeginVersion", beginVersion) .detail("RestorableVersion", restorableVersion.orDefault(-1)); - #line 2350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor6*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor6State(); static_cast<_finishActor6*>(this)->destroy(); return 0; } - #line 18573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor6*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor6State(); static_cast<_finishActor6*>(this)->finishSendAndDelPromiseRef(); @@ -18580,13 +24813,13 @@ class _finishActor6State { } int a_body1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont7(_, loopDepth); + loopDepth = a_body1cont6(_, loopDepth); return loopDepth; } int a_body1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont7(std::move(_), loopDepth); + loopDepth = a_body1cont6(std::move(_), loopDepth); return loopDepth; } @@ -18641,63 +24874,63 @@ class _finishActor6State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); } - int a_body1cont9(int loopDepth) + int a_body1cont8(int loopDepth) { - #line 2407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_8 = taskBucket->finish(tr, task); - #line 2407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont9when1(__when_expr_8.get(), loopDepth); }; + #line 24883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont8when1(__when_expr_8.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 9; - #line 2407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 18655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont10(Void const& _,int loopDepth) + int a_body1cont9(Void const& _,int loopDepth) { - #line 2378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = success(BackupLogsDispatchTask::addTask(tr, taskBucket, task, priority, beginVersion, endVersion, TaskCompletionKey::signal(onDone), logDispatchBatchFuture)); - #line 2378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont10when1(__when_expr_4.get(), loopDepth); }; + #line 24899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont9when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 5; - #line 2378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 18671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont10(Void && _,int loopDepth) + int a_body1cont9(Void && _,int loopDepth) { - #line 2378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = success(BackupLogsDispatchTask::addTask(tr, taskBucket, task, priority, beginVersion, endVersion, TaskCompletionKey::signal(onDone), logDispatchBatchFuture)); - #line 2378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont10when1(__when_expr_4.get(), loopDepth); }; + #line 24915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont9when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 5; - #line 2378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 18687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont4when1(Void const& _,int loopDepth) + int a_body1cont3when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont10(_, loopDepth); + loopDepth = a_body1cont9(_, loopDepth); return loopDepth; } - int a_body1cont4when1(Void && _,int loopDepth) + int a_body1cont3when1(Void && _,int loopDepth) { - loopDepth = a_body1cont10(std::move(_), loopDepth); + loopDepth = a_body1cont9(std::move(_), loopDepth); return loopDepth; } @@ -18712,7 +24945,7 @@ class _finishActor6State { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont4when1(value, 0); + a_body1cont3when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -18727,7 +24960,7 @@ class _finishActor6State { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont4when1(std::move(value), 0); + a_body1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -18752,65 +24985,65 @@ class _finishActor6State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 3); } - int a_body1cont10cont1(Void const& _,int loopDepth) + int a_body1cont10(Void const& _,int loopDepth) { - #line 2388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (prevBeginVersion > 0) - #line 18759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 24992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = config.destUidValue().getOrThrow(tr); - #line 2389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont10cont1when1(__when_expr_5.get(), loopDepth); }; + #line 24998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont10when1(__when_expr_5.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 6; - #line 2389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 18770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1cont10cont2(loopDepth); + loopDepth = a_body1cont10cont1(loopDepth); } return loopDepth; } - int a_body1cont10cont1(Void && _,int loopDepth) + int a_body1cont10(Void && _,int loopDepth) { - #line 2388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (prevBeginVersion > 0) - #line 18784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = config.destUidValue().getOrThrow(tr); - #line 2389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont10cont1when1(__when_expr_5.get(), loopDepth); }; + #line 25023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont10when1(__when_expr_5.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 6; - #line 2389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 18795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1cont10cont2(loopDepth); + loopDepth = a_body1cont10cont1(loopDepth); } return loopDepth; } - int a_body1cont10when1(Void const& _,int loopDepth) + int a_body1cont9when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont10cont1(_, loopDepth); + loopDepth = a_body1cont10(_, loopDepth); return loopDepth; } - int a_body1cont10when1(Void && _,int loopDepth) + int a_body1cont9when1(Void && _,int loopDepth) { - loopDepth = a_body1cont10cont1(std::move(_), loopDepth); + loopDepth = a_body1cont10(std::move(_), loopDepth); return loopDepth; } @@ -18825,7 +25058,7 @@ class _finishActor6State { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 4); a_exitChoose5(); try { - a_body1cont10when1(value, 0); + a_body1cont9when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -18840,7 +25073,7 @@ class _finishActor6State { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 4); a_exitChoose5(); try { - a_body1cont10when1(std::move(value), 0); + a_body1cont9when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -18865,41 +25098,41 @@ class _finishActor6State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 4); } - int a_body1cont10cont2(int loopDepth) + int a_body1cont10cont1(int loopDepth) { - loopDepth = a_body1cont9(loopDepth); + loopDepth = a_body1cont8(loopDepth); return loopDepth; } - int a_body1cont10cont3(int loopDepth) + int a_body1cont10cont2(int loopDepth) { - #line 2390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_6 = eraseLogData(tr, config.getUidAsKey(), destUidValue, Optional(beginVersion)); - #line 2390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont10cont3when1(__when_expr_6.get(), loopDepth); }; + #line 25113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont10cont2when1(__when_expr_6.get(), loopDepth); }; static_cast<_finishActor6*>(this)->actor_wait_state = 7; - #line 2390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_finishActor6*>(this))); - #line 18885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont10cont1when1(Key const& __destUidValue,int loopDepth) + int a_body1cont10when1(Key const& __destUidValue,int loopDepth) { - #line 2389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" destUidValue = __destUidValue; - #line 18894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont10cont3(loopDepth); + #line 25127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont10cont2(loopDepth); return loopDepth; } - int a_body1cont10cont1when1(Key && __destUidValue,int loopDepth) + int a_body1cont10when1(Key && __destUidValue,int loopDepth) { destUidValue = std::move(__destUidValue); - loopDepth = a_body1cont10cont3(loopDepth); + loopDepth = a_body1cont10cont2(loopDepth); return loopDepth; } @@ -18914,7 +25147,7 @@ class _finishActor6State { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 5); a_exitChoose6(); try { - a_body1cont10cont1when1(value, 0); + a_body1cont10when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -18929,7 +25162,7 @@ class _finishActor6State { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 5); a_exitChoose6(); try { - a_body1cont10cont1when1(std::move(value), 0); + a_body1cont10when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -18954,27 +25187,27 @@ class _finishActor6State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 5); } - int a_body1cont10cont4(Void const& _,int loopDepth) + int a_body1cont10cont3(Void const& _,int loopDepth) { - loopDepth = a_body1cont10cont2(loopDepth); + loopDepth = a_body1cont10cont1(loopDepth); return loopDepth; } - int a_body1cont10cont4(Void && _,int loopDepth) + int a_body1cont10cont3(Void && _,int loopDepth) { - loopDepth = a_body1cont10cont2(loopDepth); + loopDepth = a_body1cont10cont1(loopDepth); return loopDepth; } - int a_body1cont10cont3when1(Void const& _,int loopDepth) + int a_body1cont10cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont10cont4(_, loopDepth); + loopDepth = a_body1cont10cont3(_, loopDepth); return loopDepth; } - int a_body1cont10cont3when1(Void && _,int loopDepth) + int a_body1cont10cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont10cont4(std::move(_), loopDepth); + loopDepth = a_body1cont10cont3(std::move(_), loopDepth); return loopDepth; } @@ -18989,7 +25222,7 @@ class _finishActor6State { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 6); a_exitChoose7(); try { - a_body1cont10cont3when1(value, 0); + a_body1cont10cont2when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -19004,7 +25237,7 @@ class _finishActor6State { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 6); a_exitChoose7(); try { - a_body1cont10cont3when1(std::move(value), 0); + a_body1cont10cont2when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -19031,23 +25264,23 @@ class _finishActor6State { } int a_body1cont11(Void const& _,int loopDepth) { - loopDepth = a_body1cont9(loopDepth); + loopDepth = a_body1cont8(loopDepth); return loopDepth; } int a_body1cont11(Void && _,int loopDepth) { - loopDepth = a_body1cont9(loopDepth); + loopDepth = a_body1cont8(loopDepth); return loopDepth; } - int a_body1cont4when2(Void const& _,int loopDepth) + int a_body1cont3when2(Void const& _,int loopDepth) { loopDepth = a_body1cont11(_, loopDepth); return loopDepth; } - int a_body1cont4when2(Void && _,int loopDepth) + int a_body1cont3when2(Void && _,int loopDepth) { loopDepth = a_body1cont11(std::move(_), loopDepth); @@ -19064,7 +25297,7 @@ class _finishActor6State { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 7); a_exitChoose8(); try { - a_body1cont4when2(value, 0); + a_body1cont3when2(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -19079,7 +25312,7 @@ class _finishActor6State { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 7); a_exitChoose8(); try { - a_body1cont4when2(std::move(value), 0); + a_body1cont3when2(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -19106,11 +25339,11 @@ class _finishActor6State { } int a_body1cont12(Void const& _,int loopDepth) { - #line 2409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupLogsDispatchContinuing") .suppressFor(60) .detail("BackupUID", config.getUid()) .detail("BeginVersion", beginVersion) .detail("EndVersion", endVersion); - #line 2415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor6*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor6State(); static_cast<_finishActor6*>(this)->destroy(); return 0; } - #line 19113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor6*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor6State(); static_cast<_finishActor6*>(this)->finishSendAndDelPromiseRef(); @@ -19120,11 +25353,11 @@ class _finishActor6State { } int a_body1cont12(Void && _,int loopDepth) { - #line 2409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupLogsDispatchContinuing") .suppressFor(60) .detail("BackupUID", config.getUid()) .detail("BeginVersion", beginVersion) .detail("EndVersion", endVersion); - #line 2415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor6*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor6State(); static_cast<_finishActor6*>(this)->destroy(); return 0; } - #line 19127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor6*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor6State(); static_cast<_finishActor6*>(this)->finishSendAndDelPromiseRef(); @@ -19132,13 +25365,13 @@ class _finishActor6State { return loopDepth; } - int a_body1cont9when1(Void const& _,int loopDepth) + int a_body1cont8when1(Void const& _,int loopDepth) { loopDepth = a_body1cont12(_, loopDepth); return loopDepth; } - int a_body1cont9when1(Void && _,int loopDepth) + int a_body1cont8when1(Void && _,int loopDepth) { loopDepth = a_body1cont12(std::move(_), loopDepth); @@ -19155,7 +25388,7 @@ class _finishActor6State { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 8); a_exitChoose9(); try { - a_body1cont9when1(value, 0); + a_body1cont8when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -19170,7 +25403,7 @@ class _finishActor6State { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 8); a_exitChoose9(); try { - a_body1cont9when1(std::move(value), 0); + a_body1cont8when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -19195,48 +25428,48 @@ class _finishActor6State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 8); } - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 2312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference onDone; - #line 2313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version prevBeginVersion; - #line 2314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version beginVersion; - #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig config; - #line 2318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bool stopWhenDone; - #line 2319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional restorableVersion; - #line 2320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" EBackupState backupState; - #line 2321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional tag; - #line 2322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional latestSnapshotEndVersion; - #line 2323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional partitionedLog; - #line 2353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version endVersion; - #line 2363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference logDispatchBatchFuture; - #line 2366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int priority; - #line 2389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key destUidValue; - #line 19234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor6 final : public Actor, public ActorCallback< _finishActor6, 0, Void >, public ActorCallback< _finishActor6, 1, Void >, public ActorCallback< _finishActor6, 2, Void >, public ActorCallback< _finishActor6, 3, Void >, public ActorCallback< _finishActor6, 4, Void >, public ActorCallback< _finishActor6, 5, Key >, public ActorCallback< _finishActor6, 6, Void >, public ActorCallback< _finishActor6, 7, Void >, public ActorCallback< _finishActor6, 8, Void >, public FastAllocated<_finishActor6>, public _finishActor6State<_finishActor6> { - #line 19239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor6>::operator new; using FastAllocated<_finishActor6>::operator delete; @@ -19253,9 +25486,9 @@ friend struct ActorCallback< _finishActor6, 5, Key >; friend struct ActorCallback< _finishActor6, 6, Void >; friend struct ActorCallback< _finishActor6, 7, Void >; friend struct ActorCallback< _finishActor6, 8, Void >; - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor6(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 19258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _finishActor6State<_finishActor6>(tr, taskBucket, futureBucket, task) { @@ -19286,45 +25519,45 @@ friend struct ActorCallback< _finishActor6, 8, Void >; } }; - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _finishActor6(tr, taskBucket, futureBucket, task)); - #line 19293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 19298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor4State { - #line 19304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor4State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,int const& priority,Version const& prevBeginVersion,Version const& beginVersion,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference(),Version const& scheduledVersion = invalidVersion) - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" parentTask(parentTask), - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" priority(priority), - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" prevBeginVersion(prevBeginVersion), - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion(beginVersion), - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" completionKey(completionKey), - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" waitFor(waitFor), - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" scheduledVersion(scheduledVersion) - #line 19327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -19337,16 +25570,16 @@ class AddTaskActor4State { int a_body1(int loopDepth=0) { try { - #line 2427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = addBackupTask( BackupLogsDispatchTask::name, BackupLogsDispatchTask::version, tr, taskBucket, completionKey, BackupConfig(parentTask), waitFor, [=](Reference task) { Params.prevBeginVersion().set(task, prevBeginVersion); Params.beginVersion().set(task, beginVersion); if (scheduledVersion != invalidVersion) { ReservedTaskParams::scheduledVersion().set(task, scheduledVersion); } }, priority); - #line 2427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 19344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -19367,9 +25600,9 @@ class AddTaskActor4State { } int a_body1cont1(Key const& key,int loopDepth) { - #line 2443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor4State(); static_cast(this)->destroy(); return 0; } - #line 19372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(key); this->~AddTaskActor4State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -19379,9 +25612,9 @@ class AddTaskActor4State { } int a_body1cont1(Key && key,int loopDepth) { - #line 2443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor4State(); static_cast(this)->destroy(); return 0; } - #line 19384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(key); this->~AddTaskActor4State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -19452,30 +25685,30 @@ class AddTaskActor4State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); } - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference parentTask; - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int priority; - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version prevBeginVersion; - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version beginVersion; - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference waitFor; - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version scheduledVersion; - #line 19473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor4 final : public Actor, public ActorCallback< AddTaskActor4, 0, Key >, public FastAllocated, public AddTaskActor4State { - #line 19478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -19484,9 +25717,9 @@ class AddTaskActor4 final : public Actor, public ActorCallback< AddTaskActo void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor4, 0, Key >; - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor4(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,int const& priority,Version const& prevBeginVersion,Version const& beginVersion,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference(),Version const& scheduledVersion = invalidVersion) - #line 19489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), AddTaskActor4State(tr, taskBucket, parentTask, priority, prevBeginVersion, beginVersion, completionKey, waitFor, scheduledVersion) { @@ -19509,14 +25742,14 @@ friend struct ActorCallback< AddTaskActor4, 0, Key >; } }; - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, int const& priority, Version const& prevBeginVersion, Version const& beginVersion, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference(), Version const& scheduledVersion = invalidVersion ) { - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new AddTaskActor4(tr, taskBucket, parentTask, priority, prevBeginVersion, beginVersion, completionKey, waitFor, scheduledVersion)); - #line 19516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StringRef getName() const override { return name; }; @@ -19533,7 +25766,7 @@ friend struct ActorCallback< AddTaskActor4, 0, Key >; return _finish(tr, tb, fb, task); }; }; -StringRef BackupLogsDispatchTask::name = LiteralStringRef("file_backup_dispatch_logs_5.2"); +StringRef BackupLogsDispatchTask::name = "file_backup_dispatch_logs_5.2"_sr; REGISTER_TASKFUNC(BackupLogsDispatchTask); struct FileBackupFinishedTask : BackupTaskFuncBase { @@ -19542,26 +25775,26 @@ struct FileBackupFinishedTask : BackupTaskFuncBase { StringRef getName() const override { return name; }; - #line 19545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor7State { - #line 19551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor7State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task) - #line 19564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -19574,16 +25807,16 @@ class _finishActor7State { int a_body1(int loopDepth=0) { try { - #line 2474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(tr->getDatabase(), task, FileBackupFinishedTask::name, FileBackupFinishedTask::version); - #line 2474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor7*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 19581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor7*>(this)->actor_wait_state = 1; - #line 2474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor7*>(this))); - #line 19586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -19604,44 +25837,44 @@ class _finishActor7State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backup = BackupConfig(task); - #line 2477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" uid = backup.getUid(); - #line 2479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); - #line 2480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = backup.destUidValue().getOrThrow(tr); - #line 2480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor7*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 19617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor7*>(this)->actor_wait_state = 2; - #line 2480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor7*>(this))); - #line 19622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backup = BackupConfig(task); - #line 2477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" uid = backup.getUid(); - #line 2479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); - #line 2480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = backup.destUidValue().getOrThrow(tr); - #line 2480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor7*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 19639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor7*>(this)->actor_wait_state = 2; - #line 2480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor7*>(this))); - #line 19644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -19711,25 +25944,25 @@ class _finishActor7State { } int a_body1cont2(int loopDepth) { - #line 2482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = eraseLogData(tr, backup.getUidAsKey(), destUidValue) && clearBackupStartID(tr, uid); - #line 2482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor7*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 19718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor7*>(this)->actor_wait_state = 3; - #line 2482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor7*>(this))); - #line 19723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1when1(Key const& __destUidValue,int loopDepth) { - #line 2480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" destUidValue = __destUidValue; - #line 19732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 25965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -19794,36 +26027,36 @@ class _finishActor7State { } int a_body1cont3(Void const& _,int loopDepth) { - #line 2484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backup.stateEnum().set(tr, EBackupState::STATE_COMPLETED); - #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = taskBucket->finish(tr, task); - #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor7*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 19803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor7*>(this)->actor_wait_state = 4; - #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor7*>(this))); - #line 19808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - #line 2484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backup.stateEnum().set(tr, EBackupState::STATE_COMPLETED); - #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = taskBucket->finish(tr, task); - #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor7*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 19821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor7*>(this)->actor_wait_state = 4; - #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor7*>(this))); - #line 19826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -19893,11 +26126,11 @@ class _finishActor7State { } int a_body1cont4(Void const& _,int loopDepth) { - #line 2488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupFinished").detail("BackupUID", uid); - #line 2490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor7*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor7State(); static_cast<_finishActor7*>(this)->destroy(); return 0; } - #line 19900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor7*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor7State(); static_cast<_finishActor7*>(this)->finishSendAndDelPromiseRef(); @@ -19907,11 +26140,11 @@ class _finishActor7State { } int a_body1cont4(Void && _,int loopDepth) { - #line 2488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileBackupFinished").detail("BackupUID", uid); - #line 2490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor7*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor7State(); static_cast<_finishActor7*>(this)->destroy(); return 0; } - #line 19914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor7*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor7State(); static_cast<_finishActor7*>(this)->finishSendAndDelPromiseRef(); @@ -19982,26 +26215,26 @@ class _finishActor7State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 3); } - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig backup; - #line 2477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UID uid; - #line 2480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key destUidValue; - #line 19999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor7 final : public Actor, public ActorCallback< _finishActor7, 0, Void >, public ActorCallback< _finishActor7, 1, Key >, public ActorCallback< _finishActor7, 2, Void >, public ActorCallback< _finishActor7, 3, Void >, public FastAllocated<_finishActor7>, public _finishActor7State<_finishActor7> { - #line 20004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor7>::operator new; using FastAllocated<_finishActor7>::operator delete; @@ -20013,9 +26246,9 @@ friend struct ActorCallback< _finishActor7, 0, Void >; friend struct ActorCallback< _finishActor7, 1, Key >; friend struct ActorCallback< _finishActor7, 2, Void >; friend struct ActorCallback< _finishActor7, 3, Void >; - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor7(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 20018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _finishActor7State<_finishActor7>(tr, taskBucket, futureBucket, task) { @@ -20041,37 +26274,37 @@ friend struct ActorCallback< _finishActor7, 3, Void >; } }; - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _finishActor7(tr, taskBucket, futureBucket, task)); - #line 20048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 20053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor5State { - #line 20059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor5State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" parentTask(parentTask), - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" completionKey(completionKey), - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" waitFor(waitFor) - #line 20074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -20084,16 +26317,16 @@ class AddTaskActor5State { int a_body1(int loopDepth=0) { try { - #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = addBackupTask(FileBackupFinishedTask::name, FileBackupFinishedTask::version, tr, taskBucket, completionKey, BackupConfig(parentTask), waitFor); - #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 20091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 20096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -20114,9 +26347,9 @@ class AddTaskActor5State { } int a_body1cont1(Key const& key,int loopDepth) { - #line 2505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor5State(); static_cast(this)->destroy(); return 0; } - #line 20119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(key); this->~AddTaskActor5State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -20126,9 +26359,9 @@ class AddTaskActor5State { } int a_body1cont1(Key && key,int loopDepth) { - #line 2505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor5State(); static_cast(this)->destroy(); return 0; } - #line 20131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(key); this->~AddTaskActor5State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -20199,22 +26432,22 @@ class AddTaskActor5State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); } - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference parentTask; - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference waitFor; - #line 20212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor5 final : public Actor, public ActorCallback< AddTaskActor5, 0, Key >, public FastAllocated, public AddTaskActor5State { - #line 20217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -20223,9 +26456,9 @@ class AddTaskActor5 final : public Actor, public ActorCallback< AddTaskActo void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor5, 0, Key >; - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor5(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 20228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), AddTaskActor5State(tr, taskBucket, parentTask, completionKey, waitFor) { @@ -20248,14 +26481,14 @@ friend struct ActorCallback< AddTaskActor5, 0, Key >; } }; - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new AddTaskActor5(tr, taskBucket, parentTask, completionKey, waitFor)); - #line 20255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future execute(Database cx, Reference tb, @@ -20270,48 +26503,50 @@ friend struct ActorCallback< AddTaskActor5, 0, Key >; return _finish(tr, tb, fb, task); }; }; -StringRef FileBackupFinishedTask::name = LiteralStringRef("file_backup_finished_5.2"); +StringRef FileBackupFinishedTask::name = "file_backup_finished_5.2"_sr; REGISTER_TASKFUNC(FileBackupFinishedTask); struct BackupSnapshotManifest : BackupTaskFuncBase { static StringRef name; static constexpr uint32_t version = 1; static struct { - static TaskParam endVersion() { return LiteralStringRef(__FUNCTION__); } + static TaskParam endVersion() { return __FUNCTION__sr; } } Params; - #line 20283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _executeActor3State { - #line 20289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _executeActor3State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : cx(cx), - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config(task), - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc(), - #line 2538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + dbConfig(), + #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr(new ReadYourWritesTransaction(cx)), - #line 2542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" localmap(), - #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" startKey(), - #line 2544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" batchSize(BUGGIFY ? 1 : 1000000) - #line 20314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -20324,9 +26559,9 @@ class _executeActor3State { int a_body1(int loopDepth=0) { try { - #line 2546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 20329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -20347,75 +26582,75 @@ class _executeActor3State { } int a_body1cont1(int loopDepth) { - #line 2576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::vector files; - #line 2577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::vector> beginEndKeys; - #line 2578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + files = std::vector(); + #line 3269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginEndKeys = std::vector>(); + #line 3270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" maxVer = 0; - #line 2579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" minVer = std::numeric_limits::max(); - #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" totalBytes = 0; - #line 2582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!localmap.empty()) - #line 20362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" auto ri = localmap.rbegin(); - #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" auto i = (++ri).base(); - #line 2587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(;1;) { - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" const BackupConfig::RangeSlice& r = i->second; - #line 2591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" files.push_back(r.fileName); - #line 2594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginEndKeys.emplace_back(i->second.begin, i->first); - #line 2597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (r.version < minVer) - #line 20378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" minVer = r.version; - #line 20382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (r.version > maxVer) - #line 20386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" maxVer = r.version; - #line 20390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" totalBytes += r.fileSize; - #line 2608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" i = localmap.upper_bound(i->second.begin); - #line 2610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (i == localmap.begin()) - #line 20398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { break; } - #line 2612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" --i; - #line 20404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } } - #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.endVersion().set(task, maxVer); - #line 2617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = bc->writeKeyspaceSnapshotFile(files, beginEndKeys, totalBytes); - #line 2617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_5 = bc->writeKeyspaceSnapshotFile(files, beginEndKeys, totalBytes, dbConfig.encryptionAtRestMode.isEncryptionEnabled() ? IncludeKeyRangeMap::False : IncludeKeyRangeMap::True); + #line 3312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 20413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont1when1(__when_expr_4.get(), loopDepth); }; - static_cast<_executeActor3*>(this)->actor_wait_state = 5; - #line 2617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); - #line 20418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont1when1(__when_expr_5.get(), loopDepth); }; + static_cast<_executeActor3*>(this)->actor_wait_state = 6; + #line 3312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); + #line 26653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -20430,20 +26665,20 @@ class _executeActor3State { int a_body1loopBody1(int loopDepth) { try { - #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = taskBucket->keepRunning(tr, task); - #line 2551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor3*>(this)->actor_wait_state = 1; - #line 2551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); - #line 20446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -20476,16 +26711,16 @@ class _executeActor3State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_3 = tr->onError(e); - #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_4 = tr->onError(e); + #line 3264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 20483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; - static_cast<_executeActor3*>(this)->actor_wait_state = 4; - #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); - #line 20488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 26718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; + static_cast<_executeActor3*>(this)->actor_wait_state = 5; + #line 3264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); + #line 26723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -20498,51 +26733,33 @@ class _executeActor3State { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 2553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!bc) - #line 20503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_1 = config.backupContainer().getOrThrow(tr); - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast<_executeActor3*>(this)->actor_wait_state = 2; - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast<_executeActor3*>(this))); - #line 20514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1loopBody1cont3(loopDepth); - } + #line 3243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = store(dbConfig, getDatabaseConfiguration(cx)); + #line 3243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 26740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast<_executeActor3*>(this)->actor_wait_state = 2; + #line 3243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); + #line 26745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 2553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!bc) - #line 20528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_1 = config.backupContainer().getOrThrow(tr); - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast<_executeActor3*>(this)->actor_wait_state = 2; - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast<_executeActor3*>(this))); - #line 20539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1loopBody1cont3(loopDepth); - } + #line 3243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = store(dbConfig, getDatabaseConfiguration(cx)); + #line 3243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 26756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast<_executeActor3*>(this)->actor_wait_state = 2; + #line 3243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); + #line 26761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } @@ -20609,59 +26826,75 @@ class _executeActor3State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 0); } - int a_body1loopBody1cont3(int loopDepth) - { - #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = config.snapshotRangeFileMap().getRange(tr, startKey, {}, batchSize); - #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast<_executeActor3*>(this)->actor_wait_state = 3; - #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); - #line 20623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont4(Reference const& _bc,int loopDepth) + int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 2556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bc = getBackupContainerWithProxy(_bc); - #line 20632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); + #line 3245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!bc) + #line 26833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 3247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_2 = config.backupContainer().getOrThrow(tr); + #line 3247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 26839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast<_executeActor3*>(this)->actor_wait_state = 3; + #line 3247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast<_executeActor3*>(this))); + #line 26844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont4(loopDepth); + } return loopDepth; } - int a_body1loopBody1cont4(Reference && _bc,int loopDepth) + int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 2556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bc = getBackupContainerWithProxy(_bc); - #line 20641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); + #line 3245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!bc) + #line 26858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 3247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_2 = config.backupContainer().getOrThrow(tr); + #line 3247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 26864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast<_executeActor3*>(this)->actor_wait_state = 3; + #line 3247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast<_executeActor3*>(this))); + #line 26869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont4(loopDepth); + } return loopDepth; } - int a_body1loopBody1cont2when1(Reference const& _bc,int loopDepth) + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(_bc, loopDepth); + loopDepth = a_body1loopBody1cont3(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(Reference && _bc,int loopDepth) + int a_body1loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(std::move(_bc), loopDepth); + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { if (static_cast<_executeActor3*>(this)->actor_wait_state > 0) static_cast<_executeActor3*>(this)->actor_wait_state = 0; - static_cast<_executeActor3*>(this)->ActorCallback< _executeActor3, 1, Reference >::remove(); + static_cast<_executeActor3*>(this)->ActorCallback< _executeActor3, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< _executeActor3, 1, Reference >*,Reference const& value) + void a_callback_fire(ActorCallback< _executeActor3, 1, Void >*,Void const& value) { fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); a_exitChoose2(); @@ -20676,7 +26909,7 @@ class _executeActor3State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< _executeActor3, 1, Reference >*,Reference && value) + void a_callback_fire(ActorCallback< _executeActor3, 1, Void >*,Void && value) { fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); a_exitChoose2(); @@ -20691,7 +26924,7 @@ class _executeActor3State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< _executeActor3, 1, Reference >*,Error err) + void a_callback_error(ActorCallback< _executeActor3, 1, Void >*,Error err) { fdb_probe_actor_enter("_execute", reinterpret_cast(this), 1); a_exitChoose2(); @@ -20706,71 +26939,59 @@ class _executeActor3State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 1); } - int a_body1loopBody1cont6(BackupConfig::RangeFileMapT::PairsType const& rangeresults,int loopDepth) + int a_body1loopBody1cont4(int loopDepth) { - #line 2562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for( auto& p : rangeresults ) { - #line 2563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - localmap.insert(p); - #line 20715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 2566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (rangeresults.size() < batchSize) - #line 20719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break - } - #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - startKey = keyAfter(rangeresults.back().first); - #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->reset(); - #line 20727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont10(loopDepth); + #line 3251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = config.snapshotRangeFileMap().getRange(tr, startKey, {}, batchSize); + #line 3251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor3*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 26948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; + static_cast<_executeActor3*>(this)->actor_wait_state = 4; + #line 3251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor3*>(this))); + #line 26953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont6(BackupConfig::RangeFileMapT::PairsType && rangeresults,int loopDepth) + int a_body1loopBody1cont5(Reference const& _bc,int loopDepth) { - #line 2562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for( auto& p : rangeresults ) { - #line 2563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - localmap.insert(p); - #line 20738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 2566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (rangeresults.size() < batchSize) - #line 20742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break - } - #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - startKey = keyAfter(rangeresults.back().first); - #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->reset(); - #line 20750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont10(loopDepth); + #line 3248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bc = getBackupContainerWithProxy(_bc); + #line 26962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont4(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5(Reference && _bc,int loopDepth) + { + #line 3248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bc = getBackupContainerWithProxy(_bc); + #line 26971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont4(loopDepth); return loopDepth; } - int a_body1loopBody1cont3when1(BackupConfig::RangeFileMapT::PairsType const& rangeresults,int loopDepth) + int a_body1loopBody1cont3when1(Reference const& _bc,int loopDepth) { - loopDepth = a_body1loopBody1cont6(rangeresults, loopDepth); + loopDepth = a_body1loopBody1cont5(_bc, loopDepth); return loopDepth; } - int a_body1loopBody1cont3when1(BackupConfig::RangeFileMapT::PairsType && rangeresults,int loopDepth) + int a_body1loopBody1cont3when1(Reference && _bc,int loopDepth) { - loopDepth = a_body1loopBody1cont6(std::move(rangeresults), loopDepth); + loopDepth = a_body1loopBody1cont5(std::move(_bc), loopDepth); return loopDepth; } void a_exitChoose3() { if (static_cast<_executeActor3*>(this)->actor_wait_state > 0) static_cast<_executeActor3*>(this)->actor_wait_state = 0; - static_cast<_executeActor3*>(this)->ActorCallback< _executeActor3, 2, BackupConfig::RangeFileMapT::PairsType >::remove(); + static_cast<_executeActor3*>(this)->ActorCallback< _executeActor3, 2, Reference >::remove(); } - void a_callback_fire(ActorCallback< _executeActor3, 2, BackupConfig::RangeFileMapT::PairsType >*,BackupConfig::RangeFileMapT::PairsType const& value) + void a_callback_fire(ActorCallback< _executeActor3, 2, Reference >*,Reference const& value) { fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); a_exitChoose3(); @@ -20785,7 +27006,7 @@ class _executeActor3State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< _executeActor3, 2, BackupConfig::RangeFileMapT::PairsType >*,BackupConfig::RangeFileMapT::PairsType && value) + void a_callback_fire(ActorCallback< _executeActor3, 2, Reference >*,Reference && value) { fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); a_exitChoose3(); @@ -20800,7 +27021,7 @@ class _executeActor3State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< _executeActor3, 2, BackupConfig::RangeFileMapT::PairsType >*,Error err) + void a_callback_error(ActorCallback< _executeActor3, 2, Reference >*,Error err) { fdb_probe_actor_enter("_execute", reinterpret_cast(this), 2); a_exitChoose3(); @@ -20815,7 +27036,116 @@ class _executeActor3State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 2); } - int a_body1loopBody1cont10(int loopDepth) + int a_body1loopBody1cont7(BackupConfig::RangeFileMapT::RangeResultType const& rangeresults,int loopDepth) + { + #line 3254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto& p : rangeresults.results ) { + #line 3255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + localmap.insert(p); + #line 27045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 3258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!rangeresults.more) + #line 27049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 3261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + startKey = keyAfter(rangeresults.results.back().first); + #line 3262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->reset(); + #line 27057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont11(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont7(BackupConfig::RangeFileMapT::RangeResultType && rangeresults,int loopDepth) + { + #line 3254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto& p : rangeresults.results ) { + #line 3255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + localmap.insert(p); + #line 27068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 3258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!rangeresults.more) + #line 27072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 3261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + startKey = keyAfter(rangeresults.results.back().first); + #line 3262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->reset(); + #line 27080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont11(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4when1(BackupConfig::RangeFileMapT::RangeResultType const& rangeresults,int loopDepth) + { + loopDepth = a_body1loopBody1cont7(rangeresults, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4when1(BackupConfig::RangeFileMapT::RangeResultType && rangeresults,int loopDepth) + { + loopDepth = a_body1loopBody1cont7(std::move(rangeresults), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast<_executeActor3*>(this)->actor_wait_state > 0) static_cast<_executeActor3*>(this)->actor_wait_state = 0; + static_cast<_executeActor3*>(this)->ActorCallback< _executeActor3, 3, BackupConfig::RangeFileMapT::RangeResultType >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor3, 3, BackupConfig::RangeFileMapT::RangeResultType >*,BackupConfig::RangeFileMapT::RangeResultType const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont4when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< _executeActor3, 3, BackupConfig::RangeFileMapT::RangeResultType >*,BackupConfig::RangeFileMapT::RangeResultType && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont4when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< _executeActor3, 3, BackupConfig::RangeFileMapT::RangeResultType >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 3); + + } + int a_body1loopBody1cont11(int loopDepth) { try { loopDepth = a_body1loopBody1cont1(loopDepth); @@ -20852,16 +27182,16 @@ class _executeActor3State { return loopDepth; } - void a_exitChoose4() + void a_exitChoose5() { if (static_cast<_executeActor3*>(this)->actor_wait_state > 0) static_cast<_executeActor3*>(this)->actor_wait_state = 0; - static_cast<_executeActor3*>(this)->ActorCallback< _executeActor3, 3, Void >::remove(); + static_cast<_executeActor3*>(this)->ActorCallback< _executeActor3, 4, Void >::remove(); } - void a_callback_fire(ActorCallback< _executeActor3, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< _executeActor3, 4, Void >*,Void const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 4); + a_exitChoose5(); try { a_body1loopBody1Catch1when1(value, 0); } @@ -20870,13 +27200,13 @@ class _executeActor3State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 3); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< _executeActor3, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< _executeActor3, 4, Void >*,Void && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 4); + a_exitChoose5(); try { a_body1loopBody1Catch1when1(std::move(value), 0); } @@ -20885,13 +27215,13 @@ class _executeActor3State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 3); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< _executeActor3, 3, Void >*,Error err) + void a_callback_error(ActorCallback< _executeActor3, 4, Void >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 4); + a_exitChoose5(); try { a_body1Catch1(err, 0); } @@ -20900,16 +27230,16 @@ class _executeActor3State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 3); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 4); } int a_body1cont2(Void const& _,int loopDepth) { - #line 2619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevInfo, "FileBackupWroteSnapshotManifest") .detail("BackupUID", config.getUid()) .detail("BeginVersion", minVer) .detail("EndVersion", maxVer) .detail("TotalBytes", totalBytes); - #line 2625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor3*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->destroy(); return 0; } - #line 20912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor3*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->finishSendAndDelPromiseRef(); @@ -20919,11 +27249,11 @@ class _executeActor3State { } int a_body1cont2(Void && _,int loopDepth) { - #line 2619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevInfo, "FileBackupWroteSnapshotManifest") .detail("BackupUID", config.getUid()) .detail("BeginVersion", minVer) .detail("EndVersion", maxVer) .detail("TotalBytes", totalBytes); - #line 2625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor3*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->destroy(); return 0; } - #line 20926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor3*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor3State(); static_cast<_executeActor3*>(this)->finishSendAndDelPromiseRef(); @@ -20943,16 +27273,16 @@ class _executeActor3State { return loopDepth; } - void a_exitChoose5() + void a_exitChoose6() { if (static_cast<_executeActor3*>(this)->actor_wait_state > 0) static_cast<_executeActor3*>(this)->actor_wait_state = 0; - static_cast<_executeActor3*>(this)->ActorCallback< _executeActor3, 4, Void >::remove(); + static_cast<_executeActor3*>(this)->ActorCallback< _executeActor3, 5, Void >::remove(); } - void a_callback_fire(ActorCallback< _executeActor3, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< _executeActor3, 5, Void >*,Void const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 5); + a_exitChoose6(); try { a_body1cont1when1(value, 0); } @@ -20961,13 +27291,13 @@ class _executeActor3State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 4); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 5); } - void a_callback_fire(ActorCallback< _executeActor3, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< _executeActor3, 5, Void >*,Void && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 5); + a_exitChoose6(); try { a_body1cont1when1(std::move(value), 0); } @@ -20976,13 +27306,13 @@ class _executeActor3State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 4); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 5); } - void a_callback_error(ActorCallback< _executeActor3, 4, Void >*,Error err) + void a_callback_error(ActorCallback< _executeActor3, 5, Void >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 5); + a_exitChoose6(); try { a_body1Catch1(err, 0); } @@ -20991,41 +27321,47 @@ class _executeActor3State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 4); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 5); } - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig config; - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference bc; - #line 2538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DatabaseConfiguration dbConfig; + #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::map localmap; - #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key startKey; - #line 2544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int batchSize; - #line 2578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::vector files; + #line 3269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::vector> beginEndKeys; + #line 3270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version maxVer; - #line 2579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version minVer; - #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t totalBytes; - #line 21023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class _executeActor3 final : public Actor, public ActorCallback< _executeActor3, 0, Void >, public ActorCallback< _executeActor3, 1, Reference >, public ActorCallback< _executeActor3, 2, BackupConfig::RangeFileMapT::PairsType >, public ActorCallback< _executeActor3, 3, Void >, public ActorCallback< _executeActor3, 4, Void >, public FastAllocated<_executeActor3>, public _executeActor3State<_executeActor3> { - #line 21028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _executeActor3 final : public Actor, public ActorCallback< _executeActor3, 0, Void >, public ActorCallback< _executeActor3, 1, Void >, public ActorCallback< _executeActor3, 2, Reference >, public ActorCallback< _executeActor3, 3, BackupConfig::RangeFileMapT::RangeResultType >, public ActorCallback< _executeActor3, 4, Void >, public ActorCallback< _executeActor3, 5, Void >, public FastAllocated<_executeActor3>, public _executeActor3State<_executeActor3> { + #line 27364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor3>::operator new; using FastAllocated<_executeActor3>::operator delete; @@ -21034,13 +27370,14 @@ class _executeActor3 final : public Actor, public ActorCallback< _executeA void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< _executeActor3, 0, Void >; -friend struct ActorCallback< _executeActor3, 1, Reference >; -friend struct ActorCallback< _executeActor3, 2, BackupConfig::RangeFileMapT::PairsType >; -friend struct ActorCallback< _executeActor3, 3, Void >; +friend struct ActorCallback< _executeActor3, 1, Void >; +friend struct ActorCallback< _executeActor3, 2, Reference >; +friend struct ActorCallback< _executeActor3, 3, BackupConfig::RangeFileMapT::RangeResultType >; friend struct ActorCallback< _executeActor3, 4, Void >; - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +friend struct ActorCallback< _executeActor3, 5, Void >; + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _executeActor3(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 21043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _executeActor3State<_executeActor3>(cx, taskBucket, futureBucket, task) { @@ -21059,43 +27396,44 @@ friend struct ActorCallback< _executeActor3, 4, Void >; this->actor_wait_state = -1; switch (wait_state) { case 1: this->a_callback_error((ActorCallback< _executeActor3, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< _executeActor3, 1, Reference >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< _executeActor3, 2, BackupConfig::RangeFileMapT::PairsType >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< _executeActor3, 3, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< _executeActor3, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< _executeActor3, 2, Reference >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< _executeActor3, 3, BackupConfig::RangeFileMapT::RangeResultType >*)0, actor_cancelled()); break; case 5: this->a_callback_error((ActorCallback< _executeActor3, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< _executeActor3, 5, Void >*)0, actor_cancelled()); break; } } }; - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _executeActor3(cx, taskBucket, futureBucket, task)); - #line 21074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 21079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor8State { - #line 21085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor8State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task) - #line 21098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -21108,16 +27446,16 @@ class _finishActor8State { int a_body1(int loopDepth=0) { try { - #line 2632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(tr->getDatabase(), task, BackupSnapshotManifest::name, BackupSnapshotManifest::version); - #line 2632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor8*>(this)->actor_wait_state = 1; - #line 2632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor8*>(this))); - #line 21120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -21138,60 +27476,60 @@ class _finishActor8State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 2634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config = BackupConfig(task); - #line 2637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.latestSnapshotEndVersion().set(tr, Params.endVersion().get(task)); - #line 2639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" stopWhenDone = bool(); - #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupState = EBackupState(); - #line 2641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restorableVersion = Optional(); - #line 2642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" firstSnapshotEndVersion = Optional(); - #line 2643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tag = Optional(); - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = store(stopWhenDone, config.stopWhenDone().getOrThrow(tr)) && store(backupState, config.stateEnum().getOrThrow(tr)) && store(restorableVersion, config.getLatestRestorableVersion(tr)) && store(firstSnapshotEndVersion, config.firstSnapshotEndVersion().get(tr)) && store(tag, config.tag().get(tr)); - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor8*>(this)->actor_wait_state = 2; - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor8*>(this))); - #line 21164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 2634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config = BackupConfig(task); - #line 2637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.latestSnapshotEndVersion().set(tr, Params.endVersion().get(task)); - #line 2639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" stopWhenDone = bool(); - #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupState = EBackupState(); - #line 2641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restorableVersion = Optional(); - #line 2642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" firstSnapshotEndVersion = Optional(); - #line 2643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tag = Optional(); - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = store(stopWhenDone, config.stopWhenDone().getOrThrow(tr)) && store(backupState, config.stateEnum().getOrThrow(tr)) && store(restorableVersion, config.getLatestRestorableVersion(tr)) && store(firstSnapshotEndVersion, config.firstSnapshotEndVersion().get(tr)) && store(tag, config.tag().get(tr)); - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor8*>(this)->actor_wait_state = 2; - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor8*>(this))); - #line 21194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -21261,60 +27599,60 @@ class _finishActor8State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 2652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (restorableVersion.present() && tag.present()) - #line 21266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" FileBackupAgent().setLastRestorable(tr, StringRef(tag.get()), restorableVersion.get()); - #line 21270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!firstSnapshotEndVersion.present()) - #line 21274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.firstSnapshotEndVersion().set(tr, Params.endVersion().get(task)); - #line 21278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (restorableVersion.present() && backupState != EBackupState::STATE_RUNNING_DIFFERENTIAL) - #line 21282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.stateEnum().set(tr, EBackupState::STATE_RUNNING_DIFFERENTIAL); - #line 21286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference snapshotDoneFuture = task->getDoneFuture(futureBucket); - #line 2666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!stopWhenDone) - #line 21292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = config.initNewSnapshot(tr) && success(BackupSnapshotDispatchTask::addTask( tr, taskBucket, task, 1, TaskCompletionKey::signal(snapshotDoneFuture))); - #line 2667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor8*>(this)->actor_wait_state = 3; - #line 2667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor8*>(this))); - #line 21303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = snapshotDoneFuture->set(tr, taskBucket); - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont2when2(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor8*>(this)->actor_wait_state = 4; - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor8*>(this))); - #line 21317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -21322,60 +27660,60 @@ class _finishActor8State { } int a_body1cont2(Void && _,int loopDepth) { - #line 2652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (restorableVersion.present() && tag.present()) - #line 21327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" FileBackupAgent().setLastRestorable(tr, StringRef(tag.get()), restorableVersion.get()); - #line 21331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!firstSnapshotEndVersion.present()) - #line 21335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.firstSnapshotEndVersion().set(tr, Params.endVersion().get(task)); - #line 21339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (restorableVersion.present() && backupState != EBackupState::STATE_RUNNING_DIFFERENTIAL) - #line 21343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.stateEnum().set(tr, EBackupState::STATE_RUNNING_DIFFERENTIAL); - #line 21347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference snapshotDoneFuture = task->getDoneFuture(futureBucket); - #line 2666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!stopWhenDone) - #line 21353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = config.initNewSnapshot(tr) && success(BackupSnapshotDispatchTask::addTask( tr, taskBucket, task, 1, TaskCompletionKey::signal(snapshotDoneFuture))); - #line 2667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor8*>(this)->actor_wait_state = 3; - #line 2667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor8*>(this))); - #line 21364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = snapshotDoneFuture->set(tr, taskBucket); - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont2when2(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor8*>(this)->actor_wait_state = 4; - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor8*>(this))); - #line 21378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -21446,16 +27784,16 @@ class _finishActor8State { } int a_body1cont3(int loopDepth) { - #line 2675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = taskBucket->finish(tr, task); - #line 2675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor8*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont3when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor8*>(this)->actor_wait_state = 5; - #line 2675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor8*>(this))); - #line 21458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -21612,9 +27950,9 @@ class _finishActor8State { } int a_body1cont9(Void const& _,int loopDepth) { - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor8*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor8State(); static_cast<_finishActor8*>(this)->destroy(); return 0; } - #line 21617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor8*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor8State(); static_cast<_finishActor8*>(this)->finishSendAndDelPromiseRef(); @@ -21624,9 +27962,9 @@ class _finishActor8State { } int a_body1cont9(Void && _,int loopDepth) { - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor8*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor8State(); static_cast<_finishActor8*>(this)->destroy(); return 0; } - #line 21629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 27967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor8*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor8State(); static_cast<_finishActor8*>(this)->finishSendAndDelPromiseRef(); @@ -21697,32 +28035,32 @@ class _finishActor8State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 4); } - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 2634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig config; - #line 2639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bool stopWhenDone; - #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" EBackupState backupState; - #line 2641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional restorableVersion; - #line 2642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional firstSnapshotEndVersion; - #line 2643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional tag; - #line 21720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor8 final : public Actor, public ActorCallback< _finishActor8, 0, Void >, public ActorCallback< _finishActor8, 1, Void >, public ActorCallback< _finishActor8, 2, Void >, public ActorCallback< _finishActor8, 3, Void >, public ActorCallback< _finishActor8, 4, Void >, public FastAllocated<_finishActor8>, public _finishActor8State<_finishActor8> { - #line 21725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor8>::operator new; using FastAllocated<_finishActor8>::operator delete; @@ -21735,9 +28073,9 @@ friend struct ActorCallback< _finishActor8, 1, Void >; friend struct ActorCallback< _finishActor8, 2, Void >; friend struct ActorCallback< _finishActor8, 3, Void >; friend struct ActorCallback< _finishActor8, 4, Void >; - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor8(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 21740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _finishActor8State<_finishActor8>(tr, taskBucket, futureBucket, task) { @@ -21764,37 +28102,37 @@ friend struct ActorCallback< _finishActor8, 4, Void >; } }; - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _finishActor8(tr, taskBucket, futureBucket, task)); - #line 21771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 21776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor6State { - #line 21782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor6State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" parentTask(parentTask), - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" completionKey(completionKey), - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" waitFor(waitFor) - #line 21797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -21807,16 +28145,16 @@ class AddTaskActor6State { int a_body1(int loopDepth=0) { try { - #line 2684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = addBackupTask(BackupSnapshotManifest::name, BackupSnapshotManifest::version, tr, taskBucket, completionKey, BackupConfig(parentTask), waitFor, NOP_SETUP_TASK_FN, 1); - #line 2684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 21819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -21837,9 +28175,9 @@ class AddTaskActor6State { } int a_body1cont1(Key const& key,int loopDepth) { - #line 2693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor6State(); static_cast(this)->destroy(); return 0; } - #line 21842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(key); this->~AddTaskActor6State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -21849,9 +28187,9 @@ class AddTaskActor6State { } int a_body1cont1(Key && key,int loopDepth) { - #line 2693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor6State(); static_cast(this)->destroy(); return 0; } - #line 21854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(key); this->~AddTaskActor6State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -21922,22 +28260,22 @@ class AddTaskActor6State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); } - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference parentTask; - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference waitFor; - #line 21935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor6 final : public Actor, public ActorCallback< AddTaskActor6, 0, Key >, public FastAllocated, public AddTaskActor6State { - #line 21940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -21946,9 +28284,9 @@ class AddTaskActor6 final : public Actor, public ActorCallback< AddTaskActo void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor6, 0, Key >; - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor6(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 21951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), AddTaskActor6State(tr, taskBucket, parentTask, completionKey, waitFor) { @@ -21971,14 +28309,14 @@ friend struct ActorCallback< AddTaskActor6, 0, Key >; } }; - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new AddTaskActor6(tr, taskBucket, parentTask, completionKey, waitFor)); - #line 21978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StringRef getName() const override { return name; }; @@ -21995,7 +28333,7 @@ friend struct ActorCallback< AddTaskActor6, 0, Key >; return _finish(tr, tb, fb, task); }; }; -StringRef BackupSnapshotManifest::name = LiteralStringRef("file_backup_write_snapshot_manifest_5.2"); +StringRef BackupSnapshotManifest::name = "file_backup_write_snapshot_manifest_5.2"_sr; REGISTER_TASKFUNC(BackupSnapshotManifest); Future BackupSnapshotDispatchTask::addSnapshotManifestTask(Reference tr, @@ -22011,29 +28349,29 @@ struct StartFullBackupTaskFunc : BackupTaskFuncBase { static constexpr uint32_t version = 1; static struct { - static TaskParam beginVersion() { return LiteralStringRef(__FUNCTION__); } + static TaskParam beginVersion() { return __FUNCTION__sr; } } Params; - #line 22017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _executeActor4State { - #line 22023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _executeActor4State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : cx(cx), - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task) - #line 22036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -22046,16 +28384,16 @@ class _executeActor4State { int a_body1(int loopDepth=0) { try { - #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(cx, task, StartFullBackupTaskFunc::name, StartFullBackupTaskFunc::version); - #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 22053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 1; - #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 22058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -22076,30 +28414,30 @@ class _executeActor4State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config = BackupConfig(task); - #line 2738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" partitionedLog = Future>(); - #line 2739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 22087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config = BackupConfig(task); - #line 2738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" partitionedLog = Future>(); - #line 2739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 22102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -22169,16 +28507,16 @@ class _executeActor4State { } int a_body1cont2(int loopDepth) { - #line 2755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = getDatabaseConfiguration(cx); - #line 2755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 22176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont2when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 4; - #line 2755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 22181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -22193,24 +28531,24 @@ class _executeActor4State { int a_body1cont1loopBody1(int loopDepth) { try { - #line 2741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" partitionedLog = config.partitionedLogEnabled().get(tr); - #line 2744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" startVersionFuture = tr->getReadVersion(); - #line 2745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = success(partitionedLog) && success(startVersionFuture); - #line 2745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 22208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 2; - #line 2745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 22213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -22243,16 +28581,16 @@ class _executeActor4State { int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr->onError(e); - #line 2750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 22250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 3; - #line 2750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 22255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -22265,18 +28603,18 @@ class _executeActor4State { } int a_body1cont1loopBody1cont2(Void const& _,int loopDepth) { - #line 2747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.beginVersion().set(task, startVersionFuture.get()); - #line 22270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1cont1loopBody1cont2(Void && _,int loopDepth) { - #line 2747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.beginVersion().set(task, startVersionFuture.get()); - #line 22279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -22421,22 +28759,22 @@ class _executeActor4State { } int a_body1cont3(DatabaseConfiguration const& dbConfig,int loopDepth) { - #line 2756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupWorkerEnabled = dbConfig.backupWorkerEnabled; - #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!backupWorkerEnabled && partitionedLog.get().present() && partitionedLog.get().get()) - #line 22428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = success(ManagementAPI::changeConfig(cx.getReference(), "backup_worker_enabled:=1", true)); - #line 2760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 22434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont3when1(__when_expr_4.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 5; - #line 2760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 22439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -22448,22 +28786,22 @@ class _executeActor4State { } int a_body1cont3(DatabaseConfiguration && dbConfig,int loopDepth) { - #line 2756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupWorkerEnabled = dbConfig.backupWorkerEnabled; - #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!backupWorkerEnabled && partitionedLog.get().present() && partitionedLog.get().get()) - #line 22455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = success(ManagementAPI::changeConfig(cx.getReference(), "backup_worker_enabled:=1", true)); - #line 2760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 22461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont3when1(__when_expr_4.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 5; - #line 2760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 22466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -22538,29 +28876,29 @@ class _executeActor4State { } int a_body1cont4(int loopDepth) { - #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 22545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont4loopHead1(loopDepth); return loopDepth; } int a_body1cont5(Void const& _,int loopDepth) { - #line 2761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupWorkerEnabled = true; - #line 22554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont4(loopDepth); return loopDepth; } int a_body1cont5(Void && _,int loopDepth) { - #line 2761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupWorkerEnabled = true; - #line 22563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont4(loopDepth); return loopDepth; @@ -22637,32 +28975,32 @@ class _executeActor4State { } int a_body1cont4loopBody1(int loopDepth) { - #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" watchFuture = Future(); - #line 22642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" try { - #line 2769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" keepRunning = taskBucket->keepRunning(tr, task); - #line 2773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" started = tr->get(backupStartedKey); - #line 2774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskStarted = tr->get(config.allWorkerStarted().key); - #line 2775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" partitionedLog = config.partitionedLogEnabled().get(tr); - #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = success(started) && success(taskStarted) && success(partitionedLog); - #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); - #line 22660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 28998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont4loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont4loopBody1when1(__when_expr_5.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 6; - #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 22665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -22682,16 +29020,16 @@ class _executeActor4State { int a_body1cont4loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_9 = tr->onError(e); - #line 2812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 22689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1Catch1when1(__when_expr_9.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 10; - #line 2812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 22694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -22704,148 +29042,148 @@ class _executeActor4State { } int a_body1cont4loopBody1cont2(Void const& _,int loopDepth) { - #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!partitionedLog.get().present() || !partitionedLog.get().get()) - #line 22709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor4*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor4State(); static_cast<_executeActor4*>(this)->destroy(); return 0; } - #line 22713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor4*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor4State(); static_cast<_executeActor4*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector> ids; - #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (started.get().present()) - #line 22723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ids = decodeBackupStartedValue(started.get().get()); - #line 22727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" const UID uid = config.getUid(); - #line 2787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" auto it = std::find_if( ids.begin(), ids.end(), [uid](const std::pair& p) { return p.first == uid; }); - #line 2789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (it == ids.end()) - #line 22735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ids.emplace_back(uid, Params.beginVersion().get(task)); - #line 22739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 2792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.beginVersion().set(task, it->second); - #line 22745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->set(backupStartedKey, encodeBackupStartedValue(ids)); - #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (backupWorkerEnabled) - #line 22751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.backupWorkerEnabled().set(tr, true); - #line 22755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!taskStarted.get().present()) - #line 22759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" watchFuture = tr->watch(config.allWorkerStarted().key); - #line 22763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_6 = keepRunning; - #line 2805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); - #line 22769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont4loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont4loopBody1cont2when1(__when_expr_6.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 7; - #line 2805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 22774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4loopBody1cont2(Void && _,int loopDepth) { - #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!partitionedLog.get().present() || !partitionedLog.get().get()) - #line 22783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor4*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor4State(); static_cast<_executeActor4*>(this)->destroy(); return 0; } - #line 22787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor4*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor4State(); static_cast<_executeActor4*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector> ids; - #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (started.get().present()) - #line 22797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ids = decodeBackupStartedValue(started.get().get()); - #line 22801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" const UID uid = config.getUid(); - #line 2787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" auto it = std::find_if( ids.begin(), ids.end(), [uid](const std::pair& p) { return p.first == uid; }); - #line 2789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (it == ids.end()) - #line 22809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ids.emplace_back(uid, Params.beginVersion().get(task)); - #line 22813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 2792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.beginVersion().set(task, it->second); - #line 22819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->set(backupStartedKey, encodeBackupStartedValue(ids)); - #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (backupWorkerEnabled) - #line 22825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.backupWorkerEnabled().set(tr, true); - #line 22829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!taskStarted.get().present()) - #line 22833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" watchFuture = tr->watch(config.allWorkerStarted().key); - #line 22837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 2805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_6 = keepRunning; - #line 2805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); - #line 22843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont4loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont4loopBody1cont2when1(__when_expr_6.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 7; - #line 2805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 22848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -22915,32 +29253,32 @@ class _executeActor4State { } int a_body1cont4loopBody1cont3(Void const& _,int loopDepth) { - #line 2806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_7 = tr->commit(); - #line 2806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); - #line 22922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont4loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont4loopBody1cont3when1(__when_expr_7.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 8; - #line 2806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 22927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4loopBody1cont3(Void && _,int loopDepth) { - #line 2806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_7 = tr->commit(); - #line 2806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); - #line 22938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont4loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont4loopBody1cont3when1(__when_expr_7.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 8; - #line 2806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 22943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -23010,20 +29348,20 @@ class _executeActor4State { } int a_body1cont4loopBody1cont10(Void const& _,int loopDepth) { - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!taskStarted.get().present()) - #line 23015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_8 = watchFuture; - #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); - #line 23021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont4loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont4loopBody1cont10when1(__when_expr_8.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 9; - #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 23026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -23035,20 +29373,20 @@ class _executeActor4State { } int a_body1cont4loopBody1cont10(Void && _,int loopDepth) { - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!taskStarted.get().present()) - #line 23040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_8 = watchFuture; - #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor4*>(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); - #line 23046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont4loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont4loopBody1cont10when1(__when_expr_8.get(), loopDepth); }; static_cast<_executeActor4*>(this)->actor_wait_state = 9; - #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor4*>(this))); - #line 23051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -23123,9 +29461,9 @@ class _executeActor4State { } int a_body1cont4loopBody1cont10cont1(int loopDepth) { - #line 2810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor4*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor4State(); static_cast<_executeActor4*>(this)->destroy(); return 0; } - #line 23128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor4*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor4State(); static_cast<_executeActor4*>(this)->finishSendAndDelPromiseRef(); @@ -23283,38 +29621,38 @@ class _executeActor4State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 9); } - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig config; - #line 2738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future> partitionedLog; - #line 2744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future startVersionFuture; - #line 2756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bool backupWorkerEnabled; - #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future watchFuture; - #line 2771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future keepRunning; - #line 2773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future> started; - #line 2774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future> taskStarted; - #line 23312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _executeActor4 final : public Actor, public ActorCallback< _executeActor4, 0, Void >, public ActorCallback< _executeActor4, 1, Void >, public ActorCallback< _executeActor4, 2, Void >, public ActorCallback< _executeActor4, 3, DatabaseConfiguration >, public ActorCallback< _executeActor4, 4, Void >, public ActorCallback< _executeActor4, 5, Void >, public ActorCallback< _executeActor4, 6, Void >, public ActorCallback< _executeActor4, 7, Void >, public ActorCallback< _executeActor4, 8, Void >, public ActorCallback< _executeActor4, 9, Void >, public FastAllocated<_executeActor4>, public _executeActor4State<_executeActor4> { - #line 23317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor4>::operator new; using FastAllocated<_executeActor4>::operator delete; @@ -23332,9 +29670,9 @@ friend struct ActorCallback< _executeActor4, 6, Void >; friend struct ActorCallback< _executeActor4, 7, Void >; friend struct ActorCallback< _executeActor4, 8, Void >; friend struct ActorCallback< _executeActor4, 9, Void >; - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _executeActor4(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 23337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _executeActor4State<_executeActor4>(cx, taskBucket, futureBucket, task) { @@ -23366,47 +29704,47 @@ friend struct ActorCallback< _executeActor4, 9, Void >; } }; - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _executeActor4(cx, taskBucket, futureBucket, task)); - #line 23373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 23378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor9State { - #line 23384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor9State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 2821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config(task), - #line 2822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion(Params.beginVersion().get(task)), - #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupRangesFuture(config.backupRanges().getOrThrow(tr)), - #line 2825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" destUidValueFuture(config.destUidValue().getOrThrow(tr)), - #line 2826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" partitionedLog(config.partitionedLogEnabled().get(tr)), - #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" incrementalBackupOnly(config.incrementalBackupOnly().get(tr)) - #line 23409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -23419,16 +29757,16 @@ class _finishActor9State { int a_body1(int loopDepth=0) { try { - #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = success(backupRangesFuture) && success(destUidValueFuture) && success(partitionedLog) && success(incrementalBackupOnly); - #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor9*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor9*>(this)->actor_wait_state = 1; - #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor9*>(this))); - #line 23431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -23449,70 +29787,70 @@ class _finishActor9State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 2830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector backupRanges = backupRangesFuture.get(); - #line 2831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key destUidValue = destUidValueFuture.get(); - #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!partitionedLog.get().present() || !partitionedLog.get().get()) - #line 23458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& backupRange : backupRanges ) { - #line 2836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.startMutationLogs(tr, backupRange, destUidValue); - #line 23464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } } - #line 2840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.stateEnum().set(tr, EBackupState::STATE_RUNNING); - #line 2842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupFinished = futureBucket->future(tr); - #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_1 = config.initialSnapshotIntervalSeconds().get(tr); - #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor9*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor9*>(this)->actor_wait_state = 2; - #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast<_finishActor9*>(this))); - #line 23480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 2830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector backupRanges = backupRangesFuture.get(); - #line 2831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key destUidValue = destUidValueFuture.get(); - #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!partitionedLog.get().present() || !partitionedLog.get().get()) - #line 23493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& backupRange : backupRanges ) { - #line 2836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.startMutationLogs(tr, backupRange, destUidValue); - #line 23499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } } - #line 2840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.stateEnum().set(tr, EBackupState::STATE_RUNNING); - #line 2842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupFinished = futureBucket->future(tr); - #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_1 = config.initialSnapshotIntervalSeconds().get(tr); - #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor9*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor9*>(this)->actor_wait_state = 2; - #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast<_finishActor9*>(this))); - #line 23515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -23582,25 +29920,25 @@ class _finishActor9State { } int a_body1cont2(int loopDepth) { - #line 2846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = config.initNewSnapshot(tr, initialSnapshotIntervalSeconds.orDefault(0)); - #line 2846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor9*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor9*>(this)->actor_wait_state = 3; - #line 2846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor9*>(this))); - #line 23594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1when1(Optional const& __initialSnapshotIntervalSeconds,int loopDepth) { - #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" initialSnapshotIntervalSeconds = __initialSnapshotIntervalSeconds; - #line 23603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 29941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -23665,20 +30003,20 @@ class _finishActor9State { } int a_body1cont5(Void const& _,int loopDepth) { - #line 2850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!incrementalBackupOnly.get().present() || !incrementalBackupOnly.get().get()) - #line 23670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = success(BackupSnapshotDispatchTask::addTask( tr, taskBucket, task, 1, TaskCompletionKey::joinWith(backupFinished))); - #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor9*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor9*>(this)->actor_wait_state = 4; - #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor9*>(this))); - #line 23681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -23690,20 +30028,20 @@ class _finishActor9State { } int a_body1cont5(Void && _,int loopDepth) { - #line 2850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!incrementalBackupOnly.get().present() || !incrementalBackupOnly.get().get()) - #line 23695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = success(BackupSnapshotDispatchTask::addTask( tr, taskBucket, task, 1, TaskCompletionKey::joinWith(backupFinished))); - #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor9*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor9*>(this)->actor_wait_state = 4; - #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor9*>(this))); - #line 23706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -23778,16 +30116,16 @@ class _finishActor9State { } int a_body1cont6(int loopDepth) { - #line 2854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = success(BackupLogsDispatchTask::addTask( tr, taskBucket, task, 1, 0, beginVersion, TaskCompletionKey::joinWith(backupFinished))); - #line 2854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor9*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor9*>(this)->actor_wait_state = 5; - #line 2854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor9*>(this))); - #line 23790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -23869,32 +30207,32 @@ class _finishActor9State { } int a_body1cont8(Void const& _,int loopDepth) { - #line 2859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = success( FileBackupFinishedTask::addTask(tr, taskBucket, task, TaskCompletionKey::noSignal(), backupFinished)); - #line 2859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor9*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont8when1(__when_expr_5.get(), loopDepth); }; static_cast<_finishActor9*>(this)->actor_wait_state = 6; - #line 2859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_finishActor9*>(this))); - #line 23881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont8(Void && _,int loopDepth) { - #line 2859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = success( FileBackupFinishedTask::addTask(tr, taskBucket, task, TaskCompletionKey::noSignal(), backupFinished)); - #line 2859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor9*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont8when1(__when_expr_5.get(), loopDepth); }; static_cast<_finishActor9*>(this)->actor_wait_state = 6; - #line 2859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_finishActor9*>(this))); - #line 23897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -23964,32 +30302,32 @@ class _finishActor9State { } int a_body1cont9(Void const& _,int loopDepth) { - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_6 = taskBucket->finish(tr, task); - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor9*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont9when1(__when_expr_6.get(), loopDepth); }; static_cast<_finishActor9*>(this)->actor_wait_state = 7; - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_finishActor9*>(this))); - #line 23976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont9(Void && _,int loopDepth) { - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_6 = taskBucket->finish(tr, task); - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor9*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont9when1(__when_expr_6.get(), loopDepth); }; static_cast<_finishActor9*>(this)->actor_wait_state = 7; - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_finishActor9*>(this))); - #line 23992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -24059,9 +30397,9 @@ class _finishActor9State { } int a_body1cont10(Void const& _,int loopDepth) { - #line 2864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor9*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor9State(); static_cast<_finishActor9*>(this)->destroy(); return 0; } - #line 24064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor9*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor9State(); static_cast<_finishActor9*>(this)->finishSendAndDelPromiseRef(); @@ -24071,9 +30409,9 @@ class _finishActor9State { } int a_body1cont10(Void && _,int loopDepth) { - #line 2864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor9*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor9State(); static_cast<_finishActor9*>(this)->destroy(); return 0; } - #line 24076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor9*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor9State(); static_cast<_finishActor9*>(this)->finishSendAndDelPromiseRef(); @@ -24144,36 +30482,36 @@ class _finishActor9State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 6); } - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 2821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig config; - #line 2822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version beginVersion; - #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future> backupRangesFuture; - #line 2825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future destUidValueFuture; - #line 2826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future> partitionedLog; - #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future> incrementalBackupOnly; - #line 2842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference backupFinished; - #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional initialSnapshotIntervalSeconds; - #line 24171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor9 final : public Actor, public ActorCallback< _finishActor9, 0, Void >, public ActorCallback< _finishActor9, 1, Optional >, public ActorCallback< _finishActor9, 2, Void >, public ActorCallback< _finishActor9, 3, Void >, public ActorCallback< _finishActor9, 4, Void >, public ActorCallback< _finishActor9, 5, Void >, public ActorCallback< _finishActor9, 6, Void >, public FastAllocated<_finishActor9>, public _finishActor9State<_finishActor9> { - #line 24176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor9>::operator new; using FastAllocated<_finishActor9>::operator delete; @@ -24188,9 +30526,9 @@ friend struct ActorCallback< _finishActor9, 3, Void >; friend struct ActorCallback< _finishActor9, 4, Void >; friend struct ActorCallback< _finishActor9, 5, Void >; friend struct ActorCallback< _finishActor9, 6, Void >; - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor9(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 24193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _finishActor9State<_finishActor9>(tr, taskBucket, futureBucket, task) { @@ -24219,37 +30557,37 @@ friend struct ActorCallback< _finishActor9, 6, Void >; } }; - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _finishActor9(tr, taskBucket, futureBucket, task)); - #line 24226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 24231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor7State { - #line 24237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor7State(Reference const& tr,Reference const& taskBucket,UID const& uid,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" uid(uid), - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" completionKey(completionKey), - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" waitFor(waitFor) - #line 24252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -24262,16 +30600,16 @@ class AddTaskActor7State { int a_body1(int loopDepth=0) { try { - #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = addBackupTask(StartFullBackupTaskFunc::name, StartFullBackupTaskFunc::version, tr, taskBucket, completionKey, BackupConfig(uid), waitFor); - #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -24292,9 +30630,9 @@ class AddTaskActor7State { } int a_body1cont1(Key const& key,int loopDepth) { - #line 2879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor7State(); static_cast(this)->destroy(); return 0; } - #line 24297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(key); this->~AddTaskActor7State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -24304,9 +30642,9 @@ class AddTaskActor7State { } int a_body1cont1(Key && key,int loopDepth) { - #line 2879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(key); this->~AddTaskActor7State(); static_cast(this)->destroy(); return 0; } - #line 24309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(key); this->~AddTaskActor7State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -24377,22 +30715,22 @@ class AddTaskActor7State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 0); } - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UID uid; - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference waitFor; - #line 24390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor7 final : public Actor, public ActorCallback< AddTaskActor7, 0, Key >, public FastAllocated, public AddTaskActor7State { - #line 24395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -24401,9 +30739,9 @@ class AddTaskActor7 final : public Actor, public ActorCallback< AddTaskActo void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< AddTaskActor7, 0, Key >; - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor7(Reference const& tr,Reference const& taskBucket,UID const& uid,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 24406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), AddTaskActor7State(tr, taskBucket, uid, completionKey, waitFor) { @@ -24426,14 +30764,14 @@ friend struct ActorCallback< AddTaskActor7, 0, Key >; } }; - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, UID const& uid, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new AddTaskActor7(tr, taskBucket, uid, completionKey, waitFor)); - #line 24433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StringRef getName() const override { return name; }; @@ -24450,30 +30788,30 @@ friend struct ActorCallback< AddTaskActor7, 0, Key >; return _finish(tr, tb, fb, task); }; }; -StringRef StartFullBackupTaskFunc::name = LiteralStringRef("file_backup_start_5.2"); +StringRef StartFullBackupTaskFunc::name = "file_backup_start_5.2"_sr; REGISTER_TASKFUNC(StartFullBackupTaskFunc); struct RestoreCompleteTaskFunc : RestoreTaskFuncBase { - #line 24457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor10State { - #line 24463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor10State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task) - #line 24476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -24486,16 +30824,16 @@ class _finishActor10State { int a_body1(int loopDepth=0) { try { - #line 2905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(tr->getDatabase(), task, name, version); - #line 2905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor10*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor10*>(this)->actor_wait_state = 1; - #line 2905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); - #line 24498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -24516,52 +30854,40 @@ class _finishActor10State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore = RestoreConfig(task); - #line 2908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.stateEnum().set(tr, ERestoreState::COMPLETED); - #line 2909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->atomicOp(metadataVersionKey, metadataVersionRequiredValue, MutationRef::SetVersionstampedValue); - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - restore.fileSet().clear(tr); - #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - restore.clearApplyMutationsKeys(tr); - #line 2922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = taskBucket->finish(tr, task); - #line 2922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = restore.unlockDBAfterRestore().getD(tr, Snapshot::False, true); + #line 3609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor10*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor10*>(this)->actor_wait_state = 2; - #line 2922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); - #line 24538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); + #line 30870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore = RestoreConfig(task); - #line 2908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.stateEnum().set(tr, ERestoreState::COMPLETED); - #line 2909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->atomicOp(metadataVersionKey, metadataVersionRequiredValue, MutationRef::SetVersionstampedValue); - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - restore.fileSet().clear(tr); - #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - restore.clearApplyMutationsKeys(tr); - #line 2922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = taskBucket->finish(tr, task); - #line 2922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = restore.unlockDBAfterRestore().getD(tr, Snapshot::False, true); + #line 3609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor10*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor10*>(this)->actor_wait_state = 2; - #line 2922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); - #line 24564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); + #line 30890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -24629,57 +30955,51 @@ class _finishActor10State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); } - int a_body1cont2(Void const& _,int loopDepth) - { - #line 2923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = unlockDatabase(tr, restore.getUid()); - #line 2923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor10*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast<_finishActor10*>(this)->actor_wait_state = 3; - #line 2923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); - #line 24643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont2(Void && _,int loopDepth) + int a_body1cont2(int loopDepth) { - #line 2923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = unlockDatabase(tr, restore.getUid()); - #line 2923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->atomicOp(metadataVersionKey, metadataVersionRequiredValue, MutationRef::SetVersionstampedValue); + #line 3613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + restore.fileSet().clear(tr); + #line 3623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + restore.clearApplyMutationsKeys(tr); + #line 3625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = taskBucket->finish(tr, task); + #line 3625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor10*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor10*>(this)->actor_wait_state = 3; - #line 2923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); - #line 24659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 30975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1cont1when1(bool const& __unlockDB,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + #line 3609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + unlockDB = __unlockDB; + #line 30984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1cont1when1(bool && __unlockDB,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + unlockDB = std::move(__unlockDB); + loopDepth = a_body1cont2(loopDepth); return loopDepth; } void a_exitChoose2() { if (static_cast<_finishActor10*>(this)->actor_wait_state > 0) static_cast<_finishActor10*>(this)->actor_wait_state = 0; - static_cast<_finishActor10*>(this)->ActorCallback< _finishActor10, 1, Void >::remove(); + static_cast<_finishActor10*>(this)->ActorCallback< _finishActor10, 1, bool >::remove(); } - void a_callback_fire(ActorCallback< _finishActor10, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< _finishActor10, 1, bool >*,bool const& value) { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); a_exitChoose2(); @@ -24694,7 +31014,7 @@ class _finishActor10State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< _finishActor10, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< _finishActor10, 1, bool >*,bool && value) { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); a_exitChoose2(); @@ -24709,7 +31029,7 @@ class _finishActor10State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< _finishActor10, 1, Void >*,Error err) + void a_callback_error(ActorCallback< _finishActor10, 1, bool >*,Error err) { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 1); a_exitChoose2(); @@ -24726,25 +31046,51 @@ class _finishActor10State { } int a_body1cont3(Void const& _,int loopDepth) { - #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_finishActor10*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor10State(); static_cast<_finishActor10*>(this)->destroy(); return 0; } - #line 24731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_finishActor10*>(this)->SAV< Void >::value()) Void(Void()); - this->~_finishActor10State(); - static_cast<_finishActor10*>(this)->finishSendAndDelPromiseRef(); - return 0; + #line 3626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (unlockDB) + #line 31051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 3627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = unlockDatabase(tr, restore.getUid()); + #line 3627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_finishActor10*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 31057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; + static_cast<_finishActor10*>(this)->actor_wait_state = 4; + #line 3627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); + #line 31062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont4(loopDepth); + } return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_finishActor10*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor10State(); static_cast<_finishActor10*>(this)->destroy(); return 0; } - #line 24743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_finishActor10*>(this)->SAV< Void >::value()) Void(Void()); - this->~_finishActor10State(); - static_cast<_finishActor10*>(this)->finishSendAndDelPromiseRef(); - return 0; + #line 3626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (unlockDB) + #line 31076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 3627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = unlockDatabase(tr, restore.getUid()); + #line 3627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_finishActor10*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 31082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; + static_cast<_finishActor10*>(this)->actor_wait_state = 4; + #line 3627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor10*>(this))); + #line 31087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont4(loopDepth); + } return loopDepth; } @@ -24811,22 +31157,111 @@ class _finishActor10State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 2); } - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int a_body1cont4(int loopDepth) + { + #line 3630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_finishActor10*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor10State(); static_cast<_finishActor10*>(this)->destroy(); return 0; } + #line 31164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_finishActor10*>(this)->SAV< Void >::value()) Void(Void()); + this->~_finishActor10State(); + static_cast<_finishActor10*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont5(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont5(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont5(_, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont5(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast<_finishActor10*>(this)->actor_wait_state > 0) static_cast<_finishActor10*>(this)->actor_wait_state = 0; + static_cast<_finishActor10*>(this)->ActorCallback< _finishActor10, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _finishActor10, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< _finishActor10, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< _finishActor10, 3, Void >*,Error err) + { + fdb_probe_actor_enter("_finish", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_finish", reinterpret_cast(this), 3); + + } + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig restore; - #line 24824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool unlockDB; + #line 31259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class _finishActor10 final : public Actor, public ActorCallback< _finishActor10, 0, Void >, public ActorCallback< _finishActor10, 1, Void >, public ActorCallback< _finishActor10, 2, Void >, public FastAllocated<_finishActor10>, public _finishActor10State<_finishActor10> { - #line 24829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _finishActor10 final : public Actor, public ActorCallback< _finishActor10, 0, Void >, public ActorCallback< _finishActor10, 1, bool >, public ActorCallback< _finishActor10, 2, Void >, public ActorCallback< _finishActor10, 3, Void >, public FastAllocated<_finishActor10>, public _finishActor10State<_finishActor10> { + #line 31264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor10>::operator new; using FastAllocated<_finishActor10>::operator delete; @@ -24835,11 +31270,12 @@ class _finishActor10 final : public Actor, public ActorCallback< _finishAc void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< _finishActor10, 0, Void >; -friend struct ActorCallback< _finishActor10, 1, Void >; +friend struct ActorCallback< _finishActor10, 1, bool >; friend struct ActorCallback< _finishActor10, 2, Void >; - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +friend struct ActorCallback< _finishActor10, 3, Void >; + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor10(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 24842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _finishActor10State<_finishActor10>(tr, taskBucket, futureBucket, task) { @@ -24858,43 +31294,44 @@ friend struct ActorCallback< _finishActor10, 2, Void >; this->actor_wait_state = -1; switch (wait_state) { case 1: this->a_callback_error((ActorCallback< _finishActor10, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< _finishActor10, 1, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< _finishActor10, 1, bool >*)0, actor_cancelled()); break; case 3: this->a_callback_error((ActorCallback< _finishActor10, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< _finishActor10, 3, Void >*)0, actor_cancelled()); break; } } }; - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _finishActor10(tr, taskBucket, futureBucket, task)); - #line 24871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 24876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor8State { - #line 24882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor8State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" parentTask(parentTask), - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" completionKey(completionKey), - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" waitFor(waitFor) - #line 24897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -24907,16 +31344,16 @@ class AddTaskActor8State { int a_body1(int loopDepth=0) { try { - #line 2933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 2933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -24937,36 +31374,36 @@ class AddTaskActor8State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 2934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task = Reference(new Task(RestoreCompleteTaskFunc::name, RestoreCompleteTaskFunc::version, doneKey)); - #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = RestoreConfig(parentTask).toTask(tr, task); - #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 2934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task = Reference(new Task(RestoreCompleteTaskFunc::name, RestoreCompleteTaskFunc::version, doneKey)); - #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = RestoreConfig(parentTask).toTask(tr, task); - #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -25036,56 +31473,56 @@ class AddTaskActor8State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 2939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!waitFor) - #line 25041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task)); this->~AddTaskActor8State(); static_cast(this)->destroy(); return 0; } - #line 25045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task)); this->~AddTaskActor8State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = waitFor->onSetAddTask(tr, taskBucket, task); - #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 2939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!waitFor) - #line 25069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 2940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task)); this->~AddTaskActor8State(); static_cast(this)->destroy(); return 0; } - #line 25073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task)); this->~AddTaskActor8State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = waitFor->onSetAddTask(tr, taskBucket, task); - #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -25155,10 +31592,10 @@ class AddTaskActor8State { } int a_body1cont3(Void const& _,int loopDepth) { - #line 2944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor8State(); static_cast(this)->destroy(); return 0; } - #line 25160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor8State(); static_cast(this)->destroy(); return 0; } + #line 31597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor8State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -25167,10 +31604,10 @@ class AddTaskActor8State { } int a_body1cont3(Void && _,int loopDepth) { - #line 2944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor8State(); static_cast(this)->destroy(); return 0; } - #line 25172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor8State(); static_cast(this)->destroy(); return 0; } + #line 31609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor8State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -25240,24 +31677,24 @@ class AddTaskActor8State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 2); } - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference parentTask; - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference waitFor; - #line 2934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 25255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor8 final : public Actor, public ActorCallback< AddTaskActor8, 0, Key >, public ActorCallback< AddTaskActor8, 1, Void >, public ActorCallback< AddTaskActor8, 2, Void >, public FastAllocated, public AddTaskActor8State { - #line 25260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -25268,9 +31705,9 @@ class AddTaskActor8 final : public Actor, public ActorCallback< AddTaskActo friend struct ActorCallback< AddTaskActor8, 0, Key >; friend struct ActorCallback< AddTaskActor8, 1, Void >; friend struct ActorCallback< AddTaskActor8, 2, Void >; - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor8(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 25273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), AddTaskActor8State(tr, taskBucket, parentTask, completionKey, waitFor) { @@ -25295,14 +31732,14 @@ friend struct ActorCallback< AddTaskActor8, 2, Void >; } }; - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new AddTaskActor8(tr, taskBucket, parentTask, completionKey, waitFor)); - #line 25302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" static StringRef name; static constexpr uint32_t version = 1; @@ -25321,14 +31758,14 @@ friend struct ActorCallback< AddTaskActor8, 2, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef RestoreCompleteTaskFunc::name = LiteralStringRef("restore_complete"); +StringRef RestoreCompleteTaskFunc::name = "restore_complete"_sr; REGISTER_TASKFUNC(RestoreCompleteTaskFunc); struct RestoreFileTaskFuncBase : RestoreTaskFuncBase { struct InputParams { - static TaskParam inputFile() { return LiteralStringRef(__FUNCTION__); } - static TaskParam readOffset() { return LiteralStringRef(__FUNCTION__); } - static TaskParam readLen() { return LiteralStringRef(__FUNCTION__); } + static TaskParam inputFile() { return __FUNCTION__sr; } + static TaskParam readOffset() { return __FUNCTION__sr; } + static TaskParam readLen() { return __FUNCTION__sr; } } Params; std::string toString(Reference task) const override { @@ -25343,8 +31780,8 @@ struct RestoreRangeTaskFunc : RestoreFileTaskFuncBase { static struct : InputParams { // The range of data that the (possibly empty) data represented, which is set if it intersects the target // restore range - static TaskParam originalFileRange() { return LiteralStringRef(__FUNCTION__); } - static TaskParam> originalFileRanges() { return LiteralStringRef(__FUNCTION__); } + static TaskParam originalFileRange() { return __FUNCTION__sr; } + static TaskParam> originalFileRanges() { return __FUNCTION__sr; } static std::vector getOriginalFileRanges(Reference task) { if (originalFileRanges().exists(task)) { @@ -25365,34 +31802,249 @@ struct RestoreRangeTaskFunc : RestoreFileTaskFuncBase { return returnStr; } - #line 25368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 31805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via _validTenantAccess() + #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _validTenantAccessActorState { + #line 31811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + _validTenantAccessActorState(KeyRef const& key,Reference> const& tenantCache) + #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : key(key), + #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tenantCache(tenantCache) + #line 31820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("_validTenantAccess", reinterpret_cast(this)); + + } + ~_validTenantAccessActorState() + { + fdb_probe_actor_destroy("_validTenantAccess", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 3714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (isSystemKey(key)) + #line 31835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 3715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_validTenantAccessActor*>(this)->SAV::futures) { (void)(Void()); this->~_validTenantAccessActorState(); static_cast<_validTenantAccessActor*>(this)->destroy(); return 0; } + #line 31839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_validTenantAccessActor*>(this)->SAV< Void >::value()) Void(Void()); + this->~_validTenantAccessActorState(); + static_cast<_validTenantAccessActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 3717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tenantId = TenantAPI::extractTenantIdFromKeyRef(key); + #line 3718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture>> __when_expr_0 = tenantCache->getById(tenantId); + #line 3718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_validTenantAccessActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 31851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast<_validTenantAccessActor*>(this)->actor_wait_state = 1; + #line 3718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast<_validTenantAccessActor*>(this))); + #line 31856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~_validTenantAccessActorState(); + static_cast<_validTenantAccessActor*>(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional> const& payload,int loopDepth) + { + #line 3719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(payload.present()); + #line 3720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_validTenantAccessActor*>(this)->SAV::futures) { (void)(Void()); this->~_validTenantAccessActorState(); static_cast<_validTenantAccessActor*>(this)->destroy(); return 0; } + #line 31881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_validTenantAccessActor*>(this)->SAV< Void >::value()) Void(Void()); + this->~_validTenantAccessActorState(); + static_cast<_validTenantAccessActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Optional> && payload,int loopDepth) + { + #line 3719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ASSERT(payload.present()); + #line 3720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_validTenantAccessActor*>(this)->SAV::futures) { (void)(Void()); this->~_validTenantAccessActorState(); static_cast<_validTenantAccessActor*>(this)->destroy(); return 0; } + #line 31895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_validTenantAccessActor*>(this)->SAV< Void >::value()) Void(Void()); + this->~_validTenantAccessActorState(); + static_cast<_validTenantAccessActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Optional> const& payload,int loopDepth) + { + loopDepth = a_body1cont1(payload, loopDepth); + + return loopDepth; + } + int a_body1when1(Optional> && payload,int loopDepth) + { + loopDepth = a_body1cont1(std::move(payload), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast<_validTenantAccessActor*>(this)->actor_wait_state > 0) static_cast<_validTenantAccessActor*>(this)->actor_wait_state = 0; + static_cast<_validTenantAccessActor*>(this)->ActorCallback< _validTenantAccessActor, 0, Optional> >::remove(); + + } + void a_callback_fire(ActorCallback< _validTenantAccessActor, 0, Optional> >*,Optional> const& value) + { + fdb_probe_actor_enter("_validTenantAccess", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_validTenantAccess", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _validTenantAccessActor, 0, Optional> >*,Optional> && value) + { + fdb_probe_actor_enter("_validTenantAccess", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_validTenantAccess", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< _validTenantAccessActor, 0, Optional> >*,Error err) + { + fdb_probe_actor_enter("_validTenantAccess", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_validTenantAccess", reinterpret_cast(this), 0); + + } + #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRef key; + #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference> tenantCache; + #line 3717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t tenantId; + #line 31972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via _validTenantAccess() + #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _validTenantAccessActor final : public Actor, public ActorCallback< _validTenantAccessActor, 0, Optional> >, public FastAllocated<_validTenantAccessActor>, public _validTenantAccessActorState<_validTenantAccessActor> { + #line 31977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated<_validTenantAccessActor>::operator new; + using FastAllocated<_validTenantAccessActor>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< _validTenantAccessActor, 0, Optional> >; + #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + _validTenantAccessActor(KeyRef const& key,Reference> const& tenantCache) + #line 31988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + _validTenantAccessActorState<_validTenantAccessActor>(key, tenantCache) + { + fdb_probe_actor_enter("_validTenantAccess", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("_validTenantAccess"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("_validTenantAccess", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< _validTenantAccessActor, 0, Optional> >*)0, actor_cancelled()); break; + } + + } +}; + #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future _validTenantAccess( KeyRef const& key, Reference> const& tenantCache ) { + #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new _validTenantAccessActor(key, tenantCache)); + #line 32015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 3722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + #line 32020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _executeActor5State { - #line 25374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _executeActor5State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : cx(cx), - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 3012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore(task), - #line 3014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" rangeFile(Params.inputFile().get(task)), - #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" readOffset(Params.readOffset().get(task)), - #line 3016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" readLen(Params.readLen().get(task)) - #line 25395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -25405,21 +32057,21 @@ class _executeActor5State { int a_body1(int loopDepth=0) { try { - #line 3018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreRangeStart") .suppressFor(60) .detail("RestoreUID", restore.getUid()) .detail("FileName", rangeFile.fileName) .detail("FileVersion", rangeFile.version) .detail("FileSize", rangeFile.fileSize) .detail("ReadOffset", readOffset) .detail("ReadLen", readLen) .detail("TaskInstance", THIS_ADDR); - #line 3028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 3029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc = Future>(); - #line 3030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreRanges = Future>(); - #line 3031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addPrefix = Future(); - #line 3032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" removePrefix = Future(); - #line 3034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 25422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -25440,16 +32092,16 @@ class _executeActor5State { } int a_body1cont1(int loopDepth) { - #line 3056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_4 = bc.get()->readFile(rangeFile.fileName); - #line 3056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont1when1(__when_expr_4.get(), loopDepth); }; static_cast<_executeActor5*>(this)->actor_wait_state = 5; - #line 3056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast >*>(static_cast<_executeActor5*>(this))); - #line 25452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -25464,20 +32116,20 @@ class _executeActor5State { int a_body1loopBody1(int loopDepth) { try { - #line 3036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 3037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 3039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_0 = restore.sourceContainer().getOrThrow(tr); - #line 3039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 25475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor5*>(this)->actor_wait_state = 1; - #line 3039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast<_executeActor5*>(this))); - #line 25480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -25510,16 +32162,16 @@ class _executeActor5State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 3052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = tr->onError(e); - #line 3052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 25517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor5*>(this)->actor_wait_state = 4; - #line 3052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); - #line 25522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -25532,48 +32184,48 @@ class _executeActor5State { } int a_body1loopBody1cont2(Reference const& _bc,int loopDepth) { - #line 3040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc = getBackupContainerWithProxy(_bc); - #line 3041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreRanges = restore.getRestoreRangesOrDefault(tr); - #line 3042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addPrefix = restore.addPrefix().getD(tr); - #line 3043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" removePrefix = restore.removePrefix().getD(tr); - #line 3045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = taskBucket->keepRunning(tr, task); - #line 3045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 25547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor5*>(this)->actor_wait_state = 2; - #line 3045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); - #line 25552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Reference && _bc,int loopDepth) { - #line 3040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc = getBackupContainerWithProxy(_bc); - #line 3041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreRanges = restore.getRestoreRangesOrDefault(tr); - #line 3042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addPrefix = restore.addPrefix().getD(tr); - #line 3043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" removePrefix = restore.removePrefix().getD(tr); - #line 3045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = taskBucket->keepRunning(tr, task); - #line 3045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 25571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor5*>(this)->actor_wait_state = 2; - #line 3045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); - #line 25576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -25643,32 +32295,32 @@ class _executeActor5State { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = success(bc) && success(restoreRanges) && success(addPrefix) && success(removePrefix) && checkTaskVersion(tr->getDatabase(), task, name, version); - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 25650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor5*>(this)->actor_wait_state = 3; - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); - #line 25655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = success(bc) && success(restoreRanges) && success(addPrefix) && success(removePrefix) && checkTaskVersion(tr->getDatabase(), task, name, version); - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 25666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor5*>(this)->actor_wait_state = 3; - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); - #line 25671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -25888,25 +32540,35 @@ class _executeActor5State { } int a_body1cont2(int loopDepth) { - #line 3057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture>> __when_expr_5 = decodeRangeFileBlock(inFile, readOffset, readLen); - #line 3057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2when1(__when_expr_5.get(), loopDepth); }; - static_cast<_executeActor5*>(this)->actor_wait_state = 6; - #line 3057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast> >*>(static_cast<_executeActor5*>(this))); - #line 25900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 3772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + blockData = Standalone>(); + #line 32545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + try { + #line 3774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture>> __when_expr_5 = decodeRangeFileBlock(inFile, readOffset, readLen, cx); + #line 3774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1cont2Catch1(actor_cancelled(), loopDepth); + #line 32551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont2Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2when1(__when_expr_5.get(), loopDepth); }; + static_cast<_executeActor5*>(this)->actor_wait_state = 6; + #line 3774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast> >*>(static_cast<_executeActor5*>(this))); + #line 32556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont2Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont2Catch1(unknown_error(), loopDepth); + } return loopDepth; } int a_body1cont1when1(Reference const& __inFile,int loopDepth) { - #line 3056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" inFile = __inFile; - #line 25909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -25971,32 +32633,80 @@ class _executeActor5State { } int a_body1cont3(int loopDepth) { - #line 3060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - fileRange = KeyRange(); - #line 3061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - originalFileRanges = std::vector(); - #line 3063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - index = int(); - #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - index = 0; - #line 25982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont3loopHead1(loopDepth); + #line 3784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tenantCache = Optional>>(); + #line 3785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + validTenantCheckFutures = std::vector>(); + #line 3786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + arena = Arena(); + #line 3787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_6 = getDatabaseConfiguration(cx); + #line 3787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 32646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont3when1(__when_expr_6.get(), loopDepth); }; + static_cast<_executeActor5*>(this)->actor_wait_state = 7; + #line 3787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); + #line 32651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont2when1(Standalone> const& __blockData,int loopDepth) + int a_body1cont2Catch1(const Error& e,int loopDepth=0) { - #line 3057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - blockData = __blockData; - #line 25991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont3(loopDepth); + try { + #line 3778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (e.code() == error_code_encrypt_keys_fetch_failed || e.code() == error_code_tenant_not_found || e.code() == error_code_encrypt_key_not_found) + #line 32661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 3780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_executeActor5*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor5State(); static_cast<_executeActor5*>(this)->destroy(); return 0; } + #line 32665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_executeActor5*>(this)->SAV< Void >::value()) Void(Void()); + this->~_executeActor5State(); + static_cast<_executeActor5*>(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 3782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 32673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1cont2when1(Standalone> && __blockData,int loopDepth) + int a_body1cont4(Standalone> const& data,int loopDepth) { - blockData = std::move(__blockData); - loopDepth = a_body1cont3(loopDepth); + #line 3775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + blockData = data; + #line 32687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont4(Standalone> && data,int loopDepth) + { + #line 3775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + blockData = data; + #line 32696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Standalone> const& data,int loopDepth) + { + loopDepth = a_body1cont4(data, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Standalone> && data,int loopDepth) + { + loopDepth = a_body1cont4(std::move(data), loopDepth); return loopDepth; } @@ -26014,9 +32724,9 @@ class _executeActor5State { a_body1cont2when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont2Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont2Catch1(unknown_error(), 0); } fdb_probe_actor_exit("_execute", reinterpret_cast(this), 5); @@ -26029,9 +32739,9 @@ class _executeActor5State { a_body1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont2Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont2Catch1(unknown_error(), 0); } fdb_probe_actor_exit("_execute", reinterpret_cast(this), 5); @@ -26040,6 +32750,113 @@ class _executeActor5State { { fdb_probe_actor_enter("_execute", reinterpret_cast(this), 5); a_exitChoose6(); + try { + a_body1cont2Catch1(err, 0); + } + catch (Error& error) { + a_body1cont2Catch1(error, 0); + } catch (...) { + a_body1cont2Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 5); + + } + int a_body1cont6(int loopDepth) + { + try { + loopDepth = a_body1cont3(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont7(int loopDepth) + { + #line 3788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (config.tenantMode == TenantMode::REQUIRED && g_network && g_network->isSimulated()) + #line 32781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 3789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tenantCache = makeReference>(cx, TenantEntryCacheRefreshMode::WATCH); + #line 3790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_7 = tenantCache.get()->init(); + #line 3790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 32789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont7when1(__when_expr_7.get(), loopDepth); }; + static_cast<_executeActor5*>(this)->actor_wait_state = 8; + #line 3790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); + #line 32794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont8(loopDepth); + } + + return loopDepth; + } + int a_body1cont3when1(DatabaseConfiguration const& __config,int loopDepth) + { + #line 3787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config = __config; + #line 32808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont7(loopDepth); + + return loopDepth; + } + int a_body1cont3when1(DatabaseConfiguration && __config,int loopDepth) + { + config = std::move(__config); + loopDepth = a_body1cont7(loopDepth); + + return loopDepth; + } + void a_exitChoose7() + { + if (static_cast<_executeActor5*>(this)->actor_wait_state > 0) static_cast<_executeActor5*>(this)->actor_wait_state = 0; + static_cast<_executeActor5*>(this)->ActorCallback< _executeActor5, 6, DatabaseConfiguration >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor5, 6, DatabaseConfiguration >*,DatabaseConfiguration const& value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 6); + + } + void a_callback_fire(ActorCallback< _executeActor5, 6, DatabaseConfiguration >*,DatabaseConfiguration && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 6); + + } + void a_callback_error(ActorCallback< _executeActor5, 6, DatabaseConfiguration >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 6); + a_exitChoose7(); try { a_body1Catch1(err, 0); } @@ -26048,33 +32865,123 @@ class _executeActor5State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 5); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 6); } - int a_body1cont4(int loopDepth) + int a_body1cont8(int loopDepth) + { + #line 3794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + fileRange = KeyRange(); + #line 3795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + originalFileRanges = std::vector(); + #line 3797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + index = int(); + #line 3798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + index = 0; + #line 32881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont9(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8(loopDepth); + + return loopDepth; + } + int a_body1cont9(Void && _,int loopDepth) + { + loopDepth = a_body1cont8(loopDepth); + + return loopDepth; + } + int a_body1cont7when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont9(_, loopDepth); + + return loopDepth; + } + int a_body1cont7when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont9(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose8() + { + if (static_cast<_executeActor5*>(this)->actor_wait_state > 0) static_cast<_executeActor5*>(this)->actor_wait_state = 0; + static_cast<_executeActor5*>(this)->ActorCallback< _executeActor5, 7, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _executeActor5, 7, Void >*,Void const& value) { - #line 3184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 7); + a_exitChoose8(); + try { + a_body1cont7when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 7); + + } + void a_callback_fire(ActorCallback< _executeActor5, 7, Void >*,Void && value) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 7); + a_exitChoose8(); + try { + a_body1cont7when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 7); + + } + void a_callback_error(ActorCallback< _executeActor5, 7, Void >*,Error err) + { + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 7); + a_exitChoose8(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 7); + + } + int a_body1cont10(int loopDepth) + { + #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!originalFileRanges.empty()) - #line 26058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (BUGGIFY && restoreRanges.get().size() == 1) - #line 26062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.originalFileRange().set(task, originalFileRanges[0]); - #line 26066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 3188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.originalFileRanges().set(task, originalFileRanges); - #line 26072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } } - #line 3191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor5*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor5State(); static_cast<_executeActor5*>(this)->destroy(); return 0; } - #line 26077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 32984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor5*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor5State(); static_cast<_executeActor5*>(this)->finishSendAndDelPromiseRef(); @@ -26082,90 +32989,90 @@ class _executeActor5State { return loopDepth; } - int a_body1cont3loopHead1(int loopDepth) + int a_body1cont8loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont3loopBody1(loopDepth); + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont8loopBody1(loopDepth); return loopDepth; } - int a_body1cont3loopBody1(int loopDepth) + int a_body1cont8loopBody1(int loopDepth) { - #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!(index < restoreRanges.get().size())) - #line 26096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - return a_body1cont3break1(loopDepth==0?0:loopDepth-1); // break + return a_body1cont8break1(loopDepth==0?0:loopDepth-1); // break } - #line 3065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" auto& restoreRange = restoreRanges.get()[index]; - #line 3066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" fileRange = KeyRangeRef(blockData.front().key, blockData.back().key); - #line 3067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!fileRange.intersects(restoreRange)) - #line 26106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - return a_body1cont3continue1(loopDepth); // continue + return a_body1cont8continue1(loopDepth); // continue } - #line 3073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int rangeStart = 1; - #line 3074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int rangeEnd = blockData.size() - 1; - #line 3076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(;rangeStart < rangeEnd && !restoreRange.contains(blockData[rangeStart].key);) { - #line 3077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++rangeStart; - #line 26118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(;rangeEnd > rangeStart && !restoreRange.contains(blockData[rangeEnd - 1].key);) { - #line 3080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" --rangeEnd; - #line 26124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" data = blockData.slice(rangeStart, rangeEnd); - #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" originalFileRange = KeyRangeRef(std::max(fileRange.begin, restoreRange.begin), std::min(fileRange.end, restoreRange.end)); - #line 3089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" originalFileRanges.push_back(originalFileRange); - #line 3092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key fileEnd = std::min(fileRange.end, restoreRange.end); - #line 3093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (fileEnd == (removePrefix.get() == StringRef() ? normalKeys.end : strinc(removePrefix.get()))) - #line 26136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (fileEnd == (removePrefix.get() == StringRef() ? allKeys.end : strinc(removePrefix.get()))) + #line 33043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - fileEnd = addPrefix.get() == StringRef() ? normalKeys.end : strinc(addPrefix.get()); - #line 26140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + fileEnd = addPrefix.get() == StringRef() ? allKeys.end : strinc(addPrefix.get()); + #line 33047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 3096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" fileEnd = fileEnd.removePrefix(removePrefix.get()).withPrefix(addPrefix.get()); - #line 26146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" fileRange = KeyRangeRef(std::max(fileRange.begin, restoreRange.begin) .removePrefix(removePrefix.get()) .withPrefix(addPrefix.get()), fileEnd); - #line 3103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" start = 0; - #line 3104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" end = data.size(); - #line 3105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" dataSizeLimit = BUGGIFY ? deterministicRandom()->randomInt(256 * 1024, 10e6) : CLIENT_KNOBS->RESTORE_WRITE_TX_SIZE; - #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 3109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 26160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont3loopBody1loopHead1(loopDepth); + #line 33067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8loopBody1loopHead1(loopDepth); return loopDepth; } - int a_body1cont3break1(int loopDepth) + int a_body1cont8break1(int loopDepth) { try { - return a_body1cont4(loopDepth); + return a_body1cont10(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -26175,92 +33082,100 @@ class _executeActor5State { return loopDepth; } - int a_body1cont3continue1(int loopDepth) + int a_body1cont8continue1(int loopDepth) { - #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" index++; - #line 26182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (loopDepth == 0) return a_body1cont3loopHead1(0); + #line 33089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (loopDepth == 0) return a_body1cont8loopHead1(0); return loopDepth; } - int a_body1cont3loopBody1cont1(int loopDepth) + int a_body1cont8loopBody1cont1(int loopDepth) { - #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" index++; - #line 26191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (loopDepth == 0) return a_body1cont3loopHead1(0); + #line 33098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (loopDepth == 0) return a_body1cont8loopHead1(0); return loopDepth; } - int a_body1cont3loopBody1loopHead1(int loopDepth) + int a_body1cont8loopBody1loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont3loopBody1loopBody1(loopDepth); + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont8loopBody1loopBody1(loopDepth); return loopDepth; } - int a_body1cont3loopBody1loopBody1(int loopDepth) + int a_body1cont8loopBody1loopBody1(int loopDepth) { try { - #line 3111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 3112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 3114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" i = start; - #line 3115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" txBytes = 0; - #line 3116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" iend = start; - #line 3119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(;iend < end && txBytes < dataSizeLimit;++iend) { - #line 3120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" txBytes += data[iend].key.expectedSize(); - #line 3121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" txBytes += data[iend].value.expectedSize(); - #line 26222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" trRange = KeyRangeRef( (start == 0) ? fileRange.begin : data[start].key.removePrefix(removePrefix.get()).withPrefix(addPrefix.get()), (iend == end) ? fileRange.end : data[iend].key.removePrefix(removePrefix.get()).withPrefix(addPrefix.get())); - #line 3133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->clear(trRange); - #line 3135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(;i < iend;++i) { - #line 3136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::NEXT_WRITE_NO_WRITE_CONFLICT_RANGE); - #line 3137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (tenantCache.present()) + #line 33141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + validTenantCheckFutures.push_back(_validTenantAccess( StringRef(arena, data[i].key.removePrefix(removePrefix.get()).withPrefix(addPrefix.get())), tenantCache.get())); + #line 33145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 3876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->set(data[i].key.removePrefix(removePrefix.get()).withPrefix(addPrefix.get()), data[i].value); - #line 26234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.bytesWritten().atomicOp(tr, txBytes, MutationRef::Type::AddValue); - #line 3144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" checkLock = checkDatabaseLock(tr, restore.getUid()); - #line 3146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_6 = taskBucket->keepRunning(tr, task); - #line 3146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1cont3loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 26244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont3loopBody1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont3loopBody1loopBody1when1(__when_expr_6.get(), loopDepth); }; - static_cast<_executeActor5*>(this)->actor_wait_state = 7; - #line 3146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); - #line 26249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_8 = taskBucket->keepRunning(tr, task); + #line 3885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1cont8loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 33159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont8loopBody1loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont8loopBody1loopBody1when1(__when_expr_8.get(), loopDepth); }; + static_cast<_executeActor5*>(this)->actor_wait_state = 9; + #line 3885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); + #line 33164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1cont3loopBody1loopBody1Catch1(error, loopDepth); + loopDepth = a_body1cont8loopBody1loopBody1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1cont3loopBody1loopBody1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1cont8loopBody1loopBody1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont3loopBody1break1(int loopDepth) + int a_body1cont8loopBody1break1(int loopDepth) { try { - return a_body1cont3loopBody1cont1(loopDepth); + return a_body1cont8loopBody1cont1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); @@ -26270,36 +33185,36 @@ class _executeActor5State { return loopDepth; } - int a_body1cont3loopBody1loopBody1cont1(int loopDepth) + int a_body1cont8loopBody1loopBody1cont1(int loopDepth) { - if (loopDepth == 0) return a_body1cont3loopBody1loopHead1(0); + if (loopDepth == 0) return a_body1cont8loopBody1loopHead1(0); return loopDepth; } - int a_body1cont3loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1cont8loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 3177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (e.code() == error_code_transaction_too_large) - #line 26284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" dataSizeLimit /= 2; - #line 26288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont3loopBody1loopBody1Catch1cont1(loopDepth); + #line 33203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8loopBody1loopBody1Catch1cont1(loopDepth); } else { - #line 3180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_9 = tr->onError(e); - #line 3180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_11 = tr->onError(e); + #line 3924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 26297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), std::max(0, loopDepth - 2)); else return a_body1cont3loopBody1loopBody1Catch1when1(__when_expr_9.get(), loopDepth); }; - static_cast<_executeActor5*>(this)->actor_wait_state = 10; - #line 3180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); - #line 26302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1Catch1(__when_expr_11.getError(), std::max(0, loopDepth - 2)); else return a_body1cont8loopBody1loopBody1Catch1when1(__when_expr_11.get(), loopDepth); }; + static_cast<_executeActor5*>(this)->actor_wait_state = 12; + #line 3924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_11.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); + #line 33217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } } @@ -26311,301 +33226,321 @@ class _executeActor5State { return loopDepth; } - int a_body1cont3loopBody1loopBody1cont2(Void const& _,int loopDepth) + int a_body1cont8loopBody1loopBody1cont2(Void const& _,int loopDepth) { - #line 3148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_7 = checkLock; - #line 3148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1cont3loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 26320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont3loopBody1loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont3loopBody1loopBody1cont2when1(__when_expr_7.get(), loopDepth); }; - static_cast<_executeActor5*>(this)->actor_wait_state = 8; - #line 3148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); - #line 26325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_9 = checkLock; + #line 3887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1cont8loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 33235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1cont8loopBody1loopBody1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1cont8loopBody1loopBody1cont2when1(__when_expr_9.get(), loopDepth); }; + static_cast<_executeActor5*>(this)->actor_wait_state = 10; + #line 3887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); + #line 33240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont3loopBody1loopBody1cont2(Void && _,int loopDepth) + int a_body1cont8loopBody1loopBody1cont2(Void && _,int loopDepth) { - #line 3148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_7 = checkLock; - #line 3148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1cont3loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 26336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont3loopBody1loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont3loopBody1loopBody1cont2when1(__when_expr_7.get(), loopDepth); }; - static_cast<_executeActor5*>(this)->actor_wait_state = 8; - #line 3148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); - #line 26341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_9 = checkLock; + #line 3887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1cont8loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 33251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1cont8loopBody1loopBody1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1cont8loopBody1loopBody1cont2when1(__when_expr_9.get(), loopDepth); }; + static_cast<_executeActor5*>(this)->actor_wait_state = 10; + #line 3887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); + #line 33256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont3loopBody1loopBody1when1(Void const& _,int loopDepth) + int a_body1cont8loopBody1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont3loopBody1loopBody1cont2(_, loopDepth); + loopDepth = a_body1cont8loopBody1loopBody1cont2(_, loopDepth); return loopDepth; } - int a_body1cont3loopBody1loopBody1when1(Void && _,int loopDepth) + int a_body1cont8loopBody1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont3loopBody1loopBody1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont8loopBody1loopBody1cont2(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose7() + void a_exitChoose9() { if (static_cast<_executeActor5*>(this)->actor_wait_state > 0) static_cast<_executeActor5*>(this)->actor_wait_state = 0; - static_cast<_executeActor5*>(this)->ActorCallback< _executeActor5, 6, Void >::remove(); + static_cast<_executeActor5*>(this)->ActorCallback< _executeActor5, 8, Void >::remove(); } - void a_callback_fire(ActorCallback< _executeActor5, 6, Void >*,Void const& value) + void a_callback_fire(ActorCallback< _executeActor5, 8, Void >*,Void const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 8); + a_exitChoose9(); try { - a_body1cont3loopBody1loopBody1when1(value, 0); + a_body1cont8loopBody1loopBody1when1(value, 0); } catch (Error& error) { - a_body1cont3loopBody1loopBody1Catch1(error, 0); + a_body1cont8loopBody1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 6); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 8); } - void a_callback_fire(ActorCallback< _executeActor5, 6, Void >*,Void && value) + void a_callback_fire(ActorCallback< _executeActor5, 8, Void >*,Void && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 8); + a_exitChoose9(); try { - a_body1cont3loopBody1loopBody1when1(std::move(value), 0); + a_body1cont8loopBody1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1cont3loopBody1loopBody1Catch1(error, 0); + a_body1cont8loopBody1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 6); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 8); } - void a_callback_error(ActorCallback< _executeActor5, 6, Void >*,Error err) + void a_callback_error(ActorCallback< _executeActor5, 8, Void >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 8); + a_exitChoose9(); try { - a_body1cont3loopBody1loopBody1Catch1(err, 0); + a_body1cont8loopBody1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1cont3loopBody1loopBody1Catch1(error, 0); + a_body1cont8loopBody1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 6); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 8); } - int a_body1cont3loopBody1loopBody1cont5(Void const& _,int loopDepth) + int a_body1cont8loopBody1loopBody1cont6(Void const& _,int loopDepth) { - #line 3150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_8 = tr->commit(); - #line 3150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1cont3loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 26415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont3loopBody1loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont3loopBody1loopBody1cont5when1(__when_expr_8.get(), loopDepth); }; - static_cast<_executeActor5*>(this)->actor_wait_state = 9; - #line 3150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); - #line 26420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_10 = tr->commit(); + #line 3889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1cont8loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 33330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1cont8loopBody1loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont8loopBody1loopBody1cont6when1(__when_expr_10.get(), loopDepth); }; + static_cast<_executeActor5*>(this)->actor_wait_state = 11; + #line 3889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_10.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); + #line 33335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont3loopBody1loopBody1cont5(Void && _,int loopDepth) + int a_body1cont8loopBody1loopBody1cont6(Void && _,int loopDepth) { - #line 3150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_8 = tr->commit(); - #line 3150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1cont3loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 26431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont3loopBody1loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont3loopBody1loopBody1cont5when1(__when_expr_8.get(), loopDepth); }; - static_cast<_executeActor5*>(this)->actor_wait_state = 9; - #line 3150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); - #line 26436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_10 = tr->commit(); + #line 3889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast<_executeActor5*>(this)->actor_wait_state < 0) return a_body1cont8loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 33346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1cont8loopBody1loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont8loopBody1loopBody1cont6when1(__when_expr_10.get(), loopDepth); }; + static_cast<_executeActor5*>(this)->actor_wait_state = 11; + #line 3889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_10.addCallbackAndClear(static_cast*>(static_cast<_executeActor5*>(this))); + #line 33351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont3loopBody1loopBody1cont2when1(Void const& _,int loopDepth) + int a_body1cont8loopBody1loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont3loopBody1loopBody1cont5(_, loopDepth); + loopDepth = a_body1cont8loopBody1loopBody1cont6(_, loopDepth); return loopDepth; } - int a_body1cont3loopBody1loopBody1cont2when1(Void && _,int loopDepth) + int a_body1cont8loopBody1loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont3loopBody1loopBody1cont5(std::move(_), loopDepth); + loopDepth = a_body1cont8loopBody1loopBody1cont6(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose8() + void a_exitChoose10() { if (static_cast<_executeActor5*>(this)->actor_wait_state > 0) static_cast<_executeActor5*>(this)->actor_wait_state = 0; - static_cast<_executeActor5*>(this)->ActorCallback< _executeActor5, 7, Void >::remove(); + static_cast<_executeActor5*>(this)->ActorCallback< _executeActor5, 9, Void >::remove(); } - void a_callback_fire(ActorCallback< _executeActor5, 7, Void >*,Void const& value) + void a_callback_fire(ActorCallback< _executeActor5, 9, Void >*,Void const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 7); - a_exitChoose8(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 9); + a_exitChoose10(); try { - a_body1cont3loopBody1loopBody1cont2when1(value, 0); + a_body1cont8loopBody1loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1cont3loopBody1loopBody1Catch1(error, 0); + a_body1cont8loopBody1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 7); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 9); } - void a_callback_fire(ActorCallback< _executeActor5, 7, Void >*,Void && value) + void a_callback_fire(ActorCallback< _executeActor5, 9, Void >*,Void && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 7); - a_exitChoose8(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 9); + a_exitChoose10(); try { - a_body1cont3loopBody1loopBody1cont2when1(std::move(value), 0); + a_body1cont8loopBody1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1cont3loopBody1loopBody1Catch1(error, 0); + a_body1cont8loopBody1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 7); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 9); } - void a_callback_error(ActorCallback< _executeActor5, 7, Void >*,Error err) + void a_callback_error(ActorCallback< _executeActor5, 9, Void >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 7); - a_exitChoose8(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 9); + a_exitChoose10(); try { - a_body1cont3loopBody1loopBody1Catch1(err, 0); + a_body1cont8loopBody1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1cont3loopBody1loopBody1Catch1(error, 0); + a_body1cont8loopBody1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 7); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 9); } - int a_body1cont3loopBody1loopBody1cont6(Void const& _,int loopDepth) + int a_body1cont8loopBody1loopBody1cont7(Void const& _,int loopDepth) { - #line 3152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!validTenantCheckFutures.empty()) + #line 33423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 3892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + waitForAll(validTenantCheckFutures); + #line 3893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + validTenantCheckFutures.clear(); + #line 33429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 3896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreCommittedRange") .suppressFor(60) .detail("RestoreUID", restore.getUid()) .detail("FileName", rangeFile.fileName) .detail("FileVersion", rangeFile.version) .detail("FileSize", rangeFile.fileSize) .detail("ReadOffset", readOffset) .detail("ReadLen", readLen) .detail("CommitVersion", tr->getCommittedVersion()) .detail("BeginRange", trRange.begin) .detail("EndRange", trRange.end) .detail("StartIndex", start) .detail("EndIndex", i) .detail("DataSize", data.size()) .detail("Bytes", txBytes) .detail("OriginalFileRange", originalFileRange) .detail("TaskInstance", THIS_ADDR); - #line 3171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" start = i; - #line 3173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (start == end) - #line 26512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - return a_body1cont3loopBody1break1(loopDepth==0?0:loopDepth-1); // break + return a_body1cont8loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 3175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 26518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont3loopBody1loopBody1cont9(loopDepth); + #line 33443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8loopBody1loopBody1cont11(loopDepth); return loopDepth; } - int a_body1cont3loopBody1loopBody1cont6(Void && _,int loopDepth) + int a_body1cont8loopBody1loopBody1cont7(Void && _,int loopDepth) { - #line 3152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!validTenantCheckFutures.empty()) + #line 33452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 3892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + waitForAll(validTenantCheckFutures); + #line 3893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + validTenantCheckFutures.clear(); + #line 33458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 3896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreCommittedRange") .suppressFor(60) .detail("RestoreUID", restore.getUid()) .detail("FileName", rangeFile.fileName) .detail("FileVersion", rangeFile.version) .detail("FileSize", rangeFile.fileSize) .detail("ReadOffset", readOffset) .detail("ReadLen", readLen) .detail("CommitVersion", tr->getCommittedVersion()) .detail("BeginRange", trRange.begin) .detail("EndRange", trRange.end) .detail("StartIndex", start) .detail("EndIndex", i) .detail("DataSize", data.size()) .detail("Bytes", txBytes) .detail("OriginalFileRange", originalFileRange) .detail("TaskInstance", THIS_ADDR); - #line 3171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" start = i; - #line 3173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (start == end) - #line 26531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - return a_body1cont3loopBody1break1(loopDepth==0?0:loopDepth-1); // break + return a_body1cont8loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 3175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 26537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont3loopBody1loopBody1cont9(loopDepth); + #line 33472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8loopBody1loopBody1cont11(loopDepth); return loopDepth; } - int a_body1cont3loopBody1loopBody1cont5when1(Void const& _,int loopDepth) + int a_body1cont8loopBody1loopBody1cont6when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont3loopBody1loopBody1cont6(_, loopDepth); + loopDepth = a_body1cont8loopBody1loopBody1cont7(_, loopDepth); return loopDepth; } - int a_body1cont3loopBody1loopBody1cont5when1(Void && _,int loopDepth) + int a_body1cont8loopBody1loopBody1cont6when1(Void && _,int loopDepth) { - loopDepth = a_body1cont3loopBody1loopBody1cont6(std::move(_), loopDepth); + loopDepth = a_body1cont8loopBody1loopBody1cont7(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose9() + void a_exitChoose11() { if (static_cast<_executeActor5*>(this)->actor_wait_state > 0) static_cast<_executeActor5*>(this)->actor_wait_state = 0; - static_cast<_executeActor5*>(this)->ActorCallback< _executeActor5, 8, Void >::remove(); + static_cast<_executeActor5*>(this)->ActorCallback< _executeActor5, 10, Void >::remove(); } - void a_callback_fire(ActorCallback< _executeActor5, 8, Void >*,Void const& value) + void a_callback_fire(ActorCallback< _executeActor5, 10, Void >*,Void const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 8); - a_exitChoose9(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 10); + a_exitChoose11(); try { - a_body1cont3loopBody1loopBody1cont5when1(value, 0); + a_body1cont8loopBody1loopBody1cont6when1(value, 0); } catch (Error& error) { - a_body1cont3loopBody1loopBody1Catch1(error, 0); + a_body1cont8loopBody1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 8); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 10); } - void a_callback_fire(ActorCallback< _executeActor5, 8, Void >*,Void && value) + void a_callback_fire(ActorCallback< _executeActor5, 10, Void >*,Void && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 8); - a_exitChoose9(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 10); + a_exitChoose11(); try { - a_body1cont3loopBody1loopBody1cont5when1(std::move(value), 0); + a_body1cont8loopBody1loopBody1cont6when1(std::move(value), 0); } catch (Error& error) { - a_body1cont3loopBody1loopBody1Catch1(error, 0); + a_body1cont8loopBody1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 8); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 10); } - void a_callback_error(ActorCallback< _executeActor5, 8, Void >*,Error err) + void a_callback_error(ActorCallback< _executeActor5, 10, Void >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 8); - a_exitChoose9(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 10); + a_exitChoose11(); try { - a_body1cont3loopBody1loopBody1Catch1(err, 0); + a_body1cont8loopBody1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1cont3loopBody1loopBody1Catch1(error, 0); + a_body1cont8loopBody1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 8); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 10); } - int a_body1cont3loopBody1loopBody1cont9(int loopDepth) + int a_body1cont8loopBody1loopBody1cont11(int loopDepth) { try { - loopDepth = a_body1cont3loopBody1loopBody1cont1(loopDepth); + loopDepth = a_body1cont8loopBody1loopBody1cont1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 2)); @@ -26615,76 +33550,76 @@ class _executeActor5State { return loopDepth; } - int a_body1cont3loopBody1loopBody1Catch1cont1(int loopDepth) + int a_body1cont8loopBody1loopBody1Catch1cont1(int loopDepth) { - loopDepth = a_body1cont3loopBody1loopBody1cont1(loopDepth); + loopDepth = a_body1cont8loopBody1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont3loopBody1loopBody1Catch1cont3(Void const& _,int loopDepth) + int a_body1cont8loopBody1loopBody1Catch1cont3(Void const& _,int loopDepth) { - loopDepth = a_body1cont3loopBody1loopBody1Catch1cont1(loopDepth); + loopDepth = a_body1cont8loopBody1loopBody1Catch1cont1(loopDepth); return loopDepth; } - int a_body1cont3loopBody1loopBody1Catch1cont3(Void && _,int loopDepth) + int a_body1cont8loopBody1loopBody1Catch1cont3(Void && _,int loopDepth) { - loopDepth = a_body1cont3loopBody1loopBody1Catch1cont1(loopDepth); + loopDepth = a_body1cont8loopBody1loopBody1Catch1cont1(loopDepth); return loopDepth; } - int a_body1cont3loopBody1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont8loopBody1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont3loopBody1loopBody1Catch1cont3(_, loopDepth); + loopDepth = a_body1cont8loopBody1loopBody1Catch1cont3(_, loopDepth); return loopDepth; } - int a_body1cont3loopBody1loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1cont8loopBody1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont3loopBody1loopBody1Catch1cont3(std::move(_), loopDepth); + loopDepth = a_body1cont8loopBody1loopBody1Catch1cont3(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose10() + void a_exitChoose12() { if (static_cast<_executeActor5*>(this)->actor_wait_state > 0) static_cast<_executeActor5*>(this)->actor_wait_state = 0; - static_cast<_executeActor5*>(this)->ActorCallback< _executeActor5, 9, Void >::remove(); + static_cast<_executeActor5*>(this)->ActorCallback< _executeActor5, 11, Void >::remove(); } - void a_callback_fire(ActorCallback< _executeActor5, 9, Void >*,Void const& value) + void a_callback_fire(ActorCallback< _executeActor5, 11, Void >*,Void const& value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 9); - a_exitChoose10(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 11); + a_exitChoose12(); try { - a_body1cont3loopBody1loopBody1Catch1when1(value, 0); + a_body1cont8loopBody1loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 9); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 11); } - void a_callback_fire(ActorCallback< _executeActor5, 9, Void >*,Void && value) + void a_callback_fire(ActorCallback< _executeActor5, 11, Void >*,Void && value) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 9); - a_exitChoose10(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 11); + a_exitChoose12(); try { - a_body1cont3loopBody1loopBody1Catch1when1(std::move(value), 0); + a_body1cont8loopBody1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 9); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 11); } - void a_callback_error(ActorCallback< _executeActor5, 9, Void >*,Error err) + void a_callback_error(ActorCallback< _executeActor5, 11, Void >*,Error err) { - fdb_probe_actor_enter("_execute", reinterpret_cast(this), 9); - a_exitChoose10(); + fdb_probe_actor_enter("_execute", reinterpret_cast(this), 11); + a_exitChoose12(); try { a_body1Catch1(err, 0); } @@ -26693,71 +33628,79 @@ class _executeActor5State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("_execute", reinterpret_cast(this), 9); + fdb_probe_actor_exit("_execute", reinterpret_cast(this), 11); } - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 3012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig restore; - #line 3014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreFile rangeFile; - #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t readOffset; - #line 3016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t readLen; - #line 3028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 3029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future> bc; - #line 3030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future> restoreRanges; - #line 3031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future addPrefix; - #line 3032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future removePrefix; - #line 3056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference inFile; - #line 3057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> blockData; - #line 3060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional>> tenantCache; + #line 3785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::vector> validTenantCheckFutures; + #line 3786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Arena arena; + #line 3787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DatabaseConfiguration config; + #line 3794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyRange fileRange; - #line 3061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector originalFileRanges; - #line 3063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int index; - #line 3082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" VectorRef data; - #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyRange originalFileRange; - #line 3103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int start; - #line 3104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int end; - #line 3105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int dataSizeLimit; - #line 3114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int i; - #line 3115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int txBytes; - #line 3116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int iend; - #line 3127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyRange trRange; - #line 3144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future checkLock; - #line 26755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class _executeActor5 final : public Actor, public ActorCallback< _executeActor5, 0, Reference >, public ActorCallback< _executeActor5, 1, Void >, public ActorCallback< _executeActor5, 2, Void >, public ActorCallback< _executeActor5, 3, Void >, public ActorCallback< _executeActor5, 4, Reference >, public ActorCallback< _executeActor5, 5, Standalone> >, public ActorCallback< _executeActor5, 6, Void >, public ActorCallback< _executeActor5, 7, Void >, public ActorCallback< _executeActor5, 8, Void >, public ActorCallback< _executeActor5, 9, Void >, public FastAllocated<_executeActor5>, public _executeActor5State<_executeActor5> { - #line 26760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _executeActor5 final : public Actor, public ActorCallback< _executeActor5, 0, Reference >, public ActorCallback< _executeActor5, 1, Void >, public ActorCallback< _executeActor5, 2, Void >, public ActorCallback< _executeActor5, 3, Void >, public ActorCallback< _executeActor5, 4, Reference >, public ActorCallback< _executeActor5, 5, Standalone> >, public ActorCallback< _executeActor5, 6, DatabaseConfiguration >, public ActorCallback< _executeActor5, 7, Void >, public ActorCallback< _executeActor5, 8, Void >, public ActorCallback< _executeActor5, 9, Void >, public ActorCallback< _executeActor5, 10, Void >, public ActorCallback< _executeActor5, 11, Void >, public FastAllocated<_executeActor5>, public _executeActor5State<_executeActor5> { + #line 33703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor5>::operator new; using FastAllocated<_executeActor5>::operator delete; @@ -26771,13 +33714,15 @@ friend struct ActorCallback< _executeActor5, 2, Void >; friend struct ActorCallback< _executeActor5, 3, Void >; friend struct ActorCallback< _executeActor5, 4, Reference >; friend struct ActorCallback< _executeActor5, 5, Standalone> >; -friend struct ActorCallback< _executeActor5, 6, Void >; +friend struct ActorCallback< _executeActor5, 6, DatabaseConfiguration >; friend struct ActorCallback< _executeActor5, 7, Void >; friend struct ActorCallback< _executeActor5, 8, Void >; friend struct ActorCallback< _executeActor5, 9, Void >; - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +friend struct ActorCallback< _executeActor5, 10, Void >; +friend struct ActorCallback< _executeActor5, 11, Void >; + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _executeActor5(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 26780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _executeActor5State<_executeActor5>(cx, taskBucket, futureBucket, task) { @@ -26801,45 +33746,47 @@ friend struct ActorCallback< _executeActor5, 9, Void >; case 4: this->a_callback_error((ActorCallback< _executeActor5, 3, Void >*)0, actor_cancelled()); break; case 5: this->a_callback_error((ActorCallback< _executeActor5, 4, Reference >*)0, actor_cancelled()); break; case 6: this->a_callback_error((ActorCallback< _executeActor5, 5, Standalone> >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< _executeActor5, 6, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< _executeActor5, 6, DatabaseConfiguration >*)0, actor_cancelled()); break; case 8: this->a_callback_error((ActorCallback< _executeActor5, 7, Void >*)0, actor_cancelled()); break; case 9: this->a_callback_error((ActorCallback< _executeActor5, 8, Void >*)0, actor_cancelled()); break; case 10: this->a_callback_error((ActorCallback< _executeActor5, 9, Void >*)0, actor_cancelled()); break; + case 11: this->a_callback_error((ActorCallback< _executeActor5, 10, Void >*)0, actor_cancelled()); break; + case 12: this->a_callback_error((ActorCallback< _executeActor5, 11, Void >*)0, actor_cancelled()); break; } } }; - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _executeActor5(cx, taskBucket, futureBucket, task)); - #line 26816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 3193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 26821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor11State { - #line 26827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor11State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 3198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore(task) - #line 26842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -26852,32 +33799,32 @@ class _finishActor11State { int a_body1(int loopDepth=0) { try { - #line 3199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.fileBlocksFinished().atomicOp(tr, 1, MutationRef::Type::AddValue); - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector> updateMap; - #line 3203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector ranges = Params.getOriginalFileRanges(task); - #line 3204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& range : ranges ) { - #line 3205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Value versionEncoded = BinaryWriter::toValue(Params.inputFile().get(task).version, Unversioned()); - #line 3206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" updateMap.push_back(krmSetRange(tr, restore.applyMutationsMapPrefix(), range, versionEncoded)); - #line 26867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskFuture = futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone]); - #line 3210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = taskFuture->set(tr, taskBucket) && taskBucket->finish(tr, task) && waitForAll(updateMap); - #line 3210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor11*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 26875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor11*>(this)->actor_wait_state = 1; - #line 3210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor11*>(this))); - #line 26880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -26898,9 +33845,9 @@ class _finishActor11State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 3212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor11*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor11State(); static_cast<_finishActor11*>(this)->destroy(); return 0; } - #line 26903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor11*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor11State(); static_cast<_finishActor11*>(this)->finishSendAndDelPromiseRef(); @@ -26910,9 +33857,9 @@ class _finishActor11State { } int a_body1cont1(Void && _,int loopDepth) { - #line 3212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor11*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor11State(); static_cast<_finishActor11*>(this)->destroy(); return 0; } - #line 26915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor11*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor11State(); static_cast<_finishActor11*>(this)->finishSendAndDelPromiseRef(); @@ -26983,24 +33930,24 @@ class _finishActor11State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); } - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 3198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig restore; - #line 3209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskFuture; - #line 26998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor11 final : public Actor, public ActorCallback< _finishActor11, 0, Void >, public FastAllocated<_finishActor11>, public _finishActor11State<_finishActor11> { - #line 27003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor11>::operator new; using FastAllocated<_finishActor11>::operator delete; @@ -27009,9 +33956,9 @@ class _finishActor11 final : public Actor, public ActorCallback< _finishAc void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< _finishActor11, 0, Void >; - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor11(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 27014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _finishActor11State<_finishActor11>(tr, taskBucket, futureBucket, task) { @@ -27034,43 +33981,43 @@ friend struct ActorCallback< _finishActor11, 0, Void >; } }; - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _finishActor11(tr, taskBucket, futureBucket, task)); - #line 27041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 3214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 27046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor9State { - #line 27052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 33999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor9State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,RestoreFile const& rf,int64_t const& offset,int64_t const& len,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" parentTask(parentTask), - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" rf(rf), - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" offset(offset), - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" len(len), - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" completionKey(completionKey), - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" waitFor(waitFor) - #line 27073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -27083,16 +34030,16 @@ class AddTaskActor9State { int a_body1(int loopDepth=0) { try { - #line 3223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 3223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 27090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -27113,36 +34060,36 @@ class AddTaskActor9State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 3224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task = Reference(new Task(RestoreRangeTaskFunc::name, RestoreRangeTaskFunc::version, doneKey)); - #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = RestoreConfig(parentTask).toTask(tr, task); - #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 27122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 3224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task = Reference(new Task(RestoreRangeTaskFunc::name, RestoreRangeTaskFunc::version, doneKey)); - #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = RestoreConfig(parentTask).toTask(tr, task); - #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 27140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -27212,68 +34159,68 @@ class AddTaskActor9State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.inputFile().set(task, rf); - #line 3230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.readOffset().set(task, offset); - #line 3231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.readLen().set(task, len); - #line 3233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!waitFor) - #line 27223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task)); this->~AddTaskActor9State(); static_cast(this)->destroy(); return 0; } - #line 27227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task)); this->~AddTaskActor9State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = waitFor->onSetAddTask(tr, taskBucket, task); - #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 27237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.inputFile().set(task, rf); - #line 3230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.readOffset().set(task, offset); - #line 3231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.readLen().set(task, len); - #line 3233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!waitFor) - #line 27257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task)); this->~AddTaskActor9State(); static_cast(this)->destroy(); return 0; } - #line 27261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task)); this->~AddTaskActor9State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = waitFor->onSetAddTask(tr, taskBucket, task); - #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 27271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -27343,10 +34290,10 @@ class AddTaskActor9State { } int a_body1cont3(Void const& _,int loopDepth) { - #line 3238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor9State(); static_cast(this)->destroy(); return 0; } - #line 27348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 3982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor9State(); static_cast(this)->destroy(); return 0; } + #line 34295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor9State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -27355,10 +34302,10 @@ class AddTaskActor9State { } int a_body1cont3(Void && _,int loopDepth) { - #line 3238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor9State(); static_cast(this)->destroy(); return 0; } - #line 27360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 3982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor9State(); static_cast(this)->destroy(); return 0; } + #line 34307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor9State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -27428,30 +34375,30 @@ class AddTaskActor9State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 2); } - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference parentTask; - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreFile rf; - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t offset; - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t len; - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference waitFor; - #line 3224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 27449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor9 final : public Actor, public ActorCallback< AddTaskActor9, 0, Key >, public ActorCallback< AddTaskActor9, 1, Void >, public ActorCallback< AddTaskActor9, 2, Void >, public FastAllocated, public AddTaskActor9State { - #line 27454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -27462,9 +34409,9 @@ class AddTaskActor9 final : public Actor, public ActorCallback< AddTaskActo friend struct ActorCallback< AddTaskActor9, 0, Key >; friend struct ActorCallback< AddTaskActor9, 1, Void >; friend struct ActorCallback< AddTaskActor9, 2, Void >; - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor9(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,RestoreFile const& rf,int64_t const& offset,int64_t const& len,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 27467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), AddTaskActor9State(tr, taskBucket, parentTask, rf, offset, len, completionKey, waitFor) { @@ -27489,14 +34436,14 @@ friend struct ActorCallback< AddTaskActor9, 2, Void >; } }; - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, RestoreFile const& rf, int64_t const& offset, int64_t const& len, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 3959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new AddTaskActor9(tr, taskBucket, parentTask, rf, offset, len, completionKey, waitFor)); - #line 27496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 3240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" static StringRef name; static constexpr uint32_t version = 1; @@ -27515,7 +34462,7 @@ friend struct ActorCallback< AddTaskActor9, 2, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef RestoreRangeTaskFunc::name = LiteralStringRef("restore_range_data"); +StringRef RestoreRangeTaskFunc::name = "restore_range_data"_sr; REGISTER_TASKFUNC(RestoreRangeTaskFunc); // Decodes a mutation log key, which contains (hash, commitVersion, chunkNumber) and @@ -27609,6 +34556,14 @@ bool AccumulatedMutations::isComplete() const { bool AccumulatedMutations::matchesAnyRange(const RangeMapFilters& filters) const { std::vector mutations = decodeMutationLogValue(serializedMutations); for (auto& m : mutations) { + if (m.type == MutationRef::Encrypted) { + // TODO: In order to filter out encrypted mutations that are not relevant to the + // target range, they would have to be decrypted here in order to check relevance + // below, however the staged mutations would still need to remain encrypted for + // staging into the destination database. Without decrypting, we must assume that + // some data could match the range and return true here. + return true; + } if (filters.match(m)) { return true; } @@ -27677,34 +34632,34 @@ struct RestoreLogDataTaskFunc : RestoreFileTaskFuncBase { static struct : InputParams { } Params; - #line 27680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _executeActor6State { - #line 27686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _executeActor6State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : cx(cx), - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 3424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore(task), - #line 3426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" logFile(Params.inputFile().get(task)), - #line 3427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" readOffset(Params.readOffset().get(task)), - #line 3428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" readLen(Params.readLen().get(task)) - #line 27707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -27717,17 +34672,17 @@ class _executeActor6State { int a_body1(int loopDepth=0) { try { - #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreLogStart") .suppressFor(60) .detail("RestoreUID", restore.getUid()) .detail("FileName", logFile.fileName) .detail("FileBeginVersion", logFile.version) .detail("FileEndVersion", logFile.endVersion) .detail("FileSize", logFile.fileSize) .detail("ReadOffset", readOffset) .detail("ReadLen", readLen) .detail("TaskInstance", THIS_ADDR); - #line 3441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 3442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc = Reference(); - #line 3443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ranges = std::vector(); - #line 3445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 27730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -27748,18 +34703,18 @@ class _executeActor6State { } int a_body1cont1(int loopDepth) { - #line 3464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" mutationLogPrefix = restore.mutationLogPrefix(); - #line 3465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_5 = bc->readFile(logFile.fileName); - #line 3465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 27757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont1when1(__when_expr_5.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 6; - #line 3465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast >*>(static_cast<_executeActor6*>(this))); - #line 27762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -27774,20 +34729,20 @@ class _executeActor6State { int a_body1loopBody1(int loopDepth) { try { - #line 3447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 3448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 3450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_0 = restore.sourceContainer().getOrThrow(tr); - #line 3450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 27785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 1; - #line 3450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast<_executeActor6*>(this))); - #line 27790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -27820,16 +34775,16 @@ class _executeActor6State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = tr->onError(e); - #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 27827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 5; - #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 27832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -27842,36 +34797,36 @@ class _executeActor6State { } int a_body1loopBody1cont2(Reference const& _bc,int loopDepth) { - #line 3451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc = getBackupContainerWithProxy(_bc); - #line 3453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = store(ranges, restore.getRestoreRangesOrDefault(tr)); - #line 3453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 27851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 2; - #line 3453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 27856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Reference && _bc,int loopDepth) { - #line 3451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc = getBackupContainerWithProxy(_bc); - #line 3453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = store(ranges, restore.getRestoreRangesOrDefault(tr)); - #line 3453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 27869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 2; - #line 3453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 27874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -27941,32 +34896,32 @@ class _executeActor6State { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 3455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = checkTaskVersion(tr->getDatabase(), task, name, version); - #line 3455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 27948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 3; - #line 3455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 27953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 3455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = checkTaskVersion(tr->getDatabase(), task, name, version); - #line 3455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 27964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 3; - #line 3455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 27969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -28036,32 +34991,32 @@ class _executeActor6State { } int a_body1loopBody1cont4(Void const& _,int loopDepth) { - #line 3456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = taskBucket->keepRunning(tr, task); - #line 3456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 28043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 34998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 4; - #line 3456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 28048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont4(Void && _,int loopDepth) { - #line 3456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = taskBucket->keepRunning(tr, task); - #line 3456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 28059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 4; - #line 3456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 28064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -28281,25 +35236,25 @@ class _executeActor6State { } int a_body1cont2(int loopDepth) { - #line 3466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture>> __when_expr_6 = decodeMutationLogFileBlock(inFile, readOffset, readLen); - #line 3466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 28288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont2when1(__when_expr_6.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 7; - #line 3466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast> >*>(static_cast<_executeActor6*>(this))); - #line 28293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1when1(Reference const& __inFile,int loopDepth) { - #line 3465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" inFile = __inFile; - #line 28302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -28364,30 +35319,30 @@ class _executeActor6State { } int a_body1cont3(int loopDepth) { - #line 3471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RangeMapFilters filters(ranges); - #line 3472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" dataFiltered = filterLogMutationKVPairs(dataOriginal, filters); - #line 3474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" start = 0; - #line 3475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" end = dataFiltered.size(); - #line 3476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" dataSizeLimit = BUGGIFY ? deterministicRandom()->randomInt(256 * 1024, 10e6) : CLIENT_KNOBS->RESTORE_WRITE_TX_SIZE; - #line 3479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 3480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 28381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont3loopHead1(loopDepth); return loopDepth; } int a_body1cont2when1(Standalone> const& __dataOriginal,int loopDepth) { - #line 3466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" dataOriginal = __dataOriginal; - #line 28390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; @@ -28460,52 +35415,52 @@ class _executeActor6State { int a_body1cont3loopBody1(int loopDepth) { try { - #line 3482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (start == end) - #line 28465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor6*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor6State(); static_cast<_executeActor6*>(this)->destroy(); return 0; } - #line 28469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor6*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor6State(); static_cast<_executeActor6*>(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 3486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 3488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" i = start; - #line 3489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" txBytes = 0; - #line 3490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(;i < end && txBytes < dataSizeLimit;++i) { - #line 3491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key k = dataFiltered[i].key.withPrefix(mutationLogPrefix); - #line 3492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ValueRef v = dataFiltered[i].value; - #line 3493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->set(k, v); - #line 3494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" txBytes += k.expectedSize(); - #line 3495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" txBytes += v.expectedSize(); - #line 28495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" checkLock = checkDatabaseLock(tr, restore.getUid()); - #line 3500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_7 = taskBucket->keepRunning(tr, task); - #line 3500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 28503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont3loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont3loopBody1when1(__when_expr_7.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 8; - #line 3500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 28508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -28525,27 +35480,27 @@ class _executeActor6State { int a_body1cont3loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 3529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (e.code() == error_code_transaction_too_large) - #line 28530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" dataSizeLimit /= 2; - #line 28534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont3loopBody1Catch1cont1(loopDepth); } else { - #line 3532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_10 = tr->onError(e); - #line 3532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 28543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1Catch1(__when_expr_10.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1Catch1when1(__when_expr_10.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 11; - #line 3532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 28548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } } @@ -28559,32 +35514,32 @@ class _executeActor6State { } int a_body1cont3loopBody1cont2(Void const& _,int loopDepth) { - #line 3501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_8 = checkLock; - #line 3501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 28566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont3loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont3loopBody1cont2when1(__when_expr_8.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 9; - #line 3501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 28571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3loopBody1cont2(Void && _,int loopDepth) { - #line 3501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_8 = checkLock; - #line 3501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 28582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont3loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont3loopBody1cont2when1(__when_expr_8.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 9; - #line 3501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 28587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -28654,36 +35609,36 @@ class _executeActor6State { } int a_body1cont3loopBody1cont5(Void const& _,int loopDepth) { - #line 3504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.bytesWritten().atomicOp(tr, txBytes, MutationRef::Type::AddValue); - #line 3506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_9 = tr->commit(); - #line 3506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 28663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1cont3loopBody1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1cont3loopBody1cont5when1(__when_expr_9.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 10; - #line 3506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 28668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3loopBody1cont5(Void && _,int loopDepth) { - #line 3504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.bytesWritten().atomicOp(tr, txBytes, MutationRef::Type::AddValue); - #line 3506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_9 = tr->commit(); - #line 3506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor6*>(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 28681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1cont3loopBody1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1cont3loopBody1cont5when1(__when_expr_9.get(), loopDepth); }; static_cast<_executeActor6*>(this)->actor_wait_state = 10; - #line 3506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_executeActor6*>(this))); - #line 28686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -28753,26 +35708,26 @@ class _executeActor6State { } int a_body1cont3loopBody1cont6(Void const& _,int loopDepth) { - #line 3508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreCommittedLog") .suppressFor(60) .detail("RestoreUID", restore.getUid()) .detail("FileName", logFile.fileName) .detail("FileBeginVersion", logFile.version) .detail("FileEndVersion", logFile.endVersion) .detail("FileSize", logFile.fileSize) .detail("ReadOffset", readOffset) .detail("ReadLen", readLen) .detail("CommitVersion", tr->getCommittedVersion()) .detail("StartIndex", start) .detail("EndIndex", i) .detail("RecordCountOriginal", dataOriginal.size()) .detail("RecordCountFiltered", dataFiltered.size()) .detail("Bytes", txBytes) .detail("TaskInstance", THIS_ADDR); - #line 3526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" start = i; - #line 3527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 28762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont3loopBody1cont8(loopDepth); return loopDepth; } int a_body1cont3loopBody1cont6(Void && _,int loopDepth) { - #line 3508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreCommittedLog") .suppressFor(60) .detail("RestoreUID", restore.getUid()) .detail("FileName", logFile.fileName) .detail("FileBeginVersion", logFile.version) .detail("FileEndVersion", logFile.endVersion) .detail("FileSize", logFile.fileSize) .detail("ReadOffset", readOffset) .detail("ReadLen", readLen) .detail("CommitVersion", tr->getCommittedVersion()) .detail("StartIndex", start) .detail("EndIndex", i) .detail("RecordCountOriginal", dataOriginal.size()) .detail("RecordCountFiltered", dataFiltered.size()) .detail("Bytes", txBytes) .detail("TaskInstance", THIS_ADDR); - #line 3526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" start = i; - #line 3527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 28775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont3loopBody1cont8(loopDepth); return loopDepth; @@ -28934,54 +35889,54 @@ class _executeActor6State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 10); } - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 3424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig restore; - #line 3426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreFile logFile; - #line 3427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t readOffset; - #line 3428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t readLen; - #line 3441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 3442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference bc; - #line 3443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector ranges; - #line 3464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key mutationLogPrefix; - #line 3465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference inFile; - #line 3466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> dataOriginal; - #line 3472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector dataFiltered; - #line 3474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int start; - #line 3475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int end; - #line 3476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int dataSizeLimit; - #line 3488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int i; - #line 3489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int txBytes; - #line 3498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future checkLock; - #line 28979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _executeActor6 final : public Actor, public ActorCallback< _executeActor6, 0, Reference >, public ActorCallback< _executeActor6, 1, Void >, public ActorCallback< _executeActor6, 2, Void >, public ActorCallback< _executeActor6, 3, Void >, public ActorCallback< _executeActor6, 4, Void >, public ActorCallback< _executeActor6, 5, Reference >, public ActorCallback< _executeActor6, 6, Standalone> >, public ActorCallback< _executeActor6, 7, Void >, public ActorCallback< _executeActor6, 8, Void >, public ActorCallback< _executeActor6, 9, Void >, public ActorCallback< _executeActor6, 10, Void >, public FastAllocated<_executeActor6>, public _executeActor6State<_executeActor6> { - #line 28984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor6>::operator new; using FastAllocated<_executeActor6>::operator delete; @@ -29000,9 +35955,9 @@ friend struct ActorCallback< _executeActor6, 7, Void >; friend struct ActorCallback< _executeActor6, 8, Void >; friend struct ActorCallback< _executeActor6, 9, Void >; friend struct ActorCallback< _executeActor6, 10, Void >; - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _executeActor6(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 29005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _executeActor6State<_executeActor6>(cx, taskBucket, futureBucket, task) { @@ -29035,35 +35990,35 @@ friend struct ActorCallback< _executeActor6, 10, Void >; } }; - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _executeActor6(cx, taskBucket, futureBucket, task)); - #line 29042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 35997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 3536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 4288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 29047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor12State { - #line 29053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor12State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task) - #line 29066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -29076,20 +36031,20 @@ class _finishActor12State { int a_body1(int loopDepth=0) { try { - #line 3541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig(task).fileBlocksFinished().atomicOp(tr, 1, MutationRef::Type::AddValue); - #line 3543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskFuture = futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone]); - #line 3547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = taskFuture->set(tr, taskBucket) && taskBucket->finish(tr, task); - #line 3547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor12*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 29087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor12*>(this)->actor_wait_state = 1; - #line 3547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor12*>(this))); - #line 29092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -29110,9 +36065,9 @@ class _finishActor12State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 3549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor12*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor12State(); static_cast<_finishActor12*>(this)->destroy(); return 0; } - #line 29115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor12*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor12State(); static_cast<_finishActor12*>(this)->finishSendAndDelPromiseRef(); @@ -29122,9 +36077,9 @@ class _finishActor12State { } int a_body1cont1(Void && _,int loopDepth) { - #line 3549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor12*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor12State(); static_cast<_finishActor12*>(this)->destroy(); return 0; } - #line 29127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor12*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor12State(); static_cast<_finishActor12*>(this)->finishSendAndDelPromiseRef(); @@ -29195,22 +36150,22 @@ class _finishActor12State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 0); } - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 3543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskFuture; - #line 29208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor12 final : public Actor, public ActorCallback< _finishActor12, 0, Void >, public FastAllocated<_finishActor12>, public _finishActor12State<_finishActor12> { - #line 29213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor12>::operator new; using FastAllocated<_finishActor12>::operator delete; @@ -29219,9 +36174,9 @@ class _finishActor12 final : public Actor, public ActorCallback< _finishAc void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< _finishActor12, 0, Void >; - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor12(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 29224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _finishActor12State<_finishActor12>(tr, taskBucket, futureBucket, task) { @@ -29244,43 +36199,43 @@ friend struct ActorCallback< _finishActor12, 0, Void >; } }; - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _finishActor12(tr, taskBucket, futureBucket, task)); - #line 29251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 3551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 4303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 29256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor10State { - #line 29262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor10State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,RestoreFile const& lf,int64_t const& offset,int64_t const& len,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" parentTask(parentTask), - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" lf(lf), - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" offset(offset), - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" len(len), - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" completionKey(completionKey), - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" waitFor(waitFor) - #line 29283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -29293,16 +36248,16 @@ class AddTaskActor10State { int a_body1(int loopDepth=0) { try { - #line 3560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 3560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 29300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -29323,36 +36278,36 @@ class AddTaskActor10State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 3561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task = Reference(new Task(RestoreLogDataTaskFunc::name, RestoreLogDataTaskFunc::version, doneKey)); - #line 3564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = RestoreConfig(parentTask).toTask(tr, task); - #line 3564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 29332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 3561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task = Reference(new Task(RestoreLogDataTaskFunc::name, RestoreLogDataTaskFunc::version, doneKey)); - #line 3564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = RestoreConfig(parentTask).toTask(tr, task); - #line 3564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 29350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -29422,68 +36377,68 @@ class AddTaskActor10State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 3565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.inputFile().set(task, lf); - #line 3566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.readOffset().set(task, offset); - #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.readLen().set(task, len); - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!waitFor) - #line 29433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task)); this->~AddTaskActor10State(); static_cast(this)->destroy(); return 0; } - #line 29437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task)); this->~AddTaskActor10State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = waitFor->onSetAddTask(tr, taskBucket, task); - #line 3573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 29447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 3573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 3565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.inputFile().set(task, lf); - #line 3566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.readOffset().set(task, offset); - #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.readLen().set(task, len); - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!waitFor) - #line 29467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task)); this->~AddTaskActor10State(); static_cast(this)->destroy(); return 0; } - #line 29471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task)); this->~AddTaskActor10State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = waitFor->onSetAddTask(tr, taskBucket, task); - #line 3573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 29481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 3573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -29553,10 +36508,10 @@ class AddTaskActor10State { } int a_body1cont3(Void const& _,int loopDepth) { - #line 3574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor10State(); static_cast(this)->destroy(); return 0; } - #line 29558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 4326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor10State(); static_cast(this)->destroy(); return 0; } + #line 36513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor10State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -29565,10 +36520,10 @@ class AddTaskActor10State { } int a_body1cont3(Void && _,int loopDepth) { - #line 3574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor10State(); static_cast(this)->destroy(); return 0; } - #line 29570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 4326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor10State(); static_cast(this)->destroy(); return 0; } + #line 36525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor10State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -29638,30 +36593,30 @@ class AddTaskActor10State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 2); } - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference parentTask; - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreFile lf; - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t offset; - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t len; - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference waitFor; - #line 3561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 29659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor10 final : public Actor, public ActorCallback< AddTaskActor10, 0, Key >, public ActorCallback< AddTaskActor10, 1, Void >, public ActorCallback< AddTaskActor10, 2, Void >, public FastAllocated, public AddTaskActor10State { - #line 29664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -29672,9 +36627,9 @@ class AddTaskActor10 final : public Actor, public ActorCallback< AddTaskAct friend struct ActorCallback< AddTaskActor10, 0, Key >; friend struct ActorCallback< AddTaskActor10, 1, Void >; friend struct ActorCallback< AddTaskActor10, 2, Void >; - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor10(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,RestoreFile const& lf,int64_t const& offset,int64_t const& len,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 29677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), AddTaskActor10State(tr, taskBucket, parentTask, lf, offset, len, completionKey, waitFor) { @@ -29699,14 +36654,14 @@ friend struct ActorCallback< AddTaskActor10, 2, Void >; } }; - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, RestoreFile const& lf, int64_t const& offset, int64_t const& len, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new AddTaskActor10(tr, taskBucket, parentTask, lf, offset, len, completionKey, waitFor)); - #line 29706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 3576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 4328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future execute(Database cx, Reference tb, @@ -29721,7 +36676,7 @@ friend struct ActorCallback< AddTaskActor10, 2, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef RestoreLogDataTaskFunc::name = LiteralStringRef("restore_log_data"); +StringRef RestoreLogDataTaskFunc::name = "restore_log_data"_sr; REGISTER_TASKFUNC(RestoreLogDataTaskFunc); struct RestoreDispatchTaskFunc : RestoreTaskFuncBase { @@ -29730,47 +36685,47 @@ struct RestoreDispatchTaskFunc : RestoreTaskFuncBase { StringRef getName() const override { return name; }; static struct { - static TaskParam beginVersion() { return LiteralStringRef(__FUNCTION__); } - static TaskParam beginFile() { return LiteralStringRef(__FUNCTION__); } - static TaskParam beginBlock() { return LiteralStringRef(__FUNCTION__); } - static TaskParam batchSize() { return LiteralStringRef(__FUNCTION__); } - static TaskParam remainingInBatch() { return LiteralStringRef(__FUNCTION__); } + static TaskParam beginVersion() { return __FUNCTION__sr; } + static TaskParam beginFile() { return __FUNCTION__sr; } + static TaskParam beginBlock() { return __FUNCTION__sr; } + static TaskParam batchSize() { return __FUNCTION__sr; } + static TaskParam remainingInBatch() { return __FUNCTION__sr; } } Params; - #line 29740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor13State { - #line 29746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor13State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 3610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore(task), - #line 3612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion(Params.beginVersion().get(task)), - #line 3613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" onDone(futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone])), - #line 3615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" remainingInBatch(Params.remainingInBatch().get(task)), - #line 3616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addingToExistingBatch(remainingInBatch > 0), - #line 3617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreVersion(), - #line 3618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" onlyApplyMutationLogs(restore.onlyApplyMutationLogs().get(tr)) - #line 29773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -29783,16 +36738,16 @@ class _finishActor13State { int a_body1(int loopDepth=0) { try { - #line 3620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = store(restoreVersion, restore.restoreVersion().getOrThrow(tr)) && success(onlyApplyMutationLogs) && checkTaskVersion(tr->getDatabase(), task, name, version); - #line 3620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 29790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 1; - #line 3620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 29795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -29813,48 +36768,48 @@ class _finishActor13State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 3626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!addingToExistingBatch && beginVersion > 0) - #line 29818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.setApplyEndVersion(tr, std::min(beginVersion, restoreVersion + 1)); - #line 29822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = restore.getApplyVersionLag(tr); - #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 29828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 2; - #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 29833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 3626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!addingToExistingBatch && beginVersion > 0) - #line 29842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.setApplyEndVersion(tr, std::min(beginVersion, restoreVersion + 1)); - #line 29846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = restore.getApplyVersionLag(tr); - #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 29852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 2; - #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 29857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -29924,22 +36879,22 @@ class _finishActor13State { } int a_body1cont2(int loopDepth) { - #line 3632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" batchSize = Params.batchSize().get(task); - #line 3635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!addingToExistingBatch && applyLag > (BUGGIFY ? 1 : CLIENT_KNOBS->CORE_VERSIONSPERSECOND * 300)) - #line 29931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY); - #line 3637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 29937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 3; - #line 3637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 29942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -29951,9 +36906,9 @@ class _finishActor13State { } int a_body1cont1when1(int64_t const& __applyLag,int loopDepth) { - #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" applyLag = __applyLag; - #line 29956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -30018,52 +36973,52 @@ class _finishActor13State { } int a_body1cont4(int loopDepth) { - #line 3653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginFile = Params.beginFile().getOrDefault(task); - #line 3656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBatchSize = BUGGIFY ? 1 : CLIENT_KNOBS->RESTORE_DISPATCH_ADDTASK_SIZE; - #line 3657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_5 = restore.fileSet().getRange(tr, { beginVersion, beginFile }, {}, taskBatchSize); - #line 3657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_5 = restore.fileSet().getRange( tr, Optional({ beginVersion, beginFile }), {}, taskBatchSize); + #line 4409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 30029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 36984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont4when1(__when_expr_5.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 6; - #line 3657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 30034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 4409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); + #line 36989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont5(Void const& _,int loopDepth) { - #line 3638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = success(RestoreDispatchTaskFunc::addTask( tr, taskBucket, task, beginVersion, "", 0, batchSize, remainingInBatch)); - #line 3638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 30045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 4; - #line 3638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 30050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont5(Void && _,int loopDepth) { - #line 3638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = success(RestoreDispatchTaskFunc::addTask( tr, taskBucket, task, beginVersion, "", 0, batchSize, remainingInBatch)); - #line 3638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 30061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 4; - #line 3638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 30066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -30133,36 +37088,36 @@ class _finishActor13State { } int a_body1cont6(Void const& _,int loopDepth) { - #line 3641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreDispatch") .detail("RestoreUID", restore.getUid()) .detail("BeginVersion", beginVersion) .detail("ApplyLag", applyLag) .detail("BatchSize", batchSize) .detail("Decision", "too_far_behind") .detail("TaskInstance", THIS_ADDR); - #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = taskBucket->finish(tr, task); - #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 30142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 5; - #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 30147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont6(Void && _,int loopDepth) { - #line 3641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreDispatch") .detail("RestoreUID", restore.getUid()) .detail("BeginVersion", beginVersion) .detail("ApplyLag", applyLag) .detail("BatchSize", batchSize) .detail("Decision", "too_far_behind") .detail("TaskInstance", THIS_ADDR); - #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = taskBucket->finish(tr, task); - #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 30160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 5; - #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 30165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -30232,9 +37187,9 @@ class _finishActor13State { } int a_body1cont7(Void const& _,int loopDepth) { - #line 3650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor13*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->destroy(); return 0; } - #line 30237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor13*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->finishSendAndDelPromiseRef(); @@ -30244,9 +37199,9 @@ class _finishActor13State { } int a_body1cont7(Void && _,int loopDepth) { - #line 3650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor13*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->destroy(); return 0; } - #line 30249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor13*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->finishSendAndDelPromiseRef(); @@ -30319,48 +37274,48 @@ class _finishActor13State { } int a_body1cont9(int loopDepth) { - #line 3661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" allPartsDone = Reference(); - #line 3664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (addingToExistingBatch) - #line 30326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_6 = restore.batchFuture().getD(tr); - #line 3665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 30332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont9when1(__when_expr_6.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 7; - #line 3665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 30337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 3669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" allPartsDone = futureBucket->future(tr); - #line 3670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.batchFuture().set(tr, allPartsDone->pack()); - #line 3672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" remainingInBatch = batchSize; - #line 30348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont10(loopDepth); } return loopDepth; } - int a_body1cont4when1(RestoreConfig::FileSetT::Values const& __files,int loopDepth) + int a_body1cont4when1(RestoreConfig::FileSetT::RangeResultType const& __files,int loopDepth) { - #line 3657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" files = __files; - #line 30358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont9(loopDepth); return loopDepth; } - int a_body1cont4when1(RestoreConfig::FileSetT::Values && __files,int loopDepth) + int a_body1cont4when1(RestoreConfig::FileSetT::RangeResultType && __files,int loopDepth) { files = std::move(__files); loopDepth = a_body1cont9(loopDepth); @@ -30370,10 +37325,10 @@ class _finishActor13State { void a_exitChoose6() { if (static_cast<_finishActor13*>(this)->actor_wait_state > 0) static_cast<_finishActor13*>(this)->actor_wait_state = 0; - static_cast<_finishActor13*>(this)->ActorCallback< _finishActor13, 5, RestoreConfig::FileSetT::Values >::remove(); + static_cast<_finishActor13*>(this)->ActorCallback< _finishActor13, 5, RestoreConfig::FileSetT::RangeResultType >::remove(); } - void a_callback_fire(ActorCallback< _finishActor13, 5, RestoreConfig::FileSetT::Values >*,RestoreConfig::FileSetT::Values const& value) + void a_callback_fire(ActorCallback< _finishActor13, 5, RestoreConfig::FileSetT::RangeResultType >*,RestoreConfig::FileSetT::RangeResultType const& value) { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 5); a_exitChoose6(); @@ -30388,7 +37343,7 @@ class _finishActor13State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 5); } - void a_callback_fire(ActorCallback< _finishActor13, 5, RestoreConfig::FileSetT::Values >*,RestoreConfig::FileSetT::Values && value) + void a_callback_fire(ActorCallback< _finishActor13, 5, RestoreConfig::FileSetT::RangeResultType >*,RestoreConfig::FileSetT::RangeResultType && value) { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 5); a_exitChoose6(); @@ -30403,7 +37358,7 @@ class _finishActor13State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 5); } - void a_callback_error(ActorCallback< _finishActor13, 5, RestoreConfig::FileSetT::Values >*,Error err) + void a_callback_error(ActorCallback< _finishActor13, 5, RestoreConfig::FileSetT::RangeResultType >*,Error err) { fdb_probe_actor_enter("_finish", reinterpret_cast(this), 5); a_exitChoose6(); @@ -30420,74 +37375,74 @@ class _finishActor13State { } int a_body1cont10(int loopDepth) { - #line 3676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (files.size() == 0) - #line 30425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 4428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (files.results.size() == 0) + #line 37380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (addingToExistingBatch) - #line 30429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_7 = success(RestoreDispatchTaskFunc::addTask(tr, taskBucket, task, restoreVersion + 1, "", 0, batchSize, 0, TaskCompletionKey::noSignal(), allPartsDone)); - #line 3682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 30435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont10when1(__when_expr_7.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 8; - #line 3682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 30440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 3702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (beginVersion < restoreVersion) - #line 30447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_8 = success(RestoreDispatchTaskFunc::addTask(tr, taskBucket, task, restoreVersion, "", 0, batchSize)); - #line 3704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 30453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont10when2(__when_expr_8.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 9; - #line 3704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 30458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 3715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (applyLag == 0) - #line 30465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_9 = success(RestoreCompleteTaskFunc::addTask(tr, taskBucket, task, TaskCompletionKey::noSignal())); - #line 3717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 30471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1cont10when3(__when_expr_9.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 10; - #line 3717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 30476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 3730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_10 = delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY); - #line 3730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 30485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont10when4(__when_expr_10.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 11; - #line 3730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 30490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } } @@ -30502,18 +37457,18 @@ class _finishActor13State { } int a_body1cont11(Key const& fKey,int loopDepth) { - #line 3666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" allPartsDone = Reference(new TaskFuture(futureBucket, fKey)); - #line 30507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont10(loopDepth); return loopDepth; } int a_body1cont11(Key && fKey,int loopDepth) { - #line 3666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" allPartsDone = Reference(new TaskFuture(futureBucket, fKey)); - #line 30516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont10(loopDepth); return loopDepth; @@ -30583,117 +37538,117 @@ class _finishActor13State { } int a_body1cont10cont1(int loopDepth) { - #line 3753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addTaskFutures = std::vector>(); - #line 3754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - endVersion = files[0].version; - #line 3755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + endVersion = files.results[0].version; + #line 4507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" blocksDispatched = 0; - #line 3756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginBlock = Params.beginBlock().getOrDefault(task); - #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" i = 0; - #line 3759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for(;i < files.size();++i) { - #line 3760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - RestoreConfig::RestoreFile& f = files[i]; - #line 3765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for(;i < files.results.size();++i) { + #line 4512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + RestoreConfig::RestoreFile& f = files.results[i]; + #line 4517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (f.version != endVersion && remainingInBatch <= 0) - #line 30602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++endVersion; - #line 3768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginFile = ""; - #line 3769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginBlock = 0; - #line 30610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" break; } - #line 3774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" endVersion = f.version; - #line 3775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginFile = f.fileName; - #line 3777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" j = beginBlock * f.blockSize; - #line 3779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(;j < f.fileSize;j += f.blockSize) { - #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (blocksDispatched == taskBatchSize) - #line 30623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { break; } - #line 3784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (f.isRange) - #line 30629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addTaskFutures.push_back( RestoreRangeTaskFunc::addTask(tr, taskBucket, task, f, j, std::min(f.blockSize, f.fileSize - j), TaskCompletionKey::joinWith(allPartsDone))); - #line 30633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 3794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addTaskFutures.push_back( RestoreLogDataTaskFunc::addTask(tr, taskBucket, task, f, j, std::min(f.blockSize, f.fileSize - j), TaskCompletionKey::joinWith(allPartsDone))); - #line 30639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++beginBlock; - #line 3806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++blocksDispatched; - #line 3807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" --remainingInBatch; - #line 30647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (blocksDispatched == taskBatchSize) - #line 30651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { break; } - #line 3816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginFile = beginFile + '\x00'; - #line 3817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginBlock = 0; - #line 3819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreDispatchedFile") .suppressFor(60) .detail("RestoreUID", restore.getUid()) .detail("FileName", f.fileName) .detail("TaskInstance", THIS_ADDR); - #line 30661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (blocksDispatched == 0) - #line 30665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::string decision; - #line 3833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (i == 0) - #line 30671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" batchSize *= 2; - #line 3835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" decision = "increased_batch_size"; - #line 30677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 3837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" decision = "all_files_were_empty"; - #line 30683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreDispatch") .detail("RestoreUID", restore.getUid()) .detail("BeginVersion", beginVersion) .detail("BeginFile", Params.beginFile().get(task)) .detail("BeginBlock", Params.beginBlock().get(task)) .detail("EndVersion", endVersion) .detail("ApplyLag", applyLag) .detail("BatchSize", batchSize) .detail("Decision", decision) .detail("TaskInstance", THIS_ADDR) .detail("RemainingInBatch", remainingInBatch); - #line 3851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_13 = success(RestoreDispatchTaskFunc::addTask(tr, taskBucket, task, endVersion, beginFile, beginBlock, batchSize, remainingInBatch, TaskCompletionKey::joinWith((allPartsDone)))); - #line 3851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 30691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_13.isReady()) { if (__when_expr_13.isError()) return a_body1Catch1(__when_expr_13.getError(), loopDepth); else return a_body1cont10cont1when1(__when_expr_13.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 14; - #line 3851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_13.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 30696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -30705,36 +37660,36 @@ class _finishActor13State { } int a_body1cont10cont2(int loopDepth) { - #line 3744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future setDone = addingToExistingBatch ? onDone->set(tr, taskBucket) : Void(); - #line 3746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_12 = taskBucket->finish(tr, task) && setDone; - #line 3746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 30714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_12.isReady()) { if (__when_expr_12.isError()) return a_body1Catch1(__when_expr_12.getError(), loopDepth); else return a_body1cont10cont2when1(__when_expr_12.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 13; - #line 3746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_12.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 30719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont10cont3(Void const& _,int loopDepth) { - #line 3693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreDispatch") .detail("RestoreUID", restore.getUid()) .detail("BeginVersion", beginVersion) .detail("BeginFile", Params.beginFile().get(task)) .detail("BeginBlock", Params.beginBlock().get(task)) .detail("RestoreVersion", restoreVersion) .detail("ApplyLag", applyLag) .detail("Decision", "end_of_final_batch") .detail("TaskInstance", THIS_ADDR); - #line 30728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont10cont2(loopDepth); return loopDepth; } int a_body1cont10cont3(Void && _,int loopDepth) { - #line 3693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreDispatch") .detail("RestoreUID", restore.getUid()) .detail("BeginVersion", beginVersion) .detail("BeginFile", Params.beginFile().get(task)) .detail("BeginBlock", Params.beginBlock().get(task)) .detail("RestoreVersion", restoreVersion) .detail("ApplyLag", applyLag) .detail("Decision", "end_of_final_batch") .detail("TaskInstance", THIS_ADDR); - #line 30737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont10cont2(loopDepth); return loopDepth; @@ -30810,18 +37765,18 @@ class _finishActor13State { } int a_body1cont10cont6(Void const& _,int loopDepth) { - #line 3706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreDispatch") .detail("RestoreUID", restore.getUid()) .detail("BeginVersion", beginVersion) .detail("BeginFile", Params.beginFile().get(task)) .detail("BeginBlock", Params.beginBlock().get(task)) .detail("RestoreVersion", restoreVersion) .detail("ApplyLag", applyLag) .detail("Decision", "apply_to_restore_version") .detail("TaskInstance", THIS_ADDR); - #line 30815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont10cont5(loopDepth); return loopDepth; } int a_body1cont10cont6(Void && _,int loopDepth) { - #line 3706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreDispatch") .detail("RestoreUID", restore.getUid()) .detail("BeginVersion", beginVersion) .detail("BeginFile", Params.beginFile().get(task)) .detail("BeginBlock", Params.beginBlock().get(task)) .detail("RestoreVersion", restoreVersion) .detail("ApplyLag", applyLag) .detail("Decision", "apply_to_restore_version") .detail("TaskInstance", THIS_ADDR); - #line 30824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont10cont5(loopDepth); return loopDepth; @@ -30897,18 +37852,18 @@ class _finishActor13State { } int a_body1cont10cont9(Void const& _,int loopDepth) { - #line 3719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreDispatch") .detail("RestoreUID", restore.getUid()) .detail("BeginVersion", beginVersion) .detail("BeginFile", Params.beginFile().get(task)) .detail("BeginBlock", Params.beginBlock().get(task)) .detail("ApplyLag", applyLag) .detail("Decision", "restore_complete") .detail("TaskInstance", THIS_ADDR); - #line 30902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont10cont8(loopDepth); return loopDepth; } int a_body1cont10cont9(Void && _,int loopDepth) { - #line 3719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreDispatch") .detail("RestoreUID", restore.getUid()) .detail("BeginVersion", beginVersion) .detail("BeginFile", Params.beginFile().get(task)) .detail("BeginBlock", Params.beginBlock().get(task)) .detail("ApplyLag", applyLag) .detail("Decision", "restore_complete") .detail("TaskInstance", THIS_ADDR); - #line 30911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont10cont8(loopDepth); return loopDepth; @@ -30978,32 +37933,32 @@ class _finishActor13State { } int a_body1cont10cont11(Void const& _,int loopDepth) { - #line 3731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_11 = success(RestoreDispatchTaskFunc::addTask(tr, taskBucket, task, beginVersion, "", 0, batchSize)); - #line 3731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 30985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1Catch1(__when_expr_11.getError(), loopDepth); else return a_body1cont10cont11when1(__when_expr_11.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 12; - #line 3731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_11.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 30990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont10cont11(Void && _,int loopDepth) { - #line 3731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_11 = success(RestoreDispatchTaskFunc::addTask(tr, taskBucket, task, beginVersion, "", 0, batchSize)); - #line 3731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 31001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1Catch1(__when_expr_11.getError(), loopDepth); else return a_body1cont10cont11when1(__when_expr_11.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 12; - #line 3731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_11.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 31006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 37961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -31073,18 +38028,18 @@ class _finishActor13State { } int a_body1cont10cont11cont1(Void const& _,int loopDepth) { - #line 3733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreDispatch") .detail("RestoreUID", restore.getUid()) .detail("BeginVersion", beginVersion) .detail("ApplyLag", applyLag) .detail("Decision", "apply_still_behind") .detail("TaskInstance", THIS_ADDR); - #line 31078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont10cont8(loopDepth); return loopDepth; } int a_body1cont10cont11cont1(Void && _,int loopDepth) { - #line 3733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreDispatch") .detail("RestoreUID", restore.getUid()) .detail("BeginVersion", beginVersion) .detail("ApplyLag", applyLag) .detail("Decision", "apply_still_behind") .detail("TaskInstance", THIS_ADDR); - #line 31087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont10cont8(loopDepth); return loopDepth; @@ -31154,9 +38109,9 @@ class _finishActor13State { } int a_body1cont10cont12(Void const& _,int loopDepth) { - #line 3747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor13*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->destroy(); return 0; } - #line 31159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor13*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->finishSendAndDelPromiseRef(); @@ -31166,9 +38121,9 @@ class _finishActor13State { } int a_body1cont10cont12(Void && _,int loopDepth) { - #line 3747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor13*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->destroy(); return 0; } - #line 31171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor13*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->finishSendAndDelPromiseRef(); @@ -31241,76 +38196,76 @@ class _finishActor13State { } int a_body1cont10cont13(int loopDepth) { - #line 3872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.filesBlocksDispatched().atomicOp(tr, blocksDispatched, MutationRef::Type::AddValue); - #line 3877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!beginFile.empty()) - #line 31248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" remainingInBatch = std::max(1, remainingInBatch); - #line 31252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (remainingInBatch > 0) - #line 31256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addTaskFutures.push_back(RestoreDispatchTaskFunc::addTask(tr, taskBucket, task, endVersion, beginFile, beginBlock, batchSize, remainingInBatch, TaskCompletionKey::joinWith(allPartsDone))); - #line 31260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 3893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addTaskFutures.push_back(RestoreDispatchTaskFunc::addTask(tr, taskBucket, task, endVersion, beginFile, beginBlock, batchSize, 0, TaskCompletionKey::noSignal(), allPartsDone)); - #line 31266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 3904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_15 = waitForAll(addTaskFutures); - #line 3904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 31272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_15.isReady()) { if (__when_expr_15.isError()) return a_body1Catch1(__when_expr_15.getError(), loopDepth); else return a_body1cont10cont13when1(__when_expr_15.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 16; - #line 3904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_15.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 31277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont10cont21(Void const& _,int loopDepth) { - #line 3864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future setDone = addingToExistingBatch ? onDone->set(tr, taskBucket) : Void(); - #line 3866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_14 = setDone && taskBucket->finish(tr, task); - #line 3866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 31290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_14.isReady()) { if (__when_expr_14.isError()) return a_body1Catch1(__when_expr_14.getError(), loopDepth); else return a_body1cont10cont21when1(__when_expr_14.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 15; - #line 3866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_14.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 31295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont10cont21(Void && _,int loopDepth) { - #line 3864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future setDone = addingToExistingBatch ? onDone->set(tr, taskBucket) : Void(); - #line 3866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_14 = setDone && taskBucket->finish(tr, task); - #line 3866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 31308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_14.isReady()) { if (__when_expr_14.isError()) return a_body1Catch1(__when_expr_14.getError(), loopDepth); else return a_body1cont10cont21when1(__when_expr_14.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 15; - #line 3866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_14.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 31313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -31380,9 +38335,9 @@ class _finishActor13State { } int a_body1cont10cont21cont1(Void const& _,int loopDepth) { - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor13*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->destroy(); return 0; } - #line 31385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor13*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->finishSendAndDelPromiseRef(); @@ -31392,9 +38347,9 @@ class _finishActor13State { } int a_body1cont10cont21cont1(Void && _,int loopDepth) { - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor13*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->destroy(); return 0; } - #line 31397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor13*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->finishSendAndDelPromiseRef(); @@ -31467,36 +38422,36 @@ class _finishActor13State { } int a_body1cont10cont13cont1(Void const& _,int loopDepth) { - #line 3907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future setDone = addingToExistingBatch ? onDone->set(tr, taskBucket) : Void(); - #line 3909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_16 = setDone && taskBucket->finish(tr, task); - #line 3909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 31476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_16.isReady()) { if (__when_expr_16.isError()) return a_body1Catch1(__when_expr_16.getError(), loopDepth); else return a_body1cont10cont13cont1when1(__when_expr_16.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 17; - #line 3909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_16.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 31481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont10cont13cont1(Void && _,int loopDepth) { - #line 3907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future setDone = addingToExistingBatch ? onDone->set(tr, taskBucket) : Void(); - #line 3909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_16 = setDone && taskBucket->finish(tr, task); - #line 3909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor13*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 31494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_16.isReady()) { if (__when_expr_16.isError()) return a_body1Catch1(__when_expr_16.getError(), loopDepth); else return a_body1cont10cont13cont1when1(__when_expr_16.get(), loopDepth); }; static_cast<_finishActor13*>(this)->actor_wait_state = 17; - #line 3909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_16.addCallbackAndClear(static_cast*>(static_cast<_finishActor13*>(this))); - #line 31499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -31566,11 +38521,11 @@ class _finishActor13State { } int a_body1cont10cont13cont5(Void const& _,int loopDepth) { - #line 3911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreDispatch") .detail("RestoreUID", restore.getUid()) .detail("BeginVersion", beginVersion) .detail("BeginFile", Params.beginFile().get(task)) .detail("BeginBlock", Params.beginBlock().get(task)) .detail("EndVersion", endVersion) .detail("ApplyLag", applyLag) .detail("BatchSize", batchSize) .detail("Decision", "dispatched_files") .detail("FilesDispatched", i) .detail("BlocksDispatched", blocksDispatched) .detail("TaskInstance", THIS_ADDR) .detail("RemainingInBatch", remainingInBatch); - #line 3925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor13*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->destroy(); return 0; } - #line 31573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor13*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->finishSendAndDelPromiseRef(); @@ -31580,11 +38535,11 @@ class _finishActor13State { } int a_body1cont10cont13cont5(Void && _,int loopDepth) { - #line 3911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreDispatch") .detail("RestoreUID", restore.getUid()) .detail("BeginVersion", beginVersion) .detail("BeginFile", Params.beginFile().get(task)) .detail("BeginBlock", Params.beginBlock().get(task)) .detail("EndVersion", endVersion) .detail("ApplyLag", applyLag) .detail("BatchSize", batchSize) .detail("Decision", "dispatched_files") .detail("FilesDispatched", i) .detail("BlocksDispatched", blocksDispatched) .detail("TaskInstance", THIS_ADDR) .detail("RemainingInBatch", remainingInBatch); - #line 3925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor13*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->destroy(); return 0; } - #line 31587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor13*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor13State(); static_cast<_finishActor13*>(this)->finishSendAndDelPromiseRef(); @@ -31655,58 +38610,58 @@ class _finishActor13State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 16); } - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 3610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig restore; - #line 3612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version beginVersion; - #line 3613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference onDone; - #line 3615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t remainingInBatch; - #line 3616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bool addingToExistingBatch; - #line 3617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version restoreVersion; - #line 3618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future> onlyApplyMutationLogs; - #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t applyLag; - #line 3632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t batchSize; - #line 3653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::string beginFile; - #line 3656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int taskBatchSize; - #line 3657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - RestoreConfig::FileSetT::Values files; - #line 3661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + RestoreConfig::FileSetT::RangeResultType files; + #line 4413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference allPartsDone; - #line 3753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector> addTaskFutures; - #line 3754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version endVersion; - #line 3755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int blocksDispatched; - #line 3756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t beginBlock; - #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int i; - #line 3777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t j; - #line 31704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class _finishActor13 final : public Actor, public ActorCallback< _finishActor13, 0, Void >, public ActorCallback< _finishActor13, 1, int64_t >, public ActorCallback< _finishActor13, 2, Void >, public ActorCallback< _finishActor13, 3, Void >, public ActorCallback< _finishActor13, 4, Void >, public ActorCallback< _finishActor13, 5, RestoreConfig::FileSetT::Values >, public ActorCallback< _finishActor13, 6, Key >, public ActorCallback< _finishActor13, 7, Void >, public ActorCallback< _finishActor13, 8, Void >, public ActorCallback< _finishActor13, 9, Void >, public ActorCallback< _finishActor13, 10, Void >, public ActorCallback< _finishActor13, 11, Void >, public ActorCallback< _finishActor13, 12, Void >, public ActorCallback< _finishActor13, 13, Void >, public ActorCallback< _finishActor13, 14, Void >, public ActorCallback< _finishActor13, 15, Void >, public ActorCallback< _finishActor13, 16, Void >, public FastAllocated<_finishActor13>, public _finishActor13State<_finishActor13> { - #line 31709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _finishActor13 final : public Actor, public ActorCallback< _finishActor13, 0, Void >, public ActorCallback< _finishActor13, 1, int64_t >, public ActorCallback< _finishActor13, 2, Void >, public ActorCallback< _finishActor13, 3, Void >, public ActorCallback< _finishActor13, 4, Void >, public ActorCallback< _finishActor13, 5, RestoreConfig::FileSetT::RangeResultType >, public ActorCallback< _finishActor13, 6, Key >, public ActorCallback< _finishActor13, 7, Void >, public ActorCallback< _finishActor13, 8, Void >, public ActorCallback< _finishActor13, 9, Void >, public ActorCallback< _finishActor13, 10, Void >, public ActorCallback< _finishActor13, 11, Void >, public ActorCallback< _finishActor13, 12, Void >, public ActorCallback< _finishActor13, 13, Void >, public ActorCallback< _finishActor13, 14, Void >, public ActorCallback< _finishActor13, 15, Void >, public ActorCallback< _finishActor13, 16, Void >, public FastAllocated<_finishActor13>, public _finishActor13State<_finishActor13> { + #line 38664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor13>::operator new; using FastAllocated<_finishActor13>::operator delete; @@ -31719,7 +38674,7 @@ friend struct ActorCallback< _finishActor13, 1, int64_t >; friend struct ActorCallback< _finishActor13, 2, Void >; friend struct ActorCallback< _finishActor13, 3, Void >; friend struct ActorCallback< _finishActor13, 4, Void >; -friend struct ActorCallback< _finishActor13, 5, RestoreConfig::FileSetT::Values >; +friend struct ActorCallback< _finishActor13, 5, RestoreConfig::FileSetT::RangeResultType >; friend struct ActorCallback< _finishActor13, 6, Key >; friend struct ActorCallback< _finishActor13, 7, Void >; friend struct ActorCallback< _finishActor13, 8, Void >; @@ -31731,9 +38686,9 @@ friend struct ActorCallback< _finishActor13, 13, Void >; friend struct ActorCallback< _finishActor13, 14, Void >; friend struct ActorCallback< _finishActor13, 15, Void >; friend struct ActorCallback< _finishActor13, 16, Void >; - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor13(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 31736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _finishActor13State<_finishActor13>(tr, taskBucket, futureBucket, task) { @@ -31756,7 +38711,7 @@ friend struct ActorCallback< _finishActor13, 16, Void >; case 3: this->a_callback_error((ActorCallback< _finishActor13, 2, Void >*)0, actor_cancelled()); break; case 4: this->a_callback_error((ActorCallback< _finishActor13, 3, Void >*)0, actor_cancelled()); break; case 5: this->a_callback_error((ActorCallback< _finishActor13, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< _finishActor13, 5, RestoreConfig::FileSetT::Values >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< _finishActor13, 5, RestoreConfig::FileSetT::RangeResultType >*)0, actor_cancelled()); break; case 7: this->a_callback_error((ActorCallback< _finishActor13, 6, Key >*)0, actor_cancelled()); break; case 8: this->a_callback_error((ActorCallback< _finishActor13, 7, Void >*)0, actor_cancelled()); break; case 9: this->a_callback_error((ActorCallback< _finishActor13, 8, Void >*)0, actor_cancelled()); break; @@ -31772,47 +38727,47 @@ friend struct ActorCallback< _finishActor13, 16, Void >; } }; - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _finishActor13(tr, taskBucket, futureBucket, task)); - #line 31779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 3927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 4679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 31784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor11State { - #line 31790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor11State(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,Version const& beginVersion,std::string const& beginFile,int64_t const& beginBlock,int64_t const& batchSize,int64_t const& remainingInBatch = 0,TaskCompletionKey const& completionKey = TaskCompletionKey::noSignal(),Reference const& waitFor = Reference()) - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" parentTask(parentTask), - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion(beginVersion), - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginFile(beginFile), - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginBlock(beginBlock), - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" batchSize(batchSize), - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" remainingInBatch(remainingInBatch), - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" completionKey(completionKey), - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" waitFor(waitFor) - #line 31815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -31825,16 +38780,16 @@ class AddTaskActor11State { int a_body1(int loopDepth=0) { try { - #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 31832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 31837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -31855,40 +38810,40 @@ class AddTaskActor11State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 3941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" unsigned int priority = (remainingInBatch > 0) ? 1 : 0; - #line 3942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task = Reference(new Task(RestoreDispatchTaskFunc::name, RestoreDispatchTaskFunc::version, doneKey, priority)); - #line 3946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = RestoreConfig(parentTask).toTask(tr, task); - #line 3946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 31866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 31871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 3941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" unsigned int priority = (remainingInBatch > 0) ? 1 : 0; - #line 3942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task = Reference(new Task(RestoreDispatchTaskFunc::name, RestoreDispatchTaskFunc::version, doneKey, priority)); - #line 3946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = RestoreConfig(parentTask).toTask(tr, task); - #line 3946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 31886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 31891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -31958,76 +38913,76 @@ class AddTaskActor11State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 3947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.beginVersion().set(task, beginVersion); - #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.batchSize().set(task, batchSize); - #line 3949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.remainingInBatch().set(task, remainingInBatch); - #line 3950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.beginBlock().set(task, beginBlock); - #line 3951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.beginFile().set(task, beginFile); - #line 3953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!waitFor) - #line 31973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task)); this->~AddTaskActor11State(); static_cast(this)->destroy(); return 0; } - #line 31977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task)); this->~AddTaskActor11State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = waitFor->onSetAddTask(tr, taskBucket, task); - #line 3957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 31987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 3957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 31992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 3947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.beginVersion().set(task, beginVersion); - #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.batchSize().set(task, batchSize); - #line 3949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.remainingInBatch().set(task, remainingInBatch); - #line 3950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.beginBlock().set(task, beginBlock); - #line 3951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.beginFile().set(task, beginFile); - #line 3953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!waitFor) - #line 32011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task)); this->~AddTaskActor11State(); static_cast(this)->destroy(); return 0; } - #line 32015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task)); this->~AddTaskActor11State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = waitFor->onSetAddTask(tr, taskBucket, task); - #line 3957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 32025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 3957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 32030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 38985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -32097,10 +39052,10 @@ class AddTaskActor11State { } int a_body1cont3(Void const& _,int loopDepth) { - #line 3958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor11State(); static_cast(this)->destroy(); return 0; } - #line 32102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 4710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor11State(); static_cast(this)->destroy(); return 0; } + #line 39057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor11State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -32109,10 +39064,10 @@ class AddTaskActor11State { } int a_body1cont3(Void && _,int loopDepth) { - #line 3958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor11State(); static_cast(this)->destroy(); return 0; } - #line 32114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 4710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor11State(); static_cast(this)->destroy(); return 0; } + #line 39069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor11State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -32182,34 +39137,34 @@ class AddTaskActor11State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 2); } - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference parentTask; - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version beginVersion; - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::string beginFile; - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t beginBlock; - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t batchSize; - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t remainingInBatch; - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference waitFor; - #line 3942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 32207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor11 final : public Actor, public ActorCallback< AddTaskActor11, 0, Key >, public ActorCallback< AddTaskActor11, 1, Void >, public ActorCallback< AddTaskActor11, 2, Void >, public FastAllocated, public AddTaskActor11State { - #line 32212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -32220,9 +39175,9 @@ class AddTaskActor11 final : public Actor, public ActorCallback< AddTaskAct friend struct ActorCallback< AddTaskActor11, 0, Key >; friend struct ActorCallback< AddTaskActor11, 1, Void >; friend struct ActorCallback< AddTaskActor11, 2, Void >; - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor11(Reference const& tr,Reference const& taskBucket,Reference const& parentTask,Version const& beginVersion,std::string const& beginFile,int64_t const& beginBlock,int64_t const& batchSize,int64_t const& remainingInBatch = 0,TaskCompletionKey const& completionKey = TaskCompletionKey::noSignal(),Reference const& waitFor = Reference()) - #line 32225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), AddTaskActor11State(tr, taskBucket, parentTask, beginVersion, beginFile, beginBlock, batchSize, remainingInBatch, completionKey, waitFor) { @@ -32247,14 +39202,14 @@ friend struct ActorCallback< AddTaskActor11, 2, Void >; } }; - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, Reference const& parentTask, Version const& beginVersion, std::string const& beginFile, int64_t const& beginBlock, int64_t const& batchSize, int64_t const& remainingInBatch = 0, TaskCompletionKey const& completionKey = TaskCompletionKey::noSignal(), Reference const& waitFor = Reference() ) { - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new AddTaskActor11(tr, taskBucket, parentTask, beginVersion, beginFile, beginBlock, batchSize, remainingInBatch, completionKey, waitFor)); - #line 32254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 3960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 4712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future execute(Database cx, Reference tb, @@ -32269,25 +39224,25 @@ friend struct ActorCallback< AddTaskActor11, 2, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef RestoreDispatchTaskFunc::name = LiteralStringRef("restore_dispatch"); +StringRef RestoreDispatchTaskFunc::name = "restore_dispatch"_sr; REGISTER_TASKFUNC(RestoreDispatchTaskFunc); - #line 32275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via restoreStatus() - #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class RestoreStatusActorState { - #line 32281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreStatusActorState(Reference const& tr,Key const& tagName) - #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tagName(tagName) - #line 32290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("restoreStatus", reinterpret_cast(this)); @@ -32300,35 +39255,35 @@ class RestoreStatusActorState { int a_body1(int loopDepth=0) { try { - #line 3978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 3979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 3980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 3982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tags = std::vector(); - #line 3983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (tagName.size() == 0) - #line 32313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_0 = getAllRestoreTags(tr); - #line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 32319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 32324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 3987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tags.push_back(makeRestoreTag(tagName.toString())); - #line 32331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); } } @@ -32350,31 +39305,31 @@ class RestoreStatusActorState { } int a_body1cont1(int loopDepth) { - #line 3989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" result = std::string(); - #line 3990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" i = 0; - #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 32359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont2(std::vector const& t,int loopDepth) { - #line 3985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tags = t; - #line 32368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } int a_body1cont2(std::vector && t,int loopDepth) { - #line 3985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tags = t; - #line 32377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -32444,9 +39399,9 @@ class RestoreStatusActorState { } int a_body1cont5(int loopDepth) { - #line 3999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~RestoreStatusActorState(); static_cast(this)->destroy(); return 0; } - #line 32449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< std::string >::value()) std::string(std::move(result)); // state_var_RVO this->~RestoreStatusActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -32463,22 +39418,22 @@ class RestoreStatusActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!(i < tags.size())) - #line 32468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 3993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = tags[i].getD(tr); - #line 3993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 32476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 32481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -32498,32 +39453,32 @@ class RestoreStatusActorState { } int a_body1cont1loopBody1cont1(UidAndAbortedFlagT const& u,int loopDepth) { - #line 3994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = RestoreConfig(u.first).getFullStatus(tr); - #line 3994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 32505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 3994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 32510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont1(UidAndAbortedFlagT && u,int loopDepth) { - #line 3994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = RestoreConfig(u.first).getFullStatus(tr); - #line 3994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 32521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 3994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 32526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -32593,26 +39548,26 @@ class RestoreStatusActorState { } int a_body1cont1loopBody1cont3(std::string const& s,int loopDepth) { - #line 3995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" result.append(s); - #line 3996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" result.append("\n\n"); - #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++i; - #line 32602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; } int a_body1cont1loopBody1cont3(std::string && s,int loopDepth) { - #line 3995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" result.append(s); - #line 3996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" result.append("\n\n"); - #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++i; - #line 32615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; @@ -32680,22 +39635,22 @@ class RestoreStatusActorState { fdb_probe_actor_exit("restoreStatus", reinterpret_cast(this), 2); } - #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key tagName; - #line 3982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector tags; - #line 3989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::string result; - #line 3990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int i; - #line 32693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via restoreStatus() - #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class RestoreStatusActor final : public Actor, public ActorCallback< RestoreStatusActor, 0, std::vector >, public ActorCallback< RestoreStatusActor, 1, UidAndAbortedFlagT >, public ActorCallback< RestoreStatusActor, 2, std::string >, public FastAllocated, public RestoreStatusActorState { - #line 32698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -32706,9 +39661,9 @@ class RestoreStatusActor final : public Actor, public ActorCallback friend struct ActorCallback< RestoreStatusActor, 0, std::vector >; friend struct ActorCallback< RestoreStatusActor, 1, UidAndAbortedFlagT >; friend struct ActorCallback< RestoreStatusActor, 2, std::string >; - #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreStatusActor(Reference const& tr,Key const& tagName) - #line 32711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), RestoreStatusActorState(tr, tagName) { @@ -32733,31 +39688,31 @@ friend struct ActorCallback< RestoreStatusActor, 2, std::string >; } }; - #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] Future restoreStatus( Reference const& tr, Key const& tagName ) { - #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new RestoreStatusActor(tr, tagName)); - #line 32740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 4753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 32745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via abortRestore() - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AbortRestoreActorState { - #line 32751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AbortRestoreActorState(Reference const& tr,Key const& tagName) - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tagName(tagName) - #line 32760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("abortRestore", reinterpret_cast(this)); @@ -32770,24 +39725,24 @@ class AbortRestoreActorState { int a_body1(int loopDepth=0) { try { - #line 4003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); - #line 4007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tag = makeRestoreTag(tagName.toString()); - #line 4008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_0 = tag.get(tr); - #line 4008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 32785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 4008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 32790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -32808,39 +39763,39 @@ class AbortRestoreActorState { } int a_body1cont1(int loopDepth) { - #line 4009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!current.present()) - #line 32813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(ERestoreState::UNITIALIZED); this->~AbortRestoreActorState(); static_cast(this)->destroy(); return 0; } - #line 32817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< ERestoreState >::value()) ERestoreState(ERestoreState::UNITIALIZED); this->~AbortRestoreActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore = RestoreConfig(current.get().first); - #line 4014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = restore.stateEnum().getD(tr); - #line 4014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 32829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 32834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(Optional const& __current,int loopDepth) { - #line 4008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" current = __current; - #line 32843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -32905,25 +39860,25 @@ class AbortRestoreActorState { } int a_body1cont2(int loopDepth) { - #line 4015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = restore.isRunnable(tr); - #line 4015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 32912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 32917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1when1(ERestoreState const& __status,int loopDepth) { - #line 4014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" status = __status; - #line 32926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -32988,41 +39943,41 @@ class AbortRestoreActorState { } int a_body1cont4(int loopDepth) { - #line 4017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!runnable) - #line 32993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(status); this->~AbortRestoreActorState(); static_cast(this)->destroy(); return 0; } - #line 32997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< ERestoreState >::value()) ERestoreState(std::move(status)); // state_var_RVO this->~AbortRestoreActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.stateEnum().set(tr, ERestoreState::ABORTED); - #line 4023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.clearApplyMutationsKeys(tr); - #line 4026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = tag.cancel(tr); - #line 4026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 33011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 4026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 33016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2when1(bool const& __runnable,int loopDepth) { - #line 4015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" runnable = __runnable; - #line 33025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 39980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont4(loopDepth); return loopDepth; @@ -33087,32 +40042,32 @@ class AbortRestoreActorState { } int a_body1cont5(Void const& _,int loopDepth) { - #line 4027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = unlockDatabase(tr, current.get().first); - #line 4027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 33094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 33099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont5(Void && _,int loopDepth) { - #line 4027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = unlockDatabase(tr, current.get().first); - #line 4027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 33110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 33115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -33182,9 +40137,9 @@ class AbortRestoreActorState { } int a_body1cont7(Void const& _,int loopDepth) { - #line 4028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(ERestoreState::ABORTED); this->~AbortRestoreActorState(); static_cast(this)->destroy(); return 0; } - #line 33187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< ERestoreState >::value()) ERestoreState(ERestoreState::ABORTED); this->~AbortRestoreActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -33194,9 +40149,9 @@ class AbortRestoreActorState { } int a_body1cont7(Void && _,int loopDepth) { - #line 4028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(ERestoreState::ABORTED); this->~AbortRestoreActorState(); static_cast(this)->destroy(); return 0; } - #line 33199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< ERestoreState >::value()) ERestoreState(ERestoreState::ABORTED); this->~AbortRestoreActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -33267,26 +40222,26 @@ class AbortRestoreActorState { fdb_probe_actor_exit("abortRestore", reinterpret_cast(this), 4); } - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key tagName; - #line 4007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyBackedTag tag; - #line 4008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional current; - #line 4012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig restore; - #line 4014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ERestoreState status; - #line 4015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bool runnable; - #line 33284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via abortRestore() - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AbortRestoreActor final : public Actor, public ActorCallback< AbortRestoreActor, 0, Optional >, public ActorCallback< AbortRestoreActor, 1, ERestoreState >, public ActorCallback< AbortRestoreActor, 2, bool >, public ActorCallback< AbortRestoreActor, 3, Void >, public ActorCallback< AbortRestoreActor, 4, Void >, public FastAllocated, public AbortRestoreActorState { - #line 33289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -33299,9 +40254,9 @@ friend struct ActorCallback< AbortRestoreActor, 1, ERestoreState >; friend struct ActorCallback< AbortRestoreActor, 2, bool >; friend struct ActorCallback< AbortRestoreActor, 3, Void >; friend struct ActorCallback< AbortRestoreActor, 4, Void >; - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AbortRestoreActor(Reference const& tr,Key const& tagName) - #line 33304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), AbortRestoreActorState(tr, tagName) { @@ -33328,33 +40283,33 @@ friend struct ActorCallback< AbortRestoreActor, 4, Void >; } }; - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] Future abortRestore( Reference const& tr, Key const& tagName ) { - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new AbortRestoreActor(tr, tagName)); - #line 33335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 4782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 33340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via abortRestore() - #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AbortRestoreActor1State { - #line 33346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AbortRestoreActor1State(Database const& cx,Key const& tagName) - #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : cx(cx), - #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tagName(tagName), - #line 4032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr(Reference(new ReadYourWritesTransaction(cx))) - #line 33357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("abortRestore", reinterpret_cast(this)); @@ -33367,9 +40322,9 @@ class AbortRestoreActor1State { int a_body1(int loopDepth=0) { try { - #line 4035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 33372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -33390,11 +40345,11 @@ class AbortRestoreActor1State { } int a_body1cont1(int loopDepth) { - #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 4052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 33397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -33409,16 +40364,16 @@ class AbortRestoreActor1State { int a_body1loopBody1(int loopDepth) { try { - #line 4037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = abortRestore(tr, tagName); - #line 4037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 33416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 4037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 33421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -33451,16 +40406,16 @@ class AbortRestoreActor1State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 4044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr->onError(e); - #line 4044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 33458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 33463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -33473,56 +40428,56 @@ class AbortRestoreActor1State { } int a_body1loopBody1cont2(ERestoreState const& estate,int loopDepth) { - #line 4038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (estate != ERestoreState::ABORTED) - #line 33478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(estate); this->~AbortRestoreActor1State(); static_cast(this)->destroy(); return 0; } - #line 33482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< ERestoreState >::value()) ERestoreState(estate); this->~AbortRestoreActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = tr->commit(); - #line 4041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 33492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 33497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(ERestoreState && estate,int loopDepth) { - #line 4038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (estate != ERestoreState::ABORTED) - #line 33506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(estate); this->~AbortRestoreActor1State(); static_cast(this)->destroy(); return 0; } - #line 33510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< ERestoreState >::value()) ERestoreState(estate); this->~AbortRestoreActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = tr->commit(); - #line 4041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 33520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 33525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -33750,26 +40705,26 @@ class AbortRestoreActor1State { int a_body1cont1loopBody1(int loopDepth) { try { - #line 4054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); - #line 4057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->addReadConflictRange(singleKeyRange(KeyRef())); - #line 4058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->addWriteConflictRange(singleKeyRange(KeyRef())); - #line 4059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = tr->commit(); - #line 4059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 33767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 4059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 33772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -33789,16 +40744,16 @@ class AbortRestoreActor1State { int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 4062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = tr->onError(e); - #line 4062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 33796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 33801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -33811,9 +40766,9 @@ class AbortRestoreActor1State { } int a_body1cont1loopBody1cont2(Void const& _,int loopDepth) { - #line 4060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(ERestoreState::ABORTED); this->~AbortRestoreActor1State(); static_cast(this)->destroy(); return 0; } - #line 33816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< ERestoreState >::value()) ERestoreState(ERestoreState::ABORTED); this->~AbortRestoreActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -33823,9 +40778,9 @@ class AbortRestoreActor1State { } int a_body1cont1loopBody1cont2(Void && _,int loopDepth) { - #line 4060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(ERestoreState::ABORTED); this->~AbortRestoreActor1State(); static_cast(this)->destroy(); return 0; } - #line 33828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< ERestoreState >::value()) ERestoreState(ERestoreState::ABORTED); this->~AbortRestoreActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -33971,18 +40926,18 @@ class AbortRestoreActor1State { fdb_probe_actor_exit("abortRestore", reinterpret_cast(this), 4); } - #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key tagName; - #line 4032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 33980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via abortRestore() - #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AbortRestoreActor1 final : public Actor, public ActorCallback< AbortRestoreActor1, 0, ERestoreState >, public ActorCallback< AbortRestoreActor1, 1, Void >, public ActorCallback< AbortRestoreActor1, 2, Void >, public ActorCallback< AbortRestoreActor1, 3, Void >, public ActorCallback< AbortRestoreActor1, 4, Void >, public FastAllocated, public AbortRestoreActor1State { - #line 33985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -33995,9 +40950,9 @@ friend struct ActorCallback< AbortRestoreActor1, 1, Void >; friend struct ActorCallback< AbortRestoreActor1, 2, Void >; friend struct ActorCallback< AbortRestoreActor1, 3, Void >; friend struct ActorCallback< AbortRestoreActor1, 4, Void >; - #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AbortRestoreActor1(Database const& cx,Key const& tagName) - #line 34000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), AbortRestoreActor1State(cx, tagName) { @@ -34024,61 +40979,61 @@ friend struct ActorCallback< AbortRestoreActor1, 4, Void >; } }; - #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] Future abortRestore( Database const& cx, Key const& tagName ) { - #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new AbortRestoreActor1(cx, tagName)); - #line 34031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 40986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 4818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" struct StartFullRestoreTaskFunc : RestoreTaskFuncBase { static StringRef name; static constexpr uint32_t version = 1; static struct { - static TaskParam firstVersion() { return LiteralStringRef(__FUNCTION__); } + static TaskParam firstVersion() { return __FUNCTION__sr; } } Params; // Find all files needed for the restore and save them in the RestoreConfig for the task. // Update the total number of files and blocks and change state to starting. - #line 34046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _execute() - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _executeActor7State { - #line 34052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _executeActor7State(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : cx(cx), - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 4081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr(new ReadYourWritesTransaction(cx)), - #line 4082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore(task), - #line 4083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreVersion(), - #line 4084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion(), - #line 4085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc(), - #line 4086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ranges(), - #line 4087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" logsOnly(), - #line 4088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" inconsistentSnapshotOnly() - #line 34081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_execute", reinterpret_cast(this)); @@ -34091,9 +41046,9 @@ class _executeActor7State { int a_body1(int loopDepth=0) { try { - #line 4090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 34096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -34114,11 +41069,11 @@ class _executeActor7State { } int a_body1cont1(int loopDepth) { - #line 4128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 4129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 34121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -34133,20 +41088,20 @@ class _executeActor7State { int a_body1loopBody1(int loopDepth) { try { - #line 4092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = checkTaskVersion(tr->getDatabase(), task, name, version); - #line 4095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 1; - #line 4095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -34179,16 +41134,16 @@ class _executeActor7State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 4124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_11 = tr->onError(e); - #line 4124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 34186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1Catch1(__when_expr_11.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_11.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 12; - #line 4124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_11.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -34201,32 +41156,32 @@ class _executeActor7State { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 4096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = store(beginVersion, restore.beginVersion().getD(tr, Snapshot::False, ::invalidVersion)); - #line 4096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 2; - #line 4096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 4096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = store(beginVersion, restore.beginVersion().getD(tr, Snapshot::False, ::invalidVersion)); - #line 4096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 2; - #line 4096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -34296,32 +41251,32 @@ class _executeActor7State { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 4098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = store(restoreVersion, restore.restoreVersion().getOrThrow(tr)); - #line 4098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 3; - #line 4098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 4098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = store(restoreVersion, restore.restoreVersion().getOrThrow(tr)); - #line 4098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 3; - #line 4098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -34391,32 +41346,32 @@ class _executeActor7State { } int a_body1loopBody1cont4(Void const& _,int loopDepth) { - #line 4099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = store(ranges, restore.getRestoreRangesOrDefault(tr)); - #line 4099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 4; - #line 4099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont4(Void && _,int loopDepth) { - #line 4099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = store(ranges, restore.getRestoreRangesOrDefault(tr)); - #line 4099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 4; - #line 4099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -34486,32 +41441,32 @@ class _executeActor7State { } int a_body1loopBody1cont5(Void const& _,int loopDepth) { - #line 4100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = store(logsOnly, restore.onlyApplyMutationLogs().getD(tr, Snapshot::False, false)); - #line 4100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_4.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 5; - #line 4100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont5(Void && _,int loopDepth) { - #line 4100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = store(logsOnly, restore.onlyApplyMutationLogs().getD(tr, Snapshot::False, false)); - #line 4100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_4.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 5; - #line 4100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -34581,32 +41536,32 @@ class _executeActor7State { } int a_body1loopBody1cont6(Void const& _,int loopDepth) { - #line 4101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = store(inconsistentSnapshotOnly, restore.inconsistentSnapshotOnly().getD(tr, Snapshot::False, false)); - #line 4101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_5.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 6; - #line 4101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont6(Void && _,int loopDepth) { - #line 4101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = store(inconsistentSnapshotOnly, restore.inconsistentSnapshotOnly().getD(tr, Snapshot::False, false)); - #line 4101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_5.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 6; - #line 4101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -34676,32 +41631,32 @@ class _executeActor7State { } int a_body1loopBody1cont7(Void const& _,int loopDepth) { - #line 4104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_6 = taskBucket->keepRunning(tr, task); - #line 4104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1loopBody1cont7when1(__when_expr_6.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 7; - #line 4104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont7(Void && _,int loopDepth) { - #line 4104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_6 = taskBucket->keepRunning(tr, task); - #line 4104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1loopBody1cont7when1(__when_expr_6.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 7; - #line 4104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -34771,32 +41726,32 @@ class _executeActor7State { } int a_body1loopBody1cont8(Void const& _,int loopDepth) { - #line 4106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_7 = restore.stateEnum().getD(tr); - #line 4106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1loopBody1cont8when1(__when_expr_7.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 8; - #line 4106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont8(Void && _,int loopDepth) { - #line 4106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_7 = restore.stateEnum().getD(tr); - #line 4106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1loopBody1cont8when1(__when_expr_7.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 8; - #line 4106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -34866,20 +41821,20 @@ class _executeActor7State { } int a_body1loopBody1cont9(ERestoreState const& oldState,int loopDepth) { - #line 4107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (oldState != ERestoreState::QUEUED && oldState != ERestoreState::STARTING) - #line 34871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_8 = restore.logError(cx, restore_error(), format("StartFullRestore: Encountered unexpected state(%d)", oldState), THIS); - #line 4108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1loopBody1cont9when1(__when_expr_8.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 9; - #line 4108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -34891,20 +41846,20 @@ class _executeActor7State { } int a_body1loopBody1cont9(ERestoreState && oldState,int loopDepth) { - #line 4107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (oldState != ERestoreState::QUEUED && oldState != ERestoreState::STARTING) - #line 34896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_8 = restore.logError(cx, restore_error(), format("StartFullRestore: Encountered unexpected state(%d)", oldState), THIS); - #line 4108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1loopBody1cont9when1(__when_expr_8.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 9; - #line 4108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 34907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -34979,33 +41934,33 @@ class _executeActor7State { } int a_body1loopBody1cont10(int loopDepth) { - #line 4114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.stateEnum().set(tr, ERestoreState::STARTING); - #line 4115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.fileSet().clear(tr); - #line 4116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.fileBlockCount().clear(tr); - #line 4117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.fileCount().clear(tr); - #line 4118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_9 = restore.sourceContainer().getOrThrow(tr); - #line 4118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 34994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1loopBody1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1loopBody1cont10when1(__when_expr_9.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 10; - #line 4118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast >*>(static_cast<_executeActor7*>(this))); - #line 34999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont11(Void const& _,int loopDepth) { - #line 4112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor7*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor7State(); static_cast<_executeActor7*>(this)->destroy(); return 0; } - #line 35008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor7*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor7State(); static_cast<_executeActor7*>(this)->finishSendAndDelPromiseRef(); @@ -35015,9 +41970,9 @@ class _executeActor7State { } int a_body1loopBody1cont11(Void && _,int loopDepth) { - #line 4112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor7*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor7State(); static_cast<_executeActor7*>(this)->destroy(); return 0; } - #line 35020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 41975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor7*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor7State(); static_cast<_executeActor7*>(this)->finishSendAndDelPromiseRef(); @@ -35090,36 +42045,36 @@ class _executeActor7State { } int a_body1loopBody1cont10cont1(Reference const& _bc,int loopDepth) { - #line 4119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc = getBackupContainerWithProxy(_bc); - #line 4121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_10 = tr->commit(); - #line 4121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 35099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1loopBody1cont10cont1when1(__when_expr_10.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 11; - #line 4121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 35104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont10cont1(Reference && _bc,int loopDepth) { - #line 4119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc = getBackupContainerWithProxy(_bc); - #line 4121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_10 = tr->commit(); - #line 4121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 35117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1loopBody1cont10cont1when1(__when_expr_10.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 11; - #line 4121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_10.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 35122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -35339,34 +42294,34 @@ class _executeActor7State { } int a_body1cont2(int loopDepth) { - #line 4149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" firstConsistentVersion = invalidVersion; - #line 4150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (beginVersion == invalidVersion) - #line 35346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion = 0; - #line 35350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" keyRangesFilter = Standalone>(); - #line 4154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto const& r : ranges ) { - #line 4155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" keyRangesFilter.push_back_deep(keyRangesFilter.arena(), KeyRangeRef(r)); - #line 35358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_15 = bc->getRestoreSet(restoreVersion, keyRangesFilter, logsOnly, beginVersion); - #line 4157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 35364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_15.isReady()) { if (__when_expr_15.isError()) return a_body1Catch1(__when_expr_15.getError(), loopDepth); else return a_body1cont2when1(__when_expr_15.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 16; - #line 4157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_15.addCallbackAndClear(static_cast >*>(static_cast<_executeActor7*>(this))); - #line 35369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -35381,20 +42336,20 @@ class _executeActor7State { int a_body1cont1loopBody1(int loopDepth) { try { - #line 4131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_12 = tr->getReadVersion(); - #line 4133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 35392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_12.isReady()) { if (__when_expr_12.isError()) return a_body1cont1loopBody1Catch1(__when_expr_12.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_12.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 13; - #line 4133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_12.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 35397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -35427,16 +42382,16 @@ class _executeActor7State { int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 4145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_14 = tr->onError(e); - #line 4145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 35434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_14.isReady()) { if (__when_expr_14.isError()) return a_body1Catch1(__when_expr_14.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_14.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 15; - #line 4145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_14.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 35439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -35449,26 +42404,26 @@ class _executeActor7State { } int a_body1cont1loopBody1cont2(Version const& destVersion,int loopDepth) { - #line 4134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreVersionUpgrade") .detail("RestoreVersion", restoreVersion) .detail("Dest", destVersion); - #line 4137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (destVersion <= restoreVersion) - #line 35456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TEST(true); - #line 4139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CODE_PROBE(true, "Forcing restored cluster to higher version"); + #line 4891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->set(minRequiredCommitVersionKey, BinaryWriter::toValue(restoreVersion + 1, Unversioned())); - #line 4140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_13 = tr->commit(); - #line 4140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 35466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_13.isReady()) { if (__when_expr_13.isError()) return a_body1cont1loopBody1Catch1(__when_expr_13.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_13.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 14; - #line 4140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_13.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 35471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -35480,26 +42435,26 @@ class _executeActor7State { } int a_body1cont1loopBody1cont2(Version && destVersion,int loopDepth) { - #line 4134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreVersionUpgrade") .detail("RestoreVersion", restoreVersion) .detail("Dest", destVersion); - #line 4137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (destVersion <= restoreVersion) - #line 35487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TEST(true); - #line 4139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CODE_PROBE(true, "Forcing restored cluster to higher version"); + #line 4891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->set(minRequiredCommitVersionKey, BinaryWriter::toValue(restoreVersion + 1, Unversioned())); - #line 4140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_13 = tr->commit(); - #line 4140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 35497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_13.isReady()) { if (__when_expr_13.isError()) return a_body1cont1loopBody1Catch1(__when_expr_13.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_13.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 14; - #line 4140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_13.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 35502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -35743,93 +42698,93 @@ class _executeActor7State { } int a_body1cont3(int loopDepth) { - #line 4159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!restorable.present()) - #line 35748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(restore_missing_data(), loopDepth); - #line 35752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" files = std::vector(); - #line 4165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!logsOnly) - #line 35758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion = restorable.get().snapshot.beginVersion; - #line 4167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!inconsistentSnapshotOnly) - #line 35764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( const RangeFile& f : restorable.get().ranges ) { - #line 4169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" files.push_back({ f.version, f.fileName, true, f.blockSize, f.fileSize }); - #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" firstConsistentVersion = std::max(firstConsistentVersion, f.version); - #line 35772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } } else { - #line 4175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(int i = 0;i < restorable.get().ranges.size();++i) { - #line 4176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" const RangeFile& f = restorable.get().ranges[i]; - #line 4177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" files.push_back({ f.version, f.fileName, true, f.blockSize, f.fileSize }); - #line 4180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (i != 0 && f.version != firstConsistentVersion) - #line 35785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" firstConsistentVersion = invalidVersion; - #line 35789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" firstConsistentVersion = f.version; - #line 35795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } } } } else { - #line 4189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" firstConsistentVersion = beginVersion; - #line 35804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!inconsistentSnapshotOnly) - #line 35808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( const LogFile& f : restorable.get().logs ) { - #line 4193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" files.push_back({ f.beginVersion, f.fileName, false, f.blockSize, f.fileSize, f.endVersion }); - #line 35814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } } - #line 4197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Params.firstVersion().set(task, beginVersion); - #line 4199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 4200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 35823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont3loopHead1(loopDepth); return loopDepth; } int a_body1cont2when1(Optional const& __restorable,int loopDepth) { - #line 4157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restorable = __restorable; - #line 35832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; @@ -35894,15 +42849,15 @@ class _executeActor7State { } int a_body1cont6(int loopDepth) { - #line 4212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" start = files.begin(); - #line 4213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" end = files.end(); - #line 4215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 4216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 35905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont6loopHead1(loopDepth); return loopDepth; @@ -35917,22 +42872,22 @@ class _executeActor7State { int a_body1cont3loopBody1(int loopDepth) { try { - #line 4202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.firstConsistentVersion().set(tr, firstConsistentVersion); - #line 4205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_16 = tr->commit(); - #line 4205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 35930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_16.isReady()) { if (__when_expr_16.isError()) return a_body1cont3loopBody1Catch1(__when_expr_16.getError(), loopDepth); else return a_body1cont3loopBody1when1(__when_expr_16.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 17; - #line 4205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_16.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 35935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -35965,16 +42920,16 @@ class _executeActor7State { int a_body1cont3loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 4208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_17 = tr->onError(e); - #line 4208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 35972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_17.isReady()) { if (__when_expr_17.isError()) return a_body1Catch1(__when_expr_17.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1Catch1when1(__when_expr_17.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 18; - #line 4208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_17.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 35977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 42932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -36137,9 +43092,9 @@ class _executeActor7State { } int a_body1cont18(int loopDepth) { - #line 4254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_executeActor7*>(this)->SAV::futures) { (void)(Void()); this->~_executeActor7State(); static_cast<_executeActor7*>(this)->destroy(); return 0; } - #line 36142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_executeActor7*>(this)->SAV< Void >::value()) Void(Void()); this->~_executeActor7State(); static_cast<_executeActor7*>(this)->finishSendAndDelPromiseRef(); @@ -36156,27 +43111,27 @@ class _executeActor7State { } int a_body1cont6loopBody1(int loopDepth) { - #line 4216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!(start != end)) - #line 36161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1cont6break1(loopDepth==0?0:loopDepth-1); // break } try { - #line 4218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_18 = taskBucket->keepRunning(tr, task); - #line 4221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1cont6loopBody1Catch1(actor_cancelled(), loopDepth); - #line 36174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_18.isReady()) { if (__when_expr_18.isError()) return a_body1cont6loopBody1Catch1(__when_expr_18.getError(), loopDepth); else return a_body1cont6loopBody1when1(__when_expr_18.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 19; - #line 4221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_18.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 36179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -36209,16 +43164,16 @@ class _executeActor7State { int a_body1cont6loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 4250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_20 = tr->onError(e); - #line 4250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 36216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_20.isReady()) { if (__when_expr_20.isError()) return a_body1Catch1(__when_expr_20.getError(), std::max(0, loopDepth - 1)); else return a_body1cont6loopBody1Catch1when1(__when_expr_20.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 21; - #line 4250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_20.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 36221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -36231,80 +43186,80 @@ class _executeActor7State { } int a_body1cont6loopBody1cont3(Void const& _,int loopDepth) { - #line 4223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" i = start; - #line 4225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" txBytes = 0; - #line 4226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nFileBlocks = 0; - #line 4227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nFiles = 0; - #line 4228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" auto fileSet = restore.fileSet(); - #line 4229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(;i != end && txBytes < 1e6;++i) { - #line 4230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" txBytes += fileSet.insert(tr, *i); - #line 4231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nFileBlocks += (i->fileSize + i->blockSize - 1) / i->blockSize; - #line 4232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++nFiles; - #line 36252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.fileCount().atomicOp(tr, nFiles, MutationRef::Type::AddValue); - #line 4236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.fileBlockCount().atomicOp(tr, nFileBlocks, MutationRef::Type::AddValue); - #line 4238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_19 = tr->commit(); - #line 4238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1cont6loopBody1Catch1(actor_cancelled(), loopDepth); - #line 36262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_19.isReady()) { if (__when_expr_19.isError()) return a_body1cont6loopBody1Catch1(__when_expr_19.getError(), loopDepth); else return a_body1cont6loopBody1cont3when1(__when_expr_19.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 20; - #line 4238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_19.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 36267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont6loopBody1cont3(Void && _,int loopDepth) { - #line 4223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" i = start; - #line 4225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" txBytes = 0; - #line 4226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nFileBlocks = 0; - #line 4227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nFiles = 0; - #line 4228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" auto fileSet = restore.fileSet(); - #line 4229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(;i != end && txBytes < 1e6;++i) { - #line 4230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" txBytes += fileSet.insert(tr, *i); - #line 4231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nFileBlocks += (i->fileSize + i->blockSize - 1) / i->blockSize; - #line 4232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++nFiles; - #line 36292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.fileCount().atomicOp(tr, nFiles, MutationRef::Type::AddValue); - #line 4236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.fileBlockCount().atomicOp(tr, nFileBlocks, MutationRef::Type::AddValue); - #line 4238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_19 = tr->commit(); - #line 4238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_executeActor7*>(this)->actor_wait_state < 0) return a_body1cont6loopBody1Catch1(actor_cancelled(), loopDepth); - #line 36302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_19.isReady()) { if (__when_expr_19.isError()) return a_body1cont6loopBody1Catch1(__when_expr_19.getError(), loopDepth); else return a_body1cont6loopBody1cont3when1(__when_expr_19.get(), loopDepth); }; static_cast<_executeActor7*>(this)->actor_wait_state = 20; - #line 4238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_19.addCallbackAndClear(static_cast*>(static_cast<_executeActor7*>(this))); - #line 36307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -36374,26 +43329,26 @@ class _executeActor7State { } int a_body1cont6loopBody1cont4(Void const& _,int loopDepth) { - #line 4240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreLoadedFiles") .detail("RestoreUID", restore.getUid()) .detail("FileCount", nFiles) .detail("FileBlockCount", nFileBlocks) .detail("TransactionBytes", txBytes) .detail("TaskInstance", THIS_ADDR); - #line 4247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" start = i; - #line 4248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 36383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont6loopBody1cont7(loopDepth); return loopDepth; } int a_body1cont6loopBody1cont4(Void && _,int loopDepth) { - #line 4240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FileRestoreLoadedFiles") .detail("RestoreUID", restore.getUid()) .detail("FileCount", nFiles) .detail("FileBlockCount", nFileBlocks) .detail("TransactionBytes", txBytes) .detail("TaskInstance", THIS_ADDR); - #line 4247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" start = i; - #line 4248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 36396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont6loopBody1cont7(loopDepth); return loopDepth; @@ -36549,56 +43504,56 @@ class _executeActor7State { fdb_probe_actor_exit("_execute", reinterpret_cast(this), 20); } - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 4081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 4082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig restore; - #line 4083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version restoreVersion; - #line 4084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version beginVersion; - #line 4085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference bc; - #line 4086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector ranges; - #line 4087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bool logsOnly; - #line 4088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bool inconsistentSnapshotOnly; - #line 4149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version firstConsistentVersion; - #line 4153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> keyRangesFilter; - #line 4157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional restorable; - #line 4164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector files; - #line 4212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector::iterator start; - #line 4213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector::iterator end; - #line 4223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector::iterator i; - #line 4225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int txBytes; - #line 4226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int nFileBlocks; - #line 4227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int nFiles; - #line 36596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _execute() - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _executeActor7 final : public Actor, public ActorCallback< _executeActor7, 0, Void >, public ActorCallback< _executeActor7, 1, Void >, public ActorCallback< _executeActor7, 2, Void >, public ActorCallback< _executeActor7, 3, Void >, public ActorCallback< _executeActor7, 4, Void >, public ActorCallback< _executeActor7, 5, Void >, public ActorCallback< _executeActor7, 6, Void >, public ActorCallback< _executeActor7, 7, ERestoreState >, public ActorCallback< _executeActor7, 8, Void >, public ActorCallback< _executeActor7, 9, Reference >, public ActorCallback< _executeActor7, 10, Void >, public ActorCallback< _executeActor7, 11, Void >, public ActorCallback< _executeActor7, 12, Version >, public ActorCallback< _executeActor7, 13, Void >, public ActorCallback< _executeActor7, 14, Void >, public ActorCallback< _executeActor7, 15, Optional >, public ActorCallback< _executeActor7, 16, Void >, public ActorCallback< _executeActor7, 17, Void >, public ActorCallback< _executeActor7, 18, Void >, public ActorCallback< _executeActor7, 19, Void >, public ActorCallback< _executeActor7, 20, Void >, public FastAllocated<_executeActor7>, public _executeActor7State<_executeActor7> { - #line 36601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_executeActor7>::operator new; using FastAllocated<_executeActor7>::operator delete; @@ -36627,9 +43582,9 @@ friend struct ActorCallback< _executeActor7, 17, Void >; friend struct ActorCallback< _executeActor7, 18, Void >; friend struct ActorCallback< _executeActor7, 19, Void >; friend struct ActorCallback< _executeActor7, 20, Void >; - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _executeActor7(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 36632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _executeActor7State<_executeActor7>(cx, taskBucket, futureBucket, task) { @@ -36672,39 +43627,39 @@ friend struct ActorCallback< _executeActor7, 20, Void >; } }; - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _execute( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _executeActor7(cx, taskBucket, futureBucket, task)); - #line 36679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 5008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 36684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via _finish() - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class _finishActor14State { - #line 36690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor14State(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" futureBucket(futureBucket), - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task(task), - #line 4261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore(task), - #line 4263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" firstVersion(Params.firstVersion().getOrDefault(task, invalidVersion)) - #line 36707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -36717,20 +43672,20 @@ class _finishActor14State { int a_body1(int loopDepth=0) { try { - #line 4264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (firstVersion == invalidVersion) - #line 36722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = restore.logError( tr->getDatabase(), restore_missing_data(), "StartFullRestore: The backup had no data.", THIS); - #line 4265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor14*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 36728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor14*>(this)->actor_wait_state = 1; - #line 4265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor14*>(this))); - #line 36733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -36756,54 +43711,54 @@ class _finishActor14State { } int a_body1cont1(int loopDepth) { - #line 4272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.stateEnum().set(tr, ERestoreState::RUNNING); - #line 4276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.setApplyBeginVersion(tr, firstVersion); - #line 4277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.setApplyEndVersion(tr, firstVersion); - #line 4280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = success(RestoreDispatchTaskFunc::addTask( tr, taskBucket, task, 0, "", 0, CLIENT_KNOBS->RESTORE_DISPATCH_BATCH_SIZE)); - #line 4280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor14*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 36769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1when1(__when_expr_3.get(), loopDepth); }; static_cast<_finishActor14*>(this)->actor_wait_state = 4; - #line 4280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast<_finishActor14*>(this))); - #line 36774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void const& _,int loopDepth) { - #line 4267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = restore.tag().getD(tr); - #line 4267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor14*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 36785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor14*>(this)->actor_wait_state = 2; - #line 4267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor14*>(this))); - #line 36790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 4267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = restore.tag().getD(tr); - #line 4267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor14*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 36801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor14*>(this)->actor_wait_state = 2; - #line 4267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor14*>(this))); - #line 36806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -36873,32 +43828,32 @@ class _finishActor14State { } int a_body1cont3(std::string const& tag,int loopDepth) { - #line 4268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = success(abortRestore(tr, StringRef(tag))); - #line 4268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor14*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 36880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor14*>(this)->actor_wait_state = 3; - #line 4268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor14*>(this))); - #line 36885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(std::string && tag,int loopDepth) { - #line 4268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = success(abortRestore(tr, StringRef(tag))); - #line 4268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor14*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 36896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast<_finishActor14*>(this)->actor_wait_state = 3; - #line 4268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast<_finishActor14*>(this))); - #line 36901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -36968,9 +43923,9 @@ class _finishActor14State { } int a_body1cont4(Void const& _,int loopDepth) { - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor14*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor14State(); static_cast<_finishActor14*>(this)->destroy(); return 0; } - #line 36973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor14*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor14State(); static_cast<_finishActor14*>(this)->finishSendAndDelPromiseRef(); @@ -36980,9 +43935,9 @@ class _finishActor14State { } int a_body1cont4(Void && _,int loopDepth) { - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast<_finishActor14*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor14State(); static_cast<_finishActor14*>(this)->destroy(); return 0; } - #line 36985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 43940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast<_finishActor14*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActor14State(); static_cast<_finishActor14*>(this)->finishSendAndDelPromiseRef(); @@ -37055,32 +44010,32 @@ class _finishActor14State { } int a_body1cont6(Void const& _,int loopDepth) { - #line 4283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = taskBucket->finish(tr, task); - #line 4283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor14*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 37062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor14*>(this)->actor_wait_state = 5; - #line 4283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor14*>(this))); - #line 37067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont6(Void && _,int loopDepth) { - #line 4283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = taskBucket->finish(tr, task); - #line 4283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast<_finishActor14*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 37078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; static_cast<_finishActor14*>(this)->actor_wait_state = 5; - #line 4283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast<_finishActor14*>(this))); - #line 37083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -37150,37 +44105,25 @@ class _finishActor14State { } int a_body1cont7(Void const& _,int loopDepth) { - #line 4284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - logsOnly = restore.onlyApplyMutationLogs().get(tr); - #line 4285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_5 = success(logsOnly); - #line 4285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor14*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 37159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont7when1(__when_expr_5.get(), loopDepth); }; - static_cast<_finishActor14*>(this)->actor_wait_state = 6; - #line 4285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_finishActor14*>(this))); - #line 37164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 5036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_finishActor14*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor14State(); static_cast<_finishActor14*>(this)->destroy(); return 0; } + #line 44110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_finishActor14*>(this)->SAV< Void >::value()) Void(Void()); + this->~_finishActor14State(); + static_cast<_finishActor14*>(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } int a_body1cont7(Void && _,int loopDepth) { - #line 4284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - logsOnly = restore.onlyApplyMutationLogs().get(tr); - #line 4285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_5 = success(logsOnly); - #line 4285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor14*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 37177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont7when1(__when_expr_5.get(), loopDepth); }; - static_cast<_finishActor14*>(this)->actor_wait_state = 6; - #line 4285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast<_finishActor14*>(this))); - #line 37182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 5036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast<_finishActor14*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor14State(); static_cast<_finishActor14*>(this)->destroy(); return 0; } + #line 44122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast<_finishActor14*>(this)->SAV< Void >::value()) Void(Void()); + this->~_finishActor14State(); + static_cast<_finishActor14*>(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } @@ -37247,230 +44190,24 @@ class _finishActor14State { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 4); } - int a_body1cont8(Void const& _,int loopDepth) - { - #line 4286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (logsOnly.get().present() && logsOnly.get().get()) - #line 37254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Value versionEncoded = BinaryWriter::toValue(Params.firstVersion().get(task), Unversioned()); - #line 4290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_6 = krmSetRange(tr, restore.applyMutationsMapPrefix(), normalKeys, versionEncoded); - #line 4290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor14*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 37262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont8when1(__when_expr_6.get(), loopDepth); }; - static_cast<_finishActor14*>(this)->actor_wait_state = 7; - #line 4290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_finishActor14*>(this))); - #line 37267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont9(loopDepth); - } - - return loopDepth; - } - int a_body1cont8(Void && _,int loopDepth) - { - #line 4286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (logsOnly.get().present() && logsOnly.get().get()) - #line 37281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Value versionEncoded = BinaryWriter::toValue(Params.firstVersion().get(task), Unversioned()); - #line 4290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_6 = krmSetRange(tr, restore.applyMutationsMapPrefix(), normalKeys, versionEncoded); - #line 4290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast<_finishActor14*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 37289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont8when1(__when_expr_6.get(), loopDepth); }; - static_cast<_finishActor14*>(this)->actor_wait_state = 7; - #line 4290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast<_finishActor14*>(this))); - #line 37294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont9(loopDepth); - } - - return loopDepth; - } - int a_body1cont7when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont8(_, loopDepth); - - return loopDepth; - } - int a_body1cont7when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont8(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose6() - { - if (static_cast<_finishActor14*>(this)->actor_wait_state > 0) static_cast<_finishActor14*>(this)->actor_wait_state = 0; - static_cast<_finishActor14*>(this)->ActorCallback< _finishActor14, 5, Void >::remove(); - - } - void a_callback_fire(ActorCallback< _finishActor14, 5, Void >*,Void const& value) - { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1cont7when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 5); - - } - void a_callback_fire(ActorCallback< _finishActor14, 5, Void >*,Void && value) - { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1cont7when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 5); - - } - void a_callback_error(ActorCallback< _finishActor14, 5, Void >*,Error err) - { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 5); - - } - int a_body1cont9(int loopDepth) - { - #line 4292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast<_finishActor14*>(this)->SAV::futures) { (void)(Void()); this->~_finishActor14State(); static_cast<_finishActor14*>(this)->destroy(); return 0; } - #line 37371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast<_finishActor14*>(this)->SAV< Void >::value()) Void(Void()); - this->~_finishActor14State(); - static_cast<_finishActor14*>(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont10(Void const& _,int loopDepth) - { - loopDepth = a_body1cont9(loopDepth); - - return loopDepth; - } - int a_body1cont10(Void && _,int loopDepth) - { - loopDepth = a_body1cont9(loopDepth); - - return loopDepth; - } - int a_body1cont8when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont10(_, loopDepth); - - return loopDepth; - } - int a_body1cont8when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont10(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose7() - { - if (static_cast<_finishActor14*>(this)->actor_wait_state > 0) static_cast<_finishActor14*>(this)->actor_wait_state = 0; - static_cast<_finishActor14*>(this)->ActorCallback< _finishActor14, 6, Void >::remove(); - - } - void a_callback_fire(ActorCallback< _finishActor14, 6, Void >*,Void const& value) - { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1cont8when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 6); - - } - void a_callback_fire(ActorCallback< _finishActor14, 6, Void >*,Void && value) - { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1cont8when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 6); - - } - void a_callback_error(ActorCallback< _finishActor14, 6, Void >*,Error err) - { - fdb_probe_actor_enter("_finish", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("_finish", reinterpret_cast(this), 6); - - } - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference futureBucket; - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 4261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig restore; - #line 4263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version firstVersion; - #line 4284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Future> logsOnly; - #line 37468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class _finishActor14 final : public Actor, public ActorCallback< _finishActor14, 0, Void >, public ActorCallback< _finishActor14, 1, std::string >, public ActorCallback< _finishActor14, 2, Void >, public ActorCallback< _finishActor14, 3, Void >, public ActorCallback< _finishActor14, 4, Void >, public ActorCallback< _finishActor14, 5, Void >, public ActorCallback< _finishActor14, 6, Void >, public FastAllocated<_finishActor14>, public _finishActor14State<_finishActor14> { - #line 37473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class _finishActor14 final : public Actor, public ActorCallback< _finishActor14, 0, Void >, public ActorCallback< _finishActor14, 1, std::string >, public ActorCallback< _finishActor14, 2, Void >, public ActorCallback< _finishActor14, 3, Void >, public ActorCallback< _finishActor14, 4, Void >, public FastAllocated<_finishActor14>, public _finishActor14State<_finishActor14> { + #line 44210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated<_finishActor14>::operator new; using FastAllocated<_finishActor14>::operator delete; @@ -37483,11 +44220,9 @@ friend struct ActorCallback< _finishActor14, 1, std::string >; friend struct ActorCallback< _finishActor14, 2, Void >; friend struct ActorCallback< _finishActor14, 3, Void >; friend struct ActorCallback< _finishActor14, 4, Void >; -friend struct ActorCallback< _finishActor14, 5, Void >; -friend struct ActorCallback< _finishActor14, 6, Void >; - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" _finishActor14(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 37490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), _finishActor14State<_finishActor14>(tr, taskBucket, futureBucket, task) { @@ -37510,43 +44245,41 @@ friend struct ActorCallback< _finishActor14, 6, Void >; case 3: this->a_callback_error((ActorCallback< _finishActor14, 2, Void >*)0, actor_cancelled()); break; case 4: this->a_callback_error((ActorCallback< _finishActor14, 3, Void >*)0, actor_cancelled()); break; case 5: this->a_callback_error((ActorCallback< _finishActor14, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< _finishActor14, 5, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< _finishActor14, 6, Void >*)0, actor_cancelled()); break; } } }; - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new _finishActor14(tr, taskBucket, futureBucket, task)); - #line 37523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 5038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 37528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via addTask() - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor12State { - #line 37534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor12State(Reference const& tr,Reference const& taskBucket,UID const& uid,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : tr(tr), - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" taskBucket(taskBucket), - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" uid(uid), - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" completionKey(completionKey), - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" waitFor(waitFor) - #line 37549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("addTask", reinterpret_cast(this)); @@ -37559,20 +44292,20 @@ class AddTaskActor12State { int a_body1(int loopDepth=0) { try { - #line 4300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = completionKey.get(tr, taskBucket); - #line 4303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 37570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 4303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 37575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -37593,40 +44326,40 @@ class AddTaskActor12State { } int a_body1cont1(Key const& doneKey,int loopDepth) { - #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task = Reference(new Task(StartFullRestoreTaskFunc::name, StartFullRestoreTaskFunc::version, doneKey)); - #line 4307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore = RestoreConfig(uid); - #line 4309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = restore.toTask(tr, task); - #line 4309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 37604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 37609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Key && doneKey,int loopDepth) { - #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" task = Reference(new Task(StartFullRestoreTaskFunc::name, StartFullRestoreTaskFunc::version, doneKey)); - #line 4307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore = RestoreConfig(uid); - #line 4309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = restore.toTask(tr, task); - #line 4309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 37624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 37629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -37696,56 +44429,56 @@ class AddTaskActor12State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 4311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!waitFor) - #line 37701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task)); this->~AddTaskActor12State(); static_cast(this)->destroy(); return 0; } - #line 37705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task)); this->~AddTaskActor12State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = waitFor->onSetAddTask(tr, taskBucket, task); - #line 4315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 37715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 37720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 4311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!waitFor) - #line 37729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(taskBucket->addTask(tr, task)); this->~AddTaskActor12State(); static_cast(this)->destroy(); return 0; } - #line 37733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(taskBucket->addTask(tr, task)); this->~AddTaskActor12State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = waitFor->onSetAddTask(tr, taskBucket, task); - #line 4315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 37743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 37748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -37815,10 +44548,10 @@ class AddTaskActor12State { } int a_body1cont3(Void const& _,int loopDepth) { - #line 4316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor12State(); static_cast(this)->destroy(); return 0; } - #line 37820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 5060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor12State(); static_cast(this)->destroy(); return 0; } + #line 44553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor12State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -37827,10 +44560,10 @@ class AddTaskActor12State { } int a_body1cont3(Void && _,int loopDepth) { - #line 4316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(LiteralStringRef("OnSetAddTask")); this->~AddTaskActor12State(); static_cast(this)->destroy(); return 0; } - #line 37832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(LiteralStringRef("OnSetAddTask")); + #line 5060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)("OnSetAddTask"_sr); this->~AddTaskActor12State(); static_cast(this)->destroy(); return 0; } + #line 44565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key("OnSetAddTask"_sr); this->~AddTaskActor12State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -37900,26 +44633,26 @@ class AddTaskActor12State { fdb_probe_actor_exit("addTask", reinterpret_cast(this), 2); } - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference taskBucket; - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UID uid; - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TaskCompletionKey completionKey; - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference waitFor; - #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference task; - #line 4307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig restore; - #line 37917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via addTask() - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AddTaskActor12 final : public Actor, public ActorCallback< AddTaskActor12, 0, Key >, public ActorCallback< AddTaskActor12, 1, Void >, public ActorCallback< AddTaskActor12, 2, Void >, public FastAllocated, public AddTaskActor12State { - #line 37922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -37930,9 +44663,9 @@ class AddTaskActor12 final : public Actor, public ActorCallback< AddTaskAct friend struct ActorCallback< AddTaskActor12, 0, Key >; friend struct ActorCallback< AddTaskActor12, 1, Void >; friend struct ActorCallback< AddTaskActor12, 2, Void >; - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AddTaskActor12(Reference const& tr,Reference const& taskBucket,UID const& uid,TaskCompletionKey const& completionKey,Reference const& waitFor = Reference()) - #line 37935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), AddTaskActor12State(tr, taskBucket, uid, completionKey, waitFor) { @@ -37957,14 +44690,14 @@ friend struct ActorCallback< AddTaskActor12, 2, Void >; } }; - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future addTask( Reference const& tr, Reference const& taskBucket, UID const& uid, TaskCompletionKey const& completionKey, Reference const& waitFor = Reference() ) { - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new AddTaskActor12(tr, taskBucket, uid, completionKey, waitFor)); - #line 37964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 5062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StringRef getName() const override { return name; }; @@ -37981,7 +44714,7 @@ friend struct ActorCallback< AddTaskActor12, 2, Void >; return _finish(tr, tb, fb, task); }; }; -StringRef StartFullRestoreTaskFunc::name = LiteralStringRef("restore_start"); +StringRef StartFullRestoreTaskFunc::name = "restore_start"_sr; REGISTER_TASKFUNC(StartFullRestoreTaskFunc); } // namespace fileBackup @@ -38000,28 +44733,28 @@ class FileBackupAgentImpl { static constexpr int MAX_RESTORABLE_FILE_METASECTION_BYTES = 1024 * 8; // Parallel restore - #line 38003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via parallelRestoreFinish() - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class ParallelRestoreFinishActorState { - #line 38009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ParallelRestoreFinishActorState(Database const& cx,UID const& randomUID,UnlockDB const& unlockDB = UnlockDB::True) - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : cx(cx), - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" randomUID(randomUID), - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" unlockDB(unlockDB), - #line 4354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr(cx), - #line 4355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreRequestDoneKeyValue() - #line 38024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("parallelRestoreFinish", reinterpret_cast(this)); @@ -38034,11 +44767,11 @@ class ParallelRestoreFinishActorState { int a_body1(int loopDepth=0) { try { - #line 4356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreToolWaitForRestoreToFinish").detail("DBLock", randomUID); - #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 38041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -38059,18 +44792,18 @@ class ParallelRestoreFinishActorState { } int a_body1cont1(int loopDepth) { - #line 4378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreToolRestoreFinished") .detail("ClearRestoreRequestDoneKey", restoreRequestDoneKeyValue.present()); - #line 4381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = runRYWTransaction(cx, [](Reference tr) -> Future { tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr->setOption(FDBTransactionOptions::LOCK_AWARE); tr->clear(restoreRequestDoneKey); return Void(); }); - #line 4381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 38068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -38085,20 +44818,20 @@ class ParallelRestoreFinishActorState { int a_body1loopBody1(int loopDepth) { try { - #line 4360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_0 = tr.get(restoreRequestDoneKey); - #line 4362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 38096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 4362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 38101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -38131,16 +44864,16 @@ class ParallelRestoreFinishActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 4374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = tr.onError(e); - #line 4374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 38138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 4374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -38153,28 +44886,28 @@ class ParallelRestoreFinishActorState { } int a_body1loopBody1cont2(Optional const& _restoreRequestDoneKeyValue,int loopDepth) { - #line 4363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreRequestDoneKeyValue = _restoreRequestDoneKeyValue; - #line 4365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (restoreRequestDoneKeyValue.present()) - #line 38160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } else { - #line 4368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" watchForRestoreRequestDone = tr.watch(restoreRequestDoneKey); - #line 4369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = tr.commit(); - #line 4369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 38172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -38182,28 +44915,28 @@ class ParallelRestoreFinishActorState { } int a_body1loopBody1cont2(Optional && _restoreRequestDoneKeyValue,int loopDepth) { - #line 4363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreRequestDoneKeyValue = _restoreRequestDoneKeyValue; - #line 4365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (restoreRequestDoneKeyValue.present()) - #line 38189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } else { - #line 4368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" watchForRestoreRequestDone = tr.watch(restoreRequestDoneKey); - #line 4369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = tr.commit(); - #line 4369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 38201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 44939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -38274,32 +45007,32 @@ class ParallelRestoreFinishActorState { } int a_body1loopBody1cont5(Void const& _,int loopDepth) { - #line 4370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = watchForRestoreRequestDone; - #line 4370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 38281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont5(Void && _,int loopDepth) { - #line 4370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = watchForRestoreRequestDone; - #line 4370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 38297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -38519,29 +45252,29 @@ class ParallelRestoreFinishActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 4388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (unlockDB) - #line 38524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreToolRestoreFinished").detail("UnlockDBStart", randomUID); - #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = unlockDatabase(cx, randomUID); - #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 38532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 4393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreToolRestoreFinished").detail("DBLeftLockedAfterRestore", randomUID); - #line 38544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); } @@ -38549,29 +45282,29 @@ class ParallelRestoreFinishActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 4388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (unlockDB) - #line 38554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreToolRestoreFinished").detail("UnlockDBStart", randomUID); - #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = unlockDatabase(cx, randomUID); - #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 38562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 4393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreToolRestoreFinished").detail("DBLeftLockedAfterRestore", randomUID); - #line 38574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); } @@ -38642,9 +45375,9 @@ class ParallelRestoreFinishActorState { } int a_body1cont3(int loopDepth) { - #line 4396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ParallelRestoreFinishActorState(); static_cast(this)->destroy(); return 0; } - #line 38647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ParallelRestoreFinishActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -38654,18 +45387,18 @@ class ParallelRestoreFinishActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 4391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreToolRestoreFinished").detail("UnlockDBFinish", randomUID); - #line 38659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; } int a_body1cont4(Void && _,int loopDepth) { - #line 4391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreToolRestoreFinished").detail("UnlockDBFinish", randomUID); - #line 38668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; @@ -38733,24 +45466,24 @@ class ParallelRestoreFinishActorState { fdb_probe_actor_exit("parallelRestoreFinish", reinterpret_cast(this), 5); } - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UID randomUID; - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UnlockDB unlockDB; - #line 4354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ReadYourWritesTransaction tr; - #line 4355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional restoreRequestDoneKeyValue; - #line 4368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future watchForRestoreRequestDone; - #line 38748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via parallelRestoreFinish() - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class ParallelRestoreFinishActor final : public Actor, public ActorCallback< ParallelRestoreFinishActor, 0, Optional >, public ActorCallback< ParallelRestoreFinishActor, 1, Void >, public ActorCallback< ParallelRestoreFinishActor, 2, Void >, public ActorCallback< ParallelRestoreFinishActor, 3, Void >, public ActorCallback< ParallelRestoreFinishActor, 4, Void >, public ActorCallback< ParallelRestoreFinishActor, 5, Void >, public FastAllocated, public ParallelRestoreFinishActorState { - #line 38753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -38764,9 +45497,9 @@ friend struct ActorCallback< ParallelRestoreFinishActor, 2, Void >; friend struct ActorCallback< ParallelRestoreFinishActor, 3, Void >; friend struct ActorCallback< ParallelRestoreFinishActor, 4, Void >; friend struct ActorCallback< ParallelRestoreFinishActor, 5, Void >; - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ParallelRestoreFinishActor(Database const& cx,UID const& randomUID,UnlockDB const& unlockDB = UnlockDB::True) - #line 38769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), ParallelRestoreFinishActorState(cx, randomUID, unlockDB) { @@ -38794,49 +45527,49 @@ friend struct ActorCallback< ParallelRestoreFinishActor, 5, Void >; } }; - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future parallelRestoreFinish( Database const& cx, UID const& randomUID, UnlockDB const& unlockDB = UnlockDB::True ) { - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new ParallelRestoreFinishActor(cx, randomUID, unlockDB)); - #line 38801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 5142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 38806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via submitParallelRestore() - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class SubmitParallelRestoreActorState { - #line 38812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" SubmitParallelRestoreActorState(Database const& cx,Key const& backupTag,Standalone> const& backupRanges,Key const& bcUrl,Optional const& proxy,Version const& targetVersion,LockDB const& lockDB,UID const& randomUID,Key const& addPrefix,Key const& removePrefix) - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : cx(cx), - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupTag(backupTag), - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupRanges(backupRanges), - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bcUrl(bcUrl), - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" proxy(proxy), - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" targetVersion(targetVersion), - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" lockDB(lockDB), - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" randomUID(randomUID), - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addPrefix(addPrefix), - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" removePrefix(removePrefix), - #line 4410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc(IBackupContainer::openContainer(bcUrl.toString(), proxy, {})) - #line 38839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("submitParallelRestore", reinterpret_cast(this)); @@ -38849,16 +45582,16 @@ class SubmitParallelRestoreActorState { int a_body1(int loopDepth=0) { try { - #line 4411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = bc->describeBackup(); - #line 4411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 38856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 4411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -38879,25 +45612,25 @@ class SubmitParallelRestoreActorState { } int a_body1cont1(int loopDepth) { - #line 4412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = desc.resolveVersionTimes(cx); - #line 4412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 38886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(BackupDescription const& __desc,int loopDepth) { - #line 4411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" desc = __desc; - #line 38900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -38962,52 +45695,52 @@ class SubmitParallelRestoreActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 4414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (targetVersion == invalidVersion && desc.maxRestorableVersion.present()) - #line 38967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" targetVersion = desc.maxRestorableVersion.get(); - #line 4416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevWarn, "FastRestoreSubmitRestoreRequestWithInvalidTargetVersion") .detail("OverrideTargetVersion", targetVersion); - #line 38973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_2 = bc->getRestoreSet(targetVersion); - #line 4420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 38979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 38984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 4414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (targetVersion == invalidVersion && desc.maxRestorableVersion.present()) - #line 38993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" targetVersion = desc.maxRestorableVersion.get(); - #line 4416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevWarn, "FastRestoreSubmitRestoreRequestWithInvalidTargetVersion") .detail("OverrideTargetVersion", targetVersion); - #line 38999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_2 = bc->getRestoreSet(targetVersion); - #line 4420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 39005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 39010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -39077,54 +45810,54 @@ class SubmitParallelRestoreActorState { } int a_body1cont3(Optional const& restoreSet,int loopDepth) { - #line 4422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!restoreSet.present()) - #line 39082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevWarn, "FileBackupAgentRestoreNotPossible") .detail("BackupContainer", bc->getURL()) .detail("TargetVersion", targetVersion); - #line 4426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(restore_invalid_version(), loopDepth); - #line 39088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreSubmitRestoreRequest") .detail("BackupDesc", desc.toString()) .detail("TargetVersion", targetVersion); - #line 4433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 4434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreIndex = 0; - #line 4435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" numTries = 0; - #line 4437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 39100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont3loopHead1(loopDepth); return loopDepth; } int a_body1cont3(Optional && restoreSet,int loopDepth) { - #line 4422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!restoreSet.present()) - #line 39109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevWarn, "FileBackupAgentRestoreNotPossible") .detail("BackupContainer", bc->getURL()) .detail("TargetVersion", targetVersion); - #line 4426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(restore_invalid_version(), loopDepth); - #line 39115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreSubmitRestoreRequest") .detail("BackupDesc", desc.toString()) .detail("TargetVersion", targetVersion); - #line 4433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 4434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreIndex = 0; - #line 4435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" numTries = 0; - #line 4437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 39127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont3loopHead1(loopDepth); return loopDepth; @@ -39194,13 +45927,13 @@ class SubmitParallelRestoreActorState { } int a_body1cont5(int loopDepth) { - #line 4457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->reset(); - #line 4458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" numTries = 0; - #line 4459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 39203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont5loopHead1(loopDepth); return loopDepth; @@ -39215,20 +45948,20 @@ class SubmitParallelRestoreActorState { int a_body1cont3loopBody1(int loopDepth) { try { - #line 4439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (lockDB) - #line 39220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = lockDatabase(cx, randomUID); - #line 4440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 39226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont3loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3loopBody1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 4440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 39231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 45964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -39266,20 +45999,20 @@ class SubmitParallelRestoreActorState { int a_body1cont3loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 4447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(numTries > 50 ? SevError : SevInfo, "FastRestoreToolSubmitRestoreRequestsMayFail") .error(e) .detail("Reason", "DB is not properly locked") .detail("ExpectedLockID", randomUID); - #line 4451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" numTries++; - #line 4452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = tr->onError(e); - #line 4452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 39277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1Catch1when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 4452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 39282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -39292,16 +46025,16 @@ class SubmitParallelRestoreActorState { } int a_body1cont3loopBody1cont2(int loopDepth) { - #line 4442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = checkDatabaseLock(tr, randomUID); - #line 4442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 39299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont3loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont3loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 39304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -39383,18 +46116,18 @@ class SubmitParallelRestoreActorState { } int a_body1cont3loopBody1cont4(Void const& _,int loopDepth) { - #line 4444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreToolSubmitRestoreRequests").detail("DBIsLocked", randomUID); - #line 39388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" return a_body1cont3break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1cont3loopBody1cont4(Void && _,int loopDepth) { - #line 4444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreToolSubmitRestoreRequests").detail("DBIsLocked", randomUID); - #line 39397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" return a_body1cont3break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -39539,9 +46272,9 @@ class SubmitParallelRestoreActorState { } int a_body1cont7(int loopDepth) { - #line 4491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SubmitParallelRestoreActorState(); static_cast(this)->destroy(); return 0; } - #line 39544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SubmitParallelRestoreActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -39558,36 +46291,36 @@ class SubmitParallelRestoreActorState { } int a_body1cont5loopBody1(int loopDepth) { - #line 4460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 39565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" try { - #line 4464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(restoreIndex = 0;restoreIndex < backupRanges.size();restoreIndex++) { - #line 4465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" auto range = backupRanges[restoreIndex]; - #line 4466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone restoreTag(backupTag.toString() + "_" + std::to_string(restoreIndex)); - #line 4468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" struct RestoreRequest restoreRequest(restoreIndex, restoreTag, bcUrl, proxy, targetVersion, range, deterministicRandom()->randomUniqueID(), addPrefix, removePrefix); - #line 4477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->set(restoreRequestKeyFor(restoreRequest.index), restoreRequestValue(restoreRequest)); - #line 39577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->set(restoreRequestTriggerKey, restoreRequestTriggerValue(deterministicRandom()->randomUniqueID(), backupRanges.size())); - #line 4481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_6 = tr->commit(); - #line 4481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont5loopBody1Catch1(actor_cancelled(), loopDepth); - #line 39585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont5loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont5loopBody1when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 4481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 39590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -39620,20 +46353,20 @@ class SubmitParallelRestoreActorState { int a_body1cont5loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 4484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(numTries > 50 ? SevError : SevInfo, "FastRestoreToolSubmitRestoreRequestsRetry") .error(e) .detail("RestoreIndex", restoreIndex); - #line 4487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" numTries++; - #line 4488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_7 = tr->onError(e); - #line 4488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 39631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), std::max(0, loopDepth - 1)); else return a_body1cont5loopBody1Catch1when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 4488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 39636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -39794,42 +46527,42 @@ class SubmitParallelRestoreActorState { fdb_probe_actor_exit("submitParallelRestore", reinterpret_cast(this), 7); } - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key backupTag; - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> backupRanges; - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key bcUrl; - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional proxy; - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version targetVersion; - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" LockDB lockDB; - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UID randomUID; - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key addPrefix; - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key removePrefix; - #line 4410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference bc; - #line 4411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupDescription desc; - #line 4433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 4434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int restoreIndex; - #line 4435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int numTries; - #line 39827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via submitParallelRestore() - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class SubmitParallelRestoreActor final : public Actor, public ActorCallback< SubmitParallelRestoreActor, 0, BackupDescription >, public ActorCallback< SubmitParallelRestoreActor, 1, Void >, public ActorCallback< SubmitParallelRestoreActor, 2, Optional >, public ActorCallback< SubmitParallelRestoreActor, 3, Void >, public ActorCallback< SubmitParallelRestoreActor, 4, Void >, public ActorCallback< SubmitParallelRestoreActor, 5, Void >, public ActorCallback< SubmitParallelRestoreActor, 6, Void >, public ActorCallback< SubmitParallelRestoreActor, 7, Void >, public FastAllocated, public SubmitParallelRestoreActorState { - #line 39832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -39845,9 +46578,9 @@ friend struct ActorCallback< SubmitParallelRestoreActor, 4, Void >; friend struct ActorCallback< SubmitParallelRestoreActor, 5, Void >; friend struct ActorCallback< SubmitParallelRestoreActor, 6, Void >; friend struct ActorCallback< SubmitParallelRestoreActor, 7, Void >; - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" SubmitParallelRestoreActor(Database const& cx,Key const& backupTag,Standalone> const& backupRanges,Key const& bcUrl,Optional const& proxy,Version const& targetVersion,LockDB const& lockDB,UID const& randomUID,Key const& addPrefix,Key const& removePrefix) - #line 39850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), SubmitParallelRestoreActorState(cx, backupTag, backupRanges, bcUrl, proxy, targetVersion, lockDB, randomUID, addPrefix, removePrefix) { @@ -39877,45 +46610,45 @@ friend struct ActorCallback< SubmitParallelRestoreActor, 7, Void >; } }; - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future submitParallelRestore( Database const& cx, Key const& backupTag, Standalone> const& backupRanges, Key const& bcUrl, Optional const& proxy, Version const& targetVersion, LockDB const& lockDB, UID const& randomUID, Key const& addPrefix, Key const& removePrefix ) { - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new SubmitParallelRestoreActor(cx, backupTag, backupRanges, bcUrl, proxy, targetVersion, lockDB, randomUID, addPrefix, removePrefix)); - #line 39884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 5237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" // This method will return the final status of the backup at tag, and return the URL that was used on the tag // when that status value was read. - #line 39891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via waitBackup() - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class WaitBackupActorState { - #line 39897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" WaitBackupActorState(FileBackupAgent* const& backupAgent,Database const& cx,std::string const& tagName,StopWhenDone const& stopWhenDone,Reference* const& pContainer = nullptr,UID* const& pUID = nullptr) - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" cx(cx), - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tagName(tagName), - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" stopWhenDone(stopWhenDone), - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" pContainer(pContainer), - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" pUID(pUID), - #line 4502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backTrace(), - #line 4503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tag(makeBackupTag(tagName)) - #line 39918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("waitBackup", reinterpret_cast(this)); @@ -39928,9 +46661,9 @@ class WaitBackupActorState { int a_body1(int loopDepth=0) { try { - #line 4505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 39933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -39958,24 +46691,24 @@ class WaitBackupActorState { } int a_body1loopBody1(int loopDepth) { - #line 4506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 4507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 39967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" try { - #line 4511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_0 = tag.get(tr); - #line 4511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 39973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 4511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 39978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -39995,16 +46728,16 @@ class WaitBackupActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 4543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = tr->onError(e); - #line 4543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 40002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 4543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 40007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -40017,39 +46750,39 @@ class WaitBackupActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 4512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!oldUidAndAborted.present()) - #line 40022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(EBackupState::STATE_NEVERRAN); this->~WaitBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 40026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< EBackupState >::value()) EBackupState(EBackupState::STATE_NEVERRAN); this->~WaitBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config = BackupConfig(oldUidAndAborted.get().first); - #line 4517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = config.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); - #line 4517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 40038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 40043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1when1(Optional const& __oldUidAndAborted,int loopDepth) { - #line 4511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" oldUidAndAborted = __oldUidAndAborted; - #line 40052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; @@ -40114,24 +46847,24 @@ class WaitBackupActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 4523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!FileBackupAgent::isRunnable(status) || ((!stopWhenDone) && (EBackupState::STATE_RUNNING_DIFFERENTIAL == status))) - #line 40119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (pContainer != nullptr) - #line 40123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_2 = config.backupContainer().getOrThrow(tr, Snapshot::False, backup_invalid_info()); - #line 4527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 40129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 40134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -40148,9 +46881,9 @@ class WaitBackupActorState { } int a_body1loopBody1cont2when1(EBackupState const& __status,int loopDepth) { - #line 4517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" status = __status; - #line 40153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; @@ -40215,35 +46948,35 @@ class WaitBackupActorState { } int a_body1loopBody1cont5(int loopDepth) { - #line 4539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" watchFuture = tr->watch(config.stateEnum().key); - #line 4540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = tr->commit(); - #line 4540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 40224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 4540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 40229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont6(int loopDepth) { - #line 4532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (pUID != nullptr) - #line 40238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" *pUID = oldUidAndAborted.get().first; - #line 40242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(status); this->~WaitBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 40246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< EBackupState >::value()) EBackupState(std::move(status)); // state_var_RVO this->~WaitBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -40253,18 +46986,18 @@ class WaitBackupActorState { } int a_body1loopBody1cont7(Reference const& c,int loopDepth) { - #line 4529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" *pContainer = fileBackup::getBackupContainerWithProxy(c); - #line 40258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 46991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; } int a_body1loopBody1cont7(Reference && c,int loopDepth) { - #line 4529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" *pContainer = fileBackup::getBackupContainerWithProxy(c); - #line 40267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; @@ -40334,32 +47067,32 @@ class WaitBackupActorState { } int a_body1loopBody1cont11(Void const& _,int loopDepth) { - #line 4541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = watchFuture; - #line 4541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 40341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont11when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 40346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont11(Void && _,int loopDepth) { - #line 4541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = watchFuture; - #line 4541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 40357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont11when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 40362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -40590,38 +47323,38 @@ class WaitBackupActorState { fdb_probe_actor_exit("waitBackup", reinterpret_cast(this), 5); } - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" FileBackupAgent* backupAgent; - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::string tagName; - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StopWhenDone stopWhenDone; - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference* pContainer; - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UID* pUID; - #line 4502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::string backTrace; - #line 4503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyBackedTag tag; - #line 4506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 4511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional oldUidAndAborted; - #line 4516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig config; - #line 4517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" EBackupState status; - #line 4539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future watchFuture; - #line 40619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via waitBackup() - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class WaitBackupActor final : public Actor, public ActorCallback< WaitBackupActor, 0, Optional >, public ActorCallback< WaitBackupActor, 1, EBackupState >, public ActorCallback< WaitBackupActor, 2, Reference >, public ActorCallback< WaitBackupActor, 3, Void >, public ActorCallback< WaitBackupActor, 4, Void >, public ActorCallback< WaitBackupActor, 5, Void >, public FastAllocated, public WaitBackupActorState { - #line 40624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -40635,9 +47368,9 @@ friend struct ActorCallback< WaitBackupActor, 2, Reference >; friend struct ActorCallback< WaitBackupActor, 3, Void >; friend struct ActorCallback< WaitBackupActor, 4, Void >; friend struct ActorCallback< WaitBackupActor, 5, Void >; - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" WaitBackupActor(FileBackupAgent* const& backupAgent,Database const& cx,std::string const& tagName,StopWhenDone const& stopWhenDone,Reference* const& pContainer = nullptr,UID* const& pUID = nullptr) - #line 40640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), WaitBackupActorState(backupAgent, cx, tagName, stopWhenDone, pContainer, pUID) { @@ -40665,52 +47398,54 @@ friend struct ActorCallback< WaitBackupActor, 5, Void >; } }; - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future waitBackup( FileBackupAgent* const& backupAgent, Database const& cx, std::string const& tagName, StopWhenDone const& stopWhenDone, Reference* const& pContainer = nullptr, UID* const& pUID = nullptr ) { - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new WaitBackupActor(backupAgent, cx, tagName, stopWhenDone, pContainer, pUID)); - #line 40672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 5291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" // TODO: Get rid of all of these confusing boolean flags - #line 40678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via submitBackup() - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class SubmitBackupActorState { - #line 40684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - SubmitBackupActorState(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& outContainer,Optional const& proxy,int const& initialSnapshotIntervalSeconds,int const& snapshotIntervalSeconds,std::string const& tagName,Standalone> const& backupRanges,StopWhenDone const& stopWhenDone,UsePartitionedLog const& partitionedLog,IncrementalBackupOnly const& incrementalBackupOnly,Optional const& encryptionKeyFileName) - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + SubmitBackupActorState(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& outContainer,Optional const& proxy,int const& initialSnapshotIntervalSeconds,int const& snapshotIntervalSeconds,std::string const& tagName,Standalone> const& backupRanges,bool const& encryptionEnabled,StopWhenDone const& stopWhenDone,UsePartitionedLog const& partitionedLog,IncrementalBackupOnly const& incrementalBackupOnly,Optional const& encryptionKeyFileName) + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr(tr), - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" outContainer(outContainer), - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" proxy(proxy), - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" initialSnapshotIntervalSeconds(initialSnapshotIntervalSeconds), - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" snapshotIntervalSeconds(snapshotIntervalSeconds), - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tagName(tagName), - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupRanges(backupRanges), - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptionEnabled(encryptionEnabled), + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" stopWhenDone(stopWhenDone), - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" partitionedLog(partitionedLog), - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" incrementalBackupOnly(incrementalBackupOnly), - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" encryptionKeyFileName(encryptionKeyFileName) - #line 40713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("submitBackup", reinterpret_cast(this)); @@ -40723,26 +47458,26 @@ class SubmitBackupActorState { int a_body1(int loopDepth=0) { try { - #line 4561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); - #line 4565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevInfo, "FBA_SubmitBackup") .detail("TagName", tagName.c_str()) .detail("StopWhenDone", stopWhenDone) .detail("UsePartitionedLog", partitionedLog) .detail("OutContainer", outContainer.toString()); - #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tag = makeBackupTag(tagName); - #line 4572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_0 = tag.get(tr); - #line 4572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 40740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 4572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 40745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -40763,22 +47498,22 @@ class SubmitBackupActorState { } int a_body1cont1(Optional const& uidAndAbortedFlag,int loopDepth) { - #line 4573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (uidAndAbortedFlag.present()) - #line 40768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" prevConfig = BackupConfig(uidAndAbortedFlag.get().first); - #line 4575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = prevConfig.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); - #line 4575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 40776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 40781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -40790,22 +47525,22 @@ class SubmitBackupActorState { } int a_body1cont1(Optional && uidAndAbortedFlag,int loopDepth) { - #line 4573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (uidAndAbortedFlag.present()) - #line 40795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" prevConfig = BackupConfig(uidAndAbortedFlag.get().first); - #line 4575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = prevConfig.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); - #line 4575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 40803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 40808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -40880,36 +47615,36 @@ class SubmitBackupActorState { } int a_body1cont2(int loopDepth) { - #line 4585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config = BackupConfig(deterministicRandom()->randomUniqueID()); - #line 4586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" uid = config.getUid(); - #line 4589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" nowStr = BackupAgentBase::getCurrentTime(); - #line 4590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupContainer = outContainer.toString(); - #line 4594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (backupContainer.find("file://") == 0) - #line 40893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupContainer = joinPath(backupContainer, std::string("backup-") + nowStr.toString()); - #line 40897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bc = IBackupContainer::openContainer(backupContainer, proxy, encryptionKeyFileName); - #line 40901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" try { - #line 4601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = timeoutError(bc->create(), 30); - #line 4601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont2Catch1(actor_cancelled(), loopDepth); - #line 40907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont2Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 40912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -40922,26 +47657,26 @@ class SubmitBackupActorState { } int a_body1cont3(int loopDepth) { - #line 4577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (FileBackupAgent::isRunnable(prevBackupStatus)) - #line 40927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(backup_duplicate(), loopDepth); - #line 40931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" prevConfig.clear(tr); - #line 40935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; } int a_body1cont1when1(EBackupState const& __prevBackupStatus,int loopDepth) { - #line 4575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" prevBackupStatus = __prevBackupStatus; - #line 40944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; @@ -41006,16 +47741,16 @@ class SubmitBackupActorState { } int a_body1cont6(int loopDepth) { - #line 4609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_3 = backupAgent->lastBackupTimestamp().get(tr); - #line 4609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 41013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 4609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 41018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -41023,19 +47758,19 @@ class SubmitBackupActorState { int a_body1cont2Catch1(const Error& e,int loopDepth=0) { try { - #line 4603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (e.code() == error_code_actor_cancelled) - #line 41028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 41032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" fprintf(stderr, "ERROR: Could not create backup container: %s\n", e.what()); - #line 4606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(backup_error(), loopDepth); - #line 41038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -41135,57 +47870,57 @@ class SubmitBackupActorState { } int a_body1cont10(Optional const& lastBackupTimestamp,int loopDepth) { - #line 4611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if ((lastBackupTimestamp.present()) && (lastBackupTimestamp.get() >= nowStr)) - #line 41140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" fprintf(stderr, "ERROR: The last backup `%s' happened in the future.\n", printable(lastBackupTimestamp.get()).c_str()); - #line 4615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(backup_error(), loopDepth); - #line 41146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyRangeMap backupRangeSet; - #line 4619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& backupRange : backupRanges ) { - #line 4620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupRangeSet.insert(backupRange, 1); - #line 41154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupRangeSet.coalesce(allKeys); - #line 4624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" normalizedRanges = std::vector(); - #line 4626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& backupRange : backupRangeSet.ranges() ) { - #line 4627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (backupRange.value()) - #line 41164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" normalizedRanges.push_back(KeyRange(KeyRangeRef(backupRange.range().begin, backupRange.range().end))); - #line 41168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } } - #line 4632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.clear(tr); - #line 4634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" destUidValue = Key(BinaryWriter::toValue(uid, Unversioned())); - #line 4635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (normalizedRanges.size() == 1) - #line 41177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (normalizedRanges.size() == 1 || isDefaultBackup(normalizedRanges)) + #line 47912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = tr->getRange(KeyRangeRef(destUidLookupPrefix, strinc(destUidLookupPrefix)), CLIENT_KNOBS->TOO_MANY); - #line 4636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 41183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont10when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 41188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -41197,57 +47932,57 @@ class SubmitBackupActorState { } int a_body1cont10(Optional && lastBackupTimestamp,int loopDepth) { - #line 4611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if ((lastBackupTimestamp.present()) && (lastBackupTimestamp.get() >= nowStr)) - #line 41202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" fprintf(stderr, "ERROR: The last backup `%s' happened in the future.\n", printable(lastBackupTimestamp.get()).c_str()); - #line 4615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(backup_error(), loopDepth); - #line 41208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyRangeMap backupRangeSet; - #line 4619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& backupRange : backupRanges ) { - #line 4620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupRangeSet.insert(backupRange, 1); - #line 41216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupRangeSet.coalesce(allKeys); - #line 4624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" normalizedRanges = std::vector(); - #line 4626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& backupRange : backupRangeSet.ranges() ) { - #line 4627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (backupRange.value()) - #line 41226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" normalizedRanges.push_back(KeyRange(KeyRangeRef(backupRange.range().begin, backupRange.range().end))); - #line 41230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } } - #line 4632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.clear(tr); - #line 4634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" destUidValue = Key(BinaryWriter::toValue(uid, Unversioned())); - #line 4635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (normalizedRanges.size() == 1) - #line 41239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (normalizedRanges.size() == 1 || isDefaultBackup(normalizedRanges)) + #line 47974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = tr->getRange(KeyRangeRef(destUidLookupPrefix, strinc(destUidLookupPrefix)), CLIENT_KNOBS->TOO_MANY); - #line 4636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 41245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont10when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 41250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 47985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -41322,73 +48057,81 @@ class SubmitBackupActorState { } int a_body1cont10cont1(int loopDepth) { - #line 4656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->set(config.getUidAsKey().withPrefix(destUidValue).withPrefix(backupLatestVersionsPrefix), BinaryWriter::toValue(tr->getReadVersion().get(), Unversioned())); - #line 4658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.destUidValue().set(tr, destUidValue); - #line 4661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tag.set(tr, { uid, false }); - #line 4663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupAgent->lastBackupTimestamp().set(tr, nowStr); - #line 4666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.tag().set(tr, tagName); - #line 4667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.stateEnum().set(tr, EBackupState::STATE_SUBMITTED); - #line 4668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.backupContainer().set(tr, bc); - #line 4669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.stopWhenDone().set(tr, stopWhenDone); - #line 4670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.backupRanges().set(tr, normalizedRanges); - #line 4671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.initialSnapshotIntervalSeconds().set(tr, initialSnapshotIntervalSeconds); - #line 4672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.snapshotIntervalSeconds().set(tr, snapshotIntervalSeconds); - #line 4673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.partitionedLogEnabled().set(tr, partitionedLog); - #line 4674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" config.incrementalBackupOnly().set(tr, incrementalBackupOnly); - #line 4676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config.enableSnapshotBackupEncryption().set(tr, encryptionEnabled); + #line 5426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = fileBackup::StartFullBackupTaskFunc::addTask( tr, backupAgent->taskBucket, uid, TaskCompletionKey::noSignal()); - #line 4676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 41355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont10cont1when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 4676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 41360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont10cont6(RangeResult const& existingDestUidValues,int loopDepth) { - #line 4638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bool found = false; - #line 4639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRangeRef targetRange = normalizedRanges.size() == 1 ? normalizedRanges[0] : getDefaultBackupSharedRange(); + #line 5386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto it : existingDestUidValues ) { - #line 4640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (BinaryReader::fromStringRef(it.key.removePrefix(destUidLookupPrefix), IncludeVersion()) == normalizedRanges[0]) - #line 41373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRange uidRange = BinaryReader::fromStringRef(it.key.removePrefix(destUidLookupPrefix), IncludeVersion()); + #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (uidRange == targetRange) + #line 48114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" destUidValue = it.value; - #line 4643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" found = true; - #line 41379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CODE_PROBE(targetRange == getDefaultBackupSharedRange(), "Backup mutation sharing with default backup"); + #line 48122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" break; } } - #line 4647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!found) - #line 41385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" destUidValue = BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned()); - #line 4649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->set( BinaryWriter::toValue(normalizedRanges[0], IncludeVersion(ProtocolVersion::withSharedMutations())) .withPrefix(destUidLookupPrefix), destUidValue); - #line 41391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->set(BinaryWriter::toValue(targetRange, IncludeVersion(ProtocolVersion::withSharedMutations())) .withPrefix(destUidLookupPrefix), destUidValue); + #line 48134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } loopDepth = a_body1cont10cont1(loopDepth); @@ -41396,31 +48139,37 @@ class SubmitBackupActorState { } int a_body1cont10cont6(RangeResult && existingDestUidValues,int loopDepth) { - #line 4638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bool found = false; - #line 4639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRangeRef targetRange = normalizedRanges.size() == 1 ? normalizedRanges[0] : getDefaultBackupSharedRange(); + #line 5386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto it : existingDestUidValues ) { - #line 4640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (BinaryReader::fromStringRef(it.key.removePrefix(destUidLookupPrefix), IncludeVersion()) == normalizedRanges[0]) - #line 41405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRange uidRange = BinaryReader::fromStringRef(it.key.removePrefix(destUidLookupPrefix), IncludeVersion()); + #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (uidRange == targetRange) + #line 48152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" destUidValue = it.value; - #line 4643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" found = true; - #line 41411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + CODE_PROBE(targetRange == getDefaultBackupSharedRange(), "Backup mutation sharing with default backup"); + #line 48160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" break; } } - #line 4647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!found) - #line 41417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" destUidValue = BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned()); - #line 4649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->set( BinaryWriter::toValue(normalizedRanges[0], IncludeVersion(ProtocolVersion::withSharedMutations())) .withPrefix(destUidLookupPrefix), destUidValue); - #line 41423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->set(BinaryWriter::toValue(targetRange, IncludeVersion(ProtocolVersion::withSharedMutations())) .withPrefix(destUidLookupPrefix), destUidValue); + #line 48172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } loopDepth = a_body1cont10cont1(loopDepth); @@ -41491,9 +48240,9 @@ class SubmitBackupActorState { } int a_body1cont10cont11(Key const& taskKey,int loopDepth) { - #line 4679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SubmitBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 41496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SubmitBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -41503,9 +48252,9 @@ class SubmitBackupActorState { } int a_body1cont10cont11(Key && taskKey,int loopDepth) { - #line 4679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SubmitBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 41508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SubmitBackupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -41576,56 +48325,58 @@ class SubmitBackupActorState { fdb_probe_actor_exit("submitBackup", reinterpret_cast(this), 5); } - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" FileBackupAgent* backupAgent; - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key outContainer; - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional proxy; - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int initialSnapshotIntervalSeconds; - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int snapshotIntervalSeconds; - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::string tagName; - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> backupRanges; - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool encryptionEnabled; + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StopWhenDone stopWhenDone; - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UsePartitionedLog partitionedLog; - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" IncrementalBackupOnly incrementalBackupOnly; - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional encryptionKeyFileName; - #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyBackedTag tag; - #line 4574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig prevConfig; - #line 4575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" EBackupState prevBackupStatus; - #line 4585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig config; - #line 4586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UID uid; - #line 4589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone nowStr; - #line 4590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::string backupContainer; - #line 4598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference bc; - #line 4624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector normalizedRanges; - #line 4634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key destUidValue; - #line 41623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via submitBackup() - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class SubmitBackupActor final : public Actor, public ActorCallback< SubmitBackupActor, 0, Optional >, public ActorCallback< SubmitBackupActor, 1, EBackupState >, public ActorCallback< SubmitBackupActor, 2, Void >, public ActorCallback< SubmitBackupActor, 3, Optional >, public ActorCallback< SubmitBackupActor, 4, RangeResult >, public ActorCallback< SubmitBackupActor, 5, Key >, public FastAllocated, public SubmitBackupActorState { - #line 41628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -41639,11 +48390,11 @@ friend struct ActorCallback< SubmitBackupActor, 2, Void >; friend struct ActorCallback< SubmitBackupActor, 3, Optional >; friend struct ActorCallback< SubmitBackupActor, 4, RangeResult >; friend struct ActorCallback< SubmitBackupActor, 5, Key >; - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - SubmitBackupActor(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& outContainer,Optional const& proxy,int const& initialSnapshotIntervalSeconds,int const& snapshotIntervalSeconds,std::string const& tagName,Standalone> const& backupRanges,StopWhenDone const& stopWhenDone,UsePartitionedLog const& partitionedLog,IncrementalBackupOnly const& incrementalBackupOnly,Optional const& encryptionKeyFileName) - #line 41644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + SubmitBackupActor(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& outContainer,Optional const& proxy,int const& initialSnapshotIntervalSeconds,int const& snapshotIntervalSeconds,std::string const& tagName,Standalone> const& backupRanges,bool const& encryptionEnabled,StopWhenDone const& stopWhenDone,UsePartitionedLog const& partitionedLog,IncrementalBackupOnly const& incrementalBackupOnly,Optional const& encryptionKeyFileName) + #line 48395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), - SubmitBackupActorState(backupAgent, tr, outContainer, proxy, initialSnapshotIntervalSeconds, snapshotIntervalSeconds, tagName, backupRanges, stopWhenDone, partitionedLog, incrementalBackupOnly, encryptionKeyFileName) + SubmitBackupActorState(backupAgent, tr, outContainer, proxy, initialSnapshotIntervalSeconds, snapshotIntervalSeconds, tagName, backupRanges, encryptionEnabled, stopWhenDone, partitionedLog, incrementalBackupOnly, encryptionKeyFileName) { fdb_probe_actor_enter("submitBackup", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -41669,55 +48420,57 @@ friend struct ActorCallback< SubmitBackupActor, 5, Key >; } }; - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future submitBackup( FileBackupAgent* const& backupAgent, Reference const& tr, Key const& outContainer, Optional const& proxy, int const& initialSnapshotIntervalSeconds, int const& snapshotIntervalSeconds, std::string const& tagName, Standalone> const& backupRanges, StopWhenDone const& stopWhenDone, UsePartitionedLog const& partitionedLog, IncrementalBackupOnly const& incrementalBackupOnly, Optional const& encryptionKeyFileName ) { - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new SubmitBackupActor(backupAgent, tr, outContainer, proxy, initialSnapshotIntervalSeconds, snapshotIntervalSeconds, tagName, backupRanges, stopWhenDone, partitionedLog, incrementalBackupOnly, encryptionKeyFileName)); - #line 41676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future submitBackup( FileBackupAgent* const& backupAgent, Reference const& tr, Key const& outContainer, Optional const& proxy, int const& initialSnapshotIntervalSeconds, int const& snapshotIntervalSeconds, std::string const& tagName, Standalone> const& backupRanges, bool const& encryptionEnabled, StopWhenDone const& stopWhenDone, UsePartitionedLog const& partitionedLog, IncrementalBackupOnly const& incrementalBackupOnly, Optional const& encryptionKeyFileName ) { + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new SubmitBackupActor(backupAgent, tr, outContainer, proxy, initialSnapshotIntervalSeconds, snapshotIntervalSeconds, tagName, backupRanges, encryptionEnabled, stopWhenDone, partitionedLog, incrementalBackupOnly, encryptionKeyFileName)); + #line 48427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 5431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 41681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via submitRestore() - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class SubmitRestoreActorState { - #line 41687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - SubmitRestoreActorState(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName,Key const& backupURL,Optional const& proxy,Standalone> const& ranges,Version const& restoreVersion,Key const& addPrefix,Key const& removePrefix,LockDB const& lockDB,OnlyApplyMutationLogs const& onlyApplyMutationLogs,InconsistentSnapshotOnly const& inconsistentSnapshotOnly,Version const& beginVersion,UID const& uid) - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + SubmitRestoreActorState(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName,Key const& backupURL,Optional const& proxy,Standalone> const& ranges,Version const& restoreVersion,Key const& addPrefix,Key const& removePrefix,LockDB const& lockDB,UnlockDB const& unlockDB,OnlyApplyMutationLogs const& onlyApplyMutationLogs,InconsistentSnapshotOnly const& inconsistentSnapshotOnly,Version const& beginVersion,UID const& uid) + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr(tr), - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tagName(tagName), - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupURL(backupURL), - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" proxy(proxy), - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ranges(ranges), - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreVersion(restoreVersion), - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addPrefix(addPrefix), - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" removePrefix(removePrefix), - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" lockDB(lockDB), - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + unlockDB(unlockDB), + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" onlyApplyMutationLogs(onlyApplyMutationLogs), - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" inconsistentSnapshotOnly(inconsistentSnapshotOnly), - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" beginVersion(beginVersion), - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" uid(uid) - #line 41720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("submitRestore", reinterpret_cast(this)); @@ -41730,51 +48483,51 @@ class SubmitRestoreActorState { int a_body1(int loopDepth=0) { try { - #line 4696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyRangeMap restoreRangeSet; - #line 4697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& range : ranges ) { - #line 4698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreRangeSet.insert(range, 1); - #line 41739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreRangeSet.coalesce(allKeys); - #line 4701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreRanges = std::vector(); - #line 4702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& restoreRange : restoreRangeSet.ranges() ) { - #line 4703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (restoreRange.value()) - #line 41749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreRanges.push_back(KeyRange(KeyRangeRef(restoreRange.range().begin, restoreRange.range().end))); - #line 41753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } } - #line 4707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& restoreRange : restoreRanges ) { - #line 4708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(restoreRange.begin.startsWith(removePrefix) && restoreRange.end.startsWith(removePrefix)); - #line 41760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tag = makeRestoreTag(tagName.toString()); - #line 4716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_0 = tag.get(tr); - #line 4716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 41772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 4716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 41777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -41795,45 +48548,45 @@ class SubmitRestoreActorState { } int a_body1cont1(int loopDepth) { - #line 4717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (oldUidAndAborted.present()) - #line 41800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (oldUidAndAborted.get().first == uid) - #line 41804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (oldUidAndAborted.get().second) - #line 41808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(restore_duplicate_uid(), loopDepth); - #line 41812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 4722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SubmitRestoreActorState(); static_cast(this)->destroy(); return 0; } - #line 41818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SubmitRestoreActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 4726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" oldRestore = RestoreConfig(oldUidAndAborted.get().first); - #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = oldRestore.isRunnable(tr); - #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 41831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 41836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -41845,9 +48598,9 @@ class SubmitRestoreActorState { } int a_body1when1(Optional const& __oldUidAndAborted,int loopDepth) { - #line 4716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" oldUidAndAborted = __oldUidAndAborted; - #line 41850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -41912,45 +48665,54 @@ class SubmitRestoreActorState { } int a_body1cont6(int loopDepth) { - #line 4739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - index = int(); - #line 4740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - index = 0; - #line 41919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont6loopHead1(loopDepth); + #line 5490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!onlyApplyMutationLogs) + #line 48670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + index = int(); + #line 5492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + index = 0; + #line 48676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont6loopHead1(loopDepth); + } + else + { + loopDepth = a_body1cont13(loopDepth); + } return loopDepth; } int a_body1cont7(bool const& runnable,int loopDepth) { - #line 4731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (runnable) - #line 41928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(restore_duplicate_tag(), loopDepth); - #line 41932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" oldRestore.clear(tr); - #line 41936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont6(loopDepth); return loopDepth; } int a_body1cont7(bool && runnable,int loopDepth) { - #line 4731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (runnable) - #line 41945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(restore_duplicate_tag(), loopDepth); - #line 41949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" oldRestore.clear(tr); - #line 41953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont6(loopDepth); return loopDepth; @@ -42020,56 +48782,67 @@ class SubmitRestoreActorState { } int a_body1cont13(int loopDepth) { - #line 4750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore = RestoreConfig(uid); - #line 4753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tag.set(tr, { uid, false }); - #line 4755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference bc = IBackupContainer::openContainer(backupURL.toString(), proxy, {}); - #line 4758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.tag().set(tr, tagName.toString()); - #line 4759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.sourceContainer().set(tr, bc); - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.stateEnum().set(tr, ERestoreState::QUEUED); - #line 4761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.restoreVersion().set(tr, restoreVersion); - #line 4762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.onlyApplyMutationLogs().set(tr, onlyApplyMutationLogs); - #line 4763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.inconsistentSnapshotOnly().set(tr, inconsistentSnapshotOnly); - #line 4764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.beginVersion().set(tr, beginVersion); - #line 4765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + restore.unlockDBAfterRestore().set(tr, unlockDB); + #line 5519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (BUGGIFY && restoreRanges.size() == 1) - #line 42045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore.restoreRange().set(tr, restoreRanges[0]); - #line 42049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - #line 4768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - restore.restoreRanges().set(tr, restoreRanges); - #line 42055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto& range : restoreRanges ) { + #line 5523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + restore.restoreRangeSet().insert(tr, range); + #line 48821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } } - #line 4771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - restore.initApplyMutations(tr, addPrefix, removePrefix); - #line 4773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + restore.initApplyMutations(tr, addPrefix, removePrefix, onlyApplyMutationLogs); + #line 5530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = fileBackup::StartFullRestoreTaskFunc::addTask( tr, backupAgent->taskBucket, uid, TaskCompletionKey::noSignal()); - #line 4773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 42063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont13when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 4773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } + int a_body1cont14(int loopDepth) + { + loopDepth = a_body1cont13(loopDepth); + + return loopDepth; + } int a_body1cont6loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; @@ -42079,24 +48852,24 @@ class SubmitRestoreActorState { } int a_body1cont6loopBody1(int loopDepth) { - #line 4740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!(index < restoreRanges.size())) - #line 42084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1cont6break1(loopDepth==0?0:loopDepth-1); // break } - #line 4741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyRange restoreIntoRange = KeyRangeRef(restoreRanges[index].begin, restoreRanges[index].end) .removePrefix(removePrefix) .withPrefix(addPrefix); - #line 4744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr->getRange(restoreIntoRange, 1); - #line 4744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 42094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont6loopBody1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -42104,7 +48877,7 @@ class SubmitRestoreActorState { int a_body1cont6break1(int loopDepth) { try { - return a_body1cont13(loopDepth); + return a_body1cont14(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -42116,34 +48889,34 @@ class SubmitRestoreActorState { } int a_body1cont6loopBody1cont1(RangeResult const& existingRows,int loopDepth) { - #line 4745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (existingRows.size() > 0 && !onlyApplyMutationLogs) - #line 42121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (existingRows.size() > 0) + #line 48894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(restore_destination_not_empty(), std::max(0, loopDepth - 1)); - #line 42125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" index++; - #line 42129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont6loopHead1(0); return loopDepth; } int a_body1cont6loopBody1cont1(RangeResult && existingRows,int loopDepth) { - #line 4745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (existingRows.size() > 0 && !onlyApplyMutationLogs) - #line 42138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (existingRows.size() > 0) + #line 48911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(restore_destination_not_empty(), std::max(0, loopDepth - 1)); - #line 42142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" index++; - #line 42146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1cont6loopHead1(0); return loopDepth; @@ -42213,34 +48986,34 @@ class SubmitRestoreActorState { } int a_body1cont13cont1(Key const& taskKey,int loopDepth) { - #line 4776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (lockDB) - #line 42218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = lockDatabase(tr, uid); - #line 4777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 42224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 48997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont13cont1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = checkDatabaseLock(tr, uid); - #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 42238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont13cont1when2(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -42248,34 +49021,34 @@ class SubmitRestoreActorState { } int a_body1cont13cont1(Key && taskKey,int loopDepth) { - #line 4776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (lockDB) - #line 42253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = lockDatabase(tr, uid); - #line 4777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 42259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont13cont1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = checkDatabaseLock(tr, uid); - #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 42273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont13cont1when2(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -42344,11 +49117,11 @@ class SubmitRestoreActorState { fdb_probe_actor_exit("submitRestore", reinterpret_cast(this), 3); } - int a_body1cont13cont4(int loopDepth) + int a_body1cont13cont5(int loopDepth) { - #line 4781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SubmitRestoreActorState(); static_cast(this)->destroy(); return 0; } - #line 42351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SubmitRestoreActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -42356,27 +49129,27 @@ class SubmitRestoreActorState { return loopDepth; } - int a_body1cont13cont5(Void const& _,int loopDepth) + int a_body1cont13cont6(Void const& _,int loopDepth) { - loopDepth = a_body1cont13cont4(loopDepth); + loopDepth = a_body1cont13cont5(loopDepth); return loopDepth; } - int a_body1cont13cont5(Void && _,int loopDepth) + int a_body1cont13cont6(Void && _,int loopDepth) { - loopDepth = a_body1cont13cont4(loopDepth); + loopDepth = a_body1cont13cont5(loopDepth); return loopDepth; } int a_body1cont13cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont13cont5(_, loopDepth); + loopDepth = a_body1cont13cont6(_, loopDepth); return loopDepth; } int a_body1cont13cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont13cont5(std::move(_), loopDepth); + loopDepth = a_body1cont13cont6(std::move(_), loopDepth); return loopDepth; } @@ -42431,27 +49204,27 @@ class SubmitRestoreActorState { fdb_probe_actor_exit("submitRestore", reinterpret_cast(this), 4); } - int a_body1cont13cont6(Void const& _,int loopDepth) + int a_body1cont13cont7(Void const& _,int loopDepth) { - loopDepth = a_body1cont13cont4(loopDepth); + loopDepth = a_body1cont13cont5(loopDepth); return loopDepth; } - int a_body1cont13cont6(Void && _,int loopDepth) + int a_body1cont13cont7(Void && _,int loopDepth) { - loopDepth = a_body1cont13cont4(loopDepth); + loopDepth = a_body1cont13cont5(loopDepth); return loopDepth; } int a_body1cont13cont1when2(Void const& _,int loopDepth) { - loopDepth = a_body1cont13cont6(_, loopDepth); + loopDepth = a_body1cont13cont7(_, loopDepth); return loopDepth; } int a_body1cont13cont1when2(Void && _,int loopDepth) { - loopDepth = a_body1cont13cont6(std::move(_), loopDepth); + loopDepth = a_body1cont13cont7(std::move(_), loopDepth); return loopDepth; } @@ -42506,52 +49279,54 @@ class SubmitRestoreActorState { fdb_probe_actor_exit("submitRestore", reinterpret_cast(this), 5); } - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" FileBackupAgent* backupAgent; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key tagName; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key backupURL; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional proxy; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> ranges; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version restoreVersion; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key addPrefix; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key removePrefix; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" LockDB lockDB; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + UnlockDB unlockDB; + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" OnlyApplyMutationLogs onlyApplyMutationLogs; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" InconsistentSnapshotOnly inconsistentSnapshotOnly; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version beginVersion; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UID uid; - #line 4701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector restoreRanges; - #line 4715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyBackedTag tag; - #line 4716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Optional oldUidAndAborted; - #line 4726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig oldRestore; - #line 4739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int index; - #line 4750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig restore; - #line 42549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via submitRestore() - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class SubmitRestoreActor final : public Actor, public ActorCallback< SubmitRestoreActor, 0, Optional >, public ActorCallback< SubmitRestoreActor, 1, bool >, public ActorCallback< SubmitRestoreActor, 2, RangeResult >, public ActorCallback< SubmitRestoreActor, 3, Key >, public ActorCallback< SubmitRestoreActor, 4, Void >, public ActorCallback< SubmitRestoreActor, 5, Void >, public FastAllocated, public SubmitRestoreActorState { - #line 42554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -42565,11 +49340,11 @@ friend struct ActorCallback< SubmitRestoreActor, 2, RangeResult >; friend struct ActorCallback< SubmitRestoreActor, 3, Key >; friend struct ActorCallback< SubmitRestoreActor, 4, Void >; friend struct ActorCallback< SubmitRestoreActor, 5, Void >; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - SubmitRestoreActor(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName,Key const& backupURL,Optional const& proxy,Standalone> const& ranges,Version const& restoreVersion,Key const& addPrefix,Key const& removePrefix,LockDB const& lockDB,OnlyApplyMutationLogs const& onlyApplyMutationLogs,InconsistentSnapshotOnly const& inconsistentSnapshotOnly,Version const& beginVersion,UID const& uid) - #line 42570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + SubmitRestoreActor(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName,Key const& backupURL,Optional const& proxy,Standalone> const& ranges,Version const& restoreVersion,Key const& addPrefix,Key const& removePrefix,LockDB const& lockDB,UnlockDB const& unlockDB,OnlyApplyMutationLogs const& onlyApplyMutationLogs,InconsistentSnapshotOnly const& inconsistentSnapshotOnly,Version const& beginVersion,UID const& uid) + #line 49345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), - SubmitRestoreActorState(backupAgent, tr, tagName, backupURL, proxy, ranges, restoreVersion, addPrefix, removePrefix, lockDB, onlyApplyMutationLogs, inconsistentSnapshotOnly, beginVersion, uid) + SubmitRestoreActorState(backupAgent, tr, tagName, backupURL, proxy, ranges, restoreVersion, addPrefix, removePrefix, lockDB, unlockDB, onlyApplyMutationLogs, inconsistentSnapshotOnly, beginVersion, uid) { fdb_probe_actor_enter("submitRestore", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -42595,36 +49370,36 @@ friend struct ActorCallback< SubmitRestoreActor, 5, Void >; } }; - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future submitRestore( FileBackupAgent* const& backupAgent, Reference const& tr, Key const& tagName, Key const& backupURL, Optional const& proxy, Standalone> const& ranges, Version const& restoreVersion, Key const& addPrefix, Key const& removePrefix, LockDB const& lockDB, OnlyApplyMutationLogs const& onlyApplyMutationLogs, InconsistentSnapshotOnly const& inconsistentSnapshotOnly, Version const& beginVersion, UID const& uid ) { - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new SubmitRestoreActor(backupAgent, tr, tagName, backupURL, proxy, ranges, restoreVersion, addPrefix, removePrefix, lockDB, onlyApplyMutationLogs, inconsistentSnapshotOnly, beginVersion, uid)); - #line 42602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future submitRestore( FileBackupAgent* const& backupAgent, Reference const& tr, Key const& tagName, Key const& backupURL, Optional const& proxy, Standalone> const& ranges, Version const& restoreVersion, Key const& addPrefix, Key const& removePrefix, LockDB const& lockDB, UnlockDB const& unlockDB, OnlyApplyMutationLogs const& onlyApplyMutationLogs, InconsistentSnapshotOnly const& inconsistentSnapshotOnly, Version const& beginVersion, UID const& uid ) { + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new SubmitRestoreActor(backupAgent, tr, tagName, backupURL, proxy, ranges, restoreVersion, addPrefix, removePrefix, lockDB, unlockDB, onlyApplyMutationLogs, inconsistentSnapshotOnly, beginVersion, uid)); + #line 49377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 5540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" // This method will return the final status of the backup - #line 42608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via waitRestore() - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class WaitRestoreActorState { - #line 42614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" WaitRestoreActorState(Database const& cx,Key const& tagName,Verbose const& verbose) - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : cx(cx), - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tagName(tagName), - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" verbose(verbose), - #line 4786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" status() - #line 42627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("waitRestore", reinterpret_cast(this)); @@ -42637,9 +49412,9 @@ class WaitRestoreActorState { int a_body1(int loopDepth=0) { try { - #line 4787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 42642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -42660,9 +49435,9 @@ class WaitRestoreActorState { } int a_body1cont1(int loopDepth) { - #line 4831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(status); this->~WaitRestoreActorState(); static_cast(this)->destroy(); return 0; } - #line 42665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< ERestoreState >::value()) ERestoreState(std::move(status)); // state_var_RVO this->~WaitRestoreActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -42679,28 +49454,28 @@ class WaitRestoreActorState { } int a_body1loopBody1(int loopDepth) { - #line 4788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 42684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" try { - #line 4790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 4791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tag = makeRestoreTag(tagName.toString()); - #line 4795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture> __when_expr_0 = tag.get(tr); - #line 4795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 42698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 4795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 42703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -42733,16 +49508,16 @@ class WaitRestoreActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 4827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_7 = tr->onError(e); - #line 4827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 42740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 4827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -42755,42 +49530,42 @@ class WaitRestoreActorState { } int a_body1loopBody1cont2(Optional const& current,int loopDepth) { - #line 4796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!current.present()) - #line 42760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (verbose) - #line 42764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" printf("waitRestore: Tag: %s State: %s\n", tagName.toString().c_str(), FileBackupAgent::restoreStateText(ERestoreState::UNITIALIZED).toString().c_str()); - #line 42768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(ERestoreState::UNITIALIZED); this->~WaitRestoreActorState(); static_cast(this)->destroy(); return 0; } - #line 42772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< ERestoreState >::value()) ERestoreState(ERestoreState::UNITIALIZED); this->~WaitRestoreActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore = RestoreConfig(current.get().first); - #line 4806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (verbose) - #line 42782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = restore.getProgress(tr); - #line 4807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 42788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -42802,42 +49577,42 @@ class WaitRestoreActorState { } int a_body1loopBody1cont2(Optional && current,int loopDepth) { - #line 4796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!current.present()) - #line 42807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (verbose) - #line 42811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" printf("waitRestore: Tag: %s State: %s\n", tagName.toString().c_str(), FileBackupAgent::restoreStateText(ERestoreState::UNITIALIZED).toString().c_str()); - #line 42815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 4801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(ERestoreState::UNITIALIZED); this->~WaitRestoreActorState(); static_cast(this)->destroy(); return 0; } - #line 42819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< ERestoreState >::value()) ERestoreState(ERestoreState::UNITIALIZED); this->~WaitRestoreActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restore = RestoreConfig(current.get().first); - #line 4806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (verbose) - #line 42829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = restore.getProgress(tr); - #line 4807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 42835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else @@ -42912,34 +49687,34 @@ class WaitRestoreActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 4811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = restore.stateEnum().getD(tr); - #line 4811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 42919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont6(int loopDepth) { - #line 4808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" printf("%s\n", details.c_str()); - #line 42933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } int a_body1loopBody1cont2when1(std::string const& __details,int loopDepth) { - #line 4807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" details = __details; - #line 42942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; @@ -43004,36 +49779,36 @@ class WaitRestoreActorState { } int a_body1loopBody1cont8(ERestoreState const& status_,int loopDepth) { - #line 4812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" status = status_; - #line 4813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = restore.isRunnable(tr); - #line 4813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 43013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont8when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 4813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont8(ERestoreState && status_,int loopDepth) { - #line 4812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" status = status_; - #line 4813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = restore.isRunnable(tr); - #line 4813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 43031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont8when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 4813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -43103,33 +49878,33 @@ class WaitRestoreActorState { } int a_body1loopBody1cont9(int loopDepth) { - #line 4816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!runnable) - #line 43108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 4820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" watchFuture = tr->watch(restore.stateEnum().key); - #line 4821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = tr->commit(); - #line 4821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 43118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont9when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont8when1(bool const& __runnable,int loopDepth) { - #line 4813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" runnable = __runnable; - #line 43132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1cont9(loopDepth); return loopDepth; @@ -43194,34 +49969,34 @@ class WaitRestoreActorState { } int a_body1loopBody1cont10(Void const& _,int loopDepth) { - #line 4822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (verbose) - #line 43199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = watchFuture || delay(1); - #line 4823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 43205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont10when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 4823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 4825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_6 = watchFuture; - #line 4825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 43219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1loopBody1cont10when2(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 4825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 49999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -43229,34 +50004,34 @@ class WaitRestoreActorState { } int a_body1loopBody1cont10(Void && _,int loopDepth) { - #line 4822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (verbose) - #line 43234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 50009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = watchFuture || delay(1); - #line 4823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 43240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 50015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont10when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 4823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 50020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - #line 4825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_6 = watchFuture; - #line 4825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 43254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 50029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1loopBody1cont10when2(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 4825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 50034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } @@ -43569,32 +50344,32 @@ class WaitRestoreActorState { fdb_probe_actor_exit("waitRestore", reinterpret_cast(this), 7); } - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key tagName; - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Verbose verbose; - #line 4786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ERestoreState status; - #line 4788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 4794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyBackedTag tag; - #line 4804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" RestoreConfig restore; - #line 4807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::string details; - #line 4813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bool runnable; - #line 4820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Future watchFuture; - #line 43592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 50367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via waitRestore() - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class WaitRestoreActor final : public Actor, public ActorCallback< WaitRestoreActor, 0, Optional >, public ActorCallback< WaitRestoreActor, 1, std::string >, public ActorCallback< WaitRestoreActor, 2, ERestoreState >, public ActorCallback< WaitRestoreActor, 3, bool >, public ActorCallback< WaitRestoreActor, 4, Void >, public ActorCallback< WaitRestoreActor, 5, Void >, public ActorCallback< WaitRestoreActor, 6, Void >, public ActorCallback< WaitRestoreActor, 7, Void >, public FastAllocated, public WaitRestoreActorState { - #line 43597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 50372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -43610,9 +50385,9 @@ friend struct ActorCallback< WaitRestoreActor, 4, Void >; friend struct ActorCallback< WaitRestoreActor, 5, Void >; friend struct ActorCallback< WaitRestoreActor, 6, Void >; friend struct ActorCallback< WaitRestoreActor, 7, Void >; - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" WaitRestoreActor(Database const& cx,Key const& tagName,Verbose const& verbose) - #line 43615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 50390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), WaitRestoreActorState(cx, tagName, verbose) { @@ -43642,153 +50417,631 @@ friend struct ActorCallback< WaitRestoreActor, 7, Void >; } }; - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future waitRestore( Database const& cx, Key const& tagName, Verbose const& verbose ) { - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new WaitRestoreActor(cx, tagName, verbose)); - #line 43649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 50424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 43654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 50429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via discontinueBackup() - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class DiscontinueBackupActorState { - #line 43660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 50435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" DiscontinueBackupActorState(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName) - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr(tr), - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tagName(tagName) - #line 43671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 50446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("discontinueBackup", reinterpret_cast(this)); + + } + ~DiscontinueBackupActorState() + { + fdb_probe_actor_destroy("discontinueBackup", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 5594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 5595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 5597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tag = makeBackupTag(tagName.toString()); + #line 5598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = tag.getOrThrow(tr, Snapshot::False, backup_unneeded()); + #line 5598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 50469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 5598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~DiscontinueBackupActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 5599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config = BackupConfig(current.first); + #line 5600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = config.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); + #line 5600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 50501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 5600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(UidAndAbortedFlagT const& __current,int loopDepth) + { + #line 5598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + current = __current; + #line 50515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(UidAndAbortedFlagT && __current,int loopDepth) + { + current = std::move(__current); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DiscontinueBackupActor, 0, UidAndAbortedFlagT >::remove(); + + } + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 0, UidAndAbortedFlagT >*,UidAndAbortedFlagT const& value) + { + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 0, UidAndAbortedFlagT >*,UidAndAbortedFlagT && value) + { + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< DiscontinueBackupActor, 0, UidAndAbortedFlagT >*,Error err) + { + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 5602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!FileBackupAgent::isRunnable(status)) + #line 50582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(backup_unneeded(), loopDepth); + #line 50586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_2 = config.getLatestRestorableVersion(tr); + #line 5608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 50592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 5608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 50597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(EBackupState const& __status,int loopDepth) + { + #line 5600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + status = __status; + #line 50606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(EBackupState && __status,int loopDepth) + { + status = std::move(__status); + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DiscontinueBackupActor, 1, EBackupState >::remove(); + + } + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 1, EBackupState >*,EBackupState const& value) + { + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 1, EBackupState >*,EBackupState && value) + { + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< DiscontinueBackupActor, 1, EBackupState >*,Error err) + { + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 1); + + } + int a_body1cont3(int loopDepth) + { + #line 5610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevInfo, "FBA_DiscontinueBackup") .detail("AlreadyRestorable", latestRestorableVersion.present() ? "Yes" : "No") .detail("TagName", tag.tagName.c_str()) .detail("Status", BackupAgentBase::getStateText(status)); + #line 5615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (latestRestorableVersion.present()) + #line 50675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = tag.cancel(tr); + #line 5617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 50681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 5617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont5(loopDepth); + } + + return loopDepth; + } + int a_body1cont2when1(Optional const& __latestRestorableVersion,int loopDepth) + { + #line 5608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + latestRestorableVersion = __latestRestorableVersion; + #line 50700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Optional && __latestRestorableVersion,int loopDepth) + { + latestRestorableVersion = std::move(__latestRestorableVersion); + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DiscontinueBackupActor, 2, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 2, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 2, Optional >*,Optional && value) + { + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< DiscontinueBackupActor, 2, Optional >*,Error err) + { + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 2); + + } + int a_body1cont5(int loopDepth) + { + #line 5631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_7 = config.stopWhenDone().getOrThrow(tr); + #line 5631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 50769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont5when1(__when_expr_7.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 8; + #line 5631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont6(Void const& _,int loopDepth) + { + #line 5619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); + #line 5621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_4 = config.destUidValue().getOrThrow(tr); + #line 5621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 50787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 5621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont6(Void && _,int loopDepth) + { + #line 5619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); + #line 5621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_4 = config.destUidValue().getOrThrow(tr); + #line 5621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 50805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 5621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont6(_, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont6(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DiscontinueBackupActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< DiscontinueBackupActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 3); + + } + int a_body1cont7(int loopDepth) + { + #line 5622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_5 = success(tr->getReadVersion()); + #line 5622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 50884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont7when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 5622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont6when1(Key const& __destUidValue,int loopDepth) + { + #line 5621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + destUidValue = __destUidValue; + #line 50898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont7(loopDepth); + + return loopDepth; + } + int a_body1cont6when1(Key && __destUidValue,int loopDepth) { - fdb_probe_actor_create("discontinueBackup", reinterpret_cast(this)); + destUidValue = std::move(__destUidValue); + loopDepth = a_body1cont7(loopDepth); + return loopDepth; } - ~DiscontinueBackupActorState() + void a_exitChoose5() { - fdb_probe_actor_destroy("discontinueBackup", reinterpret_cast(this)); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DiscontinueBackupActor, 4, Key >::remove(); } - int a_body1(int loopDepth=0) + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 4, Key >*,Key const& value) { + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 4); + a_exitChoose5(); try { - #line 4837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tag = makeBackupTag(tagName.toString()); - #line 4841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = tag.getOrThrow(tr, Snapshot::False, backup_unneeded()); - #line 4841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 43694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 4841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + a_body1cont6when1(value, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 4); - return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 4, Key >*,Key && value) { - this->~DiscontinueBackupActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont6when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< DiscontinueBackupActor, 4, Key >*,Error err) + { + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 4); + + } + int a_body1cont8(Void const& _,int loopDepth) + { + #line 5623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_6 = eraseLogData(tr, config.getUidAsKey(), destUidValue) && fileBackup::clearBackupStartID(tr, config.getUid()); + #line 5623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 50967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont8when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 5623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1(int loopDepth) + int a_body1cont8(Void && _,int loopDepth) { - #line 4842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config = BackupConfig(current.first); - #line 4843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = config.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); - #line 4843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_6 = eraseLogData(tr, config.getUidAsKey(), destUidValue) && fileBackup::clearBackupStartID(tr, config.getUid()); + #line 5623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 43726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 4843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 50983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont8when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 5623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(UidAndAbortedFlagT const& __current,int loopDepth) + int a_body1cont7when1(Void const& _,int loopDepth) { - #line 4841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - current = __current; - #line 43740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); + loopDepth = a_body1cont8(_, loopDepth); return loopDepth; } - int a_body1when1(UidAndAbortedFlagT && __current,int loopDepth) + int a_body1cont7when1(Void && _,int loopDepth) { - current = std::move(__current); - loopDepth = a_body1cont1(loopDepth); + loopDepth = a_body1cont8(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose6() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DiscontinueBackupActor, 0, UidAndAbortedFlagT >::remove(); + static_cast(this)->ActorCallback< DiscontinueBackupActor, 5, Void >::remove(); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 0, UidAndAbortedFlagT >*,UidAndAbortedFlagT const& value) + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 5, Void >*,Void const& value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1when1(value, 0); + a_body1cont7when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 5); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 0, UidAndAbortedFlagT >*,UidAndAbortedFlagT && value) + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 5, Void >*,Void && value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1when1(std::move(value), 0); + a_body1cont7when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 5); } - void a_callback_error(ActorCallback< DiscontinueBackupActor, 0, UidAndAbortedFlagT >*,Error err) + void a_callback_error(ActorCallback< DiscontinueBackupActor, 5, Void >*,Error err) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 5); + a_exitChoose6(); try { a_body1Catch1(err, 0); } @@ -43797,89 +51050,89 @@ class DiscontinueBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 5); } - int a_body1cont2(int loopDepth) + int a_body1cont9(Void const& _,int loopDepth) { - #line 4845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!FileBackupAgent::isRunnable(status)) - #line 43807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 4846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(backup_unneeded(), loopDepth); - #line 43811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_2 = config.getLatestRestorableVersion(tr); - #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 43817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 43822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 5626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config.stateEnum().set(tr, EBackupState::STATE_COMPLETED); + #line 5628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DiscontinueBackupActorState(); static_cast(this)->destroy(); return 0; } + #line 51062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DiscontinueBackupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont1when1(EBackupState const& __status,int loopDepth) + int a_body1cont9(Void && _,int loopDepth) { - #line 4843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - status = __status; - #line 43831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont2(loopDepth); + #line 5626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config.stateEnum().set(tr, EBackupState::STATE_COMPLETED); + #line 5628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DiscontinueBackupActorState(); static_cast(this)->destroy(); return 0; } + #line 51076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DiscontinueBackupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont1when1(EBackupState && __status,int loopDepth) + int a_body1cont8when1(Void const& _,int loopDepth) { - status = std::move(__status); - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1cont9(_, loopDepth); return loopDepth; } - void a_exitChoose2() + int a_body1cont8when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont9(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose7() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DiscontinueBackupActor, 1, EBackupState >::remove(); + static_cast(this)->ActorCallback< DiscontinueBackupActor, 6, Void >::remove(); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 1, EBackupState >*,EBackupState const& value) + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 6, Void >*,Void const& value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 6); + a_exitChoose7(); try { - a_body1cont1when1(value, 0); + a_body1cont8when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 6); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 1, EBackupState >*,EBackupState && value) + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 6, Void >*,Void && value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 6); + a_exitChoose7(); try { - a_body1cont1when1(std::move(value), 0); + a_body1cont8when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 6); } - void a_callback_error(ActorCallback< DiscontinueBackupActor, 1, EBackupState >*,Error err) + void a_callback_error(ActorCallback< DiscontinueBackupActor, 6, Void >*,Error err) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 6); + a_exitChoose7(); try { a_body1Catch1(err, 0); } @@ -43888,92 +51141,87 @@ class DiscontinueBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 6); } - int a_body1cont3(int loopDepth) + int a_body1cont11(int loopDepth) { - #line 4853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevInfo, "FBA_DiscontinueBackup") .detail("AlreadyRestorable", latestRestorableVersion.present() ? "Yes" : "No") .detail("TagName", tag.tagName.c_str()) .detail("Status", BackupAgentBase::getStateText(status)); - #line 4858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (latestRestorableVersion.present()) - #line 43900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 4860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_3 = tag.cancel(tr); - #line 4860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 43906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 4860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else + #line 5633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (stopWhenDone) + #line 51151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - loopDepth = a_body1cont5(loopDepth); + #line 5634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(backup_duplicate(), loopDepth); + #line 51155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } + #line 5637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config.stopWhenDone().set(tr, true); + #line 5639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DiscontinueBackupActorState(); static_cast(this)->destroy(); return 0; } + #line 51161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DiscontinueBackupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont2when1(Optional const& __latestRestorableVersion,int loopDepth) + int a_body1cont5when1(bool const& __stopWhenDone,int loopDepth) { - #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - latestRestorableVersion = __latestRestorableVersion; - #line 43925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont3(loopDepth); + #line 5631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + stopWhenDone = __stopWhenDone; + #line 51173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont11(loopDepth); return loopDepth; } - int a_body1cont2when1(Optional && __latestRestorableVersion,int loopDepth) + int a_body1cont5when1(bool && __stopWhenDone,int loopDepth) { - latestRestorableVersion = std::move(__latestRestorableVersion); - loopDepth = a_body1cont3(loopDepth); + stopWhenDone = std::move(__stopWhenDone); + loopDepth = a_body1cont11(loopDepth); return loopDepth; } - void a_exitChoose3() + void a_exitChoose8() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DiscontinueBackupActor, 2, Optional >::remove(); + static_cast(this)->ActorCallback< DiscontinueBackupActor, 7, bool >::remove(); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 2, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 7, bool >*,bool const& value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 7); + a_exitChoose8(); try { - a_body1cont2when1(value, 0); + a_body1cont5when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 2); + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 7); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 2, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< DiscontinueBackupActor, 7, bool >*,bool && value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 7); + a_exitChoose8(); try { - a_body1cont2when1(std::move(value), 0); + a_body1cont5when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 2); + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 7); } - void a_callback_error(ActorCallback< DiscontinueBackupActor, 2, Optional >*,Error err) + void a_callback_error(ActorCallback< DiscontinueBackupActor, 7, bool >*,Error err) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 7); + a_exitChoose8(); try { a_body1Catch1(err, 0); } @@ -43982,113 +51230,229 @@ class DiscontinueBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 2); + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 7); } - int a_body1cont5(int loopDepth) + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + FileBackupAgent* backupAgent; + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key tagName; + #line 5597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyBackedTag tag; + #line 5598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + UidAndAbortedFlagT current; + #line 5599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + BackupConfig config; + #line 5600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EBackupState status; + #line 5608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional latestRestorableVersion; + #line 5621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key destUidValue; + #line 5631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool stopWhenDone; + #line 51256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via discontinueBackup() + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class DiscontinueBackupActor final : public Actor, public ActorCallback< DiscontinueBackupActor, 0, UidAndAbortedFlagT >, public ActorCallback< DiscontinueBackupActor, 1, EBackupState >, public ActorCallback< DiscontinueBackupActor, 2, Optional >, public ActorCallback< DiscontinueBackupActor, 3, Void >, public ActorCallback< DiscontinueBackupActor, 4, Key >, public ActorCallback< DiscontinueBackupActor, 5, Void >, public ActorCallback< DiscontinueBackupActor, 6, Void >, public ActorCallback< DiscontinueBackupActor, 7, bool >, public FastAllocated, public DiscontinueBackupActorState { + #line 51261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DiscontinueBackupActor, 0, UidAndAbortedFlagT >; +friend struct ActorCallback< DiscontinueBackupActor, 1, EBackupState >; +friend struct ActorCallback< DiscontinueBackupActor, 2, Optional >; +friend struct ActorCallback< DiscontinueBackupActor, 3, Void >; +friend struct ActorCallback< DiscontinueBackupActor, 4, Key >; +friend struct ActorCallback< DiscontinueBackupActor, 5, Void >; +friend struct ActorCallback< DiscontinueBackupActor, 6, Void >; +friend struct ActorCallback< DiscontinueBackupActor, 7, bool >; + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DiscontinueBackupActor(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName) + #line 51279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + DiscontinueBackupActorState(backupAgent, tr, tagName) { - #line 4874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_7 = config.stopWhenDone().getOrThrow(tr); - #line 4874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 43994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont5when1(__when_expr_7.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 8; - #line 4874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("discontinueBackup"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 0, UidAndAbortedFlagT >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 1, EBackupState >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 2, Optional >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 4, Key >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 5, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 6, Void >*)0, actor_cancelled()); break; + case 8: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 7, bool >*)0, actor_cancelled()); break; + } + + } +}; + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future discontinueBackup( FileBackupAgent* const& backupAgent, Reference const& tr, Key const& tagName ) { + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new DiscontinueBackupActor(backupAgent, tr, tagName)); + #line 51313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 5641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + #line 51318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via abortBackup() + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class AbortBackupActorState { + #line 51324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + AbortBackupActorState(FileBackupAgent* const& backupAgent,Reference const& tr,std::string const& tagName) + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : backupAgent(backupAgent), + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr(tr), + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tagName(tagName) + #line 51335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("abortBackup", reinterpret_cast(this)); + + } + ~AbortBackupActorState() + { + fdb_probe_actor_destroy("abortBackup", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 5645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 5646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 5648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tag = makeBackupTag(tagName); + #line 5649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = tag.getOrThrow(tr, Snapshot::False, backup_unneeded()); + #line 5649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 51358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 5649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 51363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1cont6(Void const& _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - #line 4862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); - #line 4864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = config.destUidValue().getOrThrow(tr); - #line 4864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 4864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + this->~AbortBackupActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont6(Void && _,int loopDepth) + int a_body1cont1(int loopDepth) { - #line 4862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); - #line 4864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = config.destUidValue().getOrThrow(tr); - #line 4864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 4864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config = BackupConfig(current.first); + #line 5652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = config.destUidValue().getOrThrow(tr); + #line 5652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 51390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 5652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 51395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont3when1(Void const& _,int loopDepth) + int a_body1when1(UidAndAbortedFlagT const& __current,int loopDepth) { - loopDepth = a_body1cont6(_, loopDepth); + #line 5649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + current = __current; + #line 51404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1cont3when1(Void && _,int loopDepth) + int a_body1when1(UidAndAbortedFlagT && __current,int loopDepth) { - loopDepth = a_body1cont6(std::move(_), loopDepth); + current = std::move(__current); + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DiscontinueBackupActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AbortBackupActor, 0, UidAndAbortedFlagT >::remove(); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AbortBackupActor, 0, UidAndAbortedFlagT >*,UidAndAbortedFlagT const& value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont3when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 3); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< AbortBackupActor, 0, UidAndAbortedFlagT >*,UidAndAbortedFlagT && value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont3when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 3); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< DiscontinueBackupActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< AbortBackupActor, 0, UidAndAbortedFlagT >*,Error err) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1Catch1(err, 0); } @@ -44097,81 +51461,81 @@ class DiscontinueBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 3); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 0); } - int a_body1cont7(int loopDepth) + int a_body1cont2(int loopDepth) { - #line 4865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_5 = success(tr->getReadVersion()); - #line 4865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont7when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 4865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = config.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); + #line 5653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 51473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 5653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 51478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont6when1(Key const& __destUidValue,int loopDepth) + int a_body1cont1when1(Key const& __destUidValue,int loopDepth) { - #line 4864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" destUidValue = __destUidValue; - #line 44123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont7(loopDepth); + #line 51487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont6when1(Key && __destUidValue,int loopDepth) + int a_body1cont1when1(Key && __destUidValue,int loopDepth) { destUidValue = std::move(__destUidValue); - loopDepth = a_body1cont7(loopDepth); + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - void a_exitChoose5() + void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DiscontinueBackupActor, 4, Key >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AbortBackupActor, 1, Key >::remove(); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 4, Key >*,Key const& value) + void a_callback_fire(ActorCallback< AbortBackupActor, 1, Key >*,Key const& value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont6when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 4); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 4, Key >*,Key && value) + void a_callback_fire(ActorCallback< AbortBackupActor, 1, Key >*,Key && value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont6when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 4); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< DiscontinueBackupActor, 4, Key >*,Error err) + void a_callback_error(ActorCallback< AbortBackupActor, 1, Key >*,Error err) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -44180,93 +51544,113 @@ class DiscontinueBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 4); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 1); } - int a_body1cont8(Void const& _,int loopDepth) + int a_body1cont3(EBackupState const& status,int loopDepth) { - #line 4866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_6 = eraseLogData(tr, config.getUidAsKey(), destUidValue) && fileBackup::clearBackupStartID(tr, config.getUid()); - #line 4866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont8when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 4866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!backupAgent->isRunnable(status)) + #line 51554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(backup_unneeded(), loopDepth); + #line 51558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevInfo, "FBA_AbortBackup") .detail("TagName", tagName.c_str()) .detail("Status", BackupAgentBase::getStateText(status)); + #line 5664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = tag.cancel(tr); + #line 5664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 51566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 5664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 51571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont8(Void && _,int loopDepth) + int a_body1cont3(EBackupState && status,int loopDepth) { - #line 4866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_6 = eraseLogData(tr, config.getUidAsKey(), destUidValue) && fileBackup::clearBackupStartID(tr, config.getUid()); - #line 4866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont8when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 4866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!backupAgent->isRunnable(status)) + #line 51580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(backup_unneeded(), loopDepth); + #line 51584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevInfo, "FBA_AbortBackup") .detail("TagName", tagName.c_str()) .detail("Status", BackupAgentBase::getStateText(status)); + #line 5664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = tag.cancel(tr); + #line 5664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 51592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 5664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 51597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont7when1(Void const& _,int loopDepth) + int a_body1cont2when1(EBackupState const& status,int loopDepth) { - loopDepth = a_body1cont8(_, loopDepth); + loopDepth = a_body1cont3(status, loopDepth); return loopDepth; } - int a_body1cont7when1(Void && _,int loopDepth) + int a_body1cont2when1(EBackupState && status,int loopDepth) { - loopDepth = a_body1cont8(std::move(_), loopDepth); + loopDepth = a_body1cont3(std::move(status), loopDepth); return loopDepth; } - void a_exitChoose6() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DiscontinueBackupActor, 5, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AbortBackupActor, 2, EBackupState >::remove(); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 5, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AbortBackupActor, 2, EBackupState >*,EBackupState const& value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont7when1(value, 0); + a_body1cont2when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 5); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< AbortBackupActor, 2, EBackupState >*,EBackupState && value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont7when1(std::move(value), 0); + a_body1cont2when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 5); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< DiscontinueBackupActor, 5, Void >*,Error err) + void a_callback_error(ActorCallback< AbortBackupActor, 2, EBackupState >*,Error err) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -44275,89 +51659,93 @@ class DiscontinueBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 5); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 2); } - int a_body1cont9(Void const& _,int loopDepth) + int a_body1cont4(Void const& _,int loopDepth) { - #line 4869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config.stateEnum().set(tr, EBackupState::STATE_COMPLETED); - #line 4871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DiscontinueBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 44287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~DiscontinueBackupActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 5666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_4 = eraseLogData(tr, config.getUidAsKey(), destUidValue) && fileBackup::clearBackupStartID(tr, config.getUid()); + #line 5666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 51671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 5666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 51676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont9(Void && _,int loopDepth) + int a_body1cont4(Void && _,int loopDepth) { - #line 4869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config.stateEnum().set(tr, EBackupState::STATE_COMPLETED); - #line 4871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DiscontinueBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 44301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~DiscontinueBackupActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 5666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_4 = eraseLogData(tr, config.getUidAsKey(), destUidValue) && fileBackup::clearBackupStartID(tr, config.getUid()); + #line 5666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 51687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 5666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 51692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont8when1(Void const& _,int loopDepth) + int a_body1cont3when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont9(_, loopDepth); + loopDepth = a_body1cont4(_, loopDepth); return loopDepth; } - int a_body1cont8when1(Void && _,int loopDepth) + int a_body1cont3when1(Void && _,int loopDepth) { - loopDepth = a_body1cont9(std::move(_), loopDepth); + loopDepth = a_body1cont4(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose7() + void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DiscontinueBackupActor, 6, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AbortBackupActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 6, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AbortBackupActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont8when1(value, 0); + a_body1cont3when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 6); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 6, Void >*,Void && value) + void a_callback_fire(ActorCallback< AbortBackupActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont8when1(std::move(value), 0); + a_body1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 6); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< DiscontinueBackupActor, 6, Void >*,Error err) + void a_callback_error(ActorCallback< AbortBackupActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -44366,87 +51754,89 @@ class DiscontinueBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 6); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 3); } - int a_body1cont11(int loopDepth) + int a_body1cont6(Void const& _,int loopDepth) { - #line 4876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (stopWhenDone) - #line 44376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 4877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(backup_duplicate(), loopDepth); - #line 44380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 4880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config.stopWhenDone().set(tr, true); - #line 4882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DiscontinueBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 44386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~DiscontinueBackupActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 5669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config.stateEnum().set(tr, EBackupState::STATE_ABORTED); + #line 5671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } + #line 51766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~AbortBackupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1cont5when1(bool const& __stopWhenDone,int loopDepth) + int a_body1cont6(Void && _,int loopDepth) { - #line 4874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - stopWhenDone = __stopWhenDone; - #line 44398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont11(loopDepth); + #line 5669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config.stateEnum().set(tr, EBackupState::STATE_ABORTED); + #line 5671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } + #line 51780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~AbortBackupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont5when1(bool && __stopWhenDone,int loopDepth) + int a_body1cont4when1(Void const& _,int loopDepth) { - stopWhenDone = std::move(__stopWhenDone); - loopDepth = a_body1cont11(loopDepth); + loopDepth = a_body1cont6(_, loopDepth); return loopDepth; } - void a_exitChoose8() + int a_body1cont4when1(Void && _,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DiscontinueBackupActor, 7, bool >::remove(); + loopDepth = a_body1cont6(std::move(_), loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 7, bool >*,bool const& value) + void a_exitChoose5() { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 7); - a_exitChoose8(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AbortBackupActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AbortBackupActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1cont5when1(value, 0); + a_body1cont4when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 7); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< DiscontinueBackupActor, 7, bool >*,bool && value) + void a_callback_fire(ActorCallback< AbortBackupActor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 7); - a_exitChoose8(); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1cont5when1(std::move(value), 0); + a_body1cont4when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 7); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< DiscontinueBackupActor, 7, bool >*,Error err) + void a_callback_error(ActorCallback< AbortBackupActor, 4, Void >*,Error err) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), 7); - a_exitChoose8(); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 4); + a_exitChoose5(); try { a_body1Catch1(err, 0); } @@ -44455,63 +51845,54 @@ class DiscontinueBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), 7); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 4); } - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" FileBackupAgent* backupAgent; - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key tagName; - #line 4840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string tagName; + #line 5648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyBackedTag tag; - #line 4841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UidAndAbortedFlagT current; - #line 4842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig config; - #line 4843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - EBackupState status; - #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional latestRestorableVersion; - #line 4864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key destUidValue; - #line 4874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bool stopWhenDone; - #line 44481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 51865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via discontinueBackup() - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class DiscontinueBackupActor final : public Actor, public ActorCallback< DiscontinueBackupActor, 0, UidAndAbortedFlagT >, public ActorCallback< DiscontinueBackupActor, 1, EBackupState >, public ActorCallback< DiscontinueBackupActor, 2, Optional >, public ActorCallback< DiscontinueBackupActor, 3, Void >, public ActorCallback< DiscontinueBackupActor, 4, Key >, public ActorCallback< DiscontinueBackupActor, 5, Void >, public ActorCallback< DiscontinueBackupActor, 6, Void >, public ActorCallback< DiscontinueBackupActor, 7, bool >, public FastAllocated, public DiscontinueBackupActorState { - #line 44486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via abortBackup() + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class AbortBackupActor final : public Actor, public ActorCallback< AbortBackupActor, 0, UidAndAbortedFlagT >, public ActorCallback< AbortBackupActor, 1, Key >, public ActorCallback< AbortBackupActor, 2, EBackupState >, public ActorCallback< AbortBackupActor, 3, Void >, public ActorCallback< AbortBackupActor, 4, Void >, public FastAllocated, public AbortBackupActorState { + #line 51870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< DiscontinueBackupActor, 0, UidAndAbortedFlagT >; -friend struct ActorCallback< DiscontinueBackupActor, 1, EBackupState >; -friend struct ActorCallback< DiscontinueBackupActor, 2, Optional >; -friend struct ActorCallback< DiscontinueBackupActor, 3, Void >; -friend struct ActorCallback< DiscontinueBackupActor, 4, Key >; -friend struct ActorCallback< DiscontinueBackupActor, 5, Void >; -friend struct ActorCallback< DiscontinueBackupActor, 6, Void >; -friend struct ActorCallback< DiscontinueBackupActor, 7, bool >; - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - DiscontinueBackupActor(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName) - #line 44504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +friend struct ActorCallback< AbortBackupActor, 0, UidAndAbortedFlagT >; +friend struct ActorCallback< AbortBackupActor, 1, Key >; +friend struct ActorCallback< AbortBackupActor, 2, EBackupState >; +friend struct ActorCallback< AbortBackupActor, 3, Void >; +friend struct ActorCallback< AbortBackupActor, 4, Void >; + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + AbortBackupActor(FileBackupAgent* const& backupAgent,Reference const& tr,std::string const& tagName) + #line 51885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), - DiscontinueBackupActorState(backupAgent, tr, tagName) + AbortBackupActorState(backupAgent, tr, tagName) { - fdb_probe_actor_enter("discontinueBackup", reinterpret_cast(this), -1); + fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("discontinueBackup"); + this->lineage.setActorName("abortBackup"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("discontinueBackup", reinterpret_cast(this), -1); + fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), -1); } void cancel() override @@ -44519,74 +51900,62 @@ friend struct ActorCallback< DiscontinueBackupActor, 7, bool >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 0, UidAndAbortedFlagT >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 1, EBackupState >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 2, Optional >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 4, Key >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 5, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 6, Void >*)0, actor_cancelled()); break; - case 8: this->a_callback_error((ActorCallback< DiscontinueBackupActor, 7, bool >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< AbortBackupActor, 0, UidAndAbortedFlagT >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< AbortBackupActor, 1, Key >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< AbortBackupActor, 2, EBackupState >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< AbortBackupActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< AbortBackupActor, 4, Void >*)0, actor_cancelled()); break; } } }; - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future discontinueBackup( FileBackupAgent* const& backupAgent, Reference const& tr, Key const& tagName ) { - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new DiscontinueBackupActor(backupAgent, tr, tagName)); - #line 44538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future abortBackup( FileBackupAgent* const& backupAgent, Reference const& tr, std::string const& tagName ) { + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new AbortBackupActor(backupAgent, tr, tagName)); + #line 51916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 5673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 44543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via abortBackup() - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class AbortBackupActorState { - #line 44549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 51921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via changePause() + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class ChangePauseActorState { + #line 51927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - AbortBackupActorState(FileBackupAgent* const& backupAgent,Reference const& tr,std::string const& tagName) - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ChangePauseActorState(FileBackupAgent* const& backupAgent,Database const& db,bool const& pause) + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr(tr), - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tagName(tagName) - #line 44560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + db(db), + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + pause(pause), + #line 5675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr(new ReadYourWritesTransaction(db)), + #line 5676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + change(backupAgent->taskBucket->changePause(db, pause)) + #line 51942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("abortBackup", reinterpret_cast(this)); + fdb_probe_actor_create("changePause", reinterpret_cast(this)); } - ~AbortBackupActorState() + ~ChangePauseActorState() { - fdb_probe_actor_destroy("abortBackup", reinterpret_cast(this)); + fdb_probe_actor_destroy("changePause", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 4888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tag = makeBackupTag(tagName); - #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = tag.getOrThrow(tr, Snapshot::False, backup_unneeded()); - #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 5678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 51957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -44598,168 +51967,247 @@ class AbortBackupActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~AbortBackupActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~ChangePauseActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 4894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config = BackupConfig(current.first); - #line 4895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = config.destUidValue().getOrThrow(tr); - #line 4895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 4895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = change; + #line 5691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 51982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 5691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 51987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(UidAndAbortedFlagT const& __current,int loopDepth) + int a_body1loopHead1(int loopDepth) { - #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - current = __current; - #line 44629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); return loopDepth; } - int a_body1when1(UidAndAbortedFlagT && __current,int loopDepth) + int a_body1loopBody1(int loopDepth) { - current = std::move(__current); - loopDepth = a_body1cont1(loopDepth); + #line 5679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 5680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 5681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 52007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + try { + #line 5684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->set(backupPausedKey, pause ? "1"_sr : "0"_sr); + #line 5685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = tr->commit(); + #line 5685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 52015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 5685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = tr->onError(e); + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 52057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Void const& _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont2(Void && _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AbortBackupActor, 0, UidAndAbortedFlagT >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangePauseActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< AbortBackupActor, 0, UidAndAbortedFlagT >*,UidAndAbortedFlagT const& value) + void a_callback_fire(ActorCallback< ChangePauseActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 0); + fdb_probe_actor_enter("changePause", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("changePause", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< AbortBackupActor, 0, UidAndAbortedFlagT >*,UidAndAbortedFlagT && value) + void a_callback_fire(ActorCallback< ChangePauseActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 0); + fdb_probe_actor_enter("changePause", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("changePause", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< AbortBackupActor, 0, UidAndAbortedFlagT >*,Error err) + void a_callback_error(ActorCallback< ChangePauseActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 0); + fdb_probe_actor_enter("changePause", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("changePause", reinterpret_cast(this), 0); } - int a_body1cont2(int loopDepth) + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 4896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = config.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); - #line 4896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 4896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont1when1(Key const& __destUidValue,int loopDepth) + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 4895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - destUidValue = __destUidValue; - #line 44712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont1when1(Key && __destUidValue,int loopDepth) + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - destUidValue = std::move(__destUidValue); - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AbortBackupActor, 1, Key >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangePauseActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< AbortBackupActor, 1, Key >*,Key const& value) + void a_callback_fire(ActorCallback< ChangePauseActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 1); + fdb_probe_actor_enter("changePause", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("changePause", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< AbortBackupActor, 1, Key >*,Key && value) + void a_callback_fire(ActorCallback< ChangePauseActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 1); + fdb_probe_actor_enter("changePause", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("changePause", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< AbortBackupActor, 1, Key >*,Error err) + void a_callback_error(ActorCallback< ChangePauseActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 1); + fdb_probe_actor_enter("changePause", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -44769,112 +52217,88 @@ class AbortBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("changePause", reinterpret_cast(this), 1); } - int a_body1cont3(EBackupState const& status,int loopDepth) + int a_body1cont2(Void const& _,int loopDepth) { - #line 4898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!backupAgent->isRunnable(status)) - #line 44779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 4899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(backup_unneeded(), loopDepth); - #line 44783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 4902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevInfo, "FBA_AbortBackup") .detail("TagName", tagName.c_str()) .detail("Status", BackupAgentBase::getStateText(status)); - #line 4907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_3 = tag.cancel(tr); - #line 4907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 4907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 5692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("FileBackupAgentChangePaused").detail("Action", pause ? "Paused" : "Resumed"); + #line 5693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangePauseActorState(); static_cast(this)->destroy(); return 0; } + #line 52229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangePauseActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont3(EBackupState && status,int loopDepth) + int a_body1cont2(Void && _,int loopDepth) { - #line 4898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!backupAgent->isRunnable(status)) - #line 44805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 4899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(backup_unneeded(), loopDepth); - #line 44809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 4902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevInfo, "FBA_AbortBackup") .detail("TagName", tagName.c_str()) .detail("Status", BackupAgentBase::getStateText(status)); - #line 4907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_3 = tag.cancel(tr); - #line 4907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 4907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 5692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("FileBackupAgentChangePaused").detail("Action", pause ? "Paused" : "Resumed"); + #line 5693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangePauseActorState(); static_cast(this)->destroy(); return 0; } + #line 52243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangePauseActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont2when1(EBackupState const& status,int loopDepth) + int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont3(status, loopDepth); + loopDepth = a_body1cont2(_, loopDepth); return loopDepth; } - int a_body1cont2when1(EBackupState && status,int loopDepth) + int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont3(std::move(status), loopDepth); + loopDepth = a_body1cont2(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AbortBackupActor, 2, EBackupState >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangePauseActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< AbortBackupActor, 2, EBackupState >*,EBackupState const& value) + void a_callback_fire(ActorCallback< ChangePauseActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 2); + fdb_probe_actor_enter("changePause", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 2); + fdb_probe_actor_exit("changePause", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< AbortBackupActor, 2, EBackupState >*,EBackupState && value) + void a_callback_fire(ActorCallback< ChangePauseActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 2); + fdb_probe_actor_enter("changePause", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 2); + fdb_probe_actor_exit("changePause", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< AbortBackupActor, 2, EBackupState >*,Error err) + void a_callback_error(ActorCallback< ChangePauseActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 2); + fdb_probe_actor_enter("changePause", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -44884,93 +52308,252 @@ class AbortBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 2); + fdb_probe_actor_exit("changePause", reinterpret_cast(this), 2); } - int a_body1cont4(Void const& _,int loopDepth) + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + FileBackupAgent* backupAgent; + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Database db; + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool pause; + #line 5675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 5676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Future change; + #line 52324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via changePause() + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class ChangePauseActor final : public Actor, public ActorCallback< ChangePauseActor, 0, Void >, public ActorCallback< ChangePauseActor, 1, Void >, public ActorCallback< ChangePauseActor, 2, Void >, public FastAllocated, public ChangePauseActorState { + #line 52329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ChangePauseActor, 0, Void >; +friend struct ActorCallback< ChangePauseActor, 1, Void >; +friend struct ActorCallback< ChangePauseActor, 2, Void >; + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ChangePauseActor(FileBackupAgent* const& backupAgent,Database const& db,bool const& pause) + #line 52342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + ChangePauseActorState(backupAgent, db, pause) { - #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = eraseLogData(tr, config.getUidAsKey(), destUidValue) && fileBackup::clearBackupStartID(tr, config.getUid()); - #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_enter("changePause", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("changePause"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("changePause", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ChangePauseActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ChangePauseActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ChangePauseActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future changePause( FileBackupAgent* const& backupAgent, Database const& db, bool const& pause ) { + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new ChangePauseActor(backupAgent, db, pause)); + #line 52371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 5695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + struct TimestampedVersion { + Optional version; + Optional epochs; + + bool present() const { return version.present(); } + + JsonBuilderObject toJSON() const { + JsonBuilderObject doc; + if (version.present()) { + doc.setKey("Version", version.get()); + if (epochs.present()) { + doc.setKey("EpochSeconds", epochs.get()); + doc.setKey("Timestamp", timeStampToString(epochs)); + } + } + return doc; + } + }; + + // Helper actor for generating status + // If f is present, lookup epochs using timekeeper and tr, return TimestampedVersion + #line 52397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via getTimestampedVersion() + #line 5717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 5717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class GetTimestampedVersionActorState { + #line 52403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 5717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + GetTimestampedVersionActorState(Reference const& tr,Future> const& f) + #line 5717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : tr(tr), + #line 5717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + f(f), + #line 5719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tv() + #line 52414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("getTimestampedVersion", reinterpret_cast(this)); + + } + ~GetTimestampedVersionActorState() + { + fdb_probe_actor_destroy("getTimestampedVersion", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 5720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = store(tv.version, f); + #line 5720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 52431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 5720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1cont4(Void && _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = eraseLogData(tr, config.getUidAsKey(), destUidValue) && fileBackup::clearBackupStartID(tr, config.getUid()); - #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + this->~GetTimestampedVersionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont3when1(Void const& _,int loopDepth) + int a_body1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1cont4(_, loopDepth); + #line 5721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (tv.version.present()) + #line 52459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = store(tv.epochs, timeKeeperEpochsFromVersion(tv.version.get(), tr)); + #line 5722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 52465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 5722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont2(loopDepth); + } return loopDepth; } - int a_body1cont3when1(Void && _,int loopDepth) + int a_body1cont1(Void && _,int loopDepth) { - loopDepth = a_body1cont4(std::move(_), loopDepth); + #line 5721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (tv.version.present()) + #line 52484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = store(tv.epochs, timeKeeperEpochsFromVersion(tv.version.get(), tr)); + #line 5722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 52490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 5722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont2(loopDepth); + } return loopDepth; } - void a_exitChoose4() + int a_body1when1(Void const& _,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AbortBackupActor, 3, Void >::remove(); + loopDepth = a_body1cont1(_, loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< AbortBackupActor, 3, Void >*,Void const& value) + int a_body1when1(Void && _,int loopDepth) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 3); - a_exitChoose4(); + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetTimestampedVersionActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetTimestampedVersionActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getTimestampedVersion", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont3when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getTimestampedVersion", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< AbortBackupActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetTimestampedVersionActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getTimestampedVersion", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont3when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getTimestampedVersion", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< AbortBackupActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< GetTimestampedVersionActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getTimestampedVersion", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1Catch1(err, 0); } @@ -44979,89 +52562,85 @@ class AbortBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getTimestampedVersion", reinterpret_cast(this), 0); } - int a_body1cont6(Void const& _,int loopDepth) + int a_body1cont2(int loopDepth) { - #line 4912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config.stateEnum().set(tr, EBackupState::STATE_ABORTED); - #line 4914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 44991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~AbortBackupActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 5724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(tv); this->~GetTimestampedVersionActorState(); static_cast(this)->destroy(); return 0; } + #line 52572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< TimestampedVersion >::value()) TimestampedVersion(std::move(tv)); // state_var_RVO + this->~GetTimestampedVersionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1cont6(Void && _,int loopDepth) + int a_body1cont3(Void const& _,int loopDepth) { - #line 4912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config.stateEnum().set(tr, EBackupState::STATE_ABORTED); - #line 4914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AbortBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 45005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~AbortBackupActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont4when1(Void const& _,int loopDepth) + int a_body1cont3(Void && _,int loopDepth) { - loopDepth = a_body1cont6(_, loopDepth); + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont4when1(Void && _,int loopDepth) + int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont6(std::move(_), loopDepth); + loopDepth = a_body1cont3(_, loopDepth); return loopDepth; } - void a_exitChoose5() + int a_body1cont1when1(Void && _,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AbortBackupActor, 4, Void >::remove(); + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetTimestampedVersionActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< AbortBackupActor, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetTimestampedVersionActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getTimestampedVersion", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont4when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getTimestampedVersion", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< AbortBackupActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetTimestampedVersionActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getTimestampedVersion", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont4when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getTimestampedVersion", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< AbortBackupActor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< GetTimestampedVersionActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getTimestampedVersion", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -45070,54 +52649,43 @@ class AbortBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getTimestampedVersion", reinterpret_cast(this), 1); } - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - FileBackupAgent* backupAgent; - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string tagName; - #line 4891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - KeyBackedTag tag; - #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - UidAndAbortedFlagT current; - #line 4894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - BackupConfig config; - #line 4895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key destUidValue; - #line 45090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Future> f; + #line 5719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TimestampedVersion tv; + #line 52661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via abortBackup() - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class AbortBackupActor final : public Actor, public ActorCallback< AbortBackupActor, 0, UidAndAbortedFlagT >, public ActorCallback< AbortBackupActor, 1, Key >, public ActorCallback< AbortBackupActor, 2, EBackupState >, public ActorCallback< AbortBackupActor, 3, Void >, public ActorCallback< AbortBackupActor, 4, Void >, public FastAllocated, public AbortBackupActorState { - #line 45095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via getTimestampedVersion() + #line 5717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class GetTimestampedVersionActor final : public Actor, public ActorCallback< GetTimestampedVersionActor, 0, Void >, public ActorCallback< GetTimestampedVersionActor, 1, Void >, public FastAllocated, public GetTimestampedVersionActorState { + #line 52666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< AbortBackupActor, 0, UidAndAbortedFlagT >; -friend struct ActorCallback< AbortBackupActor, 1, Key >; -friend struct ActorCallback< AbortBackupActor, 2, EBackupState >; -friend struct ActorCallback< AbortBackupActor, 3, Void >; -friend struct ActorCallback< AbortBackupActor, 4, Void >; - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - AbortBackupActor(FileBackupAgent* const& backupAgent,Reference const& tr,std::string const& tagName) - #line 45110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor(), - AbortBackupActorState(backupAgent, tr, tagName) +friend struct ActorCallback< GetTimestampedVersionActor, 0, Void >; +friend struct ActorCallback< GetTimestampedVersionActor, 1, Void >; + #line 5717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + GetTimestampedVersionActor(Reference const& tr,Future> const& f) + #line 52678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + GetTimestampedVersionActorState(tr, f) { - fdb_probe_actor_enter("abortBackup", reinterpret_cast(this), -1); + fdb_probe_actor_enter("getTimestampedVersion", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("abortBackup"); + this->lineage.setActorName("getTimestampedVersion"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("abortBackup", reinterpret_cast(this), -1); + fdb_probe_actor_exit("getTimestampedVersion", reinterpret_cast(this), -1); } void cancel() override @@ -45125,61 +52693,56 @@ friend struct ActorCallback< AbortBackupActor, 4, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< AbortBackupActor, 0, UidAndAbortedFlagT >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< AbortBackupActor, 1, Key >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< AbortBackupActor, 2, EBackupState >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< AbortBackupActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< AbortBackupActor, 4, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetTimestampedVersionActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetTimestampedVersionActor, 1, Void >*)0, actor_cancelled()); break; } } }; - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future abortBackup( FileBackupAgent* const& backupAgent, Reference const& tr, std::string const& tagName ) { - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new AbortBackupActor(backupAgent, tr, tagName)); - #line 45141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future getTimestampedVersion( Reference const& tr, Future> const& f ) { + #line 5717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new GetTimestampedVersionActor(tr, f)); + #line 52706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 5726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 45146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via changePause() - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class ChangePauseActorState { - #line 45152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 52711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via getStatusJSON() + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class GetStatusJSONActorState { + #line 52717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ChangePauseActorState(FileBackupAgent* const& backupAgent,Database const& db,bool const& pause) - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + GetStatusJSONActorState(FileBackupAgent* const& backupAgent,Database const& cx,std::string const& tagName) + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - db(db), - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - pause(pause), - #line 4918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr(new ReadYourWritesTransaction(db)), - #line 4919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - change(backupAgent->taskBucket->changePause(db, pause)) - #line 45167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + cx(cx), + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tagName(tagName), + #line 5728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr(new ReadYourWritesTransaction(cx)) + #line 52730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("changePause", reinterpret_cast(this)); + fdb_probe_actor_create("getStatusJSON", reinterpret_cast(this)); } - ~ChangePauseActorState() + ~GetStatusJSONActorState() { - fdb_probe_actor_destroy("changePause", reinterpret_cast(this)); + fdb_probe_actor_destroy("getStatusJSON", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 4921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 45182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 52745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -45192,24 +52755,8 @@ class ChangePauseActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~ChangePauseActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(int loopDepth) - { - #line 4934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = change; - #line 4934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 45207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 4934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 45212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + this->~GetStatusJSONActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; @@ -45223,45 +52770,39 @@ class ChangePauseActorState { } int a_body1loopBody1(int loopDepth) { - #line 4922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 45232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" try { - #line 4927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->set(backupPausedKey, pause ? LiteralStringRef("1") : LiteralStringRef("0")); - #line 4928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = tr->commit(); - #line 4928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 45240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc = JsonBuilderObject(); + #line 5733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("SchemaVersion", "1.0.0"); + #line 5735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 5736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 5738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tag = makeBackupTag(tagName); + #line 5739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + uidAndAbortedFlag = Optional(); + #line 5740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + paused = Optional(); + #line 5741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + recentReadVersion = Version(); + #line 5743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = store(paused, tr->get(backupAgent->taskBucket->getPauseKey())) && store(uidAndAbortedFlag, tag.get(tr)) && store(recentReadVersion, tr->getReadVersion()); + #line 5743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 52794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 4928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 45245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 5743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { loopDepth = a_body1loopBody1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1break1(int loopDepth) - { - try { - return a_body1cont1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); } return loopDepth; @@ -45275,16 +52816,16 @@ class ChangePauseActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 4931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = tr->onError(e); - #line 4931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 45282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 4931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 45287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_5 = tr->onError(e); + #line 5873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 52823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 5873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -45297,13 +52838,67 @@ class ChangePauseActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + #line 5746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("BackupAgentsPaused", paused.present()); + #line 5747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("Tag", tag.tagName); + #line 5749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (uidAndAbortedFlag.present()) + #line 52847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("UID", uidAndAbortedFlag.get().first.toString()); + #line 5752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config = BackupConfig(uidAndAbortedFlag.get().first); + #line 5754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = config.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); + #line 5754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 52857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 5754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont3(loopDepth); + } return loopDepth; } int a_body1loopBody1cont2(Void && _,int loopDepth) { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + #line 5746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("BackupAgentsPaused", paused.present()); + #line 5747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("Tag", tag.tagName); + #line 5749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (uidAndAbortedFlag.present()) + #line 52880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("UID", uidAndAbortedFlag.get().first.toString()); + #line 5752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config = BackupConfig(uidAndAbortedFlag.get().first); + #line 5754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = config.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); + #line 5754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 52890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 5754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont3(loopDepth); + } return loopDepth; } @@ -45321,13 +52916,13 @@ class ChangePauseActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangePauseActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStatusJSONActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< ChangePauseActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetStatusJSONActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("changePause", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -45337,12 +52932,12 @@ class ChangePauseActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changePause", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< ChangePauseActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetStatusJSONActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("changePause", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -45352,12 +52947,12 @@ class ChangePauseActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changePause", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< ChangePauseActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< GetStatusJSONActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("changePause", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1Catch1(err, 0); @@ -45367,505 +52962,703 @@ class ChangePauseActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changePause", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 0); } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1loopBody1cont3(int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 5871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(doc.getJson()); this->~GetStatusJSONActorState(); static_cast(this)->destroy(); return 0; } + #line 52972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< std::string >::value()) std::string(doc.getJson()); + this->~GetStatusJSONActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1loopBody1cont4(int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 5756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + JsonBuilderObject statusDoc; + #line 5757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusDoc.setKey("Name", BackupAgentBase::getStateName(backupState)); + #line 5758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusDoc.setKey("Description", BackupAgentBase::getStateText(backupState)); + #line 5759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusDoc.setKey("Completed", backupState == EBackupState::STATE_COMPLETED); + #line 5760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusDoc.setKey("Running", BackupAgentBase::isRunnable(backupState)); + #line 5761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("Status", statusDoc); + #line 5763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + done = Void(); + #line 5765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (backupState != EBackupState::STATE_NEVERRAN) + #line 52998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bc = Reference(); + #line 5767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + latestRestorable = TimestampedVersion(); + #line 5769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = store(latestRestorable, getTimestampedVersion(tr, config.getLatestRestorableVersion(tr))) && store(bc, config.backupContainer().getOrThrow(tr)); + #line 5769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 53008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 5769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 53013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont5(loopDepth); + } return loopDepth; } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont2when1(EBackupState const& __backupState,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + #line 5754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backupState = __backupState; + #line 53027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont4(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1loopBody1cont2when1(EBackupState && __backupState,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + backupState = std::move(__backupState); + loopDepth = a_body1loopBody1cont4(loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangePauseActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStatusJSONActor, 1, EBackupState >::remove(); } - void a_callback_fire(ActorCallback< ChangePauseActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetStatusJSONActor, 1, EBackupState >*,EBackupState const& value) { - fdb_probe_actor_enter("changePause", reinterpret_cast(this), 1); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1Catch1when1(value, 0); + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changePause", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< ChangePauseActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetStatusJSONActor, 1, EBackupState >*,EBackupState && value) { - fdb_probe_actor_enter("changePause", reinterpret_cast(this), 1); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1Catch1when1(std::move(value), 0); + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changePause", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< ChangePauseActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< GetStatusJSONActor, 1, EBackupState >*,Error err) { - fdb_probe_actor_enter("changePause", reinterpret_cast(this), 1); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changePause", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 1); } - int a_body1cont2(Void const& _,int loopDepth) + int a_body1loopBody1cont5(int loopDepth) { - #line 4935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("FileBackupAgentChangePaused").detail("Action", pause ? "Paused" : "Resumed"); - #line 4936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangePauseActorState(); static_cast(this)->destroy(); return 0; } - #line 45454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~ChangePauseActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 5788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (backupState == EBackupState::STATE_RUNNING_DIFFERENTIAL || backupState == EBackupState::STATE_RUNNING) + #line 53094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotInterval = int64_t(); + #line 5791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + logBytesWritten = int64_t(); + #line 5792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rangeBytesWritten = int64_t(); + #line 5793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + stopWhenDone = bool(); + #line 5794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotBegin = TimestampedVersion(); + #line 5795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotTargetEnd = TimestampedVersion(); + #line 5796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + latestLogEnd = TimestampedVersion(); + #line 5797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + latestSnapshotEnd = TimestampedVersion(); + #line 5798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotLastDispatch = TimestampedVersion(); + #line 5799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotLastDispatchShardsBehind = Optional(); + #line 5801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = store(snapshotInterval, config.snapshotIntervalSeconds().getOrThrow(tr)) && store(logBytesWritten, config.logBytesWritten().getD(tr)) && store(rangeBytesWritten, config.rangeBytesWritten().getD(tr)) && store(stopWhenDone, config.stopWhenDone().getOrThrow(tr)) && store(snapshotBegin, getTimestampedVersion(tr, config.snapshotBeginVersion().get(tr))) && store(snapshotTargetEnd, getTimestampedVersion(tr, config.snapshotTargetEndVersion().get(tr))) && store(latestLogEnd, getTimestampedVersion(tr, config.latestLogEndVersion().get(tr))) && store(latestSnapshotEnd, getTimestampedVersion(tr, config.latestSnapshotEndVersion().get(tr))) && store(snapshotLastDispatch, getTimestampedVersion(tr, config.snapshotDispatchLastVersion().get(tr))) && store(snapshotLastDispatchShardsBehind, config.snapshotDispatchLastShardsBehind().get(tr)); + #line 5801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 53120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 5801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 53125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont10(loopDepth); + } return loopDepth; } - int a_body1cont2(Void && _,int loopDepth) + int a_body1loopBody1cont6(Void const& _,int loopDepth) { - #line 4935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("FileBackupAgentChangePaused").detail("Action", pause ? "Paused" : "Resumed"); - #line 4936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangePauseActorState(); static_cast(this)->destroy(); return 0; } - #line 45468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~ChangePauseActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 5772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bc = fileBackup::getBackupContainerWithProxy(bc); + #line 5774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("Restorable", latestRestorable.present()); + #line 5776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (latestRestorable.present()) + #line 53143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + JsonBuilderObject o = latestRestorable.toJSON(); + #line 5778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (backupState != EBackupState::STATE_COMPLETED) + #line 53149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + o.setKey("LagSeconds", (recentReadVersion - latestRestorable.version.get()) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); + #line 53153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("LatestRestorablePoint", o); + #line 53157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("DestinationURL", bc->getURL()); + #line 53161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont6(Void && _,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + #line 5772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bc = fileBackup::getBackupContainerWithProxy(bc); + #line 5774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("Restorable", latestRestorable.present()); + #line 5776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (latestRestorable.present()) + #line 53174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + JsonBuilderObject o = latestRestorable.toJSON(); + #line 5778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (backupState != EBackupState::STATE_COMPLETED) + #line 53180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + o.setKey("LagSeconds", (recentReadVersion - latestRestorable.version.get()) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); + #line 53184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("LatestRestorablePoint", o); + #line 53188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("DestinationURL", bc->getURL()); + #line 53192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1loopBody1cont4when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont6(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont6(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangePauseActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStatusJSONActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< ChangePauseActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetStatusJSONActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("changePause", reinterpret_cast(this), 2); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont1when1(value, 0); + a_body1loopBody1cont4when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changePause", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< ChangePauseActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetStatusJSONActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("changePause", reinterpret_cast(this), 2); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont1when1(std::move(value), 0); + a_body1loopBody1cont4when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changePause", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< ChangePauseActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< GetStatusJSONActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("changePause", reinterpret_cast(this), 2); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changePause", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 2); } - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - FileBackupAgent* backupAgent; - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Database db; - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bool pause; - #line 4918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference tr; - #line 4919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Future change; - #line 45549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -}; -// This generated class is to be used only via changePause() - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class ChangePauseActor final : public Actor, public ActorCallback< ChangePauseActor, 0, Void >, public ActorCallback< ChangePauseActor, 1, Void >, public ActorCallback< ChangePauseActor, 2, Void >, public FastAllocated, public ChangePauseActorState { - #line 45554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< ChangePauseActor, 0, Void >; -friend struct ActorCallback< ChangePauseActor, 1, Void >; -friend struct ActorCallback< ChangePauseActor, 2, Void >; - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ChangePauseActor(FileBackupAgent* const& backupAgent,Database const& db,bool const& pause) - #line 45567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor(), - ChangePauseActorState(backupAgent, db, pause) + int a_body1loopBody1cont10(int loopDepth) { - fdb_probe_actor_enter("changePause", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("changePause"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("changePause", reinterpret_cast(this), -1); + #line 5855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture>::RangeResultType> __when_expr_4 = config.lastErrorPerType().getRange( tr, 0, std::numeric_limits::max(), CLIENT_KNOBS->TOO_MANY); + #line 5855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 53266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont10when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 5855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast>::RangeResultType >*>(static_cast(this))); + #line 53271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + return loopDepth; } - void cancel() override + int a_body1loopBody1cont11(Void const& _,int loopDepth) { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ChangePauseActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< ChangePauseActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< ChangePauseActor, 2, Void >*)0, actor_cancelled()); break; + #line 5816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("StopAfterSnapshot", stopWhenDone); + #line 5817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("SnapshotIntervalSeconds", snapshotInterval); + #line 5818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("LogBytesWritten", logBytesWritten); + #line 5819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("RangeBytesWritten", rangeBytesWritten); + #line 5821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (latestLogEnd.present()) + #line 53288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("LatestLogEnd", latestLogEnd.toJSON()); + #line 53292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (latestSnapshotEnd.present()) + #line 53296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("LatestSnapshotEnd", latestSnapshotEnd.toJSON()); + #line 53300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + JsonBuilderObject snapshot; + #line 5831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (snapshotBegin.present()) + #line 53306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshot.setKey("Begin", snapshotBegin.toJSON()); + #line 5834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (snapshotTargetEnd.present()) + #line 53312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshot.setKey("EndTarget", snapshotTargetEnd.toJSON()); + #line 5837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version interval = snapshotTargetEnd.version.get() - snapshotBegin.version.get(); + #line 5838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshot.setKey("IntervalSeconds", interval / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); + #line 5840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version elapsed = recentReadVersion - snapshotBegin.version.get(); + #line 5841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + double progress = (interval > 0) ? (100.0 * elapsed / interval) : 100; + #line 5842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshot.setKey("ExpectedProgress", progress); + #line 53326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + JsonBuilderObject dispatchDoc = snapshotLastDispatch.toJSON(); + #line 5846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (snapshotLastDispatchShardsBehind.present()) + #line 53332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + dispatchDoc.setKey("ShardsBehind", snapshotLastDispatchShardsBehind.get()); + #line 53336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshot.setKey("LastDispatch", dispatchDoc); + #line 53340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } + #line 5852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("CurrentSnapshot", snapshot); + #line 53344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont10(loopDepth); + return loopDepth; } -}; - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future changePause( FileBackupAgent* const& backupAgent, Database const& db, bool const& pause ) { - #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new ChangePauseActor(backupAgent, db, pause)); - #line 45596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -} - -#line 4938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int a_body1loopBody1cont11(Void && _,int loopDepth) + { + #line 5816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("StopAfterSnapshot", stopWhenDone); + #line 5817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("SnapshotIntervalSeconds", snapshotInterval); + #line 5818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("LogBytesWritten", logBytesWritten); + #line 5819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("RangeBytesWritten", rangeBytesWritten); + #line 5821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (latestLogEnd.present()) + #line 53361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("LatestLogEnd", latestLogEnd.toJSON()); + #line 53365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (latestSnapshotEnd.present()) + #line 53369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("LatestSnapshotEnd", latestSnapshotEnd.toJSON()); + #line 53373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + JsonBuilderObject snapshot; + #line 5831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (snapshotBegin.present()) + #line 53379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshot.setKey("Begin", snapshotBegin.toJSON()); + #line 5834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (snapshotTargetEnd.present()) + #line 53385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshot.setKey("EndTarget", snapshotTargetEnd.toJSON()); + #line 5837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version interval = snapshotTargetEnd.version.get() - snapshotBegin.version.get(); + #line 5838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshot.setKey("IntervalSeconds", interval / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); + #line 5840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version elapsed = recentReadVersion - snapshotBegin.version.get(); + #line 5841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + double progress = (interval > 0) ? (100.0 * elapsed / interval) : 100; + #line 5842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshot.setKey("ExpectedProgress", progress); + #line 53399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + JsonBuilderObject dispatchDoc = snapshotLastDispatch.toJSON(); + #line 5846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (snapshotLastDispatchShardsBehind.present()) + #line 53405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + dispatchDoc.setKey("ShardsBehind", snapshotLastDispatchShardsBehind.get()); + #line 53409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshot.setKey("LastDispatch", dispatchDoc); + #line 53413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 5852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("CurrentSnapshot", snapshot); + #line 53417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont10(loopDepth); - struct TimestampedVersion { - Optional version; - Optional epochs; + return loopDepth; + } + int a_body1loopBody1cont5when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont11(_, loopDepth); - bool present() const { return version.present(); } + return loopDepth; + } + int a_body1loopBody1cont5when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont11(std::move(_), loopDepth); - JsonBuilderObject toJSON() const { - JsonBuilderObject doc; - if (version.present()) { - doc.setKey("Version", version.get()); - if (epochs.present()) { - doc.setKey("EpochSeconds", epochs.get()); - doc.setKey("Timestamp", timeStampToString(epochs)); - } - } - return doc; - } - }; + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStatusJSONActor, 3, Void >::remove(); - // Helper actor for generating status - // If f is present, lookup epochs using timekeeper and tr, return TimestampedVersion - #line 45622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via getTimestampedVersion() - #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class GetTimestampedVersionActorState { - #line 45628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -public: - #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - GetTimestampedVersionActorState(Reference const& tr,Future> const& f) - #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : tr(tr), - #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - f(f), - #line 4962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tv() - #line 45639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + void a_callback_fire(ActorCallback< GetStatusJSONActor, 3, Void >*,Void const& value) { - fdb_probe_actor_create("getTimestampedVersion", reinterpret_cast(this)); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont5when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 3); } - ~GetTimestampedVersionActorState() + void a_callback_fire(ActorCallback< GetStatusJSONActor, 3, Void >*,Void && value) { - fdb_probe_actor_destroy("getTimestampedVersion", reinterpret_cast(this)); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont5when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 3); } - int a_body1(int loopDepth=0) + void a_callback_error(ActorCallback< GetStatusJSONActor, 3, Void >*,Error err) { + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 3); + a_exitChoose4(); try { - #line 4963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = store(tv.version, f); - #line 4963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 45656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 4963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 45661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 3); - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~GetTimestampedVersionActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; } - int a_body1cont1(Void const& _,int loopDepth) + int a_body1loopBody1cont10cont1(KeyBackedMap>::RangeResultType const& errors,int loopDepth) { - #line 4964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (tv.version.present()) - #line 45684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 4965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = store(tv.epochs, timeKeeperEpochsFromVersion(tv.version.get(), tr)); - #line 4965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 45690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 4965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 45695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont2(loopDepth); + #line 5858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + JsonBuilderArray errorList; + #line 5859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto& e : errors.results ) { + #line 5860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string msg = e.second.first; + #line 5861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version ver = e.second.second; + #line 5863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + JsonBuilderObject errDoc; + #line 5864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + errDoc.setKey("Message", msg.c_str()); + #line 5865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + errDoc.setKey("RelativeSeconds", (ver - recentReadVersion) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); + #line 53501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } + #line 5868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("Errors", errorList); + #line 53505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1loopBody1cont10cont1(KeyBackedMap>::RangeResultType && errors,int loopDepth) { - #line 4964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (tv.version.present()) - #line 45709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 4965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = store(tv.epochs, timeKeeperEpochsFromVersion(tv.version.get(), tr)); - #line 4965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 45715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 4965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 45720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont2(loopDepth); + #line 5858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + JsonBuilderArray errorList; + #line 5859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto& e : errors.results ) { + #line 5860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string msg = e.second.first; + #line 5861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version ver = e.second.second; + #line 5863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + JsonBuilderObject errDoc; + #line 5864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + errDoc.setKey("Message", msg.c_str()); + #line 5865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + errDoc.setKey("RelativeSeconds", (ver - recentReadVersion) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); + #line 53526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } + #line 5868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + doc.setKey("Errors", errorList); + #line 53530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont10when1(KeyBackedMap>::RangeResultType const& errors,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + loopDepth = a_body1loopBody1cont10cont1(errors, loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1loopBody1cont10when1(KeyBackedMap>::RangeResultType && errors,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont10cont1(std::move(errors), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose5() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetTimestampedVersionActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStatusJSONActor, 4, KeyBackedMap>::RangeResultType >::remove(); } - void a_callback_fire(ActorCallback< GetTimestampedVersionActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetStatusJSONActor, 4, KeyBackedMap>::RangeResultType >*,KeyBackedMap>::RangeResultType const& value) { - fdb_probe_actor_enter("getTimestampedVersion", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1when1(value, 0); + a_body1loopBody1cont10when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getTimestampedVersion", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< GetTimestampedVersionActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetStatusJSONActor, 4, KeyBackedMap>::RangeResultType >*,KeyBackedMap>::RangeResultType && value) { - fdb_probe_actor_enter("getTimestampedVersion", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1cont10when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getTimestampedVersion", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< GetTimestampedVersionActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< GetStatusJSONActor, 4, KeyBackedMap>::RangeResultType >*,Error err) { - fdb_probe_actor_enter("getTimestampedVersion", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getTimestampedVersion", reinterpret_cast(this), 0); - - } - int a_body1cont2(int loopDepth) - { - #line 4967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(tv); this->~GetTimestampedVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 45797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< TimestampedVersion >::value()) TimestampedVersion(std::move(tv)); // state_var_RVO - this->~GetTimestampedVersionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 4); - return loopDepth; } - int a_body1cont3(Void const& _,int loopDepth) + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont3(Void && _,int loopDepth) + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont3(_, loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont3(std::move(_), loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose6() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetTimestampedVersionActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStatusJSONActor, 5, Void >::remove(); } - void a_callback_fire(ActorCallback< GetTimestampedVersionActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetStatusJSONActor, 5, Void >*,Void const& value) { - fdb_probe_actor_enter("getTimestampedVersion", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1cont1when1(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getTimestampedVersion", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 5); } - void a_callback_fire(ActorCallback< GetTimestampedVersionActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetStatusJSONActor, 5, Void >*,Void && value) { - fdb_probe_actor_enter("getTimestampedVersion", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1cont1when1(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getTimestampedVersion", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 5); } - void a_callback_error(ActorCallback< GetTimestampedVersionActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< GetStatusJSONActor, 5, Void >*,Error err) { - fdb_probe_actor_enter("getTimestampedVersion", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 5); + a_exitChoose6(); try { a_body1Catch1(err, 0); } @@ -45874,43 +53667,89 @@ class GetTimestampedVersionActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getTimestampedVersion", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 5); } - #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + FileBackupAgent* backupAgent; + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Database cx; + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string tagName; + #line 5728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Future> f; - #line 4962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TimestampedVersion tv; - #line 45886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + JsonBuilderObject doc; + #line 5738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyBackedTag tag; + #line 5739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional uidAndAbortedFlag; + #line 5740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional paused; + #line 5741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version recentReadVersion; + #line 5752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + BackupConfig config; + #line 5754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + EBackupState backupState; + #line 5763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Future done; + #line 5766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference bc; + #line 5767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TimestampedVersion latestRestorable; + #line 5790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t snapshotInterval; + #line 5791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t logBytesWritten; + #line 5792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t rangeBytesWritten; + #line 5793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool stopWhenDone; + #line 5794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TimestampedVersion snapshotBegin; + #line 5795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TimestampedVersion snapshotTargetEnd; + #line 5796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TimestampedVersion latestLogEnd; + #line 5797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TimestampedVersion latestSnapshotEnd; + #line 5798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TimestampedVersion snapshotLastDispatch; + #line 5799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional snapshotLastDispatchShardsBehind; + #line 53721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via getTimestampedVersion() - #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class GetTimestampedVersionActor final : public Actor, public ActorCallback< GetTimestampedVersionActor, 0, Void >, public ActorCallback< GetTimestampedVersionActor, 1, Void >, public FastAllocated, public GetTimestampedVersionActorState { - #line 45891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via getStatusJSON() + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class GetStatusJSONActor final : public Actor, public ActorCallback< GetStatusJSONActor, 0, Void >, public ActorCallback< GetStatusJSONActor, 1, EBackupState >, public ActorCallback< GetStatusJSONActor, 2, Void >, public ActorCallback< GetStatusJSONActor, 3, Void >, public ActorCallback< GetStatusJSONActor, 4, KeyBackedMap>::RangeResultType >, public ActorCallback< GetStatusJSONActor, 5, Void >, public FastAllocated, public GetStatusJSONActorState { + #line 53726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetTimestampedVersionActor, 0, Void >; -friend struct ActorCallback< GetTimestampedVersionActor, 1, Void >; - #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - GetTimestampedVersionActor(Reference const& tr,Future> const& f) - #line 45903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor(), - GetTimestampedVersionActorState(tr, f) +friend struct ActorCallback< GetStatusJSONActor, 0, Void >; +friend struct ActorCallback< GetStatusJSONActor, 1, EBackupState >; +friend struct ActorCallback< GetStatusJSONActor, 2, Void >; +friend struct ActorCallback< GetStatusJSONActor, 3, Void >; +friend struct ActorCallback< GetStatusJSONActor, 4, KeyBackedMap>::RangeResultType >; +friend struct ActorCallback< GetStatusJSONActor, 5, Void >; + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + GetStatusJSONActor(FileBackupAgent* const& backupAgent,Database const& cx,std::string const& tagName) + #line 53742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + GetStatusJSONActorState(backupAgent, cx, tagName) { - fdb_probe_actor_enter("getTimestampedVersion", reinterpret_cast(this), -1); + fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getTimestampedVersion"); + this->lineage.setActorName("getStatusJSON"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("getTimestampedVersion", reinterpret_cast(this), -1); + fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), -1); } void cancel() override @@ -45918,56 +53757,64 @@ friend struct ActorCallback< GetTimestampedVersionActor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetTimestampedVersionActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetTimestampedVersionActor, 1, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetStatusJSONActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetStatusJSONActor, 1, EBackupState >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetStatusJSONActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< GetStatusJSONActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< GetStatusJSONActor, 4, KeyBackedMap>::RangeResultType >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< GetStatusJSONActor, 5, Void >*)0, actor_cancelled()); break; } } }; - #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future getTimestampedVersion( Reference const& tr, Future> const& f ) { - #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new GetTimestampedVersionActor(tr, f)); - #line 45931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future getStatusJSON( FileBackupAgent* const& backupAgent, Database const& cx, std::string const& tagName ) { + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new GetStatusJSONActor(backupAgent, cx, tagName)); + #line 53774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 4969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 5877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 45936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via getStatusJSON() - #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class GetStatusJSONActorState { - #line 45942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 53779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via getStatus() + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class GetStatusActorState { + #line 53785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - GetStatusJSONActorState(FileBackupAgent* const& backupAgent,Database const& cx,std::string const& tagName) - #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + GetStatusActorState(FileBackupAgent* const& backupAgent,Database const& cx,ShowErrors const& showErrors,std::string const& tagName) + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" cx(cx), - #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + showErrors(showErrors), + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tagName(tagName), - #line 4971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr(new ReadYourWritesTransaction(cx)) - #line 45955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr(new ReadYourWritesTransaction(cx)), + #line 5883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText() + #line 53802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("getStatusJSON", reinterpret_cast(this)); + fdb_probe_actor_create("getStatus", reinterpret_cast(this)); } - ~GetStatusJSONActorState() + ~GetStatusActorState() { - fdb_probe_actor_destroy("getStatusJSON", reinterpret_cast(this)); + fdb_probe_actor_destroy("getStatus", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 4973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 45970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 53817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -45980,12 +53827,24 @@ class GetStatusJSONActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~GetStatusJSONActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~GetStatusActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } + int a_body1cont1(int loopDepth) + { + #line 6058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(statusText); this->~GetStatusActorState(); static_cast(this)->destroy(); return 0; } + #line 53840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< std::string >::value()) std::string(std::move(statusText)); // state_var_RVO + this->~GetStatusActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } int a_body1loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; @@ -45996,189 +53855,481 @@ class GetStatusJSONActorState { int a_body1loopBody1(int loopDepth) { try { - #line 4975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc = JsonBuilderObject(); - #line 4976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("SchemaVersion", "1.0.0"); - #line 4978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 4979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tag = KeyBackedTag(); + #line 5891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config = BackupConfig(); + #line 5892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backupState = EBackupState(); + #line 5894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText = ""; + #line 5895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tag = makeBackupTag(tagName); - #line 4982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - uidAndAbortedFlag = Optional(); - #line 4983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - paused = Optional(); - #line 4984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - recentReadVersion = Version(); - #line 4986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = store(paused, tr->get(backupAgent->taskBucket->getPauseKey())) && store(uidAndAbortedFlag, tag.get(tr)) && store(recentReadVersion, tr->getReadVersion()); - #line 4986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 46019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_0 = tag.get(tr); + #line 5896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 53876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 4986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 46024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 5896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 53881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 6054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_7 = tr->onError(e); + #line 6054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 53918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_7.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 8; + #line 6054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 53923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 5897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + fPaused = tr->get(backupAgent->taskBucket->getPauseKey()); + #line 5898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (uidAndAbortedFlag.present()) + #line 53940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config = BackupConfig(uidAndAbortedFlag.get().first); + #line 5900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = config.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); + #line 5900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 53948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 5900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 53953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont3(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& __uidAndAbortedFlag,int loopDepth) + { + #line 5896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + uidAndAbortedFlag = __uidAndAbortedFlag; + #line 53967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && __uidAndAbortedFlag,int loopDepth) + { + uidAndAbortedFlag = std::move(__uidAndAbortedFlag); + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStatusActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< GetStatusActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetStatusActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetStatusActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(int loopDepth) + { + #line 5905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!uidAndAbortedFlag.present() || backupState == EBackupState::STATE_NEVERRAN) + #line 54034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 5906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += "No previous backups found.\n"; + #line 54038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont6(loopDepth); + } + else + { + #line 5908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backupStatus = std::string(BackupAgentBase::getStateText(backupState)); + #line 5909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bc = Reference(); + #line 5910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + latestRestorableVersion = Optional(); + #line 5911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + recentReadVersion = Version(); + #line 5913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = store(latestRestorableVersion, config.getLatestRestorableVersion(tr)) && store(bc, config.backupContainer().getOrThrow(tr)) && store(recentReadVersion, tr->getReadVersion()); + #line 5913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 54055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 5913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 54060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } + + return loopDepth; + } + int a_body1loopBody1cont4(EBackupState const& status,int loopDepth) + { + #line 5902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backupState = status; + #line 54070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(EBackupState && status,int loopDepth) + { + #line 5902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + backupState = status; + #line 54079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(EBackupState const& status,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(status, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(EBackupState && status,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(status), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStatusActor, 1, EBackupState >::remove(); + + } + void a_callback_fire(ActorCallback< GetStatusActor, 1, EBackupState >*,EBackupState const& value) + { + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) + void a_callback_fire(ActorCallback< GetStatusActor, 1, EBackupState >*,EBackupState && value) { - if (loopDepth == 0) return a_body1loopHead1(0); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + void a_callback_error(ActorCallback< GetStatusActor, 1, EBackupState >*,Error err) { + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 1); + a_exitChoose2(); try { - #line 5116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_5 = tr->onError(e); - #line 5116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 46048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 5116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 46053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont6(int loopDepth) + { + #line 6047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_6 = fPaused; + #line 6047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 54153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 6047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 54158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont2(Void const& _,int loopDepth) + int a_body1loopBody1cont8(Void const& _,int loopDepth) { - #line 4989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("BackupAgentsPaused", paused.present()); - #line 4990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("Tag", tag.tagName); - #line 4992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (uidAndAbortedFlag.present()) - #line 46072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bc = fileBackup::getBackupContainerWithProxy(bc); + #line 5918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool snapshotProgress = false; + #line 5920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + switch (backupState) { case EBackupState::STATE_SUBMITTED: statusText += "The backup on tag `" + tagName + "' is in progress (just started) to " + bc->getURL() + ".\n"; break; case EBackupState::STATE_RUNNING: statusText += "The backup on tag `" + tagName + "' is in progress to " + bc->getURL() + ".\n"; snapshotProgress = true; break; case EBackupState::STATE_RUNNING_DIFFERENTIAL: statusText += "The backup on tag `" + tagName + "' is restorable but continuing to " + bc->getURL() + ".\n"; snapshotProgress = true; break; case EBackupState::STATE_COMPLETED: statusText += "The previous backup on tag `" + tagName + "' at " + bc->getURL() + " completed at version " + format("%lld", latestRestorableVersion.orDefault(-1)) + ".\n"; break; default: statusText += "The previous backup on tag `" + tagName + "' at " + bc->getURL() + " " + backupStatus + ".\n"; break; }; + #line 5944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += format("BackupUID: %s\n", uidAndAbortedFlag.get().first.toString().c_str()); + #line 5945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += format("BackupURL: %s\n", bc->getURL().c_str()); + #line 5947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (snapshotProgress) + #line 54177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("UID", uidAndAbortedFlag.get().first.toString()); - #line 4995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config = BackupConfig(uidAndAbortedFlag.get().first); - #line 4997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = config.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); - #line 4997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 46082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 4997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 46087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotInterval = int64_t(); + #line 5949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotBeginVersion = Version(); + #line 5950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotTargetEndVersion = Version(); + #line 5951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + latestSnapshotEndVersion = Optional(); + #line 5952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + latestLogEndVersion = Optional(); + #line 5953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + logBytesWritten = Optional(); + #line 5954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rangeBytesWritten = Optional(); + #line 5955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + latestSnapshotEndVersionTimestamp = Optional(); + #line 5956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + latestLogEndVersionTimestamp = Optional(); + #line 5957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotBeginVersionTimestamp = Optional(); + #line 5958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotTargetEndVersionTimestamp = Optional(); + #line 5959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + stopWhenDone = bool(); + #line 5961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = store(snapshotBeginVersion, config.snapshotBeginVersion().getOrThrow(tr)) && store(snapshotTargetEndVersion, config.snapshotTargetEndVersion().getOrThrow(tr)) && store(snapshotInterval, config.snapshotIntervalSeconds().getOrThrow(tr)) && store(logBytesWritten, config.logBytesWritten().get(tr)) && store(rangeBytesWritten, config.rangeBytesWritten().get(tr)) && store(latestLogEndVersion, config.latestLogEndVersion().get(tr)) && store(latestSnapshotEndVersion, config.latestSnapshotEndVersion().get(tr)) && store(stopWhenDone, config.stopWhenDone().getOrThrow(tr)); + #line 5961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 54207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont8when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 5961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 54212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1loopBody1cont3(loopDepth); + loopDepth = a_body1loopBody1cont9(loopDepth); } return loopDepth; } - int a_body1loopBody1cont2(Void && _,int loopDepth) + int a_body1loopBody1cont8(Void && _,int loopDepth) { - #line 4989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("BackupAgentsPaused", paused.present()); - #line 4990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("Tag", tag.tagName); - #line 4992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (uidAndAbortedFlag.present()) - #line 46105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bc = fileBackup::getBackupContainerWithProxy(bc); + #line 5918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bool snapshotProgress = false; + #line 5920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + switch (backupState) { case EBackupState::STATE_SUBMITTED: statusText += "The backup on tag `" + tagName + "' is in progress (just started) to " + bc->getURL() + ".\n"; break; case EBackupState::STATE_RUNNING: statusText += "The backup on tag `" + tagName + "' is in progress to " + bc->getURL() + ".\n"; snapshotProgress = true; break; case EBackupState::STATE_RUNNING_DIFFERENTIAL: statusText += "The backup on tag `" + tagName + "' is restorable but continuing to " + bc->getURL() + ".\n"; snapshotProgress = true; break; case EBackupState::STATE_COMPLETED: statusText += "The previous backup on tag `" + tagName + "' at " + bc->getURL() + " completed at version " + format("%lld", latestRestorableVersion.orDefault(-1)) + ".\n"; break; default: statusText += "The previous backup on tag `" + tagName + "' at " + bc->getURL() + " " + backupStatus + ".\n"; break; }; + #line 5944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += format("BackupUID: %s\n", uidAndAbortedFlag.get().first.toString().c_str()); + #line 5945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += format("BackupURL: %s\n", bc->getURL().c_str()); + #line 5947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (snapshotProgress) + #line 54236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 4993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("UID", uidAndAbortedFlag.get().first.toString()); - #line 4995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config = BackupConfig(uidAndAbortedFlag.get().first); - #line 4997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = config.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); - #line 4997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 46115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 4997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 46120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotInterval = int64_t(); + #line 5949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotBeginVersion = Version(); + #line 5950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotTargetEndVersion = Version(); + #line 5951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + latestSnapshotEndVersion = Optional(); + #line 5952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + latestLogEndVersion = Optional(); + #line 5953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + logBytesWritten = Optional(); + #line 5954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rangeBytesWritten = Optional(); + #line 5955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + latestSnapshotEndVersionTimestamp = Optional(); + #line 5956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + latestLogEndVersionTimestamp = Optional(); + #line 5957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotBeginVersionTimestamp = Optional(); + #line 5958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshotTargetEndVersionTimestamp = Optional(); + #line 5959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + stopWhenDone = bool(); + #line 5961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = store(snapshotBeginVersion, config.snapshotBeginVersion().getOrThrow(tr)) && store(snapshotTargetEndVersion, config.snapshotTargetEndVersion().getOrThrow(tr)) && store(snapshotInterval, config.snapshotIntervalSeconds().getOrThrow(tr)) && store(logBytesWritten, config.logBytesWritten().get(tr)) && store(rangeBytesWritten, config.rangeBytesWritten().get(tr)) && store(latestLogEndVersion, config.latestLogEndVersion().get(tr)) && store(latestSnapshotEndVersion, config.latestSnapshotEndVersion().get(tr)) && store(stopWhenDone, config.stopWhenDone().getOrThrow(tr)); + #line 5961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 54266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont8when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 5961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 54271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1loopBody1cont3(loopDepth); + loopDepth = a_body1loopBody1cont9(loopDepth); } return loopDepth; } - int a_body1loopBody1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont2(_, loopDepth); + loopDepth = a_body1loopBody1cont8(_, loopDepth); return loopDepth; } - int a_body1loopBody1when1(Void && _,int loopDepth) + int a_body1loopBody1cont3when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont8(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStatusJSONActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStatusActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< GetStatusJSONActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetStatusActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1when1(value, 0); + a_body1loopBody1cont3when1(value, 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< GetStatusJSONActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetStatusActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1loopBody1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< GetStatusJSONActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< GetStatusActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1loopBody1Catch1(err, 0); } @@ -46187,120 +54338,118 @@ class GetStatusJSONActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 0); - - } - int a_body1loopBody1cont3(int loopDepth) - { - #line 5114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(doc.getJson()); this->~GetStatusJSONActorState(); static_cast(this)->destroy(); return 0; } - #line 46197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< std::string >::value()) std::string(doc.getJson()); - this->~GetStatusJSONActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 2); - return loopDepth; } - int a_body1loopBody1cont4(int loopDepth) + int a_body1loopBody1cont9(int loopDepth) { - #line 4999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - JsonBuilderObject statusDoc; - #line 5000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusDoc.setKey("Name", BackupAgentBase::getStateName(backupState)); - #line 5001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusDoc.setKey("Description", BackupAgentBase::getStateText(backupState)); - #line 5002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusDoc.setKey("Completed", backupState == EBackupState::STATE_COMPLETED); - #line 5003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusDoc.setKey("Running", BackupAgentBase::isRunnable(backupState)); - #line 5004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("Status", statusDoc); - #line 5006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - done = Void(); - #line 5008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (backupState != EBackupState::STATE_NEVERRAN) - #line 46223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (showErrors) + #line 54348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bc = Reference(); - #line 5010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - latestRestorable = TimestampedVersion(); - #line 5012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = store(latestRestorable, getTimestampedVersion(tr, config.getLatestRestorableVersion(tr))) && store(bc, config.backupContainer().getOrThrow(tr)); - #line 5012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 46233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 5012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 46238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture>::RangeResultType> __when_expr_5 = config.lastErrorPerType().getRange( tr, 0, std::numeric_limits::max(), CLIENT_KNOBS->TOO_MANY); + #line 6008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 54354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont9when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 6008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast>::RangeResultType >*>(static_cast(this))); + #line 54359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1loopBody1cont5(loopDepth); + loopDepth = a_body1loopBody1cont11(loopDepth); } return loopDepth; } - int a_body1loopBody1cont2when1(EBackupState const& __backupState,int loopDepth) + int a_body1loopBody1cont10(Void const& _,int loopDepth) { - #line 4997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backupState = __backupState; - #line 46252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont4(loopDepth); + #line 5970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_4 = store(latestSnapshotEndVersionTimestamp, getTimestampFromVersion(latestSnapshotEndVersion, tr)) && store(latestLogEndVersionTimestamp, getTimestampFromVersion(latestLogEndVersion, tr)) && store(snapshotBeginVersionTimestamp, timeKeeperEpochsFromVersion(snapshotBeginVersion, tr)) && store(snapshotTargetEndVersionTimestamp, timeKeeperEpochsFromVersion(snapshotTargetEndVersion, tr)); + #line 5970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 54375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont10when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 5970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 54380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont2when1(EBackupState && __backupState,int loopDepth) + int a_body1loopBody1cont10(Void && _,int loopDepth) { - backupState = std::move(__backupState); - loopDepth = a_body1loopBody1cont4(loopDepth); + #line 5970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_4 = store(latestSnapshotEndVersionTimestamp, getTimestampFromVersion(latestSnapshotEndVersion, tr)) && store(latestLogEndVersionTimestamp, getTimestampFromVersion(latestLogEndVersion, tr)) && store(snapshotBeginVersionTimestamp, timeKeeperEpochsFromVersion(snapshotBeginVersion, tr)) && store(snapshotTargetEndVersionTimestamp, timeKeeperEpochsFromVersion(snapshotTargetEndVersion, tr)); + #line 5970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 54391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont10when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 5970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 54396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - void a_exitChoose2() + int a_body1loopBody1cont8when1(Void const& _,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStatusJSONActor, 1, EBackupState >::remove(); + loopDepth = a_body1loopBody1cont10(_, loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< GetStatusJSONActor, 1, EBackupState >*,EBackupState const& value) + int a_body1loopBody1cont8when1(Void && _,int loopDepth) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 1); - a_exitChoose2(); + loopDepth = a_body1loopBody1cont10(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStatusActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetStatusActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1loopBody1cont2when1(value, 0); + a_body1loopBody1cont8when1(value, 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< GetStatusJSONActor, 1, EBackupState >*,EBackupState && value) + void a_callback_fire(ActorCallback< GetStatusActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1loopBody1cont2when1(std::move(value), 0); + a_body1loopBody1cont8when1(std::move(value), 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< GetStatusJSONActor, 1, EBackupState >*,Error err) + void a_callback_error(ActorCallback< GetStatusActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1loopBody1Catch1(err, 0); } @@ -46309,168 +54458,111 @@ class GetStatusJSONActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 3); } - int a_body1loopBody1cont5(int loopDepth) + int a_body1loopBody1cont10cont1(Void const& _,int loopDepth) { - #line 5031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (backupState == EBackupState::STATE_RUNNING_DIFFERENTIAL || backupState == EBackupState::STATE_RUNNING) - #line 46319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += format("Snapshot interval is %lld seconds. ", snapshotInterval); + #line 5979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (backupState == EBackupState::STATE_RUNNING_DIFFERENTIAL) + #line 54470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotInterval = int64_t(); - #line 5034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - logBytesWritten = int64_t(); - #line 5035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - rangeBytesWritten = int64_t(); - #line 5036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - stopWhenDone = bool(); - #line 5037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotBegin = TimestampedVersion(); - #line 5038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotTargetEnd = TimestampedVersion(); - #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - latestLogEnd = TimestampedVersion(); - #line 5040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - latestSnapshotEnd = TimestampedVersion(); - #line 5041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotLastDispatch = TimestampedVersion(); - #line 5042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotLastDispatchShardsBehind = Optional(); - #line 5044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_3 = store(snapshotInterval, config.snapshotIntervalSeconds().getOrThrow(tr)) && store(logBytesWritten, config.logBytesWritten().getD(tr)) && store(rangeBytesWritten, config.rangeBytesWritten().getD(tr)) && store(stopWhenDone, config.stopWhenDone().getOrThrow(tr)) && store(snapshotBegin, getTimestampedVersion(tr, config.snapshotBeginVersion().get(tr))) && store(snapshotTargetEnd, getTimestampedVersion(tr, config.snapshotTargetEndVersion().get(tr))) && store(latestLogEnd, getTimestampedVersion(tr, config.latestLogEndVersion().get(tr))) && store(latestSnapshotEnd, getTimestampedVersion(tr, config.latestSnapshotEndVersion().get(tr))) && store(snapshotLastDispatch, getTimestampedVersion(tr, config.snapshotDispatchLastVersion().get(tr))) && store(snapshotLastDispatchShardsBehind, config.snapshotDispatchLastShardsBehind().get(tr)); - #line 5044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 46345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 5044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 46350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += format("Current snapshot progress target is %3.2f%% (>100%% means the " "snapshot is supposed to be done)\n", 100.0 * (recentReadVersion - snapshotBeginVersion) / (snapshotTargetEndVersion - snapshotBeginVersion)); + #line 54474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } else { - loopDepth = a_body1loopBody1cont10(loopDepth); + #line 5985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += "The initial snapshot is still running.\n"; + #line 54480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } + #line 5987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += format("\nDetails:\n LogBytes written - %lld\n RangeBytes written - %lld\n " "Last complete log version and timestamp - %s, %s\n " "Last complete snapshot version and timestamp - %s, %s\n " "Current Snapshot start version and timestamp - %s, %s\n " "Expected snapshot end version and timestamp - %s, %s\n " "Backup supposed to stop at next snapshot completion - %s\n", logBytesWritten.orDefault(0), rangeBytesWritten.orDefault(0), versionToString(latestLogEndVersion).c_str(), timeStampToString(latestLogEndVersionTimestamp).c_str(), versionToString(latestSnapshotEndVersion).c_str(), timeStampToString(latestSnapshotEndVersionTimestamp).c_str(), versionToString(snapshotBeginVersion).c_str(), timeStampToString(snapshotBeginVersionTimestamp).c_str(), versionToString(snapshotTargetEndVersion).c_str(), timeStampToString(snapshotTargetEndVersionTimestamp).c_str(), boolToYesOrNo(stopWhenDone).c_str()); + #line 54484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont9(loopDepth); return loopDepth; } - int a_body1loopBody1cont6(Void const& _,int loopDepth) + int a_body1loopBody1cont10cont1(Void && _,int loopDepth) { - #line 5015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bc = fileBackup::getBackupContainerWithProxy(bc); - #line 5017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("Restorable", latestRestorable.present()); - #line 5019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (latestRestorable.present()) - #line 46368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += format("Snapshot interval is %lld seconds. ", snapshotInterval); + #line 5979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (backupState == EBackupState::STATE_RUNNING_DIFFERENTIAL) + #line 54495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - JsonBuilderObject o = latestRestorable.toJSON(); - #line 5021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (backupState != EBackupState::STATE_COMPLETED) - #line 46374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - o.setKey("LagSeconds", (recentReadVersion - latestRestorable.version.get()) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); - #line 46378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 5026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("LatestRestorablePoint", o); - #line 46382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += format("Current snapshot progress target is %3.2f%% (>100%% means the " "snapshot is supposed to be done)\n", 100.0 * (recentReadVersion - snapshotBeginVersion) / (snapshotTargetEndVersion - snapshotBeginVersion)); + #line 54499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("DestinationURL", bc->getURL()); - #line 46386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont5(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont6(Void && _,int loopDepth) - { - #line 5015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bc = fileBackup::getBackupContainerWithProxy(bc); - #line 5017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("Restorable", latestRestorable.present()); - #line 5019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (latestRestorable.present()) - #line 46399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + else { - #line 5020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - JsonBuilderObject o = latestRestorable.toJSON(); - #line 5021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (backupState != EBackupState::STATE_COMPLETED) - #line 46405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - o.setKey("LagSeconds", (recentReadVersion - latestRestorable.version.get()) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); - #line 46409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 5026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("LatestRestorablePoint", o); - #line 46413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += "The initial snapshot is still running.\n"; + #line 54505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("DestinationURL", bc->getURL()); - #line 46417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont5(loopDepth); + #line 5987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += format("\nDetails:\n LogBytes written - %lld\n RangeBytes written - %lld\n " "Last complete log version and timestamp - %s, %s\n " "Last complete snapshot version and timestamp - %s, %s\n " "Current Snapshot start version and timestamp - %s, %s\n " "Expected snapshot end version and timestamp - %s, %s\n " "Backup supposed to stop at next snapshot completion - %s\n", logBytesWritten.orDefault(0), rangeBytesWritten.orDefault(0), versionToString(latestLogEndVersion).c_str(), timeStampToString(latestLogEndVersionTimestamp).c_str(), versionToString(latestSnapshotEndVersion).c_str(), timeStampToString(latestSnapshotEndVersionTimestamp).c_str(), versionToString(snapshotBeginVersion).c_str(), timeStampToString(snapshotBeginVersionTimestamp).c_str(), versionToString(snapshotTargetEndVersion).c_str(), timeStampToString(snapshotTargetEndVersionTimestamp).c_str(), boolToYesOrNo(stopWhenDone).c_str()); + #line 54509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1cont9(loopDepth); return loopDepth; } - int a_body1loopBody1cont4when1(Void const& _,int loopDepth) + int a_body1loopBody1cont10when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont6(_, loopDepth); + loopDepth = a_body1loopBody1cont10cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont4when1(Void && _,int loopDepth) + int a_body1loopBody1cont10when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont6(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont10cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose3() + void a_exitChoose5() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStatusJSONActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStatusActor, 4, Void >::remove(); } - void a_callback_fire(ActorCallback< GetStatusJSONActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetStatusActor, 4, Void >*,Void const& value) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1cont4when1(value, 0); + a_body1loopBody1cont10when1(value, 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< GetStatusJSONActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetStatusActor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1cont4when1(std::move(value), 0); + a_body1loopBody1cont10when1(std::move(value), 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< GetStatusJSONActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< GetStatusActor, 4, Void >*,Error err) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 4); + a_exitChoose5(); try { a_body1loopBody1Catch1(err, 0); } @@ -46479,223 +54571,183 @@ class GetStatusJSONActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 4); } - int a_body1loopBody1cont10(int loopDepth) + int a_body1loopBody1cont11(int loopDepth) { - #line 5098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture>::PairsType> __when_expr_4 = config.lastErrorPerType().getRange( tr, 0, std::numeric_limits::max(), CLIENT_KNOBS->TOO_MANY); - #line 5098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 46491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont10when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 5098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast>::PairsType >*>(static_cast(this))); - #line 46496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; } - int a_body1loopBody1cont11(Void const& _,int loopDepth) + int a_body1loopBody1cont12(KeyBackedMap>::RangeResultType const& errors,int loopDepth) { - #line 5059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("StopAfterSnapshot", stopWhenDone); - #line 5060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("SnapshotIntervalSeconds", snapshotInterval); - #line 5061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("LogBytesWritten", logBytesWritten); - #line 5062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("RangeBytesWritten", rangeBytesWritten); - #line 5064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (latestLogEnd.present()) - #line 46513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("LatestLogEnd", latestLogEnd.toJSON()); - #line 46517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 5068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (latestSnapshotEnd.present()) - #line 46521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("LatestSnapshotEnd", latestSnapshotEnd.toJSON()); - #line 46525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string recentErrors; + #line 6012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string pastErrors; + #line 6014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto& e : errors.results ) { + #line 6015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version v = e.second.second; + #line 6016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string msg = format( "%s ago : %s\n", secondsToTimeFormat((recentReadVersion - v) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND) .c_str(), e.second.first.c_str()); + #line 6024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (v >= latestRestorableVersion.orDefault(0)) + #line 54597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + recentErrors += msg; + #line 54601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + else + { + #line 6027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + pastErrors += msg; + #line 54607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } } - #line 5072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - JsonBuilderObject snapshot; - #line 5074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (snapshotBegin.present()) - #line 46531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!recentErrors.empty()) + #line 54612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshot.setKey("Begin", snapshotBegin.toJSON()); - #line 5077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (snapshotTargetEnd.present()) - #line 46537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (latestRestorableVersion.present()) + #line 54616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshot.setKey("EndTarget", snapshotTargetEnd.toJSON()); - #line 5080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version interval = snapshotTargetEnd.version.get() - snapshotBegin.version.get(); - #line 5081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshot.setKey("IntervalSeconds", interval / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); - #line 5083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version elapsed = recentReadVersion - snapshotBegin.version.get(); - #line 5084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - double progress = (interval > 0) ? (100.0 * elapsed / interval) : 100; - #line 5085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshot.setKey("ExpectedProgress", progress); - #line 46551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += format("Recent Errors (since latest restorable point %s ago)\n", secondsToTimeFormat((recentReadVersion - latestRestorableVersion.get()) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND) .c_str()) + recentErrors; + #line 54620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - JsonBuilderObject dispatchDoc = snapshotLastDispatch.toJSON(); - #line 5089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (snapshotLastDispatchShardsBehind.present()) - #line 46557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + else { - #line 5090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - dispatchDoc.setKey("ShardsBehind", snapshotLastDispatchShardsBehind.get()); - #line 46561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += "Recent Errors (since initialization)\n" + recentErrors; + #line 54626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshot.setKey("LastDispatch", dispatchDoc); - #line 46565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("CurrentSnapshot", snapshot); - #line 46569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont10(loopDepth); + #line 6042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!pastErrors.empty()) + #line 54631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += "Older Errors\n" + pastErrors; + #line 54635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + loopDepth = a_body1loopBody1cont11(loopDepth); return loopDepth; } - int a_body1loopBody1cont11(Void && _,int loopDepth) - { - #line 5059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("StopAfterSnapshot", stopWhenDone); - #line 5060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("SnapshotIntervalSeconds", snapshotInterval); - #line 5061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("LogBytesWritten", logBytesWritten); - #line 5062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("RangeBytesWritten", rangeBytesWritten); - #line 5064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (latestLogEnd.present()) - #line 46586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("LatestLogEnd", latestLogEnd.toJSON()); - #line 46590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 5068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (latestSnapshotEnd.present()) - #line 46594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("LatestSnapshotEnd", latestSnapshotEnd.toJSON()); - #line 46598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + int a_body1loopBody1cont12(KeyBackedMap>::RangeResultType && errors,int loopDepth) + { + #line 6011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string recentErrors; + #line 6012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string pastErrors; + #line 6014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto& e : errors.results ) { + #line 6015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version v = e.second.second; + #line 6016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string msg = format( "%s ago : %s\n", secondsToTimeFormat((recentReadVersion - v) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND) .c_str(), e.second.first.c_str()); + #line 6024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (v >= latestRestorableVersion.orDefault(0)) + #line 54655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + recentErrors += msg; + #line 54659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + else + { + #line 6027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + pastErrors += msg; + #line 54665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } } - #line 5072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - JsonBuilderObject snapshot; - #line 5074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (snapshotBegin.present()) - #line 46604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!recentErrors.empty()) + #line 54670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshot.setKey("Begin", snapshotBegin.toJSON()); - #line 5077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (snapshotTargetEnd.present()) - #line 46610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (latestRestorableVersion.present()) + #line 54674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshot.setKey("EndTarget", snapshotTargetEnd.toJSON()); - #line 5080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version interval = snapshotTargetEnd.version.get() - snapshotBegin.version.get(); - #line 5081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshot.setKey("IntervalSeconds", interval / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); - #line 5083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version elapsed = recentReadVersion - snapshotBegin.version.get(); - #line 5084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - double progress = (interval > 0) ? (100.0 * elapsed / interval) : 100; - #line 5085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshot.setKey("ExpectedProgress", progress); - #line 46624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += format("Recent Errors (since latest restorable point %s ago)\n", secondsToTimeFormat((recentReadVersion - latestRestorableVersion.get()) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND) .c_str()) + recentErrors; + #line 54678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - JsonBuilderObject dispatchDoc = snapshotLastDispatch.toJSON(); - #line 5089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (snapshotLastDispatchShardsBehind.present()) - #line 46630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + else { - #line 5090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - dispatchDoc.setKey("ShardsBehind", snapshotLastDispatchShardsBehind.get()); - #line 46634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += "Recent Errors (since initialization)\n" + recentErrors; + #line 54684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshot.setKey("LastDispatch", dispatchDoc); - #line 46638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("CurrentSnapshot", snapshot); - #line 46642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont10(loopDepth); + #line 6042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!pastErrors.empty()) + #line 54689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += "Older Errors\n" + pastErrors; + #line 54693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + loopDepth = a_body1loopBody1cont11(loopDepth); return loopDepth; } - int a_body1loopBody1cont5when1(Void const& _,int loopDepth) + int a_body1loopBody1cont9when1(KeyBackedMap>::RangeResultType const& errors,int loopDepth) { - loopDepth = a_body1loopBody1cont11(_, loopDepth); + loopDepth = a_body1loopBody1cont12(errors, loopDepth); return loopDepth; } - int a_body1loopBody1cont5when1(Void && _,int loopDepth) + int a_body1loopBody1cont9when1(KeyBackedMap>::RangeResultType && errors,int loopDepth) { - loopDepth = a_body1loopBody1cont11(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont12(std::move(errors), loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose6() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStatusJSONActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStatusActor, 5, KeyBackedMap>::RangeResultType >::remove(); } - void a_callback_fire(ActorCallback< GetStatusJSONActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetStatusActor, 5, KeyBackedMap>::RangeResultType >*,KeyBackedMap>::RangeResultType const& value) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1loopBody1cont5when1(value, 0); + a_body1loopBody1cont9when1(value, 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 5); } - void a_callback_fire(ActorCallback< GetStatusJSONActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetStatusActor, 5, KeyBackedMap>::RangeResultType >*,KeyBackedMap>::RangeResultType && value) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1loopBody1cont5when1(std::move(value), 0); + a_body1loopBody1cont9when1(std::move(value), 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 5); } - void a_callback_error(ActorCallback< GetStatusJSONActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< GetStatusActor, 5, KeyBackedMap>::RangeResultType >*,Error err) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 5); + a_exitChoose6(); try { a_body1loopBody1Catch1(err, 0); } @@ -46704,111 +54756,89 @@ class GetStatusJSONActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 5); } - int a_body1loopBody1cont10cont1(KeyBackedMap>::PairsType const& errors,int loopDepth) + int a_body1loopBody1cont13(Optional const& paused,int loopDepth) { - #line 5101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - JsonBuilderArray errorList; - #line 5102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for( auto& e : errors ) { - #line 5103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string msg = e.second.first; - #line 5104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version ver = e.second.second; - #line 5106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - JsonBuilderObject errDoc; - #line 5107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - errDoc.setKey("Message", msg.c_str()); - #line 5108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - errDoc.setKey("RelativeSeconds", (ver - recentReadVersion) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); - #line 46726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (paused.present()) + #line 54766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += format("\nAll backup agents have been paused.\n"); + #line 54770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("Errors", errorList); - #line 46730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); + return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1loopBody1cont10cont1(KeyBackedMap>::PairsType && errors,int loopDepth) + int a_body1loopBody1cont13(Optional && paused,int loopDepth) { - #line 5101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - JsonBuilderArray errorList; - #line 5102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for( auto& e : errors ) { - #line 5103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string msg = e.second.first; - #line 5104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version ver = e.second.second; - #line 5106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - JsonBuilderObject errDoc; - #line 5107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - errDoc.setKey("Message", msg.c_str()); - #line 5108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - errDoc.setKey("RelativeSeconds", (ver - recentReadVersion) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); - #line 46751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (paused.present()) + #line 54780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + statusText += format("\nAll backup agents have been paused.\n"); + #line 54784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - doc.setKey("Errors", errorList); - #line 46755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); + return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1loopBody1cont10when1(KeyBackedMap>::PairsType const& errors,int loopDepth) + int a_body1loopBody1cont6when1(Optional const& paused,int loopDepth) { - loopDepth = a_body1loopBody1cont10cont1(errors, loopDepth); + loopDepth = a_body1loopBody1cont13(paused, loopDepth); return loopDepth; } - int a_body1loopBody1cont10when1(KeyBackedMap>::PairsType && errors,int loopDepth) + int a_body1loopBody1cont6when1(Optional && paused,int loopDepth) { - loopDepth = a_body1loopBody1cont10cont1(std::move(errors), loopDepth); + loopDepth = a_body1loopBody1cont13(std::move(paused), loopDepth); return loopDepth; } - void a_exitChoose5() + void a_exitChoose7() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStatusJSONActor, 4, KeyBackedMap>::PairsType >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStatusActor, 6, Optional >::remove(); } - void a_callback_fire(ActorCallback< GetStatusJSONActor, 4, KeyBackedMap>::PairsType >*,KeyBackedMap>::PairsType const& value) + void a_callback_fire(ActorCallback< GetStatusActor, 6, Optional >*,Optional const& value) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 6); + a_exitChoose7(); try { - a_body1loopBody1cont10when1(value, 0); + a_body1loopBody1cont6when1(value, 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 6); } - void a_callback_fire(ActorCallback< GetStatusJSONActor, 4, KeyBackedMap>::PairsType >*,KeyBackedMap>::PairsType && value) + void a_callback_fire(ActorCallback< GetStatusActor, 6, Optional >*,Optional && value) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 6); + a_exitChoose7(); try { - a_body1loopBody1cont10when1(std::move(value), 0); + a_body1loopBody1cont6when1(std::move(value), 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 6); } - void a_callback_error(ActorCallback< GetStatusJSONActor, 4, KeyBackedMap>::PairsType >*,Error err) + void a_callback_error(ActorCallback< GetStatusActor, 6, Optional >*,Error err) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 6); + a_exitChoose7(); try { a_body1loopBody1Catch1(err, 0); } @@ -46817,7 +54847,7 @@ class GetStatusJSONActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 6); } int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) @@ -46844,16 +54874,16 @@ class GetStatusJSONActorState { return loopDepth; } - void a_exitChoose6() + void a_exitChoose8() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStatusJSONActor, 5, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStatusActor, 7, Void >::remove(); } - void a_callback_fire(ActorCallback< GetStatusJSONActor, 5, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetStatusActor, 7, Void >*,Void const& value) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 7); + a_exitChoose8(); try { a_body1loopBody1Catch1when1(value, 0); } @@ -46862,13 +54892,13 @@ class GetStatusJSONActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 5); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 7); } - void a_callback_fire(ActorCallback< GetStatusJSONActor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetStatusActor, 7, Void >*,Void && value) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 7); + a_exitChoose8(); try { a_body1loopBody1Catch1when1(std::move(value), 0); } @@ -46877,13 +54907,13 @@ class GetStatusJSONActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 5); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 7); } - void a_callback_error(ActorCallback< GetStatusJSONActor, 5, Void >*,Error err) + void a_callback_error(ActorCallback< GetStatusActor, 7, Void >*,Error err) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 7); + a_exitChoose8(); try { a_body1Catch1(err, 0); } @@ -46892,89 +54922,97 @@ class GetStatusJSONActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), 5); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 7); } - #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" FileBackupAgent* backupAgent; - #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ShowErrors showErrors; + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::string tagName; - #line 4971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 4975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - JsonBuilderObject doc; - #line 4981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string statusText; + #line 5890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyBackedTag tag; - #line 4982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional uidAndAbortedFlag; - #line 4983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional paused; - #line 4984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version recentReadVersion; - #line 4995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig config; - #line 4997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" EBackupState backupState; - #line 5006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Future done; - #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional uidAndAbortedFlag; + #line 5897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Future> fPaused; + #line 5908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + std::string backupStatus; + #line 5909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference bc; - #line 5010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TimestampedVersion latestRestorable; - #line 5033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional latestRestorableVersion; + #line 5911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version recentReadVersion; + #line 5948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int64_t snapshotInterval; - #line 5034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int64_t logBytesWritten; - #line 5035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int64_t rangeBytesWritten; - #line 5036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 5949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version snapshotBeginVersion; + #line 5950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version snapshotTargetEndVersion; + #line 5951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional latestSnapshotEndVersion; + #line 5952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional latestLogEndVersion; + #line 5953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional logBytesWritten; + #line 5954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional rangeBytesWritten; + #line 5955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional latestSnapshotEndVersionTimestamp; + #line 5956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional latestLogEndVersionTimestamp; + #line 5957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional snapshotBeginVersionTimestamp; + #line 5958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional snapshotTargetEndVersionTimestamp; + #line 5959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bool stopWhenDone; - #line 5037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TimestampedVersion snapshotBegin; - #line 5038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TimestampedVersion snapshotTargetEnd; - #line 5039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TimestampedVersion latestLogEnd; - #line 5040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TimestampedVersion latestSnapshotEnd; - #line 5041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TimestampedVersion snapshotLastDispatch; - #line 5042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional snapshotLastDispatchShardsBehind; - #line 46946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 54982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via getStatusJSON() - #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class GetStatusJSONActor final : public Actor, public ActorCallback< GetStatusJSONActor, 0, Void >, public ActorCallback< GetStatusJSONActor, 1, EBackupState >, public ActorCallback< GetStatusJSONActor, 2, Void >, public ActorCallback< GetStatusJSONActor, 3, Void >, public ActorCallback< GetStatusJSONActor, 4, KeyBackedMap>::PairsType >, public ActorCallback< GetStatusJSONActor, 5, Void >, public FastAllocated, public GetStatusJSONActorState { - #line 46951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via getStatus() + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class GetStatusActor final : public Actor, public ActorCallback< GetStatusActor, 0, Optional >, public ActorCallback< GetStatusActor, 1, EBackupState >, public ActorCallback< GetStatusActor, 2, Void >, public ActorCallback< GetStatusActor, 3, Void >, public ActorCallback< GetStatusActor, 4, Void >, public ActorCallback< GetStatusActor, 5, KeyBackedMap>::RangeResultType >, public ActorCallback< GetStatusActor, 6, Optional >, public ActorCallback< GetStatusActor, 7, Void >, public FastAllocated, public GetStatusActorState { + #line 54987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetStatusJSONActor, 0, Void >; -friend struct ActorCallback< GetStatusJSONActor, 1, EBackupState >; -friend struct ActorCallback< GetStatusJSONActor, 2, Void >; -friend struct ActorCallback< GetStatusJSONActor, 3, Void >; -friend struct ActorCallback< GetStatusJSONActor, 4, KeyBackedMap>::PairsType >; -friend struct ActorCallback< GetStatusJSONActor, 5, Void >; - #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - GetStatusJSONActor(FileBackupAgent* const& backupAgent,Database const& cx,std::string const& tagName) - #line 46967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +friend struct ActorCallback< GetStatusActor, 0, Optional >; +friend struct ActorCallback< GetStatusActor, 1, EBackupState >; +friend struct ActorCallback< GetStatusActor, 2, Void >; +friend struct ActorCallback< GetStatusActor, 3, Void >; +friend struct ActorCallback< GetStatusActor, 4, Void >; +friend struct ActorCallback< GetStatusActor, 5, KeyBackedMap>::RangeResultType >; +friend struct ActorCallback< GetStatusActor, 6, Optional >; +friend struct ActorCallback< GetStatusActor, 7, Void >; + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + GetStatusActor(FileBackupAgent* const& backupAgent,Database const& cx,ShowErrors const& showErrors,std::string const& tagName) + #line 55005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), - GetStatusJSONActorState(backupAgent, cx, tagName) + GetStatusActorState(backupAgent, cx, showErrors, tagName) { - fdb_probe_actor_enter("getStatusJSON", reinterpret_cast(this), -1); + fdb_probe_actor_enter("getStatus", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getStatusJSON"); + this->lineage.setActorName("getStatus"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("getStatusJSON", reinterpret_cast(this), -1); + fdb_probe_actor_exit("getStatus", reinterpret_cast(this), -1); } void cancel() override @@ -46982,65 +55020,74 @@ friend struct ActorCallback< GetStatusJSONActor, 5, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetStatusJSONActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetStatusJSONActor, 1, EBackupState >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< GetStatusJSONActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< GetStatusJSONActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< GetStatusJSONActor, 4, KeyBackedMap>::PairsType >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< GetStatusJSONActor, 5, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetStatusActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetStatusActor, 1, EBackupState >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetStatusActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< GetStatusActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< GetStatusActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< GetStatusActor, 5, KeyBackedMap>::RangeResultType >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< GetStatusActor, 6, Optional >*)0, actor_cancelled()); break; + case 8: this->a_callback_error((ActorCallback< GetStatusActor, 7, Void >*)0, actor_cancelled()); break; } } }; - #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future getStatusJSON( FileBackupAgent* const& backupAgent, Database const& cx, std::string const& tagName ) { - #line 4970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new GetStatusJSONActor(backupAgent, cx, tagName)); - #line 46999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future getStatus( FileBackupAgent* const& backupAgent, Database const& cx, ShowErrors const& showErrors, std::string const& tagName ) { + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new GetStatusActor(backupAgent, cx, showErrors, tagName)); + #line 55039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 5120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 6060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 47004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via getStatus() - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class GetStatusActorState { - #line 47010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 55044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via getLastRestorable() + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class GetLastRestorableActorState { + #line 55050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - GetStatusActorState(FileBackupAgent* const& backupAgent,Database const& cx,ShowErrors const& showErrors,std::string const& tagName) - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + GetLastRestorableActorState(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName,Snapshot const& snapshot) + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - cx(cx), - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - showErrors(showErrors), - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr(tr), + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tagName(tagName), - #line 5125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr(new ReadYourWritesTransaction(cx)), - #line 5126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText() - #line 47027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + snapshot(snapshot) + #line 55063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("getStatus", reinterpret_cast(this)); + fdb_probe_actor_create("getLastRestorable", reinterpret_cast(this)); } - ~GetStatusActorState() + ~GetLastRestorableActorState() { - fdb_probe_actor_destroy("getStatus", reinterpret_cast(this)); + fdb_probe_actor_destroy("getLastRestorable", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 5128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 47042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); + #line 6065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 6066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 6067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_0 = tr->get(backupAgent->lastRestorable.pack(tagName), snapshot); + #line 6067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 55084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 6067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 55089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -47052,1093 +55099,1070 @@ class GetStatusActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~GetStatusActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~GetLastRestorableActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 5301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(statusText); this->~GetStatusActorState(); static_cast(this)->destroy(); return 0; } - #line 47065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< std::string >::value()) std::string(std::move(statusText)); // state_var_RVO - this->~GetStatusActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 6069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)((version.present()) ? Optional(BinaryReader::fromStringRef(version.get(), Unversioned())) : Optional()); this->~GetLastRestorableActorState(); static_cast(this)->destroy(); return 0; } + #line 55112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional((version.present()) ? Optional(BinaryReader::fromStringRef(version.get(), Unversioned())) : Optional()); + this->~GetLastRestorableActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1loopHead1(int loopDepth) + int a_body1when1(Optional const& __version,int loopDepth) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + #line 6067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + version = __version; + #line 55124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1(int loopDepth) + int a_body1when1(Optional && __version,int loopDepth) + { + version = std::move(__version); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetLastRestorableActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< GetLastRestorableActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("getLastRestorable", reinterpret_cast(this), 0); + a_exitChoose1(); try { - #line 5130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 5131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 5133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tag = KeyBackedTag(); - #line 5134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config = BackupConfig(); - #line 5135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backupState = EBackupState(); - #line 5137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText = ""; - #line 5138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tag = makeBackupTag(tagName); - #line 5139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_0 = tag.get(tr); - #line 5139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 47101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 5139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 47106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + a_body1when1(value, 0); } catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("getLastRestorable", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1break1(int loopDepth) + void a_callback_fire(ActorCallback< GetLastRestorableActor, 0, Optional >*,Optional && value) { + fdb_probe_actor_enter("getLastRestorable", reinterpret_cast(this), 0); + a_exitChoose1(); try { - return a_body1cont1(loopDepth); + a_body1when1(std::move(value), 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("getLastRestorable", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) + void a_callback_error(ActorCallback< GetLastRestorableActor, 0, Optional >*,Error err) { - if (loopDepth == 0) return a_body1loopHead1(0); + fdb_probe_actor_enter("getLastRestorable", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getLastRestorable", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + FileBackupAgent* backupAgent; + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key tagName; + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Snapshot snapshot; + #line 6067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional version; + #line 55197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via getLastRestorable() + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class GetLastRestorableActor final : public Actor>, public ActorCallback< GetLastRestorableActor, 0, Optional >, public FastAllocated, public GetLastRestorableActorState { + #line 55202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetLastRestorableActor, 0, Optional >; + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + GetLastRestorableActor(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName,Snapshot const& snapshot) + #line 55213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor>(), + GetLastRestorableActorState(backupAgent, tr, tagName, snapshot) + { + fdb_probe_actor_enter("getLastRestorable", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getLastRestorable"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getLastRestorable", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetLastRestorableActor, 0, Optional >*)0, actor_cancelled()); break; + } + + } +}; + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future> getLastRestorable( FileBackupAgent* const& backupAgent, Reference const& tr, Key const& tagName, Snapshot const& snapshot ) { + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future>(new GetLastRestorableActor(backupAgent, tr, tagName, snapshot)); + #line 55240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 6073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + static StringRef read(StringRef& data, int bytes) { + if (bytes > data.size()) + throw restore_error(); + StringRef r = data.substr(0, bytes); + data = data.substr(bytes); + return r; + } + + // Submits the restore request to the database and throws "restore_invalid_version" error if + // restore is not possible. Parameters: + // cx: the database to be restored to + // cxOrig: if present, is used to resolve the restore timestamp into a version. + // tagName: restore tag + // url: the backup container's URL that contains all backup files + // ranges: the restored key ranges; if empty, restore all key ranges in the backup + // waitForComplete: if set, wait until the restore is completed before returning; otherwise, + // return when the request is submitted to the database. + // targetVersion: the version to be restored. + // verbose: print verbose information. + // addPrefix: each key is added this prefix during restore. + // removePrefix: for each key to be restored, remove this prefix first. + // lockDB: if set lock the database with randomUid before performing restore; + // otherwise, check database is locked with the randomUid + // onlyApplyMutationLogs: only perform incremental restore, by only applying mutation logs + // inconsistentSnapshotOnly: Ignore mutation log files during the restore to speedup the process. + // When set to true, gives an inconsistent snapshot, thus not recommended + // beginVersions: restore's begin version for each range + // randomUid: the UID for lock the database + #line 55273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via restore() + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class RestoreActorState { + #line 55279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + RestoreActorState(FileBackupAgent* const& backupAgent,Database const& cx,Optional const& cxOrig,Key const& tagName,Key const& url,Optional const& proxy,Standalone> const& ranges,Standalone> const& beginVersions,WaitForComplete const& waitForComplete,Version const& targetVersion,Verbose const& verbose,Key const& addPrefix,Key const& removePrefix,LockDB const& lockDB,UnlockDB const& unlockDB,OnlyApplyMutationLogs const& onlyApplyMutationLogs,InconsistentSnapshotOnly const& inconsistentSnapshotOnly,Optional const& encryptionKeyFileName,UID const& randomUid) + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : backupAgent(backupAgent), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + cx(cx), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + cxOrig(cxOrig), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tagName(tagName), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + url(url), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + proxy(proxy), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ranges(ranges), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginVersions(beginVersions), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + waitForComplete(waitForComplete), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + targetVersion(targetVersion), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + verbose(verbose), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + addPrefix(addPrefix), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + removePrefix(removePrefix), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + lockDB(lockDB), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + unlockDB(unlockDB), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + onlyApplyMutationLogs(onlyApplyMutationLogs), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + inconsistentSnapshotOnly(inconsistentSnapshotOnly), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + encryptionKeyFileName(encryptionKeyFileName), + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + randomUid(randomUid) + #line 55322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("restore", reinterpret_cast(this)); + + } + ~RestoreActorState() + { + fdb_probe_actor_destroy("restore", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) { try { - #line 5297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_7 = tr->onError(e); - #line 5297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 47143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_7.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 8; - #line 5297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 47148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (ranges.empty()) + #line 55337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(restore_error(), loopDepth); + #line 55341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 6126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bc = IBackupContainer::openContainer(url.toString(), proxy, {}); + #line 6128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = bc->describeBackup(true); + #line 6128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 55349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 6128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1loopBody1cont2(int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - #line 5140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - fPaused = tr->get(backupAgent->taskBucket->getPauseKey()); - #line 5141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (uidAndAbortedFlag.present()) - #line 47165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + this->~RestoreActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 6129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (cxOrig.present()) + #line 55377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - config = BackupConfig(uidAndAbortedFlag.get().first); - #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = config.stateEnum().getD(tr, Snapshot::False, EBackupState::STATE_NEVERRAN); - #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 47173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 47178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = desc.resolveVersionTimes(cxOrig.get()); + #line 6130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 55383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 6130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1loopBody1cont3(loopDepth); + loopDepth = a_body1cont3(loopDepth); } return loopDepth; } - int a_body1loopBody1when1(Optional const& __uidAndAbortedFlag,int loopDepth) + int a_body1when1(BackupDescription const& __desc,int loopDepth) { - #line 5139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - uidAndAbortedFlag = __uidAndAbortedFlag; - #line 47192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont2(loopDepth); + #line 6128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + desc = __desc; + #line 55402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1when1(Optional && __uidAndAbortedFlag,int loopDepth) + int a_body1when1(BackupDescription && __desc,int loopDepth) { - uidAndAbortedFlag = std::move(__uidAndAbortedFlag); - loopDepth = a_body1loopBody1cont2(loopDepth); + desc = std::move(__desc); + loopDepth = a_body1cont1(loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStatusActor, 0, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RestoreActor, 0, BackupDescription >::remove(); } - void a_callback_fire(ActorCallback< GetStatusActor, 0, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< RestoreActor, 0, BackupDescription >*,BackupDescription const& value) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 0); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 0); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetStatusActor, 0, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< RestoreActor, 0, BackupDescription >*,BackupDescription && value) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 0); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 0); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetStatusActor, 0, Optional >*,Error err) + void a_callback_error(ActorCallback< RestoreActor, 0, BackupDescription >*,Error err) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 0); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 0); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 0); } - int a_body1loopBody1cont3(int loopDepth) + int a_body1cont3(int loopDepth) { - #line 5148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!uidAndAbortedFlag.present() || backupState == EBackupState::STATE_NEVERRAN) - #line 47259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + printf("Backup Description\n%s", desc.toString().c_str()); + #line 6134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (targetVersion == invalidVersion && desc.maxRestorableVersion.present()) + #line 55471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += "No previous backups found.\n"; - #line 47263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont6(loopDepth); + #line 6135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + targetVersion = desc.maxRestorableVersion.get(); + #line 55475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - else + #line 6137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (targetVersion == invalidVersion && onlyApplyMutationLogs && desc.contiguousLogEnd.present()) + #line 55479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backupStatus = std::string(BackupAgentBase::getStateText(backupState)); - #line 5152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bc = Reference(); - #line 5153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - latestRestorableVersion = Optional(); - #line 5154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - recentReadVersion = Version(); - #line 5156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = store(latestRestorableVersion, config.getLatestRestorableVersion(tr)) && store(bc, config.backupContainer().getOrThrow(tr)) && store(recentReadVersion, tr->getReadVersion()); - #line 5156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 47280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 5156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 47285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 6138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + targetVersion = desc.contiguousLogEnd.get() - 1; + #line 55483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 6141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginVersion = invalidVersion; + #line 6142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!beginVersions.empty()) + #line 55489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + beginVersion = *std::min_element(beginVersions.begin(), beginVersions.end()); + #line 55493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } + #line 6145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_2 = bc->getRestoreSet(targetVersion, ranges, onlyApplyMutationLogs, beginVersion); + #line 6145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 55499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 6145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 55504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont4(EBackupState const& status,int loopDepth) + int a_body1cont4(Void const& _,int loopDepth) { - #line 5145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backupState = status; - #line 47295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); + loopDepth = a_body1cont3(loopDepth); return loopDepth; } - int a_body1loopBody1cont4(EBackupState && status,int loopDepth) + int a_body1cont4(Void && _,int loopDepth) { - #line 5145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - backupState = status; - #line 47304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); + loopDepth = a_body1cont3(loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(EBackupState const& status,int loopDepth) + int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(status, loopDepth); + loopDepth = a_body1cont4(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(EBackupState && status,int loopDepth) + int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(std::move(status), loopDepth); + loopDepth = a_body1cont4(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStatusActor, 1, EBackupState >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RestoreActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< GetStatusActor, 1, EBackupState >*,EBackupState const& value) + void a_callback_fire(ActorCallback< RestoreActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 1); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1cont2when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 1); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< GetStatusActor, 1, EBackupState >*,EBackupState && value) + void a_callback_fire(ActorCallback< RestoreActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 1); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1cont2when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 1); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< GetStatusActor, 1, EBackupState >*,Error err) + void a_callback_error(ActorCallback< RestoreActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 1); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 1); - - } - int a_body1loopBody1cont6(int loopDepth) - { - #line 5290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_6 = fPaused; - #line 5290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 47378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 5290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 47383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_exit("restore", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1loopBody1cont8(Void const& _,int loopDepth) + int a_body1cont5(Optional const& restoreSet,int loopDepth) { - #line 5159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bc = fileBackup::getBackupContainerWithProxy(bc); - #line 5161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bool snapshotProgress = false; - #line 5163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - switch (backupState) { case EBackupState::STATE_SUBMITTED: statusText += "The backup on tag `" + tagName + "' is in progress (just started) to " + bc->getURL() + ".\n"; break; case EBackupState::STATE_RUNNING: statusText += "The backup on tag `" + tagName + "' is in progress to " + bc->getURL() + ".\n"; snapshotProgress = true; break; case EBackupState::STATE_RUNNING_DIFFERENTIAL: statusText += "The backup on tag `" + tagName + "' is restorable but continuing to " + bc->getURL() + ".\n"; snapshotProgress = true; break; case EBackupState::STATE_COMPLETED: statusText += "The previous backup on tag `" + tagName + "' at " + bc->getURL() + " completed at version " + format("%lld", latestRestorableVersion.orDefault(-1)) + ".\n"; break; default: statusText += "The previous backup on tag `" + tagName + "' at " + bc->getURL() + " " + backupStatus + ".\n"; break; }; - #line 5187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += format("BackupUID: %s\n", uidAndAbortedFlag.get().first.toString().c_str()); - #line 5188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += format("BackupURL: %s\n", bc->getURL().c_str()); - #line 5190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (snapshotProgress) - #line 47402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!restoreSet.present()) + #line 55588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotInterval = int64_t(); - #line 5192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotBeginVersion = Version(); - #line 5193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotTargetEndVersion = Version(); - #line 5194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - latestSnapshotEndVersion = Optional(); - #line 5195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - latestLogEndVersion = Optional(); - #line 5196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - logBytesWritten = Optional(); - #line 5197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - rangeBytesWritten = Optional(); - #line 5198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - latestSnapshotEndVersionTimestamp = Optional(); - #line 5199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - latestLogEndVersionTimestamp = Optional(); - #line 5200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotBeginVersionTimestamp = Optional(); - #line 5201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotTargetEndVersionTimestamp = Optional(); - #line 5202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - stopWhenDone = bool(); - #line 5204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_3 = store(snapshotBeginVersion, config.snapshotBeginVersion().getOrThrow(tr)) && store(snapshotTargetEndVersion, config.snapshotTargetEndVersion().getOrThrow(tr)) && store(snapshotInterval, config.snapshotIntervalSeconds().getOrThrow(tr)) && store(logBytesWritten, config.logBytesWritten().get(tr)) && store(rangeBytesWritten, config.rangeBytesWritten().get(tr)) && store(latestLogEndVersion, config.latestLogEndVersion().get(tr)) && store(latestSnapshotEndVersion, config.latestSnapshotEndVersion().get(tr)) && store(stopWhenDone, config.stopWhenDone().getOrThrow(tr)); - #line 5204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 47432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont8when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 5204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 47437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevWarn, "FileBackupAgentRestoreNotPossible") .detail("BackupContainer", bc->getURL()) .detail("BeginVersion", beginVersion) .detail("TargetVersion", targetVersion); + #line 6153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + fmt::print(stderr, "ERROR: Restore version {0} is not possible from {1}\n", targetVersion, bc->getURL()); + #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(restore_invalid_version(), loopDepth); + #line 55596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 6157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (verbose) + #line 55600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + printf("Restoring backup to version: %lld\n", (long long)targetVersion); + #line 55604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 6163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (onlyApplyMutationLogs) + #line 55608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = preloadApplyMutationsKeyVersionMap(cx, randomUid, ranges, beginVersions); + #line 6164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 55614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 6164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1loopBody1cont9(loopDepth); + loopDepth = a_body1cont9(loopDepth); } return loopDepth; } - int a_body1loopBody1cont8(Void && _,int loopDepth) + int a_body1cont5(Optional && restoreSet,int loopDepth) { - #line 5159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bc = fileBackup::getBackupContainerWithProxy(bc); - #line 5161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bool snapshotProgress = false; - #line 5163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - switch (backupState) { case EBackupState::STATE_SUBMITTED: statusText += "The backup on tag `" + tagName + "' is in progress (just started) to " + bc->getURL() + ".\n"; break; case EBackupState::STATE_RUNNING: statusText += "The backup on tag `" + tagName + "' is in progress to " + bc->getURL() + ".\n"; snapshotProgress = true; break; case EBackupState::STATE_RUNNING_DIFFERENTIAL: statusText += "The backup on tag `" + tagName + "' is restorable but continuing to " + bc->getURL() + ".\n"; snapshotProgress = true; break; case EBackupState::STATE_COMPLETED: statusText += "The previous backup on tag `" + tagName + "' at " + bc->getURL() + " completed at version " + format("%lld", latestRestorableVersion.orDefault(-1)) + ".\n"; break; default: statusText += "The previous backup on tag `" + tagName + "' at " + bc->getURL() + " " + backupStatus + ".\n"; break; }; - #line 5187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += format("BackupUID: %s\n", uidAndAbortedFlag.get().first.toString().c_str()); - #line 5188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += format("BackupURL: %s\n", bc->getURL().c_str()); - #line 5190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (snapshotProgress) - #line 47461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!restoreSet.present()) + #line 55633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotInterval = int64_t(); - #line 5192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotBeginVersion = Version(); - #line 5193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotTargetEndVersion = Version(); - #line 5194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - latestSnapshotEndVersion = Optional(); - #line 5195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - latestLogEndVersion = Optional(); - #line 5196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - logBytesWritten = Optional(); - #line 5197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - rangeBytesWritten = Optional(); - #line 5198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - latestSnapshotEndVersionTimestamp = Optional(); - #line 5199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - latestLogEndVersionTimestamp = Optional(); - #line 5200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotBeginVersionTimestamp = Optional(); - #line 5201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshotTargetEndVersionTimestamp = Optional(); - #line 5202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - stopWhenDone = bool(); - #line 5204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_3 = store(snapshotBeginVersion, config.snapshotBeginVersion().getOrThrow(tr)) && store(snapshotTargetEndVersion, config.snapshotTargetEndVersion().getOrThrow(tr)) && store(snapshotInterval, config.snapshotIntervalSeconds().getOrThrow(tr)) && store(logBytesWritten, config.logBytesWritten().get(tr)) && store(rangeBytesWritten, config.rangeBytesWritten().get(tr)) && store(latestLogEndVersion, config.latestLogEndVersion().get(tr)) && store(latestSnapshotEndVersion, config.latestSnapshotEndVersion().get(tr)) && store(stopWhenDone, config.stopWhenDone().getOrThrow(tr)); - #line 5204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 47491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont8when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 5204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 47496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent(SevWarn, "FileBackupAgentRestoreNotPossible") .detail("BackupContainer", bc->getURL()) .detail("BeginVersion", beginVersion) .detail("TargetVersion", targetVersion); + #line 6153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + fmt::print(stderr, "ERROR: Restore version {0} is not possible from {1}\n", targetVersion, bc->getURL()); + #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(restore_invalid_version(), loopDepth); + #line 55641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 6157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (verbose) + #line 55645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + printf("Restoring backup to version: %lld\n", (long long)targetVersion); + #line 55649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 6163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (onlyApplyMutationLogs) + #line 55653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = preloadApplyMutationsKeyVersionMap(cx, randomUid, ranges, beginVersions); + #line 6164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 55659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 6164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1loopBody1cont9(loopDepth); + loopDepth = a_body1cont9(loopDepth); } return loopDepth; } - int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + int a_body1cont3when1(Optional const& restoreSet,int loopDepth) { - loopDepth = a_body1loopBody1cont8(_, loopDepth); + loopDepth = a_body1cont5(restoreSet, loopDepth); return loopDepth; } - int a_body1loopBody1cont3when1(Void && _,int loopDepth) + int a_body1cont3when1(Optional && restoreSet,int loopDepth) { - loopDepth = a_body1loopBody1cont8(std::move(_), loopDepth); + loopDepth = a_body1cont5(std::move(restoreSet), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStatusActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RestoreActor, 2, Optional >::remove(); } - void a_callback_fire(ActorCallback< GetStatusActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< RestoreActor, 2, Optional >*,Optional const& value) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 2); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont3when1(value, 0); + a_body1cont3when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 2); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< GetStatusActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< RestoreActor, 2, Optional >*,Optional && value) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 2); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont3when1(std::move(value), 0); + a_body1cont3when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 2); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< GetStatusActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< RestoreActor, 2, Optional >*,Error err) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 2); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 2); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 2); } - int a_body1loopBody1cont9(int loopDepth) + int a_body1cont9(int loopDepth) { - #line 5250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (showErrors) - #line 47573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture>::PairsType> __when_expr_5 = config.lastErrorPerType().getRange( tr, 0, std::numeric_limits::max(), CLIENT_KNOBS->TOO_MANY); - #line 5251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 47579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont9when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 5251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast>::PairsType >*>(static_cast(this))); - #line 47584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1loopBody1cont11(loopDepth); - } + #line 6167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr = Reference(new ReadYourWritesTransaction(cx)); + #line 6168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 55743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont9loopHead1(loopDepth); return loopDepth; } - int a_body1loopBody1cont10(Void const& _,int loopDepth) + int a_body1cont12(Void const& _,int loopDepth) { - #line 5213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = store(latestSnapshotEndVersionTimestamp, getTimestampFromVersion(latestSnapshotEndVersion, tr)) && store(latestLogEndVersionTimestamp, getTimestampFromVersion(latestLogEndVersion, tr)) && store(snapshotBeginVersionTimestamp, timeKeeperEpochsFromVersion(snapshotBeginVersion, tr)) && store(snapshotTargetEndVersionTimestamp, timeKeeperEpochsFromVersion(snapshotTargetEndVersion, tr)); - #line 5213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 47600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont10when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 5213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 47605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1cont9(loopDepth); return loopDepth; } - int a_body1loopBody1cont10(Void && _,int loopDepth) + int a_body1cont12(Void && _,int loopDepth) { - #line 5213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = store(latestSnapshotEndVersionTimestamp, getTimestampFromVersion(latestSnapshotEndVersion, tr)) && store(latestLogEndVersionTimestamp, getTimestampFromVersion(latestLogEndVersion, tr)) && store(snapshotBeginVersionTimestamp, timeKeeperEpochsFromVersion(snapshotBeginVersion, tr)) && store(snapshotTargetEndVersionTimestamp, timeKeeperEpochsFromVersion(snapshotTargetEndVersion, tr)); - #line 5213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 47616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont10when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 5213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 47621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1cont9(loopDepth); return loopDepth; } - int a_body1loopBody1cont8when1(Void const& _,int loopDepth) + int a_body1cont5when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont10(_, loopDepth); + loopDepth = a_body1cont12(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont8when1(Void && _,int loopDepth) + int a_body1cont5when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont10(std::move(_), loopDepth); + loopDepth = a_body1cont12(std::move(_), loopDepth); return loopDepth; } void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStatusActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RestoreActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< GetStatusActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< RestoreActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 3); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1loopBody1cont8when1(value, 0); + a_body1cont5when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 3); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< GetStatusActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< RestoreActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 3); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1loopBody1cont8when1(std::move(value), 0); + a_body1cont5when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 3); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< GetStatusActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< RestoreActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 3); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 3); - - } - int a_body1loopBody1cont10cont1(Void const& _,int loopDepth) - { - #line 5221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += format("Snapshot interval is %lld seconds. ", snapshotInterval); - #line 5222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (backupState == EBackupState::STATE_RUNNING_DIFFERENTIAL) - #line 47695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += format("Current snapshot progress target is %3.2f%% (>100%% means the " "snapshot is supposed to be done)\n", 100.0 * (recentReadVersion - snapshotBeginVersion) / (snapshotTargetEndVersion - snapshotBeginVersion)); - #line 47699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - else - { - #line 5228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += "The initial snapshot is still running.\n"; - #line 47705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + a_body1Catch1(unknown_error(), 0); } - #line 5230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += format("\nDetails:\n LogBytes written - %lld\n RangeBytes written - %lld\n " "Last complete log version and timestamp - %s, %s\n " "Last complete snapshot version and timestamp - %s, %s\n " "Current Snapshot start version and timestamp - %s, %s\n " "Expected snapshot end version and timestamp - %s, %s\n " "Backup supposed to stop at next snapshot completion - %s\n", logBytesWritten.orDefault(0), rangeBytesWritten.orDefault(0), versionToString(latestLogEndVersion).c_str(), timeStampToString(latestLogEndVersionTimestamp).c_str(), versionToString(latestSnapshotEndVersion).c_str(), timeStampToString(latestSnapshotEndVersionTimestamp).c_str(), versionToString(snapshotBeginVersion).c_str(), timeStampToString(snapshotBeginVersionTimestamp).c_str(), versionToString(snapshotTargetEndVersion).c_str(), timeStampToString(snapshotTargetEndVersionTimestamp).c_str(), boolToYesOrNo(stopWhenDone).c_str()); - #line 47709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont9(loopDepth); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1loopBody1cont10cont1(Void && _,int loopDepth) + int a_body1cont13(int loopDepth) { - #line 5221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += format("Snapshot interval is %lld seconds. ", snapshotInterval); - #line 5222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (backupState == EBackupState::STATE_RUNNING_DIFFERENTIAL) - #line 47720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (waitForComplete) + #line 55827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += format("Current snapshot progress target is %3.2f%% (>100%% means the " "snapshot is supposed to be done)\n", 100.0 * (recentReadVersion - snapshotBeginVersion) / (snapshotTargetEndVersion - snapshotBeginVersion)); - #line 47724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_7 = waitRestore(cx, tagName, verbose); + #line 6198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 55833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont13when1(__when_expr_7.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 8; + #line 6198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } else { - #line 5228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += "The initial snapshot is still running.\n"; - #line 47730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont13cont1(loopDepth); } - #line 5230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += format("\nDetails:\n LogBytes written - %lld\n RangeBytes written - %lld\n " "Last complete log version and timestamp - %s, %s\n " "Last complete snapshot version and timestamp - %s, %s\n " "Current Snapshot start version and timestamp - %s, %s\n " "Expected snapshot end version and timestamp - %s, %s\n " "Backup supposed to stop at next snapshot completion - %s\n", logBytesWritten.orDefault(0), rangeBytesWritten.orDefault(0), versionToString(latestLogEndVersion).c_str(), timeStampToString(latestLogEndVersionTimestamp).c_str(), versionToString(latestSnapshotEndVersion).c_str(), timeStampToString(latestSnapshotEndVersionTimestamp).c_str(), versionToString(snapshotBeginVersion).c_str(), timeStampToString(snapshotBeginVersionTimestamp).c_str(), versionToString(snapshotTargetEndVersion).c_str(), timeStampToString(snapshotTargetEndVersionTimestamp).c_str(), boolToYesOrNo(stopWhenDone).c_str()); - #line 47734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont9(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont10when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont10cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont10when1(Void && _,int loopDepth) + int a_body1cont9loopHead1(int loopDepth) { - loopDepth = a_body1loopBody1cont10cont1(std::move(_), loopDepth); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont9loopBody1(loopDepth); return loopDepth; } - void a_exitChoose5() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStatusActor, 4, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GetStatusActor, 4, Void >*,Void const& value) - { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1loopBody1cont10when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 4); - - } - void a_callback_fire(ActorCallback< GetStatusActor, 4, Void >*,Void && value) + int a_body1cont9loopBody1(int loopDepth) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 4); - a_exitChoose5(); try { - a_body1loopBody1cont10when1(std::move(value), 0); + #line 6170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 6171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 6172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_4 = submitRestore(backupAgent, tr, tagName, url, proxy, ranges, targetVersion, addPrefix, removePrefix, lockDB, unlockDB, onlyApplyMutationLogs, inconsistentSnapshotOnly, beginVersion, randomUid); + #line 6172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont9loopBody1Catch1(actor_cancelled(), loopDepth); + #line 55866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont9loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont9loopBody1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 6172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1cont9loopBody1Catch1(error, loopDepth); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1cont9loopBody1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 4); + return loopDepth; } - void a_callback_error(ActorCallback< GetStatusActor, 4, Void >*,Error err) + int a_body1cont9break1(int loopDepth) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 4); - a_exitChoose5(); try { - a_body1loopBody1Catch1(err, 0); + return a_body1cont13(loopDepth); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 4); + return loopDepth; } - int a_body1loopBody1cont11(int loopDepth) + int a_body1cont9loopBody1cont1(int loopDepth) { - loopDepth = a_body1loopBody1cont6(loopDepth); + if (loopDepth == 0) return a_body1cont9loopHead1(0); return loopDepth; } - int a_body1loopBody1cont12(KeyBackedMap>::PairsType const& errors,int loopDepth) + int a_body1cont9loopBody1Catch1(const Error& e,int loopDepth=0) { - #line 5254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string recentErrors; - #line 5255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string pastErrors; - #line 5257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for( auto& e : errors ) { - #line 5258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version v = e.second.second; - #line 5259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string msg = format( "%s ago : %s\n", secondsToTimeFormat((recentReadVersion - v) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND) .c_str(), e.second.first.c_str()); - #line 5267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (v >= latestRestorableVersion.orDefault(0)) - #line 47822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - recentErrors += msg; - #line 47826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - else - { - #line 5270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - pastErrors += msg; - #line 47832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - } - #line 5274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!recentErrors.empty()) - #line 47837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (latestRestorableVersion.present()) - #line 47841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += format("Recent Errors (since latest restorable point %s ago)\n", secondsToTimeFormat((recentReadVersion - latestRestorableVersion.get()) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND) .c_str()) + recentErrors; - #line 47845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - else + try { + #line 6190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (e.code() == error_code_restore_duplicate_tag) + #line 55906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += "Recent Errors (since initialization)\n" + recentErrors; - #line 47851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 55910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } + #line 6193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_6 = tr->onError(e); + #line 6193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 55916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1cont9loopBody1Catch1when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 6193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } - #line 5285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!pastErrors.empty()) - #line 47856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += "Older Errors\n" + pastErrors; - #line 47860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } - loopDepth = a_body1loopBody1cont11(loopDepth); return loopDepth; } - int a_body1loopBody1cont12(KeyBackedMap>::PairsType && errors,int loopDepth) + int a_body1cont9loopBody1cont2(Void const& _,int loopDepth) { - #line 5254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string recentErrors; - #line 5255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string pastErrors; - #line 5257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for( auto& e : errors ) { - #line 5258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version v = e.second.second; - #line 5259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string msg = format( "%s ago : %s\n", secondsToTimeFormat((recentReadVersion - v) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND) .c_str(), e.second.first.c_str()); - #line 5267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (v >= latestRestorableVersion.orDefault(0)) - #line 47880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - recentErrors += msg; - #line 47884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - else - { - #line 5270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - pastErrors += msg; - #line 47890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - } - #line 5274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!recentErrors.empty()) - #line 47895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (latestRestorableVersion.present()) - #line 47899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += format("Recent Errors (since latest restorable point %s ago)\n", secondsToTimeFormat((recentReadVersion - latestRestorableVersion.get()) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND) .c_str()) + recentErrors; - #line 47903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - else - { - #line 5283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += "Recent Errors (since initialization)\n" + recentErrors; - #line 47909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - } - #line 5285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!pastErrors.empty()) - #line 47914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += "Older Errors\n" + pastErrors; - #line 47918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - loopDepth = a_body1loopBody1cont11(loopDepth); + #line 6187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_5 = tr->commit(); + #line 6187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont9loopBody1Catch1(actor_cancelled(), loopDepth); + #line 55938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont9loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont9loopBody1cont2when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 6187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont9when1(KeyBackedMap>::PairsType const& errors,int loopDepth) + int a_body1cont9loopBody1cont2(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont12(errors, loopDepth); + #line 6187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_5 = tr->commit(); + #line 6187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont9loopBody1Catch1(actor_cancelled(), loopDepth); + #line 55954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont9loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont9loopBody1cont2when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 6187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont9when1(KeyBackedMap>::PairsType && errors,int loopDepth) + int a_body1cont9loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont12(std::move(errors), loopDepth); + loopDepth = a_body1cont9loopBody1cont2(_, loopDepth); return loopDepth; } - void a_exitChoose6() + int a_body1cont9loopBody1when1(Void && _,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStatusActor, 5, KeyBackedMap>::PairsType >::remove(); + loopDepth = a_body1cont9loopBody1cont2(std::move(_), loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< GetStatusActor, 5, KeyBackedMap>::PairsType >*,KeyBackedMap>::PairsType const& value) + void a_exitChoose5() { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 5); - a_exitChoose6(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RestoreActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RestoreActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("restore", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1cont9when1(value, 0); + a_body1cont9loopBody1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont9loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont9loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 5); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< GetStatusActor, 5, KeyBackedMap>::PairsType >*,KeyBackedMap>::PairsType && value) + void a_callback_fire(ActorCallback< RestoreActor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1cont9when1(std::move(value), 0); + a_body1cont9loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont9loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont9loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 5); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< GetStatusActor, 5, KeyBackedMap>::PairsType >*,Error err) + void a_callback_error(ActorCallback< RestoreActor, 4, Void >*,Error err) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1Catch1(err, 0); + a_body1cont9loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont9loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont9loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 5); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 4); } - int a_body1loopBody1cont13(Optional const& paused,int loopDepth) + int a_body1cont9loopBody1cont3(Void const& _,int loopDepth) { - #line 5291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (paused.present()) - #line 47991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += format("\nAll backup agents have been paused.\n"); - #line 47995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + return a_body1cont9break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1loopBody1cont13(Optional && paused,int loopDepth) + int a_body1cont9loopBody1cont3(Void && _,int loopDepth) { - #line 5291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (paused.present()) - #line 48005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - statusText += format("\nAll backup agents have been paused.\n"); - #line 48009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + return a_body1cont9break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1loopBody1cont6when1(Optional const& paused,int loopDepth) + int a_body1cont9loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont13(paused, loopDepth); + loopDepth = a_body1cont9loopBody1cont3(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont6when1(Optional && paused,int loopDepth) + int a_body1cont9loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont13(std::move(paused), loopDepth); + loopDepth = a_body1cont9loopBody1cont3(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose7() + void a_exitChoose6() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStatusActor, 6, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RestoreActor, 5, Void >::remove(); } - void a_callback_fire(ActorCallback< GetStatusActor, 6, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< RestoreActor, 5, Void >*,Void const& value) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1loopBody1cont6when1(value, 0); + a_body1cont9loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont9loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont9loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 6); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 5); } - void a_callback_fire(ActorCallback< GetStatusActor, 6, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< RestoreActor, 5, Void >*,Void && value) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1loopBody1cont6when1(std::move(value), 0); + a_body1cont9loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont9loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont9loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 6); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 5); } - void a_callback_error(ActorCallback< GetStatusActor, 6, Optional >*,Error err) + void a_callback_error(ActorCallback< RestoreActor, 5, Void >*,Error err) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1loopBody1Catch1(err, 0); + a_body1cont9loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont9loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont9loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 6); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 5); } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1cont9loopBody1Catch1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont9loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1cont9loopBody1Catch1cont1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont9loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont9loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + loopDepth = a_body1cont9loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1cont9loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont9loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose8() + void a_exitChoose7() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStatusActor, 7, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RestoreActor, 6, Void >::remove(); } - void a_callback_fire(ActorCallback< GetStatusActor, 7, Void >*,Void const& value) + void a_callback_fire(ActorCallback< RestoreActor, 6, Void >*,Void const& value) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 7); - a_exitChoose8(); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 6); + a_exitChoose7(); try { - a_body1loopBody1Catch1when1(value, 0); + a_body1cont9loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 7); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 6); } - void a_callback_fire(ActorCallback< GetStatusActor, 7, Void >*,Void && value) + void a_callback_fire(ActorCallback< RestoreActor, 6, Void >*,Void && value) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 7); - a_exitChoose8(); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 6); + a_exitChoose7(); try { - a_body1loopBody1Catch1when1(std::move(value), 0); + a_body1cont9loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 7); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 6); } - void a_callback_error(ActorCallback< GetStatusActor, 7, Void >*,Error err) + void a_callback_error(ActorCallback< RestoreActor, 6, Void >*,Error err) { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), 7); - a_exitChoose8(); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 6); + a_exitChoose7(); try { a_body1Catch1(err, 0); } @@ -48147,257 +56171,101 @@ class GetStatusActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), 7); - - } - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - FileBackupAgent* backupAgent; - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Database cx; - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ShowErrors showErrors; - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string tagName; - #line 5125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference tr; - #line 5126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string statusText; - #line 5133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - KeyBackedTag tag; - #line 5134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - BackupConfig config; - #line 5135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - EBackupState backupState; - #line 5139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional uidAndAbortedFlag; - #line 5140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Future> fPaused; - #line 5151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - std::string backupStatus; - #line 5152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference bc; - #line 5153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional latestRestorableVersion; - #line 5154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version recentReadVersion; - #line 5191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - int64_t snapshotInterval; - #line 5192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version snapshotBeginVersion; - #line 5193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version snapshotTargetEndVersion; - #line 5194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional latestSnapshotEndVersion; - #line 5195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional latestLogEndVersion; - #line 5196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional logBytesWritten; - #line 5197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional rangeBytesWritten; - #line 5198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional latestSnapshotEndVersionTimestamp; - #line 5199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional latestLogEndVersionTimestamp; - #line 5200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional snapshotBeginVersionTimestamp; - #line 5201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional snapshotTargetEndVersionTimestamp; - #line 5202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bool stopWhenDone; - #line 48207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -}; -// This generated class is to be used only via getStatus() - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class GetStatusActor final : public Actor, public ActorCallback< GetStatusActor, 0, Optional >, public ActorCallback< GetStatusActor, 1, EBackupState >, public ActorCallback< GetStatusActor, 2, Void >, public ActorCallback< GetStatusActor, 3, Void >, public ActorCallback< GetStatusActor, 4, Void >, public ActorCallback< GetStatusActor, 5, KeyBackedMap>::PairsType >, public ActorCallback< GetStatusActor, 6, Optional >, public ActorCallback< GetStatusActor, 7, Void >, public FastAllocated, public GetStatusActorState { - #line 48212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< GetStatusActor, 0, Optional >; -friend struct ActorCallback< GetStatusActor, 1, EBackupState >; -friend struct ActorCallback< GetStatusActor, 2, Void >; -friend struct ActorCallback< GetStatusActor, 3, Void >; -friend struct ActorCallback< GetStatusActor, 4, Void >; -friend struct ActorCallback< GetStatusActor, 5, KeyBackedMap>::PairsType >; -friend struct ActorCallback< GetStatusActor, 6, Optional >; -friend struct ActorCallback< GetStatusActor, 7, Void >; - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - GetStatusActor(FileBackupAgent* const& backupAgent,Database const& cx,ShowErrors const& showErrors,std::string const& tagName) - #line 48230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor(), - GetStatusActorState(backupAgent, cx, showErrors, tagName) - { - fdb_probe_actor_enter("getStatus", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getStatus"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("getStatus", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetStatusActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetStatusActor, 1, EBackupState >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< GetStatusActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< GetStatusActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< GetStatusActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< GetStatusActor, 5, KeyBackedMap>::PairsType >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< GetStatusActor, 6, Optional >*)0, actor_cancelled()); break; - case 8: this->a_callback_error((ActorCallback< GetStatusActor, 7, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future getStatus( FileBackupAgent* const& backupAgent, Database const& cx, ShowErrors const& showErrors, std::string const& tagName ) { - #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new GetStatusActor(backupAgent, cx, showErrors, tagName)); - #line 48264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -} - -#line 5303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - - #line 48269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via getLastRestorable() - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class GetLastRestorableActorState { - #line 48275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -public: - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - GetLastRestorableActorState(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName,Snapshot const& snapshot) - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : backupAgent(backupAgent), - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr(tr), - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tagName(tagName), - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - snapshot(snapshot) - #line 48288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - fdb_probe_actor_create("getLastRestorable", reinterpret_cast(this)); - - } - ~GetLastRestorableActorState() - { - fdb_probe_actor_destroy("getLastRestorable", reinterpret_cast(this)); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 6); } - int a_body1(int loopDepth=0) + int a_body1cont13cont1(int loopDepth) { - try { - #line 5308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 5309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 5310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_0 = tr->get(backupAgent->lastRestorable.pack(tagName), snapshot); - #line 5310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 48309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 5310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 48314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } + #line 6203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(targetVersion); this->~RestoreActorState(); static_cast(this)->destroy(); return 0; } + #line 56181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(std::move(targetVersion)); // state_var_RVO + this->~RestoreActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) + int a_body1cont13cont2(ERestoreState const& finalState,int loopDepth) { - this->~GetLastRestorableActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; + #line 6199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (finalState != ERestoreState::COMPLETED) + #line 56193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(restore_error(), loopDepth); + #line 56197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + loopDepth = a_body1cont13cont1(loopDepth); return loopDepth; } - int a_body1cont1(int loopDepth) + int a_body1cont13cont2(ERestoreState && finalState,int loopDepth) { - #line 5312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)((version.present()) ? Optional(BinaryReader::fromStringRef(version.get(), Unversioned())) : Optional()); this->~GetLastRestorableActorState(); static_cast(this)->destroy(); return 0; } - #line 48337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional((version.present()) ? Optional(BinaryReader::fromStringRef(version.get(), Unversioned())) : Optional()); - this->~GetLastRestorableActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 6199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (finalState != ERestoreState::COMPLETED) + #line 56207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1Catch1(restore_error(), loopDepth); + #line 56211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + loopDepth = a_body1cont13cont1(loopDepth); return loopDepth; } - int a_body1when1(Optional const& __version,int loopDepth) + int a_body1cont13when1(ERestoreState const& finalState,int loopDepth) { - #line 5310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - version = __version; - #line 48349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); + loopDepth = a_body1cont13cont2(finalState, loopDepth); return loopDepth; } - int a_body1when1(Optional && __version,int loopDepth) + int a_body1cont13when1(ERestoreState && finalState,int loopDepth) { - version = std::move(__version); - loopDepth = a_body1cont1(loopDepth); + loopDepth = a_body1cont13cont2(std::move(finalState), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose8() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetLastRestorableActor, 0, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RestoreActor, 7, ERestoreState >::remove(); } - void a_callback_fire(ActorCallback< GetLastRestorableActor, 0, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< RestoreActor, 7, ERestoreState >*,ERestoreState const& value) { - fdb_probe_actor_enter("getLastRestorable", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 7); + a_exitChoose8(); try { - a_body1when1(value, 0); + a_body1cont13when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getLastRestorable", reinterpret_cast(this), 0); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 7); } - void a_callback_fire(ActorCallback< GetLastRestorableActor, 0, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< RestoreActor, 7, ERestoreState >*,ERestoreState && value) { - fdb_probe_actor_enter("getLastRestorable", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 7); + a_exitChoose8(); try { - a_body1when1(std::move(value), 0); + a_body1cont13when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getLastRestorable", reinterpret_cast(this), 0); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 7); } - void a_callback_error(ActorCallback< GetLastRestorableActor, 0, Optional >*,Error err) + void a_callback_error(ActorCallback< RestoreActor, 7, ERestoreState >*,Error err) { - fdb_probe_actor_enter("getLastRestorable", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("restore", reinterpret_cast(this), 7); + a_exitChoose8(); try { a_body1Catch1(err, 0); } @@ -48406,46 +56274,89 @@ class GetLastRestorableActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getLastRestorable", reinterpret_cast(this), 0); + fdb_probe_actor_exit("restore", reinterpret_cast(this), 7); } - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" FileBackupAgent* backupAgent; - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference tr; - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Database cx; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional cxOrig; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key tagName; - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Snapshot snapshot; - #line 5310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional version; - #line 48422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key url; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional proxy; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Standalone> ranges; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Standalone> beginVersions; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + WaitForComplete waitForComplete; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version targetVersion; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Verbose verbose; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key addPrefix; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key removePrefix; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + LockDB lockDB; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + UnlockDB unlockDB; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + OnlyApplyMutationLogs onlyApplyMutationLogs; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + InconsistentSnapshotOnly inconsistentSnapshotOnly; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Optional encryptionKeyFileName; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + UID randomUid; + #line 6126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference bc; + #line 6128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + BackupDescription desc; + #line 6141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version beginVersion; + #line 6167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 56326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via getLastRestorable() - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class GetLastRestorableActor final : public Actor>, public ActorCallback< GetLastRestorableActor, 0, Optional >, public FastAllocated, public GetLastRestorableActorState { - #line 48427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via restore() + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class RestoreActor final : public Actor, public ActorCallback< RestoreActor, 0, BackupDescription >, public ActorCallback< RestoreActor, 1, Void >, public ActorCallback< RestoreActor, 2, Optional >, public ActorCallback< RestoreActor, 3, Void >, public ActorCallback< RestoreActor, 4, Void >, public ActorCallback< RestoreActor, 5, Void >, public ActorCallback< RestoreActor, 6, Void >, public ActorCallback< RestoreActor, 7, ERestoreState >, public FastAllocated, public RestoreActorState { + #line 56331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetLastRestorableActor, 0, Optional >; - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - GetLastRestorableActor(FileBackupAgent* const& backupAgent,Reference const& tr,Key const& tagName,Snapshot const& snapshot) - #line 48438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor>(), - GetLastRestorableActorState(backupAgent, tr, tagName, snapshot) +friend struct ActorCallback< RestoreActor, 0, BackupDescription >; +friend struct ActorCallback< RestoreActor, 1, Void >; +friend struct ActorCallback< RestoreActor, 2, Optional >; +friend struct ActorCallback< RestoreActor, 3, Void >; +friend struct ActorCallback< RestoreActor, 4, Void >; +friend struct ActorCallback< RestoreActor, 5, Void >; +friend struct ActorCallback< RestoreActor, 6, Void >; +friend struct ActorCallback< RestoreActor, 7, ERestoreState >; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + RestoreActor(FileBackupAgent* const& backupAgent,Database const& cx,Optional const& cxOrig,Key const& tagName,Key const& url,Optional const& proxy,Standalone> const& ranges,Standalone> const& beginVersions,WaitForComplete const& waitForComplete,Version const& targetVersion,Verbose const& verbose,Key const& addPrefix,Key const& removePrefix,LockDB const& lockDB,UnlockDB const& unlockDB,OnlyApplyMutationLogs const& onlyApplyMutationLogs,InconsistentSnapshotOnly const& inconsistentSnapshotOnly,Optional const& encryptionKeyFileName,UID const& randomUid) + #line 56349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + RestoreActorState(backupAgent, cx, cxOrig, tagName, url, proxy, ranges, beginVersions, waitForComplete, targetVersion, verbose, addPrefix, removePrefix, lockDB, unlockDB, onlyApplyMutationLogs, inconsistentSnapshotOnly, encryptionKeyFileName, randomUid) { - fdb_probe_actor_enter("getLastRestorable", reinterpret_cast(this), -1); + fdb_probe_actor_enter("restore", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getLastRestorable"); + this->lineage.setActorName("restore"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("getLastRestorable", reinterpret_cast(this), -1); + fdb_probe_actor_exit("restore", reinterpret_cast(this), -1); } void cancel() override @@ -48453,129 +56364,65 @@ friend struct ActorCallback< GetLastRestorableActor, 0, Optional >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetLastRestorableActor, 0, Optional >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< RestoreActor, 0, BackupDescription >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< RestoreActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< RestoreActor, 2, Optional >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< RestoreActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< RestoreActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< RestoreActor, 5, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< RestoreActor, 6, Void >*)0, actor_cancelled()); break; + case 8: this->a_callback_error((ActorCallback< RestoreActor, 7, ERestoreState >*)0, actor_cancelled()); break; } - } -}; - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future> getLastRestorable( FileBackupAgent* const& backupAgent, Reference const& tr, Key const& tagName, Snapshot const& snapshot ) { - #line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future>(new GetLastRestorableActor(backupAgent, tr, tagName, snapshot)); - #line 48465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -} - -#line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - - static StringRef read(StringRef& data, int bytes) { - if (bytes > data.size()) - throw restore_error(); - StringRef r = data.substr(0, bytes); - data = data.substr(bytes); - return r; - } - - // Submits the restore request to the database and throws "restore_invalid_version" error if - // restore is not possible. Parameters: - // cx: the database to be restored to - // cxOrig: if present, is used to resolve the restore timestamp into a version. - // tagName: restore tag - // url: the backup container's URL that contains all backup files - // ranges: the restored key ranges; if empty, restore all key ranges in the backup - // waitForComplete: if set, wait until the restore is completed before returning; otherwise, - // return when the request is submitted to the database. - // targetVersion: the version to be restored. - // verbose: print verbose information. - // addPrefix: each key is added this prefix during restore. - // removePrefix: for each key to be restored, remove this prefix first. - // lockDB: if set lock the database with randomUid before performing restore; - // otherwise, check database is locked with the randomUid - // onlyApplyMutationLogs: only perform incremental restore, by only applying mutation logs - // inconsistentSnapshotOnly: Ignore mutation log files during the restore to speedup the process. - // When set to true, gives an inconsistent snapshot, thus not recommended - // beginVersion: restore's begin version - // randomUid: the UID for lock the database - #line 48498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" -// This generated class is to be used only via restore() - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -template - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class RestoreActorState { - #line 48504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } +}; + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future restore( FileBackupAgent* const& backupAgent, Database const& cx, Optional const& cxOrig, Key const& tagName, Key const& url, Optional const& proxy, Standalone> const& ranges, Standalone> const& beginVersions, WaitForComplete const& waitForComplete, Version const& targetVersion, Verbose const& verbose, Key const& addPrefix, Key const& removePrefix, LockDB const& lockDB, UnlockDB const& unlockDB, OnlyApplyMutationLogs const& onlyApplyMutationLogs, InconsistentSnapshotOnly const& inconsistentSnapshotOnly, Optional const& encryptionKeyFileName, UID const& randomUid ) { + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new RestoreActor(backupAgent, cx, cxOrig, tagName, url, proxy, ranges, beginVersions, waitForComplete, targetVersion, verbose, addPrefix, removePrefix, lockDB, unlockDB, onlyApplyMutationLogs, inconsistentSnapshotOnly, encryptionKeyFileName, randomUid)); + #line 56383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 6205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + #line 56388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via preloadApplyMutationsKeyVersionMap() + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class PreloadApplyMutationsKeyVersionMapActorState { + #line 56394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - RestoreActorState(FileBackupAgent* const& backupAgent,Database const& cx,Optional const& cxOrig,Key const& tagName,Key const& url,Optional const& proxy,Standalone> const& ranges,WaitForComplete const& waitForComplete,Version const& targetVersion,Verbose const& verbose,Key const& addPrefix,Key const& removePrefix,LockDB const& lockDB,OnlyApplyMutationLogs const& onlyApplyMutationLogs,InconsistentSnapshotOnly const& inconsistentSnapshotOnly,Version const& beginVersion,Optional const& encryptionKeyFileName,UID const& randomUid) - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - : backupAgent(backupAgent), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - cx(cx), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - cxOrig(cxOrig), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tagName(tagName), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - url(url), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - proxy(proxy), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + PreloadApplyMutationsKeyVersionMapActorState(Database const& cx,UID const& uid,Standalone> const& ranges,Standalone> const& versions) + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : cx(cx), + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + uid(uid), + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ranges(ranges), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - waitForComplete(waitForComplete), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - targetVersion(targetVersion), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - verbose(verbose), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - addPrefix(addPrefix), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - removePrefix(removePrefix), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - lockDB(lockDB), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - onlyApplyMutationLogs(onlyApplyMutationLogs), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - inconsistentSnapshotOnly(inconsistentSnapshotOnly), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - beginVersion(beginVersion), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - encryptionKeyFileName(encryptionKeyFileName), - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - randomUid(randomUid) - #line 48545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + versions(versions), + #line 6210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr(new ReadYourWritesTransaction(cx)) + #line 56409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - fdb_probe_actor_create("restore", reinterpret_cast(this)); + fdb_probe_actor_create("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this)); } - ~RestoreActorState() + ~PreloadApplyMutationsKeyVersionMapActorState() { - fdb_probe_actor_destroy("restore", reinterpret_cast(this)); + fdb_probe_actor_destroy("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 5364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (ranges.empty()) - #line 48560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(restore_error(), loopDepth); - #line 48564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 5368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - bc = IBackupContainer::openContainer(url.toString(), proxy, {}); - #line 5370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = bc->describeBackup(true); - #line 5370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 48572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 5370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 48577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 6213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 56424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -48587,326 +56434,354 @@ class RestoreActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~RestoreActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~PreloadApplyMutationsKeyVersionMapActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 5371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (cxOrig.present()) - #line 48600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = desc.resolveVersionTimes(cxOrig.get()); - #line 5372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 48606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 5372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 48611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont3(loopDepth); - } + #line 6243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + i = int(); + #line 6244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + stepSize = 1000; + #line 6245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + i = 0; + #line 56451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } - int a_body1when1(BackupDescription const& __desc,int loopDepth) + int a_body1loopHead1(int loopDepth) { - #line 5370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - desc = __desc; - #line 48625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); return loopDepth; } - int a_body1when1(BackupDescription && __desc,int loopDepth) + int a_body1loopBody1(int loopDepth) { - desc = std::move(__desc); - loopDepth = a_body1cont1(loopDepth); + try { + #line 6215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 6216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 6218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key mapStart = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); + #line 6219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(KeyRangeRef(mapStart, strinc(mapStart))); + #line 6220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int64_t startCount = 0; + #line 6221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->set(uidPrefixKey(applyMutationsKeyVersionCountRange.begin, uid), StringRef((uint8_t*)&startCount, 8)); + #line 6223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->set(mapStart, BinaryWriter::toValue(invalidVersion, Unversioned())); + #line 6225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(uidPrefixKey(applyMutationsEndRange.begin, uid)); + #line 6226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->clear(uidPrefixKey(applyMutationsBeginRange.begin, uid)); + #line 6230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version beginVersion = *std::min_element(versions.begin(), versions.end()); + #line 6231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Value versionEncoded = BinaryWriter::toValue(beginVersion, Unversioned()); + #line 6232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key prefix = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); + #line 6233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = krmSetRange(tr, prefix, allKeys, versionEncoded); + #line 6233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 56494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 6233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 56499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - void a_exitChoose1() + int a_body1break1(int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< RestoreActor, 0, BackupDescription >::remove(); + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + return loopDepth; } - void a_callback_fire(ActorCallback< RestoreActor, 0, BackupDescription >*,BackupDescription const& value) + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 0); - a_exitChoose1(); try { - a_body1when1(value, 0); + #line 6238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = tr->onError(e); + #line 6238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 56536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 6238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 56541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1Catch1(error, 0); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - a_body1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 0); + return loopDepth; } - void a_callback_fire(ActorCallback< RestoreActor, 0, BackupDescription >*,BackupDescription && value) + int a_body1loopBody1cont2(Void const& _,int loopDepth) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 0); + #line 6235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = tr->commit(); + #line 6235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 56558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 6235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 56563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Void && _,int loopDepth) + { + #line 6235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = tr->commit(); + #line 6235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 56574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 6235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 56579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 0); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< RestoreActor, 0, BackupDescription >*,Error err) + void a_callback_fire(ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 0); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 0); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 0); } - int a_body1cont3(int loopDepth) + void a_callback_error(ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 0, Void >*,Error err) { - #line 5375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - printf("Backup Description\n%s", desc.toString().c_str()); - #line 5376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (targetVersion == invalidVersion && desc.maxRestorableVersion.present()) - #line 48694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - targetVersion = desc.maxRestorableVersion.get(); - #line 48698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); } - #line 5379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (targetVersion == invalidVersion && onlyApplyMutationLogs && desc.contiguousLogEnd.present()) - #line 48702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - targetVersion = desc.contiguousLogEnd.get() - 1; - #line 48706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); } - #line 5383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_2 = bc->getRestoreSet(targetVersion, ranges, onlyApplyMutationLogs, beginVersion); - #line 5383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 48712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 5383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 48717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1cont4(Void const& _,int loopDepth) + int a_body1loopBody1cont3(Void const& _,int loopDepth) { - loopDepth = a_body1cont3(loopDepth); + return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1cont4(Void && _,int loopDepth) + int a_body1loopBody1cont3(Void && _,int loopDepth) { - loopDepth = a_body1cont3(loopDepth); + return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont4(_, loopDepth); + loopDepth = a_body1loopBody1cont3(_, loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont4(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< RestoreActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< RestoreActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 1); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(value, 0); + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 1); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< RestoreActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 1); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(std::move(value), 0); + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 1); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< RestoreActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 1); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 1); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 1); } - int a_body1cont5(Optional const& restoreSet,int loopDepth) + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 5386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!restoreSet.present()) - #line 48801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevWarn, "FileBackupAgentRestoreNotPossible") .detail("BackupContainer", bc->getURL()) .detail("BeginVersion", beginVersion) .detail("TargetVersion", targetVersion); - #line 5391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - fmt::print(stderr, "ERROR: Restore version {0} is not possible from {1}\n", targetVersion, bc->getURL()); - #line 5392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(restore_invalid_version(), loopDepth); - #line 48809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 5395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (verbose) - #line 48813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - printf("Restoring backup to version: %lld\n", (long long)targetVersion); - #line 48817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 5399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr = Reference(new ReadYourWritesTransaction(cx)); - #line 5400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 48823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont5loopHead1(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont5(Optional && restoreSet,int loopDepth) + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 5386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!restoreSet.present()) - #line 48832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent(SevWarn, "FileBackupAgentRestoreNotPossible") .detail("BackupContainer", bc->getURL()) .detail("BeginVersion", beginVersion) .detail("TargetVersion", targetVersion); - #line 5391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - fmt::print(stderr, "ERROR: Restore version {0} is not possible from {1}\n", targetVersion, bc->getURL()); - #line 5392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(restore_invalid_version(), loopDepth); - #line 48840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 5395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (verbose) - #line 48844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - printf("Restoring backup to version: %lld\n", (long long)targetVersion); - #line 48848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 5399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr = Reference(new ReadYourWritesTransaction(cx)); - #line 5400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 48854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont5loopHead1(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont3when1(Optional const& restoreSet,int loopDepth) + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont5(restoreSet, loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1cont3when1(Optional && restoreSet,int loopDepth) + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont5(std::move(restoreSet), loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< RestoreActor, 2, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< RestoreActor, 2, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 2); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont3when1(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 2); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< RestoreActor, 2, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 2); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont3when1(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 2); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< RestoreActor, 2, Optional >*,Error err) + void a_callback_error(ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 2); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -48916,72 +56791,58 @@ class RestoreActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 2); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 2); } - int a_body1cont8(int loopDepth) + int a_body1cont2(int loopDepth) { - #line 5428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (waitForComplete) - #line 48926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_6 = waitRestore(cx, tagName, verbose); - #line 5429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 48932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont8when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 5429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 48937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont11(loopDepth); - } + #line 6249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("PreloadApplyMutationsKeyVersionMap", uid).detail("Size", ranges.size()); + #line 6250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PreloadApplyMutationsKeyVersionMapActorState(); static_cast(this)->destroy(); return 0; } + #line 56803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PreloadApplyMutationsKeyVersionMapActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont5loopHead1(int loopDepth) + int a_body1cont1loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont5loopBody1(loopDepth); + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); return loopDepth; } - int a_body1cont5loopBody1(int loopDepth) + int a_body1cont1loopBody1(int loopDepth) { - try { - #line 5402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 5403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 5404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_3 = submitRestore(backupAgent, tr, tagName, url, proxy, ranges, targetVersion, addPrefix, removePrefix, lockDB, onlyApplyMutationLogs, inconsistentSnapshotOnly, beginVersion, randomUid); - #line 5404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont5loopBody1Catch1(actor_cancelled(), loopDepth); - #line 48965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont5loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5loopBody1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 5404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 48970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont5loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont5loopBody1Catch1(unknown_error(), loopDepth); + #line 6245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!(i < ranges.size())) + #line 56822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } + #line 6246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int end = std::min(i + stepSize, ranges.size()); + #line 6247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = preloadApplyMutationsKeyVersionMap(cx, uid, ranges, versions, i, end); + #line 6247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 56832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 6247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 56837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont5break1(int loopDepth) + int a_body1cont1break1(int loopDepth) { try { - return a_body1cont8(loopDepth); + return a_body1cont2(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -48991,380 +56852,576 @@ class RestoreActorState { return loopDepth; } - int a_body1cont5loopBody1cont1(int loopDepth) + int a_body1cont1loopBody1cont1(Void const& _,int loopDepth) { - if (loopDepth == 0) return a_body1cont5loopHead1(0); + #line 6245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + i += stepSize; + #line 56859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; } - int a_body1cont5loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1cont1loopBody1cont1(Void && _,int loopDepth) + { + #line 6245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + i += stepSize; + #line 56868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 3, Void >*,Void const& value) { + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 3); + a_exitChoose4(); try { - #line 5421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (e.code() == error_code_restore_duplicate_tag) - #line 49005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 49009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 5424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_5 = tr->onError(e); - #line 5424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 49015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont5loopBody1Catch1when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 5424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + a_body1cont1loopBody1when1(value, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1cont5loopBody1cont2(Void const& _,int loopDepth) + void a_callback_fire(ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 3, Void >*,Void && value) { - #line 5418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = tr->commit(); - #line 5418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont5loopBody1Catch1(actor_cancelled(), loopDepth); - #line 49037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont5loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 5418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1cont5loopBody1cont2(Void && _,int loopDepth) + void a_callback_error(ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 3, Void >*,Error err) { - #line 5418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = tr->commit(); - #line 5418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont5loopBody1Catch1(actor_cancelled(), loopDepth); - #line 49053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont5loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 5418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1cont5loopBody1when1(Void const& _,int loopDepth) + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Database cx; + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + UID uid; + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Standalone> ranges; + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Standalone> versions; + #line 6210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference tr; + #line 6243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int i; + #line 6244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int stepSize; + #line 56950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +}; +// This generated class is to be used only via preloadApplyMutationsKeyVersionMap() + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class PreloadApplyMutationsKeyVersionMapActor final : public Actor, public ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 0, Void >, public ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 1, Void >, public ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 2, Void >, public ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 3, Void >, public FastAllocated, public PreloadApplyMutationsKeyVersionMapActorState { + #line 56955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 0, Void >; +friend struct ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 1, Void >; +friend struct ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 2, Void >; +friend struct ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 3, Void >; + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + PreloadApplyMutationsKeyVersionMapActor(Database const& cx,UID const& uid,Standalone> const& ranges,Standalone> const& versions) + #line 56969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + PreloadApplyMutationsKeyVersionMapActorState(cx, uid, ranges, versions) { - loopDepth = a_body1cont5loopBody1cont2(_, loopDepth); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("preloadApplyMutationsKeyVersionMap"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< PreloadApplyMutationsKeyVersionMapActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future preloadApplyMutationsKeyVersionMap( Database const& cx, UID const& uid, Standalone> const& ranges, Standalone> const& versions ) { + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new PreloadApplyMutationsKeyVersionMapActor(cx, uid, ranges, versions)); + #line 56999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +} + +#line 6252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + + #line 57004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via preloadApplyMutationsKeyVersionMap() + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +template + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class PreloadApplyMutationsKeyVersionMapActor1State { + #line 57010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +public: + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + PreloadApplyMutationsKeyVersionMapActor1State(Database const& cx,UID const& uid,Standalone> const& ranges,Standalone> const& versions,int const& start,int const& end) + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + : cx(cx), + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + uid(uid), + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ranges(ranges), + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + versions(versions), + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + start(start), + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + end(end), + #line 6259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr(new ReadYourWritesTransaction(cx)) + #line 57029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + fdb_probe_actor_create("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this)); + + } + ~PreloadApplyMutationsKeyVersionMapActor1State() + { + fdb_probe_actor_destroy("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 6260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 57044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1cont5loopBody1when1(Void && _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - loopDepth = a_body1cont5loopBody1cont2(std::move(_), loopDepth); + this->~PreloadApplyMutationsKeyVersionMapActor1State(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - void a_exitChoose4() + int a_body1loopHead1(int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< RestoreActor, 3, Void >::remove(); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< RestoreActor, 3, Void >*,Void const& value) + int a_body1loopBody1(int loopDepth) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 3); - a_exitChoose4(); try { - a_body1cont5loopBody1when1(value, 0); + #line 6262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 6263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 6264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + i = int(); + #line 6265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + i = start; + #line 57081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1loopBody1loopHead1(loopDepth); } catch (Error& error) { - a_body1cont5loopBody1Catch1(error, 0); + loopDepth = a_body1loopBody1Catch1(error, loopDepth); } catch (...) { - a_body1cont5loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 3); + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; } - void a_callback_fire(ActorCallback< RestoreActor, 3, Void >*,Void && value) + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 3); - a_exitChoose4(); try { - a_body1cont5loopBody1when1(std::move(value), 0); + #line 6277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = tr->onError(e); + #line 6277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 57105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 6277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1cont5loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - a_body1cont5loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 3); + return loopDepth; } - void a_callback_error(ActorCallback< RestoreActor, 3, Void >*,Error err) + int a_body1loopBody1cont2(int loopDepth) + { + #line 6274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = tr->commit(); + #line 6274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 57127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 6274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1(int loopDepth) + { + #line 6265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!(i < end)) + #line 57148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 6266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version version = versions[i]; + #line 6267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (version == invalidVersion) + #line 57156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + version = 0; + #line 57160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 6270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Value versionEncoded = BinaryWriter::toValue(version, Unversioned()); + #line 6271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Key prefix = uidPrefixKey(applyMutationsKeyVersionMapRange.begin, uid); + #line 6272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = krmSetRangeCoalescing(tr, prefix, ranges[i], allKeys, versionEncoded); + #line 6272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 57170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 6272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1break1(int loopDepth) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 3); - a_exitChoose4(); try { - a_body1cont5loopBody1Catch1(err, 0); + return a_body1loopBody1cont2(loopDepth); } catch (Error& error) { - a_body1cont5loopBody1Catch1(error, 0); + loopDepth = a_body1loopBody1Catch1(error, loopDepth); } catch (...) { - a_body1cont5loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 3); + return loopDepth; } - int a_body1cont5loopBody1cont3(Void const& _,int loopDepth) + int a_body1loopBody1loopBody1cont1(Void const& _,int loopDepth) { - return a_body1cont5break1(loopDepth==0?0:loopDepth-1); // break + #line 6265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ++i; + #line 57197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (loopDepth == 0) return a_body1loopBody1loopHead1(0); return loopDepth; } - int a_body1cont5loopBody1cont3(Void && _,int loopDepth) + int a_body1loopBody1loopBody1cont1(Void && _,int loopDepth) { - return a_body1cont5break1(loopDepth==0?0:loopDepth-1); // break + #line 6265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ++i; + #line 57206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (loopDepth == 0) return a_body1loopBody1loopHead1(0); return loopDepth; } - int a_body1cont5loopBody1cont2when1(Void const& _,int loopDepth) + int a_body1loopBody1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont5loopBody1cont3(_, loopDepth); + loopDepth = a_body1loopBody1loopBody1cont1(_, loopDepth); return loopDepth; } - int a_body1cont5loopBody1cont2when1(Void && _,int loopDepth) + int a_body1loopBody1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont5loopBody1cont3(std::move(_), loopDepth); + loopDepth = a_body1loopBody1loopBody1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose5() + void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< RestoreActor, 4, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< RestoreActor, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont5loopBody1cont2when1(value, 0); + a_body1loopBody1loopBody1when1(value, 0); } catch (Error& error) { - a_body1cont5loopBody1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont5loopBody1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 4); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< RestoreActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 0, Void >*,Void && value) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont5loopBody1cont2when1(std::move(value), 0); + a_body1loopBody1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1cont5loopBody1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont5loopBody1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 4); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< RestoreActor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 0, Void >*,Error err) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont5loopBody1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1cont5loopBody1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont5loopBody1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 4); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 0); } - int a_body1cont5loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1loopBody1cont3(Void const& _,int loopDepth) { - loopDepth = a_body1cont5loopBody1cont1(loopDepth); + #line 6275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PreloadApplyMutationsKeyVersionMapActor1State(); static_cast(this)->destroy(); return 0; } + #line 57278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PreloadApplyMutationsKeyVersionMapActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont5loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1loopBody1cont3(Void && _,int loopDepth) { - loopDepth = a_body1cont5loopBody1cont1(loopDepth); + #line 6275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PreloadApplyMutationsKeyVersionMapActor1State(); static_cast(this)->destroy(); return 0; } + #line 57290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PreloadApplyMutationsKeyVersionMapActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont5loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont5loopBody1Catch1cont1(_, loopDepth); + loopDepth = a_body1loopBody1cont3(_, loopDepth); return loopDepth; } - int a_body1cont5loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont5loopBody1Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose6() + void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< RestoreActor, 5, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< RestoreActor, 5, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont5loopBody1Catch1when1(value, 0); + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 5); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< RestoreActor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 1, Void >*,Void && value) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont5loopBody1Catch1when1(std::move(value), 0); + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 5); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< RestoreActor, 5, Void >*,Error err) + void a_callback_error(ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 1, Void >*,Error err) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 5); - - } - int a_body1cont11(int loopDepth) - { - #line 5434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(targetVersion); this->~RestoreActorState(); static_cast(this)->destroy(); return 0; } - #line 49280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Version >::value()) Version(std::move(targetVersion)); // state_var_RVO - this->~RestoreActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1cont12(ERestoreState const& finalState,int loopDepth) + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 5430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (finalState != ERestoreState::COMPLETED) - #line 49292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(restore_error(), loopDepth); - #line 49296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - loopDepth = a_body1cont11(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont12(ERestoreState && finalState,int loopDepth) + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 5430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (finalState != ERestoreState::COMPLETED) - #line 49306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1Catch1(restore_error(), loopDepth); - #line 49310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - loopDepth = a_body1cont11(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont8when1(ERestoreState const& finalState,int loopDepth) + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont12(finalState, loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1cont8when1(ERestoreState && finalState,int loopDepth) + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont12(std::move(finalState), loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose7() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< RestoreActor, 6, ERestoreState >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< RestoreActor, 6, ERestoreState >*,ERestoreState const& value) + void a_callback_fire(ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont8when1(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 6); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< RestoreActor, 6, ERestoreState >*,ERestoreState && value) + void a_callback_fire(ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 2, Void >*,Void && value) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont8when1(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 6); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< RestoreActor, 6, ERestoreState >*,Error err) + void a_callback_error(ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 2, Void >*,Error err) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -49373,84 +57430,54 @@ class RestoreActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("restore", reinterpret_cast(this), 6); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), 2); } - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - FileBackupAgent* backupAgent; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional cxOrig; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key tagName; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key url; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional proxy; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + UID uid; + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> ranges; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - WaitForComplete waitForComplete; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version targetVersion; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Verbose verbose; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key addPrefix; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Key removePrefix; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - LockDB lockDB; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - OnlyApplyMutationLogs onlyApplyMutationLogs; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - InconsistentSnapshotOnly inconsistentSnapshotOnly; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version beginVersion; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Optional encryptionKeyFileName; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - UID randomUid; - #line 5368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference bc; - #line 5370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - BackupDescription desc; - #line 5399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Standalone> versions; + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int start; + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int end; + #line 6259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference tr; - #line 49421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int i; + #line 57452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; -// This generated class is to be used only via restore() - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class RestoreActor final : public Actor, public ActorCallback< RestoreActor, 0, BackupDescription >, public ActorCallback< RestoreActor, 1, Void >, public ActorCallback< RestoreActor, 2, Optional >, public ActorCallback< RestoreActor, 3, Void >, public ActorCallback< RestoreActor, 4, Void >, public ActorCallback< RestoreActor, 5, Void >, public ActorCallback< RestoreActor, 6, ERestoreState >, public FastAllocated, public RestoreActorState { - #line 49426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" +// This generated class is to be used only via preloadApplyMutationsKeyVersionMap() + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class PreloadApplyMutationsKeyVersionMapActor1 final : public Actor, public ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 0, Void >, public ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 1, Void >, public ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 2, Void >, public FastAllocated, public PreloadApplyMutationsKeyVersionMapActor1State { + #line 57457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< RestoreActor, 0, BackupDescription >; -friend struct ActorCallback< RestoreActor, 1, Void >; -friend struct ActorCallback< RestoreActor, 2, Optional >; -friend struct ActorCallback< RestoreActor, 3, Void >; -friend struct ActorCallback< RestoreActor, 4, Void >; -friend struct ActorCallback< RestoreActor, 5, Void >; -friend struct ActorCallback< RestoreActor, 6, ERestoreState >; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - RestoreActor(FileBackupAgent* const& backupAgent,Database const& cx,Optional const& cxOrig,Key const& tagName,Key const& url,Optional const& proxy,Standalone> const& ranges,WaitForComplete const& waitForComplete,Version const& targetVersion,Verbose const& verbose,Key const& addPrefix,Key const& removePrefix,LockDB const& lockDB,OnlyApplyMutationLogs const& onlyApplyMutationLogs,InconsistentSnapshotOnly const& inconsistentSnapshotOnly,Version const& beginVersion,Optional const& encryptionKeyFileName,UID const& randomUid) - #line 49443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - : Actor(), - RestoreActorState(backupAgent, cx, cxOrig, tagName, url, proxy, ranges, waitForComplete, targetVersion, verbose, addPrefix, removePrefix, lockDB, onlyApplyMutationLogs, inconsistentSnapshotOnly, beginVersion, encryptionKeyFileName, randomUid) +friend struct ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 0, Void >; +friend struct ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 1, Void >; +friend struct ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 2, Void >; + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + PreloadApplyMutationsKeyVersionMapActor1(Database const& cx,UID const& uid,Standalone> const& ranges,Standalone> const& versions,int const& start,int const& end) + #line 57470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + : Actor(), + PreloadApplyMutationsKeyVersionMapActor1State(cx, uid, ranges, versions, start, end) { - fdb_probe_actor_enter("restore", reinterpret_cast(this), -1); + fdb_probe_actor_enter("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("restore"); + this->lineage.setActorName("preloadApplyMutationsKeyVersionMap"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("restore", reinterpret_cast(this), -1); + fdb_probe_actor_exit("preloadApplyMutationsKeyVersionMap", reinterpret_cast(this), -1); } void cancel() override @@ -49458,58 +57485,54 @@ friend struct ActorCallback< RestoreActor, 6, ERestoreState >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< RestoreActor, 0, BackupDescription >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< RestoreActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< RestoreActor, 2, Optional >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< RestoreActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< RestoreActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< RestoreActor, 5, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< RestoreActor, 6, ERestoreState >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< PreloadApplyMutationsKeyVersionMapActor1, 2, Void >*)0, actor_cancelled()); break; } } }; - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -[[nodiscard]] static Future restore( FileBackupAgent* const& backupAgent, Database const& cx, Optional const& cxOrig, Key const& tagName, Key const& url, Optional const& proxy, Standalone> const& ranges, WaitForComplete const& waitForComplete, Version const& targetVersion, Verbose const& verbose, Key const& addPrefix, Key const& removePrefix, LockDB const& lockDB, OnlyApplyMutationLogs const& onlyApplyMutationLogs, InconsistentSnapshotOnly const& inconsistentSnapshotOnly, Version const& beginVersion, Optional const& encryptionKeyFileName, UID const& randomUid ) { - #line 5345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return Future(new RestoreActor(backupAgent, cx, cxOrig, tagName, url, proxy, ranges, waitForComplete, targetVersion, verbose, addPrefix, removePrefix, lockDB, onlyApplyMutationLogs, inconsistentSnapshotOnly, beginVersion, encryptionKeyFileName, randomUid)); - #line 49476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +[[nodiscard]] static Future preloadApplyMutationsKeyVersionMap( Database const& cx, UID const& uid, Standalone> const& ranges, Standalone> const& versions, int const& start, int const& end ) { + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return Future(new PreloadApplyMutationsKeyVersionMapActor1(cx, uid, ranges, versions, start, end)); + #line 57499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 5436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 6281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" // used for correctness only, locks the database before discontinuing the backup and that same lock is then used // while doing the restore. the tagname of the backup must be the same as the restore. - #line 49483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 57506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" // This generated class is to be used only via atomicRestore() - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class AtomicRestoreActorState { - #line 49489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 57512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AtomicRestoreActorState(FileBackupAgent* const& backupAgent,Database const& cx,Key const& tagName,Standalone> const& ranges,Key const& addPrefix,Key const& removePrefix,UsePartitionedLog const& fastRestore) - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : backupAgent(backupAgent), - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" cx(cx), - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tagName(tagName), - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ranges(ranges), - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addPrefix(addPrefix), - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" removePrefix(removePrefix), - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" fastRestore(fastRestore), - #line 5446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ryw_tr(Reference(new ReadYourWritesTransaction(cx))), - #line 5448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupConfig() - #line 49512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 57535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("atomicRestore", reinterpret_cast(this)); @@ -49522,10 +57545,17 @@ class AtomicRestoreActorState { int a_body1(int loopDepth=0) { try { - #line 5449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 49527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); + #line 6294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_0 = getDatabaseConfiguration(cx); + #line 6294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 57552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 6294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -49545,59 +57575,135 @@ class AtomicRestoreActorState { } int a_body1cont1(int loopDepth) { - #line 5469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 57580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1when1(DatabaseConfiguration const& __config,int loopDepth) + { + #line 6294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + config = __config; + #line 57589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(DatabaseConfiguration && __config,int loopDepth) + { + config = std::move(__config); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AtomicRestoreActor, 0, DatabaseConfiguration >::remove(); + + } + void a_callback_fire(ActorCallback< AtomicRestoreActor, 0, DatabaseConfiguration >*,DatabaseConfiguration const& value) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< AtomicRestoreActor, 0, DatabaseConfiguration >*,DatabaseConfiguration && value) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< AtomicRestoreActor, 0, DatabaseConfiguration >*,Error err) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 6315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr = Transaction(cx); - #line 5470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" commitVersion = Version(); - #line 5471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" randomUid = deterministicRandom()->randomUniqueID(); - #line 5472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 49556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont1loopHead1(loopDepth); + #line 57662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont2loopHead1(loopDepth); return loopDepth; } - int a_body1loopHead1(int loopDepth) + int a_body1cont1loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); return loopDepth; } - int a_body1loopBody1(int loopDepth) + int a_body1cont1loopBody1(int loopDepth) { try { - #line 5451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ryw_tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 5452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ryw_tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 5453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tag = makeBackupTag(tagName.toString()); - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_0 = tag.getOrThrow(ryw_tr); - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 49581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_1 = tag.getOrThrow(ryw_tr); + #line 6300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 57687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 6300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); + loopDepth = a_body1cont1loopBody1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1cont1loopBody1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1break1(int loopDepth) + int a_body1cont1break1(int loopDepth) { try { - return a_body1cont1(loopDepth); + return a_body1cont2(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -49607,25 +57713,25 @@ class AtomicRestoreActorState { return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) + int a_body1cont1loopBody1cont1(int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); + if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 5464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_2 = ryw_tr->onError(e); - #line 5464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_3 = ryw_tr->onError(e); + #line 6310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 49623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 5464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 57729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 6310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -49636,250 +57742,250 @@ class AtomicRestoreActorState { return loopDepth; } - int a_body1loopBody1cont2(UidAndAbortedFlagT const& uidFlag,int loopDepth) + int a_body1cont1loopBody1cont2(UidAndAbortedFlagT const& uidFlag,int loopDepth) { - #line 5455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupConfig = BackupConfig(uidFlag.first); - #line 5456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = backupConfig.stateEnum().getOrThrow(ryw_tr); - #line 5456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 49647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 5456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = backupConfig.stateEnum().getOrThrow(ryw_tr); + #line 6302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 57753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 6302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont2(UidAndAbortedFlagT && uidFlag,int loopDepth) + int a_body1cont1loopBody1cont2(UidAndAbortedFlagT && uidFlag,int loopDepth) { - #line 5455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupConfig = BackupConfig(uidFlag.first); - #line 5456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_1 = backupConfig.stateEnum().getOrThrow(ryw_tr); - #line 5456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 49665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 5456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_2 = backupConfig.stateEnum().getOrThrow(ryw_tr); + #line 6302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 57771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 6302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1when1(UidAndAbortedFlagT const& uidFlag,int loopDepth) + int a_body1cont1loopBody1when1(UidAndAbortedFlagT const& uidFlag,int loopDepth) { - loopDepth = a_body1loopBody1cont2(uidFlag, loopDepth); + loopDepth = a_body1cont1loopBody1cont2(uidFlag, loopDepth); return loopDepth; } - int a_body1loopBody1when1(UidAndAbortedFlagT && uidFlag,int loopDepth) + int a_body1cont1loopBody1when1(UidAndAbortedFlagT && uidFlag,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(uidFlag), loopDepth); + loopDepth = a_body1cont1loopBody1cont2(std::move(uidFlag), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose2() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AtomicRestoreActor, 0, UidAndAbortedFlagT >::remove(); + static_cast(this)->ActorCallback< AtomicRestoreActor, 1, UidAndAbortedFlagT >::remove(); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 0, UidAndAbortedFlagT >*,UidAndAbortedFlagT const& value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 1, UidAndAbortedFlagT >*,UidAndAbortedFlagT const& value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when1(value, 0); + a_body1cont1loopBody1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 0); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 0, UidAndAbortedFlagT >*,UidAndAbortedFlagT && value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 1, UidAndAbortedFlagT >*,UidAndAbortedFlagT && value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1cont1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 0); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< AtomicRestoreActor, 0, UidAndAbortedFlagT >*,Error err) + void a_callback_error(ActorCallback< AtomicRestoreActor, 1, UidAndAbortedFlagT >*,Error err) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1Catch1(err, 0); + a_body1cont1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 0); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 1); } - int a_body1loopBody1cont3(int loopDepth) + int a_body1cont1loopBody1cont3(int loopDepth) { - #line 5458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (status != EBackupState::STATE_RUNNING_DIFFERENTIAL) - #line 49742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 57848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - return a_body1loopBody1Catch1(backup_duplicate(), loopDepth); - #line 49746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + return a_body1cont1loopBody1Catch1(backup_duplicate(), loopDepth); + #line 57852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1loopBody1cont2when1(EBackupState const& __status,int loopDepth) + int a_body1cont1loopBody1cont2when1(EBackupState const& __status,int loopDepth) { - #line 5456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" status = __status; - #line 49756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); + #line 57862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont3(loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(EBackupState && __status,int loopDepth) + int a_body1cont1loopBody1cont2when1(EBackupState && __status,int loopDepth) { status = std::move(__status); - loopDepth = a_body1loopBody1cont3(loopDepth); + loopDepth = a_body1cont1loopBody1cont3(loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose3() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AtomicRestoreActor, 1, EBackupState >::remove(); + static_cast(this)->ActorCallback< AtomicRestoreActor, 2, EBackupState >::remove(); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 1, EBackupState >*,EBackupState const& value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 2, EBackupState >*,EBackupState const& value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1cont2when1(value, 0); + a_body1cont1loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 1); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 1, EBackupState >*,EBackupState && value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 2, EBackupState >*,EBackupState && value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1cont2when1(std::move(value), 0); + a_body1cont1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 1); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< AtomicRestoreActor, 1, EBackupState >*,Error err) + void a_callback_error(ActorCallback< AtomicRestoreActor, 2, EBackupState >*,Error err) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1Catch1(err, 0); + a_body1cont1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 1); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 2); } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1cont1loopBody1Catch1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1cont1loopBody1Catch1cont1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + loopDepth = a_body1cont1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1cont1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose3() + void a_exitChoose4() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AtomicRestoreActor, 2, Void >::remove(); + static_cast(this)->ActorCallback< AtomicRestoreActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1loopBody1Catch1when1(value, 0); + a_body1cont1loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 2); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1loopBody1Catch1when1(std::move(value), 0); + a_body1cont1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 2); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< AtomicRestoreActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< AtomicRestoreActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -49888,56 +57994,56 @@ class AtomicRestoreActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 2); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 3); } - int a_body1cont2(int loopDepth) + int a_body1cont3(int loopDepth) { - #line 5487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ryw_tr->reset(); - #line 5488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 49900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont2loopHead1(loopDepth); + #line 58006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont3loopHead1(loopDepth); return loopDepth; } - int a_body1cont1loopHead1(int loopDepth) + int a_body1cont2loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont2loopBody1(loopDepth); return loopDepth; } - int a_body1cont1loopBody1(int loopDepth) + int a_body1cont2loopBody1(int loopDepth) { try { - #line 5476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - tr.addWriteConflictRange(backupConfig.snapshotRangeDispatchMap().space.range()); - #line 5477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_3 = lockDatabase(&tr, randomUid); - #line 5477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 49921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 5477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + tr.addWriteConflictRange(backupConfig.snapshotRangeDispatchMap().subspace); + #line 6323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_4 = lockDatabase(&tr, randomUid); + #line 6323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); + #line 58027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont2loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont2loopBody1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 6323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1cont1loopBody1Catch1(error, loopDepth); + loopDepth = a_body1cont2loopBody1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1cont1loopBody1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1cont2loopBody1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont1break1(int loopDepth) + int a_body1cont2break1(int loopDepth) { try { - return a_body1cont2(loopDepth); + return a_body1cont3(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -49947,25 +58053,25 @@ class AtomicRestoreActorState { return loopDepth; } - int a_body1cont1loopBody1cont1(int loopDepth) + int a_body1cont2loopBody1cont1(int loopDepth) { - if (loopDepth == 0) return a_body1cont1loopHead1(0); + if (loopDepth == 0) return a_body1cont2loopHead1(0); return loopDepth; } - int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1cont2loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 5483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_5 = tr.onError(e); - #line 5483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_6 = tr.onError(e); + #line 6329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 49963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 5483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 58069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1Catch1when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 6329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -49976,250 +58082,250 @@ class AtomicRestoreActorState { return loopDepth; } - int a_body1cont1loopBody1cont2(Void const& _,int loopDepth) + int a_body1cont2loopBody1cont2(Void const& _,int loopDepth) { - #line 5478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = tr.commit(); - #line 5478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 49985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 5478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_5 = tr.commit(); + #line 6324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); + #line 58091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont2loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 6324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1loopBody1cont2(Void && _,int loopDepth) + int a_body1cont2loopBody1cont2(Void && _,int loopDepth) { - #line 5478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_4 = tr.commit(); - #line 5478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 50001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 5478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 50006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_5 = tr.commit(); + #line 6324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); + #line 58107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont2loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 6324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1loopBody1when1(Void const& _,int loopDepth) + int a_body1cont2loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont2(_, loopDepth); + loopDepth = a_body1cont2loopBody1cont2(_, loopDepth); return loopDepth; } - int a_body1cont1loopBody1when1(Void && _,int loopDepth) + int a_body1cont2loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont2loopBody1cont2(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose5() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AtomicRestoreActor, 3, Void >::remove(); + static_cast(this)->ActorCallback< AtomicRestoreActor, 4, Void >::remove(); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 4, Void >*,Void const& value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1cont1loopBody1when1(value, 0); + a_body1cont2loopBody1when1(value, 0); } catch (Error& error) { - a_body1cont1loopBody1Catch1(error, 0); + a_body1cont2loopBody1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1Catch1(unknown_error(), 0); + a_body1cont2loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 3); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1cont1loopBody1when1(std::move(value), 0); + a_body1cont2loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1cont1loopBody1Catch1(error, 0); + a_body1cont2loopBody1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1Catch1(unknown_error(), 0); + a_body1cont2loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 3); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< AtomicRestoreActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< AtomicRestoreActor, 4, Void >*,Error err) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1cont1loopBody1Catch1(err, 0); + a_body1cont2loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1cont1loopBody1Catch1(error, 0); + a_body1cont2loopBody1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1Catch1(unknown_error(), 0); + a_body1cont2loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 3); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 4); } - int a_body1cont1loopBody1cont3(Void const& _,int loopDepth) + int a_body1cont2loopBody1cont3(Void const& _,int loopDepth) { - #line 5479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" commitVersion = tr.getCommittedVersion(); - #line 5480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("AS_Locked").detail("CommitVer", commitVersion); - #line 50080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break + #line 58186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1cont1loopBody1cont3(Void && _,int loopDepth) + int a_body1cont2loopBody1cont3(Void && _,int loopDepth) { - #line 5479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" commitVersion = tr.getCommittedVersion(); - #line 5480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("AS_Locked").detail("CommitVer", commitVersion); - #line 50091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break + #line 58197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1cont1loopBody1cont2when1(Void const& _,int loopDepth) + int a_body1cont2loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont3(_, loopDepth); + loopDepth = a_body1cont2loopBody1cont3(_, loopDepth); return loopDepth; } - int a_body1cont1loopBody1cont2when1(Void && _,int loopDepth) + int a_body1cont2loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont3(std::move(_), loopDepth); + loopDepth = a_body1cont2loopBody1cont3(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose5() + void a_exitChoose6() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AtomicRestoreActor, 4, Void >::remove(); + static_cast(this)->ActorCallback< AtomicRestoreActor, 5, Void >::remove(); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 5, Void >*,Void const& value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1cont1loopBody1cont2when1(value, 0); + a_body1cont2loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1cont1loopBody1Catch1(error, 0); + a_body1cont2loopBody1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1Catch1(unknown_error(), 0); + a_body1cont2loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 4); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 5); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 5, Void >*,Void && value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1cont1loopBody1cont2when1(std::move(value), 0); + a_body1cont2loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1cont1loopBody1Catch1(error, 0); + a_body1cont2loopBody1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1Catch1(unknown_error(), 0); + a_body1cont2loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 4); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 5); } - void a_callback_error(ActorCallback< AtomicRestoreActor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< AtomicRestoreActor, 5, Void >*,Error err) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1cont1loopBody1Catch1(err, 0); + a_body1cont2loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1cont1loopBody1Catch1(error, 0); + a_body1cont2loopBody1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1Catch1(unknown_error(), 0); + a_body1cont2loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 4); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 5); } - int a_body1cont1loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1cont2loopBody1Catch1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont1(loopDepth); + loopDepth = a_body1cont2loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont1loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1cont2loopBody1Catch1cont1(Void && _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont1(loopDepth); + loopDepth = a_body1cont2loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont2loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1loopBody1Catch1cont1(_, loopDepth); + loopDepth = a_body1cont2loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1cont1loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1cont2loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1loopBody1Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont2loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose6() + void a_exitChoose7() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AtomicRestoreActor, 5, Void >::remove(); + static_cast(this)->ActorCallback< AtomicRestoreActor, 6, Void >::remove(); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 5, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 6, Void >*,Void const& value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 6); + a_exitChoose7(); try { - a_body1cont1loopBody1Catch1when1(value, 0); + a_body1cont2loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 5); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 6); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 6, Void >*,Void && value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 6); + a_exitChoose7(); try { - a_body1cont1loopBody1Catch1when1(std::move(value), 0); + a_body1cont2loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 5); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 6); } - void a_callback_error(ActorCallback< AtomicRestoreActor, 5, Void >*,Error err) + void a_callback_error(ActorCallback< AtomicRestoreActor, 6, Void >*,Error err) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 6); + a_exitChoose7(); try { a_body1Catch1(err, 0); } @@ -50228,54 +58334,54 @@ class AtomicRestoreActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 5); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 6); } - int a_body1cont3(int loopDepth) + int a_body1cont4(int loopDepth) { - #line 5503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ryw_tr->reset(); - #line 5504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 50240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont3loopHead1(loopDepth); + #line 58346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont4loopHead1(loopDepth); return loopDepth; } - int a_body1cont2loopHead1(int loopDepth) + int a_body1cont3loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont2loopBody1(loopDepth); + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont3loopBody1(loopDepth); return loopDepth; } - int a_body1cont2loopBody1(int loopDepth) + int a_body1cont3loopBody1(int loopDepth) { try { - #line 5490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_6 = backupConfig.getLatestRestorableVersion(ryw_tr); - #line 5490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 50259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont2loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont2loopBody1when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 5490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 50264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_7 = backupConfig.getLatestRestorableVersion(ryw_tr); + #line 6336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); + #line 58365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont3loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont3loopBody1when1(__when_expr_7.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 8; + #line 6336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_7.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 58370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1cont2loopBody1Catch1(error, loopDepth); + loopDepth = a_body1cont3loopBody1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1cont2loopBody1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1cont3loopBody1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont2break1(int loopDepth) + int a_body1cont3break1(int loopDepth) { try { - return a_body1cont3(loopDepth); + return a_body1cont4(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -50285,25 +58391,25 @@ class AtomicRestoreActorState { return loopDepth; } - int a_body1cont2loopBody1cont1(int loopDepth) + int a_body1cont3loopBody1cont1(int loopDepth) { - if (loopDepth == 0) return a_body1cont2loopHead1(0); + if (loopDepth == 0) return a_body1cont3loopHead1(0); return loopDepth; } - int a_body1cont2loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1cont3loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 5499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_8 = ryw_tr->onError(e); - #line 5499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_9 = ryw_tr->onError(e); + #line 6345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 50301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1Catch1when1(__when_expr_8.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 9; - #line 5499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 50306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 58407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1Catch1when1(__when_expr_9.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 10; + #line 6345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_9.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -50314,214 +58420,214 @@ class AtomicRestoreActorState { return loopDepth; } - int a_body1cont2loopBody1cont2(Optional const& restoreVersion,int loopDepth) + int a_body1cont3loopBody1cont2(Optional const& restoreVersion,int loopDepth) { - #line 5491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (restoreVersion.present() && restoreVersion.get() >= commitVersion) - #line 50321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 58427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("AS_RestoreVersion").detail("RestoreVer", restoreVersion.get()); - #line 50325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break + #line 58431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + return a_body1cont3break1(loopDepth==0?0:loopDepth-1); // break } else { - #line 5495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ryw_tr->reset(); - #line 5496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_7 = delay(0.2); - #line 5496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 50336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont2loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_7.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 8; - #line 5496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 50341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_8 = delay(0.2); + #line 6342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); + #line 58442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont3loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont3loopBody1cont2when1(__when_expr_8.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 9; + #line 6342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } return loopDepth; } - int a_body1cont2loopBody1cont2(Optional && restoreVersion,int loopDepth) + int a_body1cont3loopBody1cont2(Optional && restoreVersion,int loopDepth) { - #line 5491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (restoreVersion.present() && restoreVersion.get() >= commitVersion) - #line 50351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 58457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("AS_RestoreVersion").detail("RestoreVer", restoreVersion.get()); - #line 50355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break + #line 58461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + return a_body1cont3break1(loopDepth==0?0:loopDepth-1); // break } else { - #line 5495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ryw_tr->reset(); - #line 5496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_7 = delay(0.2); - #line 5496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 50366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont2loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_7.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 8; - #line 5496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 50371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_8 = delay(0.2); + #line 6342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); + #line 58472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1cont3loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont3loopBody1cont2when1(__when_expr_8.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 9; + #line 6342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } return loopDepth; } - int a_body1cont2loopBody1when1(Optional const& restoreVersion,int loopDepth) + int a_body1cont3loopBody1when1(Optional const& restoreVersion,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont2(restoreVersion, loopDepth); + loopDepth = a_body1cont3loopBody1cont2(restoreVersion, loopDepth); return loopDepth; } - int a_body1cont2loopBody1when1(Optional && restoreVersion,int loopDepth) + int a_body1cont3loopBody1when1(Optional && restoreVersion,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont2(std::move(restoreVersion), loopDepth); + loopDepth = a_body1cont3loopBody1cont2(std::move(restoreVersion), loopDepth); return loopDepth; } - void a_exitChoose7() + void a_exitChoose8() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AtomicRestoreActor, 6, Optional >::remove(); + static_cast(this)->ActorCallback< AtomicRestoreActor, 7, Optional >::remove(); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 6, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 7, Optional >*,Optional const& value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 7); + a_exitChoose8(); try { - a_body1cont2loopBody1when1(value, 0); + a_body1cont3loopBody1when1(value, 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1cont3loopBody1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1cont3loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 6); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 7); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 6, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 7, Optional >*,Optional && value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 7); + a_exitChoose8(); try { - a_body1cont2loopBody1when1(std::move(value), 0); + a_body1cont3loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1cont3loopBody1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1cont3loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 6); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 7); } - void a_callback_error(ActorCallback< AtomicRestoreActor, 6, Optional >*,Error err) + void a_callback_error(ActorCallback< AtomicRestoreActor, 7, Optional >*,Error err) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 7); + a_exitChoose8(); try { - a_body1cont2loopBody1Catch1(err, 0); + a_body1cont3loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1cont3loopBody1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1cont3loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 6); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 7); } - int a_body1cont2loopBody1cont3(int loopDepth) + int a_body1cont3loopBody1cont3(int loopDepth) { - loopDepth = a_body1cont2loopBody1cont6(loopDepth); + loopDepth = a_body1cont3loopBody1cont6(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont5(Void const& _,int loopDepth) + int a_body1cont3loopBody1cont5(Void const& _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont3(loopDepth); + loopDepth = a_body1cont3loopBody1cont3(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont5(Void && _,int loopDepth) + int a_body1cont3loopBody1cont5(Void && _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont3(loopDepth); + loopDepth = a_body1cont3loopBody1cont3(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont2when1(Void const& _,int loopDepth) + int a_body1cont3loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont5(_, loopDepth); + loopDepth = a_body1cont3loopBody1cont5(_, loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont2when1(Void && _,int loopDepth) + int a_body1cont3loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont5(std::move(_), loopDepth); + loopDepth = a_body1cont3loopBody1cont5(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose8() + void a_exitChoose9() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AtomicRestoreActor, 7, Void >::remove(); + static_cast(this)->ActorCallback< AtomicRestoreActor, 8, Void >::remove(); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 7, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 8, Void >*,Void const& value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 7); - a_exitChoose8(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 8); + a_exitChoose9(); try { - a_body1cont2loopBody1cont2when1(value, 0); + a_body1cont3loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1cont3loopBody1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1cont3loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 7); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 8); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 7, Void >*,Void && value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 8, Void >*,Void && value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 7); - a_exitChoose8(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 8); + a_exitChoose9(); try { - a_body1cont2loopBody1cont2when1(std::move(value), 0); + a_body1cont3loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1cont3loopBody1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1cont3loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 7); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 8); } - void a_callback_error(ActorCallback< AtomicRestoreActor, 7, Void >*,Error err) + void a_callback_error(ActorCallback< AtomicRestoreActor, 8, Void >*,Error err) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 7); - a_exitChoose8(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 8); + a_exitChoose9(); try { - a_body1cont2loopBody1Catch1(err, 0); + a_body1cont3loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1cont2loopBody1Catch1(error, 0); + a_body1cont3loopBody1Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1Catch1(unknown_error(), 0); + a_body1cont3loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 7); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 8); } - int a_body1cont2loopBody1cont6(int loopDepth) + int a_body1cont3loopBody1cont6(int loopDepth) { try { - loopDepth = a_body1cont2loopBody1cont1(loopDepth); + loopDepth = a_body1cont3loopBody1cont1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); @@ -50531,70 +58637,70 @@ class AtomicRestoreActorState { return loopDepth; } - int a_body1cont2loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1cont3loopBody1Catch1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont1(loopDepth); + loopDepth = a_body1cont3loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont2loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1cont3loopBody1Catch1cont1(Void && _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont1(loopDepth); + loopDepth = a_body1cont3loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont2loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont3loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2loopBody1Catch1cont1(_, loopDepth); + loopDepth = a_body1cont3loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1cont2loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1cont3loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2loopBody1Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont3loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose9() + void a_exitChoose10() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AtomicRestoreActor, 8, Void >::remove(); + static_cast(this)->ActorCallback< AtomicRestoreActor, 9, Void >::remove(); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 8, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 9, Void >*,Void const& value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 8); - a_exitChoose9(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 9); + a_exitChoose10(); try { - a_body1cont2loopBody1Catch1when1(value, 0); + a_body1cont3loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 8); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 9); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 8, Void >*,Void && value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 9, Void >*,Void && value) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 8); - a_exitChoose9(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 9); + a_exitChoose10(); try { - a_body1cont2loopBody1Catch1when1(std::move(value), 0); + a_body1cont3loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 8); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 9); } - void a_callback_error(ActorCallback< AtomicRestoreActor, 8, Void >*,Error err) + void a_callback_error(ActorCallback< AtomicRestoreActor, 9, Void >*,Error err) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 8); - a_exitChoose9(); + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 9); + a_exitChoose10(); try { a_body1Catch1(err, 0); } @@ -50603,59 +58709,59 @@ class AtomicRestoreActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 8); + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 9); } - int a_body1cont4(int loopDepth) + int a_body1cont5(int loopDepth) { - #line 5518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_12 = success(waitBackup(backupAgent, cx, tagName.toString(), StopWhenDone::True)); - #line 5518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_13 = success(waitBackup(backupAgent, cx, tagName.toString(), StopWhenDone::True)); + #line 6364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 50615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_12.isReady()) { if (__when_expr_12.isError()) return a_body1Catch1(__when_expr_12.getError(), loopDepth); else return a_body1cont4when1(__when_expr_12.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 13; - #line 5518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_12.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 50620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 58721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_13.isReady()) { if (__when_expr_13.isError()) return a_body1Catch1(__when_expr_13.getError(), loopDepth); else return a_body1cont5when1(__when_expr_13.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 14; + #line 6364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_13.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont3loopHead1(int loopDepth) + int a_body1cont4loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont3loopBody1(loopDepth); + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont4loopBody1(loopDepth); return loopDepth; } - int a_body1cont3loopBody1(int loopDepth) + int a_body1cont4loopBody1(int loopDepth) { try { - #line 5506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_9 = discontinueBackup(backupAgent, ryw_tr, tagName); - #line 5506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 50639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1cont3loopBody1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1cont3loopBody1when1(__when_expr_9.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 10; - #line 5506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_9.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 50644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_10 = discontinueBackup(backupAgent, ryw_tr, tagName); + #line 6352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); + #line 58745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1cont4loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont4loopBody1when1(__when_expr_10.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 11; + #line 6352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_10.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1cont3loopBody1Catch1(error, loopDepth); + loopDepth = a_body1cont4loopBody1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1cont3loopBody1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1cont4loopBody1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont3break1(int loopDepth) + int a_body1cont4break1(int loopDepth) { try { - return a_body1cont4(loopDepth); + return a_body1cont5(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -50665,31 +58771,31 @@ class AtomicRestoreActorState { return loopDepth; } - int a_body1cont3loopBody1cont1(int loopDepth) + int a_body1cont4loopBody1cont1(int loopDepth) { - if (loopDepth == 0) return a_body1cont3loopHead1(0); + if (loopDepth == 0) return a_body1cont4loopHead1(0); return loopDepth; } - int a_body1cont3loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1cont4loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 5511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (e.code() == error_code_backup_unneeded || e.code() == error_code_backup_duplicate) - #line 50679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 58785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - return a_body1cont3break1(loopDepth==0?0:loopDepth-1); // break + return a_body1cont4break1(loopDepth==0?0:loopDepth-1); // break } - #line 5514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_11 = ryw_tr->onError(e); - #line 5514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_12 = ryw_tr->onError(e); + #line 6360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 50687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1Catch1(__when_expr_11.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1Catch1when1(__when_expr_11.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 12; - #line 5514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_11.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 50692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 58793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_12.isReady()) { if (__when_expr_12.isError()) return a_body1Catch1(__when_expr_12.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1Catch1when1(__when_expr_12.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 13; + #line 6360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_12.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -50700,128 +58806,47 @@ class AtomicRestoreActorState { return loopDepth; } - int a_body1cont3loopBody1cont2(Void const& _,int loopDepth) + int a_body1cont4loopBody1cont2(Void const& _,int loopDepth) { - #line 5507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_10 = ryw_tr->commit(); - #line 5507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 50709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1cont3loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont3loopBody1cont2when1(__when_expr_10.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 11; - #line 5507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_10.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 50714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_11 = ryw_tr->commit(); + #line 6353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); + #line 58815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1cont4loopBody1Catch1(__when_expr_11.getError(), loopDepth); else return a_body1cont4loopBody1cont2when1(__when_expr_11.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 12; + #line 6353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_11.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont3loopBody1cont2(Void && _,int loopDepth) + int a_body1cont4loopBody1cont2(Void && _,int loopDepth) { - #line 5507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_10 = ryw_tr->commit(); - #line 5507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1Catch1(actor_cancelled(), loopDepth); - #line 50725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1cont3loopBody1Catch1(__when_expr_10.getError(), loopDepth); else return a_body1cont3loopBody1cont2when1(__when_expr_10.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 11; - #line 5507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_10.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 50730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_11 = ryw_tr->commit(); + #line 6353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); + #line 58831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1cont4loopBody1Catch1(__when_expr_11.getError(), loopDepth); else return a_body1cont4loopBody1cont2when1(__when_expr_11.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 12; + #line 6353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_11.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont3loopBody1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont3loopBody1cont2(_, loopDepth); - - return loopDepth; - } - int a_body1cont3loopBody1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont3loopBody1cont2(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose10() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AtomicRestoreActor, 9, Void >::remove(); - - } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 9, Void >*,Void const& value) - { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 9); - a_exitChoose10(); - try { - a_body1cont3loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1cont3loopBody1Catch1(error, 0); - } catch (...) { - a_body1cont3loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 9); - - } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 9, Void >*,Void && value) - { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 9); - a_exitChoose10(); - try { - a_body1cont3loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont3loopBody1Catch1(error, 0); - } catch (...) { - a_body1cont3loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 9); - - } - void a_callback_error(ActorCallback< AtomicRestoreActor, 9, Void >*,Error err) - { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 9); - a_exitChoose10(); - try { - a_body1cont3loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont3loopBody1Catch1(error, 0); - } catch (...) { - a_body1cont3loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 9); - - } - int a_body1cont3loopBody1cont3(Void const& _,int loopDepth) - { - #line 5508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("AS_DiscontinuedBackup").log(); - #line 50802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - return a_body1cont3break1(loopDepth==0?0:loopDepth-1); // break - - return loopDepth; - } - int a_body1cont3loopBody1cont3(Void && _,int loopDepth) - { - #line 5508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("AS_DiscontinuedBackup").log(); - #line 50811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - return a_body1cont3break1(loopDepth==0?0:loopDepth-1); // break - - return loopDepth; - } - int a_body1cont3loopBody1cont2when1(Void const& _,int loopDepth) + int a_body1cont4loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont3(_, loopDepth); + loopDepth = a_body1cont4loopBody1cont2(_, loopDepth); return loopDepth; } - int a_body1cont3loopBody1cont2when1(Void && _,int loopDepth) + int a_body1cont4loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont3(std::move(_), loopDepth); + loopDepth = a_body1cont4loopBody1cont2(std::move(_), loopDepth); return loopDepth; } @@ -50836,12 +58861,12 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 10); a_exitChoose11(); try { - a_body1cont3loopBody1cont2when1(value, 0); + a_body1cont4loopBody1when1(value, 0); } catch (Error& error) { - a_body1cont3loopBody1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 10); @@ -50851,12 +58876,12 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 10); a_exitChoose11(); try { - a_body1cont3loopBody1cont2when1(std::move(value), 0); + a_body1cont4loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1cont3loopBody1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 10); @@ -50866,37 +58891,43 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 10); a_exitChoose11(); try { - a_body1cont3loopBody1Catch1(err, 0); + a_body1cont4loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1cont3loopBody1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 10); } - int a_body1cont3loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1cont4loopBody1cont3(Void const& _,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont1(loopDepth); + #line 6354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("AS_DiscontinuedBackup").log(); + #line 58908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + return a_body1cont4break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1cont3loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1cont4loopBody1cont3(Void && _,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont1(loopDepth); + #line 6354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("AS_DiscontinuedBackup").log(); + #line 58917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + return a_body1cont4break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1cont3loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont4loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont3loopBody1Catch1cont1(_, loopDepth); + loopDepth = a_body1cont4loopBody1cont3(_, loopDepth); return loopDepth; } - int a_body1cont3loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1cont4loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont3loopBody1Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont4loopBody1cont3(std::move(_), loopDepth); return loopDepth; } @@ -50911,12 +58942,12 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 11); a_exitChoose12(); try { - a_body1cont3loopBody1Catch1when1(value, 0); + a_body1cont4loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 11); @@ -50926,12 +58957,12 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 11); a_exitChoose12(); try { - a_body1cont3loopBody1Catch1when1(std::move(value), 0); + a_body1cont4loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 11); @@ -50941,51 +58972,37 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 11); a_exitChoose12(); try { - a_body1Catch1(err, 0); + a_body1cont4loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 11); } - int a_body1cont5(Void const& _,int loopDepth) + int a_body1cont4loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 5519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("AS_BackupStopped").log(); - #line 5521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ryw_tr->reset(); - #line 5522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 50962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont5loopHead1(loopDepth); + loopDepth = a_body1cont4loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont5(Void && _,int loopDepth) + int a_body1cont4loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 5519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("AS_BackupStopped").log(); - #line 5521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ryw_tr->reset(); - #line 5522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ; - #line 50975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = a_body1cont5loopHead1(loopDepth); + loopDepth = a_body1cont4loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont4when1(Void const& _,int loopDepth) + int a_body1cont4loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont5(_, loopDepth); + loopDepth = a_body1cont4loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1cont4when1(Void && _,int loopDepth) + int a_body1cont4loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont5(std::move(_), loopDepth); + loopDepth = a_body1cont4loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } @@ -51000,7 +59017,7 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 12); a_exitChoose13(); try { - a_body1cont4when1(value, 0); + a_body1cont4loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -51015,7 +59032,7 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 12); a_exitChoose13(); try { - a_body1cont4when1(std::move(value), 0); + a_body1cont4loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -51040,208 +59057,222 @@ class AtomicRestoreActorState { fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 12); } - int a_body1cont6(int loopDepth) + int a_body1cont6(Void const& _,int loopDepth) { - #line 5539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture> __when_expr_15 = backupConfig.backupContainer().getOrThrow(cx); - #line 5539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_15.isReady()) { if (__when_expr_15.isError()) return a_body1Catch1(__when_expr_15.getError(), loopDepth); else return a_body1cont6when1(__when_expr_15.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 16; - #line 5539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_15.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 51054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 6365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("AS_BackupStopped").log(); + #line 6367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ryw_tr->reset(); + #line 6368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 59068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont6loopHead1(loopDepth); return loopDepth; } - int a_body1cont5loopHead1(int loopDepth) + int a_body1cont6(Void && _,int loopDepth) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont5loopBody1(loopDepth); + #line 6365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("AS_BackupStopped").log(); + #line 6367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ryw_tr->reset(); + #line 6368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 59081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont6loopHead1(loopDepth); return loopDepth; } - int a_body1cont5loopBody1(int loopDepth) + int a_body1cont5when1(Void const& _,int loopDepth) { - try { - #line 5525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ryw_tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 5526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ryw_tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 5527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - for( auto& range : ranges ) { - #line 5528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ryw_tr->addReadConflictRange(range); - #line 5529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - ryw_tr->clear(range); - #line 51079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - } - #line 5531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_13 = ryw_tr->commit(); - #line 5531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont5loopBody1Catch1(actor_cancelled(), loopDepth); - #line 51085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_13.isReady()) { if (__when_expr_13.isError()) return a_body1cont5loopBody1Catch1(__when_expr_13.getError(), loopDepth); else return a_body1cont5loopBody1when1(__when_expr_13.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 14; - #line 5531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_13.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont5loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont5loopBody1Catch1(unknown_error(), loopDepth); - } + loopDepth = a_body1cont6(_, loopDepth); return loopDepth; } - int a_body1cont5break1(int loopDepth) + int a_body1cont5when1(Void && _,int loopDepth) { - try { - return a_body1cont6(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } + loopDepth = a_body1cont6(std::move(_), loopDepth); return loopDepth; } - int a_body1cont5loopBody1cont1(int loopDepth) + void a_exitChoose14() { - if (loopDepth == 0) return a_body1cont5loopHead1(0); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AtomicRestoreActor, 13, Void >::remove(); - return loopDepth; } - int a_body1cont5loopBody1Catch1(const Error& e,int loopDepth=0) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 13, Void >*,Void const& value) { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 13); + a_exitChoose14(); try { - #line 5535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_14 = ryw_tr->onError(e); - #line 5535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 51127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_14.isReady()) { if (__when_expr_14.isError()) return a_body1Catch1(__when_expr_14.getError(), std::max(0, loopDepth - 1)); else return a_body1cont5loopBody1Catch1when1(__when_expr_14.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 15; - #line 5535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_14.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + a_body1cont5when1(value, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 13); - return loopDepth; } - int a_body1cont5loopBody1cont2(Void const& _,int loopDepth) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 13, Void >*,Void && value) { - #line 5532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("AS_ClearedRange").log(); - #line 51147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - return a_body1cont5break1(loopDepth==0?0:loopDepth-1); // break + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 13); + a_exitChoose14(); + try { + a_body1cont5when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 13); - return loopDepth; } - int a_body1cont5loopBody1cont2(Void && _,int loopDepth) + void a_callback_error(ActorCallback< AtomicRestoreActor, 13, Void >*,Error err) { - #line 5532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("AS_ClearedRange").log(); - #line 51156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - return a_body1cont5break1(loopDepth==0?0:loopDepth-1); // break + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 13); + a_exitChoose14(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 13); - return loopDepth; } - int a_body1cont5loopBody1when1(Void const& _,int loopDepth) + int a_body1cont7(int loopDepth) { - loopDepth = a_body1cont5loopBody1cont2(_, loopDepth); + #line 6385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture> __when_expr_16 = backupConfig.backupContainer().getOrThrow(cx.getReference()); + #line 6385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 59155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_16.isReady()) { if (__when_expr_16.isError()) return a_body1Catch1(__when_expr_16.getError(), loopDepth); else return a_body1cont7when1(__when_expr_16.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 17; + #line 6385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_16.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 59160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont5loopBody1when1(Void && _,int loopDepth) + int a_body1cont6loopHead1(int loopDepth) { - loopDepth = a_body1cont5loopBody1cont2(std::move(_), loopDepth); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont6loopBody1(loopDepth); return loopDepth; } - void a_exitChoose14() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AtomicRestoreActor, 13, Void >::remove(); - - } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 13, Void >*,Void const& value) + int a_body1cont6loopBody1(int loopDepth) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 13); - a_exitChoose14(); try { - a_body1cont5loopBody1when1(value, 0); + #line 6371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ryw_tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 6372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ryw_tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 6373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto& range : ranges ) { + #line 6374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ryw_tr->addReadConflictRange(range); + #line 6375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ryw_tr->clear(range); + #line 59185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 6377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_14 = ryw_tr->commit(); + #line 6377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont6loopBody1Catch1(actor_cancelled(), loopDepth); + #line 59191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_14.isReady()) { if (__when_expr_14.isError()) return a_body1cont6loopBody1Catch1(__when_expr_14.getError(), loopDepth); else return a_body1cont6loopBody1when1(__when_expr_14.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 15; + #line 6377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_14.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1cont5loopBody1Catch1(error, 0); + loopDepth = a_body1cont6loopBody1Catch1(error, loopDepth); } catch (...) { - a_body1cont5loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1cont6loopBody1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 13); + return loopDepth; } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 13, Void >*,Void && value) + int a_body1cont6break1(int loopDepth) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 13); - a_exitChoose14(); try { - a_body1cont5loopBody1when1(std::move(value), 0); + return a_body1cont7(loopDepth); } catch (Error& error) { - a_body1cont5loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1cont5loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 13); + return loopDepth; } - void a_callback_error(ActorCallback< AtomicRestoreActor, 13, Void >*,Error err) + int a_body1cont6loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1cont6loopHead1(0); + + return loopDepth; + } + int a_body1cont6loopBody1Catch1(const Error& e,int loopDepth=0) { - fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 13); - a_exitChoose14(); try { - a_body1cont5loopBody1Catch1(err, 0); + #line 6381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_15 = ryw_tr->onError(e); + #line 6381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 59233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_15.isReady()) { if (__when_expr_15.isError()) return a_body1Catch1(__when_expr_15.getError(), std::max(0, loopDepth - 1)); else return a_body1cont6loopBody1Catch1when1(__when_expr_15.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 16; + #line 6381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_15.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1cont5loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - a_body1cont5loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } - fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 13); + return loopDepth; } - int a_body1cont5loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1cont6loopBody1cont2(Void const& _,int loopDepth) { - loopDepth = a_body1cont5loopBody1cont1(loopDepth); + #line 6378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("AS_ClearedRange").log(); + #line 59253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + return a_body1cont6break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1cont5loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1cont6loopBody1cont2(Void && _,int loopDepth) { - loopDepth = a_body1cont5loopBody1cont1(loopDepth); + #line 6378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("AS_ClearedRange").log(); + #line 59262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + return a_body1cont6break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1cont5loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont6loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont5loopBody1Catch1cont1(_, loopDepth); + loopDepth = a_body1cont6loopBody1cont2(_, loopDepth); return loopDepth; } - int a_body1cont5loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1cont6loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont5loopBody1Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont6loopBody1cont2(std::move(_), loopDepth); return loopDepth; } @@ -51256,12 +59287,12 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 14); a_exitChoose15(); try { - a_body1cont5loopBody1Catch1when1(value, 0); + a_body1cont6loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont6loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont6loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 14); @@ -51271,12 +59302,12 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 14); a_exitChoose15(); try { - a_body1cont5loopBody1Catch1when1(std::move(value), 0); + a_body1cont6loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont6loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont6loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 14); @@ -51286,126 +59317,52 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 14); a_exitChoose15(); try { - a_body1Catch1(err, 0); + a_body1cont6loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont6loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont6loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 14); } - int a_body1cont7(Reference const& _bc,int loopDepth) + int a_body1cont6loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 5540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference bc = fileBackup::getBackupContainerWithProxy(_bc); - #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (fastRestore) - #line 51305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("AtomicParallelRestoreStartRestore").log(); - #line 5544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version targetVersion = ::invalidVersion; - #line 5545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_16 = submitParallelRestore(cx, tagName, ranges, KeyRef(bc->getURL()), bc->getProxy(), targetVersion, LockDB::True, randomUid, addPrefix, removePrefix); - #line 5545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_16.isReady()) { if (__when_expr_16.isError()) return a_body1Catch1(__when_expr_16.getError(), loopDepth); else return a_body1cont7when1(__when_expr_16.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 17; - #line 5545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_16.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 5565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("AS_StartRestore").log(); - #line 5566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_20 = restore(backupAgent, cx, cx, tagName, KeyRef(bc->getURL()), bc->getProxy(), ranges, WaitForComplete::True, ::invalidVersion, Verbose::True, addPrefix, removePrefix, LockDB::True, OnlyApplyMutationLogs::False, InconsistentSnapshotOnly::False, ::invalidVersion, {}, randomUid); - #line 5566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_20.isReady()) { if (__when_expr_20.isError()) return a_body1Catch1(__when_expr_20.getError(), loopDepth); else return a_body1cont7when2(__when_expr_20.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 21; - #line 5566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_20.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } + loopDepth = a_body1cont6loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont7(Reference && _bc,int loopDepth) + int a_body1cont6loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 5540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Reference bc = fileBackup::getBackupContainerWithProxy(_bc); - #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (fastRestore) - #line 51348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("AtomicParallelRestoreStartRestore").log(); - #line 5544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - Version targetVersion = ::invalidVersion; - #line 5545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_16 = submitParallelRestore(cx, tagName, ranges, KeyRef(bc->getURL()), bc->getProxy(), targetVersion, LockDB::True, randomUid, addPrefix, removePrefix); - #line 5545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_16.isReady()) { if (__when_expr_16.isError()) return a_body1Catch1(__when_expr_16.getError(), loopDepth); else return a_body1cont7when1(__when_expr_16.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 17; - #line 5545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_16.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 5565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("AS_StartRestore").log(); - #line 5566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_20 = restore(backupAgent, cx, cx, tagName, KeyRef(bc->getURL()), bc->getProxy(), ranges, WaitForComplete::True, ::invalidVersion, Verbose::True, addPrefix, removePrefix, LockDB::True, OnlyApplyMutationLogs::False, InconsistentSnapshotOnly::False, ::invalidVersion, {}, randomUid); - #line 5566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_20.isReady()) { if (__when_expr_20.isError()) return a_body1Catch1(__when_expr_20.getError(), loopDepth); else return a_body1cont7when2(__when_expr_20.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 21; - #line 5566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_20.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } + loopDepth = a_body1cont6loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont6when1(Reference const& _bc,int loopDepth) + int a_body1cont6loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont7(_bc, loopDepth); + loopDepth = a_body1cont6loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1cont6when1(Reference && _bc,int loopDepth) + int a_body1cont6loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont7(std::move(_bc), loopDepth); + loopDepth = a_body1cont6loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose16() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AtomicRestoreActor, 15, Reference >::remove(); + static_cast(this)->ActorCallback< AtomicRestoreActor, 15, Void >::remove(); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 15, Reference >*,Reference const& value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 15, Void >*,Void const& value) { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 15); a_exitChoose16(); try { - a_body1cont6when1(value, 0); + a_body1cont6loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -51415,12 +59372,12 @@ class AtomicRestoreActorState { fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 15); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 15, Reference >*,Reference && value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 15, Void >*,Void && value) { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 15); a_exitChoose16(); try { - a_body1cont6when1(std::move(value), 0); + a_body1cont6loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -51430,7 +59387,7 @@ class AtomicRestoreActorState { fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 15); } - void a_callback_error(ActorCallback< AtomicRestoreActor, 15, Reference >*,Error err) + void a_callback_error(ActorCallback< AtomicRestoreActor, 15, Void >*,Error err) { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 15); a_exitChoose16(); @@ -51445,65 +59402,119 @@ class AtomicRestoreActorState { fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 15); } - int a_body1cont9(Void const& _,int loopDepth) - { - #line 5555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - hasPrefix = (addPrefix.size() > 0 || removePrefix.size() > 0); - #line 5556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("AtomicParallelRestoreWaitForRestoreFinish").detail("HasPrefix", hasPrefix); - #line 5557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_17 = parallelRestoreFinish(cx, randomUid, UnlockDB{ !hasPrefix }); - #line 5557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_17.isReady()) { if (__when_expr_17.isError()) return a_body1Catch1(__when_expr_17.getError(), loopDepth); else return a_body1cont9when1(__when_expr_17.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 18; - #line 5557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_17.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont9(Void && _,int loopDepth) + int a_body1cont8(int loopDepth) { - #line 5555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - hasPrefix = (addPrefix.size() > 0 || removePrefix.size() > 0); - #line 5556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - TraceEvent("AtomicParallelRestoreWaitForRestoreFinish").detail("HasPrefix", hasPrefix); - #line 5557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_17 = parallelRestoreFinish(cx, randomUid, UnlockDB{ !hasPrefix }); - #line 5557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_17.isReady()) { if (__when_expr_17.isError()) return a_body1Catch1(__when_expr_17.getError(), loopDepth); else return a_body1cont9when1(__when_expr_17.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 18; - #line 5557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_17.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 6386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bc = fileBackup::getBackupContainerWithProxy(bc); + #line 6388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (fastRestore) + #line 59411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("AtomicParallelRestoreStartRestore").log(); + #line 6390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version targetVersion = ::invalidVersion; + #line 6391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_17 = submitParallelRestore(cx, tagName, ranges, KeyRef(bc->getURL()), bc->getProxy(), targetVersion, LockDB::True, randomUid, addPrefix, removePrefix); + #line 6391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 59421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_17.isReady()) { if (__when_expr_17.isError()) return a_body1Catch1(__when_expr_17.getError(), loopDepth); else return a_body1cont8when1(__when_expr_17.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 18; + #line 6391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_17.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 6411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("AS_StartRestore").log(); + #line 6412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + restoreRange = Standalone>(); + #line 6413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + systemRestoreRange = Standalone>(); + #line 6414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + for( auto r : ranges ) { + #line 6415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (config.tenantMode != TenantMode::REQUIRED || !r.intersects(getSystemBackupRanges())) + #line 59441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + restoreRange.push_back_deep(restoreRange.arena(), r); + #line 59445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + else + { + #line 6418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRangeRef normalKeyRange = r & normalKeys; + #line 6419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRangeRef systemKeyRange = r & systemKeys; + #line 6420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!normalKeyRange.empty()) + #line 59455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + restoreRange.push_back_deep(restoreRange.arena(), normalKeyRange); + #line 59459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!systemKeyRange.empty()) + #line 59463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + systemRestoreRange.push_back_deep(systemRestoreRange.arena(), systemKeyRange); + #line 59467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + } + } + } + #line 6428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!systemRestoreRange.empty()) + #line 59473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_21 = success(restore(backupAgent, cx, cx, "system_restore"_sr, KeyRef(bc->getURL()), bc->getProxy(), systemRestoreRange, {}, WaitForComplete::True, ::invalidVersion, Verbose::True, addPrefix, removePrefix, LockDB::True, UnlockDB::False, OnlyApplyMutationLogs::False, InconsistentSnapshotOnly::False, {}, randomUid)); + #line 6430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 59479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_21.isReady()) { if (__when_expr_21.isError()) return a_body1Catch1(__when_expr_21.getError(), loopDepth); else return a_body1cont8when2(__when_expr_21.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 22; + #line 6430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_21.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont11(loopDepth); + } + } return loopDepth; } - int a_body1cont7when1(Void const& _,int loopDepth) + int a_body1cont7when1(Reference const& __bc,int loopDepth) { - loopDepth = a_body1cont9(_, loopDepth); + #line 6385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + bc = __bc; + #line 59499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont8(loopDepth); return loopDepth; } - int a_body1cont7when1(Void && _,int loopDepth) + int a_body1cont7when1(Reference && __bc,int loopDepth) { - loopDepth = a_body1cont9(std::move(_), loopDepth); + bc = std::move(__bc); + loopDepth = a_body1cont8(loopDepth); return loopDepth; } void a_exitChoose17() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AtomicRestoreActor, 16, Void >::remove(); + static_cast(this)->ActorCallback< AtomicRestoreActor, 16, Reference >::remove(); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 16, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 16, Reference >*,Reference const& value) { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 16); a_exitChoose17(); @@ -51518,7 +59529,7 @@ class AtomicRestoreActorState { fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 16); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 16, Void >*,Void && value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 16, Reference >*,Reference && value) { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 16); a_exitChoose17(); @@ -51533,7 +59544,7 @@ class AtomicRestoreActorState { fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 16); } - void a_callback_error(ActorCallback< AtomicRestoreActor, 16, Void >*,Error err) + void a_callback_error(ActorCallback< AtomicRestoreActor, 16, Reference >*,Error err) { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 16); a_exitChoose17(); @@ -51550,61 +59561,51 @@ class AtomicRestoreActorState { } int a_body1cont10(Void const& _,int loopDepth) { - #line 5559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (hasPrefix) - #line 51555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_18 = transformRestoredDatabase(cx, ranges, addPrefix, removePrefix); - #line 5560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_18.isReady()) { if (__when_expr_18.isError()) return a_body1Catch1(__when_expr_18.getError(), loopDepth); else return a_body1cont10when1(__when_expr_18.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 19; - #line 5560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_18.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont10cont1(loopDepth); - } + #line 6401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + hasPrefix = (addPrefix.size() > 0 || removePrefix.size() > 0); + #line 6402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("AtomicParallelRestoreWaitForRestoreFinish").detail("HasPrefix", hasPrefix); + #line 6403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_18 = parallelRestoreFinish(cx, randomUid, UnlockDB{ !hasPrefix }); + #line 6403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 59572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_18.isReady()) { if (__when_expr_18.isError()) return a_body1Catch1(__when_expr_18.getError(), loopDepth); else return a_body1cont10when1(__when_expr_18.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 19; + #line 6403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_18.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } int a_body1cont10(Void && _,int loopDepth) { - #line 5559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (hasPrefix) - #line 51580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - { - #line 5560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_18 = transformRestoredDatabase(cx, ranges, addPrefix, removePrefix); - #line 5560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_18.isReady()) { if (__when_expr_18.isError()) return a_body1Catch1(__when_expr_18.getError(), loopDepth); else return a_body1cont10when1(__when_expr_18.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 19; - #line 5560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_18.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont10cont1(loopDepth); - } + #line 6401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + hasPrefix = (addPrefix.size() > 0 || removePrefix.size() > 0); + #line 6402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + TraceEvent("AtomicParallelRestoreWaitForRestoreFinish").detail("HasPrefix", hasPrefix); + #line 6403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_18 = parallelRestoreFinish(cx, randomUid, UnlockDB{ !hasPrefix }); + #line 6403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 59592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_18.isReady()) { if (__when_expr_18.isError()) return a_body1Catch1(__when_expr_18.getError(), loopDepth); else return a_body1cont10when1(__when_expr_18.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 19; + #line 6403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_18.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont9when1(Void const& _,int loopDepth) + int a_body1cont8when1(Void const& _,int loopDepth) { loopDepth = a_body1cont10(_, loopDepth); return loopDepth; } - int a_body1cont9when1(Void && _,int loopDepth) + int a_body1cont8when1(Void && _,int loopDepth) { loopDepth = a_body1cont10(std::move(_), loopDepth); @@ -51621,7 +59622,7 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 17); a_exitChoose18(); try { - a_body1cont9when1(value, 0); + a_body1cont8when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -51636,7 +59637,7 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 17); a_exitChoose18(); try { - a_body1cont9when1(std::move(value), 0); + a_body1cont8when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -51661,59 +59662,65 @@ class AtomicRestoreActorState { fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 17); } - int a_body1cont10cont1(int loopDepth) - { - #line 5563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(-1); this->~AtomicRestoreActorState(); static_cast(this)->destroy(); return 0; } - #line 51668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Version >::value()) Version(-1); - this->~AtomicRestoreActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont10cont2(Void const& _,int loopDepth) + int a_body1cont10cont1(Void const& _,int loopDepth) { - #line 5561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_19 = unlockDatabase(cx, randomUid); - #line 5561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_19.isReady()) { if (__when_expr_19.isError()) return a_body1Catch1(__when_expr_19.getError(), loopDepth); else return a_body1cont10cont2when1(__when_expr_19.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 20; - #line 5561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_19.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 6405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (hasPrefix) + #line 59669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_19 = transformRestoredDatabase(cx, ranges, addPrefix, removePrefix); + #line 6406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 59675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_19.isReady()) { if (__when_expr_19.isError()) return a_body1Catch1(__when_expr_19.getError(), loopDepth); else return a_body1cont10cont1when1(__when_expr_19.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 20; + #line 6406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_19.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont10cont2(loopDepth); + } return loopDepth; } - int a_body1cont10cont2(Void && _,int loopDepth) + int a_body1cont10cont1(Void && _,int loopDepth) { - #line 5561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - StrictFuture __when_expr_19 = unlockDatabase(cx, randomUid); - #line 5561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - if (__when_expr_19.isReady()) { if (__when_expr_19.isError()) return a_body1Catch1(__when_expr_19.getError(), loopDepth); else return a_body1cont10cont2when1(__when_expr_19.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 20; - #line 5561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - __when_expr_19.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - loopDepth = 0; + #line 6405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (hasPrefix) + #line 59694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + { + #line 6406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_19 = transformRestoredDatabase(cx, ranges, addPrefix, removePrefix); + #line 6406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 59700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_19.isReady()) { if (__when_expr_19.isError()) return a_body1Catch1(__when_expr_19.getError(), loopDepth); else return a_body1cont10cont1when1(__when_expr_19.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 20; + #line 6406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_19.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont10cont2(loopDepth); + } return loopDepth; } int a_body1cont10when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont10cont2(_, loopDepth); + loopDepth = a_body1cont10cont1(_, loopDepth); return loopDepth; } int a_body1cont10when1(Void && _,int loopDepth) { - loopDepth = a_body1cont10cont2(std::move(_), loopDepth); + loopDepth = a_body1cont10cont1(std::move(_), loopDepth); return loopDepth; } @@ -51768,25 +59775,57 @@ class AtomicRestoreActorState { fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 18); } + int a_body1cont10cont2(int loopDepth) + { + #line 6409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(-1); this->~AtomicRestoreActorState(); static_cast(this)->destroy(); return 0; } + #line 59782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(-1); + this->~AtomicRestoreActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } int a_body1cont10cont3(Void const& _,int loopDepth) { - loopDepth = a_body1cont10cont1(loopDepth); + #line 6407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_20 = unlockDatabase(cx, randomUid); + #line 6407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 59796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_20.isReady()) { if (__when_expr_20.isError()) return a_body1Catch1(__when_expr_20.getError(), loopDepth); else return a_body1cont10cont3when1(__when_expr_20.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 21; + #line 6407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_20.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } int a_body1cont10cont3(Void && _,int loopDepth) { - loopDepth = a_body1cont10cont1(loopDepth); + #line 6407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_20 = unlockDatabase(cx, randomUid); + #line 6407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 59812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_20.isReady()) { if (__when_expr_20.isError()) return a_body1Catch1(__when_expr_20.getError(), loopDepth); else return a_body1cont10cont3when1(__when_expr_20.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 21; + #line 6407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_20.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont10cont2when1(Void const& _,int loopDepth) + int a_body1cont10cont1when1(Void const& _,int loopDepth) { loopDepth = a_body1cont10cont3(_, loopDepth); return loopDepth; } - int a_body1cont10cont2when1(Void && _,int loopDepth) + int a_body1cont10cont1when1(Void && _,int loopDepth) { loopDepth = a_body1cont10cont3(std::move(_), loopDepth); @@ -51803,7 +59842,7 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 19); a_exitChoose20(); try { - a_body1cont10cont2when1(value, 0); + a_body1cont10cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -51818,7 +59857,7 @@ class AtomicRestoreActorState { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 19); a_exitChoose20(); try { - a_body1cont10cont2when1(std::move(value), 0); + a_body1cont10cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -51843,54 +59882,42 @@ class AtomicRestoreActorState { fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 19); } - int a_body1cont11(Version const& ver,int loopDepth) + int a_body1cont10cont4(Void const& _,int loopDepth) { - #line 5584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(ver); this->~AtomicRestoreActorState(); static_cast(this)->destroy(); return 0; } - #line 51850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Version >::value()) Version(ver); - this->~AtomicRestoreActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont10cont2(loopDepth); return loopDepth; } - int a_body1cont11(Version && ver,int loopDepth) + int a_body1cont10cont4(Void && _,int loopDepth) { - #line 5584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(ver); this->~AtomicRestoreActorState(); static_cast(this)->destroy(); return 0; } - #line 51862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" - new (&static_cast(this)->SAV< Version >::value()) Version(ver); - this->~AtomicRestoreActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont10cont2(loopDepth); return loopDepth; } - int a_body1cont7when2(Version const& ver,int loopDepth) + int a_body1cont10cont3when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont11(ver, loopDepth); + loopDepth = a_body1cont10cont4(_, loopDepth); return loopDepth; } - int a_body1cont7when2(Version && ver,int loopDepth) + int a_body1cont10cont3when1(Void && _,int loopDepth) { - loopDepth = a_body1cont11(std::move(ver), loopDepth); + loopDepth = a_body1cont10cont4(std::move(_), loopDepth); return loopDepth; } void a_exitChoose21() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AtomicRestoreActor, 20, Version >::remove(); + static_cast(this)->ActorCallback< AtomicRestoreActor, 20, Void >::remove(); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 20, Version >*,Version const& value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 20, Void >*,Void const& value) { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 20); a_exitChoose21(); try { - a_body1cont7when2(value, 0); + a_body1cont10cont3when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -51900,12 +59927,12 @@ class AtomicRestoreActorState { fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 20); } - void a_callback_fire(ActorCallback< AtomicRestoreActor, 20, Version >*,Version && value) + void a_callback_fire(ActorCallback< AtomicRestoreActor, 20, Void >*,Void && value) { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 20); a_exitChoose21(); try { - a_body1cont7when2(std::move(value), 0); + a_body1cont10cont3when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -51915,7 +59942,7 @@ class AtomicRestoreActorState { fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 20); } - void a_callback_error(ActorCallback< AtomicRestoreActor, 20, Version >*,Error err) + void a_callback_error(ActorCallback< AtomicRestoreActor, 20, Void >*,Error err) { fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 20); a_exitChoose21(); @@ -51930,42 +59957,472 @@ class AtomicRestoreActorState { fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 20); } - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + int a_body1cont11(int loopDepth) + { + #line 6466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_24 = restore(backupAgent, cx, cx, tagName, KeyRef(bc->getURL()), bc->getProxy(), restoreRange, {}, WaitForComplete::True, ::invalidVersion, Verbose::True, addPrefix, removePrefix, LockDB::True, UnlockDB::True, OnlyApplyMutationLogs::False, InconsistentSnapshotOnly::False, {}, randomUid); + #line 6466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 59966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_24.isReady()) { if (__when_expr_24.isError()) return a_body1Catch1(__when_expr_24.getError(), loopDepth); else return a_body1cont11when1(__when_expr_24.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 25; + #line 6466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_24.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont17(Void const& _,int loopDepth) + { + #line 6449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rywTransaction = Reference(new ReadYourWritesTransaction(cx)); + #line 6452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 59982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont17loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont17(Void && _,int loopDepth) + { + #line 6449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rywTransaction = Reference(new ReadYourWritesTransaction(cx)); + #line 6452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ; + #line 59993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont17loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont8when2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont17(_, loopDepth); + + return loopDepth; + } + int a_body1cont8when2(Void && _,int loopDepth) + { + loopDepth = a_body1cont17(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose22() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AtomicRestoreActor, 21, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AtomicRestoreActor, 21, Void >*,Void const& value) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 21); + a_exitChoose22(); + try { + a_body1cont8when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 21); + + } + void a_callback_fire(ActorCallback< AtomicRestoreActor, 21, Void >*,Void && value) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 21); + a_exitChoose22(); + try { + a_body1cont8when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 21); + + } + void a_callback_error(ActorCallback< AtomicRestoreActor, 21, Void >*,Error err) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 21); + a_exitChoose22(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 21); + + } + int a_body1cont17cont1(int loopDepth) + { + loopDepth = a_body1cont11(loopDepth); + + return loopDepth; + } + int a_body1cont17loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont17loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont17loopBody1(int loopDepth) + { + try { + #line 6454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rywTransaction->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 6455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + rywTransaction->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 6456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + oldRestore = RestoreConfig(randomUid); + #line 6457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + oldRestore.clear(rywTransaction); + #line 6458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_22 = rywTransaction->commit(); + #line 6458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont17loopBody1Catch1(actor_cancelled(), loopDepth); + #line 60089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_22.isReady()) { if (__when_expr_22.isError()) return a_body1cont17loopBody1Catch1(__when_expr_22.getError(), loopDepth); else return a_body1cont17loopBody1when1(__when_expr_22.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 23; + #line 6458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_22.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 60094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont17loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont17loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont17break1(int loopDepth) + { + try { + return a_body1cont17cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont17loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1cont17loopHead1(0); + + return loopDepth; + } + int a_body1cont17loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 6461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + StrictFuture __when_expr_23 = rywTransaction->onError(e); + #line 6461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 60131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + if (__when_expr_23.isReady()) { if (__when_expr_23.isError()) return a_body1Catch1(__when_expr_23.getError(), std::max(0, loopDepth - 1)); else return a_body1cont17loopBody1Catch1when1(__when_expr_23.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 24; + #line 6461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + __when_expr_23.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 60136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont17loopBody1cont2(Void const& _,int loopDepth) + { + return a_body1cont17break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1cont17loopBody1cont2(Void && _,int loopDepth) + { + return a_body1cont17break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1cont17loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont17loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont17loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont17loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose23() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AtomicRestoreActor, 22, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AtomicRestoreActor, 22, Void >*,Void const& value) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 22); + a_exitChoose23(); + try { + a_body1cont17loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1cont17loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont17loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 22); + + } + void a_callback_fire(ActorCallback< AtomicRestoreActor, 22, Void >*,Void && value) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 22); + a_exitChoose23(); + try { + a_body1cont17loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont17loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont17loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 22); + + } + void a_callback_error(ActorCallback< AtomicRestoreActor, 22, Void >*,Error err) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 22); + a_exitChoose23(); + try { + a_body1cont17loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont17loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont17loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 22); + + } + int a_body1cont17loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont17loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont17loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1cont17loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont17loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont17loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont17loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont17loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose24() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AtomicRestoreActor, 23, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AtomicRestoreActor, 23, Void >*,Void const& value) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 23); + a_exitChoose24(); + try { + a_body1cont17loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 23); + + } + void a_callback_fire(ActorCallback< AtomicRestoreActor, 23, Void >*,Void && value) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 23); + a_exitChoose24(); + try { + a_body1cont17loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 23); + + } + void a_callback_error(ActorCallback< AtomicRestoreActor, 23, Void >*,Error err) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 23); + a_exitChoose24(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 23); + + } + int a_body1cont11cont1(int loopDepth) + { + #line 6485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(ver); this->~AtomicRestoreActorState(); static_cast(this)->destroy(); return 0; } + #line 60301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(std::move(ver)); // state_var_RVO + this->~AtomicRestoreActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont11when1(Version const& __ver,int loopDepth) + { + #line 6466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + ver = __ver; + #line 60313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + loopDepth = a_body1cont11cont1(loopDepth); + + return loopDepth; + } + int a_body1cont11when1(Version && __ver,int loopDepth) + { + ver = std::move(__ver); + loopDepth = a_body1cont11cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose25() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AtomicRestoreActor, 24, Version >::remove(); + + } + void a_callback_fire(ActorCallback< AtomicRestoreActor, 24, Version >*,Version const& value) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 24); + a_exitChoose25(); + try { + a_body1cont11when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 24); + + } + void a_callback_fire(ActorCallback< AtomicRestoreActor, 24, Version >*,Version && value) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 24); + a_exitChoose25(); + try { + a_body1cont11when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 24); + + } + void a_callback_error(ActorCallback< AtomicRestoreActor, 24, Version >*,Error err) + { + fdb_probe_actor_enter("atomicRestore", reinterpret_cast(this), 24); + a_exitChoose25(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("atomicRestore", reinterpret_cast(this), 24); + + } + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" FileBackupAgent* backupAgent; - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key tagName; - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> ranges; - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key addPrefix; - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key removePrefix; - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UsePartitionedLog fastRestore; - #line 5446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Reference ryw_tr; - #line 5448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" BackupConfig backupConfig; - #line 5453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + DatabaseConfiguration config; + #line 6299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyBackedTag tag; - #line 5456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" EBackupState status; - #line 5469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Transaction tr; - #line 5470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Version commitVersion; - #line 5471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" UID randomUid; - #line 5555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference bc; + #line 6401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" bool hasPrefix; - #line 51963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Standalone> restoreRange; + #line 6413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Standalone> systemRestoreRange; + #line 6449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Reference rywTransaction; + #line 6456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + RestoreConfig oldRestore; + #line 6466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + Version ver; + #line 60420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via atomicRestore() - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" -class AtomicRestoreActor final : public Actor, public ActorCallback< AtomicRestoreActor, 0, UidAndAbortedFlagT >, public ActorCallback< AtomicRestoreActor, 1, EBackupState >, public ActorCallback< AtomicRestoreActor, 2, Void >, public ActorCallback< AtomicRestoreActor, 3, Void >, public ActorCallback< AtomicRestoreActor, 4, Void >, public ActorCallback< AtomicRestoreActor, 5, Void >, public ActorCallback< AtomicRestoreActor, 6, Optional >, public ActorCallback< AtomicRestoreActor, 7, Void >, public ActorCallback< AtomicRestoreActor, 8, Void >, public ActorCallback< AtomicRestoreActor, 9, Void >, public ActorCallback< AtomicRestoreActor, 10, Void >, public ActorCallback< AtomicRestoreActor, 11, Void >, public ActorCallback< AtomicRestoreActor, 12, Void >, public ActorCallback< AtomicRestoreActor, 13, Void >, public ActorCallback< AtomicRestoreActor, 14, Void >, public ActorCallback< AtomicRestoreActor, 15, Reference >, public ActorCallback< AtomicRestoreActor, 16, Void >, public ActorCallback< AtomicRestoreActor, 17, Void >, public ActorCallback< AtomicRestoreActor, 18, Void >, public ActorCallback< AtomicRestoreActor, 19, Void >, public ActorCallback< AtomicRestoreActor, 20, Version >, public FastAllocated, public AtomicRestoreActorState { - #line 51968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +class AtomicRestoreActor final : public Actor, public ActorCallback< AtomicRestoreActor, 0, DatabaseConfiguration >, public ActorCallback< AtomicRestoreActor, 1, UidAndAbortedFlagT >, public ActorCallback< AtomicRestoreActor, 2, EBackupState >, public ActorCallback< AtomicRestoreActor, 3, Void >, public ActorCallback< AtomicRestoreActor, 4, Void >, public ActorCallback< AtomicRestoreActor, 5, Void >, public ActorCallback< AtomicRestoreActor, 6, Void >, public ActorCallback< AtomicRestoreActor, 7, Optional >, public ActorCallback< AtomicRestoreActor, 8, Void >, public ActorCallback< AtomicRestoreActor, 9, Void >, public ActorCallback< AtomicRestoreActor, 10, Void >, public ActorCallback< AtomicRestoreActor, 11, Void >, public ActorCallback< AtomicRestoreActor, 12, Void >, public ActorCallback< AtomicRestoreActor, 13, Void >, public ActorCallback< AtomicRestoreActor, 14, Void >, public ActorCallback< AtomicRestoreActor, 15, Void >, public ActorCallback< AtomicRestoreActor, 16, Reference >, public ActorCallback< AtomicRestoreActor, 17, Void >, public ActorCallback< AtomicRestoreActor, 18, Void >, public ActorCallback< AtomicRestoreActor, 19, Void >, public ActorCallback< AtomicRestoreActor, 20, Void >, public ActorCallback< AtomicRestoreActor, 21, Void >, public ActorCallback< AtomicRestoreActor, 22, Void >, public ActorCallback< AtomicRestoreActor, 23, Void >, public ActorCallback< AtomicRestoreActor, 24, Version >, public FastAllocated, public AtomicRestoreActorState { + #line 60425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -51973,14 +60430,14 @@ class AtomicRestoreActor final : public Actor, public ActorCallback< At #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< AtomicRestoreActor, 0, UidAndAbortedFlagT >; -friend struct ActorCallback< AtomicRestoreActor, 1, EBackupState >; -friend struct ActorCallback< AtomicRestoreActor, 2, Void >; +friend struct ActorCallback< AtomicRestoreActor, 0, DatabaseConfiguration >; +friend struct ActorCallback< AtomicRestoreActor, 1, UidAndAbortedFlagT >; +friend struct ActorCallback< AtomicRestoreActor, 2, EBackupState >; friend struct ActorCallback< AtomicRestoreActor, 3, Void >; friend struct ActorCallback< AtomicRestoreActor, 4, Void >; friend struct ActorCallback< AtomicRestoreActor, 5, Void >; -friend struct ActorCallback< AtomicRestoreActor, 6, Optional >; -friend struct ActorCallback< AtomicRestoreActor, 7, Void >; +friend struct ActorCallback< AtomicRestoreActor, 6, Void >; +friend struct ActorCallback< AtomicRestoreActor, 7, Optional >; friend struct ActorCallback< AtomicRestoreActor, 8, Void >; friend struct ActorCallback< AtomicRestoreActor, 9, Void >; friend struct ActorCallback< AtomicRestoreActor, 10, Void >; @@ -51988,15 +60445,19 @@ friend struct ActorCallback< AtomicRestoreActor, 11, Void >; friend struct ActorCallback< AtomicRestoreActor, 12, Void >; friend struct ActorCallback< AtomicRestoreActor, 13, Void >; friend struct ActorCallback< AtomicRestoreActor, 14, Void >; -friend struct ActorCallback< AtomicRestoreActor, 15, Reference >; -friend struct ActorCallback< AtomicRestoreActor, 16, Void >; +friend struct ActorCallback< AtomicRestoreActor, 15, Void >; +friend struct ActorCallback< AtomicRestoreActor, 16, Reference >; friend struct ActorCallback< AtomicRestoreActor, 17, Void >; friend struct ActorCallback< AtomicRestoreActor, 18, Void >; friend struct ActorCallback< AtomicRestoreActor, 19, Void >; -friend struct ActorCallback< AtomicRestoreActor, 20, Version >; - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +friend struct ActorCallback< AtomicRestoreActor, 20, Void >; +friend struct ActorCallback< AtomicRestoreActor, 21, Void >; +friend struct ActorCallback< AtomicRestoreActor, 22, Void >; +friend struct ActorCallback< AtomicRestoreActor, 23, Void >; +friend struct ActorCallback< AtomicRestoreActor, 24, Version >; + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" AtomicRestoreActor(FileBackupAgent* const& backupAgent,Database const& cx,Key const& tagName,Standalone> const& ranges,Key const& addPrefix,Key const& removePrefix,UsePartitionedLog const& fastRestore) - #line 51999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 60460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), AtomicRestoreActorState(backupAgent, cx, tagName, ranges, addPrefix, removePrefix, fastRestore) { @@ -52014,14 +60475,14 @@ friend struct ActorCallback< AtomicRestoreActor, 20, Version >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< AtomicRestoreActor, 0, UidAndAbortedFlagT >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< AtomicRestoreActor, 1, EBackupState >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< AtomicRestoreActor, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< AtomicRestoreActor, 0, DatabaseConfiguration >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< AtomicRestoreActor, 1, UidAndAbortedFlagT >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< AtomicRestoreActor, 2, EBackupState >*)0, actor_cancelled()); break; case 4: this->a_callback_error((ActorCallback< AtomicRestoreActor, 3, Void >*)0, actor_cancelled()); break; case 5: this->a_callback_error((ActorCallback< AtomicRestoreActor, 4, Void >*)0, actor_cancelled()); break; case 6: this->a_callback_error((ActorCallback< AtomicRestoreActor, 5, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< AtomicRestoreActor, 6, Optional >*)0, actor_cancelled()); break; - case 8: this->a_callback_error((ActorCallback< AtomicRestoreActor, 7, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< AtomicRestoreActor, 6, Void >*)0, actor_cancelled()); break; + case 8: this->a_callback_error((ActorCallback< AtomicRestoreActor, 7, Optional >*)0, actor_cancelled()); break; case 9: this->a_callback_error((ActorCallback< AtomicRestoreActor, 8, Void >*)0, actor_cancelled()); break; case 10: this->a_callback_error((ActorCallback< AtomicRestoreActor, 9, Void >*)0, actor_cancelled()); break; case 11: this->a_callback_error((ActorCallback< AtomicRestoreActor, 10, Void >*)0, actor_cancelled()); break; @@ -52029,24 +60490,28 @@ friend struct ActorCallback< AtomicRestoreActor, 20, Version >; case 13: this->a_callback_error((ActorCallback< AtomicRestoreActor, 12, Void >*)0, actor_cancelled()); break; case 14: this->a_callback_error((ActorCallback< AtomicRestoreActor, 13, Void >*)0, actor_cancelled()); break; case 15: this->a_callback_error((ActorCallback< AtomicRestoreActor, 14, Void >*)0, actor_cancelled()); break; - case 16: this->a_callback_error((ActorCallback< AtomicRestoreActor, 15, Reference >*)0, actor_cancelled()); break; - case 17: this->a_callback_error((ActorCallback< AtomicRestoreActor, 16, Void >*)0, actor_cancelled()); break; + case 16: this->a_callback_error((ActorCallback< AtomicRestoreActor, 15, Void >*)0, actor_cancelled()); break; + case 17: this->a_callback_error((ActorCallback< AtomicRestoreActor, 16, Reference >*)0, actor_cancelled()); break; case 18: this->a_callback_error((ActorCallback< AtomicRestoreActor, 17, Void >*)0, actor_cancelled()); break; case 19: this->a_callback_error((ActorCallback< AtomicRestoreActor, 18, Void >*)0, actor_cancelled()); break; case 20: this->a_callback_error((ActorCallback< AtomicRestoreActor, 19, Void >*)0, actor_cancelled()); break; - case 21: this->a_callback_error((ActorCallback< AtomicRestoreActor, 20, Version >*)0, actor_cancelled()); break; + case 21: this->a_callback_error((ActorCallback< AtomicRestoreActor, 20, Void >*)0, actor_cancelled()); break; + case 22: this->a_callback_error((ActorCallback< AtomicRestoreActor, 21, Void >*)0, actor_cancelled()); break; + case 23: this->a_callback_error((ActorCallback< AtomicRestoreActor, 22, Void >*)0, actor_cancelled()); break; + case 24: this->a_callback_error((ActorCallback< AtomicRestoreActor, 23, Void >*)0, actor_cancelled()); break; + case 25: this->a_callback_error((ActorCallback< AtomicRestoreActor, 24, Version >*)0, actor_cancelled()); break; } } }; - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future atomicRestore( FileBackupAgent* const& backupAgent, Database const& cx, Key const& tagName, Standalone> const& ranges, Key const& addPrefix, Key const& removePrefix, UsePartitionedLog const& fastRestore ) { - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new AtomicRestoreActor(backupAgent, cx, tagName, ranges, addPrefix, removePrefix, fastRestore)); - #line 52046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 60511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 5587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 6488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" // Similar to atomicRestore, only used in simulation test. // locks the database before discontinuing the backup and that same lock is then used while doing the restore. @@ -52097,15 +60562,16 @@ Future FileBackupAgent::restore(Database cx, Key url, Optional proxy, Standalone> ranges, + Standalone> versions, WaitForComplete waitForComplete, Version targetVersion, Verbose verbose, Key addPrefix, Key removePrefix, LockDB lockDB, + UnlockDB unlockDB, OnlyApplyMutationLogs onlyApplyMutationLogs, InconsistentSnapshotOnly inconsistentSnapshotOnly, - Version beginVersion, Optional const& encryptionKeyFileName) { return FileBackupAgentImpl::restore(this, cx, @@ -52114,19 +60580,118 @@ Future FileBackupAgent::restore(Database cx, url, proxy, ranges, + versions, waitForComplete, targetVersion, verbose, addPrefix, removePrefix, lockDB, + unlockDB, onlyApplyMutationLogs, inconsistentSnapshotOnly, - beginVersion, encryptionKeyFileName, deterministicRandom()->randomUniqueID()); } +Future FileBackupAgent::restore(Database cx, + Optional cxOrig, + Key tagName, + Key url, + Optional proxy, + Standalone> ranges, + WaitForComplete waitForComplete, + Version targetVersion, + Verbose verbose, + Key addPrefix, + Key removePrefix, + LockDB lockDB, + UnlockDB unlockDB, + OnlyApplyMutationLogs onlyApplyMutationLogs, + InconsistentSnapshotOnly inconsistentSnapshotOnly, + Version beginVersion, + Optional const& encryptionKeyFileName) { + Standalone> beginVersions; + for (auto i = 0; i < ranges.size(); ++i) { + beginVersions.push_back(beginVersions.arena(), beginVersion); + } + return restore(cx, + cxOrig, + tagName, + url, + proxy, + ranges, + beginVersions, + waitForComplete, + targetVersion, + verbose, + addPrefix, + removePrefix, + lockDB, + unlockDB, + onlyApplyMutationLogs, + inconsistentSnapshotOnly, + encryptionKeyFileName); +} + +Future FileBackupAgent::restore(Database cx, + Optional cxOrig, + Key tagName, + Key url, + Optional proxy, + WaitForComplete waitForComplete, + Version targetVersion, + Verbose verbose, + KeyRange range, + Key addPrefix, + Key removePrefix, + LockDB lockDB, + OnlyApplyMutationLogs onlyApplyMutationLogs, + InconsistentSnapshotOnly inconsistentSnapshotOnly, + Version beginVersion, + Optional const& encryptionKeyFileName) { + Standalone> rangeRef; + if (range.begin.empty() && range.end.empty()) { + addDefaultBackupRanges(rangeRef); + } else { + rangeRef.push_back_deep(rangeRef.arena(), range); + } + Standalone> versionRef; + versionRef.push_back(versionRef.arena(), beginVersion); + + return restore(cx, + cxOrig, + tagName, + url, + proxy, + rangeRef, + versionRef, + waitForComplete, + targetVersion, + verbose, + addPrefix, + removePrefix, + lockDB, + UnlockDB::True, + onlyApplyMutationLogs, + inconsistentSnapshotOnly, + encryptionKeyFileName); +} + +Future FileBackupAgent::atomicRestore(Database cx, + Key tagName, + KeyRange range, + Key addPrefix, + Key removePrefix) { + Standalone> rangeRef; + if (range.begin.empty() && range.end.empty()) { + addDefaultBackupRanges(rangeRef); + } else { + rangeRef.push_back_deep(rangeRef.arena(), range); + } + return atomicRestore(cx, tagName, rangeRef, addPrefix, removePrefix); +} + Future FileBackupAgent::atomicRestore(Database cx, Key tagName, Standalone> ranges, @@ -52159,6 +60724,7 @@ Future FileBackupAgent::submitBackup(Reference int snapshotIntervalSeconds, std::string const& tagName, Standalone> backupRanges, + bool encryptionEnabled, StopWhenDone stopWhenDone, UsePartitionedLog partitionedLog, IncrementalBackupOnly incrementalBackupOnly, @@ -52171,6 +60737,7 @@ Future FileBackupAgent::submitBackup(Reference snapshotIntervalSeconds, tagName, backupRanges, + encryptionEnabled, stopWhenDone, partitionedLog, incrementalBackupOnly, @@ -52247,27 +60814,27 @@ static std::pair insideValidRange(KeyValueRef kv, } // Write [begin, end) in kvs to DB - #line 52250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 60817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" namespace { // This generated class is to be used only via writeKVs() - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class WriteKVsActorState { - #line 52257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 60824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" WriteKVsActorState(Database const& cx,Standalone> const& kvs,int const& begin,int const& end) - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : cx(cx), - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" kvs(kvs), - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" begin(begin), - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" end(end) - #line 52270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 60837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("writeKVs", reinterpret_cast(this)); @@ -52280,16 +60847,16 @@ class WriteKVsActorState { int a_body1(int loopDepth=0) { try { - #line 5788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = runRYWTransaction(cx, [=](Reference tr) -> Future { tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr->setOption(FDBTransactionOptions::LOCK_AWARE); int index = begin; while (index < end) { TraceEvent(SevFRTestInfo, "TransformDatabaseContentsWriteKV") .detail("Index", index) .detail("KVs", kvs.size()) .detail("Key", kvs[index].key) .detail("Value", kvs[index].value); tr->set(kvs[index].key, kvs[index].value); ++index; } return Void(); }); - #line 5788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 52287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 60854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 5788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 52292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 60859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -52310,22 +60877,22 @@ class WriteKVsActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 5805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr = ReadYourWritesTransaction(cx); - #line 5806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 52317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 60884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 5805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr = ReadYourWritesTransaction(cx); - #line 5806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 52328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 60895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -52395,11 +60962,11 @@ class WriteKVsActorState { } int a_body1cont2(int loopDepth) { - #line 5825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevFRTestInfo, "TransformDatabaseContentsWriteKVDone").detail("Begin", begin).detail("End", end); - #line 5827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteKVsActorState(); static_cast(this)->destroy(); return 0; } - #line 52402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 60969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WriteKVsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -52417,26 +60984,26 @@ class WriteKVsActorState { int a_body1cont1loopBody1(int loopDepth) { try { - #line 5808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 5809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr.setOption(FDBTransactionOptions::READ_LOCK_AWARE); - #line 5810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyRef k1 = kvs[begin].key; - #line 5811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - KeyRef k2 = end < kvs.size() ? kvs[end].key : normalKeys.end; - #line 5812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + KeyRef k2 = end < kvs.size() ? kvs[end].key : allKeys.end; + #line 6815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevFRTestInfo, "TransformDatabaseContentsWriteKVReadBack") .detail("Range", KeyRangeRef(k1, k2)) .detail("Begin", begin) .detail("End", end); - #line 5816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = tr.getRange(KeyRangeRef(k1, k2), CLIENT_KNOBS->TOO_MANY); - #line 5816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 52434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 5816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 52439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -52469,18 +61036,18 @@ class WriteKVsActorState { int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 5820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("TransformDatabaseContentsWriteKVReadBackError").error(e); - #line 5821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = tr.onError(e); - #line 5821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 52478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 5821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 52483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -52493,18 +61060,18 @@ class WriteKVsActorState { } int a_body1cont1loopBody1cont2(RangeResult const& readKVs,int loopDepth) { - #line 5817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(readKVs.size() > 0 || begin == end); - #line 52498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1cont1loopBody1cont2(RangeResult && readKVs,int loopDepth) { - #line 5817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(readKVs.size() > 0 || begin == end); - #line 52507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -52647,22 +61214,22 @@ class WriteKVsActorState { fdb_probe_actor_exit("writeKVs", reinterpret_cast(this), 2); } - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> kvs; - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int begin; - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int end; - #line 5805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ReadYourWritesTransaction tr; - #line 52660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via writeKVs() - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class WriteKVsActor final : public Actor, public ActorCallback< WriteKVsActor, 0, Void >, public ActorCallback< WriteKVsActor, 1, RangeResult >, public ActorCallback< WriteKVsActor, 2, Void >, public FastAllocated, public WriteKVsActorState { - #line 52665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -52673,9 +61240,9 @@ class WriteKVsActor final : public Actor, public ActorCallback< WriteKVsAc friend struct ActorCallback< WriteKVsActor, 0, Void >; friend struct ActorCallback< WriteKVsActor, 1, RangeResult >; friend struct ActorCallback< WriteKVsActor, 2, Void >; - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" WriteKVsActor(Database const& cx,Standalone> const& kvs,int const& begin,int const& end) - #line 52678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), WriteKVsActorState(cx, kvs, begin, end) { @@ -52701,42 +61268,42 @@ friend struct ActorCallback< WriteKVsActor, 2, Void >; } }; } - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future writeKVs( Database const& cx, Standalone> const& kvs, int const& begin, int const& end ) { - #line 5787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new WriteKVsActor(cx, kvs, begin, end)); - #line 52708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 5829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 6832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" // restoreRanges is the actual range that has applied removePrefix and addPrefix processed by restore system // Assume: restoreRanges do not overlap which is achieved by ensuring backup ranges do not overlap - #line 52715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" namespace { // This generated class is to be used only via transformDatabaseContents() - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class TransformDatabaseContentsActorState { - #line 52722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TransformDatabaseContentsActorState(Database const& cx,Key const& addPrefix,Key const& removePrefix,Standalone> const& restoreRanges) - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : cx(cx), - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addPrefix(addPrefix), - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" removePrefix(removePrefix), - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreRanges(restoreRanges), - #line 5836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr(cx), - #line 5837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" oldData() - #line 52739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("transformDatabaseContents", reinterpret_cast(this)); @@ -52749,13 +61316,13 @@ class TransformDatabaseContentsActorState { int a_body1(int loopDepth=0) { try { - #line 5839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreWorkloadTransformDatabaseContents") .detail("AddPrefix", addPrefix) .detail("RemovePrefix", removePrefix); - #line 5842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" i = 0; - #line 5843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 52758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -52776,51 +61343,51 @@ class TransformDatabaseContentsActorState { } int a_body1cont1(int loopDepth) { - #line 5866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" newKVs = Standalone>(); - #line 5867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(int i = 0;i < oldData.size();++i) { - #line 5868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key newKey(oldData[i].key); - #line 5869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevFRTestInfo, "TransformDatabaseContents") .detail("Keys", oldData.size()) .detail("Index", i) .detail("GetKey", oldData[i].key) .detail("GetValue", oldData[i].value); - #line 5874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (newKey.size() < removePrefix.size()) - #line 52789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { - #line 5875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevError, "TransformDatabaseContents") .detail("Key", newKey) .detail("RemovePrefix", removePrefix); - #line 52793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" continue; } - #line 5880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" newKey = newKey.removePrefix(removePrefix).withPrefix(addPrefix); - #line 5881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" newKVs.push_back_deep(newKVs.arena(), KeyValueRef(newKey.contents(), oldData[i].value)); - #line 5882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevFRTestInfo, "TransformDatabaseContents") .detail("Keys", newKVs.size()) .detail("Index", i) .detail("NewKey", newKVs.back().key) .detail("NewValue", newKVs.back().value); - #line 52802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupRanges = Standalone>(); - #line 5890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto& range : restoreRanges ) { - #line 5891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyRange tmpRange = range; - #line 5892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupRanges.push_back_deep(backupRanges.arena(), tmpRange.removePrefix(removePrefix).withPrefix(addPrefix)); - #line 52812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_2 = runRYWTransaction(cx, [=](Reference tr) -> Future { tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr->setOption(FDBTransactionOptions::LOCK_AWARE); for (int i = 0; i < restoreRanges.size(); i++) { TraceEvent(SevFRTestInfo, "TransformDatabaseContents") .detail("ClearRestoreRange", restoreRanges[i]) .detail("ClearBackupRange", backupRanges[i]); tr->clear(restoreRanges[i]); tr->clear(backupRanges[i]); } return Void(); }); - #line 5896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 52818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 5896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 52823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -52835,13 +61402,13 @@ class TransformDatabaseContentsActorState { int a_body1loopBody1(int loopDepth) { try { - #line 5845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 5846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 5847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" i = 0; - #line 52844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1loopBody1loopHead1(loopDepth); } catch (Error& error) { @@ -52874,20 +61441,20 @@ class TransformDatabaseContentsActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 5856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreWorkloadTransformDatabaseContentsGetAllKeys") .error(e) .detail("Index", i) .detail("RestoreRange", restoreRanges[i]); - #line 5860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" oldData = Standalone>(); - #line 5861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_1 = tr.onError(e); - #line 5861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 52885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 5861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 52890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -52913,22 +61480,22 @@ class TransformDatabaseContentsActorState { } int a_body1loopBody1loopBody1(int loopDepth) { - #line 5847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!(i < restoreRanges.size())) - #line 52918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 5848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = tr.getRange(restoreRanges[i], CLIENT_KNOBS->TOO_MANY); - #line 5848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 52926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 5848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 52931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -52948,34 +61515,34 @@ class TransformDatabaseContentsActorState { } int a_body1loopBody1loopBody1cont1(RangeResult const& kvs,int loopDepth) { - #line 5849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(!kvs.more); - #line 5850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto kv : kvs ) { - #line 5851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" oldData.push_back_deep(oldData.arena(), KeyValueRef(kv.key, kv.value)); - #line 52957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++i; - #line 52961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1loopHead1(0); return loopDepth; } int a_body1loopBody1loopBody1cont1(RangeResult && kvs,int loopDepth) { - #line 5849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ASSERT(!kvs.more); - #line 5850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for( auto kv : kvs ) { - #line 5851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" oldData.push_back_deep(oldData.arena(), KeyValueRef(kv.key, kv.value)); - #line 52974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ++i; - #line 52978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1loopHead1(0); return loopDepth; @@ -53120,22 +61687,22 @@ class TransformDatabaseContentsActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 5910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr.reset(); - #line 5911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 53127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopHead1(loopDepth); return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 5910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr.reset(); - #line 5911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 53138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont2loopHead1(loopDepth); return loopDepth; @@ -53205,11 +61772,11 @@ class TransformDatabaseContentsActorState { } int a_body1cont6(int loopDepth) { - #line 5929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" fwrites = std::vector>(); - #line 5930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 53212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont6loopHead1(loopDepth); return loopDepth; @@ -53224,20 +61791,20 @@ class TransformDatabaseContentsActorState { int a_body1cont2loopBody1(int loopDepth) { try { - #line 5913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 5914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_3 = tr.getRange(normalKeys, CLIENT_KNOBS->TOO_MANY); - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 53235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont2loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont2loopBody1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 53240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -53270,16 +61837,16 @@ class TransformDatabaseContentsActorState { int a_body1cont2loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 5924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_4 = tr.onError(e); - #line 5924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 53277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 5924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 53282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -53292,11 +61859,11 @@ class TransformDatabaseContentsActorState { } int a_body1cont2loopBody1cont2(RangeResult const& emptyData,int loopDepth) { - #line 5916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(int i = 0;i < emptyData.size();++i) { - #line 5917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevError, "ExpectEmptyData") .detail("Index", i) .detail("Key", emptyData[i].key) .detail("Value", emptyData[i].value); - #line 53299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break @@ -53304,11 +61871,11 @@ class TransformDatabaseContentsActorState { } int a_body1cont2loopBody1cont2(RangeResult && emptyData,int loopDepth) { - #line 5916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(int i = 0;i < emptyData.size();++i) { - #line 5917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevError, "ExpectEmptyData") .detail("Index", i) .detail("Key", emptyData[i].key) .detail("Value", emptyData[i].value); - #line 53311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 61878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break @@ -53454,11 +62021,11 @@ class TransformDatabaseContentsActorState { } int a_body1cont7(int loopDepth) { - #line 5948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr.reset(); - #line 5949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ; - #line 53461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = a_body1cont7loopHead1(loopDepth); return loopDepth; @@ -53473,30 +62040,30 @@ class TransformDatabaseContentsActorState { int a_body1cont6loopBody1(int loopDepth) { try { - #line 5932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" begin = 0; - #line 5933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" len = 0; - #line 5934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(;begin < newKVs.size();) { - #line 5935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" len = std::min(100, newKVs.size() - begin); - #line 5936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" fwrites.push_back(writeKVs(cx, newKVs, begin, begin + len)); - #line 5937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" begin = begin + len; - #line 53488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_5 = waitForAll(fwrites); - #line 5939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont6loopBody1Catch1(actor_cancelled(), loopDepth); - #line 53494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont6loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont6loopBody1when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 5939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 53499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -53529,18 +62096,18 @@ class TransformDatabaseContentsActorState { int a_body1cont6loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 5942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevError, "FastRestoreWorkloadTransformDatabaseContentsUnexpectedErrorOnWriteKVs").error(e); - #line 5943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_6 = tr.onError(e); - #line 5943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 53538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1cont6loopBody1Catch1when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 5943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 53543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -53703,11 +62270,11 @@ class TransformDatabaseContentsActorState { } int a_body1cont8(int loopDepth) { - #line 5970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreWorkloadTransformDatabaseContentsFinish") .detail("AddPrefix", addPrefix) .detail("RemovePrefix", removePrefix); - #line 5974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TransformDatabaseContentsActorState(); static_cast(this)->destroy(); return 0; } - #line 53710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TransformDatabaseContentsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -53725,20 +62292,20 @@ class TransformDatabaseContentsActorState { int a_body1cont7loopBody1(int loopDepth) { try { - #line 5951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 5952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 5953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_7 = tr.getRange(normalKeys, CLIENT_KNOBS->TOO_MANY); - #line 5953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont7loopBody1Catch1(actor_cancelled(), loopDepth); - #line 53736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1cont7loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont7loopBody1when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 5953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 53741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -53771,16 +62338,16 @@ class TransformDatabaseContentsActorState { int a_body1cont7loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 5966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_8 = tr.onError(e); - #line 5966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 53778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), std::max(0, loopDepth - 1)); else return a_body1cont7loopBody1Catch1when1(__when_expr_8.get(), loopDepth); }; static_cast(this)->actor_wait_state = 9; - #line 5966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 53783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -53793,15 +62360,15 @@ class TransformDatabaseContentsActorState { } int a_body1cont7loopBody1cont2(RangeResult const& allData,int loopDepth) { - #line 5954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevFRTestInfo, "SanityCheckData").detail("Size", allData.size()); - #line 5955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(int i = 0;i < allData.size();++i) { - #line 5956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::pair backupRestoreValid = insideValidRange(allData[i], restoreRanges, backupRanges); - #line 5957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(backupRestoreValid.first ? SevFRTestInfo : SevError, "SanityCheckData") .detail("Index", i) .detail("Key", allData[i].key) .detail("Value", allData[i].value) .detail("InsideBackupRange", backupRestoreValid.first) .detail("InsideRestoreRange", backupRestoreValid.second); - #line 53804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } return a_body1cont7break1(loopDepth==0?0:loopDepth-1); // break @@ -53809,15 +62376,15 @@ class TransformDatabaseContentsActorState { } int a_body1cont7loopBody1cont2(RangeResult && allData,int loopDepth) { - #line 5954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevFRTestInfo, "SanityCheckData").detail("Size", allData.size()); - #line 5955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(int i = 0;i < allData.size();++i) { - #line 5956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::pair backupRestoreValid = insideValidRange(allData[i], restoreRanges, backupRanges); - #line 5957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(backupRestoreValid.first ? SevFRTestInfo : SevError, "SanityCheckData") .detail("Index", i) .detail("Key", allData[i].key) .detail("Value", allData[i].value) .detail("InsideBackupRange", backupRestoreValid.first) .detail("InsideRestoreRange", backupRestoreValid.second); - #line 53820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } return a_body1cont7break1(loopDepth==0?0:loopDepth-1); // break @@ -53961,36 +62528,36 @@ class TransformDatabaseContentsActorState { fdb_probe_actor_exit("transformDatabaseContents", reinterpret_cast(this), 8); } - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key addPrefix; - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key removePrefix; - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> restoreRanges; - #line 5836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" ReadYourWritesTransaction tr; - #line 5837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> oldData; - #line 5842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int i; - #line 5866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> newKVs; - #line 5889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> backupRanges; - #line 5929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" std::vector> fwrites; - #line 5932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int begin; - #line 5933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" int len; - #line 53988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via transformDatabaseContents() - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class TransformDatabaseContentsActor final : public Actor, public ActorCallback< TransformDatabaseContentsActor, 0, RangeResult >, public ActorCallback< TransformDatabaseContentsActor, 1, Void >, public ActorCallback< TransformDatabaseContentsActor, 2, Void >, public ActorCallback< TransformDatabaseContentsActor, 3, RangeResult >, public ActorCallback< TransformDatabaseContentsActor, 4, Void >, public ActorCallback< TransformDatabaseContentsActor, 5, Void >, public ActorCallback< TransformDatabaseContentsActor, 6, Void >, public ActorCallback< TransformDatabaseContentsActor, 7, RangeResult >, public ActorCallback< TransformDatabaseContentsActor, 8, Void >, public FastAllocated, public TransformDatabaseContentsActorState { - #line 53993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -54007,9 +62574,9 @@ friend struct ActorCallback< TransformDatabaseContentsActor, 5, Void >; friend struct ActorCallback< TransformDatabaseContentsActor, 6, Void >; friend struct ActorCallback< TransformDatabaseContentsActor, 7, RangeResult >; friend struct ActorCallback< TransformDatabaseContentsActor, 8, Void >; - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TransformDatabaseContentsActor(Database const& cx,Key const& addPrefix,Key const& removePrefix,Standalone> const& restoreRanges) - #line 54012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), TransformDatabaseContentsActorState(cx, addPrefix, removePrefix, restoreRanges) { @@ -54041,39 +62608,39 @@ friend struct ActorCallback< TransformDatabaseContentsActor, 8, Void >; } }; } - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] static Future transformDatabaseContents( Database const& cx, Key const& addPrefix, Key const& removePrefix, Standalone> const& restoreRanges ) { - #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new TransformDatabaseContentsActor(cx, addPrefix, removePrefix, restoreRanges)); - #line 54048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 5976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 6979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" // addPrefix and removePrefix are the options used in the restore request: // every backup key applied removePrefix and addPrefix in restore; // transformRestoredDatabase actor will revert it by remove addPrefix and add removePrefix. - #line 54056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" namespace { // This generated class is to be used only via transformRestoredDatabase() - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" template - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class TransformRestoredDatabaseActorState { - #line 54063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TransformRestoredDatabaseActorState(Database const& cx,Standalone> const& backupRanges,Key const& addPrefix,Key const& removePrefix) - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" : cx(cx), - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" backupRanges(backupRanges), - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" addPrefix(addPrefix), - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" removePrefix(removePrefix) - #line 54076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" { fdb_probe_actor_create("transformRestoredDatabase", reinterpret_cast(this)); @@ -54087,32 +62654,32 @@ class TransformRestoredDatabaseActorState { { try { try { - #line 5985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> restoreRanges; - #line 5986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" for(int i = 0;i < backupRanges.size();++i) { - #line 5987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" KeyRange range(backupRanges[i]); - #line 5988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key begin = range.begin.removePrefix(removePrefix).withPrefix(addPrefix); - #line 5989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key end = range.end.removePrefix(removePrefix).withPrefix(addPrefix); - #line 5990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent("FastRestoreTransformRestoredDatabase") .detail("From", KeyRangeRef(begin.contents(), end.contents())) .detail("To", range); - #line 5993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" restoreRanges.push_back_deep(restoreRanges.arena(), KeyRangeRef(begin.contents(), end.contents())); - #line 54104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } - #line 5995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" StrictFuture __when_expr_0 = transformDatabaseContents(cx, removePrefix, addPrefix, restoreRanges); - #line 5995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 54110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 5995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 54115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -54139,9 +62706,9 @@ class TransformRestoredDatabaseActorState { } int a_body1cont1(int loopDepth) { - #line 6001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 7004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TransformRestoredDatabaseActorState(); static_cast(this)->destroy(); return 0; } - #line 54144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TransformRestoredDatabaseActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -54152,11 +62719,11 @@ class TransformRestoredDatabaseActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 5997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 7000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TraceEvent(SevError, "FastRestoreTransformRestoredDatabaseUnexpectedError").error(e); - #line 5998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 7001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 54159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -54254,20 +62821,20 @@ class TransformRestoredDatabaseActorState { return loopDepth; } - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Database cx; - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Standalone> backupRanges; - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key addPrefix; - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" Key removePrefix; - #line 54265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" }; // This generated class is to be used only via transformRestoredDatabase() - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" class TransformRestoredDatabaseActor final : public Actor, public ActorCallback< TransformRestoredDatabaseActor, 0, Void >, public FastAllocated, public TransformRestoredDatabaseActorState { - #line 54270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -54276,9 +62843,9 @@ class TransformRestoredDatabaseActor final : public Actor, public ActorCal void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< TransformRestoredDatabaseActor, 0, Void >; - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" TransformRestoredDatabaseActor(Database const& cx,Standalone> const& backupRanges,Key const& addPrefix,Key const& removePrefix) - #line 54281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" : Actor(), TransformRestoredDatabaseActorState(cx, backupRanges, addPrefix, removePrefix) { @@ -54302,14 +62869,14 @@ friend struct ActorCallback< TransformRestoredDatabaseActor, 0, Void >; } }; } - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" [[nodiscard]] Future transformRestoredDatabase( Database const& cx, Standalone> const& backupRanges, Key const& addPrefix, Key const& removePrefix ) { - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" return Future(new TransformRestoredDatabaseActor(cx, backupRanges, addPrefix, removePrefix)); - #line 54309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" + #line 62876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.g.cpp" } -#line 6003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" +#line 7006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/FileBackupAgent.actor.cpp" void simulateBlobFailure() { if (BUGGIFY && deterministicRandom()->random01() < 0.01) { // Simulate blob failures diff --git a/src/fdbclient/GenericManagementAPI.actor.g.h b/src/fdbclient/GenericManagementAPI.actor.g.h deleted file mode 100644 index fcb37c1..0000000 --- a/src/fdbclient/GenericManagementAPI.actor.g.h +++ /dev/null @@ -1,7845 +0,0 @@ -#define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -/* - * GenericManagementAPI.actor.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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 -#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_GENERIC_MANAGEMENT_API_ACTOR_G_H) -#define FDBCLIENT_GENERIC_MANAGEMENT_API_ACTOR_G_H -#include "fdbclient/GenericManagementAPI.actor.g.h" -#elif !defined(FDBCLIENT_GENERIC_MANAGEMENT_API_ACTOR_H) -#define FDBCLIENT_GENERIC_MANAGEMENT_API_ACTOR_H - -/* This file defines "management" interfaces that have been templated to support both IClientAPI -and Native version of databases, transactions, etc., and includes functions for performing cluster -managment tasks. It isn't exposed to C clients or anywhere outside our code base and doesn't need -to be versioned. It doesn't do anything you can't do with the standard API and some knowledge of -the contents of the system key space. -*/ - -#include -#include -#include "fdbclient/ClientBooleanParams.h" -#include "fdbclient/DatabaseConfiguration.h" -#include "fdbclient/Status.h" -#include "fdbclient/Subspace.h" -#include "fdbclient/DatabaseConfiguration.h" -#include "fdbclient/Status.h" -#include "fdbclient/SystemData.h" -#include "flow/actorcompiler.h" // has to be last include - -// ConfigurationResult enumerates normal outcomes of changeConfig() and various error -// conditions specific to it. changeConfig may also throw an Error to report other problems. -enum class ConfigurationResult { - NO_OPTIONS_PROVIDED, - CONFLICTING_OPTIONS, - UNKNOWN_OPTION, - INCOMPLETE_CONFIGURATION, - INVALID_CONFIGURATION, - STORAGE_MIGRATION_DISABLED, - DATABASE_ALREADY_CREATED, - DATABASE_CREATED, - DATABASE_UNAVAILABLE, - STORAGE_IN_UNKNOWN_DCID, - REGION_NOT_FULLY_REPLICATED, - MULTIPLE_ACTIVE_REGIONS, - REGIONS_CHANGED, - NOT_ENOUGH_WORKERS, - REGION_REPLICATION_MISMATCH, - DCID_MISSING, - LOCKED_NOT_NEW, - SUCCESS_WARN_PPW_GRADUAL, - SUCCESS, - SUCCESS_WARN_ROCKSDB_EXPERIMENTAL, - DATABASE_CREATED_WARN_ROCKSDB_EXPERIMENTAL, -}; - -enum class CoordinatorsResult { - INVALID_NETWORK_ADDRESSES, - SAME_NETWORK_ADDRESSES, - NOT_COORDINATORS, // FIXME: not detected - DATABASE_UNREACHABLE, // FIXME: not detected - BAD_DATABASE_STATE, - COORDINATOR_UNREACHABLE, - NOT_ENOUGH_MACHINES, - SUCCESS -}; - -struct ConfigureAutoResult { - std::map address_class; - int32_t processes; - int32_t machines; - - std::string old_replication; - int32_t old_commit_proxies; - int32_t old_grv_proxies; - int32_t old_resolvers; - int32_t old_logs; - int32_t old_processes_with_transaction; - int32_t old_machines_with_transaction; - - std::string auto_replication; - int32_t auto_commit_proxies; - int32_t auto_grv_proxies; - int32_t auto_resolvers; - int32_t auto_logs; - int32_t auto_processes_with_transaction; - int32_t auto_machines_with_transaction; - - int32_t desired_commit_proxies; - int32_t desired_grv_proxies; - int32_t desired_resolvers; - int32_t desired_logs; - - ConfigureAutoResult() - : processes(-1), machines(-1), old_commit_proxies(-1), old_grv_proxies(-1), old_resolvers(-1), old_logs(-1), - old_processes_with_transaction(-1), old_machines_with_transaction(-1), auto_commit_proxies(-1), - auto_grv_proxies(-1), auto_resolvers(-1), auto_logs(-1), auto_processes_with_transaction(-1), - auto_machines_with_transaction(-1), desired_commit_proxies(-1), desired_grv_proxies(-1), desired_resolvers(-1), - desired_logs(-1) {} - - bool isValid() const { return processes != -1; } -}; - -ConfigurationResult buildConfiguration( - std::vector const& modeTokens, - std::map& outConf); // Accepts a vector of configuration tokens -ConfigurationResult buildConfiguration( - std::string const& modeString, - std::map& outConf); // Accepts tokens separated by spaces in a single string - -bool isCompleteConfiguration(std::map const& options); - -ConfigureAutoResult parseConfig(StatusObject const& status); - -template -struct transaction_future_type { - using type = typename Transaction::template FutureT; -}; - -template -struct transaction_future_type { - using type = typename transaction_future_type::type; -}; - -template -struct transaction_future_type, T> { - using type = typename transaction_future_type::type; -}; - -// Management API written in template code to support both IClientAPI and NativeAPI -namespace ManagementAPI { - - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -// This generated class is to be used only via changeCachedRange() - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class ChangeCachedRangeActorState { - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ChangeCachedRangeActorState(Reference const& db,KeyRangeRef const& range,bool const& add) - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - : db(db), - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - range(range), - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - add(add), - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr(db->createTransaction()), - #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - sysRange(KeyRangeRef(storageCacheKey(range.begin), storageCacheKey(range.end))), - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - sysRangeClear(KeyRangeRef(storageCacheKey(range.begin), keyAfter(storageCacheKey(range.end)))), - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - privateRange(KeyRangeRef(cacheKeysKey(0, range.begin), cacheKeysKey(0, range.end))), - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - trueValue(storageCacheValue(std::vector{ 0 })), - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - falseValue(storageCacheValue(std::vector{})) - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - fdb_probe_actor_create("changeCachedRange", reinterpret_cast(this)); - - } - ~ChangeCachedRangeActorState() - { - fdb_probe_actor_destroy("changeCachedRange", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ; - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~ChangeCachedRangeActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) - { - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - try { - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->clear(sysRangeClear); - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->clear(privateRange); - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->addReadConflictRange(privateRange); - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - previousFuture = tr->getRange(KeyRangeRef(storageCachePrefix, sysRange.begin), 1, Snapshot::False, Reverse::True); - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_0 = safeThreadFutureToFuture(previousFuture); - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1cont1(int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - err = e; - #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_3 = safeThreadFutureToFuture(tr->onError(e)); - #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - int a_body1loopBody1cont2(RangeResult const& previous,int loopDepth) - { - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - bool prevIsCached = false; - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!previous.empty()) - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::vector prevVal; - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - decodeStorageCacheValue(previous[0].value, prevVal); - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - prevIsCached = !prevVal.empty(); - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (prevIsCached && !add) - #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(sysRange.begin, falseValue); - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(privateRange.begin, serverKeysFalse); - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - else - { - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!prevIsCached && add) - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(sysRange.begin, trueValue); - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(privateRange.begin, serverKeysTrue); - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - afterFuture = tr->getRange(KeyRangeRef(sysRange.end, storageCacheKeys.end), 1, Snapshot::False, Reverse::False); - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_1 = safeThreadFutureToFuture(afterFuture); - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont2(RangeResult && previous,int loopDepth) - { - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - bool prevIsCached = false; - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!previous.empty()) - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::vector prevVal; - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - decodeStorageCacheValue(previous[0].value, prevVal); - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - prevIsCached = !prevVal.empty(); - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (prevIsCached && !add) - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(sysRange.begin, falseValue); - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(privateRange.begin, serverKeysFalse); - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - else - { - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!prevIsCached && add) - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(sysRange.begin, trueValue); - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(privateRange.begin, serverKeysTrue); - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - afterFuture = tr->getRange(KeyRangeRef(sysRange.end, storageCacheKeys.end), 1, Snapshot::False, Reverse::False); - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_1 = safeThreadFutureToFuture(afterFuture); - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1when1(RangeResult const& previous,int loopDepth) - { - loopDepth = a_body1loopBody1cont2(previous, loopDepth); - - return loopDepth; - } - int a_body1loopBody1when1(RangeResult && previous,int loopDepth) - { - loopDepth = a_body1loopBody1cont2(std::move(previous), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeCachedRangeActor, 0, RangeResult >::remove(); - - } - void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 0, RangeResult >*,RangeResult const& value) - { - fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 0, RangeResult >*,RangeResult && value) - { - fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< ChangeCachedRangeActor, 0, RangeResult >*,Error err) - { - fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 0); - - } - int a_body1loopBody1cont3(RangeResult const& after,int loopDepth) - { - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - bool afterIsCached = false; - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!after.empty()) - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::vector afterVal; - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - decodeStorageCacheValue(after[0].value, afterVal); - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - afterIsCached = afterVal.empty(); - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (afterIsCached && !add) - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(sysRange.end, trueValue); - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(privateRange.end, serverKeysTrue); - #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - else - { - #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!afterIsCached && add) - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(sysRange.end, falseValue); - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(privateRange.end, serverKeysFalse); - #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->commit()); - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont3(RangeResult && after,int loopDepth) - { - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - bool afterIsCached = false; - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!after.empty()) - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::vector afterVal; - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - decodeStorageCacheValue(after[0].value, afterVal); - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - afterIsCached = afterVal.empty(); - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (afterIsCached && !add) - #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(sysRange.end, trueValue); - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(privateRange.end, serverKeysTrue); - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - else - { - #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!afterIsCached && add) - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(sysRange.end, falseValue); - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(privateRange.end, serverKeysFalse); - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->commit()); - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont2when1(RangeResult const& after,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(after, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont2when1(RangeResult && after,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(std::move(after), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeCachedRangeActor, 1, RangeResult >::remove(); - - } - void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 1, RangeResult >*,RangeResult const& value) - { - fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 1, RangeResult >*,RangeResult && value) - { - fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< ChangeCachedRangeActor, 1, RangeResult >*,Error err) - { - fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 1); - - } - int a_body1loopBody1cont8(Void const& _,int loopDepth) - { - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeCachedRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~ChangeCachedRangeActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont8(Void && _,int loopDepth) - { - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeCachedRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~ChangeCachedRangeActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont3when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont8(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont3when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont8(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeCachedRangeActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont3when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont3when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< ChangeCachedRangeActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 2); - - } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) - { - #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TraceEvent(SevDebug, "ChangeCachedRangeError").error(err); - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) - { - #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TraceEvent(SevDebug, "ChangeCachedRangeError").error(err); - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeCachedRangeActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 3, Void >*,Void && value) - { - fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< ChangeCachedRangeActor, 3, Void >*,Error err) - { - fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 3); - - } - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference db; - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - KeyRangeRef range; - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - bool add; - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference tr; - #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - KeyRange sysRange; - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - KeyRange sysRangeClear; - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - KeyRange privateRange; - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Value trueValue; - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Value falseValue; - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename DB::TransactionT::template FutureT previousFuture; - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename DB::TransactionT::template FutureT afterFuture; - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Error err; - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -}; -// This generated class is to be used only via changeCachedRange() - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class ChangeCachedRangeActor final : public Actor, public ActorCallback< ChangeCachedRangeActor, 0, RangeResult >, public ActorCallback< ChangeCachedRangeActor, 1, RangeResult >, public ActorCallback< ChangeCachedRangeActor, 2, Void >, public ActorCallback< ChangeCachedRangeActor, 3, Void >, public FastAllocated>, public ChangeCachedRangeActorState> { - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< ChangeCachedRangeActor, 0, RangeResult >; -friend struct ActorCallback< ChangeCachedRangeActor, 1, RangeResult >; -friend struct ActorCallback< ChangeCachedRangeActor, 2, Void >; -friend struct ActorCallback< ChangeCachedRangeActor, 3, Void >; - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ChangeCachedRangeActor(Reference const& db,KeyRangeRef const& range,bool const& add) - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - : Actor(), - ChangeCachedRangeActorState>(db, range, add) - { - fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("changeCachedRange"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ChangeCachedRangeActor, 0, RangeResult >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< ChangeCachedRangeActor, 1, RangeResult >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< ChangeCachedRangeActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< ChangeCachedRangeActor, 3, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -[[nodiscard]] Future changeCachedRange( Reference const& db, KeyRangeRef const& range, bool const& add ) { - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return Future(new ChangeCachedRangeActor(db, range, add)); - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -} - -#line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - -template -Future addCachedRange(Reference db, KeyRangeRef range) { - return changeCachedRange(db, range, true); -} - -template -Future removeCachedRange(Reference db, KeyRangeRef range) { - return changeCachedRange(db, range, false); -} - - #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -// This generated class is to be used only via getWorkers() - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class GetWorkersActorState { - #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - GetWorkersActorState(Reference const& tr,typename Tr::template FutureT const& processClassesF,typename Tr::template FutureT const& processDataF) - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - : tr(tr), - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - processClassesF(processClassesF), - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - processDataF(processDataF) - #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - fdb_probe_actor_create("getWorkers", reinterpret_cast(this)); - - } - ~GetWorkersActorState() - { - fdb_probe_actor_destroy("getWorkers", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - processClassesF = tr->getRange(processClassKeys, CLIENT_KNOBS->TOO_MANY); - #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - processDataF = tr->getRange(workerListKeys, CLIENT_KNOBS->TOO_MANY); - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - processClasses = safeThreadFutureToFuture(processClassesF); - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - processData = safeThreadFutureToFuture(processDataF); - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_0 = success(processClasses) && success(processData); - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~GetWorkersActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) - { - #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ASSERT(!processClasses.get().more && processClasses.get().size() < CLIENT_KNOBS->TOO_MANY); - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ASSERT(!processData.get().more && processData.get().size() < CLIENT_KNOBS->TOO_MANY); - #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::map>, ProcessClass> id_class; - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for(int i = 0;i < processClasses.get().size();i++) { - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - id_class[decodeProcessClassKey(processClasses.get()[i].key)] = decodeProcessClassValue(processClasses.get()[i].value); - #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::vector results; - #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for(int i = 0;i < processData.get().size();i++) { - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ProcessData data = decodeWorkerListValue(processData.get()[i].value); - #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ProcessClass processClass = id_class[data.locality.processId()]; - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (processClass.classSource() == ProcessClass::DBSource || data.processClass.classType() == ProcessClass::UnsetClass) - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - data.processClass = processClass; - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (data.processClass.classType() != ProcessClass::TesterClass) - #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - results.push_back(data); - #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(results); this->~GetWorkersActorState(); static_cast(this)->destroy(); return 0; } - #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); - this->~GetWorkersActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont1(Void && _,int loopDepth) - { - #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ASSERT(!processClasses.get().more && processClasses.get().size() < CLIENT_KNOBS->TOO_MANY); - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ASSERT(!processData.get().more && processData.get().size() < CLIENT_KNOBS->TOO_MANY); - #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::map>, ProcessClass> id_class; - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for(int i = 0;i < processClasses.get().size();i++) { - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - id_class[decodeProcessClassKey(processClasses.get()[i].key)] = decodeProcessClassValue(processClasses.get()[i].value); - #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::vector results; - #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for(int i = 0;i < processData.get().size();i++) { - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ProcessData data = decodeWorkerListValue(processData.get()[i].value); - #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ProcessClass processClass = id_class[data.locality.processId()]; - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (processClass.classSource() == ProcessClass::DBSource || data.processClass.classType() == ProcessClass::UnsetClass) - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - data.processClass = processClass; - #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (data.processClass.classType() != ProcessClass::TesterClass) - #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - results.push_back(data); - #line 1040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(results); this->~GetWorkersActorState(); static_cast(this)->destroy(); return 0; } - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); - this->~GetWorkersActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetWorkersActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GetWorkersActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("getWorkers", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getWorkers", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< GetWorkersActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("getWorkers", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getWorkers", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< GetWorkersActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("getWorkers", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getWorkers", reinterpret_cast(this), 0); - - } - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference tr; - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename Tr::template FutureT processClassesF; - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename Tr::template FutureT processDataF; - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Future processClasses; - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Future processData; - #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -}; -// This generated class is to be used only via getWorkers() - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class GetWorkersActor final : public Actor>, public ActorCallback< GetWorkersActor, 0, Void >, public FastAllocated>, public GetWorkersActorState> { - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< GetWorkersActor, 0, Void >; - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - GetWorkersActor(Reference const& tr,typename Tr::template FutureT const& processClassesF,typename Tr::template FutureT const& processDataF) - #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - : Actor>(), - GetWorkersActorState>(tr, processClassesF, processDataF) - { - fdb_probe_actor_enter("getWorkers", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getWorkers"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("getWorkers", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetWorkersActor, 0, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -[[nodiscard]] Future> getWorkers( Reference const& tr, typename Tr::template FutureT const& processClassesF, typename Tr::template FutureT const& processDataF ) { - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return Future>(new GetWorkersActor(tr, processClassesF, processDataF)); - #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -} - -#line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - -// All versions of changeConfig apply the given set of configuration tokens to the database, and return a -// ConfigurationResult (or error). - -// Accepts a full configuration in key/value format (from buildConfiguration) - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -// This generated class is to be used only via changeConfig() - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class ChangeConfigActorState { - #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ChangeConfigActorState(Reference const& db,std::map const& m,bool const& force) - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - : db(db), - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - m(m), - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - force(force), - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - initIdKey(LiteralStringRef("\xff/init_id")), - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr(db->createTransaction()) - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - fdb_probe_actor_create("changeConfig", reinterpret_cast(this)); - - } - ~ChangeConfigActorState() - { - fdb_probe_actor_destroy("changeConfig", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!m.size()) - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::NO_OPTIONS_PROVIDED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::NO_OPTIONS_PROVIDED); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::string initKey = configKeysPrefix.toString() + "initialized"; - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - creating = m.count(initKey) != 0; - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - locked = Optional(); - #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - auto iter = m.find(databaseLockedKey.toString()); - #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (iter != m.end()) - #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!creating) - #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::LOCKED_NOT_NEW); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::LOCKED_NOT_NEW); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - locked = UID::fromString(iter->second); - #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - m.erase(iter); - #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (creating) - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - m[initIdKey.toString()] = deterministicRandom()->randomUniqueID().toString(); - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!isCompleteConfiguration(m)) - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::INCOMPLETE_CONFIGURATION); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::INCOMPLETE_CONFIGURATION); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tooLong = delay(60); - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - versionKey = BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned()); - #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - oldReplicationUsesDcId = false; - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - warnPPWGradual = false; - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - warnRocksDBIsExperimental = false; - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ; - #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~ChangeConfigActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(int loopDepth) - { - #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (warnPPWGradual) - #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::SUCCESS_WARN_PPW_GRADUAL); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::SUCCESS_WARN_PPW_GRADUAL); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - else - { - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (warnRocksDBIsExperimental) - #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::SUCCESS_WARN_ROCKSDB_EXPERIMENTAL); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::SUCCESS_WARN_ROCKSDB_EXPERIMENTAL); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - else - { - #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::SUCCESS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::SUCCESS); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) - { - try { - #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); - #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!creating && !force) - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - fConfigF = tr->getRange(configKeys, CLIENT_KNOBS->TOO_MANY); - #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - fConfig = safeThreadFutureToFuture(fConfigF); - #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - processClassesF = typename DB::TransactionT::template FutureT(); - #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - processDataF = typename DB::TransactionT::template FutureT(); - #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - fWorkers = getWorkers(tr, processClassesF, processDataF); - #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_0 = success(fConfig) || tooLong; - #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - else - { - loopDepth = a_body1loopBody1cont2(loopDepth); - } - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1break1(int loopDepth) - { - try { - return a_body1cont1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1cont1(int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - e1 = Error(e); - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if ((e.code() == error_code_not_committed || e.code() == error_code_transaction_too_old) && creating) - #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->reset(); - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ; - #line 1442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopBody1Catch1loopHead1(loopDepth); - } - else - { - loopDepth = a_body1loopBody1Catch1cont1(loopDepth); - } - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - int a_body1loopBody1cont2(int loopDepth) - { - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (creating) - #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::INITIALIZE_NEW_DATABASE); - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->addReadConflictRange(singleKeyRange(initIdKey)); - #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - else - { - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (m.size()) - #line 1474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::CAUSAL_WRITE_RISKY); - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->addReadConflictRange(singleKeyRange(m.begin()->first)); - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (locked.present()) - #line 1485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ASSERT(creating); - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->atomicOp(databaseLockedKey, BinaryWriter::toValue(locked.get(), Unversioned()) .withPrefix(LiteralStringRef("0123456789")) .withSuffix(LiteralStringRef("\x00\x00\x00\x00")), MutationRef::SetVersionstampedValue); - #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for(auto i = m.begin();i != m.end();++i) { - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(StringRef(i->first), StringRef(i->second)); - #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->addReadConflictRange(singleKeyRange(moveKeysLockOwnerKey)); - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(moveKeysLockOwnerKey, versionKey); - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_5 = safeThreadFutureToFuture(tr->commit()); - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont3(Void const& _,int loopDepth) - { - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!fConfig.isReady()) - #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (fConfig.isReady()) - #line 1533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ASSERT(fConfig.get().size() < CLIENT_KNOBS->TOO_MANY); - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - oldConfig = DatabaseConfiguration(); - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - oldConfig.fromKeyValues((VectorRef)fConfig.get()); - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - newConfig = oldConfig; - #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto kv : m ) { - #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - newConfig.set(kv.first, kv.second); - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!newConfig.isValid()) - #line 1551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::INVALID_CONFIGURATION); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::INVALID_CONFIGURATION); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (newConfig.tLogPolicy->attributeKeys().count("dcid") && newConfig.regions.size() > 0) - #line 1563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::REGION_REPLICATION_MISMATCH); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::REGION_REPLICATION_MISMATCH); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - oldReplicationUsesDcId = oldReplicationUsesDcId || oldConfig.tLogPolicy->attributeKeys().count("dcid"); - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (oldConfig.usableRegions != newConfig.usableRegions) - #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::map dcId_priority; - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : newConfig.regions ) { - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - dcId_priority[it.dcId] = it.priority; - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : oldConfig.regions ) { - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!dcId_priority.count(it.dcId) || dcId_priority[it.dcId] != it.priority) - #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::REGIONS_CHANGED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::REGIONS_CHANGED); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - int activeRegionCount = 0; - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : newConfig.regions ) { - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (it.priority >= 0) - #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - activeRegionCount++; - #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (activeRegionCount > 1) - #line 1617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::MULTIPLE_ACTIVE_REGIONS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::MULTIPLE_ACTIVE_REGIONS); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - fServerListF = tr->getRange(serverListKeys, CLIENT_KNOBS->TOO_MANY); - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - fServerList = (newConfig.regions.size()) ? safeThreadFutureToFuture(fServerListF) : Future(); - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (newConfig.usableRegions == 2) - #line 1634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (oldReplicationUsesDcId) - #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - fLocalityListF = tr->getRange(tagLocalityListKeys, CLIENT_KNOBS->TOO_MANY); - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - fLocalityList = safeThreadFutureToFuture(fLocalityListF); - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_1 = success(fLocalityList) || tooLong; - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - else - { - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - replicasFuturesF = std::vector>>(); - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - replicasFutures = std::vector>>(); - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : newConfig.regions ) { - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (it.priority >= 0) - #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - replicasFuturesF.push_back(tr->get(datacenterReplicasKeyFor(it.dcId))); - #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - replicasFutures.push_back(safeThreadFutureToFuture(replicasFuturesF.back())); - #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_2 = waitForAll(replicasFutures) || tooLong; - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when2(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - } - else - { - loopDepth = a_body1loopBody1cont6(loopDepth); - } - } - else - { - loopDepth = a_body1loopBody1cont4(loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1cont3(Void && _,int loopDepth) - { - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!fConfig.isReady()) - #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (fConfig.isReady()) - #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ASSERT(fConfig.get().size() < CLIENT_KNOBS->TOO_MANY); - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - oldConfig = DatabaseConfiguration(); - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - oldConfig.fromKeyValues((VectorRef)fConfig.get()); - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - newConfig = oldConfig; - #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto kv : m ) { - #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - newConfig.set(kv.first, kv.second); - #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!newConfig.isValid()) - #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::INVALID_CONFIGURATION); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::INVALID_CONFIGURATION); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (newConfig.tLogPolicy->attributeKeys().count("dcid") && newConfig.regions.size() > 0) - #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::REGION_REPLICATION_MISMATCH); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::REGION_REPLICATION_MISMATCH); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - oldReplicationUsesDcId = oldReplicationUsesDcId || oldConfig.tLogPolicy->attributeKeys().count("dcid"); - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (oldConfig.usableRegions != newConfig.usableRegions) - #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::map dcId_priority; - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : newConfig.regions ) { - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - dcId_priority[it.dcId] = it.priority; - #line 1768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : oldConfig.regions ) { - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!dcId_priority.count(it.dcId) || dcId_priority[it.dcId] != it.priority) - #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::REGIONS_CHANGED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::REGIONS_CHANGED); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - int activeRegionCount = 0; - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : newConfig.regions ) { - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (it.priority >= 0) - #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - activeRegionCount++; - #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (activeRegionCount > 1) - #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::MULTIPLE_ACTIVE_REGIONS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::MULTIPLE_ACTIVE_REGIONS); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - fServerListF = tr->getRange(serverListKeys, CLIENT_KNOBS->TOO_MANY); - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - fServerList = (newConfig.regions.size()) ? safeThreadFutureToFuture(fServerListF) : Future(); - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (newConfig.usableRegions == 2) - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (oldReplicationUsesDcId) - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - fLocalityListF = tr->getRange(tagLocalityListKeys, CLIENT_KNOBS->TOO_MANY); - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - fLocalityList = safeThreadFutureToFuture(fLocalityListF); - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_1 = success(fLocalityList) || tooLong; - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - else - { - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - replicasFuturesF = std::vector>>(); - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - replicasFutures = std::vector>>(); - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : newConfig.regions ) { - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (it.priority >= 0) - #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - replicasFuturesF.push_back(tr->get(datacenterReplicasKeyFor(it.dcId))); - #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - replicasFutures.push_back(safeThreadFutureToFuture(replicasFuturesF.back())); - #line 1855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_2 = waitForAll(replicasFutures) || tooLong; - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when2(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - } - else - { - loopDepth = a_body1loopBody1cont6(loopDepth); - } - } - else - { - loopDepth = a_body1loopBody1cont4(loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeConfigActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< ChangeConfigActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 0); - - } - int a_body1loopBody1cont4(int loopDepth) - { - loopDepth = a_body1loopBody1cont2(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont6(int loopDepth) - { - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (newConfig.regions.size()) - #line 1956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_3 = success(fServerList) || tooLong; - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - else - { - loopDepth = a_body1loopBody1cont22(loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1cont17(int loopDepth) - { - loopDepth = a_body1loopBody1cont6(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont18(Void const& _,int loopDepth) - { - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!fLocalityList.isReady()) - #line 1987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 1991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - RangeResult localityList = fLocalityList.get(); - #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ASSERT(!localityList.more && localityList.size() < CLIENT_KNOBS->TOO_MANY); - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::set localityDcIds; - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& s : localityList ) { - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - auto dc = decodeTagLocalityListKey(s.key); - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (dc.present()) - #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - localityDcIds.insert(dc.get()); - #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : newConfig.regions ) { - #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (localityDcIds.count(it.dcId) == 0) - #line 2020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DCID_MISSING); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DCID_MISSING); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - loopDepth = a_body1loopBody1cont17(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont18(Void && _,int loopDepth) - { - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!fLocalityList.isReady()) - #line 2039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - RangeResult localityList = fLocalityList.get(); - #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ASSERT(!localityList.more && localityList.size() < CLIENT_KNOBS->TOO_MANY); - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::set localityDcIds; - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& s : localityList ) { - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - auto dc = decodeTagLocalityListKey(s.key); - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (dc.present()) - #line 2061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - localityDcIds.insert(dc.get()); - #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : newConfig.regions ) { - #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (localityDcIds.count(it.dcId) == 0) - #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DCID_MISSING); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DCID_MISSING); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - loopDepth = a_body1loopBody1cont17(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont3when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont18(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont3when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont18(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeConfigActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont3when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont3when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< ChangeConfigActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 1); - - } - int a_body1loopBody1cont19(Void const& _,int loopDepth) - { - #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : replicasFutures ) { - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!it.isReady()) - #line 2156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!it.get().present()) - #line 2168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::REGION_NOT_FULLY_REPLICATED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::REGION_NOT_FULLY_REPLICATED); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - loopDepth = a_body1loopBody1cont17(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont19(Void && _,int loopDepth) - { - #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : replicasFutures ) { - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!it.isReady()) - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!it.get().present()) - #line 2201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::REGION_NOT_FULLY_REPLICATED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::REGION_NOT_FULLY_REPLICATED); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - loopDepth = a_body1loopBody1cont17(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont3when2(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont19(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont3when2(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont19(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeConfigActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont3when2(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont3when2(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< ChangeConfigActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 2); - - } - int a_body1loopBody1cont22(int loopDepth) - { - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_4 = success(fWorkers) || tooLong; - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont22when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont23(Void const& _,int loopDepth) - { - #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!fServerList.isReady()) - #line 2299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - RangeResult serverList = fServerList.get(); - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ASSERT(!serverList.more && serverList.size() < CLIENT_KNOBS->TOO_MANY); - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::set newDcIds; - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : newConfig.regions ) { - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - newDcIds.insert(it.dcId); - #line 2319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::set> missingDcIds; - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& s : serverList ) { - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - auto ssi = decodeServerListValue(s.value); - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!ssi.locality.dcId().present() || !newDcIds.count(ssi.locality.dcId().get())) - #line 2329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - missingDcIds.insert(ssi.locality.dcId()); - #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (missingDcIds.size() > (oldReplicationUsesDcId ? 1 : 0)) - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::STORAGE_IN_UNKNOWN_DCID); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::STORAGE_IN_UNKNOWN_DCID); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - loopDepth = a_body1loopBody1cont22(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont23(Void && _,int loopDepth) - { - #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!fServerList.isReady()) - #line 2356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - RangeResult serverList = fServerList.get(); - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ASSERT(!serverList.more && serverList.size() < CLIENT_KNOBS->TOO_MANY); - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::set newDcIds; - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : newConfig.regions ) { - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - newDcIds.insert(it.dcId); - #line 2376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::set> missingDcIds; - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& s : serverList ) { - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - auto ssi = decodeServerListValue(s.value); - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!ssi.locality.dcId().present() || !newDcIds.count(ssi.locality.dcId().get())) - #line 2386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - missingDcIds.insert(ssi.locality.dcId()); - #line 2390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (missingDcIds.size() > (oldReplicationUsesDcId ? 1 : 0)) - #line 2395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::STORAGE_IN_UNKNOWN_DCID); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::STORAGE_IN_UNKNOWN_DCID); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - loopDepth = a_body1loopBody1cont22(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont6when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont23(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont6when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont23(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeConfigActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1cont6when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 3, Void >*,Void && value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1cont6when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< ChangeConfigActor, 3, Void >*,Error err) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 3); - - } - int a_body1loopBody1cont22cont1(Void const& _,int loopDepth) - { - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!fWorkers.isReady()) - #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (newConfig.regions.size()) - #line 2488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::map, std::set>> dcId_zoneIds; - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : fWorkers.get() ) { - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (it.processClass.machineClassFitness(ProcessClass::Storage) <= ProcessClass::WorstFit) - #line 2496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - dcId_zoneIds[it.locality.dcId()].insert(it.locality.zoneId()); - #line 2500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& region : newConfig.regions ) { - #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (dcId_zoneIds[region.dcId].size() < std::max(newConfig.storageTeamSize, newConfig.tLogReplicationFactor)) - #line 2507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::NOT_ENOUGH_WORKERS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::NOT_ENOUGH_WORKERS); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (region.satelliteTLogReplicationFactor > 0 && region.priority >= 0) - #line 2519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - int totalSatelliteProcesses = 0; - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& sat : region.satellites ) { - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - totalSatelliteProcesses += dcId_zoneIds[sat.dcId].size(); - #line 2527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (totalSatelliteProcesses < region.satelliteTLogReplicationFactor) - #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::NOT_ENOUGH_WORKERS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::NOT_ENOUGH_WORKERS); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - } - } - else - { - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::set> zoneIds; - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : fWorkers.get() ) { - #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (it.processClass.machineClassFitness(ProcessClass::Storage) <= ProcessClass::WorstFit) - #line 2552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - zoneIds.insert(it.locality.zoneId()); - #line 2556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (zoneIds.size() < std::max(newConfig.storageTeamSize, newConfig.tLogReplicationFactor)) - #line 2561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::NOT_ENOUGH_WORKERS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::NOT_ENOUGH_WORKERS); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (newConfig.storageServerStoreType != oldConfig.storageServerStoreType && newConfig.storageMigrationType == StorageMigrationType::DISABLED) - #line 2574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::STORAGE_MIGRATION_DISABLED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::STORAGE_MIGRATION_DISABLED); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - else - { - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (newConfig.storageMigrationType == StorageMigrationType::GRADUAL && newConfig.perpetualStorageWiggleSpeed == 0) - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - warnPPWGradual = true; - #line 2592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - else - { - #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (newConfig.storageServerStoreType != oldConfig.storageServerStoreType && newConfig.storageServerStoreType == KeyValueStoreType::SSD_ROCKSDB_V1) - #line 2598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - warnRocksDBIsExperimental = true; - #line 2602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - } - loopDepth = a_body1loopBody1cont4(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont22cont1(Void && _,int loopDepth) - { - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!fWorkers.isReady()) - #line 2614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (newConfig.regions.size()) - #line 2626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::map, std::set>> dcId_zoneIds; - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : fWorkers.get() ) { - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (it.processClass.machineClassFitness(ProcessClass::Storage) <= ProcessClass::WorstFit) - #line 2634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - dcId_zoneIds[it.locality.dcId()].insert(it.locality.zoneId()); - #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& region : newConfig.regions ) { - #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (dcId_zoneIds[region.dcId].size() < std::max(newConfig.storageTeamSize, newConfig.tLogReplicationFactor)) - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::NOT_ENOUGH_WORKERS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::NOT_ENOUGH_WORKERS); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (region.satelliteTLogReplicationFactor > 0 && region.priority >= 0) - #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - int totalSatelliteProcesses = 0; - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& sat : region.satellites ) { - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - totalSatelliteProcesses += dcId_zoneIds[sat.dcId].size(); - #line 2665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (totalSatelliteProcesses < region.satelliteTLogReplicationFactor) - #line 2669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::NOT_ENOUGH_WORKERS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::NOT_ENOUGH_WORKERS); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - } - } - else - { - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::set> zoneIds; - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : fWorkers.get() ) { - #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (it.processClass.machineClassFitness(ProcessClass::Storage) <= ProcessClass::WorstFit) - #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - zoneIds.insert(it.locality.zoneId()); - #line 2694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (zoneIds.size() < std::max(newConfig.storageTeamSize, newConfig.tLogReplicationFactor)) - #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::NOT_ENOUGH_WORKERS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::NOT_ENOUGH_WORKERS); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (newConfig.storageServerStoreType != oldConfig.storageServerStoreType && newConfig.storageMigrationType == StorageMigrationType::DISABLED) - #line 2712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::STORAGE_MIGRATION_DISABLED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::STORAGE_MIGRATION_DISABLED); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - else - { - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (newConfig.storageMigrationType == StorageMigrationType::GRADUAL && newConfig.perpetualStorageWiggleSpeed == 0) - #line 2726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - warnPPWGradual = true; - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - else - { - #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (newConfig.storageServerStoreType != oldConfig.storageServerStoreType && newConfig.storageServerStoreType == KeyValueStoreType::SSD_ROCKSDB_V1) - #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - warnRocksDBIsExperimental = true; - #line 2740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - } - loopDepth = a_body1loopBody1cont4(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont22when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont22cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont22when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont22cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose5() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeConfigActor, 4, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 4, Void >*,Void const& value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1loopBody1cont22when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 4); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 4, Void >*,Void && value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1loopBody1cont22when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 4); - - } - void a_callback_error(ActorCallback< ChangeConfigActor, 4, Void >*,Error err) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 4); - - } - int a_body1loopBody1cont24(Void const& _,int loopDepth) - { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break - - return loopDepth; - } - int a_body1loopBody1cont24(Void && _,int loopDepth) - { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break - - return loopDepth; - } - int a_body1loopBody1cont2when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont24(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont2when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont24(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose6() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeConfigActor, 5, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 5, Void >*,Void const& value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1loopBody1cont2when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 5); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 5, Void >*,Void && value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1loopBody1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 5); - - } - void a_callback_error(ActorCallback< ChangeConfigActor, 5, Void >*,Error err) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 5); - - } - int a_body1loopBody1Catch1cont1(int loopDepth) - { - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_8 = safeThreadFutureToFuture(tr->onError(e1)); - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1cont1when1(__when_expr_8.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 9; - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1Catch1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1Catch1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1loopBody1(int loopDepth) - { - try { - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - vF = tr->get(initIdKey); - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_6 = safeThreadFutureToFuture(vF); - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1loopBody1Catch1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1loopBody1Catch1loopBody1when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_6.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1loopBody1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1Catch1loopBody1cont1(int loopDepth) - { - if (loopDepth == 0) return a_body1loopBody1Catch1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1Catch1loopBody1Catch1(const Error& e2,int loopDepth=0) - { - try { - #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_7 = safeThreadFutureToFuture(tr->onError(e2)); - #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1Catch1loopBody1Catch1when1(__when_expr_7.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 8; - #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 2)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 2)); - } - - return loopDepth; - } - int a_body1loopBody1Catch1loopBody1cont2(Optional const& v,int loopDepth) - { - #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (v != m[initIdKey.toString()]) - #line 2975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_ALREADY_CREATED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_ALREADY_CREATED); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - else - { - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (m[configKeysPrefix.toString() + "storage_engine"] == std::to_string(KeyValueStoreType::SSD_ROCKSDB_V1)) - #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_CREATED_WARN_ROCKSDB_EXPERIMENTAL); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_CREATED_WARN_ROCKSDB_EXPERIMENTAL); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - else - { - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_CREATED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 3003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_CREATED); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - - return loopDepth; - } - int a_body1loopBody1Catch1loopBody1cont2(Optional && v,int loopDepth) - { - #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (v != m[initIdKey.toString()]) - #line 3017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_ALREADY_CREATED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 3021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_ALREADY_CREATED); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - else - { - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (m[configKeysPrefix.toString() + "storage_engine"] == std::to_string(KeyValueStoreType::SSD_ROCKSDB_V1)) - #line 3031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_CREATED_WARN_ROCKSDB_EXPERIMENTAL); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_CREATED_WARN_ROCKSDB_EXPERIMENTAL); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - else - { - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_CREATED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 3045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_CREATED); - this->~ChangeConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - - return loopDepth; - } - int a_body1loopBody1Catch1loopBody1when1(Optional const& v,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1loopBody1cont2(v, loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1loopBody1when1(Optional && v,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1loopBody1cont2(std::move(v), loopDepth); - - return loopDepth; - } - void a_exitChoose7() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeConfigActor, 6, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 6, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1loopBody1Catch1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 6); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 6, Optional >*,Optional && value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1loopBody1Catch1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 6); - - } - void a_callback_error(ActorCallback< ChangeConfigActor, 6, Optional >*,Error err) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1loopBody1Catch1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 6); - - } - int a_body1loopBody1Catch1loopBody1Catch1cont1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1loopBody1Catch1cont1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1loopBody1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1loopBody1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1loopBody1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1loopBody1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose8() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeConfigActor, 7, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 7, Void >*,Void const& value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 7); - a_exitChoose8(); - try { - a_body1loopBody1Catch1loopBody1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 7); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 7, Void >*,Void && value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 7); - a_exitChoose8(); - try { - a_body1loopBody1Catch1loopBody1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 7); - - } - void a_callback_error(ActorCallback< ChangeConfigActor, 7, Void >*,Error err) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 7); - a_exitChoose8(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 7); - - } - int a_body1loopBody1Catch1cont3(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont3(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose9() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeConfigActor, 8, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 8, Void >*,Void const& value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 8); - a_exitChoose9(); - try { - a_body1loopBody1Catch1cont1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 8); - - } - void a_callback_fire(ActorCallback< ChangeConfigActor, 8, Void >*,Void && value) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 8); - a_exitChoose9(); - try { - a_body1loopBody1Catch1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 8); - - } - void a_callback_error(ActorCallback< ChangeConfigActor, 8, Void >*,Error err) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 8); - a_exitChoose9(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 8); - - } - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference db; - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::map m; - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - bool force; - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StringRef initIdKey; - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference tr; - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - bool creating; - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Optional locked; - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Future tooLong; - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Key versionKey; - #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - bool oldReplicationUsesDcId; - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - bool warnPPWGradual; - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - bool warnRocksDBIsExperimental; - #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename DB::TransactionT::template FutureT fConfigF; - #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Future fConfig; - #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename DB::TransactionT::template FutureT processClassesF; - #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename DB::TransactionT::template FutureT processDataF; - #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Future> fWorkers; - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - DatabaseConfiguration oldConfig; - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - DatabaseConfiguration newConfig; - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename DB::TransactionT::template FutureT fServerListF; - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Future fServerList; - #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename DB::TransactionT::template FutureT fLocalityListF; - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Future fLocalityList; - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::vector>> replicasFuturesF; - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::vector>> replicasFutures; - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Error e1; - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename DB::TransactionT::template FutureT> vF; - #line 3322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -}; -// This generated class is to be used only via changeConfig() - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class ChangeConfigActor final : public Actor, public ActorCallback< ChangeConfigActor, 0, Void >, public ActorCallback< ChangeConfigActor, 1, Void >, public ActorCallback< ChangeConfigActor, 2, Void >, public ActorCallback< ChangeConfigActor, 3, Void >, public ActorCallback< ChangeConfigActor, 4, Void >, public ActorCallback< ChangeConfigActor, 5, Void >, public ActorCallback< ChangeConfigActor, 6, Optional >, public ActorCallback< ChangeConfigActor, 7, Void >, public ActorCallback< ChangeConfigActor, 8, Void >, public FastAllocated>, public ChangeConfigActorState> { - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< ChangeConfigActor, 0, Void >; -friend struct ActorCallback< ChangeConfigActor, 1, Void >; -friend struct ActorCallback< ChangeConfigActor, 2, Void >; -friend struct ActorCallback< ChangeConfigActor, 3, Void >; -friend struct ActorCallback< ChangeConfigActor, 4, Void >; -friend struct ActorCallback< ChangeConfigActor, 5, Void >; -friend struct ActorCallback< ChangeConfigActor, 6, Optional >; -friend struct ActorCallback< ChangeConfigActor, 7, Void >; -friend struct ActorCallback< ChangeConfigActor, 8, Void >; - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ChangeConfigActor(Reference const& db,std::map const& m,bool const& force) - #line 3348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - : Actor(), - ChangeConfigActorState>(db, m, force) - { - fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("changeConfig"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ChangeConfigActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< ChangeConfigActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< ChangeConfigActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< ChangeConfigActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< ChangeConfigActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< ChangeConfigActor, 5, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< ChangeConfigActor, 6, Optional >*)0, actor_cancelled()); break; - case 8: this->a_callback_error((ActorCallback< ChangeConfigActor, 7, Void >*)0, actor_cancelled()); break; - case 9: this->a_callback_error((ActorCallback< ChangeConfigActor, 8, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -[[nodiscard]] Future changeConfig( Reference const& db, std::map const& m, bool const& force ) { - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return Future(new ChangeConfigActor(db, m, force)); - #line 3385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -} - -#line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - - #line 3390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -// This generated class is to be used only via autoConfig() - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class AutoConfigActorState { - #line 3396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - AutoConfigActorState(Reference const& db,ConfigureAutoResult const& conf) - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - : db(db), - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - conf(conf), - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr(db->createTransaction()), - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - versionKey(BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned())) - #line 3409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - fdb_probe_actor_create("autoConfig", reinterpret_cast(this)); - - } - ~AutoConfigActorState() - { - fdb_probe_actor_destroy("autoConfig", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!conf.address_class.size()) - #line 3424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::INCOMPLETE_CONFIGURATION); this->~AutoConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 3428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::INCOMPLETE_CONFIGURATION); - this->~AutoConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ; - #line 3436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~AutoConfigActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) - { - try { - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - processClassesF = typename DB::TransactionT::template FutureT(); - #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - processDataF = typename DB::TransactionT::template FutureT(); - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_0 = getWorkers(tr, processClassesF, processDataF); - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1cont1(int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->onError(e)); - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - int a_body1loopBody1cont2(std::vector const& workers,int loopDepth) - { - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::map>> address_processId; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& w : workers ) { - #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - address_processId[w.address] = w.locality.processId(); - #line 3534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : conf.address_class ) { - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (it.second.classSource() == ProcessClass::CommandLineSource) - #line 3540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->clear(processClassKeyFor(address_processId[it.first].get())); - #line 3544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - else - { - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(processClassKeyFor(address_processId[it.first].get()), processClassValue(it.second)); - #line 3550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (conf.address_class.size()) - #line 3555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(processClassChangeKey, deterministicRandom()->randomUniqueID().toString()); - #line 3559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (conf.auto_logs != conf.old_logs) - #line 3563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(configKeysPrefix.toString() + "auto_logs", format("%d", conf.auto_logs)); - #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (conf.auto_commit_proxies != conf.old_commit_proxies) - #line 3571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(configKeysPrefix.toString() + "auto_commit_proxies", format("%d", conf.auto_commit_proxies)); - #line 3575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (conf.auto_grv_proxies != conf.old_grv_proxies) - #line 3579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(configKeysPrefix.toString() + "auto_grv_proxies", format("%d", conf.auto_grv_proxies)); - #line 3583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (conf.auto_resolvers != conf.old_resolvers) - #line 3587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(configKeysPrefix.toString() + "auto_resolvers", format("%d", conf.auto_resolvers)); - #line 3591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (conf.auto_replication != conf.old_replication) - #line 3595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::vector modes; - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - modes.push_back(conf.auto_replication); - #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::map m; - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - auto r = buildConfiguration(modes, m); - #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (r != ConfigurationResult::SUCCESS) - #line 3607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(r); this->~AutoConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(r); - this->~AutoConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& kv : m ) { - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(kv.first, kv.second); - #line 3621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->addReadConflictRange(singleKeyRange(moveKeysLockOwnerKey)); - #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(moveKeysLockOwnerKey, versionKey); - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->commit()); - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont2(std::vector && workers,int loopDepth) - { - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::map>> address_processId; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& w : workers ) { - #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - address_processId[w.address] = w.locality.processId(); - #line 3650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& it : conf.address_class ) { - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (it.second.classSource() == ProcessClass::CommandLineSource) - #line 3656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->clear(processClassKeyFor(address_processId[it.first].get())); - #line 3660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - else - { - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(processClassKeyFor(address_processId[it.first].get()), processClassValue(it.second)); - #line 3666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (conf.address_class.size()) - #line 3671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(processClassChangeKey, deterministicRandom()->randomUniqueID().toString()); - #line 3675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (conf.auto_logs != conf.old_logs) - #line 3679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(configKeysPrefix.toString() + "auto_logs", format("%d", conf.auto_logs)); - #line 3683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (conf.auto_commit_proxies != conf.old_commit_proxies) - #line 3687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(configKeysPrefix.toString() + "auto_commit_proxies", format("%d", conf.auto_commit_proxies)); - #line 3691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (conf.auto_grv_proxies != conf.old_grv_proxies) - #line 3695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(configKeysPrefix.toString() + "auto_grv_proxies", format("%d", conf.auto_grv_proxies)); - #line 3699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (conf.auto_resolvers != conf.old_resolvers) - #line 3703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(configKeysPrefix.toString() + "auto_resolvers", format("%d", conf.auto_resolvers)); - #line 3707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (conf.auto_replication != conf.old_replication) - #line 3711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::vector modes; - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - modes.push_back(conf.auto_replication); - #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::map m; - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - auto r = buildConfiguration(modes, m); - #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (r != ConfigurationResult::SUCCESS) - #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(r); this->~AutoConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 3727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(r); - this->~AutoConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto& kv : m ) { - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(kv.first, kv.second); - #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - } - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->addReadConflictRange(singleKeyRange(moveKeysLockOwnerKey)); - #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(moveKeysLockOwnerKey, versionKey); - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->commit()); - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1when1(std::vector const& workers,int loopDepth) - { - loopDepth = a_body1loopBody1cont2(workers, loopDepth); - - return loopDepth; - } - int a_body1loopBody1when1(std::vector && workers,int loopDepth) - { - loopDepth = a_body1loopBody1cont2(std::move(workers), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AutoConfigActor, 0, std::vector >::remove(); - - } - void a_callback_fire(ActorCallback< AutoConfigActor, 0, std::vector >*,std::vector const& value) - { - fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< AutoConfigActor, 0, std::vector >*,std::vector && value) - { - fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< AutoConfigActor, 0, std::vector >*,Error err) - { - fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 0); - - } - int a_body1loopBody1cont3(Void const& _,int loopDepth) - { - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::SUCCESS); this->~AutoConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 3825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::SUCCESS); - this->~AutoConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont3(Void && _,int loopDepth) - { - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::SUCCESS); this->~AutoConfigActorState(); static_cast(this)->destroy(); return 0; } - #line 3837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::SUCCESS); - this->~AutoConfigActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont2when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont2when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AutoConfigActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< AutoConfigActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< AutoConfigActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< AutoConfigActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 1); - - } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AutoConfigActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< AutoConfigActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< AutoConfigActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< AutoConfigActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 2); - - } - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference db; - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ConfigureAutoResult conf; - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference tr; - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Key versionKey; - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename DB::TransactionT::template FutureT processClassesF; - #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename DB::TransactionT::template FutureT processDataF; - #line 3995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -}; -// This generated class is to be used only via autoConfig() - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class AutoConfigActor final : public Actor, public ActorCallback< AutoConfigActor, 0, std::vector >, public ActorCallback< AutoConfigActor, 1, Void >, public ActorCallback< AutoConfigActor, 2, Void >, public FastAllocated>, public AutoConfigActorState> { - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< AutoConfigActor, 0, std::vector >; -friend struct ActorCallback< AutoConfigActor, 1, Void >; -friend struct ActorCallback< AutoConfigActor, 2, Void >; - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - AutoConfigActor(Reference const& db,ConfigureAutoResult const& conf) - #line 4015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - : Actor(), - AutoConfigActorState>(db, conf) - { - fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("autoConfig"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< AutoConfigActor, 0, std::vector >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< AutoConfigActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< AutoConfigActor, 2, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -[[nodiscard]] Future autoConfig( Reference const& db, ConfigureAutoResult const& conf ) { - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return Future(new AutoConfigActor(db, conf)); - #line 4046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -} - -#line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - -// Accepts tokens separated by spaces in a single string -template -Future changeConfig(Reference db, std::string const& modes, bool force) { - TraceEvent("ChangeConfig").detail("Mode", modes); - std::map m; - auto r = buildConfiguration(modes, m); - if (r != ConfigurationResult::SUCCESS) - return r; - return changeConfig(db, m, force); -} - -// Accepts a vector of configuration tokens -template -Future changeConfig(Reference db, - std::vector const& modes, - Optional const& conf, - bool force) { - if (modes.size() && modes[0] == LiteralStringRef("auto") && conf.present()) { - return autoConfig(db, conf.get()); - } - - std::map m; - auto r = buildConfiguration(modes, m); - if (r != ConfigurationResult::SUCCESS) - return r; - return changeConfig(db, m, force); -} - -// return the corresponding error message for the CoordinatorsResult -// used by special keys and fdbcli -std::string generateErrorMessage(const CoordinatorsResult& res); - - #line 4083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -// This generated class is to be used only via tryGetTenantTransaction() - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class TryGetTenantTransactionActorState { - #line 4089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TryGetTenantTransactionActorState(Transaction const& tr,TenantName const& name) - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - : tr(tr), - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - name(name), - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tenantMapKey(name.withPrefix(tenantMapPrefix)) - #line 4100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - fdb_probe_actor_create("tryGetTenantTransaction", reinterpret_cast(this)); - - } - ~TryGetTenantTransactionActorState() - { - fdb_probe_actor_destroy("tryGetTenantTransaction", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::RAW_ACCESS); - #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); - #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tenantFuture = tr->get(tenantMapKey); - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_0 = safeThreadFutureToFuture(tenantFuture); - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~TryGetTenantTransactionActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Optional const& val,int loopDepth) - { - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(val.map([](Optional v) { return decodeTenantEntry(v.get()); })); this->~TryGetTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 4151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Optional >::value()) Optional(val.map([](Optional v) { return decodeTenantEntry(v.get()); })); - this->~TryGetTenantTransactionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont1(Optional && val,int loopDepth) - { - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(val.map([](Optional v) { return decodeTenantEntry(v.get()); })); this->~TryGetTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 4163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Optional >::value()) Optional(val.map([](Optional v) { return decodeTenantEntry(v.get()); })); - this->~TryGetTenantTransactionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1when1(Optional const& val,int loopDepth) - { - loopDepth = a_body1cont1(val, loopDepth); - - return loopDepth; - } - int a_body1when1(Optional && val,int loopDepth) - { - loopDepth = a_body1cont1(std::move(val), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TryGetTenantTransactionActor, 0, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< TryGetTenantTransactionActor, 0, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("tryGetTenantTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("tryGetTenantTransaction", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< TryGetTenantTransactionActor, 0, Optional >*,Optional && value) - { - fdb_probe_actor_enter("tryGetTenantTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("tryGetTenantTransaction", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< TryGetTenantTransactionActor, 0, Optional >*,Error err) - { - fdb_probe_actor_enter("tryGetTenantTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("tryGetTenantTransaction", reinterpret_cast(this), 0); - - } - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Transaction tr; - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TenantName name; - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Key tenantMapKey; - #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename transaction_future_type>::type tenantFuture; - #line 4242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -}; -// This generated class is to be used only via tryGetTenantTransaction() - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class TryGetTenantTransactionActor final : public Actor>, public ActorCallback< TryGetTenantTransactionActor, 0, Optional >, public FastAllocated>, public TryGetTenantTransactionActorState> { - #line 4249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< TryGetTenantTransactionActor, 0, Optional >; - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TryGetTenantTransactionActor(Transaction const& tr,TenantName const& name) - #line 4260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - : Actor>(), - TryGetTenantTransactionActorState>(tr, name) - { - fdb_probe_actor_enter("tryGetTenantTransaction", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("tryGetTenantTransaction"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("tryGetTenantTransaction", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< TryGetTenantTransactionActor, 0, Optional >*)0, actor_cancelled()); break; - } - - } -}; - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -[[nodiscard]] Future> tryGetTenantTransaction( Transaction const& tr, TenantName const& name ) { - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return Future>(new TryGetTenantTransactionActor(tr, name)); - #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -} - -#line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - - #line 4294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -// This generated class is to be used only via tryGetTenant() - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class TryGetTenantActorState { - #line 4300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TryGetTenantActorState(Reference const& db,TenantName const& name) - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - : db(db), - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - name(name), - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr(db->createTransaction()) - #line 4311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - fdb_probe_actor_create("tryGetTenant", reinterpret_cast(this)); - - } - ~TryGetTenantActorState() - { - fdb_probe_actor_destroy("tryGetTenant", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ; - #line 4326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~TryGetTenantActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) - { - try { - #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_0 = tryGetTenantTransaction(tr, name); - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1cont1(int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->onError(e)); - #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - int a_body1loopBody1cont2(Optional const& entry,int loopDepth) - { - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(entry); this->~TryGetTenantActorState(); static_cast(this)->destroy(); return 0; } - #line 4410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Optional >::value()) Optional(entry); - this->~TryGetTenantActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont2(Optional && entry,int loopDepth) - { - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(entry); this->~TryGetTenantActorState(); static_cast(this)->destroy(); return 0; } - #line 4422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Optional >::value()) Optional(entry); - this->~TryGetTenantActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1when1(Optional const& entry,int loopDepth) - { - loopDepth = a_body1loopBody1cont2(entry, loopDepth); - - return loopDepth; - } - int a_body1loopBody1when1(Optional && entry,int loopDepth) - { - loopDepth = a_body1loopBody1cont2(std::move(entry), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TryGetTenantActor, 0, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< TryGetTenantActor, 0, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("tryGetTenant", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("tryGetTenant", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< TryGetTenantActor, 0, Optional >*,Optional && value) - { - fdb_probe_actor_enter("tryGetTenant", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("tryGetTenant", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< TryGetTenantActor, 0, Optional >*,Error err) - { - fdb_probe_actor_enter("tryGetTenant", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("tryGetTenant", reinterpret_cast(this), 0); - - } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TryGetTenantActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< TryGetTenantActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("tryGetTenant", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("tryGetTenant", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< TryGetTenantActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("tryGetTenant", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("tryGetTenant", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< TryGetTenantActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("tryGetTenant", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("tryGetTenant", reinterpret_cast(this), 1); - - } - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference db; - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TenantName name; - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference tr; - #line 4574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -}; -// This generated class is to be used only via tryGetTenant() - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class TryGetTenantActor final : public Actor>, public ActorCallback< TryGetTenantActor, 0, Optional >, public ActorCallback< TryGetTenantActor, 1, Void >, public FastAllocated>, public TryGetTenantActorState> { - #line 4581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< TryGetTenantActor, 0, Optional >; -friend struct ActorCallback< TryGetTenantActor, 1, Void >; - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TryGetTenantActor(Reference const& db,TenantName const& name) - #line 4593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - : Actor>(), - TryGetTenantActorState>(db, name) - { - fdb_probe_actor_enter("tryGetTenant", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("tryGetTenant"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("tryGetTenant", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< TryGetTenantActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< TryGetTenantActor, 1, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -[[nodiscard]] Future> tryGetTenant( Reference const& db, TenantName const& name ) { - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return Future>(new TryGetTenantActor(db, name)); - #line 4623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -} - -#line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - - #line 4628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -// This generated class is to be used only via getTenantTransaction() - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class GetTenantTransactionActorState { - #line 4634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - GetTenantTransactionActorState(Transaction const& tr,TenantName const& name) - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - : tr(tr), - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - name(name) - #line 4643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - fdb_probe_actor_create("getTenantTransaction", reinterpret_cast(this)); - - } - ~GetTenantTransactionActorState() - { - fdb_probe_actor_destroy("getTenantTransaction", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_0 = tryGetTenantTransaction(tr, name); - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~GetTenantTransactionActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Optional const& entry,int loopDepth) - { - #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!entry.present()) - #line 4688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1Catch1(tenant_not_found(), loopDepth); - #line 4692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(entry.get()); this->~GetTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 4696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< TenantMapEntry >::value()) TenantMapEntry(entry.get()); - this->~GetTenantTransactionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont1(Optional && entry,int loopDepth) - { - #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!entry.present()) - #line 4708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1Catch1(tenant_not_found(), loopDepth); - #line 4712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(entry.get()); this->~GetTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 4716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< TenantMapEntry >::value()) TenantMapEntry(entry.get()); - this->~GetTenantTransactionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1when1(Optional const& entry,int loopDepth) - { - loopDepth = a_body1cont1(entry, loopDepth); - - return loopDepth; - } - int a_body1when1(Optional && entry,int loopDepth) - { - loopDepth = a_body1cont1(std::move(entry), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetTenantTransactionActor, 0, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< GetTenantTransactionActor, 0, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("getTenantTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getTenantTransaction", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< GetTenantTransactionActor, 0, Optional >*,Optional && value) - { - fdb_probe_actor_enter("getTenantTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getTenantTransaction", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< GetTenantTransactionActor, 0, Optional >*,Error err) - { - fdb_probe_actor_enter("getTenantTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getTenantTransaction", reinterpret_cast(this), 0); - - } - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Transaction tr; - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TenantName name; - #line 4791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -}; -// This generated class is to be used only via getTenantTransaction() - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class GetTenantTransactionActor final : public Actor, public ActorCallback< GetTenantTransactionActor, 0, Optional >, public FastAllocated>, public GetTenantTransactionActorState> { - #line 4798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< GetTenantTransactionActor, 0, Optional >; - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - GetTenantTransactionActor(Transaction const& tr,TenantName const& name) - #line 4809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - : Actor(), - GetTenantTransactionActorState>(tr, name) - { - fdb_probe_actor_enter("getTenantTransaction", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getTenantTransaction"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("getTenantTransaction", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetTenantTransactionActor, 0, Optional >*)0, actor_cancelled()); break; - } - - } -}; - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -[[nodiscard]] Future getTenantTransaction( Transaction const& tr, TenantName const& name ) { - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return Future(new GetTenantTransactionActor(tr, name)); - #line 4838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -} - -#line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - - #line 4843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -// This generated class is to be used only via getTenant() - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class GetTenantActorState { - #line 4849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - GetTenantActorState(Reference const& db,TenantName const& name) - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - : db(db), - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - name(name) - #line 4858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - fdb_probe_actor_create("getTenant", reinterpret_cast(this)); - - } - ~GetTenantActorState() - { - fdb_probe_actor_destroy("getTenant", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_0 = tryGetTenant(db, name); - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~GetTenantActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Optional const& entry,int loopDepth) - { - #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!entry.present()) - #line 4903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1Catch1(tenant_not_found(), loopDepth); - #line 4907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(entry.get()); this->~GetTenantActorState(); static_cast(this)->destroy(); return 0; } - #line 4911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< TenantMapEntry >::value()) TenantMapEntry(entry.get()); - this->~GetTenantActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont1(Optional && entry,int loopDepth) - { - #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!entry.present()) - #line 4923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1Catch1(tenant_not_found(), loopDepth); - #line 4927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(entry.get()); this->~GetTenantActorState(); static_cast(this)->destroy(); return 0; } - #line 4931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< TenantMapEntry >::value()) TenantMapEntry(entry.get()); - this->~GetTenantActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1when1(Optional const& entry,int loopDepth) - { - loopDepth = a_body1cont1(entry, loopDepth); - - return loopDepth; - } - int a_body1when1(Optional && entry,int loopDepth) - { - loopDepth = a_body1cont1(std::move(entry), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetTenantActor, 0, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< GetTenantActor, 0, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("getTenant", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getTenant", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< GetTenantActor, 0, Optional >*,Optional && value) - { - fdb_probe_actor_enter("getTenant", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getTenant", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< GetTenantActor, 0, Optional >*,Error err) - { - fdb_probe_actor_enter("getTenant", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getTenant", reinterpret_cast(this), 0); - - } - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference db; - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TenantName name; - #line 5006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -}; -// This generated class is to be used only via getTenant() - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class GetTenantActor final : public Actor, public ActorCallback< GetTenantActor, 0, Optional >, public FastAllocated>, public GetTenantActorState> { - #line 5013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< GetTenantActor, 0, Optional >; - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - GetTenantActor(Reference const& db,TenantName const& name) - #line 5024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - : Actor(), - GetTenantActorState>(db, name) - { - fdb_probe_actor_enter("getTenant", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getTenant"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("getTenant", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetTenantActor, 0, Optional >*)0, actor_cancelled()); break; - } - - } -}; - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -[[nodiscard]] Future getTenant( Reference const& db, TenantName const& name ) { - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return Future(new GetTenantActor(db, name)); - #line 5053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -} - -#line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - -// Creates a tenant with the given name. If the tenant already exists, an empty optional will be returned. - #line 5059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -// This generated class is to be used only via createTenantTransaction() - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class CreateTenantTransactionActorState { - #line 5065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - CreateTenantTransactionActorState(Transaction const& tr,TenantNameRef const& name) - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - : tr(tr), - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - name(name), - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tenantMapKey(name.withPrefix(tenantMapPrefix)) - #line 5076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - fdb_probe_actor_create("createTenantTransaction", reinterpret_cast(this)); - - } - ~CreateTenantTransactionActorState() - { - fdb_probe_actor_destroy("createTenantTransaction", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (name.startsWith("\xff"_sr)) - #line 5091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1Catch1(invalid_tenant_name(), loopDepth); - #line 5095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::RAW_ACCESS); - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tenantEntryFuture = tryGetTenantTransaction(tr, name); - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tenantDataPrefixFuture = tr->get(tenantDataPrefixKey); - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - lastIdFuture = tr->get(tenantLastIdKey); - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tenantModeFuture = tr->get(configKeysPrefix.withSuffix("tenant_mode"_sr)); - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_0 = safeThreadFutureToFuture(tenantModeFuture); - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~CreateTenantTransactionActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Optional const& tenantMode,int loopDepth) - { - #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!tenantMode.present() || tenantMode.get() == StringRef(format("%d", TenantMode::DISABLED))) - #line 5141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1Catch1(tenants_disabled(), loopDepth); - #line 5145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_1 = tenantEntryFuture; - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Optional && tenantMode,int loopDepth) - { - #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!tenantMode.present() || tenantMode.get() == StringRef(format("%d", TenantMode::DISABLED))) - #line 5165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1Catch1(tenants_disabled(), loopDepth); - #line 5169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_1 = tenantEntryFuture; - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1when1(Optional const& tenantMode,int loopDepth) - { - loopDepth = a_body1cont1(tenantMode, loopDepth); - - return loopDepth; - } - int a_body1when1(Optional && tenantMode,int loopDepth) - { - loopDepth = a_body1cont1(std::move(tenantMode), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CreateTenantTransactionActor, 0, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 0, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 0, Optional >*,Optional && value) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< CreateTenantTransactionActor, 0, Optional >*,Error err) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 0); - - } - int a_body1cont3(Optional const& tenantEntry,int loopDepth) - { - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (tenantEntry.present()) - #line 5252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~CreateTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 5256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); - this->~CreateTenantTransactionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_2 = safeThreadFutureToFuture(lastIdFuture); - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont3(Optional && tenantEntry,int loopDepth) - { - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (tenantEntry.present()) - #line 5280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~CreateTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 5284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); - this->~CreateTenantTransactionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_2 = safeThreadFutureToFuture(lastIdFuture); - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1when1(Optional const& tenantEntry,int loopDepth) - { - loopDepth = a_body1cont3(tenantEntry, loopDepth); - - return loopDepth; - } - int a_body1cont1when1(Optional && tenantEntry,int loopDepth) - { - loopDepth = a_body1cont3(std::move(tenantEntry), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CreateTenantTransactionActor, 1, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 1, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 1, Optional >*,Optional && value) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< CreateTenantTransactionActor, 1, Optional >*,Error err) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 1); - - } - int a_body1cont5(int loopDepth) - { - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_3 = safeThreadFutureToFuture(tenantDataPrefixFuture); - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont3when1(Optional const& __lastIdVal,int loopDepth) - { - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - lastIdVal = __lastIdVal; - #line 5387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1cont5(loopDepth); - - return loopDepth; - } - int a_body1cont3when1(Optional && __lastIdVal,int loopDepth) - { - lastIdVal = std::move(__lastIdVal); - loopDepth = a_body1cont5(loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CreateTenantTransactionActor, 2, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 2, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 2, Optional >*,Optional && value) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< CreateTenantTransactionActor, 2, Optional >*,Error err) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 2); - - } - int a_body1cont7(Optional const& tenantDataPrefix,int loopDepth) - { - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (tenantDataPrefix.present() && tenantDataPrefix.get().size() + TenantMapEntry::ROOT_PREFIX_SIZE > CLIENT_KNOBS->TENANT_PREFIX_SIZE_LIMIT) - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TraceEvent(SevWarnAlways, "TenantPrefixTooLarge") .detail("TenantSubspace", tenantDataPrefix.get()) .detail("TenantSubspaceLength", tenantDataPrefix.get().size()) .detail("RootPrefixLength", TenantMapEntry::ROOT_PREFIX_SIZE) .detail("MaxTenantPrefixSize", CLIENT_KNOBS->TENANT_PREFIX_SIZE_LIMIT); - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1Catch1(client_invalid_operation(), loopDepth); - #line 5460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - newTenant = TenantMapEntry(lastIdVal.present() ? TenantMapEntry::prefixToId(lastIdVal.get()) + 1 : 0, tenantDataPrefix.present() ? (KeyRef)tenantDataPrefix.get() : ""_sr); - #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - prefixRangeFuture = tr->getRange(prefixRange(newTenant.prefix), 1); - #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_4 = safeThreadFutureToFuture(prefixRangeFuture); - #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont7when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont7(Optional && tenantDataPrefix,int loopDepth) - { - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (tenantDataPrefix.present() && tenantDataPrefix.get().size() + TenantMapEntry::ROOT_PREFIX_SIZE > CLIENT_KNOBS->TENANT_PREFIX_SIZE_LIMIT) - #line 5484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TraceEvent(SevWarnAlways, "TenantPrefixTooLarge") .detail("TenantSubspace", tenantDataPrefix.get()) .detail("TenantSubspaceLength", tenantDataPrefix.get().size()) .detail("RootPrefixLength", TenantMapEntry::ROOT_PREFIX_SIZE) .detail("MaxTenantPrefixSize", CLIENT_KNOBS->TENANT_PREFIX_SIZE_LIMIT); - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1Catch1(client_invalid_operation(), loopDepth); - #line 5490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - newTenant = TenantMapEntry(lastIdVal.present() ? TenantMapEntry::prefixToId(lastIdVal.get()) + 1 : 0, tenantDataPrefix.present() ? (KeyRef)tenantDataPrefix.get() : ""_sr); - #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - prefixRangeFuture = tr->getRange(prefixRange(newTenant.prefix), 1); - #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_4 = safeThreadFutureToFuture(prefixRangeFuture); - #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont7when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont5when1(Optional const& tenantDataPrefix,int loopDepth) - { - loopDepth = a_body1cont7(tenantDataPrefix, loopDepth); - - return loopDepth; - } - int a_body1cont5when1(Optional && tenantDataPrefix,int loopDepth) - { - loopDepth = a_body1cont7(std::move(tenantDataPrefix), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CreateTenantTransactionActor, 3, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 3, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont5when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 3, Optional >*,Optional && value) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont5when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< CreateTenantTransactionActor, 3, Optional >*,Error err) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 3); - - } - int a_body1cont8(RangeResult const& contents,int loopDepth) - { - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!contents.empty()) - #line 5577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1Catch1(tenant_prefix_allocator_conflict(), loopDepth); - #line 5581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(tenantLastIdKey, TenantMapEntry::idToPrefix(newTenant.id)); - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(tenantMapKey, encodeTenantEntry(newTenant)); - #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(newTenant); this->~CreateTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 5589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(newTenant)); // state_var_RVO - this->~CreateTenantTransactionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont8(RangeResult && contents,int loopDepth) - { - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!contents.empty()) - #line 5601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1Catch1(tenant_prefix_allocator_conflict(), loopDepth); - #line 5605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(tenantLastIdKey, TenantMapEntry::idToPrefix(newTenant.id)); - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->set(tenantMapKey, encodeTenantEntry(newTenant)); - #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(newTenant); this->~CreateTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 5613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(newTenant)); // state_var_RVO - this->~CreateTenantTransactionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont7when1(RangeResult const& contents,int loopDepth) - { - loopDepth = a_body1cont8(contents, loopDepth); - - return loopDepth; - } - int a_body1cont7when1(RangeResult && contents,int loopDepth) - { - loopDepth = a_body1cont8(std::move(contents), loopDepth); - - return loopDepth; - } - void a_exitChoose5() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CreateTenantTransactionActor, 4, RangeResult >::remove(); - - } - void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 4, RangeResult >*,RangeResult const& value) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont7when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 4); - - } - void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 4, RangeResult >*,RangeResult && value) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont7when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 4); - - } - void a_callback_error(ActorCallback< CreateTenantTransactionActor, 4, RangeResult >*,Error err) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 4); - - } - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Transaction tr; - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TenantNameRef name; - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Key tenantMapKey; - #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Future> tenantEntryFuture; - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename transaction_future_type>::type tenantDataPrefixFuture; - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename transaction_future_type>::type lastIdFuture; - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename transaction_future_type>::type tenantModeFuture; - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Optional lastIdVal; - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TenantMapEntry newTenant; - #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename transaction_future_type::type prefixRangeFuture; - #line 5704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -}; -// This generated class is to be used only via createTenantTransaction() - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class CreateTenantTransactionActor final : public Actor>, public ActorCallback< CreateTenantTransactionActor, 0, Optional >, public ActorCallback< CreateTenantTransactionActor, 1, Optional >, public ActorCallback< CreateTenantTransactionActor, 2, Optional >, public ActorCallback< CreateTenantTransactionActor, 3, Optional >, public ActorCallback< CreateTenantTransactionActor, 4, RangeResult >, public FastAllocated>, public CreateTenantTransactionActorState> { - #line 5711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< CreateTenantTransactionActor, 0, Optional >; -friend struct ActorCallback< CreateTenantTransactionActor, 1, Optional >; -friend struct ActorCallback< CreateTenantTransactionActor, 2, Optional >; -friend struct ActorCallback< CreateTenantTransactionActor, 3, Optional >; -friend struct ActorCallback< CreateTenantTransactionActor, 4, RangeResult >; - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - CreateTenantTransactionActor(Transaction const& tr,TenantNameRef const& name) - #line 5726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - : Actor>(), - CreateTenantTransactionActorState>(tr, name) - { - fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("createTenantTransaction"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< CreateTenantTransactionActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< CreateTenantTransactionActor, 1, Optional >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< CreateTenantTransactionActor, 2, Optional >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< CreateTenantTransactionActor, 3, Optional >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< CreateTenantTransactionActor, 4, RangeResult >*)0, actor_cancelled()); break; - } - - } -}; - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -[[nodiscard]] Future> createTenantTransaction( Transaction const& tr, TenantNameRef const& name ) { - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return Future>(new CreateTenantTransactionActor(tr, name)); - #line 5759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -} - -#line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - - #line 5764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -// This generated class is to be used only via createTenant() - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class CreateTenantActorState { - #line 5770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - CreateTenantActorState(Reference const& db,TenantName const& name) - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - : db(db), - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - name(name), - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr(db->createTransaction()), - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - firstTry(true) - #line 5783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - fdb_probe_actor_create("createTenant", reinterpret_cast(this)); - - } - ~CreateTenantActorState() - { - fdb_probe_actor_destroy("createTenant", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ; - #line 5798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~CreateTenantActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) - { - try { - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (firstTry) - #line 5831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_0 = tryGetTenantTransaction(tr, name); - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 5837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - else - { - loopDepth = a_body1loopBody1cont2(loopDepth); - } - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1cont1(int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_3 = safeThreadFutureToFuture(tr->onError(e)); - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - int a_body1loopBody1cont2(int loopDepth) - { - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_1 = createTenantTransaction(tr, name); - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 5893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont3(Optional const& entry,int loopDepth) - { - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (entry.present()) - #line 5907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1loopBody1Catch1(tenant_already_exists(), loopDepth); - #line 5911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - firstTry = false; - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopBody1cont2(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont3(Optional && entry,int loopDepth) - { - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (entry.present()) - #line 5924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1loopBody1Catch1(tenant_already_exists(), loopDepth); - #line 5928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - firstTry = false; - #line 5932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopBody1cont2(loopDepth); - - return loopDepth; - } - int a_body1loopBody1when1(Optional const& entry,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(entry, loopDepth); - - return loopDepth; - } - int a_body1loopBody1when1(Optional && entry,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(std::move(entry), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CreateTenantActor, 0, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< CreateTenantActor, 0, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< CreateTenantActor, 0, Optional >*,Optional && value) - { - fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< CreateTenantActor, 0, Optional >*,Error err) - { - fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 0); - - } - int a_body1loopBody1cont6(int loopDepth) - { - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (BUGGIFY) - #line 6004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1loopBody1Catch1(commit_unknown_result(), loopDepth); - #line 6008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->commit()); - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 6014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont2when1(Optional const& __newTenant,int loopDepth) - { - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - newTenant = __newTenant; - #line 6028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopBody1cont6(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont2when1(Optional && __newTenant,int loopDepth) - { - newTenant = std::move(__newTenant); - loopDepth = a_body1loopBody1cont6(loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CreateTenantActor, 1, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< CreateTenantActor, 1, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< CreateTenantActor, 1, Optional >*,Optional && value) - { - fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< CreateTenantActor, 1, Optional >*,Error err) - { - fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 1); - - } - int a_body1loopBody1cont7(Void const& _,int loopDepth) - { - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (BUGGIFY) - #line 6095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1loopBody1Catch1(commit_unknown_result(), loopDepth); - #line 6099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TraceEvent("CreatedTenant") .detail("Tenant", name) .detail("TenantId", newTenant.present() ? newTenant.get().id : -1) .detail("Prefix", newTenant.present() ? (StringRef)newTenant.get().prefix : "Unknown"_sr) .detail("Version", tr->getCommittedVersion()); - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CreateTenantActorState(); static_cast(this)->destroy(); return 0; } - #line 6105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~CreateTenantActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont7(Void && _,int loopDepth) - { - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (BUGGIFY) - #line 6117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1loopBody1Catch1(commit_unknown_result(), loopDepth); - #line 6121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TraceEvent("CreatedTenant") .detail("Tenant", name) .detail("TenantId", newTenant.present() ? newTenant.get().id : -1) .detail("Prefix", newTenant.present() ? (StringRef)newTenant.get().prefix : "Unknown"_sr) .detail("Version", tr->getCommittedVersion()); - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CreateTenantActorState(); static_cast(this)->destroy(); return 0; } - #line 6127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~CreateTenantActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont6when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont7(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont6when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont7(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CreateTenantActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< CreateTenantActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont6when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< CreateTenantActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont6when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< CreateTenantActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 2); - - } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CreateTenantActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< CreateTenantActor, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< CreateTenantActor, 3, Void >*,Void && value) - { - fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< CreateTenantActor, 3, Void >*,Error err) - { - fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 3); - - } - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference db; - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TenantName name; - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference tr; - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - bool firstTry; - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Optional newTenant; - #line 6283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -}; -// This generated class is to be used only via createTenant() - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class CreateTenantActor final : public Actor, public ActorCallback< CreateTenantActor, 0, Optional >, public ActorCallback< CreateTenantActor, 1, Optional >, public ActorCallback< CreateTenantActor, 2, Void >, public ActorCallback< CreateTenantActor, 3, Void >, public FastAllocated>, public CreateTenantActorState> { - #line 6290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< CreateTenantActor, 0, Optional >; -friend struct ActorCallback< CreateTenantActor, 1, Optional >; -friend struct ActorCallback< CreateTenantActor, 2, Void >; -friend struct ActorCallback< CreateTenantActor, 3, Void >; - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - CreateTenantActor(Reference const& db,TenantName const& name) - #line 6304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - : Actor(), - CreateTenantActorState>(db, name) - { - fdb_probe_actor_enter("createTenant", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("createTenant"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("createTenant", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< CreateTenantActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< CreateTenantActor, 1, Optional >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< CreateTenantActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< CreateTenantActor, 3, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -[[nodiscard]] Future createTenant( Reference const& db, TenantName const& name ) { - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return Future(new CreateTenantActor(db, name)); - #line 6336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -} - -#line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - - #line 6341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -// This generated class is to be used only via deleteTenantTransaction() - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class DeleteTenantTransactionActorState { - #line 6347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - DeleteTenantTransactionActorState(Transaction const& tr,TenantNameRef const& name) - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - : tr(tr), - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - name(name), - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tenantMapKey(name.withPrefix(tenantMapPrefix)) - #line 6358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - fdb_probe_actor_create("deleteTenantTransaction", reinterpret_cast(this)); - - } - ~DeleteTenantTransactionActorState() - { - fdb_probe_actor_destroy("deleteTenantTransaction", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::RAW_ACCESS); - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_0 = tryGetTenantTransaction(tr, name); - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 6384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~DeleteTenantTransactionActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(int loopDepth) - { - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!tenantEntry.present()) - #line 6407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 6411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~DeleteTenantTransactionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - prefixRangeFuture = tr->getRange(prefixRange(tenantEntry.get().prefix), 1); - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_1 = safeThreadFutureToFuture(prefixRangeFuture); - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1when1(Optional const& __tenantEntry,int loopDepth) - { - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tenantEntry = __tenantEntry; - #line 6437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1cont1(loopDepth); - - return loopDepth; - } - int a_body1when1(Optional && __tenantEntry,int loopDepth) - { - tenantEntry = std::move(__tenantEntry); - loopDepth = a_body1cont1(loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DeleteTenantTransactionActor, 0, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< DeleteTenantTransactionActor, 0, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< DeleteTenantTransactionActor, 0, Optional >*,Optional && value) - { - fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< DeleteTenantTransactionActor, 0, Optional >*,Error err) - { - fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 0); - - } - int a_body1cont2(RangeResult const& contents,int loopDepth) - { - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!contents.empty()) - #line 6504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1Catch1(tenant_not_empty(), loopDepth); - #line 6508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->clear(tenantMapKey); - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 6514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~DeleteTenantTransactionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont2(RangeResult && contents,int loopDepth) - { - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!contents.empty()) - #line 6526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1Catch1(tenant_not_empty(), loopDepth); - #line 6530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->clear(tenantMapKey); - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 6536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~DeleteTenantTransactionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont1when1(RangeResult const& contents,int loopDepth) - { - loopDepth = a_body1cont2(contents, loopDepth); - - return loopDepth; - } - int a_body1cont1when1(RangeResult && contents,int loopDepth) - { - loopDepth = a_body1cont2(std::move(contents), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DeleteTenantTransactionActor, 1, RangeResult >::remove(); - - } - void a_callback_fire(ActorCallback< DeleteTenantTransactionActor, 1, RangeResult >*,RangeResult const& value) - { - fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< DeleteTenantTransactionActor, 1, RangeResult >*,RangeResult && value) - { - fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< DeleteTenantTransactionActor, 1, RangeResult >*,Error err) - { - fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 1); - - } - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Transaction tr; - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TenantNameRef name; - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Key tenantMapKey; - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Optional tenantEntry; - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename transaction_future_type::type prefixRangeFuture; - #line 6617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -}; -// This generated class is to be used only via deleteTenantTransaction() - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class DeleteTenantTransactionActor final : public Actor, public ActorCallback< DeleteTenantTransactionActor, 0, Optional >, public ActorCallback< DeleteTenantTransactionActor, 1, RangeResult >, public FastAllocated>, public DeleteTenantTransactionActorState> { - #line 6624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< DeleteTenantTransactionActor, 0, Optional >; -friend struct ActorCallback< DeleteTenantTransactionActor, 1, RangeResult >; - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - DeleteTenantTransactionActor(Transaction const& tr,TenantNameRef const& name) - #line 6636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - : Actor(), - DeleteTenantTransactionActorState>(tr, name) - { - fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("deleteTenantTransaction"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< DeleteTenantTransactionActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< DeleteTenantTransactionActor, 1, RangeResult >*)0, actor_cancelled()); break; - } - - } -}; - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -[[nodiscard]] Future deleteTenantTransaction( Transaction const& tr, TenantNameRef const& name ) { - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return Future(new DeleteTenantTransactionActor(tr, name)); - #line 6666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -} - -#line 830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - - #line 6671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -// This generated class is to be used only via deleteTenant() - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class DeleteTenantActorState { - #line 6677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - DeleteTenantActorState(Reference const& db,TenantName const& name) - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - : db(db), - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - name(name), - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr(db->createTransaction()), - #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - firstTry(true) - #line 6690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - fdb_probe_actor_create("deleteTenant", reinterpret_cast(this)); - - } - ~DeleteTenantActorState() - { - fdb_probe_actor_destroy("deleteTenant", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ; - #line 6705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~DeleteTenantActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) - { - try { - #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (firstTry) - #line 6738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_0 = tryGetTenantTransaction(tr, name); - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 6744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 6749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - else - { - loopDepth = a_body1loopBody1cont2(loopDepth); - } - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1cont1(int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_3 = safeThreadFutureToFuture(tr->onError(e)); - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - int a_body1loopBody1cont2(int loopDepth) - { - #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_1 = deleteTenantTransaction(tr, name); - #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 6800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont3(Optional const& entry,int loopDepth) - { - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!entry.present()) - #line 6814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1loopBody1Catch1(tenant_not_found(), loopDepth); - #line 6818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - firstTry = false; - #line 6822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopBody1cont2(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont3(Optional && entry,int loopDepth) - { - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!entry.present()) - #line 6831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1loopBody1Catch1(tenant_not_found(), loopDepth); - #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - firstTry = false; - #line 6839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopBody1cont2(loopDepth); - - return loopDepth; - } - int a_body1loopBody1when1(Optional const& entry,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(entry, loopDepth); - - return loopDepth; - } - int a_body1loopBody1when1(Optional && entry,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(std::move(entry), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DeleteTenantActor, 0, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< DeleteTenantActor, 0, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< DeleteTenantActor, 0, Optional >*,Optional && value) - { - fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< DeleteTenantActor, 0, Optional >*,Error err) - { - fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 0); - - } - int a_body1loopBody1cont6(Void const& _,int loopDepth) - { - #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (BUGGIFY) - #line 6911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1loopBody1Catch1(commit_unknown_result(), loopDepth); - #line 6915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->commit()); - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 6921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont6(Void && _,int loopDepth) - { - #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (BUGGIFY) - #line 6935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1loopBody1Catch1(commit_unknown_result(), loopDepth); - #line 6939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->commit()); - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 6945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont2when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont6(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont2when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont6(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DeleteTenantActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< DeleteTenantActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< DeleteTenantActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< DeleteTenantActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 1); - - } - int a_body1loopBody1cont7(Void const& _,int loopDepth) - { - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (BUGGIFY) - #line 7022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1loopBody1Catch1(commit_unknown_result(), loopDepth); - #line 7026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TraceEvent("DeletedTenant").detail("Tenant", name).detail("Version", tr->getCommittedVersion()); - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteTenantActorState(); static_cast(this)->destroy(); return 0; } - #line 7032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~DeleteTenantActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont7(Void && _,int loopDepth) - { - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (BUGGIFY) - #line 7044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return a_body1loopBody1Catch1(commit_unknown_result(), loopDepth); - #line 7048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TraceEvent("DeletedTenant").detail("Tenant", name).detail("Version", tr->getCommittedVersion()); - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteTenantActorState(); static_cast(this)->destroy(); return 0; } - #line 7054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~DeleteTenantActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont6when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont7(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont6when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont7(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DeleteTenantActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< DeleteTenantActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont6when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< DeleteTenantActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont6when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< DeleteTenantActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 2); - - } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DeleteTenantActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< DeleteTenantActor, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< DeleteTenantActor, 3, Void >*,Void && value) - { - fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< DeleteTenantActor, 3, Void >*,Error err) - { - fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 3); - - } - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference db; - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TenantName name; - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference tr; - #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - bool firstTry; - #line 7208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -}; -// This generated class is to be used only via deleteTenant() - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class DeleteTenantActor final : public Actor, public ActorCallback< DeleteTenantActor, 0, Optional >, public ActorCallback< DeleteTenantActor, 1, Void >, public ActorCallback< DeleteTenantActor, 2, Void >, public ActorCallback< DeleteTenantActor, 3, Void >, public FastAllocated>, public DeleteTenantActorState> { - #line 7215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< DeleteTenantActor, 0, Optional >; -friend struct ActorCallback< DeleteTenantActor, 1, Void >; -friend struct ActorCallback< DeleteTenantActor, 2, Void >; -friend struct ActorCallback< DeleteTenantActor, 3, Void >; - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - DeleteTenantActor(Reference const& db,TenantName const& name) - #line 7229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - : Actor(), - DeleteTenantActorState>(db, name) - { - fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("deleteTenant"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< DeleteTenantActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< DeleteTenantActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< DeleteTenantActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< DeleteTenantActor, 3, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -[[nodiscard]] Future deleteTenant( Reference const& db, TenantName const& name ) { - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return Future(new DeleteTenantActor(db, name)); - #line 7261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -} - -#line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - - #line 7266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -// This generated class is to be used only via listTenantsTransaction() - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class ListTenantsTransactionActorState { - #line 7272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ListTenantsTransactionActorState(Transaction const& tr,TenantNameRef const& begin,TenantNameRef const& end,int const& limit) - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - : tr(tr), - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - begin(begin), - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - end(end), - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - limit(limit), - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - range(KeyRangeRef(begin, end).withPrefix(tenantMapPrefix)) - #line 7287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - fdb_probe_actor_create("listTenantsTransaction", reinterpret_cast(this)); - - } - ~ListTenantsTransactionActorState() - { - fdb_probe_actor_destroy("listTenantsTransaction", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::RAW_ACCESS); - #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - listFuture = tr->getRange(firstGreaterOrEqual(range.begin), firstGreaterOrEqual(range.end), limit); - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_0 = safeThreadFutureToFuture(listFuture); - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~ListTenantsTransactionActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(RangeResult const& results,int loopDepth) - { - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::map tenants; - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto kv : results ) { - #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tenants[kv.key.removePrefix(tenantMapPrefix)] = decodeTenantEntry(kv.value); - #line 7342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(tenants); this->~ListTenantsTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 7346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< std::map >::value()) std::map(tenants); - this->~ListTenantsTransactionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont1(RangeResult && results,int loopDepth) - { - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - std::map tenants; - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - for( auto kv : results ) { - #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tenants[kv.key.removePrefix(tenantMapPrefix)] = decodeTenantEntry(kv.value); - #line 7362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - } - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(tenants); this->~ListTenantsTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 7366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< std::map >::value()) std::map(tenants); - this->~ListTenantsTransactionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1when1(RangeResult const& results,int loopDepth) - { - loopDepth = a_body1cont1(results, loopDepth); - - return loopDepth; - } - int a_body1when1(RangeResult && results,int loopDepth) - { - loopDepth = a_body1cont1(std::move(results), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ListTenantsTransactionActor, 0, RangeResult >::remove(); - - } - void a_callback_fire(ActorCallback< ListTenantsTransactionActor, 0, RangeResult >*,RangeResult const& value) - { - fdb_probe_actor_enter("listTenantsTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("listTenantsTransaction", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< ListTenantsTransactionActor, 0, RangeResult >*,RangeResult && value) - { - fdb_probe_actor_enter("listTenantsTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("listTenantsTransaction", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< ListTenantsTransactionActor, 0, RangeResult >*,Error err) - { - fdb_probe_actor_enter("listTenantsTransaction", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("listTenantsTransaction", reinterpret_cast(this), 0); - - } - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Transaction tr; - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TenantNameRef begin; - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TenantNameRef end; - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - int limit; - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - KeyRange range; - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - typename transaction_future_type::type listFuture; - #line 7449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -}; -// This generated class is to be used only via listTenantsTransaction() - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class ListTenantsTransactionActor final : public Actor>, public ActorCallback< ListTenantsTransactionActor, 0, RangeResult >, public FastAllocated>, public ListTenantsTransactionActorState> { - #line 7456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< ListTenantsTransactionActor, 0, RangeResult >; - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ListTenantsTransactionActor(Transaction const& tr,TenantNameRef const& begin,TenantNameRef const& end,int const& limit) - #line 7467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - : Actor>(), - ListTenantsTransactionActorState>(tr, begin, end, limit) - { - fdb_probe_actor_enter("listTenantsTransaction", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("listTenantsTransaction"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("listTenantsTransaction", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ListTenantsTransactionActor, 0, RangeResult >*)0, actor_cancelled()); break; - } - - } -}; - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -[[nodiscard]] Future> listTenantsTransaction( Transaction const& tr, TenantNameRef const& begin, TenantNameRef const& end, int const& limit ) { - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return Future>(new ListTenantsTransactionActor(tr, begin, end, limit)); - #line 7496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -} - -#line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - - #line 7501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -// This generated class is to be used only via listTenants() - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class ListTenantsActorState { - #line 7507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ListTenantsActorState(Reference const& db,TenantName const& begin,TenantName const& end,int const& limit) - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - : db(db), - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - begin(begin), - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - end(end), - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - limit(limit), - #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr(db->createTransaction()) - #line 7522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - { - fdb_probe_actor_create("listTenants", reinterpret_cast(this)); - - } - ~ListTenantsActorState() - { - fdb_probe_actor_destroy("listTenants", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ; - #line 7537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~ListTenantsActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) - { - try { - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture> __when_expr_0 = listTenantsTransaction(tr, begin, end, limit); - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 7572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 7577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1cont1(int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->onError(e)); - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 7601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - int a_body1loopBody1cont2(std::map const& tenants,int loopDepth) - { - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(tenants); this->~ListTenantsActorState(); static_cast(this)->destroy(); return 0; } - #line 7621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< std::map >::value()) std::map(tenants); - this->~ListTenantsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont2(std::map && tenants,int loopDepth) - { - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(tenants); this->~ListTenantsActorState(); static_cast(this)->destroy(); return 0; } - #line 7633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - new (&static_cast(this)->SAV< std::map >::value()) std::map(tenants); - this->~ListTenantsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1when1(std::map const& tenants,int loopDepth) - { - loopDepth = a_body1loopBody1cont2(tenants, loopDepth); - - return loopDepth; - } - int a_body1loopBody1when1(std::map && tenants,int loopDepth) - { - loopDepth = a_body1loopBody1cont2(std::move(tenants), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ListTenantsActor, 0, std::map >::remove(); - - } - void a_callback_fire(ActorCallback< ListTenantsActor, 0, std::map >*,std::map const& value) - { - fdb_probe_actor_enter("listTenants", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("listTenants", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< ListTenantsActor, 0, std::map >*,std::map && value) - { - fdb_probe_actor_enter("listTenants", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("listTenants", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< ListTenantsActor, 0, std::map >*,Error err) - { - fdb_probe_actor_enter("listTenants", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("listTenants", reinterpret_cast(this), 0); - - } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ListTenantsActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ListTenantsActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("listTenants", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("listTenants", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< ListTenantsActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("listTenants", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("listTenants", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< ListTenantsActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("listTenants", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("listTenants", reinterpret_cast(this), 1); - - } - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference db; - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TenantName begin; - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - TenantName end; - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - int limit; - #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - Reference tr; - #line 7789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -}; -// This generated class is to be used only via listTenants() - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -class ListTenantsActor final : public Actor>, public ActorCallback< ListTenantsActor, 0, std::map >, public ActorCallback< ListTenantsActor, 1, Void >, public FastAllocated>, public ListTenantsActorState> { - #line 7796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< ListTenantsActor, 0, std::map >; -friend struct ActorCallback< ListTenantsActor, 1, Void >; - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - ListTenantsActor(Reference const& db,TenantName const& begin,TenantName const& end,int const& limit) - #line 7808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" - : Actor>(), - ListTenantsActorState>(db, begin, end, limit) - { - fdb_probe_actor_enter("listTenants", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("listTenants"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("listTenants", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ListTenantsActor, 0, std::map >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< ListTenantsActor, 1, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -template - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -[[nodiscard]] Future> listTenants( Reference const& db, TenantName const& begin, TenantName const& end, int const& limit ) { - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" - return Future>(new ListTenantsActor(db, begin, end, limit)); - #line 7838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.g.h" -} - -#line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GenericManagementAPI.actor.h" -} // namespace ManagementAPI - -#include "flow/unactorcompiler.h" -#endif diff --git a/src/fdbclient/GlobalConfig.actor.cpp b/src/fdbclient/GlobalConfig.actor.cpp index 6b99ca8..45db5aa 100644 --- a/src/fdbclient/GlobalConfig.actor.cpp +++ b/src/fdbclient/GlobalConfig.actor.cpp @@ -28,14 +28,14 @@ #include "flow/actorcompiler.h" // This must be the last #include. -const KeyRef fdbClientInfoTxnSampleRate = LiteralStringRef("config/fdb_client_info/client_txn_sample_rate"); -const KeyRef fdbClientInfoTxnSizeLimit = LiteralStringRef("config/fdb_client_info/client_txn_size_limit"); +const KeyRef fdbClientInfoTxnSampleRate = "config/fdb_client_info/client_txn_sample_rate"_sr; +const KeyRef fdbClientInfoTxnSizeLimit = "config/fdb_client_info/client_txn_size_limit"_sr; -const KeyRef transactionTagSampleRate = LiteralStringRef("config/transaction_tag_sample_rate"); -const KeyRef transactionTagSampleCost = LiteralStringRef("config/transaction_tag_sample_cost"); +const KeyRef transactionTagSampleRate = "config/transaction_tag_sample_rate"_sr; +const KeyRef transactionTagSampleCost = "config/transaction_tag_sample_cost"_sr; -const KeyRef samplingFrequency = LiteralStringRef("visibility/sampling/frequency"); -const KeyRef samplingWindow = LiteralStringRef("visibility/sampling/window"); +const KeyRef samplingFrequency = "visibility/sampling/frequency"_sr; +const KeyRef samplingWindow = "visibility/sampling/window"_sr; GlobalConfig::GlobalConfig(DatabaseContext* cx) : cx(cx), lastUpdate(0) {} @@ -62,7 +62,7 @@ void GlobalConfig::applyChanges(Transaction& tr, // Write version key to trigger update in cluster controller. tr.atomicOp(globalConfigVersionKey, - LiteralStringRef("0123456789\x00\x00\x00\x00"), // versionstamp + "0123456789\x00\x00\x00\x00"_sr, // versionstamp MutationRef::SetVersionstampedValue); } @@ -101,7 +101,7 @@ void GlobalConfig::trigger(KeyRef key, std::functionfirst)) { @@ -153,109 +153,29 @@ void GlobalConfig::erase(KeyRangeRef range) { } } -// Similar to tr.onError(), but doesn't require a DatabaseContext. -struct Backoff { - Future onError() { - double currentBackoff = backoff; - backoff = std::min(backoff * CLIENT_KNOBS->BACKOFF_GROWTH_RATE, CLIENT_KNOBS->DEFAULT_MAX_BACKOFF); - return delay(currentBackoff * deterministicRandom()->random01()); - } - -private: - double backoff = CLIENT_KNOBS->DEFAULT_BACKOFF; -}; - -// Older FDB versions used different keys for client profiling data. This -// function performs a one-time migration of data in these keys to the new -// global configuration key space. -ACTOR Future GlobalConfig::migrate(GlobalConfig* self) { - state Key migratedKey("\xff\x02/fdbClientInfo/migrated/"_sr); - state Reference tr; - try { - state Backoff backoff; - loop { - tr = makeReference(Database(Reference::addRef(self->cx))); - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - - try { - state Optional migrated = wait(tr->get(migratedKey)); - if (migrated.present()) { - // Already performed migration. - return Void(); - } - - state Optional sampleRate = - wait(tr->get(Key("\xff\x02/fdbClientInfo/client_txn_sample_rate/"_sr))); - state Optional sizeLimit = - wait(tr->get(Key("\xff\x02/fdbClientInfo/client_txn_size_limit/"_sr))); - - tr->setOption(FDBTransactionOptions::SPECIAL_KEY_SPACE_ENABLE_WRITES); - // The value doesn't matter too much, as long as the key is set. - tr->set(migratedKey.contents(), "1"_sr); - if (sampleRate.present()) { - const double sampleRateDbl = - BinaryReader::fromStringRef(sampleRate.get().contents(), Unversioned()); - Tuple rate = Tuple().appendDouble(sampleRateDbl); - tr->set(GlobalConfig::prefixedKey(fdbClientInfoTxnSampleRate), rate.pack()); - } - if (sizeLimit.present()) { - const int64_t sizeLimitInt = - BinaryReader::fromStringRef(sizeLimit.get().contents(), Unversioned()); - Tuple size = Tuple().append(sizeLimitInt); - tr->set(GlobalConfig::prefixedKey(fdbClientInfoTxnSizeLimit), size.pack()); - } - - wait(tr->commit()); - break; - } catch (Error& e) { - // If multiple fdbserver processes are started at once, they will all - // attempt this migration at the same time, sometimes resulting in - // aborts due to conflicts. Purposefully avoid retrying, making this - // migration best-effort. - TraceEvent(SevInfo, "GlobalConfig_RetryableMigrationError").errorUnsuppressed(e).suppressFor(1.0); - wait(tr->onError(e)); - tr.clear(); - // tr is cleared, so it won't backoff properly. Use custom backoff logic here. - wait(backoff.onError()); - } - } - } catch (Error& e) { - // Catch non-retryable errors (and do nothing). - TraceEvent(SevWarnAlways, "GlobalConfig_MigrationError").error(e); - } - return Void(); -} - // Updates local copy of global configuration by reading the entire key-range -// from storage. -ACTOR Future GlobalConfig::refresh(GlobalConfig* self) { - // TraceEvent trace(SevInfo, "GlobalConfig_Refresh"); +// from storage (proxied through the GrvProxies). +ACTOR Future GlobalConfig::refresh(GlobalConfig* self, Version lastKnown) { + // TraceEvent trace(SevInfo, "GlobalConfigRefresh"); self->erase(KeyRangeRef(""_sr, "\xff"_sr)); - state Backoff backoff; - - state Reference tr; + state Backoff backoff(CLIENT_KNOBS->GLOBAL_CONFIG_REFRESH_BACKOFF, CLIENT_KNOBS->GLOBAL_CONFIG_REFRESH_MAX_BACKOFF); loop { try { - tr = makeReference(Database(Reference::addRef(self->cx))); - tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - RangeResult result = wait(tr->getRange(globalConfigDataKeys, CLIENT_KNOBS->TOO_MANY)); - for (const auto& kv : result) { + GlobalConfigRefreshReply reply = + wait(timeoutError(basicLoadBalance(self->cx->getGrvProxies(UseProvisionalProxies::False), + &GrvProxyInterface::refreshGlobalConfig, + GlobalConfigRefreshRequest{ lastKnown }), + CLIENT_KNOBS->GLOBAL_CONFIG_REFRESH_TIMEOUT)); + for (const auto& kv : reply.result) { KeyRef systemKey = kv.key.removePrefix(globalConfigKeysPrefix); self->insert(systemKey, kv.value); } - break; + return Void(); } catch (Error& e) { - TraceEvent("GlobalConfigRefreshError").errorUnsuppressed(e).suppressFor(1.0); - wait(tr->onError(e)); - tr.clear(); - // tr is cleared, so it won't backoff properly. Use custom backoff logic here. wait(backoff.onError()); } } - return Void(); } // Applies updates to the local copy of the global configuration when this @@ -265,9 +185,8 @@ ACTOR Future GlobalConfig::updater(GlobalConfig* self, const ClientDBInfo* try { if (self->initialized.canBeSet()) { wait(self->cx->onConnected()); - wait(self->migrate(self)); - wait(self->refresh(self)); + wait(self->refresh(self, -1)); self->initialized.send(Void()); } @@ -284,7 +203,7 @@ ACTOR Future GlobalConfig::updater(GlobalConfig* self, const ClientDBInfo* // This process missed too many global configuration // history updates or the protocol version changed, so it // must re-read the entire configuration range. - wait(self->refresh(self)); + wait(self->refresh(self, history.back().version)); if (dbInfo->history.size() > 0) { self->lastUpdate = dbInfo->history.back().version; } diff --git a/src/fdbclient/GlobalConfig.actor.g.cpp b/src/fdbclient/GlobalConfig.actor.g.cpp index 7de7828..000a534 100644 --- a/src/fdbclient/GlobalConfig.actor.g.cpp +++ b/src/fdbclient/GlobalConfig.actor.g.cpp @@ -30,14 +30,14 @@ #include "flow/actorcompiler.h" // This must be the last #include. -const KeyRef fdbClientInfoTxnSampleRate = LiteralStringRef("config/fdb_client_info/client_txn_sample_rate"); -const KeyRef fdbClientInfoTxnSizeLimit = LiteralStringRef("config/fdb_client_info/client_txn_size_limit"); +const KeyRef fdbClientInfoTxnSampleRate = "config/fdb_client_info/client_txn_sample_rate"_sr; +const KeyRef fdbClientInfoTxnSizeLimit = "config/fdb_client_info/client_txn_size_limit"_sr; -const KeyRef transactionTagSampleRate = LiteralStringRef("config/transaction_tag_sample_rate"); -const KeyRef transactionTagSampleCost = LiteralStringRef("config/transaction_tag_sample_cost"); +const KeyRef transactionTagSampleRate = "config/transaction_tag_sample_rate"_sr; +const KeyRef transactionTagSampleCost = "config/transaction_tag_sample_cost"_sr; -const KeyRef samplingFrequency = LiteralStringRef("visibility/sampling/frequency"); -const KeyRef samplingWindow = LiteralStringRef("visibility/sampling/window"); +const KeyRef samplingFrequency = "visibility/sampling/frequency"_sr; +const KeyRef samplingWindow = "visibility/sampling/window"_sr; GlobalConfig::GlobalConfig(DatabaseContext* cx) : cx(cx), lastUpdate(0) {} @@ -64,7 +64,7 @@ void GlobalConfig::applyChanges(Transaction& tr, // Write version key to trigger update in cluster controller. tr.atomicOp(globalConfigVersionKey, - LiteralStringRef("0123456789\x00\x00\x00\x00"), // versionstamp + "0123456789\x00\x00\x00\x00"_sr, // versionstamp MutationRef::SetVersionstampedValue); } @@ -103,7 +103,7 @@ void GlobalConfig::trigger(KeyRef key, std::functionfirst)) { @@ -155,835 +155,24 @@ void GlobalConfig::erase(KeyRangeRef range) { } } -// Similar to tr.onError(), but doesn't require a DatabaseContext. -struct Backoff { - Future onError() { - double currentBackoff = backoff; - backoff = std::min(backoff * CLIENT_KNOBS->BACKOFF_GROWTH_RATE, CLIENT_KNOBS->DEFAULT_MAX_BACKOFF); - return delay(currentBackoff * deterministicRandom()->random01()); - } - -private: - double backoff = CLIENT_KNOBS->DEFAULT_BACKOFF; -}; - -// Older FDB versions used different keys for client profiling data. This -// function performs a one-time migration of data in these keys to the new -// global configuration key space. - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" -// This generated class is to be used only via migrate() - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" -template - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" -class GlobalConfig_MigrateActorState { - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" -public: - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - GlobalConfig_MigrateActorState(GlobalConfig* const& self) - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - : self(self), - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - migratedKey("\xff\x02/fdbClientInfo/migrated/"_sr), - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr() - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - { - fdb_probe_actor_create("migrate", reinterpret_cast(this)); - - } - ~GlobalConfig_MigrateActorState() - { - fdb_probe_actor_destroy("migrate", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - try { - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - backoff = Backoff(); - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - ; - #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch2(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch2(unknown_error(), loopDepth); - } - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~GlobalConfig_MigrateActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(int loopDepth) - { - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GlobalConfig_MigrateActorState(); static_cast(this)->destroy(); return 0; } - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~GlobalConfig_MigrateActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1Catch2(const Error& e,int loopDepth=0) - { - try { - #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - TraceEvent(SevWarnAlways, "GlobalConfig_MigrationError").error(e); - #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont2(int loopDepth) - { - loopDepth = a_body1cont3(loopDepth); - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) - { - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr = makeReference(Database(Reference::addRef(self->cx))); - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - try { - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture> __when_expr_0 = tr->get(migratedKey); - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1break1(int loopDepth) - { - try { - return a_body1cont2(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch2(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch2(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1cont1(int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - TraceEvent(SevInfo, "GlobalConfig_RetryableMigrationError").errorUnsuppressed(e).suppressFor(1.0); - #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_4 = tr->onError(e); - #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch2(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch2(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch2(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - int a_body1loopBody1cont2(int loopDepth) - { - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (migrated.present()) - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - { - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GlobalConfig_MigrateActorState(); static_cast(this)->destroy(); return 0; } - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~GlobalConfig_MigrateActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture> __when_expr_1 = tr->get(Key("\xff\x02/fdbClientInfo/client_txn_sample_rate/"_sr)); - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1when1(Optional const& __migrated,int loopDepth) - { - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - migrated = __migrated; - #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = a_body1loopBody1cont2(loopDepth); - - return loopDepth; - } - int a_body1loopBody1when1(Optional && __migrated,int loopDepth) - { - migrated = std::move(__migrated); - loopDepth = a_body1loopBody1cont2(loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GlobalConfig_MigrateActor, 0, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< GlobalConfig_MigrateActor, 0, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< GlobalConfig_MigrateActor, 0, Optional >*,Optional && value) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< GlobalConfig_MigrateActor, 0, Optional >*,Error err) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 0); - - } - int a_body1loopBody1cont3(int loopDepth) - { - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture> __when_expr_2 = tr->get(Key("\xff\x02/fdbClientInfo/client_txn_size_limit/"_sr)); - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont2when1(Optional const& __sampleRate,int loopDepth) - { - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - sampleRate = __sampleRate; - #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont2when1(Optional && __sampleRate,int loopDepth) - { - sampleRate = std::move(__sampleRate); - loopDepth = a_body1loopBody1cont3(loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GlobalConfig_MigrateActor, 1, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< GlobalConfig_MigrateActor, 1, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< GlobalConfig_MigrateActor, 1, Optional >*,Optional && value) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< GlobalConfig_MigrateActor, 1, Optional >*,Error err) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 1); - - } - int a_body1loopBody1cont5(int loopDepth) - { - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr->setOption(FDBTransactionOptions::SPECIAL_KEY_SPACE_ENABLE_WRITES); - #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr->set(migratedKey.contents(), "1"_sr); - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (sampleRate.present()) - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - { - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - const double sampleRateDbl = BinaryReader::fromStringRef(sampleRate.get().contents(), Unversioned()); - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - Tuple rate = Tuple().appendDouble(sampleRateDbl); - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr->set(GlobalConfig::prefixedKey(fdbClientInfoTxnSampleRate), rate.pack()); - #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - } - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (sizeLimit.present()) - #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - { - #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - const int64_t sizeLimitInt = BinaryReader::fromStringRef(sizeLimit.get().contents(), Unversioned()); - #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - Tuple size = Tuple().append(sizeLimitInt); - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr->set(GlobalConfig::prefixedKey(fdbClientInfoTxnSizeLimit), size.pack()); - #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - } - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_3 = tr->commit(); - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont3when1(Optional const& __sizeLimit,int loopDepth) - { - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - sizeLimit = __sizeLimit; - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = a_body1loopBody1cont5(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont3when1(Optional && __sizeLimit,int loopDepth) - { - sizeLimit = std::move(__sizeLimit); - loopDepth = a_body1loopBody1cont5(loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GlobalConfig_MigrateActor, 2, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< GlobalConfig_MigrateActor, 2, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont3when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< GlobalConfig_MigrateActor, 2, Optional >*,Optional && value) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont3when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< GlobalConfig_MigrateActor, 2, Optional >*,Error err) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 2); - - } - int a_body1loopBody1cont6(Void const& _,int loopDepth) - { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break - - return loopDepth; - } - int a_body1loopBody1cont6(Void && _,int loopDepth) - { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break - - return loopDepth; - } - int a_body1loopBody1cont5when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont6(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont5when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont6(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GlobalConfig_MigrateActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GlobalConfig_MigrateActor, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1cont5when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< GlobalConfig_MigrateActor, 3, Void >*,Void && value) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1cont5when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< GlobalConfig_MigrateActor, 3, Void >*,Error err) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 3); - - } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) - { - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr.clear(); - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_5 = backoff.onError(); - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch2(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1cont1when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) - { - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr.clear(); - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_5 = backoff.onError(); - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch2(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1cont1when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose5() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GlobalConfig_MigrateActor, 4, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GlobalConfig_MigrateActor, 4, Void >*,Void const& value) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1loopBody1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 4); - - } - void a_callback_fire(ActorCallback< GlobalConfig_MigrateActor, 4, Void >*,Void && value) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1loopBody1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 4); - - } - void a_callback_error(ActorCallback< GlobalConfig_MigrateActor, 4, Void >*,Error err) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1Catch2(err, 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 4); - - } - int a_body1loopBody1Catch1cont2(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont2(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont2(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont2(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose6() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GlobalConfig_MigrateActor, 5, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GlobalConfig_MigrateActor, 5, Void >*,Void const& value) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1loopBody1Catch1cont1when1(value, 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 5); - - } - void a_callback_fire(ActorCallback< GlobalConfig_MigrateActor, 5, Void >*,Void && value) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1loopBody1Catch1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 5); - - } - void a_callback_error(ActorCallback< GlobalConfig_MigrateActor, 5, Void >*,Error err) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1Catch2(err, 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("migrate", reinterpret_cast(this), 5); - - } - int a_body1cont3(int loopDepth) - { - try { - loopDepth = a_body1cont1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - GlobalConfig* self; - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - Key migratedKey; - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - Reference tr; - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - Backoff backoff; - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - Optional migrated; - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - Optional sampleRate; - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - Optional sizeLimit; - #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" -}; -// This generated class is to be used only via migrate() - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" -class GlobalConfig_MigrateActor final : public Actor, public ActorCallback< GlobalConfig_MigrateActor, 0, Optional >, public ActorCallback< GlobalConfig_MigrateActor, 1, Optional >, public ActorCallback< GlobalConfig_MigrateActor, 2, Optional >, public ActorCallback< GlobalConfig_MigrateActor, 3, Void >, public ActorCallback< GlobalConfig_MigrateActor, 4, Void >, public ActorCallback< GlobalConfig_MigrateActor, 5, Void >, public FastAllocated, public GlobalConfig_MigrateActorState { - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< GlobalConfig_MigrateActor, 0, Optional >; -friend struct ActorCallback< GlobalConfig_MigrateActor, 1, Optional >; -friend struct ActorCallback< GlobalConfig_MigrateActor, 2, Optional >; -friend struct ActorCallback< GlobalConfig_MigrateActor, 3, Void >; -friend struct ActorCallback< GlobalConfig_MigrateActor, 4, Void >; -friend struct ActorCallback< GlobalConfig_MigrateActor, 5, Void >; - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - GlobalConfig_MigrateActor(GlobalConfig* const& self) - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - : Actor(), - GlobalConfig_MigrateActorState(self) - { - fdb_probe_actor_enter("migrate", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("migrate"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("migrate", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GlobalConfig_MigrateActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GlobalConfig_MigrateActor, 1, Optional >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< GlobalConfig_MigrateActor, 2, Optional >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< GlobalConfig_MigrateActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< GlobalConfig_MigrateActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< GlobalConfig_MigrateActor, 5, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" -[[nodiscard]] Future GlobalConfig::migrate( GlobalConfig* const& self ) { - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - return Future(new GlobalConfig_MigrateActor(self)); - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" -} - -#line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - // Updates local copy of global configuration by reading the entire key-range -// from storage. - #line 973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" +// from storage (proxied through the GrvProxies). + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" // This generated class is to be used only via refresh() - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" template - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" class GlobalConfig_RefreshActorState { - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" public: - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - GlobalConfig_RefreshActorState(GlobalConfig* const& self) - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - : self(self) - #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + GlobalConfig_RefreshActorState(GlobalConfig* const& self,Version const& lastKnown) + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + : self(self), + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + lastKnown(lastKnown) + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { fdb_probe_actor_create("refresh", reinterpret_cast(this)); @@ -996,15 +185,13 @@ class GlobalConfig_RefreshActorState { int a_body1(int loopDepth=0) { try { - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" self->erase(KeyRangeRef(""_sr, "\xff"_sr)); - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - backoff = Backoff(); - #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr = Reference(); - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + backoff = Backoff(CLIENT_KNOBS->GLOBAL_CONFIG_REFRESH_BACKOFF, CLIENT_KNOBS->GLOBAL_CONFIG_REFRESH_MAX_BACKOFF); + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" ; - #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1023,18 +210,6 @@ class GlobalConfig_RefreshActorState { return loopDepth; } - int a_body1cont1(int loopDepth) - { - #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GlobalConfig_RefreshActorState(); static_cast(this)->destroy(); return 0; } - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~GlobalConfig_RefreshActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } int a_body1loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; @@ -1045,22 +220,16 @@ class GlobalConfig_RefreshActorState { int a_body1loopBody1(int loopDepth) { try { - #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr = makeReference(Database(Reference::addRef(self->cx))); - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_0 = tr->getRange(globalConfigDataKeys, CLIENT_KNOBS->TOO_MANY); - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + StrictFuture __when_expr_0 = timeoutError(basicLoadBalance(self->cx->getGrvProxies(UseProvisionalProxies::False), &GrvProxyInterface::refreshGlobalConfig, GlobalConfigRefreshRequest{ lastKnown }), CLIENT_KNOBS->GLOBAL_CONFIG_REFRESH_TIMEOUT); + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1071,19 +240,6 @@ class GlobalConfig_RefreshActorState { return loopDepth; } - int a_body1break1(int loopDepth) - { - try { - return a_body1cont1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } int a_body1loopBody1cont1(int loopDepth) { if (loopDepth == 0) return a_body1loopHead1(0); @@ -1093,18 +249,16 @@ class GlobalConfig_RefreshActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - TraceEvent("GlobalConfigRefreshError").errorUnsuppressed(e).suppressFor(1.0); - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_1 = tr->onError(e); - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + StrictFuture __when_expr_1 = backoff.onError(); + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1115,53 +269,65 @@ class GlobalConfig_RefreshActorState { return loopDepth; } - int a_body1loopBody1cont2(RangeResult const& result,int loopDepth) + int a_body1loopBody1cont2(GlobalConfigRefreshReply const& reply,int loopDepth) { - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - for( const auto& kv : result ) { - #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + for( const auto& kv : reply.result ) { + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" KeyRef systemKey = kv.key.removePrefix(globalConfigKeysPrefix); - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" self->insert(systemKey, kv.value); - #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GlobalConfig_RefreshActorState(); static_cast(this)->destroy(); return 0; } + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~GlobalConfig_RefreshActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1loopBody1cont2(RangeResult && result,int loopDepth) + int a_body1loopBody1cont2(GlobalConfigRefreshReply && reply,int loopDepth) { - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - for( const auto& kv : result ) { - #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + for( const auto& kv : reply.result ) { + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" KeyRef systemKey = kv.key.removePrefix(globalConfigKeysPrefix); - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" self->insert(systemKey, kv.value); - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GlobalConfig_RefreshActorState(); static_cast(this)->destroy(); return 0; } + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~GlobalConfig_RefreshActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1loopBody1when1(RangeResult const& result,int loopDepth) + int a_body1loopBody1when1(GlobalConfigRefreshReply const& reply,int loopDepth) { - loopDepth = a_body1loopBody1cont2(result, loopDepth); + loopDepth = a_body1loopBody1cont2(reply, loopDepth); return loopDepth; } - int a_body1loopBody1when1(RangeResult && result,int loopDepth) + int a_body1loopBody1when1(GlobalConfigRefreshReply && reply,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(result), loopDepth); + loopDepth = a_body1loopBody1cont2(std::move(reply), loopDepth); return loopDepth; } void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GlobalConfig_RefreshActor, 0, RangeResult >::remove(); + static_cast(this)->ActorCallback< GlobalConfig_RefreshActor, 0, GlobalConfigRefreshReply >::remove(); } - void a_callback_fire(ActorCallback< GlobalConfig_RefreshActor, 0, RangeResult >*,RangeResult const& value) + void a_callback_fire(ActorCallback< GlobalConfig_RefreshActor, 0, GlobalConfigRefreshReply >*,GlobalConfigRefreshReply const& value) { fdb_probe_actor_enter("refresh", reinterpret_cast(this), 0); a_exitChoose1(); @@ -1171,204 +337,105 @@ class GlobalConfig_RefreshActorState { catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("refresh", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< GlobalConfig_RefreshActor, 0, RangeResult >*,RangeResult && value) - { - fdb_probe_actor_enter("refresh", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("refresh", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< GlobalConfig_RefreshActor, 0, RangeResult >*,Error err) - { - fdb_probe_actor_enter("refresh", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("refresh", reinterpret_cast(this), 0); - - } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) - { - #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr.clear(); - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_2 = backoff.onError(); - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1cont1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) - { - #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - tr.clear(); - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_2 = backoff.onError(); - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1cont1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GlobalConfig_RefreshActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GlobalConfig_RefreshActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("refresh", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("refresh", reinterpret_cast(this), 1); + fdb_probe_actor_exit("refresh", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GlobalConfig_RefreshActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< GlobalConfig_RefreshActor, 0, GlobalConfigRefreshReply >*,GlobalConfigRefreshReply && value) { - fdb_probe_actor_enter("refresh", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("refresh", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1Catch1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("refresh", reinterpret_cast(this), 1); + fdb_probe_actor_exit("refresh", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GlobalConfig_RefreshActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< GlobalConfig_RefreshActor, 0, GlobalConfigRefreshReply >*,Error err) { - fdb_probe_actor_enter("refresh", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("refresh", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("refresh", reinterpret_cast(this), 1); + fdb_probe_actor_exit("refresh", reinterpret_cast(this), 0); } - int a_body1loopBody1Catch1cont2(Void const& _,int loopDepth) + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont2(Void && _,int loopDepth) + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont1when1(Void const& _,int loopDepth) + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont2(_, loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont1when1(Void && _,int loopDepth) + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont2(std::move(_), loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose3() + void a_exitChoose2() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GlobalConfig_RefreshActor, 2, Void >::remove(); + static_cast(this)->ActorCallback< GlobalConfig_RefreshActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< GlobalConfig_RefreshActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GlobalConfig_RefreshActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("refresh", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("refresh", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1Catch1cont1when1(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("refresh", reinterpret_cast(this), 2); + fdb_probe_actor_exit("refresh", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< GlobalConfig_RefreshActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< GlobalConfig_RefreshActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("refresh", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("refresh", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1Catch1cont1when1(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("refresh", reinterpret_cast(this), 2); + fdb_probe_actor_exit("refresh", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< GlobalConfig_RefreshActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< GlobalConfig_RefreshActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("refresh", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("refresh", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -1377,21 +444,21 @@ class GlobalConfig_RefreshActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("refresh", reinterpret_cast(this), 2); + fdb_probe_actor_exit("refresh", reinterpret_cast(this), 1); } - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" GlobalConfig* self; - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + Version lastKnown; + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" Backoff backoff; - #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - Reference tr; - #line 1389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" }; // This generated class is to be used only via refresh() - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" -class GlobalConfig_RefreshActor final : public Actor, public ActorCallback< GlobalConfig_RefreshActor, 0, RangeResult >, public ActorCallback< GlobalConfig_RefreshActor, 1, Void >, public ActorCallback< GlobalConfig_RefreshActor, 2, Void >, public FastAllocated, public GlobalConfig_RefreshActorState { - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" +class GlobalConfig_RefreshActor final : public Actor, public ActorCallback< GlobalConfig_RefreshActor, 0, GlobalConfigRefreshReply >, public ActorCallback< GlobalConfig_RefreshActor, 1, Void >, public FastAllocated, public GlobalConfig_RefreshActorState { + #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1399,14 +466,13 @@ class GlobalConfig_RefreshActor final : public Actor, public ActorCallback #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GlobalConfig_RefreshActor, 0, RangeResult >; +friend struct ActorCallback< GlobalConfig_RefreshActor, 0, GlobalConfigRefreshReply >; friend struct ActorCallback< GlobalConfig_RefreshActor, 1, Void >; -friend struct ActorCallback< GlobalConfig_RefreshActor, 2, Void >; - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - GlobalConfig_RefreshActor(GlobalConfig* const& self) - #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + GlobalConfig_RefreshActor(GlobalConfig* const& self,Version const& lastKnown) + #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" : Actor(), - GlobalConfig_RefreshActorState(self) + GlobalConfig_RefreshActorState(self, lastKnown) { fdb_probe_actor_enter("refresh", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -1422,40 +488,39 @@ friend struct ActorCallback< GlobalConfig_RefreshActor, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GlobalConfig_RefreshActor, 0, RangeResult >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GlobalConfig_RefreshActor, 0, GlobalConfigRefreshReply >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< GlobalConfig_RefreshActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< GlobalConfig_RefreshActor, 2, Void >*)0, actor_cancelled()); break; } } }; - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" -[[nodiscard]] Future GlobalConfig::refresh( GlobalConfig* const& self ) { - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - return Future(new GlobalConfig_RefreshActor(self)); - #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" +[[nodiscard]] Future GlobalConfig::refresh( GlobalConfig* const& self, Version const& lastKnown ) { + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + return Future(new GlobalConfig_RefreshActor(self, lastKnown)); + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } -#line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" +#line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" // Applies updates to the local copy of the global configuration when this // process receives an updated history. - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" // This generated class is to be used only via updater() - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" template - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" class GlobalConfig_UpdaterActorState { - #line 1449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" public: - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" GlobalConfig_UpdaterActorState(GlobalConfig* const& self,const ClientDBInfo* const& dbInfo) - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" : self(self), - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" dbInfo(dbInfo) - #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { fdb_probe_actor_create("updater", reinterpret_cast(this)); @@ -1468,9 +533,9 @@ class GlobalConfig_UpdaterActorState { int a_body1(int loopDepth=0) { try { - #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" ; - #line 1473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1499,20 +564,20 @@ class GlobalConfig_UpdaterActorState { int a_body1loopBody1(int loopDepth) { try { - #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (self->initialized.canBeSet()) - #line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" StrictFuture __when_expr_0 = self->cx->onConnected(); - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" loopDepth = 0; } else @@ -1537,18 +602,18 @@ class GlobalConfig_UpdaterActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" TraceEvent("GlobalConfigUpdaterError").error(e); - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_5 = delay(1.0); - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + StrictFuture __when_expr_4 = delay(1.0); + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1561,41 +626,41 @@ class GlobalConfig_UpdaterActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" ; - #line 1566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" loopDepth = a_body1loopBody1cont2loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_1 = self->migrate(self); - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + StrictFuture __when_expr_1 = self->refresh(self, -1); + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_1 = self->migrate(self); - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + StrictFuture __when_expr_1 = self->refresh(self, -1); + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1665,33 +730,19 @@ class GlobalConfig_UpdaterActorState { } int a_body1loopBody1cont4(Void const& _,int loopDepth) { - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_2 = self->refresh(self); - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = 0; + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + self->initialized.send(Void()); + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } int a_body1loopBody1cont4(Void && _,int loopDepth) { - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_2 = self->refresh(self); - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = 0; + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + self->initialized.send(Void()); + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } @@ -1757,87 +808,6 @@ class GlobalConfig_UpdaterActorState { } fdb_probe_actor_exit("updater", reinterpret_cast(this), 1); - } - int a_body1loopBody1cont5(Void const& _,int loopDepth) - { - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - self->initialized.send(Void()); - #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = a_body1loopBody1cont2(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont5(Void && _,int loopDepth) - { - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - self->initialized.send(Void()); - #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - loopDepth = a_body1loopBody1cont2(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont4when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont5(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont4when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont5(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GlobalConfig_UpdaterActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GlobalConfig_UpdaterActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("updater", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont4when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("updater", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< GlobalConfig_UpdaterActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("updater", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont4when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("updater", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< GlobalConfig_UpdaterActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("updater", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("updater", reinterpret_cast(this), 2); - } int a_body1loopBody1cont2loopHead1(int loopDepth) { @@ -1849,16 +819,16 @@ class GlobalConfig_UpdaterActorState { int a_body1loopBody1cont2loopBody1(int loopDepth) { try { - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_3 = self->dbInfoChanged.onTrigger(); - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + StrictFuture __when_expr_2 = self->dbInfoChanged.onTrigger(); + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1cont2loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont2loopBody1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont2loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2loopBody1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1878,9 +848,9 @@ class GlobalConfig_UpdaterActorState { int a_body1loopBody1cont2loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" return a_body1loopBody1Catch1(e, std::max(0, loopDepth - 1)); - #line 1883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1loopBody1Catch1(error, std::max(0, loopDepth - 1)); @@ -1892,73 +862,73 @@ class GlobalConfig_UpdaterActorState { } int a_body1loopBody1cont2loopBody1cont2(Void const& _,int loopDepth) { - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" auto& history = dbInfo->history; - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (history.size() == 0) - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { return a_body1loopBody1cont2loopHead1(loopDepth); // continue } - #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (self->lastUpdate < history[0].version) - #line 1905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { - #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_4 = self->refresh(self); - #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + StrictFuture __when_expr_3 = self->refresh(self, history.back().version); + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1cont2loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont2loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1cont2loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont2loopBody1cont2when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" loopDepth = 0; } else { - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" for( const auto& vh : history ) { - #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (vh.version <= self->lastUpdate) - #line 1925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { continue; } - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" for( const auto& mutation : vh.mutations.contents() ) { - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (mutation.type == MutationRef::SetValue) - #line 1933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { - #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" self->insert(mutation.param1, mutation.param2); - #line 1937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } else { - #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (mutation.type == MutationRef::ClearRange) - #line 1943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" self->erase(KeyRangeRef(mutation.param1, mutation.param2)); - #line 1947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } else { - #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" ASSERT(false); - #line 1953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } } } - #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" ASSERT(vh.version > self->lastUpdate); - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" self->lastUpdate = vh.version; - #line 1961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } loopDepth = a_body1loopBody1cont2loopBody1cont3(loopDepth); } @@ -1967,73 +937,73 @@ class GlobalConfig_UpdaterActorState { } int a_body1loopBody1cont2loopBody1cont2(Void && _,int loopDepth) { - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" auto& history = dbInfo->history; - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (history.size() == 0) - #line 1974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { return a_body1loopBody1cont2loopHead1(loopDepth); // continue } - #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (self->lastUpdate < history[0].version) - #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { - #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - StrictFuture __when_expr_4 = self->refresh(self); - #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + StrictFuture __when_expr_3 = self->refresh(self, history.back().version); + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1cont2loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont2loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1cont2loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont2loopBody1cont2when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" loopDepth = 0; } else { - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" for( const auto& vh : history ) { - #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (vh.version <= self->lastUpdate) - #line 2000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { continue; } - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" for( const auto& mutation : vh.mutations.contents() ) { - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (mutation.type == MutationRef::SetValue) - #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { - #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" self->insert(mutation.param1, mutation.param2); - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } else { - #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (mutation.type == MutationRef::ClearRange) - #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" self->erase(KeyRangeRef(mutation.param1, mutation.param2)); - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } else { - #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" ASSERT(false); - #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } } } - #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" ASSERT(vh.version > self->lastUpdate); - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" self->lastUpdate = vh.version; - #line 2036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } loopDepth = a_body1loopBody1cont2loopBody1cont3(loopDepth); } @@ -2052,16 +1022,16 @@ class GlobalConfig_UpdaterActorState { return loopDepth; } - void a_exitChoose4() + void a_exitChoose3() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GlobalConfig_UpdaterActor, 3, Void >::remove(); + static_cast(this)->ActorCallback< GlobalConfig_UpdaterActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< GlobalConfig_UpdaterActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GlobalConfig_UpdaterActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("updater", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("updater", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1loopBody1cont2loopBody1when1(value, 0); } @@ -2070,13 +1040,13 @@ class GlobalConfig_UpdaterActorState { } catch (...) { a_body1loopBody1cont2loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updater", reinterpret_cast(this), 3); + fdb_probe_actor_exit("updater", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< GlobalConfig_UpdaterActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< GlobalConfig_UpdaterActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("updater", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("updater", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1loopBody1cont2loopBody1when1(std::move(value), 0); } @@ -2085,13 +1055,13 @@ class GlobalConfig_UpdaterActorState { } catch (...) { a_body1loopBody1cont2loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updater", reinterpret_cast(this), 3); + fdb_probe_actor_exit("updater", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< GlobalConfig_UpdaterActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< GlobalConfig_UpdaterActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("updater", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("updater", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1loopBody1cont2loopBody1Catch1(err, 0); } @@ -2100,27 +1070,27 @@ class GlobalConfig_UpdaterActorState { } catch (...) { a_body1loopBody1cont2loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updater", reinterpret_cast(this), 3); + fdb_probe_actor_exit("updater", reinterpret_cast(this), 2); } int a_body1loopBody1cont2loopBody1cont3(int loopDepth) { - #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" self->configChanged.trigger(); - #line 2110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" loopDepth = a_body1loopBody1cont2loopBody1cont17(loopDepth); return loopDepth; } int a_body1loopBody1cont2loopBody1cont5(Void const& _,int loopDepth) { - #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (dbInfo->history.size() > 0) - #line 2119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" self->lastUpdate = dbInfo->history.back().version; - #line 2123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } loopDepth = a_body1loopBody1cont2loopBody1cont3(loopDepth); @@ -2128,13 +1098,13 @@ class GlobalConfig_UpdaterActorState { } int a_body1loopBody1cont2loopBody1cont5(Void && _,int loopDepth) { - #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" if (dbInfo->history.size() > 0) - #line 2133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" { - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" self->lastUpdate = dbInfo->history.back().version; - #line 2137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } loopDepth = a_body1loopBody1cont2loopBody1cont3(loopDepth); @@ -2152,16 +1122,16 @@ class GlobalConfig_UpdaterActorState { return loopDepth; } - void a_exitChoose5() + void a_exitChoose4() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GlobalConfig_UpdaterActor, 4, Void >::remove(); + static_cast(this)->ActorCallback< GlobalConfig_UpdaterActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< GlobalConfig_UpdaterActor, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GlobalConfig_UpdaterActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("updater", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("updater", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1loopBody1cont2loopBody1cont2when1(value, 0); } @@ -2170,13 +1140,13 @@ class GlobalConfig_UpdaterActorState { } catch (...) { a_body1loopBody1cont2loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updater", reinterpret_cast(this), 4); + fdb_probe_actor_exit("updater", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< GlobalConfig_UpdaterActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< GlobalConfig_UpdaterActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("updater", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("updater", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1loopBody1cont2loopBody1cont2when1(std::move(value), 0); } @@ -2185,13 +1155,13 @@ class GlobalConfig_UpdaterActorState { } catch (...) { a_body1loopBody1cont2loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updater", reinterpret_cast(this), 4); + fdb_probe_actor_exit("updater", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< GlobalConfig_UpdaterActor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< GlobalConfig_UpdaterActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("updater", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("updater", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1loopBody1cont2loopBody1Catch1(err, 0); } @@ -2200,7 +1170,7 @@ class GlobalConfig_UpdaterActorState { } catch (...) { a_body1loopBody1cont2loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updater", reinterpret_cast(this), 4); + fdb_probe_actor_exit("updater", reinterpret_cast(this), 3); } int a_body1loopBody1cont2loopBody1cont17(int loopDepth) @@ -2240,16 +1210,16 @@ class GlobalConfig_UpdaterActorState { return loopDepth; } - void a_exitChoose6() + void a_exitChoose5() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GlobalConfig_UpdaterActor, 5, Void >::remove(); + static_cast(this)->ActorCallback< GlobalConfig_UpdaterActor, 4, Void >::remove(); } - void a_callback_fire(ActorCallback< GlobalConfig_UpdaterActor, 5, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GlobalConfig_UpdaterActor, 4, Void >*,Void const& value) { - fdb_probe_actor_enter("updater", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("updater", reinterpret_cast(this), 4); + a_exitChoose5(); try { a_body1loopBody1Catch1when1(value, 0); } @@ -2258,13 +1228,13 @@ class GlobalConfig_UpdaterActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updater", reinterpret_cast(this), 5); + fdb_probe_actor_exit("updater", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< GlobalConfig_UpdaterActor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< GlobalConfig_UpdaterActor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("updater", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("updater", reinterpret_cast(this), 4); + a_exitChoose5(); try { a_body1loopBody1Catch1when1(std::move(value), 0); } @@ -2273,13 +1243,13 @@ class GlobalConfig_UpdaterActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updater", reinterpret_cast(this), 5); + fdb_probe_actor_exit("updater", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< GlobalConfig_UpdaterActor, 5, Void >*,Error err) + void a_callback_error(ActorCallback< GlobalConfig_UpdaterActor, 4, Void >*,Error err) { - fdb_probe_actor_enter("updater", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("updater", reinterpret_cast(this), 4); + a_exitChoose5(); try { a_body1Catch1(err, 0); } @@ -2288,19 +1258,19 @@ class GlobalConfig_UpdaterActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updater", reinterpret_cast(this), 5); + fdb_probe_actor_exit("updater", reinterpret_cast(this), 4); } - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" GlobalConfig* self; - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" const ClientDBInfo* dbInfo; - #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" }; // This generated class is to be used only via updater() - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" -class GlobalConfig_UpdaterActor final : public Actor, public ActorCallback< GlobalConfig_UpdaterActor, 0, Void >, public ActorCallback< GlobalConfig_UpdaterActor, 1, Void >, public ActorCallback< GlobalConfig_UpdaterActor, 2, Void >, public ActorCallback< GlobalConfig_UpdaterActor, 3, Void >, public ActorCallback< GlobalConfig_UpdaterActor, 4, Void >, public ActorCallback< GlobalConfig_UpdaterActor, 5, Void >, public FastAllocated, public GlobalConfig_UpdaterActorState { - #line 2303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" +class GlobalConfig_UpdaterActor final : public Actor, public ActorCallback< GlobalConfig_UpdaterActor, 0, Void >, public ActorCallback< GlobalConfig_UpdaterActor, 1, Void >, public ActorCallback< GlobalConfig_UpdaterActor, 2, Void >, public ActorCallback< GlobalConfig_UpdaterActor, 3, Void >, public ActorCallback< GlobalConfig_UpdaterActor, 4, Void >, public FastAllocated, public GlobalConfig_UpdaterActorState { + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2313,10 +1283,9 @@ friend struct ActorCallback< GlobalConfig_UpdaterActor, 1, Void >; friend struct ActorCallback< GlobalConfig_UpdaterActor, 2, Void >; friend struct ActorCallback< GlobalConfig_UpdaterActor, 3, Void >; friend struct ActorCallback< GlobalConfig_UpdaterActor, 4, Void >; -friend struct ActorCallback< GlobalConfig_UpdaterActor, 5, Void >; - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" GlobalConfig_UpdaterActor(GlobalConfig* const& self,const ClientDBInfo* const& dbInfo) - #line 2319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" : Actor(), GlobalConfig_UpdaterActorState(self, dbInfo) { @@ -2339,16 +1308,15 @@ friend struct ActorCallback< GlobalConfig_UpdaterActor, 5, Void >; case 3: this->a_callback_error((ActorCallback< GlobalConfig_UpdaterActor, 2, Void >*)0, actor_cancelled()); break; case 4: this->a_callback_error((ActorCallback< GlobalConfig_UpdaterActor, 3, Void >*)0, actor_cancelled()); break; case 5: this->a_callback_error((ActorCallback< GlobalConfig_UpdaterActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< GlobalConfig_UpdaterActor, 5, Void >*)0, actor_cancelled()); break; } } }; - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" [[nodiscard]] Future GlobalConfig::updater( GlobalConfig* const& self, const ClientDBInfo* const& dbInfo ) { - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" return Future(new GlobalConfig_UpdaterActor(self, dbInfo)); - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" + #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.cpp" } -#line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" +#line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.cpp" diff --git a/src/fdbclient/ISingleThreadTransaction.cpp b/src/fdbclient/ISingleThreadTransaction.cpp index df5fdef..75275c6 100644 --- a/src/fdbclient/ISingleThreadTransaction.cpp +++ b/src/fdbclient/ISingleThreadTransaction.cpp @@ -59,7 +59,7 @@ Reference ISingleThreadTransaction::create(Type type, Reference ISingleThreadTransaction::create(Type type, Database const& cx, - TenantName const& tenant) { + Reference const& tenant) { Reference result; if (type == Type::RYW) { result = makeReference(); diff --git a/src/fdbclient/IdempotencyId.actor.cpp b/src/fdbclient/IdempotencyId.actor.cpp new file mode 100644 index 0000000..1f74b59 --- /dev/null +++ b/src/fdbclient/IdempotencyId.actor.cpp @@ -0,0 +1,374 @@ +/* + * IdempotencyId.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/IdempotencyId.actor.h" +#include "fdbclient/ReadYourWrites.h" +#include "fdbclient/SystemData.h" +#include "flow/BooleanParam.h" +#include "flow/UnitTest.h" +#include "flow/actorcompiler.h" // this has to be the last include + +struct IdempotencyIdKVBuilderImpl { + Optional commitVersion; + Optional batchIndexHighOrderByte; + BinaryWriter value{ IncludeVersion() }; +}; + +IdempotencyIdKVBuilder::IdempotencyIdKVBuilder() : impl(PImpl::create()) {} + +void IdempotencyIdKVBuilder::setCommitVersion(Version commitVersion) { + impl->commitVersion = commitVersion; +} + +void IdempotencyIdKVBuilder::add(const IdempotencyIdRef& id, uint16_t batchIndex) { + ASSERT(id.valid()); + if (impl->batchIndexHighOrderByte.present()) { + ASSERT((batchIndex >> 8) == impl->batchIndexHighOrderByte.get()); + } else { + impl->batchIndexHighOrderByte = batchIndex >> 8; + impl->value << int64_t(now()); + } + StringRef s = id.asStringRefUnsafe(); + impl->value << uint8_t(s.size()); + impl->value.serializeBytes(s); + impl->value << uint8_t(batchIndex); // Low order byte of batchIndex +} + +Optional IdempotencyIdKVBuilder::buildAndClear() { + ASSERT(impl->commitVersion.present()); + if (!impl->batchIndexHighOrderByte.present()) { + return {}; + } + + Value v = impl->value.toValue(); + + KeyRef key = + makeIdempotencySingleKeyRange(v.arena(), impl->commitVersion.get(), impl->batchIndexHighOrderByte.get()).begin; + + impl->value = BinaryWriter(IncludeVersion()); + impl->batchIndexHighOrderByte = Optional(); + + Optional result = KeyValue(); + result.get().arena() = v.arena(); + result.get().key = key; + result.get().value = v; + return result; +} + +IdempotencyIdKVBuilder::~IdempotencyIdKVBuilder() = default; + +Optional kvContainsIdempotencyId(const KeyValueRef& kv, const IdempotencyIdRef& id) { + ASSERT(id.valid()); + StringRef needle = id.asStringRefUnsafe(); + StringRef haystack = kv.value; + +#ifndef _WIN32 + // The common case is that the kv does not contain the idempotency id, so early return if memmem is available + if (memmem(haystack.begin(), haystack.size(), needle.begin(), needle.size()) == nullptr) { + return {}; + } +#endif + + // Even if id is a substring of value, it may still not actually contain it. + BinaryReader reader(kv.value.begin(), kv.value.size(), IncludeVersion()); + int64_t timestamp; // ignored + reader >> timestamp; + while (!reader.empty()) { + uint8_t length; + reader >> length; + StringRef candidate{ reinterpret_cast(reader.readBytes(length)), length }; + uint8_t lowOrderBatchIndex; + reader >> lowOrderBatchIndex; + if (candidate == needle) { + Version commitVersion; + uint8_t highOrderBatchIndex; + decodeIdempotencyKey(kv.key, commitVersion, highOrderBatchIndex); + return CommitResult{ commitVersion, + static_cast((uint16_t(highOrderBatchIndex) << 8) | + uint16_t(lowOrderBatchIndex)) }; + } + } + return {}; +} + +void forceLinkIdempotencyIdTests() {} + +namespace { +IdempotencyIdRef generate(Arena& arena) { + int length = deterministicRandom()->coinflip() ? deterministicRandom()->randomInt(16, 256) : 16; + StringRef id = makeString(length, arena); + deterministicRandom()->randomBytes(mutateString(id), length); + return IdempotencyIdRef(id); +} +} // namespace + +TEST_CASE("/fdbclient/IdempotencyId/basic") { + Arena arena; + uint16_t firstBatchIndex = deterministicRandom()->randomUInt32(); + firstBatchIndex &= 0xff7f; // ensure firstBatchIndex+5 won't change the higher order byte + uint16_t batchIndex = firstBatchIndex; + Version commitVersion = deterministicRandom()->randomInt64(0, std::numeric_limits::max()); + std::vector idVector; // Reference + std::unordered_set idSet; // Make sure hash+equals works + IdempotencyIdKVBuilder builder; // Check kv data format + builder.setCommitVersion(commitVersion); + + for (int i = 0; i < 5; ++i) { + auto id = generate(arena); + idVector.emplace_back(id); + idSet.emplace(id); + builder.add(id, batchIndex++); + } + + batchIndex = firstBatchIndex; + Optional kvOpt = builder.buildAndClear(); + ASSERT(kvOpt.present()); + const auto& kv = kvOpt.get(); + + ASSERT(idSet.size() == idVector.size()); + for (const auto& id : idVector) { + auto commitResult = kvContainsIdempotencyId(kv, id); + ASSERT(commitResult.present()); + ASSERT(commitResult.get().commitVersion == commitVersion); + ASSERT(commitResult.get().batchIndex == batchIndex++); + ASSERT(idSet.find(id) != idSet.end()); + idSet.erase(id); + ASSERT(idSet.find(id) == idSet.end()); + } + ASSERT(idSet.size() == 0); + + ASSERT(!kvContainsIdempotencyId(kv, generate(arena)).present()); + + return Void(); +} + +TEST_CASE("/fdbclient/IdempotencyId/serialization") { + ASSERT(ObjectReader::fromStringRef(ObjectWriter::toValue(IdempotencyIdRef(), Unversioned()), + Unversioned()) == IdempotencyIdRef()); + for (int i = 0; i < 1000; ++i) { + Arena arena; + auto id = generate(arena); + auto serialized = ObjectWriter::toValue(id, Unversioned()); + IdempotencyIdRef t; + ObjectReader reader(serialized.begin(), Unversioned()); + reader.deserialize(t); + ASSERT(t == id); + } + return Void(); +} + +KeyRangeRef makeIdempotencySingleKeyRange(Arena& arena, Version version, uint8_t highOrderBatchIndex) { + static const auto size = + idempotencyIdKeys.begin.size() + sizeof(version) + sizeof(highOrderBatchIndex) + /*\x00*/ 1; + + StringRef second = makeString(size, arena); + auto* dst = mutateString(second); + + memcpy(dst, idempotencyIdKeys.begin.begin(), idempotencyIdKeys.begin.size()); + dst += idempotencyIdKeys.begin.size(); + + version = bigEndian64(version); + memcpy(dst, &version, sizeof(version)); + dst += sizeof(version); + + *dst++ = highOrderBatchIndex; + + *dst++ = 0; + + ASSERT_EQ(dst - second.begin(), size); + + return KeyRangeRef(second.removeSuffix("\x00"_sr), second); +} + +void decodeIdempotencyKey(KeyRef key, Version& commitVersion, uint8_t& highOrderBatchIndex) { + BinaryReader reader(key, Unversioned()); + reader.readBytes(idempotencyIdKeys.begin.size()); + reader >> commitVersion; + commitVersion = bigEndian64(commitVersion); + reader >> highOrderBatchIndex; +} + +FDB_BOOLEAN_PARAM(Oldest); + +// Find the youngest or oldest idempotency id key in `range` (depending on `oldest`) +// Write the timestamp to `*time` and the version to `*version` when non-null. +ACTOR static Future> getBoundary(Reference tr, + KeyRange range, + Oldest oldest, + Version* version, + int64_t* time) { + RangeResult result = + wait(tr->getRange(range, /*limit*/ 1, Snapshot::False, oldest ? Reverse::False : Reverse::True)); + if (!result.size()) { + return Optional(); + } + if (version != nullptr) { + BinaryReader rd(result.front().key, Unversioned()); + rd.readBytes(idempotencyIdKeys.begin.size()); + rd >> *version; + *version = bigEndian64(*version); + } + if (time != nullptr) { + BinaryReader rd(result.front().value, IncludeVersion()); + rd >> *time; + } + return result.front().key; +} + +ACTOR Future getIdmpKeyStatus(Database db) { + state Reference tr = makeReference(db); + state int64_t size; + state IdempotencyIdsExpiredVersion expired; + state KeyBackedObjectProperty expiredKey(idempotencyIdsExpiredVersion, + Unversioned()); + state int64_t oldestIdVersion = 0; + state int64_t oldestIdTime = 0; + loop { + try { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + + wait(store(size, tr->getEstimatedRangeSizeBytes(idempotencyIdKeys)) && + store(expired, expiredKey.getD(tr)) && + success(getBoundary(tr, idempotencyIdKeys, Oldest::True, &oldestIdVersion, &oldestIdTime))); + JsonBuilderObject result; + result["size_bytes"] = size; + if (expired.expired != 0) { + result["expired_version"] = expired.expired; + } + if (expired.expiredTime != 0) { + result["expired_age"] = int64_t(now()) - expired.expiredTime; + } + if (oldestIdVersion != 0) { + result["oldest_id_version"] = oldestIdVersion; + } + if (oldestIdTime != 0) { + result["oldest_id_age"] = int64_t(now()) - oldestIdTime; + } + return result; + } catch (Error& e) { + wait(tr->onError(e)); + } + } +} + +ACTOR Future cleanIdempotencyIds(Database db, double minAgeSeconds) { + state int64_t idmpKeySize; + state int64_t candidateDeleteSize; + state KeyRange finalRange; + state Reference tr; + + // Only assigned to once + state Key oldestKey; + state Version oldestVersion; + state int64_t oldestTime; + + // Assigned to multiple times looking for a suitable range + state Version candidateDeleteVersion; + state int64_t candidateDeleteTime; + state KeyRange candidateRangeToClean; + + tr = makeReference(db); + loop { + try { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + + // Check if any keys are older than minAgeSeconds + Optional oldestKey_ = + wait(getBoundary(tr, idempotencyIdKeys, Oldest::True, &oldestVersion, &oldestTime)); + if (!oldestKey_.present()) { + break; + } + oldestKey = oldestKey_.get(); + if (int64_t(now()) - oldestTime < minAgeSeconds) { + break; + } + + // Only used for a trace event + wait(store(idmpKeySize, tr->getEstimatedRangeSizeBytes(idempotencyIdKeys))); + + // Get the version of the most recent idempotency ID + wait(success( + getBoundary(tr, idempotencyIdKeys, Oldest::False, &candidateDeleteVersion, &candidateDeleteTime))); + + // Keep dividing the candidate range until clearing it would not delete something younger than + // minAgeSeconds + loop { + + candidateRangeToClean = + KeyRangeRef(oldestKey, + BinaryWriter::toValue(bigEndian64(candidateDeleteVersion + 1), Unversioned()) + .withPrefix(idempotencyIdKeys.begin)); + + // We know that we're okay deleting oldestVersion at this point. Go ahead and do that. + if (oldestVersion == candidateDeleteVersion) { + break; + } + + // Find the youngest key in candidate range + wait(success(getBoundary( + tr, candidateRangeToClean, Oldest::False, &candidateDeleteVersion, &candidateDeleteTime))); + + // Update the range so that it ends at an idempotency id key. Since we're binary searching, the + // candidate range was probably too large before. + candidateRangeToClean = + KeyRangeRef(oldestKey, + BinaryWriter::toValue(bigEndian64(candidateDeleteVersion + 1), Unversioned()) + .withPrefix(idempotencyIdKeys.begin)); + + wait(store(candidateDeleteSize, tr->getEstimatedRangeSizeBytes(candidateRangeToClean))); + + int64_t youngestAge = int64_t(now()) - candidateDeleteTime; + TraceEvent("IdempotencyIdsCleanerCandidateDelete") + .detail("Range", candidateRangeToClean.toString()) + .detail("IdmpKeySizeEstimate", idmpKeySize) + .detail("YoungestIdAge", youngestAge) + .detail("MinAgeSeconds", minAgeSeconds) + .detail("ClearRangeSizeEstimate", candidateDeleteSize); + if (youngestAge > minAgeSeconds) { + break; + } + candidateDeleteVersion = (oldestVersion + candidateDeleteVersion) / 2; + } + finalRange = KeyRangeRef(idempotencyIdKeys.begin, candidateRangeToClean.end); + if (!finalRange.empty()) { + tr->addReadConflictRange(finalRange); + tr->clear(finalRange); + tr->set( + idempotencyIdsExpiredVersion, + ObjectWriter::toValue(IdempotencyIdsExpiredVersion{ candidateDeleteVersion, candidateDeleteTime }, + Unversioned())); + TraceEvent("IdempotencyIdsCleanerAttempt") + .detail("Range", finalRange.toString()) + .detail("IdmpKeySizeEstimate", idmpKeySize) + .detail("ClearRangeSizeEstimate", candidateDeleteSize) + .detail("ExpiredVersion", candidateDeleteVersion) + .detail("ExpiredVersionAgeEstimate", static_cast(now()) - candidateDeleteTime); + wait(tr->commit()); + } + break; + } catch (Error& e) { + TraceEvent("IdempotencyIdsCleanerError").error(e); + wait(tr->onError(e)); + } + } + return Void(); +} diff --git a/src/fdbclient/IdempotencyId.actor.g.cpp b/src/fdbclient/IdempotencyId.actor.g.cpp new file mode 100644 index 0000000..23331bd --- /dev/null +++ b/src/fdbclient/IdempotencyId.actor.g.cpp @@ -0,0 +1,2125 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +/* + * IdempotencyId.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/IdempotencyId.actor.h" +#include "fdbclient/ReadYourWrites.h" +#include "fdbclient/SystemData.h" +#include "flow/BooleanParam.h" +#include "flow/UnitTest.h" +#include "flow/actorcompiler.h" // this has to be the last include + +struct IdempotencyIdKVBuilderImpl { + Optional commitVersion; + Optional batchIndexHighOrderByte; + BinaryWriter value{ IncludeVersion() }; +}; + +IdempotencyIdKVBuilder::IdempotencyIdKVBuilder() : impl(PImpl::create()) {} + +void IdempotencyIdKVBuilder::setCommitVersion(Version commitVersion) { + impl->commitVersion = commitVersion; +} + +void IdempotencyIdKVBuilder::add(const IdempotencyIdRef& id, uint16_t batchIndex) { + ASSERT(id.valid()); + if (impl->batchIndexHighOrderByte.present()) { + ASSERT((batchIndex >> 8) == impl->batchIndexHighOrderByte.get()); + } else { + impl->batchIndexHighOrderByte = batchIndex >> 8; + impl->value << int64_t(now()); + } + StringRef s = id.asStringRefUnsafe(); + impl->value << uint8_t(s.size()); + impl->value.serializeBytes(s); + impl->value << uint8_t(batchIndex); // Low order byte of batchIndex +} + +Optional IdempotencyIdKVBuilder::buildAndClear() { + ASSERT(impl->commitVersion.present()); + if (!impl->batchIndexHighOrderByte.present()) { + return {}; + } + + Value v = impl->value.toValue(); + + KeyRef key = + makeIdempotencySingleKeyRange(v.arena(), impl->commitVersion.get(), impl->batchIndexHighOrderByte.get()).begin; + + impl->value = BinaryWriter(IncludeVersion()); + impl->batchIndexHighOrderByte = Optional(); + + Optional result = KeyValue(); + result.get().arena() = v.arena(); + result.get().key = key; + result.get().value = v; + return result; +} + +IdempotencyIdKVBuilder::~IdempotencyIdKVBuilder() = default; + +Optional kvContainsIdempotencyId(const KeyValueRef& kv, const IdempotencyIdRef& id) { + ASSERT(id.valid()); + StringRef needle = id.asStringRefUnsafe(); + StringRef haystack = kv.value; + +#ifndef _WIN32 + // The common case is that the kv does not contain the idempotency id, so early return if memmem is available + if (memmem(haystack.begin(), haystack.size(), needle.begin(), needle.size()) == nullptr) { + return {}; + } +#endif + + // Even if id is a substring of value, it may still not actually contain it. + BinaryReader reader(kv.value.begin(), kv.value.size(), IncludeVersion()); + int64_t timestamp; // ignored + reader >> timestamp; + while (!reader.empty()) { + uint8_t length; + reader >> length; + StringRef candidate{ reinterpret_cast(reader.readBytes(length)), length }; + uint8_t lowOrderBatchIndex; + reader >> lowOrderBatchIndex; + if (candidate == needle) { + Version commitVersion; + uint8_t highOrderBatchIndex; + decodeIdempotencyKey(kv.key, commitVersion, highOrderBatchIndex); + return CommitResult{ commitVersion, + static_cast((uint16_t(highOrderBatchIndex) << 8) | + uint16_t(lowOrderBatchIndex)) }; + } + } + return {}; +} + +void forceLinkIdempotencyIdTests() {} + +namespace { +IdempotencyIdRef generate(Arena& arena) { + int length = deterministicRandom()->coinflip() ? deterministicRandom()->randomInt(16, 256) : 16; + StringRef id = makeString(length, arena); + deterministicRandom()->randomBytes(mutateString(id), length); + return IdempotencyIdRef(id); +} +} // namespace + + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase122() + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +template + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +class FlowTestCase122ActorState { + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +public: + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + FlowTestCase122ActorState(UnitTestParameters const& params) + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + : params(params) + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase122", reinterpret_cast(this)); + + } + ~FlowTestCase122ActorState() + { + fdb_probe_actor_destroy("flowTestCase122", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + Arena arena; + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + uint16_t firstBatchIndex = deterministicRandom()->randomUInt32(); + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + firstBatchIndex &= 0xff7f; + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + uint16_t batchIndex = firstBatchIndex; + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + Version commitVersion = deterministicRandom()->randomInt64(0, std::numeric_limits::max()); + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + std::vector idVector; + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + std::unordered_set idSet; + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + IdempotencyIdKVBuilder builder; + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + builder.setCommitVersion(commitVersion); + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + for(int i = 0;i < 5;++i) { + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + auto id = generate(arena); + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + idVector.emplace_back(id); + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + idSet.emplace(id); + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + builder.add(id, batchIndex++); + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + batchIndex = firstBatchIndex; + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + Optional kvOpt = builder.buildAndClear(); + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ASSERT(kvOpt.present()); + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + const auto& kv = kvOpt.get(); + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ASSERT(idSet.size() == idVector.size()); + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + for( const auto& id : idVector ) { + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + auto commitResult = kvContainsIdempotencyId(kv, id); + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ASSERT(commitResult.present()); + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ASSERT(commitResult.get().commitVersion == commitVersion); + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ASSERT(commitResult.get().batchIndex == batchIndex++); + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ASSERT(idSet.find(id) != idSet.end()); + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + idSet.erase(id); + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ASSERT(idSet.find(id) == idSet.end()); + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ASSERT(idSet.size() == 0); + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ASSERT(!kvContainsIdempotencyId(kv, generate(arena)).present()); + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase122ActorState(); static_cast(this)->destroy(); return 0; } + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase122ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase122ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + UnitTestParameters params; + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase122() + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +class FlowTestCase122Actor final : public Actor, public FastAllocated, public FlowTestCase122ActorState { + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + FlowTestCase122Actor(UnitTestParameters const& params) + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + : Actor(), + FlowTestCase122ActorState(params) + { + fdb_probe_actor_enter("flowTestCase122", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase122"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase122", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +static Future flowTestCase122( UnitTestParameters const& params ) { + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + return Future(new FlowTestCase122Actor(params)); + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase122, "/fdbclient/IdempotencyId/basic") + +#line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase162() + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +template + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +class FlowTestCase162ActorState { + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +public: + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + FlowTestCase162ActorState(UnitTestParameters const& params) + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + : params(params) + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase162", reinterpret_cast(this)); + + } + ~FlowTestCase162ActorState() + { + fdb_probe_actor_destroy("flowTestCase162", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ASSERT(ObjectReader::fromStringRef(ObjectWriter::toValue(IdempotencyIdRef(), Unversioned()), Unversioned()) == IdempotencyIdRef()); + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + for(int i = 0;i < 1000;++i) { + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + Arena arena; + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + auto id = generate(arena); + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + auto serialized = ObjectWriter::toValue(id, Unversioned()); + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + IdempotencyIdRef t; + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ObjectReader reader(serialized.begin(), Unversioned()); + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + reader.deserialize(t); + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ASSERT(t == id); + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase162ActorState(); static_cast(this)->destroy(); return 0; } + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase162ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase162ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + UnitTestParameters params; + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase162() + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +class FlowTestCase162Actor final : public Actor, public FastAllocated, public FlowTestCase162ActorState { + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + FlowTestCase162Actor(UnitTestParameters const& params) + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + : Actor(), + FlowTestCase162ActorState(params) + { + fdb_probe_actor_enter("flowTestCase162", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase162"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase162", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +static Future flowTestCase162( UnitTestParameters const& params ) { + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + return Future(new FlowTestCase162Actor(params)); + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase162, "/fdbclient/IdempotencyId/serialization") + +#line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + +KeyRangeRef makeIdempotencySingleKeyRange(Arena& arena, Version version, uint8_t highOrderBatchIndex) { + static const auto size = + idempotencyIdKeys.begin.size() + sizeof(version) + sizeof(highOrderBatchIndex) + /*\x00*/ 1; + + StringRef second = makeString(size, arena); + auto* dst = mutateString(second); + + memcpy(dst, idempotencyIdKeys.begin.begin(), idempotencyIdKeys.begin.size()); + dst += idempotencyIdKeys.begin.size(); + + version = bigEndian64(version); + memcpy(dst, &version, sizeof(version)); + dst += sizeof(version); + + *dst++ = highOrderBatchIndex; + + *dst++ = 0; + + ASSERT_EQ(dst - second.begin(), size); + + return KeyRangeRef(second.removeSuffix("\x00"_sr), second); +} + +void decodeIdempotencyKey(KeyRef key, Version& commitVersion, uint8_t& highOrderBatchIndex) { + BinaryReader reader(key, Unversioned()); + reader.readBytes(idempotencyIdKeys.begin.size()); + reader >> commitVersion; + commitVersion = bigEndian64(commitVersion); + reader >> highOrderBatchIndex; +} + +FDB_BOOLEAN_PARAM(Oldest); + +// Find the youngest or oldest idempotency id key in `range` (depending on `oldest`) +// Write the timestamp to `*time` and the version to `*version` when non-null. + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +namespace { +// This generated class is to be used only via getBoundary() + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +template + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +class GetBoundaryActorState { + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +public: + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + GetBoundaryActorState(Reference const& tr,KeyRange const& range,Oldest const& oldest,Version* const& version,int64_t* const& time) + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + : tr(tr), + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + range(range), + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + oldest(oldest), + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + version(version), + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + time(time) + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + fdb_probe_actor_create("getBoundary", reinterpret_cast(this)); + + } + ~GetBoundaryActorState() + { + fdb_probe_actor_destroy("getBoundary", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + StrictFuture __when_expr_0 = tr->getRange(range, 1, Snapshot::False, oldest ? Reverse::False : Reverse::True); + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetBoundaryActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(RangeResult const& result,int loopDepth) + { + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (!result.size()) + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GetBoundaryActorState(); static_cast(this)->destroy(); return 0; } + #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~GetBoundaryActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (version != nullptr) + #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + BinaryReader rd(result.front().key, Unversioned()); + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + rd.readBytes(idempotencyIdKeys.begin.size()); + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + rd >> *version; + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + *version = bigEndian64(*version); + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (time != nullptr) + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + BinaryReader rd(result.front().value, IncludeVersion()); + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + rd >> *time; + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(result.front().key); this->~GetBoundaryActorState(); static_cast(this)->destroy(); return 0; } + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(result.front().key); + this->~GetBoundaryActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(RangeResult && result,int loopDepth) + { + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (!result.size()) + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GetBoundaryActorState(); static_cast(this)->destroy(); return 0; } + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~GetBoundaryActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (version != nullptr) + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + BinaryReader rd(result.front().key, Unversioned()); + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + rd.readBytes(idempotencyIdKeys.begin.size()); + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + rd >> *version; + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + *version = bigEndian64(*version); + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (time != nullptr) + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + BinaryReader rd(result.front().value, IncludeVersion()); + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + rd >> *time; + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(result.front().key); this->~GetBoundaryActorState(); static_cast(this)->destroy(); return 0; } + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(result.front().key); + this->~GetBoundaryActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(RangeResult const& result,int loopDepth) + { + loopDepth = a_body1cont1(result, loopDepth); + + return loopDepth; + } + int a_body1when1(RangeResult && result,int loopDepth) + { + loopDepth = a_body1cont1(std::move(result), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetBoundaryActor, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< GetBoundaryActor, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("getBoundary", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBoundary", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetBoundaryActor, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("getBoundary", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBoundary", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetBoundaryActor, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("getBoundary", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBoundary", reinterpret_cast(this), 0); + + } + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + Reference tr; + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + KeyRange range; + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + Oldest oldest; + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + Version* version; + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + int64_t* time; + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +}; +// This generated class is to be used only via getBoundary() + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +class GetBoundaryActor final : public Actor>, public ActorCallback< GetBoundaryActor, 0, RangeResult >, public FastAllocated, public GetBoundaryActorState { + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetBoundaryActor, 0, RangeResult >; + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + GetBoundaryActor(Reference const& tr,KeyRange const& range,Oldest const& oldest,Version* const& version,int64_t* const& time) + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + : Actor>(), + GetBoundaryActorState(tr, range, oldest, version, time) + { + fdb_probe_actor_enter("getBoundary", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getBoundary"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getBoundary", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetBoundaryActor, 0, RangeResult >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +[[nodiscard]] static Future> getBoundary( Reference const& tr, KeyRange const& range, Oldest const& oldest, Version* const& version, int64_t* const& time ) { + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + return Future>(new GetBoundaryActor(tr, range, oldest, version, time)); + #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +} + +#line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + + #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +namespace { +// This generated class is to be used only via getIdmpKeyStatus() + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +template + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +class GetIdmpKeyStatusActorState { + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +public: + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + GetIdmpKeyStatusActorState(Database const& db) + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + : db(db), + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + tr(makeReference(db)), + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + size(), + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + expired(), + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + expiredKey(idempotencyIdsExpiredVersion, Unversioned()), + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + oldestIdVersion(0), + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + oldestIdTime(0) + #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + fdb_probe_actor_create("getIdmpKeyStatus", reinterpret_cast(this)); + + } + ~GetIdmpKeyStatusActorState() + { + fdb_probe_actor_destroy("getIdmpKeyStatus", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ; + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetIdmpKeyStatusActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + StrictFuture __when_expr_0 = store(size, tr->getEstimatedRangeSizeBytes(idempotencyIdKeys)) && store(expired, expiredKey.getD(tr)) && success(getBoundary(tr, idempotencyIdKeys, Oldest::True, &oldestIdVersion, &oldestIdTime)); + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + StrictFuture __when_expr_1 = tr->onError(e); + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Void const& _,int loopDepth) + { + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + JsonBuilderObject result; + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + result["size_bytes"] = size; + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (expired.expired != 0) + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + result["expired_version"] = expired.expired; + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (expired.expiredTime != 0) + #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + result["expired_age"] = int64_t(now()) - expired.expiredTime; + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (oldestIdVersion != 0) + #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + result["oldest_id_version"] = oldestIdVersion; + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (oldestIdTime != 0) + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + result["oldest_id_age"] = int64_t(now()) - oldestIdTime; + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetIdmpKeyStatusActorState(); static_cast(this)->destroy(); return 0; } + #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + new (&static_cast(this)->SAV< JsonBuilderObject >::value()) JsonBuilderObject(result); + this->~GetIdmpKeyStatusActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Void && _,int loopDepth) + { + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + JsonBuilderObject result; + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + result["size_bytes"] = size; + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (expired.expired != 0) + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + result["expired_version"] = expired.expired; + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (expired.expiredTime != 0) + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + result["expired_age"] = int64_t(now()) - expired.expiredTime; + #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (oldestIdVersion != 0) + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + result["oldest_id_version"] = oldestIdVersion; + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (oldestIdTime != 0) + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + result["oldest_id_age"] = int64_t(now()) - oldestIdTime; + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + } + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetIdmpKeyStatusActorState(); static_cast(this)->destroy(); return 0; } + #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + new (&static_cast(this)->SAV< JsonBuilderObject >::value()) JsonBuilderObject(result); + this->~GetIdmpKeyStatusActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetIdmpKeyStatusActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetIdmpKeyStatusActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getIdmpKeyStatus", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getIdmpKeyStatus", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetIdmpKeyStatusActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getIdmpKeyStatus", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getIdmpKeyStatus", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetIdmpKeyStatusActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getIdmpKeyStatus", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getIdmpKeyStatus", reinterpret_cast(this), 0); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetIdmpKeyStatusActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetIdmpKeyStatusActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("getIdmpKeyStatus", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getIdmpKeyStatus", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetIdmpKeyStatusActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("getIdmpKeyStatus", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getIdmpKeyStatus", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetIdmpKeyStatusActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("getIdmpKeyStatus", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getIdmpKeyStatus", reinterpret_cast(this), 1); + + } + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + Database db; + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + Reference tr; + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + int64_t size; + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + IdempotencyIdsExpiredVersion expired; + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + KeyBackedObjectProperty expiredKey; + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + int64_t oldestIdVersion; + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + int64_t oldestIdTime; + #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +}; +// This generated class is to be used only via getIdmpKeyStatus() + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +class GetIdmpKeyStatusActor final : public Actor, public ActorCallback< GetIdmpKeyStatusActor, 0, Void >, public ActorCallback< GetIdmpKeyStatusActor, 1, Void >, public FastAllocated, public GetIdmpKeyStatusActorState { + #line 1100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetIdmpKeyStatusActor, 0, Void >; +friend struct ActorCallback< GetIdmpKeyStatusActor, 1, Void >; + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + GetIdmpKeyStatusActor(Database const& db) + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + : Actor(), + GetIdmpKeyStatusActorState(db) + { + fdb_probe_actor_enter("getIdmpKeyStatus", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getIdmpKeyStatus"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getIdmpKeyStatus", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetIdmpKeyStatusActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetIdmpKeyStatusActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +[[nodiscard]] Future getIdmpKeyStatus( Database const& db ) { + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + return Future(new GetIdmpKeyStatusActor(db)); + #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +} + +#line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + + #line 1146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +namespace { +// This generated class is to be used only via cleanIdempotencyIds() + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +template + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +class CleanIdempotencyIdsActorState { + #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +public: + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + CleanIdempotencyIdsActorState(Database const& db,double const& minAgeSeconds) + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + : db(db), + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + minAgeSeconds(minAgeSeconds), + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + idmpKeySize(), + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + candidateDeleteSize(), + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + finalRange(), + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + tr(), + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + oldestKey(), + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + oldestVersion(), + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + oldestTime(), + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + candidateDeleteVersion(), + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + candidateDeleteTime(), + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + candidateRangeToClean() + #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + fdb_probe_actor_create("cleanIdempotencyIds", reinterpret_cast(this)); + + } + ~CleanIdempotencyIdsActorState() + { + fdb_probe_actor_destroy("cleanIdempotencyIds", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + tr = makeReference(db); + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ; + #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CleanIdempotencyIdsActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CleanIdempotencyIdsActorState(); static_cast(this)->destroy(); return 0; } + #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CleanIdempotencyIdsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + StrictFuture> __when_expr_0 = getBoundary(tr, idempotencyIdKeys, Oldest::True, &oldestVersion, &oldestTime); + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + TraceEvent("IdempotencyIdsCleanerError").error(e); + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + StrictFuture __when_expr_6 = tr->onError(e); + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Optional const& oldestKey_,int loopDepth) + { + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (!oldestKey_.present()) + #line 1312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + oldestKey = oldestKey_.get(); + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (int64_t(now()) - oldestTime < minAgeSeconds) + #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + StrictFuture __when_expr_1 = store(idmpKeySize, tr->getEstimatedRangeSizeBytes(idempotencyIdKeys)); + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Optional && oldestKey_,int loopDepth) + { + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (!oldestKey_.present()) + #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + oldestKey = oldestKey_.get(); + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (int64_t(now()) - oldestTime < minAgeSeconds) + #line 1350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + StrictFuture __when_expr_1 = store(idmpKeySize, tr->getEstimatedRangeSizeBytes(idempotencyIdKeys)); + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& oldestKey_,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(oldestKey_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && oldestKey_,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(oldestKey_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CleanIdempotencyIdsActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< CleanIdempotencyIdsActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CleanIdempotencyIdsActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CleanIdempotencyIdsActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + StrictFuture __when_expr_2 = success( getBoundary(tr, idempotencyIdKeys, Oldest::False, &candidateDeleteVersion, &candidateDeleteTime)); + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + StrictFuture __when_expr_2 = success( getBoundary(tr, idempotencyIdKeys, Oldest::False, &candidateDeleteVersion, &candidateDeleteTime)); + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CleanIdempotencyIdsActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CleanIdempotencyIdsActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< CleanIdempotencyIdsActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< CleanIdempotencyIdsActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont6(Void const& _,int loopDepth) + { + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ; + #line 1530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = a_body1loopBody1cont6loopHead1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont6(Void && _,int loopDepth) + { + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + ; + #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = a_body1loopBody1cont6loopHead1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont6(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont6(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CleanIdempotencyIdsActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CleanIdempotencyIdsActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< CleanIdempotencyIdsActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< CleanIdempotencyIdsActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 2); + + } + int a_body1loopBody1cont7(int loopDepth) + { + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + finalRange = KeyRangeRef(idempotencyIdKeys.begin, candidateRangeToClean.end); + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (!finalRange.empty()) + #line 1613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + tr->addReadConflictRange(finalRange); + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + tr->clear(finalRange); + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + tr->set( idempotencyIdsExpiredVersion, ObjectWriter::toValue(IdempotencyIdsExpiredVersion{ candidateDeleteVersion, candidateDeleteTime }, Unversioned())); + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + TraceEvent("IdempotencyIdsCleanerAttempt") .detail("Range", finalRange.toString()) .detail("IdmpKeySizeEstimate", idmpKeySize) .detail("ClearRangeSizeEstimate", candidateDeleteSize) .detail("ExpiredVersion", candidateDeleteVersion) .detail("ExpiredVersionAgeEstimate", static_cast(now()) - candidateDeleteTime); + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + StrictFuture __when_expr_5 = tr->commit(); + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont7when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont8(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont6loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1cont6loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont6loopBody1(int loopDepth) + { + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + candidateRangeToClean = KeyRangeRef(oldestKey, BinaryWriter::toValue(bigEndian64(candidateDeleteVersion + 1), Unversioned()) .withPrefix(idempotencyIdKeys.begin)); + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (oldestVersion == candidateDeleteVersion) + #line 1655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + return a_body1loopBody1cont6break1(loopDepth==0?0:loopDepth-1); // break + } + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + StrictFuture __when_expr_3 = success(getBoundary( tr, candidateRangeToClean, Oldest::False, &candidateDeleteVersion, &candidateDeleteTime)); + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont6loopBody1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont6break1(int loopDepth) + { + try { + return a_body1loopBody1cont7(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont6loopBody1cont1(Void const& _,int loopDepth) + { + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + candidateRangeToClean = KeyRangeRef(oldestKey, BinaryWriter::toValue(bigEndian64(candidateDeleteVersion + 1), Unversioned()) .withPrefix(idempotencyIdKeys.begin)); + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + StrictFuture __when_expr_4 = store(candidateDeleteSize, tr->getEstimatedRangeSizeBytes(candidateRangeToClean)); + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont6loopBody1cont1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont6loopBody1cont1(Void && _,int loopDepth) + { + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + candidateRangeToClean = KeyRangeRef(oldestKey, BinaryWriter::toValue(bigEndian64(candidateDeleteVersion + 1), Unversioned()) .withPrefix(idempotencyIdKeys.begin)); + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + StrictFuture __when_expr_4 = store(candidateDeleteSize, tr->getEstimatedRangeSizeBytes(candidateRangeToClean)); + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont6loopBody1cont1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont6loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont6loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont6loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont6loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CleanIdempotencyIdsActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CleanIdempotencyIdsActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont6loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< CleanIdempotencyIdsActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont6loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< CleanIdempotencyIdsActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 3); + + } + int a_body1loopBody1cont6loopBody1cont3(Void const& _,int loopDepth) + { + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + int64_t youngestAge = int64_t(now()) - candidateDeleteTime; + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + TraceEvent("IdempotencyIdsCleanerCandidateDelete") .detail("Range", candidateRangeToClean.toString()) .detail("IdmpKeySizeEstimate", idmpKeySize) .detail("YoungestIdAge", youngestAge) .detail("MinAgeSeconds", minAgeSeconds) .detail("ClearRangeSizeEstimate", candidateDeleteSize); + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (youngestAge > minAgeSeconds) + #line 1793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + return a_body1loopBody1cont6break1(loopDepth==0?0:loopDepth-1); // break + } + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + candidateDeleteVersion = (oldestVersion + candidateDeleteVersion) / 2; + #line 1799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (loopDepth == 0) return a_body1loopBody1cont6loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont6loopBody1cont3(Void && _,int loopDepth) + { + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + int64_t youngestAge = int64_t(now()) - candidateDeleteTime; + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + TraceEvent("IdempotencyIdsCleanerCandidateDelete") .detail("Range", candidateRangeToClean.toString()) .detail("IdmpKeySizeEstimate", idmpKeySize) .detail("YoungestIdAge", youngestAge) .detail("MinAgeSeconds", minAgeSeconds) .detail("ClearRangeSizeEstimate", candidateDeleteSize); + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + if (youngestAge > minAgeSeconds) + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + { + return a_body1loopBody1cont6break1(loopDepth==0?0:loopDepth-1); // break + } + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + candidateDeleteVersion = (oldestVersion + candidateDeleteVersion) / 2; + #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + if (loopDepth == 0) return a_body1loopBody1cont6loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont6loopBody1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont6loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont6loopBody1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont6loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CleanIdempotencyIdsActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CleanIdempotencyIdsActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont6loopBody1cont1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< CleanIdempotencyIdsActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont6loopBody1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< CleanIdempotencyIdsActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 4); + + } + int a_body1loopBody1cont8(int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont9(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont9(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont7when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont9(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont7when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont9(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CleanIdempotencyIdsActor, 5, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CleanIdempotencyIdsActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1loopBody1cont7when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< CleanIdempotencyIdsActor, 5, Void >*,Void && value) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1loopBody1cont7when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< CleanIdempotencyIdsActor, 5, Void >*,Error err) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 5); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose7() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CleanIdempotencyIdsActor, 6, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CleanIdempotencyIdsActor, 6, Void >*,Void const& value) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 6); + + } + void a_callback_fire(ActorCallback< CleanIdempotencyIdsActor, 6, Void >*,Void && value) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 6); + + } + void a_callback_error(ActorCallback< CleanIdempotencyIdsActor, 6, Void >*,Error err) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), 6); + + } + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + Database db; + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + double minAgeSeconds; + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + int64_t idmpKeySize; + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + int64_t candidateDeleteSize; + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + KeyRange finalRange; + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + Reference tr; + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + Key oldestKey; + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + Version oldestVersion; + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + int64_t oldestTime; + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + Version candidateDeleteVersion; + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + int64_t candidateDeleteTime; + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + KeyRange candidateRangeToClean; + #line 2066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +}; +// This generated class is to be used only via cleanIdempotencyIds() + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +class CleanIdempotencyIdsActor final : public Actor, public ActorCallback< CleanIdempotencyIdsActor, 0, Optional >, public ActorCallback< CleanIdempotencyIdsActor, 1, Void >, public ActorCallback< CleanIdempotencyIdsActor, 2, Void >, public ActorCallback< CleanIdempotencyIdsActor, 3, Void >, public ActorCallback< CleanIdempotencyIdsActor, 4, Void >, public ActorCallback< CleanIdempotencyIdsActor, 5, Void >, public ActorCallback< CleanIdempotencyIdsActor, 6, Void >, public FastAllocated, public CleanIdempotencyIdsActorState { + #line 2071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CleanIdempotencyIdsActor, 0, Optional >; +friend struct ActorCallback< CleanIdempotencyIdsActor, 1, Void >; +friend struct ActorCallback< CleanIdempotencyIdsActor, 2, Void >; +friend struct ActorCallback< CleanIdempotencyIdsActor, 3, Void >; +friend struct ActorCallback< CleanIdempotencyIdsActor, 4, Void >; +friend struct ActorCallback< CleanIdempotencyIdsActor, 5, Void >; +friend struct ActorCallback< CleanIdempotencyIdsActor, 6, Void >; + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + CleanIdempotencyIdsActor(Database const& db,double const& minAgeSeconds) + #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" + : Actor(), + CleanIdempotencyIdsActorState(db, minAgeSeconds) + { + fdb_probe_actor_enter("cleanIdempotencyIds", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("cleanIdempotencyIds"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("cleanIdempotencyIds", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CleanIdempotencyIdsActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CleanIdempotencyIdsActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< CleanIdempotencyIdsActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< CleanIdempotencyIdsActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< CleanIdempotencyIdsActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< CleanIdempotencyIdsActor, 5, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< CleanIdempotencyIdsActor, 6, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" +[[nodiscard]] Future cleanIdempotencyIds( Database const& db, double const& minAgeSeconds ) { + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" + return Future(new CleanIdempotencyIdsActor(db, minAgeSeconds)); + #line 2122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.g.cpp" +} + +#line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/IdempotencyId.actor.cpp" diff --git a/src/fdbclient/KeyBackedTypes.h b/src/fdbclient/KeyBackedTypes.h deleted file mode 100644 index 3733380..0000000 --- a/src/fdbclient/KeyBackedTypes.h +++ /dev/null @@ -1,544 +0,0 @@ -/* - * KeyBackedTypes.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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 - -#include -#include - -#include "fdbclient/IClientApi.h" -#include "fdbclient/ReadYourWrites.h" -#include "fdbclient/Subspace.h" -#include "flow/ObjectSerializer.h" -#include "flow/genericactors.actor.h" -#include "flow/serialize.h" - -// Codec is a utility struct to convert a type to and from a Tuple. It is used by the template -// classes below like KeyBackedProperty and KeyBackedMap to convert key parts and values -// from various types to Value strings and back. -// New types can be supported either by writing a new specialization or adding these -// methods to the type so that the default specialization can be used: -// static T T::unpack(Tuple const &t) -// Tuple T::pack() const -// Since Codec is a struct, partial specialization can be used, such as the std::pair -// partial specialization below allowing any std::pair where T1 and T2 are already -// supported by Codec. -template -struct Codec { - static inline Tuple pack(T const& val) { return val.pack(); } - static inline T unpack(Tuple const& t) { return T::unpack(t); } -}; - -// If T is Tuple then conversion is simple. -template <> -inline Tuple Codec::pack(Tuple const& val) { - return val; -} -template <> -inline Tuple Codec::unpack(Tuple const& val) { - return val; -} - -template <> -inline Tuple Codec::pack(int64_t const& val) { - return Tuple().append(val); -} -template <> -inline int64_t Codec::unpack(Tuple const& val) { - return val.getInt(0); -} - -template <> -inline Tuple Codec::pack(bool const& val) { - return Tuple().append(val ? 1 : 0); -} -template <> -inline bool Codec::unpack(Tuple const& val) { - return val.getInt(0) == 1; -} - -template <> -inline Tuple Codec>::pack(Standalone const& val) { - return Tuple().append(val); -} -template <> -inline Standalone Codec>::unpack(Tuple const& val) { - return val.getString(0); -} - -template <> -inline Tuple Codec::pack(UID const& val) { - return Codec>::pack(BinaryWriter::toValue(val, Unversioned())); -} -template <> -inline UID Codec::unpack(Tuple const& val) { - return BinaryReader::fromStringRef(Codec>::unpack(val), Unversioned()); -} - -// This is backward compatible with Codec> -template <> -inline Tuple Codec::pack(std::string const& val) { - return Tuple().append(StringRef(val)); -} -template <> -inline std::string Codec::unpack(Tuple const& val) { - return val.getString(0).toString(); -} - -// Partial specialization to cover all std::pairs as long as the component types are Codec compatible -template -struct Codec> { - static Tuple pack(typename std::pair const& val) { - return Tuple().append(Codec::pack(val.first)).append(Codec::pack(val.second)); - } - static std::pair unpack(Tuple const& t) { - ASSERT(t.size() == 2); - return { Codec::unpack(t.subTuple(0, 1)), Codec::unpack(t.subTuple(1, 2)) }; - } -}; - -template -struct Codec> { - static Tuple pack(typename std::vector const& val) { - Tuple t; - for (T item : val) { - Tuple itemTuple = Codec::pack(item); - // fdbclient doesn't support nested tuples yet. For now, flatten the tuple into StringRef - t.append(itemTuple.pack()); - } - return t; - } - - static std::vector unpack(Tuple const& t) { - std::vector v; - - for (int i = 0; i < t.size(); i++) { - Tuple itemTuple = Tuple::unpack(t.getString(i)); - v.push_back(Codec::unpack(itemTuple)); - } - - return v; - } -}; - -template <> -inline Tuple Codec::pack(KeyRange const& val) { - return Tuple().append(val.begin).append(val.end); -} -template <> -inline KeyRange Codec::unpack(Tuple const& val) { - return KeyRangeRef(val.getString(0), val.getString(1)); -} - -// Convenient read/write access to a single value of type T stored at key -// Even though 'this' is not actually mutated, methods that change the db key are not const. -template -class KeyBackedProperty { -public: - KeyBackedProperty(KeyRef key) : key(key) {} - Future> get(Reference tr, Snapshot snapshot = Snapshot::False) const { - return map(tr->get(key, snapshot), [](Optional const& val) -> Optional { - if (val.present()) - return Codec::unpack(Tuple::unpack(val.get())); - return {}; - }); - } - // Get property's value or defaultValue if it doesn't exist - Future getD(Reference tr, - Snapshot snapshot = Snapshot::False, - T defaultValue = T()) const { - return map(get(tr, snapshot), [=](Optional val) -> T { return val.present() ? val.get() : defaultValue; }); - } - // Get property's value or throw error if it doesn't exist - Future getOrThrow(Reference tr, - Snapshot snapshot = Snapshot::False, - Error err = key_not_found()) const { - return map(get(tr, snapshot), [=](Optional val) -> T { - if (!val.present()) { - throw err; - } - - return val.get(); - }); - } - - Future> get(Database cx, Snapshot snapshot = Snapshot::False) const { - return runRYWTransaction(cx, [=, self = *this](Reference tr) { - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - - return self.get(tr, snapshot); - }); - } - - Future getD(Database cx, Snapshot snapshot = Snapshot::False, T defaultValue = T()) const { - return runRYWTransaction(cx, [=, self = *this](Reference tr) { - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - - return self.getD(tr, snapshot, defaultValue); - }); - } - - Future getOrThrow(Database cx, Snapshot snapshot = Snapshot::False, Error err = key_not_found()) const { - return runRYWTransaction(cx, [=, self = *this](Reference tr) { - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - - return self.getOrThrow(tr, snapshot, err); - }); - } - - void set(Reference tr, T const& val) { return tr->set(key, Codec::pack(val).pack()); } - - Future set(Database cx, T const& val) { - return runRYWTransaction(cx, [=, self = *this](Reference tr) { - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - self->set(tr, val); - return Future(Void()); - }); - } - - void clear(Reference tr) { return tr->clear(key); } - Key key; -}; - -// This is just like KeyBackedProperty but instead of using Codec for conversion to/from values it -// uses BinaryReader and BinaryWriter. This enables allows atomic ops with integer types, and also -// allows reading and writing of existing keys which use BinaryReader/Writer. -template -class KeyBackedBinaryValue { -public: - KeyBackedBinaryValue(KeyRef key) : key(key) {} - Future> get(Reference tr, Snapshot snapshot = Snapshot::False) const { - return map(tr->get(key, snapshot), [](Optional const& val) -> Optional { - if (val.present()) - return BinaryReader::fromStringRef(val.get(), Unversioned()); - return {}; - }); - } - // Get property's value or defaultValue if it doesn't exist - Future getD(Reference tr, - Snapshot snapshot = Snapshot::False, - T defaultValue = T()) const { - return map(get(tr, Snapshot::False), - [=](Optional val) -> T { return val.present() ? val.get() : defaultValue; }); - } - void set(Reference tr, T const& val) { - return tr->set(key, BinaryWriter::toValue(val, Unversioned())); - } - void atomicOp(Reference tr, T const& val, MutationRef::Type type) { - return tr->atomicOp(key, BinaryWriter::toValue(val, Unversioned()), type); - } - void clear(Reference tr) { return tr->clear(key); } - Key key; -}; - -// Convenient read/write access to a sorted map of KeyType to ValueType under prefix -// Even though 'this' is not actually mutated, methods that change db keys are not const. -template -class KeyBackedMap { -public: - KeyBackedMap(KeyRef prefix) : space(prefix) {} - - typedef _KeyType KeyType; - typedef _ValueType ValueType; - typedef std::pair PairType; - typedef std::vector PairsType; - - // If end is not present one key past the end of the map is used. - Future getRange(Reference tr, - KeyType const& begin, - Optional const& end, - int limit, - Snapshot snapshot = Snapshot::False, - Reverse reverse = Reverse::False) const { - Subspace s = space; // 'this' could be invalid inside lambda - Key endKey = end.present() ? s.pack(Codec::pack(end.get())) : space.range().end; - return map( - tr->getRange( - KeyRangeRef(s.pack(Codec::pack(begin)), endKey), GetRangeLimits(limit), snapshot, reverse), - [s](RangeResult const& kvs) -> PairsType { - PairsType results; - for (int i = 0; i < kvs.size(); ++i) { - KeyType key = Codec::unpack(s.unpack(kvs[i].key)); - ValueType val = Codec::unpack(Tuple::unpack(kvs[i].value)); - results.push_back(PairType(key, val)); - } - return results; - }); - } - - Future> get(Reference tr, - KeyType const& key, - Snapshot snapshot = Snapshot::False) const { - return map(tr->get(space.pack(Codec::pack(key)), snapshot), - [](Optional const& val) -> Optional { - if (val.present()) - return Codec::unpack(Tuple::unpack(val.get())); - return {}; - }); - } - - // Returns a Property that can be get/set that represents key's entry in this this. - KeyBackedProperty getProperty(KeyType const& key) const { return space.pack(Codec::pack(key)); } - - // Returns the expectedSize of the set key - int set(Reference tr, KeyType const& key, ValueType const& val) { - Key k = space.pack(Codec::pack(key)); - Value v = Codec::pack(val).pack(); - tr->set(k, v); - return k.expectedSize() + v.expectedSize(); - } - - void erase(Reference tr, KeyType const& key) { - return tr->clear(space.pack(Codec::pack(key))); - } - - void erase(Reference tr, KeyType const& key) { - return tr->clear(space.pack(Codec::pack(key))); - } - - void erase(Reference tr, KeyType const& begin, KeyType const& end) { - return tr->clear(KeyRangeRef(space.pack(Codec::pack(begin)), space.pack(Codec::pack(end)))); - } - - void clear(Reference tr) { return tr->clear(space.range()); } - - Subspace space; -}; - -// Convenient read/write access to a single value of type T stored at key -// Even though 'this' is not actually mutated, methods that change the db key are not const. -template -class KeyBackedObjectProperty { -public: - KeyBackedObjectProperty(KeyRef key, VersionOptions versionOptions) : key(key), versionOptions(versionOptions) {} - Future> get(Reference tr, Snapshot snapshot = Snapshot::False) const { - - return map(tr->get(key, snapshot), [vo = versionOptions](Optional const& val) -> Optional { - if (val.present()) - return ObjectReader::fromStringRef(val.get(), vo); - return {}; - }); - } - - // Get property's value or defaultValue if it doesn't exist - Future getD(Reference tr, - Snapshot snapshot = Snapshot::False, - T defaultValue = T()) const { - return map(get(tr, snapshot), [=](Optional val) -> T { return val.present() ? val.get() : defaultValue; }); - } - // Get property's value or throw error if it doesn't exist - Future getOrThrow(Reference tr, - Snapshot snapshot = Snapshot::False, - Error err = key_not_found()) const { - return map(get(tr, snapshot), [=](Optional val) -> T { - if (!val.present()) { - throw err; - } - - return val.get(); - }); - } - - Future> get(Database cx, Snapshot snapshot = Snapshot::False) const { - return runRYWTransaction(cx, [=, self = *this](Reference tr) { - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - - return self.get(tr, snapshot); - }); - } - - Future getD(Database cx, Snapshot snapshot = Snapshot::False, T defaultValue = T()) const { - return runRYWTransaction(cx, [=, self = *this](Reference tr) { - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - - return self.getD(tr, snapshot, defaultValue); - }); - } - - Future getOrThrow(Database cx, Snapshot snapshot = Snapshot::False, Error err = key_not_found()) const { - return runRYWTransaction(cx, [=, self = *this](Reference tr) { - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - - return self.getOrThrow(tr, snapshot, err); - }); - } - - void set(Reference tr, T const& val) { - return tr->set(key, ObjectWriter::toValue(val, versionOptions)); - } - - Future set(Database cx, T const& val) { - return runRYWTransaction(cx, [=, self = *this](Reference tr) { - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - self.set(tr, val); - return Future(Void()); - }); - } - - void clear(Reference tr) { return tr->clear(key); } - - Key key; - VersionOptions versionOptions; -}; - -// Convenient read/write access to a sorted map of KeyType to ValueType under key prefix -// ValueType is encoded / decoded with ObjectWriter/ObjectReader -// Even though 'this' is not actually mutated, methods that change db keys are not const. -template -class KeyBackedObjectMap { -public: - KeyBackedObjectMap(KeyRef prefix, VersionOptions versionOptions) : space(prefix), versionOptions(versionOptions) {} - - typedef _KeyType KeyType; - typedef _ValueType ValueType; - typedef std::pair PairType; - typedef std::vector PairsType; - - // If end is not present one key past the end of the map is used. - Future getRange(Reference tr, - KeyType const& begin, - Optional const& end, - int limit, - Snapshot snapshot = Snapshot::False, - Reverse reverse = Reverse::False) const { - Key endKey = end.present() ? space.pack(Codec::pack(end.get())) : space.range().end; - return map( - tr->getRange( - KeyRangeRef(space.pack(Codec::pack(begin)), endKey), GetRangeLimits(limit), snapshot, reverse), - [self = *this](RangeResult const& kvs) -> PairsType { - PairsType results; - for (int i = 0; i < kvs.size(); ++i) { - KeyType key = Codec::unpack(self.space.unpack(kvs[i].key)); - ValueType val = ObjectReader::fromStringRef(kvs[i].value, self.versionOptions); - results.push_back(PairType(key, val)); - } - return results; - }); - } - - Future> get(Reference tr, - KeyType const& key, - Snapshot snapshot = Snapshot::False) const { - return map(tr->get(space.pack(Codec::pack(key)), snapshot), - [vo = versionOptions](Optional const& val) -> Optional { - if (val.present()) - return ObjectReader::fromStringRef(val.get(), vo); - return {}; - }); - } - - // Returns a Property that can be get/set that represents key's entry in this this. - KeyBackedObjectProperty getProperty(KeyType const& key) const { - return KeyBackedObjectProperty(space.pack(Codec::pack(key)), - versionOptions); - } - - // Returns the expectedSize of the set key - int set(Reference tr, KeyType const& key, ValueType const& val) { - Key k = space.pack(Codec::pack(key)); - Value v = ObjectWriter::toValue(val, versionOptions); - tr->set(k, v); - return k.expectedSize() + v.expectedSize(); - } - - Key serializeKey(KeyType const& key) { return space.pack(Codec::pack(key)); } - - Value serializeValue(ValueType const& val) { return ObjectWriter::toValue(val, versionOptions); } - - void erase(Reference tr, KeyType const& key) { - return tr->clear(space.pack(Codec::pack(key))); - } - - void erase(Reference tr, KeyType const& key) { - return tr->clear(space.pack(Codec::pack(key))); - } - - void erase(Reference tr, KeyType const& begin, KeyType const& end) { - return tr->clear(KeyRangeRef(space.pack(Codec::pack(begin)), space.pack(Codec::pack(end)))); - } - - void clear(Reference tr) { return tr->clear(space.range()); } - - Subspace space; - VersionOptions versionOptions; -}; - -template -class KeyBackedSet { -public: - KeyBackedSet(KeyRef key) : space(key) {} - - typedef _ValueType ValueType; - typedef std::vector Values; - - // If end is not present one key past the end of the map is used. - Future getRange(Reference tr, - ValueType const& begin, - Optional const& end, - int limit, - Snapshot snapshot = Snapshot::False) const { - Subspace s = space; // 'this' could be invalid inside lambda - Key endKey = end.present() ? s.pack(Codec::pack(end.get())) : space.range().end; - return map( - tr->getRange(KeyRangeRef(s.pack(Codec::pack(begin)), endKey), GetRangeLimits(limit), snapshot), - [s](RangeResult const& kvs) -> Values { - Values results; - for (int i = 0; i < kvs.size(); ++i) { - results.push_back(Codec::unpack(s.unpack(kvs[i].key))); - } - return results; - }); - } - - Future exists(Reference tr, - ValueType const& val, - Snapshot snapshot = Snapshot::False) const { - return map(tr->get(space.pack(Codec::pack(val)), snapshot), - [](Optional const& val) -> bool { return val.present(); }); - } - - // Returns the expectedSize of the set key - int insert(Reference tr, ValueType const& val) { - Key k = space.pack(Codec::pack(val)); - tr->set(k, StringRef()); - return k.expectedSize(); - } - - void erase(Reference tr, ValueType const& val) { - return tr->clear(space.pack(Codec::pack(val))); - } - - void erase(Reference tr, ValueType const& begin, ValueType const& end) { - return tr->clear( - KeyRangeRef(space.pack(Codec::pack(begin)), space.pack(Codec::pack(end)))); - } - - void clear(Reference tr) { return tr->clear(space.range()); } - - Subspace space; -}; diff --git a/src/fdbclient/KeyRangeMap.actor.cpp b/src/fdbclient/KeyRangeMap.actor.cpp index c736c71..a678c28 100644 --- a/src/fdbclient/KeyRangeMap.actor.cpp +++ b/src/fdbclient/KeyRangeMap.actor.cpp @@ -23,6 +23,7 @@ #include "fdbclient/CommitTransaction.h" #include "fdbclient/FDBTypes.h" #include "fdbclient/ReadYourWrites.h" +#include "flow/UnitTest.h" #include "flow/actorcompiler.h" // has to be last include void KeyRangeActorMap::getRangesAffectedByInsertion(const KeyRangeRef& keys, std::vector& affectedRanges) { @@ -35,32 +36,54 @@ void KeyRangeActorMap::getRangesAffectedByInsertion(const KeyRangeRef& keys, std affectedRanges.push_back(KeyRangeRef(keys.end, e.end())); } -RangeResult krmDecodeRanges(KeyRef mapPrefix, KeyRange keys, RangeResult kv) { +RangeResult krmDecodeRanges(KeyRef mapPrefix, KeyRange keys, RangeResult kv, bool align) { ASSERT(!kv.more || kv.size() > 1); KeyRange withPrefix = KeyRangeRef(mapPrefix.toString() + keys.begin.toString(), mapPrefix.toString() + keys.end.toString()); - ValueRef beginValue, endValue; - if (kv.size() && kv[0].key.startsWith(mapPrefix)) - beginValue = kv[0].value; - if (kv.size() && kv.end()[-1].key.startsWith(mapPrefix)) - endValue = kv.end()[-1].value; - RangeResult result; result.arena().dependsOn(kv.arena()); result.arena().dependsOn(keys.arena()); - result.push_back(result.arena(), KeyValueRef(keys.begin, beginValue)); + // Always push a kv pair <= keys.begin. + KeyRef beginKey = keys.begin; + if (!align && !kv.empty() && kv.front().key.startsWith(mapPrefix) && kv.front().key < withPrefix.begin) { + beginKey = kv[0].key.removePrefix(mapPrefix); + } + ValueRef beginValue; + if (!kv.empty() && kv.front().key.startsWith(mapPrefix) && kv.front().key <= withPrefix.begin) { + beginValue = kv.front().value; + } + result.push_back(result.arena(), KeyValueRef(beginKey, beginValue)); + for (int i = 0; i < kv.size(); i++) { if (kv[i].key > withPrefix.begin && kv[i].key < withPrefix.end) { KeyRef k = kv[i].key.removePrefix(mapPrefix); result.push_back(result.arena(), KeyValueRef(k, kv[i].value)); - } else if (kv[i].key >= withPrefix.end) + } else if (kv[i].key >= withPrefix.end) { kv.more = false; + // There should be at most 1 value past mapPrefix + keys.end. + ASSERT(i == kv.size() - 1); + break; + } } - if (!kv.more) - result.push_back(result.arena(), KeyValueRef(keys.end, endValue)); + if (!kv.more) { + KeyRef endKey = keys.end; + if (!align && !kv.empty() && kv.back().key.startsWith(mapPrefix) && kv.back().key >= withPrefix.end) { + endKey = kv.back().key.removePrefix(mapPrefix); + } + ValueRef endValue; + if (!kv.empty()) { + // In the aligned case, carry the last value to be the end value. + if (align && kv.back().key.startsWith(mapPrefix) && kv.back().key > withPrefix.end) { + endValue = result.back().value; + } else { + endValue = kv.back().value; + } + } + result.push_back(result.arena(), KeyValueRef(endKey, endValue)); + } result.more = kv.more; return result; @@ -93,6 +116,43 @@ ACTOR Future krmGetRanges(Reference tr, return krmDecodeRanges(mapPrefix, keys, kv); } +// Returns keys.begin, all transitional points in keys, and keys.end, and their values +ACTOR Future krmGetRangesUnaligned(Transaction* tr, + Key mapPrefix, + KeyRange keys, + int limit, + int limitBytes) { + KeyRange withPrefix = + KeyRangeRef(mapPrefix.toString() + keys.begin.toString(), mapPrefix.toString() + keys.end.toString()); + + state GetRangeLimits limits(limit, limitBytes); + limits.minRows = 2; + // wait to include the next highest row >= keys.end in the result, so since end is exclusive, we need +2 and + // !orEqual + RangeResult kv = + wait(tr->getRange(lastLessOrEqual(withPrefix.begin), KeySelectorRef(withPrefix.end, false, +2), limits)); + + return krmDecodeRanges(mapPrefix, keys, kv, false); +} + +ACTOR Future krmGetRangesUnaligned(Reference tr, + Key mapPrefix, + KeyRange keys, + int limit, + int limitBytes) { + KeyRange withPrefix = + KeyRangeRef(mapPrefix.toString() + keys.begin.toString(), mapPrefix.toString() + keys.end.toString()); + + state GetRangeLimits limits(limit, limitBytes); + limits.minRows = 2; + // wait to include the next highest row >= keys.end in the result, so since end is exclusive, we need +2 and + // !orEqual + RangeResult kv = + wait(tr->getRange(lastLessOrEqual(withPrefix.begin), KeySelectorRef(withPrefix.end, false, +2), limits)); + + return krmDecodeRanges(mapPrefix, keys, kv, false); +} + void krmSetPreviouslyEmptyRange(Transaction* tr, const KeyRef& mapPrefix, const KeyRangeRef& keys, @@ -186,7 +246,7 @@ static Future krmSetRangeCoalescing_(Transaction* tr, // Determine how far to extend this range at the beginning auto beginRange = keys[0].get(); bool hasBegin = beginRange.size() > 0 && beginRange[0].key.startsWith(mapPrefix); - Value beginValue = hasBegin ? beginRange[0].value : LiteralStringRef(""); + Value beginValue = hasBegin ? beginRange[0].value : ""_sr; state Key beginKey = withPrefix.begin; if (beginValue == value) { @@ -199,7 +259,7 @@ static Future krmSetRangeCoalescing_(Transaction* tr, bool hasEnd = endRange.size() >= 1 && endRange[0].key.startsWith(mapPrefix) && endRange[0].key <= withPrefix.end; bool hasNext = (endRange.size() == 2 && endRange[1].key.startsWith(mapPrefix)) || (endRange.size() == 1 && withPrefix.end < endRange[0].key && endRange[0].key.startsWith(mapPrefix)); - Value existingValue = hasEnd ? endRange[0].value : LiteralStringRef(""); + Value existingValue = hasEnd ? endRange[0].value : ""_sr; bool valueMatches = value == existingValue; KeyRange conflictRange = KeyRangeRef(hasBegin ? beginRange[0].key : mapPrefix, withPrefix.begin); @@ -254,3 +314,107 @@ Future krmSetRangeCoalescing(Reference const& t Value const& value) { return holdWhile(tr, krmSetRangeCoalescing_(tr.getPtr(), mapPrefix, range, maxRange, value)); } + +TEST_CASE("/keyrangemap/decoderange/aligned") { + Arena arena; + Key prefix = "/prefix/"_sr; + StringRef fullKeyA = StringRef(arena, "/prefix/a"_sr); + StringRef fullKeyB = StringRef(arena, "/prefix/b"_sr); + StringRef fullKeyC = StringRef(arena, "/prefix/c"_sr); + StringRef fullKeyD = StringRef(arena, "/prefix/d"_sr); + + StringRef keyA = StringRef(arena, "a"_sr); + StringRef keyB = StringRef(arena, "b"_sr); + StringRef keyC = StringRef(arena, "c"_sr); + StringRef keyD = StringRef(arena, "d"_sr); + StringRef keyE = StringRef(arena, "e"_sr); + StringRef keyAB = StringRef(arena, "ab"_sr); + StringRef keyAC = StringRef(arena, "ac"_sr); + StringRef keyCD = StringRef(arena, "cd"_sr); + + // Fake getRange() call. + RangeResult kv; + kv.push_back(arena, KeyValueRef(fullKeyA, keyA)); + kv.push_back(arena, KeyValueRef(fullKeyB, keyB)); + + // [A, AB(start), AC(start), B] + RangeResult decodedRanges = krmDecodeRanges(prefix, KeyRangeRef(keyAB, keyAC), kv); + ASSERT(decodedRanges.size() == 2); + ASSERT(decodedRanges.front().key == keyAB); + ASSERT(decodedRanges.front().value == keyA); + ASSERT(decodedRanges.back().key == keyAC); + ASSERT(decodedRanges.back().value == keyA); + + kv.push_back(arena, KeyValueRef(fullKeyC, keyC)); + kv.push_back(arena, KeyValueRef(fullKeyD, keyD)); + + // [A, AB(start), B, C, CD(end), D] + decodedRanges = krmDecodeRanges(prefix, KeyRangeRef(keyAB, keyCD), kv); + ASSERT(decodedRanges.size() == 4); + ASSERT(decodedRanges.front().key == keyAB); + ASSERT(decodedRanges.front().value == keyA); + ASSERT(decodedRanges.back().key == keyCD); + ASSERT(decodedRanges.back().value == keyC); + + // [""(start), A, B, C, D, E(end)] + decodedRanges = krmDecodeRanges(prefix, KeyRangeRef(StringRef(), keyE), kv); + ASSERT(decodedRanges.size() == 6); + ASSERT(decodedRanges.front().key == StringRef()); + ASSERT(decodedRanges.front().value == StringRef()); + ASSERT(decodedRanges.back().key == keyE); + ASSERT(decodedRanges.back().value == keyD); + + return Void(); +} + +TEST_CASE("/keyrangemap/decoderange/unaligned") { + Arena arena; + Key prefix = "/prefix/"_sr; + StringRef fullKeyA = StringRef(arena, "/prefix/a"_sr); + StringRef fullKeyB = StringRef(arena, "/prefix/b"_sr); + StringRef fullKeyC = StringRef(arena, "/prefix/c"_sr); + StringRef fullKeyD = StringRef(arena, "/prefix/d"_sr); + + StringRef keyA = StringRef(arena, "a"_sr); + StringRef keyB = StringRef(arena, "b"_sr); + StringRef keyC = StringRef(arena, "c"_sr); + StringRef keyD = StringRef(arena, "d"_sr); + StringRef keyE = StringRef(arena, "e"_sr); + StringRef keyAB = StringRef(arena, "ab"_sr); + StringRef keyAC = StringRef(arena, "ac"_sr); + StringRef keyCD = StringRef(arena, "cd"_sr); + + // Fake getRange() call. + RangeResult kv; + kv.push_back(arena, KeyValueRef(fullKeyA, keyA)); + kv.push_back(arena, KeyValueRef(fullKeyB, keyB)); + + // [A, AB(start), AC(start), B] + RangeResult decodedRanges = krmDecodeRanges(prefix, KeyRangeRef(keyAB, keyAC), kv, false); + ASSERT(decodedRanges.size() == 2); + ASSERT(decodedRanges.front().key == keyA); + ASSERT(decodedRanges.front().value == keyA); + ASSERT(decodedRanges.back().key == keyB); + ASSERT(decodedRanges.back().value == keyB); + + kv.push_back(arena, KeyValueRef(fullKeyC, keyC)); + kv.push_back(arena, KeyValueRef(fullKeyD, keyD)); + + // [A, AB(start), B, C, CD(end), D] + decodedRanges = krmDecodeRanges(prefix, KeyRangeRef(keyAB, keyCD), kv, false); + ASSERT(decodedRanges.size() == 4); + ASSERT(decodedRanges.front().key == keyA); + ASSERT(decodedRanges.front().value == keyA); + ASSERT(decodedRanges.back().key == keyD); + ASSERT(decodedRanges.back().value == keyD); + + // [""(start), A, B, C, D, E(end)] + decodedRanges = krmDecodeRanges(prefix, KeyRangeRef(StringRef(), keyE), kv, false); + ASSERT(decodedRanges.size() == 6); + ASSERT(decodedRanges.front().key == StringRef()); + ASSERT(decodedRanges.front().value == StringRef()); + ASSERT(decodedRanges.back().key == keyE); + ASSERT(decodedRanges.back().value == keyD); + + return Void(); +} \ No newline at end of file diff --git a/src/fdbclient/KeyRangeMap.actor.g.cpp b/src/fdbclient/KeyRangeMap.actor.g.cpp index 54ef7a5..ea6931a 100644 --- a/src/fdbclient/KeyRangeMap.actor.g.cpp +++ b/src/fdbclient/KeyRangeMap.actor.g.cpp @@ -25,6 +25,7 @@ #include "fdbclient/CommitTransaction.h" #include "fdbclient/FDBTypes.h" #include "fdbclient/ReadYourWrites.h" +#include "flow/UnitTest.h" #include "flow/actorcompiler.h" // has to be last include void KeyRangeActorMap::getRangesAffectedByInsertion(const KeyRangeRef& keys, std::vector& affectedRanges) { @@ -37,61 +38,83 @@ void KeyRangeActorMap::getRangesAffectedByInsertion(const KeyRangeRef& keys, std affectedRanges.push_back(KeyRangeRef(keys.end, e.end())); } -RangeResult krmDecodeRanges(KeyRef mapPrefix, KeyRange keys, RangeResult kv) { +RangeResult krmDecodeRanges(KeyRef mapPrefix, KeyRange keys, RangeResult kv, bool align) { ASSERT(!kv.more || kv.size() > 1); KeyRange withPrefix = KeyRangeRef(mapPrefix.toString() + keys.begin.toString(), mapPrefix.toString() + keys.end.toString()); - ValueRef beginValue, endValue; - if (kv.size() && kv[0].key.startsWith(mapPrefix)) - beginValue = kv[0].value; - if (kv.size() && kv.end()[-1].key.startsWith(mapPrefix)) - endValue = kv.end()[-1].value; - RangeResult result; result.arena().dependsOn(kv.arena()); result.arena().dependsOn(keys.arena()); - result.push_back(result.arena(), KeyValueRef(keys.begin, beginValue)); + // Always push a kv pair <= keys.begin. + KeyRef beginKey = keys.begin; + if (!align && !kv.empty() && kv.front().key.startsWith(mapPrefix) && kv.front().key < withPrefix.begin) { + beginKey = kv[0].key.removePrefix(mapPrefix); + } + ValueRef beginValue; + if (!kv.empty() && kv.front().key.startsWith(mapPrefix) && kv.front().key <= withPrefix.begin) { + beginValue = kv.front().value; + } + result.push_back(result.arena(), KeyValueRef(beginKey, beginValue)); + for (int i = 0; i < kv.size(); i++) { if (kv[i].key > withPrefix.begin && kv[i].key < withPrefix.end) { KeyRef k = kv[i].key.removePrefix(mapPrefix); result.push_back(result.arena(), KeyValueRef(k, kv[i].value)); - } else if (kv[i].key >= withPrefix.end) + } else if (kv[i].key >= withPrefix.end) { kv.more = false; + // There should be at most 1 value past mapPrefix + keys.end. + ASSERT(i == kv.size() - 1); + break; + } } - if (!kv.more) - result.push_back(result.arena(), KeyValueRef(keys.end, endValue)); + if (!kv.more) { + KeyRef endKey = keys.end; + if (!align && !kv.empty() && kv.back().key.startsWith(mapPrefix) && kv.back().key >= withPrefix.end) { + endKey = kv.back().key.removePrefix(mapPrefix); + } + ValueRef endValue; + if (!kv.empty()) { + // In the aligned case, carry the last value to be the end value. + if (align && kv.back().key.startsWith(mapPrefix) && kv.back().key > withPrefix.end) { + endValue = result.back().value; + } else { + endValue = kv.back().value; + } + } + result.push_back(result.arena(), KeyValueRef(endKey, endValue)); + } result.more = kv.more; return result; } // Returns keys.begin, all transitional points in keys, and keys.end, and their values - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" namespace { // This generated class is to be used only via krmGetRanges() - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" template - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" class KrmGetRangesActorState { - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" public: - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KrmGetRangesActorState(Transaction* const& tr,Key const& mapPrefix,KeyRange const& keys,int const& limit,int const& limitBytes) - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" : tr(tr), - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" mapPrefix(mapPrefix), - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" keys(keys), - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" limit(limit), - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" limitBytes(limitBytes) - #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { fdb_probe_actor_create("krmGetRanges", reinterpret_cast(this)); @@ -104,22 +127,22 @@ class KrmGetRangesActorState { int a_body1(int loopDepth=0) { try { - #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange withPrefix = KeyRangeRef(mapPrefix.toString() + keys.begin.toString(), mapPrefix.toString() + keys.end.toString()); - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" limits = GetRangeLimits(limit, limitBytes); - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" limits.minRows = 2; - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" StrictFuture __when_expr_0 = tr->getRange(lastLessOrEqual(withPrefix.begin), firstGreaterThan(withPrefix.end), limits); - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -140,9 +163,9 @@ class KrmGetRangesActorState { } int a_body1cont1(RangeResult const& kv,int loopDepth) { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(krmDecodeRanges(mapPrefix, keys, kv)); this->~KrmGetRangesActorState(); static_cast(this)->destroy(); return 0; } - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(krmDecodeRanges(mapPrefix, keys, kv)); this->~KrmGetRangesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -152,9 +175,9 @@ class KrmGetRangesActorState { } int a_body1cont1(RangeResult && kv,int loopDepth) { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(krmDecodeRanges(mapPrefix, keys, kv)); this->~KrmGetRangesActorState(); static_cast(this)->destroy(); return 0; } - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(krmDecodeRanges(mapPrefix, keys, kv)); this->~KrmGetRangesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -225,24 +248,24 @@ class KrmGetRangesActorState { fdb_probe_actor_exit("krmGetRanges", reinterpret_cast(this), 0); } - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Transaction* tr; - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Key mapPrefix; - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange keys; - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" int limit; - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" int limitBytes; - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" GetRangeLimits limits; - #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" }; // This generated class is to be used only via krmGetRanges() - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" class KrmGetRangesActor final : public Actor, public ActorCallback< KrmGetRangesActor, 0, RangeResult >, public FastAllocated, public KrmGetRangesActorState { - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -251,9 +274,9 @@ class KrmGetRangesActor final : public Actor, public ActorCallback< void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< KrmGetRangesActor, 0, RangeResult >; - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KrmGetRangesActor(Transaction* const& tr,Key const& mapPrefix,KeyRange const& keys,int const& limit,int const& limitBytes) - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" : Actor(), KrmGetRangesActorState(tr, mapPrefix, keys, limit, limitBytes) { @@ -277,38 +300,38 @@ friend struct ActorCallback< KrmGetRangesActor, 0, RangeResult >; } }; } - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" [[nodiscard]] Future krmGetRanges( Transaction* const& tr, Key const& mapPrefix, KeyRange const& keys, int const& limit, int const& limitBytes ) { - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" return Future(new KrmGetRangesActor(tr, mapPrefix, keys, limit, limitBytes)); - #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } -#line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +#line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" namespace { // This generated class is to be used only via krmGetRanges() - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" template - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" class KrmGetRangesActor1State { - #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" public: - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KrmGetRangesActor1State(Reference const& tr,Key const& mapPrefix,KeyRange const& keys,int const& limit,int const& limitBytes) - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" : tr(tr), - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" mapPrefix(mapPrefix), - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" keys(keys), - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" limit(limit), - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" limitBytes(limitBytes) - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { fdb_probe_actor_create("krmGetRanges", reinterpret_cast(this)); @@ -321,22 +344,22 @@ class KrmGetRangesActor1State { int a_body1(int loopDepth=0) { try { - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange withPrefix = KeyRangeRef(mapPrefix.toString() + keys.begin.toString(), mapPrefix.toString() + keys.end.toString()); - #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" limits = GetRangeLimits(limit, limitBytes); - #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" limits.minRows = 2; - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" StrictFuture __when_expr_0 = tr->getRange(lastLessOrEqual(withPrefix.begin), firstGreaterThan(withPrefix.end), limits); - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -357,9 +380,9 @@ class KrmGetRangesActor1State { } int a_body1cont1(RangeResult const& kv,int loopDepth) { - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(krmDecodeRanges(mapPrefix, keys, kv)); this->~KrmGetRangesActor1State(); static_cast(this)->destroy(); return 0; } - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(krmDecodeRanges(mapPrefix, keys, kv)); this->~KrmGetRangesActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -369,9 +392,9 @@ class KrmGetRangesActor1State { } int a_body1cont1(RangeResult && kv,int loopDepth) { - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(krmDecodeRanges(mapPrefix, keys, kv)); this->~KrmGetRangesActor1State(); static_cast(this)->destroy(); return 0; } - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(krmDecodeRanges(mapPrefix, keys, kv)); this->~KrmGetRangesActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -442,24 +465,24 @@ class KrmGetRangesActor1State { fdb_probe_actor_exit("krmGetRanges", reinterpret_cast(this), 0); } - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Reference tr; - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Key mapPrefix; - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange keys; - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" int limit; - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" int limitBytes; - #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" GetRangeLimits limits; - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" }; // This generated class is to be used only via krmGetRanges() - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" class KrmGetRangesActor1 final : public Actor, public ActorCallback< KrmGetRangesActor1, 0, RangeResult >, public FastAllocated, public KrmGetRangesActor1State { - #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -468,19 +491,454 @@ class KrmGetRangesActor1 final : public Actor, public ActorCallback void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< KrmGetRangesActor1, 0, RangeResult >; - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KrmGetRangesActor1(Reference const& tr,Key const& mapPrefix,KeyRange const& keys,int const& limit,int const& limitBytes) - #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + : Actor(), + KrmGetRangesActor1State(tr, mapPrefix, keys, limit, limitBytes) + { + fdb_probe_actor_enter("krmGetRanges", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("krmGetRanges"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("krmGetRanges", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< KrmGetRangesActor1, 0, RangeResult >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +[[nodiscard]] Future krmGetRanges( Reference const& tr, Key const& mapPrefix, KeyRange const& keys, int const& limit, int const& limitBytes ) { + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + return Future(new KrmGetRangesActor1(tr, mapPrefix, keys, limit, limitBytes)); + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +} + +#line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + +// Returns keys.begin, all transitional points in keys, and keys.end, and their values + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +namespace { +// This generated class is to be used only via krmGetRangesUnaligned() + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +template + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +class KrmGetRangesUnalignedActorState { + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +public: + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + KrmGetRangesUnalignedActorState(Transaction* const& tr,Key const& mapPrefix,KeyRange const& keys,int const& limit,int const& limitBytes) + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + : tr(tr), + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + mapPrefix(mapPrefix), + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + keys(keys), + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + limit(limit), + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + limitBytes(limitBytes) + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + { + fdb_probe_actor_create("krmGetRangesUnaligned", reinterpret_cast(this)); + + } + ~KrmGetRangesUnalignedActorState() + { + fdb_probe_actor_destroy("krmGetRangesUnaligned", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + KeyRange withPrefix = KeyRangeRef(mapPrefix.toString() + keys.begin.toString(), mapPrefix.toString() + keys.end.toString()); + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + limits = GetRangeLimits(limit, limitBytes); + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + limits.minRows = 2; + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StrictFuture __when_expr_0 = tr->getRange(lastLessOrEqual(withPrefix.begin), KeySelectorRef(withPrefix.end, false, +2), limits); + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~KrmGetRangesUnalignedActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(RangeResult const& kv,int loopDepth) + { + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(krmDecodeRanges(mapPrefix, keys, kv, false)); this->~KrmGetRangesUnalignedActorState(); static_cast(this)->destroy(); return 0; } + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(krmDecodeRanges(mapPrefix, keys, kv, false)); + this->~KrmGetRangesUnalignedActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(RangeResult && kv,int loopDepth) + { + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(krmDecodeRanges(mapPrefix, keys, kv, false)); this->~KrmGetRangesUnalignedActorState(); static_cast(this)->destroy(); return 0; } + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(krmDecodeRanges(mapPrefix, keys, kv, false)); + this->~KrmGetRangesUnalignedActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(RangeResult const& kv,int loopDepth) + { + loopDepth = a_body1cont1(kv, loopDepth); + + return loopDepth; + } + int a_body1when1(RangeResult && kv,int loopDepth) + { + loopDepth = a_body1cont1(std::move(kv), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< KrmGetRangesUnalignedActor, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< KrmGetRangesUnalignedActor, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("krmGetRangesUnaligned", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("krmGetRangesUnaligned", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< KrmGetRangesUnalignedActor, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("krmGetRangesUnaligned", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("krmGetRangesUnaligned", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< KrmGetRangesUnalignedActor, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("krmGetRangesUnaligned", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("krmGetRangesUnaligned", reinterpret_cast(this), 0); + + } + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + Transaction* tr; + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + Key mapPrefix; + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + KeyRange keys; + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + int limit; + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + int limitBytes; + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + GetRangeLimits limits; + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +}; +// This generated class is to be used only via krmGetRangesUnaligned() + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +class KrmGetRangesUnalignedActor final : public Actor, public ActorCallback< KrmGetRangesUnalignedActor, 0, RangeResult >, public FastAllocated, public KrmGetRangesUnalignedActorState { + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< KrmGetRangesUnalignedActor, 0, RangeResult >; + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + KrmGetRangesUnalignedActor(Transaction* const& tr,Key const& mapPrefix,KeyRange const& keys,int const& limit,int const& limitBytes) + #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + : Actor(), + KrmGetRangesUnalignedActorState(tr, mapPrefix, keys, limit, limitBytes) + { + fdb_probe_actor_enter("krmGetRangesUnaligned", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("krmGetRangesUnaligned"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("krmGetRangesUnaligned", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< KrmGetRangesUnalignedActor, 0, RangeResult >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +[[nodiscard]] Future krmGetRangesUnaligned( Transaction* const& tr, Key const& mapPrefix, KeyRange const& keys, int const& limit, int const& limitBytes ) { + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + return Future(new KrmGetRangesUnalignedActor(tr, mapPrefix, keys, limit, limitBytes)); + #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +} + +#line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + + #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +namespace { +// This generated class is to be used only via krmGetRangesUnaligned() + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +template + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +class KrmGetRangesUnalignedActor1State { + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +public: + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + KrmGetRangesUnalignedActor1State(Reference const& tr,Key const& mapPrefix,KeyRange const& keys,int const& limit,int const& limitBytes) + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + : tr(tr), + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + mapPrefix(mapPrefix), + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + keys(keys), + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + limit(limit), + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + limitBytes(limitBytes) + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + { + fdb_probe_actor_create("krmGetRangesUnaligned", reinterpret_cast(this)); + + } + ~KrmGetRangesUnalignedActor1State() + { + fdb_probe_actor_destroy("krmGetRangesUnaligned", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + KeyRange withPrefix = KeyRangeRef(mapPrefix.toString() + keys.begin.toString(), mapPrefix.toString() + keys.end.toString()); + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + limits = GetRangeLimits(limit, limitBytes); + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + limits.minRows = 2; + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StrictFuture __when_expr_0 = tr->getRange(lastLessOrEqual(withPrefix.begin), KeySelectorRef(withPrefix.end, false, +2), limits); + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~KrmGetRangesUnalignedActor1State(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(RangeResult const& kv,int loopDepth) + { + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(krmDecodeRanges(mapPrefix, keys, kv, false)); this->~KrmGetRangesUnalignedActor1State(); static_cast(this)->destroy(); return 0; } + #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(krmDecodeRanges(mapPrefix, keys, kv, false)); + this->~KrmGetRangesUnalignedActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(RangeResult && kv,int loopDepth) + { + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(krmDecodeRanges(mapPrefix, keys, kv, false)); this->~KrmGetRangesUnalignedActor1State(); static_cast(this)->destroy(); return 0; } + #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(krmDecodeRanges(mapPrefix, keys, kv, false)); + this->~KrmGetRangesUnalignedActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(RangeResult const& kv,int loopDepth) + { + loopDepth = a_body1cont1(kv, loopDepth); + + return loopDepth; + } + int a_body1when1(RangeResult && kv,int loopDepth) + { + loopDepth = a_body1cont1(std::move(kv), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< KrmGetRangesUnalignedActor1, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< KrmGetRangesUnalignedActor1, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("krmGetRangesUnaligned", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("krmGetRangesUnaligned", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< KrmGetRangesUnalignedActor1, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("krmGetRangesUnaligned", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("krmGetRangesUnaligned", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< KrmGetRangesUnalignedActor1, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("krmGetRangesUnaligned", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("krmGetRangesUnaligned", reinterpret_cast(this), 0); + + } + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + Reference tr; + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + Key mapPrefix; + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + KeyRange keys; + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + int limit; + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + int limitBytes; + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + GetRangeLimits limits; + #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +}; +// This generated class is to be used only via krmGetRangesUnaligned() + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +class KrmGetRangesUnalignedActor1 final : public Actor, public ActorCallback< KrmGetRangesUnalignedActor1, 0, RangeResult >, public FastAllocated, public KrmGetRangesUnalignedActor1State { + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< KrmGetRangesUnalignedActor1, 0, RangeResult >; + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + KrmGetRangesUnalignedActor1(Reference const& tr,Key const& mapPrefix,KeyRange const& keys,int const& limit,int const& limitBytes) + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" : Actor(), - KrmGetRangesActor1State(tr, mapPrefix, keys, limit, limitBytes) + KrmGetRangesUnalignedActor1State(tr, mapPrefix, keys, limit, limitBytes) { - fdb_probe_actor_enter("krmGetRanges", reinterpret_cast(this), -1); + fdb_probe_actor_enter("krmGetRangesUnaligned", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("krmGetRanges"); + this->lineage.setActorName("krmGetRangesUnaligned"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("krmGetRanges", reinterpret_cast(this), -1); + fdb_probe_actor_exit("krmGetRangesUnaligned", reinterpret_cast(this), -1); } void cancel() override @@ -488,20 +946,20 @@ friend struct ActorCallback< KrmGetRangesActor1, 0, RangeResult >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< KrmGetRangesActor1, 0, RangeResult >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< KrmGetRangesUnalignedActor1, 0, RangeResult >*)0, actor_cancelled()); break; } } }; } - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" -[[nodiscard]] Future krmGetRanges( Reference const& tr, Key const& mapPrefix, KeyRange const& keys, int const& limit, int const& limitBytes ) { - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" - return Future(new KrmGetRangesActor1(tr, mapPrefix, keys, limit, limitBytes)); - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +[[nodiscard]] Future krmGetRangesUnaligned( Reference const& tr, Key const& mapPrefix, KeyRange const& keys, int const& limit, int const& limitBytes ) { + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + return Future(new KrmGetRangesUnalignedActor1(tr, mapPrefix, keys, limit, limitBytes)); + #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } -#line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +#line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" void krmSetPreviouslyEmptyRange(Transaction* tr, const KeyRef& mapPrefix, @@ -526,29 +984,29 @@ void krmSetPreviouslyEmptyRange(CommitTransactionRef& tr, tr.set(trArena, withPrefix.end, oldEndValue); } - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" namespace { // This generated class is to be used only via krmSetRange() - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" template - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" class KrmSetRangeActorState { - #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" public: - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KrmSetRangeActorState(Transaction* const& tr,Key const& mapPrefix,KeyRange const& range,Value const& value) - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" : tr(tr), - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" mapPrefix(mapPrefix), - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" range(range), - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" value(value), - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" withPrefix(KeyRangeRef(mapPrefix.toString() + range.begin.toString(), mapPrefix.toString() + range.end.toString())) - #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { fdb_probe_actor_create("krmSetRange", reinterpret_cast(this)); @@ -561,16 +1019,16 @@ class KrmSetRangeActorState { int a_body1(int loopDepth=0) { try { - #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" StrictFuture __when_expr_0 = tr->getRange(lastLessOrEqual(withPrefix.end), firstGreaterThan(withPrefix.end), 1, Snapshot::True); - #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -591,37 +1049,37 @@ class KrmSetRangeActorState { } int a_body1cont1(RangeResult const& old,int loopDepth) { - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Value oldValue; - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" bool hasResult = old.size() > 0 && old[0].key.startsWith(mapPrefix); - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (hasResult) - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" oldValue = old[0].value; - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange conflictRange = KeyRangeRef(hasResult ? old[0].key : mapPrefix.toString(), keyAfter(withPrefix.end)); - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!conflictRange.empty()) - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->addReadConflictRange(conflictRange); - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->clear(withPrefix); - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->set(withPrefix.begin, value); - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->set(withPrefix.end, oldValue); - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~KrmSetRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~KrmSetRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -631,37 +1089,37 @@ class KrmSetRangeActorState { } int a_body1cont1(RangeResult && old,int loopDepth) { - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Value oldValue; - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" bool hasResult = old.size() > 0 && old[0].key.startsWith(mapPrefix); - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (hasResult) - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" oldValue = old[0].value; - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange conflictRange = KeyRangeRef(hasResult ? old[0].key : mapPrefix.toString(), keyAfter(withPrefix.end)); - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!conflictRange.empty()) - #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->addReadConflictRange(conflictRange); - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->clear(withPrefix); - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->set(withPrefix.begin, value); - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->set(withPrefix.end, oldValue); - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~KrmSetRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~KrmSetRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -732,22 +1190,22 @@ class KrmSetRangeActorState { fdb_probe_actor_exit("krmSetRange", reinterpret_cast(this), 0); } - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Transaction* tr; - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Key mapPrefix; - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange range; - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Value value; - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange withPrefix; - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" }; // This generated class is to be used only via krmSetRange() - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" class KrmSetRangeActor final : public Actor, public ActorCallback< KrmSetRangeActor, 0, RangeResult >, public FastAllocated, public KrmSetRangeActorState { - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -756,9 +1214,9 @@ class KrmSetRangeActor final : public Actor, public ActorCallback< KrmSetR void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< KrmSetRangeActor, 0, RangeResult >; - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KrmSetRangeActor(Transaction* const& tr,Key const& mapPrefix,KeyRange const& range,Value const& value) - #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" : Actor(), KrmSetRangeActorState(tr, mapPrefix, range, value) { @@ -782,38 +1240,38 @@ friend struct ActorCallback< KrmSetRangeActor, 0, RangeResult >; } }; } - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" [[nodiscard]] Future krmSetRange( Transaction* const& tr, Key const& mapPrefix, KeyRange const& range, Value const& value ) { - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" return Future(new KrmSetRangeActor(tr, mapPrefix, range, value)); - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } -#line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +#line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" namespace { // This generated class is to be used only via krmSetRange() - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" template - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" class KrmSetRangeActor1State { - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" public: - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KrmSetRangeActor1State(Reference const& tr,Key const& mapPrefix,KeyRange const& range,Value const& value) - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" : tr(tr), - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" mapPrefix(mapPrefix), - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" range(range), - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" value(value), - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" withPrefix(KeyRangeRef(mapPrefix.toString() + range.begin.toString(), mapPrefix.toString() + range.end.toString())) - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { fdb_probe_actor_create("krmSetRange", reinterpret_cast(this)); @@ -826,16 +1284,16 @@ class KrmSetRangeActor1State { int a_body1(int loopDepth=0) { try { - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" StrictFuture __when_expr_0 = tr->getRange(lastLessOrEqual(withPrefix.end), firstGreaterThan(withPrefix.end), 1, Snapshot::True); - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -856,37 +1314,37 @@ class KrmSetRangeActor1State { } int a_body1cont1(RangeResult const& old,int loopDepth) { - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Value oldValue; - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" bool hasResult = old.size() > 0 && old[0].key.startsWith(mapPrefix); - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (hasResult) - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" oldValue = old[0].value; - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange conflictRange = KeyRangeRef(hasResult ? old[0].key : mapPrefix.toString(), keyAfter(withPrefix.end)); - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!conflictRange.empty()) - #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->addReadConflictRange(conflictRange); - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->clear(withPrefix); - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->set(withPrefix.begin, value); - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->set(withPrefix.end, oldValue); - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~KrmSetRangeActor1State(); static_cast(this)->destroy(); return 0; } - #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~KrmSetRangeActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -896,37 +1354,37 @@ class KrmSetRangeActor1State { } int a_body1cont1(RangeResult && old,int loopDepth) { - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Value oldValue; - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" bool hasResult = old.size() > 0 && old[0].key.startsWith(mapPrefix); - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (hasResult) - #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" oldValue = old[0].value; - #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange conflictRange = KeyRangeRef(hasResult ? old[0].key : mapPrefix.toString(), keyAfter(withPrefix.end)); - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!conflictRange.empty()) - #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->addReadConflictRange(conflictRange); - #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->clear(withPrefix); - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->set(withPrefix.begin, value); - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->set(withPrefix.end, oldValue); - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~KrmSetRangeActor1State(); static_cast(this)->destroy(); return 0; } - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~KrmSetRangeActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -997,22 +1455,22 @@ class KrmSetRangeActor1State { fdb_probe_actor_exit("krmSetRange", reinterpret_cast(this), 0); } - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Reference tr; - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Key mapPrefix; - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange range; - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Value value; - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange withPrefix; - #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" }; // This generated class is to be used only via krmSetRange() - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" class KrmSetRangeActor1 final : public Actor, public ActorCallback< KrmSetRangeActor1, 0, RangeResult >, public FastAllocated, public KrmSetRangeActor1State { - #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1021,9 +1479,9 @@ class KrmSetRangeActor1 final : public Actor, public ActorCallback< KrmSet void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< KrmSetRangeActor1, 0, RangeResult >; - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KrmSetRangeActor1(Reference const& tr,Key const& mapPrefix,KeyRange const& range,Value const& value) - #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" : Actor(), KrmSetRangeActor1State(tr, mapPrefix, range, value) { @@ -1047,41 +1505,41 @@ friend struct ActorCallback< KrmSetRangeActor1, 0, RangeResult >; } }; } - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" [[nodiscard]] Future krmSetRange( Reference const& tr, Key const& mapPrefix, KeyRange const& range, Value const& value ) { - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" return Future(new KrmSetRangeActor1(tr, mapPrefix, range, value)); - #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } -#line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +#line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" // Sets a range of keys in a key range map, coalescing with adjacent regions if the values match // Ranges outside of maxRange will not be coalesced // CAUTION: use care when attempting to coalesce multiple ranges in the same prefix in a single transaction - #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" namespace { // This generated class is to be used only via krmSetRangeCoalescing_() - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" template - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" class KrmSetRangeCoalescing_ActorState { - #line 1069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" public: - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KrmSetRangeCoalescing_ActorState(Transaction* const& tr,Key const& mapPrefix,KeyRange const& range,KeyRange const& maxRange,Value const& value) - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" : tr(tr), - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" mapPrefix(mapPrefix), - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" range(range), - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" maxRange(maxRange), - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" value(value) - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { fdb_probe_actor_create("krmSetRangeCoalescing_", reinterpret_cast(this)); @@ -1094,28 +1552,28 @@ class KrmSetRangeCoalescing_ActorState { int a_body1(int loopDepth=0) { try { - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" ASSERT(maxRange.contains(range)); - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" withPrefix = KeyRangeRef(mapPrefix.toString() + range.begin.toString(), mapPrefix.toString() + range.end.toString()); - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" maxWithPrefix = KeyRangeRef(mapPrefix.toString() + maxRange.begin.toString(), mapPrefix.toString() + maxRange.end.toString()); - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" keys = std::vector>(); - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" keys.push_back( tr->getRange(lastLessThan(withPrefix.begin), firstGreaterOrEqual(withPrefix.begin), 1, Snapshot::True)); - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" keys.push_back( tr->getRange(lastLessOrEqual(withPrefix.end), firstGreaterThan(withPrefix.end) + 1, 2, Snapshot::True)); - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" StrictFuture __when_expr_0 = waitForAll(keys); - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1136,100 +1594,100 @@ class KrmSetRangeCoalescing_ActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" auto beginRange = keys[0].get(); - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" bool hasBegin = beginRange.size() > 0 && beginRange[0].key.startsWith(mapPrefix); - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" - Value beginValue = hasBegin ? beginRange[0].value : LiteralStringRef(""); - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + Value beginValue = hasBegin ? beginRange[0].value : ""_sr; + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" beginKey = withPrefix.begin; - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (beginValue == value) - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" bool outsideRange = !hasBegin || beginRange[0].key < maxWithPrefix.begin; - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" beginKey = outsideRange ? maxWithPrefix.begin : beginRange[0].key; - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } - #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" auto endRange = keys[1].get(); - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" bool hasEnd = endRange.size() >= 1 && endRange[0].key.startsWith(mapPrefix) && endRange[0].key <= withPrefix.end; - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" bool hasNext = (endRange.size() == 2 && endRange[1].key.startsWith(mapPrefix)) || (endRange.size() == 1 && withPrefix.end < endRange[0].key && endRange[0].key.startsWith(mapPrefix)); - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" - Value existingValue = hasEnd ? endRange[0].value : LiteralStringRef(""); - #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + Value existingValue = hasEnd ? endRange[0].value : ""_sr; + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" bool valueMatches = value == existingValue; - #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange conflictRange = KeyRangeRef(hasBegin ? beginRange[0].key : mapPrefix, withPrefix.begin); - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!conflictRange.empty()) - #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->addReadConflictRange(conflictRange); - #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" conflictRange = KeyRangeRef(hasEnd ? endRange[0].key : mapPrefix, hasNext ? keyAfter(endRange.end()[-1].key) : strinc(mapPrefix)); - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!conflictRange.empty()) - #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->addReadConflictRange(conflictRange); - #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } - #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endKey = Key(); - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endValue = Value(); - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (hasNext && endRange.end()[-1].key <= maxWithPrefix.end && valueMatches) - #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endKey = endRange.end()[-1].key; - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endValue = endRange.end()[-1].value; - #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } else { - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (valueMatches) - #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endKey = maxWithPrefix.end; - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endValue = existingValue; - #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } else { - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endKey = withPrefix.end; - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endValue = existingValue; - #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } } - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->clear(KeyRangeRef(beginKey, endKey)); - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" ASSERT(value != endValue || endKey == maxWithPrefix.end); - #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->set(beginKey, value); - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->set(endKey, endValue); - #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~KrmSetRangeCoalescing_ActorState(); static_cast(this)->destroy(); return 0; } - #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~KrmSetRangeCoalescing_ActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1239,100 +1697,100 @@ class KrmSetRangeCoalescing_ActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" auto beginRange = keys[0].get(); - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" bool hasBegin = beginRange.size() > 0 && beginRange[0].key.startsWith(mapPrefix); - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" - Value beginValue = hasBegin ? beginRange[0].value : LiteralStringRef(""); - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + Value beginValue = hasBegin ? beginRange[0].value : ""_sr; + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" beginKey = withPrefix.begin; - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (beginValue == value) - #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" bool outsideRange = !hasBegin || beginRange[0].key < maxWithPrefix.begin; - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" beginKey = outsideRange ? maxWithPrefix.begin : beginRange[0].key; - #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } - #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" auto endRange = keys[1].get(); - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" bool hasEnd = endRange.size() >= 1 && endRange[0].key.startsWith(mapPrefix) && endRange[0].key <= withPrefix.end; - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" bool hasNext = (endRange.size() == 2 && endRange[1].key.startsWith(mapPrefix)) || (endRange.size() == 1 && withPrefix.end < endRange[0].key && endRange[0].key.startsWith(mapPrefix)); - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" - Value existingValue = hasEnd ? endRange[0].value : LiteralStringRef(""); - #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + Value existingValue = hasEnd ? endRange[0].value : ""_sr; + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" bool valueMatches = value == existingValue; - #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange conflictRange = KeyRangeRef(hasBegin ? beginRange[0].key : mapPrefix, withPrefix.begin); - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!conflictRange.empty()) - #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->addReadConflictRange(conflictRange); - #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" conflictRange = KeyRangeRef(hasEnd ? endRange[0].key : mapPrefix, hasNext ? keyAfter(endRange.end()[-1].key) : strinc(mapPrefix)); - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!conflictRange.empty()) - #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->addReadConflictRange(conflictRange); - #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } - #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endKey = Key(); - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endValue = Value(); - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (hasNext && endRange.end()[-1].key <= maxWithPrefix.end && valueMatches) - #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endKey = endRange.end()[-1].key; - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endValue = endRange.end()[-1].value; - #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } else { - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (valueMatches) - #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" { - #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endKey = maxWithPrefix.end; - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endValue = existingValue; - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } else { - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endKey = withPrefix.end; - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" endValue = existingValue; - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } } - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->clear(KeyRangeRef(beginKey, endKey)); - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" ASSERT(value != endValue || endKey == maxWithPrefix.end); - #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->set(beginKey, value); - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" tr->set(endKey, endValue); - #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~KrmSetRangeCoalescing_ActorState(); static_cast(this)->destroy(); return 0; } - #line 1335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~KrmSetRangeCoalescing_ActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1403,36 +1861,36 @@ class KrmSetRangeCoalescing_ActorState { fdb_probe_actor_exit("krmSetRangeCoalescing_", reinterpret_cast(this), 0); } - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Transaction* tr; - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Key mapPrefix; - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange range; - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange maxRange; - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Value value; - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange withPrefix; - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KeyRange maxWithPrefix; - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" std::vector> keys; - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Key beginKey; - #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Key endKey; - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Value endValue; - #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" }; // This generated class is to be used only via krmSetRangeCoalescing_() - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" template - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" class KrmSetRangeCoalescing_Actor final : public Actor, public ActorCallback< KrmSetRangeCoalescing_Actor, 0, Void >, public FastAllocated>, public KrmSetRangeCoalescing_ActorState> { - #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -1441,9 +1899,9 @@ class KrmSetRangeCoalescing_Actor final : public Actor, public ActorCallba void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< KrmSetRangeCoalescing_Actor, 0, Void >; - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" KrmSetRangeCoalescing_Actor(Transaction* const& tr,Key const& mapPrefix,KeyRange const& range,KeyRange const& maxRange,Value const& value) - #line 1446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" : Actor(), KrmSetRangeCoalescing_ActorState>(tr, mapPrefix, range, maxRange, value) { @@ -1467,16 +1925,16 @@ friend struct ActorCallback< KrmSetRangeCoalescing_Actor, 0, Void > } }; } - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" template - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" [[nodiscard]] static Future krmSetRangeCoalescing_( Transaction* const& tr, Key const& mapPrefix, KeyRange const& range, KeyRange const& maxRange, Value const& value ) { - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" return Future(new KrmSetRangeCoalescing_Actor(tr, mapPrefix, range, maxRange, value)); - #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" } -#line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +#line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" Future krmSetRangeCoalescing(Transaction* const& tr, Key const& mapPrefix, KeyRange const& range, @@ -1491,3 +1949,352 @@ Future krmSetRangeCoalescing(Reference const& t Value const& value) { return holdWhile(tr, krmSetRangeCoalescing_(tr.getPtr(), mapPrefix, range, maxRange, value)); } + + #line 1953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase318() + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +template + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +class FlowTestCase318ActorState { + #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +public: + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + FlowTestCase318ActorState(UnitTestParameters const& params) + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + : params(params) + #line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase318", reinterpret_cast(this)); + + } + ~FlowTestCase318ActorState() + { + fdb_probe_actor_destroy("flowTestCase318", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + Arena arena; + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + Key prefix = "/prefix/"_sr; + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef fullKeyA = StringRef(arena, "/prefix/a"_sr); + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef fullKeyB = StringRef(arena, "/prefix/b"_sr); + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef fullKeyC = StringRef(arena, "/prefix/c"_sr); + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef fullKeyD = StringRef(arena, "/prefix/d"_sr); + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyA = StringRef(arena, "a"_sr); + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyB = StringRef(arena, "b"_sr); + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyC = StringRef(arena, "c"_sr); + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyD = StringRef(arena, "d"_sr); + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyE = StringRef(arena, "e"_sr); + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyAB = StringRef(arena, "ab"_sr); + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyAC = StringRef(arena, "ac"_sr); + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyCD = StringRef(arena, "cd"_sr); + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + RangeResult kv; + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + kv.push_back(arena, KeyValueRef(fullKeyA, keyA)); + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + kv.push_back(arena, KeyValueRef(fullKeyB, keyB)); + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + RangeResult decodedRanges = krmDecodeRanges(prefix, KeyRangeRef(keyAB, keyAC), kv); + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.size() == 2); + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.front().key == keyAB); + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.front().value == keyA); + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.back().key == keyAC); + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.back().value == keyA); + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + kv.push_back(arena, KeyValueRef(fullKeyC, keyC)); + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + kv.push_back(arena, KeyValueRef(fullKeyD, keyD)); + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + decodedRanges = krmDecodeRanges(prefix, KeyRangeRef(keyAB, keyCD), kv); + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.size() == 4); + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.front().key == keyAB); + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.front().value == keyA); + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.back().key == keyCD); + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.back().value == keyC); + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + decodedRanges = krmDecodeRanges(prefix, KeyRangeRef(StringRef(), keyE), kv); + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.size() == 6); + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.front().key == StringRef()); + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.front().value == StringRef()); + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.back().key == keyE); + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.back().value == keyD); + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase318ActorState(); static_cast(this)->destroy(); return 0; } + #line 2056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase318ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase318ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + UnitTestParameters params; + #line 2080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase318() + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +class FlowTestCase318Actor final : public Actor, public FastAllocated, public FlowTestCase318ActorState { + #line 2085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + FlowTestCase318Actor(UnitTestParameters const& params) + #line 2095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + : Actor(), + FlowTestCase318ActorState(params) + { + fdb_probe_actor_enter("flowTestCase318", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase318"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase318", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +static Future flowTestCase318( UnitTestParameters const& params ) { + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + return Future(new FlowTestCase318Actor(params)); + #line 2122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase318, "/keyrangemap/decoderange/aligned") + +#line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + + #line 2128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase370() + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +template + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +class FlowTestCase370ActorState { + #line 2135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +public: + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + FlowTestCase370ActorState(UnitTestParameters const& params) + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + : params(params) + #line 2142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase370", reinterpret_cast(this)); + + } + ~FlowTestCase370ActorState() + { + fdb_probe_actor_destroy("flowTestCase370", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + Arena arena; + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + Key prefix = "/prefix/"_sr; + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef fullKeyA = StringRef(arena, "/prefix/a"_sr); + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef fullKeyB = StringRef(arena, "/prefix/b"_sr); + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef fullKeyC = StringRef(arena, "/prefix/c"_sr); + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef fullKeyD = StringRef(arena, "/prefix/d"_sr); + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyA = StringRef(arena, "a"_sr); + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyB = StringRef(arena, "b"_sr); + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyC = StringRef(arena, "c"_sr); + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyD = StringRef(arena, "d"_sr); + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyE = StringRef(arena, "e"_sr); + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyAB = StringRef(arena, "ab"_sr); + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyAC = StringRef(arena, "ac"_sr); + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + StringRef keyCD = StringRef(arena, "cd"_sr); + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + RangeResult kv; + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + kv.push_back(arena, KeyValueRef(fullKeyA, keyA)); + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + kv.push_back(arena, KeyValueRef(fullKeyB, keyB)); + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + RangeResult decodedRanges = krmDecodeRanges(prefix, KeyRangeRef(keyAB, keyAC), kv, false); + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.size() == 2); + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.front().key == keyA); + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.front().value == keyA); + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.back().key == keyB); + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.back().value == keyB); + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + kv.push_back(arena, KeyValueRef(fullKeyC, keyC)); + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + kv.push_back(arena, KeyValueRef(fullKeyD, keyD)); + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + decodedRanges = krmDecodeRanges(prefix, KeyRangeRef(keyAB, keyCD), kv, false); + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.size() == 4); + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.front().key == keyA); + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.front().value == keyA); + #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.back().key == keyD); + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.back().value == keyD); + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + decodedRanges = krmDecodeRanges(prefix, KeyRangeRef(StringRef(), keyE), kv, false); + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.size() == 6); + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.front().key == StringRef()); + #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.front().value == StringRef()); + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.back().key == keyE); + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + ASSERT(decodedRanges.back().value == keyD); + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase370ActorState(); static_cast(this)->destroy(); return 0; } + #line 2231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase370ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase370ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + UnitTestParameters params; + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase370() + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +class FlowTestCase370Actor final : public Actor, public FastAllocated, public FlowTestCase370ActorState { + #line 2260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + FlowTestCase370Actor(UnitTestParameters const& params) + #line 2270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" + : Actor(), + FlowTestCase370ActorState(params) + { + fdb_probe_actor_enter("flowTestCase370", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase370"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase370", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" +static Future flowTestCase370( UnitTestParameters const& params ) { + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.cpp" + return Future(new FlowTestCase370Actor(params)); + #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/KeyRangeMap.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase370, "/keyrangemap/decoderange/unaligned") + diff --git a/src/fdbclient/LinkTest.cpp b/src/fdbclient/LinkTest.cpp new file mode 100644 index 0000000..73dcd81 --- /dev/null +++ b/src/fdbclient/LinkTest.cpp @@ -0,0 +1,8 @@ +// When creating a static or shared library, undefined symbols will be ignored. +// Since we want to ensure no symbols from other modules are used, each module +// will create an executable so the linker will throw errors if it can't find +// the declaration of a symbol. This class defines a dummy main function so the +// executable can be built. +int main() { + return 0; +} diff --git a/src/fdbclient/ManagementAPI.actor.cpp b/src/fdbclient/ManagementAPI.actor.cpp index fd8265d..9799a2b 100644 --- a/src/fdbclient/ManagementAPI.actor.cpp +++ b/src/fdbclient/ManagementAPI.actor.cpp @@ -22,6 +22,7 @@ #include #include +#include "fdbclient/GenericManagementAPI.actor.h" #include "fmt/format.h" #include "fdbclient/Knobs.h" #include "flow/Arena.h" @@ -42,6 +43,7 @@ #include "fdbrpc/ReplicationPolicy.h" #include "fdbrpc/Replication.h" #include "fdbclient/Schemas.h" +#include "fdbrpc/SimulatorProcessInfo.h" #include "flow/actorcompiler.h" // This must be the last #include. @@ -200,6 +202,22 @@ std::map configForToken(std::string const& mode) { } out[p + key] = format("%d", tenantMode); } + + if (key == "encryption_at_rest_mode") { + EncryptionAtRestMode mode; + if (value == "disabled") { + mode = EncryptionAtRestMode::DISABLED; + } else if (value == "domain_aware") { + mode = EncryptionAtRestMode::DOMAIN_AWARE; + } else if (value == "cluster_aware") { + mode = EncryptionAtRestMode::CLUSTER_AWARE; + } else { + printf("Error: Only disabled|domain_aware|cluster_aware are valid for encryption_at_rest_mode.\n"); + return out; + } + out[p + key] = format("%d", mode); + } + if (key == "exclude") { int p = 0; while (p < value.size()) { @@ -218,7 +236,7 @@ std::map configForToken(std::string const& mode) { } } - if (key == "perpetual_storage_wiggle_engine") { + if (key == "storage_engine" || key == "log_engine" || key == "perpetual_storage_wiggle_engine") { StringRef s = value; // Parse as engine_name[:p=v]... to handle future storage engine params @@ -235,23 +253,31 @@ std::map configForToken(std::string const& mode) { } return out; } + return out; } Optional logType; Optional storeType; + + // These are legacy shorthand commands to set a specific log engine and storage engine + // based only on the storage engine name. Most of them assume SQLite should be the + // log engine. if (mode == "ssd-1") { logType = KeyValueStoreType::SSD_BTREE_V1; storeType = KeyValueStoreType::SSD_BTREE_V1; } else if (mode == "ssd" || mode == "ssd-2") { logType = KeyValueStoreType::SSD_BTREE_V2; storeType = KeyValueStoreType::SSD_BTREE_V2; - } else if (mode == "ssd-redwood-1-experimental") { + } else if (mode == "ssd-redwood-1" || mode == "ssd-redwood-1-experimental") { logType = KeyValueStoreType::SSD_BTREE_V2; storeType = KeyValueStoreType::SSD_REDWOOD_V1; } else if (mode == "ssd-rocksdb-v1") { logType = KeyValueStoreType::SSD_BTREE_V2; storeType = KeyValueStoreType::SSD_ROCKSDB_V1; + } else if (mode == "ssd-sharded-rocksdb") { + logType = KeyValueStoreType::SSD_BTREE_V2; + storeType = KeyValueStoreType::SSD_SHARDED_ROCKSDB; } else if (mode == "memory" || mode == "memory-2") { logType = KeyValueStoreType::SSD_BTREE_V2; storeType = KeyValueStoreType::MEMORY; @@ -266,7 +292,7 @@ std::map configForToken(std::string const& mode) { if (storeType.present()) { out[p + "log_engine"] = format("%d", logType.get().storeType()); - out[p + "storage_engine"] = format("%d", KeyValueStoreType::StoreType(storeType.get())); + out[p + "storage_engine"] = format("%d", storeType.get().storeType()); return out; } @@ -403,7 +429,10 @@ ConfigurationResult buildConfiguration(std::vector const& modeTokens, for (auto t = m.begin(); t != m.end(); ++t) { if (outConf.count(t->first)) { - TraceEvent(SevWarnAlways, "ConflictingOption").detail("Option", t->first); + TraceEvent(SevWarnAlways, "ConflictingOption") + .detail("Option", t->first) + .detail("Value", t->second) + .detail("ExistingValue", outConf[t->first]); return ConfigurationResult::CONFLICTING_OPTIONS; } outConf[t->first] = t->second; @@ -482,16 +511,186 @@ bool isCompleteConfiguration(std::map const& options) options.count(p + "storage_engine") == 1; } -ACTOR Future getDatabaseConfiguration(Database cx) { +/* + - Validates encryption and tenant mode configurations + - During cluster creation (configure new) we allow the following: + - If encryption mode is disabled/cluster_aware then any tenant mode is allowed + - If the encryption mode is domain_aware then the only allowed tenant mode is required + - During cluster configuration changes the following is allowed: + - Encryption mode cannot be changed (can only be set during creation) + - If the encryption mode is disabled/cluster_aware then any tenant mode changes are allowed + - If the encryption mode is domain_aware then tenant mode changes are not allowed (as the only supported mode is + required) +*/ +bool isEncryptionAtRestModeConfigValid(Optional oldConfiguration, + std::map newConfig, + bool creating) { + EncryptionAtRestMode encryptMode; + TenantMode tenantMode; + if (creating) { + if (newConfig.count(encryptionAtRestModeConfKey.toString()) != 0) { + encryptMode = EncryptionAtRestMode::fromValueRef( + ValueRef(newConfig.find(encryptionAtRestModeConfKey.toString())->second)); + // check if the tenant mode is being set during configure new (otherwise assume tenants are disabled) + if (newConfig.count(tenantModeConfKey.toString()) != 0) { + tenantMode = TenantMode::fromValue(ValueRef(newConfig.find(tenantModeConfKey.toString())->second)); + } + } + } else { + ASSERT(oldConfiguration.present()); + encryptMode = oldConfiguration.get().encryptionAtRestMode; + if (newConfig.count(tenantModeConfKey.toString()) != 0) { + tenantMode = TenantMode::fromValue(ValueRef(newConfig.find(tenantModeConfKey.toString())->second)); + } else { + // Tenant mode and encryption mode didn't change + return true; + } + } + TraceEvent(SevDebug, "EncryptAndTenantModes") + .detail("EncryptMode", encryptMode.toString()) + .detail("TenantMode", tenantMode.toString()); + + if (encryptMode.mode == EncryptionAtRestMode::DOMAIN_AWARE && tenantMode != TenantMode::REQUIRED) { + // For domain aware encryption only the required tenant mode is currently supported + TraceEvent(SevWarnAlways, "InvalidEncryptAndTenantConfiguration") + .detail("EncryptMode", encryptMode.toString()) + .detail("TenantMode", tenantMode.toString()); + return false; + } + + return true; +} + +bool isTenantModeModeConfigValid(DatabaseConfiguration oldConfiguration, DatabaseConfiguration newConfiguration) { + TenantMode oldTenantMode = oldConfiguration.tenantMode; + TenantMode newTenantMode = newConfiguration.tenantMode; + TraceEvent(SevDebug, "TenantModes") + .detail("OldTenantMode", oldTenantMode.toString()) + .detail("NewTenantMode", newTenantMode.toString()); + if (oldTenantMode != TenantMode::REQUIRED && newTenantMode == TenantMode::REQUIRED) { + // TODO: Changing from optional/disabled to required tenant mode should be allowed if there is no non-tenant + // data present + TraceEvent(SevWarnAlways, "InvalidTenantConfiguration") + .detail("OldTenantMode", oldTenantMode.toString()) + .detail("NewTenantMode", newTenantMode.toString()); + return false; + } + return true; +} + +TEST_CASE("/ManagementAPI/ChangeConfig/TenantMode") { + DatabaseConfiguration oldConfig; + DatabaseConfiguration newConfig; + std::vector tenantModes = { TenantMode::DISABLED, TenantMode::OPTIONAL_TENANT, TenantMode::REQUIRED }; + // required tenant mode can change to any other tenant mode + oldConfig.tenantMode = TenantMode::REQUIRED; + newConfig.tenantMode = deterministicRandom()->randomChoice(tenantModes); + ASSERT(isTenantModeModeConfigValid(oldConfig, newConfig)); + // optional/disabled tenant mode can switch to optional/disabled tenant mode + oldConfig.tenantMode = deterministicRandom()->coinflip() ? TenantMode::DISABLED : TenantMode::OPTIONAL_TENANT; + newConfig.tenantMode = deterministicRandom()->coinflip() ? TenantMode::DISABLED : TenantMode::OPTIONAL_TENANT; + ASSERT(isTenantModeModeConfigValid(oldConfig, newConfig)); + // optional/disabled tenant mode CANNOT switch to required tenant mode + oldConfig.tenantMode = deterministicRandom()->coinflip() ? TenantMode::DISABLED : TenantMode::OPTIONAL_TENANT; + newConfig.tenantMode = TenantMode::REQUIRED; + ASSERT(!isTenantModeModeConfigValid(oldConfig, newConfig)); + + return Void(); +} + +// unit test for changing encryption/tenant mode config options +TEST_CASE("/ManagementAPI/ChangeConfig/TenantAndEncryptMode") { + std::map newConfig; + std::string encryptModeKey = encryptionAtRestModeConfKey.toString(); + std::string tenantModeKey = tenantModeConfKey.toString(); + std::vector tenantModes = { TenantMode::DISABLED, TenantMode::OPTIONAL_TENANT, TenantMode::REQUIRED }; + std::vector encryptionModes = { EncryptionAtRestMode::DISABLED, + EncryptionAtRestMode::CLUSTER_AWARE, + EncryptionAtRestMode::DOMAIN_AWARE }; + // configure new test cases + + // encryption disabled checks + newConfig[encryptModeKey] = std::to_string(EncryptionAtRestMode::DISABLED); + newConfig[tenantModeKey] = std::to_string(deterministicRandom()->randomChoice(tenantModes)); + ASSERT(isEncryptionAtRestModeConfigValid(Optional(), newConfig, true)); + + // cluster aware encryption checks + newConfig[encryptModeKey] = std::to_string(EncryptionAtRestMode::CLUSTER_AWARE); + newConfig[tenantModeKey] = std::to_string(deterministicRandom()->randomChoice(tenantModes)); + ASSERT(isEncryptionAtRestModeConfigValid(Optional(), newConfig, true)); + + // domain aware encryption checks + newConfig[encryptModeKey] = std::to_string(EncryptionAtRestMode::DOMAIN_AWARE); + newConfig[tenantModeKey] = + std::to_string(deterministicRandom()->coinflip() ? TenantMode::DISABLED : TenantMode::OPTIONAL_TENANT); + ASSERT(!isEncryptionAtRestModeConfigValid(Optional(), newConfig, true)); + newConfig[tenantModeKey] = std::to_string(TenantMode::REQUIRED); + ASSERT(isEncryptionAtRestModeConfigValid(Optional(), newConfig, true)); + + // no encrypt mode present + newConfig.erase(encryptModeKey); + newConfig[tenantModeKey] = std::to_string(deterministicRandom()->randomChoice(tenantModes)); + ASSERT(isEncryptionAtRestModeConfigValid(Optional(), newConfig, true)); + + // no tenant mode present + newConfig.erase(tenantModeKey); + newConfig[encryptModeKey] = std::to_string(EncryptionAtRestMode::DOMAIN_AWARE); + ASSERT(!isEncryptionAtRestModeConfigValid(Optional(), newConfig, true)); + newConfig[encryptModeKey] = std::to_string(EncryptionAtRestMode::CLUSTER_AWARE); + ASSERT(isEncryptionAtRestModeConfigValid(Optional(), newConfig, true)); + + // change config test cases + DatabaseConfiguration oldConfig; + + // encryption disabled checks + oldConfig.encryptionAtRestMode = EncryptionAtRestMode::DISABLED; + oldConfig.tenantMode = deterministicRandom()->randomChoice(tenantModes); + newConfig[tenantModeKey] = std::to_string(deterministicRandom()->randomChoice(tenantModes)); + ASSERT(isEncryptionAtRestModeConfigValid(oldConfig, newConfig, false)); + + // domain aware encryption checks + oldConfig.encryptionAtRestMode = EncryptionAtRestMode::DOMAIN_AWARE; + oldConfig.tenantMode = TenantMode::REQUIRED; + newConfig[tenantModeKey] = + std::to_string(deterministicRandom()->coinflip() ? TenantMode::DISABLED : TenantMode::OPTIONAL_TENANT); + ASSERT(!isEncryptionAtRestModeConfigValid(oldConfig, newConfig, false)); + newConfig[tenantModeKey] = std::to_string(TenantMode::REQUIRED); + ASSERT(isEncryptionAtRestModeConfigValid(oldConfig, newConfig, false)); + + // cluster aware encryption checks + oldConfig.encryptionAtRestMode = EncryptionAtRestMode::CLUSTER_AWARE; + // required tenant mode can switch to any other tenant mode with cluster aware encryption + oldConfig.tenantMode = deterministicRandom()->randomChoice(tenantModes); + newConfig[tenantModeKey] = std::to_string(deterministicRandom()->randomChoice(tenantModes)); + ASSERT(isEncryptionAtRestModeConfigValid(oldConfig, newConfig, false)); + + // no tenant mode present + newConfig.erase(tenantModeKey); + oldConfig.tenantMode = deterministicRandom()->randomChoice(tenantModes); + oldConfig.encryptionAtRestMode = deterministicRandom()->randomChoice(encryptionModes); + ASSERT(isEncryptionAtRestModeConfigValid(oldConfig, newConfig, false)); + + return Void(); +} + +ACTOR Future getDatabaseConfiguration(Transaction* tr, bool useSystemPriority) { + if (useSystemPriority) { + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + } + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + RangeResult res = wait(tr->getRange(configKeys, CLIENT_KNOBS->TOO_MANY)); + ASSERT(res.size() < CLIENT_KNOBS->TOO_MANY); + DatabaseConfiguration config; + config.fromKeyValues((VectorRef)res); + return config; +} + +ACTOR Future getDatabaseConfiguration(Database cx, bool useSystemPriority) { state Transaction tr(cx); loop { try { - tr.setOption(FDBTransactionOptions::READ_LOCK_AWARE); - tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - RangeResult res = wait(tr.getRange(configKeys, CLIENT_KNOBS->TOO_MANY)); - ASSERT(res.size() < CLIENT_KNOBS->TOO_MANY); - DatabaseConfiguration config; - config.fromKeyValues((VectorRef)res); + DatabaseConfiguration config = wait(getDatabaseConfiguration(&tr, useSystemPriority)); return config; } catch (Error& e) { wait(tr.onError(e)); @@ -830,29 +1029,128 @@ ACTOR Future> getConnectionString(Database cx) } } -ACTOR Future> changeQuorumChecker(Transaction* tr, - ClusterConnectionString* conn, - std::string newName) { +static std::vector connectionStrings; + +namespace { + +ACTOR Future> getClusterConnectionStringFromStorageServer(Transaction* tr) { + tr->setOption(FDBTransactionOptions::LOCK_AWARE); tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr->setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - Optional currentKey = wait(tr->get(coordinatorsKey)); - if (!currentKey.present()) - return CoordinatorsResult::BAD_DATABASE_STATE; // Someone deleted this key entirely? + state int retryTimes = 0; + loop { + if (retryTimes >= CLIENT_KNOBS->CHANGE_QUORUM_BAD_STATE_RETRY_TIMES) { + return Optional(); + } + + Version readVersion = wait(tr->getReadVersion()); + state Optional currentKey = wait(tr->get(coordinatorsKey)); + if (g_network->isSimulated() && currentKey.present()) { + // If the change coordinators request succeeded, the coordinators + // should have changed to the connection string of the most + // recently issued request. If instead the connection string is + // equal to one of the previously issued requests, there is a bug + // and we are breaking the promises we make with + // commit_unknown_result (the transaction must no longer be in + // progress when receiving commit_unknown_result). + int n = connectionStrings.size() > 0 ? connectionStrings.size() - 1 : 0; // avoid underflow + for (int i = 0; i < n; ++i) { + ASSERT(currentKey.get() != connectionStrings.at(i)); + } + } + + if (!currentKey.present()) { + // Someone deleted this key entirely? + ++retryTimes; + wait(delay(CLIENT_KNOBS->CHANGE_QUORUM_BAD_STATE_RETRY_DELAY)); + continue; + } - state ClusterConnectionString old(currentKey.get().toString()); - if (tr->getDatabase()->getConnectionRecord() && - old.clusterKeyName().toString() != - tr->getDatabase()->getConnectionRecord()->getConnectionString().clusterKeyName()) - return CoordinatorsResult::BAD_DATABASE_STATE; // Someone changed the "name" of the database?? + state ClusterConnectionString clusterConnectionString(currentKey.get().toString()); + if (tr->getDatabase()->getConnectionRecord() && + clusterConnectionString.clusterKeyName().toString() != + tr->getDatabase()->getConnectionRecord()->getConnectionString().clusterKeyName()) { + // Someone changed the "name" of the database?? + ++retryTimes; + wait(delay(CLIENT_KNOBS->CHANGE_QUORUM_BAD_STATE_RETRY_DELAY)); + continue; + } + + return clusterConnectionString; + } +} + +ACTOR Future verifyConfigurationDatabaseAlive(Database cx) { + state Backoff backoff; + state Reference configTr; + loop { + try { + // Attempt to read a random value from the configuration + // database to make sure it is online. + configTr = ISingleThreadTransaction::create(ISingleThreadTransaction::Type::PAXOS_CONFIG, cx); + Tuple tuple; + tuple.appendNull(); // config class + tuple << "test"_sr; + Optional serializedValue = wait(configTr->get(tuple.pack())); + TraceEvent("ChangeQuorumCheckerNewCoordinatorsOnline").log(); + return Void(); + } catch (Error& e) { + TraceEvent("ChangeQuorumCheckerNewCoordinatorsError").error(e); + if (e.code() == error_code_coordinators_changed) { + wait(backoff.onError()); + configTr->reset(); + } else { + wait(configTr->onError(e)); + } + } + } +} + +ACTOR Future resetPreviousCoordinatorsKey(Database cx) { + loop { + // When the change coordinators transaction succeeds, it uses the + // special key space error message to return a message to the client. + // This causes the underlying transaction to not be committed. In order + // to make sure we clear the previous coordinators key, we have to use + // a new transaction here. + state Reference clearTr = + ISingleThreadTransaction::create(ISingleThreadTransaction::Type::RYW, cx); + try { + clearTr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + clearTr->clear(previousCoordinatorsKey); + wait(clearTr->commit()); + return Void(); + } catch (Error& e2) { + wait(clearTr->onError(e2)); + } + } +} + +} // namespace + +ACTOR Future> changeQuorumChecker(Transaction* tr, + ClusterConnectionString* conn, + std::string newName, + bool disableConfigDB) { + TraceEvent("ChangeQuorumCheckerStart").detail("NewConnectionString", conn->toString()); + state Optional clusterConnectionStringOptional = + wait(getClusterConnectionStringFromStorageServer(tr)); + + if (!clusterConnectionStringOptional.present()) { + return CoordinatorsResult::BAD_DATABASE_STATE; + } + + // The cluster connection string stored in the storage server + state ClusterConnectionString old = clusterConnectionStringOptional.get(); if (conn->hostnames.size() + conn->coords.size() == 0) { conn->hostnames = old.hostnames; conn->coords = old.coords; } - std::vector desiredCoordinators = wait(conn->tryResolveHostnames()); + state std::vector desiredCoordinators = wait(conn->tryResolveHostnames()); if (desiredCoordinators.size() != conn->hostnames.size() + conn->coords.size()) { TraceEvent("ChangeQuorumCheckerEarlyTermination") .detail("Reason", "One or more hostnames are unresolvable") @@ -868,16 +1166,34 @@ ACTOR Future> changeQuorumChecker(Transaction* tr, std::sort(old.hostnames.begin(), old.hostnames.end()); std::sort(old.coords.begin(), old.coords.end()); if (conn->hostnames == old.hostnames && conn->coords == old.coords && old.clusterKeyName() == newName) { + connectionStrings.clear(); + if (g_network->isSimulated() && g_simulator->configDBType == ConfigDBType::DISABLED) { + disableConfigDB = true; + } + if (!disableConfigDB) { + wait(verifyConfigurationDatabaseAlive(tr->getDatabase())); + } + if (BUGGIFY_WITH_PROB(0.1)) { + // Introduce a random delay in simulation to allow processes to be + // killed before previousCoordinatorKeys has been reset. This will + // help test scenarios where the previous configuration database + // state has been transferred to the new coordinators but the + // broadcaster thinks it has not been transferred. + wait(delay(deterministicRandom()->random01() * 10)); + } + wait(resetPreviousCoordinatorsKey(tr->getDatabase())); return CoordinatorsResult::SAME_NETWORK_ADDRESSES; } conn->parseKey(newName + ':' + deterministicRandom()->randomAlphaNumeric(32)); + connectionStrings.push_back(conn->toString()); if (g_network->isSimulated()) { int i = 0; int protectedCount = 0; - while ((protectedCount < ((desiredCoordinators.size() / 2) + 1)) && (i < desiredCoordinators.size())) { - auto process = g_simulator.getProcessByAddress(desiredCoordinators[i]); + int minimumCoordinators = (desiredCoordinators.size() / 2) + 1; + while (protectedCount < minimumCoordinators && i < desiredCoordinators.size()) { + auto process = g_simulator->getProcessByAddress(desiredCoordinators[i]); auto addresses = process->addresses; if (!process->isReliable()) { @@ -885,14 +1201,23 @@ ACTOR Future> changeQuorumChecker(Transaction* tr, continue; } - g_simulator.protectedAddresses.insert(process->addresses.address); + g_simulator->protectedAddresses.insert(process->addresses.address); if (addresses.secondaryAddress.present()) { - g_simulator.protectedAddresses.insert(process->addresses.secondaryAddress.get()); + g_simulator->protectedAddresses.insert(process->addresses.secondaryAddress.get()); } TraceEvent("ProtectCoordinator").detail("Address", desiredCoordinators[i]).backtrace(); protectedCount++; i++; } + + if (protectedCount < minimumCoordinators) { + TraceEvent("NotEnoughReliableCoordinators") + .detail("NumReliable", protectedCount) + .detail("MinimumRequired", minimumCoordinators) + .detail("ConnectionString", conn->toString()); + + return CoordinatorsResult::COORDINATOR_UNREACHABLE; + } } std::vector>> leaderServers; @@ -918,6 +1243,9 @@ ACTOR Future> changeQuorumChecker(Transaction* tr, return CoordinatorsResult::COORDINATOR_UNREACHABLE; } } + TraceEvent("ChangeQuorumCheckerSetCoordinatorsKey") + .detail("CurrentCoordinators", old.toString()) + .detail("NewCoordinators", conn->toString()); tr->set(coordinatorsKey, conn->toString()); return Optional(); } @@ -930,28 +1258,26 @@ ACTOR Future changeQuorum(Database cx, Reference currentKey = wait(tr.get(coordinatorsKey)); + state Optional clusterConnectionStringOptional = + wait(getClusterConnectionStringFromStorageServer(&tr)); - if (!currentKey.present()) - return CoordinatorsResult::BAD_DATABASE_STATE; // Someone deleted this key entirely? + if (!clusterConnectionStringOptional.present()) { + return CoordinatorsResult::BAD_DATABASE_STATE; + } - state ClusterConnectionString old(currentKey.get().toString()); - if (cx->getConnectionRecord() && - old.clusterKeyName().toString() != cx->getConnectionRecord()->getConnectionString().clusterKeyName()) - return CoordinatorsResult::BAD_DATABASE_STATE; // Someone changed the "name" of the database?? + // The cluster connection string stored in the storage server + state ClusterConnectionString oldClusterConnectionString = clusterConnectionStringOptional.get(); + state Key oldClusterKeyName = oldClusterConnectionString.clusterKeyName(); - state std::vector oldCoordinators = wait(old.tryResolveHostnames()); + state std::vector oldCoordinators = wait(oldClusterConnectionString.tryResolveHostnames()); state CoordinatorsResult result = CoordinatorsResult::SUCCESS; if (!desiredCoordinators.size()) { - std::vector _desiredCoordinators = wait(change->getDesiredCoordinators( - &tr, - oldCoordinators, - Reference(new ClusterConnectionMemoryRecord(old)), - result)); + std::vector _desiredCoordinators = wait( + change->getDesiredCoordinators(&tr, + oldCoordinators, + Reference( + new ClusterConnectionMemoryRecord(oldClusterConnectionString)), + result)); desiredCoordinators = _desiredCoordinators; } @@ -971,40 +1297,44 @@ ACTOR Future changeQuorum(Database cx, ReferencegetDesiredClusterKeyName(); if (newName.empty()) - newName = old.clusterKeyName().toString(); + newName = oldClusterKeyName.toString(); - if (oldCoordinators == desiredCoordinators && old.clusterKeyName() == newName) + if (oldCoordinators == desiredCoordinators && oldClusterKeyName == newName) return retries ? CoordinatorsResult::SUCCESS : CoordinatorsResult::SAME_NETWORK_ADDRESSES; - state ClusterConnectionString conn( + state ClusterConnectionString newClusterConnectionString( desiredCoordinators, StringRef(newName + ':' + deterministicRandom()->randomAlphaNumeric(32))); + state Key newClusterKeyName = newClusterConnectionString.clusterKeyName(); if (g_network->isSimulated()) { for (int i = 0; i < (desiredCoordinators.size() / 2) + 1; i++) { - auto process = g_simulator.getProcessByAddress(desiredCoordinators[i]); + auto process = g_simulator->getProcessByAddress(desiredCoordinators[i]); ASSERT(process->isReliable() || process->rebooting); - g_simulator.protectedAddresses.insert(process->addresses.address); + g_simulator->protectedAddresses.insert(process->addresses.address); if (process->addresses.secondaryAddress.present()) { - g_simulator.protectedAddresses.insert(process->addresses.secondaryAddress.get()); + g_simulator->protectedAddresses.insert(process->addresses.secondaryAddress.get()); } TraceEvent("ProtectCoordinator").detail("Address", desiredCoordinators[i]).backtrace(); } } - TraceEvent("AttemptingQuorumChange").detail("FromCS", old.toString()).detail("ToCS", conn.toString()); - TEST(old.clusterKeyName() != conn.clusterKeyName()); // Quorum change with new name - TEST(old.clusterKeyName() == conn.clusterKeyName()); // Quorum change with unchanged name + TraceEvent("AttemptingQuorumChange") + .detail("FromCS", oldClusterConnectionString.toString()) + .detail("ToCS", newClusterConnectionString.toString()); + CODE_PROBE(oldClusterKeyName != newClusterKeyName, "Quorum change with new name"); + CODE_PROBE(oldClusterKeyName == newClusterKeyName, "Quorum change with unchanged name"); state std::vector>> leaderServers; - state ClientCoordinators coord( - Reference(new ClusterConnectionMemoryRecord(conn))); + state ClientCoordinators coord(Reference( + new ClusterConnectionMemoryRecord(newClusterConnectionString))); // check if allowed to modify the cluster descriptor if (!change->getDesiredClusterKeyName().empty()) { CheckDescriptorMutableReply mutabilityReply = wait(coord.clientLeaderServers[0].checkDescriptorMutable.getReply(CheckDescriptorMutableRequest())); - if (!mutabilityReply.isMutable) + if (!mutabilityReply.isMutable) { return CoordinatorsResult::BAD_DATABASE_STATE; + } } leaderServers.reserve(coord.clientLeaderServers.size()); for (int i = 0; i < coord.clientLeaderServers.size(); i++) @@ -1018,7 +1348,7 @@ ACTOR Future changeQuorum(Database cx, Reference getRedundancy(AutoQuorumChange* self, Transaction* tr) { - state Future> fStorageReplicas = - tr->get(LiteralStringRef("storage_replicas").withPrefix(configKeysPrefix)); - state Future> fLogReplicas = - tr->get(LiteralStringRef("log_replicas").withPrefix(configKeysPrefix)); + state Future> fStorageReplicas = tr->get("storage_replicas"_sr.withPrefix(configKeysPrefix)); + state Future> fLogReplicas = tr->get("log_replicas"_sr.withPrefix(configKeysPrefix)); wait(success(fStorageReplicas) && success(fLogReplicas)); int redundancy = std::min(atoi(fStorageReplicas.get().get().toString().c_str()), atoi(fLogReplicas.get().get().toString().c_str())); @@ -1224,10 +1552,7 @@ struct AutoQuorumChange final : IQuorumChange { std::map> currentCounts; std::map hardLimits; - std::vector fields({ LiteralStringRef("dcid"), - LiteralStringRef("data_hall"), - LiteralStringRef("zoneid"), - LiteralStringRef("machineid") }); + std::vector fields({ "dcid"_sr, "data_hall"_sr, "zoneid"_sr, "machineid"_sr }); for (auto field = fields.begin(); field != fields.end(); field++) { if (field->toString() == "zoneid") { @@ -1244,7 +1569,7 @@ struct AutoQuorumChange final : IQuorumChange { continue; } // Exclude faulty node due to machine assassination - if (g_network->isSimulated() && !g_simulator.getProcessByAddress(worker->address)->isReliable()) { + if (g_network->isSimulated() && !g_simulator->getProcessByAddress(worker->address)->isReliable()) { TraceEvent("AutoSelectCoordinators").detail("SkipUnreliableWorker", worker->address.toString()); continue; } @@ -1253,7 +1578,7 @@ struct AutoQuorumChange final : IQuorumChange { if (maxCounts[*field] == 0) { maxCounts[*field] = 1; } - auto value = worker->locality.get(*field).orDefault(LiteralStringRef("")); + auto value = worker->locality.get(*field).orDefault(""_sr); auto currentCount = currentCounts[*field][value]; if (currentCount >= maxCounts[*field]) { valid = false; @@ -1262,7 +1587,7 @@ struct AutoQuorumChange final : IQuorumChange { } if (valid) { for (auto field = fields.begin(); field != fields.end(); field++) { - auto value = worker->locality.get(*field).orDefault(LiteralStringRef("")); + auto value = worker->locality.get(*field).orDefault(""_sr); currentCounts[*field][value] += 1; } chosen.push_back(worker->address); @@ -1329,6 +1654,7 @@ ACTOR Future excludeServers(Database cx, std::vector ser state ReadYourWritesTransaction ryw(cx); loop { try { + ryw.setOption(FDBTransactionOptions::RAW_ACCESS); ryw.setOption(FDBTransactionOptions::SPECIAL_KEY_SPACE_ENABLE_WRITES); ryw.set( SpecialKeySpace::getManagementApiCommandOptionSpecialKey(failed ? "failed" : "excluded", "force"), @@ -1404,6 +1730,7 @@ ACTOR Future excludeLocalities(Database cx, std::unordered_set includeServers(Database cx, std::vector ser state ReadYourWritesTransaction ryw(cx); loop { try { + ryw.setOption(FDBTransactionOptions::RAW_ACCESS); ryw.setOption(FDBTransactionOptions::SPECIAL_KEY_SPACE_ENABLE_WRITES); for (auto& s : servers) { if (!s.isValid()) { @@ -1468,8 +1796,7 @@ ACTOR Future includeServers(Database cx, std::vector ser // This is why we now make two clears: first only of the ip // address, the second will delete all ports. if (s.isWholeMachine()) - ryw.clear(KeyRangeRef(addr.withSuffix(LiteralStringRef(":")), - addr.withSuffix(LiteralStringRef(";")))); + ryw.clear(KeyRangeRef(addr.withSuffix(":"_sr), addr.withSuffix(";"_sr))); } } TraceEvent("IncludeServersCommit").detail("Servers", describe(servers)).detail("Failed", failed); @@ -1549,6 +1876,7 @@ ACTOR Future includeLocalities(Database cx, std::vector local state ReadYourWritesTransaction ryw(cx); loop { try { + ryw.setOption(FDBTransactionOptions::RAW_ACCESS); ryw.setOption(FDBTransactionOptions::SPECIAL_KEY_SPACE_ENABLE_WRITES); if (includeAll) { if (failed) { @@ -1877,25 +2205,6 @@ ACTOR Future setHealthyZone(Database cx, StringRef zoneId, double seconds, } } -ACTOR Future setDDIgnoreRebalanceSwitch(Database cx, bool ignoreRebalance) { - state Transaction tr(cx); - loop { - try { - tr.setOption(FDBTransactionOptions::LOCK_AWARE); - tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - if (ignoreRebalance) { - tr.set(rebalanceDDIgnoreKey, LiteralStringRef("on")); - } else { - tr.clear(rebalanceDDIgnoreKey); - } - wait(tr.commit()); - return Void(); - } catch (Error& e) { - wait(tr.onError(e)); - } - } -} - ACTOR Future setDDMode(Database cx, int mode) { state Transaction tr(cx); state int oldMode = -1; @@ -1924,6 +2233,8 @@ ACTOR Future setDDMode(Database cx, int mode) { tr.set(dataDistributionModeKey, wr.toValue()); if (mode) { // set DDMode to 1 will enable all disabled parts, for instance the SS failure monitors. + // set DDMode to 2 is a security mode which disables data moves but allows auditStorage part + // DDMode=2 is set when shard location metadata inconsistency is detected Optional currentHealthyZoneValue = wait(tr.get(healthyZoneKey)); if (currentHealthyZoneValue.present() && decodeHealthyZoneValue(currentHealthyZoneValue.get()).first == ignoreSSFailuresZoneString) { @@ -2100,9 +2411,7 @@ ACTOR Future lockDatabase(Transaction* tr, UID id) { } tr->atomicOp(databaseLockedKey, - BinaryWriter::toValue(id, Unversioned()) - .withPrefix(LiteralStringRef("0123456789")) - .withSuffix(LiteralStringRef("\x00\x00\x00\x00")), + BinaryWriter::toValue(id, Unversioned()).withPrefix("0123456789"_sr).withSuffix("\x00\x00\x00\x00"_sr), MutationRef::SetVersionstampedValue); tr->addWriteConflictRange(normalKeys); return Void(); @@ -2123,9 +2432,7 @@ ACTOR Future lockDatabase(Reference tr, UID id) } tr->atomicOp(databaseLockedKey, - BinaryWriter::toValue(id, Unversioned()) - .withPrefix(LiteralStringRef("0123456789")) - .withSuffix(LiteralStringRef("\x00\x00\x00\x00")), + BinaryWriter::toValue(id, Unversioned()).withPrefix("0123456789"_sr).withSuffix("\x00\x00\x00\x00"_sr), MutationRef::SetVersionstampedValue); tr->addWriteConflictRange(normalKeys); return Void(); @@ -2133,6 +2440,9 @@ ACTOR Future lockDatabase(Reference tr, UID id) ACTOR Future lockDatabase(Database cx, UID id) { state Transaction tr(cx); + UID debugID = deterministicRandom()->randomUniqueID(); + TraceEvent("LockDatabaseTransaction", debugID).log(); + tr.debugTransaction(debugID); loop { try { wait(lockDatabase(&tr, id)); @@ -2243,13 +2553,14 @@ ACTOR Future updateChangeFeed(Transaction* tr, Key rangeID, ChangeFeedStat } } else if (status == ChangeFeedStatus::CHANGE_FEED_DESTROY) { if (val.present()) { + if (g_network->isSimulated()) { + g_simulator->validationData.allDestroyedChangeFeedIDs.insert(rangeID.toString()); + } tr->set(rangeIDKey, changeFeedValue(std::get<0>(decodeChangeFeedValue(val.get())), std::get<1>(decodeChangeFeedValue(val.get())), status)); tr->clear(rangeIDKey); - } else { - throw unsupported_operation(); } } return Void(); @@ -2280,13 +2591,14 @@ ACTOR Future updateChangeFeed(Reference tr, } } else if (status == ChangeFeedStatus::CHANGE_FEED_DESTROY) { if (val.present()) { + if (g_network->isSimulated()) { + g_simulator->validationData.allDestroyedChangeFeedIDs.insert(rangeID.toString()); + } tr->set(rangeIDKey, changeFeedValue(std::get<0>(decodeChangeFeedValue(val.get())), std::get<1>(decodeChangeFeedValue(val.get())), status)); tr->clear(rangeIDKey); - } else { - throw unsupported_operation(); } } return Void(); @@ -2342,6 +2654,72 @@ ACTOR Future forceRecovery(Reference clusterFile } } +ACTOR Future auditStorage(Reference clusterFile, + KeyRange range, + AuditType type, + KeyValueStoreType engineType, + double timeoutSeconds) { + state Reference>> clusterInterface(new AsyncVar>); + state Future leaderMon = monitorLeader(clusterFile, clusterInterface); + TraceEvent(SevVerbose, "ManagementAPIAuditStorageTrigger").detail("AuditType", type).detail("Range", range); + state UID auditId; + try { + while (!clusterInterface->get().present()) { + wait(clusterInterface->onChange()); + } + TraceEvent(SevVerbose, "ManagementAPIAuditStorageBegin").detail("AuditType", type).detail("Range", range); + TriggerAuditRequest req(type, range, engineType); + UID auditId_ = wait(timeoutError(clusterInterface->get().get().triggerAudit.getReply(req), timeoutSeconds)); + auditId = auditId_; + TraceEvent(SevVerbose, "ManagementAPIAuditStorageEnd") + .detail("AuditType", type) + .detail("Range", range) + .detail("AuditID", auditId); + } catch (Error& e) { + TraceEvent(SevInfo, "ManagementAPIAuditStorageError") + .errorUnsuppressed(e) + .detail("AuditType", type) + .detail("Range", range) + .detail("AuditID", auditId); + throw e; + } + + return auditId; +} + +ACTOR Future cancelAuditStorage(Reference clusterFile, + AuditType type, + UID auditId, + double timeoutSeconds) { + state Reference>> clusterInterface(new AsyncVar>); + state Future leaderMon = monitorLeader(clusterFile, clusterInterface); + TraceEvent(SevVerbose, "ManagementAPICancelAuditStorageTrigger") + .detail("AuditType", type) + .detail("AuditId", auditId); + try { + while (!clusterInterface->get().present()) { + wait(clusterInterface->onChange()); + } + TraceEvent(SevVerbose, "ManagementAPICancelAuditStorageBegin") + .detail("AuditType", type) + .detail("AuditId", auditId); + TriggerAuditRequest req(type, auditId); + UID auditId_ = wait(timeoutError(clusterInterface->get().get().triggerAudit.getReply(req), timeoutSeconds)); + ASSERT(auditId_ == auditId); + TraceEvent(SevVerbose, "ManagementAPICancelAuditStorageEnd") + .detail("AuditType", type) + .detail("AuditID", auditId); + } catch (Error& e) { + TraceEvent(SevInfo, "ManagementAPICancelAuditStorageError") + .errorUnsuppressed(e) + .detail("AuditType", type) + .detail("AuditID", auditId); + throw e; + } + + return auditId; +} + ACTOR Future waitForPrimaryDC(Database cx, StringRef dcId) { state ReadYourWritesTransaction tr(cx); @@ -2578,24 +2956,25 @@ TEST_CASE("/ManagementAPI/AutoQuorumChange/checkLocality") { auto dataHall = dataCenter + std::to_string(i / 2 % 2); auto rack = dataHall + std::to_string(i % 2); auto machineId = rack + std::to_string(i); - data.locality.set(LiteralStringRef("dcid"), StringRef(dataCenter)); - data.locality.set(LiteralStringRef("data_hall"), StringRef(dataHall)); - data.locality.set(LiteralStringRef("rack"), StringRef(rack)); - data.locality.set(LiteralStringRef("zoneid"), StringRef(rack)); - data.locality.set(LiteralStringRef("machineid"), StringRef(machineId)); + data.locality.set("dcid"_sr, StringRef(dataCenter)); + data.locality.set("data_hall"_sr, StringRef(dataHall)); + data.locality.set("rack"_sr, StringRef(rack)); + data.locality.set("zoneid"_sr, StringRef(rack)); + data.locality.set("machineid"_sr, StringRef(machineId)); data.address.ip = IPAddress(i); if (g_network->isSimulated()) { - g_simulator.newProcess("TestCoordinator", - data.address.ip, - data.address.port, - false, - 1, - data.locality, - ProcessClass(ProcessClass::CoordinatorClass, ProcessClass::CommandLineSource), - "", - "", - currentProtocolVersion); + g_simulator->newProcess("TestCoordinator", + data.address.ip, + data.address.port, + false, + 1, + data.locality, + ProcessClass(ProcessClass::CoordinatorClass, ProcessClass::CommandLineSource), + "", + "", + currentProtocolVersion(), + false); } workers.push_back(data); @@ -2608,10 +2987,7 @@ TEST_CASE("/ManagementAPI/AutoQuorumChange/checkLocality") { std::map> chosenValues; ASSERT(chosen.size() == 5); - std::vector fields({ LiteralStringRef("dcid"), - LiteralStringRef("data_hall"), - LiteralStringRef("zoneid"), - LiteralStringRef("machineid") }); + std::vector fields({ "dcid"_sr, "data_hall"_sr, "zoneid"_sr, "machineid"_sr }); for (auto worker = chosen.begin(); worker != chosen.end(); worker++) { ASSERT(worker->ip.toV4() < workers.size()); LocalityData data = workers[worker->ip.toV4()].locality; @@ -2620,10 +2996,10 @@ TEST_CASE("/ManagementAPI/AutoQuorumChange/checkLocality") { } } - ASSERT(chosenValues[LiteralStringRef("dcid")].size() == 2); - ASSERT(chosenValues[LiteralStringRef("data_hall")].size() == 4); - ASSERT(chosenValues[LiteralStringRef("zoneid")].size() == 5); - ASSERT(chosenValues[LiteralStringRef("machineid")].size() == 5); + ASSERT(chosenValues["dcid"_sr].size() == 2); + ASSERT(chosenValues["data_hall"_sr].size() == 4); + ASSERT(chosenValues["zoneid"_sr].size() == 5); + ASSERT(chosenValues["machineid"_sr].size() == 5); ASSERT(std::find(chosen.begin(), chosen.end(), workers[noAssignIndex].address) != chosen.end()); return Void(); diff --git a/src/fdbclient/ManagementAPI.actor.g.cpp b/src/fdbclient/ManagementAPI.actor.g.cpp index 90f5970..519373a 100644 --- a/src/fdbclient/ManagementAPI.actor.g.cpp +++ b/src/fdbclient/ManagementAPI.actor.g.cpp @@ -24,6 +24,7 @@ #include #include +#include "fdbclient/GenericManagementAPI.actor.h" #include "fmt/format.h" #include "fdbclient/Knobs.h" #include "flow/Arena.h" @@ -44,6 +45,7 @@ #include "fdbrpc/ReplicationPolicy.h" #include "fdbrpc/Replication.h" #include "fdbclient/Schemas.h" +#include "fdbrpc/SimulatorProcessInfo.h" #include "flow/actorcompiler.h" // This must be the last #include. @@ -202,6 +204,22 @@ std::map configForToken(std::string const& mode) { } out[p + key] = format("%d", tenantMode); } + + if (key == "encryption_at_rest_mode") { + EncryptionAtRestMode mode; + if (value == "disabled") { + mode = EncryptionAtRestMode::DISABLED; + } else if (value == "domain_aware") { + mode = EncryptionAtRestMode::DOMAIN_AWARE; + } else if (value == "cluster_aware") { + mode = EncryptionAtRestMode::CLUSTER_AWARE; + } else { + printf("Error: Only disabled|domain_aware|cluster_aware are valid for encryption_at_rest_mode.\n"); + return out; + } + out[p + key] = format("%d", mode); + } + if (key == "exclude") { int p = 0; while (p < value.size()) { @@ -220,7 +238,7 @@ std::map configForToken(std::string const& mode) { } } - if (key == "perpetual_storage_wiggle_engine") { + if (key == "storage_engine" || key == "log_engine" || key == "perpetual_storage_wiggle_engine") { StringRef s = value; // Parse as engine_name[:p=v]... to handle future storage engine params @@ -237,23 +255,31 @@ std::map configForToken(std::string const& mode) { } return out; } + return out; } Optional logType; Optional storeType; + + // These are legacy shorthand commands to set a specific log engine and storage engine + // based only on the storage engine name. Most of them assume SQLite should be the + // log engine. if (mode == "ssd-1") { logType = KeyValueStoreType::SSD_BTREE_V1; storeType = KeyValueStoreType::SSD_BTREE_V1; } else if (mode == "ssd" || mode == "ssd-2") { logType = KeyValueStoreType::SSD_BTREE_V2; storeType = KeyValueStoreType::SSD_BTREE_V2; - } else if (mode == "ssd-redwood-1-experimental") { + } else if (mode == "ssd-redwood-1" || mode == "ssd-redwood-1-experimental") { logType = KeyValueStoreType::SSD_BTREE_V2; storeType = KeyValueStoreType::SSD_REDWOOD_V1; } else if (mode == "ssd-rocksdb-v1") { logType = KeyValueStoreType::SSD_BTREE_V2; storeType = KeyValueStoreType::SSD_ROCKSDB_V1; + } else if (mode == "ssd-sharded-rocksdb") { + logType = KeyValueStoreType::SSD_BTREE_V2; + storeType = KeyValueStoreType::SSD_SHARDED_ROCKSDB; } else if (mode == "memory" || mode == "memory-2") { logType = KeyValueStoreType::SSD_BTREE_V2; storeType = KeyValueStoreType::MEMORY; @@ -268,7 +294,7 @@ std::map configForToken(std::string const& mode) { if (storeType.present()) { out[p + "log_engine"] = format("%d", logType.get().storeType()); - out[p + "storage_engine"] = format("%d", KeyValueStoreType::StoreType(storeType.get())); + out[p + "storage_engine"] = format("%d", storeType.get().storeType()); return out; } @@ -405,7 +431,10 @@ ConfigurationResult buildConfiguration(std::vector const& modeTokens, for (auto t = m.begin(); t != m.end(); ++t) { if (outConf.count(t->first)) { - TraceEvent(SevWarnAlways, "ConflictingOption").detail("Option", t->first); + TraceEvent(SevWarnAlways, "ConflictingOption") + .detail("Option", t->first) + .detail("Value", t->second) + .detail("ExistingValue", outConf[t->first]); return ConfigurationResult::CONFLICTING_OPTIONS; } outConf[t->first] = t->second; @@ -484,39 +513,131 @@ bool isCompleteConfiguration(std::map const& options) options.count(p + "storage_engine") == 1; } - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +/* + - Validates encryption and tenant mode configurations + - During cluster creation (configure new) we allow the following: + - If encryption mode is disabled/cluster_aware then any tenant mode is allowed + - If the encryption mode is domain_aware then the only allowed tenant mode is required + - During cluster configuration changes the following is allowed: + - Encryption mode cannot be changed (can only be set during creation) + - If the encryption mode is disabled/cluster_aware then any tenant mode changes are allowed + - If the encryption mode is domain_aware then tenant mode changes are not allowed (as the only supported mode is + required) +*/ +bool isEncryptionAtRestModeConfigValid(Optional oldConfiguration, + std::map newConfig, + bool creating) { + EncryptionAtRestMode encryptMode; + TenantMode tenantMode; + if (creating) { + if (newConfig.count(encryptionAtRestModeConfKey.toString()) != 0) { + encryptMode = EncryptionAtRestMode::fromValueRef( + ValueRef(newConfig.find(encryptionAtRestModeConfKey.toString())->second)); + // check if the tenant mode is being set during configure new (otherwise assume tenants are disabled) + if (newConfig.count(tenantModeConfKey.toString()) != 0) { + tenantMode = TenantMode::fromValue(ValueRef(newConfig.find(tenantModeConfKey.toString())->second)); + } + } + } else { + ASSERT(oldConfiguration.present()); + encryptMode = oldConfiguration.get().encryptionAtRestMode; + if (newConfig.count(tenantModeConfKey.toString()) != 0) { + tenantMode = TenantMode::fromValue(ValueRef(newConfig.find(tenantModeConfKey.toString())->second)); + } else { + // Tenant mode and encryption mode didn't change + return true; + } + } + TraceEvent(SevDebug, "EncryptAndTenantModes") + .detail("EncryptMode", encryptMode.toString()) + .detail("TenantMode", tenantMode.toString()); + + if (encryptMode.mode == EncryptionAtRestMode::DOMAIN_AWARE && tenantMode != TenantMode::REQUIRED) { + // For domain aware encryption only the required tenant mode is currently supported + TraceEvent(SevWarnAlways, "InvalidEncryptAndTenantConfiguration") + .detail("EncryptMode", encryptMode.toString()) + .detail("TenantMode", tenantMode.toString()); + return false; + } + + return true; +} + +bool isTenantModeModeConfigValid(DatabaseConfiguration oldConfiguration, DatabaseConfiguration newConfiguration) { + TenantMode oldTenantMode = oldConfiguration.tenantMode; + TenantMode newTenantMode = newConfiguration.tenantMode; + TraceEvent(SevDebug, "TenantModes") + .detail("OldTenantMode", oldTenantMode.toString()) + .detail("NewTenantMode", newTenantMode.toString()); + if (oldTenantMode != TenantMode::REQUIRED && newTenantMode == TenantMode::REQUIRED) { + // TODO: Changing from optional/disabled to required tenant mode should be allowed if there is no non-tenant + // data present + TraceEvent(SevWarnAlways, "InvalidTenantConfiguration") + .detail("OldTenantMode", oldTenantMode.toString()) + .detail("NewTenantMode", newTenantMode.toString()); + return false; + } + return true; +} + + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { -// This generated class is to be used only via getDatabaseConfiguration() - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -template - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class GetDatabaseConfigurationActorState { - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via flowTestCase581() + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class FlowTestCase581ActorState { + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - GetDatabaseConfigurationActorState(Database const& cx) - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - : cx(cx), - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr(cx) - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + FlowTestCase581ActorState(UnitTestParameters const& params) + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + : params(params) + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - fdb_probe_actor_create("getDatabaseConfiguration", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase581", reinterpret_cast(this)); } - ~GetDatabaseConfigurationActorState() + ~FlowTestCase581ActorState() { - fdb_probe_actor_destroy("getDatabaseConfiguration", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase581", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ; - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + DatabaseConfiguration oldConfig; + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + DatabaseConfiguration newConfig; + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::vector tenantModes = { TenantMode::DISABLED, TenantMode::OPTIONAL_TENANT, TenantMode::REQUIRED }; + #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + oldConfig.tenantMode = TenantMode::REQUIRED; + #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig.tenantMode = deterministicRandom()->randomChoice(tenantModes); + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(isTenantModeModeConfigValid(oldConfig, newConfig)); + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + oldConfig.tenantMode = deterministicRandom()->coinflip() ? TenantMode::DISABLED : TenantMode::OPTIONAL_TENANT; + #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig.tenantMode = deterministicRandom()->coinflip() ? TenantMode::DISABLED : TenantMode::OPTIONAL_TENANT; + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(isTenantModeModeConfigValid(oldConfig, newConfig)); + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + oldConfig.tenantMode = deterministicRandom()->coinflip() ? TenantMode::DISABLED : TenantMode::OPTIONAL_TENANT; + #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig.tenantMode = TenantMode::REQUIRED; + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(!isTenantModeModeConfigValid(oldConfig, newConfig)); + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase581ActorState(); static_cast(this)->destroy(); return 0; } + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase581ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -528,86 +649,330 @@ class GetDatabaseConfigurationActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~GetDatabaseConfigurationActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase581ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1loopHead1(int loopDepth) + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + UnitTestParameters params; + #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase581() + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class FlowTestCase581Actor final : public Actor, public FastAllocated, public FlowTestCase581ActorState { + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + FlowTestCase581Actor(UnitTestParameters const& params) + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + : Actor(), + FlowTestCase581ActorState(params) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + fdb_probe_actor_enter("flowTestCase581", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase581"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase581", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1loopBody1(int loopDepth) + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +static Future flowTestCase581( UnitTestParameters const& params ) { + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new FlowTestCase581Actor(params)); + #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase581, "/ManagementAPI/ChangeConfig/TenantMode") + +#line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + +// unit test for changing encryption/tenant mode config options + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase602() + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class FlowTestCase602ActorState { + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + FlowTestCase602ActorState(UnitTestParameters const& params) + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + : params(params) + #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase602", reinterpret_cast(this)); + + } + ~FlowTestCase602ActorState() + { + fdb_probe_actor_destroy("flowTestCase602", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) { try { - #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::READ_LOCK_AWARE); - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_0 = tr.getRange(configKeys, CLIENT_KNOBS->TOO_MANY); - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::map newConfig; + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::string encryptModeKey = encryptionAtRestModeConfKey.toString(); + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::string tenantModeKey = tenantModeConfKey.toString(); + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::vector tenantModes = { TenantMode::DISABLED, TenantMode::OPTIONAL_TENANT, TenantMode::REQUIRED }; + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::vector encryptionModes = { EncryptionAtRestMode::DISABLED, EncryptionAtRestMode::CLUSTER_AWARE, EncryptionAtRestMode::DOMAIN_AWARE }; + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig[encryptModeKey] = std::to_string(EncryptionAtRestMode::DISABLED); + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig[tenantModeKey] = std::to_string(deterministicRandom()->randomChoice(tenantModes)); + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(isEncryptionAtRestModeConfigValid(Optional(), newConfig, true)); + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig[encryptModeKey] = std::to_string(EncryptionAtRestMode::CLUSTER_AWARE); + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig[tenantModeKey] = std::to_string(deterministicRandom()->randomChoice(tenantModes)); + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(isEncryptionAtRestModeConfigValid(Optional(), newConfig, true)); + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig[encryptModeKey] = std::to_string(EncryptionAtRestMode::DOMAIN_AWARE); + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig[tenantModeKey] = std::to_string(deterministicRandom()->coinflip() ? TenantMode::DISABLED : TenantMode::OPTIONAL_TENANT); + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(!isEncryptionAtRestModeConfigValid(Optional(), newConfig, true)); + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig[tenantModeKey] = std::to_string(TenantMode::REQUIRED); + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(isEncryptionAtRestModeConfigValid(Optional(), newConfig, true)); + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig.erase(encryptModeKey); + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig[tenantModeKey] = std::to_string(deterministicRandom()->randomChoice(tenantModes)); + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(isEncryptionAtRestModeConfigValid(Optional(), newConfig, true)); + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig.erase(tenantModeKey); + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig[encryptModeKey] = std::to_string(EncryptionAtRestMode::DOMAIN_AWARE); + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(!isEncryptionAtRestModeConfigValid(Optional(), newConfig, true)); + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig[encryptModeKey] = std::to_string(EncryptionAtRestMode::CLUSTER_AWARE); + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(isEncryptionAtRestModeConfigValid(Optional(), newConfig, true)); + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + DatabaseConfiguration oldConfig; + #line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + oldConfig.encryptionAtRestMode = EncryptionAtRestMode::DISABLED; + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + oldConfig.tenantMode = deterministicRandom()->randomChoice(tenantModes); + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig[tenantModeKey] = std::to_string(deterministicRandom()->randomChoice(tenantModes)); + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(isEncryptionAtRestModeConfigValid(oldConfig, newConfig, false)); + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + oldConfig.encryptionAtRestMode = EncryptionAtRestMode::DOMAIN_AWARE; + #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + oldConfig.tenantMode = TenantMode::REQUIRED; + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig[tenantModeKey] = std::to_string(deterministicRandom()->coinflip() ? TenantMode::DISABLED : TenantMode::OPTIONAL_TENANT); + #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(!isEncryptionAtRestModeConfigValid(oldConfig, newConfig, false)); + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig[tenantModeKey] = std::to_string(TenantMode::REQUIRED); + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(isEncryptionAtRestModeConfigValid(oldConfig, newConfig, false)); + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + oldConfig.encryptionAtRestMode = EncryptionAtRestMode::CLUSTER_AWARE; + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + oldConfig.tenantMode = deterministicRandom()->randomChoice(tenantModes); + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig[tenantModeKey] = std::to_string(deterministicRandom()->randomChoice(tenantModes)); + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(isEncryptionAtRestModeConfigValid(oldConfig, newConfig, false)); + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newConfig.erase(tenantModeKey); + #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + oldConfig.tenantMode = deterministicRandom()->randomChoice(tenantModes); + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + oldConfig.encryptionAtRestMode = deterministicRandom()->randomChoice(encryptionModes); + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(isEncryptionAtRestModeConfigValid(oldConfig, newConfig, false)); + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase602ActorState(); static_cast(this)->destroy(); return 0; } + #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase602ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - if (loopDepth == 0) return a_body1loopHead1(0); + this->~FlowTestCase602ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + UnitTestParameters params; + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase602() + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class FlowTestCase602Actor final : public Actor, public FastAllocated, public FlowTestCase602ActorState { + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + FlowTestCase602Actor(UnitTestParameters const& params) + #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + : Actor(), + FlowTestCase602ActorState(params) + { + fdb_probe_actor_enter("flowTestCase602", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase602"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase602", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +static Future flowTestCase602( UnitTestParameters const& params ) { + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new FlowTestCase602Actor(params)); + #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase602, "/ManagementAPI/ChangeConfig/TenantAndEncryptMode") + +#line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via getDatabaseConfiguration() + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class GetDatabaseConfigurationActorState { + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + GetDatabaseConfigurationActorState(Transaction* const& tr,bool const& useSystemPriority) + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + : tr(tr), + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + useSystemPriority(useSystemPriority) + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + fdb_probe_actor_create("getDatabaseConfiguration", reinterpret_cast(this)); + + } + ~GetDatabaseConfigurationActorState() + { + fdb_probe_actor_destroy("getDatabaseConfiguration", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) { try { - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_1 = tr.onError(e); - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (useSystemPriority) + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_0 = tr->getRange(configKeys, CLIENT_KNOBS->TOO_MANY); + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1loopBody1cont2(RangeResult const& res,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetDatabaseConfigurationActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(RangeResult const& res,int loopDepth) { - #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(res.size() < CLIENT_KNOBS->TOO_MANY); - #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" DatabaseConfiguration config; - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" config.fromKeyValues((VectorRef)res); - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(config); this->~GetDatabaseConfigurationActorState(); static_cast(this)->destroy(); return 0; } - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< DatabaseConfiguration >::value()) DatabaseConfiguration(config); this->~GetDatabaseConfigurationActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -615,17 +980,17 @@ class GetDatabaseConfigurationActorState { return loopDepth; } - int a_body1loopBody1cont2(RangeResult && res,int loopDepth) + int a_body1cont1(RangeResult && res,int loopDepth) { - #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(res.size() < CLIENT_KNOBS->TOO_MANY); - #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" DatabaseConfiguration config; - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" config.fromKeyValues((VectorRef)res); - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(config); this->~GetDatabaseConfigurationActorState(); static_cast(this)->destroy(); return 0; } - #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< DatabaseConfiguration >::value()) DatabaseConfiguration(config); this->~GetDatabaseConfigurationActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -633,15 +998,15 @@ class GetDatabaseConfigurationActorState { return loopDepth; } - int a_body1loopBody1when1(RangeResult const& res,int loopDepth) + int a_body1when1(RangeResult const& res,int loopDepth) { - loopDepth = a_body1loopBody1cont2(res, loopDepth); + loopDepth = a_body1cont1(res, loopDepth); return loopDepth; } - int a_body1loopBody1when1(RangeResult && res,int loopDepth) + int a_body1when1(RangeResult && res,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(res), loopDepth); + loopDepth = a_body1cont1(std::move(res), loopDepth); return loopDepth; } @@ -656,12 +1021,12 @@ class GetDatabaseConfigurationActorState { fdb_probe_actor_enter("getDatabaseConfiguration", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getDatabaseConfiguration", reinterpret_cast(this), 0); @@ -671,12 +1036,12 @@ class GetDatabaseConfigurationActorState { fdb_probe_actor_enter("getDatabaseConfiguration", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getDatabaseConfiguration", reinterpret_cast(this), 0); @@ -685,81 +1050,6 @@ class GetDatabaseConfigurationActorState { { fdb_probe_actor_enter("getDatabaseConfiguration", reinterpret_cast(this), 0); a_exitChoose1(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getDatabaseConfiguration", reinterpret_cast(this), 0); - - } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetDatabaseConfigurationActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GetDatabaseConfigurationActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("getDatabaseConfiguration", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getDatabaseConfiguration", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< GetDatabaseConfigurationActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("getDatabaseConfiguration", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getDatabaseConfiguration", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< GetDatabaseConfigurationActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("getDatabaseConfiguration", reinterpret_cast(this), 1); - a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -768,19 +1058,19 @@ class GetDatabaseConfigurationActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getDatabaseConfiguration", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getDatabaseConfiguration", reinterpret_cast(this), 0); } - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Database cx; - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Transaction tr; - #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Transaction* tr; + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + bool useSystemPriority; + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via getDatabaseConfiguration() - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class GetDatabaseConfigurationActor final : public Actor, public ActorCallback< GetDatabaseConfigurationActor, 0, RangeResult >, public ActorCallback< GetDatabaseConfigurationActor, 1, Void >, public FastAllocated, public GetDatabaseConfigurationActorState { - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class GetDatabaseConfigurationActor final : public Actor, public ActorCallback< GetDatabaseConfigurationActor, 0, RangeResult >, public FastAllocated, public GetDatabaseConfigurationActorState { + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -789,12 +1079,11 @@ class GetDatabaseConfigurationActor final : public Actor, void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetDatabaseConfigurationActor, 0, RangeResult >; -friend struct ActorCallback< GetDatabaseConfigurationActor, 1, Void >; - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - GetDatabaseConfigurationActor(Database const& cx) - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + GetDatabaseConfigurationActor(Transaction* const& tr,bool const& useSystemPriority) + #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), - GetDatabaseConfigurationActorState(cx) + GetDatabaseConfigurationActorState(tr, useSystemPriority) { fdb_probe_actor_enter("getDatabaseConfiguration", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -811,27 +1100,356 @@ friend struct ActorCallback< GetDatabaseConfigurationActor, 1, Void >; this->actor_wait_state = -1; switch (wait_state) { case 1: this->a_callback_error((ActorCallback< GetDatabaseConfigurationActor, 0, RangeResult >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetDatabaseConfigurationActor, 1, Void >*)0, actor_cancelled()); break; } } }; } - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -[[nodiscard]] Future getDatabaseConfiguration( Database const& cx ) { - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return Future(new GetDatabaseConfigurationActor(cx)); - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future getDatabaseConfiguration( Transaction* const& tr, bool const& useSystemPriority ) { + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new GetDatabaseConfigurationActor(tr, useSystemPriority)); + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - -ConfigureAutoResult parseConfig(StatusObject const& status) { - ConfigureAutoResult result; - StatusObjectReader statusObj(status); +#line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StatusObjectReader statusObjCluster; - if (!statusObj.get("cluster", statusObjCluster)) + #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via getDatabaseConfiguration() + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class GetDatabaseConfigurationActor1State { + #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + GetDatabaseConfigurationActor1State(Database const& cx,bool const& useSystemPriority) + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + : cx(cx), + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + useSystemPriority(useSystemPriority), + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr(cx) + #line 1135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + fdb_probe_actor_create("getDatabaseConfiguration", reinterpret_cast(this)); + + } + ~GetDatabaseConfigurationActor1State() + { + fdb_probe_actor_destroy("getDatabaseConfiguration", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ; + #line 1150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetDatabaseConfigurationActor1State(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_0 = getDatabaseConfiguration(&tr, useSystemPriority); + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_1 = tr.onError(e); + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(DatabaseConfiguration const& config,int loopDepth) + { + #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(config); this->~GetDatabaseConfigurationActor1State(); static_cast(this)->destroy(); return 0; } + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< DatabaseConfiguration >::value()) DatabaseConfiguration(config); + this->~GetDatabaseConfigurationActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont2(DatabaseConfiguration && config,int loopDepth) + { + #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(config); this->~GetDatabaseConfigurationActor1State(); static_cast(this)->destroy(); return 0; } + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< DatabaseConfiguration >::value()) DatabaseConfiguration(config); + this->~GetDatabaseConfigurationActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1when1(DatabaseConfiguration const& config,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(config, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(DatabaseConfiguration && config,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(config), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetDatabaseConfigurationActor1, 0, DatabaseConfiguration >::remove(); + + } + void a_callback_fire(ActorCallback< GetDatabaseConfigurationActor1, 0, DatabaseConfiguration >*,DatabaseConfiguration const& value) + { + fdb_probe_actor_enter("getDatabaseConfiguration", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getDatabaseConfiguration", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetDatabaseConfigurationActor1, 0, DatabaseConfiguration >*,DatabaseConfiguration && value) + { + fdb_probe_actor_enter("getDatabaseConfiguration", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getDatabaseConfiguration", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetDatabaseConfigurationActor1, 0, DatabaseConfiguration >*,Error err) + { + fdb_probe_actor_enter("getDatabaseConfiguration", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getDatabaseConfiguration", reinterpret_cast(this), 0); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetDatabaseConfigurationActor1, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetDatabaseConfigurationActor1, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("getDatabaseConfiguration", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getDatabaseConfiguration", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetDatabaseConfigurationActor1, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("getDatabaseConfiguration", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getDatabaseConfiguration", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetDatabaseConfigurationActor1, 1, Void >*,Error err) + { + fdb_probe_actor_enter("getDatabaseConfiguration", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getDatabaseConfiguration", reinterpret_cast(this), 1); + + } + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Database cx; + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + bool useSystemPriority; + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Transaction tr; + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +}; +// This generated class is to be used only via getDatabaseConfiguration() + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class GetDatabaseConfigurationActor1 final : public Actor, public ActorCallback< GetDatabaseConfigurationActor1, 0, DatabaseConfiguration >, public ActorCallback< GetDatabaseConfigurationActor1, 1, Void >, public FastAllocated, public GetDatabaseConfigurationActor1State { + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetDatabaseConfigurationActor1, 0, DatabaseConfiguration >; +friend struct ActorCallback< GetDatabaseConfigurationActor1, 1, Void >; + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + GetDatabaseConfigurationActor1(Database const& cx,bool const& useSystemPriority) + #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + : Actor(), + GetDatabaseConfigurationActor1State(cx, useSystemPriority) + { + fdb_probe_actor_enter("getDatabaseConfiguration", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getDatabaseConfiguration"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getDatabaseConfiguration", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetDatabaseConfigurationActor1, 0, DatabaseConfiguration >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetDatabaseConfigurationActor1, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future getDatabaseConfiguration( Database const& cx, bool const& useSystemPriority ) { + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new GetDatabaseConfigurationActor1(cx, useSystemPriority)); + #line 1442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +} + +#line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + +ConfigureAutoResult parseConfig(StatusObject const& status) { + ConfigureAutoResult result; + StatusObjectReader statusObj(status); + + StatusObjectReader statusObjCluster; + if (!statusObj.get("cluster", statusObjCluster)) return ConfigureAutoResult(); StatusObjectReader statusObjConfig; @@ -1095,25 +1713,25 @@ ConfigureAutoResult parseConfig(StatusObject const& status) { return result; } - #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via getWorkers() - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetWorkersActorState { - #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetWorkersActorState(Transaction* const& tr) - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr), - #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" processClasses(tr->getRange(processClassKeys, CLIENT_KNOBS->TOO_MANY)), - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" processData(tr->getRange(workerListKeys, CLIENT_KNOBS->TOO_MANY)) - #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("getWorkers", reinterpret_cast(this)); @@ -1126,16 +1744,16 @@ class GetWorkersActorState { int a_body1(int loopDepth=0) { try { - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = success(processClasses) && success(processData); - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1156,46 +1774,46 @@ class GetWorkersActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(!processClasses.get().more && processClasses.get().size() < CLIENT_KNOBS->TOO_MANY); - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(!processData.get().more && processData.get().size() < CLIENT_KNOBS->TOO_MANY); - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::map>, ProcessClass> id_class; - #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(int i = 0;i < processClasses.get().size();i++) { - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" id_class[decodeProcessClassKey(processClasses.get()[i].key)] = decodeProcessClassValue(processClasses.get()[i].value); - #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector results; - #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(int i = 0;i < processData.get().size();i++) { - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ProcessData data = decodeWorkerListValue(processData.get()[i].value); - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ProcessClass processClass = id_class[data.locality.processId()]; - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (processClass.classSource() == ProcessClass::DBSource || data.processClass.classType() == ProcessClass::UnsetClass) - #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" data.processClass = processClass; - #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (data.processClass.classType() != ProcessClass::TesterClass) - #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" results.push_back(data); - #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~GetWorkersActorState(); static_cast(this)->destroy(); return 0; } - #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); this->~GetWorkersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1205,46 +1823,46 @@ class GetWorkersActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(!processClasses.get().more && processClasses.get().size() < CLIENT_KNOBS->TOO_MANY); - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(!processData.get().more && processData.get().size() < CLIENT_KNOBS->TOO_MANY); - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::map>, ProcessClass> id_class; - #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(int i = 0;i < processClasses.get().size();i++) { - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" id_class[decodeProcessClassKey(processClasses.get()[i].key)] = decodeProcessClassValue(processClasses.get()[i].value); - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector results; - #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(int i = 0;i < processData.get().size();i++) { - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ProcessData data = decodeWorkerListValue(processData.get()[i].value); - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ProcessClass processClass = id_class[data.locality.processId()]; - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (processClass.classSource() == ProcessClass::DBSource || data.processClass.classType() == ProcessClass::UnsetClass) - #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" data.processClass = processClass; - #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (data.processClass.classType() != ProcessClass::TesterClass) - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" results.push_back(data); - #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~GetWorkersActorState(); static_cast(this)->destroy(); return 0; } - #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); this->~GetWorkersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1315,18 +1933,18 @@ class GetWorkersActorState { fdb_probe_actor_exit("getWorkers", reinterpret_cast(this), 0); } - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Future processClasses; - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Future processData; - #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via getWorkers() - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetWorkersActor final : public Actor>, public ActorCallback< GetWorkersActor, 0, Void >, public FastAllocated, public GetWorkersActorState { - #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1335,9 +1953,9 @@ class GetWorkersActor final : public Actor>, public Act void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetWorkersActor, 0, Void >; - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetWorkersActor(Transaction* const& tr) - #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor>(), GetWorkersActorState(tr) { @@ -1361,32 +1979,32 @@ friend struct ActorCallback< GetWorkersActor, 0, Void >; } }; } - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future> getWorkers( Transaction* const& tr ) { - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future>(new GetWorkersActor(tr)); - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via getWorkers() - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetWorkersActor1State { - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetWorkersActor1State(Database const& cx) - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(cx) - #line 1389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("getWorkers", reinterpret_cast(this)); @@ -1399,9 +2017,9 @@ class GetWorkersActor1State { int a_body1(int loopDepth=0) { try { - #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 1404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1430,22 +2048,22 @@ class GetWorkersActor1State { int a_body1loopBody1(int loopDepth) { try { - #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = getWorkers(&tr); - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1465,16 +2083,16 @@ class GetWorkersActor1State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.onError(e); - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1487,9 +2105,9 @@ class GetWorkersActor1State { } int a_body1loopBody1cont2(std::vector const& workers,int loopDepth) { - #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(workers); this->~GetWorkersActor1State(); static_cast(this)->destroy(); return 0; } - #line 1492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(workers); this->~GetWorkersActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1499,9 +2117,9 @@ class GetWorkersActor1State { } int a_body1loopBody1cont2(std::vector && workers,int loopDepth) { - #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(workers); this->~GetWorkersActor1State(); static_cast(this)->destroy(); return 0; } - #line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(workers); this->~GetWorkersActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1647,16 +2265,16 @@ class GetWorkersActor1State { fdb_probe_actor_exit("getWorkers", reinterpret_cast(this), 1); } - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 1654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via getWorkers() - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetWorkersActor1 final : public Actor>, public ActorCallback< GetWorkersActor1, 0, std::vector >, public ActorCallback< GetWorkersActor1, 1, Void >, public FastAllocated, public GetWorkersActor1State { - #line 1659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1666,9 +2284,9 @@ class GetWorkersActor1 final : public Actor>, public Ac #pragma clang diagnostic pop friend struct ActorCallback< GetWorkersActor1, 0, std::vector >; friend struct ActorCallback< GetWorkersActor1, 1, Void >; - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetWorkersActor1(Database const& cx) - #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor>(), GetWorkersActor1State(cx) { @@ -1693,32 +2311,32 @@ friend struct ActorCallback< GetWorkersActor1, 1, Void >; } }; } - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future> getWorkers( Database const& cx ) { - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future>(new GetWorkersActor1(cx)); - #line 1700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via getConnectionString() - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetConnectionStringActorState { - #line 1712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetConnectionStringActorState(Database const& cx) - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(cx) - #line 1721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("getConnectionString", reinterpret_cast(this)); @@ -1731,9 +2349,9 @@ class GetConnectionStringActorState { int a_body1(int loopDepth=0) { try { - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 1736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1762,20 +2380,20 @@ class GetConnectionStringActorState { int a_body1loopBody1(int loopDepth) { try { - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::READ_LOCK_AWARE); - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = tr.get(coordinatorsKey); - #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1795,16 +2413,16 @@ class GetConnectionStringActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.onError(e); - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1817,21 +2435,21 @@ class GetConnectionStringActorState { } int a_body1loopBody1cont2(Optional const& currentKey,int loopDepth) { - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!currentKey.present()) - #line 1822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GetConnectionStringActorState(); static_cast(this)->destroy(); return 0; } - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~GetConnectionStringActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(ClusterConnectionString(currentKey.get().toString())); this->~GetConnectionStringActorState(); static_cast(this)->destroy(); return 0; } - #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(ClusterConnectionString(currentKey.get().toString())); this->~GetConnectionStringActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1841,21 +2459,21 @@ class GetConnectionStringActorState { } int a_body1loopBody1cont2(Optional && currentKey,int loopDepth) { - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!currentKey.present()) - #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GetConnectionStringActorState(); static_cast(this)->destroy(); return 0; } - #line 1850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~GetConnectionStringActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(ClusterConnectionString(currentKey.get().toString())); this->~GetConnectionStringActorState(); static_cast(this)->destroy(); return 0; } - #line 1858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(ClusterConnectionString(currentKey.get().toString())); this->~GetConnectionStringActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2001,16 +2619,16 @@ class GetConnectionStringActorState { fdb_probe_actor_exit("getConnectionString", reinterpret_cast(this), 1); } - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via getConnectionString() - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetConnectionStringActor final : public Actor>, public ActorCallback< GetConnectionStringActor, 0, Optional >, public ActorCallback< GetConnectionStringActor, 1, Void >, public FastAllocated, public GetConnectionStringActorState { - #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2020,9 +2638,9 @@ class GetConnectionStringActor final : public Actor >; friend struct ActorCallback< GetConnectionStringActor, 1, Void >; - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetConnectionStringActor(Database const& cx) - #line 2025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor>(), GetConnectionStringActorState(cx) { @@ -2047,65 +2665,59 @@ friend struct ActorCallback< GetConnectionStringActor, 1, Void >; } }; } - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future> getConnectionString( Database const& cx ) { - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future>(new GetConnectionStringActor(cx)); - #line 2054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + +static std::vector connectionStrings; - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { -// This generated class is to be used only via changeQuorumChecker() - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -template - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class ChangeQuorumCheckerActorState { - #line 2066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + + #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via getClusterConnectionStringFromStorageServer() + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class GetClusterConnectionStringFromStorageServerActorState { + #line 2687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ChangeQuorumCheckerActorState(Transaction* const& tr,ClusterConnectionString* const& conn,std::string const& newName) - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - : tr(tr), - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - conn(conn), - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - newName(newName) - #line 2077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + GetClusterConnectionStringFromStorageServerActorState(Transaction* const& tr) + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + : tr(tr) + #line 2694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - fdb_probe_actor_create("changeQuorumChecker", reinterpret_cast(this)); + fdb_probe_actor_create("getClusterConnectionStringFromStorageServer", reinterpret_cast(this)); } - ~ChangeQuorumCheckerActorState() + ~GetClusterConnectionStringFromStorageServerActorState() { - fdb_probe_actor_destroy("changeQuorumChecker", reinterpret_cast(this)); + fdb_probe_actor_destroy("getClusterConnectionStringFromStorageServer", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); - #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture> __when_expr_0 = tr->get(coordinatorsKey); - #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + retryTimes = 0; + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ; + #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -2117,167 +2729,130 @@ class ChangeQuorumCheckerActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~ChangeQuorumCheckerActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~GetClusterConnectionStringFromStorageServerActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(Optional const& currentKey,int loopDepth) + int a_body1loopHead1(int loopDepth) { - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!currentKey.present()) - #line 2130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::BAD_DATABASE_STATE); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::BAD_DATABASE_STATE); - this->~ChangeQuorumCheckerActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - old = ClusterConnectionString(currentKey.get().toString()); - #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (tr->getDatabase()->getConnectionRecord() && old.clusterKeyName().toString() != tr->getDatabase()->getConnectionRecord()->getConnectionString().clusterKeyName()) - #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (retryTimes >= CLIENT_KNOBS->CHANGE_QUORUM_BAD_STATE_RETRY_TIMES) + #line 2749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::BAD_DATABASE_STATE); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } - #line 2148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::BAD_DATABASE_STATE); - this->~ChangeQuorumCheckerActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GetClusterConnectionStringFromStorageServerActorState(); static_cast(this)->destroy(); return 0; } + #line 2753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~GetClusterConnectionStringFromStorageServerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (conn->hostnames.size() + conn->coords.size() == 0) - #line 2156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - conn->hostnames = old.hostnames; - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - conn->coords = old.coords; - #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture> __when_expr_1 = conn->tryResolveHostnames(); - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_0 = tr->getReadVersion(); + #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1(Optional && currentKey,int loopDepth) + int a_body1loopBody1cont1(Version const& readVersion,int loopDepth) { - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!currentKey.present()) - #line 2182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::BAD_DATABASE_STATE); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } - #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::BAD_DATABASE_STATE); - this->~ChangeQuorumCheckerActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - old = ClusterConnectionString(currentKey.get().toString()); - #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (tr->getDatabase()->getConnectionRecord() && old.clusterKeyName().toString() != tr->getDatabase()->getConnectionRecord()->getConnectionString().clusterKeyName()) - #line 2196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::BAD_DATABASE_STATE); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } - #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::BAD_DATABASE_STATE); - this->~ChangeQuorumCheckerActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (conn->hostnames.size() + conn->coords.size() == 0) - #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - conn->hostnames = old.hostnames; - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - conn->coords = old.coords; - #line 2214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture> __when_expr_1 = conn->tryResolveHostnames(); - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture> __when_expr_1 = tr->get(coordinatorsKey); + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1(Version && readVersion,int loopDepth) + { + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture> __when_expr_1 = tr->get(coordinatorsKey); + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(Optional const& currentKey,int loopDepth) + int a_body1loopBody1when1(Version const& readVersion,int loopDepth) { - loopDepth = a_body1cont1(currentKey, loopDepth); + loopDepth = a_body1loopBody1cont1(readVersion, loopDepth); return loopDepth; } - int a_body1when1(Optional && currentKey,int loopDepth) + int a_body1loopBody1when1(Version && readVersion,int loopDepth) { - loopDepth = a_body1cont1(std::move(currentKey), loopDepth); + loopDepth = a_body1loopBody1cont1(std::move(readVersion), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeQuorumCheckerActor, 0, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetClusterConnectionStringFromStorageServerActor, 0, Version >::remove(); } - void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 0, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< GetClusterConnectionStringFromStorageServerActor, 0, Version >*,Version const& value) { - fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 0, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< GetClusterConnectionStringFromStorageServerActor, 0, Version >*,Version && value) { - fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< ChangeQuorumCheckerActor, 0, Optional >*,Error err) + void a_callback_error(ActorCallback< GetClusterConnectionStringFromStorageServerActor, 0, Version >*,Error err) { - fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -2287,424 +2862,208 @@ class ChangeQuorumCheckerActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 0); } - int a_body1cont2(std::vector const& desiredCoordinators,int loopDepth) + int a_body1loopBody1cont3(int loopDepth) { - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (desiredCoordinators.size() != conn->hostnames.size() + conn->coords.size()) - #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - TraceEvent("ChangeQuorumCheckerEarlyTermination") .detail("Reason", "One or more hostnames are unresolvable") .backtrace(); - #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::COORDINATOR_UNREACHABLE); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } - #line 2303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::COORDINATOR_UNREACHABLE); - this->~ChangeQuorumCheckerActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (newName.empty()) - #line 2311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (g_network->isSimulated() && currentKey.present()) + #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - newName = old.clusterKeyName().toString(); - #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + int n = connectionStrings.size() > 0 ? connectionStrings.size() - 1 : 0; + #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + for(int i = 0;i < n;++i) { + #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(currentKey.get() != connectionStrings.at(i)); + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } } - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::sort(conn->hostnames.begin(), conn->hostnames.end()); - #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::sort(conn->coords.begin(), conn->coords.end()); - #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::sort(old.hostnames.begin(), old.hostnames.end()); - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::sort(old.coords.begin(), old.coords.end()); - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (conn->hostnames == old.hostnames && conn->coords == old.coords && old.clusterKeyName() == newName) - #line 2327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!currentKey.present()) + #line 2885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::SAME_NETWORK_ADDRESSES); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } - #line 2331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::SAME_NETWORK_ADDRESSES); - this->~ChangeQuorumCheckerActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ++retryTimes; + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->CHANGE_QUORUM_BAD_STATE_RETRY_DELAY); + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; } - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - conn->parseKey(newName + ':' + deterministicRandom()->randomAlphaNumeric(32)); - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (g_network->isSimulated()) - #line 2341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + else { - #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - int i = 0; - #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - int protectedCount = 0; - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - for(;(protectedCount < ((desiredCoordinators.size() / 2) + 1)) && (i < desiredCoordinators.size());) { - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - auto process = g_simulator.getProcessByAddress(desiredCoordinators[i]); - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - auto addresses = process->addresses; - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!process->isReliable()) - #line 2355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - i++; - #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - continue; - } - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - g_simulator.protectedAddresses.insert(process->addresses.address); - #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (addresses.secondaryAddress.present()) - #line 2366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - g_simulator.protectedAddresses.insert(process->addresses.secondaryAddress.get()); - #line 2370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - TraceEvent("ProtectCoordinator").detail("Address", desiredCoordinators[i]).backtrace(); - #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - protectedCount++; - #line 894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - i++; - #line 2378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - } - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::vector>> leaderServers; - #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ClientCoordinators coord(Reference(new ClusterConnectionMemoryRecord(*conn))); - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - leaderServers.reserve(coord.clientLeaderServers.size()); - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - for(int i = 0;i < coord.clientLeaderServers.size();i++) { - #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (coord.clientLeaderServers[i].hostname.present()) - #line 2391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - leaderServers.push_back(retryGetReplyFromHostname(GetLeaderRequest(coord.clusterKey, UID()), coord.clientLeaderServers[i].hostname.get(), WLTOKEN_CLIENTLEADERREG_GETLEADER, TaskPriority::CoordinationReply)); - #line 2395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - else - { - #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - leaderServers.push_back(retryBrokenPromise(coord.clientLeaderServers[i].getLeader, GetLeaderRequest(coord.clusterKey, UID()), TaskPriority::CoordinationReply)); - #line 2401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } + loopDepth = a_body1loopBody1cont4(loopDepth); } - #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_2 = waitForAll(leaderServers); - #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_3 = delay(5.0); - #line 2412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont2when2(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; return loopDepth; } - int a_body1cont2(std::vector && desiredCoordinators,int loopDepth) + int a_body1loopBody1cont1when1(Optional const& __currentKey,int loopDepth) { - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (desiredCoordinators.size() != conn->hostnames.size() + conn->coords.size()) - #line 2428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - TraceEvent("ChangeQuorumCheckerEarlyTermination") .detail("Reason", "One or more hostnames are unresolvable") .backtrace(); - #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::COORDINATOR_UNREACHABLE); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } - #line 2434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::COORDINATOR_UNREACHABLE); - this->~ChangeQuorumCheckerActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + currentKey = __currentKey; + #line 2912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1when1(Optional && __currentKey,int loopDepth) + { + currentKey = std::move(__currentKey); + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetClusterConnectionStringFromStorageServerActor, 1, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< GetClusterConnectionStringFromStorageServerActor, 1, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont1when1(value, 0); } - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (newName.empty()) - #line 2442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - newName = old.clusterKeyName().toString(); - #line 2446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); } - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::sort(conn->hostnames.begin(), conn->hostnames.end()); - #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::sort(conn->coords.begin(), conn->coords.end()); - #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::sort(old.hostnames.begin(), old.hostnames.end()); - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::sort(old.coords.begin(), old.coords.end()); - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (conn->hostnames == old.hostnames && conn->coords == old.coords && old.clusterKeyName() == newName) - #line 2458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::SAME_NETWORK_ADDRESSES); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::SAME_NETWORK_ADDRESSES); - this->~ChangeQuorumCheckerActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - conn->parseKey(newName + ':' + deterministicRandom()->randomAlphaNumeric(32)); - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (g_network->isSimulated()) - #line 2472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - int i = 0; - #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - int protectedCount = 0; - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - for(;(protectedCount < ((desiredCoordinators.size() / 2) + 1)) && (i < desiredCoordinators.size());) { - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - auto process = g_simulator.getProcessByAddress(desiredCoordinators[i]); - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - auto addresses = process->addresses; - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!process->isReliable()) - #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - i++; - #line 2490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - continue; - } - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - g_simulator.protectedAddresses.insert(process->addresses.address); - #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (addresses.secondaryAddress.present()) - #line 2497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - g_simulator.protectedAddresses.insert(process->addresses.secondaryAddress.get()); - #line 2501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - TraceEvent("ProtectCoordinator").detail("Address", desiredCoordinators[i]).backtrace(); - #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - protectedCount++; - #line 894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - i++; - #line 2509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - } - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::vector>> leaderServers; - #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ClientCoordinators coord(Reference(new ClusterConnectionMemoryRecord(*conn))); - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - leaderServers.reserve(coord.clientLeaderServers.size()); - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - for(int i = 0;i < coord.clientLeaderServers.size();i++) { - #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (coord.clientLeaderServers[i].hostname.present()) - #line 2522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - leaderServers.push_back(retryGetReplyFromHostname(GetLeaderRequest(coord.clusterKey, UID()), coord.clientLeaderServers[i].hostname.get(), WLTOKEN_CLIENTLEADERREG_GETLEADER, TaskPriority::CoordinationReply)); - #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - else - { - #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - leaderServers.push_back(retryBrokenPromise(coord.clientLeaderServers[i].getLeader, GetLeaderRequest(coord.clusterKey, UID()), TaskPriority::CoordinationReply)); - #line 2532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - } - #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_2 = waitForAll(leaderServers); - #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_3 = delay(5.0); - #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont2when2(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1when1(std::vector const& desiredCoordinators,int loopDepth) - { - loopDepth = a_body1cont2(desiredCoordinators, loopDepth); - - return loopDepth; - } - int a_body1cont1when1(std::vector && desiredCoordinators,int loopDepth) - { - loopDepth = a_body1cont2(std::move(desiredCoordinators), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeQuorumCheckerActor, 1, std::vector >::remove(); - - } - void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 1, std::vector >*,std::vector const& value) - { - fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); + fdb_probe_actor_exit("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetClusterConnectionStringFromStorageServerActor, 1, Optional >*,Optional && value) + { + fdb_probe_actor_enter("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 1, std::vector >*,std::vector && value) + void a_callback_error(ActorCallback< GetClusterConnectionStringFromStorageServerActor, 1, Optional >*,Error err) { - fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 1); + fdb_probe_actor_enter("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(std::move(value), 0); + a_body1Catch1(err, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< ChangeQuorumCheckerActor, 1, std::vector >*,Error err) + int a_body1loopBody1cont4(int loopDepth) { - fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1Catch1(err, 0); + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + clusterConnectionString = ClusterConnectionString(currentKey.get().toString()); + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (tr->getDatabase()->getConnectionRecord() && clusterConnectionString.clusterKeyName().toString() != tr->getDatabase()->getConnectionRecord()->getConnectionString().clusterKeyName()) + #line 2981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ++retryTimes; + #line 1078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_3 = delay(CLIENT_KNOBS->CHANGE_QUORUM_BAD_STATE_RETRY_DELAY); + #line 1078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 1078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); + else + { + loopDepth = a_body1loopBody1cont9(loopDepth); } - fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 1); - - } - int a_body1cont6(int loopDepth) - { - #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr->set(coordinatorsKey, conn->toString()); - #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } - #line 2624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); - this->~ChangeQuorumCheckerActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; return loopDepth; } - int a_body1cont2when1(Void const& _,int loopDepth) + int a_body1loopBody1cont7(Void const& _,int loopDepth) { - loopDepth = a_body1cont6(loopDepth); + return a_body1loopHead1(loopDepth); // continue return loopDepth; } - int a_body1cont2when1(Void && _,int loopDepth) + int a_body1loopBody1cont7(Void && _,int loopDepth) { - loopDepth = a_body1cont6(loopDepth); + return a_body1loopHead1(loopDepth); // continue return loopDepth; } - int a_body1cont2when2(Void const& _,int loopDepth) + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) { - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::COORDINATOR_UNREACHABLE); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } - #line 2648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::COORDINATOR_UNREACHABLE); - this->~ChangeQuorumCheckerActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1loopBody1cont7(_, loopDepth); return loopDepth; } - int a_body1cont2when2(Void && _,int loopDepth) + int a_body1loopBody1cont3when1(Void && _,int loopDepth) { - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::COORDINATOR_UNREACHABLE); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } - #line 2660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::COORDINATOR_UNREACHABLE); - this->~ChangeQuorumCheckerActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1loopBody1cont7(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeQuorumCheckerActor, 2, Void >::remove(); - static_cast(this)->ActorCallback< ChangeQuorumCheckerActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetClusterConnectionStringFromStorageServerActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetClusterConnectionStringFromStorageServerActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 2); + fdb_probe_actor_enter("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2when1(value, 0); + a_body1loopBody1cont3when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetClusterConnectionStringFromStorageServerActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 2); + fdb_probe_actor_enter("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2when1(std::move(value), 0); + a_body1loopBody1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< ChangeQuorumCheckerActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< GetClusterConnectionStringFromStorageServerActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 2); + fdb_probe_actor_enter("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -2714,43 +3073,85 @@ class ChangeQuorumCheckerActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 3, Void >*,Void const& value) + int a_body1loopBody1cont9(int loopDepth) { - fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 3); - a_exitChoose3(); + #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(clusterConnectionString); this->~GetClusterConnectionStringFromStorageServerActorState(); static_cast(this)->destroy(); return 0; } + #line 3083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(clusterConnectionString)); // state_var_RVO + this->~GetClusterConnectionStringFromStorageServerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont10(Void const& _,int loopDepth) + { + return a_body1loopHead1(loopDepth); // continue + + return loopDepth; + } + int a_body1loopBody1cont10(Void && _,int loopDepth) + { + return a_body1loopHead1(loopDepth); // continue + + return loopDepth; + } + int a_body1loopBody1cont4when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont10(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont10(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetClusterConnectionStringFromStorageServerActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetClusterConnectionStringFromStorageServerActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont2when2(value, 0); + a_body1loopBody1cont4when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetClusterConnectionStringFromStorageServerActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 3); - a_exitChoose3(); + fdb_probe_actor_enter("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont2when2(std::move(value), 0); + a_body1loopBody1cont4when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< ChangeQuorumCheckerActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< GetClusterConnectionStringFromStorageServerActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 3); - a_exitChoose3(); + fdb_probe_actor_enter("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -2759,47 +3160,47 @@ class ChangeQuorumCheckerActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), 3); } - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ClusterConnectionString* conn; - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::string newName; - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ClusterConnectionString old; - #line 2773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + int retryTimes; + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Optional currentKey; + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ClusterConnectionString clusterConnectionString; + #line 3174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; -// This generated class is to be used only via changeQuorumChecker() - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class ChangeQuorumCheckerActor final : public Actor>, public ActorCallback< ChangeQuorumCheckerActor, 0, Optional >, public ActorCallback< ChangeQuorumCheckerActor, 1, std::vector >, public ActorCallback< ChangeQuorumCheckerActor, 2, Void >, public ActorCallback< ChangeQuorumCheckerActor, 3, Void >, public FastAllocated, public ChangeQuorumCheckerActorState { - #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via getClusterConnectionStringFromStorageServer() + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class GetClusterConnectionStringFromStorageServerActor final : public Actor>, public ActorCallback< GetClusterConnectionStringFromStorageServerActor, 0, Version >, public ActorCallback< GetClusterConnectionStringFromStorageServerActor, 1, Optional >, public ActorCallback< GetClusterConnectionStringFromStorageServerActor, 2, Void >, public ActorCallback< GetClusterConnectionStringFromStorageServerActor, 3, Void >, public FastAllocated, public GetClusterConnectionStringFromStorageServerActorState { + #line 3179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< ChangeQuorumCheckerActor, 0, Optional >; -friend struct ActorCallback< ChangeQuorumCheckerActor, 1, std::vector >; -friend struct ActorCallback< ChangeQuorumCheckerActor, 2, Void >; -friend struct ActorCallback< ChangeQuorumCheckerActor, 3, Void >; - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ChangeQuorumCheckerActor(Transaction* const& tr,ClusterConnectionString* const& conn,std::string const& newName) - #line 2792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - : Actor>(), - ChangeQuorumCheckerActorState(tr, conn, newName) +friend struct ActorCallback< GetClusterConnectionStringFromStorageServerActor, 0, Version >; +friend struct ActorCallback< GetClusterConnectionStringFromStorageServerActor, 1, Optional >; +friend struct ActorCallback< GetClusterConnectionStringFromStorageServerActor, 2, Void >; +friend struct ActorCallback< GetClusterConnectionStringFromStorageServerActor, 3, Void >; + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + GetClusterConnectionStringFromStorageServerActor(Transaction* const& tr) + #line 3193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + : Actor>(), + GetClusterConnectionStringFromStorageServerActorState(tr) { - fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), -1); + fdb_probe_actor_enter("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("changeQuorumChecker"); + this->lineage.setActorName("getClusterConnectionStringFromStorageServer"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), -1); + fdb_probe_actor_exit("getClusterConnectionStringFromStorageServer", reinterpret_cast(this), -1); } void cancel() override @@ -2807,63 +3208,56 @@ friend struct ActorCallback< ChangeQuorumCheckerActor, 3, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ChangeQuorumCheckerActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< ChangeQuorumCheckerActor, 1, std::vector >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< ChangeQuorumCheckerActor, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetClusterConnectionStringFromStorageServerActor, 0, Version >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetClusterConnectionStringFromStorageServerActor, 1, Optional >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetClusterConnectionStringFromStorageServerActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< GetClusterConnectionStringFromStorageServerActor, 3, Void >*)0, actor_cancelled()); break; } } }; -} - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -[[nodiscard]] Future> changeQuorumChecker( Transaction* const& tr, ClusterConnectionString* const& conn, std::string const& newName ) { - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return Future>(new ChangeQuorumCheckerActor(tr, conn, newName)); - #line 2822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future> getClusterConnectionStringFromStorageServer( Transaction* const& tr ) { + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future>(new GetClusterConnectionStringFromStorageServerActor(tr)); + #line 3223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via changeQuorum() - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -template - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class ChangeQuorumActorState { - #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 3228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via verifyConfigurationDatabaseAlive() + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class VerifyConfigurationDatabaseAliveActorState { + #line 3234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ChangeQuorumActorState(Database const& cx,Reference const& change) - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + VerifyConfigurationDatabaseAliveActorState(Database const& cx) + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - change(change), - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr(cx), - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - retries(0), - #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - desiredCoordinators(), - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - notEnoughMachineResults(0) - #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + backoff(), + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + configTr() + #line 3245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - fdb_probe_actor_create("changeQuorum", reinterpret_cast(this)); + fdb_probe_actor_create("verifyConfigurationDatabaseAlive", reinterpret_cast(this)); } - ~ChangeQuorumActorState() + ~VerifyConfigurationDatabaseAliveActorState() { - fdb_probe_actor_destroy("changeQuorum", reinterpret_cast(this)); + fdb_probe_actor_destroy("verifyConfigurationDatabaseAlive", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 2866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 3260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2876,8 +3270,8 @@ class ChangeQuorumActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~ChangeQuorumActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~VerifyConfigurationDatabaseAliveActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; @@ -2892,24 +3286,24 @@ class ChangeQuorumActorState { int a_body1loopBody1(int loopDepth) { try { - #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); - #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture> __when_expr_0 = tr.get(coordinatorsKey); - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + configTr = ISingleThreadTransaction::create(ISingleThreadTransaction::Type::PAXOS_CONFIG, cx); + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Tuple tuple; + #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tuple.appendNull(); + #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tuple << "test"_sr; + #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture> __when_expr_0 = configTr->get(tuple.pack()); + #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 3306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2929,19 +3323,38 @@ class ChangeQuorumActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - TraceEvent("RetryQuorumChange").error(e).detail("Retries", retries); - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_8 = tr.onError(e); - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_8.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 8; - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + #line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent("ChangeQuorumCheckerNewCoordinatorsError").error(e); + #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (e.code() == error_code_coordinators_changed) + #line 3330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_1 = backoff.onError(); + #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_2 = configTr->onError(e); + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); @@ -2951,111 +3364,55 @@ class ChangeQuorumActorState { return loopDepth; } - int a_body1loopBody1cont2(Optional const& currentKey,int loopDepth) + int a_body1loopBody1cont2(Optional const& serializedValue,int loopDepth) { - #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!currentKey.present()) - #line 2958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::BAD_DATABASE_STATE); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } - #line 2962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::BAD_DATABASE_STATE); - this->~ChangeQuorumActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - old = ClusterConnectionString(currentKey.get().toString()); - #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (cx->getConnectionRecord() && old.clusterKeyName().toString() != cx->getConnectionRecord()->getConnectionString().clusterKeyName()) - #line 2972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::BAD_DATABASE_STATE); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } - #line 2976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::BAD_DATABASE_STATE); - this->~ChangeQuorumActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture> __when_expr_1 = old.tryResolveHostnames(); - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; - + #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent("ChangeQuorumCheckerNewCoordinatorsOnline").log(); + #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~VerifyConfigurationDatabaseAliveActorState(); static_cast(this)->destroy(); return 0; } + #line 3373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~VerifyConfigurationDatabaseAliveActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + return loopDepth; } - int a_body1loopBody1cont2(Optional && currentKey,int loopDepth) + int a_body1loopBody1cont2(Optional && serializedValue,int loopDepth) { - #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!currentKey.present()) - #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::BAD_DATABASE_STATE); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } - #line 3004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::BAD_DATABASE_STATE); - this->~ChangeQuorumActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - old = ClusterConnectionString(currentKey.get().toString()); - #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (cx->getConnectionRecord() && old.clusterKeyName().toString() != cx->getConnectionRecord()->getConnectionString().clusterKeyName()) - #line 3014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::BAD_DATABASE_STATE); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } - #line 3018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::BAD_DATABASE_STATE); - this->~ChangeQuorumActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture> __when_expr_1 = old.tryResolveHostnames(); - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent("ChangeQuorumCheckerNewCoordinatorsOnline").log(); + #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~VerifyConfigurationDatabaseAliveActorState(); static_cast(this)->destroy(); return 0; } + #line 3387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~VerifyConfigurationDatabaseAliveActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1loopBody1when1(Optional const& currentKey,int loopDepth) + int a_body1loopBody1when1(Optional const& serializedValue,int loopDepth) { - loopDepth = a_body1loopBody1cont2(currentKey, loopDepth); + loopDepth = a_body1loopBody1cont2(serializedValue, loopDepth); return loopDepth; } - int a_body1loopBody1when1(Optional && currentKey,int loopDepth) + int a_body1loopBody1when1(Optional && serializedValue,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(currentKey), loopDepth); + loopDepth = a_body1loopBody1cont2(std::move(serializedValue), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeQuorumActor, 0, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< VerifyConfigurationDatabaseAliveActor, 0, Optional >::remove(); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 0, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< VerifyConfigurationDatabaseAliveActor, 0, Optional >*,Optional const& value) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 0); + fdb_probe_actor_enter("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -3065,12 +3422,12 @@ class ChangeQuorumActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 0); + fdb_probe_actor_exit("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 0, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< VerifyConfigurationDatabaseAliveActor, 0, Optional >*,Optional && value) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 0); + fdb_probe_actor_enter("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -3080,12 +3437,12 @@ class ChangeQuorumActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 0); + fdb_probe_actor_exit("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< ChangeQuorumActor, 0, Optional >*,Error err) + void a_callback_error(ActorCallback< VerifyConfigurationDatabaseAliveActor, 0, Optional >*,Error err) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 0); + fdb_probe_actor_enter("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1Catch1(err, 0); @@ -3095,520 +3452,418 @@ class ChangeQuorumActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 0); + fdb_probe_actor_exit("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 0); } - int a_body1loopBody1cont3(int loopDepth) + int a_body1loopBody1Catch1cont1(int loopDepth) { - #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - result = CoordinatorsResult::SUCCESS; - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!desiredCoordinators.size()) - #line 3107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture> __when_expr_2 = change->getDesiredCoordinators( &tr, oldCoordinators, Reference(new ClusterConnectionMemoryRecord(old)), result); - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1loopBody1cont6(loopDepth); - } + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(std::vector const& __oldCoordinators,int loopDepth) + int a_body1loopBody1Catch1cont2(Void const& _,int loopDepth) { - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - oldCoordinators = __oldCoordinators; - #line 3132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); + #line 1104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + configTr->reset(); + #line 3468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(std::vector && __oldCoordinators,int loopDepth) + int a_body1loopBody1Catch1cont2(Void && _,int loopDepth) { - oldCoordinators = std::move(__oldCoordinators); - loopDepth = a_body1loopBody1cont3(loopDepth); + #line 1104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + configTr->reset(); + #line 3477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont2(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeQuorumActor, 1, std::vector >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< VerifyConfigurationDatabaseAliveActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 1, std::vector >*,std::vector const& value) + void a_callback_fire(ActorCallback< VerifyConfigurationDatabaseAliveActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 1); + fdb_probe_actor_enter("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1cont2when1(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 1); + fdb_probe_actor_exit("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 1, std::vector >*,std::vector && value) + void a_callback_fire(ActorCallback< VerifyConfigurationDatabaseAliveActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 1); + fdb_probe_actor_enter("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1cont2when1(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 1); + fdb_probe_actor_exit("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< ChangeQuorumActor, 1, std::vector >*,Error err) + void a_callback_error(ActorCallback< VerifyConfigurationDatabaseAliveActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 1); + fdb_probe_actor_enter("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 1); - - } - int a_body1loopBody1cont6(int loopDepth) - { - #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (result == CoordinatorsResult::NOT_ENOUGH_MACHINES && notEnoughMachineResults < 1) - #line 3199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - notEnoughMachineResults++; - #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_3 = delay(1.0); - #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1loopBody1cont9(loopDepth); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1loopBody1cont7(std::vector const& _desiredCoordinators,int loopDepth) + int a_body1loopBody1Catch1cont4(Void const& _,int loopDepth) { - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - desiredCoordinators = _desiredCoordinators; - #line 3226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont6(loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont7(std::vector && _desiredCoordinators,int loopDepth) + int a_body1loopBody1Catch1cont4(Void && _,int loopDepth) { - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - desiredCoordinators = _desiredCoordinators; - #line 3235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont6(loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont3when1(std::vector const& _desiredCoordinators,int loopDepth) + int a_body1loopBody1Catch1when2(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont7(_desiredCoordinators, loopDepth); + loopDepth = a_body1loopBody1Catch1cont4(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont3when1(std::vector && _desiredCoordinators,int loopDepth) + int a_body1loopBody1Catch1when2(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont7(std::move(_desiredCoordinators), loopDepth); + loopDepth = a_body1loopBody1Catch1cont4(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeQuorumActor, 2, std::vector >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< VerifyConfigurationDatabaseAliveActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 2, std::vector >*,std::vector const& value) + void a_callback_fire(ActorCallback< VerifyConfigurationDatabaseAliveActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 2); + fdb_probe_actor_enter("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont3when1(value, 0); + a_body1loopBody1Catch1when2(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 2); + fdb_probe_actor_exit("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 2, std::vector >*,std::vector && value) + void a_callback_fire(ActorCallback< VerifyConfigurationDatabaseAliveActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 2); + fdb_probe_actor_enter("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont3when1(std::move(value), 0); + a_body1loopBody1Catch1when2(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 2); + fdb_probe_actor_exit("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< ChangeQuorumActor, 2, std::vector >*,Error err) + void a_callback_error(ActorCallback< VerifyConfigurationDatabaseAliveActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 2); + fdb_probe_actor_enter("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 2); + fdb_probe_actor_exit("verifyConfigurationDatabaseAlive", reinterpret_cast(this), 2); } - int a_body1loopBody1cont9(int loopDepth) + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Database cx; + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Backoff backoff; + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Reference configTr; + #line 3626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +}; +// This generated class is to be used only via verifyConfigurationDatabaseAlive() + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class VerifyConfigurationDatabaseAliveActor final : public Actor, public ActorCallback< VerifyConfigurationDatabaseAliveActor, 0, Optional >, public ActorCallback< VerifyConfigurationDatabaseAliveActor, 1, Void >, public ActorCallback< VerifyConfigurationDatabaseAliveActor, 2, Void >, public FastAllocated, public VerifyConfigurationDatabaseAliveActorState { + #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< VerifyConfigurationDatabaseAliveActor, 0, Optional >; +friend struct ActorCallback< VerifyConfigurationDatabaseAliveActor, 1, Void >; +friend struct ActorCallback< VerifyConfigurationDatabaseAliveActor, 2, Void >; + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + VerifyConfigurationDatabaseAliveActor(Database const& cx) + #line 3644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + : Actor(), + VerifyConfigurationDatabaseAliveActorState(cx) { - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (result != CoordinatorsResult::SUCCESS) - #line 3307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(result); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } - #line 3311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(std::move(result)); // state_var_RVO - this->~ChangeQuorumActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!desiredCoordinators.size()) - #line 3319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::INVALID_NETWORK_ADDRESSES); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } - #line 3323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::INVALID_NETWORK_ADDRESSES); - this->~ChangeQuorumActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::sort(desiredCoordinators.begin(), desiredCoordinators.end()); - #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::string newName = change->getDesiredClusterKeyName(); - #line 973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (newName.empty()) - #line 3335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - newName = old.clusterKeyName().toString(); - #line 3339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (oldCoordinators == desiredCoordinators && old.clusterKeyName() == newName) - #line 3343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(retries ? CoordinatorsResult::SUCCESS : CoordinatorsResult::SAME_NETWORK_ADDRESSES); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } - #line 3347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(retries ? CoordinatorsResult::SUCCESS : CoordinatorsResult::SAME_NETWORK_ADDRESSES); - this->~ChangeQuorumActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - conn = ClusterConnectionString(desiredCoordinators, StringRef(newName + ':' + deterministicRandom()->randomAlphaNumeric(32))); - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (g_network->isSimulated()) - #line 3357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - for(int i = 0;i < (desiredCoordinators.size() / 2) + 1;i++) { - #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - auto process = g_simulator.getProcessByAddress(desiredCoordinators[i]); - #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ASSERT(process->isReliable() || process->rebooting); - #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - g_simulator.protectedAddresses.insert(process->addresses.address); - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (process->addresses.secondaryAddress.present()) - #line 3369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - g_simulator.protectedAddresses.insert(process->addresses.secondaryAddress.get()); - #line 3373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - TraceEvent("ProtectCoordinator").detail("Address", desiredCoordinators[i]).backtrace(); - #line 3377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - } - #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - TraceEvent("AttemptingQuorumChange").detail("FromCS", old.toString()).detail("ToCS", conn.toString()); - #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - TEST(old.clusterKeyName() != conn.clusterKeyName()); - #line 997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - TEST(old.clusterKeyName() == conn.clusterKeyName()); - #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - leaderServers = std::vector>>(); - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - coord = ClientCoordinators(Reference(new ClusterConnectionMemoryRecord(conn))); - #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!change->getDesiredClusterKeyName().empty()) - #line 3392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_4 = coord.clientLeaderServers[0].checkDescriptorMutable.getReply(CheckDescriptorMutableRequest()); - #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont9when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1loopBody1cont11(loopDepth); - } + fdb_probe_actor_enter("verifyConfigurationDatabaseAlive", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("verifyConfigurationDatabaseAlive"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("verifyConfigurationDatabaseAlive", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1loopBody1cont10(Void const& _,int loopDepth) + void cancel() override { - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.reset(); - #line 3417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - return a_body1loopHead1(loopDepth); // continue + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< VerifyConfigurationDatabaseAliveActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< VerifyConfigurationDatabaseAliveActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< VerifyConfigurationDatabaseAliveActor, 2, Void >*)0, actor_cancelled()); break; + } - return loopDepth; } - int a_body1loopBody1cont10(Void && _,int loopDepth) +}; + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future verifyConfigurationDatabaseAlive( Database const& cx ) { + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new VerifyConfigurationDatabaseAliveActor(cx)); + #line 3673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +} + +#line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + + #line 3678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via resetPreviousCoordinatorsKey() + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class ResetPreviousCoordinatorsKeyActorState { + #line 3684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ResetPreviousCoordinatorsKeyActorState(Database const& cx) + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + : cx(cx) + #line 3691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.reset(); - #line 3426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - return a_body1loopHead1(loopDepth); // continue + fdb_probe_actor_create("resetPreviousCoordinatorsKey", reinterpret_cast(this)); - return loopDepth; } - int a_body1loopBody1cont6when1(Void const& _,int loopDepth) + ~ResetPreviousCoordinatorsKeyActorState() { - loopDepth = a_body1loopBody1cont10(_, loopDepth); + fdb_probe_actor_destroy("resetPreviousCoordinatorsKey", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ; + #line 3706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1loopBody1cont6when1(Void && _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - loopDepth = a_body1loopBody1cont10(std::move(_), loopDepth); + this->~ResetPreviousCoordinatorsKeyActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - void a_exitChoose4() + int a_body1loopHead1(int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeQuorumActor, 3, Void >::remove(); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 3, Void >*,Void const& value) + int a_body1loopBody1(int loopDepth) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 3); - a_exitChoose4(); + #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + clearTr = ISingleThreadTransaction::create(ISingleThreadTransaction::Type::RYW, cx); + #line 3736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" try { - a_body1loopBody1cont6when1(value, 0); + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + clearTr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + clearTr->clear(previousCoordinatorsKey); + #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_0 = clearTr->commit(); + #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1loopBody1Catch1(error, loopDepth); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 3); + return loopDepth; } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 3, Void >*,Void && value) + int a_body1loopBody1cont1(int loopDepth) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1cont6when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 3); + if (loopDepth == 0) return a_body1loopHead1(0); + return loopDepth; } - void a_callback_error(ActorCallback< ChangeQuorumActor, 3, Void >*,Error err) + int a_body1loopBody1Catch1(const Error& e2,int loopDepth=0) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 3); - a_exitChoose4(); try { - a_body1loopBody1Catch1(err, 0); + #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_1 = clearTr->onError(e2); + #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 3); - - } - int a_body1loopBody1cont11(int loopDepth) - { - #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - leaderServers.reserve(coord.clientLeaderServers.size()); - #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - for(int i = 0;i < coord.clientLeaderServers.size();i++) { - #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - leaderServers.push_back(retryBrokenPromise(coord.clientLeaderServers[i].getLeader, GetLeaderRequest(coord.clusterKey, UID()), TaskPriority::CoordinationReply)); - #line 3502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } - #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_5 = waitForAll(leaderServers); - #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont11when1(__when_expr_5.get(), loopDepth); }; - #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_6 = delay(5.0); - #line 3512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1loopBody1cont11when2(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont19(CheckDescriptorMutableReply const& mutabilityReply,int loopDepth) + int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!mutabilityReply.isMutable) - #line 3528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::BAD_DATABASE_STATE); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } - #line 3532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::BAD_DATABASE_STATE); - this->~ChangeQuorumActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - loopDepth = a_body1loopBody1cont11(loopDepth); + #line 1125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ResetPreviousCoordinatorsKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 3795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ResetPreviousCoordinatorsKeyActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1loopBody1cont19(CheckDescriptorMutableReply && mutabilityReply,int loopDepth) + int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!mutabilityReply.isMutable) - #line 3546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::BAD_DATABASE_STATE); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } - #line 3550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::BAD_DATABASE_STATE); - this->~ChangeQuorumActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - loopDepth = a_body1loopBody1cont11(loopDepth); + #line 1125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ResetPreviousCoordinatorsKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 3807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ResetPreviousCoordinatorsKeyActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1loopBody1cont9when1(CheckDescriptorMutableReply const& mutabilityReply,int loopDepth) + int a_body1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont19(mutabilityReply, loopDepth); + loopDepth = a_body1loopBody1cont2(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont9when1(CheckDescriptorMutableReply && mutabilityReply,int loopDepth) + int a_body1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont19(std::move(mutabilityReply), loopDepth); + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose5() + void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeQuorumActor, 4, CheckDescriptorMutableReply >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ResetPreviousCoordinatorsKeyActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 4, CheckDescriptorMutableReply >*,CheckDescriptorMutableReply const& value) + void a_callback_fire(ActorCallback< ResetPreviousCoordinatorsKeyActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("resetPreviousCoordinatorsKey", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1cont9when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 4); + fdb_probe_actor_exit("resetPreviousCoordinatorsKey", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 4, CheckDescriptorMutableReply >*,CheckDescriptorMutableReply && value) + void a_callback_fire(ActorCallback< ResetPreviousCoordinatorsKeyActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("resetPreviousCoordinatorsKey", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1cont9when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 4); + fdb_probe_actor_exit("resetPreviousCoordinatorsKey", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< ChangeQuorumActor, 4, CheckDescriptorMutableReply >*,Error err) + void a_callback_error(ActorCallback< ResetPreviousCoordinatorsKeyActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("resetPreviousCoordinatorsKey", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1loopBody1Catch1(err, 0); } @@ -3617,324 +3872,440 @@ class ChangeQuorumActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 4); + fdb_probe_actor_exit("resetPreviousCoordinatorsKey", reinterpret_cast(this), 0); } - int a_body1loopBody1cont11cont1(int loopDepth) - { - #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.set(coordinatorsKey, conn.toString()); - #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_7 = tr.commit(); - #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1loopBody1cont11cont1when1(__when_expr_7.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont11when1(Void const& _,int loopDepth) + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont11cont1(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont11when1(Void && _,int loopDepth) + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont11cont1(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont11when2(Void const& _,int loopDepth) + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::COORDINATOR_UNREACHABLE); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } - #line 3657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::COORDINATOR_UNREACHABLE); - this->~ChangeQuorumActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont11when2(Void && _,int loopDepth) + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::COORDINATOR_UNREACHABLE); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } - #line 3669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::COORDINATOR_UNREACHABLE); - this->~ChangeQuorumActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose6() + void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeQuorumActor, 5, Void >::remove(); - static_cast(this)->ActorCallback< ChangeQuorumActor, 6, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ResetPreviousCoordinatorsKeyActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 5, Void >*,Void const& value) + void a_callback_fire(ActorCallback< ResetPreviousCoordinatorsKeyActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("resetPreviousCoordinatorsKey", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1cont11when1(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 5); + fdb_probe_actor_exit("resetPreviousCoordinatorsKey", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< ResetPreviousCoordinatorsKeyActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("resetPreviousCoordinatorsKey", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1cont11when1(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 5); + fdb_probe_actor_exit("resetPreviousCoordinatorsKey", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< ChangeQuorumActor, 5, Void >*,Error err) + void a_callback_error(ActorCallback< ResetPreviousCoordinatorsKeyActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("resetPreviousCoordinatorsKey", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 5); + fdb_probe_actor_exit("resetPreviousCoordinatorsKey", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 6, Void >*,Void const& value) + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Database cx; + #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Reference clearTr; + #line 3957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +}; +// This generated class is to be used only via resetPreviousCoordinatorsKey() + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class ResetPreviousCoordinatorsKeyActor final : public Actor, public ActorCallback< ResetPreviousCoordinatorsKeyActor, 0, Void >, public ActorCallback< ResetPreviousCoordinatorsKeyActor, 1, Void >, public FastAllocated, public ResetPreviousCoordinatorsKeyActorState { + #line 3962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ResetPreviousCoordinatorsKeyActor, 0, Void >; +friend struct ActorCallback< ResetPreviousCoordinatorsKeyActor, 1, Void >; + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ResetPreviousCoordinatorsKeyActor(Database const& cx) + #line 3974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + : Actor(), + ResetPreviousCoordinatorsKeyActorState(cx) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 6); - a_exitChoose6(); - try { - a_body1loopBody1cont11when2(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 6); + fdb_probe_actor_enter("resetPreviousCoordinatorsKey", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("resetPreviousCoordinatorsKey"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("resetPreviousCoordinatorsKey", reinterpret_cast(this), -1); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 6, Void >*,Void && value) + void cancel() override { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 6); - a_exitChoose6(); - try { - a_body1loopBody1cont11when2(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ResetPreviousCoordinatorsKeyActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ResetPreviousCoordinatorsKeyActor, 1, Void >*)0, actor_cancelled()); break; } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 6); } - void a_callback_error(ActorCallback< ChangeQuorumActor, 6, Void >*,Error err) +}; + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future resetPreviousCoordinatorsKey( Database const& cx ) { + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new ResetPreviousCoordinatorsKeyActor(cx)); + #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +} + +#line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + +} // namespace + + #line 4009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via changeQuorumChecker() + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class ChangeQuorumCheckerActorState { + #line 4016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ChangeQuorumCheckerActorState(Transaction* const& tr,ClusterConnectionString* const& conn,std::string const& newName,bool const& disableConfigDB) + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + : tr(tr), + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + conn(conn), + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newName(newName), + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + disableConfigDB(disableConfigDB) + #line 4029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + fdb_probe_actor_create("changeQuorumChecker", reinterpret_cast(this)); + + } + ~ChangeQuorumCheckerActorState() + { + fdb_probe_actor_destroy("changeQuorumChecker", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 6); - a_exitChoose6(); try { - a_body1loopBody1Catch1(err, 0); + #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent("ChangeQuorumCheckerStart").detail("NewConnectionString", conn->toString()); + #line 1139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture> __when_expr_0 = getClusterConnectionStringFromStorageServer(tr); + #line 1139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 4053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 6); + return loopDepth; } - int a_body1loopBody1cont11cont3(Void const& _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ASSERT(false); - #line 3778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont11cont5(loopDepth); + this->~ChangeQuorumCheckerActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont11cont3(Void && _,int loopDepth) + int a_body1cont1(int loopDepth) { - #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ASSERT(false); - #line 3787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont11cont5(loopDepth); + #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!clusterConnectionStringOptional.present()) + #line 4076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::BAD_DATABASE_STATE); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } + #line 4080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::BAD_DATABASE_STATE); + this->~ChangeQuorumCheckerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + old = clusterConnectionStringOptional.get(); + #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (conn->hostnames.size() + conn->coords.size() == 0) + #line 4090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + conn->hostnames = old.hostnames; + #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + conn->coords = old.coords; + #line 4096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture> __when_expr_1 = conn->tryResolveHostnames(); + #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 4107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont11cont1when1(Void const& _,int loopDepth) + int a_body1when1(Optional const& __clusterConnectionStringOptional,int loopDepth) { - loopDepth = a_body1loopBody1cont11cont3(_, loopDepth); + #line 1139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + clusterConnectionStringOptional = __clusterConnectionStringOptional; + #line 4116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont11cont1when1(Void && _,int loopDepth) + int a_body1when1(Optional && __clusterConnectionStringOptional,int loopDepth) { - loopDepth = a_body1loopBody1cont11cont3(std::move(_), loopDepth); + clusterConnectionStringOptional = std::move(__clusterConnectionStringOptional); + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - void a_exitChoose7() + void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeQuorumActor, 7, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeQuorumCheckerActor, 0, Optional >::remove(); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 7, Void >*,Void const& value) + void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 0, Optional >*,Optional const& value) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 7); - a_exitChoose7(); + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1cont11cont1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 7); + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 7, Void >*,Void && value) + void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 0, Optional >*,Optional && value) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 7); - a_exitChoose7(); + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1cont11cont1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 7); + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< ChangeQuorumActor, 7, Void >*,Error err) + void a_callback_error(ActorCallback< ChangeQuorumCheckerActor, 0, Optional >*,Error err) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 7); - a_exitChoose7(); + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 7); + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 0); } - int a_body1loopBody1cont11cont5(int loopDepth) + int a_body1cont2(int loopDepth) { - try { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (desiredCoordinators.size() != conn->hostnames.size() + conn->coords.size()) + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent("ChangeQuorumCheckerEarlyTermination") .detail("Reason", "One or more hostnames are unresolvable") .backtrace(); + #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::COORDINATOR_UNREACHABLE); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } + #line 4189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::COORDINATOR_UNREACHABLE); + this->~ChangeQuorumCheckerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (newName.empty()) + #line 4197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newName = old.clusterKeyName().toString(); + #line 4201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::sort(conn->hostnames.begin(), conn->hostnames.end()); + #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::sort(conn->coords.begin(), conn->coords.end()); + #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::sort(old.hostnames.begin(), old.hostnames.end()); + #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::sort(old.coords.begin(), old.coords.end()); + #line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (conn->hostnames == old.hostnames && conn->coords == old.coords && old.clusterKeyName() == newName) + #line 4213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + connectionStrings.clear(); + #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (g_network->isSimulated() && g_simulator->configDBType == ConfigDBType::DISABLED) + #line 4219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + disableConfigDB = true; + #line 4223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!disableConfigDB) + #line 4227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_2 = verifyConfigurationDatabaseAlive(tr->getDatabase()); + #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont8(loopDepth); + } + } + else + { + loopDepth = a_body1cont5(loopDepth); } return loopDepth; } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) - { - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ++retries; - #line 3872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) - { - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ++retries; - #line 3881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont1when1(std::vector const& __desiredCoordinators,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + desiredCoordinators = __desiredCoordinators; + #line 4257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1cont1when1(std::vector && __desiredCoordinators,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + desiredCoordinators = std::move(__desiredCoordinators); + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - void a_exitChoose8() + void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeQuorumActor, 8, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeQuorumCheckerActor, 1, std::vector >::remove(); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 8, Void >*,Void const& value) + void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 1, std::vector >*,std::vector const& value) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 8); - a_exitChoose8(); + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1Catch1when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 8); + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< ChangeQuorumActor, 8, Void >*,Void && value) + void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 1, std::vector >*,std::vector && value) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 8); - a_exitChoose8(); + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1Catch1when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 8); + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< ChangeQuorumActor, 8, Void >*,Error err) + void a_callback_error(ActorCallback< ChangeQuorumCheckerActor, 1, std::vector >*,Error err) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 8); - a_exitChoose8(); + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -3943,265 +4314,296 @@ class ChangeQuorumActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 8); + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 1); } - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Database cx; - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Reference change; - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Transaction tr; - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - int retries; - #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::vector desiredCoordinators; - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - int notEnoughMachineResults; - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ClusterConnectionString old; - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::vector oldCoordinators; - #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - CoordinatorsResult result; - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ClusterConnectionString conn; - #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::vector>> leaderServers; - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ClientCoordinators coord; - #line 3973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -}; -// This generated class is to be used only via changeQuorum() - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class ChangeQuorumActor final : public Actor, public ActorCallback< ChangeQuorumActor, 0, Optional >, public ActorCallback< ChangeQuorumActor, 1, std::vector >, public ActorCallback< ChangeQuorumActor, 2, std::vector >, public ActorCallback< ChangeQuorumActor, 3, Void >, public ActorCallback< ChangeQuorumActor, 4, CheckDescriptorMutableReply >, public ActorCallback< ChangeQuorumActor, 5, Void >, public ActorCallback< ChangeQuorumActor, 6, Void >, public ActorCallback< ChangeQuorumActor, 7, Void >, public ActorCallback< ChangeQuorumActor, 8, Void >, public FastAllocated, public ChangeQuorumActorState { - #line 3978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< ChangeQuorumActor, 0, Optional >; -friend struct ActorCallback< ChangeQuorumActor, 1, std::vector >; -friend struct ActorCallback< ChangeQuorumActor, 2, std::vector >; -friend struct ActorCallback< ChangeQuorumActor, 3, Void >; -friend struct ActorCallback< ChangeQuorumActor, 4, CheckDescriptorMutableReply >; -friend struct ActorCallback< ChangeQuorumActor, 5, Void >; -friend struct ActorCallback< ChangeQuorumActor, 6, Void >; -friend struct ActorCallback< ChangeQuorumActor, 7, Void >; -friend struct ActorCallback< ChangeQuorumActor, 8, Void >; - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ChangeQuorumActor(Database const& cx,Reference const& change) - #line 3997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - : Actor(), - ChangeQuorumActorState(cx, change) + int a_body1cont5(int loopDepth) { - fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("changeQuorum"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), -1); + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + conn->parseKey(newName + ':' + deterministicRandom()->randomAlphaNumeric(32)); + #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + connectionStrings.push_back(conn->toString()); + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (g_network->isSimulated()) + #line 4328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + int i = 0; + #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + int protectedCount = 0; + #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + int minimumCoordinators = (desiredCoordinators.size() / 2) + 1; + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + for(;protectedCount < minimumCoordinators && i < desiredCoordinators.size();) { + #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + auto process = g_simulator->getProcessByAddress(desiredCoordinators[i]); + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + auto addresses = process->addresses; + #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!process->isReliable()) + #line 4344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + i++; + #line 4348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + continue; + } + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + g_simulator->protectedAddresses.insert(process->addresses.address); + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (addresses.secondaryAddress.present()) + #line 4355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + g_simulator->protectedAddresses.insert(process->addresses.secondaryAddress.get()); + #line 4359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent("ProtectCoordinator").detail("Address", desiredCoordinators[i]).backtrace(); + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + protectedCount++; + #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + i++; + #line 4367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (protectedCount < minimumCoordinators) + #line 4371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent("NotEnoughReliableCoordinators") .detail("NumReliable", protectedCount) .detail("MinimumRequired", minimumCoordinators) .detail("ConnectionString", conn->toString()); + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::COORDINATOR_UNREACHABLE); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } + #line 4377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::COORDINATOR_UNREACHABLE); + this->~ChangeQuorumCheckerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::vector>> leaderServers; + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ClientCoordinators coord(Reference(new ClusterConnectionMemoryRecord(*conn))); + #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + leaderServers.reserve(coord.clientLeaderServers.size()); + #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + for(int i = 0;i < coord.clientLeaderServers.size();i++) { + #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (coord.clientLeaderServers[i].hostname.present()) + #line 4394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + leaderServers.push_back(retryGetReplyFromHostname(GetLeaderRequest(coord.clusterKey, UID()), coord.clientLeaderServers[i].hostname.get(), WLTOKEN_CLIENTLEADERREG_GETLEADER, TaskPriority::CoordinationReply)); + #line 4398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + else + { + #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + leaderServers.push_back(retryBrokenPromise(coord.clientLeaderServers[i].getLeader, GetLeaderRequest(coord.clusterKey, UID()), TaskPriority::CoordinationReply)); + #line 4404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + } + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_5 = waitForAll(leaderServers); + #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont5when1(__when_expr_5.get(), loopDepth); }; + #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_6 = delay(5.0); + #line 4415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont5when2(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + return loopDepth; } - void cancel() override + int a_body1cont8(int loopDepth) { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ChangeQuorumActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< ChangeQuorumActor, 1, std::vector >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< ChangeQuorumActor, 2, std::vector >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< ChangeQuorumActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< ChangeQuorumActor, 4, CheckDescriptorMutableReply >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< ChangeQuorumActor, 5, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< ChangeQuorumActor, 7, Void >*)0, actor_cancelled()); break; - case 8: this->a_callback_error((ActorCallback< ChangeQuorumActor, 8, Void >*)0, actor_cancelled()); break; + #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (BUGGIFY_WITH_PROB(0.1)) + #line 4431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_3 = delay(deterministicRandom()->random01() * 10); + #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont8when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont11(loopDepth); } + return loopDepth; } -}; -} - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -[[nodiscard]] Future changeQuorum( Database const& cx, Reference const& change ) { - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return Future(new ChangeQuorumActor(cx, change)); - #line 4032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -} + int a_body1cont10(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8(loopDepth); -#line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return loopDepth; + } + int a_body1cont10(Void && _,int loopDepth) + { + loopDepth = a_body1cont8(loopDepth); -struct NameQuorumChange final : IQuorumChange { - std::string newName; - Reference otherChange; - explicit NameQuorumChange(std::string const& newName, Reference const& otherChange) - : newName(newName), otherChange(otherChange) {} - Future> getDesiredCoordinators(Transaction* tr, - std::vector oldCoordinators, - Reference ccr, - CoordinatorsResult& t) override { - return otherChange->getDesiredCoordinators(tr, oldCoordinators, ccr, t); + return loopDepth; } - std::string getDesiredClusterKeyName() const override { return newName; } -}; -Reference nameQuorumChange(std::string const& name, Reference const& other) { - return Reference(new NameQuorumChange(name, other)); -} + int a_body1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont10(_, loopDepth); -struct AutoQuorumChange final : IQuorumChange { - int desired; - explicit AutoQuorumChange(int desired) : desired(desired) {} + return loopDepth; + } + int a_body1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont10(std::move(_), loopDepth); - Future> getDesiredCoordinators(Transaction* tr, - std::vector oldCoordinators, - Reference ccr, - CoordinatorsResult& err) override { - return getDesired(Reference::addRef(this), tr, oldCoordinators, ccr, &err); + return loopDepth; } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeQuorumCheckerActor, 2, Void >::remove(); - #line 4065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -// This generated class is to be used only via getRedundancy() - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -template - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class GetRedundancyActorState { - #line 4071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -public: - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - GetRedundancyActorState(AutoQuorumChange* const& self,Transaction* const& tr) - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - : self(self), - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr(tr), - #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - fStorageReplicas(tr->get(LiteralStringRef("storage_replicas").withPrefix(configKeysPrefix))), - #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - fLogReplicas(tr->get(LiteralStringRef("log_replicas").withPrefix(configKeysPrefix))) - #line 4084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 2, Void >*,Void const& value) { - fdb_probe_actor_create("getRedundancy", reinterpret_cast(this)); + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 2); } - ~GetRedundancyActorState() + void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 2, Void >*,Void && value) { - fdb_probe_actor_destroy("getRedundancy", reinterpret_cast(this)); + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 2); } - int a_body1(int loopDepth=0) + void a_callback_error(ActorCallback< ChangeQuorumCheckerActor, 2, Void >*,Error err) { + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 2); + a_exitChoose3(); try { - #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_0 = success(fStorageReplicas) && success(fLogReplicas); - #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + a_body1Catch1(err, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 2); - return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) + int a_body1cont11(int loopDepth) { - this->~GetRedundancyActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_4 = resetPreviousCoordinatorsKey(tr->getDatabase()); + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont11when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1(Void const& _,int loopDepth) + int a_body1cont12(Void const& _,int loopDepth) { - #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - int redundancy = std::min(atoi(fStorageReplicas.get().get().toString().c_str()), atoi(fLogReplicas.get().get().toString().c_str())); - #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(redundancy); this->~GetRedundancyActorState(); static_cast(this)->destroy(); return 0; } - #line 4131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< int >::value()) int(redundancy); - this->~GetRedundancyActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont11(loopDepth); return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1cont12(Void && _,int loopDepth) { - #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - int redundancy = std::min(atoi(fStorageReplicas.get().get().toString().c_str()), atoi(fLogReplicas.get().get().toString().c_str())); - #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(redundancy); this->~GetRedundancyActorState(); static_cast(this)->destroy(); return 0; } - #line 4145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< int >::value()) int(redundancy); - this->~GetRedundancyActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont11(loopDepth); return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1cont8when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + loopDepth = a_body1cont12(_, loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1cont8when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont12(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRedundancyActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeQuorumCheckerActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< GetRedundancyActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("getRedundancy", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1when1(value, 0); + a_body1cont8when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRedundancy", reinterpret_cast(this), 0); + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< GetRedundancyActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("getRedundancy", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1when1(std::move(value), 0); + a_body1cont8when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRedundancy", reinterpret_cast(this), 0); + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< GetRedundancyActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< ChangeQuorumCheckerActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("getRedundancy", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -4210,34 +4612,1685 @@ class GetRedundancyActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRedundancy", reinterpret_cast(this), 0); + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 3); } - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - AutoQuorumChange* self; - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Transaction* tr; - #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Future> fStorageReplicas; - #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Future> fLogReplicas; - #line 4224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -}; -// This generated class is to be used only via getRedundancy() - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class GetRedundancyActor final : public Actor, public ActorCallback< GetRedundancyActor, 0, Void >, public FastAllocated, public GetRedundancyActorState { - #line 4229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< GetRedundancyActor, 0, Void >; - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + int a_body1cont11cont1(Void const& _,int loopDepth) + { + #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::SAME_NETWORK_ADDRESSES); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } + #line 4622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::SAME_NETWORK_ADDRESSES); + this->~ChangeQuorumCheckerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont11cont1(Void && _,int loopDepth) + { + #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::SAME_NETWORK_ADDRESSES); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } + #line 4634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::SAME_NETWORK_ADDRESSES); + this->~ChangeQuorumCheckerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont11when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont11cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont11when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont11cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeQuorumCheckerActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont11when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont11when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< ChangeQuorumCheckerActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 4); + + } + int a_body1cont13(int loopDepth) + { + #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent("ChangeQuorumCheckerSetCoordinatorsKey") .detail("CurrentCoordinators", old.toString()) .detail("NewCoordinators", conn->toString()); + #line 1249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->set(coordinatorsKey, conn->toString()); + #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } + #line 4713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~ChangeQuorumCheckerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont5when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont13(loopDepth); + + return loopDepth; + } + int a_body1cont5when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont13(loopDepth); + + return loopDepth; + } + int a_body1cont5when2(Void const& _,int loopDepth) + { + #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::COORDINATOR_UNREACHABLE); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } + #line 4737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::COORDINATOR_UNREACHABLE); + this->~ChangeQuorumCheckerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont5when2(Void && _,int loopDepth) + { + #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(CoordinatorsResult::COORDINATOR_UNREACHABLE); this->~ChangeQuorumCheckerActorState(); static_cast(this)->destroy(); return 0; } + #line 4749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(CoordinatorsResult::COORDINATOR_UNREACHABLE); + this->~ChangeQuorumCheckerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeQuorumCheckerActor, 5, Void >::remove(); + static_cast(this)->ActorCallback< ChangeQuorumCheckerActor, 6, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont5when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 5, Void >*,Void && value) + { + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont5when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< ChangeQuorumCheckerActor, 5, Void >*,Error err) + { + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 6, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1cont5when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 6); + + } + void a_callback_fire(ActorCallback< ChangeQuorumCheckerActor, 6, Void >*,Void && value) + { + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1cont5when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 6); + + } + void a_callback_error(ActorCallback< ChangeQuorumCheckerActor, 6, Void >*,Error err) + { + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), 6); + + } + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Transaction* tr; + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ClusterConnectionString* conn; + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::string newName; + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + bool disableConfigDB; + #line 1139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Optional clusterConnectionStringOptional; + #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ClusterConnectionString old; + #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::vector desiredCoordinators; + #line 4868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +}; +// This generated class is to be used only via changeQuorumChecker() + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class ChangeQuorumCheckerActor final : public Actor>, public ActorCallback< ChangeQuorumCheckerActor, 0, Optional >, public ActorCallback< ChangeQuorumCheckerActor, 1, std::vector >, public ActorCallback< ChangeQuorumCheckerActor, 2, Void >, public ActorCallback< ChangeQuorumCheckerActor, 3, Void >, public ActorCallback< ChangeQuorumCheckerActor, 4, Void >, public ActorCallback< ChangeQuorumCheckerActor, 5, Void >, public ActorCallback< ChangeQuorumCheckerActor, 6, Void >, public FastAllocated, public ChangeQuorumCheckerActorState { + #line 4873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ChangeQuorumCheckerActor, 0, Optional >; +friend struct ActorCallback< ChangeQuorumCheckerActor, 1, std::vector >; +friend struct ActorCallback< ChangeQuorumCheckerActor, 2, Void >; +friend struct ActorCallback< ChangeQuorumCheckerActor, 3, Void >; +friend struct ActorCallback< ChangeQuorumCheckerActor, 4, Void >; +friend struct ActorCallback< ChangeQuorumCheckerActor, 5, Void >; +friend struct ActorCallback< ChangeQuorumCheckerActor, 6, Void >; + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ChangeQuorumCheckerActor(Transaction* const& tr,ClusterConnectionString* const& conn,std::string const& newName,bool const& disableConfigDB) + #line 4890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + : Actor>(), + ChangeQuorumCheckerActorState(tr, conn, newName, disableConfigDB) + { + fdb_probe_actor_enter("changeQuorumChecker", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("changeQuorumChecker"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("changeQuorumChecker", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ChangeQuorumCheckerActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ChangeQuorumCheckerActor, 1, std::vector >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ChangeQuorumCheckerActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< ChangeQuorumCheckerActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< ChangeQuorumCheckerActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< ChangeQuorumCheckerActor, 5, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future> changeQuorumChecker( Transaction* const& tr, ClusterConnectionString* const& conn, std::string const& newName, bool const& disableConfigDB ) { + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future>(new ChangeQuorumCheckerActor(tr, conn, newName, disableConfigDB)); + #line 4923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +} + +#line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + + #line 4928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via changeQuorum() + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class ChangeQuorumActorState { + #line 4935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ChangeQuorumActorState(Database const& cx,Reference const& change) + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + : cx(cx), + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + change(change), + #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr(cx), + #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + retries(0), + #line 1256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + desiredCoordinators(), + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + notEnoughMachineResults(0) + #line 4952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + fdb_probe_actor_create("changeQuorum", reinterpret_cast(this)); + + } + ~ChangeQuorumActorState() + { + fdb_probe_actor_destroy("changeQuorum", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ; + #line 4967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ChangeQuorumActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture> __when_expr_0 = getClusterConnectionStringFromStorageServer(&tr); + #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 5005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent("RetryQuorumChange").error(e).detail("Retries", retries); + #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_8 = tr.onError(e); + #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 5031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_8.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 8; + #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!clusterConnectionStringOptional.present()) + #line 5051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::BAD_DATABASE_STATE); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } + #line 5055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::BAD_DATABASE_STATE); + this->~ChangeQuorumActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + oldClusterConnectionString = clusterConnectionStringOptional.get(); + #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + oldClusterKeyName = oldClusterConnectionString.clusterKeyName(); + #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture> __when_expr_1 = oldClusterConnectionString.tryResolveHostnames(); + #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 5074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& __clusterConnectionStringOptional,int loopDepth) + { + #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + clusterConnectionStringOptional = __clusterConnectionStringOptional; + #line 5083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && __clusterConnectionStringOptional,int loopDepth) + { + clusterConnectionStringOptional = std::move(__clusterConnectionStringOptional); + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeQuorumActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ChangeQuorumActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(int loopDepth) + { + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + result = CoordinatorsResult::SUCCESS; + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!desiredCoordinators.size()) + #line 5152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture> __when_expr_2 = change->getDesiredCoordinators(&tr, oldCoordinators, Reference( new ClusterConnectionMemoryRecord(oldClusterConnectionString)), result); + #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 5163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont5(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont2when1(std::vector const& __oldCoordinators,int loopDepth) + { + #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + oldCoordinators = __oldCoordinators; + #line 5177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(std::vector && __oldCoordinators,int loopDepth) + { + oldCoordinators = std::move(__oldCoordinators); + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeQuorumActor, 1, std::vector >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 1, std::vector >*,std::vector const& value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 1, std::vector >*,std::vector && value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< ChangeQuorumActor, 1, std::vector >*,Error err) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont5(int loopDepth) + { + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (result == CoordinatorsResult::NOT_ENOUGH_MACHINES && notEnoughMachineResults < 1) + #line 5244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + notEnoughMachineResults++; + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_3 = delay(1.0); + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont8(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont6(std::vector const& _desiredCoordinators,int loopDepth) + { + #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + desiredCoordinators = _desiredCoordinators; + #line 5271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont5(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont6(std::vector && _desiredCoordinators,int loopDepth) + { + #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + desiredCoordinators = _desiredCoordinators; + #line 5280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont5(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(std::vector const& _desiredCoordinators,int loopDepth) + { + loopDepth = a_body1loopBody1cont6(_desiredCoordinators, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(std::vector && _desiredCoordinators,int loopDepth) + { + loopDepth = a_body1loopBody1cont6(std::move(_desiredCoordinators), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeQuorumActor, 2, std::vector >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 2, std::vector >*,std::vector const& value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 2, std::vector >*,std::vector && value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< ChangeQuorumActor, 2, std::vector >*,Error err) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 2); + + } + int a_body1loopBody1cont8(int loopDepth) + { + #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (result != CoordinatorsResult::SUCCESS) + #line 5352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(result); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } + #line 5356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(std::move(result)); // state_var_RVO + this->~ChangeQuorumActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!desiredCoordinators.size()) + #line 5364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::INVALID_NETWORK_ADDRESSES); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } + #line 5368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::INVALID_NETWORK_ADDRESSES); + this->~ChangeQuorumActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::sort(desiredCoordinators.begin(), desiredCoordinators.end()); + #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::string newName = change->getDesiredClusterKeyName(); + #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (newName.empty()) + #line 5380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newName = oldClusterKeyName.toString(); + #line 5384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (oldCoordinators == desiredCoordinators && oldClusterKeyName == newName) + #line 5388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(retries ? CoordinatorsResult::SUCCESS : CoordinatorsResult::SAME_NETWORK_ADDRESSES); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } + #line 5392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(retries ? CoordinatorsResult::SUCCESS : CoordinatorsResult::SAME_NETWORK_ADDRESSES); + this->~ChangeQuorumActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newClusterConnectionString = ClusterConnectionString(desiredCoordinators, StringRef(newName + ':' + deterministicRandom()->randomAlphaNumeric(32))); + #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + newClusterKeyName = newClusterConnectionString.clusterKeyName(); + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (g_network->isSimulated()) + #line 5404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + for(int i = 0;i < (desiredCoordinators.size() / 2) + 1;i++) { + #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + auto process = g_simulator->getProcessByAddress(desiredCoordinators[i]); + #line 1312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(process->isReliable() || process->rebooting); + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + g_simulator->protectedAddresses.insert(process->addresses.address); + #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (process->addresses.secondaryAddress.present()) + #line 5416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + g_simulator->protectedAddresses.insert(process->addresses.secondaryAddress.get()); + #line 5420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 1318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent("ProtectCoordinator").detail("Address", desiredCoordinators[i]).backtrace(); + #line 5424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + } + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent("AttemptingQuorumChange") .detail("FromCS", oldClusterConnectionString.toString()) .detail("ToCS", newClusterConnectionString.toString()); + #line 1325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + CODE_PROBE(oldClusterKeyName != newClusterKeyName, "Quorum change with new name"); + #line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + CODE_PROBE(oldClusterKeyName == newClusterKeyName, "Quorum change with unchanged name"); + #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + leaderServers = std::vector>>(); + #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + coord = ClientCoordinators(Reference( new ClusterConnectionMemoryRecord(newClusterConnectionString))); + #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!change->getDesiredClusterKeyName().empty()) + #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_4 = coord.clientLeaderServers[0].checkDescriptorMutable.getReply(CheckDescriptorMutableRequest()); + #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont8when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont11(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont9(Void const& _,int loopDepth) + { + #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr.reset(); + #line 5464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + return a_body1loopHead1(loopDepth); // continue + + return loopDepth; + } + int a_body1loopBody1cont9(Void && _,int loopDepth) + { + #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr.reset(); + #line 5473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + return a_body1loopHead1(loopDepth); // continue + + return loopDepth; + } + int a_body1loopBody1cont5when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont9(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont9(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeQuorumActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont5when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont5when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< ChangeQuorumActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 3); + + } + int a_body1loopBody1cont11(int loopDepth) + { + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + leaderServers.reserve(coord.clientLeaderServers.size()); + #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + for(int i = 0;i < coord.clientLeaderServers.size();i++) { + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + leaderServers.push_back(retryBrokenPromise(coord.clientLeaderServers[i].getLeader, GetLeaderRequest(coord.clusterKey, UID()), TaskPriority::CoordinationReply)); + #line 5549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_5 = waitForAll(leaderServers); + #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont11when1(__when_expr_5.get(), loopDepth); }; + #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_6 = delay(5.0); + #line 5559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1loopBody1cont11when2(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont19(CheckDescriptorMutableReply const& mutabilityReply,int loopDepth) + { + #line 1335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!mutabilityReply.isMutable) + #line 5575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::BAD_DATABASE_STATE); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } + #line 5579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::BAD_DATABASE_STATE); + this->~ChangeQuorumActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1loopBody1cont11(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont19(CheckDescriptorMutableReply && mutabilityReply,int loopDepth) + { + #line 1335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!mutabilityReply.isMutable) + #line 5593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::BAD_DATABASE_STATE); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } + #line 5597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::BAD_DATABASE_STATE); + this->~ChangeQuorumActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1loopBody1cont11(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont8when1(CheckDescriptorMutableReply const& mutabilityReply,int loopDepth) + { + loopDepth = a_body1loopBody1cont19(mutabilityReply, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont8when1(CheckDescriptorMutableReply && mutabilityReply,int loopDepth) + { + loopDepth = a_body1loopBody1cont19(std::move(mutabilityReply), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeQuorumActor, 4, CheckDescriptorMutableReply >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 4, CheckDescriptorMutableReply >*,CheckDescriptorMutableReply const& value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont8when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 4, CheckDescriptorMutableReply >*,CheckDescriptorMutableReply && value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont8when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< ChangeQuorumActor, 4, CheckDescriptorMutableReply >*,Error err) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 4); + + } + int a_body1loopBody1cont11cont1(int loopDepth) + { + #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr.set(coordinatorsKey, newClusterConnectionString.toString()); + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_7 = tr.commit(); + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1loopBody1cont11cont1when1(__when_expr_7.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont11when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont11cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont11when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont11cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont11when2(Void const& _,int loopDepth) + { + #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::COORDINATOR_UNREACHABLE); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } + #line 5704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::COORDINATOR_UNREACHABLE); + this->~ChangeQuorumActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont11when2(Void && _,int loopDepth) + { + #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(CoordinatorsResult::COORDINATOR_UNREACHABLE); this->~ChangeQuorumActorState(); static_cast(this)->destroy(); return 0; } + #line 5716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< CoordinatorsResult >::value()) CoordinatorsResult(CoordinatorsResult::COORDINATOR_UNREACHABLE); + this->~ChangeQuorumActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeQuorumActor, 5, Void >::remove(); + static_cast(this)->ActorCallback< ChangeQuorumActor, 6, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1loopBody1cont11when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 5, Void >*,Void && value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1loopBody1cont11when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< ChangeQuorumActor, 5, Void >*,Error err) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 6, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1loopBody1cont11when2(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 6); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 6, Void >*,Void && value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1loopBody1cont11when2(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 6); + + } + void a_callback_error(ActorCallback< ChangeQuorumActor, 6, Void >*,Error err) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 6); + + } + int a_body1loopBody1cont11cont3(Void const& _,int loopDepth) + { + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(false); + #line 5825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont11cont5(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont11cont3(Void && _,int loopDepth) + { + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(false); + #line 5834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont11cont5(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont11cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont11cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont11cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont11cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose7() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeQuorumActor, 7, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 7, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 7); + a_exitChoose7(); + try { + a_body1loopBody1cont11cont1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 7); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 7, Void >*,Void && value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 7); + a_exitChoose7(); + try { + a_body1loopBody1cont11cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 7); + + } + void a_callback_error(ActorCallback< ChangeQuorumActor, 7, Void >*,Error err) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 7); + a_exitChoose7(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 7); + + } + int a_body1loopBody1cont11cont5(int loopDepth) + { + try { + loopDepth = a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ++retries; + #line 5919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ++retries; + #line 5928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose8() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeQuorumActor, 8, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 8, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 8); + a_exitChoose8(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 8); + + } + void a_callback_fire(ActorCallback< ChangeQuorumActor, 8, Void >*,Void && value) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 8); + a_exitChoose8(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 8); + + } + void a_callback_error(ActorCallback< ChangeQuorumActor, 8, Void >*,Error err) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), 8); + a_exitChoose8(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), 8); + + } + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Database cx; + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Reference change; + #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Transaction tr; + #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + int retries; + #line 1256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::vector desiredCoordinators; + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + int notEnoughMachineResults; + #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Optional clusterConnectionStringOptional; + #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ClusterConnectionString oldClusterConnectionString; + #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Key oldClusterKeyName; + #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::vector oldCoordinators; + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + CoordinatorsResult result; + #line 1305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ClusterConnectionString newClusterConnectionString; + #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Key newClusterKeyName; + #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::vector>> leaderServers; + #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ClientCoordinators coord; + #line 6026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +}; +// This generated class is to be used only via changeQuorum() + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class ChangeQuorumActor final : public Actor, public ActorCallback< ChangeQuorumActor, 0, Optional >, public ActorCallback< ChangeQuorumActor, 1, std::vector >, public ActorCallback< ChangeQuorumActor, 2, std::vector >, public ActorCallback< ChangeQuorumActor, 3, Void >, public ActorCallback< ChangeQuorumActor, 4, CheckDescriptorMutableReply >, public ActorCallback< ChangeQuorumActor, 5, Void >, public ActorCallback< ChangeQuorumActor, 6, Void >, public ActorCallback< ChangeQuorumActor, 7, Void >, public ActorCallback< ChangeQuorumActor, 8, Void >, public FastAllocated, public ChangeQuorumActorState { + #line 6031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ChangeQuorumActor, 0, Optional >; +friend struct ActorCallback< ChangeQuorumActor, 1, std::vector >; +friend struct ActorCallback< ChangeQuorumActor, 2, std::vector >; +friend struct ActorCallback< ChangeQuorumActor, 3, Void >; +friend struct ActorCallback< ChangeQuorumActor, 4, CheckDescriptorMutableReply >; +friend struct ActorCallback< ChangeQuorumActor, 5, Void >; +friend struct ActorCallback< ChangeQuorumActor, 6, Void >; +friend struct ActorCallback< ChangeQuorumActor, 7, Void >; +friend struct ActorCallback< ChangeQuorumActor, 8, Void >; + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ChangeQuorumActor(Database const& cx,Reference const& change) + #line 6050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + : Actor(), + ChangeQuorumActorState(cx, change) + { + fdb_probe_actor_enter("changeQuorum", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("changeQuorum"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("changeQuorum", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ChangeQuorumActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ChangeQuorumActor, 1, std::vector >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ChangeQuorumActor, 2, std::vector >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< ChangeQuorumActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< ChangeQuorumActor, 4, CheckDescriptorMutableReply >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< ChangeQuorumActor, 5, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< ChangeQuorumActor, 7, Void >*)0, actor_cancelled()); break; + case 8: this->a_callback_error((ActorCallback< ChangeQuorumActor, 8, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future changeQuorum( Database const& cx, Reference const& change ) { + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new ChangeQuorumActor(cx, change)); + #line 6085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +} + +#line 1362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + +struct NameQuorumChange final : IQuorumChange { + std::string newName; + Reference otherChange; + explicit NameQuorumChange(std::string const& newName, Reference const& otherChange) + : newName(newName), otherChange(otherChange) {} + Future> getDesiredCoordinators(Transaction* tr, + std::vector oldCoordinators, + Reference ccr, + CoordinatorsResult& t) override { + return otherChange->getDesiredCoordinators(tr, oldCoordinators, ccr, t); + } + std::string getDesiredClusterKeyName() const override { return newName; } +}; +Reference nameQuorumChange(std::string const& name, Reference const& other) { + return Reference(new NameQuorumChange(name, other)); +} + +struct AutoQuorumChange final : IQuorumChange { + int desired; + explicit AutoQuorumChange(int desired) : desired(desired) {} + + Future> getDesiredCoordinators(Transaction* tr, + std::vector oldCoordinators, + Reference ccr, + CoordinatorsResult& err) override { + return getDesired(Reference::addRef(this), tr, oldCoordinators, ccr, &err); + } + + #line 6118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via getRedundancy() + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class GetRedundancyActorState { + #line 6124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + GetRedundancyActorState(AutoQuorumChange* const& self,Transaction* const& tr) + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + : self(self), + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr(tr), + #line 1392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + fStorageReplicas(tr->get("storage_replicas"_sr.withPrefix(configKeysPrefix))), + #line 1393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + fLogReplicas(tr->get("log_replicas"_sr.withPrefix(configKeysPrefix))) + #line 6137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + fdb_probe_actor_create("getRedundancy", reinterpret_cast(this)); + + } + ~GetRedundancyActorState() + { + fdb_probe_actor_destroy("getRedundancy", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_0 = success(fStorageReplicas) && success(fLogReplicas); + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetRedundancyActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + int redundancy = std::min(atoi(fStorageReplicas.get().get().toString().c_str()), atoi(fLogReplicas.get().get().toString().c_str())); + #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(redundancy); this->~GetRedundancyActorState(); static_cast(this)->destroy(); return 0; } + #line 6184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< int >::value()) int(redundancy); + this->~GetRedundancyActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + int redundancy = std::min(atoi(fStorageReplicas.get().get().toString().c_str()), atoi(fLogReplicas.get().get().toString().c_str())); + #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(redundancy); this->~GetRedundancyActorState(); static_cast(this)->destroy(); return 0; } + #line 6198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< int >::value()) int(redundancy); + this->~GetRedundancyActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetRedundancyActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetRedundancyActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getRedundancy", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRedundancy", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetRedundancyActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getRedundancy", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRedundancy", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetRedundancyActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getRedundancy", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRedundancy", reinterpret_cast(this), 0); + + } + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + AutoQuorumChange* self; + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Transaction* tr; + #line 1392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Future> fStorageReplicas; + #line 1393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Future> fLogReplicas; + #line 6277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +}; +// This generated class is to be used only via getRedundancy() + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class GetRedundancyActor final : public Actor, public ActorCallback< GetRedundancyActor, 0, Void >, public FastAllocated, public GetRedundancyActorState { + #line 6282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetRedundancyActor, 0, Void >; + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetRedundancyActor(AutoQuorumChange* const& self,Transaction* const& tr) - #line 4240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), GetRedundancyActorState(self, tr) { @@ -4260,39 +6313,39 @@ friend struct ActorCallback< GetRedundancyActor, 0, Void >; } }; - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] static Future getRedundancy( AutoQuorumChange* const& self, Transaction* const& tr ) { - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new GetRedundancyActor(self, tr)); - #line 4267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 4272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" // This generated class is to be used only via isAcceptable() - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class IsAcceptableActorState { - #line 4278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" IsAcceptableActorState(AutoQuorumChange* const& self,Transaction* const& tr,std::vector const& oldCoordinators,Reference const& ccr,int const& desiredCount,std::set* const& excluded) - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : self(self), - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(tr), - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" oldCoordinators(oldCoordinators), - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ccr(ccr), - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" desiredCount(desiredCount), - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" excluded(excluded) - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("isAcceptable", reinterpret_cast(this)); @@ -4305,109 +6358,109 @@ class IsAcceptableActorState { int a_body1(int loopDepth=0) { try { - #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ClusterConnectionString cs = ccr->getConnectionString(); - #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (oldCoordinators.size() != cs.hostnames.size() + cs.coords.size()) - #line 4312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsAcceptableActorState(); static_cast(this)->destroy(); return 0; } - #line 4316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsAcceptableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (oldCoordinators.size() < desiredCount) - #line 4324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsAcceptableActorState(); static_cast(this)->destroy(); return 0; } - #line 4328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsAcceptableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (oldCoordinators.size() % 2 != 1) - #line 4336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsAcceptableActorState(); static_cast(this)->destroy(); return 0; } - #line 4340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsAcceptableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto& c : oldCoordinators ) { - #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (addressExcluded(*excluded, c)) - #line 4350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsAcceptableActorState(); static_cast(this)->destroy(); return 0; } - #line 4354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsAcceptableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::sort(oldCoordinators.begin(), oldCoordinators.end()); - #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(int i = 1;i < oldCoordinators.size();i++) { - #line 1100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (oldCoordinators[i - 1].ip == oldCoordinators[i].ip) - #line 4367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsAcceptableActorState(); static_cast(this)->destroy(); return 0; } - #line 4371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsAcceptableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 1104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ClientCoordinators coord(ccr); - #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector>> leaderServers; - #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" leaderServers.reserve(coord.clientLeaderServers.size()); - #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(int i = 0;i < coord.clientLeaderServers.size();i++) { - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (coord.clientLeaderServers[i].hostname.present()) - #line 4388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" leaderServers.push_back(retryGetReplyFromHostname(GetLeaderRequest(coord.clusterKey, UID()), coord.clientLeaderServers[i].hostname.get(), WLTOKEN_CLIENTLEADERREG_GETLEADER, TaskPriority::CoordinationReply)); - #line 4392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" leaderServers.push_back(retryBrokenPromise(coord.clientLeaderServers[i].getLeader, GetLeaderRequest(coord.clusterKey, UID()), TaskPriority::CoordinationReply)); - #line 4398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture>>> __when_expr_0 = timeout(getAll(leaderServers), CLIENT_KNOBS->IS_ACCEPTABLE_DELAY); - #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast>> >*>(static_cast(this))); - #line 4410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4428,36 +6481,36 @@ class IsAcceptableActorState { } int a_body1cont1(Optional>> const& results,int loopDepth) { - #line 1121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!results.present()) - #line 4433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsAcceptableActorState(); static_cast(this)->destroy(); return 0; } - #line 4437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsAcceptableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto& r : results.get() ) { - #line 1125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!r.present()) - #line 4447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsAcceptableActorState(); static_cast(this)->destroy(); return 0; } - #line 4451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsAcceptableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 1130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~IsAcceptableActorState(); static_cast(this)->destroy(); return 0; } - #line 4460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~IsAcceptableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4467,36 +6520,36 @@ class IsAcceptableActorState { } int a_body1cont1(Optional>> && results,int loopDepth) { - #line 1121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!results.present()) - #line 4472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsAcceptableActorState(); static_cast(this)->destroy(); return 0; } - #line 4476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsAcceptableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto& r : results.get() ) { - #line 1125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!r.present()) - #line 4486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsAcceptableActorState(); static_cast(this)->destroy(); return 0; } - #line 4490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsAcceptableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 1130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~IsAcceptableActorState(); static_cast(this)->destroy(); return 0; } - #line 4499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~IsAcceptableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4567,24 +6620,24 @@ class IsAcceptableActorState { fdb_probe_actor_exit("isAcceptable", reinterpret_cast(this), 0); } - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" AutoQuorumChange* self; - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector oldCoordinators; - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Reference ccr; - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" int desiredCount; - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::set* excluded; - #line 4582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via isAcceptable() - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class IsAcceptableActor final : public Actor, public ActorCallback< IsAcceptableActor, 0, Optional>> >, public FastAllocated, public IsAcceptableActorState { - #line 4587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4593,9 +6646,9 @@ class IsAcceptableActor final : public Actor, public ActorCallback< IsAcce void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< IsAcceptableActor, 0, Optional>> >; - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" IsAcceptableActor(AutoQuorumChange* const& self,Transaction* const& tr,std::vector const& oldCoordinators,Reference const& ccr,int const& desiredCount,std::set* const& excluded) - #line 4598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), IsAcceptableActorState(self, tr, oldCoordinators, ccr, desiredCount, excluded) { @@ -4618,39 +6671,39 @@ friend struct ActorCallback< IsAcceptableActor, 0, Optional isAcceptable( AutoQuorumChange* const& self, Transaction* const& tr, std::vector const& oldCoordinators, Reference const& ccr, int const& desiredCount, std::set* const& excluded ) { - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new IsAcceptableActor(self, tr, oldCoordinators, ccr, desiredCount, excluded)); - #line 4625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 1460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 4630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" // This generated class is to be used only via getDesired() - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetDesiredActorState { - #line 4636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetDesiredActorState(Reference const& self,Transaction* const& tr,std::vector const& oldCoordinators,Reference const& ccr,CoordinatorsResult* const& err) - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : self(self), - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(tr), - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" oldCoordinators(oldCoordinators), - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ccr(ccr), - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" err(err), - #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" desiredCount(self->desired) - #line 4653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("getDesired", reinterpret_cast(this)); @@ -4663,20 +6716,20 @@ class GetDesiredActorState { int a_body1(int loopDepth=0) { try { - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (desiredCount == -1) - #line 4668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = getRedundancy(self.getPtr(), tr); - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } else @@ -4702,34 +6755,34 @@ class GetDesiredActorState { } int a_body1cont1(int loopDepth) { - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_1 = getAllExcludedServers(tr); - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(int const& redundancy,int loopDepth) { - #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" desiredCount = redundancy * 2 - 1; - #line 4723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } int a_body1cont2(int && redundancy,int loopDepth) { - #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" desiredCount = redundancy * 2 - 1; - #line 4732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -4799,36 +6852,36 @@ class GetDesiredActorState { } int a_body1cont4(std::vector const& excl,int loopDepth) { - #line 1146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" excluded = std::set(excl.begin(), excl.end()); - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_2 = getWorkers(tr); - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont4when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4(std::vector && excl,int loopDepth) { - #line 1146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" excluded = std::set(excl.begin(), excl.end()); - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_2 = getWorkers(tr); - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont4when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4898,51 +6951,51 @@ class GetDesiredActorState { } int a_body1cont5(std::vector const& _workers,int loopDepth) { - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" workers = _workers; - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::map addr_locality; - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto w : workers ) { - #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" addr_locality[w.address] = w.locality; - #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool checkAcceptable = true; - #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::set>> checkDuplicates; - #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto addr : oldCoordinators ) { - #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto findResult = addr_locality.find(addr); - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (findResult == addr_locality.end() || checkDuplicates.count(findResult->second.zoneId())) - #line 4921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" checkAcceptable = false; - #line 4925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" break; } - #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" checkDuplicates.insert(findResult->second.zoneId()); - #line 4930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (checkAcceptable) - #line 4934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_3 = isAcceptable(self.getPtr(), tr, oldCoordinators, ccr, desiredCount, &excluded); - #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 6998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } else @@ -4954,51 +7007,51 @@ class GetDesiredActorState { } int a_body1cont5(std::vector && _workers,int loopDepth) { - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" workers = _workers; - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::map addr_locality; - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto w : workers ) { - #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" addr_locality[w.address] = w.locality; - #line 4965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool checkAcceptable = true; - #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::set>> checkDuplicates; - #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto addr : oldCoordinators ) { - #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto findResult = addr_locality.find(addr); - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (findResult == addr_locality.end() || checkDuplicates.count(findResult->second.zoneId())) - #line 4977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" checkAcceptable = false; - #line 4981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" break; } - #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" checkDuplicates.insert(findResult->second.zoneId()); - #line 4986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (checkAcceptable) - #line 4990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_3 = isAcceptable(self.getPtr(), tr, oldCoordinators, ccr, desiredCount, &excluded); - #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } else @@ -5073,37 +7126,37 @@ class GetDesiredActorState { } int a_body1cont6(int loopDepth) { - #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector chosen; - #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" self->addDesiredWorkers(chosen, workers, desiredCount, excluded); - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (chosen.size() < desiredCount) - #line 5082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (chosen.empty() || chosen.size() < oldCoordinators.size()) - #line 5086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("NotEnoughMachinesForCoordinators") .detail("EligibleWorkers", workers.size()) .detail("ChosenWorkers", chosen.size()) .detail("DesiredCoordinators", desiredCount) .detail("CurrentCoordinators", oldCoordinators.size()); - #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" *err = CoordinatorsResult::NOT_ENOUGH_MACHINES; - #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(std::vector()); this->~GetDesiredActorState(); static_cast(this)->destroy(); return 0; } - #line 5094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::vector()); this->~GetDesiredActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" chosen.resize((chosen.size() - 1) | 1); - #line 5102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(chosen); this->~GetDesiredActorState(); static_cast(this)->destroy(); return 0; } - #line 5106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(chosen); this->~GetDesiredActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5113,15 +7166,15 @@ class GetDesiredActorState { } int a_body1cont10(bool const& ok,int loopDepth) { - #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (ok) - #line 5118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" *err = CoordinatorsResult::SAME_NETWORK_ADDRESSES; - #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(oldCoordinators); this->~GetDesiredActorState(); static_cast(this)->destroy(); return 0; } - #line 5124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::move(oldCoordinators)); // state_var_RVO this->~GetDesiredActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5133,15 +7186,15 @@ class GetDesiredActorState { } int a_body1cont10(bool && ok,int loopDepth) { - #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (ok) - #line 5138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" *err = CoordinatorsResult::SAME_NETWORK_ADDRESSES; - #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(oldCoordinators); this->~GetDesiredActorState(); static_cast(this)->destroy(); return 0; } - #line 5144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::move(oldCoordinators)); // state_var_RVO this->~GetDesiredActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5214,28 +7267,28 @@ class GetDesiredActorState { fdb_probe_actor_exit("getDesired", reinterpret_cast(this), 3); } - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Reference self; - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector oldCoordinators; - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Reference ccr; - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" CoordinatorsResult* err; - #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" int desiredCount; - #line 1146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::set excluded; - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector workers; - #line 5233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via getDesired() - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetDesiredActor final : public Actor>, public ActorCallback< GetDesiredActor, 0, int >, public ActorCallback< GetDesiredActor, 1, std::vector >, public ActorCallback< GetDesiredActor, 2, std::vector >, public ActorCallback< GetDesiredActor, 3, bool >, public FastAllocated, public GetDesiredActorState { - #line 5238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5247,9 +7300,9 @@ friend struct ActorCallback< GetDesiredActor, 0, int >; friend struct ActorCallback< GetDesiredActor, 1, std::vector >; friend struct ActorCallback< GetDesiredActor, 2, std::vector >; friend struct ActorCallback< GetDesiredActor, 3, bool >; - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetDesiredActor(Reference const& self,Transaction* const& tr,std::vector const& oldCoordinators,Reference const& ccr,CoordinatorsResult* const& err) - #line 5252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor>(), GetDesiredActorState(self, tr, oldCoordinators, ccr, err) { @@ -5275,14 +7328,14 @@ friend struct ActorCallback< GetDesiredActor, 3, bool >; } }; - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] static Future> getDesired( Reference const& self, Transaction* const& tr, std::vector const& oldCoordinators, Reference const& ccr, CoordinatorsResult* const& err ) { - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future>(new GetDesiredActor(self, tr, oldCoordinators, ccr, err)); - #line 5282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" // Select a desired set of workers such that // (1) the number of workers at each locality type (e.g., dcid) <= desiredCount; and @@ -5315,10 +7368,7 @@ friend struct ActorCallback< GetDesiredActor, 3, bool >; std::map> currentCounts; std::map hardLimits; - std::vector fields({ LiteralStringRef("dcid"), - LiteralStringRef("data_hall"), - LiteralStringRef("zoneid"), - LiteralStringRef("machineid") }); + std::vector fields({ "dcid"_sr, "data_hall"_sr, "zoneid"_sr, "machineid"_sr }); for (auto field = fields.begin(); field != fields.end(); field++) { if (field->toString() == "zoneid") { @@ -5335,7 +7385,7 @@ friend struct ActorCallback< GetDesiredActor, 3, bool >; continue; } // Exclude faulty node due to machine assassination - if (g_network->isSimulated() && !g_simulator.getProcessByAddress(worker->address)->isReliable()) { + if (g_network->isSimulated() && !g_simulator->getProcessByAddress(worker->address)->isReliable()) { TraceEvent("AutoSelectCoordinators").detail("SkipUnreliableWorker", worker->address.toString()); continue; } @@ -5344,7 +7394,7 @@ friend struct ActorCallback< GetDesiredActor, 3, bool >; if (maxCounts[*field] == 0) { maxCounts[*field] = 1; } - auto value = worker->locality.get(*field).orDefault(LiteralStringRef("")); + auto value = worker->locality.get(*field).orDefault(""_sr); auto currentCount = currentCounts[*field][value]; if (currentCount >= maxCounts[*field]) { valid = false; @@ -5353,7 +7403,7 @@ friend struct ActorCallback< GetDesiredActor, 3, bool >; } if (valid) { for (auto field = fields.begin(); field != fields.end(); field++) { - auto value = worker->locality.get(*field).orDefault(LiteralStringRef("")); + auto value = worker->locality.get(*field).orDefault(""_sr); currentCounts[*field][value] += 1; } chosen.push_back(worker->address); @@ -5382,25 +7432,25 @@ Reference autoQuorumChange(int desired) { return Reference(new AutoQuorumChange(desired)); } - #line 5385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via excludeServers() - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class ExcludeServersActorState { - #line 5392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ExcludeServersActorState(Transaction* const& tr,std::vector const& servers,bool const& failed) - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr), - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" servers(servers), - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" failed(failed) - #line 5403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("excludeServers", reinterpret_cast(this)); @@ -5413,24 +7463,24 @@ class ExcludeServersActorState { int a_body1(int loopDepth=0) { try { - #line 1295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = failed ? getExcludedFailedServerList(tr) : getExcludedServerList(tr); - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5451,54 +7501,54 @@ class ExcludeServersActorState { } int a_body1cont1(std::vector const& excl,int loopDepth) { - #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::set exclusions(excl.begin(), excl.end()); - #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool containNewExclusion = false; - #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto& s : servers ) { - #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (exclusions.find(s) != exclusions.end()) - #line 5462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { continue; } - #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" containNewExclusion = true; - #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (failed) - #line 5470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(encodeFailedServersKey(s), StringRef()); - #line 5474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(encodeExcludedServersKey(s), StringRef()); - #line 5480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (containNewExclusion) - #line 5485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::string excludeVersionKey = deterministicRandom()->randomUniqueID().toString(); - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto serversVersionKey = failed ? failedServersVersionKey : excludedServersVersionKey; - #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->addReadConflictRange(singleKeyRange(serversVersionKey)); - #line 1318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(serversVersionKey, excludeVersionKey); - #line 5495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("ExcludeServersCommit") .detail("Servers", describe(servers)) .detail("ExcludeFailed", failed) .detail("ExclusionUpdated", containNewExclusion); - #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ExcludeServersActorState(); static_cast(this)->destroy(); return 0; } - #line 5501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ExcludeServersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5508,54 +7558,54 @@ class ExcludeServersActorState { } int a_body1cont1(std::vector && excl,int loopDepth) { - #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::set exclusions(excl.begin(), excl.end()); - #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool containNewExclusion = false; - #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto& s : servers ) { - #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (exclusions.find(s) != exclusions.end()) - #line 5519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { continue; } - #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" containNewExclusion = true; - #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (failed) - #line 5527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(encodeFailedServersKey(s), StringRef()); - #line 5531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(encodeExcludedServersKey(s), StringRef()); - #line 5537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (containNewExclusion) - #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::string excludeVersionKey = deterministicRandom()->randomUniqueID().toString(); - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto serversVersionKey = failed ? failedServersVersionKey : excludedServersVersionKey; - #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->addReadConflictRange(singleKeyRange(serversVersionKey)); - #line 1318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(serversVersionKey, excludeVersionKey); - #line 5552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("ExcludeServersCommit") .detail("Servers", describe(servers)) .detail("ExcludeFailed", failed) .detail("ExclusionUpdated", containNewExclusion); - #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ExcludeServersActorState(); static_cast(this)->destroy(); return 0; } - #line 5558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ExcludeServersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5626,18 +7676,18 @@ class ExcludeServersActorState { fdb_probe_actor_exit("excludeServers", reinterpret_cast(this), 0); } - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector servers; - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool failed; - #line 5635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via excludeServers() - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class ExcludeServersActor final : public Actor, public ActorCallback< ExcludeServersActor, 0, std::vector >, public FastAllocated, public ExcludeServersActorState { - #line 5640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5646,9 +7696,9 @@ class ExcludeServersActor final : public Actor, public ActorCallback< Excl void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ExcludeServersActor, 0, std::vector >; - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ExcludeServersActor(Transaction* const& tr,std::vector const& servers,bool const& failed) - #line 5651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), ExcludeServersActorState(tr, servers, failed) { @@ -5672,34 +7722,34 @@ friend struct ActorCallback< ExcludeServersActor, 0, std::vector excludeServers( Transaction* const& tr, std::vector const& servers, bool const& failed ) { - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new ExcludeServersActor(tr, servers, failed)); - #line 5679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 5684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via excludeServers() - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class ExcludeServersActor1State { - #line 5691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ExcludeServersActor1State(Database const& cx,std::vector const& servers,bool const& failed) - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" servers(servers), - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" failed(failed) - #line 5702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("excludeServers", reinterpret_cast(this)); @@ -5712,24 +7762,24 @@ class ExcludeServersActor1State { int a_body1(int loopDepth=0) { try { - #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (cx->apiVersionAtLeast(700)) - #line 5717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw = ReadYourWritesTransaction(cx); - #line 1330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 5723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } else { - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr = Transaction(cx); - #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 5732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead2(loopDepth); } } @@ -5759,30 +7809,32 @@ class ExcludeServersActor1State { int a_body1loopBody1(int loopDepth) { try { - #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ryw.setOption(FDBTransactionOptions::RAW_ACCESS); + #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw.setOption(FDBTransactionOptions::SPECIAL_KEY_SPACE_ENABLE_WRITES); - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw.set( SpecialKeySpace::getManagementApiCommandOptionSpecialKey(failed ? "failed" : "excluded", "force"), ValueRef()); - #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto& s : servers ) { - #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Key addr = failed ? SpecialKeySpace::getManagementApiCommandPrefix("failed").withSuffix(s.toString()) : SpecialKeySpace::getManagementApiCommandPrefix("exclude").withSuffix(s.toString()); - #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw.set(addr, ValueRef()); - #line 5772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("ExcludeServersSpecialKeySpaceCommit") .detail("Servers", describe(servers)) .detail("ExcludeFailed", failed); - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = ryw.commit(); - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 5780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5802,18 +7854,18 @@ class ExcludeServersActor1State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("ExcludeServersError").errorUnsuppressed(e); - #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = ryw.onError(e); - #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5826,9 +7878,9 @@ class ExcludeServersActor1State { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ExcludeServersActor1State(); static_cast(this)->destroy(); return 0; } - #line 5831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ExcludeServersActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5838,9 +7890,9 @@ class ExcludeServersActor1State { } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ExcludeServersActor1State(); static_cast(this)->destroy(); return 0; } - #line 5843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 7895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ExcludeServersActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5996,16 +8048,16 @@ class ExcludeServersActor1State { int a_body1loopBody2(int loopDepth) { try { - #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = excludeServers(&tr, servers, failed); - #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody2Catch1(actor_cancelled(), loopDepth); - #line 6003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody2Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6025,18 +8077,18 @@ class ExcludeServersActor1State { int a_body1loopBody2Catch1(const Error& e,int loopDepth=0) { try { - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("ExcludeServersError").errorUnsuppressed(e); - #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_4 = tr.onError(e); - #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody2Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6049,32 +8101,32 @@ class ExcludeServersActor1State { } int a_body1loopBody2cont2(Void const& _,int loopDepth) { - #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_3 = tr.commit(); - #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody2Catch1(actor_cancelled(), loopDepth); - #line 6056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody2Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody2cont2when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody2cont2(Void && _,int loopDepth) { - #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_3 = tr.commit(); - #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody2Catch1(actor_cancelled(), loopDepth); - #line 6072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody2Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody2cont2when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -6144,9 +8196,9 @@ class ExcludeServersActor1State { } int a_body1loopBody2cont3(Void const& _,int loopDepth) { - #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ExcludeServersActor1State(); static_cast(this)->destroy(); return 0; } - #line 6149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ExcludeServersActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6156,9 +8208,9 @@ class ExcludeServersActor1State { } int a_body1loopBody2cont3(Void && _,int loopDepth) { - #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ExcludeServersActor1State(); static_cast(this)->destroy(); return 0; } - #line 6161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ExcludeServersActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6304,22 +8356,22 @@ class ExcludeServersActor1State { fdb_probe_actor_exit("excludeServers", reinterpret_cast(this), 4); } - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector servers; - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool failed; - #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ReadYourWritesTransaction ryw; - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 6317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via excludeServers() - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class ExcludeServersActor1 final : public Actor, public ActorCallback< ExcludeServersActor1, 0, Void >, public ActorCallback< ExcludeServersActor1, 1, Void >, public ActorCallback< ExcludeServersActor1, 2, Void >, public ActorCallback< ExcludeServersActor1, 3, Void >, public ActorCallback< ExcludeServersActor1, 4, Void >, public FastAllocated, public ExcludeServersActor1State { - #line 6322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6332,9 +8384,9 @@ friend struct ActorCallback< ExcludeServersActor1, 1, Void >; friend struct ActorCallback< ExcludeServersActor1, 2, Void >; friend struct ActorCallback< ExcludeServersActor1, 3, Void >; friend struct ActorCallback< ExcludeServersActor1, 4, Void >; - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ExcludeServersActor1(Database const& cx,std::vector const& servers,bool const& failed) - #line 6337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), ExcludeServersActor1State(cx, servers, failed) { @@ -6362,35 +8414,35 @@ friend struct ActorCallback< ExcludeServersActor1, 4, Void >; } }; } - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future excludeServers( Database const& cx, std::vector const& servers, bool const& failed ) { - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new ExcludeServersActor1(cx, servers, failed)); - #line 6369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 1692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" // excludes localities by setting the keys in api version below 7.0 - #line 6375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via excludeLocalities() - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class ExcludeLocalitiesActorState { - #line 6382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ExcludeLocalitiesActorState(Transaction* const& tr,std::unordered_set const& localities,bool const& failed) - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr), - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" localities(localities), - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" failed(failed) - #line 6393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("excludeLocalities", reinterpret_cast(this)); @@ -6403,24 +8455,24 @@ class ExcludeLocalitiesActorState { int a_body1(int loopDepth=0) { try { - #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = failed ? getExcludedFailedLocalityList(tr) : getExcludedLocalityList(tr); - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6441,54 +8493,54 @@ class ExcludeLocalitiesActorState { } int a_body1cont1(std::vector const& excl,int loopDepth) { - #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::set exclusion(excl.begin(), excl.end()); - #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool containNewExclusion = false; - #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( const auto& l : localities ) { - #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (exclusion.find(l) != exclusion.end()) - #line 6452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { continue; } - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" containNewExclusion = true; - #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (failed) - #line 6460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(encodeFailedLocalityKey(l), StringRef()); - #line 6464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(encodeExcludedLocalityKey(l), StringRef()); - #line 6470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (containNewExclusion) - #line 6475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::string excludeVersionKey = deterministicRandom()->randomUniqueID().toString(); - #line 1389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto localityVersionKey = failed ? failedLocalityVersionKey : excludedLocalityVersionKey; - #line 1390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->addReadConflictRange(singleKeyRange(localityVersionKey)); - #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(localityVersionKey, excludeVersionKey); - #line 6485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("ExcludeLocalitiesCommit") .detail("Localities", describe(localities)) .detail("ExcludeFailed", failed) .detail("ExclusionUpdated", containNewExclusion); - #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ExcludeLocalitiesActorState(); static_cast(this)->destroy(); return 0; } - #line 6491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ExcludeLocalitiesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6498,54 +8550,54 @@ class ExcludeLocalitiesActorState { } int a_body1cont1(std::vector && excl,int loopDepth) { - #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::set exclusion(excl.begin(), excl.end()); - #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool containNewExclusion = false; - #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( const auto& l : localities ) { - #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (exclusion.find(l) != exclusion.end()) - #line 6509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { continue; } - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" containNewExclusion = true; - #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (failed) - #line 6517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(encodeFailedLocalityKey(l), StringRef()); - #line 6521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(encodeExcludedLocalityKey(l), StringRef()); - #line 6527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (containNewExclusion) - #line 6532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::string excludeVersionKey = deterministicRandom()->randomUniqueID().toString(); - #line 1389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto localityVersionKey = failed ? failedLocalityVersionKey : excludedLocalityVersionKey; - #line 1390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->addReadConflictRange(singleKeyRange(localityVersionKey)); - #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(localityVersionKey, excludeVersionKey); - #line 6542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("ExcludeLocalitiesCommit") .detail("Localities", describe(localities)) .detail("ExcludeFailed", failed) .detail("ExclusionUpdated", containNewExclusion); - #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ExcludeLocalitiesActorState(); static_cast(this)->destroy(); return 0; } - #line 6548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ExcludeLocalitiesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6616,18 +8668,18 @@ class ExcludeLocalitiesActorState { fdb_probe_actor_exit("excludeLocalities", reinterpret_cast(this), 0); } - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::unordered_set localities; - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool failed; - #line 6625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via excludeLocalities() - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class ExcludeLocalitiesActor final : public Actor, public ActorCallback< ExcludeLocalitiesActor, 0, std::vector >, public FastAllocated, public ExcludeLocalitiesActorState { - #line 6630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6636,9 +8688,9 @@ class ExcludeLocalitiesActor final : public Actor, public ActorCallback< E void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ExcludeLocalitiesActor, 0, std::vector >; - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ExcludeLocalitiesActor(Transaction* const& tr,std::unordered_set const& localities,bool const& failed) - #line 6641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), ExcludeLocalitiesActorState(tr, localities, failed) { @@ -6662,36 +8714,36 @@ friend struct ActorCallback< ExcludeLocalitiesActor, 0, std::vector } }; } - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future excludeLocalities( Transaction* const& tr, std::unordered_set const& localities, bool const& failed ) { - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new ExcludeLocalitiesActor(tr, localities, failed)); - #line 6669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 1725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" // Exclude the servers matching the given set of localities from use as state servers. // excludes localities by setting the keys. - #line 6676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via excludeLocalities() - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class ExcludeLocalitiesActor1State { - #line 6683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ExcludeLocalitiesActor1State(Database const& cx,std::unordered_set const& localities,bool const& failed) - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" localities(localities), - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" failed(failed) - #line 6694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("excludeLocalities", reinterpret_cast(this)); @@ -6704,24 +8756,24 @@ class ExcludeLocalitiesActor1State { int a_body1(int loopDepth=0) { try { - #line 1403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (cx->apiVersionAtLeast(700)) - #line 6709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw = ReadYourWritesTransaction(cx); - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 6715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } else { - #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr = Transaction(cx); - #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 6724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead2(loopDepth); } } @@ -6751,30 +8803,32 @@ class ExcludeLocalitiesActor1State { int a_body1loopBody1(int loopDepth) { try { - #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ryw.setOption(FDBTransactionOptions::RAW_ACCESS); + #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw.setOption(FDBTransactionOptions::SPECIAL_KEY_SPACE_ENABLE_WRITES); - #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw.set(SpecialKeySpace::getManagementApiCommandOptionSpecialKey( failed ? "failed_locality" : "excluded_locality", "force"), ValueRef()); - #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( const auto& l : localities ) { - #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Key addr = failed ? SpecialKeySpace::getManagementApiCommandPrefix("failedlocality").withSuffix(l) : SpecialKeySpace::getManagementApiCommandPrefix("excludedlocality").withSuffix(l); - #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw.set(addr, ValueRef()); - #line 6764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("ExcludeLocalitiesSpecialKeySpaceCommit") .detail("Localities", describe(localities)) .detail("ExcludeFailed", failed); - #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = ryw.commit(); - #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 6772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6794,18 +8848,18 @@ class ExcludeLocalitiesActor1State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("ExcludeLocalitiesError").errorUnsuppressed(e); - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = ryw.onError(e); - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6818,9 +8872,9 @@ class ExcludeLocalitiesActor1State { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ExcludeLocalitiesActor1State(); static_cast(this)->destroy(); return 0; } - #line 6823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ExcludeLocalitiesActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6830,9 +8884,9 @@ class ExcludeLocalitiesActor1State { } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ExcludeLocalitiesActor1State(); static_cast(this)->destroy(); return 0; } - #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 8889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ExcludeLocalitiesActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6988,16 +9042,16 @@ class ExcludeLocalitiesActor1State { int a_body1loopBody2(int loopDepth) { try { - #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = excludeLocalities(&tr, localities, failed); - #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody2Catch1(actor_cancelled(), loopDepth); - #line 6995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody2Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7017,18 +9071,18 @@ class ExcludeLocalitiesActor1State { int a_body1loopBody2Catch1(const Error& e,int loopDepth=0) { try { - #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("ExcludeLocalitiesError").errorUnsuppressed(e); - #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_4 = tr.onError(e); - #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 7026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody2Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7041,32 +9095,32 @@ class ExcludeLocalitiesActor1State { } int a_body1loopBody2cont2(Void const& _,int loopDepth) { - #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_3 = tr.commit(); - #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody2Catch1(actor_cancelled(), loopDepth); - #line 7048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody2Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody2cont2when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody2cont2(Void && _,int loopDepth) { - #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_3 = tr.commit(); - #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody2Catch1(actor_cancelled(), loopDepth); - #line 7064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody2Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody2cont2when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -7136,9 +9190,9 @@ class ExcludeLocalitiesActor1State { } int a_body1loopBody2cont3(Void const& _,int loopDepth) { - #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ExcludeLocalitiesActor1State(); static_cast(this)->destroy(); return 0; } - #line 7141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ExcludeLocalitiesActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7148,9 +9202,9 @@ class ExcludeLocalitiesActor1State { } int a_body1loopBody2cont3(Void && _,int loopDepth) { - #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ExcludeLocalitiesActor1State(); static_cast(this)->destroy(); return 0; } - #line 7153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ExcludeLocalitiesActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7296,22 +9350,22 @@ class ExcludeLocalitiesActor1State { fdb_probe_actor_exit("excludeLocalities", reinterpret_cast(this), 4); } - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::unordered_set localities; - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool failed; - #line 1404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ReadYourWritesTransaction ryw; - #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 7309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via excludeLocalities() - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class ExcludeLocalitiesActor1 final : public Actor, public ActorCallback< ExcludeLocalitiesActor1, 0, Void >, public ActorCallback< ExcludeLocalitiesActor1, 1, Void >, public ActorCallback< ExcludeLocalitiesActor1, 2, Void >, public ActorCallback< ExcludeLocalitiesActor1, 3, Void >, public ActorCallback< ExcludeLocalitiesActor1, 4, Void >, public FastAllocated, public ExcludeLocalitiesActor1State { - #line 7314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7324,9 +9378,9 @@ friend struct ActorCallback< ExcludeLocalitiesActor1, 1, Void >; friend struct ActorCallback< ExcludeLocalitiesActor1, 2, Void >; friend struct ActorCallback< ExcludeLocalitiesActor1, 3, Void >; friend struct ActorCallback< ExcludeLocalitiesActor1, 4, Void >; - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ExcludeLocalitiesActor1(Database const& cx,std::unordered_set const& localities,bool const& failed) - #line 7329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), ExcludeLocalitiesActor1State(cx, localities, failed) { @@ -7354,36 +9408,36 @@ friend struct ActorCallback< ExcludeLocalitiesActor1, 4, Void >; } }; } - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future excludeLocalities( Database const& cx, std::unordered_set const& localities, bool const& failed ) { - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new ExcludeLocalitiesActor1(cx, localities, failed)); - #line 7361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 1769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 7366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via includeServers() - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class IncludeServersActorState { - #line 7373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" IncludeServersActorState(Database const& cx,std::vector const& servers,bool const& failed) - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" servers(servers), - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" failed(failed), - #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" versionKey(deterministicRandom()->randomUniqueID().toString()) - #line 7386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("includeServers", reinterpret_cast(this)); @@ -7396,24 +9450,24 @@ class IncludeServersActorState { int a_body1(int loopDepth=0) { try { - #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (cx->apiVersionAtLeast(700)) - #line 7401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw = ReadYourWritesTransaction(cx); - #line 1447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 7407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } else { - #line 1485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr = Transaction(cx); - #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 7416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead2(loopDepth); } } @@ -7443,57 +9497,59 @@ class IncludeServersActorState { int a_body1loopBody1(int loopDepth) { try { - #line 1449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ryw.setOption(FDBTransactionOptions::RAW_ACCESS); + #line 1777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw.setOption(FDBTransactionOptions::SPECIAL_KEY_SPACE_ENABLE_WRITES); - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto& s : servers ) { - #line 1451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!s.isValid()) - #line 7452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (failed) - #line 7456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw.clear(SpecialKeySpace::getManagementApiCommandRange("failed")); - #line 7460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw.clear(SpecialKeySpace::getManagementApiCommandRange("exclude")); - #line 7466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } else { - #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Key addr = failed ? SpecialKeySpace::getManagementApiCommandPrefix("failed").withSuffix(s.toString()) : SpecialKeySpace::getManagementApiCommandPrefix("exclude").withSuffix(s.toString()); - #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw.clear(addr); - #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (s.isWholeMachine()) - #line 7477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ryw.clear(KeyRangeRef(addr.withSuffix(LiteralStringRef(":")), addr.withSuffix(LiteralStringRef(";")))); - #line 7481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 1799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ryw.clear(KeyRangeRef(addr.withSuffix(":"_sr), addr.withSuffix(";"_sr))); + #line 9537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } } - #line 1475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("IncludeServersCommit").detail("Servers", describe(servers)).detail("Failed", failed); - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = ryw.commit(); - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 7491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7513,18 +9569,18 @@ class IncludeServersActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("IncludeServersError").errorUnsuppressed(e); - #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = ryw.onError(e); - #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 7522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7537,9 +9593,9 @@ class IncludeServersActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 1478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~IncludeServersActorState(); static_cast(this)->destroy(); return 0; } - #line 7542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~IncludeServersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7549,9 +9605,9 @@ class IncludeServersActorState { } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 1478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~IncludeServersActorState(); static_cast(this)->destroy(); return 0; } - #line 7554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~IncludeServersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7707,100 +9763,100 @@ class IncludeServersActorState { int a_body1loopBody2(int loopDepth) { try { - #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); - #line 1495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::CAUSAL_WRITE_RISKY); - #line 1496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (failed) - #line 7722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.addReadConflictRange(singleKeyRange(failedServersVersionKey)); - #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(failedServersVersionKey, versionKey); - #line 7728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.addReadConflictRange(singleKeyRange(excludedServersVersionKey)); - #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(excludedServersVersionKey, versionKey); - #line 7736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto& s : servers ) { - #line 1505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!s.isValid()) - #line 7742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (failed) - #line 7746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(failedServersKeys); - #line 7750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(excludedServersKeys); - #line 7756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } else { - #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (s.isWholeMachine()) - #line 7763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto addr = failed ? encodeFailedServersKey(s) : encodeExcludedServersKey(s); - #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(singleKeyRange(addr)); - #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(KeyRangeRef(addr + ':', addr + char(':' + 1))); - #line 7771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (failed) - #line 7777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(encodeFailedServersKey(s)); - #line 7781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(encodeExcludedServersKey(s)); - #line 7787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } } } - #line 1532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("IncludeServersCommit").detail("Servers", describe(servers)).detail("Failed", failed); - #line 1534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = tr.commit(); - #line 1534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody2Catch1(actor_cancelled(), loopDepth); - #line 7798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody2Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7820,18 +9876,18 @@ class IncludeServersActorState { int a_body1loopBody2Catch1(const Error& e,int loopDepth=0) { try { - #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("IncludeServersError").errorUnsuppressed(e); - #line 1538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_3 = tr.onError(e); - #line 1538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 7829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody2Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7844,9 +9900,9 @@ class IncludeServersActorState { } int a_body1loopBody2cont2(Void const& _,int loopDepth) { - #line 1535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~IncludeServersActorState(); static_cast(this)->destroy(); return 0; } - #line 7849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~IncludeServersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7856,9 +9912,9 @@ class IncludeServersActorState { } int a_body1loopBody2cont2(Void && _,int loopDepth) { - #line 1535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~IncludeServersActorState(); static_cast(this)->destroy(); return 0; } - #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 9917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~IncludeServersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8004,24 +10060,24 @@ class IncludeServersActorState { fdb_probe_actor_exit("includeServers", reinterpret_cast(this), 3); } - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector servers; - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool failed; - #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::string versionKey; - #line 1446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ReadYourWritesTransaction ryw; - #line 1485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 8019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via includeServers() - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class IncludeServersActor final : public Actor, public ActorCallback< IncludeServersActor, 0, Void >, public ActorCallback< IncludeServersActor, 1, Void >, public ActorCallback< IncludeServersActor, 2, Void >, public ActorCallback< IncludeServersActor, 3, Void >, public FastAllocated, public IncludeServersActorState { - #line 8024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8033,9 +10089,9 @@ friend struct ActorCallback< IncludeServersActor, 0, Void >; friend struct ActorCallback< IncludeServersActor, 1, Void >; friend struct ActorCallback< IncludeServersActor, 2, Void >; friend struct ActorCallback< IncludeServersActor, 3, Void >; - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" IncludeServersActor(Database const& cx,std::vector const& servers,bool const& failed) - #line 8038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), IncludeServersActorState(cx, servers, failed) { @@ -8062,40 +10118,40 @@ friend struct ActorCallback< IncludeServersActor, 3, Void >; } }; } - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future includeServers( Database const& cx, std::vector const& servers, bool const& failed ) { - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new IncludeServersActor(cx, servers, failed)); - #line 8069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" // Remove the given localities from the exclusion list. // include localities by clearing the keys. - #line 8076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via includeLocalities() - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class IncludeLocalitiesActorState { - #line 8083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" IncludeLocalitiesActorState(Database const& cx,std::vector const& localities,bool const& failed,bool const& includeAll) - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" localities(localities), - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" failed(failed), - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" includeAll(includeAll), - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" versionKey(deterministicRandom()->randomUniqueID().toString()) - #line 8098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("includeLocalities", reinterpret_cast(this)); @@ -8108,24 +10164,24 @@ class IncludeLocalitiesActorState { int a_body1(int loopDepth=0) { try { - #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (cx->apiVersionAtLeast(700)) - #line 8113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw = ReadYourWritesTransaction(cx); - #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 8119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } else { - #line 1580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr = Transaction(cx); - #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 8128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead2(loopDepth); } } @@ -8155,50 +10211,52 @@ class IncludeLocalitiesActorState { int a_body1loopBody1(int loopDepth) { try { - #line 1552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ryw.setOption(FDBTransactionOptions::RAW_ACCESS); + #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw.setOption(FDBTransactionOptions::SPECIAL_KEY_SPACE_ENABLE_WRITES); - #line 1553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (includeAll) - #line 8162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (failed) - #line 8166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw.clear(SpecialKeySpace::getManagementApiCommandRange("failedlocality")); - #line 8170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw.clear(SpecialKeySpace::getManagementApiCommandRange("excludedlocality")); - #line 8176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } else { - #line 1560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( const auto& l : localities ) { - #line 1561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Key locality = failed ? SpecialKeySpace::getManagementApiCommandPrefix("failedlocality").withSuffix(l) : SpecialKeySpace::getManagementApiCommandPrefix("excludedlocality").withSuffix(l); - #line 1564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ryw.clear(locality); - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("IncludeLocalitiesCommit") .detail("Localities", describe(localities)) .detail("Failed", failed) .detail("IncludeAll", includeAll); - #line 1572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = ryw.commit(); - #line 1572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 8196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8218,18 +10276,18 @@ class IncludeLocalitiesActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("IncludeLocalitiesError").errorUnsuppressed(e); - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = ryw.onError(e); - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 8227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8242,9 +10300,9 @@ class IncludeLocalitiesActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~IncludeLocalitiesActorState(); static_cast(this)->destroy(); return 0; } - #line 8247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~IncludeLocalitiesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8254,9 +10312,9 @@ class IncludeLocalitiesActorState { } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~IncludeLocalitiesActorState(); static_cast(this)->destroy(); return 0; } - #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~IncludeLocalitiesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8412,85 +10470,85 @@ class IncludeLocalitiesActorState { int a_body1loopBody2(int loopDepth) { try { - #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); - #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::CAUSAL_WRITE_RISKY); - #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (failed) - #line 8427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.addReadConflictRange(singleKeyRange(failedLocalityVersionKey)); - #line 1593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(failedLocalityVersionKey, versionKey); - #line 8433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.addReadConflictRange(singleKeyRange(excludedLocalityVersionKey)); - #line 1596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(excludedLocalityVersionKey, versionKey); - #line 8441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (includeAll) - #line 8445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (failed) - #line 8449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(failedLocalityKeys); - #line 8453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(excludedLocalityKeys); - #line 8459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } else { - #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( const auto& l : localities ) { - #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (failed) - #line 8468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(encodeFailedLocalityKey(l)); - #line 8472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(encodeExcludedLocalityKey(l)); - #line 8478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } } - #line 1615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("IncludeLocalitiesCommit") .detail("Localities", describe(localities)) .detail("Failed", failed) .detail("IncludeAll", includeAll); - #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = tr.commit(); - #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody2Catch1(actor_cancelled(), loopDepth); - #line 8488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody2Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8510,18 +10568,18 @@ class IncludeLocalitiesActorState { int a_body1loopBody2Catch1(const Error& e,int loopDepth=0) { try { - #line 1623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("IncludeLocalitiesError").errorUnsuppressed(e); - #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_3 = tr.onError(e); - #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 8519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody2Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8534,9 +10592,9 @@ class IncludeLocalitiesActorState { } int a_body1loopBody2cont2(Void const& _,int loopDepth) { - #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~IncludeLocalitiesActorState(); static_cast(this)->destroy(); return 0; } - #line 8539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~IncludeLocalitiesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8546,9 +10604,9 @@ class IncludeLocalitiesActorState { } int a_body1loopBody2cont2(Void && _,int loopDepth) { - #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~IncludeLocalitiesActorState(); static_cast(this)->destroy(); return 0; } - #line 8551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~IncludeLocalitiesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8694,26 +10752,26 @@ class IncludeLocalitiesActorState { fdb_probe_actor_exit("includeLocalities", reinterpret_cast(this), 3); } - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector localities; - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool failed; - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool includeAll; - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::string versionKey; - #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ReadYourWritesTransaction ryw; - #line 1580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 8711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via includeLocalities() - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class IncludeLocalitiesActor final : public Actor, public ActorCallback< IncludeLocalitiesActor, 0, Void >, public ActorCallback< IncludeLocalitiesActor, 1, Void >, public ActorCallback< IncludeLocalitiesActor, 2, Void >, public ActorCallback< IncludeLocalitiesActor, 3, Void >, public FastAllocated, public IncludeLocalitiesActorState { - #line 8716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8725,9 +10783,9 @@ friend struct ActorCallback< IncludeLocalitiesActor, 0, Void >; friend struct ActorCallback< IncludeLocalitiesActor, 1, Void >; friend struct ActorCallback< IncludeLocalitiesActor, 2, Void >; friend struct ActorCallback< IncludeLocalitiesActor, 3, Void >; - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" IncludeLocalitiesActor(Database const& cx,std::vector const& localities,bool const& failed,bool const& includeAll) - #line 8730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), IncludeLocalitiesActorState(cx, localities, failed, includeAll) { @@ -8754,36 +10812,36 @@ friend struct ActorCallback< IncludeLocalitiesActor, 3, Void >; } }; } - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future includeLocalities( Database const& cx, std::vector const& localities, bool const& failed, bool const& includeAll ) { - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new IncludeLocalitiesActor(cx, localities, failed, includeAll)); - #line 8761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 1957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 8766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via setClass() - #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class SetClassActorState { - #line 8773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" SetClassActorState(Database const& cx,AddressExclusion const& server,ProcessClass const& processClass) - #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" server(server), - #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" processClass(processClass), - #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(cx) - #line 8786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("setClass", reinterpret_cast(this)); @@ -8796,9 +10854,9 @@ class SetClassActorState { int a_body1(int loopDepth=0) { try { - #line 1633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 8801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -8827,24 +10885,24 @@ class SetClassActorState { int a_body1loopBody1(int loopDepth) { try { - #line 1635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); - #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = getWorkers(&tr); - #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 8842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 8847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8864,16 +10922,16 @@ class SetClassActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = tr.onError(e); - #line 1660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 8871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8886,102 +10944,102 @@ class SetClassActorState { } int a_body1loopBody1cont2(std::vector const& workers,int loopDepth) { - #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool foundChange = false; - #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(int i = 0;i < workers.size();i++) { - #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (server.excludes(workers[i].address)) - #line 8895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (processClass.classType() != ProcessClass::InvalidClass) - #line 8899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(processClassKeyFor(workers[i].locality.processId().get()), processClassValue(processClass)); - #line 8903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(processClassKeyFor(workers[i].locality.processId().get())); - #line 8909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" foundChange = true; - #line 8913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (foundChange) - #line 8918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(processClassChangeKey, deterministicRandom()->randomUniqueID().toString()); - #line 8922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.commit(); - #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 8928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(std::vector && workers,int loopDepth) { - #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool foundChange = false; - #line 1643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(int i = 0;i < workers.size();i++) { - #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (server.excludes(workers[i].address)) - #line 8946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (processClass.classType() != ProcessClass::InvalidClass) - #line 8950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(processClassKeyFor(workers[i].locality.processId().get()), processClassValue(processClass)); - #line 8954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(processClassKeyFor(workers[i].locality.processId().get())); - #line 8960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" foundChange = true; - #line 8964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (foundChange) - #line 8969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(processClassChangeKey, deterministicRandom()->randomUniqueID().toString()); - #line 8973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.commit(); - #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 8979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9051,9 +11109,9 @@ class SetClassActorState { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SetClassActorState(); static_cast(this)->destroy(); return 0; } - #line 9056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SetClassActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9063,9 +11121,9 @@ class SetClassActorState { } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SetClassActorState(); static_cast(this)->destroy(); return 0; } - #line 9068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SetClassActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9211,20 +11269,20 @@ class SetClassActorState { fdb_probe_actor_exit("setClass", reinterpret_cast(this), 2); } - #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" AddressExclusion server; - #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ProcessClass processClass; - #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 9222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via setClass() - #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class SetClassActor final : public Actor, public ActorCallback< SetClassActor, 0, std::vector >, public ActorCallback< SetClassActor, 1, Void >, public ActorCallback< SetClassActor, 2, Void >, public FastAllocated, public SetClassActorState { - #line 9227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9235,9 +11293,9 @@ class SetClassActor final : public Actor, public ActorCallback< SetClassAc friend struct ActorCallback< SetClassActor, 0, std::vector >; friend struct ActorCallback< SetClassActor, 1, Void >; friend struct ActorCallback< SetClassActor, 2, Void >; - #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" SetClassActor(Database const& cx,AddressExclusion const& server,ProcessClass const& processClass) - #line 9240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), SetClassActorState(cx, server, processClass) { @@ -9263,30 +11321,30 @@ friend struct ActorCallback< SetClassActor, 2, Void >; } }; } - #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future setClass( Database const& cx, AddressExclusion const& server, ProcessClass const& processClass ) { - #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new SetClassActor(cx, server, processClass)); - #line 9270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 1992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 9275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via getExcludedServerList() - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetExcludedServerListActorState { - #line 9282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetExcludedServerListActorState(Transaction* const& tr) - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr) - #line 9289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("getExcludedServerList", reinterpret_cast(this)); @@ -9299,16 +11357,16 @@ class GetExcludedServerListActorState { int a_body1(int loopDepth=0) { try { - #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = tr->getRange(excludedServersKeys, CLIENT_KNOBS->TOO_MANY); - #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9329,28 +11387,28 @@ class GetExcludedServerListActorState { } int a_body1cont1(int loopDepth) { - #line 1667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(!r.more && r.size() < CLIENT_KNOBS->TOO_MANY); - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector exclusions; - #line 1670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(auto i = r.begin();i != r.end();++i) { - #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto a = decodeExcludedServersKey(i->key); - #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (a.isValid()) - #line 9342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" exclusions.push_back(a); - #line 9346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" uniquify(exclusions); - #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(exclusions); this->~GetExcludedServerListActorState(); static_cast(this)->destroy(); return 0; } - #line 9353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(exclusions); this->~GetExcludedServerListActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9360,9 +11418,9 @@ class GetExcludedServerListActorState { } int a_body1when1(RangeResult const& __r,int loopDepth) { - #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" r = __r; - #line 9365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -9425,16 +11483,16 @@ class GetExcludedServerListActorState { fdb_probe_actor_exit("getExcludedServerList", reinterpret_cast(this), 0); } - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" RangeResult r; - #line 9432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via getExcludedServerList() - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetExcludedServerListActor final : public Actor>, public ActorCallback< GetExcludedServerListActor, 0, RangeResult >, public FastAllocated, public GetExcludedServerListActorState { - #line 9437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9443,9 +11501,9 @@ class GetExcludedServerListActor final : public Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetExcludedServerListActor, 0, RangeResult >; - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetExcludedServerListActor(Transaction* const& tr) - #line 9448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor>(), GetExcludedServerListActorState(tr) { @@ -9469,30 +11527,30 @@ friend struct ActorCallback< GetExcludedServerListActor, 0, RangeResult >; } }; } - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future> getExcludedServerList( Transaction* const& tr ) { - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future>(new GetExcludedServerListActor(tr)); - #line 9476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 9481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via getExcludedFailedServerList() - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetExcludedFailedServerListActorState { - #line 9488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetExcludedFailedServerListActorState(Transaction* const& tr) - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr) - #line 9495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("getExcludedFailedServerList", reinterpret_cast(this)); @@ -9505,16 +11563,16 @@ class GetExcludedFailedServerListActorState { int a_body1(int loopDepth=0) { try { - #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = tr->getRange(failedServersKeys, CLIENT_KNOBS->TOO_MANY); - #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9535,28 +11593,28 @@ class GetExcludedFailedServerListActorState { } int a_body1cont1(int loopDepth) { - #line 1681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(!r.more && r.size() < CLIENT_KNOBS->TOO_MANY); - #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector exclusions; - #line 1684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(auto i = r.begin();i != r.end();++i) { - #line 1685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto a = decodeFailedServersKey(i->key); - #line 1686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (a.isValid()) - #line 9548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" exclusions.push_back(a); - #line 9552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" uniquify(exclusions); - #line 1690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(exclusions); this->~GetExcludedFailedServerListActorState(); static_cast(this)->destroy(); return 0; } - #line 9559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(exclusions); this->~GetExcludedFailedServerListActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9566,9 +11624,9 @@ class GetExcludedFailedServerListActorState { } int a_body1when1(RangeResult const& __r,int loopDepth) { - #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" r = __r; - #line 9571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -9631,16 +11689,16 @@ class GetExcludedFailedServerListActorState { fdb_probe_actor_exit("getExcludedFailedServerList", reinterpret_cast(this), 0); } - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" RangeResult r; - #line 9638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via getExcludedFailedServerList() - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetExcludedFailedServerListActor final : public Actor>, public ActorCallback< GetExcludedFailedServerListActor, 0, RangeResult >, public FastAllocated, public GetExcludedFailedServerListActorState { - #line 9643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9649,9 +11707,9 @@ class GetExcludedFailedServerListActor final : public Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetExcludedFailedServerListActor, 0, RangeResult >; - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetExcludedFailedServerListActor(Transaction* const& tr) - #line 9654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor>(), GetExcludedFailedServerListActorState(tr) { @@ -9675,32 +11733,32 @@ friend struct ActorCallback< GetExcludedFailedServerListActor, 0, RangeResult >; } }; } - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future> getExcludedFailedServerList( Transaction* const& tr ) { - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future>(new GetExcludedFailedServerListActor(tr)); - #line 9682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 9687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via getAllExcludedServers() - #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetAllExcludedServersActorState { - #line 9694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetAllExcludedServersActorState(Transaction* const& tr) - #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr), - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" exclusions() - #line 9703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("getAllExcludedServers", reinterpret_cast(this)); @@ -9713,16 +11771,16 @@ class GetAllExcludedServersActorState { int a_body1(int loopDepth=0) { try { - #line 1695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = getExcludedServerList(tr); - #line 1695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 9725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9743,36 +11801,36 @@ class GetAllExcludedServersActorState { } int a_body1cont1(std::vector const& excludedServers,int loopDepth) { - #line 1696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" exclusions.insert(exclusions.end(), excludedServers.begin(), excludedServers.end()); - #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_1 = getExcludedFailedServerList(tr); - #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 9757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(std::vector && excludedServers,int loopDepth) { - #line 1696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" exclusions.insert(exclusions.end(), excludedServers.begin(), excludedServers.end()); - #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_1 = getExcludedFailedServerList(tr); - #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 9775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9842,13 +11900,13 @@ class GetAllExcludedServersActorState { } int a_body1cont2(std::vector const& excludedFailed,int loopDepth) { - #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" exclusions.insert(exclusions.end(), excludedFailed.begin(), excludedFailed.end()); - #line 1699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" uniquify(exclusions); - #line 1700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(exclusions); this->~GetAllExcludedServersActorState(); static_cast(this)->destroy(); return 0; } - #line 9851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::move(exclusions)); // state_var_RVO this->~GetAllExcludedServersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9858,13 +11916,13 @@ class GetAllExcludedServersActorState { } int a_body1cont2(std::vector && excludedFailed,int loopDepth) { - #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" exclusions.insert(exclusions.end(), excludedFailed.begin(), excludedFailed.end()); - #line 1699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" uniquify(exclusions); - #line 1700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(exclusions); this->~GetAllExcludedServersActorState(); static_cast(this)->destroy(); return 0; } - #line 9867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 11925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::move(exclusions)); // state_var_RVO this->~GetAllExcludedServersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9935,16 +11993,16 @@ class GetAllExcludedServersActorState { fdb_probe_actor_exit("getAllExcludedServers", reinterpret_cast(this), 1); } - #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector exclusions; - #line 9942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via getAllExcludedServers() - #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetAllExcludedServersActor final : public Actor>, public ActorCallback< GetAllExcludedServersActor, 0, std::vector >, public ActorCallback< GetAllExcludedServersActor, 1, std::vector >, public FastAllocated, public GetAllExcludedServersActorState { - #line 9947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9954,9 +12012,9 @@ class GetAllExcludedServersActor final : public Actor >; friend struct ActorCallback< GetAllExcludedServersActor, 1, std::vector >; - #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetAllExcludedServersActor(Transaction* const& tr) - #line 9959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor>(), GetAllExcludedServersActorState(tr) { @@ -9981,32 +12039,32 @@ friend struct ActorCallback< GetAllExcludedServersActor, 1, std::vector> getAllExcludedServers( Transaction* const& tr ) { - #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future>(new GetAllExcludedServersActor(tr)); - #line 9988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 9993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via getAllExcludedServers() - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetAllExcludedServersActor1State { - #line 10000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetAllExcludedServersActor1State(Database const& cx) - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(cx) - #line 10009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("getAllExcludedServers", reinterpret_cast(this)); @@ -10019,9 +12077,9 @@ class GetAllExcludedServersActor1State { int a_body1(int loopDepth=0) { try { - #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 10024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -10050,22 +12108,22 @@ class GetAllExcludedServersActor1State { int a_body1loopBody1(int loopDepth) { try { - #line 1707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = getAllExcludedServers(&tr); - #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 10063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 10068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -10085,16 +12143,16 @@ class GetAllExcludedServersActor1State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.onError(e); - #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 10092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -10107,9 +12165,9 @@ class GetAllExcludedServersActor1State { } int a_body1loopBody1cont2(std::vector const& exclusions,int loopDepth) { - #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(exclusions); this->~GetAllExcludedServersActor1State(); static_cast(this)->destroy(); return 0; } - #line 10112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(exclusions); this->~GetAllExcludedServersActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10119,9 +12177,9 @@ class GetAllExcludedServersActor1State { } int a_body1loopBody1cont2(std::vector && exclusions,int loopDepth) { - #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(exclusions); this->~GetAllExcludedServersActor1State(); static_cast(this)->destroy(); return 0; } - #line 10124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(exclusions); this->~GetAllExcludedServersActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10267,16 +12325,16 @@ class GetAllExcludedServersActor1State { fdb_probe_actor_exit("getAllExcludedServers", reinterpret_cast(this), 1); } - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 10274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via getAllExcludedServers() - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetAllExcludedServersActor1 final : public Actor>, public ActorCallback< GetAllExcludedServersActor1, 0, std::vector >, public ActorCallback< GetAllExcludedServersActor1, 1, Void >, public FastAllocated, public GetAllExcludedServersActor1State { - #line 10279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -10286,9 +12344,9 @@ class GetAllExcludedServersActor1 final : public Actor >; friend struct ActorCallback< GetAllExcludedServersActor1, 1, Void >; - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetAllExcludedServersActor1(Database const& cx) - #line 10291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor>(), GetAllExcludedServersActor1State(cx) { @@ -10313,30 +12371,30 @@ friend struct ActorCallback< GetAllExcludedServersActor1, 1, Void >; } }; } - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future> getAllExcludedServers( Database const& cx ) { - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future>(new GetAllExcludedServersActor1(cx)); - #line 10320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 10325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via getExcludedLocalityList() - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetExcludedLocalityListActorState { - #line 10332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetExcludedLocalityListActorState(Transaction* const& tr) - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr) - #line 10339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("getExcludedLocalityList", reinterpret_cast(this)); @@ -10349,16 +12407,16 @@ class GetExcludedLocalityListActorState { int a_body1(int loopDepth=0) { try { - #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = tr->getRange(excludedLocalityKeys, CLIENT_KNOBS->TOO_MANY); - #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -10379,23 +12437,23 @@ class GetExcludedLocalityListActorState { } int a_body1cont1(int loopDepth) { - #line 1720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(!r.more && r.size() < CLIENT_KNOBS->TOO_MANY); - #line 1722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector excludedLocalities; - #line 1723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( const auto& i : r ) { - #line 1724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto a = decodeExcludedLocalityKey(i.key); - #line 1725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" excludedLocalities.push_back(a); - #line 10392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" uniquify(excludedLocalities); - #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(excludedLocalities); this->~GetExcludedLocalityListActorState(); static_cast(this)->destroy(); return 0; } - #line 10398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(excludedLocalities); this->~GetExcludedLocalityListActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10405,9 +12463,9 @@ class GetExcludedLocalityListActorState { } int a_body1when1(RangeResult const& __r,int loopDepth) { - #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" r = __r; - #line 10410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -10470,16 +12528,16 @@ class GetExcludedLocalityListActorState { fdb_probe_actor_exit("getExcludedLocalityList", reinterpret_cast(this), 0); } - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" RangeResult r; - #line 10477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via getExcludedLocalityList() - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetExcludedLocalityListActor final : public Actor>, public ActorCallback< GetExcludedLocalityListActor, 0, RangeResult >, public FastAllocated, public GetExcludedLocalityListActorState { - #line 10482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -10488,9 +12546,9 @@ class GetExcludedLocalityListActor final : public Actor void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetExcludedLocalityListActor, 0, RangeResult >; - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetExcludedLocalityListActor(Transaction* const& tr) - #line 10493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor>(), GetExcludedLocalityListActorState(tr) { @@ -10514,30 +12572,30 @@ friend struct ActorCallback< GetExcludedLocalityListActor, 0, RangeResult >; } }; } - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future> getExcludedLocalityList( Transaction* const& tr ) { - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future>(new GetExcludedLocalityListActor(tr)); - #line 10521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 10526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via getExcludedFailedLocalityList() - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetExcludedFailedLocalityListActorState { - #line 10533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetExcludedFailedLocalityListActorState(Transaction* const& tr) - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr) - #line 10540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("getExcludedFailedLocalityList", reinterpret_cast(this)); @@ -10550,16 +12608,16 @@ class GetExcludedFailedLocalityListActorState { int a_body1(int loopDepth=0) { try { - #line 1732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = tr->getRange(failedLocalityKeys, CLIENT_KNOBS->TOO_MANY); - #line 1732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -10580,23 +12638,23 @@ class GetExcludedFailedLocalityListActorState { } int a_body1cont1(int loopDepth) { - #line 1733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(!r.more && r.size() < CLIENT_KNOBS->TOO_MANY); - #line 1735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector excludedLocalities; - #line 1736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( const auto& i : r ) { - #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto a = decodeFailedLocalityKey(i.key); - #line 1738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" excludedLocalities.push_back(a); - #line 10593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" uniquify(excludedLocalities); - #line 1741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(excludedLocalities); this->~GetExcludedFailedLocalityListActorState(); static_cast(this)->destroy(); return 0; } - #line 10599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(excludedLocalities); this->~GetExcludedFailedLocalityListActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10606,9 +12664,9 @@ class GetExcludedFailedLocalityListActorState { } int a_body1when1(RangeResult const& __r,int loopDepth) { - #line 1732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" r = __r; - #line 10611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -10671,16 +12729,16 @@ class GetExcludedFailedLocalityListActorState { fdb_probe_actor_exit("getExcludedFailedLocalityList", reinterpret_cast(this), 0); } - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 1732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" RangeResult r; - #line 10678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via getExcludedFailedLocalityList() - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetExcludedFailedLocalityListActor final : public Actor>, public ActorCallback< GetExcludedFailedLocalityListActor, 0, RangeResult >, public FastAllocated, public GetExcludedFailedLocalityListActorState { - #line 10683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -10689,9 +12747,9 @@ class GetExcludedFailedLocalityListActor final : public Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetExcludedFailedLocalityListActor, 0, RangeResult >; - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetExcludedFailedLocalityListActor(Transaction* const& tr) - #line 10694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor>(), GetExcludedFailedLocalityListActorState(tr) { @@ -10715,32 +12773,32 @@ friend struct ActorCallback< GetExcludedFailedLocalityListActor, 0, RangeResult } }; } - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future> getExcludedFailedLocalityList( Transaction* const& tr ) { - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future>(new GetExcludedFailedLocalityListActor(tr)); - #line 10722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 10727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via getAllExcludedLocalities() - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetAllExcludedLocalitiesActorState { - #line 10734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetAllExcludedLocalitiesActorState(Transaction* const& tr) - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr), - #line 1745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" exclusions() - #line 10743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("getAllExcludedLocalities", reinterpret_cast(this)); @@ -10753,16 +12811,16 @@ class GetAllExcludedLocalitiesActorState { int a_body1(int loopDepth=0) { try { - #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = getExcludedLocalityList(tr); - #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 10765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -10783,36 +12841,36 @@ class GetAllExcludedLocalitiesActorState { } int a_body1cont1(std::vector const& excludedLocalities,int loopDepth) { - #line 1747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" exclusions.insert(exclusions.end(), excludedLocalities.begin(), excludedLocalities.end()); - #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_1 = getExcludedFailedLocalityList(tr); - #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 10797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(std::vector && excludedLocalities,int loopDepth) { - #line 1747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" exclusions.insert(exclusions.end(), excludedLocalities.begin(), excludedLocalities.end()); - #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_1 = getExcludedFailedLocalityList(tr); - #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 10815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -10882,13 +12940,13 @@ class GetAllExcludedLocalitiesActorState { } int a_body1cont2(std::vector const& failedLocalities,int loopDepth) { - #line 1749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" exclusions.insert(exclusions.end(), failedLocalities.begin(), failedLocalities.end()); - #line 1750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" uniquify(exclusions); - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(exclusions); this->~GetAllExcludedLocalitiesActorState(); static_cast(this)->destroy(); return 0; } - #line 10891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::move(exclusions)); // state_var_RVO this->~GetAllExcludedLocalitiesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10898,13 +12956,13 @@ class GetAllExcludedLocalitiesActorState { } int a_body1cont2(std::vector && failedLocalities,int loopDepth) { - #line 1749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" exclusions.insert(exclusions.end(), failedLocalities.begin(), failedLocalities.end()); - #line 1750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" uniquify(exclusions); - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(exclusions); this->~GetAllExcludedLocalitiesActorState(); static_cast(this)->destroy(); return 0; } - #line 10907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 12965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::move(exclusions)); // state_var_RVO this->~GetAllExcludedLocalitiesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10975,16 +13033,16 @@ class GetAllExcludedLocalitiesActorState { fdb_probe_actor_exit("getAllExcludedLocalities", reinterpret_cast(this), 1); } - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 1745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector exclusions; - #line 10982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via getAllExcludedLocalities() - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetAllExcludedLocalitiesActor final : public Actor>, public ActorCallback< GetAllExcludedLocalitiesActor, 0, std::vector >, public ActorCallback< GetAllExcludedLocalitiesActor, 1, std::vector >, public FastAllocated, public GetAllExcludedLocalitiesActorState { - #line 10987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -10994,9 +13052,9 @@ class GetAllExcludedLocalitiesActor final : public Actor >; friend struct ActorCallback< GetAllExcludedLocalitiesActor, 1, std::vector >; - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetAllExcludedLocalitiesActor(Transaction* const& tr) - #line 10999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor>(), GetAllExcludedLocalitiesActorState(tr) { @@ -11021,33 +13079,33 @@ friend struct ActorCallback< GetAllExcludedLocalitiesActor, 1, std::vector> getAllExcludedLocalities( Transaction* const& tr ) { - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future>(new GetAllExcludedLocalitiesActor(tr)); - #line 11028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" // Get the list of excluded localities by reading the keys. - #line 11034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via getAllExcludedLocalities() - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetAllExcludedLocalitiesActor1State { - #line 11041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetAllExcludedLocalitiesActor1State(Database const& cx) - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(cx) - #line 11050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("getAllExcludedLocalities", reinterpret_cast(this)); @@ -11060,9 +13118,9 @@ class GetAllExcludedLocalitiesActor1State { int a_body1(int loopDepth=0) { try { - #line 1757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 11065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -11091,22 +13149,22 @@ class GetAllExcludedLocalitiesActor1State { int a_body1loopBody1(int loopDepth) { try { - #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = getAllExcludedLocalities(&tr); - #line 1762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 11109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11126,16 +13184,16 @@ class GetAllExcludedLocalitiesActor1State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.onError(e); - #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 11133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11148,9 +13206,9 @@ class GetAllExcludedLocalitiesActor1State { } int a_body1loopBody1cont2(std::vector const& exclusions,int loopDepth) { - #line 1763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(exclusions); this->~GetAllExcludedLocalitiesActor1State(); static_cast(this)->destroy(); return 0; } - #line 11153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(exclusions); this->~GetAllExcludedLocalitiesActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11160,9 +13218,9 @@ class GetAllExcludedLocalitiesActor1State { } int a_body1loopBody1cont2(std::vector && exclusions,int loopDepth) { - #line 1763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(exclusions); this->~GetAllExcludedLocalitiesActor1State(); static_cast(this)->destroy(); return 0; } - #line 11165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(exclusions); this->~GetAllExcludedLocalitiesActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11308,16 +13366,16 @@ class GetAllExcludedLocalitiesActor1State { fdb_probe_actor_exit("getAllExcludedLocalities", reinterpret_cast(this), 1); } - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 11315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via getAllExcludedLocalities() - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class GetAllExcludedLocalitiesActor1 final : public Actor>, public ActorCallback< GetAllExcludedLocalitiesActor1, 0, std::vector >, public ActorCallback< GetAllExcludedLocalitiesActor1, 1, Void >, public FastAllocated, public GetAllExcludedLocalitiesActor1State { - #line 11320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -11327,9 +13385,9 @@ class GetAllExcludedLocalitiesActor1 final : public Actor >; friend struct ActorCallback< GetAllExcludedLocalitiesActor1, 1, Void >; - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" GetAllExcludedLocalitiesActor1(Database const& cx) - #line 11332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor>(), GetAllExcludedLocalitiesActor1State(cx) { @@ -11354,14 +13412,14 @@ friend struct ActorCallback< GetAllExcludedLocalitiesActor1, 1, Void >; } }; } - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future> getAllExcludedLocalities( Database const& cx ) { - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future>(new GetAllExcludedLocalitiesActor1(cx)); - #line 11361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" // Decodes the locality string to a pair of locality prefix and its value. // The prefix could be dcid, processid, machineid, processid. @@ -11394,23 +13452,23 @@ std::set getAddressesByLocality(const std::vector return localityAddresses; } - #line 11397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via printHealthyZone() - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class PrintHealthyZoneActorState { - #line 11404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" PrintHealthyZoneActorState(Database const& cx) - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(cx) - #line 11413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("printHealthyZone", reinterpret_cast(this)); @@ -11423,9 +13481,9 @@ class PrintHealthyZoneActorState { int a_body1(int loopDepth=0) { try { - #line 1803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 11428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -11454,20 +13512,20 @@ class PrintHealthyZoneActorState { int a_body1loopBody1(int loopDepth) { try { - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::READ_LOCK_AWARE); - #line 1806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = tr.get(healthyZoneKey); - #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 11470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11487,16 +13545,16 @@ class PrintHealthyZoneActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.onError(e); - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 11494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11509,36 +13567,36 @@ class PrintHealthyZoneActorState { } int a_body1loopBody1cont2(Optional const& val,int loopDepth) { - #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present() && decodeHealthyZoneValue(val.get()).first == ignoreSSFailuresZoneString) - #line 11514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" printf("Data distribution has been disabled for all storage server failures in this cluster and thus " "maintenance mode is not active.\n"); - #line 11518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!val.present() || decodeHealthyZoneValue(val.get()).second <= tr.getReadVersion().get()) - #line 11524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" printf("No ongoing maintenance.\n"); - #line 11528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto healthyZone = decodeHealthyZoneValue(val.get()); - #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" fmt::print("Maintenance for zone {0} will continue for {1} seconds.\n", healthyZone.first.toString(), (healthyZone.second - tr.getReadVersion().get()) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); - #line 11536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PrintHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } - #line 11541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~PrintHealthyZoneActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11548,36 +13606,36 @@ class PrintHealthyZoneActorState { } int a_body1loopBody1cont2(Optional && val,int loopDepth) { - #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present() && decodeHealthyZoneValue(val.get()).first == ignoreSSFailuresZoneString) - #line 11553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" printf("Data distribution has been disabled for all storage server failures in this cluster and thus " "maintenance mode is not active.\n"); - #line 11557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!val.present() || decodeHealthyZoneValue(val.get()).second <= tr.getReadVersion().get()) - #line 11563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" printf("No ongoing maintenance.\n"); - #line 11567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto healthyZone = decodeHealthyZoneValue(val.get()); - #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" fmt::print("Maintenance for zone {0} will continue for {1} seconds.\n", healthyZone.first.toString(), (healthyZone.second - tr.getReadVersion().get()) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); - #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PrintHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } - #line 11580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~PrintHealthyZoneActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11723,16 +13781,16 @@ class PrintHealthyZoneActorState { fdb_probe_actor_exit("printHealthyZone", reinterpret_cast(this), 1); } - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 11730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via printHealthyZone() - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class PrintHealthyZoneActor final : public Actor, public ActorCallback< PrintHealthyZoneActor, 0, Optional >, public ActorCallback< PrintHealthyZoneActor, 1, Void >, public FastAllocated, public PrintHealthyZoneActorState { - #line 11735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -11742,9 +13800,9 @@ class PrintHealthyZoneActor final : public Actor, public ActorCallback< Pr #pragma clang diagnostic pop friend struct ActorCallback< PrintHealthyZoneActor, 0, Optional >; friend struct ActorCallback< PrintHealthyZoneActor, 1, Void >; - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" PrintHealthyZoneActor(Database const& cx) - #line 11747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), PrintHealthyZoneActorState(cx) { @@ -11769,36 +13827,36 @@ friend struct ActorCallback< PrintHealthyZoneActor, 1, Void >; } }; } - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future printHealthyZone( Database const& cx ) { - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new PrintHealthyZoneActor(cx)); - #line 11776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 11781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via clearHealthyZone() - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class ClearHealthyZoneActorState { - #line 11788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ClearHealthyZoneActorState(Database const& cx,bool const& printWarning,bool const& clearSSFailureZoneString) - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" printWarning(printWarning), - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" clearSSFailureZoneString(clearSSFailureZoneString), - #line 1827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(cx) - #line 11801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("clearHealthyZone", reinterpret_cast(this)); @@ -11811,11 +13869,11 @@ class ClearHealthyZoneActorState { int a_body1(int loopDepth=0) { try { - #line 1828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("ClearHealthyZone").detail("ClearSSFailureZoneString", clearSSFailureZoneString); - #line 1829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 11818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -11844,22 +13902,22 @@ class ClearHealthyZoneActorState { int a_body1loopBody1(int loopDepth) { try { - #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = tr.get(healthyZoneKey); - #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 11862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11879,16 +13937,16 @@ class ClearHealthyZoneActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = tr.onError(e); - #line 1848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 11886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11901,76 +13959,76 @@ class ClearHealthyZoneActorState { } int a_body1loopBody1cont2(Optional const& val,int loopDepth) { - #line 1835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!clearSSFailureZoneString && val.present() && decodeHealthyZoneValue(val.get()).first == ignoreSSFailuresZoneString) - #line 11906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (printWarning) - #line 11910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" printf("ERROR: Maintenance mode cannot be used while data distribution is disabled for storage " "server failures. Use 'datadistribution on' to reenable data distribution.\n"); - #line 11914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~ClearHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } - #line 11918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~ClearHealthyZoneActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(healthyZoneKey); - #line 1845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.commit(); - #line 1845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 13993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Optional && val,int loopDepth) { - #line 1835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!clearSSFailureZoneString && val.present() && decodeHealthyZoneValue(val.get()).first == ignoreSSFailuresZoneString) - #line 11944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 14002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (printWarning) - #line 11948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 14006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" printf("ERROR: Maintenance mode cannot be used while data distribution is disabled for storage " "server failures. Use 'datadistribution on' to reenable data distribution.\n"); - #line 11952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 14010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~ClearHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } - #line 11956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 14014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~ClearHealthyZoneActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(healthyZoneKey); - #line 1845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.commit(); - #line 1845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 14026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 14031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -12040,1016 +14098,660 @@ class ClearHealthyZoneActorState { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(true); this->~ClearHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } - #line 12045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(true); - this->~ClearHealthyZoneActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont3(Void && _,int loopDepth) - { - #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(true); this->~ClearHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } - #line 12057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(true); - this->~ClearHealthyZoneActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont2when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont2when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ClearHealthyZoneActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ClearHealthyZoneActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("clearHealthyZone", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("clearHealthyZone", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< ClearHealthyZoneActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("clearHealthyZone", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("clearHealthyZone", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< ClearHealthyZoneActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("clearHealthyZone", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("clearHealthyZone", reinterpret_cast(this), 1); - - } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ClearHealthyZoneActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ClearHealthyZoneActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("clearHealthyZone", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("clearHealthyZone", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< ClearHealthyZoneActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("clearHealthyZone", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("clearHealthyZone", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< ClearHealthyZoneActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("clearHealthyZone", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("clearHealthyZone", reinterpret_cast(this), 2); - - } - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Database cx; - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - bool printWarning; - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - bool clearSSFailureZoneString; - #line 1827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Transaction tr; - #line 12211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -}; -// This generated class is to be used only via clearHealthyZone() - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class ClearHealthyZoneActor final : public Actor, public ActorCallback< ClearHealthyZoneActor, 0, Optional >, public ActorCallback< ClearHealthyZoneActor, 1, Void >, public ActorCallback< ClearHealthyZoneActor, 2, Void >, public FastAllocated, public ClearHealthyZoneActorState { - #line 12216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< ClearHealthyZoneActor, 0, Optional >; -friend struct ActorCallback< ClearHealthyZoneActor, 1, Void >; -friend struct ActorCallback< ClearHealthyZoneActor, 2, Void >; - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ClearHealthyZoneActor(Database const& cx,bool const& printWarning,bool const& clearSSFailureZoneString) - #line 12229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - : Actor(), - ClearHealthyZoneActorState(cx, printWarning, clearSSFailureZoneString) - { - fdb_probe_actor_enter("clearHealthyZone", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("clearHealthyZone"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("clearHealthyZone", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ClearHealthyZoneActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< ClearHealthyZoneActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< ClearHealthyZoneActor, 2, Void >*)0, actor_cancelled()); break; - } - - } -}; -} - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -[[nodiscard]] Future clearHealthyZone( Database const& cx, bool const& printWarning, bool const& clearSSFailureZoneString ) { - #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return Future(new ClearHealthyZoneActor(cx, printWarning, clearSSFailureZoneString)); - #line 12259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -} - -#line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - - #line 12264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via setHealthyZone() - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -template - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class SetHealthyZoneActorState { - #line 12271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -public: - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - SetHealthyZoneActorState(Database const& cx,StringRef const& zoneId,double const& seconds,bool const& printWarning) - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - : cx(cx), - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - zoneId(zoneId), - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - seconds(seconds), - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - printWarning(printWarning), - #line 1854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr(cx) - #line 12286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - fdb_probe_actor_create("setHealthyZone", reinterpret_cast(this)); + #line 2174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~ClearHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } + #line 14103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~ClearHealthyZoneActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + return loopDepth; } - ~SetHealthyZoneActorState() + int a_body1loopBody1cont3(Void && _,int loopDepth) { - fdb_probe_actor_destroy("setHealthyZone", reinterpret_cast(this)); + #line 2174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~ClearHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } + #line 14115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~ClearHealthyZoneActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + return loopDepth; } - int a_body1(int loopDepth=0) + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) { - try { - #line 1855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - TraceEvent("SetHealthyZone").detail("Zone", zoneId).detail("DurationSeconds", seconds); - #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ; - #line 12303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } + loopDepth = a_body1loopBody1cont3(_, loopDepth); return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) + int a_body1loopBody1cont2when1(Void && _,int loopDepth) { - this->~SetHealthyZoneActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); return loopDepth; } - int a_body1loopHead1(int loopDepth) + void a_exitChoose2() { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ClearHealthyZoneActor, 1, Void >::remove(); - return loopDepth; } - int a_body1loopBody1(int loopDepth) + void a_callback_fire(ActorCallback< ClearHealthyZoneActor, 1, Void >*,Void const& value) { + fdb_probe_actor_enter("clearHealthyZone", reinterpret_cast(this), 1); + a_exitChoose2(); try { - #line 1858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture> __when_expr_0 = tr.get(healthyZoneKey); - #line 1861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 12342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 12347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("clearHealthyZone", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) + void a_callback_fire(ActorCallback< ClearHealthyZoneActor, 1, Void >*,Void && value) { - if (loopDepth == 0) return a_body1loopHead1(0); + fdb_probe_actor_enter("clearHealthyZone", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("clearHealthyZone", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + void a_callback_error(ActorCallback< ClearHealthyZoneActor, 1, Void >*,Error err) { + fdb_probe_actor_enter("clearHealthyZone", reinterpret_cast(this), 1); + a_exitChoose2(); try { - #line 1875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_3 = tr.onError(e); - #line 1875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 12371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 1875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("clearHealthyZone", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1loopBody1cont2(Optional const& val,int loopDepth) + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 1862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (val.present() && decodeHealthyZoneValue(val.get()).first == ignoreSSFailuresZoneString) - #line 12391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (printWarning) - #line 12395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - printf("ERROR: Maintenance mode cannot be used while data distribution is disabled for storage " "server failures. Use 'datadistribution on' to reenable data distribution.\n"); - #line 12399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(false); this->~SetHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } - #line 12403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(false); - this->~SetHealthyZoneActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_1 = tr.getReadVersion(); - #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 12413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont2(Optional && val,int loopDepth) + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 1862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (val.present() && decodeHealthyZoneValue(val.get()).first == ignoreSSFailuresZoneString) - #line 12427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (printWarning) - #line 12431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - printf("ERROR: Maintenance mode cannot be used while data distribution is disabled for storage " "server failures. Use 'datadistribution on' to reenable data distribution.\n"); - #line 12435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(false); this->~SetHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } - #line 12439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(false); - this->~SetHealthyZoneActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_1 = tr.getReadVersion(); - #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 12449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1when1(Optional const& val,int loopDepth) + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont2(val, loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1when1(Optional && val,int loopDepth) + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(val), loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SetHealthyZoneActor, 0, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ClearHealthyZoneActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< SetHealthyZoneActor, 0, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< ClearHealthyZoneActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("clearHealthyZone", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1when1(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 0); + fdb_probe_actor_exit("clearHealthyZone", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< SetHealthyZoneActor, 0, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< ClearHealthyZoneActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("clearHealthyZone", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 0); + fdb_probe_actor_exit("clearHealthyZone", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< SetHealthyZoneActor, 0, Optional >*,Error err) + void a_callback_error(ActorCallback< ClearHealthyZoneActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("clearHealthyZone", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 0); - - } - int a_body1loopBody1cont3(Version const& readVersion,int loopDepth) - { - #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.set(healthyZoneKey, healthyZoneValue(zoneId, readVersion + (seconds * CLIENT_KNOBS->CORE_VERSIONSPERSECOND))); - #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_2 = tr.commit(); - #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 12530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_exit("clearHealthyZone", reinterpret_cast(this), 2); - return loopDepth; } - int a_body1loopBody1cont3(Version && readVersion,int loopDepth) + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Database cx; + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + bool printWarning; + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + bool clearSSFailureZoneString; + #line 2155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Transaction tr; + #line 14269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +}; +// This generated class is to be used only via clearHealthyZone() + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class ClearHealthyZoneActor final : public Actor, public ActorCallback< ClearHealthyZoneActor, 0, Optional >, public ActorCallback< ClearHealthyZoneActor, 1, Void >, public ActorCallback< ClearHealthyZoneActor, 2, Void >, public FastAllocated, public ClearHealthyZoneActorState { + #line 14274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ClearHealthyZoneActor, 0, Optional >; +friend struct ActorCallback< ClearHealthyZoneActor, 1, Void >; +friend struct ActorCallback< ClearHealthyZoneActor, 2, Void >; + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ClearHealthyZoneActor(Database const& cx,bool const& printWarning,bool const& clearSSFailureZoneString) + #line 14287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + : Actor(), + ClearHealthyZoneActorState(cx, printWarning, clearSSFailureZoneString) { - #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.set(healthyZoneKey, healthyZoneValue(zoneId, readVersion + (seconds * CLIENT_KNOBS->CORE_VERSIONSPERSECOND))); - #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_2 = tr.commit(); - #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 12548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_enter("clearHealthyZone", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("clearHealthyZone"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("clearHealthyZone", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1loopBody1cont2when1(Version const& readVersion,int loopDepth) + void cancel() override { - loopDepth = a_body1loopBody1cont3(readVersion, loopDepth); + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ClearHealthyZoneActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ClearHealthyZoneActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ClearHealthyZoneActor, 2, Void >*)0, actor_cancelled()); break; + } - return loopDepth; } - int a_body1loopBody1cont2when1(Version && readVersion,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(std::move(readVersion), loopDepth); +}; +} + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future clearHealthyZone( Database const& cx, bool const& printWarning, bool const& clearSSFailureZoneString ) { + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new ClearHealthyZoneActor(cx, printWarning, clearSSFailureZoneString)); + #line 14317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +} - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SetHealthyZoneActor, 1, Version >::remove(); +#line 2180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - } - void a_callback_fire(ActorCallback< SetHealthyZoneActor, 1, Version >*,Version const& value) + #line 14322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via setHealthyZone() + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class SetHealthyZoneActorState { + #line 14329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + SetHealthyZoneActorState(Database const& cx,StringRef const& zoneId,double const& seconds,bool const& printWarning) + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + : cx(cx), + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + zoneId(zoneId), + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + seconds(seconds), + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + printWarning(printWarning), + #line 2182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr(cx) + #line 14344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 1); + fdb_probe_actor_create("setHealthyZone", reinterpret_cast(this)); } - void a_callback_fire(ActorCallback< SetHealthyZoneActor, 1, Version >*,Version && value) + ~SetHealthyZoneActorState() { - fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 1); + fdb_probe_actor_destroy("setHealthyZone", reinterpret_cast(this)); } - void a_callback_error(ActorCallback< SetHealthyZoneActor, 1, Version >*,Error err) + int a_body1(int loopDepth=0) { - fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 1); - a_exitChoose2(); try { - a_body1loopBody1Catch1(err, 0); + #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent("SetHealthyZone").detail("Zone", zoneId).detail("DurationSeconds", seconds); + #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ; + #line 14361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 1); - - } - int a_body1loopBody1cont6(Void const& _,int loopDepth) - { - #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(true); this->~SetHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } - #line 12625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(true); - this->~SetHealthyZoneActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; return loopDepth; } - int a_body1loopBody1cont6(Void && _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(true); this->~SetHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } - #line 12637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~SetHealthyZoneActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont3when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont6(_, loopDepth); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont3when1(Void && _,int loopDepth) + int a_body1loopHead1(int loopDepth) { - loopDepth = a_body1loopBody1cont6(std::move(_), loopDepth); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); return loopDepth; } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SetHealthyZoneActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< SetHealthyZoneActor, 2, Void >*,Void const& value) + int a_body1loopBody1(int loopDepth) { - fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 2); - a_exitChoose3(); try { - a_body1loopBody1cont3when1(value, 0); + #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 2187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 2188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture> __when_expr_0 = tr.get(healthyZoneKey); + #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 14400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 14405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1loopBody1Catch1(error, loopDepth); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 2); + return loopDepth; } - void a_callback_fire(ActorCallback< SetHealthyZoneActor, 2, Void >*,Void && value) + int a_body1loopBody1cont1(int loopDepth) { - fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont3when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 2); + if (loopDepth == 0) return a_body1loopHead1(0); + return loopDepth; } - void a_callback_error(ActorCallback< SetHealthyZoneActor, 2, Void >*,Error err) + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { - fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 2); - a_exitChoose3(); try { - a_body1loopBody1Catch1(err, 0); + #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_3 = tr.onError(e); + #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 14429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 14434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } - fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 2); + return loopDepth; } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1loopBody1cont2(Optional const& val,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 2190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (val.present() && decodeHealthyZoneValue(val.get()).first == ignoreSSFailuresZoneString) + #line 14449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (printWarning) + #line 14453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + printf("ERROR: Maintenance mode cannot be used while data distribution is disabled for storage " "server failures. Use 'datadistribution on' to reenable data distribution.\n"); + #line 14457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~SetHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } + #line 14461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~SetHealthyZoneActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_1 = tr.getReadVersion(); + #line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 14471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 14476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1loopBody1cont2(Optional && val,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 2190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (val.present() && decodeHealthyZoneValue(val.get()).first == ignoreSSFailuresZoneString) + #line 14485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (printWarning) + #line 14489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + printf("ERROR: Maintenance mode cannot be used while data distribution is disabled for storage " "server failures. Use 'datadistribution on' to reenable data distribution.\n"); + #line 14493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~SetHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } + #line 14497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~SetHealthyZoneActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_1 = tr.getReadVersion(); + #line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 14507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 14512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1loopBody1when1(Optional const& val,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + loopDepth = a_body1loopBody1cont2(val, loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1loopBody1when1(Optional && val,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont2(std::move(val), loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SetHealthyZoneActor, 3, Void >::remove(); + static_cast(this)->ActorCallback< SetHealthyZoneActor, 0, Optional >::remove(); } - void a_callback_fire(ActorCallback< SetHealthyZoneActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< SetHealthyZoneActor, 0, Optional >*,Optional const& value) { - fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1Catch1when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 3); + fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< SetHealthyZoneActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< SetHealthyZoneActor, 0, Optional >*,Optional && value) { - fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1Catch1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 3); + fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< SetHealthyZoneActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< SetHealthyZoneActor, 0, Optional >*,Error err) { - fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 3); + fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 0); } - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Database cx; - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StringRef zoneId; - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - double seconds; - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - bool printWarning; - #line 1854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Transaction tr; - #line 12793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -}; -// This generated class is to be used only via setHealthyZone() - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class SetHealthyZoneActor final : public Actor, public ActorCallback< SetHealthyZoneActor, 0, Optional >, public ActorCallback< SetHealthyZoneActor, 1, Version >, public ActorCallback< SetHealthyZoneActor, 2, Void >, public ActorCallback< SetHealthyZoneActor, 3, Void >, public FastAllocated, public SetHealthyZoneActorState { - #line 12798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< SetHealthyZoneActor, 0, Optional >; -friend struct ActorCallback< SetHealthyZoneActor, 1, Version >; -friend struct ActorCallback< SetHealthyZoneActor, 2, Void >; -friend struct ActorCallback< SetHealthyZoneActor, 3, Void >; - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - SetHealthyZoneActor(Database const& cx,StringRef const& zoneId,double const& seconds,bool const& printWarning) - #line 12812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - : Actor(), - SetHealthyZoneActorState(cx, zoneId, seconds, printWarning) + int a_body1loopBody1cont3(Version const& readVersion,int loopDepth) { - fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("setHealthyZone"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), -1); + #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr.set(healthyZoneKey, healthyZoneValue(zoneId, readVersion + (seconds * CLIENT_KNOBS->CORE_VERSIONSPERSECOND))); + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_2 = tr.commit(); + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 14588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 14593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + return loopDepth; } - void cancel() override + int a_body1loopBody1cont3(Version && readVersion,int loopDepth) { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< SetHealthyZoneActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< SetHealthyZoneActor, 1, Version >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< SetHealthyZoneActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< SetHealthyZoneActor, 3, Void >*)0, actor_cancelled()); break; - } + #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr.set(healthyZoneKey, healthyZoneValue(zoneId, readVersion + (seconds * CLIENT_KNOBS->CORE_VERSIONSPERSECOND))); + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_2 = tr.commit(); + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 14606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 14611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + return loopDepth; } -}; -} - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -[[nodiscard]] Future setHealthyZone( Database const& cx, StringRef const& zoneId, double const& seconds, bool const& printWarning ) { - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return Future(new SetHealthyZoneActor(cx, zoneId, seconds, printWarning)); - #line 12843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -} - -#line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + int a_body1loopBody1cont2when1(Version const& readVersion,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(readVersion, loopDepth); - #line 12848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via setDDIgnoreRebalanceSwitch() - #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -template - #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class SetDDIgnoreRebalanceSwitchActorState { - #line 12855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -public: - #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - SetDDIgnoreRebalanceSwitchActorState(Database const& cx,bool const& ignoreRebalance) - #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - : cx(cx), - #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ignoreRebalance(ignoreRebalance), - #line 1881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr(cx) - #line 12866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + return loopDepth; + } + int a_body1loopBody1cont2when1(Version && readVersion,int loopDepth) { - fdb_probe_actor_create("setDDIgnoreRebalanceSwitch", reinterpret_cast(this)); + loopDepth = a_body1loopBody1cont3(std::move(readVersion), loopDepth); + return loopDepth; } - ~SetDDIgnoreRebalanceSwitchActorState() + void a_exitChoose2() { - fdb_probe_actor_destroy("setDDIgnoreRebalanceSwitch", reinterpret_cast(this)); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SetHealthyZoneActor, 1, Version >::remove(); } - int a_body1(int loopDepth=0) + void a_callback_fire(ActorCallback< SetHealthyZoneActor, 1, Version >*,Version const& value) { + fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 1); + a_exitChoose2(); try { - #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ; - #line 12881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 1); - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~SetDDIgnoreRebalanceSwitchActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; } - int a_body1loopBody1(int loopDepth) + void a_callback_fire(ActorCallback< SetHealthyZoneActor, 1, Version >*,Version && value) { + fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 1); + a_exitChoose2(); try { - #line 1884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (ignoreRebalance) - #line 12916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 1887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.set(rebalanceDDIgnoreKey, LiteralStringRef("on")); - #line 12920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - else - { - #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.clear(rebalanceDDIgnoreKey); - #line 12926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - #line 1891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_0 = tr.commit(); - #line 1891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 12932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 1); - return loopDepth; - } - int a_body1loopBody1cont1(int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + void a_callback_error(ActorCallback< SetHealthyZoneActor, 1, Version >*,Error err) { + fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 1); + a_exitChoose2(); try { - #line 1894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_1 = tr.onError(e); - #line 1894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 12961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 1894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1loopBody1cont2(Void const& _,int loopDepth) + int a_body1loopBody1cont6(Void const& _,int loopDepth) { - #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SetDDIgnoreRebalanceSwitchActorState(); static_cast(this)->destroy(); return 0; } - #line 12981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~SetDDIgnoreRebalanceSwitchActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 2201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~SetHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } + #line 14683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~SetHealthyZoneActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1loopBody1cont2(Void && _,int loopDepth) + int a_body1loopBody1cont6(Void && _,int loopDepth) { - #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SetDDIgnoreRebalanceSwitchActorState(); static_cast(this)->destroy(); return 0; } - #line 12993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~SetDDIgnoreRebalanceSwitchActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 2201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~SetHealthyZoneActorState(); static_cast(this)->destroy(); return 0; } + #line 14695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~SetHealthyZoneActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1loopBody1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont2(_, loopDepth); + loopDepth = a_body1loopBody1cont6(_, loopDepth); return loopDepth; } - int a_body1loopBody1when1(Void && _,int loopDepth) + int a_body1loopBody1cont3when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont6(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SetDDIgnoreRebalanceSwitchActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SetHealthyZoneActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< SetDDIgnoreRebalanceSwitchActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< SetHealthyZoneActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("setDDIgnoreRebalanceSwitch", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1when1(value, 0); + a_body1loopBody1cont3when1(value, 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("setDDIgnoreRebalanceSwitch", reinterpret_cast(this), 0); + fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< SetDDIgnoreRebalanceSwitchActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< SetHealthyZoneActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("setDDIgnoreRebalanceSwitch", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1loopBody1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("setDDIgnoreRebalanceSwitch", reinterpret_cast(this), 0); + fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< SetDDIgnoreRebalanceSwitchActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< SetHealthyZoneActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("setDDIgnoreRebalanceSwitch", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1loopBody1Catch1(err, 0); } @@ -13058,7 +14760,7 @@ class SetDDIgnoreRebalanceSwitchActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("setDDIgnoreRebalanceSwitch", reinterpret_cast(this), 0); + fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 2); } int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) @@ -13085,16 +14787,16 @@ class SetDDIgnoreRebalanceSwitchActorState { return loopDepth; } - void a_exitChoose2() + void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SetDDIgnoreRebalanceSwitchActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SetHealthyZoneActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< SetDDIgnoreRebalanceSwitchActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< SetHealthyZoneActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("setDDIgnoreRebalanceSwitch", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1loopBody1Catch1when1(value, 0); } @@ -13103,13 +14805,13 @@ class SetDDIgnoreRebalanceSwitchActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("setDDIgnoreRebalanceSwitch", reinterpret_cast(this), 1); + fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< SetDDIgnoreRebalanceSwitchActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< SetHealthyZoneActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("setDDIgnoreRebalanceSwitch", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1loopBody1Catch1when1(std::move(value), 0); } @@ -13118,13 +14820,13 @@ class SetDDIgnoreRebalanceSwitchActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("setDDIgnoreRebalanceSwitch", reinterpret_cast(this), 1); + fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< SetDDIgnoreRebalanceSwitchActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< SetHealthyZoneActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("setDDIgnoreRebalanceSwitch", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -13133,43 +14835,49 @@ class SetDDIgnoreRebalanceSwitchActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("setDDIgnoreRebalanceSwitch", reinterpret_cast(this), 1); + fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), 3); } - #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - bool ignoreRebalance; - #line 1881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StringRef zoneId; + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + double seconds; + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + bool printWarning; + #line 2182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 13145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 14851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; -// This generated class is to be used only via setDDIgnoreRebalanceSwitch() - #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class SetDDIgnoreRebalanceSwitchActor final : public Actor, public ActorCallback< SetDDIgnoreRebalanceSwitchActor, 0, Void >, public ActorCallback< SetDDIgnoreRebalanceSwitchActor, 1, Void >, public FastAllocated, public SetDDIgnoreRebalanceSwitchActorState { - #line 13150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via setHealthyZone() + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class SetHealthyZoneActor final : public Actor, public ActorCallback< SetHealthyZoneActor, 0, Optional >, public ActorCallback< SetHealthyZoneActor, 1, Version >, public ActorCallback< SetHealthyZoneActor, 2, Void >, public ActorCallback< SetHealthyZoneActor, 3, Void >, public FastAllocated, public SetHealthyZoneActorState { + #line 14856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< SetDDIgnoreRebalanceSwitchActor, 0, Void >; -friend struct ActorCallback< SetDDIgnoreRebalanceSwitchActor, 1, Void >; - #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - SetDDIgnoreRebalanceSwitchActor(Database const& cx,bool const& ignoreRebalance) - #line 13162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - : Actor(), - SetDDIgnoreRebalanceSwitchActorState(cx, ignoreRebalance) +friend struct ActorCallback< SetHealthyZoneActor, 0, Optional >; +friend struct ActorCallback< SetHealthyZoneActor, 1, Version >; +friend struct ActorCallback< SetHealthyZoneActor, 2, Void >; +friend struct ActorCallback< SetHealthyZoneActor, 3, Void >; + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + SetHealthyZoneActor(Database const& cx,StringRef const& zoneId,double const& seconds,bool const& printWarning) + #line 14870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + : Actor(), + SetHealthyZoneActorState(cx, zoneId, seconds, printWarning) { - fdb_probe_actor_enter("setDDIgnoreRebalanceSwitch", reinterpret_cast(this), -1); + fdb_probe_actor_enter("setHealthyZone", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("setDDIgnoreRebalanceSwitch"); + this->lineage.setActorName("setHealthyZone"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("setDDIgnoreRebalanceSwitch", reinterpret_cast(this), -1); + fdb_probe_actor_exit("setHealthyZone", reinterpret_cast(this), -1); } void cancel() override @@ -13177,45 +14885,47 @@ friend struct ActorCallback< SetDDIgnoreRebalanceSwitchActor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< SetDDIgnoreRebalanceSwitchActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< SetDDIgnoreRebalanceSwitchActor, 1, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< SetHealthyZoneActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< SetHealthyZoneActor, 1, Version >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< SetHealthyZoneActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< SetHealthyZoneActor, 3, Void >*)0, actor_cancelled()); break; } } }; } - #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -[[nodiscard]] Future setDDIgnoreRebalanceSwitch( Database const& cx, bool const& ignoreRebalance ) { - #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return Future(new SetDDIgnoreRebalanceSwitchActor(cx, ignoreRebalance)); - #line 13191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future setHealthyZone( Database const& cx, StringRef const& zoneId, double const& seconds, bool const& printWarning ) { + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new SetHealthyZoneActor(cx, zoneId, seconds, printWarning)); + #line 14901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 13196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 14906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via setDDMode() - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class SetDDModeActorState { - #line 13203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 14913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" SetDDModeActorState(Database const& cx,int const& mode) - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" mode(mode), - #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(cx), - #line 1901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" oldMode(-1), - #line 1902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" wr(Unversioned()) - #line 13218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 14928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("setDDMode", reinterpret_cast(this)); @@ -13228,11 +14938,11 @@ class SetDDModeActorState { int a_body1(int loopDepth=0) { try { - #line 1903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" wr << mode; - #line 1905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 13235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 14945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -13261,20 +14971,20 @@ class SetDDModeActorState { int a_body1loopBody1(int loopDepth) { try { - #line 1907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = tr.get(dataDistributionModeKey); - #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 13272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 14982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 13277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 14987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13294,18 +15004,18 @@ class SetDDModeActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("SetDDModeRetrying").error(e); - #line 1939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_3 = tr.onError(e); - #line 1939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 13303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13318,51 +15028,51 @@ class SetDDModeActorState { } int a_body1loopBody1cont2(Optional const& old,int loopDepth) { - #line 1910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (oldMode < 0) - #line 13323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" oldMode = 1; - #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (old.present()) - #line 13329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" BinaryReader rd(old.get(), Unversioned()); - #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" rd >> oldMode; - #line 13335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" BinaryWriter wrMyOwner(Unversioned()); - #line 1918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" wrMyOwner << dataDistributionModeLock; - #line 1919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(moveKeysLockOwnerKey, wrMyOwner.toValue()); - #line 1920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" BinaryWriter wrLastWrite(Unversioned()); - #line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" wrLastWrite << deterministicRandom()->randomUniqueID(); - #line 1922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(moveKeysLockWriteKey, wrLastWrite.toValue()); - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(dataDistributionModeKey, wr.toValue()); - #line 1925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (mode) - #line 13354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_1 = tr.get(healthyZoneKey); - #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 13360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 13365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } else @@ -13374,51 +15084,51 @@ class SetDDModeActorState { } int a_body1loopBody1cont2(Optional && old,int loopDepth) { - #line 1910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (oldMode < 0) - #line 13379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" oldMode = 1; - #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (old.present()) - #line 13385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" BinaryReader rd(old.get(), Unversioned()); - #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" rd >> oldMode; - #line 13391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" BinaryWriter wrMyOwner(Unversioned()); - #line 1918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" wrMyOwner << dataDistributionModeLock; - #line 1919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(moveKeysLockOwnerKey, wrMyOwner.toValue()); - #line 1920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" BinaryWriter wrLastWrite(Unversioned()); - #line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" wrLastWrite << deterministicRandom()->randomUniqueID(); - #line 1922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(moveKeysLockWriteKey, wrLastWrite.toValue()); - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(dataDistributionModeKey, wr.toValue()); - #line 1925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (mode) - #line 13410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_1 = tr.get(healthyZoneKey); - #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 13416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 13421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } else @@ -13493,50 +15203,50 @@ class SetDDModeActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 1935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = tr.commit(); - #line 1935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 13500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont6(Optional const& currentHealthyZoneValue,int loopDepth) { - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (currentHealthyZoneValue.present() && decodeHealthyZoneValue(currentHealthyZoneValue.get()).first == ignoreSSFailuresZoneString) - #line 13514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(healthyZoneKey); - #line 13518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(rebalanceDDIgnoreKey); - #line 13522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } int a_body1loopBody1cont6(Optional && currentHealthyZoneValue,int loopDepth) { - #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (currentHealthyZoneValue.present() && decodeHealthyZoneValue(currentHealthyZoneValue.get()).first == ignoreSSFailuresZoneString) - #line 13531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(healthyZoneKey); - #line 13535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.clear(rebalanceDDIgnoreKey); - #line 13539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; @@ -13606,9 +15316,9 @@ class SetDDModeActorState { } int a_body1loopBody1cont9(Void const& _,int loopDepth) { - #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(oldMode); this->~SetDDModeActorState(); static_cast(this)->destroy(); return 0; } - #line 13611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(std::move(oldMode)); // state_var_RVO this->~SetDDModeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -13618,9 +15328,9 @@ class SetDDModeActorState { } int a_body1loopBody1cont9(Void && _,int loopDepth) { - #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(oldMode); this->~SetDDModeActorState(); static_cast(this)->destroy(); return 0; } - #line 13623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(std::move(oldMode)); // state_var_RVO this->~SetDDModeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -13766,22 +15476,22 @@ class SetDDModeActorState { fdb_probe_actor_exit("setDDMode", reinterpret_cast(this), 3); } - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" int mode; - #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 1901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" int oldMode; - #line 1902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" BinaryWriter wr; - #line 13779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via setDDMode() - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class SetDDModeActor final : public Actor, public ActorCallback< SetDDModeActor, 0, Optional >, public ActorCallback< SetDDModeActor, 1, Optional >, public ActorCallback< SetDDModeActor, 2, Void >, public ActorCallback< SetDDModeActor, 3, Void >, public FastAllocated, public SetDDModeActorState { - #line 13784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -13793,9 +15503,9 @@ friend struct ActorCallback< SetDDModeActor, 0, Optional >; friend struct ActorCallback< SetDDModeActor, 1, Optional >; friend struct ActorCallback< SetDDModeActor, 2, Void >; friend struct ActorCallback< SetDDModeActor, 3, Void >; - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" SetDDModeActor(Database const& cx,int const& mode) - #line 13798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), SetDDModeActorState(cx, mode) { @@ -13822,34 +15532,34 @@ friend struct ActorCallback< SetDDModeActor, 3, Void >; } }; } - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future setDDMode( Database const& cx, int const& mode ) { - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new SetDDModeActor(cx, mode)); - #line 13829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 13834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via checkForExcludingServersTxActor() - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class CheckForExcludingServersTxActorActorState { - #line 13841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" CheckForExcludingServersTxActorActorState(ReadYourWritesTransaction* const& tr,std::set* const& exclusions,std::set* const& inProgressExclusion) - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr), - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" exclusions(exclusions), - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" inProgressExclusion(inProgressExclusion) - #line 13852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("checkForExcludingServersTxActor", reinterpret_cast(this)); @@ -13862,36 +15572,36 @@ class CheckForExcludingServersTxActorActorState { int a_body1(int loopDepth=0) { try { - #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(inProgressExclusion->size() == 0); - #line 1949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!exclusions->size()) - #line 13869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~CheckForExcludingServersTxActorActorState(); static_cast(this)->destroy(); return 0; } - #line 13873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~CheckForExcludingServersTxActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 1953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = tr->getRange(serverListKeys, CLIENT_KNOBS->TOO_MANY); - #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13912,49 +15622,49 @@ class CheckForExcludingServersTxActorActorState { } int a_body1cont1(RangeResult const& serverList,int loopDepth) { - #line 1961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(!serverList.more && serverList.size() < CLIENT_KNOBS->TOO_MANY); - #line 1963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ok = true; - #line 1964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto& s : serverList ) { - #line 1965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto addresses = decodeServerListValue(s.value).getKeyValues.getEndpoint().addresses; - #line 1966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (addressExcluded(*exclusions, addresses.address)) - #line 13925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ok = false; - #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" inProgressExclusion->insert(addresses.address); - #line 13931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (addresses.secondaryAddress.present() && addressExcluded(*exclusions, addresses.secondaryAddress.get())) - #line 13935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ok = false; - #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" inProgressExclusion->insert(addresses.secondaryAddress.get()); - #line 13941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (ok) - #line 13946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture>> __when_expr_1 = tr->get(logsKey); - #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast> >*>(static_cast(this))); - #line 13957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } else @@ -13966,49 +15676,49 @@ class CheckForExcludingServersTxActorActorState { } int a_body1cont1(RangeResult && serverList,int loopDepth) { - #line 1961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(!serverList.more && serverList.size() < CLIENT_KNOBS->TOO_MANY); - #line 1963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ok = true; - #line 1964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto& s : serverList ) { - #line 1965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto addresses = decodeServerListValue(s.value).getKeyValues.getEndpoint().addresses; - #line 1966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (addressExcluded(*exclusions, addresses.address)) - #line 13979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ok = false; - #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" inProgressExclusion->insert(addresses.address); - #line 13985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 1970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (addresses.secondaryAddress.present() && addressExcluded(*exclusions, addresses.secondaryAddress.get())) - #line 13989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ok = false; - #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" inProgressExclusion->insert(addresses.secondaryAddress.get()); - #line 13995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (ok) - #line 14000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture>> __when_expr_1 = tr->get(logsKey); - #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 14006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast> >*>(static_cast(this))); - #line 14011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } else @@ -14083,9 +15793,9 @@ class CheckForExcludingServersTxActorActorState { } int a_body1cont3(int loopDepth) { - #line 1994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(ok); this->~CheckForExcludingServersTxActorActorState(); static_cast(this)->destroy(); return 0; } - #line 14088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(std::move(ok)); // state_var_RVO this->~CheckForExcludingServersTxActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -14095,34 +15805,34 @@ class CheckForExcludingServersTxActorActorState { } int a_body1cont7(Optional> const& value,int loopDepth) { - #line 1978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(value.present()); - #line 1979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto logs = decodeLogsValue(value.get()); - #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto const& log : logs.first ) { - #line 1981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (log.second == NetworkAddress() || addressExcluded(*exclusions, log.second)) - #line 14106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ok = false; - #line 1983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" inProgressExclusion->insert(log.second); - #line 14112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto const& log : logs.second ) { - #line 1987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (log.second == NetworkAddress() || addressExcluded(*exclusions, log.second)) - #line 14119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ok = false; - #line 1989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" inProgressExclusion->insert(log.second); - #line 14125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } loopDepth = a_body1cont3(loopDepth); @@ -14131,34 +15841,34 @@ class CheckForExcludingServersTxActorActorState { } int a_body1cont7(Optional> && value,int loopDepth) { - #line 1978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(value.present()); - #line 1979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto logs = decodeLogsValue(value.get()); - #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto const& log : logs.first ) { - #line 1981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (log.second == NetworkAddress() || addressExcluded(*exclusions, log.second)) - #line 14142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ok = false; - #line 1983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" inProgressExclusion->insert(log.second); - #line 14148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto const& log : logs.second ) { - #line 1987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (log.second == NetworkAddress() || addressExcluded(*exclusions, log.second)) - #line 14155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 1988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ok = false; - #line 1989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" inProgressExclusion->insert(log.second); - #line 14161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } loopDepth = a_body1cont3(loopDepth); @@ -14228,20 +15938,20 @@ class CheckForExcludingServersTxActorActorState { fdb_probe_actor_exit("checkForExcludingServersTxActor", reinterpret_cast(this), 1); } - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ReadYourWritesTransaction* tr; - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::set* exclusions; - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::set* inProgressExclusion; - #line 1963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool ok; - #line 14239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via checkForExcludingServersTxActor() - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class CheckForExcludingServersTxActorActor final : public Actor, public ActorCallback< CheckForExcludingServersTxActorActor, 0, RangeResult >, public ActorCallback< CheckForExcludingServersTxActorActor, 1, Optional> >, public FastAllocated, public CheckForExcludingServersTxActorActorState { - #line 14244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -14251,9 +15961,9 @@ class CheckForExcludingServersTxActorActor final : public Actor, public Ac #pragma clang diagnostic pop friend struct ActorCallback< CheckForExcludingServersTxActorActor, 0, RangeResult >; friend struct ActorCallback< CheckForExcludingServersTxActorActor, 1, Optional> >; - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" CheckForExcludingServersTxActorActor(ReadYourWritesTransaction* const& tr,std::set* const& exclusions,std::set* const& inProgressExclusion) - #line 14256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), CheckForExcludingServersTxActorActorState(tr, exclusions, inProgressExclusion) { @@ -14278,38 +15988,38 @@ friend struct ActorCallback< CheckForExcludingServersTxActorActor, 1, Optional checkForExcludingServersTxActor( ReadYourWritesTransaction* const& tr, std::set* const& exclusions, std::set* const& inProgressExclusion ) { - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new CheckForExcludingServersTxActorActor(tr, exclusions, inProgressExclusion)); - #line 14285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 15995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 1996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 14290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via checkForExcludingServers() - #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class CheckForExcludingServersActorState { - #line 14297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" CheckForExcludingServersActorState(Database const& cx,std::vector const& excl,bool const& waitForAllExcluded) - #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" excl(excl), - #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" waitForAllExcluded(waitForAllExcluded), - #line 2000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" exclusions(excl.begin(), excl.end()), - #line 2001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" inProgressExclusion() - #line 14312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("checkForExcludingServers", reinterpret_cast(this)); @@ -14322,9 +16032,9 @@ class CheckForExcludingServersActorState { int a_body1(int loopDepth=0) { try { - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 14327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -14345,9 +16055,9 @@ class CheckForExcludingServersActorState { } int a_body1cont1(int loopDepth) { - #line 2019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(inProgressExclusion); this->~CheckForExcludingServersActorState(); static_cast(this)->destroy(); return 0; } - #line 14350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::set >::value()) std::set(std::move(inProgressExclusion)); // state_var_RVO this->~CheckForExcludingServersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -14364,22 +16074,22 @@ class CheckForExcludingServersActorState { } int a_body1loopBody1(int loopDepth) { - #line 2004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr = ReadYourWritesTransaction(cx); - #line 2005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" inProgressExclusion.clear(); - #line 14371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" try { - #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = checkForExcludingServersTxActor(&tr, &exclusions, &inProgressExclusion); - #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 14377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 14382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -14412,18 +16122,18 @@ class CheckForExcludingServersActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("CheckForExcludingServersError").error(e); - #line 2016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = tr.onError(e); - #line 2016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 14421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 14426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -14436,68 +16146,68 @@ class CheckForExcludingServersActorState { } int a_body1loopBody1cont2(bool const& ok,int loopDepth) { - #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (ok) - #line 14441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(inProgressExclusion); this->~CheckForExcludingServersActorState(); static_cast(this)->destroy(); return 0; } - #line 14445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::set >::value()) std::set(std::move(inProgressExclusion)); // state_var_RVO this->~CheckForExcludingServersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!waitForAllExcluded) - #line 14453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = delayJittered(1.0); - #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 14461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 14466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(bool && ok,int loopDepth) { - #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (ok) - #line 14475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(inProgressExclusion); this->~CheckForExcludingServersActorState(); static_cast(this)->destroy(); return 0; } - #line 14479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::set >::value()) std::set(std::move(inProgressExclusion)); // state_var_RVO this->~CheckForExcludingServersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!waitForAllExcluded) - #line 14487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = delayJittered(1.0); - #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 14495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 14500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -14728,24 +16438,24 @@ class CheckForExcludingServersActorState { fdb_probe_actor_exit("checkForExcludingServers", reinterpret_cast(this), 2); } - #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector excl; - #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" bool waitForAllExcluded; - #line 2000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::set exclusions; - #line 2001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::set inProgressExclusion; - #line 2004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ReadYourWritesTransaction tr; - #line 14743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via checkForExcludingServers() - #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class CheckForExcludingServersActor final : public Actor>, public ActorCallback< CheckForExcludingServersActor, 0, bool >, public ActorCallback< CheckForExcludingServersActor, 1, Void >, public ActorCallback< CheckForExcludingServersActor, 2, Void >, public FastAllocated, public CheckForExcludingServersActorState { - #line 14748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -14756,9 +16466,9 @@ class CheckForExcludingServersActor final : public Actor; friend struct ActorCallback< CheckForExcludingServersActor, 1, Void >; friend struct ActorCallback< CheckForExcludingServersActor, 2, Void >; - #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" CheckForExcludingServersActor(Database const& cx,std::vector const& excl,bool const& waitForAllExcluded) - #line 14761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor>(), CheckForExcludingServersActorState(cx, excl, waitForAllExcluded) { @@ -14784,34 +16494,34 @@ friend struct ActorCallback< CheckForExcludingServersActor, 2, Void >; } }; } - #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future> checkForExcludingServers( Database const& cx, std::vector const& excl, bool const& waitForAllExcluded ) { - #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future>(new CheckForExcludingServersActor(cx, excl, waitForAllExcluded)); - #line 14791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 14796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via mgmtSnapCreate() - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class MgmtSnapCreateActorState { - #line 14803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" MgmtSnapCreateActorState(Database const& cx,Standalone const& snapCmd,UID const& snapUID) - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" snapCmd(snapCmd), - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" snapUID(snapUID) - #line 14814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("mgmtSnapCreate", reinterpret_cast(this)); @@ -14825,16 +16535,16 @@ class MgmtSnapCreateActorState { { try { try { - #line 2024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = snapCreate(cx, snapCmd, snapUID); - #line 2024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 14832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 14837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -14862,11 +16572,11 @@ class MgmtSnapCreateActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent(SevWarn, "SnapCreateFailed").error(e).detail("snapUID", snapUID); - #line 2029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 14869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -14878,11 +16588,11 @@ class MgmtSnapCreateActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 2025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("SnapCreateSucceeded").detail("snapUID", snapUID); - #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~MgmtSnapCreateActorState(); static_cast(this)->destroy(); return 0; } - #line 14885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~MgmtSnapCreateActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -14892,11 +16602,11 @@ class MgmtSnapCreateActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 2025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TraceEvent("SnapCreateSucceeded").detail("snapUID", snapUID); - #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~MgmtSnapCreateActorState(); static_cast(this)->destroy(); return 0; } - #line 14899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~MgmtSnapCreateActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -14967,18 +16677,18 @@ class MgmtSnapCreateActorState { fdb_probe_actor_exit("mgmtSnapCreate", reinterpret_cast(this), 0); } - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Standalone snapCmd; - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UID snapUID; - #line 14976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via mgmtSnapCreate() - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class MgmtSnapCreateActor final : public Actor, public ActorCallback< MgmtSnapCreateActor, 0, Void >, public FastAllocated, public MgmtSnapCreateActorState { - #line 14981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -14987,9 +16697,9 @@ class MgmtSnapCreateActor final : public Actor, public ActorCallback< Mgmt void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< MgmtSnapCreateActor, 0, Void >; - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" MgmtSnapCreateActor(Database const& cx,Standalone const& snapCmd,UID const& snapUID) - #line 14992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), MgmtSnapCreateActorState(cx, snapCmd, snapUID) { @@ -15013,32 +16723,32 @@ friend struct ActorCallback< MgmtSnapCreateActor, 0, Void >; } }; } - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future mgmtSnapCreate( Database const& cx, Standalone const& snapCmd, UID const& snapUID ) { - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new MgmtSnapCreateActor(cx, snapCmd, snapUID)); - #line 15020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 15025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via waitForFullReplication() - #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class WaitForFullReplicationActorState { - #line 15032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" WaitForFullReplicationActorState(Database const& cx) - #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(cx) - #line 15041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("waitForFullReplication", reinterpret_cast(this)); @@ -15051,9 +16761,9 @@ class WaitForFullReplicationActorState { int a_body1(int loopDepth=0) { try { - #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 15056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -15082,22 +16792,22 @@ class WaitForFullReplicationActorState { int a_body1loopBody1(int loopDepth) { try { - #line 2037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 2038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 2039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = tr.getRange(configKeys, CLIENT_KNOBS->TOO_MANY); - #line 2041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 15095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -15117,16 +16827,16 @@ class WaitForFullReplicationActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_4 = tr.onError(e); - #line 2068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 15124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 2068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -15139,60 +16849,60 @@ class WaitForFullReplicationActorState { } int a_body1loopBody1cont2(RangeResult const& confResults,int loopDepth) { - #line 2042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(!confResults.more && confResults.size() < CLIENT_KNOBS->TOO_MANY); - #line 2043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" config = DatabaseConfiguration(); - #line 2044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" config.fromKeyValues((VectorRef)confResults); - #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" replicasFutures = std::vector>>(); - #line 2047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto& region : config.regions ) { - #line 2048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" replicasFutures.push_back(tr.get(datacenterReplicasKeyFor(region.dcId))); - #line 15154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = waitForAll(replicasFutures); - #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 15160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(RangeResult && confResults,int loopDepth) { - #line 2042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(!confResults.more && confResults.size() < CLIENT_KNOBS->TOO_MANY); - #line 2043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" config = DatabaseConfiguration(); - #line 2044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" config.fromKeyValues((VectorRef)confResults); - #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" replicasFutures = std::vector>>(); - #line 2047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for( auto& region : config.regions ) { - #line 2048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" replicasFutures.push_back(tr.get(datacenterReplicasKeyFor(region.dcId))); - #line 15184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = waitForAll(replicasFutures); - #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 15190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -15262,82 +16972,82 @@ class WaitForFullReplicationActorState { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" watchFutures = std::vector>(); - #line 2053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(int i = 0;i < config.regions.size();i++) { - #line 2054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!replicasFutures[i].get().present() || decodeDatacenterReplicasValue(replicasFutures[i].get().get()) < config.storageTeamSize) - #line 15271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" watchFutures.push_back(tr.watch(datacenterReplicasKeyFor(config.regions[i].dcId))); - #line 15275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!watchFutures.size() || (config.usableRegions == 1 && watchFutures.size() < config.regions.size())) - #line 15280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitForFullReplicationActorState(); static_cast(this)->destroy(); return 0; } - #line 15284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 16994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitForFullReplicationActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = tr.commit(); - #line 2064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 15294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" watchFutures = std::vector>(); - #line 2053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(int i = 0;i < config.regions.size();i++) { - #line 2054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!replicasFutures[i].get().present() || decodeDatacenterReplicasValue(replicasFutures[i].get().get()) < config.storageTeamSize) - #line 15312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" watchFutures.push_back(tr.watch(datacenterReplicasKeyFor(config.regions[i].dcId))); - #line 15316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!watchFutures.size() || (config.usableRegions == 1 && watchFutures.size() < config.regions.size())) - #line 15321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitForFullReplicationActorState(); static_cast(this)->destroy(); return 0; } - #line 15325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitForFullReplicationActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = tr.commit(); - #line 2064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 15335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -15407,32 +17117,32 @@ class WaitForFullReplicationActorState { } int a_body1loopBody1cont5(Void const& _,int loopDepth) { - #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_3 = waitForAny(watchFutures); - #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 15414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont5(Void && _,int loopDepth) { - #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_3 = waitForAny(watchFutures); - #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 15430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -15502,18 +17212,18 @@ class WaitForFullReplicationActorState { } int a_body1loopBody1cont9(Void const& _,int loopDepth) { - #line 2066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.reset(); - #line 15507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont11(loopDepth); return loopDepth; } int a_body1loopBody1cont9(Void && _,int loopDepth) { - #line 2066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.reset(); - #line 15516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont11(loopDepth); return loopDepth; @@ -15669,22 +17379,22 @@ class WaitForFullReplicationActorState { fdb_probe_actor_exit("waitForFullReplication", reinterpret_cast(this), 4); } - #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ReadYourWritesTransaction tr; - #line 2043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" DatabaseConfiguration config; - #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector>> replicasFutures; - #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector> watchFutures; - #line 15682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via waitForFullReplication() - #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class WaitForFullReplicationActor final : public Actor, public ActorCallback< WaitForFullReplicationActor, 0, RangeResult >, public ActorCallback< WaitForFullReplicationActor, 1, Void >, public ActorCallback< WaitForFullReplicationActor, 2, Void >, public ActorCallback< WaitForFullReplicationActor, 3, Void >, public ActorCallback< WaitForFullReplicationActor, 4, Void >, public FastAllocated, public WaitForFullReplicationActorState { - #line 15687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -15697,9 +17407,9 @@ friend struct ActorCallback< WaitForFullReplicationActor, 1, Void >; friend struct ActorCallback< WaitForFullReplicationActor, 2, Void >; friend struct ActorCallback< WaitForFullReplicationActor, 3, Void >; friend struct ActorCallback< WaitForFullReplicationActor, 4, Void >; - #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" WaitForFullReplicationActor(Database const& cx) - #line 15702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), WaitForFullReplicationActorState(cx) { @@ -15727,30 +17437,30 @@ friend struct ActorCallback< WaitForFullReplicationActor, 4, Void >; } }; } - #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future waitForFullReplication( Database const& cx ) { - #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new WaitForFullReplicationActor(cx)); - #line 15734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 15739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via timeKeeperSetDisable() - #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class TimeKeeperSetDisableActorState { - #line 15746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TimeKeeperSetDisableActorState(Database const& cx) - #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx) - #line 15753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("timeKeeperSetDisable", reinterpret_cast(this)); @@ -15763,9 +17473,9 @@ class TimeKeeperSetDisableActorState { int a_body1(int loopDepth=0) { try { - #line 2074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 15768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -15793,26 +17503,26 @@ class TimeKeeperSetDisableActorState { } int a_body1loopBody1(int loopDepth) { - #line 2075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr = Transaction(cx); - #line 15798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" try { - #line 2077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.set(timeKeeperDisableKey, StringRef()); - #line 2080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = tr.commit(); - #line 2080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 15810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -15832,16 +17542,16 @@ class TimeKeeperSetDisableActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.onError(e); - #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 15839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -15854,9 +17564,9 @@ class TimeKeeperSetDisableActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 2081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TimeKeeperSetDisableActorState(); static_cast(this)->destroy(); return 0; } - #line 15859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TimeKeeperSetDisableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -15866,9 +17576,9 @@ class TimeKeeperSetDisableActorState { } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 2081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TimeKeeperSetDisableActorState(); static_cast(this)->destroy(); return 0; } - #line 15871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TimeKeeperSetDisableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16014,16 +17724,16 @@ class TimeKeeperSetDisableActorState { fdb_probe_actor_exit("timeKeeperSetDisable", reinterpret_cast(this), 1); } - #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 2075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 16021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via timeKeeperSetDisable() - #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class TimeKeeperSetDisableActor final : public Actor, public ActorCallback< TimeKeeperSetDisableActor, 0, Void >, public ActorCallback< TimeKeeperSetDisableActor, 1, Void >, public FastAllocated, public TimeKeeperSetDisableActorState { - #line 16026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -16033,9 +17743,9 @@ class TimeKeeperSetDisableActor final : public Actor, public ActorCallback #pragma clang diagnostic pop friend struct ActorCallback< TimeKeeperSetDisableActor, 0, Void >; friend struct ActorCallback< TimeKeeperSetDisableActor, 1, Void >; - #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" TimeKeeperSetDisableActor(Database const& cx) - #line 16038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), TimeKeeperSetDisableActorState(cx) { @@ -16060,32 +17770,32 @@ friend struct ActorCallback< TimeKeeperSetDisableActor, 1, Void >; } }; } - #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future timeKeeperSetDisable( Database const& cx ) { - #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new TimeKeeperSetDisableActor(cx)); - #line 16067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 16072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via lockDatabase() - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class LockDatabaseActorState { - #line 16079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" LockDatabaseActorState(Transaction* const& tr,UID const& id) - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr), - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" id(id) - #line 16088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("lockDatabase", reinterpret_cast(this)); @@ -16098,20 +17808,20 @@ class LockDatabaseActorState { int a_body1(int loopDepth=0) { try { - #line 2089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = tr->get(databaseLockedKey); - #line 2091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 16109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 16114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -16132,17 +17842,17 @@ class LockDatabaseActorState { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 2093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present()) - #line 16137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) == id) - #line 16141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~LockDatabaseActorState(); static_cast(this)->destroy(); return 0; } - #line 16145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~LockDatabaseActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16150,18 +17860,18 @@ class LockDatabaseActorState { } else { - #line 2098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(database_locked(), loopDepth); - #line 16155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 2102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr->atomicOp(databaseLockedKey, BinaryWriter::toValue(id, Unversioned()) .withPrefix(LiteralStringRef("0123456789")) .withSuffix(LiteralStringRef("\x00\x00\x00\x00")), MutationRef::SetVersionstampedValue); - #line 2107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->atomicOp(databaseLockedKey, BinaryWriter::toValue(id, Unversioned()).withPrefix("0123456789"_sr).withSuffix("\x00\x00\x00\x00"_sr), MutationRef::SetVersionstampedValue); + #line 2416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->addWriteConflictRange(normalKeys); - #line 2108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~LockDatabaseActorState(); static_cast(this)->destroy(); return 0; } - #line 16164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~LockDatabaseActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16171,17 +17881,17 @@ class LockDatabaseActorState { } int a_body1cont1(Optional && val,int loopDepth) { - #line 2093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present()) - #line 16176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) == id) - #line 16180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~LockDatabaseActorState(); static_cast(this)->destroy(); return 0; } - #line 16184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~LockDatabaseActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16189,18 +17899,18 @@ class LockDatabaseActorState { } else { - #line 2098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(database_locked(), loopDepth); - #line 16194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 2102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr->atomicOp(databaseLockedKey, BinaryWriter::toValue(id, Unversioned()) .withPrefix(LiteralStringRef("0123456789")) .withSuffix(LiteralStringRef("\x00\x00\x00\x00")), MutationRef::SetVersionstampedValue); - #line 2107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->atomicOp(databaseLockedKey, BinaryWriter::toValue(id, Unversioned()).withPrefix("0123456789"_sr).withSuffix("\x00\x00\x00\x00"_sr), MutationRef::SetVersionstampedValue); + #line 2416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->addWriteConflictRange(normalKeys); - #line 2108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~LockDatabaseActorState(); static_cast(this)->destroy(); return 0; } - #line 16203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~LockDatabaseActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16271,16 +17981,16 @@ class LockDatabaseActorState { fdb_probe_actor_exit("lockDatabase", reinterpret_cast(this), 0); } - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UID id; - #line 16278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via lockDatabase() - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class LockDatabaseActor final : public Actor, public ActorCallback< LockDatabaseActor, 0, Optional >, public FastAllocated, public LockDatabaseActorState { - #line 16283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 17993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -16289,9 +17999,9 @@ class LockDatabaseActor final : public Actor, public ActorCallback< LockDa void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< LockDatabaseActor, 0, Optional >; - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" LockDatabaseActor(Transaction* const& tr,UID const& id) - #line 16294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), LockDatabaseActorState(tr, id) { @@ -16315,32 +18025,32 @@ friend struct ActorCallback< LockDatabaseActor, 0, Optional >; } }; } - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future lockDatabase( Transaction* const& tr, UID const& id ) { - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new LockDatabaseActor(tr, id)); - #line 16322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 16327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via lockDatabase() - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class LockDatabaseActor1State { - #line 16334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" LockDatabaseActor1State(Reference const& tr,UID const& id) - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr), - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" id(id) - #line 16343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("lockDatabase", reinterpret_cast(this)); @@ -16353,20 +18063,20 @@ class LockDatabaseActor1State { int a_body1(int loopDepth=0) { try { - #line 2112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = tr->get(databaseLockedKey); - #line 2114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 16364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 16369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -16387,17 +18097,17 @@ class LockDatabaseActor1State { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present()) - #line 16392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) == id) - #line 16396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~LockDatabaseActor1State(); static_cast(this)->destroy(); return 0; } - #line 16400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~LockDatabaseActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16405,18 +18115,18 @@ class LockDatabaseActor1State { } else { - #line 2121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(database_locked(), loopDepth); - #line 16410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 2125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr->atomicOp(databaseLockedKey, BinaryWriter::toValue(id, Unversioned()) .withPrefix(LiteralStringRef("0123456789")) .withSuffix(LiteralStringRef("\x00\x00\x00\x00")), MutationRef::SetVersionstampedValue); - #line 2130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->atomicOp(databaseLockedKey, BinaryWriter::toValue(id, Unversioned()).withPrefix("0123456789"_sr).withSuffix("\x00\x00\x00\x00"_sr), MutationRef::SetVersionstampedValue); + #line 2437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->addWriteConflictRange(normalKeys); - #line 2131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~LockDatabaseActor1State(); static_cast(this)->destroy(); return 0; } - #line 16419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~LockDatabaseActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16426,17 +18136,17 @@ class LockDatabaseActor1State { } int a_body1cont1(Optional && val,int loopDepth) { - #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present()) - #line 16431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) == id) - #line 16435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~LockDatabaseActor1State(); static_cast(this)->destroy(); return 0; } - #line 16439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~LockDatabaseActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16444,18 +18154,18 @@ class LockDatabaseActor1State { } else { - #line 2121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(database_locked(), loopDepth); - #line 16449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 2125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr->atomicOp(databaseLockedKey, BinaryWriter::toValue(id, Unversioned()) .withPrefix(LiteralStringRef("0123456789")) .withSuffix(LiteralStringRef("\x00\x00\x00\x00")), MutationRef::SetVersionstampedValue); - #line 2130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->atomicOp(databaseLockedKey, BinaryWriter::toValue(id, Unversioned()).withPrefix("0123456789"_sr).withSuffix("\x00\x00\x00\x00"_sr), MutationRef::SetVersionstampedValue); + #line 2437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->addWriteConflictRange(normalKeys); - #line 2131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~LockDatabaseActor1State(); static_cast(this)->destroy(); return 0; } - #line 16458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~LockDatabaseActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16526,16 +18236,16 @@ class LockDatabaseActor1State { fdb_probe_actor_exit("lockDatabase", reinterpret_cast(this), 0); } - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Reference tr; - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UID id; - #line 16533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via lockDatabase() - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class LockDatabaseActor1 final : public Actor, public ActorCallback< LockDatabaseActor1, 0, Optional >, public FastAllocated, public LockDatabaseActor1State { - #line 16538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -16544,9 +18254,9 @@ class LockDatabaseActor1 final : public Actor, public ActorCallback< LockD void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< LockDatabaseActor1, 0, Optional >; - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" LockDatabaseActor1(Reference const& tr,UID const& id) - #line 16549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), LockDatabaseActor1State(tr, id) { @@ -16570,34 +18280,34 @@ friend struct ActorCallback< LockDatabaseActor1, 0, Optional >; } }; } - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future lockDatabase( Reference const& tr, UID const& id ) { - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new LockDatabaseActor1(tr, id)); - #line 16577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 16582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via lockDatabase() - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class LockDatabaseActor2State { - #line 16589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" LockDatabaseActor2State(Database const& cx,UID const& id) - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" id(id), - #line 2135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(cx) - #line 16600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("lockDatabase", reinterpret_cast(this)); @@ -16610,9 +18320,15 @@ class LockDatabaseActor2State { int a_body1(int loopDepth=0) { try { - #line 2136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + UID debugID = deterministicRandom()->randomUniqueID(); + #line 2444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent("LockDatabaseTransaction", debugID).log(); + #line 2445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr.debugTransaction(debugID); + #line 2446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 16615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -16641,16 +18357,16 @@ class LockDatabaseActor2State { int a_body1loopBody1(int loopDepth) { try { - #line 2138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = lockDatabase(&tr, id); - #line 2138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 16648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 16653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -16670,24 +18386,24 @@ class LockDatabaseActor2State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (e.code() == error_code_database_locked) - #line 16675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 16679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = tr.onError(e); - #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 16685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 16690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -16700,32 +18416,32 @@ class LockDatabaseActor2State { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.commit(); - #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 16707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 16712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.commit(); - #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 16723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 16728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -16795,9 +18511,9 @@ class LockDatabaseActor2State { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~LockDatabaseActor2State(); static_cast(this)->destroy(); return 0; } - #line 16800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~LockDatabaseActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16807,9 +18523,9 @@ class LockDatabaseActor2State { } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~LockDatabaseActor2State(); static_cast(this)->destroy(); return 0; } - #line 16812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~LockDatabaseActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16955,18 +18671,18 @@ class LockDatabaseActor2State { fdb_probe_actor_exit("lockDatabase", reinterpret_cast(this), 2); } - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UID id; - #line 2135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 16964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via lockDatabase() - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class LockDatabaseActor2 final : public Actor, public ActorCallback< LockDatabaseActor2, 0, Void >, public ActorCallback< LockDatabaseActor2, 1, Void >, public ActorCallback< LockDatabaseActor2, 2, Void >, public FastAllocated, public LockDatabaseActor2State { - #line 16969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -16977,9 +18693,9 @@ class LockDatabaseActor2 final : public Actor, public ActorCallback< LockD friend struct ActorCallback< LockDatabaseActor2, 0, Void >; friend struct ActorCallback< LockDatabaseActor2, 1, Void >; friend struct ActorCallback< LockDatabaseActor2, 2, Void >; - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" LockDatabaseActor2(Database const& cx,UID const& id) - #line 16982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), LockDatabaseActor2State(cx, id) { @@ -17005,32 +18721,32 @@ friend struct ActorCallback< LockDatabaseActor2, 2, Void >; } }; } - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future lockDatabase( Database const& cx, UID const& id ) { - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new LockDatabaseActor2(cx, id)); - #line 17012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 17017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via unlockDatabase() - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class UnlockDatabaseActorState { - #line 17024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UnlockDatabaseActorState(Transaction* const& tr,UID const& id) - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr), - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" id(id) - #line 17033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("unlockDatabase", reinterpret_cast(this)); @@ -17043,20 +18759,20 @@ class UnlockDatabaseActorState { int a_body1(int loopDepth=0) { try { - #line 2150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = tr->get(databaseLockedKey); - #line 2152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 17059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -17077,31 +18793,31 @@ class UnlockDatabaseActorState { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!val.present()) - #line 17082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UnlockDatabaseActorState(); static_cast(this)->destroy(); return 0; } - #line 17086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~UnlockDatabaseActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present() && BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) != id) - #line 17094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(database_locked(), loopDepth); - #line 17098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->clear(singleKeyRange(databaseLockedKey)); - #line 2163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UnlockDatabaseActorState(); static_cast(this)->destroy(); return 0; } - #line 17104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~UnlockDatabaseActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -17111,31 +18827,31 @@ class UnlockDatabaseActorState { } int a_body1cont1(Optional && val,int loopDepth) { - #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!val.present()) - #line 17116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UnlockDatabaseActorState(); static_cast(this)->destroy(); return 0; } - #line 17120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~UnlockDatabaseActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present() && BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) != id) - #line 17128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(database_locked(), loopDepth); - #line 17132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->clear(singleKeyRange(databaseLockedKey)); - #line 2163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UnlockDatabaseActorState(); static_cast(this)->destroy(); return 0; } - #line 17138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~UnlockDatabaseActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -17206,16 +18922,16 @@ class UnlockDatabaseActorState { fdb_probe_actor_exit("unlockDatabase", reinterpret_cast(this), 0); } - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UID id; - #line 17213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via unlockDatabase() - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class UnlockDatabaseActor final : public Actor, public ActorCallback< UnlockDatabaseActor, 0, Optional >, public FastAllocated, public UnlockDatabaseActorState { - #line 17218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -17224,9 +18940,9 @@ class UnlockDatabaseActor final : public Actor, public ActorCallback< Unlo void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< UnlockDatabaseActor, 0, Optional >; - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UnlockDatabaseActor(Transaction* const& tr,UID const& id) - #line 17229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), UnlockDatabaseActorState(tr, id) { @@ -17250,32 +18966,32 @@ friend struct ActorCallback< UnlockDatabaseActor, 0, Optional >; } }; } - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future unlockDatabase( Transaction* const& tr, UID const& id ) { - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new UnlockDatabaseActor(tr, id)); - #line 17257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 17262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via unlockDatabase() - #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class UnlockDatabaseActor1State { - #line 17269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UnlockDatabaseActor1State(Reference const& tr,UID const& id) - #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr), - #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" id(id) - #line 17278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 18994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("unlockDatabase", reinterpret_cast(this)); @@ -17288,20 +19004,20 @@ class UnlockDatabaseActor1State { int a_body1(int loopDepth=0) { try { - #line 2167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = tr->get(databaseLockedKey); - #line 2169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 17304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -17322,31 +19038,31 @@ class UnlockDatabaseActor1State { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 2171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!val.present()) - #line 17327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UnlockDatabaseActor1State(); static_cast(this)->destroy(); return 0; } - #line 17331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~UnlockDatabaseActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present() && BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) != id) - #line 17339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(database_locked(), loopDepth); - #line 17343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 2179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->clear(singleKeyRange(databaseLockedKey)); - #line 2180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UnlockDatabaseActor1State(); static_cast(this)->destroy(); return 0; } - #line 17349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~UnlockDatabaseActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -17356,31 +19072,31 @@ class UnlockDatabaseActor1State { } int a_body1cont1(Optional && val,int loopDepth) { - #line 2171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!val.present()) - #line 17361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UnlockDatabaseActor1State(); static_cast(this)->destroy(); return 0; } - #line 17365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~UnlockDatabaseActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present() && BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) != id) - #line 17373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(database_locked(), loopDepth); - #line 17377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 2179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->clear(singleKeyRange(databaseLockedKey)); - #line 2180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UnlockDatabaseActor1State(); static_cast(this)->destroy(); return 0; } - #line 17383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~UnlockDatabaseActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -17451,16 +19167,16 @@ class UnlockDatabaseActor1State { fdb_probe_actor_exit("unlockDatabase", reinterpret_cast(this), 0); } - #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Reference tr; - #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UID id; - #line 17458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via unlockDatabase() - #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class UnlockDatabaseActor1 final : public Actor, public ActorCallback< UnlockDatabaseActor1, 0, Optional >, public FastAllocated, public UnlockDatabaseActor1State { - #line 17463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -17469,9 +19185,9 @@ class UnlockDatabaseActor1 final : public Actor, public ActorCallback< Unl void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< UnlockDatabaseActor1, 0, Optional >; - #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UnlockDatabaseActor1(Reference const& tr,UID const& id) - #line 17474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), UnlockDatabaseActor1State(tr, id) { @@ -17495,34 +19211,34 @@ friend struct ActorCallback< UnlockDatabaseActor1, 0, Optional >; } }; } - #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future unlockDatabase( Reference const& tr, UID const& id ) { - #line 2166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new UnlockDatabaseActor1(tr, id)); - #line 17502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 17507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via unlockDatabase() - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class UnlockDatabaseActor2State { - #line 17514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UnlockDatabaseActor2State(Database const& cx,UID const& id) - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" id(id), - #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(cx) - #line 17525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("unlockDatabase", reinterpret_cast(this)); @@ -17535,9 +19251,9 @@ class UnlockDatabaseActor2State { int a_body1(int loopDepth=0) { try { - #line 2185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 17540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -17566,16 +19282,16 @@ class UnlockDatabaseActor2State { int a_body1loopBody1(int loopDepth) { try { - #line 2187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = unlockDatabase(&tr, id); - #line 2187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 17573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 17578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -17595,24 +19311,24 @@ class UnlockDatabaseActor2State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (e.code() == error_code_database_locked) - #line 17600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 17604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 2193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = tr.onError(e); - #line 2193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 17610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 17615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -17625,32 +19341,32 @@ class UnlockDatabaseActor2State { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 2188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.commit(); - #line 2188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 17632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 17637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 2188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.commit(); - #line 2188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 17648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 17653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -17720,9 +19436,9 @@ class UnlockDatabaseActor2State { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UnlockDatabaseActor2State(); static_cast(this)->destroy(); return 0; } - #line 17725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~UnlockDatabaseActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -17732,9 +19448,9 @@ class UnlockDatabaseActor2State { } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UnlockDatabaseActor2State(); static_cast(this)->destroy(); return 0; } - #line 17737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~UnlockDatabaseActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -17880,18 +19596,18 @@ class UnlockDatabaseActor2State { fdb_probe_actor_exit("unlockDatabase", reinterpret_cast(this), 2); } - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UID id; - #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction tr; - #line 17889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via unlockDatabase() - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class UnlockDatabaseActor2 final : public Actor, public ActorCallback< UnlockDatabaseActor2, 0, Void >, public ActorCallback< UnlockDatabaseActor2, 1, Void >, public ActorCallback< UnlockDatabaseActor2, 2, Void >, public FastAllocated, public UnlockDatabaseActor2State { - #line 17894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -17902,9 +19618,9 @@ class UnlockDatabaseActor2 final : public Actor, public ActorCallback< Unl friend struct ActorCallback< UnlockDatabaseActor2, 0, Void >; friend struct ActorCallback< UnlockDatabaseActor2, 1, Void >; friend struct ActorCallback< UnlockDatabaseActor2, 2, Void >; - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UnlockDatabaseActor2(Database const& cx,UID const& id) - #line 17907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), UnlockDatabaseActor2State(cx, id) { @@ -17930,32 +19646,32 @@ friend struct ActorCallback< UnlockDatabaseActor2, 2, Void >; } }; } - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future unlockDatabase( Database const& cx, UID const& id ) { - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new UnlockDatabaseActor2(cx, id)); - #line 17937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 17942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via checkDatabaseLock() - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class CheckDatabaseLockActorState { - #line 17949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" CheckDatabaseLockActorState(Transaction* const& tr,UID const& id) - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr), - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" id(id) - #line 17958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("checkDatabaseLock", reinterpret_cast(this)); @@ -17968,20 +19684,20 @@ class CheckDatabaseLockActorState { int a_body1(int loopDepth=0) { try { - #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = tr->get(databaseLockedKey); - #line 2201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 17984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -18002,17 +19718,17 @@ class CheckDatabaseLockActorState { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present() && BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) != id) - #line 18007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(database_locked(), loopDepth); - #line 18011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckDatabaseLockActorState(); static_cast(this)->destroy(); return 0; } - #line 18015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CheckDatabaseLockActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -18022,17 +19738,17 @@ class CheckDatabaseLockActorState { } int a_body1cont1(Optional && val,int loopDepth) { - #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present() && BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) != id) - #line 18027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(database_locked(), loopDepth); - #line 18031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckDatabaseLockActorState(); static_cast(this)->destroy(); return 0; } - #line 18035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CheckDatabaseLockActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -18103,16 +19819,16 @@ class CheckDatabaseLockActorState { fdb_probe_actor_exit("checkDatabaseLock", reinterpret_cast(this), 0); } - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Transaction* tr; - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UID id; - #line 18110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via checkDatabaseLock() - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class CheckDatabaseLockActor final : public Actor, public ActorCallback< CheckDatabaseLockActor, 0, Optional >, public FastAllocated, public CheckDatabaseLockActorState { - #line 18115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -18121,9 +19837,9 @@ class CheckDatabaseLockActor final : public Actor, public ActorCallback< C void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< CheckDatabaseLockActor, 0, Optional >; - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" CheckDatabaseLockActor(Transaction* const& tr,UID const& id) - #line 18126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), CheckDatabaseLockActorState(tr, id) { @@ -18147,32 +19863,32 @@ friend struct ActorCallback< CheckDatabaseLockActor, 0, Optional >; } }; } - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future checkDatabaseLock( Transaction* const& tr, UID const& id ) { - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new CheckDatabaseLockActor(tr, id)); - #line 18154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 18159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via checkDatabaseLock() - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class CheckDatabaseLockActor1State { - #line 18166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" CheckDatabaseLockActor1State(Reference const& tr,UID const& id) - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr), - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" id(id) - #line 18175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("checkDatabaseLock", reinterpret_cast(this)); @@ -18185,20 +19901,20 @@ class CheckDatabaseLockActor1State { int a_body1(int loopDepth=0) { try { - #line 2212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = tr->get(databaseLockedKey); - #line 2214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 18201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 19917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -18219,40 +19935,389 @@ class CheckDatabaseLockActor1State { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 2216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (val.present() && BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) != id) - #line 18224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (val.present() && BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) != id) + #line 19940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return a_body1Catch1(database_locked(), loopDepth); + #line 19944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckDatabaseLockActor1State(); static_cast(this)->destroy(); return 0; } + #line 19948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CheckDatabaseLockActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Optional && val,int loopDepth) + { + #line 2526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (val.present() && BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) != id) + #line 19960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return a_body1Catch1(database_locked(), loopDepth); + #line 19964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckDatabaseLockActor1State(); static_cast(this)->destroy(); return 0; } + #line 19968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CheckDatabaseLockActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Optional const& val,int loopDepth) + { + loopDepth = a_body1cont1(val, loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && val,int loopDepth) + { + loopDepth = a_body1cont1(std::move(val), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckDatabaseLockActor1, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< CheckDatabaseLockActor1, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("checkDatabaseLock", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkDatabaseLock", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CheckDatabaseLockActor1, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("checkDatabaseLock", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkDatabaseLock", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CheckDatabaseLockActor1, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("checkDatabaseLock", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkDatabaseLock", reinterpret_cast(this), 0); + + } + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Reference tr; + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + UID id; + #line 20043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +}; +// This generated class is to be used only via checkDatabaseLock() + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class CheckDatabaseLockActor1 final : public Actor, public ActorCallback< CheckDatabaseLockActor1, 0, Optional >, public FastAllocated, public CheckDatabaseLockActor1State { + #line 20048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CheckDatabaseLockActor1, 0, Optional >; + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + CheckDatabaseLockActor1(Reference const& tr,UID const& id) + #line 20059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + : Actor(), + CheckDatabaseLockActor1State(tr, id) + { + fdb_probe_actor_enter("checkDatabaseLock", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("checkDatabaseLock"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("checkDatabaseLock", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CheckDatabaseLockActor1, 0, Optional >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future checkDatabaseLock( Reference const& tr, UID const& id ) { + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new CheckDatabaseLockActor1(tr, id)); + #line 20087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +} + +#line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + + #line 20092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via updateChangeFeed() + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class UpdateChangeFeedActorState { + #line 20099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + UpdateChangeFeedActorState(Transaction* const& tr,Key const& rangeID,ChangeFeedStatus const& status,KeyRange const& range) + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + : tr(tr), + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + rangeID(rangeID), + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + status(status), + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + range(range), + #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + rangeIDKey(rangeID.withPrefix(changeFeedPrefix)) + #line 20114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + fdb_probe_actor_create("updateChangeFeed", reinterpret_cast(this)); + + } + ~UpdateChangeFeedActorState() + { + fdb_probe_actor_destroy("updateChangeFeed", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 2538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture> __when_expr_0 = tr->get(rangeIDKey); + #line 2538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 20133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 2538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 20138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~UpdateChangeFeedActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional const& val,int loopDepth) + { + #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (status == ChangeFeedStatus::CHANGE_FEED_CREATE) + #line 20161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return a_body1Catch1(database_locked(), loopDepth); - #line 18228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!val.present()) + #line 20165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->set(rangeIDKey, changeFeedValue(range, invalidVersion, status)); + #line 20169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + else + { + #line 2542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (std::get<0>(decodeChangeFeedValue(val.get())) != range) + #line 20175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return a_body1Catch1(unsupported_operation(), loopDepth); + #line 20179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + } } - #line 2221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckDatabaseLockActor1State(); static_cast(this)->destroy(); return 0; } - #line 18232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~CheckDatabaseLockActor1State(); - static_cast(this)->finishSendAndDelPromiseRef(); + else + { + #line 2545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (status == ChangeFeedStatus::CHANGE_FEED_STOP) + #line 20187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (val.present()) + #line 20191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->set(rangeIDKey, changeFeedValue(std::get<0>(decodeChangeFeedValue(val.get())), std::get<1>(decodeChangeFeedValue(val.get())), status)); + #line 20195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + else + { + #line 2552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return a_body1Catch1(unsupported_operation(), loopDepth); + #line 20201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + } + else + { + #line 2554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (status == ChangeFeedStatus::CHANGE_FEED_DESTROY) + #line 20208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (val.present()) + #line 20212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (g_network->isSimulated()) + #line 20216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + g_simulator->validationData.allDestroyedChangeFeedIDs.insert(rangeID.toString()); + #line 20220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->set(rangeIDKey, changeFeedValue(std::get<0>(decodeChangeFeedValue(val.get())), std::get<1>(decodeChangeFeedValue(val.get())), status)); + #line 2563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->clear(rangeIDKey); + #line 20226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + } + } + } + #line 2566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateChangeFeedActorState(); static_cast(this)->destroy(); return 0; } + #line 20233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~UpdateChangeFeedActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont1(Optional && val,int loopDepth) { - #line 2216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (val.present() && BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) != id) - #line 18244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (status == ChangeFeedStatus::CHANGE_FEED_CREATE) + #line 20245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return a_body1Catch1(database_locked(), loopDepth); - #line 18248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!val.present()) + #line 20249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->set(rangeIDKey, changeFeedValue(range, invalidVersion, status)); + #line 20253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + else + { + #line 2542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (std::get<0>(decodeChangeFeedValue(val.get())) != range) + #line 20259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return a_body1Catch1(unsupported_operation(), loopDepth); + #line 20263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + } } - #line 2221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckDatabaseLockActor1State(); static_cast(this)->destroy(); return 0; } - #line 18252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~CheckDatabaseLockActor1State(); - static_cast(this)->finishSendAndDelPromiseRef(); + else + { + #line 2545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (status == ChangeFeedStatus::CHANGE_FEED_STOP) + #line 20271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (val.present()) + #line 20275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->set(rangeIDKey, changeFeedValue(std::get<0>(decodeChangeFeedValue(val.get())), std::get<1>(decodeChangeFeedValue(val.get())), status)); + #line 20279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + else + { + #line 2552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return a_body1Catch1(unsupported_operation(), loopDepth); + #line 20285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + } + else + { + #line 2554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (status == ChangeFeedStatus::CHANGE_FEED_DESTROY) + #line 20292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (val.present()) + #line 20296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (g_network->isSimulated()) + #line 20300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + g_simulator->validationData.allDestroyedChangeFeedIDs.insert(rangeID.toString()); + #line 20304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->set(rangeIDKey, changeFeedValue(std::get<0>(decodeChangeFeedValue(val.get())), std::get<1>(decodeChangeFeedValue(val.get())), status)); + #line 2563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr->clear(rangeIDKey); + #line 20310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + } + } + } + #line 2566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateChangeFeedActorState(); static_cast(this)->destroy(); return 0; } + #line 20317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~UpdateChangeFeedActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -18271,13 +20336,13 @@ class CheckDatabaseLockActor1State { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CheckDatabaseLockActor1, 0, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< UpdateChangeFeedActor, 0, Optional >::remove(); } - void a_callback_fire(ActorCallback< CheckDatabaseLockActor1, 0, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< UpdateChangeFeedActor, 0, Optional >*,Optional const& value) { - fdb_probe_actor_enter("checkDatabaseLock", reinterpret_cast(this), 0); + fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -18287,12 +20352,12 @@ class CheckDatabaseLockActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("checkDatabaseLock", reinterpret_cast(this), 0); + fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< CheckDatabaseLockActor1, 0, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< UpdateChangeFeedActor, 0, Optional >*,Optional && value) { - fdb_probe_actor_enter("checkDatabaseLock", reinterpret_cast(this), 0); + fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -18302,12 +20367,12 @@ class CheckDatabaseLockActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("checkDatabaseLock", reinterpret_cast(this), 0); + fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< CheckDatabaseLockActor1, 0, Optional >*,Error err) + void a_callback_error(ActorCallback< UpdateChangeFeedActor, 0, Optional >*,Error err) { - fdb_probe_actor_enter("checkDatabaseLock", reinterpret_cast(this), 0); + fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -18317,40 +20382,46 @@ class CheckDatabaseLockActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("checkDatabaseLock", reinterpret_cast(this), 0); + fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); } - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Reference tr; - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - UID id; - #line 18327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Transaction* tr; + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Key rangeID; + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ChangeFeedStatus status; + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + KeyRange range; + #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Key rangeIDKey; + #line 20398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; -// This generated class is to be used only via checkDatabaseLock() - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class CheckDatabaseLockActor1 final : public Actor, public ActorCallback< CheckDatabaseLockActor1, 0, Optional >, public FastAllocated, public CheckDatabaseLockActor1State { - #line 18332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via updateChangeFeed() + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class UpdateChangeFeedActor final : public Actor, public ActorCallback< UpdateChangeFeedActor, 0, Optional >, public FastAllocated, public UpdateChangeFeedActorState { + #line 20403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< CheckDatabaseLockActor1, 0, Optional >; - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - CheckDatabaseLockActor1(Reference const& tr,UID const& id) - #line 18343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +friend struct ActorCallback< UpdateChangeFeedActor, 0, Optional >; + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + UpdateChangeFeedActor(Transaction* const& tr,Key const& rangeID,ChangeFeedStatus const& status,KeyRange const& range) + #line 20414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), - CheckDatabaseLockActor1State(tr, id) + UpdateChangeFeedActorState(tr, rangeID, status, range) { - fdb_probe_actor_enter("checkDatabaseLock", reinterpret_cast(this), -1); + fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("checkDatabaseLock"); + this->lineage.setActorName("updateChangeFeed"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("checkDatabaseLock", reinterpret_cast(this), -1); + fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), -1); } void cancel() override @@ -18358,49 +20429,49 @@ friend struct ActorCallback< CheckDatabaseLockActor1, 0, Optional >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< CheckDatabaseLockActor1, 0, Optional >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< UpdateChangeFeedActor, 0, Optional >*)0, actor_cancelled()); break; } } }; } - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -[[nodiscard]] Future checkDatabaseLock( Reference const& tr, UID const& id ) { - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return Future(new CheckDatabaseLockActor1(tr, id)); - #line 18371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future updateChangeFeed( Transaction* const& tr, Key const& rangeID, ChangeFeedStatus const& status, KeyRange const& range ) { + #line 2534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new UpdateChangeFeedActor(tr, rangeID, status, range)); + #line 20442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 18376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via updateChangeFeed() - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -template - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class UpdateChangeFeedActorState { - #line 18383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class UpdateChangeFeedActor1State { + #line 20454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - UpdateChangeFeedActorState(Transaction* const& tr,Key const& rangeID,ChangeFeedStatus const& status,KeyRange const& range) - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + UpdateChangeFeedActor1State(Reference const& tr,Key const& rangeID,ChangeFeedStatus const& status,KeyRange const& range) + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : tr(tr), - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" rangeID(rangeID), - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" status(status), - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" range(range), - #line 2225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" rangeIDKey(rangeID.withPrefix(changeFeedPrefix)) - #line 18398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("updateChangeFeed", reinterpret_cast(this)); } - ~UpdateChangeFeedActorState() + ~UpdateChangeFeedActor1State() { fdb_probe_actor_destroy("updateChangeFeed", reinterpret_cast(this)); @@ -18408,18 +20479,18 @@ class UpdateChangeFeedActorState { int a_body1(int loopDepth=0) { try { - #line 2226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = tr->get(rangeIDKey); - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 20488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 18422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 2576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 20493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -18432,172 +20503,176 @@ class UpdateChangeFeedActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~UpdateChangeFeedActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~UpdateChangeFeedActor1State(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(Optional const& val,int loopDepth) { - #line 2229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (status == ChangeFeedStatus::CHANGE_FEED_CREATE) - #line 18445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!val.present()) - #line 18449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(rangeIDKey, changeFeedValue(range, invalidVersion, status)); - #line 18453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 2232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (std::get<0>(decodeChangeFeedValue(val.get())) != range) - #line 18459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(unsupported_operation(), loopDepth); - #line 18463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } } else { - #line 2235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (status == ChangeFeedStatus::CHANGE_FEED_STOP) - #line 18471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present()) - #line 18475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(rangeIDKey, changeFeedValue(std::get<0>(decodeChangeFeedValue(val.get())), std::get<1>(decodeChangeFeedValue(val.get())), status)); - #line 18479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(unsupported_operation(), loopDepth); - #line 18485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } else { - #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (status == ChangeFeedStatus::CHANGE_FEED_DESTROY) - #line 18492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present()) - #line 18496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (g_network->isSimulated()) + #line 20571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + g_simulator->validationData.allDestroyedChangeFeedIDs.insert(rangeID.toString()); + #line 20575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 2597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(rangeIDKey, changeFeedValue(std::get<0>(decodeChangeFeedValue(val.get())), std::get<1>(decodeChangeFeedValue(val.get())), status)); - #line 2250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->clear(rangeIDKey); - #line 18502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - else - { - #line 2252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return a_body1Catch1(unsupported_operation(), loopDepth); - #line 18508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } } } - #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateChangeFeedActorState(); static_cast(this)->destroy(); return 0; } - #line 18515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~UpdateChangeFeedActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 2604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateChangeFeedActor1State(); static_cast(this)->destroy(); return 0; } + #line 20588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~UpdateChangeFeedActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont1(Optional && val,int loopDepth) { - #line 2229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (status == ChangeFeedStatus::CHANGE_FEED_CREATE) - #line 18527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!val.present()) - #line 18531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(rangeIDKey, changeFeedValue(range, invalidVersion, status)); - #line 18535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 2232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (std::get<0>(decodeChangeFeedValue(val.get())) != range) - #line 18541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(unsupported_operation(), loopDepth); - #line 18545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } } else { - #line 2235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (status == ChangeFeedStatus::CHANGE_FEED_STOP) - #line 18553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present()) - #line 18557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(rangeIDKey, changeFeedValue(std::get<0>(decodeChangeFeedValue(val.get())), std::get<1>(decodeChangeFeedValue(val.get())), status)); - #line 18561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } else { - #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return a_body1Catch1(unsupported_operation(), loopDepth); - #line 18567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } else { - #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (status == ChangeFeedStatus::CHANGE_FEED_DESTROY) - #line 18574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (val.present()) - #line 18578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (g_network->isSimulated()) + #line 20655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + g_simulator->validationData.allDestroyedChangeFeedIDs.insert(rangeID.toString()); + #line 20659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + } + #line 2597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->set(rangeIDKey, changeFeedValue(std::get<0>(decodeChangeFeedValue(val.get())), std::get<1>(decodeChangeFeedValue(val.get())), status)); - #line 2250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr->clear(rangeIDKey); - #line 18584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - else - { - #line 2252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return a_body1Catch1(unsupported_operation(), loopDepth); - #line 18590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } } } - #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateChangeFeedActorState(); static_cast(this)->destroy(); return 0; } - #line 18597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~UpdateChangeFeedActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 2604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateChangeFeedActor1State(); static_cast(this)->destroy(); return 0; } + #line 20672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~UpdateChangeFeedActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -18616,11 +20691,11 @@ class UpdateChangeFeedActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< UpdateChangeFeedActor, 0, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< UpdateChangeFeedActor1, 0, Optional >::remove(); } - void a_callback_fire(ActorCallback< UpdateChangeFeedActor, 0, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< UpdateChangeFeedActor1, 0, Optional >*,Optional const& value) { fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); a_exitChoose1(); @@ -18635,7 +20710,7 @@ class UpdateChangeFeedActorState { fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< UpdateChangeFeedActor, 0, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< UpdateChangeFeedActor1, 0, Optional >*,Optional && value) { fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); a_exitChoose1(); @@ -18650,7 +20725,7 @@ class UpdateChangeFeedActorState { fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< UpdateChangeFeedActor, 0, Optional >*,Error err) + void a_callback_error(ActorCallback< UpdateChangeFeedActor1, 0, Optional >*,Error err) { fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); a_exitChoose1(); @@ -18665,35 +20740,35 @@ class UpdateChangeFeedActorState { fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); } - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Transaction* tr; - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Reference tr; + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Key rangeID; - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ChangeFeedStatus status; - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" KeyRange range; - #line 2225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Key rangeIDKey; - #line 18678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 20753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via updateChangeFeed() - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class UpdateChangeFeedActor final : public Actor, public ActorCallback< UpdateChangeFeedActor, 0, Optional >, public FastAllocated, public UpdateChangeFeedActorState { - #line 18683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class UpdateChangeFeedActor1 final : public Actor, public ActorCallback< UpdateChangeFeedActor1, 0, Optional >, public FastAllocated, public UpdateChangeFeedActor1State { + #line 20758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< UpdateChangeFeedActor, 0, Optional >; - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - UpdateChangeFeedActor(Transaction* const& tr,Key const& rangeID,ChangeFeedStatus const& status,KeyRange const& range) - #line 18694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +friend struct ActorCallback< UpdateChangeFeedActor1, 0, Optional >; + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + UpdateChangeFeedActor1(Reference const& tr,Key const& rangeID,ChangeFeedStatus const& status,KeyRange const& range) + #line 20769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), - UpdateChangeFeedActorState(tr, rangeID, status, range) + UpdateChangeFeedActor1State(tr, rangeID, status, range) { fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -18704,307 +20779,387 @@ friend struct ActorCallback< UpdateChangeFeedActor, 0, Optional >; fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), -1); } - void cancel() override + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< UpdateChangeFeedActor1, 0, Optional >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future updateChangeFeed( Reference const& tr, Key const& rangeID, ChangeFeedStatus const& status, KeyRange const& range ) { + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new UpdateChangeFeedActor1(tr, rangeID, status, range)); + #line 20797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +} + +#line 2606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + + #line 20802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via updateChangeFeed() + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class UpdateChangeFeedActor2State { + #line 20809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + UpdateChangeFeedActor2State(Database const& cx,Key const& rangeID,ChangeFeedStatus const& status,KeyRange const& range) + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + : cx(cx), + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + rangeID(rangeID), + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + status(status), + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + range(range), + #line 2608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr(cx) + #line 20824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + fdb_probe_actor_create("updateChangeFeed", reinterpret_cast(this)); + + } + ~UpdateChangeFeedActor2State() + { + fdb_probe_actor_destroy("updateChangeFeed", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 2609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ; + #line 20839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~UpdateChangeFeedActor2State(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 2611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_0 = updateChangeFeed(&tr, rangeID, status, range); + #line 2611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 20872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 2611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 20877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 2615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_2 = tr.onError(e); + #line 2615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 20901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 2615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 20906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Void const& _,int loopDepth) + { + #line 2612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_1 = tr.commit(); + #line 2612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 20923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 20928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Void && _,int loopDepth) + { + #line 2612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_1 = tr.commit(); + #line 2612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 20939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 20944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< UpdateChangeFeedActor2, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< UpdateChangeFeedActor2, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< UpdateChangeFeedActor2, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< UpdateChangeFeedActor2, 0, Void >*,Error err) + { + fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 2613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateChangeFeedActor2State(); static_cast(this)->destroy(); return 0; } + #line 21016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~UpdateChangeFeedActor2State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 2613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateChangeFeedActor2State(); static_cast(this)->destroy(); return 0; } + #line 21028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~UpdateChangeFeedActor2State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< UpdateChangeFeedActor, 0, Optional >*)0, actor_cancelled()); break; - } + loopDepth = a_body1loopBody1cont3(_, loopDepth); + return loopDepth; } -}; -} - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -[[nodiscard]] Future updateChangeFeed( Transaction* const& tr, Key const& rangeID, ChangeFeedStatus const& status, KeyRange const& range ) { - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return Future(new UpdateChangeFeedActor(tr, rangeID, status, range)); - #line 18722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -} - -#line 2257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - - #line 18727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via updateChangeFeed() - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -template - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class UpdateChangeFeedActor1State { - #line 18734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" -public: - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - UpdateChangeFeedActor1State(Reference const& tr,Key const& rangeID,ChangeFeedStatus const& status,KeyRange const& range) - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - : tr(tr), - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - rangeID(rangeID), - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - status(status), - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - range(range), - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - rangeIDKey(rangeID.withPrefix(changeFeedPrefix)) - #line 18749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + int a_body1loopBody1cont2when1(Void && _,int loopDepth) { - fdb_probe_actor_create("updateChangeFeed", reinterpret_cast(this)); + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + return loopDepth; } - ~UpdateChangeFeedActor1State() + void a_exitChoose2() { - fdb_probe_actor_destroy("updateChangeFeed", reinterpret_cast(this)); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< UpdateChangeFeedActor2, 1, Void >::remove(); } - int a_body1(int loopDepth=0) + void a_callback_fire(ActorCallback< UpdateChangeFeedActor2, 1, Void >*,Void const& value) { + fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 1); + a_exitChoose2(); try { - #line 2263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture> __when_expr_0 = tr->get(rangeIDKey); - #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 18773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) + void a_callback_fire(ActorCallback< UpdateChangeFeedActor2, 1, Void >*,Void && value) { - this->~UpdateChangeFeedActor1State(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; + fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1cont1(Optional const& val,int loopDepth) + void a_callback_error(ActorCallback< UpdateChangeFeedActor2, 1, Void >*,Error err) { - #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (status == ChangeFeedStatus::CHANGE_FEED_CREATE) - #line 18796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!val.present()) - #line 18800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr->set(rangeIDKey, changeFeedValue(range, invalidVersion, status)); - #line 18804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - else - { - #line 2269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (std::get<0>(decodeChangeFeedValue(val.get())) != range) - #line 18810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return a_body1Catch1(unsupported_operation(), loopDepth); - #line 18814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - } + fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); } - else - { - #line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (status == ChangeFeedStatus::CHANGE_FEED_STOP) - #line 18822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (val.present()) - #line 18826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr->set(rangeIDKey, changeFeedValue(std::get<0>(decodeChangeFeedValue(val.get())), std::get<1>(decodeChangeFeedValue(val.get())), status)); - #line 18830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - else - { - #line 2279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return a_body1Catch1(unsupported_operation(), loopDepth); - #line 18836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - } - else - { - #line 2281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (status == ChangeFeedStatus::CHANGE_FEED_DESTROY) - #line 18843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (val.present()) - #line 18847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr->set(rangeIDKey, changeFeedValue(std::get<0>(decodeChangeFeedValue(val.get())), std::get<1>(decodeChangeFeedValue(val.get())), status)); - #line 2287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr->clear(rangeIDKey); - #line 18853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - else - { - #line 2289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return a_body1Catch1(unsupported_operation(), loopDepth); - #line 18859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - } - } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); } - #line 2292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateChangeFeedActor1State(); static_cast(this)->destroy(); return 0; } - #line 18866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~UpdateChangeFeedActor1State(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 1); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont1(Optional && val,int loopDepth) + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (status == ChangeFeedStatus::CHANGE_FEED_CREATE) - #line 18878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!val.present()) - #line 18882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr->set(rangeIDKey, changeFeedValue(range, invalidVersion, status)); - #line 18886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - else - { - #line 2269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (std::get<0>(decodeChangeFeedValue(val.get())) != range) - #line 18892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return a_body1Catch1(unsupported_operation(), loopDepth); - #line 18896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - } - } - else - { - #line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (status == ChangeFeedStatus::CHANGE_FEED_STOP) - #line 18904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (val.present()) - #line 18908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr->set(rangeIDKey, changeFeedValue(std::get<0>(decodeChangeFeedValue(val.get())), std::get<1>(decodeChangeFeedValue(val.get())), status)); - #line 18912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - else - { - #line 2279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return a_body1Catch1(unsupported_operation(), loopDepth); - #line 18918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - } - else - { - #line 2281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (status == ChangeFeedStatus::CHANGE_FEED_DESTROY) - #line 18925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (val.present()) - #line 18929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr->set(rangeIDKey, changeFeedValue(std::get<0>(decodeChangeFeedValue(val.get())), std::get<1>(decodeChangeFeedValue(val.get())), status)); - #line 2287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr->clear(rangeIDKey); - #line 18935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - else - { - #line 2289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return a_body1Catch1(unsupported_operation(), loopDepth); - #line 18941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - } - } - } - } - #line 2292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateChangeFeedActor1State(); static_cast(this)->destroy(); return 0; } - #line 18948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~UpdateChangeFeedActor1State(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1when1(Optional const& val,int loopDepth) + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(val, loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1when1(Optional && val,int loopDepth) + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(val), loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< UpdateChangeFeedActor1, 0, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< UpdateChangeFeedActor2, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< UpdateChangeFeedActor1, 0, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< UpdateChangeFeedActor2, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1when1(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); + fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< UpdateChangeFeedActor1, 0, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< UpdateChangeFeedActor2, 2, Void >*,Void && value) { - fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); + fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< UpdateChangeFeedActor1, 0, Optional >*,Error err) + void a_callback_error(ActorCallback< UpdateChangeFeedActor2, 2, Void >*,Error err) { - fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -19013,38 +21168,40 @@ class UpdateChangeFeedActor1State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); + fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 2); } - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Reference tr; - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Database cx; + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Key rangeID; - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ChangeFeedStatus status; - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" KeyRange range; - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Key rangeIDKey; - #line 19029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Transaction tr; + #line 21184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via updateChangeFeed() - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class UpdateChangeFeedActor1 final : public Actor, public ActorCallback< UpdateChangeFeedActor1, 0, Optional >, public FastAllocated, public UpdateChangeFeedActor1State { - #line 19034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class UpdateChangeFeedActor2 final : public Actor, public ActorCallback< UpdateChangeFeedActor2, 0, Void >, public ActorCallback< UpdateChangeFeedActor2, 1, Void >, public ActorCallback< UpdateChangeFeedActor2, 2, Void >, public FastAllocated, public UpdateChangeFeedActor2State { + #line 21189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< UpdateChangeFeedActor1, 0, Optional >; - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - UpdateChangeFeedActor1(Reference const& tr,Key const& rangeID,ChangeFeedStatus const& status,KeyRange const& range) - #line 19045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +friend struct ActorCallback< UpdateChangeFeedActor2, 0, Void >; +friend struct ActorCallback< UpdateChangeFeedActor2, 1, Void >; +friend struct ActorCallback< UpdateChangeFeedActor2, 2, Void >; + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + UpdateChangeFeedActor2(Database const& cx,Key const& rangeID,ChangeFeedStatus const& status,KeyRange const& range) + #line 21202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), - UpdateChangeFeedActor1State(tr, rangeID, status, range) + UpdateChangeFeedActor2State(cx, rangeID, status, range) { fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -19060,59 +21217,57 @@ friend struct ActorCallback< UpdateChangeFeedActor1, 0, Optional >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< UpdateChangeFeedActor1, 0, Optional >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< UpdateChangeFeedActor2, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< UpdateChangeFeedActor2, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< UpdateChangeFeedActor2, 2, Void >*)0, actor_cancelled()); break; } } }; } - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -[[nodiscard]] Future updateChangeFeed( Reference const& tr, Key const& rangeID, ChangeFeedStatus const& status, KeyRange const& range ) { - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return Future(new UpdateChangeFeedActor1(tr, rangeID, status, range)); - #line 19073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future updateChangeFeed( Database const& cx, Key const& rangeID, ChangeFeedStatus const& status, KeyRange const& range ) { + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new UpdateChangeFeedActor2(cx, rangeID, status, range)); + #line 21232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 19078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 21237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { -// This generated class is to be used only via updateChangeFeed() - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -template - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class UpdateChangeFeedActor2State { - #line 19085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via advanceVersion() + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class AdvanceVersionActorState { + #line 21244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - UpdateChangeFeedActor2State(Database const& cx,Key const& rangeID,ChangeFeedStatus const& status,KeyRange const& range) - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + AdvanceVersionActorState(Database const& cx,Version const& v) + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - rangeID(rangeID), - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - status(status), - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - range(range), - #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + v(v), + #line 2621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(cx) - #line 19100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 21255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - fdb_probe_actor_create("updateChangeFeed", reinterpret_cast(this)); + fdb_probe_actor_create("advanceVersion", reinterpret_cast(this)); } - ~UpdateChangeFeedActor2State() + ~AdvanceVersionActorState() { - fdb_probe_actor_destroy("updateChangeFeed", reinterpret_cast(this)); + fdb_probe_actor_destroy("advanceVersion", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 19115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 21270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -19125,8 +21280,8 @@ class UpdateChangeFeedActor2State { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~UpdateChangeFeedActor2State(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~AdvanceVersionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; @@ -19140,17 +21295,22 @@ class UpdateChangeFeedActor2State { } int a_body1loopBody1(int loopDepth) { + #line 2623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 2624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 21302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" try { - #line 2299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_0 = updateChangeFeed(&tr, rangeID, status, range); - #line 2299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 19148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_0 = tr.getReadVersion(); + #line 2626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 21308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 2299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 2626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 21313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -19170,16 +21330,16 @@ class UpdateChangeFeedActor2State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = tr.onError(e); - #line 2303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 19177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 21337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 2303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 3; + #line 2635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 21342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -19190,252 +21350,578 @@ class UpdateChangeFeedActor2State { return loopDepth; } - int a_body1loopBody1cont2(Void const& _,int loopDepth) + int a_body1loopBody1cont2(Version const& rv,int loopDepth) { - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_1 = tr.commit(); - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 19199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + #line 2627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (rv <= v) + #line 21357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr.set(minRequiredCommitVersionKey, BinaryWriter::toValue(v + 1, Unversioned())); + #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_1 = tr.commit(); + #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 21365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 21370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 2631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + fmt::print("Current read version is {}\n", rv); + #line 2632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AdvanceVersionActorState(); static_cast(this)->destroy(); return 0; } + #line 21379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~AdvanceVersionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } return loopDepth; } - int a_body1loopBody1cont2(Void && _,int loopDepth) + int a_body1loopBody1cont2(Version && rv,int loopDepth) { - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_1 = tr.commit(); - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 19215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; + #line 2627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (rv <= v) + #line 21392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + tr.set(minRequiredCommitVersionKey, BinaryWriter::toValue(v + 1, Unversioned())); + #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_1 = tr.commit(); + #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 21400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 21405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 2631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + fmt::print("Current read version is {}\n", rv); + #line 2632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AdvanceVersionActorState(); static_cast(this)->destroy(); return 0; } + #line 21414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~AdvanceVersionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } return loopDepth; } - int a_body1loopBody1when1(Void const& _,int loopDepth) + int a_body1loopBody1when1(Version const& rv,int loopDepth) { - loopDepth = a_body1loopBody1cont2(_, loopDepth); + loopDepth = a_body1loopBody1cont2(rv, loopDepth); return loopDepth; } - int a_body1loopBody1when1(Void && _,int loopDepth) + int a_body1loopBody1when1(Version && rv,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont2(std::move(rv), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< UpdateChangeFeedActor2, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AdvanceVersionActor, 0, Version >::remove(); } - void a_callback_fire(ActorCallback< UpdateChangeFeedActor2, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AdvanceVersionActor, 0, Version >*,Version const& value) { - fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); + fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< AdvanceVersionActor, 0, Version >*,Version && value) + { + fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(value, 0); + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< AdvanceVersionActor, 0, Version >*,Error err) + { + fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(int loopDepth) + { + loopDepth = a_body1loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AdvanceVersionActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AdvanceVersionActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< AdvanceVersionActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); + fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< UpdateChangeFeedActor2, 0, Void >*,Void && value) + void a_callback_error(ActorCallback< AdvanceVersionActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); + fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< UpdateChangeFeedActor2, 0, Void >*,Error err) + int a_body1loopBody1cont6(int loopDepth) { - fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 0); - a_exitChoose1(); try { - a_body1loopBody1Catch1(err, 0); + loopDepth = a_body1loopBody1cont1(loopDepth); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } - fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 0); + return loopDepth; } - int a_body1loopBody1cont3(Void const& _,int loopDepth) + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 2301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateChangeFeedActor2State(); static_cast(this)->destroy(); return 0; } - #line 19292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~UpdateChangeFeedActor2State(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont3(Void && _,int loopDepth) + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 2301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateChangeFeedActor2State(); static_cast(this)->destroy(); return 0; } - #line 19304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~UpdateChangeFeedActor2State(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont3(_, loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(Void && _,int loopDepth) + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< UpdateChangeFeedActor2, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AdvanceVersionActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< UpdateChangeFeedActor2, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AdvanceVersionActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1cont2when1(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 1); + fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< UpdateChangeFeedActor2, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< AdvanceVersionActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1cont2when1(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 1); + fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< UpdateChangeFeedActor2, 1, Void >*,Error err) + void a_callback_error(ActorCallback< AdvanceVersionActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 1); + fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 2); } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Database cx; + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Version v; + #line 2621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Transaction tr; + #line 21661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +}; +// This generated class is to be used only via advanceVersion() + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class AdvanceVersionActor final : public Actor, public ActorCallback< AdvanceVersionActor, 0, Version >, public ActorCallback< AdvanceVersionActor, 1, Void >, public ActorCallback< AdvanceVersionActor, 2, Void >, public FastAllocated, public AdvanceVersionActorState { + #line 21666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< AdvanceVersionActor, 0, Version >; +friend struct ActorCallback< AdvanceVersionActor, 1, Void >; +friend struct ActorCallback< AdvanceVersionActor, 2, Void >; + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + AdvanceVersionActor(Database const& cx,Version const& v) + #line 21679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + : Actor(), + AdvanceVersionActorState(cx, v) + { + fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("advanceVersion"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< AdvanceVersionActor, 0, Version >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< AdvanceVersionActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< AdvanceVersionActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future advanceVersion( Database const& cx, Version const& v ) { + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new AdvanceVersionActor(cx, v)); + #line 21709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +} + +#line 2639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + + #line 21714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via forceRecovery() + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class ForceRecoveryActorState { + #line 21721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +public: + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ForceRecoveryActorState(Reference const& clusterFile,Key const& dcId) + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + : clusterFile(clusterFile), + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + dcId(dcId), + #line 2641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + clusterInterface(new AsyncVar>), + #line 2642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + leaderMon(monitorLeader(clusterFile, clusterInterface)) + #line 21734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + fdb_probe_actor_create("forceRecovery", reinterpret_cast(this)); + + } + ~ForceRecoveryActorState() + { + fdb_probe_actor_destroy("forceRecovery", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 2644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ; + #line 21749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ForceRecoveryActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 2646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_0 = clusterInterface->get().present() ? brokenPromiseToNever( clusterInterface->get().get().forceRecovery.getReply(ForceRecoveryRequest(dcId))) : Never(); + #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 21781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + #line 2652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_1 = clusterInterface->onChange(); + #line 21785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 2646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 21792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + #line 2650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ForceRecoveryActorState(); static_cast(this)->destroy(); return 0; } + #line 21807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ForceRecoveryActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + #line 2650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ForceRecoveryActorState(); static_cast(this)->destroy(); return 0; } + #line 21819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ForceRecoveryActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1when2(Void const& _,int loopDepth) { loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1loopBody1when2(Void && _,int loopDepth) { loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + void a_exitChoose1() { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ForceRecoveryActor, 0, Void >::remove(); + static_cast(this)->ActorCallback< ForceRecoveryActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ForceRecoveryActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("forceRecovery", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("forceRecovery", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + void a_callback_fire(ActorCallback< ForceRecoveryActor, 0, Void >*,Void && value) { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + fdb_probe_actor_enter("forceRecovery", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("forceRecovery", reinterpret_cast(this), 0); - return loopDepth; } - void a_exitChoose3() + void a_callback_error(ActorCallback< ForceRecoveryActor, 0, Void >*,Error err) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< UpdateChangeFeedActor2, 2, Void >::remove(); + fdb_probe_actor_enter("forceRecovery", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("forceRecovery", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< UpdateChangeFeedActor2, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< ForceRecoveryActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("forceRecovery", reinterpret_cast(this), 1); + a_exitChoose1(); try { - a_body1loopBody1Catch1when1(value, 0); + a_body1loopBody1when2(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 2); + fdb_probe_actor_exit("forceRecovery", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< UpdateChangeFeedActor2, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< ForceRecoveryActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("forceRecovery", reinterpret_cast(this), 1); + a_exitChoose1(); try { - a_body1loopBody1Catch1when1(std::move(value), 0); + a_body1loopBody1when2(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 2); + fdb_probe_actor_exit("forceRecovery", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< UpdateChangeFeedActor2, 2, Void >*,Error err) + void a_callback_error(ActorCallback< ForceRecoveryActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("forceRecovery", reinterpret_cast(this), 1); + a_exitChoose1(); try { a_body1Catch1(err, 0); } @@ -19444,48 +21930,45 @@ class UpdateChangeFeedActor2State { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), 2); + fdb_probe_actor_exit("forceRecovery", reinterpret_cast(this), 1); } - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Database cx; - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Key rangeID; - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ChangeFeedStatus status; - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - KeyRange range; - #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Transaction tr; - #line 19460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Reference clusterFile; + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Key dcId; + #line 2641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Reference>> clusterInterface; + #line 2642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Future leaderMon; + #line 21944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; -// This generated class is to be used only via updateChangeFeed() - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class UpdateChangeFeedActor2 final : public Actor, public ActorCallback< UpdateChangeFeedActor2, 0, Void >, public ActorCallback< UpdateChangeFeedActor2, 1, Void >, public ActorCallback< UpdateChangeFeedActor2, 2, Void >, public FastAllocated, public UpdateChangeFeedActor2State { - #line 19465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via forceRecovery() + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class ForceRecoveryActor final : public Actor, public ActorCallback< ForceRecoveryActor, 0, Void >, public ActorCallback< ForceRecoveryActor, 1, Void >, public FastAllocated, public ForceRecoveryActorState { + #line 21949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< UpdateChangeFeedActor2, 0, Void >; -friend struct ActorCallback< UpdateChangeFeedActor2, 1, Void >; -friend struct ActorCallback< UpdateChangeFeedActor2, 2, Void >; - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - UpdateChangeFeedActor2(Database const& cx,Key const& rangeID,ChangeFeedStatus const& status,KeyRange const& range) - #line 19478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +friend struct ActorCallback< ForceRecoveryActor, 0, Void >; +friend struct ActorCallback< ForceRecoveryActor, 1, Void >; + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ForceRecoveryActor(Reference const& clusterFile,Key const& dcId) + #line 21961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), - UpdateChangeFeedActor2State(cx, rangeID, status, range) + ForceRecoveryActorState(clusterFile, dcId) { - fdb_probe_actor_enter("updateChangeFeed", reinterpret_cast(this), -1); + fdb_probe_actor_enter("forceRecovery", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("updateChangeFeed"); + this->lineage.setActorName("forceRecovery"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("updateChangeFeed", reinterpret_cast(this), -1); + fdb_probe_actor_exit("forceRecovery", reinterpret_cast(this), -1); } void cancel() override @@ -19493,476 +21976,401 @@ friend struct ActorCallback< UpdateChangeFeedActor2, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< UpdateChangeFeedActor2, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< UpdateChangeFeedActor2, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< UpdateChangeFeedActor2, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< ForceRecoveryActor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -[[nodiscard]] Future updateChangeFeed( Database const& cx, Key const& rangeID, ChangeFeedStatus const& status, KeyRange const& range ) { - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return Future(new UpdateChangeFeedActor2(cx, rangeID, status, range)); - #line 19508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future forceRecovery( Reference const& clusterFile, Key const& dcId ) { + #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new ForceRecoveryActor(clusterFile, dcId)); + #line 21989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 19513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 21994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { -// This generated class is to be used only via advanceVersion() - #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -template - #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class AdvanceVersionActorState { - #line 19520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via auditStorage() + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class AuditStorageActorState { + #line 22001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - AdvanceVersionActorState(Database const& cx,Version const& v) - #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - : cx(cx), - #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - v(v), - #line 2309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr(cx) - #line 19531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - fdb_probe_actor_create("advanceVersion", reinterpret_cast(this)); - - } - ~AdvanceVersionActorState() - { - fdb_probe_actor_destroy("advanceVersion", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 2310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ; - #line 19546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~AdvanceVersionActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) - { - #line 2311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 19578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - try { - #line 2314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_0 = tr.getReadVersion(); - #line 2314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 19584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 2314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1cont1(int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 2323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_2 = tr.onError(e); - #line 2323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 19613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 2323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - int a_body1loopBody1cont2(Version const& rv,int loopDepth) + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + AuditStorageActorState(Reference const& clusterFile,KeyRange const& range,AuditType const& type,KeyValueStoreType const& engineType,double const& timeoutSeconds) + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + : clusterFile(clusterFile), + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + range(range), + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + type(type), + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + engineType(engineType), + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + timeoutSeconds(timeoutSeconds), + #line 2662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + clusterInterface(new AsyncVar>), + #line 2663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + leaderMon(monitorLeader(clusterFile, clusterInterface)) + #line 22020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (rv <= v) - #line 19633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.set(minRequiredCommitVersionKey, BinaryWriter::toValue(v + 1, Unversioned())); - #line 2317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_1 = tr.commit(); - #line 2317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 19641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 2317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 2319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - fmt::print("Current read version is {}\n", rv); - #line 2320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AdvanceVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 19655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~AdvanceVersionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } + fdb_probe_actor_create("auditStorage", reinterpret_cast(this)); - return loopDepth; } - int a_body1loopBody1cont2(Version && rv,int loopDepth) + ~AuditStorageActorState() { - #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (rv <= v) - #line 19668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - { - #line 2316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - tr.set(minRequiredCommitVersionKey, BinaryWriter::toValue(v + 1, Unversioned())); - #line 2317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_1 = tr.commit(); - #line 2317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 19676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 2317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 2319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - fmt::print("Current read version is {}\n", rv); - #line 2320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AdvanceVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 19690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~AdvanceVersionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } + fdb_probe_actor_destroy("auditStorage", reinterpret_cast(this)); - return loopDepth; } - int a_body1loopBody1when1(Version const& rv,int loopDepth) + int a_body1(int loopDepth=0) { - loopDepth = a_body1loopBody1cont2(rv, loopDepth); + try { + #line 2664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent(SevVerbose, "ManagementAPIAuditStorageTrigger").detail("AuditType", type).detail("Range", range); + #line 2665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + auditId = UID(); + #line 22037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + try { + #line 2667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ; + #line 22041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1loopBody1when1(Version && rv,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - loopDepth = a_body1loopBody1cont2(std::move(rv), loopDepth); + this->~AuditStorageActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - void a_exitChoose1() + int a_body1cont1(int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AdvanceVersionActor, 0, Version >::remove(); + #line 2687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(auditId); this->~AuditStorageActorState(); static_cast(this)->destroy(); return 0; } + #line 22070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< UID >::value()) UID(std::move(auditId)); // state_var_RVO + this->~AuditStorageActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + return loopDepth; } - void a_callback_fire(ActorCallback< AdvanceVersionActor, 0, Version >*,Version const& value) + int a_body1Catch2(const Error& e,int loopDepth=0) { - fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 0); - a_exitChoose1(); try { - a_body1loopBody1when1(value, 0); + #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent(SevInfo, "ManagementAPIAuditStorageError") .errorUnsuppressed(e) .detail("AuditType", type) .detail("Range", range) .detail("AuditID", auditId); + #line 2684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 22085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 0); + return loopDepth; } - void a_callback_fire(ActorCallback< AdvanceVersionActor, 0, Version >*,Version && value) + int a_body1cont2(int loopDepth) { - fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + #line 2670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent(SevVerbose, "ManagementAPIAuditStorageBegin").detail("AuditType", type).detail("Range", range); + #line 2671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TriggerAuditRequest req(type, range, engineType); + #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_1 = timeoutError(clusterInterface->get().get().triggerAudit.getReply(req), timeoutSeconds); + #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 22105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 22110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 2667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!(!clusterInterface->get().present())) + #line 22126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 0); + #line 2668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_0 = clusterInterface->onChange(); + #line 2668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 22134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 2668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 22139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = 0; + return loopDepth; } - void a_callback_error(ActorCallback< AdvanceVersionActor, 0, Version >*,Error err) + int a_body1break1(int loopDepth) { - fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 0); - a_exitChoose1(); try { - a_body1loopBody1Catch1(err, 0); + return a_body1cont2(loopDepth); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1Catch2(error, loopDepth); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch2(unknown_error(), loopDepth); } - fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 0); - - } - int a_body1loopBody1cont3(int loopDepth) - { - loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; } - int a_body1loopBody1cont4(Void const& _,int loopDepth) + int a_body1loopBody1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont3(loopDepth); + if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1loopBody1cont4(Void && _,int loopDepth) + int a_body1loopBody1cont1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont3(loopDepth); + if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + int a_body1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(_, loopDepth); + loopDepth = a_body1loopBody1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(Void && _,int loopDepth) + int a_body1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AdvanceVersionActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AuditStorageActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< AdvanceVersionActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AuditStorageActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("auditStorage", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1cont2when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 1); + fdb_probe_actor_exit("auditStorage", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< AdvanceVersionActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< AuditStorageActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("auditStorage", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1cont2when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 1); + fdb_probe_actor_exit("auditStorage", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< AdvanceVersionActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< AuditStorageActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("auditStorage", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch2(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 1); + fdb_probe_actor_exit("auditStorage", reinterpret_cast(this), 0); } - int a_body1loopBody1cont6(int loopDepth) + int a_body1cont3(UID const& auditId_,int loopDepth) { - try { - loopDepth = a_body1loopBody1cont1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } + #line 2673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + auditId = auditId_; + #line 2674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent(SevVerbose, "ManagementAPIAuditStorageEnd") .detail("AuditType", type) .detail("Range", range) .detail("AuditID", auditId); + #line 22238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1cont5(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1cont3(UID && auditId_,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 2673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + auditId = auditId_; + #line 2674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent(SevVerbose, "ManagementAPIAuditStorageEnd") .detail("AuditType", type) .detail("Range", range) .detail("AuditID", auditId); + #line 22249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1cont5(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1cont2when1(UID const& auditId_,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont3(auditId_, loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont2when1(UID && auditId_,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + loopDepth = a_body1cont3(std::move(auditId_), loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + void a_exitChoose2() { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AuditStorageActor, 1, UID >::remove(); - return loopDepth; } - void a_exitChoose3() + void a_callback_fire(ActorCallback< AuditStorageActor, 1, UID >*,UID const& value) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AdvanceVersionActor, 2, Void >::remove(); + fdb_probe_actor_enter("auditStorage", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("auditStorage", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< AdvanceVersionActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< AuditStorageActor, 1, UID >*,UID && value) { - fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("auditStorage", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1Catch1when1(value, 0); + a_body1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 2); + fdb_probe_actor_exit("auditStorage", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< AdvanceVersionActor, 2, Void >*,Void && value) + void a_callback_error(ActorCallback< AuditStorageActor, 1, UID >*,Error err) { - fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("auditStorage", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1Catch1when1(std::move(value), 0); + a_body1Catch2(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 2); + fdb_probe_actor_exit("auditStorage", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< AdvanceVersionActor, 2, Void >*,Error err) + int a_body1cont5(int loopDepth) { - fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), 2); - a_exitChoose3(); try { - a_body1Catch1(err, 0); + loopDepth = a_body1cont1(loopDepth); } catch (Error& error) { - a_body1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), 2); + return loopDepth; } - #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Database cx; - #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Version v; - #line 2309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Transaction tr; - #line 19937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Reference clusterFile; + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + KeyRange range; + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + AuditType type; + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + KeyValueStoreType engineType; + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + double timeoutSeconds; + #line 2662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Reference>> clusterInterface; + #line 2663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + Future leaderMon; + #line 2665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + UID auditId; + #line 22346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; -// This generated class is to be used only via advanceVersion() - #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class AdvanceVersionActor final : public Actor, public ActorCallback< AdvanceVersionActor, 0, Version >, public ActorCallback< AdvanceVersionActor, 1, Void >, public ActorCallback< AdvanceVersionActor, 2, Void >, public FastAllocated, public AdvanceVersionActorState { - #line 19942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via auditStorage() + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class AuditStorageActor final : public Actor, public ActorCallback< AuditStorageActor, 0, Void >, public ActorCallback< AuditStorageActor, 1, UID >, public FastAllocated, public AuditStorageActorState { + #line 22351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< AdvanceVersionActor, 0, Version >; -friend struct ActorCallback< AdvanceVersionActor, 1, Void >; -friend struct ActorCallback< AdvanceVersionActor, 2, Void >; - #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - AdvanceVersionActor(Database const& cx,Version const& v) - #line 19955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - : Actor(), - AdvanceVersionActorState(cx, v) - { - fdb_probe_actor_enter("advanceVersion", reinterpret_cast(this), -1); +friend struct ActorCallback< AuditStorageActor, 0, Void >; +friend struct ActorCallback< AuditStorageActor, 1, UID >; + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + AuditStorageActor(Reference const& clusterFile,KeyRange const& range,AuditType const& type,KeyValueStoreType const& engineType,double const& timeoutSeconds) + #line 22363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + : Actor(), + AuditStorageActorState(clusterFile, range, type, engineType, timeoutSeconds) + { + fdb_probe_actor_enter("auditStorage", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("advanceVersion"); + this->lineage.setActorName("auditStorage"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("advanceVersion", reinterpret_cast(this), -1); + fdb_probe_actor_exit("auditStorage", reinterpret_cast(this), -1); } void cancel() override @@ -19970,60 +22378,110 @@ friend struct ActorCallback< AdvanceVersionActor, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< AdvanceVersionActor, 0, Version >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< AdvanceVersionActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< AdvanceVersionActor, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< AuditStorageActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< AuditStorageActor, 1, UID >*)0, actor_cancelled()); break; } } }; } - #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -[[nodiscard]] Future advanceVersion( Database const& cx, Version const& v ) { - #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return Future(new AdvanceVersionActor(cx, v)); - #line 19985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future auditStorage( Reference const& clusterFile, KeyRange const& range, AuditType const& type, KeyValueStoreType const& engineType, double const& timeoutSeconds ) { + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new AuditStorageActor(clusterFile, range, type, engineType, timeoutSeconds)); + #line 22392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 19990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { -// This generated class is to be used only via forceRecovery() - #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -template - #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class ForceRecoveryActorState { - #line 19997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via cancelAuditStorage() + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class CancelAuditStorageActorState { + #line 22404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ForceRecoveryActorState(Reference const& clusterFile,Key const& dcId) - #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + CancelAuditStorageActorState(Reference const& clusterFile,AuditType const& type,UID const& auditId,double const& timeoutSeconds) + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : clusterFile(clusterFile), - #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - dcId(dcId), - #line 2329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + type(type), + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + auditId(auditId), + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + timeoutSeconds(timeoutSeconds), + #line 2694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" clusterInterface(new AsyncVar>), - #line 2330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" leaderMon(monitorLeader(clusterFile, clusterInterface)) - #line 20010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + fdb_probe_actor_create("cancelAuditStorage", reinterpret_cast(this)); + + } + ~CancelAuditStorageActorState() + { + fdb_probe_actor_destroy("cancelAuditStorage", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 2696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent(SevVerbose, "ManagementAPICancelAuditStorageTrigger") .detail("AuditType", type) .detail("AuditId", auditId); + #line 22436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + try { + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ; + #line 22440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) { - fdb_probe_actor_create("forceRecovery", reinterpret_cast(this)); + this->~CancelAuditStorageActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + return loopDepth; } - ~ForceRecoveryActorState() + int a_body1cont1(int loopDepth) { - fdb_probe_actor_destroy("forceRecovery", reinterpret_cast(this)); + #line 2720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(auditId); this->~CancelAuditStorageActorState(); static_cast(this)->destroy(); return 0; } + #line 22469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< UID >::value()) UID(std::move(auditId)); // state_var_RVO + this->~CancelAuditStorageActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + return loopDepth; } - int a_body1(int loopDepth=0) + int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ; - #line 20025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); + #line 2713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent(SevInfo, "ManagementAPICancelAuditStorageError") .errorUnsuppressed(e) .detail("AuditType", type) .detail("AuditID", auditId); + #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 22484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -20033,10 +22491,22 @@ class ForceRecoveryActorState { return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) + int a_body1cont2(int loopDepth) { - this->~ForceRecoveryActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + #line 2703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent(SevVerbose, "ManagementAPICancelAuditStorageBegin") .detail("AuditType", type) .detail("AuditId", auditId); + #line 2706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TriggerAuditRequest req(type, auditId); + #line 2707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_1 = timeoutError(clusterInterface->get().get().triggerAudit.getReply(req), timeoutSeconds); + #line 2707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 22504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 22509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -20050,201 +22520,252 @@ class ForceRecoveryActorState { } int a_body1loopBody1(int loopDepth) { - #line 2334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_0 = clusterInterface->get().present() ? brokenPromiseToNever( clusterInterface->get().get().forceRecovery.getReply(ForceRecoveryRequest(dcId))) : Never(); - #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 20057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 2340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - StrictFuture __when_expr_1 = clusterInterface->onChange(); - #line 20061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 2334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 20068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!(!clusterInterface->get().present())) + #line 22525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + StrictFuture __when_expr_0 = clusterInterface->onChange(); + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 22533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 22538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) + int a_body1break1(int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); + try { + return a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1loopBody1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ForceRecoveryActorState(); static_cast(this)->destroy(); return 0; } - #line 20083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~ForceRecoveryActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1loopBody1when1(Void && _,int loopDepth) + int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ForceRecoveryActorState(); static_cast(this)->destroy(); return 0; } - #line 20095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~ForceRecoveryActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1loopBody1when2(Void const& _,int loopDepth) + int a_body1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1loopBody1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1when2(Void && _,int loopDepth) + int a_body1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ForceRecoveryActor, 0, Void >::remove(); - static_cast(this)->ActorCallback< ForceRecoveryActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CancelAuditStorageActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< ForceRecoveryActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< CancelAuditStorageActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("forceRecovery", reinterpret_cast(this), 0); + fdb_probe_actor_enter("cancelAuditStorage", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("forceRecovery", reinterpret_cast(this), 0); + fdb_probe_actor_exit("cancelAuditStorage", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< ForceRecoveryActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< CancelAuditStorageActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("forceRecovery", reinterpret_cast(this), 0); + fdb_probe_actor_enter("cancelAuditStorage", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("forceRecovery", reinterpret_cast(this), 0); + fdb_probe_actor_exit("cancelAuditStorage", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< ForceRecoveryActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< CancelAuditStorageActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("forceRecovery", reinterpret_cast(this), 0); + fdb_probe_actor_enter("cancelAuditStorage", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1Catch2(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("forceRecovery", reinterpret_cast(this), 0); + fdb_probe_actor_exit("cancelAuditStorage", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< ForceRecoveryActor, 1, Void >*,Void const& value) + int a_body1cont3(UID const& auditId_,int loopDepth) { - fdb_probe_actor_enter("forceRecovery", reinterpret_cast(this), 1); - a_exitChoose1(); + #line 2708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(auditId_ == auditId); + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent(SevVerbose, "ManagementAPICancelAuditStorageEnd") .detail("AuditType", type) .detail("AuditID", auditId); + #line 22637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont3(UID && auditId_,int loopDepth) + { + #line 2708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(auditId_ == auditId); + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + TraceEvent(SevVerbose, "ManagementAPICancelAuditStorageEnd") .detail("AuditType", type) .detail("AuditID", auditId); + #line 22648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont2when1(UID const& auditId_,int loopDepth) + { + loopDepth = a_body1cont3(auditId_, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(UID && auditId_,int loopDepth) + { + loopDepth = a_body1cont3(std::move(auditId_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CancelAuditStorageActor, 1, UID >::remove(); + + } + void a_callback_fire(ActorCallback< CancelAuditStorageActor, 1, UID >*,UID const& value) + { + fdb_probe_actor_enter("cancelAuditStorage", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when2(value, 0); + a_body1cont2when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("forceRecovery", reinterpret_cast(this), 1); + fdb_probe_actor_exit("cancelAuditStorage", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< ForceRecoveryActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< CancelAuditStorageActor, 1, UID >*,UID && value) { - fdb_probe_actor_enter("forceRecovery", reinterpret_cast(this), 1); - a_exitChoose1(); + fdb_probe_actor_enter("cancelAuditStorage", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when2(std::move(value), 0); + a_body1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("forceRecovery", reinterpret_cast(this), 1); + fdb_probe_actor_exit("cancelAuditStorage", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< ForceRecoveryActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< CancelAuditStorageActor, 1, UID >*,Error err) { - fdb_probe_actor_enter("forceRecovery", reinterpret_cast(this), 1); - a_exitChoose1(); + fdb_probe_actor_enter("cancelAuditStorage", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1Catch1(err, 0); + a_body1Catch2(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("cancelAuditStorage", reinterpret_cast(this), 1); + + } + int a_body1cont5(int loopDepth) + { + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("forceRecovery", reinterpret_cast(this), 1); + return loopDepth; } - #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Reference clusterFile; - #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - Key dcId; - #line 2329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + AuditType type; + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + UID auditId; + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + double timeoutSeconds; + #line 2694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Reference>> clusterInterface; - #line 2330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Future leaderMon; - #line 20220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; -// This generated class is to be used only via forceRecovery() - #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class ForceRecoveryActor final : public Actor, public ActorCallback< ForceRecoveryActor, 0, Void >, public ActorCallback< ForceRecoveryActor, 1, Void >, public FastAllocated, public ForceRecoveryActorState { - #line 20225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via cancelAuditStorage() + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class CancelAuditStorageActor final : public Actor, public ActorCallback< CancelAuditStorageActor, 0, Void >, public ActorCallback< CancelAuditStorageActor, 1, UID >, public FastAllocated, public CancelAuditStorageActorState { + #line 22746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< ForceRecoveryActor, 0, Void >; -friend struct ActorCallback< ForceRecoveryActor, 1, Void >; - #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ForceRecoveryActor(Reference const& clusterFile,Key const& dcId) - #line 20237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - : Actor(), - ForceRecoveryActorState(clusterFile, dcId) - { - fdb_probe_actor_enter("forceRecovery", reinterpret_cast(this), -1); +friend struct ActorCallback< CancelAuditStorageActor, 0, Void >; +friend struct ActorCallback< CancelAuditStorageActor, 1, UID >; + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + CancelAuditStorageActor(Reference const& clusterFile,AuditType const& type,UID const& auditId,double const& timeoutSeconds) + #line 22758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + : Actor(), + CancelAuditStorageActorState(clusterFile, type, auditId, timeoutSeconds) + { + fdb_probe_actor_enter("cancelAuditStorage", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("forceRecovery"); + this->lineage.setActorName("cancelAuditStorage"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("forceRecovery", reinterpret_cast(this), -1); + fdb_probe_actor_exit("cancelAuditStorage", reinterpret_cast(this), -1); } void cancel() override @@ -20252,40 +22773,41 @@ friend struct ActorCallback< ForceRecoveryActor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ForceRecoveryActor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< CancelAuditStorageActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CancelAuditStorageActor, 1, UID >*)0, actor_cancelled()); break; } } }; } - #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -[[nodiscard]] Future forceRecovery( Reference const& clusterFile, Key const& dcId ) { - #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return Future(new ForceRecoveryActor(clusterFile, dcId)); - #line 20265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +[[nodiscard]] Future cancelAuditStorage( Reference const& clusterFile, AuditType const& type, UID const& auditId, double const& timeoutSeconds ) { + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new CancelAuditStorageActor(clusterFile, type, auditId, timeoutSeconds)); + #line 22787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 20270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { // This generated class is to be used only via waitForPrimaryDC() - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" template - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class WaitForPrimaryDCActorState { - #line 20277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" WaitForPrimaryDCActorState(Database const& cx,StringRef const& dcId) - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : cx(cx), - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" dcId(dcId), - #line 2346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr(cx) - #line 20288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { fdb_probe_actor_create("waitForPrimaryDC", reinterpret_cast(this)); @@ -20298,9 +22820,9 @@ class WaitForPrimaryDCActorState { int a_body1(int loopDepth=0) { try { - #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ; - #line 20303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -20329,18 +22851,18 @@ class WaitForPrimaryDCActorState { int a_body1loopBody1(int loopDepth) { try { - #line 2350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture> __when_expr_0 = tr.get(primaryDatacenterKey); - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 20343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -20360,16 +22882,16 @@ class WaitForPrimaryDCActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_3 = tr.onError(e); - #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 20367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 20372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -20382,60 +22904,60 @@ class WaitForPrimaryDCActorState { } int a_body1loopBody1cont2(Optional const& res,int loopDepth) { - #line 2352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (res.present() && res.get() == dcId) - #line 20387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitForPrimaryDCActorState(); static_cast(this)->destroy(); return 0; } - #line 20391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitForPrimaryDCActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" watchFuture = tr.watch(primaryDatacenterKey); - #line 2357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.commit(); - #line 2357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 20408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Optional && res,int loopDepth) { - #line 2352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (res.present() && res.get() == dcId) - #line 20417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitForPrimaryDCActorState(); static_cast(this)->destroy(); return 0; } - #line 20421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitForPrimaryDCActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" watchFuture = tr.watch(primaryDatacenterKey); - #line 2357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_1 = tr.commit(); - #line 2357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 20438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 22960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -20505,32 +23027,32 @@ class WaitForPrimaryDCActorState { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = watchFuture; - #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 20517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_2 = watchFuture; - #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 20533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -20600,18 +23122,18 @@ class WaitForPrimaryDCActorState { } int a_body1loopBody1cont5(Void const& _,int loopDepth) { - #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.reset(); - #line 20605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont7(loopDepth); return loopDepth; } int a_body1loopBody1cont5(Void && _,int loopDepth) { - #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" tr.reset(); - #line 20614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont7(loopDepth); return loopDepth; @@ -20767,20 +23289,20 @@ class WaitForPrimaryDCActorState { fdb_probe_actor_exit("waitForPrimaryDC", reinterpret_cast(this), 3); } - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Database cx; - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StringRef dcId; - #line 2346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ReadYourWritesTransaction tr; - #line 2356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" Future watchFuture; - #line 20778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; // This generated class is to be used only via waitForPrimaryDC() - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" class WaitForPrimaryDCActor final : public Actor, public ActorCallback< WaitForPrimaryDCActor, 0, Optional >, public ActorCallback< WaitForPrimaryDCActor, 1, Void >, public ActorCallback< WaitForPrimaryDCActor, 2, Void >, public ActorCallback< WaitForPrimaryDCActor, 3, Void >, public FastAllocated, public WaitForPrimaryDCActorState { - #line 20783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -20792,9 +23314,9 @@ friend struct ActorCallback< WaitForPrimaryDCActor, 0, Optional >; friend struct ActorCallback< WaitForPrimaryDCActor, 1, Void >; friend struct ActorCallback< WaitForPrimaryDCActor, 2, Void >; friend struct ActorCallback< WaitForPrimaryDCActor, 3, Void >; - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" WaitForPrimaryDCActor(Database const& cx,StringRef const& dcId) - #line 20797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), WaitForPrimaryDCActorState(cx, dcId) { @@ -20821,14 +23343,14 @@ friend struct ActorCallback< WaitForPrimaryDCActor, 3, Void >; } }; } - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" [[nodiscard]] Future waitForPrimaryDC( Database const& cx, StringRef const& dcId ) { - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" return Future(new WaitForPrimaryDCActor(cx, dcId)); - #line 20828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -#line 2365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 2743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" json_spirit::Value_type normJSONType(json_spirit::Value_type type) { if (type == json_spirit::int_type) @@ -21031,43 +23553,43 @@ std::string ManagementAPI::generateErrorMessage(const CoordinatorsResult& res) { return msg; } - #line 21034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase2567() - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -template - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class FlowTestCase2567ActorState { - #line 21041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via flowTestCase2945() + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +template + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class FlowTestCase2945ActorState { + #line 23563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - FlowTestCase2567ActorState(UnitTestParameters const& params) - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + FlowTestCase2945ActorState(UnitTestParameters const& params) + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" : params(params) - #line 21048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase2567", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase2945", reinterpret_cast(this)); } - ~FlowTestCase2567ActorState() + ~FlowTestCase2945ActorState() { - fdb_probe_actor_destroy("flowTestCase2567", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase2945", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 2568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" StrictFuture __when_expr_0 = Future(Void()); - #line 2568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 21065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 23587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 2568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 21070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 23592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -21080,190 +23602,190 @@ class FlowTestCase2567ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase2567ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase2945ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(Void const& _,int loopDepth) { - #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector workers; - #line 2571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector chosen; - #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::set excluded; - #line 2573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" AutoQuorumChange change(5); - #line 2575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(int i = 0;i < 10;i++) { - #line 2576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ProcessData data; - #line 2577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto dataCenter = std::to_string(i / 4 % 2); - #line 2578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto dataHall = dataCenter + std::to_string(i / 2 % 2); - #line 2579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto rack = dataHall + std::to_string(i % 2); - #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto machineId = rack + std::to_string(i); - #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - data.locality.set(LiteralStringRef("dcid"), StringRef(dataCenter)); - #line 2582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - data.locality.set(LiteralStringRef("data_hall"), StringRef(dataHall)); - #line 2583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - data.locality.set(LiteralStringRef("rack"), StringRef(rack)); - #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - data.locality.set(LiteralStringRef("zoneid"), StringRef(rack)); - #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - data.locality.set(LiteralStringRef("machineid"), StringRef(machineId)); - #line 2586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + data.locality.set("dcid"_sr, StringRef(dataCenter)); + #line 2960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + data.locality.set("data_hall"_sr, StringRef(dataHall)); + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + data.locality.set("rack"_sr, StringRef(rack)); + #line 2962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + data.locality.set("zoneid"_sr, StringRef(rack)); + #line 2963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + data.locality.set("machineid"_sr, StringRef(machineId)); + #line 2964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" data.address.ip = IPAddress(i); - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (g_network->isSimulated()) - #line 21125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - g_simulator.newProcess("TestCoordinator", data.address.ip, data.address.port, false, 1, data.locality, ProcessClass(ProcessClass::CoordinatorClass, ProcessClass::CommandLineSource), "", "", currentProtocolVersion); - #line 21129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + g_simulator->newProcess("TestCoordinator", data.address.ip, data.address.port, false, 1, data.locality, ProcessClass(ProcessClass::CoordinatorClass, ProcessClass::CommandLineSource), "", "", currentProtocolVersion(), false); + #line 23651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 2601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" workers.push_back(data); - #line 21133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 2604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto noAssignIndex = deterministicRandom()->randomInt(0, workers.size()); - #line 2605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" workers[noAssignIndex].processClass._class = ProcessClass::CoordinatorClass; - #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" change.addDesiredWorkers(chosen, workers, 5, excluded); - #line 2608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::map> chosenValues; - #line 2610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(chosen.size() == 5); - #line 2611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::vector fields({ LiteralStringRef("dcid"), LiteralStringRef("data_hall"), LiteralStringRef("zoneid"), LiteralStringRef("machineid") }); - #line 2615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::vector fields({ "dcid"_sr, "data_hall"_sr, "zoneid"_sr, "machineid"_sr }); + #line 2991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(auto worker = chosen.begin();worker != chosen.end();worker++) { - #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(worker->ip.toV4() < workers.size()); - #line 2617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" LocalityData data = workers[worker->ip.toV4()].locality; - #line 2618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(auto field = fields.begin();field != fields.end();field++) { - #line 2619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" chosenValues[*field].insert(data.get(*field).get()); - #line 21157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 2623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ASSERT(chosenValues[LiteralStringRef("dcid")].size() == 2); - #line 2624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ASSERT(chosenValues[LiteralStringRef("data_hall")].size() == 4); - #line 2625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ASSERT(chosenValues[LiteralStringRef("zoneid")].size() == 5); - #line 2626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ASSERT(chosenValues[LiteralStringRef("machineid")].size() == 5); - #line 2627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(chosenValues["dcid"_sr].size() == 2); + #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(chosenValues["data_hall"_sr].size() == 4); + #line 3001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(chosenValues["zoneid"_sr].size() == 5); + #line 3002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(chosenValues["machineid"_sr].size() == 5); + #line 3003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(std::find(chosen.begin(), chosen.end(), workers[noAssignIndex].address) != chosen.end()); - #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase2567ActorState(); static_cast(this)->destroy(); return 0; } - #line 21172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase2567ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase2945ActorState(); static_cast(this)->destroy(); return 0; } + #line 23694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase2945ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector workers; - #line 2571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::vector chosen; - #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::set excluded; - #line 2573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" AutoQuorumChange change(5); - #line 2575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(int i = 0;i < 10;i++) { - #line 2576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ProcessData data; - #line 2577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto dataCenter = std::to_string(i / 4 % 2); - #line 2578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto dataHall = dataCenter + std::to_string(i / 2 % 2); - #line 2579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto rack = dataHall + std::to_string(i % 2); - #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto machineId = rack + std::to_string(i); - #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - data.locality.set(LiteralStringRef("dcid"), StringRef(dataCenter)); - #line 2582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - data.locality.set(LiteralStringRef("data_hall"), StringRef(dataHall)); - #line 2583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - data.locality.set(LiteralStringRef("rack"), StringRef(rack)); - #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - data.locality.set(LiteralStringRef("zoneid"), StringRef(rack)); - #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - data.locality.set(LiteralStringRef("machineid"), StringRef(machineId)); - #line 2586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + data.locality.set("dcid"_sr, StringRef(dataCenter)); + #line 2960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + data.locality.set("data_hall"_sr, StringRef(dataHall)); + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + data.locality.set("rack"_sr, StringRef(rack)); + #line 2962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + data.locality.set("zoneid"_sr, StringRef(rack)); + #line 2963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + data.locality.set("machineid"_sr, StringRef(machineId)); + #line 2964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" data.address.ip = IPAddress(i); - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" if (g_network->isSimulated()) - #line 21216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" { - #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - g_simulator.newProcess("TestCoordinator", data.address.ip, data.address.port, false, 1, data.locality, ProcessClass(ProcessClass::CoordinatorClass, ProcessClass::CommandLineSource), "", "", currentProtocolVersion); - #line 21220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + g_simulator->newProcess("TestCoordinator", data.address.ip, data.address.port, false, 1, data.locality, ProcessClass(ProcessClass::CoordinatorClass, ProcessClass::CommandLineSource), "", "", currentProtocolVersion(), false); + #line 23742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 2601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" workers.push_back(data); - #line 21224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } - #line 2604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" auto noAssignIndex = deterministicRandom()->randomInt(0, workers.size()); - #line 2605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" workers[noAssignIndex].processClass._class = ProcessClass::CoordinatorClass; - #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" change.addDesiredWorkers(chosen, workers, 5, excluded); - #line 2608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" std::map> chosenValues; - #line 2610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(chosen.size() == 5); - #line 2611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - std::vector fields({ LiteralStringRef("dcid"), LiteralStringRef("data_hall"), LiteralStringRef("zoneid"), LiteralStringRef("machineid") }); - #line 2615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + std::vector fields({ "dcid"_sr, "data_hall"_sr, "zoneid"_sr, "machineid"_sr }); + #line 2991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(auto worker = chosen.begin();worker != chosen.end();worker++) { - #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(worker->ip.toV4() < workers.size()); - #line 2617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" LocalityData data = workers[worker->ip.toV4()].locality; - #line 2618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" for(auto field = fields.begin();field != fields.end();field++) { - #line 2619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" chosenValues[*field].insert(data.get(*field).get()); - #line 21248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } } - #line 2623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ASSERT(chosenValues[LiteralStringRef("dcid")].size() == 2); - #line 2624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ASSERT(chosenValues[LiteralStringRef("data_hall")].size() == 4); - #line 2625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ASSERT(chosenValues[LiteralStringRef("zoneid")].size() == 5); - #line 2626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - ASSERT(chosenValues[LiteralStringRef("machineid")].size() == 5); - #line 2627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(chosenValues["dcid"_sr].size() == 2); + #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(chosenValues["data_hall"_sr].size() == 4); + #line 3001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(chosenValues["zoneid"_sr].size() == 5); + #line 3002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + ASSERT(chosenValues["machineid"_sr].size() == 5); + #line 3003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" ASSERT(std::find(chosen.begin(), chosen.end(), workers[noAssignIndex].address) != chosen.end()); - #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase2567ActorState(); static_cast(this)->destroy(); return 0; } - #line 21263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase2567ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase2945ActorState(); static_cast(this)->destroy(); return 0; } + #line 23785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase2945ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -21282,13 +23804,13 @@ class FlowTestCase2567ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase2567Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase2945Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase2567Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase2945Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase2567", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase2945", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -21298,12 +23820,12 @@ class FlowTestCase2567ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2567", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase2945", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase2567Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase2945Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase2567", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase2945", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -21313,12 +23835,12 @@ class FlowTestCase2567ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2567", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase2945", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase2567Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase2945Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase2567", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase2945", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -21328,38 +23850,38 @@ class FlowTestCase2567ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2567", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase2945", reinterpret_cast(this), 0); } - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" UnitTestParameters params; - #line 21336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 23858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase2567() - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -class FlowTestCase2567Actor final : public Actor, public ActorCallback< FlowTestCase2567Actor, 0, Void >, public FastAllocated, public FlowTestCase2567ActorState { - #line 21341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +// This generated class is to be used only via flowTestCase2945() + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +class FlowTestCase2945Actor final : public Actor, public ActorCallback< FlowTestCase2945Actor, 0, Void >, public FastAllocated, public FlowTestCase2945ActorState { + #line 23863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase2567Actor, 0, Void >; - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - FlowTestCase2567Actor(UnitTestParameters const& params) - #line 21352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" +friend struct ActorCallback< FlowTestCase2945Actor, 0, Void >; + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + FlowTestCase2945Actor(UnitTestParameters const& params) + #line 23874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" : Actor(), - FlowTestCase2567ActorState(params) + FlowTestCase2945ActorState(params) { - fdb_probe_actor_enter("flowTestCase2567", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase2945", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase2567"); + this->lineage.setActorName("flowTestCase2945"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase2567", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase2945", reinterpret_cast(this), -1); } void cancel() override @@ -21367,18 +23889,18 @@ friend struct ActorCallback< FlowTestCase2567Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase2567Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase2945Actor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" -static Future flowTestCase2567( UnitTestParameters const& params ) { - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" - return Future(new FlowTestCase2567Actor(params)); - #line 21380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +static Future flowTestCase2945( UnitTestParameters const& params ) { + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" + return Future(new FlowTestCase2945Actor(params)); + #line 23902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase2567, "/ManagementAPI/AutoQuorumChange/checkLocality") +ACTOR_TEST_CASE(flowTestCase2945, "/ManagementAPI/AutoQuorumChange/checkLocality") -#line 2631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" +#line 3007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.cpp" diff --git a/src/fdbclient/MetaclusterRegistration.cpp b/src/fdbclient/MetaclusterRegistration.cpp new file mode 100644 index 0000000..728a640 --- /dev/null +++ b/src/fdbclient/MetaclusterRegistration.cpp @@ -0,0 +1,40 @@ +/* + * MetaclusterRegistration.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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. + */ + +#include "fdbclient/MetaclusterRegistration.h" + +std::string clusterTypeToString(const ClusterType& clusterType) { + switch (clusterType) { + case ClusterType::STANDALONE: + return "standalone"; + case ClusterType::METACLUSTER_MANAGEMENT: + return "metacluster_management"; + case ClusterType::METACLUSTER_DATA: + return "metacluster_data"; + default: + return "unknown"; + } +} +KeyBackedObjectProperty& +metacluster::metadata::metaclusterRegistration() { + static KeyBackedObjectProperty instance( + "\xff/metacluster/clusterRegistration"_sr, IncludeVersion()); + return instance; +} diff --git a/src/fdbclient/MonitorLeader.actor.cpp b/src/fdbclient/MonitorLeader.actor.cpp index 67b1412..e1b72c9 100644 --- a/src/fdbclient/MonitorLeader.actor.cpp +++ b/src/fdbclient/MonitorLeader.actor.cpp @@ -26,6 +26,7 @@ #include "flow/UnitTest.h" #include "fdbrpc/genericactors.actor.h" #include "flow/Platform.h" +#include "flow/IConnection.h" #include "flow/actorcompiler.h" // has to be last include namespace { @@ -50,8 +51,6 @@ std::string trim(std::string const& connectionString) { } // namespace -FDB_DEFINE_BOOLEAN_PARAM(ConnectionStringNeedsPersisted); - // Returns the connection string currently held in this object. This may not match the stored record if it hasn't // been persisted or if the persistent storage for the record has been modified externally. ClusterConnectionString& IClusterConnectionRecord::getConnectionString() { @@ -248,7 +247,7 @@ TEST_CASE("/fdbclient/MonitorLeader/ConnectionString/hostname") { hostnames.push_back(Hostname::parse(hn1 + ":" + port1)); hostnames.push_back(Hostname::parse(hn2 + ":" + port2)); - ClusterConnectionString cs(hostnames, LiteralStringRef("TestCluster:0")); + ClusterConnectionString cs(hostnames, "TestCluster:0"_sr); ASSERT(cs.hostnames.size() == 2); ASSERT(cs.coords.size() == 0); ASSERT(cs.toString() == connectionString); @@ -259,7 +258,7 @@ TEST_CASE("/fdbclient/MonitorLeader/ConnectionString/hostname") { hostnames.push_back(Hostname::parse(hn1 + ":" + port1)); hostnames.push_back(Hostname::parse(hn1 + ":" + port1)); try { - ClusterConnectionString cs(hostnames, LiteralStringRef("TestCluster:0")); + ClusterConnectionString cs(hostnames, "TestCluster:0"_sr); } catch (Error& e) { ASSERT(e.code() == error_code_connection_string_invalid); } @@ -367,7 +366,7 @@ TEST_CASE("/fdbclient/MonitorLeader/parseConnectionString/fuzz") { auto c = connectionString.begin(); while (c != connectionString.end()) { if (deterministicRandom()->random01() < 0.1) // Add whitespace character - output += deterministicRandom()->randomChoice(LiteralStringRef(" \t\n\r")); + output += deterministicRandom()->randomChoice(" \t\n\r"_sr); if (deterministicRandom()->random01() < 0.5) { // Add one of the input characters output += *c; ++c; @@ -376,9 +375,9 @@ TEST_CASE("/fdbclient/MonitorLeader/parseConnectionString/fuzz") { output += "#"; int charCount = deterministicRandom()->randomInt(0, 20); for (int i = 0; i < charCount; i++) { - output += deterministicRandom()->randomChoice(LiteralStringRef("asdfzxcv123345:!@#$#$&()<\"\' \t")); + output += deterministicRandom()->randomChoice("asdfzxcv123345:!@#$#$&()<\"\' \t"_sr); } - output += deterministicRandom()->randomChoice(LiteralStringRef("\n\r")); + output += deterministicRandom()->randomChoice("\n\r"_sr); } } @@ -485,6 +484,14 @@ ClientLeaderRegInterface::ClientLeaderRegInterface(INetwork* local) { TaskPriority::Coordination); } +std::string ClientLeaderRegInterface::getAddressString() const { + if (hostname.present()) { + return hostname.get().toString(); + } else { + return getLeader.getEndpoint().getPrimaryAddress().toString(); + } +} + // Nominee is the worker among all workers that are considered as leader by one coordinator // This function contacts a coordinator coord to ask who is its nominee. ACTOR Future monitorNominee(Key key, @@ -493,6 +500,7 @@ ACTOR Future monitorNominee(Key key, Optional* info) { loop { state Optional li; + wait(Future(Void())); // Make sure we weren't cancelled if (coord.hostname.present()) { wait(store(li, retryGetReplyFromHostname(GetLeaderRequest(key, info->present() ? info->get().changeID : UID()), @@ -510,9 +518,7 @@ ACTOR Future monitorNominee(Key key, TraceEvent("GetLeaderReply") .suppressFor(1.0) - .detail("Coordinator", - coord.hostname.present() ? coord.hostname.get().toString() - : coord.getLeader.getEndpoint().getPrimaryAddress().toString()) + .detail("Coordinator", coord.getAddressString()) .detail("Nominee", li.present() ? li.get().changeID : UID()) .detail("ClusterKey", key.printable()); @@ -581,6 +587,7 @@ ACTOR Future monitorLeaderOneGeneration(Reference> nominees; state Future allActors; + state Optional> leader; nominees.resize(coordinators.clientLeaderServers.size()); @@ -594,7 +601,7 @@ ACTOR Future monitorLeaderOneGeneration(Reference> leader = getLeader(nominees); + leader = getLeader(nominees); TraceEvent("MonitorLeaderChange") .detail("NewLeader", leader.present() ? leader.get().first.changeID : UID(1, 1)); if (leader.present()) { @@ -615,7 +622,7 @@ ACTOR Future monitorLeaderOneGeneration(ReferencegetConnectionString().toString()); } - connRecord->setAndPersistConnectionString(info.intermediateConnRecord->getConnectionString()); + wait(connRecord->setAndPersistConnectionString(info.intermediateConnRecord->getConnectionString())); info.intermediateConnRecord = connRecord; } @@ -658,69 +665,43 @@ ACTOR Future asyncDeserializeClusterInterface(Reference> s } } -struct ClientStatusStats { - int count; - std::vector> examples; +namespace { - ClientStatusStats() : count(0) { examples.reserve(CLIENT_KNOBS->CLIENT_EXAMPLE_AMOUNT); } -}; +void tryInsertIntoSamples(OpenDatabaseRequest::Samples& samples, + const NetworkAddress& networkAddress, + const Key& traceLogGroup) { + ++samples.count; + if (samples.samples.size() < static_cast(CLIENT_KNOBS->CLIENT_EXAMPLE_AMOUNT)) { + samples.samples.insert({ networkAddress, traceLogGroup }); + } +} + +} // namespace OpenDatabaseRequest ClientData::getRequest() { OpenDatabaseRequest req; - std::map issueMap; - std::map versionMap; - std::map maxProtocolMap; - int clientCount = 0; - - // SOMEDAY: add a yield in this loop for (auto& ci : clientStatusInfoMap) { - for (auto& it : ci.second.issues) { - auto& entry = issueMap[it]; - entry.count++; - if (entry.examples.size() < CLIENT_KNOBS->CLIENT_EXAMPLE_AMOUNT) { - entry.examples.emplace_back(ci.first, ci.second.traceLogGroup); - } + const auto& networkAddress = ci.first; + const auto& traceLogGroup = ci.second.traceLogGroup; + + for (auto& issue : ci.second.issues) { + tryInsertIntoSamples(req.issues[issue], networkAddress, traceLogGroup); } - if (ci.second.versions.size()) { - clientCount++; - StringRef maxProtocol; - for (auto& it : ci.second.versions) { - maxProtocol = std::max(maxProtocol, it.protocolVersion); - auto& entry = versionMap[it]; - entry.count++; - if (entry.examples.size() < CLIENT_KNOBS->CLIENT_EXAMPLE_AMOUNT) { - entry.examples.emplace_back(ci.first, ci.second.traceLogGroup); - } - } - auto& maxEntry = maxProtocolMap[maxProtocol]; - maxEntry.count++; - if (maxEntry.examples.size() < CLIENT_KNOBS->CLIENT_EXAMPLE_AMOUNT) { - maxEntry.examples.emplace_back(ci.first, ci.second.traceLogGroup); - } - } else { - auto& entry = versionMap[ClientVersionRef()]; - entry.count++; - if (entry.examples.size() < CLIENT_KNOBS->CLIENT_EXAMPLE_AMOUNT) { - entry.examples.emplace_back(ci.first, ci.second.traceLogGroup); - } + + if (!ci.second.versions.size()) { + tryInsertIntoSamples(req.supportedVersions[ClientVersionRef()], networkAddress, traceLogGroup); + continue; } - } - req.issues.reserve(issueMap.size()); - for (auto& it : issueMap) { - req.issues.push_back(ItemWithExamples(it.first, it.second.count, it.second.examples)); - } - req.supportedVersions.reserve(versionMap.size()); - for (auto& it : versionMap) { - req.supportedVersions.push_back( - ItemWithExamples>(it.first, it.second.count, it.second.examples)); - } - req.maxProtocolSupported.reserve(maxProtocolMap.size()); - for (auto& it : maxProtocolMap) { - req.maxProtocolSupported.push_back(ItemWithExamples(it.first, it.second.count, it.second.examples)); + ++req.clientCount; + StringRef maxProtocol; + for (auto& it : ci.second.versions) { + maxProtocol = std::max(maxProtocol, it.protocolVersion); + tryInsertIntoSamples(req.supportedVersions[it], networkAddress, traceLogGroup); + } + tryInsertIntoSamples(req.maxProtocolSupported[maxProtocol], networkAddress, traceLogGroup); } - req.clientCount = clientCount; return req; } @@ -874,6 +855,7 @@ ACTOR Future monitorProxiesOneGeneration( state std::vector lastGrvProxyUIDs; state std::vector lastGrvProxies; state std::vector clientLeaderServers; + state bool allConnectionsFailed = false; clientLeaderServers.reserve(coordinatorsSize); for (const auto& h : cs.hostnames) { @@ -882,6 +864,7 @@ ACTOR Future monitorProxiesOneGeneration( for (const auto& c : cs.coords) { clientLeaderServers.push_back(ClientLeaderRegInterface(c)); } + ASSERT(clientLeaderServers.size() > 0); deterministicRandom()->randomShuffle(clientLeaderServers); @@ -900,8 +883,23 @@ ACTOR Future monitorProxiesOneGeneration( state ClusterConnectionString storedConnectionString; if (connRecord) { bool upToDate = wait(connRecord->upToDate(storedConnectionString)); - if (!upToDate) { - req.issues.push_back_deep(req.issues.arena(), LiteralStringRef("incorrect_cluster_file_contents")); + if (upToDate) { + incorrectTime = Optional(); + } else if (allConnectionsFailed && storedConnectionString.getNumberOfCoordinators() > 0) { + // Failed to connect to all coordinators from the current connection string, + // so it is not possible to get any new updates from the cluster. It can be that + // all the coordinators have changed, but the client missed that, because it had + // an incompatible protocol version. Since the cluster file is different, + // it may have been updated by other clients. + TraceEvent("UpdatingConnectionStringFromFile") + .detail("ClusterFile", connRecord->toString()) + .detail("StoredConnectionString", storedConnectionString.toString()) + .detail("CurrentConnectionString", connRecord->getConnectionString().toString()); + wait(connRecord->setAndPersistConnectionString(storedConnectionString)); + info.intermediateConnRecord = connRecord; + return info; + } else { + req.issues.push_back_deep(req.issues.arena(), "incorrect_cluster_file_contents"_sr); std::string connectionString = connRecord->getConnectionString().toString(); if (!incorrectTime.present()) { incorrectTime = now(); @@ -913,8 +911,6 @@ ACTOR Future monitorProxiesOneGeneration( .detail("ClusterFile", connRecord->toString()) .detail("StoredConnectionString", storedConnectionString.toString()) .detail("CurrentConnectionString", connectionString); - } else { - incorrectTime = Optional(); } } else { incorrectTime = Optional(); @@ -947,6 +943,7 @@ ACTOR Future monitorProxiesOneGeneration( .detail("OldConnStr", info.intermediateConnRecord->getConnectionString().toString()); info.intermediateConnRecord = connRecord->makeIntermediateRecord( ClusterConnectionString(rep.get().read().forward.get().toString())); + ASSERT(info.intermediateConnRecord->getConnectionString().getNumberOfCoordinators() > 0); return info; } if (connRecord != info.intermediateConnRecord) { @@ -957,7 +954,7 @@ ACTOR Future monitorProxiesOneGeneration( .detail("CurrentConnectionString", info.intermediateConnRecord->getConnectionString().toString()); } - connRecord->setAndPersistConnectionString(info.intermediateConnRecord->getConnectionString()); + wait(connRecord->setAndPersistConnectionString(info.intermediateConnRecord->getConnectionString())); info.intermediateConnRecord = connRecord; } @@ -968,11 +965,16 @@ ACTOR Future monitorProxiesOneGeneration( shrinkProxyList(ni, lastCommitProxyUIDs, lastCommitProxies, lastGrvProxyUIDs, lastGrvProxies); clientInfo->setUnconditional(ni); successIndex = index; + allConnectionsFailed = false; } else { - TEST(rep.getError().code() == error_code_failed_to_progress); // Coordinator cant talk to cluster controller - TEST(rep.getError().code() == error_code_lookup_failed); // Coordinator hostname resolving failure + CODE_PROBE(rep.getError().code() == error_code_failed_to_progress, + "Coordinator cannot talk to cluster controller"); + TraceEvent("MonitorProxiesConnectFailed") + .detail("Error", rep.getError().name()) + .detail("Coordinator", clientLeaderServer.getAddressString()); index = (index + 1) % coordinatorsSize; if (index == successIndex) { + allConnectionsFailed = true; wait(delay(CLIENT_KNOBS->COORDINATOR_RECONNECTION_DELAY)); } } @@ -988,6 +990,7 @@ ACTOR Future monitorProxies( IsInternal internal) { state MonitorLeaderInfo info(connRecord->get()); loop { + ASSERT(connRecord->get().isValid()); choose { when(MonitorLeaderInfo _info = wait(monitorProxiesOneGeneration( connRecord->get(), clientInfo, coordinator, info, supportedVersions, traceLogGroup, internal))) { diff --git a/src/fdbclient/MonitorLeader.actor.g.cpp b/src/fdbclient/MonitorLeader.actor.g.cpp index 82e378d..b415627 100644 --- a/src/fdbclient/MonitorLeader.actor.g.cpp +++ b/src/fdbclient/MonitorLeader.actor.g.cpp @@ -28,6 +28,7 @@ #include "flow/UnitTest.h" #include "fdbrpc/genericactors.actor.h" #include "flow/Platform.h" +#include "flow/IConnection.h" #include "flow/actorcompiler.h" // has to be last include namespace { @@ -52,8 +53,6 @@ std::string trim(std::string const& connectionString) { } // namespace -FDB_DEFINE_BOOLEAN_PARAM(ConnectionStringNeedsPersisted); - // Returns the connection string currently held in this object. This may not match the stored record if it hasn't // been persisted or if the persistent storage for the record has been modified externally. ClusterConnectionString& IClusterConnectionRecord::getConnectionString() { @@ -128,52 +127,52 @@ ClusterConnectionString::ClusterConnectionString(const std::string& connectionSt ASSERT((coords.size() + hostnames.size()) > 0); } - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase129() - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -template - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class FlowTestCase129ActorState { - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" +// This generated class is to be used only via flowTestCase128() + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +template + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class FlowTestCase128ActorState { + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - FlowTestCase129ActorState(UnitTestParameters const& params) - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + FlowTestCase128ActorState(UnitTestParameters const& params) + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : params(params), - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" input() - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase129", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase128", reinterpret_cast(this)); } - ~FlowTestCase129ActorState() + ~FlowTestCase128ActorState() { - fdb_probe_actor_destroy("flowTestCase129", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase128", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { { - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" input = "asdf:2345@1.1.1.1:345"; - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString cs(input); - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(input == cs.toString()); - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } { - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" input = "asdf:2345@1.1.1.1:345,1.1.1.1:345"; - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" try { - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString cs(input); - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1cont5(loopDepth); } catch (Error& error) { @@ -193,8 +192,8 @@ class FlowTestCase129ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase129ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase128ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; @@ -202,71 +201,71 @@ class FlowTestCase129ActorState { int a_body1cont1(int loopDepth) { { - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" input = "0xxdeadbeef:100100100@1.1.1.1:34534,5.1.5.3:23443"; - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString cs(input); - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(input == cs.toString()); - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } { - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" input = "0xxdeadbeef:100100100@1.1.1.1:34534,5.1.5.3:23443"; - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string commented("#start of comment\n"); - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += input; - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += "\n"; - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += "# asdfasdf ##"; - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString cs(commented); - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(input == cs.toString()); - #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } { - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" input = "0xxdeadbeef:100100100@[::1]:1234,[::1]:1235"; - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string commented("#start of comment\n"); - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += input; - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += "\n"; - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += "# asdfasdf ##"; - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString cs(commented); - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(input == cs.toString()); - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } { - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" input = "0xxdeadbeef:100100100@[abcd:dcba::1]:1234,[abcd:dcba::abcd:1]:1234"; - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string commented("#start of comment\n"); - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += input; - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += "\n"; - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += "# asdfasdf ##"; - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString cs(commented); - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(input == cs.toString()); - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - } - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase129ActorState(); static_cast(this)->destroy(); return 0; } - #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase129ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + } + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase128ActorState(); static_cast(this)->destroy(); return 0; } + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase128ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -280,9 +279,9 @@ class FlowTestCase129ActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(e.code() == error_code_connection_string_invalid); - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); } catch (Error& error) { @@ -306,36 +305,36 @@ class FlowTestCase129ActorState { return loopDepth; } - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" UnitTestParameters params; - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string input; - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase129() - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class FlowTestCase129Actor final : public Actor, public FastAllocated, public FlowTestCase129ActorState { - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" +// This generated class is to be used only via flowTestCase128() + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class FlowTestCase128Actor final : public Actor, public FastAllocated, public FlowTestCase128ActorState { + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - FlowTestCase129Actor(UnitTestParameters const& params) - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + FlowTestCase128Actor(UnitTestParameters const& params) + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor(), - FlowTestCase129ActorState(params) + FlowTestCase128ActorState(params) { - fdb_probe_actor_enter("flowTestCase129", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase128", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase129"); + this->lineage.setActorName("flowTestCase128"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase129", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase128", reinterpret_cast(this), -1); } void cancel() override @@ -348,64 +347,64 @@ class FlowTestCase129Actor final : public Actor, public FastAllocated flowTestCase129( UnitTestParameters const& params ) { - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - return Future(new FlowTestCase129Actor(params)); - #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +static Future flowTestCase128( UnitTestParameters const& params ) { + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + return Future(new FlowTestCase128Actor(params)); + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase129, "/fdbclient/MonitorLeader/parseConnectionString/addresses") +ACTOR_TEST_CASE(flowTestCase128, "/fdbclient/MonitorLeader/parseConnectionString/addresses") -#line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase189() - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -template - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class FlowTestCase189ActorState { - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" +// This generated class is to be used only via flowTestCase188() + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +template + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class FlowTestCase188ActorState { + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - FlowTestCase189ActorState(UnitTestParameters const& params) - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + FlowTestCase188ActorState(UnitTestParameters const& params) + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : params(params), - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" input() - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase189", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase188", reinterpret_cast(this)); } - ~FlowTestCase189ActorState() + ~FlowTestCase188ActorState() { - fdb_probe_actor_destroy("flowTestCase189", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase188", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { { - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" input = "asdf:2345@localhost:1234"; - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString cs(input); - #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(cs.hostnames.size() == 1); - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(input == cs.toString()); - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } { - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" input = "asdf:2345@localhost:1234,localhost:1234"; - #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" try { - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString cs(input); - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1cont5(loopDepth); } catch (Error& error) { @@ -425,8 +424,8 @@ class FlowTestCase189ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase189ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase188ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; @@ -434,60 +433,60 @@ class FlowTestCase189ActorState { int a_body1cont1(int loopDepth) { { - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" input = "0xxdeadbeef:100100100@localhost:34534,host-name:23443"; - #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString cs(input); - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(cs.hostnames.size() == 2); - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(input == cs.toString()); - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } { - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" input = "0xxdeadbeef:100100100@localhost:34534,host-name:23443"; - #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string commented("#start of comment\n"); - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += input; - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += "\n"; - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += "# asdfasdf ##"; - #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString cs(commented); - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(cs.hostnames.size() == 2); - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(input == cs.toString()); - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } { - #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" input = "0xxdeadbeef:100100100@localhost:34534,host-name_part1.host-name_part2:1234:tls"; - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string commented("#start of comment\n"); - #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += input; - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += "\n"; - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" commented += "# asdfasdf ##"; - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString cs(commented); - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(cs.hostnames.size() == 2); - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(input == cs.toString()); - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - } - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase189ActorState(); static_cast(this)->destroy(); return 0; } - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase189ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + } + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase188ActorState(); static_cast(this)->destroy(); return 0; } + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase188ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -501,9 +500,9 @@ class FlowTestCase189ActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(e.code() == error_code_connection_string_invalid); - #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); } catch (Error& error) { @@ -527,36 +526,36 @@ class FlowTestCase189ActorState { return loopDepth; } - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" UnitTestParameters params; - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string input; - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase189() - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class FlowTestCase189Actor final : public Actor, public FastAllocated, public FlowTestCase189ActorState { - #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" +// This generated class is to be used only via flowTestCase188() + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class FlowTestCase188Actor final : public Actor, public FastAllocated, public FlowTestCase188ActorState { + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - FlowTestCase189Actor(UnitTestParameters const& params) - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + FlowTestCase188Actor(UnitTestParameters const& params) + #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor(), - FlowTestCase189ActorState(params) + FlowTestCase188ActorState(params) { - fdb_probe_actor_enter("flowTestCase189", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase188", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase189"); + this->lineage.setActorName("flowTestCase188"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase189", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase188", reinterpret_cast(this), -1); } void cancel() override @@ -569,77 +568,77 @@ class FlowTestCase189Actor final : public Actor, public FastAllocated flowTestCase189( UnitTestParameters const& params ) { - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - return Future(new FlowTestCase189Actor(params)); - #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +static Future flowTestCase188( UnitTestParameters const& params ) { + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + return Future(new FlowTestCase188Actor(params)); + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase189, "/fdbclient/MonitorLeader/parseConnectionString/hostnames") +ACTOR_TEST_CASE(flowTestCase188, "/fdbclient/MonitorLeader/parseConnectionString/hostnames") -#line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase242() - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -template - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class FlowTestCase242ActorState { - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" +// This generated class is to be used only via flowTestCase241() + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +template + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class FlowTestCase241ActorState { + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - FlowTestCase242ActorState(UnitTestParameters const& params) - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + FlowTestCase241ActorState(UnitTestParameters const& params) + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : params(params) - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase242", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase241", reinterpret_cast(this)); } - ~FlowTestCase242ActorState() + ~FlowTestCase241ActorState() { - fdb_probe_actor_destroy("flowTestCase242", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase241", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string connectionString = "TestCluster:0@localhost:1234,host-name:5678"; - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string hn1 = "localhost", port1 = "1234", hn2 = "host-name", port2 = "5678"; - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector hostnames; - #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" hostnames.push_back(Hostname::parse(hn1 + ":" + port1)); - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" hostnames.push_back(Hostname::parse(hn2 + ":" + port2)); + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + ClusterConnectionString cs(hostnames, "TestCluster:0"_sr); #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - ClusterConnectionString cs(hostnames, LiteralStringRef("TestCluster:0")); - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(cs.hostnames.size() == 2); - #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(cs.coords.size() == 0); - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(cs.toString() == connectionString); - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } { - #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" hostnames.clear(); - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" hostnames.push_back(Hostname::parse(hn1 + ":" + port1)); - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" hostnames.push_back(Hostname::parse(hn1 + ":" + port1)); - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" try { - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - ClusterConnectionString cs(hostnames, LiteralStringRef("TestCluster:0")); - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + ClusterConnectionString cs(hostnames, "TestCluster:0"_sr); + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1cont5(loopDepth); } catch (Error& error) { @@ -659,20 +658,20 @@ class FlowTestCase242ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase242ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase241ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase242ActorState(); static_cast(this)->destroy(); return 0; } - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase242ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase241ActorState(); static_cast(this)->destroy(); return 0; } + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase241ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -686,9 +685,9 @@ class FlowTestCase242ActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(e.code() == error_code_connection_string_invalid); - #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); } catch (Error& error) { @@ -712,34 +711,34 @@ class FlowTestCase242ActorState { return loopDepth; } - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" UnitTestParameters params; - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase242() - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class FlowTestCase242Actor final : public Actor, public FastAllocated, public FlowTestCase242ActorState { - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" +// This generated class is to be used only via flowTestCase241() + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class FlowTestCase241Actor final : public Actor, public FastAllocated, public FlowTestCase241ActorState { + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - FlowTestCase242Actor(UnitTestParameters const& params) - #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + FlowTestCase241Actor(UnitTestParameters const& params) + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor(), - FlowTestCase242ActorState(params) + FlowTestCase241ActorState(params) { - fdb_probe_actor_enter("flowTestCase242", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase241", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase242"); + this->lineage.setActorName("flowTestCase241"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase242", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase241", reinterpret_cast(this), -1); } void cancel() override @@ -752,33 +751,33 @@ class FlowTestCase242Actor final : public Actor, public FastAllocated flowTestCase242( UnitTestParameters const& params ) { - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - return Future(new FlowTestCase242Actor(params)); - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +static Future flowTestCase241( UnitTestParameters const& params ) { + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + return Future(new FlowTestCase241Actor(params)); + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase242, "/fdbclient/MonitorLeader/ConnectionString/hostname") +ACTOR_TEST_CASE(flowTestCase241, "/fdbclient/MonitorLeader/ConnectionString/hostname") -#line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" namespace { // This generated class is to be used only via tryResolveHostnamesImpl() - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" template - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class TryResolveHostnamesImplActorState { - #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" TryResolveHostnamesImplActorState(ClusterConnectionString* const& self) - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : self(self), - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" allCoordinatorsSet() - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { fdb_probe_actor_create("tryResolveHostnamesImpl", reinterpret_cast(this)); @@ -791,30 +790,30 @@ class TryResolveHostnamesImplActorState { int a_body1(int loopDepth=0) { try { - #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" for( const auto& coord : self->coords ) { - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" allCoordinatorsSet.insert(coord); - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector> fs; - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" for( auto& hostname : self->hostnames ) { - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" fs.push_back(map(hostname.resolve(), [&](Optional const& addr) -> Void { if (addr.present()) { allCoordinatorsSet.insert(addr.get()); } return Void(); })); - #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" StrictFuture __when_expr_0 = waitForAll(fs); - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -835,13 +834,13 @@ class TryResolveHostnamesImplActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector allCoordinators(allCoordinatorsSet.begin(), allCoordinatorsSet.end()); - #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::sort(allCoordinators.begin(), allCoordinators.end()); - #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(allCoordinators); this->~TryResolveHostnamesImplActorState(); static_cast(this)->destroy(); return 0; } - #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(allCoordinators); this->~TryResolveHostnamesImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -851,13 +850,13 @@ class TryResolveHostnamesImplActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector allCoordinators(allCoordinatorsSet.begin(), allCoordinatorsSet.end()); - #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::sort(allCoordinators.begin(), allCoordinators.end()); - #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(allCoordinators); this->~TryResolveHostnamesImplActorState(); static_cast(this)->destroy(); return 0; } - #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(allCoordinators); this->~TryResolveHostnamesImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -928,16 +927,16 @@ class TryResolveHostnamesImplActorState { fdb_probe_actor_exit("tryResolveHostnamesImpl", reinterpret_cast(this), 0); } - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString* self; - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::set allCoordinatorsSet; - #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; // This generated class is to be used only via tryResolveHostnamesImpl() - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class TryResolveHostnamesImplActor final : public Actor>, public ActorCallback< TryResolveHostnamesImplActor, 0, Void >, public FastAllocated, public TryResolveHostnamesImplActorState { - #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -946,9 +945,9 @@ class TryResolveHostnamesImplActor final : public Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< TryResolveHostnamesImplActor, 0, Void >; - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" TryResolveHostnamesImplActor(ClusterConnectionString* const& self) - #line 951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor>(), TryResolveHostnamesImplActorState(self) { @@ -972,66 +971,66 @@ friend struct ActorCallback< TryResolveHostnamesImplActor, 0, Void >; } }; } - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" [[nodiscard]] Future> tryResolveHostnamesImpl( ClusterConnectionString* const& self ) { - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" return Future>(new TryResolveHostnamesImplActor(self)); - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -#line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Future> ClusterConnectionString::tryResolveHostnames() { return tryResolveHostnamesImpl(this); } - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase295() - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -template - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class FlowTestCase295ActorState { - #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" +// This generated class is to be used only via flowTestCase294() + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +template + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class FlowTestCase294ActorState { + #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - FlowTestCase295ActorState(UnitTestParameters const& params) - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + FlowTestCase294ActorState(UnitTestParameters const& params) + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : params(params) - #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase295", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase294", reinterpret_cast(this)); } - ~FlowTestCase295ActorState() + ~FlowTestCase294ActorState() { - fdb_probe_actor_destroy("flowTestCase295", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase294", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string connectionString = "TestCluster:0@host.name:1234,host-name:5678"; - #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string hn = "host-name", port = "5678"; - #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" address = NetworkAddress::parse("1.0.0.0:5678"); - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" INetworkConnections::net()->addMockTCPEndpoint(hn, port, { address }); - #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString cs(connectionString); - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" StrictFuture> __when_expr_0 = cs.tryResolveHostnames(); - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1044,36 +1043,36 @@ class FlowTestCase295ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase295ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase294ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(std::vector const& allCoordinators,int loopDepth) { - #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(allCoordinators.size() == 1 && std::find(allCoordinators.begin(), allCoordinators.end(), address) != allCoordinators.end()); - #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase295ActorState(); static_cast(this)->destroy(); return 0; } - #line 1059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase295ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase294ActorState(); static_cast(this)->destroy(); return 0; } + #line 1058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase294ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont1(std::vector && allCoordinators,int loopDepth) { - #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(allCoordinators.size() == 1 && std::find(allCoordinators.begin(), allCoordinators.end(), address) != allCoordinators.end()); - #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase295ActorState(); static_cast(this)->destroy(); return 0; } - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase295ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase294ActorState(); static_cast(this)->destroy(); return 0; } + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase294ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -1092,13 +1091,13 @@ class FlowTestCase295ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase295Actor, 0, std::vector >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase294Actor, 0, std::vector >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase295Actor, 0, std::vector >*,std::vector const& value) + void a_callback_fire(ActorCallback< FlowTestCase294Actor, 0, std::vector >*,std::vector const& value) { - fdb_probe_actor_enter("flowTestCase295", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase294", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -1108,12 +1107,12 @@ class FlowTestCase295ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase295", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase294", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase295Actor, 0, std::vector >*,std::vector && value) + void a_callback_fire(ActorCallback< FlowTestCase294Actor, 0, std::vector >*,std::vector && value) { - fdb_probe_actor_enter("flowTestCase295", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase294", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -1123,12 +1122,12 @@ class FlowTestCase295ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase295", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase294", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase295Actor, 0, std::vector >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase294Actor, 0, std::vector >*,Error err) { - fdb_probe_actor_enter("flowTestCase295", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase294", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -1138,40 +1137,40 @@ class FlowTestCase295ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase295", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase294", reinterpret_cast(this), 0); } - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" UnitTestParameters params; - #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" NetworkAddress address; - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase295() - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class FlowTestCase295Actor final : public Actor, public ActorCallback< FlowTestCase295Actor, 0, std::vector >, public FastAllocated, public FlowTestCase295ActorState { - #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" +// This generated class is to be used only via flowTestCase294() + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class FlowTestCase294Actor final : public Actor, public ActorCallback< FlowTestCase294Actor, 0, std::vector >, public FastAllocated, public FlowTestCase294ActorState { + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase295Actor, 0, std::vector >; - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - FlowTestCase295Actor(UnitTestParameters const& params) - #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" +friend struct ActorCallback< FlowTestCase294Actor, 0, std::vector >; + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + FlowTestCase294Actor(UnitTestParameters const& params) + #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor(), - FlowTestCase295ActorState(params) + FlowTestCase294ActorState(params) { - fdb_probe_actor_enter("flowTestCase295", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase294", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase295"); + this->lineage.setActorName("flowTestCase294"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase295", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase294", reinterpret_cast(this), -1); } void cancel() override @@ -1179,144 +1178,144 @@ friend struct ActorCallback< FlowTestCase295Actor, 0, std::vectoractor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase295Actor, 0, std::vector >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase294Actor, 0, std::vector >*)0, actor_cancelled()); break; } } }; } - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -static Future flowTestCase295( UnitTestParameters const& params ) { - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - return Future(new FlowTestCase295Actor(params)); - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +static Future flowTestCase294( UnitTestParameters const& params ) { + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + return Future(new FlowTestCase294Actor(params)); + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase295, "/fdbclient/MonitorLeader/PartialResolve") +ACTOR_TEST_CASE(flowTestCase294, "/fdbclient/MonitorLeader/PartialResolve") -#line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase311() - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -template - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class FlowTestCase311ActorState { - #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" +// This generated class is to be used only via flowTestCase310() + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +template + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class FlowTestCase310ActorState { + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - FlowTestCase311ActorState(UnitTestParameters const& params) - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + FlowTestCase310ActorState(UnitTestParameters const& params) + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : params(params) - #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase311", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase310", reinterpret_cast(this)); } - ~FlowTestCase311ActorState() + ~FlowTestCase310ActorState() { - fdb_probe_actor_destroy("flowTestCase311", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase310", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { { - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" LeaderInfo in; - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" LeaderInfo out; - #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" in.forward = deterministicRandom()->coinflip(); - #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" in.changeID = deterministicRandom()->randomUniqueID(); - #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string rndString(deterministicRandom()->randomInt(10, 400), 'x'); - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" for( auto& c : rndString ) { - #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" c = deterministicRandom()->randomAlphaNumeric(); - #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" in.serializedInfo = rndString; - #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ObjectWriter writer(IncludeVersion()); - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" writer.serialize(in); - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Standalone copy = writer.toStringRef(); - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ArenaObjectReader reader(copy.arena(), copy, IncludeVersion()); - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" reader.deserialize(out); - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(in.forward == out.forward); - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(in.changeID == out.changeID); - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(in.serializedInfo == out.serializedInfo); - #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" LeaderInfo leaderInfo; - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" leaderInfo.forward = deterministicRandom()->coinflip(); - #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" leaderInfo.changeID = deterministicRandom()->randomUniqueID(); - #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string rndString(deterministicRandom()->randomInt(10, 400), 'x'); - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" for( auto& c : rndString ) { - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" c = deterministicRandom()->randomAlphaNumeric(); - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" leaderInfo.serializedInfo = rndString; - #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ErrorOr>> objIn(leaderInfo); - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ErrorOr>> objOut; - #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Standalone copy; - #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ObjectWriter writer(IncludeVersion()); - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" writer.serialize(objIn); - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" copy = writer.toStringRef(); - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ArenaObjectReader reader(copy.arena(), copy, IncludeVersion()); - #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" reader.deserialize(objOut); - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(!objOut.isError()); - #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(objOut.get().asUnderlyingType().present()); - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" LeaderInfo outLeader = objOut.get().asUnderlyingType().get(); - #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(outLeader.changeID == leaderInfo.changeID); - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(outLeader.forward == leaderInfo.forward); - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(outLeader.serializedInfo == leaderInfo.serializedInfo); - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase311ActorState(); static_cast(this)->destroy(); return 0; } - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase311ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase310ActorState(); static_cast(this)->destroy(); return 0; } + #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase310ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -1329,40 +1328,40 @@ class FlowTestCase311ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase311ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase310ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" UnitTestParameters params; - #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase311() - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class FlowTestCase311Actor final : public Actor, public FastAllocated, public FlowTestCase311ActorState { - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" +// This generated class is to be used only via flowTestCase310() + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class FlowTestCase310Actor final : public Actor, public FastAllocated, public FlowTestCase310ActorState { + #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - FlowTestCase311Actor(UnitTestParameters const& params) - #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + FlowTestCase310Actor(UnitTestParameters const& params) + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor(), - FlowTestCase311ActorState(params) + FlowTestCase310ActorState(params) { - fdb_probe_actor_enter("flowTestCase311", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase310", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase311"); + this->lineage.setActorName("flowTestCase310"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase311", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase310", reinterpret_cast(this), -1); } void cancel() override @@ -1375,102 +1374,102 @@ class FlowTestCase311Actor final : public Actor, public FastAllocated flowTestCase311( UnitTestParameters const& params ) { - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - return Future(new FlowTestCase311Actor(params)); - #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +static Future flowTestCase310( UnitTestParameters const& params ) { + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + return Future(new FlowTestCase310Actor(params)); + #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase311, "/flow/FlatBuffers/LeaderInfo") +ACTOR_TEST_CASE(flowTestCase310, "/flow/FlatBuffers/LeaderInfo") -#line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 1388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase361() - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -template - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class FlowTestCase361ActorState { - #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" +// This generated class is to be used only via flowTestCase360() + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +template + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class FlowTestCase360ActorState { + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - FlowTestCase361ActorState(UnitTestParameters const& params) - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + FlowTestCase360ActorState(UnitTestParameters const& params) + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : params(params) - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase361", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase360", reinterpret_cast(this)); } - ~FlowTestCase361ActorState() + ~FlowTestCase360ActorState() { - fdb_probe_actor_destroy("flowTestCase361", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase360", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string connectionString = "0xxdeadbeef:100100100@1.1.1.1:34534,5.1.5.3:23443"; - #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" for(int i = 0;i < 10000;i++) { - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::string output(""); - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" auto c = connectionString.begin(); - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" for(;c != connectionString.end();) { - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (deterministicRandom()->random01() < 0.1) - #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - output += deterministicRandom()->randomChoice(LiteralStringRef(" \t\n\r")); - #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + output += deterministicRandom()->randomChoice(" \t\n\r"_sr); + #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (deterministicRandom()->random01() < 0.5) - #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" output += *c; - #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ++c; - #line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (deterministicRandom()->random01() < 0.1) - #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" output += "#"; - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" int charCount = deterministicRandom()->randomInt(0, 20); - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" for(int i = 0;i < charCount;i++) { - #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - output += deterministicRandom()->randomChoice(LiteralStringRef("asdfzxcv123345:!@#$#$&()<\"\' \t")); - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + output += deterministicRandom()->randomChoice("asdfzxcv123345:!@#$#$&()<\"\' \t"_sr); + #line 1454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - output += deterministicRandom()->randomChoice(LiteralStringRef("\n\r")); - #line 1459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + output += deterministicRandom()->randomChoice("\n\r"_sr); + #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } } - #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString cs(output); - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ASSERT(connectionString == cs.toString()); - #line 1466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase361ActorState(); static_cast(this)->destroy(); return 0; } - #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase361ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase360ActorState(); static_cast(this)->destroy(); return 0; } + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase360ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -1483,40 +1482,40 @@ class FlowTestCase361ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase361ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase360ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" UnitTestParameters params; - #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase361() - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class FlowTestCase361Actor final : public Actor, public FastAllocated, public FlowTestCase361ActorState { - #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" +// This generated class is to be used only via flowTestCase360() + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class FlowTestCase360Actor final : public Actor, public FastAllocated, public FlowTestCase360ActorState { + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - FlowTestCase361Actor(UnitTestParameters const& params) - #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + FlowTestCase360Actor(UnitTestParameters const& params) + #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor(), - FlowTestCase361ActorState(params) + FlowTestCase360ActorState(params) { - fdb_probe_actor_enter("flowTestCase361", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase360", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase361"); + this->lineage.setActorName("flowTestCase360"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase361", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase360", reinterpret_cast(this), -1); } void cancel() override @@ -1529,15 +1528,15 @@ class FlowTestCase361Actor final : public Actor, public FastAllocated flowTestCase361( UnitTestParameters const& params ) { - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - return Future(new FlowTestCase361Actor(params)); - #line 1536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +static Future flowTestCase360( UnitTestParameters const& params ) { + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + return Future(new FlowTestCase360Actor(params)); + #line 1535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase361, "/fdbclient/MonitorLeader/parseConnectionString/fuzz") +ACTOR_TEST_CASE(flowTestCase360, "/fdbclient/MonitorLeader/parseConnectionString/fuzz") -#line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString::ClusterConnectionString(const std::vector& servers, Key key) : coords(servers) { @@ -1636,29 +1635,37 @@ ClientLeaderRegInterface::ClientLeaderRegInterface(INetwork* local) { TaskPriority::Coordination); } +std::string ClientLeaderRegInterface::getAddressString() const { + if (hostname.present()) { + return hostname.get().toString(); + } else { + return getLeader.getEndpoint().getPrimaryAddress().toString(); + } +} + // Nominee is the worker among all workers that are considered as leader by one coordinator // This function contacts a coordinator coord to ask who is its nominee. - #line 1641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" namespace { // This generated class is to be used only via monitorNominee() - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" template - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class MonitorNomineeActorState { - #line 1648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorNomineeActorState(Key const& key,ClientLeaderRegInterface const& coord,AsyncTrigger* const& nomineeChange,Optional* const& info) - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : key(key), - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" coord(coord), - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" nomineeChange(nomineeChange), - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info(info) - #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { fdb_probe_actor_create("monitorNominee", reinterpret_cast(this)); @@ -1671,9 +1678,9 @@ class MonitorNomineeActorState { int a_body1(int loopDepth=0) { try { - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ; - #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1701,78 +1708,101 @@ class MonitorNomineeActorState { } int a_body1loopBody1(int loopDepth) { - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" li = Optional(); - #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + StrictFuture __when_expr_0 = Future(Void()); + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1(Void const& _,int loopDepth) + { + #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (coord.hostname.present()) - #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - StrictFuture __when_expr_0 = store(li, retryGetReplyFromHostname(GetLeaderRequest(key, info->present() ? info->get().changeID : UID()), coord.hostname.get(), WLTOKEN_CLIENTLEADERREG_GETLEADER, TaskPriority::CoordinationReply)); - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + StrictFuture __when_expr_1 = store(li, retryGetReplyFromHostname(GetLeaderRequest(key, info->present() ? info->get().changeID : UID()), coord.hostname.get(), WLTOKEN_CLIENTLEADERREG_GETLEADER, TaskPriority::CoordinationReply)); + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; } else { - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - StrictFuture __when_expr_1 = store(li, retryBrokenPromise(coord.getLeader, GetLeaderRequest(key, info->present() ? info->get().changeID : UID()), TaskPriority::CoordinationReply)); - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + StrictFuture __when_expr_2 = store(li, retryBrokenPromise(coord.getLeader, GetLeaderRequest(key, info->present() ? info->get().changeID : UID()), TaskPriority::CoordinationReply)); + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; } return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) - { - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - StrictFuture __when_expr_2 = Future(Void()); - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont2(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont2(Void && _,int loopDepth) + int a_body1loopBody1cont1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (coord.hostname.present()) + #line 1766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + { + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + StrictFuture __when_expr_1 = store(li, retryGetReplyFromHostname(GetLeaderRequest(key, info->present() ? info->get().changeID : UID()), coord.hostname.get(), WLTOKEN_CLIENTLEADERREG_GETLEADER, TaskPriority::CoordinationReply)); + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + StrictFuture __when_expr_2 = store(li, retryBrokenPromise(coord.getLeader, GetLeaderRequest(key, info->present() ? info->get().changeID : UID()), TaskPriority::CoordinationReply)); + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = 0; + } return loopDepth; } int a_body1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont2(_, loopDepth); + loopDepth = a_body1loopBody1cont1(_, loopDepth); return loopDepth; } int a_body1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); return loopDepth; } @@ -1827,25 +1857,41 @@ class MonitorNomineeActorState { fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 0); } + int a_body1loopBody1cont2(int loopDepth) + { + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + StrictFuture __when_expr_3 = Future(Void()); + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } int a_body1loopBody1cont3(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } - int a_body1loopBody1when2(Void const& _,int loopDepth) + int a_body1loopBody1cont1when1(Void const& _,int loopDepth) { loopDepth = a_body1loopBody1cont3(_, loopDepth); return loopDepth; } - int a_body1loopBody1when2(Void && _,int loopDepth) + int a_body1loopBody1cont1when1(Void && _,int loopDepth) { loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); @@ -1862,7 +1908,7 @@ class MonitorNomineeActorState { fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1when2(value, 0); + a_body1loopBody1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -1877,7 +1923,7 @@ class MonitorNomineeActorState { fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1when2(std::move(value), 0); + a_body1loopBody1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -1904,136 +1950,211 @@ class MonitorNomineeActorState { } int a_body1loopBody1cont4(Void const& _,int loopDepth) { - #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - TraceEvent("GetLeaderReply") .suppressFor(1.0) .detail("Coordinator", coord.hostname.present() ? coord.hostname.get().toString() : coord.getLeader.getEndpoint().getPrimaryAddress().toString()) .detail("Nominee", li.present() ? li.get().changeID : UID()) .detail("ClusterKey", key.printable()); + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1when2(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1when2(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< MonitorNomineeActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< MonitorNomineeActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont1when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< MonitorNomineeActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< MonitorNomineeActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 2); + + } + int a_body1loopBody1cont5(Void const& _,int loopDepth) + { #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + TraceEvent("GetLeaderReply") .suppressFor(1.0) .detail("Coordinator", coord.getAddressString()) .detail("Nominee", li.present() ? li.get().changeID : UID()) .detail("ClusterKey", key.printable()); + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (li != *info) - #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" *info = li; - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" nomineeChange->trigger(); - #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (li.present() && li.get().forward) - #line 1919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - StrictFuture __when_expr_3 = Future(Never()); - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + StrictFuture __when_expr_4 = Future(Never()); + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont5when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1loopBody1cont6(loopDepth); + loopDepth = a_body1loopBody1cont7(loopDepth); } } else { - loopDepth = a_body1loopBody1cont5(loopDepth); + loopDepth = a_body1loopBody1cont6(loopDepth); } return loopDepth; } - int a_body1loopBody1cont4(Void && _,int loopDepth) + int a_body1loopBody1cont5(Void && _,int loopDepth) { - #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - TraceEvent("GetLeaderReply") .suppressFor(1.0) .detail("Coordinator", coord.hostname.present() ? coord.hostname.get().toString() : coord.getLeader.getEndpoint().getPrimaryAddress().toString()) .detail("Nominee", li.present() ? li.get().changeID : UID()) .detail("ClusterKey", key.printable()); #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + TraceEvent("GetLeaderReply") .suppressFor(1.0) .detail("Coordinator", coord.getAddressString()) .detail("Nominee", li.present() ? li.get().changeID : UID()) .detail("ClusterKey", key.printable()); + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (li != *info) - #line 1951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" *info = li; - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" nomineeChange->trigger(); - #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (li.present() && li.get().forward) - #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - StrictFuture __when_expr_3 = Future(Never()); - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + StrictFuture __when_expr_4 = Future(Never()); + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont5when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1loopBody1cont6(loopDepth); + loopDepth = a_body1loopBody1cont7(loopDepth); } } else { - loopDepth = a_body1loopBody1cont5(loopDepth); + loopDepth = a_body1loopBody1cont6(loopDepth); } return loopDepth; } - int a_body1loopBody1cont1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(_, loopDepth); + loopDepth = a_body1loopBody1cont5(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont1when1(Void && _,int loopDepth) + int a_body1loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont5(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose3() + void a_exitChoose4() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< MonitorNomineeActor, 2, Void >::remove(); + static_cast(this)->ActorCallback< MonitorNomineeActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< MonitorNomineeActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< MonitorNomineeActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1loopBody1cont1when1(value, 0); + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 2); + fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< MonitorNomineeActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< MonitorNomineeActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1loopBody1cont1when1(std::move(value), 0); + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 2); + fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< MonitorNomineeActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< MonitorNomineeActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -2042,85 +2163,85 @@ class MonitorNomineeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 2); + fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 3); } - int a_body1loopBody1cont5(int loopDepth) + int a_body1loopBody1cont6(int loopDepth) { if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1loopBody1cont6(int loopDepth) + int a_body1loopBody1cont7(int loopDepth) { - loopDepth = a_body1loopBody1cont5(loopDepth); + loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; } - int a_body1loopBody1cont7(Void const& _,int loopDepth) + int a_body1loopBody1cont8(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont6(loopDepth); + loopDepth = a_body1loopBody1cont7(loopDepth); return loopDepth; } - int a_body1loopBody1cont7(Void && _,int loopDepth) + int a_body1loopBody1cont8(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont6(loopDepth); + loopDepth = a_body1loopBody1cont7(loopDepth); return loopDepth; } - int a_body1loopBody1cont4when1(Void const& _,int loopDepth) + int a_body1loopBody1cont5when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont7(_, loopDepth); + loopDepth = a_body1loopBody1cont8(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont4when1(Void && _,int loopDepth) + int a_body1loopBody1cont5when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont7(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont8(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose5() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< MonitorNomineeActor, 3, Void >::remove(); + static_cast(this)->ActorCallback< MonitorNomineeActor, 4, Void >::remove(); } - void a_callback_fire(ActorCallback< MonitorNomineeActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< MonitorNomineeActor, 4, Void >*,Void const& value) { - fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1cont4when1(value, 0); + a_body1loopBody1cont5when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 3); + fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< MonitorNomineeActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< MonitorNomineeActor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1cont4when1(std::move(value), 0); + a_body1loopBody1cont5when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 3); + fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< MonitorNomineeActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< MonitorNomineeActor, 4, Void >*,Error err) { - fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("monitorNominee", reinterpret_cast(this), 4); + a_exitChoose5(); try { a_body1Catch1(err, 0); } @@ -2129,25 +2250,25 @@ class MonitorNomineeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 3); + fdb_probe_actor_exit("monitorNominee", reinterpret_cast(this), 4); } - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Key key; - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClientLeaderRegInterface coord; - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" AsyncTrigger* nomineeChange; - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Optional* info; - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Optional li; - #line 2145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; // This generated class is to be used only via monitorNominee() - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class MonitorNomineeActor final : public Actor, public ActorCallback< MonitorNomineeActor, 0, Void >, public ActorCallback< MonitorNomineeActor, 1, Void >, public ActorCallback< MonitorNomineeActor, 2, Void >, public ActorCallback< MonitorNomineeActor, 3, Void >, public FastAllocated, public MonitorNomineeActorState { - #line 2150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class MonitorNomineeActor final : public Actor, public ActorCallback< MonitorNomineeActor, 0, Void >, public ActorCallback< MonitorNomineeActor, 1, Void >, public ActorCallback< MonitorNomineeActor, 2, Void >, public ActorCallback< MonitorNomineeActor, 3, Void >, public ActorCallback< MonitorNomineeActor, 4, Void >, public FastAllocated, public MonitorNomineeActorState { + #line 2271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2159,9 +2280,10 @@ friend struct ActorCallback< MonitorNomineeActor, 0, Void >; friend struct ActorCallback< MonitorNomineeActor, 1, Void >; friend struct ActorCallback< MonitorNomineeActor, 2, Void >; friend struct ActorCallback< MonitorNomineeActor, 3, Void >; - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +friend struct ActorCallback< MonitorNomineeActor, 4, Void >; + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorNomineeActor(Key const& key,ClientLeaderRegInterface const& coord,AsyncTrigger* const& nomineeChange,Optional* const& info) - #line 2164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor(), MonitorNomineeActorState(key, coord, nomineeChange, info) { @@ -2183,19 +2305,20 @@ friend struct ActorCallback< MonitorNomineeActor, 3, Void >; case 2: this->a_callback_error((ActorCallback< MonitorNomineeActor, 1, Void >*)0, actor_cancelled()); break; case 3: this->a_callback_error((ActorCallback< MonitorNomineeActor, 2, Void >*)0, actor_cancelled()); break; case 4: this->a_callback_error((ActorCallback< MonitorNomineeActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< MonitorNomineeActor, 4, Void >*)0, actor_cancelled()); break; } } }; } - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" [[nodiscard]] Future monitorNominee( Key const& key, ClientLeaderRegInterface const& coord, AsyncTrigger* const& nomineeChange, Optional* const& info ) { - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" return Future(new MonitorNomineeActor(key, coord, nomineeChange, info)); - #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -#line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" // Also used in fdbserver/LeaderElection.actor.cpp! // bool represents if the LeaderInfo is a majority answer or not. @@ -2245,33 +2368,35 @@ Optional> getLeader(const std::vector - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class MonitorLeaderOneGenerationActorState { - #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorLeaderOneGenerationActorState(Reference const& connRecord,Reference> const& outSerializedLeaderInfo,MonitorLeaderInfo const& info) - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : connRecord(connRecord), - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" outSerializedLeaderInfo(outSerializedLeaderInfo), - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info(info), - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" coordinators(info.intermediateConnRecord), - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" nomineeChange(), - #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" nominees(), - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - allActors() - #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + allActors(), + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + leader() + #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { fdb_probe_actor_create("monitorLeaderOneGeneration", reinterpret_cast(this)); @@ -2284,23 +2409,23 @@ class MonitorLeaderOneGenerationActorState { int a_body1(int loopDepth=0) { try { - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" nominees.resize(coordinators.clientLeaderServers.size()); - #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" actors = std::vector>(); - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" actors.reserve(coordinators.clientLeaderServers.size()); - #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" for(int i = 0;i < coordinators.clientLeaderServers.size();i++) { - #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" actors.push_back( monitorNominee(coordinators.clusterKey, coordinators.clientLeaderServers[i], &nomineeChange, &nominees[i])); - #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" allActors = waitForAll(actors); - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ; - #line 2303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2328,91 +2453,122 @@ class MonitorLeaderOneGenerationActorState { } int a_body1loopBody1(int loopDepth) { - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - Optional> leader = getLeader(nominees); - #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + leader = getLeader(nominees); + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" TraceEvent("MonitorLeaderChange") .detail("NewLeader", leader.present() ? leader.get().first.changeID : UID(1, 1)); - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (leader.present()) - #line 2337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (leader.get().first.forward) - #line 2341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" TraceEvent("MonitorLeaderForwarding") .detail("NewConnStr", leader.get().first.serializedInfo.toString()) .detail("OldConnStr", info.intermediateConnRecord->getConnectionString().toString()) .trackLatest("MonitorLeaderForwarding"); - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info.intermediateConnRecord = connRecord->makeIntermediateRecord( ClusterConnectionString(leader.get().first.serializedInfo.toString())); - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(info); this->~MonitorLeaderOneGenerationActorState(); static_cast(this)->destroy(); return 0; } - #line 2349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" new (&static_cast(this)->SAV< MonitorLeaderInfo >::value()) MonitorLeaderInfo(std::move(info)); // state_var_RVO this->~MonitorLeaderOneGenerationActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (connRecord != info.intermediateConnRecord) - #line 2357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (!info.hasConnected) - #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" TraceEvent(SevWarnAlways, "IncorrectClusterFileContentsAtConnection") .detail("ClusterFile", connRecord->toString()) .detail("StoredConnectionString", connRecord->getConnectionString().toString()) .detail("CurrentConnectionString", info.intermediateConnRecord->getConnectionString().toString()); - #line 2365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - connRecord->setAndPersistConnectionString(info.intermediateConnRecord->getConnectionString()); - #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - info.intermediateConnRecord = connRecord; - #line 2371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - } - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - info.hasConnected = true; - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - connRecord->notifyConnected(); #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - outSerializedLeaderInfo->set(leader.get().first.serializedInfo); - #line 2379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + StrictFuture __when_expr_0 = connRecord->setAndPersistConnectionString(info.intermediateConnRecord->getConnectionString()); + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont2(loopDepth); + } } - #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - StrictFuture __when_expr_0 = nomineeChange.onTrigger() || allActors; - #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + else + { + loopDepth = a_body1loopBody1cont1(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + StrictFuture __when_expr_1 = nomineeChange.onTrigger() || allActors; + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont1(Void const& _,int loopDepth) + int a_body1loopBody1cont2(int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + info.hasConnected = true; + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + connRecord->notifyConnected(); + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + outSerializedLeaderInfo->set(leader.get().first.serializedInfo); + #line 2540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont1(Void && _,int loopDepth) + int a_body1loopBody1cont4(Void const& _,int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + info.intermediateConnRecord = connRecord; + #line 2549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + info.intermediateConnRecord = connRecord; + #line 2558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } int a_body1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(_, loopDepth); + loopDepth = a_body1loopBody1cont4(_, loopDepth); return loopDepth; } int a_body1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); return loopDepth; } @@ -2467,28 +2623,105 @@ class MonitorLeaderOneGenerationActorState { fdb_probe_actor_exit("monitorLeaderOneGeneration", reinterpret_cast(this), 0); } - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + int a_body1loopBody1cont8(Void const& _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont8(Void && _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< MonitorLeaderOneGenerationActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< MonitorLeaderOneGenerationActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("monitorLeaderOneGeneration", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorLeaderOneGeneration", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< MonitorLeaderOneGenerationActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("monitorLeaderOneGeneration", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorLeaderOneGeneration", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< MonitorLeaderOneGenerationActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("monitorLeaderOneGeneration", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorLeaderOneGeneration", reinterpret_cast(this), 1); + + } + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference connRecord; - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference> outSerializedLeaderInfo; - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorLeaderInfo info; - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClientCoordinators coordinators; - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" AsyncTrigger nomineeChange; - #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector> nominees; - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Future allActors; - #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + Optional> leader; + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector> actors; - #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; // This generated class is to be used only via monitorLeaderOneGeneration() - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class MonitorLeaderOneGenerationActor final : public Actor, public ActorCallback< MonitorLeaderOneGenerationActor, 0, Void >, public FastAllocated, public MonitorLeaderOneGenerationActorState { - #line 2491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class MonitorLeaderOneGenerationActor final : public Actor, public ActorCallback< MonitorLeaderOneGenerationActor, 0, Void >, public ActorCallback< MonitorLeaderOneGenerationActor, 1, Void >, public FastAllocated, public MonitorLeaderOneGenerationActorState { + #line 2724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2497,9 +2730,10 @@ class MonitorLeaderOneGenerationActor final : public Actor, p void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< MonitorLeaderOneGenerationActor, 0, Void >; - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +friend struct ActorCallback< MonitorLeaderOneGenerationActor, 1, Void >; + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorLeaderOneGenerationActor(Reference const& connRecord,Reference> const& outSerializedLeaderInfo,MonitorLeaderInfo const& info) - #line 2502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor(), MonitorLeaderOneGenerationActorState(connRecord, outSerializedLeaderInfo, info) { @@ -2518,39 +2752,40 @@ friend struct ActorCallback< MonitorLeaderOneGenerationActor, 0, Void >; this->actor_wait_state = -1; switch (wait_state) { case 1: this->a_callback_error((ActorCallback< MonitorLeaderOneGenerationActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< MonitorLeaderOneGenerationActor, 1, Void >*)0, actor_cancelled()); break; } } }; } - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" [[nodiscard]] Future monitorLeaderOneGeneration( Reference const& connRecord, Reference> const& outSerializedLeaderInfo, MonitorLeaderInfo const& info ) { - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" return Future(new MonitorLeaderOneGenerationActor(connRecord, outSerializedLeaderInfo, info)); - #line 2530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -#line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" namespace { // This generated class is to be used only via monitorLeaderInternal() - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" template - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class MonitorLeaderInternalActorState { - #line 2542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorLeaderInternalActorState(Reference const& connRecord,Reference> const& outSerializedLeaderInfo) - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : connRecord(connRecord), - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" outSerializedLeaderInfo(outSerializedLeaderInfo), - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info(connRecord) - #line 2553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { fdb_probe_actor_create("monitorLeaderInternal", reinterpret_cast(this)); @@ -2563,9 +2798,9 @@ class MonitorLeaderInternalActorState { int a_body1(int loopDepth=0) { try { - #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ; - #line 2568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2593,34 +2828,34 @@ class MonitorLeaderInternalActorState { } int a_body1loopBody1(int loopDepth) { - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" StrictFuture __when_expr_0 = monitorLeaderOneGeneration(connRecord, outSerializedLeaderInfo, info); - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(MonitorLeaderInfo const& _info,int loopDepth) { - #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info = _info; - #line 2614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(MonitorLeaderInfo && _info,int loopDepth) { - #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info = _info; - #line 2623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -2688,18 +2923,18 @@ class MonitorLeaderInternalActorState { fdb_probe_actor_exit("monitorLeaderInternal", reinterpret_cast(this), 0); } - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference connRecord; - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference> outSerializedLeaderInfo; - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorLeaderInfo info; - #line 2697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; // This generated class is to be used only via monitorLeaderInternal() - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class MonitorLeaderInternalActor final : public Actor, public ActorCallback< MonitorLeaderInternalActor, 0, MonitorLeaderInfo >, public FastAllocated, public MonitorLeaderInternalActorState { - #line 2702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2708,9 +2943,9 @@ class MonitorLeaderInternalActor final : public Actor, public ActorCallbac void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< MonitorLeaderInternalActor, 0, MonitorLeaderInfo >; - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorLeaderInternalActor(Reference const& connRecord,Reference> const& outSerializedLeaderInfo) - #line 2713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor(), MonitorLeaderInternalActorState(connRecord, outSerializedLeaderInfo) { @@ -2734,36 +2969,36 @@ friend struct ActorCallback< MonitorLeaderInternalActor, 0, MonitorLeaderInfo >; } }; } - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" [[nodiscard]] Future monitorLeaderInternal( Reference const& connRecord, Reference> const& outSerializedLeaderInfo ) { - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" return Future(new MonitorLeaderInternalActor(connRecord, outSerializedLeaderInfo)); - #line 2741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -#line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 2746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" namespace { // This generated class is to be used only via asyncDeserializeClusterInterface() - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" template - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class AsyncDeserializeClusterInterfaceActorState { - #line 2753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 2988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" AsyncDeserializeClusterInterfaceActorState(Reference> const& serializedInfo,Reference>> const& outKnownLeader) - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : serializedInfo(serializedInfo), - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" outKnownLeader(outKnownLeader), - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" knownLeader(new AsyncVar>{}), - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" deserializer(asyncDeserialize(serializedInfo, knownLeader)) - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { fdb_probe_actor_create("asyncDeserializeClusterInterface", reinterpret_cast(this)); @@ -2776,9 +3011,9 @@ class AsyncDeserializeClusterInterfaceActorState { int a_body1(int loopDepth=0) { try { - #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ; - #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2806,22 +3041,22 @@ class AsyncDeserializeClusterInterfaceActorState { } int a_body1loopBody1(int loopDepth) { - #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" StrictFuture __when_expr_0 = deserializer; - #line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" StrictFuture __when_expr_1 = knownLeader->onChange(); - #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2834,37 +3069,37 @@ class AsyncDeserializeClusterInterfaceActorState { } int a_body1loopBody1when1(Void const& _,int loopDepth) { - #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" UNSTOPPABLE_ASSERT(false); - #line 2839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1when1(Void && _,int loopDepth) { - #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" UNSTOPPABLE_ASSERT(false); - #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1when2(Void const& _,int loopDepth) { - #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (knownLeader->get().present()) - #line 2857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" outKnownLeader->set(knownLeader->get().get().clientInterface); - #line 2861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } else { - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" outKnownLeader->set(Optional{}); - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } loopDepth = a_body1loopBody1cont1(loopDepth); @@ -2872,19 +3107,19 @@ class AsyncDeserializeClusterInterfaceActorState { } int a_body1loopBody1when2(Void && _,int loopDepth) { - #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (knownLeader->get().present()) - #line 2877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" outKnownLeader->set(knownLeader->get().get().clientInterface); - #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } else { - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" outKnownLeader->set(Optional{}); - #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } loopDepth = a_body1loopBody1cont1(loopDepth); @@ -2987,20 +3222,20 @@ class AsyncDeserializeClusterInterfaceActorState { fdb_probe_actor_exit("asyncDeserializeClusterInterface", reinterpret_cast(this), 1); } - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference> serializedInfo; - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference>> outKnownLeader; - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference>> knownLeader; - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Future deserializer; - #line 2998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; // This generated class is to be used only via asyncDeserializeClusterInterface() - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class AsyncDeserializeClusterInterfaceActor final : public Actor, public ActorCallback< AsyncDeserializeClusterInterfaceActor, 0, Void >, public ActorCallback< AsyncDeserializeClusterInterfaceActor, 1, Void >, public FastAllocated, public AsyncDeserializeClusterInterfaceActorState { - #line 3003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3010,9 +3245,9 @@ class AsyncDeserializeClusterInterfaceActor final : public Actor, public A #pragma clang diagnostic pop friend struct ActorCallback< AsyncDeserializeClusterInterfaceActor, 0, Void >; friend struct ActorCallback< AsyncDeserializeClusterInterfaceActor, 1, Void >; - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" AsyncDeserializeClusterInterfaceActor(Reference> const& serializedInfo,Reference>> const& outKnownLeader) - #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor(), AsyncDeserializeClusterInterfaceActorState(serializedInfo, outKnownLeader) { @@ -3036,99 +3271,73 @@ friend struct ActorCallback< AsyncDeserializeClusterInterfaceActor, 1, Void >; } }; } - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" [[nodiscard]] Future asyncDeserializeClusterInterface( Reference> const& serializedInfo, Reference>> const& outKnownLeader ) { - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" return Future(new AsyncDeserializeClusterInterfaceActor(serializedInfo, outKnownLeader)); - #line 3043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -#line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -struct ClientStatusStats { - int count; - std::vector> examples; +namespace { - ClientStatusStats() : count(0) { examples.reserve(CLIENT_KNOBS->CLIENT_EXAMPLE_AMOUNT); } -}; +void tryInsertIntoSamples(OpenDatabaseRequest::Samples& samples, + const NetworkAddress& networkAddress, + const Key& traceLogGroup) { + ++samples.count; + if (samples.samples.size() < static_cast(CLIENT_KNOBS->CLIENT_EXAMPLE_AMOUNT)) { + samples.samples.insert({ networkAddress, traceLogGroup }); + } +} + +} // namespace OpenDatabaseRequest ClientData::getRequest() { OpenDatabaseRequest req; - std::map issueMap; - std::map versionMap; - std::map maxProtocolMap; - int clientCount = 0; - - // SOMEDAY: add a yield in this loop for (auto& ci : clientStatusInfoMap) { - for (auto& it : ci.second.issues) { - auto& entry = issueMap[it]; - entry.count++; - if (entry.examples.size() < CLIENT_KNOBS->CLIENT_EXAMPLE_AMOUNT) { - entry.examples.emplace_back(ci.first, ci.second.traceLogGroup); - } + const auto& networkAddress = ci.first; + const auto& traceLogGroup = ci.second.traceLogGroup; + + for (auto& issue : ci.second.issues) { + tryInsertIntoSamples(req.issues[issue], networkAddress, traceLogGroup); } - if (ci.second.versions.size()) { - clientCount++; - StringRef maxProtocol; - for (auto& it : ci.second.versions) { - maxProtocol = std::max(maxProtocol, it.protocolVersion); - auto& entry = versionMap[it]; - entry.count++; - if (entry.examples.size() < CLIENT_KNOBS->CLIENT_EXAMPLE_AMOUNT) { - entry.examples.emplace_back(ci.first, ci.second.traceLogGroup); - } - } - auto& maxEntry = maxProtocolMap[maxProtocol]; - maxEntry.count++; - if (maxEntry.examples.size() < CLIENT_KNOBS->CLIENT_EXAMPLE_AMOUNT) { - maxEntry.examples.emplace_back(ci.first, ci.second.traceLogGroup); - } - } else { - auto& entry = versionMap[ClientVersionRef()]; - entry.count++; - if (entry.examples.size() < CLIENT_KNOBS->CLIENT_EXAMPLE_AMOUNT) { - entry.examples.emplace_back(ci.first, ci.second.traceLogGroup); - } + + if (!ci.second.versions.size()) { + tryInsertIntoSamples(req.supportedVersions[ClientVersionRef()], networkAddress, traceLogGroup); + continue; } - } - req.issues.reserve(issueMap.size()); - for (auto& it : issueMap) { - req.issues.push_back(ItemWithExamples(it.first, it.second.count, it.second.examples)); - } - req.supportedVersions.reserve(versionMap.size()); - for (auto& it : versionMap) { - req.supportedVersions.push_back( - ItemWithExamples>(it.first, it.second.count, it.second.examples)); - } - req.maxProtocolSupported.reserve(maxProtocolMap.size()); - for (auto& it : maxProtocolMap) { - req.maxProtocolSupported.push_back(ItemWithExamples(it.first, it.second.count, it.second.examples)); + ++req.clientCount; + StringRef maxProtocol; + for (auto& it : ci.second.versions) { + maxProtocol = std::max(maxProtocol, it.protocolVersion); + tryInsertIntoSamples(req.supportedVersions[it], networkAddress, traceLogGroup); + } + tryInsertIntoSamples(req.maxProtocolSupported[maxProtocol], networkAddress, traceLogGroup); } - req.clientCount = clientCount; return req; } - #line 3115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" namespace { // This generated class is to be used only via getClientInfoFromLeader() - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" template - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class GetClientInfoFromLeaderActorState { - #line 3122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" GetClientInfoFromLeaderActorState(Reference>> const& knownLeader,ClientData* const& clientData) - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : knownLeader(knownLeader), - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientData(clientData) - #line 3131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { fdb_probe_actor_create("getClientInfoFromLeader", reinterpret_cast(this)); @@ -3141,9 +3350,9 @@ class GetClientInfoFromLeaderActorState { int a_body1(int loopDepth=0) { try { - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ; - #line 3146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -3164,13 +3373,13 @@ class GetClientInfoFromLeaderActorState { } int a_body1cont1(int loopDepth) { - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" lastRequestTime = now(); - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" req = clientData->getRequest(); - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ; - #line 3173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -3184,22 +3393,22 @@ class GetClientInfoFromLeaderActorState { } int a_body1loopBody1(int loopDepth) { - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (!(!knownLeader->get().present())) - #line 3189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" StrictFuture __when_expr_0 = knownLeader->onChange(); - #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3301,40 +3510,40 @@ class GetClientInfoFromLeaderActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (now() - lastRequestTime > CLIENT_KNOBS->MAX_CLIENT_STATUS_AGE) - #line 3306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" lastRequestTime = now(); - #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" req = clientData->getRequest(); - #line 3312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } else { - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" resetReply(req); - #line 3318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" req.knownClientInfoID = clientData->clientInfo->get().read().id; - #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" StrictFuture __when_expr_1 = brokenPromiseToNever(knownLeader->get().get().clientInterface.openDatabase.getReply(req)); - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" StrictFuture __when_expr_2 = knownLeader->onChange(); - #line 3330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3347,22 +3556,22 @@ class GetClientInfoFromLeaderActorState { } int a_body1cont1loopBody1when1(ClientDBInfo const& ni,int loopDepth) { - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" TraceEvent("GetClientInfoFromLeaderGotClientInfo", knownLeader->get().get().clientInterface.id()) .detail("CommitProxy0", ni.commitProxies.size() ? ni.commitProxies[0].address().toString() : "") .detail("GrvProxy0", ni.grvProxies.size() ? ni.grvProxies[0].address().toString() : "") .detail("ClientID", ni.id); - #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientData->clientInfo->set(CachedSerialization(ni)); - #line 3354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; } int a_body1cont1loopBody1when1(ClientDBInfo && ni,int loopDepth) { - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" TraceEvent("GetClientInfoFromLeaderGotClientInfo", knownLeader->get().get().clientInterface.id()) .detail("CommitProxy0", ni.commitProxies.size() ? ni.commitProxies[0].address().toString() : "") .detail("GrvProxy0", ni.grvProxies.size() ? ni.grvProxies[0].address().toString() : "") .detail("ClientID", ni.id); - #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientData->clientInfo->set(CachedSerialization(ni)); - #line 3365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; @@ -3476,20 +3685,20 @@ class GetClientInfoFromLeaderActorState { fdb_probe_actor_exit("getClientInfoFromLeader", reinterpret_cast(this), 2); } - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference>> knownLeader; - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClientData* clientData; - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" double lastRequestTime; - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" OpenDatabaseRequest req; - #line 3487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; // This generated class is to be used only via getClientInfoFromLeader() - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class GetClientInfoFromLeaderActor final : public Actor, public ActorCallback< GetClientInfoFromLeaderActor, 0, Void >, public ActorCallback< GetClientInfoFromLeaderActor, 1, ClientDBInfo >, public ActorCallback< GetClientInfoFromLeaderActor, 2, Void >, public FastAllocated, public GetClientInfoFromLeaderActorState { - #line 3492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3500,9 +3709,9 @@ class GetClientInfoFromLeaderActor final : public Actor, public ActorCallb friend struct ActorCallback< GetClientInfoFromLeaderActor, 0, Void >; friend struct ActorCallback< GetClientInfoFromLeaderActor, 1, ClientDBInfo >; friend struct ActorCallback< GetClientInfoFromLeaderActor, 2, Void >; - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" GetClientInfoFromLeaderActor(Reference>> const& knownLeader,ClientData* const& clientData) - #line 3505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor(), GetClientInfoFromLeaderActorState(knownLeader, clientData) { @@ -3527,48 +3736,48 @@ friend struct ActorCallback< GetClientInfoFromLeaderActor, 2, Void >; } }; } - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" [[nodiscard]] Future getClientInfoFromLeader( Reference>> const& knownLeader, ClientData* const& clientData ) { - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" return Future(new GetClientInfoFromLeaderActor(knownLeader, clientData)); - #line 3534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -#line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 3539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" namespace { // This generated class is to be used only via monitorLeaderAndGetClientInfo() - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" template - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class MonitorLeaderAndGetClientInfoActorState { - #line 3546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorLeaderAndGetClientInfoActorState(Key const& clusterKey,std::vector const& hostnames,std::vector const& coordinators,ClientData* const& clientData,Reference>> const& leaderInfo) - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : clusterKey(clusterKey), - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" hostnames(hostnames), - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" coordinators(coordinators), - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientData(clientData), - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" leaderInfo(leaderInfo), - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientLeaderServers(), - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" nomineeChange(), - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" nominees(), - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" allActors(), - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" knownLeader(new AsyncVar>{}) - #line 3571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { fdb_probe_actor_create("monitorLeaderAndGetClientInfo", reinterpret_cast(this)); @@ -3581,39 +3790,39 @@ class MonitorLeaderAndGetClientInfoActorState { int a_body1(int loopDepth=0) { try { - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientLeaderServers.reserve(hostnames.size() + coordinators.size()); - #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" for( auto h : hostnames ) { - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientLeaderServers.push_back(ClientLeaderRegInterface(h)); - #line 3590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" for( auto s : coordinators ) { - #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientLeaderServers.push_back(ClientLeaderRegInterface(s)); - #line 3596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" nominees.resize(clientLeaderServers.size()); - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector> actors; - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" actors.reserve(clientLeaderServers.size()); - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" for(int i = 0;i < clientLeaderServers.size();i++) { - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" actors.push_back(monitorNominee(clusterKey, clientLeaderServers[i], &nomineeChange, &nominees[i])); - #line 3608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" actors.push_back(getClientInfoFromLeader(knownLeader, clientData)); - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" allActors = waitForAll(actors); - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ; - #line 3616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -3641,65 +3850,65 @@ class MonitorLeaderAndGetClientInfoActorState { } int a_body1loopBody1(int loopDepth) { - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Optional> leader = getLeader(nominees); - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" TraceEvent("MonitorLeaderAndGetClientInfoLeaderChange") .detail("NewLeader", leader.present() ? leader.get().first.changeID : UID(1, 1)) .detail("Key", clusterKey.printable()); - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (leader.present()) - #line 3650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (leader.get().first.forward) - #line 3654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClientDBInfo outInfo; - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" outInfo.id = deterministicRandom()->randomUniqueID(); - #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" outInfo.forward = leader.get().first.serializedInfo; - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientData->clientInfo->set(CachedSerialization(outInfo)); - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" leaderInfo->set(leader.get().first); - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" TraceEvent("MonitorLeaderAndGetClientInfoForwarding") .detail("NewConnStr", leader.get().first.serializedInfo.toString()); - #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~MonitorLeaderAndGetClientInfoActorState(); static_cast(this)->destroy(); return 0; } - #line 3670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~MonitorLeaderAndGetClientInfoActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (leader.get().first.serializedInfo.size()) - #line 3678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ObjectReader reader(leader.get().first.serializedInfo.begin(), IncludeVersion()); - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterControllerClientInterface res; - #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" reader.deserialize(res); - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" knownLeader->set(res); - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" leaderInfo->set(leader.get().first); - #line 3690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } } - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" StrictFuture __when_expr_0 = nomineeChange.onTrigger() || allActors; - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 3911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3779,32 +3988,32 @@ class MonitorLeaderAndGetClientInfoActorState { fdb_probe_actor_exit("monitorLeaderAndGetClientInfo", reinterpret_cast(this), 0); } - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Key clusterKey; - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector hostnames; - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector coordinators; - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClientData* clientData; - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference>> leaderInfo; - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector clientLeaderServers; - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" AsyncTrigger nomineeChange; - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector> nominees; - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Future allActors; - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference>> knownLeader; - #line 3802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; // This generated class is to be used only via monitorLeaderAndGetClientInfo() - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class MonitorLeaderAndGetClientInfoActor final : public Actor, public ActorCallback< MonitorLeaderAndGetClientInfoActor, 0, Void >, public FastAllocated, public MonitorLeaderAndGetClientInfoActorState { - #line 3807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3813,9 +4022,9 @@ class MonitorLeaderAndGetClientInfoActor final : public Actor, public Acto void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< MonitorLeaderAndGetClientInfoActor, 0, Void >; - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorLeaderAndGetClientInfoActor(Key const& clusterKey,std::vector const& hostnames,std::vector const& coordinators,ClientData* const& clientData,Reference>> const& leaderInfo) - #line 3818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor(), MonitorLeaderAndGetClientInfoActorState(clusterKey, hostnames, coordinators, clientData, leaderInfo) { @@ -3839,14 +4048,14 @@ friend struct ActorCallback< MonitorLeaderAndGetClientInfoActor, 0, Void >; } }; } - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" [[nodiscard]] Future monitorLeaderAndGetClientInfo( Key const& clusterKey, std::vector const& hostnames, std::vector const& coordinators, ClientData* const& clientData, Reference>> const& leaderInfo ) { - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" return Future(new MonitorLeaderAndGetClientInfoActor(clusterKey, hostnames, coordinators, clientData, leaderInfo)); - #line 3846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -#line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" void shrinkProxyList(ClientDBInfo& ni, std::vector& lastCommitProxyUIDs, @@ -3888,53 +4097,55 @@ void shrinkProxyList(ClientDBInfo& ni, } } - #line 3891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" namespace { // This generated class is to be used only via monitorProxiesOneGeneration() - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" template - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class MonitorProxiesOneGenerationActorState { - #line 3898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorProxiesOneGenerationActorState(Reference const& connRecord,Reference> const& clientInfo,Reference>> const& coordinator,MonitorLeaderInfo const& info,Reference>>> const& supportedVersions,Key const& traceLogGroup,IsInternal const& internal) - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : connRecord(connRecord), - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientInfo(clientInfo), - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" coordinator(coordinator), - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info(info), - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" supportedVersions(supportedVersions), - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" traceLogGroup(traceLogGroup), - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" internal(internal), - #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" cs(info.intermediateConnRecord->getConnectionString()), - #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" coordinatorsSize(cs.hostnames.size() + cs.coords.size()), - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" index(0), - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" successIndex(0), - #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" incorrectTime(), - #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" lastCommitProxyUIDs(), - #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" lastCommitProxies(), - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" lastGrvProxyUIDs(), - #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" lastGrvProxies(), - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - clientLeaderServers() - #line 3937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + clientLeaderServers(), + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + allConnectionsFailed(false) + #line 4148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { fdb_probe_actor_create("monitorProxiesOneGeneration", reinterpret_cast(this)); @@ -3947,25 +4158,27 @@ class MonitorProxiesOneGenerationActorState { int a_body1(int loopDepth=0) { try { - #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientLeaderServers.reserve(coordinatorsSize); - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" for( const auto& h : cs.hostnames ) { - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientLeaderServers.push_back(ClientLeaderRegInterface(h)); - #line 3956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" for( const auto& c : cs.coords ) { - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientLeaderServers.push_back(ClientLeaderRegInterface(c)); - #line 3962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + ASSERT(clientLeaderServers.size() > 0); + #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" deterministicRandom()->randomShuffle(clientLeaderServers); - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ; - #line 3968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -3993,47 +4206,47 @@ class MonitorProxiesOneGenerationActorState { } int a_body1loopBody1(int loopDepth) { - #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientLeaderServer = clientLeaderServers[index]; - #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" req = OpenDatabaseCoordRequest(); - #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" req.clusterKey = cs.clusterKey(); - #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" req.hostnames = cs.hostnames; - #line 894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" req.coordinators = cs.coords; - #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" req.knownClientInfoID = clientInfo->get().id; - #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" req.supportedVersions = supportedVersions->get(); - #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" req.traceLogGroup = traceLogGroup; - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" req.internal = internal; - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" storedConnectionString = ClusterConnectionString(); - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (connRecord) - #line 4018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" StrictFuture __when_expr_0 = connRecord->upToDate(storedConnectionString); - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; } else { - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" incorrectTime = Optional(); - #line 4036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); } @@ -4041,99 +4254,143 @@ class MonitorProxiesOneGenerationActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" repFuture = Future>>(); - #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (clientLeaderServer.hostname.present()) - #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" repFuture = tryGetReplyFromHostname(req, clientLeaderServer.hostname.get(), WLTOKEN_CLIENTLEADERREG_OPENDATABASE, TaskPriority::CoordinationReply); - #line 4052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } else { - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" repFuture = clientLeaderServer.openDatabase.tryGetReply(req, TaskPriority::CoordinationReply); - #line 4058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" coordinator->setUnconditional(clientLeaderServer); - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - StrictFuture>> __when_expr_1 = repFuture; - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + StrictFuture>> __when_expr_2 = repFuture; + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast> >*>(static_cast(this))); - #line 4071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 4284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(bool const& upToDate,int loopDepth) { - #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - if (!upToDate) - #line 4080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (upToDate) + #line 4293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - req.issues.push_back_deep(req.issues.arena(), LiteralStringRef("incorrect_cluster_file_contents")); - #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - std::string connectionString = connRecord->getConnectionString().toString(); - #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - if (!incorrectTime.present()) - #line 4088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - { - #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - incorrectTime = now(); - #line 4092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - } - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - TraceEvent(now() - incorrectTime.get() > 300 ? SevWarnAlways : SevWarn, "IncorrectClusterFileContents") .detail("ClusterFile", connRecord->toString()) .detail("StoredConnectionString", storedConnectionString.toString()) .detail("CurrentConnectionString", connectionString); - #line 4096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + incorrectTime = Optional(); + #line 4297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); } else { - #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - incorrectTime = Optional(); - #line 4102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (allConnectionsFailed && storedConnectionString.getNumberOfCoordinators() > 0) + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + { + #line 894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + TraceEvent("UpdatingConnectionStringFromFile") .detail("ClusterFile", connRecord->toString()) .detail("StoredConnectionString", storedConnectionString.toString()) .detail("CurrentConnectionString", connRecord->getConnectionString().toString()); + #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + StrictFuture __when_expr_1 = connRecord->setAndPersistConnectionString(storedConnectionString); + #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 4312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + req.issues.push_back_deep(req.issues.arena(), "incorrect_cluster_file_contents"_sr); + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + std::string connectionString = connRecord->getConnectionString().toString(); + #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (!incorrectTime.present()) + #line 4328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + { + #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + incorrectTime = now(); + #line 4332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + } + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + TraceEvent(now() - incorrectTime.get() > 300 ? SevWarnAlways : SevWarn, "IncorrectClusterFileContents") .detail("ClusterFile", connRecord->toString()) .detail("StoredConnectionString", storedConnectionString.toString()) .detail("CurrentConnectionString", connectionString); + #line 4336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = a_body1loopBody1cont5(loopDepth); + } } - loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1cont2(bool && upToDate,int loopDepth) { - #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - if (!upToDate) - #line 4112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (upToDate) + #line 4347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - req.issues.push_back_deep(req.issues.arena(), LiteralStringRef("incorrect_cluster_file_contents")); - #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - std::string connectionString = connRecord->getConnectionString().toString(); - #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - if (!incorrectTime.present()) - #line 4120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - { - #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - incorrectTime = now(); - #line 4124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - } - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - TraceEvent(now() - incorrectTime.get() > 300 ? SevWarnAlways : SevWarn, "IncorrectClusterFileContents") .detail("ClusterFile", connRecord->toString()) .detail("StoredConnectionString", storedConnectionString.toString()) .detail("CurrentConnectionString", connectionString); - #line 4128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + incorrectTime = Optional(); + #line 4351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); } else { - #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - incorrectTime = Optional(); - #line 4134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (allConnectionsFailed && storedConnectionString.getNumberOfCoordinators() > 0) + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + { + #line 894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + TraceEvent("UpdatingConnectionStringFromFile") .detail("ClusterFile", connRecord->toString()) .detail("StoredConnectionString", storedConnectionString.toString()) .detail("CurrentConnectionString", connRecord->getConnectionString().toString()); + #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + StrictFuture __when_expr_1 = connRecord->setAndPersistConnectionString(storedConnectionString); + #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 4366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + req.issues.push_back_deep(req.issues.arena(), "incorrect_cluster_file_contents"_sr); + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + std::string connectionString = connRecord->getConnectionString().toString(); + #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (!incorrectTime.present()) + #line 4382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + { + #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + incorrectTime = now(); + #line 4386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + } + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + TraceEvent(now() - incorrectTime.get() > 300 ? SevWarnAlways : SevWarn, "IncorrectClusterFileContents") .detail("ClusterFile", connRecord->toString()) .detail("StoredConnectionString", storedConnectionString.toString()) .detail("CurrentConnectionString", connectionString); + #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = a_body1loopBody1cont5(loopDepth); + } } - loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } @@ -4200,88 +4457,191 @@ class MonitorProxiesOneGenerationActorState { fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 0); } - int a_body1loopBody1cont8(int loopDepth) + int a_body1loopBody1cont3(int loopDepth) { - #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5(int loopDepth) + { + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont6(Void const& _,int loopDepth) + { + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + info.intermediateConnRecord = connRecord; + #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(info); this->~MonitorProxiesOneGenerationActorState(); static_cast(this)->destroy(); return 0; } + #line 4478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + new (&static_cast(this)->SAV< MonitorLeaderInfo >::value()) MonitorLeaderInfo(std::move(info)); // state_var_RVO + this->~MonitorProxiesOneGenerationActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont6(Void && _,int loopDepth) + { + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + info.intermediateConnRecord = connRecord; + #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(info); this->~MonitorProxiesOneGenerationActorState(); static_cast(this)->destroy(); return 0; } + #line 4492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + new (&static_cast(this)->SAV< MonitorLeaderInfo >::value()) MonitorLeaderInfo(std::move(info)); // state_var_RVO + this->~MonitorProxiesOneGenerationActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont6(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont6(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< MonitorProxiesOneGenerationActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< MonitorProxiesOneGenerationActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< MonitorProxiesOneGenerationActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< MonitorProxiesOneGenerationActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont11(int loopDepth) + { + #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (rep.present()) - #line 4207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (rep.get().read().forward.present()) - #line 4211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" TraceEvent("MonitorProxiesForwarding") .detail("NewConnStr", rep.get().read().forward.get().toString()) .detail("OldConnStr", info.intermediateConnRecord->getConnectionString().toString()); - #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info.intermediateConnRecord = connRecord->makeIntermediateRecord( ClusterConnectionString(rep.get().read().forward.get().toString())); - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + ASSERT(info.intermediateConnRecord->getConnectionString().getNumberOfCoordinators() > 0); + #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(info); this->~MonitorProxiesOneGenerationActorState(); static_cast(this)->destroy(); return 0; } - #line 4219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" new (&static_cast(this)->SAV< MonitorLeaderInfo >::value()) MonitorLeaderInfo(std::move(info)); // state_var_RVO this->~MonitorProxiesOneGenerationActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (connRecord != info.intermediateConnRecord) - #line 4227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (!info.hasConnected) - #line 4231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" TraceEvent(SevWarnAlways, "IncorrectClusterFileContentsAtConnection") .detail("ClusterFile", connRecord->toString()) .detail("StoredConnectionString", connRecord->getConnectionString().toString()) .detail("CurrentConnectionString", info.intermediateConnRecord->getConnectionString().toString()); - #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - connRecord->setAndPersistConnectionString(info.intermediateConnRecord->getConnectionString()); - #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - info.intermediateConnRecord = connRecord; - #line 4241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + StrictFuture __when_expr_3 = connRecord->setAndPersistConnectionString(info.intermediateConnRecord->getConnectionString()); + #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 4603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont11when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont11cont2(loopDepth); } - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - info.hasConnected = true; - #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - connRecord->notifyConnected(); - #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - auto& ni = rep.get().mutate(); - #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - shrinkProxyList(ni, lastCommitProxyUIDs, lastCommitProxies, lastGrvProxyUIDs, lastGrvProxies); - #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - clientInfo->setUnconditional(ni); - #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - successIndex = index; - #line 4255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - loopDepth = a_body1loopBody1cont11(loopDepth); } else { + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + CODE_PROBE(rep.getError().code() == error_code_failed_to_progress, "Coordinator cannot talk to cluster controller"); #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - TEST(rep.getError().code() == error_code_failed_to_progress); - #line 973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - TEST(rep.getError().code() == error_code_lookup_failed); - #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - index = (index + 1) % coordinatorsSize; + TraceEvent("MonitorProxiesConnectFailed") .detail("Error", rep.getError().name()) .detail("Coordinator", clientLeaderServer.getAddressString()); #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + index = (index + 1) % coordinatorsSize; + #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (index == successIndex) - #line 4268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->COORDINATOR_RECONNECTION_DELAY); - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + allConnectionsFailed = true; + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + StrictFuture __when_expr_4 = delay(CLIENT_KNOBS->COORDINATOR_RECONNECTION_DELAY); + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont8when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont11when2(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1loopBody1cont16(loopDepth); + loopDepth = a_body1loopBody1cont11cont8(loopDepth); } } @@ -4289,30 +4649,30 @@ class MonitorProxiesOneGenerationActorState { } int a_body1loopBody1cont1when1(ErrorOr> const& __rep,int loopDepth) { - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" rep = __rep; - #line 4294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" - loopDepth = a_body1loopBody1cont8(loopDepth); + #line 4654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = a_body1loopBody1cont11(loopDepth); return loopDepth; } int a_body1loopBody1cont1when1(ErrorOr> && __rep,int loopDepth) { rep = std::move(__rep); - loopDepth = a_body1loopBody1cont8(loopDepth); + loopDepth = a_body1loopBody1cont11(loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose3() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< MonitorProxiesOneGenerationActor, 1, ErrorOr> >::remove(); + static_cast(this)->ActorCallback< MonitorProxiesOneGenerationActor, 2, ErrorOr> >::remove(); } - void a_callback_fire(ActorCallback< MonitorProxiesOneGenerationActor, 1, ErrorOr> >*,ErrorOr> const& value) + void a_callback_fire(ActorCallback< MonitorProxiesOneGenerationActor, 2, ErrorOr> >*,ErrorOr> const& value) { - fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1loopBody1cont1when1(value, 0); } @@ -4321,13 +4681,13 @@ class MonitorProxiesOneGenerationActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 1); + fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< MonitorProxiesOneGenerationActor, 1, ErrorOr> >*,ErrorOr> && value) + void a_callback_fire(ActorCallback< MonitorProxiesOneGenerationActor, 2, ErrorOr> >*,ErrorOr> && value) { - fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1loopBody1cont1when1(std::move(value), 0); } @@ -4336,13 +4696,13 @@ class MonitorProxiesOneGenerationActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 1); + fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< MonitorProxiesOneGenerationActor, 1, ErrorOr> >*,Error err) + void a_callback_error(ActorCallback< MonitorProxiesOneGenerationActor, 2, ErrorOr> >*,Error err) { - fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -4351,85 +4711,106 @@ class MonitorProxiesOneGenerationActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 1); + fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 2); } - int a_body1loopBody1cont11(int loopDepth) + int a_body1loopBody1cont11cont1(int loopDepth) { if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1loopBody1cont16(int loopDepth) + int a_body1loopBody1cont11cont2(int loopDepth) { - loopDepth = a_body1loopBody1cont11(loopDepth); + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + info.hasConnected = true; + #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + connRecord->notifyConnected(); + #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + auto& ni = rep.get().mutate(); + #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + shrinkProxyList(ni, lastCommitProxyUIDs, lastCommitProxies, lastGrvProxyUIDs, lastGrvProxies); + #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + clientInfo->setUnconditional(ni); + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + successIndex = index; + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + allConnectionsFailed = false; + #line 4739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = a_body1loopBody1cont11cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont17(Void const& _,int loopDepth) + int a_body1loopBody1cont11cont4(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont16(loopDepth); + #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + info.intermediateConnRecord = connRecord; + #line 4748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = a_body1loopBody1cont11cont2(loopDepth); return loopDepth; } - int a_body1loopBody1cont17(Void && _,int loopDepth) + int a_body1loopBody1cont11cont4(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont16(loopDepth); + #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + info.intermediateConnRecord = connRecord; + #line 4757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + loopDepth = a_body1loopBody1cont11cont2(loopDepth); return loopDepth; } - int a_body1loopBody1cont8when1(Void const& _,int loopDepth) + int a_body1loopBody1cont11when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont17(_, loopDepth); + loopDepth = a_body1loopBody1cont11cont4(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont8when1(Void && _,int loopDepth) + int a_body1loopBody1cont11when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont17(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont11cont4(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose3() + void a_exitChoose4() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< MonitorProxiesOneGenerationActor, 2, Void >::remove(); + static_cast(this)->ActorCallback< MonitorProxiesOneGenerationActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< MonitorProxiesOneGenerationActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< MonitorProxiesOneGenerationActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1loopBody1cont8when1(value, 0); + a_body1loopBody1cont11when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 2); + fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< MonitorProxiesOneGenerationActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< MonitorProxiesOneGenerationActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1loopBody1cont8when1(std::move(value), 0); + a_body1loopBody1cont11when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 2); + fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< MonitorProxiesOneGenerationActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< MonitorProxiesOneGenerationActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -4438,59 +4819,142 @@ class MonitorProxiesOneGenerationActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 2); + fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 3); + + } + int a_body1loopBody1cont11cont8(int loopDepth) + { + loopDepth = a_body1loopBody1cont11cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont11cont9(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont11cont8(loopDepth); + return loopDepth; + } + int a_body1loopBody1cont11cont9(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont11cont8(loopDepth); + + return loopDepth; } - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + int a_body1loopBody1cont11when2(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont11cont9(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont11when2(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont11cont9(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< MonitorProxiesOneGenerationActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< MonitorProxiesOneGenerationActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont11when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< MonitorProxiesOneGenerationActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont11when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< MonitorProxiesOneGenerationActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("monitorProxiesOneGeneration", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorProxiesOneGeneration", reinterpret_cast(this), 4); + + } + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference connRecord; - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference> clientInfo; - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference>> coordinator; - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorLeaderInfo info; - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference>>> supportedVersions; - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Key traceLogGroup; - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" IsInternal internal; - #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString cs; - #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" int coordinatorsSize; - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" int index; - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" int successIndex; - #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Optional incorrectTime; - #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector lastCommitProxyUIDs; - #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector lastCommitProxies; - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector lastGrvProxyUIDs; - #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector lastGrvProxies; - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" std::vector clientLeaderServers; - #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + bool allConnectionsFailed; + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClientLeaderRegInterface clientLeaderServer; - #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" OpenDatabaseCoordRequest req; - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ClusterConnectionString storedConnectionString; - #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Future>> repFuture; - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ErrorOr> rep; - #line 4488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; // This generated class is to be used only via monitorProxiesOneGeneration() - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" -class MonitorProxiesOneGenerationActor final : public Actor, public ActorCallback< MonitorProxiesOneGenerationActor, 0, bool >, public ActorCallback< MonitorProxiesOneGenerationActor, 1, ErrorOr> >, public ActorCallback< MonitorProxiesOneGenerationActor, 2, Void >, public FastAllocated, public MonitorProxiesOneGenerationActorState { - #line 4493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +class MonitorProxiesOneGenerationActor final : public Actor, public ActorCallback< MonitorProxiesOneGenerationActor, 0, bool >, public ActorCallback< MonitorProxiesOneGenerationActor, 1, Void >, public ActorCallback< MonitorProxiesOneGenerationActor, 2, ErrorOr> >, public ActorCallback< MonitorProxiesOneGenerationActor, 3, Void >, public ActorCallback< MonitorProxiesOneGenerationActor, 4, Void >, public FastAllocated, public MonitorProxiesOneGenerationActorState { + #line 4957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4499,11 +4963,13 @@ class MonitorProxiesOneGenerationActor final : public Actor, void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< MonitorProxiesOneGenerationActor, 0, bool >; -friend struct ActorCallback< MonitorProxiesOneGenerationActor, 1, ErrorOr> >; -friend struct ActorCallback< MonitorProxiesOneGenerationActor, 2, Void >; - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +friend struct ActorCallback< MonitorProxiesOneGenerationActor, 1, Void >; +friend struct ActorCallback< MonitorProxiesOneGenerationActor, 2, ErrorOr> >; +friend struct ActorCallback< MonitorProxiesOneGenerationActor, 3, Void >; +friend struct ActorCallback< MonitorProxiesOneGenerationActor, 4, Void >; + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorProxiesOneGenerationActor(Reference const& connRecord,Reference> const& clientInfo,Reference>> const& coordinator,MonitorLeaderInfo const& info,Reference>>> const& supportedVersions,Key const& traceLogGroup,IsInternal const& internal) - #line 4506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 4972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor(), MonitorProxiesOneGenerationActorState(connRecord, clientInfo, coordinator, info, supportedVersions, traceLogGroup, internal) { @@ -4522,49 +4988,51 @@ friend struct ActorCallback< MonitorProxiesOneGenerationActor, 2, Void >; this->actor_wait_state = -1; switch (wait_state) { case 1: this->a_callback_error((ActorCallback< MonitorProxiesOneGenerationActor, 0, bool >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< MonitorProxiesOneGenerationActor, 1, ErrorOr> >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< MonitorProxiesOneGenerationActor, 2, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< MonitorProxiesOneGenerationActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< MonitorProxiesOneGenerationActor, 2, ErrorOr> >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< MonitorProxiesOneGenerationActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< MonitorProxiesOneGenerationActor, 4, Void >*)0, actor_cancelled()); break; } } }; } - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" [[nodiscard]] Future monitorProxiesOneGeneration( Reference const& connRecord, Reference> const& clientInfo, Reference>> const& coordinator, MonitorLeaderInfo const& info, Reference>>> const& supportedVersions, Key const& traceLogGroup, IsInternal const& internal ) { - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" return Future(new MonitorProxiesOneGenerationActor(connRecord, clientInfo, coordinator, info, supportedVersions, traceLogGroup, internal)); - #line 4536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -#line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 4541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" namespace { // This generated class is to be used only via monitorProxies() - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" template - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class MonitorProxiesActorState { - #line 4548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorProxiesActorState(Reference>> const& connRecord,Reference> const& clientInfo,Reference>> const& coordinator,Reference>>> const& supportedVersions,Key const& traceLogGroup,IsInternal const& internal) - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" : connRecord(connRecord), - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" clientInfo(clientInfo), - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" coordinator(coordinator), - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" supportedVersions(supportedVersions), - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" traceLogGroup(traceLogGroup), - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" internal(internal), - #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info(connRecord->get()) - #line 4567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" { fdb_probe_actor_create("monitorProxies", reinterpret_cast(this)); @@ -4577,9 +5045,9 @@ class MonitorProxiesActorState { int a_body1(int loopDepth=0) { try { - #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" ; - #line 4582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -4607,22 +5075,24 @@ class MonitorProxiesActorState { } int a_body1loopBody1(int loopDepth) { - #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + ASSERT(connRecord->get().isValid()); + #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" StrictFuture __when_expr_0 = monitorProxiesOneGeneration( connRecord->get(), clientInfo, coordinator, info, supportedVersions, traceLogGroup, internal); - #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" StrictFuture __when_expr_1 = connRecord->onChange(); - #line 4618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4635,40 +5105,40 @@ class MonitorProxiesActorState { } int a_body1loopBody1when1(MonitorLeaderInfo const& _info,int loopDepth) { - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info = _info; - #line 4640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1when1(MonitorLeaderInfo && _info,int loopDepth) { - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info = _info; - #line 4649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1when2(Void const& _,int loopDepth) { - #line 997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info.hasConnected = false; - #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info.intermediateConnRecord = connRecord->get(); - #line 4660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1when2(Void && _,int loopDepth) { - #line 997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info.hasConnected = false; - #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" info.intermediateConnRecord = connRecord->get(); - #line 4671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -4770,26 +5240,26 @@ class MonitorProxiesActorState { fdb_probe_actor_exit("monitorProxies", reinterpret_cast(this), 1); } - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference>> connRecord; - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference> clientInfo; - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference>> coordinator; - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Reference>>> supportedVersions; - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" Key traceLogGroup; - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" IsInternal internal; - #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorLeaderInfo info; - #line 4787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" }; // This generated class is to be used only via monitorProxies() - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" class MonitorProxiesActor final : public Actor, public ActorCallback< MonitorProxiesActor, 0, MonitorLeaderInfo >, public ActorCallback< MonitorProxiesActor, 1, Void >, public FastAllocated, public MonitorProxiesActorState { - #line 4792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4799,9 +5269,9 @@ class MonitorProxiesActor final : public Actor, public ActorCallback< Moni #pragma clang diagnostic pop friend struct ActorCallback< MonitorProxiesActor, 0, MonitorLeaderInfo >; friend struct ActorCallback< MonitorProxiesActor, 1, Void >; - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" MonitorProxiesActor(Reference>> const& connRecord,Reference> const& clientInfo,Reference>> const& coordinator,Reference>>> const& supportedVersions,Key const& traceLogGroup,IsInternal const& internal) - #line 4804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" : Actor(), MonitorProxiesActorState(connRecord, clientInfo, coordinator, supportedVersions, traceLogGroup, internal) { @@ -4825,11 +5295,11 @@ friend struct ActorCallback< MonitorProxiesActor, 1, Void >; } }; } - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" [[nodiscard]] Future monitorProxies( Reference>> const& connRecord, Reference> const& clientInfo, Reference>> const& coordinator, Reference>>> const& supportedVersions, Key const& traceLogGroup, IsInternal const& internal ) { - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" return Future(new MonitorProxiesActor(connRecord, clientInfo, coordinator, supportedVersions, traceLogGroup, internal)); - #line 4832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" + #line 5302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.g.cpp" } -#line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" +#line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MonitorLeader.actor.cpp" diff --git a/src/fdbclient/MultiVersionTransaction.actor.cpp b/src/fdbclient/MultiVersionTransaction.actor.cpp index d5cbae9..edad018 100644 --- a/src/fdbclient/MultiVersionTransaction.actor.cpp +++ b/src/fdbclient/MultiVersionTransaction.actor.cpp @@ -18,6 +18,20 @@ * limitations under the License. */ +#ifdef __unixish__ +#include +#endif + +#include "fdbclient/IClientApi.h" +#include "fdbclient/json_spirit/json_spirit_reader_template.h" +#include "fdbclient/json_spirit/json_spirit_writer_template.h" +#include "fdbclient/json_spirit/json_spirit_value.h" +#include "flow/ThreadHelper.actor.h" +#include "flow/Trace.h" +#ifdef ADDRESS_SANITIZER +#include +#endif + #include "fdbclient/FDBOptions.g.h" #include "fdbclient/FDBTypes.h" #include "fdbclient/GenericManagementAPI.actor.h" @@ -32,6 +46,11 @@ #include "flow/Platform.h" #include "flow/ProtocolVersion.h" #include "flow/UnitTest.h" +#include "flow/Trace.h" + +#ifdef __unixish__ +#include +#endif // __unixish__ #include "flow/actorcompiler.h" // This must be the last #include. @@ -251,13 +270,14 @@ ThreadFuture>> DLTransaction::getRangeSplitPoints(c }); } -ThreadFuture>> DLTransaction::getBlobGranuleRanges(const KeyRangeRef& keyRange) { +ThreadFuture>> DLTransaction::getBlobGranuleRanges(const KeyRangeRef& keyRange, + int rangeLimit) { if (!api->transactionGetBlobGranuleRanges) { return unsupported_operation(); } FdbCApi::FDBFuture* f = api->transactionGetBlobGranuleRanges( - tr, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size()); + tr, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size(), rangeLimit); return toThreadFuture>>(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { const FdbCApi::FDBKeyRange* keyRanges; int keyRangesLength; @@ -273,10 +293,46 @@ ThreadResult DLTransaction::readBlobGranules(const KeyRangeRef& key Version beginVersion, Optional readVersion, ReadBlobGranuleContext granuleContext) { - if (!api->transactionReadBlobGranules) { + return unsupported_operation(); +} + +ThreadFuture>> DLTransaction::readBlobGranulesStart( + const KeyRangeRef& keyRange, + Version beginVersion, + Optional readVersion, + Version* readVersionOut) { + if (!api->transactionReadBlobGranulesStart) { return unsupported_operation(); } + int64_t rv = readVersion.present() ? readVersion.get() : latestVersion; + + FdbCApi::FDBFuture* f = api->transactionReadBlobGranulesStart(tr, + keyRange.begin.begin(), + keyRange.begin.size(), + keyRange.end.begin(), + keyRange.end.size(), + beginVersion, + rv, + readVersionOut); + + return ThreadFuture>>( + (ThreadSingleAssignmentVar>>*)(f)); +}; + +ThreadResult DLTransaction::readBlobGranulesFinish( + ThreadFuture>> startFuture, + const KeyRangeRef& keyRange, + Version beginVersion, + Version readVersion, + ReadBlobGranuleContext granuleContext) { + if (!api->transactionReadBlobGranulesFinish) { + return unsupported_operation(); + } + + // convert back to fdb future for API + FdbCApi::FDBFuture* f = (FdbCApi::FDBFuture*)(startFuture.extractPtr()); + // FIXME: better way to convert here? FdbCApi::FDBReadBlobGranuleContext context; context.userContext = granuleContext.userContext; @@ -286,25 +342,40 @@ ThreadResult DLTransaction::readBlobGranules(const KeyRangeRef& key context.debugNoMaterialize = granuleContext.debugNoMaterialize; context.granuleParallelism = granuleContext.granuleParallelism; - int64_t rv = readVersion.present() ? readVersion.get() : latestVersion; + FdbCApi::FDBResult* r = api->transactionReadBlobGranulesFinish(tr, + f, + keyRange.begin.begin(), + keyRange.begin.size(), + keyRange.end.begin(), + keyRange.end.size(), + beginVersion, + readVersion, + &context); + + return ThreadResult((ThreadSingleAssignmentVar*)(r)); +}; + +ThreadFuture>> +DLTransaction::summarizeBlobGranules(const KeyRangeRef& keyRange, Optional summaryVersion, int rangeLimit) { + if (!api->transactionSummarizeBlobGranules) { + return unsupported_operation(); + } + + int64_t sv = summaryVersion.present() ? summaryVersion.get() : latestVersion; - FdbCApi::FDBResult* r = api->transactionReadBlobGranules(tr, - keyRange.begin.begin(), - keyRange.begin.size(), - keyRange.end.begin(), - keyRange.end.size(), - beginVersion, - rv, - context); - const FdbCApi::FDBKeyValue* kvs; - int count; - FdbCApi::fdb_bool_t more; - FdbCApi::fdb_error_t error = api->resultGetKeyValueArray(r, &kvs, &count, &more); - ASSERT(!error); - - // The memory for this is stored in the FDBResult and is released when the result gets destroyed - return ThreadResult( - RangeResult(RangeResultRef(VectorRef((KeyValueRef*)kvs, count), more), Arena())); + FdbCApi::FDBFuture* f = api->transactionSummarizeBlobGranules( + tr, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size(), sv, rangeLimit); + + return toThreadFuture>>( + api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + const FdbCApi::FDBGranuleSummary* summaries; + int summariesLength; + FdbCApi::fdb_error_t error = api->futureGetGranuleSummaryArray(f, &summaries, &summariesLength); + ASSERT(!error); + // The memory for this is stored in the FDBFuture and is released when the future gets destroyed + return Standalone>( + VectorRef((BlobGranuleSummaryRef*)summaries, summariesLength), Arena()); + }); } void DLTransaction::addReadConflictRange(const KeyRangeRef& keys) { @@ -356,6 +427,34 @@ Version DLTransaction::getCommittedVersion() { return version; } +ThreadFuture DLTransaction::getTagThrottledDuration() { + if (!api->transactionGetTagThrottledDuration) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->transactionGetTagThrottledDuration(tr); + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + double duration; + FdbCApi::fdb_error_t error = api->futureGetDouble(f, &duration); + ASSERT(!error); + return duration; + }); +} + +ThreadFuture DLTransaction::getTotalCost() { + if (!api->transactionGetTotalCost) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->transactionGetTotalCost(tr); + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + int64_t size = 0; + FdbCApi::fdb_error_t error = api->futureGetInt64(f, &size); + ASSERT(!error); + return size; + }); +} + ThreadFuture DLTransaction::getApproximateSize() { if (!api->transactionGetApproximateSize) { return unsupported_operation(); @@ -387,6 +486,14 @@ void DLTransaction::reset() { api->transactionReset(tr); } +void DLTransaction::debugTrace(BaseTraceEvent&& event) { + event.detail("CommitResult", "Deferred logging unsupported").log(); +}; + +void DLTransaction::debugPrint(std::string const& message) { + fmt::print("[Deferred logging unsupported] {}\n", message); +} + ThreadFuture DLTransaction::getVersionVector() { return VersionVector(); // not implemented } @@ -400,6 +507,157 @@ Reference DLTenant::createTransaction() { return Reference(new DLTransaction(api, tr)); } +ThreadFuture DLTenant::getId() { + if (!api->tenantGetId) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->tenantGetId(tenant); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + int64_t res = 0; + FdbCApi::fdb_error_t error = api->futureGetInt64(f, &res); + ASSERT(!error); + return res; + }); +} + +ThreadFuture DLTenant::purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) { + if (!api->tenantPurgeBlobGranules) { + return unsupported_operation(); + } + FdbCApi::FDBFuture* f = api->tenantPurgeBlobGranules(tenant, + keyRange.begin.begin(), + keyRange.begin.size(), + keyRange.end.begin(), + keyRange.end.size(), + purgeVersion, + force); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + const uint8_t* key; + int keyLength; + FdbCApi::fdb_error_t error = api->futureGetKey(f, &key, &keyLength); + ASSERT(!error); + + // The memory for this is stored in the FDBFuture and is released when the future gets destroyed + return Key(KeyRef(key, keyLength), Arena()); + }); +} + +ThreadFuture DLTenant::waitPurgeGranulesComplete(const KeyRef& purgeKey) { + if (!api->tenantWaitPurgeGranulesComplete) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->tenantWaitPurgeGranulesComplete(tenant, purgeKey.begin(), purgeKey.size()); + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { return Void(); }); +} + +ThreadFuture DLTenant::blobbifyRange(const KeyRangeRef& keyRange) { + if (!api->tenantBlobbifyRange) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->tenantBlobbifyRange( + tenant, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size()); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + +ThreadFuture DLTenant::blobbifyRangeBlocking(const KeyRangeRef& keyRange) { + if (!api->tenantBlobbifyRangeBlocking) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->tenantBlobbifyRangeBlocking( + tenant, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size()); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + +ThreadFuture DLTenant::unblobbifyRange(const KeyRangeRef& keyRange) { + if (!api->tenantUnblobbifyRange) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->tenantUnblobbifyRange( + tenant, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size()); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + +ThreadFuture>> DLTenant::listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) { + if (!api->tenantListBlobbifiedRanges) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->tenantListBlobbifiedRanges( + tenant, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size(), rangeLimit); + + return toThreadFuture>>(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + const FdbCApi::FDBKeyRange* keyRanges; + int keyRangesLength; + FdbCApi::fdb_error_t error = api->futureGetKeyRangeArray(f, &keyRanges, &keyRangesLength); + ASSERT(!error); + // The memory for this is stored in the FDBFuture and is released when the future gets destroyed. + return Standalone>(VectorRef((KeyRangeRef*)keyRanges, keyRangesLength), + Arena()); + }); +} + +ThreadFuture DLTenant::verifyBlobRange(const KeyRangeRef& keyRange, Optional version) { + if (!api->tenantVerifyBlobRange) { + return unsupported_operation(); + } + + Version readVersion = version.present() ? version.get() : latestVersion; + + FdbCApi::FDBFuture* f = api->tenantVerifyBlobRange( + tenant, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size(), readVersion); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + Version version = invalidVersion; + ASSERT(!api->futureGetInt64(f, &version)); + return version; + }); +} + +ThreadFuture DLTenant::flushBlobRange(const KeyRangeRef& keyRange, bool compact, Optional version) { + if (!api->tenantFlushBlobRange) { + return unsupported_operation(); + } + + Version readVersion = version.present() ? version.get() : latestVersion; + + FdbCApi::FDBFuture* f = api->tenantFlushBlobRange(tenant, + keyRange.begin.begin(), + keyRange.begin.size(), + keyRange.end.begin(), + keyRange.end.size(), + compact, + readVersion); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + // DLDatabase DLDatabase::DLDatabase(Reference api, ThreadFuture dbFuture) : api(api), db(nullptr) { addref(); @@ -510,8 +768,7 @@ double DLDatabase::getMainThreadBusyness() { ThreadFuture DLDatabase::getServerProtocol(Optional expectedVersion) { ASSERT(api->databaseGetServerProtocol != nullptr); - uint64_t expected = - expectedVersion.map([](const ProtocolVersion& v) { return v.version(); }).orDefault(0); + uint64_t expected = expectedVersion.map(&ProtocolVersion::version).orDefault(0); FdbCApi::FDBFuture* f = api->databaseGetServerProtocol(db, expected); return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { uint64_t pv; @@ -522,16 +779,16 @@ ThreadFuture DLDatabase::getServerProtocol(Optional DLDatabase::purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) { - if (!api->purgeBlobGranules) { + if (!api->databasePurgeBlobGranules) { return unsupported_operation(); } - FdbCApi::FDBFuture* f = api->purgeBlobGranules(db, - keyRange.begin.begin(), - keyRange.begin.size(), - keyRange.end.begin(), - keyRange.end.size(), - purgeVersion, - force); + FdbCApi::FDBFuture* f = api->databasePurgeBlobGranules(db, + keyRange.begin.begin(), + keyRange.begin.size(), + keyRange.end.begin(), + keyRange.end.size(), + purgeVersion, + force); return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { const uint8_t* key; @@ -545,14 +802,134 @@ ThreadFuture DLDatabase::purgeBlobGranules(const KeyRangeRef& keyRange, Ver } ThreadFuture DLDatabase::waitPurgeGranulesComplete(const KeyRef& purgeKey) { - if (!api->waitPurgeGranulesComplete) { + if (!api->databaseWaitPurgeGranulesComplete) { return unsupported_operation(); } - FdbCApi::FDBFuture* f = api->waitPurgeGranulesComplete(db, purgeKey.begin(), purgeKey.size()); + FdbCApi::FDBFuture* f = api->databaseWaitPurgeGranulesComplete(db, purgeKey.begin(), purgeKey.size()); return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { return Void(); }); } +ThreadFuture DLDatabase::blobbifyRange(const KeyRangeRef& keyRange) { + if (!api->databaseBlobbifyRange) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->databaseBlobbifyRange( + db, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size()); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + +ThreadFuture DLDatabase::blobbifyRangeBlocking(const KeyRangeRef& keyRange) { + if (!api->databaseBlobbifyRangeBlocking) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->databaseBlobbifyRangeBlocking( + db, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size()); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + +ThreadFuture DLDatabase::unblobbifyRange(const KeyRangeRef& keyRange) { + if (!api->databaseUnblobbifyRange) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->databaseUnblobbifyRange( + db, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size()); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + +ThreadFuture>> DLDatabase::listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) { + if (!api->databaseListBlobbifiedRanges) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->databaseListBlobbifiedRanges( + db, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size(), rangeLimit); + + return toThreadFuture>>(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + const FdbCApi::FDBKeyRange* keyRanges; + int keyRangesLength; + FdbCApi::fdb_error_t error = api->futureGetKeyRangeArray(f, &keyRanges, &keyRangesLength); + ASSERT(!error); + // The memory for this is stored in the FDBFuture and is released when the future gets destroyed. + return Standalone>(VectorRef((KeyRangeRef*)keyRanges, keyRangesLength), + Arena()); + }); +} + +ThreadFuture DLDatabase::verifyBlobRange(const KeyRangeRef& keyRange, Optional version) { + if (!api->databaseVerifyBlobRange) { + return unsupported_operation(); + } + + Version readVersion = version.present() ? version.get() : latestVersion; + + FdbCApi::FDBFuture* f = api->databaseVerifyBlobRange( + db, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size(), readVersion); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + Version version = invalidVersion; + ASSERT(!api->futureGetInt64(f, &version)); + return version; + }); +} + +ThreadFuture DLDatabase::flushBlobRange(const KeyRangeRef& keyRange, bool compact, Optional version) { + if (!api->databaseFlushBlobRange) { + return unsupported_operation(); + } + + Version readVersion = version.present() ? version.get() : latestVersion; + + FdbCApi::FDBFuture* f = api->databaseFlushBlobRange(db, + keyRange.begin.begin(), + keyRange.begin.size(), + keyRange.end.begin(), + keyRange.end.size(), + compact, + readVersion); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + +ThreadFuture> DLDatabase::getClientStatus() { + if (!api->databaseGetClientStatus) { + return unsupported_operation(); + } + FdbCApi::FDBFuture* f = api->databaseGetClientStatus(db); + return toThreadFuture>(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + const uint8_t* str; + int strLength; + FdbCApi::fdb_error_t error = api->futureGetKey(f, &str, &strLength); + ASSERT(!error); + + // The memory for this is stored in the FDBFuture and is released when the future gets destroyed + return Standalone(StringRef(str, strLength), Arena()); + }); +} + // DLApi // Loads the specified function from a dynamic library @@ -568,7 +945,7 @@ void loadClientFunction(T* fp, void* lib, std::string libPath, const char* funct *(void**)(fp) = loadFunction(lib, functionName); if (*fp == nullptr && requireFunction) { TraceEvent(SevError, "ErrorLoadingFunction").detail("LibraryPath", libPath).detail("Function", functionName); - throw platform_error(); + throw api_function_missing(); } } @@ -596,11 +973,21 @@ void DLApi::init() { loadClientFunction(&api->selectApiVersion, lib, fdbCPath, "fdb_select_api_version_impl", headerVersion >= 0); loadClientFunction(&api->getClientVersion, lib, fdbCPath, "fdb_get_client_version", headerVersion >= 410); + loadClientFunction(&api->useFutureProtocolVersion, + lib, + fdbCPath, + "fdb_use_future_protocol_version", + headerVersion >= ApiVersion::withFutureProtocolVersionApi().version()); loadClientFunction(&api->setNetworkOption, lib, fdbCPath, "fdb_network_set_option", headerVersion >= 0); loadClientFunction(&api->setupNetwork, lib, fdbCPath, "fdb_setup_network", headerVersion >= 0); loadClientFunction(&api->runNetwork, lib, fdbCPath, "fdb_run_network", headerVersion >= 0); loadClientFunction(&api->stopNetwork, lib, fdbCPath, "fdb_stop_network", headerVersion >= 0); loadClientFunction(&api->createDatabase, lib, fdbCPath, "fdb_create_database", headerVersion >= 610); + loadClientFunction(&api->createDatabaseFromConnectionString, + lib, + fdbCPath, + "fdb_create_database_from_connection_string", + headerVersion >= ApiVersion::withCreateDBFromConnString().version()); loadClientFunction(&api->databaseOpenTenant, lib, fdbCPath, "fdb_database_open_tenant", headerVersion >= 710); loadClientFunction( @@ -626,18 +1013,95 @@ void DLApi::init() { headerVersion >= 700); loadClientFunction( &api->databaseCreateSnapshot, lib, fdbCPath, "fdb_database_create_snapshot", headerVersion >= 700); - loadClientFunction( - &api->purgeBlobGranules, lib, fdbCPath, "fdb_database_purge_blob_granules", headerVersion >= 710); - - loadClientFunction(&api->waitPurgeGranulesComplete, + &api->databasePurgeBlobGranules, lib, fdbCPath, "fdb_database_purge_blob_granules", headerVersion >= 710); + loadClientFunction(&api->databaseWaitPurgeGranulesComplete, lib, fdbCPath, "fdb_database_wait_purge_granules_complete", headerVersion >= 710); - + loadClientFunction(&api->databaseBlobbifyRange, + lib, + fdbCPath, + "fdb_database_blobbify_range", + headerVersion >= ApiVersion::withBlobRangeApi().version()); + loadClientFunction(&api->databaseBlobbifyRangeBlocking, + lib, + fdbCPath, + "fdb_database_blobbify_range_blocking", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->databaseUnblobbifyRange, + lib, + fdbCPath, + "fdb_database_unblobbify_range", + headerVersion >= ApiVersion::withBlobRangeApi().version()); + loadClientFunction(&api->databaseListBlobbifiedRanges, + lib, + fdbCPath, + "fdb_database_list_blobbified_ranges", + headerVersion >= ApiVersion::withBlobRangeApi().version()); + loadClientFunction(&api->databaseVerifyBlobRange, + lib, + fdbCPath, + "fdb_database_verify_blob_range", + headerVersion >= ApiVersion::withBlobRangeApi().version()); + loadClientFunction(&api->databaseFlushBlobRange, + lib, + fdbCPath, + "fdb_database_flush_blob_range", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->databaseGetClientStatus, + lib, + fdbCPath, + "fdb_database_get_client_status", + headerVersion >= ApiVersion::withGetClientStatus().version()); loadClientFunction( &api->tenantCreateTransaction, lib, fdbCPath, "fdb_tenant_create_transaction", headerVersion >= 710); + loadClientFunction(&api->tenantPurgeBlobGranules, + lib, + fdbCPath, + "fdb_tenant_purge_blob_granules", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantWaitPurgeGranulesComplete, + lib, + fdbCPath, + "fdb_tenant_wait_purge_granules_complete", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantBlobbifyRange, + lib, + fdbCPath, + "fdb_tenant_blobbify_range", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantBlobbifyRangeBlocking, + lib, + fdbCPath, + "fdb_tenant_blobbify_range_blocking", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantUnblobbifyRange, + lib, + fdbCPath, + "fdb_tenant_unblobbify_range", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantListBlobbifiedRanges, + lib, + fdbCPath, + "fdb_tenant_list_blobbified_ranges", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantVerifyBlobRange, + lib, + fdbCPath, + "fdb_tenant_verify_blob_range", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantFlushBlobRange, + lib, + fdbCPath, + "fdb_tenant_flush_blob_range", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantGetId, + lib, + fdbCPath, + "fdb_tenant_get_id", + headerVersion >= ApiVersion::withTenantGetId().version()); loadClientFunction(&api->tenantDestroy, lib, fdbCPath, "fdb_tenant_destroy", headerVersion >= 710); loadClientFunction(&api->transactionSetOption, lib, fdbCPath, "fdb_transaction_set_option", headerVersion >= 0); @@ -668,6 +1132,16 @@ void DLApi::init() { fdbCPath, "fdb_transaction_get_committed_version", headerVersion >= 0); + loadClientFunction(&api->transactionGetTagThrottledDuration, + lib, + fdbCPath, + "fdb_transaction_get_tag_throttled_duration", + headerVersion >= ApiVersion::withGetTagThrottledDuration().version()); + loadClientFunction(&api->transactionGetTotalCost, + lib, + fdbCPath, + "fdb_transaction_get_total_cost", + headerVersion >= ApiVersion::withGetTotalCost().version()); loadClientFunction(&api->transactionGetApproximateSize, lib, fdbCPath, @@ -697,11 +1171,36 @@ void DLApi::init() { headerVersion >= 710); loadClientFunction( &api->transactionReadBlobGranules, lib, fdbCPath, "fdb_transaction_read_blob_granules", headerVersion >= 710); + loadClientFunction(&api->transactionReadBlobGranulesStart, + lib, + fdbCPath, + "fdb_transaction_read_blob_granules_start", + headerVersion >= ApiVersion::withBlobRangeApi().version()); + loadClientFunction(&api->transactionReadBlobGranulesFinish, + lib, + fdbCPath, + "fdb_transaction_read_blob_granules_finish", + headerVersion >= ApiVersion::withBlobRangeApi().version()); + loadClientFunction(&api->transactionSummarizeBlobGranules, + lib, + fdbCPath, + "fdb_transaction_summarize_blob_granules", + headerVersion >= ApiVersion::withBlobRangeApi().version()); + loadClientFunction(&api->futureGetDouble, + lib, + fdbCPath, + "fdb_future_get_double", + headerVersion >= ApiVersion::withFutureGetDouble().version()); loadClientFunction(&api->futureGetInt64, lib, fdbCPath, headerVersion >= 620 ? "fdb_future_get_int64" : "fdb_future_get_version", headerVersion >= 0); + loadClientFunction(&api->futureGetBool, + lib, + fdbCPath, + "fdb_future_get_bool", + headerVersion >= ApiVersion::withFutureGetBool().version()); loadClientFunction(&api->futureGetUInt64, lib, fdbCPath, "fdb_future_get_uint64", headerVersion >= 700); loadClientFunction(&api->futureGetError, lib, fdbCPath, "fdb_future_get_error", headerVersion >= 0); loadClientFunction(&api->futureGetKey, lib, fdbCPath, "fdb_future_get_key", headerVersion >= 0); @@ -714,6 +1213,11 @@ void DLApi::init() { &api->futureGetKeyValueArray, lib, fdbCPath, "fdb_future_get_keyvalue_array", headerVersion >= 0); loadClientFunction( &api->futureGetMappedKeyValueArray, lib, fdbCPath, "fdb_future_get_mappedkeyvalue_array", headerVersion >= 710); + loadClientFunction(&api->futureGetGranuleSummaryArray, + lib, + fdbCPath, + "fdb_future_get_granule_summary_array", + headerVersion >= ApiVersion::withBlobRangeApi().version()); loadClientFunction(&api->futureGetSharedState, lib, fdbCPath, "fdb_future_get_shared_state", headerVersion >= 710); loadClientFunction(&api->futureSetCallback, lib, fdbCPath, "fdb_future_set_callback", headerVersion >= 0); loadClientFunction(&api->futureCancel, lib, fdbCPath, "fdb_future_cancel", headerVersion >= 0); @@ -748,6 +1252,14 @@ const char* DLApi::getClientVersion() { return api->getClientVersion(); } +void DLApi::useFutureProtocolVersion() { + if (!api->useFutureProtocolVersion) { + return; + } + + api->useFutureProtocolVersion(); +} + void DLApi::setNetworkOption(FDBNetworkOptions::Option option, Optional value) { throwIfError(api->setNetworkOption(static_cast(option), value.present() ? value.get().begin() : nullptr, @@ -829,6 +1341,16 @@ Reference DLApi::createDatabase(const char* clusterFilePath) { } } +Reference DLApi::createDatabaseFromConnectionString(const char* connectionString) { + if (api->createDatabaseFromConnectionString == nullptr) { + throw unsupported_operation(); + } + + FdbCApi::FDBDatabase* db; + throwIfError(api->createDatabaseFromConnectionString(connectionString, &db)); + return Reference(new DLDatabase(api, db)); +} + void DLApi::addNetworkThreadCompletionHook(void (*hook)(void*), void* hookParameter) { MutexHolder holder(lock); threadCompletionHooks.emplace_back(hook, hookParameter); @@ -840,7 +1362,7 @@ MultiVersionTransaction::MultiVersionTransaction(Reference UniqueOrderedOptionList defaultOptions) : db(db), tenant(tenant), startTime(timer_monotonic()), timeoutTsav(new ThreadSingleAssignmentVar()) { setDefaultOptions(defaultOptions); - updateTransaction(); + updateTransaction(false); } void MultiVersionTransaction::setDefaultOptions(UniqueOrderedOptionList options) { @@ -848,7 +1370,7 @@ void MultiVersionTransaction::setDefaultOptions(UniqueOrderedOptionListcreateTransaction(); } - newTr.onChange = currentTenant.onChange; } else { auto currentDb = db->dbState->dbVar->get(); if (currentDb.value) { newTr.transaction = currentDb.value->createTransaction(); } - newTr.onChange = currentDb.onChange; } - Optional timeout; - for (auto option : persistentOptions) { - if (option.first == FDBTransactionOptions::TIMEOUT) { - timeout = option.second.castTo(); - } else if (newTr.transaction) { - newTr.transaction->setOption(option.first, option.second.castTo()); + // When called from the constructor or from reset(), all persistent options are database options and therefore + // alredy set on newTr.transaction if it got created sucessfully. If newTr.transaction could not be created (i.e., + // because no database with a matching version is present), the local timeout set in setTimeout() applies, so we + // need to set it. + if (setPersistentOptions || !newTr.transaction) { + Optional timeout; + for (auto const& option : persistentOptions) { + if (option.first == FDBTransactionOptions::TIMEOUT) { + timeout = option.second.castTo(); + } else if (newTr.transaction) { + newTr.transaction->setOption(option.first, option.second.castTo()); + } } - } - - // Setting a timeout can immediately cause a transaction to fail. The only timeout - // that matters is the one most recently set, so we ignore any earlier set timeouts - // that might inadvertently fail the transaction. - if (timeout.present()) { - setTimeout(timeout); if (newTr.transaction) { - newTr.transaction->setOption(FDBTransactionOptions::TIMEOUT, timeout); + for (auto const& option : sensitivePersistentOptions) { + newTr.transaction->setOption(option.first, option.second.castTo()); + } } - } + // Setting a timeout can immediately cause a transaction to fail. The only timeout + // that matters is the one most recently set, so we ignore any earlier set timeouts + // that might inadvertently fail the transaction. + if (timeout.present()) { + if (newTr.transaction) { + newTr.transaction->setOption(FDBTransactionOptions::TIMEOUT, timeout); + resetTimeout(); + } else { + setTimeout(timeout); + } + } + } lock.enter(); transaction = newTr; lock.leave(); @@ -913,22 +1445,35 @@ void MultiVersionTransaction::setVersion(Version v) { } } -ThreadFuture MultiVersionTransaction::getReadVersion() { +template +ThreadFuture MultiVersionTransaction::executeOperation(ThreadFuture (ITransaction::*func)(Args...), + Args&&... args) { auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getReadVersion() : makeTimeout(); - return abortableFuture(f, tr.onChange); + if (tr.transaction) { + auto f = (tr.transaction.getPtr()->*func)(std::forward(args)...); + return abortableFuture(f, tr.onChange); + } + + // If database initialization failed, return the initialization error + auto dbError = db->dbState->getInitializationError(); + if (dbError.isError()) { + return ThreadFuture(dbError.getError()); + } + + // Wait for the database to be initialized + return abortableFuture(makeTimeout(), tr.onChange); +} + +ThreadFuture MultiVersionTransaction::getReadVersion() { + return executeOperation(&ITransaction::getReadVersion); } ThreadFuture> MultiVersionTransaction::get(const KeyRef& key, bool snapshot) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->get(key, snapshot) : makeTimeout>(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::get, key, std::forward(snapshot)); } ThreadFuture MultiVersionTransaction::getKey(const KeySelectorRef& key, bool snapshot) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getKey(key, snapshot) : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getKey, key, std::forward(snapshot)); } ThreadFuture MultiVersionTransaction::getRange(const KeySelectorRef& begin, @@ -936,10 +1481,12 @@ ThreadFuture MultiVersionTransaction::getRange(const KeySelectorRef int limit, bool snapshot, bool reverse) { - auto tr = getTransaction(); - auto f = - tr.transaction ? tr.transaction->getRange(begin, end, limit, snapshot, reverse) : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getRange, + begin, + end, + std::forward(limit), + std::forward(snapshot), + std::forward(reverse)); } ThreadFuture MultiVersionTransaction::getRange(const KeySelectorRef& begin, @@ -947,28 +1494,34 @@ ThreadFuture MultiVersionTransaction::getRange(const KeySelectorRef GetRangeLimits limits, bool snapshot, bool reverse) { - auto tr = getTransaction(); - auto f = - tr.transaction ? tr.transaction->getRange(begin, end, limits, snapshot, reverse) : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getRange, + begin, + end, + std::forward(limits), + std::forward(snapshot), + std::forward(reverse)); } ThreadFuture MultiVersionTransaction::getRange(const KeyRangeRef& keys, int limit, bool snapshot, bool reverse) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getRange(keys, limit, snapshot, reverse) : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getRange, + keys, + std::forward(limit), + std::forward(snapshot), + std::forward(reverse)); } ThreadFuture MultiVersionTransaction::getRange(const KeyRangeRef& keys, GetRangeLimits limits, bool snapshot, bool reverse) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getRange(keys, limits, snapshot, reverse) : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getRange, + keys, + std::forward(limits), + std::forward(snapshot), + std::forward(reverse)); } ThreadFuture MultiVersionTransaction::getMappedRange(const KeySelectorRef& begin, @@ -977,23 +1530,21 @@ ThreadFuture MultiVersionTransaction::getMappedRange(const Ke GetRangeLimits limits, bool snapshot, bool reverse) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getMappedRange(begin, end, mapper, limits, snapshot, reverse) - : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getMappedRange, + begin, + end, + mapper, + std::forward(limits), + std::forward(snapshot), + std::forward(reverse)); } ThreadFuture> MultiVersionTransaction::getVersionstamp() { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getVersionstamp() : makeTimeout>(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getVersionstamp); } ThreadFuture>> MultiVersionTransaction::getAddressesForKey(const KeyRef& key) { - auto tr = getTransaction(); - auto f = - tr.transaction ? tr.transaction->getAddressesForKey(key) : makeTimeout>>(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getAddressesForKey, key); } void MultiVersionTransaction::addReadConflictRange(const KeyRangeRef& keys) { @@ -1004,39 +1555,76 @@ void MultiVersionTransaction::addReadConflictRange(const KeyRangeRef& keys) { } ThreadFuture MultiVersionTransaction::getEstimatedRangeSizeBytes(const KeyRangeRef& keys) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getEstimatedRangeSizeBytes(keys) : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getEstimatedRangeSizeBytes, keys); } ThreadFuture>> MultiVersionTransaction::getRangeSplitPoints(const KeyRangeRef& range, int64_t chunkSize) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getRangeSplitPoints(range, chunkSize) - : makeTimeout>>(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getRangeSplitPoints, range, std::forward(chunkSize)); } ThreadFuture>> MultiVersionTransaction::getBlobGranuleRanges( - const KeyRangeRef& keyRange) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getBlobGranuleRanges(keyRange) - : makeTimeout>>(); - return abortableFuture(f, tr.onChange); + const KeyRangeRef& keyRange, + int rangeLimit) { + return executeOperation(&ITransaction::getBlobGranuleRanges, keyRange, std::forward(rangeLimit)); } ThreadResult MultiVersionTransaction::readBlobGranules(const KeyRangeRef& keyRange, Version beginVersion, Optional readVersion, ReadBlobGranuleContext granuleContext) { + // FIXME: prevent from calling this from another main thread? auto tr = getTransaction(); if (tr.transaction) { - return tr.transaction->readBlobGranules(keyRange, beginVersion, readVersion, granuleContext); + Version readVersionOut; + auto f = tr.transaction->readBlobGranulesStart(keyRange, beginVersion, readVersion, &readVersionOut); + auto abortableF = abortableFuture(f, tr.onChange); + abortableF.blockUntilReadyCheckOnMainThread(); + if (abortableF.isError()) { + return ThreadResult(abortableF.getError()); + } + if (granuleContext.debugNoMaterialize) { + return ThreadResult(blob_granule_not_materialized()); + } + return tr.transaction->readBlobGranulesFinish( + abortableF, keyRange, beginVersion, readVersionOut, granuleContext); } else { return abortableTimeoutResult(tr.onChange); } } +ThreadFuture>> MultiVersionTransaction::readBlobGranulesStart( + const KeyRangeRef& keyRange, + Version beginVersion, + Optional readVersion, + Version* readVersionOut) { + return executeOperation(&ITransaction::readBlobGranulesStart, + keyRange, + std::forward(beginVersion), + std::forward>(readVersion), + std::forward(readVersionOut)); +} + +ThreadResult MultiVersionTransaction::readBlobGranulesFinish( + ThreadFuture>> startFuture, + const KeyRangeRef& keyRange, + Version beginVersion, + Version readVersion, + ReadBlobGranuleContext granuleContext) { + // can't call this directly + return ThreadResult(unsupported_operation()); +} + +ThreadFuture>> MultiVersionTransaction::summarizeBlobGranules( + const KeyRangeRef& keyRange, + Optional summaryVersion, + int rangeLimit) { + return executeOperation(&ITransaction::summarizeBlobGranules, + keyRange, + std::forward>(summaryVersion), + std::forward(rangeLimit)); +} + void MultiVersionTransaction::atomicOp(const KeyRef& key, const ValueRef& value, uint32_t operationType) { auto tr = getTransaction(); if (tr.transaction) { @@ -1073,9 +1661,7 @@ void MultiVersionTransaction::clear(const KeyRef& key) { } ThreadFuture MultiVersionTransaction::watch(const KeyRef& key) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->watch(key) : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::watch, key); } void MultiVersionTransaction::addWriteConflictRange(const KeyRangeRef& keys) { @@ -1086,9 +1672,7 @@ void MultiVersionTransaction::addWriteConflictRange(const KeyRangeRef& keys) { } ThreadFuture MultiVersionTransaction::commit() { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->commit() : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::commit); } Version MultiVersionTransaction::getCommittedVersion() { @@ -1096,7 +1680,6 @@ Version MultiVersionTransaction::getCommittedVersion() { if (tr.transaction) { return tr.transaction->getCommittedVersion(); } - return invalidVersion; } @@ -1109,21 +1692,29 @@ ThreadFuture MultiVersionTransaction::getVersionVector() { return VersionVector(); } -ThreadFuture MultiVersionTransaction::getSpanID() { +ThreadFuture MultiVersionTransaction::getSpanContext() { auto tr = getTransaction(); if (tr.transaction) { - return tr.transaction->getSpanID(); + return tr.transaction->getSpanContext(); } - return UID(); + return SpanContext(); } -ThreadFuture MultiVersionTransaction::getApproximateSize() { +ThreadFuture MultiVersionTransaction::getTagThrottledDuration() { auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getApproximateSize() : makeTimeout(); + auto f = tr.transaction ? tr.transaction->getTagThrottledDuration() : makeTimeout(); return abortableFuture(f, tr.onChange); } +ThreadFuture MultiVersionTransaction::getTotalCost() { + return executeOperation(&ITransaction::getTotalCost); +} + +ThreadFuture MultiVersionTransaction::getApproximateSize() { + return executeOperation(&ITransaction::getApproximateSize); +} + void MultiVersionTransaction::setOption(FDBTransactionOptions::Option option, Optional value) { auto itr = FDBTransactionOptions::optionInfo.find(option); if (itr == FDBTransactionOptions::optionInfo.end()) { @@ -1131,40 +1722,40 @@ void MultiVersionTransaction::setOption(FDBTransactionOptions::Option option, Op throw invalid_option(); } - if (MultiVersionApi::apiVersionAtLeast(610) && itr->second.persistent) { - persistentOptions.emplace_back(option, value.castTo>()); - } - - if (itr->first == FDBTransactionOptions::TIMEOUT) { - setTimeout(value); + if (MultiVersionApi::api->getApiVersion().hasPersistentOptions() && itr->second.persistent) { + if (itr->second.sensitive) + sensitivePersistentOptions.emplace_back(option, value.castTo()); + else + persistentOptions.emplace_back(option, value.castTo>()); } auto tr = getTransaction(); if (tr.transaction) { tr.transaction->setOption(option, value); + } else if (itr->first == FDBTransactionOptions::TIMEOUT) { + setTimeout(value); } } ThreadFuture MultiVersionTransaction::onError(Error const& e) { if (e.code() == error_code_cluster_version_changed) { - updateTransaction(); + updateTransaction(true); return ThreadFuture(Void()); } else { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->onError(e) : makeTimeout(); - f = abortableFuture(f, tr.onChange); - - return flatMapThreadFuture(f, [this, e](ErrorOr ready) { - if (!ready.isError() || ready.getError().code() != error_code_cluster_version_changed) { - if (ready.isError()) { - return ErrorOr>(ready.getError()); - } - + auto f = executeOperation(&ITransaction::onError, e); + return flatMapThreadFuture(f, [this](ErrorOr ready) { + if (ready.isError() && ready.getError().code() == error_code_cluster_version_changed) { + // In case of a cluster version change, upgrade (or downgrade) the transaction + // and let it to be retried independently of the original error + updateTransaction(true); + return ErrorOr>(Void()); + } + // In all other cases forward the result of the inner onError call + if (ready.isError()) { + return ErrorOr>(ready.getError()); + } else { return ErrorOr>(Void()); } - - updateTransaction(); - return ErrorOr>(onError(e)); }); } } @@ -1180,7 +1771,10 @@ Optional MultiVersionTransaction::getTenant() { // Waits for the specified duration and signals the assignment variable with a timed out error // This will be canceled if a new timeout is set, in which case the tsav will not be signaled. ACTOR Future timeoutImpl(Reference> tsav, double duration) { - wait(delay(duration)); + state double endTime = now() + duration; + while (now() < endTime) { + wait(delayUntil(std::min(endTime + 0.0001, now() + CLIENT_KNOBS->TRANSACTION_TIMEOUT_DELAY_INTERVAL))); + } tsav->trySendError(transaction_timed_out()); return Void(); @@ -1220,14 +1814,17 @@ void MultiVersionTransaction::setTimeout(Optional value) { { // lock scope ThreadSpinLockHolder holder(timeoutLock); - - Reference> tsav = timeoutTsav; - ThreadFuture newTimeout = onMainThread([transactionStartTime, tsav, timeoutDuration]() { - return timeoutImpl(tsav, timeoutDuration - std::max(0.0, now() - transactionStartTime)); - }); - prevTimeout = currentTimeout; - currentTimeout = newTimeout; + + if (timeoutDuration > 0) { + Reference> tsav = timeoutTsav; + ThreadFuture newTimeout = onMainThread([transactionStartTime, tsav, timeoutDuration]() { + return timeoutImpl(tsav, timeoutDuration - std::max(0.0, now() - transactionStartTime)); + }); + currentTimeout = newTimeout; + } else { + currentTimeout = ThreadFuture(); + } } // Cancel the previous timeout now that we have a new one. This means that changing the timeout @@ -1237,6 +1834,18 @@ void MultiVersionTransaction::setTimeout(Optional value) { } } +// Removes timeout if set. This timeout only applies if we don't have an underlying database object to connect with. +void MultiVersionTransaction::resetTimeout() { + ThreadFuture prevTimeout; + { // lock scope + ThreadSpinLockHolder holder(timeoutLock); + prevTimeout = currentTimeout; + currentTimeout = ThreadFuture(); + } + if (prevTimeout.isValid()) { + prevTimeout.cancel(); + } +} // Creates a ThreadFuture that will signal an error if the transaction times out. template ThreadFuture MultiVersionTransaction::makeTimeout() { @@ -1260,14 +1869,19 @@ ThreadFuture MultiVersionTransaction::makeTimeout() { template ThreadResult MultiVersionTransaction::abortableTimeoutResult(ThreadFuture abortSignal) { - ThreadFuture timeoutFuture = makeTimeout(); - ThreadFuture abortable = abortableFuture(timeoutFuture, abortSignal); + // If database initialization failed, return the initialization error + auto dbError = db->dbState->getInitializationError(); + if (dbError.isError()) { + return ThreadResult(dbError.getError()); + } + ThreadFuture abortable = abortableFuture(makeTimeout(), abortSignal); abortable.blockUntilReadyCheckOnMainThread(); return ThreadResult((ThreadSingleAssignmentVar*)abortable.extractPtr()); } void MultiVersionTransaction::reset() { persistentOptions.clear(); + sensitivePersistentOptions.clear(); // Reset the timeout state Reference> prevTimeoutTsav; @@ -1291,11 +1905,14 @@ void MultiVersionTransaction::reset() { } setDefaultOptions(db->dbState->transactionDefaultOptions); - updateTransaction(); + updateTransaction(false); } MultiVersionTransaction::~MultiVersionTransaction() { timeoutTsav->trySendError(transaction_cancelled()); + if (currentTimeout.isValid()) { + currentTimeout.cancel(); + } } bool MultiVersionTransaction::isValid() { @@ -1303,8 +1920,18 @@ bool MultiVersionTransaction::isValid() { return tr.transaction.isValid(); } +void MultiVersionTransaction::debugTrace(BaseTraceEvent&& event) { + auto tr = getTransaction(); + tr.transaction->debugTrace(std::move(event)); +} + +void MultiVersionTransaction::debugPrint(std::string const& message) { + auto tr = getTransaction(); + tr.transaction->debugPrint(message); +} + // MultiVersionTenant -MultiVersionTenant::MultiVersionTenant(Reference db, StringRef tenantName) +MultiVersionTenant::MultiVersionTenant(Reference db, TenantNameRef tenantName) : tenantState(makeReference(db, tenantName)) {} MultiVersionTenant::~MultiVersionTenant() { @@ -1317,7 +1944,66 @@ Reference MultiVersionTenant::createTransaction() { tenantState->db->dbState->transactionDefaultOptions)); } -MultiVersionTenant::TenantState::TenantState(Reference db, StringRef tenantName) +template +ThreadFuture MultiVersionTenant::executeOperation(ThreadFuture (ITenant::*func)(Args...), Args&&... args) { + auto tenantDb = tenantState->tenantVar->get(); + if (tenantDb.value) { + auto f = (tenantDb.value.getPtr()->*func)(std::forward(args)...); + return abortableFuture(f, tenantDb.onChange); + } + + // If database initialization failed, return the initialization error + auto dbError = tenantState->db->dbState->getInitializationError(); + if (dbError.isError()) { + return ThreadFuture(dbError.getError()); + } + + // Wait for the database to be initialized + return abortableFuture(ThreadFuture(Never()), tenantDb.onChange); +} + +ThreadFuture MultiVersionTenant::getId() { + return executeOperation(&ITenant::getId); +} + +ThreadFuture MultiVersionTenant::purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) { + return executeOperation( + &ITenant::purgeBlobGranules, keyRange, std::forward(purgeVersion), std::forward(force)); +} + +ThreadFuture MultiVersionTenant::waitPurgeGranulesComplete(const KeyRef& purgeKey) { + return executeOperation(&ITenant::waitPurgeGranulesComplete, purgeKey); +} + +ThreadFuture MultiVersionTenant::blobbifyRange(const KeyRangeRef& keyRange) { + return executeOperation(&ITenant::blobbifyRange, keyRange); +} + +ThreadFuture MultiVersionTenant::blobbifyRangeBlocking(const KeyRangeRef& keyRange) { + return executeOperation(&ITenant::blobbifyRangeBlocking, keyRange); +} + +ThreadFuture MultiVersionTenant::unblobbifyRange(const KeyRangeRef& keyRange) { + return executeOperation(&ITenant::unblobbifyRange, keyRange); +} + +ThreadFuture>> MultiVersionTenant::listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) { + return executeOperation(&ITenant::listBlobbifiedRanges, keyRange, std::forward(rangeLimit)); +} + +ThreadFuture MultiVersionTenant::verifyBlobRange(const KeyRangeRef& keyRange, Optional version) { + return executeOperation(&ITenant::verifyBlobRange, keyRange, std::forward>(version)); +} + +ThreadFuture MultiVersionTenant::flushBlobRange(const KeyRangeRef& keyRange, + bool compact, + Optional version) { + return executeOperation( + &ITenant::flushBlobRange, keyRange, std::forward(compact), std::forward>(version)); +} + +MultiVersionTenant::TenantState::TenantState(Reference db, TenantNameRef tenantName) : tenantVar(new ThreadSafeAsyncVar>(Reference(nullptr))), tenantName(tenantName), db(db), closed(false) { updateTenant(); @@ -1334,7 +2020,7 @@ void MultiVersionTenant::TenantState::updateTenant() { tenant = Reference(nullptr); } - tenantVar->set(tenant); + tenantVar->set(tenant, /* triggerIfSame */ !tenant.isValid()); Reference self = Reference::addRef(this); @@ -1360,13 +2046,12 @@ void MultiVersionTenant::TenantState::close() { // MultiVersionDatabase MultiVersionDatabase::MultiVersionDatabase(MultiVersionApi* api, int threadIdx, - std::string clusterFilePath, + ClusterConnectionRecord const& connectionRecord, Reference db, Reference versionMonitorDb, bool openConnectors) - : dbState(new DatabaseState(clusterFilePath, versionMonitorDb)) { - dbState->db = db; - dbState->dbVar->set(db); + : dbState(new DatabaseState(connectionRecord, versionMonitorDb)) { + dbState->setDatabase(db); if (openConnectors) { if (!api->localClientDisabled) { dbState->addClient(api->getLocalClient()); @@ -1374,7 +2059,7 @@ MultiVersionDatabase::MultiVersionDatabase(MultiVersionApi* api, api->runOnExternalClients(threadIdx, [this](Reference client) { dbState->addClient(client); }); - api->runOnExternalClientsAllThreads([&clusterFilePath](Reference client) { + api->runOnExternalClientsAllThreads([&connectionRecord](Reference client) { // This creates a database to initialize some client state on the external library. // We only do this on 6.2+ clients to avoid some bugs associated with older versions. // This deletes the new database immediately to discard its connections. @@ -1384,7 +2069,7 @@ MultiVersionDatabase::MultiVersionDatabase(MultiVersionApi* api, // to run this initialization in case the other fails, and it's safe to run them in parallel. if (client->protocolVersion.hasCloseUnusedConnection() && !client->initialized) { try { - Reference newDb = client->api->createDatabase(clusterFilePath.c_str()); + Reference newDb = connectionRecord.createDatabase(client->api); client->initialized = true; } catch (Error& e) { // This connection is not initialized. It is still possible to connect with it, @@ -1393,23 +2078,23 @@ MultiVersionDatabase::MultiVersionDatabase(MultiVersionApi* api, TraceEvent(SevWarnAlways, "FailedToInitializeExternalClient") .error(e) .detail("LibraryPath", client->libPath) - .detail("ClusterFilePath", clusterFilePath); + .detail("ConnectionRecord", connectionRecord); } } }); // For clients older than 6.2 we create and maintain our database connection - api->runOnExternalClients(threadIdx, [this, &clusterFilePath](Reference client) { + api->runOnExternalClients(threadIdx, [this, &connectionRecord](Reference client) { if (!client->protocolVersion.hasCloseUnusedConnection()) { try { dbState->legacyDatabaseConnections[client->protocolVersion] = - client->api->createDatabase(clusterFilePath.c_str()); + connectionRecord.createDatabase(client->api); } catch (Error& e) { // This connection is discarded TraceEvent(SevWarnAlways, "FailedToCreateLegacyDatabaseConnection") .error(e) .detail("LibraryPath", client->libPath) - .detail("ClusterFilePath", clusterFilePath); + .detail("ConnectionRecord", connectionRecord); } } }); @@ -1426,7 +2111,8 @@ MultiVersionDatabase::~MultiVersionDatabase() { // Create a MultiVersionDatabase that wraps an already created IDatabase object // For internal use in testing Reference MultiVersionDatabase::debugCreateFromExistingDatabase(Reference db) { - return Reference(new MultiVersionDatabase(MultiVersionApi::api, 0, "", db, db, false)); + return Reference(new MultiVersionDatabase( + MultiVersionApi::api, 0, ClusterConnectionRecord::fromConnectionString(""), db, db, false)); } Reference MultiVersionDatabase::openTenant(TenantNameRef tenantName) { @@ -1447,6 +2133,9 @@ void MultiVersionDatabase::setOption(FDBDatabaseOptions::Option option, Optional TraceEvent("UnknownDatabaseOption").detail("Option", option); throw invalid_option(); } + if (itr->first == FDBDatabaseOptions::USE_CONFIG_DATABASE) { + dbState->isConfigDB = true; + } int defaultFor = itr->second.defaultFor; if (defaultFor >= 0) { @@ -1470,20 +2159,34 @@ ThreadFuture MultiVersionDatabase::rebootWorker(const StringRef& addres return false; } +template +ThreadFuture MultiVersionDatabase::executeOperation(ThreadFuture (IDatabase::*func)(Args...), Args&&... args) { + auto db = dbState->dbVar->get(); + if (db.value) { + auto f = (db.value.getPtr()->*func)(std::forward(args)...); + return abortableFuture(f, db.onChange); + } + + // If database initialization failed, return the initialization error + auto dbError = dbState->getInitializationError(); + if (dbError.isError()) { + return ThreadFuture(dbError.getError()); + } + + // Wait for the database to be initialized + return abortableFuture(ThreadFuture(Never()), db.onChange); +} + ThreadFuture MultiVersionDatabase::forceRecoveryWithDataLoss(const StringRef& dcid) { - auto f = dbState->db ? dbState->db->forceRecoveryWithDataLoss(dcid) : ThreadFuture(Never()); - return abortableFuture(f, dbState->dbVar->get().onChange); + return executeOperation(&IDatabase::forceRecoveryWithDataLoss, dcid); } ThreadFuture MultiVersionDatabase::createSnapshot(const StringRef& uid, const StringRef& snapshot_command) { - auto f = dbState->db ? dbState->db->createSnapshot(uid, snapshot_command) : ThreadFuture(Never()); - return abortableFuture(f, dbState->dbVar->get().onChange); + return executeOperation(&IDatabase::createSnapshot, uid, snapshot_command); } ThreadFuture MultiVersionDatabase::createSharedState() { - auto dbVar = dbState->dbVar->get(); - auto f = dbVar.value ? dbVar.value->createSharedState() : ThreadFuture(Never()); - return abortableFuture(f, dbVar.onChange); + return executeOperation(&IDatabase::createSharedState); } void MultiVersionDatabase::setSharedState(DatabaseSharedState* p) { @@ -1509,12 +2212,40 @@ double MultiVersionDatabase::getMainThreadBusyness() { ThreadFuture MultiVersionDatabase::purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) { - auto f = dbState->db ? dbState->db->purgeBlobGranules(keyRange, purgeVersion, force) : ThreadFuture(Never()); - return abortableFuture(f, dbState->dbVar->get().onChange); + return executeOperation( + &IDatabase::purgeBlobGranules, keyRange, std::forward(purgeVersion), std::forward(force)); } + ThreadFuture MultiVersionDatabase::waitPurgeGranulesComplete(const KeyRef& purgeKey) { - auto f = dbState->db ? dbState->db->waitPurgeGranulesComplete(purgeKey) : ThreadFuture(Never()); - return abortableFuture(f, dbState->dbVar->get().onChange); + return executeOperation(&IDatabase::waitPurgeGranulesComplete, purgeKey); +} + +ThreadFuture MultiVersionDatabase::blobbifyRange(const KeyRangeRef& keyRange) { + return executeOperation(&IDatabase::blobbifyRange, keyRange); +} + +ThreadFuture MultiVersionDatabase::blobbifyRangeBlocking(const KeyRangeRef& keyRange) { + return executeOperation(&IDatabase::blobbifyRangeBlocking, keyRange); +} + +ThreadFuture MultiVersionDatabase::unblobbifyRange(const KeyRangeRef& keyRange) { + return executeOperation(&IDatabase::unblobbifyRange, keyRange); +} + +ThreadFuture>> MultiVersionDatabase::listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) { + return executeOperation(&IDatabase::listBlobbifiedRanges, keyRange, std::forward(rangeLimit)); +} + +ThreadFuture MultiVersionDatabase::verifyBlobRange(const KeyRangeRef& keyRange, Optional version) { + return executeOperation(&IDatabase::verifyBlobRange, keyRange, std::forward>(version)); +} + +ThreadFuture MultiVersionDatabase::flushBlobRange(const KeyRangeRef& keyRange, + bool compact, + Optional version) { + return executeOperation( + &IDatabase::flushBlobRange, keyRange, std::forward(compact), std::forward>(version)); } // Returns the protocol version reported by the coordinator this client is connected to @@ -1524,9 +2255,53 @@ ThreadFuture MultiVersionDatabase::getServerProtocol(Optional

    versionMonitorDb->getServerProtocol(expectedVersion); } -MultiVersionDatabase::DatabaseState::DatabaseState(std::string clusterFilePath, Reference versionMonitorDb) +ThreadFuture> MultiVersionDatabase::getClientStatus() { + auto stateRef = dbState; + auto db = stateRef->dbVar->get(); + if (!db.value.isValid()) { + db.value = stateRef->versionMonitorDb; + } + if (!db.value.isValid()) { + return onMainThread([stateRef] { return Future>(stateRef->getClientStatus(""_sr)); }); + } else { + // If a database is created first retrieve its status + auto f = db.value->getClientStatus(); + auto statusFuture = abortableFuture(f, db.onChange); + return flatMapThreadFuture, Standalone>( + statusFuture, [stateRef](ErrorOr> dbContextStatus) { + return onMainThread([stateRef, dbContextStatus] { + return Future>(stateRef->getClientStatus(dbContextStatus)); + }); + }); + } +} + +MultiVersionDatabase::DatabaseState::DatabaseState(ClusterConnectionRecord const& connectionRecord, + Reference versionMonitorDb) : dbVar(new ThreadSafeAsyncVar>(Reference(nullptr))), - clusterFilePath(clusterFilePath), versionMonitorDb(versionMonitorDb), closed(false) {} + connectionRecord(connectionRecord), versionMonitorDb(versionMonitorDb), + initializationState(InitializationState::INITIALIZING), isConfigDB(false) {} + +void MultiVersionDatabase::DatabaseState::setDatabase(Reference db) { + if (db.isValid()) { + initializationState = InitializationState::CREATED; + } + this->db = db; + dbVar->set(db, true); +} + +ErrorOr MultiVersionDatabase::DatabaseState::getInitializationError() { + InitializationState st = initializationState.load(); + switch (st) { + case InitializationState::INCOMPATIBLE: + return MultiVersionApi::api->failIncompatibleClient ? ErrorOr(incompatible_client()) + : ErrorOr(Void()); + case InitializationState::INITIALIZATION_FAILED: + return ErrorOr(initializationError); + default: + return ErrorOr(Void()); + } +} // Adds a client (local or externally loaded) that can be used to connect to the cluster void MultiVersionDatabase::DatabaseState::addClient(Reference client) { @@ -1570,6 +2345,11 @@ ThreadFuture MultiVersionDatabase::DatabaseState::monitorProtocolVersion() Reference self = Reference::addRef(this); return mapThreadFuture(f, [self, expected](ErrorOr cv) { + if (self->initializationState == InitializationState::CLOSED) { + return ErrorOr(Void()); + } + + ProtocolVersion clusterVersion; if (cv.isError()) { if (cv.getError().code() == error_code_operation_cancelled) { return ErrorOr(cv.getError()); @@ -1578,11 +2358,19 @@ ThreadFuture MultiVersionDatabase::DatabaseState::monitorProtocolVersion() TraceEvent("ErrorGettingClusterProtocolVersion") .error(cv.getError()) .detail("ExpectedProtocolVersion", expected); - } - ProtocolVersion clusterVersion = - !cv.isError() ? cv.get() : self->dbProtocolVersion.orDefault(currentProtocolVersion); - onMainThreadVoid([self, clusterVersion]() { self->protocolVersionChanged(clusterVersion); }); + if (self->initializationState == InitializationState::INITIALIZING) { + // A failure to retrieve the protocol error is a fatal error, such as invalid or + // missing cluster file. There is no point of retrying on it. + // Mark the database as failed and abort pending futures + self->initializationError = cv.getError(); + self->initializationState = InitializationState::INITIALIZATION_FAILED; + self->dbVar->set(Reference(), true); + } + } else { + clusterVersion = cv.get(); + onMainThreadVoid([self, clusterVersion]() { self->protocolVersionChanged(clusterVersion); }); + } return ErrorOr(Void()); }); } @@ -1590,11 +2378,12 @@ ThreadFuture MultiVersionDatabase::DatabaseState::monitorProtocolVersion() // Called when a change to the protocol version of the cluster has been detected. // Must be called from the main thread void MultiVersionDatabase::DatabaseState::protocolVersionChanged(ProtocolVersion protocolVersion) { - if (closed) { + if (initializationState == InitializationState::CLOSED) { return; } - // If the protocol version changed but is still compatible, update our local version but keep the same connection + // If the protocol version changed but is still compatible, update our local version but keep the + // same connection if (dbProtocolVersion.present() && protocolVersion.normalizedVersion() == dbProtocolVersion.get().normalizedVersion()) { dbProtocolVersion = protocolVersion; @@ -1602,74 +2391,70 @@ void MultiVersionDatabase::DatabaseState::protocolVersionChanged(ProtocolVersion ASSERT(protocolVersionMonitor.isValid()); protocolVersionMonitor.cancel(); protocolVersionMonitor = monitorProtocolVersion(); + return; } // The protocol version has changed to a different, incompatible version - else { - TraceEvent("ProtocolVersionChanged") - .detail("NewProtocolVersion", protocolVersion) - .detail("OldProtocolVersion", dbProtocolVersion); - // When the protocol version changes, clear the corresponding entry in the shared state map - // so it can be re-initialized. Only do so if there was a valid previous protocol version. - if (dbProtocolVersion.present() && MultiVersionApi::apiVersionAtLeast(710)) { - MultiVersionApi::api->clearClusterSharedStateMapEntry(clusterFilePath); - } - - dbProtocolVersion = protocolVersion; - - auto itr = clients.find(protocolVersion.normalizedVersion()); - if (itr != clients.end()) { - auto& client = itr->second; - TraceEvent("CreatingDatabaseOnClient") - .detail("LibraryPath", client->libPath) - .detail("Failed", client->failed) - .detail("External", client->external); - - Reference newDb; - try { - newDb = client->api->createDatabase(clusterFilePath.c_str()); - } catch (Error& e) { - TraceEvent(SevWarnAlways, "MultiVersionClientFailedToCreateDatabase") - .error(e) - .detail("LibraryPath", client->libPath) - .detail("External", client->external) - .detail("ClusterFilePath", clusterFilePath); + TraceEvent("ProtocolVersionChanged") + .detail("NewProtocolVersion", protocolVersion) + .detail("OldProtocolVersion", dbProtocolVersion); + // When the protocol version changes, clear the corresponding entry in the shared state map + // so it can be re-initialized. Only do so if there was a valid previous protocol version. + if (dbProtocolVersion.present() && MultiVersionApi::api->getApiVersion().hasClusterSharedStateMap()) { + MultiVersionApi::api->clearClusterSharedStateMapEntry(clusterId, dbProtocolVersion.get()); + } + + dbProtocolVersion = protocolVersion; + + auto itr = clients.find(protocolVersion.normalizedVersion()); + if (itr == clients.end()) { + // We don't have a client matching the current protocol + initializationState = InitializationState::INCOMPATIBLE; + updateDatabase(Reference(), Reference()); + return; + } - // Put the client in a disconnected state until the version changes again - updateDatabase(Reference(), Reference()); - return; - } + // A compatible client found, use it for creating a new database connection + auto& client = itr->second; + TraceEvent("CreatingDatabaseOnClient") + .detail("LibraryPath", client->libPath) + .detail("Failed", client->failed) + .detail("External", client->external); - if (client->external && !MultiVersionApi::apiVersionAtLeast(610)) { - // Old API versions return a future when creating the database, so we need to wait for it - Reference self = Reference::addRef(this); - dbReady = mapThreadFuture( - newDb.castTo()->onReady(), [self, newDb, client](ErrorOr ready) { - if (!ready.isError()) { - onMainThreadVoid([self, newDb, client]() { self->updateDatabase(newDb, client); }); - } else { - onMainThreadVoid( - [self, client]() { self->updateDatabase(Reference(), client); }); - } + Reference newDb; + try { + newDb = connectionRecord.createDatabase(client->api); + } catch (Error& e) { + // Create error currently does not return any error except for network not initialized, + // which cannot happen at this point + ASSERT(false); + } - return ready; - }); - } else { - updateDatabase(newDb, client); - } - } else { - // We don't have a client matching the current protocol - updateDatabase(Reference(), Reference()); - } + if (client->external && !MultiVersionApi::api->getApiVersion().hasInlineUpdateDatabase()) { + // Old API versions return a future when creating the database, so we need to wait for it + Reference self = Reference::addRef(this); + dbReady = mapThreadFuture( + newDb.castTo()->onReady(), [self, newDb, client](ErrorOr ready) { + if (!ready.isError()) { + onMainThreadVoid([self, newDb, client]() { self->updateDatabase(newDb, client); }); + } else { + onMainThreadVoid( + [self, client]() { self->updateDatabase(Reference(), Reference()); }); + } + return ready; + }); + } else { + updateDatabase(newDb, client); } } // Replaces the active database connection with a new one. Must be called from the main thread. void MultiVersionDatabase::DatabaseState::updateDatabase(Reference newDb, Reference client) { - if (closed) { + if (initializationState == InitializationState::CLOSED) { return; } + // Reapply database options on the new database if (newDb) { optionLock.enter(); for (auto option : options) { @@ -1692,46 +2477,50 @@ void MultiVersionDatabase::DatabaseState::updateDatabase(Reference ne break; } } - - db = newDb; - optionLock.leave(); + } - if (dbProtocolVersion.get().hasStableInterfaces() && db) { - versionMonitorDb = db; - } else { - // For older clients that don't have an API to get the protocol version, we have to monitor it locally - try { - versionMonitorDb = MultiVersionApi::api->getLocalClient()->api->createDatabase(clusterFilePath.c_str()); - } catch (Error& e) { - // We can't create a new database to monitor the cluster version. This means we will continue using the - // previous one, which should hopefully continue to work. - TraceEvent(SevWarnAlways, "FailedToCreateDatabaseForVersionMonitoring") - .error(e) - .detail("ClusterFilePath", clusterFilePath); - } - } + // Use the new database for monitoring the version changes, if it supports version monitoring + if (newDb && dbProtocolVersion.get().hasStableInterfaces()) { + versionMonitorDb = newDb; } else { // We don't have a database connection, so use the local client to monitor the protocol version - db = Reference(); + // Also for older clients that don't have an API to get the protocol version, we have to monitor it locally try { - versionMonitorDb = MultiVersionApi::api->getLocalClient()->api->createDatabase(clusterFilePath.c_str()); + versionMonitorDb = connectionRecord.createDatabase(MultiVersionApi::api->getLocalClient()->api); } catch (Error& e) { - // We can't create a new database to monitor the cluster version. This means we will continue using the - // previous one, which should hopefully continue to work. + // We can't create a new database to monitor the cluster version. This means we will continue using + // the previous one, which should hopefully continue to work. TraceEvent(SevWarnAlways, "FailedToCreateDatabaseForVersionMonitoring") .error(e) - .detail("ClusterFilePath", clusterFilePath); + .detail("ConnectionRecord", connectionRecord); } } - if (db.isValid() && dbProtocolVersion.present() && MultiVersionApi::apiVersionAtLeast(710)) { - auto updateResult = MultiVersionApi::api->updateClusterSharedStateMap(clusterFilePath, db); - auto handler = mapThreadFuture(updateResult, [this](ErrorOr result) { - dbVar->set(db); - return ErrorOr(Void()); + + // Verify the database has the necessary functionality to update the shared + // state. Avoid updating the shared state if the database is a + // configuration database, because a configuration database does not have + // access to typical system keys and does not need to be updated. + if (newDb && MultiVersionApi::api->getApiVersion().hasClusterSharedStateMap() && !isConfigDB) { + Future updateResult = + MultiVersionApi::api->updateClusterSharedStateMap(connectionRecord, dbProtocolVersion.get(), newDb); + sharedStateUpdater = map(errorOr(updateResult), [this, newDb](ErrorOr result) { + if (result.present()) { + clusterId = result.get(); + TraceEvent("ClusterSharedStateUpdated") + .detail("ClusterId", result.get()) + .detail("ProtocolVersion", dbProtocolVersion.get()); + } else { + TraceEvent(SevWarnAlways, "ClusterSharedStateUpdateError") + .error(result.getError()) + .detail("ConnectionRecord", connectionRecord) + .detail("ProtocolVersion", dbProtocolVersion.get()); + } + setDatabase(newDb); + return Void(); }); } else { - dbVar->set(db); + setDatabase(newDb); } ASSERT(protocolVersionMonitor.isValid()); @@ -1758,7 +2547,7 @@ void MultiVersionDatabase::DatabaseState::startLegacyVersionMonitors() { void MultiVersionDatabase::DatabaseState::close() { Reference self = Reference::addRef(this); onMainThreadVoid([self]() { - self->closed = true; + self->initializationState = InitializationState::CLOSED; if (self->protocolVersionMonitor.isValid()) { self->protocolVersionMonitor.cancel(); } @@ -1770,6 +2559,92 @@ void MultiVersionDatabase::DatabaseState::close() { }); } +namespace { + +const char* initializationStateToString(MultiVersionDatabase::InitializationState initState) { + switch (initState) { + case MultiVersionDatabase::InitializationState::INITIALIZING: + return "initializing"; + case MultiVersionDatabase::InitializationState::INITIALIZATION_FAILED: + return "initialization_failed"; + case MultiVersionDatabase::InitializationState::CREATED: + return "created"; + case MultiVersionDatabase::InitializationState::INCOMPATIBLE: + return "incompatible"; + case MultiVersionDatabase::InitializationState::CLOSED: + return "closed"; + default: + ASSERT(false); + return "invalid_state"; + } +} + +} // namespace + +// +// Generates the client-side status report for the Multi-Version Database +// +// The parameter dbContextStatus contains the status report generated by +// the wrapped Native Database (from external or local client), which is then +// embedded within the status report of the Multi-Version Database +// +// The overall report schema is as follows: +// { "Healthy": , +// "InitializationState": , +// "InitializationError": , +// "ProtocolVersion" : , +// "ConnectionRecord" : , +// "DatabaseStatus" : , +// "ErrorRetrievingDatabaseStatus" : , +// "AvailableClients" : [ +// { "ProtocolVersion" : , +// "ReleaseVersion" : , +// "ThreadIndex" : +// }, +// ... +// ] +// } +// +// +Standalone MultiVersionDatabase::DatabaseState::getClientStatus( + ErrorOr> dbContextStatus) { + json_spirit::mObject statusObj; + statusObj["InitializationState"] = initializationStateToString(initializationState); + if (initializationState == InitializationState::INITIALIZATION_FAILED) { + statusObj["InitializationError"] = initializationError.code(); + } + json_spirit::mArray clientArr; + for (auto [protocolVersion, client] : this->clients) { + json_spirit::mObject clientDesc; + clientDesc["ProtocolVersion"] = format("%llx", client->protocolVersion.version()); + clientDesc["ReleaseVersion"] = client->releaseVersion; + clientDesc["ThreadIndex"] = client->threadIndex; + clientArr.push_back(clientDesc); + } + statusObj["AvailableClients"] = clientArr; + statusObj["ConnectionRecord"] = connectionRecord.toString(); + if (dbProtocolVersion.present()) { + statusObj["ProtocolVersion"] = format("%llx", dbProtocolVersion.get().version()); + } + bool dbContextHealthy = false; + if (initializationState != InitializationState::INITIALIZATION_FAILED) { + if (dbContextStatus.isError()) { + statusObj["ErrorRetrievingDatabaseStatus"] = dbContextStatus.getError().code(); + } else { + json_spirit::mValue dbContextStatusVal; + json_spirit::read_string(dbContextStatus.get().toString(), dbContextStatusVal); + statusObj["DatabaseStatus"] = dbContextStatusVal; + auto& dbContextStatusObj = dbContextStatusVal.get_obj(); + auto healthyIter = dbContextStatusObj.find("Healthy"); + if (healthyIter != dbContextStatusObj.end() && healthyIter->second.type() == json_spirit::bool_type) { + dbContextHealthy = healthyIter->second.get_bool(); + } + } + } + statusObj["Healthy"] = initializationState == InitializationState::CREATED && dbContextHealthy; + return StringRef(json_spirit::write_string(json_spirit::mValue(statusObj))); +} + // Starts the connection monitor by creating a database object at an old version. // Must be called from the main thread void MultiVersionDatabase::LegacyVersionMonitor::startConnectionMonitor( @@ -1821,7 +2696,7 @@ void MultiVersionDatabase::LegacyVersionMonitor::runGrvProbe(Reference([](Version v) { return Void(); }); + return v.map([](Version v) { return Void(); }); }); } @@ -1832,22 +2707,19 @@ void MultiVersionDatabase::LegacyVersionMonitor::close() { } // MultiVersionApi -bool MultiVersionApi::apiVersionAtLeast(int minVersion) { - ASSERT_NE(MultiVersionApi::api->apiVersion, 0); - return MultiVersionApi::api->apiVersion >= minVersion || MultiVersionApi::api->apiVersion < 0; -} - void MultiVersionApi::runOnExternalClientsAllThreads(std::function)> func, - bool runOnFailedClients) { + bool runOnFailedClients, + bool failOnError) { for (int i = 0; i < threadCount; i++) { - runOnExternalClients(i, func, runOnFailedClients); + runOnExternalClients(i, func, runOnFailedClients, failOnError); } } // runOnFailedClients should be used cautiously. Some failed clients may not have successfully loaded all symbols. void MultiVersionApi::runOnExternalClients(int threadIdx, std::function)> func, - bool runOnFailedClients) { + bool runOnFailedClients, + bool failOnError) { bool newFailure = false; auto c = externalClients.begin(); @@ -1866,6 +2738,9 @@ void MultiVersionApi::runOnExternalClients(int threadIdx, TraceEvent(SevWarnAlways, "ExternalClientFailure").error(e).detail("LibPath", c->first); client->failed = true; newFailure = true; + if (failOnError) { + throw e; + } } } @@ -1877,30 +2752,44 @@ void MultiVersionApi::runOnExternalClients(int threadIdx, } } +bool MultiVersionApi::hasNonFailedExternalClients() { + bool validClientFound = false; + runOnExternalClientsAllThreads([&validClientFound](auto client) { + if (!client->failed) { + validClientFound = true; + } + }); + return validClientFound; +} + Reference MultiVersionApi::getLocalClient() { return localClient; } void MultiVersionApi::selectApiVersion(int apiVersion) { + ApiVersion newApiVersion(apiVersion); if (!localClient) { localClient = makeReference(getLocalClientAPI()); ASSERT(localClient); } - if (this->apiVersion != 0 && this->apiVersion != apiVersion) { + if (this->apiVersion.isValid() && this->apiVersion != newApiVersion) { throw api_version_already_set(); } localClient->api->selectApiVersion(apiVersion); - this->apiVersion = apiVersion; + this->apiVersion = newApiVersion; } const char* MultiVersionApi::getClientVersion() { return localClient->api->getClientVersion(); } -namespace { +void MultiVersionApi::useFutureProtocolVersion() { + localClient->api->useFutureProtocolVersion(); +} +namespace { void validateOption(Optional value, bool canBePresent, bool canBeAbsent, bool canBeEmpty = true) { ASSERT(canBePresent || canBeAbsent); @@ -1916,7 +2805,7 @@ void validateOption(Optional value, bool canBePresent, bool canBeAbse void MultiVersionApi::disableMultiVersionClientApi() { MutexHolder holder(lock); - if (networkStartSetup || localClientDisabled) { + if (networkStartSetup || localClientDisabled || disableBypass) { throw invalid_option(); } @@ -1931,7 +2820,7 @@ void MultiVersionApi::setCallbacksOnExternalThreads() { callbackOnMainThread = false; } -void MultiVersionApi::addExternalLibrary(std::string path) { +void MultiVersionApi::addExternalLibrary(std::string path, bool useFutureVersion) { std::string filename = basename(path); if (filename.empty() || !fileExists(path)) { @@ -1944,12 +2833,13 @@ void MultiVersionApi::addExternalLibrary(std::string path) { throw invalid_option(); // SOMEDAY: it might be good to allow clients to be added after the network is setup } - // external libraries always run on their own thread; ensure we allocate at least one thread to run this library. + // external libraries always run on their own thread; ensure we allocate at least one thread to run this + // library. threadCount = std::max(threadCount, 1); if (externalClientDescriptions.count(filename) == 0) { - TraceEvent("AddingExternalClient").detail("LibraryPath", filename); - externalClientDescriptions.emplace(std::make_pair(filename, ClientDesc(path, true))); + TraceEvent("AddingExternalClient").detail("LibraryPath", filename).detail("UseFutureVersion", useFutureVersion); + externalClientDescriptions.emplace(std::make_pair(filename, ClientDesc(path, true, useFutureVersion))); } } @@ -1962,14 +2852,15 @@ void MultiVersionApi::addExternalLibraryDirectory(std::string path) { throw invalid_option(); // SOMEDAY: it might be good to allow clients to be added after the network is setup } - // external libraries always run on their own thread; ensure we allocate at least one thread to run this library. + // external libraries always run on their own thread; ensure we allocate at least one thread to run this + // library. threadCount = std::max(threadCount, 1); for (auto filename : files) { std::string lib = abspath(joinPath(path, filename)); if (externalClientDescriptions.count(filename) == 0) { TraceEvent("AddingExternalClient").detail("LibraryPath", filename); - externalClientDescriptions.emplace(std::make_pair(filename, ClientDesc(lib, true))); + externalClientDescriptions.emplace(std::make_pair(filename, ClientDesc(lib, true, false))); } } } @@ -1989,8 +2880,9 @@ std::vector> MultiVersionApi::copyExternalLibraryPe for (int ii = 0; ii < threadCount; ++ii) { std::string filename = basename(path); - char tempName[PATH_MAX + 12]; - sprintf(tempName, "/tmp/%s-XXXXXX", filename.c_str()); + constexpr int MAX_TMP_NAME_LENGTH = PATH_MAX + 12; + char tempName[MAX_TMP_NAME_LENGTH]; + snprintf(tempName, MAX_TMP_NAME_LENGTH, "%s/%s-XXXXXX", tmpDir.c_str(), filename.c_str()); int tempFd = mkstemp(tempName); int fd; @@ -2040,7 +2932,7 @@ std::vector> MultiVersionApi::copyExternalLibraryPe return paths; } -#else +#else // if defined (__unixish__) std::vector> MultiVersionApi::copyExternalLibraryPerThread(std::string path) { if (threadCount > 1) { TraceEvent(SevError, "MultipleClientThreadsUnsupportedOnWindows").log(); @@ -2050,7 +2942,7 @@ std::vector> MultiVersionApi::copyExternalLibraryPe paths.push_back({ path, false }); return paths; } -#endif +#endif // if defined (__unixish__) void MultiVersionApi::disableLocalClient() { MutexHolder holder(lock); @@ -2065,8 +2957,8 @@ void MultiVersionApi::setSupportedClientVersions(Standalone versions) MutexHolder holder(lock); ASSERT(networkSetup); - // This option must be set on the main thread because it modifies structures that can be used concurrently by the - // main thread + // This option must be set on the main thread because it modifies structures that can be used concurrently by + // the main thread onMainThreadVoid([this, versions]() { localClient->api->setNetworkOption(FDBNetworkOptions::SUPPORTED_CLIENT_VERSIONS, versions); }); @@ -2106,7 +2998,7 @@ void MultiVersionApi::setNetworkOptionInternal(FDBNetworkOptions::Option option, setCallbacksOnExternalThreads(); } else if (option == FDBNetworkOptions::EXTERNAL_CLIENT_LIBRARY) { validateOption(value, true, false, false); - addExternalLibrary(abspath(value.get().toString())); + addExternalLibrary(abspath(value.get().toString()), false); } else if (option == FDBNetworkOptions::EXTERNAL_CLIENT_DIRECTORY) { validateOption(value, true, false, false); addExternalLibraryDirectory(value.get().toString()); @@ -2122,6 +3014,13 @@ void MultiVersionApi::setNetworkOptionInternal(FDBNetworkOptions::Option option, externalClient = true; bypassMultiClientApi = true; forwardOption = true; + } else if (option == FDBNetworkOptions::DISABLE_CLIENT_BYPASS) { + MutexHolder holder(lock); + ASSERT(!networkStartSetup); + if (bypassMultiClientApi) { + throw invalid_option(); + } + disableBypass = true; } else if (option == FDBNetworkOptions::CLIENT_THREADS_PER_VERSION) { MutexHolder holder(lock); validateOption(value, true, false, false); @@ -2134,6 +3033,30 @@ void MultiVersionApi::setNetworkOptionInternal(FDBNetworkOptions::Option option, // multiple client threads are not supported on windows. threadCount = extractIntOption(value, 1, 1); #endif + } else if (option == FDBNetworkOptions::CLIENT_TMP_DIR) { + validateOption(value, true, false, false); + tmpDir = abspath(value.get().toString()); + } else if (option == FDBNetworkOptions::FUTURE_VERSION_CLIENT_LIBRARY) { + validateOption(value, true, false, false); + addExternalLibrary(abspath(value.get().toString()), true); + } else if (option == FDBNetworkOptions::TRACE_FILE_IDENTIFIER) { + validateOption(value, true, false, true); + traceFileIdentifier = value.get().toString(); + { + MutexHolder holder(lock); + // Forward the option unmodified only to the the local client and let it validate it. + // While for external clients the trace file identifiers are determined in setupNetwork + localClient->api->setNetworkOption(option, value); + } + } else if (option == FDBNetworkOptions::TRACE_SHARE_AMONG_CLIENT_THREADS) { + validateOption(value, false, true); + traceShareBaseNameAmongThreads = true; + } else if (option == FDBNetworkOptions::IGNORE_EXTERNAL_CLIENT_FAILURES) { + validateOption(value, false, true); + ignoreExternalClientFailures = true; + } else if (option == FDBNetworkOptions::FAIL_INCOMPATIBLE_CLIENT) { + validateOption(value, false, true); + failIncompatibleClient = true; } else if (option == FDBNetworkOptions::RETAIN_CLIENT_LIBRARY_COPIES) { validateOption(value, false, true); retainClientLibCopies = true; @@ -2157,91 +3080,129 @@ void MultiVersionApi::setNetworkOptionInternal(FDBNetworkOptions::Option option, } void MultiVersionApi::setupNetwork() { - if (!externalClient) { - loadEnvironmentVariableNetworkOptions(); - } - - uint64_t transportId = 0; - { // lock scope - MutexHolder holder(lock); - if (networkStartSetup) { - throw network_already_setup(); - } - - if (threadCount > 1) { - disableLocalClient(); + try { + if (!externalClient) { + loadEnvironmentVariableNetworkOptions(); } - for (auto i : externalClientDescriptions) { - std::string path = i.second.libPath; - std::string filename = basename(path); + uint64_t transportId = 0; + { // lock scope + MutexHolder holder(lock); + if (networkStartSetup) { + throw network_already_setup(); + } - // Copy external lib for each thread - if (externalClients.count(filename) == 0) { - externalClients[filename] = {}; - for (const auto& tmp : copyExternalLibraryPerThread(path)) { - bool unlinkOnLoad = tmp.second && !retainClientLibCopies; - externalClients[filename].push_back(Reference( - new ClientInfo(new DLApi(tmp.first, unlinkOnLoad /*unlink on load*/), path))); - } + if (threadCount > 1) { + disableLocalClient(); } - } - if (externalClients.empty() && localClientDisabled) { - // SOMEDAY: this should be allowed when it's possible to add external clients after the - // network is setup. - // - // Typically we would create a more specific error for this case, but since we expect - // this case to go away soon, we can use a trace event and a generic error. - TraceEvent(SevWarn, "CannotSetupNetwork") - .detail("Reason", "Local client is disabled and no external clients configured"); + networkStartSetup = true; - throw client_invalid_operation(); - } + if (externalClientDescriptions.empty() && localClientDisabled) { + TraceEvent(SevWarn, "CannotSetupNetwork") + .detail("Reason", "Local client is disabled and no external clients configured"); - networkStartSetup = true; + throw no_external_client_provided(); + } - if (externalClients.empty()) { - bypassMultiClientApi = true; // SOMEDAY: we won't be able to set this option once it becomes possible to add - // clients after setupNetwork is called - } + if (externalClientDescriptions.empty() && !disableBypass) { + bypassMultiClientApi = true; // SOMEDAY: we won't be able to set this option once it becomes possible to + // add clients after setupNetwork is called + } - if (!bypassMultiClientApi) { - transportId = (uint64_t(uint32_t(platform::getRandomSeed())) << 32) ^ uint32_t(platform::getRandomSeed()); - if (transportId <= 1) - transportId += 2; - localClient->api->setNetworkOption(FDBNetworkOptions::EXTERNAL_CLIENT_TRANSPORT_ID, - std::to_string(transportId)); + if (!bypassMultiClientApi) { + transportId = + (uint64_t(uint32_t(platform::getRandomSeed())) << 32) ^ uint32_t(platform::getRandomSeed()); + if (transportId <= 1) + transportId += 2; + localClient->api->setNetworkOption(FDBNetworkOptions::EXTERNAL_CLIENT_TRANSPORT_ID, + std::to_string(transportId)); + } + localClient->api->setupNetwork(); + + if (!apiVersion.hasFailOnExternalClientErrors()) { + ignoreExternalClientFailures = true; + } + + for (auto i : externalClientDescriptions) { + std::string path = i.second.libPath; + std::string filename = basename(path); + bool useFutureVersion = i.second.useFutureVersion; + + // Copy external lib for each thread + if (externalClients.count(filename) == 0) { + externalClients[filename] = {}; + auto libCopies = copyExternalLibraryPerThread(path); + for (int idx = 0; idx < libCopies.size(); ++idx) { + bool unlinkOnLoad = libCopies[idx].second && !retainClientLibCopies; + externalClients[filename].push_back(Reference( + new ClientInfo(new DLApi(libCopies[idx].first, unlinkOnLoad /*unlink on load*/), + path, + useFutureVersion, + idx))); + } + } + } } - localClient->api->setupNetwork(); - } - localClient->loadVersion(); + localClient->loadVersion(); - if (!bypassMultiClientApi) { - runOnExternalClientsAllThreads([this](Reference client) { - TraceEvent("InitializingExternalClient").detail("LibraryPath", client->libPath); - client->api->selectApiVersion(apiVersion); - client->loadVersion(); - }); + if (bypassMultiClientApi) { + networkSetup = true; + } else { + runOnExternalClientsAllThreads( + [this](Reference client) { + TraceEvent("InitializingExternalClient").detail("LibraryPath", client->libPath); + client->api->selectApiVersion(apiVersion.version()); + if (client->useFutureVersion) { + client->api->useFutureProtocolVersion(); + } + client->loadVersion(); + }, + false, + !ignoreExternalClientFailures); + + std::string baseTraceFileId; + if (apiVersion.hasTraceFileIdentifier()) { + // TRACE_FILE_IDENTIFIER option is supported since 6.3 + baseTraceFileId = traceFileIdentifier.empty() ? format("%d", getpid()) : traceFileIdentifier; + } - MutexHolder holder(lock); - runOnExternalClientsAllThreads([this, transportId](Reference client) { - for (auto option : options) { - client->api->setNetworkOption(option.first, option.second.castTo()); + MutexHolder holder(lock); + runOnExternalClientsAllThreads( + [this, transportId, baseTraceFileId](Reference client) { + for (auto option : options) { + client->api->setNetworkOption(option.first, option.second.castTo()); + } + client->api->setNetworkOption(FDBNetworkOptions::EXTERNAL_CLIENT_TRANSPORT_ID, + std::to_string(transportId)); + if (!baseTraceFileId.empty()) { + client->api->setNetworkOption(FDBNetworkOptions::TRACE_FILE_IDENTIFIER, + traceShareBaseNameAmongThreads + ? baseTraceFileId + : client->getTraceFileIdentifier(baseTraceFileId)); + } + client->api->setupNetwork(); + }, + false, + !ignoreExternalClientFailures); + + if (localClientDisabled && !hasNonFailedExternalClients()) { + TraceEvent(SevWarn, "CannotSetupNetwork") + .detail("Reason", "Local client is disabled and all external clients failed"); + throw all_external_clients_failed(); } - client->api->setNetworkOption(FDBNetworkOptions::EXTERNAL_CLIENT_TRANSPORT_ID, std::to_string(transportId)); - client->api->setupNetwork(); - }); + networkSetup = true; // Needs to be guarded by mutex + } - networkSetup = true; // Needs to be guarded by mutex - } else { - networkSetup = true; + options.clear(); + updateSupportedVersions(); + } catch (Error& e) { + // Make sure all error and warning events are traced + flushTraceFileVoid(); + throw e; } - - options.clear(); - updateSupportedVersions(); } THREAD_FUNC_RETURN runNetworkThread(void* param) { @@ -2270,28 +3231,32 @@ void MultiVersionApi::runNetwork() { std::vector handles; if (!bypassMultiClientApi) { - for (int threadNum = 0; threadNum < threadCount; threadNum++) { - runOnExternalClients(threadNum, [&handles, threadNum](Reference client) { - if (client->external) { - std::string threadName = format("fdb-%s-%d", client->releaseVersion.c_str(), threadNum); - if (threadName.size() > 15) { - threadName = format("fdb-%s", client->releaseVersion.c_str()); - if (threadName.size() > 15) { - threadName = "fdb-external"; - } - } - handles.push_back( - g_network->startThread(&runNetworkThread, client.getPtr(), 0, threadName.c_str())); + runOnExternalClientsAllThreads([&handles](Reference client) { + ASSERT(client->external); + std::string threadName = format("fdb-%s-%d", client->releaseVersion.c_str(), client->threadIndex); + if (threadName.size() > 15) { + threadName = format("fdb-%s", client->releaseVersion.c_str()); + if (threadName.size() > 15) { + threadName = "fdb-external"; } - }); - } + } + handles.push_back(g_network->startThread(&runNetworkThread, client.getPtr(), 0, threadName.c_str())); + }); } - localClient->api->runNetwork(); + try { + localClient->api->runNetwork(); + } catch (const Error& e) { + closeTraceFile(); + throw e; + } for (auto h : handles) { waitThread(h); } + + TraceEvent("MultiVersionRunNetworkTerminating"); + closeTraceFile(); } void MultiVersionApi::stopNetwork() { @@ -2328,14 +3293,12 @@ void MultiVersionApi::addNetworkThreadCompletionHook(void (*hook)(void*), void* } // Creates an IDatabase object that represents a connection to the cluster -Reference MultiVersionApi::createDatabase(const char* clusterFilePath) { +Reference MultiVersionApi::createDatabase(ClusterConnectionRecord const& connectionRecord) { lock.enter(); if (!networkSetup) { lock.leave(); throw network_not_setup(); } - std::string clusterFile(clusterFilePath); - if (localClientDisabled) { ASSERT(!bypassMultiClientApi); @@ -2343,23 +3306,32 @@ Reference MultiVersionApi::createDatabase(const char* clusterFilePath nextThread = (nextThread + 1) % threadCount; lock.leave(); - Reference localDb = localClient->api->createDatabase(clusterFilePath); + Reference localDb = connectionRecord.createDatabase(localClient->api); return Reference( - new MultiVersionDatabase(this, threadIdx, clusterFile, Reference(), localDb)); + new MultiVersionDatabase(this, threadIdx, connectionRecord, Reference(), localDb)); } lock.leave(); ASSERT_LE(threadCount, 1); - Reference localDb = localClient->api->createDatabase(clusterFilePath); + Reference localDb = connectionRecord.createDatabase(localClient->api); if (bypassMultiClientApi) { return localDb; } else { - return Reference(new MultiVersionDatabase(this, 0, clusterFile, Reference(), localDb)); + return Reference( + new MultiVersionDatabase(this, 0, connectionRecord, Reference(), localDb)); } } +Reference MultiVersionApi::createDatabase(const char* clusterFilePath) { + return createDatabase(ClusterConnectionRecord::fromFile(clusterFilePath)); +} + +Reference MultiVersionApi::createDatabaseFromConnectionString(const char* connectionString) { + return createDatabase(ClusterConnectionRecord::fromConnectionString(connectionString)); +} + void MultiVersionApi::updateSupportedVersions() { if (networkSetup) { Standalone> versionStr; @@ -2384,34 +3356,87 @@ void MultiVersionApi::updateSupportedVersions() { } } -ThreadFuture MultiVersionApi::updateClusterSharedStateMap(std::string clusterFilePath, Reference db) { - MutexHolder holder(lock); - if (clusterSharedStateMap.find(clusterFilePath) == clusterSharedStateMap.end()) { - clusterSharedStateMap[clusterFilePath] = db->createSharedState(); - } else { - ThreadFuture entry = clusterSharedStateMap[clusterFilePath]; - return mapThreadFuture(entry, [db](ErrorOr result) { - if (result.isError()) { - return ErrorOr(result.getError()); +// Must be called from the main thread +ACTOR Future updateClusterSharedStateMapImpl(MultiVersionApi* self, + ClusterConnectionRecord connectionRecord, + ProtocolVersion dbProtocolVersion, + Reference db) { + // The cluster ID will be the connection record string (either a filename or the connection string itself) + // in versions before we could read the cluster ID. + state std::string clusterId = connectionRecord.toString(); + if (CLIENT_KNOBS->CLIENT_ENABLE_USING_CLUSTER_ID_KEY && dbProtocolVersion.hasClusterIdSpecialKey()) { + state Reference tr = db->createTransaction(); + loop { + try { + state ThreadFuture> clusterIdFuture = tr->get("\xff\xff/cluster_id"_sr); + Optional clusterIdVal = wait(safeThreadFutureToFuture(clusterIdFuture)); + ASSERT(clusterIdVal.present()); + clusterId = clusterIdVal.get().toString(); + ASSERT(UID::fromString(clusterId).isValid()); + break; + } catch (Error& e) { + wait(safeThreadFutureToFuture(tr->onError(e))); } - auto ssPtr = result.get(); - db->setSharedState(ssPtr); - return ErrorOr(Void()); - }); + } } - return Void(); + + if (self->clusterSharedStateMap.find(clusterId) == self->clusterSharedStateMap.end()) { + TraceEvent("CreatingClusterSharedState") + .detail("ClusterId", clusterId) + .detail("ProtocolVersion", dbProtocolVersion); + self->clusterSharedStateMap[clusterId] = { db->createSharedState(), dbProtocolVersion }; + } else { + auto& sharedStateInfo = self->clusterSharedStateMap[clusterId]; + if (sharedStateInfo.protocolVersion != dbProtocolVersion) { + // This situation should never happen, because we are connecting to the same cluster, + // so the protocol version must be the same + TraceEvent(SevError, "ClusterStateProtocolVersionMismatch") + .detail("ClusterId", clusterId) + .detail("ProtocolVersionExpected", dbProtocolVersion) + .detail("ProtocolVersionFound", sharedStateInfo.protocolVersion); + return clusterId; + } + + TraceEvent("SettingClusterSharedState") + .detail("ClusterId", clusterId) + .detail("ProtocolVersion", dbProtocolVersion); + + state ThreadFuture entry = sharedStateInfo.sharedStateFuture; + DatabaseSharedState* sharedState = wait(safeThreadFutureToFuture(entry)); + db->setSharedState(sharedState); + } + + return clusterId; } -void MultiVersionApi::clearClusterSharedStateMapEntry(std::string clusterFilePath) { - MutexHolder holder(lock); - auto mapEntry = clusterSharedStateMap.find(clusterFilePath); +// Must be called from the main thread +Future MultiVersionApi::updateClusterSharedStateMap(ClusterConnectionRecord const& connectionRecord, + ProtocolVersion dbProtocolVersion, + Reference db) { + return updateClusterSharedStateMapImpl(this, connectionRecord, dbProtocolVersion, db); +} + +// Must be called from the main thread +void MultiVersionApi::clearClusterSharedStateMapEntry(std::string clusterId, ProtocolVersion dbProtocolVersion) { + auto mapEntry = clusterSharedStateMap.find(clusterId); + // It can be that other database instances on the same cluster are already upgraded and thus + // have cleared or even created a new shared object entry if (mapEntry == clusterSharedStateMap.end()) { - TraceEvent(SevError, "ClusterSharedStateMapEntryNotFound").detail("ClusterFilePath", clusterFilePath); + TraceEvent("ClusterSharedStateMapEntryNotFound").detail("ClusterId", clusterId); + return; + } + auto sharedStateInfo = mapEntry->second; + if (sharedStateInfo.protocolVersion != dbProtocolVersion) { + TraceEvent("ClusterSharedStateClearSkipped") + .detail("ClusterId", clusterId) + .detail("ProtocolVersionExpected", dbProtocolVersion) + .detail("ProtocolVersionFound", sharedStateInfo.protocolVersion); return; } - auto ssPtr = mapEntry->second.get(); + auto ssPtr = sharedStateInfo.sharedStateFuture.get(); ssPtr->delRef(ssPtr); clusterSharedStateMap.erase(mapEntry); + TraceEvent("ClusterSharedStateCleared").detail("ClusterId", clusterId).detail("ProtocolVersion", dbProtocolVersion); } std::vector parseOptionValues(std::string valueStr) { @@ -2453,9 +3478,9 @@ std::vector parseOptionValues(std::string valueStr) { return values; } -// This function sets all environment variable options which have not been set previously by a call to this function. -// If an option has multiple values and setting one of those values failed with an error, then only those options -// which were not successfully set will be set on subsequent calls. +// This function sets all environment variable options which have not been set previously by a call to this +// function. If an option has multiple values and setting one of those values failed with an error, then only those +// options which were not successfully set will be set on subsequent calls. void MultiVersionApi::loadEnvironmentVariableNetworkOptions() { if (envOptionsLoaded) { return; @@ -2513,8 +3538,9 @@ void MultiVersionApi::loadEnvironmentVariableNetworkOptions() { MultiVersionApi::MultiVersionApi() : callbackOnMainThread(true), localClientDisabled(false), networkStartSetup(false), networkSetup(false), - bypassMultiClientApi(false), externalClient(false), retainClientLibCopies(false), apiVersion(0), threadCount(0), - envOptionsLoaded(false) {} + disableBypass(false), bypassMultiClientApi(false), externalClient(false), ignoreExternalClientFailures(false), + failIncompatibleClient(false), retainClientLibCopies(false), apiVersion(0), threadCount(0), tmpDir("/tmp"), + traceShareBaseNameAmongThreads(false), envOptionsLoaded(false) {} MultiVersionApi* MultiVersionApi::api = new MultiVersionApi(); @@ -2551,6 +3577,12 @@ bool ClientInfo::canReplace(Reference other) const { return !protocolVersion.isCompatible(other->protocolVersion); } +std::string ClientInfo::getTraceFileIdentifier(const std::string& baseIdentifier) { + std::string versionStr = releaseVersion; + std::replace(versionStr.begin(), versionStr.end(), '.', '_'); + return format("%s_v%st%d", baseIdentifier.c_str(), versionStr.c_str(), threadIndex); +} + // UNIT TESTS TEST_CASE("/fdbclient/multiversionclient/EnvironmentVariableParsing") { auto vals = parseOptionValues("a"); @@ -2752,6 +3784,11 @@ template THREAD_FUNC runSingleAssignmentVarTest(void* arg) { noUnseed = true; +// This test intentionally leaks memory +#ifdef ADDRESS_SANITIZER + __lsan::ScopedDisabler disableLeakChecks; +#endif + volatile bool* done = (volatile bool*)arg; try { for (int i = 0; i < 25; ++i) { @@ -2831,7 +3868,7 @@ struct AbortableTest { } }; -TEST_CASE("/fdbclient/multiversionclient/AbortableSingleAssignmentVar") { +TEST_CASE("fdbclient/multiversionclient/AbortableSingleAssignmentVar") { state volatile bool done = false; state THREAD_HANDLE thread = g_network->startThread(runSingleAssignmentVarTest, (void*)&done); @@ -2908,7 +3945,7 @@ struct DLTest { } }; -TEST_CASE("/fdbclient/multiversionclient/DLSingleAssignmentVar") { +TEST_CASE("fdbclient/multiversionclient/DLSingleAssignmentVar") { state volatile bool done = false; MultiVersionApi::api->callbackOnMainThread = true; @@ -2952,7 +3989,7 @@ struct MapTest { } }; -TEST_CASE("/fdbclient/multiversionclient/MapSingleAssignmentVar") { +TEST_CASE("fdbclient/multiversionclient/MapSingleAssignmentVar") { state volatile bool done = false; state THREAD_HANDLE thread = g_network->startThread(runSingleAssignmentVarTest, (void*)&done); @@ -2991,7 +4028,7 @@ struct FlatMapTest { } }; -TEST_CASE("/fdbclient/multiversionclient/FlatMapSingleAssignmentVar") { +TEST_CASE("fdbclient/multiversionclient/FlatMapSingleAssignmentVar") { state volatile bool done = false; state THREAD_HANDLE thread = g_network->startThread(runSingleAssignmentVarTest, (void*)&done); diff --git a/src/fdbclient/MultiVersionTransaction.actor.g.cpp b/src/fdbclient/MultiVersionTransaction.actor.g.cpp index 3c5e62c..4f7c0c1 100644 --- a/src/fdbclient/MultiVersionTransaction.actor.g.cpp +++ b/src/fdbclient/MultiVersionTransaction.actor.g.cpp @@ -20,6 +20,20 @@ * limitations under the License. */ +#ifdef __unixish__ +#include +#endif + +#include "fdbclient/IClientApi.h" +#include "fdbclient/json_spirit/json_spirit_reader_template.h" +#include "fdbclient/json_spirit/json_spirit_writer_template.h" +#include "fdbclient/json_spirit/json_spirit_value.h" +#include "flow/ThreadHelper.actor.h" +#include "flow/Trace.h" +#ifdef ADDRESS_SANITIZER +#include +#endif + #include "fdbclient/FDBOptions.g.h" #include "fdbclient/FDBTypes.h" #include "fdbclient/GenericManagementAPI.actor.h" @@ -34,6 +48,11 @@ #include "flow/Platform.h" #include "flow/ProtocolVersion.h" #include "flow/UnitTest.h" +#include "flow/Trace.h" + +#ifdef __unixish__ +#include +#endif // __unixish__ #include "flow/actorcompiler.h" // This must be the last #include. @@ -253,13 +272,14 @@ ThreadFuture>> DLTransaction::getRangeSplitPoints(c }); } -ThreadFuture>> DLTransaction::getBlobGranuleRanges(const KeyRangeRef& keyRange) { +ThreadFuture>> DLTransaction::getBlobGranuleRanges(const KeyRangeRef& keyRange, + int rangeLimit) { if (!api->transactionGetBlobGranuleRanges) { return unsupported_operation(); } FdbCApi::FDBFuture* f = api->transactionGetBlobGranuleRanges( - tr, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size()); + tr, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size(), rangeLimit); return toThreadFuture>>(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { const FdbCApi::FDBKeyRange* keyRanges; int keyRangesLength; @@ -275,10 +295,46 @@ ThreadResult DLTransaction::readBlobGranules(const KeyRangeRef& key Version beginVersion, Optional readVersion, ReadBlobGranuleContext granuleContext) { - if (!api->transactionReadBlobGranules) { + return unsupported_operation(); +} + +ThreadFuture>> DLTransaction::readBlobGranulesStart( + const KeyRangeRef& keyRange, + Version beginVersion, + Optional readVersion, + Version* readVersionOut) { + if (!api->transactionReadBlobGranulesStart) { + return unsupported_operation(); + } + + int64_t rv = readVersion.present() ? readVersion.get() : latestVersion; + + FdbCApi::FDBFuture* f = api->transactionReadBlobGranulesStart(tr, + keyRange.begin.begin(), + keyRange.begin.size(), + keyRange.end.begin(), + keyRange.end.size(), + beginVersion, + rv, + readVersionOut); + + return ThreadFuture>>( + (ThreadSingleAssignmentVar>>*)(f)); +}; + +ThreadResult DLTransaction::readBlobGranulesFinish( + ThreadFuture>> startFuture, + const KeyRangeRef& keyRange, + Version beginVersion, + Version readVersion, + ReadBlobGranuleContext granuleContext) { + if (!api->transactionReadBlobGranulesFinish) { return unsupported_operation(); } + // convert back to fdb future for API + FdbCApi::FDBFuture* f = (FdbCApi::FDBFuture*)(startFuture.extractPtr()); + // FIXME: better way to convert here? FdbCApi::FDBReadBlobGranuleContext context; context.userContext = granuleContext.userContext; @@ -288,25 +344,40 @@ ThreadResult DLTransaction::readBlobGranules(const KeyRangeRef& key context.debugNoMaterialize = granuleContext.debugNoMaterialize; context.granuleParallelism = granuleContext.granuleParallelism; - int64_t rv = readVersion.present() ? readVersion.get() : latestVersion; + FdbCApi::FDBResult* r = api->transactionReadBlobGranulesFinish(tr, + f, + keyRange.begin.begin(), + keyRange.begin.size(), + keyRange.end.begin(), + keyRange.end.size(), + beginVersion, + readVersion, + &context); + + return ThreadResult((ThreadSingleAssignmentVar*)(r)); +}; + +ThreadFuture>> +DLTransaction::summarizeBlobGranules(const KeyRangeRef& keyRange, Optional summaryVersion, int rangeLimit) { + if (!api->transactionSummarizeBlobGranules) { + return unsupported_operation(); + } - FdbCApi::FDBResult* r = api->transactionReadBlobGranules(tr, - keyRange.begin.begin(), - keyRange.begin.size(), - keyRange.end.begin(), - keyRange.end.size(), - beginVersion, - rv, - context); - const FdbCApi::FDBKeyValue* kvs; - int count; - FdbCApi::fdb_bool_t more; - FdbCApi::fdb_error_t error = api->resultGetKeyValueArray(r, &kvs, &count, &more); - ASSERT(!error); - - // The memory for this is stored in the FDBResult and is released when the result gets destroyed - return ThreadResult( - RangeResult(RangeResultRef(VectorRef((KeyValueRef*)kvs, count), more), Arena())); + int64_t sv = summaryVersion.present() ? summaryVersion.get() : latestVersion; + + FdbCApi::FDBFuture* f = api->transactionSummarizeBlobGranules( + tr, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size(), sv, rangeLimit); + + return toThreadFuture>>( + api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + const FdbCApi::FDBGranuleSummary* summaries; + int summariesLength; + FdbCApi::fdb_error_t error = api->futureGetGranuleSummaryArray(f, &summaries, &summariesLength); + ASSERT(!error); + // The memory for this is stored in the FDBFuture and is released when the future gets destroyed + return Standalone>( + VectorRef((BlobGranuleSummaryRef*)summaries, summariesLength), Arena()); + }); } void DLTransaction::addReadConflictRange(const KeyRangeRef& keys) { @@ -358,6 +429,34 @@ Version DLTransaction::getCommittedVersion() { return version; } +ThreadFuture DLTransaction::getTagThrottledDuration() { + if (!api->transactionGetTagThrottledDuration) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->transactionGetTagThrottledDuration(tr); + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + double duration; + FdbCApi::fdb_error_t error = api->futureGetDouble(f, &duration); + ASSERT(!error); + return duration; + }); +} + +ThreadFuture DLTransaction::getTotalCost() { + if (!api->transactionGetTotalCost) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->transactionGetTotalCost(tr); + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + int64_t size = 0; + FdbCApi::fdb_error_t error = api->futureGetInt64(f, &size); + ASSERT(!error); + return size; + }); +} + ThreadFuture DLTransaction::getApproximateSize() { if (!api->transactionGetApproximateSize) { return unsupported_operation(); @@ -389,6 +488,14 @@ void DLTransaction::reset() { api->transactionReset(tr); } +void DLTransaction::debugTrace(BaseTraceEvent&& event) { + event.detail("CommitResult", "Deferred logging unsupported").log(); +}; + +void DLTransaction::debugPrint(std::string const& message) { + fmt::print("[Deferred logging unsupported] {}\n", message); +} + ThreadFuture DLTransaction::getVersionVector() { return VersionVector(); // not implemented } @@ -402,6 +509,157 @@ Reference DLTenant::createTransaction() { return Reference(new DLTransaction(api, tr)); } +ThreadFuture DLTenant::getId() { + if (!api->tenantGetId) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->tenantGetId(tenant); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + int64_t res = 0; + FdbCApi::fdb_error_t error = api->futureGetInt64(f, &res); + ASSERT(!error); + return res; + }); +} + +ThreadFuture DLTenant::purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) { + if (!api->tenantPurgeBlobGranules) { + return unsupported_operation(); + } + FdbCApi::FDBFuture* f = api->tenantPurgeBlobGranules(tenant, + keyRange.begin.begin(), + keyRange.begin.size(), + keyRange.end.begin(), + keyRange.end.size(), + purgeVersion, + force); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + const uint8_t* key; + int keyLength; + FdbCApi::fdb_error_t error = api->futureGetKey(f, &key, &keyLength); + ASSERT(!error); + + // The memory for this is stored in the FDBFuture and is released when the future gets destroyed + return Key(KeyRef(key, keyLength), Arena()); + }); +} + +ThreadFuture DLTenant::waitPurgeGranulesComplete(const KeyRef& purgeKey) { + if (!api->tenantWaitPurgeGranulesComplete) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->tenantWaitPurgeGranulesComplete(tenant, purgeKey.begin(), purgeKey.size()); + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { return Void(); }); +} + +ThreadFuture DLTenant::blobbifyRange(const KeyRangeRef& keyRange) { + if (!api->tenantBlobbifyRange) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->tenantBlobbifyRange( + tenant, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size()); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + +ThreadFuture DLTenant::blobbifyRangeBlocking(const KeyRangeRef& keyRange) { + if (!api->tenantBlobbifyRangeBlocking) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->tenantBlobbifyRangeBlocking( + tenant, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size()); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + +ThreadFuture DLTenant::unblobbifyRange(const KeyRangeRef& keyRange) { + if (!api->tenantUnblobbifyRange) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->tenantUnblobbifyRange( + tenant, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size()); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + +ThreadFuture>> DLTenant::listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) { + if (!api->tenantListBlobbifiedRanges) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->tenantListBlobbifiedRanges( + tenant, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size(), rangeLimit); + + return toThreadFuture>>(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + const FdbCApi::FDBKeyRange* keyRanges; + int keyRangesLength; + FdbCApi::fdb_error_t error = api->futureGetKeyRangeArray(f, &keyRanges, &keyRangesLength); + ASSERT(!error); + // The memory for this is stored in the FDBFuture and is released when the future gets destroyed. + return Standalone>(VectorRef((KeyRangeRef*)keyRanges, keyRangesLength), + Arena()); + }); +} + +ThreadFuture DLTenant::verifyBlobRange(const KeyRangeRef& keyRange, Optional version) { + if (!api->tenantVerifyBlobRange) { + return unsupported_operation(); + } + + Version readVersion = version.present() ? version.get() : latestVersion; + + FdbCApi::FDBFuture* f = api->tenantVerifyBlobRange( + tenant, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size(), readVersion); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + Version version = invalidVersion; + ASSERT(!api->futureGetInt64(f, &version)); + return version; + }); +} + +ThreadFuture DLTenant::flushBlobRange(const KeyRangeRef& keyRange, bool compact, Optional version) { + if (!api->tenantFlushBlobRange) { + return unsupported_operation(); + } + + Version readVersion = version.present() ? version.get() : latestVersion; + + FdbCApi::FDBFuture* f = api->tenantFlushBlobRange(tenant, + keyRange.begin.begin(), + keyRange.begin.size(), + keyRange.end.begin(), + keyRange.end.size(), + compact, + readVersion); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + // DLDatabase DLDatabase::DLDatabase(Reference api, ThreadFuture dbFuture) : api(api), db(nullptr) { addref(); @@ -512,8 +770,7 @@ double DLDatabase::getMainThreadBusyness() { ThreadFuture DLDatabase::getServerProtocol(Optional expectedVersion) { ASSERT(api->databaseGetServerProtocol != nullptr); - uint64_t expected = - expectedVersion.map([](const ProtocolVersion& v) { return v.version(); }).orDefault(0); + uint64_t expected = expectedVersion.map(&ProtocolVersion::version).orDefault(0); FdbCApi::FDBFuture* f = api->databaseGetServerProtocol(db, expected); return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { uint64_t pv; @@ -524,16 +781,16 @@ ThreadFuture DLDatabase::getServerProtocol(Optional DLDatabase::purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) { - if (!api->purgeBlobGranules) { + if (!api->databasePurgeBlobGranules) { return unsupported_operation(); } - FdbCApi::FDBFuture* f = api->purgeBlobGranules(db, - keyRange.begin.begin(), - keyRange.begin.size(), - keyRange.end.begin(), - keyRange.end.size(), - purgeVersion, - force); + FdbCApi::FDBFuture* f = api->databasePurgeBlobGranules(db, + keyRange.begin.begin(), + keyRange.begin.size(), + keyRange.end.begin(), + keyRange.end.size(), + purgeVersion, + force); return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { const uint8_t* key; @@ -547,14 +804,134 @@ ThreadFuture DLDatabase::purgeBlobGranules(const KeyRangeRef& keyRange, Ver } ThreadFuture DLDatabase::waitPurgeGranulesComplete(const KeyRef& purgeKey) { - if (!api->waitPurgeGranulesComplete) { + if (!api->databaseWaitPurgeGranulesComplete) { return unsupported_operation(); } - FdbCApi::FDBFuture* f = api->waitPurgeGranulesComplete(db, purgeKey.begin(), purgeKey.size()); + FdbCApi::FDBFuture* f = api->databaseWaitPurgeGranulesComplete(db, purgeKey.begin(), purgeKey.size()); return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { return Void(); }); } +ThreadFuture DLDatabase::blobbifyRange(const KeyRangeRef& keyRange) { + if (!api->databaseBlobbifyRange) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->databaseBlobbifyRange( + db, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size()); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + +ThreadFuture DLDatabase::blobbifyRangeBlocking(const KeyRangeRef& keyRange) { + if (!api->databaseBlobbifyRangeBlocking) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->databaseBlobbifyRangeBlocking( + db, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size()); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + +ThreadFuture DLDatabase::unblobbifyRange(const KeyRangeRef& keyRange) { + if (!api->databaseUnblobbifyRange) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->databaseUnblobbifyRange( + db, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size()); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + +ThreadFuture>> DLDatabase::listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) { + if (!api->databaseListBlobbifiedRanges) { + return unsupported_operation(); + } + + FdbCApi::FDBFuture* f = api->databaseListBlobbifiedRanges( + db, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size(), rangeLimit); + + return toThreadFuture>>(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + const FdbCApi::FDBKeyRange* keyRanges; + int keyRangesLength; + FdbCApi::fdb_error_t error = api->futureGetKeyRangeArray(f, &keyRanges, &keyRangesLength); + ASSERT(!error); + // The memory for this is stored in the FDBFuture and is released when the future gets destroyed. + return Standalone>(VectorRef((KeyRangeRef*)keyRanges, keyRangesLength), + Arena()); + }); +} + +ThreadFuture DLDatabase::verifyBlobRange(const KeyRangeRef& keyRange, Optional version) { + if (!api->databaseVerifyBlobRange) { + return unsupported_operation(); + } + + Version readVersion = version.present() ? version.get() : latestVersion; + + FdbCApi::FDBFuture* f = api->databaseVerifyBlobRange( + db, keyRange.begin.begin(), keyRange.begin.size(), keyRange.end.begin(), keyRange.end.size(), readVersion); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + Version version = invalidVersion; + ASSERT(!api->futureGetInt64(f, &version)); + return version; + }); +} + +ThreadFuture DLDatabase::flushBlobRange(const KeyRangeRef& keyRange, bool compact, Optional version) { + if (!api->databaseFlushBlobRange) { + return unsupported_operation(); + } + + Version readVersion = version.present() ? version.get() : latestVersion; + + FdbCApi::FDBFuture* f = api->databaseFlushBlobRange(db, + keyRange.begin.begin(), + keyRange.begin.size(), + keyRange.end.begin(), + keyRange.end.size(), + compact, + readVersion); + + return toThreadFuture(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + FdbCApi::fdb_bool_t ret = false; + ASSERT(!api->futureGetBool(f, &ret)); + return ret; + }); +} + +ThreadFuture> DLDatabase::getClientStatus() { + if (!api->databaseGetClientStatus) { + return unsupported_operation(); + } + FdbCApi::FDBFuture* f = api->databaseGetClientStatus(db); + return toThreadFuture>(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) { + const uint8_t* str; + int strLength; + FdbCApi::fdb_error_t error = api->futureGetKey(f, &str, &strLength); + ASSERT(!error); + + // The memory for this is stored in the FDBFuture and is released when the future gets destroyed + return Standalone(StringRef(str, strLength), Arena()); + }); +} + // DLApi // Loads the specified function from a dynamic library @@ -570,7 +947,7 @@ void loadClientFunction(T* fp, void* lib, std::string libPath, const char* funct *(void**)(fp) = loadFunction(lib, functionName); if (*fp == nullptr && requireFunction) { TraceEvent(SevError, "ErrorLoadingFunction").detail("LibraryPath", libPath).detail("Function", functionName); - throw platform_error(); + throw api_function_missing(); } } @@ -598,11 +975,21 @@ void DLApi::init() { loadClientFunction(&api->selectApiVersion, lib, fdbCPath, "fdb_select_api_version_impl", headerVersion >= 0); loadClientFunction(&api->getClientVersion, lib, fdbCPath, "fdb_get_client_version", headerVersion >= 410); + loadClientFunction(&api->useFutureProtocolVersion, + lib, + fdbCPath, + "fdb_use_future_protocol_version", + headerVersion >= ApiVersion::withFutureProtocolVersionApi().version()); loadClientFunction(&api->setNetworkOption, lib, fdbCPath, "fdb_network_set_option", headerVersion >= 0); loadClientFunction(&api->setupNetwork, lib, fdbCPath, "fdb_setup_network", headerVersion >= 0); loadClientFunction(&api->runNetwork, lib, fdbCPath, "fdb_run_network", headerVersion >= 0); loadClientFunction(&api->stopNetwork, lib, fdbCPath, "fdb_stop_network", headerVersion >= 0); loadClientFunction(&api->createDatabase, lib, fdbCPath, "fdb_create_database", headerVersion >= 610); + loadClientFunction(&api->createDatabaseFromConnectionString, + lib, + fdbCPath, + "fdb_create_database_from_connection_string", + headerVersion >= ApiVersion::withCreateDBFromConnString().version()); loadClientFunction(&api->databaseOpenTenant, lib, fdbCPath, "fdb_database_open_tenant", headerVersion >= 710); loadClientFunction( @@ -628,18 +1015,95 @@ void DLApi::init() { headerVersion >= 700); loadClientFunction( &api->databaseCreateSnapshot, lib, fdbCPath, "fdb_database_create_snapshot", headerVersion >= 700); - loadClientFunction( - &api->purgeBlobGranules, lib, fdbCPath, "fdb_database_purge_blob_granules", headerVersion >= 710); - - loadClientFunction(&api->waitPurgeGranulesComplete, + &api->databasePurgeBlobGranules, lib, fdbCPath, "fdb_database_purge_blob_granules", headerVersion >= 710); + loadClientFunction(&api->databaseWaitPurgeGranulesComplete, lib, fdbCPath, "fdb_database_wait_purge_granules_complete", headerVersion >= 710); - + loadClientFunction(&api->databaseBlobbifyRange, + lib, + fdbCPath, + "fdb_database_blobbify_range", + headerVersion >= ApiVersion::withBlobRangeApi().version()); + loadClientFunction(&api->databaseBlobbifyRangeBlocking, + lib, + fdbCPath, + "fdb_database_blobbify_range_blocking", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->databaseUnblobbifyRange, + lib, + fdbCPath, + "fdb_database_unblobbify_range", + headerVersion >= ApiVersion::withBlobRangeApi().version()); + loadClientFunction(&api->databaseListBlobbifiedRanges, + lib, + fdbCPath, + "fdb_database_list_blobbified_ranges", + headerVersion >= ApiVersion::withBlobRangeApi().version()); + loadClientFunction(&api->databaseVerifyBlobRange, + lib, + fdbCPath, + "fdb_database_verify_blob_range", + headerVersion >= ApiVersion::withBlobRangeApi().version()); + loadClientFunction(&api->databaseFlushBlobRange, + lib, + fdbCPath, + "fdb_database_flush_blob_range", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->databaseGetClientStatus, + lib, + fdbCPath, + "fdb_database_get_client_status", + headerVersion >= ApiVersion::withGetClientStatus().version()); loadClientFunction( &api->tenantCreateTransaction, lib, fdbCPath, "fdb_tenant_create_transaction", headerVersion >= 710); + loadClientFunction(&api->tenantPurgeBlobGranules, + lib, + fdbCPath, + "fdb_tenant_purge_blob_granules", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantWaitPurgeGranulesComplete, + lib, + fdbCPath, + "fdb_tenant_wait_purge_granules_complete", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantBlobbifyRange, + lib, + fdbCPath, + "fdb_tenant_blobbify_range", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantBlobbifyRangeBlocking, + lib, + fdbCPath, + "fdb_tenant_blobbify_range_blocking", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantUnblobbifyRange, + lib, + fdbCPath, + "fdb_tenant_unblobbify_range", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantListBlobbifiedRanges, + lib, + fdbCPath, + "fdb_tenant_list_blobbified_ranges", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantVerifyBlobRange, + lib, + fdbCPath, + "fdb_tenant_verify_blob_range", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantFlushBlobRange, + lib, + fdbCPath, + "fdb_tenant_flush_blob_range", + headerVersion >= ApiVersion::withTenantBlobRangeApi().version()); + loadClientFunction(&api->tenantGetId, + lib, + fdbCPath, + "fdb_tenant_get_id", + headerVersion >= ApiVersion::withTenantGetId().version()); loadClientFunction(&api->tenantDestroy, lib, fdbCPath, "fdb_tenant_destroy", headerVersion >= 710); loadClientFunction(&api->transactionSetOption, lib, fdbCPath, "fdb_transaction_set_option", headerVersion >= 0); @@ -670,6 +1134,16 @@ void DLApi::init() { fdbCPath, "fdb_transaction_get_committed_version", headerVersion >= 0); + loadClientFunction(&api->transactionGetTagThrottledDuration, + lib, + fdbCPath, + "fdb_transaction_get_tag_throttled_duration", + headerVersion >= ApiVersion::withGetTagThrottledDuration().version()); + loadClientFunction(&api->transactionGetTotalCost, + lib, + fdbCPath, + "fdb_transaction_get_total_cost", + headerVersion >= ApiVersion::withGetTotalCost().version()); loadClientFunction(&api->transactionGetApproximateSize, lib, fdbCPath, @@ -699,11 +1173,36 @@ void DLApi::init() { headerVersion >= 710); loadClientFunction( &api->transactionReadBlobGranules, lib, fdbCPath, "fdb_transaction_read_blob_granules", headerVersion >= 710); + loadClientFunction(&api->transactionReadBlobGranulesStart, + lib, + fdbCPath, + "fdb_transaction_read_blob_granules_start", + headerVersion >= ApiVersion::withBlobRangeApi().version()); + loadClientFunction(&api->transactionReadBlobGranulesFinish, + lib, + fdbCPath, + "fdb_transaction_read_blob_granules_finish", + headerVersion >= ApiVersion::withBlobRangeApi().version()); + loadClientFunction(&api->transactionSummarizeBlobGranules, + lib, + fdbCPath, + "fdb_transaction_summarize_blob_granules", + headerVersion >= ApiVersion::withBlobRangeApi().version()); + loadClientFunction(&api->futureGetDouble, + lib, + fdbCPath, + "fdb_future_get_double", + headerVersion >= ApiVersion::withFutureGetDouble().version()); loadClientFunction(&api->futureGetInt64, lib, fdbCPath, headerVersion >= 620 ? "fdb_future_get_int64" : "fdb_future_get_version", headerVersion >= 0); + loadClientFunction(&api->futureGetBool, + lib, + fdbCPath, + "fdb_future_get_bool", + headerVersion >= ApiVersion::withFutureGetBool().version()); loadClientFunction(&api->futureGetUInt64, lib, fdbCPath, "fdb_future_get_uint64", headerVersion >= 700); loadClientFunction(&api->futureGetError, lib, fdbCPath, "fdb_future_get_error", headerVersion >= 0); loadClientFunction(&api->futureGetKey, lib, fdbCPath, "fdb_future_get_key", headerVersion >= 0); @@ -716,6 +1215,11 @@ void DLApi::init() { &api->futureGetKeyValueArray, lib, fdbCPath, "fdb_future_get_keyvalue_array", headerVersion >= 0); loadClientFunction( &api->futureGetMappedKeyValueArray, lib, fdbCPath, "fdb_future_get_mappedkeyvalue_array", headerVersion >= 710); + loadClientFunction(&api->futureGetGranuleSummaryArray, + lib, + fdbCPath, + "fdb_future_get_granule_summary_array", + headerVersion >= ApiVersion::withBlobRangeApi().version()); loadClientFunction(&api->futureGetSharedState, lib, fdbCPath, "fdb_future_get_shared_state", headerVersion >= 710); loadClientFunction(&api->futureSetCallback, lib, fdbCPath, "fdb_future_set_callback", headerVersion >= 0); loadClientFunction(&api->futureCancel, lib, fdbCPath, "fdb_future_cancel", headerVersion >= 0); @@ -750,6 +1254,14 @@ const char* DLApi::getClientVersion() { return api->getClientVersion(); } +void DLApi::useFutureProtocolVersion() { + if (!api->useFutureProtocolVersion) { + return; + } + + api->useFutureProtocolVersion(); +} + void DLApi::setNetworkOption(FDBNetworkOptions::Option option, Optional value) { throwIfError(api->setNetworkOption(static_cast(option), value.present() ? value.get().begin() : nullptr, @@ -831,6 +1343,16 @@ Reference DLApi::createDatabase(const char* clusterFilePath) { } } +Reference DLApi::createDatabaseFromConnectionString(const char* connectionString) { + if (api->createDatabaseFromConnectionString == nullptr) { + throw unsupported_operation(); + } + + FdbCApi::FDBDatabase* db; + throwIfError(api->createDatabaseFromConnectionString(connectionString, &db)); + return Reference(new DLDatabase(api, db)); +} + void DLApi::addNetworkThreadCompletionHook(void (*hook)(void*), void* hookParameter) { MutexHolder holder(lock); threadCompletionHooks.emplace_back(hook, hookParameter); @@ -842,7 +1364,7 @@ MultiVersionTransaction::MultiVersionTransaction(Reference UniqueOrderedOptionList defaultOptions) : db(db), tenant(tenant), startTime(timer_monotonic()), timeoutTsav(new ThreadSingleAssignmentVar()) { setDefaultOptions(defaultOptions); - updateTransaction(); + updateTransaction(false); } void MultiVersionTransaction::setDefaultOptions(UniqueOrderedOptionList options) { @@ -850,7 +1372,7 @@ void MultiVersionTransaction::setDefaultOptions(UniqueOrderedOptionListcreateTransaction(); } - newTr.onChange = currentTenant.onChange; } else { auto currentDb = db->dbState->dbVar->get(); if (currentDb.value) { newTr.transaction = currentDb.value->createTransaction(); } - newTr.onChange = currentDb.onChange; } - Optional timeout; - for (auto option : persistentOptions) { - if (option.first == FDBTransactionOptions::TIMEOUT) { - timeout = option.second.castTo(); - } else if (newTr.transaction) { - newTr.transaction->setOption(option.first, option.second.castTo()); + // When called from the constructor or from reset(), all persistent options are database options and therefore + // alredy set on newTr.transaction if it got created sucessfully. If newTr.transaction could not be created (i.e., + // because no database with a matching version is present), the local timeout set in setTimeout() applies, so we + // need to set it. + if (setPersistentOptions || !newTr.transaction) { + Optional timeout; + for (auto const& option : persistentOptions) { + if (option.first == FDBTransactionOptions::TIMEOUT) { + timeout = option.second.castTo(); + } else if (newTr.transaction) { + newTr.transaction->setOption(option.first, option.second.castTo()); + } } - } - - // Setting a timeout can immediately cause a transaction to fail. The only timeout - // that matters is the one most recently set, so we ignore any earlier set timeouts - // that might inadvertently fail the transaction. - if (timeout.present()) { - setTimeout(timeout); if (newTr.transaction) { - newTr.transaction->setOption(FDBTransactionOptions::TIMEOUT, timeout); + for (auto const& option : sensitivePersistentOptions) { + newTr.transaction->setOption(option.first, option.second.castTo()); + } } - } + // Setting a timeout can immediately cause a transaction to fail. The only timeout + // that matters is the one most recently set, so we ignore any earlier set timeouts + // that might inadvertently fail the transaction. + if (timeout.present()) { + if (newTr.transaction) { + newTr.transaction->setOption(FDBTransactionOptions::TIMEOUT, timeout); + resetTimeout(); + } else { + setTimeout(timeout); + } + } + } lock.enter(); transaction = newTr; lock.leave(); @@ -915,22 +1447,35 @@ void MultiVersionTransaction::setVersion(Version v) { } } -ThreadFuture MultiVersionTransaction::getReadVersion() { +template +ThreadFuture MultiVersionTransaction::executeOperation(ThreadFuture (ITransaction::*func)(Args...), + Args&&... args) { auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getReadVersion() : makeTimeout(); - return abortableFuture(f, tr.onChange); + if (tr.transaction) { + auto f = (tr.transaction.getPtr()->*func)(std::forward(args)...); + return abortableFuture(f, tr.onChange); + } + + // If database initialization failed, return the initialization error + auto dbError = db->dbState->getInitializationError(); + if (dbError.isError()) { + return ThreadFuture(dbError.getError()); + } + + // Wait for the database to be initialized + return abortableFuture(makeTimeout(), tr.onChange); +} + +ThreadFuture MultiVersionTransaction::getReadVersion() { + return executeOperation(&ITransaction::getReadVersion); } ThreadFuture> MultiVersionTransaction::get(const KeyRef& key, bool snapshot) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->get(key, snapshot) : makeTimeout>(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::get, key, std::forward(snapshot)); } ThreadFuture MultiVersionTransaction::getKey(const KeySelectorRef& key, bool snapshot) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getKey(key, snapshot) : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getKey, key, std::forward(snapshot)); } ThreadFuture MultiVersionTransaction::getRange(const KeySelectorRef& begin, @@ -938,10 +1483,12 @@ ThreadFuture MultiVersionTransaction::getRange(const KeySelectorRef int limit, bool snapshot, bool reverse) { - auto tr = getTransaction(); - auto f = - tr.transaction ? tr.transaction->getRange(begin, end, limit, snapshot, reverse) : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getRange, + begin, + end, + std::forward(limit), + std::forward(snapshot), + std::forward(reverse)); } ThreadFuture MultiVersionTransaction::getRange(const KeySelectorRef& begin, @@ -949,28 +1496,34 @@ ThreadFuture MultiVersionTransaction::getRange(const KeySelectorRef GetRangeLimits limits, bool snapshot, bool reverse) { - auto tr = getTransaction(); - auto f = - tr.transaction ? tr.transaction->getRange(begin, end, limits, snapshot, reverse) : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getRange, + begin, + end, + std::forward(limits), + std::forward(snapshot), + std::forward(reverse)); } ThreadFuture MultiVersionTransaction::getRange(const KeyRangeRef& keys, int limit, bool snapshot, bool reverse) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getRange(keys, limit, snapshot, reverse) : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getRange, + keys, + std::forward(limit), + std::forward(snapshot), + std::forward(reverse)); } ThreadFuture MultiVersionTransaction::getRange(const KeyRangeRef& keys, GetRangeLimits limits, bool snapshot, bool reverse) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getRange(keys, limits, snapshot, reverse) : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getRange, + keys, + std::forward(limits), + std::forward(snapshot), + std::forward(reverse)); } ThreadFuture MultiVersionTransaction::getMappedRange(const KeySelectorRef& begin, @@ -979,23 +1532,21 @@ ThreadFuture MultiVersionTransaction::getMappedRange(const Ke GetRangeLimits limits, bool snapshot, bool reverse) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getMappedRange(begin, end, mapper, limits, snapshot, reverse) - : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getMappedRange, + begin, + end, + mapper, + std::forward(limits), + std::forward(snapshot), + std::forward(reverse)); } ThreadFuture> MultiVersionTransaction::getVersionstamp() { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getVersionstamp() : makeTimeout>(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getVersionstamp); } ThreadFuture>> MultiVersionTransaction::getAddressesForKey(const KeyRef& key) { - auto tr = getTransaction(); - auto f = - tr.transaction ? tr.transaction->getAddressesForKey(key) : makeTimeout>>(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getAddressesForKey, key); } void MultiVersionTransaction::addReadConflictRange(const KeyRangeRef& keys) { @@ -1006,39 +1557,76 @@ void MultiVersionTransaction::addReadConflictRange(const KeyRangeRef& keys) { } ThreadFuture MultiVersionTransaction::getEstimatedRangeSizeBytes(const KeyRangeRef& keys) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getEstimatedRangeSizeBytes(keys) : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getEstimatedRangeSizeBytes, keys); } ThreadFuture>> MultiVersionTransaction::getRangeSplitPoints(const KeyRangeRef& range, int64_t chunkSize) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getRangeSplitPoints(range, chunkSize) - : makeTimeout>>(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::getRangeSplitPoints, range, std::forward(chunkSize)); } ThreadFuture>> MultiVersionTransaction::getBlobGranuleRanges( - const KeyRangeRef& keyRange) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getBlobGranuleRanges(keyRange) - : makeTimeout>>(); - return abortableFuture(f, tr.onChange); + const KeyRangeRef& keyRange, + int rangeLimit) { + return executeOperation(&ITransaction::getBlobGranuleRanges, keyRange, std::forward(rangeLimit)); } ThreadResult MultiVersionTransaction::readBlobGranules(const KeyRangeRef& keyRange, Version beginVersion, Optional readVersion, ReadBlobGranuleContext granuleContext) { + // FIXME: prevent from calling this from another main thread? auto tr = getTransaction(); if (tr.transaction) { - return tr.transaction->readBlobGranules(keyRange, beginVersion, readVersion, granuleContext); + Version readVersionOut; + auto f = tr.transaction->readBlobGranulesStart(keyRange, beginVersion, readVersion, &readVersionOut); + auto abortableF = abortableFuture(f, tr.onChange); + abortableF.blockUntilReadyCheckOnMainThread(); + if (abortableF.isError()) { + return ThreadResult(abortableF.getError()); + } + if (granuleContext.debugNoMaterialize) { + return ThreadResult(blob_granule_not_materialized()); + } + return tr.transaction->readBlobGranulesFinish( + abortableF, keyRange, beginVersion, readVersionOut, granuleContext); } else { return abortableTimeoutResult(tr.onChange); } } +ThreadFuture>> MultiVersionTransaction::readBlobGranulesStart( + const KeyRangeRef& keyRange, + Version beginVersion, + Optional readVersion, + Version* readVersionOut) { + return executeOperation(&ITransaction::readBlobGranulesStart, + keyRange, + std::forward(beginVersion), + std::forward>(readVersion), + std::forward(readVersionOut)); +} + +ThreadResult MultiVersionTransaction::readBlobGranulesFinish( + ThreadFuture>> startFuture, + const KeyRangeRef& keyRange, + Version beginVersion, + Version readVersion, + ReadBlobGranuleContext granuleContext) { + // can't call this directly + return ThreadResult(unsupported_operation()); +} + +ThreadFuture>> MultiVersionTransaction::summarizeBlobGranules( + const KeyRangeRef& keyRange, + Optional summaryVersion, + int rangeLimit) { + return executeOperation(&ITransaction::summarizeBlobGranules, + keyRange, + std::forward>(summaryVersion), + std::forward(rangeLimit)); +} + void MultiVersionTransaction::atomicOp(const KeyRef& key, const ValueRef& value, uint32_t operationType) { auto tr = getTransaction(); if (tr.transaction) { @@ -1075,9 +1663,7 @@ void MultiVersionTransaction::clear(const KeyRef& key) { } ThreadFuture MultiVersionTransaction::watch(const KeyRef& key) { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->watch(key) : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::watch, key); } void MultiVersionTransaction::addWriteConflictRange(const KeyRangeRef& keys) { @@ -1088,9 +1674,7 @@ void MultiVersionTransaction::addWriteConflictRange(const KeyRangeRef& keys) { } ThreadFuture MultiVersionTransaction::commit() { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->commit() : makeTimeout(); - return abortableFuture(f, tr.onChange); + return executeOperation(&ITransaction::commit); } Version MultiVersionTransaction::getCommittedVersion() { @@ -1098,7 +1682,6 @@ Version MultiVersionTransaction::getCommittedVersion() { if (tr.transaction) { return tr.transaction->getCommittedVersion(); } - return invalidVersion; } @@ -1111,21 +1694,29 @@ ThreadFuture MultiVersionTransaction::getVersionVector() { return VersionVector(); } -ThreadFuture MultiVersionTransaction::getSpanID() { +ThreadFuture MultiVersionTransaction::getSpanContext() { auto tr = getTransaction(); if (tr.transaction) { - return tr.transaction->getSpanID(); + return tr.transaction->getSpanContext(); } - return UID(); + return SpanContext(); } -ThreadFuture MultiVersionTransaction::getApproximateSize() { +ThreadFuture MultiVersionTransaction::getTagThrottledDuration() { auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->getApproximateSize() : makeTimeout(); + auto f = tr.transaction ? tr.transaction->getTagThrottledDuration() : makeTimeout(); return abortableFuture(f, tr.onChange); } +ThreadFuture MultiVersionTransaction::getTotalCost() { + return executeOperation(&ITransaction::getTotalCost); +} + +ThreadFuture MultiVersionTransaction::getApproximateSize() { + return executeOperation(&ITransaction::getApproximateSize); +} + void MultiVersionTransaction::setOption(FDBTransactionOptions::Option option, Optional value) { auto itr = FDBTransactionOptions::optionInfo.find(option); if (itr == FDBTransactionOptions::optionInfo.end()) { @@ -1133,40 +1724,40 @@ void MultiVersionTransaction::setOption(FDBTransactionOptions::Option option, Op throw invalid_option(); } - if (MultiVersionApi::apiVersionAtLeast(610) && itr->second.persistent) { - persistentOptions.emplace_back(option, value.castTo>()); - } - - if (itr->first == FDBTransactionOptions::TIMEOUT) { - setTimeout(value); + if (MultiVersionApi::api->getApiVersion().hasPersistentOptions() && itr->second.persistent) { + if (itr->second.sensitive) + sensitivePersistentOptions.emplace_back(option, value.castTo()); + else + persistentOptions.emplace_back(option, value.castTo>()); } auto tr = getTransaction(); if (tr.transaction) { tr.transaction->setOption(option, value); + } else if (itr->first == FDBTransactionOptions::TIMEOUT) { + setTimeout(value); } } ThreadFuture MultiVersionTransaction::onError(Error const& e) { if (e.code() == error_code_cluster_version_changed) { - updateTransaction(); + updateTransaction(true); return ThreadFuture(Void()); } else { - auto tr = getTransaction(); - auto f = tr.transaction ? tr.transaction->onError(e) : makeTimeout(); - f = abortableFuture(f, tr.onChange); - - return flatMapThreadFuture(f, [this, e](ErrorOr ready) { - if (!ready.isError() || ready.getError().code() != error_code_cluster_version_changed) { - if (ready.isError()) { - return ErrorOr>(ready.getError()); - } - + auto f = executeOperation(&ITransaction::onError, e); + return flatMapThreadFuture(f, [this](ErrorOr ready) { + if (ready.isError() && ready.getError().code() == error_code_cluster_version_changed) { + // In case of a cluster version change, upgrade (or downgrade) the transaction + // and let it to be retried independently of the original error + updateTransaction(true); + return ErrorOr>(Void()); + } + // In all other cases forward the result of the inner onError call + if (ready.isError()) { + return ErrorOr>(ready.getError()); + } else { return ErrorOr>(Void()); } - - updateTransaction(); - return ErrorOr>(onError(e)); }); } } @@ -1181,23 +1772,25 @@ Optional MultiVersionTransaction::getTenant() { // Waits for the specified duration and signals the assignment variable with a timed out error // This will be canceled if a new timeout is set, in which case the tsav will not be signaled. - #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 1775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" namespace { // This generated class is to be used only via timeoutImpl() - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" template - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" class TimeoutImplActorState { - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 1782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" public: - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" TimeoutImplActorState(Reference> const& tsav,double const& duration) - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" : tsav(tsav), - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - duration(duration) - #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + duration(duration), + #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + endTime(now() + duration) + #line 1793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" { fdb_probe_actor_create("timeoutImpl", reinterpret_cast(this)); @@ -1210,17 +1803,10 @@ class TimeoutImplActorState { int a_body1(int loopDepth=0) { try { - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - StrictFuture __when_expr_0 = delay(duration); - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" - loopDepth = 0; + #line 1775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + ; + #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -1238,13 +1824,13 @@ class TimeoutImplActorState { return loopDepth; } - int a_body1cont1(Void const& _,int loopDepth) + int a_body1cont1(int loopDepth) { - #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 1779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" tsav->trySendError(transaction_timed_out()); - #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 1780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TimeoutImplActorState(); static_cast(this)->destroy(); return 0; } - #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 1833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TimeoutImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1252,29 +1838,69 @@ class TimeoutImplActorState { return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1loopHead1(int loopDepth) { - #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - tsav->trySendError(transaction_timed_out()); - #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TimeoutImplActorState(); static_cast(this)->destroy(); return 0; } - #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~TimeoutImplActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 1775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (!(now() < endTime)) + #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 1776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + StrictFuture __when_expr_0 = delayUntil(std::min(endTime + 0.0001, now() + CLIENT_KNOBS->TRANSACTION_TIMEOUT_DELAY_INTERVAL)); + #line 1776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(Void const& _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1(Void && _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + loopDepth = a_body1loopBody1cont1(_, loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); return loopDepth; } @@ -1289,7 +1915,7 @@ class TimeoutImplActorState { fdb_probe_actor_enter("timeoutImpl", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -1304,7 +1930,7 @@ class TimeoutImplActorState { fdb_probe_actor_enter("timeoutImpl", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -1329,16 +1955,18 @@ class TimeoutImplActorState { fdb_probe_actor_exit("timeoutImpl", reinterpret_cast(this), 0); } - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" Reference> tsav; - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" double duration; - #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + double endTime; + #line 1964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" }; // This generated class is to be used only via timeoutImpl() - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" class TimeoutImplActor final : public Actor, public ActorCallback< TimeoutImplActor, 0, Void >, public FastAllocated, public TimeoutImplActorState { - #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 1969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1347,9 +1975,9 @@ class TimeoutImplActor final : public Actor, public ActorCallback< Timeout void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< TimeoutImplActor, 0, Void >; - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" TimeoutImplActor(Reference> const& tsav,double const& duration) - #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" : Actor(), TimeoutImplActorState(tsav, duration) { @@ -1373,14 +2001,14 @@ friend struct ActorCallback< TimeoutImplActor, 0, Void >; } }; } - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" [[nodiscard]] Future timeoutImpl( Reference> const& tsav, double const& duration ) { - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" return Future(new TimeoutImplActor(tsav, duration)); - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" } -#line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +#line 1782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" namespace { @@ -1416,14 +2044,17 @@ void MultiVersionTransaction::setTimeout(Optional value) { { // lock scope ThreadSpinLockHolder holder(timeoutLock); - - Reference> tsav = timeoutTsav; - ThreadFuture newTimeout = onMainThread([transactionStartTime, tsav, timeoutDuration]() { - return timeoutImpl(tsav, timeoutDuration - std::max(0.0, now() - transactionStartTime)); - }); - prevTimeout = currentTimeout; - currentTimeout = newTimeout; + + if (timeoutDuration > 0) { + Reference> tsav = timeoutTsav; + ThreadFuture newTimeout = onMainThread([transactionStartTime, tsav, timeoutDuration]() { + return timeoutImpl(tsav, timeoutDuration - std::max(0.0, now() - transactionStartTime)); + }); + currentTimeout = newTimeout; + } else { + currentTimeout = ThreadFuture(); + } } // Cancel the previous timeout now that we have a new one. This means that changing the timeout @@ -1433,6 +2064,18 @@ void MultiVersionTransaction::setTimeout(Optional value) { } } +// Removes timeout if set. This timeout only applies if we don't have an underlying database object to connect with. +void MultiVersionTransaction::resetTimeout() { + ThreadFuture prevTimeout; + { // lock scope + ThreadSpinLockHolder holder(timeoutLock); + prevTimeout = currentTimeout; + currentTimeout = ThreadFuture(); + } + if (prevTimeout.isValid()) { + prevTimeout.cancel(); + } +} // Creates a ThreadFuture that will signal an error if the transaction times out. template ThreadFuture MultiVersionTransaction::makeTimeout() { @@ -1456,14 +2099,19 @@ ThreadFuture MultiVersionTransaction::makeTimeout() { template ThreadResult MultiVersionTransaction::abortableTimeoutResult(ThreadFuture abortSignal) { - ThreadFuture timeoutFuture = makeTimeout(); - ThreadFuture abortable = abortableFuture(timeoutFuture, abortSignal); + // If database initialization failed, return the initialization error + auto dbError = db->dbState->getInitializationError(); + if (dbError.isError()) { + return ThreadResult(dbError.getError()); + } + ThreadFuture abortable = abortableFuture(makeTimeout(), abortSignal); abortable.blockUntilReadyCheckOnMainThread(); return ThreadResult((ThreadSingleAssignmentVar*)abortable.extractPtr()); } void MultiVersionTransaction::reset() { persistentOptions.clear(); + sensitivePersistentOptions.clear(); // Reset the timeout state Reference> prevTimeoutTsav; @@ -1487,11 +2135,14 @@ void MultiVersionTransaction::reset() { } setDefaultOptions(db->dbState->transactionDefaultOptions); - updateTransaction(); + updateTransaction(false); } MultiVersionTransaction::~MultiVersionTransaction() { timeoutTsav->trySendError(transaction_cancelled()); + if (currentTimeout.isValid()) { + currentTimeout.cancel(); + } } bool MultiVersionTransaction::isValid() { @@ -1499,8 +2150,18 @@ bool MultiVersionTransaction::isValid() { return tr.transaction.isValid(); } +void MultiVersionTransaction::debugTrace(BaseTraceEvent&& event) { + auto tr = getTransaction(); + tr.transaction->debugTrace(std::move(event)); +} + +void MultiVersionTransaction::debugPrint(std::string const& message) { + auto tr = getTransaction(); + tr.transaction->debugPrint(message); +} + // MultiVersionTenant -MultiVersionTenant::MultiVersionTenant(Reference db, StringRef tenantName) +MultiVersionTenant::MultiVersionTenant(Reference db, TenantNameRef tenantName) : tenantState(makeReference(db, tenantName)) {} MultiVersionTenant::~MultiVersionTenant() { @@ -1513,7 +2174,66 @@ Reference MultiVersionTenant::createTransaction() { tenantState->db->dbState->transactionDefaultOptions)); } -MultiVersionTenant::TenantState::TenantState(Reference db, StringRef tenantName) +template +ThreadFuture MultiVersionTenant::executeOperation(ThreadFuture (ITenant::*func)(Args...), Args&&... args) { + auto tenantDb = tenantState->tenantVar->get(); + if (tenantDb.value) { + auto f = (tenantDb.value.getPtr()->*func)(std::forward(args)...); + return abortableFuture(f, tenantDb.onChange); + } + + // If database initialization failed, return the initialization error + auto dbError = tenantState->db->dbState->getInitializationError(); + if (dbError.isError()) { + return ThreadFuture(dbError.getError()); + } + + // Wait for the database to be initialized + return abortableFuture(ThreadFuture(Never()), tenantDb.onChange); +} + +ThreadFuture MultiVersionTenant::getId() { + return executeOperation(&ITenant::getId); +} + +ThreadFuture MultiVersionTenant::purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) { + return executeOperation( + &ITenant::purgeBlobGranules, keyRange, std::forward(purgeVersion), std::forward(force)); +} + +ThreadFuture MultiVersionTenant::waitPurgeGranulesComplete(const KeyRef& purgeKey) { + return executeOperation(&ITenant::waitPurgeGranulesComplete, purgeKey); +} + +ThreadFuture MultiVersionTenant::blobbifyRange(const KeyRangeRef& keyRange) { + return executeOperation(&ITenant::blobbifyRange, keyRange); +} + +ThreadFuture MultiVersionTenant::blobbifyRangeBlocking(const KeyRangeRef& keyRange) { + return executeOperation(&ITenant::blobbifyRangeBlocking, keyRange); +} + +ThreadFuture MultiVersionTenant::unblobbifyRange(const KeyRangeRef& keyRange) { + return executeOperation(&ITenant::unblobbifyRange, keyRange); +} + +ThreadFuture>> MultiVersionTenant::listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) { + return executeOperation(&ITenant::listBlobbifiedRanges, keyRange, std::forward(rangeLimit)); +} + +ThreadFuture MultiVersionTenant::verifyBlobRange(const KeyRangeRef& keyRange, Optional version) { + return executeOperation(&ITenant::verifyBlobRange, keyRange, std::forward>(version)); +} + +ThreadFuture MultiVersionTenant::flushBlobRange(const KeyRangeRef& keyRange, + bool compact, + Optional version) { + return executeOperation( + &ITenant::flushBlobRange, keyRange, std::forward(compact), std::forward>(version)); +} + +MultiVersionTenant::TenantState::TenantState(Reference db, TenantNameRef tenantName) : tenantVar(new ThreadSafeAsyncVar>(Reference(nullptr))), tenantName(tenantName), db(db), closed(false) { updateTenant(); @@ -1530,7 +2250,7 @@ void MultiVersionTenant::TenantState::updateTenant() { tenant = Reference(nullptr); } - tenantVar->set(tenant); + tenantVar->set(tenant, /* triggerIfSame */ !tenant.isValid()); Reference self = Reference::addRef(this); @@ -1556,13 +2276,12 @@ void MultiVersionTenant::TenantState::close() { // MultiVersionDatabase MultiVersionDatabase::MultiVersionDatabase(MultiVersionApi* api, int threadIdx, - std::string clusterFilePath, + ClusterConnectionRecord const& connectionRecord, Reference db, Reference versionMonitorDb, bool openConnectors) - : dbState(new DatabaseState(clusterFilePath, versionMonitorDb)) { - dbState->db = db; - dbState->dbVar->set(db); + : dbState(new DatabaseState(connectionRecord, versionMonitorDb)) { + dbState->setDatabase(db); if (openConnectors) { if (!api->localClientDisabled) { dbState->addClient(api->getLocalClient()); @@ -1570,7 +2289,7 @@ MultiVersionDatabase::MultiVersionDatabase(MultiVersionApi* api, api->runOnExternalClients(threadIdx, [this](Reference client) { dbState->addClient(client); }); - api->runOnExternalClientsAllThreads([&clusterFilePath](Reference client) { + api->runOnExternalClientsAllThreads([&connectionRecord](Reference client) { // This creates a database to initialize some client state on the external library. // We only do this on 6.2+ clients to avoid some bugs associated with older versions. // This deletes the new database immediately to discard its connections. @@ -1580,7 +2299,7 @@ MultiVersionDatabase::MultiVersionDatabase(MultiVersionApi* api, // to run this initialization in case the other fails, and it's safe to run them in parallel. if (client->protocolVersion.hasCloseUnusedConnection() && !client->initialized) { try { - Reference newDb = client->api->createDatabase(clusterFilePath.c_str()); + Reference newDb = connectionRecord.createDatabase(client->api); client->initialized = true; } catch (Error& e) { // This connection is not initialized. It is still possible to connect with it, @@ -1589,23 +2308,23 @@ MultiVersionDatabase::MultiVersionDatabase(MultiVersionApi* api, TraceEvent(SevWarnAlways, "FailedToInitializeExternalClient") .error(e) .detail("LibraryPath", client->libPath) - .detail("ClusterFilePath", clusterFilePath); + .detail("ConnectionRecord", connectionRecord); } } }); // For clients older than 6.2 we create and maintain our database connection - api->runOnExternalClients(threadIdx, [this, &clusterFilePath](Reference client) { + api->runOnExternalClients(threadIdx, [this, &connectionRecord](Reference client) { if (!client->protocolVersion.hasCloseUnusedConnection()) { try { dbState->legacyDatabaseConnections[client->protocolVersion] = - client->api->createDatabase(clusterFilePath.c_str()); + connectionRecord.createDatabase(client->api); } catch (Error& e) { // This connection is discarded TraceEvent(SevWarnAlways, "FailedToCreateLegacyDatabaseConnection") .error(e) .detail("LibraryPath", client->libPath) - .detail("ClusterFilePath", clusterFilePath); + .detail("ConnectionRecord", connectionRecord); } } }); @@ -1622,7 +2341,8 @@ MultiVersionDatabase::~MultiVersionDatabase() { // Create a MultiVersionDatabase that wraps an already created IDatabase object // For internal use in testing Reference MultiVersionDatabase::debugCreateFromExistingDatabase(Reference db) { - return Reference(new MultiVersionDatabase(MultiVersionApi::api, 0, "", db, db, false)); + return Reference(new MultiVersionDatabase( + MultiVersionApi::api, 0, ClusterConnectionRecord::fromConnectionString(""), db, db, false)); } Reference MultiVersionDatabase::openTenant(TenantNameRef tenantName) { @@ -1643,6 +2363,9 @@ void MultiVersionDatabase::setOption(FDBDatabaseOptions::Option option, Optional TraceEvent("UnknownDatabaseOption").detail("Option", option); throw invalid_option(); } + if (itr->first == FDBDatabaseOptions::USE_CONFIG_DATABASE) { + dbState->isConfigDB = true; + } int defaultFor = itr->second.defaultFor; if (defaultFor >= 0) { @@ -1666,20 +2389,34 @@ ThreadFuture MultiVersionDatabase::rebootWorker(const StringRef& addres return false; } +template +ThreadFuture MultiVersionDatabase::executeOperation(ThreadFuture (IDatabase::*func)(Args...), Args&&... args) { + auto db = dbState->dbVar->get(); + if (db.value) { + auto f = (db.value.getPtr()->*func)(std::forward(args)...); + return abortableFuture(f, db.onChange); + } + + // If database initialization failed, return the initialization error + auto dbError = dbState->getInitializationError(); + if (dbError.isError()) { + return ThreadFuture(dbError.getError()); + } + + // Wait for the database to be initialized + return abortableFuture(ThreadFuture(Never()), db.onChange); +} + ThreadFuture MultiVersionDatabase::forceRecoveryWithDataLoss(const StringRef& dcid) { - auto f = dbState->db ? dbState->db->forceRecoveryWithDataLoss(dcid) : ThreadFuture(Never()); - return abortableFuture(f, dbState->dbVar->get().onChange); + return executeOperation(&IDatabase::forceRecoveryWithDataLoss, dcid); } ThreadFuture MultiVersionDatabase::createSnapshot(const StringRef& uid, const StringRef& snapshot_command) { - auto f = dbState->db ? dbState->db->createSnapshot(uid, snapshot_command) : ThreadFuture(Never()); - return abortableFuture(f, dbState->dbVar->get().onChange); + return executeOperation(&IDatabase::createSnapshot, uid, snapshot_command); } ThreadFuture MultiVersionDatabase::createSharedState() { - auto dbVar = dbState->dbVar->get(); - auto f = dbVar.value ? dbVar.value->createSharedState() : ThreadFuture(Never()); - return abortableFuture(f, dbVar.onChange); + return executeOperation(&IDatabase::createSharedState); } void MultiVersionDatabase::setSharedState(DatabaseSharedState* p) { @@ -1705,12 +2442,40 @@ double MultiVersionDatabase::getMainThreadBusyness() { ThreadFuture MultiVersionDatabase::purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) { - auto f = dbState->db ? dbState->db->purgeBlobGranules(keyRange, purgeVersion, force) : ThreadFuture(Never()); - return abortableFuture(f, dbState->dbVar->get().onChange); + return executeOperation( + &IDatabase::purgeBlobGranules, keyRange, std::forward(purgeVersion), std::forward(force)); } + ThreadFuture MultiVersionDatabase::waitPurgeGranulesComplete(const KeyRef& purgeKey) { - auto f = dbState->db ? dbState->db->waitPurgeGranulesComplete(purgeKey) : ThreadFuture(Never()); - return abortableFuture(f, dbState->dbVar->get().onChange); + return executeOperation(&IDatabase::waitPurgeGranulesComplete, purgeKey); +} + +ThreadFuture MultiVersionDatabase::blobbifyRange(const KeyRangeRef& keyRange) { + return executeOperation(&IDatabase::blobbifyRange, keyRange); +} + +ThreadFuture MultiVersionDatabase::blobbifyRangeBlocking(const KeyRangeRef& keyRange) { + return executeOperation(&IDatabase::blobbifyRangeBlocking, keyRange); +} + +ThreadFuture MultiVersionDatabase::unblobbifyRange(const KeyRangeRef& keyRange) { + return executeOperation(&IDatabase::unblobbifyRange, keyRange); +} + +ThreadFuture>> MultiVersionDatabase::listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) { + return executeOperation(&IDatabase::listBlobbifiedRanges, keyRange, std::forward(rangeLimit)); +} + +ThreadFuture MultiVersionDatabase::verifyBlobRange(const KeyRangeRef& keyRange, Optional version) { + return executeOperation(&IDatabase::verifyBlobRange, keyRange, std::forward>(version)); +} + +ThreadFuture MultiVersionDatabase::flushBlobRange(const KeyRangeRef& keyRange, + bool compact, + Optional version) { + return executeOperation( + &IDatabase::flushBlobRange, keyRange, std::forward(compact), std::forward>(version)); } // Returns the protocol version reported by the coordinator this client is connected to @@ -1720,9 +2485,53 @@ ThreadFuture MultiVersionDatabase::getServerProtocol(Optional

    versionMonitorDb->getServerProtocol(expectedVersion); } -MultiVersionDatabase::DatabaseState::DatabaseState(std::string clusterFilePath, Reference versionMonitorDb) +ThreadFuture> MultiVersionDatabase::getClientStatus() { + auto stateRef = dbState; + auto db = stateRef->dbVar->get(); + if (!db.value.isValid()) { + db.value = stateRef->versionMonitorDb; + } + if (!db.value.isValid()) { + return onMainThread([stateRef] { return Future>(stateRef->getClientStatus(""_sr)); }); + } else { + // If a database is created first retrieve its status + auto f = db.value->getClientStatus(); + auto statusFuture = abortableFuture(f, db.onChange); + return flatMapThreadFuture, Standalone>( + statusFuture, [stateRef](ErrorOr> dbContextStatus) { + return onMainThread([stateRef, dbContextStatus] { + return Future>(stateRef->getClientStatus(dbContextStatus)); + }); + }); + } +} + +MultiVersionDatabase::DatabaseState::DatabaseState(ClusterConnectionRecord const& connectionRecord, + Reference versionMonitorDb) : dbVar(new ThreadSafeAsyncVar>(Reference(nullptr))), - clusterFilePath(clusterFilePath), versionMonitorDb(versionMonitorDb), closed(false) {} + connectionRecord(connectionRecord), versionMonitorDb(versionMonitorDb), + initializationState(InitializationState::INITIALIZING), isConfigDB(false) {} + +void MultiVersionDatabase::DatabaseState::setDatabase(Reference db) { + if (db.isValid()) { + initializationState = InitializationState::CREATED; + } + this->db = db; + dbVar->set(db, true); +} + +ErrorOr MultiVersionDatabase::DatabaseState::getInitializationError() { + InitializationState st = initializationState.load(); + switch (st) { + case InitializationState::INCOMPATIBLE: + return MultiVersionApi::api->failIncompatibleClient ? ErrorOr(incompatible_client()) + : ErrorOr(Void()); + case InitializationState::INITIALIZATION_FAILED: + return ErrorOr(initializationError); + default: + return ErrorOr(Void()); + } +} // Adds a client (local or externally loaded) that can be used to connect to the cluster void MultiVersionDatabase::DatabaseState::addClient(Reference client) { @@ -1766,6 +2575,11 @@ ThreadFuture MultiVersionDatabase::DatabaseState::monitorProtocolVersion() Reference self = Reference::addRef(this); return mapThreadFuture(f, [self, expected](ErrorOr cv) { + if (self->initializationState == InitializationState::CLOSED) { + return ErrorOr(Void()); + } + + ProtocolVersion clusterVersion; if (cv.isError()) { if (cv.getError().code() == error_code_operation_cancelled) { return ErrorOr(cv.getError()); @@ -1774,11 +2588,19 @@ ThreadFuture MultiVersionDatabase::DatabaseState::monitorProtocolVersion() TraceEvent("ErrorGettingClusterProtocolVersion") .error(cv.getError()) .detail("ExpectedProtocolVersion", expected); - } - ProtocolVersion clusterVersion = - !cv.isError() ? cv.get() : self->dbProtocolVersion.orDefault(currentProtocolVersion); - onMainThreadVoid([self, clusterVersion]() { self->protocolVersionChanged(clusterVersion); }); + if (self->initializationState == InitializationState::INITIALIZING) { + // A failure to retrieve the protocol error is a fatal error, such as invalid or + // missing cluster file. There is no point of retrying on it. + // Mark the database as failed and abort pending futures + self->initializationError = cv.getError(); + self->initializationState = InitializationState::INITIALIZATION_FAILED; + self->dbVar->set(Reference(), true); + } + } else { + clusterVersion = cv.get(); + onMainThreadVoid([self, clusterVersion]() { self->protocolVersionChanged(clusterVersion); }); + } return ErrorOr(Void()); }); } @@ -1786,11 +2608,12 @@ ThreadFuture MultiVersionDatabase::DatabaseState::monitorProtocolVersion() // Called when a change to the protocol version of the cluster has been detected. // Must be called from the main thread void MultiVersionDatabase::DatabaseState::protocolVersionChanged(ProtocolVersion protocolVersion) { - if (closed) { + if (initializationState == InitializationState::CLOSED) { return; } - // If the protocol version changed but is still compatible, update our local version but keep the same connection + // If the protocol version changed but is still compatible, update our local version but keep the + // same connection if (dbProtocolVersion.present() && protocolVersion.normalizedVersion() == dbProtocolVersion.get().normalizedVersion()) { dbProtocolVersion = protocolVersion; @@ -1798,74 +2621,70 @@ void MultiVersionDatabase::DatabaseState::protocolVersionChanged(ProtocolVersion ASSERT(protocolVersionMonitor.isValid()); protocolVersionMonitor.cancel(); protocolVersionMonitor = monitorProtocolVersion(); + return; } // The protocol version has changed to a different, incompatible version - else { - TraceEvent("ProtocolVersionChanged") - .detail("NewProtocolVersion", protocolVersion) - .detail("OldProtocolVersion", dbProtocolVersion); - // When the protocol version changes, clear the corresponding entry in the shared state map - // so it can be re-initialized. Only do so if there was a valid previous protocol version. - if (dbProtocolVersion.present() && MultiVersionApi::apiVersionAtLeast(710)) { - MultiVersionApi::api->clearClusterSharedStateMapEntry(clusterFilePath); - } - - dbProtocolVersion = protocolVersion; - - auto itr = clients.find(protocolVersion.normalizedVersion()); - if (itr != clients.end()) { - auto& client = itr->second; - TraceEvent("CreatingDatabaseOnClient") - .detail("LibraryPath", client->libPath) - .detail("Failed", client->failed) - .detail("External", client->external); - - Reference newDb; - try { - newDb = client->api->createDatabase(clusterFilePath.c_str()); - } catch (Error& e) { - TraceEvent(SevWarnAlways, "MultiVersionClientFailedToCreateDatabase") - .error(e) - .detail("LibraryPath", client->libPath) - .detail("External", client->external) - .detail("ClusterFilePath", clusterFilePath); + TraceEvent("ProtocolVersionChanged") + .detail("NewProtocolVersion", protocolVersion) + .detail("OldProtocolVersion", dbProtocolVersion); + // When the protocol version changes, clear the corresponding entry in the shared state map + // so it can be re-initialized. Only do so if there was a valid previous protocol version. + if (dbProtocolVersion.present() && MultiVersionApi::api->getApiVersion().hasClusterSharedStateMap()) { + MultiVersionApi::api->clearClusterSharedStateMapEntry(clusterId, dbProtocolVersion.get()); + } + + dbProtocolVersion = protocolVersion; + + auto itr = clients.find(protocolVersion.normalizedVersion()); + if (itr == clients.end()) { + // We don't have a client matching the current protocol + initializationState = InitializationState::INCOMPATIBLE; + updateDatabase(Reference(), Reference()); + return; + } - // Put the client in a disconnected state until the version changes again - updateDatabase(Reference(), Reference()); - return; - } + // A compatible client found, use it for creating a new database connection + auto& client = itr->second; + TraceEvent("CreatingDatabaseOnClient") + .detail("LibraryPath", client->libPath) + .detail("Failed", client->failed) + .detail("External", client->external); - if (client->external && !MultiVersionApi::apiVersionAtLeast(610)) { - // Old API versions return a future when creating the database, so we need to wait for it - Reference self = Reference::addRef(this); - dbReady = mapThreadFuture( - newDb.castTo()->onReady(), [self, newDb, client](ErrorOr ready) { - if (!ready.isError()) { - onMainThreadVoid([self, newDb, client]() { self->updateDatabase(newDb, client); }); - } else { - onMainThreadVoid( - [self, client]() { self->updateDatabase(Reference(), client); }); - } + Reference newDb; + try { + newDb = connectionRecord.createDatabase(client->api); + } catch (Error& e) { + // Create error currently does not return any error except for network not initialized, + // which cannot happen at this point + ASSERT(false); + } - return ready; - }); - } else { - updateDatabase(newDb, client); - } - } else { - // We don't have a client matching the current protocol - updateDatabase(Reference(), Reference()); - } + if (client->external && !MultiVersionApi::api->getApiVersion().hasInlineUpdateDatabase()) { + // Old API versions return a future when creating the database, so we need to wait for it + Reference self = Reference::addRef(this); + dbReady = mapThreadFuture( + newDb.castTo()->onReady(), [self, newDb, client](ErrorOr ready) { + if (!ready.isError()) { + onMainThreadVoid([self, newDb, client]() { self->updateDatabase(newDb, client); }); + } else { + onMainThreadVoid( + [self, client]() { self->updateDatabase(Reference(), Reference()); }); + } + return ready; + }); + } else { + updateDatabase(newDb, client); } } // Replaces the active database connection with a new one. Must be called from the main thread. void MultiVersionDatabase::DatabaseState::updateDatabase(Reference newDb, Reference client) { - if (closed) { + if (initializationState == InitializationState::CLOSED) { return; } + // Reapply database options on the new database if (newDb) { optionLock.enter(); for (auto option : options) { @@ -1888,46 +2707,50 @@ void MultiVersionDatabase::DatabaseState::updateDatabase(Reference ne break; } } - - db = newDb; - optionLock.leave(); + } - if (dbProtocolVersion.get().hasStableInterfaces() && db) { - versionMonitorDb = db; - } else { - // For older clients that don't have an API to get the protocol version, we have to monitor it locally - try { - versionMonitorDb = MultiVersionApi::api->getLocalClient()->api->createDatabase(clusterFilePath.c_str()); - } catch (Error& e) { - // We can't create a new database to monitor the cluster version. This means we will continue using the - // previous one, which should hopefully continue to work. - TraceEvent(SevWarnAlways, "FailedToCreateDatabaseForVersionMonitoring") - .error(e) - .detail("ClusterFilePath", clusterFilePath); - } - } + // Use the new database for monitoring the version changes, if it supports version monitoring + if (newDb && dbProtocolVersion.get().hasStableInterfaces()) { + versionMonitorDb = newDb; } else { // We don't have a database connection, so use the local client to monitor the protocol version - db = Reference(); + // Also for older clients that don't have an API to get the protocol version, we have to monitor it locally try { - versionMonitorDb = MultiVersionApi::api->getLocalClient()->api->createDatabase(clusterFilePath.c_str()); + versionMonitorDb = connectionRecord.createDatabase(MultiVersionApi::api->getLocalClient()->api); } catch (Error& e) { - // We can't create a new database to monitor the cluster version. This means we will continue using the - // previous one, which should hopefully continue to work. + // We can't create a new database to monitor the cluster version. This means we will continue using + // the previous one, which should hopefully continue to work. TraceEvent(SevWarnAlways, "FailedToCreateDatabaseForVersionMonitoring") .error(e) - .detail("ClusterFilePath", clusterFilePath); - } - } - if (db.isValid() && dbProtocolVersion.present() && MultiVersionApi::apiVersionAtLeast(710)) { - auto updateResult = MultiVersionApi::api->updateClusterSharedStateMap(clusterFilePath, db); - auto handler = mapThreadFuture(updateResult, [this](ErrorOr result) { - dbVar->set(db); - return ErrorOr(Void()); - }); + .detail("ConnectionRecord", connectionRecord); + } + } + + // Verify the database has the necessary functionality to update the shared + // state. Avoid updating the shared state if the database is a + // configuration database, because a configuration database does not have + // access to typical system keys and does not need to be updated. + if (newDb && MultiVersionApi::api->getApiVersion().hasClusterSharedStateMap() && !isConfigDB) { + Future updateResult = + MultiVersionApi::api->updateClusterSharedStateMap(connectionRecord, dbProtocolVersion.get(), newDb); + sharedStateUpdater = map(errorOr(updateResult), [this, newDb](ErrorOr result) { + if (result.present()) { + clusterId = result.get(); + TraceEvent("ClusterSharedStateUpdated") + .detail("ClusterId", result.get()) + .detail("ProtocolVersion", dbProtocolVersion.get()); + } else { + TraceEvent(SevWarnAlways, "ClusterSharedStateUpdateError") + .error(result.getError()) + .detail("ConnectionRecord", connectionRecord) + .detail("ProtocolVersion", dbProtocolVersion.get()); + } + setDatabase(newDb); + return Void(); + }); } else { - dbVar->set(db); + setDatabase(newDb); } ASSERT(protocolVersionMonitor.isValid()); @@ -1954,7 +2777,7 @@ void MultiVersionDatabase::DatabaseState::startLegacyVersionMonitors() { void MultiVersionDatabase::DatabaseState::close() { Reference self = Reference::addRef(this); onMainThreadVoid([self]() { - self->closed = true; + self->initializationState = InitializationState::CLOSED; if (self->protocolVersionMonitor.isValid()) { self->protocolVersionMonitor.cancel(); } @@ -1966,6 +2789,92 @@ void MultiVersionDatabase::DatabaseState::close() { }); } +namespace { + +const char* initializationStateToString(MultiVersionDatabase::InitializationState initState) { + switch (initState) { + case MultiVersionDatabase::InitializationState::INITIALIZING: + return "initializing"; + case MultiVersionDatabase::InitializationState::INITIALIZATION_FAILED: + return "initialization_failed"; + case MultiVersionDatabase::InitializationState::CREATED: + return "created"; + case MultiVersionDatabase::InitializationState::INCOMPATIBLE: + return "incompatible"; + case MultiVersionDatabase::InitializationState::CLOSED: + return "closed"; + default: + ASSERT(false); + return "invalid_state"; + } +} + +} // namespace + +// +// Generates the client-side status report for the Multi-Version Database +// +// The parameter dbContextStatus contains the status report generated by +// the wrapped Native Database (from external or local client), which is then +// embedded within the status report of the Multi-Version Database +// +// The overall report schema is as follows: +// { "Healthy": , +// "InitializationState": , +// "InitializationError": , +// "ProtocolVersion" : , +// "ConnectionRecord" : , +// "DatabaseStatus" : , +// "ErrorRetrievingDatabaseStatus" : , +// "AvailableClients" : [ +// { "ProtocolVersion" : , +// "ReleaseVersion" : , +// "ThreadIndex" : +// }, +// ... +// ] +// } +// +// +Standalone MultiVersionDatabase::DatabaseState::getClientStatus( + ErrorOr> dbContextStatus) { + json_spirit::mObject statusObj; + statusObj["InitializationState"] = initializationStateToString(initializationState); + if (initializationState == InitializationState::INITIALIZATION_FAILED) { + statusObj["InitializationError"] = initializationError.code(); + } + json_spirit::mArray clientArr; + for (auto [protocolVersion, client] : this->clients) { + json_spirit::mObject clientDesc; + clientDesc["ProtocolVersion"] = format("%llx", client->protocolVersion.version()); + clientDesc["ReleaseVersion"] = client->releaseVersion; + clientDesc["ThreadIndex"] = client->threadIndex; + clientArr.push_back(clientDesc); + } + statusObj["AvailableClients"] = clientArr; + statusObj["ConnectionRecord"] = connectionRecord.toString(); + if (dbProtocolVersion.present()) { + statusObj["ProtocolVersion"] = format("%llx", dbProtocolVersion.get().version()); + } + bool dbContextHealthy = false; + if (initializationState != InitializationState::INITIALIZATION_FAILED) { + if (dbContextStatus.isError()) { + statusObj["ErrorRetrievingDatabaseStatus"] = dbContextStatus.getError().code(); + } else { + json_spirit::mValue dbContextStatusVal; + json_spirit::read_string(dbContextStatus.get().toString(), dbContextStatusVal); + statusObj["DatabaseStatus"] = dbContextStatusVal; + auto& dbContextStatusObj = dbContextStatusVal.get_obj(); + auto healthyIter = dbContextStatusObj.find("Healthy"); + if (healthyIter != dbContextStatusObj.end() && healthyIter->second.type() == json_spirit::bool_type) { + dbContextHealthy = healthyIter->second.get_bool(); + } + } + } + statusObj["Healthy"] = initializationState == InitializationState::CREATED && dbContextHealthy; + return StringRef(json_spirit::write_string(json_spirit::mValue(statusObj))); +} + // Starts the connection monitor by creating a database object at an old version. // Must be called from the main thread void MultiVersionDatabase::LegacyVersionMonitor::startConnectionMonitor( @@ -2017,7 +2926,7 @@ void MultiVersionDatabase::LegacyVersionMonitor::runGrvProbe(Reference([](Version v) { return Void(); }); + return v.map([](Version v) { return Void(); }); }); } @@ -2028,22 +2937,19 @@ void MultiVersionDatabase::LegacyVersionMonitor::close() { } // MultiVersionApi -bool MultiVersionApi::apiVersionAtLeast(int minVersion) { - ASSERT_NE(MultiVersionApi::api->apiVersion, 0); - return MultiVersionApi::api->apiVersion >= minVersion || MultiVersionApi::api->apiVersion < 0; -} - void MultiVersionApi::runOnExternalClientsAllThreads(std::function)> func, - bool runOnFailedClients) { + bool runOnFailedClients, + bool failOnError) { for (int i = 0; i < threadCount; i++) { - runOnExternalClients(i, func, runOnFailedClients); + runOnExternalClients(i, func, runOnFailedClients, failOnError); } } // runOnFailedClients should be used cautiously. Some failed clients may not have successfully loaded all symbols. void MultiVersionApi::runOnExternalClients(int threadIdx, std::function)> func, - bool runOnFailedClients) { + bool runOnFailedClients, + bool failOnError) { bool newFailure = false; auto c = externalClients.begin(); @@ -2062,6 +2968,9 @@ void MultiVersionApi::runOnExternalClients(int threadIdx, TraceEvent(SevWarnAlways, "ExternalClientFailure").error(e).detail("LibPath", c->first); client->failed = true; newFailure = true; + if (failOnError) { + throw e; + } } } @@ -2073,30 +2982,44 @@ void MultiVersionApi::runOnExternalClients(int threadIdx, } } +bool MultiVersionApi::hasNonFailedExternalClients() { + bool validClientFound = false; + runOnExternalClientsAllThreads([&validClientFound](auto client) { + if (!client->failed) { + validClientFound = true; + } + }); + return validClientFound; +} + Reference MultiVersionApi::getLocalClient() { return localClient; } void MultiVersionApi::selectApiVersion(int apiVersion) { + ApiVersion newApiVersion(apiVersion); if (!localClient) { localClient = makeReference(getLocalClientAPI()); ASSERT(localClient); } - if (this->apiVersion != 0 && this->apiVersion != apiVersion) { + if (this->apiVersion.isValid() && this->apiVersion != newApiVersion) { throw api_version_already_set(); } localClient->api->selectApiVersion(apiVersion); - this->apiVersion = apiVersion; + this->apiVersion = newApiVersion; } const char* MultiVersionApi::getClientVersion() { return localClient->api->getClientVersion(); } -namespace { +void MultiVersionApi::useFutureProtocolVersion() { + localClient->api->useFutureProtocolVersion(); +} +namespace { void validateOption(Optional value, bool canBePresent, bool canBeAbsent, bool canBeEmpty = true) { ASSERT(canBePresent || canBeAbsent); @@ -2112,7 +3035,7 @@ void validateOption(Optional value, bool canBePresent, bool canBeAbse void MultiVersionApi::disableMultiVersionClientApi() { MutexHolder holder(lock); - if (networkStartSetup || localClientDisabled) { + if (networkStartSetup || localClientDisabled || disableBypass) { throw invalid_option(); } @@ -2127,7 +3050,7 @@ void MultiVersionApi::setCallbacksOnExternalThreads() { callbackOnMainThread = false; } -void MultiVersionApi::addExternalLibrary(std::string path) { +void MultiVersionApi::addExternalLibrary(std::string path, bool useFutureVersion) { std::string filename = basename(path); if (filename.empty() || !fileExists(path)) { @@ -2140,12 +3063,13 @@ void MultiVersionApi::addExternalLibrary(std::string path) { throw invalid_option(); // SOMEDAY: it might be good to allow clients to be added after the network is setup } - // external libraries always run on their own thread; ensure we allocate at least one thread to run this library. + // external libraries always run on their own thread; ensure we allocate at least one thread to run this + // library. threadCount = std::max(threadCount, 1); if (externalClientDescriptions.count(filename) == 0) { - TraceEvent("AddingExternalClient").detail("LibraryPath", filename); - externalClientDescriptions.emplace(std::make_pair(filename, ClientDesc(path, true))); + TraceEvent("AddingExternalClient").detail("LibraryPath", filename).detail("UseFutureVersion", useFutureVersion); + externalClientDescriptions.emplace(std::make_pair(filename, ClientDesc(path, true, useFutureVersion))); } } @@ -2158,14 +3082,15 @@ void MultiVersionApi::addExternalLibraryDirectory(std::string path) { throw invalid_option(); // SOMEDAY: it might be good to allow clients to be added after the network is setup } - // external libraries always run on their own thread; ensure we allocate at least one thread to run this library. + // external libraries always run on their own thread; ensure we allocate at least one thread to run this + // library. threadCount = std::max(threadCount, 1); for (auto filename : files) { std::string lib = abspath(joinPath(path, filename)); if (externalClientDescriptions.count(filename) == 0) { TraceEvent("AddingExternalClient").detail("LibraryPath", filename); - externalClientDescriptions.emplace(std::make_pair(filename, ClientDesc(lib, true))); + externalClientDescriptions.emplace(std::make_pair(filename, ClientDesc(lib, true, false))); } } } @@ -2185,8 +3110,9 @@ std::vector> MultiVersionApi::copyExternalLibraryPe for (int ii = 0; ii < threadCount; ++ii) { std::string filename = basename(path); - char tempName[PATH_MAX + 12]; - sprintf(tempName, "/tmp/%s-XXXXXX", filename.c_str()); + constexpr int MAX_TMP_NAME_LENGTH = PATH_MAX + 12; + char tempName[MAX_TMP_NAME_LENGTH]; + snprintf(tempName, MAX_TMP_NAME_LENGTH, "%s/%s-XXXXXX", tmpDir.c_str(), filename.c_str()); int tempFd = mkstemp(tempName); int fd; @@ -2236,7 +3162,7 @@ std::vector> MultiVersionApi::copyExternalLibraryPe return paths; } -#else +#else // if defined (__unixish__) std::vector> MultiVersionApi::copyExternalLibraryPerThread(std::string path) { if (threadCount > 1) { TraceEvent(SevError, "MultipleClientThreadsUnsupportedOnWindows").log(); @@ -2246,7 +3172,7 @@ std::vector> MultiVersionApi::copyExternalLibraryPe paths.push_back({ path, false }); return paths; } -#endif +#endif // if defined (__unixish__) void MultiVersionApi::disableLocalClient() { MutexHolder holder(lock); @@ -2261,8 +3187,8 @@ void MultiVersionApi::setSupportedClientVersions(Standalone versions) MutexHolder holder(lock); ASSERT(networkSetup); - // This option must be set on the main thread because it modifies structures that can be used concurrently by the - // main thread + // This option must be set on the main thread because it modifies structures that can be used concurrently by + // the main thread onMainThreadVoid([this, versions]() { localClient->api->setNetworkOption(FDBNetworkOptions::SUPPORTED_CLIENT_VERSIONS, versions); }); @@ -2302,7 +3228,7 @@ void MultiVersionApi::setNetworkOptionInternal(FDBNetworkOptions::Option option, setCallbacksOnExternalThreads(); } else if (option == FDBNetworkOptions::EXTERNAL_CLIENT_LIBRARY) { validateOption(value, true, false, false); - addExternalLibrary(abspath(value.get().toString())); + addExternalLibrary(abspath(value.get().toString()), false); } else if (option == FDBNetworkOptions::EXTERNAL_CLIENT_DIRECTORY) { validateOption(value, true, false, false); addExternalLibraryDirectory(value.get().toString()); @@ -2318,6 +3244,13 @@ void MultiVersionApi::setNetworkOptionInternal(FDBNetworkOptions::Option option, externalClient = true; bypassMultiClientApi = true; forwardOption = true; + } else if (option == FDBNetworkOptions::DISABLE_CLIENT_BYPASS) { + MutexHolder holder(lock); + ASSERT(!networkStartSetup); + if (bypassMultiClientApi) { + throw invalid_option(); + } + disableBypass = true; } else if (option == FDBNetworkOptions::CLIENT_THREADS_PER_VERSION) { MutexHolder holder(lock); validateOption(value, true, false, false); @@ -2330,6 +3263,30 @@ void MultiVersionApi::setNetworkOptionInternal(FDBNetworkOptions::Option option, // multiple client threads are not supported on windows. threadCount = extractIntOption(value, 1, 1); #endif + } else if (option == FDBNetworkOptions::CLIENT_TMP_DIR) { + validateOption(value, true, false, false); + tmpDir = abspath(value.get().toString()); + } else if (option == FDBNetworkOptions::FUTURE_VERSION_CLIENT_LIBRARY) { + validateOption(value, true, false, false); + addExternalLibrary(abspath(value.get().toString()), true); + } else if (option == FDBNetworkOptions::TRACE_FILE_IDENTIFIER) { + validateOption(value, true, false, true); + traceFileIdentifier = value.get().toString(); + { + MutexHolder holder(lock); + // Forward the option unmodified only to the the local client and let it validate it. + // While for external clients the trace file identifiers are determined in setupNetwork + localClient->api->setNetworkOption(option, value); + } + } else if (option == FDBNetworkOptions::TRACE_SHARE_AMONG_CLIENT_THREADS) { + validateOption(value, false, true); + traceShareBaseNameAmongThreads = true; + } else if (option == FDBNetworkOptions::IGNORE_EXTERNAL_CLIENT_FAILURES) { + validateOption(value, false, true); + ignoreExternalClientFailures = true; + } else if (option == FDBNetworkOptions::FAIL_INCOMPATIBLE_CLIENT) { + validateOption(value, false, true); + failIncompatibleClient = true; } else if (option == FDBNetworkOptions::RETAIN_CLIENT_LIBRARY_COPIES) { validateOption(value, false, true); retainClientLibCopies = true; @@ -2353,261 +3310,834 @@ void MultiVersionApi::setNetworkOptionInternal(FDBNetworkOptions::Option option, } void MultiVersionApi::setupNetwork() { - if (!externalClient) { - loadEnvironmentVariableNetworkOptions(); - } + try { + if (!externalClient) { + loadEnvironmentVariableNetworkOptions(); + } - uint64_t transportId = 0; - { // lock scope - MutexHolder holder(lock); - if (networkStartSetup) { - throw network_already_setup(); + uint64_t transportId = 0; + { // lock scope + MutexHolder holder(lock); + if (networkStartSetup) { + throw network_already_setup(); + } + + if (threadCount > 1) { + disableLocalClient(); + } + + networkStartSetup = true; + + if (externalClientDescriptions.empty() && localClientDisabled) { + TraceEvent(SevWarn, "CannotSetupNetwork") + .detail("Reason", "Local client is disabled and no external clients configured"); + + throw no_external_client_provided(); + } + + if (externalClientDescriptions.empty() && !disableBypass) { + bypassMultiClientApi = true; // SOMEDAY: we won't be able to set this option once it becomes possible to + // add clients after setupNetwork is called + } + + if (!bypassMultiClientApi) { + transportId = + (uint64_t(uint32_t(platform::getRandomSeed())) << 32) ^ uint32_t(platform::getRandomSeed()); + if (transportId <= 1) + transportId += 2; + localClient->api->setNetworkOption(FDBNetworkOptions::EXTERNAL_CLIENT_TRANSPORT_ID, + std::to_string(transportId)); + } + localClient->api->setupNetwork(); + + if (!apiVersion.hasFailOnExternalClientErrors()) { + ignoreExternalClientFailures = true; + } + + for (auto i : externalClientDescriptions) { + std::string path = i.second.libPath; + std::string filename = basename(path); + bool useFutureVersion = i.second.useFutureVersion; + + // Copy external lib for each thread + if (externalClients.count(filename) == 0) { + externalClients[filename] = {}; + auto libCopies = copyExternalLibraryPerThread(path); + for (int idx = 0; idx < libCopies.size(); ++idx) { + bool unlinkOnLoad = libCopies[idx].second && !retainClientLibCopies; + externalClients[filename].push_back(Reference( + new ClientInfo(new DLApi(libCopies[idx].first, unlinkOnLoad /*unlink on load*/), + path, + useFutureVersion, + idx))); + } + } + } } - if (threadCount > 1) { - disableLocalClient(); + localClient->loadVersion(); + + if (bypassMultiClientApi) { + networkSetup = true; + } else { + runOnExternalClientsAllThreads( + [this](Reference client) { + TraceEvent("InitializingExternalClient").detail("LibraryPath", client->libPath); + client->api->selectApiVersion(apiVersion.version()); + if (client->useFutureVersion) { + client->api->useFutureProtocolVersion(); + } + client->loadVersion(); + }, + false, + !ignoreExternalClientFailures); + + std::string baseTraceFileId; + if (apiVersion.hasTraceFileIdentifier()) { + // TRACE_FILE_IDENTIFIER option is supported since 6.3 + baseTraceFileId = traceFileIdentifier.empty() ? format("%d", getpid()) : traceFileIdentifier; + } + + MutexHolder holder(lock); + runOnExternalClientsAllThreads( + [this, transportId, baseTraceFileId](Reference client) { + for (auto option : options) { + client->api->setNetworkOption(option.first, option.second.castTo()); + } + client->api->setNetworkOption(FDBNetworkOptions::EXTERNAL_CLIENT_TRANSPORT_ID, + std::to_string(transportId)); + if (!baseTraceFileId.empty()) { + client->api->setNetworkOption(FDBNetworkOptions::TRACE_FILE_IDENTIFIER, + traceShareBaseNameAmongThreads + ? baseTraceFileId + : client->getTraceFileIdentifier(baseTraceFileId)); + } + client->api->setupNetwork(); + }, + false, + !ignoreExternalClientFailures); + + if (localClientDisabled && !hasNonFailedExternalClients()) { + TraceEvent(SevWarn, "CannotSetupNetwork") + .detail("Reason", "Local client is disabled and all external clients failed"); + throw all_external_clients_failed(); + } + + networkSetup = true; // Needs to be guarded by mutex } - for (auto i : externalClientDescriptions) { - std::string path = i.second.libPath; - std::string filename = basename(path); + options.clear(); + updateSupportedVersions(); + } catch (Error& e) { + // Make sure all error and warning events are traced + flushTraceFileVoid(); + throw e; + } +} + +THREAD_FUNC_RETURN runNetworkThread(void* param) { + try { + ((ClientInfo*)param)->api->runNetwork(); + } catch (Error& e) { + TraceEvent(SevError, "ExternalRunNetworkError").error(e); + } catch (std::exception& e) { + TraceEvent(SevError, "ExternalRunNetworkError").error(unknown_error()).detail("RootException", e.what()); + } catch (...) { + TraceEvent(SevError, "ExternalRunNetworkError").error(unknown_error()); + } - // Copy external lib for each thread - if (externalClients.count(filename) == 0) { - externalClients[filename] = {}; - for (const auto& tmp : copyExternalLibraryPerThread(path)) { - bool unlinkOnLoad = tmp.second && !retainClientLibCopies; - externalClients[filename].push_back(Reference( - new ClientInfo(new DLApi(tmp.first, unlinkOnLoad /*unlink on load*/), path))); + TraceEvent("ExternalNetworkThreadTerminating"); + THREAD_RETURN; +} + +void MultiVersionApi::runNetwork() { + lock.enter(); + if (!networkSetup) { + lock.leave(); + throw network_not_setup(); + } + + lock.leave(); + + std::vector handles; + if (!bypassMultiClientApi) { + runOnExternalClientsAllThreads([&handles](Reference client) { + ASSERT(client->external); + std::string threadName = format("fdb-%s-%d", client->releaseVersion.c_str(), client->threadIndex); + if (threadName.size() > 15) { + threadName = format("fdb-%s", client->releaseVersion.c_str()); + if (threadName.size() > 15) { + threadName = "fdb-external"; } } + handles.push_back(g_network->startThread(&runNetworkThread, client.getPtr(), 0, threadName.c_str())); + }); + } + + try { + localClient->api->runNetwork(); + } catch (const Error& e) { + closeTraceFile(); + throw e; + } + + for (auto h : handles) { + waitThread(h); + } + + TraceEvent("MultiVersionRunNetworkTerminating"); + closeTraceFile(); +} + +void MultiVersionApi::stopNetwork() { + lock.enter(); + if (!networkSetup) { + lock.leave(); + throw network_not_setup(); + } + lock.leave(); + + TraceEvent("MultiVersionStopNetwork"); + localClient->api->stopNetwork(); + + if (!bypassMultiClientApi) { + runOnExternalClientsAllThreads([](Reference client) { client->api->stopNetwork(); }, true); + } +} + +void MultiVersionApi::addNetworkThreadCompletionHook(void (*hook)(void*), void* hookParameter) { + lock.enter(); + if (!networkSetup) { + lock.leave(); + throw network_not_setup(); + } + lock.leave(); + + localClient->api->addNetworkThreadCompletionHook(hook, hookParameter); + + if (!bypassMultiClientApi) { + runOnExternalClientsAllThreads([hook, hookParameter](Reference client) { + client->api->addNetworkThreadCompletionHook(hook, hookParameter); + }); + } +} + +// Creates an IDatabase object that represents a connection to the cluster +Reference MultiVersionApi::createDatabase(ClusterConnectionRecord const& connectionRecord) { + lock.enter(); + if (!networkSetup) { + lock.leave(); + throw network_not_setup(); + } + if (localClientDisabled) { + ASSERT(!bypassMultiClientApi); + + int threadIdx = nextThread; + nextThread = (nextThread + 1) % threadCount; + lock.leave(); + + Reference localDb = connectionRecord.createDatabase(localClient->api); + return Reference( + new MultiVersionDatabase(this, threadIdx, connectionRecord, Reference(), localDb)); + } + + lock.leave(); + + ASSERT_LE(threadCount, 1); + + Reference localDb = connectionRecord.createDatabase(localClient->api); + if (bypassMultiClientApi) { + return localDb; + } else { + return Reference( + new MultiVersionDatabase(this, 0, connectionRecord, Reference(), localDb)); + } +} + +Reference MultiVersionApi::createDatabase(const char* clusterFilePath) { + return createDatabase(ClusterConnectionRecord::fromFile(clusterFilePath)); +} + +Reference MultiVersionApi::createDatabaseFromConnectionString(const char* connectionString) { + return createDatabase(ClusterConnectionRecord::fromConnectionString(connectionString)); +} + +void MultiVersionApi::updateSupportedVersions() { + if (networkSetup) { + Standalone> versionStr; + + // not mutating the client, so just call on one instance of each client version. + // thread 0 always exists. + runOnExternalClients(0, [&versionStr](Reference client) { + const char* ver = client->api->getClientVersion(); + versionStr.append(versionStr.arena(), (uint8_t*)ver, (int)strlen(ver)); + versionStr.append(versionStr.arena(), (uint8_t*)";", 1); + }); + + if (!localClient->failed) { + const char* local = localClient->api->getClientVersion(); + versionStr.append(versionStr.arena(), (uint8_t*)local, (int)strlen(local)); + } else { + versionStr.resize(versionStr.arena(), std::max(0, versionStr.size() - 1)); } - if (externalClients.empty() && localClientDisabled) { - // SOMEDAY: this should be allowed when it's possible to add external clients after the - // network is setup. - // - // Typically we would create a more specific error for this case, but since we expect - // this case to go away soon, we can use a trace event and a generic error. - TraceEvent(SevWarn, "CannotSetupNetwork") - .detail("Reason", "Local client is disabled and no external clients configured"); + setNetworkOption(FDBNetworkOptions::SUPPORTED_CLIENT_VERSIONS, + StringRef(versionStr.begin(), versionStr.size())); + } +} + +// Must be called from the main thread + #line 3590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +namespace { +// This generated class is to be used only via updateClusterSharedStateMapImpl() + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +template + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +class UpdateClusterSharedStateMapImplActorState { + #line 3597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +public: + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + UpdateClusterSharedStateMapImplActorState(MultiVersionApi* const& self,ClusterConnectionRecord const& connectionRecord,ProtocolVersion const& dbProtocolVersion,Reference const& db) + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + : self(self), + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + connectionRecord(connectionRecord), + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + dbProtocolVersion(dbProtocolVersion), + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + db(db), + #line 3366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + clusterId(connectionRecord.toString()) + #line 3612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + { + fdb_probe_actor_create("updateClusterSharedStateMapImpl", reinterpret_cast(this)); + + } + ~UpdateClusterSharedStateMapImplActorState() + { + fdb_probe_actor_destroy("updateClusterSharedStateMapImpl", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 3367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (CLIENT_KNOBS->CLIENT_ENABLE_USING_CLUSTER_ID_KEY && dbProtocolVersion.hasClusterIdSpecialKey()) + #line 3627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + { + #line 3368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + tr = db->createTransaction(); + #line 3369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + ; + #line 3633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + else + { + loopDepth = a_body1cont1(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } - throw client_invalid_operation(); + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~UpdateClusterSharedStateMapImplActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 3383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (self->clusterSharedStateMap.find(clusterId) == self->clusterSharedStateMap.end()) + #line 3661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + { + #line 3384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + TraceEvent("CreatingClusterSharedState") .detail("ClusterId", clusterId) .detail("ProtocolVersion", dbProtocolVersion); + #line 3387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + self->clusterSharedStateMap[clusterId] = { db->createSharedState(), dbProtocolVersion }; + #line 3667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + loopDepth = a_body1cont3(loopDepth); + } + else + { + #line 3389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + auto& sharedStateInfo = self->clusterSharedStateMap[clusterId]; + #line 3390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (sharedStateInfo.protocolVersion != dbProtocolVersion) + #line 3676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + { + #line 3393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + TraceEvent(SevError, "ClusterStateProtocolVersionMismatch") .detail("ClusterId", clusterId) .detail("ProtocolVersionExpected", dbProtocolVersion) .detail("ProtocolVersionFound", sharedStateInfo.protocolVersion); + #line 3397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(clusterId); this->~UpdateClusterSharedStateMapImplActorState(); static_cast(this)->destroy(); return 0; } + #line 3682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + new (&static_cast(this)->SAV< std::string >::value()) std::string(std::move(clusterId)); // state_var_RVO + this->~UpdateClusterSharedStateMapImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 3400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + TraceEvent("SettingClusterSharedState") .detail("ClusterId", clusterId) .detail("ProtocolVersion", dbProtocolVersion); + #line 3404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + entry = sharedStateInfo.sharedStateFuture; + #line 3405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + StrictFuture __when_expr_2 = safeThreadFutureToFuture(entry); + #line 3405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 3405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + loopDepth = 0; } - networkStartSetup = true; + return loopDepth; + } + int a_body1cont2(int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - if (externalClients.empty()) { - bypassMultiClientApi = true; // SOMEDAY: we won't be able to set this option once it becomes possible to add - // clients after setupNetwork is called + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 3371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + clusterIdFuture = tr->get("\xff\xff/cluster_id"_sr); + #line 3372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + StrictFuture> __when_expr_0 = safeThreadFutureToFuture(clusterIdFuture); + #line 3372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 3372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 3734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 3378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->onError(e)); + #line 3378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 3378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } - if (!bypassMultiClientApi) { - transportId = (uint64_t(uint32_t(platform::getRandomSeed())) << 32) ^ uint32_t(platform::getRandomSeed()); - if (transportId <= 1) - transportId += 2; - localClient->api->setNetworkOption(FDBNetworkOptions::EXTERNAL_CLIENT_TRANSPORT_ID, - std::to_string(transportId)); - } - localClient->api->setupNetwork(); + return loopDepth; } + int a_body1loopBody1cont2(Optional const& clusterIdVal,int loopDepth) + { + #line 3373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + ASSERT(clusterIdVal.present()); + #line 3374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + clusterId = clusterIdVal.get().toString(); + #line 3375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + ASSERT(UID::fromString(clusterId).isValid()); + #line 3795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break - localClient->loadVersion(); - - if (!bypassMultiClientApi) { - runOnExternalClientsAllThreads([this](Reference client) { - TraceEvent("InitializingExternalClient").detail("LibraryPath", client->libPath); - client->api->selectApiVersion(apiVersion); - client->loadVersion(); - }); - - MutexHolder holder(lock); - runOnExternalClientsAllThreads([this, transportId](Reference client) { - for (auto option : options) { - client->api->setNetworkOption(option.first, option.second.castTo()); - } - client->api->setNetworkOption(FDBNetworkOptions::EXTERNAL_CLIENT_TRANSPORT_ID, std::to_string(transportId)); - - client->api->setupNetwork(); - }); - - networkSetup = true; // Needs to be guarded by mutex - } else { - networkSetup = true; + return loopDepth; } + int a_body1loopBody1cont2(Optional && clusterIdVal,int loopDepth) + { + #line 3373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + ASSERT(clusterIdVal.present()); + #line 3374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + clusterId = clusterIdVal.get().toString(); + #line 3375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + ASSERT(UID::fromString(clusterId).isValid()); + #line 3808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break - options.clear(); - updateSupportedVersions(); -} - -THREAD_FUNC_RETURN runNetworkThread(void* param) { - try { - ((ClientInfo*)param)->api->runNetwork(); - } catch (Error& e) { - TraceEvent(SevError, "ExternalRunNetworkError").error(e); - } catch (std::exception& e) { - TraceEvent(SevError, "ExternalRunNetworkError").error(unknown_error()).detail("RootException", e.what()); - } catch (...) { - TraceEvent(SevError, "ExternalRunNetworkError").error(unknown_error()); + return loopDepth; } + int a_body1loopBody1when1(Optional const& clusterIdVal,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(clusterIdVal, loopDepth); - TraceEvent("ExternalNetworkThreadTerminating"); - THREAD_RETURN; -} + return loopDepth; + } + int a_body1loopBody1when1(Optional && clusterIdVal,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(clusterIdVal), loopDepth); -void MultiVersionApi::runNetwork() { - lock.enter(); - if (!networkSetup) { - lock.leave(); - throw network_not_setup(); + return loopDepth; } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< UpdateClusterSharedStateMapImplActor, 0, Optional >::remove(); - lock.leave(); + } + void a_callback_fire(ActorCallback< UpdateClusterSharedStateMapImplActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("updateClusterSharedStateMapImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateClusterSharedStateMapImpl", reinterpret_cast(this), 0); - std::vector handles; - if (!bypassMultiClientApi) { - for (int threadNum = 0; threadNum < threadCount; threadNum++) { - runOnExternalClients(threadNum, [&handles, threadNum](Reference client) { - if (client->external) { - std::string threadName = format("fdb-%s-%d", client->releaseVersion.c_str(), threadNum); - if (threadName.size() > 15) { - threadName = format("fdb-%s", client->releaseVersion.c_str()); - if (threadName.size() > 15) { - threadName = "fdb-external"; - } - } - handles.push_back( - g_network->startThread(&runNetworkThread, client.getPtr(), 0, threadName.c_str())); - } - }); + } + void a_callback_fire(ActorCallback< UpdateClusterSharedStateMapImplActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("updateClusterSharedStateMapImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateClusterSharedStateMapImpl", reinterpret_cast(this), 0); + } + void a_callback_error(ActorCallback< UpdateClusterSharedStateMapImplActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("updateClusterSharedStateMapImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateClusterSharedStateMapImpl", reinterpret_cast(this), 0); - localClient->api->runNetwork(); + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); - for (auto h : handles) { - waitThread(h); + return loopDepth; } -} + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); -void MultiVersionApi::stopNetwork() { - lock.enter(); - if (!networkSetup) { - lock.leave(); - throw network_not_setup(); + return loopDepth; } - lock.leave(); + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); - TraceEvent("MultiVersionStopNetwork"); - localClient->api->stopNetwork(); + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); - if (!bypassMultiClientApi) { - runOnExternalClientsAllThreads([](Reference client) { client->api->stopNetwork(); }, true); + return loopDepth; } -} + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< UpdateClusterSharedStateMapImplActor, 1, Void >::remove(); -void MultiVersionApi::addNetworkThreadCompletionHook(void (*hook)(void*), void* hookParameter) { - lock.enter(); - if (!networkSetup) { - lock.leave(); - throw network_not_setup(); } - lock.leave(); + void a_callback_fire(ActorCallback< UpdateClusterSharedStateMapImplActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("updateClusterSharedStateMapImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateClusterSharedStateMapImpl", reinterpret_cast(this), 1); - localClient->api->addNetworkThreadCompletionHook(hook, hookParameter); + } + void a_callback_fire(ActorCallback< UpdateClusterSharedStateMapImplActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("updateClusterSharedStateMapImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateClusterSharedStateMapImpl", reinterpret_cast(this), 1); - if (!bypassMultiClientApi) { - runOnExternalClientsAllThreads([hook, hookParameter](Reference client) { - client->api->addNetworkThreadCompletionHook(hook, hookParameter); - }); } -} + void a_callback_error(ActorCallback< UpdateClusterSharedStateMapImplActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("updateClusterSharedStateMapImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateClusterSharedStateMapImpl", reinterpret_cast(this), 1); -// Creates an IDatabase object that represents a connection to the cluster -Reference MultiVersionApi::createDatabase(const char* clusterFilePath) { - lock.enter(); - if (!networkSetup) { - lock.leave(); - throw network_not_setup(); } - std::string clusterFile(clusterFilePath); + int a_body1cont3(int loopDepth) + { + #line 3409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(clusterId); this->~UpdateClusterSharedStateMapImplActorState(); static_cast(this)->destroy(); return 0; } + #line 3955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + new (&static_cast(this)->SAV< std::string >::value()) std::string(std::move(clusterId)); // state_var_RVO + this->~UpdateClusterSharedStateMapImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; - if (localClientDisabled) { - ASSERT(!bypassMultiClientApi); + return loopDepth; + } + int a_body1cont5(DatabaseSharedState* const& sharedState,int loopDepth) + { + #line 3406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + db->setSharedState(sharedState); + #line 3967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + loopDepth = a_body1cont3(loopDepth); - int threadIdx = nextThread; - nextThread = (nextThread + 1) % threadCount; - lock.leave(); + return loopDepth; + } + int a_body1cont5(DatabaseSharedState* && sharedState,int loopDepth) + { + #line 3406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + db->setSharedState(sharedState); + #line 3976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + loopDepth = a_body1cont3(loopDepth); - Reference localDb = localClient->api->createDatabase(clusterFilePath); - return Reference( - new MultiVersionDatabase(this, threadIdx, clusterFile, Reference(), localDb)); + return loopDepth; } + int a_body1cont1when1(DatabaseSharedState* const& sharedState,int loopDepth) + { + loopDepth = a_body1cont5(sharedState, loopDepth); - lock.leave(); + return loopDepth; + } + int a_body1cont1when1(DatabaseSharedState* && sharedState,int loopDepth) + { + loopDepth = a_body1cont5(std::move(sharedState), loopDepth); - ASSERT_LE(threadCount, 1); + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< UpdateClusterSharedStateMapImplActor, 2, DatabaseSharedState* >::remove(); - Reference localDb = localClient->api->createDatabase(clusterFilePath); - if (bypassMultiClientApi) { - return localDb; - } else { - return Reference(new MultiVersionDatabase(this, 0, clusterFile, Reference(), localDb)); } -} + void a_callback_fire(ActorCallback< UpdateClusterSharedStateMapImplActor, 2, DatabaseSharedState* >*,DatabaseSharedState* const& value) + { + fdb_probe_actor_enter("updateClusterSharedStateMapImpl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateClusterSharedStateMapImpl", reinterpret_cast(this), 2); -void MultiVersionApi::updateSupportedVersions() { - if (networkSetup) { - Standalone> versionStr; + } + void a_callback_fire(ActorCallback< UpdateClusterSharedStateMapImplActor, 2, DatabaseSharedState* >*,DatabaseSharedState* && value) + { + fdb_probe_actor_enter("updateClusterSharedStateMapImpl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateClusterSharedStateMapImpl", reinterpret_cast(this), 2); - // not mutating the client, so just call on one instance of each client version. - // thread 0 always exists. - runOnExternalClients(0, [&versionStr](Reference client) { - const char* ver = client->api->getClientVersion(); - versionStr.append(versionStr.arena(), (uint8_t*)ver, (int)strlen(ver)); - versionStr.append(versionStr.arena(), (uint8_t*)";", 1); - }); + } + void a_callback_error(ActorCallback< UpdateClusterSharedStateMapImplActor, 2, DatabaseSharedState* >*,Error err) + { + fdb_probe_actor_enter("updateClusterSharedStateMapImpl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateClusterSharedStateMapImpl", reinterpret_cast(this), 2); + + } + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + MultiVersionApi* self; + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + ClusterConnectionRecord connectionRecord; + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + ProtocolVersion dbProtocolVersion; + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + Reference db; + #line 3366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + std::string clusterId; + #line 3368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + Reference tr; + #line 3371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + ThreadFuture> clusterIdFuture; + #line 3404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + ThreadFuture entry; + #line 4060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +}; +// This generated class is to be used only via updateClusterSharedStateMapImpl() + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +class UpdateClusterSharedStateMapImplActor final : public Actor, public ActorCallback< UpdateClusterSharedStateMapImplActor, 0, Optional >, public ActorCallback< UpdateClusterSharedStateMapImplActor, 1, Void >, public ActorCallback< UpdateClusterSharedStateMapImplActor, 2, DatabaseSharedState* >, public FastAllocated, public UpdateClusterSharedStateMapImplActorState { + #line 4065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< UpdateClusterSharedStateMapImplActor, 0, Optional >; +friend struct ActorCallback< UpdateClusterSharedStateMapImplActor, 1, Void >; +friend struct ActorCallback< UpdateClusterSharedStateMapImplActor, 2, DatabaseSharedState* >; + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + UpdateClusterSharedStateMapImplActor(MultiVersionApi* const& self,ClusterConnectionRecord const& connectionRecord,ProtocolVersion const& dbProtocolVersion,Reference const& db) + #line 4078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + : Actor(), + UpdateClusterSharedStateMapImplActorState(self, connectionRecord, dbProtocolVersion, db) + { + fdb_probe_actor_enter("updateClusterSharedStateMapImpl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("updateClusterSharedStateMapImpl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("updateClusterSharedStateMapImpl", reinterpret_cast(this), -1); - if (!localClient->failed) { - const char* local = localClient->api->getClientVersion(); - versionStr.append(versionStr.arena(), (uint8_t*)local, (int)strlen(local)); - } else { - versionStr.resize(versionStr.arena(), std::max(0, versionStr.size() - 1)); + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< UpdateClusterSharedStateMapImplActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< UpdateClusterSharedStateMapImplActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< UpdateClusterSharedStateMapImplActor, 2, DatabaseSharedState* >*)0, actor_cancelled()); break; } - setNetworkOption(FDBNetworkOptions::SUPPORTED_CLIENT_VERSIONS, - StringRef(versionStr.begin(), versionStr.size())); } +}; +} + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +[[nodiscard]] Future updateClusterSharedStateMapImpl( MultiVersionApi* const& self, ClusterConnectionRecord const& connectionRecord, ProtocolVersion const& dbProtocolVersion, Reference const& db ) { + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + return Future(new UpdateClusterSharedStateMapImplActor(self, connectionRecord, dbProtocolVersion, db)); + #line 4108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" } -ThreadFuture MultiVersionApi::updateClusterSharedStateMap(std::string clusterFilePath, Reference db) { - MutexHolder holder(lock); - if (clusterSharedStateMap.find(clusterFilePath) == clusterSharedStateMap.end()) { - clusterSharedStateMap[clusterFilePath] = db->createSharedState(); - } else { - ThreadFuture entry = clusterSharedStateMap[clusterFilePath]; - return mapThreadFuture(entry, [db](ErrorOr result) { - if (result.isError()) { - return ErrorOr(result.getError()); - } - auto ssPtr = result.get(); - db->setSharedState(ssPtr); - return ErrorOr(Void()); - }); - } - return Void(); +#line 3411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + +// Must be called from the main thread +Future MultiVersionApi::updateClusterSharedStateMap(ClusterConnectionRecord const& connectionRecord, + ProtocolVersion dbProtocolVersion, + Reference db) { + return updateClusterSharedStateMapImpl(this, connectionRecord, dbProtocolVersion, db); } -void MultiVersionApi::clearClusterSharedStateMapEntry(std::string clusterFilePath) { - MutexHolder holder(lock); - auto mapEntry = clusterSharedStateMap.find(clusterFilePath); +// Must be called from the main thread +void MultiVersionApi::clearClusterSharedStateMapEntry(std::string clusterId, ProtocolVersion dbProtocolVersion) { + auto mapEntry = clusterSharedStateMap.find(clusterId); + // It can be that other database instances on the same cluster are already upgraded and thus + // have cleared or even created a new shared object entry if (mapEntry == clusterSharedStateMap.end()) { - TraceEvent(SevError, "ClusterSharedStateMapEntryNotFound").detail("ClusterFilePath", clusterFilePath); + TraceEvent("ClusterSharedStateMapEntryNotFound").detail("ClusterId", clusterId); + return; + } + auto sharedStateInfo = mapEntry->second; + if (sharedStateInfo.protocolVersion != dbProtocolVersion) { + TraceEvent("ClusterSharedStateClearSkipped") + .detail("ClusterId", clusterId) + .detail("ProtocolVersionExpected", dbProtocolVersion) + .detail("ProtocolVersionFound", sharedStateInfo.protocolVersion); return; } - auto ssPtr = mapEntry->second.get(); + auto ssPtr = sharedStateInfo.sharedStateFuture.get(); ssPtr->delRef(ssPtr); clusterSharedStateMap.erase(mapEntry); + TraceEvent("ClusterSharedStateCleared").detail("ClusterId", clusterId).detail("ProtocolVersion", dbProtocolVersion); } std::vector parseOptionValues(std::string valueStr) { @@ -2649,9 +4179,9 @@ std::vector parseOptionValues(std::string valueStr) { return values; } -// This function sets all environment variable options which have not been set previously by a call to this function. -// If an option has multiple values and setting one of those values failed with an error, then only those options -// which were not successfully set will be set on subsequent calls. +// This function sets all environment variable options which have not been set previously by a call to this +// function. If an option has multiple values and setting one of those values failed with an error, then only those +// options which were not successfully set will be set on subsequent calls. void MultiVersionApi::loadEnvironmentVariableNetworkOptions() { if (envOptionsLoaded) { return; @@ -2709,8 +4239,9 @@ void MultiVersionApi::loadEnvironmentVariableNetworkOptions() { MultiVersionApi::MultiVersionApi() : callbackOnMainThread(true), localClientDisabled(false), networkStartSetup(false), networkSetup(false), - bypassMultiClientApi(false), externalClient(false), retainClientLibCopies(false), apiVersion(0), threadCount(0), - envOptionsLoaded(false) {} + disableBypass(false), bypassMultiClientApi(false), externalClient(false), ignoreExternalClientFailures(false), + failIncompatibleClient(false), retainClientLibCopies(false), apiVersion(0), threadCount(0), tmpDir("/tmp"), + traceShareBaseNameAmongThreads(false), envOptionsLoaded(false) {} MultiVersionApi* MultiVersionApi::api = new MultiVersionApi(); @@ -2747,73 +4278,79 @@ bool ClientInfo::canReplace(Reference other) const { return !protocolVersion.isCompatible(other->protocolVersion); } +std::string ClientInfo::getTraceFileIdentifier(const std::string& baseIdentifier) { + std::string versionStr = releaseVersion; + std::replace(versionStr.begin(), versionStr.end(), '.', '_'); + return format("%s_v%st%d", baseIdentifier.c_str(), versionStr.c_str(), threadIndex); +} + // UNIT TESTS - #line 2751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase2555() - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -template - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -class FlowTestCase2555ActorState { - #line 2758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +// This generated class is to be used only via flowTestCase3587() + #line 3587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +template + #line 3587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +class FlowTestCase3587ActorState { + #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" public: - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - FlowTestCase2555ActorState(UnitTestParameters const& params) - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + FlowTestCase3587ActorState(UnitTestParameters const& params) + #line 3587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" : params(params) - #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase2555", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase3587", reinterpret_cast(this)); } - ~FlowTestCase2555ActorState() + ~FlowTestCase3587ActorState() { - fdb_probe_actor_destroy("flowTestCase2555", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase3587", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 2556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" auto vals = parseOptionValues("a"); - #line 2557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT(vals.size() == 1 && vals[0] == "a"); - #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" vals = parseOptionValues("abcde"); - #line 2560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT(vals.size() == 1 && vals[0] == "abcde"); - #line 2562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" vals = parseOptionValues(""); - #line 2563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT(vals.size() == 1 && vals[0] == ""); - #line 2565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" vals = parseOptionValues("a:b:c:d:e"); - #line 2566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT(vals.size() == 5 && vals[0] == "a" && vals[1] == "b" && vals[2] == "c" && vals[3] == "d" && vals[4] == "e"); - #line 2568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" vals = parseOptionValues("\\\\a\\::\\:b:\\\\"); - #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT(vals.size() == 3 && vals[0] == "\\a:" && vals[1] == ":b" && vals[2] == "\\"); - #line 2571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" vals = parseOptionValues("abcd:"); - #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT(vals.size() == 2 && vals[0] == "abcd" && vals[1] == ""); - #line 2574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" vals = parseOptionValues(":abcd"); - #line 2575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT(vals.size() == 2 && vals[0] == "" && vals[1] == "abcd"); - #line 2577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" vals = parseOptionValues(":"); - #line 2578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT(vals.size() == 2 && vals[0] == "" && vals[1] == ""); - #line 2810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" try { - #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" vals = parseOptionValues("\\x"); - #line 2582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT(false); - #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); } catch (Error& error) { @@ -2832,20 +4369,20 @@ class FlowTestCase2555ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase2555ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase3587ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 2587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase2555ActorState(); static_cast(this)->destroy(); return 0; } - #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase2555ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 3619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase3587ActorState(); static_cast(this)->destroy(); return 0; } + #line 4382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase3587ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -2853,9 +4390,9 @@ class FlowTestCase2555ActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT_EQ(e.code(), error_code_invalid_option_value); - #line 2858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); } catch (Error& error) { @@ -2879,34 +4416,34 @@ class FlowTestCase2555ActorState { return loopDepth; } - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" UnitTestParameters params; - #line 2884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase2555() - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -class FlowTestCase2555Actor final : public Actor, public FastAllocated, public FlowTestCase2555ActorState { - #line 2889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +// This generated class is to be used only via flowTestCase3587() + #line 3587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +class FlowTestCase3587Actor final : public Actor, public FastAllocated, public FlowTestCase3587ActorState { + #line 4426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - FlowTestCase2555Actor(UnitTestParameters const& params) - #line 2899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 3587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + FlowTestCase3587Actor(UnitTestParameters const& params) + #line 4436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" : Actor(), - FlowTestCase2555ActorState(params) + FlowTestCase3587ActorState(params) { - fdb_probe_actor_enter("flowTestCase2555", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase3587", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase2555"); + this->lineage.setActorName("flowTestCase3587"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase2555", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase3587", reinterpret_cast(this), -1); } void cancel() override @@ -2919,15 +4456,15 @@ class FlowTestCase2555Actor final : public Actor, public FastAllocated flowTestCase2555( UnitTestParameters const& params ) { - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - return Future(new FlowTestCase2555Actor(params)); - #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 3587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +static Future flowTestCase3587( UnitTestParameters const& params ) { + #line 3587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + return Future(new FlowTestCase3587Actor(params)); + #line 4463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase2555, "/fdbclient/multiversionclient/EnvironmentVariableParsing") +ACTOR_TEST_CASE(flowTestCase3587, "/fdbclient/multiversionclient/EnvironmentVariableParsing") -#line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +#line 3621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" class ValidateFuture final : public ThreadCallback { public: @@ -3055,27 +4592,27 @@ THREAD_FUNC cancel(void* arg) { THREAD_RETURN; } - #line 3058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" namespace { // This generated class is to be used only via checkUndestroyedFutures() - #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" template - #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" class CheckUndestroyedFuturesActorState { - #line 3065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" public: - #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" CheckUndestroyedFuturesActorState(std::vector*> const& undestroyed) - #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" : undestroyed(undestroyed), - #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" fNum(), - #line 2718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" f(), - #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" start(now()) - #line 3078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" { fdb_probe_actor_create("checkUndestroyedFutures", reinterpret_cast(this)); @@ -3088,9 +4625,9 @@ class CheckUndestroyedFuturesActorState { int a_body1(int loopDepth=0) { try { - #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" fNum = 0; - #line 3093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -3111,16 +4648,16 @@ class CheckUndestroyedFuturesActorState { } int a_body1cont1(int loopDepth) { - #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" StrictFuture __when_expr_1 = delay(1.0); - #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3134,17 +4671,17 @@ class CheckUndestroyedFuturesActorState { } int a_body1loopBody1(int loopDepth) { - #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" if (!(fNum < undestroyed.size())) - #line 3139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 2722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" f = undestroyed[fNum]; - #line 2724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ; - #line 3147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = a_body1loopBody1loopHead1(loopDepth); return loopDepth; @@ -3164,11 +4701,11 @@ class CheckUndestroyedFuturesActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 2728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT(f->isReady()); - #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ++fNum; - #line 3171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -3182,22 +4719,22 @@ class CheckUndestroyedFuturesActorState { } int a_body1loopBody1loopBody1(int loopDepth) { - #line 2724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" if (!(!f->isReady() && start + 5 >= now())) - #line 3187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" { return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 2725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" StrictFuture __when_expr_0 = delay(1.0); - #line 2725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 3195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3292,21 +4829,21 @@ class CheckUndestroyedFuturesActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 2733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" for(fNum = 0;fNum < undestroyed.size();++fNum) { - #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" f = undestroyed[fNum]; - #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT_EQ(f->debugGetReferenceCount(), 1); - #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT(f->isReady()); - #line 2739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" f->cancel(); - #line 3305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" } - #line 2742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckUndestroyedFuturesActorState(); static_cast(this)->destroy(); return 0; } - #line 3309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CheckUndestroyedFuturesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3316,21 +4853,21 @@ class CheckUndestroyedFuturesActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 2733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" for(fNum = 0;fNum < undestroyed.size();++fNum) { - #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" f = undestroyed[fNum]; - #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT_EQ(f->debugGetReferenceCount(), 1); - #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ASSERT(f->isReady()); - #line 2739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" f->cancel(); - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" } - #line 2742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckUndestroyedFuturesActorState(); static_cast(this)->destroy(); return 0; } - #line 3333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CheckUndestroyedFuturesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3401,20 +4938,20 @@ class CheckUndestroyedFuturesActorState { fdb_probe_actor_exit("checkUndestroyedFutures", reinterpret_cast(this), 1); } - #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" std::vector*> undestroyed; - #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" int fNum; - #line 2718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ThreadSingleAssignmentVar* f; - #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" double start; - #line 3412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" }; // This generated class is to be used only via checkUndestroyedFutures() - #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" class CheckUndestroyedFuturesActor final : public Actor, public ActorCallback< CheckUndestroyedFuturesActor, 0, Void >, public ActorCallback< CheckUndestroyedFuturesActor, 1, Void >, public FastAllocated, public CheckUndestroyedFuturesActorState { - #line 3417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3424,9 +4961,9 @@ class CheckUndestroyedFuturesActor final : public Actor, public ActorCallb #pragma clang diagnostic pop friend struct ActorCallback< CheckUndestroyedFuturesActor, 0, Void >; friend struct ActorCallback< CheckUndestroyedFuturesActor, 1, Void >; - #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" CheckUndestroyedFuturesActor(std::vector*> const& undestroyed) - #line 3429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" : Actor(), CheckUndestroyedFuturesActorState(undestroyed) { @@ -3451,14 +4988,14 @@ friend struct ActorCallback< CheckUndestroyedFuturesActor, 1, Void >; } }; } - #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" [[nodiscard]] Future checkUndestroyedFutures( std::vector*> const& undestroyed ) { - #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" return Future(new CheckUndestroyedFuturesActor(undestroyed)); - #line 3458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" } -#line 2744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +#line 3776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" // Common code for tests of single assignment vars. Tests both correctness and thread safety. // T should be a class that has a static method with the following signature: @@ -3470,6 +5007,11 @@ template THREAD_FUNC runSingleAssignmentVarTest(void* arg) { noUnseed = true; +// This test intentionally leaks memory +#ifdef ADDRESS_SANITIZER + __lsan::ScopedDisabler disableLeakChecks; +#endif + volatile bool* done = (volatile bool*)arg; try { for (int i = 0; i < 25; ++i) { @@ -3549,40 +5091,40 @@ struct AbortableTest { } }; - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase2834() - #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -template - #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -class FlowTestCase2834ActorState { - #line 3559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +// This generated class is to be used only via flowTestCase3871() + #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +template + #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +class FlowTestCase3871ActorState { + #line 5101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" public: - #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - FlowTestCase2834ActorState(UnitTestParameters const& params) - #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + FlowTestCase3871ActorState(UnitTestParameters const& params) + #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" : params(params), - #line 2835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" done(false), - #line 2836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" thread(g_network->startThread(runSingleAssignmentVarTest, (void*)&done)) - #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase2834", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase3871", reinterpret_cast(this)); } - ~FlowTestCase2834ActorState() + ~FlowTestCase3871ActorState() { - fdb_probe_actor_destroy("flowTestCase2834", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase3871", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 2838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ; - #line 3585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -3595,22 +5137,22 @@ class FlowTestCase2834ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase2834ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase3871ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 2842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" waitThread(thread); - #line 2844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase2834ActorState(); static_cast(this)->destroy(); return 0; } - #line 3610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase2834ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 3881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase3871ActorState(); static_cast(this)->destroy(); return 0; } + #line 5152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase3871ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -3624,22 +5166,22 @@ class FlowTestCase2834ActorState { } int a_body1loopBody1(int loopDepth) { - #line 2838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" if (!(!done)) - #line 3629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 2839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" StrictFuture __when_expr_0 = delay(1.0); - #line 2839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 3876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 5179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 2839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 3876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3683,13 +5225,13 @@ class FlowTestCase2834ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase2834Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase3871Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase2834Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase3871Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase2834", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase3871", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -3699,12 +5241,12 @@ class FlowTestCase2834ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2834", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase3871", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase2834Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase3871Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase2834", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase3871", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -3714,12 +5256,12 @@ class FlowTestCase2834ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2834", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase3871", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase2834Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase3871Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase2834", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase3871", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -3729,42 +5271,42 @@ class FlowTestCase2834ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2834", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase3871", reinterpret_cast(this), 0); } - #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" UnitTestParameters params; - #line 2835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" volatile bool done; - #line 2836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" THREAD_HANDLE thread; - #line 3741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase2834() - #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -class FlowTestCase2834Actor final : public Actor, public ActorCallback< FlowTestCase2834Actor, 0, Void >, public FastAllocated, public FlowTestCase2834ActorState { - #line 3746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +// This generated class is to be used only via flowTestCase3871() + #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +class FlowTestCase3871Actor final : public Actor, public ActorCallback< FlowTestCase3871Actor, 0, Void >, public FastAllocated, public FlowTestCase3871ActorState { + #line 5288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase2834Actor, 0, Void >; - #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - FlowTestCase2834Actor(UnitTestParameters const& params) - #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +friend struct ActorCallback< FlowTestCase3871Actor, 0, Void >; + #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + FlowTestCase3871Actor(UnitTestParameters const& params) + #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" : Actor(), - FlowTestCase2834ActorState(params) + FlowTestCase3871ActorState(params) { - fdb_probe_actor_enter("flowTestCase2834", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase3871", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase2834"); + this->lineage.setActorName("flowTestCase3871"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase2834", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase3871", reinterpret_cast(this), -1); } void cancel() override @@ -3772,21 +5314,21 @@ friend struct ActorCallback< FlowTestCase2834Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase2834Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase3871Actor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -static Future flowTestCase2834( UnitTestParameters const& params ) { - #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - return Future(new FlowTestCase2834Actor(params)); - #line 3785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +static Future flowTestCase3871( UnitTestParameters const& params ) { + #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + return Future(new FlowTestCase3871Actor(params)); + #line 5327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase2834, "/fdbclient/multiversionclient/AbortableSingleAssignmentVar") +ACTOR_TEST_CASE(flowTestCase3871, "fdbclient/multiversionclient/AbortableSingleAssignmentVar") -#line 2846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +#line 3883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" class CAPICallback final : public ThreadCallback { public: @@ -3852,42 +5394,42 @@ struct DLTest { } }; - #line 3855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase2911() - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -template - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -class FlowTestCase2911ActorState { - #line 3862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +// This generated class is to be used only via flowTestCase3948() + #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +template + #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +class FlowTestCase3948ActorState { + #line 5404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" public: - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - FlowTestCase2911ActorState(UnitTestParameters const& params) - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + FlowTestCase3948ActorState(UnitTestParameters const& params) + #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" : params(params), - #line 2912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" done(false) - #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase2911", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase3948", reinterpret_cast(this)); } - ~FlowTestCase2911ActorState() + ~FlowTestCase3948ActorState() { - fdb_probe_actor_destroy("flowTestCase2911", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase3948", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 2914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" MultiVersionApi::api->callbackOnMainThread = true; - #line 2915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" thread = g_network->startThread(runSingleAssignmentVarTest, (void*)&done); - #line 2917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ; - #line 3890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -3900,25 +5442,25 @@ class FlowTestCase2911ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase2911ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase3948ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 2921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" waitThread(thread); - #line 2923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" done = false; - #line 2924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" MultiVersionApi::api->callbackOnMainThread = false; - #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" thread = g_network->startThread(runSingleAssignmentVarTest, (void*)&done); - #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ; - #line 3921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -3932,22 +5474,22 @@ class FlowTestCase2911ActorState { } int a_body1loopBody1(int loopDepth) { - #line 2917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" if (!(!done)) - #line 3937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" StrictFuture __when_expr_0 = delay(1.0); - #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 3955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 5487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 3955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3991,13 +5533,13 @@ class FlowTestCase2911ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase2911Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase3948Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase2911Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase3948Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase2911", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase3948", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -4007,12 +5549,12 @@ class FlowTestCase2911ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2911", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase3948", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase2911Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase3948Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase2911", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase3948", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -4022,12 +5564,12 @@ class FlowTestCase2911ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2911", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase3948", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase2911Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase3948Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase2911", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase3948", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -4037,19 +5579,19 @@ class FlowTestCase2911ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2911", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase3948", reinterpret_cast(this), 0); } int a_body1cont2(int loopDepth) { - #line 2931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" waitThread(thread); - #line 2933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase2911ActorState(); static_cast(this)->destroy(); return 0; } - #line 4049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase2911ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 3970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase3948ActorState(); static_cast(this)->destroy(); return 0; } + #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase3948ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -4063,22 +5605,22 @@ class FlowTestCase2911ActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" if (!(!done)) - #line 4068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" StrictFuture __when_expr_1 = delay(1.0); - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 3965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 3965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4122,13 +5664,13 @@ class FlowTestCase2911ActorState { } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase2911Actor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase3948Actor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase2911Actor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase3948Actor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase2911", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase3948", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1loopBody1when1(value, 0); @@ -4138,12 +5680,12 @@ class FlowTestCase2911ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2911", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase3948", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< FlowTestCase2911Actor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase3948Actor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase2911", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase3948", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1loopBody1when1(std::move(value), 0); @@ -4153,12 +5695,12 @@ class FlowTestCase2911ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2911", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase3948", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< FlowTestCase2911Actor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase3948Actor, 1, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase2911", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase3948", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -4168,43 +5710,43 @@ class FlowTestCase2911ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2911", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase3948", reinterpret_cast(this), 1); } - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" UnitTestParameters params; - #line 2912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" volatile bool done; - #line 2915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" THREAD_HANDLE thread; - #line 4180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase2911() - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -class FlowTestCase2911Actor final : public Actor, public ActorCallback< FlowTestCase2911Actor, 0, Void >, public ActorCallback< FlowTestCase2911Actor, 1, Void >, public FastAllocated, public FlowTestCase2911ActorState { - #line 4185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +// This generated class is to be used only via flowTestCase3948() + #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +class FlowTestCase3948Actor final : public Actor, public ActorCallback< FlowTestCase3948Actor, 0, Void >, public ActorCallback< FlowTestCase3948Actor, 1, Void >, public FastAllocated, public FlowTestCase3948ActorState { + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase2911Actor, 0, Void >; -friend struct ActorCallback< FlowTestCase2911Actor, 1, Void >; - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - FlowTestCase2911Actor(UnitTestParameters const& params) - #line 4197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +friend struct ActorCallback< FlowTestCase3948Actor, 0, Void >; +friend struct ActorCallback< FlowTestCase3948Actor, 1, Void >; + #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + FlowTestCase3948Actor(UnitTestParameters const& params) + #line 5739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" : Actor(), - FlowTestCase2911ActorState(params) + FlowTestCase3948ActorState(params) { - fdb_probe_actor_enter("flowTestCase2911", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase3948", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase2911"); + this->lineage.setActorName("flowTestCase3948"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase2911", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase3948", reinterpret_cast(this), -1); } void cancel() override @@ -4212,22 +5754,22 @@ friend struct ActorCallback< FlowTestCase2911Actor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase2911Actor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< FlowTestCase2911Actor, 1, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase3948Actor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase3948Actor, 1, Void >*)0, actor_cancelled()); break; } } }; } - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -static Future flowTestCase2911( UnitTestParameters const& params ) { - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - return Future(new FlowTestCase2911Actor(params)); - #line 4226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +static Future flowTestCase3948( UnitTestParameters const& params ) { + #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + return Future(new FlowTestCase3948Actor(params)); + #line 5768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase2911, "/fdbclient/multiversionclient/DLSingleAssignmentVar") +ACTOR_TEST_CASE(flowTestCase3948, "fdbclient/multiversionclient/DLSingleAssignmentVar") -#line 2935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +#line 3972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" struct MapTest { static FutureInfo createThreadFuture(FutureInfo f) { @@ -4248,40 +5790,40 @@ struct MapTest { } }; - #line 4251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase2955() - #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -template - #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -class FlowTestCase2955ActorState { - #line 4258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +// This generated class is to be used only via flowTestCase3992() + #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +template + #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +class FlowTestCase3992ActorState { + #line 5800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" public: - #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - FlowTestCase2955ActorState(UnitTestParameters const& params) - #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + FlowTestCase3992ActorState(UnitTestParameters const& params) + #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" : params(params), - #line 2956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" done(false), - #line 2957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" thread(g_network->startThread(runSingleAssignmentVarTest, (void*)&done)) - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase2955", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase3992", reinterpret_cast(this)); } - ~FlowTestCase2955ActorState() + ~FlowTestCase3992ActorState() { - fdb_probe_actor_destroy("flowTestCase2955", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase3992", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 2959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ; - #line 4284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -4294,22 +5836,22 @@ class FlowTestCase2955ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase2955ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase3992ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 2963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 4000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" waitThread(thread); - #line 2965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase2955ActorState(); static_cast(this)->destroy(); return 0; } - #line 4309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase2955ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase3992ActorState(); static_cast(this)->destroy(); return 0; } + #line 5851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase3992ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -4323,22 +5865,22 @@ class FlowTestCase2955ActorState { } int a_body1loopBody1(int loopDepth) { - #line 2959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" if (!(!done)) - #line 4328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 2960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" StrictFuture __when_expr_0 = delay(1.0); - #line 2960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 3997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 2960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 3997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4382,13 +5924,13 @@ class FlowTestCase2955ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase2955Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase3992Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase2955Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase3992Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase2955", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase3992", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -4398,12 +5940,12 @@ class FlowTestCase2955ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2955", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase3992", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase2955Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase3992Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase2955", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase3992", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -4413,12 +5955,12 @@ class FlowTestCase2955ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2955", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase3992", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase2955Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase3992Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase2955", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase3992", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -4428,42 +5970,42 @@ class FlowTestCase2955ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2955", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase3992", reinterpret_cast(this), 0); } - #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" UnitTestParameters params; - #line 2956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" volatile bool done; - #line 2957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 3994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" THREAD_HANDLE thread; - #line 4440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 5982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase2955() - #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -class FlowTestCase2955Actor final : public Actor, public ActorCallback< FlowTestCase2955Actor, 0, Void >, public FastAllocated, public FlowTestCase2955ActorState { - #line 4445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +// This generated class is to be used only via flowTestCase3992() + #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +class FlowTestCase3992Actor final : public Actor, public ActorCallback< FlowTestCase3992Actor, 0, Void >, public FastAllocated, public FlowTestCase3992ActorState { + #line 5987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase2955Actor, 0, Void >; - #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - FlowTestCase2955Actor(UnitTestParameters const& params) - #line 4456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +friend struct ActorCallback< FlowTestCase3992Actor, 0, Void >; + #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + FlowTestCase3992Actor(UnitTestParameters const& params) + #line 5998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" : Actor(), - FlowTestCase2955ActorState(params) + FlowTestCase3992ActorState(params) { - fdb_probe_actor_enter("flowTestCase2955", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase3992", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase2955"); + this->lineage.setActorName("flowTestCase3992"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase2955", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase3992", reinterpret_cast(this), -1); } void cancel() override @@ -4471,21 +6013,21 @@ friend struct ActorCallback< FlowTestCase2955Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase2955Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase3992Actor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -static Future flowTestCase2955( UnitTestParameters const& params ) { - #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - return Future(new FlowTestCase2955Actor(params)); - #line 4484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +static Future flowTestCase3992( UnitTestParameters const& params ) { + #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + return Future(new FlowTestCase3992Actor(params)); + #line 6026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase2955, "/fdbclient/multiversionclient/MapSingleAssignmentVar") +ACTOR_TEST_CASE(flowTestCase3992, "fdbclient/multiversionclient/MapSingleAssignmentVar") -#line 2967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +#line 4004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" struct FlatMapTest { static FutureInfo createThreadFuture(FutureInfo f) { @@ -4513,40 +6055,40 @@ struct FlatMapTest { } }; - #line 4516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 6058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase2994() - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -template - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -class FlowTestCase2994ActorState { - #line 4523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +// This generated class is to be used only via flowTestCase4031() + #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +template + #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +class FlowTestCase4031ActorState { + #line 6065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" public: - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - FlowTestCase2994ActorState(UnitTestParameters const& params) - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + FlowTestCase4031ActorState(UnitTestParameters const& params) + #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" : params(params), - #line 2995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 4032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" done(false), - #line 2996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 4033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" thread(g_network->startThread(runSingleAssignmentVarTest, (void*)&done)) - #line 4534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 6076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase2994", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase4031", reinterpret_cast(this)); } - ~FlowTestCase2994ActorState() + ~FlowTestCase4031ActorState() { - fdb_probe_actor_destroy("flowTestCase2994", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase4031", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 2998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 4035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" ; - #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 6091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -4559,22 +6101,22 @@ class FlowTestCase2994ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase2994ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase4031ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 3002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 4039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" waitThread(thread); - #line 3004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase2994ActorState(); static_cast(this)->destroy(); return 0; } - #line 4574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase2994ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 4041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase4031ActorState(); static_cast(this)->destroy(); return 0; } + #line 6116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase4031ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -4588,22 +6130,22 @@ class FlowTestCase2994ActorState { } int a_body1loopBody1(int loopDepth) { - #line 2998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 4035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" if (!(!done)) - #line 4593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 6135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 2999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 4036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" StrictFuture __when_expr_0 = delay(1.0); - #line 2999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 6143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 2999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 4036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4647,13 +6189,13 @@ class FlowTestCase2994ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase2994Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase4031Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase2994Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase4031Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase2994", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase4031", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -4663,12 +6205,12 @@ class FlowTestCase2994ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2994", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase4031", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase2994Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase4031Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase2994", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase4031", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -4678,12 +6220,12 @@ class FlowTestCase2994ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2994", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase4031", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase2994Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase4031Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase2994", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase4031", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -4693,42 +6235,42 @@ class FlowTestCase2994ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase2994", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase4031", reinterpret_cast(this), 0); } - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" UnitTestParameters params; - #line 2995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 4032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" volatile bool done; - #line 2996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + #line 4033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" THREAD_HANDLE thread; - #line 4705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 6247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase2994() - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -class FlowTestCase2994Actor final : public Actor, public ActorCallback< FlowTestCase2994Actor, 0, Void >, public FastAllocated, public FlowTestCase2994ActorState { - #line 4710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +// This generated class is to be used only via flowTestCase4031() + #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +class FlowTestCase4031Actor final : public Actor, public ActorCallback< FlowTestCase4031Actor, 0, Void >, public FastAllocated, public FlowTestCase4031ActorState { + #line 6252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase2994Actor, 0, Void >; - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - FlowTestCase2994Actor(UnitTestParameters const& params) - #line 4721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" +friend struct ActorCallback< FlowTestCase4031Actor, 0, Void >; + #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + FlowTestCase4031Actor(UnitTestParameters const& params) + #line 6263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" : Actor(), - FlowTestCase2994ActorState(params) + FlowTestCase4031ActorState(params) { - fdb_probe_actor_enter("flowTestCase2994", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase4031", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase2994"); + this->lineage.setActorName("flowTestCase4031"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase2994", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase4031", reinterpret_cast(this), -1); } void cancel() override @@ -4736,18 +6278,18 @@ friend struct ActorCallback< FlowTestCase2994Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase2994Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase4031Actor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" -static Future flowTestCase2994( UnitTestParameters const& params ) { - #line 2994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" - return Future(new FlowTestCase2994Actor(params)); - #line 4749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" + #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +static Future flowTestCase4031( UnitTestParameters const& params ) { + #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" + return Future(new FlowTestCase4031Actor(params)); + #line 6291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase2994, "/fdbclient/multiversionclient/FlatMapSingleAssignmentVar") +ACTOR_TEST_CASE(flowTestCase4031, "fdbclient/multiversionclient/FlatMapSingleAssignmentVar") -#line 3006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" +#line 4043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MultiVersionTransaction.actor.cpp" diff --git a/src/fdbclient/MutationLogReader.actor.cpp b/src/fdbclient/MutationLogReader.actor.cpp index 5919fdc..3cbcce5 100644 --- a/src/fdbclient/MutationLogReader.actor.cpp +++ b/src/fdbclient/MutationLogReader.actor.cpp @@ -67,7 +67,7 @@ ACTOR Future PipelinedReader::getNext_impl(PipelinedReader* self, Database state Transaction tr(cx); state GetRangeLimits limits(GetRangeLimits::ROW_LIMIT_UNLIMITED, - (g_network->isSimulated() && !g_simulator.speedUpSimulation) + (g_network->isSimulated() && !g_simulator->speedUpSimulation) ? CLIENT_KNOBS->BACKUP_SIMULATED_LIMIT_BYTES : CLIENT_KNOBS->BACKUP_GET_RANGE_LIMIT_BYTES); @@ -103,7 +103,7 @@ ACTOR Future PipelinedReader::getNext_impl(PipelinedReader* self, Database return Void(); } - begin = kvs.readThrough.present() ? kvs.readThrough.get() : keyAfter(kvs.back().key); + begin = kvs.getReadThrough(); break; } catch (Error& e) { @@ -179,7 +179,7 @@ ACTOR Future> MutationLogReader::getNext_impl(Mutatio namespace { // UNIT TESTS TEST_CASE("/fdbclient/mutationlogreader/VersionKeyRefConversion") { - Key prefix = LiteralStringRef("foos"); + Key prefix = "foos"_sr; ASSERT(keyRefToVersion(versionToKey(0, prefix), prefix.size()) == 0); ASSERT(keyRefToVersion(versionToKey(1, prefix), prefix.size()) == 1); diff --git a/src/fdbclient/MutationLogReader.actor.g.cpp b/src/fdbclient/MutationLogReader.actor.g.cpp index 37b065c..f558b68 100644 --- a/src/fdbclient/MutationLogReader.actor.g.cpp +++ b/src/fdbclient/MutationLogReader.actor.g.cpp @@ -83,7 +83,7 @@ class PipelinedReader_GetNext_implActorState { #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.cpp" tr(cx), #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.cpp" - limits(GetRangeLimits::ROW_LIMIT_UNLIMITED, (g_network->isSimulated() && !g_simulator.speedUpSimulation) ? CLIENT_KNOBS->BACKUP_SIMULATED_LIMIT_BYTES : CLIENT_KNOBS->BACKUP_GET_RANGE_LIMIT_BYTES), + limits(GetRangeLimits::ROW_LIMIT_UNLIMITED, (g_network->isSimulated() && !g_simulator->speedUpSimulation) ? CLIENT_KNOBS->BACKUP_SIMULATED_LIMIT_BYTES : CLIENT_KNOBS->BACKUP_GET_RANGE_LIMIT_BYTES), #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.cpp" begin(versionToKey(self->currentBeginVersion, self->prefix)), #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.cpp" @@ -345,7 +345,7 @@ class PipelinedReader_GetNext_implActorState { return 0; } #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.cpp" - begin = kvs.readThrough.present() ? kvs.readThrough.get() : keyAfter(kvs.back().key); + begin = kvs.getReadThrough(); #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.cpp" return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break @@ -376,7 +376,7 @@ class PipelinedReader_GetNext_implActorState { return 0; } #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.cpp" - begin = kvs.readThrough.present() ? kvs.readThrough.get() : keyAfter(kvs.back().key); + begin = kvs.getReadThrough(); #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.cpp" return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break @@ -1366,7 +1366,7 @@ class FlowTestCase181ActorState { { try { #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.cpp" - Key prefix = LiteralStringRef("foos"); + Key prefix = "foos"_sr; #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.cpp" ASSERT(keyRefToVersion(versionToKey(0, prefix), prefix.size()) == 0); #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.cpp" diff --git a/src/fdbclient/NativeAPI.actor.cpp b/src/fdbclient/NativeAPI.actor.cpp index b89b55f..da7e2da 100644 --- a/src/fdbclient/NativeAPI.actor.cpp +++ b/src/fdbclient/NativeAPI.actor.cpp @@ -21,35 +21,44 @@ #include "fdbclient/NativeAPI.actor.h" #include +#include #include +#include #include #include +#include #include #include #include #include #include "boost/algorithm/string.hpp" + +#include "fdbclient/Knobs.h" +#include "flow/CodeProbe.h" #include "fmt/format.h" #include "fdbclient/FDBOptions.g.h" #include "fdbclient/FDBTypes.h" #include "fdbrpc/FailureMonitor.h" #include "fdbrpc/MultiInterface.h" +#include "fdbrpc/TenantInfo.h" #include "fdbclient/ActorLineageProfiler.h" #include "fdbclient/AnnotateActor.h" #include "fdbclient/Atomic.h" #include "fdbclient/BlobGranuleCommon.h" +#include "fdbclient/BlobGranuleRequest.actor.h" #include "fdbclient/ClusterInterface.h" #include "fdbclient/ClusterConnectionFile.h" +#include "fdbclient/ClusterConnectionMemoryRecord.h" #include "fdbclient/CoordinationInterface.h" +#include "fdbclient/CommitTransaction.h" #include "fdbclient/DatabaseContext.h" #include "fdbclient/GlobalConfig.actor.h" #include "fdbclient/IKnobCollection.h" -#include "fdbclient/Knobs.h" #include "fdbclient/JsonBuilder.h" -#include "fdbclient/KeyBackedTypes.h" +#include "fdbclient/KeyBackedTypes.actor.h" #include "fdbclient/KeyRangeMap.h" #include "fdbclient/ManagementAPI.actor.h" #include "fdbclient/NameLineage.h" @@ -61,9 +70,11 @@ #include "fdbclient/SpecialKeySpace.actor.h" #include "fdbclient/StorageServerInterface.h" #include "fdbclient/SystemData.h" +#include "fdbclient/Tenant.h" +#include "fdbclient/TenantSpecialKeys.actor.h" #include "fdbclient/TransactionLineage.h" #include "fdbclient/versions.h" -#include "fdbclient/WellKnownEndpoints.h" +#include "fdbrpc/WellKnownEndpoints.h" #include "fdbrpc/LoadBalance.h" #include "fdbrpc/Net2FileSystem.h" #include "fdbrpc/simulator.h" @@ -82,7 +93,7 @@ #include "flow/Platform.h" #include "flow/SystemMonitor.h" #include "flow/TLSConfig.actor.h" -#include "flow/Tracing.h" +#include "fdbclient/Tracing.h" #include "flow/UnitTest.h" #include "flow/network.h" #include "flow/serialize.h" @@ -101,6 +112,9 @@ #endif #include "flow/actorcompiler.h" // This must be the last #include. +template class RequestStream; +template struct NetNotifiedQueue; + extern const char* getSourceVersion(); namespace { @@ -108,11 +122,11 @@ namespace { TransactionLineageCollector transactionLineageCollector; NameLineageCollector nameLineageCollector; -template +template Future loadBalance( DatabaseContext* ctx, const Reference alternatives, - RequestStream Interface::*channel, + RequestStream Interface::*channel, const Request& request = Request(), TaskPriority taskID = TaskPriority::DefaultPromiseEndpoint, AtMostOnce atMostOnce = @@ -133,26 +147,25 @@ Future loadBalance( } // namespace FDB_BOOLEAN_PARAM(TransactionRecordLogInfo); -FDB_DEFINE_BOOLEAN_PARAM(UseProvisionalProxies); - -// Used to determine whether or not client will load balance based on the number of GRVs released by each proxy -FDB_DEFINE_BOOLEAN_PARAM(BalanceOnRequests); // Whether or not a request should include the tenant name FDB_BOOLEAN_PARAM(UseTenant); +// Whether a blob granule request is a request for the mapping to read, or a request to get granule boundaries +FDB_BOOLEAN_PARAM(JustGranules); + NetworkOptions networkOptions; TLSConfig tlsConfig(TLSEndpointType::CLIENT); // The default values, TRACE_DEFAULT_ROLL_SIZE and TRACE_DEFAULT_MAX_LOGS_SIZE are located in Trace.h. NetworkOptions::NetworkOptions() : traceRollSize(TRACE_DEFAULT_ROLL_SIZE), traceMaxLogsSize(TRACE_DEFAULT_MAX_LOGS_SIZE), traceLogGroup("default"), - traceFormat("xml"), traceClockSource("now"), + traceFormat("xml"), traceClockSource("now"), traceInitializeOnSetup(false), supportedVersions(new ReferencedObject>>()), runLoopProfilingEnabled(false), primaryClient(true) {} -static const Key CLIENT_LATENCY_INFO_PREFIX = LiteralStringRef("client_latency/"); -static const Key CLIENT_LATENCY_INFO_CTR_PREFIX = LiteralStringRef("client_latency_counter/"); +static const Key CLIENT_LATENCY_INFO_PREFIX = "client_latency/"_sr; +static const Key CLIENT_LATENCY_INFO_CTR_PREFIX = "client_latency_counter/"_sr; void DatabaseContext::addTssMapping(StorageServerInterface const& ssi, StorageServerInterface const& tssi) { auto result = tssMapping.find(ssi.id()); @@ -166,14 +179,8 @@ void DatabaseContext::addTssMapping(StorageServerInterface const& ssi, StorageSe tssMetrics[tssi.id()] = metrics; tssMapping[ssi.id()] = tssi; } else { - if (result->second.id() == tssi.id()) { - metrics = tssMetrics[tssi.id()]; - } else { - TEST(true); // SS now maps to new TSS! This will probably never happen in practice - tssMetrics.erase(result->second.id()); - metrics = makeReference(); - tssMetrics[tssi.id()] = metrics; - } + ASSERT(result->second.id() == tssi.id()); + metrics = tssMetrics[tssi.id()]; result->second = tssi; } @@ -188,6 +195,8 @@ void DatabaseContext::addTssMapping(StorageServerInterface const& ssi, StorageSe TSSEndpointData(tssi.id(), tssi.getMappedKeyValues.getEndpoint(), metrics)); queueModel.updateTssEndpoint(ssi.getKeyValuesStream.getEndpoint().token.first(), TSSEndpointData(tssi.id(), tssi.getKeyValuesStream.getEndpoint(), metrics)); + queueModel.updateTssEndpoint(ssi.changeFeedStream.getEndpoint().token.first(), + TSSEndpointData(tssi.id(), tssi.changeFeedStream.getEndpoint(), metrics)); // non-data requests duplicated for load queueModel.updateTssEndpoint(ssi.watchValue.getEndpoint().token.first(), @@ -198,6 +207,12 @@ void DatabaseContext::addTssMapping(StorageServerInterface const& ssi, StorageSe TSSEndpointData(tssi.id(), tssi.getReadHotRanges.getEndpoint(), metrics)); queueModel.updateTssEndpoint(ssi.getRangeSplitPoints.getEndpoint().token.first(), TSSEndpointData(tssi.id(), tssi.getRangeSplitPoints.getEndpoint(), metrics)); + queueModel.updateTssEndpoint(ssi.overlappingChangeFeeds.getEndpoint().token.first(), + TSSEndpointData(tssi.id(), tssi.overlappingChangeFeeds.getEndpoint(), metrics)); + + // duplicated to ensure feed data cleanup + queueModel.updateTssEndpoint(ssi.changeFeedPop.getEndpoint().token.first(), + TSSEndpointData(tssi.id(), tssi.changeFeedPop.getEndpoint(), metrics)); } } @@ -270,13 +285,13 @@ void DatabaseContext::getLatestCommitVersion(const StorageServerInterface& ssi, } void DatabaseContext::getLatestCommitVersions(const Reference& locationInfo, - Version readVersion, Reference info, VersionVector& latestCommitVersions) { latestCommitVersions.clear(); - if (info->debugID.present()) { - g_traceBatch.addEvent("TransactionDebug", info->debugID.get().first(), "NativeAPI.getLatestCommitVersions"); + if (info->readOptions.present() && info->readOptions.get().debugID.present()) { + g_traceBatch.addEvent( + "TransactionDebug", info->readOptions.get().debugID.get().first(), "NativeAPI.getLatestCommitVersions"); } if (!info->readVersionObtainedFromGrvProxy) { @@ -287,12 +302,12 @@ void DatabaseContext::getLatestCommitVersions(const Reference& loc return; } - if (readVersion > ssVersionVectorCache.getMaxVersion()) { + if (info->readVersion() > ssVersionVectorCache.getMaxVersion()) { if (!CLIENT_KNOBS->FORCE_GRV_CACHE_OFF && !info->options.skipGrvCache && info->options.useGrvCache) { return; } else { TraceEvent(SevError, "GetLatestCommitVersions") - .detail("ReadVersion", readVersion) + .detail("ReadVersion", info->readVersion()) .detail("VersionVector", ssVersionVectorCache.toString()); ASSERT(false); } @@ -305,7 +320,7 @@ void DatabaseContext::getLatestCommitVersions(const Reference& loc getLatestCommitVersionForSSID(locationInfo->locations()->getId(i), tag, commitVersion); bool updatedVersionMap = false; - if (tag != invalidTag && commitVersion != invalidVersion && commitVersion < readVersion) { + if (tag != invalidTag && commitVersion != invalidVersion && commitVersion < info->readVersion()) { updatedVersionMap = true; versionMap[commitVersion].insert(tag); } @@ -316,7 +331,7 @@ void DatabaseContext::getLatestCommitVersions(const Reference& loc .detail("InSSIDMap", tag != invalidTag ? 1 : 0) .detail("Tag", tag) .detail("CommitVersion", commitVersion) - .detail("ReadVersion", readVersion) + .detail("ReadVersion", info->readVersion()) .detail("VersionVector", ssVersionVectorCache.toString()) .setMaxEventLength(11000) .setMaxFieldLength(10000); @@ -501,7 +516,7 @@ void DatabaseContext::validateVersion(Version version) const { throw client_invalid_operation(); } if (switchable && version < minAcceptableReadVersion) { - TEST(true); // Attempted to read a version lower than any this client has seen from the current cluster + CODE_PROBE(true, "Attempted to read a version lower than any this client has seen from the current cluster"); throw transaction_too_old(); } @@ -565,7 +580,7 @@ void traceTSSErrors(const char* name, UID tssId, const std::unordered_map& sample) { +void traceSSOrTSSPercentiles(TraceEvent& ev, const std::string name, DDSketch& sample) { ev.detail(name + "Mean", sample.mean()); // don't log the larger percentiles unless we actually have enough samples to log the accurate percentile instead of // the largest sample in this window @@ -582,8 +597,8 @@ void traceSSOrTSSPercentiles(TraceEvent& ev, const std::string name, ContinuousS void traceTSSPercentiles(TraceEvent& ev, const std::string name, - ContinuousSample& ssSample, - ContinuousSample& tssSample) { + DDSketch& ssSample, + DDSketch& tssSample) { ASSERT(ssSample.getPopulationSize() == tssSample.getPopulationSize()); ev.detail(name + "Count", ssSample.getPopulationSize()); if (ssSample.getPopulationSize() > 0) { @@ -641,7 +656,8 @@ ACTOR Future databaseLogger(DatabaseContext* cx) { loop { wait(delay(CLIENT_KNOBS->SYSTEM_MONITOR_INTERVAL, TaskPriority::FlushTrace)); - if (!g_network->isSimulated()) { + bool logTraces = !g_network->isSimulated() || BUGGIFY_WITH_PROB(0.01); + if (logTraces) { TraceEvent ev("TransactionMetrics", cx->dbId); ev.detail("Elapsed", (lastLogged == 0) ? 0 : now() - lastLogged) @@ -675,14 +691,41 @@ ACTOR Future databaseLogger(DatabaseContext* cx) { .detail("MedianBytesPerCommit", cx->bytesPerCommit.median()) .detail("MaxBytesPerCommit", cx->bytesPerCommit.max()) .detail("NumLocalityCacheEntries", cx->locationCache.size()); - if (cx->anyBlobGranuleRequests) { - ev.detail("MeanBGLatency", cx->bgLatencies.mean()) - .detail("MedianBGLatency", cx->bgLatencies.median()) - .detail("MaxBGLatency", cx->bgLatencies.max()) - .detail("MeanBGGranulesPerRequest", cx->bgGranulesPerRequest.mean()) - .detail("MedianBGGranulesPerRequest", cx->bgGranulesPerRequest.median()) - .detail("MaxBGGranulesPerRequest", cx->bgGranulesPerRequest.max()); - } + } + + if (cx->usedAnyChangeFeeds && logTraces) { + TraceEvent feedEv("ChangeFeedClientMetrics", cx->dbId); + + feedEv.detail("Elapsed", (lastLogged == 0) ? 0 : now() - lastLogged) + .detail("Cluster", + cx->getConnectionRecord() + ? cx->getConnectionRecord()->getConnectionString().clusterKeyName().toString() + : "") + .detail("Internal", cx->internal); + + cx->ccFeed.logToTraceEvent(feedEv); + } + + if (cx->anyBGReads && logTraces) { + TraceEvent bgReadEv("BlobGranuleReadMetrics", cx->dbId); + + bgReadEv.detail("Elapsed", (lastLogged == 0) ? 0 : now() - lastLogged) + .detail("Cluster", + cx->getConnectionRecord() + ? cx->getConnectionRecord()->getConnectionString().clusterKeyName().toString() + : "") + .detail("Internal", cx->internal); + + // add counters + cx->ccBG.logToTraceEvent(bgReadEv); + + // add latencies + bgReadEv.detail("MeanBGLatency", cx->bgLatencies.mean()) + .detail("MedianBGLatency", cx->bgLatencies.median()) + .detail("MaxBGLatency", cx->bgLatencies.max()) + .detail("MeanBGGranulesPerRequest", cx->bgGranulesPerRequest.mean()) + .detail("MedianBGGranulesPerRequest", cx->bgGranulesPerRequest.median()) + .detail("MaxBGGranulesPerRequest", cx->bgGranulesPerRequest.max()); } cx->latencies.clear(); @@ -767,6 +810,7 @@ ACTOR static Future delExcessClntTxnEntriesActor(Transaction* tr, int64_t tr->clear(KeyRangeRef(txEntries[0].key, strinc(endKey))); TraceEvent(SevInfo, "DeletingExcessCntTxnEntries").detail("BytesToBeDeleted", numBytesToDel); int64_t bytesDel = -numBytesToDel; + tr->atomicOp(clientLatencyAtomicCtr, StringRef((uint8_t*)&bytesDel, 8), MutationRef::AddValue); wait(tr->commit()); } @@ -916,7 +960,9 @@ ACTOR Future assertFailure(GrvProxyInterface remote, Future attemptGRVFromOldProxies(std::vector oldProxies, std::vector newProxies) { - Span span(deterministicRandom()->randomUniqueID(), "VerifyCausalReadRisky"_loc); + auto debugID = nondeterministicRandom()->randomUniqueID(); + g_traceBatch.addEvent("AttemptGRVFromOldProxyDebug", debugID.first(), "NativeAPI.attemptGRVFromOldProxies.Start"); + Span span("NAPI:VerifyCausalReadRisky"_loc); std::vector> replies; replies.reserve(oldProxies.size()); GetReadVersionRequest req( @@ -1098,6 +1144,7 @@ ACTOR Future monitorCacheList(DatabaseContext* self) { state Transaction tr; state std::map cacheServerMap; state Future updateRanges = updateCachedRanges(self, &cacheServerMap); + state Backoff backoff; // if no caches are configured, we don't want to run this actor at all // so we just wait for the first trigger from a storage server wait(self->updateCache.onTrigger()); @@ -1135,8 +1182,10 @@ ACTOR Future monitorCacheList(DatabaseContext* self) { } cacheServerMap = std::move(allCacheServers); wait(delay(5.0)); + backoff = Backoff(); } catch (Error& e) { wait(tr.onError(e)); + wait(backoff.onError()); } } } catch (Error& e) { @@ -1168,8 +1217,8 @@ ACTOR static Future handleTssMismatches(DatabaseContext* cx) { state bool quarantine = CLIENT_KNOBS->QUARANTINE_TSS_ON_MISMATCH; TraceEvent(SevWarnAlways, quarantine ? "TSS_QuarantineMismatch" : "TSS_KillMismatch") .detail("TSSID", data.first.toString()); - TEST(quarantine); // Quarantining TSS because it got mismatch - TEST(!quarantine); // Killing TSS because it got mismatch + CODE_PROBE(quarantine, "Quarantining TSS because it got mismatch"); + CODE_PROBE(!quarantine, "Killing TSS because it got mismatch"); tr = makeReference(Database(Reference::addRef(cx))); state int tries = 0; @@ -1178,7 +1227,7 @@ ACTOR static Future handleTssMismatches(DatabaseContext* cx) { tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); if (quarantine) { - tr->set(tssQuarantineKeyFor(data.first), LiteralStringRef("")); + tr->set(tssQuarantineKeyFor(data.first), ""_sr); } else { tr->clear(serverTagKeyFor(data.first)); } @@ -1186,10 +1235,9 @@ ACTOR static Future handleTssMismatches(DatabaseContext* cx) { for (const DetailedTSSMismatch& d : data.second) { // -> mismatch data - tssMismatchDB.set( - tr, - Tuple().append(data.first.toString()).append(d.timestamp).append(d.mismatchId.toString()), - d.traceString); + tssMismatchDB.set(tr, + Tuple::makeTuple(data.first.toString(), d.timestamp, d.mismatchId.toString()), + d.traceString); } wait(tr->commit()); @@ -1208,7 +1256,7 @@ ACTOR static Future handleTssMismatches(DatabaseContext* cx) { // clear out txn so that the extra DatabaseContext ref gets decref'd and we can free cx tr = makeReference(); } else { - TEST(true); // Not handling TSS with mismatch because it's already gone + CODE_PROBE(true, "Not handling TSS with mismatch because it's already gone"); } } } @@ -1216,6 +1264,7 @@ ACTOR static Future handleTssMismatches(DatabaseContext* cx) { ACTOR static Future backgroundGrvUpdater(DatabaseContext* cx) { state Transaction tr; state double grvDelay = 0.001; + state Backoff backoff; try { loop { if (CLIENT_KNOBS->FORCE_GRV_CACHE_OFF) @@ -1243,9 +1292,11 @@ ACTOR static Future backgroundGrvUpdater(DatabaseContext* cx) { .detail("GrvDelay", grvDelay) .detail("CachedReadVersion", cx->getCachedReadVersion()) .detail("CachedTime", cx->getLastGrvTime()); + backoff = Backoff(); } catch (Error& e) { TraceEvent(SevInfo, "BackgroundGrvUpdaterTxnError").errorUnsuppressed(e); wait(tr.onError(e)); + wait(backoff.onError()); } } else { wait( @@ -1260,18 +1311,7 @@ ACTOR static Future backgroundGrvUpdater(DatabaseContext* cx) { } } -ACTOR static Future getHealthMetricsActor(DatabaseContext* cx, bool detailed) { - if (now() - cx->healthMetricsLastUpdated < CLIENT_KNOBS->AGGREGATE_HEALTH_METRICS_MAX_STALENESS) { - if (detailed) { - return cx->healthMetrics; - } else { - HealthMetrics result; - result.update(cx->healthMetrics, false, false); - return result; - } - } - state bool sendDetailedRequest = - detailed && now() - cx->detailedHealthMetricsLastUpdated > CLIENT_KNOBS->DETAILED_HEALTH_METRICS_MAX_STALENESS; +ACTOR static Future getHealthMetricsActor(DatabaseContext* cx, bool detailed, bool sendDetailedRequest) { loop { choose { when(wait(cx->onProxiesChanged())) {} @@ -1295,44 +1335,46 @@ ACTOR static Future getHealthMetricsActor(DatabaseContext* cx, bo } Future DatabaseContext::getHealthMetrics(bool detailed = false) { - return getHealthMetricsActor(this, detailed); + if (now() - healthMetricsLastUpdated < CLIENT_KNOBS->AGGREGATE_HEALTH_METRICS_MAX_STALENESS) { + if (detailed) { + return healthMetrics; + } else { + HealthMetrics result; + result.update(healthMetrics, false, false); + return result; + } + } + bool sendDetailedRequest = + detailed && now() - detailedHealthMetricsLastUpdated > CLIENT_KNOBS->DETAILED_HEALTH_METRICS_MAX_STALENESS; + return getHealthMetricsActor(this, detailed, sendDetailedRequest); } -void DatabaseContext::registerSpecialKeySpaceModule(SpecialKeySpace::MODULE module, - SpecialKeySpace::IMPLTYPE type, - std::unique_ptr&& impl) { - specialKeySpace->registerKeyRange(module, type, impl->getKeyRange(), impl.get()); - specialKeySpaceModules.push_back(std::move(impl)); -} +Future> DatabaseContext::getStorageStats(const UID& id, double maxStaleness) { + if (now() - detailedHealthMetricsLastUpdated < maxStaleness) { + auto it = healthMetrics.storageStats.find(id); + return it == healthMetrics.storageStats.end() ? Optional() : it->second; + } -ACTOR Future getWorkerInterfaces(Reference clusterRecord); -ACTOR Future> getJSON(Database db); + return map(getHealthMetricsActor(this, true, true), [&id](auto metrics) -> Optional { + auto it = metrics.storageStats.find(id); + return it == metrics.storageStats.end() ? Optional() : it->second; + }); +} -struct WorkerInterfacesSpecialKeyImpl : SpecialKeyRangeReadImpl { - Future getRange(ReadYourWritesTransaction* ryw, - KeyRangeRef kr, - GetRangeLimits limitsHint) const override { - if (ryw->getDatabase().getPtr() && ryw->getDatabase()->getConnectionRecord()) { - Key prefix = Key(getKeyRange().begin); - return map(getWorkerInterfaces(ryw->getDatabase()->getConnectionRecord()), - [prefix = prefix, kr = KeyRange(kr)](const RangeResult& in) { - RangeResult result; - for (const auto& [k_, v] : in) { - auto k = k_.withPrefix(prefix); - if (kr.contains(k)) - result.push_back_deep(result.arena(), KeyValueRef(k, v)); - } - - std::sort(result.begin(), result.end(), KeyValueRef::OrderByKey{}); - return result; - }); - } else { - return RangeResult(); - } +// register a special key(s) implementation under the specified module +void DatabaseContext::registerSpecialKeysImpl(SpecialKeySpace::MODULE module, + SpecialKeySpace::IMPLTYPE type, + std::unique_ptr&& impl, + int deprecatedVersion) { + // if deprecated, add the implementation when the api version is less than the deprecated version + if (deprecatedVersion == -1 || apiVersion.version() < deprecatedVersion) { + specialKeySpace->registerKeyRange(module, type, impl->getKeyRange(), impl.get()); + specialKeySpaceModules.push_back(std::move(impl)); } +} - explicit WorkerInterfacesSpecialKeyImpl(KeyRangeRef kr) : SpecialKeyRangeReadImpl(kr) {} -}; +ACTOR Future getWorkerInterfaces(Reference clusterRecord); +ACTOR Future> getJSON(Database db); struct SingleSpecialKeyImpl : SpecialKeyRangeReadImpl { Future getRange(ReadYourWritesTransaction* ryw, @@ -1348,12 +1390,17 @@ struct SingleSpecialKeyImpl : SpecialKeyRangeReadImpl { }); } - SingleSpecialKeyImpl(KeyRef k, const std::function>(ReadYourWritesTransaction*)>& f) - : SpecialKeyRangeReadImpl(singleKeyRange(k)), k(k), f(f) {} + SingleSpecialKeyImpl(KeyRef k, + const std::function>(ReadYourWritesTransaction*)>& f, + bool supportsTenants = false) + : SpecialKeyRangeReadImpl(singleKeyRange(k)), k(k), f(f), tenantSupport(supportsTenants) {} + + bool supportsTenants() const override { return tenantSupport; }; private: Key k; std::function>(ReadYourWritesTransaction*)> f; + bool tenantSupport; }; class HealthMetricsRangeImpl : public SpecialKeyRangeAsyncImpl { @@ -1368,7 +1415,7 @@ static RangeResult healthMetricsToKVPairs(const HealthMetrics& metrics, KeyRange RangeResult result; if (CLIENT_BUGGIFY) return result; - if (kr.contains(LiteralStringRef("\xff\xff/metrics/health/aggregate")) && metrics.worstStorageDurabilityLag != 0) { + if (kr.contains("\xff\xff/metrics/health/aggregate"_sr) && metrics.worstStorageDurabilityLag != 0) { json_spirit::mObject statsObj; statsObj["batch_limited"] = metrics.batchLimited; statsObj["tps_limit"] = metrics.tpsLimit; @@ -1380,15 +1427,13 @@ static RangeResult healthMetricsToKVPairs(const HealthMetrics& metrics, KeyRange std::string statsString = json_spirit::write_string(json_spirit::mValue(statsObj), json_spirit::Output_options::raw_utf8); ValueRef bytes(result.arena(), statsString); - result.push_back(result.arena(), KeyValueRef(LiteralStringRef("\xff\xff/metrics/health/aggregate"), bytes)); + result.push_back(result.arena(), KeyValueRef("\xff\xff/metrics/health/aggregate"_sr, bytes)); } // tlog stats { int phase = 0; // Avoid comparing twice per loop iteration for (const auto& [uid, logStats] : metrics.tLogQueue) { - StringRef k{ - StringRef(uid.toString()).withPrefix(LiteralStringRef("\xff\xff/metrics/health/log/"), result.arena()) - }; + StringRef k{ StringRef(uid.toString()).withPrefix("\xff\xff/metrics/health/log/"_sr, result.arena()) }; if (phase == 0 && k >= kr.begin) { phase = 1; } @@ -1410,8 +1455,7 @@ static RangeResult healthMetricsToKVPairs(const HealthMetrics& metrics, KeyRange { int phase = 0; // Avoid comparing twice per loop iteration for (const auto& [uid, storageStats] : metrics.storageStats) { - StringRef k{ StringRef(uid.toString()) - .withPrefix(LiteralStringRef("\xff\xff/metrics/health/storage/"), result.arena()) }; + StringRef k{ StringRef(uid.toString()).withPrefix("\xff\xff/metrics/health/storage/"_sr, result.arena()) }; if (phase == 0 && k >= kr.begin) { phase = 1; } @@ -1437,10 +1481,9 @@ static RangeResult healthMetricsToKVPairs(const HealthMetrics& metrics, KeyRange ACTOR static Future healthMetricsGetRangeActor(ReadYourWritesTransaction* ryw, KeyRangeRef kr) { HealthMetrics metrics = wait(ryw->getDatabase()->getHealthMetrics( - /*detailed ("per process")*/ kr.intersects(KeyRangeRef(LiteralStringRef("\xff\xff/metrics/health/storage/"), - LiteralStringRef("\xff\xff/metrics/health/storage0"))) || - kr.intersects(KeyRangeRef(LiteralStringRef("\xff\xff/metrics/health/log/"), - LiteralStringRef("\xff\xff/metrics/health/log0"))))); + /*detailed ("per process")*/ kr.intersects( + KeyRangeRef("\xff\xff/metrics/health/storage/"_sr, "\xff\xff/metrics/health/storage0"_sr)) || + kr.intersects(KeyRangeRef("\xff\xff/metrics/health/log/"_sr, "\xff\xff/metrics/health/log0"_sr)))); return healthMetricsToKVPairs(metrics, kr); } @@ -1452,14 +1495,16 @@ Future HealthMetricsRangeImpl::getRange(ReadYourWritesTransaction* return healthMetricsGetRangeActor(ryw, kr); } -KeyRangeRef toRelativeRange(KeyRangeRef range, KeyRef prefix) { - if (prefix.empty()) { - return range; - } else { - KeyRef begin = range.begin.startsWith(prefix) ? range.begin.removePrefix(prefix) : allKeys.begin; - KeyRef end = range.end.startsWith(prefix) ? range.end.removePrefix(prefix) : allKeys.end; - return KeyRangeRef(begin, end); +ACTOR Future getClusterId(Database db) { + while (!db->clientInfo->get().clusterId.isValid()) { + wait(db->clientInfo->onChange()); } + return db->clientInfo->get().clusterId; +} + +void DatabaseContext::initializeSpecialCounters() { + specialCounter(cc, "OutstandingWatches", [this] { return outstandingWatches; }); + specialCounter(cc, "WatchMapSize", [this] { return watchMap.size(); }); } DatabaseContext::DatabaseContext(Reference>> connectionRecord, @@ -1471,12 +1516,13 @@ DatabaseContext::DatabaseContext(Reference defaultTenant) - : lockAware(lockAware), switchable(switchable), connectionRecord(connectionRecord), proxyProvisional(false), - clientLocality(clientLocality), enableLocalityLoadBalance(enableLocalityLoadBalance), defaultTenant(defaultTenant), - internal(internal), cc("TransactionMetrics"), transactionReadVersions("ReadVersions", cc), + : dbId(deterministicRandom()->randomUniqueID()), lockAware(lockAware), switchable(switchable), + connectionRecord(connectionRecord), proxyProvisional(false), clientLocality(clientLocality), + enableLocalityLoadBalance(enableLocalityLoadBalance), defaultTenant(defaultTenant), internal(internal), + cc("TransactionMetrics", dbId.toString()), transactionReadVersions("ReadVersions", cc), transactionReadVersionsThrottled("ReadVersionsThrottled", cc), transactionReadVersionsCompleted("ReadVersionsCompleted", cc), transactionReadVersionBatches("ReadVersionBatches", cc), @@ -1500,24 +1546,32 @@ DatabaseContext::DatabaseContext(ReferenceSHARD_STAT_SMOOTH_AMOUNT), specialKeySpace(std::make_unique(specialKeys.begin, specialKeys.end, /* test */ false)), connectToDatabaseEventCacheHolder(format("ConnectToDatabase/%s", dbId.toString().c_str())) { - dbId = deterministicRandom()->randomUniqueID(); - TraceEvent("DatabaseContextCreated", dbId).backtrace(); connected = (clientInfo->get().commitProxies.size() && clientInfo->get().grvProxies.size()) @@ -1527,16 +1581,14 @@ DatabaseContext::DatabaseContext(ReferenceMETADATA_VERSION_CACHE_SIZE); maxOutstandingWatches = CLIENT_KNOBS->DEFAULT_MAX_OUTSTANDING_WATCHES; - snapshotRywEnabled = apiVersionAtLeast(300) ? 1 : 0; + snapshotRywEnabled = apiVersion.hasSnapshotRYW() ? 1 : 0; logger = databaseLogger(this) && tssLogger(this); locationCacheSize = g_network->isSimulated() ? CLIENT_KNOBS->LOCATION_CACHE_EVICTION_SIZE_SIM : CLIENT_KNOBS->LOCATION_CACHE_EVICTION_SIZE; - tenantCacheSize = g_network->isSimulated() ? CLIENT_KNOBS->TENANT_CACHE_EVICTION_SIZE_SIM - : CLIENT_KNOBS->TENANT_CACHE_EVICTION_SIZE; - getValueSubmitted.init(LiteralStringRef("NativeAPI.GetValueSubmitted")); - getValueCompleted.init(LiteralStringRef("NativeAPI.GetValueCompleted")); + getValueSubmitted.init("NativeAPI.GetValueSubmitted"_sr); + getValueCompleted.init("NativeAPI.GetValueCompleted"_sr); clientDBInfoMonitor = monitorClientDBInfoChange(this, clientInfo, &proxiesChangeTrigger); tssMismatchHandler = handleTssMismatches(this); @@ -1546,193 +1598,188 @@ DatabaseContext::DatabaseContext(ReferenceINIT_MID_SHARD_BYTES); globalConfig = std::make_unique(this); - if (apiVersionAtLeast(710)) { - registerSpecialKeySpaceModule( - SpecialKeySpace::MODULE::MANAGEMENT, - SpecialKeySpace::IMPLTYPE::READWRITE, - std::make_unique(SpecialKeySpace::getManagementApiCommandRange("tenantmap"))); - } - if (apiVersionAtLeast(700)) { - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::ERRORMSG, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique( - SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::ERRORMSG).begin, - [](ReadYourWritesTransaction* ryw) -> Future> { - if (ryw->getSpecialKeySpaceErrorMsg().present()) - return Optional(ryw->getSpecialKeySpaceErrorMsg().get()); - else - return Optional(); - })); - registerSpecialKeySpaceModule( + if (apiVersion.version() >= 700) { + registerSpecialKeysImpl(SpecialKeySpace::MODULE::ERRORMSG, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique( + SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::ERRORMSG).begin, + [](ReadYourWritesTransaction* ryw) -> Future> { + if (ryw->getSpecialKeySpaceErrorMsg().present()) + return Optional(ryw->getSpecialKeySpaceErrorMsg().get()); + else + return Optional(); + }, + true)); + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - KeyRangeRef(LiteralStringRef("options/"), LiteralStringRef("options0")) + KeyRangeRef("options/"_sr, "options0"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique(SpecialKeySpace::getManagementApiCommandRange("exclude"))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique(SpecialKeySpace::getManagementApiCommandRange("failed"))); - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::MANAGEMENT, - SpecialKeySpace::IMPLTYPE::READWRITE, - std::make_unique( - SpecialKeySpace::getManagementApiCommandRange("excludedlocality"))); - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::MANAGEMENT, - SpecialKeySpace::IMPLTYPE::READWRITE, - std::make_unique( - SpecialKeySpace::getManagementApiCommandRange("failedlocality"))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl(SpecialKeySpace::MODULE::MANAGEMENT, + SpecialKeySpace::IMPLTYPE::READWRITE, + std::make_unique( + SpecialKeySpace::getManagementApiCommandRange("excludedlocality"))); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::MANAGEMENT, + SpecialKeySpace::IMPLTYPE::READWRITE, + std::make_unique( + SpecialKeySpace::getManagementApiCommandRange("failedlocality"))); + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READONLY, std::make_unique( - KeyRangeRef(LiteralStringRef("in_progress_exclusion/"), LiteralStringRef("in_progress_exclusion0")) + KeyRangeRef("in_progress_exclusion/"_sr, "in_progress_exclusion0"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::CONFIGURATION, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - KeyRangeRef(LiteralStringRef("process/class_type/"), LiteralStringRef("process/class_type0")) + KeyRangeRef("process/class_type/"_sr, "process/class_type0"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::CONFIGURATION).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::CONFIGURATION, SpecialKeySpace::IMPLTYPE::READONLY, std::make_unique( - KeyRangeRef(LiteralStringRef("process/class_source/"), LiteralStringRef("process/class_source0")) + KeyRangeRef("process/class_source/"_sr, "process/class_source0"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::CONFIGURATION).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - singleKeyRange(LiteralStringRef("db_locked")) + singleKeyRange("db_locked"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - singleKeyRange(LiteralStringRef("consistency_check_suspended")) + singleKeyRange("consistency_check_suspended"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::GLOBALCONFIG, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::GLOBALCONFIG))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::TRACING, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::TRACING))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::CONFIGURATION, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - KeyRangeRef(LiteralStringRef("coordinators/"), LiteralStringRef("coordinators0")) + KeyRangeRef("coordinators/"_sr, "coordinators0"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::CONFIGURATION).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READONLY, std::make_unique( - singleKeyRange(LiteralStringRef("auto_coordinators")) + singleKeyRange("auto_coordinators"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - singleKeyRange(LiteralStringRef("min_required_commit_version")) + singleKeyRange("min_required_commit_version"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - singleKeyRange(LiteralStringRef("version_epoch")) + singleKeyRange("version_epoch"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - KeyRangeRef(LiteralStringRef("profiling/"), LiteralStringRef("profiling0")) - .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + KeyRangeRef("profiling/"_sr, "profiling0"_sr) + .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin)), + /* deprecated */ ApiVersion::withClientProfilingDeprecated().version()); + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - KeyRangeRef(LiteralStringRef("maintenance/"), LiteralStringRef("maintenance0")) + KeyRangeRef("maintenance/"_sr, "maintenance0"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - KeyRangeRef(LiteralStringRef("data_distribution/"), LiteralStringRef("data_distribution0")) + KeyRangeRef("data_distribution/"_sr, "data_distribution0"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::ACTORLINEAGE, SpecialKeySpace::IMPLTYPE::READONLY, std::make_unique(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::ACTORLINEAGE))); - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::ACTOR_PROFILER_CONF, - SpecialKeySpace::IMPLTYPE::READWRITE, - std::make_unique(SpecialKeySpace::getModuleRange( - SpecialKeySpace::MODULE::ACTOR_PROFILER_CONF))); - } - if (apiVersionAtLeast(630)) { - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::TRANSACTION, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique(conflictingKeysRange)); - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::TRANSACTION, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique(readConflictRangeKeysRange)); - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::TRANSACTION, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique(writeConflictRangeKeysRange)); - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::METRICS, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique(ddStatsRange)); - registerSpecialKeySpaceModule( - SpecialKeySpace::MODULE::METRICS, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique(KeyRangeRef(LiteralStringRef("\xff\xff/metrics/health/"), - LiteralStringRef("\xff\xff/metrics/health0")))); - registerSpecialKeySpaceModule( - SpecialKeySpace::MODULE::WORKERINTERFACE, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique(KeyRangeRef( - LiteralStringRef("\xff\xff/worker_interfaces/"), LiteralStringRef("\xff\xff/worker_interfaces0")))); - registerSpecialKeySpaceModule( - SpecialKeySpace::MODULE::STATUSJSON, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique(LiteralStringRef("\xff\xff/status/json"), - [](ReadYourWritesTransaction* ryw) -> Future> { - if (ryw->getDatabase().getPtr() && - ryw->getDatabase()->getConnectionRecord()) { - ++ryw->getDatabase()->transactionStatusRequests; - return getJSON(ryw->getDatabase()); - } else { - return Optional(); - } - })); - registerSpecialKeySpaceModule( - SpecialKeySpace::MODULE::CLUSTERFILEPATH, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique( - LiteralStringRef("\xff\xff/cluster_file_path"), - [](ReadYourWritesTransaction* ryw) -> Future> { - try { - if (ryw->getDatabase().getPtr() && ryw->getDatabase()->getConnectionRecord()) { - Optional output = - StringRef(ryw->getDatabase()->getConnectionRecord()->getLocation()); - return output; - } - } catch (Error& e) { - return e; - } - return Optional(); - })); - - registerSpecialKeySpaceModule( + registerSpecialKeysImpl(SpecialKeySpace::MODULE::ACTOR_PROFILER_CONF, + SpecialKeySpace::IMPLTYPE::READWRITE, + std::make_unique( + SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::ACTOR_PROFILER_CONF))); + } + if (apiVersion.version() >= 630) { + registerSpecialKeysImpl(SpecialKeySpace::MODULE::TRANSACTION, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique(conflictingKeysRange)); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::TRANSACTION, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique(readConflictRangeKeysRange)); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::TRANSACTION, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique(writeConflictRangeKeysRange)); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::METRICS, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique(ddStatsRange)); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::METRICS, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique( + KeyRangeRef("\xff\xff/metrics/health/"_sr, "\xff\xff/metrics/health0"_sr))); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::WORKERINTERFACE, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique( + KeyRangeRef("\xff\xff/worker_interfaces/"_sr, "\xff\xff/worker_interfaces0"_sr))); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::STATUSJSON, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique( + "\xff\xff/status/json"_sr, + [](ReadYourWritesTransaction* ryw) -> Future> { + if (ryw->getDatabase().getPtr() && ryw->getDatabase()->getConnectionRecord()) { + ++ryw->getDatabase()->transactionStatusRequests; + return getJSON(ryw->getDatabase()); + } else { + return Optional(); + } + }, + true)); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::CLUSTERFILEPATH, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique( + "\xff\xff/cluster_file_path"_sr, + [](ReadYourWritesTransaction* ryw) -> Future> { + try { + if (ryw->getDatabase().getPtr() && + ryw->getDatabase()->getConnectionRecord()) { + Optional output = + StringRef(ryw->getDatabase()->getConnectionRecord()->getLocation()); + return output; + } + } catch (Error& e) { + return e; + } + return Optional(); + }, + true)); + + registerSpecialKeysImpl( SpecialKeySpace::MODULE::CONNECTIONSTRING, SpecialKeySpace::IMPLTYPE::READONLY, std::make_unique( - LiteralStringRef("\xff\xff/connection_string"), + "\xff\xff/connection_string"_sr, [](ReadYourWritesTransaction* ryw) -> Future> { try { if (ryw->getDatabase().getPtr() && ryw->getDatabase()->getConnectionRecord()) { @@ -1744,13 +1791,38 @@ DatabaseContext::DatabaseContext(Reference(); - })); + }, + true)); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::CLUSTERID, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique( + "\xff\xff/cluster_id"_sr, + [](ReadYourWritesTransaction* ryw) -> Future> { + try { + if (ryw->getDatabase().getPtr()) { + return map(getClusterId(ryw->getDatabase()), [](UID id) { + return Optional(StringRef(id.toString())); + }); + } + } catch (Error& e) { + return e; + } + return Optional(); + }, + true)); + + registerSpecialKeysImpl( + SpecialKeySpace::MODULE::MANAGEMENT, + SpecialKeySpace::IMPLTYPE::READWRITE, + std::make_unique(SpecialKeySpace::getManagementApiCommandRange("tenant"))); } throttleExpirer = recurring([this]() { expireThrottles(); }, CLIENT_KNOBS->TAG_THROTTLE_EXPIRATION_INTERVAL); if (BUGGIFY) { DatabaseContext::debugUseTags = true; } + + initializeSpecialCounters(); } DatabaseContext::DatabaseContext(const Error& err) @@ -1778,17 +1850,29 @@ DatabaseContext::DatabaseContext(const Error& err) transactionsCommitStarted("CommitStarted", cc), transactionsCommitCompleted("CommitCompleted", cc), transactionKeyServerLocationRequests("KeyServerLocationRequests", cc), transactionKeyServerLocationRequestsCompleted("KeyServerLocationRequestsCompleted", cc), - transactionStatusRequests("StatusRequests", cc), transactionsTooOld("TooOld", cc), + transactionBlobGranuleLocationRequests("BlobGranuleLocationRequests", cc), + transactionBlobGranuleLocationRequestsCompleted("BlobGranuleLocationRequestsCompleted", cc), + transactionStatusRequests("StatusRequests", cc), transactionTenantLookupRequests("TenantLookupRequests", cc), + transactionTenantLookupRequestsCompleted("TenantLookupRequestsCompleted", cc), transactionsTooOld("TooOld", cc), transactionsFutureVersions("FutureVersions", cc), transactionsNotCommitted("NotCommitted", cc), transactionsMaybeCommitted("MaybeCommitted", cc), transactionsResourceConstrained("ResourceConstrained", cc), transactionsProcessBehind("ProcessBehind", cc), transactionsThrottled("Throttled", cc), transactionsExpensiveClearCostEstCount("ExpensiveClearCostEstCount", cc), transactionGrvFullBatches("NumGrvFullBatches", cc), transactionGrvTimedOutBatches("NumGrvTimedOutBatches", cc), - transactionCommitVersionNotFoundForSS("CommitVersionNotFoundForSS", cc), latencies(1000), readLatencies(1000), - commitLatencies(1000), GRVLatencies(1000), mutationsPerCommit(1000), bytesPerCommit(1000), bgLatencies(1000), - bgGranulesPerRequest(1000), transactionTracingSample(false), + transactionCommitVersionNotFoundForSS("CommitVersionNotFoundForSS", cc), anyBGReads(false), + ccBG("BlobGranuleReadMetrics"), bgReadInputBytes("BGReadInputBytes", ccBG), + bgReadOutputBytes("BGReadOutputBytes", ccBG), bgReadSnapshotRows("BGReadSnapshotRows", ccBG), + bgReadRowsCleared("BGReadRowsCleared", ccBG), bgReadRowsInserted("BGReadRowsInserted", ccBG), + bgReadRowsUpdated("BGReadRowsUpdated", ccBG), bgLatencies(), bgGranulesPerRequest(), usedAnyChangeFeeds(false), + ccFeed("ChangeFeedClientMetrics"), feedStreamStarts("FeedStreamStarts", ccFeed), + feedMergeStreamStarts("FeedMergeStreamStarts", ccFeed), feedErrors("FeedErrors", ccFeed), + feedNonRetriableErrors("FeedNonRetriableErrors", ccFeed), feedPops("FeedPops", ccFeed), + feedPopsFallback("FeedPopsFallback", ccFeed), latencies(), readLatencies(), commitLatencies(), GRVLatencies(), + mutationsPerCommit(), bytesPerCommit(), sharedStatePtr(nullptr), transactionTracingSample(false), smoothMidShardSize(CLIENT_KNOBS->SHARD_STAT_SMOOTH_AMOUNT), - connectToDatabaseEventCacheHolder(format("ConnectToDatabase/%s", dbId.toString().c_str())) {} + connectToDatabaseEventCacheHolder(format("ConnectToDatabase/%s", dbId.toString().c_str())), outstandingWatches(0) { + initializeSpecialCounters(); +} // Static constructor used by server processes to create a DatabaseContext // For internal (fdbserver) use only @@ -1828,55 +1912,47 @@ DatabaseContext::~DatabaseContext() { it->second->notifyContextDestroyed(); ASSERT_ABORT(server_interf.empty()); locationCache.insert(allKeys, Reference()); + for (auto& it : notAtLatestChangeFeeds) { + it.second->context = nullptr; + } + for (auto& it : changeFeedUpdaters) { + it.second->context = nullptr; + } TraceEvent("DatabaseContextDestructed", dbId).backtrace(); } -Optional DatabaseContext::getCachedLocation(const Optional& tenantName, +Optional DatabaseContext::getCachedLocation(const TenantInfo& tenant, const KeyRef& key, Reverse isBackward) { - TenantMapEntry tenantEntry; Arena arena; KeyRef resolvedKey = key; - if (tenantName.present()) { - auto itr = tenantCache.find(tenantName.get()); - if (itr != tenantCache.end()) { - tenantEntry = itr->second; - resolvedKey = resolvedKey.withPrefix(tenantEntry.prefix, arena); - } else { - return Optional(); - } + if (tenant.hasTenant()) { + resolvedKey = resolvedKey.withPrefix(tenant.prefix.get(), arena); } auto range = isBackward ? locationCache.rangeContainingKeyBefore(resolvedKey) : locationCache.rangeContaining(resolvedKey); if (range->value()) { - return KeyRangeLocationInfo(tenantEntry, toRelativeRange(range->range(), tenantEntry.prefix), range->value()); + return KeyRangeLocationInfo(toPrefixRelativeRange(range->range(), tenant.prefix), range->value()); } return Optional(); } -bool DatabaseContext::getCachedLocations(const Optional& tenantName, +bool DatabaseContext::getCachedLocations(const TenantInfo& tenant, const KeyRangeRef& range, std::vector& result, int limit, Reverse reverse) { result.clear(); - TenantMapEntry tenantEntry; Arena arena; KeyRangeRef resolvedRange = range; - if (tenantName.present()) { - auto itr = tenantCache.find(tenantName.get()); - if (itr != tenantCache.end()) { - tenantEntry = itr->second; - resolvedRange = resolvedRange.withPrefix(tenantEntry.prefix, arena); - } else { - return false; - } + if (tenant.hasTenant()) { + resolvedRange = resolvedRange.withPrefix(tenant.prefix.get(), arena); } auto begin = locationCache.rangeContaining(resolvedRange.begin); @@ -1885,11 +1961,11 @@ bool DatabaseContext::getCachedLocations(const Optional& tenantName, loop { auto r = reverse ? end : begin; if (!r->value()) { - TEST(result.size()); // had some but not all cached locations + CODE_PROBE(result.size(), "had some but not all cached locations"); result.clear(); return false; } - result.emplace_back(tenantEntry, toRelativeRange(r->range() & resolvedRange, tenantEntry.prefix), r->value()); + result.emplace_back(toPrefixRelativeRange(r->range() & resolvedRange, tenant.prefix), r->value()); if (result.size() == limit || begin == end) { break; } @@ -1903,26 +1979,8 @@ bool DatabaseContext::getCachedLocations(const Optional& tenantName, return true; } -void DatabaseContext::cacheTenant(const TenantName& tenant, const TenantMapEntry& tenantEntry) { - if (tenantCacheSize > 0) { - // Naive cache eviction just erases the entire cache when it gets full. - // We don't expect a single client to fill the tenant cache typically, so this should work reasonably well. - if (tenantCache.size() > tenantCacheSize) { - tenantCache.clear(); - } - - tenantCache[tenant] = tenantEntry; - } -} - -Reference DatabaseContext::setCachedLocation(const Optional& tenant, - const TenantMapEntry& tenantEntry, - const KeyRangeRef& absoluteKeys, +Reference DatabaseContext::setCachedLocation(const KeyRangeRef& absoluteKeys, const std::vector& servers) { - if (tenant.present()) { - cacheTenant(tenant.get(), tenantEntry); - } - std::vector>> serverRefs; serverRefs.reserve(servers.size()); for (const auto& interf : servers) { @@ -1932,7 +1990,7 @@ Reference DatabaseContext::setCachedLocation(const Optional(serverRefs); while (locationCache.size() > locationCacheSize && attempts < maxEvictionAttempts) { - TEST(true); // NativeAPI storage server locationCache entry evicted + CODE_PROBE(true, "NativeAPI storage server locationCache entry evicted"); attempts++; auto r = locationCache.randomRange(); Key begin = r.begin(), end = r.end(); // insert invalidates r, so can't be passed a mere reference into it @@ -1942,15 +2000,11 @@ Reference DatabaseContext::setCachedLocation(const Optional& tenantPrefix, const KeyRef& key, Reverse isBackward) { Arena arena; KeyRef resolvedKey = key; - if (!tenantPrefix.empty()) { - resolvedKey = resolvedKey.withPrefix(tenantPrefix, arena); + if (tenantPrefix.present() && !tenantPrefix.get().empty()) { + resolvedKey = resolvedKey.withPrefix(tenantPrefix.get(), arena); } if (isBackward) { @@ -1960,11 +2014,11 @@ void DatabaseContext::invalidateCache(const KeyRef& tenantPrefix, const KeyRef& } } -void DatabaseContext::invalidateCache(const KeyRef& tenantPrefix, const KeyRangeRef& keys) { +void DatabaseContext::invalidateCache(const Optional& tenantPrefix, const KeyRangeRef& keys) { Arena arena; KeyRangeRef resolvedKeys = keys; - if (!tenantPrefix.empty()) { - resolvedKeys = resolvedKeys.withPrefix(tenantPrefix, arena); + if (tenantPrefix.present() && !tenantPrefix.get().empty()) { + resolvedKeys = resolvedKeys.withPrefix(tenantPrefix.get(), arena); } auto rs = locationCache.intersectingRanges(resolvedKeys); @@ -2099,25 +2153,25 @@ void DatabaseContext::setOption(FDBDatabaseOptions::Option option, Optional= maxOutstandingWatches) throw too_many_watches(); ++outstandingWatches; } -void DatabaseContext::removeWatch() { +void DatabaseContext::decreaseWatchCounter() { --outstandingWatches; ASSERT(outstandingWatches >= 0); } -Future DatabaseContext::onConnected() { +Future DatabaseContext::onConnected() const { return connected; } ACTOR static Future switchConnectionRecordImpl(Reference connRecord, DatabaseContext* self) { - TEST(true); // Switch connection file + CODE_PROBE(true, "Switch connection file"); TraceEvent("SwitchConnectionRecord") .detail("ClusterFile", connRecord->toString()) .detail("ConnectionString", connRecord->getConnectionString().toString()); @@ -2126,8 +2180,7 @@ ACTOR static Future switchConnectionRecordImpl(ReferencecommitProxies.clear(); self->grvProxies.clear(); self->minAcceptableReadVersion = std::numeric_limits::max(); - self->tenantCache.clear(); - self->invalidateCache(Key(), allKeys); + self->invalidateCache({}, allKeys); self->ssVersionVectorCache.clear(); @@ -2178,7 +2231,7 @@ void DatabaseContext::expireThrottles() { for (auto& priorityItr : throttledTags) { for (auto tagItr = priorityItr.second.begin(); tagItr != priorityItr.second.end();) { if (tagItr->second.expired()) { - TEST(true); // Expiring client throttle + CODE_PROBE(true, "Expiring client throttle"); tagItr = priorityItr.second.erase(tagItr); } else { ++tagItr; @@ -2187,7 +2240,98 @@ void DatabaseContext::expireThrottles() { } } -extern IPAddress determinePublicIPAutomatically(ClusterConnectionString& ccs); +// Initialize tracing for FDB client +// +// connRecord is necessary for determining the local IP, which is then included in the trace +// file name, and also used to annotate all trace events. +// +// If trace_initialize_on_setup is not set, tracing is initialized when opening a database. +// In that case we can immediatelly determine the IP. Thus, we can use the IP in the +// trace file name and annotate all events with it. +// +// If trace_initialize_on_setup network option is set, tracing is at first initialized without +// connRecord and thus without the local IP. In that case we cannot use the local IP in the +// trace file names. The IP is then provided by a repeated call to initializeClientTracing +// when opening a database. All tracing events from this point are annotated with the local IP +// +// If tracing initialization is completed, further calls to initializeClientTracing are ignored +void initializeClientTracing(Reference connRecord, Optional apiVersion) { + if (!networkOptions.traceDirectory.present()) { + return; + } + + bool initialized = traceFileIsOpen(); + if (initialized && (isTraceLocalAddressSet() || !connRecord)) { + // Tracing initialization is completed + return; + } + + // Network must be created before initializing tracing + ASSERT(g_network); + + Optional localAddress; + if (connRecord) { + auto publicIP = connRecord->getConnectionString().determineLocalSourceIP(); + localAddress = NetworkAddress(publicIP, ::getpid()); + } + platform::ImageInfo imageInfo = platform::getImageInfo(); + + if (initialized) { + // Tracing already initialized, just need to update the IP address + setTraceLocalAddress(localAddress.get()); + TraceEvent("ClientStart") + .detail("SourceVersion", getSourceVersion()) + .detail("Version", FDB_VT_VERSION) + .detail("PackageName", FDB_VT_PACKAGE_NAME) + .detailf("ActualTime", "%lld", DEBUG_DETERMINISM ? 0 : time(nullptr)) + .detail("ApiVersion", apiVersion) + .detail("ClientLibrary", imageInfo.fileName) + .detailf("ImageOffset", "%p", imageInfo.offset) + .detail("Primary", networkOptions.primaryClient) + .trackLatest("ClientStart"); + } else { + // Initialize tracing + selectTraceFormatter(networkOptions.traceFormat); + selectTraceClockSource(networkOptions.traceClockSource); + addUniversalTraceField("ClientDescription", + format("%s-%s-%" PRIu64, + networkOptions.primaryClient ? "primary" : "external", + FDB_VT_VERSION, + deterministicRandom()->randomUInt64())); + + std::string identifier = networkOptions.traceFileIdentifier; + openTraceFile(localAddress, + networkOptions.traceRollSize, + networkOptions.traceMaxLogsSize, + networkOptions.traceDirectory.get(), + "trace", + networkOptions.traceLogGroup, + identifier, + networkOptions.tracePartialFileSuffix, + InitializeTraceMetrics::True); + + TraceEvent("ClientStart") + .detail("SourceVersion", getSourceVersion()) + .detail("Version", FDB_VT_VERSION) + .detail("PackageName", FDB_VT_PACKAGE_NAME) + .detailf("ActualTime", "%lld", DEBUG_DETERMINISM ? 0 : time(nullptr)) + .detail("ApiVersion", apiVersion) + .detail("ClientLibrary", imageInfo.fileName) + .detailf("ImageOffset", "%p", imageInfo.offset) + .detail("Primary", networkOptions.primaryClient) + .trackLatest("ClientStart"); + + g_network->initMetrics(); + FlowTransport::transport().initMetrics(); + } + + // Initialize system monitoring once the local IP is available + if (localAddress.present()) { + initializeSystemMonitorMachineState(SystemMonitorMachineState(IPAddress(localAddress.get().ip))); + systemMonitor(); + uncancellable(recurring(&systemMonitor, CLIENT_KNOBS->SYSTEM_MONITOR_INTERVAL, TaskPriority::FlushTrace)); + } +} // Creates a database object that represents a connection to a cluster // This constructor uses a preallocated DatabaseContext that may have been created @@ -2202,49 +2346,7 @@ Database Database::createDatabase(Reference connRecord ASSERT(TraceEvent::isNetworkThread()); - platform::ImageInfo imageInfo = platform::getImageInfo(); - - if (connRecord) { - if (networkOptions.traceDirectory.present() && !traceFileIsOpen()) { - g_network->initMetrics(); - FlowTransport::transport().initMetrics(); - initTraceEventMetrics(); - - auto publicIP = determinePublicIPAutomatically(connRecord->getConnectionString()); - selectTraceFormatter(networkOptions.traceFormat); - selectTraceClockSource(networkOptions.traceClockSource); - addUniversalTraceField("ClientDescription", - format("%s-%s-%" PRIu64, - networkOptions.primaryClient ? "primary" : "external", - FDB_VT_VERSION, - getTraceThreadId())); - - openTraceFile(NetworkAddress(publicIP, ::getpid()), - networkOptions.traceRollSize, - networkOptions.traceMaxLogsSize, - networkOptions.traceDirectory.get(), - "trace", - networkOptions.traceLogGroup, - networkOptions.traceFileIdentifier, - networkOptions.tracePartialFileSuffix); - - TraceEvent("ClientStart") - .detail("SourceVersion", getSourceVersion()) - .detail("Version", FDB_VT_VERSION) - .detail("PackageName", FDB_VT_PACKAGE_NAME) - .detailf("ActualTime", "%lld", DEBUG_DETERMINISM ? 0 : time(nullptr)) - .detail("ApiVersion", apiVersion) - .detail("ClientLibrary", imageInfo.fileName) - .detailf("ImageOffset", "%p", imageInfo.offset) - .detail("Primary", networkOptions.primaryClient) - .trackLatest("ClientStart"); - - initializeSystemMonitorMachineState(SystemMonitorMachineState(IPAddress(publicIP))); - - systemMonitor(); - uncancellable(recurring(&systemMonitor, CLIENT_KNOBS->SYSTEM_MONITOR_INTERVAL, TaskPriority::FlushTrace)); - } - } + initializeClientTracing(connRecord, apiVersion); g_network->initTLS(); @@ -2296,7 +2398,7 @@ Database Database::createDatabase(Reference connRecord .detail("Version", FDB_VT_VERSION) .detail("ClusterFile", connRecord ? connRecord->toString() : "None") .detail("ConnectionString", connRecord ? connRecord->getConnectionString().toString() : "None") - .detail("ClientLibrary", imageInfo.fileName) + .detail("ClientLibrary", platform::getImageInfo().fileName) .detail("Primary", networkOptions.primaryClient) .detail("Internal", internal) .trackLatest(database->connectToDatabaseEventCacheHolder.trackingKey); @@ -2308,28 +2410,15 @@ Database Database::createDatabase(std::string connFileName, int apiVersion, IsInternal internal, LocalityData const& clientLocality) { - Reference rccr = Reference( - new ClusterConnectionFile(ClusterConnectionFile::lookupClusterFileName(connFileName).first)); + Reference rccr = ClusterConnectionFile::openOrDefault(connFileName); return Database::createDatabase(rccr, apiVersion, internal, clientLocality); } -Reference DatabaseContext::getWatchMetadata(int64_t tenantId, KeyRef key) const { - const auto it = watchMap.find(std::make_pair(tenantId, key)); - if (it == watchMap.end()) - return Reference(); - return it->second; -} - -void DatabaseContext::setWatchMetadata(Reference metadata) { - watchMap[std::make_pair(metadata->parameters->tenant.tenantId, metadata->parameters->key)] = metadata; -} - -void DatabaseContext::deleteWatchMetadata(int64_t tenantId, KeyRef key) { - watchMap.erase(std::make_pair(tenantId, key)); -} - -void DatabaseContext::clearWatchMetadata() { - watchMap.clear(); +Database Database::createSimulatedExtraDatabase(std::string connectionString, Optional defaultTenant) { + auto extraFile = makeReference(ClusterConnectionString(connectionString)); + Database db = Database::createDatabase(extraFile, ApiVersion::LATEST_VERSION); + db->defaultTenant = defaultTenant; + return db; } const UniqueOrderedOptionList& Database::getTransactionDefaults() const { @@ -2393,6 +2482,9 @@ void setNetworkOption(FDBNetworkOptions::Option option, Optional valu validateOptionValuePresent(value); networkOptions.tracePartialFileSuffix = value.get().toString(); break; + case FDBNetworkOptions::TRACE_INITIALIZE_ON_SETUP: + networkOptions.traceInitializeOnSetup = true; + break; case FDBNetworkOptions::KNOB: { validateOptionValuePresent(value); @@ -2486,7 +2578,7 @@ void setNetworkOption(FDBNetworkOptions::Option option, Optional valu ASSERT(value.present()); Standalone> supportedVersions; - std::vector supportedVersionsStrings = value.get().splitAny(LiteralStringRef(";")); + std::vector supportedVersionsStrings = value.get().splitAny(";"_sr); for (StringRef versionString : supportedVersionsStrings) { #ifdef ADDRESS_SANITIZER __lsan_disable(); @@ -2593,6 +2685,10 @@ void setupNetwork(uint64_t transportId, UseMetrics useMetrics) { FlowTransport::createInstance(true, transportId, WLTOKEN_RESERVED_COUNT); Net2FileSystem::newFileSystem(); + if (networkOptions.traceInitializeOnSetup) { + ::initializeClientTracing({}, {}); + } + uncancellable(monitorNetworkBusyness()); } @@ -2619,9 +2715,13 @@ void stopNetwork() { if (!g_network) throw network_not_setup(); - TraceEvent("ClientStopNetwork"); + TraceEvent("ClientStopNetwork").log(); + + if (networkOptions.traceDirectory.present() && networkOptions.runLoopProfilingEnabled) { + stopRunLoopProfiler(); + } + g_network->stop(); - closeTraceFile(); } void DatabaseContext::updateProxies() { @@ -2667,7 +2767,7 @@ bool DatabaseContext::isCurrentGrvProxy(UID proxyId) const { if (proxy.id() == proxyId) return true; } - TEST(true); // stale GRV proxy detected + CODE_PROBE(true, "stale GRV proxy detected", probe::decoration::rare); return false; } @@ -2734,26 +2834,26 @@ void GetRangeLimits::decrement(MappedKeyValueRef const& data) { } // True if either the row or byte limit has been reached -bool GetRangeLimits::isReached() { +bool GetRangeLimits::isReached() const { return rows == 0 || (bytes == 0 && minRows == 0); } // True if data would cause the row or byte limit to be reached -bool GetRangeLimits::reachedBy(VectorRef const& data) { +bool GetRangeLimits::reachedBy(VectorRef const& data) const { return (rows != GetRangeLimits::ROW_LIMIT_UNLIMITED && data.size() >= rows) || (bytes != GetRangeLimits::BYTE_LIMIT_UNLIMITED && (int)data.expectedSize() + (8 - (int)sizeof(KeyValueRef)) * data.size() >= bytes && data.size() >= minRows); } -bool GetRangeLimits::hasByteLimit() { +bool GetRangeLimits::hasByteLimit() const { return bytes != GetRangeLimits::BYTE_LIMIT_UNLIMITED; } -bool GetRangeLimits::hasRowLimit() { +bool GetRangeLimits::hasRowLimit() const { return rows != GetRangeLimits::ROW_LIMIT_UNLIMITED; } -bool GetRangeLimits::hasSatisfiedMinRows() { +bool GetRangeLimits::hasSatisfiedMinRows() const { return hasByteLimit() && minRows == 0; } @@ -2780,25 +2880,51 @@ AddressExclusion AddressExclusion::parse(StringRef const& key) { } } +Tenant::Tenant(Database cx, TenantName name) : idFuture(cx->lookupTenant(name)), name(name) {} +Tenant::Tenant(int64_t id) : idFuture(id) {} +Tenant::Tenant(Future id, Optional name) : idFuture(id), name(name) {} + +int64_t Tenant::id() const { + ASSERT(idFuture.isReady()); + return idFuture.get(); +} + +Future Tenant::getIdFuture() const { + return idFuture; +} + +KeyRef Tenant::prefix() const { + ASSERT(idFuture.isReady()); + if (bigEndianId == -1) { + bigEndianId = bigEndian64(idFuture.get()); + } + return StringRef(reinterpret_cast(&bigEndianId), TenantAPI::PREFIX_SIZE); +} + +std::string Tenant::description() const { + StringRef nameStr = name.castTo().orDefault(""_sr); + if (idFuture.canGet()) { + return format("%.*s (%lld)", nameStr.size(), nameStr.begin(), idFuture.get()); + } else { + return format("%.*s", nameStr.size(), nameStr.begin()); + } +} + Future> getValue(Reference const& trState, Key const& key, - Future const& version, UseTenant const& useTenant = UseTenant::True, TransactionRecordLogInfo const& recordLogInfo = TransactionRecordLogInfo::True); Future getRange(Reference const& trState, - Future const& fVersion, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Reverse const& reverse, UseTenant const& useTenant); -ACTOR Future> fetchServerInterface(Reference trState, - Future ver, - UID id) { +ACTOR Future> fetchServerInterface(Reference trState, UID id) { Optional val = - wait(getValue(trState, serverListKeyFor(id), ver, UseTenant::False, TransactionRecordLogInfo::False)); + wait(getValue(trState, serverListKeyFor(id), UseTenant::False, TransactionRecordLogInfo::False)); if (!val.present()) { // A storage server has been removed from serverList since we read keyServers @@ -2808,12 +2934,13 @@ ACTOR Future> fetchServerInterface(Reference>> -transactionalGetServerInterfaces(Reference trState, Future ver, std::vector ids) { +ACTOR Future>> transactionalGetServerInterfaces( + Reference trState, + std::vector ids) { state std::vector>> serverListEntries; serverListEntries.reserve(ids.size()); for (int s = 0; s < ids.size(); s++) { - serverListEntries.push_back(fetchServerInterface(trState, ver, ids[s])); + serverListEntries.push_back(fetchServerInterface(trState, ids[s])); } std::vector> serverListValues = wait(getAll(serverListEntries)); @@ -2860,15 +2987,15 @@ void updateTagMappings(Database cx, const GetKeyServerLocationsReply& reply) { // If isBackward == true, returns the shard containing the key before 'key' (an infinitely long, inexpressible key). // Otherwise returns the shard containing key ACTOR Future getKeyLocation_internal(Database cx, - Optional tenant, + TenantInfo tenant, Key key, - SpanID spanID, + SpanContext spanContext, Optional debugID, UseProvisionalProxies useProvisionalProxies, Reverse isBackward, Version version) { - state Span span("NAPI:getKeyLocation"_loc, spanID); + state Span span("NAPI:getKeyLocation"_loc, spanContext); if (isBackward) { ASSERT(key != allKeys.begin && key <= allKeys.end); } else { @@ -2884,47 +3011,34 @@ ACTOR Future getKeyLocation_internal(Database cx, ++cx->transactionKeyServerLocationRequests; choose { when(wait(cx->onProxiesChanged())) {} - when(GetKeyServerLocationsReply rep = - wait(basicLoadBalance(cx->getCommitProxies(useProvisionalProxies), - &CommitProxyInterface::getKeyServersLocations, - GetKeyServerLocationsRequest(span.context, - tenant.castTo(), - key, - Optional(), - 100, - isBackward, - version, - key.arena()), - TaskPriority::DefaultPromiseEndpoint))) { + when(GetKeyServerLocationsReply rep = wait(basicLoadBalance( + cx->getCommitProxies(useProvisionalProxies), + &CommitProxyInterface::getKeyServersLocations, + GetKeyServerLocationsRequest( + span.context, tenant, key, Optional(), 100, isBackward, version, key.arena()), + TaskPriority::DefaultPromiseEndpoint))) { ++cx->transactionKeyServerLocationRequestsCompleted; if (debugID.present()) g_traceBatch.addEvent( "TransactionDebug", debugID.get().first(), "NativeAPI.getKeyLocation.After"); ASSERT(rep.results.size() == 1); - auto locationInfo = - cx->setCachedLocation(tenant, rep.tenantEntry, rep.results[0].first, rep.results[0].second); + auto locationInfo = cx->setCachedLocation(rep.results[0].first, rep.results[0].second); updateTssMappings(cx, rep); updateTagMappings(cx, rep); cx->updateBackoff(success()); return KeyRangeLocationInfo( - rep.tenantEntry, - KeyRange(toRelativeRange(rep.results[0].first, rep.tenantEntry.prefix), rep.arena), - locationInfo); + KeyRange(toPrefixRelativeRange(rep.results[0].first, tenant.prefix), rep.arena), locationInfo); } } } catch (Error& e) { - if (e.code() == error_code_proxy_memory_limit_exceeded) { - // Eats proxy_memory_limit_exceeded error from commit proxies + if (e.code() == error_code_commit_proxy_memory_limit_exceeded) { + // Eats commit_proxy_memory_limit_exceeded error from commit proxies TraceEvent(SevWarnAlways, "CommitProxyOverloadedForKeyLocation").suppressFor(5); cx->updateBackoff(e); continue; } - if (e.code() == error_code_tenant_not_found) { - ASSERT(tenant.present()); - cx->invalidateCachedTenant(tenant.get()); - } throw; } @@ -2962,10 +3076,10 @@ bool checkOnlyEndpointFailed(const Database& cx, const Endpoint& endpoint) { template Future getKeyLocation(Database const& cx, - Optional const& tenant, + TenantInfo const& tenant, Key const& key, F StorageServerInterface::*member, - SpanID spanID, + SpanContext spanContext, Optional debugID, UseProvisionalProxies useProvisionalProxies, Reverse isBackward, @@ -2973,7 +3087,8 @@ Future getKeyLocation(Database const& cx, // we first check whether this range is cached Optional locationInfo = cx->getCachedLocation(tenant, key, isBackward); if (!locationInfo.present()) { - return getKeyLocation_internal(cx, tenant, key, spanID, debugID, useProvisionalProxies, isBackward, version); + return getKeyLocation_internal( + cx, tenant, key, spanContext, debugID, useProvisionalProxies, isBackward, version); } bool onlyEndpointFailedAndNeedRefresh = false; @@ -2984,10 +3099,11 @@ Future getKeyLocation(Database const& cx, } if (onlyEndpointFailedAndNeedRefresh) { - cx->invalidateCache(locationInfo.get().tenantEntry.prefix, key); + cx->invalidateCache(tenant.prefix, key); // Refresh the cache with a new getKeyLocations made to proxies. - return getKeyLocation_internal(cx, tenant, key, spanID, debugID, useProvisionalProxies, isBackward, version); + return getKeyLocation_internal( + cx, tenant, key, spanContext, debugID, useProvisionalProxies, isBackward, version); } return locationInfo.get(); @@ -2998,26 +3114,18 @@ Future getKeyLocation(Reference trState, Key const& key, F StorageServerInterface::*member, Reverse isBackward, - UseTenant useTenant, - Version version) { - auto f = getKeyLocation(trState->cx, - useTenant ? trState->tenant() : Optional(), - key, - member, - trState->spanID, - trState->debugID, - trState->useProvisionalProxies, - isBackward, - version); - - if (trState->tenant().present() && useTenant) { - return map(f, [trState](const KeyRangeLocationInfo& locationInfo) { - trState->tenantId = locationInfo.tenantEntry.id; - return locationInfo; - }); - } else { - return f; - } + UseTenant useTenant) { + return getKeyLocation(trState->cx, + useTenant ? trState->getTenantInfo() : TenantInfo(), + key, + member, + trState->spanContext, + trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(), + trState->useProvisionalProxies, + isBackward, + trState->readVersionFuture.isValid() && trState->readVersionFuture.isReady() + ? trState->readVersion() + : latestVersion); } void DatabaseContext::updateBackoff(const Error& err) { @@ -3029,7 +3137,7 @@ void DatabaseContext::updateBackoff(const Error& err) { } break; - case error_code_proxy_memory_limit_exceeded: + case error_code_commit_proxy_memory_limit_exceeded: ++transactionsResourceConstrained; if (backoffDelay == 0.0) { backoffDelay = CLIENT_KNOBS->DEFAULT_BACKOFF; @@ -3046,15 +3154,15 @@ void DatabaseContext::updateBackoff(const Error& err) { ACTOR Future> getKeyRangeLocations_internal( Database cx, - Optional tenant, + TenantInfo tenant, KeyRange keys, int limit, Reverse reverse, - SpanID spanID, + SpanContext spanContext, Optional debugID, UseProvisionalProxies useProvisionalProxies, Version version) { - state Span span("NAPI:getKeyRangeLocations"_loc, spanID); + state Span span("NAPI:getKeyRangeLocations"_loc, spanContext); if (debugID.present()) g_traceBatch.addEvent("TransactionDebug", debugID.get().first(), "NativeAPI.getKeyLocations.Before"); @@ -3064,18 +3172,12 @@ ACTOR Future> getKeyRangeLocations_internal( ++cx->transactionKeyServerLocationRequests; choose { when(wait(cx->onProxiesChanged())) {} - when(GetKeyServerLocationsReply _rep = - wait(basicLoadBalance(cx->getCommitProxies(useProvisionalProxies), - &CommitProxyInterface::getKeyServersLocations, - GetKeyServerLocationsRequest(span.context, - tenant.castTo(), - keys.begin, - keys.end, - limit, - reverse, - version, - keys.arena()), - TaskPriority::DefaultPromiseEndpoint))) { + when(GetKeyServerLocationsReply _rep = wait(basicLoadBalance( + cx->getCommitProxies(useProvisionalProxies), + &CommitProxyInterface::getKeyServersLocations, + GetKeyServerLocationsRequest( + span.context, tenant, keys.begin, keys.end, limit, reverse, version, keys.arena()), + TaskPriority::DefaultPromiseEndpoint))) { ++cx->transactionKeyServerLocationRequestsCompleted; state GetKeyServerLocationsReply rep = _rep; if (debugID.present()) @@ -3086,13 +3188,11 @@ ACTOR Future> getKeyRangeLocations_internal( state std::vector results; state int shard = 0; for (; shard < rep.results.size(); shard++) { - // FIXME: these shards are being inserted into the map sequentially, it would be much more - // CPU efficient to save the map pairs and insert them all at once. + // FIXME: these shards are being inserted into the map sequentially, it would be much more CPU + // efficient to save the map pairs and insert them all at once. results.emplace_back( - rep.tenantEntry, - (toRelativeRange(rep.results[shard].first, rep.tenantEntry.prefix) & keys), - cx->setCachedLocation( - tenant, rep.tenantEntry, rep.results[shard].first, rep.results[shard].second)); + (toPrefixRelativeRange(rep.results[shard].first, tenant.prefix) & keys), + cx->setCachedLocation(rep.results[shard].first, rep.results[shard].second)); wait(yield()); } updateTssMappings(cx, rep); @@ -3103,16 +3203,12 @@ ACTOR Future> getKeyRangeLocations_internal( } } } catch (Error& e) { - if (e.code() == error_code_proxy_memory_limit_exceeded) { - // Eats proxy_memory_limit_exceeded error from commit proxies + if (e.code() == error_code_commit_proxy_memory_limit_exceeded) { + // Eats commit_proxy_memory_limit_exceeded error from commit proxies TraceEvent(SevWarnAlways, "CommitProxyOverloadedForRangeLocation").suppressFor(5); cx->updateBackoff(e); continue; } - if (e.code() == error_code_tenant_not_found) { - ASSERT(tenant.present()); - cx->invalidateCachedTenant(tenant.get()); - } throw; } @@ -3127,12 +3223,12 @@ ACTOR Future> getKeyRangeLocations_internal( // [([a, b1), locationInfo), ([b1, c), locationInfo), ([c, d1), locationInfo)]. template Future> getKeyRangeLocations(Database const& cx, - Optional tenant, + TenantInfo const& tenant, KeyRange const& keys, int limit, Reverse reverse, F StorageServerInterface::*member, - SpanID const& spanID, + SpanContext const& spanContext, Optional const& debugID, UseProvisionalProxies useProvisionalProxies, Version version) { @@ -3142,7 +3238,7 @@ Future> getKeyRangeLocations(Database const& c std::vector locations; if (!cx->getCachedLocations(tenant, keys, locations, limit, reverse)) { return getKeyRangeLocations_internal( - cx, tenant, keys, limit, reverse, spanID, debugID, useProvisionalProxies, version); + cx, tenant, keys, limit, reverse, spanContext, debugID, useProvisionalProxies, version); } bool foundFailed = false; @@ -3155,7 +3251,7 @@ Future> getKeyRangeLocations(Database const& c } if (onlyEndpointFailedAndNeedRefresh) { - cx->invalidateCache(locationInfo.tenantEntry.prefix, locationInfo.range.begin); + cx->invalidateCache(tenant.prefix, locationInfo.range.begin); foundFailed = true; } } @@ -3163,7 +3259,7 @@ Future> getKeyRangeLocations(Database const& c if (foundFailed) { // Refresh the cache with a new getKeyRangeLocations made to proxies. return getKeyRangeLocations_internal( - cx, tenant, keys, limit, reverse, spanID, debugID, useProvisionalProxies, version); + cx, tenant, keys, limit, reverse, spanContext, debugID, useProvisionalProxies, version); } return locations; @@ -3175,47 +3271,144 @@ Future> getKeyRangeLocations(Referencecx, - useTenant ? trState->tenant() : Optional(), - keys, - limit, - reverse, - member, - trState->spanID, - trState->debugID, - trState->useProvisionalProxies, - version); - - if (trState->tenant().present() && useTenant) { - return map(f, [trState](const std::vector& locationInfo) { - ASSERT(!locationInfo.empty()); - trState->tenantId = locationInfo[0].tenantEntry.id; - return locationInfo; - }); - } else { - return f; + UseTenant useTenant) { + return getKeyRangeLocations(trState->cx, + useTenant ? trState->getTenantInfo(AllowInvalidTenantID::True) : TenantInfo(), + keys, + limit, + reverse, + member, + trState->spanContext, + trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(), + trState->useProvisionalProxies, + trState->readVersionFuture.isValid() && trState->readVersionFuture.isReady() + ? trState->readVersion() + : latestVersion); +} + +ACTOR Future>> getBlobGranuleLocations_internal( + Database cx, + TenantInfo tenant, + KeyRange keys, + int limit, + Reverse reverse, + JustGranules justGranules, + SpanContext spanContext, + Optional debugID, + UseProvisionalProxies useProvisionalProxies, + Version version, + bool* more) { + state Span span("NAPI:getBlobGranuleLocations"_loc, spanContext); + if (debugID.present()) + g_traceBatch.addEvent("TransactionDebug", debugID.get().first(), "NativeAPI.getBlobGranuleLocations.Before"); + + loop { + ++cx->transactionBlobGranuleLocationRequests; + choose { + when(wait(cx->onProxiesChanged())) {} + when(GetBlobGranuleLocationsReply _rep = + wait(basicLoadBalance(cx->getCommitProxies(useProvisionalProxies), + &CommitProxyInterface::getBlobGranuleLocations, + GetBlobGranuleLocationsRequest(span.context, + tenant, + keys.begin, + keys.end, + limit, + reverse, + justGranules, + version, + keys.arena()), + TaskPriority::DefaultPromiseEndpoint))) { + ++cx->transactionBlobGranuleLocationRequestsCompleted; + state GetBlobGranuleLocationsReply rep = _rep; + if (debugID.present()) + g_traceBatch.addEvent( + "TransactionDebug", debugID.get().first(), "NativeAPI.getBlobGranuleLocations.After"); + // if justGranules, we can get an empty mapping, otherwise, an empty mapping should have been an error + ASSERT(justGranules || rep.results.size()); + ASSERT(!rep.more || !rep.results.empty()); + *more = rep.more; + + state std::vector> results; + state int granule = 0; + for (auto& bwInterf : rep.bwInterfs) { + cx->blobWorker_interf.insert({ bwInterf.id(), bwInterf }); + } + for (; granule < rep.results.size(); granule++) { + // FIXME: cache mapping? + KeyRange range(toPrefixRelativeRange(rep.results[granule].first, tenant.prefix)); + if (!justGranules) { + range = range & keys; + } + results.emplace_back(range, rep.results[granule].second); + wait(yield()); + } + + return results; + } + } } } -ACTOR Future warmRange_impl(Reference trState, KeyRange keys, Future fVersion) { +// Get the Blob Worker locations for each granule in the 'keys' key-range, similar to getKeyRangeLocations +Future>> getBlobGranuleLocations(Database const& cx, + TenantInfo const& tenant, + KeyRange const& keys, + int limit, + Reverse reverse, + JustGranules justGranules, + SpanContext const& spanContext, + Optional const& debugID, + UseProvisionalProxies useProvisionalProxies, + Version version, + bool* more) { + + ASSERT(!keys.empty()); + + // FIXME: wrap this with location caching for blob workers like getKeyRangeLocations has + return getBlobGranuleLocations_internal( + cx, tenant, keys, limit, reverse, justGranules, spanContext, debugID, useProvisionalProxies, version, more); +} + +Future>> getBlobGranuleLocations(Reference trState, + KeyRange const& keys, + int limit, + Reverse reverse, + UseTenant useTenant, + JustGranules justGranules, + bool* more) { + return getBlobGranuleLocations( + trState->cx, + useTenant ? trState->getTenantInfo(AllowInvalidTenantID::True) : TenantInfo(), + keys, + limit, + reverse, + justGranules, + trState->spanContext, + trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(), + trState->useProvisionalProxies, + trState->readVersionFuture.isValid() && trState->readVersionFuture.isReady() ? trState->readVersion() + : latestVersion, + more); +} + +ACTOR Future warmRange_impl(Reference trState, KeyRange keys) { state int totalRanges = 0; state int totalRequests = 0; - state Version version = wait(fVersion); + wait(trState->startTransaction()); loop { - std::vector locations = - wait(getKeyRangeLocations_internal(trState->cx, - trState->tenant(), - keys, - CLIENT_KNOBS->WARM_RANGE_SHARD_LIMIT, - Reverse::False, - trState->spanID, - trState->debugID, - trState->useProvisionalProxies, - version)); + std::vector locations = wait(getKeyRangeLocations_internal( + trState->cx, + trState->getTenantInfo(), + keys, + CLIENT_KNOBS->WARM_RANGE_SHARD_LIMIT, + Reverse::False, + trState->spanContext, + trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(), + trState->useProvisionalProxies, + trState->readVersion())); totalRanges += CLIENT_KNOBS->WARM_RANGE_SHARD_LIMIT; totalRequests++; if (locations.size() == 0 || totalRanges >= trState->cx->locationCacheSize || @@ -3243,43 +3436,76 @@ ACTOR Future warmRange_impl(Reference trState, KeyRange return Void(); } -SpanID generateSpanID(bool transactionTracingSample, SpanID parentContext = SpanID()) { - uint64_t txnId = deterministicRandom()->randomUInt64(); +SpanContext generateSpanID(bool transactionTracingSample, SpanContext parentContext = SpanContext()) { if (parentContext.isValid()) { - if (parentContext.first() > 0) { - txnId = parentContext.first(); - } - uint64_t tokenId = parentContext.second() > 0 ? deterministicRandom()->randomUInt64() : 0; - return SpanID(txnId, tokenId); - } else if (transactionTracingSample) { - uint64_t tokenId = deterministicRandom()->random01() <= FLOW_KNOBS->TRACING_SAMPLE_RATE - ? deterministicRandom()->randomUInt64() - : 0; - return SpanID(txnId, tokenId); - } else { - return SpanID(txnId, 0); + return SpanContext(parentContext.traceID, deterministicRandom()->randomUInt64(), parentContext.m_Flags); + } + if (transactionTracingSample) { + return SpanContext(deterministicRandom()->randomUniqueID(), + deterministicRandom()->randomUInt64(), + deterministicRandom()->random01() <= FLOW_KNOBS->TRACING_SAMPLE_RATE + ? TraceFlags::sampled + : TraceFlags::unsampled); + } + return SpanContext( + deterministicRandom()->randomUniqueID(), deterministicRandom()->randomUInt64(), TraceFlags::unsampled); +} + +ACTOR Future lookupTenantImpl(DatabaseContext* cx, TenantName tenant) { + loop { + try { + wait(cx->getBackoff()); + + ++cx->transactionTenantLookupRequests; + choose { + when(wait(cx->onProxiesChanged())) {} + when(GetTenantIdReply rep = wait(basicLoadBalance(cx->getCommitProxies(UseProvisionalProxies::False), + &CommitProxyInterface::getTenantId, + GetTenantIdRequest(tenant, latestVersion), + TaskPriority::DefaultPromiseEndpoint))) { + ++cx->transactionTenantLookupRequestsCompleted; + cx->updateBackoff(success()); + return rep.tenantId; + } + } + } catch (Error& e) { + if (e.code() == error_code_commit_proxy_memory_limit_exceeded) { + TraceEvent(SevWarnAlways, "CommitProxyOverloadedForTenant").suppressFor(5); + // Eats commit_proxy_memory_limit_exceeded error from commit proxies + cx->updateBackoff(e); + continue; + } + + throw; + } } } +Future DatabaseContext::lookupTenant(TenantName tenant) { + return lookupTenantImpl(this, tenant); +} + TransactionState::TransactionState(Database cx, - Optional tenant, + Optional> tenant, TaskPriority taskID, - SpanID spanID, + SpanContext spanContext, Reference trLogInfo) - : cx(cx), trLogInfo(trLogInfo), options(cx), taskID(taskID), spanID(spanID), readVersionObtainedFromGrvProxy(true), - tenant_(tenant), tenantSet(tenant.present()) {} + : cx(cx), trLogInfo(trLogInfo), options(cx), taskID(taskID), spanContext(spanContext), + readVersionObtainedFromGrvProxy(true), tenant_(tenant), tenantSet(tenant.present()) {} Reference TransactionState::cloneAndReset(Reference newTrLogInfo, bool generateNewSpan) const { - SpanID newSpanID = generateNewSpan ? generateSpanID(cx->transactionTracingSample) : spanID; + SpanContext newSpanContext = generateNewSpan ? generateSpanID(cx->transactionTracingSample) : spanContext; Reference newState = - makeReference(cx, tenant_, cx->taskID, newSpanID, newTrLogInfo); + makeReference(cx, tenant_, cx->taskID, newSpanContext, newTrLogInfo); if (!cx->apiVersionAtLeast(16)) { newState->options = options; } + newState->readVersionFuture = Future(); + newState->metadataVersion = Promise>(); newState->numErrors = numErrors; newState->startTime = startTime; newState->committedVersion = committedVersion; @@ -3289,71 +3515,118 @@ Reference TransactionState::cloneAndReset(Reference const& t = tenant(); +TenantInfo TransactionState::getTenantInfo(AllowInvalidTenantID allowInvalidTenantId /* = false */) { + Optional> const& t = tenant(); if (options.rawAccess) { return TenantInfo(); + } else if (!cx->internal && cx->clientInfo->get().clusterType == ClusterType::METACLUSTER_MANAGEMENT) { + throw management_cluster_invalid_access(); } else if (!cx->internal && cx->clientInfo->get().tenantMode == TenantMode::REQUIRED && !t.present()) { throw tenant_name_required(); } else if (!t.present()) { return TenantInfo(); } else if (cx->clientInfo->get().tenantMode == TenantMode::DISABLED && t.present()) { - throw tenants_disabled(); + // If we are running provisional proxies, we allow a tenant request to go through since we don't know the tenant + // mode. Such a transaction would not be allowed to commit without enabling provisional commits because either + // the commit proxies will be provisional or the read version will be too old. + if (!cx->clientInfo->get().grvProxies.empty() && !cx->clientInfo->get().grvProxies[0].provisional) { + throw tenants_disabled(); + } else { + ASSERT(!useProvisionalProxies); + } } - ASSERT(tenantId != TenantInfo::INVALID_TENANT); - return TenantInfo(t.get(), tenantId); + ASSERT(t.present() && (allowInvalidTenantId || t.get()->id() != TenantInfo::INVALID_TENANT)); + return TenantInfo( + (allowInvalidTenantId && !t.get()->ready().isReady()) ? TenantInfo::INVALID_TENANT : t.get()->id(), authToken); } -Optional const& TransactionState::tenant() { - if (tenantSet) { - return tenant_; - } else { - if (!tenant_.present() && !options.rawAccess) { - tenant_ = cx->defaultTenant; +// Returns the tenant used in this transaction. If the tenant is unset and raw access isn't specified, then the default +// tenant from DatabaseContext is applied to this transaction (note: the default tenant is typically unset, but in +// simulation could be something different). +// +// This function should not be called in the transaction constructor or in the setOption function to allow a user the +// opportunity to set raw access. +Optional> const& TransactionState::tenant() { + hasTenant(ResolveDefaultTenant::True); + return tenant_; +} + +// Returns true if the tenant has been set, but does not cause default tenant resolution. This is useful in setOption +// (where we do not want to call tenant()) if we want to enforce that an option not be set on a Tenant transaction (e.g. +// for raw access). +bool TransactionState::hasTenant(ResolveDefaultTenant resolveDefaultTenant) { + if (!tenantSet && resolveDefaultTenant) { + if (!options.rawAccess && cx->defaultTenant.present()) { + tenant_ = makeReference(cx->lookupTenant(cx->defaultTenant.get()), cx->defaultTenant); } tenantSet = true; - return tenant_; } + + return tenant_.present(); +} + +ACTOR Future startTransaction(Reference trState) { + wait(success(trState->readVersionFuture)); + if (trState->tenant().present()) { + wait(trState->tenant().get()->ready()); + } + + return Void(); } -bool TransactionState::hasTenant() const { - return tenantSet && tenant_.present(); +Future TransactionState::startTransaction(uint32_t readVersionFlags) { + if (!startFuture.isValid()) { + if (!readVersionFuture.isValid()) { + readVersionFuture = getReadVersion(readVersionFlags); + } + if (readVersionFuture.isReady() && (!tenant().present() || tenant().get()->ready().isReady())) { + startFuture = Void(); + } else { + startFuture = ::startTransaction(Reference::addRef(this)); + } + } + + return startFuture; } Future Transaction::warmRange(KeyRange keys) { - return warmRange_impl(trState, keys, getReadVersion()); + return warmRange_impl(trState, keys); } ACTOR Future> getValue(Reference trState, Key key, - Future version, UseTenant useTenant, TransactionRecordLogInfo recordLogInfo) { - state Version ver = wait(version); - state Span span("NAPI:getValue"_loc, trState->spanID); + wait(trState->startTransaction()); + + state Span span("NAPI:getValue"_loc, trState->spanContext); if (useTenant && trState->tenant().present()) { - span.addTag("tenant"_sr, trState->tenant().get()); + span.addAttribute("tenant"_sr, + trState->tenant().get()->name.castTo().orDefault(""_sr)); } - span.addTag("key"_sr, key); - trState->cx->validateVersion(ver); + trState->cx->validateVersion(trState->readVersion()); loop { state KeyRangeLocationInfo locationInfo = - wait(getKeyLocation(trState, key, &StorageServerInterface::getValue, Reverse::False, useTenant, ver)); + wait(getKeyLocation(trState, key, &StorageServerInterface::getValue, Reverse::False, useTenant)); state Optional getValueID = Optional(); state uint64_t startTime; state double startTimeD; state VersionVector ssLatestCommitVersions; - trState->cx->getLatestCommitVersions(locationInfo.locations, ver, trState, ssLatestCommitVersions); + state Optional readOptions = trState->readOptions; + + trState->cx->getLatestCommitVersions(locationInfo.locations, trState, ssLatestCommitVersions); try { - if (trState->debugID.present()) { + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) { getValueID = nondeterministicRandom()->randomUniqueID(); + readOptions.get().debugID = getValueID; - g_traceBatch.addAttach("GetValueAttachID", trState->debugID.get().first(), getValueID.get().first()); + g_traceBatch.addAttach( + "GetValueAttachID", trState->readOptions.get().debugID.get().first(), getValueID.get().first()); g_traceBatch.addEvent("GetValueDebug", getValueID.get().first(), "NativeAPI.getValue.Before"); //.detail("TaskID", g_network->getCurrentTask()); @@ -3385,10 +3658,10 @@ ACTOR Future> getValue(Reference trState, GetValueRequest(span.context, useTenant ? trState->getTenantInfo() : TenantInfo(), key, - ver, + trState->readVersion(), trState->cx->sampleReadTags() ? trState->options.readTags : Optional(), - getValueID, + readOptions, ssLatestCommitVersions), TaskPriority::DefaultPromiseEndpoint, AtMostOnce::False, @@ -3406,11 +3679,17 @@ ACTOR Future> getValue(Reference trState, trState->cx->readLatencies.addSample(latency); if (trState->trLogInfo && recordLogInfo) { int valueSize = reply.value.present() ? reply.value.get().size() : 0; - trState->trLogInfo->addLog(FdbClientLogEvents::EventGet( - startTimeD, trState->cx->clientLocality.dcId(), latency, valueSize, key, trState->tenant())); + trState->trLogInfo->addLog(FdbClientLogEvents::EventGet(startTimeD, + trState->cx->clientLocality.dcId(), + latency, + valueSize, + key, + trState->tenant().flatMapRef(&Tenant::name))); } trState->cx->getValueCompleted->latency = timer_int() - startTime; trState->cx->getValueCompleted->log(); + trState->totalCost += + getReadOperationCost(key.size() + (reply.value.present() ? reply.value.get().size() : 0)); if (getValueID.present()) { g_traceBatch.addEvent("GetValueDebug", @@ -3437,39 +3716,37 @@ ACTOR Future> getValue(Reference trState, .detail("ReqVersion", ver) .detail("ReplySize", reply.value.present() ? reply.value.get().size() : -1);*/ } - if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || - (e.code() == error_code_transaction_too_old && ver == latestVersion)) { - trState->cx->invalidateCache(locationInfo.tenantEntry.prefix, key); + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) { + trState->cx->invalidateCache(useTenant ? trState->tenant().mapRef(&Tenant::prefix) : Optional(), + key); wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, trState->taskID)); - } else if (e.code() == error_code_unknown_tenant) { - ASSERT(useTenant && trState->tenant().present()); - trState->cx->invalidateCachedTenant(trState->tenant().get()); - wait(delay(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, trState->taskID)); } else { if (trState->trLogInfo && recordLogInfo) - trState->trLogInfo->addLog(FdbClientLogEvents::EventGetError(startTimeD, - trState->cx->clientLocality.dcId(), - static_cast(e.code()), - key, - trState->tenant())); + trState->trLogInfo->addLog( + FdbClientLogEvents::EventGetError(startTimeD, + trState->cx->clientLocality.dcId(), + static_cast(e.code()), + key, + trState->tenant().flatMapRef(&Tenant::name))); throw e; } } } } -ACTOR Future getKey(Reference trState, - KeySelector k, - Future version, - UseTenant useTenant = UseTenant::True) { - wait(success(version)); +ACTOR Future getKey(Reference trState, KeySelector k, UseTenant useTenant = UseTenant::True) { + wait(trState->startTransaction()); + + state Optional getKeyID; + state Optional readOptions = trState->readOptions; - state Optional getKeyID = Optional(); - state Span span("NAPI:getKey"_loc, trState->spanID); - if (trState->debugID.present()) { + state Span span("NAPI:getKey"_loc, trState->spanContext); + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) { getKeyID = nondeterministicRandom()->randomUniqueID(); + readOptions.get().debugID = getKeyID; - g_traceBatch.addAttach("GetKeyAttachID", trState->debugID.get().first(), getKeyID.get().first()); + g_traceBatch.addAttach( + "GetKeyAttachID", trState->readOptions.get().debugID.get().first(), getKeyID.get().first()); g_traceBatch.addEvent( "GetKeyDebug", getKeyID.get().first(), @@ -3488,15 +3765,11 @@ ACTOR Future getKey(Reference trState, } Key locationKey(k.getKey(), k.arena()); - state KeyRangeLocationInfo locationInfo = wait(getKeyLocation(trState, - locationKey, - &StorageServerInterface::getKey, - Reverse{ k.isBackward() }, - useTenant, - version.get())); + state KeyRangeLocationInfo locationInfo = wait(getKeyLocation( + trState, locationKey, &StorageServerInterface::getKey, Reverse{ k.isBackward() }, useTenant)); state VersionVector ssLatestCommitVersions; - trState->cx->getLatestCommitVersions(locationInfo.locations, version.get(), trState, ssLatestCommitVersions); + trState->cx->getLatestCommitVersions(locationInfo.locations, trState, ssLatestCommitVersions); try { if (getKeyID.present()) @@ -3510,9 +3783,9 @@ ACTOR Future getKey(Reference trState, GetKeyRequest req(span.context, useTenant ? trState->getTenantInfo() : TenantInfo(), k, - version.get(), + trState->readVersion(), trState->cx->sampleReadTags() ? trState->options.readTags : Optional(), - getKeyID, + readOptions, ssLatestCommitVersions); req.arena.dependsOn(k.arena()); @@ -3551,13 +3824,11 @@ ACTOR Future getKey(Reference trState, if (getKeyID.present()) g_traceBatch.addEvent("GetKeyDebug", getKeyID.get().first(), "NativeAPI.getKey.Error"); if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) { - trState->cx->invalidateCache(locationInfo.tenantEntry.prefix, k.getKey(), Reverse{ k.isBackward() }); + trState->cx->invalidateCache(useTenant ? trState->tenant().mapRef(&Tenant::prefix) : Optional(), + k.getKey(), + Reverse{ k.isBackward() }); wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, trState->taskID)); - } else if (e.code() == error_code_unknown_tenant) { - ASSERT(useTenant && trState->tenant().present()); - trState->cx->invalidateCachedTenant(trState->tenant().get()); - wait(delay(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, trState->taskID)); } else { TraceEvent(SevInfo, "GetKeyError").error(e).detail("AtKey", k.getKey()).detail("Offset", k.offset); throw e; @@ -3566,8 +3837,8 @@ ACTOR Future getKey(Reference trState, } } -ACTOR Future waitForCommittedVersion(Database cx, Version version, SpanID spanContext) { - state Span span("NAPI:waitForCommittedVersion"_loc, { spanContext }); +ACTOR Future waitForCommittedVersion(Database cx, Version version, SpanContext spanContext) { + state Span span("NAPI:waitForCommittedVersion"_loc, spanContext); loop { try { choose { @@ -3597,7 +3868,7 @@ ACTOR Future waitForCommittedVersion(Database cx, Version version, Span } } catch (Error& e) { if (e.code() == error_code_batch_transaction_throttled || - e.code() == error_code_proxy_memory_limit_exceeded) { + e.code() == error_code_grv_proxy_memory_limit_exceeded) { // GRV Proxy returns an error wait(delayJittered(CLIENT_KNOBS->GRV_ERROR_RETRY_DELAY)); } else { @@ -3609,14 +3880,14 @@ ACTOR Future waitForCommittedVersion(Database cx, Version version, Span } ACTOR Future getRawVersion(Reference trState) { - state Span span("NAPI:getRawVersion"_loc, { trState->spanID }); + state Span span("NAPI:getRawVersion"_loc, trState->spanContext); loop { choose { when(wait(trState->cx->onProxiesChanged())) {} when(GetReadVersionReply v = wait(basicLoadBalance(trState->cx->getGrvProxies(UseProvisionalProxies::False), &GrvProxyInterface::getConsistentReadVersion, - GetReadVersionRequest(trState->spanID, + GetReadVersionRequest(trState->spanContext, 0, TransactionPriority::IMMEDIATE, trState->cx->ssVersionVectorCache.getMaxVersion()), @@ -3640,22 +3911,21 @@ ACTOR Future readVersionBatcher( uint32_t flags); ACTOR Future watchValue(Database cx, Reference parameters) { - state Span span("NAPI:watchValue"_loc, parameters->spanID); + state Span span("NAPI:watchValue"_loc, parameters->spanContext); state Version ver = parameters->version; cx->validateVersion(parameters->version); ASSERT(parameters->version != latestVersion); loop { state KeyRangeLocationInfo locationInfo = wait(getKeyLocation(cx, - parameters->tenant.name, + parameters->tenant, parameters->key, &StorageServerInterface::watchValue, - parameters->spanID, + parameters->spanContext, parameters->debugID, parameters->useProvisionalProxies, Reverse::False, parameters->version)); - try { state Optional watchValueID = Optional(); if (parameters->debugID.present()) { @@ -3704,21 +3974,17 @@ ACTOR Future watchValue(Database cx, Reference p ver = v; } catch (Error& e) { if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) { - cx->invalidateCache(locationInfo.tenantEntry.prefix, parameters->key); + cx->invalidateCache(parameters->tenant.prefix, parameters->key); wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, parameters->taskID)); - } else if (e.code() == error_code_unknown_tenant) { - ASSERT(parameters->tenant.name.present()); - cx->invalidateCachedTenant(parameters->tenant.name.get()); - wait(delay(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, parameters->taskID)); } else if (e.code() == error_code_watch_cancelled || e.code() == error_code_process_behind) { // clang-format off - TEST(e.code() == error_code_watch_cancelled); // Too many watches on the storage server, poll for changes instead - TEST(e.code() == error_code_process_behind); // The storage servers are all behind + CODE_PROBE(e.code() == error_code_watch_cancelled, "Too many watches on the storage server, poll for changes instead"); + CODE_PROBE(e.code() == error_code_process_behind, "The storage servers are all behind", probe::decoration::rare); // clang-format on wait(delay(CLIENT_KNOBS->WATCH_POLLING_TIME, parameters->taskID)); } else if (e.code() == error_code_timed_out) { // The storage server occasionally times out watches in case - // it was cancelled - TEST(true); // A watch timed out + // it was cancelled + CODE_PROBE(true, "A watch timed out"); wait(delay(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, parameters->taskID)); } else { state Error err = e; @@ -3750,7 +4016,8 @@ ACTOR Future watchStorageServerResp(int64_t tenantId, Key key, Database cx } // ABA happens else { - TEST(true); // ABA issue where the version returned from the server is less than the version in the map + CODE_PROBE(true, + "ABA issue where the version returned from the server is less than the version in the map"); // case 2: version_1 < version_2 and future_count == 1 if (metadata->watchPromise.getFutureReferenceCount() == 1) { @@ -3779,10 +4046,14 @@ ACTOR Future watchStorageServerResp(int64_t tenantId, Key key, Database cx } ACTOR Future sameVersionDiffValue(Database cx, Reference parameters) { - state ReadYourWritesTransaction tr(cx, parameters->tenant.name); + state ReadYourWritesTransaction tr(cx, + parameters->tenant.hasTenant() + ? makeReference(parameters->tenant.tenantId) + : Optional>()); + loop { try { - if (!parameters->tenant.name.present()) { + if (!parameters->tenant.hasTenant()) { tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); } @@ -3798,7 +4069,7 @@ ACTOR Future sameVersionDiffValue(Database cx, Reference } // val_3 == val_2 (storage server value matches value passed into the function -> new watch) - if (valSS == parameters->value && tr.getTransactionState()->tenantId == parameters->tenant.tenantId) { + if (valSS == parameters->value && tr.getTransactionState()->tenantId() == parameters->tenant.tenantId) { metadata = makeReference(parameters); cx->setWatchMetadata(metadata); @@ -3841,7 +4112,8 @@ Future getWatchFuture(Database cx, Reference parameters) // case 3: val_1 != val_2 && version_2 > version_1 (received watch with different value and a higher version so // recreate in SS) else if (parameters->version > metadata->parameters->version) { - TEST(true); // Setting a watch that has a different value than the one in the map but a higher version (newer) + CODE_PROBE(true, + "Setting a watch that has a different value than the one in the map but a higher version (newer)"); cx->deleteWatchMetadata(parameters->tenant.tenantId, parameters->key); metadata->watchPromise.send(parameters->version); @@ -3856,30 +4128,74 @@ Future getWatchFuture(Database cx, Reference parameters) } // case 5: val_1 != val_2 && version_1 == version_2 (received watch with different value but same version) else if (metadata->parameters->version == parameters->version) { - TEST(true); // Setting a watch which has a different value than the one in the map but the same version + CODE_PROBE(true, "Setting a watch which has a different value than the one in the map but the same version"); return sameVersionDiffValue(cx, parameters); } - TEST(true); // Setting a watch which has a different value than the one in the map but a lower version (older) + CODE_PROBE(true, "Setting a watch which has a different value than the one in the map but a lower version (older)"); // case 4: val_1 != val_2 && version_2 < version_1 return Void(); } +namespace { + +// NOTE: Since an ACTOR could receive multiple exceptions for a single catch clause, e.g. broken promise together with +// operation cancelled, If the decreaseWatchRefCount is placed at the catch clause, it might be triggered for multiple +// times. One could check if the SAV isSet, but seems a more intuitive way is to use RAII-style constructor/destructor +// pair. Yet the object has to be constructed after a wait statement, so it must be trivially-constructible. This +// requires move-assignment operator implemented. +class WatchRefCountUpdater { + Database cx; + int64_t tenantID; + KeyRef key; + Version version; + +public: + WatchRefCountUpdater() = default; + + WatchRefCountUpdater(const Database& cx_, const int64_t tenantID_, KeyRef key_, const Version& ver) + : cx(cx_), tenantID(tenantID_), key(key_), version(ver) {} + + WatchRefCountUpdater& operator=(WatchRefCountUpdater&& other) { + if (cx.getReference()) { + cx->decreaseWatchRefCount(tenantID, key, version); + } + + cx = std::move(other.cx); + tenantID = std::move(other.tenantID); + key = std::move(other.key); + version = std::move(other.version); + + cx->increaseWatchRefCount(tenantID, key, version); + + return *this; + } + + ~WatchRefCountUpdater() { + if (cx.getReference()) { + cx->decreaseWatchRefCount(tenantID, key, version); + } + } +}; + +} // namespace + ACTOR Future watchValueMap(Future version, TenantInfo tenant, Key key, Optional value, Database cx, TagSet tags, - SpanID spanID, + SpanContext spanContext, TaskPriority taskID, Optional debugID, UseProvisionalProxies useProvisionalProxies) { state Version ver = wait(version); + state WatchRefCountUpdater watchRefCountUpdater(cx, tenant.tenantId, key, ver); - wait(getWatchFuture( - cx, - makeReference(tenant, key, value, ver, tags, spanID, taskID, debugID, useProvisionalProxies))); + wait(getWatchFuture(cx, + makeReference( + tenant, key, value, ver, tags, spanContext, taskID, debugID, useProvisionalProxies))); return Void(); } @@ -3906,7 +4222,7 @@ void transformRangeLimits(GetRangeLimits limits, Reverse reverse, GetKeyValuesFa } template -RequestStream StorageServerInterface::*getRangeRequestStream() { +PublicRequestStream StorageServerInterface::*getRangeRequestStream() { if constexpr (std::is_same::value) { return &StorageServerInterface::getKeyValues; } else if (std::is_same::value) { @@ -3918,17 +4234,18 @@ RequestStream StorageServerInterface::*getRangeReques ACTOR template Future getExactRange(Reference trState, - Version version, KeyRange keys, Key mapper, GetRangeLimits limits, Reverse reverse, UseTenant useTenant) { state RangeResultFamily output; - state Span span("NAPI:getExactRange"_loc, trState->spanID); + // TODO - ljoswiak parent or link? + state Span span("NAPI:getExactRange"_loc, trState->spanContext); if (useTenant && trState->tenant().present()) { - span.addTag("tenant"_sr, trState->tenant().get()); + span.addAttribute("tenant"_sr, + trState->tenant().get()->name.castTo().orDefault(""_sr)); } // printf("getExactRange( '%s', '%s' )\n", keys.begin.toString().c_str(), keys.end.toString().c_str()); @@ -3939,8 +4256,7 @@ Future getExactRange(Reference trState, CLIENT_KNOBS->GET_RANGE_SHARD_LIMIT, reverse, getRangeRequestStream(), - useTenant, - version)); + useTenant)); ASSERT(locations.size()); state int shard = 0; loop { @@ -3951,12 +4267,12 @@ Future getExactRange(Reference trState, req.arena.dependsOn(mapper.arena()); req.tenantInfo = useTenant ? trState->getTenantInfo() : TenantInfo(); - req.version = version; + req.version = trState->readVersion(); req.begin = firstGreaterOrEqual(range.begin); req.end = firstGreaterOrEqual(range.end); + req.spanContext = span.context; - trState->cx->getLatestCommitVersions( - locations[shard].locations, req.version, trState, req.ssLatestCommitVersions); + trState->cx->getLatestCommitVersions(locations[shard].locations, trState, req.ssLatestCommitVersions); // keep shard's arena around in case of async tss comparison req.arena.dependsOn(locations[shard].range.arena()); @@ -3966,20 +4282,22 @@ Future getExactRange(Reference trState, // FIXME: buggify byte limits on internal functions that use them, instead of globally req.tags = trState->cx->sampleReadTags() ? trState->options.readTags : Optional(); - req.debugID = trState->debugID; + + req.options = trState->readOptions; try { - if (trState->debugID.present()) { - g_traceBatch.addEvent( - "TransactionDebug", trState->debugID.get().first(), "NativeAPI.getExactRange.Before"); - /*TraceEvent("TransactionDebugGetExactRangeInfo", trState->debugID.get()) + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) { + g_traceBatch.addEvent("TransactionDebug", + trState->readOptions.get().debugID.get().first(), + "NativeAPI.getExactRange.Before"); + /*TraceEvent("TransactionDebugGetExactRangeInfo", trState->readOptions.get().debugID.get()) .detail("ReqBeginKey", req.begin.getKey()) .detail("ReqEndKey", req.end.getKey()) .detail("ReqLimit", req.limit) .detail("ReqLimitBytes", req.limitBytes) .detail("ReqVersion", req.version) .detail("Reverse", reverse) - .detail("Servers", locations[shard].second->description());*/ + .detail("Servers", locations[shard].locations->locations()->description());*/ } ++trState->cx->transactionPhysicalReads; state GetKeyValuesFamilyReply rep; @@ -4004,9 +4322,10 @@ Future getExactRange(Reference trState, ++trState->cx->transactionPhysicalReadsCompleted; throw; } - if (trState->debugID.present()) - g_traceBatch.addEvent( - "TransactionDebug", trState->debugID.get().first(), "NativeAPI.getExactRange.After"); + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) + g_traceBatch.addEvent("TransactionDebug", + trState->readOptions.get().debugID.get().first(), + "NativeAPI.getExactRange.After"); output.arena().dependsOn(rep.arena); output.append(output.arena(), rep.data.begin(), rep.data.size()); @@ -4041,7 +4360,7 @@ Future getExactRange(Reference trState, .detail("BlockBytes", rep.data.expectedSize()); ASSERT(false); } - TEST(true); // GetKeyValuesFamilyReply.more in getExactRange + CODE_PROBE(true, "GetKeyValuesFamilyReply.more in getExactRange"); // Make next request to the same shard with a beginning key just after the last key returned if (reverse) locations[shard].range = @@ -4052,7 +4371,7 @@ Future getExactRange(Reference trState, } if (!more || locations[shard].range.empty()) { - TEST(true); // getExactrange (!more || locations[shard].first.empty()) + CODE_PROBE(true, "getExactrange (!more || locations[shard].first.empty())"); if (shard == locations.size() - 1) { const KeyRangeRef& range = locations[shard].range; KeyRef begin = reverse ? keys.begin : range.end; @@ -4062,7 +4381,7 @@ Future getExactRange(Reference trState, output.more = false; return output; } - TEST(true); // Multiple requests of key locations + CODE_PROBE(true, "Multiple requests of key locations"); keys = KeyRangeRef(begin, end); break; @@ -4088,15 +4407,11 @@ Future getExactRange(Reference trState, else keys = KeyRangeRef(range.begin, keys.end); - trState->cx->invalidateCache(locations[0].tenantEntry.prefix, keys); + trState->cx->invalidateCache( + useTenant ? trState->tenant().mapRef(&Tenant::prefix) : Optional(), keys); wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, trState->taskID)); break; - } else if (e.code() == error_code_unknown_tenant) { - ASSERT(useTenant && trState->tenant().present()); - trState->cx->invalidateCachedTenant(trState->tenant().get()); - wait(delay(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, trState->taskID)); - break; } else { TraceEvent(SevInfo, "GetExactRangeError") .error(e) @@ -4110,39 +4425,26 @@ Future getExactRange(Reference trState, } } -Future resolveKey(Reference trState, - KeySelector const& key, - Version const& version, - UseTenant useTenant) { +Future resolveKey(Reference trState, KeySelector const& key, UseTenant useTenant) { if (key.isFirstGreaterOrEqual()) return Future(key.getKey()); if (key.isFirstGreaterThan()) return Future(keyAfter(key.getKey())); - return getKey(trState, key, version, useTenant); + return getKey(trState, key, useTenant); } ACTOR template Future getRangeFallback(Reference trState, - Version version, KeySelector begin, KeySelector end, Key mapper, GetRangeLimits limits, Reverse reverse, UseTenant useTenant) { - if (version == latestVersion) { - state Transaction transaction(trState->cx); - transaction.setOption(FDBTransactionOptions::CAUSAL_READ_RISKY); - transaction.setOption(FDBTransactionOptions::LOCK_AWARE); - transaction.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - Version ver = wait(transaction.getReadVersion()); - version = ver; - } - - Future fb = resolveKey(trState, begin, version, useTenant); - state Future fe = resolveKey(trState, end, version, useTenant); + Future fb = resolveKey(trState, begin, useTenant); + state Future fe = resolveKey(trState, end, useTenant); state Key b = wait(fb); state Key e = wait(fe); @@ -4155,7 +4457,7 @@ Future getRangeFallback(Reference trState, // or allKeys.begin exists in the database/tenant and will be part of the conflict range anyways RangeResultFamily _r = wait(getExactRange( - trState, version, KeyRangeRef(b, e), mapper, limits, reverse, useTenant)); + trState, KeyRangeRef(b, e), mapper, limits, reverse, useTenant)); RangeResultFamily r = _r; if (b == allKeys.begin && ((reverse && !r.more) || !reverse)) @@ -4194,7 +4496,6 @@ int64_t inline getRangeResultFamilyBytes(MappedRangeResultRef result) { int64_t bytes = 0; for (const MappedKeyValueRef& mappedKeyValue : result) { bytes += mappedKeyValue.key.size() + mappedKeyValue.value.size(); - auto& reqAndResult = mappedKeyValue.reqAndResult; if (std::holds_alternative(reqAndResult)) { auto getValue = std::get(reqAndResult); @@ -4221,6 +4522,7 @@ void getRangeFinished(Reference trState, RangeResultFamily result) { int64_t bytes = getRangeResultFamilyBytes(result); + trState->totalCost += getReadOperationCost(bytes); trState->cx->transactionBytesRead += bytes; trState->cx->transactionKeysRead += result.size(); @@ -4231,7 +4533,7 @@ void getRangeFinished(Reference trState, bytes, begin.getKey(), end.getKey(), - trState->tenant())); + trState->tenant().flatMapRef(&Tenant::name))); } if (!snapshot) { @@ -4273,7 +4575,6 @@ ACTOR template Future getRange(Reference trState, - Future fVersion, KeySelector begin, KeySelector end, Key mapper, @@ -4287,20 +4588,18 @@ Future getRange(Reference trState, state KeySelector originalBegin = begin; state KeySelector originalEnd = end; state RangeResultFamily output; - state Span span("NAPI:getRange"_loc, trState->spanID); + state Span span("NAPI:getRange"_loc, trState->spanContext); + state Optional getRangeID = Optional(); if (useTenant && trState->tenant().present()) { - span.addTag("tenant"_sr, trState->tenant().get()); + span.addAttribute("tenant"_sr, + trState->tenant().get()->name.castTo().orDefault(""_sr)); } try { - state Version version = wait(fVersion); - trState->cx->validateVersion(version); + wait(trState->startTransaction()); + trState->cx->validateVersion(trState->readVersion()); state double startTime = now(); - state Version readVersion = version; // Needed for latestVersion requests; if more, make future requests at the - // version that the first one completed - // FIXME: Is this really right? Weaken this and see if there is a problem; - // if so maybe there is a much subtler problem even with this. if (begin.getKey() == allKeys.begin && begin.offset < 1) { output.readToBegin = true; @@ -4319,25 +4618,18 @@ Future getRange(Reference trState, Key locationKey = reverse ? Key(end.getKey(), end.arena()) : Key(begin.getKey(), begin.arena()); Reverse locationBackward{ reverse ? (end - 1).isBackward() : begin.isBackward() }; - state KeyRangeLocationInfo beginServer = - wait(getKeyLocation(trState, - locationKey, - getRangeRequestStream(), - locationBackward, - useTenant, - version)); + state KeyRangeLocationInfo beginServer = wait(getKeyLocation( + trState, locationKey, getRangeRequestStream(), locationBackward, useTenant)); state KeyRange shard = beginServer.range; state bool modifiedSelectors = false; state GetKeyValuesFamilyRequest req; req.mapper = mapper; req.arena.dependsOn(mapper.arena()); - req.tenantInfo = useTenant ? trState->getTenantInfo() : TenantInfo(); - req.isFetchKeys = (trState->taskID == TaskPriority::FetchKeys); - req.version = readVersion; + req.options = trState->readOptions; + req.version = trState->readVersion(); - trState->cx->getLatestCommitVersions( - beginServer.locations, req.version, trState, req.ssLatestCommitVersions); + trState->cx->getLatestCommitVersions(beginServer.locations, trState, req.ssLatestCommitVersions); // In case of async tss comparison, also make req arena depend on begin, end, and/or shard's arena depending // on which is used @@ -4345,7 +4637,7 @@ Future getRange(Reference trState, if (reverse && (begin - 1).isDefinitelyLess(shard.begin) && (!begin.isFirstGreaterOrEqual() || begin.getKey() != shard.begin)) { // In this case we would be setting modifiedSelectors to true, but - // not modifying anything + // not modifying anything req.begin = firstGreaterOrEqual(shard.begin); modifiedSelectors = true; @@ -4371,26 +4663,32 @@ Future getRange(Reference trState, ASSERT(req.limitBytes > 0 && req.limit != 0 && req.limit < 0 == reverse); req.tags = trState->cx->sampleReadTags() ? trState->options.readTags : Optional(); - req.debugID = trState->debugID; req.spanContext = span.context; + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) { + getRangeID = nondeterministicRandom()->randomUniqueID(); + g_traceBatch.addAttach( + "TransactionAttachID", trState->readOptions.get().debugID.get().first(), getRangeID.get().first()); + } try { - if (trState->debugID.present()) { - g_traceBatch.addEvent( - "TransactionDebug", trState->debugID.get().first(), "NativeAPI.getRange.Before"); - /*TraceEvent("TransactionDebugGetRangeInfo", trState->debugID.get()) - .detail("ReqBeginKey", req.begin.getKey()) - .detail("ReqEndKey", req.end.getKey()) - .detail("OriginalBegin", originalBegin.toString()) - .detail("OriginalEnd", originalEnd.toString()) - .detail("Begin", begin.toString()) - .detail("End", end.toString()) - .detail("Shard", shard) - .detail("ReqLimit", req.limit) - .detail("ReqLimitBytes", req.limitBytes) - .detail("ReqVersion", req.version) - .detail("Reverse", reverse) - .detail("ModifiedSelectors", modifiedSelectors) - .detail("Servers", beginServer.second->description());*/ + if (getRangeID.present()) { + g_traceBatch.addEvent("TransactionDebug", getRangeID.get().first(), "NativeAPI.getRange.Before"); + /* + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) { + TraceEvent("TransactionDebugGetRangeInfo", trState->readOptions.get().debugID.get()) + .detail("ReqBeginKey", req.begin.getKey()) + .detail("ReqEndKey", req.end.getKey()) + .detail("OriginalBegin", originalBegin.toString()) + .detail("OriginalEnd", originalEnd.toString()) + .detail("Begin", begin.toString()) + .detail("End", end.toString()) + .detail("Shard", shard) + .detail("ReqLimit", req.limit) + .detail("ReqLimitBytes", req.limitBytes) + .detail("ReqVersion", req.version) + .detail("Reverse", reverse) + .detail("ModifiedSelectors", modifiedSelectors) + .detail("Servers", beginServer.locations->locations()->description()); + }*/ } ++trState->cx->transactionPhysicalReads; @@ -4416,16 +4714,19 @@ Future getRange(Reference trState, throw; } - if (trState->debugID.present()) { + if (getRangeID.present()) { g_traceBatch.addEvent("TransactionDebug", - trState->debugID.get().first(), + getRangeID.get().first(), "NativeAPI.getRange.After"); //.detail("SizeOf", rep.data.size()); - /*TraceEvent("TransactionDebugGetRangeDone", trState->debugID.get()) - .detail("ReqBeginKey", req.begin.getKey()) - .detail("ReqEndKey", req.end.getKey()) - .detail("RepIsMore", rep.more) - .detail("VersionReturned", rep.version) - .detail("RowsReturned", rep.data.size());*/ + /* + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) { + TraceEvent("TransactionDebugGetRangeDone", trState->readOptions.get().debugID.get()) + .detail("ReqBeginKey", req.begin.getKey()) + .detail("ReqEndKey", req.end.getKey()) + .detail("RepIsMore", rep.more) + .detail("VersionReturned", rep.version) + .detail("RowsReturned", rep.data.size()); + }*/ } ASSERT(!rep.more || rep.data.size()); @@ -4473,11 +4774,17 @@ Future getRange(Reference trState, if (readThrough) { output.arena().dependsOn(shard.arena()); - output.readThrough = reverse ? shard.begin : shard.end; + // As modifiedSelectors is true, more is also true. Then set readThrough to the shard boundary. + ASSERT(modifiedSelectors); + output.more = true; + output.setReadThrough(reverse ? shard.begin : shard.end); } getRangeFinished( trState, startTime, originalBegin, originalEnd, snapshot, conflictRange, reverse, output); + if (!output.more) { + ASSERT(!output.readThrough.present()); + } return output; } @@ -4485,36 +4792,28 @@ Future getRange(Reference trState, output.append(output.arena(), rep.data.begin(), rep.data.size()); if (finished) { + output.more = modifiedSelectors || limits.isReached() || rep.more; if (readThrough) { output.arena().dependsOn(shard.arena()); - output.readThrough = reverse ? shard.begin : shard.end; + output.setReadThrough(reverse ? shard.begin : shard.end); } - output.more = modifiedSelectors || limits.isReached() || rep.more; getRangeFinished( trState, startTime, originalBegin, originalEnd, snapshot, conflictRange, reverse, output); + if (!output.more) { + ASSERT(!output.readThrough.present()); + } return output; } - if (readVersion == latestVersion) { - readVersion = rep.version; // see above comment - } - if (!rep.more) { ASSERT(modifiedSelectors); - TEST(true); // !GetKeyValuesFamilyReply.more and modifiedSelectors in getRange + CODE_PROBE(true, "!GetKeyValuesFamilyReply.more and modifiedSelectors in getRange"); if (!rep.data.size()) { RangeResultFamily result = wait( getRangeFallback( - trState, - readVersion, - originalBegin, - originalEnd, - mapper, - originalLimits, - reverse, - useTenant)); + trState, originalBegin, originalEnd, mapper, originalLimits, reverse, useTenant)); getRangeFinished( trState, startTime, originalBegin, originalEnd, snapshot, conflictRange, reverse, result); return result; @@ -4525,7 +4824,7 @@ Future getRange(Reference trState, else begin = firstGreaterOrEqual(shard.end); } else { - TEST(true); // GetKeyValuesFamilyReply.more in getRange + CODE_PROBE(true, "GetKeyValuesFamilyReply.more in getRange"); if (reverse) end = firstGreaterOrEqual(output[output.size() - 1].key); else @@ -4533,38 +4832,26 @@ Future getRange(Reference trState, } } catch (Error& e) { - if (trState->debugID.present()) { - g_traceBatch.addEvent( - "TransactionDebug", trState->debugID.get().first(), "NativeAPI.getRange.Error"); - TraceEvent("TransactionDebugError", trState->debugID.get()).error(e); + if (getRangeID.present()) { + g_traceBatch.addEvent("TransactionDebug", getRangeID.get().first(), "NativeAPI.getRange.Error"); + TraceEvent("TransactionDebugError", getRangeID.get()).error(e); } - if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || - (e.code() == error_code_transaction_too_old && readVersion == latestVersion)) { - trState->cx->invalidateCache(beginServer.tenantEntry.prefix, + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) { + trState->cx->invalidateCache(useTenant ? trState->tenant().mapRef(&Tenant::prefix) + : Optional(), reverse ? end.getKey() : begin.getKey(), Reverse{ reverse ? (end - 1).isBackward() : begin.isBackward() }); if (e.code() == error_code_wrong_shard_server) { RangeResultFamily result = wait( getRangeFallback( - trState, - version, - originalBegin, - originalEnd, - mapper, - originalLimits, - reverse, - useTenant)); + trState, originalBegin, originalEnd, mapper, originalLimits, reverse, useTenant)); getRangeFinished( trState, startTime, originalBegin, originalEnd, snapshot, conflictRange, reverse, result); return result; } wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, trState->taskID)); - } else if (e.code() == error_code_unknown_tenant) { - ASSERT(useTenant && trState->tenant().present()); - trState->cx->invalidateCachedTenant(trState->tenant().get()); - wait(delay(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, trState->taskID)); } else { if (trState->trLogInfo) trState->trLogInfo->addLog( @@ -4573,7 +4860,7 @@ Future getRange(Reference trState, static_cast(e.code()), begin.getKey(), end.getKey(), - trState->tenant())); + trState->tenant().flatMapRef(&Tenant::name))); throw e; } @@ -4643,7 +4930,7 @@ static Future tssStreamComparison(Request request, } else { tssData.metrics->ssError(e.code()); } - TEST(e.code() != error_code_end_of_stream); // SS got error in TSS stream comparison + CODE_PROBE(e.code() != error_code_end_of_stream, "SS got error in TSS stream comparison"); } state double sleepTime = std::max(startTime + FLOW_KNOBS->LOAD_BALANCE_TSS_TIMEOUT - now(), 0.0); @@ -4655,7 +4942,7 @@ static Future tssStreamComparison(Request request, } when(wait(delay(sleepTime))) { ++tssData.metrics->tssTimeouts; - TEST(true); // Got TSS timeout in stream comparison + CODE_PROBE(true, "Got TSS timeout in stream comparison", probe::decoration::rare); } } } catch (Error& e) { @@ -4670,7 +4957,7 @@ static Future tssStreamComparison(Request request, } else { tssData.metrics->tssError(e.code()); } - TEST(e.code() != error_code_end_of_stream); // TSS got error in TSS stream comparison + CODE_PROBE(e.code() != error_code_end_of_stream, "TSS got error in TSS stream comparison"); } if (!ssEndOfStream || !tssEndOfStream) { @@ -4683,13 +4970,12 @@ static Future tssStreamComparison(Request request, // FIXME: this code is pretty much identical to LoadBalance.h // TODO could add team check logic in if we added synchronous way to turn this into a fixed getRange request // and send it to the whole team and compare? I think it's fine to skip that for streaming though - TEST(ssEndOfStream != tssEndOfStream); // SS or TSS stream finished early! // skip tss comparison if both are end of stream if ((!ssEndOfStream || !tssEndOfStream) && !TSS_doCompare(ssReply.get(), tssReply.get())) { - TEST(true); // TSS mismatch in stream comparison + CODE_PROBE(true, "TSS mismatch in stream comparison"); TraceEvent mismatchEvent( - (g_network->isSimulated() && g_simulator.tssMode == ISimulator::TSSMode::EnabledDropMutations) + (g_network->isSimulated() && g_simulator->tssMode == ISimulator::TSSMode::EnabledDropMutations) ? SevWarnAlways : SevError, TSS_mismatchTraceName(request)); @@ -4699,10 +4985,11 @@ static Future tssStreamComparison(Request request, if (tssData.metrics->shouldRecordDetailedMismatch()) { TSS_traceMismatch(mismatchEvent, request, ssReply.get(), tssReply.get()); - TEST(FLOW_KNOBS - ->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL); // Tracing Full TSS Mismatch in stream comparison - TEST(!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL); // Tracing Partial TSS Mismatch in stream - // comparison and storing the rest in FDB + CODE_PROBE(FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL, + "Tracing Full TSS Mismatch in stream comparison", + probe::decoration::rare); + CODE_PROBE(!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL, + "Tracing Partial TSS Mismatch in stream comparison and storing the rest in FDB"); if (!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL) { mismatchEvent.disable(); @@ -4711,7 +4998,7 @@ static Future tssStreamComparison(Request request, // record a summarized trace event instead TraceEvent summaryEvent((g_network->isSimulated() && - g_simulator.tssMode == ISimulator::TSSMode::EnabledDropMutations) + g_simulator->tssMode == ISimulator::TSSMode::EnabledDropMutations) ? SevWarnAlways : SevError, TSS_mismatchTraceName(request)); @@ -4735,14 +5022,14 @@ static Future tssStreamComparison(Request request, // Currently only used for GetKeyValuesStream but could easily be plugged for other stream types // User of the stream has to forward the SS's responses to the returned promise stream, if it is set -template +template Optional> -maybeDuplicateTSSStreamFragment(Request& req, QueueModel* model, RequestStream const* ssStream) { +maybeDuplicateTSSStreamFragment(Request& req, QueueModel* model, RequestStream const* ssStream) { if (model) { Optional tssData = model->getTssData(ssStream->getEndpoint().token.first()); if (tssData.present()) { - TEST(true); // duplicating stream to TSS + CODE_PROBE(true, "duplicating stream to TSS"); resetReply(req); // FIXME: optimize to avoid creating new netNotifiedQueueWithAcknowledgements for each stream duplication RequestStream tssRequestStream(tssData.get().endpoint); @@ -4759,12 +5046,11 @@ maybeDuplicateTSSStreamFragment(Request& req, QueueModel* model, RequestStream getRangeStreamFragment(Reference trState, ParallelStream::Fragment* results, - Version version, KeyRange keys, GetRangeLimits limits, Snapshot snapshot, Reverse reverse, - SpanID spanContext) { + SpanContext spanContext) { loop { state std::vector locations = wait(getKeyRangeLocations(trState, @@ -4772,8 +5058,7 @@ ACTOR Future getRangeStreamFragment(Reference trState, CLIENT_KNOBS->GET_RANGE_SHARD_LIMIT, reverse, &StorageServerInterface::getKeyValuesStream, - UseTenant::True, - version)); + UseTenant::True)); ASSERT(locations.size()); state int shard = 0; loop { @@ -4782,14 +5067,15 @@ ACTOR Future getRangeStreamFragment(Reference trState, state Optional> tssDuplicateStream; state GetKeyValuesStreamRequest req; req.tenantInfo = trState->getTenantInfo(); - req.version = version; + req.version = trState->readVersion(); req.begin = firstGreaterOrEqual(range.begin); req.end = firstGreaterOrEqual(range.end); req.spanContext = spanContext; req.limit = reverse ? -CLIENT_KNOBS->REPLY_BYTE_LIMIT : CLIENT_KNOBS->REPLY_BYTE_LIMIT; req.limitBytes = std::numeric_limits::max(); - trState->cx->getLatestCommitVersions( - locations[shard].locations, req.version, trState, req.ssLatestCommitVersions); + req.options = trState->readOptions; + + trState->cx->getLatestCommitVersions(locations[shard].locations, trState, req.ssLatestCommitVersions); // keep shard's arena around in case of async tss comparison req.arena.dependsOn(range.arena()); @@ -4798,12 +5084,12 @@ ACTOR Future getRangeStreamFragment(Reference trState, // FIXME: buggify byte limits on internal functions that use them, instead of globally req.tags = trState->cx->sampleReadTags() ? trState->options.readTags : Optional(); - req.debugID = trState->debugID; try { - if (trState->debugID.present()) { - g_traceBatch.addEvent( - "TransactionDebug", trState->debugID.get().first(), "NativeAPI.RangeStream.Before"); + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) { + g_traceBatch.addEvent("TransactionDebug", + trState->readOptions.get().debugID.get().first(), + "NativeAPI.RangeStream.Before"); } ++trState->cx->transactionPhysicalReads; state GetKeyValuesStreamReply rep; @@ -4899,9 +5185,10 @@ ACTOR Future getRangeStreamFragment(Reference trState, } rep = GetKeyValuesStreamReply(); } - if (trState->debugID.present()) - g_traceBatch.addEvent( - "TransactionDebug", trState->debugID.get().first(), "NativeAPI.getExactRange.After"); + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) + g_traceBatch.addEvent("TransactionDebug", + trState->readOptions.get().debugID.get().first(), + "NativeAPI.getExactRange.After"); RangeResult output(RangeResultRef(rep.data, rep.more), rep.arena); if (tssDuplicateStream.present() && !tssDuplicateStream.get().done()) { @@ -4941,7 +5228,7 @@ ACTOR Future getRangeStreamFragment(Reference trState, .detail("BlockBytes", rep.data.expectedSize()); ASSERT(false); } - TEST(true); // GetKeyValuesStreamReply.more in getRangeStream + CODE_PROBE(true, "GetKeyValuesStreamReply.more in getRangeStream"); // Make next request to the same shard with a beginning key just after the last key returned if (reverse) locations[shard].range = @@ -4969,7 +5256,10 @@ ACTOR Future getRangeStreamFragment(Reference trState, output.readThroughEnd = true; } output.arena().dependsOn(keys.arena()); - output.readThrough = reverse ? keys.begin : keys.end; + // for getRangeStreamFragment, one fragment end doesn't mean it's the end of getRange + // so set 'more' to true + output.more = true; + output.setReadThrough(reverse ? keys.begin : keys.end); results->send(std::move(output)); results->finish(); if (tssDuplicateStream.present() && !tssDuplicateStream.get().done()) { @@ -4983,7 +5273,9 @@ ACTOR Future getRangeStreamFragment(Reference trState, ++shard; } output.arena().dependsOn(range.arena()); - output.readThrough = reverse ? range.begin : range.end; + // if it's not the last shard, set more to true and readThrough to the shard boundary + output.more = true; + output.setReadThrough(reverse ? range.begin : range.end); results->send(std::move(output)); break; } @@ -5009,7 +5301,7 @@ ACTOR Future getRangeStreamFragment(Reference trState, throw; } if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || - e.code() == error_code_connection_failed) { + e.code() == error_code_connection_failed || e.code() == error_code_request_maybe_delivered) { const KeyRangeRef& range = locations[shard].range; if (reverse) @@ -5017,15 +5309,10 @@ ACTOR Future getRangeStreamFragment(Reference trState, else keys = KeyRangeRef(range.begin, keys.end); - trState->cx->invalidateCache(locations[0].tenantEntry.prefix, keys); + trState->cx->invalidateCache(trState->tenant().mapRef(&Tenant::prefix), keys); wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, trState->taskID)); break; - } else if (e.code() == error_code_unknown_tenant) { - ASSERT(trState->tenant().present()); - trState->cx->invalidateCachedTenant(trState->tenant().get()); - wait(delay(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, trState->taskID)); - break; } else { results->sendError(e); return Void(); @@ -5037,8 +5324,7 @@ ACTOR Future getRangeStreamFragment(Reference trState, ACTOR Future>> getRangeSplitPoints(Reference trState, KeyRange keys, - int64_t chunkSize, - Version version); + int64_t chunkSize); static KeyRange intersect(KeyRangeRef lhs, KeyRangeRef rhs) { return KeyRange(KeyRangeRef(std::max(lhs.begin, rhs.begin), std::min(lhs.end, rhs.end))); @@ -5048,7 +5334,6 @@ static KeyRange intersect(KeyRangeRef lhs, KeyRangeRef rhs) { // the client get them in order ACTOR Future getRangeStream(Reference trState, PromiseStream _results, - Future fVersion, KeySelector begin, KeySelector end, GetRangeLimits limits, @@ -5059,13 +5344,13 @@ ACTOR Future getRangeStream(Reference trState, // FIXME: better handling to disable row limits ASSERT(!limits.hasRowLimit()); - state Span span("NAPI:getRangeStream"_loc, trState->spanID); + state Span span("NAPI:getRangeStream"_loc, trState->spanContext); - state Version version = wait(fVersion); - trState->cx->validateVersion(version); + wait(trState->startTransaction()); + trState->cx->validateVersion(trState->readVersion()); - Future fb = resolveKey(trState, begin, version, UseTenant::True); - state Future fe = resolveKey(trState, end, version, UseTenant::True); + Future fb = resolveKey(trState, begin, UseTenant::True); + state Future fe = resolveKey(trState, end, UseTenant::True); state Key b = wait(fb); state Key e = wait(fe); @@ -5088,10 +5373,10 @@ ACTOR Future getRangeStream(Reference trState, state std::vector> outstandingRequests; while (b < e) { state KeyRangeLocationInfo locationInfo = wait(getKeyLocation( - trState, reverse ? e : b, &StorageServerInterface::getKeyValuesStream, reverse, UseTenant::True, version)); + trState, reverse ? e : b, &StorageServerInterface::getKeyValuesStream, reverse, UseTenant::True)); state KeyRange shardIntersection = intersect(locationInfo.range, KeyRangeRef(b, e)); state Standalone> splitPoints = - wait(getRangeSplitPoints(trState, shardIntersection, CLIENT_KNOBS->RANGESTREAM_FRAGMENT_SIZE, version)); + wait(getRangeSplitPoints(trState, shardIntersection, CLIENT_KNOBS->RANGESTREAM_FRAGMENT_SIZE)); state std::vector toSend; // state std::vector::iterator>> outstandingRequests; @@ -5113,8 +5398,8 @@ ACTOR Future getRangeStream(Reference trState, continue; } ParallelStream::Fragment* fragment = wait(results.createFragment()); - outstandingRequests.push_back(getRangeStreamFragment( - trState, fragment, version, toSend[useIdx], limits, snapshot, reverse, span.context)); + outstandingRequests.push_back( + getRangeStreamFragment(trState, fragment, toSend[useIdx], limits, snapshot, reverse, span.context)); } if (reverse) { e = shardIntersection.begin; @@ -5127,22 +5412,13 @@ ACTOR Future getRangeStream(Reference trState, } Future getRange(Reference const& trState, - Future const& fVersion, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Reverse const& reverse, UseTenant const& useTenant) { - return getRange(trState, - fVersion, - begin, - end, - ""_sr, - limits, - Promise>(), - Snapshot::True, - reverse, - useTenant); + return getRange( + trState, begin, end, ""_sr, limits, Promise>(), Snapshot::True, reverse, useTenant); } bool DatabaseContext::debugUseTags = false; @@ -5176,13 +5452,13 @@ void debugAddTags(Reference trState) { Transaction::Transaction() : trState(makeReference(TaskPriority::DefaultEndpoint, generateSpanID(false))) {} -Transaction::Transaction(Database const& cx, Optional const& tenant) +Transaction::Transaction(Database const& cx, Optional> const& tenant) : trState(makeReference(cx, tenant, cx->taskID, generateSpanID(cx->transactionTracingSample), createTrLogInfoProbabilistically(cx))), - span(trState->spanID, "Transaction"_loc), backoff(CLIENT_KNOBS->DEFAULT_BACKOFF), tr(trState->spanID) { + span(trState->spanContext, "Transaction"_loc), backoff(CLIENT_KNOBS->DEFAULT_BACKOFF), tr(trState->spanContext) { if (DatabaseContext::debugUseTags) { debugAddTags(trState); } @@ -5196,9 +5472,7 @@ Transaction::~Transaction() { void Transaction::operator=(Transaction&& r) noexcept { flushTrLogsIfEnabled(); tr = std::move(r.tr); - readVersion = std::move(r.readVersion); trState = std::move(r.trState); - metadataVersion = std::move(r.metadataVersion); extraConflictRanges = std::move(r.extraConflictRanges); commitResult = std::move(r.commitResult); committing = std::move(r.committing); @@ -5221,12 +5495,12 @@ VersionVector Transaction::getVersionVector() const { void Transaction::setVersion(Version v) { trState->startTime = now(); - if (readVersion.isValid()) + if (trState->readVersionFuture.isValid()) throw read_version_already_set(); if (v <= 0) throw version_invalid(); - readVersion = v; + trState->readVersionFuture = v; trState->readVersionObtainedFromGrvProxy = false; } @@ -5254,11 +5528,12 @@ Future> Transaction::get(const Key& key, Snapshot snapshot) { // This will return the global metadata version key. useTenant = UseTenant::False; ++trState->cx->transactionMetadataVersionReads; - if (!ver.isReady() || metadataVersion.isSet()) { - return metadataVersion.getFuture(); + if (!ver.isReady() || trState->metadataVersion.isSet()) { + return trState->metadataVersion.getFuture(); } else { - if (ver.isError()) + if (ver.isError()) { return ver.getError(); + } if (ver.get() == trState->cx->metadataVersionCache[trState->cx->mvCacheInsertLocation].first) { return trState->cx->metadataVersionCache[trState->cx->mvCacheInsertLocation].second; } @@ -5286,7 +5561,7 @@ Future> Transaction::get(const Key& key, Snapshot snapshot) { } } - return getValue(trState, key, ver, useTenant); + return getValue(trState, key, useTenant); } void Watch::setWatch(Future watchFuture) { @@ -5296,20 +5571,47 @@ void Watch::setWatch(Future watchFuture) { onSetWatchTrigger.send(Void()); } -ACTOR Future getTenantMetadata(Reference trState, Key key, Version version) { - KeyRangeLocationInfo locationInfo = - wait(getKeyLocation(trState, key, &StorageServerInterface::getValue, Reverse::False, UseTenant::True, version)); +ACTOR Future getTenantMetadata(Reference trState) { + wait(trState->startTransaction()); return trState->getTenantInfo(); } -Future populateAndGetTenant(Reference trState, Key const& key, Version version) { - if (!trState->tenant().present() || key == metadataVersionKey) { +Future populateAndGetTenant(Reference trState, Key const& key) { + if (!trState->hasTenant() || key == metadataVersionKey) { return TenantInfo(); - } else if (trState->tenantId != TenantInfo::INVALID_TENANT) { + } else if (trState->startTransaction().canGet()) { return trState->getTenantInfo(); } else { - return getTenantMetadata(trState, key, version); - } + return getTenantMetadata(trState); + } +} + +// Restarts a watch after a database switch +ACTOR Future restartWatch(Database cx, + TenantInfo tenantInfo, + Key key, + Optional value, + TagSet tags, + SpanContext spanContext, + TaskPriority taskID, + Optional debugID, + UseProvisionalProxies useProvisionalProxies) { + // Remove the reference count as the old watches should be all dropped when switching connectionFile. + // The tenantId should be the old one. + cx->deleteWatchMetadata(tenantInfo.tenantId, key, /* removeReferenceCount */ true); + + wait(watchValueMap(cx->minAcceptableReadVersion, + tenantInfo, + key, + value, + cx, + tags, + spanContext, + taskID, + debugID, + useProvisionalProxies)); + + return Void(); } // FIXME: This seems pretty horrible. Now a Database can't die until all of its watches do... @@ -5317,7 +5619,7 @@ ACTOR Future watch(Reference watch, Database cx, Future tenant, TagSet tags, - SpanID spanID, + SpanContext spanContext, TaskPriority taskID, Optional debugID, UseProvisionalProxies useProvisionalProxies) { @@ -5339,29 +5641,27 @@ ACTOR Future watch(Reference watch, } when(wait(cx->connectionFileChanged())) { - TEST(true); // Recreated a watch after switch - cx->clearWatchMetadata(); - watch->watchFuture = watchValueMap(cx->minAcceptableReadVersion, - tenantInfo, - watch->key, - watch->value, - cx, - tags, - spanID, - taskID, - debugID, - useProvisionalProxies); + CODE_PROBE(true, "Recreated a watch after switch"); + watch->watchFuture = restartWatch(cx, + tenantInfo, + watch->key, + watch->value, + tags, + spanContext, + taskID, + debugID, + useProvisionalProxies); } } } } } } catch (Error& e) { - cx->removeWatch(); + cx->decreaseWatchCounter(); throw; } - cx->removeWatch(); + cx->decreaseWatchCounter(); return Void(); } @@ -5372,51 +5672,41 @@ Future Transaction::getRawReadVersion() { Future Transaction::watch(Reference watch) { ++trState->cx->transactionWatchRequests; - trState->cx->addWatch(); + trState->cx->increaseWatchCounter(); + watch->readOptions = trState->readOptions; watches.push_back(watch); - return ::watch( - watch, - trState->cx, - populateAndGetTenant( - trState, watch->key, readVersion.isValid() && readVersion.isReady() ? readVersion.get() : latestVersion), - trState->options.readTags, - trState->spanID, - trState->taskID, - trState->debugID, - trState->useProvisionalProxies); -} - -ACTOR Future>> getAddressesForKeyActor(Reference trState, - Future ver, - Key key) { + return ::watch(watch, + trState->cx, + populateAndGetTenant(trState, watch->key), + trState->options.readTags, + trState->spanContext, + trState->taskID, + trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(), + trState->useProvisionalProxies); +} + +ACTOR Future>> getAddressesForKeyActor(Reference trState, Key key) { state std::vector ssi; + wait(trState->startTransaction()); + state Key resolvedKey = key; - if (trState->tenant().present()) { - state Version version = wait(ver); - KeyRangeLocationInfo locationInfo = wait(getKeyLocation( - trState, ""_sr, &StorageServerInterface::getValue, Reverse::False, UseTenant::True, version)); - resolvedKey = key.withPrefix(locationInfo.tenantEntry.prefix); + if (trState->hasTenant()) { + resolvedKey = key.withPrefix(trState->tenant().get()->prefix()); } // If key >= allKeys.end, then getRange will return a kv-pair with an empty value. This will result in our // serverInterfaces vector being empty, which will cause us to return an empty addresses list. state Key ksKey = keyServersKey(resolvedKey); state RangeResult serverTagResult = wait(getRange(trState, - ver, lastLessOrEqual(serverTagKeys.begin), firstGreaterThan(serverTagKeys.end), GetRangeLimits(CLIENT_KNOBS->TOO_MANY), Reverse::False, UseTenant::False)); ASSERT(!serverTagResult.more && serverTagResult.size() < CLIENT_KNOBS->TOO_MANY); - Future futureServerUids = getRange(trState, - ver, - lastLessOrEqual(ksKey), - firstGreaterThan(ksKey), - GetRangeLimits(1), - Reverse::False, - UseTenant::False); + Future futureServerUids = getRange( + trState, lastLessOrEqual(ksKey), firstGreaterThan(ksKey), GetRangeLimits(1), Reverse::False, UseTenant::False); RangeResult serverUids = wait(futureServerUids); ASSERT(serverUids.size()); // every shard needs to have a team @@ -5427,7 +5717,7 @@ ACTOR Future>> getAddressesForKeyActor(Referen // the move is finished, because it could be cancelled at any time. decodeKeyServersValue(serverTagResult, serverUids[0].value, src, ignore); Optional> serverInterfaces = - wait(transactionalGetServerInterfaces(trState, ver, src)); + wait(transactionalGetServerInterfaces(trState, src)); ASSERT(serverInterfaces.present()); // since this is happening transactionally, /FF/keyServers and /FF/serverList // need to be consistent with one another @@ -5446,17 +5736,14 @@ ACTOR Future>> getAddressesForKeyActor(Referen Future>> Transaction::getAddressesForKey(const Key& key) { ++trState->cx->transactionLogicalReads; ++trState->cx->transactionGetAddressesForKeyRequests; - auto ver = getReadVersion(); - - return getAddressesForKeyActor(trState, ver, key); + return getAddressesForKeyActor(trState, key); } ACTOR Future getKeyAndConflictRange(Reference trState, KeySelector k, - Future version, Promise> conflictRange) { try { - Key rep = wait(getKey(trState, k, version)); + Key rep = wait(getKey(trState, k)); if (k.offset <= 0) conflictRange.send(std::make_pair(rep, k.orEqual ? keyAfter(k.getKey()) : Key(k.getKey(), k.arena()))); else @@ -5473,11 +5760,11 @@ Future Transaction::getKey(const KeySelector& key, Snapshot snapshot) { ++trState->cx->transactionLogicalReads; ++trState->cx->transactionGetKeyRequests; if (snapshot) - return ::getKey(trState, key, getReadVersion()); + return ::getKey(trState, key); Promise> conflictRange; extraConflictRanges.push_back(conflictRange.getFuture()); - return getKeyAndConflictRange(trState, key, getReadVersion(), conflictRange); + return getKeyAndConflictRange(trState, key, conflictRange); } template @@ -5511,18 +5798,18 @@ Future Transaction::getRangeInternal(const KeySelector& begin KeySelector b = begin; if (b.orEqual) { - TEST(true); // Native begin orEqual==true + CODE_PROBE(true, "Native begin orEqual==true"); b.removeOrEqual(b.arena()); } KeySelector e = end; if (e.orEqual) { - TEST(true); // Native end orEqual==true + CODE_PROBE(true, "Native end orEqual==true"); e.removeOrEqual(e.arena()); } if (b.offset >= e.offset && b.getKey() >= e.getKey()) { - TEST(true); // Native range inverted + CODE_PROBE(true, "Native range inverted"); return RangeResultFamily(); } @@ -5538,7 +5825,7 @@ Future Transaction::getRangeInternal(const KeySelector& begin } return ::getRange( - trState, getReadVersion(), b, e, mapper, limits, conflictRange, snapshot, reverse); + trState, b, e, mapper, limits, conflictRange, snapshot, reverse); } Future Transaction::getRange(const KeySelector& begin, @@ -5570,7 +5857,7 @@ Future Transaction::getRange(const KeySelector& begin, // A method for streaming data from the storage server that is more efficient than getRange when reading large amounts // of data -Future Transaction::getRangeStream(const PromiseStream& results, +Future Transaction::getRangeStream(PromiseStream& results, const KeySelector& begin, const KeySelector& end, GetRangeLimits limits, @@ -5584,18 +5871,18 @@ Future Transaction::getRangeStream(const PromiseStream& resul KeySelector b = begin; if (b.orEqual) { - TEST(true); // Native stream begin orEqual==true + CODE_PROBE(true, "Native stream begin orEqual==true", probe::decoration::rare); b.removeOrEqual(b.arena()); } KeySelector e = end; if (e.orEqual) { - TEST(true); // Native stream end orEqual==true + CODE_PROBE(true, "Native stream end orEqual==true", probe::decoration::rare); e.removeOrEqual(e.arena()); } if (b.offset >= e.offset && b.getKey() >= e.getKey()) { - TEST(true); // Native stream range inverted + CODE_PROBE(true, "Native stream range inverted", probe::decoration::rare); results.sendError(end_of_stream()); return Void(); } @@ -5605,11 +5892,10 @@ Future Transaction::getRangeStream(const PromiseStream& resul extraConflictRanges.push_back(conflictRange.getFuture()); } - return forwardErrors( - ::getRangeStream(trState, results, getReadVersion(), b, e, limits, conflictRange, snapshot, reverse), results); + return forwardErrors(::getRangeStream(trState, results, b, e, limits, conflictRange, snapshot, reverse), results); } -Future Transaction::getRangeStream(const PromiseStream& results, +Future Transaction::getRangeStream(PromiseStream& results, const KeySelector& begin, const KeySelector& end, int limit, @@ -5646,7 +5932,7 @@ void Transaction::addReadConflictRange(KeyRangeRef const& keys) { void Transaction::makeSelfConflicting() { BinaryWriter wr(Unversioned()); - wr.serializeBytes(LiteralStringRef("\xFF/SC/")); + wr.serializeBytes("\xFF/SC/"_sr); wr << deterministicRandom()->randomUniqueID(); auto r = singleKeyRange(wr.toValue(), tr.arena); tr.transaction.read_conflict_ranges.push_back(tr.arena, r); @@ -5665,6 +5951,7 @@ void Transaction::set(const KeyRef& key, const ValueRef& value, AddConflictRange auto r = singleKeyRange(key, req.arena); auto v = ValueRef(req.arena, value); t.mutations.emplace_back(req.arena, MutationRef::SetValue, r.begin, v); + trState->totalCost += getWriteOperationCost(key.expectedSize() + value.expectedSize()); if (addConflictRange) { t.write_conflict_ranges.push_back(req.arena, r); @@ -5694,11 +5981,12 @@ void Transaction::atomicOp(const KeyRef& key, auto v = ValueRef(req.arena, operand); t.mutations.emplace_back(req.arena, operationType, r.begin, v); + trState->totalCost += getWriteOperationCost(key.expectedSize()); if (addConflictRange && operationType != MutationRef::SetVersionstampedKey) t.write_conflict_ranges.push_back(req.arena, r); - TEST(true); // NativeAPI atomic operation + CODE_PROBE(true, "NativeAPI atomic operation"); } void Transaction::clear(const KeyRangeRef& range, AddConflictRange addConflictRange) { @@ -5725,7 +6013,10 @@ void Transaction::clear(const KeyRangeRef& range, AddConflictRange addConflictRa return; t.mutations.emplace_back(req.arena, MutationRef::ClearRange, r.begin, r.end); - + // NOTE: The throttling cost of each clear is assumed to be one page. + // This makes compuation fast, but can be inaccurate and may + // underestimate the cost of large clears. + trState->totalCost += CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE; if (addConflictRange) t.write_conflict_ranges.push_back(req.arena, r); } @@ -5784,7 +6075,7 @@ double Transaction::getBackoff(int errCode) { if (priorityItr != trState->cx->throttledTags.end()) { auto tagItr = priorityItr->second.find(tag); if (tagItr != priorityItr->second.end()) { - TEST(true); // Returning throttle backoff + CODE_PROBE(true, "Returning throttle backoff"); returnedBackoff = std::max( returnedBackoff, std::min(CLIENT_KNOBS->TAG_THROTTLE_RECHECK_INTERVAL, tagItr->second.throttleDuration())); @@ -5799,7 +6090,9 @@ double Transaction::getBackoff(int errCode) { returnedBackoff *= deterministicRandom()->random01(); // Set backoff for next time - if (errCode == error_code_proxy_memory_limit_exceeded) { + if (errCode == error_code_commit_proxy_memory_limit_exceeded || + errCode == error_code_grv_proxy_memory_limit_exceeded) { + backoff = std::min(backoff * CLIENT_KNOBS->BACKOFF_GROWTH_RATE, CLIENT_KNOBS->RESOURCE_CONSTRAINED_MAX_BACKOFF); } else { backoff = std::min(backoff * CLIENT_KNOBS->BACKOFF_GROWTH_RATE, trState->options.maxBackoff); @@ -5836,6 +6129,7 @@ void TransactionOptions::clear() { useGrvCache = false; skipGrvCache = false; rawAccess = false; + bypassStorageQuota = false; } TransactionOptions::TransactionOptions() { @@ -5853,22 +6147,24 @@ void TransactionOptions::reset(Database const& cx) { void Transaction::resetImpl(bool generateNewSpan) { flushTrLogsIfEnabled(); trState = trState->cloneAndReset(createTrLogInfoProbabilistically(trState->cx), generateNewSpan); - tr = CommitTransactionRequest(trState->spanID); - readVersion = Future(); - metadataVersion = Promise>(); + tr = CommitTransactionRequest(trState->spanContext); extraConflictRanges.clear(); commitResult = Promise(); committing = Future(); cancelWatches(); } +TagSet const& Transaction::getTags() const { + return trState->options.tags; +} + void Transaction::reset() { resetImpl(false); } void Transaction::fullReset() { resetImpl(true); - span = Span(trState->spanID, "Transaction"_loc); + span = Span(trState->spanContext, "Transaction"_loc); backoff = CLIENT_KNOBS->DEFAULT_BACKOFF; } @@ -5986,17 +6282,27 @@ ACTOR void checkWrites(Reference trState, } } -ACTOR static Future commitDummyTransaction(Reference trState, KeyRange range) { - state Transaction tr(trState->cx); +FDB_BOOLEAN_PARAM(TenantPrefixPrepended); + +ACTOR static Future commitDummyTransaction(Reference trState, + KeyRange range, + TenantPrefixPrepended tenantPrefixPrepended) { + state Transaction tr(trState->cx, trState->tenant()); state int retries = 0; - state Span span("NAPI:dummyTransaction"_loc, trState->spanID); - tr.span.addParent(span.context); + state Span span("NAPI:dummyTransaction"_loc, trState->spanContext); + tr.span.setParent(span.context); loop { try { TraceEvent("CommitDummyTransaction").detail("Key", range.begin).detail("Retries", retries); tr.trState->options = trState->options; tr.trState->taskID = trState->taskID; - tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr.trState->authToken = trState->authToken; + if (!trState->hasTenant()) { + tr.setOption(FDBTransactionOptions::RAW_ACCESS); + } else { + tr.trState->skipApplyTenantPrefix = tenantPrefixPrepended; + CODE_PROBE(true, "Commit of a dummy transaction in tenant keyspace"); + } tr.setOption(FDBTransactionOptions::CAUSAL_WRITE_RISKY); tr.setOption(FDBTransactionOptions::LOCK_AWARE); tr.addReadConflictRange(range); @@ -6004,6 +6310,10 @@ ACTOR static Future commitDummyTransaction(Reference trS wait(tr.commit()); return Void(); } catch (Error& e) { + // If the tenant is gone, then our original transaction won't be able to commit + if (e.code() == error_code_tenant_not_found) { + return Void(); + } TraceEvent("CommitDummyTransactionError") .errorUnsuppressed(e) .detail("Key", range.begin) @@ -6014,6 +6324,70 @@ ACTOR static Future commitDummyTransaction(Reference trS } } +ACTOR static Future> determineCommitStatus(Reference trState, + Version minPossibleCommitVersion, + Version maxPossibleCommitVersion, + IdempotencyIdRef idempotencyId) { + state Transaction tr(trState->cx); + state int retries = 0; + state Version expiredVersion; + state Span span("NAPI:determineCommitStatus"_loc, trState->spanContext); + tr.span.setParent(span.context); + loop { + try { + tr.trState->options = trState->options; + tr.trState->taskID = trState->taskID; + tr.trState->authToken = trState->authToken; + tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::READ_LOCK_AWARE); + KeyBackedObjectProperty expiredKey(idempotencyIdsExpiredVersion, + Unversioned()); + IdempotencyIdsExpiredVersion expiredVal = wait(expiredKey.getD(&tr)); + expiredVersion = expiredVal.expired; + if (expiredVersion >= minPossibleCommitVersion) { + throw commit_unknown_result_fatal(); + } + Version rv = wait(tr.getReadVersion()); + TraceEvent("DetermineCommitStatusAttempt") + .detail("IdempotencyId", idempotencyId.asStringRefUnsafe()) + .detail("Retries", retries) + .detail("ReadVersion", rv) + .detail("ExpiredVersion", expiredVersion) + .detail("MinPossibleCommitVersion", minPossibleCommitVersion) + .detail("MaxPossibleCommitVersion", maxPossibleCommitVersion); + KeyRange possibleRange = + KeyRangeRef(BinaryWriter::toValue(bigEndian64(minPossibleCommitVersion), Unversioned()) + .withPrefix(idempotencyIdKeys.begin), + BinaryWriter::toValue(bigEndian64(maxPossibleCommitVersion + 1), Unversioned()) + .withPrefix(idempotencyIdKeys.begin)); + RangeResult range = wait(tr.getRange(possibleRange, CLIENT_KNOBS->TOO_MANY)); + ASSERT(!range.more); + for (const auto& kv : range) { + auto commitResult = kvContainsIdempotencyId(kv, idempotencyId); + if (commitResult.present()) { + TraceEvent("DetermineCommitStatus") + .detail("Committed", 1) + .detail("IdempotencyId", idempotencyId.asStringRefUnsafe()) + .detail("Retries", retries); + return commitResult; + } + } + TraceEvent("DetermineCommitStatus") + .detail("Committed", 0) + .detail("IdempotencyId", idempotencyId.asStringRefUnsafe()) + .detail("Retries", retries); + return Optional(); + } catch (Error& e) { + TraceEvent("DetermineCommitStatusError") + .errorUnsuppressed(e) + .detail("IdempotencyId", idempotencyId.asStringRefUnsafe()) + .detail("Retries", retries); + wait(tr.onError(e)); + } + ++retries; + } +} + void Transaction::cancelWatches(Error const& e) { for (int i = 0; i < watches.size(); ++i) if (!watches[i]->onChangeTrigger.isSet()) @@ -6027,16 +6401,17 @@ void Transaction::setupWatches() { Future watchVersion = getCommittedVersion() > 0 ? getCommittedVersion() : getReadVersion(); for (int i = 0; i < watches.size(); ++i) - watches[i]->setWatch(watchValueMap(watchVersion, - trState->getTenantInfo(), - watches[i]->key, - watches[i]->value, - trState->cx, - trState->options.readTags, - trState->spanID, - trState->taskID, - trState->debugID, - trState->useProvisionalProxies)); + watches[i]->setWatch( + watchValueMap(watchVersion, + trState->getTenantInfo(), + watches[i]->key, + watches[i]->value, + trState->cx, + trState->options.readTags, + trState->spanContext, + trState->taskID, + trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(), + trState->useProvisionalProxies)); watches.clear(); } catch (Error&) { @@ -6052,29 +6427,31 @@ ACTOR Future> estimateCommitCosts(Referen state int i = 0; for (; i < transaction->mutations.size(); ++i) { - auto* it = &transaction->mutations[i]; + auto const& mutation = transaction->mutations[i]; - if (it->type == MutationRef::Type::SetValue || it->isAtomicOp()) { + if (mutation.type == MutationRef::Type::SetValue || mutation.isAtomicOp()) { trCommitCosts.opsCount++; - trCommitCosts.writeCosts += getWriteOperationCost(it->expectedSize()); - } else if (it->type == MutationRef::Type::ClearRange) { + trCommitCosts.writeCosts += getWriteOperationCost(mutation.expectedSize()); + } else if (mutation.type == MutationRef::Type::ClearRange) { trCommitCosts.opsCount++; - keyRange = KeyRangeRef(it->param1, it->param2); + keyRange = KeyRangeRef(mutation.param1, mutation.param2); if (trState->options.expensiveClearCostEstimation) { - StorageMetrics m = wait(trState->cx->getStorageMetrics(keyRange, CLIENT_KNOBS->TOO_MANY)); + StorageMetrics m = wait(trState->cx->getStorageMetrics(keyRange, CLIENT_KNOBS->TOO_MANY, trState)); trCommitCosts.clearIdxCosts.emplace_back(i, getWriteOperationCost(m.bytes)); trCommitCosts.writeCosts += getWriteOperationCost(m.bytes); ++trCommitCosts.expensiveCostEstCount; ++trState->cx->transactionsExpensiveClearCostEstCount; } else { + if (trState->hasTenant()) { + wait(trState->tenant().get()->ready()); + } std::vector locations = wait(getKeyRangeLocations(trState, keyRange, CLIENT_KNOBS->TOO_MANY, Reverse::False, &StorageServerInterface::getShardState, - UseTenant::True, - latestVersion)); + UseTenant::True)); if (locations.empty()) { continue; } @@ -6125,69 +6502,92 @@ ACTOR Future> estimateCommitCosts(Referen // TODO: send the prefix as part of the commit request and ship it all the way // through to the storage servers void applyTenantPrefix(CommitTransactionRequest& req, Key tenantPrefix) { + VectorRef updatedMutations; + updatedMutations.reserve(req.arena, req.transaction.mutations.size()); for (auto& m : req.transaction.mutations) { + StringRef param1 = m.param1; + StringRef param2 = m.param2; if (m.param1 != metadataVersionKey) { - m.param1 = m.param1.withPrefix(tenantPrefix, req.arena); + param1 = m.param1.withPrefix(tenantPrefix, req.arena); if (m.type == MutationRef::ClearRange) { - m.param2 = m.param2.withPrefix(tenantPrefix, req.arena); + param2 = m.param2.withPrefix(tenantPrefix, req.arena); } else if (m.type == MutationRef::SetVersionstampedKey) { - uint8_t* key = mutateString(m.param1); - int* offset = reinterpret_cast(&key[m.param1.size() - 4]); + uint8_t* key = mutateString(param1); + int* offset = reinterpret_cast(&key[param1.size() - 4]); *offset += tenantPrefix.size(); } } + updatedMutations.push_back(req.arena, MutationRef(MutationRef::Type(m.type), param1, param2)); } + req.transaction.mutations = updatedMutations; - for (auto& rc : req.transaction.read_conflict_ranges) { + VectorRef updatedReadConflictRanges; + updatedReadConflictRanges.reserve(req.arena, req.transaction.read_conflict_ranges.size()); + for (auto const& rc : req.transaction.read_conflict_ranges) { if (rc.begin != metadataVersionKey) { - rc = rc.withPrefix(tenantPrefix, req.arena); + updatedReadConflictRanges.push_back(req.arena, rc.withPrefix(tenantPrefix, req.arena)); + } else { + updatedReadConflictRanges.push_back(req.arena, rc); } } + req.transaction.read_conflict_ranges = updatedReadConflictRanges; + VectorRef updatedWriteConflictRanges; + updatedWriteConflictRanges.reserve(req.arena, req.transaction.write_conflict_ranges.size()); for (auto& wc : req.transaction.write_conflict_ranges) { if (wc.begin != metadataVersionKey) { - wc = wc.withPrefix(tenantPrefix, req.arena); + updatedWriteConflictRanges.push_back(req.arena, wc.withPrefix(tenantPrefix, req.arena)); + } else { + updatedWriteConflictRanges.push_back(req.arena, wc); } } + req.transaction.write_conflict_ranges = updatedWriteConflictRanges; } -ACTOR static Future tryCommit(Reference trState, - CommitTransactionRequest req, - Future readVersion) { +ACTOR static Future tryCommit(Reference trState, CommitTransactionRequest req) { state TraceInterval interval("TransactionCommit"); state double startTime = now(); - state Span span("NAPI:tryCommit"_loc, trState->spanID); - state Optional debugID = trState->debugID; + state Span span("NAPI:tryCommit"_loc, trState->spanContext); + state Optional debugID = trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(); + state TenantPrefixPrepended tenantPrefixPrepended = TenantPrefixPrepended::False; if (debugID.present()) { TraceEvent(interval.begin()).detail("Parent", debugID.get()); } + + // If the read version hasn't already been fetched, then we had no reads and don't need (expensive) full causal + // consistency. + state Future startFuture = trState->startTransaction(GetReadVersionRequest::FLAG_CAUSAL_READ_RISKY); + try { if (CLIENT_BUGGIFY) { - throw deterministicRandom()->randomChoice(std::vector{ - not_committed(), transaction_too_old(), proxy_memory_limit_exceeded(), commit_unknown_result() }); + throw deterministicRandom()->randomChoice(std::vector{ not_committed(), + transaction_too_old(), + commit_proxy_memory_limit_exceeded(), + grv_proxy_memory_limit_exceeded(), + commit_unknown_result() }); } if (req.tagSet.present() && trState->options.priority < TransactionPriority::IMMEDIATE) { - wait(store(req.transaction.read_snapshot, readVersion) && - store(req.commitCostEstimation, estimateCommitCosts(trState, &req.transaction))); + state Future> commitCostFuture = + estimateCommitCosts(trState, &req.transaction); + wait(startFuture); + wait(store(req.commitCostEstimation, commitCostFuture)); } else { - wait(store(req.transaction.read_snapshot, readVersion)); + wait(startFuture); } - state Key tenantPrefix; - if (trState->tenant().present()) { - KeyRangeLocationInfo locationInfo = wait(getKeyLocation(trState, - ""_sr, - &StorageServerInterface::getValue, - Reverse::False, - UseTenant::True, - req.transaction.read_snapshot)); - applyTenantPrefix(req, locationInfo.tenantEntry.prefix); - tenantPrefix = locationInfo.tenantEntry.prefix; - } + req.transaction.read_snapshot = trState->readVersion(); + state Key tenantPrefix; + // skipApplyTenantPrefix is set only in the context of a commitDummyTransaction() + // (see member declaration) + if (trState->hasTenant() && !trState->skipApplyTenantPrefix) { + applyTenantPrefix(req, trState->tenant().get()->prefix()); + tenantPrefixPrepended = TenantPrefixPrepended::True; + tenantPrefix = trState->tenant().get()->prefix(); + } + CODE_PROBE(trState->skipApplyTenantPrefix, "Tenant prefix prepend skipped for dummy transaction"); req.tenantInfo = trState->getTenantInfo(); - startTime = now(); state Optional commitID = Optional(); @@ -6199,6 +6599,12 @@ ACTOR static Future tryCommit(Reference trState, req.debugID = commitID; state Future reply; + // Only gets filled in in the happy path where we don't have to commit on the first proxy or use provisional + // proxies + state int alternativeChosen = -1; + // Only valid if alternativeChosen >= 0 + state Reference proxiesUsed; + if (trState->options.commitOnFirstProxy) { if (trState->cx->clientInfo->get().firstCommitProxy.present()) { reply = throwErrorOr(brokenPromiseToMaybeDelivered( @@ -6209,11 +6615,13 @@ ACTOR static Future tryCommit(Reference trState, : Never(); } } else { - reply = basicLoadBalance(trState->cx->getCommitProxies(trState->useProvisionalProxies), + proxiesUsed = trState->cx->getCommitProxies(trState->useProvisionalProxies); + reply = basicLoadBalance(proxiesUsed, &CommitProxyInterface::commit, req, TaskPriority::DefaultPromiseEndpoint, - AtMostOnce::True); + AtMostOnce::True, + &alternativeChosen); } state double grvTime = now(); choose { @@ -6262,7 +6670,13 @@ ACTOR static Future tryCommit(Reference trState, req.transaction.mutations.expectedSize(), ci.version, req, - trState->tenant())); + trState->tenant().flatMapRef(&Tenant::name))); + if (trState->automaticIdempotency && alternativeChosen >= 0) { + // Automatic idempotency means we're responsible for best effort idempotency id clean up + proxiesUsed->getInterface(alternativeChosen) + .expireIdempotencyId.send(ExpireIdempotencyIdRequest{ + ci.version, uint8_t(ci.txnBatchId >> 8), trState->getTenantInfo() }); + } return Void(); } else { // clear the RYW transaction which contains previous conflicting keys @@ -6298,7 +6712,7 @@ ACTOR static Future tryCommit(Reference trState, if (e.code() == error_code_request_maybe_delivered || e.code() == error_code_commit_unknown_result) { // We don't know if the commit happened, and it might even still be in flight. - if (!trState->options.causalWriteRisky) { + if (!trState->options.causalWriteRisky || req.idempotencyId.valid()) { // Make sure it's not still in flight, either by ensuring the master we submitted to is dead, or the // version we submitted with is dead, or by committing a conflicting transaction successfully // if ( cx->getCommitProxies()->masterGeneration <= originalMasterGeneration ) @@ -6311,29 +6725,51 @@ ACTOR static Future tryCommit(Reference trState, KeyRangeRef selfConflictingRange = intersects(req.transaction.write_conflict_ranges, req.transaction.read_conflict_ranges).get(); - TEST(true); // Waiting for dummy transaction to report commit_unknown_result + CODE_PROBE(true, "Waiting for dummy transaction to report commit_unknown_result"); - wait(commitDummyTransaction(trState, singleKeyRange(selfConflictingRange.begin))); + wait( + commitDummyTransaction(trState, singleKeyRange(selfConflictingRange.begin), tenantPrefixPrepended)); + if (req.idempotencyId.valid()) { + Optional commitResult = wait(determineCommitStatus( + trState, + req.transaction.read_snapshot, + req.transaction.read_snapshot + 5e6 /* Based on MAX_WRITE_TRANSACTION_LIFE_VERSIONS */, + req.idempotencyId)); + if (commitResult.present()) { + Standalone ret = makeString(10); + placeVersionstamp( + mutateString(ret), commitResult.get().commitVersion, commitResult.get().batchIndex); + trState->versionstampPromise.send(ret); + CODE_PROBE(true, "AutomaticIdempotencyCommitted"); + return Void(); + } else { + CODE_PROBE(true, "AutomaticIdempotencyNotCommitted"); + throw transaction_too_old(); + } + } } // The user needs to be informed that we aren't sure whether the commit happened. Standard retry loops // retry it anyway (relying on transaction idempotence) but a client might do something else. throw commit_unknown_result(); - } else if (e.code() == error_code_unknown_tenant) { - ASSERT(trState->tenant().present()); - trState->cx->invalidateCachedTenant(trState->tenant().get()); - throw; } else { if (e.code() != error_code_transaction_too_old && e.code() != error_code_not_committed && - e.code() != error_code_database_locked && e.code() != error_code_proxy_memory_limit_exceeded && + e.code() != error_code_database_locked && e.code() != error_code_commit_proxy_memory_limit_exceeded && + e.code() != error_code_grv_proxy_memory_limit_exceeded && e.code() != error_code_batch_transaction_throttled && e.code() != error_code_tag_throttled && e.code() != error_code_process_behind && e.code() != error_code_future_version && - e.code() != error_code_tenant_not_found) { + e.code() != error_code_tenant_not_found && e.code() != error_code_illegal_tenant_access && + e.code() != error_code_proxy_tag_throttled && e.code() != error_code_storage_quota_exceeded && + e.code() != error_code_tenant_locked) { TraceEvent(SevError, "TryCommitError").error(e); } if (trState->trLogInfo) - trState->trLogInfo->addLog(FdbClientLogEvents::EventCommitError( - startTime, trState->cx->clientLocality.dcId(), static_cast(e.code()), req, trState->tenant())); + trState->trLogInfo->addLog( + FdbClientLogEvents::EventCommitError(startTime, + trState->cx->clientLocality.dcId(), + static_cast(e.code()), + req, + trState->tenant().flatMapRef(&Tenant::name))); throw; } } @@ -6362,7 +6798,7 @@ Future Transaction::commitMutations() { size_t transactionSize = getSize(); if (transactionSize > (uint64_t)FLOW_KNOBS->PACKET_WARNING) { - TraceEvent(!g_network->isSimulated() ? SevWarnAlways : SevWarn, "LargeTransaction") + TraceEvent(SevWarn, "LargeTransaction") .suppressFor(1.0) .detail("Size", transactionSize) .detail("NumMutations", tr.transaction.mutations.size()) @@ -6381,11 +6817,6 @@ Future Transaction::commitMutations() { return transaction_too_large(); } - if (!readVersion.isValid()) - getReadVersion( - GetReadVersionRequest::FLAG_CAUSAL_READ_RISKY); // sets up readVersion field. We had no reads, so no - // need for (expensive) full causal consistency. - bool isCheckingWrites = trState->options.checkWritesEnabled && deterministicRandom()->random01() < 0.01; for (int i = 0; i < extraConflictRanges.size(); i++) if (extraConflictRanges[i].isReady() && @@ -6393,6 +6824,18 @@ Future Transaction::commitMutations() { tr.transaction.read_conflict_ranges.emplace_back( tr.arena, extraConflictRanges[i].get().first, extraConflictRanges[i].get().second); + if (tr.idempotencyId.valid()) { + // We need to be able confirm that this transaction is no longer in + // flight, and if the idempotency id is in the read and write + // conflict range we can use that. + BinaryWriter wr(Unversioned()); + wr.serializeBytes("\xFF/SC/"_sr); + wr.serializeBytes(tr.idempotencyId.asStringRefUnsafe()); + auto r = singleKeyRange(wr.toValue(), tr.arena); + tr.transaction.read_conflict_ranges.push_back(tr.arena, r); + tr.transaction.write_conflict_ranges.push_back(tr.arena, r); + } + if (!trState->options.causalWriteRisky && !intersects(tr.transaction.write_conflict_ranges, tr.transaction.read_conflict_ranges).present()) makeSelfConflicting(); @@ -6419,11 +6862,14 @@ Future Transaction::commitMutations() { if (trState->options.firstInBatch) { tr.flags = tr.flags | CommitTransactionRequest::FLAG_FIRST_IN_BATCH; } + if (trState->options.bypassStorageQuota) { + tr.flags = tr.flags | CommitTransactionRequest::FLAG_BYPASS_STORAGE_QUOTA; + } if (trState->options.reportConflictingKeys) { tr.transaction.report_conflicting_keys = true; } - Future commitResult = tryCommit(trState, tr, readVersion); + Future commitResult = tryCommit(trState, tr); if (isCheckingWrites) { Promise committed; @@ -6484,9 +6930,9 @@ void Transaction::setOption(FDBTransactionOptions::Option option, OptionalreadVersionFuture.isValid()) throw read_version_already_set(); - readVersion = Version(0); + trState->readVersionFuture = Version(0); trState->options.causalWriteRisky = true; break; @@ -6551,10 +6997,10 @@ void Transaction::setOption(FDBTransactionOptions::Option option, Optional(value.get().printable(), TransactionLogInfo::DONT_LOG); trState->trLogInfo->maxFieldLength = trState->options.maxTransactionLoggingFieldLength; } - if (trState->debugID.present()) { + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) { TraceEvent(SevInfo, "TransactionBeingTraced") .detail("DebugTransactionID", trState->trLogInfo->identifier) - .detail("ServerTraceID", trState->debugID.get()); + .detail("ServerTraceID", trState->readOptions.get().debugID.get()); } break; @@ -6586,10 +7032,11 @@ void Transaction::setOption(FDBTransactionOptions::Option option, OptionalrandomUniqueID()); - if (trState->trLogInfo && !trState->trLogInfo->identifier.empty()) { + if (trState->trLogInfo && !trState->trLogInfo->identifier.empty() && trState->readOptions.present() && + trState->readOptions.get().debugID.present()) { TraceEvent(SevInfo, "TransactionBeingTraced") .detail("DebugTransactionID", trState->trLogInfo->identifier) - .detail("ServerTraceID", trState->debugID.get()); + .detail("ServerTraceID", trState->readOptions.get().debugID.get()); } break; @@ -6605,12 +7052,20 @@ void Transaction::setOption(FDBTransactionOptions::Option option, OptionalreadOptions.present()) { + trState->readOptions = ReadOptions(); + } + trState->readOptions.get().lockAware = true; trState->options.lockAware = true; trState->options.readOnly = false; break; case FDBTransactionOptions::READ_LOCK_AWARE: validateOptionValueNotPresent(value); + if (!trState->readOptions.present()) { + trState->readOptions = ReadOptions(); + } + trState->readOptions.get().lockAware = true; if (!trState->options.lockAware) { trState->options.lockAware = true; trState->options.readOnly = true; @@ -6624,6 +7079,11 @@ void Transaction::setOption(FDBTransactionOptions::Option option, OptionalhasTenant()) { + Error e = invalid_option(); + TraceEvent(SevWarn, "TenantTransactionUseProvisionalProxies").error(e).detail("Tenant", trState->tenant()); + throw e; + } trState->options.getReadVersionFlags |= GetReadVersionRequest::FLAG_USE_PROVISIONAL_PROXIES; trState->useProvisionalProxies = UseProvisionalProxies::True; break; @@ -6646,10 +7106,11 @@ void Transaction::setOption(FDBTransactionOptions::Option option, Optional(value.get(), Unversioned())); + CODE_PROBE(true, "Adding link in FDBTransactionOptions::SPAN_PARENT"); + span.setParent(BinaryReader::fromStringRef(value.get(), IncludeVersion())); break; case FDBTransactionOptions::REPORT_CONFLICTING_KEYS: @@ -6664,6 +7125,9 @@ void Transaction::setOption(FDBTransactionOptions::Option option, Optionalcx->sharedStatePtr) { + throw invalid_option(); + } if (trState->numErrors == 0) { trState->options.useGrvCache = true; } @@ -6679,7 +7143,7 @@ void Transaction::setOption(FDBTransactionOptions::Option option, OptionalhasTenant()) { + if (trState->hasTenant(ResolveDefaultTenant::False)) { Error e = invalid_option(); TraceEvent(SevWarn, "TenantTransactionRawAccess").error(e).detail("Tenant", trState->tenant()); throw e; @@ -6687,12 +7151,65 @@ void Transaction::setOption(FDBTransactionOptions::Option option, Optionaloptions.rawAccess = true; break; + case FDBTransactionOptions::BYPASS_STORAGE_QUOTA: + trState->options.bypassStorageQuota = true; + break; + + case FDBTransactionOptions::AUTHORIZATION_TOKEN: + if (value.present()) + trState->authToken = WipedString(value.get()); + else + trState->authToken.reset(); + break; + case FDBTransactionOptions::IDEMPOTENCY_ID: + validateOptionValuePresent(value); + if (!(value.get().size() >= 16 && value.get().size() < 256)) { + Error e = invalid_option(); + TraceEvent(SevWarn, "IdempotencyIdInvalidSize") + .error(e) + .detail("IdempotencyId", value.get().printable()) + .detail("Recommendation", "Use an idempotency id that's at least 16 bytes and less than 256 bytes"); + throw e; + } + tr.idempotencyId = IdempotencyIdRef(tr.arena, IdempotencyIdRef(value.get())); + trState->automaticIdempotency = false; + break; + case FDBTransactionOptions::AUTOMATIC_IDEMPOTENCY: + validateOptionValueNotPresent(value); + if (!tr.idempotencyId.valid()) { + tr.idempotencyId = IdempotencyIdRef( + tr.arena, + IdempotencyIdRef(BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned()))); + } + trState->automaticIdempotency = true; + break; + + case FDBTransactionOptions::READ_SERVER_SIDE_CACHE_ENABLE: + trState->readOptions.withDefault(ReadOptions()).cacheResult = CacheResult::True; + break; + + case FDBTransactionOptions::READ_SERVER_SIDE_CACHE_DISABLE: + trState->readOptions.withDefault(ReadOptions()).cacheResult = CacheResult::False; + break; + + case FDBTransactionOptions::READ_PRIORITY_LOW: + trState->readOptions.withDefault(ReadOptions()).type = ReadType::LOW; + break; + + case FDBTransactionOptions::READ_PRIORITY_NORMAL: + trState->readOptions.withDefault(ReadOptions()).type = ReadType::NORMAL; + break; + + case FDBTransactionOptions::READ_PRIORITY_HIGH: + trState->readOptions.withDefault(ReadOptions()).type = ReadType::HIGH; + break; + default: break; } } -ACTOR Future getConsistentReadVersion(SpanID parentSpan, +ACTOR Future getConsistentReadVersion(SpanContext parentSpan, DatabaseContext* cx, uint32_t transactionCount, TransactionPriority priority, @@ -6725,15 +7242,17 @@ ACTOR Future getConsistentReadVersion(SpanID parentSpan, &GrvProxyInterface::getConsistentReadVersion, req, cx->taskID))) { + CODE_PROBE(v.proxyTagThrottledDuration > 0.0, + "getConsistentReadVersion received GetReadVersionReply delayed by proxy tag throttling"); if (tags.size() != 0) { auto& priorityThrottledTags = cx->throttledTags[priority]; for (auto& tag : tags) { auto itr = v.tagThrottleInfo.find(tag.first); if (itr == v.tagThrottleInfo.end()) { - TEST(true); // Removing client throttle + CODE_PROBE(true, "Removing client throttle"); priorityThrottledTags.erase(tag.first); } else { - TEST(true); // Setting client throttle + CODE_PROBE(true, "Setting client throttle"); auto result = priorityThrottledTags.try_emplace(tag.first, itr->second); if (!result.second) { result.first->second.update(itr->second); @@ -6759,12 +7278,14 @@ ACTOR Future getConsistentReadVersion(SpanID parentSpan, } } catch (Error& e) { if (e.code() != error_code_broken_promise && e.code() != error_code_batch_transaction_throttled && - e.code() != error_code_proxy_memory_limit_exceeded) + e.code() != error_code_grv_proxy_memory_limit_exceeded && e.code() != error_code_proxy_tag_throttled) TraceEvent(SevError, "GetConsistentReadVersionError").error(e); - if ((e.code() == error_code_batch_transaction_throttled || - e.code() == error_code_proxy_memory_limit_exceeded) && - !cx->apiVersionAtLeast(630)) { + if (e.code() == error_code_batch_transaction_throttled && !cx->apiVersionAtLeast(630)) { wait(delayJittered(5.0)); + } else if (e.code() == error_code_grv_proxy_memory_limit_exceeded) { + // FIXME(xwang): the better way is to let this error broadcast to transaction.onError(e), otherwise the + // txn->cx counter doesn't make sense + wait(delayJittered(CLIENT_KNOBS->GRV_ERROR_RETRY_DELAY)); } else { throw; } @@ -6782,26 +7303,22 @@ ACTOR Future readVersionBatcher(DatabaseContext* cx, state Future timeout; state Optional debugID; state bool send_batch; - state Reference batchSizeDist = Histogram::getHistogram(LiteralStringRef("GrvBatcher"), - LiteralStringRef("ClientGrvBatchSize"), - Histogram::Unit::countLinear, - 0, - CLIENT_KNOBS->MAX_BATCH_SIZE * 2); + state Reference batchSizeDist = Histogram::getHistogram( + "GrvBatcher"_sr, "ClientGrvBatchSize"_sr, Histogram::Unit::countLinear, 0, CLIENT_KNOBS->MAX_BATCH_SIZE * 2); state Reference batchIntervalDist = - Histogram::getHistogram(LiteralStringRef("GrvBatcher"), - LiteralStringRef("ClientGrvBatchInterval"), - Histogram::Unit::microseconds, + Histogram::getHistogram("GrvBatcher"_sr, + "ClientGrvBatchInterval"_sr, + Histogram::Unit::milliseconds, 0, CLIENT_KNOBS->GRV_BATCH_TIMEOUT * 1000000 * 2); - state Reference grvReplyLatencyDist = Histogram::getHistogram( - LiteralStringRef("GrvBatcher"), LiteralStringRef("ClientGrvReplyLatency"), Histogram::Unit::microseconds); + state Reference grvReplyLatencyDist = + Histogram::getHistogram("GrvBatcher"_sr, "ClientGrvReplyLatency"_sr, Histogram::Unit::milliseconds); state double lastRequestTime = now(); state TransactionTagMap tags; // dynamic batching state PromiseStream replyTimes; - state PromiseStream _errorStream; state double batchTime = 0; state Span span("NAPI:readVersionBatcher"_loc); loop { @@ -6814,7 +7331,7 @@ ACTOR Future readVersionBatcher(DatabaseContext* cx, } g_traceBatch.addAttach("TransactionAttachID", req.debugID.get().first(), debugID.get().first()); } - span.addParent(req.spanContext); + span.addLink(req.spanContext); requests.push_back(req.reply); for (auto tag : req.tags) { ++tags[tag]; @@ -6870,15 +7387,16 @@ ACTOR Future readVersionBatcher(DatabaseContext* cx, ACTOR Future extractReadVersion(Reference trState, Location location, - SpanID spanContext, + SpanContext spanContext, Future f, Promise> metadataVersion) { - state Span span(spanContext, location, { trState->spanID }); + state Span span(spanContext, location, trState->spanContext); GetReadVersionReply rep = wait(f); double replyTime = now(); double latency = replyTime - trState->startTime; trState->cx->lastProxyRequestTime = trState->startTime; trState->cx->updateCachedReadVersion(trState->startTime, rep.version); + trState->proxyTagThrottledDuration += rep.proxyTagThrottledDuration; if (rep.rkBatchThrottled) { trState->cx->lastRkBatchThrottleTime = replyTime; } @@ -6892,7 +7410,7 @@ ACTOR Future extractReadVersion(Reference trState, latency, trState->options.priority, rep.version, - trState->tenant())); + trState->tenant().flatMapRef(&Tenant::name))); if (rep.locked && !trState->options.lockAware) throw database_locked(); @@ -6919,7 +7437,7 @@ ACTOR Future extractReadVersion(Reference trState, if (itr->second.expired()) { priorityThrottledTags.erase(itr); } else if (itr->second.throttleDuration() > 0) { - TEST(true); // throttling transaction after getting read version + CODE_PROBE(true, "throttling transaction after getting read version"); ++trState->cx->transactionReadVersionsThrottled; throw tag_throttled(); } @@ -6969,102 +7487,103 @@ bool rkThrottlingCooledDown(DatabaseContext* cx, TransactionPriority priority) { return false; } -Future Transaction::getReadVersion(uint32_t flags) { - if (!readVersion.isValid()) { - if (!CLIENT_KNOBS->FORCE_GRV_CACHE_OFF && !trState->options.skipGrvCache && - (deterministicRandom()->random01() <= CLIENT_KNOBS->DEBUG_USE_GRV_CACHE_CHANCE || - trState->options.useGrvCache) && - rkThrottlingCooledDown(getDatabase().getPtr(), trState->options.priority)) { - // Upon our first request to use cached RVs, start the background updater - if (!trState->cx->grvUpdateHandler.isValid()) { - trState->cx->grvUpdateHandler = backgroundGrvUpdater(getDatabase().getPtr()); - } - Version rv = trState->cx->getCachedReadVersion(); - double lastTime = trState->cx->getLastGrvTime(); - double requestTime = now(); - if (requestTime - lastTime <= CLIENT_KNOBS->MAX_VERSION_CACHE_LAG && rv != Version(0)) { - ASSERT(!debug_checkVersionTime(rv, requestTime, "CheckStaleness")); - readVersion = rv; - return readVersion; - } // else go through regular GRV path - } - ++trState->cx->transactionReadVersions; - flags |= trState->options.getReadVersionFlags; - switch (trState->options.priority) { - case TransactionPriority::IMMEDIATE: - flags |= GetReadVersionRequest::PRIORITY_SYSTEM_IMMEDIATE; - ++trState->cx->transactionImmediateReadVersions; - break; - case TransactionPriority::DEFAULT: - flags |= GetReadVersionRequest::PRIORITY_DEFAULT; - ++trState->cx->transactionDefaultReadVersions; - break; - case TransactionPriority::BATCH: - flags |= GetReadVersionRequest::PRIORITY_BATCH; - ++trState->cx->transactionBatchReadVersions; - break; - default: - ASSERT(false); +Future TransactionState::getReadVersion(uint32_t flags) { + ASSERT(!readVersionFuture.isValid()); + + if (!CLIENT_KNOBS->FORCE_GRV_CACHE_OFF && !options.skipGrvCache && + (deterministicRandom()->random01() <= CLIENT_KNOBS->DEBUG_USE_GRV_CACHE_CHANCE || options.useGrvCache) && + rkThrottlingCooledDown(cx.getPtr(), options.priority)) { + // Upon our first request to use cached RVs, start the background updater + if (!cx->grvUpdateHandler.isValid()) { + cx->grvUpdateHandler = backgroundGrvUpdater(cx.getPtr()); } + Version rv = cx->getCachedReadVersion(); + double lastTime = cx->getLastGrvTime(); + double requestTime = now(); + if (requestTime - lastTime <= CLIENT_KNOBS->MAX_VERSION_CACHE_LAG && rv != Version(0)) { + ASSERT(!debug_checkVersionTime(rv, requestTime, "CheckStaleness")); + return rv; + } // else go through regular GRV path + } + ++cx->transactionReadVersions; + flags |= options.getReadVersionFlags; + switch (options.priority) { + case TransactionPriority::IMMEDIATE: + flags |= GetReadVersionRequest::PRIORITY_SYSTEM_IMMEDIATE; + ++cx->transactionImmediateReadVersions; + break; + case TransactionPriority::DEFAULT: + flags |= GetReadVersionRequest::PRIORITY_DEFAULT; + ++cx->transactionDefaultReadVersions; + break; + case TransactionPriority::BATCH: + flags |= GetReadVersionRequest::PRIORITY_BATCH; + ++cx->transactionBatchReadVersions; + break; + default: + ASSERT(false); + } - if (trState->options.tags.size() != 0) { - double maxThrottleDelay = 0.0; - bool canRecheck = false; + if (options.tags.size() != 0) { + double maxThrottleDelay = 0.0; + bool canRecheck = false; - auto& priorityThrottledTags = trState->cx->throttledTags[trState->options.priority]; - for (auto& tag : trState->options.tags) { - auto itr = priorityThrottledTags.find(tag); - if (itr != priorityThrottledTags.end()) { - if (!itr->second.expired()) { - maxThrottleDelay = std::max(maxThrottleDelay, itr->second.throttleDuration()); - canRecheck = itr->second.canRecheck(); - } else { - priorityThrottledTags.erase(itr); - } + auto& priorityThrottledTags = cx->throttledTags[options.priority]; + for (auto& tag : options.tags) { + auto itr = priorityThrottledTags.find(tag); + if (itr != priorityThrottledTags.end()) { + if (!itr->second.expired()) { + maxThrottleDelay = std::max(maxThrottleDelay, itr->second.throttleDuration()); + canRecheck = itr->second.canRecheck(); + } else { + priorityThrottledTags.erase(itr); } } + } - if (maxThrottleDelay > 0.0 && !canRecheck) { // TODO: allow delaying? - TEST(true); // Throttling tag before GRV request - ++trState->cx->transactionReadVersionsThrottled; - readVersion = tag_throttled(); - return readVersion; - } else { - TEST(maxThrottleDelay > 0.0); // Rechecking throttle - } - - for (auto& tag : trState->options.tags) { - auto itr = priorityThrottledTags.find(tag); - if (itr != priorityThrottledTags.end()) { - itr->second.updateChecked(); - } - } + if (maxThrottleDelay > 0.0 && !canRecheck) { // TODO: allow delaying? + CODE_PROBE(true, "Throttling tag before GRV request"); + ++cx->transactionReadVersionsThrottled; + return tag_throttled(); + } else { + CODE_PROBE(maxThrottleDelay > 0.0, "Rechecking throttle"); } - auto& batcher = trState->cx->versionBatcher[flags]; - if (!batcher.actor.isValid()) { - batcher.actor = - readVersionBatcher(trState->cx.getPtr(), batcher.stream.getFuture(), trState->options.priority, flags); + for (auto& tag : options.tags) { + auto itr = priorityThrottledTags.find(tag); + if (itr != priorityThrottledTags.end()) { + itr->second.updateChecked(); + } } + } - Location location = "NAPI:getReadVersion"_loc; - UID spanContext = generateSpanID(trState->cx->transactionTracingSample, trState->spanID); - auto const req = DatabaseContext::VersionRequest(spanContext, trState->options.tags, trState->debugID); - batcher.stream.send(req); - trState->startTime = now(); - readVersion = extractReadVersion(trState, location, spanContext, req.reply.getFuture(), metadataVersion); + auto& batcher = cx->versionBatcher[flags]; + if (!batcher.actor.isValid()) { + batcher.actor = readVersionBatcher(cx.getPtr(), batcher.stream.getFuture(), options.priority, flags); } - return readVersion; + + Location location = "NAPI:getReadVersion"_loc; + SpanContext derivedSpanContext = generateSpanID(cx->transactionTracingSample, spanContext); + Optional versionDebugID = readOptions.present() ? readOptions.get().debugID : Optional(); + auto const req = DatabaseContext::VersionRequest(derivedSpanContext, options.tags, versionDebugID); + batcher.stream.send(req); + startTime = now(); + return extractReadVersion( + Reference::addRef(this), location, spanContext, req.reply.getFuture(), metadataVersion); } Optional Transaction::getCachedReadVersion() const { - if (readVersion.isValid() && readVersion.isReady() && !readVersion.isError()) { - return readVersion.get(); + if (trState->readVersionFuture.canGet()) { + return trState->readVersion(); } else { return Optional(); } } +double Transaction::getTagThrottledDuration() const { + return trState->proxyTagThrottledDuration; +} + Future> Transaction::getVersionstamp() { if (committing.isValid()) { return transaction_invalid_version(); @@ -7176,6 +7695,25 @@ Future DatabaseContext::getClusterProtocol(OptionalTAG_THROTTLE_SMOOTHING_WINDOW; + + if (capacity >= 1) { + return 0.0; + } + + if (tpsRate == 0) { + return std::max(0.0, expiration - now()); + } + + return std::min(expiration - now(), capacity / tpsRate); +} + uint32_t Transaction::getSize() { auto s = tr.transaction.mutations.expectedSize() + tr.transaction.read_conflict_ranges.expectedSize() + tr.transaction.write_conflict_ranges.expectedSize(); @@ -7184,25 +7722,32 @@ uint32_t Transaction::getSize() { Future Transaction::onError(Error const& e) { if (g_network->isSimulated() && ++trState->numErrors % 10 == 0) { - TraceEvent(SevWarnAlways, "TransactionTooManyRetries").detail("NumRetries", trState->numErrors); + TraceEvent(SevWarnAlways, "TransactionTooManyRetries") + .errorUnsuppressed(e) + .detail("NumRetries", trState->numErrors); } if (e.code() == error_code_success) { return client_invalid_operation(); } if (e.code() == error_code_not_committed || e.code() == error_code_commit_unknown_result || - e.code() == error_code_database_locked || e.code() == error_code_proxy_memory_limit_exceeded || - e.code() == error_code_process_behind || e.code() == error_code_batch_transaction_throttled || - e.code() == error_code_tag_throttled) { + e.code() == error_code_database_locked || e.code() == error_code_commit_proxy_memory_limit_exceeded || + e.code() == error_code_grv_proxy_memory_limit_exceeded || e.code() == error_code_process_behind || + e.code() == error_code_batch_transaction_throttled || e.code() == error_code_tag_throttled || + e.code() == error_code_blob_granule_request_failed || e.code() == error_code_proxy_tag_throttled) { if (e.code() == error_code_not_committed) ++trState->cx->transactionsNotCommitted; else if (e.code() == error_code_commit_unknown_result) ++trState->cx->transactionsMaybeCommitted; - else if (e.code() == error_code_proxy_memory_limit_exceeded) + else if (e.code() == error_code_commit_proxy_memory_limit_exceeded || + e.code() == error_code_grv_proxy_memory_limit_exceeded) ++trState->cx->transactionsResourceConstrained; else if (e.code() == error_code_process_behind) ++trState->cx->transactionsProcessBehind; else if (e.code() == error_code_batch_transaction_throttled || e.code() == error_code_tag_throttled) { ++trState->cx->transactionsThrottled; + } else if (e.code() == error_code_proxy_tag_throttled) { + ++trState->cx->transactionsThrottled; + trState->proxyTagThrottledDuration += CLIENT_KNOBS->PROXY_MAX_TAG_THROTTLE_DURATION; } double backoff = getBackoff(e.code()); @@ -7219,42 +7764,55 @@ Future Transaction::onError(Error const& e) { reset(); return delay(std::min(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, maxBackoff), trState->taskID); } - if (e.code() == error_code_unknown_tenant) { - double maxBackoff = trState->options.maxBackoff; - reset(); - return delay(std::min(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, maxBackoff), trState->taskID); - } return e; } -ACTOR Future getStorageMetricsLargeKeyRange(Database cx, KeyRange keys); +ACTOR Future getStorageMetricsLargeKeyRange(Database cx, + KeyRange keys, + Optional> trState); -ACTOR Future doGetStorageMetrics(Database cx, KeyRange keys, Reference locationInfo) { - loop { - try { - WaitMetricsRequest req(keys, StorageMetrics(), StorageMetrics()); - req.min.bytes = 0; - req.max.bytes = -1; - StorageMetrics m = wait(loadBalance( - locationInfo->locations(), &StorageServerInterface::waitMetrics, req, TaskPriority::DataDistribution)); - return m; - } catch (Error& e) { - if (e.code() != error_code_wrong_shard_server && e.code() != error_code_all_alternatives_failed) { - TraceEvent(SevError, "WaitStorageMetricsError").error(e); - throw; - } +ACTOR Future doGetStorageMetrics(Database cx, + TenantInfo tenantInfo, + Version version, + KeyRange keys, + Reference locationInfo, + Optional> trState) { + try { + WaitMetricsRequest req(tenantInfo, version, keys, StorageMetrics(), StorageMetrics()); + req.min.bytes = 0; + req.max.bytes = -1; + StorageMetrics m = wait(loadBalance( + locationInfo->locations(), &StorageServerInterface::waitMetrics, req, TaskPriority::DataDistribution)); + return m; + } catch (Error& e) { + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) { + cx->invalidateCache(tenantInfo.prefix, keys); wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution)); - cx->invalidateCache(Key(), keys); - StorageMetrics m = wait(getStorageMetricsLargeKeyRange(cx, keys)); - return m; + } else if (e.code() == error_code_future_version) { + wait(delay(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, TaskPriority::DataDistribution)); + } else { + bool ok = e.code() == error_code_tenant_not_found; + TraceEvent(ok ? SevInfo : SevError, "DoGetStorageMetricsError").error(e); + throw; } + + StorageMetrics m = wait(getStorageMetricsLargeKeyRange(cx, keys, trState)); + return m; } } -ACTOR Future getStorageMetricsLargeKeyRange(Database cx, KeyRange keys) { +ACTOR Future getStorageMetricsLargeKeyRange(Database cx, + KeyRange keys, + Optional> trState) { state Span span("NAPI:GetStorageMetricsLargeKeyRange"_loc); + if (trState.present()) { + wait(trState.get()->startTransaction()); + } + state TenantInfo tenantInfo = + wait(trState.present() ? populateAndGetTenant(trState.get(), keys.begin) : TenantInfo()); + state Version version = trState.present() ? trState.get()->readVersion() : latestVersion; std::vector locations = wait(getKeyRangeLocations(cx, - Optional(), + tenantInfo, keys, std::numeric_limits::max(), Reverse::False, @@ -7262,7 +7820,7 @@ ACTOR Future getStorageMetricsLargeKeyRange(Database cx, KeyRang span.context, Optional(), UseProvisionalProxies::False, - latestVersion)); + version)); state int nLocs = locations.size(); state std::vector> fx(nLocs); state StorageMetrics total; @@ -7270,7 +7828,8 @@ ACTOR Future getStorageMetricsLargeKeyRange(Database cx, KeyRang for (int i = 0; i < nLocs; i++) { partBegin = (i == 0) ? keys.begin : locations[i].range.begin; partEnd = (i == nLocs - 1) ? keys.end : locations[i].range.end; - fx[i] = doGetStorageMetrics(cx, KeyRangeRef(partBegin, partEnd), locations[i].locations); + fx[i] = doGetStorageMetrics( + cx, tenantInfo, version, KeyRangeRef(partBegin, partEnd), locations[i].locations, trState); } wait(waitForAll(fx)); for (int i = 0; i < nLocs; i++) { @@ -7279,14 +7838,16 @@ ACTOR Future getStorageMetricsLargeKeyRange(Database cx, KeyRang return total; } -ACTOR Future trackBoundedStorageMetrics(KeyRange keys, +ACTOR Future trackBoundedStorageMetrics(TenantInfo tenantInfo, + Version version, + KeyRange keys, Reference location, StorageMetrics x, StorageMetrics halfError, PromiseStream deltaStream) { try { loop { - WaitMetricsRequest req(keys, x - halfError, x + halfError); + WaitMetricsRequest req(tenantInfo, version, keys, x - halfError, x + halfError); StorageMetrics nextX = wait(loadBalance(location->locations(), &StorageServerInterface::waitMetrics, req)); deltaStream.send(nextX - x); x = nextX; @@ -7297,7 +7858,9 @@ ACTOR Future trackBoundedStorageMetrics(KeyRange keys, } } -ACTOR Future waitStorageMetricsMultipleLocations(std::vector locations, +ACTOR Future waitStorageMetricsMultipleLocations(TenantInfo tenantInfo, + Version version, + std::vector locations, StorageMetrics min, StorageMetrics max, StorageMetrics permittedError) { @@ -7311,7 +7874,7 @@ ACTOR Future waitStorageMetricsMultipleLocations(std::vectorlocations(), @@ -7332,7 +7895,7 @@ ACTOR Future waitStorageMetricsMultipleLocations(std::vector>> getReadHotRanges(Da // to find the read-hot sub ranges within a read-hot shard. std::vector locations = wait(getKeyRangeLocations(cx, - Optional(), + TenantInfo(), keys, shardLimit, Reverse::False, @@ -7392,10 +7955,10 @@ ACTOR Future>> getReadHotRanges(Da wait(waitForAll(fReplies)); if (nLocs == 1) { - TEST(true); // Single-shard read hot range request + CODE_PROBE(true, "Single-shard read hot range request"); return fReplies[0].get().readHotRanges; } else { - TEST(true); // Multi-shard read hot range request + CODE_PROBE(true, "Multi-shard read hot range request"); Standalone> results; for (int i = 0; i < nLocs; i++) { results.append(results.arena(), @@ -7411,67 +7974,97 @@ ACTOR Future>> getReadHotRanges(Da TraceEvent(SevError, "GetReadHotSubRangesError").error(e); throw; } - cx->invalidateCache(Key(), keys); + cx->invalidateCache({}, keys); wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution)); } } } -ACTOR Future, int>> waitStorageMetrics(Database cx, - KeyRange keys, - StorageMetrics min, - StorageMetrics max, - StorageMetrics permittedError, - int shardLimit, - int expectedShardCount) { +ACTOR Future> waitStorageMetricsWithLocation(TenantInfo tenantInfo, + Version version, + KeyRange keys, + std::vector locations, + StorageMetrics min, + StorageMetrics max, + StorageMetrics permittedError) { + Future fx; + if (locations.size() > 1) { + fx = waitStorageMetricsMultipleLocations(tenantInfo, version, locations, min, max, permittedError); + } else { + WaitMetricsRequest req(tenantInfo, version, keys, min, max); + fx = loadBalance(locations[0].locations->locations(), + &StorageServerInterface::waitMetrics, + req, + TaskPriority::DataDistribution); + } + StorageMetrics x = wait(fx); + return x; +} + +ACTOR Future, int>> waitStorageMetrics( + Database cx, + KeyRange keys, + StorageMetrics min, + StorageMetrics max, + StorageMetrics permittedError, + int shardLimit, + int expectedShardCount, + Optional> trState) { state Span span("NAPI:WaitStorageMetrics"_loc, generateSpanID(cx->transactionTracingSample)); loop { - std::vector locations = wait(getKeyRangeLocations(cx, - Optional(), - keys, - shardLimit, - Reverse::False, - &StorageServerInterface::waitMetrics, - span.context, - Optional(), - UseProvisionalProxies::False, - latestVersion)); + if (trState.present()) { + wait(trState.get()->startTransaction()); + } + state TenantInfo tenantInfo = + wait(trState.present() ? populateAndGetTenant(trState.get(), keys.begin) : TenantInfo()); + state Version version = trState.present() ? trState.get()->readVersion() : latestVersion; + state std::vector locations = + wait(getKeyRangeLocations(cx, + tenantInfo, + keys, + shardLimit, + Reverse::False, + &StorageServerInterface::waitMetrics, + span.context, + Optional(), + UseProvisionalProxies::False, + version)); if (expectedShardCount >= 0 && locations.size() != expectedShardCount) { return std::make_pair(Optional(), locations.size()); } // SOMEDAY: Right now, if there are too many shards we delay and check again later. There may be a better - // solution to this. - if (locations.size() < shardLimit) { - try { - Future fx; - if (locations.size() > 1) { - fx = waitStorageMetricsMultipleLocations(locations, min, max, permittedError); - } else { - WaitMetricsRequest req(keys, min, max); - fx = loadBalance(locations[0].locations->locations(), - &StorageServerInterface::waitMetrics, - req, - TaskPriority::DataDistribution); - } - StorageMetrics x = wait(fx); - return std::make_pair(x, -1); - } catch (Error& e) { - if (e.code() != error_code_wrong_shard_server && e.code() != error_code_all_alternatives_failed) { - TraceEvent(SevError, "WaitStorageMetricsError").error(e); - throw; - } - cx->invalidateCache(Key(), keys); - wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution)); - } - } else { + // solution to this. How could this happen? + if (locations.size() >= shardLimit) { TraceEvent(SevWarn, "WaitStorageMetricsPenalty") .detail("Keys", keys) - .detail("Limit", CLIENT_KNOBS->STORAGE_METRICS_SHARD_LIMIT) + .detail("Limit", shardLimit) + .detail("LocationSize", locations.size()) .detail("JitteredSecondsOfPenitence", CLIENT_KNOBS->STORAGE_METRICS_TOO_MANY_SHARDS_DELAY); wait(delayJittered(CLIENT_KNOBS->STORAGE_METRICS_TOO_MANY_SHARDS_DELAY, TaskPriority::DataDistribution)); // make sure that the next getKeyRangeLocations() call will actually re-fetch the range - cx->invalidateCache(Key(), keys); + cx->invalidateCache(tenantInfo.prefix, keys); + continue; + } + + try { + Optional res = + wait(waitStorageMetricsWithLocation(tenantInfo, version, keys, locations, min, max, permittedError)); + if (res.present()) { + return std::make_pair(res, -1); + } + } catch (Error& e) { + TraceEvent(SevDebug, "WaitStorageMetricsHandleError").error(e); + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) { + cx->invalidateCache(tenantInfo.prefix, keys); + wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution)); + } else if (e.code() == error_code_future_version) { + wait(delay(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, TaskPriority::DataDistribution)); + } else { + bool ok = e.code() == error_code_tenant_not_found; + TraceEvent(ok ? SevInfo : SevError, "WaitStorageMetricsError").error(e); + throw; + } } } } @@ -7482,17 +8075,21 @@ Future, int>> DatabaseContext::waitStorageMet StorageMetrics const& max, StorageMetrics const& permittedError, int shardLimit, - int expectedShardCount) { + int expectedShardCount, + Optional> trState) { return ::waitStorageMetrics(Database(Reference::addRef(this)), keys, min, max, permittedError, shardLimit, - expectedShardCount); + expectedShardCount, + trState); } -Future DatabaseContext::getStorageMetrics(KeyRange const& keys, int shardLimit) { +Future DatabaseContext::getStorageMetrics(KeyRange const& keys, + int shardLimit, + Optional> trState) { if (shardLimit > 0) { StorageMetrics m; m.bytes = -1; @@ -7502,9 +8099,10 @@ Future DatabaseContext::getStorageMetrics(KeyRange const& keys, m, StorageMetrics(), shardLimit, - -1)); + -1, + trState)); } else { - return ::getStorageMetricsLargeKeyRange(Database(Reference::addRef(this)), keys); + return ::getStorageMetricsLargeKeyRange(Database(Reference::addRef(this)), keys, trState); } } @@ -7533,9 +8131,12 @@ Future>> DatabaseContext::getReadH ACTOR Future>> getRangeSplitPoints(Reference trState, KeyRange keys, - int64_t chunkSize, - Version version) { - state Span span("NAPI:GetRangeSplitPoints"_loc, trState->spanID); + int64_t chunkSize) { + state Span span("NAPI:GetRangeSplitPoints"_loc, trState->spanContext); + + if (trState->hasTenant()) { + wait(trState->startTransaction()); + } loop { state std::vector locations = @@ -7544,8 +8145,7 @@ ACTOR Future>> getRangeSplitPoints(ReferenceTOO_MANY, Reverse::False, &StorageServerInterface::getRangeSplitPoints, - UseTenant::True, - version)); + UseTenant::True)); try { state int nLocs = locations.size(); state std::vector> fReplies(nLocs); @@ -7582,12 +8182,8 @@ ACTOR Future>> getRangeSplitPoints(Referencecx->invalidateCache(locations[0].tenantEntry.prefix, keys); + trState->cx->invalidateCache(trState->tenant().mapRef(&Tenant::prefix), keys); wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution)); - } else if (e.code() == error_code_unknown_tenant) { - ASSERT(trState->tenant().present()); - trState->cx->invalidateCachedTenant(trState->tenant().get()); - wait(delay(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, trState->taskID)); } else { TraceEvent(SevError, "GetRangeSplitPoints").error(e); throw; @@ -7597,43 +8193,61 @@ ACTOR Future>> getRangeSplitPoints(Reference>> Transaction::getRangeSplitPoints(KeyRange const& keys, int64_t chunkSize) { - return ::getRangeSplitPoints( - trState, keys, chunkSize, readVersion.isValid() && readVersion.isReady() ? readVersion.get() : latestVersion); + return ::getRangeSplitPoints(trState, keys, chunkSize); } #define BG_REQUEST_DEBUG false -// the blob granule requests are a bit funky because they piggyback off the existing transaction to read from the system -// keyspace -ACTOR Future>> getBlobGranuleRangesActor(Transaction* self, KeyRange keyRange) { - // FIXME: use streaming range read +ACTOR Future>> getBlobGranuleRangesActor(Transaction* self, + KeyRange keyRange, + int rangeLimit) { + state KeyRange currentRange = keyRange; state Standalone> results; + state bool more = false; if (BG_REQUEST_DEBUG) { fmt::print("Getting Blob Granules for [{0} - {1})\n", keyRange.begin.printable(), keyRange.end.printable()); } - self->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - loop { - state RangeResult blobGranuleMapping = wait( - krmGetRanges(self, blobGranuleMappingKeys.begin, currentRange, 1000, GetRangeLimits::BYTE_LIMIT_UNLIMITED)); - for (int i = 0; i < blobGranuleMapping.size() - 1; i++) { - if (blobGranuleMapping[i].value.size()) { - results.push_back(results.arena(), - KeyRangeRef(blobGranuleMapping[i].key, blobGranuleMapping[i + 1].key)); + if (self->getTenant().present()) { + wait(self->getTenant().get()->ready()); + } + loop { + int remaining = std::max(0, rangeLimit - results.size()) + 1; + // TODO: knob + remaining = std::min(1000, remaining); + if (BUGGIFY_WITH_PROB(0.01)) { + remaining = std::min(remaining, deterministicRandom()->randomInt(1, 10)); + } + std::vector> blobGranuleMapping = wait(getBlobGranuleLocations( + self->trState, currentRange, remaining, Reverse::False, UseTenant::True, JustGranules::True, &more)); + for (auto& it : blobGranuleMapping) { + if (!results.empty() && results.back().end > it.first.end) { + ASSERT(results.back().end > it.first.begin); + ASSERT(results.back().end <= it.first.end); + CODE_PROBE(true, "Merge while reading granules", probe::decoration::rare); + while (!results.empty() && results.back().begin >= it.first.begin) { + // TODO: we can't easily un-allocate the data in the arena for these guys, but that's ok as this + // should be rare + results.pop_back(); + } + ASSERT(results.empty() || results.back().end == it.first.begin); + } + results.push_back_deep(results.arena(), it.first); + if (results.size() == rangeLimit) { + return results; } } - results.arena().dependsOn(blobGranuleMapping.arena()); - if (blobGranuleMapping.more) { - currentRange = KeyRangeRef(blobGranuleMapping.back().key, currentRange.end); - } else { + if (!more) { return results; } + CODE_PROBE(more, "partial granule mapping"); + currentRange = KeyRangeRef(results.back().end, currentRange.end); } } -Future>> Transaction::getBlobGranuleRanges(const KeyRange& range) { - return ::getBlobGranuleRangesActor(this, range); +Future>> Transaction::getBlobGranuleRanges(const KeyRange& range, int rangeLimit) { + return ::getBlobGranuleRangesActor(this, range, rangeLimit); } // hack (for now) to get blob worker interface into load balance @@ -7647,13 +8261,12 @@ ACTOR Future>> readBlobGranulesActor( KeyRange range, Version begin, Optional read, - Version* readVersionOut) { // read not present is "use transaction version" + Version* readVersionOut, + int chunkLimit, + bool summarize) { // read not present is "use transaction version" - state RangeResult blobGranuleMapping; - state Key granuleStartKey; - state Key granuleEndKey; + ASSERT(chunkLimit > 0); state KeyRange keyRange = range; - state UID workerId; state int i; state Version rv; @@ -7666,107 +8279,112 @@ ACTOR Future>> readBlobGranulesActor( Version _end = wait(self->getReadVersion()); rv = _end; } - self->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + // Right now just read whole blob range assignments from DB // FIXME: eventually we probably want to cache this and invalidate similarly to storage servers. // Cache misses could still read from the DB, or we could add it to the Transaction State Store and // have proxies serve it from memory. - RangeResult _bgMapping = - wait(krmGetRanges(self, blobGranuleMappingKeys.begin, keyRange, 1000, GetRangeLimits::BYTE_LIMIT_UNLIMITED)); - blobGranuleMapping = _bgMapping; - if (blobGranuleMapping.more) { + if (BG_REQUEST_DEBUG) { + fmt::print("Doing blob granule request [{0} - {1}) @ {2}{3}\n", + range.begin.printable(), + range.end.printable(), + rv, + self->getTenant().present() ? " for tenant " + printable(self->getTenant().get()->description()) + : ""); + } + + if (self->getTenant().present()) { + // ensure tenant is populated for getBlobGranuleLocations request + wait(self->getTenant().get()->ready()); + } + + state bool moreMapping = false; + state std::vector> blobGranuleMapping = + wait(getBlobGranuleLocations(self->trState, + keyRange, + CLIENT_KNOBS->BG_TOO_MANY_GRANULES, + Reverse::False, + UseTenant::True, + JustGranules::False, + &moreMapping)); + + if (blobGranuleMapping.empty()) { + throw blob_granule_transaction_too_old(); + } + ASSERT(blobGranuleMapping.front().first.begin <= keyRange.begin); + ASSERT(moreMapping == blobGranuleMapping.back().first.end < keyRange.end); + if (moreMapping) { if (BG_REQUEST_DEBUG) { - fmt::print( - "BG Mapping for [{0} - %{1}) too large!\n", keyRange.begin.printable(), keyRange.end.printable()); - } - TraceEvent(SevWarn, "BGMappingTooLarge").detail("Range", range).detail("Max", 1000); + fmt::print("BG Mapping for [{0} - {1}) too large! ({2}) LastRange=[{3} - {4}): {5}\n", + keyRange.begin.printable(), + keyRange.end.printable(), + blobGranuleMapping.size(), + blobGranuleMapping.back().first.begin.printable(), + blobGranuleMapping.back().first.end.printable(), + blobGranuleMapping.back().second.shortString()); + } + TraceEvent(SevWarn, "BGMappingTooLarge") + .detail("Range", range) + .detail("Max", CLIENT_KNOBS->BG_TOO_MANY_GRANULES); throw unsupported_operation(); } - ASSERT(!blobGranuleMapping.more && blobGranuleMapping.size() < CLIENT_KNOBS->TOO_MANY); - - if (blobGranuleMapping.size() == 0) { - if (BG_REQUEST_DEBUG) { - printf("no blob worker assignments yet\n"); - } - throw blob_granule_transaction_too_old(); - } + ASSERT(blobGranuleMapping.size() <= CLIENT_KNOBS->BG_TOO_MANY_GRANULES); if (BG_REQUEST_DEBUG) { fmt::print("Doing blob granule request @ {}\n", rv); fmt::print("blob worker assignments:\n"); } - for (i = 0; i < blobGranuleMapping.size() - 1; i++) { - granuleStartKey = blobGranuleMapping[i].key; - granuleEndKey = blobGranuleMapping[i + 1].key; - if (!blobGranuleMapping[i].value.size()) { - if (BG_REQUEST_DEBUG) { - fmt::print("Key range [{0} - {1}) missing worker assignment!\n", - granuleStartKey.printable(), - granuleEndKey.printable()); - // TODO probably new exception type instead - } - throw blob_granule_transaction_too_old(); - } - - workerId = decodeBlobGranuleMappingValue(blobGranuleMapping[i].value); - if (workerId == UID()) { - if (BG_REQUEST_DEBUG) { - fmt::print("Key range [{0} - {1}) has no assigned worker yet!\n", - granuleStartKey.printable(), - granuleEndKey.printable()); - } - throw blob_granule_transaction_too_old(); - } - if (BG_REQUEST_DEBUG) { - fmt::print( - " [{0} - {1}): {2}\n", granuleStartKey.printable(), granuleEndKey.printable(), workerId.toString()); - } - - if (!self->trState->cx->blobWorker_interf.count(workerId)) { - Optional workerInterface = wait(self->get(blobWorkerListKeyFor(workerId))); - // from the time the mapping was read from the db, the associated blob worker - // could have died and so its interface wouldn't be present as part of the blobWorkerList - // we persist in the db. So throw wrong_shard_server to get the new mapping - if (!workerInterface.present()) { - // need to re-read mapping, throw transaction_too_old so client retries. TODO better error? - // throw wrong_shard_server(); - throw transaction_too_old(); - } - // FIXME: maybe just want to insert here if there are racing queries for the same worker or something? - self->trState->cx->blobWorker_interf[workerId] = decodeBlobWorkerListValue(workerInterface.get()); - if (BG_REQUEST_DEBUG) { - fmt::print(" decoded worker interface for {0}\n", workerId.toString()); - } - } - } - // Make request for each granule - for (i = 0; i < blobGranuleMapping.size() - 1; i++) { - granuleStartKey = blobGranuleMapping[i].key; - granuleEndKey = blobGranuleMapping[i + 1].key; + for (i = 0; i < blobGranuleMapping.size(); i++) { + state KeyRange granule = blobGranuleMapping[i].first; // if this was a time travel and the request returned larger bounds, skip this chunk - if (granuleEndKey <= keyRange.begin) { + if (granule.end <= keyRange.begin) { continue; } - workerId = decodeBlobGranuleMappingValue(blobGranuleMapping[i].value); - // prune first/last granules to requested range - if (keyRange.begin > granuleStartKey) { - granuleStartKey = keyRange.begin; + state BlobWorkerInterface bwInterf = self->trState->cx->blobWorker_interf[blobGranuleMapping[i].second]; + ASSERT(bwInterf.id() != UID()); + if (BG_REQUEST_DEBUG) { + fmt::print("Blob granule request mapping [{0} - {1})={2}\n", + granule.begin.printable(), + granule.end.printable(), + bwInterf.id().toString().substr(0, 5)); } - if (keyRange.end < granuleEndKey) { - granuleEndKey = keyRange.end; + // prune first/last granules to requested range + if (keyRange.begin > granule.begin) { + granule = KeyRangeRef(keyRange.begin, granule.end); + } + if (keyRange.end < granule.end) { + granule = KeyRangeRef(granule.begin, keyRange.end); + } + + if (g_network->isSimulated() && !g_simulator->speedUpSimulation && BUGGIFY_WITH_PROB(0.01)) { + // simulate as if we read a stale mapping and a different worker owns the granule + ASSERT(!self->trState->cx->blobWorker_interf.empty()); + CODE_PROBE(true, "Randomizing blob worker id for request"); + TraceEvent ev("RandomizingBlobWorkerForReq"); + ev.detail("OriginalWorker", bwInterf.id()); + int randomIdx = deterministicRandom()->randomInt(0, self->trState->cx->blobWorker_interf.size()); + for (auto& it : self->trState->cx->blobWorker_interf) { + if (randomIdx == 0) { + bwInterf = it.second; + break; + } + randomIdx--; + } + ev.detail("NewWorker", bwInterf.id()); } state BlobGranuleFileRequest req; - req.keyRange = KeyRangeRef(StringRef(req.arena, granuleStartKey), StringRef(req.arena, granuleEndKey)); + req.keyRange = KeyRangeRef(StringRef(req.arena, granule.begin), StringRef(req.arena, granule.end)); req.beginVersion = begin; req.readVersion = rv; + req.tenantInfo = self->getTenant().present() ? self->trState->getTenantInfo() : TenantInfo(); req.canCollapseBegin = true; // TODO make this a parameter once we support it + req.summarize = summarize; std::vector>> v; - v.push_back( - makeReference>(self->trState->cx->blobWorker_interf[workerId])); + v.push_back(makeReference>(bwInterf)); state Reference>> location = makeReference(v); // use load balance with one option for now for retry and error handling @@ -7780,12 +8398,13 @@ ACTOR Future>> readBlobGranulesActor( nullptr))) { if (BG_REQUEST_DEBUG) { fmt::print("Blob granule request for [{0} - {1}) @ {2} - {3} got reply from {4}:\n", - granuleStartKey.printable(), - granuleEndKey.printable(), + granule.begin.printable(), + granule.end.printable(), begin, rv, - workerId.toString()); + bwInterf.id().toString().substr(0, 5)); } + ASSERT(!rep.chunks.empty()); results.arena().dependsOn(rep.arena); for (auto& chunk : rep.chunks) { if (BG_REQUEST_DEBUG) { @@ -7805,10 +8424,39 @@ ACTOR Future>> readBlobGranulesActor( chunk.newDeltas[chunk.newDeltas.size() - 1].version); } fmt::print(" IncludedVersion: {0}\n\n\n", chunk.includedVersion); + if (chunk.tenantPrefix.present()) { + fmt::print(" TenantPrefix: {0}\n", chunk.tenantPrefix.get().printable()); + } + } + + ASSERT(chunk.tenantPrefix.present() == self->getTenant().present()); + if (chunk.tenantPrefix.present()) { + ASSERT(chunk.tenantPrefix.get() == self->getTenant().get()->prefix()); } + if (!results.empty() && results.back().keyRange.end != chunk.keyRange.begin) { + ASSERT(results.back().keyRange.end > chunk.keyRange.begin); + ASSERT(results.back().keyRange.end <= chunk.keyRange.end); + CODE_PROBE(true, "Merge while reading granule range", probe::decoration::rare); + while (!results.empty() && results.back().keyRange.begin >= chunk.keyRange.begin) { + // TODO: we can't easily un-depend the arenas for these guys, but that's ok as this + // should be rare + results.pop_back(); + } + ASSERT(results.empty() || results.back().keyRange.end == chunk.keyRange.begin); + } results.push_back(results.arena(), chunk); - keyRange = KeyRangeRef(std::min(chunk.keyRange.end, keyRange.end), keyRange.end); + StringRef chunkEndKey = chunk.keyRange.end; + if (chunk.tenantPrefix.present()) { + chunkEndKey = chunkEndKey.removePrefix(chunk.tenantPrefix.get()); + } + keyRange = KeyRangeRef(std::min(chunkEndKey, keyRange.end), keyRange.end); + if (summarize && results.size() == chunkLimit) { + break; + } + } + if (summarize && results.size() == chunkLimit) { + break; } } // if we detect that this blob worker fails, cancel the request, as otherwise load balance will @@ -7817,26 +8465,30 @@ ACTOR Future>> readBlobGranulesActor( location->get(0, &BlobWorkerInterface::blobGranuleFileRequest).getEndpoint(), FailureStatus(true)))) { if (BG_REQUEST_DEBUG) { - fmt::print("readBlobGranules got BW {0} failed\n", workerId.toString()); + fmt::print("readBlobGranules got BW {0} failed\n", bwInterf.id().toString()); } - throw connection_failed(); } } } catch (Error& e) { if (BG_REQUEST_DEBUG) { - fmt::print("BGReq got error {}\n", e.name()); + fmt::print("Blob granule request for [{0} - {1}) @ {2} - {3} got error from {4}: {5}\n", + granule.begin.printable(), + granule.end.printable(), + begin, + rv, + bwInterf.id().toString().substr(0, 5), + e.name()); } // worker is up but didn't actually have granule, or connection failed if (e.code() == error_code_wrong_shard_server || e.code() == error_code_connection_failed) { - // need to re-read mapping, throw transaction_too_old so client retries. TODO better error? - throw transaction_too_old(); + throw blob_granule_request_failed(); } throw e; } } - self->trState->cx->anyBlobGranuleRequests = true; + self->trState->cx->anyBGReads = true; self->trState->cx->bgGranulesPerRequest.addSample(results.size()); self->trState->cx->bgLatencies.addSample(now() - startTime); @@ -7850,11 +8502,46 @@ Future>> Transaction::readBlobGranules Version begin, Optional readVersion, Version* readVersionOut) { - return readBlobGranulesActor(this, range, begin, readVersion, readVersionOut); + return readBlobGranulesActor( + this, range, begin, readVersion, readVersionOut, std::numeric_limits::max(), false); } -ACTOR Future setPerpetualStorageWiggle(Database cx, bool enable, LockAware lockAware) { +ACTOR Future>> summarizeBlobGranulesActor(Transaction* self, + KeyRange range, + Optional summaryVersion, + int rangeLimit) { + state Version readVersionOut; + Standalone> chunks = + wait(readBlobGranulesActor(self, range, 0, summaryVersion, &readVersionOut, rangeLimit, true)); + ASSERT(chunks.size() <= rangeLimit); + ASSERT(!summaryVersion.present() || readVersionOut == summaryVersion.get()); + Standalone> summaries; + summaries.reserve(summaries.arena(), chunks.size()); + for (auto& it : chunks) { + summaries.push_back(summaries.arena(), summarizeGranuleChunk(summaries.arena(), it)); + } + + return summaries; +} + +Future>> +Transaction::summarizeBlobGranules(const KeyRange& range, Optional summaryVersion, int rangeLimit) { + return summarizeBlobGranulesActor(this, range, summaryVersion, rangeLimit); +} + +void Transaction::addGranuleMaterializeStats(const GranuleMaterializeStats& stats) { + trState->cx->anyBGReads = true; + trState->cx->bgReadInputBytes += stats.inputBytes; + trState->cx->bgReadOutputBytes += stats.outputBytes; + trState->cx->bgReadSnapshotRows += stats.snapshotRows; + trState->cx->bgReadRowsCleared += stats.rowsCleared; + trState->cx->bgReadRowsInserted += stats.rowsInserted; + trState->cx->bgReadRowsUpdated += stats.rowsUpdated; +} + +ACTOR Future setPerpetualStorageWiggle(Database cx, bool enable, LockAware lockAware) { state ReadYourWritesTransaction tr(cx); + state Version version = invalidVersion; loop { try { tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); @@ -7864,22 +8551,180 @@ ACTOR Future setPerpetualStorageWiggle(Database cx, bool enable, LockAware tr.set(perpetualStorageWiggleKey, enable ? "1"_sr : "0"_sr); wait(tr.commit()); + version = tr.getCommittedVersion(); break; } catch (Error& e) { wait(tr.onError(e)); } } - return Void(); + return version; +} + +ACTOR Future checkBlobSubrange(Database db, KeyRange keyRange, Optional version) { + state Transaction tr(db); + state Optional summaryVersion; + if (version.present()) { + summaryVersion = version.get(); + } + loop { + try { + if (!summaryVersion.present()) { + // fill summary version at the start, so that retries use the same version + Version summaryVersion_ = wait(tr.getReadVersion()); + summaryVersion = summaryVersion_; + } + // same properties as a read for validating granule is readable, just much less memory and network bandwidth + // used + wait(success(tr.summarizeBlobGranules(keyRange, summaryVersion, std::numeric_limits::max()))); + return summaryVersion.get(); + } catch (Error& e) { + wait(tr.onError(e)); + } + } +} + +ACTOR Future verifyBlobRangeActor(Reference cx, + KeyRange range, + Optional version, + Optional> tenant) { + state Database db(cx); + state Transaction tr(db); + state Standalone> allRanges; + state KeyRange curRegion = KeyRangeRef(range.begin, range.begin); + state Version readVersionOut = invalidVersion; + state int batchSize = BUGGIFY ? deterministicRandom()->randomInt(2, 10) : CLIENT_KNOBS->BG_TOO_MANY_GRANULES / 2; + state int loadSize = (BUGGIFY ? deterministicRandom()->randomInt(1, 20) : 20) * batchSize; + + if (version.present()) { + if (version.get() == latestVersion) { + loop { + try { + Version _version = wait(tr.getReadVersion()); + version = _version; + break; + } catch (Error& e) { + wait(tr.onError(e)); + } + } + } + if (version.get() <= 0) { + TraceEvent("VerifyBlobInvalidVersion").detail("Range", range).detail("Version", version); + throw unsupported_operation(); + } + } + + if (tenant.present()) { + wait(tenant.get()->ready()); + range = range.withPrefix(tenant.get()->prefix()); + curRegion = KeyRangeRef(range.begin, range.begin); + } + + loop { + if (curRegion.begin >= range.end) { + return readVersionOut; + } + loop { + try { + wait(store(allRanges, tr.getBlobGranuleRanges(KeyRangeRef(curRegion.begin, range.end), loadSize))); + break; + } catch (Error& e) { + wait(tr.onError(e)); + } + } + + if (allRanges.empty()) { + if (curRegion.begin < range.end) { + return invalidVersion; + } + return readVersionOut; + } + + state std::vector> checkParts; + // Chunk up to smaller ranges than this limit. Must be smaller than BG_TOO_MANY_GRANULES to not hit the limit + int batchCount = 0; + for (auto& it : allRanges) { + if (it.begin > curRegion.end) { + return invalidVersion; + } + + curRegion = KeyRangeRef(curRegion.begin, it.end); + batchCount++; + + if (batchCount == batchSize) { + checkParts.push_back(checkBlobSubrange(db, curRegion, version)); + batchCount = 0; + curRegion = KeyRangeRef(curRegion.end, curRegion.end); + } + } + if (!curRegion.empty()) { + checkParts.push_back(checkBlobSubrange(db, curRegion, version)); + } + + try { + wait(waitForAll(checkParts)); + } catch (Error& e) { + if (e.code() == error_code_blob_granule_transaction_too_old) { + return invalidVersion; + } + throw e; + } + ASSERT(!checkParts.empty()); + readVersionOut = checkParts.back().get(); + curRegion = KeyRangeRef(curRegion.end, curRegion.end); + } +} + +Future DatabaseContext::verifyBlobRange(const KeyRange& range, + Optional version, + Optional> tenant) { + return verifyBlobRangeActor(Reference::addRef(this), range, version, tenant); +} + +ACTOR Future flushBlobRangeActor(Reference cx, + KeyRange range, + bool compact, + Optional version, + Optional> tenant) { + if (tenant.present()) { + wait(tenant.get()->ready()); + range = range.withPrefix(tenant.get()->prefix()); + } + state Database db(cx); + if (!version.present()) { + state Transaction tr(db); + Version _v = wait(tr.getReadVersion()); + version = _v; + } + FlushGranuleRequest req(-1, range, version.get(), compact); + try { + wait(success(doBlobGranuleRequests(db, range, req, &BlobWorkerInterface::flushGranuleRequest))); + return true; + } catch (Error& e) { + if (e.code() == error_code_blob_granule_transaction_too_old) { + // can't flush data at this version, because no granules + return false; + } + throw e; + } +} + +Future DatabaseContext::flushBlobRange(const KeyRange& range, + bool compact, + Optional version, + Optional> tenant) { + return flushBlobRangeActor(Reference::addRef(this), range, compact, version, tenant); } ACTOR Future>> readStorageWiggleValues(Database cx, bool primary, bool use_system_priority) { - state const Key readKey = perpetualStorageWiggleIDPrefix.withSuffix(primary ? "primary/"_sr : "remote/"_sr); - state KeyBackedObjectMap metadataMap(readKey, - IncludeVersion()); + state StorageWiggleData wiggleState; + state KeyBackedObjectMap metadataMap = + wiggleState.wigglingStorageServer(PrimaryRegion(primary)); + state Reference tr(new ReadYourWritesTransaction(cx)); - state std::vector> res; + state KeyBackedRangeResult> res; + // read the wiggling pairs loop { try { @@ -7895,14 +8740,15 @@ ACTOR Future>> readStorageWiggleV wait(tr->onError(e)); } } - return res; + return res.results; } ACTOR Future splitStorageMetricsStream(PromiseStream resultStream, Database cx, KeyRange keys, StorageMetrics limit, - StorageMetrics estimated) { + StorageMetrics estimated, + Optional minSplitBytes) { state Span span("NAPI:SplitStorageMetricsStream"_loc); state Key beginKey = keys.begin; state Key globalLastKey = beginKey; @@ -7912,7 +8758,7 @@ ACTOR Future splitStorageMetricsStream(PromiseStream resultStream, loop { state std::vector locations = wait(getKeyRangeLocations(cx, - Optional(), + TenantInfo(), KeyRangeRef(beginKey, keys.end), CLIENT_KNOBS->STORAGE_METRICS_SHARD_LIMIT, Reverse::False, @@ -7933,7 +8779,8 @@ ACTOR Future splitStorageMetricsStream(PromiseStream resultStream, limit, localUsed, estimated, - i == locations.size() - 1 && keys.end <= locations.back().range.end); + i == locations.size() - 1 && keys.end <= locations.back().range.end, + minSplitBytes); SplitMetricsReply res = wait(loadBalance(locations[i].locations->locations(), &StorageServerInterface::splitMetrics, req, @@ -7986,7 +8833,7 @@ ACTOR Future splitStorageMetricsStream(PromiseStream resultStream, resultStream.sendError(e); throw; } - cx->invalidateCache(Key(), keys); + cx->invalidateCache({}, keys); wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution)); } } @@ -7996,20 +8843,84 @@ ACTOR Future splitStorageMetricsStream(PromiseStream resultStream, Future DatabaseContext::splitStorageMetricsStream(const PromiseStream& resultStream, KeyRange const& keys, StorageMetrics const& limit, - StorageMetrics const& estimated) { + StorageMetrics const& estimated, + Optional const& minSplitBytes) { return ::splitStorageMetricsStream( - resultStream, Database(Reference::addRef(this)), keys, limit, estimated); + resultStream, Database(Reference::addRef(this)), keys, limit, estimated, minSplitBytes); +} + +ACTOR Future>>> splitStorageMetricsWithLocations( + std::vector locations, + KeyRange keys, + StorageMetrics limit, + StorageMetrics estimated, + Optional minSplitBytes) { + state StorageMetrics used; + state Standalone> results; + results.push_back_deep(results.arena(), keys.begin); + //TraceEvent("SplitStorageMetrics").detail("Locations", locations.size()); + try { + state int i = 0; + for (; i < locations.size(); i++) { + state Key beginKey = locations[i].range.begin; + loop { + KeyRangeRef range(beginKey, locations[i].range.end); + SplitMetricsRequest req(range, limit, used, estimated, i == locations.size() - 1, minSplitBytes); + SplitMetricsReply res = wait(loadBalance(locations[i].locations->locations(), + &StorageServerInterface::splitMetrics, + req, + TaskPriority::DataDistribution)); + if (res.splits.size() && + res.splits[0] <= results.back()) { // split points are out of order, possibly + // because of moving data, throw error to retry + ASSERT_WE_THINK(false); // FIXME: This seems impossible and doesn't seem to be covered by testing + throw all_alternatives_failed(); + } + + if (res.splits.size()) { + results.append(results.arena(), res.splits.begin(), res.splits.size()); + results.arena().dependsOn(res.splits.arena()); + } + + used = res.used; + + if (res.more && res.splits.size()) { + // Next request will return split points after this one + beginKey = KeyRef(beginKey.arena(), res.splits.back()); + } else { + break; + } + //TraceEvent("SplitStorageMetricsResult").detail("Used", used.bytes).detail("Location", i).detail("Size", res.splits.size()); + } + } + + if (used.allLessOrEqual(limit * CLIENT_KNOBS->STORAGE_METRICS_UNFAIR_SPLIT_LIMIT) && results.size() > 1) { + results.resize(results.arena(), results.size() - 1); + } + + if (keys.end <= locations.back().range.end) { + results.push_back_deep(results.arena(), keys.end); + } + return results; + } catch (Error& e) { + if (e.code() != error_code_wrong_shard_server && e.code() != error_code_all_alternatives_failed) { + TraceEvent(SevError, "SplitStorageMetricsError").error(e); + throw; + } + } + return Optional>>(); } ACTOR Future>> splitStorageMetrics(Database cx, KeyRange keys, StorageMetrics limit, - StorageMetrics estimated) { + StorageMetrics estimated, + Optional minSplitBytes) { state Span span("NAPI:SplitStorageMetrics"_loc); loop { state std::vector locations = wait(getKeyRangeLocations(cx, - Optional(), + TenantInfo(), keys, CLIENT_KNOBS->STORAGE_METRICS_SHARD_LIMIT, Reverse::False, @@ -8018,67 +8929,33 @@ ACTOR Future>> splitStorageMetrics(Database cx, Optional(), UseProvisionalProxies::False, latestVersion)); - state StorageMetrics used; - state Standalone> results; // SOMEDAY: Right now, if there are too many shards we delay and check again later. There may be a better // solution to this. if (locations.size() == CLIENT_KNOBS->STORAGE_METRICS_SHARD_LIMIT) { wait(delay(CLIENT_KNOBS->STORAGE_METRICS_TOO_MANY_SHARDS_DELAY, TaskPriority::DataDistribution)); - cx->invalidateCache(Key(), keys); - } else { - results.push_back_deep(results.arena(), keys.begin); - try { - //TraceEvent("SplitStorageMetrics").detail("Locations", locations.size()); - - state int i = 0; - for (; i < locations.size(); i++) { - SplitMetricsRequest req(locations[i].range, limit, used, estimated, i == locations.size() - 1); - SplitMetricsReply res = wait(loadBalance(locations[i].locations->locations(), - &StorageServerInterface::splitMetrics, - req, - TaskPriority::DataDistribution)); - if (res.splits.size() && - res.splits[0] <= results.back()) { // split points are out of order, possibly because of - // moving data, throw error to retry - ASSERT_WE_THINK( - false); // FIXME: This seems impossible and doesn't seem to be covered by testing - throw all_alternatives_failed(); - } - if (res.splits.size()) { - results.append(results.arena(), res.splits.begin(), res.splits.size()); - results.arena().dependsOn(res.splits.arena()); - } - used = res.used; - - //TraceEvent("SplitStorageMetricsResult").detail("Used", used.bytes).detail("Location", i).detail("Size", res.splits.size()); - } + cx->invalidateCache({}, keys); + continue; + } - if (used.allLessOrEqual(limit * CLIENT_KNOBS->STORAGE_METRICS_UNFAIR_SPLIT_LIMIT) && - results.size() > 1) { - results.resize(results.arena(), results.size() - 1); - } + Optional>> results = + wait(splitStorageMetricsWithLocations(locations, keys, limit, estimated, minSplitBytes)); - if (keys.end <= locations.back().range.end) { - results.push_back_deep(results.arena(), keys.end); - } - return results; - } catch (Error& e) { - if (e.code() != error_code_wrong_shard_server && e.code() != error_code_all_alternatives_failed) { - TraceEvent(SevError, "SplitStorageMetricsError").error(e); - throw; - } - cx->invalidateCache(Key(), keys); - wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution)); - } + if (results.present()) { + return results.get(); } + + cx->invalidateCache({}, keys); + wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution)); } } Future>> DatabaseContext::splitStorageMetrics(KeyRange const& keys, StorageMetrics const& limit, - StorageMetrics const& estimated) { - return ::splitStorageMetrics(Database(Reference::addRef(this)), keys, limit, estimated); + StorageMetrics const& estimated, + Optional const& minSplitBytes) { + return ::splitStorageMetrics( + Database(Reference::addRef(this)), keys, limit, estimated, minSplitBytes); } void Transaction::checkDeferredError() const { @@ -8091,7 +8968,7 @@ Reference Transaction::createTrLogInfoProbabilistically(cons cx->globalConfig->get(fdbClientInfoTxnSampleRate, CLIENT_KNOBS->CSI_SAMPLING_PROBABILITY); if (((networkOptions.logClientInfo.present() && networkOptions.logClientInfo.get()) || BUGGIFY) && deterministicRandom()->random01() < clientSamplingProbability && - (!g_network->isSimulated() || !g_simulator.speedUpSimulation)) { + (!g_network->isSimulated() || !g_simulator->speedUpSimulation)) { return makeReference(TransactionLogInfo::DATABASE); } } @@ -8099,14 +8976,16 @@ Reference Transaction::createTrLogInfoProbabilistically(cons return Reference(); } -void Transaction::setTransactionID(uint64_t id) { +void Transaction::setTransactionID(UID id) { ASSERT(getSize() == 0); - trState->spanID = SpanID(id, trState->spanID.second()); + trState->spanContext = SpanContext(id, trState->spanContext.spanID, trState->spanContext.m_Flags); + tr.spanContext = trState->spanContext; + span.context = trState->spanContext; } void Transaction::setToken(uint64_t token) { ASSERT(getSize() == 0); - trState->spanID = SpanID(trState->spanID.first(), token); + trState->spanContext = SpanContext(trState->spanContext.traceID, token); } void enableClientInfoLogging() { @@ -8138,88 +9017,112 @@ ACTOR Future snapCreate(Database cx, Standalone snapCmd, UID sn } ACTOR template -static Future createCheckpointImpl(T tr, KeyRangeRef range, CheckpointFormat format) { +static Future createCheckpointImpl(T tr, + std::vector ranges, + CheckpointFormat format, + Optional actionId) { ASSERT(!tr->getTenant().present()); - TraceEvent("CreateCheckpointTransactionBegin").detail("Range", range); - - state RangeResult keyServers = wait(krmGetRanges(tr, keyServersPrefix, range)); - ASSERT(!keyServers.more); + ASSERT(!ranges.empty()); + ASSERT(actionId.present()); + TraceEvent(SevDebug, "CreateCheckpointTransactionBegin").detail("Ranges", describe(ranges)); state RangeResult UIDtoTagMap = wait(tr->getRange(serverTagKeys, CLIENT_KNOBS->TOO_MANY)); ASSERT(!UIDtoTagMap.more && UIDtoTagMap.size() < CLIENT_KNOBS->TOO_MANY); - for (int i = 0; i < keyServers.size() - 1; ++i) { - KeyRangeRef shard(keyServers[i].key, keyServers[i + 1].key); - std::vector src; - std::vector dest; - decodeKeyServersValue(UIDtoTagMap, keyServers[i].value, src, dest); - - // The checkpoint request is sent to all replicas, in case any of them is unhealthy. - // An alternative is to choose a healthy replica. - const UID checkpointID = deterministicRandom()->randomUniqueID(); - for (int idx = 0; idx < src.size(); ++idx) { - CheckpointMetaData checkpoint(shard & range, format, src[idx], checkpointID); + state std::unordered_map> rangeMap; + state std::unordered_map> srcMap; + for (const auto& range : ranges) { + RangeResult keyServers = wait(krmGetRanges(tr, keyServersPrefix, range)); + ASSERT(!keyServers.more); + for (int i = 0; i < keyServers.size() - 1; ++i) { + const KeyRangeRef currentRange(keyServers[i].key, keyServers[i + 1].key); + std::vector src; + std::vector dest; + UID srcId; + UID destId; + decodeKeyServersValue(UIDtoTagMap, keyServers[i].value, src, dest, srcId, destId); + rangeMap[srcId].push_back(currentRange); + srcMap.emplace(srcId, src); + } + } + + if (format == DataMoveRocksCF) { + for (const auto& [srcId, ranges] : rangeMap) { + // The checkpoint request is sent to all replicas, in case any of them is unhealthy. + // An alternative is to choose a healthy replica. + const UID checkpointID = UID(deterministicRandom()->randomUInt64(), srcId.first()); + CheckpointMetaData checkpoint(ranges, format, srcMap[srcId], checkpointID, actionId.get()); checkpoint.setState(CheckpointMetaData::Pending); tr->set(checkpointKeyFor(checkpointID), checkpointValue(checkpoint)); - } - TraceEvent("CreateCheckpointTransactionShard") - .detail("Shard", shard) - .detail("SrcServers", describe(src)) - .detail("ServerSelected", describe(src)) - .detail("CheckpointKey", checkpointKeyFor(checkpointID)) - .detail("ReadVersion", tr->getReadVersion().get()); + TraceEvent(SevDebug, "CreateCheckpointTransactionShard") + .detail("CheckpointKey", checkpointKeyFor(checkpointID)) + .detail("CheckpointMetaData", checkpoint.toString()); + } + } else { + throw not_implemented(); } return Void(); } -Future createCheckpoint(Reference tr, KeyRangeRef range, CheckpointFormat format) { - return holdWhile(tr, createCheckpointImpl(tr, range, format)); +Future createCheckpoint(Reference tr, + const std::vector& ranges, + CheckpointFormat format, + Optional actionId) { + return holdWhile(tr, createCheckpointImpl(tr, ranges, format, actionId)); } -Future createCheckpoint(Transaction* tr, KeyRangeRef range, CheckpointFormat format) { - return createCheckpointImpl(tr, range, format); +Future createCheckpoint(Transaction* tr, + const std::vector& ranges, + CheckpointFormat format, + Optional actionId) { + return createCheckpointImpl(tr, ranges, format, actionId); } // Gets CheckpointMetaData of the specific keyrange, version and format from one of the storage servers, if none of the // servers have the checkpoint, a checkpoint_not_found error is returned. -ACTOR static Future getCheckpointMetaDataInternal(GetCheckpointRequest req, +ACTOR static Future getCheckpointMetaDataInternal(KeyRange range, + Version version, + CheckpointFormat format, + Optional actionId, Reference alternatives, double timeout) { - TraceEvent("GetCheckpointMetaDataInternalBegin") - .detail("Range", req.range) - .detail("Version", req.version) - .detail("Format", static_cast(req.format)) + TraceEvent(SevDebug, "GetCheckpointMetaDataInternalBegin") + .detail("Range", range) + .detail("Version", version) + .detail("Format", static_cast(format)) .detail("Locations", alternatives->description()); state std::vector>> futures; state int index = 0; for (index = 0; index < alternatives->size(); ++index) { // For each shard, all storage servers are checked, only one is required. - futures.push_back(errorOr(timeoutError(alternatives->getInterface(index).checkpoint.getReply(req), timeout))); + futures.push_back(errorOr(timeoutError(alternatives->getInterface(index).checkpoint.getReply( + GetCheckpointRequest({ range }, version, format, actionId)), + timeout))); } state Optional error; wait(waitForAll(futures)); - TraceEvent("GetCheckpointMetaDataInternalWaitEnd").detail("Range", req.range).detail("Version", req.version); + TraceEvent(SevDebug, "GetCheckpointMetaDataInternalWaitEnd").detail("Range", range).detail("Version", version); for (index = 0; index < futures.size(); ++index) { if (!futures[index].isReady()) { error = timed_out(); - TraceEvent("GetCheckpointMetaDataInternalSSTimeout") - .detail("Range", req.range) - .detail("Version", req.version) + TraceEvent(SevDebug, "GetCheckpointMetaDataInternalSSTimeout") + .detail("Range", range) + .detail("Version", version) .detail("StorageServer", alternatives->getInterface(index).uniqueID); continue; } if (futures[index].get().isError()) { const Error& e = futures[index].get().getError(); - TraceEvent("GetCheckpointMetaDataInternalError") + TraceEvent(SevWarn, "GetCheckpointMetaDataInternalError") .errorUnsuppressed(e) - .detail("Range", req.range) - .detail("Version", req.version) + .detail("Range", range) + .detail("Version", version) .detail("StorageServer", alternatives->getInterface(index).uniqueID); if (e.code() != error_code_checkpoint_not_found || !error.present()) { error = e; @@ -8233,39 +9136,43 @@ ACTOR static Future getCheckpointMetaDataInternal(GetCheckpo throw error.get(); } -ACTOR Future> getCheckpointMetaData(Database cx, - KeyRange keys, - Version version, - CheckpointFormat format, - double timeout) { - state Span span("NAPI:GetCheckpoint"_loc); +ACTOR static Future>> getCheckpointMetaDataForRange( + Database cx, + KeyRange range, + Version version, + CheckpointFormat format, + Optional actionId, + double timeout) { + state Span span("NAPI:GetCheckpointMetaDataForRange"_loc); state int index = 0; state std::vector> futures; + state std::vector locations; loop { - TraceEvent("GetCheckpointBegin") - .detail("Range", keys.toString()) + locations.clear(); + TraceEvent(SevDebug, "GetCheckpointMetaDataForRangeBegin") + .detail("Range", range.toString()) .detail("Version", version) .detail("Format", static_cast(format)); + futures.clear(); try { - state std::vector locations = - wait(getKeyRangeLocations(cx, - Optional(), - keys, - CLIENT_KNOBS->TOO_MANY, - Reverse::False, - &StorageServerInterface::checkpoint, - span.context, - Optional(), - UseProvisionalProxies::False, - latestVersion)); + wait(store(locations, + getKeyRangeLocations(cx, + TenantInfo(), + range, + CLIENT_KNOBS->TOO_MANY, + Reverse::False, + &StorageServerInterface::checkpoint, + span.context, + Optional(), + UseProvisionalProxies::False, + latestVersion))); - futures.clear(); for (index = 0; index < locations.size(); ++index) { futures.push_back(getCheckpointMetaDataInternal( - GetCheckpointRequest(version, keys, format), locations[index].locations, timeout)); - TraceEvent("GetCheckpointShardBegin") + locations[index].range, version, format, actionId, locations[index].locations, timeout)); + TraceEvent(SevDebug, "GetCheckpointShardBegin") .detail("Range", locations[index].range) .detail("Version", version) .detail("StorageServers", locations[index].locations->description()); @@ -8273,20 +9180,20 @@ ACTOR Future> getCheckpointMetaData(Database cx, choose { when(wait(cx->connectionFileChanged())) { - cx->invalidateCache(KeyRef(), keys); + cx->invalidateCache({}, range); } when(wait(waitForAll(futures))) { break; } when(wait(delay(timeout))) { - TraceEvent("GetCheckpointTimeout").detail("Range", keys).detail("Version", version); + TraceEvent(SevWarn, "GetCheckpointTimeout").detail("Range", range).detail("Version", version); } } } catch (Error& e) { - TraceEvent("GetCheckpointError").errorUnsuppressed(e).detail("Range", keys.toString()); + TraceEvent(SevWarn, "GetCheckpointError").errorUnsuppressed(e).detail("Range", range); if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || e.code() == error_code_connection_failed || e.code() == error_code_broken_promise) { - cx->invalidateCache(KeyRef(), keys); + cx->invalidateCache({}, range); wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY)); } else { throw; @@ -8294,11 +9201,38 @@ ACTOR Future> getCheckpointMetaData(Database cx, } } - std::vector res; + std::vector> res; for (index = 0; index < futures.size(); ++index) { - TraceEvent("GetCheckpointShardEnd").detail("Checkpoint", futures[index].get().toString()); - res.push_back(futures[index].get()); + TraceEvent(SevDebug, "GetCheckpointShardEnd") + .detail("Range", locations[index].range) + .detail("Checkpoint", futures[index].get().toString()); + res.emplace_back(locations[index].range, futures[index].get()); + } + return res; +} + +ACTOR Future>> getCheckpointMetaData(Database cx, + std::vector ranges, + Version version, + CheckpointFormat format, + Optional actionId, + double timeout) { + state std::vector>>> futures; + + // TODO(heliu): Avoid send requests to the same shard. + for (const auto& range : ranges) { + futures.push_back(getCheckpointMetaDataForRange(cx, range, version, format, actionId, timeout)); + } + + std::vector>> results = wait(getAll(futures)); + + std::vector> res; + + for (const auto& r : results) { + ASSERT(!r.empty()); + res.insert(res.end(), r.begin(), r.end()); } + return res; } @@ -8413,16 +9347,13 @@ ACTOR static Future rebootWorkerActor(DatabaseContext* cx, ValueRef add for (const auto& it : kvs) { ClientWorkerInterface workerInterf = BinaryReader::fromStringRef(it.value, IncludeVersion()); - Key primaryAddress = - it.key.endsWith(LiteralStringRef(":tls")) ? it.key.removeSuffix(LiteralStringRef(":tls")) : it.key; + Key primaryAddress = it.key.endsWith(":tls"_sr) ? it.key.removeSuffix(":tls"_sr) : it.key; workerInterfaces[primaryAddress] = workerInterf; // Also add mapping from a worker's second address(if present) to its interface if (workerInterf.reboot.getEndpoint().addresses.secondaryAddress.present()) { Key secondAddress = StringRef(workerInterf.reboot.getEndpoint().addresses.secondaryAddress.get().toString()); - secondAddress = secondAddress.endsWith(LiteralStringRef(":tls")) - ? secondAddress.removeSuffix(LiteralStringRef(":tls")) - : secondAddress; + secondAddress = secondAddress.endsWith(":tls"_sr) ? secondAddress.removeSuffix(":tls"_sr) : secondAddress; workerInterfaces[secondAddress] = workerInterf; } } @@ -8494,38 +9425,33 @@ Future DatabaseContext::initSharedState() { } void DatabaseContext::setSharedState(DatabaseSharedState* p) { - ASSERT(p->protocolVersion == currentProtocolVersion); + ASSERT(p->protocolVersion == currentProtocolVersion()); sharedStatePtr = p; sharedStatePtr->refCount++; } +// FIXME: this has undesired head-of-line-blocking behavior in the case of large version jumps. +// For example, say that The current feed version is 100, and one waiter wants to wait for the feed version >= 1000. +// This will send a request with minVersion=1000. Then say someone wants to wait for feed version >= 200. Because we've +// already blocked this updater on version 1000, even if the feed would already be at version 200+, we won't get an +// empty version response until version 1000. ACTOR Future storageFeedVersionUpdater(StorageServerInterface interf, ChangeFeedStorageData* self) { - state Promise destroyed = self->destroyed; loop { - if (destroyed.isSet()) { - return Void(); - } if (self->version.get() < self->desired.get()) { wait(delay(CLIENT_KNOBS->CHANGE_FEED_EMPTY_BATCH_TIME) || self->version.whenAtLeast(self->desired.get())); - if (destroyed.isSet()) { - return Void(); - } if (self->version.get() < self->desired.get()) { try { ChangeFeedVersionUpdateReply rep = wait(brokenPromiseToNever( interf.changeFeedVersionUpdate.getReply(ChangeFeedVersionUpdateRequest(self->desired.get())))); - if (rep.version > self->version.get()) { self->version.set(rep.version); } } catch (Error& e) { - if (e.code() == error_code_server_overloaded) { - if (FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY > CLIENT_KNOBS->CHANGE_FEED_EMPTY_BATCH_TIME) { - wait(delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY - - CLIENT_KNOBS->CHANGE_FEED_EMPTY_BATCH_TIME)); - } - } else { - throw e; + if (e.code() != error_code_server_overloaded) { + throw; + } + if (FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY > CLIENT_KNOBS->CHANGE_FEED_EMPTY_BATCH_TIME) { + wait(delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY - CLIENT_KNOBS->CHANGE_FEED_EMPTY_BATCH_TIME)); } } } @@ -8535,6 +9461,104 @@ ACTOR Future storageFeedVersionUpdater(StorageServerInterface interf, Chan } } +ACTOR Future changeFeedCommitter(IKeyValueStore* storage, + Reference> commitChangeFeedStorage, + int64_t* uncommittedCFBytes) { + loop { + while (!commitChangeFeedStorage->get()) { + wait(commitChangeFeedStorage->onChange()); + } + *uncommittedCFBytes = 0; + commitChangeFeedStorage->set(false); + wait(storage->commit()); + } +} + +ACTOR Future cleanupChangeFeedCache(DatabaseContext* db) { + wait(db->initializeChangeFeedCache); + wait(delay(CLIENT_KNOBS->CHANGE_FEED_CACHE_EXPIRE_TIME)); + loop { + for (auto it = db->changeFeedCaches.begin(); it != db->changeFeedCaches.end(); ++it) { + if (!it->second->active && now() - it->second->inactiveTime > CLIENT_KNOBS->CHANGE_FEED_CACHE_EXPIRE_TIME) { + Key beginKey = changeFeedCacheKey(it->first.tenantPrefix, it->first.rangeId, it->first.range, 0); + Key endKey = + changeFeedCacheKey(it->first.tenantPrefix, it->first.rangeId, it->first.range, MAX_VERSION); + db->storage->clear(KeyRangeRef(beginKey, endKey)); + KeyRange feedRange = + singleKeyRange(changeFeedCacheFeedKey(it->first.tenantPrefix, it->first.rangeId, it->first.range)); + db->storage->clear(feedRange); + + db->uncommittedCFBytes += beginKey.size() + endKey.size() + feedRange.expectedSize(); + if (db->uncommittedCFBytes > CLIENT_KNOBS->CHANGE_FEED_CACHE_FLUSH_BYTES) { + db->commitChangeFeedStorage->set(true); + } + + auto& rangeIdCache = db->rangeId_cacheData[it->first.rangeId]; + rangeIdCache.erase(it->first); + if (rangeIdCache.empty()) { + db->rangeId_cacheData.erase(it->first.rangeId); + } + db->changeFeedCaches.erase(it); + break; + } + } + wait(delay(5.0)); + } +} + +ACTOR Future initializeCFCache(DatabaseContext* db) { + state Key beginKey = changeFeedCacheFeedKeys.begin; + loop { + RangeResult res = wait(db->storage->readRange(KeyRangeRef(beginKey, changeFeedCacheFeedKeys.end), + CLIENT_KNOBS->CHANGE_FEED_CACHE_LIMIT_BYTES, + CLIENT_KNOBS->CHANGE_FEED_CACHE_LIMIT_BYTES)); + if (res.size()) { + beginKey = keyAfter(res.back().key); + } else { + ASSERT(!res.more); + } + for (auto& kv : res) { + ChangeFeedCacheRange cf(decodeChangeFeedCacheFeedKey(kv.key)); + Reference data = makeReference(); + auto val = decodeChangeFeedCacheFeedValue(kv.value); + data->version = val.first; + data->popped = val.second; + data->active = false; + data->inactiveTime = now(); + db->changeFeedCaches[cf] = data; + db->rangeId_cacheData[cf.rangeId][cf] = data; + } + if (!res.more) { + break; + } + } + return Void(); +} + +ACTOR Future handleShutdown(DatabaseContext* db) { + try { + wait(db->storage->getError()); + } catch (Error& e) { + TraceEvent("ChangeFeedCacheDiskError").error(e); + } + db->initializeChangeFeedCache = Void(); + db->storage = nullptr; + db->changeFeedStorageCommitter = Void(); + return Void(); +} + +void DatabaseContext::setStorage(IKeyValueStore* store) { + if (storage != nullptr) { + TraceEvent(SevError, "NativeClientMultipleSetStorage"); + return; + } + storage = store; + commitChangeFeedStorage = makeReference>(false); + initializeChangeFeedCache = initializeCFCache(this); + changeFeedStorageCommitter = changeFeedCommitter(storage, commitChangeFeedStorage, &uncommittedCFBytes) && + cleanupChangeFeedCache(this) && handleShutdown(this); +} + Reference DatabaseContext::getStorageData(StorageServerInterface interf) { // use token from interface since that changes on SS restart UID token = interf.waitFailure.getEndpoint().token; @@ -8544,10 +9568,334 @@ Reference DatabaseContext::getStorageData(StorageServerIn newStorageUpdater->id = interf.id(); newStorageUpdater->interfToken = token; newStorageUpdater->updater = storageFeedVersionUpdater(interf, newStorageUpdater.getPtr()); - changeFeedUpdaters[token] = newStorageUpdater; + newStorageUpdater->context = this; + newStorageUpdater->created = now(); + changeFeedUpdaters[token] = newStorageUpdater.getPtr(); return newStorageUpdater; } - return it->second; + return Reference::addRef(it->second); +} + +Version DatabaseContext::getMinimumChangeFeedVersion() { + Version minVersion = std::numeric_limits::max(); + for (auto& it : changeFeedUpdaters) { + if (now() - it.second->created > CLIENT_KNOBS->CHANGE_FEED_START_INTERVAL) { + minVersion = std::min(minVersion, it.second->version.get()); + } + } + for (auto& it : notAtLatestChangeFeeds) { + if (now() - it.second->created > CLIENT_KNOBS->CHANGE_FEED_START_INTERVAL) { + minVersion = std::min(minVersion, it.second->getVersion()); + } + } + return minVersion; +} + +void DatabaseContext::setDesiredChangeFeedVersion(Version v) { + for (auto& it : changeFeedUpdaters) { + if (it.second->version.get() < v && it.second->desired.get() < v) { + it.second->desired.set(v); + } + } +} + +// Because two storage servers, depending on the shard map, can have different representations of a clear at the same +// version depending on their shard maps at the time of the mutation, it is non-trivial to directly compare change feed +// streams. Instead we compare the presence of data at each version. This both saves on cpu cost of validation, and +// because historically most change feed corruption bugs are the absence of entire versions, not a subset of mutations +// within a version. +struct ChangeFeedTSSValidationData { + PromiseStream ssStreamSummary; + ReplyPromiseStream tssStream; + Future validatorFuture; + std::deque> rollbacks; + Version popVersion = invalidVersion; + bool done = false; + + ChangeFeedTSSValidationData() {} + ChangeFeedTSSValidationData(ReplyPromiseStream tssStream) : tssStream(tssStream) {} + + void updatePopped(Version newPopVersion) { popVersion = std::max(popVersion, newPopVersion); } + + bool checkRollback(const MutationsAndVersionRef& m) { + if (m.mutations.size() == 1 && m.mutations.back().param1 == lastEpochEndPrivateKey) { + if (rollbacks.empty() || rollbacks.back().second < m.version) { + Version rollbackVersion; + BinaryReader br(m.mutations.back().param2, Unversioned()); + br >> rollbackVersion; + if (!rollbacks.empty()) { + ASSERT(rollbacks.back().second <= rollbackVersion); + } + rollbacks.push_back({ rollbackVersion, m.version }); + } + return true; + } else { + return false; + } + } + + bool shouldAddMutation(const MutationsAndVersionRef& m) { + return !done && !m.mutations.empty() && !checkRollback(m); + } + + bool isRolledBack(Version v) { + if (rollbacks.empty()) { + return false; + } + for (int i = 0; i < rollbacks.size(); i++) { + if (v <= rollbacks[i].first) { + return false; + } + if (v < rollbacks[i].second) { + return true; + } + } + return false; + } + + void send(const ChangeFeedStreamReply& ssReply) { + if (done) { + return; + } + updatePopped(ssReply.popVersion); + for (auto& it : ssReply.mutations) { + if (shouldAddMutation(it)) { + ssStreamSummary.send(it.version); + } + } + } + + void complete() { + done = true; + // destroy TSS stream to stop server actor + tssStream.reset(); + } +}; + +void handleTSSChangeFeedMismatch(const ChangeFeedStreamRequest& request, + const TSSEndpointData& tssData, + int64_t matchesFound, + Version lastMatchingVersion, + Version ssVersion, + Version tssVersion, + Version popVersion) { + if (request.canReadPopped) { + // There is a known issue where this can return different data between an SS and TSS when a feed was popped but + // the SS restarted before the pop could be persisted, for reads that can read popped data. As such, only count + // this as a mismatch when !req.canReadPopped + return; + } + CODE_PROBE(true, "TSS mismatch in stream comparison"); + + if (tssData.metrics->shouldRecordDetailedMismatch()) { + TraceEvent mismatchEvent( + (g_network->isSimulated() && g_simulator->tssMode == ISimulator::TSSMode::EnabledDropMutations) + ? SevWarnAlways + : SevError, + "TSSMismatchChangeFeedStream"); + mismatchEvent.setMaxEventLength(FLOW_KNOBS->TSS_LARGE_TRACE_SIZE); + + // request info + mismatchEvent.detail("TSSID", tssData.tssId); + mismatchEvent.detail("FeedID", request.rangeID); + mismatchEvent.detail("BeginVersion", request.begin); + mismatchEvent.detail("EndVersion", request.end); + mismatchEvent.detail("StartKey", request.range.begin); + mismatchEvent.detail("EndKey", request.range.end); + mismatchEvent.detail("CanReadPopped", request.canReadPopped); + mismatchEvent.detail("PopVersion", popVersion); + mismatchEvent.detail("DebugUID", request.id); + + // mismatch info + mismatchEvent.detail("MatchesFound", matchesFound); + mismatchEvent.detail("LastMatchingVersion", lastMatchingVersion); + mismatchEvent.detail("SSVersion", ssVersion); + mismatchEvent.detail("TSSVersion", tssVersion); + + CODE_PROBE(FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL, + "Tracing Full TSS Feed Mismatch in stream comparison", + probe::decoration::rare); + CODE_PROBE(!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL, + "Tracing Partial TSS Feed Mismatch in stream comparison and storing the rest in FDB"); + + if (!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL) { + mismatchEvent.disable(); + UID mismatchUID = deterministicRandom()->randomUniqueID(); + tssData.metrics->recordDetailedMismatchData(mismatchUID, mismatchEvent.getFields().toString()); + + // record a summarized trace event instead + TraceEvent summaryEvent( + (g_network->isSimulated() && g_simulator->tssMode == ISimulator::TSSMode::EnabledDropMutations) + ? SevWarnAlways + : SevError, + "TSSMismatchChangeFeedStream"); + summaryEvent.detail("TSSID", tssData.tssId) + .detail("MismatchId", mismatchUID) + .detail("FeedDebugUID", request.id); + } + } +} + +ACTOR Future changeFeedTSSValidator(ChangeFeedStreamRequest req, + Optional* data, + TSSEndpointData tssData) { + state bool ssDone = false; + state bool tssDone = false; + state std::deque ssSummary; + state std::deque tssSummary; + + ASSERT(data->present()); + state int64_t matchesFound = 0; + state Version lastMatchingVersion = req.begin - 1; + + loop { + // If SS stream gets error, whole stream data gets reset, so it's ok to cancel this actor + if (!ssDone && ssSummary.empty()) { + try { + Version next = waitNext(data->get().ssStreamSummary.getFuture()); + ssSummary.push_back(next); + } catch (Error& e) { + if (e.code() == error_code_actor_cancelled) { + throw; + } + if (e.code() != error_code_end_of_stream) { + data->get().complete(); + if (e.code() != error_code_operation_cancelled) { + tssData.metrics->ssError(e.code()); + } + throw e; + } + ssDone = true; + if (tssDone) { + data->get().complete(); + return Void(); + } + } + } + + if (!tssDone && tssSummary.empty()) { + try { + choose { + when(ChangeFeedStreamReply nextTss = waitNext(data->get().tssStream.getFuture())) { + data->get().updatePopped(nextTss.popVersion); + for (auto& it : nextTss.mutations) { + if (data->get().shouldAddMutation(it)) { + tssSummary.push_back(it.version); + } + } + } + // if ss has result, tss needs to return it + when(wait((ssDone || !ssSummary.empty()) ? delay(2.0 * FLOW_KNOBS->LOAD_BALANCE_TSS_TIMEOUT) + : Never())) { + ++tssData.metrics->tssTimeouts; + data->get().complete(); + return Void(); + } + } + + } catch (Error& e) { + if (e.code() == error_code_operation_cancelled) { + throw e; + } + if (e.code() == error_code_end_of_stream) { + tssDone = true; + if (ssDone) { + data->get().complete(); + return Void(); + } + } else { + tssData.metrics->tssError(e.code()); + data->get().complete(); + return Void(); + } + } + } + + // handle rollbacks and concurrent pops + while (!ssSummary.empty() && + (ssSummary.front() < data->get().popVersion || data->get().isRolledBack(ssSummary.front()))) { + ssSummary.pop_front(); + } + + while (!tssSummary.empty() && + (tssSummary.front() < data->get().popVersion || data->get().isRolledBack(tssSummary.front()))) { + tssSummary.pop_front(); + } + while (!ssSummary.empty() && !tssSummary.empty()) { + CODE_PROBE(true, "Comparing TSS change feed data"); + if (ssSummary.front() != tssSummary.front()) { + CODE_PROBE(true, "TSS change feed mismatch"); + handleTSSChangeFeedMismatch(req, + tssData, + matchesFound, + lastMatchingVersion, + ssSummary.front(), + tssSummary.front(), + data->get().popVersion); + data->get().complete(); + return Void(); + } + matchesFound++; + lastMatchingVersion = ssSummary.front(); + ssSummary.pop_front(); + tssSummary.pop_front(); + + while (!data->get().rollbacks.empty() && data->get().rollbacks.front().second <= lastMatchingVersion) { + data->get().rollbacks.pop_front(); + } + } + + ASSERT(!ssDone || !tssDone); // both shouldn't be done, otherwise we shouldn't have looped + if ((ssDone && !tssSummary.empty()) || (tssDone && !ssSummary.empty())) { + CODE_PROBE(true, "TSS change feed mismatch at end of stream"); + handleTSSChangeFeedMismatch(req, + tssData, + matchesFound, + lastMatchingVersion, + ssDone ? -1 : ssSummary.front(), + tssDone ? -1 : tssSummary.front(), + data->get().popVersion); + data->get().complete(); + return Void(); + } + } +} + +void maybeDuplicateTSSChangeFeedStream(ChangeFeedStreamRequest& req, + const RequestStream& stream, + QueueModel* model, + Optional* tssData) { + if (model) { + Optional tssPair = model->getTssData(stream.getEndpoint().token.first()); + if (tssPair.present()) { + CODE_PROBE(true, "duplicating feed stream to TSS"); + resetReply(req); + + RequestStream tssRequestStream(tssPair.get().endpoint); + *tssData = Optional( + ChangeFeedTSSValidationData(tssRequestStream.getReplyStream(req))); + // tie validator actor to the lifetime of the stream being active + tssData->get().validatorFuture = changeFeedTSSValidator(req, tssData, tssPair.get()); + } + } +} + +ChangeFeedStorageData::~ChangeFeedStorageData() { + if (context) { + context->changeFeedUpdaters.erase(interfToken); + } +} + +ChangeFeedData::ChangeFeedData(DatabaseContext* context) + : dbgid(deterministicRandom()->randomUniqueID()), context(context), notAtLatest(1), created(now()) { + if (context) { + context->notAtLatestChangeFeeds[dbgid] = this; + } +} +ChangeFeedData::~ChangeFeedData() { + if (context) { + context->notAtLatestChangeFeeds.erase(dbgid); + } } Version ChangeFeedData::getVersion() { @@ -8653,7 +10001,8 @@ ACTOR Future partialChangeFeedStream(StorageServerInterface interf, Version end, Reference feedData, Reference storageData, - UID debugUID) { + UID debugUID, + Optional* tssData) { // calling lastReturnedVersion's callbacks could cause us to be cancelled state Promise refresh = feedData->refresh; @@ -8697,6 +10046,9 @@ ACTOR Future partialChangeFeedStream(StorageServerInterface interf, if (rep.popVersion > feedData->popVersion) { feedData->popVersion = rep.popVersion; } + if (tssData->present()) { + tssData->get().updatePopped(rep.popVersion); + } if (lastEmpty != invalidVersion && !results.isEmpty()) { for (auto& it : feedData->storageData) { @@ -8711,6 +10063,10 @@ ACTOR Future partialChangeFeedStream(StorageServerInterface interf, while (resultLoc < rep.mutations.size()) { wait(results.onEmpty()); if (rep.mutations[resultLoc].version >= nextVersion) { + if (tssData->present() && tssData->get().shouldAddMutation(rep.mutations[resultLoc])) { + tssData->get().ssStreamSummary.send(rep.mutations[resultLoc].version); + } + results.send(rep.mutations[resultLoc]); if (DEBUG_CF_CLIENT_TRACE) { @@ -8741,6 +10097,9 @@ ACTOR Future partialChangeFeedStream(StorageServerInterface interf, if (refresh.canBeSet() && !atLatestVersion && rep.atLatestVersion) { atLatestVersion = true; feedData->notAtLatest.set(feedData->notAtLatest.get() - 1); + if (feedData->notAtLatest.get() == 0 && feedData->context) { + feedData->context->notAtLatestChangeFeeds.erase(feedData->dbgid); + } } if (refresh.canBeSet() && rep.minStreamVersion > storageData->version.get()) { storageData->version.set(rep.minStreamVersion); @@ -8774,17 +10133,47 @@ ACTOR Future partialChangeFeedStream(StorageServerInterface interf, if (e.code() == error_code_actor_cancelled) { throw; } - results.sendError(e); - return Void(); + results.sendError(e); + return Void(); + } +} + +void writeMutationsToCache(Reference cacheData, + Reference db, + Standalone> cacheOut, + Key rangeID, + KeyRange range, + Key tenantPrefix) { + if (!cacheData) { + return; + } + ASSERT(cacheData->active); + while (!cacheOut.empty() && cacheOut.front().version <= cacheData->latest) { + cacheOut.pop_front(); + } + if (!cacheOut.empty()) { + Key durableKey = changeFeedCacheKey(tenantPrefix, rangeID, range, cacheOut.back().version); + Value durableValue = changeFeedCacheValue(cacheOut); + db->storage->set(KeyValueRef(durableKey, durableValue)); + cacheData->latest = cacheOut.back().version; + db->uncommittedCFBytes += durableKey.size() + durableValue.size(); + if (db->uncommittedCFBytes > CLIENT_KNOBS->CHANGE_FEED_CACHE_FLUSH_BYTES) { + db->commitChangeFeedStorage->set(true); + } } } ACTOR Future mergeChangeFeedStreamInternal(Reference results, + Key rangeID, + KeyRange range, std::vector> interfs, std::vector streams, Version* begin, Version end, - UID mergeCursorUID) { + UID mergeCursorUID, + Reference db, + Reference cacheData, + Key tenantPrefix) { state Promise refresh = results->refresh; // with empty version handling in the partial cursor, all streams will always have a next element with version >= // the minimum version of any stream's next element @@ -8881,7 +10270,7 @@ ACTOR Future mergeChangeFeedStreamInternal(Reference resul ASSERT(results->mutations.isEmpty()); } else { ASSERT(nextOut.back().version > results->lastReturnedVersion.get()); - + writeMutationsToCache(cacheData, db, nextOut, rangeID, range, tenantPrefix); results->mutations.send(nextOut); wait(results->mutations.onEmpty()); wait(delay(0)); @@ -8897,45 +10286,56 @@ ACTOR Future mergeChangeFeedStream(Reference db, std::vector> interfs, Reference results, Key rangeID, + KeyRange range, Version* begin, Version end, int replyBufferSize, - bool canReadPopped) { + bool canReadPopped, + ReadOptions readOptions, + bool encrypted, + Reference cacheData, + Key tenantPrefix) { state std::vector> fetchers(interfs.size()); state std::vector> onErrors(interfs.size()); state std::vector streams(interfs.size()); + state std::vector> tssDatas; + tssDatas.reserve(interfs.size()); + for (int i = 0; i < interfs.size(); i++) { + tssDatas.push_back({}); + } - TEST(interfs.size() > 10); // Large change feed merge cursor - TEST(interfs.size() > 100); // Very large change feed merge cursor + CODE_PROBE(interfs.size() > 10, "Large change feed merge cursor"); + CODE_PROBE(interfs.size() > 100, "Very large change feed merge cursor"); state UID mergeCursorUID = UID(); state std::vector debugUIDs; results->streams.clear(); - for (auto& it : interfs) { + for (int i = 0; i < interfs.size(); i++) { ChangeFeedStreamRequest req; req.rangeID = rangeID; req.begin = *begin; req.end = end; - req.range = it.second; + req.range = interfs[i].second; req.canReadPopped = canReadPopped; // divide total buffer size among sub-streams, but keep individual streams large enough to be efficient req.replyBufferSize = replyBufferSize / interfs.size(); if (replyBufferSize != -1 && req.replyBufferSize < CLIENT_KNOBS->CHANGE_FEED_STREAM_MIN_BYTES) { req.replyBufferSize = CLIENT_KNOBS->CHANGE_FEED_STREAM_MIN_BYTES; } - req.debugUID = deterministicRandom()->randomUniqueID(); - debugUIDs.push_back(req.debugUID); - mergeCursorUID = - UID(mergeCursorUID.first() ^ req.debugUID.first(), mergeCursorUID.second() ^ req.debugUID.second()); + req.options = readOptions; + req.id = deterministicRandom()->randomUniqueID(); + req.encrypted = encrypted; - results->streams.push_back(it.first.changeFeedStream.getReplyStream(req)); - } + debugUIDs.push_back(req.id); + mergeCursorUID = UID(mergeCursorUID.first() ^ req.id.first(), mergeCursorUID.second() ^ req.id.second()); - for (auto& it : results->storageData) { - if (it->debugGetReferenceCount() == 2) { - db->changeFeedUpdaters.erase(it->interfToken); - } + results->streams.push_back(interfs[i].first.changeFeedStream.getReplyStream(req)); + maybeDuplicateTSSChangeFeedStream(req, + interfs[i].first.changeFeedStream, + db->enableLocalityLoadBalance ? &db->queueModel : nullptr, + &tssDatas[i]); } + results->maxSeenVersion = invalidVersion; results->storageData.clear(); Promise refresh = results->refresh; @@ -8944,6 +10344,10 @@ ACTOR Future mergeChangeFeedStream(Reference db, results->storageData.push_back(db->getStorageData(interfs[i].first)); } results->notAtLatest.set(interfs.size()); + if (results->context) { + results->context->notAtLatestChangeFeeds[results->dbgid] = results.getPtr(); + results->created = now(); + } refresh.send(Void()); for (int i = 0; i < interfs.size(); i++) { @@ -8966,10 +10370,13 @@ ACTOR Future mergeChangeFeedStream(Reference db, end, results, results->storageData[i], - debugUIDs[i]); + debugUIDs[i], + &tssDatas[i]); } - wait(waitForAny(onErrors) || mergeChangeFeedStreamInternal(results, interfs, streams, begin, end, mergeCursorUID)); + wait(waitForAny(onErrors) || + mergeChangeFeedStreamInternal( + results, rangeID, range, interfs, streams, begin, end, mergeCursorUID, db, cacheData, tenantPrefix)); return Void(); } @@ -8986,6 +10393,8 @@ ACTOR Future getChangeFeedRange(Reference db, Databas loop { try { tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); Version readVer = wait(tr.getReadVersion()); if (readVer < begin) { wait(delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY)); @@ -8993,6 +10402,12 @@ ACTOR Future getChangeFeedRange(Reference db, Databas } else { Optional val = wait(tr.get(rangeIDKey)); if (!val.present()) { + ASSERT(tr.getReadVersion().isReady()); + TraceEvent(SevDebug, "ChangeFeedNotRegisteredGet") + .detail("FeedID", rangeID) + .detail("FullFeedKey", rangeIDKey) + .detail("BeginVersion", begin) + .detail("ReadVersion", tr.getReadVersion().get()); throw change_feed_not_registered(); } if (db->changeFeedCache.size() > CLIENT_KNOBS->CHANGE_FEED_CACHE_SIZE) { @@ -9012,7 +10427,11 @@ ACTOR Future singleChangeFeedStreamInternal(KeyRange range, Reference results, Key rangeID, Version* begin, - Version end) { + Version end, + Optional* tssData, + Reference db, + Reference cacheData, + Key tenantPrefix) { state Promise refresh = results->refresh; ASSERT(results->streams.size() == 1); @@ -9026,16 +10445,30 @@ ACTOR Future singleChangeFeedStreamInternal(KeyRange range, // update lastReturned once the previous mutation has been consumed if (*begin - 1 > results->lastReturnedVersion.get()) { results->lastReturnedVersion.set(*begin - 1); + if (!refresh.canBeSet()) { + try { + // refresh is set if and only if this actor is cancelled + wait(Future(Void())); + // Catch any unexpected behavior if the above contract is broken + ASSERT(false); + } catch (Error& e) { + ASSERT(e.code() == error_code_actor_cancelled); + throw; + } + } } loop { - + ASSERT(refresh.canBeSet()); state ChangeFeedStreamReply feedReply = waitNext(results->streams[0].getFuture()); *begin = feedReply.mutations.back().version + 1; if (feedReply.popVersion > results->popVersion) { results->popVersion = feedReply.popVersion; } + if (tssData->present()) { + tssData->get().updatePopped(feedReply.popVersion); + } // don't send completely empty set of mutations to promise stream bool anyMutations = false; @@ -9050,6 +10483,11 @@ ACTOR Future singleChangeFeedStreamInternal(KeyRange range, // stream. Anything with mutations should be strictly greater than lastReturnedVersion ASSERT(feedReply.mutations.front().version > results->lastReturnedVersion.get()); + if (tssData->present()) { + tssData->get().send(feedReply); + } + + writeMutationsToCache(cacheData, db, feedReply.mutations, rangeID, range, tenantPrefix); results->mutations.send( Standalone>(feedReply.mutations, feedReply.arena)); @@ -9079,6 +10517,9 @@ ACTOR Future singleChangeFeedStreamInternal(KeyRange range, if (!atLatest && feedReply.atLatestVersion) { atLatest = true; results->notAtLatest.set(0); + if (results->context) { + results->context->notAtLatestChangeFeeds.erase(results->dbgid); + } } if (feedReply.minStreamVersion > results->storageData[0]->version.get()) { @@ -9095,19 +10536,26 @@ ACTOR Future singleChangeFeedStream(Reference db, Version* begin, Version end, int replyBufferSize, - bool canReadPopped) { + bool canReadPopped, + ReadOptions readOptions, + bool encrypted, + Reference cacheData, + Key tenantPrefix) { state Database cx(db); state ChangeFeedStreamRequest req; + state Optional tssData; req.rangeID = rangeID; req.begin = *begin; req.end = end; req.range = range; req.canReadPopped = canReadPopped; req.replyBufferSize = replyBufferSize; - req.debugUID = deterministicRandom()->randomUniqueID(); + req.options = readOptions; + req.id = deterministicRandom()->randomUniqueID(); + req.encrypted = encrypted; if (DEBUG_CF_CLIENT_TRACE) { - TraceEvent(SevDebug, "TraceChangeFeedClientSingleCursor", req.debugUID) + TraceEvent(SevDebug, "TraceChangeFeedClientSingleCursor", req.id) .detail("FeedID", rangeID) .detail("Range", range) .detail("Begin", *begin) @@ -9117,11 +10565,6 @@ ACTOR Future singleChangeFeedStream(Reference db, results->streams.clear(); - for (auto& it : results->storageData) { - if (it->debugGetReferenceCount() == 2) { - db->changeFeedUpdaters.erase(it->interfToken); - } - } results->streams.push_back(interf.changeFeedStream.getReplyStream(req)); results->maxSeenVersion = invalidVersion; @@ -9130,13 +10573,107 @@ ACTOR Future singleChangeFeedStream(Reference db, Promise refresh = results->refresh; results->refresh = Promise(); results->notAtLatest.set(1); + if (results->context) { + results->context->notAtLatestChangeFeeds[results->dbgid] = results.getPtr(); + results->created = now(); + } refresh.send(Void()); - wait(results->streams[0].onError() || singleChangeFeedStreamInternal(range, results, rangeID, begin, end)); + maybeDuplicateTSSChangeFeedStream( + req, interf.changeFeedStream, cx->enableLocalityLoadBalance ? &cx->queueModel : nullptr, &tssData); + + wait(results->streams[0].onError() || + singleChangeFeedStreamInternal(range, results, rangeID, begin, end, &tssData, db, cacheData, tenantPrefix)); return Void(); } +void coalesceChangeFeedLocations(std::vector& locations) { + // FIXME: only coalesce if same tenant! + std::vector teamUIDs; + bool anyToCoalesce = false; + teamUIDs.reserve(locations.size()); + for (int i = 0; i < locations.size(); i++) { + ASSERT(locations[i].locations->size() > 0); + UID teamUID = locations[i].locations->getId(0); + for (int j = 1; j < locations[i].locations->size(); j++) { + UID locUID = locations[i].locations->getId(j); + teamUID = UID(teamUID.first() ^ locUID.first(), teamUID.second() ^ locUID.second()); + } + if (!teamUIDs.empty() && teamUIDs.back() == teamUID) { + anyToCoalesce = true; + } + teamUIDs.push_back(teamUID); + } + + if (!anyToCoalesce) { + return; + } + + CODE_PROBE(true, "coalescing change feed locations"); + + // FIXME: there's technically a probability of "hash" collisions here, but it's extremely low. Could validate that + // two teams with the same xor are in fact the same, or fall back to not doing this if it gets a wrong shard server + // error or something + + std::vector coalesced; + coalesced.reserve(locations.size()); + coalesced.push_back(locations[0]); + for (int i = 1; i < locations.size(); i++) { + if (teamUIDs[i] == teamUIDs[i - 1]) { + coalesced.back().range = KeyRangeRef(coalesced.back().range.begin, locations[i].range.end); + } else { + coalesced.push_back(locations[i]); + } + } + + locations = coalesced; +} + +ACTOR Future getChangeFeedStreamFromDisk(Reference db, + Reference results, + Key rangeID, + Version* begin, + Version end, + KeyRange range, + Key tenantPrefix) { + state bool foundEnd = false; + loop { + Key beginKey = changeFeedCacheKey(tenantPrefix, rangeID, range, *begin); + Key endKey = changeFeedCacheKey(tenantPrefix, rangeID, range, MAX_VERSION); + state RangeResult res = wait(db->storage->readRange(KeyRangeRef(beginKey, endKey), + CLIENT_KNOBS->CHANGE_FEED_CACHE_LIMIT_BYTES, + CLIENT_KNOBS->CHANGE_FEED_CACHE_LIMIT_BYTES)); + state int idx = 0; + + while (!foundEnd && idx < res.size()) { + Standalone> mutations = decodeChangeFeedCacheValue(res[idx].value); + while (!mutations.empty() && mutations.front().version < *begin) { + mutations.pop_front(); + } + while (!mutations.empty() && mutations.back().version >= end) { + mutations.pop_back(); + foundEnd = true; + } + if (!mutations.empty()) { + *begin = mutations.back().version; + results->mutations.send(mutations); + wait(results->mutations.onEmpty()); + wait(delay(0)); + if (*begin > results->lastReturnedVersion.get()) { + results->lastReturnedVersion.set(*begin); + } + } + (*begin)++; + idx++; + } + + if (foundEnd || !res.more) { + return foundEnd; + } + } +} + ACTOR Future getChangeFeedStreamActor(Reference db, Reference results, Key rangeID, @@ -9144,12 +10681,14 @@ ACTOR Future getChangeFeedStreamActor(Reference db, Version end, KeyRange range, int replyBufferSize, - bool canReadPopped) { + bool canReadPopped, + ReadOptions readOptions, + bool encrypted, + Reference cacheData, + Key tenantPrefix) { state Database cx(db); state Span span("NAPI:GetChangeFeedStream"_loc); - results->endVersion = end; - state double sleepWithBackoff = CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY; state Version lastBeginVersion = invalidVersion; @@ -9161,7 +10700,7 @@ ACTOR Future getChangeFeedStreamActor(Reference db, keys = fullRange & range; state std::vector locations = wait(getKeyRangeLocations(cx, - Optional(), + TenantInfo(), keys, CLIENT_KNOBS->CHANGE_FEED_LOCATION_LIMIT, Reverse::False, @@ -9176,6 +10715,10 @@ ACTOR Future getChangeFeedStreamActor(Reference db, throw unknown_change_feed(); } + if (CLIENT_KNOBS->CHANGE_FEED_COALESCE_LOCATIONS && locations.size() > 1) { + coalesceChangeFeedLocations(locations); + } + state std::vector chosenLocations(locations.size()); state int loc = 0; while (loc < locations.size()) { @@ -9198,6 +10741,10 @@ ACTOR Future getChangeFeedStreamActor(Reference db, if (useIdx >= 0) { chosenLocations[loc] = useIdx; loc++; + if (g_network->isSimulated() && !g_simulator->speedUpSimulation && BUGGIFY_WITH_PROB(0.01)) { + // simulate as if we had to wait for all alternatives delayed, before the next one + wait(delay(deterministicRandom()->random01())); + } continue; } @@ -9218,35 +10765,56 @@ ACTOR Future getChangeFeedStreamActor(Reference db, loc = 0; } + ++db->feedStreamStarts; + if (locations.size() > 1) { + ++db->feedMergeStreamStarts; std::vector> interfs; for (int i = 0; i < locations.size(); i++) { interfs.emplace_back(locations[i].locations->getInterface(chosenLocations[i]), locations[i].range & range); } - TEST(true); // Change feed merge cursor + CODE_PROBE(true, "Change feed merge cursor"); // TODO (jslocum): validate connectionFileChanged behavior - wait( - mergeChangeFeedStream(db, interfs, results, rangeID, &begin, end, replyBufferSize, canReadPopped) || - cx->connectionFileChanged()); + wait(mergeChangeFeedStream(db, + interfs, + results, + rangeID, + range, + &begin, + end, + replyBufferSize, + canReadPopped, + readOptions, + encrypted, + cacheData, + tenantPrefix) || + cx->connectionFileChanged()); } else { - TEST(true); // Change feed single cursor + CODE_PROBE(true, "Change feed single cursor"); StorageServerInterface interf = locations[0].locations->getInterface(chosenLocations[0]); - wait(singleChangeFeedStream( - db, interf, range, results, rangeID, &begin, end, replyBufferSize, canReadPopped) || + wait(singleChangeFeedStream(db, + interf, + range, + results, + rangeID, + &begin, + end, + replyBufferSize, + canReadPopped, + readOptions, + encrypted, + cacheData, + tenantPrefix) || cx->connectionFileChanged()); } } catch (Error& e) { if (e.code() == error_code_actor_cancelled || e.code() == error_code_change_feed_popped) { - for (auto& it : results->storageData) { - if (it->debugGetReferenceCount() == 2) { - db->changeFeedUpdaters.erase(it->interfToken); - } - } results->streams.clear(); results->storageData.clear(); if (e.code() == error_code_change_feed_popped) { - TEST(true); // getChangeFeedStreamActor got popped + ++db->feedNonRetriableErrors; + CODE_PROBE(true, "getChangeFeedStreamActor got popped", probe::decoration::rare); results->mutations.sendError(e); results->refresh.sendError(e); } else { @@ -9256,29 +10824,42 @@ ACTOR Future getChangeFeedStreamActor(Reference db, } if (results->notAtLatest.get() == 0) { results->notAtLatest.set(1); + if (results->context) { + results->context->notAtLatestChangeFeeds[results->dbgid] = results.getPtr(); + results->created = now(); + } } if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || e.code() == error_code_connection_failed || e.code() == error_code_unknown_change_feed || - e.code() == error_code_broken_promise) { + e.code() == error_code_broken_promise || e.code() == error_code_future_version || + e.code() == error_code_request_maybe_delivered || + e.code() == error_code_storage_too_many_feed_streams) { + ++db->feedErrors; db->changeFeedCache.erase(rangeID); - cx->invalidateCache(Key(), keys); - if (begin == lastBeginVersion) { + cx->invalidateCache({}, keys); + if (begin == lastBeginVersion || e.code() == error_code_storage_too_many_feed_streams) { // We didn't read anything since the last failure before failing again. - // Do exponential backoff, up to 1 second - sleepWithBackoff = std::min(1.0, sleepWithBackoff * 1.5); + // Back off quickly and exponentially, up to 1 second + sleepWithBackoff = std::min(2.0, sleepWithBackoff * 5); + sleepWithBackoff = std::max(0.1, sleepWithBackoff); } else { sleepWithBackoff = CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY; } + TraceEvent("ChangeFeedClientError") + .errorUnsuppressed(e) + .suppressFor(30.0) + .detail("FeedID", rangeID) + .detail("BeginVersion", begin) + .detail("AnyProgress", begin != lastBeginVersion); wait(delay(sleepWithBackoff)); } else { + if (e.code() != error_code_end_of_stream) { + ++db->feedNonRetriableErrors; + TraceEvent("ChangeFeedClientErrorNonRetryable").errorUnsuppressed(e).suppressFor(5.0); + } results->mutations.sendError(e); results->refresh.sendError(change_feed_cancelled()); - for (auto& it : results->storageData) { - if (it->debugGetReferenceCount() == 2) { - db->changeFeedUpdaters.erase(it->interfToken); - } - } results->streams.clear(); results->storageData.clear(); return Void(); @@ -9287,22 +10868,130 @@ ACTOR Future getChangeFeedStreamActor(Reference db, } } +ACTOR Future durableChangeFeedMonitor(Reference db, + Reference results, + Key rangeID, + Version begin, + Version end, + KeyRange range, + int replyBufferSize, + bool canReadPopped, + ReadOptions readOptions, + bool encrypted, + Future tenantPrefix) { + state Optional cacheRange; + state Reference data; + state Error err = success(); + state Version originalBegin = begin; + results->endVersion = end; + db->usedAnyChangeFeeds = true; + try { + if (db->storage != nullptr) { + wait(db->initializeChangeFeedCache); + Key prefix = wait(tenantPrefix); + cacheRange = ChangeFeedCacheRange(prefix, rangeID, range); + if (db->changeFeedCaches.count(cacheRange.get())) { + auto cacheData = db->changeFeedCaches[cacheRange.get()]; + if (begin < cacheData->popped) { + results->mutations.sendError(change_feed_popped()); + return Void(); + } + if (cacheData->version <= begin) { + bool foundEnd = wait(getChangeFeedStreamFromDisk(db, results, rangeID, &begin, end, range, prefix)); + if (foundEnd) { + results->mutations.sendError(end_of_stream()); + return Void(); + } + } + } + if (end == MAX_VERSION) { + if (!db->changeFeedCaches.count(cacheRange.get())) { + data = makeReference(); + data->version = begin; + data->active = true; + db->changeFeedCaches[cacheRange.get()] = data; + db->rangeId_cacheData[cacheRange.get().rangeId][cacheRange.get()] = data; + Key durableFeedKey = changeFeedCacheFeedKey(cacheRange.get().tenantPrefix, rangeID, range); + Value durableFeedValue = changeFeedCacheFeedValue(begin, 0); + db->storage->set(KeyValueRef(durableFeedKey, durableFeedValue)); + } else { + data = db->changeFeedCaches[cacheRange.get()]; + if (!data->active && data->version <= begin) { + data->active = true; + if (originalBegin > data->latest + 1) { + data->version = originalBegin; + Key durableFeedKey = changeFeedCacheFeedKey(cacheRange.get().tenantPrefix, rangeID, range); + Value durableFeedValue = changeFeedCacheFeedValue(originalBegin, data->popped); + db->storage->set(KeyValueRef(durableFeedKey, durableFeedValue)); + } + } else { + data = Reference(); + } + } + } + } + wait(getChangeFeedStreamActor(db, + results, + rangeID, + begin, + end, + range, + replyBufferSize, + canReadPopped, + readOptions, + encrypted, + data, + cacheRange.present() ? cacheRange.get().tenantPrefix : Key())); + } catch (Error& e) { + err = e; + } + if (data) { + data->active = false; + data->inactiveTime = now(); + } + if (err.code() != error_code_success) { + throw err; + } + return Void(); +} + Future DatabaseContext::getChangeFeedStream(Reference results, Key rangeID, Version begin, Version end, KeyRange range, int replyBufferSize, - bool canReadPopped) { - return getChangeFeedStreamActor( - Reference::addRef(this), results, rangeID, begin, end, range, replyBufferSize, canReadPopped); -} - -ACTOR Future> singleLocationOverlappingChangeFeeds( - Database cx, - Reference location, - KeyRangeRef range, - Version minVersion) { + bool canReadPopped, + ReadOptions readOptions, + bool encrypted, + Future tenantPrefix) { + return durableChangeFeedMonitor(Reference::addRef(this), + results, + rangeID, + begin, + end, + range, + replyBufferSize, + canReadPopped, + readOptions, + encrypted, + tenantPrefix); +} + +Version OverlappingChangeFeedsInfo::getFeedMetadataVersion(const KeyRangeRef& range) const { + Version v = invalidVersion; + for (auto& it : feedMetadataVersions) { + if (it.second > v && it.first.intersects(range)) { + v = it.second; + } + } + return v; +} + +ACTOR Future singleLocationOverlappingChangeFeeds(Database cx, + Reference location, + KeyRangeRef range, + Version minVersion) { state OverlappingChangeFeedsRequest req; req.range = range; req.minVersion = minVersion; @@ -9314,16 +11003,16 @@ ACTOR Future> singleLocationOverlappingC TaskPriority::DefaultPromiseEndpoint, AtMostOnce::False, cx->enableLocalityLoadBalance ? &cx->queueModel : nullptr)); - return rep.rangeIds; + return rep; } bool compareChangeFeedResult(const OverlappingChangeFeedEntry& i, const OverlappingChangeFeedEntry& j) { - return i.rangeId < j.rangeId; + return i.feedId < j.feedId; } -ACTOR Future> getOverlappingChangeFeedsActor(Reference db, - KeyRangeRef range, - Version minVersion) { +ACTOR Future getOverlappingChangeFeedsActor(Reference db, + KeyRangeRef range, + Version minVersion) { state Database cx(db); state Span span("NAPI:GetOverlappingChangeFeeds"_loc); @@ -9331,7 +11020,7 @@ ACTOR Future> getOverlappingChangeFeedsA try { state std::vector locations = wait(getKeyRangeLocations(cx, - Optional(), + TenantInfo(), range, CLIENT_KNOBS->CHANGE_FEED_LOCATION_LIMIT, Reverse::False, @@ -9349,23 +11038,38 @@ ACTOR Future> getOverlappingChangeFeedsA throw all_alternatives_failed(); } - state std::vector>> allOverlappingRequests; + state std::vector> allOverlappingRequests; for (auto& it : locations) { allOverlappingRequests.push_back( singleLocationOverlappingChangeFeeds(cx, it.locations, it.range & range, minVersion)); } wait(waitForAll(allOverlappingRequests)); - std::vector result; - for (auto& it : allOverlappingRequests) { - result.insert(result.end(), it.get().begin(), it.get().end()); + OverlappingChangeFeedsInfo result; + std::unordered_map latestFeedMetadata; + for (int i = 0; i < locations.size(); i++) { + result.arena.dependsOn(allOverlappingRequests[i].get().arena); + result.arena.dependsOn(locations[i].range.arena()); + result.feedMetadataVersions.push_back( + { locations[i].range, allOverlappingRequests[i].get().feedMetadataVersion }); + for (auto& it : allOverlappingRequests[i].get().feeds) { + auto res = latestFeedMetadata.insert({ it.feedId, it }); + if (!res.second) { + CODE_PROBE(true, "deduping fetched overlapping feed by higher metadata version"); + if (res.first->second.feedMetadataVersion < it.feedMetadataVersion) { + res.first->second = it; + } + } + } + } + for (auto& it : latestFeedMetadata) { + result.feeds.push_back(result.arena, it.second); } - std::sort(result.begin(), result.end(), compareChangeFeedResult); - result.resize(std::unique(result.begin(), result.end()) - result.begin()); return result; } catch (Error& e) { - if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) { - cx->invalidateCache(Key(), range); + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || + e.code() == error_code_future_version) { + cx->invalidateCache({}, range); wait(delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY)); } else { throw e; @@ -9374,16 +11078,18 @@ ACTOR Future> getOverlappingChangeFeedsA } } -Future> DatabaseContext::getOverlappingChangeFeeds(KeyRangeRef range, - Version minVersion) { +Future DatabaseContext::getOverlappingChangeFeeds(KeyRangeRef range, Version minVersion) { return getOverlappingChangeFeedsActor(Reference::addRef(this), range, minVersion); } ACTOR static Future popChangeFeedBackup(Database cx, Key rangeID, Version version) { + ++cx->feedPopsFallback; state Transaction tr(cx); loop { try { tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); state Key rangeIDKey = rangeID.withPrefix(changeFeedPrefix); Optional val = wait(tr.get(rangeIDKey)); if (val.present()) { @@ -9395,6 +11101,12 @@ ACTOR static Future popChangeFeedBackup(Database cx, Key rangeID, Version tr.set(rangeIDKey, changeFeedValue(range, version, status)); } } else { + ASSERT(tr.getReadVersion().isReady()); + TraceEvent(SevDebug, "ChangeFeedNotRegisteredPop") + .detail("FeedID", rangeID) + .detail("FullFeedKey", rangeIDKey) + .detail("PopVersion", version) + .detail("ReadVersion", tr.getReadVersion().get()); throw change_feed_not_registered(); } wait(tr.commit()); @@ -9409,12 +11121,34 @@ ACTOR Future popChangeFeedMutationsActor(Reference db, Ke state Database cx(db); state Key rangeIDKey = rangeID.withPrefix(changeFeedPrefix); state Span span("NAPI:PopChangeFeedMutations"_loc); + db->usedAnyChangeFeeds = true; + ++db->feedPops; + + if (db->rangeId_cacheData.count(rangeID)) { + auto& feeds = db->rangeId_cacheData[rangeID]; + for (auto& it : feeds) { + if (version > it.second->popped) { + it.second->popped = version; + Key beginKey = changeFeedCacheKey(it.first.tenantPrefix, it.first.rangeId, it.first.range, 0); + Key endKey = changeFeedCacheKey(it.first.tenantPrefix, it.first.rangeId, it.first.range, version); + db->storage->clear(KeyRangeRef(beginKey, endKey)); + Key durableFeedKey = changeFeedCacheFeedKey(it.first.tenantPrefix, it.first.rangeId, it.first.range); + Value durableFeedValue = changeFeedCacheFeedValue(it.second->version, it.second->popped); + db->storage->set(KeyValueRef(durableFeedKey, durableFeedValue)); + db->uncommittedCFBytes += + beginKey.size() + endKey.size() + durableFeedKey.size() + durableFeedValue.size(); + if (db->uncommittedCFBytes > CLIENT_KNOBS->CHANGE_FEED_CACHE_FLUSH_BYTES) { + db->commitChangeFeedStorage->set(true); + } + } + } + } state KeyRange keys = wait(getChangeFeedRange(db, cx, rangeID)); state std::vector locations = wait(getKeyRangeLocations(cx, - Optional(), + TenantInfo(), keys, 3, Reverse::False, @@ -9429,6 +11163,8 @@ ACTOR Future popChangeFeedMutationsActor(Reference db, Ke return Void(); } + auto model = cx->enableLocalityLoadBalance ? &cx->queueModel : nullptr; + bool foundFailed = false; for (int i = 0; i < locations.size() && !foundFailed; i++) { for (int j = 0; j < locations[i].locations->size() && !foundFailed; j++) { @@ -9437,6 +11173,15 @@ ACTOR Future popChangeFeedMutationsActor(Reference db, Ke .isFailed()) { foundFailed = true; } + // for now, if any of popping SS has a TSS pair, just always use backup method + if (model && model + ->getTssData(locations[i] + .locations->get(j, &StorageServerInterface::changeFeedPop) + .getEndpoint() + .token.first()) + .present()) { + foundFailed = true; + } } } @@ -9467,7 +11212,7 @@ ACTOR Future popChangeFeedMutationsActor(Reference db, Ke throw; } db->changeFeedCache.erase(rangeID); - cx->invalidateCache(Key(), keys); + cx->invalidateCache({}, keys); wait(popChangeFeedBackup(cx, rangeID, version)); } return Void(); @@ -9481,24 +11226,91 @@ Reference DatabaseContext::createTransaction() { return makeReference(Database(Reference::addRef(this))); } +// BlobGranule API. +ACTOR Future>> getBlobRanges(Transaction* tr, KeyRange range, int batchLimit) { + state Standalone> blobRanges; + state Key beginKey = range.begin; + + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + + loop { + + state RangeResult results = + wait(krmGetRangesUnaligned(tr, blobRangeKeys.begin, KeyRangeRef(beginKey, range.end), 2 * batchLimit + 2)); + + blobRanges.arena().dependsOn(results.arena()); + for (int i = 0; i < results.size() - 1; i++) { + if (isBlobRangeActive(results[i].value)) { + blobRanges.push_back(blobRanges.arena(), KeyRangeRef(results[i].key, results[i + 1].key)); + } + if (blobRanges.size() == batchLimit) { + return blobRanges; + } + } + + if (!results.more) { + return blobRanges; + } + beginKey = results.back().key; + } +} + ACTOR Future purgeBlobGranulesActor(Reference db, KeyRange range, Version purgeVersion, + Optional> tenant, bool force) { state Database cx(db); state Transaction tr(cx); state Key purgeKey; + state KeyRange purgeRange = range; - // FIXME: implement force - if (!force) { + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + if (purgeVersion == latestVersion) { + loop { + try { + Version _purgeVersion = wait(tr.getReadVersion()); + purgeVersion = _purgeVersion; + break; + } catch (Error& e) { + wait(tr.onError(e)); + } + } + tr.reset(); + } + if (purgeVersion <= 0) { + TraceEvent("PurgeInvalidVersion").detail("Range", range).detail("Version", purgeVersion).detail("Force", force); throw unsupported_operation(); } + + if (tenant.present()) { + wait(tenant.get()->ready()); + purgeRange = purgeRange.withPrefix(tenant.get()->prefix()); + } + loop { try { tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); - Value purgeValue = blobGranulePurgeValueFor(purgeVersion, range, force); + // must be aligned to blob range(s) + state Future>> blobbifiedBegin = + getBlobRanges(&tr, KeyRangeRef(purgeRange.begin, keyAfter(purgeRange.begin)), 1); + state Future>> blobbifiedEnd = + getBlobRanges(&tr, KeyRangeRef(purgeRange.end, keyAfter(purgeRange.end)), 1); + wait(success(blobbifiedBegin) && success(blobbifiedEnd)); + // If there are no blob ranges on the boundary that's okay as we allow purging of multiple full ranges. + if ((!blobbifiedBegin.get().empty() && blobbifiedBegin.get().front().begin < purgeRange.begin) || + (!blobbifiedEnd.get().empty() && blobbifiedEnd.get().front().begin < purgeRange.end)) { + TraceEvent("UnalignedPurge") + .detail("Range", purgeRange) + .detail("Version", purgeVersion) + .detail("Force", force); + throw unsupported_operation(); + } + + Value purgeValue = blobGranulePurgeValueFor(purgeVersion, purgeRange, force); tr.atomicOp( addVersionStampAtEnd(blobGranulePurgeKeys.begin), purgeValue, MutationRef::SetVersionstampedKey); tr.set(blobGranulePurgeChangeKey, deterministicRandom()->randomUniqueID().toString()); @@ -9508,8 +11320,8 @@ ACTOR Future purgeBlobGranulesActor(Reference db, purgeKey = blobGranulePurgeKeys.begin.withSuffix(vs); if (BG_REQUEST_DEBUG) { fmt::print("purgeBlobGranules for range [{0} - {1}) at version {2} registered {3}\n", - range.begin.printable(), - range.end.printable(), + purgeRange.begin.printable(), + purgeRange.end.printable(), purgeVersion, purgeKey.printable()); } @@ -9517,8 +11329,8 @@ ACTOR Future purgeBlobGranulesActor(Reference db, } catch (Error& e) { if (BG_REQUEST_DEBUG) { fmt::print("purgeBlobGranules for range [{0} - {1}) at version {2} encountered error {3}\n", - range.begin.printable(), - range.end.printable(), + purgeRange.begin.printable(), + purgeRange.end.printable(), purgeVersion, e.name()); } @@ -9528,8 +11340,11 @@ ACTOR Future purgeBlobGranulesActor(Reference db, return purgeKey; } -Future DatabaseContext::purgeBlobGranules(KeyRange range, Version purgeVersion, bool force) { - return purgeBlobGranulesActor(Reference::addRef(this), range, purgeVersion, force); +Future DatabaseContext::purgeBlobGranules(KeyRange range, + Version purgeVersion, + Optional> tenant, + bool force) { + return purgeBlobGranulesActor(Reference::addRef(this), range, purgeVersion, tenant, force); } ACTOR Future waitPurgeGranulesCompleteActor(Reference db, Key purgeKey) { @@ -9564,6 +11379,223 @@ Future DatabaseContext::waitPurgeGranulesComplete(Key purgeKey) { return waitPurgeGranulesCompleteActor(Reference::addRef(this), purgeKey); } +ACTOR Future setBlobRangeActor(Reference cx, + KeyRange range, + bool active, + Optional> tenant) { + state Database db(cx); + state Reference tr = makeReference(db); + + if (tenant.present()) { + wait(tenant.get()->ready()); + range = range.withPrefix(tenant.get()->prefix()); + } + + state Value value = active ? blobRangeActive : blobRangeInactive; + if (active && (!g_network->isSimulated() || !g_simulator->willRestart) && BUGGIFY_WITH_PROB(0.1)) { + // buggify to arbitrary if test isn't a restarting test that could downgrade to an earlier version that doesn't + // support this + int randLen = deterministicRandom()->randomInt(2, 20); + value = StringRef(deterministicRandom()->randomAlphaNumeric(randLen)); + } + Standalone changeLog(BlobRangeChangeLogRef(range, value)); + state Value changeValue = blobRangeChangeLogValueFor(changeLog); + loop { + try { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + + Standalone> startBlobRanges = wait(getBlobRanges(&tr->getTransaction(), range, 1)); + + if (active) { + // Idempotent request. + if (!startBlobRanges.empty()) { + return startBlobRanges.front().begin == range.begin && startBlobRanges.front().end == range.end; + } + } else { + // An unblobbify request must be aligned to boundaries. + // It is okay to unblobbify multiple regions all at once. + if (startBlobRanges.empty()) { + // already unblobbified + return true; + } else if (startBlobRanges.front().begin < range.begin) { + // If there is a blob at the beginning of the range that overlaps the start + return false; + } + // if blob range does start at the specified, key, we need to make sure the end of also a boundary of a + // blob range + Standalone> endBlobRanges = + wait(getBlobRanges(&tr->getTransaction(), singleKeyRange(range.end), 1)); + if (!endBlobRanges.empty() && endBlobRanges.front().begin < range.end) { + return false; + } + } + + tr->set(blobRangeChangeKey, deterministicRandom()->randomUniqueID().toString()); + // This is not coalescing because we want to keep each range logically separate. + // FIXME: if not active, do coalescing - had issues + wait(krmSetRange(tr, blobRangeKeys.begin, range, value)); + // RYWTransaction has issues with atomic op sizing when using addVersionstampAtEnd on old api versions + tr->getTransaction().atomicOp( + addVersionStampAtEnd(blobRangeChangeLogKeys.begin), changeValue, MutationRef::SetVersionstampedKey); + wait(tr->commit()); + return true; + } catch (Error& e) { + wait(tr->onError(e)); + } + } +} + +ACTOR Future blobbifyRangeActor(Reference cx, + KeyRange range, + bool doWait, + Optional> tenant) { + if (BG_REQUEST_DEBUG) { + fmt::print("BlobbifyRange [{0} - {1}) ({2})\n", range.begin.printable(), range.end.printable(), doWait); + } + state bool result = wait(setBlobRangeActor(cx, range, true, tenant)); + if (!doWait || !result) { + return result; + } + // FIXME: add blob worker verifyRange rpc call that just waits for granule to become readable at any version + loop { + Version verifyVersion = wait(cx->verifyBlobRange(range, latestVersion, tenant)); + if (verifyVersion != invalidVersion) { + if (BG_REQUEST_DEBUG) { + fmt::print("BlobbifyRange [{0} - {1}) got complete @ {2}\n", + range.begin.printable(), + range.end.printable(), + verifyVersion); + } + return result; + } + wait(delay(0.1)); + } +} + +Future DatabaseContext::blobbifyRange(KeyRange range, Optional> tenant) { + return blobbifyRangeActor(Reference::addRef(this), range, false, tenant); +} + +Future DatabaseContext::blobbifyRangeBlocking(KeyRange range, Optional> tenant) { + return blobbifyRangeActor(Reference::addRef(this), range, true, tenant); +} + +Future DatabaseContext::unblobbifyRange(KeyRange range, Optional> tenant) { + return setBlobRangeActor(Reference::addRef(this), range, false, tenant); +} + +ACTOR Future>> listBlobbifiedRangesActor(Reference cx, + KeyRange range, + int rangeLimit, + Optional> tenant) { + + state Database db(cx); + state Transaction tr(db); + state KeyRef tenantPrefix; + state Standalone> blobRanges; + + if (tenant.present()) { + wait(tenant.get()->ready()); + tenantPrefix = tenant.get()->prefix(); + range = range.withPrefix(tenantPrefix); + } + + loop { + try { + wait(store(blobRanges, getBlobRanges(&tr, range, rangeLimit))); + break; + } catch (Error& e) { + wait(tr.onError(e)); + } + } + + if (!tenant.present()) { + return blobRanges; + } + + // Strip tenant prefix out. + state Standalone> tenantBlobRanges; + for (auto& blobRange : blobRanges) { + // Filter out blob ranges that span tenants for some reason. + if (!blobRange.begin.startsWith(tenantPrefix) || !blobRange.end.startsWith(tenantPrefix)) { + TraceEvent("ListBlobbifiedRangeSpansTenants") + .suppressFor(/*seconds=*/5) + .detail("Tenant", tenant) + .detail("Range", blobRange); + continue; + } + tenantBlobRanges.push_back_deep(tenantBlobRanges.arena(), blobRange.removePrefix(tenantPrefix)); + } + return tenantBlobRanges; +} + +Future>> DatabaseContext::listBlobbifiedRanges(KeyRange range, + int rangeLimit, + Optional> tenant) { + return listBlobbifiedRangesActor(Reference::addRef(this), range, rangeLimit, tenant); +} + +ACTOR Future blobRestoreActor(Reference cx, KeyRange range, Optional version) { + state Database db(cx); + state Reference tr = makeReference(db); + loop { + try { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + state Key key = blobRestoreCommandKeyFor(range); + Optional value = wait(tr->get(key)); + if (value.present()) { + Standalone restoreState = decodeBlobRestoreState(value.get()); + if (restoreState.phase < BlobRestorePhase::DONE) { + return false; // stop if there is in-progress restore. + } + } + BlobRestoreState restoreState(BlobRestorePhase::INIT); + Value newValue = blobRestoreCommandValueFor(restoreState); + tr->set(key, newValue); + + BlobRestoreArg arg(version); + Value argValue = blobRestoreArgValueFor(arg); + tr->set(blobRestoreArgKeyFor(range), argValue); + + wait(tr->commit()); + return true; + } catch (Error& e) { + wait(tr->onError(e)); + } + } +} + +Future DatabaseContext::blobRestore(KeyRange range, Optional version) { + return blobRestoreActor(Reference::addRef(this), range, version); +} + +ACTOR static Future>> +getHotRangeMetricsActor(Reference db, StorageServerInterface ssi, ReadHotSubRangeRequest req) { + + ErrorOr fs = wait(ssi.getReadHotRanges.tryGetReply(req)); + if (fs.isError()) { + fmt::print("Error({}): cannot get read hot metrics from storage server {}.\n", + fs.getError().what(), + ssi.address().toString()); + return Standalone>(); + } else { + return fs.get().readHotRanges; + } +} + +Future>> DatabaseContext::getHotRangeMetrics( + StorageServerInterface ssi, + const KeyRange& keys, + ReadHotSubRangeRequest::SplitType type, + int splitCount) { + + return getHotRangeMetricsActor( + Reference::addRef(this), ssi, ReadHotSubRangeRequest(keys, type, splitCount)); +} + int64_t getMaxKeySize(KeyRef const& key) { return getMaxWriteKeySize(key, true); } @@ -9573,7 +11605,7 @@ int64_t getMaxReadKeySize(KeyRef const& key) { } int64_t getMaxWriteKeySize(KeyRef const& key, bool hasRawAccess) { - int64_t tenantSize = hasRawAccess ? CLIENT_KNOBS->TENANT_PREFIX_SIZE_LIMIT : 0; + int64_t tenantSize = hasRawAccess ? TenantAPI::PREFIX_SIZE : 0; return key.startsWith(systemKeys.begin) ? CLIENT_KNOBS->SYSTEM_KEY_SIZE_LIMIT : CLIENT_KNOBS->KEY_SIZE_LIMIT + tenantSize; } @@ -9581,3 +11613,27 @@ int64_t getMaxWriteKeySize(KeyRef const& key, bool hasRawAccess) { int64_t getMaxClearKeySize(KeyRef const& key) { return getMaxKeySize(key); } + +namespace NativeAPI { + +ACTOR Future>> getServerListAndProcessClasses( + Transaction* tr) { + state Future> workers = getWorkers(tr); + state Future serverList = tr->getRange(serverListKeys, CLIENT_KNOBS->TOO_MANY); + wait(success(workers) && success(serverList)); + ASSERT(!serverList.get().more && serverList.get().size() < CLIENT_KNOBS->TOO_MANY); + + std::map>, ProcessData> id_data; + for (int i = 0; i < workers.get().size(); i++) + id_data[workers.get()[i].locality.processId()] = workers.get()[i]; + + std::vector> results; + for (int i = 0; i < serverList.get().size(); i++) { + auto ssi = decodeServerListValue(serverList.get()[i].value); + results.emplace_back(ssi, id_data[ssi.locality.processId()].processClass); + } + + return results; +} + +} // namespace NativeAPI diff --git a/src/fdbclient/NativeAPI.actor.g.cpp b/src/fdbclient/NativeAPI.actor.g.cpp index 4b27d19..98e4bf2 100644 --- a/src/fdbclient/NativeAPI.actor.g.cpp +++ b/src/fdbclient/NativeAPI.actor.g.cpp @@ -23,35 +23,44 @@ #include "fdbclient/NativeAPI.actor.h" #include +#include #include +#include #include #include +#include #include #include #include #include #include "boost/algorithm/string.hpp" + +#include "fdbclient/Knobs.h" +#include "flow/CodeProbe.h" #include "fmt/format.h" #include "fdbclient/FDBOptions.g.h" #include "fdbclient/FDBTypes.h" #include "fdbrpc/FailureMonitor.h" #include "fdbrpc/MultiInterface.h" +#include "fdbrpc/TenantInfo.h" #include "fdbclient/ActorLineageProfiler.h" #include "fdbclient/AnnotateActor.h" #include "fdbclient/Atomic.h" #include "fdbclient/BlobGranuleCommon.h" +#include "fdbclient/BlobGranuleRequest.actor.h" #include "fdbclient/ClusterInterface.h" #include "fdbclient/ClusterConnectionFile.h" +#include "fdbclient/ClusterConnectionMemoryRecord.h" #include "fdbclient/CoordinationInterface.h" +#include "fdbclient/CommitTransaction.h" #include "fdbclient/DatabaseContext.h" #include "fdbclient/GlobalConfig.actor.h" #include "fdbclient/IKnobCollection.h" -#include "fdbclient/Knobs.h" #include "fdbclient/JsonBuilder.h" -#include "fdbclient/KeyBackedTypes.h" +#include "fdbclient/KeyBackedTypes.actor.h" #include "fdbclient/KeyRangeMap.h" #include "fdbclient/ManagementAPI.actor.h" #include "fdbclient/NameLineage.h" @@ -63,9 +72,11 @@ #include "fdbclient/SpecialKeySpace.actor.h" #include "fdbclient/StorageServerInterface.h" #include "fdbclient/SystemData.h" +#include "fdbclient/Tenant.h" +#include "fdbclient/TenantSpecialKeys.actor.h" #include "fdbclient/TransactionLineage.h" #include "fdbclient/versions.h" -#include "fdbclient/WellKnownEndpoints.h" +#include "fdbrpc/WellKnownEndpoints.h" #include "fdbrpc/LoadBalance.h" #include "fdbrpc/Net2FileSystem.h" #include "fdbrpc/simulator.h" @@ -84,7 +95,7 @@ #include "flow/Platform.h" #include "flow/SystemMonitor.h" #include "flow/TLSConfig.actor.h" -#include "flow/Tracing.h" +#include "fdbclient/Tracing.h" #include "flow/UnitTest.h" #include "flow/network.h" #include "flow/serialize.h" @@ -103,6 +114,9 @@ #endif #include "flow/actorcompiler.h" // This must be the last #include. +template class RequestStream; +template struct NetNotifiedQueue; + extern const char* getSourceVersion(); namespace { @@ -110,11 +124,11 @@ namespace { TransactionLineageCollector transactionLineageCollector; NameLineageCollector nameLineageCollector; -template +template Future loadBalance( DatabaseContext* ctx, const Reference alternatives, - RequestStream Interface::*channel, + RequestStream Interface::*channel, const Request& request = Request(), TaskPriority taskID = TaskPriority::DefaultPromiseEndpoint, AtMostOnce atMostOnce = @@ -135,26 +149,25 @@ Future loadBalance( } // namespace FDB_BOOLEAN_PARAM(TransactionRecordLogInfo); -FDB_DEFINE_BOOLEAN_PARAM(UseProvisionalProxies); - -// Used to determine whether or not client will load balance based on the number of GRVs released by each proxy -FDB_DEFINE_BOOLEAN_PARAM(BalanceOnRequests); // Whether or not a request should include the tenant name FDB_BOOLEAN_PARAM(UseTenant); +// Whether a blob granule request is a request for the mapping to read, or a request to get granule boundaries +FDB_BOOLEAN_PARAM(JustGranules); + NetworkOptions networkOptions; TLSConfig tlsConfig(TLSEndpointType::CLIENT); // The default values, TRACE_DEFAULT_ROLL_SIZE and TRACE_DEFAULT_MAX_LOGS_SIZE are located in Trace.h. NetworkOptions::NetworkOptions() : traceRollSize(TRACE_DEFAULT_ROLL_SIZE), traceMaxLogsSize(TRACE_DEFAULT_MAX_LOGS_SIZE), traceLogGroup("default"), - traceFormat("xml"), traceClockSource("now"), + traceFormat("xml"), traceClockSource("now"), traceInitializeOnSetup(false), supportedVersions(new ReferencedObject>>()), runLoopProfilingEnabled(false), primaryClient(true) {} -static const Key CLIENT_LATENCY_INFO_PREFIX = LiteralStringRef("client_latency/"); -static const Key CLIENT_LATENCY_INFO_CTR_PREFIX = LiteralStringRef("client_latency_counter/"); +static const Key CLIENT_LATENCY_INFO_PREFIX = "client_latency/"_sr; +static const Key CLIENT_LATENCY_INFO_CTR_PREFIX = "client_latency_counter/"_sr; void DatabaseContext::addTssMapping(StorageServerInterface const& ssi, StorageServerInterface const& tssi) { auto result = tssMapping.find(ssi.id()); @@ -168,14 +181,8 @@ void DatabaseContext::addTssMapping(StorageServerInterface const& ssi, StorageSe tssMetrics[tssi.id()] = metrics; tssMapping[ssi.id()] = tssi; } else { - if (result->second.id() == tssi.id()) { - metrics = tssMetrics[tssi.id()]; - } else { - TEST(true); // SS now maps to new TSS! This will probably never happen in practice - tssMetrics.erase(result->second.id()); - metrics = makeReference(); - tssMetrics[tssi.id()] = metrics; - } + ASSERT(result->second.id() == tssi.id()); + metrics = tssMetrics[tssi.id()]; result->second = tssi; } @@ -190,6 +197,8 @@ void DatabaseContext::addTssMapping(StorageServerInterface const& ssi, StorageSe TSSEndpointData(tssi.id(), tssi.getMappedKeyValues.getEndpoint(), metrics)); queueModel.updateTssEndpoint(ssi.getKeyValuesStream.getEndpoint().token.first(), TSSEndpointData(tssi.id(), tssi.getKeyValuesStream.getEndpoint(), metrics)); + queueModel.updateTssEndpoint(ssi.changeFeedStream.getEndpoint().token.first(), + TSSEndpointData(tssi.id(), tssi.changeFeedStream.getEndpoint(), metrics)); // non-data requests duplicated for load queueModel.updateTssEndpoint(ssi.watchValue.getEndpoint().token.first(), @@ -200,6 +209,12 @@ void DatabaseContext::addTssMapping(StorageServerInterface const& ssi, StorageSe TSSEndpointData(tssi.id(), tssi.getReadHotRanges.getEndpoint(), metrics)); queueModel.updateTssEndpoint(ssi.getRangeSplitPoints.getEndpoint().token.first(), TSSEndpointData(tssi.id(), tssi.getRangeSplitPoints.getEndpoint(), metrics)); + queueModel.updateTssEndpoint(ssi.overlappingChangeFeeds.getEndpoint().token.first(), + TSSEndpointData(tssi.id(), tssi.overlappingChangeFeeds.getEndpoint(), metrics)); + + // duplicated to ensure feed data cleanup + queueModel.updateTssEndpoint(ssi.changeFeedPop.getEndpoint().token.first(), + TSSEndpointData(tssi.id(), tssi.changeFeedPop.getEndpoint(), metrics)); } } @@ -272,13 +287,13 @@ void DatabaseContext::getLatestCommitVersion(const StorageServerInterface& ssi, } void DatabaseContext::getLatestCommitVersions(const Reference& locationInfo, - Version readVersion, Reference info, VersionVector& latestCommitVersions) { latestCommitVersions.clear(); - if (info->debugID.present()) { - g_traceBatch.addEvent("TransactionDebug", info->debugID.get().first(), "NativeAPI.getLatestCommitVersions"); + if (info->readOptions.present() && info->readOptions.get().debugID.present()) { + g_traceBatch.addEvent( + "TransactionDebug", info->readOptions.get().debugID.get().first(), "NativeAPI.getLatestCommitVersions"); } if (!info->readVersionObtainedFromGrvProxy) { @@ -289,12 +304,12 @@ void DatabaseContext::getLatestCommitVersions(const Reference& loc return; } - if (readVersion > ssVersionVectorCache.getMaxVersion()) { + if (info->readVersion() > ssVersionVectorCache.getMaxVersion()) { if (!CLIENT_KNOBS->FORCE_GRV_CACHE_OFF && !info->options.skipGrvCache && info->options.useGrvCache) { return; } else { TraceEvent(SevError, "GetLatestCommitVersions") - .detail("ReadVersion", readVersion) + .detail("ReadVersion", info->readVersion()) .detail("VersionVector", ssVersionVectorCache.toString()); ASSERT(false); } @@ -307,7 +322,7 @@ void DatabaseContext::getLatestCommitVersions(const Reference& loc getLatestCommitVersionForSSID(locationInfo->locations()->getId(i), tag, commitVersion); bool updatedVersionMap = false; - if (tag != invalidTag && commitVersion != invalidVersion && commitVersion < readVersion) { + if (tag != invalidTag && commitVersion != invalidVersion && commitVersion < info->readVersion()) { updatedVersionMap = true; versionMap[commitVersion].insert(tag); } @@ -318,7 +333,7 @@ void DatabaseContext::getLatestCommitVersions(const Reference& loc .detail("InSSIDMap", tag != invalidTag ? 1 : 0) .detail("Tag", tag) .detail("CommitVersion", commitVersion) - .detail("ReadVersion", readVersion) + .detail("ReadVersion", info->readVersion()) .detail("VersionVector", ssVersionVectorCache.toString()) .setMaxEventLength(11000) .setMaxFieldLength(10000); @@ -503,7 +518,7 @@ void DatabaseContext::validateVersion(Version version) const { throw client_invalid_operation(); } if (switchable && version < minAcceptableReadVersion) { - TEST(true); // Attempted to read a version lower than any this client has seen from the current cluster + CODE_PROBE(true, "Attempted to read a version lower than any this client has seen from the current cluster"); throw transaction_too_old(); } @@ -567,7 +582,7 @@ void traceTSSErrors(const char* name, UID tssId, const std::unordered_map& sample) { +void traceSSOrTSSPercentiles(TraceEvent& ev, const std::string name, DDSketch& sample) { ev.detail(name + "Mean", sample.mean()); // don't log the larger percentiles unless we actually have enough samples to log the accurate percentile instead of // the largest sample in this window @@ -584,8 +599,8 @@ void traceSSOrTSSPercentiles(TraceEvent& ev, const std::string name, ContinuousS void traceTSSPercentiles(TraceEvent& ev, const std::string name, - ContinuousSample& ssSample, - ContinuousSample& tssSample) { + DDSketch& ssSample, + DDSketch& tssSample) { ASSERT(ssSample.getPopulationSize() == tssSample.getPopulationSize()); ev.detail(name + "Count", ssSample.getPopulationSize()); if (ssSample.getPopulationSize() > 0) { @@ -594,23 +609,23 @@ void traceTSSPercentiles(TraceEvent& ev, } } - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via tssLogger() - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class TssLoggerActorState { - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TssLoggerActorState(DatabaseContext* const& cx) - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" lastLogged(0) - #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("tssLogger", reinterpret_cast(this)); @@ -623,9 +638,9 @@ class TssLoggerActorState { int a_body1(int loopDepth=0) { try { - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -653,122 +668,122 @@ class TssLoggerActorState { } int a_body1loopBody1(int loopDepth) { - #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = delay(CLIENT_KNOBS->TSS_METRICS_LOGGING_INTERVAL, TaskPriority::FlushTrace); - #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( const auto& it : cx->tssMetrics ) { - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (it.second->detailedMismatches.size()) - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->tssMismatchStream.send( std::pair>(it.first, it.second->detailedMismatches)); - #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (it.second->ssErrorsByCode.size()) - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" traceTSSErrors("TSS_SSErrors", it.first, it.second->ssErrorsByCode); - #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (it.second->tssErrorsByCode.size()) - #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" traceTSSErrors("TSS_TSSErrors", it.first, it.second->tssErrorsByCode); - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent tssEv("TSSClientMetrics", cx->dbId); - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssEv.detail("TSSID", it.first) .detail("Elapsed", (lastLogged == 0) ? 0 : now() - lastLogged) .detail("Internal", cx->internal); - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" it.second->cc.logToTraceEvent(tssEv); - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" traceTSSPercentiles(tssEv, "GetValueLatency", it.second->SSgetValueLatency, it.second->TSSgetValueLatency); - #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" traceTSSPercentiles( tssEv, "GetKeyValuesLatency", it.second->SSgetKeyValuesLatency, it.second->TSSgetKeyValuesLatency); - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" traceTSSPercentiles(tssEv, "GetKeyLatency", it.second->SSgetKeyLatency, it.second->TSSgetKeyLatency); - #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" traceTSSPercentiles(tssEv, "GetMappedKeyValuesLatency", it.second->SSgetMappedKeyValuesLatency, it.second->TSSgetMappedKeyValuesLatency); - #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" it.second->clear(); - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" lastLogged = now(); - #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( const auto& it : cx->tssMetrics ) { - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (it.second->detailedMismatches.size()) - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->tssMismatchStream.send( std::pair>(it.first, it.second->detailedMismatches)); - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (it.second->ssErrorsByCode.size()) - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" traceTSSErrors("TSS_SSErrors", it.first, it.second->ssErrorsByCode); - #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (it.second->tssErrorsByCode.size()) - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" traceTSSErrors("TSS_TSSErrors", it.first, it.second->tssErrorsByCode); - #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent tssEv("TSSClientMetrics", cx->dbId); - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssEv.detail("TSSID", it.first) .detail("Elapsed", (lastLogged == 0) ? 0 : now() - lastLogged) .detail("Internal", cx->internal); - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" it.second->cc.logToTraceEvent(tssEv); - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" traceTSSPercentiles(tssEv, "GetValueLatency", it.second->SSgetValueLatency, it.second->TSSgetValueLatency); - #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" traceTSSPercentiles( tssEv, "GetKeyValuesLatency", it.second->SSgetKeyValuesLatency, it.second->TSSgetKeyValuesLatency); - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" traceTSSPercentiles(tssEv, "GetKeyLatency", it.second->SSgetKeyLatency, it.second->TSSgetKeyLatency); - #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" traceTSSPercentiles(tssEv, "GetMappedKeyValuesLatency", it.second->SSgetMappedKeyValuesLatency, it.second->TSSgetMappedKeyValuesLatency); - #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" it.second->clear(); - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" lastLogged = now(); - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -836,16 +851,16 @@ class TssLoggerActorState { fdb_probe_actor_exit("tssLogger", reinterpret_cast(this), 0); } - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseContext* cx; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double lastLogged; - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via tssLogger() - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class TssLoggerActor final : public Actor, public ActorCallback< TssLoggerActor, 0, Void >, public FastAllocated, public TssLoggerActorState { - #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -854,9 +869,9 @@ class TssLoggerActor final : public Actor, public ActorCallback< TssLogger void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< TssLoggerActor, 0, Void >; - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TssLoggerActor(DatabaseContext* const& cx) - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), TssLoggerActorState(cx) { @@ -880,32 +895,32 @@ friend struct ActorCallback< TssLoggerActor, 0, Void >; } }; } - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future tssLogger( DatabaseContext* const& cx ) { - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new TssLoggerActor(cx)); - #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via databaseLogger() - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class DatabaseLoggerActorState { - #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseLoggerActorState(DatabaseContext* const& cx) - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" lastLogged(0) - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("databaseLogger", reinterpret_cast(this)); @@ -918,9 +933,9 @@ class DatabaseLoggerActorState { int a_body1(int loopDepth=0) { try { - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -948,112 +963,154 @@ class DatabaseLoggerActorState { } int a_body1loopBody1(int loopDepth) { - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = delay(CLIENT_KNOBS->SYSTEM_MONITOR_INTERVAL, TaskPriority::FlushTrace); - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!g_network->isSimulated()) - #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool logTraces = !g_network->isSimulated() || BUGGIFY_WITH_PROB(0.01); + #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (logTraces) + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent ev("TransactionMetrics", cx->dbId); - #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ev.detail("Elapsed", (lastLogged == 0) ? 0 : now() - lastLogged) .detail("Cluster", cx->getConnectionRecord() ? cx->getConnectionRecord()->getConnectionString().clusterKeyName().toString() : "") .detail("Internal", cx->internal); - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->cc.logToTraceEvent(ev); - #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ev.detail("LocationCacheEntryCount", cx->locationCache.size()); - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ev.detail("MeanLatency", cx->latencies.mean()) .detail("MedianLatency", cx->latencies.median()) .detail("Latency90", cx->latencies.percentile(0.90)) .detail("Latency98", cx->latencies.percentile(0.98)) .detail("MaxLatency", cx->latencies.max()) .detail("MeanRowReadLatency", cx->readLatencies.mean()) .detail("MedianRowReadLatency", cx->readLatencies.median()) .detail("MaxRowReadLatency", cx->readLatencies.max()) .detail("MeanGRVLatency", cx->GRVLatencies.mean()) .detail("MedianGRVLatency", cx->GRVLatencies.median()) .detail("MaxGRVLatency", cx->GRVLatencies.max()) .detail("MeanCommitLatency", cx->commitLatencies.mean()) .detail("MedianCommitLatency", cx->commitLatencies.median()) .detail("MaxCommitLatency", cx->commitLatencies.max()) .detail("MeanMutationsPerCommit", cx->mutationsPerCommit.mean()) .detail("MedianMutationsPerCommit", cx->mutationsPerCommit.median()) .detail("MaxMutationsPerCommit", cx->mutationsPerCommit.max()) .detail("MeanBytesPerCommit", cx->bytesPerCommit.mean()) .detail("MedianBytesPerCommit", cx->bytesPerCommit.median()) .detail("MaxBytesPerCommit", cx->bytesPerCommit.max()) .detail("NumLocalityCacheEntries", cx->locationCache.size()); - #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (cx->anyBlobGranuleRequests) - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ev.detail("MeanBGLatency", cx->bgLatencies.mean()) .detail("MedianBGLatency", cx->bgLatencies.median()) .detail("MaxBGLatency", cx->bgLatencies.max()) .detail("MeanBGGranulesPerRequest", cx->bgGranulesPerRequest.mean()) .detail("MedianBGGranulesPerRequest", cx->bgGranulesPerRequest.median()) .detail("MaxBGGranulesPerRequest", cx->bgGranulesPerRequest.max()); - #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } + #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (cx->usedAnyChangeFeeds && logTraces) + #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent feedEv("ChangeFeedClientMetrics", cx->dbId); + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + feedEv.detail("Elapsed", (lastLogged == 0) ? 0 : now() - lastLogged) .detail("Cluster", cx->getConnectionRecord() ? cx->getConnectionRecord()->getConnectionString().clusterKeyName().toString() : "") .detail("Internal", cx->internal); + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->ccFeed.logToTraceEvent(feedEv); + #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (cx->anyBGReads && logTraces) + #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent bgReadEv("BlobGranuleReadMetrics", cx->dbId); + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bgReadEv.detail("Elapsed", (lastLogged == 0) ? 0 : now() - lastLogged) .detail("Cluster", cx->getConnectionRecord() ? cx->getConnectionRecord()->getConnectionString().clusterKeyName().toString() : "") .detail("Internal", cx->internal); + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->ccBG.logToTraceEvent(bgReadEv); + #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bgReadEv.detail("MeanBGLatency", cx->bgLatencies.mean()) .detail("MedianBGLatency", cx->bgLatencies.median()) .detail("MaxBGLatency", cx->bgLatencies.max()) .detail("MeanBGGranulesPerRequest", cx->bgGranulesPerRequest.mean()) .detail("MedianBGGranulesPerRequest", cx->bgGranulesPerRequest.median()) .detail("MaxBGGranulesPerRequest", cx->bgGranulesPerRequest.max()); + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->latencies.clear(); - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->readLatencies.clear(); - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->GRVLatencies.clear(); - #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->commitLatencies.clear(); - #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->mutationsPerCommit.clear(); - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->bytesPerCommit.clear(); - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->bgLatencies.clear(); - #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->bgGranulesPerRequest.clear(); - #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" lastLogged = now(); - #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!g_network->isSimulated()) - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool logTraces = !g_network->isSimulated() || BUGGIFY_WITH_PROB(0.01); + #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (logTraces) + #line 1055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent ev("TransactionMetrics", cx->dbId); - #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ev.detail("Elapsed", (lastLogged == 0) ? 0 : now() - lastLogged) .detail("Cluster", cx->getConnectionRecord() ? cx->getConnectionRecord()->getConnectionString().clusterKeyName().toString() : "") .detail("Internal", cx->internal); - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->cc.logToTraceEvent(ev); - #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ev.detail("LocationCacheEntryCount", cx->locationCache.size()); - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ev.detail("MeanLatency", cx->latencies.mean()) .detail("MedianLatency", cx->latencies.median()) .detail("Latency90", cx->latencies.percentile(0.90)) .detail("Latency98", cx->latencies.percentile(0.98)) .detail("MaxLatency", cx->latencies.max()) .detail("MeanRowReadLatency", cx->readLatencies.mean()) .detail("MedianRowReadLatency", cx->readLatencies.median()) .detail("MaxRowReadLatency", cx->readLatencies.max()) .detail("MeanGRVLatency", cx->GRVLatencies.mean()) .detail("MedianGRVLatency", cx->GRVLatencies.median()) .detail("MaxGRVLatency", cx->GRVLatencies.max()) .detail("MeanCommitLatency", cx->commitLatencies.mean()) .detail("MedianCommitLatency", cx->commitLatencies.median()) .detail("MaxCommitLatency", cx->commitLatencies.max()) .detail("MeanMutationsPerCommit", cx->mutationsPerCommit.mean()) .detail("MedianMutationsPerCommit", cx->mutationsPerCommit.median()) .detail("MaxMutationsPerCommit", cx->mutationsPerCommit.max()) .detail("MeanBytesPerCommit", cx->bytesPerCommit.mean()) .detail("MedianBytesPerCommit", cx->bytesPerCommit.median()) .detail("MaxBytesPerCommit", cx->bytesPerCommit.max()) .detail("NumLocalityCacheEntries", cx->locationCache.size()); - #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (cx->anyBlobGranuleRequests) - #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ev.detail("MeanBGLatency", cx->bgLatencies.mean()) .detail("MedianBGLatency", cx->bgLatencies.median()) .detail("MaxBGLatency", cx->bgLatencies.max()) .detail("MeanBGGranulesPerRequest", cx->bgGranulesPerRequest.mean()) .detail("MedianBGGranulesPerRequest", cx->bgGranulesPerRequest.median()) .detail("MaxBGGranulesPerRequest", cx->bgGranulesPerRequest.max()); - #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } + #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (cx->usedAnyChangeFeeds && logTraces) + #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent feedEv("ChangeFeedClientMetrics", cx->dbId); + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + feedEv.detail("Elapsed", (lastLogged == 0) ? 0 : now() - lastLogged) .detail("Cluster", cx->getConnectionRecord() ? cx->getConnectionRecord()->getConnectionString().clusterKeyName().toString() : "") .detail("Internal", cx->internal); + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->ccFeed.logToTraceEvent(feedEv); + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (cx->anyBGReads && logTraces) + #line 1083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent bgReadEv("BlobGranuleReadMetrics", cx->dbId); + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bgReadEv.detail("Elapsed", (lastLogged == 0) ? 0 : now() - lastLogged) .detail("Cluster", cx->getConnectionRecord() ? cx->getConnectionRecord()->getConnectionString().clusterKeyName().toString() : "") .detail("Internal", cx->internal); + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->ccBG.logToTraceEvent(bgReadEv); + #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bgReadEv.detail("MeanBGLatency", cx->bgLatencies.mean()) .detail("MedianBGLatency", cx->bgLatencies.median()) .detail("MaxBGLatency", cx->bgLatencies.max()) .detail("MeanBGGranulesPerRequest", cx->bgGranulesPerRequest.mean()) .detail("MedianBGGranulesPerRequest", cx->bgGranulesPerRequest.median()) .detail("MaxBGGranulesPerRequest", cx->bgGranulesPerRequest.max()); + #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->latencies.clear(); - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->readLatencies.clear(); - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->GRVLatencies.clear(); - #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->commitLatencies.clear(); - #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->mutationsPerCommit.clear(); - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->bytesPerCommit.clear(); - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->bgLatencies.clear(); - #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->bgGranulesPerRequest.clear(); - #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" lastLogged = now(); - #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -1121,16 +1178,16 @@ class DatabaseLoggerActorState { fdb_probe_actor_exit("databaseLogger", reinterpret_cast(this), 0); } - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseContext* cx; - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double lastLogged; - #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via databaseLogger() - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class DatabaseLoggerActor final : public Actor, public ActorCallback< DatabaseLoggerActor, 0, Void >, public FastAllocated, public DatabaseLoggerActorState { - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1139,9 +1196,9 @@ class DatabaseLoggerActor final : public Actor, public ActorCallback< Data void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< DatabaseLoggerActor, 0, Void >; - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseLoggerActor(DatabaseContext* const& cx) - #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), DatabaseLoggerActorState(cx) { @@ -1165,41 +1222,41 @@ friend struct ActorCallback< DatabaseLoggerActor, 0, Void >; } }; } - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future databaseLogger( DatabaseContext* const& cx ) { - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new DatabaseLoggerActor(cx)); - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" struct TrInfoChunk { ValueRef value; Key key; }; - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via transactionInfoCommitActor() - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class TransactionInfoCommitActorActorState { - #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TransactionInfoCommitActorActorState(Transaction* const& tr,std::vector* const& chunks) - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : tr(tr), - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" chunks(chunks), - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" clientLatencyAtomicCtr(CLIENT_LATENCY_INFO_CTR_PREFIX.withPrefix(fdbClientInfoPrefixRange.begin)), - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" retryCount(0) - #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("transactionInfoCommitActor", reinterpret_cast(this)); @@ -1212,9 +1269,9 @@ class TransactionInfoCommitActorActorState { int a_body1(int loopDepth=0) { try { - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1243,36 +1300,36 @@ class TransactionInfoCommitActorActorState { int a_body1loopBody1(int loopDepth) { try { - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->reset(); - #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" vstamp = tr->getVersionstamp(); - #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t numCommitBytes = 0; - #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& chunk : *chunks ) { - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->atomicOp(chunk.key, chunk.value, MutationRef::SetVersionstampedKey); - #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" numCommitBytes += chunk.key.size() + chunk.value.size() - 4; - #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->atomicOp(clientLatencyAtomicCtr, StringRef((uint8_t*)&numCommitBytes, 8), MutationRef::AddValue); - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = tr->commit(); - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1292,26 +1349,26 @@ class TransactionInfoCommitActorActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" retryCount++; - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (retryCount == 10) - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = tr->onError(e); - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1324,9 +1381,9 @@ class TransactionInfoCommitActorActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TransactionInfoCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TransactionInfoCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1336,9 +1393,9 @@ class TransactionInfoCommitActorActorState { } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TransactionInfoCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TransactionInfoCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1484,22 +1541,22 @@ class TransactionInfoCommitActorActorState { fdb_probe_actor_exit("transactionInfoCommitActor", reinterpret_cast(this), 1); } - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction* tr; - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector* chunks; - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" const Key clientLatencyAtomicCtr; - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int retryCount; - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future> vstamp; - #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via transactionInfoCommitActor() - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class TransactionInfoCommitActorActor final : public Actor, public ActorCallback< TransactionInfoCommitActorActor, 0, Void >, public ActorCallback< TransactionInfoCommitActorActor, 1, Void >, public FastAllocated, public TransactionInfoCommitActorActorState { - #line 1502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1509,9 +1566,9 @@ class TransactionInfoCommitActorActor final : public Actor, public ActorCa #pragma clang diagnostic pop friend struct ActorCallback< TransactionInfoCommitActorActor, 0, Void >; friend struct ActorCallback< TransactionInfoCommitActorActor, 1, Void >; - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TransactionInfoCommitActorActor(Transaction* const& tr,std::vector* const& chunks) - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), TransactionInfoCommitActorActorState(tr, chunks) { @@ -1536,36 +1593,36 @@ friend struct ActorCallback< TransactionInfoCommitActorActor, 1, Void >; } }; } - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] static Future transactionInfoCommitActor( Transaction* const& tr, std::vector* const& chunks ) { - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new TransactionInfoCommitActorActor(tr, chunks)); - #line 1543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via delExcessClntTxnEntriesActor() - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class DelExcessClntTxnEntriesActorActorState { - #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DelExcessClntTxnEntriesActorActorState(Transaction* const& tr,int64_t const& clientTxInfoSizeLimit) - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : tr(tr), - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" clientTxInfoSizeLimit(clientTxInfoSizeLimit), - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" clientLatencyName(CLIENT_LATENCY_INFO_PREFIX.withPrefix(fdbClientInfoPrefixRange.begin)), - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" clientLatencyAtomicCtr(CLIENT_LATENCY_INFO_CTR_PREFIX.withPrefix(fdbClientInfoPrefixRange.begin)) - #line 1568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("delExcessClntTxnEntriesActor", reinterpret_cast(this)); @@ -1578,11 +1635,11 @@ class DelExcessClntTxnEntriesActorActorState { int a_body1(int loopDepth=0) { try { - #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevInfo, "DelExcessClntTxnEntriesCalled").log(); - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1611,22 +1668,22 @@ class DelExcessClntTxnEntriesActorActorState { int a_body1loopBody1(int loopDepth) { try { - #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->reset(); - #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture> __when_expr_0 = tr->get(KeyRef(clientLatencyAtomicCtr), Snapshot::True); - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1646,16 +1703,16 @@ class DelExcessClntTxnEntriesActorActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = tr->onError(e); - #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1668,104 +1725,104 @@ class DelExcessClntTxnEntriesActorActorState { } int a_body1loopBody1cont2(Optional const& ctrValue,int loopDepth) { - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!ctrValue.present()) - #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevInfo, "NumClntTxnEntriesNotFound").log(); - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DelExcessClntTxnEntriesActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DelExcessClntTxnEntriesActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" txInfoSize = 0; - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(ctrValue.get().size() == sizeof(int64_t)); - #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" memcpy(&txInfoSize, ctrValue.get().begin(), ctrValue.get().size()); - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (txInfoSize < clientTxInfoSizeLimit) - #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DelExcessClntTxnEntriesActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DelExcessClntTxnEntriesActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int getRangeByteLimit = (txInfoSize - clientTxInfoSizeLimit) < CLIENT_KNOBS->TRANSACTION_SIZE_LIMIT ? (txInfoSize - clientTxInfoSizeLimit) : CLIENT_KNOBS->TRANSACTION_SIZE_LIMIT; - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetRangeLimits limit(GetRangeLimits::ROW_LIMIT_UNLIMITED, getRangeByteLimit); - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = tr->getRange(KeyRangeRef(clientLatencyName, strinc(clientLatencyName)), limit); - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Optional && ctrValue,int loopDepth) { - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!ctrValue.present()) - #line 1725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevInfo, "NumClntTxnEntriesNotFound").log(); - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DelExcessClntTxnEntriesActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DelExcessClntTxnEntriesActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" txInfoSize = 0; - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(ctrValue.get().size() == sizeof(int64_t)); - #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" memcpy(&txInfoSize, ctrValue.get().begin(), ctrValue.get().size()); - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (txInfoSize < clientTxInfoSizeLimit) - #line 1745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DelExcessClntTxnEntriesActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DelExcessClntTxnEntriesActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int getRangeByteLimit = (txInfoSize - clientTxInfoSizeLimit) < CLIENT_KNOBS->TRANSACTION_SIZE_LIMIT ? (txInfoSize - clientTxInfoSizeLimit) : CLIENT_KNOBS->TRANSACTION_SIZE_LIMIT; - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetRangeLimits limit(GetRangeLimits::ROW_LIMIT_UNLIMITED, getRangeByteLimit); - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = tr->getRange(KeyRangeRef(clientLatencyName, strinc(clientLatencyName)), limit); - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1835,45 +1892,45 @@ class DelExcessClntTxnEntriesActorActorState { } int a_body1loopBody1cont3(RangeResult const& txEntries,int loopDepth) { - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" numBytesToDel = 0; - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef endKey; - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& kv : txEntries ) { - #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" endKey = kv.key; - #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" numBytesToDel += kv.key.size() + kv.value.size(); - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (txInfoSize - numBytesToDel <= clientTxInfoSizeLimit) - #line 1850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { break; } } - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (numBytesToDel) - #line 1857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->clear(KeyRangeRef(txEntries[0].key, strinc(endKey))); - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevInfo, "DeletingExcessCntTxnEntries").detail("BytesToBeDeleted", numBytesToDel); - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t bytesDel = -numBytesToDel; - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->atomicOp(clientLatencyAtomicCtr, StringRef((uint8_t*)&bytesDel, 8), MutationRef::AddValue); - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = tr->commit(); - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else @@ -1885,45 +1942,45 @@ class DelExcessClntTxnEntriesActorActorState { } int a_body1loopBody1cont3(RangeResult && txEntries,int loopDepth) { - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" numBytesToDel = 0; - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef endKey; - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& kv : txEntries ) { - #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" endKey = kv.key; - #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" numBytesToDel += kv.key.size() + kv.value.size(); - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (txInfoSize - numBytesToDel <= clientTxInfoSizeLimit) - #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { break; } } - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (numBytesToDel) - #line 1907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->clear(KeyRangeRef(txEntries[0].key, strinc(endKey))); - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevInfo, "DeletingExcessCntTxnEntries").detail("BytesToBeDeleted", numBytesToDel); - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t bytesDel = -numBytesToDel; - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->atomicOp(clientLatencyAtomicCtr, StringRef((uint8_t*)&bytesDel, 8), MutationRef::AddValue); - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = tr->commit(); - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else @@ -1998,13 +2055,13 @@ class DelExcessClntTxnEntriesActorActorState { } int a_body1loopBody1cont6(int loopDepth) { - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (txInfoSize - numBytesToDel <= clientTxInfoSizeLimit) - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DelExcessClntTxnEntriesActorActorState(); static_cast(this)->destroy(); return 0; } - #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DelExcessClntTxnEntriesActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2177,24 +2234,24 @@ class DelExcessClntTxnEntriesActorActorState { fdb_probe_actor_exit("delExcessClntTxnEntriesActor", reinterpret_cast(this), 3); } - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction* tr; - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t clientTxInfoSizeLimit; - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" const Key clientLatencyName; - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" const Key clientLatencyAtomicCtr; - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t txInfoSize; - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t numBytesToDel; - #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via delExcessClntTxnEntriesActor() - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class DelExcessClntTxnEntriesActorActor final : public Actor, public ActorCallback< DelExcessClntTxnEntriesActorActor, 0, Optional >, public ActorCallback< DelExcessClntTxnEntriesActorActor, 1, RangeResult >, public ActorCallback< DelExcessClntTxnEntriesActorActor, 2, Void >, public ActorCallback< DelExcessClntTxnEntriesActorActor, 3, Void >, public FastAllocated, public DelExcessClntTxnEntriesActorActorState { - #line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2206,9 +2263,9 @@ friend struct ActorCallback< DelExcessClntTxnEntriesActorActor, 0, Optional; friend struct ActorCallback< DelExcessClntTxnEntriesActorActor, 2, Void >; friend struct ActorCallback< DelExcessClntTxnEntriesActorActor, 3, Void >; - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DelExcessClntTxnEntriesActorActor(Transaction* const& tr,int64_t const& clientTxInfoSizeLimit) - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), DelExcessClntTxnEntriesActorActorState(tr, clientTxInfoSizeLimit) { @@ -2235,33 +2292,33 @@ friend struct ActorCallback< DelExcessClntTxnEntriesActorActor, 3, Void >; } }; } - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] static Future delExcessClntTxnEntriesActor( Transaction* const& tr, int64_t const& clientTxInfoSizeLimit ) { - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new DelExcessClntTxnEntriesActorActor(tr, clientTxInfoSizeLimit)); - #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" // Delref and addref self to give self a chance to get destroyed. - #line 2248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via refreshTransaction() - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class RefreshTransactionActorState { - #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" RefreshTransactionActorState(DatabaseContext* const& self,Transaction* const& tr) - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : self(self), - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr(tr) - #line 2264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("refreshTransaction", reinterpret_cast(this)); @@ -2274,18 +2331,18 @@ class RefreshTransactionActorState { int a_body1(int loopDepth=0) { try { - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" *tr = Transaction(); - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = delay(0); - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2306,11 +2363,11 @@ class RefreshTransactionActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" *tr = Transaction(Database(Reference::addRef(self))); - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RefreshTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 2313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~RefreshTransactionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2320,11 +2377,11 @@ class RefreshTransactionActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" *tr = Transaction(Database(Reference::addRef(self))); - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RefreshTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 2327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~RefreshTransactionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2395,16 +2452,16 @@ class RefreshTransactionActorState { fdb_probe_actor_exit("refreshTransaction", reinterpret_cast(this), 0); } - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseContext* self; - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction* tr; - #line 2402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via refreshTransaction() - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class RefreshTransactionActor final : public Actor, public ActorCallback< RefreshTransactionActor, 0, Void >, public FastAllocated, public RefreshTransactionActorState { - #line 2407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2413,9 +2470,9 @@ class RefreshTransactionActor final : public Actor, public ActorCallback< void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< RefreshTransactionActor, 0, Void >; - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" RefreshTransactionActor(DatabaseContext* const& self,Transaction* const& tr) - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), RefreshTransactionActorState(self, tr) { @@ -2439,41 +2496,41 @@ friend struct ActorCallback< RefreshTransactionActor, 0, Void >; } }; } - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] static Future refreshTransaction( DatabaseContext* const& self, Transaction* const& tr ) { - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new RefreshTransactionActor(self, tr)); - #line 2446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" // The reason for getting a pointer to DatabaseContext instead of a reference counted object is because reference // counting will increment reference count for DatabaseContext which holds the future of this actor. This creates a // cyclic reference and hence this actor and Database object will not be destroyed at all. - #line 2454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via clientStatusUpdateActor() - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class ClientStatusUpdateActorActorState { - #line 2461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ClientStatusUpdateActorActorState(DatabaseContext* const& cx) - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" clientLatencyName(CLIENT_LATENCY_INFO_PREFIX.withPrefix(fdbClientInfoPrefixRange.begin).toString()), - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr(), - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" commitQ(), - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" txBytes(0) - #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("clientStatusUpdateActor", reinterpret_cast(this)); @@ -2486,9 +2543,9 @@ class ClientStatusUpdateActorActorState { int a_body1(int loopDepth=0) { try { - #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 2491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2516,16 +2573,16 @@ class ClientStatusUpdateActorActorState { } int a_body1loopBody1(int loopDepth) { - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = refreshTransaction(cx, &tr); - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2533,66 +2590,66 @@ class ClientStatusUpdateActorActorState { int a_body1loopBody1cont1(Void const& _,int loopDepth) { try { - #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(cx->clientStatusUpdater.outStatusQ.empty()); - #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->clientStatusUpdater.inStatusQ.swap(cx->clientStatusUpdater.outStatusQ); - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trChunksQ = std::vector(); - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& entry : cx->clientStatusUpdater.outStatusQ ) { - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto& bw = entry.second; - #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t value_size_limit = BUGGIFY ? deterministicRandom()->randomInt(1e3, CLIENT_KNOBS->VALUE_SIZE_LIMIT) : CLIENT_KNOBS->VALUE_SIZE_LIMIT; - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int num_chunks = (bw.getLength() + value_size_limit - 1) / value_size_limit; - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::string random_id = deterministicRandom()->randomAlphaNumeric(16); - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::string user_provided_id = entry.first.size() ? entry.first + "/" : ""; - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < num_chunks;i++) { - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TrInfoChunk chunk; - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" BinaryWriter chunkBW(Unversioned()); - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" chunkBW << bigEndian32(i + 1) << bigEndian32(num_chunks); - #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" chunk.key = KeyRef(clientLatencyName + std::string(10, '\x00') + "/" + random_id + "/" + chunkBW.toValue().toString() + "/" + user_provided_id + std::string(4, '\x00')); - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int32_t pos = littleEndian32(clientLatencyName.size()); - #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" memcpy(mutateString(chunk.key) + chunk.key.size() - sizeof(int32_t), &pos, sizeof(int32_t)); - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (i == num_chunks - 1) - #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" chunk.value = ValueRef(static_cast(bw.getData()) + (i * value_size_limit), bw.getLength() - (i * value_size_limit)); - #line 2574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" chunk.value = ValueRef(static_cast(bw.getData()) + (i * value_size_limit), value_size_limit); - #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trChunksQ.push_back(std::move(chunk)); - #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" dataSizeLimit = BUGGIFY ? deterministicRandom()->randomInt(200e3, 1.5 * CLIENT_KNOBS->TRANSACTION_SIZE_LIMIT) : 0.8 * CLIENT_KNOBS->TRANSACTION_SIZE_LIMIT; - #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tracking_iter = trChunksQ.begin(); - #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(commitQ.empty() && (txBytes == 0)); - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 2595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); } catch (Error& error) { @@ -2606,66 +2663,66 @@ class ClientStatusUpdateActorActorState { int a_body1loopBody1cont1(Void && _,int loopDepth) { try { - #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(cx->clientStatusUpdater.outStatusQ.empty()); - #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->clientStatusUpdater.inStatusQ.swap(cx->clientStatusUpdater.outStatusQ); - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trChunksQ = std::vector(); - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& entry : cx->clientStatusUpdater.outStatusQ ) { - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto& bw = entry.second; - #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t value_size_limit = BUGGIFY ? deterministicRandom()->randomInt(1e3, CLIENT_KNOBS->VALUE_SIZE_LIMIT) : CLIENT_KNOBS->VALUE_SIZE_LIMIT; - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int num_chunks = (bw.getLength() + value_size_limit - 1) / value_size_limit; - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::string random_id = deterministicRandom()->randomAlphaNumeric(16); - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::string user_provided_id = entry.first.size() ? entry.first + "/" : ""; - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < num_chunks;i++) { - #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TrInfoChunk chunk; - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" BinaryWriter chunkBW(Unversioned()); - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" chunkBW << bigEndian32(i + 1) << bigEndian32(num_chunks); - #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" chunk.key = KeyRef(clientLatencyName + std::string(10, '\x00') + "/" + random_id + "/" + chunkBW.toValue().toString() + "/" + user_provided_id + std::string(4, '\x00')); - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int32_t pos = littleEndian32(clientLatencyName.size()); - #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" memcpy(mutateString(chunk.key) + chunk.key.size() - sizeof(int32_t), &pos, sizeof(int32_t)); - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (i == num_chunks - 1) - #line 2643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" chunk.value = ValueRef(static_cast(bw.getData()) + (i * value_size_limit), bw.getLength() - (i * value_size_limit)); - #line 2647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" chunk.value = ValueRef(static_cast(bw.getData()) + (i * value_size_limit), value_size_limit); - #line 2653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trChunksQ.push_back(std::move(chunk)); - #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" dataSizeLimit = BUGGIFY ? deterministicRandom()->randomInt(200e3, 1.5 * CLIENT_KNOBS->TRANSACTION_SIZE_LIMIT) : 0.8 * CLIENT_KNOBS->TRANSACTION_SIZE_LIMIT; - #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tracking_iter = trChunksQ.begin(); - #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(commitQ.empty() && (txBytes == 0)); - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 2668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); } catch (Error& error) { @@ -2748,28 +2805,28 @@ class ClientStatusUpdateActorActorState { int a_body1loopBody1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_actor_cancelled) - #line 2753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->clientStatusUpdater.outStatusQ.clear(); - #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevWarnAlways, "UnableToWriteClientStatus").error(e); - #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_6 = delay(10.0); - #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2782,18 +2839,18 @@ class ClientStatusUpdateActorActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->clientStatusUpdater.outStatusQ.clear(); - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = cx->globalConfig->onInitialized(); - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 2791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2807,17 +2864,17 @@ class ClientStatusUpdateActorActorState { } int a_body1loopBody1cont1loopBody1(int loopDepth) { - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" iter = tracking_iter; - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" txBytes = 0; - #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" commitQ.clear(); - #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 2820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopBody1loopHead1(loopDepth); } catch (Error& error) { @@ -2850,27 +2907,27 @@ class ClientStatusUpdateActorActorState { int a_body1loopBody1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_transaction_too_large) - #line 2855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" dataSizeLimit /= 2; - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(dataSizeLimit >= CLIENT_KNOBS->VALUE_SIZE_LIMIT + CLIENT_KNOBS->KEY_SIZE_LIMIT); - #line 2861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevWarnAlways, "ClientTrInfoErrorCommit").error(e).detail("TxBytes", txBytes); - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" commitQ.clear(); - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" txBytes = 0; - #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1loopBody1cont1Catch1(e, std::max(0, loopDepth - 1)); - #line 2873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } loopDepth = a_body1loopBody1cont1loopBody1cont1(loopDepth); } @@ -2884,20 +2941,20 @@ class ClientStatusUpdateActorActorState { } int a_body1loopBody1cont1loopBody1cont2(int loopDepth) { - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!commitQ.empty()) - #line 2889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = transactionInfoCommitActor(&tr, &commitQ); - #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else @@ -2916,26 +2973,26 @@ class ClientStatusUpdateActorActorState { } int a_body1loopBody1cont1loopBody1loopBody1(int loopDepth) { - #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!(iter != trChunksQ.end())) - #line 2921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { return a_body1loopBody1cont1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (iter->value.size() + iter->key.size() + txBytes > dataSizeLimit) - #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = transactionInfoCommitActor(&tr, &commitQ); - #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1loopBody1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1loopBody1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else @@ -2960,39 +3017,39 @@ class ClientStatusUpdateActorActorState { } int a_body1loopBody1cont1loopBody1loopBody1cont1(int loopDepth) { - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" commitQ.push_back(*iter); - #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" txBytes += iter->value.size() + iter->key.size(); - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++iter; - #line 2969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1cont1loopBody1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1loopBody1loopBody1cont3(Void const& _,int loopDepth) { - #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tracking_iter = iter; - #line 850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" commitQ.clear(); - #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" txBytes = 0; - #line 2982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopBody1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1cont1loopBody1loopBody1cont3(Void && _,int loopDepth) { - #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tracking_iter = iter; - #line 850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" commitQ.clear(); - #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" txBytes = 0; - #line 2995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopBody1loopBody1cont1(loopDepth); return loopDepth; @@ -3068,22 +3125,22 @@ class ClientStatusUpdateActorActorState { } int a_body1loopBody1cont1loopBody1cont4(Void const& _,int loopDepth) { - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" commitQ.clear(); - #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" txBytes = 0; - #line 3075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopBody1cont3(loopDepth); return loopDepth; } int a_body1loopBody1cont1loopBody1cont4(Void && _,int loopDepth) { - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" commitQ.clear(); - #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" txBytes = 0; - #line 3086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopBody1cont3(loopDepth); return loopDepth; @@ -3153,28 +3210,28 @@ class ClientStatusUpdateActorActorState { } int a_body1loopBody1cont8(Void const& _,int loopDepth) { - #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double sampleRate = cx->globalConfig->get(fdbClientInfoTxnSampleRate, std::numeric_limits::infinity()); - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double clientSamplingProbability = std::isinf(sampleRate) ? CLIENT_KNOBS->CSI_SAMPLING_PROBABILITY : sampleRate; - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t sizeLimit = cx->globalConfig->get(fdbClientInfoTxnSizeLimit, -1); - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t clientTxnInfoSizeLimit = sizeLimit == -1 ? CLIENT_KNOBS->CSI_SIZE_LIMIT : sizeLimit; - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!trChunksQ.empty() && deterministicRandom()->random01() < clientSamplingProbability) - #line 3166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_4 = delExcessClntTxnEntriesActor(&tr, clientTxnInfoSizeLimit); - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 3172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1cont1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont8when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else @@ -3186,28 +3243,28 @@ class ClientStatusUpdateActorActorState { } int a_body1loopBody1cont8(Void && _,int loopDepth) { - #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double sampleRate = cx->globalConfig->get(fdbClientInfoTxnSampleRate, std::numeric_limits::infinity()); - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double clientSamplingProbability = std::isinf(sampleRate) ? CLIENT_KNOBS->CSI_SAMPLING_PROBABILITY : sampleRate; - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t sizeLimit = cx->globalConfig->get(fdbClientInfoTxnSizeLimit, -1); - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t clientTxnInfoSizeLimit = sizeLimit == -1 ? CLIENT_KNOBS->CSI_SIZE_LIMIT : sizeLimit; - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!trChunksQ.empty() && deterministicRandom()->random01() < clientSamplingProbability) - #line 3199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_4 = delExcessClntTxnEntriesActor(&tr, clientTxnInfoSizeLimit); - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 3205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1cont1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont8when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else @@ -3282,16 +3339,16 @@ class ClientStatusUpdateActorActorState { } int a_body1loopBody1cont9(int loopDepth) { - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_5 = delay(CLIENT_KNOBS->CSI_STATUS_DELAY); - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1cont1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont9when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3534,30 +3591,30 @@ class ClientStatusUpdateActorActorState { fdb_probe_actor_exit("clientStatusUpdateActor", reinterpret_cast(this), 6); } - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseContext* cx; - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" const std::string clientLatencyName; - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction tr; - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector commitQ; - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int txBytes; - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector trChunksQ; - #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t dataSizeLimit; - #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector::iterator tracking_iter; - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector::iterator iter; - #line 3555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via clientStatusUpdateActor() - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class ClientStatusUpdateActorActor final : public Actor, public ActorCallback< ClientStatusUpdateActorActor, 0, Void >, public ActorCallback< ClientStatusUpdateActorActor, 1, Void >, public ActorCallback< ClientStatusUpdateActorActor, 2, Void >, public ActorCallback< ClientStatusUpdateActorActor, 3, Void >, public ActorCallback< ClientStatusUpdateActorActor, 4, Void >, public ActorCallback< ClientStatusUpdateActorActor, 5, Void >, public ActorCallback< ClientStatusUpdateActorActor, 6, Void >, public FastAllocated, public ClientStatusUpdateActorActorState { - #line 3560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3572,9 +3629,9 @@ friend struct ActorCallback< ClientStatusUpdateActorActor, 3, Void >; friend struct ActorCallback< ClientStatusUpdateActorActor, 4, Void >; friend struct ActorCallback< ClientStatusUpdateActorActor, 5, Void >; friend struct ActorCallback< ClientStatusUpdateActorActor, 6, Void >; - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ClientStatusUpdateActorActor(DatabaseContext* const& cx) - #line 3577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), ClientStatusUpdateActorActorState(cx) { @@ -3604,32 +3661,32 @@ friend struct ActorCallback< ClientStatusUpdateActorActor, 6, Void >; } }; } - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] static Future clientStatusUpdateActor( DatabaseContext* const& cx ) { - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new ClientStatusUpdateActorActor(cx)); - #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 3616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via assertFailure() - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class AssertFailureActorState { - #line 3623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" AssertFailureActorState(GrvProxyInterface const& remote,Future> const& reply) - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : remote(remote), - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" reply(reply) - #line 3632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("assertFailure", reinterpret_cast(this)); @@ -3643,16 +3700,16 @@ class AssertFailureActorState { { try { try { - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture> __when_expr_0 = reply; - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 3650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3679,9 +3736,9 @@ class AssertFailureActorState { } int a_body1cont1(int loopDepth) { - #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AssertFailureActorState(); static_cast(this)->destroy(); return 0; } - #line 3684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AssertFailureActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3692,13 +3749,13 @@ class AssertFailureActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_actor_cancelled) - #line 3697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 3701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } loopDepth = a_body1cont1(loopDepth); } @@ -3712,15 +3769,15 @@ class AssertFailureActorState { } int a_body1cont2(ErrorOr const& res,int loopDepth) { - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!res.isError()) - #line 3717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevError, "GotStaleReadVersion") .detail("Remote", remote.getConsistentReadVersion.getEndpoint().addresses.address.toString()) .detail("Provisional", remote.provisional) .detail("ReadVersion", res.get().version); - #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT_WE_THINK(false); - #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } loopDepth = a_body1cont5(loopDepth); @@ -3728,15 +3785,15 @@ class AssertFailureActorState { } int a_body1cont2(ErrorOr && res,int loopDepth) { - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!res.isError()) - #line 3733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevError, "GotStaleReadVersion") .detail("Remote", remote.getConsistentReadVersion.getEndpoint().addresses.address.toString()) .detail("Provisional", remote.provisional) .detail("ReadVersion", res.get().version); - #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT_WE_THINK(false); - #line 3739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } loopDepth = a_body1cont5(loopDepth); @@ -3818,16 +3875,16 @@ class AssertFailureActorState { return loopDepth; } - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GrvProxyInterface remote; - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future> reply; - #line 3825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via assertFailure() - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class AssertFailureActor final : public Actor, public ActorCallback< AssertFailureActor, 0, ErrorOr >, public FastAllocated, public AssertFailureActorState { - #line 3830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3836,9 +3893,9 @@ class AssertFailureActor final : public Actor, public ActorCallback< Asser void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< AssertFailureActor, 0, ErrorOr >; - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" AssertFailureActor(GrvProxyInterface const& remote,Future> const& reply) - #line 3841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), AssertFailureActorState(remote, reply) { @@ -3862,18 +3919,20 @@ friend struct ActorCallback< AssertFailureActor, 0, ErrorOr } }; } - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future assertFailure( GrvProxyInterface const& remote, Future> const& reply ) { - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new AssertFailureActor(remote, reply)); - #line 3869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future attemptGRVFromOldProxies(std::vector oldProxies, std::vector newProxies) { - Span span(deterministicRandom()->randomUniqueID(), "VerifyCausalReadRisky"_loc); + auto debugID = nondeterministicRandom()->randomUniqueID(); + g_traceBatch.addEvent("AttemptGRVFromOldProxyDebug", debugID.first(), "NativeAPI.attemptGRVFromOldProxies.Start"); + Span span("NAPI:VerifyCausalReadRisky"_loc); std::vector> replies; replies.reserve(oldProxies.size()); GetReadVersionRequest req( @@ -3896,33 +3955,33 @@ Future attemptGRVFromOldProxies(std::vector oldProxies, return waitForAll(replies); } - #line 3899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via monitorClientDBInfoChange() - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class MonitorClientDBInfoChangeActorState { - #line 3906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" MonitorClientDBInfoChangeActorState(DatabaseContext* const& cx,Reference const> const& clientDBInfo,AsyncTrigger* const& proxiesChangeTrigger) - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" clientDBInfo(clientDBInfo), - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" proxiesChangeTrigger(proxiesChangeTrigger), - #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" curCommitProxies(), - #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" curGrvProxies(), - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" actors(false), - #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" clientDBInfoOnChange(clientDBInfo->onChange()) - #line 3925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("monitorClientDBInfoChange", reinterpret_cast(this)); @@ -3935,13 +3994,13 @@ class MonitorClientDBInfoChangeActorState { int a_body1(int loopDepth=0) { try { - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" curCommitProxies = clientDBInfo->get().commitProxies; - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" curGrvProxies = clientDBInfo->get().grvProxies; - #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 3944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -3969,22 +4028,22 @@ class MonitorClientDBInfoChangeActorState { } int a_body1loopBody1(int loopDepth) { - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = clientDBInfoOnChange; - #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = actors.getResult(); - #line 3980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3997,27 +4056,27 @@ class MonitorClientDBInfoChangeActorState { } int a_body1loopBody1when1(Void const& _,int loopDepth) { - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" clientDBInfoOnChange = clientDBInfo->onChange(); - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (clientDBInfo->get().commitProxies != curCommitProxies || clientDBInfo->get().grvProxies != curGrvProxies) - #line 4004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (deterministicRandom()->random01() < cx->verifyCausalReadsProp && !curGrvProxies.empty() && !clientDBInfo->get().grvProxies.empty() && !clientDBInfo->get().grvProxies[0].provisional) - #line 4008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" actors.add(attemptGRVFromOldProxies(curGrvProxies, clientDBInfo->get().grvProxies)); - #line 4012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" curCommitProxies = clientDBInfo->get().commitProxies; - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" curGrvProxies = clientDBInfo->get().grvProxies; - #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" proxiesChangeTrigger->trigger(); - #line 4020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } loopDepth = a_body1loopBody1cont1(loopDepth); @@ -4025,27 +4084,27 @@ class MonitorClientDBInfoChangeActorState { } int a_body1loopBody1when1(Void && _,int loopDepth) { - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" clientDBInfoOnChange = clientDBInfo->onChange(); - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (clientDBInfo->get().commitProxies != curCommitProxies || clientDBInfo->get().grvProxies != curGrvProxies) - #line 4032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (deterministicRandom()->random01() < cx->verifyCausalReadsProp && !curGrvProxies.empty() && !clientDBInfo->get().grvProxies.empty() && !clientDBInfo->get().grvProxies[0].provisional) - #line 4036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" actors.add(attemptGRVFromOldProxies(curGrvProxies, clientDBInfo->get().grvProxies)); - #line 4040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" curCommitProxies = clientDBInfo->get().commitProxies; - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" curGrvProxies = clientDBInfo->get().grvProxies; - #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" proxiesChangeTrigger->trigger(); - #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } loopDepth = a_body1loopBody1cont1(loopDepth); @@ -4053,18 +4112,18 @@ class MonitorClientDBInfoChangeActorState { } int a_body1loopBody1when2(Void const& _,int loopDepth) { - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UNSTOPPABLE_ASSERT(false); - #line 4058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1when2(Void && _,int loopDepth) { - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UNSTOPPABLE_ASSERT(false); - #line 4067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -4166,26 +4225,26 @@ class MonitorClientDBInfoChangeActorState { fdb_probe_actor_exit("monitorClientDBInfoChange", reinterpret_cast(this), 1); } - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseContext* cx; - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference const> clientDBInfo; - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" AsyncTrigger* proxiesChangeTrigger; - #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector curCommitProxies; - #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector curGrvProxies; - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ActorCollection actors; - #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future clientDBInfoOnChange; - #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via monitorClientDBInfoChange() - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class MonitorClientDBInfoChangeActor final : public Actor, public ActorCallback< MonitorClientDBInfoChangeActor, 0, Void >, public ActorCallback< MonitorClientDBInfoChangeActor, 1, Void >, public FastAllocated, public MonitorClientDBInfoChangeActorState { - #line 4188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4195,9 +4254,9 @@ class MonitorClientDBInfoChangeActor final : public Actor, public ActorCal #pragma clang diagnostic pop friend struct ActorCallback< MonitorClientDBInfoChangeActor, 0, Void >; friend struct ActorCallback< MonitorClientDBInfoChangeActor, 1, Void >; - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" MonitorClientDBInfoChangeActor(DatabaseContext* const& cx,Reference const> const& clientDBInfo,AsyncTrigger* const& proxiesChangeTrigger) - #line 4200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), MonitorClientDBInfoChangeActorState(cx, clientDBInfo, proxiesChangeTrigger) { @@ -4221,14 +4280,14 @@ friend struct ActorCallback< MonitorClientDBInfoChangeActor, 1, Void >; } }; } - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] static Future monitorClientDBInfoChange( DatabaseContext* const& cx, Reference const> const& clientDBInfo, AsyncTrigger* const& proxiesChangeTrigger ) { - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new MonitorClientDBInfoChangeActor(cx, clientDBInfo, proxiesChangeTrigger)); - #line 4228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" void updateLocationCacheWithCaches(DatabaseContext* self, const std::map& removed, @@ -4265,29 +4324,29 @@ Reference addCaches(const Reference& loc, return makeReference(interfaces, true); } - #line 4268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via updateCachedRanges() - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class UpdateCachedRangesActorState { - #line 4275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UpdateCachedRangesActorState(DatabaseContext* const& self,std::map* const& cacheServers) - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : self(self), - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cacheServers(cacheServers), - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr(), - #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trueValue(storageCacheValue(std::vector{ 0 })), - #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" falseValue(storageCacheValue(std::vector{})) - #line 4290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("updateCachedRanges", reinterpret_cast(this)); @@ -4301,9 +4360,9 @@ class UpdateCachedRangesActorState { { try { try { - #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 4306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -4331,11 +4390,11 @@ class UpdateCachedRangesActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevError, "UpdateCachedRangesFailed").error(e); - #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 4338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -4354,50 +4413,50 @@ class UpdateCachedRangesActorState { } int a_body1loopBody1(int loopDepth) { - #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr = Transaction(); - #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = delay(0); - #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = brokenPromiseToNever(self->updateCache.onTrigger()); - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = brokenPromiseToNever(self->updateCache.onTrigger()); - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4467,24 +4526,24 @@ class UpdateCachedRangesActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr = Transaction(Database(Reference::addRef(self))); - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setOption(FDBTransactionOptions::READ_LOCK_AWARE); - #line 4476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = tr.getRange(storageCacheKeys, CLIENT_KNOBS->TOO_MANY); - #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2Catch1(actor_cancelled(), loopDepth); - #line 4482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont2Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4497,24 +4556,24 @@ class UpdateCachedRangesActorState { } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr = Transaction(Database(Reference::addRef(self))); - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setOption(FDBTransactionOptions::READ_LOCK_AWARE); - #line 4506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = tr.getRange(storageCacheKeys, CLIENT_KNOBS->TOO_MANY); - #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2Catch1(actor_cancelled(), loopDepth); - #line 4512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont2Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4597,16 +4656,16 @@ class UpdateCachedRangesActorState { int a_body1loopBody1cont2Catch1(const Error& e,int loopDepth=0) { try { - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_4 = tr.onError(e); - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch2(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4619,232 +4678,232 @@ class UpdateCachedRangesActorState { } int a_body1loopBody1cont4(RangeResult const& range,int loopDepth) { - #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(!range.more); - #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector>> cacheInterfaces; - #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cacheInterfaces.reserve(cacheServers->size()); - #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( const auto& p : *cacheServers ) { - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cacheInterfaces.push_back(makeReference>(p.second)); - #line 4632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 1040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool currCached = false; - #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef begin, end; - #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( const auto& kv : range ) { - #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(currCached == (kv.value == falseValue)); - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (kv.value == trueValue) - #line 4644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" begin = kv.key.substr(storageCacheKeys.begin.size()); - #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" currCached = true; - #line 4650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" currCached = false; - #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" end = kv.key.substr(storageCacheKeys.begin.size()); - #line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRangeRef cachedRange{ begin, end }; - #line 1052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto ranges = self->locationCache.containedRanges(cachedRange); - #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef containedRangesBegin, containedRangesEnd, prevKey; - #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!ranges.empty()) - #line 4666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" containedRangesBegin = ranges.begin().range().begin; - #line 4670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(auto iter = ranges.begin();iter != ranges.end();++iter) { - #line 1058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" containedRangesEnd = iter->range().end; - #line 1059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (iter->value() && !iter->value()->hasCaches) - #line 4678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" iter->value() = addCaches(iter->value(), cacheInterfaces); - #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto iter = self->locationCache.rangeContaining(begin); - #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (iter->value() && !iter->value()->hasCaches) - #line 4689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (end >= iter->range().end) - #line 4693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key endCopy = iter->range().end; - #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->locationCache.insert(KeyRangeRef{ begin, endCopy }, addCaches(iter->value(), cacheInterfaces)); - #line 4699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->locationCache.insert(KeyRangeRef{ begin, end }, addCaches(iter->value(), cacheInterfaces)); - #line 4705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" iter = self->locationCache.rangeContainingKeyBefore(end); - #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (iter->value() && !iter->value()->hasCaches) - #line 4712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key beginCopy = iter->range().begin; - #line 1077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->locationCache.insert(KeyRangeRef{ beginCopy, end }, addCaches(iter->value(), cacheInterfaces)); - #line 4718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } } - #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = delay(2.0); - #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2Catch1(actor_cancelled(), loopDepth); - #line 4726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1cont2Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont4(RangeResult && range,int loopDepth) { - #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(!range.more); - #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector>> cacheInterfaces; - #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cacheInterfaces.reserve(cacheServers->size()); - #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( const auto& p : *cacheServers ) { - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cacheInterfaces.push_back(makeReference>(p.second)); - #line 4748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 1040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool currCached = false; - #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef begin, end; - #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( const auto& kv : range ) { - #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(currCached == (kv.value == falseValue)); - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (kv.value == trueValue) - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" begin = kv.key.substr(storageCacheKeys.begin.size()); - #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" currCached = true; - #line 4766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" currCached = false; - #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" end = kv.key.substr(storageCacheKeys.begin.size()); - #line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRangeRef cachedRange{ begin, end }; - #line 1052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto ranges = self->locationCache.containedRanges(cachedRange); - #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef containedRangesBegin, containedRangesEnd, prevKey; - #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!ranges.empty()) - #line 4782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" containedRangesBegin = ranges.begin().range().begin; - #line 4786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(auto iter = ranges.begin();iter != ranges.end();++iter) { - #line 1058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" containedRangesEnd = iter->range().end; - #line 1059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (iter->value() && !iter->value()->hasCaches) - #line 4794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" iter->value() = addCaches(iter->value(), cacheInterfaces); - #line 4798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto iter = self->locationCache.rangeContaining(begin); - #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (iter->value() && !iter->value()->hasCaches) - #line 4805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (end >= iter->range().end) - #line 4809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key endCopy = iter->range().end; - #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->locationCache.insert(KeyRangeRef{ begin, endCopy }, addCaches(iter->value(), cacheInterfaces)); - #line 4815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->locationCache.insert(KeyRangeRef{ begin, end }, addCaches(iter->value(), cacheInterfaces)); - #line 4821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" iter = self->locationCache.rangeContainingKeyBefore(end); - #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (iter->value() && !iter->value()->hasCaches) - #line 4828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key beginCopy = iter->range().begin; - #line 1077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->locationCache.insert(KeyRangeRef{ beginCopy, end }, addCaches(iter->value(), cacheInterfaces)); - #line 4834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } } - #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = delay(2.0); - #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2Catch1(actor_cancelled(), loopDepth); - #line 4842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1cont2Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -5075,22 +5134,22 @@ class UpdateCachedRangesActorState { fdb_probe_actor_exit("updateCachedRanges", reinterpret_cast(this), 4); } - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseContext* self; - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::map* cacheServers; - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction tr; - #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Value trueValue; - #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Value falseValue; - #line 5088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via updateCachedRanges() - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class UpdateCachedRangesActor final : public Actor, public ActorCallback< UpdateCachedRangesActor, 0, Void >, public ActorCallback< UpdateCachedRangesActor, 1, Void >, public ActorCallback< UpdateCachedRangesActor, 2, RangeResult >, public ActorCallback< UpdateCachedRangesActor, 3, Void >, public ActorCallback< UpdateCachedRangesActor, 4, Void >, public FastAllocated, public UpdateCachedRangesActorState { - #line 5093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5103,9 +5162,9 @@ friend struct ActorCallback< UpdateCachedRangesActor, 1, Void >; friend struct ActorCallback< UpdateCachedRangesActor, 2, RangeResult >; friend struct ActorCallback< UpdateCachedRangesActor, 3, Void >; friend struct ActorCallback< UpdateCachedRangesActor, 4, Void >; - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UpdateCachedRangesActor(DatabaseContext* const& self,std::map* const& cacheServers) - #line 5108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), UpdateCachedRangesActorState(self, cacheServers) { @@ -5133,39 +5192,41 @@ friend struct ActorCallback< UpdateCachedRangesActor, 4, Void >; } }; } - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future updateCachedRanges( DatabaseContext* const& self, std::map* const& cacheServers ) { - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new UpdateCachedRangesActor(self, cacheServers)); - #line 5140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 1139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" // The reason for getting a pointer to DatabaseContext instead of a reference counted object is because reference // counting will increment reference count for DatabaseContext which holds the future of this actor. This creates a // cyclic reference and hence this actor and Database object will not be destroyed at all. - #line 5148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via monitorCacheList() - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class MonitorCacheListActorState { - #line 5155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" MonitorCacheListActorState(DatabaseContext* const& self) - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : self(self), - #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr(), - #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cacheServerMap(), - #line 1100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - updateRanges(updateCachedRanges(self, &cacheServerMap)) - #line 5168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + updateRanges(updateCachedRanges(self, &cacheServerMap)), + #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + backoff() + #line 5229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("monitorCacheList", reinterpret_cast(this)); @@ -5178,16 +5239,16 @@ class MonitorCacheListActorState { int a_body1(int loopDepth=0) { try { - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = self->updateCache.onTrigger(); - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5209,9 +5270,9 @@ class MonitorCacheListActorState { int a_body1cont1(Void const& _,int loopDepth) { try { - #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 5214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); } catch (Error& error) { @@ -5225,9 +5286,9 @@ class MonitorCacheListActorState { int a_body1cont1(Void && _,int loopDepth) { try { - #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 5230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); } catch (Error& error) { @@ -5304,11 +5365,11 @@ class MonitorCacheListActorState { int a_body1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevError, "MonitorCacheListFailed").error(e); - #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 5311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -5327,16 +5388,16 @@ class MonitorCacheListActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = refreshTransaction(self, &tr); - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -5344,16 +5405,16 @@ class MonitorCacheListActorState { int a_body1cont1loopBody1cont1(Void const& _,int loopDepth) { try { - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = tr.getRange(storageCacheServerKeys, CLIENT_KNOBS->TOO_MANY); - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 5351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5367,16 +5428,16 @@ class MonitorCacheListActorState { int a_body1cont1loopBody1cont1(Void && _,int loopDepth) { try { - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = tr.getRange(storageCacheServerKeys, CLIENT_KNOBS->TOO_MANY); - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 5374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5459,16 +5520,16 @@ class MonitorCacheListActorState { int a_body1cont1loopBody1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 1139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_4 = tr.onError(e); - #line 1139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 1139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5481,100 +5542,100 @@ class MonitorCacheListActorState { } int a_body1cont1loopBody1cont3(RangeResult const& cacheList,int loopDepth) { - #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(!cacheList.more); - #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool hasChanges = false; - #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::map allCacheServers; - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto kv : cacheList ) { - #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto ssi = BinaryReader::fromStringRef(kv.value, IncludeVersion()); - #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" allCacheServers.emplace(ssi.id(), ssi); - #line 5496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::map newCacheServers; - #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::map deletedCacheServers; - #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::set_difference(allCacheServers.begin(), allCacheServers.end(), cacheServerMap.begin(), cacheServerMap.end(), std::insert_iterator>( newCacheServers, newCacheServers.begin())); - #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::set_difference(cacheServerMap.begin(), cacheServerMap.end(), allCacheServers.begin(), allCacheServers.end(), std::insert_iterator>( deletedCacheServers, deletedCacheServers.begin())); - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" hasChanges = !(newCacheServers.empty() && deletedCacheServers.empty()); - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (hasChanges) - #line 5510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" updateLocationCacheWithCaches(self, deletedCacheServers, newCacheServers); - #line 5514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 1136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cacheServerMap = std::move(allCacheServers); - #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = delay(5.0); - #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 5522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont3(RangeResult && cacheList,int loopDepth) { - #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(!cacheList.more); - #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool hasChanges = false; - #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::map allCacheServers; - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto kv : cacheList ) { - #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto ssi = BinaryReader::fromStringRef(kv.value, IncludeVersion()); - #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" allCacheServers.emplace(ssi.id(), ssi); - #line 5546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::map newCacheServers; - #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::map deletedCacheServers; - #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::set_difference(allCacheServers.begin(), allCacheServers.end(), cacheServerMap.begin(), cacheServerMap.end(), std::insert_iterator>( newCacheServers, newCacheServers.begin())); - #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::set_difference(cacheServerMap.begin(), cacheServerMap.end(), allCacheServers.begin(), allCacheServers.end(), std::insert_iterator>( deletedCacheServers, deletedCacheServers.begin())); - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" hasChanges = !(newCacheServers.empty() && deletedCacheServers.empty()); - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (hasChanges) - #line 5560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" updateLocationCacheWithCaches(self, deletedCacheServers, newCacheServers); - #line 5564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 1136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cacheServerMap = std::move(allCacheServers); - #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = delay(5.0); - #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 5572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -5644,13 +5705,19 @@ class MonitorCacheListActorState { } int a_body1cont1loopBody1cont4(Void const& _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont7(loopDepth); + #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + backoff = Backoff(); + #line 5710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont8(loopDepth); return loopDepth; } int a_body1cont1loopBody1cont4(Void && _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont7(loopDepth); + #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + backoff = Backoff(); + #line 5719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont8(loopDepth); return loopDepth; } @@ -5717,7 +5784,7 @@ class MonitorCacheListActorState { fdb_probe_actor_exit("monitorCacheList", reinterpret_cast(this), 3); } - int a_body1cont1loopBody1cont7(int loopDepth) + int a_body1cont1loopBody1cont8(int loopDepth) { try { loopDepth = a_body1cont1loopBody1cont2(loopDepth); @@ -5732,13 +5799,33 @@ class MonitorCacheListActorState { } int a_body1cont1loopBody1cont1Catch1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont2(loopDepth); + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_5 = backoff.onError(); + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 5806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1Catch1cont1when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont1Catch1cont1(Void && _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont2(loopDepth); + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_5 = backoff.onError(); + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 5822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1Catch1cont1when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } @@ -5805,20 +5892,97 @@ class MonitorCacheListActorState { fdb_probe_actor_exit("monitorCacheList", reinterpret_cast(this), 4); } - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int a_body1cont1loopBody1cont1Catch1cont2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont1Catch1cont2(Void && _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont1Catch1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont1Catch1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont1Catch1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont1Catch1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< MonitorCacheListActor, 5, Void >::remove(); + + } + void a_callback_fire(ActorCallback< MonitorCacheListActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("monitorCacheList", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont1loopBody1cont1Catch1cont1when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorCacheList", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< MonitorCacheListActor, 5, Void >*,Void && value) + { + fdb_probe_actor_enter("monitorCacheList", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont1loopBody1cont1Catch1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorCacheList", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< MonitorCacheListActor, 5, Void >*,Error err) + { + fdb_probe_actor_enter("monitorCacheList", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("monitorCacheList", reinterpret_cast(this), 5); + + } + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseContext* self; - #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction tr; - #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::map cacheServerMap; - #line 1100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future updateRanges; - #line 5816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Backoff backoff; + #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via monitorCacheList() - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class MonitorCacheListActor final : public Actor, public ActorCallback< MonitorCacheListActor, 0, Void >, public ActorCallback< MonitorCacheListActor, 1, Void >, public ActorCallback< MonitorCacheListActor, 2, RangeResult >, public ActorCallback< MonitorCacheListActor, 3, Void >, public ActorCallback< MonitorCacheListActor, 4, Void >, public FastAllocated, public MonitorCacheListActorState { - #line 5821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class MonitorCacheListActor final : public Actor, public ActorCallback< MonitorCacheListActor, 0, Void >, public ActorCallback< MonitorCacheListActor, 1, Void >, public ActorCallback< MonitorCacheListActor, 2, RangeResult >, public ActorCallback< MonitorCacheListActor, 3, Void >, public ActorCallback< MonitorCacheListActor, 4, Void >, public ActorCallback< MonitorCacheListActor, 5, Void >, public FastAllocated, public MonitorCacheListActorState { + #line 5985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5831,9 +5995,10 @@ friend struct ActorCallback< MonitorCacheListActor, 1, Void >; friend struct ActorCallback< MonitorCacheListActor, 2, RangeResult >; friend struct ActorCallback< MonitorCacheListActor, 3, Void >; friend struct ActorCallback< MonitorCacheListActor, 4, Void >; - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +friend struct ActorCallback< MonitorCacheListActor, 5, Void >; + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" MonitorCacheListActor(DatabaseContext* const& self) - #line 5836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), MonitorCacheListActorState(self) { @@ -5856,41 +6021,42 @@ friend struct ActorCallback< MonitorCacheListActor, 4, Void >; case 3: this->a_callback_error((ActorCallback< MonitorCacheListActor, 2, RangeResult >*)0, actor_cancelled()); break; case 4: this->a_callback_error((ActorCallback< MonitorCacheListActor, 3, Void >*)0, actor_cancelled()); break; case 5: this->a_callback_error((ActorCallback< MonitorCacheListActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< MonitorCacheListActor, 5, Void >*)0, actor_cancelled()); break; } } }; } - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future monitorCacheList( DatabaseContext* const& self ) { - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new MonitorCacheListActor(self)); - #line 5868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 5873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via handleTssMismatches() - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class HandleTssMismatchesActorState { - #line 5880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" HandleTssMismatchesActorState(DatabaseContext* const& cx) - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr(), - #line 1150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssMapDB(KeyBackedMap(tssMappingKeys.begin)), - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssMismatchDB(KeyBackedMap(tssMismatchKeys.begin)) - #line 5893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("handleTssMismatches", reinterpret_cast(this)); @@ -5903,9 +6069,9 @@ class HandleTssMismatchesActorState { int a_body1(int loopDepth=0) { try { - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 5908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -5933,41 +6099,41 @@ class HandleTssMismatchesActorState { } int a_body1loopBody1(int loopDepth) { - #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" FutureStream>> __when_expr_0 = cx->tssMismatchStream.getFuture(); - #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); - #line 5945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(int loopDepth) { - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = delay(0); - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1when1(std::pair> const& __data,int loopDepth) { - #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" data = __data; - #line 5970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -6032,50 +6198,50 @@ class HandleTssMismatchesActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssPairID = UID(); - #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool found = false; - #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( const auto& it : cx->tssMapping ) { - #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (it.second.id() == data.first) - #line 6043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssPairID = it.first; - #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" found = true; - #line 6049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" break; } } - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (found) - #line 6055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" quarantine = CLIENT_KNOBS->QUARANTINE_TSS_ON_MISMATCH; - #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevWarnAlways, quarantine ? "TSS_QuarantineMismatch" : "TSS_KillMismatch") .detail("TSSID", data.first.toString()); - #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(quarantine); - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(!quarantine); - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(quarantine, "Quarantining TSS because it got mismatch"); + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(!quarantine, "Killing TSS because it got mismatch"); + #line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr = makeReference(Database(Reference::addRef(cx))); - #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tries = 0; - #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 6071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont2loopHead1(loopDepth); } else { - #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 6078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Not handling TSS with mismatch because it's already gone"); + #line 6244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont3(loopDepth); } @@ -6083,50 +6249,50 @@ class HandleTssMismatchesActorState { } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssPairID = UID(); - #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool found = false; - #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( const auto& it : cx->tssMapping ) { - #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (it.second.id() == data.first) - #line 6094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssPairID = it.first; - #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" found = true; - #line 6100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" break; } } - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (found) - #line 6106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" quarantine = CLIENT_KNOBS->QUARANTINE_TSS_ON_MISMATCH; - #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevWarnAlways, quarantine ? "TSS_QuarantineMismatch" : "TSS_KillMismatch") .detail("TSSID", data.first.toString()); - #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(quarantine); - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(!quarantine); - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(quarantine, "Quarantining TSS because it got mismatch"); + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(!quarantine, "Killing TSS because it got mismatch"); + #line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr = makeReference(Database(Reference::addRef(cx))); - #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tries = 0; - #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 6122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont2loopHead1(loopDepth); } else { - #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 6129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Not handling TSS with mismatch because it's already gone"); + #line 6295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont3(loopDepth); } @@ -6203,9 +6369,9 @@ class HandleTssMismatchesActorState { } int a_body1loopBody1cont6(int loopDepth) { - #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr = makeReference(); - #line 6208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; @@ -6220,42 +6386,42 @@ class HandleTssMismatchesActorState { int a_body1loopBody1cont2loopBody1(int loopDepth) { try { - #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (quarantine) - #line 6229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr->set(tssQuarantineKeyFor(data.first), LiteralStringRef("")); - #line 6233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->set(tssQuarantineKeyFor(data.first), ""_sr); + #line 6399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->clear(serverTagKeyFor(data.first)); - #line 6239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssMapDB.erase(tr, tssPairID); - #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( const DetailedTSSMismatch& d : data.second ) { - #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tssMismatchDB.set( tr, Tuple().append(data.first.toString()).append(d.timestamp).append(d.mismatchId.toString()), d.traceString); - #line 6247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssMismatchDB.set(tr, Tuple::makeTuple(data.first.toString(), d.timestamp, d.mismatchId.toString()), d.traceString); + #line 6413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = tr->commit(); - #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont2loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2loopBody1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6281,15 +6447,15 @@ class HandleTssMismatchesActorState { } int a_body1loopBody1cont2loopBody1cont1(int loopDepth) { - #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tries++; - #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (tries > 10) - #line 6288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent("TSS_MismatchGaveUp").detail("TSSID", data.first.toString()); - #line 6292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return a_body1loopBody1cont2break1(loopDepth==0?0:loopDepth-1); // break } if (loopDepth == 0) return a_body1loopBody1cont2loopHead1(0); @@ -6299,16 +6465,16 @@ class HandleTssMismatchesActorState { int a_body1loopBody1cont2loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = tr->onError(e); - #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 6306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont2loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6469,28 +6635,28 @@ class HandleTssMismatchesActorState { fdb_probe_actor_exit("handleTssMismatches", reinterpret_cast(this), 3); } - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseContext* cx; - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference tr; - #line 1150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyBackedMap tssMapDB; - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyBackedMap tssMismatchDB; - #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::pair> data; - #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UID tssPairID; - #line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool quarantine; - #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int tries; - #line 6488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via handleTssMismatches() - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class HandleTssMismatchesActor final : public Actor, public ActorSingleCallback< HandleTssMismatchesActor, 0, std::pair> >, public ActorCallback< HandleTssMismatchesActor, 1, Void >, public ActorCallback< HandleTssMismatchesActor, 2, Void >, public ActorCallback< HandleTssMismatchesActor, 3, Void >, public FastAllocated, public HandleTssMismatchesActorState { - #line 6493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6502,9 +6668,9 @@ friend struct ActorSingleCallback< HandleTssMismatchesActor, 0, std::pair; friend struct ActorCallback< HandleTssMismatchesActor, 2, Void >; friend struct ActorCallback< HandleTssMismatchesActor, 3, Void >; - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" HandleTssMismatchesActor(DatabaseContext* const& cx) - #line 6507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), HandleTssMismatchesActorState(cx) { @@ -6531,34 +6697,36 @@ friend struct ActorCallback< HandleTssMismatchesActor, 3, Void >; } }; } - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] static Future handleTssMismatches( DatabaseContext* const& cx ) { - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new HandleTssMismatchesActor(cx)); - #line 6538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 6543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via backgroundGrvUpdater() - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class BackgroundGrvUpdaterActorState { - #line 6550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" BackgroundGrvUpdaterActorState(DatabaseContext* const& cx) - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr(), - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - grvDelay(0.001) - #line 6561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + grvDelay(0.001), + #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + backoff() + #line 6729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("backgroundGrvUpdater", reinterpret_cast(this)); @@ -6572,9 +6740,9 @@ class BackgroundGrvUpdaterActorState { { try { try { - #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 6577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -6602,11 +6770,11 @@ class BackgroundGrvUpdaterActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevInfo, "BackgroundGrvUpdaterFailed").errorUnsuppressed(e); - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 6609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -6625,59 +6793,59 @@ class BackgroundGrvUpdaterActorState { } int a_body1loopBody1(int loopDepth) { - #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (CLIENT_KNOBS->FORCE_GRV_CACHE_OFF) - #line 6630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~BackgroundGrvUpdaterActorState(); static_cast(this)->destroy(); return 0; } - #line 6634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~BackgroundGrvUpdaterActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = refreshTransaction(cx, &tr); - #line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" curTime = now(); - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" lastTime = cx->getLastGrvTime(); - #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" lastProxyTime = cx->lastProxyRequestTime; - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevDebug, "BackgroundGrvUpdaterBefore") .detail("CurTime", curTime) .detail("LastTime", lastTime) .detail("GrvDelay", grvDelay) .detail("CachedReadVersion", cx->getCachedReadVersion()) .detail("CachedTime", cx->getLastGrvTime()) .detail("Gap", curTime - lastTime) .detail("Bound", CLIENT_KNOBS->MAX_VERSION_CACHE_LAG - grvDelay); - #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (curTime - lastTime >= (CLIENT_KNOBS->MAX_VERSION_CACHE_LAG - grvDelay) || curTime - lastProxyTime > CLIENT_KNOBS->MAX_PROXY_CONTACT_LAG) - #line 6666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { try { - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setOption(FDBTransactionOptions::SKIP_GRV_CACHE); - #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = success(tr.getReadVersion()); - #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 6675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6688,16 +6856,16 @@ class BackgroundGrvUpdaterActorState { } else { - #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = delay(std::max(0.001, std::min(CLIENT_KNOBS->MAX_PROXY_CONTACT_LAG - (curTime - lastProxyTime), (CLIENT_KNOBS->MAX_VERSION_CACHE_LAG - grvDelay) - (curTime - lastTime)))); - #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = delay(std::max(0.001, std::min(CLIENT_KNOBS->MAX_PROXY_CONTACT_LAG - (curTime - lastProxyTime), (CLIENT_KNOBS->MAX_VERSION_CACHE_LAG - grvDelay) - (curTime - lastTime)))); + #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when2(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch2(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when2(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } @@ -6705,31 +6873,31 @@ class BackgroundGrvUpdaterActorState { } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" curTime = now(); - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" lastTime = cx->getLastGrvTime(); - #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" lastProxyTime = cx->lastProxyRequestTime; - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevDebug, "BackgroundGrvUpdaterBefore") .detail("CurTime", curTime) .detail("LastTime", lastTime) .detail("GrvDelay", grvDelay) .detail("CachedReadVersion", cx->getCachedReadVersion()) .detail("CachedTime", cx->getLastGrvTime()) .detail("Gap", curTime - lastTime) .detail("Bound", CLIENT_KNOBS->MAX_VERSION_CACHE_LAG - grvDelay); - #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (curTime - lastTime >= (CLIENT_KNOBS->MAX_VERSION_CACHE_LAG - grvDelay) || curTime - lastProxyTime > CLIENT_KNOBS->MAX_PROXY_CONTACT_LAG) - #line 6718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { try { - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setOption(FDBTransactionOptions::SKIP_GRV_CACHE); - #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = success(tr.getReadVersion()); - #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 6727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6740,16 +6908,16 @@ class BackgroundGrvUpdaterActorState { } else { - #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = delay(std::max(0.001, std::min(CLIENT_KNOBS->MAX_PROXY_CONTACT_LAG - (curTime - lastProxyTime), (CLIENT_KNOBS->MAX_VERSION_CACHE_LAG - grvDelay) - (curTime - lastTime)))); - #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = delay(std::max(0.001, std::min(CLIENT_KNOBS->MAX_PROXY_CONTACT_LAG - (curTime - lastProxyTime), (CLIENT_KNOBS->MAX_VERSION_CACHE_LAG - grvDelay) - (curTime - lastTime)))); + #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when2(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch2(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when2(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } @@ -6833,18 +7001,18 @@ class BackgroundGrvUpdaterActorState { int a_body1loopBody1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevInfo, "BackgroundGrvUpdaterTxnError").errorUnsuppressed(e); - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = tr.onError(e); - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6857,26 +7025,30 @@ class BackgroundGrvUpdaterActorState { } int a_body1loopBody1cont5(Void const& _,int loopDepth) { - #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->lastProxyRequestTime = curTime; - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" grvDelay = (grvDelay + (now() - curTime)) / 2.0; - #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevDebug, "BackgroundGrvUpdaterSuccess") .detail("GrvDelay", grvDelay) .detail("CachedReadVersion", cx->getCachedReadVersion()) .detail("CachedTime", cx->getLastGrvTime()); - #line 6866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + backoff = Backoff(); + #line 7036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont7(loopDepth); return loopDepth; } int a_body1loopBody1cont5(Void && _,int loopDepth) { - #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->lastProxyRequestTime = curTime; - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" grvDelay = (grvDelay + (now() - curTime)) / 2.0; - #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevDebug, "BackgroundGrvUpdaterSuccess") .detail("GrvDelay", grvDelay) .detail("CachedReadVersion", cx->getCachedReadVersion()) .detail("CachedTime", cx->getLastGrvTime()); - #line 6879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + backoff = Backoff(); + #line 7051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont7(loopDepth); return loopDepth; @@ -6959,13 +7131,33 @@ class BackgroundGrvUpdaterActorState { } int a_body1loopBody1cont1Catch1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(loopDepth); + #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = backoff.onError(); + #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 7138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1cont1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1Catch1cont1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(loopDepth); + #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = backoff.onError(); + #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 7154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1cont1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } @@ -7032,27 +7224,27 @@ class BackgroundGrvUpdaterActorState { fdb_probe_actor_exit("backgroundGrvUpdater", reinterpret_cast(this), 2); } - int a_body1loopBody1cont8(Void const& _,int loopDepth) + int a_body1loopBody1cont1Catch1cont2(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont3(loopDepth); + loopDepth = a_body1loopBody1cont4(loopDepth); return loopDepth; } - int a_body1loopBody1cont8(Void && _,int loopDepth) + int a_body1loopBody1cont1Catch1cont2(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont3(loopDepth); + loopDepth = a_body1loopBody1cont4(loopDepth); return loopDepth; } - int a_body1loopBody1cont1when2(Void const& _,int loopDepth) + int a_body1loopBody1cont1Catch1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont8(_, loopDepth); + loopDepth = a_body1loopBody1cont1Catch1cont2(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont1when2(Void && _,int loopDepth) + int a_body1loopBody1cont1Catch1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont8(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont1Catch1cont2(std::move(_), loopDepth); return loopDepth; } @@ -7067,7 +7259,7 @@ class BackgroundGrvUpdaterActorState { fdb_probe_actor_enter("backgroundGrvUpdater", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1loopBody1cont1when2(value, 0); + a_body1loopBody1cont1Catch1cont1when1(value, 0); } catch (Error& error) { a_body1Catch2(error, 0); @@ -7082,7 +7274,7 @@ class BackgroundGrvUpdaterActorState { fdb_probe_actor_enter("backgroundGrvUpdater", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1loopBody1cont1when2(std::move(value), 0); + a_body1loopBody1cont1Catch1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch2(error, 0); @@ -7107,24 +7299,101 @@ class BackgroundGrvUpdaterActorState { fdb_probe_actor_exit("backgroundGrvUpdater", reinterpret_cast(this), 3); } - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int a_body1loopBody1cont8(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont8(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1when2(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1when2(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< BackgroundGrvUpdaterActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< BackgroundGrvUpdaterActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("backgroundGrvUpdater", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont1when2(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("backgroundGrvUpdater", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< BackgroundGrvUpdaterActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("backgroundGrvUpdater", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("backgroundGrvUpdater", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< BackgroundGrvUpdaterActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("backgroundGrvUpdater", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("backgroundGrvUpdater", reinterpret_cast(this), 4); + + } + #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseContext* cx; - #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction tr; - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double grvDelay; - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Backoff backoff; + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double curTime; - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double lastTime; - #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double lastProxyTime; - #line 7122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via backgroundGrvUpdater() - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class BackgroundGrvUpdaterActor final : public Actor, public ActorCallback< BackgroundGrvUpdaterActor, 0, Void >, public ActorCallback< BackgroundGrvUpdaterActor, 1, Void >, public ActorCallback< BackgroundGrvUpdaterActor, 2, Void >, public ActorCallback< BackgroundGrvUpdaterActor, 3, Void >, public FastAllocated, public BackgroundGrvUpdaterActorState { - #line 7127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class BackgroundGrvUpdaterActor final : public Actor, public ActorCallback< BackgroundGrvUpdaterActor, 0, Void >, public ActorCallback< BackgroundGrvUpdaterActor, 1, Void >, public ActorCallback< BackgroundGrvUpdaterActor, 2, Void >, public ActorCallback< BackgroundGrvUpdaterActor, 3, Void >, public ActorCallback< BackgroundGrvUpdaterActor, 4, Void >, public FastAllocated, public BackgroundGrvUpdaterActorState { + #line 7396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7136,9 +7405,10 @@ friend struct ActorCallback< BackgroundGrvUpdaterActor, 0, Void >; friend struct ActorCallback< BackgroundGrvUpdaterActor, 1, Void >; friend struct ActorCallback< BackgroundGrvUpdaterActor, 2, Void >; friend struct ActorCallback< BackgroundGrvUpdaterActor, 3, Void >; - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +friend struct ActorCallback< BackgroundGrvUpdaterActor, 4, Void >; + #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" BackgroundGrvUpdaterActor(DatabaseContext* const& cx) - #line 7141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), BackgroundGrvUpdaterActorState(cx) { @@ -7160,37 +7430,40 @@ friend struct ActorCallback< BackgroundGrvUpdaterActor, 3, Void >; case 2: this->a_callback_error((ActorCallback< BackgroundGrvUpdaterActor, 1, Void >*)0, actor_cancelled()); break; case 3: this->a_callback_error((ActorCallback< BackgroundGrvUpdaterActor, 2, Void >*)0, actor_cancelled()); break; case 4: this->a_callback_error((ActorCallback< BackgroundGrvUpdaterActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< BackgroundGrvUpdaterActor, 4, Void >*)0, actor_cancelled()); break; } } }; } - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] static Future backgroundGrvUpdater( DatabaseContext* const& cx ) { - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new BackgroundGrvUpdaterActor(cx)); - #line 7172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getHealthMetricsActor() - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetHealthMetricsActorActorState { - #line 7184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetHealthMetricsActorActorState(DatabaseContext* const& cx,bool const& detailed) - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetHealthMetricsActorActorState(DatabaseContext* const& cx,bool const& detailed,bool const& sendDetailedRequest) + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - detailed(detailed) - #line 7193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + detailed(detailed), + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + sendDetailedRequest(sendDetailedRequest) + #line 7466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getHealthMetricsActor", reinterpret_cast(this)); @@ -7203,42 +7476,9 @@ class GetHealthMetricsActorActorState { int a_body1(int loopDepth=0) { try { - #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (now() - cx->healthMetricsLastUpdated < CLIENT_KNOBS->AGGREGATE_HEALTH_METRICS_MAX_STALENESS) - #line 7208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (detailed) - #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(cx->healthMetrics); this->~GetHealthMetricsActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< HealthMetrics >::value()) HealthMetrics(cx->healthMetrics); - this->~GetHealthMetricsActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - else - { - #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - HealthMetrics result; - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - result.update(cx->healthMetrics, false, false); - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetHealthMetricsActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< HealthMetrics >::value()) HealthMetrics(result); - this->~GetHealthMetricsActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - sendDetailedRequest = detailed && now() - cx->detailedHealthMetricsLastUpdated > CLIENT_KNOBS->DETAILED_HEALTH_METRICS_MAX_STALENESS; - #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 7241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -7266,22 +7506,22 @@ class GetHealthMetricsActorActorState { } int a_body1loopBody1(int loopDepth) { - #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = cx->onProxiesChanged(); - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 7273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = basicLoadBalance(cx->getGrvProxies(UseProvisionalProxies::False), &GrvProxyInterface::getHealthMetrics, GetHealthMetricsRequest(sendDetailedRequest)); - #line 7277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -7306,19 +7546,19 @@ class GetHealthMetricsActorActorState { } int a_body1loopBody1when2(GetHealthMetricsReply const& rep,int loopDepth) { - #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->healthMetrics.update(rep.healthMetrics, detailed, true); - #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (detailed) - #line 7313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->healthMetricsLastUpdated = now(); - #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->detailedHealthMetricsLastUpdated = now(); - #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(cx->healthMetrics); this->~GetHealthMetricsActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< HealthMetrics >::value()) HealthMetrics(cx->healthMetrics); this->~GetHealthMetricsActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7326,15 +7566,15 @@ class GetHealthMetricsActorActorState { } else { - #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->healthMetricsLastUpdated = now(); - #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" HealthMetrics result; - #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" result.update(cx->healthMetrics, false, false); - #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetHealthMetricsActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< HealthMetrics >::value()) HealthMetrics(result); this->~GetHealthMetricsActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7345,19 +7585,19 @@ class GetHealthMetricsActorActorState { } int a_body1loopBody1when2(GetHealthMetricsReply && rep,int loopDepth) { - #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->healthMetrics.update(rep.healthMetrics, detailed, true); - #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (detailed) - #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 1283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->healthMetricsLastUpdated = now(); - #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->detailedHealthMetricsLastUpdated = now(); - #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(cx->healthMetrics); this->~GetHealthMetricsActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< HealthMetrics >::value()) HealthMetrics(cx->healthMetrics); this->~GetHealthMetricsActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7365,15 +7605,15 @@ class GetHealthMetricsActorActorState { } else { - #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->healthMetricsLastUpdated = now(); - #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" HealthMetrics result; - #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" result.update(cx->healthMetrics, false, false); - #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetHealthMetricsActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< HealthMetrics >::value()) HealthMetrics(result); this->~GetHealthMetricsActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7479,18 +7719,18 @@ class GetHealthMetricsActorActorState { fdb_probe_actor_exit("getHealthMetricsActor", reinterpret_cast(this), 1); } - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseContext* cx; - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool detailed; - #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool sendDetailedRequest; - #line 7488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getHealthMetricsActor() - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetHealthMetricsActorActor final : public Actor, public ActorCallback< GetHealthMetricsActorActor, 0, Void >, public ActorCallback< GetHealthMetricsActorActor, 1, GetHealthMetricsReply >, public FastAllocated, public GetHealthMetricsActorActorState { - #line 7493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7500,11 +7740,11 @@ class GetHealthMetricsActorActor final : public Actor, public Act #pragma clang diagnostic pop friend struct ActorCallback< GetHealthMetricsActorActor, 0, Void >; friend struct ActorCallback< GetHealthMetricsActorActor, 1, GetHealthMetricsReply >; - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetHealthMetricsActorActor(DatabaseContext* const& cx,bool const& detailed) - #line 7505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetHealthMetricsActorActor(DatabaseContext* const& cx,bool const& detailed,bool const& sendDetailedRequest) + #line 7745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - GetHealthMetricsActorActorState(cx, detailed) + GetHealthMetricsActorActorState(cx, detailed, sendDetailedRequest) { fdb_probe_actor_enter("getHealthMetricsActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -7526,60 +7766,62 @@ friend struct ActorCallback< GetHealthMetricsActorActor, 1, GetHealthMetricsRepl } }; } - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] static Future getHealthMetricsActor( DatabaseContext* const& cx, bool const& detailed ) { - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new GetHealthMetricsActorActor(cx, detailed)); - #line 7533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] static Future getHealthMetricsActor( DatabaseContext* const& cx, bool const& detailed, bool const& sendDetailedRequest ) { + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetHealthMetricsActorActor(cx, detailed, sendDetailedRequest)); + #line 7773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future DatabaseContext::getHealthMetrics(bool detailed = false) { - return getHealthMetricsActor(this, detailed); + if (now() - healthMetricsLastUpdated < CLIENT_KNOBS->AGGREGATE_HEALTH_METRICS_MAX_STALENESS) { + if (detailed) { + return healthMetrics; + } else { + HealthMetrics result; + result.update(healthMetrics, false, false); + return result; + } + } + bool sendDetailedRequest = + detailed && now() - detailedHealthMetricsLastUpdated > CLIENT_KNOBS->DETAILED_HEALTH_METRICS_MAX_STALENESS; + return getHealthMetricsActor(this, detailed, sendDetailedRequest); } -void DatabaseContext::registerSpecialKeySpaceModule(SpecialKeySpace::MODULE module, - SpecialKeySpace::IMPLTYPE type, - std::unique_ptr&& impl) { - specialKeySpace->registerKeyRange(module, type, impl->getKeyRange(), impl.get()); - specialKeySpaceModules.push_back(std::move(impl)); +Future> DatabaseContext::getStorageStats(const UID& id, double maxStaleness) { + if (now() - detailedHealthMetricsLastUpdated < maxStaleness) { + auto it = healthMetrics.storageStats.find(id); + return it == healthMetrics.storageStats.end() ? Optional() : it->second; + } + + return map(getHealthMetricsActor(this, true, true), [&id](auto metrics) -> Optional { + auto it = metrics.storageStats.find(id); + return it == metrics.storageStats.end() ? Optional() : it->second; + }); +} + +// register a special key(s) implementation under the specified module +void DatabaseContext::registerSpecialKeysImpl(SpecialKeySpace::MODULE module, + SpecialKeySpace::IMPLTYPE type, + std::unique_ptr&& impl, + int deprecatedVersion) { + // if deprecated, add the implementation when the api version is less than the deprecated version + if (deprecatedVersion == -1 || apiVersion.version() < deprecatedVersion) { + specialKeySpace->registerKeyRange(module, type, impl->getKeyRange(), impl.get()); + specialKeySpaceModules.push_back(std::move(impl)); + } } - #line 7549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" [[nodiscard]] Future getWorkerInterfaces( Reference const& clusterRecord ); -#line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +#line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" [[nodiscard]] Future> getJSON( Database const& db ); -#line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - -struct WorkerInterfacesSpecialKeyImpl : SpecialKeyRangeReadImpl { - Future getRange(ReadYourWritesTransaction* ryw, - KeyRangeRef kr, - GetRangeLimits limitsHint) const override { - if (ryw->getDatabase().getPtr() && ryw->getDatabase()->getConnectionRecord()) { - Key prefix = Key(getKeyRange().begin); - return map(getWorkerInterfaces(ryw->getDatabase()->getConnectionRecord()), - [prefix = prefix, kr = KeyRange(kr)](const RangeResult& in) { - RangeResult result; - for (const auto& [k_, v] : in) { - auto k = k_.withPrefix(prefix); - if (kr.contains(k)) - result.push_back_deep(result.arena(), KeyValueRef(k, v)); - } - - std::sort(result.begin(), result.end(), KeyValueRef::OrderByKey{}); - return result; - }); - } else { - return RangeResult(); - } - } - - explicit WorkerInterfacesSpecialKeyImpl(KeyRangeRef kr) : SpecialKeyRangeReadImpl(kr) {} -}; +#line 1378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" struct SingleSpecialKeyImpl : SpecialKeyRangeReadImpl { Future getRange(ReadYourWritesTransaction* ryw, @@ -7595,12 +7837,17 @@ struct SingleSpecialKeyImpl : SpecialKeyRangeReadImpl { }); } - SingleSpecialKeyImpl(KeyRef k, const std::function>(ReadYourWritesTransaction*)>& f) - : SpecialKeyRangeReadImpl(singleKeyRange(k)), k(k), f(f) {} + SingleSpecialKeyImpl(KeyRef k, + const std::function>(ReadYourWritesTransaction*)>& f, + bool supportsTenants = false) + : SpecialKeyRangeReadImpl(singleKeyRange(k)), k(k), f(f), tenantSupport(supportsTenants) {} + + bool supportsTenants() const override { return tenantSupport; }; private: Key k; std::function>(ReadYourWritesTransaction*)> f; + bool tenantSupport; }; class HealthMetricsRangeImpl : public SpecialKeyRangeAsyncImpl { @@ -7615,7 +7862,7 @@ static RangeResult healthMetricsToKVPairs(const HealthMetrics& metrics, KeyRange RangeResult result; if (CLIENT_BUGGIFY) return result; - if (kr.contains(LiteralStringRef("\xff\xff/metrics/health/aggregate")) && metrics.worstStorageDurabilityLag != 0) { + if (kr.contains("\xff\xff/metrics/health/aggregate"_sr) && metrics.worstStorageDurabilityLag != 0) { json_spirit::mObject statsObj; statsObj["batch_limited"] = metrics.batchLimited; statsObj["tps_limit"] = metrics.tpsLimit; @@ -7627,15 +7874,13 @@ static RangeResult healthMetricsToKVPairs(const HealthMetrics& metrics, KeyRange std::string statsString = json_spirit::write_string(json_spirit::mValue(statsObj), json_spirit::Output_options::raw_utf8); ValueRef bytes(result.arena(), statsString); - result.push_back(result.arena(), KeyValueRef(LiteralStringRef("\xff\xff/metrics/health/aggregate"), bytes)); + result.push_back(result.arena(), KeyValueRef("\xff\xff/metrics/health/aggregate"_sr, bytes)); } // tlog stats { int phase = 0; // Avoid comparing twice per loop iteration for (const auto& [uid, logStats] : metrics.tLogQueue) { - StringRef k{ - StringRef(uid.toString()).withPrefix(LiteralStringRef("\xff\xff/metrics/health/log/"), result.arena()) - }; + StringRef k{ StringRef(uid.toString()).withPrefix("\xff\xff/metrics/health/log/"_sr, result.arena()) }; if (phase == 0 && k >= kr.begin) { phase = 1; } @@ -7657,8 +7902,7 @@ static RangeResult healthMetricsToKVPairs(const HealthMetrics& metrics, KeyRange { int phase = 0; // Avoid comparing twice per loop iteration for (const auto& [uid, storageStats] : metrics.storageStats) { - StringRef k{ StringRef(uid.toString()) - .withPrefix(LiteralStringRef("\xff\xff/metrics/health/storage/"), result.arena()) }; + StringRef k{ StringRef(uid.toString()).withPrefix("\xff\xff/metrics/health/storage/"_sr, result.arena()) }; if (phase == 0 && k >= kr.begin) { phase = 1; } @@ -7682,23 +7926,23 @@ static RangeResult healthMetricsToKVPairs(const HealthMetrics& metrics, KeyRange return result; } - #line 7685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via healthMetricsGetRangeActor() - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class HealthMetricsGetRangeActorActorState { - #line 7692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" HealthMetricsGetRangeActorActorState(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : ryw(ryw), - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" kr(kr) - #line 7701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("healthMetricsGetRangeActor", reinterpret_cast(this)); @@ -7711,16 +7955,16 @@ class HealthMetricsGetRangeActorActorState { int a_body1(int loopDepth=0) { try { - #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = ryw->getDatabase()->getHealthMetrics( kr.intersects(KeyRangeRef(LiteralStringRef("\xff\xff/metrics/health/storage/"), LiteralStringRef("\xff\xff/metrics/health/storage0"))) || kr.intersects(KeyRangeRef(LiteralStringRef("\xff\xff/metrics/health/log/"), LiteralStringRef("\xff\xff/metrics/health/log0")))); - #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = ryw->getDatabase()->getHealthMetrics( kr.intersects( KeyRangeRef("\xff\xff/metrics/health/storage/"_sr, "\xff\xff/metrics/health/storage0"_sr)) || kr.intersects(KeyRangeRef("\xff\xff/metrics/health/log/"_sr, "\xff\xff/metrics/health/log0"_sr))); + #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7741,9 +7985,9 @@ class HealthMetricsGetRangeActorActorState { } int a_body1cont1(HealthMetrics const& metrics,int loopDepth) { - #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(healthMetricsToKVPairs(metrics, kr)); this->~HealthMetricsGetRangeActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(healthMetricsToKVPairs(metrics, kr)); this->~HealthMetricsGetRangeActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7753,9 +7997,9 @@ class HealthMetricsGetRangeActorActorState { } int a_body1cont1(HealthMetrics && metrics,int loopDepth) { - #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(healthMetricsToKVPairs(metrics, kr)); this->~HealthMetricsGetRangeActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(healthMetricsToKVPairs(metrics, kr)); this->~HealthMetricsGetRangeActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7826,16 +8070,16 @@ class HealthMetricsGetRangeActorActorState { fdb_probe_actor_exit("healthMetricsGetRangeActor", reinterpret_cast(this), 0); } - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRangeRef kr; - #line 7833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via healthMetricsGetRangeActor() - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class HealthMetricsGetRangeActorActor final : public Actor, public ActorCallback< HealthMetricsGetRangeActorActor, 0, HealthMetrics >, public FastAllocated, public HealthMetricsGetRangeActorActorState { - #line 7838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7844,9 +8088,9 @@ class HealthMetricsGetRangeActorActor final : public Actor, public void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< HealthMetricsGetRangeActorActor, 0, HealthMetrics >; - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" HealthMetricsGetRangeActorActor(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 7849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), HealthMetricsGetRangeActorActorState(ryw, kr) { @@ -7870,14 +8114,14 @@ friend struct ActorCallback< HealthMetricsGetRangeActorActor, 0, HealthMetrics > } }; } - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] static Future healthMetricsGetRangeActor( ReadYourWritesTransaction* const& ryw, KeyRangeRef const& kr ) { - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new HealthMetricsGetRangeActorActor(ryw, kr)); - #line 7877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 1446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" HealthMetricsRangeImpl::HealthMetricsRangeImpl(KeyRangeRef kr) : SpecialKeyRangeAsyncImpl(kr) {} @@ -7887,14 +8131,237 @@ Future HealthMetricsRangeImpl::getRange(ReadYourWritesTransaction* return healthMetricsGetRangeActor(ryw, kr); } -KeyRangeRef toRelativeRange(KeyRangeRef range, KeyRef prefix) { - if (prefix.empty()) { - return range; - } else { - KeyRef begin = range.begin.startsWith(prefix) ? range.begin.removePrefix(prefix) : allKeys.begin; - KeyRef end = range.end.startsWith(prefix) ? range.end.removePrefix(prefix) : allKeys.end; - return KeyRangeRef(begin, end); + #line 8134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via getClusterId() + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetClusterIdActorState { + #line 8141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetClusterIdActorState(Database const& db) + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db) + #line 8148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("getClusterId", reinterpret_cast(this)); + } + ~GetClusterIdActorState() + { + fdb_probe_actor_destroy("getClusterId", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 8163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetClusterIdActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 1502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(db->clientInfo->get().clusterId); this->~GetClusterIdActorState(); static_cast(this)->destroy(); return 0; } + #line 8186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< UID >::value()) UID(db->clientInfo->get().clusterId); + this->~GetClusterIdActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!(!db->clientInfo->get().clusterId.isValid())) + #line 8205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = db->clientInfo->onChange(); + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 8213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 8218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(Void const& _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1(Void && _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetClusterIdActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetClusterIdActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getClusterId", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getClusterId", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetClusterIdActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getClusterId", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getClusterId", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetClusterIdActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getClusterId", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getClusterId", reinterpret_cast(this), 0); + + } + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database db; + #line 8313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via getClusterId() + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetClusterIdActor final : public Actor, public ActorCallback< GetClusterIdActor, 0, Void >, public FastAllocated, public GetClusterIdActorState { + #line 8318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetClusterIdActor, 0, Void >; + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetClusterIdActor(Database const& db) + #line 8329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + GetClusterIdActorState(db) + { + fdb_probe_actor_enter("getClusterId", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getClusterId"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getClusterId", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetClusterIdActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getClusterId( Database const& db ) { + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetClusterIdActor(db)); + #line 8357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +void DatabaseContext::initializeSpecialCounters() { + specialCounter(cc, "OutstandingWatches", [this] { return outstandingWatches; }); + specialCounter(cc, "WatchMapSize", [this] { return watchMap.size(); }); } DatabaseContext::DatabaseContext(Reference>> connectionRecord, @@ -7906,12 +8373,13 @@ DatabaseContext::DatabaseContext(Reference defaultTenant) - : lockAware(lockAware), switchable(switchable), connectionRecord(connectionRecord), proxyProvisional(false), - clientLocality(clientLocality), enableLocalityLoadBalance(enableLocalityLoadBalance), defaultTenant(defaultTenant), - internal(internal), cc("TransactionMetrics"), transactionReadVersions("ReadVersions", cc), + : dbId(deterministicRandom()->randomUniqueID()), lockAware(lockAware), switchable(switchable), + connectionRecord(connectionRecord), proxyProvisional(false), clientLocality(clientLocality), + enableLocalityLoadBalance(enableLocalityLoadBalance), defaultTenant(defaultTenant), internal(internal), + cc("TransactionMetrics", dbId.toString()), transactionReadVersions("ReadVersions", cc), transactionReadVersionsThrottled("ReadVersionsThrottled", cc), transactionReadVersionsCompleted("ReadVersionsCompleted", cc), transactionReadVersionBatches("ReadVersionBatches", cc), @@ -7935,24 +8403,32 @@ DatabaseContext::DatabaseContext(ReferenceSHARD_STAT_SMOOTH_AMOUNT), specialKeySpace(std::make_unique(specialKeys.begin, specialKeys.end, /* test */ false)), connectToDatabaseEventCacheHolder(format("ConnectToDatabase/%s", dbId.toString().c_str())) { - dbId = deterministicRandom()->randomUniqueID(); - TraceEvent("DatabaseContextCreated", dbId).backtrace(); connected = (clientInfo->get().commitProxies.size() && clientInfo->get().grvProxies.size()) @@ -7962,16 +8438,14 @@ DatabaseContext::DatabaseContext(ReferenceMETADATA_VERSION_CACHE_SIZE); maxOutstandingWatches = CLIENT_KNOBS->DEFAULT_MAX_OUTSTANDING_WATCHES; - snapshotRywEnabled = apiVersionAtLeast(300) ? 1 : 0; + snapshotRywEnabled = apiVersion.hasSnapshotRYW() ? 1 : 0; logger = databaseLogger(this) && tssLogger(this); locationCacheSize = g_network->isSimulated() ? CLIENT_KNOBS->LOCATION_CACHE_EVICTION_SIZE_SIM : CLIENT_KNOBS->LOCATION_CACHE_EVICTION_SIZE; - tenantCacheSize = g_network->isSimulated() ? CLIENT_KNOBS->TENANT_CACHE_EVICTION_SIZE_SIM - : CLIENT_KNOBS->TENANT_CACHE_EVICTION_SIZE; - getValueSubmitted.init(LiteralStringRef("NativeAPI.GetValueSubmitted")); - getValueCompleted.init(LiteralStringRef("NativeAPI.GetValueCompleted")); + getValueSubmitted.init("NativeAPI.GetValueSubmitted"_sr); + getValueCompleted.init("NativeAPI.GetValueCompleted"_sr); clientDBInfoMonitor = monitorClientDBInfoChange(this, clientInfo, &proxiesChangeTrigger); tssMismatchHandler = handleTssMismatches(this); @@ -7981,193 +8455,188 @@ DatabaseContext::DatabaseContext(ReferenceINIT_MID_SHARD_BYTES); globalConfig = std::make_unique(this); - if (apiVersionAtLeast(710)) { - registerSpecialKeySpaceModule( - SpecialKeySpace::MODULE::MANAGEMENT, - SpecialKeySpace::IMPLTYPE::READWRITE, - std::make_unique(SpecialKeySpace::getManagementApiCommandRange("tenantmap"))); - } - if (apiVersionAtLeast(700)) { - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::ERRORMSG, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique( - SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::ERRORMSG).begin, - [](ReadYourWritesTransaction* ryw) -> Future> { - if (ryw->getSpecialKeySpaceErrorMsg().present()) - return Optional(ryw->getSpecialKeySpaceErrorMsg().get()); - else - return Optional(); - })); - registerSpecialKeySpaceModule( + if (apiVersion.version() >= 700) { + registerSpecialKeysImpl(SpecialKeySpace::MODULE::ERRORMSG, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique( + SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::ERRORMSG).begin, + [](ReadYourWritesTransaction* ryw) -> Future> { + if (ryw->getSpecialKeySpaceErrorMsg().present()) + return Optional(ryw->getSpecialKeySpaceErrorMsg().get()); + else + return Optional(); + }, + true)); + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - KeyRangeRef(LiteralStringRef("options/"), LiteralStringRef("options0")) + KeyRangeRef("options/"_sr, "options0"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique(SpecialKeySpace::getManagementApiCommandRange("exclude"))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique(SpecialKeySpace::getManagementApiCommandRange("failed"))); - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::MANAGEMENT, - SpecialKeySpace::IMPLTYPE::READWRITE, - std::make_unique( - SpecialKeySpace::getManagementApiCommandRange("excludedlocality"))); - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::MANAGEMENT, - SpecialKeySpace::IMPLTYPE::READWRITE, - std::make_unique( - SpecialKeySpace::getManagementApiCommandRange("failedlocality"))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl(SpecialKeySpace::MODULE::MANAGEMENT, + SpecialKeySpace::IMPLTYPE::READWRITE, + std::make_unique( + SpecialKeySpace::getManagementApiCommandRange("excludedlocality"))); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::MANAGEMENT, + SpecialKeySpace::IMPLTYPE::READWRITE, + std::make_unique( + SpecialKeySpace::getManagementApiCommandRange("failedlocality"))); + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READONLY, std::make_unique( - KeyRangeRef(LiteralStringRef("in_progress_exclusion/"), LiteralStringRef("in_progress_exclusion0")) + KeyRangeRef("in_progress_exclusion/"_sr, "in_progress_exclusion0"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::CONFIGURATION, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - KeyRangeRef(LiteralStringRef("process/class_type/"), LiteralStringRef("process/class_type0")) + KeyRangeRef("process/class_type/"_sr, "process/class_type0"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::CONFIGURATION).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::CONFIGURATION, SpecialKeySpace::IMPLTYPE::READONLY, std::make_unique( - KeyRangeRef(LiteralStringRef("process/class_source/"), LiteralStringRef("process/class_source0")) + KeyRangeRef("process/class_source/"_sr, "process/class_source0"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::CONFIGURATION).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - singleKeyRange(LiteralStringRef("db_locked")) + singleKeyRange("db_locked"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - singleKeyRange(LiteralStringRef("consistency_check_suspended")) + singleKeyRange("consistency_check_suspended"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::GLOBALCONFIG, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::GLOBALCONFIG))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::TRACING, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::TRACING))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::CONFIGURATION, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - KeyRangeRef(LiteralStringRef("coordinators/"), LiteralStringRef("coordinators0")) + KeyRangeRef("coordinators/"_sr, "coordinators0"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::CONFIGURATION).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READONLY, std::make_unique( - singleKeyRange(LiteralStringRef("auto_coordinators")) + singleKeyRange("auto_coordinators"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - singleKeyRange(LiteralStringRef("min_required_commit_version")) + singleKeyRange("min_required_commit_version"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - singleKeyRange(LiteralStringRef("version_epoch")) + singleKeyRange("version_epoch"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - KeyRangeRef(LiteralStringRef("profiling/"), LiteralStringRef("profiling0")) - .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + KeyRangeRef("profiling/"_sr, "profiling0"_sr) + .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin)), + /* deprecated */ ApiVersion::withClientProfilingDeprecated().version()); + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - KeyRangeRef(LiteralStringRef("maintenance/"), LiteralStringRef("maintenance0")) + KeyRangeRef("maintenance/"_sr, "maintenance0"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::MANAGEMENT, SpecialKeySpace::IMPLTYPE::READWRITE, std::make_unique( - KeyRangeRef(LiteralStringRef("data_distribution/"), LiteralStringRef("data_distribution0")) + KeyRangeRef("data_distribution/"_sr, "data_distribution0"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin))); - registerSpecialKeySpaceModule( + registerSpecialKeysImpl( SpecialKeySpace::MODULE::ACTORLINEAGE, SpecialKeySpace::IMPLTYPE::READONLY, std::make_unique(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::ACTORLINEAGE))); - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::ACTOR_PROFILER_CONF, - SpecialKeySpace::IMPLTYPE::READWRITE, - std::make_unique(SpecialKeySpace::getModuleRange( - SpecialKeySpace::MODULE::ACTOR_PROFILER_CONF))); - } - if (apiVersionAtLeast(630)) { - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::TRANSACTION, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique(conflictingKeysRange)); - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::TRANSACTION, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique(readConflictRangeKeysRange)); - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::TRANSACTION, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique(writeConflictRangeKeysRange)); - registerSpecialKeySpaceModule(SpecialKeySpace::MODULE::METRICS, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique(ddStatsRange)); - registerSpecialKeySpaceModule( - SpecialKeySpace::MODULE::METRICS, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique(KeyRangeRef(LiteralStringRef("\xff\xff/metrics/health/"), - LiteralStringRef("\xff\xff/metrics/health0")))); - registerSpecialKeySpaceModule( - SpecialKeySpace::MODULE::WORKERINTERFACE, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique(KeyRangeRef( - LiteralStringRef("\xff\xff/worker_interfaces/"), LiteralStringRef("\xff\xff/worker_interfaces0")))); - registerSpecialKeySpaceModule( - SpecialKeySpace::MODULE::STATUSJSON, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique(LiteralStringRef("\xff\xff/status/json"), - [](ReadYourWritesTransaction* ryw) -> Future> { - if (ryw->getDatabase().getPtr() && - ryw->getDatabase()->getConnectionRecord()) { - ++ryw->getDatabase()->transactionStatusRequests; - return getJSON(ryw->getDatabase()); - } else { - return Optional(); - } - })); - registerSpecialKeySpaceModule( - SpecialKeySpace::MODULE::CLUSTERFILEPATH, - SpecialKeySpace::IMPLTYPE::READONLY, - std::make_unique( - LiteralStringRef("\xff\xff/cluster_file_path"), - [](ReadYourWritesTransaction* ryw) -> Future> { - try { - if (ryw->getDatabase().getPtr() && ryw->getDatabase()->getConnectionRecord()) { - Optional output = - StringRef(ryw->getDatabase()->getConnectionRecord()->getLocation()); - return output; - } - } catch (Error& e) { - return e; - } - return Optional(); - })); - - registerSpecialKeySpaceModule( + registerSpecialKeysImpl(SpecialKeySpace::MODULE::ACTOR_PROFILER_CONF, + SpecialKeySpace::IMPLTYPE::READWRITE, + std::make_unique( + SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::ACTOR_PROFILER_CONF))); + } + if (apiVersion.version() >= 630) { + registerSpecialKeysImpl(SpecialKeySpace::MODULE::TRANSACTION, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique(conflictingKeysRange)); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::TRANSACTION, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique(readConflictRangeKeysRange)); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::TRANSACTION, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique(writeConflictRangeKeysRange)); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::METRICS, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique(ddStatsRange)); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::METRICS, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique( + KeyRangeRef("\xff\xff/metrics/health/"_sr, "\xff\xff/metrics/health0"_sr))); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::WORKERINTERFACE, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique( + KeyRangeRef("\xff\xff/worker_interfaces/"_sr, "\xff\xff/worker_interfaces0"_sr))); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::STATUSJSON, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique( + "\xff\xff/status/json"_sr, + [](ReadYourWritesTransaction* ryw) -> Future> { + if (ryw->getDatabase().getPtr() && ryw->getDatabase()->getConnectionRecord()) { + ++ryw->getDatabase()->transactionStatusRequests; + return getJSON(ryw->getDatabase()); + } else { + return Optional(); + } + }, + true)); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::CLUSTERFILEPATH, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique( + "\xff\xff/cluster_file_path"_sr, + [](ReadYourWritesTransaction* ryw) -> Future> { + try { + if (ryw->getDatabase().getPtr() && + ryw->getDatabase()->getConnectionRecord()) { + Optional output = + StringRef(ryw->getDatabase()->getConnectionRecord()->getLocation()); + return output; + } + } catch (Error& e) { + return e; + } + return Optional(); + }, + true)); + + registerSpecialKeysImpl( SpecialKeySpace::MODULE::CONNECTIONSTRING, SpecialKeySpace::IMPLTYPE::READONLY, std::make_unique( - LiteralStringRef("\xff\xff/connection_string"), + "\xff\xff/connection_string"_sr, [](ReadYourWritesTransaction* ryw) -> Future> { try { if (ryw->getDatabase().getPtr() && ryw->getDatabase()->getConnectionRecord()) { @@ -8179,13 +8648,38 @@ DatabaseContext::DatabaseContext(Reference(); - })); + }, + true)); + registerSpecialKeysImpl(SpecialKeySpace::MODULE::CLUSTERID, + SpecialKeySpace::IMPLTYPE::READONLY, + std::make_unique( + "\xff\xff/cluster_id"_sr, + [](ReadYourWritesTransaction* ryw) -> Future> { + try { + if (ryw->getDatabase().getPtr()) { + return map(getClusterId(ryw->getDatabase()), [](UID id) { + return Optional(StringRef(id.toString())); + }); + } + } catch (Error& e) { + return e; + } + return Optional(); + }, + true)); + + registerSpecialKeysImpl( + SpecialKeySpace::MODULE::MANAGEMENT, + SpecialKeySpace::IMPLTYPE::READWRITE, + std::make_unique(SpecialKeySpace::getManagementApiCommandRange("tenant"))); } throttleExpirer = recurring([this]() { expireThrottles(); }, CLIENT_KNOBS->TAG_THROTTLE_EXPIRATION_INTERVAL); if (BUGGIFY) { DatabaseContext::debugUseTags = true; } + + initializeSpecialCounters(); } DatabaseContext::DatabaseContext(const Error& err) @@ -8213,17 +8707,29 @@ DatabaseContext::DatabaseContext(const Error& err) transactionsCommitStarted("CommitStarted", cc), transactionsCommitCompleted("CommitCompleted", cc), transactionKeyServerLocationRequests("KeyServerLocationRequests", cc), transactionKeyServerLocationRequestsCompleted("KeyServerLocationRequestsCompleted", cc), - transactionStatusRequests("StatusRequests", cc), transactionsTooOld("TooOld", cc), + transactionBlobGranuleLocationRequests("BlobGranuleLocationRequests", cc), + transactionBlobGranuleLocationRequestsCompleted("BlobGranuleLocationRequestsCompleted", cc), + transactionStatusRequests("StatusRequests", cc), transactionTenantLookupRequests("TenantLookupRequests", cc), + transactionTenantLookupRequestsCompleted("TenantLookupRequestsCompleted", cc), transactionsTooOld("TooOld", cc), transactionsFutureVersions("FutureVersions", cc), transactionsNotCommitted("NotCommitted", cc), transactionsMaybeCommitted("MaybeCommitted", cc), transactionsResourceConstrained("ResourceConstrained", cc), transactionsProcessBehind("ProcessBehind", cc), transactionsThrottled("Throttled", cc), transactionsExpensiveClearCostEstCount("ExpensiveClearCostEstCount", cc), transactionGrvFullBatches("NumGrvFullBatches", cc), transactionGrvTimedOutBatches("NumGrvTimedOutBatches", cc), - transactionCommitVersionNotFoundForSS("CommitVersionNotFoundForSS", cc), latencies(1000), readLatencies(1000), - commitLatencies(1000), GRVLatencies(1000), mutationsPerCommit(1000), bytesPerCommit(1000), bgLatencies(1000), - bgGranulesPerRequest(1000), transactionTracingSample(false), + transactionCommitVersionNotFoundForSS("CommitVersionNotFoundForSS", cc), anyBGReads(false), + ccBG("BlobGranuleReadMetrics"), bgReadInputBytes("BGReadInputBytes", ccBG), + bgReadOutputBytes("BGReadOutputBytes", ccBG), bgReadSnapshotRows("BGReadSnapshotRows", ccBG), + bgReadRowsCleared("BGReadRowsCleared", ccBG), bgReadRowsInserted("BGReadRowsInserted", ccBG), + bgReadRowsUpdated("BGReadRowsUpdated", ccBG), bgLatencies(), bgGranulesPerRequest(), usedAnyChangeFeeds(false), + ccFeed("ChangeFeedClientMetrics"), feedStreamStarts("FeedStreamStarts", ccFeed), + feedMergeStreamStarts("FeedMergeStreamStarts", ccFeed), feedErrors("FeedErrors", ccFeed), + feedNonRetriableErrors("FeedNonRetriableErrors", ccFeed), feedPops("FeedPops", ccFeed), + feedPopsFallback("FeedPopsFallback", ccFeed), latencies(), readLatencies(), commitLatencies(), GRVLatencies(), + mutationsPerCommit(), bytesPerCommit(), sharedStatePtr(nullptr), transactionTracingSample(false), smoothMidShardSize(CLIENT_KNOBS->SHARD_STAT_SMOOTH_AMOUNT), - connectToDatabaseEventCacheHolder(format("ConnectToDatabase/%s", dbId.toString().c_str())) {} + connectToDatabaseEventCacheHolder(format("ConnectToDatabase/%s", dbId.toString().c_str())), outstandingWatches(0) { + initializeSpecialCounters(); +} // Static constructor used by server processes to create a DatabaseContext // For internal (fdbserver) use only @@ -8263,55 +8769,47 @@ DatabaseContext::~DatabaseContext() { it->second->notifyContextDestroyed(); ASSERT_ABORT(server_interf.empty()); locationCache.insert(allKeys, Reference()); + for (auto& it : notAtLatestChangeFeeds) { + it.second->context = nullptr; + } + for (auto& it : changeFeedUpdaters) { + it.second->context = nullptr; + } TraceEvent("DatabaseContextDestructed", dbId).backtrace(); } -Optional DatabaseContext::getCachedLocation(const Optional& tenantName, +Optional DatabaseContext::getCachedLocation(const TenantInfo& tenant, const KeyRef& key, Reverse isBackward) { - TenantMapEntry tenantEntry; Arena arena; KeyRef resolvedKey = key; - if (tenantName.present()) { - auto itr = tenantCache.find(tenantName.get()); - if (itr != tenantCache.end()) { - tenantEntry = itr->second; - resolvedKey = resolvedKey.withPrefix(tenantEntry.prefix, arena); - } else { - return Optional(); - } + if (tenant.hasTenant()) { + resolvedKey = resolvedKey.withPrefix(tenant.prefix.get(), arena); } auto range = isBackward ? locationCache.rangeContainingKeyBefore(resolvedKey) : locationCache.rangeContaining(resolvedKey); if (range->value()) { - return KeyRangeLocationInfo(tenantEntry, toRelativeRange(range->range(), tenantEntry.prefix), range->value()); + return KeyRangeLocationInfo(toPrefixRelativeRange(range->range(), tenant.prefix), range->value()); } return Optional(); } -bool DatabaseContext::getCachedLocations(const Optional& tenantName, +bool DatabaseContext::getCachedLocations(const TenantInfo& tenant, const KeyRangeRef& range, std::vector& result, int limit, Reverse reverse) { result.clear(); - TenantMapEntry tenantEntry; Arena arena; KeyRangeRef resolvedRange = range; - if (tenantName.present()) { - auto itr = tenantCache.find(tenantName.get()); - if (itr != tenantCache.end()) { - tenantEntry = itr->second; - resolvedRange = resolvedRange.withPrefix(tenantEntry.prefix, arena); - } else { - return false; - } + if (tenant.hasTenant()) { + resolvedRange = resolvedRange.withPrefix(tenant.prefix.get(), arena); } auto begin = locationCache.rangeContaining(resolvedRange.begin); @@ -8320,11 +8818,11 @@ bool DatabaseContext::getCachedLocations(const Optional& tenantName, loop { auto r = reverse ? end : begin; if (!r->value()) { - TEST(result.size()); // had some but not all cached locations + CODE_PROBE(result.size(), "had some but not all cached locations"); result.clear(); return false; } - result.emplace_back(tenantEntry, toRelativeRange(r->range() & resolvedRange, tenantEntry.prefix), r->value()); + result.emplace_back(toPrefixRelativeRange(r->range() & resolvedRange, tenant.prefix), r->value()); if (result.size() == limit || begin == end) { break; } @@ -8338,26 +8836,8 @@ bool DatabaseContext::getCachedLocations(const Optional& tenantName, return true; } -void DatabaseContext::cacheTenant(const TenantName& tenant, const TenantMapEntry& tenantEntry) { - if (tenantCacheSize > 0) { - // Naive cache eviction just erases the entire cache when it gets full. - // We don't expect a single client to fill the tenant cache typically, so this should work reasonably well. - if (tenantCache.size() > tenantCacheSize) { - tenantCache.clear(); - } - - tenantCache[tenant] = tenantEntry; - } -} - -Reference DatabaseContext::setCachedLocation(const Optional& tenant, - const TenantMapEntry& tenantEntry, - const KeyRangeRef& absoluteKeys, +Reference DatabaseContext::setCachedLocation(const KeyRangeRef& absoluteKeys, const std::vector& servers) { - if (tenant.present()) { - cacheTenant(tenant.get(), tenantEntry); - } - std::vector>> serverRefs; serverRefs.reserve(servers.size()); for (const auto& interf : servers) { @@ -8367,7 +8847,7 @@ Reference DatabaseContext::setCachedLocation(const Optional(serverRefs); while (locationCache.size() > locationCacheSize && attempts < maxEvictionAttempts) { - TEST(true); // NativeAPI storage server locationCache entry evicted + CODE_PROBE(true, "NativeAPI storage server locationCache entry evicted"); attempts++; auto r = locationCache.randomRange(); Key begin = r.begin(), end = r.end(); // insert invalidates r, so can't be passed a mere reference into it @@ -8377,15 +8857,11 @@ Reference DatabaseContext::setCachedLocation(const Optional& tenantPrefix, const KeyRef& key, Reverse isBackward) { Arena arena; KeyRef resolvedKey = key; - if (!tenantPrefix.empty()) { - resolvedKey = resolvedKey.withPrefix(tenantPrefix, arena); + if (tenantPrefix.present() && !tenantPrefix.get().empty()) { + resolvedKey = resolvedKey.withPrefix(tenantPrefix.get(), arena); } if (isBackward) { @@ -8395,11 +8871,11 @@ void DatabaseContext::invalidateCache(const KeyRef& tenantPrefix, const KeyRef& } } -void DatabaseContext::invalidateCache(const KeyRef& tenantPrefix, const KeyRangeRef& keys) { +void DatabaseContext::invalidateCache(const Optional& tenantPrefix, const KeyRangeRef& keys) { Arena arena; KeyRangeRef resolvedKeys = keys; - if (!tenantPrefix.empty()) { - resolvedKeys = resolvedKeys.withPrefix(tenantPrefix, arena); + if (tenantPrefix.present() && !tenantPrefix.get().empty()) { + resolvedKeys = resolvedKeys.withPrefix(tenantPrefix.get(), arena); } auto rs = locationCache.intersectingRanges(resolvedKeys); @@ -8534,39 +9010,39 @@ void DatabaseContext::setOption(FDBDatabaseOptions::Option option, Optional= maxOutstandingWatches) throw too_many_watches(); ++outstandingWatches; } -void DatabaseContext::removeWatch() { +void DatabaseContext::decreaseWatchCounter() { --outstandingWatches; ASSERT(outstandingWatches >= 0); } -Future DatabaseContext::onConnected() { +Future DatabaseContext::onConnected() const { return connected; } - #line 8553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via switchConnectionRecordImpl() - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class SwitchConnectionRecordImplActorState { - #line 8560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" SwitchConnectionRecordImplActorState(Reference const& connRecord,DatabaseContext* const& self) - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : connRecord(connRecord), - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self(self) - #line 8569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("switchConnectionRecordImpl", reinterpret_cast(this)); @@ -8579,41 +9055,39 @@ class SwitchConnectionRecordImplActorState { int a_body1(int loopDepth=0) { try { - #line 2120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 2121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Switch connection file"); + #line 2175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent("SwitchConnectionRecord") .detail("ClusterFile", connRecord->toString()) .detail("ConnectionString", connRecord->getConnectionString().toString()); - #line 2126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->commitProxies.clear(); - #line 2127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->grvProxies.clear(); - #line 2128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->minAcceptableReadVersion = std::numeric_limits::max(); - #line 2129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - self->tenantCache.clear(); - #line 2130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - self->invalidateCache(Key(), allKeys); - #line 2132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + self->invalidateCache({}, allKeys); + #line 2185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->ssVersionVectorCache.clear(); - #line 2134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto clearedClientInfo = self->clientInfo->get(); - #line 2135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" clearedClientInfo.commitProxies.clear(); - #line 2136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" clearedClientInfo.grvProxies.clear(); - #line 2137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" clearedClientInfo.id = deterministicRandom()->randomUniqueID(); - #line 2138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->clientInfo->set(clearedClientInfo); - #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->connectionRecord->set(connRecord); - #line 2141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" db = Database(Reference::addRef(self)); - #line 2142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr = Transaction(db); - #line 2143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 8616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -8641,22 +9115,22 @@ class SwitchConnectionRecordImplActorState { } int a_body1loopBody1(int loopDepth) { - #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setOption(FDBTransactionOptions::READ_LOCK_AWARE); - #line 8646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 2146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent("SwitchConnectionRecordAttemptingGRV").log(); - #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = tr.getReadVersion(); - #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 8654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8676,18 +9150,18 @@ class SwitchConnectionRecordImplActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent("SwitchConnectionRecordError").detail("Error", e.what()); - #line 2156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = tr.onError(e); - #line 2156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 8685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8700,15 +9174,15 @@ class SwitchConnectionRecordImplActorState { } int a_body1loopBody1cont2(Version const& v,int loopDepth) { - #line 2148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent("SwitchConnectionRecordGotRV") .detail("ReadVersion", v) .detail("MinAcceptableReadVersion", self->minAcceptableReadVersion); - #line 2151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(self->minAcceptableReadVersion != std::numeric_limits::max()); - #line 2152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->connectionFileChangedTrigger.trigger(); - #line 2153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SwitchConnectionRecordImplActorState(); static_cast(this)->destroy(); return 0; } - #line 8711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SwitchConnectionRecordImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8718,15 +9192,15 @@ class SwitchConnectionRecordImplActorState { } int a_body1loopBody1cont2(Version && v,int loopDepth) { - #line 2148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent("SwitchConnectionRecordGotRV") .detail("ReadVersion", v) .detail("MinAcceptableReadVersion", self->minAcceptableReadVersion); - #line 2151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(self->minAcceptableReadVersion != std::numeric_limits::max()); - #line 2152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->connectionFileChangedTrigger.trigger(); - #line 2153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SwitchConnectionRecordImplActorState(); static_cast(this)->destroy(); return 0; } - #line 8729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SwitchConnectionRecordImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8872,20 +9346,20 @@ class SwitchConnectionRecordImplActorState { fdb_probe_actor_exit("switchConnectionRecordImpl", reinterpret_cast(this), 1); } - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference connRecord; - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseContext* self; - #line 2141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database db; - #line 2142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction tr; - #line 8883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via switchConnectionRecordImpl() - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class SwitchConnectionRecordImplActor final : public Actor, public ActorCallback< SwitchConnectionRecordImplActor, 0, Version >, public ActorCallback< SwitchConnectionRecordImplActor, 1, Void >, public FastAllocated, public SwitchConnectionRecordImplActorState { - #line 8888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8895,9 +9369,9 @@ class SwitchConnectionRecordImplActor final : public Actor, public ActorCa #pragma clang diagnostic pop friend struct ActorCallback< SwitchConnectionRecordImplActor, 0, Version >; friend struct ActorCallback< SwitchConnectionRecordImplActor, 1, Void >; - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" SwitchConnectionRecordImplActor(Reference const& connRecord,DatabaseContext* const& self) - #line 8900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), SwitchConnectionRecordImplActorState(connRecord, self) { @@ -8922,14 +9396,14 @@ friend struct ActorCallback< SwitchConnectionRecordImplActor, 1, Void >; } }; } - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] static Future switchConnectionRecordImpl( Reference const& connRecord, DatabaseContext* const& self ) { - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new SwitchConnectionRecordImplActor(connRecord, self)); - #line 8929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 2160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 2213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference DatabaseContext::getConnectionRecord() { if (connectionRecord) { @@ -8951,7 +9425,7 @@ void DatabaseContext::expireThrottles() { for (auto& priorityItr : throttledTags) { for (auto tagItr = priorityItr.second.begin(); tagItr != priorityItr.second.end();) { if (tagItr->second.expired()) { - TEST(true); // Expiring client throttle + CODE_PROBE(true, "Expiring client throttle"); tagItr = priorityItr.second.erase(tagItr); } else { ++tagItr; @@ -8960,7 +9434,98 @@ void DatabaseContext::expireThrottles() { } } -extern IPAddress determinePublicIPAutomatically(ClusterConnectionString& ccs); +// Initialize tracing for FDB client +// +// connRecord is necessary for determining the local IP, which is then included in the trace +// file name, and also used to annotate all trace events. +// +// If trace_initialize_on_setup is not set, tracing is initialized when opening a database. +// In that case we can immediatelly determine the IP. Thus, we can use the IP in the +// trace file name and annotate all events with it. +// +// If trace_initialize_on_setup network option is set, tracing is at first initialized without +// connRecord and thus without the local IP. In that case we cannot use the local IP in the +// trace file names. The IP is then provided by a repeated call to initializeClientTracing +// when opening a database. All tracing events from this point are annotated with the local IP +// +// If tracing initialization is completed, further calls to initializeClientTracing are ignored +void initializeClientTracing(Reference connRecord, Optional apiVersion) { + if (!networkOptions.traceDirectory.present()) { + return; + } + + bool initialized = traceFileIsOpen(); + if (initialized && (isTraceLocalAddressSet() || !connRecord)) { + // Tracing initialization is completed + return; + } + + // Network must be created before initializing tracing + ASSERT(g_network); + + Optional localAddress; + if (connRecord) { + auto publicIP = connRecord->getConnectionString().determineLocalSourceIP(); + localAddress = NetworkAddress(publicIP, ::getpid()); + } + platform::ImageInfo imageInfo = platform::getImageInfo(); + + if (initialized) { + // Tracing already initialized, just need to update the IP address + setTraceLocalAddress(localAddress.get()); + TraceEvent("ClientStart") + .detail("SourceVersion", getSourceVersion()) + .detail("Version", FDB_VT_VERSION) + .detail("PackageName", FDB_VT_PACKAGE_NAME) + .detailf("ActualTime", "%lld", DEBUG_DETERMINISM ? 0 : time(nullptr)) + .detail("ApiVersion", apiVersion) + .detail("ClientLibrary", imageInfo.fileName) + .detailf("ImageOffset", "%p", imageInfo.offset) + .detail("Primary", networkOptions.primaryClient) + .trackLatest("ClientStart"); + } else { + // Initialize tracing + selectTraceFormatter(networkOptions.traceFormat); + selectTraceClockSource(networkOptions.traceClockSource); + addUniversalTraceField("ClientDescription", + format("%s-%s-%" PRIu64, + networkOptions.primaryClient ? "primary" : "external", + FDB_VT_VERSION, + deterministicRandom()->randomUInt64())); + + std::string identifier = networkOptions.traceFileIdentifier; + openTraceFile(localAddress, + networkOptions.traceRollSize, + networkOptions.traceMaxLogsSize, + networkOptions.traceDirectory.get(), + "trace", + networkOptions.traceLogGroup, + identifier, + networkOptions.tracePartialFileSuffix, + InitializeTraceMetrics::True); + + TraceEvent("ClientStart") + .detail("SourceVersion", getSourceVersion()) + .detail("Version", FDB_VT_VERSION) + .detail("PackageName", FDB_VT_PACKAGE_NAME) + .detailf("ActualTime", "%lld", DEBUG_DETERMINISM ? 0 : time(nullptr)) + .detail("ApiVersion", apiVersion) + .detail("ClientLibrary", imageInfo.fileName) + .detailf("ImageOffset", "%p", imageInfo.offset) + .detail("Primary", networkOptions.primaryClient) + .trackLatest("ClientStart"); + + g_network->initMetrics(); + FlowTransport::transport().initMetrics(); + } + + // Initialize system monitoring once the local IP is available + if (localAddress.present()) { + initializeSystemMonitorMachineState(SystemMonitorMachineState(IPAddress(localAddress.get().ip))); + systemMonitor(); + uncancellable(recurring(&systemMonitor, CLIENT_KNOBS->SYSTEM_MONITOR_INTERVAL, TaskPriority::FlushTrace)); + } +} // Creates a database object that represents a connection to a cluster // This constructor uses a preallocated DatabaseContext that may have been created @@ -8975,49 +9540,7 @@ Database Database::createDatabase(Reference connRecord ASSERT(TraceEvent::isNetworkThread()); - platform::ImageInfo imageInfo = platform::getImageInfo(); - - if (connRecord) { - if (networkOptions.traceDirectory.present() && !traceFileIsOpen()) { - g_network->initMetrics(); - FlowTransport::transport().initMetrics(); - initTraceEventMetrics(); - - auto publicIP = determinePublicIPAutomatically(connRecord->getConnectionString()); - selectTraceFormatter(networkOptions.traceFormat); - selectTraceClockSource(networkOptions.traceClockSource); - addUniversalTraceField("ClientDescription", - format("%s-%s-%" PRIu64, - networkOptions.primaryClient ? "primary" : "external", - FDB_VT_VERSION, - getTraceThreadId())); - - openTraceFile(NetworkAddress(publicIP, ::getpid()), - networkOptions.traceRollSize, - networkOptions.traceMaxLogsSize, - networkOptions.traceDirectory.get(), - "trace", - networkOptions.traceLogGroup, - networkOptions.traceFileIdentifier, - networkOptions.tracePartialFileSuffix); - - TraceEvent("ClientStart") - .detail("SourceVersion", getSourceVersion()) - .detail("Version", FDB_VT_VERSION) - .detail("PackageName", FDB_VT_PACKAGE_NAME) - .detailf("ActualTime", "%lld", DEBUG_DETERMINISM ? 0 : time(nullptr)) - .detail("ApiVersion", apiVersion) - .detail("ClientLibrary", imageInfo.fileName) - .detailf("ImageOffset", "%p", imageInfo.offset) - .detail("Primary", networkOptions.primaryClient) - .trackLatest("ClientStart"); - - initializeSystemMonitorMachineState(SystemMonitorMachineState(IPAddress(publicIP))); - - systemMonitor(); - uncancellable(recurring(&systemMonitor, CLIENT_KNOBS->SYSTEM_MONITOR_INTERVAL, TaskPriority::FlushTrace)); - } - } + initializeClientTracing(connRecord, apiVersion); g_network->initTLS(); @@ -9069,7 +9592,7 @@ Database Database::createDatabase(Reference connRecord .detail("Version", FDB_VT_VERSION) .detail("ClusterFile", connRecord ? connRecord->toString() : "None") .detail("ConnectionString", connRecord ? connRecord->getConnectionString().toString() : "None") - .detail("ClientLibrary", imageInfo.fileName) + .detail("ClientLibrary", platform::getImageInfo().fileName) .detail("Primary", networkOptions.primaryClient) .detail("Internal", internal) .trackLatest(database->connectToDatabaseEventCacheHolder.trackingKey); @@ -9081,28 +9604,15 @@ Database Database::createDatabase(std::string connFileName, int apiVersion, IsInternal internal, LocalityData const& clientLocality) { - Reference rccr = Reference( - new ClusterConnectionFile(ClusterConnectionFile::lookupClusterFileName(connFileName).first)); + Reference rccr = ClusterConnectionFile::openOrDefault(connFileName); return Database::createDatabase(rccr, apiVersion, internal, clientLocality); } -Reference DatabaseContext::getWatchMetadata(int64_t tenantId, KeyRef key) const { - const auto it = watchMap.find(std::make_pair(tenantId, key)); - if (it == watchMap.end()) - return Reference(); - return it->second; -} - -void DatabaseContext::setWatchMetadata(Reference metadata) { - watchMap[std::make_pair(metadata->parameters->tenant.tenantId, metadata->parameters->key)] = metadata; -} - -void DatabaseContext::deleteWatchMetadata(int64_t tenantId, KeyRef key) { - watchMap.erase(std::make_pair(tenantId, key)); -} - -void DatabaseContext::clearWatchMetadata() { - watchMap.clear(); +Database Database::createSimulatedExtraDatabase(std::string connectionString, Optional defaultTenant) { + auto extraFile = makeReference(ClusterConnectionString(connectionString)); + Database db = Database::createDatabase(extraFile, ApiVersion::LATEST_VERSION); + db->defaultTenant = defaultTenant; + return db; } const UniqueOrderedOptionList& Database::getTransactionDefaults() const { @@ -9166,6 +9676,9 @@ void setNetworkOption(FDBNetworkOptions::Option option, Optional valu validateOptionValuePresent(value); networkOptions.tracePartialFileSuffix = value.get().toString(); break; + case FDBNetworkOptions::TRACE_INITIALIZE_ON_SETUP: + networkOptions.traceInitializeOnSetup = true; + break; case FDBNetworkOptions::KNOB: { validateOptionValuePresent(value); @@ -9259,7 +9772,7 @@ void setNetworkOption(FDBNetworkOptions::Option option, Optional valu ASSERT(value.present()); Standalone> supportedVersions; - std::vector supportedVersionsStrings = value.get().splitAny(LiteralStringRef(";")); + std::vector supportedVersionsStrings = value.get().splitAny(";"_sr); for (StringRef versionString : supportedVersionsStrings) { #ifdef ADDRESS_SANITIZER __lsan_disable(); @@ -9306,21 +9819,21 @@ void setNetworkOption(FDBNetworkOptions::Option option, Optional valu } // update the network busyness on a 1s cadence - #line 9309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via monitorNetworkBusyness() - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class MonitorNetworkBusynessActorState { - #line 9316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" MonitorNetworkBusynessActorState() - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : prevTime(now()) - #line 9323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("monitorNetworkBusyness", reinterpret_cast(this)); @@ -9333,9 +9846,9 @@ class MonitorNetworkBusynessActorState { int a_body1(int loopDepth=0) { try { - #line 2538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 9338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -9363,102 +9876,102 @@ class MonitorNetworkBusynessActorState { } int a_body1loopBody1(int loopDepth) { - #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = delay(CLIENT_KNOBS->NETWORK_BUSYNESS_MONITOR_INTERVAL, TaskPriority::FlushTrace); - #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 9370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 2540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double elapsed = now() - prevTime; - #line 2541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" prevTime = now(); - #line 2542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" struct NetworkMetrics::PriorityStats& tracker = g_network->networkInfo.metrics.starvationTrackerNetworkBusyness; - #line 2544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (tracker.active) - #line 9390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 2545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tracker.duration += now() - tracker.windowedTimer; - #line 2546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tracker.maxDuration = std::max(tracker.maxDuration, now() - tracker.timer); - #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tracker.windowedTimer = now(); - #line 9398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 2550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double busyFraction = std::min(elapsed, tracker.duration) / elapsed; - #line 2558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double burstiness = 0; - #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (CLIENT_KNOBS->BUSYNESS_SPIKE_START_THRESHOLD >= 0 && CLIENT_KNOBS->BUSYNESS_SPIKE_SATURATED_THRESHOLD >= CLIENT_KNOBS->BUSYNESS_SPIKE_START_THRESHOLD) - #line 9406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 2561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" burstiness = std::min(1.0, std::max(0.0, tracker.maxDuration - CLIENT_KNOBS->BUSYNESS_SPIKE_START_THRESHOLD) / std::max(1e-6, CLIENT_KNOBS->BUSYNESS_SPIKE_SATURATED_THRESHOLD - CLIENT_KNOBS->BUSYNESS_SPIKE_START_THRESHOLD)); - #line 9410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 2568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_network->networkInfo.metrics.networkBusyness = std::max(busyFraction, burstiness); - #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tracker.duration = 0; - #line 2571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tracker.maxDuration = 0; - #line 9418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 2540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double elapsed = now() - prevTime; - #line 2541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" prevTime = now(); - #line 2542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" struct NetworkMetrics::PriorityStats& tracker = g_network->networkInfo.metrics.starvationTrackerNetworkBusyness; - #line 2544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (tracker.active) - #line 9433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 2545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tracker.duration += now() - tracker.windowedTimer; - #line 2546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tracker.maxDuration = std::max(tracker.maxDuration, now() - tracker.timer); - #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tracker.windowedTimer = now(); - #line 9441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 2550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double busyFraction = std::min(elapsed, tracker.duration) / elapsed; - #line 2558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double burstiness = 0; - #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (CLIENT_KNOBS->BUSYNESS_SPIKE_START_THRESHOLD >= 0 && CLIENT_KNOBS->BUSYNESS_SPIKE_SATURATED_THRESHOLD >= CLIENT_KNOBS->BUSYNESS_SPIKE_START_THRESHOLD) - #line 9449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 2561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" burstiness = std::min(1.0, std::max(0.0, tracker.maxDuration - CLIENT_KNOBS->BUSYNESS_SPIKE_START_THRESHOLD) / std::max(1e-6, CLIENT_KNOBS->BUSYNESS_SPIKE_SATURATED_THRESHOLD - CLIENT_KNOBS->BUSYNESS_SPIKE_START_THRESHOLD)); - #line 9453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 2568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_network->networkInfo.metrics.networkBusyness = std::max(busyFraction, burstiness); - #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tracker.duration = 0; - #line 2571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tracker.maxDuration = 0; - #line 9461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -9526,14 +10039,14 @@ class MonitorNetworkBusynessActorState { fdb_probe_actor_exit("monitorNetworkBusyness", reinterpret_cast(this), 0); } - #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double prevTime; - #line 9531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via monitorNetworkBusyness() - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class MonitorNetworkBusynessActor final : public Actor, public ActorCallback< MonitorNetworkBusynessActor, 0, Void >, public FastAllocated, public MonitorNetworkBusynessActorState { - #line 9536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9542,9 +10055,9 @@ class MonitorNetworkBusynessActor final : public Actor, public ActorCallba void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< MonitorNetworkBusynessActor, 0, Void >; - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" MonitorNetworkBusynessActor() - #line 9547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), MonitorNetworkBusynessActorState() { @@ -9568,14 +10081,14 @@ friend struct ActorCallback< MonitorNetworkBusynessActor, 0, Void >; } }; } - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future monitorNetworkBusyness( ) { - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new MonitorNetworkBusynessActor()); - #line 9575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 2574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 2666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" static void setupGlobalKnobs() { IKnobCollection::setGlobalKnobCollection(IKnobCollection::Type::CLIENT, Randomize::False, IsSimulated::False); @@ -9598,6 +10111,10 @@ void setupNetwork(uint64_t transportId, UseMetrics useMetrics) { FlowTransport::createInstance(true, transportId, WLTOKEN_RESERVED_COUNT); Net2FileSystem::newFileSystem(); + if (networkOptions.traceInitializeOnSetup) { + ::initializeClientTracing({}, {}); + } + uncancellable(monitorNetworkBusyness()); } @@ -9624,9 +10141,13 @@ void stopNetwork() { if (!g_network) throw network_not_setup(); - TraceEvent("ClientStopNetwork"); + TraceEvent("ClientStopNetwork").log(); + + if (networkOptions.traceDirectory.present() && networkOptions.runLoopProfilingEnabled) { + stopRunLoopProfiler(); + } + g_network->stop(); - closeTraceFile(); } void DatabaseContext::updateProxies() { @@ -9672,29 +10193,29 @@ bool DatabaseContext::isCurrentGrvProxy(UID proxyId) const { if (proxy.id() == proxyId) return true; } - TEST(true); // stale GRV proxy detected + CODE_PROBE(true, "stale GRV proxy detected", probe::decoration::rare); return false; } // Actor which will wait until the MultiInterface returned by the DatabaseContext cx is not // nullptr - #line 9681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getCommitProxiesFuture() - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetCommitProxiesFutureActorState { - #line 9688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetCommitProxiesFutureActorState(DatabaseContext* const& cx,UseProvisionalProxies const& useProvisionalProxies) - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" useProvisionalProxies(useProvisionalProxies) - #line 9697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getCommitProxiesFuture", reinterpret_cast(this)); @@ -9707,9 +10228,9 @@ class GetCommitProxiesFutureActorState { int a_body1(int loopDepth=0) { try { - #line 2678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 9712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -9737,30 +10258,30 @@ class GetCommitProxiesFutureActorState { } int a_body1loopBody1(int loopDepth) { - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference commitProxies = cx->getCommitProxies(useProvisionalProxies); - #line 2680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (commitProxies) - #line 9744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(commitProxies); this->~GetCommitProxiesFutureActorState(); static_cast(this)->destroy(); return 0; } - #line 9748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(commitProxies); this->~GetCommitProxiesFutureActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = cx->onProxiesChanged(); - #line 2682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 9758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9840,16 +10361,16 @@ class GetCommitProxiesFutureActorState { fdb_probe_actor_exit("getCommitProxiesFuture", reinterpret_cast(this), 0); } - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseContext* cx; - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UseProvisionalProxies useProvisionalProxies; - #line 9847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getCommitProxiesFuture() - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetCommitProxiesFutureActor final : public Actor>, public ActorCallback< GetCommitProxiesFutureActor, 0, Void >, public FastAllocated, public GetCommitProxiesFutureActorState { - #line 9852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9858,9 +10379,9 @@ class GetCommitProxiesFutureActor final : public Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetCommitProxiesFutureActor, 0, Void >; - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetCommitProxiesFutureActor(DatabaseContext* const& cx,UseProvisionalProxies const& useProvisionalProxies) - #line 9863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor>(), GetCommitProxiesFutureActorState(cx, useProvisionalProxies) { @@ -9884,14 +10405,14 @@ friend struct ActorCallback< GetCommitProxiesFutureActor, 0, Void >; } }; } - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future> getCommitProxiesFuture( DatabaseContext* const& cx, UseProvisionalProxies const& useProvisionalProxies ) { - #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future>(new GetCommitProxiesFutureActor(cx, useProvisionalProxies)); - #line 9891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 2685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 2785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" // Returns a future which will not be set until the CommitProxyInfo of this DatabaseContext is not nullptr Future> DatabaseContext::getCommitProxiesFuture( @@ -9944,26 +10465,26 @@ void GetRangeLimits::decrement(MappedKeyValueRef const& data) { } // True if either the row or byte limit has been reached -bool GetRangeLimits::isReached() { +bool GetRangeLimits::isReached() const { return rows == 0 || (bytes == 0 && minRows == 0); } // True if data would cause the row or byte limit to be reached -bool GetRangeLimits::reachedBy(VectorRef const& data) { +bool GetRangeLimits::reachedBy(VectorRef const& data) const { return (rows != GetRangeLimits::ROW_LIMIT_UNLIMITED && data.size() >= rows) || (bytes != GetRangeLimits::BYTE_LIMIT_UNLIMITED && (int)data.expectedSize() + (8 - (int)sizeof(KeyValueRef)) * data.size() >= bytes && data.size() >= minRows); } -bool GetRangeLimits::hasByteLimit() { +bool GetRangeLimits::hasByteLimit() const { return bytes != GetRangeLimits::BYTE_LIMIT_UNLIMITED; } -bool GetRangeLimits::hasRowLimit() { +bool GetRangeLimits::hasRowLimit() const { return rows != GetRangeLimits::ROW_LIMIT_UNLIMITED; } -bool GetRangeLimits::hasSatisfiedMinRows() { +bool GetRangeLimits::hasSatisfiedMinRows() const { return hasByteLimit() && minRows == 0; } @@ -9990,39 +10511,65 @@ AddressExclusion AddressExclusion::parse(StringRef const& key) { } } +Tenant::Tenant(Database cx, TenantName name) : idFuture(cx->lookupTenant(name)), name(name) {} +Tenant::Tenant(int64_t id) : idFuture(id) {} +Tenant::Tenant(Future id, Optional name) : idFuture(id), name(name) {} + +int64_t Tenant::id() const { + ASSERT(idFuture.isReady()); + return idFuture.get(); +} + +Future Tenant::getIdFuture() const { + return idFuture; +} + +KeyRef Tenant::prefix() const { + ASSERT(idFuture.isReady()); + if (bigEndianId == -1) { + bigEndianId = bigEndian64(idFuture.get()); + } + return StringRef(reinterpret_cast(&bigEndianId), TenantAPI::PREFIX_SIZE); +} + +std::string Tenant::description() const { + StringRef nameStr = name.castTo().orDefault(""_sr); + if (idFuture.canGet()) { + return format("%.*s (%lld)", nameStr.size(), nameStr.begin(), idFuture.get()); + } else { + return format("%.*s", nameStr.size(), nameStr.begin()); + } +} + Future> getValue(Reference const& trState, Key const& key, - Future const& version, UseTenant const& useTenant = UseTenant::True, TransactionRecordLogInfo const& recordLogInfo = TransactionRecordLogInfo::True); Future getRange(Reference const& trState, - Future const& fVersion, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Reverse const& reverse, UseTenant const& useTenant); - #line 10007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via fetchServerInterface() - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class FetchServerInterfaceActorState { - #line 10014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - FetchServerInterfaceActorState(Reference const& trState,Future const& ver,UID const& id) - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + FetchServerInterfaceActorState(Reference const& trState,UID const& id) + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ver(ver), - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" id(id) - #line 10025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("fetchServerInterface", reinterpret_cast(this)); @@ -10035,16 +10582,16 @@ class FetchServerInterfaceActorState { int a_body1(int loopDepth=0) { try { - #line 2800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_0 = getValue(trState, serverListKeyFor(id), ver, UseTenant::False, TransactionRecordLogInfo::False); - #line 2800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_0 = getValue(trState, serverListKeyFor(id), UseTenant::False, TransactionRecordLogInfo::False); + #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 10047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -10065,21 +10612,21 @@ class FetchServerInterfaceActorState { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 2803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!val.present()) - #line 10070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 2805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~FetchServerInterfaceActorState(); static_cast(this)->destroy(); return 0; } - #line 10074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~FetchServerInterfaceActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(decodeServerListValue(val.get())); this->~FetchServerInterfaceActorState(); static_cast(this)->destroy(); return 0; } - #line 10082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(decodeServerListValue(val.get())); this->~FetchServerInterfaceActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10089,21 +10636,21 @@ class FetchServerInterfaceActorState { } int a_body1cont1(Optional && val,int loopDepth) { - #line 2803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!val.present()) - #line 10094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 2805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~FetchServerInterfaceActorState(); static_cast(this)->destroy(); return 0; } - #line 10098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~FetchServerInterfaceActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(decodeServerListValue(val.get())); this->~FetchServerInterfaceActorState(); static_cast(this)->destroy(); return 0; } - #line 10106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(decodeServerListValue(val.get())); this->~FetchServerInterfaceActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10174,18 +10721,16 @@ class FetchServerInterfaceActorState { fdb_probe_actor_exit("fetchServerInterface", reinterpret_cast(this), 0); } - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future ver; - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UID id; - #line 10183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via fetchServerInterface() - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class FetchServerInterfaceActor final : public Actor>, public ActorCallback< FetchServerInterfaceActor, 0, Optional >, public FastAllocated, public FetchServerInterfaceActorState { - #line 10188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -10194,11 +10739,11 @@ class FetchServerInterfaceActor final : public Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< FetchServerInterfaceActor, 0, Optional >; - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - FetchServerInterfaceActor(Reference const& trState,Future const& ver,UID const& id) - #line 10199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + FetchServerInterfaceActor(Reference const& trState,UID const& id) + #line 10744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor>(), - FetchServerInterfaceActorState(trState, ver, id) + FetchServerInterfaceActorState(trState, id) { fdb_probe_actor_enter("fetchServerInterface", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -10220,36 +10765,34 @@ friend struct ActorCallback< FetchServerInterfaceActor, 0, Optional >; } }; } - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future> fetchServerInterface( Reference const& trState, Future const& ver, UID const& id ) { - #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future>(new FetchServerInterfaceActor(trState, ver, id)); - #line 10227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future> fetchServerInterface( Reference const& trState, UID const& id ) { + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>(new FetchServerInterfaceActor(trState, id)); + #line 10772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 2810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 2936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 10232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via transactionalGetServerInterfaces() - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class TransactionalGetServerInterfacesActorState { - #line 10239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TransactionalGetServerInterfacesActorState(Reference const& trState,Future const& ver,std::vector const& ids) - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TransactionalGetServerInterfacesActorState(Reference const& trState,std::vector const& ids) + #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ver(ver), - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ids(ids), - #line 2813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" serverListEntries() - #line 10252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("transactionalGetServerInterfaces", reinterpret_cast(this)); @@ -10262,24 +10805,24 @@ class TransactionalGetServerInterfacesActorState { int a_body1(int loopDepth=0) { try { - #line 2814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" serverListEntries.reserve(ids.size()); - #line 2815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int s = 0;s < ids.size();s++) { - #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - serverListEntries.push_back(fetchServerInterface(trState, ver, ids[s])); - #line 10271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + serverListEntries.push_back(fetchServerInterface(trState, ids[s])); + #line 10814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 2819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture>> __when_expr_0 = getAll(serverListEntries); - #line 2819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); - #line 10282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -10300,29 +10843,29 @@ class TransactionalGetServerInterfacesActorState { } int a_body1cont1(std::vector> const& serverListValues,int loopDepth) { - #line 2820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector serverInterfaces; - #line 2821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int s = 0;s < serverListValues.size();s++) { - #line 2822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!serverListValues[s].present()) - #line 10309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(Optional>()); this->~TransactionalGetServerInterfacesActorState(); static_cast(this)->destroy(); return 0; } - #line 10313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional> >::value()) Optional>(Optional>()); this->~TransactionalGetServerInterfacesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" serverInterfaces.push_back(serverListValues[s].get()); - #line 10321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(serverInterfaces); this->~TransactionalGetServerInterfacesActorState(); static_cast(this)->destroy(); return 0; } - #line 10325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional> >::value()) Optional>(serverInterfaces); this->~TransactionalGetServerInterfacesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10332,29 +10875,29 @@ class TransactionalGetServerInterfacesActorState { } int a_body1cont1(std::vector> && serverListValues,int loopDepth) { - #line 2820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector serverInterfaces; - #line 2821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int s = 0;s < serverListValues.size();s++) { - #line 2822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!serverListValues[s].present()) - #line 10341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(Optional>()); this->~TransactionalGetServerInterfacesActorState(); static_cast(this)->destroy(); return 0; } - #line 10345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional> >::value()) Optional>(Optional>()); this->~TransactionalGetServerInterfacesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" serverInterfaces.push_back(serverListValues[s].get()); - #line 10353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(serverInterfaces); this->~TransactionalGetServerInterfacesActorState(); static_cast(this)->destroy(); return 0; } - #line 10357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional> >::value()) Optional>(serverInterfaces); this->~TransactionalGetServerInterfacesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10425,20 +10968,18 @@ class TransactionalGetServerInterfacesActorState { fdb_probe_actor_exit("transactionalGetServerInterfaces", reinterpret_cast(this), 0); } - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future ver; - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector ids; - #line 2813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector>> serverListEntries; - #line 10436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via transactionalGetServerInterfaces() - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class TransactionalGetServerInterfacesActor final : public Actor>>, public ActorCallback< TransactionalGetServerInterfacesActor, 0, std::vector> >, public FastAllocated, public TransactionalGetServerInterfacesActorState { - #line 10441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -10447,11 +10988,11 @@ class TransactionalGetServerInterfacesActor final : public Actor>>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< TransactionalGetServerInterfacesActor, 0, std::vector> >; - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TransactionalGetServerInterfacesActor(Reference const& trState,Future const& ver,std::vector const& ids) - #line 10452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TransactionalGetServerInterfacesActor(Reference const& trState,std::vector const& ids) + #line 10993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor>>(), - TransactionalGetServerInterfacesActorState(trState, ver, ids) + TransactionalGetServerInterfacesActorState(trState, ids) { fdb_probe_actor_enter("transactionalGetServerInterfaces", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -10473,14 +11014,14 @@ friend struct ActorCallback< TransactionalGetServerInterfacesActor, 0, std::vect } }; } - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future>> transactionalGetServerInterfaces( Reference const& trState, Future const& ver, std::vector const& ids ) { - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future>>(new TransactionalGetServerInterfacesActor(trState, ver, ids)); - #line 10480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future>> transactionalGetServerInterfaces( Reference const& trState, std::vector const& ids ) { + #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new TransactionalGetServerInterfacesActor(trState, ids)); + #line 11021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 2830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 2957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" void updateTssMappings(Database cx, const GetKeyServerLocationsReply& reply) { // Since a ss -> tss mapping is included in resultsTssMapping iff that SS is in results and has a tss pair, @@ -10513,37 +11054,37 @@ void updateTagMappings(Database cx, const GetKeyServerLocationsReply& reply) { // If isBackward == true, returns the shard containing the key before 'key' (an infinitely long, inexpressible key). // Otherwise returns the shard containing key - #line 10516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getKeyLocation_internal() - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetKeyLocation_internalActorState { - #line 10523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetKeyLocation_internalActorState(Database const& cx,Optional const& tenant,Key const& key,SpanID const& spanID,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies,Reverse const& isBackward,Version const& version) - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetKeyLocation_internalActorState(Database const& cx,TenantInfo const& tenant,Key const& key,SpanContext const& spanContext,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies,Reverse const& isBackward,Version const& version) + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tenant(tenant), - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" key(key), - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - spanID(spanID), - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + spanContext(spanContext), + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" debugID(debugID), - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" useProvisionalProxies(useProvisionalProxies), - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" isBackward(isBackward), - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" version(version), - #line 2871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:getKeyLocation"_loc, spanID) - #line 10546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:getKeyLocation"_loc, spanContext) + #line 11087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getKeyLocation_internal", reinterpret_cast(this)); @@ -10556,31 +11097,31 @@ class GetKeyLocation_internalActorState { int a_body1(int loopDepth=0) { try { - #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (isBackward) - #line 10561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 2873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(key != allKeys.begin && key <= allKeys.end); - #line 10565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 2875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(key < allKeys.end); - #line 10571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 2878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (debugID.present()) - #line 10575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 2879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent("TransactionDebug", debugID.get().first(), "NativeAPI.getKeyLocation.Before"); - #line 10579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 10583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -10609,16 +11150,16 @@ class GetKeyLocation_internalActorState { int a_body1loopBody1(int loopDepth) { try { - #line 2883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = cx->getBackoff(); - #line 2883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 10616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -10638,30 +11179,20 @@ class GetKeyLocation_internalActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_proxy_memory_limit_exceeded) - #line 10643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_commit_proxy_memory_limit_exceeded) + #line 11184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevWarnAlways, "CommitProxyOverloadedForKeyLocation").suppressFor(5); - #line 2921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->updateBackoff(e); - #line 10649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return a_body1loopHead1(loopDepth); // continue } - #line 2924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_tenant_not_found) - #line 10654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(tenant.present()); - #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCachedTenant(tenant.get()); - #line 10660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 2929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 10664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); @@ -10673,48 +11204,48 @@ class GetKeyLocation_internalActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 2884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++cx->transactionKeyServerLocationRequests; - #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = cx->onProxiesChanged(); - #line 2885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 10682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = basicLoadBalance(cx->getCommitProxies(useProvisionalProxies), &CommitProxyInterface::getKeyServersLocations, GetKeyServerLocationsRequest(span.context, tenant.castTo(), key, Optional(), 100, isBackward, version, key.arena()), TaskPriority::DefaultPromiseEndpoint); - #line 10686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = basicLoadBalance( cx->getCommitProxies(useProvisionalProxies), &CommitProxyInterface::getKeyServersLocations, GetKeyServerLocationsRequest( span.context, tenant, key, Optional(), 100, isBackward, version, key.arena()), TaskPriority::DefaultPromiseEndpoint); + #line 11217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 2884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++cx->transactionKeyServerLocationRequests; - #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = cx->onProxiesChanged(); - #line 2885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 10706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = basicLoadBalance(cx->getCommitProxies(useProvisionalProxies), &CommitProxyInterface::getKeyServersLocations, GetKeyServerLocationsRequest(span.context, tenant.castTo(), key, Optional(), 100, isBackward, version, key.arena()), TaskPriority::DefaultPromiseEndpoint); - #line 10710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = basicLoadBalance( cx->getCommitProxies(useProvisionalProxies), &CommitProxyInterface::getKeyServersLocations, GetKeyServerLocationsRequest( span.context, tenant, key, Optional(), 100, isBackward, version, key.arena()), TaskPriority::DefaultPromiseEndpoint); + #line 11241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -10802,30 +11333,30 @@ class GetKeyLocation_internalActorState { } int a_body1loopBody1cont2when2(GetKeyServerLocationsReply const& rep,int loopDepth) { - #line 2899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++cx->transactionKeyServerLocationRequestsCompleted; - #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (debugID.present()) - #line 10809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent( "TransactionDebug", debugID.get().first(), "NativeAPI.getKeyLocation.After"); - #line 10813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(rep.results.size() == 1); - #line 2905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - auto locationInfo = cx->setCachedLocation(tenant, rep.tenantEntry, rep.results[0].first, rep.results[0].second); - #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto locationInfo = cx->setCachedLocation(rep.results[0].first, rep.results[0].second); + #line 3027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" updateTssMappings(cx, rep); - #line 2908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" updateTagMappings(cx, rep); - #line 2910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->updateBackoff(success()); - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(KeyRangeLocationInfo( rep.tenantEntry, KeyRange(toRelativeRange(rep.results[0].first, rep.tenantEntry.prefix), rep.arena), locationInfo)); this->~GetKeyLocation_internalActorState(); static_cast(this)->destroy(); return 0; } - #line 10827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< KeyRangeLocationInfo >::value()) KeyRangeLocationInfo(KeyRangeLocationInfo( rep.tenantEntry, KeyRange(toRelativeRange(rep.results[0].first, rep.tenantEntry.prefix), rep.arena), locationInfo)); + #line 3031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(KeyRangeLocationInfo( KeyRange(toPrefixRelativeRange(rep.results[0].first, tenant.prefix), rep.arena), locationInfo)); this->~GetKeyLocation_internalActorState(); static_cast(this)->destroy(); return 0; } + #line 11358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< KeyRangeLocationInfo >::value()) KeyRangeLocationInfo(KeyRangeLocationInfo( KeyRange(toPrefixRelativeRange(rep.results[0].first, tenant.prefix), rep.arena), locationInfo)); this->~GetKeyLocation_internalActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -10834,30 +11365,30 @@ class GetKeyLocation_internalActorState { } int a_body1loopBody1cont2when2(GetKeyServerLocationsReply && rep,int loopDepth) { - #line 2899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++cx->transactionKeyServerLocationRequestsCompleted; - #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (debugID.present()) - #line 10841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent( "TransactionDebug", debugID.get().first(), "NativeAPI.getKeyLocation.After"); - #line 10845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(rep.results.size() == 1); - #line 2905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - auto locationInfo = cx->setCachedLocation(tenant, rep.tenantEntry, rep.results[0].first, rep.results[0].second); - #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto locationInfo = cx->setCachedLocation(rep.results[0].first, rep.results[0].second); + #line 3027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" updateTssMappings(cx, rep); - #line 2908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" updateTagMappings(cx, rep); - #line 2910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->updateBackoff(success()); - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(KeyRangeLocationInfo( rep.tenantEntry, KeyRange(toRelativeRange(rep.results[0].first, rep.tenantEntry.prefix), rep.arena), locationInfo)); this->~GetKeyLocation_internalActorState(); static_cast(this)->destroy(); return 0; } - #line 10859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< KeyRangeLocationInfo >::value()) KeyRangeLocationInfo(KeyRangeLocationInfo( rep.tenantEntry, KeyRange(toRelativeRange(rep.results[0].first, rep.tenantEntry.prefix), rep.arena), locationInfo)); + #line 3031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(KeyRangeLocationInfo( KeyRange(toPrefixRelativeRange(rep.results[0].first, tenant.prefix), rep.arena), locationInfo)); this->~GetKeyLocation_internalActorState(); static_cast(this)->destroy(); return 0; } + #line 11390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< KeyRangeLocationInfo >::value()) KeyRangeLocationInfo(KeyRangeLocationInfo( KeyRange(toPrefixRelativeRange(rep.results[0].first, tenant.prefix), rep.arena), locationInfo)); this->~GetKeyLocation_internalActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -10974,30 +11505,30 @@ class GetKeyLocation_internalActorState { return loopDepth; } - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Optional tenant; - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TenantInfo tenant; + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key key; - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SpanID spanID; - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SpanContext spanContext; + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional debugID; - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UseProvisionalProxies useProvisionalProxies; - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reverse isBackward; - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Version version; - #line 2871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 10995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getKeyLocation_internal() - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetKeyLocation_internalActor final : public Actor, public ActorCallback< GetKeyLocation_internalActor, 0, Void >, public ActorCallback< GetKeyLocation_internalActor, 1, Void >, public ActorCallback< GetKeyLocation_internalActor, 2, GetKeyServerLocationsReply >, public FastAllocated, public GetKeyLocation_internalActorState { - #line 11000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -11008,11 +11539,11 @@ class GetKeyLocation_internalActor final : public Actor, p friend struct ActorCallback< GetKeyLocation_internalActor, 0, Void >; friend struct ActorCallback< GetKeyLocation_internalActor, 1, Void >; friend struct ActorCallback< GetKeyLocation_internalActor, 2, GetKeyServerLocationsReply >; - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetKeyLocation_internalActor(Database const& cx,Optional const& tenant,Key const& key,SpanID const& spanID,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies,Reverse const& isBackward,Version const& version) - #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetKeyLocation_internalActor(Database const& cx,TenantInfo const& tenant,Key const& key,SpanContext const& spanContext,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies,Reverse const& isBackward,Version const& version) + #line 11544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - GetKeyLocation_internalActorState(cx, tenant, key, spanID, debugID, useProvisionalProxies, isBackward, version) + GetKeyLocation_internalActorState(cx, tenant, key, spanContext, debugID, useProvisionalProxies, isBackward, version) { fdb_probe_actor_enter("getKeyLocation_internal", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -11035,14 +11566,14 @@ friend struct ActorCallback< GetKeyLocation_internalActor, 2, GetKeyServerLocati } }; } - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future getKeyLocation_internal( Database const& cx, Optional const& tenant, Key const& key, SpanID const& spanID, Optional const& debugID, UseProvisionalProxies const& useProvisionalProxies, Reverse const& isBackward, Version const& version ) { - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new GetKeyLocation_internalActor(cx, tenant, key, spanID, debugID, useProvisionalProxies, isBackward, version)); - #line 11042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getKeyLocation_internal( Database const& cx, TenantInfo const& tenant, Key const& key, SpanContext const& spanContext, Optional const& debugID, UseProvisionalProxies const& useProvisionalProxies, Reverse const& isBackward, Version const& version ) { + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetKeyLocation_internalActor(cx, tenant, key, spanContext, debugID, useProvisionalProxies, isBackward, version)); + #line 11573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 2933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" // Checks if `endpoint` is failed on a healthy server or not. Returns true if we need to refresh the location cache for // the endpoint. @@ -11075,10 +11606,10 @@ bool checkOnlyEndpointFailed(const Database& cx, const Endpoint& endpoint) { template Future getKeyLocation(Database const& cx, - Optional const& tenant, + TenantInfo const& tenant, Key const& key, F StorageServerInterface::*member, - SpanID spanID, + SpanContext spanContext, Optional debugID, UseProvisionalProxies useProvisionalProxies, Reverse isBackward, @@ -11086,7 +11617,8 @@ Future getKeyLocation(Database const& cx, // we first check whether this range is cached Optional locationInfo = cx->getCachedLocation(tenant, key, isBackward); if (!locationInfo.present()) { - return getKeyLocation_internal(cx, tenant, key, spanID, debugID, useProvisionalProxies, isBackward, version); + return getKeyLocation_internal( + cx, tenant, key, spanContext, debugID, useProvisionalProxies, isBackward, version); } bool onlyEndpointFailedAndNeedRefresh = false; @@ -11097,10 +11629,11 @@ Future getKeyLocation(Database const& cx, } if (onlyEndpointFailedAndNeedRefresh) { - cx->invalidateCache(locationInfo.get().tenantEntry.prefix, key); + cx->invalidateCache(tenant.prefix, key); // Refresh the cache with a new getKeyLocations made to proxies. - return getKeyLocation_internal(cx, tenant, key, spanID, debugID, useProvisionalProxies, isBackward, version); + return getKeyLocation_internal( + cx, tenant, key, spanContext, debugID, useProvisionalProxies, isBackward, version); } return locationInfo.get(); @@ -11111,26 +11644,18 @@ Future getKeyLocation(Reference trState, Key const& key, F StorageServerInterface::*member, Reverse isBackward, - UseTenant useTenant, - Version version) { - auto f = getKeyLocation(trState->cx, - useTenant ? trState->tenant() : Optional(), - key, - member, - trState->spanID, - trState->debugID, - trState->useProvisionalProxies, - isBackward, - version); - - if (trState->tenant().present() && useTenant) { - return map(f, [trState](const KeyRangeLocationInfo& locationInfo) { - trState->tenantId = locationInfo.tenantEntry.id; - return locationInfo; - }); - } else { - return f; - } + UseTenant useTenant) { + return getKeyLocation(trState->cx, + useTenant ? trState->getTenantInfo() : TenantInfo(), + key, + member, + trState->spanContext, + trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(), + trState->useProvisionalProxies, + isBackward, + trState->readVersionFuture.isValid() && trState->readVersionFuture.isReady() + ? trState->readVersion() + : latestVersion); } void DatabaseContext::updateBackoff(const Error& err) { @@ -11142,7 +11667,7 @@ void DatabaseContext::updateBackoff(const Error& err) { } break; - case error_code_proxy_memory_limit_exceeded: + case error_code_commit_proxy_memory_limit_exceeded: ++transactionsResourceConstrained; if (backoffDelay == 0.0) { backoffDelay = CLIENT_KNOBS->DEFAULT_BACKOFF; @@ -11157,39 +11682,39 @@ void DatabaseContext::updateBackoff(const Error& err) { } } - #line 11160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getKeyRangeLocations_internal() - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetKeyRangeLocations_internalActorState { - #line 11167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetKeyRangeLocations_internalActorState(Database const& cx,Optional const& tenant,KeyRange const& keys,int const& limit,Reverse const& reverse,SpanID const& spanID,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies,Version const& version) - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetKeyRangeLocations_internalActorState(Database const& cx,TenantInfo const& tenant,KeyRange const& keys,int const& limit,Reverse const& reverse,SpanContext const& spanContext,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies,Version const& version) + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tenant(tenant), - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys(keys), - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" limit(limit), - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" reverse(reverse), - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - spanID(spanID), - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + spanContext(spanContext), + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" debugID(debugID), - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" useProvisionalProxies(useProvisionalProxies), - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" version(version), - #line 3057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:getKeyRangeLocations"_loc, spanID) - #line 11192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:getKeyRangeLocations"_loc, spanContext) + #line 11717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getKeyRangeLocations_internal", reinterpret_cast(this)); @@ -11202,17 +11727,17 @@ class GetKeyRangeLocations_internalActorState { int a_body1(int loopDepth=0) { try { - #line 3058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (debugID.present()) - #line 11207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent("TransactionDebug", debugID.get().first(), "NativeAPI.getKeyLocations.Before"); - #line 11211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 11215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -11241,16 +11766,16 @@ class GetKeyRangeLocations_internalActorState { int a_body1loopBody1(int loopDepth) { try { - #line 3063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = cx->getBackoff(); - #line 3063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11270,30 +11795,20 @@ class GetKeyRangeLocations_internalActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 3106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_proxy_memory_limit_exceeded) - #line 11275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_commit_proxy_memory_limit_exceeded) + #line 11800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevWarnAlways, "CommitProxyOverloadedForRangeLocation").suppressFor(5); - #line 3109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->updateBackoff(e); - #line 11281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return a_body1loopHead1(loopDepth); // continue } - #line 3112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_tenant_not_found) - #line 11286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(tenant.present()); - #line 3114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCachedTenant(tenant.get()); - #line 11292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 11296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); @@ -11305,48 +11820,48 @@ class GetKeyRangeLocations_internalActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++cx->transactionKeyServerLocationRequests; - #line 3066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = cx->onProxiesChanged(); - #line 3065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - #line 3067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = basicLoadBalance(cx->getCommitProxies(useProvisionalProxies), &CommitProxyInterface::getKeyServersLocations, GetKeyServerLocationsRequest(span.context, tenant.castTo(), keys.begin, keys.end, limit, reverse, version, keys.arena()), TaskPriority::DefaultPromiseEndpoint); - #line 11318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = basicLoadBalance( cx->getCommitProxies(useProvisionalProxies), &CommitProxyInterface::getKeyServersLocations, GetKeyServerLocationsRequest( span.context, tenant, keys.begin, keys.end, limit, reverse, version, keys.arena()), TaskPriority::DefaultPromiseEndpoint); + #line 11833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++cx->transactionKeyServerLocationRequests; - #line 3066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = cx->onProxiesChanged(); - #line 3065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - #line 3067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = basicLoadBalance(cx->getCommitProxies(useProvisionalProxies), &CommitProxyInterface::getKeyServersLocations, GetKeyServerLocationsRequest(span.context, tenant.castTo(), keys.begin, keys.end, limit, reverse, version, keys.arena()), TaskPriority::DefaultPromiseEndpoint); - #line 11342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = basicLoadBalance( cx->getCommitProxies(useProvisionalProxies), &CommitProxyInterface::getKeyServersLocations, GetKeyServerLocationsRequest( span.context, tenant, keys.begin, keys.end, limit, reverse, version, keys.arena()), TaskPriority::DefaultPromiseEndpoint); + #line 11857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -11434,54 +11949,54 @@ class GetKeyRangeLocations_internalActorState { } int a_body1loopBody1cont2when2(GetKeyServerLocationsReply const& _rep,int loopDepth) { - #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++cx->transactionKeyServerLocationRequestsCompleted; - #line 3080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rep = _rep; - #line 3081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (debugID.present()) - #line 11443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent( "TransactionDebug", debugID.get().first(), "NativeAPI.getKeyLocations.After"); - #line 11447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(rep.results.size()); - #line 3086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results = std::vector(); - #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" shard = 0; - #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 11457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont2when2loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1cont2when2(GetKeyServerLocationsReply && _rep,int loopDepth) { - #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++cx->transactionKeyServerLocationRequestsCompleted; - #line 3080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rep = _rep; - #line 3081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (debugID.present()) - #line 11470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent( "TransactionDebug", debugID.get().first(), "NativeAPI.getKeyLocations.After"); - #line 11474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(rep.results.size()); - #line 3086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results = std::vector(); - #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" shard = 0; - #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 11484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont2when2loopHead1(loopDepth); return loopDepth; @@ -11540,15 +12055,15 @@ class GetKeyRangeLocations_internalActorState { } int a_body1loopBody1cont2when2cont1(int loopDepth) { - #line 3098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" updateTssMappings(cx, rep); - #line 3099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" updateTagMappings(cx, rep); - #line 3101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->updateBackoff(success()); - #line 3102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~GetKeyRangeLocations_internalActorState(); static_cast(this)->destroy(); return 0; } - #line 11551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 12066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::move(results)); // state_var_RVO this->~GetKeyRangeLocations_internalActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11565,24 +12080,24 @@ class GetKeyRangeLocations_internalActorState { } int a_body1loopBody1cont2when2loopBody1(int loopDepth) { - #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!(shard < rep.results.size())) - #line 11570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 12085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { return a_body1loopBody1cont2when2break1(loopDepth==0?0:loopDepth-1); // break } - #line 3091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.emplace_back( rep.tenantEntry, (toRelativeRange(rep.results[shard].first, rep.tenantEntry.prefix) & keys), cx->setCachedLocation( tenant, rep.tenantEntry, rep.results[shard].first, rep.results[shard].second)); - #line 3096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.emplace_back( (toPrefixRelativeRange(rep.results[shard].first, tenant.prefix) & keys), cx->setCachedLocation(rep.results[shard].first, rep.results[shard].second)); + #line 3196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = yield(); - #line 3096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 11580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 12095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2when2loopBody1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 3096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 12100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -11602,18 +12117,18 @@ class GetKeyRangeLocations_internalActorState { } int a_body1loopBody1cont2when2loopBody1cont1(Void const& _,int loopDepth) { - #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" shard++; - #line 11607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 12122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1cont2when2loopHead1(0); return loopDepth; } int a_body1loopBody1cont2when2loopBody1cont1(Void && _,int loopDepth) { - #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" shard++; - #line 11616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 12131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1cont2when2loopHead1(0); return loopDepth; @@ -11739,38 +12254,38 @@ class GetKeyRangeLocations_internalActorState { return loopDepth; } - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Optional tenant; - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TenantInfo tenant; + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange keys; - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int limit; - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reverse reverse; - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SpanID spanID; - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SpanContext spanContext; + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional debugID; - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UseProvisionalProxies useProvisionalProxies; - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Version version; - #line 3057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 3080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetKeyServerLocationsReply rep; - #line 3086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector results; - #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int shard; - #line 11768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 12283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getKeyRangeLocations_internal() - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetKeyRangeLocations_internalActor final : public Actor>, public ActorCallback< GetKeyRangeLocations_internalActor, 0, Void >, public ActorCallback< GetKeyRangeLocations_internalActor, 1, Void >, public ActorCallback< GetKeyRangeLocations_internalActor, 2, GetKeyServerLocationsReply >, public ActorCallback< GetKeyRangeLocations_internalActor, 3, Void >, public FastAllocated, public GetKeyRangeLocations_internalActorState { - #line 11773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 12288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -11782,11 +12297,11 @@ friend struct ActorCallback< GetKeyRangeLocations_internalActor, 0, Void >; friend struct ActorCallback< GetKeyRangeLocations_internalActor, 1, Void >; friend struct ActorCallback< GetKeyRangeLocations_internalActor, 2, GetKeyServerLocationsReply >; friend struct ActorCallback< GetKeyRangeLocations_internalActor, 3, Void >; - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetKeyRangeLocations_internalActor(Database const& cx,Optional const& tenant,KeyRange const& keys,int const& limit,Reverse const& reverse,SpanID const& spanID,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies,Version const& version) - #line 11787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetKeyRangeLocations_internalActor(Database const& cx,TenantInfo const& tenant,KeyRange const& keys,int const& limit,Reverse const& reverse,SpanContext const& spanContext,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies,Version const& version) + #line 12302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor>(), - GetKeyRangeLocations_internalActorState(cx, tenant, keys, limit, reverse, spanID, debugID, useProvisionalProxies, version) + GetKeyRangeLocations_internalActorState(cx, tenant, keys, limit, reverse, spanContext, debugID, useProvisionalProxies, version) { fdb_probe_actor_enter("getKeyRangeLocations_internal", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -11810,14 +12325,14 @@ friend struct ActorCallback< GetKeyRangeLocations_internalActor, 3, Void >; } }; } - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future> getKeyRangeLocations_internal( Database const& cx, Optional const& tenant, KeyRange const& keys, int const& limit, Reverse const& reverse, SpanID const& spanID, Optional const& debugID, UseProvisionalProxies const& useProvisionalProxies, Version const& version ) { - #line 3047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future>(new GetKeyRangeLocations_internalActor(cx, tenant, keys, limit, reverse, spanID, debugID, useProvisionalProxies, version)); - #line 11817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future> getKeyRangeLocations_internal( Database const& cx, TenantInfo const& tenant, KeyRange const& keys, int const& limit, Reverse const& reverse, SpanContext const& spanContext, Optional const& debugID, UseProvisionalProxies const& useProvisionalProxies, Version const& version ) { + #line 3155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>(new GetKeyRangeLocations_internalActor(cx, tenant, keys, limit, reverse, spanContext, debugID, useProvisionalProxies, version)); + #line 12332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 3121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 3217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" // Get the SS locations for each shard in the 'keys' key-range; // Returned vector size is the number of shards in the input keys key-range. @@ -11827,12 +12342,12 @@ friend struct ActorCallback< GetKeyRangeLocations_internalActor, 3, Void >; // [([a, b1), locationInfo), ([b1, c), locationInfo), ([c, d1), locationInfo)]. template Future> getKeyRangeLocations(Database const& cx, - Optional tenant, + TenantInfo const& tenant, KeyRange const& keys, int limit, Reverse reverse, F StorageServerInterface::*member, - SpanID const& spanID, + SpanContext const& spanContext, Optional const& debugID, UseProvisionalProxies useProvisionalProxies, Version version) { @@ -11842,7 +12357,7 @@ Future> getKeyRangeLocations(Database const& c std::vector locations; if (!cx->getCachedLocations(tenant, keys, locations, limit, reverse)) { return getKeyRangeLocations_internal( - cx, tenant, keys, limit, reverse, spanID, debugID, useProvisionalProxies, version); + cx, tenant, keys, limit, reverse, spanContext, debugID, useProvisionalProxies, version); } bool foundFailed = false; @@ -11855,7 +12370,7 @@ Future> getKeyRangeLocations(Database const& c } if (onlyEndpointFailedAndNeedRefresh) { - cx->invalidateCache(locationInfo.tenantEntry.prefix, locationInfo.range.begin); + cx->invalidateCache(tenant.prefix, locationInfo.range.begin); foundFailed = true; } } @@ -11863,7 +12378,7 @@ Future> getKeyRangeLocations(Database const& c if (foundFailed) { // Refresh the cache with a new getKeyRangeLocations made to proxies. return getKeyRangeLocations_internal( - cx, tenant, keys, limit, reverse, spanID, debugID, useProvisionalProxies, version); + cx, tenant, keys, limit, reverse, spanContext, debugID, useProvisionalProxies, version); } return locations; @@ -11875,53 +12390,611 @@ Future> getKeyRangeLocations(Referencecx, - useTenant ? trState->tenant() : Optional(), - keys, - limit, - reverse, - member, - trState->spanID, - trState->debugID, - trState->useProvisionalProxies, - version); - - if (trState->tenant().present() && useTenant) { - return map(f, [trState](const std::vector& locationInfo) { - ASSERT(!locationInfo.empty()); - trState->tenantId = locationInfo[0].tenantEntry.id; - return locationInfo; - }); - } else { - return f; + UseTenant useTenant) { + return getKeyRangeLocations(trState->cx, + useTenant ? trState->getTenantInfo(AllowInvalidTenantID::True) : TenantInfo(), + keys, + limit, + reverse, + member, + trState->spanContext, + trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(), + trState->useProvisionalProxies, + trState->readVersionFuture.isValid() && trState->readVersionFuture.isReady() + ? trState->readVersion() + : latestVersion); +} + + #line 12408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via getBlobGranuleLocations_internal() + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetBlobGranuleLocations_internalActorState { + #line 12415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetBlobGranuleLocations_internalActorState(Database const& cx,TenantInfo const& tenant,KeyRange const& keys,int const& limit,Reverse const& reverse,JustGranules const& justGranules,SpanContext const& spanContext,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies,Version const& version,bool* const& more) + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenant(tenant), + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keys(keys), + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + limit(limit), + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + reverse(reverse), + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + justGranules(justGranules), + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + spanContext(spanContext), + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + debugID(debugID), + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + useProvisionalProxies(useProvisionalProxies), + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version), + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + more(more), + #line 3301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:getBlobGranuleLocations"_loc, spanContext) + #line 12444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("getBlobGranuleLocations_internal", reinterpret_cast(this)); + + } + ~GetBlobGranuleLocations_internalActorState() + { + fdb_probe_actor_destroy("getBlobGranuleLocations_internal", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 3302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (debugID.present()) + #line 12459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent("TransactionDebug", debugID.get().first(), "NativeAPI.getBlobGranuleLocations.Before"); + #line 12463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 3305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 12467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetBlobGranuleLocations_internalActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 3306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++cx->transactionBlobGranuleLocationRequests; + #line 3308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = cx->onProxiesChanged(); + #line 3307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 12501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + #line 3309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = basicLoadBalance(cx->getCommitProxies(useProvisionalProxies), &CommitProxyInterface::getBlobGranuleLocations, GetBlobGranuleLocationsRequest(span.context, tenant, keys.begin, keys.end, limit, reverse, justGranules, version, keys.arena()), TaskPriority::DefaultPromiseEndpoint); + #line 12505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 3308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 12512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2(GetBlobGranuleLocationsReply const& _rep,int loopDepth) + { + #line 3322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++cx->transactionBlobGranuleLocationRequestsCompleted; + #line 3323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rep = _rep; + #line 3324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (debugID.present()) + #line 12543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent( "TransactionDebug", debugID.get().first(), "NativeAPI.getBlobGranuleLocations.After"); + #line 12547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(justGranules || rep.results.size()); + #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!rep.more || !rep.results.empty()); + #line 3330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + *more = rep.more; + #line 3332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results = std::vector>(); + #line 3333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + granule = 0; + #line 3334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& bwInterf : rep.bwInterfs ) { + #line 3335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->blobWorker_interf.insert({ bwInterf.id(), bwInterf }); + #line 12563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 3337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 12567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1when2loopHead1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2(GetBlobGranuleLocationsReply && _rep,int loopDepth) + { + #line 3322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++cx->transactionBlobGranuleLocationRequestsCompleted; + #line 3323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rep = _rep; + #line 3324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (debugID.present()) + #line 12580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent( "TransactionDebug", debugID.get().first(), "NativeAPI.getBlobGranuleLocations.After"); + #line 12584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(justGranules || rep.results.size()); + #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!rep.more || !rep.results.empty()); + #line 3330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + *more = rep.more; + #line 3332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results = std::vector>(); + #line 3333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + granule = 0; + #line 3334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& bwInterf : rep.bwInterfs ) { + #line 3335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->blobWorker_interf.insert({ bwInterf.id(), bwInterf }); + #line 12600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 3337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 12604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1when2loopHead1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetBlobGranuleLocations_internalActor, 0, Void >::remove(); + static_cast(this)->ActorCallback< GetBlobGranuleLocations_internalActor, 1, GetBlobGranuleLocationsReply >::remove(); + + } + void a_callback_fire(ActorCallback< GetBlobGranuleLocations_internalActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getBlobGranuleLocations_internal", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlobGranuleLocations_internal", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetBlobGranuleLocations_internalActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getBlobGranuleLocations_internal", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlobGranuleLocations_internal", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetBlobGranuleLocations_internalActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getBlobGranuleLocations_internal", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlobGranuleLocations_internal", reinterpret_cast(this), 0); + + } + int a_body1loopBody1when2cont1(int loopDepth) + { + #line 3347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetBlobGranuleLocations_internalActorState(); static_cast(this)->destroy(); return 0; } + #line 12665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(std::move(results)); // state_var_RVO + this->~GetBlobGranuleLocations_internalActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1when2loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1when2loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2loopBody1(int loopDepth) + { + #line 3337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!(granule < rep.results.size())) + #line 12684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1loopBody1when2break1(loopDepth==0?0:loopDepth-1); // break + } + #line 3339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range(toPrefixRelativeRange(rep.results[granule].first, tenant.prefix)); + #line 3340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!justGranules) + #line 12692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range = range & keys; + #line 12696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 3343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.emplace_back(range, rep.results[granule].second); + #line 3344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = yield(); + #line 3344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); + #line 12704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1when2loopBody1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 3344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 12709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when2break1(int loopDepth) + { + try { + return a_body1loopBody1when2cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1when2loopBody1cont1(Void const& _,int loopDepth) + { + #line 3337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + granule++; + #line 12731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1loopBody1when2loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when2loopBody1cont1(Void && _,int loopDepth) + { + #line 3337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + granule++; + #line 12740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1loopBody1when2loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when2loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1when2loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1when2loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetBlobGranuleLocations_internalActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetBlobGranuleLocations_internalActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("getBlobGranuleLocations_internal", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1loopBody1when2loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlobGranuleLocations_internal", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< GetBlobGranuleLocations_internalActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("getBlobGranuleLocations_internal", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1loopBody1when2loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlobGranuleLocations_internal", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< GetBlobGranuleLocations_internalActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("getBlobGranuleLocations_internal", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlobGranuleLocations_internal", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< GetBlobGranuleLocations_internalActor, 1, GetBlobGranuleLocationsReply >*,GetBlobGranuleLocationsReply const& value) + { + fdb_probe_actor_enter("getBlobGranuleLocations_internal", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1loopBody1when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlobGranuleLocations_internal", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetBlobGranuleLocations_internalActor, 1, GetBlobGranuleLocationsReply >*,GetBlobGranuleLocationsReply && value) + { + fdb_probe_actor_enter("getBlobGranuleLocations_internal", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1loopBody1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlobGranuleLocations_internal", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetBlobGranuleLocations_internalActor, 1, GetBlobGranuleLocationsReply >*,Error err) + { + fdb_probe_actor_enter("getBlobGranuleLocations_internal", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlobGranuleLocations_internal", reinterpret_cast(this), 1); + + } + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database cx; + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TenantInfo tenant; + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange keys; + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int limit; + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reverse reverse; + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + JustGranules justGranules; + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SpanContext spanContext; + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional debugID; + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + UseProvisionalProxies useProvisionalProxies; + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool* more; + #line 3301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Span span; + #line 3323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetBlobGranuleLocationsReply rep; + #line 3332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> results; + #line 3333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int granule; + #line 12883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via getBlobGranuleLocations_internal() + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetBlobGranuleLocations_internalActor final : public Actor>>, public ActorCallback< GetBlobGranuleLocations_internalActor, 0, Void >, public ActorCallback< GetBlobGranuleLocations_internalActor, 1, GetBlobGranuleLocationsReply >, public ActorCallback< GetBlobGranuleLocations_internalActor, 2, Void >, public FastAllocated, public GetBlobGranuleLocations_internalActorState { + #line 12888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetBlobGranuleLocations_internalActor, 0, Void >; +friend struct ActorCallback< GetBlobGranuleLocations_internalActor, 1, GetBlobGranuleLocationsReply >; +friend struct ActorCallback< GetBlobGranuleLocations_internalActor, 2, Void >; + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetBlobGranuleLocations_internalActor(Database const& cx,TenantInfo const& tenant,KeyRange const& keys,int const& limit,Reverse const& reverse,JustGranules const& justGranules,SpanContext const& spanContext,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies,Version const& version,bool* const& more) + #line 12901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>>(), + GetBlobGranuleLocations_internalActorState(cx, tenant, keys, limit, reverse, justGranules, spanContext, debugID, useProvisionalProxies, version, more) + { + fdb_probe_actor_enter("getBlobGranuleLocations_internal", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getBlobGranuleLocations_internal"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getBlobGranuleLocations_internal", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetBlobGranuleLocations_internalActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetBlobGranuleLocations_internalActor, 2, Void >*)0, actor_cancelled()); break; + } + } +}; +} + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future>> getBlobGranuleLocations_internal( Database const& cx, TenantInfo const& tenant, KeyRange const& keys, int const& limit, Reverse const& reverse, JustGranules const& justGranules, SpanContext const& spanContext, Optional const& debugID, UseProvisionalProxies const& useProvisionalProxies, Version const& version, bool* const& more ) { + #line 3289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new GetBlobGranuleLocations_internalActor(cx, tenant, keys, limit, reverse, justGranules, spanContext, debugID, useProvisionalProxies, version, more)); + #line 12930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 3352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +// Get the Blob Worker locations for each granule in the 'keys' key-range, similar to getKeyRangeLocations +Future>> getBlobGranuleLocations(Database const& cx, + TenantInfo const& tenant, + KeyRange const& keys, + int limit, + Reverse reverse, + JustGranules justGranules, + SpanContext const& spanContext, + Optional const& debugID, + UseProvisionalProxies useProvisionalProxies, + Version version, + bool* more) { + + ASSERT(!keys.empty()); + + // FIXME: wrap this with location caching for blob workers like getKeyRangeLocations has + return getBlobGranuleLocations_internal( + cx, tenant, keys, limit, reverse, justGranules, spanContext, debugID, useProvisionalProxies, version, more); +} + +Future>> getBlobGranuleLocations(Reference trState, + KeyRange const& keys, + int limit, + Reverse reverse, + UseTenant useTenant, + JustGranules justGranules, + bool* more) { + return getBlobGranuleLocations( + trState->cx, + useTenant ? trState->getTenantInfo(AllowInvalidTenantID::True) : TenantInfo(), + keys, + limit, + reverse, + justGranules, + trState->spanContext, + trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(), + trState->useProvisionalProxies, + trState->readVersionFuture.isValid() && trState->readVersionFuture.isReady() ? trState->readVersion() + : latestVersion, + more); } - #line 11902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 12977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via warmRange_impl() - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class WarmRange_implActorState { - #line 11909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 12984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WarmRange_implActorState(Reference const& trState,KeyRange const& keys,Future const& fVersion) - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WarmRange_implActorState(Reference const& trState,KeyRange const& keys) + #line 3395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys(keys), - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fVersion(fVersion), - #line 3203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" totalRanges(0), - #line 3204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" totalRequests(0) - #line 11924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 12997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("warmRange_impl", reinterpret_cast(this)); @@ -11934,16 +13007,16 @@ class WarmRange_implActorState { int a_body1(int loopDepth=0) { try { - #line 3206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = fVersion; - #line 3206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = trState->startTransaction(); + #line 3399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 13019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11962,38 +13035,43 @@ class WarmRange_implActorState { return loopDepth; } - int a_body1cont1(int loopDepth) + int a_body1cont1(Void const& _,int loopDepth) { - #line 3208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 11969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } - int a_body1when1(Version const& __version,int loopDepth) + int a_body1cont1(Void && _,int loopDepth) { - #line 3206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version = __version; - #line 11978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); + #line 3401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 13051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } - int a_body1when1(Version && __version,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - version = std::move(__version); - loopDepth = a_body1cont1(loopDepth); + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WarmRange_implActor, 0, Version >::remove(); + static_cast(this)->ActorCallback< WarmRange_implActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< WarmRange_implActor, 0, Version >*,Version const& value) + void a_callback_fire(ActorCallback< WarmRange_implActor, 0, Void >*,Void const& value) { fdb_probe_actor_enter("warmRange_impl", reinterpret_cast(this), 0); a_exitChoose1(); @@ -12008,7 +13086,7 @@ class WarmRange_implActorState { fdb_probe_actor_exit("warmRange_impl", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< WarmRange_implActor, 0, Version >*,Version && value) + void a_callback_fire(ActorCallback< WarmRange_implActor, 0, Void >*,Void && value) { fdb_probe_actor_enter("warmRange_impl", reinterpret_cast(this), 0); a_exitChoose1(); @@ -12023,7 +13101,7 @@ class WarmRange_implActorState { fdb_probe_actor_exit("warmRange_impl", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< WarmRange_implActor, 0, Version >*,Error err) + void a_callback_error(ActorCallback< WarmRange_implActor, 0, Void >*,Error err) { fdb_probe_actor_enter("warmRange_impl", reinterpret_cast(this), 0); a_exitChoose1(); @@ -12040,9 +13118,9 @@ class WarmRange_implActorState { } int a_body1cont2(int loopDepth) { - #line 3243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WarmRange_implActorState(); static_cast(this)->destroy(); return 0; } - #line 12045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WarmRange_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -12059,16 +13137,16 @@ class WarmRange_implActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 3209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_1 = getKeyRangeLocations_internal(trState->cx, trState->tenant(), keys, CLIENT_KNOBS->WARM_RANGE_SHARD_LIMIT, Reverse::False, trState->spanID, trState->debugID, trState->useProvisionalProxies, version); - #line 3209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_1 = getKeyRangeLocations_internal( trState->cx, trState->getTenantInfo(), keys, CLIENT_KNOBS->WARM_RANGE_SHARD_LIMIT, Reverse::False, trState->spanContext, trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(), trState->useProvisionalProxies, trState->readVersion()); + #line 3402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 12066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 12071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -12088,27 +13166,27 @@ class WarmRange_implActorState { } int a_body1cont1loopBody1cont1(std::vector const& locations,int loopDepth) { - #line 3219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" totalRanges += CLIENT_KNOBS->WARM_RANGE_SHARD_LIMIT; - #line 3220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" totalRequests++; - #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (locations.size() == 0 || totalRanges >= trState->cx->locationCacheSize || locations[locations.size() - 1].range.end >= keys.end) - #line 12097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 3225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys = KeyRangeRef(locations[locations.size() - 1].range.end, keys.end); - #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (totalRequests % 20 == 0) - #line 12105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr = Transaction(trState->cx, trState->tenant()); - #line 3230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 12111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont1loopHead1(loopDepth); } else @@ -12120,27 +13198,27 @@ class WarmRange_implActorState { } int a_body1cont1loopBody1cont1(std::vector && locations,int loopDepth) { - #line 3219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" totalRanges += CLIENT_KNOBS->WARM_RANGE_SHARD_LIMIT; - #line 3220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" totalRequests++; - #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (locations.size() == 0 || totalRanges >= trState->cx->locationCacheSize || locations[locations.size() - 1].range.end >= keys.end) - #line 12129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 3225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys = KeyRangeRef(locations[locations.size() - 1].range.end, keys.end); - #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (totalRequests % 20 == 0) - #line 12137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr = Transaction(trState->cx, trState->tenant()); - #line 3230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 12143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont1loopHead1(loopDepth); } else @@ -12235,20 +13313,20 @@ class WarmRange_implActorState { int a_body1cont1loopBody1cont1loopBody1(int loopDepth) { try { - #line 3232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 3233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setOption(FDBTransactionOptions::CAUSAL_READ_RISKY); - #line 3234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = success(tr.getReadVersion()); - #line 3234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 12246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont1loopBody1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 3234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -12281,16 +13359,16 @@ class WarmRange_implActorState { int a_body1cont1loopBody1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = tr.onError(e); - #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 12288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 2)); else return a_body1cont1loopBody1cont1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -12451,26 +13529,22 @@ class WarmRange_implActorState { fdb_probe_actor_exit("warmRange_impl", reinterpret_cast(this), 3); } - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange keys; - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future fVersion; - #line 3203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int totalRanges; - #line 3204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int totalRequests; - #line 3206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction tr; - #line 12468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via warmRange_impl() - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class WarmRange_implActor final : public Actor, public ActorCallback< WarmRange_implActor, 0, Version >, public ActorCallback< WarmRange_implActor, 1, std::vector >, public ActorCallback< WarmRange_implActor, 2, Void >, public ActorCallback< WarmRange_implActor, 3, Void >, public FastAllocated, public WarmRange_implActorState { - #line 12473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class WarmRange_implActor final : public Actor, public ActorCallback< WarmRange_implActor, 0, Void >, public ActorCallback< WarmRange_implActor, 1, std::vector >, public ActorCallback< WarmRange_implActor, 2, Void >, public ActorCallback< WarmRange_implActor, 3, Void >, public FastAllocated, public WarmRange_implActorState { + #line 13547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -12478,15 +13552,15 @@ class WarmRange_implActor final : public Actor, public ActorCallback< Warm #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< WarmRange_implActor, 0, Version >; +friend struct ActorCallback< WarmRange_implActor, 0, Void >; friend struct ActorCallback< WarmRange_implActor, 1, std::vector >; friend struct ActorCallback< WarmRange_implActor, 2, Void >; friend struct ActorCallback< WarmRange_implActor, 3, Void >; - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WarmRange_implActor(Reference const& trState,KeyRange const& keys,Future const& fVersion) - #line 12487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WarmRange_implActor(Reference const& trState,KeyRange const& keys) + #line 13561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - WarmRange_implActorState(trState, keys, fVersion) + WarmRange_implActorState(trState, keys) { fdb_probe_actor_enter("warmRange_impl", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -12502,7 +13576,7 @@ friend struct ActorCallback< WarmRange_implActor, 3, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< WarmRange_implActor, 0, Version >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< WarmRange_implActor, 0, Void >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< WarmRange_implActor, 1, std::vector >*)0, actor_cancelled()); break; case 3: this->a_callback_error((ActorCallback< WarmRange_implActor, 2, Void >*)0, actor_cancelled()); break; case 4: this->a_callback_error((ActorCallback< WarmRange_implActor, 3, Void >*)0, actor_cancelled()); break; @@ -12511,144 +13585,63 @@ friend struct ActorCallback< WarmRange_implActor, 3, Void >; } }; } - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future warmRange_impl( Reference const& trState, KeyRange const& keys, Future const& fVersion ) { - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new WarmRange_implActor(trState, keys, fVersion)); - #line 12518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future warmRange_impl( Reference const& trState, KeyRange const& keys ) { + #line 3395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new WarmRange_implActor(trState, keys)); + #line 13592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 3245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 3438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -SpanID generateSpanID(bool transactionTracingSample, SpanID parentContext = SpanID()) { - uint64_t txnId = deterministicRandom()->randomUInt64(); +SpanContext generateSpanID(bool transactionTracingSample, SpanContext parentContext = SpanContext()) { if (parentContext.isValid()) { - if (parentContext.first() > 0) { - txnId = parentContext.first(); - } - uint64_t tokenId = parentContext.second() > 0 ? deterministicRandom()->randomUInt64() : 0; - return SpanID(txnId, tokenId); - } else if (transactionTracingSample) { - uint64_t tokenId = deterministicRandom()->random01() <= FLOW_KNOBS->TRACING_SAMPLE_RATE - ? deterministicRandom()->randomUInt64() - : 0; - return SpanID(txnId, tokenId); - } else { - return SpanID(txnId, 0); - } -} - -TransactionState::TransactionState(Database cx, - Optional tenant, - TaskPriority taskID, - SpanID spanID, - Reference trLogInfo) - : cx(cx), trLogInfo(trLogInfo), options(cx), taskID(taskID), spanID(spanID), readVersionObtainedFromGrvProxy(true), - tenant_(tenant), tenantSet(tenant.present()) {} - -Reference TransactionState::cloneAndReset(Reference newTrLogInfo, - bool generateNewSpan) const { - - SpanID newSpanID = generateNewSpan ? generateSpanID(cx->transactionTracingSample) : spanID; - Reference newState = - makeReference(cx, tenant_, cx->taskID, newSpanID, newTrLogInfo); - - if (!cx->apiVersionAtLeast(16)) { - newState->options = options; - } - - newState->numErrors = numErrors; - newState->startTime = startTime; - newState->committedVersion = committedVersion; - newState->conflictingKeys = conflictingKeys; - newState->tenantSet = tenantSet; - - return newState; -} - -TenantInfo TransactionState::getTenantInfo() { - Optional const& t = tenant(); - - if (options.rawAccess) { - return TenantInfo(); - } else if (!cx->internal && cx->clientInfo->get().tenantMode == TenantMode::REQUIRED && !t.present()) { - throw tenant_name_required(); - } else if (!t.present()) { - return TenantInfo(); - } else if (cx->clientInfo->get().tenantMode == TenantMode::DISABLED && t.present()) { - throw tenants_disabled(); + return SpanContext(parentContext.traceID, deterministicRandom()->randomUInt64(), parentContext.m_Flags); } - - ASSERT(tenantId != TenantInfo::INVALID_TENANT); - return TenantInfo(t.get(), tenantId); -} - -Optional const& TransactionState::tenant() { - if (tenantSet) { - return tenant_; - } else { - if (!tenant_.present() && !options.rawAccess) { - tenant_ = cx->defaultTenant; - } - tenantSet = true; - return tenant_; + if (transactionTracingSample) { + return SpanContext(deterministicRandom()->randomUniqueID(), + deterministicRandom()->randomUInt64(), + deterministicRandom()->random01() <= FLOW_KNOBS->TRACING_SAMPLE_RATE + ? TraceFlags::sampled + : TraceFlags::unsampled); } + return SpanContext( + deterministicRandom()->randomUniqueID(), deterministicRandom()->randomUInt64(), TraceFlags::unsampled); } -bool TransactionState::hasTenant() const { - return tenantSet && tenant_.present(); -} - -Future Transaction::warmRange(KeyRange keys) { - return warmRange_impl(trState, keys, getReadVersion()); -} - - #line 12606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 13612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via getValue() - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetValueActorState { - #line 12613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via lookupTenantImpl() + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class LookupTenantImplActorState { + #line 13619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetValueActorState(Reference const& trState,Key const& key,Future const& version,UseTenant const& useTenant,TransactionRecordLogInfo const& recordLogInfo) - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : trState(trState), - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - key(key), - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version(version), - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - useTenant(useTenant), - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - recordLogInfo(recordLogInfo) - #line 12628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + LookupTenantImplActorState(DatabaseContext* const& cx,TenantName const& tenant) + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenant(tenant) + #line 13628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("getValue", reinterpret_cast(this)); + fdb_probe_actor_create("lookupTenantImpl", reinterpret_cast(this)); } - ~GetValueActorState() + ~LookupTenantImplActorState() { - fdb_probe_actor_destroy("getValue", reinterpret_cast(this)); + fdb_probe_actor_destroy("lookupTenantImpl", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 3334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = version; - #line 3334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 3334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 3455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 13643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -12660,637 +13653,644 @@ class GetValueActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~GetValueActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~LookupTenantImplActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(int loopDepth) - { - #line 3335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span = Span("NAPI:getValue"_loc, trState->spanID); - #line 3336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (useTenant && trState->tenant().present()) - #line 12675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span.addTag("tenant"_sr, trState->tenant().get()); - #line 12679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 3340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span.addTag("key"_sr, key); - #line 3341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->validateVersion(ver); - #line 3343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 12687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont1loopHead1(loopDepth); - - return loopDepth; - } - int a_body1when1(Version const& __ver,int loopDepth) - { - #line 3334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ver = __ver; - #line 12696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); - - return loopDepth; - } - int a_body1when1(Version && __ver,int loopDepth) + int a_body1loopHead1(int loopDepth) { - ver = std::move(__ver); - loopDepth = a_body1cont1(loopDepth); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); return loopDepth; } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetValueActor, 0, Version >::remove(); - - } - void a_callback_fire(ActorCallback< GetValueActor, 0, Version >*,Version const& value) - { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< GetValueActor, 0, Version >*,Version && value) - { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< GetValueActor, 0, Version >*,Error err) + int a_body1loopBody1(int loopDepth) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 0); - a_exitChoose1(); try { - a_body1Catch1(err, 0); + #line 3457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = cx->getBackoff(); + #line 3457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 13676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 3457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 13681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1Catch1(error, 0); + loopDepth = a_body1loopBody1Catch1(error, loopDepth); } catch (...) { - a_body1Catch1(unknown_error(), 0); + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 0); - - } - int a_body1cont1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); return loopDepth; } - int a_body1cont1loopBody1(int loopDepth) + int a_body1loopBody1cont1(int loopDepth) { - #line 3344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = getKeyLocation(trState, key, &StorageServerInterface::getValue, Reverse::False, useTenant, ver); - #line 3344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 12772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 3344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1cont1loopBody1cont1(int loopDepth) + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { - #line 3347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - getValueID = Optional(); - #line 3348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - startTime = uint64_t(); - #line 3349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - startTimeD = double(); - #line 3350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ssLatestCommitVersions = VersionVector(); - #line 3351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->getLatestCommitVersions(locationInfo.locations, ver, trState, ssLatestCommitVersions); - #line 12794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 3353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->debugID.present()) - #line 12798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_commit_proxy_memory_limit_exceeded) + #line 13703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - getValueID = nondeterministicRandom()->randomUniqueID(); - #line 3356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addAttach("GetValueAttachID", trState->debugID.get().first(), getValueID.get().first()); - #line 3357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent("GetValueDebug", getValueID.get().first(), "NativeAPI.getValue.Before"); - #line 12806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 3366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ++trState->cx->getValueSubmitted; - #line 3367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - startTime = timer_int(); - #line 3368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - startTimeD = now(); - #line 3369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ++trState->cx->transactionPhysicalReads; - #line 3371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - reply = GetValueReply(); - #line 12818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - try { - #line 3373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (CLIENT_BUGGIFY_WITH_PROB(.01)) - #line 12822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1cont1loopBody1cont1Catch2(deterministicRandom()->randomChoice( std::vector{ transaction_too_old(), future_version() }), loopDepth); - #line 12826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 3378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = trState->cx->connectionFileChanged(); - #line 3377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont1Catch2(actor_cancelled(), loopDepth); - #line 12832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1cont1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; - #line 3381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = loadBalance( trState->cx.getPtr(), locationInfo.locations, &StorageServerInterface::getValue, GetValueRequest(span.context, useTenant ? trState->getTenantInfo() : TenantInfo(), key, ver, trState->cx->sampleReadTags() ? trState->options.readTags : Optional(), getValueID, ssLatestCommitVersions), TaskPriority::DefaultPromiseEndpoint, AtMostOnce::False, trState->cx->enableLocalityLoadBalance ? &trState->cx->queueModel : nullptr); - #line 12836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1cont1Catch2(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont1when2(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 3378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1loopBody1cont1Catch2(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1loopBody1cont1Catch2(unknown_error(), loopDepth); + #line 3473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevWarnAlways, "CommitProxyOverloadedForTenant").suppressFor(5); + #line 3475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->updateBackoff(e); + #line 13709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return a_body1loopHead1(loopDepth); // continue } + #line 3479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 13714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { - loopDepth = a_body1cont1loopBody1cont1Catch1(error, loopDepth); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - loopDepth = a_body1cont1loopBody1cont1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } return loopDepth; } - int a_body1cont1loopBody1when1(KeyRangeLocationInfo const& __locationInfo,int loopDepth) + int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 3344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - locationInfo = __locationInfo; - #line 12864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont1loopBody1cont1(loopDepth); + #line 3459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++cx->transactionTenantLookupRequests; + #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = cx->onProxiesChanged(); + #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 13732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + #line 3462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = basicLoadBalance(cx->getCommitProxies(UseProvisionalProxies::False), &CommitProxyInterface::getTenantId, GetTenantIdRequest(tenant, latestVersion), TaskPriority::DefaultPromiseEndpoint); + #line 13736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 13743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont1loopBody1when1(KeyRangeLocationInfo && __locationInfo,int loopDepth) + int a_body1loopBody1cont2(Void && _,int loopDepth) { - locationInfo = std::move(__locationInfo); - loopDepth = a_body1cont1loopBody1cont1(loopDepth); + #line 3459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++cx->transactionTenantLookupRequests; + #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = cx->onProxiesChanged(); + #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 13756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + #line 3462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = basicLoadBalance(cx->getCommitProxies(UseProvisionalProxies::False), &CommitProxyInterface::getTenantId, GetTenantIdRequest(tenant, latestVersion), TaskPriority::DefaultPromiseEndpoint); + #line 13760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 13767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - void a_exitChoose2() + int a_body1loopBody1when1(Void const& _,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetValueActor, 1, KeyRangeLocationInfo >::remove(); + loopDepth = a_body1loopBody1cont2(_, loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< GetValueActor, 1, KeyRangeLocationInfo >*,KeyRangeLocationInfo const& value) + int a_body1loopBody1when1(Void && _,int loopDepth) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 1); + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< GetValueActor, 1, KeyRangeLocationInfo >*,KeyRangeLocationInfo && value) + void a_exitChoose1() { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 1); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< LookupTenantImplActor, 0, Void >::remove(); } - void a_callback_error(ActorCallback< GetValueActor, 1, KeyRangeLocationInfo >*,Error err) + void a_callback_fire(ActorCallback< LookupTenantImplActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("lookupTenantImpl", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 1); + fdb_probe_actor_exit("lookupTenantImpl", reinterpret_cast(this), 0); } - int a_body1cont1loopBody1cont2(int loopDepth) - { - if (loopDepth == 0) return a_body1cont1loopHead1(0); - - return loopDepth; - } - int a_body1cont1loopBody1cont1Catch1(const Error& e,int loopDepth=0) + void a_callback_fire(ActorCallback< LookupTenantImplActor, 0, Void >*,Void && value) { + fdb_probe_actor_enter("lookupTenantImpl", reinterpret_cast(this), 0); + a_exitChoose1(); try { - #line 3429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->getValueCompleted->latency = timer_int() - startTime; - #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->getValueCompleted->log(); - #line 3431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (getValueID.present()) - #line 12942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent("GetValueDebug", getValueID.get().first(), "NativeAPI.getValue.Error"); - #line 12946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 3440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || (e.code() == error_code_transaction_too_old && ver == latestVersion)) - #line 12950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->invalidateCache(locationInfo.tenantEntry.prefix, key); - #line 3443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_4 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, trState->taskID); - #line 3443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 12958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1Catch1when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 3443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 3444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_unknown_tenant) - #line 12970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(useTenant && trState->tenant().present()); - #line 3446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->invalidateCachedTenant(trState->tenant().get()); - #line 3447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_5 = delay(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, trState->taskID); - #line 3447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 12980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1Catch1when2(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 3447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 3449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->trLogInfo && recordLogInfo) - #line 12992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->trLogInfo->addLog(FdbClientLogEvents::EventGetError(startTimeD, trState->cx->clientLocality.dcId(), static_cast(e.code()), key, trState->tenant())); - #line 12996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 3455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 13000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - int a_body1cont1loopBody1cont3(int loopDepth) - { - #line 3405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - double latency = now() - startTimeD; - #line 3406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->readLatencies.addSample(latency); - #line 3407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->trLogInfo && recordLogInfo) - #line 13020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int valueSize = reply.value.present() ? reply.value.get().size() : 0; - #line 3409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->trLogInfo->addLog(FdbClientLogEvents::EventGet( startTimeD, trState->cx->clientLocality.dcId(), latency, valueSize, key, trState->tenant())); - #line 13026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 3412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->getValueCompleted->latency = timer_int() - startTime; - #line 3413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->getValueCompleted->log(); - #line 3415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (getValueID.present()) - #line 13034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent("GetValueDebug", getValueID.get().first(), "NativeAPI.getValue.After"); - #line 13038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + a_body1loopBody1Catch1(unknown_error(), 0); } - #line 3425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->transactionBytesRead += reply.value.present() ? reply.value.get().size() : 0; - #line 3426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ++trState->cx->transactionKeysRead; - #line 3427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(reply.value); this->~GetValueActorState(); static_cast(this)->destroy(); return 0; } - #line 13046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(reply.value); - this->~GetValueActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + fdb_probe_actor_exit("lookupTenantImpl", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1cont1loopBody1cont1Catch2(const Error& __current_error,int loopDepth=0) + void a_callback_error(ActorCallback< LookupTenantImplActor, 0, Void >*,Error err) { + fdb_probe_actor_enter("lookupTenantImpl", reinterpret_cast(this), 0); + a_exitChoose1(); try { - #line 3401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ++trState->cx->transactionPhysicalReadsCompleted; - #line 3402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1cont1loopBody1cont1Catch1(__current_error, loopDepth); - #line 13061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - loopDepth = a_body1cont1loopBody1cont1Catch1(error, loopDepth); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1cont1loopBody1cont1Catch1(unknown_error(), loopDepth); + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("lookupTenantImpl", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1cont1loopBody1cont5(int loopDepth) + int a_body1loopBody1cont3(int loopDepth) { - #line 3399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ++trState->cx->transactionPhysicalReadsCompleted; - #line 13075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont1loopBody1cont8(loopDepth); + loopDepth = a_body1loopBody1cont4(loopDepth); return loopDepth; } - int a_body1cont1loopBody1cont1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) { - #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1cont1loopBody1cont1Catch2(transaction_too_old(), loopDepth); - #line 13084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } - int a_body1cont1loopBody1cont1when1(Void && _,int loopDepth) + int a_body1loopBody1cont2when1(Void && _,int loopDepth) { - #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1cont1loopBody1cont1Catch2(transaction_too_old(), loopDepth); - #line 13092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } - int a_body1cont1loopBody1cont1when2(GetValueReply const& _reply,int loopDepth) + int a_body1loopBody1cont2when2(GetTenantIdReply const& rep,int loopDepth) { - #line 3396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - reply = _reply; - #line 13100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont1loopBody1cont5(loopDepth); + #line 3466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++cx->transactionTenantLookupRequestsCompleted; + #line 3467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->updateBackoff(success()); + #line 3468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(rep.tenantId); this->~LookupTenantImplActorState(); static_cast(this)->destroy(); return 0; } + #line 13861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< int64_t >::value()) int64_t(rep.tenantId); + this->~LookupTenantImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont1loopBody1cont1when2(GetValueReply && _reply,int loopDepth) + int a_body1loopBody1cont2when2(GetTenantIdReply && rep,int loopDepth) { - #line 3396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - reply = _reply; - #line 13109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont1loopBody1cont5(loopDepth); + #line 3466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++cx->transactionTenantLookupRequestsCompleted; + #line 3467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->updateBackoff(success()); + #line 3468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(rep.tenantId); this->~LookupTenantImplActorState(); static_cast(this)->destroy(); return 0; } + #line 13877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< int64_t >::value()) int64_t(rep.tenantId); + this->~LookupTenantImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - void a_exitChoose3() + void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetValueActor, 2, Void >::remove(); - static_cast(this)->ActorCallback< GetValueActor, 3, GetValueReply >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< LookupTenantImplActor, 1, Void >::remove(); + static_cast(this)->ActorCallback< LookupTenantImplActor, 2, GetTenantIdReply >::remove(); } - void a_callback_fire(ActorCallback< GetValueActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< LookupTenantImplActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("lookupTenantImpl", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont1loopBody1cont1when1(value, 0); + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1cont1loopBody1cont1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 2); + fdb_probe_actor_exit("lookupTenantImpl", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< GetValueActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< LookupTenantImplActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("lookupTenantImpl", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont1loopBody1cont1when1(std::move(value), 0); + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1cont1loopBody1cont1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 2); + fdb_probe_actor_exit("lookupTenantImpl", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< GetValueActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< LookupTenantImplActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("lookupTenantImpl", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont1loopBody1cont1Catch2(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1cont1loopBody1cont1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 2); + fdb_probe_actor_exit("lookupTenantImpl", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< GetValueActor, 3, GetValueReply >*,GetValueReply const& value) + void a_callback_fire(ActorCallback< LookupTenantImplActor, 2, GetTenantIdReply >*,GetTenantIdReply const& value) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 3); - a_exitChoose3(); + fdb_probe_actor_enter("lookupTenantImpl", reinterpret_cast(this), 2); + a_exitChoose2(); try { - a_body1cont1loopBody1cont1when2(value, 0); + a_body1loopBody1cont2when2(value, 0); } catch (Error& error) { - a_body1cont1loopBody1cont1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 3); + fdb_probe_actor_exit("lookupTenantImpl", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< GetValueActor, 3, GetValueReply >*,GetValueReply && value) + void a_callback_fire(ActorCallback< LookupTenantImplActor, 2, GetTenantIdReply >*,GetTenantIdReply && value) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 3); - a_exitChoose3(); + fdb_probe_actor_enter("lookupTenantImpl", reinterpret_cast(this), 2); + a_exitChoose2(); try { - a_body1cont1loopBody1cont1when2(std::move(value), 0); + a_body1loopBody1cont2when2(std::move(value), 0); } catch (Error& error) { - a_body1cont1loopBody1cont1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 3); + fdb_probe_actor_exit("lookupTenantImpl", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< GetValueActor, 3, GetValueReply >*,Error err) + void a_callback_error(ActorCallback< LookupTenantImplActor, 2, GetTenantIdReply >*,Error err) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 3); - a_exitChoose3(); + fdb_probe_actor_enter("lookupTenantImpl", reinterpret_cast(this), 2); + a_exitChoose2(); try { - a_body1cont1loopBody1cont1Catch2(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1cont1loopBody1cont1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 3); + fdb_probe_actor_exit("lookupTenantImpl", reinterpret_cast(this), 2); } - int a_body1cont1loopBody1cont8(int loopDepth) + int a_body1loopBody1cont4(int loopDepth) { try { - loopDepth = a_body1cont1loopBody1cont3(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); } catch (Error& error) { - loopDepth = a_body1cont1loopBody1cont1Catch1(error, loopDepth); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - loopDepth = a_body1cont1loopBody1cont1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } return loopDepth; } - int a_body1cont1loopBody1cont1Catch1cont1(int loopDepth) - { - loopDepth = a_body1cont1loopBody1cont2(loopDepth); - - return loopDepth; - } - int a_body1cont1loopBody1cont1Catch1cont3(Void const& _,int loopDepth) + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + DatabaseContext* cx; + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TenantName tenant; + #line 13999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via lookupTenantImpl() + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class LookupTenantImplActor final : public Actor, public ActorCallback< LookupTenantImplActor, 0, Void >, public ActorCallback< LookupTenantImplActor, 1, Void >, public ActorCallback< LookupTenantImplActor, 2, GetTenantIdReply >, public FastAllocated, public LookupTenantImplActorState { + #line 14004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< LookupTenantImplActor, 0, Void >; +friend struct ActorCallback< LookupTenantImplActor, 1, Void >; +friend struct ActorCallback< LookupTenantImplActor, 2, GetTenantIdReply >; + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + LookupTenantImplActor(DatabaseContext* const& cx,TenantName const& tenant) + #line 14017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + LookupTenantImplActorState(cx, tenant) { - loopDepth = a_body1cont1loopBody1cont1Catch1cont1(loopDepth); + fdb_probe_actor_enter("lookupTenantImpl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("lookupTenantImpl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("lookupTenantImpl", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< LookupTenantImplActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< LookupTenantImplActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future lookupTenantImpl( DatabaseContext* const& cx, TenantName const& tenant ) { + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new LookupTenantImplActor(cx, tenant)); + #line 14046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 3483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +Future DatabaseContext::lookupTenant(TenantName tenant) { + return lookupTenantImpl(this, tenant); +} + +TransactionState::TransactionState(Database cx, + Optional> tenant, + TaskPriority taskID, + SpanContext spanContext, + Reference trLogInfo) + : cx(cx), trLogInfo(trLogInfo), options(cx), taskID(taskID), spanContext(spanContext), + readVersionObtainedFromGrvProxy(true), tenant_(tenant), tenantSet(tenant.present()) {} + +Reference TransactionState::cloneAndReset(Reference newTrLogInfo, + bool generateNewSpan) const { + + SpanContext newSpanContext = generateNewSpan ? generateSpanID(cx->transactionTracingSample) : spanContext; + Reference newState = + makeReference(cx, tenant_, cx->taskID, newSpanContext, newTrLogInfo); + + if (!cx->apiVersionAtLeast(16)) { + newState->options = options; + } + + newState->readVersionFuture = Future(); + newState->metadataVersion = Promise>(); + newState->numErrors = numErrors; + newState->startTime = startTime; + newState->committedVersion = committedVersion; + newState->conflictingKeys = conflictingKeys; + newState->tenantSet = tenantSet; + + return newState; +} + +TenantInfo TransactionState::getTenantInfo(AllowInvalidTenantID allowInvalidTenantId /* = false */) { + Optional> const& t = tenant(); + + if (options.rawAccess) { + return TenantInfo(); + } else if (!cx->internal && cx->clientInfo->get().clusterType == ClusterType::METACLUSTER_MANAGEMENT) { + throw management_cluster_invalid_access(); + } else if (!cx->internal && cx->clientInfo->get().tenantMode == TenantMode::REQUIRED && !t.present()) { + throw tenant_name_required(); + } else if (!t.present()) { + return TenantInfo(); + } else if (cx->clientInfo->get().tenantMode == TenantMode::DISABLED && t.present()) { + // If we are running provisional proxies, we allow a tenant request to go through since we don't know the tenant + // mode. Such a transaction would not be allowed to commit without enabling provisional commits because either + // the commit proxies will be provisional or the read version will be too old. + if (!cx->clientInfo->get().grvProxies.empty() && !cx->clientInfo->get().grvProxies[0].provisional) { + throw tenants_disabled(); + } else { + ASSERT(!useProvisionalProxies); + } + } + + ASSERT(t.present() && (allowInvalidTenantId || t.get()->id() != TenantInfo::INVALID_TENANT)); + return TenantInfo( + (allowInvalidTenantId && !t.get()->ready().isReady()) ? TenantInfo::INVALID_TENANT : t.get()->id(), authToken); +} + +// Returns the tenant used in this transaction. If the tenant is unset and raw access isn't specified, then the default +// tenant from DatabaseContext is applied to this transaction (note: the default tenant is typically unset, but in +// simulation could be something different). +// +// This function should not be called in the transaction constructor or in the setOption function to allow a user the +// opportunity to set raw access. +Optional> const& TransactionState::tenant() { + hasTenant(ResolveDefaultTenant::True); + return tenant_; +} + +// Returns true if the tenant has been set, but does not cause default tenant resolution. This is useful in setOption +// (where we do not want to call tenant()) if we want to enforce that an option not be set on a Tenant transaction (e.g. +// for raw access). +bool TransactionState::hasTenant(ResolveDefaultTenant resolveDefaultTenant) { + if (!tenantSet && resolveDefaultTenant) { + if (!options.rawAccess && cx->defaultTenant.present()) { + tenant_ = makeReference(cx->lookupTenant(cx->defaultTenant.get()), cx->defaultTenant); + } + tenantSet = true; + } + + return tenant_.present(); +} + + #line 14137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via startTransaction() + #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class StartTransactionActorState { + #line 14144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StartTransactionActorState(Reference const& trState) + #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : trState(trState) + #line 14151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("startTransaction", reinterpret_cast(this)); + + } + ~StartTransactionActorState() + { + fdb_probe_actor_destroy("startTransaction", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 3571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = success(trState->readVersionFuture); + #line 3571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 14168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 3571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 14173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1cont1loopBody1cont1Catch1cont3(Void && _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - loopDepth = a_body1cont1loopBody1cont1Catch1cont1(loopDepth); + this->~StartTransactionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1cont1loopBody1cont1Catch1when1(Void const& _,int loopDepth) + int a_body1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont1Catch1cont3(_, loopDepth); + #line 3572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->tenant().present()) + #line 14196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = trState->tenant().get()->ready(); + #line 3573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 14202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 3573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 14207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont2(loopDepth); + } return loopDepth; } - int a_body1cont1loopBody1cont1Catch1when1(Void && _,int loopDepth) + int a_body1cont1(Void && _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont1Catch1cont3(std::move(_), loopDepth); + #line 3572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->tenant().present()) + #line 14221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = trState->tenant().get()->ready(); + #line 3573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 14227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 3573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 14232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont2(loopDepth); + } return loopDepth; } - void a_exitChoose4() + int a_body1when1(Void const& _,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetValueActor, 4, Void >::remove(); + loopDepth = a_body1cont1(_, loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< GetValueActor, 4, Void >*,Void const& value) + int a_body1when1(Void && _,int loopDepth) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 4); - a_exitChoose4(); + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< StartTransactionActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< StartTransactionActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("startTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont1loopBody1cont1Catch1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 4); + fdb_probe_actor_exit("startTransaction", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetValueActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< StartTransactionActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 4); - a_exitChoose4(); + fdb_probe_actor_enter("startTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont1loopBody1cont1Catch1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 4); + fdb_probe_actor_exit("startTransaction", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetValueActor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< StartTransactionActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 4); - a_exitChoose4(); + fdb_probe_actor_enter("startTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1Catch1(err, 0); } @@ -13299,79 +14299,85 @@ class GetValueActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 4); + fdb_probe_actor_exit("startTransaction", reinterpret_cast(this), 0); } - int a_body1cont1loopBody1cont1Catch1cont4(int loopDepth) + int a_body1cont2(int loopDepth) { - loopDepth = a_body1cont1loopBody1cont1Catch1cont1(loopDepth); + #line 3576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~StartTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 14309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~StartTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont1loopBody1cont1Catch1cont5(Void const& _,int loopDepth) + int a_body1cont3(Void const& _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont1Catch1cont4(loopDepth); + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont1loopBody1cont1Catch1cont5(Void && _,int loopDepth) + int a_body1cont3(Void && _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont1Catch1cont4(loopDepth); + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont1loopBody1cont1Catch1when2(Void const& _,int loopDepth) + int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont1Catch1cont5(_, loopDepth); + loopDepth = a_body1cont3(_, loopDepth); return loopDepth; } - int a_body1cont1loopBody1cont1Catch1when2(Void && _,int loopDepth) + int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1loopBody1cont1Catch1cont5(std::move(_), loopDepth); + loopDepth = a_body1cont3(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose5() + void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetValueActor, 5, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< StartTransactionActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< GetValueActor, 5, Void >*,Void const& value) + void a_callback_fire(ActorCallback< StartTransactionActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 5); - a_exitChoose5(); + fdb_probe_actor_enter("startTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont1loopBody1cont1Catch1when2(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 5); + fdb_probe_actor_exit("startTransaction", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< GetValueActor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< StartTransactionActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 5); - a_exitChoose5(); + fdb_probe_actor_enter("startTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont1loopBody1cont1Catch1when2(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 5); + fdb_probe_actor_exit("startTransaction", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< GetValueActor, 5, Void >*,Error err) + void a_callback_error(ActorCallback< StartTransactionActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), 5); - a_exitChoose5(); + fdb_probe_actor_enter("startTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -13380,67 +14386,39 @@ class GetValueActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getValue", reinterpret_cast(this), 5); + fdb_probe_actor_exit("startTransaction", reinterpret_cast(this), 1); } - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key key; - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future version; - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - UseTenant useTenant; - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TransactionRecordLogInfo recordLogInfo; - #line 3334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version ver; - #line 3335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Span span; - #line 3344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRangeLocationInfo locationInfo; - #line 3347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Optional getValueID; - #line 3348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - uint64_t startTime; - #line 3349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - double startTimeD; - #line 3350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - VersionVector ssLatestCommitVersions; - #line 3371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetValueReply reply; - #line 13412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 14394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via getValue() - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetValueActor final : public Actor>, public ActorCallback< GetValueActor, 0, Version >, public ActorCallback< GetValueActor, 1, KeyRangeLocationInfo >, public ActorCallback< GetValueActor, 2, Void >, public ActorCallback< GetValueActor, 3, GetValueReply >, public ActorCallback< GetValueActor, 4, Void >, public ActorCallback< GetValueActor, 5, Void >, public FastAllocated, public GetValueActorState { - #line 13417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via startTransaction() + #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class StartTransactionActor final : public Actor, public ActorCallback< StartTransactionActor, 0, Void >, public ActorCallback< StartTransactionActor, 1, Void >, public FastAllocated, public StartTransactionActorState { + #line 14399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetValueActor, 0, Version >; -friend struct ActorCallback< GetValueActor, 1, KeyRangeLocationInfo >; -friend struct ActorCallback< GetValueActor, 2, Void >; -friend struct ActorCallback< GetValueActor, 3, GetValueReply >; -friend struct ActorCallback< GetValueActor, 4, Void >; -friend struct ActorCallback< GetValueActor, 5, Void >; - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetValueActor(Reference const& trState,Key const& key,Future const& version,UseTenant const& useTenant,TransactionRecordLogInfo const& recordLogInfo) - #line 13433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor>(), - GetValueActorState(trState, key, version, useTenant, recordLogInfo) +friend struct ActorCallback< StartTransactionActor, 0, Void >; +friend struct ActorCallback< StartTransactionActor, 1, Void >; + #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StartTransactionActor(Reference const& trState) + #line 14411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + StartTransactionActorState(trState) { - fdb_probe_actor_enter("getValue", reinterpret_cast(this), -1); + fdb_probe_actor_enter("startTransaction", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getValue"); + this->lineage.setActorName("startTransaction"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("getValue", reinterpret_cast(this), -1); + fdb_probe_actor_exit("startTransaction", reinterpret_cast(this), -1); } void cancel() override @@ -13448,68 +14426,84 @@ friend struct ActorCallback< GetValueActor, 5, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetValueActor, 0, Version >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetValueActor, 1, KeyRangeLocationInfo >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< GetValueActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< GetValueActor, 4, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< GetValueActor, 5, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< StartTransactionActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< StartTransactionActor, 1, Void >*)0, actor_cancelled()); break; } } }; } - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future> getValue( Reference const& trState, Key const& key, Future const& version, UseTenant const& useTenant, TransactionRecordLogInfo const& recordLogInfo ) { - #line 3329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future>(new GetValueActor(trState, key, version, useTenant, recordLogInfo)); - #line 13465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future startTransaction( Reference const& trState ) { + #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new StartTransactionActor(trState)); + #line 14440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 3578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +Future TransactionState::startTransaction(uint32_t readVersionFlags) { + if (!startFuture.isValid()) { + if (!readVersionFuture.isValid()) { + readVersionFuture = getReadVersion(readVersionFlags); + } + if (readVersionFuture.isReady() && (!tenant().present() || tenant().get()->ready().isReady())) { + startFuture = Void(); + } else { + startFuture = ::startTransaction(Reference::addRef(this)); + } + } + + return startFuture; } -#line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +Future Transaction::warmRange(KeyRange keys) { + return warmRange_impl(trState, keys); +} - #line 13470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 14464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via getKey() - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetKeyActorState { - #line 13477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via getValue() + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetValueActorState { + #line 14471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetKeyActorState(Reference const& trState,KeySelector const& k,Future const& version,UseTenant const& useTenant = UseTenant::True) - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetValueActorState(Reference const& trState,Key const& key,UseTenant const& useTenant,TransactionRecordLogInfo const& recordLogInfo) + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - k(k), - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version(version), - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - useTenant(useTenant) - #line 13490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + key(key), + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + useTenant(useTenant), + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + recordLogInfo(recordLogInfo) + #line 14484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("getKey", reinterpret_cast(this)); + fdb_probe_actor_create("getValue", reinterpret_cast(this)); } - ~GetKeyActorState() + ~GetValueActorState() { - fdb_probe_actor_destroy("getKey", reinterpret_cast(this)); + fdb_probe_actor_destroy("getValue", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 3465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = success(version); - #line 3465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = trState->startTransaction(); + #line 3602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 14501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 3465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 3602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 14506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13522,58 +14516,50 @@ class GetKeyActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~GetKeyActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~GetValueActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(Void const& _,int loopDepth) { - #line 3467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - getKeyID = Optional(); - #line 3468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span = Span("NAPI:getKey"_loc, trState->spanID); - #line 3469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->debugID.present()) - #line 13539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span = Span("NAPI:getValue"_loc, trState->spanContext); + #line 3605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (useTenant && trState->tenant().present()) + #line 14531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - getKeyID = nondeterministicRandom()->randomUniqueID(); - #line 3472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addAttach("GetKeyAttachID", trState->debugID.get().first(), getKeyID.get().first()); - #line 3473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent( "GetKeyDebug", getKeyID.get().first(), "NativeAPI.getKey.AfterVersion"); - #line 13547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span.addAttribute("tenant"_sr, trState->tenant().get()->name.castTo().orDefault(""_sr)); + #line 14535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->validateVersion(trState->readVersion()); + #line 3612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 13551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 14541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 3467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - getKeyID = Optional(); - #line 3468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span = Span("NAPI:getKey"_loc, trState->spanID); - #line 3469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->debugID.present()) - #line 13564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span = Span("NAPI:getValue"_loc, trState->spanContext); + #line 3605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (useTenant && trState->tenant().present()) + #line 14552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - getKeyID = nondeterministicRandom()->randomUniqueID(); - #line 3472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addAttach("GetKeyAttachID", trState->debugID.get().first(), getKeyID.get().first()); - #line 3473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent( "GetKeyDebug", getKeyID.get().first(), "NativeAPI.getKey.AfterVersion"); - #line 13572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span.addAttribute("tenant"_sr, trState->tenant().get()->name.castTo().orDefault(""_sr)); + #line 14556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->validateVersion(trState->readVersion()); + #line 3612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 13576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 14562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -13592,13 +14578,13 @@ class GetKeyActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetKeyActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetValueActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< GetKeyActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetValueActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -13608,12 +14594,12 @@ class GetKeyActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetKeyActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetValueActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -13623,12 +14609,12 @@ class GetKeyActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetKeyActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< GetValueActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -13638,7 +14624,7 @@ class GetKeyActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 0); } int a_body1cont1loopHead1(int loopDepth) @@ -13650,99 +14636,86 @@ class GetKeyActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 3481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (k.getKey() == allKeys.end) - #line 13655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (k.offset > 0) - #line 13659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(allKeys.end); this->~GetKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 13663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(allKeys.end); - this->~GetKeyActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 3485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - k.orEqual = false; - #line 13671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - else - { - #line 3486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (k.getKey() == allKeys.begin && k.offset <= 0) - #line 13677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Key()); this->~GetKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 13681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(Key()); - this->~GetKeyActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - #line 3490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key locationKey(k.getKey(), k.arena()); - #line 3491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = getKeyLocation(trState, locationKey, &StorageServerInterface::getKey, Reverse{ k.isBackward() }, useTenant, version.get()); - #line 3491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 13694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = getKeyLocation(trState, key, &StorageServerInterface::getValue, Reverse::False, useTenant); + #line 3613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 14643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 3491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 3613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 14648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont1(int loopDepth) { - #line 3498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + getValueID = Optional(); + #line 3617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + startTime = uint64_t(); + #line 3618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + startTimeD = double(); + #line 3619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ssLatestCommitVersions = VersionVector(); - #line 3499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->getLatestCommitVersions(locationInfo.locations, version.get(), trState, ssLatestCommitVersions); - #line 13710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + readOptions = trState->readOptions; + #line 3622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->getLatestCommitVersions(locationInfo.locations, trState, ssLatestCommitVersions); + #line 14667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 3502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (getKeyID.present()) - #line 13714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) + #line 14671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent( "GetKeyDebug", getKeyID.get().first(), "NativeAPI.getKey.Before"); - #line 13718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + getValueID = nondeterministicRandom()->randomUniqueID(); + #line 3626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + readOptions.get().debugID = getValueID; + #line 3628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addAttach( "GetValueAttachID", trState->readOptions.get().debugID.get().first(), getValueID.get().first()); + #line 3630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent("GetValueDebug", getValueID.get().first(), "NativeAPI.getValue.Before"); + #line 14681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++trState->cx->getValueSubmitted; + #line 3640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + startTime = timer_int(); + #line 3641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + startTimeD = now(); + #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionPhysicalReads; - #line 3510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetKeyRequest req(span.context, useTenant ? trState->getTenantInfo() : TenantInfo(), k, version.get(), trState->cx->sampleReadTags() ? trState->options.readTags : Optional(), getKeyID, ssLatestCommitVersions); - #line 3517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.arena.dependsOn(k.arena()); - #line 3519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - reply = GetKeyReply(); - #line 13728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + reply = GetValueReply(); + #line 14693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 3522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (CLIENT_BUGGIFY_WITH_PROB(.01)) + #line 14697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1cont1loopBody1cont1Catch2(deterministicRandom()->randomChoice( std::vector{ transaction_too_old(), future_version() }), loopDepth); + #line 14701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 3651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = trState->cx->connectionFileChanged(); - #line 3521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont1Catch2(actor_cancelled(), loopDepth); - #line 13734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont1Catch2(actor_cancelled(), loopDepth); + #line 14707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1cont1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; - #line 3525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = loadBalance( trState->cx.getPtr(), locationInfo.locations, &StorageServerInterface::getKey, req, TaskPriority::DefaultPromiseEndpoint, AtMostOnce::False, trState->cx->enableLocalityLoadBalance ? &trState->cx->queueModel : nullptr); - #line 13738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = loadBalance( trState->cx.getPtr(), locationInfo.locations, &StorageServerInterface::getValue, GetValueRequest(span.context, useTenant ? trState->getTenantInfo() : TenantInfo(), key, trState->readVersion(), trState->cx->sampleReadTags() ? trState->options.readTags : Optional(), readOptions, ssLatestCommitVersions), TaskPriority::DefaultPromiseEndpoint, AtMostOnce::False, trState->cx->enableLocalityLoadBalance ? &trState->cx->queueModel : nullptr); + #line 14711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1cont1Catch2(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont1when2(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 3522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 3; + #line 3651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 14718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13761,9 +14734,9 @@ class GetKeyActorState { } int a_body1cont1loopBody1when1(KeyRangeLocationInfo const& __locationInfo,int loopDepth) { - #line 3491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" locationInfo = __locationInfo; - #line 13766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 14739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; @@ -13777,13 +14750,13 @@ class GetKeyActorState { } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetKeyActor, 1, KeyRangeLocationInfo >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetValueActor, 1, KeyRangeLocationInfo >::remove(); } - void a_callback_fire(ActorCallback< GetKeyActor, 1, KeyRangeLocationInfo >*,KeyRangeLocationInfo const& value) + void a_callback_fire(ActorCallback< GetValueActor, 1, KeyRangeLocationInfo >*,KeyRangeLocationInfo const& value) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 1); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1loopBody1when1(value, 0); @@ -13793,12 +14766,12 @@ class GetKeyActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< GetKeyActor, 1, KeyRangeLocationInfo >*,KeyRangeLocationInfo && value) + void a_callback_fire(ActorCallback< GetValueActor, 1, KeyRangeLocationInfo >*,KeyRangeLocationInfo && value) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 1); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1loopBody1when1(std::move(value), 0); @@ -13808,12 +14781,12 @@ class GetKeyActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< GetKeyActor, 1, KeyRangeLocationInfo >*,Error err) + void a_callback_error(ActorCallback< GetValueActor, 1, KeyRangeLocationInfo >*,Error err) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 1); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -13823,10 +14796,10 @@ class GetKeyActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 1); } - int a_body1cont1loopBody1cont6(int loopDepth) + int a_body1cont1loopBody1cont2(int loopDepth) { if (loopDepth == 0) return a_body1cont1loopHead1(0); @@ -13835,62 +14808,49 @@ class GetKeyActorState { int a_body1cont1loopBody1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 3551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (getKeyID.present()) - #line 13840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->getValueCompleted->latency = timer_int() - startTime; + #line 3709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->getValueCompleted->log(); + #line 3710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (getValueID.present()) + #line 14817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent("GetKeyDebug", getKeyID.get().first(), "NativeAPI.getKey.Error"); - #line 13844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent("GetValueDebug", getValueID.get().first(), "NativeAPI.getValue.Error"); + #line 14821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) - #line 13848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 14825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->invalidateCache(locationInfo.tenantEntry.prefix, k.getKey(), Reverse{ k.isBackward() }); - #line 3556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->invalidateCache(useTenant ? trState->tenant().mapRef(&Tenant::prefix) : Optional(), key); + #line 3722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_4 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, trState->taskID); - #line 3556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 13856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 14833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1Catch1when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 3556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 4; + #line 3722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 14838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - #line 3557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_unknown_tenant) - #line 13868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(useTenant && trState->tenant().present()); - #line 3559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->invalidateCachedTenant(trState->tenant().get()); - #line 3560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_5 = delay(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, trState->taskID); - #line 3560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 13878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1Catch1when2(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 3560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else + #line 3724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->trLogInfo && recordLogInfo) + #line 14845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevInfo, "GetKeyError").error(e).detail("AtKey", k.getKey()).detail("Offset", k.offset); - #line 3563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 13892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->trLogInfo->addLog( FdbClientLogEvents::EventGetError(startTimeD, trState->cx->clientLocality.dcId(), static_cast(e.code()), key, trState->tenant().flatMapRef(&Tenant::name))); + #line 14849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + #line 3731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 14853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } catch (Error& error) { @@ -13901,42 +14861,58 @@ class GetKeyActorState { return loopDepth; } - int a_body1cont1loopBody1cont7(int loopDepth) + int a_body1cont1loopBody1cont3(int loopDepth) { - #line 3541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (getKeyID.present()) - #line 13908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + double latency = now() - startTimeD; + #line 3679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->readLatencies.addSample(latency); + #line 3680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->trLogInfo && recordLogInfo) + #line 14872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent("GetKeyDebug", getKeyID.get().first(), "NativeAPI.getKey.After"); - #line 13912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int valueSize = reply.value.present() ? reply.value.get().size() : 0; + #line 3682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->trLogInfo->addLog(FdbClientLogEvents::EventGet(startTimeD, trState->cx->clientLocality.dcId(), latency, valueSize, key, trState->tenant().flatMapRef(&Tenant::name))); + #line 14878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - k = reply.sel; - #line 3547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!k.offset && k.orEqual) - #line 13918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->getValueCompleted->latency = timer_int() - startTime; + #line 3690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->getValueCompleted->log(); + #line 3691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->totalCost += getReadOperationCost(key.size() + (reply.value.present() ? reply.value.get().size() : 0)); + #line 3694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (getValueID.present()) + #line 14888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(k.getKey()); this->~GetKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 13922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(k.getKey()); - this->~GetKeyActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 3695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent("GetValueDebug", getValueID.get().first(), "NativeAPI.getValue.After"); + #line 14892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - loopDepth = a_body1cont1loopBody1cont15(loopDepth); + #line 3704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->transactionBytesRead += reply.value.present() ? reply.value.get().size() : 0; + #line 3705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++trState->cx->transactionKeysRead; + #line 3706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(reply.value); this->~GetValueActorState(); static_cast(this)->destroy(); return 0; } + #line 14900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(reply.value); + this->~GetValueActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } int a_body1cont1loopBody1cont1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 3538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionPhysicalReadsCompleted; - #line 3539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1cont1loopBody1cont1Catch1(__current_error, loopDepth); - #line 13939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 14915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1cont1loopBody1cont1Catch1(error, loopDepth); @@ -13946,59 +14922,59 @@ class GetKeyActorState { return loopDepth; } - int a_body1cont1loopBody1cont9(int loopDepth) + int a_body1cont1loopBody1cont5(int loopDepth) { - #line 3536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionPhysicalReadsCompleted; - #line 13953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont1loopBody1cont11(loopDepth); + #line 14929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont8(loopDepth); return loopDepth; } int a_body1cont1loopBody1cont1when1(Void const& _,int loopDepth) { - #line 3523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1cont1loopBody1cont1Catch2(transaction_too_old(), loopDepth); - #line 13962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 14938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } int a_body1cont1loopBody1cont1when1(Void && _,int loopDepth) { - #line 3523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1cont1loopBody1cont1Catch2(transaction_too_old(), loopDepth); - #line 13970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 14946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } - int a_body1cont1loopBody1cont1when2(GetKeyReply const& _reply,int loopDepth) + int a_body1cont1loopBody1cont1when2(GetValueReply const& _reply,int loopDepth) { - #line 3533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" reply = _reply; - #line 13978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont1loopBody1cont9(loopDepth); + #line 14954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont5(loopDepth); return loopDepth; } - int a_body1cont1loopBody1cont1when2(GetKeyReply && _reply,int loopDepth) + int a_body1cont1loopBody1cont1when2(GetValueReply && _reply,int loopDepth) { - #line 3533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" reply = _reply; - #line 13987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont1loopBody1cont9(loopDepth); + #line 14963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont5(loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetKeyActor, 2, Void >::remove(); - static_cast(this)->ActorCallback< GetKeyActor, 3, GetKeyReply >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetValueActor, 2, Void >::remove(); + static_cast(this)->ActorCallback< GetValueActor, 3, GetValueReply >::remove(); } - void a_callback_fire(ActorCallback< GetKeyActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetValueActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 2); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont1loopBody1cont1when1(value, 0); @@ -14008,12 +14984,12 @@ class GetKeyActorState { } catch (...) { a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< GetKeyActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetValueActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 2); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont1loopBody1cont1when1(std::move(value), 0); @@ -14023,12 +14999,12 @@ class GetKeyActorState { } catch (...) { a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< GetKeyActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< GetValueActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 2); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont1loopBody1cont1Catch2(err, 0); @@ -14038,12 +15014,12 @@ class GetKeyActorState { } catch (...) { a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< GetKeyActor, 3, GetKeyReply >*,GetKeyReply const& value) + void a_callback_fire(ActorCallback< GetValueActor, 3, GetValueReply >*,GetValueReply const& value) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 3); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 3); a_exitChoose3(); try { a_body1cont1loopBody1cont1when2(value, 0); @@ -14053,12 +15029,12 @@ class GetKeyActorState { } catch (...) { a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< GetKeyActor, 3, GetKeyReply >*,GetKeyReply && value) + void a_callback_fire(ActorCallback< GetValueActor, 3, GetValueReply >*,GetValueReply && value) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 3); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 3); a_exitChoose3(); try { a_body1cont1loopBody1cont1when2(std::move(value), 0); @@ -14068,12 +15044,12 @@ class GetKeyActorState { } catch (...) { a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< GetKeyActor, 3, GetKeyReply >*,Error err) + void a_callback_error(ActorCallback< GetValueActor, 3, GetValueReply >*,Error err) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 3); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 3); a_exitChoose3(); try { a_body1cont1loopBody1cont1Catch2(err, 0); @@ -14083,13 +15059,13 @@ class GetKeyActorState { } catch (...) { a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 3); } - int a_body1cont1loopBody1cont11(int loopDepth) + int a_body1cont1loopBody1cont8(int loopDepth) { try { - loopDepth = a_body1cont1loopBody1cont7(loopDepth); + loopDepth = a_body1cont1loopBody1cont3(loopDepth); } catch (Error& error) { loopDepth = a_body1cont1loopBody1cont1Catch1(error, loopDepth); @@ -14099,22 +15075,9 @@ class GetKeyActorState { return loopDepth; } - int a_body1cont1loopBody1cont15(int loopDepth) - { - try { - loopDepth = a_body1cont1loopBody1cont6(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } int a_body1cont1loopBody1cont1Catch1cont1(int loopDepth) { - loopDepth = a_body1cont1loopBody1cont6(loopDepth); + loopDepth = a_body1cont1loopBody1cont2(loopDepth); return loopDepth; } @@ -14144,13 +15107,13 @@ class GetKeyActorState { } void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetKeyActor, 4, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetValueActor, 4, Void >::remove(); } - void a_callback_fire(ActorCallback< GetKeyActor, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetValueActor, 4, Void >*,Void const& value) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 4); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 4); a_exitChoose4(); try { a_body1cont1loopBody1cont1Catch1when1(value, 0); @@ -14160,12 +15123,12 @@ class GetKeyActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< GetKeyActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetValueActor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 4); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 4); a_exitChoose4(); try { a_body1cont1loopBody1cont1Catch1when1(std::move(value), 0); @@ -14175,12 +15138,12 @@ class GetKeyActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< GetKeyActor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< GetValueActor, 4, Void >*,Error err) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 4); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), 4); a_exitChoose4(); try { a_body1Catch1(err, 0); @@ -14190,140 +15153,64 @@ class GetKeyActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 4); - - } - int a_body1cont1loopBody1cont1Catch1cont4(int loopDepth) - { - loopDepth = a_body1cont1loopBody1cont1Catch1cont1(loopDepth); - - return loopDepth; - } - int a_body1cont1loopBody1cont1Catch1cont5(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1loopBody1cont1Catch1cont4(loopDepth); - - return loopDepth; - } - int a_body1cont1loopBody1cont1Catch1cont5(Void && _,int loopDepth) - { - loopDepth = a_body1cont1loopBody1cont1Catch1cont4(loopDepth); - - return loopDepth; - } - int a_body1cont1loopBody1cont1Catch1when2(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1loopBody1cont1Catch1cont5(_, loopDepth); - - return loopDepth; - } - int a_body1cont1loopBody1cont1Catch1when2(Void && _,int loopDepth) - { - loopDepth = a_body1cont1loopBody1cont1Catch1cont5(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose5() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetKeyActor, 5, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GetKeyActor, 5, Void >*,Void const& value) - { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 5); - a_exitChoose5(); - try { - a_body1cont1loopBody1cont1Catch1when2(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 5); - - } - void a_callback_fire(ActorCallback< GetKeyActor, 5, Void >*,Void && value) - { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 5); - a_exitChoose5(); - try { - a_body1cont1loopBody1cont1Catch1when2(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 5); - - } - void a_callback_error(ActorCallback< GetKeyActor, 5, Void >*,Error err) - { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), 5); - a_exitChoose5(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getKey", reinterpret_cast(this), 5); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), 4); } - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeySelector k; - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future version; - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key key; + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UseTenant useTenant; - #line 3467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Optional getKeyID; - #line 3468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TransactionRecordLogInfo recordLogInfo; + #line 3604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 3491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRangeLocationInfo locationInfo; - #line 3498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional getValueID; + #line 3617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + uint64_t startTime; + #line 3618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + double startTimeD; + #line 3619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" VersionVector ssLatestCommitVersions; - #line 3519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetKeyReply reply; - #line 14295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional readOptions; + #line 3644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetValueReply reply; + #line 15183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via getKey() - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetKeyActor final : public Actor, public ActorCallback< GetKeyActor, 0, Void >, public ActorCallback< GetKeyActor, 1, KeyRangeLocationInfo >, public ActorCallback< GetKeyActor, 2, Void >, public ActorCallback< GetKeyActor, 3, GetKeyReply >, public ActorCallback< GetKeyActor, 4, Void >, public ActorCallback< GetKeyActor, 5, Void >, public FastAllocated, public GetKeyActorState { - #line 14300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via getValue() + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetValueActor final : public Actor>, public ActorCallback< GetValueActor, 0, Void >, public ActorCallback< GetValueActor, 1, KeyRangeLocationInfo >, public ActorCallback< GetValueActor, 2, Void >, public ActorCallback< GetValueActor, 3, GetValueReply >, public ActorCallback< GetValueActor, 4, Void >, public FastAllocated, public GetValueActorState { + #line 15188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetKeyActor, 0, Void >; -friend struct ActorCallback< GetKeyActor, 1, KeyRangeLocationInfo >; -friend struct ActorCallback< GetKeyActor, 2, Void >; -friend struct ActorCallback< GetKeyActor, 3, GetKeyReply >; -friend struct ActorCallback< GetKeyActor, 4, Void >; -friend struct ActorCallback< GetKeyActor, 5, Void >; - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetKeyActor(Reference const& trState,KeySelector const& k,Future const& version,UseTenant const& useTenant = UseTenant::True) - #line 14316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - GetKeyActorState(trState, k, version, useTenant) +friend struct ActorCallback< GetValueActor, 0, Void >; +friend struct ActorCallback< GetValueActor, 1, KeyRangeLocationInfo >; +friend struct ActorCallback< GetValueActor, 2, Void >; +friend struct ActorCallback< GetValueActor, 3, GetValueReply >; +friend struct ActorCallback< GetValueActor, 4, Void >; + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetValueActor(Reference const& trState,Key const& key,UseTenant const& useTenant,TransactionRecordLogInfo const& recordLogInfo) + #line 15203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>(), + GetValueActorState(trState, key, useTenant, recordLogInfo) { - fdb_probe_actor_enter("getKey", reinterpret_cast(this), -1); + fdb_probe_actor_enter("getValue", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getKey"); + this->lineage.setActorName("getValue"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("getKey", reinterpret_cast(this), -1); + fdb_probe_actor_exit("getValue", reinterpret_cast(this), -1); } void cancel() override @@ -14331,62 +15218,66 @@ friend struct ActorCallback< GetKeyActor, 5, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetKeyActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetKeyActor, 1, KeyRangeLocationInfo >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< GetKeyActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< GetKeyActor, 4, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< GetKeyActor, 5, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetValueActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetValueActor, 1, KeyRangeLocationInfo >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetValueActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< GetValueActor, 4, Void >*)0, actor_cancelled()); break; } } }; } - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future getKey( Reference const& trState, KeySelector const& k, Future const& version, UseTenant const& useTenant = UseTenant::True ) { - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new GetKeyActor(trState, k, version, useTenant)); - #line 14348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future> getValue( Reference const& trState, Key const& key, UseTenant const& useTenant, TransactionRecordLogInfo const& recordLogInfo ) { + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>(new GetValueActor(trState, key, useTenant, recordLogInfo)); + #line 15234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 3568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 3736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 14353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 15239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via waitForCommittedVersion() - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class WaitForCommittedVersionActorState { - #line 14360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via getKey() + #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetKeyActorState { + #line 15246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WaitForCommittedVersionActorState(Database const& cx,Version const& version,SpanID const& spanContext) - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : cx(cx), - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version(version), - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - spanContext(spanContext), - #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:waitForCommittedVersion"_loc, { spanContext }) - #line 14373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetKeyActorState(Reference const& trState,KeySelector const& k,UseTenant const& useTenant = UseTenant::True) + #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : trState(trState), + #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + k(k), + #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + useTenant(useTenant) + #line 15257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("waitForCommittedVersion", reinterpret_cast(this)); + fdb_probe_actor_create("getKey", reinterpret_cast(this)); } - ~WaitForCommittedVersionActorState() + ~GetKeyActorState() { - fdb_probe_actor_destroy("waitForCommittedVersion", reinterpret_cast(this)); + fdb_probe_actor_destroy("getKey", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 3571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 14388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); + #line 3738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = trState->startTransaction(); + #line 3738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 15274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 3738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 15279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -14398,398 +15289,572 @@ class WaitForCommittedVersionActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~WaitForCommittedVersionActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~GetKeyActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1loopHead1(int loopDepth) + int a_body1cont1(Void const& _,int loopDepth) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + #line 3740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + getKeyID = Optional(); + #line 3741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + readOptions = trState->readOptions; + #line 3743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span = Span("NAPI:getKey"_loc, trState->spanContext); + #line 3744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) + #line 15308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + getKeyID = nondeterministicRandom()->randomUniqueID(); + #line 3746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + readOptions.get().debugID = getKeyID; + #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addAttach( "GetKeyAttachID", trState->readOptions.get().debugID.get().first(), getKeyID.get().first()); + #line 3750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent( "GetKeyDebug", getKeyID.get().first(), "NativeAPI.getKey.AfterVersion"); + #line 15318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 15322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } - int a_body1loopBody1(int loopDepth) + int a_body1cont1(Void && _,int loopDepth) { - try { - #line 3574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = cx->onProxiesChanged(); - #line 3573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 14421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 3575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = basicLoadBalance( cx->getGrvProxies(UseProvisionalProxies::False), &GrvProxyInterface::getConsistentReadVersion, GetReadVersionRequest( span.context, 0, TransactionPriority::IMMEDIATE, cx->ssVersionVectorCache.getMaxVersion()), cx->taskID); - #line 14425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 3574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 14432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + #line 3740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + getKeyID = Optional(); + #line 3741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + readOptions = trState->readOptions; + #line 3743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span = Span("NAPI:getKey"_loc, trState->spanContext); + #line 3744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) + #line 15337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + getKeyID = nondeterministicRandom()->randomUniqueID(); + #line 3746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + readOptions.get().debugID = getKeyID; + #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addAttach( "GetKeyAttachID", trState->readOptions.get().debugID.get().first(), getKeyID.get().first()); + #line 3750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent( "GetKeyDebug", getKeyID.get().first(), "NativeAPI.getKey.AfterVersion"); + #line 15347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 15351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); + loopDepth = a_body1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetKeyActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetKeyActor, 0, Void >*,Void const& value) { + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 0); + a_exitChoose1(); try { - #line 3599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_batch_transaction_throttled || e.code() == error_code_proxy_memory_limit_exceeded) - #line 14454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = delayJittered(CLIENT_KNOBS->GRV_ERROR_RETRY_DELAY); - #line 3602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 14460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 3602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 14465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 3604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevError, "WaitForCommittedVersionError").error(e); - #line 3605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 14474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } + a_body1when1(value, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1loopBody1cont2(int loopDepth) + void a_callback_fire(ActorCallback< GetKeyActor, 0, Void >*,Void && value) { - loopDepth = a_body1loopBody1cont3(loopDepth); + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1loopBody1when1(Void const& _,int loopDepth) + void a_callback_error(ActorCallback< GetKeyActor, 0, Void >*,Error err) { - loopDepth = a_body1loopBody1cont2(loopDepth); + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1loopBody1when1(Void && _,int loopDepth) + int a_body1cont1loopHead1(int loopDepth) { - loopDepth = a_body1loopBody1cont2(loopDepth); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); return loopDepth; } - int a_body1loopBody1when2(GetReadVersionReply const& v,int loopDepth) + int a_body1cont1loopBody1(int loopDepth) { - #line 3581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->minAcceptableReadVersion = std::min(cx->minAcceptableReadVersion, v.version); - #line 3582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (v.midShardSize > 0) - #line 14509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->smoothMidShardSize.setTotal(v.midShardSize); - #line 14513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 3584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (cx->versionVectorCacheActive(v.ssVersionVectorDelta)) - #line 14517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (k.getKey() == allKeys.end) + #line 15430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (cx->isCurrentGrvProxy(v.proxyId)) - #line 14521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->ssVersionVectorCache.applyDelta(v.ssVersionVectorDelta); - #line 14525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - else + #line 3759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (k.offset > 0) + #line 15434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->ssVersionVectorCache.clear(); - #line 14531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(allKeys.end); this->~GetKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 15438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key(allKeys.end); + this->~GetKeyActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } + #line 3762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + k.orEqual = false; + #line 15446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (v.version >= version) - #line 14536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + else { - #line 3592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(v.version); this->~WaitForCommittedVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 14540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Version >::value()) Version(v.version); - this->~WaitForCommittedVersionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 3763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (k.getKey() == allKeys.begin && k.offset <= 0) + #line 15452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Key()); this->~GetKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 15456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key(Key()); + this->~GetKeyActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } } - #line 3595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, cx->taskID); - #line 3595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 14550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1when2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 3595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 14555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key locationKey(k.getKey(), k.arena()); + #line 3768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = getKeyLocation( trState, locationKey, &StorageServerInterface::getKey, Reverse{ k.isBackward() }, useTenant); + #line 3768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 15469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 3768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 15474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1when2(GetReadVersionReply && v,int loopDepth) + int a_body1cont1loopBody1cont1(int loopDepth) { - #line 3581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->minAcceptableReadVersion = std::min(cx->minAcceptableReadVersion, v.version); - #line 3582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (v.midShardSize > 0) - #line 14566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->smoothMidShardSize.setTotal(v.midShardSize); - #line 14570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 3584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (cx->versionVectorCacheActive(v.ssVersionVectorDelta)) - #line 14574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (cx->isCurrentGrvProxy(v.proxyId)) - #line 14578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ssLatestCommitVersions = VersionVector(); + #line 3772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->getLatestCommitVersions(locationInfo.locations, trState, ssLatestCommitVersions); + #line 15485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + try { + #line 3775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (getKeyID.present()) + #line 15489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->ssVersionVectorCache.applyDelta(v.ssVersionVectorDelta); - #line 14582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent( "GetKeyDebug", getKeyID.get().first(), "NativeAPI.getKey.Before"); + #line 15493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - else - { - #line 3588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->ssVersionVectorCache.clear(); - #line 14588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++trState->cx->transactionPhysicalReads; + #line 3783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetKeyRequest req(span.context, useTenant ? trState->getTenantInfo() : TenantInfo(), k, trState->readVersion(), trState->cx->sampleReadTags() ? trState->options.readTags : Optional(), readOptions, ssLatestCommitVersions); + #line 3790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.arena.dependsOn(k.arena()); + #line 3792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + reply = GetKeyReply(); + #line 15503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + try { + #line 3795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = trState->cx->connectionFileChanged(); + #line 3794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont1Catch2(actor_cancelled(), loopDepth); + #line 15509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1cont1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; + #line 3798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = loadBalance( trState->cx.getPtr(), locationInfo.locations, &StorageServerInterface::getKey, req, TaskPriority::DefaultPromiseEndpoint, AtMostOnce::False, trState->cx->enableLocalityLoadBalance ? &trState->cx->queueModel : nullptr); + #line 15513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1cont1Catch2(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont1when2(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 3795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 15520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1loopBody1cont1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1loopBody1cont1Catch2(unknown_error(), loopDepth); } } - #line 3591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (v.version >= version) - #line 14593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(v.version); this->~WaitForCommittedVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 14597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Version >::value()) Version(v.version); - this->~WaitForCommittedVersionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + catch (Error& error) { + loopDepth = a_body1cont1loopBody1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1loopBody1cont1Catch1(unknown_error(), loopDepth); } - #line 3595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, cx->taskID); - #line 3595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 14607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1when2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 3595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 14612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; return loopDepth; } - void a_exitChoose1() + int a_body1cont1loopBody1when1(KeyRangeLocationInfo const& __locationInfo,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WaitForCommittedVersionActor, 0, Void >::remove(); - static_cast(this)->ActorCallback< WaitForCommittedVersionActor, 1, GetReadVersionReply >::remove(); + #line 3768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + locationInfo = __locationInfo; + #line 15541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont1(loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 0, Void >*,Void const& value) + int a_body1cont1loopBody1when1(KeyRangeLocationInfo && __locationInfo,int loopDepth) { - fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 0); - a_exitChoose1(); + locationInfo = std::move(__locationInfo); + loopDepth = a_body1cont1loopBody1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetKeyActor, 1, KeyRangeLocationInfo >::remove(); + + } + void a_callback_fire(ActorCallback< GetKeyActor, 1, KeyRangeLocationInfo >*,KeyRangeLocationInfo const& value) + { + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when1(value, 0); + a_body1cont1loopBody1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetKeyActor, 1, KeyRangeLocationInfo >*,KeyRangeLocationInfo && value) { - fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1cont1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< WaitForCommittedVersionActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< GetKeyActor, 1, KeyRangeLocationInfo >*,Error err) { - fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 1); } - int a_body1loopBody1when2cont1(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont6(int loopDepth) { - loopDepth = a_body1loopBody1cont2(loopDepth); + if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; } - int a_body1loopBody1when2cont1(Void && _,int loopDepth) + int a_body1cont1loopBody1cont1Catch1(const Error& e,int loopDepth=0) { - loopDepth = a_body1loopBody1cont2(loopDepth); + try { + #line 3824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (getKeyID.present()) + #line 15615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent("GetKeyDebug", getKeyID.get().first(), "NativeAPI.getKey.Error"); + #line 15619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 3826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) + #line 15623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->invalidateCache(useTenant ? trState->tenant().mapRef(&Tenant::prefix) : Optional(), k.getKey(), Reverse{ k.isBackward() }); + #line 3831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, trState->taskID); + #line 3831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 15631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1Catch1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 3831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 15636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 3833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevInfo, "GetKeyError").error(e).detail("AtKey", k.getKey()).detail("Offset", k.offset); + #line 3834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 15645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } return loopDepth; } - int a_body1loopBody1when2when1(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont7(int loopDepth) { - loopDepth = a_body1loopBody1when2cont1(_, loopDepth); + #line 3814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (getKeyID.present()) + #line 15660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent("GetKeyDebug", getKeyID.get().first(), "NativeAPI.getKey.After"); + #line 15664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 3819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + k = reply.sel; + #line 3820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!k.offset && k.orEqual) + #line 15670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(k.getKey()); this->~GetKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 15674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key(k.getKey()); + this->~GetKeyActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1cont1loopBody1cont15(loopDepth); return loopDepth; } - int a_body1loopBody1when2when1(Void && _,int loopDepth) + int a_body1cont1loopBody1cont1Catch2(const Error& __current_error,int loopDepth=0) { - loopDepth = a_body1loopBody1when2cont1(std::move(_), loopDepth); + try { + #line 3811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++trState->cx->transactionPhysicalReadsCompleted; + #line 3812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1cont1loopBody1cont1Catch1(__current_error, loopDepth); + #line 15691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + catch (Error& error) { + loopDepth = a_body1cont1loopBody1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1loopBody1cont1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - void a_exitChoose2() + int a_body1cont1loopBody1cont9(int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WaitForCommittedVersionActor, 2, Void >::remove(); + #line 3809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++trState->cx->transactionPhysicalReadsCompleted; + #line 15705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont11(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont1when1(Void const& _,int loopDepth) + { + #line 3796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1cont1loopBody1cont1Catch2(transaction_too_old(), loopDepth); + #line 15714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return loopDepth; } - void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 2, Void >*,Void const& value) + int a_body1cont1loopBody1cont1when1(Void && _,int loopDepth) { - fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 2); - a_exitChoose2(); + #line 3796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1cont1loopBody1cont1Catch2(transaction_too_old(), loopDepth); + #line 15722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + + return loopDepth; + } + int a_body1cont1loopBody1cont1when2(GetKeyReply const& _reply,int loopDepth) + { + #line 3806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + reply = _reply; + #line 15730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont9(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont1when2(GetKeyReply && _reply,int loopDepth) + { + #line 3806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + reply = _reply; + #line 15739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont9(loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetKeyActor, 2, Void >::remove(); + static_cast(this)->ActorCallback< GetKeyActor, 3, GetKeyReply >::remove(); + + } + void a_callback_fire(ActorCallback< GetKeyActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1when2when1(value, 0); + a_body1cont1loopBody1cont1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1cont1Catch2(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetKeyActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 2); - a_exitChoose2(); + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1when2when1(std::move(value), 0); + a_body1cont1loopBody1cont1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1cont1Catch2(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< WaitForCommittedVersionActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< GetKeyActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 2); - a_exitChoose2(); + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1Catch1(err, 0); + a_body1cont1loopBody1cont1Catch2(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1cont1Catch2(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 1, GetReadVersionReply >*,GetReadVersionReply const& value) + void a_callback_fire(ActorCallback< GetKeyActor, 3, GetKeyReply >*,GetKeyReply const& value) { - fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 1); - a_exitChoose1(); + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 3); + a_exitChoose3(); try { - a_body1loopBody1when2(value, 0); + a_body1cont1loopBody1cont1when2(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1cont1Catch2(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 1, GetReadVersionReply >*,GetReadVersionReply && value) + void a_callback_fire(ActorCallback< GetKeyActor, 3, GetKeyReply >*,GetKeyReply && value) { - fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 1); - a_exitChoose1(); + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 3); + a_exitChoose3(); try { - a_body1loopBody1when2(std::move(value), 0); + a_body1cont1loopBody1cont1when2(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1cont1Catch2(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< WaitForCommittedVersionActor, 1, GetReadVersionReply >*,Error err) + void a_callback_error(ActorCallback< GetKeyActor, 3, GetKeyReply >*,Error err) { - fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 1); - a_exitChoose1(); + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 3); + a_exitChoose3(); try { - a_body1loopBody1Catch1(err, 0); + a_body1cont1loopBody1cont1Catch2(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1cont1Catch2(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1cont1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 3); } - int a_body1loopBody1cont3(int loopDepth) + int a_body1cont1loopBody1cont11(int loopDepth) { try { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont1loopBody1cont7(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1cont1loopBody1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1loopBody1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1loopBody1cont15(int loopDepth) + { + try { + loopDepth = a_body1cont1loopBody1cont6(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); @@ -14799,76 +15864,76 @@ class WaitForCommittedVersionActorState { return loopDepth; } - int a_body1loopBody1Catch1cont1(int loopDepth) + int a_body1cont1loopBody1cont1Catch1cont1(int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont1loopBody1cont6(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont2(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont1Catch1cont3(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + loopDepth = a_body1cont1loopBody1cont1Catch1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont2(Void && _,int loopDepth) + int a_body1cont1loopBody1cont1Catch1cont3(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + loopDepth = a_body1cont1loopBody1cont1Catch1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont2(_, loopDepth); + loopDepth = a_body1cont1loopBody1cont1Catch1cont3(_, loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1cont1loopBody1cont1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont1loopBody1cont1Catch1cont3(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose3() + void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WaitForCommittedVersionActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetKeyActor, 4, Void >::remove(); } - void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetKeyActor, 4, Void >*,Void const& value) { - fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 3); - a_exitChoose3(); + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 4); + a_exitChoose4(); try { - a_body1loopBody1Catch1when1(value, 0); + a_body1cont1loopBody1cont1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetKeyActor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 3); - a_exitChoose3(); + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 4); + a_exitChoose4(); try { - a_body1loopBody1Catch1when1(std::move(value), 0); + a_body1cont1loopBody1cont1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< WaitForCommittedVersionActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< GetKeyActor, 4, Void >*,Error err) { - fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 3); - a_exitChoose3(); + fdb_probe_actor_enter("getKey", reinterpret_cast(this), 4); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -14877,47 +15942,58 @@ class WaitForCommittedVersionActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getKey", reinterpret_cast(this), 4); } - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Database cx; - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SpanID spanContext; - #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference trState; + #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeySelector k; + #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + UseTenant useTenant; + #line 3740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional getKeyID; + #line 3741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional readOptions; + #line 3743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 14891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRangeLocationInfo locationInfo; + #line 3771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + VersionVector ssLatestCommitVersions; + #line 3792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetKeyReply reply; + #line 15966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via waitForCommittedVersion() - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class WaitForCommittedVersionActor final : public Actor, public ActorCallback< WaitForCommittedVersionActor, 0, Void >, public ActorCallback< WaitForCommittedVersionActor, 1, GetReadVersionReply >, public ActorCallback< WaitForCommittedVersionActor, 2, Void >, public ActorCallback< WaitForCommittedVersionActor, 3, Void >, public FastAllocated, public WaitForCommittedVersionActorState { - #line 14896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via getKey() + #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetKeyActor final : public Actor, public ActorCallback< GetKeyActor, 0, Void >, public ActorCallback< GetKeyActor, 1, KeyRangeLocationInfo >, public ActorCallback< GetKeyActor, 2, Void >, public ActorCallback< GetKeyActor, 3, GetKeyReply >, public ActorCallback< GetKeyActor, 4, Void >, public FastAllocated, public GetKeyActorState { + #line 15971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< WaitForCommittedVersionActor, 0, Void >; -friend struct ActorCallback< WaitForCommittedVersionActor, 1, GetReadVersionReply >; -friend struct ActorCallback< WaitForCommittedVersionActor, 2, Void >; -friend struct ActorCallback< WaitForCommittedVersionActor, 3, Void >; - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WaitForCommittedVersionActor(Database const& cx,Version const& version,SpanID const& spanContext) - #line 14910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - WaitForCommittedVersionActorState(cx, version, spanContext) +friend struct ActorCallback< GetKeyActor, 0, Void >; +friend struct ActorCallback< GetKeyActor, 1, KeyRangeLocationInfo >; +friend struct ActorCallback< GetKeyActor, 2, Void >; +friend struct ActorCallback< GetKeyActor, 3, GetKeyReply >; +friend struct ActorCallback< GetKeyActor, 4, Void >; + #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetKeyActor(Reference const& trState,KeySelector const& k,UseTenant const& useTenant = UseTenant::True) + #line 15986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + GetKeyActorState(trState, k, useTenant) { - fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), -1); + fdb_probe_actor_enter("getKey", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("waitForCommittedVersion"); + this->lineage.setActorName("getKey"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), -1); + fdb_probe_actor_exit("getKey", reinterpret_cast(this), -1); } void cancel() override @@ -14925,55 +16001,60 @@ friend struct ActorCallback< WaitForCommittedVersionActor, 3, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< WaitForCommittedVersionActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< WaitForCommittedVersionActor, 2, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< WaitForCommittedVersionActor, 3, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetKeyActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetKeyActor, 1, KeyRangeLocationInfo >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetKeyActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< GetKeyActor, 4, Void >*)0, actor_cancelled()); break; } } }; } - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future waitForCommittedVersion( Database const& cx, Version const& version, SpanID const& spanContext ) { - #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new WaitForCommittedVersionActor(cx, version, spanContext)); - #line 14940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getKey( Reference const& trState, KeySelector const& k, UseTenant const& useTenant = UseTenant::True ) { + #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetKeyActor(trState, k, useTenant)); + #line 16017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 3610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 3839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 14945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 16022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via getRawVersion() - #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetRawVersionActorState { - #line 14952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via waitForCommittedVersion() + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class WaitForCommittedVersionActorState { + #line 16029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetRawVersionActorState(Reference const& trState) - #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : trState(trState), - #line 3612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:getRawVersion"_loc, { trState->spanID }) - #line 14961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WaitForCommittedVersionActorState(Database const& cx,Version const& version,SpanContext const& spanContext) + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version), + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + spanContext(spanContext), + #line 3841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:waitForCommittedVersion"_loc, spanContext) + #line 16042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("getRawVersion", reinterpret_cast(this)); + fdb_probe_actor_create("waitForCommittedVersion", reinterpret_cast(this)); } - ~GetRawVersionActorState() + ~WaitForCommittedVersionActorState() { - fdb_probe_actor_destroy("getRawVersion", reinterpret_cast(this)); + fdb_probe_actor_destroy("waitForCommittedVersion", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 3613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 14976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 16057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -14986,8 +16067,8 @@ class GetRawVersionActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~GetRawVersionActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~WaitForCommittedVersionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; @@ -15001,23 +16082,30 @@ class GetRawVersionActorState { } int a_body1loopBody1(int loopDepth) { - #line 3615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = trState->cx->onProxiesChanged(); - #line 3614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 15008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 3616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = basicLoadBalance(trState->cx->getGrvProxies(UseProvisionalProxies::False), &GrvProxyInterface::getConsistentReadVersion, GetReadVersionRequest(trState->spanID, 0, TransactionPriority::IMMEDIATE, trState->cx->ssVersionVectorCache.getMaxVersion()), trState->cx->taskID); - #line 15012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 3615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + try { + #line 3845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = cx->onProxiesChanged(); + #line 3844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 16090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + #line 3846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = basicLoadBalance( cx->getGrvProxies(UseProvisionalProxies::False), &GrvProxyInterface::getConsistentReadVersion, GetReadVersionRequest( span.context, 0, TransactionPriority::IMMEDIATE, cx->ssVersionVectorCache.getMaxVersion()), cx->taskID); + #line 16094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 3845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 16101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } return loopDepth; } @@ -15027,120 +16115,701 @@ class GetRawVersionActorState { return loopDepth; } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 3870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_batch_transaction_throttled || e.code() == error_code_grv_proxy_memory_limit_exceeded) + #line 16123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = delayJittered(CLIENT_KNOBS->GRV_ERROR_RETRY_DELAY); + #line 3873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 16129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 3873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 16134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 3875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevError, "WaitForCommittedVersionError").error(e); + #line 3876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 16143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } int a_body1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } int a_body1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } int a_body1loopBody1when2(GetReadVersionReply const& v,int loopDepth) { - #line 3624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->cx->versionVectorCacheActive(v.ssVersionVectorDelta)) - #line 15046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->minAcceptableReadVersion = std::min(cx->minAcceptableReadVersion, v.version); + #line 3853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (v.midShardSize > 0) + #line 16178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->cx->isCurrentGrvProxy(v.proxyId)) - #line 15050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->smoothMidShardSize.setTotal(v.midShardSize); + #line 16182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 3855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (cx->versionVectorCacheActive(v.ssVersionVectorDelta)) + #line 16186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (cx->isCurrentGrvProxy(v.proxyId)) + #line 16190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->ssVersionVectorCache.applyDelta(v.ssVersionVectorDelta); - #line 15054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->ssVersionVectorCache.applyDelta(v.ssVersionVectorDelta); + #line 16194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 3628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->ssVersionVectorCache.clear(); - #line 15060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->ssVersionVectorCache.clear(); + #line 16200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(v.version); this->~GetRawVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 15065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Version >::value()) Version(v.version); - this->~GetRawVersionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 3862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (v.version >= version) + #line 16205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(v.version); this->~WaitForCommittedVersionActorState(); static_cast(this)->destroy(); return 0; } + #line 16209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(v.version); + this->~WaitForCommittedVersionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 3866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, cx->taskID); + #line 3866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 16219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1when2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 3866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 16224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } int a_body1loopBody1when2(GetReadVersionReply && v,int loopDepth) { - #line 3624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->cx->versionVectorCacheActive(v.ssVersionVectorDelta)) - #line 15077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->minAcceptableReadVersion = std::min(cx->minAcceptableReadVersion, v.version); + #line 3853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (v.midShardSize > 0) + #line 16235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->cx->isCurrentGrvProxy(v.proxyId)) - #line 15081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->smoothMidShardSize.setTotal(v.midShardSize); + #line 16239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 3855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (cx->versionVectorCacheActive(v.ssVersionVectorDelta)) + #line 16243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (cx->isCurrentGrvProxy(v.proxyId)) + #line 16247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->ssVersionVectorCache.applyDelta(v.ssVersionVectorDelta); - #line 15085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->ssVersionVectorCache.applyDelta(v.ssVersionVectorDelta); + #line 16251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 3628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->ssVersionVectorCache.clear(); - #line 15091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->ssVersionVectorCache.clear(); + #line 16257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(v.version); this->~GetRawVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 15096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Version >::value()) Version(v.version); - this->~GetRawVersionActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 3862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (v.version >= version) + #line 16262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(v.version); this->~WaitForCommittedVersionActorState(); static_cast(this)->destroy(); return 0; } + #line 16266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(v.version); + this->~WaitForCommittedVersionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 3866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, cx->taskID); + #line 3866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 16276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1when2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 3866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 16281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRawVersionActor, 0, Void >::remove(); - static_cast(this)->ActorCallback< GetRawVersionActor, 1, GetReadVersionReply >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WaitForCommittedVersionActor, 0, Void >::remove(); + static_cast(this)->ActorCallback< WaitForCommittedVersionActor, 1, GetReadVersionReply >::remove(); } - void a_callback_fire(ActorCallback< GetRawVersionActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("getRawVersion", reinterpret_cast(this), 0); + fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRawVersion", reinterpret_cast(this), 0); + fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetRawVersionActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("getRawVersion", reinterpret_cast(this), 0); + fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRawVersion", reinterpret_cast(this), 0); + fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetRawVersionActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< WaitForCommittedVersionActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("getRawVersion", reinterpret_cast(this), 0); + fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 0); + + } + int a_body1loopBody1when2cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1when2cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1when2cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WaitForCommittedVersionActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1loopBody1when2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1loopBody1when2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< WaitForCommittedVersionActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 1, GetReadVersionReply >*,GetReadVersionReply const& value) + { + fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1loopBody1when2(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 1, GetReadVersionReply >*,GetReadVersionReply && value) + { + fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1loopBody1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< WaitForCommittedVersionActor, 1, GetReadVersionReply >*,Error err) + { + fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont3(int loopDepth) + { + try { + loopDepth = a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont2(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont2(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WaitForCommittedVersionActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 3); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< WaitForCommittedVersionActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 3); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< WaitForCommittedVersionActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), 3); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), 3); + + } + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database cx; + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SpanContext spanContext; + #line 3841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Span span; + #line 16560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via waitForCommittedVersion() + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class WaitForCommittedVersionActor final : public Actor, public ActorCallback< WaitForCommittedVersionActor, 0, Void >, public ActorCallback< WaitForCommittedVersionActor, 1, GetReadVersionReply >, public ActorCallback< WaitForCommittedVersionActor, 2, Void >, public ActorCallback< WaitForCommittedVersionActor, 3, Void >, public FastAllocated, public WaitForCommittedVersionActorState { + #line 16565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< WaitForCommittedVersionActor, 0, Void >; +friend struct ActorCallback< WaitForCommittedVersionActor, 1, GetReadVersionReply >; +friend struct ActorCallback< WaitForCommittedVersionActor, 2, Void >; +friend struct ActorCallback< WaitForCommittedVersionActor, 3, Void >; + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WaitForCommittedVersionActor(Database const& cx,Version const& version,SpanContext const& spanContext) + #line 16579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + WaitForCommittedVersionActorState(cx, version, spanContext) + { + fdb_probe_actor_enter("waitForCommittedVersion", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("waitForCommittedVersion"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("waitForCommittedVersion", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< WaitForCommittedVersionActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WaitForCommittedVersionActor, 2, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< WaitForCommittedVersionActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future waitForCommittedVersion( Database const& cx, Version const& version, SpanContext const& spanContext ) { + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new WaitForCommittedVersionActor(cx, version, spanContext)); + #line 16609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 3881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 16614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via getRawVersion() + #line 3882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 3882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetRawVersionActorState { + #line 16621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 3882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetRawVersionActorState(Reference const& trState) + #line 3882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : trState(trState), + #line 3883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:getRawVersion"_loc, trState->spanContext) + #line 16630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("getRawVersion", reinterpret_cast(this)); + + } + ~GetRawVersionActorState() + { + fdb_probe_actor_destroy("getRawVersion", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 3884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 16645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetRawVersionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 3886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = trState->cx->onProxiesChanged(); + #line 3885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 16677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + #line 3887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = basicLoadBalance(trState->cx->getGrvProxies(UseProvisionalProxies::False), &GrvProxyInterface::getConsistentReadVersion, GetReadVersionRequest(trState->spanContext, 0, TransactionPriority::IMMEDIATE, trState->cx->ssVersionVectorCache.getMaxVersion()), trState->cx->taskID); + #line 16681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 3886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 16688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2(GetReadVersionReply const& v,int loopDepth) + { + #line 3895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->cx->versionVectorCacheActive(v.ssVersionVectorDelta)) + #line 16715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->cx->isCurrentGrvProxy(v.proxyId)) + #line 16719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->ssVersionVectorCache.applyDelta(v.ssVersionVectorDelta); + #line 16723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + #line 3899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->ssVersionVectorCache.clear(); + #line 16729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 3902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(v.version); this->~GetRawVersionActorState(); static_cast(this)->destroy(); return 0; } + #line 16734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(v.version); + this->~GetRawVersionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1when2(GetReadVersionReply && v,int loopDepth) + { + #line 3895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->cx->versionVectorCacheActive(v.ssVersionVectorDelta)) + #line 16746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->cx->isCurrentGrvProxy(v.proxyId)) + #line 16750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 3897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->ssVersionVectorCache.applyDelta(v.ssVersionVectorDelta); + #line 16754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + #line 3899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->ssVersionVectorCache.clear(); + #line 16760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 3902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(v.version); this->~GetRawVersionActorState(); static_cast(this)->destroy(); return 0; } + #line 16765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(v.version); + this->~GetRawVersionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetRawVersionActor, 0, Void >::remove(); + static_cast(this)->ActorCallback< GetRawVersionActor, 1, GetReadVersionReply >::remove(); + + } + void a_callback_fire(ActorCallback< GetRawVersionActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getRawVersion", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRawVersion", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetRawVersionActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getRawVersion", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRawVersion", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetRawVersionActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getRawVersion", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -15198,16 +16867,16 @@ class GetRawVersionActorState { fdb_probe_actor_exit("getRawVersion", reinterpret_cast(this), 1); } - #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 3612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 15205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 16874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getRawVersion() - #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetRawVersionActor final : public Actor, public ActorCallback< GetRawVersionActor, 0, Void >, public ActorCallback< GetRawVersionActor, 1, GetReadVersionReply >, public FastAllocated, public GetRawVersionActorState { - #line 15210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 16879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -15217,9 +16886,9 @@ class GetRawVersionActor final : public Actor, public ActorCallback< Ge #pragma clang diagnostic pop friend struct ActorCallback< GetRawVersionActor, 0, Void >; friend struct ActorCallback< GetRawVersionActor, 1, GetReadVersionReply >; - #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetRawVersionActor(Reference const& trState) - #line 15222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 16891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), GetRawVersionActorState(trState) { @@ -15243,41 +16912,41 @@ friend struct ActorCallback< GetRawVersionActor, 1, GetReadVersionReply >; } }; } - #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future getRawVersion( Reference const& trState ) { - #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new GetRawVersionActor(trState)); - #line 15250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 16919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 3636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 3907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 15255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 16924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" [[nodiscard]] Future readVersionBatcher( DatabaseContext* const& cx, FutureStream, Optional>> const& versionStream, uint32_t const& flags ); -#line 3641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 3912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 15260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 16929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via watchValue() - #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class WatchValueActorState { - #line 15267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 16936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" WatchValueActorState(Database const& cx,Reference const& parameters) - #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" parameters(parameters), - #line 3643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:watchValue"_loc, parameters->spanID), - #line 3644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:watchValue"_loc, parameters->spanContext), + #line 3915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ver(parameters->version) - #line 15280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 16949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("watchValue", reinterpret_cast(this)); @@ -15290,13 +16959,13 @@ class WatchValueActorState { int a_body1(int loopDepth=0) { try { - #line 3645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->validateVersion(parameters->version); - #line 3646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(parameters->version != latestVersion); - #line 3648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 15299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 16968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -15324,16 +16993,16 @@ class WatchValueActorState { } int a_body1loopBody1(int loopDepth) { - #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = getKeyLocation(cx, parameters->tenant.name, parameters->key, &StorageServerInterface::watchValue, parameters->spanID, parameters->debugID, parameters->useProvisionalProxies, Reverse::False, parameters->version); - #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = getKeyLocation(cx, parameters->tenant, parameters->key, &StorageServerInterface::watchValue, parameters->spanContext, parameters->debugID, parameters->useProvisionalProxies, Reverse::False, parameters->version); + #line 3920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 15331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -15341,38 +17010,38 @@ class WatchValueActorState { int a_body1loopBody1cont1(int loopDepth) { try { - #line 3660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" watchValueID = Optional(); - #line 3661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (parameters->debugID.present()) - #line 15348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" watchValueID = nondeterministicRandom()->randomUniqueID(); - #line 3664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addAttach( "WatchValueAttachID", parameters->debugID.get().first(), watchValueID.get().first()); - #line 3666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent("WatchValueDebug", watchValueID.get().first(), "NativeAPI.watchValue.Before"); - #line 15356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" resp = WatchValueReply(); - #line 3672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = loadBalance(cx.getPtr(), locationInfo.locations, &StorageServerInterface::watchValue, WatchValueRequest(span.context, parameters->tenant, parameters->key, parameters->value, ver, cx->sampleReadTags() ? parameters->tags : Optional(), watchValueID), TaskPriority::DefaultPromiseEndpoint); - #line 3671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 15364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; - #line 3686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = cx->connectionRecord ? cx->connectionRecord->onChange() : Never(); - #line 15368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -15385,9 +17054,9 @@ class WatchValueActorState { } int a_body1loopBody1when1(KeyRangeLocationInfo const& __locationInfo,int loopDepth) { - #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" locationInfo = __locationInfo; - #line 15390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -15459,104 +17128,81 @@ class WatchValueActorState { int a_body1loopBody1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 3706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) - #line 15464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(locationInfo.tenantEntry.prefix, parameters->key); - #line 3708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache(parameters->tenant.prefix, parameters->key); + #line 3978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_5 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, parameters->taskID); - #line 3708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 15472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 3708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - #line 3709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_unknown_tenant) - #line 15484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_watch_cancelled || e.code() == error_code_process_behind) + #line 17153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(parameters->tenant.name.present()); - #line 3711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCachedTenant(parameters->tenant.name.get()); - #line 3712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_6 = delay(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, parameters->taskID); - #line 3712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(e.code() == error_code_watch_cancelled, "Too many watches on the storage server, poll for changes instead"); + #line 3982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(e.code() == error_code_process_behind, "The storage servers are all behind", probe::decoration::rare); + #line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_6 = delay(CLIENT_KNOBS->WATCH_POLLING_TIME, parameters->taskID); + #line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 15494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when2(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 3712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_watch_cancelled || e.code() == error_code_process_behind) - #line 15506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_timed_out) + #line 17175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(e.code() == error_code_watch_cancelled); - #line 3716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(e.code() == error_code_process_behind); - #line 3718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_7 = delay(CLIENT_KNOBS->WATCH_POLLING_TIME, parameters->taskID); - #line 3718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "A watch timed out"); + #line 3988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_7 = delay(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, parameters->taskID); + #line 3988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 15516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when3(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 3718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - #line 3719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_timed_out) - #line 15528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 3721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 3722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_8 = delay(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, parameters->taskID); - #line 3722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 15536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when4(__when_expr_8.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 8; - #line 3722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 3724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - err = e; - #line 3725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_9 = delay(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, parameters->taskID); - #line 3725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 15552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when5(__when_expr_9.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 9; - #line 3725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_9.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } + #line 3990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + err = e; + #line 3991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_8 = delay(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, parameters->taskID); + #line 3991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 17199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when4(__when_expr_8.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 8; + #line 3991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 17204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } } } @@ -15571,74 +17217,74 @@ class WatchValueActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 3690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (watchValueID.present()) - #line 15576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent("WatchValueDebug", watchValueID.get().first(), "NativeAPI.watchValue.After"); - #line 15580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_4 = waitForCommittedVersion(cx, resp.version, span.context); - #line 3697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 15586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1cont1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 3697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1when1(WatchValueReply const& r,int loopDepth) { - #line 3684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" resp = r; - #line 15600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } int a_body1loopBody1cont1when1(WatchValueReply && r,int loopDepth) { - #line 3684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" resp = r; - #line 15609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } int a_body1loopBody1cont1when2(Void const& _,int loopDepth) { - #line 3687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = Never(); - #line 3687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 15620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont1when2when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 3687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1when2(Void && _,int loopDepth) { - #line 3687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = Never(); - #line 3687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 15636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont1when2when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 3687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 15641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -15817,42 +17463,42 @@ class WatchValueActorState { } int a_body1loopBody1cont5(Version const& v,int loopDepth) { - #line 3701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (v - resp.version < 50000000) - #line 15822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(resp.version); this->~WatchValueActorState(); static_cast(this)->destroy(); return 0; } - #line 15826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Version >::value()) Version(resp.version); this->~WatchValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ver = v; - #line 15834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont9(loopDepth); return loopDepth; } int a_body1loopBody1cont5(Version && v,int loopDepth) { - #line 3701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (v - resp.version < 50000000) - #line 15843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(resp.version); this->~WatchValueActorState(); static_cast(this)->destroy(); return 0; } - #line 15847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Version >::value()) Version(resp.version); this->~WatchValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ver = v; - #line 15855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont9(loopDepth); return loopDepth; @@ -16176,33 +17822,31 @@ class WatchValueActorState { fdb_probe_actor_exit("watchValue", reinterpret_cast(this), 7); } - int a_body1loopBody1cont1Catch1cont7(int loopDepth) - { - loopDepth = a_body1loopBody1cont1Catch1cont5(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1Catch1cont8(Void const& _,int loopDepth) + int a_body1loopBody1cont1Catch1cont7(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1Catch1cont7(loopDepth); + #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(err, std::max(0, loopDepth - 1)); + #line 17829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } - int a_body1loopBody1cont1Catch1cont8(Void && _,int loopDepth) + int a_body1loopBody1cont1Catch1cont7(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1Catch1cont7(loopDepth); + #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(err, std::max(0, loopDepth - 1)); + #line 17837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } int a_body1loopBody1cont1Catch1when4(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1Catch1cont8(_, loopDepth); + loopDepth = a_body1loopBody1cont1Catch1cont7(_, loopDepth); return loopDepth; } int a_body1loopBody1cont1Catch1when4(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1Catch1cont8(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont1Catch1cont7(std::move(_), loopDepth); return loopDepth; } @@ -16257,107 +17901,28 @@ class WatchValueActorState { fdb_probe_actor_exit("watchValue", reinterpret_cast(this), 8); } - int a_body1loopBody1cont1Catch1cont9(Void const& _,int loopDepth) - { - #line 3726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(err, std::max(0, loopDepth - 1)); - #line 16264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - - return loopDepth; - } - int a_body1loopBody1cont1Catch1cont9(Void && _,int loopDepth) - { - #line 3726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(err, std::max(0, loopDepth - 1)); - #line 16272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - - return loopDepth; - } - int a_body1loopBody1cont1Catch1when5(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1Catch1cont9(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1Catch1when5(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1Catch1cont9(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose9() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WatchValueActor, 9, Void >::remove(); - - } - void a_callback_fire(ActorCallback< WatchValueActor, 9, Void >*,Void const& value) - { - fdb_probe_actor_enter("watchValue", reinterpret_cast(this), 9); - a_exitChoose9(); - try { - a_body1loopBody1cont1Catch1when5(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("watchValue", reinterpret_cast(this), 9); - - } - void a_callback_fire(ActorCallback< WatchValueActor, 9, Void >*,Void && value) - { - fdb_probe_actor_enter("watchValue", reinterpret_cast(this), 9); - a_exitChoose9(); - try { - a_body1loopBody1cont1Catch1when5(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("watchValue", reinterpret_cast(this), 9); - - } - void a_callback_error(ActorCallback< WatchValueActor, 9, Void >*,Error err) - { - fdb_probe_actor_enter("watchValue", reinterpret_cast(this), 9); - a_exitChoose9(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("watchValue", reinterpret_cast(this), 9); - - } - #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference parameters; - #line 3643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 3644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Version ver; - #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRangeLocationInfo locationInfo; - #line 3660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional watchValueID; - #line 3670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" WatchValueReply resp; - #line 3724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Error err; - #line 16355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via watchValue() - #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class WatchValueActor final : public Actor, public ActorCallback< WatchValueActor, 0, KeyRangeLocationInfo >, public ActorCallback< WatchValueActor, 1, WatchValueReply >, public ActorCallback< WatchValueActor, 2, Void >, public ActorCallback< WatchValueActor, 3, Void >, public ActorCallback< WatchValueActor, 4, Version >, public ActorCallback< WatchValueActor, 5, Void >, public ActorCallback< WatchValueActor, 6, Void >, public ActorCallback< WatchValueActor, 7, Void >, public ActorCallback< WatchValueActor, 8, Void >, public ActorCallback< WatchValueActor, 9, Void >, public FastAllocated, public WatchValueActorState { - #line 16360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 3913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class WatchValueActor final : public Actor, public ActorCallback< WatchValueActor, 0, KeyRangeLocationInfo >, public ActorCallback< WatchValueActor, 1, WatchValueReply >, public ActorCallback< WatchValueActor, 2, Void >, public ActorCallback< WatchValueActor, 3, Void >, public ActorCallback< WatchValueActor, 4, Version >, public ActorCallback< WatchValueActor, 5, Void >, public ActorCallback< WatchValueActor, 6, Void >, public ActorCallback< WatchValueActor, 7, Void >, public ActorCallback< WatchValueActor, 8, Void >, public FastAllocated, public WatchValueActorState { + #line 17925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -16374,10 +17939,9 @@ friend struct ActorCallback< WatchValueActor, 5, Void >; friend struct ActorCallback< WatchValueActor, 6, Void >; friend struct ActorCallback< WatchValueActor, 7, Void >; friend struct ActorCallback< WatchValueActor, 8, Void >; -friend struct ActorCallback< WatchValueActor, 9, Void >; - #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" WatchValueActor(Database const& cx,Reference const& parameters) - #line 16380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), WatchValueActorState(cx, parameters) { @@ -16403,40 +17967,39 @@ friend struct ActorCallback< WatchValueActor, 9, Void >; case 6: this->a_callback_error((ActorCallback< WatchValueActor, 6, Void >*)0, actor_cancelled()); break; case 7: this->a_callback_error((ActorCallback< WatchValueActor, 7, Void >*)0, actor_cancelled()); break; case 8: this->a_callback_error((ActorCallback< WatchValueActor, 8, Void >*)0, actor_cancelled()); break; - case 9: this->a_callback_error((ActorCallback< WatchValueActor, 9, Void >*)0, actor_cancelled()); break; } } }; } - #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future watchValue( Database const& cx, Reference const& parameters ) { - #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new WatchValueActor(cx, parameters)); - #line 16416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 3731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 3997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 16421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via watchStorageServerResp() - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class WatchStorageServerRespActorState { - #line 16428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 17991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" WatchStorageServerRespActorState(int64_t const& tenantId,Key const& key,Database const& cx) - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : tenantId(tenantId), - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" key(key), - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx(cx) - #line 16439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("watchStorageServerResp", reinterpret_cast(this)); @@ -16449,9 +18012,9 @@ class WatchStorageServerRespActorState { int a_body1(int loopDepth=0) { try { - #line 3733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 16454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -16480,30 +18043,30 @@ class WatchStorageServerRespActorState { int a_body1loopBody1(int loopDepth) { try { - #line 3735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" metadata = cx->getWatchMetadata(tenantId, key); - #line 3736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!metadata.isValid()) - #line 16487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WatchStorageServerRespActorState(); static_cast(this)->destroy(); return 0; } - #line 16491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WatchStorageServerRespActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = watchValue(cx, metadata->parameters); - #line 3739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 16501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 16506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -16523,23 +18086,23 @@ class WatchStorageServerRespActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 3761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_operation_cancelled) - #line 16528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 16532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference metadata = cx->getWatchMetadata(tenantId, key); - #line 3766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!metadata.isValid()) - #line 16538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WatchStorageServerRespActorState(); static_cast(this)->destroy(); return 0; } - #line 16542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WatchStorageServerRespActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16547,15 +18110,15 @@ class WatchStorageServerRespActorState { } else { - #line 3768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (metadata->watchPromise.getFutureReferenceCount() == 1) - #line 16552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->deleteWatchMetadata(tenantId, key); - #line 3770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WatchStorageServerRespActorState(); static_cast(this)->destroy(); return 0; } - #line 16558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WatchStorageServerRespActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -16563,21 +18126,21 @@ class WatchStorageServerRespActorState { } else { - #line 3771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_future_version) - #line 16568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { return a_body1loopHead1(loopDepth); // continue } } } - #line 3774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->deleteWatchMetadata(tenantId, key); - #line 3775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" metadata->watchPromise.sendError(e); - #line 3776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 16580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); @@ -16589,46 +18152,46 @@ class WatchStorageServerRespActorState { } int a_body1loopBody1cont2(Version const& watchVersion,int loopDepth) { - #line 3741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" metadata = cx->getWatchMetadata(tenantId, key); - #line 3742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!metadata.isValid()) - #line 16596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WatchStorageServerRespActorState(); static_cast(this)->destroy(); return 0; } - #line 16600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WatchStorageServerRespActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (watchVersion >= metadata->parameters->version) - #line 16608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->deleteWatchMetadata(tenantId, key); - #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (metadata->watchPromise.canBeSet()) - #line 16614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" metadata->watchPromise.send(watchVersion); - #line 16618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } else { - #line 3753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 3756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "ABA issue where the version returned from the server is less than the version in the map"); + #line 4023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (metadata->watchPromise.getFutureReferenceCount() == 1) - #line 16627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->deleteWatchMetadata(tenantId, key); - #line 16631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } loopDepth = a_body1loopBody1cont10(loopDepth); @@ -16637,46 +18200,46 @@ class WatchStorageServerRespActorState { } int a_body1loopBody1cont2(Version && watchVersion,int loopDepth) { - #line 3741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" metadata = cx->getWatchMetadata(tenantId, key); - #line 3742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!metadata.isValid()) - #line 16644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WatchStorageServerRespActorState(); static_cast(this)->destroy(); return 0; } - #line 16648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WatchStorageServerRespActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (watchVersion >= metadata->parameters->version) - #line 16656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->deleteWatchMetadata(tenantId, key); - #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (metadata->watchPromise.canBeSet()) - #line 16662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" metadata->watchPromise.send(watchVersion); - #line 16666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } else { - #line 3753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 3756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "ABA issue where the version returned from the server is less than the version in the map"); + #line 4023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (metadata->watchPromise.getFutureReferenceCount() == 1) - #line 16675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->deleteWatchMetadata(tenantId, key); - #line 16679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } loopDepth = a_body1loopBody1cont10(loopDepth); @@ -16759,20 +18322,20 @@ class WatchStorageServerRespActorState { return loopDepth; } - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t tenantId; - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key key; - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 3735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference metadata; - #line 16770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via watchStorageServerResp() - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class WatchStorageServerRespActor final : public Actor, public ActorCallback< WatchStorageServerRespActor, 0, Version >, public FastAllocated, public WatchStorageServerRespActorState { - #line 16775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -16781,9 +18344,9 @@ class WatchStorageServerRespActor final : public Actor, public ActorCallba void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< WatchStorageServerRespActor, 0, Version >; - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" WatchStorageServerRespActor(int64_t const& tenantId,Key const& key,Database const& cx) - #line 16786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), WatchStorageServerRespActorState(tenantId, key, cx) { @@ -16807,34 +18370,34 @@ friend struct ActorCallback< WatchStorageServerRespActor, 0, Version >; } }; } - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future watchStorageServerResp( int64_t const& tenantId, Key const& key, Database const& cx ) { - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new WatchStorageServerRespActor(tenantId, key, cx)); - #line 16814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 3780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 4047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 16819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via sameVersionDiffValue() - #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class SameVersionDiffValueActorState { - #line 16826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" SameVersionDiffValueActorState(Database const& cx,Reference const& parameters) - #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" parameters(parameters), - #line 3782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr(cx, parameters->tenant.name) - #line 16837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr(cx, parameters->tenant.hasTenant() ? makeReference(parameters->tenant.tenantId) : Optional>()) + #line 18400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("sameVersionDiffValue", reinterpret_cast(this)); @@ -16847,9 +18410,9 @@ class SameVersionDiffValueActorState { int a_body1(int loopDepth=0) { try { - #line 3783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 16852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -16878,24 +18441,24 @@ class SameVersionDiffValueActorState { int a_body1loopBody1(int loopDepth) { try { - #line 3785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!parameters->tenant.name.present()) - #line 16883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!parameters->tenant.hasTenant()) + #line 18446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 16887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture> __when_expr_0 = tr.get(parameters->key); - #line 3789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 16893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 16898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -16915,16 +18478,16 @@ class SameVersionDiffValueActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 3817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = tr.onError(e); - #line 3817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 16922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 3817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 16927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -16937,63 +18500,63 @@ class SameVersionDiffValueActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 3790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference metadata = cx->getWatchMetadata(parameters->tenant.tenantId, parameters->key); - #line 3793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (metadata.isValid() && valSS != metadata->parameters->value) - #line 16944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->deleteWatchMetadata(parameters->tenant.tenantId, parameters->key); - #line 3796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" metadata->watchPromise.send(parameters->version); - #line 3797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" metadata->watchFutureSS.cancel(); - #line 16952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (valSS == parameters->value && tr.getTransactionState()->tenantId == parameters->tenant.tenantId) - #line 16956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (valSS == parameters->value && tr.getTransactionState()->tenantId() == parameters->tenant.tenantId) + #line 18519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" metadata = makeReference(parameters); - #line 3803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->setWatchMetadata(metadata); - #line 3805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" metadata->watchFutureSS = watchStorageServerResp(parameters->tenant.tenantId, parameters->key, cx); - #line 16964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (valSS != parameters->value) - #line 16968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SameVersionDiffValueActorState(); static_cast(this)->destroy(); return 0; } - #line 16972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SameVersionDiffValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 3813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = success(metadata->watchPromise.getFuture()); - #line 3813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 16982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 16987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1when1(Optional const& __valSS,int loopDepth) { - #line 3789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" valSS = __valSS; - #line 16996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; @@ -17058,9 +18621,9 @@ class SameVersionDiffValueActorState { } int a_body1loopBody1cont4(Void const& _,int loopDepth) { - #line 3815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SameVersionDiffValueActorState(); static_cast(this)->destroy(); return 0; } - #line 17063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SameVersionDiffValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -17070,9 +18633,9 @@ class SameVersionDiffValueActorState { } int a_body1loopBody1cont4(Void && _,int loopDepth) { - #line 3815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SameVersionDiffValueActorState(); static_cast(this)->destroy(); return 0; } - #line 17075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SameVersionDiffValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -17218,20 +18781,20 @@ class SameVersionDiffValueActorState { fdb_probe_actor_exit("sameVersionDiffValue", reinterpret_cast(this), 2); } - #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference parameters; - #line 3782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ReadYourWritesTransaction tr; - #line 3789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional valSS; - #line 17229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via sameVersionDiffValue() - #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class SameVersionDiffValueActor final : public Actor, public ActorCallback< SameVersionDiffValueActor, 0, Optional >, public ActorCallback< SameVersionDiffValueActor, 1, Void >, public ActorCallback< SameVersionDiffValueActor, 2, Void >, public FastAllocated, public SameVersionDiffValueActorState { - #line 17234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -17242,9 +18805,9 @@ class SameVersionDiffValueActor final : public Actor, public ActorCallback friend struct ActorCallback< SameVersionDiffValueActor, 0, Optional >; friend struct ActorCallback< SameVersionDiffValueActor, 1, Void >; friend struct ActorCallback< SameVersionDiffValueActor, 2, Void >; - #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" SameVersionDiffValueActor(Database const& cx,Reference const& parameters) - #line 17247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), SameVersionDiffValueActorState(cx, parameters) { @@ -17270,14 +18833,14 @@ friend struct ActorCallback< SameVersionDiffValueActor, 2, Void >; } }; } - #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future sameVersionDiffValue( Database const& cx, Reference const& parameters ) { - #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new SameVersionDiffValueActor(cx, parameters)); - #line 17277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 3821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 4092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future getWatchFuture(Database cx, Reference parameters) { Reference metadata = cx->getWatchMetadata(parameters->tenant.tenantId, parameters->key); @@ -17301,7 +18864,8 @@ Future getWatchFuture(Database cx, Reference parameters) // case 3: val_1 != val_2 && version_2 > version_1 (received watch with different value and a higher version so // recreate in SS) else if (parameters->version > metadata->parameters->version) { - TEST(true); // Setting a watch that has a different value than the one in the map but a higher version (newer) + CODE_PROBE(true, + "Setting a watch that has a different value than the one in the map but a higher version (newer)"); cx->deleteWatchMetadata(parameters->tenant.tenantId, parameters->key); metadata->watchPromise.send(parameters->version); @@ -17316,48 +18880,91 @@ Future getWatchFuture(Database cx, Reference parameters) } // case 5: val_1 != val_2 && version_1 == version_2 (received watch with different value but same version) else if (metadata->parameters->version == parameters->version) { - TEST(true); // Setting a watch which has a different value than the one in the map but the same version + CODE_PROBE(true, "Setting a watch which has a different value than the one in the map but the same version"); return sameVersionDiffValue(cx, parameters); } - TEST(true); // Setting a watch which has a different value than the one in the map but a lower version (older) + CODE_PROBE(true, "Setting a watch which has a different value than the one in the map but a lower version (older)"); // case 4: val_1 != val_2 && version_2 < version_1 return Void(); } - #line 17328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { + +// NOTE: Since an ACTOR could receive multiple exceptions for a single catch clause, e.g. broken promise together with +// operation cancelled, If the decreaseWatchRefCount is placed at the catch clause, it might be triggered for multiple +// times. One could check if the SAV isSet, but seems a more intuitive way is to use RAII-style constructor/destructor +// pair. Yet the object has to be constructed after a wait statement, so it must be trivially-constructible. This +// requires move-assignment operator implemented. +class WatchRefCountUpdater { + Database cx; + int64_t tenantID; + KeyRef key; + Version version; + +public: + WatchRefCountUpdater() = default; + + WatchRefCountUpdater(const Database& cx_, const int64_t tenantID_, KeyRef key_, const Version& ver) + : cx(cx_), tenantID(tenantID_), key(key_), version(ver) {} + + WatchRefCountUpdater& operator=(WatchRefCountUpdater&& other) { + if (cx.getReference()) { + cx->decreaseWatchRefCount(tenantID, key, version); + } + + cx = std::move(other.cx); + tenantID = std::move(other.tenantID); + key = std::move(other.key); + version = std::move(other.version); + + cx->increaseWatchRefCount(tenantID, key, version); + + return *this; + } + + ~WatchRefCountUpdater() { + if (cx.getReference()) { + cx->decreaseWatchRefCount(tenantID, key, version); + } + } +}; + +} // namespace + + #line 18935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via watchValueMap() - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class WatchValueMapActorState { - #line 17335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WatchValueMapActorState(Future const& version,TenantInfo const& tenant,Key const& key,Optional const& value,Database const& cx,TagSet const& tags,SpanID const& spanID,TaskPriority const& taskID,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies) - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WatchValueMapActorState(Future const& version,TenantInfo const& tenant,Key const& key,Optional const& value,Database const& cx,TagSet const& tags,SpanContext const& spanContext,TaskPriority const& taskID,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies) + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : version(version), - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tenant(tenant), - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" key(key), - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" value(value), - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx(cx), - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tags(tags), - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - spanID(spanID), - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + spanContext(spanContext), + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" taskID(taskID), - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" debugID(debugID), - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" useProvisionalProxies(useProvisionalProxies) - #line 17360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("watchValueMap", reinterpret_cast(this)); @@ -17370,16 +18977,16 @@ class WatchValueMapActorState { int a_body1(int loopDepth=0) { try { - #line 3878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = version; - #line 3878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 17382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 18989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -17400,25 +19007,27 @@ class WatchValueMapActorState { } int a_body1cont1(int loopDepth) { - #line 3880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = getWatchFuture( cx, makeReference(tenant, key, value, ver, tags, spanID, taskID, debugID, useProvisionalProxies)); - #line 3880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + watchRefCountUpdater = WatchRefCountUpdater(cx, tenant.tenantId, key, ver); + #line 4196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = getWatchFuture(cx, makeReference( tenant, key, value, ver, tags, spanContext, taskID, debugID, useProvisionalProxies)); + #line 4196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 17407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 17412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(Version const& __ver,int loopDepth) { - #line 3878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ver = __ver; - #line 17421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -17483,9 +19092,9 @@ class WatchValueMapActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 3884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WatchValueMapActorState(); static_cast(this)->destroy(); return 0; } - #line 17488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WatchValueMapActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -17495,9 +19104,9 @@ class WatchValueMapActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 3884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WatchValueMapActorState(); static_cast(this)->destroy(); return 0; } - #line 17500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WatchValueMapActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -17568,34 +19177,36 @@ class WatchValueMapActorState { fdb_probe_actor_exit("watchValueMap", reinterpret_cast(this), 1); } - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future version; - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TenantInfo tenant; - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key key; - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional value; - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TagSet tags; - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SpanID spanID; - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SpanContext spanContext; + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TaskPriority taskID; - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional debugID; - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UseProvisionalProxies useProvisionalProxies; - #line 3878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Version ver; - #line 17593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WatchRefCountUpdater watchRefCountUpdater; + #line 19204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via watchValueMap() - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class WatchValueMapActor final : public Actor, public ActorCallback< WatchValueMapActor, 0, Version >, public ActorCallback< WatchValueMapActor, 1, Void >, public FastAllocated, public WatchValueMapActorState { - #line 17598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -17605,11 +19216,11 @@ class WatchValueMapActor final : public Actor, public ActorCallback< Watch #pragma clang diagnostic pop friend struct ActorCallback< WatchValueMapActor, 0, Version >; friend struct ActorCallback< WatchValueMapActor, 1, Void >; - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WatchValueMapActor(Future const& version,TenantInfo const& tenant,Key const& key,Optional const& value,Database const& cx,TagSet const& tags,SpanID const& spanID,TaskPriority const& taskID,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies) - #line 17610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WatchValueMapActor(Future const& version,TenantInfo const& tenant,Key const& key,Optional const& value,Database const& cx,TagSet const& tags,SpanContext const& spanContext,TaskPriority const& taskID,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies) + #line 19221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - WatchValueMapActorState(version, tenant, key, value, cx, tags, spanID, taskID, debugID, useProvisionalProxies) + WatchValueMapActorState(version, tenant, key, value, cx, tags, spanContext, taskID, debugID, useProvisionalProxies) { fdb_probe_actor_enter("watchValueMap", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -17632,14 +19243,14 @@ friend struct ActorCallback< WatchValueMapActor, 1, Void >; } }; } - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future watchValueMap( Future const& version, TenantInfo const& tenant, Key const& key, Optional const& value, Database const& cx, TagSet const& tags, SpanID const& spanID, TaskPriority const& taskID, Optional const& debugID, UseProvisionalProxies const& useProvisionalProxies ) { - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new WatchValueMapActor(version, tenant, key, value, cx, tags, spanID, taskID, debugID, useProvisionalProxies)); - #line 17639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future watchValueMap( Future const& version, TenantInfo const& tenant, Key const& key, Optional const& value, Database const& cx, TagSet const& tags, SpanContext const& spanContext, TaskPriority const& taskID, Optional const& debugID, UseProvisionalProxies const& useProvisionalProxies ) { + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new WatchValueMapActor(version, tenant, key, value, cx, tags, spanContext, taskID, debugID, useProvisionalProxies)); + #line 19250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 3886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 4202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template void transformRangeLimits(GetRangeLimits limits, Reverse reverse, GetKeyValuesFamilyRequest& req) { @@ -17663,7 +19274,7 @@ void transformRangeLimits(GetRangeLimits limits, Reverse reverse, GetKeyValuesFa } template -RequestStream StorageServerInterface::*getRangeRequestStream() { +PublicRequestStream StorageServerInterface::*getRangeRequestStream() { if constexpr (std::is_same::value) { return &StorageServerInterface::getKeyValues; } else if (std::is_same::value) { @@ -17673,37 +19284,35 @@ RequestStream StorageServerInterface::*getRangeReques } } - #line 17676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getExactRange() - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetExactRangeActorState { - #line 17683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetExactRangeActorState(Reference const& trState,Version const& version,KeyRange const& keys,Key const& mapper,GetRangeLimits const& limits,Reverse const& reverse,UseTenant const& useTenant) - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetExactRangeActorState(Reference const& trState,KeyRange const& keys,Key const& mapper,GetRangeLimits const& limits,Reverse const& reverse,UseTenant const& useTenant) + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version(version), - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys(keys), - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" mapper(mapper), - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" limits(limits), - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" reverse(reverse), - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" useTenant(useTenant), - #line 3927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output(), - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:getExactRange"_loc, trState->spanID) - #line 17706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:getExactRange"_loc, trState->spanContext) + #line 19315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getExactRange", reinterpret_cast(this)); @@ -17716,17 +19325,17 @@ class GetExactRangeActorState { int a_body1(int loopDepth=0) { try { - #line 3930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (useTenant && trState->tenant().present()) - #line 17721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span.addTag("tenant"_sr, trState->tenant().get()); - #line 17725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span.addAttribute("tenant"_sr, trState->tenant().get()->name.castTo().orDefault(""_sr)); + #line 19334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 17729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -17754,38 +19363,38 @@ class GetExactRangeActorState { } int a_body1loopBody1(int loopDepth) { - #line 3936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_0 = getKeyRangeLocations(trState, keys, CLIENT_KNOBS->GET_RANGE_SHARD_LIMIT, reverse, getRangeRequestStream(), useTenant, version); - #line 3936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_0 = getKeyRangeLocations(trState, keys, CLIENT_KNOBS->GET_RANGE_SHARD_LIMIT, reverse, getRangeRequestStream(), useTenant); + #line 4253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 17761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 3936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 17766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(int loopDepth) { - #line 3944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(locations.size()); - #line 3945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" shard = 0; - #line 3946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 17779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1when1(std::vector const& __locations,int loopDepth) { - #line 3936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" locations = __locations; - #line 17788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -17863,68 +19472,68 @@ class GetExactRangeActorState { } int a_body1loopBody1cont1loopBody1(int loopDepth) { - #line 3947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" const KeyRangeRef& range = locations[shard].range; - #line 3949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetKeyValuesFamilyRequest req; - #line 3950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.mapper = mapper; - #line 3951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.arena.dependsOn(mapper.arena()); - #line 3953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.tenantInfo = useTenant ? trState->getTenantInfo() : TenantInfo(); - #line 3954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.version = version; - #line 3955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.version = trState->readVersion(); + #line 4271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.begin = firstGreaterOrEqual(range.begin); - #line 3956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.end = firstGreaterOrEqual(range.end); - #line 3957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.spanContext = span.context; - #line 3958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->getLatestCommitVersions( locations[shard].locations, req.version, trState, req.ssLatestCommitVersions); - #line 3962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->getLatestCommitVersions(locations[shard].locations, trState, req.ssLatestCommitVersions); + #line 4278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.arena.dependsOn(locations[shard].range.arena()); - #line 3964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" transformRangeLimits(limits, reverse, req); - #line 3965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(req.limitBytes > 0 && req.limit != 0 && req.limit < 0 == reverse); - #line 3968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.tags = trState->cx->sampleReadTags() ? trState->options.readTags : Optional(); - #line 3969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.debugID = trState->debugID; - #line 17896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.options = trState->readOptions; + #line 19505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 3972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->debugID.present()) - #line 17900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) + #line 19509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 3973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent( "TransactionDebug", trState->debugID.get().first(), "NativeAPI.getExactRange.Before"); - #line 17904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent("TransactionDebug", trState->readOptions.get().debugID.get().first(), "NativeAPI.getExactRange.Before"); + #line 19513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionPhysicalReads; - #line 3985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rep = GetKeyValuesFamilyReply(); - #line 17910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 3988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = trState->cx->connectionFileChanged(); - #line 3987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1loopBody1Catch2(actor_cancelled(), loopDepth); - #line 17916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1loopBody1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; - #line 3991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = loadBalance( trState->cx.getPtr(), locations[shard].locations, getRangeRequestStream(), req, TaskPriority::DefaultPromiseEndpoint, AtMostOnce::False, trState->cx->enableLocalityLoadBalance ? &trState->cx->queueModel : nullptr); - #line 17920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont1loopBody1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont1loopBody1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 3988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 17927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -17963,70 +19572,47 @@ class GetExactRangeActorState { int a_body1loopBody1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 4083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) - #line 17968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" const KeyRangeRef& range = locations[shard].range; - #line 4086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (reverse) - #line 17974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys = KeyRangeRef(keys.begin, range.end); - #line 17978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 4089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys = KeyRangeRef(range.begin, keys.end); - #line 17984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->invalidateCache(locations[0].tenantEntry.prefix, keys); - #line 4093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->invalidateCache( useTenant ? trState->tenant().mapRef(&Tenant::prefix) : Optional(), keys); + #line 4413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, trState->taskID); - #line 4093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 17992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 17997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - #line 4095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_unknown_tenant) - #line 18004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 4096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(useTenant && trState->tenant().present()); - #line 4097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->invalidateCachedTenant(trState->tenant().get()); - #line 4098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_4 = delay(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, trState->taskID); - #line 4098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 18014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont1loopBody1Catch1when2(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 4098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 18019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 4101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevInfo, "GetExactRangeError") .error(e) .detail("Tenant", trState->tenant()) .detail("ShardBegin", locations[shard].range.begin) .detail("ShardEnd", locations[shard].range.end); - #line 4106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 2)); - #line 18028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } + #line 4416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevInfo, "GetExactRangeError") .error(e) .detail("Tenant", trState->tenant()) .detail("ShardBegin", locations[shard].range.begin) .detail("ShardEnd", locations[shard].range.end); + #line 4421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 2)); + #line 19615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } catch (Error& error) { @@ -18039,135 +19625,135 @@ class GetExactRangeActorState { } int a_body1loopBody1cont1loopBody1cont2(int loopDepth) { - #line 4007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->debugID.present()) - #line 18044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) + #line 19630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent( "TransactionDebug", trState->debugID.get().first(), "NativeAPI.getExactRange.After"); - #line 18048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent("TransactionDebug", trState->readOptions.get().debugID.get().first(), "NativeAPI.getExactRange.After"); + #line 19634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.arena().dependsOn(rep.arena); - #line 4011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.append(output.arena(), rep.data.begin(), rep.data.size()); - #line 4013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (limits.hasRowLimit() && rep.data.size() > limits.rows) - #line 18056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevError, "GetExactRangeTooManyRows") .detail("RowLimit", limits.rows) .detail("DeliveredRows", output.size()); - #line 4017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(false); - #line 18062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" limits.decrement(rep.data); - #line 4021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (limits.isReached()) - #line 18068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.more = true; - #line 4023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(output); this->~GetExactRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 18074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(std::move(output)); // state_var_RVO this->~GetExactRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool more = rep.more; - #line 4028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (reverse && more && rep.data.size() > 0 && output[output.size() - 1].key == locations[shard].range.begin) - #line 18084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" more = false; - #line 18088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (more) - #line 18092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!rep.data.size()) - #line 18096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevError, "GetExactRangeError") .detail("Reason", "More data indicated but no rows present") .detail("LimitBytes", limits.bytes) .detail("LimitRows", limits.rows) .detail("OutputSize", output.size()) .detail("OutputBytes", output.expectedSize()) .detail("BlockSize", rep.data.size()) .detail("BlockBytes", rep.data.expectedSize()); - #line 4042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(false); - #line 18102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 4046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "GetKeyValuesFamilyReply.more in getExactRange"); + #line 4365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (reverse) - #line 18108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" locations[shard].range = KeyRangeRef(locations[shard].range.begin, output[output.size() - 1].key); - #line 18112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 4050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" locations[shard].range = KeyRangeRef(keyAfter(output[output.size() - 1].key), locations[shard].range.end); - #line 18118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 4054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!more || locations[shard].range.empty()) - #line 18123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 4056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "getExactrange (!more || locations[shard].first.empty())"); + #line 4375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (shard == locations.size() - 1) - #line 18129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" const KeyRangeRef& range = locations[shard].range; - #line 4058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef begin = reverse ? keys.begin : range.end; - #line 4059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef end = reverse ? range.begin : keys.end; - #line 4061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (begin >= end) - #line 18139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.more = false; - #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(output); this->~GetExactRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 18145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(std::move(output)); // state_var_RVO this->~GetExactRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 4067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Multiple requests of key locations"); + #line 4386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys = KeyRangeRef(begin, end); - #line 18155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 4071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++shard; - #line 18160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (limits.hasSatisfiedMinRows() && output.size() > 0) - #line 18164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.more = true; - #line 4079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(output); this->~GetExactRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 18170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(std::move(output)); // state_var_RVO this->~GetExactRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -18180,11 +19766,11 @@ class GetExactRangeActorState { int a_body1loopBody1cont1loopBody1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 4004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionPhysicalReadsCompleted; - #line 4005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1loopBody1cont1loopBody1Catch1(__current_error, loopDepth); - #line 18187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1loopBody1cont1loopBody1Catch1(error, loopDepth); @@ -18196,43 +19782,43 @@ class GetExactRangeActorState { } int a_body1loopBody1cont1loopBody1cont4(int loopDepth) { - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionPhysicalReadsCompleted; - #line 18201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopBody1cont6(loopDepth); return loopDepth; } int a_body1loopBody1cont1loopBody1when1(Void const& _,int loopDepth) { - #line 3989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1loopBody1cont1loopBody1Catch2(transaction_too_old(), loopDepth); - #line 18210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } int a_body1loopBody1cont1loopBody1when1(Void && _,int loopDepth) { - #line 3989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1loopBody1cont1loopBody1Catch2(transaction_too_old(), loopDepth); - #line 18218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } int a_body1loopBody1cont1loopBody1when2(GetKeyValuesFamilyReply const& _rep,int loopDepth) { - #line 3999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rep = _rep; - #line 18226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopBody1cont4(loopDepth); return loopDepth; } int a_body1loopBody1cont1loopBody1when2(GetKeyValuesFamilyReply && _rep,int loopDepth) { - #line 3999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rep = _rep; - #line 18235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 19821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopBody1cont4(loopDepth); return loopDepth; @@ -18435,113 +20021,36 @@ class GetExactRangeActorState { fdb_probe_actor_exit("getExactRange", reinterpret_cast(this), 3); } - int a_body1loopBody1cont1loopBody1Catch1cont7(Void const& _,int loopDepth) - { - return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break - - return loopDepth; - } - int a_body1loopBody1cont1loopBody1Catch1cont7(Void && _,int loopDepth) - { - return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break - - return loopDepth; - } - int a_body1loopBody1cont1loopBody1Catch1when2(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1loopBody1Catch1cont7(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1loopBody1Catch1when2(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1loopBody1Catch1cont7(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetExactRangeActor, 4, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GetExactRangeActor, 4, Void >*,Void const& value) - { - fdb_probe_actor_enter("getExactRange", reinterpret_cast(this), 4); - a_exitChoose4(); - try { - a_body1loopBody1cont1loopBody1Catch1when2(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getExactRange", reinterpret_cast(this), 4); - - } - void a_callback_fire(ActorCallback< GetExactRangeActor, 4, Void >*,Void && value) - { - fdb_probe_actor_enter("getExactRange", reinterpret_cast(this), 4); - a_exitChoose4(); - try { - a_body1loopBody1cont1loopBody1Catch1when2(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getExactRange", reinterpret_cast(this), 4); - - } - void a_callback_error(ActorCallback< GetExactRangeActor, 4, Void >*,Error err) - { - fdb_probe_actor_enter("getExactRange", reinterpret_cast(this), 4); - a_exitChoose4(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getExactRange", reinterpret_cast(this), 4); - - } - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange keys; - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key mapper; - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetRangeLimits limits; - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reverse reverse; - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UseTenant useTenant; - #line 3927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" RangeResultFamily output; - #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 3936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector locations; - #line 3945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int shard; - #line 3985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetKeyValuesFamilyReply rep; - #line 18537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getExactRange() - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetExactRangeActor final : public Actor, public ActorCallback< GetExactRangeActor, 0, std::vector >, public ActorCallback< GetExactRangeActor, 1, Void >, public ActorCallback< GetExactRangeActor, 2, GetKeyValuesFamilyReply >, public ActorCallback< GetExactRangeActor, 3, Void >, public ActorCallback< GetExactRangeActor, 4, Void >, public FastAllocated>, public GetExactRangeActorState> { - #line 18544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetExactRangeActor final : public Actor, public ActorCallback< GetExactRangeActor, 0, std::vector >, public ActorCallback< GetExactRangeActor, 1, Void >, public ActorCallback< GetExactRangeActor, 2, GetKeyValuesFamilyReply >, public ActorCallback< GetExactRangeActor, 3, Void >, public FastAllocated>, public GetExactRangeActorState> { + #line 20053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -18553,12 +20062,11 @@ friend struct ActorCallback< GetExactRangeActor, 1, Void >; friend struct ActorCallback< GetExactRangeActor, 2, GetKeyValuesFamilyReply >; friend struct ActorCallback< GetExactRangeActor, 3, Void >; -friend struct ActorCallback< GetExactRangeActor, 4, Void >; - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetExactRangeActor(Reference const& trState,Version const& version,KeyRange const& keys,Key const& mapper,GetRangeLimits const& limits,Reverse const& reverse,UseTenant const& useTenant) - #line 18559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetExactRangeActor(Reference const& trState,KeyRange const& keys,Key const& mapper,GetRangeLimits const& limits,Reverse const& reverse,UseTenant const& useTenant) + #line 20067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - GetExactRangeActorState>(trState, version, keys, mapper, limits, reverse, useTenant) + GetExactRangeActorState>(trState, keys, mapper, limits, reverse, useTenant) { fdb_probe_actor_enter("getExactRange", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -18577,65 +20085,59 @@ friend struct ActorCallback< GetExactRangeActora_callback_error((ActorCallback< GetExactRangeActor, 0, std::vector >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< GetExactRangeActor, 1, Void >*)0, actor_cancelled()); break; case 3: this->a_callback_error((ActorCallback< GetExactRangeActor, 3, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< GetExactRangeActor, 4, Void >*)0, actor_cancelled()); break; } } }; } - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future getExactRange( Reference const& trState, Version const& version, KeyRange const& keys, Key const& mapper, GetRangeLimits const& limits, Reverse const& reverse, UseTenant const& useTenant ) { - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new GetExactRangeActor(trState, version, keys, mapper, limits, reverse, useTenant)); - #line 18592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getExactRange( Reference const& trState, KeyRange const& keys, Key const& mapper, GetRangeLimits const& limits, Reverse const& reverse, UseTenant const& useTenant ) { + #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetExactRangeActor(trState, keys, mapper, limits, reverse, useTenant)); + #line 20099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 4112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 4427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -Future resolveKey(Reference trState, - KeySelector const& key, - Version const& version, - UseTenant useTenant) { +Future resolveKey(Reference trState, KeySelector const& key, UseTenant useTenant) { if (key.isFirstGreaterOrEqual()) return Future(key.getKey()); if (key.isFirstGreaterThan()) return Future(keyAfter(key.getKey())); - return getKey(trState, key, version, useTenant); + return getKey(trState, key, useTenant); } - #line 18610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getRangeFallback() - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetRangeFallbackActorState { - #line 18617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetRangeFallbackActorState(Reference const& trState,Version const& version,KeySelector const& begin,KeySelector const& end,Key const& mapper,GetRangeLimits const& limits,Reverse const& reverse,UseTenant const& useTenant) - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetRangeFallbackActorState(Reference const& trState,KeySelector const& begin,KeySelector const& end,Key const& mapper,GetRangeLimits const& limits,Reverse const& reverse,UseTenant const& useTenant) + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version(version), - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" begin(begin), - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" end(end), - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" mapper(mapper), - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" limits(limits), - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" reverse(reverse), - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" useTenant(useTenant) - #line 18638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getRangeFallback", reinterpret_cast(this)); @@ -18648,34 +20150,21 @@ class GetRangeFallbackActorState { int a_body1(int loopDepth=0) { try { - #line 4135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (version == latestVersion) - #line 18653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 4136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - transaction = Transaction(trState->cx); - #line 4137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - transaction.setOption(FDBTransactionOptions::CAUSAL_READ_RISKY); - #line 4138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - transaction.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 4139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - transaction.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 4140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = transaction.getReadVersion(); - #line 4140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 4140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 18672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont1(loopDepth); - } + #line 4446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future fb = resolveKey(trState, begin, useTenant); + #line 4447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fe = resolveKey(trState, end, useTenant); + #line 4449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = fb; + #line 4449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 20161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 4449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 20166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -18695,61 +20184,43 @@ class GetRangeFallbackActorState { } int a_body1cont1(int loopDepth) { - #line 4144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future fb = resolveKey(trState, begin, version, useTenant); - #line 4145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fe = resolveKey(trState, end, version, useTenant); - #line 4147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = fb; - #line 4147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = fe; + #line 4450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 18711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont2(Version const& ver,int loopDepth) + int a_body1when1(Key const& __b,int loopDepth) { - #line 4141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version = ver; - #line 18720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + b = __b; + #line 20205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1cont2(Version && ver,int loopDepth) + int a_body1when1(Key && __b,int loopDepth) { - #line 4141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version = ver; - #line 18729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + b = std::move(__b); loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1when1(Version const& ver,int loopDepth) - { - loopDepth = a_body1cont2(ver, loopDepth); - - return loopDepth; - } - int a_body1when1(Version && ver,int loopDepth) - { - loopDepth = a_body1cont2(std::move(ver), loopDepth); - - return loopDepth; - } void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRangeFallbackActor, 0, Version >::remove(); + static_cast(this)->ActorCallback< GetRangeFallbackActor, 0, Key >::remove(); } - void a_callback_fire(ActorCallback< GetRangeFallbackActor, 0, Version >*,Version const& value) + void a_callback_fire(ActorCallback< GetRangeFallbackActor, 0, Key >*,Key const& value) { fdb_probe_actor_enter("getRangeFallback", reinterpret_cast(this), 0); a_exitChoose1(); @@ -18764,7 +20235,7 @@ class GetRangeFallbackActorState { fdb_probe_actor_exit("getRangeFallback", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetRangeFallbackActor, 0, Version >*,Version && value) + void a_callback_fire(ActorCallback< GetRangeFallbackActor, 0, Key >*,Key && value) { fdb_probe_actor_enter("getRangeFallback", reinterpret_cast(this), 0); a_exitChoose1(); @@ -18779,7 +20250,7 @@ class GetRangeFallbackActorState { fdb_probe_actor_exit("getRangeFallback", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetRangeFallbackActor, 0, Version >*,Error err) + void a_callback_error(ActorCallback< GetRangeFallbackActor, 0, Key >*,Error err) { fdb_probe_actor_enter("getRangeFallback", reinterpret_cast(this), 0); a_exitChoose1(); @@ -18794,35 +20265,47 @@ class GetRangeFallbackActorState { fdb_probe_actor_exit("getRangeFallback", reinterpret_cast(this), 0); } - int a_body1cont4(int loopDepth) + int a_body1cont2(int loopDepth) { - #line 4148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = fe; - #line 4148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (b >= e) + #line 20272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 4452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(RangeResultFamily()); this->~GetRangeFallbackActorState(); static_cast(this)->destroy(); return 0; } + #line 20276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(RangeResultFamily()); + this->~GetRangeFallbackActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 4459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = getExactRange( trState, KeyRangeRef(b, e), mapper, limits, reverse, useTenant); + #line 4459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont4when1(__when_expr_2.get(), loopDepth); }; + #line 20286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 18808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 20291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1when1(Key const& __b,int loopDepth) + int a_body1cont1when1(Key const& __e,int loopDepth) { - #line 4147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - b = __b; - #line 18817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont4(loopDepth); + #line 4450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + e = __e; + #line 20300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont1when1(Key && __b,int loopDepth) + int a_body1cont1when1(Key && __e,int loopDepth) { - b = std::move(__b); - loopDepth = a_body1cont4(loopDepth); + e = std::move(__e); + loopDepth = a_body1cont2(loopDepth); return loopDepth; } @@ -18877,134 +20360,39 @@ class GetRangeFallbackActorState { fdb_probe_actor_exit("getRangeFallback", reinterpret_cast(this), 1); } - int a_body1cont5(int loopDepth) - { - #line 4149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (b >= e) - #line 18884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 4150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(RangeResultFamily()); this->~GetRangeFallbackActorState(); static_cast(this)->destroy(); return 0; } - #line 18888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(RangeResultFamily()); - this->~GetRangeFallbackActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 4157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = getExactRange( trState, version, KeyRangeRef(b, e), mapper, limits, reverse, useTenant); - #line 4157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 18898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 4157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 18903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont4when1(Key const& __e,int loopDepth) - { - #line 4148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - e = __e; - #line 18912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont5(loopDepth); - - return loopDepth; - } - int a_body1cont4when1(Key && __e,int loopDepth) - { - e = std::move(__e); - loopDepth = a_body1cont5(loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRangeFallbackActor, 2, Key >::remove(); - - } - void a_callback_fire(ActorCallback< GetRangeFallbackActor, 2, Key >*,Key const& value) - { - fdb_probe_actor_enter("getRangeFallback", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont4when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getRangeFallback", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< GetRangeFallbackActor, 2, Key >*,Key && value) - { - fdb_probe_actor_enter("getRangeFallback", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont4when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getRangeFallback", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< GetRangeFallbackActor, 2, Key >*,Error err) + int a_body1cont3(RangeResultFamily const& _r,int loopDepth) { - fdb_probe_actor_enter("getRangeFallback", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getRangeFallback", reinterpret_cast(this), 2); - - } - int a_body1cont6(RangeResultFamily const& _r,int loopDepth) - { - #line 4159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" RangeResultFamily r = _r; - #line 4161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (b == allKeys.begin && ((reverse && !r.more) || !reverse)) - #line 18981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" r.readToBegin = true; - #line 18985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e == allKeys.end && ((!reverse && !r.more) || reverse)) - #line 18989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" r.readThroughEnd = true; - #line 18993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(!limits.hasRowLimit() || r.size() <= limits.rows); - #line 4175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (limits.hasByteLimit() && r.expectedSize() > size_t(limits.bytes + CLIENT_KNOBS->SYSTEM_KEY_SIZE_LIMIT + CLIENT_KNOBS->VALUE_SIZE_LIMIT + 1) && limits.minRows == 0) - #line 18999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevWarnAlways, "GetRangeFallbackTooMuchData") .detail("LimitBytes", limits.bytes) .detail("DeliveredBytes", r.expectedSize()) .detail("LimitRows", limits.rows) .detail("DeliveredRows", r.size()); - #line 19003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(r); this->~GetRangeFallbackActorState(); static_cast(this)->destroy(); return 0; } - #line 19007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(r); this->~GetRangeFallbackActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -19012,39 +20400,39 @@ class GetRangeFallbackActorState { return loopDepth; } - int a_body1cont6(RangeResultFamily && _r,int loopDepth) + int a_body1cont3(RangeResultFamily && _r,int loopDepth) { - #line 4159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" RangeResultFamily r = _r; - #line 4161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (b == allKeys.begin && ((reverse && !r.more) || !reverse)) - #line 19021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" r.readToBegin = true; - #line 19025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e == allKeys.end && ((!reverse && !r.more) || reverse)) - #line 19029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" r.readThroughEnd = true; - #line 19033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(!limits.hasRowLimit() || r.size() <= limits.rows); - #line 4175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (limits.hasByteLimit() && r.expectedSize() > size_t(limits.bytes + CLIENT_KNOBS->SYSTEM_KEY_SIZE_LIMIT + CLIENT_KNOBS->VALUE_SIZE_LIMIT + 1) && limits.minRows == 0) - #line 19039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevWarnAlways, "GetRangeFallbackTooMuchData") .detail("LimitBytes", limits.bytes) .detail("DeliveredBytes", r.expectedSize()) .detail("LimitRows", limits.rows) .detail("DeliveredRows", r.size()); - #line 19043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(r); this->~GetRangeFallbackActorState(); static_cast(this)->destroy(); return 0; } - #line 19047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(r); this->~GetRangeFallbackActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -19052,58 +20440,58 @@ class GetRangeFallbackActorState { return loopDepth; } - int a_body1cont5when1(RangeResultFamily const& _r,int loopDepth) + int a_body1cont2when1(RangeResultFamily const& _r,int loopDepth) { - loopDepth = a_body1cont6(_r, loopDepth); + loopDepth = a_body1cont3(_r, loopDepth); return loopDepth; } - int a_body1cont5when1(RangeResultFamily && _r,int loopDepth) + int a_body1cont2when1(RangeResultFamily && _r,int loopDepth) { - loopDepth = a_body1cont6(std::move(_r), loopDepth); + loopDepth = a_body1cont3(std::move(_r), loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose3() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRangeFallbackActor, 3, RangeResultFamily >::remove(); + static_cast(this)->ActorCallback< GetRangeFallbackActor, 2, RangeResultFamily >::remove(); } - void a_callback_fire(ActorCallback< GetRangeFallbackActor, 3, RangeResultFamily >*,RangeResultFamily const& value) + void a_callback_fire(ActorCallback< GetRangeFallbackActor, 2, RangeResultFamily >*,RangeResultFamily const& value) { - fdb_probe_actor_enter("getRangeFallback", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getRangeFallback", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont5when1(value, 0); + a_body1cont2when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRangeFallback", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getRangeFallback", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< GetRangeFallbackActor, 3, RangeResultFamily >*,RangeResultFamily && value) + void a_callback_fire(ActorCallback< GetRangeFallbackActor, 2, RangeResultFamily >*,RangeResultFamily && value) { - fdb_probe_actor_enter("getRangeFallback", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getRangeFallback", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont5when1(std::move(value), 0); + a_body1cont2when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRangeFallback", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getRangeFallback", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< GetRangeFallbackActor, 3, RangeResultFamily >*,Error err) + void a_callback_error(ActorCallback< GetRangeFallbackActor, 2, RangeResultFamily >*,Error err) { - fdb_probe_actor_enter("getRangeFallback", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getRangeFallback", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -19112,41 +20500,37 @@ class GetRangeFallbackActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRangeFallback", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getRangeFallback", reinterpret_cast(this), 2); } - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeySelector begin; - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeySelector end; - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key mapper; - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetRangeLimits limits; - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reverse reverse; - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UseTenant useTenant; - #line 4136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Transaction transaction; - #line 4145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future fe; - #line 4147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key b; - #line 4148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key e; - #line 19142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getRangeFallback() - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetRangeFallbackActor final : public Actor, public ActorCallback< GetRangeFallbackActor, 0, Version >, public ActorCallback< GetRangeFallbackActor, 1, Key >, public ActorCallback< GetRangeFallbackActor, 2, Key >, public ActorCallback< GetRangeFallbackActor, 3, RangeResultFamily >, public FastAllocated>, public GetRangeFallbackActorState> { - #line 19149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetRangeFallbackActor final : public Actor, public ActorCallback< GetRangeFallbackActor, 0, Key >, public ActorCallback< GetRangeFallbackActor, 1, Key >, public ActorCallback< GetRangeFallbackActor, 2, RangeResultFamily >, public FastAllocated>, public GetRangeFallbackActorState> { + #line 20533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -19154,15 +20538,14 @@ class GetRangeFallbackActor final : public Actor, public Acto #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetRangeFallbackActor, 0, Version >; +friend struct ActorCallback< GetRangeFallbackActor, 0, Key >; friend struct ActorCallback< GetRangeFallbackActor, 1, Key >; -friend struct ActorCallback< GetRangeFallbackActor, 2, Key >; -friend struct ActorCallback< GetRangeFallbackActor, 3, RangeResultFamily >; - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetRangeFallbackActor(Reference const& trState,Version const& version,KeySelector const& begin,KeySelector const& end,Key const& mapper,GetRangeLimits const& limits,Reverse const& reverse,UseTenant const& useTenant) - #line 19163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +friend struct ActorCallback< GetRangeFallbackActor, 2, RangeResultFamily >; + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetRangeFallbackActor(Reference const& trState,KeySelector const& begin,KeySelector const& end,Key const& mapper,GetRangeLimits const& limits,Reverse const& reverse,UseTenant const& useTenant) + #line 20546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - GetRangeFallbackActorState>(trState, version, begin, end, mapper, limits, reverse, useTenant) + GetRangeFallbackActorState>(trState, begin, end, mapper, limits, reverse, useTenant) { fdb_probe_actor_enter("getRangeFallback", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -19178,25 +20561,24 @@ friend struct ActorCallback< GetRangeFallbackActoractor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetRangeFallbackActor, 0, Version >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetRangeFallbackActor, 0, Key >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< GetRangeFallbackActor, 1, Key >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< GetRangeFallbackActor, 2, Key >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< GetRangeFallbackActor, 3, RangeResultFamily >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetRangeFallbackActor, 2, RangeResultFamily >*)0, actor_cancelled()); break; } } }; } - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future getRangeFallback( Reference const& trState, Version const& version, KeySelector const& begin, KeySelector const& end, Key const& mapper, GetRangeLimits const& limits, Reverse const& reverse, UseTenant const& useTenant ) { - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new GetRangeFallbackActor(trState, version, begin, end, mapper, limits, reverse, useTenant)); - #line 19196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getRangeFallback( Reference const& trState, KeySelector const& begin, KeySelector const& end, Key const& mapper, GetRangeLimits const& limits, Reverse const& reverse, UseTenant const& useTenant ) { + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetRangeFallbackActor(trState, begin, end, mapper, limits, reverse, useTenant)); + #line 20578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 4188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 4490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t inline getRangeResultFamilyBytes(RangeResultRef result) { return result.expectedSize(); @@ -19206,7 +20588,6 @@ int64_t inline getRangeResultFamilyBytes(MappedRangeResultRef result) { int64_t bytes = 0; for (const MappedKeyValueRef& mappedKeyValue : result) { bytes += mappedKeyValue.key.size() + mappedKeyValue.value.size(); - auto& reqAndResult = mappedKeyValue.reqAndResult; if (std::holds_alternative(reqAndResult)) { auto getValue = std::get(reqAndResult); @@ -19233,6 +20614,7 @@ void getRangeFinished(Reference trState, RangeResultFamily result) { int64_t bytes = getRangeResultFamilyBytes(result); + trState->totalCost += getReadOperationCost(bytes); trState->cx->transactionBytesRead += bytes; trState->cx->transactionKeysRead += result.size(); @@ -19243,7 +20625,7 @@ void getRangeFinished(Reference trState, bytes, begin.getKey(), end.getKey(), - trState->tenant())); + trState->tenant().flatMapRef(&Tenant::name))); } if (!snapshot) { @@ -19278,49 +20660,49 @@ void getRangeFinished(Reference trState, } } - #line 19281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getRange() - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetRangeActorState { - #line 19288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetRangeActorState(Reference const& trState,Future const& fVersion,KeySelector const& begin,KeySelector const& end,Key const& mapper,GetRangeLimits const& limits,Promise> const& conflictRange,Snapshot const& snapshot,Reverse const& reverse,UseTenant const& useTenant = UseTenant::True) - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetRangeActorState(Reference const& trState,KeySelector const& begin,KeySelector const& end,Key const& mapper,GetRangeLimits const& limits,Promise> const& conflictRange,Snapshot const& snapshot,Reverse const& reverse,UseTenant const& useTenant = UseTenant::True) + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fVersion(fVersion), - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" begin(begin), - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" end(end), - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" mapper(mapper), - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" limits(limits), - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" conflictRange(conflictRange), - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" snapshot(snapshot), - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" reverse(reverse), - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" useTenant(useTenant), - #line 4286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" originalLimits(limits), - #line 4287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" originalBegin(begin), - #line 4288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" originalEnd(end), - #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output(), - #line 4290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:getRange"_loc, trState->spanID) - #line 19323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:getRange"_loc, trState->spanContext), + #line 4592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + getRangeID(Optional()) + #line 20705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getRange", reinterpret_cast(this)); @@ -19333,25 +20715,25 @@ class GetRangeActorState { int a_body1(int loopDepth=0) { try { - #line 4291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (useTenant && trState->tenant().present()) - #line 19338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span.addTag("tenant"_sr, trState->tenant().get()); - #line 19342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span.addAttribute("tenant"_sr, trState->tenant().get()->name.castTo().orDefault(""_sr)); + #line 20724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } try { - #line 4296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = fVersion; - #line 4296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = trState->startTransaction(); + #line 4599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 19349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 4296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 20736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -19379,17 +20761,17 @@ class GetRangeActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 4583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (conflictRange.canBeSet()) - #line 19384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" conflictRange.send(std::make_pair(Key(), Key())); - #line 19388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 19392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -19399,58 +20781,79 @@ class GetRangeActorState { return loopDepth; } - int a_body1cont3(int loopDepth) + int a_body1cont3(Void const& _,int loopDepth) { - #line 4297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->validateVersion(version); - #line 4299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->validateVersion(trState->readVersion()); + #line 4602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" startTime = now(); - #line 4300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - readVersion = version; - #line 4305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (begin.getKey() == allKeys.begin && begin.offset < 1) - #line 19412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.readToBegin = true; - #line 4307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" begin = KeySelector(firstGreaterOrEqual(begin.getKey()), begin.arena()); - #line 19418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(!limits.isReached()); - #line 4311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT((!limits.hasRowLimit() || limits.rows >= limits.minRows) && limits.minRows >= 0); - #line 4313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 19426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont3loopHead1(loopDepth); return loopDepth; } - int a_body1when1(Version const& __version,int loopDepth) + int a_body1cont3(Void && _,int loopDepth) { - #line 4296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version = __version; - #line 19435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont3(loopDepth); + #line 4600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->validateVersion(trState->readVersion()); + #line 4602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + startTime = now(); + #line 4604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (begin.getKey() == allKeys.begin && begin.offset < 1) + #line 20819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 4605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + output.readToBegin = true; + #line 4606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + begin = KeySelector(firstGreaterOrEqual(begin.getKey()), begin.arena()); + #line 20825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 4609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!limits.isReached()); + #line 4610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT((!limits.hasRowLimit() || limits.rows >= limits.minRows) && limits.minRows >= 0); + #line 4612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 20833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3loopHead1(loopDepth); return loopDepth; } - int a_body1when1(Version && __version,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - version = std::move(__version); - loopDepth = a_body1cont3(loopDepth); + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRangeActor, 0, Version >::remove(); + static_cast(this)->ActorCallback< GetRangeActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< GetRangeActor, 0, Version >*,Version const& value) + void a_callback_fire(ActorCallback< GetRangeActor, 0, Void >*,Void const& value) { fdb_probe_actor_enter("getRange", reinterpret_cast(this), 0); a_exitChoose1(); @@ -19465,7 +20868,7 @@ class GetRangeActorState { fdb_probe_actor_exit("getRange", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetRangeActor, 0, Version >*,Version && value) + void a_callback_fire(ActorCallback< GetRangeActor, 0, Void >*,Void && value) { fdb_probe_actor_enter("getRange", reinterpret_cast(this), 0); a_exitChoose1(); @@ -19480,7 +20883,7 @@ class GetRangeActorState { fdb_probe_actor_exit("getRange", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetRangeActor, 0, Version >*,Error err) + void a_callback_error(ActorCallback< GetRangeActor, 0, Void >*,Error err) { fdb_probe_actor_enter("getRange", reinterpret_cast(this), 0); a_exitChoose1(); @@ -19504,151 +20907,158 @@ class GetRangeActorState { } int a_body1cont3loopBody1(int loopDepth) { - #line 4314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (end.getKey() == allKeys.begin && (end.offset < 1 || end.isFirstGreaterOrEqual())) - #line 19509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" getRangeFinished( trState, startTime, originalBegin, originalEnd, snapshot, conflictRange, reverse, output); - #line 4317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(output); this->~GetRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 19515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(std::move(output)); // state_var_RVO this->~GetRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key locationKey = reverse ? Key(end.getKey(), end.arena()) : Key(begin.getKey(), begin.arena()); - #line 4321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reverse locationBackward{ reverse ? (end - 1).isBackward() : begin.isBackward() }; - #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = getKeyLocation(trState, locationKey, getRangeRequestStream(), locationBackward, useTenant, version); - #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = getKeyLocation( trState, locationKey, getRangeRequestStream(), locationBackward, useTenant); + #line 4621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 19529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3loopBody1cont1(int loopDepth) { - #line 4329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" shard = beginServer.range; - #line 4330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" modifiedSelectors = false; - #line 4331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req = GetKeyValuesFamilyRequest(); - #line 4332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.mapper = mapper; - #line 4333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.arena.dependsOn(mapper.arena()); - #line 4335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.tenantInfo = useTenant ? trState->getTenantInfo() : TenantInfo(); - #line 4336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.isFetchKeys = (trState->taskID == TaskPriority::FetchKeys); - #line 4337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.version = readVersion; - #line 4339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->getLatestCommitVersions( beginServer.locations, req.version, trState, req.ssLatestCommitVersions); - #line 4344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.options = trState->readOptions; + #line 4630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.version = trState->readVersion(); + #line 4632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->getLatestCommitVersions(beginServer.locations, trState, req.ssLatestCommitVersions); + #line 4636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool dependOnShard = false; - #line 4345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (reverse && (begin - 1).isDefinitelyLess(shard.begin) && (!begin.isFirstGreaterOrEqual() || begin.getKey() != shard.begin)) - #line 19563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.begin = firstGreaterOrEqual(shard.begin); - #line 4351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" modifiedSelectors = true; - #line 4352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.arena.dependsOn(shard.arena()); - #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" dependOnShard = true; - #line 19573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 4355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.begin = begin; - #line 4356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.arena.dependsOn(begin.arena()); - #line 19581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!reverse && end.isDefinitelyGreater(shard.end)) - #line 19585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.end = firstGreaterOrEqual(shard.end); - #line 4361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" modifiedSelectors = true; - #line 4362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!dependOnShard) - #line 19593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 20996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.arena.dependsOn(shard.arena()); - #line 19597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } else { - #line 4366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.end = end; - #line 4367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.arena.dependsOn(end.arena()); - #line 19606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" transformRangeLimits(limits, reverse, req); - #line 4371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(req.limitBytes > 0 && req.limit != 0 && req.limit < 0 == reverse); - #line 4373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.tags = trState->cx->sampleReadTags() ? trState->options.readTags : Optional(); - #line 4374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.debugID = trState->debugID; - #line 4375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.spanContext = span.context; - #line 19618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) + #line 21021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 4668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + getRangeID = nondeterministicRandom()->randomUniqueID(); + #line 4669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addAttach( "TransactionAttachID", trState->readOptions.get().debugID.get().first(), getRangeID.get().first()); + #line 21027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } try { - #line 4377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->debugID.present()) - #line 19622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (getRangeID.present()) + #line 21032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent( "TransactionDebug", trState->debugID.get().first(), "NativeAPI.getRange.Before"); - #line 19626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent("TransactionDebug", getRangeID.get().first(), "NativeAPI.getRange.Before"); + #line 21036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionPhysicalReads; - #line 4397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rep = GetKeyValuesFamilyReply(); - #line 19632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (CLIENT_BUGGIFY_WITH_PROB(.01)) - #line 19636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1cont3loopBody1cont1Catch2(deterministicRandom()->randomChoice( std::vector{ transaction_too_old(), future_version() }), loopDepth); - #line 19640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = loadBalance(trState->cx.getPtr(), beginServer.locations, getRangeRequestStream(), req, TaskPriority::DefaultPromiseEndpoint, AtMostOnce::False, trState->cx->enableLocalityLoadBalance ? &trState->cx->queueModel : nullptr); - #line 4404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1cont1Catch2(actor_cancelled(), loopDepth); - #line 19646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont3loopBody1cont1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont3loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -19667,9 +21077,9 @@ class GetRangeActorState { } int a_body1cont3loopBody1when1(KeyRangeLocationInfo const& __beginServer,int loopDepth) { - #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" beginServer = __beginServer; - #line 19672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont3loopBody1cont1(loopDepth); return loopDepth; @@ -19741,36 +21151,36 @@ class GetRangeActorState { int a_body1cont3loopBody1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 4536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->debugID.present()) - #line 19746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (getRangeID.present()) + #line 21156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent( "TransactionDebug", trState->debugID.get().first(), "NativeAPI.getRange.Error"); - #line 4539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("TransactionDebugError", trState->debugID.get()).error(e); - #line 19752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent("TransactionDebug", getRangeID.get().first(), "NativeAPI.getRange.Error"); + #line 4837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("TransactionDebugError", getRangeID.get()).error(e); + #line 21162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || (e.code() == error_code_transaction_too_old && readVersion == latestVersion)) - #line 19756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) + #line 21166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->invalidateCache(beginServer.tenantEntry.prefix, reverse ? end.getKey() : begin.getKey(), Reverse{ reverse ? (end - 1).isBackward() : begin.isBackward() }); - #line 4547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->invalidateCache(useTenant ? trState->tenant().mapRef(&Tenant::prefix) : Optional(), reverse ? end.getKey() : begin.getKey(), Reverse{ reverse ? (end - 1).isBackward() : begin.isBackward() }); + #line 4845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_wrong_shard_server) - #line 19762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_4 = getRangeFallback( trState, version, originalBegin, originalEnd, mapper, originalLimits, reverse, useTenant); - #line 4548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = getRangeFallback( trState, originalBegin, originalEnd, mapper, originalLimits, reverse, useTenant); + #line 4846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 19768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch2(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else @@ -19780,40 +21190,17 @@ class GetRangeActorState { } else { - #line 4564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_unknown_tenant) - #line 19785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->trLogInfo) + #line 21195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(useTenant && trState->tenant().present()); - #line 4566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->invalidateCachedTenant(trState->tenant().get()); - #line 4567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_6 = delay(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, trState->taskID); - #line 4567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 19795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch2(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont1Catch1when2(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 4567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 4569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->trLogInfo) - #line 19807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 4570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->trLogInfo->addLog( FdbClientLogEvents::EventGetRangeError(startTime, trState->cx->clientLocality.dcId(), static_cast(e.code()), begin.getKey(), end.getKey(), trState->tenant())); - #line 19811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 4578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch2(e, std::max(0, loopDepth - 1)); - #line 19815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->trLogInfo->addLog( FdbClientLogEvents::EventGetRangeError(startTime, trState->cx->clientLocality.dcId(), static_cast(e.code()), begin.getKey(), end.getKey(), trState->tenant().flatMapRef(&Tenant::name))); + #line 21199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + #line 4865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch2(e, std::max(0, loopDepth - 1)); + #line 21203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } catch (Error& error) { @@ -19824,184 +21211,196 @@ class GetRangeActorState { return loopDepth; } - int a_body1cont3loopBody1cont9(int loopDepth) + int a_body1cont3loopBody1cont10(int loopDepth) { - #line 4419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->debugID.present()) - #line 19831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (getRangeID.present()) + #line 21218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent("TransactionDebug", trState->debugID.get().first(), "NativeAPI.getRange.After"); - #line 19835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent("TransactionDebug", getRangeID.get().first(), "NativeAPI.getRange.After"); + #line 21222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(!rep.more || rep.data.size()); - #line 4432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(!limits.hasRowLimit() || rep.data.size() <= limits.rows); - #line 4434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" limits.decrement(rep.data); - #line 4436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (reverse && begin.isLastLessOrEqual() && rep.data.size() && rep.data.end()[-1].key == begin.getKey()) - #line 19845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" modifiedSelectors = false; - #line 19849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool finished = limits.isReached() || (!modifiedSelectors && !rep.more) || limits.hasSatisfiedMinRows(); - #line 4442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool readThrough = modifiedSelectors && !rep.more; - #line 4445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (finished && !output.size()) - #line 19857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool readToBegin = output.readToBegin; - #line 4447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool readThroughEnd = output.readThroughEnd; - #line 4449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" using RangeResultRefFamily = typename RangeResultFamily::RefType; - #line 4450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output = RangeResultFamily( RangeResultRefFamily(rep.data, modifiedSelectors || limits.isReached() || rep.more), rep.arena); - #line 4452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.readToBegin = readToBegin; - #line 4453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.readThroughEnd = readThroughEnd; - #line 4455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (BUGGIFY && limits.hasByteLimit() && output.size() > std::max(1, originalLimits.minRows) && (!std::is_same::value)) - #line 19873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" RangeResultFamily copy; - #line 4461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int newSize = deterministicRandom()->randomInt(std::max(1, originalLimits.minRows), output.size()); - #line 4463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < newSize;i++) { - #line 4464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" copy.push_back_deep(copy.arena(), output[i]); - #line 19883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output = copy; - #line 4467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.more = true; - #line 4469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" getRangeFinished( trState, startTime, originalBegin, originalEnd, snapshot, conflictRange, reverse, output); - #line 4471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(output); this->~GetRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 19893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(std::move(output)); // state_var_RVO this->~GetRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (readThrough) - #line 19901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.arena().dependsOn(shard.arena()); - #line 4476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - output.readThrough = reverse ? shard.begin : shard.end; - #line 19907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(modifiedSelectors); + #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + output.more = true; + #line 4780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + output.setReadThrough(reverse ? shard.begin : shard.end); + #line 21298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" getRangeFinished( trState, startTime, originalBegin, originalEnd, snapshot, conflictRange, reverse, output); - #line 4481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!output.more) + #line 21304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 4786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!output.readThrough.present()); + #line 21308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 4788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(output); this->~GetRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 19913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(std::move(output)); // state_var_RVO this->~GetRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.arena().dependsOn(rep.arena); - #line 4485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.append(output.arena(), rep.data.begin(), rep.data.size()); - #line 4487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (finished) - #line 19925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + output.more = modifiedSelectors || limits.isReached() || rep.more; + #line 4796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (readThrough) - #line 19929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.arena().dependsOn(shard.arena()); - #line 4490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - output.readThrough = reverse ? shard.begin : shard.end; - #line 19935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + output.setReadThrough(reverse ? shard.begin : shard.end); + #line 21336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - output.more = modifiedSelectors || limits.isReached() || rep.more; - #line 4494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" getRangeFinished( trState, startTime, originalBegin, originalEnd, snapshot, conflictRange, reverse, output); - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!output.more) + #line 21342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 4804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!output.readThrough.present()); + #line 21346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 4806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(output); this->~GetRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 19943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(std::move(output)); // state_var_RVO this->~GetRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (readVersion == latestVersion) - #line 19951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 4500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - readVersion = rep.version; - #line 19955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 4503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!rep.more) - #line 19959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(modifiedSelectors); - #line 4505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 4507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "!GetKeyValuesFamilyReply.more and modifiedSelectors in getRange"); + #line 4813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!rep.data.size()) - #line 19967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = getRangeFallback( trState, readVersion, originalBegin, originalEnd, mapper, originalLimits, reverse, useTenant); - #line 4508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = getRangeFallback( trState, originalBegin, originalEnd, mapper, originalLimits, reverse, useTenant); + #line 4814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 19973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont3loopBody1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3loopBody1cont9when1(__when_expr_3.get(), loopDepth); }; + #line 21372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont3loopBody1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3loopBody1cont10when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 4508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 19978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1cont3loopBody1cont23(loopDepth); + loopDepth = a_body1cont3loopBody1cont10cont12(loopDepth); } } else { - #line 4528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 4529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "GetKeyValuesFamilyReply.more in getRange"); + #line 4828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (reverse) - #line 19992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" end = firstGreaterOrEqual(output[output.size() - 1].key); - #line 19996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 4532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" begin = firstGreaterThan(output[output.size() - 1].key); - #line 20002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - loopDepth = a_body1cont3loopBody1cont13(loopDepth); + loopDepth = a_body1cont3loopBody1cont10cont1(loopDepth); } return loopDepth; @@ -20009,11 +21408,11 @@ class GetRangeActorState { int a_body1cont3loopBody1cont1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 4415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionPhysicalReadsCompleted; - #line 4416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1cont3loopBody1cont1Catch1(__current_error, loopDepth); - #line 20016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1cont3loopBody1cont1Catch1(error, loopDepth); @@ -20023,37 +21422,37 @@ class GetRangeActorState { return loopDepth; } - int a_body1cont3loopBody1cont11(GetKeyValuesFamilyReply const& _rep,int loopDepth) + int a_body1cont3loopBody1cont12(GetKeyValuesFamilyReply const& _rep,int loopDepth) { - #line 4412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rep = _rep; - #line 4413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionPhysicalReadsCompleted; - #line 20032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont3loopBody1cont11cont2(loopDepth); + #line 21431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3loopBody1cont12cont2(loopDepth); return loopDepth; } - int a_body1cont3loopBody1cont11(GetKeyValuesFamilyReply && _rep,int loopDepth) + int a_body1cont3loopBody1cont12(GetKeyValuesFamilyReply && _rep,int loopDepth) { - #line 4412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rep = _rep; - #line 4413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionPhysicalReadsCompleted; - #line 20043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont3loopBody1cont11cont2(loopDepth); + #line 21442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3loopBody1cont12cont2(loopDepth); return loopDepth; } int a_body1cont3loopBody1cont1when1(GetKeyValuesFamilyReply const& _rep,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont11(_rep, loopDepth); + loopDepth = a_body1cont3loopBody1cont12(_rep, loopDepth); return loopDepth; } int a_body1cont3loopBody1cont1when1(GetKeyValuesFamilyReply && _rep,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont11(std::move(_rep), loopDepth); + loopDepth = a_body1cont3loopBody1cont12(std::move(_rep), loopDepth); return loopDepth; } @@ -20108,10 +21507,10 @@ class GetRangeActorState { fdb_probe_actor_exit("getRange", reinterpret_cast(this), 2); } - int a_body1cont3loopBody1cont11cont2(int loopDepth) + int a_body1cont3loopBody1cont12cont2(int loopDepth) { try { - loopDepth = a_body1cont3loopBody1cont9(loopDepth); + loopDepth = a_body1cont3loopBody1cont10(loopDepth); } catch (Error& error) { loopDepth = a_body1cont3loopBody1cont1Catch1(error, loopDepth); @@ -20121,39 +21520,39 @@ class GetRangeActorState { return loopDepth; } - int a_body1cont3loopBody1cont13(int loopDepth) + int a_body1cont3loopBody1cont10cont1(int loopDepth) { - loopDepth = a_body1cont3loopBody1cont13cont1(loopDepth); + loopDepth = a_body1cont3loopBody1cont10cont17(loopDepth); return loopDepth; } - int a_body1cont3loopBody1cont23(int loopDepth) + int a_body1cont3loopBody1cont10cont12(int loopDepth) { - #line 4523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (reverse) - #line 20134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" end = firstGreaterOrEqual(shard.begin); - #line 20138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 4526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" begin = firstGreaterOrEqual(shard.end); - #line 20144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - loopDepth = a_body1cont3loopBody1cont13(loopDepth); + loopDepth = a_body1cont3loopBody1cont10cont1(loopDepth); return loopDepth; } - int a_body1cont3loopBody1cont24(RangeResultFamily const& result,int loopDepth) + int a_body1cont3loopBody1cont10cont13(RangeResultFamily const& result,int loopDepth) { - #line 4518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" getRangeFinished( trState, startTime, originalBegin, originalEnd, snapshot, conflictRange, reverse, result); - #line 4520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 20156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(result); this->~GetRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -20161,13 +21560,13 @@ class GetRangeActorState { return loopDepth; } - int a_body1cont3loopBody1cont24(RangeResultFamily && result,int loopDepth) + int a_body1cont3loopBody1cont10cont13(RangeResultFamily && result,int loopDepth) { - #line 4518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" getRangeFinished( trState, startTime, originalBegin, originalEnd, snapshot, conflictRange, reverse, result); - #line 4520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 20170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(result); this->~GetRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -20175,15 +21574,15 @@ class GetRangeActorState { return loopDepth; } - int a_body1cont3loopBody1cont9when1(RangeResultFamily const& result,int loopDepth) + int a_body1cont3loopBody1cont10when1(RangeResultFamily const& result,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont24(result, loopDepth); + loopDepth = a_body1cont3loopBody1cont10cont13(result, loopDepth); return loopDepth; } - int a_body1cont3loopBody1cont9when1(RangeResultFamily && result,int loopDepth) + int a_body1cont3loopBody1cont10when1(RangeResultFamily && result,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont24(std::move(result), loopDepth); + loopDepth = a_body1cont3loopBody1cont10cont13(std::move(result), loopDepth); return loopDepth; } @@ -20198,7 +21597,7 @@ class GetRangeActorState { fdb_probe_actor_enter("getRange", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont3loopBody1cont9when1(value, 0); + a_body1cont3loopBody1cont10when1(value, 0); } catch (Error& error) { a_body1cont3loopBody1cont1Catch1(error, 0); @@ -20213,7 +21612,7 @@ class GetRangeActorState { fdb_probe_actor_enter("getRange", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont3loopBody1cont9when1(std::move(value), 0); + a_body1cont3loopBody1cont10when1(std::move(value), 0); } catch (Error& error) { a_body1cont3loopBody1cont1Catch1(error, 0); @@ -20238,7 +21637,7 @@ class GetRangeActorState { fdb_probe_actor_exit("getRange", reinterpret_cast(this), 3); } - int a_body1cont3loopBody1cont13cont1(int loopDepth) + int a_body1cont3loopBody1cont10cont17(int loopDepth) { try { loopDepth = a_body1cont3loopBody1cont3(loopDepth); @@ -20259,27 +21658,27 @@ class GetRangeActorState { } int a_body1cont3loopBody1cont1Catch1cont3(int loopDepth) { - #line 4563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_5 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, trState->taskID); - #line 4563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 20266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch2(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont1Catch1cont3when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 4563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 20271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3loopBody1cont1Catch1cont4(RangeResultFamily const& result,int loopDepth) { - #line 4558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" getRangeFinished( trState, startTime, originalBegin, originalEnd, snapshot, conflictRange, reverse, result); - #line 4560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 20282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(result); this->~GetRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -20289,11 +21688,11 @@ class GetRangeActorState { } int a_body1cont3loopBody1cont1Catch1cont4(RangeResultFamily && result,int loopDepth) { - #line 4558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" getRangeFinished( trState, startTime, originalBegin, originalEnd, snapshot, conflictRange, reverse, result); - #line 4560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 20296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< RangeResultFamily >::value()) RangeResultFamily(result); this->~GetRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -20439,141 +21838,56 @@ class GetRangeActorState { fdb_probe_actor_exit("getRange", reinterpret_cast(this), 5); } - int a_body1cont3loopBody1cont1Catch1cont7(int loopDepth) - { - loopDepth = a_body1cont3loopBody1cont1Catch1cont1(loopDepth); - - return loopDepth; - } - int a_body1cont3loopBody1cont1Catch1cont8(Void const& _,int loopDepth) - { - loopDepth = a_body1cont3loopBody1cont1Catch1cont7(loopDepth); - - return loopDepth; - } - int a_body1cont3loopBody1cont1Catch1cont8(Void && _,int loopDepth) - { - loopDepth = a_body1cont3loopBody1cont1Catch1cont7(loopDepth); - - return loopDepth; - } - int a_body1cont3loopBody1cont1Catch1when2(Void const& _,int loopDepth) - { - loopDepth = a_body1cont3loopBody1cont1Catch1cont8(_, loopDepth); - - return loopDepth; - } - int a_body1cont3loopBody1cont1Catch1when2(Void && _,int loopDepth) - { - loopDepth = a_body1cont3loopBody1cont1Catch1cont8(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose7() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRangeActor, 6, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GetRangeActor, 6, Void >*,Void const& value) - { - fdb_probe_actor_enter("getRange", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1cont3loopBody1cont1Catch1when2(value, 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("getRange", reinterpret_cast(this), 6); - - } - void a_callback_fire(ActorCallback< GetRangeActor, 6, Void >*,Void && value) - { - fdb_probe_actor_enter("getRange", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1cont3loopBody1cont1Catch1when2(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("getRange", reinterpret_cast(this), 6); - - } - void a_callback_error(ActorCallback< GetRangeActor, 6, Void >*,Error err) - { - fdb_probe_actor_enter("getRange", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1Catch2(err, 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("getRange", reinterpret_cast(this), 6); - - } - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future fVersion; - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeySelector begin; - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeySelector end; - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key mapper; - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetRangeLimits limits; - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Promise> conflictRange; - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Snapshot snapshot; - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reverse reverse; - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UseTenant useTenant; - #line 4286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetRangeLimits originalLimits; - #line 4287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeySelector originalBegin; - #line 4288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeySelector originalEnd; - #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" RangeResultFamily output; - #line 4290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 4296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 4299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional getRangeID; + #line 4602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double startTime; - #line 4300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version readVersion; - #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRangeLocationInfo beginServer; - #line 4329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange shard; - #line 4330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool modifiedSelectors; - #line 4331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetKeyValuesFamilyRequest req; - #line 4397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetKeyValuesFamilyReply rep; - #line 20569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getRange() - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetRangeActor final : public Actor, public ActorCallback< GetRangeActor, 0, Version >, public ActorCallback< GetRangeActor, 1, KeyRangeLocationInfo >, public ActorCallback< GetRangeActor, 2, GetKeyValuesFamilyReply >, public ActorCallback< GetRangeActor, 3, RangeResultFamily >, public ActorCallback< GetRangeActor, 4, RangeResultFamily >, public ActorCallback< GetRangeActor, 5, Void >, public ActorCallback< GetRangeActor, 6, Void >, public FastAllocated>, public GetRangeActorState> { - #line 20576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetRangeActor final : public Actor, public ActorCallback< GetRangeActor, 0, Void >, public ActorCallback< GetRangeActor, 1, KeyRangeLocationInfo >, public ActorCallback< GetRangeActor, 2, GetKeyValuesFamilyReply >, public ActorCallback< GetRangeActor, 3, RangeResultFamily >, public ActorCallback< GetRangeActor, 4, RangeResultFamily >, public ActorCallback< GetRangeActor, 5, Void >, public FastAllocated>, public GetRangeActorState> { + #line 21890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -20581,18 +21895,17 @@ class GetRangeActor final : public Actor, public ActorCallbac #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetRangeActor, 0, Version >; +friend struct ActorCallback< GetRangeActor, 0, Void >; friend struct ActorCallback< GetRangeActor, 1, KeyRangeLocationInfo >; friend struct ActorCallback< GetRangeActor, 2, GetKeyValuesFamilyReply >; friend struct ActorCallback< GetRangeActor, 3, RangeResultFamily >; friend struct ActorCallback< GetRangeActor, 4, RangeResultFamily >; friend struct ActorCallback< GetRangeActor, 5, Void >; -friend struct ActorCallback< GetRangeActor, 6, Void >; - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetRangeActor(Reference const& trState,Future const& fVersion,KeySelector const& begin,KeySelector const& end,Key const& mapper,GetRangeLimits const& limits,Promise> const& conflictRange,Snapshot const& snapshot,Reverse const& reverse,UseTenant const& useTenant = UseTenant::True) - #line 20593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetRangeActor(Reference const& trState,KeySelector const& begin,KeySelector const& end,Key const& mapper,GetRangeLimits const& limits,Promise> const& conflictRange,Snapshot const& snapshot,Reverse const& reverse,UseTenant const& useTenant = UseTenant::True) + #line 21906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - GetRangeActorState>(trState, fVersion, begin, end, mapper, limits, conflictRange, snapshot, reverse, useTenant) + GetRangeActorState>(trState, begin, end, mapper, limits, conflictRange, snapshot, reverse, useTenant) { fdb_probe_actor_enter("getRange", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -20608,28 +21921,27 @@ friend struct ActorCallback< GetRangeActoractor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetRangeActor, 0, Version >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetRangeActor, 0, Void >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< GetRangeActor, 1, KeyRangeLocationInfo >*)0, actor_cancelled()); break; case 3: this->a_callback_error((ActorCallback< GetRangeActor, 2, GetKeyValuesFamilyReply >*)0, actor_cancelled()); break; case 4: this->a_callback_error((ActorCallback< GetRangeActor, 3, RangeResultFamily >*)0, actor_cancelled()); break; case 5: this->a_callback_error((ActorCallback< GetRangeActor, 4, RangeResultFamily >*)0, actor_cancelled()); break; case 6: this->a_callback_error((ActorCallback< GetRangeActor, 5, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< GetRangeActor, 6, Void >*)0, actor_cancelled()); break; } } }; } - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future getRange( Reference const& trState, Future const& fVersion, KeySelector const& begin, KeySelector const& end, Key const& mapper, GetRangeLimits const& limits, Promise> const& conflictRange, Snapshot const& snapshot, Reverse const& reverse, UseTenant const& useTenant = UseTenant::True ) { - #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new GetRangeActor(trState, fVersion, begin, end, mapper, limits, conflictRange, snapshot, reverse, useTenant)); - #line 20629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getRange( Reference const& trState, KeySelector const& begin, KeySelector const& end, Key const& mapper, GetRangeLimits const& limits, Promise> const& conflictRange, Snapshot const& snapshot, Reverse const& reverse, UseTenant const& useTenant = UseTenant::True ) { + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetRangeActor(trState, begin, end, mapper, limits, conflictRange, snapshot, reverse, useTenant)); + #line 21941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 4590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 4877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template struct TSSDuplicateStreamData { @@ -20654,35 +21966,35 @@ struct TSSDuplicateStreamData { // Error tracking here is weird, and latency doesn't really mean the same thing here as it does with normal tss // comparisons, so this is pretty much just counting mismatches - #line 20657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via tssStreamComparison() - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class TssStreamComparisonActorState { - #line 20664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TssStreamComparisonActorState(Request const& request,TSSDuplicateStreamData const& streamData,ReplyPromiseStream const& tssReplyStream,TSSEndpointData const& tssData) - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : request(request), - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" streamData(streamData), - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssReplyStream(tssReplyStream), - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssData(tssData), - #line 4619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ssEndOfStream(false), - #line 4620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssEndOfStream(false), - #line 4621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ssReply(Optional()), - #line 4622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssReply(Optional()) - #line 20685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 21997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("tssStreamComparison", reinterpret_cast(this)); @@ -20695,9 +22007,9 @@ class TssStreamComparisonActorState { int a_body1(int loopDepth=0) { try { - #line 4624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 20700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -20725,24 +22037,24 @@ class TssStreamComparisonActorState { } int a_body1loopBody1(int loopDepth) { - #line 4626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ssReply = Optional(); - #line 4627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssReply = Optional(); - #line 4629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" startTime = now(); - #line 20734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 4632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" FutureStream __when_expr_0 = streamData.stream.getFuture(); - #line 4632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 20740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 4632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 20745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -20755,26 +22067,26 @@ class TssStreamComparisonActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 4649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" sleepTime = std::max(startTime + FLOW_KNOBS->LOAD_BALANCE_TSS_TIMEOUT - now(), 0.0); - #line 20760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 4653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" FutureStream __when_expr_1 = tssReplyStream.getFuture(); - #line 4652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 20766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont1when1(__when_expr_1.pop(), loopDepth); }; - #line 4656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = delay(sleepTime); - #line 20770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 20777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -20788,33 +22100,33 @@ class TssStreamComparisonActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 4635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_actor_cancelled) - #line 20793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" streamData.setDone(); - #line 4637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 20799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_end_of_stream) - #line 20803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ssEndOfStream = true; - #line 20807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 4644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssData.metrics->ssError(e.code()); - #line 20813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(e.code() != error_code_end_of_stream); - #line 20817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(e.code() != error_code_end_of_stream, "SS got error in TSS stream comparison"); + #line 22129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); } catch (Error& error) { @@ -20827,18 +22139,18 @@ class TssStreamComparisonActorState { } int a_body1loopBody1cont2(REPLYSTREAM_TYPE(Request) const& _ssReply,int loopDepth) { - #line 4633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ssReply = _ssReply; - #line 20832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont4(loopDepth); return loopDepth; } int a_body1loopBody1cont2(REPLYSTREAM_TYPE(Request) && _ssReply,int loopDepth) { - #line 4633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ssReply = _ssReply; - #line 20841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont4(loopDepth); return loopDepth; @@ -20921,85 +22233,83 @@ class TssStreamComparisonActorState { } int a_body1loopBody1cont5(int loopDepth) { - #line 4676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!ssEndOfStream || !tssEndOfStream) - #line 20926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++tssData.metrics->streamComparisons; - #line 20930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (ssReply.present() && tssReply.present()) - #line 20934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(ssEndOfStream != tssEndOfStream); - #line 4689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if ((!ssEndOfStream || !tssEndOfStream) && !TSS_doCompare(ssReply.get(), tssReply.get())) - #line 20940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 4691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent mismatchEvent( (g_network->isSimulated() && g_simulator.tssMode == ISimulator::TSSMode::EnabledDropMutations) ? SevWarnAlways : SevError, TSS_mismatchTraceName(request)); - #line 4696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "TSS mismatch in stream comparison"); + #line 4977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent mismatchEvent( (g_network->isSimulated() && g_simulator->tssMode == ISimulator::TSSMode::EnabledDropMutations) ? SevWarnAlways : SevError, TSS_mismatchTraceName(request)); + #line 4982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" mismatchEvent.setMaxEventLength(FLOW_KNOBS->TSS_LARGE_TRACE_SIZE); - #line 4697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" mismatchEvent.detail("TSSID", tssData.tssId); - #line 4699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (tssData.metrics->shouldRecordDetailedMismatch()) - #line 20952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TSS_traceMismatch(mismatchEvent, request, ssReply.get(), tssReply.get()); - #line 4702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(FLOW_KNOBS ->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL); - #line 4704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL); - #line 4707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL, "Tracing Full TSS Mismatch in stream comparison", probe::decoration::rare); + #line 4991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL, "Tracing Partial TSS Mismatch in stream comparison and storing the rest in FDB"); + #line 4994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL) - #line 20962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" mismatchEvent.disable(); - #line 4709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UID mismatchUID = deterministicRandom()->randomUniqueID(); - #line 4710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssData.metrics->recordDetailedMismatchData(mismatchUID, mismatchEvent.getFields().toString()); - #line 4713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent summaryEvent((g_network->isSimulated() && g_simulator.tssMode == ISimulator::TSSMode::EnabledDropMutations) ? SevWarnAlways : SevError, TSS_mismatchTraceName(request)); - #line 4718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent summaryEvent((g_network->isSimulated() && g_simulator->tssMode == ISimulator::TSSMode::EnabledDropMutations) ? SevWarnAlways : SevError, TSS_mismatchTraceName(request)); + #line 5005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" summaryEvent.detail("TSSID", tssData.tssId).detail("MismatchId", mismatchUID); - #line 20974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } else { - #line 4722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" mismatchEvent.disable(); - #line 20981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" streamData.setDone(); - #line 4725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TssStreamComparisonActorState(); static_cast(this)->destroy(); return 0; } - #line 20987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TssStreamComparisonActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 4728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!ssReply.present() || !tssReply.present() || ssEndOfStream || tssEndOfStream) - #line 20996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" streamData.setDone(); - #line 4731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TssStreamComparisonActorState(); static_cast(this)->destroy(); return 0; } - #line 21002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TssStreamComparisonActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -21012,33 +22322,33 @@ class TssStreamComparisonActorState { int a_body1loopBody1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 4662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_actor_cancelled) - #line 21017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" streamData.setDone(); - #line 4664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 21023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_end_of_stream) - #line 21027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssEndOfStream = true; - #line 21031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 4671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssData.metrics->tssError(e.code()); - #line 21037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(e.code() != error_code_end_of_stream); - #line 21041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(e.code() != error_code_end_of_stream, "TSS got error in TSS stream comparison"); + #line 22351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont5(loopDepth); } catch (Error& error) { @@ -21057,40 +22367,40 @@ class TssStreamComparisonActorState { } int a_body1loopBody1cont1when1(REPLYSTREAM_TYPE(Request) const& _tssReply,int loopDepth) { - #line 4654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssReply = _tssReply; - #line 21062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; } int a_body1loopBody1cont1when1(REPLYSTREAM_TYPE(Request) && _tssReply,int loopDepth) { - #line 4654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssReply = _tssReply; - #line 21071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; } int a_body1loopBody1cont1when2(Void const& _,int loopDepth) { - #line 4657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++tssData.metrics->tssTimeouts; - #line 4658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 21082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Got TSS timeout in stream comparison", probe::decoration::rare); + #line 22392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; } int a_body1loopBody1cont1when2(Void && _,int loopDepth) { - #line 4657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++tssData.metrics->tssTimeouts; - #line 4658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 21093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 4945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Got TSS timeout in stream comparison", probe::decoration::rare); + #line 22403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; @@ -21205,34 +22515,34 @@ class TssStreamComparisonActorState { return loopDepth; } - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Request request; - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TSSDuplicateStreamData streamData; - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ReplyPromiseStream tssReplyStream; - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TSSEndpointData tssData; - #line 4619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool ssEndOfStream; - #line 4620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool tssEndOfStream; - #line 4621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional ssReply; - #line 4622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional tssReply; - #line 4629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double startTime; - #line 4649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double sleepTime; - #line 21228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via tssStreamComparison() - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class TssStreamComparisonActor final : public Actor, public ActorSingleCallback< TssStreamComparisonActor, 0, REPLYSTREAM_TYPE(Request) >, public ActorSingleCallback< TssStreamComparisonActor, 1, REPLYSTREAM_TYPE(Request) >, public ActorCallback< TssStreamComparisonActor, 2, Void >, public FastAllocated>, public TssStreamComparisonActorState> { - #line 21235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -21243,9 +22553,9 @@ class TssStreamComparisonActor final : public Actor, public ActorSingleCal friend struct ActorSingleCallback< TssStreamComparisonActor, 0, REPLYSTREAM_TYPE(Request) >; friend struct ActorSingleCallback< TssStreamComparisonActor, 1, REPLYSTREAM_TYPE(Request) >; friend struct ActorCallback< TssStreamComparisonActor, 2, Void >; - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TssStreamComparisonActor(Request const& request,TSSDuplicateStreamData const& streamData,ReplyPromiseStream const& tssReplyStream,TSSEndpointData const& tssData) - #line 21248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), TssStreamComparisonActorState>(request, streamData, tssReplyStream, tssData) { @@ -21270,27 +22580,27 @@ friend struct ActorCallback< TssStreamComparisonActor, 2, Void >; } }; } - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] static Future tssStreamComparison( Request const& request, TSSDuplicateStreamData const& streamData, ReplyPromiseStream const& tssReplyStream, TSSEndpointData const& tssData ) { - #line 4614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 4901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new TssStreamComparisonActor(request, streamData, tssReplyStream, tssData)); - #line 21279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 4735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 5022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" // Currently only used for GetKeyValuesStream but could easily be plugged for other stream types // User of the stream has to forward the SS's responses to the returned promise stream, if it is set -template +template Optional> -maybeDuplicateTSSStreamFragment(Request& req, QueueModel* model, RequestStream const* ssStream) { +maybeDuplicateTSSStreamFragment(Request& req, QueueModel* model, RequestStream const* ssStream) { if (model) { Optional tssData = model->getTssData(ssStream->getEndpoint().token.first()); if (tssData.present()) { - TEST(true); // duplicating stream to TSS + CODE_PROBE(true, "duplicating stream to TSS"); resetReply(req); // FIXME: optimize to avoid creating new netNotifiedQueueWithAcknowledgements for each stream duplication RequestStream tssRequestStream(tssData.get().endpoint); @@ -21305,35 +22615,33 @@ maybeDuplicateTSSStreamFragment(Request& req, QueueModel* model, RequestStream - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetRangeStreamFragmentActorState { - #line 21315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetRangeStreamFragmentActorState(Reference const& trState,ParallelStream::Fragment* const& results,Version const& version,KeyRange const& keys,GetRangeLimits const& limits,Snapshot const& snapshot,Reverse const& reverse,SpanID const& spanContext) - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetRangeStreamFragmentActorState(Reference const& trState,ParallelStream::Fragment* const& results,KeyRange const& keys,GetRangeLimits const& limits,Snapshot const& snapshot,Reverse const& reverse,SpanContext const& spanContext) + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results(results), - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version(version), - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys(keys), - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" limits(limits), - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" snapshot(snapshot), - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" reverse(reverse), - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" spanContext(spanContext) - #line 21336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getRangeStreamFragment", reinterpret_cast(this)); @@ -21346,9 +22654,9 @@ class GetRangeStreamFragmentActorState { int a_body1(int loopDepth=0) { try { - #line 4768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 21351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -21376,38 +22684,38 @@ class GetRangeStreamFragmentActorState { } int a_body1loopBody1(int loopDepth) { - #line 4769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_0 = getKeyRangeLocations(trState, keys, CLIENT_KNOBS->GET_RANGE_SHARD_LIMIT, reverse, &StorageServerInterface::getKeyValuesStream, UseTenant::True, version); - #line 4769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_0 = getKeyRangeLocations(trState, keys, CLIENT_KNOBS->GET_RANGE_SHARD_LIMIT, reverse, &StorageServerInterface::getKeyValuesStream, UseTenant::True); + #line 5055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 21383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 4769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 21388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(int loopDepth) { - #line 4777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(locations.size()); - #line 4778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" shard = 0; - #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 21401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1when1(std::vector const& __locations,int loopDepth) { - #line 4769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" locations = __locations; - #line 21410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -21485,64 +22793,64 @@ class GetRangeStreamFragmentActorState { } int a_body1loopBody1cont1loopBody1(int loopDepth) { - #line 4780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" const KeyRange& range = locations[shard].range; - #line 4782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssDuplicateStream = Optional>(); - #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req = GetKeyValuesStreamRequest(); - #line 4784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.tenantInfo = trState->getTenantInfo(); - #line 4785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.version = version; - #line 4786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.version = trState->readVersion(); + #line 5071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.begin = firstGreaterOrEqual(range.begin); - #line 4787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.end = firstGreaterOrEqual(range.end); - #line 4788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.spanContext = spanContext; - #line 4789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.limit = reverse ? -CLIENT_KNOBS->REPLY_BYTE_LIMIT : CLIENT_KNOBS->REPLY_BYTE_LIMIT; - #line 4790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.limitBytes = std::numeric_limits::max(); - #line 4791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->getLatestCommitVersions( locations[shard].locations, req.version, trState, req.ssLatestCommitVersions); - #line 4795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.options = trState->readOptions; + #line 5078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->getLatestCommitVersions(locations[shard].locations, trState, req.ssLatestCommitVersions); + #line 5081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.arena.dependsOn(range.arena()); - #line 4797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(req.limitBytes > 0 && req.limit != 0 && req.limit < 0 == reverse); - #line 4800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.tags = trState->cx->sampleReadTags() ? trState->options.readTags : Optional(); - #line 4801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.debugID = trState->debugID; - #line 21518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 4804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->debugID.present()) - #line 21522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) + #line 22830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent( "TransactionDebug", trState->debugID.get().first(), "NativeAPI.RangeStream.Before"); - #line 21526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent("TransactionDebug", trState->readOptions.get().debugID.get().first(), "NativeAPI.RangeStream.Before"); + #line 22834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionPhysicalReads; - #line 4809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rep = GetKeyValuesStreamReply(); - #line 4811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (locations[shard].locations->size() == 0) - #line 21534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = trState->cx->connectionFileChanged(); - #line 4812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 21540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 4812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 21545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else @@ -21580,90 +22888,67 @@ class GetRangeStreamFragmentActorState { int a_body1loopBody1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 5005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (tssDuplicateStream.present() && !tssDuplicateStream.get().done()) - #line 21585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssDuplicateStream.get().stream.sendError(e); - #line 21589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 5008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_actor_cancelled) - #line 21593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 2)); - #line 21597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 5011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || e.code() == error_code_connection_failed) - #line 21601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || e.code() == error_code_connection_failed || e.code() == error_code_request_maybe_delivered) + #line 22909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" const KeyRangeRef& range = locations[shard].range; - #line 5015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (reverse) - #line 21607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys = KeyRangeRef(keys.begin, range.end); - #line 21611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 5018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys = KeyRangeRef(range.begin, keys.end); - #line 21617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 5020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->invalidateCache(locations[0].tenantEntry.prefix, keys); - #line 5022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->invalidateCache(trState->tenant().mapRef(&Tenant::prefix), keys); + #line 5314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_6 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, trState->taskID); - #line 5022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 21625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont1loopBody1Catch1when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 5022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 21630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - #line 5024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_unknown_tenant) - #line 21637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 5025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(trState->tenant().present()); - #line 5026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->invalidateCachedTenant(trState->tenant().get()); - #line 5027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_7 = delay(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, trState->taskID); - #line 5027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 21647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont1loopBody1Catch1when2(__when_expr_7.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 5027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 21652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 5030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->sendError(e); - #line 5031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetRangeStreamFragmentActorState(); static_cast(this)->destroy(); return 0; } - #line 21661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~GetRangeStreamFragmentActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } + #line 5317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->sendError(e); + #line 5318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetRangeStreamFragmentActorState(); static_cast(this)->destroy(); return 0; } + #line 22947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~GetRangeStreamFragmentActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } } catch (Error& error) { @@ -21676,22 +22961,22 @@ class GetRangeStreamFragmentActorState { } int a_body1loopBody1cont1loopBody1cont2(int loopDepth) { - #line 4817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" useIdx = -1; - #line 4819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 21683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopBody1cont2loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1cont1loopBody1cont4(Void const& _,int loopDepth) { - #line 4813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results->sendError(transaction_too_old()); - #line 4814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetRangeStreamFragmentActorState(); static_cast(this)->destroy(); return 0; } - #line 21694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~GetRangeStreamFragmentActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -21701,11 +22986,11 @@ class GetRangeStreamFragmentActorState { } int a_body1loopBody1cont1loopBody1cont4(Void && _,int loopDepth) { - #line 4813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results->sendError(transaction_too_old()); - #line 4814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetRangeStreamFragmentActorState(); static_cast(this)->destroy(); return 0; } - #line 21708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 22993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~GetRangeStreamFragmentActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -21778,15 +23063,15 @@ class GetRangeStreamFragmentActorState { } int a_body1loopBody1cont1loopBody1cont6(int loopDepth) { - #line 4858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" replyStream = locations[shard] .locations->get(useIdx, &StorageServerInterface::getKeyValuesStream) .getReplyStream(req); - #line 4863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssDuplicateStream = maybeDuplicateTSSStreamFragment( req, trState->cx->enableLocalityLoadBalance ? &trState->cx->queueModel : nullptr, &locations[shard].locations->get(useIdx, &StorageServerInterface::getKeyValuesStream)); - #line 4868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" breakAgain = false; - #line 4869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 21789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopBody1cont6loopHead1(loopDepth); return loopDepth; @@ -21800,56 +23085,56 @@ class GetRangeStreamFragmentActorState { } int a_body1loopBody1cont1loopBody1cont2loopBody1(int loopDepth) { - #line 4822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int count = 0; - #line 4823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < locations[shard].locations->size();i++) { - #line 4824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!IFailureMonitor::failureMonitor() .getState(locations[shard] .locations->get(i, &StorageServerInterface::getKeyValuesStream) .getEndpoint()) .failed) - #line 21809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (deterministicRandom()->random01() <= 1.0 / ++count) - #line 21813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" useIdx = i; - #line 21817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } } - #line 4835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (useIdx >= 0) - #line 21823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { return a_body1loopBody1cont1loopBody1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 4839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector> ok(locations[shard].locations->size()); - #line 4840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < ok.size();i++) { - #line 4841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ok[i] = IFailureMonitor::failureMonitor().onStateEqual( locations[shard] .locations->get(i, &StorageServerInterface::getKeyValuesStream) .getEndpoint(), FailureStatus(false)); - #line 21833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (now() - g_network->networkInfo.newestAlternativesFailure > 1 || deterministicRandom()->random01() < 0.01) - #line 21837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent("AllAlternativesFailed") .detail("Alternatives", locations[shard].locations->description()); - #line 21841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = allAlternativesFailedDelay(quorum(ok, 1)); - #line 4855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 21847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont1loopBody1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1loopBody1cont2loopBody1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 4855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 21852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -21944,9 +23229,9 @@ class GetRangeStreamFragmentActorState { } int a_body1loopBody1cont1loopBody1cont7(int loopDepth) { - #line 5000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (breakAgain) - #line 21949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break } @@ -21963,16 +23248,16 @@ class GetRangeStreamFragmentActorState { } int a_body1loopBody1cont1loopBody1cont6loopBody1(int loopDepth) { - #line 4870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = results->onEmpty(); - #line 4870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 21970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1cont1loopBody1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1loopBody1cont6loopBody1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 4870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 21975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -21993,22 +23278,22 @@ class GetRangeStreamFragmentActorState { int a_body1loopBody1cont1loopBody1cont6loopBody1cont1(Void const& _,int loopDepth) { try { - #line 4873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_4 = trState->cx->connectionFileChanged(); - #line 4872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1loopBody1cont6loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 22000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1cont1loopBody1cont6loopBody1cont1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont1loopBody1cont6loopBody1cont1when1(__when_expr_4.get(), loopDepth); }; - #line 4881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" FutureStream __when_expr_5 = replyStream.getFuture(); - #line 22004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1cont1loopBody1cont6loopBody1cont1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont1loopBody1cont6loopBody1cont1when2(__when_expr_5.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 22011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -22022,22 +23307,22 @@ class GetRangeStreamFragmentActorState { int a_body1loopBody1cont1loopBody1cont6loopBody1cont1(Void && _,int loopDepth) { try { - #line 4873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_4 = trState->cx->connectionFileChanged(); - #line 4872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1loopBody1cont6loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 22029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1cont1loopBody1cont6loopBody1cont1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont1loopBody1cont6loopBody1cont1when1(__when_expr_4.get(), loopDepth); }; - #line 4881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" FutureStream __when_expr_5 = replyStream.getFuture(); - #line 22033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1cont1loopBody1cont6loopBody1cont1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont1loopBody1cont6loopBody1cont1when2(__when_expr_5.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 4873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 22040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -22113,195 +23398,199 @@ class GetRangeStreamFragmentActorState { } int a_body1loopBody1cont1loopBody1cont6loopBody1cont2(int loopDepth) { - #line 4902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->debugID.present()) - #line 22118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) + #line 23403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent( "TransactionDebug", trState->debugID.get().first(), "NativeAPI.getExactRange.After"); - #line 22122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent("TransactionDebug", trState->readOptions.get().debugID.get().first(), "NativeAPI.getExactRange.After"); + #line 23407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" RangeResult output(RangeResultRef(rep.data, rep.more), rep.arena); - #line 4907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (tssDuplicateStream.present() && !tssDuplicateStream.get().done()) - #line 22128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetKeyValuesStreamReply replyCopy; - #line 4910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" replyCopy.version = rep.version; - #line 4911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" replyCopy.more = rep.more; - #line 4912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" replyCopy.cached = rep.cached; - #line 4913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" replyCopy.arena.dependsOn(rep.arena); - #line 4914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" replyCopy.data.append(replyCopy.arena, rep.data.begin(), rep.data.size()); - #line 4915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssDuplicateStream.get().stream.send(replyCopy); - #line 22144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t bytes = 0; - #line 4919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( const KeyValueRef& kv : output ) { - #line 4920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bytes += kv.key.size() + kv.value.size(); - #line 22152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->transactionBytesRead += bytes; - #line 4924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->transactionKeysRead += output.size(); - #line 4927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (reverse && output.more && rep.data.size() > 0 && output[output.size() - 1].key == locations[shard].range.begin) - #line 22160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.more = false; - #line 22164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (output.more) - #line 22168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!rep.data.size()) - #line 22172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevError, "GetRangeStreamError") .detail("Reason", "More data indicated but no rows present") .detail("LimitBytes", limits.bytes) .detail("LimitRows", limits.rows) .detail("OutputSize", output.size()) .detail("OutputBytes", output.expectedSize()) .detail("BlockSize", rep.data.size()) .detail("BlockBytes", rep.data.expectedSize()); - #line 4942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(false); - #line 22178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 4946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "GetKeyValuesStreamReply.more in getRangeStream"); + #line 5233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (reverse) - #line 22184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" locations[shard].range = KeyRangeRef(locations[shard].range.begin, output[output.size() - 1].key); - #line 22188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 4950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" locations[shard].range = KeyRangeRef(keyAfter(output[output.size() - 1].key), locations[shard].range.end); - #line 22194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 4954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (locations[shard].range.empty()) - #line 22199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.more = false; - #line 22203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!output.more) - #line 22207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" const KeyRange& range = locations[shard].range; - #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (shard == locations.size() - 1) - #line 22213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef begin = reverse ? keys.begin : range.end; - #line 4962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef end = reverse ? range.begin : keys.end; - #line 4964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (begin >= end) - #line 22221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (range.begin == allKeys.begin) - #line 22225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.readToBegin = true; - #line 22229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (range.end == allKeys.end) - #line 22233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.readThroughEnd = true; - #line 22237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.arena().dependsOn(keys.arena()); - #line 4972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - output.readThrough = reverse ? keys.begin : keys.end; - #line 4973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + output.more = true; + #line 5262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + output.setReadThrough(reverse ? keys.begin : keys.end); + #line 5263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results->send(std::move(output)); - #line 4974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results->finish(); - #line 4975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (tssDuplicateStream.present() && !tssDuplicateStream.get().done()) - #line 22249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssDuplicateStream.get().stream.sendError(end_of_stream()); - #line 22253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetRangeStreamFragmentActorState(); static_cast(this)->destroy(); return 0; } - #line 22257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~GetRangeStreamFragmentActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 4980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys = KeyRangeRef(begin, end); - #line 4981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" breakAgain = true; - #line 22267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 4983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++shard; - #line 22273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.arena().dependsOn(range.arena()); - #line 4986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - output.readThrough = reverse ? range.begin : range.end; - #line 4987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + output.more = true; + #line 5278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + output.setReadThrough(reverse ? range.begin : range.end); + #line 5279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results->send(std::move(output)); - #line 22281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return a_body1loopBody1cont1loopBody1cont6break1(loopDepth==0?0:loopDepth-1); // break } - #line 4991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(output.size()); - #line 4992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (keys.begin == allKeys.begin && !reverse) - #line 22288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.readToBegin = true; - #line 22292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (keys.end == allKeys.end && reverse) - #line 22296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" output.readThroughEnd = true; - #line 22300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results->send(std::move(output)); - #line 22304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1cont1loopBody1cont6loopHead1(0); return loopDepth; @@ -22309,43 +23598,43 @@ class GetRangeStreamFragmentActorState { int a_body1loopBody1cont1loopBody1cont6loopBody1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 4887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionPhysicalReadsCompleted; - #line 4888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_broken_promise) - #line 22316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (tssDuplicateStream.present() && !tssDuplicateStream.get().done()) - #line 22320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssDuplicateStream.get().stream.sendError(connection_failed()); - #line 22324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1loopBody1cont1loopBody1Catch1(connection_failed(), std::max(0, loopDepth - 1)); - #line 22328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() != error_code_end_of_stream) - #line 22332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (tssDuplicateStream.present() && !tssDuplicateStream.get().done()) - #line 22336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssDuplicateStream.get().stream.sendError(e); - #line 22340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1loopBody1cont1loopBody1Catch1(e, std::max(0, loopDepth - 1)); - #line 22344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rep = GetKeyValuesStreamReply(); - #line 22348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopBody1cont6loopBody1cont2(loopDepth); } catch (Error& error) { @@ -22358,28 +23647,28 @@ class GetRangeStreamFragmentActorState { } int a_body1loopBody1cont1loopBody1cont6loopBody1cont3(int loopDepth) { - #line 4885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionPhysicalReadsCompleted; - #line 22363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopBody1cont6loopBody1cont5(loopDepth); return loopDepth; } int a_body1loopBody1cont1loopBody1cont6loopBody1cont1when1(Void const& _,int loopDepth) { - #line 4874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results->sendError(transaction_too_old()); - #line 4875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (tssDuplicateStream.present() && !tssDuplicateStream.get().done()) - #line 22374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssDuplicateStream.get().stream.sendError(transaction_too_old()); - #line 22378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetRangeStreamFragmentActorState(); static_cast(this)->destroy(); return 0; } - #line 22382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~GetRangeStreamFragmentActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -22389,19 +23678,19 @@ class GetRangeStreamFragmentActorState { } int a_body1loopBody1cont1loopBody1cont6loopBody1cont1when1(Void && _,int loopDepth) { - #line 4874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results->sendError(transaction_too_old()); - #line 4875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (tssDuplicateStream.present() && !tssDuplicateStream.get().done()) - #line 22396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 4876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tssDuplicateStream.get().stream.sendError(transaction_too_old()); - #line 22400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 4878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetRangeStreamFragmentActorState(); static_cast(this)->destroy(); return 0; } - #line 22404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~GetRangeStreamFragmentActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -22411,18 +23700,18 @@ class GetRangeStreamFragmentActorState { } int a_body1loopBody1cont1loopBody1cont6loopBody1cont1when2(GetKeyValuesStreamReply const& _rep,int loopDepth) { - #line 4882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rep = _rep; - #line 22416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopBody1cont6loopBody1cont3(loopDepth); return loopDepth; } int a_body1loopBody1cont1loopBody1cont6loopBody1cont1when2(GetKeyValuesStreamReply && _rep,int loopDepth) { - #line 4882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rep = _rep; - #line 22425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopBody1cont6loopBody1cont3(loopDepth); return loopDepth; @@ -22625,119 +23914,42 @@ class GetRangeStreamFragmentActorState { fdb_probe_actor_exit("getRangeStreamFragment", reinterpret_cast(this), 6); } - int a_body1loopBody1cont1loopBody1Catch1cont9(Void const& _,int loopDepth) - { - return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break - - return loopDepth; - } - int a_body1loopBody1cont1loopBody1Catch1cont9(Void && _,int loopDepth) - { - return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break - - return loopDepth; - } - int a_body1loopBody1cont1loopBody1Catch1when2(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1loopBody1Catch1cont9(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1loopBody1Catch1when2(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1loopBody1Catch1cont9(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose7() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRangeStreamFragmentActor, 7, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GetRangeStreamFragmentActor, 7, Void >*,Void const& value) - { - fdb_probe_actor_enter("getRangeStreamFragment", reinterpret_cast(this), 7); - a_exitChoose7(); - try { - a_body1loopBody1cont1loopBody1Catch1when2(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getRangeStreamFragment", reinterpret_cast(this), 7); - - } - void a_callback_fire(ActorCallback< GetRangeStreamFragmentActor, 7, Void >*,Void && value) - { - fdb_probe_actor_enter("getRangeStreamFragment", reinterpret_cast(this), 7); - a_exitChoose7(); - try { - a_body1loopBody1cont1loopBody1Catch1when2(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getRangeStreamFragment", reinterpret_cast(this), 7); - - } - void a_callback_error(ActorCallback< GetRangeStreamFragmentActor, 7, Void >*,Error err) - { - fdb_probe_actor_enter("getRangeStreamFragment", reinterpret_cast(this), 7); - a_exitChoose7(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getRangeStreamFragment", reinterpret_cast(this), 7); - - } - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ParallelStream::Fragment* results; - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange keys; - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetRangeLimits limits; - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Snapshot snapshot; - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reverse reverse; - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SpanID spanContext; - #line 4769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SpanContext spanContext; + #line 5055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector locations; - #line 4778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int shard; - #line 4782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional> tssDuplicateStream; - #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetKeyValuesStreamRequest req; - #line 4809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetKeyValuesStreamReply rep; - #line 4817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int useIdx; - #line 4858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ReplyPromiseStream replyStream; - #line 4868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool breakAgain; - #line 22735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 23947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getRangeStreamFragment() - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetRangeStreamFragmentActor final : public Actor, public ActorCallback< GetRangeStreamFragmentActor, 0, std::vector >, public ActorCallback< GetRangeStreamFragmentActor, 1, Void >, public ActorCallback< GetRangeStreamFragmentActor, 2, Void >, public ActorCallback< GetRangeStreamFragmentActor, 3, Void >, public ActorCallback< GetRangeStreamFragmentActor, 4, Void >, public ActorSingleCallback< GetRangeStreamFragmentActor, 5, GetKeyValuesStreamReply >, public ActorCallback< GetRangeStreamFragmentActor, 6, Void >, public ActorCallback< GetRangeStreamFragmentActor, 7, Void >, public FastAllocated, public GetRangeStreamFragmentActorState { - #line 22740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetRangeStreamFragmentActor final : public Actor, public ActorCallback< GetRangeStreamFragmentActor, 0, std::vector >, public ActorCallback< GetRangeStreamFragmentActor, 1, Void >, public ActorCallback< GetRangeStreamFragmentActor, 2, Void >, public ActorCallback< GetRangeStreamFragmentActor, 3, Void >, public ActorCallback< GetRangeStreamFragmentActor, 4, Void >, public ActorSingleCallback< GetRangeStreamFragmentActor, 5, GetKeyValuesStreamReply >, public ActorCallback< GetRangeStreamFragmentActor, 6, Void >, public FastAllocated, public GetRangeStreamFragmentActorState { + #line 23952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -22752,12 +23964,11 @@ friend struct ActorCallback< GetRangeStreamFragmentActor, 3, Void >; friend struct ActorCallback< GetRangeStreamFragmentActor, 4, Void >; friend struct ActorSingleCallback< GetRangeStreamFragmentActor, 5, GetKeyValuesStreamReply >; friend struct ActorCallback< GetRangeStreamFragmentActor, 6, Void >; -friend struct ActorCallback< GetRangeStreamFragmentActor, 7, Void >; - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetRangeStreamFragmentActor(Reference const& trState,ParallelStream::Fragment* const& results,Version const& version,KeyRange const& keys,GetRangeLimits const& limits,Snapshot const& snapshot,Reverse const& reverse,SpanID const& spanContext) - #line 22758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetRangeStreamFragmentActor(Reference const& trState,ParallelStream::Fragment* const& results,KeyRange const& keys,GetRangeLimits const& limits,Snapshot const& snapshot,Reverse const& reverse,SpanContext const& spanContext) + #line 23969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - GetRangeStreamFragmentActorState(trState, results, version, keys, limits, snapshot, reverse, spanContext) + GetRangeStreamFragmentActorState(trState, results, keys, limits, snapshot, reverse, spanContext) { fdb_probe_actor_enter("getRangeStreamFragment", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -22779,25 +23990,24 @@ friend struct ActorCallback< GetRangeStreamFragmentActor, 7, Void >; case 4: this->a_callback_error((ActorCallback< GetRangeStreamFragmentActor, 3, Void >*)0, actor_cancelled()); break; case 5: this->a_callback_error((ActorCallback< GetRangeStreamFragmentActor, 4, Void >*)0, actor_cancelled()); break; case 6: this->a_callback_error((ActorCallback< GetRangeStreamFragmentActor, 6, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< GetRangeStreamFragmentActor, 7, Void >*)0, actor_cancelled()); break; } } }; } - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future getRangeStreamFragment( Reference const& trState, ParallelStream::Fragment* const& results, Version const& version, KeyRange const& keys, GetRangeLimits const& limits, Snapshot const& snapshot, Reverse const& reverse, SpanID const& spanContext ) { - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new GetRangeStreamFragmentActor(trState, results, version, keys, limits, snapshot, reverse, spanContext)); - #line 22792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getRangeStreamFragment( Reference const& trState, ParallelStream::Fragment* const& results, KeyRange const& keys, GetRangeLimits const& limits, Snapshot const& snapshot, Reverse const& reverse, SpanContext const& spanContext ) { + #line 5047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetRangeStreamFragmentActor(trState, results, keys, limits, snapshot, reverse, spanContext)); + #line 24002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 5037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 5324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 22797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -[[nodiscard]] Future>> getRangeSplitPoints( Reference const& trState, KeyRange const& keys, int64_t const& chunkSize, Version const& version ); + #line 24007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +[[nodiscard]] Future>> getRangeSplitPoints( Reference const& trState, KeyRange const& keys, int64_t const& chunkSize ); -#line 5042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 5328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" static KeyRange intersect(KeyRangeRef lhs, KeyRangeRef rhs) { return KeyRange(KeyRangeRef(std::max(lhs.begin, rhs.begin), std::min(lhs.end, rhs.end))); @@ -22805,39 +24015,37 @@ static KeyRange intersect(KeyRangeRef lhs, KeyRangeRef rhs) { // Divides the requested key range into 1MB fragments, create range streams for each fragment, and merges the results so // the client get them in order - #line 22808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getRangeStream() - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetRangeStreamActorState { - #line 22815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetRangeStreamActorState(Reference const& trState,PromiseStream const& _results,Future const& fVersion,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Promise> const& conflictRange,Snapshot const& snapshot,Reverse const& reverse) - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetRangeStreamActorState(Reference const& trState,PromiseStream const& _results,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Promise> const& conflictRange,Snapshot const& snapshot,Reverse const& reverse) + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" _results(_results), - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fVersion(fVersion), - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" begin(begin), - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" end(end), - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" limits(limits), - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" conflictRange(conflictRange), - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" snapshot(snapshot), - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" reverse(reverse), - #line 5058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results(_results, CLIENT_KNOBS->RANGESTREAM_BUFFERED_FRAGMENTS_LIMIT) - #line 22840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getRangeStream", reinterpret_cast(this)); @@ -22850,20 +24058,20 @@ class GetRangeStreamActorState { int a_body1(int loopDepth=0) { try { - #line 5061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(!limits.hasRowLimit()); - #line 5062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span = Span("NAPI:getRangeStream"_loc, trState->spanID); - #line 5064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = fVersion; - #line 5064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span = Span("NAPI:getRangeStream"_loc, trState->spanContext); + #line 5349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = trState->startTransaction(); + #line 5349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 22861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 5064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 22866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 24074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -22882,51 +24090,69 @@ class GetRangeStreamActorState { return loopDepth; } - int a_body1cont1(int loopDepth) + int a_body1cont1(Void const& _,int loopDepth) { - #line 5065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->validateVersion(version); - #line 5067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future fb = resolveKey(trState, begin, version, UseTenant::True); - #line 5068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fe = resolveKey(trState, end, version, UseTenant::True); - #line 5070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->validateVersion(trState->readVersion()); + #line 5352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future fb = resolveKey(trState, begin, UseTenant::True); + #line 5353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fe = resolveKey(trState, end, UseTenant::True); + #line 5355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = fb; - #line 5070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 22897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 5070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 22902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(Version const& __version,int loopDepth) + int a_body1cont1(Void && _,int loopDepth) { - #line 5064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version = __version; - #line 22911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); + #line 5350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->validateVersion(trState->readVersion()); + #line 5352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future fb = resolveKey(trState, begin, UseTenant::True); + #line 5353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fe = resolveKey(trState, end, UseTenant::True); + #line 5355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = fb; + #line 5355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 24127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 5355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 24132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1when1(Version && __version,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - version = std::move(__version); - loopDepth = a_body1cont1(loopDepth); + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRangeStreamActor, 0, Version >::remove(); + static_cast(this)->ActorCallback< GetRangeStreamActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< GetRangeStreamActor, 0, Version >*,Version const& value) + void a_callback_fire(ActorCallback< GetRangeStreamActor, 0, Void >*,Void const& value) { fdb_probe_actor_enter("getRangeStream", reinterpret_cast(this), 0); a_exitChoose1(); @@ -22941,7 +24167,7 @@ class GetRangeStreamActorState { fdb_probe_actor_exit("getRangeStream", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetRangeStreamActor, 0, Version >*,Version && value) + void a_callback_fire(ActorCallback< GetRangeStreamActor, 0, Void >*,Void && value) { fdb_probe_actor_enter("getRangeStream", reinterpret_cast(this), 0); a_exitChoose1(); @@ -22956,7 +24182,7 @@ class GetRangeStreamActorState { fdb_probe_actor_exit("getRangeStream", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetRangeStreamActor, 0, Version >*,Error err) + void a_callback_error(ActorCallback< GetRangeStreamActor, 0, Void >*,Error err) { fdb_probe_actor_enter("getRangeStream", reinterpret_cast(this), 0); a_exitChoose1(); @@ -22973,25 +24199,25 @@ class GetRangeStreamActorState { } int a_body1cont2(int loopDepth) { - #line 5071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = fe; - #line 5071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 22980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 5071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 22985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1when1(Key const& __b,int loopDepth) { - #line 5070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" b = __b; - #line 22994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -23056,28 +24282,28 @@ class GetRangeStreamActorState { } int a_body1cont3(int loopDepth) { - #line 5073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!snapshot) - #line 23061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" conflictRange.send(std::make_pair(std::min(b, Key(begin.getKey(), begin.arena())), std::max(e, Key(end.getKey(), end.arena())))); - #line 23065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 5079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (b >= e) - #line 23069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = results.finish(); - #line 5080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 5080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 23080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else @@ -23089,9 +24315,9 @@ class GetRangeStreamActorState { } int a_body1cont2when1(Key const& __e,int loopDepth) { - #line 5071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" e = __e; - #line 23094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; @@ -23156,20 +24382,20 @@ class GetRangeStreamActorState { } int a_body1cont4(int loopDepth) { - #line 5088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" outstandingRequests = std::vector>(); - #line 5089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 23163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont4loopHead1(loopDepth); return loopDepth; } int a_body1cont6(Void const& _,int loopDepth) { - #line 5081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetRangeStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 23172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~GetRangeStreamActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -23179,9 +24405,9 @@ class GetRangeStreamActorState { } int a_body1cont6(Void && _,int loopDepth) { - #line 5081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetRangeStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 23184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~GetRangeStreamActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -23254,16 +24480,16 @@ class GetRangeStreamActorState { } int a_body1cont8(int loopDepth) { - #line 5125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_7 = waitForAll(outstandingRequests) && results.finish(); - #line 5125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 23261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont8when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 5125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 23266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -23277,22 +24503,22 @@ class GetRangeStreamActorState { } int a_body1cont4loopBody1(int loopDepth) { - #line 5089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!(b < e)) - #line 23282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { return a_body1cont4break1(loopDepth==0?0:loopDepth-1); // break } - #line 5090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_4 = getKeyLocation( trState, reverse ? e : b, &StorageServerInterface::getKeyValuesStream, reverse, UseTenant::True, version); - #line 5090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = getKeyLocation( trState, reverse ? e : b, &StorageServerInterface::getKeyValuesStream, reverse, UseTenant::True); + #line 5375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 23290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 5090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 23295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -23312,27 +24538,27 @@ class GetRangeStreamActorState { } int a_body1cont4loopBody1cont1(int loopDepth) { - #line 5092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" shardIntersection = intersect(locationInfo.range, KeyRangeRef(b, e)); - #line 5093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture>> __when_expr_5 = getRangeSplitPoints(trState, shardIntersection, CLIENT_KNOBS->RANGESTREAM_FRAGMENT_SIZE, version); - #line 5093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture>> __when_expr_5 = getRangeSplitPoints(trState, shardIntersection, CLIENT_KNOBS->RANGESTREAM_FRAGMENT_SIZE); + #line 5378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 23321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1cont1when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 5093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast> >*>(static_cast(this))); - #line 23326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4loopBody1when1(KeyRangeLocationInfo const& __locationInfo,int loopDepth) { - #line 5090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" locationInfo = __locationInfo; - #line 23335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont4loopBody1cont1(loopDepth); return loopDepth; @@ -23397,46 +24623,46 @@ class GetRangeStreamActorState { } int a_body1cont4loopBody1cont3(int loopDepth) { - #line 5095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" toSend = std::vector(); - #line 5098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!splitPoints.empty()) - #line 23404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" toSend.push_back(KeyRange(KeyRangeRef(shardIntersection.begin, splitPoints.front()), splitPoints.arena())); - #line 5100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < splitPoints.size() - 1;++i) { - #line 5101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" toSend.push_back(KeyRange(KeyRangeRef(splitPoints[i], splitPoints[i + 1]), splitPoints.arena())); - #line 23412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 5103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" toSend.push_back(KeyRange(KeyRangeRef(splitPoints.back(), shardIntersection.end), splitPoints.arena())); - #line 23416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 5105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" toSend.push_back(KeyRange(KeyRangeRef(shardIntersection.begin, shardIntersection.end))); - #line 23422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 5108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" idx = 0; - #line 5109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" useIdx = 0; - #line 5110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 23430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont4loopBody1cont3loopHead1(loopDepth); return loopDepth; } int a_body1cont4loopBody1cont1when1(Standalone> const& __splitPoints,int loopDepth) { - #line 5093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" splitPoints = __splitPoints; - #line 23439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont4loopBody1cont3(loopDepth); return loopDepth; @@ -23501,19 +24727,19 @@ class GetRangeStreamActorState { } int a_body1cont4loopBody1cont4(int loopDepth) { - #line 5119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (reverse) - #line 23506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" e = shardIntersection.begin; - #line 23510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 5122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" b = shardIntersection.end; - #line 23516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } if (loopDepth == 0) return a_body1cont4loopHead1(0); @@ -23528,30 +24754,30 @@ class GetRangeStreamActorState { } int a_body1cont4loopBody1cont3loopBody1(int loopDepth) { - #line 5110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!(idx < toSend.size())) - #line 23533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { return a_body1cont4loopBody1cont3break1(loopDepth==0?0:loopDepth-1); // break } - #line 5111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" useIdx = reverse ? toSend.size() - idx - 1 : idx; - #line 5112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (toSend[useIdx].empty()) - #line 23541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { return a_body1cont4loopBody1cont3continue1(loopDepth); // continue } - #line 5115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture::Fragment*> __when_expr_6 = results.createFragment(); - #line 5115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 23549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 2)); else return a_body1cont4loopBody1cont3loopBody1when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 5115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast::Fragment* >*>(static_cast(this))); - #line 23554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -23571,31 +24797,31 @@ class GetRangeStreamActorState { } int a_body1cont4loopBody1cont3continue1(int loopDepth) { - #line 5110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++idx; - #line 23576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1cont4loopBody1cont3loopHead1(0); return loopDepth; } int a_body1cont4loopBody1cont3loopBody1cont1(ParallelStream::Fragment* const& fragment,int loopDepth) { - #line 5116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - outstandingRequests.push_back(getRangeStreamFragment( trState, fragment, version, toSend[useIdx], limits, snapshot, reverse, span.context)); - #line 5110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + outstandingRequests.push_back( getRangeStreamFragment(trState, fragment, toSend[useIdx], limits, snapshot, reverse, span.context)); + #line 5395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++idx; - #line 23587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1cont4loopBody1cont3loopHead1(0); return loopDepth; } int a_body1cont4loopBody1cont3loopBody1cont1(ParallelStream::Fragment* && fragment,int loopDepth) { - #line 5116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - outstandingRequests.push_back(getRangeStreamFragment( trState, fragment, version, toSend[useIdx], limits, snapshot, reverse, span.context)); - #line 5110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + outstandingRequests.push_back( getRangeStreamFragment(trState, fragment, toSend[useIdx], limits, snapshot, reverse, span.context)); + #line 5395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++idx; - #line 23598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1cont4loopBody1cont3loopHead1(0); return loopDepth; @@ -23665,9 +24891,9 @@ class GetRangeStreamActorState { } int a_body1cont9(Void const& _,int loopDepth) { - #line 5126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetRangeStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 23670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~GetRangeStreamActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -23677,9 +24903,9 @@ class GetRangeStreamActorState { } int a_body1cont9(Void && _,int loopDepth) { - #line 5126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetRangeStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 23682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 24908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~GetRangeStreamActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -23750,56 +24976,52 @@ class GetRangeStreamActorState { fdb_probe_actor_exit("getRangeStream", reinterpret_cast(this), 7); } - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" PromiseStream _results; - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future fVersion; - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeySelector begin; - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeySelector end; - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetRangeLimits limits; - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Promise> conflictRange; - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Snapshot snapshot; - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reverse reverse; - #line 5058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ParallelStream results; - #line 5062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 5064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 5068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future fe; - #line 5070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key b; - #line 5071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key e; - #line 5088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector> outstandingRequests; - #line 5090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRangeLocationInfo locationInfo; - #line 5092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange shardIntersection; - #line 5093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Standalone> splitPoints; - #line 5095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector toSend; - #line 5108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int idx; - #line 5109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int useIdx; - #line 23797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getRangeStream() - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetRangeStreamActor final : public Actor, public ActorCallback< GetRangeStreamActor, 0, Version >, public ActorCallback< GetRangeStreamActor, 1, Key >, public ActorCallback< GetRangeStreamActor, 2, Key >, public ActorCallback< GetRangeStreamActor, 3, Void >, public ActorCallback< GetRangeStreamActor, 4, KeyRangeLocationInfo >, public ActorCallback< GetRangeStreamActor, 5, Standalone> >, public ActorCallback< GetRangeStreamActor, 6, ParallelStream::Fragment* >, public ActorCallback< GetRangeStreamActor, 7, Void >, public FastAllocated, public GetRangeStreamActorState { - #line 23802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetRangeStreamActor final : public Actor, public ActorCallback< GetRangeStreamActor, 0, Void >, public ActorCallback< GetRangeStreamActor, 1, Key >, public ActorCallback< GetRangeStreamActor, 2, Key >, public ActorCallback< GetRangeStreamActor, 3, Void >, public ActorCallback< GetRangeStreamActor, 4, KeyRangeLocationInfo >, public ActorCallback< GetRangeStreamActor, 5, Standalone> >, public ActorCallback< GetRangeStreamActor, 6, ParallelStream::Fragment* >, public ActorCallback< GetRangeStreamActor, 7, Void >, public FastAllocated, public GetRangeStreamActorState { + #line 25024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -23807,7 +25029,7 @@ class GetRangeStreamActor final : public Actor, public ActorCallback< GetR #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetRangeStreamActor, 0, Version >; +friend struct ActorCallback< GetRangeStreamActor, 0, Void >; friend struct ActorCallback< GetRangeStreamActor, 1, Key >; friend struct ActorCallback< GetRangeStreamActor, 2, Key >; friend struct ActorCallback< GetRangeStreamActor, 3, Void >; @@ -23815,11 +25037,11 @@ friend struct ActorCallback< GetRangeStreamActor, 4, KeyRangeLocationInfo >; friend struct ActorCallback< GetRangeStreamActor, 5, Standalone> >; friend struct ActorCallback< GetRangeStreamActor, 6, ParallelStream::Fragment* >; friend struct ActorCallback< GetRangeStreamActor, 7, Void >; - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetRangeStreamActor(Reference const& trState,PromiseStream const& _results,Future const& fVersion,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Promise> const& conflictRange,Snapshot const& snapshot,Reverse const& reverse) - #line 23820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetRangeStreamActor(Reference const& trState,PromiseStream const& _results,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Promise> const& conflictRange,Snapshot const& snapshot,Reverse const& reverse) + #line 25042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - GetRangeStreamActorState(trState, _results, fVersion, begin, end, limits, conflictRange, snapshot, reverse) + GetRangeStreamActorState(trState, _results, begin, end, limits, conflictRange, snapshot, reverse) { fdb_probe_actor_enter("getRangeStream", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -23835,7 +25057,7 @@ friend struct ActorCallback< GetRangeStreamActor, 7, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetRangeStreamActor, 0, Version >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetRangeStreamActor, 0, Void >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< GetRangeStreamActor, 1, Key >*)0, actor_cancelled()); break; case 3: this->a_callback_error((ActorCallback< GetRangeStreamActor, 2, Key >*)0, actor_cancelled()); break; case 4: this->a_callback_error((ActorCallback< GetRangeStreamActor, 3, Void >*)0, actor_cancelled()); break; @@ -23848,32 +25070,23 @@ friend struct ActorCallback< GetRangeStreamActor, 7, Void >; } }; } - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future getRangeStream( Reference const& trState, PromiseStream const& _results, Future const& fVersion, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Promise> const& conflictRange, Snapshot const& snapshot, Reverse const& reverse ) { - #line 5049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new GetRangeStreamActor(trState, _results, fVersion, begin, end, limits, conflictRange, snapshot, reverse)); - #line 23855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getRangeStream( Reference const& trState, PromiseStream const& _results, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Promise> const& conflictRange, Snapshot const& snapshot, Reverse const& reverse ) { + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetRangeStreamActor(trState, _results, begin, end, limits, conflictRange, snapshot, reverse)); + #line 25077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 5128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 5413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future getRange(Reference const& trState, - Future const& fVersion, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Reverse const& reverse, UseTenant const& useTenant) { - return getRange(trState, - fVersion, - begin, - end, - ""_sr, - limits, - Promise>(), - Snapshot::True, - reverse, - useTenant); + return getRange( + trState, begin, end, ""_sr, limits, Promise>(), Snapshot::True, reverse, useTenant); } bool DatabaseContext::debugUseTags = false; @@ -23907,13 +25120,13 @@ void debugAddTags(Reference trState) { Transaction::Transaction() : trState(makeReference(TaskPriority::DefaultEndpoint, generateSpanID(false))) {} -Transaction::Transaction(Database const& cx, Optional const& tenant) +Transaction::Transaction(Database const& cx, Optional> const& tenant) : trState(makeReference(cx, tenant, cx->taskID, generateSpanID(cx->transactionTracingSample), createTrLogInfoProbabilistically(cx))), - span(trState->spanID, "Transaction"_loc), backoff(CLIENT_KNOBS->DEFAULT_BACKOFF), tr(trState->spanID) { + span(trState->spanContext, "Transaction"_loc), backoff(CLIENT_KNOBS->DEFAULT_BACKOFF), tr(trState->spanContext) { if (DatabaseContext::debugUseTags) { debugAddTags(trState); } @@ -23927,9 +25140,7 @@ Transaction::~Transaction() { void Transaction::operator=(Transaction&& r) noexcept { flushTrLogsIfEnabled(); tr = std::move(r.tr); - readVersion = std::move(r.readVersion); trState = std::move(r.trState); - metadataVersion = std::move(r.metadataVersion); extraConflictRanges = std::move(r.extraConflictRanges); commitResult = std::move(r.commitResult); committing = std::move(r.committing); @@ -23952,12 +25163,12 @@ VersionVector Transaction::getVersionVector() const { void Transaction::setVersion(Version v) { trState->startTime = now(); - if (readVersion.isValid()) + if (trState->readVersionFuture.isValid()) throw read_version_already_set(); if (v <= 0) throw version_invalid(); - readVersion = v; + trState->readVersionFuture = v; trState->readVersionObtainedFromGrvProxy = false; } @@ -23985,11 +25196,12 @@ Future> Transaction::get(const Key& key, Snapshot snapshot) { // This will return the global metadata version key. useTenant = UseTenant::False; ++trState->cx->transactionMetadataVersionReads; - if (!ver.isReady() || metadataVersion.isSet()) { - return metadataVersion.getFuture(); + if (!ver.isReady() || trState->metadataVersion.isSet()) { + return trState->metadataVersion.getFuture(); } else { - if (ver.isError()) + if (ver.isError()) { return ver.getError(); + } if (ver.get() == trState->cx->metadataVersionCache[trState->cx->mvCacheInsertLocation].first) { return trState->cx->metadataVersionCache[trState->cx->mvCacheInsertLocation].second; } @@ -24017,7 +25229,7 @@ Future> Transaction::get(const Key& key, Snapshot snapshot) { } } - return getValue(trState, key, ver, useTenant); + return getValue(trState, key, useTenant); } void Watch::setWatch(Future watchFuture) { @@ -24027,25 +25239,21 @@ void Watch::setWatch(Future watchFuture) { onSetWatchTrigger.send(Void()); } - #line 24030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getTenantMetadata() - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetTenantMetadataActorState { - #line 24037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetTenantMetadataActorState(Reference const& trState,Key const& key,Version const& version) - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : trState(trState), - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - key(key), - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version(version) - #line 24048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetTenantMetadataActorState(Reference const& trState) + #line 5574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : trState(trState) + #line 25256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getTenantMetadata", reinterpret_cast(this)); @@ -24058,16 +25266,16 @@ class GetTenantMetadataActorState { int a_body1(int loopDepth=0) { try { - #line 5300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = getKeyLocation(trState, key, &StorageServerInterface::getValue, Reverse::False, UseTenant::True, version); - #line 5300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = trState->startTransaction(); + #line 5575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 5300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 25278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -24086,11 +25294,11 @@ class GetTenantMetadataActorState { return loopDepth; } - int a_body1cont1(KeyRangeLocationInfo const& locationInfo,int loopDepth) + int a_body1cont1(Void const& _,int loopDepth) { - #line 5302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(trState->getTenantInfo()); this->~GetTenantMetadataActorState(); static_cast(this)->destroy(); return 0; } - #line 24093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< TenantInfo >::value()) TenantInfo(trState->getTenantInfo()); this->~GetTenantMetadataActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -24098,11 +25306,11 @@ class GetTenantMetadataActorState { return loopDepth; } - int a_body1cont1(KeyRangeLocationInfo && locationInfo,int loopDepth) + int a_body1cont1(Void && _,int loopDepth) { - #line 5302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(trState->getTenantInfo()); this->~GetTenantMetadataActorState(); static_cast(this)->destroy(); return 0; } - #line 24105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< TenantInfo >::value()) TenantInfo(trState->getTenantInfo()); this->~GetTenantMetadataActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -24110,25 +25318,25 @@ class GetTenantMetadataActorState { return loopDepth; } - int a_body1when1(KeyRangeLocationInfo const& locationInfo,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(locationInfo, loopDepth); + loopDepth = a_body1cont1(_, loopDepth); return loopDepth; } - int a_body1when1(KeyRangeLocationInfo && locationInfo,int loopDepth) + int a_body1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(locationInfo), loopDepth); + loopDepth = a_body1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetTenantMetadataActor, 0, KeyRangeLocationInfo >::remove(); + static_cast(this)->ActorCallback< GetTenantMetadataActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< GetTenantMetadataActor, 0, KeyRangeLocationInfo >*,KeyRangeLocationInfo const& value) + void a_callback_fire(ActorCallback< GetTenantMetadataActor, 0, Void >*,Void const& value) { fdb_probe_actor_enter("getTenantMetadata", reinterpret_cast(this), 0); a_exitChoose1(); @@ -24143,7 +25351,7 @@ class GetTenantMetadataActorState { fdb_probe_actor_exit("getTenantMetadata", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetTenantMetadataActor, 0, KeyRangeLocationInfo >*,KeyRangeLocationInfo && value) + void a_callback_fire(ActorCallback< GetTenantMetadataActor, 0, Void >*,Void && value) { fdb_probe_actor_enter("getTenantMetadata", reinterpret_cast(this), 0); a_exitChoose1(); @@ -24158,7 +25366,7 @@ class GetTenantMetadataActorState { fdb_probe_actor_exit("getTenantMetadata", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetTenantMetadataActor, 0, KeyRangeLocationInfo >*,Error err) + void a_callback_error(ActorCallback< GetTenantMetadataActor, 0, Void >*,Error err) { fdb_probe_actor_enter("getTenantMetadata", reinterpret_cast(this), 0); a_exitChoose1(); @@ -24173,18 +25381,14 @@ class GetTenantMetadataActorState { fdb_probe_actor_exit("getTenantMetadata", reinterpret_cast(this), 0); } - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key key; - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 24182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getTenantMetadata() - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetTenantMetadataActor final : public Actor, public ActorCallback< GetTenantMetadataActor, 0, KeyRangeLocationInfo >, public FastAllocated, public GetTenantMetadataActorState { - #line 24187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetTenantMetadataActor final : public Actor, public ActorCallback< GetTenantMetadataActor, 0, Void >, public FastAllocated, public GetTenantMetadataActorState { + #line 25391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -24192,12 +25396,12 @@ class GetTenantMetadataActor final : public Actor, public ActorCallb #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetTenantMetadataActor, 0, KeyRangeLocationInfo >; - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetTenantMetadataActor(Reference const& trState,Key const& key,Version const& version) - #line 24198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +friend struct ActorCallback< GetTenantMetadataActor, 0, Void >; + #line 5574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetTenantMetadataActor(Reference const& trState) + #line 25402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - GetTenantMetadataActorState(trState, key, version) + GetTenantMetadataActorState(trState) { fdb_probe_actor_enter("getTenantMetadata", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -24213,61 +25417,289 @@ friend struct ActorCallback< GetTenantMetadataActor, 0, KeyRangeLocationInfo >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetTenantMetadataActor, 0, KeyRangeLocationInfo >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetTenantMetadataActor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future getTenantMetadata( Reference const& trState, Key const& key, Version const& version ) { - #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new GetTenantMetadataActor(trState, key, version)); - #line 24226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getTenantMetadata( Reference const& trState ) { + #line 5574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetTenantMetadataActor(trState)); + #line 25430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 5304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 5578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -Future populateAndGetTenant(Reference trState, Key const& key, Version version) { - if (!trState->tenant().present() || key == metadataVersionKey) { +Future populateAndGetTenant(Reference trState, Key const& key) { + if (!trState->hasTenant() || key == metadataVersionKey) { return TenantInfo(); - } else if (trState->tenantId != TenantInfo::INVALID_TENANT) { + } else if (trState->startTransaction().canGet()) { return trState->getTenantInfo(); } else { - return getTenantMetadata(trState, key, version); + return getTenantMetadata(trState); } } +// Restarts a watch after a database switch + #line 25446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via restartWatch() + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class RestartWatchActorState { + #line 25453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + RestartWatchActorState(Database const& cx,TenantInfo const& tenantInfo,Key const& key,Optional const& value,TagSet const& tags,SpanContext const& spanContext,TaskPriority const& taskID,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies) + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantInfo(tenantInfo), + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + key(key), + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + value(value), + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tags(tags), + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + spanContext(spanContext), + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + taskID(taskID), + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + debugID(debugID), + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + useProvisionalProxies(useProvisionalProxies) + #line 25476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("restartWatch", reinterpret_cast(this)); + + } + ~RestartWatchActorState() + { + fdb_probe_actor_destroy("restartWatch", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 5601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->deleteWatchMetadata(tenantInfo.tenantId, key, true); + #line 5603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = watchValueMap(cx->minAcceptableReadVersion, tenantInfo, key, value, cx, tags, spanContext, taskID, debugID, useProvisionalProxies); + #line 5603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 25495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 5603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 25500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~RestartWatchActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 5614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RestartWatchActorState(); static_cast(this)->destroy(); return 0; } + #line 25523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RestartWatchActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 5614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RestartWatchActorState(); static_cast(this)->destroy(); return 0; } + #line 25535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RestartWatchActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RestartWatchActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RestartWatchActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("restartWatch", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("restartWatch", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< RestartWatchActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("restartWatch", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("restartWatch", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< RestartWatchActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("restartWatch", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("restartWatch", reinterpret_cast(this), 0); + + } + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database cx; + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TenantInfo tenantInfo; + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key key; + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional value; + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TagSet tags; + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SpanContext spanContext; + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TaskPriority taskID; + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional debugID; + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + UseProvisionalProxies useProvisionalProxies; + #line 25624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via restartWatch() + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class RestartWatchActor final : public Actor, public ActorCallback< RestartWatchActor, 0, Void >, public FastAllocated, public RestartWatchActorState { + #line 25629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< RestartWatchActor, 0, Void >; + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + RestartWatchActor(Database const& cx,TenantInfo const& tenantInfo,Key const& key,Optional const& value,TagSet const& tags,SpanContext const& spanContext,TaskPriority const& taskID,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies) + #line 25640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + RestartWatchActorState(cx, tenantInfo, key, value, tags, spanContext, taskID, debugID, useProvisionalProxies) + { + fdb_probe_actor_enter("restartWatch", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("restartWatch"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("restartWatch", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< RestartWatchActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future restartWatch( Database const& cx, TenantInfo const& tenantInfo, Key const& key, Optional const& value, TagSet const& tags, SpanContext const& spanContext, TaskPriority const& taskID, Optional const& debugID, UseProvisionalProxies const& useProvisionalProxies ) { + #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new RestartWatchActor(cx, tenantInfo, key, value, tags, spanContext, taskID, debugID, useProvisionalProxies)); + #line 25668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 5616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + // FIXME: This seems pretty horrible. Now a Database can't die until all of its watches do... - #line 24242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via watch() - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class WatchActorState { - #line 24249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WatchActorState(Reference const& watch,Database const& cx,Future const& tenant,TagSet const& tags,SpanID const& spanID,TaskPriority const& taskID,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies) - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WatchActorState(Reference const& watch,Database const& cx,Future const& tenant,TagSet const& tags,SpanContext const& spanContext,TaskPriority const& taskID,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies) + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : watch(watch), - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx(cx), - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tenant(tenant), - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tags(tags), - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - spanID(spanID), - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + spanContext(spanContext), + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" taskID(taskID), - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" debugID(debugID), - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" useProvisionalProxies(useProvisionalProxies) - #line 24270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("watch", reinterpret_cast(this)); @@ -24281,22 +25713,22 @@ class WatchActorState { { try { try { - #line 5328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = watch->onChangeTrigger.getFuture(); - #line 5325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 24288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 5331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = watch->onSetWatchTrigger.getFuture(); - #line 24292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 5328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -24323,11 +25755,11 @@ class WatchActorState { } int a_body1cont1(int loopDepth) { - #line 5364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->removeWatch(); - #line 5365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->decreaseWatchCounter(); + #line 5665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WatchActorState(); static_cast(this)->destroy(); return 0; } - #line 24330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WatchActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -24338,11 +25770,11 @@ class WatchActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 5360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->removeWatch(); - #line 5361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->decreaseWatchCounter(); + #line 5661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 24345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -24372,32 +25804,32 @@ class WatchActorState { } int a_body1when2(Void const& _,int loopDepth) { - #line 5333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = tenant; - #line 5333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 24379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1when2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 5333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when2(Void && _,int loopDepth) { - #line 5333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = tenant; - #line 5333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 24395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1when2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 5333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -24456,18 +25888,18 @@ class WatchActorState { } int a_body1when2cont1(int loopDepth) { - #line 5334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 24461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1when2cont1loopHead1(loopDepth); return loopDepth; } int a_body1when2when1(TenantInfo const& __tenantInfo,int loopDepth) { - #line 5333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tenantInfo = __tenantInfo; - #line 24470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1when2cont1(loopDepth); return loopDepth; @@ -24545,22 +25977,22 @@ class WatchActorState { } int a_body1when2cont1loopBody1(int loopDepth) { - #line 5337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = watch->watchFuture; - #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 24552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1when2cont1loopBody1when1(__when_expr_3.get(), loopDepth); }; - #line 5341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_4 = cx->connectionFileChanged(); - #line 24556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch2(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1when2cont1loopBody1when2(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 5337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 25995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -24598,26 +26030,22 @@ class WatchActorState { } int a_body1when2cont1loopBody1when2(Void const& _,int loopDepth) { - #line 5342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 5343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->clearWatchMetadata(); - #line 5344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - watch->watchFuture = watchValueMap(cx->minAcceptableReadVersion, tenantInfo, watch->key, watch->value, cx, tags, spanID, taskID, debugID, useProvisionalProxies); - #line 24607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Recreated a watch after switch"); + #line 5645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + watch->watchFuture = restartWatch(cx, tenantInfo, watch->key, watch->value, tags, spanContext, taskID, debugID, useProvisionalProxies); + #line 26037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1when2cont1loopBody1cont1(loopDepth); return loopDepth; } int a_body1when2cont1loopBody1when2(Void && _,int loopDepth) { - #line 5342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 5343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->clearWatchMetadata(); - #line 5344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - watch->watchFuture = watchValueMap(cx->minAcceptableReadVersion, tenantInfo, watch->key, watch->value, cx, tags, spanID, taskID, debugID, useProvisionalProxies); - #line 24620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Recreated a watch after switch"); + #line 5645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + watch->watchFuture = restartWatch(cx, tenantInfo, watch->key, watch->value, tags, spanContext, taskID, debugID, useProvisionalProxies); + #line 26048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1when2cont1loopBody1cont1(loopDepth); return loopDepth; @@ -24777,30 +26205,30 @@ class WatchActorState { return loopDepth; } - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference watch; - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future tenant; - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TagSet tags; - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SpanID spanID; - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SpanContext spanContext; + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TaskPriority taskID; - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional debugID; - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" UseProvisionalProxies useProvisionalProxies; - #line 5333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TenantInfo tenantInfo; - #line 24798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via watch() - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class WatchActor final : public Actor, public ActorCallback< WatchActor, 0, Void >, public ActorCallback< WatchActor, 1, Void >, public ActorCallback< WatchActor, 2, TenantInfo >, public ActorCallback< WatchActor, 3, Void >, public ActorCallback< WatchActor, 4, Void >, public FastAllocated, public WatchActorState { - #line 24803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -24813,11 +26241,11 @@ friend struct ActorCallback< WatchActor, 1, Void >; friend struct ActorCallback< WatchActor, 2, TenantInfo >; friend struct ActorCallback< WatchActor, 3, Void >; friend struct ActorCallback< WatchActor, 4, Void >; - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WatchActor(Reference const& watch,Database const& cx,Future const& tenant,TagSet const& tags,SpanID const& spanID,TaskPriority const& taskID,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies) - #line 24818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WatchActor(Reference const& watch,Database const& cx,Future const& tenant,TagSet const& tags,SpanContext const& spanContext,TaskPriority const& taskID,Optional const& debugID,UseProvisionalProxies const& useProvisionalProxies) + #line 26246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - WatchActorState(watch, cx, tenant, tags, spanID, taskID, debugID, useProvisionalProxies) + WatchActorState(watch, cx, tenant, tags, spanContext, taskID, debugID, useProvisionalProxies) { fdb_probe_actor_enter("watch", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -24841,14 +26269,14 @@ friend struct ActorCallback< WatchActor, 4, Void >; } }; } - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future watch( Reference const& watch, Database const& cx, Future const& tenant, TagSet const& tags, SpanID const& spanID, TaskPriority const& taskID, Optional const& debugID, UseProvisionalProxies const& useProvisionalProxies ) { - #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new WatchActor(watch, cx, tenant, tags, spanID, taskID, debugID, useProvisionalProxies)); - #line 24848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future watch( Reference const& watch, Database const& cx, Future const& tenant, TagSet const& tags, SpanContext const& spanContext, TaskPriority const& taskID, Optional const& debugID, UseProvisionalProxies const& useProvisionalProxies ) { + #line 5618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new WatchActor(watch, cx, tenant, tags, spanContext, taskID, debugID, useProvisionalProxies)); + #line 26276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 5367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 5667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future Transaction::getRawReadVersion() { return ::getRawVersion(trState); @@ -24857,43 +26285,38 @@ Future Transaction::getRawReadVersion() { Future Transaction::watch(Reference watch) { ++trState->cx->transactionWatchRequests; - trState->cx->addWatch(); + trState->cx->increaseWatchCounter(); + watch->readOptions = trState->readOptions; watches.push_back(watch); - return ::watch( - watch, - trState->cx, - populateAndGetTenant( - trState, watch->key, readVersion.isValid() && readVersion.isReady() ? readVersion.get() : latestVersion), - trState->options.readTags, - trState->spanID, - trState->taskID, - trState->debugID, - trState->useProvisionalProxies); + return ::watch(watch, + trState->cx, + populateAndGetTenant(trState, watch->key), + trState->options.readTags, + trState->spanContext, + trState->taskID, + trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(), + trState->useProvisionalProxies); } - #line 24874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getAddressesForKeyActor() - #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetAddressesForKeyActorActorState { - #line 24881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetAddressesForKeyActorActorState(Reference const& trState,Future const& ver,Key const& key) - #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetAddressesForKeyActorActorState(Reference const& trState,Key const& key) + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ver(ver), - #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" key(key), - #line 5392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ssi(), - #line 5394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - resolvedKey(key) - #line 24896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ssi() + #line 26319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getAddressesForKeyActor", reinterpret_cast(this)); @@ -24906,26 +26329,17 @@ class GetAddressesForKeyActorActorState { int a_body1(int loopDepth=0) { try { - #line 5395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->tenant().present()) - #line 24911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 5396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = ver; - #line 5396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 5396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont1(loopDepth); - } + #line 5691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = trState->startTransaction(); + #line 5691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 26336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 5691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 26341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -24943,63 +26357,81 @@ class GetAddressesForKeyActorActorState { return loopDepth; } - int a_body1cont1(int loopDepth) + int a_body1cont1(Void const& _,int loopDepth) { - #line 5404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + resolvedKey = key; + #line 5694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->hasTenant()) + #line 26366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 5695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + resolvedKey = key.withPrefix(trState->tenant().get()->prefix()); + #line 26370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 5700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ksKey = keyServersKey(resolvedKey); - #line 5405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = getRange(trState, ver, lastLessOrEqual(serverTagKeys.begin), firstGreaterThan(serverTagKeys.end), GetRangeLimits(CLIENT_KNOBS->TOO_MANY), Reverse::False, UseTenant::False); - #line 5405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = getRange(trState, lastLessOrEqual(serverTagKeys.begin), firstGreaterThan(serverTagKeys.end), GetRangeLimits(CLIENT_KNOBS->TOO_MANY), Reverse::False, UseTenant::False); + #line 5701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 5405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 5701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 26383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont2(int loopDepth) + int a_body1cont1(Void && _,int loopDepth) { - #line 5397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = getKeyLocation( trState, ""_sr, &StorageServerInterface::getValue, Reverse::False, UseTenant::True, version); - #line 5397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + resolvedKey = key; + #line 5694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->hasTenant()) + #line 26394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 5695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + resolvedKey = key.withPrefix(trState->tenant().get()->prefix()); + #line 26398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 5700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ksKey = keyServersKey(resolvedKey); + #line 5701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = getRange(trState, lastLessOrEqual(serverTagKeys.begin), firstGreaterThan(serverTagKeys.end), GetRangeLimits(CLIENT_KNOBS->TOO_MANY), Reverse::False, UseTenant::False); + #line 5701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 24970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; + #line 26406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 5397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 24975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 26411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(Version const& __version,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - #line 5396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version = __version; - #line 24984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1cont1(_, loopDepth); return loopDepth; } - int a_body1when1(Version && __version,int loopDepth) + int a_body1when1(Void && _,int loopDepth) { - version = std::move(__version); - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetAddressesForKeyActorActor, 0, Version >::remove(); + static_cast(this)->ActorCallback< GetAddressesForKeyActorActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< GetAddressesForKeyActorActor, 0, Version >*,Version const& value) + void a_callback_fire(ActorCallback< GetAddressesForKeyActorActor, 0, Void >*,Void const& value) { fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 0); a_exitChoose1(); @@ -25014,7 +26446,7 @@ class GetAddressesForKeyActorActorState { fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetAddressesForKeyActorActor, 0, Version >*,Version && value) + void a_callback_fire(ActorCallback< GetAddressesForKeyActorActor, 0, Void >*,Void && value) { fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 0); a_exitChoose1(); @@ -25029,7 +26461,7 @@ class GetAddressesForKeyActorActorState { fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetAddressesForKeyActorActor, 0, Version >*,Error err) + void a_callback_error(ActorCallback< GetAddressesForKeyActorActor, 0, Void >*,Error err) { fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 0); a_exitChoose1(); @@ -25044,48 +26476,54 @@ class GetAddressesForKeyActorActorState { fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 0); } - int a_body1cont3(KeyRangeLocationInfo const& locationInfo,int loopDepth) - { - #line 5399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - resolvedKey = key.withPrefix(locationInfo.tenantEntry.prefix); - #line 25051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); - - return loopDepth; - } - int a_body1cont3(KeyRangeLocationInfo && locationInfo,int loopDepth) + int a_body1cont2(int loopDepth) { - #line 5399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - resolvedKey = key.withPrefix(locationInfo.tenantEntry.prefix); - #line 25060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); + #line 5707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!serverTagResult.more && serverTagResult.size() < CLIENT_KNOBS->TOO_MANY); + #line 5708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future futureServerUids = getRange( trState, lastLessOrEqual(ksKey), firstGreaterThan(ksKey), GetRangeLimits(1), Reverse::False, UseTenant::False); + #line 5710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = futureServerUids; + #line 5710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 26489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 5710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 26494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont2when1(KeyRangeLocationInfo const& locationInfo,int loopDepth) + int a_body1cont1when1(RangeResult const& __serverTagResult,int loopDepth) { - loopDepth = a_body1cont3(locationInfo, loopDepth); + #line 5701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + serverTagResult = __serverTagResult; + #line 26503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont2when1(KeyRangeLocationInfo && locationInfo,int loopDepth) + int a_body1cont1when1(RangeResult && __serverTagResult,int loopDepth) { - loopDepth = a_body1cont3(std::move(locationInfo), loopDepth); + serverTagResult = std::move(__serverTagResult); + loopDepth = a_body1cont2(loopDepth); return loopDepth; } void a_exitChoose2() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetAddressesForKeyActorActor, 1, KeyRangeLocationInfo >::remove(); + static_cast(this)->ActorCallback< GetAddressesForKeyActorActor, 1, RangeResult >::remove(); } - void a_callback_fire(ActorCallback< GetAddressesForKeyActorActor, 1, KeyRangeLocationInfo >*,KeyRangeLocationInfo const& value) + void a_callback_fire(ActorCallback< GetAddressesForKeyActorActor, 1, RangeResult >*,RangeResult const& value) { fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont2when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -25095,12 +26533,12 @@ class GetAddressesForKeyActorActorState { fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< GetAddressesForKeyActorActor, 1, KeyRangeLocationInfo >*,KeyRangeLocationInfo && value) + void a_callback_fire(ActorCallback< GetAddressesForKeyActorActor, 1, RangeResult >*,RangeResult && value) { fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont2when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -25110,7 +26548,7 @@ class GetAddressesForKeyActorActorState { fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< GetAddressesForKeyActorActor, 1, KeyRangeLocationInfo >*,Error err) + void a_callback_error(ActorCallback< GetAddressesForKeyActorActor, 1, RangeResult >*,Error err) { fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 1); a_exitChoose2(); @@ -25125,39 +26563,63 @@ class GetAddressesForKeyActorActorState { fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 1); } - int a_body1cont5(int loopDepth) + int a_body1cont4(RangeResult const& serverUids,int loopDepth) { - #line 5412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(!serverTagResult.more && serverTagResult.size() < CLIENT_KNOBS->TOO_MANY); - #line 5413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future futureServerUids = getRange(trState, ver, lastLessOrEqual(ksKey), firstGreaterThan(ksKey), GetRangeLimits(1), Reverse::False, UseTenant::False); - #line 5420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = futureServerUids; - #line 5420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(serverUids.size()); + #line 5714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector src; + #line 5715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector ignore; + #line 5718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + decodeKeyServersValue(serverTagResult, serverUids[0].value, src, ignore); + #line 5719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture>> __when_expr_3 = transactionalGetServerInterfaces(trState, src); + #line 5719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; + #line 26580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 5420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 26585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1when1(RangeResult const& __serverTagResult,int loopDepth) + int a_body1cont4(RangeResult && serverUids,int loopDepth) { - #line 5405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - serverTagResult = __serverTagResult; - #line 25152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont5(loopDepth); + #line 5712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(serverUids.size()); + #line 5714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector src; + #line 5715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector ignore; + #line 5718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + decodeKeyServersValue(serverTagResult, serverUids[0].value, src, ignore); + #line 5719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture>> __when_expr_3 = transactionalGetServerInterfaces(trState, src); + #line 5719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 26604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 5719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 26609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont1when1(RangeResult && __serverTagResult,int loopDepth) + int a_body1cont2when1(RangeResult const& serverUids,int loopDepth) { - serverTagResult = std::move(__serverTagResult); - loopDepth = a_body1cont5(loopDepth); + loopDepth = a_body1cont4(serverUids, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(RangeResult && serverUids,int loopDepth) + { + loopDepth = a_body1cont4(std::move(serverUids), loopDepth); return loopDepth; } @@ -25172,7 +26634,7 @@ class GetAddressesForKeyActorActorState { fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont1when1(value, 0); + a_body1cont2when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -25187,7 +26649,7 @@ class GetAddressesForKeyActorActorState { fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont1when1(std::move(value), 0); + a_body1cont2when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -25212,140 +26674,29 @@ class GetAddressesForKeyActorActorState { fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 2); } - int a_body1cont6(RangeResult const& serverUids,int loopDepth) - { - #line 5422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(serverUids.size()); - #line 5424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector src; - #line 5425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector ignore; - #line 5428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - decodeKeyServersValue(serverTagResult, serverUids[0].value, src, ignore); - #line 5429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture>> __when_expr_4 = transactionalGetServerInterfaces(trState, ver, src); - #line 5429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 5429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast> >*>(static_cast(this))); - #line 25234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont6(RangeResult && serverUids,int loopDepth) - { - #line 5422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(serverUids.size()); - #line 5424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector src; - #line 5425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector ignore; - #line 5428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - decodeKeyServersValue(serverTagResult, serverUids[0].value, src, ignore); - #line 5429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture>> __when_expr_4 = transactionalGetServerInterfaces(trState, ver, src); - #line 5429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 25253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 5429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast> >*>(static_cast(this))); - #line 25258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont5when1(RangeResult const& serverUids,int loopDepth) - { - loopDepth = a_body1cont6(serverUids, loopDepth); - - return loopDepth; - } - int a_body1cont5when1(RangeResult && serverUids,int loopDepth) + int a_body1cont5(Optional> const& serverInterfaces,int loopDepth) { - loopDepth = a_body1cont6(std::move(serverUids), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetAddressesForKeyActorActor, 3, RangeResult >::remove(); - - } - void a_callback_fire(ActorCallback< GetAddressesForKeyActorActor, 3, RangeResult >*,RangeResult const& value) - { - fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont5when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< GetAddressesForKeyActorActor, 3, RangeResult >*,RangeResult && value) - { - fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont5when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< GetAddressesForKeyActorActor, 3, RangeResult >*,Error err) - { - fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 3); - - } - int a_body1cont7(Optional> const& serverInterfaces,int loopDepth) - { - #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(serverInterfaces.present()); - #line 5434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ssi = serverInterfaces.get(); - #line 5436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Standalone> addresses; - #line 5437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto i : ssi ) { - #line 5438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::string ipString = trState->options.includePort ? i.address().toString() : i.address().ip.toString(); - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" char* c_string = new (addresses.arena()) char[ipString.length() + 1]; - #line 5440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" strcpy(c_string, ipString.c_str()); - #line 5441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" addresses.push_back(addresses.arena(), c_string); - #line 25344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 5443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(addresses); this->~GetAddressesForKeyActorActorState(); static_cast(this)->destroy(); return 0; } - #line 25348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(addresses); this->~GetAddressesForKeyActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -25353,29 +26704,29 @@ class GetAddressesForKeyActorActorState { return loopDepth; } - int a_body1cont7(Optional> && serverInterfaces,int loopDepth) + int a_body1cont5(Optional> && serverInterfaces,int loopDepth) { - #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(serverInterfaces.present()); - #line 5434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ssi = serverInterfaces.get(); - #line 5436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Standalone> addresses; - #line 5437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto i : ssi ) { - #line 5438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::string ipString = trState->options.includePort ? i.address().toString() : i.address().ip.toString(); - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" char* c_string = new (addresses.arena()) char[ipString.length() + 1]; - #line 5440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" strcpy(c_string, ipString.c_str()); - #line 5441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" addresses.push_back(addresses.arena(), c_string); - #line 25374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 5443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(addresses); this->~GetAddressesForKeyActorActorState(); static_cast(this)->destroy(); return 0; } - #line 25378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(addresses); this->~GetAddressesForKeyActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -25383,58 +26734,58 @@ class GetAddressesForKeyActorActorState { return loopDepth; } - int a_body1cont6when1(Optional> const& serverInterfaces,int loopDepth) + int a_body1cont4when1(Optional> const& serverInterfaces,int loopDepth) { - loopDepth = a_body1cont7(serverInterfaces, loopDepth); + loopDepth = a_body1cont5(serverInterfaces, loopDepth); return loopDepth; } - int a_body1cont6when1(Optional> && serverInterfaces,int loopDepth) + int a_body1cont4when1(Optional> && serverInterfaces,int loopDepth) { - loopDepth = a_body1cont7(std::move(serverInterfaces), loopDepth); + loopDepth = a_body1cont5(std::move(serverInterfaces), loopDepth); return loopDepth; } - void a_exitChoose5() + void a_exitChoose4() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetAddressesForKeyActorActor, 4, Optional> >::remove(); + static_cast(this)->ActorCallback< GetAddressesForKeyActorActor, 3, Optional> >::remove(); } - void a_callback_fire(ActorCallback< GetAddressesForKeyActorActor, 4, Optional> >*,Optional> const& value) + void a_callback_fire(ActorCallback< GetAddressesForKeyActorActor, 3, Optional> >*,Optional> const& value) { - fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont6when1(value, 0); + a_body1cont4when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< GetAddressesForKeyActorActor, 4, Optional> >*,Optional> && value) + void a_callback_fire(ActorCallback< GetAddressesForKeyActorActor, 3, Optional> >*,Optional> && value) { - fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont6when1(std::move(value), 0); + a_body1cont4when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< GetAddressesForKeyActorActor, 4, Optional> >*,Error err) + void a_callback_error(ActorCallback< GetAddressesForKeyActorActor, 3, Optional> >*,Error err) { - fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -25443,31 +26794,27 @@ class GetAddressesForKeyActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getAddressesForKeyActor", reinterpret_cast(this), 3); } - #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future ver; - #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key key; - #line 5392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector ssi; - #line 5394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key resolvedKey; - #line 5396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 5404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key ksKey; - #line 5405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" RangeResult serverTagResult; - #line 25465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getAddressesForKeyActor() - #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetAddressesForKeyActorActor final : public Actor>>, public ActorCallback< GetAddressesForKeyActorActor, 0, Version >, public ActorCallback< GetAddressesForKeyActorActor, 1, KeyRangeLocationInfo >, public ActorCallback< GetAddressesForKeyActorActor, 2, RangeResult >, public ActorCallback< GetAddressesForKeyActorActor, 3, RangeResult >, public ActorCallback< GetAddressesForKeyActorActor, 4, Optional> >, public FastAllocated, public GetAddressesForKeyActorActorState { - #line 25470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetAddressesForKeyActorActor final : public Actor>>, public ActorCallback< GetAddressesForKeyActorActor, 0, Void >, public ActorCallback< GetAddressesForKeyActorActor, 1, RangeResult >, public ActorCallback< GetAddressesForKeyActorActor, 2, RangeResult >, public ActorCallback< GetAddressesForKeyActorActor, 3, Optional> >, public FastAllocated, public GetAddressesForKeyActorActorState { + #line 26817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -25475,16 +26822,15 @@ class GetAddressesForKeyActorActor final : public Actor>>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetAddressesForKeyActorActor, 0, Version >; -friend struct ActorCallback< GetAddressesForKeyActorActor, 1, KeyRangeLocationInfo >; +friend struct ActorCallback< GetAddressesForKeyActorActor, 0, Void >; +friend struct ActorCallback< GetAddressesForKeyActorActor, 1, RangeResult >; friend struct ActorCallback< GetAddressesForKeyActorActor, 2, RangeResult >; -friend struct ActorCallback< GetAddressesForKeyActorActor, 3, RangeResult >; -friend struct ActorCallback< GetAddressesForKeyActorActor, 4, Optional> >; - #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetAddressesForKeyActorActor(Reference const& trState,Future const& ver,Key const& key) - #line 25485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +friend struct ActorCallback< GetAddressesForKeyActorActor, 3, Optional> >; + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetAddressesForKeyActorActor(Reference const& trState,Key const& key) + #line 26831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor>>(), - GetAddressesForKeyActorActorState(trState, ver, key) + GetAddressesForKeyActorActorState(trState, key) { fdb_probe_actor_enter("getAddressesForKeyActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -25500,54 +26846,49 @@ friend struct ActorCallback< GetAddressesForKeyActorActor, 4, Optionalactor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetAddressesForKeyActorActor, 0, Version >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetAddressesForKeyActorActor, 1, KeyRangeLocationInfo >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetAddressesForKeyActorActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetAddressesForKeyActorActor, 1, RangeResult >*)0, actor_cancelled()); break; case 3: this->a_callback_error((ActorCallback< GetAddressesForKeyActorActor, 2, RangeResult >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< GetAddressesForKeyActorActor, 3, RangeResult >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< GetAddressesForKeyActorActor, 4, Optional> >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< GetAddressesForKeyActorActor, 3, Optional> >*)0, actor_cancelled()); break; } } }; } - #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future>> getAddressesForKeyActor( Reference const& trState, Future const& ver, Key const& key ) { - #line 5389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future>>(new GetAddressesForKeyActorActor(trState, ver, key)); - #line 25517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future>> getAddressesForKeyActor( Reference const& trState, Key const& key ) { + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new GetAddressesForKeyActorActor(trState, key)); + #line 26862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 5445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 5735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future>> Transaction::getAddressesForKey(const Key& key) { ++trState->cx->transactionLogicalReads; ++trState->cx->transactionGetAddressesForKeyRequests; - auto ver = getReadVersion(); - - return getAddressesForKeyActor(trState, ver, key); + return getAddressesForKeyActor(trState, key); } - #line 25530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getKeyAndConflictRange() - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetKeyAndConflictRangeActorState { - #line 25537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetKeyAndConflictRangeActorState(Reference const& trState,KeySelector const& k,Future const& version,Promise> const& conflictRange) - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetKeyAndConflictRangeActorState(Reference const& trState,KeySelector const& k,Promise> const& conflictRange) + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" k(k), - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version(version), - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" conflictRange(conflictRange) - #line 25550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getKeyAndConflictRange", reinterpret_cast(this)); @@ -25561,16 +26902,16 @@ class GetKeyAndConflictRangeActorState { { try { try { - #line 5459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = getKey(trState, k, version); - #line 5459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = getKey(trState, k); + #line 5746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 25568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 5459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 25573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -25598,11 +26939,11 @@ class GetKeyAndConflictRangeActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 5467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" conflictRange.send(std::make_pair(Key(), Key())); - #line 5468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 25605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -25614,23 +26955,23 @@ class GetKeyAndConflictRangeActorState { } int a_body1cont2(Key const& rep,int loopDepth) { - #line 5460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (k.offset <= 0) - #line 25619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" conflictRange.send(std::make_pair(rep, k.orEqual ? keyAfter(k.getKey()) : Key(k.getKey(), k.arena()))); - #line 25623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 5463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" conflictRange.send( std::make_pair(k.orEqual ? keyAfter(k.getKey()) : Key(k.getKey(), k.arena()), keyAfter(rep))); - #line 25629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 5465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(rep); this->~GetKeyAndConflictRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 25633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(rep); this->~GetKeyAndConflictRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -25640,23 +26981,23 @@ class GetKeyAndConflictRangeActorState { } int a_body1cont2(Key && rep,int loopDepth) { - #line 5460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (k.offset <= 0) - #line 25645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" conflictRange.send(std::make_pair(rep, k.orEqual ? keyAfter(k.getKey()) : Key(k.getKey(), k.arena()))); - #line 25649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 5463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" conflictRange.send( std::make_pair(k.orEqual ? keyAfter(k.getKey()) : Key(k.getKey(), k.arena()), keyAfter(rep))); - #line 25655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 26996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 5465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(rep); this->~GetKeyAndConflictRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 25659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(rep); this->~GetKeyAndConflictRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -25727,20 +27068,18 @@ class GetKeyAndConflictRangeActorState { fdb_probe_actor_exit("getKeyAndConflictRange", reinterpret_cast(this), 0); } - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeySelector k; - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future version; - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Promise> conflictRange; - #line 25738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getKeyAndConflictRange() - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetKeyAndConflictRangeActor final : public Actor, public ActorCallback< GetKeyAndConflictRangeActor, 0, Key >, public FastAllocated, public GetKeyAndConflictRangeActorState { - #line 25743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -25749,11 +27088,11 @@ class GetKeyAndConflictRangeActor final : public Actor, public ActorCallbac void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetKeyAndConflictRangeActor, 0, Key >; - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetKeyAndConflictRangeActor(Reference const& trState,KeySelector const& k,Future const& version,Promise> const& conflictRange) - #line 25754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetKeyAndConflictRangeActor(Reference const& trState,KeySelector const& k,Promise> const& conflictRange) + #line 27093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - GetKeyAndConflictRangeActorState(trState, k, version, conflictRange) + GetKeyAndConflictRangeActorState(trState, k, conflictRange) { fdb_probe_actor_enter("getKeyAndConflictRange", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -25775,24 +27114,24 @@ friend struct ActorCallback< GetKeyAndConflictRangeActor, 0, Key >; } }; } - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future getKeyAndConflictRange( Reference const& trState, KeySelector const& k, Future const& version, Promise> const& conflictRange ) { - #line 5454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new GetKeyAndConflictRangeActor(trState, k, version, conflictRange)); - #line 25782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getKeyAndConflictRange( Reference const& trState, KeySelector const& k, Promise> const& conflictRange ) { + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetKeyAndConflictRangeActor(trState, k, conflictRange)); + #line 27121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 5471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 5758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future Transaction::getKey(const KeySelector& key, Snapshot snapshot) { ++trState->cx->transactionLogicalReads; ++trState->cx->transactionGetKeyRequests; if (snapshot) - return ::getKey(trState, key, getReadVersion()); + return ::getKey(trState, key); Promise> conflictRange; extraConflictRanges.push_back(conflictRange.getFuture()); - return getKeyAndConflictRange(trState, key, getReadVersion(), conflictRange); + return getKeyAndConflictRange(trState, key, conflictRange); } template @@ -25826,18 +27165,18 @@ Future Transaction::getRangeInternal(const KeySelector& begin KeySelector b = begin; if (b.orEqual) { - TEST(true); // Native begin orEqual==true + CODE_PROBE(true, "Native begin orEqual==true"); b.removeOrEqual(b.arena()); } KeySelector e = end; if (e.orEqual) { - TEST(true); // Native end orEqual==true + CODE_PROBE(true, "Native end orEqual==true"); e.removeOrEqual(e.arena()); } if (b.offset >= e.offset && b.getKey() >= e.getKey()) { - TEST(true); // Native range inverted + CODE_PROBE(true, "Native range inverted"); return RangeResultFamily(); } @@ -25853,7 +27192,7 @@ Future Transaction::getRangeInternal(const KeySelector& begin } return ::getRange( - trState, getReadVersion(), b, e, mapper, limits, conflictRange, snapshot, reverse); + trState, b, e, mapper, limits, conflictRange, snapshot, reverse); } Future Transaction::getRange(const KeySelector& begin, @@ -25885,7 +27224,7 @@ Future Transaction::getRange(const KeySelector& begin, // A method for streaming data from the storage server that is more efficient than getRange when reading large amounts // of data -Future Transaction::getRangeStream(const PromiseStream& results, +Future Transaction::getRangeStream(PromiseStream& results, const KeySelector& begin, const KeySelector& end, GetRangeLimits limits, @@ -25899,18 +27238,18 @@ Future Transaction::getRangeStream(const PromiseStream& resul KeySelector b = begin; if (b.orEqual) { - TEST(true); // Native stream begin orEqual==true + CODE_PROBE(true, "Native stream begin orEqual==true", probe::decoration::rare); b.removeOrEqual(b.arena()); } KeySelector e = end; if (e.orEqual) { - TEST(true); // Native stream end orEqual==true + CODE_PROBE(true, "Native stream end orEqual==true", probe::decoration::rare); e.removeOrEqual(e.arena()); } if (b.offset >= e.offset && b.getKey() >= e.getKey()) { - TEST(true); // Native stream range inverted + CODE_PROBE(true, "Native stream range inverted", probe::decoration::rare); results.sendError(end_of_stream()); return Void(); } @@ -25920,11 +27259,10 @@ Future Transaction::getRangeStream(const PromiseStream& resul extraConflictRanges.push_back(conflictRange.getFuture()); } - return forwardErrors( - ::getRangeStream(trState, results, getReadVersion(), b, e, limits, conflictRange, snapshot, reverse), results); + return forwardErrors(::getRangeStream(trState, results, b, e, limits, conflictRange, snapshot, reverse), results); } -Future Transaction::getRangeStream(const PromiseStream& results, +Future Transaction::getRangeStream(PromiseStream& results, const KeySelector& begin, const KeySelector& end, int limit, @@ -25961,7 +27299,7 @@ void Transaction::addReadConflictRange(KeyRangeRef const& keys) { void Transaction::makeSelfConflicting() { BinaryWriter wr(Unversioned()); - wr.serializeBytes(LiteralStringRef("\xFF/SC/")); + wr.serializeBytes("\xFF/SC/"_sr); wr << deterministicRandom()->randomUniqueID(); auto r = singleKeyRange(wr.toValue(), tr.arena); tr.transaction.read_conflict_ranges.push_back(tr.arena, r); @@ -25980,6 +27318,7 @@ void Transaction::set(const KeyRef& key, const ValueRef& value, AddConflictRange auto r = singleKeyRange(key, req.arena); auto v = ValueRef(req.arena, value); t.mutations.emplace_back(req.arena, MutationRef::SetValue, r.begin, v); + trState->totalCost += getWriteOperationCost(key.expectedSize() + value.expectedSize()); if (addConflictRange) { t.write_conflict_ranges.push_back(req.arena, r); @@ -26009,11 +27348,12 @@ void Transaction::atomicOp(const KeyRef& key, auto v = ValueRef(req.arena, operand); t.mutations.emplace_back(req.arena, operationType, r.begin, v); + trState->totalCost += getWriteOperationCost(key.expectedSize()); if (addConflictRange && operationType != MutationRef::SetVersionstampedKey) t.write_conflict_ranges.push_back(req.arena, r); - TEST(true); // NativeAPI atomic operation + CODE_PROBE(true, "NativeAPI atomic operation"); } void Transaction::clear(const KeyRangeRef& range, AddConflictRange addConflictRange) { @@ -26040,7 +27380,10 @@ void Transaction::clear(const KeyRangeRef& range, AddConflictRange addConflictRa return; t.mutations.emplace_back(req.arena, MutationRef::ClearRange, r.begin, r.end); - + // NOTE: The throttling cost of each clear is assumed to be one page. + // This makes compuation fast, but can be inaccurate and may + // underestimate the cost of large clears. + trState->totalCost += CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE; if (addConflictRange) t.write_conflict_ranges.push_back(req.arena, r); } @@ -26099,7 +27442,7 @@ double Transaction::getBackoff(int errCode) { if (priorityItr != trState->cx->throttledTags.end()) { auto tagItr = priorityItr->second.find(tag); if (tagItr != priorityItr->second.end()) { - TEST(true); // Returning throttle backoff + CODE_PROBE(true, "Returning throttle backoff"); returnedBackoff = std::max( returnedBackoff, std::min(CLIENT_KNOBS->TAG_THROTTLE_RECHECK_INTERVAL, tagItr->second.throttleDuration())); @@ -26114,7 +27457,9 @@ double Transaction::getBackoff(int errCode) { returnedBackoff *= deterministicRandom()->random01(); // Set backoff for next time - if (errCode == error_code_proxy_memory_limit_exceeded) { + if (errCode == error_code_commit_proxy_memory_limit_exceeded || + errCode == error_code_grv_proxy_memory_limit_exceeded) { + backoff = std::min(backoff * CLIENT_KNOBS->BACKOFF_GROWTH_RATE, CLIENT_KNOBS->RESOURCE_CONSTRAINED_MAX_BACKOFF); } else { backoff = std::min(backoff * CLIENT_KNOBS->BACKOFF_GROWTH_RATE, trState->options.maxBackoff); @@ -26151,6 +27496,7 @@ void TransactionOptions::clear() { useGrvCache = false; skipGrvCache = false; rawAccess = false; + bypassStorageQuota = false; } TransactionOptions::TransactionOptions() { @@ -26168,22 +27514,24 @@ void TransactionOptions::reset(Database const& cx) { void Transaction::resetImpl(bool generateNewSpan) { flushTrLogsIfEnabled(); trState = trState->cloneAndReset(createTrLogInfoProbabilistically(trState->cx), generateNewSpan); - tr = CommitTransactionRequest(trState->spanID); - readVersion = Future(); - metadataVersion = Promise>(); + tr = CommitTransactionRequest(trState->spanContext); extraConflictRanges.clear(); commitResult = Promise(); committing = Future(); cancelWatches(); } +TagSet const& Transaction::getTags() const { + return trState->options.tags; +} + void Transaction::reset() { resetImpl(false); } void Transaction::fullReset() { resetImpl(true); - span = Span(trState->spanID, "Transaction"_loc); + span = Span(trState->spanContext, "Transaction"_loc); backoff = CLIENT_KNOBS->DEFAULT_BACKOFF; } @@ -26227,29 +27575,29 @@ Optional intersects(VectorRef lhs, VectorRef(); } - #line 26230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via checkWrites() - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class CheckWritesActorState { - #line 26237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" CheckWritesActorState(Reference const& trState,Future const& committed,Promise const& outCommitted,CommitTransactionRequest const& req) - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" committed(committed), - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" outCommitted(outCommitted), - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req(req), - #line 5919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" version() - #line 26252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("checkWrites", reinterpret_cast(this)); @@ -26263,15 +27611,15 @@ class CheckWritesActorState { { try { try { - #line 5921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = committed; - #line 5921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 26270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" static_cast(this)->actor_wait_state = 1; - #line 5921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 26274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -26297,15 +27645,15 @@ class CheckWritesActorState { } int a_body1cont1(int loopDepth) { - #line 5931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = delay(deterministicRandom()->random01()); - #line 5931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - #line 26304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" static_cast(this)->actor_wait_state = 2; - #line 5931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 26308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -26313,11 +27661,11 @@ class CheckWritesActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 5927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" outCommitted.sendError(e); - #line 5928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" delete static_cast(this); - #line 26320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return 0; } catch (Error& error) { @@ -26330,22 +27678,22 @@ class CheckWritesActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 5924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" version = trState->committedVersion; - #line 5925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" outCommitted.send(Void()); - #line 26337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont4(loopDepth); return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 5924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" version = trState->committedVersion; - #line 5925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" outCommitted.send(Void()); - #line 26348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont4(loopDepth); return loopDepth; @@ -26428,48 +27776,48 @@ class CheckWritesActorState { } int a_body1cont5(Void const& _,int loopDepth) { - #line 5933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" expectedValues = KeyRangeMap(); - #line 5935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto& mutations = req.transaction.mutations; - #line 5936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" mCount = mutations.size(); - #line 5938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int idx = 0;idx < mutations.size();idx++) { - #line 5939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (mutations[idx].type == MutationRef::SetValue) - #line 26441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" expectedValues.insert(singleKeyRange(mutations[idx].param1), MutationBlock(mutations[idx].param2)); - #line 26445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 5941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (mutations[idx].type == MutationRef::ClearRange) - #line 26451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" expectedValues.insert(KeyRangeRef(mutations[idx].param1, mutations[idx].param2), MutationBlock(true)); - #line 26455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } } try { - #line 5946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr = Transaction(trState->cx); - #line 5947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setVersion(version); - #line 5948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" checkedRanges = 0; - #line 5949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ranges = expectedValues.ranges(); - #line 5950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" it = ranges.begin(); - #line 5951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 26472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont5loopHead1(loopDepth); } catch (Error& error) { @@ -26482,48 +27830,48 @@ class CheckWritesActorState { } int a_body1cont5(Void && _,int loopDepth) { - #line 5933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" expectedValues = KeyRangeMap(); - #line 5935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto& mutations = req.transaction.mutations; - #line 5936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" mCount = mutations.size(); - #line 5938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int idx = 0;idx < mutations.size();idx++) { - #line 5939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (mutations[idx].type == MutationRef::SetValue) - #line 26495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" expectedValues.insert(singleKeyRange(mutations[idx].param1), MutationBlock(mutations[idx].param2)); - #line 26499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 5941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (mutations[idx].type == MutationRef::ClearRange) - #line 26505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" expectedValues.insert(KeyRangeRef(mutations[idx].param1, mutations[idx].param2), MutationBlock(true)); - #line 26509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } } try { - #line 5946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr = Transaction(trState->cx); - #line 5947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setVersion(version); - #line 5948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" checkedRanges = 0; - #line 5949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ranges = expectedValues.ranges(); - #line 5950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" it = ranges.begin(); - #line 5951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 26526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont5loopHead1(loopDepth); } catch (Error& error) { @@ -26606,13 +27954,13 @@ class CheckWritesActorState { int a_body1cont5Catch1(const Error& e,int loopDepth=0) { try { - #line 5983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool ok = e.code() == error_code_transaction_too_old || e.code() == error_code_future_version; - #line 5984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(ok ? SevWarn : SevError, "CheckWritesFailed").error(e); - #line 5985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 26615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -26624,9 +27972,9 @@ class CheckWritesActorState { } int a_body1cont11(int loopDepth) { - #line 5978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent("CheckWritesSuccess") .detail("Version", version) .detail("MutationCount", mCount) .detail("CheckedRanges", checkedRanges); - #line 26629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont11cont2(loopDepth); return loopDepth; @@ -26640,46 +27988,46 @@ class CheckWritesActorState { } int a_body1cont5loopBody1(int loopDepth) { - #line 5951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!(it != ranges.end())) - #line 26645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 27993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { return a_body1cont5break1(loopDepth==0?0:loopDepth-1); // break } - #line 5952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" m = it->value(); - #line 5953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (m.mutated) - #line 26653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" checkedRanges++; - #line 5955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (m.cleared) - #line 26659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = tr.getRange(it->range(), 1); - #line 5956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont5Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont5loopBody1when1(__when_expr_2.get(), loopDepth); }; - #line 26665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" static_cast(this)->actor_wait_state = 3; - #line 5956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 26669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - #line 5965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture> __when_expr_3 = tr.get(it->range().begin); - #line 5965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont5Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont5loopBody1when2(__when_expr_3.get(), loopDepth); }; - #line 26678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" static_cast(this)->actor_wait_state = 4; - #line 5965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 26682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } } @@ -26705,9 +28053,9 @@ class CheckWritesActorState { } int a_body1cont5loopBody1cont1(int loopDepth) { - #line 5951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++it; - #line 26710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1cont5loopHead1(0); return loopDepth; @@ -26720,15 +28068,15 @@ class CheckWritesActorState { } int a_body1cont5loopBody1cont4(RangeResult const& shouldBeEmpty,int loopDepth) { - #line 5957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (shouldBeEmpty.size()) - #line 26725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevError, "CheckWritesFailed") .detail("Class", "Clear") .detail("KeyBegin", it->range().begin) .detail("KeyEnd", it->range().end); - #line 5962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" delete static_cast(this); - #line 26731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return 0; } loopDepth = a_body1cont5loopBody1cont3(loopDepth); @@ -26737,15 +28085,15 @@ class CheckWritesActorState { } int a_body1cont5loopBody1cont4(RangeResult && shouldBeEmpty,int loopDepth) { - #line 5957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (shouldBeEmpty.size()) - #line 26742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevError, "CheckWritesFailed") .detail("Class", "Clear") .detail("KeyBegin", it->range().begin) .detail("KeyEnd", it->range().end); - #line 5962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" delete static_cast(this); - #line 26748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return 0; } loopDepth = a_body1cont5loopBody1cont3(loopDepth); @@ -26817,31 +28165,31 @@ class CheckWritesActorState { } int a_body1cont5loopBody1cont7(Optional const& val,int loopDepth) { - #line 5966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!val.present() || val.get() != m.setValue) - #line 26822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent evt(SevError, "CheckWritesFailed"); - #line 5968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" evt.detail("Class", "Set").detail("Key", it->range().begin).detail("Expected", m.setValue); - #line 5969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!val.present()) - #line 26830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" evt.detail("Actual", "_Value Missing_"); - #line 26834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 5972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" evt.detail("Actual", val.get()); - #line 26840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 5973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" delete static_cast(this); - #line 26844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return 0; } loopDepth = a_body1cont5loopBody1cont3(loopDepth); @@ -26850,31 +28198,31 @@ class CheckWritesActorState { } int a_body1cont5loopBody1cont7(Optional && val,int loopDepth) { - #line 5966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!val.present() || val.get() != m.setValue) - #line 26855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent evt(SevError, "CheckWritesFailed"); - #line 5968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" evt.detail("Class", "Set").detail("Key", it->range().begin).detail("Expected", m.setValue); - #line 5969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!val.present()) - #line 26863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 5970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" evt.detail("Actual", "_Value Missing_"); - #line 26867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 5972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" evt.detail("Actual", val.get()); - #line 26873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 5973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" delete static_cast(this); - #line 26877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return 0; } loopDepth = a_body1cont5loopBody1cont3(loopDepth); @@ -26959,43 +28307,43 @@ class CheckWritesActorState { } int a_body1cont12(int loopDepth) { - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" delete static_cast(this); - #line 26964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return 0; return loopDepth; } - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future committed; - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Promise outCommitted; - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" CommitTransactionRequest req; - #line 5919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Version version; - #line 5933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRangeMap expectedValues; - #line 5936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int mCount; - #line 5946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction tr; - #line 5948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int checkedRanges; - #line 5949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRangeMap::Ranges ranges; - #line 5950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRangeMap::iterator it; - #line 5952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" MutationBlock m; - #line 26993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via checkWrites() - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class CheckWritesActor final : public Actor, public ActorCallback< CheckWritesActor, 0, Void >, public ActorCallback< CheckWritesActor, 1, Void >, public ActorCallback< CheckWritesActor, 2, RangeResult >, public ActorCallback< CheckWritesActor, 3, Optional >, public FastAllocated, public CheckWritesActorState { - #line 26998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -27007,9 +28355,9 @@ friend struct ActorCallback< CheckWritesActor, 0, Void >; friend struct ActorCallback< CheckWritesActor, 1, Void >; friend struct ActorCallback< CheckWritesActor, 2, RangeResult >; friend struct ActorCallback< CheckWritesActor, 3, Optional >; - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" CheckWritesActor(Reference const& trState,Future const& committed,Promise const& outCommitted,CommitTransactionRequest const& req) - #line 27012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), CheckWritesActorState(trState, committed, outCommitted, req) { @@ -27024,38 +28372,42 @@ friend struct ActorCallback< CheckWritesActor, 3, Optional >; } }; } - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" void checkWrites( Reference const& trState, Future const& committed, Promise const& outCommitted, CommitTransactionRequest const& req ) { - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" new CheckWritesActor(trState, committed, outCommitted, req); - #line 27031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 5988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +FDB_BOOLEAN_PARAM(TenantPrefixPrepended); - #line 27036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via commitDummyTransaction() - #line 5989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 5989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class CommitDummyTransactionActorState { - #line 27043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 5989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - CommitDummyTransactionActorState(Reference const& trState,KeyRange const& range) - #line 5989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 5989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CommitDummyTransactionActorState(Reference const& trState,KeyRange const& range,TenantPrefixPrepended const& tenantPrefixPrepended) + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 5989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" range(range), - #line 5990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr(trState->cx), - #line 5991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantPrefixPrepended(tenantPrefixPrepended), + #line 6290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr(trState->cx, trState->tenant()), + #line 6291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" retries(0), - #line 5992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:dummyTransaction"_loc, trState->spanID) - #line 27058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:dummyTransaction"_loc, trState->spanContext) + #line 28410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("commitDummyTransaction", reinterpret_cast(this)); @@ -27068,11 +28420,11 @@ class CommitDummyTransactionActorState { int a_body1(int loopDepth=0) { try { - #line 5993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr.span.addParent(span.context); - #line 5994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.span.setParent(span.context); + #line 6294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 27075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -27101,32 +28453,48 @@ class CommitDummyTransactionActorState { int a_body1loopBody1(int loopDepth) { try { - #line 5996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent("CommitDummyTransaction").detail("Key", range.begin).detail("Retries", retries); - #line 5997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.trState->options = trState->options; - #line 5998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.trState->taskID = trState->taskID; - #line 5999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 6000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.trState->authToken = trState->authToken; + #line 6300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!trState->hasTenant()) + #line 28466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::RAW_ACCESS); + #line 28470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + #line 6303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.trState->skipApplyTenantPrefix = tenantPrefixPrepended; + #line 6304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Commit of a dummy transaction in tenant keyspace"); + #line 28478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 6306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setOption(FDBTransactionOptions::CAUSAL_WRITE_RISKY); - #line 6001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 6002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.addReadConflictRange(range); - #line 6003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.addWriteConflictRange(range); - #line 6004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = tr.commit(); - #line 6004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 27124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 6004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -27139,9 +28507,9 @@ class CommitDummyTransactionActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 6013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++retries; - #line 27144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -27149,18 +28517,30 @@ class CommitDummyTransactionActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 6007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_tenant_not_found) + #line 28522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitDummyTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 28526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CommitDummyTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 6317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent("CommitDummyTransactionError") .errorUnsuppressed(e) .detail("Key", range.begin) .detail("Retries", retries); - #line 6011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = tr.onError(e); - #line 6011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 27158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 6011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -27173,9 +28553,9 @@ class CommitDummyTransactionActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 6005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitDummyTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 27178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CommitDummyTransactionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -27185,9 +28565,9 @@ class CommitDummyTransactionActorState { } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 6005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitDummyTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 27190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CommitDummyTransactionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -27333,22 +28713,24 @@ class CommitDummyTransactionActorState { fdb_probe_actor_exit("commitDummyTransaction", reinterpret_cast(this), 1); } - #line 5989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 5989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange range; - #line 5990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TenantPrefixPrepended tenantPrefixPrepended; + #line 6290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction tr; - #line 5991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int retries; - #line 5992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 27346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via commitDummyTransaction() - #line 5989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class CommitDummyTransactionActor final : public Actor, public ActorCallback< CommitDummyTransactionActor, 0, Void >, public ActorCallback< CommitDummyTransactionActor, 1, Void >, public FastAllocated, public CommitDummyTransactionActorState { - #line 27351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 28733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -27358,11 +28740,11 @@ class CommitDummyTransactionActor final : public Actor, public ActorCallba #pragma clang diagnostic pop friend struct ActorCallback< CommitDummyTransactionActor, 0, Void >; friend struct ActorCallback< CommitDummyTransactionActor, 1, Void >; - #line 5989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - CommitDummyTransactionActor(Reference const& trState,KeyRange const& range) - #line 27363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CommitDummyTransactionActor(Reference const& trState,KeyRange const& range,TenantPrefixPrepended const& tenantPrefixPrepended) + #line 28745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - CommitDummyTransactionActorState(trState, range) + CommitDummyTransactionActorState(trState, range, tenantPrefixPrepended) { fdb_probe_actor_enter("commitDummyTransaction", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -27385,14 +28767,651 @@ friend struct ActorCallback< CommitDummyTransactionActor, 1, Void >; } }; } - #line 5989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] static Future commitDummyTransaction( Reference const& trState, KeyRange const& range ) { - #line 5989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new CommitDummyTransactionActor(trState, range)); - #line 27392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] static Future commitDummyTransaction( Reference const& trState, KeyRange const& range, TenantPrefixPrepended const& tenantPrefixPrepended ) { + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new CommitDummyTransactionActor(trState, range, tenantPrefixPrepended)); + #line 28774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 6326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 28779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via determineCommitStatus() + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class DetermineCommitStatusActorState { + #line 28786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + DetermineCommitStatusActorState(Reference const& trState,Version const& minPossibleCommitVersion,Version const& maxPossibleCommitVersion,IdempotencyIdRef const& idempotencyId) + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : trState(trState), + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + minPossibleCommitVersion(minPossibleCommitVersion), + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + maxPossibleCommitVersion(maxPossibleCommitVersion), + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + idempotencyId(idempotencyId), + #line 6331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr(trState->cx), + #line 6332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + retries(0), + #line 6333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + expiredVersion(), + #line 6334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:determineCommitStatus"_loc, trState->spanContext) + #line 28807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("determineCommitStatus", reinterpret_cast(this)); + + } + ~DetermineCommitStatusActorState() + { + fdb_probe_actor_destroy("determineCommitStatus", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 6335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.span.setParent(span.context); + #line 6336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 28824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~DetermineCommitStatusActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 6338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.trState->options = trState->options; + #line 6339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.trState->taskID = trState->taskID; + #line 6340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.trState->authToken = trState->authToken; + #line 6341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 6342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::READ_LOCK_AWARE); + #line 6343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyBackedObjectProperty expiredKey(idempotencyIdsExpiredVersion, Unversioned()); + #line 6345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = expiredKey.getD(&tr); + #line 6345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 28869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 6345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 28874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + #line 6387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++retries; + #line 28889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 6381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("DetermineCommitStatusError") .errorUnsuppressed(e) .detail("IdempotencyId", idempotencyId.asStringRefUnsafe()) .detail("Retries", retries); + #line 6385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = tr.onError(e); + #line 6385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 28903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 6385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 28908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(IdempotencyIdsExpiredVersion const& expiredVal,int loopDepth) + { + #line 6346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + expiredVersion = expiredVal.expired; + #line 6347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (expiredVersion >= minPossibleCommitVersion) + #line 28925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1loopBody1Catch1(commit_unknown_result_fatal(), loopDepth); + #line 28929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 6350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = tr.getReadVersion(); + #line 6350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 28935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 6350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 28940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(IdempotencyIdsExpiredVersion && expiredVal,int loopDepth) + { + #line 6346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + expiredVersion = expiredVal.expired; + #line 6347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (expiredVersion >= minPossibleCommitVersion) + #line 28951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1loopBody1Catch1(commit_unknown_result_fatal(), loopDepth); + #line 28955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 6350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = tr.getReadVersion(); + #line 6350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 28961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 6350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 28966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(IdempotencyIdsExpiredVersion const& expiredVal,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(expiredVal, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(IdempotencyIdsExpiredVersion && expiredVal,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(expiredVal), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DetermineCommitStatusActor, 0, IdempotencyIdsExpiredVersion >::remove(); + + } + void a_callback_fire(ActorCallback< DetermineCommitStatusActor, 0, IdempotencyIdsExpiredVersion >*,IdempotencyIdsExpiredVersion const& value) + { + fdb_probe_actor_enter("determineCommitStatus", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("determineCommitStatus", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< DetermineCommitStatusActor, 0, IdempotencyIdsExpiredVersion >*,IdempotencyIdsExpiredVersion && value) + { + fdb_probe_actor_enter("determineCommitStatus", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("determineCommitStatus", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< DetermineCommitStatusActor, 0, IdempotencyIdsExpiredVersion >*,Error err) + { + fdb_probe_actor_enter("determineCommitStatus", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("determineCommitStatus", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(Version const& rv,int loopDepth) + { + #line 6351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("DetermineCommitStatusAttempt") .detail("IdempotencyId", idempotencyId.asStringRefUnsafe()) .detail("Retries", retries) .detail("ReadVersion", rv) .detail("ExpiredVersion", expiredVersion) .detail("MinPossibleCommitVersion", minPossibleCommitVersion) .detail("MaxPossibleCommitVersion", maxPossibleCommitVersion); + #line 6358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange possibleRange = KeyRangeRef(BinaryWriter::toValue(bigEndian64(minPossibleCommitVersion), Unversioned()) .withPrefix(idempotencyIdKeys.begin), BinaryWriter::toValue(bigEndian64(maxPossibleCommitVersion + 1), Unversioned()) .withPrefix(idempotencyIdKeys.begin)); + #line 6363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = tr.getRange(possibleRange, CLIENT_KNOBS->TOO_MANY); + #line 6363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 29044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 6363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 29049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Version && rv,int loopDepth) + { + #line 6351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("DetermineCommitStatusAttempt") .detail("IdempotencyId", idempotencyId.asStringRefUnsafe()) .detail("Retries", retries) .detail("ReadVersion", rv) .detail("ExpiredVersion", expiredVersion) .detail("MinPossibleCommitVersion", minPossibleCommitVersion) .detail("MaxPossibleCommitVersion", maxPossibleCommitVersion); + #line 6358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange possibleRange = KeyRangeRef(BinaryWriter::toValue(bigEndian64(minPossibleCommitVersion), Unversioned()) .withPrefix(idempotencyIdKeys.begin), BinaryWriter::toValue(bigEndian64(maxPossibleCommitVersion + 1), Unversioned()) .withPrefix(idempotencyIdKeys.begin)); + #line 6363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = tr.getRange(possibleRange, CLIENT_KNOBS->TOO_MANY); + #line 6363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 29064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 6363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 29069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Version const& rv,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(rv, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Version && rv,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(rv), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DetermineCommitStatusActor, 1, Version >::remove(); + + } + void a_callback_fire(ActorCallback< DetermineCommitStatusActor, 1, Version >*,Version const& value) + { + fdb_probe_actor_enter("determineCommitStatus", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("determineCommitStatus", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< DetermineCommitStatusActor, 1, Version >*,Version && value) + { + fdb_probe_actor_enter("determineCommitStatus", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("determineCommitStatus", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< DetermineCommitStatusActor, 1, Version >*,Error err) + { + fdb_probe_actor_enter("determineCommitStatus", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("determineCommitStatus", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont5(RangeResult const& range,int loopDepth) + { + #line 6364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!range.more); + #line 6365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( const auto& kv : range ) { + #line 6366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto commitResult = kvContainsIdempotencyId(kv, idempotencyId); + #line 6367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (commitResult.present()) + #line 29147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("DetermineCommitStatus") .detail("Committed", 1) .detail("IdempotencyId", idempotencyId.asStringRefUnsafe()) .detail("Retries", retries); + #line 6372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(commitResult); this->~DetermineCommitStatusActorState(); static_cast(this)->destroy(); return 0; } + #line 29153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(commitResult); + this->~DetermineCommitStatusActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 6375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("DetermineCommitStatus") .detail("Committed", 0) .detail("IdempotencyId", idempotencyId.asStringRefUnsafe()) .detail("Retries", retries); + #line 6379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~DetermineCommitStatusActorState(); static_cast(this)->destroy(); return 0; } + #line 29164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~DetermineCommitStatusActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont5(RangeResult && range,int loopDepth) + { + #line 6364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!range.more); + #line 6365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( const auto& kv : range ) { + #line 6366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto commitResult = kvContainsIdempotencyId(kv, idempotencyId); + #line 6367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (commitResult.present()) + #line 29182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("DetermineCommitStatus") .detail("Committed", 1) .detail("IdempotencyId", idempotencyId.asStringRefUnsafe()) .detail("Retries", retries); + #line 6372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(commitResult); this->~DetermineCommitStatusActorState(); static_cast(this)->destroy(); return 0; } + #line 29188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(commitResult); + this->~DetermineCommitStatusActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 6375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("DetermineCommitStatus") .detail("Committed", 0) .detail("IdempotencyId", idempotencyId.asStringRefUnsafe()) .detail("Retries", retries); + #line 6379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~DetermineCommitStatusActorState(); static_cast(this)->destroy(); return 0; } + #line 29199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~DetermineCommitStatusActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont3when1(RangeResult const& range,int loopDepth) + { + loopDepth = a_body1loopBody1cont5(range, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(RangeResult && range,int loopDepth) + { + loopDepth = a_body1loopBody1cont5(std::move(range), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DetermineCommitStatusActor, 2, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< DetermineCommitStatusActor, 2, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("determineCommitStatus", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("determineCommitStatus", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< DetermineCommitStatusActor, 2, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("determineCommitStatus", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("determineCommitStatus", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< DetermineCommitStatusActor, 2, RangeResult >*,Error err) + { + fdb_probe_actor_enter("determineCommitStatus", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("determineCommitStatus", reinterpret_cast(this), 2); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DetermineCommitStatusActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DetermineCommitStatusActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("determineCommitStatus", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("determineCommitStatus", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< DetermineCommitStatusActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("determineCommitStatus", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("determineCommitStatus", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< DetermineCommitStatusActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("determineCommitStatus", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("determineCommitStatus", reinterpret_cast(this), 3); + + } + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference trState; + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version minPossibleCommitVersion; + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version maxPossibleCommitVersion; + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + IdempotencyIdRef idempotencyId; + #line 6331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Transaction tr; + #line 6332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int retries; + #line 6333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version expiredVersion; + #line 6334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Span span; + #line 29361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via determineCommitStatus() + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class DetermineCommitStatusActor final : public Actor>, public ActorCallback< DetermineCommitStatusActor, 0, IdempotencyIdsExpiredVersion >, public ActorCallback< DetermineCommitStatusActor, 1, Version >, public ActorCallback< DetermineCommitStatusActor, 2, RangeResult >, public ActorCallback< DetermineCommitStatusActor, 3, Void >, public FastAllocated, public DetermineCommitStatusActorState { + #line 29366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DetermineCommitStatusActor, 0, IdempotencyIdsExpiredVersion >; +friend struct ActorCallback< DetermineCommitStatusActor, 1, Version >; +friend struct ActorCallback< DetermineCommitStatusActor, 2, RangeResult >; +friend struct ActorCallback< DetermineCommitStatusActor, 3, Void >; + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + DetermineCommitStatusActor(Reference const& trState,Version const& minPossibleCommitVersion,Version const& maxPossibleCommitVersion,IdempotencyIdRef const& idempotencyId) + #line 29380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>(), + DetermineCommitStatusActorState(trState, minPossibleCommitVersion, maxPossibleCommitVersion, idempotencyId) + { + fdb_probe_actor_enter("determineCommitStatus", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("determineCommitStatus"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("determineCommitStatus", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DetermineCommitStatusActor, 0, IdempotencyIdsExpiredVersion >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DetermineCommitStatusActor, 1, Version >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< DetermineCommitStatusActor, 2, RangeResult >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< DetermineCommitStatusActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] static Future> determineCommitStatus( Reference const& trState, Version const& minPossibleCommitVersion, Version const& maxPossibleCommitVersion, IdempotencyIdRef const& idempotencyId ) { + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>(new DetermineCommitStatusActor(trState, minPossibleCommitVersion, maxPossibleCommitVersion, idempotencyId)); + #line 29411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 6016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 6390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" void Transaction::cancelWatches(Error const& e) { for (int i = 0; i < watches.size(); ++i) @@ -27407,16 +29426,17 @@ void Transaction::setupWatches() { Future watchVersion = getCommittedVersion() > 0 ? getCommittedVersion() : getReadVersion(); for (int i = 0; i < watches.size(); ++i) - watches[i]->setWatch(watchValueMap(watchVersion, - trState->getTenantInfo(), - watches[i]->key, - watches[i]->value, - trState->cx, - trState->options.readTags, - trState->spanID, - trState->taskID, - trState->debugID, - trState->useProvisionalProxies)); + watches[i]->setWatch( + watchValueMap(watchVersion, + trState->getTenantInfo(), + watches[i]->key, + watches[i]->value, + trState->cx, + trState->options.readTags, + trState->spanContext, + trState->taskID, + trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(), + trState->useProvisionalProxies)); watches.clear(); } catch (Error&) { @@ -27425,29 +29445,29 @@ void Transaction::setupWatches() { } } - #line 27428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via estimateCommitCosts() - #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class EstimateCommitCostsActorState { - #line 27435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" EstimateCommitCostsActorState(Reference const& trState,CommitTransactionRef const* const& transaction) - #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" transaction(transaction), - #line 6050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trCommitCosts(), - #line 6051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keyRange(), - #line 6052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" i(0) - #line 27450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("estimateCommitCosts", reinterpret_cast(this)); @@ -27460,9 +29480,9 @@ class EstimateCommitCostsActorState { int a_body1(int loopDepth=0) { try { - #line 6054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 27465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -27483,56 +29503,56 @@ class EstimateCommitCostsActorState { } int a_body1cont1(int loopDepth) { - #line 6097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!trState->cx->sampleOnCost(trCommitCosts.writeCosts)) - #line 27488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~EstimateCommitCostsActorState(); static_cast(this)->destroy(); return 0; } - #line 27492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~EstimateCommitCostsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 6106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(trCommitCosts.writeCosts > 0); - #line 6107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::deque> newClearIdxCosts; - #line 6108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( const auto& [idx, cost] : trCommitCosts.clearIdxCosts ) { - #line 6109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (trCommitCosts.writeCosts >= CLIENT_KNOBS->COMMIT_SAMPLE_COST) - #line 27506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double mul = trCommitCosts.writeCosts / std::max(1.0, (double)CLIENT_KNOBS->COMMIT_SAMPLE_COST); - #line 6111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (deterministicRandom()->random01() < cost * mul / trCommitCosts.writeCosts) - #line 27512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" newClearIdxCosts.emplace_back( idx, cost < CLIENT_KNOBS->COMMIT_SAMPLE_COST ? CLIENT_KNOBS->COMMIT_SAMPLE_COST : cost); - #line 27516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } else { - #line 6115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (deterministicRandom()->random01() < (double)cost / trCommitCosts.writeCosts) - #line 27523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" newClearIdxCosts.emplace_back( idx, cost < CLIENT_KNOBS->COMMIT_SAMPLE_COST ? CLIENT_KNOBS->COMMIT_SAMPLE_COST : cost); - #line 27527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } } - #line 6121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trCommitCosts.clearIdxCosts.swap(newClearIdxCosts); - #line 6122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(trCommitCosts); this->~EstimateCommitCostsActorState(); static_cast(this)->destroy(); return 0; } - #line 27535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(trCommitCosts)); // state_var_RVO this->~EstimateCommitCostsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -27549,64 +29569,73 @@ class EstimateCommitCostsActorState { } int a_body1loopBody1(int loopDepth) { - #line 6054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!(i < transaction->mutations.size())) - #line 27554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 6055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - auto* it = &transaction->mutations[i]; - #line 6057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (it->type == MutationRef::Type::SetValue || it->isAtomicOp()) - #line 27562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto const& mutation = transaction->mutations[i]; + #line 6432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (mutation.type == MutationRef::Type::SetValue || mutation.isAtomicOp()) + #line 29582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trCommitCosts.opsCount++; - #line 6059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trCommitCosts.writeCosts += getWriteOperationCost(it->expectedSize()); - #line 27568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trCommitCosts.writeCosts += getWriteOperationCost(mutation.expectedSize()); + #line 29588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); } else { - #line 6060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (it->type == MutationRef::Type::ClearRange) - #line 27575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (mutation.type == MutationRef::Type::ClearRange) + #line 29595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trCommitCosts.opsCount++; - #line 6062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - keyRange = KeyRangeRef(it->param1, it->param2); - #line 6063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keyRange = KeyRangeRef(mutation.param1, mutation.param2); + #line 6438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (trState->options.expensiveClearCostEstimation) - #line 27583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = trState->cx->getStorageMetrics(keyRange, CLIENT_KNOBS->TOO_MANY); - #line 6064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = trState->cx->getStorageMetrics(keyRange, CLIENT_KNOBS->TOO_MANY, trState); + #line 6439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 27589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 6064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 27594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - #line 6070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_1 = getKeyRangeLocations(trState, keyRange, CLIENT_KNOBS->TOO_MANY, Reverse::False, &StorageServerInterface::getShardState, UseTenant::True, latestVersion); - #line 6070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 27603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 6070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 27608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 6445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->hasTenant()) + #line 29621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = trState->tenant().get()->ready(); + #line 6446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 29627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 6446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 29632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont8(loopDepth); + } } } else @@ -27632,18 +29661,18 @@ class EstimateCommitCostsActorState { } int a_body1continue1(int loopDepth) { - #line 6054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++i; - #line 27637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(int loopDepth) { - #line 6054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++i; - #line 27646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -27662,30 +29691,30 @@ class EstimateCommitCostsActorState { } int a_body1loopBody1cont6(StorageMetrics const& m,int loopDepth) { - #line 6065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trCommitCosts.clearIdxCosts.emplace_back(i, getWriteOperationCost(m.bytes)); - #line 6066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trCommitCosts.writeCosts += getWriteOperationCost(m.bytes); - #line 6067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trCommitCosts.expensiveCostEstCount; - #line 6068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionsExpensiveClearCostEstCount; - #line 27673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; } int a_body1loopBody1cont6(StorageMetrics && m,int loopDepth) { - #line 6065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trCommitCosts.clearIdxCosts.emplace_back(i, getWriteOperationCost(m.bytes)); - #line 6066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trCommitCosts.writeCosts += getWriteOperationCost(m.bytes); - #line 6067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trCommitCosts.expensiveCostEstCount; - #line 6068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionsExpensiveClearCostEstCount; - #line 27688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 29717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; @@ -27753,91 +29782,53 @@ class EstimateCommitCostsActorState { fdb_probe_actor_exit("estimateCommitCosts", reinterpret_cast(this), 0); } - int a_body1loopBody1cont8(std::vector const& locations,int loopDepth) + int a_body1loopBody1cont8(int loopDepth) { - #line 6078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (locations.empty()) - #line 27760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - return a_body1continue1(loopDepth); // continue - } - #line 6082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - uint64_t bytes = 0; - #line 6083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (locations.size() == 1) - #line 27768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 6084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bytes = CLIENT_KNOBS->INCOMPLETE_SHARD_PLUS; - #line 27772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - else - { - #line 6086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bytes = CLIENT_KNOBS->INCOMPLETE_SHARD_PLUS * 2 + (locations.size() - 2) * (int64_t)trState->cx->smoothMidShardSize.smoothTotal(); - #line 27778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 6090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trCommitCosts.clearIdxCosts.emplace_back(i, getWriteOperationCost(bytes)); - #line 6091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trCommitCosts.writeCosts += getWriteOperationCost(bytes); - #line 27784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont5(loopDepth); + #line 6448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_2 = getKeyRangeLocations(trState, keyRange, CLIENT_KNOBS->TOO_MANY, Reverse::False, &StorageServerInterface::getShardState, UseTenant::True); + #line 6448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 29791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont8when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 6448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 29796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont8(std::vector && locations,int loopDepth) + int a_body1loopBody1cont9(Void const& _,int loopDepth) { - #line 6078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (locations.empty()) - #line 27793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - return a_body1continue1(loopDepth); // continue - } - #line 6082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - uint64_t bytes = 0; - #line 6083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (locations.size() == 1) - #line 27801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 6084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bytes = CLIENT_KNOBS->INCOMPLETE_SHARD_PLUS; - #line 27805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - else - { - #line 6086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bytes = CLIENT_KNOBS->INCOMPLETE_SHARD_PLUS * 2 + (locations.size() - 2) * (int64_t)trState->cx->smoothMidShardSize.smoothTotal(); - #line 27811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 6090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trCommitCosts.clearIdxCosts.emplace_back(i, getWriteOperationCost(bytes)); - #line 6091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trCommitCosts.writeCosts += getWriteOperationCost(bytes); - #line 27817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont5(loopDepth); + loopDepth = a_body1loopBody1cont8(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont9(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(loopDepth); return loopDepth; } - int a_body1loopBody1when2(std::vector const& locations,int loopDepth) + int a_body1loopBody1when2(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont8(locations, loopDepth); + loopDepth = a_body1loopBody1cont9(_, loopDepth); return loopDepth; } - int a_body1loopBody1when2(std::vector && locations,int loopDepth) + int a_body1loopBody1when2(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont8(std::move(locations), loopDepth); + loopDepth = a_body1loopBody1cont9(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< EstimateCommitCostsActor, 1, std::vector >::remove(); + static_cast(this)->ActorCallback< EstimateCommitCostsActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< EstimateCommitCostsActor, 1, std::vector >*,std::vector const& value) + void a_callback_fire(ActorCallback< EstimateCommitCostsActor, 1, Void >*,Void const& value) { fdb_probe_actor_enter("estimateCommitCosts", reinterpret_cast(this), 1); a_exitChoose2(); @@ -27852,7 +29843,7 @@ class EstimateCommitCostsActorState { fdb_probe_actor_exit("estimateCommitCosts", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< EstimateCommitCostsActor, 1, std::vector >*,std::vector && value) + void a_callback_fire(ActorCallback< EstimateCommitCostsActor, 1, Void >*,Void && value) { fdb_probe_actor_enter("estimateCommitCosts", reinterpret_cast(this), 1); a_exitChoose2(); @@ -27867,7 +29858,7 @@ class EstimateCommitCostsActorState { fdb_probe_actor_exit("estimateCommitCosts", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< EstimateCommitCostsActor, 1, std::vector >*,Error err) + void a_callback_error(ActorCallback< EstimateCommitCostsActor, 1, Void >*,Error err) { fdb_probe_actor_enter("estimateCommitCosts", reinterpret_cast(this), 1); a_exitChoose2(); @@ -27882,39 +29873,169 @@ class EstimateCommitCostsActorState { fdb_probe_actor_exit("estimateCommitCosts", reinterpret_cast(this), 1); } - #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference trState; - #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - CommitTransactionRef const* transaction; - #line 6050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ClientTrCommitCostEstimation trCommitCosts; - #line 6051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRangeRef keyRange; - #line 6052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int i; - #line 27895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -}; -// This generated class is to be used only via estimateCommitCosts() - #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class EstimateCommitCostsActor final : public Actor>, public ActorCallback< EstimateCommitCostsActor, 0, StorageMetrics >, public ActorCallback< EstimateCommitCostsActor, 1, std::vector >, public FastAllocated, public EstimateCommitCostsActorState { - #line 27900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< EstimateCommitCostsActor, 0, StorageMetrics >; -friend struct ActorCallback< EstimateCommitCostsActor, 1, std::vector >; - #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - EstimateCommitCostsActor(Reference const& trState,CommitTransactionRef const* const& transaction) - #line 27912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor>(), - EstimateCommitCostsActorState(trState, transaction) + int a_body1loopBody1cont10(std::vector const& locations,int loopDepth) { - fdb_probe_actor_enter("estimateCommitCosts", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING + #line 6455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (locations.empty()) + #line 29880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1continue1(loopDepth); // continue + } + #line 6459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + uint64_t bytes = 0; + #line 6460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (locations.size() == 1) + #line 29888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bytes = CLIENT_KNOBS->INCOMPLETE_SHARD_PLUS; + #line 29892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + #line 6463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bytes = CLIENT_KNOBS->INCOMPLETE_SHARD_PLUS * 2 + (locations.size() - 2) * (int64_t)trState->cx->smoothMidShardSize.smoothTotal(); + #line 29898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 6467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trCommitCosts.clearIdxCosts.emplace_back(i, getWriteOperationCost(bytes)); + #line 6468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trCommitCosts.writeCosts += getWriteOperationCost(bytes); + #line 29904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont5(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont10(std::vector && locations,int loopDepth) + { + #line 6455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (locations.empty()) + #line 29913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1continue1(loopDepth); // continue + } + #line 6459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + uint64_t bytes = 0; + #line 6460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (locations.size() == 1) + #line 29921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bytes = CLIENT_KNOBS->INCOMPLETE_SHARD_PLUS; + #line 29925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + #line 6463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bytes = CLIENT_KNOBS->INCOMPLETE_SHARD_PLUS * 2 + (locations.size() - 2) * (int64_t)trState->cx->smoothMidShardSize.smoothTotal(); + #line 29931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 6467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trCommitCosts.clearIdxCosts.emplace_back(i, getWriteOperationCost(bytes)); + #line 6468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trCommitCosts.writeCosts += getWriteOperationCost(bytes); + #line 29937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont5(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont8when1(std::vector const& locations,int loopDepth) + { + loopDepth = a_body1loopBody1cont10(locations, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont8when1(std::vector && locations,int loopDepth) + { + loopDepth = a_body1loopBody1cont10(std::move(locations), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< EstimateCommitCostsActor, 2, std::vector >::remove(); + + } + void a_callback_fire(ActorCallback< EstimateCommitCostsActor, 2, std::vector >*,std::vector const& value) + { + fdb_probe_actor_enter("estimateCommitCosts", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont8when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("estimateCommitCosts", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< EstimateCommitCostsActor, 2, std::vector >*,std::vector && value) + { + fdb_probe_actor_enter("estimateCommitCosts", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont8when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("estimateCommitCosts", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< EstimateCommitCostsActor, 2, std::vector >*,Error err) + { + fdb_probe_actor_enter("estimateCommitCosts", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("estimateCommitCosts", reinterpret_cast(this), 2); + + } + #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference trState; + #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CommitTransactionRef const* transaction; + #line 6425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ClientTrCommitCostEstimation trCommitCosts; + #line 6426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRangeRef keyRange; + #line 6427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int i; + #line 30015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via estimateCommitCosts() + #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class EstimateCommitCostsActor final : public Actor>, public ActorCallback< EstimateCommitCostsActor, 0, StorageMetrics >, public ActorCallback< EstimateCommitCostsActor, 1, Void >, public ActorCallback< EstimateCommitCostsActor, 2, std::vector >, public FastAllocated, public EstimateCommitCostsActorState { + #line 30020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< EstimateCommitCostsActor, 0, StorageMetrics >; +friend struct ActorCallback< EstimateCommitCostsActor, 1, Void >; +friend struct ActorCallback< EstimateCommitCostsActor, 2, std::vector >; + #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + EstimateCommitCostsActor(Reference const& trState,CommitTransactionRef const* const& transaction) + #line 30033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>(), + EstimateCommitCostsActorState(trState, transaction) + { + fdb_probe_actor_enter("estimateCommitCosts", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING this->lineage.setActorName("estimateCommitCosts"); LineageScope _(&this->lineage); #endif @@ -27928,77 +30049,94 @@ friend struct ActorCallback< EstimateCommitCostsActor, 1, std::vectoractor_wait_state = -1; switch (wait_state) { case 1: this->a_callback_error((ActorCallback< EstimateCommitCostsActor, 0, StorageMetrics >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< EstimateCommitCostsActor, 1, std::vector >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< EstimateCommitCostsActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< EstimateCommitCostsActor, 2, std::vector >*)0, actor_cancelled()); break; } } }; } - #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future> estimateCommitCosts( Reference const& trState, CommitTransactionRef const* const& transaction ) { - #line 6048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future>(new EstimateCommitCostsActor(trState, transaction)); - #line 27941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 6124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 6501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" // TODO: send the prefix as part of the commit request and ship it all the way // through to the storage servers void applyTenantPrefix(CommitTransactionRequest& req, Key tenantPrefix) { + VectorRef updatedMutations; + updatedMutations.reserve(req.arena, req.transaction.mutations.size()); for (auto& m : req.transaction.mutations) { + StringRef param1 = m.param1; + StringRef param2 = m.param2; if (m.param1 != metadataVersionKey) { - m.param1 = m.param1.withPrefix(tenantPrefix, req.arena); + param1 = m.param1.withPrefix(tenantPrefix, req.arena); if (m.type == MutationRef::ClearRange) { - m.param2 = m.param2.withPrefix(tenantPrefix, req.arena); + param2 = m.param2.withPrefix(tenantPrefix, req.arena); } else if (m.type == MutationRef::SetVersionstampedKey) { - uint8_t* key = mutateString(m.param1); - int* offset = reinterpret_cast(&key[m.param1.size() - 4]); + uint8_t* key = mutateString(param1); + int* offset = reinterpret_cast(&key[param1.size() - 4]); *offset += tenantPrefix.size(); } } + updatedMutations.push_back(req.arena, MutationRef(MutationRef::Type(m.type), param1, param2)); } + req.transaction.mutations = updatedMutations; - for (auto& rc : req.transaction.read_conflict_ranges) { + VectorRef updatedReadConflictRanges; + updatedReadConflictRanges.reserve(req.arena, req.transaction.read_conflict_ranges.size()); + for (auto const& rc : req.transaction.read_conflict_ranges) { if (rc.begin != metadataVersionKey) { - rc = rc.withPrefix(tenantPrefix, req.arena); + updatedReadConflictRanges.push_back(req.arena, rc.withPrefix(tenantPrefix, req.arena)); + } else { + updatedReadConflictRanges.push_back(req.arena, rc); } } + req.transaction.read_conflict_ranges = updatedReadConflictRanges; + VectorRef updatedWriteConflictRanges; + updatedWriteConflictRanges.reserve(req.arena, req.transaction.write_conflict_ranges.size()); for (auto& wc : req.transaction.write_conflict_ranges) { if (wc.begin != metadataVersionKey) { - wc = wc.withPrefix(tenantPrefix, req.arena); + updatedWriteConflictRanges.push_back(req.arena, wc.withPrefix(tenantPrefix, req.arena)); + } else { + updatedWriteConflictRanges.push_back(req.arena, wc); } } + req.transaction.write_conflict_ranges = updatedWriteConflictRanges; } - #line 27975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via tryCommit() - #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class TryCommitActorState { - #line 27982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TryCommitActorState(Reference const& trState,CommitTransactionRequest const& req,Future const& readVersion) - #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TryCommitActorState(Reference const& trState,CommitTransactionRequest const& req) + #line 6547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req(req), - #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - readVersion(readVersion), - #line 6157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" interval("TransactionCommit"), - #line 6158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" startTime(now()), - #line 6159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:tryCommit"_loc, trState->spanID), - #line 6160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - debugID(trState->debugID) - #line 28001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:tryCommit"_loc, trState->spanContext), + #line 6551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + debugID(trState->readOptions.present() ? trState->readOptions.get().debugID : Optional()), + #line 6552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantPrefixPrepended(TenantPrefixPrepended::False) + #line 30139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("tryCommit", reinterpret_cast(this)); @@ -28011,51 +30149,56 @@ class TryCommitActorState { int a_body1(int loopDepth=0) { try { - #line 6161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (debugID.present()) - #line 28016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(interval.begin()).detail("Parent", debugID.get()); - #line 28020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + #line 6559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + startFuture = trState->startTransaction(GetReadVersionRequest::FLAG_CAUSAL_READ_RISKY); + #line 30162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 6165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (CLIENT_BUGGIFY) - #line 28025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch2(deterministicRandom()->randomChoice(std::vector{ not_committed(), transaction_too_old(), proxy_memory_limit_exceeded(), commit_unknown_result() }), loopDepth); - #line 28029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch2(deterministicRandom()->randomChoice(std::vector{ not_committed(), transaction_too_old(), commit_proxy_memory_limit_exceeded(), grv_proxy_memory_limit_exceeded(), commit_unknown_result() }), loopDepth); + #line 30170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (req.tagSet.present() && trState->options.priority < TransactionPriority::IMMEDIATE) - #line 28033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = store(req.transaction.read_snapshot, readVersion) && store(req.commitCostEstimation, estimateCommitCosts(trState, &req.transaction)); - #line 6171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + commitCostFuture = estimateCommitCosts(trState, &req.transaction); + #line 6573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = startFuture; + #line 6573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 28039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 6171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 28044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - #line 6174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = store(req.transaction.read_snapshot, readVersion); - #line 6174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = startFuture; + #line 6576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 28053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 6174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 28058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 6576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 30201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } } @@ -28084,28 +30227,28 @@ class TryCommitActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 6298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_request_maybe_delivered || e.code() == error_code_commit_unknown_result) - #line 28089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!trState->options.causalWriteRisky) - #line 28093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!trState->options.causalWriteRisky || req.idempotencyId.valid()) + #line 30236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRangeRef selfConflictingRange = intersects(req.transaction.write_conflict_ranges, req.transaction.read_conflict_ranges).get(); - #line 6314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 6316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_5 = commitDummyTransaction(trState, singleKeyRange(selfConflictingRange.begin)); - #line 6316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Waiting for dummy transaction to report commit_unknown_result"); + #line 6730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_5 = commitDummyTransaction(trState, singleKeyRange(selfConflictingRange.begin), tenantPrefixPrepended); + #line 6730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 28103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1Catch2when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 6316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 28108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else @@ -28115,40 +30258,25 @@ class TryCommitActorState { } else { - #line 6322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_unknown_tenant) - #line 28120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() != error_code_transaction_too_old && e.code() != error_code_not_committed && e.code() != error_code_database_locked && e.code() != error_code_commit_proxy_memory_limit_exceeded && e.code() != error_code_grv_proxy_memory_limit_exceeded && e.code() != error_code_batch_transaction_throttled && e.code() != error_code_tag_throttled && e.code() != error_code_process_behind && e.code() != error_code_future_version && e.code() != error_code_tenant_not_found && e.code() != error_code_illegal_tenant_access && e.code() != error_code_proxy_tag_throttled && e.code() != error_code_storage_quota_exceeded && e.code() != error_code_tenant_locked) + #line 30263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(trState->tenant().present()); - #line 6324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->invalidateCachedTenant(trState->tenant().get()); - #line 6325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, loopDepth); - #line 28128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevError, "TryCommitError").error(e); + #line 30267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - else + #line 6766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->trLogInfo) + #line 30271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() != error_code_transaction_too_old && e.code() != error_code_not_committed && e.code() != error_code_database_locked && e.code() != error_code_proxy_memory_limit_exceeded && e.code() != error_code_batch_transaction_throttled && e.code() != error_code_tag_throttled && e.code() != error_code_process_behind && e.code() != error_code_future_version && e.code() != error_code_tenant_not_found) - #line 28134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 6332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevError, "TryCommitError").error(e); - #line 28138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 6334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->trLogInfo) - #line 28142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 6335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->trLogInfo->addLog(FdbClientLogEvents::EventCommitError( startTime, trState->cx->clientLocality.dcId(), static_cast(e.code()), req, trState->tenant())); - #line 28146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 6337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, loopDepth); - #line 28150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->trLogInfo->addLog( FdbClientLogEvents::EventCommitError(startTime, trState->cx->clientLocality.dcId(), static_cast(e.code()), req, trState->tenant().flatMapRef(&Tenant::name))); + #line 30275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + #line 6773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 30279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } catch (Error& error) { @@ -28161,40 +30289,130 @@ class TryCommitActorState { } int a_body1cont3(int loopDepth) { - #line 6177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.transaction.read_snapshot = trState->readVersion(); + #line 6581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tenantPrefix = Key(); - #line 6178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->tenant().present()) - #line 28168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 6179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = getKeyLocation(trState, ""_sr, &StorageServerInterface::getValue, Reverse::False, UseTenant::True, req.transaction.read_snapshot); - #line 6179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 28174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 6179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 28179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 6584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->hasTenant() && !trState->skipApplyTenantPrefix) + #line 30298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + applyTenantPrefix(req, trState->tenant().get()->prefix()); + #line 6586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantPrefixPrepended = TenantPrefixPrepended::True; + #line 6587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantPrefix = trState->tenant().get()->prefix(); + #line 30306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 6589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(trState->skipApplyTenantPrefix, "Tenant prefix prepend skipped for dummy transaction"); + #line 6590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.tenantInfo = trState->getTenantInfo(); + #line 6591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + startTime = now(); + #line 6592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + commitID = Optional(); + #line 6594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (debugID.present()) + #line 30318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + commitID = nondeterministicRandom()->randomUniqueID(); + #line 6596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addAttach("CommitAttachID", debugID.get().first(), commitID.get().first()); + #line 6597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + g_traceBatch.addEvent("CommitDebug", commitID.get().first(), "NativeAPI.commit.Before"); + #line 30326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 6600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.debugID = commitID; + #line 6601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + reply = Future(); + #line 6604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + alternativeChosen = -1; + #line 6606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + proxiesUsed = Reference(); + #line 6608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->options.commitOnFirstProxy) + #line 30338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->cx->clientInfo->get().firstCommitProxy.present()) + #line 30342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + reply = throwErrorOr(brokenPromiseToMaybeDelivered( trState->cx->clientInfo->get().firstCommitProxy.get().commit.tryGetReply(req))); + #line 30346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + #line 6613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + const std::vector& proxies = trState->cx->clientInfo->get().commitProxies; + #line 6614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + reply = proxies.size() ? throwErrorOr(brokenPromiseToMaybeDelivered(proxies[0].commit.tryGetReply(req))) : Never(); + #line 30354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } } else { - loopDepth = a_body1cont7(loopDepth); + #line 6618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + proxiesUsed = trState->cx->getCommitProxies(trState->useProvisionalProxies); + #line 6619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + reply = basicLoadBalance(proxiesUsed, &CommitProxyInterface::commit, req, TaskPriority::DefaultPromiseEndpoint, AtMostOnce::True, &alternativeChosen); + #line 30363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + #line 6626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + grvTime = now(); + #line 6628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = trState->cx->onProxiesChanged(); + #line 6627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 30371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; + #line 6632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = reply; + #line 30375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch2(__when_expr_4.getError(), loopDepth); else return a_body1cont3when2(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 6628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 30382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } int a_body1cont5(Void const& _,int loopDepth) { - loopDepth = a_body1cont3(loopDepth); + #line 6574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = store(req.commitCostEstimation, commitCostFuture); + #line 6574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 30393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont5when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 6574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 30398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } int a_body1cont5(Void && _,int loopDepth) { - loopDepth = a_body1cont3(loopDepth); + #line 6574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = store(req.commitCostEstimation, commitCostFuture); + #line 6574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 30409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont5when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 6574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 30414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } @@ -28273,13 +30491,13 @@ class TryCommitActorState { return loopDepth; } - int a_body1when2(Void const& _,int loopDepth) + int a_body1cont5when1(Void const& _,int loopDepth) { loopDepth = a_body1cont6(_, loopDepth); return loopDepth; } - int a_body1when2(Void && _,int loopDepth) + int a_body1cont5when1(Void && _,int loopDepth) { loopDepth = a_body1cont6(std::move(_), loopDepth); @@ -28296,7 +30514,7 @@ class TryCommitActorState { fdb_probe_actor_enter("tryCommit", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1when2(value, 0); + a_body1cont5when1(value, 0); } catch (Error& error) { a_body1Catch2(error, 0); @@ -28311,7 +30529,7 @@ class TryCommitActorState { fdb_probe_actor_enter("tryCommit", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1when2(std::move(value), 0); + a_body1cont5when1(std::move(value), 0); } catch (Error& error) { a_body1Catch2(error, 0); @@ -28336,125 +30554,42 @@ class TryCommitActorState { fdb_probe_actor_exit("tryCommit", reinterpret_cast(this), 1); } - int a_body1cont7(int loopDepth) - { - #line 6189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.tenantInfo = trState->getTenantInfo(); - #line 6191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - startTime = now(); - #line 6192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - commitID = Optional(); - #line 6194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (debugID.present()) - #line 28349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 6195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - commitID = nondeterministicRandom()->randomUniqueID(); - #line 6196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addAttach("CommitAttachID", debugID.get().first(), commitID.get().first()); - #line 6197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - g_traceBatch.addEvent("CommitDebug", commitID.get().first(), "NativeAPI.commit.Before"); - #line 28357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 6200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.debugID = commitID; - #line 6201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - reply = Future(); - #line 6202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->options.commitOnFirstProxy) - #line 28365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 6203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (trState->cx->clientInfo->get().firstCommitProxy.present()) - #line 28369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 6204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - reply = throwErrorOr(brokenPromiseToMaybeDelivered( trState->cx->clientInfo->get().firstCommitProxy.get().commit.tryGetReply(req))); - #line 28373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - else - { - #line 6207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - const std::vector& proxies = trState->cx->clientInfo->get().commitProxies; - #line 6208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - reply = proxies.size() ? throwErrorOr(brokenPromiseToMaybeDelivered(proxies[0].commit.tryGetReply(req))) : Never(); - #line 28381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - else - { - #line 6212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - reply = basicLoadBalance(trState->cx->getCommitProxies(trState->useProvisionalProxies), &CommitProxyInterface::commit, req, TaskPriority::DefaultPromiseEndpoint, AtMostOnce::True); - #line 28388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 6218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - grvTime = now(); - #line 6220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = trState->cx->onProxiesChanged(); - #line 6219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 28396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), loopDepth); else return a_body1cont7when1(__when_expr_3.get(), loopDepth); }; - #line 6224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_4 = reply; - #line 28400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch2(__when_expr_4.getError(), loopDepth); else return a_body1cont7when2(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 6220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 28407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont8(KeyRangeLocationInfo const& locationInfo,int loopDepth) + int a_body1cont7(Void const& _,int loopDepth) { - #line 6185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - applyTenantPrefix(req, locationInfo.tenantEntry.prefix); - #line 6186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tenantPrefix = locationInfo.tenantEntry.prefix; - #line 28418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont7(loopDepth); + loopDepth = a_body1cont3(loopDepth); return loopDepth; } - int a_body1cont8(KeyRangeLocationInfo && locationInfo,int loopDepth) + int a_body1cont7(Void && _,int loopDepth) { - #line 6185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - applyTenantPrefix(req, locationInfo.tenantEntry.prefix); - #line 6186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tenantPrefix = locationInfo.tenantEntry.prefix; - #line 28429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont7(loopDepth); + loopDepth = a_body1cont3(loopDepth); return loopDepth; } - int a_body1cont3when1(KeyRangeLocationInfo const& locationInfo,int loopDepth) + int a_body1when2(Void const& _,int loopDepth) { - loopDepth = a_body1cont8(locationInfo, loopDepth); + loopDepth = a_body1cont7(_, loopDepth); return loopDepth; } - int a_body1cont3when1(KeyRangeLocationInfo && locationInfo,int loopDepth) + int a_body1when2(Void && _,int loopDepth) { - loopDepth = a_body1cont8(std::move(locationInfo), loopDepth); + loopDepth = a_body1cont7(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TryCommitActor, 2, KeyRangeLocationInfo >::remove(); + static_cast(this)->ActorCallback< TryCommitActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< TryCommitActor, 2, KeyRangeLocationInfo >*,KeyRangeLocationInfo const& value) + void a_callback_fire(ActorCallback< TryCommitActor, 2, Void >*,Void const& value) { fdb_probe_actor_enter("tryCommit", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont3when1(value, 0); + a_body1when2(value, 0); } catch (Error& error) { a_body1Catch2(error, 0); @@ -28464,12 +30599,12 @@ class TryCommitActorState { fdb_probe_actor_exit("tryCommit", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< TryCommitActor, 2, KeyRangeLocationInfo >*,KeyRangeLocationInfo && value) + void a_callback_fire(ActorCallback< TryCommitActor, 2, Void >*,Void && value) { fdb_probe_actor_enter("tryCommit", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont3when1(std::move(value), 0); + a_body1when2(std::move(value), 0); } catch (Error& error) { a_body1Catch2(error, 0); @@ -28479,7 +30614,7 @@ class TryCommitActorState { fdb_probe_actor_exit("tryCommit", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< TryCommitActor, 2, KeyRangeLocationInfo >*,Error err) + void a_callback_error(ActorCallback< TryCommitActor, 2, Void >*,Error err) { fdb_probe_actor_enter("tryCommit", reinterpret_cast(this), 2); a_exitChoose3(); @@ -28494,103 +30629,111 @@ class TryCommitActorState { fdb_probe_actor_exit("tryCommit", reinterpret_cast(this), 2); } - int a_body1cont7when1(Void const& _,int loopDepth) + int a_body1cont3when1(Void const& _,int loopDepth) { - #line 6221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" reply.cancel(); - #line 6222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch2(request_maybe_delivered(), loopDepth); - #line 28503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } - int a_body1cont7when1(Void && _,int loopDepth) + int a_body1cont3when1(Void && _,int loopDepth) { - #line 6221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" reply.cancel(); - #line 6222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch2(request_maybe_delivered(), loopDepth); - #line 28513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } - int a_body1cont7when2(CommitID const& ci,int loopDepth) + int a_body1cont3when2(CommitID const& ci,int loopDepth) { - #line 6225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Version v = ci.version; - #line 6226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (v != invalidVersion) - #line 28523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (CLIENT_BUGGIFY) - #line 28527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch2(commit_unknown_result(), loopDepth); - #line 28531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->updateCachedReadVersion(grvTime, v); - #line 6231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (debugID.present()) - #line 28537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(interval.end()).detail("CommittedVersion", v); - #line 28541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->committedVersion = v; - #line 6234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (v > trState->cx->metadataVersionCache[trState->cx->mvCacheInsertLocation].first) - #line 28547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->mvCacheInsertLocation = (trState->cx->mvCacheInsertLocation + 1) % trState->cx->metadataVersionCache.size(); - #line 6237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->metadataVersionCache[trState->cx->mvCacheInsertLocation] = std::make_pair(v, ci.metadataVersion); - #line 28553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Standalone ret = makeString(10); - #line 6242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" placeVersionstamp(mutateString(ret), v, ci.txnBatchId); - #line 6243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->versionstampPromise.send(ret); - #line 6245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->numErrors = 0; - #line 6246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionsCommitCompleted; - #line 6247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->transactionCommittedMutations += req.transaction.mutations.size(); - #line 6248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->transactionCommittedMutationBytes += req.transaction.mutations.expectedSize(); - #line 6250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (commitID.present()) - #line 28571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent("CommitDebug", commitID.get().first(), "NativeAPI.commit.After"); - #line 28575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double latency = now() - startTime; - #line 6254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->commitLatencies.addSample(latency); - #line 6255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->latencies.addSample(now() - trState->startTime); - #line 6256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (trState->trLogInfo) - #line 28585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->trLogInfo->addLog( FdbClientLogEvents::EventCommit_V2(startTime, trState->cx->clientLocality.dcId(), latency, req.transaction.mutations.size(), req.transaction.mutations.expectedSize(), ci.version, req, trState->tenant())); - #line 28589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->trLogInfo->addLog( FdbClientLogEvents::EventCommit_V2(startTime, trState->cx->clientLocality.dcId(), latency, req.transaction.mutations.size(), req.transaction.mutations.expectedSize(), ci.version, req, trState->tenant().flatMapRef(&Tenant::name))); + #line 30724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->automaticIdempotency && alternativeChosen >= 0) + #line 30728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + proxiesUsed->getInterface(alternativeChosen) .expireIdempotencyId.send(ExpireIdempotencyIdRequest{ ci.version, uint8_t(ci.txnBatchId >> 8), trState->getTenantInfo() }); + #line 30732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 6680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TryCommitActorState(); static_cast(this)->destroy(); return 0; } - #line 28593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TryCommitActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -28598,129 +30741,137 @@ class TryCommitActorState { } else { - #line 6269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->conflictingKeys.reset(); - #line 6270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (ci.conflictingKRIndices.present()) - #line 28605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->conflictingKeys = std::make_shared>(conflictingKeysFalse, specialKeys.end); - #line 6273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" conflictingKRIndices = ci.conflictingKRIndices.get(); - #line 6276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" mergedIds = std::unordered_set(conflictingKRIndices.begin(), conflictingKRIndices.end()); - #line 6278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto const& rCRIndex : mergedIds ) { - #line 6279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" const KeyRangeRef kr = req.transaction.read_conflict_ranges[rCRIndex]; - #line 6280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" const KeyRange krWithPrefix = KeyRangeRef(kr.begin.removePrefix(tenantPrefix).withPrefix(conflictingKeysRange.begin), kr.end.removePrefix(tenantPrefix).withPrefix(conflictingKeysRange.begin)); - #line 6283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->conflictingKeys->insert(krWithPrefix, conflictingKeysTrue); - #line 28621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (debugID.present()) - #line 28626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(interval.end()).detail("Conflict", 1); - #line 28630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (commitID.present()) - #line 28634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent("CommitDebug", commitID.get().first(), "NativeAPI.commit.After"); - #line 28638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch2(not_committed(), loopDepth); - #line 28642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } return loopDepth; } - int a_body1cont7when2(CommitID && ci,int loopDepth) + int a_body1cont3when2(CommitID && ci,int loopDepth) { - #line 6225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Version v = ci.version; - #line 6226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (v != invalidVersion) - #line 28653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (CLIENT_BUGGIFY) - #line 28657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch2(commit_unknown_result(), loopDepth); - #line 28661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->updateCachedReadVersion(grvTime, v); - #line 6231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (debugID.present()) - #line 28667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(interval.end()).detail("CommittedVersion", v); - #line 28671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->committedVersion = v; - #line 6234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (v > trState->cx->metadataVersionCache[trState->cx->mvCacheInsertLocation].first) - #line 28677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->mvCacheInsertLocation = (trState->cx->mvCacheInsertLocation + 1) % trState->cx->metadataVersionCache.size(); - #line 6237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->metadataVersionCache[trState->cx->mvCacheInsertLocation] = std::make_pair(v, ci.metadataVersion); - #line 28683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Standalone ret = makeString(10); - #line 6242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" placeVersionstamp(mutateString(ret), v, ci.txnBatchId); - #line 6243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->versionstampPromise.send(ret); - #line 6245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->numErrors = 0; - #line 6246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionsCommitCompleted; - #line 6247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->transactionCommittedMutations += req.transaction.mutations.size(); - #line 6248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->transactionCommittedMutationBytes += req.transaction.mutations.expectedSize(); - #line 6250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (commitID.present()) - #line 28701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent("CommitDebug", commitID.get().first(), "NativeAPI.commit.After"); - #line 28705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double latency = now() - startTime; - #line 6254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->commitLatencies.addSample(latency); - #line 6255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->latencies.addSample(now() - trState->startTime); - #line 6256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (trState->trLogInfo) - #line 28715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->trLogInfo->addLog( FdbClientLogEvents::EventCommit_V2(startTime, trState->cx->clientLocality.dcId(), latency, req.transaction.mutations.size(), req.transaction.mutations.expectedSize(), ci.version, req, trState->tenant())); - #line 28719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->trLogInfo->addLog( FdbClientLogEvents::EventCommit_V2(startTime, trState->cx->clientLocality.dcId(), latency, req.transaction.mutations.size(), req.transaction.mutations.expectedSize(), ci.version, req, trState->tenant().flatMapRef(&Tenant::name))); + #line 30862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->automaticIdempotency && alternativeChosen >= 0) + #line 30866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + proxiesUsed->getInterface(alternativeChosen) .expireIdempotencyId.send(ExpireIdempotencyIdRequest{ ci.version, uint8_t(ci.txnBatchId >> 8), trState->getTenantInfo() }); + #line 30870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 6680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TryCommitActorState(); static_cast(this)->destroy(); return 0; } - #line 28723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TryCommitActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -28728,48 +30879,48 @@ class TryCommitActorState { } else { - #line 6269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->conflictingKeys.reset(); - #line 6270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (ci.conflictingKRIndices.present()) - #line 28735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->conflictingKeys = std::make_shared>(conflictingKeysFalse, specialKeys.end); - #line 6273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" conflictingKRIndices = ci.conflictingKRIndices.get(); - #line 6276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" mergedIds = std::unordered_set(conflictingKRIndices.begin(), conflictingKRIndices.end()); - #line 6278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto const& rCRIndex : mergedIds ) { - #line 6279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" const KeyRangeRef kr = req.transaction.read_conflict_ranges[rCRIndex]; - #line 6280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" const KeyRange krWithPrefix = KeyRangeRef(kr.begin.removePrefix(tenantPrefix).withPrefix(conflictingKeysRange.begin), kr.end.removePrefix(tenantPrefix).withPrefix(conflictingKeysRange.begin)); - #line 6283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->conflictingKeys->insert(krWithPrefix, conflictingKeysTrue); - #line 28751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (debugID.present()) - #line 28756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(interval.end()).detail("Conflict", 1); - #line 28760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (commitID.present()) - #line 28764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent("CommitDebug", commitID.get().first(), "NativeAPI.commit.After"); - #line 28768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch2(not_committed(), loopDepth); - #line 28772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 30923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } return loopDepth; @@ -28786,7 +30937,7 @@ class TryCommitActorState { fdb_probe_actor_enter("tryCommit", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont7when1(value, 0); + a_body1cont3when1(value, 0); } catch (Error& error) { a_body1Catch2(error, 0); @@ -28801,7 +30952,7 @@ class TryCommitActorState { fdb_probe_actor_enter("tryCommit", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont7when1(std::move(value), 0); + a_body1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1Catch2(error, 0); @@ -28831,7 +30982,7 @@ class TryCommitActorState { fdb_probe_actor_enter("tryCommit", reinterpret_cast(this), 4); a_exitChoose4(); try { - a_body1cont7when2(value, 0); + a_body1cont3when2(value, 0); } catch (Error& error) { a_body1Catch2(error, 0); @@ -28846,7 +30997,7 @@ class TryCommitActorState { fdb_probe_actor_enter("tryCommit", reinterpret_cast(this), 4); a_exitChoose4(); try { - a_body1cont7when2(std::move(value), 0); + a_body1cont3when2(std::move(value), 0); } catch (Error& error) { a_body1Catch2(error, 0); @@ -28873,21 +31024,59 @@ class TryCommitActorState { } int a_body1Catch2cont2(int loopDepth) { - #line 6321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(commit_unknown_result(), loopDepth); - #line 28878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } int a_body1Catch2cont3(Void const& _,int loopDepth) { - loopDepth = a_body1Catch2cont2(loopDepth); + #line 6732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (req.idempotencyId.valid()) + #line 31037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_6 = determineCommitStatus( trState, req.transaction.read_snapshot, req.transaction.read_snapshot + 5e6 , req.idempotencyId); + #line 6733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 31043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1Catch2cont3when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 6733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 31048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1Catch2cont4(loopDepth); + } return loopDepth; } int a_body1Catch2cont3(Void && _,int loopDepth) { - loopDepth = a_body1Catch2cont2(loopDepth); + #line 6732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (req.idempotencyId.valid()) + #line 31062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_6 = determineCommitStatus( trState, req.transaction.read_snapshot, req.transaction.read_snapshot + 5e6 , req.idempotencyId); + #line 6733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 31068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1Catch2cont3when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 6733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 31073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1Catch2cont4(loopDepth); + } return loopDepth; } @@ -28954,38 +31143,181 @@ class TryCommitActorState { fdb_probe_actor_exit("tryCommit", reinterpret_cast(this), 5); } - #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int a_body1Catch2cont4(int loopDepth) + { + loopDepth = a_body1Catch2cont2(loopDepth); + + return loopDepth; + } + int a_body1Catch2cont5(Optional const& commitResult,int loopDepth) + { + #line 6738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (commitResult.present()) + #line 31156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone ret = makeString(10); + #line 6740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + placeVersionstamp( mutateString(ret), commitResult.get().commitVersion, commitResult.get().batchIndex); + #line 6742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->versionstampPromise.send(ret); + #line 6743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "AutomaticIdempotencyCommitted"); + #line 6744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TryCommitActorState(); static_cast(this)->destroy(); return 0; } + #line 31168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~TryCommitActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 6746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "AutomaticIdempotencyNotCommitted"); + #line 6747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(transaction_too_old(), loopDepth); + #line 31180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + + return loopDepth; + } + int a_body1Catch2cont5(Optional && commitResult,int loopDepth) + { + #line 6738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (commitResult.present()) + #line 31189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 6739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone ret = makeString(10); + #line 6740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + placeVersionstamp( mutateString(ret), commitResult.get().commitVersion, commitResult.get().batchIndex); + #line 6742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->versionstampPromise.send(ret); + #line 6743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "AutomaticIdempotencyCommitted"); + #line 6744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TryCommitActorState(); static_cast(this)->destroy(); return 0; } + #line 31201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~TryCommitActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 6746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "AutomaticIdempotencyNotCommitted"); + #line 6747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(transaction_too_old(), loopDepth); + #line 31213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + + return loopDepth; + } + int a_body1Catch2cont3when1(Optional const& commitResult,int loopDepth) + { + loopDepth = a_body1Catch2cont5(commitResult, loopDepth); + + return loopDepth; + } + int a_body1Catch2cont3when1(Optional && commitResult,int loopDepth) + { + loopDepth = a_body1Catch2cont5(std::move(commitResult), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TryCommitActor, 6, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< TryCommitActor, 6, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("tryCommit", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1Catch2cont3when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryCommit", reinterpret_cast(this), 6); + + } + void a_callback_fire(ActorCallback< TryCommitActor, 6, Optional >*,Optional && value) + { + fdb_probe_actor_enter("tryCommit", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1Catch2cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryCommit", reinterpret_cast(this), 6); + + } + void a_callback_error(ActorCallback< TryCommitActor, 6, Optional >*,Error err) + { + fdb_probe_actor_enter("tryCommit", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryCommit", reinterpret_cast(this), 6); + + } + #line 6547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" CommitTransactionRequest req; - #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future readVersion; - #line 6157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceInterval interval; - #line 6158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double startTime; - #line 6159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 6160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional debugID; - #line 6177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TenantPrefixPrepended tenantPrefixPrepended; + #line 6559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future startFuture; + #line 6571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future> commitCostFuture; + #line 6581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key tenantPrefix; - #line 6192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional commitID; - #line 6201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future reply; - #line 6218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int alternativeChosen; + #line 6606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference proxiesUsed; + #line 6626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double grvTime; - #line 6273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Standalone> conflictingKRIndices; - #line 6276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::unordered_set mergedIds; - #line 28983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via tryCommit() - #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class TryCommitActor final : public Actor, public ActorCallback< TryCommitActor, 0, Void >, public ActorCallback< TryCommitActor, 1, Void >, public ActorCallback< TryCommitActor, 2, KeyRangeLocationInfo >, public ActorCallback< TryCommitActor, 3, Void >, public ActorCallback< TryCommitActor, 4, CommitID >, public ActorCallback< TryCommitActor, 5, Void >, public FastAllocated, public TryCommitActorState { - #line 28988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class TryCommitActor final : public Actor, public ActorCallback< TryCommitActor, 0, Void >, public ActorCallback< TryCommitActor, 1, Void >, public ActorCallback< TryCommitActor, 2, Void >, public ActorCallback< TryCommitActor, 3, Void >, public ActorCallback< TryCommitActor, 4, CommitID >, public ActorCallback< TryCommitActor, 5, Void >, public ActorCallback< TryCommitActor, 6, Optional >, public FastAllocated, public TryCommitActorState { + #line 31320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -28995,15 +31327,16 @@ class TryCommitActor final : public Actor, public ActorCallback< TryCommit #pragma clang diagnostic pop friend struct ActorCallback< TryCommitActor, 0, Void >; friend struct ActorCallback< TryCommitActor, 1, Void >; -friend struct ActorCallback< TryCommitActor, 2, KeyRangeLocationInfo >; +friend struct ActorCallback< TryCommitActor, 2, Void >; friend struct ActorCallback< TryCommitActor, 3, Void >; friend struct ActorCallback< TryCommitActor, 4, CommitID >; friend struct ActorCallback< TryCommitActor, 5, Void >; - #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TryCommitActor(Reference const& trState,CommitTransactionRequest const& req,Future const& readVersion) - #line 29004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +friend struct ActorCallback< TryCommitActor, 6, Optional >; + #line 6547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TryCommitActor(Reference const& trState,CommitTransactionRequest const& req) + #line 31337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - TryCommitActorState(trState, req, readVersion) + TryCommitActorState(trState, req) { fdb_probe_actor_enter("tryCommit", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -29021,22 +31354,23 @@ friend struct ActorCallback< TryCommitActor, 5, Void >; switch (wait_state) { case 1: this->a_callback_error((ActorCallback< TryCommitActor, 0, Void >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< TryCommitActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< TryCommitActor, 2, KeyRangeLocationInfo >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< TryCommitActor, 2, Void >*)0, actor_cancelled()); break; case 4: this->a_callback_error((ActorCallback< TryCommitActor, 3, Void >*)0, actor_cancelled()); break; case 5: this->a_callback_error((ActorCallback< TryCommitActor, 5, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< TryCommitActor, 6, Optional >*)0, actor_cancelled()); break; } } }; } - #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] static Future tryCommit( Reference const& trState, CommitTransactionRequest const& req, Future const& readVersion ) { - #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new TryCommitActor(trState, req, readVersion)); - #line 29036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 6547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] static Future tryCommit( Reference const& trState, CommitTransactionRequest const& req ) { + #line 6547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new TryCommitActor(trState, req)); + #line 31370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 6341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 6777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future Transaction::commitMutations() { try { @@ -29061,7 +31395,7 @@ Future Transaction::commitMutations() { size_t transactionSize = getSize(); if (transactionSize > (uint64_t)FLOW_KNOBS->PACKET_WARNING) { - TraceEvent(!g_network->isSimulated() ? SevWarnAlways : SevWarn, "LargeTransaction") + TraceEvent(SevWarn, "LargeTransaction") .suppressFor(1.0) .detail("Size", transactionSize) .detail("NumMutations", tr.transaction.mutations.size()) @@ -29080,11 +31414,6 @@ Future Transaction::commitMutations() { return transaction_too_large(); } - if (!readVersion.isValid()) - getReadVersion( - GetReadVersionRequest::FLAG_CAUSAL_READ_RISKY); // sets up readVersion field. We had no reads, so no - // need for (expensive) full causal consistency. - bool isCheckingWrites = trState->options.checkWritesEnabled && deterministicRandom()->random01() < 0.01; for (int i = 0; i < extraConflictRanges.size(); i++) if (extraConflictRanges[i].isReady() && @@ -29092,6 +31421,18 @@ Future Transaction::commitMutations() { tr.transaction.read_conflict_ranges.emplace_back( tr.arena, extraConflictRanges[i].get().first, extraConflictRanges[i].get().second); + if (tr.idempotencyId.valid()) { + // We need to be able confirm that this transaction is no longer in + // flight, and if the idempotency id is in the read and write + // conflict range we can use that. + BinaryWriter wr(Unversioned()); + wr.serializeBytes("\xFF/SC/"_sr); + wr.serializeBytes(tr.idempotencyId.asStringRefUnsafe()); + auto r = singleKeyRange(wr.toValue(), tr.arena); + tr.transaction.read_conflict_ranges.push_back(tr.arena, r); + tr.transaction.write_conflict_ranges.push_back(tr.arena, r); + } + if (!trState->options.causalWriteRisky && !intersects(tr.transaction.write_conflict_ranges, tr.transaction.read_conflict_ranges).present()) makeSelfConflicting(); @@ -29118,11 +31459,14 @@ Future Transaction::commitMutations() { if (trState->options.firstInBatch) { tr.flags = tr.flags | CommitTransactionRequest::FLAG_FIRST_IN_BATCH; } + if (trState->options.bypassStorageQuota) { + tr.flags = tr.flags | CommitTransactionRequest::FLAG_BYPASS_STORAGE_QUOTA; + } if (trState->options.reportConflictingKeys) { tr.transaction.report_conflicting_keys = true; } - Future commitResult = tryCommit(trState, tr, readVersion); + Future commitResult = tryCommit(trState, tr); if (isCheckingWrites) { Promise committed; @@ -29140,21 +31484,21 @@ Future Transaction::commitMutations() { } } - #line 29143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via commitAndWatch() - #line 6444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 6444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class CommitAndWatchActorState { - #line 29150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 6444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" CommitAndWatchActorState(Transaction* const& self) - #line 6444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 6444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : self(self) - #line 29157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("commitAndWatch", reinterpret_cast(this)); @@ -29168,16 +31512,16 @@ class CommitAndWatchActorState { { try { try { - #line 6446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = self->commitMutations(); - #line 6446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 29175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 6446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -29205,32 +31549,32 @@ class CommitAndWatchActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 6461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() != error_code_actor_cancelled) - #line 29210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!self->watches.empty()) - #line 29214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->cancelWatches(e); - #line 29218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->trState->versionstampPromise.sendError(transaction_invalid_version()); - #line 6468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!self->apiVersionAtLeast(700)) - #line 29224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->reset(); - #line 29228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 6473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 29233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -29242,27 +31586,27 @@ class CommitAndWatchActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 6448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->getDatabase()->transactionTracingSample = (self->getCommittedVersion() % 60000000) < (60000000 * FLOW_KNOBS->TRACING_SAMPLE_RATE); - #line 6451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!self->watches.empty()) - #line 29249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->setupWatches(); - #line 29253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!self->apiVersionAtLeast(700)) - #line 29257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->reset(); - #line 29261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitAndWatchActorState(); static_cast(this)->destroy(); return 0; } - #line 29265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CommitAndWatchActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -29272,27 +31616,27 @@ class CommitAndWatchActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 6448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->getDatabase()->transactionTracingSample = (self->getCommittedVersion() % 60000000) < (60000000 * FLOW_KNOBS->TRACING_SAMPLE_RATE); - #line 6451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!self->watches.empty()) - #line 29279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->setupWatches(); - #line 29283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!self->apiVersionAtLeast(700)) - #line 29287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->reset(); - #line 29291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitAndWatchActorState(); static_cast(this)->destroy(); return 0; } - #line 29295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CommitAndWatchActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -29363,14 +31707,14 @@ class CommitAndWatchActorState { fdb_probe_actor_exit("commitAndWatch", reinterpret_cast(this), 0); } - #line 6444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction* self; - #line 29368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via commitAndWatch() - #line 6444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class CommitAndWatchActor final : public Actor, public ActorCallback< CommitAndWatchActor, 0, Void >, public FastAllocated, public CommitAndWatchActorState { - #line 29373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -29379,9 +31723,9 @@ class CommitAndWatchActor final : public Actor, public ActorCallback< Comm void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< CommitAndWatchActor, 0, Void >; - #line 6444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" CommitAndWatchActor(Transaction* const& self) - #line 29384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), CommitAndWatchActorState(self) { @@ -29405,14 +31749,14 @@ friend struct ActorCallback< CommitAndWatchActor, 0, Void >; } }; } - #line 6444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future commitAndWatch( Transaction* const& self ) { - #line 6444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 6890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new CommitAndWatchActor(self)); - #line 29412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 31756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 6476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 6922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future Transaction::commit() { ASSERT(!committing.isValid()); @@ -29424,9 +31768,9 @@ void Transaction::setOption(FDBTransactionOptions::Option option, OptionalreadVersionFuture.isValid()) throw read_version_already_set(); - readVersion = Version(0); + trState->readVersionFuture = Version(0); trState->options.causalWriteRisky = true; break; @@ -29491,10 +31835,10 @@ void Transaction::setOption(FDBTransactionOptions::Option option, Optional(value.get().printable(), TransactionLogInfo::DONT_LOG); trState->trLogInfo->maxFieldLength = trState->options.maxTransactionLoggingFieldLength; } - if (trState->debugID.present()) { + if (trState->readOptions.present() && trState->readOptions.get().debugID.present()) { TraceEvent(SevInfo, "TransactionBeingTraced") .detail("DebugTransactionID", trState->trLogInfo->identifier) - .detail("ServerTraceID", trState->debugID.get()); + .detail("ServerTraceID", trState->readOptions.get().debugID.get()); } break; @@ -29526,10 +31870,11 @@ void Transaction::setOption(FDBTransactionOptions::Option option, OptionalrandomUniqueID()); - if (trState->trLogInfo && !trState->trLogInfo->identifier.empty()) { + if (trState->trLogInfo && !trState->trLogInfo->identifier.empty() && trState->readOptions.present() && + trState->readOptions.get().debugID.present()) { TraceEvent(SevInfo, "TransactionBeingTraced") .detail("DebugTransactionID", trState->trLogInfo->identifier) - .detail("ServerTraceID", trState->debugID.get()); + .detail("ServerTraceID", trState->readOptions.get().debugID.get()); } break; @@ -29545,12 +31890,20 @@ void Transaction::setOption(FDBTransactionOptions::Option option, OptionalreadOptions.present()) { + trState->readOptions = ReadOptions(); + } + trState->readOptions.get().lockAware = true; trState->options.lockAware = true; trState->options.readOnly = false; break; case FDBTransactionOptions::READ_LOCK_AWARE: validateOptionValueNotPresent(value); + if (!trState->readOptions.present()) { + trState->readOptions = ReadOptions(); + } + trState->readOptions.get().lockAware = true; if (!trState->options.lockAware) { trState->options.lockAware = true; trState->options.readOnly = true; @@ -29564,6 +31917,11 @@ void Transaction::setOption(FDBTransactionOptions::Option option, OptionalhasTenant()) { + Error e = invalid_option(); + TraceEvent(SevWarn, "TenantTransactionUseProvisionalProxies").error(e).detail("Tenant", trState->tenant()); + throw e; + } trState->options.getReadVersionFlags |= GetReadVersionRequest::FLAG_USE_PROVISIONAL_PROXIES; trState->useProvisionalProxies = UseProvisionalProxies::True; break; @@ -29586,10 +31944,11 @@ void Transaction::setOption(FDBTransactionOptions::Option option, Optional(value.get(), Unversioned())); + CODE_PROBE(true, "Adding link in FDBTransactionOptions::SPAN_PARENT"); + span.setParent(BinaryReader::fromStringRef(value.get(), IncludeVersion())); break; case FDBTransactionOptions::REPORT_CONFLICTING_KEYS: @@ -29604,6 +31963,9 @@ void Transaction::setOption(FDBTransactionOptions::Option option, Optionalcx->sharedStatePtr) { + throw invalid_option(); + } if (trState->numErrors == 0) { trState->options.useGrvCache = true; } @@ -29619,7 +31981,7 @@ void Transaction::setOption(FDBTransactionOptions::Option option, OptionalhasTenant()) { + if (trState->hasTenant(ResolveDefaultTenant::False)) { Error e = invalid_option(); TraceEvent(SevWarn, "TenantTransactionRawAccess").error(e).detail("Tenant", trState->tenant()); throw e; @@ -29627,40 +31989,93 @@ void Transaction::setOption(FDBTransactionOptions::Option option, Optionaloptions.rawAccess = true; break; + case FDBTransactionOptions::BYPASS_STORAGE_QUOTA: + trState->options.bypassStorageQuota = true; + break; + + case FDBTransactionOptions::AUTHORIZATION_TOKEN: + if (value.present()) + trState->authToken = WipedString(value.get()); + else + trState->authToken.reset(); + break; + case FDBTransactionOptions::IDEMPOTENCY_ID: + validateOptionValuePresent(value); + if (!(value.get().size() >= 16 && value.get().size() < 256)) { + Error e = invalid_option(); + TraceEvent(SevWarn, "IdempotencyIdInvalidSize") + .error(e) + .detail("IdempotencyId", value.get().printable()) + .detail("Recommendation", "Use an idempotency id that's at least 16 bytes and less than 256 bytes"); + throw e; + } + tr.idempotencyId = IdempotencyIdRef(tr.arena, IdempotencyIdRef(value.get())); + trState->automaticIdempotency = false; + break; + case FDBTransactionOptions::AUTOMATIC_IDEMPOTENCY: + validateOptionValueNotPresent(value); + if (!tr.idempotencyId.valid()) { + tr.idempotencyId = IdempotencyIdRef( + tr.arena, + IdempotencyIdRef(BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned()))); + } + trState->automaticIdempotency = true; + break; + + case FDBTransactionOptions::READ_SERVER_SIDE_CACHE_ENABLE: + trState->readOptions.withDefault(ReadOptions()).cacheResult = CacheResult::True; + break; + + case FDBTransactionOptions::READ_SERVER_SIDE_CACHE_DISABLE: + trState->readOptions.withDefault(ReadOptions()).cacheResult = CacheResult::False; + break; + + case FDBTransactionOptions::READ_PRIORITY_LOW: + trState->readOptions.withDefault(ReadOptions()).type = ReadType::LOW; + break; + + case FDBTransactionOptions::READ_PRIORITY_NORMAL: + trState->readOptions.withDefault(ReadOptions()).type = ReadType::NORMAL; + break; + + case FDBTransactionOptions::READ_PRIORITY_HIGH: + trState->readOptions.withDefault(ReadOptions()).type = ReadType::HIGH; + break; + default: break; } } - #line 29635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getConsistentReadVersion() - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetConsistentReadVersionActorState { - #line 29642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetConsistentReadVersionActorState(SpanID const& parentSpan,DatabaseContext* const& cx,uint32_t const& transactionCount,TransactionPriority const& priority,uint32_t const& flags,TransactionTagMap const& tags,Optional const& debugID) - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetConsistentReadVersionActorState(SpanContext const& parentSpan,DatabaseContext* const& cx,uint32_t const& transactionCount,TransactionPriority const& priority,uint32_t const& flags,TransactionTagMap const& tags,Optional const& debugID) + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : parentSpan(parentSpan), - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx(cx), - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" transactionCount(transactionCount), - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" priority(priority), - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" flags(flags), - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tags(tags), - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" debugID(debugID), - #line 6702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" span("NAPI:getConsistentReadVersion"_loc, parentSpan) - #line 29663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getConsistentReadVersion", reinterpret_cast(this)); @@ -29673,19 +32088,19 @@ class GetConsistentReadVersionActorState { int a_body1(int loopDepth=0) { try { - #line 6704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++cx->transactionReadVersionBatches; - #line 6705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (debugID.present()) - #line 29680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent("TransactionDebug", debugID.get().first(), "NativeAPI.getConsistentReadVersion.Before"); - #line 29684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 29688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -29714,26 +32129,26 @@ class GetConsistentReadVersionActorState { int a_body1loopBody1(int loopDepth) { try { - #line 6709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req = GetReadVersionRequest(span.context, transactionCount, priority, cx->ssVersionVectorCache.getMaxVersion(), flags, tags, debugID); - #line 6716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" onProxiesChanged = cx->onProxiesChanged(); - #line 6719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = onProxiesChanged; - #line 6718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 29725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 6722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = basicLoadBalance(cx->getGrvProxies(UseProvisionalProxies( flags & GetReadVersionRequest::FLAG_USE_PROVISIONAL_PROXIES)), &GrvProxyInterface::getConsistentReadVersion, req, cx->taskID); - #line 29729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 6719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -29753,35 +32168,54 @@ class GetConsistentReadVersionActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 6761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() != error_code_broken_promise && e.code() != error_code_batch_transaction_throttled && e.code() != error_code_proxy_memory_limit_exceeded) - #line 29758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() != error_code_broken_promise && e.code() != error_code_batch_transaction_throttled && e.code() != error_code_grv_proxy_memory_limit_exceeded && e.code() != error_code_proxy_tag_throttled) + #line 32173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevError, "GetConsistentReadVersionError").error(e); - #line 29762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if ((e.code() == error_code_batch_transaction_throttled || e.code() == error_code_proxy_memory_limit_exceeded) && !cx->apiVersionAtLeast(630)) - #line 29766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_batch_transaction_throttled && !cx->apiVersionAtLeast(630)) + #line 32181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = delayJittered(5.0); - #line 6767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 29772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 6767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 29777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - #line 6769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 29784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_grv_proxy_memory_limit_exceeded) + #line 32199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 7288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = delayJittered(CLIENT_KNOBS->GRV_ERROR_RETRY_DELAY); + #line 7288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 32205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when2(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 7288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 32210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 7290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 32217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } } } catch (Error& error) { @@ -29800,93 +32234,95 @@ class GetConsistentReadVersionActorState { } int a_body1loopBody1when1(Void const& _,int loopDepth) { - #line 6720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" onProxiesChanged = cx->onProxiesChanged(); - #line 29805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } int a_body1loopBody1when1(Void && _,int loopDepth) { - #line 6720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" onProxiesChanged = cx->onProxiesChanged(); - #line 29814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } int a_body1loopBody1when2(GetReadVersionReply const& v,int loopDepth) { - #line 6728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(v.proxyTagThrottledDuration > 0.0, "getConsistentReadVersion received GetReadVersionReply delayed by proxy tag throttling"); + #line 7247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (tags.size() != 0) - #line 29823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto& priorityThrottledTags = cx->throttledTags[priority]; - #line 6730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& tag : tags ) { - #line 6731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto itr = v.tagThrottleInfo.find(tag.first); - #line 6732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (itr == v.tagThrottleInfo.end()) - #line 29833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 6734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Removing client throttle"); + #line 7253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" priorityThrottledTags.erase(tag.first); - #line 29839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 6736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 6737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Setting client throttle"); + #line 7256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto result = priorityThrottledTags.try_emplace(tag.first, itr->second); - #line 6738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!result.second) - #line 29849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" result.first->second.update(itr->second); - #line 29853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } } } - #line 6745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (debugID.present()) - #line 29860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent( "TransactionDebug", debugID.get().first(), "NativeAPI.getConsistentReadVersion.After"); - #line 29864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(v.version > 0); - #line 6749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->minAcceptableReadVersion = std::min(cx->minAcceptableReadVersion, v.version); - #line 6750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (cx->versionVectorCacheActive(v.ssVersionVectorDelta)) - #line 29872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (cx->isCurrentGrvProxy(v.proxyId)) - #line 29876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->ssVersionVectorCache.applyDelta(v.ssVersionVectorDelta); - #line 29880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { return a_body1loopHead1(loopDepth); // continue } } - #line 6757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(v); this->~GetConsistentReadVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 29889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< GetReadVersionReply >::value()) GetReadVersionReply(v); this->~GetConsistentReadVersionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -29896,75 +32332,77 @@ class GetConsistentReadVersionActorState { } int a_body1loopBody1when2(GetReadVersionReply && v,int loopDepth) { - #line 6728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(v.proxyTagThrottledDuration > 0.0, "getConsistentReadVersion received GetReadVersionReply delayed by proxy tag throttling"); + #line 7247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (tags.size() != 0) - #line 29901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto& priorityThrottledTags = cx->throttledTags[priority]; - #line 6730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& tag : tags ) { - #line 6731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto itr = v.tagThrottleInfo.find(tag.first); - #line 6732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (itr == v.tagThrottleInfo.end()) - #line 29911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 6734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Removing client throttle"); + #line 7253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" priorityThrottledTags.erase(tag.first); - #line 29917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 6736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 6737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Setting client throttle"); + #line 7256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto result = priorityThrottledTags.try_emplace(tag.first, itr->second); - #line 6738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!result.second) - #line 29927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" result.first->second.update(itr->second); - #line 29931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } } } - #line 6745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (debugID.present()) - #line 29938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addEvent( "TransactionDebug", debugID.get().first(), "NativeAPI.getConsistentReadVersion.After"); - #line 29942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(v.version > 0); - #line 6749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->minAcceptableReadVersion = std::min(cx->minAcceptableReadVersion, v.version); - #line 6750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (cx->versionVectorCacheActive(v.ssVersionVectorDelta)) - #line 29950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (cx->isCurrentGrvProxy(v.proxyId)) - #line 29954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" cx->ssVersionVectorCache.applyDelta(v.ssVersionVectorDelta); - #line 29958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { return a_body1loopHead1(loopDepth); // continue } } - #line 6757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(v); this->~GetConsistentReadVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 29967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< GetReadVersionReply >::value()) GetReadVersionReply(v); this->~GetConsistentReadVersionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -30163,32 +32601,113 @@ class GetConsistentReadVersionActorState { fdb_probe_actor_exit("getConsistentReadVersion", reinterpret_cast(this), 2); } - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SpanID parentSpan; - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int a_body1loopBody1Catch1cont4(int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont5(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont4(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont5(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont4(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when2(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont5(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when2(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont5(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetConsistentReadVersionActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetConsistentReadVersionActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("getConsistentReadVersion", reinterpret_cast(this), 3); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getConsistentReadVersion", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< GetConsistentReadVersionActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("getConsistentReadVersion", reinterpret_cast(this), 3); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getConsistentReadVersion", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< GetConsistentReadVersionActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("getConsistentReadVersion", reinterpret_cast(this), 3); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getConsistentReadVersion", reinterpret_cast(this), 3); + + } + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SpanContext parentSpan; + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseContext* cx; - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" uint32_t transactionCount; - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TransactionPriority priority; - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" uint32_t flags; - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TransactionTagMap tags; - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional debugID; - #line 6702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 6709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetReadVersionRequest req; - #line 6716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future onProxiesChanged; - #line 30186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getConsistentReadVersion() - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetConsistentReadVersionActor final : public Actor, public ActorCallback< GetConsistentReadVersionActor, 0, Void >, public ActorCallback< GetConsistentReadVersionActor, 1, GetReadVersionReply >, public ActorCallback< GetConsistentReadVersionActor, 2, Void >, public FastAllocated, public GetConsistentReadVersionActorState { - #line 30191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetConsistentReadVersionActor final : public Actor, public ActorCallback< GetConsistentReadVersionActor, 0, Void >, public ActorCallback< GetConsistentReadVersionActor, 1, GetReadVersionReply >, public ActorCallback< GetConsistentReadVersionActor, 2, Void >, public ActorCallback< GetConsistentReadVersionActor, 3, Void >, public FastAllocated, public GetConsistentReadVersionActorState { + #line 32710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -30199,9 +32718,10 @@ class GetConsistentReadVersionActor final : public Actor, p friend struct ActorCallback< GetConsistentReadVersionActor, 0, Void >; friend struct ActorCallback< GetConsistentReadVersionActor, 1, GetReadVersionReply >; friend struct ActorCallback< GetConsistentReadVersionActor, 2, Void >; - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetConsistentReadVersionActor(SpanID const& parentSpan,DatabaseContext* const& cx,uint32_t const& transactionCount,TransactionPriority const& priority,uint32_t const& flags,TransactionTagMap const& tags,Optional const& debugID) - #line 30204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +friend struct ActorCallback< GetConsistentReadVersionActor, 3, Void >; + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetConsistentReadVersionActor(SpanContext const& parentSpan,DatabaseContext* const& cx,uint32_t const& transactionCount,TransactionPriority const& priority,uint32_t const& flags,TransactionTagMap const& tags,Optional const& debugID) + #line 32724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), GetConsistentReadVersionActorState(parentSpan, cx, transactionCount, priority, flags, tags, debugID) { @@ -30221,71 +32741,70 @@ friend struct ActorCallback< GetConsistentReadVersionActor, 2, Void >; switch (wait_state) { case 1: this->a_callback_error((ActorCallback< GetConsistentReadVersionActor, 0, Void >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< GetConsistentReadVersionActor, 2, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetConsistentReadVersionActor, 3, Void >*)0, actor_cancelled()); break; } } }; } - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future getConsistentReadVersion( SpanID const& parentSpan, DatabaseContext* const& cx, uint32_t const& transactionCount, TransactionPriority const& priority, uint32_t const& flags, TransactionTagMap const& tags, Optional const& debugID ) { - #line 6695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getConsistentReadVersion( SpanContext const& parentSpan, DatabaseContext* const& cx, uint32_t const& transactionCount, TransactionPriority const& priority, uint32_t const& flags, TransactionTagMap const& tags, Optional const& debugID ) { + #line 7212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new GetConsistentReadVersionActor(parentSpan, cx, transactionCount, priority, flags, tags, debugID)); - #line 30233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 6774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 7295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 30238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via readVersionBatcher() - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class ReadVersionBatcherActorState { - #line 30245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ReadVersionBatcherActorState(DatabaseContext* const& cx,FutureStream const& versionStream,TransactionPriority const& priority,uint32_t const& flags) - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" versionStream(versionStream), - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" priority(priority), - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" flags(flags), - #line 6779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" requests(), - #line 6780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" addActor(), - #line 6781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" collection(actorCollection(addActor.getFuture())), - #line 6782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" timeout(), - #line 6783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" debugID(), - #line 6784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" send_batch(), - #line 6785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - batchSizeDist(Histogram::getHistogram(LiteralStringRef("GrvBatcher"), LiteralStringRef("ClientGrvBatchSize"), Histogram::Unit::countLinear, 0, CLIENT_KNOBS->MAX_BATCH_SIZE * 2)), - #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - batchIntervalDist(Histogram::getHistogram(LiteralStringRef("GrvBatcher"), LiteralStringRef("ClientGrvBatchInterval"), Histogram::Unit::microseconds, 0, CLIENT_KNOBS->GRV_BATCH_TIMEOUT * 1000000 * 2)), - #line 6796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - grvReplyLatencyDist(Histogram::getHistogram( LiteralStringRef("GrvBatcher"), LiteralStringRef("ClientGrvReplyLatency"), Histogram::Unit::microseconds)), - #line 6798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + batchSizeDist(Histogram::getHistogram( "GrvBatcher"_sr, "ClientGrvBatchSize"_sr, Histogram::Unit::countLinear, 0, CLIENT_KNOBS->MAX_BATCH_SIZE * 2)), + #line 7308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + batchIntervalDist(Histogram::getHistogram("GrvBatcher"_sr, "ClientGrvBatchInterval"_sr, Histogram::Unit::milliseconds, 0, CLIENT_KNOBS->GRV_BATCH_TIMEOUT * 1000000 * 2)), + #line 7314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + grvReplyLatencyDist(Histogram::getHistogram("GrvBatcher"_sr, "ClientGrvReplyLatency"_sr, Histogram::Unit::milliseconds)), + #line 7316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" lastRequestTime(now()), - #line 6800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tags(), - #line 6803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" replyTimes(), - #line 6804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - _errorStream(), - #line 6805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" batchTime(0), - #line 6806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" span("NAPI:readVersionBatcher"_loc) - #line 30288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("readVersionBatcher", reinterpret_cast(this)); @@ -30298,9 +32817,9 @@ class ReadVersionBatcherActorState { int a_body1(int loopDepth=0) { try { - #line 6807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 30303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -30328,79 +32847,79 @@ class ReadVersionBatcherActorState { } int a_body1loopBody1(int loopDepth) { - #line 6808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" send_batch = false; - #line 6810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" FutureStream __when_expr_0 = versionStream; - #line 6809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 30337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.pop(), loopDepth); }; - #line 6830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = timeout.isValid() ? timeout : Never(); - #line 30341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; - #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" FutureStream __when_expr_2 = replyTimes.getFuture(); - #line 30345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when3(__when_expr_2.pop(), loopDepth); }; - #line 6840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = collection; - #line 30349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when4(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 6810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 30360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(int loopDepth) { - #line 6842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (send_batch) - #line 30369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int count = requests.size(); - #line 6844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ASSERT(count); - #line 6846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" batchSizeDist->sampleRecordCounter(count); - #line 6847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto requestTime = now(); - #line 6848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" batchIntervalDist->sampleSeconds(requestTime - lastRequestTime); - #line 6849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" lastRequestTime = requestTime; - #line 6852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Promise GRVReply; - #line 6853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" requests.push_back(GRVReply); - #line 6854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" addActor.send(ready(timeReply(GRVReply.getFuture(), replyTimes))); - #line 6856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future batch = incrementalBroadcastWithError( getConsistentReadVersion(span.context, cx, count, priority, flags, std::move(tags), std::move(debugID)), std::move(requests), CLIENT_KNOBS->BROADCAST_BATCH_SIZE); - #line 6861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" span = Span("NAPI:readVersionBatcher"_loc); - #line 6862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tags.clear(); - #line 6863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" debugID = Optional(); - #line 6864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" requests.clear(); - #line 6865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" addActor.send(batch); - #line 6866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" timeout = Future(); - #line 30403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } if (loopDepth == 0) return a_body1loopHead1(0); @@ -30408,51 +32927,51 @@ class ReadVersionBatcherActorState { } int a_body1loopBody1when1(DatabaseContext::VersionRequest const& req,int loopDepth) { - #line 6811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (req.debugID.present()) - #line 30413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!debugID.present()) - #line 30417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" debugID = nondeterministicRandom()->randomUniqueID(); - #line 30421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addAttach("TransactionAttachID", req.debugID.get().first(), debugID.get().first()); - #line 30425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span.addParent(req.spanContext); - #line 6818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span.addLink(req.spanContext); + #line 7335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" requests.push_back(req.reply); - #line 6819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto tag : req.tags ) { - #line 6820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++tags[tag]; - #line 30435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (requests.size() == CLIENT_KNOBS->MAX_BATCH_SIZE) - #line 30439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" send_batch = true; - #line 6825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++cx->transactionGrvFullBatches; - #line 30445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 6826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!timeout.isValid()) - #line 30451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" timeout = delay(batchTime, TaskPriority::GetConsistentReadVersion); - #line 30455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } loopDepth = a_body1loopBody1cont1(loopDepth); @@ -30461,51 +32980,51 @@ class ReadVersionBatcherActorState { } int a_body1loopBody1when1(DatabaseContext::VersionRequest && req,int loopDepth) { - #line 6811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (req.debugID.present()) - #line 30466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!debugID.present()) - #line 30470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" debugID = nondeterministicRandom()->randomUniqueID(); - #line 30474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" g_traceBatch.addAttach("TransactionAttachID", req.debugID.get().first(), debugID.get().first()); - #line 30478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 32997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span.addParent(req.spanContext); - #line 6818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span.addLink(req.spanContext); + #line 7335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" requests.push_back(req.reply); - #line 6819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto tag : req.tags ) { - #line 6820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++tags[tag]; - #line 30488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (requests.size() == CLIENT_KNOBS->MAX_BATCH_SIZE) - #line 30492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" send_batch = true; - #line 6825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++cx->transactionGrvFullBatches; - #line 30498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 6826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!timeout.isValid()) - #line 30504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" timeout = delay(batchTime, TaskPriority::GetConsistentReadVersion); - #line 30508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } loopDepth = a_body1loopBody1cont1(loopDepth); @@ -30514,48 +33033,48 @@ class ReadVersionBatcherActorState { } int a_body1loopBody1when2(Void const& _,int loopDepth) { - #line 6831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" send_batch = true; - #line 6832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++cx->transactionGrvTimedOutBatches; - #line 30521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1when2(Void && _,int loopDepth) { - #line 6831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" send_batch = true; - #line 6832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++cx->transactionGrvTimedOutBatches; - #line 30532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1when3(double const& reply_latency,int loopDepth) { - #line 6836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double target_latency = reply_latency * 0.5; - #line 6837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" batchTime = std::min(0.1 * target_latency + 0.9 * batchTime, CLIENT_KNOBS->GRV_BATCH_TIMEOUT); - #line 6838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" grvReplyLatencyDist->sampleSeconds(reply_latency); - #line 30545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1when3(double && reply_latency,int loopDepth) { - #line 6836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double target_latency = reply_latency * 0.5; - #line 6837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" batchTime = std::min(0.1 * target_latency + 0.9 * batchTime, CLIENT_KNOBS->GRV_BATCH_TIMEOUT); - #line 6838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" grvReplyLatencyDist->sampleSeconds(reply_latency); - #line 30558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -30761,50 +33280,48 @@ class ReadVersionBatcherActorState { fdb_probe_actor_exit("readVersionBatcher", reinterpret_cast(this), 3); } - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" DatabaseContext* cx; - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" FutureStream versionStream; - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TransactionPriority priority; - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" uint32_t flags; - #line 6779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector> requests; - #line 6780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" PromiseStream> addActor; - #line 6781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future collection; - #line 6782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future timeout; - #line 6783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional debugID; - #line 6784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool send_batch; - #line 6785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference batchSizeDist; - #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference batchIntervalDist; - #line 6796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference grvReplyLatencyDist; - #line 6798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double lastRequestTime; - #line 6800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TransactionTagMap tags; - #line 6803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" PromiseStream replyTimes; - #line 6804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - PromiseStream _errorStream; - #line 6805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double batchTime; - #line 6806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 30802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via readVersionBatcher() - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class ReadVersionBatcherActor final : public Actor, public ActorSingleCallback< ReadVersionBatcherActor, 0, DatabaseContext::VersionRequest >, public ActorCallback< ReadVersionBatcherActor, 1, Void >, public ActorSingleCallback< ReadVersionBatcherActor, 2, double >, public ActorCallback< ReadVersionBatcherActor, 3, Void >, public FastAllocated, public ReadVersionBatcherActorState { - #line 30807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -30816,9 +33333,9 @@ friend struct ActorSingleCallback< ReadVersionBatcherActor, 0, DatabaseContext:: friend struct ActorCallback< ReadVersionBatcherActor, 1, Void >; friend struct ActorSingleCallback< ReadVersionBatcherActor, 2, double >; friend struct ActorCallback< ReadVersionBatcherActor, 3, Void >; - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ReadVersionBatcherActor(DatabaseContext* const& cx,FutureStream const& versionStream,TransactionPriority const& priority,uint32_t const& flags) - #line 30821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), ReadVersionBatcherActorState(cx, versionStream, priority, flags) { @@ -30842,40 +33359,40 @@ friend struct ActorCallback< ReadVersionBatcherActor, 3, Void >; } }; } - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future readVersionBatcher( DatabaseContext* const& cx, FutureStream const& versionStream, TransactionPriority const& priority, uint32_t const& flags ) { - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new ReadVersionBatcherActor(cx, versionStream, priority, flags)); - #line 30849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 6870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 7387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 30854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via extractReadVersion() - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class ExtractReadVersionActorState { - #line 30861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ExtractReadVersionActorState(Reference const& trState,Location const& location,SpanID const& spanContext,Future const& f,Promise> const& metadataVersion) - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ExtractReadVersionActorState(Reference const& trState,Location const& location,SpanContext const& spanContext,Future const& f,Promise> const& metadataVersion) + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" location(location), - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" spanContext(spanContext), - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" f(f), - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" metadataVersion(metadataVersion), - #line 6876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span(spanContext, location, { trState->spanID }) - #line 30878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span(spanContext, location, trState->spanContext) + #line 33395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("extractReadVersion", reinterpret_cast(this)); @@ -30888,16 +33405,16 @@ class ExtractReadVersionActorState { int a_body1(int loopDepth=0) { try { - #line 6877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = f; - #line 6877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 30895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 6877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 30900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -30918,139 +33435,141 @@ class ExtractReadVersionActorState { } int a_body1cont1(GetReadVersionReply const& rep,int loopDepth) { - #line 6878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double replyTime = now(); - #line 6879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double latency = replyTime - trState->startTime; - #line 6880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->lastProxyRequestTime = trState->startTime; - #line 6881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->updateCachedReadVersion(trState->startTime, rep.version); - #line 6882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->proxyTagThrottledDuration += rep.proxyTagThrottledDuration; + #line 7400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (rep.rkBatchThrottled) - #line 30931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->lastRkBatchThrottleTime = replyTime; - #line 30935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (rep.rkDefaultThrottled) - #line 30939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->lastRkDefaultThrottleTime = replyTime; - #line 30943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->GRVLatencies.addSample(latency); - #line 6889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (trState->trLogInfo) - #line 30949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->trLogInfo->addLog(FdbClientLogEvents::EventGetVersion_V3(trState->startTime, trState->cx->clientLocality.dcId(), latency, trState->options.priority, rep.version, trState->tenant())); - #line 30953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->trLogInfo->addLog(FdbClientLogEvents::EventGetVersion_V3(trState->startTime, trState->cx->clientLocality.dcId(), latency, trState->options.priority, rep.version, trState->tenant().flatMapRef(&Tenant::name))); + #line 33472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (rep.locked && !trState->options.lockAware) - #line 30957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(database_locked(), loopDepth); - #line 30961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionReadVersionsCompleted; - #line 6900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" switch (trState->options.priority) { case TransactionPriority::IMMEDIATE: ++trState->cx->transactionImmediateReadVersionsCompleted; break; case TransactionPriority::DEFAULT: ++trState->cx->transactionDefaultReadVersionsCompleted; break; case TransactionPriority::BATCH: ++trState->cx->transactionBatchReadVersionsCompleted; break; default: ASSERT(false); }; - #line 6914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (trState->options.tags.size() != 0) - #line 30969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto& priorityThrottledTags = trState->cx->throttledTags[trState->options.priority]; - #line 6916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& tag : trState->options.tags ) { - #line 6917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto itr = priorityThrottledTags.find(tag); - #line 6918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (itr != priorityThrottledTags.end()) - #line 30979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (itr->second.expired()) - #line 30983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" priorityThrottledTags.erase(itr); - #line 30987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 6921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (itr->second.throttleDuration() > 0) - #line 30993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 6923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "throttling transaction after getting read version"); + #line 7441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionReadVersionsThrottled; - #line 6924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(tag_throttled(), loopDepth); - #line 31001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } } } - #line 6929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& tag : trState->options.tags ) { - #line 6930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto itr = priorityThrottledTags.find(tag); - #line 6931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (itr != priorityThrottledTags.end()) - #line 31012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" itr->second.addReleased(1); - #line 31016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } } - #line 6937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (rep.version > trState->cx->metadataVersionCache[trState->cx->mvCacheInsertLocation].first) - #line 31022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->mvCacheInsertLocation = (trState->cx->mvCacheInsertLocation + 1) % trState->cx->metadataVersionCache.size(); - #line 6940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->metadataVersionCache[trState->cx->mvCacheInsertLocation] = std::make_pair(rep.version, rep.metadataVersion); - #line 31028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" metadataVersion.send(rep.metadataVersion); - #line 6945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (trState->cx->versionVectorCacheActive(rep.ssVersionVectorDelta)) - #line 31034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (trState->cx->isCurrentGrvProxy(rep.proxyId)) - #line 31038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->ssVersionVectorCache.applyDelta(rep.ssVersionVectorDelta); - #line 31042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 6949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->ssVersionVectorCache.clear(); - #line 31048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 6952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(rep.version); this->~ExtractReadVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 31053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Version >::value()) Version(rep.version); this->~ExtractReadVersionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -31060,139 +33579,141 @@ class ExtractReadVersionActorState { } int a_body1cont1(GetReadVersionReply && rep,int loopDepth) { - #line 6878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double replyTime = now(); - #line 6879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double latency = replyTime - trState->startTime; - #line 6880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->lastProxyRequestTime = trState->startTime; - #line 6881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->updateCachedReadVersion(trState->startTime, rep.version); - #line 6882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->proxyTagThrottledDuration += rep.proxyTagThrottledDuration; + #line 7400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (rep.rkBatchThrottled) - #line 31073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->lastRkBatchThrottleTime = replyTime; - #line 31077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (rep.rkDefaultThrottled) - #line 31081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->lastRkDefaultThrottleTime = replyTime; - #line 31085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->GRVLatencies.addSample(latency); - #line 6889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (trState->trLogInfo) - #line 31091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->trLogInfo->addLog(FdbClientLogEvents::EventGetVersion_V3(trState->startTime, trState->cx->clientLocality.dcId(), latency, trState->options.priority, rep.version, trState->tenant())); - #line 31095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->trLogInfo->addLog(FdbClientLogEvents::EventGetVersion_V3(trState->startTime, trState->cx->clientLocality.dcId(), latency, trState->options.priority, rep.version, trState->tenant().flatMapRef(&Tenant::name))); + #line 33616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (rep.locked && !trState->options.lockAware) - #line 31099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(database_locked(), loopDepth); - #line 31103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionReadVersionsCompleted; - #line 6900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" switch (trState->options.priority) { case TransactionPriority::IMMEDIATE: ++trState->cx->transactionImmediateReadVersionsCompleted; break; case TransactionPriority::DEFAULT: ++trState->cx->transactionDefaultReadVersionsCompleted; break; case TransactionPriority::BATCH: ++trState->cx->transactionBatchReadVersionsCompleted; break; default: ASSERT(false); }; - #line 6914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (trState->options.tags.size() != 0) - #line 31111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto& priorityThrottledTags = trState->cx->throttledTags[trState->options.priority]; - #line 6916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& tag : trState->options.tags ) { - #line 6917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto itr = priorityThrottledTags.find(tag); - #line 6918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (itr != priorityThrottledTags.end()) - #line 31121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (itr->second.expired()) - #line 31125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" priorityThrottledTags.erase(itr); - #line 31129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 6921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (itr->second.throttleDuration() > 0) - #line 31135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 6923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "throttling transaction after getting read version"); + #line 7441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ++trState->cx->transactionReadVersionsThrottled; - #line 6924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(tag_throttled(), loopDepth); - #line 31143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } } } - #line 6929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& tag : trState->options.tags ) { - #line 6930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" auto itr = priorityThrottledTags.find(tag); - #line 6931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (itr != priorityThrottledTags.end()) - #line 31154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" itr->second.addReleased(1); - #line 31158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } } - #line 6937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (rep.version > trState->cx->metadataVersionCache[trState->cx->mvCacheInsertLocation].first) - #line 31164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->mvCacheInsertLocation = (trState->cx->mvCacheInsertLocation + 1) % trState->cx->metadataVersionCache.size(); - #line 6940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->metadataVersionCache[trState->cx->mvCacheInsertLocation] = std::make_pair(rep.version, rep.metadataVersion); - #line 31170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 6944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" metadataVersion.send(rep.metadataVersion); - #line 6945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (trState->cx->versionVectorCacheActive(rep.ssVersionVectorDelta)) - #line 31176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (trState->cx->isCurrentGrvProxy(rep.proxyId)) - #line 31180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 6947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->ssVersionVectorCache.applyDelta(rep.ssVersionVectorDelta); - #line 31184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } else { - #line 6949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" trState->cx->ssVersionVectorCache.clear(); - #line 31190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 6952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(rep.version); this->~ExtractReadVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 31195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Version >::value()) Version(rep.version); this->~ExtractReadVersionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -31263,24 +33784,24 @@ class ExtractReadVersionActorState { fdb_probe_actor_exit("extractReadVersion", reinterpret_cast(this), 0); } - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Location location; - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SpanID spanContext; - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SpanContext spanContext; + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future f; - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Promise> metadataVersion; - #line 6876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 31278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via extractReadVersion() - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class ExtractReadVersionActor final : public Actor, public ActorCallback< ExtractReadVersionActor, 0, GetReadVersionReply >, public FastAllocated, public ExtractReadVersionActorState { - #line 31283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -31289,9 +33810,9 @@ class ExtractReadVersionActor final : public Actor, public ActorCallbac void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ExtractReadVersionActor, 0, GetReadVersionReply >; - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ExtractReadVersionActor(Reference const& trState,Location const& location,SpanID const& spanContext,Future const& f,Promise> const& metadataVersion) - #line 31294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ExtractReadVersionActor(Reference const& trState,Location const& location,SpanContext const& spanContext,Future const& f,Promise> const& metadataVersion) + #line 33815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), ExtractReadVersionActorState(trState, location, spanContext, f, metadataVersion) { @@ -31315,14 +33836,14 @@ friend struct ActorCallback< ExtractReadVersionActor, 0, GetReadVersionReply >; } }; } - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future extractReadVersion( Reference const& trState, Location const& location, SpanID const& spanContext, Future const& f, Promise> const& metadataVersion ) { - #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future extractReadVersion( Reference const& trState, Location const& location, SpanContext const& spanContext, Future const& f, Promise> const& metadataVersion ) { + #line 7388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new ExtractReadVersionActor(trState, location, spanContext, f, metadataVersion)); - #line 31322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 6954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 7472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool rkThrottlingCooledDown(DatabaseContext* cx, TransactionPriority priority) { if (priority == TransactionPriority::IMMEDIATE) { @@ -31341,102 +33862,103 @@ bool rkThrottlingCooledDown(DatabaseContext* cx, TransactionPriority priority) { return false; } -Future Transaction::getReadVersion(uint32_t flags) { - if (!readVersion.isValid()) { - if (!CLIENT_KNOBS->FORCE_GRV_CACHE_OFF && !trState->options.skipGrvCache && - (deterministicRandom()->random01() <= CLIENT_KNOBS->DEBUG_USE_GRV_CACHE_CHANCE || - trState->options.useGrvCache) && - rkThrottlingCooledDown(getDatabase().getPtr(), trState->options.priority)) { - // Upon our first request to use cached RVs, start the background updater - if (!trState->cx->grvUpdateHandler.isValid()) { - trState->cx->grvUpdateHandler = backgroundGrvUpdater(getDatabase().getPtr()); - } - Version rv = trState->cx->getCachedReadVersion(); - double lastTime = trState->cx->getLastGrvTime(); - double requestTime = now(); - if (requestTime - lastTime <= CLIENT_KNOBS->MAX_VERSION_CACHE_LAG && rv != Version(0)) { - ASSERT(!debug_checkVersionTime(rv, requestTime, "CheckStaleness")); - readVersion = rv; - return readVersion; - } // else go through regular GRV path - } - ++trState->cx->transactionReadVersions; - flags |= trState->options.getReadVersionFlags; - switch (trState->options.priority) { - case TransactionPriority::IMMEDIATE: - flags |= GetReadVersionRequest::PRIORITY_SYSTEM_IMMEDIATE; - ++trState->cx->transactionImmediateReadVersions; - break; - case TransactionPriority::DEFAULT: - flags |= GetReadVersionRequest::PRIORITY_DEFAULT; - ++trState->cx->transactionDefaultReadVersions; - break; - case TransactionPriority::BATCH: - flags |= GetReadVersionRequest::PRIORITY_BATCH; - ++trState->cx->transactionBatchReadVersions; - break; - default: - ASSERT(false); - } +Future TransactionState::getReadVersion(uint32_t flags) { + ASSERT(!readVersionFuture.isValid()); + + if (!CLIENT_KNOBS->FORCE_GRV_CACHE_OFF && !options.skipGrvCache && + (deterministicRandom()->random01() <= CLIENT_KNOBS->DEBUG_USE_GRV_CACHE_CHANCE || options.useGrvCache) && + rkThrottlingCooledDown(cx.getPtr(), options.priority)) { + // Upon our first request to use cached RVs, start the background updater + if (!cx->grvUpdateHandler.isValid()) { + cx->grvUpdateHandler = backgroundGrvUpdater(cx.getPtr()); + } + Version rv = cx->getCachedReadVersion(); + double lastTime = cx->getLastGrvTime(); + double requestTime = now(); + if (requestTime - lastTime <= CLIENT_KNOBS->MAX_VERSION_CACHE_LAG && rv != Version(0)) { + ASSERT(!debug_checkVersionTime(rv, requestTime, "CheckStaleness")); + return rv; + } // else go through regular GRV path + } + ++cx->transactionReadVersions; + flags |= options.getReadVersionFlags; + switch (options.priority) { + case TransactionPriority::IMMEDIATE: + flags |= GetReadVersionRequest::PRIORITY_SYSTEM_IMMEDIATE; + ++cx->transactionImmediateReadVersions; + break; + case TransactionPriority::DEFAULT: + flags |= GetReadVersionRequest::PRIORITY_DEFAULT; + ++cx->transactionDefaultReadVersions; + break; + case TransactionPriority::BATCH: + flags |= GetReadVersionRequest::PRIORITY_BATCH; + ++cx->transactionBatchReadVersions; + break; + default: + ASSERT(false); + } - if (trState->options.tags.size() != 0) { - double maxThrottleDelay = 0.0; - bool canRecheck = false; + if (options.tags.size() != 0) { + double maxThrottleDelay = 0.0; + bool canRecheck = false; - auto& priorityThrottledTags = trState->cx->throttledTags[trState->options.priority]; - for (auto& tag : trState->options.tags) { - auto itr = priorityThrottledTags.find(tag); - if (itr != priorityThrottledTags.end()) { - if (!itr->second.expired()) { - maxThrottleDelay = std::max(maxThrottleDelay, itr->second.throttleDuration()); - canRecheck = itr->second.canRecheck(); - } else { - priorityThrottledTags.erase(itr); - } + auto& priorityThrottledTags = cx->throttledTags[options.priority]; + for (auto& tag : options.tags) { + auto itr = priorityThrottledTags.find(tag); + if (itr != priorityThrottledTags.end()) { + if (!itr->second.expired()) { + maxThrottleDelay = std::max(maxThrottleDelay, itr->second.throttleDuration()); + canRecheck = itr->second.canRecheck(); + } else { + priorityThrottledTags.erase(itr); } } + } - if (maxThrottleDelay > 0.0 && !canRecheck) { // TODO: allow delaying? - TEST(true); // Throttling tag before GRV request - ++trState->cx->transactionReadVersionsThrottled; - readVersion = tag_throttled(); - return readVersion; - } else { - TEST(maxThrottleDelay > 0.0); // Rechecking throttle - } - - for (auto& tag : trState->options.tags) { - auto itr = priorityThrottledTags.find(tag); - if (itr != priorityThrottledTags.end()) { - itr->second.updateChecked(); - } - } + if (maxThrottleDelay > 0.0 && !canRecheck) { // TODO: allow delaying? + CODE_PROBE(true, "Throttling tag before GRV request"); + ++cx->transactionReadVersionsThrottled; + return tag_throttled(); + } else { + CODE_PROBE(maxThrottleDelay > 0.0, "Rechecking throttle"); } - auto& batcher = trState->cx->versionBatcher[flags]; - if (!batcher.actor.isValid()) { - batcher.actor = - readVersionBatcher(trState->cx.getPtr(), batcher.stream.getFuture(), trState->options.priority, flags); + for (auto& tag : options.tags) { + auto itr = priorityThrottledTags.find(tag); + if (itr != priorityThrottledTags.end()) { + itr->second.updateChecked(); + } } + } - Location location = "NAPI:getReadVersion"_loc; - UID spanContext = generateSpanID(trState->cx->transactionTracingSample, trState->spanID); - auto const req = DatabaseContext::VersionRequest(spanContext, trState->options.tags, trState->debugID); - batcher.stream.send(req); - trState->startTime = now(); - readVersion = extractReadVersion(trState, location, spanContext, req.reply.getFuture(), metadataVersion); + auto& batcher = cx->versionBatcher[flags]; + if (!batcher.actor.isValid()) { + batcher.actor = readVersionBatcher(cx.getPtr(), batcher.stream.getFuture(), options.priority, flags); } - return readVersion; + + Location location = "NAPI:getReadVersion"_loc; + SpanContext derivedSpanContext = generateSpanID(cx->transactionTracingSample, spanContext); + Optional versionDebugID = readOptions.present() ? readOptions.get().debugID : Optional(); + auto const req = DatabaseContext::VersionRequest(derivedSpanContext, options.tags, versionDebugID); + batcher.stream.send(req); + startTime = now(); + return extractReadVersion( + Reference::addRef(this), location, spanContext, req.reply.getFuture(), metadataVersion); } Optional Transaction::getCachedReadVersion() const { - if (readVersion.isValid() && readVersion.isReady() && !readVersion.isError()) { - return readVersion.get(); + if (trState->readVersionFuture.canGet()) { + return trState->readVersion(); } else { return Optional(); } } +double Transaction::getTagThrottledDuration() const { + return trState->proxyTagThrottledDuration; +} + Future> Transaction::getVersionstamp() { if (committing.isValid()) { return transaction_invalid_version(); @@ -31445,21 +33967,21 @@ Future> Transaction::getVersionstamp() { } // Gets the protocol version reported by a coordinator via the protocol info interface - #line 31448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getCoordinatorProtocol() - #line 7076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetCoordinatorProtocolActorState { - #line 31455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetCoordinatorProtocolActorState(NetworkAddress const& coordinatorAddress) - #line 7076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : coordinatorAddress(coordinatorAddress) - #line 31462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 33984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getCoordinatorProtocol", reinterpret_cast(this)); @@ -31472,18 +33994,18 @@ class GetCoordinatorProtocolActorState { int a_body1(int loopDepth=0) { try { - #line 7077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" RequestStream requestStream( Endpoint::wellKnown({ coordinatorAddress }, WLTOKEN_PROTOCOL_INFO)); - #line 7079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = retryBrokenPromise(requestStream, ProtocolInfoRequest{}); - #line 7079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 31481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 7079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 31486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -31504,9 +34026,9 @@ class GetCoordinatorProtocolActorState { } int a_body1cont1(ProtocolInfoReply const& reply,int loopDepth) { - #line 7080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(reply.version); this->~GetCoordinatorProtocolActorState(); static_cast(this)->destroy(); return 0; } - #line 31509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< ProtocolVersion >::value()) ProtocolVersion(reply.version); this->~GetCoordinatorProtocolActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -31516,9 +34038,9 @@ class GetCoordinatorProtocolActorState { } int a_body1cont1(ProtocolInfoReply && reply,int loopDepth) { - #line 7080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(reply.version); this->~GetCoordinatorProtocolActorState(); static_cast(this)->destroy(); return 0; } - #line 31521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< ProtocolVersion >::value()) ProtocolVersion(reply.version); this->~GetCoordinatorProtocolActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -31589,14 +34111,14 @@ class GetCoordinatorProtocolActorState { fdb_probe_actor_exit("getCoordinatorProtocol", reinterpret_cast(this), 0); } - #line 7076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" NetworkAddress coordinatorAddress; - #line 31594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getCoordinatorProtocol() - #line 7076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetCoordinatorProtocolActor final : public Actor, public ActorCallback< GetCoordinatorProtocolActor, 0, ProtocolInfoReply >, public FastAllocated, public GetCoordinatorProtocolActorState { - #line 31599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -31605,9 +34127,9 @@ class GetCoordinatorProtocolActor final : public Actor, public void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetCoordinatorProtocolActor, 0, ProtocolInfoReply >; - #line 7076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetCoordinatorProtocolActor(NetworkAddress const& coordinatorAddress) - #line 31610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), GetCoordinatorProtocolActorState(coordinatorAddress) { @@ -31631,38 +34153,38 @@ friend struct ActorCallback< GetCoordinatorProtocolActor, 0, ProtocolInfoReply > } }; } - #line 7076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future getCoordinatorProtocol( NetworkAddress const& coordinatorAddress ) { - #line 7076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new GetCoordinatorProtocolActor(coordinatorAddress)); - #line 31638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 7601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" // Gets the protocol version reported by a coordinator in its connect packet // If we are unable to get a version from the connect packet (e.g. because we lost connection with the peer), then this // function will return with an unset result. // If an expected version is given, this future won't return if the actual protocol version matches the expected version - #line 31647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getCoordinatorProtocolFromConnectPacket() - #line 7087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetCoordinatorProtocolFromConnectPacketActorState { - #line 31654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetCoordinatorProtocolFromConnectPacketActorState(NetworkAddress const& coordinatorAddress,Optional const& expectedVersion) - #line 7087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : coordinatorAddress(coordinatorAddress), - #line 7087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" expectedVersion(expectedVersion), - #line 7090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" protocolVersion(FlowTransport::transport().getPeerProtocolAsyncVar(coordinatorAddress)) - #line 31665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getCoordinatorProtocolFromConnectPacket", reinterpret_cast(this)); @@ -31675,22 +34197,22 @@ class GetCoordinatorProtocolFromConnectPacketActorState { int a_body1(int loopDepth=0) { try { - #line 7093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!protocolVersion.present()) - #line 31680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevWarnAlways, "GetCoordinatorProtocolPeerMissing").detail("Address", coordinatorAddress); - #line 7095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = delay(FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT); - #line 7095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 31688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 7095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 31693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else @@ -31716,18 +34238,18 @@ class GetCoordinatorProtocolFromConnectPacketActorState { } int a_body1cont1(int loopDepth) { - #line 7099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 31721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont2(Void const& _,int loopDepth) { - #line 7096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GetCoordinatorProtocolFromConnectPacketActorState(); static_cast(this)->destroy(); return 0; } - #line 31730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~GetCoordinatorProtocolFromConnectPacketActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -31737,9 +34259,9 @@ class GetCoordinatorProtocolFromConnectPacketActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 7096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GetCoordinatorProtocolFromConnectPacketActorState(); static_cast(this)->destroy(); return 0; } - #line 31742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~GetCoordinatorProtocolFromConnectPacketActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -31819,51 +34341,51 @@ class GetCoordinatorProtocolFromConnectPacketActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 7100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (protocolVersion.get()->get().present() && protocolVersion.get()->get() != expectedVersion) - #line 31824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(protocolVersion.get()->get()); this->~GetCoordinatorProtocolFromConnectPacketActorState(); static_cast(this)->destroy(); return 0; } - #line 31828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(protocolVersion.get()->get()); this->~GetCoordinatorProtocolFromConnectPacketActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 7104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future change = protocolVersion.get()->onChange(); - #line 7105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!protocolVersion.get()->get().present()) - #line 31838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" change = timeout(change, FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT, Void()); - #line 31842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = change; - #line 7110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 31848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 7110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 31853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont1(Void const& _,int loopDepth) { - #line 7112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!protocolVersion.get()->get().present()) - #line 31862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(protocolVersion.get()->get()); this->~GetCoordinatorProtocolFromConnectPacketActorState(); static_cast(this)->destroy(); return 0; } - #line 31866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(protocolVersion.get()->get()); this->~GetCoordinatorProtocolFromConnectPacketActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -31875,13 +34397,13 @@ class GetCoordinatorProtocolFromConnectPacketActorState { } int a_body1cont1loopBody1cont1(Void && _,int loopDepth) { - #line 7112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!protocolVersion.get()->get().present()) - #line 31880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(protocolVersion.get()->get()); this->~GetCoordinatorProtocolFromConnectPacketActorState(); static_cast(this)->destroy(); return 0; } - #line 31884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(protocolVersion.get()->get()); this->~GetCoordinatorProtocolFromConnectPacketActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -31954,18 +34476,18 @@ class GetCoordinatorProtocolFromConnectPacketActorState { fdb_probe_actor_exit("getCoordinatorProtocolFromConnectPacket", reinterpret_cast(this), 1); } - #line 7087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" NetworkAddress coordinatorAddress; - #line 7087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional expectedVersion; - #line 7090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional> const>> protocolVersion; - #line 31963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getCoordinatorProtocolFromConnectPacket() - #line 7087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetCoordinatorProtocolFromConnectPacketActor final : public Actor>, public ActorCallback< GetCoordinatorProtocolFromConnectPacketActor, 0, Void >, public ActorCallback< GetCoordinatorProtocolFromConnectPacketActor, 1, Void >, public FastAllocated, public GetCoordinatorProtocolFromConnectPacketActorState { - #line 31968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -31975,9 +34497,9 @@ class GetCoordinatorProtocolFromConnectPacketActor final : public Actor; friend struct ActorCallback< GetCoordinatorProtocolFromConnectPacketActor, 1, Void >; - #line 7087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetCoordinatorProtocolFromConnectPacketActor(NetworkAddress const& coordinatorAddress,Optional const& expectedVersion) - #line 31980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor>(), GetCoordinatorProtocolFromConnectPacketActorState(coordinatorAddress, expectedVersion) { @@ -32002,38 +34524,38 @@ friend struct ActorCallback< GetCoordinatorProtocolFromConnectPacketActor, 1, Vo } }; } - #line 7087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future> getCoordinatorProtocolFromConnectPacket( NetworkAddress const& coordinatorAddress, Optional const& expectedVersion ) { - #line 7087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future>(new GetCoordinatorProtocolFromConnectPacketActor(coordinatorAddress, expectedVersion)); - #line 32009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 7636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" // Returns the protocol version reported by the given coordinator // If an expected version is given, the future won't return until the protocol version is different than expected - #line 32016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getClusterProtocolImpl() - #line 7120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetClusterProtocolImplActorState { - #line 32023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetClusterProtocolImplActorState(Reference> const> const& coordinator,Optional const& expectedVersion) - #line 7120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : coordinator(coordinator), - #line 7120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" expectedVersion(expectedVersion), - #line 7123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" needToConnect(true), - #line 7124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" protocolVersion(Never()) - #line 32036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getClusterProtocolImpl", reinterpret_cast(this)); @@ -32046,9 +34568,9 @@ class GetClusterProtocolImplActorState { int a_body1(int loopDepth=0) { try { - #line 7126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 32051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -32076,49 +34598,49 @@ class GetClusterProtocolImplActorState { } int a_body1loopBody1(int loopDepth) { - #line 7127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!coordinator->get().present()) - #line 32081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = coordinator->onChange(); - #line 7128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 32087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 7128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 32092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - #line 7130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" coordinatorAddress = NetworkAddress(); - #line 7131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (coordinator->get().get().hostname.present()) - #line 32101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" h = coordinator->get().get().hostname.get(); - #line 7133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = store(coordinatorAddress, h.resolveWithRetry()); - #line 7133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 32109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 7133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 32114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - #line 7135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" coordinatorAddress = coordinator->get().get().getLeader.getEndpoint().getPrimaryAddress(); - #line 32121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont3(loopDepth); } } @@ -32208,38 +34730,38 @@ class GetClusterProtocolImplActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 7138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (needToConnect) - #line 32213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" protocolVersion = getCoordinatorProtocol(coordinatorAddress); - #line 7142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" needToConnect = false; - #line 32219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = coordinator->onChange(); - #line 7144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 32225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; - #line 7149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = protocolVersion; - #line 32229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont3when2(__when_expr_3.get(), loopDepth); }; - #line 7159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture> __when_expr_4 = getCoordinatorProtocolFromConnectPacket(coordinatorAddress, expectedVersion); - #line 32233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont3when3(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 7145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 32242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -32327,73 +34849,73 @@ class GetClusterProtocolImplActorState { } int a_body1loopBody1cont3when1(Void const& _,int loopDepth) { - #line 7146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" needToConnect = true; - #line 32332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; } int a_body1loopBody1cont3when1(Void && _,int loopDepth) { - #line 7146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" needToConnect = true; - #line 32341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; } int a_body1loopBody1cont3when2(ProtocolVersion const& pv,int loopDepth) { - #line 7150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!expectedVersion.present() || expectedVersion.get() != pv) - #line 32350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(pv); this->~GetClusterProtocolImplActorState(); static_cast(this)->destroy(); return 0; } - #line 32354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< ProtocolVersion >::value()) ProtocolVersion(pv); this->~GetClusterProtocolImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 7154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" protocolVersion = Never(); - #line 32362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; } int a_body1loopBody1cont3when2(ProtocolVersion && pv,int loopDepth) { - #line 7150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!expectedVersion.present() || expectedVersion.get() != pv) - #line 32371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(pv); this->~GetClusterProtocolImplActorState(); static_cast(this)->destroy(); return 0; } - #line 32375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< ProtocolVersion >::value()) ProtocolVersion(pv); this->~GetClusterProtocolImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 7154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" protocolVersion = Never(); - #line 32383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; } int a_body1loopBody1cont3when3(Optional const& pv,int loopDepth) { - #line 7161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (pv.present()) - #line 32392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(pv.get()); this->~GetClusterProtocolImplActorState(); static_cast(this)->destroy(); return 0; } - #line 32396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< ProtocolVersion >::value()) ProtocolVersion(pv.get()); this->~GetClusterProtocolImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -32401,9 +34923,9 @@ class GetClusterProtocolImplActorState { } else { - #line 7164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" needToConnect = true; - #line 32406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } loopDepth = a_body1loopBody1cont6(loopDepth); @@ -32411,13 +34933,13 @@ class GetClusterProtocolImplActorState { } int a_body1loopBody1cont3when3(Optional && pv,int loopDepth) { - #line 7161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (pv.present()) - #line 32416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(pv.get()); this->~GetClusterProtocolImplActorState(); static_cast(this)->destroy(); return 0; } - #line 32420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< ProtocolVersion >::value()) ProtocolVersion(pv.get()); this->~GetClusterProtocolImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -32425,9 +34947,9 @@ class GetClusterProtocolImplActorState { } else { - #line 7164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" needToConnect = true; - #line 32430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 34952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } loopDepth = a_body1loopBody1cont6(loopDepth); @@ -32576,24 +35098,24 @@ class GetClusterProtocolImplActorState { fdb_probe_actor_exit("getClusterProtocolImpl", reinterpret_cast(this), 4); } - #line 7120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference> const> coordinator; - #line 7120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional expectedVersion; - #line 7123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool needToConnect; - #line 7124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future protocolVersion; - #line 7130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" NetworkAddress coordinatorAddress; - #line 7132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Hostname h; - #line 32591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 35113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getClusterProtocolImpl() - #line 7120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetClusterProtocolImplActor final : public Actor, public ActorCallback< GetClusterProtocolImplActor, 0, Void >, public ActorCallback< GetClusterProtocolImplActor, 1, Void >, public ActorCallback< GetClusterProtocolImplActor, 2, Void >, public ActorCallback< GetClusterProtocolImplActor, 3, ProtocolVersion >, public ActorCallback< GetClusterProtocolImplActor, 4, Optional >, public FastAllocated, public GetClusterProtocolImplActorState { - #line 32596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 35118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -32606,9 +35128,9 @@ friend struct ActorCallback< GetClusterProtocolImplActor, 1, Void >; friend struct ActorCallback< GetClusterProtocolImplActor, 2, Void >; friend struct ActorCallback< GetClusterProtocolImplActor, 3, ProtocolVersion >; friend struct ActorCallback< GetClusterProtocolImplActor, 4, Optional >; - #line 7120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetClusterProtocolImplActor(Reference> const> const& coordinator,Optional const& expectedVersion) - #line 32611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 35133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), GetClusterProtocolImplActorState(coordinator, expectedVersion) { @@ -32634,14 +35156,14 @@ friend struct ActorCallback< GetClusterProtocolImplActor, 4, Optional getClusterProtocolImpl( Reference> const> const& coordinator, Optional const& expectedVersion ) { - #line 7120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new GetClusterProtocolImplActor(coordinator, expectedVersion)); - #line 32641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 35163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 7690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" // Returns the protocol version reported by the coordinator this client is currently connected to // If an expected version is given, the future won't return until the protocol version is different than expected @@ -32650,6 +35172,25 @@ Future DatabaseContext::getClusterProtocol(OptionalTAG_THROTTLE_SMOOTHING_WINDOW; + + if (capacity >= 1) { + return 0.0; + } + + if (tpsRate == 0) { + return std::max(0.0, expiration - now()); + } + + return std::min(expiration - now(), capacity / tpsRate); +} + uint32_t Transaction::getSize() { auto s = tr.transaction.mutations.expectedSize() + tr.transaction.read_conflict_ranges.expectedSize() + tr.transaction.write_conflict_ranges.expectedSize(); @@ -32658,25 +35199,32 @@ uint32_t Transaction::getSize() { Future Transaction::onError(Error const& e) { if (g_network->isSimulated() && ++trState->numErrors % 10 == 0) { - TraceEvent(SevWarnAlways, "TransactionTooManyRetries").detail("NumRetries", trState->numErrors); + TraceEvent(SevWarnAlways, "TransactionTooManyRetries") + .errorUnsuppressed(e) + .detail("NumRetries", trState->numErrors); } if (e.code() == error_code_success) { return client_invalid_operation(); } if (e.code() == error_code_not_committed || e.code() == error_code_commit_unknown_result || - e.code() == error_code_database_locked || e.code() == error_code_proxy_memory_limit_exceeded || - e.code() == error_code_process_behind || e.code() == error_code_batch_transaction_throttled || - e.code() == error_code_tag_throttled) { + e.code() == error_code_database_locked || e.code() == error_code_commit_proxy_memory_limit_exceeded || + e.code() == error_code_grv_proxy_memory_limit_exceeded || e.code() == error_code_process_behind || + e.code() == error_code_batch_transaction_throttled || e.code() == error_code_tag_throttled || + e.code() == error_code_blob_granule_request_failed || e.code() == error_code_proxy_tag_throttled) { if (e.code() == error_code_not_committed) ++trState->cx->transactionsNotCommitted; else if (e.code() == error_code_commit_unknown_result) ++trState->cx->transactionsMaybeCommitted; - else if (e.code() == error_code_proxy_memory_limit_exceeded) + else if (e.code() == error_code_commit_proxy_memory_limit_exceeded || + e.code() == error_code_grv_proxy_memory_limit_exceeded) ++trState->cx->transactionsResourceConstrained; else if (e.code() == error_code_process_behind) ++trState->cx->transactionsProcessBehind; else if (e.code() == error_code_batch_transaction_throttled || e.code() == error_code_tag_throttled) { ++trState->cx->transactionsThrottled; + } else if (e.code() == error_code_proxy_tag_throttled) { + ++trState->cx->transactionsThrottled; + trState->proxyTagThrottledDuration += CLIENT_KNOBS->PROXY_MAX_TAG_THROTTLE_DURATION; } double backoff = getBackoff(e.code()); @@ -32693,38 +35241,39 @@ Future Transaction::onError(Error const& e) { reset(); return delay(std::min(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, maxBackoff), trState->taskID); } - if (e.code() == error_code_unknown_tenant) { - double maxBackoff = trState->options.maxBackoff; - reset(); - return delay(std::min(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, maxBackoff), trState->taskID); - } return e; } - #line 32704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -[[nodiscard]] Future getStorageMetricsLargeKeyRange( Database const& cx, KeyRange const& keys ); + #line 35247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +[[nodiscard]] Future getStorageMetricsLargeKeyRange( Database const& cx, KeyRange const& keys, Optional> const& trState ); -#line 7231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 7773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 32709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 35252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via doGetStorageMetrics() - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class DoGetStorageMetricsActorState { - #line 32716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 35259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - DoGetStorageMetricsActorState(Database const& cx,KeyRange const& keys,Reference const& locationInfo) - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + DoGetStorageMetricsActorState(Database const& cx,TenantInfo const& tenantInfo,Version const& version,KeyRange const& keys,Reference const& locationInfo,Optional> const& trState) + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantInfo(tenantInfo), + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version), + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys(keys), - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - locationInfo(locationInfo) - #line 32727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + locationInfo(locationInfo), + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState(trState) + #line 35276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("doGetStorageMetrics", reinterpret_cast(this)); @@ -32737,10 +35286,30 @@ class DoGetStorageMetricsActorState { int a_body1(int loopDepth=0) { try { - #line 7233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 32742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); + try { + #line 7781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WaitMetricsRequest req(tenantInfo, version, keys, StorageMetrics(), StorageMetrics()); + #line 7782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.min.bytes = 0; + #line 7783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.max.bytes = -1; + #line 7784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = loadBalance( locationInfo->locations(), &StorageServerInterface::waitMetrics, req, TaskPriority::DataDistribution); + #line 7784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 35300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 7784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 35305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -32758,80 +35327,70 @@ class DoGetStorageMetricsActorState { return loopDepth; } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) - { - try { - #line 7235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WaitMetricsRequest req(keys, StorageMetrics(), StorageMetrics()); - #line 7236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.min.bytes = 0; - #line 7237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.max.bytes = -1; - #line 7238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = loadBalance( locationInfo->locations(), &StorageServerInterface::waitMetrics, req, TaskPriority::DataDistribution); - #line 7238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 32781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 7238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 32786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 7242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() != error_code_wrong_shard_server && e.code() != error_code_all_alternatives_failed) - #line 32802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) + #line 35335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevError, "WaitStorageMetricsError").error(e); - #line 7244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 32808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache(tenantInfo.prefix, keys); + #line 7790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution); + #line 7790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 35343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1Catch2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 7790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 35348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 7791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_future_version) + #line 35355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 7792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, TaskPriority::DataDistribution); + #line 7792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 35361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1Catch2when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 7792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 35366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 7794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool ok = e.code() == error_code_tenant_not_found; + #line 7795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(ok ? SevInfo : SevError, "DoGetStorageMetricsError").error(e); + #line 7796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 35377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } } - #line 7246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution); - #line 7246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 32814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 7246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 32819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1loopBody1cont2(StorageMetrics const& m,int loopDepth) + int a_body1cont2(StorageMetrics const& m,int loopDepth) { - #line 7240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(m); this->~DoGetStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } - #line 32834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 35393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(m); this->~DoGetStorageMetricsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -32839,11 +35398,11 @@ class DoGetStorageMetricsActorState { return loopDepth; } - int a_body1loopBody1cont2(StorageMetrics && m,int loopDepth) + int a_body1cont2(StorageMetrics && m,int loopDepth) { - #line 7240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(m); this->~DoGetStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } - #line 32846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 35405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(m); this->~DoGetStorageMetricsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -32851,15 +35410,15 @@ class DoGetStorageMetricsActorState { return loopDepth; } - int a_body1loopBody1when1(StorageMetrics const& m,int loopDepth) + int a_body1when1(StorageMetrics const& m,int loopDepth) { - loopDepth = a_body1loopBody1cont2(m, loopDepth); + loopDepth = a_body1cont2(m, loopDepth); return loopDepth; } - int a_body1loopBody1when1(StorageMetrics && m,int loopDepth) + int a_body1when1(StorageMetrics && m,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(m), loopDepth); + loopDepth = a_body1cont2(std::move(m), loopDepth); return loopDepth; } @@ -32874,12 +35433,12 @@ class DoGetStorageMetricsActorState { fdb_probe_actor_enter("doGetStorageMetrics", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } fdb_probe_actor_exit("doGetStorageMetrics", reinterpret_cast(this), 0); @@ -32889,12 +35448,12 @@ class DoGetStorageMetricsActorState { fdb_probe_actor_enter("doGetStorageMetrics", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } fdb_probe_actor_exit("doGetStorageMetrics", reinterpret_cast(this), 0); @@ -32904,61 +35463,53 @@ class DoGetStorageMetricsActorState { fdb_probe_actor_enter("doGetStorageMetrics", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch2(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } fdb_probe_actor_exit("doGetStorageMetrics", reinterpret_cast(this), 0); } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1Catch2cont1(int loopDepth) { - #line 7247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(Key(), keys); - #line 7248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = getStorageMetricsLargeKeyRange(cx, keys); - #line 7248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 32925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1cont1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 7248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 32930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = getStorageMetricsLargeKeyRange(cx, keys, trState); + #line 7799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 35482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1Catch2cont1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 7799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 35487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1Catch2cont2(Void const& _,int loopDepth) { - #line 7247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(Key(), keys); - #line 7248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = getStorageMetricsLargeKeyRange(cx, keys); - #line 7248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 32943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1cont1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 7248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 32948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1Catch2cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1Catch2cont2(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + loopDepth = a_body1Catch2cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1Catch2when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1Catch2cont2(_, loopDepth); + + return loopDepth; + } + int a_body1Catch2when1(Void && _,int loopDepth) + { + loopDepth = a_body1Catch2cont2(std::move(_), loopDepth); return loopDepth; } @@ -32973,7 +35524,7 @@ class DoGetStorageMetricsActorState { fdb_probe_actor_enter("doGetStorageMetrics", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1Catch1when1(value, 0); + a_body1Catch2when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -32988,7 +35539,7 @@ class DoGetStorageMetricsActorState { fdb_probe_actor_enter("doGetStorageMetrics", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1Catch1when1(std::move(value), 0); + a_body1Catch2when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -33013,54 +35564,48 @@ class DoGetStorageMetricsActorState { fdb_probe_actor_exit("doGetStorageMetrics", reinterpret_cast(this), 1); } - int a_body1loopBody1Catch1cont3(StorageMetrics const& m,int loopDepth) + int a_body1Catch2cont3(int loopDepth) { - #line 7249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(m); this->~DoGetStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } - #line 33020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(m); - this->~DoGetStorageMetricsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1Catch2cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont3(StorageMetrics && m,int loopDepth) + int a_body1Catch2cont4(Void const& _,int loopDepth) { - #line 7249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(m); this->~DoGetStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } - #line 33032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(m); - this->~DoGetStorageMetricsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1Catch2cont3(loopDepth); + + return loopDepth; + } + int a_body1Catch2cont4(Void && _,int loopDepth) + { + loopDepth = a_body1Catch2cont3(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont1when1(StorageMetrics const& m,int loopDepth) + int a_body1Catch2when2(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont3(m, loopDepth); + loopDepth = a_body1Catch2cont4(_, loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont1when1(StorageMetrics && m,int loopDepth) + int a_body1Catch2when2(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont3(std::move(m), loopDepth); + loopDepth = a_body1Catch2cont4(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DoGetStorageMetricsActor, 2, StorageMetrics >::remove(); + static_cast(this)->ActorCallback< DoGetStorageMetricsActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< DoGetStorageMetricsActor, 2, StorageMetrics >*,StorageMetrics const& value) + void a_callback_fire(ActorCallback< DoGetStorageMetricsActor, 2, Void >*,Void const& value) { fdb_probe_actor_enter("doGetStorageMetrics", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1Catch1cont1when1(value, 0); + a_body1Catch2when2(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -33070,12 +35615,12 @@ class DoGetStorageMetricsActorState { fdb_probe_actor_exit("doGetStorageMetrics", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< DoGetStorageMetricsActor, 2, StorageMetrics >*,StorageMetrics && value) + void a_callback_fire(ActorCallback< DoGetStorageMetricsActor, 2, Void >*,Void && value) { fdb_probe_actor_enter("doGetStorageMetrics", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1Catch1cont1when1(std::move(value), 0); + a_body1Catch2when2(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -33085,7 +35630,7 @@ class DoGetStorageMetricsActorState { fdb_probe_actor_exit("doGetStorageMetrics", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< DoGetStorageMetricsActor, 2, StorageMetrics >*,Error err) + void a_callback_error(ActorCallback< DoGetStorageMetricsActor, 2, Void >*,Error err) { fdb_probe_actor_enter("doGetStorageMetrics", reinterpret_cast(this), 2); a_exitChoose3(); @@ -33100,18 +35645,111 @@ class DoGetStorageMetricsActorState { fdb_probe_actor_exit("doGetStorageMetrics", reinterpret_cast(this), 2); } - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int a_body1Catch2cont6(StorageMetrics const& m,int loopDepth) + { + #line 7800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(m); this->~DoGetStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } + #line 35652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(m); + this->~DoGetStorageMetricsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2cont6(StorageMetrics && m,int loopDepth) + { + #line 7800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(m); this->~DoGetStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } + #line 35664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(m); + this->~DoGetStorageMetricsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2cont1when1(StorageMetrics const& m,int loopDepth) + { + loopDepth = a_body1Catch2cont6(m, loopDepth); + + return loopDepth; + } + int a_body1Catch2cont1when1(StorageMetrics && m,int loopDepth) + { + loopDepth = a_body1Catch2cont6(std::move(m), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoGetStorageMetricsActor, 3, StorageMetrics >::remove(); + + } + void a_callback_fire(ActorCallback< DoGetStorageMetricsActor, 3, StorageMetrics >*,StorageMetrics const& value) + { + fdb_probe_actor_enter("doGetStorageMetrics", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch2cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doGetStorageMetrics", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< DoGetStorageMetricsActor, 3, StorageMetrics >*,StorageMetrics && value) + { + fdb_probe_actor_enter("doGetStorageMetrics", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch2cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doGetStorageMetrics", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< DoGetStorageMetricsActor, 3, StorageMetrics >*,Error err) + { + fdb_probe_actor_enter("doGetStorageMetrics", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doGetStorageMetrics", reinterpret_cast(this), 3); + + } + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TenantInfo tenantInfo; + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange keys; - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference locationInfo; - #line 33109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional> trState; + #line 35747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via doGetStorageMetrics() - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class DoGetStorageMetricsActor final : public Actor, public ActorCallback< DoGetStorageMetricsActor, 0, StorageMetrics >, public ActorCallback< DoGetStorageMetricsActor, 1, Void >, public ActorCallback< DoGetStorageMetricsActor, 2, StorageMetrics >, public FastAllocated, public DoGetStorageMetricsActorState { - #line 33114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class DoGetStorageMetricsActor final : public Actor, public ActorCallback< DoGetStorageMetricsActor, 0, StorageMetrics >, public ActorCallback< DoGetStorageMetricsActor, 1, Void >, public ActorCallback< DoGetStorageMetricsActor, 2, Void >, public ActorCallback< DoGetStorageMetricsActor, 3, StorageMetrics >, public FastAllocated, public DoGetStorageMetricsActorState { + #line 35752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -33121,12 +35759,13 @@ class DoGetStorageMetricsActor final : public Actor, public Acto #pragma clang diagnostic pop friend struct ActorCallback< DoGetStorageMetricsActor, 0, StorageMetrics >; friend struct ActorCallback< DoGetStorageMetricsActor, 1, Void >; -friend struct ActorCallback< DoGetStorageMetricsActor, 2, StorageMetrics >; - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - DoGetStorageMetricsActor(Database const& cx,KeyRange const& keys,Reference const& locationInfo) - #line 33127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +friend struct ActorCallback< DoGetStorageMetricsActor, 2, Void >; +friend struct ActorCallback< DoGetStorageMetricsActor, 3, StorageMetrics >; + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + DoGetStorageMetricsActor(Database const& cx,TenantInfo const& tenantInfo,Version const& version,KeyRange const& keys,Reference const& locationInfo,Optional> const& trState) + #line 35766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - DoGetStorageMetricsActorState(cx, keys, locationInfo) + DoGetStorageMetricsActorState(cx, tenantInfo, version, keys, locationInfo, trState) { fdb_probe_actor_enter("doGetStorageMetrics", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -33144,40 +35783,43 @@ friend struct ActorCallback< DoGetStorageMetricsActor, 2, StorageMetrics >; switch (wait_state) { case 1: this->a_callback_error((ActorCallback< DoGetStorageMetricsActor, 0, StorageMetrics >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< DoGetStorageMetricsActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< DoGetStorageMetricsActor, 2, StorageMetrics >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< DoGetStorageMetricsActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< DoGetStorageMetricsActor, 3, StorageMetrics >*)0, actor_cancelled()); break; } } }; } - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future doGetStorageMetrics( Database const& cx, KeyRange const& keys, Reference const& locationInfo ) { - #line 7232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new DoGetStorageMetricsActor(cx, keys, locationInfo)); - #line 33157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future doGetStorageMetrics( Database const& cx, TenantInfo const& tenantInfo, Version const& version, KeyRange const& keys, Reference const& locationInfo, Optional> const& trState ) { + #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new DoGetStorageMetricsActor(cx, tenantInfo, version, keys, locationInfo, trState)); + #line 35797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 7803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 33162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 35802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getStorageMetricsLargeKeyRange() - #line 7254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetStorageMetricsLargeKeyRangeActorState { - #line 33169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 35809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetStorageMetricsLargeKeyRangeActorState(Database const& cx,KeyRange const& keys) - #line 7254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetStorageMetricsLargeKeyRangeActorState(Database const& cx,KeyRange const& keys,Optional> const& trState) + #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 7254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys(keys), - #line 7255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState(trState), + #line 7807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" span("NAPI:GetStorageMetricsLargeKeyRange"_loc) - #line 33180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 35822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getStorageMetricsLargeKeyRange", reinterpret_cast(this)); @@ -33190,17 +35832,26 @@ class GetStorageMetricsLargeKeyRangeActorState { int a_body1(int loopDepth=0) { try { - #line 7256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_0 = getKeyRangeLocations(cx, Optional(), keys, std::numeric_limits::max(), Reverse::False, &StorageServerInterface::waitMetrics, span.context, Optional(), UseProvisionalProxies::False, latestVersion); - #line 7256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 33197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 7256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 33202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 7808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState.present()) + #line 35837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 7809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = trState.get()->startTransaction(); + #line 7809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 35843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 7809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 35848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -33218,126 +35869,302 @@ class GetStorageMetricsLargeKeyRangeActorState { return loopDepth; } - int a_body1cont1(std::vector const& locations,int loopDepth) + int a_body1cont1(int loopDepth) + { + #line 7811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = trState.present() ? populateAndGetTenant(trState.get(), keys.begin) : TenantInfo(); + #line 7811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 35878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 7811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 35883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStorageMetricsLargeKeyRangeActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 0); + + } + int a_body1cont3(int loopDepth) + { + #line 7813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version = trState.present() ? trState.get()->readVersion() : latestVersion; + #line 7814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_2 = getKeyRangeLocations(cx, tenantInfo, keys, std::numeric_limits::max(), Reverse::False, &StorageServerInterface::waitMetrics, span.context, Optional(), UseProvisionalProxies::False, version); + #line 7814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 35971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 7814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 35976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(TenantInfo const& __tenantInfo,int loopDepth) + { + #line 7811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantInfo = __tenantInfo; + #line 35985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(TenantInfo && __tenantInfo,int loopDepth) + { + tenantInfo = std::move(__tenantInfo); + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, TenantInfo >::remove(); + + } + void a_callback_fire(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, TenantInfo >*,TenantInfo const& value) + { + fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, TenantInfo >*,TenantInfo && value) + { + fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, TenantInfo >*,Error err) + { + fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 1); + + } + int a_body1cont4(std::vector const& locations,int loopDepth) { - #line 7266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" nLocs = locations.size(); - #line 7267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fx = std::vector>(nLocs); - #line 7268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" total = StorageMetrics(); - #line 7269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef partBegin, partEnd; - #line 7270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" partBegin = (i == 0) ? keys.begin : locations[i].range.begin; - #line 7272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" partEnd = (i == nLocs - 1) ? keys.end : locations[i].range.end; - #line 7273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fx[i] = doGetStorageMetrics(cx, KeyRangeRef(partBegin, partEnd), locations[i].locations); - #line 33239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fx[i] = doGetStorageMetrics( cx, tenantInfo, version, KeyRangeRef(partBegin, partEnd), locations[i].locations, trState); + #line 36066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = waitForAll(fx); - #line 7275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = waitForAll(fx); + #line 7834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 33245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 7275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 33250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 7834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 36077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1(std::vector && locations,int loopDepth) + int a_body1cont4(std::vector && locations,int loopDepth) { - #line 7266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" nLocs = locations.size(); - #line 7267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fx = std::vector>(nLocs); - #line 7268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" total = StorageMetrics(); - #line 7269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef partBegin, partEnd; - #line 7270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" partBegin = (i == 0) ? keys.begin : locations[i].range.begin; - #line 7272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" partEnd = (i == nLocs - 1) ? keys.end : locations[i].range.end; - #line 7273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fx[i] = doGetStorageMetrics(cx, KeyRangeRef(partBegin, partEnd), locations[i].locations); - #line 33273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fx[i] = doGetStorageMetrics( cx, tenantInfo, version, KeyRangeRef(partBegin, partEnd), locations[i].locations, trState); + #line 36100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = waitForAll(fx); - #line 7275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = waitForAll(fx); + #line 7834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 33279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 7275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 33284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 7834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 36111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(std::vector const& locations,int loopDepth) + int a_body1cont3when1(std::vector const& locations,int loopDepth) { - loopDepth = a_body1cont1(locations, loopDepth); + loopDepth = a_body1cont4(locations, loopDepth); return loopDepth; } - int a_body1when1(std::vector && locations,int loopDepth) + int a_body1cont3when1(std::vector && locations,int loopDepth) { - loopDepth = a_body1cont1(std::move(locations), loopDepth); + loopDepth = a_body1cont4(std::move(locations), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose3() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStorageMetricsLargeKeyRangeActor, 0, std::vector >::remove(); + static_cast(this)->ActorCallback< GetStorageMetricsLargeKeyRangeActor, 2, std::vector >::remove(); } - void a_callback_fire(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 0, std::vector >*,std::vector const& value) + void a_callback_fire(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 2, std::vector >*,std::vector const& value) { - fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1when1(value, 0); + a_body1cont3when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 0, std::vector >*,std::vector && value) + void a_callback_fire(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 2, std::vector >*,std::vector && value) { - fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1when1(std::move(value), 0); + a_body1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 0, std::vector >*,Error err) + void a_callback_error(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 2, std::vector >*,Error err) { - fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -33346,20 +36173,20 @@ class GetStorageMetricsLargeKeyRangeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 2); } - int a_body1cont2(Void const& _,int loopDepth) + int a_body1cont5(Void const& _,int loopDepth) { - #line 7276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" total += fx[i].get(); - #line 33358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(total); this->~GetStorageMetricsLargeKeyRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 33362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(std::move(total)); // state_var_RVO this->~GetStorageMetricsLargeKeyRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -33367,17 +36194,17 @@ class GetStorageMetricsLargeKeyRangeActorState { return loopDepth; } - int a_body1cont2(Void && _,int loopDepth) + int a_body1cont5(Void && _,int loopDepth) { - #line 7276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" total += fx[i].get(); - #line 33376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(total); this->~GetStorageMetricsLargeKeyRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 33380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(std::move(total)); // state_var_RVO this->~GetStorageMetricsLargeKeyRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -33385,58 +36212,58 @@ class GetStorageMetricsLargeKeyRangeActorState { return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1cont4when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + loopDepth = a_body1cont5(_, loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1cont4when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont5(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose4() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, Void >::remove(); + static_cast(this)->ActorCallback< GetStorageMetricsLargeKeyRangeActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont1when1(value, 0); + a_body1cont4when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont1when1(std::move(value), 0); + a_body1cont4when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< GetStorageMetricsLargeKeyRangeActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -33445,27 +36272,33 @@ class GetStorageMetricsLargeKeyRangeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getStorageMetricsLargeKeyRange", reinterpret_cast(this), 3); } - #line 7254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 7254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange keys; - #line 7255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional> trState; + #line 7807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 7266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TenantInfo tenantInfo; + #line 7813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 7824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int nLocs; - #line 7267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector> fx; - #line 7268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StorageMetrics total; - #line 33463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getStorageMetricsLargeKeyRange() - #line 7254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetStorageMetricsLargeKeyRangeActor final : public Actor, public ActorCallback< GetStorageMetricsLargeKeyRangeActor, 0, std::vector >, public ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, Void >, public FastAllocated, public GetStorageMetricsLargeKeyRangeActorState { - #line 33468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetStorageMetricsLargeKeyRangeActor final : public Actor, public ActorCallback< GetStorageMetricsLargeKeyRangeActor, 0, Void >, public ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, TenantInfo >, public ActorCallback< GetStorageMetricsLargeKeyRangeActor, 2, std::vector >, public ActorCallback< GetStorageMetricsLargeKeyRangeActor, 3, Void >, public FastAllocated, public GetStorageMetricsLargeKeyRangeActorState { + #line 36301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -33473,13 +36306,15 @@ class GetStorageMetricsLargeKeyRangeActor final : public Actor, #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetStorageMetricsLargeKeyRangeActor, 0, std::vector >; -friend struct ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, Void >; - #line 7254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetStorageMetricsLargeKeyRangeActor(Database const& cx,KeyRange const& keys) - #line 33480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +friend struct ActorCallback< GetStorageMetricsLargeKeyRangeActor, 0, Void >; +friend struct ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, TenantInfo >; +friend struct ActorCallback< GetStorageMetricsLargeKeyRangeActor, 2, std::vector >; +friend struct ActorCallback< GetStorageMetricsLargeKeyRangeActor, 3, Void >; + #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetStorageMetricsLargeKeyRangeActor(Database const& cx,KeyRange const& keys,Optional> const& trState) + #line 36315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - GetStorageMetricsLargeKeyRangeActorState(cx, keys) + GetStorageMetricsLargeKeyRangeActorState(cx, keys, trState) { fdb_probe_actor_enter("getStorageMetricsLargeKeyRange", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -33495,45 +36330,51 @@ friend struct ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetStorageMetricsLargeKeyRangeActor, 0, std::vector >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetStorageMetricsLargeKeyRangeActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetStorageMetricsLargeKeyRangeActor, 1, TenantInfo >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetStorageMetricsLargeKeyRangeActor, 2, std::vector >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< GetStorageMetricsLargeKeyRangeActor, 3, Void >*)0, actor_cancelled()); break; } } }; } - #line 7254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future getStorageMetricsLargeKeyRange( Database const& cx, KeyRange const& keys ) { - #line 7254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new GetStorageMetricsLargeKeyRangeActor(cx, keys)); - #line 33509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getStorageMetricsLargeKeyRange( Database const& cx, KeyRange const& keys, Optional> const& trState ) { + #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetStorageMetricsLargeKeyRangeActor(cx, keys, trState)); + #line 36346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 7840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 33514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via trackBoundedStorageMetrics() - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class TrackBoundedStorageMetricsActorState { - #line 33521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TrackBoundedStorageMetricsActorState(KeyRange const& keys,Reference const& location,StorageMetrics const& x,StorageMetrics const& halfError,PromiseStream const& deltaStream) - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : keys(keys), - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TrackBoundedStorageMetricsActorState(TenantInfo const& tenantInfo,Version const& version,KeyRange const& keys,Reference const& location,StorageMetrics const& x,StorageMetrics const& halfError,PromiseStream const& deltaStream) + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : tenantInfo(tenantInfo), + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version), + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keys(keys), + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" location(location), - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" x(x), - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" halfError(halfError), - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" deltaStream(deltaStream) - #line 33536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("trackBoundedStorageMetrics", reinterpret_cast(this)); @@ -33547,9 +36388,9 @@ class TrackBoundedStorageMetricsActorState { { try { try { - #line 7288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 33552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -33577,11 +36418,11 @@ class TrackBoundedStorageMetricsActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 7295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" deltaStream.sendError(e); - #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 33584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -33600,40 +36441,40 @@ class TrackBoundedStorageMetricsActorState { } int a_body1loopBody1(int loopDepth) { - #line 7289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WaitMetricsRequest req(keys, x - halfError, x + halfError); - #line 7290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WaitMetricsRequest req(tenantInfo, version, keys, x - halfError, x + halfError); + #line 7851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = loadBalance(location->locations(), &StorageServerInterface::waitMetrics, req); - #line 7290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 33609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 7290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 33614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(StorageMetrics const& nextX,int loopDepth) { - #line 7291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" deltaStream.send(nextX - x); - #line 7292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" x = nextX; - #line 33625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(StorageMetrics && nextX,int loopDepth) { - #line 7291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" deltaStream.send(nextX - x); - #line 7292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" x = nextX; - #line 33636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -33701,22 +36542,26 @@ class TrackBoundedStorageMetricsActorState { fdb_probe_actor_exit("trackBoundedStorageMetrics", reinterpret_cast(this), 0); } - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TenantInfo tenantInfo; + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange keys; - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference location; - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StorageMetrics x; - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StorageMetrics halfError; - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" PromiseStream deltaStream; - #line 33714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via trackBoundedStorageMetrics() - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class TrackBoundedStorageMetricsActor final : public Actor, public ActorCallback< TrackBoundedStorageMetricsActor, 0, StorageMetrics >, public FastAllocated, public TrackBoundedStorageMetricsActorState { - #line 33719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -33725,11 +36570,11 @@ class TrackBoundedStorageMetricsActor final : public Actor, public ActorCa void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< TrackBoundedStorageMetricsActor, 0, StorageMetrics >; - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TrackBoundedStorageMetricsActor(KeyRange const& keys,Reference const& location,StorageMetrics const& x,StorageMetrics const& halfError,PromiseStream const& deltaStream) - #line 33730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TrackBoundedStorageMetricsActor(TenantInfo const& tenantInfo,Version const& version,KeyRange const& keys,Reference const& location,StorageMetrics const& x,StorageMetrics const& halfError,PromiseStream const& deltaStream) + #line 36575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - TrackBoundedStorageMetricsActorState(keys, location, x, halfError, deltaStream) + TrackBoundedStorageMetricsActorState(tenantInfo, version, keys, location, x, halfError, deltaStream) { fdb_probe_actor_enter("trackBoundedStorageMetrics", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -33751,52 +36596,56 @@ friend struct ActorCallback< TrackBoundedStorageMetricsActor, 0, StorageMetrics } }; } - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future trackBoundedStorageMetrics( KeyRange const& keys, Reference const& location, StorageMetrics const& x, StorageMetrics const& halfError, PromiseStream const& deltaStream ) { - #line 7282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new TrackBoundedStorageMetricsActor(keys, location, x, halfError, deltaStream)); - #line 33758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future trackBoundedStorageMetrics( TenantInfo const& tenantInfo, Version const& version, KeyRange const& keys, Reference const& location, StorageMetrics const& x, StorageMetrics const& halfError, PromiseStream const& deltaStream ) { + #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new TrackBoundedStorageMetricsActor(tenantInfo, version, keys, location, x, halfError, deltaStream)); + #line 36603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 7860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 33763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via waitStorageMetricsMultipleLocations() - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class WaitStorageMetricsMultipleLocationsActorState { - #line 33770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WaitStorageMetricsMultipleLocationsActorState(std::vector const& locations,StorageMetrics const& min,StorageMetrics const& max,StorageMetrics const& permittedError) - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : locations(locations), - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WaitStorageMetricsMultipleLocationsActorState(TenantInfo const& tenantInfo,Version const& version,std::vector const& locations,StorageMetrics const& min,StorageMetrics const& max,StorageMetrics const& permittedError) + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : tenantInfo(tenantInfo), + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version), + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + locations(locations), + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" min(min), - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" max(max), - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" permittedError(permittedError), - #line 7304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" nLocs(locations.size()), - #line 7305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fx(nLocs), - #line 7306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" total(), - #line 7307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" deltas(), - #line 7308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" wx(fx.size()), - #line 7309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" halfErrorPerMachine(permittedError * (0.5 / nLocs)), - #line 7310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" maxPlus(max + halfErrorPerMachine * (nLocs - 1)), - #line 7311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" minMinus(min - halfErrorPerMachine * (nLocs - 1)) - #line 33799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("waitStorageMetricsMultipleLocations", reinterpret_cast(this)); @@ -33809,28 +36658,28 @@ class WaitStorageMetricsMultipleLocationsActorState { int a_body1(int loopDepth=0) { try { - #line 7313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WaitMetricsRequest req(locations[i].range, StorageMetrics(), StorageMetrics()); - #line 7315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WaitMetricsRequest req(tenantInfo, version, locations[i].range, StorageMetrics(), StorageMetrics()); + #line 7878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.min.bytes = 0; - #line 7316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.max.bytes = -1; - #line 7317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fx[i] = loadBalance(locations[i].locations->locations(), &StorageServerInterface::waitMetrics, req, TaskPriority::DataDistribution); - #line 33822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = waitForAll(fx); - #line 7322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 33828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 7322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 33833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -33851,90 +36700,90 @@ class WaitStorageMetricsMultipleLocationsActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 7325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" total += fx[i].get(); - #line 33858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!total.allLessOrEqual(maxPlus)) - #line 33862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(total); this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->destroy(); return 0; } - #line 33866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(std::move(total)); // state_var_RVO this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 7330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!minMinus.allLessOrEqual(total)) - #line 33874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(total); this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->destroy(); return 0; } - #line 33878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(std::move(total)); // state_var_RVO this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 7333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - wx[i] = trackBoundedStorageMetrics( locations[i].range, locations[i].locations, fx[i].get(), halfErrorPerMachine, deltas); - #line 33888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + wx[i] = trackBoundedStorageMetrics( tenantInfo, version, locations[i].range, locations[i].locations, fx[i].get(), halfErrorPerMachine, deltas); + #line 36737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 33892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 7325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" total += fx[i].get(); - #line 33903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!total.allLessOrEqual(maxPlus)) - #line 33907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(total); this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->destroy(); return 0; } - #line 33911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(std::move(total)); // state_var_RVO this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 7330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!minMinus.allLessOrEqual(total)) - #line 33919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(total); this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->destroy(); return 0; } - #line 33923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(std::move(total)); // state_var_RVO this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 7333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - wx[i] = trackBoundedStorageMetrics( locations[i].range, locations[i].locations, fx[i].get(), halfErrorPerMachine, deltas); - #line 33933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + wx[i] = trackBoundedStorageMetrics( tenantInfo, version, locations[i].range, locations[i].locations, fx[i].get(), halfErrorPerMachine, deltas); + #line 36782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 33937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -34011,43 +36860,43 @@ class WaitStorageMetricsMultipleLocationsActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 7338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" FutureStream __when_expr_1 = deltas.getFuture(); - #line 7338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 34018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 7338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 34023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont1(StorageMetrics const& delta,int loopDepth) { - #line 7339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" total += delta; - #line 7340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!total.allLessOrEqual(maxPlus)) - #line 34034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(total); this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->destroy(); return 0; } - #line 34038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(std::move(total)); // state_var_RVO this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 7342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!minMinus.allLessOrEqual(total)) - #line 34046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(total); this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->destroy(); return 0; } - #line 34050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(std::move(total)); // state_var_RVO this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -34059,27 +36908,27 @@ class WaitStorageMetricsMultipleLocationsActorState { } int a_body1cont1loopBody1cont1(StorageMetrics && delta,int loopDepth) { - #line 7339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" total += delta; - #line 7340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!total.allLessOrEqual(maxPlus)) - #line 34066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(total); this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->destroy(); return 0; } - #line 34070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(std::move(total)); // state_var_RVO this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 7342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!minMinus.allLessOrEqual(total)) - #line 34078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(total); this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->destroy(); return 0; } - #line 34082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 36931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(std::move(total)); // state_var_RVO this->~WaitStorageMetricsMultipleLocationsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -34152,36 +37001,40 @@ class WaitStorageMetricsMultipleLocationsActorState { fdb_probe_actor_exit("waitStorageMetricsMultipleLocations", reinterpret_cast(this), 1); } - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TenantInfo tenantInfo; + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector locations; - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StorageMetrics min; - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StorageMetrics max; - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StorageMetrics permittedError; - #line 7304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int nLocs; - #line 7305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector> fx; - #line 7306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StorageMetrics total; - #line 7307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" PromiseStream deltas; - #line 7308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector> wx; - #line 7309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StorageMetrics halfErrorPerMachine; - #line 7310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StorageMetrics maxPlus; - #line 7311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StorageMetrics minMinus; - #line 34179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via waitStorageMetricsMultipleLocations() - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class WaitStorageMetricsMultipleLocationsActor final : public Actor, public ActorCallback< WaitStorageMetricsMultipleLocationsActor, 0, Void >, public ActorSingleCallback< WaitStorageMetricsMultipleLocationsActor, 1, StorageMetrics >, public FastAllocated, public WaitStorageMetricsMultipleLocationsActorState { - #line 34184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -34191,11 +37044,11 @@ class WaitStorageMetricsMultipleLocationsActor final : public Actor; friend struct ActorSingleCallback< WaitStorageMetricsMultipleLocationsActor, 1, StorageMetrics >; - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WaitStorageMetricsMultipleLocationsActor(std::vector const& locations,StorageMetrics const& min,StorageMetrics const& max,StorageMetrics const& permittedError) - #line 34196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WaitStorageMetricsMultipleLocationsActor(TenantInfo const& tenantInfo,Version const& version,std::vector const& locations,StorageMetrics const& min,StorageMetrics const& max,StorageMetrics const& permittedError) + #line 37049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - WaitStorageMetricsMultipleLocationsActorState(locations, min, max, permittedError) + WaitStorageMetricsMultipleLocationsActorState(tenantInfo, version, locations, min, max, permittedError) { fdb_probe_actor_enter("waitStorageMetricsMultipleLocations", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -34218,30 +37071,30 @@ friend struct ActorSingleCallback< WaitStorageMetricsMultipleLocationsActor, 1, } }; } - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future waitStorageMetricsMultipleLocations( std::vector const& locations, StorageMetrics const& min, StorageMetrics const& max, StorageMetrics const& permittedError ) { - #line 7300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new WaitStorageMetricsMultipleLocationsActor(locations, min, max, permittedError)); - #line 34225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future waitStorageMetricsMultipleLocations( TenantInfo const& tenantInfo, Version const& version, std::vector const& locations, StorageMetrics const& min, StorageMetrics const& max, StorageMetrics const& permittedError ) { + #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new WaitStorageMetricsMultipleLocationsActor(tenantInfo, version, locations, min, max, permittedError)); + #line 37078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 7909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 34230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via extractMetrics() - #line 7347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class ExtractMetricsActorState { - #line 34237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ExtractMetricsActorState(Future, int>> const& fMetrics) - #line 7347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : fMetrics(fMetrics) - #line 34244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("extractMetrics", reinterpret_cast(this)); @@ -34254,16 +37107,16 @@ class ExtractMetricsActorState { int a_body1(int loopDepth=0) { try { - #line 7348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture, int>> __when_expr_0 = fMetrics; - #line 7348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 34261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 7348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast, int> >*>(static_cast(this))); - #line 34266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -34284,9 +37137,9 @@ class ExtractMetricsActorState { } int a_body1cont1(std::pair, int> const& x,int loopDepth) { - #line 7349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(x.first.get()); this->~ExtractMetricsActorState(); static_cast(this)->destroy(); return 0; } - #line 34289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(x.first.get()); this->~ExtractMetricsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -34296,9 +37149,9 @@ class ExtractMetricsActorState { } int a_body1cont1(std::pair, int> && x,int loopDepth) { - #line 7349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(x.first.get()); this->~ExtractMetricsActorState(); static_cast(this)->destroy(); return 0; } - #line 34301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< StorageMetrics >::value()) StorageMetrics(x.first.get()); this->~ExtractMetricsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -34369,14 +37222,14 @@ class ExtractMetricsActorState { fdb_probe_actor_exit("extractMetrics", reinterpret_cast(this), 0); } - #line 7347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future, int>> fMetrics; - #line 34374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via extractMetrics() - #line 7347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class ExtractMetricsActor final : public Actor, public ActorCallback< ExtractMetricsActor, 0, std::pair, int> >, public FastAllocated, public ExtractMetricsActorState { - #line 34379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -34385,9 +37238,9 @@ class ExtractMetricsActor final : public Actor, public ActorCall void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ExtractMetricsActor, 0, std::pair, int> >; - #line 7347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ExtractMetricsActor(Future, int>> const& fMetrics) - #line 34390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), ExtractMetricsActorState(fMetrics) { @@ -34411,34 +37264,34 @@ friend struct ActorCallback< ExtractMetricsActor, 0, std::pair extractMetrics( Future, int>> const& fMetrics ) { - #line 7347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future(new ExtractMetricsActor(fMetrics)); - #line 34418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 7914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 34423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getReadHotRanges() - #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetReadHotRangesActorState { - #line 34430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetReadHotRangesActorState(Database const& cx,KeyRange const& keys) - #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys(keys), - #line 7353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" span("NAPI:GetReadHotRanges"_loc) - #line 34441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getReadHotRanges", reinterpret_cast(this)); @@ -34451,9 +37304,9 @@ class GetReadHotRangesActorState { int a_body1(int loopDepth=0) { try { - #line 7354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 34456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -34481,18 +37334,18 @@ class GetReadHotRangesActorState { } int a_body1loopBody1(int loopDepth) { - #line 7355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t shardLimit = 100; - #line 7357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_0 = getKeyRangeLocations(cx, Optional(), keys, shardLimit, Reverse::False, &StorageServerInterface::getReadHotRanges, span.context, Optional(), UseProvisionalProxies::False, latestVersion); - #line 7357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_0 = getKeyRangeLocations(cx, TenantInfo(), keys, shardLimit, Reverse::False, &StorageServerInterface::getReadHotRanges, span.context, Optional(), UseProvisionalProxies::False, latestVersion); + #line 7920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 34490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 7357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 34495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -34500,34 +37353,34 @@ class GetReadHotRangesActorState { int a_body1loopBody1cont1(std::vector const& locations,int loopDepth) { try { - #line 7373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" nLocs = locations.size(); - #line 7380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fReplies = std::vector>(nLocs); - #line 7381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef partBegin, partEnd; - #line 7382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" partBegin = (i == 0) ? keys.begin : locations[i].range.begin; - #line 7384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" partEnd = (i == nLocs - 1) ? keys.end : locations[i].range.end; - #line 7385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ReadHotSubRangeRequest req(KeyRangeRef(partBegin, partEnd)); - #line 7386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fReplies[i] = loadBalance(locations[i].locations->locations(), &StorageServerInterface::getReadHotRanges, req, TaskPriority::DataDistribution); - #line 34519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = waitForAll(fReplies); - #line 7392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 34525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 7392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 34530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -34541,34 +37394,34 @@ class GetReadHotRangesActorState { int a_body1loopBody1cont1(std::vector && locations,int loopDepth) { try { - #line 7373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" nLocs = locations.size(); - #line 7380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fReplies = std::vector>(nLocs); - #line 7381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef partBegin, partEnd; - #line 7382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" partBegin = (i == 0) ? keys.begin : locations[i].range.begin; - #line 7384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" partEnd = (i == nLocs - 1) ? keys.end : locations[i].range.end; - #line 7385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ReadHotSubRangeRequest req(KeyRangeRef(partBegin, partEnd)); - #line 7386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fReplies[i] = loadBalance(locations[i].locations->locations(), &StorageServerInterface::getReadHotRanges, req, TaskPriority::DataDistribution); - #line 34560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = waitForAll(fReplies); - #line 7392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 34566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 7392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 34571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -34651,28 +37504,28 @@ class GetReadHotRangesActorState { int a_body1loopBody1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 7410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() != error_code_wrong_shard_server && e.code() != error_code_all_alternatives_failed) - #line 34656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" TraceEvent(SevError, "GetReadHotSubRangesError").error(e); - #line 7412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 34662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(Key(), keys); - #line 7415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache({}, keys); + #line 7978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution); - #line 7415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 34670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 7415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 34675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -34685,15 +37538,15 @@ class GetReadHotRangesActorState { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 7394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (nLocs == 1) - #line 34690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 7396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Single-shard read hot range request"); + #line 7959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(fReplies[0].get().readHotRanges); this->~GetReadHotRangesActorState(); static_cast(this)->destroy(); return 0; } - #line 34696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(fReplies[0].get().readHotRanges); this->~GetReadHotRangesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -34701,21 +37554,21 @@ class GetReadHotRangesActorState { } else { - #line 7398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 7399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Multi-shard read hot range request"); + #line 7962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Standalone> results; - #line 7400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.append(results.arena(), fReplies[i].get().readHotRanges.begin(), fReplies[i].get().readHotRanges.size()); - #line 7404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.arena().dependsOn(fReplies[i].get().readHotRanges.arena()); - #line 34714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetReadHotRangesActorState(); static_cast(this)->destroy(); return 0; } - #line 34718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(results); this->~GetReadHotRangesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -34726,15 +37579,15 @@ class GetReadHotRangesActorState { } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 7394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (nLocs == 1) - #line 34731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 7396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Single-shard read hot range request"); + #line 7959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(fReplies[0].get().readHotRanges); this->~GetReadHotRangesActorState(); static_cast(this)->destroy(); return 0; } - #line 34737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(fReplies[0].get().readHotRanges); this->~GetReadHotRangesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -34742,21 +37595,21 @@ class GetReadHotRangesActorState { } else { - #line 7398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 7399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Multi-shard read hot range request"); + #line 7962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Standalone> results; - #line 7400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.append(results.arena(), fReplies[i].get().readHotRanges.begin(), fReplies[i].get().readHotRanges.size()); - #line 7404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.arena().dependsOn(fReplies[i].get().readHotRanges.arena()); - #line 34755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetReadHotRangesActorState(); static_cast(this)->destroy(); return 0; } - #line 34759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(results); this->~GetReadHotRangesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -34903,22 +37756,22 @@ class GetReadHotRangesActorState { fdb_probe_actor_exit("getReadHotRanges", reinterpret_cast(this), 2); } - #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange keys; - #line 7353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 7373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int nLocs; - #line 7380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector> fReplies; - #line 34916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getReadHotRanges() - #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetReadHotRangesActor final : public Actor>>, public ActorCallback< GetReadHotRangesActor, 0, std::vector >, public ActorCallback< GetReadHotRangesActor, 1, Void >, public ActorCallback< GetReadHotRangesActor, 2, Void >, public FastAllocated, public GetReadHotRangesActorState { - #line 34921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -34929,9 +37782,9 @@ class GetReadHotRangesActor final : public Actor >; friend struct ActorCallback< GetReadHotRangesActor, 1, Void >; friend struct ActorCallback< GetReadHotRangesActor, 2, Void >; - #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" GetReadHotRangesActor(Database const& cx,KeyRange const& keys) - #line 34934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor>>(), GetReadHotRangesActorState(cx, keys) { @@ -34957,44 +37810,281 @@ friend struct ActorCallback< GetReadHotRangesActor, 2, Void >; } }; } - #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" [[nodiscard]] Future>> getReadHotRanges( Database const& cx, KeyRange const& keys ) { - #line 7352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future>>(new GetReadHotRangesActor(cx, keys)); - #line 34964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 37817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 7982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 37822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via waitStorageMetricsWithLocation() + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class WaitStorageMetricsWithLocationActorState { + #line 37829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WaitStorageMetricsWithLocationActorState(TenantInfo const& tenantInfo,Version const& version,KeyRange const& keys,std::vector const& locations,StorageMetrics const& min,StorageMetrics const& max,StorageMetrics const& permittedError) + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : tenantInfo(tenantInfo), + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version), + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keys(keys), + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + locations(locations), + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + min(min), + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + max(max), + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + permittedError(permittedError) + #line 37848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("waitStorageMetricsWithLocation", reinterpret_cast(this)); + + } + ~WaitStorageMetricsWithLocationActorState() + { + fdb_probe_actor_destroy("waitStorageMetricsWithLocation", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 7990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future fx; + #line 7991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (locations.size() > 1) + #line 37865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 7992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fx = waitStorageMetricsMultipleLocations(tenantInfo, version, locations, min, max, permittedError); + #line 37869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + #line 7994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WaitMetricsRequest req(tenantInfo, version, keys, min, max); + #line 7995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fx = loadBalance(locations[0].locations->locations(), &StorageServerInterface::waitMetrics, req, TaskPriority::DataDistribution); + #line 37877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = fx; + #line 8000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 37883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 8000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 37888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~WaitStorageMetricsWithLocationActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(StorageMetrics const& x,int loopDepth) + { + #line 8001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(x); this->~WaitStorageMetricsWithLocationActorState(); static_cast(this)->destroy(); return 0; } + #line 37911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(x); + this->~WaitStorageMetricsWithLocationActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(StorageMetrics && x,int loopDepth) + { + #line 8001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(x); this->~WaitStorageMetricsWithLocationActorState(); static_cast(this)->destroy(); return 0; } + #line 37923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(x); + this->~WaitStorageMetricsWithLocationActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(StorageMetrics const& x,int loopDepth) + { + loopDepth = a_body1cont1(x, loopDepth); + + return loopDepth; + } + int a_body1when1(StorageMetrics && x,int loopDepth) + { + loopDepth = a_body1cont1(std::move(x), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WaitStorageMetricsWithLocationActor, 0, StorageMetrics >::remove(); + + } + void a_callback_fire(ActorCallback< WaitStorageMetricsWithLocationActor, 0, StorageMetrics >*,StorageMetrics const& value) + { + fdb_probe_actor_enter("waitStorageMetricsWithLocation", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitStorageMetricsWithLocation", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< WaitStorageMetricsWithLocationActor, 0, StorageMetrics >*,StorageMetrics && value) + { + fdb_probe_actor_enter("waitStorageMetricsWithLocation", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitStorageMetricsWithLocation", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< WaitStorageMetricsWithLocationActor, 0, StorageMetrics >*,Error err) + { + fdb_probe_actor_enter("waitStorageMetricsWithLocation", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitStorageMetricsWithLocation", reinterpret_cast(this), 0); + + } + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TenantInfo tenantInfo; + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange keys; + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector locations; + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageMetrics min; + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageMetrics max; + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageMetrics permittedError; + #line 38008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via waitStorageMetricsWithLocation() + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class WaitStorageMetricsWithLocationActor final : public Actor>, public ActorCallback< WaitStorageMetricsWithLocationActor, 0, StorageMetrics >, public FastAllocated, public WaitStorageMetricsWithLocationActorState { + #line 38013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< WaitStorageMetricsWithLocationActor, 0, StorageMetrics >; + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WaitStorageMetricsWithLocationActor(TenantInfo const& tenantInfo,Version const& version,KeyRange const& keys,std::vector const& locations,StorageMetrics const& min,StorageMetrics const& max,StorageMetrics const& permittedError) + #line 38024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>(), + WaitStorageMetricsWithLocationActorState(tenantInfo, version, keys, locations, min, max, permittedError) + { + fdb_probe_actor_enter("waitStorageMetricsWithLocation", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("waitStorageMetricsWithLocation"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("waitStorageMetricsWithLocation", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< WaitStorageMetricsWithLocationActor, 0, StorageMetrics >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future> waitStorageMetricsWithLocation( TenantInfo const& tenantInfo, Version const& version, KeyRange const& keys, std::vector const& locations, StorageMetrics const& min, StorageMetrics const& max, StorageMetrics const& permittedError ) { + #line 7983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>(new WaitStorageMetricsWithLocationActor(tenantInfo, version, keys, locations, min, max, permittedError)); + #line 38052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 8003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 34969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 38057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via waitStorageMetrics() - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class WaitStorageMetricsActorState { - #line 34976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 38064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WaitStorageMetricsActorState(Database const& cx,KeyRange const& keys,StorageMetrics const& min,StorageMetrics const& max,StorageMetrics const& permittedError,int const& shardLimit,int const& expectedShardCount) - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WaitStorageMetricsActorState(Database const& cx,KeyRange const& keys,StorageMetrics const& min,StorageMetrics const& max,StorageMetrics const& permittedError,int const& shardLimit,int const& expectedShardCount,Optional> const& trState) + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys(keys), - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" min(min), - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" max(max), - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" permittedError(permittedError), - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" shardLimit(shardLimit), - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" expectedShardCount(expectedShardCount), - #line 7427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState(trState), + #line 8013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" span("NAPI:WaitStorageMetrics"_loc, generateSpanID(cx->transactionTracingSample)) - #line 34997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 38087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("waitStorageMetrics", reinterpret_cast(this)); @@ -35007,9 +38097,9 @@ class WaitStorageMetricsActorState { int a_body1(int loopDepth=0) { try { - #line 7428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 35012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 38102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -35037,187 +38127,76 @@ class WaitStorageMetricsActorState { } int a_body1loopBody1(int loopDepth) { - #line 7429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_0 = getKeyRangeLocations(cx, Optional(), keys, shardLimit, Reverse::False, &StorageServerInterface::waitMetrics, span.context, Optional(), UseProvisionalProxies::False, latestVersion); - #line 7429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState.present()) + #line 38132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = trState.get()->startTransaction(); + #line 8016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 38138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 8016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 38143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont1(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + #line 8018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = trState.present() ? populateAndGetTenant(trState.get(), keys.begin) : TenantInfo(); + #line 8018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 35044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 7429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 35049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 38159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 8018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 38164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont1(std::vector const& locations,int loopDepth) + int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 7439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (expectedShardCount >= 0 && locations.size() != expectedShardCount) - #line 35058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV, int>>::futures) { (void)(std::make_pair(Optional(), locations.size())); this->~WaitStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } - #line 35062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< std::pair, int> >::value()) std::pair, int>(std::make_pair(Optional(), locations.size())); - this->~WaitStorageMetricsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 7445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (locations.size() < shardLimit) - #line 35070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - try { - #line 7447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future fx; - #line 7448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (locations.size() > 1) - #line 35077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fx = waitStorageMetricsMultipleLocations(locations, min, max, permittedError); - #line 35081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - else - { - #line 7451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WaitMetricsRequest req(keys, min, max); - #line 7452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fx = loadBalance(locations[0].locations->locations(), &StorageServerInterface::waitMetrics, req, TaskPriority::DataDistribution); - #line 35089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = fx; - #line 7457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 35095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 7457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 35100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1cont1Catch1(unknown_error(), loopDepth); - } - } - else - { - #line 7468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevWarn, "WaitStorageMetricsPenalty") .detail("Keys", keys) .detail("Limit", CLIENT_KNOBS->STORAGE_METRICS_SHARD_LIMIT) .detail("JitteredSecondsOfPenitence", CLIENT_KNOBS->STORAGE_METRICS_TOO_MANY_SHARDS_DELAY); - #line 7472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = delayJittered(CLIENT_KNOBS->STORAGE_METRICS_TOO_MANY_SHARDS_DELAY, TaskPriority::DataDistribution); - #line 7472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 35117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when2(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 7472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 35122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont1(std::vector && locations,int loopDepth) + int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 7439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (expectedShardCount >= 0 && locations.size() != expectedShardCount) - #line 35132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV, int>>::futures) { (void)(std::make_pair(Optional(), locations.size())); this->~WaitStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } - #line 35136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< std::pair, int> >::value()) std::pair, int>(std::make_pair(Optional(), locations.size())); - this->~WaitStorageMetricsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 7445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (locations.size() < shardLimit) - #line 35144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - try { - #line 7447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future fx; - #line 7448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (locations.size() > 1) - #line 35151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fx = waitStorageMetricsMultipleLocations(locations, min, max, permittedError); - #line 35155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - else - { - #line 7451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WaitMetricsRequest req(keys, min, max); - #line 7452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fx = loadBalance(locations[0].locations->locations(), &StorageServerInterface::waitMetrics, req, TaskPriority::DataDistribution); - #line 35163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = fx; - #line 7457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 35169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 7457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 35174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1cont1Catch1(unknown_error(), loopDepth); - } - } - else - { - #line 7468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevWarn, "WaitStorageMetricsPenalty") .detail("Keys", keys) .detail("Limit", CLIENT_KNOBS->STORAGE_METRICS_SHARD_LIMIT) .detail("JitteredSecondsOfPenitence", CLIENT_KNOBS->STORAGE_METRICS_TOO_MANY_SHARDS_DELAY); - #line 7472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = delayJittered(CLIENT_KNOBS->STORAGE_METRICS_TOO_MANY_SHARDS_DELAY, TaskPriority::DataDistribution); - #line 7472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 35191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when2(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 7472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 35196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1when1(std::vector const& locations,int loopDepth) + int a_body1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(locations, loopDepth); + loopDepth = a_body1loopBody1cont2(_, loopDepth); return loopDepth; } - int a_body1loopBody1when1(std::vector && locations,int loopDepth) + int a_body1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(std::move(locations), loopDepth); + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WaitStorageMetricsActor, 0, std::vector >::remove(); + static_cast(this)->ActorCallback< WaitStorageMetricsActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 0, std::vector >*,std::vector const& value) + void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 0, Void >*,Void const& value) { fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 0); a_exitChoose1(); @@ -35232,7 +38211,7 @@ class WaitStorageMetricsActorState { fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 0, std::vector >*,std::vector && value) + void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 0, Void >*,Void && value) { fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 0); a_exitChoose1(); @@ -35247,7 +38226,7 @@ class WaitStorageMetricsActorState { fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< WaitStorageMetricsActor, 0, std::vector >*,Error err) + void a_callback_error(ActorCallback< WaitStorageMetricsActor, 0, Void >*,Error err) { fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 0); a_exitChoose1(); @@ -35262,96 +38241,47 @@ class WaitStorageMetricsActorState { fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 0); } - int a_body1loopBody1cont2(int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1cont4(int loopDepth) - { - loopDepth = a_body1loopBody1cont2(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 7460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() != error_code_wrong_shard_server && e.code() != error_code_all_alternatives_failed) - #line 35282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevError, "WaitStorageMetricsError").error(e); - #line 7462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 35288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(Key(), keys); - #line 7465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution); - #line 7465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 35296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 7465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 35301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - int a_body1loopBody1cont5(StorageMetrics const& x,int loopDepth) - { - #line 7458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV, int>>::futures) { (void)(std::make_pair(x, -1)); this->~WaitStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } - #line 35316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< std::pair, int> >::value()) std::pair, int>(std::make_pair(x, -1)); - this->~WaitStorageMetricsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont5(StorageMetrics && x,int loopDepth) + int a_body1loopBody1cont3(int loopDepth) { - #line 7458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV, int>>::futures) { (void)(std::make_pair(x, -1)); this->~WaitStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } - #line 35328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< std::pair, int> >::value()) std::pair, int>(std::make_pair(x, -1)); - this->~WaitStorageMetricsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 8020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version = trState.present() ? trState.get()->readVersion() : latestVersion; + #line 8021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_2 = getKeyRangeLocations(cx, tenantInfo, keys, shardLimit, Reverse::False, &StorageServerInterface::waitMetrics, span.context, Optional(), UseProvisionalProxies::False, version); + #line 8021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 38252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 8021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 38257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont1when1(StorageMetrics const& x,int loopDepth) + int a_body1loopBody1cont1when1(TenantInfo const& __tenantInfo,int loopDepth) { - loopDepth = a_body1loopBody1cont5(x, loopDepth); + #line 8018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantInfo = __tenantInfo; + #line 38266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } - int a_body1loopBody1cont1when1(StorageMetrics && x,int loopDepth) + int a_body1loopBody1cont1when1(TenantInfo && __tenantInfo,int loopDepth) { - loopDepth = a_body1loopBody1cont5(std::move(x), loopDepth); + tenantInfo = std::move(__tenantInfo); + loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } void a_exitChoose2() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WaitStorageMetricsActor, 1, StorageMetrics >::remove(); + static_cast(this)->ActorCallback< WaitStorageMetricsActor, 1, TenantInfo >::remove(); } - void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 1, StorageMetrics >*,StorageMetrics const& value) + void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 1, TenantInfo >*,TenantInfo const& value) { fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 1); a_exitChoose2(); @@ -35359,14 +38289,14 @@ class WaitStorageMetricsActorState { a_body1loopBody1cont1when1(value, 0); } catch (Error& error) { - a_body1loopBody1cont1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1cont1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 1, StorageMetrics >*,StorageMetrics && value) + void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 1, TenantInfo >*,TenantInfo && value) { fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 1); a_exitChoose2(); @@ -35374,64 +38304,95 @@ class WaitStorageMetricsActorState { a_body1loopBody1cont1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1cont1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1cont1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< WaitStorageMetricsActor, 1, StorageMetrics >*,Error err) + void a_callback_error(ActorCallback< WaitStorageMetricsActor, 1, TenantInfo >*,Error err) { fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1cont1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1cont1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1cont1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 1); } - int a_body1loopBody1cont1Catch1cont1(Void const& _,int loopDepth) + int a_body1loopBody1cont4(int loopDepth) { - loopDepth = a_body1loopBody1cont4(loopDepth); + #line 8032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (expectedShardCount >= 0 && locations.size() != expectedShardCount) + #line 38333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV, int>>::futures) { (void)(std::make_pair(Optional(), locations.size())); this->~WaitStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } + #line 38337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< std::pair, int> >::value()) std::pair, int>(std::make_pair(Optional(), locations.size())); + this->~WaitStorageMetricsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 8038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (locations.size() >= shardLimit) + #line 38345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevWarn, "WaitStorageMetricsPenalty") .detail("Keys", keys) .detail("Limit", shardLimit) .detail("LocationSize", locations.size()) .detail("JitteredSecondsOfPenitence", CLIENT_KNOBS->STORAGE_METRICS_TOO_MANY_SHARDS_DELAY); + #line 8044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = delayJittered(CLIENT_KNOBS->STORAGE_METRICS_TOO_MANY_SHARDS_DELAY, TaskPriority::DataDistribution); + #line 8044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 38353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 8044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 38358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont5(loopDepth); + } return loopDepth; } - int a_body1loopBody1cont1Catch1cont1(Void && _,int loopDepth) + int a_body1loopBody1cont3when1(std::vector const& __locations,int loopDepth) { + #line 8021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + locations = __locations; + #line 38372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopBody1cont4(loopDepth); return loopDepth; } - int a_body1loopBody1cont1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1Catch1when1(Void && _,int loopDepth) + int a_body1loopBody1cont3when1(std::vector && __locations,int loopDepth) { - loopDepth = a_body1loopBody1cont1Catch1cont1(std::move(_), loopDepth); + locations = std::move(__locations); + loopDepth = a_body1loopBody1cont4(loopDepth); return loopDepth; } void a_exitChoose3() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WaitStorageMetricsActor, 2, Void >::remove(); + static_cast(this)->ActorCallback< WaitStorageMetricsActor, 2, std::vector >::remove(); } - void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 2, std::vector >*,std::vector const& value) { fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont1Catch1when1(value, 0); + a_body1loopBody1cont3when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -35441,12 +38402,12 @@ class WaitStorageMetricsActorState { fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 2, std::vector >*,std::vector && value) { fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont1Catch1when1(std::move(value), 0); + a_body1loopBody1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -35456,7 +38417,7 @@ class WaitStorageMetricsActorState { fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< WaitStorageMetricsActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< WaitStorageMetricsActor, 2, std::vector >*,Error err) { fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 2); a_exitChoose3(); @@ -35471,33 +38432,56 @@ class WaitStorageMetricsActorState { fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 2); } - int a_body1loopBody1cont9(Void const& _,int loopDepth) + int a_body1loopBody1cont5(int loopDepth) { - #line 7474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(Key(), keys); - #line 35478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont2(loopDepth); + try { + #line 8051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_4 = waitStorageMetricsWithLocation(tenantInfo, version, keys, locations, min, max, permittedError); + #line 8051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont5Catch1(actor_cancelled(), loopDepth); + #line 38442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1cont5Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 8051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 38447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1cont5Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1cont5Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1loopBody1cont9(Void && _,int loopDepth) + int a_body1loopBody1cont7(Void const& _,int loopDepth) { - #line 7474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(Key(), keys); - #line 35487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont2(loopDepth); + #line 8046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache(tenantInfo.prefix, keys); + #line 38462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return a_body1loopHead1(loopDepth); // continue return loopDepth; } - int a_body1loopBody1cont1when2(Void const& _,int loopDepth) + int a_body1loopBody1cont7(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont9(_, loopDepth); + #line 8046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache(tenantInfo.prefix, keys); + #line 38471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return a_body1loopHead1(loopDepth); // continue return loopDepth; } - int a_body1loopBody1cont1when2(Void && _,int loopDepth) + int a_body1loopBody1cont4when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont9(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont7(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont7(std::move(_), loopDepth); return loopDepth; } @@ -35512,7 +38496,7 @@ class WaitStorageMetricsActorState { fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1loopBody1cont1when2(value, 0); + a_body1loopBody1cont4when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -35527,7 +38511,7 @@ class WaitStorageMetricsActorState { fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1loopBody1cont1when2(std::move(value), 0); + a_body1loopBody1cont4when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -35552,28 +38536,377 @@ class WaitStorageMetricsActorState { fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 3); } - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int a_body1loopBody1cont9(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont5Catch1(const Error& e,int loopDepth=0) + { + try { + #line 8057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "WaitStorageMetricsHandleError").error(e); + #line 8058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) + #line 38552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache(tenantInfo.prefix, keys); + #line 8060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_5 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution); + #line 8060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 38560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont5Catch1when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 8060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 38565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 8061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_future_version) + #line 38572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_6 = delay(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, TaskPriority::DataDistribution); + #line 8062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 38578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont5Catch1when2(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 8062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 38583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 8064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool ok = e.code() == error_code_tenant_not_found; + #line 8065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(ok ? SevInfo : SevError, "WaitStorageMetricsError").error(e); + #line 8066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 38594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont10(Optional const& res,int loopDepth) + { + #line 8053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.present()) + #line 38610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV, int>>::futures) { (void)(std::make_pair(res, -1)); this->~WaitStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } + #line 38614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< std::pair, int> >::value()) std::pair, int>(std::make_pair(res, -1)); + this->~WaitStorageMetricsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1loopBody1cont10cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont10(Optional && res,int loopDepth) + { + #line 8053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.present()) + #line 38628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV, int>>::futures) { (void)(std::make_pair(res, -1)); this->~WaitStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } + #line 38632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< std::pair, int> >::value()) std::pair, int>(std::make_pair(res, -1)); + this->~WaitStorageMetricsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1loopBody1cont10cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5when1(Optional const& res,int loopDepth) + { + loopDepth = a_body1loopBody1cont10(res, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5when1(Optional && res,int loopDepth) + { + loopDepth = a_body1loopBody1cont10(std::move(res), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WaitStorageMetricsActor, 4, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 4, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont5when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1cont5Catch1(error, 0); + } catch (...) { + a_body1loopBody1cont5Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 4, Optional >*,Optional && value) + { + fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont5when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1cont5Catch1(error, 0); + } catch (...) { + a_body1loopBody1cont5Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< WaitStorageMetricsActor, 4, Optional >*,Error err) + { + fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont5Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1cont5Catch1(error, 0); + } catch (...) { + a_body1loopBody1cont5Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 4); + + } + int a_body1loopBody1cont10cont3(int loopDepth) + { + try { + loopDepth = a_body1loopBody1cont9(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont5Catch1cont1(int loopDepth) + { + loopDepth = a_body1loopBody1cont9(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5Catch1cont2(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont5Catch1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5Catch1cont2(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont5Catch1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont5Catch1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont5Catch1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WaitStorageMetricsActor, 5, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1loopBody1cont5Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 5, Void >*,Void && value) + { + fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1loopBody1cont5Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< WaitStorageMetricsActor, 5, Void >*,Error err) + { + fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 5); + + } + int a_body1loopBody1cont5Catch1cont3(int loopDepth) + { + loopDepth = a_body1loopBody1cont5Catch1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5Catch1cont4(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont5Catch1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5Catch1cont4(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont5Catch1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5Catch1when2(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont5Catch1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5Catch1when2(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont5Catch1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose7() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WaitStorageMetricsActor, 6, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 6, Void >*,Void const& value) + { + fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1loopBody1cont5Catch1when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 6); + + } + void a_callback_fire(ActorCallback< WaitStorageMetricsActor, 6, Void >*,Void && value) + { + fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1loopBody1cont5Catch1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 6); + + } + void a_callback_error(ActorCallback< WaitStorageMetricsActor, 6, Void >*,Error err) + { + fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitStorageMetrics", reinterpret_cast(this), 6); + + } + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange keys; - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StorageMetrics min; - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StorageMetrics max; - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StorageMetrics permittedError; - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int shardLimit; - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int expectedShardCount; - #line 7427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional> trState; + #line 8013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 35571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TenantInfo tenantInfo; + #line 8020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 8021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector locations; + #line 38904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via waitStorageMetrics() - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class WaitStorageMetricsActor final : public Actor, int>>, public ActorCallback< WaitStorageMetricsActor, 0, std::vector >, public ActorCallback< WaitStorageMetricsActor, 1, StorageMetrics >, public ActorCallback< WaitStorageMetricsActor, 2, Void >, public ActorCallback< WaitStorageMetricsActor, 3, Void >, public FastAllocated, public WaitStorageMetricsActorState { - #line 35576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class WaitStorageMetricsActor final : public Actor, int>>, public ActorCallback< WaitStorageMetricsActor, 0, Void >, public ActorCallback< WaitStorageMetricsActor, 1, TenantInfo >, public ActorCallback< WaitStorageMetricsActor, 2, std::vector >, public ActorCallback< WaitStorageMetricsActor, 3, Void >, public ActorCallback< WaitStorageMetricsActor, 4, Optional >, public ActorCallback< WaitStorageMetricsActor, 5, Void >, public ActorCallback< WaitStorageMetricsActor, 6, Void >, public FastAllocated, public WaitStorageMetricsActorState { + #line 38909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -35581,15 +38914,18 @@ class WaitStorageMetricsActor final : public Actor, int>>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< WaitStorageMetricsActor, 0, std::vector >; -friend struct ActorCallback< WaitStorageMetricsActor, 1, StorageMetrics >; -friend struct ActorCallback< WaitStorageMetricsActor, 2, Void >; +friend struct ActorCallback< WaitStorageMetricsActor, 0, Void >; +friend struct ActorCallback< WaitStorageMetricsActor, 1, TenantInfo >; +friend struct ActorCallback< WaitStorageMetricsActor, 2, std::vector >; friend struct ActorCallback< WaitStorageMetricsActor, 3, Void >; - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WaitStorageMetricsActor(Database const& cx,KeyRange const& keys,StorageMetrics const& min,StorageMetrics const& max,StorageMetrics const& permittedError,int const& shardLimit,int const& expectedShardCount) - #line 35590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +friend struct ActorCallback< WaitStorageMetricsActor, 4, Optional >; +friend struct ActorCallback< WaitStorageMetricsActor, 5, Void >; +friend struct ActorCallback< WaitStorageMetricsActor, 6, Void >; + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WaitStorageMetricsActor(Database const& cx,KeyRange const& keys,StorageMetrics const& min,StorageMetrics const& max,StorageMetrics const& permittedError,int const& shardLimit,int const& expectedShardCount,Optional> const& trState) + #line 38926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor, int>>(), - WaitStorageMetricsActorState(cx, keys, min, max, permittedError, shardLimit, expectedShardCount) + WaitStorageMetricsActorState(cx, keys, min, max, permittedError, shardLimit, expectedShardCount, trState) { fdb_probe_actor_enter("waitStorageMetrics", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -35605,23 +38941,26 @@ friend struct ActorCallback< WaitStorageMetricsActor, 3, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< WaitStorageMetricsActor, 0, std::vector >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< WaitStorageMetricsActor, 1, StorageMetrics >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< WaitStorageMetricsActor, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< WaitStorageMetricsActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WaitStorageMetricsActor, 1, TenantInfo >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< WaitStorageMetricsActor, 2, std::vector >*)0, actor_cancelled()); break; case 4: this->a_callback_error((ActorCallback< WaitStorageMetricsActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< WaitStorageMetricsActor, 4, Optional >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< WaitStorageMetricsActor, 5, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< WaitStorageMetricsActor, 6, Void >*)0, actor_cancelled()); break; } } }; } - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future, int>> waitStorageMetrics( Database const& cx, KeyRange const& keys, StorageMetrics const& min, StorageMetrics const& max, StorageMetrics const& permittedError, int const& shardLimit, int const& expectedShardCount ) { - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future, int>>(new WaitStorageMetricsActor(cx, keys, min, max, permittedError, shardLimit, expectedShardCount)); - #line 35621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future, int>> waitStorageMetrics( Database const& cx, KeyRange const& keys, StorageMetrics const& min, StorageMetrics const& max, StorageMetrics const& permittedError, int const& shardLimit, int const& expectedShardCount, Optional> const& trState ) { + #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future, int>>(new WaitStorageMetricsActor(cx, keys, min, max, permittedError, shardLimit, expectedShardCount, trState)); + #line 38960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 8071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future, int>> DatabaseContext::waitStorageMetrics( KeyRange const& keys, @@ -35629,17 +38968,21 @@ Future, int>> DatabaseContext::waitStorageMet StorageMetrics const& max, StorageMetrics const& permittedError, int shardLimit, - int expectedShardCount) { + int expectedShardCount, + Optional> trState) { return ::waitStorageMetrics(Database(Reference::addRef(this)), keys, min, max, permittedError, shardLimit, - expectedShardCount); + expectedShardCount, + trState); } -Future DatabaseContext::getStorageMetrics(KeyRange const& keys, int shardLimit) { +Future DatabaseContext::getStorageMetrics(KeyRange const& keys, + int shardLimit, + Optional> trState) { if (shardLimit > 0) { StorageMetrics m; m.bytes = -1; @@ -35649,31 +38992,32 @@ Future DatabaseContext::getStorageMetrics(KeyRange const& keys, m, StorageMetrics(), shardLimit, - -1)); + -1, + trState)); } else { - return ::getStorageMetricsLargeKeyRange(Database(Reference::addRef(this)), keys); + return ::getStorageMetricsLargeKeyRange(Database(Reference::addRef(this)), keys, trState); } } - #line 35658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via waitDataDistributionMetricsList() - #line 7511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class WaitDataDistributionMetricsListActorState { - #line 35665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" WaitDataDistributionMetricsListActorState(Database const& cx,KeyRange const& keys,int const& shardLimit) - #line 7511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 7511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys(keys), - #line 7511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" shardLimit(shardLimit) - #line 35676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("waitDataDistributionMetricsList", reinterpret_cast(this)); @@ -35686,9 +39030,9 @@ class WaitDataDistributionMetricsListActorState { int a_body1(int loopDepth=0) { try { - #line 7514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 35691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -35716,22 +39060,22 @@ class WaitDataDistributionMetricsListActorState { } int a_body1loopBody1(int loopDepth) { - #line 7516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = cx->onProxiesChanged(); - #line 7515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 35723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 7517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture> __when_expr_1 = errorOr(basicLoadBalance(cx->getCommitProxies(UseProvisionalProxies::False), &CommitProxyInterface::getDDMetrics, GetDDMetricsRequest(keys, shardLimit))); - #line 35727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 7516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 35734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -35756,17 +39100,17 @@ class WaitDataDistributionMetricsListActorState { } int a_body1loopBody1when2(ErrorOr const& rep,int loopDepth) { - #line 7521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (rep.isError()) - #line 35761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(rep.getError(), std::max(0, loopDepth - 1)); - #line 35765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(rep.get().storageMetricsList); this->~WaitDataDistributionMetricsListActorState(); static_cast(this)->destroy(); return 0; } - #line 35769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(rep.get().storageMetricsList); this->~WaitDataDistributionMetricsListActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -35776,17 +39120,17 @@ class WaitDataDistributionMetricsListActorState { } int a_body1loopBody1when2(ErrorOr && rep,int loopDepth) { - #line 7521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (rep.isError()) - #line 35781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(rep.getError(), std::max(0, loopDepth - 1)); - #line 35785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(rep.get().storageMetricsList); this->~WaitDataDistributionMetricsListActorState(); static_cast(this)->destroy(); return 0; } - #line 35789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(rep.get().storageMetricsList); this->~WaitDataDistributionMetricsListActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -35891,18 +39235,18 @@ class WaitDataDistributionMetricsListActorState { fdb_probe_actor_exit("waitDataDistributionMetricsList", reinterpret_cast(this), 1); } - #line 7511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 7511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange keys; - #line 7511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int shardLimit; - #line 35900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via waitDataDistributionMetricsList() - #line 7511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class WaitDataDistributionMetricsListActor final : public Actor>>, public ActorCallback< WaitDataDistributionMetricsListActor, 0, Void >, public ActorCallback< WaitDataDistributionMetricsListActor, 1, ErrorOr >, public FastAllocated, public WaitDataDistributionMetricsListActorState { - #line 35905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -35912,9 +39256,9 @@ class WaitDataDistributionMetricsListActor final : public Actor; friend struct ActorCallback< WaitDataDistributionMetricsListActor, 1, ErrorOr >; - #line 7511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" WaitDataDistributionMetricsListActor(Database const& cx,KeyRange const& keys,int const& shardLimit) - #line 35917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor>>(), WaitDataDistributionMetricsListActorState(cx, keys, shardLimit) { @@ -35938,42 +39282,40 @@ friend struct ActorCallback< WaitDataDistributionMetricsListActor, 1, ErrorOr>> waitDataDistributionMetricsList( Database const& cx, KeyRange const& keys, int const& shardLimit ) { - #line 7511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return Future>>(new WaitDataDistributionMetricsListActor(cx, keys, shardLimit)); - #line 35945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 8127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future>> DatabaseContext::getReadHotRanges(KeyRange const& keys) { return ::getReadHotRanges(Database(Reference::addRef(this)), keys); } - #line 35954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getRangeSplitPoints() - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetRangeSplitPointsActorState { - #line 35961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetRangeSplitPointsActorState(Reference const& trState,KeyRange const& keys,int64_t const& chunkSize,Version const& version) - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetRangeSplitPointsActorState(Reference const& trState,KeyRange const& keys,int64_t const& chunkSize) + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : trState(trState), - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keys(keys), - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" chunkSize(chunkSize), - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version(version), - #line 7538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:GetRangeSplitPoints"_loc, trState->spanID) - #line 35976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:GetRangeSplitPoints"_loc, trState->spanContext) + #line 39318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getRangeSplitPoints", reinterpret_cast(this)); @@ -35986,10 +39328,26 @@ class GetRangeSplitPointsActorState { int a_body1(int loopDepth=0) { try { - #line 7540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 35991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); + #line 8137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (trState->hasTenant()) + #line 39333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = trState->startTransaction(); + #line 8138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 39339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 8138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 39344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -36007,126 +39365,210 @@ class GetRangeSplitPointsActorState { return loopDepth; } - int a_body1loopHead1(int loopDepth) + int a_body1cont1(int loopDepth) + { + #line 8141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 39372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetRangeSplitPointsActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetRangeSplitPointsActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetRangeSplitPointsActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetRangeSplitPointsActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 0); + + } + int a_body1cont1loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); return loopDepth; } - int a_body1loopBody1(int loopDepth) + int a_body1cont1loopBody1(int loopDepth) { - #line 7541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_0 = getKeyRangeLocations(trState, keys, CLIENT_KNOBS->TOO_MANY, Reverse::False, &StorageServerInterface::getRangeSplitPoints, UseTenant::True, version); - #line 7541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_1 = getKeyRangeLocations(trState, keys, CLIENT_KNOBS->TOO_MANY, Reverse::False, &StorageServerInterface::getRangeSplitPoints, UseTenant::True); + #line 8142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 36023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 7541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 36028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 8142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 39470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) + int a_body1cont1loopBody1cont1(int loopDepth) { try { - #line 7550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" nLocs = locations.size(); - #line 7551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fReplies = std::vector>(nLocs); - #line 7552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRef partBegin, partEnd; - #line 7553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" partBegin = (i == 0) ? keys.begin : locations[i].range.begin; - #line 7555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" partEnd = (i == nLocs - 1) ? keys.end : locations[i].range.end; - #line 7556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" SplitRangeRequest req(trState->getTenantInfo(), KeyRangeRef(partBegin, partEnd), chunkSize); - #line 7557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fReplies[i] = loadBalance(locations[i].locations->locations(), &StorageServerInterface::getRangeSplitPoints, req, TaskPriority::DataDistribution); - #line 36052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = waitForAll(fReplies); - #line 7563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 36058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 7563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 36063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = waitForAll(fReplies); + #line 8163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont1Catch1(actor_cancelled(), loopDepth); + #line 39500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 8163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 39505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1loopBody1cont1Catch1(error, loopDepth); + loopDepth = a_body1cont1loopBody1cont1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1loopBody1cont1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1cont1loopBody1cont1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1loopBody1when1(std::vector const& __locations,int loopDepth) + int a_body1cont1loopBody1when1(std::vector const& __locations,int loopDepth) { - #line 7541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" locations = __locations; - #line 36078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 39520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1when1(std::vector && __locations,int loopDepth) + int a_body1cont1loopBody1when1(std::vector && __locations,int loopDepth) { locations = std::move(__locations); - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose2() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRangeSplitPointsActor, 0, std::vector >::remove(); + static_cast(this)->ActorCallback< GetRangeSplitPointsActor, 1, std::vector >::remove(); } - void a_callback_fire(ActorCallback< GetRangeSplitPointsActor, 0, std::vector >*,std::vector const& value) + void a_callback_fire(ActorCallback< GetRangeSplitPointsActor, 1, std::vector >*,std::vector const& value) { - fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when1(value, 0); + a_body1cont1loopBody1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< GetRangeSplitPointsActor, 0, std::vector >*,std::vector && value) + void a_callback_fire(ActorCallback< GetRangeSplitPointsActor, 1, std::vector >*,std::vector && value) { - fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1cont1loopBody1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< GetRangeSplitPointsActor, 0, std::vector >*,Error err) + void a_callback_error(ActorCallback< GetRangeSplitPointsActor, 1, std::vector >*,Error err) { - fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -36135,66 +39577,43 @@ class GetRangeSplitPointsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 1); } - int a_body1loopBody1cont2(int loopDepth) + int a_body1cont1loopBody1cont2(int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); + if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; } - int a_body1loopBody1cont1Catch1(const Error& e,int loopDepth=0) + int a_body1cont1loopBody1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 7584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) - #line 36152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->invalidateCache(locations[0].tenantEntry.prefix, keys); - #line 7586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution); - #line 7586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + trState->cx->invalidateCache(trState->tenant().mapRef(&Tenant::prefix), keys); + #line 8186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution); + #line 8186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 36160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 7586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 36165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 8186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 39607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - #line 7587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_unknown_tenant) - #line 36172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(trState->tenant().present()); - #line 7589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - trState->cx->invalidateCachedTenant(trState->tenant().get()); - #line 7590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = delay(CLIENT_KNOBS->UNKNOWN_TENANT_RETRY_DELAY, trState->taskID); - #line 7590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 36182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when2(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 7590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 36187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 7592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevError, "GetRangeSplitPoints").error(e); - #line 7593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 36196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } + #line 8188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevError, "GetRangeSplitPoints").error(e); + #line 8189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 39616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } catch (Error& error) { @@ -36205,44 +39624,44 @@ class GetRangeSplitPointsActorState { return loopDepth; } - int a_body1loopBody1cont3(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont3(Void const& _,int loopDepth) { - #line 7564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Standalone> results; - #line 7566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.push_back_deep(results.arena(), keys.begin); - #line 7567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (i > 0) - #line 36218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.push_back_deep(results.arena(), locations[i].range.begin); - #line 36222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (fReplies[i].get().splitPoints.size() > 0) - #line 36226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.append( results.arena(), fReplies[i].get().splitPoints.begin(), fReplies[i].get().splitPoints.size()); - #line 7575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.arena().dependsOn(fReplies[i].get().splitPoints.arena()); - #line 36232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 7578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (results.back() != keys.end) - #line 36237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.push_back_deep(results.arena(), keys.end); - #line 36241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetRangeSplitPointsActorState(); static_cast(this)->destroy(); return 0; } - #line 36245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(results); this->~GetRangeSplitPointsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -36250,44 +39669,44 @@ class GetRangeSplitPointsActorState { return loopDepth; } - int a_body1loopBody1cont3(Void && _,int loopDepth) + int a_body1cont1loopBody1cont3(Void && _,int loopDepth) { - #line 7564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Standalone> results; - #line 7566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.push_back_deep(results.arena(), keys.begin); - #line 7567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for(int i = 0;i < nLocs;i++) { - #line 7568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (i > 0) - #line 36263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.push_back_deep(results.arena(), locations[i].range.begin); - #line 36267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (fReplies[i].get().splitPoints.size() > 0) - #line 36271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.append( results.arena(), fReplies[i].get().splitPoints.begin(), fReplies[i].get().splitPoints.size()); - #line 7575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.arena().dependsOn(fReplies[i].get().splitPoints.arena()); - #line 36277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } } - #line 7578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (results.back() != keys.end) - #line 36282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.push_back_deep(results.arena(), keys.end); - #line 36286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetRangeSplitPointsActorState(); static_cast(this)->destroy(); return 0; } - #line 36290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(results); this->~GetRangeSplitPointsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -36295,96 +39714,15 @@ class GetRangeSplitPointsActorState { return loopDepth; } - int a_body1loopBody1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRangeSplitPointsActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GetRangeSplitPointsActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont1when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1cont1Catch1(error, 0); - } catch (...) { - a_body1loopBody1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< GetRangeSplitPointsActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1cont1Catch1(error, 0); - } catch (...) { - a_body1loopBody1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< GetRangeSplitPointsActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1cont1Catch1(error, 0); - } catch (...) { - a_body1loopBody1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 1); - - } - int a_body1loopBody1cont1Catch1cont1(int loopDepth) - { - loopDepth = a_body1loopBody1cont2(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1Catch1cont2(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1Catch1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1Catch1cont2(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1Catch1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1Catch1when1(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1Catch1cont2(_, loopDepth); + loopDepth = a_body1cont1loopBody1cont3(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont1Catch1when1(Void && _,int loopDepth) + int a_body1cont1loopBody1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1Catch1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont1loopBody1cont3(std::move(_), loopDepth); return loopDepth; } @@ -36399,12 +39737,12 @@ class GetRangeSplitPointsActorState { fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont1Catch1when1(value, 0); + a_body1cont1loopBody1cont1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont1loopBody1cont1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont1loopBody1cont1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 2); @@ -36414,12 +39752,12 @@ class GetRangeSplitPointsActorState { fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont1Catch1when1(std::move(value), 0); + a_body1cont1loopBody1cont1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont1loopBody1cont1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont1loopBody1cont1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 2); @@ -36429,43 +39767,43 @@ class GetRangeSplitPointsActorState { fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1Catch1(err, 0); + a_body1cont1loopBody1cont1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont1loopBody1cont1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont1loopBody1cont1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 2); } - int a_body1loopBody1cont1Catch1cont3(int loopDepth) + int a_body1cont1loopBody1cont1Catch1cont1(int loopDepth) { - loopDepth = a_body1loopBody1cont1Catch1cont1(loopDepth); + loopDepth = a_body1cont1loopBody1cont2(loopDepth); return loopDepth; } - int a_body1loopBody1cont1Catch1cont4(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont1Catch1cont2(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1Catch1cont3(loopDepth); + loopDepth = a_body1cont1loopBody1cont1Catch1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont1Catch1cont4(Void && _,int loopDepth) + int a_body1cont1loopBody1cont1Catch1cont2(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1Catch1cont3(loopDepth); + loopDepth = a_body1cont1loopBody1cont1Catch1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont1Catch1when2(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1Catch1cont4(_, loopDepth); + loopDepth = a_body1cont1loopBody1cont1Catch1cont2(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont1Catch1when2(Void && _,int loopDepth) + int a_body1cont1loopBody1cont1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1Catch1cont4(std::move(_), loopDepth); + loopDepth = a_body1cont1loopBody1cont1Catch1cont2(std::move(_), loopDepth); return loopDepth; } @@ -36480,7 +39818,7 @@ class GetRangeSplitPointsActorState { fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1loopBody1cont1Catch1when2(value, 0); + a_body1cont1loopBody1cont1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -36495,7 +39833,7 @@ class GetRangeSplitPointsActorState { fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1loopBody1cont1Catch1when2(std::move(value), 0); + a_body1cont1loopBody1cont1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -36520,28 +39858,26 @@ class GetRangeSplitPointsActorState { fdb_probe_actor_exit("getRangeSplitPoints", reinterpret_cast(this), 3); } - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference trState; - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange keys; - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int64_t chunkSize; - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 7538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 7541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector locations; - #line 7550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int nLocs; - #line 7551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector> fReplies; - #line 36539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getRangeSplitPoints() - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetRangeSplitPointsActor final : public Actor>>, public ActorCallback< GetRangeSplitPointsActor, 0, std::vector >, public ActorCallback< GetRangeSplitPointsActor, 1, Void >, public ActorCallback< GetRangeSplitPointsActor, 2, Void >, public ActorCallback< GetRangeSplitPointsActor, 3, Void >, public FastAllocated, public GetRangeSplitPointsActorState { - #line 36544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetRangeSplitPointsActor final : public Actor>>, public ActorCallback< GetRangeSplitPointsActor, 0, Void >, public ActorCallback< GetRangeSplitPointsActor, 1, std::vector >, public ActorCallback< GetRangeSplitPointsActor, 2, Void >, public ActorCallback< GetRangeSplitPointsActor, 3, Void >, public FastAllocated, public GetRangeSplitPointsActorState { + #line 39880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -36549,15 +39885,15 @@ class GetRangeSplitPointsActor final : public Actor #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetRangeSplitPointsActor, 0, std::vector >; -friend struct ActorCallback< GetRangeSplitPointsActor, 1, Void >; +friend struct ActorCallback< GetRangeSplitPointsActor, 0, Void >; +friend struct ActorCallback< GetRangeSplitPointsActor, 1, std::vector >; friend struct ActorCallback< GetRangeSplitPointsActor, 2, Void >; friend struct ActorCallback< GetRangeSplitPointsActor, 3, Void >; - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetRangeSplitPointsActor(Reference const& trState,KeyRange const& keys,int64_t const& chunkSize,Version const& version) - #line 36558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetRangeSplitPointsActor(Reference const& trState,KeyRange const& keys,int64_t const& chunkSize) + #line 39894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor>>(), - GetRangeSplitPointsActorState(trState, keys, chunkSize, version) + GetRangeSplitPointsActorState(trState, keys, chunkSize) { fdb_probe_actor_enter("getRangeSplitPoints", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -36573,8 +39909,8 @@ friend struct ActorCallback< GetRangeSplitPointsActor, 3, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetRangeSplitPointsActor, 0, std::vector >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetRangeSplitPointsActor, 1, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetRangeSplitPointsActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetRangeSplitPointsActor, 1, std::vector >*)0, actor_cancelled()); break; case 3: this->a_callback_error((ActorCallback< GetRangeSplitPointsActor, 2, Void >*)0, actor_cancelled()); break; case 4: this->a_callback_error((ActorCallback< GetRangeSplitPointsActor, 3, Void >*)0, actor_cancelled()); break; } @@ -36582,45 +39918,46 @@ friend struct ActorCallback< GetRangeSplitPointsActor, 3, Void >; } }; } - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future>> getRangeSplitPoints( Reference const& trState, KeyRange const& keys, int64_t const& chunkSize, Version const& version ) { - #line 7534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future>>(new GetRangeSplitPointsActor(trState, keys, chunkSize, version)); - #line 36589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future>> getRangeSplitPoints( Reference const& trState, KeyRange const& keys, int64_t const& chunkSize ) { + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new GetRangeSplitPointsActor(trState, keys, chunkSize)); + #line 39925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 8194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future>> Transaction::getRangeSplitPoints(KeyRange const& keys, int64_t chunkSize) { - return ::getRangeSplitPoints( - trState, keys, chunkSize, readVersion.isValid() && readVersion.isReady() ? readVersion.get() : latestVersion); + return ::getRangeSplitPoints(trState, keys, chunkSize); } #define BG_REQUEST_DEBUG false -// the blob granule requests are a bit funky because they piggyback off the existing transaction to read from the system -// keyspace - #line 36603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via getBlobGranuleRangesActor() - #line 7608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class GetBlobGranuleRangesActorActorState { - #line 36610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetBlobGranuleRangesActorActorState(Transaction* const& self,KeyRange const& keyRange) - #line 7608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetBlobGranuleRangesActorActorState(Transaction* const& self,KeyRange const& keyRange,int const& rangeLimit) + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : self(self), - #line 7608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" keyRange(keyRange), - #line 7610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeLimit(rangeLimit), + #line 8205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" currentRange(keyRange), - #line 7611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results() - #line 36623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results(), + #line 8207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + more(false) + #line 39960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("getBlobGranuleRangesActor", reinterpret_cast(this)); @@ -36633,20 +39970,34 @@ class GetBlobGranuleRangesActorActorState { int a_body1(int loopDepth=0) { try { - #line 7612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (BG_REQUEST_DEBUG) - #line 36638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fmt::print("Getting Blob Granules for [{0} - {1})\n", keyRange.begin.printable(), keyRange.end.printable()); - #line 36642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 39979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (self->getTenant().present()) + #line 39983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = self->getTenant().get()->ready(); + #line 8213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 39989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 8213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 39994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); } - #line 7615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - self->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 7616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 36648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -36664,122 +40015,297 @@ class GetBlobGranuleRangesActorActorState { return loopDepth; } - int a_body1loopHead1(int loopDepth) + int a_body1cont1(int loopDepth) + { + #line 8215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 40022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont3(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetBlobGranuleRangesActorActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetBlobGranuleRangesActorActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getBlobGranuleRangesActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlobGranuleRangesActor", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetBlobGranuleRangesActorActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getBlobGranuleRangesActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlobGranuleRangesActor", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetBlobGranuleRangesActorActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getBlobGranuleRangesActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getBlobGranuleRangesActor", reinterpret_cast(this), 0); + + } + int a_body1cont1loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); return loopDepth; } - int a_body1loopBody1(int loopDepth) + int a_body1cont1loopBody1(int loopDepth) { - #line 7617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = krmGetRanges(self, blobGranuleMappingKeys.begin, currentRange, 1000, GetRangeLimits::BYTE_LIMIT_UNLIMITED); - #line 7617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int remaining = std::max(0, rangeLimit - results.size()) + 1; + #line 8218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + remaining = std::min(1000, remaining); + #line 8219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (BUGGIFY_WITH_PROB(0.01)) + #line 40117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + remaining = std::min(remaining, deterministicRandom()->randomInt(1, 10)); + #line 40121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture>> __when_expr_1 = getBlobGranuleLocations( self->trState, currentRange, remaining, Reverse::False, UseTenant::True, JustGranules::True, &more); + #line 8222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 36680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 7617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 36685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 8222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 40132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) + int a_body1cont1loopBody1cont1(std::vector> const& blobGranuleMapping,int loopDepth) { - #line 7620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(int i = 0;i < blobGranuleMapping.size() - 1;i++) { - #line 7621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (blobGranuleMapping[i].value.size()) - #line 36696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : blobGranuleMapping ) { + #line 8225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!results.empty() && results.back().end > it.first.end) + #line 40143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results.back().end > it.first.begin); + #line 8227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results.back().end <= it.first.end); + #line 8228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Merge while reading granules", probe::decoration::rare); + #line 8229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(;!results.empty() && results.back().begin >= it.first.begin;) { + #line 8232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.pop_back(); + #line 40155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results.empty() || results.back().end == it.first.begin); + #line 40159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.push_back_deep(results.arena(), it.first); + #line 8237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (results.size() == rangeLimit) + #line 40165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.push_back(results.arena(), KeyRangeRef(blobGranuleMapping[i].key, blobGranuleMapping[i + 1].key)); - #line 36700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetBlobGranuleRangesActorActorState(); static_cast(this)->destroy(); return 0; } + #line 40169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO + this->~GetBlobGranuleRangesActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } } - #line 7626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.arena().dependsOn(blobGranuleMapping.arena()); - #line 7627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (blobGranuleMapping.more) - #line 36707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!more) + #line 40178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - currentRange = KeyRangeRef(blobGranuleMapping.back().key, currentRange.end); - #line 36711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetBlobGranuleRangesActorActorState(); static_cast(this)->destroy(); return 0; } + #line 40182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO + this->~GetBlobGranuleRangesActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } - else + #line 8244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(more, "partial granule mapping"); + #line 8245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + currentRange = KeyRangeRef(results.back().end, currentRange.end); + #line 40192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1cont1(std::vector> && blobGranuleMapping,int loopDepth) + { + #line 8224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : blobGranuleMapping ) { + #line 8225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!results.empty() && results.back().end > it.first.end) + #line 40203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results.back().end > it.first.begin); + #line 8227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results.back().end <= it.first.end); + #line 8228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Merge while reading granules", probe::decoration::rare); + #line 8229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(;!results.empty() && results.back().begin >= it.first.begin;) { + #line 8232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.pop_back(); + #line 40215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results.empty() || results.back().end == it.first.begin); + #line 40219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.push_back_deep(results.arena(), it.first); + #line 8237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (results.size() == rangeLimit) + #line 40225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetBlobGranuleRangesActorActorState(); static_cast(this)->destroy(); return 0; } + #line 40229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO + this->~GetBlobGranuleRangesActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 8241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!more) + #line 40238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetBlobGranuleRangesActorActorState(); static_cast(this)->destroy(); return 0; } - #line 36717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO this->~GetBlobGranuleRangesActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - if (loopDepth == 0) return a_body1loopHead1(0); + #line 8244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(more, "partial granule mapping"); + #line 8245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + currentRange = KeyRangeRef(results.back().end, currentRange.end); + #line 40252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; } - int a_body1loopBody1when1(RangeResult const& __blobGranuleMapping,int loopDepth) + int a_body1cont1loopBody1when1(std::vector> const& blobGranuleMapping,int loopDepth) { - #line 7617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - blobGranuleMapping = __blobGranuleMapping; - #line 36731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont1loopBody1cont1(blobGranuleMapping, loopDepth); return loopDepth; } - int a_body1loopBody1when1(RangeResult && __blobGranuleMapping,int loopDepth) + int a_body1cont1loopBody1when1(std::vector> && blobGranuleMapping,int loopDepth) { - blobGranuleMapping = std::move(__blobGranuleMapping); - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont1loopBody1cont1(std::move(blobGranuleMapping), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose2() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetBlobGranuleRangesActorActor, 0, RangeResult >::remove(); + static_cast(this)->ActorCallback< GetBlobGranuleRangesActorActor, 1, std::vector> >::remove(); } - void a_callback_fire(ActorCallback< GetBlobGranuleRangesActorActor, 0, RangeResult >*,RangeResult const& value) + void a_callback_fire(ActorCallback< GetBlobGranuleRangesActorActor, 1, std::vector> >*,std::vector> const& value) { - fdb_probe_actor_enter("getBlobGranuleRangesActor", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getBlobGranuleRangesActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when1(value, 0); + a_body1cont1loopBody1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getBlobGranuleRangesActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getBlobGranuleRangesActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< GetBlobGranuleRangesActorActor, 0, RangeResult >*,RangeResult && value) + void a_callback_fire(ActorCallback< GetBlobGranuleRangesActorActor, 1, std::vector> >*,std::vector> && value) { - fdb_probe_actor_enter("getBlobGranuleRangesActor", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getBlobGranuleRangesActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1cont1loopBody1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getBlobGranuleRangesActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getBlobGranuleRangesActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< GetBlobGranuleRangesActorActor, 0, RangeResult >*,Error err) + void a_callback_error(ActorCallback< GetBlobGranuleRangesActorActor, 1, std::vector> >*,Error err) { - fdb_probe_actor_enter("getBlobGranuleRangesActor", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getBlobGranuleRangesActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -36788,25 +40314,27 @@ class GetBlobGranuleRangesActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getBlobGranuleRangesActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getBlobGranuleRangesActor", reinterpret_cast(this), 1); } - #line 7608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction* self; - #line 7608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange keyRange; - #line 7610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int rangeLimit; + #line 8205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange currentRange; - #line 7611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Standalone> results; - #line 7617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - RangeResult blobGranuleMapping; - #line 36804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool more; + #line 40332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via getBlobGranuleRangesActor() - #line 7608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetBlobGranuleRangesActorActor final : public Actor>>, public ActorCallback< GetBlobGranuleRangesActorActor, 0, RangeResult >, public FastAllocated, public GetBlobGranuleRangesActorActorState { - #line 36809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetBlobGranuleRangesActorActor final : public Actor>>, public ActorCallback< GetBlobGranuleRangesActorActor, 0, Void >, public ActorCallback< GetBlobGranuleRangesActorActor, 1, std::vector> >, public FastAllocated, public GetBlobGranuleRangesActorActorState { + #line 40337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -36814,12 +40342,13 @@ class GetBlobGranuleRangesActorActor final : public Actor>>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetBlobGranuleRangesActorActor, 0, RangeResult >; - #line 7608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetBlobGranuleRangesActorActor(Transaction* const& self,KeyRange const& keyRange) - #line 36820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +friend struct ActorCallback< GetBlobGranuleRangesActorActor, 0, Void >; +friend struct ActorCallback< GetBlobGranuleRangesActorActor, 1, std::vector> >; + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetBlobGranuleRangesActorActor(Transaction* const& self,KeyRange const& keyRange,int const& rangeLimit) + #line 40349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor>>(), - GetBlobGranuleRangesActorActorState(self, keyRange) + GetBlobGranuleRangesActorActorState(self, keyRange, rangeLimit) { fdb_probe_actor_enter("getBlobGranuleRangesActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -36835,23 +40364,24 @@ friend struct ActorCallback< GetBlobGranuleRangesActorActor, 0, RangeResult >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetBlobGranuleRangesActorActor, 0, RangeResult >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetBlobGranuleRangesActorActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetBlobGranuleRangesActorActor, 1, std::vector> >*)0, actor_cancelled()); break; } } }; } - #line 7608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future>> getBlobGranuleRangesActor( Transaction* const& self, KeyRange const& keyRange ) { - #line 7608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future>>(new GetBlobGranuleRangesActorActor(self, keyRange)); - #line 36848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future>> getBlobGranuleRangesActor( Transaction* const& self, KeyRange const& keyRange, int const& rangeLimit ) { + #line 8201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new GetBlobGranuleRangesActorActor(self, keyRange, rangeLimit)); + #line 40378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 8248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -Future>> Transaction::getBlobGranuleRanges(const KeyRange& range) { - return ::getBlobGranuleRangesActor(this, range); +Future>> Transaction::getBlobGranuleRanges(const KeyRange& range, int rangeLimit) { + return ::getBlobGranuleRangesActor(this, range, rangeLimit); } // hack (for now) to get blob worker interface into load balance @@ -36860,47 +40390,33 @@ struct BWLocationInfo : MultiInterface> explicit BWLocationInfo(const std::vector>>& v) : Locations(v) {} }; - #line 36863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via readBlobGranulesActor() - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class ReadBlobGranulesActorActorState { - #line 36870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ReadBlobGranulesActorActorState(Transaction* const& self,KeyRange const& range,Version const& begin,Optional const& read,Version* const& readVersionOut) - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ReadBlobGranulesActorActorState(Transaction* const& self,KeyRange const& range,Version const& begin,Optional const& read,Version* const& readVersionOut,int const& chunkLimit,bool const& summarize) + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : self(self), - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" range(range), - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" begin(begin), - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" read(read), - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" readVersionOut(readVersionOut), - #line 7652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - blobGranuleMapping(), - #line 7653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - granuleStartKey(), - #line 7654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - granuleEndKey(), - #line 7655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - keyRange(range), - #line 7656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - workerId(), - #line 7657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - i(), - #line 7658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - rv(), - #line 7660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results(), - #line 7661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - startTime(now()) - #line 36903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + chunkLimit(chunkLimit), + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + summarize(summarize) + #line 40419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("readBlobGranulesActor", reinterpret_cast(this)); @@ -36913,27 +40429,39 @@ class ReadBlobGranulesActorActorState { int a_body1(int loopDepth=0) { try { - #line 7663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(chunkLimit > 0); + #line 8269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keyRange = range; + #line 8270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + i = int(); + #line 8271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rv = Version(); + #line 8273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results = Standalone>(); + #line 8274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + startTime = now(); + #line 8276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (read.present()) - #line 36918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rv = read.get(); - #line 36922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); } else { - #line 7666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = self->getReadVersion(); - #line 7666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 36931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 7666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 36936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } } @@ -36955,36 +40483,51 @@ class ReadBlobGranulesActorActorState { } int a_body1cont1(int loopDepth) { - #line 7669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - self->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 7674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = krmGetRanges(self, blobGranuleMappingKeys.begin, keyRange, 1000, GetRangeLimits::BYTE_LIMIT_UNLIMITED); - #line 7674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 36964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 7674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 36969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 8287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (BG_REQUEST_DEBUG) + #line 40488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("Doing blob granule request [{0} - {1}) @ {2}{3}\n", range.begin.printable(), range.end.printable(), rv, self->getTenant().present() ? " for tenant " + printable(self->getTenant().get()->description()) : ""); + #line 40492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (self->getTenant().present()) + #line 40496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = self->getTenant().get()->ready(); + #line 8298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 40502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 8298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 40507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont5(loopDepth); + } return loopDepth; } int a_body1cont3(Version const& _end,int loopDepth) { - #line 7667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rv = _end; - #line 36978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } int a_body1cont3(Version && _end,int loopDepth) { - #line 7667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rv = _end; - #line 36987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -37052,139 +40595,55 @@ class ReadBlobGranulesActorActorState { fdb_probe_actor_exit("readBlobGranulesActor", reinterpret_cast(this), 0); } - int a_body1cont5(RangeResult const& _bgMapping,int loopDepth) + int a_body1cont5(int loopDepth) { - #line 7676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - blobGranuleMapping = _bgMapping; - #line 7677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (blobGranuleMapping.more) - #line 37061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 37065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print( "BG Mapping for [{0} - %{1}) too large!\n", keyRange.begin.printable(), keyRange.end.printable()); - #line 37069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevWarn, "BGMappingTooLarge").detail("Range", range).detail("Max", 1000); - #line 7683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(unsupported_operation(), loopDepth); - #line 37075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(!blobGranuleMapping.more && blobGranuleMapping.size() < CLIENT_KNOBS->TOO_MANY); - #line 7687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (blobGranuleMapping.size() == 0) - #line 37081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 37085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - printf("no blob worker assignments yet\n"); - #line 37089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(blob_granule_transaction_too_old(), loopDepth); - #line 37093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 37097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("Doing blob granule request @ {}\n", rv); - #line 7696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("blob worker assignments:\n"); - #line 37103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - i = 0; - #line 37107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont5loopHead1(loopDepth); + #line 8301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + moreMapping = false; + #line 8302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture>> __when_expr_2 = getBlobGranuleLocations(self->trState, keyRange, CLIENT_KNOBS->BG_TOO_MANY_GRANULES, Reverse::False, UseTenant::True, JustGranules::False, &moreMapping); + #line 8302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 40606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont5when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 8302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 40611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont5(RangeResult && _bgMapping,int loopDepth) + int a_body1cont7(Void const& _,int loopDepth) { - #line 7676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - blobGranuleMapping = _bgMapping; - #line 7677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (blobGranuleMapping.more) - #line 37118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 37122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print( "BG Mapping for [{0} - %{1}) too large!\n", keyRange.begin.printable(), keyRange.end.printable()); - #line 37126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevWarn, "BGMappingTooLarge").detail("Range", range).detail("Max", 1000); - #line 7683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(unsupported_operation(), loopDepth); - #line 37132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(!blobGranuleMapping.more && blobGranuleMapping.size() < CLIENT_KNOBS->TOO_MANY); - #line 7687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (blobGranuleMapping.size() == 0) - #line 37138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 37142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - printf("no blob worker assignments yet\n"); - #line 37146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(blob_granule_transaction_too_old(), loopDepth); - #line 37150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 37154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("Doing blob granule request @ {}\n", rv); - #line 7696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("blob worker assignments:\n"); - #line 37160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - i = 0; - #line 37164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont5loopHead1(loopDepth); + loopDepth = a_body1cont5(loopDepth); return loopDepth; } - int a_body1cont1when1(RangeResult const& _bgMapping,int loopDepth) + int a_body1cont7(Void && _,int loopDepth) { - loopDepth = a_body1cont5(_bgMapping, loopDepth); + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont7(_, loopDepth); return loopDepth; } - int a_body1cont1when1(RangeResult && _bgMapping,int loopDepth) + int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont5(std::move(_bgMapping), loopDepth); + loopDepth = a_body1cont7(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ReadBlobGranulesActorActor, 1, RangeResult >::remove(); + static_cast(this)->ActorCallback< ReadBlobGranulesActorActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< ReadBlobGranulesActorActor, 1, RangeResult >*,RangeResult const& value) + void a_callback_fire(ActorCallback< ReadBlobGranulesActorActor, 1, Void >*,Void const& value) { fdb_probe_actor_enter("readBlobGranulesActor", reinterpret_cast(this), 1); a_exitChoose2(); @@ -37199,7 +40658,7 @@ class ReadBlobGranulesActorActorState { fdb_probe_actor_exit("readBlobGranulesActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< ReadBlobGranulesActorActor, 1, RangeResult >*,RangeResult && value) + void a_callback_fire(ActorCallback< ReadBlobGranulesActorActor, 1, Void >*,Void && value) { fdb_probe_actor_enter("readBlobGranulesActor", reinterpret_cast(this), 1); a_exitChoose2(); @@ -37214,7 +40673,7 @@ class ReadBlobGranulesActorActorState { fdb_probe_actor_exit("readBlobGranulesActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< ReadBlobGranulesActorActor, 1, RangeResult >*,Error err) + void a_callback_error(ActorCallback< ReadBlobGranulesActorActor, 1, Void >*,Error err) { fdb_probe_actor_enter("readBlobGranulesActor", reinterpret_cast(this), 1); a_exitChoose2(); @@ -37229,193 +40688,85 @@ class ReadBlobGranulesActorActorState { fdb_probe_actor_exit("readBlobGranulesActor", reinterpret_cast(this), 1); } - int a_body1cont6(int loopDepth) - { - #line 7745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - i = 0; - #line 37236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont6loopHead1(loopDepth); - - return loopDepth; - } - int a_body1cont5loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont5loopBody1(loopDepth); - - return loopDepth; - } - int a_body1cont5loopBody1(int loopDepth) + int a_body1cont8(int loopDepth) { - #line 7699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!(i < blobGranuleMapping.size() - 1)) - #line 37252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - return a_body1cont5break1(loopDepth==0?0:loopDepth-1); // break - } - #line 7700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - granuleStartKey = blobGranuleMapping[i].key; - #line 7701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - granuleEndKey = blobGranuleMapping[i + 1].key; - #line 7702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!blobGranuleMapping[i].value.size()) - #line 37262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (blobGranuleMapping.empty()) + #line 40695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 37266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("Key range [{0} - {1}) missing worker assignment!\n", granuleStartKey.printable(), granuleEndKey.printable()); - #line 37270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(blob_granule_transaction_too_old(), std::max(0, loopDepth - 1)); - #line 37274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(blob_granule_transaction_too_old(), loopDepth); + #line 40699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - workerId = decodeBlobGranuleMappingValue(blobGranuleMapping[i].value); - #line 7713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (workerId == UID()) - #line 37280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(blobGranuleMapping.front().first.begin <= keyRange.begin); + #line 8315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(moreMapping == blobGranuleMapping.back().first.end < keyRange.end); + #line 8316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (moreMapping) + #line 40707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (BG_REQUEST_DEBUG) - #line 37284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("Key range [{0} - {1}) has no assigned worker yet!\n", granuleStartKey.printable(), granuleEndKey.printable()); - #line 37288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("BG Mapping for [{0} - {1}) too large! ({2}) LastRange=[{3} - {4}): {5}\n", keyRange.begin.printable(), keyRange.end.printable(), blobGranuleMapping.size(), blobGranuleMapping.back().first.begin.printable(), blobGranuleMapping.back().first.end.printable(), blobGranuleMapping.back().second.shortString()); + #line 40715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(blob_granule_transaction_too_old(), std::max(0, loopDepth - 1)); - #line 37292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 37296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print( " [{0} - {1}): {2}\n", granuleStartKey.printable(), granuleEndKey.printable(), workerId.toString()); - #line 37300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!self->trState->cx->blobWorker_interf.count(workerId)) - #line 37304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_2 = self->get(blobWorkerListKeyFor(workerId)); - #line 7727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 37310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont5loopBody1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 7727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 37315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont5loopBody1cont1(loopDepth); - } - - return loopDepth; - } - int a_body1cont5break1(int loopDepth) - { - try { - return a_body1cont6(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont5loopBody1cont1(int loopDepth) - { - #line 7699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - i++; - #line 37342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (loopDepth == 0) return a_body1cont5loopHead1(0); - - return loopDepth; - } - int a_body1cont5loopBody1cont8(Optional const& workerInterface,int loopDepth) - { - #line 7731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!workerInterface.present()) - #line 37351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(transaction_too_old(), std::max(0, loopDepth - 1)); - #line 37355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - self->trState->cx->blobWorker_interf[workerId] = decodeBlobWorkerListValue(workerInterface.get()); - #line 7738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 37361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print(" decoded worker interface for {0}\n", workerId.toString()); - #line 37365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - loopDepth = a_body1cont5loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1cont5loopBody1cont8(Optional && workerInterface,int loopDepth) - { - #line 7731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!workerInterface.present()) - #line 37375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(transaction_too_old(), std::max(0, loopDepth - 1)); - #line 37379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevWarn, "BGMappingTooLarge") .detail("Range", range) .detail("Max", CLIENT_KNOBS->BG_TOO_MANY_GRANULES); + #line 8329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(unsupported_operation(), loopDepth); + #line 40721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - self->trState->cx->blobWorker_interf[workerId] = decodeBlobWorkerListValue(workerInterface.get()); - #line 7738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(blobGranuleMapping.size() <= CLIENT_KNOBS->BG_TOO_MANY_GRANULES); + #line 8333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (BG_REQUEST_DEBUG) - #line 37385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print(" decoded worker interface for {0}\n", workerId.toString()); - #line 37389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("Doing blob granule request @ {}\n", rv); + #line 8335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("blob worker assignments:\n"); + #line 40733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - loopDepth = a_body1cont5loopBody1cont1(loopDepth); + #line 8339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + i = 0; + #line 40737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont8loopHead1(loopDepth); return loopDepth; } - int a_body1cont5loopBody1when1(Optional const& workerInterface,int loopDepth) + int a_body1cont5when1(std::vector> const& __blobGranuleMapping,int loopDepth) { - loopDepth = a_body1cont5loopBody1cont8(workerInterface, loopDepth); + #line 8302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + blobGranuleMapping = __blobGranuleMapping; + #line 40746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont8(loopDepth); return loopDepth; } - int a_body1cont5loopBody1when1(Optional && workerInterface,int loopDepth) + int a_body1cont5when1(std::vector> && __blobGranuleMapping,int loopDepth) { - loopDepth = a_body1cont5loopBody1cont8(std::move(workerInterface), loopDepth); + blobGranuleMapping = std::move(__blobGranuleMapping); + loopDepth = a_body1cont8(loopDepth); return loopDepth; } void a_exitChoose3() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ReadBlobGranulesActorActor, 2, Optional >::remove(); + static_cast(this)->ActorCallback< ReadBlobGranulesActorActor, 2, std::vector> >::remove(); } - void a_callback_fire(ActorCallback< ReadBlobGranulesActorActor, 2, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< ReadBlobGranulesActorActor, 2, std::vector> >*,std::vector> const& value) { fdb_probe_actor_enter("readBlobGranulesActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont5loopBody1when1(value, 0); + a_body1cont5when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -37425,12 +40776,12 @@ class ReadBlobGranulesActorActorState { fdb_probe_actor_exit("readBlobGranulesActor", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< ReadBlobGranulesActorActor, 2, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< ReadBlobGranulesActorActor, 2, std::vector> >*,std::vector> && value) { fdb_probe_actor_enter("readBlobGranulesActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont5loopBody1when1(std::move(value), 0); + a_body1cont5when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -37440,7 +40791,7 @@ class ReadBlobGranulesActorActorState { fdb_probe_actor_exit("readBlobGranulesActor", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< ReadBlobGranulesActorActor, 2, Optional >*,Error err) + void a_callback_error(ActorCallback< ReadBlobGranulesActorActor, 2, std::vector> >*,Error err) { fdb_probe_actor_enter("readBlobGranulesActor", reinterpret_cast(this), 2); a_exitChoose3(); @@ -37455,25 +40806,25 @@ class ReadBlobGranulesActorActorState { fdb_probe_actor_exit("readBlobGranulesActor", reinterpret_cast(this), 2); } - int a_body1cont12(int loopDepth) + int a_body1cont9(int loopDepth) { - #line 7839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - self->trState->cx->anyBlobGranuleRequests = true; - #line 7840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + self->trState->cx->anyBGReads = true; + #line 8492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->trState->cx->bgGranulesPerRequest.addSample(results.size()); - #line 7841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" self->trState->cx->bgLatencies.addSample(now() - startTime); - #line 7843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (readVersionOut != nullptr) - #line 37468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" *readVersionOut = rv; - #line 37472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~ReadBlobGranulesActorActorState(); static_cast(this)->destroy(); return 0; } - #line 37476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO this->~ReadBlobGranulesActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -37481,97 +40832,142 @@ class ReadBlobGranulesActorActorState { return loopDepth; } - int a_body1cont6loopHead1(int loopDepth) + int a_body1cont8loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont6loopBody1(loopDepth); + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont8loopBody1(loopDepth); return loopDepth; } - int a_body1cont6loopBody1(int loopDepth) + int a_body1cont8loopBody1(int loopDepth) { - #line 7745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!(i < blobGranuleMapping.size() - 1)) - #line 37495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!(i < blobGranuleMapping.size())) + #line 40846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1cont8break1(loopDepth==0?0:loopDepth-1); // break + } + #line 8340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + granule = blobGranuleMapping[i].first; + #line 8342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (granule.end <= keyRange.begin) + #line 40854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1cont8continue1(loopDepth); // continue + } + #line 8345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bwInterf = self->trState->cx->blobWorker_interf[blobGranuleMapping[i].second]; + #line 8346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(bwInterf.id() != UID()); + #line 8347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (BG_REQUEST_DEBUG) + #line 40864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - return a_body1cont6break1(loopDepth==0?0:loopDepth-1); // break + #line 8348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("Blob granule request mapping [{0} - {1})={2}\n", granule.begin.printable(), granule.end.printable(), bwInterf.id().toString().substr(0, 5)); + #line 40868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - granuleStartKey = blobGranuleMapping[i].key; - #line 7747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - granuleEndKey = blobGranuleMapping[i + 1].key; - #line 7749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (granuleEndKey <= keyRange.begin) - #line 37505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (keyRange.begin > granule.begin) + #line 40872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - return a_body1cont6continue1(loopDepth); // continue + #line 8355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + granule = KeyRangeRef(keyRange.begin, granule.end); + #line 40876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - workerId = decodeBlobGranuleMappingValue(blobGranuleMapping[i].value); - #line 7754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (keyRange.begin > granuleStartKey) - #line 37513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (keyRange.end < granule.end) + #line 40880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - granuleStartKey = keyRange.begin; - #line 37517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + granule = KeyRangeRef(granule.begin, keyRange.end); + #line 40884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (keyRange.end < granuleEndKey) - #line 37521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (g_network->isSimulated() && !g_simulator->speedUpSimulation && BUGGIFY_WITH_PROB(0.01)) + #line 40888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - granuleEndKey = keyRange.end; - #line 37525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!self->trState->cx->blobWorker_interf.empty()); + #line 8364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Randomizing blob worker id for request"); + #line 8365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent ev("RandomizingBlobWorkerForReq"); + #line 8366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ev.detail("OriginalWorker", bwInterf.id()); + #line 8367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int randomIdx = deterministicRandom()->randomInt(0, self->trState->cx->blobWorker_interf.size()); + #line 8368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : self->trState->cx->blobWorker_interf ) { + #line 8369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (randomIdx == 0) + #line 40904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bwInterf = it.second; + #line 40908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + break; + } + #line 8373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + randomIdx--; + #line 40913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ev.detail("NewWorker", bwInterf.id()); + #line 40917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req = BlobGranuleFileRequest(); - #line 7762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.keyRange = KeyRangeRef(StringRef(req.arena, granuleStartKey), StringRef(req.arena, granuleEndKey)); - #line 7763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.keyRange = KeyRangeRef(StringRef(req.arena, granule.begin), StringRef(req.arena, granule.end)); + #line 8380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.beginVersion = begin; - #line 7764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.readVersion = rv; - #line 7765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.tenantInfo = self->getTenant().present() ? self->trState->getTenantInfo() : TenantInfo(); + #line 8383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" req.canCollapseBegin = true; - #line 7767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.summarize = summarize; + #line 8386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector>> v; - #line 7768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - v.push_back( makeReference>(self->trState->cx->blobWorker_interf[workerId])); - #line 7770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + v.push_back(makeReference>(bwInterf)); + #line 8388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" location = makeReference(v); - #line 37543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 7775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_3 = loadBalance(location, &BlobWorkerInterface::blobGranuleFileRequest, req, TaskPriority::DefaultPromiseEndpoint, AtMostOnce::False, nullptr); - #line 7774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont6loopBody1Catch1(actor_cancelled(), loopDepth); - #line 37549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont6loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6loopBody1when1(__when_expr_3.get(), loopDepth); }; - #line 7816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont8loopBody1Catch1(actor_cancelled(), loopDepth); + #line 40945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont8loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont8loopBody1when1(__when_expr_3.get(), loopDepth); }; + #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_4 = IFailureMonitor::failureMonitor().onStateEqual( location->get(0, &BlobWorkerInterface::blobGranuleFileRequest).getEndpoint(), FailureStatus(true)); - #line 37553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont6loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6loopBody1when2(__when_expr_4.get(), loopDepth); }; + #line 40949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont8loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont8loopBody1when2(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 7775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 37560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 40956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1cont6loopBody1Catch1(error, loopDepth); + loopDepth = a_body1cont8loopBody1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1cont6loopBody1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1cont8loopBody1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont6break1(int loopDepth) + int a_body1cont8break1(int loopDepth) { try { - return a_body1cont12(loopDepth); + return a_body1cont9(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -37581,46 +40977,46 @@ class ReadBlobGranulesActorActorState { return loopDepth; } - int a_body1cont6continue1(int loopDepth) + int a_body1cont8continue1(int loopDepth) { - #line 7745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" i++; - #line 37588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (loopDepth == 0) return a_body1cont6loopHead1(0); + #line 40984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1cont8loopHead1(0); return loopDepth; } - int a_body1cont6loopBody1cont1(int loopDepth) + int a_body1cont8loopBody1cont1(int loopDepth) { - #line 7745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" i++; - #line 37597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (loopDepth == 0) return a_body1cont6loopHead1(0); + #line 40993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1cont8loopHead1(0); return loopDepth; } - int a_body1cont6loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1cont8loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 7827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (BG_REQUEST_DEBUG) - #line 37607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("BGReq got error {}\n", e.name()); - #line 37611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("Blob granule request for [{0} - {1}) @ {2} - {3} got error from {4}: {5}\n", granule.begin.printable(), granule.end.printable(), begin, rv, bwInterf.id().toString().substr(0, 5), e.name()); + #line 41007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (e.code() == error_code_wrong_shard_server || e.code() == error_code_connection_failed) - #line 37615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(transaction_too_old(), std::max(0, loopDepth - 1)); - #line 37619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(blob_granule_request_failed(), std::max(0, loopDepth - 1)); + #line 41015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 37623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); @@ -37630,145 +41026,265 @@ class ReadBlobGranulesActorActorState { return loopDepth; } - int a_body1cont6loopBody1cont6(int loopDepth) + int a_body1cont8loopBody1cont10(int loopDepth) { - loopDepth = a_body1cont6loopBody1cont7(loopDepth); + loopDepth = a_body1cont8loopBody1cont10cont1(loopDepth); return loopDepth; } - int a_body1cont6loopBody1when1(BlobGranuleFileReply const& rep,int loopDepth) + int a_body1cont8loopBody1when1(BlobGranuleFileReply const& rep,int loopDepth) { - #line 7781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (BG_REQUEST_DEBUG) - #line 37643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("Blob granule request for [{0} - {1}) @ {2} - {3} got reply from {4}:\n", granuleStartKey.printable(), granuleEndKey.printable(), begin, rv, workerId.toString()); - #line 37647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("Blob granule request for [{0} - {1}) @ {2} - {3} got reply from {4}:\n", granule.begin.printable(), granule.end.printable(), begin, rv, bwInterf.id().toString().substr(0, 5)); + #line 41043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!rep.chunks.empty()); + #line 8408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.arena().dependsOn(rep.arena); - #line 7790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& chunk : rep.chunks ) { - #line 7791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (BG_REQUEST_DEBUG) - #line 37655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fmt::print( "[{0} - {1})\n", chunk.keyRange.begin.printable(), chunk.keyRange.end.printable()); - #line 7795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fmt::print(" SnapshotFile: {0}\n \n DeltaFiles:\n", chunk.snapshotFile.present() ? chunk.snapshotFile.get().toString().c_str() : ""); - #line 7798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& df : chunk.deltaFiles ) { - #line 7799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fmt::print(" {0}\n", df.toString()); - #line 37665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fmt::print(" Deltas: ({0})", chunk.newDeltas.size()); - #line 7802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (chunk.newDeltas.size() > 0) - #line 37671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fmt::print(" with version [{0} - {1}]", chunk.newDeltas[0].version, chunk.newDeltas[chunk.newDeltas.size() - 1].version); - #line 37675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fmt::print(" IncludedVersion: {0}\n\n\n", chunk.includedVersion); - #line 37679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (chunk.tenantPrefix.present()) + #line 41079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print(" TenantPrefix: {0}\n", chunk.tenantPrefix.get().printable()); + #line 41083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 8432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(chunk.tenantPrefix.present() == self->getTenant().present()); + #line 8433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (chunk.tenantPrefix.present()) + #line 41090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(chunk.tenantPrefix.get() == self->getTenant().get()->prefix()); + #line 41094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!results.empty() && results.back().keyRange.end != chunk.keyRange.begin) + #line 41098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results.back().keyRange.end > chunk.keyRange.begin); + #line 8439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results.back().keyRange.end <= chunk.keyRange.end); + #line 8440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Merge while reading granule range", probe::decoration::rare); + #line 8441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(;!results.empty() && results.back().keyRange.begin >= chunk.keyRange.begin;) { + #line 8444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.pop_back(); + #line 41110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results.empty() || results.back().keyRange.end == chunk.keyRange.begin); + #line 41114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.push_back(results.arena(), chunk); - #line 7811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - keyRange = KeyRangeRef(std::min(chunk.keyRange.end, keyRange.end), keyRange.end); - #line 37685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StringRef chunkEndKey = chunk.keyRange.end; + #line 8450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (chunk.tenantPrefix.present()) + #line 41122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + chunkEndKey = chunkEndKey.removePrefix(chunk.tenantPrefix.get()); + #line 41126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keyRange = KeyRangeRef(std::min(chunkEndKey, keyRange.end), keyRange.end); + #line 8454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (summarize && results.size() == chunkLimit) + #line 41132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + break; + } + } + #line 8458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (summarize && results.size() == chunkLimit) + #line 41139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1cont8break1(loopDepth==0?0:loopDepth-1); // break } - loopDepth = a_body1cont6loopBody1cont6(loopDepth); + loopDepth = a_body1cont8loopBody1cont10(loopDepth); return loopDepth; } - int a_body1cont6loopBody1when1(BlobGranuleFileReply && rep,int loopDepth) + int a_body1cont8loopBody1when1(BlobGranuleFileReply && rep,int loopDepth) { - #line 7781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (BG_REQUEST_DEBUG) - #line 37695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("Blob granule request for [{0} - {1}) @ {2} - {3} got reply from {4}:\n", granuleStartKey.printable(), granuleEndKey.printable(), begin, rv, workerId.toString()); - #line 37699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("Blob granule request for [{0} - {1}) @ {2} - {3} got reply from {4}:\n", granule.begin.printable(), granule.end.printable(), begin, rv, bwInterf.id().toString().substr(0, 5)); + #line 41155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!rep.chunks.empty()); + #line 8408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.arena().dependsOn(rep.arena); - #line 7790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& chunk : rep.chunks ) { - #line 7791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (BG_REQUEST_DEBUG) - #line 37707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fmt::print( "[{0} - {1})\n", chunk.keyRange.begin.printable(), chunk.keyRange.end.printable()); - #line 7795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fmt::print(" SnapshotFile: {0}\n \n DeltaFiles:\n", chunk.snapshotFile.present() ? chunk.snapshotFile.get().toString().c_str() : ""); - #line 7798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" for( auto& df : chunk.deltaFiles ) { - #line 7799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fmt::print(" {0}\n", df.toString()); - #line 37717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fmt::print(" Deltas: ({0})", chunk.newDeltas.size()); - #line 7802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (chunk.newDeltas.size() > 0) - #line 37723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fmt::print(" with version [{0} - {1}]", chunk.newDeltas[0].version, chunk.newDeltas[chunk.newDeltas.size() - 1].version); - #line 37727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" fmt::print(" IncludedVersion: {0}\n\n\n", chunk.includedVersion); - #line 37731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (chunk.tenantPrefix.present()) + #line 41191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print(" TenantPrefix: {0}\n", chunk.tenantPrefix.get().printable()); + #line 41195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 8432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(chunk.tenantPrefix.present() == self->getTenant().present()); + #line 8433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (chunk.tenantPrefix.present()) + #line 41202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(chunk.tenantPrefix.get() == self->getTenant().get()->prefix()); + #line 41206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!results.empty() && results.back().keyRange.end != chunk.keyRange.begin) + #line 41210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results.back().keyRange.end > chunk.keyRange.begin); + #line 8439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results.back().keyRange.end <= chunk.keyRange.end); + #line 8440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Merge while reading granule range", probe::decoration::rare); + #line 8441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(;!results.empty() && results.back().keyRange.begin >= chunk.keyRange.begin;) { + #line 8444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.pop_back(); + #line 41222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results.empty() || results.back().keyRange.end == chunk.keyRange.begin); + #line 41226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" results.push_back(results.arena(), chunk); - #line 7811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - keyRange = KeyRangeRef(std::min(chunk.keyRange.end, keyRange.end), keyRange.end); - #line 37737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StringRef chunkEndKey = chunk.keyRange.end; + #line 8450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (chunk.tenantPrefix.present()) + #line 41234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + chunkEndKey = chunkEndKey.removePrefix(chunk.tenantPrefix.get()); + #line 41238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keyRange = KeyRangeRef(std::min(chunkEndKey, keyRange.end), keyRange.end); + #line 8454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (summarize && results.size() == chunkLimit) + #line 41244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + break; + } + } + #line 8458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (summarize && results.size() == chunkLimit) + #line 41251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1cont8break1(loopDepth==0?0:loopDepth-1); // break } - loopDepth = a_body1cont6loopBody1cont6(loopDepth); + loopDepth = a_body1cont8loopBody1cont10(loopDepth); return loopDepth; } - int a_body1cont6loopBody1when2(Void const& _,int loopDepth) + int a_body1cont8loopBody1when2(Void const& _,int loopDepth) { - #line 7819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (BG_REQUEST_DEBUG) - #line 37747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("readBlobGranules got BW {0} failed\n", workerId.toString()); - #line 37751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("readBlobGranules got BW {0} failed\n", bwInterf.id().toString()); + #line 41267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1cont6loopBody1Catch1(connection_failed(), loopDepth); - #line 37755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1cont8loopBody1Catch1(connection_failed(), loopDepth); + #line 41271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } - int a_body1cont6loopBody1when2(Void && _,int loopDepth) + int a_body1cont8loopBody1when2(Void && _,int loopDepth) { - #line 7819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (BG_REQUEST_DEBUG) - #line 37763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("readBlobGranules got BW {0} failed\n", workerId.toString()); - #line 37767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("readBlobGranules got BW {0} failed\n", bwInterf.id().toString()); + #line 41283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1cont6loopBody1Catch1(connection_failed(), loopDepth); - #line 37771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1cont8loopBody1Catch1(connection_failed(), loopDepth); + #line 41287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } @@ -37784,12 +41300,12 @@ class ReadBlobGranulesActorActorState { fdb_probe_actor_enter("readBlobGranulesActor", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont6loopBody1when1(value, 0); + a_body1cont8loopBody1when1(value, 0); } catch (Error& error) { - a_body1cont6loopBody1Catch1(error, 0); + a_body1cont8loopBody1Catch1(error, 0); } catch (...) { - a_body1cont6loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("readBlobGranulesActor", reinterpret_cast(this), 3); @@ -37799,12 +41315,12 @@ class ReadBlobGranulesActorActorState { fdb_probe_actor_enter("readBlobGranulesActor", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont6loopBody1when1(std::move(value), 0); + a_body1cont8loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1cont6loopBody1Catch1(error, 0); + a_body1cont8loopBody1Catch1(error, 0); } catch (...) { - a_body1cont6loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("readBlobGranulesActor", reinterpret_cast(this), 3); @@ -37814,12 +41330,12 @@ class ReadBlobGranulesActorActorState { fdb_probe_actor_enter("readBlobGranulesActor", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont6loopBody1Catch1(err, 0); + a_body1cont8loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1cont6loopBody1Catch1(error, 0); + a_body1cont8loopBody1Catch1(error, 0); } catch (...) { - a_body1cont6loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("readBlobGranulesActor", reinterpret_cast(this), 3); @@ -37829,12 +41345,12 @@ class ReadBlobGranulesActorActorState { fdb_probe_actor_enter("readBlobGranulesActor", reinterpret_cast(this), 4); a_exitChoose4(); try { - a_body1cont6loopBody1when2(value, 0); + a_body1cont8loopBody1when2(value, 0); } catch (Error& error) { - a_body1cont6loopBody1Catch1(error, 0); + a_body1cont8loopBody1Catch1(error, 0); } catch (...) { - a_body1cont6loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("readBlobGranulesActor", reinterpret_cast(this), 4); @@ -37844,12 +41360,12 @@ class ReadBlobGranulesActorActorState { fdb_probe_actor_enter("readBlobGranulesActor", reinterpret_cast(this), 4); a_exitChoose4(); try { - a_body1cont6loopBody1when2(std::move(value), 0); + a_body1cont8loopBody1when2(std::move(value), 0); } catch (Error& error) { - a_body1cont6loopBody1Catch1(error, 0); + a_body1cont8loopBody1Catch1(error, 0); } catch (...) { - a_body1cont6loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("readBlobGranulesActor", reinterpret_cast(this), 4); @@ -37859,20 +41375,20 @@ class ReadBlobGranulesActorActorState { fdb_probe_actor_enter("readBlobGranulesActor", reinterpret_cast(this), 4); a_exitChoose4(); try { - a_body1cont6loopBody1Catch1(err, 0); + a_body1cont8loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1cont6loopBody1Catch1(error, 0); + a_body1cont8loopBody1Catch1(error, 0); } catch (...) { - a_body1cont6loopBody1Catch1(unknown_error(), 0); + a_body1cont8loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("readBlobGranulesActor", reinterpret_cast(this), 4); } - int a_body1cont6loopBody1cont7(int loopDepth) + int a_body1cont8loopBody1cont10cont1(int loopDepth) { try { - loopDepth = a_body1cont6loopBody1cont1(loopDepth); + loopDepth = a_body1cont8loopBody1cont1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); @@ -37882,44 +41398,48 @@ class ReadBlobGranulesActorActorState { return loopDepth; } - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction* self; - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange range; - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Version begin; - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Optional read; - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Version* readVersionOut; - #line 7652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - RangeResult blobGranuleMapping; - #line 7653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key granuleStartKey; - #line 7654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key granuleEndKey; - #line 7655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int chunkLimit; + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool summarize; + #line 8269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange keyRange; - #line 7656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - UID workerId; - #line 7657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" int i; - #line 7658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Version rv; - #line 7660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Standalone> results; - #line 7661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" double startTime; - #line 7761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool moreMapping; + #line 8302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> blobGranuleMapping; + #line 8340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange granule; + #line 8345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + BlobWorkerInterface bwInterf; + #line 8378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" BlobGranuleFileRequest req; - #line 7770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference>> location; - #line 37917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via readBlobGranulesActor() - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class ReadBlobGranulesActorActor final : public Actor>>, public ActorCallback< ReadBlobGranulesActorActor, 0, Version >, public ActorCallback< ReadBlobGranulesActorActor, 1, RangeResult >, public ActorCallback< ReadBlobGranulesActorActor, 2, Optional >, public ActorCallback< ReadBlobGranulesActorActor, 3, BlobGranuleFileReply >, public ActorCallback< ReadBlobGranulesActorActor, 4, Void >, public FastAllocated, public ReadBlobGranulesActorActorState { - #line 37922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class ReadBlobGranulesActorActor final : public Actor>>, public ActorCallback< ReadBlobGranulesActorActor, 0, Version >, public ActorCallback< ReadBlobGranulesActorActor, 1, Void >, public ActorCallback< ReadBlobGranulesActorActor, 2, std::vector> >, public ActorCallback< ReadBlobGranulesActorActor, 3, BlobGranuleFileReply >, public ActorCallback< ReadBlobGranulesActorActor, 4, Void >, public FastAllocated, public ReadBlobGranulesActorActorState { + #line 41442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -37928,15 +41448,15 @@ class ReadBlobGranulesActorActor final : public Actor>>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ReadBlobGranulesActorActor, 0, Version >; -friend struct ActorCallback< ReadBlobGranulesActorActor, 1, RangeResult >; -friend struct ActorCallback< ReadBlobGranulesActorActor, 2, Optional >; +friend struct ActorCallback< ReadBlobGranulesActorActor, 1, Void >; +friend struct ActorCallback< ReadBlobGranulesActorActor, 2, std::vector> >; friend struct ActorCallback< ReadBlobGranulesActorActor, 3, BlobGranuleFileReply >; friend struct ActorCallback< ReadBlobGranulesActorActor, 4, Void >; - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ReadBlobGranulesActorActor(Transaction* const& self,KeyRange const& range,Version const& begin,Optional const& read,Version* const& readVersionOut) - #line 37937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ReadBlobGranulesActorActor(Transaction* const& self,KeyRange const& range,Version const& begin,Optional const& read,Version* const& readVersionOut,int const& chunkLimit,bool const& summarize) + #line 41457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor>>(), - ReadBlobGranulesActorActorState(self, range, begin, read, readVersionOut) + ReadBlobGranulesActorActorState(self, range, begin, read, readVersionOut, chunkLimit, summarize) { fdb_probe_actor_enter("readBlobGranulesActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -37953,51 +41473,306 @@ friend struct ActorCallback< ReadBlobGranulesActorActor, 4, Void >; this->actor_wait_state = -1; switch (wait_state) { case 1: this->a_callback_error((ActorCallback< ReadBlobGranulesActorActor, 0, Version >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< ReadBlobGranulesActorActor, 1, RangeResult >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< ReadBlobGranulesActorActor, 2, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ReadBlobGranulesActorActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ReadBlobGranulesActorActor, 2, std::vector> >*)0, actor_cancelled()); break; case 4: this->a_callback_error((ActorCallback< ReadBlobGranulesActorActor, 3, BlobGranuleFileReply >*)0, actor_cancelled()); break; } } }; } - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future>> readBlobGranulesActor( Transaction* const& self, KeyRange const& range, Version const& begin, Optional const& read, Version* const& readVersionOut ) { - #line 7645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future>>(new ReadBlobGranulesActorActor(self, range, begin, read, readVersionOut)); - #line 37968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future>> readBlobGranulesActor( Transaction* const& self, KeyRange const& range, Version const& begin, Optional const& read, Version* const& readVersionOut, int const& chunkLimit, bool const& summarize ) { + #line 8259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new ReadBlobGranulesActorActor(self, range, begin, read, readVersionOut, chunkLimit, summarize)); + #line 41488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 8500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Future>> Transaction::readBlobGranules(const KeyRange& range, Version begin, Optional readVersion, Version* readVersionOut) { - return readBlobGranulesActor(this, range, begin, readVersion, readVersionOut); + return readBlobGranulesActor( + this, range, begin, readVersion, readVersionOut, std::numeric_limits::max(), false); +} + + #line 41501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via summarizeBlobGranulesActor() + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SummarizeBlobGranulesActorActorState { + #line 41508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SummarizeBlobGranulesActorActorState(Transaction* const& self,KeyRange const& range,Optional const& summaryVersion,int const& rangeLimit) + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : self(self), + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + summaryVersion(summaryVersion), + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeLimit(rangeLimit), + #line 8513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + readVersionOut() + #line 41523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("summarizeBlobGranulesActor", reinterpret_cast(this)); + + } + ~SummarizeBlobGranulesActorActorState() + { + fdb_probe_actor_destroy("summarizeBlobGranulesActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 8514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture>> __when_expr_0 = readBlobGranulesActor(self, range, 0, summaryVersion, &readVersionOut, rangeLimit, true); + #line 8514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 41540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 8514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 41545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~SummarizeBlobGranulesActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Standalone> const& chunks,int loopDepth) + { + #line 8516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(chunks.size() <= rangeLimit); + #line 8517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!summaryVersion.present() || readVersionOut == summaryVersion.get()); + #line 8518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone> summaries; + #line 8519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + summaries.reserve(summaries.arena(), chunks.size()); + #line 8520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : chunks ) { + #line 8521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + summaries.push_back(summaries.arena(), summarizeGranuleChunk(summaries.arena(), it)); + #line 41578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(summaries); this->~SummarizeBlobGranulesActorActorState(); static_cast(this)->destroy(); return 0; } + #line 41582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(summaries); + this->~SummarizeBlobGranulesActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Standalone> && chunks,int loopDepth) + { + #line 8516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(chunks.size() <= rangeLimit); + #line 8517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!summaryVersion.present() || readVersionOut == summaryVersion.get()); + #line 8518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone> summaries; + #line 8519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + summaries.reserve(summaries.arena(), chunks.size()); + #line 8520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : chunks ) { + #line 8521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + summaries.push_back(summaries.arena(), summarizeGranuleChunk(summaries.arena(), it)); + #line 41604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(summaries); this->~SummarizeBlobGranulesActorActorState(); static_cast(this)->destroy(); return 0; } + #line 41608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(summaries); + this->~SummarizeBlobGranulesActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Standalone> const& chunks,int loopDepth) + { + loopDepth = a_body1cont1(chunks, loopDepth); + + return loopDepth; + } + int a_body1when1(Standalone> && chunks,int loopDepth) + { + loopDepth = a_body1cont1(std::move(chunks), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SummarizeBlobGranulesActorActor, 0, Standalone> >::remove(); + + } + void a_callback_fire(ActorCallback< SummarizeBlobGranulesActorActor, 0, Standalone> >*,Standalone> const& value) + { + fdb_probe_actor_enter("summarizeBlobGranulesActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("summarizeBlobGranulesActor", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< SummarizeBlobGranulesActorActor, 0, Standalone> >*,Standalone> && value) + { + fdb_probe_actor_enter("summarizeBlobGranulesActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("summarizeBlobGranulesActor", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< SummarizeBlobGranulesActorActor, 0, Standalone> >*,Error err) + { + fdb_probe_actor_enter("summarizeBlobGranulesActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("summarizeBlobGranulesActor", reinterpret_cast(this), 0); + + } + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Transaction* self; + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional summaryVersion; + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int rangeLimit; + #line 8513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version readVersionOut; + #line 41689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via summarizeBlobGranulesActor() + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SummarizeBlobGranulesActorActor final : public Actor>>, public ActorCallback< SummarizeBlobGranulesActorActor, 0, Standalone> >, public FastAllocated, public SummarizeBlobGranulesActorActorState { + #line 41694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< SummarizeBlobGranulesActorActor, 0, Standalone> >; + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SummarizeBlobGranulesActorActor(Transaction* const& self,KeyRange const& range,Optional const& summaryVersion,int const& rangeLimit) + #line 41705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>>(), + SummarizeBlobGranulesActorActorState(self, range, summaryVersion, rangeLimit) + { + fdb_probe_actor_enter("summarizeBlobGranulesActor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("summarizeBlobGranulesActor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("summarizeBlobGranulesActor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< SummarizeBlobGranulesActorActor, 0, Standalone> >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future>> summarizeBlobGranulesActor( Transaction* const& self, KeyRange const& range, Optional const& summaryVersion, int const& rangeLimit ) { + #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new SummarizeBlobGranulesActorActor(self, range, summaryVersion, rangeLimit)); + #line 41733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 8526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +Future>> +Transaction::summarizeBlobGranules(const KeyRange& range, Optional summaryVersion, int rangeLimit) { + return summarizeBlobGranulesActor(this, range, summaryVersion, rangeLimit); +} + +void Transaction::addGranuleMaterializeStats(const GranuleMaterializeStats& stats) { + trState->cx->anyBGReads = true; + trState->cx->bgReadInputBytes += stats.inputBytes; + trState->cx->bgReadOutputBytes += stats.outputBytes; + trState->cx->bgReadSnapshotRows += stats.snapshotRows; + trState->cx->bgReadRowsCleared += stats.rowsCleared; + trState->cx->bgReadRowsInserted += stats.rowsInserted; + trState->cx->bgReadRowsUpdated += stats.rowsUpdated; } - #line 37980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { // This generated class is to be used only via setPerpetualStorageWiggle() - #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" template - #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" class SetPerpetualStorageWiggleActorState { - #line 37987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" SetPerpetualStorageWiggleActorState(Database const& cx,bool const& enable,LockAware const& lockAware) - #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" enable(enable), - #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" lockAware(lockAware), - #line 7857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr(cx) - #line 38000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr(cx), + #line 8544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(invalidVersion) + #line 41775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { fdb_probe_actor_create("setPerpetualStorageWiggle", reinterpret_cast(this)); @@ -38010,9 +41785,9 @@ class SetPerpetualStorageWiggleActorState { int a_body1(int loopDepth=0) { try { - #line 7858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 38015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -38033,10 +41808,10 @@ class SetPerpetualStorageWiggleActorState { } int a_body1cont1(int loopDepth) { - #line 7872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SetPerpetualStorageWiggleActorState(); static_cast(this)->destroy(); return 0; } - #line 38038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + #line 8560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(version); this->~SetPerpetualStorageWiggleActorState(); static_cast(this)->destroy(); return 0; } + #line 41813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(std::move(version)); // state_var_RVO this->~SetPerpetualStorageWiggleActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -38053,28 +41828,28 @@ class SetPerpetualStorageWiggleActorState { int a_body1loopBody1(int loopDepth) { try { - #line 7860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 7861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (lockAware) - #line 38060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 38064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 7865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr.set(perpetualStorageWiggleKey, enable ? "1"_sr : "0"_sr); - #line 7866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_0 = tr.commit(); - #line 7866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 38072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 7866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -38107,16 +41882,16 @@ class SetPerpetualStorageWiggleActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 7869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = tr.onError(e); - #line 7869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 38114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 7869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 41894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -38129,12 +41904,18 @@ class SetPerpetualStorageWiggleActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { + #line 8554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version = tr.getCommittedVersion(); + #line 41909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1loopBody1cont2(Void && _,int loopDepth) { + #line 8554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version = tr.getCommittedVersion(); + #line 41918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -38277,33 +42058,35 @@ class SetPerpetualStorageWiggleActorState { fdb_probe_actor_exit("setPerpetualStorageWiggle", reinterpret_cast(this), 1); } - #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" bool enable; - #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" LockAware lockAware; - #line 7857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ReadYourWritesTransaction tr; - #line 38288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 42071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; // This generated class is to be used only via setPerpetualStorageWiggle() - #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class SetPerpetualStorageWiggleActor final : public Actor, public ActorCallback< SetPerpetualStorageWiggleActor, 0, Void >, public ActorCallback< SetPerpetualStorageWiggleActor, 1, Void >, public FastAllocated, public SetPerpetualStorageWiggleActorState { - #line 38293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SetPerpetualStorageWiggleActor final : public Actor, public ActorCallback< SetPerpetualStorageWiggleActor, 0, Void >, public ActorCallback< SetPerpetualStorageWiggleActor, 1, Void >, public FastAllocated, public SetPerpetualStorageWiggleActorState { + #line 42076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< SetPerpetualStorageWiggleActor, 0, Void >; friend struct ActorCallback< SetPerpetualStorageWiggleActor, 1, Void >; - #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" SetPerpetualStorageWiggleActor(Database const& cx,bool const& enable,LockAware const& lockAware) - #line 38305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), + #line 42088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), SetPerpetualStorageWiggleActorState(cx, enable, lockAware) { fdb_probe_actor_enter("setPerpetualStorageWiggle", reinterpret_cast(this), -1); @@ -38327,57 +42110,61 @@ friend struct ActorCallback< SetPerpetualStorageWiggleActor, 1, Void >; } }; } - #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future setPerpetualStorageWiggle( Database const& cx, bool const& enable, LockAware const& lockAware ) { - #line 7856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new SetPerpetualStorageWiggleActor(cx, enable, lockAware)); - #line 38334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future setPerpetualStorageWiggle( Database const& cx, bool const& enable, LockAware const& lockAware ) { + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new SetPerpetualStorageWiggleActor(cx, enable, lockAware)); + #line 42117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 8562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 38339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 42122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via readStorageWiggleValues() - #line 7875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 7875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class ReadStorageWiggleValuesActorState { - #line 38346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via checkBlobSubrange() + #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class CheckBlobSubrangeActorState { + #line 42129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ReadStorageWiggleValuesActorState(Database const& cx,bool const& primary,bool const& use_system_priority) - #line 7875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : cx(cx), - #line 7875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - primary(primary), - #line 7875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - use_system_priority(use_system_priority), - #line 7878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - readKey(perpetualStorageWiggleIDPrefix.withSuffix(primary ? "primary/"_sr : "remote/"_sr)), - #line 7879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - metadataMap(readKey, IncludeVersion()), - #line 7881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr(new ReadYourWritesTransaction(cx)), - #line 7882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - res() - #line 38365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CheckBlobSubrangeActorState(Database const& db,KeyRange const& keyRange,Optional const& version) + #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db), + #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keyRange(keyRange), + #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version), + #line 8564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr(db), + #line 8565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + summaryVersion() + #line 42144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("readStorageWiggleValues", reinterpret_cast(this)); + fdb_probe_actor_create("checkBlobSubrange", reinterpret_cast(this)); } - ~ReadStorageWiggleValuesActorState() + ~CheckBlobSubrangeActorState() { - fdb_probe_actor_destroy("readStorageWiggleValues", reinterpret_cast(this)); + fdb_probe_actor_destroy("checkBlobSubrange", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 7884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (version.present()) + #line 42159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + summaryVersion = version.get(); + #line 42163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 38380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 42167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -38390,24 +42177,12 @@ class ReadStorageWiggleValuesActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~ReadStorageWiggleValuesActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~CheckBlobSubrangeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(int loopDepth) - { - #line 7898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV>>::futures) { (void)(res); this->~ReadStorageWiggleValuesActorState(); static_cast(this)->destroy(); return 0; } - #line 38403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(std::move(res)); // state_var_RVO - this->~ReadStorageWiggleValuesActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } int a_body1loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; @@ -38418,29 +42193,26 @@ class ReadStorageWiggleValuesActorState { int a_body1loopBody1(int loopDepth) { try { - #line 7886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 7887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); - #line 7888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (use_system_priority) - #line 38427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!summaryVersion.present()) + #line 42198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 7889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 38431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = tr.getReadVersion(); + #line 8573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 42204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 8573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 42209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont2(loopDepth); } - #line 7891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = store(res, metadataMap.getRange(tr, UID(0, 0), Optional(), CLIENT_KNOBS->TOO_MANY)); - #line 7891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 38437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 7891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; } catch (Error& error) { loopDepth = a_body1loopBody1Catch1(error, loopDepth); @@ -38450,19 +42222,6 @@ class ReadStorageWiggleValuesActorState { return loopDepth; } - int a_body1break1(int loopDepth) - { - try { - return a_body1cont1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } int a_body1loopBody1cont1(int loopDepth) { if (loopDepth == 0) return a_body1loopHead1(0); @@ -38472,16 +42231,16 @@ class ReadStorageWiggleValuesActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 7895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = tr->onError(e); - #line 7895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 38479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = tr.onError(e); + #line 8581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 42238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 7895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 3; + #line 8581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 42243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -38492,59 +42251,61 @@ class ReadStorageWiggleValuesActorState { return loopDepth; } - int a_body1loopBody1cont2(Void const& _,int loopDepth) + int a_body1loopBody1cont2(int loopDepth) { - #line 7892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = tr->commit(); - #line 7892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 38501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = success(tr.summarizeBlobGranules(keyRange, summaryVersion, std::numeric_limits::max())); + #line 8578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 42260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 7892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 8578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 42265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont2(Void && _,int loopDepth) + int a_body1loopBody1cont3(Version const& summaryVersion_,int loopDepth) { - #line 7892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = tr->commit(); - #line 7892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 38517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 7892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 38522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 8574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + summaryVersion = summaryVersion_; + #line 42274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } - int a_body1loopBody1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont3(Version && summaryVersion_,int loopDepth) { - loopDepth = a_body1loopBody1cont2(_, loopDepth); + #line 8574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + summaryVersion = summaryVersion_; + #line 42283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } - int a_body1loopBody1when1(Void && _,int loopDepth) + int a_body1loopBody1when1(Version const& summaryVersion_,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont3(summaryVersion_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Version && summaryVersion_,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(summaryVersion_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ReadStorageWiggleValuesActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckBlobSubrangeActor, 0, Version >::remove(); } - void a_callback_fire(ActorCallback< ReadStorageWiggleValuesActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< CheckBlobSubrangeActor, 0, Version >*,Version const& value) { - fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 0); + fdb_probe_actor_enter("checkBlobSubrange", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -38554,12 +42315,12 @@ class ReadStorageWiggleValuesActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 0); + fdb_probe_actor_exit("checkBlobSubrange", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< ReadStorageWiggleValuesActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< CheckBlobSubrangeActor, 0, Version >*,Version && value) { - fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 0); + fdb_probe_actor_enter("checkBlobSubrange", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -38569,12 +42330,12 @@ class ReadStorageWiggleValuesActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 0); + fdb_probe_actor_exit("checkBlobSubrange", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< ReadStorageWiggleValuesActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< CheckBlobSubrangeActor, 0, Version >*,Error err) { - fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 0); + fdb_probe_actor_enter("checkBlobSubrange", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1Catch1(err, 0); @@ -38584,42 +42345,54 @@ class ReadStorageWiggleValuesActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 0); + fdb_probe_actor_exit("checkBlobSubrange", reinterpret_cast(this), 0); } - int a_body1loopBody1cont4(Void const& _,int loopDepth) + int a_body1loopBody1cont5(Void const& _,int loopDepth) { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + #line 8579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(summaryVersion.get()); this->~CheckBlobSubrangeActorState(); static_cast(this)->destroy(); return 0; } + #line 42355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(summaryVersion.get()); + this->~CheckBlobSubrangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1loopBody1cont4(Void && _,int loopDepth) + int a_body1loopBody1cont5(Void && _,int loopDepth) { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + #line 8579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(summaryVersion.get()); this->~CheckBlobSubrangeActorState(); static_cast(this)->destroy(); return 0; } + #line 42367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(summaryVersion.get()); + this->~CheckBlobSubrangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } int a_body1loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(_, loopDepth); + loopDepth = a_body1loopBody1cont5(_, loopDepth); return loopDepth; } int a_body1loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont5(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ReadStorageWiggleValuesActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckBlobSubrangeActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< ReadStorageWiggleValuesActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< CheckBlobSubrangeActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 1); + fdb_probe_actor_enter("checkBlobSubrange", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1cont2when1(value, 0); @@ -38629,12 +42402,12 @@ class ReadStorageWiggleValuesActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 1); + fdb_probe_actor_exit("checkBlobSubrange", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< ReadStorageWiggleValuesActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< CheckBlobSubrangeActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 1); + fdb_probe_actor_enter("checkBlobSubrange", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1cont2when1(std::move(value), 0); @@ -38644,12 +42417,12 @@ class ReadStorageWiggleValuesActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 1); + fdb_probe_actor_exit("checkBlobSubrange", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< ReadStorageWiggleValuesActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< CheckBlobSubrangeActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 1); + fdb_probe_actor_enter("checkBlobSubrange", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1Catch1(err, 0); @@ -38659,7 +42432,7 @@ class ReadStorageWiggleValuesActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 1); + fdb_probe_actor_exit("checkBlobSubrange", reinterpret_cast(this), 1); } int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) @@ -38688,13 +42461,13 @@ class ReadStorageWiggleValuesActorState { } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ReadStorageWiggleValuesActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckBlobSubrangeActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< ReadStorageWiggleValuesActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< CheckBlobSubrangeActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 2); + fdb_probe_actor_enter("checkBlobSubrange", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1loopBody1Catch1when1(value, 0); @@ -38704,12 +42477,12 @@ class ReadStorageWiggleValuesActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 2); + fdb_probe_actor_exit("checkBlobSubrange", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< ReadStorageWiggleValuesActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< CheckBlobSubrangeActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 2); + fdb_probe_actor_enter("checkBlobSubrange", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1loopBody1Catch1when1(std::move(value), 0); @@ -38719,12 +42492,12 @@ class ReadStorageWiggleValuesActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 2); + fdb_probe_actor_exit("checkBlobSubrange", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< ReadStorageWiggleValuesActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< CheckBlobSubrangeActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 2); + fdb_probe_actor_enter("checkBlobSubrange", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -38734,52 +42507,48 @@ class ReadStorageWiggleValuesActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 2); + fdb_probe_actor_exit("checkBlobSubrange", reinterpret_cast(this), 2); } - #line 7875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Database cx; - #line 7875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bool primary; - #line 7875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bool use_system_priority; - #line 7878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - const Key readKey; - #line 7879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyBackedObjectMap metadataMap; - #line 7881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference tr; - #line 7882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector> res; - #line 38754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database db; + #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange keyRange; + #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional version; + #line 8564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Transaction tr; + #line 8565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional summaryVersion; + #line 42523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via readStorageWiggleValues() - #line 7875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class ReadStorageWiggleValuesActor final : public Actor>>, public ActorCallback< ReadStorageWiggleValuesActor, 0, Void >, public ActorCallback< ReadStorageWiggleValuesActor, 1, Void >, public ActorCallback< ReadStorageWiggleValuesActor, 2, Void >, public FastAllocated, public ReadStorageWiggleValuesActorState { - #line 38759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via checkBlobSubrange() + #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class CheckBlobSubrangeActor final : public Actor, public ActorCallback< CheckBlobSubrangeActor, 0, Version >, public ActorCallback< CheckBlobSubrangeActor, 1, Void >, public ActorCallback< CheckBlobSubrangeActor, 2, Void >, public FastAllocated, public CheckBlobSubrangeActorState { + #line 42528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< ReadStorageWiggleValuesActor, 0, Void >; -friend struct ActorCallback< ReadStorageWiggleValuesActor, 1, Void >; -friend struct ActorCallback< ReadStorageWiggleValuesActor, 2, Void >; - #line 7875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ReadStorageWiggleValuesActor(Database const& cx,bool const& primary,bool const& use_system_priority) - #line 38772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor>>(), - ReadStorageWiggleValuesActorState(cx, primary, use_system_priority) +friend struct ActorCallback< CheckBlobSubrangeActor, 0, Version >; +friend struct ActorCallback< CheckBlobSubrangeActor, 1, Void >; +friend struct ActorCallback< CheckBlobSubrangeActor, 2, Void >; + #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CheckBlobSubrangeActor(Database const& db,KeyRange const& keyRange,Optional const& version) + #line 42541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + CheckBlobSubrangeActorState(db, keyRange, version) { - fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), -1); + fdb_probe_actor_enter("checkBlobSubrange", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("readStorageWiggleValues"); + this->lineage.setActorName("checkBlobSubrange"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), -1); + fdb_probe_actor_exit("checkBlobSubrange", reinterpret_cast(this), -1); } void cancel() override @@ -38787,72 +42556,92 @@ friend struct ActorCallback< ReadStorageWiggleValuesActor, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ReadStorageWiggleValuesActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< ReadStorageWiggleValuesActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< ReadStorageWiggleValuesActor, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< CheckBlobSubrangeActor, 0, Version >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CheckBlobSubrangeActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< CheckBlobSubrangeActor, 2, Void >*)0, actor_cancelled()); break; } } }; } - #line 7875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future>> readStorageWiggleValues( Database const& cx, bool const& primary, bool const& use_system_priority ) { - #line 7875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future>>(new ReadStorageWiggleValuesActor(cx, primary, use_system_priority)); - #line 38802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future checkBlobSubrange( Database const& db, KeyRange const& keyRange, Optional const& version ) { + #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new CheckBlobSubrangeActor(db, keyRange, version)); + #line 42571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 8585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 38807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 42576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via splitStorageMetricsStream() - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class SplitStorageMetricsStreamActorState { - #line 38814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via verifyBlobRangeActor() + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class VerifyBlobRangeActorActorState { + #line 42583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SplitStorageMetricsStreamActorState(PromiseStream const& resultStream,Database const& cx,KeyRange const& keys,StorageMetrics const& limit,StorageMetrics const& estimated) - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : resultStream(resultStream), - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx(cx), - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - keys(keys), - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - limit(limit), - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - estimated(estimated), - #line 7906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:SplitStorageMetricsStream"_loc), - #line 7907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - beginKey(keys.begin), - #line 7908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - globalLastKey(beginKey) - #line 38835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + VerifyBlobRangeActorActorState(Reference const& cx,KeyRange const& range,Optional const& version,Optional> const& tenant) + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version), + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenant(tenant), + #line 8590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db(cx), + #line 8591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr(db), + #line 8592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + allRanges(), + #line 8593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + curRegion(KeyRangeRef(range.begin, range.begin)), + #line 8594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + readVersionOut(invalidVersion), + #line 8595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + batchSize(BUGGIFY ? deterministicRandom()->randomInt(2, 10) : CLIENT_KNOBS->BG_TOO_MANY_GRANULES / 2), + #line 8596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + loadSize((BUGGIFY ? deterministicRandom()->randomInt(1, 20) : 20) * batchSize) + #line 42610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("splitStorageMetricsStream", reinterpret_cast(this)); + fdb_probe_actor_create("verifyBlobRangeActor", reinterpret_cast(this)); } - ~SplitStorageMetricsStreamActorState() + ~VerifyBlobRangeActorActorState() { - fdb_probe_actor_destroy("splitStorageMetricsStream", reinterpret_cast(this)); + fdb_probe_actor_destroy("verifyBlobRangeActor", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 7909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - resultStream.send(beginKey); - #line 7911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - globalUsed = StorageMetrics(); - #line 7912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 38854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); + #line 8598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (version.present()) + #line 42625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (version.get() == latestVersion) + #line 42629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 42633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + else + { + loopDepth = a_body1cont2(loopDepth); + } + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -38864,21 +42653,56 @@ class SplitStorageMetricsStreamActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~SplitStorageMetricsStreamActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~VerifyBlobRangeActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 7993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SplitStorageMetricsStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 38877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~SplitStorageMetricsStreamActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 8616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (tenant.present()) + #line 42666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = tenant.get()->ready(); + #line 8617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 42672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 8617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 42677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont6(loopDepth); + } + + return loopDepth; + } + int a_body1cont2(int loopDepth) + { + #line 8610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (version.get() <= 0) + #line 42691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("VerifyBlobInvalidVersion").detail("Range", range).detail("Version", version); + #line 8612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(unsupported_operation(), loopDepth); + #line 42697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont3(int loopDepth) + { + loopDepth = a_body1cont2(loopDepth); return loopDepth; } @@ -38891,24 +42715,31 @@ class SplitStorageMetricsStreamActorState { } int a_body1loopBody1(int loopDepth) { - #line 7913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_0 = getKeyRangeLocations(cx, Optional(), KeyRangeRef(beginKey, keys.end), CLIENT_KNOBS->STORAGE_METRICS_SHARD_LIMIT, Reverse::False, &StorageServerInterface::splitMetrics, span.context, Optional(), UseProvisionalProxies::False, latestVersion); - #line 7913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 38898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 7913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 38903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + try { + #line 8602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = tr.getReadVersion(); + #line 8602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 42723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 8602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 42728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } return loopDepth; } int a_body1break1(int loopDepth) { try { - return a_body1cont1(loopDepth); + return a_body1cont3(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -38919,367 +42750,436 @@ class SplitStorageMetricsStreamActorState { return loopDepth; } int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 7927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - localUsed = globalUsed; - #line 7928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - localLastKey = globalLastKey; - #line 7929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results = Standalone>(); - #line 7930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - i = 0; - #line 7931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 38934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); + #line 8606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = tr.onError(e); + #line 8606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 42765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 8606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 42770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1loopBody1cont1Catch1(error, loopDepth); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - loopDepth = a_body1loopBody1cont1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } return loopDepth; } - int a_body1loopBody1when1(std::vector const& __locations,int loopDepth) + int a_body1loopBody1cont2(Version const& _version,int loopDepth) { - #line 7913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - locations = __locations; - #line 38949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 8603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version = _version; + #line 42785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1loopBody1when1(std::vector && __locations,int loopDepth) + int a_body1loopBody1cont2(Version && _version,int loopDepth) { - locations = std::move(__locations); - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 8603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version = _version; + #line 42794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when1(Version const& _version,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(_version, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Version && _version,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(_version), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SplitStorageMetricsStreamActor, 0, std::vector >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< VerifyBlobRangeActorActor, 0, Version >::remove(); } - void a_callback_fire(ActorCallback< SplitStorageMetricsStreamActor, 0, std::vector >*,std::vector const& value) + void a_callback_fire(ActorCallback< VerifyBlobRangeActorActor, 0, Version >*,Version const& value) { - fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 0); + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 0); + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< SplitStorageMetricsStreamActor, 0, std::vector >*,std::vector && value) + void a_callback_fire(ActorCallback< VerifyBlobRangeActorActor, 0, Version >*,Version && value) { - fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 0); + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 0); + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< SplitStorageMetricsStreamActor, 0, std::vector >*,Error err) + void a_callback_error(ActorCallback< VerifyBlobRangeActorActor, 0, Version >*,Error err) { - fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 0); + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 0); + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 0); } - int a_body1loopBody1cont2(int loopDepth) + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont1Catch1(const Error& e,int loopDepth=0) + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - try { - #line 7981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_operation_cancelled) - #line 39023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 39027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() != error_code_wrong_shard_server && e.code() != error_code_all_alternatives_failed) - #line 39031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevError, "SplitStorageMetricsStreamError").error(e); - #line 7986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - resultStream.sendError(e); - #line 7987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 39039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(Key(), keys); - #line 7990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution); - #line 7990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 39047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 7990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 39052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont3(int loopDepth) + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - #line 7958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - globalUsed = localUsed; - #line 7961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (keys.end <= locations.back().range.end && globalUsed.allLessOrEqual(limit * CLIENT_KNOBS->STORAGE_METRICS_UNFAIR_SPLIT_LIMIT) && results.size() > 1) - #line 39069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.resize(results.arena(), results.size() - 1); - #line 7965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - localLastKey = results.back(); - #line 39075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - globalLastKey = localLastKey; - #line 7969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& splitKey : results ) { - #line 7970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - resultStream.send(splitKey); - #line 39083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 7973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (keys.end <= locations.back().range.end) - #line 39087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - resultStream.send(keys.end); - #line 7975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - resultStream.sendError(end_of_stream()); - #line 39093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - return a_body1break1(loopDepth==0?0:loopDepth-1); // break - } - else - { - #line 7978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - beginKey = locations.back().range.end; - #line 39100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - loopDepth = a_body1loopBody1cont9(loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont1loopHead1(int loopDepth) + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1cont1loopBody1(loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - int a_body1loopBody1cont1loopBody1(int loopDepth) + void a_exitChoose2() { - #line 7931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!(i < locations.size())) - #line 39117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break - } - #line 7932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SplitMetricsRequest req(locations[i].range, limit, localUsed, estimated, i == locations.size() - 1 && keys.end <= locations.back().range.end); - #line 7937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = loadBalance(locations[i].locations->locations(), &StorageServerInterface::splitMetrics, req, TaskPriority::DataDistribution); - #line 7937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 39127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 7937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 39132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< VerifyBlobRangeActorActor, 1, Void >::remove(); - return loopDepth; } - int a_body1loopBody1cont1break1(int loopDepth) + void a_callback_fire(ActorCallback< VerifyBlobRangeActorActor, 1, Void >*,Void const& value) { + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - return a_body1loopBody1cont3(loopDepth); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { - loopDepth = a_body1loopBody1cont1Catch1(error, loopDepth); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1loopBody1cont1Catch1(unknown_error(), loopDepth); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1loopBody1cont1loopBody1cont1(SplitMetricsReply const& res,int loopDepth) + void a_callback_fire(ActorCallback< VerifyBlobRangeActorActor, 1, Void >*,Void && value) { - #line 7941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (res.splits.size() && res.splits[0] <= localLastKey) - #line 39154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT_WE_THINK(false); - #line 7945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1loopBody1cont1Catch1(all_alternatives_failed(), std::max(0, loopDepth - 1)); - #line 39160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); } - #line 7948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (res.splits.size()) - #line 39164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.append(results.arena(), res.splits.begin(), res.splits.size()); - #line 7950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.arena().dependsOn(res.splits.arena()); - #line 7951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - localLastKey = res.splits.back(); - #line 39172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); } - #line 7953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - localUsed = res.used; - #line 7931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - i++; - #line 39178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (loopDepth == 0) return a_body1loopBody1cont1loopHead1(0); + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1loopBody1cont1loopBody1cont1(SplitMetricsReply && res,int loopDepth) + void a_callback_error(ActorCallback< VerifyBlobRangeActorActor, 1, Void >*,Error err) { - #line 7941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (res.splits.size() && res.splits[0] <= localLastKey) - #line 39187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT_WE_THINK(false); - #line 7945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1loopBody1cont1Catch1(all_alternatives_failed(), std::max(0, loopDepth - 1)); - #line 39193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); } - #line 7948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (res.splits.size()) - #line 39197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 7949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.append(results.arena(), res.splits.begin(), res.splits.size()); - #line 7950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.arena().dependsOn(res.splits.arena()); - #line 7951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - localLastKey = res.splits.back(); - #line 39205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); } - #line 7953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - localUsed = res.used; - #line 7931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - i++; - #line 39211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (loopDepth == 0) return a_body1loopBody1cont1loopHead1(0); + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 1); + + } + int a_body1cont6(int loopDepth) + { + #line 8622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 42941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont6loopHead1(loopDepth); return loopDepth; } - int a_body1loopBody1cont1loopBody1when1(SplitMetricsReply const& res,int loopDepth) + int a_body1cont7(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1loopBody1cont1(res, loopDepth); + #line 8618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range = range.withPrefix(tenant.get()->prefix()); + #line 8619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + curRegion = KeyRangeRef(range.begin, range.begin); + #line 42952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont6(loopDepth); return loopDepth; } - int a_body1loopBody1cont1loopBody1when1(SplitMetricsReply && res,int loopDepth) + int a_body1cont7(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1loopBody1cont1(std::move(res), loopDepth); + #line 8618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range = range.withPrefix(tenant.get()->prefix()); + #line 8619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + curRegion = KeyRangeRef(range.begin, range.begin); + #line 42963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont6(loopDepth); return loopDepth; } - void a_exitChoose2() + int a_body1cont1when1(Void const& _,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SplitStorageMetricsStreamActor, 1, SplitMetricsReply >::remove(); + loopDepth = a_body1cont7(_, loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< SplitStorageMetricsStreamActor, 1, SplitMetricsReply >*,SplitMetricsReply const& value) + int a_body1cont1when1(Void && _,int loopDepth) { - fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 1); - a_exitChoose2(); + loopDepth = a_body1cont7(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< VerifyBlobRangeActorActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< VerifyBlobRangeActorActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1cont1loopBody1when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { - a_body1loopBody1cont1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1cont1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 1); + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< SplitStorageMetricsStreamActor, 1, SplitMetricsReply >*,SplitMetricsReply && value) + void a_callback_fire(ActorCallback< VerifyBlobRangeActorActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1cont1loopBody1when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1cont1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1cont1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 1); + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< SplitStorageMetricsStreamActor, 1, SplitMetricsReply >*,Error err) + void a_callback_error(ActorCallback< VerifyBlobRangeActorActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1cont1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1cont1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1cont1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 1); + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 2); } - int a_body1loopBody1cont9(int loopDepth) + int a_body1cont6loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont6loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont6loopBody1(int loopDepth) + { + #line 8623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (curRegion.begin >= range.end) + #line 43042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(readVersionOut); this->~VerifyBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 43046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(std::move(readVersionOut)); // state_var_RVO + this->~VerifyBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 8626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 43054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont6loopBody1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont6loopBody1cont1(int loopDepth) + { + #line 8635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (allRanges.empty()) + #line 43063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (curRegion.begin < range.end) + #line 43067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(invalidVersion); this->~VerifyBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 43071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(invalidVersion); + this->~VerifyBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 8639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(readVersionOut); this->~VerifyBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 43079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(std::move(readVersionOut)); // state_var_RVO + this->~VerifyBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 8642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + checkParts = std::vector>(); + #line 8644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int batchCount = 0; + #line 8645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : allRanges ) { + #line 8646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (it.begin > curRegion.end) + #line 43093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(invalidVersion); this->~VerifyBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 43097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(invalidVersion); + this->~VerifyBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 8650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + curRegion = KeyRangeRef(curRegion.begin, it.end); + #line 8651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + batchCount++; + #line 8653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (batchCount == batchSize) + #line 43109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + checkParts.push_back(checkBlobSubrange(db, curRegion, version)); + #line 8655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + batchCount = 0; + #line 8656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + curRegion = KeyRangeRef(curRegion.end, curRegion.end); + #line 43117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 8659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!curRegion.empty()) + #line 43122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + checkParts.push_back(checkBlobSubrange(db, curRegion, version)); + #line 43126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + try { + #line 8664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_5 = waitForAll(checkParts); + #line 8664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont6loopBody1cont1Catch1(actor_cancelled(), loopDepth); + #line 43133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont6loopBody1cont1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont6loopBody1cont1when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 8664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 43138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont6loopBody1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont6loopBody1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont6loopBody1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont6loopBody1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont6loopBody1loopBody1(int loopDepth) { try { - loopDepth = a_body1loopBody1cont2(loopDepth); + #line 8628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = store(allRanges, tr.getBlobGranuleRanges(KeyRangeRef(curRegion.begin, range.end), loadSize)); + #line 8628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont6loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 43163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont6loopBody1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6loopBody1loopBody1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 8628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 43168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont6loopBody1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont6loopBody1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont6loopBody1break1(int loopDepth) + { + try { + return a_body1cont6loopBody1cont1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); @@ -39289,70 +43189,174 @@ class SplitStorageMetricsStreamActorState { return loopDepth; } - int a_body1loopBody1cont1Catch1cont1(Void const& _,int loopDepth) + int a_body1cont6loopBody1loopBody1cont1(int loopDepth) { - loopDepth = a_body1loopBody1cont2(loopDepth); + if (loopDepth == 0) return a_body1cont6loopBody1loopHead1(0); return loopDepth; } - int a_body1loopBody1cont1Catch1cont1(Void && _,int loopDepth) + int a_body1cont6loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) { - loopDepth = a_body1loopBody1cont2(loopDepth); + try { + #line 8631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = tr.onError(e); + #line 8631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); + #line 43205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 2)); else return a_body1cont6loopBody1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 8631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 43210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 2)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 2)); + } return loopDepth; } - int a_body1loopBody1cont1Catch1when1(Void const& _,int loopDepth) + int a_body1cont6loopBody1loopBody1cont2(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1Catch1cont1(_, loopDepth); + return a_body1cont6loopBody1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1loopBody1cont1Catch1when1(Void && _,int loopDepth) + int a_body1cont6loopBody1loopBody1cont2(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1Catch1cont1(std::move(_), loopDepth); + return a_body1cont6loopBody1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - void a_exitChoose3() + int a_body1cont6loopBody1loopBody1when1(Void const& _,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SplitStorageMetricsStreamActor, 2, Void >::remove(); + loopDepth = a_body1cont6loopBody1loopBody1cont2(_, loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< SplitStorageMetricsStreamActor, 2, Void >*,Void const& value) + int a_body1cont6loopBody1loopBody1when1(Void && _,int loopDepth) { - fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 2); - a_exitChoose3(); + loopDepth = a_body1cont6loopBody1loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< VerifyBlobRangeActorActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< VerifyBlobRangeActorActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1loopBody1cont1Catch1when1(value, 0); + a_body1cont6loopBody1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1cont6loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont6loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< VerifyBlobRangeActorActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont6loopBody1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont6loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont6loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< VerifyBlobRangeActorActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont6loopBody1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont6loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont6loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 3); + + } + int a_body1cont6loopBody1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont6loopBody1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont6loopBody1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1cont6loopBody1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont6loopBody1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont6loopBody1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont6loopBody1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont6loopBody1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< VerifyBlobRangeActorActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< VerifyBlobRangeActorActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont6loopBody1loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 2); + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< SplitStorageMetricsStreamActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< VerifyBlobRangeActorActor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1cont1Catch1when1(std::move(value), 0); + a_body1cont6loopBody1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 2); + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< SplitStorageMetricsStreamActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< VerifyBlobRangeActorActor, 4, Void >*,Error err) { - fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 4); + a_exitChoose5(); try { a_body1Catch1(err, 0); } @@ -39361,66 +43365,193 @@ class SplitStorageMetricsStreamActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 2); + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 4); } - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - PromiseStream resultStream; - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Database cx; - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRange keys; - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StorageMetrics limit; - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StorageMetrics estimated; - #line 7906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Span span; - #line 7907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key beginKey; - #line 7908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key globalLastKey; - #line 7911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StorageMetrics globalUsed; - #line 7913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector locations; - #line 7927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StorageMetrics localUsed; - #line 7928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key localLastKey; - #line 7929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Standalone> results; - #line 7930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int i; - #line 39395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + int a_body1cont6loopBody1cont3(int loopDepth) + { + #line 8671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!checkParts.empty()); + #line 8672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + readVersionOut = checkParts.back().get(); + #line 8673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + curRegion = KeyRangeRef(curRegion.end, curRegion.end); + #line 43379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1cont6loopHead1(0); + + return loopDepth; + } + int a_body1cont6loopBody1cont1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 8666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_blob_granule_transaction_too_old) + #line 43389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(invalidVersion); this->~VerifyBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 43393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Version >::value()) Version(invalidVersion); + this->~VerifyBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 8669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 43401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont6loopBody1cont10(Void const& _,int loopDepth) + { + loopDepth = a_body1cont6loopBody1cont10cont1(loopDepth); + + return loopDepth; + } + int a_body1cont6loopBody1cont10(Void && _,int loopDepth) + { + loopDepth = a_body1cont6loopBody1cont10cont1(loopDepth); + + return loopDepth; + } + int a_body1cont6loopBody1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont6loopBody1cont10(_, loopDepth); + + return loopDepth; + } + int a_body1cont6loopBody1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont6loopBody1cont10(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< VerifyBlobRangeActorActor, 5, Void >::remove(); + + } + void a_callback_fire(ActorCallback< VerifyBlobRangeActorActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont6loopBody1cont1when1(value, 0); + } + catch (Error& error) { + a_body1cont6loopBody1cont1Catch1(error, 0); + } catch (...) { + a_body1cont6loopBody1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< VerifyBlobRangeActorActor, 5, Void >*,Void && value) + { + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont6loopBody1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont6loopBody1cont1Catch1(error, 0); + } catch (...) { + a_body1cont6loopBody1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< VerifyBlobRangeActorActor, 5, Void >*,Error err) + { + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont6loopBody1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont6loopBody1cont1Catch1(error, 0); + } catch (...) { + a_body1cont6loopBody1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), 5); + + } + int a_body1cont6loopBody1cont10cont1(int loopDepth) + { + try { + loopDepth = a_body1cont6loopBody1cont3(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference cx; + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional version; + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional> tenant; + #line 8590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database db; + #line 8591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Transaction tr; + #line 8592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone> allRanges; + #line 8593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange curRegion; + #line 8594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version readVersionOut; + #line 8595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int batchSize; + #line 8596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int loadSize; + #line 8642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> checkParts; + #line 43523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via splitStorageMetricsStream() - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class SplitStorageMetricsStreamActor final : public Actor, public ActorCallback< SplitStorageMetricsStreamActor, 0, std::vector >, public ActorCallback< SplitStorageMetricsStreamActor, 1, SplitMetricsReply >, public ActorCallback< SplitStorageMetricsStreamActor, 2, Void >, public FastAllocated, public SplitStorageMetricsStreamActorState { - #line 39400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via verifyBlobRangeActor() + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class VerifyBlobRangeActorActor final : public Actor, public ActorCallback< VerifyBlobRangeActorActor, 0, Version >, public ActorCallback< VerifyBlobRangeActorActor, 1, Void >, public ActorCallback< VerifyBlobRangeActorActor, 2, Void >, public ActorCallback< VerifyBlobRangeActorActor, 3, Void >, public ActorCallback< VerifyBlobRangeActorActor, 4, Void >, public ActorCallback< VerifyBlobRangeActorActor, 5, Void >, public FastAllocated, public VerifyBlobRangeActorActorState { + #line 43528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< SplitStorageMetricsStreamActor, 0, std::vector >; -friend struct ActorCallback< SplitStorageMetricsStreamActor, 1, SplitMetricsReply >; -friend struct ActorCallback< SplitStorageMetricsStreamActor, 2, Void >; - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SplitStorageMetricsStreamActor(PromiseStream const& resultStream,Database const& cx,KeyRange const& keys,StorageMetrics const& limit,StorageMetrics const& estimated) - #line 39413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - SplitStorageMetricsStreamActorState(resultStream, cx, keys, limit, estimated) +friend struct ActorCallback< VerifyBlobRangeActorActor, 0, Version >; +friend struct ActorCallback< VerifyBlobRangeActorActor, 1, Void >; +friend struct ActorCallback< VerifyBlobRangeActorActor, 2, Void >; +friend struct ActorCallback< VerifyBlobRangeActorActor, 3, Void >; +friend struct ActorCallback< VerifyBlobRangeActorActor, 4, Void >; +friend struct ActorCallback< VerifyBlobRangeActorActor, 5, Void >; + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + VerifyBlobRangeActorActor(Reference const& cx,KeyRange const& range,Optional const& version,Optional> const& tenant) + #line 43544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + VerifyBlobRangeActorActorState(cx, range, version, tenant) { - fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), -1); + fdb_probe_actor_enter("verifyBlobRangeActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("splitStorageMetricsStream"); + this->lineage.setActorName("verifyBlobRangeActor"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), -1); + fdb_probe_actor_exit("verifyBlobRangeActor", reinterpret_cast(this), -1); } void cancel() override @@ -39428,70 +43559,87 @@ friend struct ActorCallback< SplitStorageMetricsStreamActor, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< SplitStorageMetricsStreamActor, 0, std::vector >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< SplitStorageMetricsStreamActor, 1, SplitMetricsReply >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< SplitStorageMetricsStreamActor, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< VerifyBlobRangeActorActor, 0, Version >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< VerifyBlobRangeActorActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< VerifyBlobRangeActorActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< VerifyBlobRangeActorActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< VerifyBlobRangeActorActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< VerifyBlobRangeActorActor, 5, Void >*)0, actor_cancelled()); break; } } }; } - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future splitStorageMetricsStream( PromiseStream const& resultStream, Database const& cx, KeyRange const& keys, StorageMetrics const& limit, StorageMetrics const& estimated ) { - #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new SplitStorageMetricsStreamActor(resultStream, cx, keys, limit, estimated)); - #line 39443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future verifyBlobRangeActor( Reference const& cx, KeyRange const& range, Optional const& version, Optional> const& tenant ) { + #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new VerifyBlobRangeActorActor(cx, range, version, tenant)); + #line 43577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 7995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 8676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -Future DatabaseContext::splitStorageMetricsStream(const PromiseStream& resultStream, - KeyRange const& keys, - StorageMetrics const& limit, - StorageMetrics const& estimated) { - return ::splitStorageMetricsStream( - resultStream, Database(Reference::addRef(this)), keys, limit, estimated); +Future DatabaseContext::verifyBlobRange(const KeyRange& range, + Optional version, + Optional> tenant) { + return verifyBlobRangeActor(Reference::addRef(this), range, version, tenant); } - #line 39456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 43588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via splitStorageMetrics() - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class SplitStorageMetricsActorState { - #line 39463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via flushBlobRangeActor() + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class FlushBlobRangeActorActorState { + #line 43595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SplitStorageMetricsActorState(Database const& cx,KeyRange const& keys,StorageMetrics const& limit,StorageMetrics const& estimated) - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + FlushBlobRangeActorActorState(Reference const& cx,KeyRange const& range,bool const& compact,Optional const& version,Optional> const& tenant) + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - keys(keys), - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - limit(limit), - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - estimated(estimated), - #line 8008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:SplitStorageMetrics"_loc) - #line 39478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + compact(compact), + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version), + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenant(tenant) + #line 43610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("splitStorageMetrics", reinterpret_cast(this)); + fdb_probe_actor_create("flushBlobRangeActor", reinterpret_cast(this)); } - ~SplitStorageMetricsActorState() + ~FlushBlobRangeActorActorState() { - fdb_probe_actor_destroy("splitStorageMetrics", reinterpret_cast(this)); + fdb_probe_actor_destroy("flushBlobRangeActor", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 8009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 39493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); + #line 8688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (tenant.present()) + #line 43625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = tenant.get()->ready(); + #line 8689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 43631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 8689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 43636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -39503,134 +43651,110 @@ class SplitStorageMetricsActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~SplitStorageMetricsActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlushBlobRangeActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1loopHead1(int loopDepth) + int a_body1cont1(int loopDepth) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + #line 8692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db = Database(cx); + #line 8693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!version.present()) + #line 43666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr = Transaction(db); + #line 8695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = tr.getReadVersion(); + #line 8695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 43674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 8695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 43679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont4(loopDepth); + } return loopDepth; } - int a_body1loopBody1(int loopDepth) + int a_body1cont2(Void const& _,int loopDepth) { - #line 8010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_0 = getKeyRangeLocations(cx, Optional(), keys, CLIENT_KNOBS->STORAGE_METRICS_SHARD_LIMIT, Reverse::False, &StorageServerInterface::splitMetrics, span.context, Optional(), UseProvisionalProxies::False, latestVersion); - #line 8010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 39525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 39530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 8690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range = range.withPrefix(tenant.get()->prefix()); + #line 43693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) + int a_body1cont2(Void && _,int loopDepth) { - #line 8021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - used = StorageMetrics(); - #line 8022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results = Standalone>(); - #line 8026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (locations.size() == CLIENT_KNOBS->STORAGE_METRICS_SHARD_LIMIT) - #line 39543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = delay(CLIENT_KNOBS->STORAGE_METRICS_TOO_MANY_SHARDS_DELAY, TaskPriority::DataDistribution); - #line 8027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 39549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 39554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 8030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.push_back_deep(results.arena(), keys.begin); - #line 39561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - try { - #line 8034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - i = 0; - #line 8035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 39567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1loopBody1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1cont1Catch1(unknown_error(), loopDepth); - } - } + #line 8690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range = range.withPrefix(tenant.get()->prefix()); + #line 43702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1when1(std::vector const& __locations,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - #line 8010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - locations = __locations; - #line 39583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont2(_, loopDepth); return loopDepth; } - int a_body1loopBody1when1(std::vector && __locations,int loopDepth) + int a_body1when1(Void && _,int loopDepth) { - locations = std::move(__locations); - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont2(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SplitStorageMetricsActor, 0, std::vector >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlushBlobRangeActorActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 0, std::vector >*,std::vector const& value) + void a_callback_fire(ActorCallback< FlushBlobRangeActorActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flushBlobRangeActor", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flushBlobRangeActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 0, std::vector >*,std::vector && value) + void a_callback_fire(ActorCallback< FlushBlobRangeActorActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flushBlobRangeActor", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flushBlobRangeActor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< SplitStorageMetricsActor, 0, std::vector >*,Error err) + void a_callback_error(ActorCallback< FlushBlobRangeActorActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flushBlobRangeActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -39640,84 +43764,104 @@ class SplitStorageMetricsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flushBlobRangeActor", reinterpret_cast(this), 0); } - int a_body1loopBody1cont2(int loopDepth) + int a_body1cont4(int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); + #line 8698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + FlushGranuleRequest req(-1, range, version.get(), compact); + #line 43774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + try { + #line 8700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = success(doBlobGranuleRequests(db, range, req, &BlobWorkerInterface::flushGranuleRequest)); + #line 8700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont4Catch1(actor_cancelled(), loopDepth); + #line 43780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont4Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont4when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 8700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 43785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont4Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont4Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1loopBody1cont3(Void const& _,int loopDepth) + int a_body1cont5(Version const& _v,int loopDepth) { - #line 8028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(Key(), keys); - #line 39656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont2(loopDepth); + #line 8696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version = _v; + #line 43800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont4(loopDepth); return loopDepth; } - int a_body1loopBody1cont3(Void && _,int loopDepth) + int a_body1cont5(Version && _v,int loopDepth) { - #line 8028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(Key(), keys); - #line 39665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont2(loopDepth); + #line 8696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version = _v; + #line 43809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont4(loopDepth); return loopDepth; } - int a_body1loopBody1cont1when1(Void const& _,int loopDepth) + int a_body1cont1when1(Version const& _v,int loopDepth) { - loopDepth = a_body1loopBody1cont3(_, loopDepth); + loopDepth = a_body1cont5(_v, loopDepth); return loopDepth; } - int a_body1loopBody1cont1when1(Void && _,int loopDepth) + int a_body1cont1when1(Version && _v,int loopDepth) { - loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + loopDepth = a_body1cont5(std::move(_v), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SplitStorageMetricsActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlushBlobRangeActorActor, 1, Version >::remove(); } - void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlushBlobRangeActorActor, 1, Version >*,Version const& value) { - fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flushBlobRangeActor", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1cont1when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flushBlobRangeActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlushBlobRangeActorActor, 1, Version >*,Version && value) { - fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flushBlobRangeActor", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1cont1when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flushBlobRangeActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< SplitStorageMetricsActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< FlushBlobRangeActorActor, 1, Version >*,Error err) { - fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flushBlobRangeActor", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -39727,370 +43871,166 @@ class SplitStorageMetricsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flushBlobRangeActor", reinterpret_cast(this), 1); } - int a_body1loopBody1cont5(int loopDepth) - { - loopDepth = a_body1loopBody1cont2(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1Catch1(const Error& e,int loopDepth=0) + int a_body1cont4Catch1(const Error& e,int loopDepth=0) { try { - #line 8067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() != error_code_wrong_shard_server && e.code() != error_code_all_alternatives_failed) - #line 39744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_blob_granule_transaction_too_old) + #line 43882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevError, "SplitStorageMetricsError").error(e); - #line 8069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 39750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~FlushBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 43886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~FlushBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } - #line 8071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(Key(), keys); - #line 8072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution); - #line 8072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 39758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 8072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 39763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 8707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 43894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1loopBody1cont6(int loopDepth) + int a_body1cont8(Void const& _,int loopDepth) { - #line 8057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (used.allLessOrEqual(limit * CLIENT_KNOBS->STORAGE_METRICS_UNFAIR_SPLIT_LIMIT) && results.size() > 1) - #line 39778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.resize(results.arena(), results.size() - 1); - #line 39782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (keys.end <= locations.back().range.end) - #line 39786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.push_back_deep(results.arena(), keys.end); - #line 39790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~SplitStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } - #line 39794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO - this->~SplitStorageMetricsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 8701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~FlushBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 43908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~FlushBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1loopBody1cont1loopHead1(int loopDepth) + int a_body1cont8(Void && _,int loopDepth) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1cont1loopBody1(loopDepth); + #line 8701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~FlushBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 43920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~FlushBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1loopBody1cont1loopBody1(int loopDepth) + int a_body1cont4when1(Void const& _,int loopDepth) { - #line 8035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!(i < locations.size())) - #line 39813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break - } - #line 8036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SplitMetricsRequest req(locations[i].range, limit, used, estimated, i == locations.size() - 1); - #line 8037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = loadBalance(locations[i].locations->locations(), &StorageServerInterface::splitMetrics, req, TaskPriority::DataDistribution); - #line 8037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 39823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1loopBody1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 8037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 39828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1cont8(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont1break1(int loopDepth) + int a_body1cont4when1(Void && _,int loopDepth) { - try { - return a_body1loopBody1cont6(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1loopBody1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1cont1loopBody1cont1(SplitMetricsReply const& res,int loopDepth) - { - #line 8041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (res.splits.size() && res.splits[0] <= results.back()) - #line 39850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT_WE_THINK( false); - #line 8046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1loopBody1cont1Catch1(all_alternatives_failed(), std::max(0, loopDepth - 1)); - #line 39856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (res.splits.size()) - #line 39860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.append(results.arena(), res.splits.begin(), res.splits.size()); - #line 8050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.arena().dependsOn(res.splits.arena()); - #line 39866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - used = res.used; - #line 8035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - i++; - #line 39872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (loopDepth == 0) return a_body1loopBody1cont1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1cont1loopBody1cont1(SplitMetricsReply && res,int loopDepth) - { - #line 8041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (res.splits.size() && res.splits[0] <= results.back()) - #line 39881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT_WE_THINK( false); - #line 8046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1loopBody1cont1Catch1(all_alternatives_failed(), std::max(0, loopDepth - 1)); - #line 39887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (res.splits.size()) - #line 39891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.append(results.arena(), res.splits.begin(), res.splits.size()); - #line 8050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.arena().dependsOn(res.splits.arena()); - #line 39897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - used = res.used; - #line 8035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - i++; - #line 39903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (loopDepth == 0) return a_body1loopBody1cont1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1cont1loopBody1when1(SplitMetricsReply const& res,int loopDepth) - { - loopDepth = a_body1loopBody1cont1loopBody1cont1(res, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1loopBody1when1(SplitMetricsReply && res,int loopDepth) - { - loopDepth = a_body1loopBody1cont1loopBody1cont1(std::move(res), loopDepth); + loopDepth = a_body1cont8(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SplitStorageMetricsActor, 2, SplitMetricsReply >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlushBlobRangeActorActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 2, SplitMetricsReply >*,SplitMetricsReply const& value) + void a_callback_fire(ActorCallback< FlushBlobRangeActorActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flushBlobRangeActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont1loopBody1when1(value, 0); + a_body1cont4when1(value, 0); } catch (Error& error) { - a_body1loopBody1cont1Catch1(error, 0); + a_body1cont4Catch1(error, 0); } catch (...) { - a_body1loopBody1cont1Catch1(unknown_error(), 0); + a_body1cont4Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flushBlobRangeActor", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 2, SplitMetricsReply >*,SplitMetricsReply && value) + void a_callback_fire(ActorCallback< FlushBlobRangeActorActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flushBlobRangeActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont1loopBody1when1(std::move(value), 0); + a_body1cont4when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1cont1Catch1(error, 0); + a_body1cont4Catch1(error, 0); } catch (...) { - a_body1loopBody1cont1Catch1(unknown_error(), 0); + a_body1cont4Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flushBlobRangeActor", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< SplitStorageMetricsActor, 2, SplitMetricsReply >*,Error err) + void a_callback_error(ActorCallback< FlushBlobRangeActorActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flushBlobRangeActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1cont1Catch1(error, 0); - } catch (...) { - a_body1loopBody1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 2); - - } - int a_body1loopBody1cont1Catch1cont1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont5(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1Catch1cont1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont5(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SplitStorageMetricsActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1cont1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 3, Void >*,Void && value) - { - fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1loopBody1cont1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< SplitStorageMetricsActor, 3, Void >*,Error err) - { - fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1Catch1(err, 0); + a_body1cont4Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont4Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont4Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 3); + fdb_probe_actor_exit("flushBlobRangeActor", reinterpret_cast(this), 2); } - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Database cx; - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRange keys; - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StorageMetrics limit; - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StorageMetrics estimated; - #line 8008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Span span; - #line 8010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector locations; - #line 8021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StorageMetrics used; - #line 8022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Standalone> results; - #line 8034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int i; - #line 40064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference cx; + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool compact; + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional version; + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional> tenant; + #line 8692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database db; + #line 8694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Transaction tr; + #line 44005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via splitStorageMetrics() - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class SplitStorageMetricsActor final : public Actor>>, public ActorCallback< SplitStorageMetricsActor, 0, std::vector >, public ActorCallback< SplitStorageMetricsActor, 1, Void >, public ActorCallback< SplitStorageMetricsActor, 2, SplitMetricsReply >, public ActorCallback< SplitStorageMetricsActor, 3, Void >, public FastAllocated, public SplitStorageMetricsActorState { - #line 40069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via flushBlobRangeActor() + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class FlushBlobRangeActorActor final : public Actor, public ActorCallback< FlushBlobRangeActorActor, 0, Void >, public ActorCallback< FlushBlobRangeActorActor, 1, Version >, public ActorCallback< FlushBlobRangeActorActor, 2, Void >, public FastAllocated, public FlushBlobRangeActorActorState { + #line 44010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< SplitStorageMetricsActor, 0, std::vector >; -friend struct ActorCallback< SplitStorageMetricsActor, 1, Void >; -friend struct ActorCallback< SplitStorageMetricsActor, 2, SplitMetricsReply >; -friend struct ActorCallback< SplitStorageMetricsActor, 3, Void >; - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SplitStorageMetricsActor(Database const& cx,KeyRange const& keys,StorageMetrics const& limit,StorageMetrics const& estimated) - #line 40083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor>>(), - SplitStorageMetricsActorState(cx, keys, limit, estimated) +friend struct ActorCallback< FlushBlobRangeActorActor, 0, Void >; +friend struct ActorCallback< FlushBlobRangeActorActor, 1, Version >; +friend struct ActorCallback< FlushBlobRangeActorActor, 2, Void >; + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + FlushBlobRangeActorActor(Reference const& cx,KeyRange const& range,bool const& compact,Optional const& version,Optional> const& tenant) + #line 44023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + FlushBlobRangeActorActorState(cx, range, compact, version, tenant) { - fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flushBlobRangeActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("splitStorageMetrics"); + this->lineage.setActorName("flushBlobRangeActor"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flushBlobRangeActor", reinterpret_cast(this), -1); } void cancel() override @@ -40098,109 +44038,73 @@ friend struct ActorCallback< SplitStorageMetricsActor, 3, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< SplitStorageMetricsActor, 0, std::vector >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< SplitStorageMetricsActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< SplitStorageMetricsActor, 2, SplitMetricsReply >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< SplitStorageMetricsActor, 3, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlushBlobRangeActorActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlushBlobRangeActorActor, 1, Version >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< FlushBlobRangeActorActor, 2, Void >*)0, actor_cancelled()); break; } } }; } - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future>> splitStorageMetrics( Database const& cx, KeyRange const& keys, StorageMetrics const& limit, StorageMetrics const& estimated ) { - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future>>(new SplitStorageMetricsActor(cx, keys, limit, estimated)); - #line 40114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -} - -#line 8077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - -Future>> DatabaseContext::splitStorageMetrics(KeyRange const& keys, - StorageMetrics const& limit, - StorageMetrics const& estimated) { - return ::splitStorageMetrics(Database(Reference::addRef(this)), keys, limit, estimated); -} - -void Transaction::checkDeferredError() const { - trState->cx->checkDeferredError(); -} - -Reference Transaction::createTrLogInfoProbabilistically(const Database& cx) { - if (!cx->isError()) { - double clientSamplingProbability = - cx->globalConfig->get(fdbClientInfoTxnSampleRate, CLIENT_KNOBS->CSI_SAMPLING_PROBABILITY); - if (((networkOptions.logClientInfo.present() && networkOptions.logClientInfo.get()) || BUGGIFY) && - deterministicRandom()->random01() < clientSamplingProbability && - (!g_network->isSimulated() || !g_simulator.speedUpSimulation)) { - return makeReference(TransactionLogInfo::DATABASE); - } - } - - return Reference(); -} - -void Transaction::setTransactionID(uint64_t id) { - ASSERT(getSize() == 0); - trState->spanID = SpanID(id, trState->spanID.second()); + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future flushBlobRangeActor( Reference const& cx, KeyRange const& range, bool const& compact, Optional const& version, Optional> const& tenant ) { + #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new FlushBlobRangeActorActor(cx, range, compact, version, tenant)); + #line 44053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -void Transaction::setToken(uint64_t token) { - ASSERT(getSize() == 0); - trState->spanID = SpanID(trState->spanID.first(), token); -} +#line 8710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -void enableClientInfoLogging() { - ASSERT(networkOptions.logClientInfo.present() == false); - networkOptions.logClientInfo = true; - TraceEvent(SevInfo, "ClientInfoLoggingEnabled").log(); +Future DatabaseContext::flushBlobRange(const KeyRange& range, + bool compact, + Optional version, + Optional> tenant) { + return flushBlobRangeActor(Reference::addRef(this), range, compact, version, tenant); } - #line 40159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 44065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via snapCreate() - #line 8118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class SnapCreateActorState { - #line 40166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via readStorageWiggleValues() + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class ReadStorageWiggleValuesActorState { + #line 44072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 8118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SnapCreateActorState(Database const& cx,Standalone const& snapCmd,UID const& snapUID) - #line 8118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ReadStorageWiggleValuesActorState(Database const& cx,bool const& primary,bool const& use_system_priority) + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 8118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - snapCmd(snapCmd), - #line 8118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - snapUID(snapUID) - #line 40177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + primary(primary), + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + use_system_priority(use_system_priority), + #line 8721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + wiggleState(), + #line 8722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + metadataMap(wiggleState.wigglingStorageServer(PrimaryRegion(primary))), + #line 8725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr(new ReadYourWritesTransaction(cx)), + #line 8726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + res() + #line 44091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("snapCreate", reinterpret_cast(this)); + fdb_probe_actor_create("readStorageWiggleValues", reinterpret_cast(this)); } - ~SnapCreateActorState() + ~ReadStorageWiggleValuesActorState() { - fdb_probe_actor_destroy("snapCreate", reinterpret_cast(this)); + fdb_probe_actor_destroy("readStorageWiggleValues", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 8119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("SnapCreateEnter").detail("SnapCmd", snapCmd).detail("UID", snapUID); - #line 40192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - try { - #line 8121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 40196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch2(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch2(unknown_error(), loopDepth); - } + #line 8729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 44106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -40212,26 +44116,21 @@ class SnapCreateActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~SnapCreateActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~ReadStorageWiggleValuesActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1Catch2(const Error& e,int loopDepth=0) + int a_body1cont1(int loopDepth) { - try { - #line 8135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("SnapCreateError").error(e).detail("SnapCmd", snapCmd.toString()).detail("UID", snapUID); - #line 8136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, loopDepth); - #line 40228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } + #line 8743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(res.results); this->~ReadStorageWiggleValuesActorState(); static_cast(this)->destroy(); return 0; } + #line 44129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(res.results); + this->~ReadStorageWiggleValuesActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } @@ -40244,23 +44143,49 @@ class SnapCreateActorState { } int a_body1loopBody1(int loopDepth) { - #line 8123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = cx->onProxiesChanged(); - #line 8122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 40251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 8124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = basicLoadBalance(cx->getCommitProxies(UseProvisionalProxies::False), &CommitProxyInterface::proxySnapReq, ProxySnapRequest(snapCmd, snapUID, snapUID), cx->taskID, AtMostOnce::True); - #line 40255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 40262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + try { + #line 8731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 8732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + #line 8733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (use_system_priority) + #line 44153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 44157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = store(res, metadataMap.getRange(tr, UID(0, 0), Optional(), CLIENT_KNOBS->TOO_MANY)); + #line 8736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 44163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 8736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 44168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } return loopDepth; } @@ -40270,443 +44195,263 @@ class SnapCreateActorState { return loopDepth; } - int a_body1loopBody1when1(Void const& _,int loopDepth) + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { - loopDepth = a_body1loopBody1cont1(loopDepth); + try { + #line 8740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = tr->onError(e); + #line 8740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 44205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 8740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 44210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } return loopDepth; } - int a_body1loopBody1when1(Void && _,int loopDepth) + int a_body1loopBody1cont2(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 8737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = tr->commit(); + #line 8737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 44227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 8737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 44232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1when2(Void const& _,int loopDepth) + int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 8129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("SnapCreateExit").detail("SnapCmd", snapCmd).detail("UID", snapUID); - #line 8130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SnapCreateActorState(); static_cast(this)->destroy(); return 0; } - #line 40291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~SnapCreateActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 8737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = tr->commit(); + #line 8737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 44243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 8737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 44248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1when2(Void && _,int loopDepth) + int a_body1loopBody1when1(Void const& _,int loopDepth) { - #line 8129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("SnapCreateExit").detail("SnapCmd", snapCmd).detail("UID", snapUID); - #line 8130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SnapCreateActorState(); static_cast(this)->destroy(); return 0; } - #line 40305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~SnapCreateActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SnapCreateActor, 0, Void >::remove(); - static_cast(this)->ActorCallback< SnapCreateActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ReadStorageWiggleValuesActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< SnapCreateActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< ReadStorageWiggleValuesActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("snapCreate", reinterpret_cast(this), 0); + fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("snapCreate", reinterpret_cast(this), 0); + fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< SnapCreateActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< ReadStorageWiggleValuesActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("snapCreate", reinterpret_cast(this), 0); + fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("snapCreate", reinterpret_cast(this), 0); + fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< SnapCreateActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< ReadStorageWiggleValuesActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("snapCreate", reinterpret_cast(this), 0); + fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1Catch2(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("snapCreate", reinterpret_cast(this), 0); + fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< SnapCreateActor, 1, Void >*,Void const& value) + int a_body1loopBody1cont4(Void const& _,int loopDepth) { - fdb_probe_actor_enter("snapCreate", reinterpret_cast(this), 1); - a_exitChoose1(); + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ReadStorageWiggleValuesActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ReadStorageWiggleValuesActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when2(value, 0); + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("snapCreate", reinterpret_cast(this), 1); + fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< SnapCreateActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< ReadStorageWiggleValuesActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("snapCreate", reinterpret_cast(this), 1); - a_exitChoose1(); + fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when2(std::move(value), 0); + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("snapCreate", reinterpret_cast(this), 1); + fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< SnapCreateActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< ReadStorageWiggleValuesActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("snapCreate", reinterpret_cast(this), 1); - a_exitChoose1(); + fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1Catch2(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("snapCreate", reinterpret_cast(this), 1); + fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 1); } - #line 8118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Database cx; - #line 8118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Standalone snapCmd; - #line 8118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - UID snapUID; - #line 40416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -}; -// This generated class is to be used only via snapCreate() - #line 8118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class SnapCreateActor final : public Actor, public ActorCallback< SnapCreateActor, 0, Void >, public ActorCallback< SnapCreateActor, 1, Void >, public FastAllocated, public SnapCreateActorState { - #line 40421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< SnapCreateActor, 0, Void >; -friend struct ActorCallback< SnapCreateActor, 1, Void >; - #line 8118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SnapCreateActor(Database const& cx,Standalone const& snapCmd,UID const& snapUID) - #line 40433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - SnapCreateActorState(cx, snapCmd, snapUID) - { - fdb_probe_actor_enter("snapCreate", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("snapCreate"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("snapCreate", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< SnapCreateActor, 0, Void >*)0, actor_cancelled()); break; - } - - } -}; -} - #line 8118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future snapCreate( Database const& cx, Standalone const& snapCmd, UID const& snapUID ) { - #line 8118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new SnapCreateActor(cx, snapCmd, snapUID)); - #line 40461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -} - -#line 8139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - - #line 40466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via createCheckpointImpl() - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class CreateCheckpointImplActorState { - #line 40473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - CreateCheckpointImplActorState(T const& tr,KeyRangeRef const& range,CheckpointFormat const& format) - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : tr(tr), - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - range(range), - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - format(format) - #line 40484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - fdb_probe_actor_create("createCheckpointImpl", reinterpret_cast(this)); - - } - ~CreateCheckpointImplActorState() - { - fdb_probe_actor_destroy("createCheckpointImpl", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 8142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(!tr->getTenant().present()); - #line 8143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("CreateCheckpointTransactionBegin").detail("Range", range); - #line 8145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = krmGetRanges(tr, keyServersPrefix, range); - #line 8145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 40505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 40510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~CreateCheckpointImplActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(int loopDepth) - { - #line 8146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(!keyServers.more); - #line 8148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = tr->getRange(serverTagKeys, CLIENT_KNOBS->TOO_MANY); - #line 8148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 40537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 40542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1when1(RangeResult const& __keyServers,int loopDepth) - { - #line 8145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - keyServers = __keyServers; - #line 40551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); - - return loopDepth; - } - int a_body1when1(RangeResult && __keyServers,int loopDepth) + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - keyServers = std::move(__keyServers); - loopDepth = a_body1cont1(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CreateCheckpointImplActor, 0, RangeResult >::remove(); - - } - void a_callback_fire(ActorCallback< CreateCheckpointImplActor, 0, RangeResult >*,RangeResult const& value) - { - fdb_probe_actor_enter("createCheckpointImpl", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createCheckpointImpl", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< CreateCheckpointImplActor, 0, RangeResult >*,RangeResult && value) - { - fdb_probe_actor_enter("createCheckpointImpl", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createCheckpointImpl", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< CreateCheckpointImplActor, 0, RangeResult >*,Error err) - { - fdb_probe_actor_enter("createCheckpointImpl", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("createCheckpointImpl", reinterpret_cast(this), 0); - - } - int a_body1cont2(int loopDepth) + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 8149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(!UIDtoTagMap.more && UIDtoTagMap.size() < CLIENT_KNOBS->TOO_MANY); - #line 8151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(int i = 0;i < keyServers.size() - 1;++i) { - #line 8152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRangeRef shard(keyServers[i].key, keyServers[i + 1].key); - #line 8153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector src; - #line 8154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector dest; - #line 8155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - decodeKeyServersValue(UIDtoTagMap, keyServers[i].value, src, dest); - #line 8159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - const UID checkpointID = deterministicRandom()->randomUniqueID(); - #line 8160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(int idx = 0;idx < src.size();++idx) { - #line 8161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - CheckpointMetaData checkpoint(shard & range, format, src[idx], checkpointID); - #line 8162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - checkpoint.setState(CheckpointMetaData::Pending); - #line 8163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr->set(checkpointKeyFor(checkpointID), checkpointValue(checkpoint)); - #line 40638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("CreateCheckpointTransactionShard") .detail("Shard", shard) .detail("SrcServers", describe(src)) .detail("ServerSelected", describe(src)) .detail("CheckpointKey", checkpointKeyFor(checkpointID)) .detail("ReadVersion", tr->getReadVersion().get()); - #line 40642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CreateCheckpointImplActorState(); static_cast(this)->destroy(); return 0; } - #line 40646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~CreateCheckpointImplActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont1when1(RangeResult const& __UIDtoTagMap,int loopDepth) + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - #line 8148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - UIDtoTagMap = __UIDtoTagMap; - #line 40658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1cont1when1(RangeResult && __UIDtoTagMap,int loopDepth) + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - UIDtoTagMap = std::move(__UIDtoTagMap); - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CreateCheckpointImplActor, 1, RangeResult >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ReadStorageWiggleValuesActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< CreateCheckpointImplActor, 1, RangeResult >*,RangeResult const& value) + void a_callback_fire(ActorCallback< ReadStorageWiggleValuesActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("createCheckpointImpl", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont1when1(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("createCheckpointImpl", reinterpret_cast(this), 1); + fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< CreateCheckpointImplActor, 1, RangeResult >*,RangeResult && value) + void a_callback_fire(ActorCallback< ReadStorageWiggleValuesActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("createCheckpointImpl", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont1when1(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("createCheckpointImpl", reinterpret_cast(this), 1); + fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< CreateCheckpointImplActor, 1, RangeResult >*,Error err) + void a_callback_error(ActorCallback< ReadStorageWiggleValuesActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("createCheckpointImpl", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -40715,49 +44460,52 @@ class CreateCheckpointImplActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("createCheckpointImpl", reinterpret_cast(this), 1); + fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), 2); } - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - T tr; - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRangeRef range; - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - CheckpointFormat format; - #line 8145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - RangeResult keyServers; - #line 8148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - RangeResult UIDtoTagMap; - #line 40731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database cx; + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool primary; + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool use_system_priority; + #line 8721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageWiggleData wiggleState; + #line 8722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyBackedObjectMap metadataMap; + #line 8725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference tr; + #line 8726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyBackedRangeResult> res; + #line 44480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via createCheckpointImpl() - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class CreateCheckpointImplActor final : public Actor, public ActorCallback< CreateCheckpointImplActor, 0, RangeResult >, public ActorCallback< CreateCheckpointImplActor, 1, RangeResult >, public FastAllocated>, public CreateCheckpointImplActorState> { - #line 40738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via readStorageWiggleValues() + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class ReadStorageWiggleValuesActor final : public Actor>>, public ActorCallback< ReadStorageWiggleValuesActor, 0, Void >, public ActorCallback< ReadStorageWiggleValuesActor, 1, Void >, public ActorCallback< ReadStorageWiggleValuesActor, 2, Void >, public FastAllocated, public ReadStorageWiggleValuesActorState { + #line 44485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< CreateCheckpointImplActor, 0, RangeResult >; -friend struct ActorCallback< CreateCheckpointImplActor, 1, RangeResult >; - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - CreateCheckpointImplActor(T const& tr,KeyRangeRef const& range,CheckpointFormat const& format) - #line 40750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - CreateCheckpointImplActorState>(tr, range, format) +friend struct ActorCallback< ReadStorageWiggleValuesActor, 0, Void >; +friend struct ActorCallback< ReadStorageWiggleValuesActor, 1, Void >; +friend struct ActorCallback< ReadStorageWiggleValuesActor, 2, Void >; + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ReadStorageWiggleValuesActor(Database const& cx,bool const& primary,bool const& use_system_priority) + #line 44498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>>(), + ReadStorageWiggleValuesActorState(cx, primary, use_system_priority) { - fdb_probe_actor_enter("createCheckpointImpl", reinterpret_cast(this), -1); + fdb_probe_actor_enter("readStorageWiggleValues", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("createCheckpointImpl"); + this->lineage.setActorName("readStorageWiggleValues"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("createCheckpointImpl", reinterpret_cast(this), -1); + fdb_probe_actor_exit("readStorageWiggleValues", reinterpret_cast(this), -1); } void cancel() override @@ -40765,90 +44513,74 @@ friend struct ActorCallback< CreateCheckpointImplActor, 1, RangeResult >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< CreateCheckpointImplActor, 0, RangeResult >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< CreateCheckpointImplActor, 1, RangeResult >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< ReadStorageWiggleValuesActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ReadStorageWiggleValuesActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ReadStorageWiggleValuesActor, 2, Void >*)0, actor_cancelled()); break; } } }; } - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] static Future createCheckpointImpl( T const& tr, KeyRangeRef const& range, CheckpointFormat const& format ) { - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new CreateCheckpointImplActor(tr, range, format)); - #line 40781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -} - -#line 8176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - -Future createCheckpoint(Reference tr, KeyRangeRef range, CheckpointFormat format) { - return holdWhile(tr, createCheckpointImpl(tr, range, format)); + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future>> readStorageWiggleValues( Database const& cx, bool const& primary, bool const& use_system_priority ) { + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new ReadStorageWiggleValuesActor(cx, primary, use_system_priority)); + #line 44528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -Future createCheckpoint(Transaction* tr, KeyRangeRef range, CheckpointFormat format) { - return createCheckpointImpl(tr, range, format); -} +#line 8745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -// Gets CheckpointMetaData of the specific keyrange, version and format from one of the storage servers, if none of the -// servers have the checkpoint, a checkpoint_not_found error is returned. - #line 40796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 44533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via getCheckpointMetaDataInternal() - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetCheckpointMetaDataInternalActorState { - #line 40803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via splitStorageMetricsStream() + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SplitStorageMetricsStreamActorState { + #line 44540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetCheckpointMetaDataInternalActorState(GetCheckpointRequest const& req,Reference const& alternatives,double const& timeout) - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : req(req), - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - alternatives(alternatives), - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - timeout(timeout) - #line 40814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SplitStorageMetricsStreamActorState(PromiseStream const& resultStream,Database const& cx,KeyRange const& keys,StorageMetrics const& limit,StorageMetrics const& estimated,Optional const& minSplitBytes) + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : resultStream(resultStream), + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx(cx), + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keys(keys), + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + limit(limit), + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + estimated(estimated), + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + minSplitBytes(minSplitBytes), + #line 8752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:SplitStorageMetricsStream"_loc), + #line 8753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + beginKey(keys.begin), + #line 8754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + globalLastKey(beginKey) + #line 44563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("getCheckpointMetaDataInternal", reinterpret_cast(this)); + fdb_probe_actor_create("splitStorageMetricsStream", reinterpret_cast(this)); } - ~GetCheckpointMetaDataInternalActorState() + ~SplitStorageMetricsStreamActorState() { - fdb_probe_actor_destroy("getCheckpointMetaDataInternal", reinterpret_cast(this)); + fdb_probe_actor_destroy("splitStorageMetricsStream", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 8190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("GetCheckpointMetaDataInternalBegin") .detail("Range", req.range) .detail("Version", req.version) .detail("Format", static_cast(req.format)) .detail("Locations", alternatives->description()); - #line 8196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - futures = std::vector>>(); - #line 8197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - index = 0; - #line 8198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(index = 0;index < alternatives->size();++index) { - #line 8200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - futures.push_back(errorOr(timeoutError(alternatives->getInterface(index).checkpoint.getReply(req), timeout))); - #line 40837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - error = Optional(); - #line 8204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = waitForAll(futures); - #line 8204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 40845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 40850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 8755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + resultStream.send(beginKey); + #line 8757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + globalUsed = StorageMetrics(); + #line 8758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 44582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -40860,169 +44592,139 @@ class GetCheckpointMetaDataInternalActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~GetCheckpointMetaDataInternalActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~SplitStorageMetricsStreamActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(Void const& _,int loopDepth) + int a_body1cont1(int loopDepth) { - #line 8205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("GetCheckpointMetaDataInternalWaitEnd").detail("Range", req.range).detail("Version", req.version); - #line 8207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(index = 0;index < futures.size();++index) { - #line 8208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!futures[index].isReady()) - #line 40877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - error = timed_out(); - #line 8210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("GetCheckpointMetaDataInternalSSTimeout") .detail("Range", req.range) .detail("Version", req.version) .detail("StorageServer", alternatives->getInterface(index).uniqueID); - #line 40883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - continue; - } - #line 8217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (futures[index].get().isError()) - #line 40888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - const Error& e = futures[index].get().getError(); - #line 8219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("GetCheckpointMetaDataInternalError") .errorUnsuppressed(e) .detail("Range", req.range) .detail("Version", req.version) .detail("StorageServer", alternatives->getInterface(index).uniqueID); - #line 8224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() != error_code_checkpoint_not_found || !error.present()) - #line 40896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - error = e; - #line 40900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - else - { - #line 8228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(futures[index].get().get()); this->~GetCheckpointMetaDataInternalActorState(); static_cast(this)->destroy(); return 0; } - #line 40907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< CheckpointMetaData >::value()) CheckpointMetaData(futures[index].get().get()); - this->~GetCheckpointMetaDataInternalActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } + #line 8840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SplitStorageMetricsStreamActorState(); static_cast(this)->destroy(); return 0; } + #line 44605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~SplitStorageMetricsStreamActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 8759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_0 = getKeyRangeLocations(cx, TenantInfo(), KeyRangeRef(beginKey, keys.end), CLIENT_KNOBS->STORAGE_METRICS_SHARD_LIMIT, Reverse::False, &StorageServerInterface::splitMetrics, span.context, Optional(), UseProvisionalProxies::False, latestVersion); + #line 8759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 44626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 8759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 44631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - #line 8232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(error.present()); - #line 8233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(error.get(), loopDepth); - #line 40918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1loopBody1cont1(int loopDepth) { - #line 8205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("GetCheckpointMetaDataInternalWaitEnd").detail("Range", req.range).detail("Version", req.version); - #line 8207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(index = 0;index < futures.size();++index) { - #line 8208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!futures[index].isReady()) - #line 40930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - error = timed_out(); - #line 8210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("GetCheckpointMetaDataInternalSSTimeout") .detail("Range", req.range) .detail("Version", req.version) .detail("StorageServer", alternatives->getInterface(index).uniqueID); - #line 40936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - continue; - } - #line 8217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (futures[index].get().isError()) - #line 40941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - const Error& e = futures[index].get().getError(); - #line 8219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("GetCheckpointMetaDataInternalError") .errorUnsuppressed(e) .detail("Range", req.range) .detail("Version", req.version) .detail("StorageServer", alternatives->getInterface(index).uniqueID); - #line 8224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() != error_code_checkpoint_not_found || !error.present()) - #line 40949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - error = e; - #line 40953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - else - { - #line 8228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(futures[index].get().get()); this->~GetCheckpointMetaDataInternalActorState(); static_cast(this)->destroy(); return 0; } - #line 40960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< CheckpointMetaData >::value()) CheckpointMetaData(futures[index].get().get()); - this->~GetCheckpointMetaDataInternalActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } + try { + #line 8773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + localUsed = globalUsed; + #line 8774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + localLastKey = globalLastKey; + #line 8775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results = Standalone>(); + #line 8776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + i = 0; + #line 8777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 44662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1loopBody1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1cont1Catch1(unknown_error(), loopDepth); } - #line 8232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(error.present()); - #line 8233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(error.get(), loopDepth); - #line 40971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1loopBody1when1(std::vector const& __locations,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + #line 8759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + locations = __locations; + #line 44677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1loopBody1when1(std::vector && __locations,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + locations = std::move(__locations); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetCheckpointMetaDataInternalActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SplitStorageMetricsStreamActor, 0, std::vector >::remove(); } - void a_callback_fire(ActorCallback< GetCheckpointMetaDataInternalActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< SplitStorageMetricsStreamActor, 0, std::vector >*,std::vector const& value) { - fdb_probe_actor_enter("getCheckpointMetaDataInternal", reinterpret_cast(this), 0); + fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getCheckpointMetaDataInternal", reinterpret_cast(this), 0); + fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetCheckpointMetaDataInternalActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< SplitStorageMetricsStreamActor, 0, std::vector >*,std::vector && value) { - fdb_probe_actor_enter("getCheckpointMetaDataInternal", reinterpret_cast(this), 0); + fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getCheckpointMetaDataInternal", reinterpret_cast(this), 0); + fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetCheckpointMetaDataInternalActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< SplitStorageMetricsStreamActor, 0, std::vector >*,Error err) { - fdb_probe_actor_enter("getCheckpointMetaDataInternal", reinterpret_cast(this), 0); + fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -41032,235 +44734,51 @@ class GetCheckpointMetaDataInternalActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getCheckpointMetaDataInternal", reinterpret_cast(this), 0); + fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 0); } - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetCheckpointRequest req; - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference alternatives; - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - double timeout; - #line 8196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector>> futures; - #line 8197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int index; - #line 8203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Optional error; - #line 41050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -}; -// This generated class is to be used only via getCheckpointMetaDataInternal() - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetCheckpointMetaDataInternalActor final : public Actor, public ActorCallback< GetCheckpointMetaDataInternalActor, 0, Void >, public FastAllocated, public GetCheckpointMetaDataInternalActorState { - #line 41055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< GetCheckpointMetaDataInternalActor, 0, Void >; - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetCheckpointMetaDataInternalActor(GetCheckpointRequest const& req,Reference const& alternatives,double const& timeout) - #line 41066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - GetCheckpointMetaDataInternalActorState(req, alternatives, timeout) + int a_body1loopBody1cont2(int loopDepth) { - fdb_probe_actor_enter("getCheckpointMetaDataInternal", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getCheckpointMetaDataInternal"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("getCheckpointMetaDataInternal", reinterpret_cast(this), -1); + if (loopDepth == 0) return a_body1loopHead1(0); + return loopDepth; } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetCheckpointMetaDataInternalActor, 0, Void >*)0, actor_cancelled()); break; - } - - } -}; -} - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] static Future getCheckpointMetaDataInternal( GetCheckpointRequest const& req, Reference const& alternatives, double const& timeout ) { - #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new GetCheckpointMetaDataInternalActor(req, alternatives, timeout)); - #line 41094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -} - -#line 8235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - - #line 41099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via getCheckpointMetaData() - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetCheckpointMetaDataActorState { - #line 41106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetCheckpointMetaDataActorState(Database const& cx,KeyRange const& keys,Version const& version,CheckpointFormat const& format,double const& timeout) - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : cx(cx), - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - keys(keys), - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version(version), - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - format(format), - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - timeout(timeout), - #line 8241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:GetCheckpoint"_loc), - #line 8242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - index(0), - #line 8243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - futures() - #line 41127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - fdb_probe_actor_create("getCheckpointMetaData", reinterpret_cast(this)); - - } - ~GetCheckpointMetaDataActorState() - { - fdb_probe_actor_destroy("getCheckpointMetaData", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 8245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 41142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~GetCheckpointMetaDataActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(int loopDepth) - { - #line 8297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector res; - #line 8298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(index = 0;index < futures.size();++index) { - #line 8299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("GetCheckpointShardEnd").detail("Checkpoint", futures[index].get().toString()); - #line 8300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - res.push_back(futures[index].get()); - #line 41171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(res); this->~GetCheckpointMetaDataActorState(); static_cast(this)->destroy(); return 0; } - #line 41175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< std::vector >::value()) std::vector(res); - this->~GetCheckpointMetaDataActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) - { - #line 8246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("GetCheckpointBegin") .detail("Range", keys.toString()) .detail("Version", version) .detail("Format", static_cast(format)); - #line 41194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - try { - #line 8252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_0 = getKeyRangeLocations(cx, Optional(), keys, CLIENT_KNOBS->TOO_MANY, Reverse::False, &StorageServerInterface::checkpoint, span.context, Optional(), UseProvisionalProxies::False, latestVersion); - #line 8252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 41200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 41205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1break1(int loopDepth) - { - try { - return a_body1cont1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1loopBody1cont1(int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1loopBody1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 8286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("GetCheckpointError").errorUnsuppressed(e).detail("Range", keys.toString()); - #line 8287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || e.code() == error_code_connection_failed || e.code() == error_code_broken_promise) - #line 41242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_operation_cancelled) + #line 44751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(KeyRef(), keys); - #line 8290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_4 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY); - #line 8290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 41250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 8290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 41255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 8829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 44755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - else + #line 8831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() != error_code_wrong_shard_server && e.code() != error_code_all_alternatives_failed) + #line 44759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevError, "SplitStorageMetricsStreamError").error(e); + #line 8833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + resultStream.sendError(e); + #line 8834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 41262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 44767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + #line 8836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache({}, keys); + #line 8837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution); + #line 8837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 44775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 8837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 44780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); @@ -41270,312 +44788,226 @@ class GetCheckpointMetaDataActorState { return loopDepth; } - int a_body1loopBody1cont2(int loopDepth) + int a_body1loopBody1cont3(int loopDepth) { - #line 8264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - futures.clear(); - #line 8265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(index = 0;index < locations.size();++index) { - #line 8266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - futures.push_back(getCheckpointMetaDataInternal( GetCheckpointRequest(version, keys, format), locations[index].locations, timeout)); - #line 8268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("GetCheckpointShardBegin") .detail("Range", locations[index].range) .detail("Version", version) .detail("StorageServers", locations[index].locations->description()); - #line 41283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + globalUsed = localUsed; + #line 8808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (keys.end <= locations.back().range.end && globalUsed.allLessOrEqual(limit * CLIENT_KNOBS->STORAGE_METRICS_UNFAIR_SPLIT_LIMIT) && results.size() > 1) + #line 44797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.resize(results.arena(), results.size() - 1); + #line 8812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + localLastKey = results.back(); + #line 44803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 8275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = cx->connectionFileChanged(); - #line 8274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 41289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - #line 8278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = waitForAll(futures); - #line 41293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when2(__when_expr_2.get(), loopDepth); }; - #line 8281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = delay(timeout); - #line 41297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont2when3(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 41306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 8814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + globalLastKey = localLastKey; + #line 8816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& splitKey : results ) { + #line 8817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + resultStream.send(splitKey); + #line 44811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (keys.end <= locations.back().range.end) + #line 44815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + resultStream.send(keys.end); + #line 8822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + resultStream.sendError(end_of_stream()); + #line 44821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + else + { + #line 8825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + beginKey = locations.back().range.end; + #line 44828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + loopDepth = a_body1loopBody1cont9(loopDepth); return loopDepth; } - int a_body1loopBody1when1(std::vector const& __locations,int loopDepth) + int a_body1loopBody1cont1loopHead1(int loopDepth) { - #line 8252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - locations = __locations; - #line 41315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont2(loopDepth); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1cont1loopBody1(loopDepth); return loopDepth; } - int a_body1loopBody1when1(std::vector && __locations,int loopDepth) + int a_body1loopBody1cont1loopBody1(int loopDepth) { - locations = std::move(__locations); - loopDepth = a_body1loopBody1cont2(loopDepth); + #line 8777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!(i < locations.size())) + #line 44845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 8778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SplitMetricsRequest req(locations[i].range, limit, localUsed, estimated, i == locations.size() - 1 && keys.end <= locations.back().range.end, minSplitBytes); + #line 8784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = loadBalance(locations[i].locations->locations(), &StorageServerInterface::splitMetrics, req, TaskPriority::DataDistribution); + #line 8784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 44855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 8784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 44860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetCheckpointMetaDataActor, 0, std::vector >::remove(); - - } - void a_callback_fire(ActorCallback< GetCheckpointMetaDataActor, 0, std::vector >*,std::vector const& value) + int a_body1loopBody1cont1break1(int loopDepth) { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 0); - a_exitChoose1(); try { - a_body1loopBody1when1(value, 0); + return a_body1loopBody1cont3(loopDepth); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1loopBody1cont1Catch1(error, loopDepth); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1loopBody1cont1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 0); + return loopDepth; } - void a_callback_fire(ActorCallback< GetCheckpointMetaDataActor, 0, std::vector >*,std::vector && value) + int a_body1loopBody1cont1loopBody1cont1(SplitMetricsReply const& res,int loopDepth) { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(std::move(value), 0); + #line 8788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.splits.size() && res.splits[0] <= localLastKey) + #line 44882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT_WE_THINK(false); + #line 8792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1loopBody1cont1Catch1(all_alternatives_failed(), std::max(0, loopDepth - 1)); + #line 44888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + #line 8795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.splits.size()) + #line 44892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.append(results.arena(), res.splits.begin(), res.splits.size()); + #line 8797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.arena().dependsOn(res.splits.arena()); + #line 8798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + localLastKey = res.splits.back(); + #line 44900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 0); + #line 8800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + localUsed = res.used; + #line 8777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + i++; + #line 44906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1loopBody1cont1loopHead1(0); + return loopDepth; } - void a_callback_error(ActorCallback< GetCheckpointMetaDataActor, 0, std::vector >*,Error err) + int a_body1loopBody1cont1loopBody1cont1(SplitMetricsReply && res,int loopDepth) { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1Catch1(err, 0); + #line 8788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.splits.size() && res.splits[0] <= localLastKey) + #line 44915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT_WE_THINK(false); + #line 8792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1loopBody1cont1Catch1(all_alternatives_failed(), std::max(0, loopDepth - 1)); + #line 44921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + #line 8795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.splits.size()) + #line 44925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.append(results.arena(), res.splits.begin(), res.splits.size()); + #line 8797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.arena().dependsOn(res.splits.arena()); + #line 8798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + localLastKey = res.splits.back(); + #line 44933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 0); - - } - int a_body1loopBody1cont3(int loopDepth) - { - loopDepth = a_body1loopBody1cont5(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont2when1(Void const& _,int loopDepth) - { - #line 8276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(KeyRef(), keys); - #line 41388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont2when1(Void && _,int loopDepth) - { - #line 8276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(KeyRef(), keys); - #line 41397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont2when2(Void const& _,int loopDepth) - { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break - - return loopDepth; - } - int a_body1loopBody1cont2when2(Void && _,int loopDepth) - { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + #line 8800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + localUsed = res.used; + #line 8777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + i++; + #line 44939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1loopBody1cont1loopHead1(0); return loopDepth; } - int a_body1loopBody1cont2when3(Void const& _,int loopDepth) + int a_body1loopBody1cont1loopBody1when1(SplitMetricsReply const& res,int loopDepth) { - #line 8282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("GetCheckpointTimeout").detail("Range", keys).detail("Version", version); - #line 41418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); + loopDepth = a_body1loopBody1cont1loopBody1cont1(res, loopDepth); return loopDepth; } - int a_body1loopBody1cont2when3(Void && _,int loopDepth) + int a_body1loopBody1cont1loopBody1when1(SplitMetricsReply && res,int loopDepth) { - #line 8282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("GetCheckpointTimeout").detail("Range", keys).detail("Version", version); - #line 41427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); + loopDepth = a_body1loopBody1cont1loopBody1cont1(std::move(res), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetCheckpointMetaDataActor, 1, Void >::remove(); - static_cast(this)->ActorCallback< GetCheckpointMetaDataActor, 2, Void >::remove(); - static_cast(this)->ActorCallback< GetCheckpointMetaDataActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GetCheckpointMetaDataActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< GetCheckpointMetaDataActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< GetCheckpointMetaDataActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< GetCheckpointMetaDataActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 2); - a_exitChoose2(); - try { - a_body1loopBody1cont2when2(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< GetCheckpointMetaDataActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 2); - a_exitChoose2(); - try { - a_body1loopBody1cont2when2(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< GetCheckpointMetaDataActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 2); - a_exitChoose2(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 2); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SplitStorageMetricsStreamActor, 1, SplitMetricsReply >::remove(); } - void a_callback_fire(ActorCallback< GetCheckpointMetaDataActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< SplitStorageMetricsStreamActor, 1, SplitMetricsReply >*,SplitMetricsReply const& value) { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 3); + fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1cont2when3(value, 0); + a_body1loopBody1cont1loopBody1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1loopBody1cont1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1loopBody1cont1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 3); + fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< GetCheckpointMetaDataActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< SplitStorageMetricsStreamActor, 1, SplitMetricsReply >*,SplitMetricsReply && value) { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 3); + fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1cont2when3(std::move(value), 0); + a_body1loopBody1cont1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1loopBody1cont1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1loopBody1cont1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 3); + fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< GetCheckpointMetaDataActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< SplitStorageMetricsStreamActor, 1, SplitMetricsReply >*,Error err) { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 3); + fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1Catch1(err, 0); + a_body1loopBody1cont1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1loopBody1cont1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1loopBody1cont1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 3); + fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 1); } - int a_body1loopBody1cont5(int loopDepth) + int a_body1loopBody1cont9(int loopDepth) { try { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1loopBody1cont2(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); @@ -41585,75 +45017,69 @@ class GetCheckpointMetaDataActorState { return loopDepth; } - int a_body1loopBody1Catch1cont1(int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont2(Void const& _,int loopDepth) + int a_body1loopBody1cont1Catch1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont2(Void && _,int loopDepth) + int a_body1loopBody1cont1Catch1cont1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont2(_, loopDepth); + loopDepth = a_body1loopBody1cont1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1loopBody1cont1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont2(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont1Catch1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetCheckpointMetaDataActor, 4, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SplitStorageMetricsStreamActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< GetCheckpointMetaDataActor, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< SplitStorageMetricsStreamActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 4); + fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1Catch1when1(value, 0); + a_body1loopBody1cont1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 4); + fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< GetCheckpointMetaDataActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< SplitStorageMetricsStreamActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 4); + fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1Catch1when1(std::move(value), 0); + a_body1loopBody1cont1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 4); + fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< GetCheckpointMetaDataActor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< SplitStorageMetricsStreamActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 4); + fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -41663,58 +45089,68 @@ class GetCheckpointMetaDataActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 4); + fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), 2); } - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + PromiseStream resultStream; + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange keys; - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - CheckpointFormat format; - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - double timeout; - #line 8241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageMetrics limit; + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageMetrics estimated; + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional minSplitBytes; + #line 8752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Span span; - #line 8242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int index; - #line 8243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector> futures; - #line 8252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key beginKey; + #line 8754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key globalLastKey; + #line 8757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageMetrics globalUsed; + #line 8759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" std::vector locations; - #line 41687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageMetrics localUsed; + #line 8774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key localLastKey; + #line 8775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone> results; + #line 8776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int i; + #line 45125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via getCheckpointMetaData() - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetCheckpointMetaDataActor final : public Actor>, public ActorCallback< GetCheckpointMetaDataActor, 0, std::vector >, public ActorCallback< GetCheckpointMetaDataActor, 1, Void >, public ActorCallback< GetCheckpointMetaDataActor, 2, Void >, public ActorCallback< GetCheckpointMetaDataActor, 3, Void >, public ActorCallback< GetCheckpointMetaDataActor, 4, Void >, public FastAllocated, public GetCheckpointMetaDataActorState { - #line 41692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via splitStorageMetricsStream() + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SplitStorageMetricsStreamActor final : public Actor, public ActorCallback< SplitStorageMetricsStreamActor, 0, std::vector >, public ActorCallback< SplitStorageMetricsStreamActor, 1, SplitMetricsReply >, public ActorCallback< SplitStorageMetricsStreamActor, 2, Void >, public FastAllocated, public SplitStorageMetricsStreamActorState { + #line 45130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetCheckpointMetaDataActor, 0, std::vector >; -friend struct ActorCallback< GetCheckpointMetaDataActor, 1, Void >; -friend struct ActorCallback< GetCheckpointMetaDataActor, 2, Void >; -friend struct ActorCallback< GetCheckpointMetaDataActor, 3, Void >; -friend struct ActorCallback< GetCheckpointMetaDataActor, 4, Void >; - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetCheckpointMetaDataActor(Database const& cx,KeyRange const& keys,Version const& version,CheckpointFormat const& format,double const& timeout) - #line 41707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor>(), - GetCheckpointMetaDataActorState(cx, keys, version, format, timeout) +friend struct ActorCallback< SplitStorageMetricsStreamActor, 0, std::vector >; +friend struct ActorCallback< SplitStorageMetricsStreamActor, 1, SplitMetricsReply >; +friend struct ActorCallback< SplitStorageMetricsStreamActor, 2, Void >; + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SplitStorageMetricsStreamActor(PromiseStream const& resultStream,Database const& cx,KeyRange const& keys,StorageMetrics const& limit,StorageMetrics const& estimated,Optional const& minSplitBytes) + #line 45143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + SplitStorageMetricsStreamActorState(resultStream, cx, keys, limit, estimated, minSplitBytes) { - fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), -1); + fdb_probe_actor_enter("splitStorageMetricsStream", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getCheckpointMetaData"); + this->lineage.setActorName("splitStorageMetricsStream"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), -1); + fdb_probe_actor_exit("splitStorageMetricsStream", reinterpret_cast(this), -1); } void cancel() override @@ -41722,61 +45158,80 @@ friend struct ActorCallback< GetCheckpointMetaDataActor, 4, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetCheckpointMetaDataActor, 0, std::vector >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetCheckpointMetaDataActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< GetCheckpointMetaDataActor, 4, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< SplitStorageMetricsStreamActor, 0, std::vector >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< SplitStorageMetricsStreamActor, 1, SplitMetricsReply >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< SplitStorageMetricsStreamActor, 2, Void >*)0, actor_cancelled()); break; } } }; } - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future> getCheckpointMetaData( Database const& cx, KeyRange const& keys, Version const& version, CheckpointFormat const& format, double const& timeout ) { - #line 8236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future>(new GetCheckpointMetaDataActor(cx, keys, version, format, timeout)); - #line 41737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future splitStorageMetricsStream( PromiseStream const& resultStream, Database const& cx, KeyRange const& keys, StorageMetrics const& limit, StorageMetrics const& estimated, Optional const& minSplitBytes ) { + #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new SplitStorageMetricsStreamActor(resultStream, cx, keys, limit, estimated, minSplitBytes)); + #line 45173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 8304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 8842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +Future DatabaseContext::splitStorageMetricsStream(const PromiseStream& resultStream, + KeyRange const& keys, + StorageMetrics const& limit, + StorageMetrics const& estimated, + Optional const& minSplitBytes) { + return ::splitStorageMetricsStream( + resultStream, Database(Reference::addRef(this)), keys, limit, estimated, minSplitBytes); +} - #line 41742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 45187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via checkSafeExclusions() - #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class CheckSafeExclusionsActorState { - #line 41749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via splitStorageMetricsWithLocations() + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SplitStorageMetricsWithLocationsActorState { + #line 45194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - CheckSafeExclusionsActorState(Database const& cx,std::vector const& exclusions) - #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : cx(cx), - #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - exclusions(exclusions) - #line 41758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SplitStorageMetricsWithLocationsActorState(std::vector const& locations,KeyRange const& keys,StorageMetrics const& limit,StorageMetrics const& estimated,Optional const& minSplitBytes) + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : locations(locations), + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keys(keys), + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + limit(limit), + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + estimated(estimated), + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + minSplitBytes(minSplitBytes), + #line 8858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + used(), + #line 8859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results() + #line 45213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("checkSafeExclusions", reinterpret_cast(this)); + fdb_probe_actor_create("splitStorageMetricsWithLocations", reinterpret_cast(this)); } - ~CheckSafeExclusionsActorState() + ~SplitStorageMetricsWithLocationsActorState() { - fdb_probe_actor_destroy("checkSafeExclusions", reinterpret_cast(this)); + fdb_probe_actor_destroy("splitStorageMetricsWithLocations", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 8306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("ExclusionSafetyCheckBegin") .detail("NumExclusion", exclusions.size()) .detail("Exclusions", describe(exclusions)); - #line 8309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ddCheck = bool(); - #line 41775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.push_back_deep(results.arena(), keys.begin); + #line 45228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - #line 8311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + i = 0; + #line 8864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 41779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 45234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -41795,73 +45250,38 @@ class CheckSafeExclusionsActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~CheckSafeExclusionsActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~SplitStorageMetricsWithLocationsActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 8333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("ExclusionSafetyCheckCoordinators").log(); - #line 8334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - coordinatorList = ClientCoordinators(cx->getConnectionRecord()); - #line 8335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - leaderServers = std::vector>>(); - #line 8336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - leaderServers.reserve(coordinatorList.clientLeaderServers.size()); - #line 8337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(int i = 0;i < coordinatorList.clientLeaderServers.size();i++) { - #line 8338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (coordinatorList.clientLeaderServers[i].hostname.present()) - #line 41818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - leaderServers.push_back(retryGetReplyFromHostname(GetLeaderRequest(coordinatorList.clusterKey, UID()), coordinatorList.clientLeaderServers[i].hostname.get(), WLTOKEN_CLIENTLEADERREG_GETLEADER, TaskPriority::CoordinationReply)); - #line 41822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - else - { - #line 8344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - leaderServers.push_back(retryBrokenPromise(coordinatorList.clientLeaderServers[i].getLeader, GetLeaderRequest(coordinatorList.clusterKey, UID()), TaskPriority::CoordinationReply)); - #line 41828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - #line 8351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = smartQuorum(leaderServers, leaderServers.size() / 2 + 1, 1.0); - #line 8350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 41835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; - #line 8352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = delay(3.0); - #line 41839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1when2(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 41846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 8911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>>::futures) { (void)(Optional>>()); this->~SplitStorageMetricsWithLocationsActorState(); static_cast(this)->destroy(); return 0; } + #line 45263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional>> >::value()) Optional>>(Optional>>()); + this->~SplitStorageMetricsWithLocationsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 8325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() != error_code_actor_cancelled) - #line 41856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() != error_code_wrong_shard_server && e.code() != error_code_all_alternatives_failed) + #line 45276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("ExclusionSafetyCheckError") .error(e) .detail("NumExclusion", exclusions.size()) .detail("Exclusions", describe(exclusions)); - #line 41860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevError, "SplitStorageMetricsError").error(e); + #line 8908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 45282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 8331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, loopDepth); - #line 41864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -41873,7 +45293,29 @@ class CheckSafeExclusionsActorState { } int a_body1cont2(int loopDepth) { - loopDepth = a_body1cont3(loopDepth); + #line 8897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (used.allLessOrEqual(limit * CLIENT_KNOBS->STORAGE_METRICS_UNFAIR_SPLIT_LIMIT) && results.size() > 1) + #line 45298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.resize(results.arena(), results.size() - 1); + #line 45302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (keys.end <= locations.back().range.end) + #line 45306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.push_back_deep(results.arena(), keys.end); + #line 45310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>>::futures) { (void)(results); this->~SplitStorageMetricsWithLocationsActorState(); static_cast(this)->destroy(); return 0; } + #line 45314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Optional>> >::value()) Optional>>(std::move(results)); // state_var_RVO + this->~SplitStorageMetricsWithLocationsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } @@ -41886,23 +45328,18 @@ class CheckSafeExclusionsActorState { } int a_body1loopBody1(int loopDepth) { - #line 8313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = cx->onProxiesChanged(); - #line 8312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 41893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 8314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = basicLoadBalance(cx->getCommitProxies(UseProvisionalProxies::False), &CommitProxyInterface::exclusionSafetyCheckReq, ExclusionSafetyCheckRequest(exclusions), cx->taskID); - #line 41897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 41904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 8864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!(i < locations.size())) + #line 45333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 8865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + beginKey = locations[i].range.begin; + #line 8866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 45341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1loopHead1(loopDepth); return loopDepth; } @@ -41921,80 +45358,184 @@ class CheckSafeExclusionsActorState { } int a_body1loopBody1cont1(int loopDepth) { + #line 8864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + i++; + #line 45363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1loopBody1when1(Void const& _,int loopDepth) + int a_body1loopBody1loopHead1(int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1loopBody1(loopDepth); return loopDepth; } - int a_body1loopBody1when1(Void && _,int loopDepth) + int a_body1loopBody1loopBody1(int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 8867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRangeRef range(beginKey, locations[i].range.end); + #line 8868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SplitMetricsRequest req(range, limit, used, estimated, i == locations.size() - 1, minSplitBytes); + #line 8869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = loadBalance(locations[i].locations->locations(), &StorageServerInterface::splitMetrics, req, TaskPriority::DataDistribution); + #line 8869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 2)); + #line 45385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 8869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 45390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1when2(ExclusionSafetyCheckReply const& _ddCheck,int loopDepth) + int a_body1loopBody1break1(int loopDepth) { - #line 8319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ddCheck = _ddCheck.safe; - #line 41944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + try { + return a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), std::max(0, loopDepth - 1)); + } return loopDepth; } - int a_body1loopBody1when2(ExclusionSafetyCheckReply && _ddCheck,int loopDepth) + int a_body1loopBody1loopBody1cont1(SplitMetricsReply const& res,int loopDepth) { - #line 8319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ddCheck = _ddCheck.safe; - #line 41953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + #line 8873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.splits.size() && res.splits[0] <= results.back()) + #line 45412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT_WE_THINK(false); + #line 8877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch2(all_alternatives_failed(), std::max(0, loopDepth - 2)); + #line 45418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.splits.size()) + #line 45422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.append(results.arena(), res.splits.begin(), res.splits.size()); + #line 8882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.arena().dependsOn(res.splits.arena()); + #line 45428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + used = res.used; + #line 8887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.more && res.splits.size()) + #line 45434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + beginKey = KeyRef(beginKey.arena(), res.splits.back()); + #line 45438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break + } + if (loopDepth == 0) return a_body1loopBody1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1loopBody1cont1(SplitMetricsReply && res,int loopDepth) + { + #line 8873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.splits.size() && res.splits[0] <= results.back()) + #line 45452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT_WE_THINK(false); + #line 8877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch2(all_alternatives_failed(), std::max(0, loopDepth - 2)); + #line 45458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.splits.size()) + #line 45462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.append(results.arena(), res.splits.begin(), res.splits.size()); + #line 8882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.arena().dependsOn(res.splits.arena()); + #line 45468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 8885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + used = res.used; + #line 8887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.more && res.splits.size()) + #line 45474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + beginKey = KeyRef(beginKey.arena(), res.splits.back()); + #line 45478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break + } + if (loopDepth == 0) return a_body1loopBody1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1loopBody1when1(SplitMetricsReply const& res,int loopDepth) + { + loopDepth = a_body1loopBody1loopBody1cont1(res, loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1when1(SplitMetricsReply && res,int loopDepth) + { + loopDepth = a_body1loopBody1loopBody1cont1(std::move(res), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CheckSafeExclusionsActor, 0, Void >::remove(); - static_cast(this)->ActorCallback< CheckSafeExclusionsActor, 1, ExclusionSafetyCheckReply >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SplitStorageMetricsWithLocationsActor, 0, SplitMetricsReply >::remove(); } - void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< SplitStorageMetricsWithLocationsActor, 0, SplitMetricsReply >*,SplitMetricsReply const& value) { - fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 0); + fdb_probe_actor_enter("splitStorageMetricsWithLocations", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(value, 0); + a_body1loopBody1loopBody1when1(value, 0); } catch (Error& error) { a_body1Catch2(error, 0); } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 0); + fdb_probe_actor_exit("splitStorageMetricsWithLocations", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< SplitStorageMetricsWithLocationsActor, 0, SplitMetricsReply >*,SplitMetricsReply && value) { - fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 0); + fdb_probe_actor_enter("splitStorageMetricsWithLocations", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1loopBody1loopBody1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch2(error, 0); } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 0); + fdb_probe_actor_exit("splitStorageMetricsWithLocations", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< CheckSafeExclusionsActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< SplitStorageMetricsWithLocationsActor, 0, SplitMetricsReply >*,Error err) { - fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 0); + fdb_probe_actor_enter("splitStorageMetricsWithLocations", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch2(err, 0); @@ -42004,58 +45545,117 @@ class CheckSafeExclusionsActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 0); + fdb_probe_actor_exit("splitStorageMetricsWithLocations", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 1, ExclusionSafetyCheckReply >*,ExclusionSafetyCheckReply const& value) + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector locations; + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange keys; + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageMetrics limit; + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageMetrics estimated; + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional minSplitBytes; + #line 8858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageMetrics used; + #line 8859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone> results; + #line 8863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int i; + #line 8865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key beginKey; + #line 45569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via splitStorageMetricsWithLocations() + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SplitStorageMetricsWithLocationsActor final : public Actor>>>, public ActorCallback< SplitStorageMetricsWithLocationsActor, 0, SplitMetricsReply >, public FastAllocated, public SplitStorageMetricsWithLocationsActorState { + #line 45574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< SplitStorageMetricsWithLocationsActor, 0, SplitMetricsReply >; + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SplitStorageMetricsWithLocationsActor(std::vector const& locations,KeyRange const& keys,StorageMetrics const& limit,StorageMetrics const& estimated,Optional const& minSplitBytes) + #line 45585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>>>(), + SplitStorageMetricsWithLocationsActorState(locations, keys, limit, estimated, minSplitBytes) + { + fdb_probe_actor_enter("splitStorageMetricsWithLocations", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("splitStorageMetricsWithLocations"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("splitStorageMetricsWithLocations", reinterpret_cast(this), -1); + + } + void cancel() override { - fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 1); - a_exitChoose1(); - try { - a_body1loopBody1when2(value, 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< SplitStorageMetricsWithLocationsActor, 0, SplitMetricsReply >*)0, actor_cancelled()); break; } - fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 1, ExclusionSafetyCheckReply >*,ExclusionSafetyCheckReply && value) +}; +} + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future>>> splitStorageMetricsWithLocations( std::vector const& locations, KeyRange const& keys, StorageMetrics const& limit, StorageMetrics const& estimated, Optional const& minSplitBytes ) { + #line 8852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>>(new SplitStorageMetricsWithLocationsActor(locations, keys, limit, estimated, minSplitBytes)); + #line 45613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 8913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 45618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via splitStorageMetrics() + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SplitStorageMetricsActorState { + #line 45625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SplitStorageMetricsActorState(Database const& cx,KeyRange const& keys,StorageMetrics const& limit,StorageMetrics const& estimated,Optional const& minSplitBytes) + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keys(keys), + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + limit(limit), + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + estimated(estimated), + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + minSplitBytes(minSplitBytes), + #line 8919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:SplitStorageMetrics"_loc) + #line 45642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 1); - a_exitChoose1(); - try { - a_body1loopBody1when2(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 1); + fdb_probe_actor_create("splitStorageMetrics", reinterpret_cast(this)); } - void a_callback_error(ActorCallback< CheckSafeExclusionsActor, 1, ExclusionSafetyCheckReply >*,Error err) + ~SplitStorageMetricsActorState() { - fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 1); - a_exitChoose1(); - try { - a_body1Catch2(err, 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 1); + fdb_probe_actor_destroy("splitStorageMetrics", reinterpret_cast(this)); } - int a_body1cont3(int loopDepth) + int a_body1(int loopDepth=0) { try { - loopDepth = a_body1cont1(loopDepth); + #line 8920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 45657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -42065,133 +45665,118 @@ class CheckSafeExclusionsActorState { return loopDepth; } - int a_body1cont4(int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - #line 8357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int attemptCoordinatorExclude = 0; - #line 8358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int coordinatorsUnavailable = 0; - #line 8359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(int i = 0;i < leaderServers.size();i++) { - #line 8360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - NetworkAddress leaderAddress = coordinatorList.clientLeaderServers[i].getLeader.getEndpoint().getPrimaryAddress(); - #line 8362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (leaderServers[i].isReady()) - #line 42080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if ((std::count( exclusions.begin(), exclusions.end(), AddressExclusion(leaderAddress.ip, leaderAddress.port)) || std::count(exclusions.begin(), exclusions.end(), AddressExclusion(leaderAddress.ip)))) - #line 42084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - attemptCoordinatorExclude++; - #line 42088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - else - { - #line 8369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - coordinatorsUnavailable++; - #line 42095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - #line 8372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int faultTolerance = (leaderServers.size() - 1) / 2 - coordinatorsUnavailable; - #line 8373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bool coordinatorCheck = (attemptCoordinatorExclude <= faultTolerance); - #line 8374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("ExclusionSafetyCheckFinish") .detail("CoordinatorListSize", leaderServers.size()) .detail("NumExclusions", exclusions.size()) .detail("FaultTolerance", faultTolerance) .detail("AttemptCoordinatorExclude", attemptCoordinatorExclude) .detail("CoordinatorCheck", coordinatorCheck) .detail("DataDistributorCheck", ddCheck); - #line 8382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)((ddCheck && coordinatorCheck)); this->~CheckSafeExclusionsActorState(); static_cast(this)->destroy(); return 0; } - #line 42106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool((ddCheck && coordinatorCheck)); - this->~CheckSafeExclusionsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + this->~SplitStorageMetricsActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1loopHead1(int loopDepth) { - loopDepth = a_body1cont4(loopDepth); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1loopBody1(int loopDepth) { - loopDepth = a_body1cont4(loopDepth); + #line 8921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_0 = getKeyRangeLocations(cx, TenantInfo(), keys, CLIENT_KNOBS->STORAGE_METRICS_SHARD_LIMIT, Reverse::False, &StorageServerInterface::splitMetrics, span.context, Optional(), UseProvisionalProxies::False, latestVersion); + #line 8921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 45689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 8921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 45694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont1when2(Void const& _,int loopDepth) + int a_body1loopBody1cont1(int loopDepth) { - #line 8353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("ExclusionSafetyCheckNoCoordinatorQuorum").log(); - #line 8354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckSafeExclusionsActorState(); static_cast(this)->destroy(); return 0; } - #line 42132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(false); - this->~CheckSafeExclusionsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 8935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (locations.size() == CLIENT_KNOBS->STORAGE_METRICS_SHARD_LIMIT) + #line 45703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = delay(CLIENT_KNOBS->STORAGE_METRICS_TOO_MANY_SHARDS_DELAY, TaskPriority::DataDistribution); + #line 8936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 45709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 8936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 45714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont2(loopDepth); + } return loopDepth; } - int a_body1cont1when2(Void && _,int loopDepth) + int a_body1loopBody1when1(std::vector const& __locations,int loopDepth) { - #line 8353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("ExclusionSafetyCheckNoCoordinatorQuorum").log(); - #line 8354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckSafeExclusionsActorState(); static_cast(this)->destroy(); return 0; } - #line 42146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(false); - this->~CheckSafeExclusionsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 8921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + locations = __locations; + #line 45728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - void a_exitChoose2() + int a_body1loopBody1when1(std::vector && __locations,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CheckSafeExclusionsActor, 2, Void >::remove(); - static_cast(this)->ActorCallback< CheckSafeExclusionsActor, 3, Void >::remove(); + locations = std::move(__locations); + loopDepth = a_body1loopBody1cont1(loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 2, Void >*,Void const& value) + void a_exitChoose1() { - fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 2); - a_exitChoose2(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SplitStorageMetricsActor, 0, std::vector >::remove(); + + } + void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 0, std::vector >*,std::vector const& value) + { + fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont1when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 2); + fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 0, std::vector >*,std::vector && value) { - fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 2); - a_exitChoose2(); + fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 2); + fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< CheckSafeExclusionsActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< SplitStorageMetricsActor, 0, std::vector >*,Error err) { - fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 2); - a_exitChoose2(); + fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1Catch1(err, 0); } @@ -42200,42 +45785,94 @@ class CheckSafeExclusionsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 2); + fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 3, Void >*,Void const& value) + int a_body1loopBody1cont2(int loopDepth) { - fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 3); + #line 8941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture>>> __when_expr_2 = splitStorageMetricsWithLocations(locations, keys, limit, estimated, minSplitBytes); + #line 8941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 45797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 8941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast>> >*>(static_cast(this))); + #line 45802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 8937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache({}, keys); + #line 45811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return a_body1loopHead1(loopDepth); // continue + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 8937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache({}, keys); + #line 45820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return a_body1loopHead1(loopDepth); // continue + + return loopDepth; + } + int a_body1loopBody1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SplitStorageMetricsActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when2(value, 0); + a_body1loopBody1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 3); + fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 3); + fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when2(std::move(value), 0); + a_body1loopBody1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 3); + fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< CheckSafeExclusionsActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< SplitStorageMetricsActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 3); + fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -42245,234 +45882,121 @@ class CheckSafeExclusionsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 3); + fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 1); } - #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Database cx; - #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector exclusions; - #line 8309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bool ddCheck; - #line 8334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ClientCoordinators coordinatorList; - #line 8335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector>> leaderServers; - #line 42261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -}; -// This generated class is to be used only via checkSafeExclusions() - #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class CheckSafeExclusionsActor final : public Actor, public ActorCallback< CheckSafeExclusionsActor, 0, Void >, public ActorCallback< CheckSafeExclusionsActor, 1, ExclusionSafetyCheckReply >, public ActorCallback< CheckSafeExclusionsActor, 2, Void >, public ActorCallback< CheckSafeExclusionsActor, 3, Void >, public FastAllocated, public CheckSafeExclusionsActorState { - #line 42266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< CheckSafeExclusionsActor, 0, Void >; -friend struct ActorCallback< CheckSafeExclusionsActor, 1, ExclusionSafetyCheckReply >; -friend struct ActorCallback< CheckSafeExclusionsActor, 2, Void >; -friend struct ActorCallback< CheckSafeExclusionsActor, 3, Void >; - #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - CheckSafeExclusionsActor(Database const& cx,std::vector const& exclusions) - #line 42280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - CheckSafeExclusionsActorState(cx, exclusions) + int a_body1loopBody1cont5(Optional>> const& results,int loopDepth) { - fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("checkSafeExclusions"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< CheckSafeExclusionsActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< CheckSafeExclusionsActor, 2, Void >*)0, actor_cancelled()); break; - } - - } -}; -} - #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future checkSafeExclusions( Database const& cx, std::vector const& exclusions ) { - #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new CheckSafeExclusionsActor(cx, exclusions)); - #line 42309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -} - -#line 8384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - -// returns true if we can connect to the given worker interface - #line 42315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via verifyInterfaceActor() - #line 8386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class VerifyInterfaceActorActorState { - #line 42322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - #line 8386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - VerifyInterfaceActorActorState(Reference const& connectLock,ClientWorkerInterface const& workerInterf) - #line 8386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : connectLock(connectLock), - #line 8386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - workerInterf(workerInterf) - #line 42331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - fdb_probe_actor_create("verifyInterfaceActor", reinterpret_cast(this)); - - } - ~VerifyInterfaceActorActorState() - { - fdb_probe_actor_destroy("verifyInterfaceActor", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 8387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = connectLock->take(); - #line 8387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 42348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + #line 8944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (results.present()) + #line 45892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(results.get()); this->~SplitStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } + #line 45896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(results.get()); + this->~SplitStorageMetricsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~VerifyInterfaceActorActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) - { - #line 8388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - releaser = FlowLock::Releaser(*connectLock); - #line 8389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - leaderInterf = ClientLeaderRegInterface(workerInterf.address()); - #line 8391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_1 = brokenPromiseToNever(leaderInterf.getLeader.getReply(GetLeaderRequest())); - #line 8390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 42382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - #line 8395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->CLI_CONNECT_TIMEOUT); - #line 42386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 8395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache({}, keys); + #line 8949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution); + #line 8949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 45908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont5when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 8949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 45913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1loopBody1cont5(Optional>> && results,int loopDepth) { - #line 8388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - releaser = FlowLock::Releaser(*connectLock); - #line 8389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - leaderInterf = ClientLeaderRegInterface(workerInterf.address()); - #line 8391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_1 = brokenPromiseToNever(leaderInterf.getLeader.getReply(GetLeaderRequest())); - #line 8390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 42408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - #line 8395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->CLI_CONNECT_TIMEOUT); - #line 42412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 8395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (results.present()) + #line 45922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 8945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(results.get()); this->~SplitStorageMetricsActorState(); static_cast(this)->destroy(); return 0; } + #line 45926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(results.get()); + this->~SplitStorageMetricsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 8948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache({}, keys); + #line 8949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY, TaskPriority::DataDistribution); + #line 8949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 45938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont5when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 8949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 45943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont2when1(Optional>> const& results,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + loopDepth = a_body1loopBody1cont5(results, loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1loopBody1cont2when1(Optional>> && results,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont5(std::move(results), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< VerifyInterfaceActorActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SplitStorageMetricsActor, 2, Optional>> >::remove(); } - void a_callback_fire(ActorCallback< VerifyInterfaceActorActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 2, Optional>> >*,Optional>> const& value) { - fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1when1(value, 0); + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< VerifyInterfaceActorActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 2, Optional>> >*,Optional>> && value) { - fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< VerifyInterfaceActorActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< SplitStorageMetricsActor, 2, Optional>> >*,Error err) { - fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -42481,143 +46005,73 @@ class VerifyInterfaceActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 2); } - int a_body1cont1when1(Optional const& rep,int loopDepth) + int a_body1loopBody1cont6(Void const& _,int loopDepth) { - #line 8393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(true); this->~VerifyInterfaceActorActorState(); static_cast(this)->destroy(); return 0; } - #line 42491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(true); - this->~VerifyInterfaceActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1cont1when1(Optional && rep,int loopDepth) + int a_body1loopBody1cont6(Void && _,int loopDepth) { - #line 8393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(true); this->~VerifyInterfaceActorActorState(); static_cast(this)->destroy(); return 0; } - #line 42503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(true); - this->~VerifyInterfaceActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1cont1when2(Void const& _,int loopDepth) + int a_body1loopBody1cont5when1(Void const& _,int loopDepth) { - #line 8397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(false); this->~VerifyInterfaceActorActorState(); static_cast(this)->destroy(); return 0; } - #line 42515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(false); - this->~VerifyInterfaceActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1loopBody1cont6(_, loopDepth); return loopDepth; } - int a_body1cont1when2(Void && _,int loopDepth) + int a_body1loopBody1cont5when1(Void && _,int loopDepth) { - #line 8397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(false); this->~VerifyInterfaceActorActorState(); static_cast(this)->destroy(); return 0; } - #line 42527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< bool >::value()) bool(false); - this->~VerifyInterfaceActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1loopBody1cont6(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< VerifyInterfaceActorActor, 1, Optional >::remove(); - static_cast(this)->ActorCallback< VerifyInterfaceActorActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< VerifyInterfaceActorActor, 1, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< VerifyInterfaceActorActor, 1, Optional >*,Optional && value) - { - fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< VerifyInterfaceActorActor, 1, Optional >*,Error err) + void a_exitChoose4() { - fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 1); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SplitStorageMetricsActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< VerifyInterfaceActorActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 2); - a_exitChoose2(); + fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont1when2(value, 0); + a_body1loopBody1cont5when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 2); + fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< VerifyInterfaceActorActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< SplitStorageMetricsActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 2); - a_exitChoose2(); + fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont1when2(std::move(value), 0); + a_body1loopBody1cont5when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 2); + fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< VerifyInterfaceActorActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< SplitStorageMetricsActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 2); - a_exitChoose2(); + fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -42626,46 +46080,53 @@ class VerifyInterfaceActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 2); + fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), 3); } - #line 8386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference connectLock; - #line 8386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ClientWorkerInterface workerInterf; - #line 8388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - FlowLock::Releaser releaser; - #line 8389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ClientLeaderRegInterface leaderInterf; - #line 42640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database cx; + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange keys; + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageMetrics limit; + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageMetrics estimated; + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional minSplitBytes; + #line 8919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Span span; + #line 8921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector locations; + #line 46100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via verifyInterfaceActor() - #line 8386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class VerifyInterfaceActorActor final : public Actor, public ActorCallback< VerifyInterfaceActorActor, 0, Void >, public ActorCallback< VerifyInterfaceActorActor, 1, Optional >, public ActorCallback< VerifyInterfaceActorActor, 2, Void >, public FastAllocated, public VerifyInterfaceActorActorState { - #line 42645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via splitStorageMetrics() + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SplitStorageMetricsActor final : public Actor>>, public ActorCallback< SplitStorageMetricsActor, 0, std::vector >, public ActorCallback< SplitStorageMetricsActor, 1, Void >, public ActorCallback< SplitStorageMetricsActor, 2, Optional>> >, public ActorCallback< SplitStorageMetricsActor, 3, Void >, public FastAllocated, public SplitStorageMetricsActorState { + #line 46105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< VerifyInterfaceActorActor, 0, Void >; -friend struct ActorCallback< VerifyInterfaceActorActor, 1, Optional >; -friend struct ActorCallback< VerifyInterfaceActorActor, 2, Void >; - #line 8386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - VerifyInterfaceActorActor(Reference const& connectLock,ClientWorkerInterface const& workerInterf) - #line 42658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - VerifyInterfaceActorActorState(connectLock, workerInterf) +friend struct ActorCallback< SplitStorageMetricsActor, 0, std::vector >; +friend struct ActorCallback< SplitStorageMetricsActor, 1, Void >; +friend struct ActorCallback< SplitStorageMetricsActor, 2, Optional>> >; +friend struct ActorCallback< SplitStorageMetricsActor, 3, Void >; + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SplitStorageMetricsActor(Database const& cx,KeyRange const& keys,StorageMetrics const& limit,StorageMetrics const& estimated,Optional const& minSplitBytes) + #line 46119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>>(), + SplitStorageMetricsActorState(cx, keys, limit, estimated, minSplitBytes) { - fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), -1); + fdb_probe_actor_enter("splitStorageMetrics", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("verifyInterfaceActor"); + this->lineage.setActorName("splitStorageMetrics"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), -1); + fdb_probe_actor_exit("splitStorageMetrics", reinterpret_cast(this), -1); } void cancel() override @@ -42673,86 +46134,113 @@ friend struct ActorCallback< VerifyInterfaceActorActor, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< VerifyInterfaceActorActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< VerifyInterfaceActorActor, 1, Optional >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< SplitStorageMetricsActor, 0, std::vector >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< SplitStorageMetricsActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< SplitStorageMetricsActor, 2, Optional>> >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< SplitStorageMetricsActor, 3, Void >*)0, actor_cancelled()); break; } } }; } - #line 8386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future verifyInterfaceActor( Reference const& connectLock, ClientWorkerInterface const& workerInterf ) { - #line 8386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new VerifyInterfaceActorActor(connectLock, workerInterf)); - #line 42687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future>> splitStorageMetrics( Database const& cx, KeyRange const& keys, StorageMetrics const& limit, StorageMetrics const& estimated, Optional const& minSplitBytes ) { + #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new SplitStorageMetricsActor(cx, keys, limit, estimated, minSplitBytes)); + #line 46150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 8952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +Future>> DatabaseContext::splitStorageMetrics(KeyRange const& keys, + StorageMetrics const& limit, + StorageMetrics const& estimated, + Optional const& minSplitBytes) { + return ::splitStorageMetrics( + Database(Reference::addRef(this)), keys, limit, estimated, minSplitBytes); +} + +void Transaction::checkDeferredError() const { + trState->cx->checkDeferredError(); +} + +Reference Transaction::createTrLogInfoProbabilistically(const Database& cx) { + if (!cx->isError()) { + double clientSamplingProbability = + cx->globalConfig->get(fdbClientInfoTxnSampleRate, CLIENT_KNOBS->CSI_SAMPLING_PROBABILITY); + if (((networkOptions.logClientInfo.present() && networkOptions.logClientInfo.get()) || BUGGIFY) && + deterministicRandom()->random01() < clientSamplingProbability && + (!g_network->isSimulated() || !g_simulator->speedUpSimulation)) { + return makeReference(TransactionLogInfo::DATABASE); + } + } + + return Reference(); +} + +void Transaction::setTransactionID(UID id) { + ASSERT(getSize() == 0); + trState->spanContext = SpanContext(id, trState->spanContext.spanID, trState->spanContext.m_Flags); + tr.spanContext = trState->spanContext; + span.context = trState->spanContext; } -#line 8401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +void Transaction::setToken(uint64_t token) { + ASSERT(getSize() == 0); + trState->spanContext = SpanContext(trState->spanContext.traceID, token); +} + +void enableClientInfoLogging() { + ASSERT(networkOptions.logClientInfo.present() == false); + networkOptions.logClientInfo = true; + TraceEvent(SevInfo, "ClientInfoLoggingEnabled").log(); +} - #line 42692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 46199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via rebootWorkerActor() - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class RebootWorkerActorActorState { - #line 42699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via snapCreate() + #line 8997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 8997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SnapCreateActorState { + #line 46206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - RebootWorkerActorActorState(DatabaseContext* const& cx,ValueRef const& addr,bool const& check,int const& duration) - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SnapCreateActorState(Database const& cx,Standalone const& snapCmd,UID const& snapUID) + #line 8997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 8997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" : cx(cx), - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - addr(addr), - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - check(check), - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - duration(duration) - #line 42712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + snapCmd(snapCmd), + #line 8997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + snapUID(snapUID) + #line 46217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("rebootWorkerActor", reinterpret_cast(this)); + fdb_probe_actor_create("snapCreate", reinterpret_cast(this)); } - ~RebootWorkerActorActorState() + ~SnapCreateActorState() { - fdb_probe_actor_destroy("rebootWorkerActor", reinterpret_cast(this)); + fdb_probe_actor_destroy("snapCreate", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 8404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (duration < 0) - #line 42727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - duration = 0; - #line 42731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("SnapCreateEnter").detail("SnapCmd", snapCmd).detail("UID", snapUID); + #line 46232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + try { + #line 9000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 46236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } - #line 8406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!cx->getConnectionRecord()) - #line 42735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(0); this->~RebootWorkerActorActorState(); static_cast(this)->destroy(); return 0; } - #line 42739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< int64_t >::value()) int64_t(0); - this->~RebootWorkerActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); } - #line 8409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = getWorkerInterfaces(cx->getConnectionRecord()); - #line 8409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 42749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -42764,380 +46252,235 @@ class RebootWorkerActorActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~RebootWorkerActorActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(RangeResult const& kvs,int loopDepth) - { - #line 8410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(!kvs.more); - #line 8412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - workerInterfaces = std::map(); - #line 8413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( const auto& it : kvs ) { - #line 8414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ClientWorkerInterface workerInterf = BinaryReader::fromStringRef(it.value, IncludeVersion()); - #line 8416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key primaryAddress = it.key.endsWith(LiteralStringRef(":tls")) ? it.key.removeSuffix(LiteralStringRef(":tls")) : it.key; - #line 8418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - workerInterfaces[primaryAddress] = workerInterf; - #line 8420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (workerInterf.reboot.getEndpoint().addresses.secondaryAddress.present()) - #line 42789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key secondAddress = StringRef(workerInterf.reboot.getEndpoint().addresses.secondaryAddress.get().toString()); - #line 8423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - secondAddress = secondAddress.endsWith(LiteralStringRef(":tls")) ? secondAddress.removeSuffix(LiteralStringRef(":tls")) : secondAddress; - #line 8426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - workerInterfaces[secondAddress] = workerInterf; - #line 42797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - #line 8430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - addressesVec = std::vector(); - #line 8431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - boost::algorithm::split(addressesVec, addr.toString(), boost::is_any_of(",")); - #line 8433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference connectLock(new FlowLock(CLIENT_KNOBS->CLI_CONNECT_PARALLELISM)); - #line 8434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - verifyInterfs = std::vector>(); - #line 8435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( const auto& requestedAddress : addressesVec ) { - #line 8437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!workerInterfaces.count(Key(requestedAddress))) - #line 42812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(0); this->~RebootWorkerActorActorState(); static_cast(this)->destroy(); return 0; } - #line 42816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< int64_t >::value()) int64_t(0); - this->~RebootWorkerActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 8440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - verifyInterfs.push_back(verifyInterfaceActor(connectLock, workerInterfaces[Key(requestedAddress)])); - #line 42824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = waitForAll(verifyInterfs); - #line 8443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 42830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + this->~SnapCreateActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(RangeResult && kvs,int loopDepth) + int a_body1Catch2(const Error& e,int loopDepth=0) { - #line 8410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(!kvs.more); - #line 8412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - workerInterfaces = std::map(); - #line 8413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( const auto& it : kvs ) { - #line 8414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ClientWorkerInterface workerInterf = BinaryReader::fromStringRef(it.value, IncludeVersion()); - #line 8416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key primaryAddress = it.key.endsWith(LiteralStringRef(":tls")) ? it.key.removeSuffix(LiteralStringRef(":tls")) : it.key; - #line 8418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - workerInterfaces[primaryAddress] = workerInterf; - #line 8420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (workerInterf.reboot.getEndpoint().addresses.secondaryAddress.present()) - #line 42856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key secondAddress = StringRef(workerInterf.reboot.getEndpoint().addresses.secondaryAddress.get().toString()); - #line 8423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - secondAddress = secondAddress.endsWith(LiteralStringRef(":tls")) ? secondAddress.removeSuffix(LiteralStringRef(":tls")) : secondAddress; - #line 8426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - workerInterfaces[secondAddress] = workerInterf; - #line 42864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } + try { + #line 9014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("SnapCreateError").error(e).detail("SnapCmd", snapCmd.toString()).detail("UID", snapUID); + #line 9015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 46268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 8430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - addressesVec = std::vector(); - #line 8431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - boost::algorithm::split(addressesVec, addr.toString(), boost::is_any_of(",")); - #line 8433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference connectLock(new FlowLock(CLIENT_KNOBS->CLI_CONNECT_PARALLELISM)); - #line 8434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - verifyInterfs = std::vector>(); - #line 8435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( const auto& requestedAddress : addressesVec ) { - #line 8437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!workerInterfaces.count(Key(requestedAddress))) - #line 42879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(0); this->~RebootWorkerActorActorState(); static_cast(this)->destroy(); return 0; } - #line 42883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< int64_t >::value()) int64_t(0); - this->~RebootWorkerActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 8440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - verifyInterfs.push_back(verifyInterfaceActor(connectLock, workerInterfaces[Key(requestedAddress)])); - #line 42891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - #line 8443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = waitForAll(verifyInterfs); - #line 8443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 42897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 42902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; return loopDepth; } - int a_body1when1(RangeResult const& kvs,int loopDepth) + int a_body1loopHead1(int loopDepth) { - loopDepth = a_body1cont1(kvs, loopDepth); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); return loopDepth; } - int a_body1when1(RangeResult && kvs,int loopDepth) + int a_body1loopBody1(int loopDepth) { - loopDepth = a_body1cont1(std::move(kvs), loopDepth); - + #line 9002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = cx->onProxiesChanged(); + #line 9001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 46291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + #line 9003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = basicLoadBalance(cx->getCommitProxies(UseProvisionalProxies::False), &CommitProxyInterface::proxySnapReq, ProxySnapRequest(snapCmd, snapUID, snapUID), cx->taskID, AtMostOnce::True); + #line 46295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 46302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2(Void const& _,int loopDepth) + { + #line 9008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("SnapCreateExit").detail("SnapCmd", snapCmd).detail("UID", snapUID); + #line 9009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SnapCreateActorState(); static_cast(this)->destroy(); return 0; } + #line 46331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~SnapCreateActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1when2(Void && _,int loopDepth) + { + #line 9008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("SnapCreateExit").detail("SnapCmd", snapCmd).detail("UID", snapUID); + #line 9009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SnapCreateActorState(); static_cast(this)->destroy(); return 0; } + #line 46345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~SnapCreateActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< RebootWorkerActorActor, 0, RangeResult >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SnapCreateActor, 0, Void >::remove(); + static_cast(this)->ActorCallback< SnapCreateActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< RebootWorkerActorActor, 0, RangeResult >*,RangeResult const& value) + void a_callback_fire(ActorCallback< SnapCreateActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("rebootWorkerActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("snapCreate", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("rebootWorkerActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("snapCreate", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< RebootWorkerActorActor, 0, RangeResult >*,RangeResult && value) + void a_callback_fire(ActorCallback< SnapCreateActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("rebootWorkerActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("snapCreate", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("rebootWorkerActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("snapCreate", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< RebootWorkerActorActor, 0, RangeResult >*,Error err) + void a_callback_error(ActorCallback< SnapCreateActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("rebootWorkerActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("snapCreate", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1Catch2(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("rebootWorkerActor", reinterpret_cast(this), 0); - - } - int a_body1cont4(Void const& _,int loopDepth) - { - #line 8444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( const auto& f : verifyInterfs ) { - #line 8445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!f.get()) - #line 42976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(0); this->~RebootWorkerActorActorState(); static_cast(this)->destroy(); return 0; } - #line 42980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< int64_t >::value()) int64_t(0); - this->~RebootWorkerActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - #line 8449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( const auto& address : addressesVec ) { - #line 8451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - workerInterfaces[Key(address)].reboot.send(RebootRequest(false, check, duration)); - #line 42991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(1); this->~RebootWorkerActorActorState(); static_cast(this)->destroy(); return 0; } - #line 42995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< int64_t >::value()) int64_t(1); - this->~RebootWorkerActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont4(Void && _,int loopDepth) - { - #line 8444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( const auto& f : verifyInterfs ) { - #line 8445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!f.get()) - #line 43009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(0); this->~RebootWorkerActorActorState(); static_cast(this)->destroy(); return 0; } - #line 43013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< int64_t >::value()) int64_t(0); - this->~RebootWorkerActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - } - #line 8449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( const auto& address : addressesVec ) { - #line 8451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - workerInterfaces[Key(address)].reboot.send(RebootRequest(false, check, duration)); - #line 43024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + a_body1Catch2(unknown_error(), 0); } - #line 8453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(1); this->~RebootWorkerActorActorState(); static_cast(this)->destroy(); return 0; } - #line 43028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< int64_t >::value()) int64_t(1); - this->~RebootWorkerActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont4(_, loopDepth); - - return loopDepth; - } - int a_body1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont4(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< RebootWorkerActorActor, 1, Void >::remove(); + fdb_probe_actor_exit("snapCreate", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< RebootWorkerActorActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< SnapCreateActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("rebootWorkerActor", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("snapCreate", reinterpret_cast(this), 1); + a_exitChoose1(); try { - a_body1cont1when1(value, 0); + a_body1loopBody1when2(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("rebootWorkerActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("snapCreate", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< RebootWorkerActorActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< SnapCreateActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("rebootWorkerActor", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("snapCreate", reinterpret_cast(this), 1); + a_exitChoose1(); try { - a_body1cont1when1(std::move(value), 0); + a_body1loopBody1when2(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("rebootWorkerActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("snapCreate", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< RebootWorkerActorActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< SnapCreateActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("rebootWorkerActor", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("snapCreate", reinterpret_cast(this), 1); + a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1Catch2(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("rebootWorkerActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("snapCreate", reinterpret_cast(this), 1); } - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - DatabaseContext* cx; - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ValueRef addr; - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bool check; - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int duration; - #line 8412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::map workerInterfaces; - #line 8430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector addressesVec; - #line 8434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector> verifyInterfs; - #line 43113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 8997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database cx; + #line 8997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone snapCmd; + #line 8997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + UID snapUID; + #line 46456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via rebootWorkerActor() - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class RebootWorkerActorActor final : public Actor, public ActorCallback< RebootWorkerActorActor, 0, RangeResult >, public ActorCallback< RebootWorkerActorActor, 1, Void >, public FastAllocated, public RebootWorkerActorActorState { - #line 43118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via snapCreate() + #line 8997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SnapCreateActor final : public Actor, public ActorCallback< SnapCreateActor, 0, Void >, public ActorCallback< SnapCreateActor, 1, Void >, public FastAllocated, public SnapCreateActorState { + #line 46461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< RebootWorkerActorActor, 0, RangeResult >; -friend struct ActorCallback< RebootWorkerActorActor, 1, Void >; - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - RebootWorkerActorActor(DatabaseContext* const& cx,ValueRef const& addr,bool const& check,int const& duration) - #line 43130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - RebootWorkerActorActorState(cx, addr, check, duration) +friend struct ActorCallback< SnapCreateActor, 0, Void >; +friend struct ActorCallback< SnapCreateActor, 1, Void >; + #line 8997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SnapCreateActor(Database const& cx,Standalone const& snapCmd,UID const& snapUID) + #line 46473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + SnapCreateActorState(cx, snapCmd, snapUID) { - fdb_probe_actor_enter("rebootWorkerActor", reinterpret_cast(this), -1); + fdb_probe_actor_enter("snapCreate", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("rebootWorkerActor"); + this->lineage.setActorName("snapCreate"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("rebootWorkerActor", reinterpret_cast(this), -1); + fdb_probe_actor_exit("snapCreate", reinterpret_cast(this), -1); } void cancel() override @@ -43145,71 +46488,72 @@ friend struct ActorCallback< RebootWorkerActorActor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< RebootWorkerActorActor, 0, RangeResult >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< RebootWorkerActorActor, 1, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< SnapCreateActor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] static Future rebootWorkerActor( DatabaseContext* const& cx, ValueRef const& addr, bool const& check, int const& duration ) { - #line 8402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new RebootWorkerActorActor(cx, addr, check, duration)); - #line 43159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -} - -#line 8455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - -Future DatabaseContext::rebootWorker(StringRef addr, bool check, int duration) { - return rebootWorkerActor(this, addr, check, duration); + #line 8997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future snapCreate( Database const& cx, Standalone const& snapCmd, UID const& snapUID ) { + #line 8997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new SnapCreateActor(cx, snapCmd, snapUID)); + #line 46501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -Future DatabaseContext::forceRecoveryWithDataLoss(StringRef dcId) { - return forceRecovery(getConnectionRecord(), dcId); -} +#line 9018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 43172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 46506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via createSnapshotActor() - #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class CreateSnapshotActorActorState { - #line 43179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via createCheckpointImpl() + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class CreateCheckpointImplActorState { + #line 46513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - CreateSnapshotActorActorState(DatabaseContext* const& cx,UID const& snapUID,StringRef const& snapCmd) - #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : cx(cx), - #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - snapUID(snapUID), - #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - snapCmd(snapCmd) - #line 43190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CreateCheckpointImplActorState(T const& tr,std::vector const& ranges,CheckpointFormat const& format,Optional const& actionId) + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : tr(tr), + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ranges(ranges), + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + format(format), + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + actionId(actionId) + #line 46526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("createSnapshotActor", reinterpret_cast(this)); + fdb_probe_actor_create("createCheckpointImpl", reinterpret_cast(this)); } - ~CreateSnapshotActorActorState() + ~CreateCheckpointImplActorState() { - fdb_probe_actor_destroy("createSnapshotActor", reinterpret_cast(this)); + fdb_probe_actor_destroy("createCheckpointImpl", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 8465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = mgmtSnapCreate(cx->clone(), snapCmd, snapUID); - #line 8465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 43207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!tr->getTenant().present()); + #line 9025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!ranges.empty()); + #line 9026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(actionId.present()); + #line 9027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "CreateCheckpointTransactionBegin").detail("Ranges", describe(ranges)); + #line 9029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = tr->getRange(serverTagKeys, CLIENT_KNOBS->TOO_MANY); + #line 9029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 46551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 9029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 46556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -43222,57 +46566,52 @@ class CreateSnapshotActorActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~CreateSnapshotActorActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~CreateCheckpointImplActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(Void const& _,int loopDepth) - { - #line 8466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CreateSnapshotActorActorState(); static_cast(this)->destroy(); return 0; } - #line 43235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~CreateSnapshotActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont1(Void && _,int loopDepth) + int a_body1cont1(int loopDepth) { - #line 8466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CreateSnapshotActorActorState(); static_cast(this)->destroy(); return 0; } - #line 43247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~CreateSnapshotActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 9030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!UIDtoTagMap.more && UIDtoTagMap.size() < CLIENT_KNOBS->TOO_MANY); + #line 9032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeMap = std::unordered_map>(); + #line 9033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + srcMap = std::unordered_map>(); + #line 9034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + RangeForbody1cont1Iterator0 = std::begin(ranges); + #line 46585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1when1(RangeResult const& __UIDtoTagMap,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + #line 9029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + UIDtoTagMap = __UIDtoTagMap; + #line 46594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1when1(RangeResult && __UIDtoTagMap,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + UIDtoTagMap = std::move(__UIDtoTagMap); + loopDepth = a_body1cont1(loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CreateSnapshotActorActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateCheckpointImplActor, 0, RangeResult >::remove(); } - void a_callback_fire(ActorCallback< CreateSnapshotActorActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< CreateCheckpointImplActor, 0, RangeResult >*,RangeResult const& value) { - fdb_probe_actor_enter("createSnapshotActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("createCheckpointImpl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -43282,12 +46621,12 @@ class CreateSnapshotActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("createSnapshotActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("createCheckpointImpl", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< CreateSnapshotActorActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< CreateCheckpointImplActor, 0, RangeResult >*,RangeResult && value) { - fdb_probe_actor_enter("createSnapshotActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("createCheckpointImpl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -43297,12 +46636,12 @@ class CreateSnapshotActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("createSnapshotActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("createCheckpointImpl", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< CreateSnapshotActorActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< CreateCheckpointImplActor, 0, RangeResult >*,Error err) { - fdb_probe_actor_enter("createSnapshotActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("createCheckpointImpl", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -43312,132 +46651,84 @@ class CreateSnapshotActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("createSnapshotActor", reinterpret_cast(this), 0); - - } - #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - DatabaseContext* cx; - #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - UID snapUID; - #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StringRef snapCmd; - #line 43324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -}; -// This generated class is to be used only via createSnapshotActor() - #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class CreateSnapshotActorActor final : public Actor, public ActorCallback< CreateSnapshotActorActor, 0, Void >, public FastAllocated, public CreateSnapshotActorActorState { - #line 43329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< CreateSnapshotActorActor, 0, Void >; - #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - CreateSnapshotActorActor(DatabaseContext* const& cx,UID const& snapUID,StringRef const& snapCmd) - #line 43340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - CreateSnapshotActorActorState(cx, snapUID, snapCmd) - { - fdb_probe_actor_enter("createSnapshotActor", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("createSnapshotActor"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("createSnapshotActor", reinterpret_cast(this), -1); + fdb_probe_actor_exit("createCheckpointImpl", reinterpret_cast(this), 0); } - void cancel() override + int a_body1cont2(int loopDepth) { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< CreateSnapshotActorActor, 0, Void >*)0, actor_cancelled()); break; + #line 9049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (format == DataMoveRocksCF) + #line 46661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( const auto& [srcId, ranges] : rangeMap ) { + #line 9053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + const UID checkpointID = UID(deterministicRandom()->randomUInt64(), srcId.first()); + #line 9054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CheckpointMetaData checkpoint(ranges, format, srcMap[srcId], checkpointID, actionId.get()); + #line 9055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + checkpoint.setState(CheckpointMetaData::Pending); + #line 9056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->set(checkpointKeyFor(checkpointID), checkpointValue(checkpoint)); + #line 9058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "CreateCheckpointTransactionShard") .detail("CheckpointKey", checkpointKeyFor(checkpointID)) .detail("CheckpointMetaData", checkpoint.toString()); + #line 46675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } } + else + { + #line 9063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(not_implemented(), loopDepth); + #line 46682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CreateCheckpointImplActorState(); static_cast(this)->destroy(); return 0; } + #line 46686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CreateCheckpointImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + return loopDepth; } -}; -} - #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] static Future createSnapshotActor( DatabaseContext* const& cx, UID const& snapUID, StringRef const& snapCmd ) { - #line 8464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new CreateSnapshotActorActor(cx, snapUID, snapCmd)); - #line 43368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -} - -#line 8468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - -Future DatabaseContext::createSnapshot(StringRef uid, StringRef snapshot_command) { - std::string uid_str = uid.toString(); - if (!std::all_of(uid_str.begin(), uid_str.end(), [](unsigned char c) { return std::isxdigit(c); }) || - uid_str.size() != 32) { - // only 32-length hex string is considered as a valid UID - throw snap_invalid_uid_string(); - } - return createSnapshotActor(this, UID::fromString(uid_str), snapshot_command); -} - -void sharedStateDelRef(DatabaseSharedState* ssPtr) { - if (--ssPtr->refCount == 0) { - delete ssPtr; - } -} - -Future DatabaseContext::initSharedState() { - ASSERT(!sharedStatePtr); // Don't re-initialize shared state if a pointer already exists - DatabaseSharedState* newState = new DatabaseSharedState(); - // Increment refcount by 1 on creation to account for the one held in MultiVersionApi map - // Therefore, on initialization, refCount should be 2 (after also going to setSharedState) - newState->refCount++; - newState->delRef = &sharedStateDelRef; - setSharedState(newState); - return newState; -} - -void DatabaseContext::setSharedState(DatabaseSharedState* p) { - ASSERT(p->protocolVersion == currentProtocolVersion); - sharedStatePtr = p; - sharedStatePtr->refCount++; -} - - #line 43406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via storageFeedVersionUpdater() - #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class StorageFeedVersionUpdaterActorState { - #line 43413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StorageFeedVersionUpdaterActorState(StorageServerInterface const& interf,ChangeFeedStorageData* const& self) - #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : interf(interf), - #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - self(self), - #line 8503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - destroyed(self->destroyed) - #line 43424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + int a_body1cont1loopHead1(int loopDepth) { - fdb_probe_actor_create("storageFeedVersionUpdater", reinterpret_cast(this)); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); + return loopDepth; } - ~StorageFeedVersionUpdaterActorState() + int a_body1cont1loopBody1(int loopDepth) { - fdb_probe_actor_destroy("storageFeedVersionUpdater", reinterpret_cast(this)); + #line 9034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!(RangeForbody1cont1Iterator0 != std::end(ranges))) + #line 46705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 9034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + const auto& range = *RangeForbody1cont1Iterator0; + #line 46711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = krmGetRanges(tr, keyServersPrefix, range); + #line 9035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 46717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 46722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + return loopDepth; } - int a_body1(int loopDepth=0) + int a_body1cont1break1(int loopDepth) { try { - #line 8504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 43439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); + return a_body1cont2(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -43447,214 +46738,123 @@ class StorageFeedVersionUpdaterActorState { return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~StorageFeedVersionUpdaterActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) + int a_body1cont1loopBody1cont1(int loopDepth) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + #line 9034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++RangeForbody1cont1Iterator0; + #line 46745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; } - int a_body1loopBody1(int loopDepth) + int a_body1cont1loopBody1cont3(RangeResult const& keyServers,int loopDepth) { - #line 8505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (destroyed.isSet()) - #line 43469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~StorageFeedVersionUpdaterActorState(); static_cast(this)->destroy(); return 0; } - #line 43473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~StorageFeedVersionUpdaterActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 8508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (self->version.get() < self->desired.get()) - #line 43481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = delay(CLIENT_KNOBS->CHANGE_FEED_EMPTY_BATCH_TIME) || self->version.whenAtLeast(self->desired.get()); - #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 43487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 8533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = self->desired.whenAtLeast(self->version.get() + 1); - #line 8533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 43501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 8533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - - return loopDepth; - } - int a_body1loopBody1cont1(int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1cont3(Void const& _,int loopDepth) - { - #line 8510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (destroyed.isSet()) - #line 43522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~StorageFeedVersionUpdaterActorState(); static_cast(this)->destroy(); return 0; } - #line 43526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~StorageFeedVersionUpdaterActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 8513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (self->version.get() < self->desired.get()) - #line 43534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - try { - #line 8515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = brokenPromiseToNever( interf.changeFeedVersionUpdate.getReply(ChangeFeedVersionUpdateRequest(self->desired.get()))); - #line 8515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont3Catch1(actor_cancelled(), loopDepth); - #line 43541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont3Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1cont3Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1cont3Catch1(unknown_error(), loopDepth); - } - } - else - { - loopDepth = a_body1loopBody1cont4(loopDepth); + #line 9036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!keyServers.more); + #line 9037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < keyServers.size() - 1;++i) { + #line 9038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + const KeyRangeRef currentRange(keyServers[i].key, keyServers[i + 1].key); + #line 9039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector src; + #line 9040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector dest; + #line 9041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + UID srcId; + #line 9042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + UID destId; + #line 9043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + decodeKeyServersValue(UIDtoTagMap, keyServers[i].value, src, dest, srcId, destId); + #line 9044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeMap[srcId].push_back(currentRange); + #line 9045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + srcMap.emplace(srcId, src); + #line 46772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont3(Void && _,int loopDepth) + int a_body1cont1loopBody1cont3(RangeResult && keyServers,int loopDepth) { - #line 8510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (destroyed.isSet()) - #line 43566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~StorageFeedVersionUpdaterActorState(); static_cast(this)->destroy(); return 0; } - #line 43570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~StorageFeedVersionUpdaterActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 8513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (self->version.get() < self->desired.get()) - #line 43578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - try { - #line 8515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = brokenPromiseToNever( interf.changeFeedVersionUpdate.getReply(ChangeFeedVersionUpdateRequest(self->desired.get()))); - #line 8515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont3Catch1(actor_cancelled(), loopDepth); - #line 43585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont3Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1cont3Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1cont3Catch1(unknown_error(), loopDepth); - } - } - else - { - loopDepth = a_body1loopBody1cont4(loopDepth); + #line 9036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!keyServers.more); + #line 9037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < keyServers.size() - 1;++i) { + #line 9038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + const KeyRangeRef currentRange(keyServers[i].key, keyServers[i + 1].key); + #line 9039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector src; + #line 9040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector dest; + #line 9041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + UID srcId; + #line 9042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + UID destId; + #line 9043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + decodeKeyServersValue(UIDtoTagMap, keyServers[i].value, src, dest, srcId, destId); + #line 9044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeMap[srcId].push_back(currentRange); + #line 9045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + srcMap.emplace(srcId, src); + #line 46800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1when1(Void const& _,int loopDepth) + int a_body1cont1loopBody1when1(RangeResult const& keyServers,int loopDepth) { - loopDepth = a_body1loopBody1cont3(_, loopDepth); + loopDepth = a_body1cont1loopBody1cont3(keyServers, loopDepth); return loopDepth; } - int a_body1loopBody1when1(Void && _,int loopDepth) + int a_body1cont1loopBody1when1(RangeResult && keyServers,int loopDepth) { - loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + loopDepth = a_body1cont1loopBody1cont3(std::move(keyServers), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< StorageFeedVersionUpdaterActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateCheckpointImplActor, 1, RangeResult >::remove(); } - void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< CreateCheckpointImplActor, 1, RangeResult >*,RangeResult const& value) { - fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("createCheckpointImpl", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when1(value, 0); + a_body1cont1loopBody1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 0); + fdb_probe_actor_exit("createCheckpointImpl", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< CreateCheckpointImplActor, 1, RangeResult >*,RangeResult && value) { - fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("createCheckpointImpl", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1cont1loopBody1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 0); + fdb_probe_actor_exit("createCheckpointImpl", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< StorageFeedVersionUpdaterActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< CreateCheckpointImplActor, 1, RangeResult >*,Error err) { - fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("createCheckpointImpl", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -43663,802 +46863,1007 @@ class StorageFeedVersionUpdaterActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 0); + fdb_probe_actor_exit("createCheckpointImpl", reinterpret_cast(this), 1); } - int a_body1loopBody1cont4(int loopDepth) + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + T tr; + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector ranges; + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CheckpointFormat format; + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional actionId; + #line 9029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + RangeResult UIDtoTagMap; + #line 9032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::unordered_map> rangeMap; + #line 9033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::unordered_map> srcMap; + #line 9034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + decltype(std::begin(std::declval>())) RangeForbody1cont1Iterator0; + #line 46885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via createCheckpointImpl() + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class CreateCheckpointImplActor final : public Actor, public ActorCallback< CreateCheckpointImplActor, 0, RangeResult >, public ActorCallback< CreateCheckpointImplActor, 1, RangeResult >, public FastAllocated>, public CreateCheckpointImplActorState> { + #line 46892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CreateCheckpointImplActor, 0, RangeResult >; +friend struct ActorCallback< CreateCheckpointImplActor, 1, RangeResult >; + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CreateCheckpointImplActor(T const& tr,std::vector const& ranges,CheckpointFormat const& format,Optional const& actionId) + #line 46904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + CreateCheckpointImplActorState>(tr, ranges, format, actionId) { - loopDepth = a_body1loopBody1cont1(loopDepth); + fdb_probe_actor_enter("createCheckpointImpl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("createCheckpointImpl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("createCheckpointImpl", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1loopBody1cont6(int loopDepth) + void cancel() override { - loopDepth = a_body1loopBody1cont4(loopDepth); + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CreateCheckpointImplActor, 0, RangeResult >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CreateCheckpointImplActor, 1, RangeResult >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] static Future createCheckpointImpl( T const& tr, std::vector const& ranges, CheckpointFormat const& format, Optional const& actionId ) { + #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new CreateCheckpointImplActor(tr, ranges, format, actionId)); + #line 46935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +Future createCheckpoint(Reference tr, + const std::vector& ranges, + CheckpointFormat format, + Optional actionId) { + return holdWhile(tr, createCheckpointImpl(tr, ranges, format, actionId)); +} + +Future createCheckpoint(Transaction* tr, + const std::vector& ranges, + CheckpointFormat format, + Optional actionId) { + return createCheckpointImpl(tr, ranges, format, actionId); +} + +// Gets CheckpointMetaData of the specific keyrange, version and format from one of the storage servers, if none of the +// servers have the checkpoint, a checkpoint_not_found error is returned. + #line 46956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via getCheckpointMetaDataInternal() + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetCheckpointMetaDataInternalActorState { + #line 46963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetCheckpointMetaDataInternalActorState(KeyRange const& range,Version const& version,CheckpointFormat const& format,Optional const& actionId,Reference const& alternatives,double const& timeout) + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : range(range), + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version), + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + format(format), + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + actionId(actionId), + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + alternatives(alternatives), + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + timeout(timeout) + #line 46980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("getCheckpointMetaDataInternal", reinterpret_cast(this)); + + } + ~GetCheckpointMetaDataInternalActorState() + { + fdb_probe_actor_destroy("getCheckpointMetaDataInternal", reinterpret_cast(this)); - return loopDepth; } - int a_body1loopBody1cont3Catch1(const Error& e,int loopDepth=0) + int a_body1(int loopDepth=0) { try { - #line 8522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_server_overloaded) - #line 43686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY > CLIENT_KNOBS->CHANGE_FEED_EMPTY_BATCH_TIME) - #line 43690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY - CLIENT_KNOBS->CHANGE_FEED_EMPTY_BATCH_TIME); - #line 8524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 43696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont3Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 8524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 43701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1loopBody1cont3Catch1cont2(loopDepth); - } - } - else - { - #line 8528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 43713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "GetCheckpointMetaDataInternalBegin") .detail("Range", range) .detail("Version", version) .detail("Format", static_cast(format)) .detail("Locations", alternatives->description()); + #line 9097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + futures = std::vector>>(); + #line 9098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + index = 0; + #line 9099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(index = 0;index < alternatives->size();++index) { + #line 9101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + futures.push_back(errorOr(timeoutError(alternatives->getInterface(index).checkpoint.getReply( GetCheckpointRequest({ range }, version, format, actionId)), timeout))); + #line 47003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + #line 9106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + error = Optional(); + #line 9107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = waitForAll(futures); + #line 9107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 47011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 47016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1loopBody1cont7(ChangeFeedVersionUpdateReply const& rep,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - #line 8518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (rep.version > self->version.get()) - #line 43728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - self->version.set(rep.version); - #line 43732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + this->~GetCheckpointMetaDataInternalActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 9108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "GetCheckpointMetaDataInternalWaitEnd").detail("Range", range).detail("Version", version); + #line 9110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(index = 0;index < futures.size();++index) { + #line 9111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!futures[index].isReady()) + #line 47043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + error = timed_out(); + #line 9113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "GetCheckpointMetaDataInternalSSTimeout") .detail("Range", range) .detail("Version", version) .detail("StorageServer", alternatives->getInterface(index).uniqueID); + #line 47049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + continue; + } + #line 9120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (futures[index].get().isError()) + #line 47054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + const Error& e = futures[index].get().getError(); + #line 9122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevWarn, "GetCheckpointMetaDataInternalError") .errorUnsuppressed(e) .detail("Range", range) .detail("Version", version) .detail("StorageServer", alternatives->getInterface(index).uniqueID); + #line 9127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() != error_code_checkpoint_not_found || !error.present()) + #line 47062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + error = e; + #line 47066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + else + { + #line 9131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(futures[index].get().get()); this->~GetCheckpointMetaDataInternalActorState(); static_cast(this)->destroy(); return 0; } + #line 47073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< CheckpointMetaData >::value()) CheckpointMetaData(futures[index].get().get()); + this->~GetCheckpointMetaDataInternalActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } } - loopDepth = a_body1loopBody1cont10(loopDepth); + #line 9135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(error.present()); + #line 9136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(error.get(), loopDepth); + #line 47084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } - int a_body1loopBody1cont7(ChangeFeedVersionUpdateReply && rep,int loopDepth) + int a_body1cont1(Void && _,int loopDepth) { - #line 8518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (rep.version > self->version.get()) - #line 43742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - self->version.set(rep.version); - #line 43746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "GetCheckpointMetaDataInternalWaitEnd").detail("Range", range).detail("Version", version); + #line 9110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(index = 0;index < futures.size();++index) { + #line 9111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!futures[index].isReady()) + #line 47096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + error = timed_out(); + #line 9113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "GetCheckpointMetaDataInternalSSTimeout") .detail("Range", range) .detail("Version", version) .detail("StorageServer", alternatives->getInterface(index).uniqueID); + #line 47102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + continue; + } + #line 9120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (futures[index].get().isError()) + #line 47107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + const Error& e = futures[index].get().getError(); + #line 9122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevWarn, "GetCheckpointMetaDataInternalError") .errorUnsuppressed(e) .detail("Range", range) .detail("Version", version) .detail("StorageServer", alternatives->getInterface(index).uniqueID); + #line 9127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() != error_code_checkpoint_not_found || !error.present()) + #line 47115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + error = e; + #line 47119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + else + { + #line 9131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(futures[index].get().get()); this->~GetCheckpointMetaDataInternalActorState(); static_cast(this)->destroy(); return 0; } + #line 47126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< CheckpointMetaData >::value()) CheckpointMetaData(futures[index].get().get()); + this->~GetCheckpointMetaDataInternalActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } } - loopDepth = a_body1loopBody1cont10(loopDepth); + #line 9135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(error.present()); + #line 9136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(error.get(), loopDepth); + #line 47137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } - int a_body1loopBody1cont3when1(ChangeFeedVersionUpdateReply const& rep,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont7(rep, loopDepth); + loopDepth = a_body1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont3when1(ChangeFeedVersionUpdateReply && rep,int loopDepth) + int a_body1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont7(std::move(rep), loopDepth); + loopDepth = a_body1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< StorageFeedVersionUpdaterActor, 1, ChangeFeedVersionUpdateReply >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetCheckpointMetaDataInternalActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 1, ChangeFeedVersionUpdateReply >*,ChangeFeedVersionUpdateReply const& value) + void a_callback_fire(ActorCallback< GetCheckpointMetaDataInternalActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getCheckpointMetaDataInternal", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1cont3when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { - a_body1loopBody1cont3Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1cont3Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getCheckpointMetaDataInternal", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 1, ChangeFeedVersionUpdateReply >*,ChangeFeedVersionUpdateReply && value) + void a_callback_fire(ActorCallback< GetCheckpointMetaDataInternalActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getCheckpointMetaDataInternal", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1cont3when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1cont3Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1cont3Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getCheckpointMetaDataInternal", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< StorageFeedVersionUpdaterActor, 1, ChangeFeedVersionUpdateReply >*,Error err) + void a_callback_error(ActorCallback< GetCheckpointMetaDataInternalActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getCheckpointMetaDataInternal", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1cont3Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1cont3Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1cont3Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getCheckpointMetaDataInternal", reinterpret_cast(this), 0); } - int a_body1loopBody1cont10(int loopDepth) + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CheckpointFormat format; + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional actionId; + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference alternatives; + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + double timeout; + #line 9097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector>> futures; + #line 9098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int index; + #line 9106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional error; + #line 47222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via getCheckpointMetaDataInternal() + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetCheckpointMetaDataInternalActor final : public Actor, public ActorCallback< GetCheckpointMetaDataInternalActor, 0, Void >, public FastAllocated, public GetCheckpointMetaDataInternalActorState { + #line 47227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetCheckpointMetaDataInternalActor, 0, Void >; + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetCheckpointMetaDataInternalActor(KeyRange const& range,Version const& version,CheckpointFormat const& format,Optional const& actionId,Reference const& alternatives,double const& timeout) + #line 47238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + GetCheckpointMetaDataInternalActorState(range, version, format, actionId, alternatives, timeout) { - try { - loopDepth = a_body1loopBody1cont6(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } + fdb_probe_actor_enter("getCheckpointMetaDataInternal", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getCheckpointMetaDataInternal"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getCheckpointMetaDataInternal", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1loopBody1cont3Catch1cont1(int loopDepth) + void cancel() override { - loopDepth = a_body1loopBody1cont6(loopDepth); + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetCheckpointMetaDataInternalActor, 0, Void >*)0, actor_cancelled()); break; + } - return loopDepth; } - int a_body1loopBody1cont3Catch1cont2(int loopDepth) +}; +} + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] static Future getCheckpointMetaDataInternal( KeyRange const& range, Version const& version, CheckpointFormat const& format, Optional const& actionId, Reference const& alternatives, double const& timeout ) { + #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetCheckpointMetaDataInternalActor(range, version, format, actionId, alternatives, timeout)); + #line 47266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 47271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via getCheckpointMetaDataForRange() + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetCheckpointMetaDataForRangeActorState { + #line 47278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetCheckpointMetaDataForRangeActorState(Database const& cx,KeyRange const& range,Version const& version,CheckpointFormat const& format,Optional const& actionId,double const& timeout) + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version), + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + format(format), + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + actionId(actionId), + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + timeout(timeout), + #line 9146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:GetCheckpointMetaDataForRange"_loc), + #line 9147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + index(0), + #line 9148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + futures(), + #line 9149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + locations() + #line 47303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - loopDepth = a_body1loopBody1cont3Catch1cont1(loopDepth); + fdb_probe_actor_create("getCheckpointMetaDataForRange", reinterpret_cast(this)); - return loopDepth; } - int a_body1loopBody1cont3Catch1cont3(Void const& _,int loopDepth) + ~GetCheckpointMetaDataForRangeActorState() { - loopDepth = a_body1loopBody1cont3Catch1cont2(loopDepth); + fdb_probe_actor_destroy("getCheckpointMetaDataForRange", reinterpret_cast(this)); - return loopDepth; } - int a_body1loopBody1cont3Catch1cont3(Void && _,int loopDepth) + int a_body1(int loopDepth=0) { - loopDepth = a_body1loopBody1cont3Catch1cont2(loopDepth); + try { + #line 9151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 47318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1loopBody1cont3Catch1when1(Void const& _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - loopDepth = a_body1loopBody1cont3Catch1cont3(_, loopDepth); + this->~GetCheckpointMetaDataForRangeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont3Catch1when1(Void && _,int loopDepth) + int a_body1cont1(int loopDepth) { - loopDepth = a_body1loopBody1cont3Catch1cont3(std::move(_), loopDepth); + #line 9204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> res; + #line 9205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(index = 0;index < futures.size();++index) { + #line 9206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "GetCheckpointShardEnd") .detail("Range", locations[index].range) .detail("Checkpoint", futures[index].get().toString()); + #line 9209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + res.emplace_back(locations[index].range, futures[index].get()); + #line 47347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(res); this->~GetCheckpointMetaDataForRangeActorState(); static_cast(this)->destroy(); return 0; } + #line 47351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(res); + this->~GetCheckpointMetaDataForRangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - void a_exitChoose3() + int a_body1loopHead1(int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< StorageFeedVersionUpdaterActor, 2, Void >::remove(); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 2, Void >*,Void const& value) + int a_body1loopBody1(int loopDepth) { - fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 2); - a_exitChoose3(); + #line 9152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + locations.clear(); + #line 9153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "GetCheckpointMetaDataForRangeBegin") .detail("Range", range.toString()) .detail("Version", version) .detail("Format", static_cast(format)); + #line 9157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + futures.clear(); + #line 47374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" try { - a_body1loopBody1cont3Catch1when1(value, 0); + #line 9160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = store(locations, getKeyRangeLocations(cx, TenantInfo(), range, CLIENT_KNOBS->TOO_MANY, Reverse::False, &StorageServerInterface::checkpoint, span.context, Optional(), UseProvisionalProxies::False, latestVersion)); + #line 9160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 47380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 47385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1Catch1(error, 0); + loopDepth = a_body1loopBody1Catch1(error, loopDepth); } catch (...) { - a_body1Catch1(unknown_error(), 0); + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 2); + return loopDepth; } - void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 2, Void >*,Void && value) + int a_body1break1(int loopDepth) { - fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 2); - a_exitChoose3(); try { - a_body1loopBody1cont3Catch1when1(std::move(value), 0); + return a_body1cont1(loopDepth); } catch (Error& error) { - a_body1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 2); + return loopDepth; } - void a_callback_error(ActorCallback< StorageFeedVersionUpdaterActor, 2, Void >*,Error err) + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { - fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 2); - a_exitChoose3(); try { - a_body1Catch1(err, 0); + #line 9193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevWarn, "GetCheckpointError").errorUnsuppressed(e).detail("Range", range); + #line 9194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || e.code() == error_code_connection_failed || e.code() == error_code_broken_promise) + #line 47422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache({}, range); + #line 9197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY); + #line 9197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 47430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 9197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 47435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 9199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 47442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } } catch (Error& error) { - a_body1Catch1(error, 0); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - a_body1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } - fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 2); + return loopDepth; } - int a_body1loopBody1cont11(Void const& _,int loopDepth) + int a_body1loopBody1cont2(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 9172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(index = 0;index < locations.size();++index) { + #line 9173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + futures.push_back(getCheckpointMetaDataInternal( locations[index].range, version, format, actionId, locations[index].locations, timeout)); + #line 9175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "GetCheckpointShardBegin") .detail("Range", locations[index].range) .detail("Version", version) .detail("StorageServers", locations[index].locations->description()); + #line 47461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = cx->connectionFileChanged(); + #line 9181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 47467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + #line 9185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = waitForAll(futures); + #line 47471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when2(__when_expr_2.get(), loopDepth); }; + #line 9188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = delay(timeout); + #line 47475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont2when3(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 47484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont11(Void && _,int loopDepth) + int a_body1loopBody1cont2(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 9172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(index = 0;index < locations.size();++index) { + #line 9173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + futures.push_back(getCheckpointMetaDataInternal( locations[index].range, version, format, actionId, locations[index].locations, timeout)); + #line 9175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "GetCheckpointShardBegin") .detail("Range", locations[index].range) .detail("Version", version) .detail("StorageServers", locations[index].locations->description()); + #line 47497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = cx->connectionFileChanged(); + #line 9181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 47503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + #line 9185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = waitForAll(futures); + #line 47507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when2(__when_expr_2.get(), loopDepth); }; + #line 9188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = delay(timeout); + #line 47511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont2when3(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 47520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1when2(Void const& _,int loopDepth) + int a_body1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont11(_, loopDepth); + loopDepth = a_body1loopBody1cont2(_, loopDepth); return loopDepth; } - int a_body1loopBody1when2(Void && _,int loopDepth) + int a_body1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont11(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< StorageFeedVersionUpdaterActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetCheckpointMetaDataForRangeActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetCheckpointMetaDataForRangeActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1when2(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetCheckpointMetaDataForRangeActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1when2(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< StorageFeedVersionUpdaterActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< GetCheckpointMetaDataForRangeActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 3); - - } - #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StorageServerInterface interf; - #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ChangeFeedStorageData* self; - #line 8503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Promise destroyed; - #line 43996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -}; -// This generated class is to be used only via storageFeedVersionUpdater() - #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class StorageFeedVersionUpdaterActor final : public Actor, public ActorCallback< StorageFeedVersionUpdaterActor, 0, Void >, public ActorCallback< StorageFeedVersionUpdaterActor, 1, ChangeFeedVersionUpdateReply >, public ActorCallback< StorageFeedVersionUpdaterActor, 2, Void >, public ActorCallback< StorageFeedVersionUpdaterActor, 3, Void >, public FastAllocated, public StorageFeedVersionUpdaterActorState { - #line 44001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< StorageFeedVersionUpdaterActor, 0, Void >; -friend struct ActorCallback< StorageFeedVersionUpdaterActor, 1, ChangeFeedVersionUpdateReply >; -friend struct ActorCallback< StorageFeedVersionUpdaterActor, 2, Void >; -friend struct ActorCallback< StorageFeedVersionUpdaterActor, 3, Void >; - #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StorageFeedVersionUpdaterActor(StorageServerInterface const& interf,ChangeFeedStorageData* const& self) - #line 44015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - StorageFeedVersionUpdaterActorState(interf, self) - { - fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("storageFeedVersionUpdater"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< StorageFeedVersionUpdaterActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< StorageFeedVersionUpdaterActor, 1, ChangeFeedVersionUpdateReply >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< StorageFeedVersionUpdaterActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< StorageFeedVersionUpdaterActor, 3, Void >*)0, actor_cancelled()); break; + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 0); } -}; -} - #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future storageFeedVersionUpdater( StorageServerInterface const& interf, ChangeFeedStorageData* const& self ) { - #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new StorageFeedVersionUpdaterActor(interf, self)); - #line 44046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -} - -#line 8537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - -Reference DatabaseContext::getStorageData(StorageServerInterface interf) { - // use token from interface since that changes on SS restart - UID token = interf.waitFailure.getEndpoint().token; - auto it = changeFeedUpdaters.find(token); - if (it == changeFeedUpdaters.end()) { - Reference newStorageUpdater = makeReference(); - newStorageUpdater->id = interf.id(); - newStorageUpdater->interfToken = token; - newStorageUpdater->updater = storageFeedVersionUpdater(interf, newStorageUpdater.getPtr()); - changeFeedUpdaters[token] = newStorageUpdater; - return newStorageUpdater; - } - return it->second; -} - -Version ChangeFeedData::getVersion() { - return lastReturnedVersion.get(); -} - -// This function is essentially bubbling the information about what has been processed from the server through the -// change feed client. First it makes sure the server has returned all mutations up through the target version, the -// native api has consumed and processed, them, and then the fdb client has consumed all of the mutations. - #line 44073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via changeFeedWaitLatest() - #line 8560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class ChangeFeedWaitLatestActorState { - #line 44080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - #line 8560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ChangeFeedWaitLatestActorState(Reference const& self,Version const& version) - #line 8560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : self(self), - #line 8560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version(version) - #line 44089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - fdb_probe_actor_create("changeFeedWaitLatest", reinterpret_cast(this)); - - } - ~ChangeFeedWaitLatestActorState() + int a_body1loopBody1cont3(int loopDepth) { - fdb_probe_actor_destroy("changeFeedWaitLatest", reinterpret_cast(this)); + loopDepth = a_body1loopBody1cont5(loopDepth); + return loopDepth; } - int a_body1(int loopDepth=0) + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) { - try { - #line 8562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector> allAtLeast; - #line 8563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : self->storageData ) { - #line 8564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (it->version.get() < version) - #line 44108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (version > it->desired.get()) - #line 44112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - it->desired.set(version); - #line 44116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - allAtLeast.push_back(it->version.whenAtLeast(version)); - #line 44120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - #line 8572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = waitForAll(allAtLeast); - #line 8572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } + #line 9183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache({}, range); + #line 47598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) + int a_body1loopBody1cont2when1(Void && _,int loopDepth) { - this->~ChangeFeedWaitLatestActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; + #line 9183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache({}, range); + #line 47607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } - int a_body1cont1(Void const& _,int loopDepth) + int a_body1loopBody1cont2when2(Void const& _,int loopDepth) { - #line 8575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector> onEmpty; - #line 8576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : self->streams ) { - #line 8577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!it.isEmpty()) - #line 44159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - onEmpty.push_back(it.onEmpty()); - #line 44163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - #line 8582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (onEmpty.size()) - #line 44168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = waitForAll(onEmpty); - #line 8583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont5(loopDepth); - } + return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1loopBody1cont2when2(Void && _,int loopDepth) { - #line 8575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector> onEmpty; - #line 8576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : self->streams ) { - #line 8577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!it.isEmpty()) - #line 44197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - onEmpty.push_back(it.onEmpty()); - #line 44201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - #line 8582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (onEmpty.size()) - #line 44206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = waitForAll(onEmpty); - #line 8583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont5(loopDepth); - } + return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont2when3(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + #line 9189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevWarn, "GetCheckpointTimeout").detail("Range", range).detail("Version", version); + #line 47628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1loopBody1cont2when3(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + #line 9189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevWarn, "GetCheckpointTimeout").detail("Range", range).detail("Version", version); + #line 47637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeFeedWaitLatestActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetCheckpointMetaDataForRangeActor, 1, Void >::remove(); + static_cast(this)->ActorCallback< GetCheckpointMetaDataForRangeActor, 2, Void >::remove(); + static_cast(this)->ActorCallback< GetCheckpointMetaDataForRangeActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetCheckpointMetaDataForRangeActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1when1(value, 0); + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetCheckpointMetaDataForRangeActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< ChangeFeedWaitLatestActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< GetCheckpointMetaDataForRangeActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 1); } - int a_body1cont5(int loopDepth) + void a_callback_fire(ActorCallback< GetCheckpointMetaDataForRangeActor, 2, Void >*,Void const& value) { - #line 8586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (self->mutations.isEmpty()) - #line 44294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = delay(0); - #line 8587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont5when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 8587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1loopBody1cont2when2(value, 0); } - else - { - loopDepth = a_body1cont9(loopDepth); + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 2); - return loopDepth; - } - int a_body1cont8(Void const& _,int loopDepth) - { - loopDepth = a_body1cont5(loopDepth); - - return loopDepth; - } - int a_body1cont8(Void && _,int loopDepth) - { - loopDepth = a_body1cont5(loopDepth); - - return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + void a_callback_fire(ActorCallback< GetCheckpointMetaDataForRangeActor, 2, Void >*,Void && value) { - loopDepth = a_body1cont8(_, loopDepth); + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1loopBody1cont2when2(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 2); - return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + void a_callback_error(ActorCallback< GetCheckpointMetaDataForRangeActor, 2, Void >*,Error err) { - loopDepth = a_body1cont8(std::move(_), loopDepth); + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 2); - return loopDepth; } - void a_exitChoose2() + void a_callback_fire(ActorCallback< GetCheckpointMetaDataForRangeActor, 3, Void >*,Void const& value) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeFeedWaitLatestActor, 1, Void >::remove(); + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 3); + a_exitChoose2(); + try { + a_body1loopBody1cont2when3(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetCheckpointMetaDataForRangeActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 1); + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 3); a_exitChoose2(); try { - a_body1cont1when1(value, 0); + a_body1loopBody1cont2when3(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 1, Void >*,Void && value) + void a_callback_error(ActorCallback< GetCheckpointMetaDataForRangeActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 1); + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 3); a_exitChoose2(); try { - a_body1cont1when1(std::move(value), 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< ChangeFeedWaitLatestActor, 1, Void >*,Error err) + int a_body1loopBody1cont5(int loopDepth) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 1); - a_exitChoose2(); try { - a_body1Catch1(err, 0); + loopDepth = a_body1loopBody1cont1(loopDepth); } catch (Error& error) { - a_body1Catch1(error, 0); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - a_body1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 1); + return loopDepth; } - int a_body1cont9(int loopDepth) + int a_body1loopBody1Catch1cont1(int loopDepth) { - #line 8592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 44394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont9loopHead1(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont10(Void const& _,int loopDepth) + int a_body1loopBody1Catch1cont2(Void const& _,int loopDepth) { - loopDepth = a_body1cont9(loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); return loopDepth; } - int a_body1cont10(Void && _,int loopDepth) + int a_body1loopBody1Catch1cont2(Void && _,int loopDepth) { - loopDepth = a_body1cont9(loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); return loopDepth; } - int a_body1cont5when1(Void const& _,int loopDepth) + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont10(_, loopDepth); + loopDepth = a_body1loopBody1Catch1cont2(_, loopDepth); return loopDepth; } - int a_body1cont5when1(Void && _,int loopDepth) + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont10(std::move(_), loopDepth); + loopDepth = a_body1loopBody1Catch1cont2(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeFeedWaitLatestActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetCheckpointMetaDataForRangeActor, 4, Void >::remove(); } - void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetCheckpointMetaDataForRangeActor, 4, Void >*,Void const& value) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 2); + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 4); a_exitChoose3(); try { - a_body1cont5when1(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetCheckpointMetaDataForRangeActor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 2); + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 4); a_exitChoose3(); try { - a_body1cont5when1(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< ChangeFeedWaitLatestActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< GetCheckpointMetaDataForRangeActor, 4, Void >*,Error err) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 2); + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), 4); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -44468,72 +47873,140 @@ class ChangeFeedWaitLatestActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), 4); } - int a_body1cont11(int loopDepth) + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database cx; + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CheckpointFormat format; + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional actionId; + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + double timeout; + #line 9146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Span span; + #line 9147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int index; + #line 9148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> futures; + #line 9149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector locations; + #line 47899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via getCheckpointMetaDataForRange() + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetCheckpointMetaDataForRangeActor final : public Actor>>, public ActorCallback< GetCheckpointMetaDataForRangeActor, 0, Void >, public ActorCallback< GetCheckpointMetaDataForRangeActor, 1, Void >, public ActorCallback< GetCheckpointMetaDataForRangeActor, 2, Void >, public ActorCallback< GetCheckpointMetaDataForRangeActor, 3, Void >, public ActorCallback< GetCheckpointMetaDataForRangeActor, 4, Void >, public FastAllocated, public GetCheckpointMetaDataForRangeActorState { + #line 47904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetCheckpointMetaDataForRangeActor, 0, Void >; +friend struct ActorCallback< GetCheckpointMetaDataForRangeActor, 1, Void >; +friend struct ActorCallback< GetCheckpointMetaDataForRangeActor, 2, Void >; +friend struct ActorCallback< GetCheckpointMetaDataForRangeActor, 3, Void >; +friend struct ActorCallback< GetCheckpointMetaDataForRangeActor, 4, Void >; + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetCheckpointMetaDataForRangeActor(Database const& cx,KeyRange const& range,Version const& version,CheckpointFormat const& format,Optional const& actionId,double const& timeout) + #line 47919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>>(), + GetCheckpointMetaDataForRangeActorState(cx, range, version, format, actionId, timeout) + { + fdb_probe_actor_enter("getCheckpointMetaDataForRange", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getCheckpointMetaDataForRange"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getCheckpointMetaDataForRange", reinterpret_cast(this), -1); + + } + void cancel() override { - #line 8598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (self->maxSeenVersion >= version) - #line 44478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_4 = self->lastReturnedVersion.whenAtLeast(version); - #line 8601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 44484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont11when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 8601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 8604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 44496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont11loopHead1(loopDepth); + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetCheckpointMetaDataForRangeActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetCheckpointMetaDataForRangeActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetCheckpointMetaDataForRangeActor, 4, Void >*)0, actor_cancelled()); break; } - return loopDepth; } - int a_body1cont9loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont9loopBody1(loopDepth); +}; +} + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] static Future>> getCheckpointMetaDataForRange( Database const& cx, KeyRange const& range, Version const& version, CheckpointFormat const& format, Optional const& actionId, double const& timeout ) { + #line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new GetCheckpointMetaDataForRangeActor(cx, range, version, format, actionId, timeout)); + #line 47949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 47954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via getCheckpointMetaData() + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetCheckpointMetaDataActorState { + #line 47961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetCheckpointMetaDataActorState(Database const& cx,std::vector const& ranges,Version const& version,CheckpointFormat const& format,Optional const& actionId,double const& timeout) + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ranges(ranges), + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version), + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + format(format), + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + actionId(actionId), + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + timeout(timeout), + #line 9220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + futures() + #line 47980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("getCheckpointMetaData", reinterpret_cast(this)); - return loopDepth; } - int a_body1cont9loopBody1(int loopDepth) + ~GetCheckpointMetaDataActorState() { - #line 8592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!(self->lastReturnedVersion.get() < self->maxSeenVersion && self->lastReturnedVersion.get() < version)) - #line 44513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - return a_body1cont9break1(loopDepth==0?0:loopDepth-1); // break - } - #line 8593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version target = std::min(self->maxSeenVersion, version); - #line 8594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = self->lastReturnedVersion.whenAtLeast(target); - #line 8594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 44523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont9loopBody1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 8594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_destroy("getCheckpointMetaData", reinterpret_cast(this)); - return loopDepth; } - int a_body1cont9break1(int loopDepth) + int a_body1(int loopDepth=0) { try { - return a_body1cont11(loopDepth); + #line 9223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( const auto& range : ranges ) { + #line 9224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + futures.push_back(getCheckpointMetaDataForRange(cx, range, version, format, actionId, timeout)); + #line 47997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture>>> __when_expr_0 = getAll(futures); + #line 9227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 48003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast>> >*>(static_cast(this))); + #line 48008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -44543,70 +48016,110 @@ class ChangeFeedWaitLatestActorState { return loopDepth; } - int a_body1cont9loopBody1cont1(Void const& _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - if (loopDepth == 0) return a_body1cont9loopHead1(0); + this->~GetCheckpointMetaDataActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1cont9loopBody1cont1(Void && _,int loopDepth) + int a_body1cont1(std::vector>> const& results,int loopDepth) { - if (loopDepth == 0) return a_body1cont9loopHead1(0); + #line 9229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> res; + #line 9231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( const auto& r : results ) { + #line 9232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!r.empty()); + #line 9233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + res.insert(res.end(), r.begin(), r.end()); + #line 48037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(res); this->~GetCheckpointMetaDataActorState(); static_cast(this)->destroy(); return 0; } + #line 48041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(res); + this->~GetCheckpointMetaDataActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont9loopBody1when1(Void const& _,int loopDepth) + int a_body1cont1(std::vector>> && results,int loopDepth) { - loopDepth = a_body1cont9loopBody1cont1(_, loopDepth); + #line 9229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> res; + #line 9231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( const auto& r : results ) { + #line 9232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!r.empty()); + #line 9233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + res.insert(res.end(), r.begin(), r.end()); + #line 48059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(res); this->~GetCheckpointMetaDataActorState(); static_cast(this)->destroy(); return 0; } + #line 48063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(res); + this->~GetCheckpointMetaDataActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont9loopBody1when1(Void && _,int loopDepth) + int a_body1when1(std::vector>> const& results,int loopDepth) { - loopDepth = a_body1cont9loopBody1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont1(results, loopDepth); return loopDepth; } - void a_exitChoose4() + int a_body1when1(std::vector>> && results,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeFeedWaitLatestActor, 3, Void >::remove(); + loopDepth = a_body1cont1(std::move(results), loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 3, Void >*,Void const& value) + void a_exitChoose1() { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 3); - a_exitChoose4(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetCheckpointMetaDataActor, 0, std::vector>> >::remove(); + + } + void a_callback_fire(ActorCallback< GetCheckpointMetaDataActor, 0, std::vector>> >*,std::vector>> const& value) + { + fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont9loopBody1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetCheckpointMetaDataActor, 0, std::vector>> >*,std::vector>> && value) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont9loopBody1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< ChangeFeedWaitLatestActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< GetCheckpointMetaDataActor, 0, std::vector>> >*,Error err) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1Catch1(err, 0); } @@ -44615,627 +48128,805 @@ class ChangeFeedWaitLatestActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), 0); } - int a_body1cont11cont1(int loopDepth) + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database cx; + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector ranges; + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CheckpointFormat format; + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional actionId; + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + double timeout; + #line 9220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector>>> futures; + #line 48148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via getCheckpointMetaData() + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetCheckpointMetaDataActor final : public Actor>>, public ActorCallback< GetCheckpointMetaDataActor, 0, std::vector>> >, public FastAllocated, public GetCheckpointMetaDataActorState { + #line 48153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetCheckpointMetaDataActor, 0, std::vector>> >; + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetCheckpointMetaDataActor(Database const& cx,std::vector const& ranges,Version const& version,CheckpointFormat const& format,Optional const& actionId,double const& timeout) + #line 48164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>>(), + GetCheckpointMetaDataActorState(cx, ranges, version, format, actionId, timeout) { - #line 8610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeFeedWaitLatestActorState(); static_cast(this)->destroy(); return 0; } - #line 44625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~ChangeFeedWaitLatestActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + fdb_probe_actor_enter("getCheckpointMetaData", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getCheckpointMetaData"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getCheckpointMetaData", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1cont11cont2(Void const& _,int loopDepth) + void cancel() override { - loopDepth = a_body1cont11cont1(loopDepth); + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetCheckpointMetaDataActor, 0, std::vector>> >*)0, actor_cancelled()); break; + } - return loopDepth; } - int a_body1cont11cont2(Void && _,int loopDepth) - { - loopDepth = a_body1cont11cont1(loopDepth); +}; +} + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future>> getCheckpointMetaData( Database const& cx, std::vector const& ranges, Version const& version, CheckpointFormat const& format, Optional const& actionId, double const& timeout ) { + #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new GetCheckpointMetaDataActor(cx, ranges, version, format, actionId, timeout)); + #line 48192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} - return loopDepth; - } - int a_body1cont11when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont11cont2(_, loopDepth); +#line 9238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return loopDepth; - } - int a_body1cont11when1(Void && _,int loopDepth) + #line 48197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via checkSafeExclusions() + #line 9239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class CheckSafeExclusionsActorState { + #line 48204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CheckSafeExclusionsActorState(Database const& cx,std::vector const& exclusions) + #line 9239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 9239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + exclusions(exclusions) + #line 48213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - loopDepth = a_body1cont11cont2(std::move(_), loopDepth); + fdb_probe_actor_create("checkSafeExclusions", reinterpret_cast(this)); - return loopDepth; } - void a_exitChoose5() + ~CheckSafeExclusionsActorState() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeFeedWaitLatestActor, 4, Void >::remove(); + fdb_probe_actor_destroy("checkSafeExclusions", reinterpret_cast(this)); } - void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 4, Void >*,Void const& value) + int a_body1(int loopDepth=0) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 4); - a_exitChoose5(); try { - a_body1cont11when1(value, 0); + #line 9240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("ExclusionSafetyCheckBegin") .detail("NumExclusion", exclusions.size()) .detail("Exclusions", describe(exclusions)); + #line 9243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ddCheck = bool(); + #line 48230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + try { + #line 9245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 48234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } } catch (Error& error) { - a_body1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 4); + return loopDepth; } - void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 4, Void >*,Void && value) + int a_body1Catch1(Error error,int loopDepth=0) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont11when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); + this->~CheckSafeExclusionsActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 9267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("ExclusionSafetyCheckCoordinators").log(); + #line 9268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + coordinatorList = ClientCoordinators(cx->getConnectionRecord()); + #line 9269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + leaderServers = std::vector>>(); + #line 9270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + leaderServers.reserve(coordinatorList.clientLeaderServers.size()); + #line 9271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < coordinatorList.clientLeaderServers.size();i++) { + #line 9272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (coordinatorList.clientLeaderServers[i].hostname.present()) + #line 48273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + leaderServers.push_back(retryGetReplyFromHostname(GetLeaderRequest(coordinatorList.clusterKey, UID()), coordinatorList.clientLeaderServers[i].hostname.get(), WLTOKEN_CLIENTLEADERREG_GETLEADER, TaskPriority::CoordinationReply)); + #line 48277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + #line 9278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + leaderServers.push_back(retryBrokenPromise(coordinatorList.clientLeaderServers[i].getLeader, GetLeaderRequest(coordinatorList.clusterKey, UID()), TaskPriority::CoordinationReply)); + #line 48283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 4); + #line 9285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = smartQuorum(leaderServers, leaderServers.size() / 2 + 1, 1.0); + #line 9284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 48290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; + #line 9286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = delay(3.0); + #line 48294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1when2(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 48301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + return loopDepth; } - void a_callback_error(ActorCallback< ChangeFeedWaitLatestActor, 4, Void >*,Error err) + int a_body1Catch2(const Error& e,int loopDepth=0) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 4); - a_exitChoose5(); try { - a_body1Catch1(err, 0); + #line 9259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() != error_code_actor_cancelled) + #line 48311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("ExclusionSafetyCheckError") .error(e) .detail("NumExclusion", exclusions.size()) .detail("Exclusions", describe(exclusions)); + #line 48315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 48319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } catch (Error& error) { - a_body1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 4); + return loopDepth; } - int a_body1cont11cont3(int loopDepth) + int a_body1cont2(int loopDepth) { - loopDepth = a_body1cont11cont1(loopDepth); + loopDepth = a_body1cont3(loopDepth); return loopDepth; } - int a_body1cont11loopHead1(int loopDepth) + int a_body1loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont11loopBody1(loopDepth); + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); return loopDepth; } - int a_body1cont11loopBody1(int loopDepth) + int a_body1loopBody1(int loopDepth) { - #line 8604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!(!self->mutations.isEmpty())) - #line 44725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - return a_body1cont11break1(loopDepth==0?0:loopDepth-1); // break - } - #line 8605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_5 = self->mutations.onEmpty(); - #line 8605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 44733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont11loopBody1when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 8605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 9247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = cx->onProxiesChanged(); + #line 9246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 48348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + #line 9248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = basicLoadBalance(cx->getCommitProxies(UseProvisionalProxies::False), &CommitProxyInterface::exclusionSafetyCheckReq, ExclusionSafetyCheckRequest(exclusions), cx->taskID); + #line 48352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 48359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont11break1(int loopDepth) + int a_body1break1(int loopDepth) { try { - return a_body1cont11cont3(loopDepth); + return a_body1cont2(loopDepth); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + loopDepth = a_body1Catch2(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1Catch2(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont11loopBody1cont1(Void const& _,int loopDepth) + int a_body1loopBody1cont1(int loopDepth) { - #line 8606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_6 = delay(0); - #line 8606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 44762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1cont11loopBody1cont1when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 8606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1cont11loopBody1cont1(Void && _,int loopDepth) + int a_body1loopBody1when1(Void const& _,int loopDepth) { - #line 8606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_6 = delay(0); - #line 8606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 44778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1cont11loopBody1cont1when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 8606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 44783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont11loopBody1when1(Void const& _,int loopDepth) + int a_body1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont11loopBody1cont1(_, loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont11loopBody1when1(Void && _,int loopDepth) + int a_body1loopBody1when2(ExclusionSafetyCheckReply const& _ddCheck,int loopDepth) { - loopDepth = a_body1cont11loopBody1cont1(std::move(_), loopDepth); + #line 9253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ddCheck = _ddCheck.safe; + #line 48399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - void a_exitChoose6() + int a_body1loopBody1when2(ExclusionSafetyCheckReply && _ddCheck,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeFeedWaitLatestActor, 5, Void >::remove(); + #line 9253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ddCheck = _ddCheck.safe; + #line 48408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + return loopDepth; } - void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 5, Void >*,Void const& value) + void a_exitChoose1() { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 5); - a_exitChoose6(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckSafeExclusionsActor, 0, Void >::remove(); + static_cast(this)->ActorCallback< CheckSafeExclusionsActor, 1, ExclusionSafetyCheckReply >::remove(); + + } + void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont11loopBody1when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 5); + fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont11loopBody1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 5); + fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< ChangeFeedWaitLatestActor, 5, Void >*,Error err) + void a_callback_error(ActorCallback< CheckSafeExclusionsActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1Catch2(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 5); - - } - int a_body1cont11loopBody1cont3(Void const& _,int loopDepth) - { - if (loopDepth == 0) return a_body1cont11loopHead1(0); - - return loopDepth; - } - int a_body1cont11loopBody1cont3(Void && _,int loopDepth) - { - if (loopDepth == 0) return a_body1cont11loopHead1(0); - - return loopDepth; - } - int a_body1cont11loopBody1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont11loopBody1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1cont11loopBody1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont11loopBody1cont3(std::move(_), loopDepth); + fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 0); - return loopDepth; } - void a_exitChoose7() + void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 1, ExclusionSafetyCheckReply >*,ExclusionSafetyCheckReply const& value) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeFeedWaitLatestActor, 6, Void >::remove(); + fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1loopBody1when2(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 6, Void >*,Void const& value) + void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 1, ExclusionSafetyCheckReply >*,ExclusionSafetyCheckReply && value) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 1); + a_exitChoose1(); try { - a_body1cont11loopBody1cont1when1(value, 0); + a_body1loopBody1when2(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 6); + fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 6, Void >*,Void && value) + void a_callback_error(ActorCallback< CheckSafeExclusionsActor, 1, ExclusionSafetyCheckReply >*,Error err) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 1); + a_exitChoose1(); try { - a_body1cont11loopBody1cont1when1(std::move(value), 0); + a_body1Catch2(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 6); + fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< ChangeFeedWaitLatestActor, 6, Void >*,Error err) + int a_body1cont3(int loopDepth) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 6); - a_exitChoose7(); try { - a_body1Catch1(err, 0); + loopDepth = a_body1cont1(loopDepth); } catch (Error& error) { - a_body1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 6); + return loopDepth; } - #line 8560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference self; - #line 8560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 44930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -}; -// This generated class is to be used only via changeFeedWaitLatest() - #line 8560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class ChangeFeedWaitLatestActor final : public Actor, public ActorCallback< ChangeFeedWaitLatestActor, 0, Void >, public ActorCallback< ChangeFeedWaitLatestActor, 1, Void >, public ActorCallback< ChangeFeedWaitLatestActor, 2, Void >, public ActorCallback< ChangeFeedWaitLatestActor, 3, Void >, public ActorCallback< ChangeFeedWaitLatestActor, 4, Void >, public ActorCallback< ChangeFeedWaitLatestActor, 5, Void >, public ActorCallback< ChangeFeedWaitLatestActor, 6, Void >, public FastAllocated, public ChangeFeedWaitLatestActorState { - #line 44935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< ChangeFeedWaitLatestActor, 0, Void >; -friend struct ActorCallback< ChangeFeedWaitLatestActor, 1, Void >; -friend struct ActorCallback< ChangeFeedWaitLatestActor, 2, Void >; -friend struct ActorCallback< ChangeFeedWaitLatestActor, 3, Void >; -friend struct ActorCallback< ChangeFeedWaitLatestActor, 4, Void >; -friend struct ActorCallback< ChangeFeedWaitLatestActor, 5, Void >; -friend struct ActorCallback< ChangeFeedWaitLatestActor, 6, Void >; - #line 8560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ChangeFeedWaitLatestActor(Reference const& self,Version const& version) - #line 44952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - ChangeFeedWaitLatestActorState(self, version) + int a_body1cont4(int loopDepth) { - fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("changeFeedWaitLatest"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), -1); + #line 9291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int attemptCoordinatorExclude = 0; + #line 9292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int coordinatorsUnavailable = 0; + #line 9293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < leaderServers.size();i++) { + #line 9294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + NetworkAddress leaderAddress = coordinatorList.clientLeaderServers[i].getLeader.getEndpoint().getPrimaryAddress(); + #line 9296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (leaderServers[i].isReady()) + #line 48535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if ((std::count( exclusions.begin(), exclusions.end(), AddressExclusion(leaderAddress.ip, leaderAddress.port)) || std::count(exclusions.begin(), exclusions.end(), AddressExclusion(leaderAddress.ip)))) + #line 48539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + attemptCoordinatorExclude++; + #line 48543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + else + { + #line 9303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + coordinatorsUnavailable++; + #line 48550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 9306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int faultTolerance = (leaderServers.size() - 1) / 2 - coordinatorsUnavailable; + #line 9307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool coordinatorCheck = (attemptCoordinatorExclude <= faultTolerance); + #line 9308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("ExclusionSafetyCheckFinish") .detail("CoordinatorListSize", leaderServers.size()) .detail("NumExclusions", exclusions.size()) .detail("FaultTolerance", faultTolerance) .detail("AttemptCoordinatorExclude", attemptCoordinatorExclude) .detail("CoordinatorCheck", coordinatorCheck) .detail("DataDistributorCheck", ddCheck); + #line 9316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)((ddCheck && coordinatorCheck)); this->~CheckSafeExclusionsActorState(); static_cast(this)->destroy(); return 0; } + #line 48561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool((ddCheck && coordinatorCheck)); + this->~CheckSafeExclusionsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + return loopDepth; } - void cancel() override + int a_body1cont1when1(Void const& _,int loopDepth) { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ChangeFeedWaitLatestActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< ChangeFeedWaitLatestActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< ChangeFeedWaitLatestActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< ChangeFeedWaitLatestActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< ChangeFeedWaitLatestActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< ChangeFeedWaitLatestActor, 5, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< ChangeFeedWaitLatestActor, 6, Void >*)0, actor_cancelled()); break; - } + loopDepth = a_body1cont4(loopDepth); + return loopDepth; } -}; -} - #line 8560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future changeFeedWaitLatest( Reference const& self, Version const& version ) { - #line 8560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new ChangeFeedWaitLatestActor(self, version)); - #line 44986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -} + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(loopDepth); -#line 8612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return loopDepth; + } + int a_body1cont1when2(Void const& _,int loopDepth) + { + #line 9287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("ExclusionSafetyCheckNoCoordinatorQuorum").log(); + #line 9288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckSafeExclusionsActorState(); static_cast(this)->destroy(); return 0; } + #line 48587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~CheckSafeExclusionsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; - #line 44991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via changeFeedWhenAtLatest() - #line 8613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class ChangeFeedWhenAtLatestActorState { - #line 44998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - #line 8613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ChangeFeedWhenAtLatestActorState(Reference const& self,Version const& version) - #line 8613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : self(self), - #line 8613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version(version) - #line 45007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return loopDepth; + } + int a_body1cont1when2(Void && _,int loopDepth) { - fdb_probe_actor_create("changeFeedWhenAtLatest", reinterpret_cast(this)); + #line 9287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("ExclusionSafetyCheckNoCoordinatorQuorum").log(); + #line 9288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckSafeExclusionsActorState(); static_cast(this)->destroy(); return 0; } + #line 48601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~CheckSafeExclusionsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + return loopDepth; } - ~ChangeFeedWhenAtLatestActorState() + void a_exitChoose2() { - fdb_probe_actor_destroy("changeFeedWhenAtLatest", reinterpret_cast(this)); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckSafeExclusionsActor, 2, Void >::remove(); + static_cast(this)->ActorCallback< CheckSafeExclusionsActor, 3, Void >::remove(); } - int a_body1(int loopDepth=0) + void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 2, Void >*,Void const& value) { + fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 2); + a_exitChoose2(); try { - #line 8614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (version >= self->endVersion) - #line 45022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - this->~ChangeFeedWhenAtLatestActorState(); - #line 45026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - static_cast(this)->sendAndDelPromiseRef(Never()); - return 0; - } - #line 8617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (version <= self->getVersion()) - #line 45032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeFeedWhenAtLatestActorState(); static_cast(this)->destroy(); return 0; } - #line 45036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~ChangeFeedWhenAtLatestActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 8620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - lastReturned = self->lastReturnedVersion.whenAtLeast(version); - #line 8621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 45046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); + a_body1cont1when1(value, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 2); - return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) + void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 2, Void >*,Void && value) { - this->~ChangeFeedWhenAtLatestActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; + fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 2); - return loopDepth; } - int a_body1cont1(int loopDepth) + void a_callback_error(ActorCallback< CheckSafeExclusionsActor, 2, Void >*,Error err) { - #line 8636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (self->lastReturnedVersion.get() < version) - #line 45069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - self->lastReturnedVersion.set(version); - #line 45073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); } - #line 8639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(self->getVersion() >= version); - #line 8640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeFeedWhenAtLatestActorState(); static_cast(this)->destroy(); return 0; } - #line 45079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~ChangeFeedWhenAtLatestActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 2); - return loopDepth; } - int a_body1loopHead1(int loopDepth) + void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 3, Void >*,Void const& value) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 3); + a_exitChoose2(); + try { + a_body1cont1when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1loopBody1(int loopDepth) + void a_callback_fire(ActorCallback< CheckSafeExclusionsActor, 3, Void >*,Void && value) { - #line 8623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future waitEmptyVersion = (self->notAtLatest.get() == 0) ? changeFeedWaitLatest(self, version) : Never(); - #line 8625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = waitEmptyVersion; - #line 8624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 45102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 8628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = lastReturned; - #line 45106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; - #line 8631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = self->refresh.getFuture(); - #line 45110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when3(__when_expr_2.get(), loopDepth); }; - #line 8632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = self->notAtLatest.onChange(); - #line 45114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when4(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 45125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 3); + a_exitChoose2(); + try { + a_body1cont1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1break1(int loopDepth) + void a_callback_error(ActorCallback< CheckSafeExclusionsActor, 3, Void >*,Error err) { + fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), 3); + a_exitChoose2(); try { - return a_body1cont1(loopDepth); + a_body1Catch1(err, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) + #line 9239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database cx; + #line 9239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector exclusions; + #line 9243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool ddCheck; + #line 9268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ClientCoordinators coordinatorList; + #line 9269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector>> leaderServers; + #line 48716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via checkSafeExclusions() + #line 9239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class CheckSafeExclusionsActor final : public Actor, public ActorCallback< CheckSafeExclusionsActor, 0, Void >, public ActorCallback< CheckSafeExclusionsActor, 1, ExclusionSafetyCheckReply >, public ActorCallback< CheckSafeExclusionsActor, 2, Void >, public ActorCallback< CheckSafeExclusionsActor, 3, Void >, public FastAllocated, public CheckSafeExclusionsActorState { + #line 48721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CheckSafeExclusionsActor, 0, Void >; +friend struct ActorCallback< CheckSafeExclusionsActor, 1, ExclusionSafetyCheckReply >; +friend struct ActorCallback< CheckSafeExclusionsActor, 2, Void >; +friend struct ActorCallback< CheckSafeExclusionsActor, 3, Void >; + #line 9239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CheckSafeExclusionsActor(Database const& cx,std::vector const& exclusions) + #line 48735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + CheckSafeExclusionsActorState(cx, exclusions) { - if (loopDepth == 0) return a_body1loopHead1(0); + fdb_probe_actor_enter("checkSafeExclusions", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("checkSafeExclusions"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("checkSafeExclusions", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1loopBody1when1(Void const& _,int loopDepth) + void cancel() override { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CheckSafeExclusionsActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CheckSafeExclusionsActor, 2, Void >*)0, actor_cancelled()); break; + } - return loopDepth; } - int a_body1loopBody1when1(Void && _,int loopDepth) +}; +} + #line 9239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future checkSafeExclusions( Database const& cx, std::vector const& exclusions ) { + #line 9239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new CheckSafeExclusionsActor(cx, exclusions)); + #line 48764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +// returns true if we can connect to the given worker interface + #line 48770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via verifyInterfaceActor() + #line 9320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class VerifyInterfaceActorActorState { + #line 48777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + VerifyInterfaceActorActorState(Reference const& connectLock,ClientWorkerInterface const& workerInterf) + #line 9320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : connectLock(connectLock), + #line 9320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + workerInterf(workerInterf) + #line 48786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + fdb_probe_actor_create("verifyInterfaceActor", reinterpret_cast(this)); - return loopDepth; } - int a_body1loopBody1when2(Void const& _,int loopDepth) + ~VerifyInterfaceActorActorState() { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + fdb_probe_actor_destroy("verifyInterfaceActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 9321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = connectLock->take(); + #line 9321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 48803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 48808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1loopBody1when2(Void && _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + this->~VerifyInterfaceActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1loopBody1when3(Void const& _,int loopDepth) + int a_body1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 9322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + releaser = FlowLock::Releaser(*connectLock); + #line 9323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + leaderInterf = ClientLeaderRegInterface(workerInterf.address()); + #line 9325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_1 = brokenPromiseToNever(leaderInterf.getLeader.getReply(GetLeaderRequest())); + #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 48837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + #line 9329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->CLI_CONNECT_TIMEOUT); + #line 48841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 9329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 48848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1when3(Void && _,int loopDepth) + int a_body1cont1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 9322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + releaser = FlowLock::Releaser(*connectLock); + #line 9323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + leaderInterf = ClientLeaderRegInterface(workerInterf.address()); + #line 9325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_1 = brokenPromiseToNever(leaderInterf.getLeader.getReply(GetLeaderRequest())); + #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 48863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + #line 9329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->CLI_CONNECT_TIMEOUT); + #line 48867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 9329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 48874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1when4(Void const& _,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1when4(Void && _,int loopDepth) + int a_body1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ChangeFeedWhenAtLatestActor, 0, Void >::remove(); - static_cast(this)->ActorCallback< ChangeFeedWhenAtLatestActor, 1, Void >::remove(); - static_cast(this)->ActorCallback< ChangeFeedWhenAtLatestActor, 2, Void >::remove(); - static_cast(this)->ActorCallback< ChangeFeedWhenAtLatestActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< VerifyInterfaceActorActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< VerifyInterfaceActorActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 0); + fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 0); + fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< VerifyInterfaceActorActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 0); + fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 0); + fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< ChangeFeedWhenAtLatestActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< VerifyInterfaceActorActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 0); + fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -45245,43 +48936,98 @@ class ChangeFeedWhenAtLatestActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 0); + fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 1, Void >*,Void const& value) + int a_body1cont1when1(Optional const& rep,int loopDepth) { - fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 1); - a_exitChoose1(); + #line 9327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~VerifyInterfaceActorActorState(); static_cast(this)->destroy(); return 0; } + #line 48946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~VerifyInterfaceActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Optional && rep,int loopDepth) + { + #line 9327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~VerifyInterfaceActorActorState(); static_cast(this)->destroy(); return 0; } + #line 48958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~VerifyInterfaceActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when2(Void const& _,int loopDepth) + { + #line 9331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~VerifyInterfaceActorActorState(); static_cast(this)->destroy(); return 0; } + #line 48970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~VerifyInterfaceActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when2(Void && _,int loopDepth) + { + #line 9331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~VerifyInterfaceActorActorState(); static_cast(this)->destroy(); return 0; } + #line 48982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~VerifyInterfaceActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< VerifyInterfaceActorActor, 1, Optional >::remove(); + static_cast(this)->ActorCallback< VerifyInterfaceActorActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< VerifyInterfaceActorActor, 1, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when2(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 1); + fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< VerifyInterfaceActorActor, 1, Optional >*,Optional && value) { - fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 1); - a_exitChoose1(); + fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1loopBody1when2(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 1); + fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< ChangeFeedWhenAtLatestActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< VerifyInterfaceActorActor, 1, Optional >*,Error err) { - fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 1); - a_exitChoose1(); + fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -45290,43 +49036,43 @@ class ChangeFeedWhenAtLatestActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 1); + fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< VerifyInterfaceActorActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 2); - a_exitChoose1(); + fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 2); + a_exitChoose2(); try { - a_body1loopBody1when3(value, 0); + a_body1cont1when2(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 2); + fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< VerifyInterfaceActorActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 2); - a_exitChoose1(); + fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 2); + a_exitChoose2(); try { - a_body1loopBody1when3(std::move(value), 0); + a_body1cont1when2(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 2); + fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< ChangeFeedWhenAtLatestActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< VerifyInterfaceActorActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 2); - a_exitChoose1(); + fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), 2); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -45335,42 +49081,9479 @@ class ChangeFeedWhenAtLatestActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 2); + fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 3); + #line 9320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference connectLock; + #line 9320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ClientWorkerInterface workerInterf; + #line 9322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + FlowLock::Releaser releaser; + #line 9323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ClientLeaderRegInterface leaderInterf; + #line 49095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via verifyInterfaceActor() + #line 9320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class VerifyInterfaceActorActor final : public Actor, public ActorCallback< VerifyInterfaceActorActor, 0, Void >, public ActorCallback< VerifyInterfaceActorActor, 1, Optional >, public ActorCallback< VerifyInterfaceActorActor, 2, Void >, public FastAllocated, public VerifyInterfaceActorActorState { + #line 49100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< VerifyInterfaceActorActor, 0, Void >; +friend struct ActorCallback< VerifyInterfaceActorActor, 1, Optional >; +friend struct ActorCallback< VerifyInterfaceActorActor, 2, Void >; + #line 9320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + VerifyInterfaceActorActor(Reference const& connectLock,ClientWorkerInterface const& workerInterf) + #line 49113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + VerifyInterfaceActorActorState(connectLock, workerInterf) + { + fdb_probe_actor_enter("verifyInterfaceActor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("verifyInterfaceActor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("verifyInterfaceActor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< VerifyInterfaceActorActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< VerifyInterfaceActorActor, 1, Optional >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 9320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future verifyInterfaceActor( Reference const& connectLock, ClientWorkerInterface const& workerInterf ) { + #line 9320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new VerifyInterfaceActorActor(connectLock, workerInterf)); + #line 49142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 49147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via rebootWorkerActor() + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class RebootWorkerActorActorState { + #line 49154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + RebootWorkerActorActorState(DatabaseContext* const& cx,ValueRef const& addr,bool const& check,int const& duration) + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + addr(addr), + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + check(check), + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + duration(duration) + #line 49167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("rebootWorkerActor", reinterpret_cast(this)); + + } + ~RebootWorkerActorActorState() + { + fdb_probe_actor_destroy("rebootWorkerActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 9338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (duration < 0) + #line 49182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + duration = 0; + #line 49186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!cx->getConnectionRecord()) + #line 49190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(0); this->~RebootWorkerActorActorState(); static_cast(this)->destroy(); return 0; } + #line 49194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< int64_t >::value()) int64_t(0); + this->~RebootWorkerActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 9343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = getWorkerInterfaces(cx->getConnectionRecord()); + #line 9343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 49204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 49209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~RebootWorkerActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(RangeResult const& kvs,int loopDepth) + { + #line 9344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!kvs.more); + #line 9346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + workerInterfaces = std::map(); + #line 9347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( const auto& it : kvs ) { + #line 9348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ClientWorkerInterface workerInterf = BinaryReader::fromStringRef(it.value, IncludeVersion()); + #line 9350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key primaryAddress = it.key.endsWith(":tls"_sr) ? it.key.removeSuffix(":tls"_sr) : it.key; + #line 9351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + workerInterfaces[primaryAddress] = workerInterf; + #line 9353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (workerInterf.reboot.getEndpoint().addresses.secondaryAddress.present()) + #line 49244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key secondAddress = StringRef(workerInterf.reboot.getEndpoint().addresses.secondaryAddress.get().toString()); + #line 9356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + secondAddress = secondAddress.endsWith(":tls"_sr) ? secondAddress.removeSuffix(":tls"_sr) : secondAddress; + #line 9357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + workerInterfaces[secondAddress] = workerInterf; + #line 49252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 9361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + addressesVec = std::vector(); + #line 9362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + boost::algorithm::split(addressesVec, addr.toString(), boost::is_any_of(",")); + #line 9364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference connectLock(new FlowLock(CLIENT_KNOBS->CLI_CONNECT_PARALLELISM)); + #line 9365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + verifyInterfs = std::vector>(); + #line 9366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( const auto& requestedAddress : addressesVec ) { + #line 9368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!workerInterfaces.count(Key(requestedAddress))) + #line 49267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(0); this->~RebootWorkerActorActorState(); static_cast(this)->destroy(); return 0; } + #line 49271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< int64_t >::value()) int64_t(0); + this->~RebootWorkerActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 9371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + verifyInterfs.push_back(verifyInterfaceActor(connectLock, workerInterfaces[Key(requestedAddress)])); + #line 49279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = waitForAll(verifyInterfs); + #line 9374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 49285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 49290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(RangeResult && kvs,int loopDepth) + { + #line 9344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!kvs.more); + #line 9346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + workerInterfaces = std::map(); + #line 9347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( const auto& it : kvs ) { + #line 9348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ClientWorkerInterface workerInterf = BinaryReader::fromStringRef(it.value, IncludeVersion()); + #line 9350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key primaryAddress = it.key.endsWith(":tls"_sr) ? it.key.removeSuffix(":tls"_sr) : it.key; + #line 9351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + workerInterfaces[primaryAddress] = workerInterf; + #line 9353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (workerInterf.reboot.getEndpoint().addresses.secondaryAddress.present()) + #line 49311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key secondAddress = StringRef(workerInterf.reboot.getEndpoint().addresses.secondaryAddress.get().toString()); + #line 9356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + secondAddress = secondAddress.endsWith(":tls"_sr) ? secondAddress.removeSuffix(":tls"_sr) : secondAddress; + #line 9357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + workerInterfaces[secondAddress] = workerInterf; + #line 49319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 9361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + addressesVec = std::vector(); + #line 9362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + boost::algorithm::split(addressesVec, addr.toString(), boost::is_any_of(",")); + #line 9364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference connectLock(new FlowLock(CLIENT_KNOBS->CLI_CONNECT_PARALLELISM)); + #line 9365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + verifyInterfs = std::vector>(); + #line 9366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( const auto& requestedAddress : addressesVec ) { + #line 9368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!workerInterfaces.count(Key(requestedAddress))) + #line 49334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(0); this->~RebootWorkerActorActorState(); static_cast(this)->destroy(); return 0; } + #line 49338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< int64_t >::value()) int64_t(0); + this->~RebootWorkerActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 9371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + verifyInterfs.push_back(verifyInterfaceActor(connectLock, workerInterfaces[Key(requestedAddress)])); + #line 49346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = waitForAll(verifyInterfs); + #line 9374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 49352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 49357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(RangeResult const& kvs,int loopDepth) + { + loopDepth = a_body1cont1(kvs, loopDepth); + + return loopDepth; + } + int a_body1when1(RangeResult && kvs,int loopDepth) + { + loopDepth = a_body1cont1(std::move(kvs), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RebootWorkerActorActor, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< RebootWorkerActorActor, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("rebootWorkerActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("rebootWorkerActor", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< RebootWorkerActorActor, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("rebootWorkerActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("rebootWorkerActor", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< RebootWorkerActorActor, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("rebootWorkerActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("rebootWorkerActor", reinterpret_cast(this), 0); + + } + int a_body1cont4(Void const& _,int loopDepth) + { + #line 9375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( const auto& f : verifyInterfs ) { + #line 9376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!f.get()) + #line 49431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(0); this->~RebootWorkerActorActorState(); static_cast(this)->destroy(); return 0; } + #line 49435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< int64_t >::value()) int64_t(0); + this->~RebootWorkerActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 9380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( const auto& address : addressesVec ) { + #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + workerInterfaces[Key(address)].reboot.send(RebootRequest(false, check, duration)); + #line 49446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(1); this->~RebootWorkerActorActorState(); static_cast(this)->destroy(); return 0; } + #line 49450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< int64_t >::value()) int64_t(1); + this->~RebootWorkerActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont4(Void && _,int loopDepth) + { + #line 9375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( const auto& f : verifyInterfs ) { + #line 9376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!f.get()) + #line 49464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(0); this->~RebootWorkerActorActorState(); static_cast(this)->destroy(); return 0; } + #line 49468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< int64_t >::value()) int64_t(0); + this->~RebootWorkerActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 9380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( const auto& address : addressesVec ) { + #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + workerInterfaces[Key(address)].reboot.send(RebootRequest(false, check, duration)); + #line 49479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(1); this->~RebootWorkerActorActorState(); static_cast(this)->destroy(); return 0; } + #line 49483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< int64_t >::value()) int64_t(1); + this->~RebootWorkerActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RebootWorkerActorActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RebootWorkerActorActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("rebootWorkerActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("rebootWorkerActor", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< RebootWorkerActorActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("rebootWorkerActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("rebootWorkerActor", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< RebootWorkerActorActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("rebootWorkerActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("rebootWorkerActor", reinterpret_cast(this), 1); + + } + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + DatabaseContext* cx; + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ValueRef addr; + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool check; + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int duration; + #line 9346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::map workerInterfaces; + #line 9361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector addressesVec; + #line 9365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> verifyInterfs; + #line 49568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via rebootWorkerActor() + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class RebootWorkerActorActor final : public Actor, public ActorCallback< RebootWorkerActorActor, 0, RangeResult >, public ActorCallback< RebootWorkerActorActor, 1, Void >, public FastAllocated, public RebootWorkerActorActorState { + #line 49573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< RebootWorkerActorActor, 0, RangeResult >; +friend struct ActorCallback< RebootWorkerActorActor, 1, Void >; + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + RebootWorkerActorActor(DatabaseContext* const& cx,ValueRef const& addr,bool const& check,int const& duration) + #line 49585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + RebootWorkerActorActorState(cx, addr, check, duration) + { + fdb_probe_actor_enter("rebootWorkerActor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("rebootWorkerActor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("rebootWorkerActor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< RebootWorkerActorActor, 0, RangeResult >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< RebootWorkerActorActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] static Future rebootWorkerActor( DatabaseContext* const& cx, ValueRef const& addr, bool const& check, int const& duration ) { + #line 9336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new RebootWorkerActorActor(cx, addr, check, duration)); + #line 49614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +Future DatabaseContext::rebootWorker(StringRef addr, bool check, int duration) { + return rebootWorkerActor(this, addr, check, duration); +} + +Future DatabaseContext::forceRecoveryWithDataLoss(StringRef dcId) { + return forceRecovery(getConnectionRecord(), dcId); +} + + #line 49627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via createSnapshotActor() + #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class CreateSnapshotActorActorState { + #line 49634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CreateSnapshotActorActorState(DatabaseContext* const& cx,UID const& snapUID,StringRef const& snapCmd) + #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + snapUID(snapUID), + #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + snapCmd(snapCmd) + #line 49645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("createSnapshotActor", reinterpret_cast(this)); + + } + ~CreateSnapshotActorActorState() + { + fdb_probe_actor_destroy("createSnapshotActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 9396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = mgmtSnapCreate(cx->clone(), snapCmd, snapUID); + #line 9396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 49662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 49667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CreateSnapshotActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 9397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CreateSnapshotActorActorState(); static_cast(this)->destroy(); return 0; } + #line 49690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CreateSnapshotActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 9397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CreateSnapshotActorActorState(); static_cast(this)->destroy(); return 0; } + #line 49702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CreateSnapshotActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateSnapshotActorActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CreateSnapshotActorActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("createSnapshotActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createSnapshotActor", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CreateSnapshotActorActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("createSnapshotActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createSnapshotActor", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CreateSnapshotActorActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("createSnapshotActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createSnapshotActor", reinterpret_cast(this), 0); + + } + #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + DatabaseContext* cx; + #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + UID snapUID; + #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StringRef snapCmd; + #line 49779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via createSnapshotActor() + #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class CreateSnapshotActorActor final : public Actor, public ActorCallback< CreateSnapshotActorActor, 0, Void >, public FastAllocated, public CreateSnapshotActorActorState { + #line 49784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CreateSnapshotActorActor, 0, Void >; + #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CreateSnapshotActorActor(DatabaseContext* const& cx,UID const& snapUID,StringRef const& snapCmd) + #line 49795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + CreateSnapshotActorActorState(cx, snapUID, snapCmd) + { + fdb_probe_actor_enter("createSnapshotActor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("createSnapshotActor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("createSnapshotActor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CreateSnapshotActorActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] static Future createSnapshotActor( DatabaseContext* const& cx, UID const& snapUID, StringRef const& snapCmd ) { + #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new CreateSnapshotActorActor(cx, snapUID, snapCmd)); + #line 49823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +Future DatabaseContext::createSnapshot(StringRef uid, StringRef snapshot_command) { + std::string uid_str = uid.toString(); + if (!std::all_of(uid_str.begin(), uid_str.end(), [](unsigned char c) { return std::isxdigit(c); }) || + uid_str.size() != 32) { + // only 32-length hex string is considered as a valid UID + throw snap_invalid_uid_string(); + } + return createSnapshotActor(this, UID::fromString(uid_str), snapshot_command); +} + +void sharedStateDelRef(DatabaseSharedState* ssPtr) { + if (--ssPtr->refCount == 0) { + delete ssPtr; + } +} + +Future DatabaseContext::initSharedState() { + ASSERT(!sharedStatePtr); // Don't re-initialize shared state if a pointer already exists + DatabaseSharedState* newState = new DatabaseSharedState(); + // Increment refcount by 1 on creation to account for the one held in MultiVersionApi map + // Therefore, on initialization, refCount should be 2 (after also going to setSharedState) + newState->refCount++; + newState->delRef = &sharedStateDelRef; + setSharedState(newState); + return newState; +} + +void DatabaseContext::setSharedState(DatabaseSharedState* p) { + ASSERT(p->protocolVersion == currentProtocolVersion()); + sharedStatePtr = p; + sharedStatePtr->refCount++; +} + +// FIXME: this has undesired head-of-line-blocking behavior in the case of large version jumps. +// For example, say that The current feed version is 100, and one waiter wants to wait for the feed version >= 1000. +// This will send a request with minVersion=1000. Then say someone wants to wait for feed version >= 200. Because we've +// already blocked this updater on version 1000, even if the feed would already be at version 200+, we won't get an +// empty version response until version 1000. + #line 49866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via storageFeedVersionUpdater() + #line 9438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class StorageFeedVersionUpdaterActorState { + #line 49873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageFeedVersionUpdaterActorState(StorageServerInterface const& interf,ChangeFeedStorageData* const& self) + #line 9438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : interf(interf), + #line 9438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + self(self) + #line 49882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("storageFeedVersionUpdater", reinterpret_cast(this)); + + } + ~StorageFeedVersionUpdaterActorState() + { + fdb_probe_actor_destroy("storageFeedVersionUpdater", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 9439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 49897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~StorageFeedVersionUpdaterActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 9440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (self->version.get() < self->desired.get()) + #line 49927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = delay(CLIENT_KNOBS->CHANGE_FEED_EMPTY_BATCH_TIME) || self->version.whenAtLeast(self->desired.get()); + #line 9441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 49933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 49938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 9459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = self->desired.whenAtLeast(self->version.get() + 1); + #line 9459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 49947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 9459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 49952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont2(Void const& _,int loopDepth) + { + #line 9442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (self->version.get() < self->desired.get()) + #line 49968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + try { + #line 9444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = brokenPromiseToNever( interf.changeFeedVersionUpdate.getReply(ChangeFeedVersionUpdateRequest(self->desired.get()))); + #line 9444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2Catch1(actor_cancelled(), loopDepth); + #line 49975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont2Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 49980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1cont2Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1cont2Catch1(unknown_error(), loopDepth); + } + } + else + { + loopDepth = a_body1loopBody1cont3(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Void && _,int loopDepth) + { + #line 9442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (self->version.get() < self->desired.get()) + #line 50000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + try { + #line 9444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = brokenPromiseToNever( interf.changeFeedVersionUpdate.getReply(ChangeFeedVersionUpdateRequest(self->desired.get()))); + #line 9444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2Catch1(actor_cancelled(), loopDepth); + #line 50007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont2Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1cont2Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1cont2Catch1(unknown_error(), loopDepth); + } + } + else + { + loopDepth = a_body1loopBody1cont3(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< StorageFeedVersionUpdaterActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< StorageFeedVersionUpdaterActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(int loopDepth) + { + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2Catch1(const Error& e,int loopDepth=0) + { + try { + #line 9450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() != error_code_server_overloaded) + #line 50108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 50112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY > CLIENT_KNOBS->CHANGE_FEED_EMPTY_BATCH_TIME) + #line 50116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY - CLIENT_KNOBS->CHANGE_FEED_EMPTY_BATCH_TIME); + #line 9454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 50122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 9454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont2Catch1cont1(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont5(ChangeFeedVersionUpdateReply const& rep,int loopDepth) + { + #line 9446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (rep.version > self->version.get()) + #line 50147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + self->version.set(rep.version); + #line 50151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + loopDepth = a_body1loopBody1cont8(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5(ChangeFeedVersionUpdateReply && rep,int loopDepth) + { + #line 9446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (rep.version > self->version.get()) + #line 50161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + self->version.set(rep.version); + #line 50165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + loopDepth = a_body1loopBody1cont8(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(ChangeFeedVersionUpdateReply const& rep,int loopDepth) + { + loopDepth = a_body1loopBody1cont5(rep, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(ChangeFeedVersionUpdateReply && rep,int loopDepth) + { + loopDepth = a_body1loopBody1cont5(std::move(rep), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< StorageFeedVersionUpdaterActor, 1, ChangeFeedVersionUpdateReply >::remove(); + + } + void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 1, ChangeFeedVersionUpdateReply >*,ChangeFeedVersionUpdateReply const& value) + { + fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1cont2Catch1(error, 0); + } catch (...) { + a_body1loopBody1cont2Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 1, ChangeFeedVersionUpdateReply >*,ChangeFeedVersionUpdateReply && value) + { + fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1cont2Catch1(error, 0); + } catch (...) { + a_body1loopBody1cont2Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< StorageFeedVersionUpdaterActor, 1, ChangeFeedVersionUpdateReply >*,Error err) + { + fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1cont2Catch1(error, 0); + } catch (...) { + a_body1loopBody1cont2Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont8(int loopDepth) + { + try { + loopDepth = a_body1loopBody1cont4(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2Catch1cont1(int loopDepth) + { + loopDepth = a_body1loopBody1cont4(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2Catch1cont3(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2Catch1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2Catch1cont3(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2Catch1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2Catch1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2Catch1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< StorageFeedVersionUpdaterActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont2Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont2Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< StorageFeedVersionUpdaterActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 2); + + } + int a_body1loopBody1cont9(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont9(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont9(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont9(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< StorageFeedVersionUpdaterActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< StorageFeedVersionUpdaterActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< StorageFeedVersionUpdaterActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), 3); + + } + #line 9438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageServerInterface interf; + #line 9438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedStorageData* self; + #line 50407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via storageFeedVersionUpdater() + #line 9438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class StorageFeedVersionUpdaterActor final : public Actor, public ActorCallback< StorageFeedVersionUpdaterActor, 0, Void >, public ActorCallback< StorageFeedVersionUpdaterActor, 1, ChangeFeedVersionUpdateReply >, public ActorCallback< StorageFeedVersionUpdaterActor, 2, Void >, public ActorCallback< StorageFeedVersionUpdaterActor, 3, Void >, public FastAllocated, public StorageFeedVersionUpdaterActorState { + #line 50412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< StorageFeedVersionUpdaterActor, 0, Void >; +friend struct ActorCallback< StorageFeedVersionUpdaterActor, 1, ChangeFeedVersionUpdateReply >; +friend struct ActorCallback< StorageFeedVersionUpdaterActor, 2, Void >; +friend struct ActorCallback< StorageFeedVersionUpdaterActor, 3, Void >; + #line 9438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageFeedVersionUpdaterActor(StorageServerInterface const& interf,ChangeFeedStorageData* const& self) + #line 50426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + StorageFeedVersionUpdaterActorState(interf, self) + { + fdb_probe_actor_enter("storageFeedVersionUpdater", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("storageFeedVersionUpdater"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("storageFeedVersionUpdater", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< StorageFeedVersionUpdaterActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< StorageFeedVersionUpdaterActor, 1, ChangeFeedVersionUpdateReply >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< StorageFeedVersionUpdaterActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< StorageFeedVersionUpdaterActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 9438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future storageFeedVersionUpdater( StorageServerInterface const& interf, ChangeFeedStorageData* const& self ) { + #line 9438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new StorageFeedVersionUpdaterActor(interf, self)); + #line 50457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 50462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via changeFeedCommitter() + #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class ChangeFeedCommitterActorState { + #line 50469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedCommitterActorState(IKeyValueStore* const& storage,Reference> const& commitChangeFeedStorage,int64_t* const& uncommittedCFBytes) + #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : storage(storage), + #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + commitChangeFeedStorage(commitChangeFeedStorage), + #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + uncommittedCFBytes(uncommittedCFBytes) + #line 50480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("changeFeedCommitter", reinterpret_cast(this)); + + } + ~ChangeFeedCommitterActorState() + { + fdb_probe_actor_destroy("changeFeedCommitter", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 9467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 50495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ChangeFeedCommitterActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 9468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 50525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + #line 9471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + *uncommittedCFBytes = 0; + #line 9472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + commitChangeFeedStorage->set(false); + #line 9473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = storage->commit(); + #line 9473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 50540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1(int loopDepth) + { + #line 9468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!(!commitChangeFeedStorage->get())) + #line 50561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 9469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = commitChangeFeedStorage->onChange(); + #line 9469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); + #line 50569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1break1(int loopDepth) + { + try { + return a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1loopBody1cont1(Void const& _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopBody1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1loopBody1cont1(Void && _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopBody1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeFeedCommitterActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeFeedCommitterActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeFeedCommitter", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedCommitter", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ChangeFeedCommitterActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("changeFeedCommitter", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedCommitter", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ChangeFeedCommitterActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("changeFeedCommitter", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedCommitter", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont2(Void const& _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont2(Void && _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeFeedCommitterActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeFeedCommitterActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeFeedCommitter", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedCommitter", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ChangeFeedCommitterActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("changeFeedCommitter", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedCommitter", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< ChangeFeedCommitterActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("changeFeedCommitter", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedCommitter", reinterpret_cast(this), 1); + + } + #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + IKeyValueStore* storage; + #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference> commitChangeFeedStorage; + #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int64_t* uncommittedCFBytes; + #line 50748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via changeFeedCommitter() + #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class ChangeFeedCommitterActor final : public Actor, public ActorCallback< ChangeFeedCommitterActor, 0, Void >, public ActorCallback< ChangeFeedCommitterActor, 1, Void >, public FastAllocated, public ChangeFeedCommitterActorState { + #line 50753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ChangeFeedCommitterActor, 0, Void >; +friend struct ActorCallback< ChangeFeedCommitterActor, 1, Void >; + #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedCommitterActor(IKeyValueStore* const& storage,Reference> const& commitChangeFeedStorage,int64_t* const& uncommittedCFBytes) + #line 50765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + ChangeFeedCommitterActorState(storage, commitChangeFeedStorage, uncommittedCFBytes) + { + fdb_probe_actor_enter("changeFeedCommitter", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("changeFeedCommitter"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("changeFeedCommitter", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ChangeFeedCommitterActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ChangeFeedCommitterActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future changeFeedCommitter( IKeyValueStore* const& storage, Reference> const& commitChangeFeedStorage, int64_t* const& uncommittedCFBytes ) { + #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new ChangeFeedCommitterActor(storage, commitChangeFeedStorage, uncommittedCFBytes)); + #line 50794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 50799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via cleanupChangeFeedCache() + #line 9477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class CleanupChangeFeedCacheActorState { + #line 50806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CleanupChangeFeedCacheActorState(DatabaseContext* const& db) + #line 9477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db) + #line 50813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("cleanupChangeFeedCache", reinterpret_cast(this)); + + } + ~CleanupChangeFeedCacheActorState() + { + fdb_probe_actor_destroy("cleanupChangeFeedCache", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 9478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = db->initializeChangeFeedCache; + #line 9478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 50830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CleanupChangeFeedCacheActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 9479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = delay(CLIENT_KNOBS->CHANGE_FEED_CACHE_EXPIRE_TIME); + #line 9479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 50860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 9479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = delay(CLIENT_KNOBS->CHANGE_FEED_CACHE_EXPIRE_TIME); + #line 9479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 50876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 50881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CleanupChangeFeedCacheActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CleanupChangeFeedCacheActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("cleanupChangeFeedCache", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanupChangeFeedCache", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CleanupChangeFeedCacheActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("cleanupChangeFeedCache", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanupChangeFeedCache", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CleanupChangeFeedCacheActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("cleanupChangeFeedCache", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanupChangeFeedCache", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 9480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 50953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont2loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 9480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 50962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont2loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CleanupChangeFeedCacheActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CleanupChangeFeedCacheActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("cleanupChangeFeedCache", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanupChangeFeedCache", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< CleanupChangeFeedCacheActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("cleanupChangeFeedCache", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanupChangeFeedCache", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< CleanupChangeFeedCacheActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("cleanupChangeFeedCache", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanupChangeFeedCache", reinterpret_cast(this), 1); + + } + int a_body1cont2loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont2loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1(int loopDepth) + { + #line 9481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(auto it = db->changeFeedCaches.begin();it != db->changeFeedCaches.end();++it) { + #line 9482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!it->second->active && now() - it->second->inactiveTime > CLIENT_KNOBS->CHANGE_FEED_CACHE_EXPIRE_TIME) + #line 51043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key beginKey = changeFeedCacheKey(it->first.tenantPrefix, it->first.rangeId, it->first.range, 0); + #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key endKey = changeFeedCacheKey(it->first.tenantPrefix, it->first.rangeId, it->first.range, MAX_VERSION); + #line 9486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->storage->clear(KeyRangeRef(beginKey, endKey)); + #line 9487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange feedRange = singleKeyRange(changeFeedCacheFeedKey(it->first.tenantPrefix, it->first.rangeId, it->first.range)); + #line 9489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->storage->clear(feedRange); + #line 9491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->uncommittedCFBytes += beginKey.size() + endKey.size() + feedRange.expectedSize(); + #line 9492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (db->uncommittedCFBytes > CLIENT_KNOBS->CHANGE_FEED_CACHE_FLUSH_BYTES) + #line 51059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->commitChangeFeedStorage->set(true); + #line 51063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto& rangeIdCache = db->rangeId_cacheData[it->first.rangeId]; + #line 9497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeIdCache.erase(it->first); + #line 9498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (rangeIdCache.empty()) + #line 51071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->rangeId_cacheData.erase(it->first.rangeId); + #line 51075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->changeFeedCaches.erase(it); + #line 51079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + break; + } + } + #line 9505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(5.0); + #line 9505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 51087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 9505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 51092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2loopBody1cont1(Void const& _,int loopDepth) + { + if (loopDepth == 0) return a_body1cont2loopHead1(0); + + return loopDepth; + } + int a_body1cont2loopBody1cont1(Void && _,int loopDepth) + { + if (loopDepth == 0) return a_body1cont2loopHead1(0); + + return loopDepth; + } + int a_body1cont2loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CleanupChangeFeedCacheActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CleanupChangeFeedCacheActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("cleanupChangeFeedCache", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanupChangeFeedCache", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< CleanupChangeFeedCacheActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("cleanupChangeFeedCache", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanupChangeFeedCache", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< CleanupChangeFeedCacheActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("cleanupChangeFeedCache", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("cleanupChangeFeedCache", reinterpret_cast(this), 2); + + } + #line 9477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + DatabaseContext* db; + #line 51174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via cleanupChangeFeedCache() + #line 9477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class CleanupChangeFeedCacheActor final : public Actor, public ActorCallback< CleanupChangeFeedCacheActor, 0, Void >, public ActorCallback< CleanupChangeFeedCacheActor, 1, Void >, public ActorCallback< CleanupChangeFeedCacheActor, 2, Void >, public FastAllocated, public CleanupChangeFeedCacheActorState { + #line 51179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CleanupChangeFeedCacheActor, 0, Void >; +friend struct ActorCallback< CleanupChangeFeedCacheActor, 1, Void >; +friend struct ActorCallback< CleanupChangeFeedCacheActor, 2, Void >; + #line 9477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CleanupChangeFeedCacheActor(DatabaseContext* const& db) + #line 51192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + CleanupChangeFeedCacheActorState(db) + { + fdb_probe_actor_enter("cleanupChangeFeedCache", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("cleanupChangeFeedCache"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("cleanupChangeFeedCache", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CleanupChangeFeedCacheActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CleanupChangeFeedCacheActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< CleanupChangeFeedCacheActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 9477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future cleanupChangeFeedCache( DatabaseContext* const& db ) { + #line 9477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new CleanupChangeFeedCacheActor(db)); + #line 51222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 51227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via initializeCFCache() + #line 9509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class InitializeCFCacheActorState { + #line 51234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + InitializeCFCacheActorState(DatabaseContext* const& db) + #line 9509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db), + #line 9510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + beginKey(changeFeedCacheFeedKeys.begin) + #line 51243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("initializeCFCache", reinterpret_cast(this)); + + } + ~InitializeCFCacheActorState() + { + fdb_probe_actor_destroy("initializeCFCache", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 9511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 51258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~InitializeCFCacheActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~InitializeCFCacheActorState(); static_cast(this)->destroy(); return 0; } + #line 51281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~InitializeCFCacheActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 9512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = db->storage->readRange(KeyRangeRef(beginKey, changeFeedCacheFeedKeys.end), CLIENT_KNOBS->CHANGE_FEED_CACHE_LIMIT_BYTES, CLIENT_KNOBS->CHANGE_FEED_CACHE_LIMIT_BYTES); + #line 9512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 51302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 51307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(RangeResult const& res,int loopDepth) + { + #line 9515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.size()) + #line 51329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + beginKey = keyAfter(res.back().key); + #line 51333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + #line 9518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!res.more); + #line 51339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& kv : res ) { + #line 9521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedCacheRange cf(decodeChangeFeedCacheFeedKey(kv.key)); + #line 9522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference data = makeReference(); + #line 9523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto val = decodeChangeFeedCacheFeedValue(kv.value); + #line 9524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->version = val.first; + #line 9525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->popped = val.second; + #line 9526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->active = false; + #line 9527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->inactiveTime = now(); + #line 9528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->changeFeedCaches[cf] = data; + #line 9529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->rangeId_cacheData[cf.rangeId][cf] = data; + #line 51361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!res.more) + #line 51365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1(RangeResult && res,int loopDepth) + { + #line 9515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.size()) + #line 51377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + beginKey = keyAfter(res.back().key); + #line 51381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + #line 9518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!res.more); + #line 51387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& kv : res ) { + #line 9521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedCacheRange cf(decodeChangeFeedCacheFeedKey(kv.key)); + #line 9522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference data = makeReference(); + #line 9523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto val = decodeChangeFeedCacheFeedValue(kv.value); + #line 9524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->version = val.first; + #line 9525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->popped = val.second; + #line 9526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->active = false; + #line 9527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->inactiveTime = now(); + #line 9528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->changeFeedCaches[cf] = data; + #line 9529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->rangeId_cacheData[cf.rangeId][cf] = data; + #line 51409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!res.more) + #line 51413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(RangeResult const& res,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(res, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(RangeResult && res,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(std::move(res), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< InitializeCFCacheActor, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< InitializeCFCacheActor, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("initializeCFCache", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initializeCFCache", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< InitializeCFCacheActor, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("initializeCFCache", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initializeCFCache", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< InitializeCFCacheActor, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("initializeCFCache", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("initializeCFCache", reinterpret_cast(this), 0); + + } + #line 9509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + DatabaseContext* db; + #line 9510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key beginKey; + #line 51488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via initializeCFCache() + #line 9509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class InitializeCFCacheActor final : public Actor, public ActorCallback< InitializeCFCacheActor, 0, RangeResult >, public FastAllocated, public InitializeCFCacheActorState { + #line 51493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< InitializeCFCacheActor, 0, RangeResult >; + #line 9509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + InitializeCFCacheActor(DatabaseContext* const& db) + #line 51504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + InitializeCFCacheActorState(db) + { + fdb_probe_actor_enter("initializeCFCache", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("initializeCFCache"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("initializeCFCache", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< InitializeCFCacheActor, 0, RangeResult >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 9509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future initializeCFCache( DatabaseContext* const& db ) { + #line 9509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new InitializeCFCacheActor(db)); + #line 51532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 51537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via handleShutdown() + #line 9538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class HandleShutdownActorState { + #line 51544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + HandleShutdownActorState(DatabaseContext* const& db) + #line 9538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db) + #line 51551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("handleShutdown", reinterpret_cast(this)); + + } + ~HandleShutdownActorState() + { + fdb_probe_actor_destroy("handleShutdown", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + try { + #line 9540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = db->storage->getError(); + #line 9540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 51569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 51574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~HandleShutdownActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 9544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->initializeChangeFeedCache = Void(); + #line 9545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->storage = nullptr; + #line 9546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->changeFeedStorageCommitter = Void(); + #line 9547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~HandleShutdownActorState(); static_cast(this)->destroy(); return 0; } + #line 51609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~HandleShutdownActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 9542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("ChangeFeedCacheDiskError").error(e); + #line 51622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< HandleShutdownActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< HandleShutdownActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("handleShutdown", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("handleShutdown", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< HandleShutdownActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("handleShutdown", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("handleShutdown", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< HandleShutdownActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("handleShutdown", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("handleShutdown", reinterpret_cast(this), 0); + + } + int a_body1cont3(int loopDepth) + { + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 9538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + DatabaseContext* db; + #line 51723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via handleShutdown() + #line 9538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class HandleShutdownActor final : public Actor, public ActorCallback< HandleShutdownActor, 0, Void >, public FastAllocated, public HandleShutdownActorState { + #line 51728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< HandleShutdownActor, 0, Void >; + #line 9538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + HandleShutdownActor(DatabaseContext* const& db) + #line 51739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + HandleShutdownActorState(db) + { + fdb_probe_actor_enter("handleShutdown", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("handleShutdown"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("handleShutdown", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< HandleShutdownActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 9538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future handleShutdown( DatabaseContext* const& db ) { + #line 9538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new HandleShutdownActor(db)); + #line 51767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +void DatabaseContext::setStorage(IKeyValueStore* store) { + if (storage != nullptr) { + TraceEvent(SevError, "NativeClientMultipleSetStorage"); + return; + } + storage = store; + commitChangeFeedStorage = makeReference>(false); + initializeChangeFeedCache = initializeCFCache(this); + changeFeedStorageCommitter = changeFeedCommitter(storage, commitChangeFeedStorage, &uncommittedCFBytes) && + cleanupChangeFeedCache(this) && handleShutdown(this); +} + +Reference DatabaseContext::getStorageData(StorageServerInterface interf) { + // use token from interface since that changes on SS restart + UID token = interf.waitFailure.getEndpoint().token; + auto it = changeFeedUpdaters.find(token); + if (it == changeFeedUpdaters.end()) { + Reference newStorageUpdater = makeReference(); + newStorageUpdater->id = interf.id(); + newStorageUpdater->interfToken = token; + newStorageUpdater->updater = storageFeedVersionUpdater(interf, newStorageUpdater.getPtr()); + newStorageUpdater->context = this; + newStorageUpdater->created = now(); + changeFeedUpdaters[token] = newStorageUpdater.getPtr(); + return newStorageUpdater; + } + return Reference::addRef(it->second); +} + +Version DatabaseContext::getMinimumChangeFeedVersion() { + Version minVersion = std::numeric_limits::max(); + for (auto& it : changeFeedUpdaters) { + if (now() - it.second->created > CLIENT_KNOBS->CHANGE_FEED_START_INTERVAL) { + minVersion = std::min(minVersion, it.second->version.get()); + } + } + for (auto& it : notAtLatestChangeFeeds) { + if (now() - it.second->created > CLIENT_KNOBS->CHANGE_FEED_START_INTERVAL) { + minVersion = std::min(minVersion, it.second->getVersion()); + } + } + return minVersion; +} + +void DatabaseContext::setDesiredChangeFeedVersion(Version v) { + for (auto& it : changeFeedUpdaters) { + if (it.second->version.get() < v && it.second->desired.get() < v) { + it.second->desired.set(v); + } + } +} + +// Because two storage servers, depending on the shard map, can have different representations of a clear at the same +// version depending on their shard maps at the time of the mutation, it is non-trivial to directly compare change feed +// streams. Instead we compare the presence of data at each version. This both saves on cpu cost of validation, and +// because historically most change feed corruption bugs are the absence of entire versions, not a subset of mutations +// within a version. +struct ChangeFeedTSSValidationData { + PromiseStream ssStreamSummary; + ReplyPromiseStream tssStream; + Future validatorFuture; + std::deque> rollbacks; + Version popVersion = invalidVersion; + bool done = false; + + ChangeFeedTSSValidationData() {} + ChangeFeedTSSValidationData(ReplyPromiseStream tssStream) : tssStream(tssStream) {} + + void updatePopped(Version newPopVersion) { popVersion = std::max(popVersion, newPopVersion); } + + bool checkRollback(const MutationsAndVersionRef& m) { + if (m.mutations.size() == 1 && m.mutations.back().param1 == lastEpochEndPrivateKey) { + if (rollbacks.empty() || rollbacks.back().second < m.version) { + Version rollbackVersion; + BinaryReader br(m.mutations.back().param2, Unversioned()); + br >> rollbackVersion; + if (!rollbacks.empty()) { + ASSERT(rollbacks.back().second <= rollbackVersion); + } + rollbacks.push_back({ rollbackVersion, m.version }); + } + return true; + } else { + return false; + } + } + + bool shouldAddMutation(const MutationsAndVersionRef& m) { + return !done && !m.mutations.empty() && !checkRollback(m); + } + + bool isRolledBack(Version v) { + if (rollbacks.empty()) { + return false; + } + for (int i = 0; i < rollbacks.size(); i++) { + if (v <= rollbacks[i].first) { + return false; + } + if (v < rollbacks[i].second) { + return true; + } + } + return false; + } + + void send(const ChangeFeedStreamReply& ssReply) { + if (done) { + return; + } + updatePopped(ssReply.popVersion); + for (auto& it : ssReply.mutations) { + if (shouldAddMutation(it)) { + ssStreamSummary.send(it.version); + } + } + } + + void complete() { + done = true; + // destroy TSS stream to stop server actor + tssStream.reset(); + } +}; + +void handleTSSChangeFeedMismatch(const ChangeFeedStreamRequest& request, + const TSSEndpointData& tssData, + int64_t matchesFound, + Version lastMatchingVersion, + Version ssVersion, + Version tssVersion, + Version popVersion) { + if (request.canReadPopped) { + // There is a known issue where this can return different data between an SS and TSS when a feed was popped but + // the SS restarted before the pop could be persisted, for reads that can read popped data. As such, only count + // this as a mismatch when !req.canReadPopped + return; + } + CODE_PROBE(true, "TSS mismatch in stream comparison"); + + if (tssData.metrics->shouldRecordDetailedMismatch()) { + TraceEvent mismatchEvent( + (g_network->isSimulated() && g_simulator->tssMode == ISimulator::TSSMode::EnabledDropMutations) + ? SevWarnAlways + : SevError, + "TSSMismatchChangeFeedStream"); + mismatchEvent.setMaxEventLength(FLOW_KNOBS->TSS_LARGE_TRACE_SIZE); + + // request info + mismatchEvent.detail("TSSID", tssData.tssId); + mismatchEvent.detail("FeedID", request.rangeID); + mismatchEvent.detail("BeginVersion", request.begin); + mismatchEvent.detail("EndVersion", request.end); + mismatchEvent.detail("StartKey", request.range.begin); + mismatchEvent.detail("EndKey", request.range.end); + mismatchEvent.detail("CanReadPopped", request.canReadPopped); + mismatchEvent.detail("PopVersion", popVersion); + mismatchEvent.detail("DebugUID", request.id); + + // mismatch info + mismatchEvent.detail("MatchesFound", matchesFound); + mismatchEvent.detail("LastMatchingVersion", lastMatchingVersion); + mismatchEvent.detail("SSVersion", ssVersion); + mismatchEvent.detail("TSSVersion", tssVersion); + + CODE_PROBE(FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL, + "Tracing Full TSS Feed Mismatch in stream comparison", + probe::decoration::rare); + CODE_PROBE(!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL, + "Tracing Partial TSS Feed Mismatch in stream comparison and storing the rest in FDB"); + + if (!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL) { + mismatchEvent.disable(); + UID mismatchUID = deterministicRandom()->randomUniqueID(); + tssData.metrics->recordDetailedMismatchData(mismatchUID, mismatchEvent.getFields().toString()); + + // record a summarized trace event instead + TraceEvent summaryEvent( + (g_network->isSimulated() && g_simulator->tssMode == ISimulator::TSSMode::EnabledDropMutations) + ? SevWarnAlways + : SevError, + "TSSMismatchChangeFeedStream"); + summaryEvent.detail("TSSID", tssData.tssId) + .detail("MismatchId", mismatchUID) + .detail("FeedDebugUID", request.id); + } + } +} + + #line 51961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via changeFeedTSSValidator() + #line 9739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class ChangeFeedTSSValidatorActorState { + #line 51968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedTSSValidatorActorState(ChangeFeedStreamRequest const& req,Optional* const& data,TSSEndpointData const& tssData) + #line 9739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : req(req), + #line 9739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data(data), + #line 9739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssData(tssData), + #line 9742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ssDone(false), + #line 9743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssDone(false), + #line 9744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ssSummary(), + #line 9745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssSummary() + #line 51987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("changeFeedTSSValidator", reinterpret_cast(this)); + + } + ~ChangeFeedTSSValidatorActorState() + { + fdb_probe_actor_destroy("changeFeedTSSValidator", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 9747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(data->present()); + #line 9748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + matchesFound = 0; + #line 9749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + lastMatchingVersion = req.begin - 1; + #line 9751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 52008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ChangeFeedTSSValidatorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 9753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!ssDone && ssSummary.empty()) + #line 52038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + try { + #line 9755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + FutureStream __when_expr_0 = data->get().ssStreamSummary.getFuture(); + #line 9755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 52045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.pop(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + } + else + { + loopDepth = a_body1loopBody1cont1(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + #line 9776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!tssDone && tssSummary.empty()) + #line 52070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + try { + #line 9779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + FutureStream __when_expr_1 = data->get().tssStream.getFuture(); + #line 9778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); + #line 52077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont1when1(__when_expr_1.pop(), loopDepth); }; + #line 9788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = (ssDone || !ssSummary.empty()) ? delay(2.0 * FLOW_KNOBS->LOAD_BALANCE_TSS_TIMEOUT) : Never(); + #line 52081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont1when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1cont1Catch1(unknown_error(), loopDepth); + } + } + else + { + loopDepth = a_body1loopBody1cont6(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 9758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_actor_cancelled) + #line 52115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 52119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() != error_code_end_of_stream) + #line 52123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->get().complete(); + #line 9763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() != error_code_operation_cancelled) + #line 52129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssData.metrics->ssError(e.code()); + #line 52133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 52137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ssDone = true; + #line 9769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (tssDone) + #line 52143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->get().complete(); + #line 9771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeFeedTSSValidatorActorState(); static_cast(this)->destroy(); return 0; } + #line 52149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeFeedTSSValidatorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1loopBody1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont3(Version const& next,int loopDepth) + { + #line 9756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ssSummary.push_back(next); + #line 52169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont5(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3(Version && next,int loopDepth) + { + #line 9756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ssSummary.push_back(next); + #line 52178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont5(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Version const& next,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(next, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Version && next,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(next), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorSingleCallback< ChangeFeedTSSValidatorActor, 0, Version >::remove(); + + } + void a_callback_fire(ActorSingleCallback< ChangeFeedTSSValidatorActor, 0, Version >*,Version const& value) + { + fdb_probe_actor_enter("changeFeedTSSValidator", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedTSSValidator", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorSingleCallback< ChangeFeedTSSValidatorActor, 0, Version >*,Version && value) + { + fdb_probe_actor_enter("changeFeedTSSValidator", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedTSSValidator", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorSingleCallback< ChangeFeedTSSValidatorActor, 0, Version >*,Error err) + { + fdb_probe_actor_enter("changeFeedTSSValidator", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedTSSValidator", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont5(int loopDepth) + { + try { + loopDepth = a_body1loopBody1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont6(int loopDepth) + { + #line 9815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(;!ssSummary.empty() && (ssSummary.front() < data->get().popVersion || data->get().isRolledBack(ssSummary.front()));) { + #line 9817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ssSummary.pop_front(); + #line 52265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(;!tssSummary.empty() && (tssSummary.front() < data->get().popVersion || data->get().isRolledBack(tssSummary.front()));) { + #line 9822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssSummary.pop_front(); + #line 52271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(;!ssSummary.empty() && !tssSummary.empty();) { + #line 9825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Comparing TSS change feed data"); + #line 9826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (ssSummary.front() != tssSummary.front()) + #line 52279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "TSS change feed mismatch"); + #line 9828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + handleTSSChangeFeedMismatch(req, tssData, matchesFound, lastMatchingVersion, ssSummary.front(), tssSummary.front(), data->get().popVersion); + #line 9835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->get().complete(); + #line 9836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeFeedTSSValidatorActorState(); static_cast(this)->destroy(); return 0; } + #line 52289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeFeedTSSValidatorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 9838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + matchesFound++; + #line 9839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + lastMatchingVersion = ssSummary.front(); + #line 9840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ssSummary.pop_front(); + #line 9841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssSummary.pop_front(); + #line 9843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(;!data->get().rollbacks.empty() && data->get().rollbacks.front().second <= lastMatchingVersion;) { + #line 9844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->get().rollbacks.pop_front(); + #line 52307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 9848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!ssDone || !tssDone); + #line 9849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if ((ssDone && !tssSummary.empty()) || (tssDone && !ssSummary.empty())) + #line 52314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "TSS change feed mismatch at end of stream"); + #line 9851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + handleTSSChangeFeedMismatch(req, tssData, matchesFound, lastMatchingVersion, ssDone ? -1 : ssSummary.front(), tssDone ? -1 : tssSummary.front(), data->get().popVersion); + #line 9858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->get().complete(); + #line 9859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeFeedTSSValidatorActorState(); static_cast(this)->destroy(); return 0; } + #line 52324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeFeedTSSValidatorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont7(int loopDepth) + { + loopDepth = a_body1loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 9797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_operation_cancelled) + #line 52345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 52349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_end_of_stream) + #line 52353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssDone = true; + #line 9802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (ssDone) + #line 52359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->get().complete(); + #line 9804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeFeedTSSValidatorActorState(); static_cast(this)->destroy(); return 0; } + #line 52365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeFeedTSSValidatorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + else + { + #line 9807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssData.metrics->tssError(e.code()); + #line 9808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->get().complete(); + #line 9809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeFeedTSSValidatorActorState(); static_cast(this)->destroy(); return 0; } + #line 52380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeFeedTSSValidatorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1loopBody1cont7(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont8(int loopDepth) + { + loopDepth = a_body1loopBody1cont9(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1when1(ChangeFeedStreamReply const& nextTss,int loopDepth) + { + #line 9780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->get().updatePopped(nextTss.popVersion); + #line 9781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : nextTss.mutations ) { + #line 9782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (data->get().shouldAddMutation(it)) + #line 52410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssSummary.push_back(it.version); + #line 52414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + loopDepth = a_body1loopBody1cont8(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1when1(ChangeFeedStreamReply && nextTss,int loopDepth) + { + #line 9780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->get().updatePopped(nextTss.popVersion); + #line 9781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : nextTss.mutations ) { + #line 9782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (data->get().shouldAddMutation(it)) + #line 52429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssSummary.push_back(it.version); + #line 52433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + loopDepth = a_body1loopBody1cont8(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1when2(Void const& _,int loopDepth) + { + #line 9790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++tssData.metrics->tssTimeouts; + #line 9791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->get().complete(); + #line 9792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeFeedTSSValidatorActorState(); static_cast(this)->destroy(); return 0; } + #line 52448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeFeedTSSValidatorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont1when2(Void && _,int loopDepth) + { + #line 9790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++tssData.metrics->tssTimeouts; + #line 9791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->get().complete(); + #line 9792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeFeedTSSValidatorActorState(); static_cast(this)->destroy(); return 0; } + #line 52464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeFeedTSSValidatorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorSingleCallback< ChangeFeedTSSValidatorActor, 1, ChangeFeedStreamReply >::remove(); + static_cast(this)->ActorCallback< ChangeFeedTSSValidatorActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorSingleCallback< ChangeFeedTSSValidatorActor, 1, ChangeFeedStreamReply >*,ChangeFeedStreamReply const& value) + { + fdb_probe_actor_enter("changeFeedTSSValidator", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1cont1Catch1(error, 0); + } catch (...) { + a_body1loopBody1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedTSSValidator", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorSingleCallback< ChangeFeedTSSValidatorActor, 1, ChangeFeedStreamReply >*,ChangeFeedStreamReply && value) + { + fdb_probe_actor_enter("changeFeedTSSValidator", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1cont1Catch1(error, 0); + } catch (...) { + a_body1loopBody1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedTSSValidator", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorSingleCallback< ChangeFeedTSSValidatorActor, 1, ChangeFeedStreamReply >*,Error err) + { + fdb_probe_actor_enter("changeFeedTSSValidator", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1cont1Catch1(error, 0); + } catch (...) { + a_body1loopBody1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedTSSValidator", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ChangeFeedTSSValidatorActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeFeedTSSValidator", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1loopBody1cont1when2(value, 0); + } + catch (Error& error) { + a_body1loopBody1cont1Catch1(error, 0); + } catch (...) { + a_body1loopBody1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedTSSValidator", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< ChangeFeedTSSValidatorActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("changeFeedTSSValidator", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1loopBody1cont1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1cont1Catch1(error, 0); + } catch (...) { + a_body1loopBody1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedTSSValidator", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< ChangeFeedTSSValidatorActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("changeFeedTSSValidator", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1loopBody1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1cont1Catch1(error, 0); + } catch (...) { + a_body1loopBody1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedTSSValidator", reinterpret_cast(this), 2); + + } + int a_body1loopBody1cont9(int loopDepth) + { + try { + loopDepth = a_body1loopBody1cont7(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + #line 9739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedStreamRequest req; + #line 9739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional* data; + #line 9739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TSSEndpointData tssData; + #line 9742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool ssDone; + #line 9743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool tssDone; + #line 9744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::deque ssSummary; + #line 9745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::deque tssSummary; + #line 9748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int64_t matchesFound; + #line 9749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version lastMatchingVersion; + #line 52600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via changeFeedTSSValidator() + #line 9739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class ChangeFeedTSSValidatorActor final : public Actor, public ActorSingleCallback< ChangeFeedTSSValidatorActor, 0, Version >, public ActorSingleCallback< ChangeFeedTSSValidatorActor, 1, ChangeFeedStreamReply >, public ActorCallback< ChangeFeedTSSValidatorActor, 2, Void >, public FastAllocated, public ChangeFeedTSSValidatorActorState { + #line 52605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorSingleCallback< ChangeFeedTSSValidatorActor, 0, Version >; +friend struct ActorSingleCallback< ChangeFeedTSSValidatorActor, 1, ChangeFeedStreamReply >; +friend struct ActorCallback< ChangeFeedTSSValidatorActor, 2, Void >; + #line 9739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedTSSValidatorActor(ChangeFeedStreamRequest const& req,Optional* const& data,TSSEndpointData const& tssData) + #line 52618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + ChangeFeedTSSValidatorActorState(req, data, tssData) + { + fdb_probe_actor_enter("changeFeedTSSValidator", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("changeFeedTSSValidator"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("changeFeedTSSValidator", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorSingleCallback< ChangeFeedTSSValidatorActor, 0, Version >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorSingleCallback< ChangeFeedTSSValidatorActor, 1, ChangeFeedStreamReply >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 9739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future changeFeedTSSValidator( ChangeFeedStreamRequest const& req, Optional* const& data, TSSEndpointData const& tssData ) { + #line 9739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new ChangeFeedTSSValidatorActor(req, data, tssData)); + #line 52647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +void maybeDuplicateTSSChangeFeedStream(ChangeFeedStreamRequest& req, + const RequestStream& stream, + QueueModel* model, + Optional* tssData) { + if (model) { + Optional tssPair = model->getTssData(stream.getEndpoint().token.first()); + if (tssPair.present()) { + CODE_PROBE(true, "duplicating feed stream to TSS"); + resetReply(req); + + RequestStream tssRequestStream(tssPair.get().endpoint); + *tssData = Optional( + ChangeFeedTSSValidationData(tssRequestStream.getReplyStream(req))); + // tie validator actor to the lifetime of the stream being active + tssData->get().validatorFuture = changeFeedTSSValidator(req, tssData, tssPair.get()); + } + } +} + +ChangeFeedStorageData::~ChangeFeedStorageData() { + if (context) { + context->changeFeedUpdaters.erase(interfToken); + } +} + +ChangeFeedData::ChangeFeedData(DatabaseContext* context) + : dbgid(deterministicRandom()->randomUniqueID()), context(context), notAtLatest(1), created(now()) { + if (context) { + context->notAtLatestChangeFeeds[dbgid] = this; + } +} +ChangeFeedData::~ChangeFeedData() { + if (context) { + context->notAtLatestChangeFeeds.erase(dbgid); + } +} + +Version ChangeFeedData::getVersion() { + return lastReturnedVersion.get(); +} + +// This function is essentially bubbling the information about what has been processed from the server through the +// change feed client. First it makes sure the server has returned all mutations up through the target version, the +// native api has consumed and processed, them, and then the fdb client has consumed all of the mutations. + #line 52696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via changeFeedWaitLatest() + #line 9908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class ChangeFeedWaitLatestActorState { + #line 52703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedWaitLatestActorState(Reference const& self,Version const& version) + #line 9908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : self(self), + #line 9908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version) + #line 52712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("changeFeedWaitLatest", reinterpret_cast(this)); + + } + ~ChangeFeedWaitLatestActorState() + { + fdb_probe_actor_destroy("changeFeedWaitLatest", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 9910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> allAtLeast; + #line 9911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : self->storageData ) { + #line 9912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (it->version.get() < version) + #line 52731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (version > it->desired.get()) + #line 52735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + it->desired.set(version); + #line 52739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + allAtLeast.push_back(it->version.whenAtLeast(version)); + #line 52743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 9920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = waitForAll(allAtLeast); + #line 9920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 52750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ChangeFeedWaitLatestActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 9923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> onEmpty; + #line 9924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : self->streams ) { + #line 9925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!it.isEmpty()) + #line 52782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + onEmpty.push_back(it.onEmpty()); + #line 52786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 9930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (onEmpty.size()) + #line 52791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = waitForAll(onEmpty); + #line 9931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 52797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont5(loopDepth); + } + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 9923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> onEmpty; + #line 9924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : self->streams ) { + #line 9925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!it.isEmpty()) + #line 52820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + onEmpty.push_back(it.onEmpty()); + #line 52824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 9930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (onEmpty.size()) + #line 52829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = waitForAll(onEmpty); + #line 9931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 52835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 9931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont5(loopDepth); + } + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeFeedWaitLatestActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ChangeFeedWaitLatestActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 0); + + } + int a_body1cont5(int loopDepth) + { + #line 9934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (self->mutations.isEmpty()) + #line 52917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(0); + #line 9935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 52923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont5when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 9935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 52928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont9(loopDepth); + } + + return loopDepth; + } + int a_body1cont8(Void const& _,int loopDepth) + { + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont8(Void && _,int loopDepth) + { + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont8(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeFeedWaitLatestActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< ChangeFeedWaitLatestActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 1); + + } + int a_body1cont9(int loopDepth) + { + #line 9940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 53017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont9loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont10(Void const& _,int loopDepth) + { + loopDepth = a_body1cont9(loopDepth); + + return loopDepth; + } + int a_body1cont10(Void && _,int loopDepth) + { + loopDepth = a_body1cont9(loopDepth); + + return loopDepth; + } + int a_body1cont5when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont10(_, loopDepth); + + return loopDepth; + } + int a_body1cont5when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont10(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeFeedWaitLatestActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont5when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont5when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< ChangeFeedWaitLatestActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 2); + + } + int a_body1cont11(int loopDepth) + { + #line 9946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (self->maxSeenVersion >= version) + #line 53101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = self->lastReturnedVersion.whenAtLeast(version); + #line 9949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 53107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont11when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 9949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 53112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 9952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 53119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont11loopHead1(loopDepth); + } + + return loopDepth; + } + int a_body1cont9loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont9loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont9loopBody1(int loopDepth) + { + #line 9940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!(self->lastReturnedVersion.get() < self->maxSeenVersion && self->lastReturnedVersion.get() < version)) + #line 53136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1cont9break1(loopDepth==0?0:loopDepth-1); // break + } + #line 9941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version target = std::min(self->maxSeenVersion, version); + #line 9942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = self->lastReturnedVersion.whenAtLeast(target); + #line 9942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 53146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont9loopBody1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 9942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 53151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont9break1(int loopDepth) + { + try { + return a_body1cont11(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont9loopBody1cont1(Void const& _,int loopDepth) + { + if (loopDepth == 0) return a_body1cont9loopHead1(0); + + return loopDepth; + } + int a_body1cont9loopBody1cont1(Void && _,int loopDepth) + { + if (loopDepth == 0) return a_body1cont9loopHead1(0); + + return loopDepth; + } + int a_body1cont9loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont9loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont9loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont9loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeFeedWaitLatestActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont9loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont9loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< ChangeFeedWaitLatestActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 3); + + } + int a_body1cont11cont1(int loopDepth) + { + #line 9958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeFeedWaitLatestActorState(); static_cast(this)->destroy(); return 0; } + #line 53248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeFeedWaitLatestActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont11cont2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont11cont1(loopDepth); + + return loopDepth; + } + int a_body1cont11cont2(Void && _,int loopDepth) + { + loopDepth = a_body1cont11cont1(loopDepth); + + return loopDepth; + } + int a_body1cont11when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont11cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont11when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont11cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeFeedWaitLatestActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont11when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont11when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< ChangeFeedWaitLatestActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 4); + + } + int a_body1cont11cont3(int loopDepth) + { + loopDepth = a_body1cont11cont1(loopDepth); + + return loopDepth; + } + int a_body1cont11loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont11loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont11loopBody1(int loopDepth) + { + #line 9952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!(!self->mutations.isEmpty())) + #line 53348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1cont11break1(loopDepth==0?0:loopDepth-1); // break + } + #line 9953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_5 = self->mutations.onEmpty(); + #line 9953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 53356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont11loopBody1when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 9953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 53361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont11break1(int loopDepth) + { + try { + return a_body1cont11cont3(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont11loopBody1cont1(Void const& _,int loopDepth) + { + #line 9954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_6 = delay(0); + #line 9954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 53385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1cont11loopBody1cont1when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 9954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 53390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont11loopBody1cont1(Void && _,int loopDepth) + { + #line 9954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_6 = delay(0); + #line 9954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 53401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1cont11loopBody1cont1when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 9954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 53406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont11loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont11loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont11loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont11loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeFeedWaitLatestActor, 5, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont11loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 5, Void >*,Void && value) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont11loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< ChangeFeedWaitLatestActor, 5, Void >*,Error err) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 5); + + } + int a_body1cont11loopBody1cont3(Void const& _,int loopDepth) + { + if (loopDepth == 0) return a_body1cont11loopHead1(0); + + return loopDepth; + } + int a_body1cont11loopBody1cont3(Void && _,int loopDepth) + { + if (loopDepth == 0) return a_body1cont11loopHead1(0); + + return loopDepth; + } + int a_body1cont11loopBody1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont11loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont11loopBody1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont11loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose7() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeFeedWaitLatestActor, 6, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 6, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1cont11loopBody1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 6); + + } + void a_callback_fire(ActorCallback< ChangeFeedWaitLatestActor, 6, Void >*,Void && value) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1cont11loopBody1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 6); + + } + void a_callback_error(ActorCallback< ChangeFeedWaitLatestActor, 6, Void >*,Error err) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), 6); + + } + #line 9908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference self; + #line 9908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 53553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via changeFeedWaitLatest() + #line 9908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class ChangeFeedWaitLatestActor final : public Actor, public ActorCallback< ChangeFeedWaitLatestActor, 0, Void >, public ActorCallback< ChangeFeedWaitLatestActor, 1, Void >, public ActorCallback< ChangeFeedWaitLatestActor, 2, Void >, public ActorCallback< ChangeFeedWaitLatestActor, 3, Void >, public ActorCallback< ChangeFeedWaitLatestActor, 4, Void >, public ActorCallback< ChangeFeedWaitLatestActor, 5, Void >, public ActorCallback< ChangeFeedWaitLatestActor, 6, Void >, public FastAllocated, public ChangeFeedWaitLatestActorState { + #line 53558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ChangeFeedWaitLatestActor, 0, Void >; +friend struct ActorCallback< ChangeFeedWaitLatestActor, 1, Void >; +friend struct ActorCallback< ChangeFeedWaitLatestActor, 2, Void >; +friend struct ActorCallback< ChangeFeedWaitLatestActor, 3, Void >; +friend struct ActorCallback< ChangeFeedWaitLatestActor, 4, Void >; +friend struct ActorCallback< ChangeFeedWaitLatestActor, 5, Void >; +friend struct ActorCallback< ChangeFeedWaitLatestActor, 6, Void >; + #line 9908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedWaitLatestActor(Reference const& self,Version const& version) + #line 53575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + ChangeFeedWaitLatestActorState(self, version) + { + fdb_probe_actor_enter("changeFeedWaitLatest", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("changeFeedWaitLatest"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("changeFeedWaitLatest", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ChangeFeedWaitLatestActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ChangeFeedWaitLatestActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ChangeFeedWaitLatestActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< ChangeFeedWaitLatestActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< ChangeFeedWaitLatestActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< ChangeFeedWaitLatestActor, 5, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< ChangeFeedWaitLatestActor, 6, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 9908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future changeFeedWaitLatest( Reference const& self, Version const& version ) { + #line 9908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new ChangeFeedWaitLatestActor(self, version)); + #line 53609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 53614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via changeFeedWhenAtLatest() + #line 9961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class ChangeFeedWhenAtLatestActorState { + #line 53621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedWhenAtLatestActorState(Reference const& self,Version const& version) + #line 9961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : self(self), + #line 9961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version) + #line 53630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("changeFeedWhenAtLatest", reinterpret_cast(this)); + + } + ~ChangeFeedWhenAtLatestActorState() + { + fdb_probe_actor_destroy("changeFeedWhenAtLatest", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 9962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (version >= self->endVersion) + #line 53645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + this->~ChangeFeedWhenAtLatestActorState(); + #line 53649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->sendAndDelPromiseRef(Never()); + return 0; + } + #line 9965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (version <= self->getVersion()) + #line 53655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeFeedWhenAtLatestActorState(); static_cast(this)->destroy(); return 0; } + #line 53659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeFeedWhenAtLatestActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 9968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + lastReturned = self->lastReturnedVersion.whenAtLeast(version); + #line 9969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 53669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ChangeFeedWhenAtLatestActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 9984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (self->lastReturnedVersion.get() < version) + #line 53692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 9985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + self->lastReturnedVersion.set(version); + #line 53696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 9987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(self->getVersion() >= version); + #line 9988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeFeedWhenAtLatestActorState(); static_cast(this)->destroy(); return 0; } + #line 53702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeFeedWhenAtLatestActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 9971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future waitEmptyVersion = (self->notAtLatest.get() == 0) ? changeFeedWaitLatest(self, version) : Never(); + #line 9973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = waitEmptyVersion; + #line 9972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 53725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + #line 9976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = lastReturned; + #line 53729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; + #line 9979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = self->refresh.getFuture(); + #line 53733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when3(__when_expr_2.get(), loopDepth); }; + #line 9980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = self->notAtLatest.onChange(); + #line 53737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when4(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 9973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 53748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when2(Void const& _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when2(Void && _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when3(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when3(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when4(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when4(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeFeedWhenAtLatestActor, 0, Void >::remove(); + static_cast(this)->ActorCallback< ChangeFeedWhenAtLatestActor, 1, Void >::remove(); + static_cast(this)->ActorCallback< ChangeFeedWhenAtLatestActor, 2, Void >::remove(); + static_cast(this)->ActorCallback< ChangeFeedWhenAtLatestActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ChangeFeedWhenAtLatestActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1loopBody1when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1loopBody1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< ChangeFeedWhenAtLatestActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 2); + a_exitChoose1(); + try { + a_body1loopBody1when3(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 2); + a_exitChoose1(); + try { + a_body1loopBody1when3(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< ChangeFeedWhenAtLatestActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 2); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 3); + a_exitChoose1(); + try { + a_body1loopBody1when4(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 3); + a_exitChoose1(); + try { + a_body1loopBody1when4(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< ChangeFeedWhenAtLatestActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 3); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 3); + + } + #line 9961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference self; + #line 9961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 9968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future lastReturned; + #line 54015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via changeFeedWhenAtLatest() + #line 9961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class ChangeFeedWhenAtLatestActor final : public Actor, public ActorCallback< ChangeFeedWhenAtLatestActor, 0, Void >, public ActorCallback< ChangeFeedWhenAtLatestActor, 1, Void >, public ActorCallback< ChangeFeedWhenAtLatestActor, 2, Void >, public ActorCallback< ChangeFeedWhenAtLatestActor, 3, Void >, public FastAllocated, public ChangeFeedWhenAtLatestActorState { + #line 54020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ChangeFeedWhenAtLatestActor, 0, Void >; +friend struct ActorCallback< ChangeFeedWhenAtLatestActor, 1, Void >; +friend struct ActorCallback< ChangeFeedWhenAtLatestActor, 2, Void >; +friend struct ActorCallback< ChangeFeedWhenAtLatestActor, 3, Void >; + #line 9961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedWhenAtLatestActor(Reference const& self,Version const& version) + #line 54034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + ChangeFeedWhenAtLatestActorState(self, version) + { + fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("changeFeedWhenAtLatest"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ChangeFeedWhenAtLatestActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 9961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future changeFeedWhenAtLatest( Reference const& self, Version const& version ) { + #line 9961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new ChangeFeedWhenAtLatestActor(self, version)); + #line 54062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 9990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +Future ChangeFeedData::whenAtLeast(Version version) { + return changeFeedWhenAtLatest(Reference::addRef(this), version); +} + +#define DEBUG_CF_CLIENT_TRACE false + + #line 54073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via partialChangeFeedStream() + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class PartialChangeFeedStreamActorState { + #line 54080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + PartialChangeFeedStreamActorState(StorageServerInterface const& interf,PromiseStream> const& results,ReplyPromiseStream const& replyStream,Version const& begin,Version const& end,Reference const& feedData,Reference const& storageData,UID const& debugUID,Optional* const& tssData) + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : interf(interf), + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results(results), + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + replyStream(replyStream), + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + begin(begin), + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + end(end), + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + feedData(feedData), + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + storageData(storageData), + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + debugUID(debugUID), + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssData(tssData), + #line 10008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + refresh(feedData->refresh), + #line 10009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + atLatestVersion(false), + #line 10010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + nextVersion(begin), + #line 10016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + lastEmpty(invalidVersion) + #line 54111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("partialChangeFeedStream", reinterpret_cast(this)); + + } + ~PartialChangeFeedStreamActorState() + { + fdb_probe_actor_destroy("partialChangeFeedStream", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + try { + #line 10018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 54127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~PartialChangeFeedStreamActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 10130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 54157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorError", debugUID).errorUnsuppressed(e); + #line 54161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_actor_cancelled) + #line 54165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 54169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.sendError(e); + #line 10137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PartialChangeFeedStreamActorState(); static_cast(this)->destroy(); return 0; } + #line 54175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PartialChangeFeedStreamActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 10019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (nextVersion >= end) + #line 54200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.sendError(end_of_stream()); + #line 10021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PartialChangeFeedStreamActorState(); static_cast(this)->destroy(); return 0; } + #line 54206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PartialChangeFeedStreamActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 10024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + FutureStream __when_expr_0 = replyStream.getFuture(); + #line 10023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 54216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.pop(), loopDepth); }; + #line 10112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = atLatestVersion && replyStream.isEmpty() && results.isEmpty() ? storageData->version.whenAtLeast(nextVersion) : Future(Never()); + #line 54220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; + #line 10125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = atLatestVersion && replyStream.isEmpty() && !results.isEmpty() ? results.onEmpty() : Future(Never()); + #line 54224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when3(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 10024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 10112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 10125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 54233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(ChangeFeedStreamReply const& __rep,int loopDepth) + { + #line 10024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rep = __rep; + #line 10026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (nextVersion == begin && rep.mutations.size() == 1 && rep.mutations[0].mutations.size() == 0 && rep.mutations[0].version == begin - 1) + #line 54250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1loopHead1(loopDepth); // continue + } + #line 10031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 54256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorReply", debugUID) .detail("SSID", storageData->id) .detail("AtLatest", atLatestVersion) .detail("FirstVersion", rep.mutations.front().version) .detail("LastVersion", rep.mutations.back().version) .detail("Count", rep.mutations.size()) .detail("MinStreamVersion", rep.minStreamVersion) .detail("PopVersion", rep.popVersion) .detail("RepAtLatest", rep.atLatestVersion); + #line 54260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (rep.mutations.back().version > feedData->maxSeenVersion) + #line 54264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + feedData->maxSeenVersion = rep.mutations.back().version; + #line 54268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (rep.popVersion > feedData->popVersion) + #line 54272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + feedData->popVersion = rep.popVersion; + #line 54276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (tssData->present()) + #line 54280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssData->get().updatePopped(rep.popVersion); + #line 54284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (lastEmpty != invalidVersion && !results.isEmpty()) + #line 54288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : feedData->storageData ) { + #line 10055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (refresh.canBeSet() && lastEmpty > it->desired.get()) + #line 54294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + it->desired.set(lastEmpty); + #line 54298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 10059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + lastEmpty = invalidVersion; + #line 54303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + resultLoc = 0; + #line 10063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 54309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1when1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(ChangeFeedStreamReply && __rep,int loopDepth) + { + rep = std::move(__rep); + #line 10026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (nextVersion == begin && rep.mutations.size() == 1 && rep.mutations[0].mutations.size() == 0 && rep.mutations[0].version == begin - 1) + #line 54319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1loopHead1(loopDepth); // continue + } + #line 10031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 54325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorReply", debugUID) .detail("SSID", storageData->id) .detail("AtLatest", atLatestVersion) .detail("FirstVersion", rep.mutations.front().version) .detail("LastVersion", rep.mutations.back().version) .detail("Count", rep.mutations.size()) .detail("MinStreamVersion", rep.minStreamVersion) .detail("PopVersion", rep.popVersion) .detail("RepAtLatest", rep.atLatestVersion); + #line 54329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (rep.mutations.back().version > feedData->maxSeenVersion) + #line 54333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + feedData->maxSeenVersion = rep.mutations.back().version; + #line 54337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (rep.popVersion > feedData->popVersion) + #line 54341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + feedData->popVersion = rep.popVersion; + #line 54345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (tssData->present()) + #line 54349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssData->get().updatePopped(rep.popVersion); + #line 54353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (lastEmpty != invalidVersion && !results.isEmpty()) + #line 54357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : feedData->storageData ) { + #line 10055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (refresh.canBeSet() && lastEmpty > it->desired.get()) + #line 54363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + it->desired.set(lastEmpty); + #line 54367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 10059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + lastEmpty = invalidVersion; + #line 54372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + resultLoc = 0; + #line 10063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 54378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1when1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2(Void const& _,int loopDepth) + { + #line 10115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + MutationsAndVersionRef empty; + #line 10116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + empty.version = storageData->version.get(); + #line 10117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.send(empty); + #line 10118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + nextVersion = storageData->version.get() + 1; + #line 10119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 54395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorSendEmpty", debugUID) .detail("Version", empty.version); + #line 54399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + lastEmpty = empty.version; + #line 54403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2(Void && _,int loopDepth) + { + #line 10115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + MutationsAndVersionRef empty; + #line 10116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + empty.version = storageData->version.get(); + #line 10117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.send(empty); + #line 10118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + nextVersion = storageData->version.get() + 1; + #line 10119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 54420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorSendEmpty", debugUID) .detail("Version", empty.version); + #line 54424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + lastEmpty = empty.version; + #line 54428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when3(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when3(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorSingleCallback< PartialChangeFeedStreamActor, 0, ChangeFeedStreamReply >::remove(); + static_cast(this)->ActorCallback< PartialChangeFeedStreamActor, 1, Void >::remove(); + static_cast(this)->ActorCallback< PartialChangeFeedStreamActor, 2, Void >::remove(); + + } + int a_body1loopBody1when1cont1(int loopDepth) + { + #line 10093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (rep.mutations.back().version + 1 > nextVersion) + #line 54457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + nextVersion = rep.mutations.back().version + 1; + #line 54461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (refresh.canBeSet() && !atLatestVersion && rep.atLatestVersion) + #line 54465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + atLatestVersion = true; + #line 10099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + feedData->notAtLatest.set(feedData->notAtLatest.get() - 1); + #line 10100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (feedData->notAtLatest.get() == 0 && feedData->context) + #line 54473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + feedData->context->notAtLatestChangeFeeds.erase(feedData->dbgid); + #line 54477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 10104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (refresh.canBeSet() && rep.minStreamVersion > storageData->version.get()) + #line 54482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + storageData->version.set(rep.minStreamVersion); + #line 54486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 54490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorReplyDone", debugUID) .detail("AtLatestNow", atLatestVersion); + #line 54494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1when1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1loopBody1(int loopDepth) + { + #line 10063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!(resultLoc < rep.mutations.size())) + #line 54511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1loopBody1when1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 10064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = results.onEmpty(); + #line 10064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 2)); + #line 54519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1when1loopBody1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 10064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 54524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1break1(int loopDepth) + { + try { + return a_body1loopBody1when1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1when1loopBody1cont1(Void const& _,int loopDepth) + { + #line 10065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (rep.mutations[resultLoc].version >= nextVersion) + #line 54546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (tssData->present() && tssData->get().shouldAddMutation(rep.mutations[resultLoc])) + #line 54550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssData->get().ssStreamSummary.send(rep.mutations[resultLoc].version); + #line 54554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.send(rep.mutations[resultLoc]); + #line 10072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 54560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorSend", debugUID) .detail("Version", rep.mutations[resultLoc].version) .detail("Size", rep.mutations[resultLoc].mutations.size()); + #line 54564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : feedData->storageData ) { + #line 10082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (refresh.canBeSet() && rep.mutations[resultLoc].version > it->desired.get()) + #line 54570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + it->desired.set(rep.mutations[resultLoc].version); + #line 54574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + } + else + { + #line 10087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(rep.mutations[resultLoc].mutations.empty()); + #line 54582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + resultLoc++; + #line 54586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1loopBody1when1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1loopBody1cont1(Void && _,int loopDepth) + { + #line 10065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (rep.mutations[resultLoc].version >= nextVersion) + #line 54595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (tssData->present() && tssData->get().shouldAddMutation(rep.mutations[resultLoc])) + #line 54599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssData->get().ssStreamSummary.send(rep.mutations[resultLoc].version); + #line 54603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.send(rep.mutations[resultLoc]); + #line 10072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 54609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorSend", debugUID) .detail("Version", rep.mutations[resultLoc].version) .detail("Size", rep.mutations[resultLoc].mutations.size()); + #line 54613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : feedData->storageData ) { + #line 10082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (refresh.canBeSet() && rep.mutations[resultLoc].version > it->desired.get()) + #line 54619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + it->desired.set(rep.mutations[resultLoc].version); + #line 54623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + } + else + { + #line 10087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(rep.mutations[resultLoc].mutations.empty()); + #line 54631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + resultLoc++; + #line 54635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1loopBody1when1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1when1loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1when1loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PartialChangeFeedStreamActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< PartialChangeFeedStreamActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 3); + a_exitChoose2(); + try { + a_body1loopBody1when1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< PartialChangeFeedStreamActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 3); + a_exitChoose2(); + try { + a_body1loopBody1when1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< PartialChangeFeedStreamActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 3); + a_exitChoose2(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorSingleCallback< PartialChangeFeedStreamActor, 0, ChangeFeedStreamReply >*,ChangeFeedStreamReply const& value) + { + fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorSingleCallback< PartialChangeFeedStreamActor, 0, ChangeFeedStreamReply >*,ChangeFeedStreamReply && value) + { + fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorSingleCallback< PartialChangeFeedStreamActor, 0, ChangeFeedStreamReply >*,Error err) + { + fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< PartialChangeFeedStreamActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1loopBody1when2(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< PartialChangeFeedStreamActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1loopBody1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< PartialChangeFeedStreamActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< PartialChangeFeedStreamActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 2); + a_exitChoose1(); + try { + a_body1loopBody1when3(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< PartialChangeFeedStreamActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 2); + a_exitChoose1(); + try { + a_body1loopBody1when3(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< PartialChangeFeedStreamActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 2); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 2); + + } + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageServerInterface interf; + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + PromiseStream> results; + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ReplyPromiseStream replyStream; + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version begin; + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version end; + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference feedData; + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference storageData; + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + UID debugUID; + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional* tssData; + #line 10008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Promise refresh; + #line 10009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool atLatestVersion; + #line 10010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version nextVersion; + #line 10016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version lastEmpty; + #line 10024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedStreamReply rep; + #line 10062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int resultLoc; + #line 54868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via partialChangeFeedStream() + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class PartialChangeFeedStreamActor final : public Actor, public ActorSingleCallback< PartialChangeFeedStreamActor, 0, ChangeFeedStreamReply >, public ActorCallback< PartialChangeFeedStreamActor, 3, Void >, public ActorCallback< PartialChangeFeedStreamActor, 1, Void >, public ActorCallback< PartialChangeFeedStreamActor, 2, Void >, public FastAllocated, public PartialChangeFeedStreamActorState { + #line 54873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorSingleCallback< PartialChangeFeedStreamActor, 0, ChangeFeedStreamReply >; +friend struct ActorCallback< PartialChangeFeedStreamActor, 3, Void >; +friend struct ActorCallback< PartialChangeFeedStreamActor, 1, Void >; +friend struct ActorCallback< PartialChangeFeedStreamActor, 2, Void >; + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + PartialChangeFeedStreamActor(StorageServerInterface const& interf,PromiseStream> const& results,ReplyPromiseStream const& replyStream,Version const& begin,Version const& end,Reference const& feedData,Reference const& storageData,UID const& debugUID,Optional* const& tssData) + #line 54887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + PartialChangeFeedStreamActorState(interf, results, replyStream, begin, end, feedData, storageData, debugUID, tssData) + { + fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("partialChangeFeedStream"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorSingleCallback< PartialChangeFeedStreamActor, 0, ChangeFeedStreamReply >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< PartialChangeFeedStreamActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future partialChangeFeedStream( StorageServerInterface const& interf, PromiseStream> const& results, ReplyPromiseStream const& replyStream, Version const& begin, Version const& end, Reference const& feedData, Reference const& storageData, UID const& debugUID, Optional* const& tssData ) { + #line 9997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new PartialChangeFeedStreamActor(interf, results, replyStream, begin, end, feedData, storageData, debugUID, tssData)); + #line 54916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 10140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +void writeMutationsToCache(Reference cacheData, + Reference db, + Standalone> cacheOut, + Key rangeID, + KeyRange range, + Key tenantPrefix) { + if (!cacheData) { + return; + } + ASSERT(cacheData->active); + while (!cacheOut.empty() && cacheOut.front().version <= cacheData->latest) { + cacheOut.pop_front(); + } + if (!cacheOut.empty()) { + Key durableKey = changeFeedCacheKey(tenantPrefix, rangeID, range, cacheOut.back().version); + Value durableValue = changeFeedCacheValue(cacheOut); + db->storage->set(KeyValueRef(durableKey, durableValue)); + cacheData->latest = cacheOut.back().version; + db->uncommittedCFBytes += durableKey.size() + durableValue.size(); + if (db->uncommittedCFBytes > CLIENT_KNOBS->CHANGE_FEED_CACHE_FLUSH_BYTES) { + db->commitChangeFeedStorage->set(true); + } + } +} + + #line 54946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via mergeChangeFeedStreamInternal() + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class MergeChangeFeedStreamInternalActorState { + #line 54953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + MergeChangeFeedStreamInternalActorState(Reference const& results,Key const& rangeID,KeyRange const& range,std::vector> const& interfs,std::vector const& streams,Version* const& begin,Version const& end,UID const& mergeCursorUID,Reference const& db,Reference const& cacheData,Key const& tenantPrefix) + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : results(results), + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeID(rangeID), + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + interfs(interfs), + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + streams(streams), + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + begin(begin), + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + end(end), + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + mergeCursorUID(mergeCursorUID), + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db(db), + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cacheData(cacheData), + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantPrefix(tenantPrefix), + #line 10177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + refresh(results->refresh), + #line 10180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + mutations() + #line 54984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("mergeChangeFeedStreamInternal", reinterpret_cast(this)); + + } + ~MergeChangeFeedStreamInternalActorState() + { + fdb_probe_actor_destroy("mergeChangeFeedStreamInternal", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 10182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 54999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorStart", mergeCursorUID) .detail("StreamCount", interfs.size()) .detail("Begin", *begin) .detail("End", end); + #line 55003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = results->mutations.onEmpty(); + #line 10191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 55009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 10191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~MergeChangeFeedStreamInternalActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 10192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = delay(0); + #line 10192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 55039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 10192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 10192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = delay(0); + #line 10192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 55055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 10192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< MergeChangeFeedStreamInternalActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< MergeChangeFeedStreamInternalActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 0); + + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 10193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results->mutations.isEmpty()); + #line 10195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 55134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorGotEmpty", mergeCursorUID); + #line 55138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (*begin - 1 > results->lastReturnedVersion.get()) + #line 55142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->lastReturnedVersion.set(*begin - 1); + #line 55146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + interfNum = 0; + #line 10206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + streamsUsed = std::vector(); + #line 10208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& stream : streams ) { + #line 10209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + streamsUsed.push_back(stream); + #line 55156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + nextVersion = Version(); + #line 10213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 55162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 10193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results->mutations.isEmpty()); + #line 10195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 55173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorGotEmpty", mergeCursorUID); + #line 55177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (*begin - 1 > results->lastReturnedVersion.get()) + #line 55181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->lastReturnedVersion.set(*begin - 1); + #line 55185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + interfNum = 0; + #line 10206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + streamsUsed = std::vector(); + #line 10208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& stream : streams ) { + #line 10209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + streamsUsed.push_back(stream); + #line 55195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + nextVersion = Version(); + #line 10213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 55201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< MergeChangeFeedStreamInternalActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< MergeChangeFeedStreamInternalActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 1); + + } + int a_body1cont3loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont3loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1(int loopDepth) + { + #line 10215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + interfNum = 0; + #line 10216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 55282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3loopBody1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1cont1(int loopDepth) + { + #line 10229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (mutations.empty()) + #line 55291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(end_of_stream(), std::max(0, loopDepth - 1)); + #line 55295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + streamsUsed.clear(); + #line 10236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = delay(0); + #line 10236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 55303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 10236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3loopBody1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont3loopBody1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1loopBody1(int loopDepth) + { + #line 10216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!(interfNum < streamsUsed.size())) + #line 55324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1cont3loopBody1break1(loopDepth==0?0:loopDepth-1); // break + } + try { + #line 10218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + FutureStream> __when_expr_2 = streamsUsed[interfNum].results.getFuture(); + #line 10218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 55333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont3loopBody1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3loopBody1loopBody1when1(__when_expr_2.pop(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 10218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 55338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont3loopBody1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont3loopBody1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3loopBody1break1(int loopDepth) + { + try { + return a_body1cont3loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont3loopBody1loopBody1cont1(int loopDepth) + { + #line 10226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + interfNum++; + #line 55366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1cont3loopBody1loopHead1(0); + + return loopDepth; + } + int a_body1cont3loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 10222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() != error_code_end_of_stream) + #line 55376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 2)); + #line 55380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + loopDepth = a_body1cont3loopBody1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 2)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 2)); + } + + return loopDepth; + } + int a_body1cont3loopBody1loopBody1cont3(Standalone const& res,int loopDepth) + { + #line 10219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + streamsUsed[interfNum].next = res; + #line 10220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + mutations.push(streamsUsed[interfNum]); + #line 55398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3loopBody1loopBody1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1loopBody1cont3(Standalone && res,int loopDepth) + { + #line 10219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + streamsUsed[interfNum].next = res; + #line 10220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + mutations.push(streamsUsed[interfNum]); + #line 55409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3loopBody1loopBody1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1loopBody1when1(Standalone const& res,int loopDepth) + { + loopDepth = a_body1cont3loopBody1loopBody1cont3(res, loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1loopBody1when1(Standalone && res,int loopDepth) + { + loopDepth = a_body1cont3loopBody1loopBody1cont3(std::move(res), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorSingleCallback< MergeChangeFeedStreamInternalActor, 2, Standalone >::remove(); + + } + void a_callback_fire(ActorSingleCallback< MergeChangeFeedStreamInternalActor, 2, Standalone >*,Standalone const& value) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3loopBody1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1cont3loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorSingleCallback< MergeChangeFeedStreamInternalActor, 2, Standalone >*,Standalone && value) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3loopBody1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont3loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorSingleCallback< MergeChangeFeedStreamInternalActor, 2, Standalone >*,Error err) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3loopBody1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont3loopBody1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 2); + + } + int a_body1cont3loopBody1loopBody1cont5(int loopDepth) + { + try { + loopDepth = a_body1cont3loopBody1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 2)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 2)); + } + + return loopDepth; + } + int a_body1cont3loopBody1cont2(Void const& _,int loopDepth) + { + #line 10239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone> nextOut; + #line 10240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + nextVersion = mutations.top().next.version; + #line 10242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + streamsUsed.push_back(mutations.top()); + #line 10243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + nextOut.push_back_deep(nextOut.arena(), mutations.top().next); + #line 10244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + mutations.pop(); + #line 10247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(;!mutations.empty() && mutations.top().next.version == nextVersion;) { + #line 10248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (mutations.top().next.mutations.size() && mutations.top().next.mutations.front().param1 != lastEpochEndPrivateKey) + #line 55506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + nextOut.back().mutations.append_deep( nextOut.arena(), mutations.top().next.mutations.begin(), mutations.top().next.mutations.size()); + #line 55510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + streamsUsed.push_back(mutations.top()); + #line 10254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + mutations.pop(); + #line 55516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(nextOut.size() == 1); + #line 10258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(nextVersion >= *begin); + #line 10260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + *begin = nextVersion + 1; + #line 10262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 55526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorSending", mergeCursorUID) .detail("Count", streamsUsed.size()) .detail("Version", nextVersion); + #line 55530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (nextOut.back().mutations.empty()) + #line 55534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results->mutations.isEmpty()); + #line 55538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3loopBody1cont4(loopDepth); + } + else + { + #line 10272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(nextOut.back().version > results->lastReturnedVersion.get()); + #line 10273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + writeMutationsToCache(cacheData, db, nextOut, rangeID, range, tenantPrefix); + #line 10274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->mutations.send(nextOut); + #line 10275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = results->mutations.onEmpty(); + #line 10275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 55553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 10275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + + return loopDepth; + } + int a_body1cont3loopBody1cont2(Void && _,int loopDepth) + { + #line 10239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone> nextOut; + #line 10240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + nextVersion = mutations.top().next.version; + #line 10242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + streamsUsed.push_back(mutations.top()); + #line 10243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + nextOut.push_back_deep(nextOut.arena(), mutations.top().next); + #line 10244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + mutations.pop(); + #line 10247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(;!mutations.empty() && mutations.top().next.version == nextVersion;) { + #line 10248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (mutations.top().next.mutations.size() && mutations.top().next.mutations.front().param1 != lastEpochEndPrivateKey) + #line 55580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + nextOut.back().mutations.append_deep( nextOut.arena(), mutations.top().next.mutations.begin(), mutations.top().next.mutations.size()); + #line 55584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + streamsUsed.push_back(mutations.top()); + #line 10254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + mutations.pop(); + #line 55590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(nextOut.size() == 1); + #line 10258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(nextVersion >= *begin); + #line 10260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + *begin = nextVersion + 1; + #line 10262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 55600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorSending", mergeCursorUID) .detail("Count", streamsUsed.size()) .detail("Version", nextVersion); + #line 55604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (nextOut.back().mutations.empty()) + #line 55608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results->mutations.isEmpty()); + #line 55612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3loopBody1cont4(loopDepth); + } + else + { + #line 10272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(nextOut.back().version > results->lastReturnedVersion.get()); + #line 10273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + writeMutationsToCache(cacheData, db, nextOut, rangeID, range, tenantPrefix); + #line 10274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->mutations.send(nextOut); + #line 10275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = results->mutations.onEmpty(); + #line 10275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 55627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 10275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + + return loopDepth; + } + int a_body1cont3loopBody1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< MergeChangeFeedStreamInternalActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont3loopBody1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont3loopBody1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< MergeChangeFeedStreamInternalActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 3); + + } + int a_body1cont3loopBody1cont4(int loopDepth) + { + #line 10279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (nextVersion > results->lastReturnedVersion.get()) + #line 55705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->lastReturnedVersion.set(nextVersion); + #line 55709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + if (loopDepth == 0) return a_body1cont3loopHead1(0); + + return loopDepth; + } + int a_body1cont3loopBody1cont9(Void const& _,int loopDepth) + { + #line 10276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_5 = delay(0); + #line 10276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 55721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont9when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 10276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3loopBody1cont9(Void && _,int loopDepth) + { + #line 10276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_5 = delay(0); + #line 10276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 55737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont9when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 10276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 55742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont9(_, loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont9(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< MergeChangeFeedStreamInternalActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont3loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont3loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< MergeChangeFeedStreamInternalActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 4); + + } + int a_body1cont3loopBody1cont10(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1cont10(Void && _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1cont9when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont10(_, loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1cont9when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont10(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< MergeChangeFeedStreamInternalActor, 5, Void >::remove(); + + } + void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont3loopBody1cont9when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 5, Void >*,Void && value) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont3loopBody1cont9when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< MergeChangeFeedStreamInternalActor, 5, Void >*,Error err) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 5); + + } + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference results; + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key rangeID; + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> interfs; + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector streams; + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version* begin; + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version end; + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + UID mergeCursorUID; + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference db; + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference cacheData; + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key tenantPrefix; + #line 10177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Promise refresh; + #line 10180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::priority_queue> mutations; + #line 10204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int interfNum; + #line 10206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector streamsUsed; + #line 10212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version nextVersion; + #line 55917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via mergeChangeFeedStreamInternal() + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class MergeChangeFeedStreamInternalActor final : public Actor, public ActorCallback< MergeChangeFeedStreamInternalActor, 0, Void >, public ActorCallback< MergeChangeFeedStreamInternalActor, 1, Void >, public ActorSingleCallback< MergeChangeFeedStreamInternalActor, 2, Standalone >, public ActorCallback< MergeChangeFeedStreamInternalActor, 3, Void >, public ActorCallback< MergeChangeFeedStreamInternalActor, 4, Void >, public ActorCallback< MergeChangeFeedStreamInternalActor, 5, Void >, public FastAllocated, public MergeChangeFeedStreamInternalActorState { + #line 55922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< MergeChangeFeedStreamInternalActor, 0, Void >; +friend struct ActorCallback< MergeChangeFeedStreamInternalActor, 1, Void >; +friend struct ActorSingleCallback< MergeChangeFeedStreamInternalActor, 2, Standalone >; +friend struct ActorCallback< MergeChangeFeedStreamInternalActor, 3, Void >; +friend struct ActorCallback< MergeChangeFeedStreamInternalActor, 4, Void >; +friend struct ActorCallback< MergeChangeFeedStreamInternalActor, 5, Void >; + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + MergeChangeFeedStreamInternalActor(Reference const& results,Key const& rangeID,KeyRange const& range,std::vector> const& interfs,std::vector const& streams,Version* const& begin,Version const& end,UID const& mergeCursorUID,Reference const& db,Reference const& cacheData,Key const& tenantPrefix) + #line 55938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + MergeChangeFeedStreamInternalActorState(results, rangeID, range, interfs, streams, begin, end, mergeCursorUID, db, cacheData, tenantPrefix) + { + fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("mergeChangeFeedStreamInternal"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< MergeChangeFeedStreamInternalActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< MergeChangeFeedStreamInternalActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorSingleCallback< MergeChangeFeedStreamInternalActor, 2, Standalone >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< MergeChangeFeedStreamInternalActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< MergeChangeFeedStreamInternalActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< MergeChangeFeedStreamInternalActor, 5, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future mergeChangeFeedStreamInternal( Reference const& results, Key const& rangeID, KeyRange const& range, std::vector> const& interfs, std::vector const& streams, Version* const& begin, Version const& end, UID const& mergeCursorUID, Reference const& db, Reference const& cacheData, Key const& tenantPrefix ) { + #line 10166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new MergeChangeFeedStreamInternalActor(results, rangeID, range, interfs, streams, begin, end, mergeCursorUID, db, cacheData, tenantPrefix)); + #line 55971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 10284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 55976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via mergeChangeFeedStream() + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class MergeChangeFeedStreamActorState { + #line 55983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + MergeChangeFeedStreamActorState(Reference const& db,std::vector> const& interfs,Reference const& results,Key const& rangeID,KeyRange const& range,Version* const& begin,Version const& end,int const& replyBufferSize,bool const& canReadPopped,ReadOptions const& readOptions,bool const& encrypted,Reference const& cacheData,Key const& tenantPrefix) + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db), + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + interfs(interfs), + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results(results), + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeID(rangeID), + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + begin(begin), + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + end(end), + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + replyBufferSize(replyBufferSize), + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + canReadPopped(canReadPopped), + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + readOptions(readOptions), + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + encrypted(encrypted), + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cacheData(cacheData), + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantPrefix(tenantPrefix), + #line 10298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fetchers(interfs.size()), + #line 10299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + onErrors(interfs.size()), + #line 10300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + streams(interfs.size()), + #line 10301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssDatas() + #line 56022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("mergeChangeFeedStream", reinterpret_cast(this)); + + } + ~MergeChangeFeedStreamActorState() + { + fdb_probe_actor_destroy("mergeChangeFeedStream", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 10302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssDatas.reserve(interfs.size()); + #line 10303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < interfs.size();i++) { + #line 10304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssDatas.push_back({}); + #line 56041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(interfs.size() > 10, "Large change feed merge cursor"); + #line 10308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(interfs.size() > 100, "Very large change feed merge cursor"); + #line 10310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + mergeCursorUID = UID(); + #line 10311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + debugUIDs = std::vector(); + #line 10312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->streams.clear(); + #line 10313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < interfs.size();i++) { + #line 10314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedStreamRequest req; + #line 10315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.rangeID = rangeID; + #line 10316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.begin = *begin; + #line 10317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.end = end; + #line 10318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.range = interfs[i].second; + #line 10319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.canReadPopped = canReadPopped; + #line 10321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.replyBufferSize = replyBufferSize / interfs.size(); + #line 10322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (replyBufferSize != -1 && req.replyBufferSize < CLIENT_KNOBS->CHANGE_FEED_STREAM_MIN_BYTES) + #line 56071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.replyBufferSize = CLIENT_KNOBS->CHANGE_FEED_STREAM_MIN_BYTES; + #line 56075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.options = readOptions; + #line 10326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.id = deterministicRandom()->randomUniqueID(); + #line 10327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.encrypted = encrypted; + #line 10329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + debugUIDs.push_back(req.id); + #line 10330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + mergeCursorUID = UID(mergeCursorUID.first() ^ req.id.first(), mergeCursorUID.second() ^ req.id.second()); + #line 10332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->streams.push_back(interfs[i].first.changeFeedStream.getReplyStream(req)); + #line 10333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + maybeDuplicateTSSChangeFeedStream(req, interfs[i].first.changeFeedStream, db->enableLocalityLoadBalance ? &db->queueModel : nullptr, &tssDatas[i]); + #line 56091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->maxSeenVersion = invalidVersion; + #line 10340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->storageData.clear(); + #line 10341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Promise refresh = results->refresh; + #line 10342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->refresh = Promise(); + #line 10343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < interfs.size();i++) { + #line 10344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->storageData.push_back(db->getStorageData(interfs[i].first)); + #line 56105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->notAtLatest.set(interfs.size()); + #line 10347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (results->context) + #line 56111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->context->notAtLatestChangeFeeds[results->dbgid] = results.getPtr(); + #line 10349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->created = now(); + #line 56117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + refresh.send(Void()); + #line 10353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < interfs.size();i++) { + #line 10354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 56125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorInit", debugUIDs[i]) .detail("CursorDebugUID", mergeCursorUID) .detail("Idx", i) .detail("FeedID", rangeID) .detail("MergeRange", KeyRangeRef(interfs.front().second.begin, interfs.back().second.end)) .detail("PartialRange", interfs[i].second) .detail("Begin", *begin) .detail("End", end) .detail("CanReadPopped", canReadPopped); + #line 56129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + onErrors[i] = results->streams[i].onError(); + #line 10366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fetchers[i] = partialChangeFeedStream(interfs[i].first, streams[i].results, results->streams[i], *begin, end, results, results->storageData[i], debugUIDs[i], &tssDatas[i]); + #line 56135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = waitForAny(onErrors) || mergeChangeFeedStreamInternal( results, rangeID, range, interfs, streams, begin, end, mergeCursorUID, db, cacheData, tenantPrefix); + #line 10377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 56141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 10377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 56146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~MergeChangeFeedStreamActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 10381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~MergeChangeFeedStreamActorState(); static_cast(this)->destroy(); return 0; } + #line 56169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~MergeChangeFeedStreamActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 10381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~MergeChangeFeedStreamActorState(); static_cast(this)->destroy(); return 0; } + #line 56181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~MergeChangeFeedStreamActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< MergeChangeFeedStreamActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< MergeChangeFeedStreamActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("mergeChangeFeedStream", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStream", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< MergeChangeFeedStreamActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("mergeChangeFeedStream", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStream", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< MergeChangeFeedStreamActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("mergeChangeFeedStream", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("mergeChangeFeedStream", reinterpret_cast(this), 0); + + } + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference db; + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> interfs; + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference results; + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key rangeID; + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version* begin; + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version end; + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int replyBufferSize; + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool canReadPopped; + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ReadOptions readOptions; + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool encrypted; + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference cacheData; + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key tenantPrefix; + #line 10298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> fetchers; + #line 10299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> onErrors; + #line 10300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector streams; + #line 10301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> tssDatas; + #line 10310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + UID mergeCursorUID; + #line 10311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector debugUIDs; + #line 56290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via mergeChangeFeedStream() + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class MergeChangeFeedStreamActor final : public Actor, public ActorCallback< MergeChangeFeedStreamActor, 0, Void >, public FastAllocated, public MergeChangeFeedStreamActorState { + #line 56295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< MergeChangeFeedStreamActor, 0, Void >; + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + MergeChangeFeedStreamActor(Reference const& db,std::vector> const& interfs,Reference const& results,Key const& rangeID,KeyRange const& range,Version* const& begin,Version const& end,int const& replyBufferSize,bool const& canReadPopped,ReadOptions const& readOptions,bool const& encrypted,Reference const& cacheData,Key const& tenantPrefix) + #line 56306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + MergeChangeFeedStreamActorState(db, interfs, results, rangeID, range, begin, end, replyBufferSize, canReadPopped, readOptions, encrypted, cacheData, tenantPrefix) + { + fdb_probe_actor_enter("mergeChangeFeedStream", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("mergeChangeFeedStream"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("mergeChangeFeedStream", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< MergeChangeFeedStreamActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future mergeChangeFeedStream( Reference const& db, std::vector> const& interfs, Reference const& results, Key const& rangeID, KeyRange const& range, Version* const& begin, Version const& end, int const& replyBufferSize, bool const& canReadPopped, ReadOptions const& readOptions, bool const& encrypted, Reference const& cacheData, Key const& tenantPrefix ) { + #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new MergeChangeFeedStreamActor(db, interfs, results, rangeID, range, begin, end, replyBufferSize, canReadPopped, readOptions, encrypted, cacheData, tenantPrefix)); + #line 56334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 10383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 56339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via getChangeFeedRange() + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetChangeFeedRangeActorState { + #line 56346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetChangeFeedRangeActorState(Reference const& db,Database const& cx,Key const& rangeID,Version const& begin = 0) + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db), + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx(cx), + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeID(rangeID), + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + begin(begin), + #line 10385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr(cx), + #line 10386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeIDKey(rangeID.withPrefix(changeFeedPrefix)) + #line 56363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("getChangeFeedRange", reinterpret_cast(this)); + + } + ~GetChangeFeedRangeActorState() + { + fdb_probe_actor_destroy("getChangeFeedRange", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 10388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto cacheLoc = db->changeFeedCache.find(rangeID); + #line 10389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (cacheLoc != db->changeFeedCache.end()) + #line 56380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(cacheLoc->second); this->~GetChangeFeedRangeActorState(); static_cast(this)->destroy(); return 0; } + #line 56384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< KeyRange >::value()) KeyRange(cacheLoc->second); + this->~GetChangeFeedRangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 10393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 56392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetChangeFeedRangeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 10395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 10396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 10397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 10398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = tr.getReadVersion(); + #line 10398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 56431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 10398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 56436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 10421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = tr.onError(e); + #line 10421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 56460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 10421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 56465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Version const& readVer,int loopDepth) + { + #line 10399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (readVer < begin) + #line 56480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY); + #line 10400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 56486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 10400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 56491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 10403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_2 = tr.get(rangeIDKey); + #line 10403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 56500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 10403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 56505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + + return loopDepth; + } + int a_body1loopBody1cont2(Version && readVer,int loopDepth) + { + #line 10399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (readVer < begin) + #line 56515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY); + #line 10400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 56521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 10400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 56526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 10403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_2 = tr.get(rangeIDKey); + #line 10403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 56535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 10403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 56540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + + return loopDepth; + } + int a_body1loopBody1when1(Version const& readVer,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(readVer, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Version && readVer,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(readVer), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetChangeFeedRangeActor, 0, Version >::remove(); + + } + void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 0, Version >*,Version const& value) + { + fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 0, Version >*,Version && value) + { + fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetChangeFeedRangeActor, 0, Version >*,Error err) + { + fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(int loopDepth) + { + loopDepth = a_body1loopBody1cont10(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(Void const& _,int loopDepth) + { + #line 10401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.reset(); + #line 56619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + #line 10401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.reset(); + #line 56628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetChangeFeedRangeActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetChangeFeedRangeActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont6(Optional const& val,int loopDepth) + { + #line 10404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!val.present()) + #line 56700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(tr.getReadVersion().isReady()); + #line 10406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "ChangeFeedNotRegisteredGet") .detail("FeedID", rangeID) .detail("FullFeedKey", rangeIDKey) .detail("BeginVersion", begin) .detail("ReadVersion", tr.getReadVersion().get()); + #line 10411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1loopBody1Catch1(change_feed_not_registered(), loopDepth); + #line 56708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (db->changeFeedCache.size() > CLIENT_KNOBS->CHANGE_FEED_CACHE_SIZE) + #line 56712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->changeFeedCache.clear(); + #line 56716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range = std::get<0>(decodeChangeFeedValue(val.get())); + #line 10417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->changeFeedCache[rangeID] = range; + #line 10418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(range); this->~GetChangeFeedRangeActorState(); static_cast(this)->destroy(); return 0; } + #line 56724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< KeyRange >::value()) KeyRange(range); + this->~GetChangeFeedRangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont6(Optional && val,int loopDepth) + { + #line 10404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!val.present()) + #line 56736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(tr.getReadVersion().isReady()); + #line 10406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "ChangeFeedNotRegisteredGet") .detail("FeedID", rangeID) .detail("FullFeedKey", rangeIDKey) .detail("BeginVersion", begin) .detail("ReadVersion", tr.getReadVersion().get()); + #line 10411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1loopBody1Catch1(change_feed_not_registered(), loopDepth); + #line 56744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (db->changeFeedCache.size() > CLIENT_KNOBS->CHANGE_FEED_CACHE_SIZE) + #line 56748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->changeFeedCache.clear(); + #line 56752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range = std::get<0>(decodeChangeFeedValue(val.get())); + #line 10417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->changeFeedCache[rangeID] = range; + #line 10418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(range); this->~GetChangeFeedRangeActorState(); static_cast(this)->destroy(); return 0; } + #line 56760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< KeyRange >::value()) KeyRange(range); + this->~GetChangeFeedRangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont2when2(Optional const& val,int loopDepth) + { + loopDepth = a_body1loopBody1cont6(val, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when2(Optional && val,int loopDepth) + { + loopDepth = a_body1loopBody1cont6(std::move(val), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetChangeFeedRangeActor, 2, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 2, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont2when2(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 2, Optional >*,Optional && value) + { + fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont2when2(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< GetChangeFeedRangeActor, 2, Optional >*,Error err) + { + fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 2); + + } + int a_body1loopBody1cont10(int loopDepth) + { + try { + loopDepth = a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetChangeFeedRangeActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< GetChangeFeedRangeActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 3); + + } + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference db; + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database cx; + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key rangeID; + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version begin; + #line 10385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Transaction tr; + #line 10386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key rangeIDKey; + #line 56931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via getChangeFeedRange() + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetChangeFeedRangeActor final : public Actor, public ActorCallback< GetChangeFeedRangeActor, 0, Version >, public ActorCallback< GetChangeFeedRangeActor, 1, Void >, public ActorCallback< GetChangeFeedRangeActor, 2, Optional >, public ActorCallback< GetChangeFeedRangeActor, 3, Void >, public FastAllocated, public GetChangeFeedRangeActorState { + #line 56936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetChangeFeedRangeActor, 0, Version >; +friend struct ActorCallback< GetChangeFeedRangeActor, 1, Void >; +friend struct ActorCallback< GetChangeFeedRangeActor, 2, Optional >; +friend struct ActorCallback< GetChangeFeedRangeActor, 3, Void >; + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetChangeFeedRangeActor(Reference const& db,Database const& cx,Key const& rangeID,Version const& begin = 0) + #line 56950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + GetChangeFeedRangeActorState(db, cx, rangeID, begin) + { + fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getChangeFeedRange"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetChangeFeedRangeActor, 0, Version >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetChangeFeedRangeActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetChangeFeedRangeActor, 2, Optional >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< GetChangeFeedRangeActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getChangeFeedRange( Reference const& db, Database const& cx, Key const& rangeID, Version const& begin = 0 ) { + #line 10384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetChangeFeedRangeActor(db, cx, rangeID, begin)); + #line 56981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 10425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 56986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via singleChangeFeedStreamInternal() + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SingleChangeFeedStreamInternalActorState { + #line 56993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SingleChangeFeedStreamInternalActorState(KeyRange const& range,Reference const& results,Key const& rangeID,Version* const& begin,Version const& end,Optional* const& tssData,Reference const& db,Reference const& cacheData,Key const& tenantPrefix) + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : range(range), + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results(results), + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeID(rangeID), + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + begin(begin), + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + end(end), + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssData(tssData), + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db(db), + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cacheData(cacheData), + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantPrefix(tenantPrefix), + #line 10436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + refresh(results->refresh) + #line 57018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("singleChangeFeedStreamInternal", reinterpret_cast(this)); + + } + ~SingleChangeFeedStreamInternalActorState() + { + fdb_probe_actor_destroy("singleChangeFeedStreamInternal", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 10437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results->streams.size() == 1); + #line 10438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results->storageData.size() == 1); + #line 10439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + atLatest = false; + #line 10442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = results->mutations.onEmpty(); + #line 10442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 57041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 10442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~SingleChangeFeedStreamInternalActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 10443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = delay(0); + #line 10443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 57071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 10443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 10443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = delay(0); + #line 10443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 57087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 10443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SingleChangeFeedStreamInternalActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< SingleChangeFeedStreamInternalActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 10444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results->mutations.isEmpty()); + #line 10446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (*begin - 1 > results->lastReturnedVersion.get()) + #line 57166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->lastReturnedVersion.set(*begin - 1); + #line 10448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!refresh.canBeSet()) + #line 57172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + try { + #line 10451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = Future(Void()); + #line 10451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont2Catch1(actor_cancelled(), loopDepth); + #line 57179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont2Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 10451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont2Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont2Catch1(unknown_error(), loopDepth); + } + } + else + { + loopDepth = a_body1cont4(loopDepth); + } + } + else + { + loopDepth = a_body1cont3(loopDepth); + } + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 10444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(results->mutations.isEmpty()); + #line 10446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (*begin - 1 > results->lastReturnedVersion.get()) + #line 57211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->lastReturnedVersion.set(*begin - 1); + #line 10448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!refresh.canBeSet()) + #line 57217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + try { + #line 10451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = Future(Void()); + #line 10451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont2Catch1(actor_cancelled(), loopDepth); + #line 57224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont2Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 10451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont2Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont2Catch1(unknown_error(), loopDepth); + } + } + else + { + loopDepth = a_body1cont4(loopDepth); + } + } + else + { + loopDepth = a_body1cont3(loopDepth); + } + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SingleChangeFeedStreamInternalActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< SingleChangeFeedStreamInternalActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 1); + + } + int a_body1cont3(int loopDepth) + { + #line 10461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 57317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont4(int loopDepth) + { + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1cont5(int loopDepth) + { + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont2Catch1(const Error& e,int loopDepth=0) + { + try { + #line 10455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(e.code() == error_code_actor_cancelled); + #line 10456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 57341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont6(Void const& _,int loopDepth) + { + #line 10453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(false); + #line 57355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont8(loopDepth); + + return loopDepth; + } + int a_body1cont6(Void && _,int loopDepth) + { + #line 10453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(false); + #line 57364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont8(loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont6(_, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont6(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SingleChangeFeedStreamInternalActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1cont2Catch1(error, 0); + } catch (...) { + a_body1cont2Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont2Catch1(error, 0); + } catch (...) { + a_body1cont2Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< SingleChangeFeedStreamInternalActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2Catch1(err, 0); + } + catch (Error& error) { + a_body1cont2Catch1(error, 0); + } catch (...) { + a_body1cont2Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 2); + + } + int a_body1cont8(int loopDepth) + { + try { + loopDepth = a_body1cont5(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont3loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1(int loopDepth) + { + #line 10462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(refresh.canBeSet()); + #line 10463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + FutureStream __when_expr_3 = results->streams[0].getFuture(); + #line 10463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 57460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1when1(__when_expr_3.pop(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 10463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3loopBody1cont1(int loopDepth) + { + #line 10464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + *begin = feedReply.mutations.back().version + 1; + #line 10466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (feedReply.popVersion > results->popVersion) + #line 57476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->popVersion = feedReply.popVersion; + #line 57480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (tssData->present()) + #line 57484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssData->get().updatePopped(feedReply.popVersion); + #line 57488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool anyMutations = false; + #line 10475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : feedReply.mutations ) { + #line 10476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!it.mutations.empty()) + #line 57496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + anyMutations = true; + #line 57500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + break; + } + } + #line 10481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (anyMutations) + #line 57506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(feedReply.mutations.front().version > results->lastReturnedVersion.get()); + #line 10486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (tssData->present()) + #line 57512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssData->get().send(feedReply); + #line 57516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + writeMutationsToCache(cacheData, db, feedReply.mutations, rangeID, range, tenantPrefix); + #line 10491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->mutations.send( Standalone>(feedReply.mutations, feedReply.arena)); + #line 10495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = results->mutations.onEmpty(); + #line 10495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 57526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 10495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont3loopBody1cont2(loopDepth); + } + + return loopDepth; + } + int a_body1cont3loopBody1when1(ChangeFeedStreamReply const& __feedReply,int loopDepth) + { + #line 10463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + feedReply = __feedReply; + #line 57545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1when1(ChangeFeedStreamReply && __feedReply,int loopDepth) + { + feedReply = std::move(__feedReply); + loopDepth = a_body1cont3loopBody1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorSingleCallback< SingleChangeFeedStreamInternalActor, 3, ChangeFeedStreamReply >::remove(); + + } + void a_callback_fire(ActorSingleCallback< SingleChangeFeedStreamInternalActor, 3, ChangeFeedStreamReply >*,ChangeFeedStreamReply const& value) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont3loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorSingleCallback< SingleChangeFeedStreamInternalActor, 3, ChangeFeedStreamReply >*,ChangeFeedStreamReply && value) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont3loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorSingleCallback< SingleChangeFeedStreamInternalActor, 3, ChangeFeedStreamReply >*,Error err) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 3); + + } + int a_body1cont3loopBody1cont2(int loopDepth) + { + #line 10501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (feedReply.mutations.back().version > results->lastReturnedVersion.get()) + #line 57612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->lastReturnedVersion.set(feedReply.mutations.back().version); + #line 57616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!refresh.canBeSet()) + #line 57620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + try { + #line 10508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_6 = Future(Void()); + #line 10508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1cont2Catch1(actor_cancelled(), loopDepth); + #line 57627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont3loopBody1cont2Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont3loopBody1cont2when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 10508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont3loopBody1cont2Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont3loopBody1cont2Catch1(unknown_error(), loopDepth); + } + } + else + { + loopDepth = a_body1cont3loopBody1cont10(loopDepth); + } + + return loopDepth; + } + int a_body1cont3loopBody1cont7(Void const& _,int loopDepth) + { + #line 10496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_5 = delay(0); + #line 10496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 57654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont7when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 10496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3loopBody1cont7(Void && _,int loopDepth) + { + #line 10496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_5 = delay(0); + #line 10496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 57670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont7when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 10496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3loopBody1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont7(_, loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont7(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SingleChangeFeedStreamInternalActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont3loopBody1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont3loopBody1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< SingleChangeFeedStreamInternalActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 4); + + } + int a_body1cont3loopBody1cont9(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1cont9(Void && _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1cont7when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont9(_, loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1cont7when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont9(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SingleChangeFeedStreamInternalActor, 5, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont3loopBody1cont7when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 5, Void >*,Void && value) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont3loopBody1cont7when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< SingleChangeFeedStreamInternalActor, 5, Void >*,Error err) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 5); + + } + int a_body1cont3loopBody1cont10(int loopDepth) + { + #line 10517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!atLatest && feedReply.atLatestVersion) + #line 57822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + atLatest = true; + #line 10519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->notAtLatest.set(0); + #line 10520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (results->context) + #line 57830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->context->notAtLatestChangeFeeds.erase(results->dbgid); + #line 57834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 10525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (feedReply.minStreamVersion > results->storageData[0]->version.get()) + #line 57839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->storageData[0]->version.set(feedReply.minStreamVersion); + #line 57843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + if (loopDepth == 0) return a_body1cont3loopHead1(0); + + return loopDepth; + } + int a_body1cont3loopBody1cont12(int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont10(loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1cont2Catch1(const Error& e,int loopDepth=0) + { + try { + #line 10512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(e.code() == error_code_actor_cancelled); + #line 10513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 57862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont3loopBody1cont13(Void const& _,int loopDepth) + { + #line 10510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(false); + #line 57876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3loopBody1cont13cont2(loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1cont13(Void && _,int loopDepth) + { + #line 10510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(false); + #line 57885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont3loopBody1cont13cont2(loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont13(_, loopDepth); + + return loopDepth; + } + int a_body1cont3loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3loopBody1cont13(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose7() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SingleChangeFeedStreamInternalActor, 6, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 6, Void >*,Void const& value) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1cont3loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1cont3loopBody1cont2Catch1(error, 0); + } catch (...) { + a_body1cont3loopBody1cont2Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 6); + + } + void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 6, Void >*,Void && value) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1cont3loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont3loopBody1cont2Catch1(error, 0); + } catch (...) { + a_body1cont3loopBody1cont2Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 6); + + } + void a_callback_error(ActorCallback< SingleChangeFeedStreamInternalActor, 6, Void >*,Error err) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1cont3loopBody1cont2Catch1(err, 0); + } + catch (Error& error) { + a_body1cont3loopBody1cont2Catch1(error, 0); + } catch (...) { + a_body1cont3loopBody1cont2Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 6); + + } + int a_body1cont3loopBody1cont13cont2(int loopDepth) + { + try { + loopDepth = a_body1cont3loopBody1cont12(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference results; + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key rangeID; + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version* begin; + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version end; + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional* tssData; + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference db; + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference cacheData; + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key tenantPrefix; + #line 10436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Promise refresh; + #line 10439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool atLatest; + #line 10463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedStreamReply feedReply; + #line 57990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via singleChangeFeedStreamInternal() + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SingleChangeFeedStreamInternalActor final : public Actor, public ActorCallback< SingleChangeFeedStreamInternalActor, 0, Void >, public ActorCallback< SingleChangeFeedStreamInternalActor, 1, Void >, public ActorCallback< SingleChangeFeedStreamInternalActor, 2, Void >, public ActorSingleCallback< SingleChangeFeedStreamInternalActor, 3, ChangeFeedStreamReply >, public ActorCallback< SingleChangeFeedStreamInternalActor, 4, Void >, public ActorCallback< SingleChangeFeedStreamInternalActor, 5, Void >, public ActorCallback< SingleChangeFeedStreamInternalActor, 6, Void >, public FastAllocated, public SingleChangeFeedStreamInternalActorState { + #line 57995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< SingleChangeFeedStreamInternalActor, 0, Void >; +friend struct ActorCallback< SingleChangeFeedStreamInternalActor, 1, Void >; +friend struct ActorCallback< SingleChangeFeedStreamInternalActor, 2, Void >; +friend struct ActorSingleCallback< SingleChangeFeedStreamInternalActor, 3, ChangeFeedStreamReply >; +friend struct ActorCallback< SingleChangeFeedStreamInternalActor, 4, Void >; +friend struct ActorCallback< SingleChangeFeedStreamInternalActor, 5, Void >; +friend struct ActorCallback< SingleChangeFeedStreamInternalActor, 6, Void >; + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SingleChangeFeedStreamInternalActor(KeyRange const& range,Reference const& results,Key const& rangeID,Version* const& begin,Version const& end,Optional* const& tssData,Reference const& db,Reference const& cacheData,Key const& tenantPrefix) + #line 58012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + SingleChangeFeedStreamInternalActorState(range, results, rangeID, begin, end, tssData, db, cacheData, tenantPrefix) + { + fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("singleChangeFeedStreamInternal"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< SingleChangeFeedStreamInternalActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< SingleChangeFeedStreamInternalActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< SingleChangeFeedStreamInternalActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorSingleCallback< SingleChangeFeedStreamInternalActor, 3, ChangeFeedStreamReply >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< SingleChangeFeedStreamInternalActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< SingleChangeFeedStreamInternalActor, 5, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< SingleChangeFeedStreamInternalActor, 6, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future singleChangeFeedStreamInternal( KeyRange const& range, Reference const& results, Key const& rangeID, Version* const& begin, Version const& end, Optional* const& tssData, Reference const& db, Reference const& cacheData, Key const& tenantPrefix ) { + #line 10426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new SingleChangeFeedStreamInternalActor(range, results, rangeID, begin, end, tssData, db, cacheData, tenantPrefix)); + #line 58046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 10530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 58051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via singleChangeFeedStream() + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SingleChangeFeedStreamActorState { + #line 58058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SingleChangeFeedStreamActorState(Reference const& db,StorageServerInterface const& interf,KeyRange const& range,Reference const& results,Key const& rangeID,Version* const& begin,Version const& end,int const& replyBufferSize,bool const& canReadPopped,ReadOptions const& readOptions,bool const& encrypted,Reference const& cacheData,Key const& tenantPrefix) + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db), + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + interf(interf), + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results(results), + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeID(rangeID), + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + begin(begin), + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + end(end), + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + replyBufferSize(replyBufferSize), + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + canReadPopped(canReadPopped), + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + readOptions(readOptions), + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + encrypted(encrypted), + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cacheData(cacheData), + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantPrefix(tenantPrefix), + #line 10544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx(db), + #line 10545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req(), + #line 10546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tssData() + #line 58095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("singleChangeFeedStream", reinterpret_cast(this)); + + } + ~SingleChangeFeedStreamActorState() + { + fdb_probe_actor_destroy("singleChangeFeedStream", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 10547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.rangeID = rangeID; + #line 10548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.begin = *begin; + #line 10549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.end = end; + #line 10550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.range = range; + #line 10551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.canReadPopped = canReadPopped; + #line 10552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.replyBufferSize = replyBufferSize; + #line 10553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.options = readOptions; + #line 10554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.id = deterministicRandom()->randomUniqueID(); + #line 10555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.encrypted = encrypted; + #line 10557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (DEBUG_CF_CLIENT_TRACE) + #line 58128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "TraceChangeFeedClientSingleCursor", req.id) .detail("FeedID", rangeID) .detail("Range", range) .detail("Begin", *begin) .detail("End", end) .detail("CanReadPopped", canReadPopped); + #line 58132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->streams.clear(); + #line 10568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->streams.push_back(interf.changeFeedStream.getReplyStream(req)); + #line 10570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->maxSeenVersion = invalidVersion; + #line 10571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->storageData.clear(); + #line 10572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->storageData.push_back(db->getStorageData(interf)); + #line 10573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Promise refresh = results->refresh; + #line 10574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->refresh = Promise(); + #line 10575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->notAtLatest.set(1); + #line 10576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (results->context) + #line 58152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->context->notAtLatestChangeFeeds[results->dbgid] = results.getPtr(); + #line 10578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->created = now(); + #line 58158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + refresh.send(Void()); + #line 10582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + maybeDuplicateTSSChangeFeedStream( req, interf.changeFeedStream, cx->enableLocalityLoadBalance ? &cx->queueModel : nullptr, &tssData); + #line 10585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = results->streams[0].onError() || singleChangeFeedStreamInternal(range, results, rangeID, begin, end, &tssData, db, cacheData, tenantPrefix); + #line 10585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 58168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 10585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~SingleChangeFeedStreamActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 10588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SingleChangeFeedStreamActorState(); static_cast(this)->destroy(); return 0; } + #line 58196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~SingleChangeFeedStreamActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 10588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SingleChangeFeedStreamActorState(); static_cast(this)->destroy(); return 0; } + #line 58208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~SingleChangeFeedStreamActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SingleChangeFeedStreamActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SingleChangeFeedStreamActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("singleChangeFeedStream", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStream", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< SingleChangeFeedStreamActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("singleChangeFeedStream", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStream", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< SingleChangeFeedStreamActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("singleChangeFeedStream", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("singleChangeFeedStream", reinterpret_cast(this), 0); + + } + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference db; + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageServerInterface interf; + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference results; + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key rangeID; + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version* begin; + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version end; + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int replyBufferSize; + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool canReadPopped; + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ReadOptions readOptions; + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool encrypted; + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference cacheData; + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key tenantPrefix; + #line 10544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database cx; + #line 10545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedStreamRequest req; + #line 10546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional tssData; + #line 58311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via singleChangeFeedStream() + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SingleChangeFeedStreamActor final : public Actor, public ActorCallback< SingleChangeFeedStreamActor, 0, Void >, public FastAllocated, public SingleChangeFeedStreamActorState { + #line 58316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< SingleChangeFeedStreamActor, 0, Void >; + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SingleChangeFeedStreamActor(Reference const& db,StorageServerInterface const& interf,KeyRange const& range,Reference const& results,Key const& rangeID,Version* const& begin,Version const& end,int const& replyBufferSize,bool const& canReadPopped,ReadOptions const& readOptions,bool const& encrypted,Reference const& cacheData,Key const& tenantPrefix) + #line 58327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + SingleChangeFeedStreamActorState(db, interf, range, results, rangeID, begin, end, replyBufferSize, canReadPopped, readOptions, encrypted, cacheData, tenantPrefix) + { + fdb_probe_actor_enter("singleChangeFeedStream", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("singleChangeFeedStream"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("singleChangeFeedStream", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< SingleChangeFeedStreamActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future singleChangeFeedStream( Reference const& db, StorageServerInterface const& interf, KeyRange const& range, Reference const& results, Key const& rangeID, Version* const& begin, Version const& end, int const& replyBufferSize, bool const& canReadPopped, ReadOptions const& readOptions, bool const& encrypted, Reference const& cacheData, Key const& tenantPrefix ) { + #line 10531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new SingleChangeFeedStreamActor(db, interf, range, results, rangeID, begin, end, replyBufferSize, canReadPopped, readOptions, encrypted, cacheData, tenantPrefix)); + #line 58355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 10590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +void coalesceChangeFeedLocations(std::vector& locations) { + // FIXME: only coalesce if same tenant! + std::vector teamUIDs; + bool anyToCoalesce = false; + teamUIDs.reserve(locations.size()); + for (int i = 0; i < locations.size(); i++) { + ASSERT(locations[i].locations->size() > 0); + UID teamUID = locations[i].locations->getId(0); + for (int j = 1; j < locations[i].locations->size(); j++) { + UID locUID = locations[i].locations->getId(j); + teamUID = UID(teamUID.first() ^ locUID.first(), teamUID.second() ^ locUID.second()); + } + if (!teamUIDs.empty() && teamUIDs.back() == teamUID) { + anyToCoalesce = true; + } + teamUIDs.push_back(teamUID); + } + + if (!anyToCoalesce) { + return; + } + + CODE_PROBE(true, "coalescing change feed locations"); + + // FIXME: there's technically a probability of "hash" collisions here, but it's extremely low. Could validate that + // two teams with the same xor are in fact the same, or fall back to not doing this if it gets a wrong shard server + // error or something + + std::vector coalesced; + coalesced.reserve(locations.size()); + coalesced.push_back(locations[0]); + for (int i = 1; i < locations.size(); i++) { + if (teamUIDs[i] == teamUIDs[i - 1]) { + coalesced.back().range = KeyRangeRef(coalesced.back().range.begin, locations[i].range.end); + } else { + coalesced.push_back(locations[i]); + } + } + + locations = coalesced; +} + + #line 58402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via getChangeFeedStreamFromDisk() + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetChangeFeedStreamFromDiskActorState { + #line 58409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetChangeFeedStreamFromDiskActorState(Reference const& db,Reference const& results,Key const& rangeID,Version* const& begin,Version const& end,KeyRange const& range,Key const& tenantPrefix) + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db), + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results(results), + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeID(rangeID), + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + begin(begin), + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + end(end), + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantPrefix(tenantPrefix), + #line 10640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + foundEnd(false) + #line 58430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("getChangeFeedStreamFromDisk", reinterpret_cast(this)); + + } + ~GetChangeFeedStreamFromDiskActorState() + { + fdb_probe_actor_destroy("getChangeFeedStreamFromDisk", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 10641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 58445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetChangeFeedStreamFromDiskActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 10642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key beginKey = changeFeedCacheKey(tenantPrefix, rangeID, range, *begin); + #line 10643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key endKey = changeFeedCacheKey(tenantPrefix, rangeID, range, MAX_VERSION); + #line 10644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = db->storage->readRange(KeyRangeRef(beginKey, endKey), CLIENT_KNOBS->CHANGE_FEED_CACHE_LIMIT_BYTES, CLIENT_KNOBS->CHANGE_FEED_CACHE_LIMIT_BYTES); + #line 10644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 58481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 10644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + #line 10647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + idx = 0; + #line 10649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 58497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(RangeResult const& __res,int loopDepth) + { + #line 10644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + res = __res; + #line 58506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(RangeResult && __res,int loopDepth) + { + res = std::move(__res); + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetChangeFeedStreamFromDiskActor, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< GetChangeFeedStreamFromDiskActor, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("getChangeFeedStreamFromDisk", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when4(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getChangeFeedStreamFromDisk", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< ChangeFeedWhenAtLatestActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetChangeFeedStreamFromDiskActor, 0, RangeResult >*,RangeResult && value) { - fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 3); + fdb_probe_actor_enter("getChangeFeedStreamFromDisk", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when4(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getChangeFeedStreamFromDisk", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< ChangeFeedWhenAtLatestActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< GetChangeFeedStreamFromDiskActor, 0, RangeResult >*,Error err) { - fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), 3); + fdb_probe_actor_enter("getChangeFeedStreamFromDisk", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -45380,855 +58563,1467 @@ class ChangeFeedWhenAtLatestActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getChangeFeedStreamFromDisk", reinterpret_cast(this), 0); } - #line 8613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference self; - #line 8613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 8620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future lastReturned; - #line 45392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + int a_body1loopBody1cont2(int loopDepth) + { + #line 10671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (foundEnd || !res.more) + #line 58573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(foundEnd); this->~GetChangeFeedStreamFromDiskActorState(); static_cast(this)->destroy(); return 0; } + #line 58577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(std::move(foundEnd)); // state_var_RVO + this->~GetChangeFeedStreamFromDiskActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1cont1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1loopBody1(int loopDepth) + { + #line 10649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!(!foundEnd && idx < res.size())) + #line 58598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 10650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone> mutations = decodeChangeFeedCacheValue(res[idx].value); + #line 10651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(;!mutations.empty() && mutations.front().version < *begin;) { + #line 10652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + mutations.pop_front(); + #line 58608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(;!mutations.empty() && mutations.back().version >= end;) { + #line 10655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + mutations.pop_back(); + #line 10656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + foundEnd = true; + #line 58616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!mutations.empty()) + #line 58620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + *begin = mutations.back().version; + #line 10660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->mutations.send(mutations); + #line 10661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = results->mutations.onEmpty(); + #line 10661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); + #line 58630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 10661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont1loopBody1cont1(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1break1(int loopDepth) + { + try { + return a_body1loopBody1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont1loopBody1cont1(int loopDepth) + { + #line 10667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + (*begin)++; + #line 10668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + idx++; + #line 58664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1loopBody1cont1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1loopBody1cont5(Void const& _,int loopDepth) + { + #line 10662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(0); + #line 10662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); + #line 58675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont1loopBody1cont5when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 10662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1loopBody1cont5(Void && _,int loopDepth) + { + #line 10662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(0); + #line 10662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); + #line 58691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont1loopBody1cont5when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 10662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 58696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1loopBody1cont5(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1loopBody1cont5(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetChangeFeedStreamFromDiskActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetChangeFeedStreamFromDiskActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("getChangeFeedStreamFromDisk", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedStreamFromDisk", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetChangeFeedStreamFromDiskActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("getChangeFeedStreamFromDisk", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedStreamFromDisk", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetChangeFeedStreamFromDiskActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("getChangeFeedStreamFromDisk", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedStreamFromDisk", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont1loopBody1cont6(Void const& _,int loopDepth) + { + #line 10663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (*begin > results->lastReturnedVersion.get()) + #line 58768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->lastReturnedVersion.set(*begin); + #line 58772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + loopDepth = a_body1loopBody1cont1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1loopBody1cont6(Void && _,int loopDepth) + { + #line 10663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (*begin > results->lastReturnedVersion.get()) + #line 58782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->lastReturnedVersion.set(*begin); + #line 58786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + loopDepth = a_body1loopBody1cont1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1loopBody1cont5when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1loopBody1cont6(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1loopBody1cont5when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1loopBody1cont6(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetChangeFeedStreamFromDiskActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetChangeFeedStreamFromDiskActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("getChangeFeedStreamFromDisk", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont1loopBody1cont5when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedStreamFromDisk", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< GetChangeFeedStreamFromDiskActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("getChangeFeedStreamFromDisk", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont1loopBody1cont5when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedStreamFromDisk", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< GetChangeFeedStreamFromDiskActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("getChangeFeedStreamFromDisk", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedStreamFromDisk", reinterpret_cast(this), 2); + + } + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference db; + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference results; + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key rangeID; + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version* begin; + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version end; + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key tenantPrefix; + #line 10640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool foundEnd; + #line 10644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + RangeResult res; + #line 10647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int idx; + #line 58875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via changeFeedWhenAtLatest() - #line 8613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class ChangeFeedWhenAtLatestActor final : public Actor, public ActorCallback< ChangeFeedWhenAtLatestActor, 0, Void >, public ActorCallback< ChangeFeedWhenAtLatestActor, 1, Void >, public ActorCallback< ChangeFeedWhenAtLatestActor, 2, Void >, public ActorCallback< ChangeFeedWhenAtLatestActor, 3, Void >, public FastAllocated, public ChangeFeedWhenAtLatestActorState { - #line 45397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via getChangeFeedStreamFromDisk() + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetChangeFeedStreamFromDiskActor final : public Actor, public ActorCallback< GetChangeFeedStreamFromDiskActor, 0, RangeResult >, public ActorCallback< GetChangeFeedStreamFromDiskActor, 1, Void >, public ActorCallback< GetChangeFeedStreamFromDiskActor, 2, Void >, public FastAllocated, public GetChangeFeedStreamFromDiskActorState { + #line 58880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< ChangeFeedWhenAtLatestActor, 0, Void >; -friend struct ActorCallback< ChangeFeedWhenAtLatestActor, 1, Void >; -friend struct ActorCallback< ChangeFeedWhenAtLatestActor, 2, Void >; -friend struct ActorCallback< ChangeFeedWhenAtLatestActor, 3, Void >; - #line 8613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ChangeFeedWhenAtLatestActor(Reference const& self,Version const& version) - #line 45411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - ChangeFeedWhenAtLatestActorState(self, version) +friend struct ActorCallback< GetChangeFeedStreamFromDiskActor, 0, RangeResult >; +friend struct ActorCallback< GetChangeFeedStreamFromDiskActor, 1, Void >; +friend struct ActorCallback< GetChangeFeedStreamFromDiskActor, 2, Void >; + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetChangeFeedStreamFromDiskActor(Reference const& db,Reference const& results,Key const& rangeID,Version* const& begin,Version const& end,KeyRange const& range,Key const& tenantPrefix) + #line 58893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + GetChangeFeedStreamFromDiskActorState(db, results, rangeID, begin, end, range, tenantPrefix) { - fdb_probe_actor_enter("changeFeedWhenAtLatest", reinterpret_cast(this), -1); + fdb_probe_actor_enter("getChangeFeedStreamFromDisk", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("changeFeedWhenAtLatest"); + this->lineage.setActorName("getChangeFeedStreamFromDisk"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("changeFeedWhenAtLatest", reinterpret_cast(this), -1); + fdb_probe_actor_exit("getChangeFeedStreamFromDisk", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetChangeFeedStreamFromDiskActor, 0, RangeResult >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetChangeFeedStreamFromDiskActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetChangeFeedStreamFromDiskActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getChangeFeedStreamFromDisk( Reference const& db, Reference const& results, Key const& rangeID, Version* const& begin, Version const& end, KeyRange const& range, Key const& tenantPrefix ) { + #line 10633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetChangeFeedStreamFromDiskActor(db, results, rangeID, begin, end, range, tenantPrefix)); + #line 58923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 10676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 58928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via getChangeFeedStreamActor() + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetChangeFeedStreamActorActorState { + #line 58935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetChangeFeedStreamActorActorState(Reference const& db,Reference const& results,Key const& rangeID,Version const& begin,Version const& end,KeyRange const& range,int const& replyBufferSize,bool const& canReadPopped,ReadOptions const& readOptions,bool const& encrypted,Reference const& cacheData,Key const& tenantPrefix) + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db), + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results(results), + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeID(rangeID), + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + begin(begin), + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + end(end), + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + replyBufferSize(replyBufferSize), + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + canReadPopped(canReadPopped), + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + readOptions(readOptions), + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + encrypted(encrypted), + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cacheData(cacheData), + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantPrefix(tenantPrefix), + #line 10689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx(db), + #line 10690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:GetChangeFeedStream"_loc), + #line 10692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + sleepWithBackoff(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY), + #line 10693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + lastBeginVersion(invalidVersion) + #line 58972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("getChangeFeedStreamActor", reinterpret_cast(this)); + + } + ~GetChangeFeedStreamActorActorState() + { + fdb_probe_actor_destroy("getChangeFeedStreamActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 10695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 58987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetChangeFeedStreamActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 10696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keys = KeyRange(); + #line 59017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + try { + #line 10698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + lastBeginVersion = begin; + #line 10699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = getChangeFeedRange(db, cx, rangeID, begin); + #line 10699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 59025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 10699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 10812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_actor_cancelled || e.code() == error_code_change_feed_popped) + #line 59052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->streams.clear(); + #line 10814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->storageData.clear(); + #line 10815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_change_feed_popped) + #line 59060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++db->feedNonRetriableErrors; + #line 10817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "getChangeFeedStreamActor got popped", probe::decoration::rare); + #line 10818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->mutations.sendError(e); + #line 10819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->refresh.sendError(e); + #line 59070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + #line 10821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->refresh.sendError(change_feed_cancelled()); + #line 59076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 59080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (results->notAtLatest.get() == 0) + #line 59084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->notAtLatest.set(1); + #line 10827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (results->context) + #line 59090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->context->notAtLatestChangeFeeds[results->dbgid] = results.getPtr(); + #line 10829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->created = now(); + #line 59096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + #line 10833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || e.code() == error_code_connection_failed || e.code() == error_code_unknown_change_feed || e.code() == error_code_broken_promise || e.code() == error_code_future_version || e.code() == error_code_request_maybe_delivered || e.code() == error_code_storage_too_many_feed_streams) + #line 59101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++db->feedErrors; + #line 10839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->changeFeedCache.erase(rangeID); + #line 10840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache({}, keys); + #line 10841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (begin == lastBeginVersion || e.code() == error_code_storage_too_many_feed_streams) + #line 59111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + sleepWithBackoff = std::min(2.0, sleepWithBackoff * 5); + #line 10845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + sleepWithBackoff = std::max(0.1, sleepWithBackoff); + #line 59117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + #line 10847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + sleepWithBackoff = CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY; + #line 59123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("ChangeFeedClientError") .errorUnsuppressed(e) .suppressFor(30.0) .detail("FeedID", rangeID) .detail("BeginVersion", begin) .detail("AnyProgress", begin != lastBeginVersion); + #line 10855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_6 = delay(sleepWithBackoff); + #line 10855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 59131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 10855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 10857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() != error_code_end_of_stream) + #line 59143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++db->feedNonRetriableErrors; + #line 10859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("ChangeFeedClientErrorNonRetryable").errorUnsuppressed(e).suppressFor(5.0); + #line 59149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->mutations.sendError(e); + #line 10862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->refresh.sendError(change_feed_cancelled()); + #line 10863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->streams.clear(); + #line 10864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->storageData.clear(); + #line 10865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetChangeFeedStreamActorActorState(); static_cast(this)->destroy(); return 0; } + #line 59161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~GetChangeFeedStreamActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(KeyRange const& fullRange,int loopDepth) + { + #line 10700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keys = fullRange & range; + #line 10701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_1 = getKeyRangeLocations(cx, TenantInfo(), keys, CLIENT_KNOBS->CHANGE_FEED_LOCATION_LIMIT, Reverse::False, &StorageServerInterface::changeFeedStream, span.context, Optional(), UseProvisionalProxies::False, latestVersion); + #line 10701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 59184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 10701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 59189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(KeyRange && fullRange,int loopDepth) + { + #line 10700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keys = fullRange & range; + #line 10701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_1 = getKeyRangeLocations(cx, TenantInfo(), keys, CLIENT_KNOBS->CHANGE_FEED_LOCATION_LIMIT, Reverse::False, &StorageServerInterface::changeFeedStream, span.context, Optional(), UseProvisionalProxies::False, latestVersion); + #line 10701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 59202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 10701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 59207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(KeyRange const& fullRange,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(fullRange, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(KeyRange && fullRange,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(fullRange), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetChangeFeedStreamActorActor, 0, KeyRange >::remove(); + + } + void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 0, KeyRange >*,KeyRange const& value) + { + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 0, KeyRange >*,KeyRange && value) + { + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetChangeFeedStreamActorActor, 0, KeyRange >*,Error err) + { + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(int loopDepth) + { + #line 10713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (locations.size() >= CLIENT_KNOBS->CHANGE_FEED_LOCATION_LIMIT) + #line 59279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT_WE_THINK(false); + #line 10715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1loopBody1Catch1(unknown_change_feed(), loopDepth); + #line 59285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (CLIENT_KNOBS->CHANGE_FEED_COALESCE_LOCATIONS && locations.size() > 1) + #line 59289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + coalesceChangeFeedLocations(locations); + #line 59293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + chosenLocations = std::vector(locations.size()); + #line 10723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + loc = 0; + #line 10724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 59301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont3loopHead1(loopDepth); + return loopDepth; } - void cancel() override + int a_body1loopBody1cont2when1(std::vector const& __locations,int loopDepth) { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ChangeFeedWhenAtLatestActor, 0, Void >*)0, actor_cancelled()); break; - } + #line 10701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + locations = __locations; + #line 59310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont3(loopDepth); + return loopDepth; } -}; -} - #line 8613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future changeFeedWhenAtLatest( Reference const& self, Version const& version ) { - #line 8613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new ChangeFeedWhenAtLatestActor(self, version)); - #line 45439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -} - -#line 8642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - -Future ChangeFeedData::whenAtLeast(Version version) { - return changeFeedWhenAtLatest(Reference::addRef(this), version); -} - -#define DEBUG_CF_CLIENT_TRACE false - - #line 45450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via partialChangeFeedStream() - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class PartialChangeFeedStreamActorState { - #line 45457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - PartialChangeFeedStreamActorState(StorageServerInterface const& interf,PromiseStream> const& results,ReplyPromiseStream const& replyStream,Version const& begin,Version const& end,Reference const& feedData,Reference const& storageData,UID const& debugUID) - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : interf(interf), - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results(results), - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - replyStream(replyStream), - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - begin(begin), - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - end(end), - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - feedData(feedData), - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - storageData(storageData), - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - debugUID(debugUID), - #line 8659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - refresh(feedData->refresh), - #line 8660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - atLatestVersion(false), - #line 8661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - nextVersion(begin), - #line 8667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - lastEmpty(invalidVersion) - #line 45486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + int a_body1loopBody1cont2when1(std::vector && __locations,int loopDepth) { - fdb_probe_actor_create("partialChangeFeedStream", reinterpret_cast(this)); + locations = std::move(__locations); + loopDepth = a_body1loopBody1cont3(loopDepth); + return loopDepth; } - ~PartialChangeFeedStreamActorState() + void a_exitChoose2() { - fdb_probe_actor_destroy("partialChangeFeedStream", reinterpret_cast(this)); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetChangeFeedStreamActorActor, 1, std::vector >::remove(); } - int a_body1(int loopDepth=0) + void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 1, std::vector >*,std::vector const& value) { + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - try { - #line 8669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 45502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch2(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch2(unknown_error(), loopDepth); - } + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 1); - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~PartialChangeFeedStreamActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; } - int a_body1Catch2(const Error& e,int loopDepth=0) + void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 1, std::vector >*,std::vector && value) { + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - #line 8771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 45532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorError", debugUID).errorUnsuppressed(e); - #line 45536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_actor_cancelled) - #line 45540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, loopDepth); - #line 45544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.sendError(e); - #line 8778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PartialChangeFeedStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 45550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~PartialChangeFeedStreamActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1loopHead1(int loopDepth) + void a_callback_error(ActorCallback< GetChangeFeedStreamActorActor, 1, std::vector >*,Error err) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1loopBody1(int loopDepth) + int a_body1loopBody1cont4(int loopDepth) { - #line 8670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (nextVersion >= end) - #line 45575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++db->feedStreamStarts; + #line 10770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (locations.size() > 1) + #line 59379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.sendError(end_of_stream()); - #line 8672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PartialChangeFeedStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 45581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~PartialChangeFeedStreamActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 10771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++db->feedMergeStreamStarts; + #line 10772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> interfs; + #line 10773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < locations.size();i++) { + #line 10774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + interfs.emplace_back(locations[i].locations->getInterface(chosenLocations[i]), locations[i].range & range); + #line 59389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Change feed merge cursor"); + #line 10779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = mergeChangeFeedStream(db, interfs, results, rangeID, range, &begin, end, replyBufferSize, canReadPopped, readOptions, encrypted, cacheData, tenantPrefix) || cx->connectionFileChanged(); + #line 10779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 59397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 10779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 10794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "Change feed single cursor"); + #line 10795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageServerInterface interf = locations[0].locations->getInterface(chosenLocations[0]); + #line 10796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_5 = singleChangeFeedStream(db, interf, range, results, rangeID, &begin, end, replyBufferSize, canReadPopped, readOptions, encrypted, cacheData, tenantPrefix) || cx->connectionFileChanged(); + #line 10796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 59415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont4when2(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 10796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } - #line 8675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - FutureStream __when_expr_0 = replyStream.getFuture(); - #line 8674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 45591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.pop(), loopDepth); }; - #line 8753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = atLatestVersion && replyStream.isEmpty() && results.isEmpty() ? storageData->version.whenAtLeast(nextVersion) : Future(Never()); - #line 45595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; - #line 8766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = atLatestVersion && replyStream.isEmpty() && !results.isEmpty() ? results.onEmpty() : Future(Never()); - #line 45599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when3(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 45608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) + int a_body1loopBody1cont3loopHead1(int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1cont3loopBody1(loopDepth); return loopDepth; } - int a_body1loopBody1when1(ChangeFeedStreamReply const& __rep,int loopDepth) + int a_body1loopBody1cont3loopBody1(int loopDepth) { - #line 8675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - rep = __rep; - #line 8677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (nextVersion == begin && rep.mutations.size() == 1 && rep.mutations[0].mutations.size() == 0 && rep.mutations[0].version == begin - 1) - #line 45625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - return a_body1loopHead1(loopDepth); // continue - } - #line 8682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 45631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!(loc < locations.size())) + #line 59437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorReply", debugUID) .detail("SSID", storageData->id) .detail("AtLatest", atLatestVersion) .detail("FirstVersion", rep.mutations.front().version) .detail("LastVersion", rep.mutations.back().version) .detail("Count", rep.mutations.size()) .detail("MinStreamVersion", rep.minStreamVersion) .detail("PopVersion", rep.popVersion) .detail("RepAtLatest", rep.atLatestVersion); - #line 45635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return a_body1loopBody1cont3break1(loopDepth==0?0:loopDepth-1); // break } - #line 8694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (rep.mutations.back().version > feedData->maxSeenVersion) - #line 45639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - feedData->maxSeenVersion = rep.mutations.back().version; - #line 45643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int count = 0; + #line 10728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int useIdx = -1; + #line 10729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < locations[loc].locations->size();i++) { + #line 10730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!IFailureMonitor::failureMonitor() .getState(locations[loc] .locations->get(i, &StorageServerInterface::changeFeedStream) .getEndpoint()) .failed) + #line 59449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (deterministicRandom()->random01() <= 1.0 / ++count) + #line 59453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + useIdx = i; + #line 59457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } } - #line 8697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (rep.popVersion > feedData->popVersion) - #line 45647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (useIdx >= 0) + #line 59463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - feedData->popVersion = rep.popVersion; - #line 45651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + chosenLocations[loc] = useIdx; + #line 10743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + loc++; + #line 10744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (g_network->isSimulated() && !g_simulator->speedUpSimulation && BUGGIFY_WITH_PROB(0.01)) + #line 59471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(deterministicRandom()->random01()); + #line 10746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 59477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont3loopBody1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 10746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont3loopBody1cont6(loopDepth); + } } - #line 8701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (lastEmpty != invalidVersion && !results.isEmpty()) - #line 45655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + else { - #line 8702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : feedData->storageData ) { - #line 8703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (refresh.canBeSet() && lastEmpty > it->desired.get()) - #line 45661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - it->desired.set(lastEmpty); - #line 45665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - #line 8707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - lastEmpty = invalidVersion; - #line 45670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont3loopBody1cont1(loopDepth); } - #line 8710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - resultLoc = 0; - #line 8711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 45676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1when1loopHead1(loopDepth); return loopDepth; } - int a_body1loopBody1when1(ChangeFeedStreamReply && __rep,int loopDepth) + int a_body1loopBody1cont3break1(int loopDepth) { - rep = std::move(__rep); - #line 8677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (nextVersion == begin && rep.mutations.size() == 1 && rep.mutations[0].mutations.size() == 0 && rep.mutations[0].version == begin - 1) - #line 45686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - return a_body1loopHead1(loopDepth); // continue - } - #line 8682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 45692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorReply", debugUID) .detail("SSID", storageData->id) .detail("AtLatest", atLatestVersion) .detail("FirstVersion", rep.mutations.front().version) .detail("LastVersion", rep.mutations.back().version) .detail("Count", rep.mutations.size()) .detail("MinStreamVersion", rep.minStreamVersion) .detail("PopVersion", rep.popVersion) .detail("RepAtLatest", rep.atLatestVersion); - #line 45696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + try { + return a_body1loopBody1cont4(loopDepth); } - #line 8694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (rep.mutations.back().version > feedData->maxSeenVersion) - #line 45700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - feedData->maxSeenVersion = rep.mutations.back().version; - #line 45704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); } - #line 8697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (rep.popVersion > feedData->popVersion) - #line 45708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - feedData->popVersion = rep.popVersion; - #line 45712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + + return loopDepth; + } + int a_body1loopBody1cont3loopBody1cont1(int loopDepth) + { + #line 10751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> ok(locations[loc].locations->size()); + #line 10752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < ok.size();i++) { + #line 10753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ok[i] = IFailureMonitor::failureMonitor().onStateEqual( locations[loc].locations->get(i, &StorageServerInterface::changeFeedStream).getEndpoint(), FailureStatus(false)); + #line 59518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 8701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (lastEmpty != invalidVersion && !results.isEmpty()) - #line 45716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (now() - g_network->networkInfo.newestAlternativesFailure > 1 || deterministicRandom()->random01() < 0.01) + #line 59522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : feedData->storageData ) { - #line 8703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (refresh.canBeSet() && lastEmpty > it->desired.get()) - #line 45722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - it->desired.set(lastEmpty); - #line 45726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - #line 8707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - lastEmpty = invalidVersion; - #line 45731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("AllAlternativesFailed").detail("Alternatives", locations[0].locations->description()); + #line 59526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 8710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - resultLoc = 0; - #line 8711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 45737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1when1loopHead1(loopDepth); + #line 10764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = allAlternativesFailedDelay(quorum(ok, 1)); + #line 10764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 59532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont3loopBody1cont1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 10764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 59537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1when2(Void const& _,int loopDepth) + int a_body1loopBody1cont3loopBody1cont6(int loopDepth) { - #line 8756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - MutationsAndVersionRef empty; - #line 8757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - empty.version = storageData->version.get(); - #line 8758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.send(empty); - #line 8759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - nextVersion = storageData->version.get() + 1; - #line 8760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 45754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorSendEmpty", debugUID) .detail("Version", empty.version); - #line 45758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - lastEmpty = empty.version; - #line 45762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont1(loopDepth); + return a_body1loopBody1cont3loopHead1(loopDepth); // continue return loopDepth; } - int a_body1loopBody1when2(Void && _,int loopDepth) + int a_body1loopBody1cont3loopBody1cont7(Void const& _,int loopDepth) { - #line 8756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - MutationsAndVersionRef empty; - #line 8757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - empty.version = storageData->version.get(); - #line 8758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.send(empty); - #line 8759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - nextVersion = storageData->version.get() + 1; - #line 8760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 45779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorSendEmpty", debugUID) .detail("Version", empty.version); - #line 45783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - lastEmpty = empty.version; - #line 45787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1loopBody1cont3loopBody1cont6(loopDepth); return loopDepth; } - int a_body1loopBody1when3(Void const& _,int loopDepth) + int a_body1loopBody1cont3loopBody1cont7(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1loopBody1cont3loopBody1cont6(loopDepth); return loopDepth; } - int a_body1loopBody1when3(Void && _,int loopDepth) + int a_body1loopBody1cont3loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1loopBody1cont3loopBody1cont7(_, loopDepth); return loopDepth; } - void a_exitChoose1() + int a_body1loopBody1cont3loopBody1when1(Void && _,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorSingleCallback< PartialChangeFeedStreamActor, 0, ChangeFeedStreamReply >::remove(); - static_cast(this)->ActorCallback< PartialChangeFeedStreamActor, 1, Void >::remove(); - static_cast(this)->ActorCallback< PartialChangeFeedStreamActor, 2, Void >::remove(); + loopDepth = a_body1loopBody1cont3loopBody1cont7(std::move(_), loopDepth); + return loopDepth; } - int a_body1loopBody1when1cont1(int loopDepth) + void a_exitChoose3() { - #line 8737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (rep.mutations.back().version + 1 > nextVersion) - #line 45816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - nextVersion = rep.mutations.back().version + 1; - #line 45820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetChangeFeedStreamActorActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3loopBody1when1(value, 0); } - #line 8741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (refresh.canBeSet() && !atLatestVersion && rep.atLatestVersion) - #line 45824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - atLatestVersion = true; - #line 8743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - feedData->notAtLatest.set(feedData->notAtLatest.get() - 1); - #line 45830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); } - #line 8745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (refresh.canBeSet() && rep.minStreamVersion > storageData->version.get()) - #line 45834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - storageData->version.set(rep.minStreamVersion); - #line 45838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3loopBody1when1(std::move(value), 0); } - #line 8748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 45842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorReplyDone", debugUID) .detail("AtLatestNow", atLatestVersion); - #line 45846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); } - loopDepth = a_body1loopBody1cont1(loopDepth); + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< GetChangeFeedStreamActorActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 2); + + } + int a_body1loopBody1cont3loopBody1cont9(Void const& _,int loopDepth) + { + #line 10765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + loc = 0; + #line 59627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1loopBody1cont3loopHead1(0); return loopDepth; } - int a_body1loopBody1when1loopHead1(int loopDepth) + int a_body1loopBody1cont3loopBody1cont9(Void && _,int loopDepth) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1when1loopBody1(loopDepth); + #line 10765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + loc = 0; + #line 59636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1loopBody1cont3loopHead1(0); return loopDepth; } - int a_body1loopBody1when1loopBody1(int loopDepth) + int a_body1loopBody1cont3loopBody1cont1when1(Void const& _,int loopDepth) { - #line 8711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!(resultLoc < rep.mutations.size())) - #line 45863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - return a_body1loopBody1when1break1(loopDepth==0?0:loopDepth-1); // break - } - #line 8712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = results.onEmpty(); - #line 8712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 45871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1when1loopBody1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 45876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1loopBody1cont3loopBody1cont9(_, loopDepth); return loopDepth; } - int a_body1loopBody1when1break1(int loopDepth) + int a_body1loopBody1cont3loopBody1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3loopBody1cont9(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetChangeFeedStreamActorActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 3, Void >*,Void const& value) { + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { - return a_body1loopBody1when1cont1(loopDepth); + a_body1loopBody1cont3loopBody1cont1when1(value, 0); } catch (Error& error) { - loopDepth = a_body1Catch2(error, std::max(0, loopDepth - 1)); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch2(unknown_error(), std::max(0, loopDepth - 1)); + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1loopBody1when1loopBody1cont1(Void const& _,int loopDepth) + void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 3, Void >*,Void && value) { - #line 8713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (rep.mutations[resultLoc].version >= nextVersion) - #line 45898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.send(rep.mutations[resultLoc]); - #line 8716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 45904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorSend", debugUID) .detail("Version", rep.mutations[resultLoc].version) .detail("Size", rep.mutations[resultLoc].mutations.size()); - #line 45908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : feedData->storageData ) { - #line 8726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (refresh.canBeSet() && rep.mutations[resultLoc].version > it->desired.get()) - #line 45914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - it->desired.set(rep.mutations[resultLoc].version); - #line 45918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont3loopBody1cont1when1(std::move(value), 0); } - else - { - #line 8731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(rep.mutations[resultLoc].mutations.empty()); - #line 45926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); } - #line 8733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - resultLoc++; - #line 45930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (loopDepth == 0) return a_body1loopBody1when1loopHead1(0); + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1loopBody1when1loopBody1cont1(Void && _,int loopDepth) + void a_callback_error(ActorCallback< GetChangeFeedStreamActorActor, 3, Void >*,Error err) { - #line 8713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (rep.mutations[resultLoc].version >= nextVersion) - #line 45939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results.send(rep.mutations[resultLoc]); - #line 8716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 45945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorSend", debugUID) .detail("Version", rep.mutations[resultLoc].version) .detail("Size", rep.mutations[resultLoc].mutations.size()); - #line 45949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : feedData->storageData ) { - #line 8726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (refresh.canBeSet() && rep.mutations[resultLoc].version > it->desired.get()) - #line 45955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - it->desired.set(rep.mutations[resultLoc].version); - #line 45959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1(err, 0); } - else - { - #line 8731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(rep.mutations[resultLoc].mutations.empty()); - #line 45967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); } - #line 8733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - resultLoc++; - #line 45971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (loopDepth == 0) return a_body1loopBody1when1loopHead1(0); + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 3); + + } + int a_body1loopBody1cont7(int loopDepth) + { + loopDepth = a_body1loopBody1cont11(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont8(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont7(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont8(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont7(loopDepth); return loopDepth; } - int a_body1loopBody1when1loopBody1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont4when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1when1loopBody1cont1(_, loopDepth); + loopDepth = a_body1loopBody1cont8(_, loopDepth); return loopDepth; } - int a_body1loopBody1when1loopBody1when1(Void && _,int loopDepth) + int a_body1loopBody1cont4when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1when1loopBody1cont1(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont8(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose5() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< PartialChangeFeedStreamActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetChangeFeedStreamActorActor, 4, Void >::remove(); } - void a_callback_fire(ActorCallback< PartialChangeFeedStreamActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 4, Void >*,Void const& value) { - fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 3); - a_exitChoose2(); + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1when1loopBody1when1(value, 0); + a_body1loopBody1cont4when1(value, 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< PartialChangeFeedStreamActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 3); - a_exitChoose2(); + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1when1loopBody1when1(std::move(value), 0); + a_body1loopBody1cont4when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< PartialChangeFeedStreamActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< GetChangeFeedStreamActorActor, 4, Void >*,Error err) { - fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 3); - a_exitChoose2(); + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1Catch2(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 4); } - void a_callback_fire(ActorSingleCallback< PartialChangeFeedStreamActor, 0, ChangeFeedStreamReply >*,ChangeFeedStreamReply const& value) + int a_body1loopBody1cont10(Void const& _,int loopDepth) { - fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 0); + loopDepth = a_body1loopBody1cont7(loopDepth); + return loopDepth; } - void a_callback_fire(ActorSingleCallback< PartialChangeFeedStreamActor, 0, ChangeFeedStreamReply >*,ChangeFeedStreamReply && value) + int a_body1loopBody1cont10(Void && _,int loopDepth) { - fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 0); + loopDepth = a_body1loopBody1cont7(loopDepth); + return loopDepth; } - void a_callback_error(ActorSingleCallback< PartialChangeFeedStreamActor, 0, ChangeFeedStreamReply >*,Error err) + int a_body1loopBody1cont4when2(Void const& _,int loopDepth) { - fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 0); - a_exitChoose1(); + loopDepth = a_body1loopBody1cont10(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4when2(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont10(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetChangeFeedStreamActorActor, 5, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1Catch2(err, 0); + a_body1loopBody1cont4when2(value, 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 5); } - void a_callback_fire(ActorCallback< PartialChangeFeedStreamActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 5, Void >*,Void && value) { - fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 1); - a_exitChoose1(); + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1loopBody1when2(value, 0); + a_body1loopBody1cont4when2(std::move(value), 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 5); } - void a_callback_fire(ActorCallback< PartialChangeFeedStreamActor, 1, Void >*,Void && value) + void a_callback_error(ActorCallback< GetChangeFeedStreamActorActor, 5, Void >*,Error err) { - fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 1); - a_exitChoose1(); + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1loopBody1when2(std::move(value), 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 5); } - void a_callback_error(ActorCallback< PartialChangeFeedStreamActor, 1, Void >*,Error err) + int a_body1loopBody1cont11(int loopDepth) { - fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 1); - a_exitChoose1(); try { - a_body1Catch2(err, 0); + loopDepth = a_body1loopBody1cont1(loopDepth); } catch (Error& error) { - a_body1Catch2(error, 0); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - a_body1Catch2(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } - fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 1); + return loopDepth; } - void a_callback_fire(ActorCallback< PartialChangeFeedStreamActor, 2, Void >*,Void const& value) + int a_body1loopBody1Catch1cont1(int loopDepth) { - fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 2); - a_exitChoose1(); + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont7(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont7(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont7(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont7(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose7() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetChangeFeedStreamActorActor, 6, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 6, Void >*,Void const& value) + { + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 6); + a_exitChoose7(); try { - a_body1loopBody1when3(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 6); } - void a_callback_fire(ActorCallback< PartialChangeFeedStreamActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 6, Void >*,Void && value) { - fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 2); - a_exitChoose1(); + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 6); + a_exitChoose7(); try { - a_body1loopBody1when3(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 6); } - void a_callback_error(ActorCallback< PartialChangeFeedStreamActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< GetChangeFeedStreamActorActor, 6, Void >*,Error err) { - fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), 2); - a_exitChoose1(); + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 6); + a_exitChoose7(); try { - a_body1Catch2(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1Catch2(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 6); } - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StorageServerInterface interf; - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - PromiseStream> results; - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ReplyPromiseStream replyStream; - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference db; + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference results; + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key rangeID; + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Version begin; - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Version end; - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference feedData; - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference storageData; - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - UID debugUID; - #line 8659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Promise refresh; - #line 8660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bool atLatestVersion; - #line 8661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version nextVersion; - #line 8667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version lastEmpty; - #line 8675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ChangeFeedStreamReply rep; - #line 8710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int resultLoc; - #line 46202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int replyBufferSize; + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool canReadPopped; + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ReadOptions readOptions; + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool encrypted; + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference cacheData; + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key tenantPrefix; + #line 10689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database cx; + #line 10690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Span span; + #line 10692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + double sleepWithBackoff; + #line 10693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version lastBeginVersion; + #line 10696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange keys; + #line 10701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector locations; + #line 10722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector chosenLocations; + #line 10723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int loc; + #line 59994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via partialChangeFeedStream() - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class PartialChangeFeedStreamActor final : public Actor, public ActorSingleCallback< PartialChangeFeedStreamActor, 0, ChangeFeedStreamReply >, public ActorCallback< PartialChangeFeedStreamActor, 3, Void >, public ActorCallback< PartialChangeFeedStreamActor, 1, Void >, public ActorCallback< PartialChangeFeedStreamActor, 2, Void >, public FastAllocated, public PartialChangeFeedStreamActorState { - #line 46207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via getChangeFeedStreamActor() + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetChangeFeedStreamActorActor final : public Actor, public ActorCallback< GetChangeFeedStreamActorActor, 0, KeyRange >, public ActorCallback< GetChangeFeedStreamActorActor, 1, std::vector >, public ActorCallback< GetChangeFeedStreamActorActor, 2, Void >, public ActorCallback< GetChangeFeedStreamActorActor, 3, Void >, public ActorCallback< GetChangeFeedStreamActorActor, 4, Void >, public ActorCallback< GetChangeFeedStreamActorActor, 5, Void >, public ActorCallback< GetChangeFeedStreamActorActor, 6, Void >, public FastAllocated, public GetChangeFeedStreamActorActorState { + #line 59999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorSingleCallback< PartialChangeFeedStreamActor, 0, ChangeFeedStreamReply >; -friend struct ActorCallback< PartialChangeFeedStreamActor, 3, Void >; -friend struct ActorCallback< PartialChangeFeedStreamActor, 1, Void >; -friend struct ActorCallback< PartialChangeFeedStreamActor, 2, Void >; - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - PartialChangeFeedStreamActor(StorageServerInterface const& interf,PromiseStream> const& results,ReplyPromiseStream const& replyStream,Version const& begin,Version const& end,Reference const& feedData,Reference const& storageData,UID const& debugUID) - #line 46221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +friend struct ActorCallback< GetChangeFeedStreamActorActor, 0, KeyRange >; +friend struct ActorCallback< GetChangeFeedStreamActorActor, 1, std::vector >; +friend struct ActorCallback< GetChangeFeedStreamActorActor, 2, Void >; +friend struct ActorCallback< GetChangeFeedStreamActorActor, 3, Void >; +friend struct ActorCallback< GetChangeFeedStreamActorActor, 4, Void >; +friend struct ActorCallback< GetChangeFeedStreamActorActor, 5, Void >; +friend struct ActorCallback< GetChangeFeedStreamActorActor, 6, Void >; + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetChangeFeedStreamActorActor(Reference const& db,Reference const& results,Key const& rangeID,Version const& begin,Version const& end,KeyRange const& range,int const& replyBufferSize,bool const& canReadPopped,ReadOptions const& readOptions,bool const& encrypted,Reference const& cacheData,Key const& tenantPrefix) + #line 60016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - PartialChangeFeedStreamActorState(interf, results, replyStream, begin, end, feedData, storageData, debugUID) + GetChangeFeedStreamActorActorState(db, results, rangeID, begin, end, range, replyBufferSize, canReadPopped, readOptions, encrypted, cacheData, tenantPrefix) { - fdb_probe_actor_enter("partialChangeFeedStream", reinterpret_cast(this), -1); + fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("partialChangeFeedStream"); + this->lineage.setActorName("getChangeFeedStreamActor"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("partialChangeFeedStream", reinterpret_cast(this), -1); + fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), -1); } void cancel() override @@ -46236,82 +60031,114 @@ friend struct ActorCallback< PartialChangeFeedStreamActor, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorSingleCallback< PartialChangeFeedStreamActor, 0, ChangeFeedStreamReply >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< PartialChangeFeedStreamActor, 3, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetChangeFeedStreamActorActor, 0, KeyRange >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetChangeFeedStreamActorActor, 1, std::vector >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetChangeFeedStreamActorActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< GetChangeFeedStreamActorActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< GetChangeFeedStreamActorActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< GetChangeFeedStreamActorActor, 5, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< GetChangeFeedStreamActorActor, 6, Void >*)0, actor_cancelled()); break; } } }; } - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future partialChangeFeedStream( StorageServerInterface const& interf, PromiseStream> const& results, ReplyPromiseStream const& replyStream, Version const& begin, Version const& end, Reference const& feedData, Reference const& storageData, UID const& debugUID ) { - #line 8649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new PartialChangeFeedStreamActor(interf, results, replyStream, begin, end, feedData, storageData, debugUID)); - #line 46250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getChangeFeedStreamActor( Reference const& db, Reference const& results, Key const& rangeID, Version const& begin, Version const& end, KeyRange const& range, int const& replyBufferSize, bool const& canReadPopped, ReadOptions const& readOptions, bool const& encrypted, Reference const& cacheData, Key const& tenantPrefix ) { + #line 10677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetChangeFeedStreamActorActor(db, results, rangeID, begin, end, range, replyBufferSize, canReadPopped, readOptions, encrypted, cacheData, tenantPrefix)); + #line 60050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 8781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 10870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 46255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 60055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via mergeChangeFeedStreamInternal() - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class MergeChangeFeedStreamInternalActorState { - #line 46262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via durableChangeFeedMonitor() + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class DurableChangeFeedMonitorActorState { + #line 60062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - MergeChangeFeedStreamInternalActorState(Reference const& results,std::vector> const& interfs,std::vector const& streams,Version* const& begin,Version const& end,UID const& mergeCursorUID) - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : results(results), - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - interfs(interfs), - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - streams(streams), - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + DurableChangeFeedMonitorActorState(Reference const& db,Reference const& results,Key const& rangeID,Version const& begin,Version const& end,KeyRange const& range,int const& replyBufferSize,bool const& canReadPopped,ReadOptions const& readOptions,bool const& encrypted,Future const& tenantPrefix) + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db), + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results(results), + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeID(rangeID), + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" begin(begin), - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" end(end), - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - mergeCursorUID(mergeCursorUID), - #line 8788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - refresh(results->refresh), - #line 8791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - mutations() - #line 46283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + replyBufferSize(replyBufferSize), + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + canReadPopped(canReadPopped), + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + readOptions(readOptions), + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + encrypted(encrypted), + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantPrefix(tenantPrefix), + #line 10882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cacheRange(), + #line 10883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data(), + #line 10884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + err(success()), + #line 10885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + originalBegin(begin) + #line 60097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("mergeChangeFeedStreamInternal", reinterpret_cast(this)); + fdb_probe_actor_create("durableChangeFeedMonitor", reinterpret_cast(this)); } - ~MergeChangeFeedStreamInternalActorState() + ~DurableChangeFeedMonitorActorState() { - fdb_probe_actor_destroy("mergeChangeFeedStreamInternal", reinterpret_cast(this)); + fdb_probe_actor_destroy("durableChangeFeedMonitor", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 8793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 46298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorStart", mergeCursorUID) .detail("StreamCount", interfs.size()) .detail("Begin", *begin) .detail("End", end); - #line 46302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->endVersion = end; + #line 10887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->usedAnyChangeFeeds = true; + #line 60114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + try { + #line 10889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (db->storage != nullptr) + #line 60118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = db->initializeChangeFeedCache; + #line 10890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 60124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 10890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 60129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont2(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); } - #line 8802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = results->mutations.onEmpty(); - #line 8802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 46308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 46313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -46323,1181 +60150,1493 @@ class MergeChangeFeedStreamInternalActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~MergeChangeFeedStreamInternalActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~DurableChangeFeedMonitorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(Void const& _,int loopDepth) + int a_body1cont1(int loopDepth) { - #line 8803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = delay(0); - #line 8803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 46338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 46343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (data) + #line 60163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->active = false; + #line 10950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->inactiveTime = now(); + #line 60169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (err.code() != error_code_success) + #line 60173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(err, loopDepth); + #line 60177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 10955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DurableChangeFeedMonitorActorState(); static_cast(this)->destroy(); return 0; } + #line 60181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DurableChangeFeedMonitorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 10946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + err = e; + #line 60194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2(int loopDepth) + { + #line 10933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = getChangeFeedStreamActor(db, results, rangeID, begin, end, range, replyBufferSize, canReadPopped, readOptions, encrypted, data, cacheRange.present() ? cacheRange.get().tenantPrefix : Key()); + #line 10933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 60211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), loopDepth); else return a_body1cont2when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 10933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 60216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1cont3(Void const& _,int loopDepth) { - #line 8803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = delay(0); - #line 8803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 46354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 46359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = tenantPrefix; + #line 10891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 60227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont3when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 10891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 60232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 10891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = tenantPrefix; + #line 10891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 60243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont3when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 10891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 60248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + loopDepth = a_body1cont3(_, loopDepth); return loopDepth; } int a_body1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont3(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< MergeChangeFeedStreamInternalActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DurableChangeFeedMonitorActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< DurableChangeFeedMonitorActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 0); + fdb_probe_actor_enter("durableChangeFeedMonitor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 0); + fdb_probe_actor_exit("durableChangeFeedMonitor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< DurableChangeFeedMonitorActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 0); + fdb_probe_actor_enter("durableChangeFeedMonitor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 0); + fdb_probe_actor_exit("durableChangeFeedMonitor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< MergeChangeFeedStreamInternalActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< DurableChangeFeedMonitorActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 0); + fdb_probe_actor_enter("durableChangeFeedMonitor", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1Catch2(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 0); + fdb_probe_actor_exit("durableChangeFeedMonitor", reinterpret_cast(this), 0); } - int a_body1cont3(Void const& _,int loopDepth) + int a_body1cont4(Key const& prefix,int loopDepth) { - #line 8804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(results->mutations.isEmpty()); - #line 8806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 46433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cacheRange = ChangeFeedCacheRange(prefix, rangeID, range); + #line 10893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (db->changeFeedCaches.count(cacheRange.get())) + #line 60322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorGotEmpty", mergeCursorUID); - #line 46437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto cacheData = db->changeFeedCaches[cacheRange.get()]; + #line 10895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (begin < cacheData->popped) + #line 60328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->mutations.sendError(change_feed_popped()); + #line 10897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DurableChangeFeedMonitorActorState(); static_cast(this)->destroy(); return 0; } + #line 60334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DurableChangeFeedMonitorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 10899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (cacheData->version <= begin) + #line 60342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = getChangeFeedStreamFromDisk(db, results, rangeID, &begin, end, range, prefix); + #line 10900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 60348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont4when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 10900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 60353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont6(loopDepth); + } } - #line 8811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (*begin - 1 > results->lastReturnedVersion.get()) - #line 46441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + else { - #line 8812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->lastReturnedVersion.set(*begin - 1); - #line 46445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont5(loopDepth); } - #line 8815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - interfNum = 0; - #line 8817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - streamsUsed = std::vector(); - #line 8819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& stream : streams ) { - #line 8820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - streamsUsed.push_back(stream); - #line 46455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + + return loopDepth; + } + int a_body1cont4(Key && prefix,int loopDepth) + { + #line 10892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cacheRange = ChangeFeedCacheRange(prefix, rangeID, range); + #line 10893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (db->changeFeedCaches.count(cacheRange.get())) + #line 60374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto cacheData = db->changeFeedCaches[cacheRange.get()]; + #line 10895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (begin < cacheData->popped) + #line 60380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->mutations.sendError(change_feed_popped()); + #line 10897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DurableChangeFeedMonitorActorState(); static_cast(this)->destroy(); return 0; } + #line 60386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DurableChangeFeedMonitorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 10899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (cacheData->version <= begin) + #line 60394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = getChangeFeedStreamFromDisk(db, results, rangeID, &begin, end, range, prefix); + #line 10900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 60400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont4when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 10900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 60405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont6(loopDepth); + } } - #line 8823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - nextVersion = Version(); - #line 8824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 46461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont3loopHead1(loopDepth); + else + { + loopDepth = a_body1cont5(loopDepth); + } + + return loopDepth; + } + int a_body1cont3when1(Key const& prefix,int loopDepth) + { + loopDepth = a_body1cont4(prefix, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Key && prefix,int loopDepth) + { + loopDepth = a_body1cont4(std::move(prefix), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DurableChangeFeedMonitorActor, 1, Key >::remove(); + + } + void a_callback_fire(ActorCallback< DurableChangeFeedMonitorActor, 1, Key >*,Key const& value) + { + fdb_probe_actor_enter("durableChangeFeedMonitor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("durableChangeFeedMonitor", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< DurableChangeFeedMonitorActor, 1, Key >*,Key && value) + { + fdb_probe_actor_enter("durableChangeFeedMonitor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("durableChangeFeedMonitor", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< DurableChangeFeedMonitorActor, 1, Key >*,Error err) + { + fdb_probe_actor_enter("durableChangeFeedMonitor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("durableChangeFeedMonitor", reinterpret_cast(this), 1); + + } + int a_body1cont5(int loopDepth) + { + #line 10907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (end == MAX_VERSION) + #line 60487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!db->changeFeedCaches.count(cacheRange.get())) + #line 60491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data = makeReference(); + #line 10910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->version = begin; + #line 10911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->active = true; + #line 10912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->changeFeedCaches[cacheRange.get()] = data; + #line 10913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->rangeId_cacheData[cacheRange.get().rangeId][cacheRange.get()] = data; + #line 10914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key durableFeedKey = changeFeedCacheFeedKey(cacheRange.get().tenantPrefix, rangeID, range); + #line 10915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Value durableFeedValue = changeFeedCacheFeedValue(begin, 0); + #line 10916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->storage->set(KeyValueRef(durableFeedKey, durableFeedValue)); + #line 60509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + else + { + #line 10918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data = db->changeFeedCaches[cacheRange.get()]; + #line 10919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!data->active && data->version <= begin) + #line 60517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->active = true; + #line 10921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (originalBegin > data->latest + 1) + #line 60523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 10922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data->version = originalBegin; + #line 10923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key durableFeedKey = changeFeedCacheFeedKey(cacheRange.get().tenantPrefix, rangeID, range); + #line 10924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Value durableFeedValue = changeFeedCacheFeedValue(originalBegin, data->popped); + #line 10925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->storage->set(KeyValueRef(durableFeedKey, durableFeedValue)); + #line 60533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + else + { + #line 10928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + data = Reference(); + #line 60540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + } + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont3(Void && _,int loopDepth) + int a_body1cont6(int loopDepth) { - #line 8804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(results->mutations.isEmpty()); - #line 8806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 46472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont8(bool const& foundEnd,int loopDepth) + { + #line 10901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (foundEnd) + #line 60558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorGotEmpty", mergeCursorUID); - #line 46476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->mutations.sendError(end_of_stream()); + #line 10903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DurableChangeFeedMonitorActorState(); static_cast(this)->destroy(); return 0; } + #line 60564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DurableChangeFeedMonitorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } - #line 8811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (*begin - 1 > results->lastReturnedVersion.get()) - #line 46480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont8(bool && foundEnd,int loopDepth) + { + #line 10901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (foundEnd) + #line 60578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->lastReturnedVersion.set(*begin - 1); - #line 46484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - interfNum = 0; - #line 8817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - streamsUsed = std::vector(); - #line 8819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& stream : streams ) { - #line 8820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - streamsUsed.push_back(stream); - #line 46494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 10902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results->mutations.sendError(end_of_stream()); + #line 10903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DurableChangeFeedMonitorActorState(); static_cast(this)->destroy(); return 0; } + #line 60584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DurableChangeFeedMonitorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } - #line 8823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - nextVersion = Version(); - #line 8824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 46500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont3loopHead1(loopDepth); + loopDepth = a_body1cont6(loopDepth); return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1cont4when1(bool const& foundEnd,int loopDepth) { - loopDepth = a_body1cont3(_, loopDepth); + loopDepth = a_body1cont8(foundEnd, loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1cont4when1(bool && foundEnd,int loopDepth) { - loopDepth = a_body1cont3(std::move(_), loopDepth); + loopDepth = a_body1cont8(std::move(foundEnd), loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< MergeChangeFeedStreamInternalActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DurableChangeFeedMonitorActor, 2, bool >::remove(); } - void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< DurableChangeFeedMonitorActor, 2, bool >*,bool const& value) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("durableChangeFeedMonitor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont1when1(value, 0); + a_body1cont4when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 1); + fdb_probe_actor_exit("durableChangeFeedMonitor", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< DurableChangeFeedMonitorActor, 2, bool >*,bool && value) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("durableChangeFeedMonitor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont1when1(std::move(value), 0); + a_body1cont4when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 1); + fdb_probe_actor_exit("durableChangeFeedMonitor", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< MergeChangeFeedStreamInternalActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< DurableChangeFeedMonitorActor, 2, bool >*,Error err) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("durableChangeFeedMonitor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1Catch1(err, 0); + a_body1Catch2(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1Catch2(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 1); + fdb_probe_actor_exit("durableChangeFeedMonitor", reinterpret_cast(this), 2); } - int a_body1cont3loopHead1(int loopDepth) + int a_body1cont18(Void const& _,int loopDepth) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont3loopBody1(loopDepth); + loopDepth = a_body1cont18cont1(loopDepth); return loopDepth; } - int a_body1cont3loopBody1(int loopDepth) + int a_body1cont18(Void && _,int loopDepth) { - #line 8826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - interfNum = 0; - #line 8827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 46581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont3loopBody1loopHead1(loopDepth); + loopDepth = a_body1cont18cont1(loopDepth); return loopDepth; } - int a_body1cont3loopBody1cont1(int loopDepth) + int a_body1cont2when1(Void const& _,int loopDepth) { - #line 8840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (mutations.empty()) - #line 46590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(end_of_stream(), std::max(0, loopDepth - 1)); - #line 46594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - streamsUsed.clear(); - #line 8847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = delay(0); - #line 8847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 46602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 8847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 46607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1cont18(_, loopDepth); return loopDepth; } - int a_body1cont3loopBody1loopHead1(int loopDepth) + int a_body1cont2when1(Void && _,int loopDepth) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont3loopBody1loopBody1(loopDepth); + loopDepth = a_body1cont18(std::move(_), loopDepth); return loopDepth; } - int a_body1cont3loopBody1loopBody1(int loopDepth) + void a_exitChoose4() { - #line 8827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!(interfNum < streamsUsed.size())) - #line 46623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - return a_body1cont3loopBody1break1(loopDepth==0?0:loopDepth-1); // break + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DurableChangeFeedMonitorActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DurableChangeFeedMonitorActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("durableChangeFeedMonitor", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); } + fdb_probe_actor_exit("durableChangeFeedMonitor", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< DurableChangeFeedMonitorActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("durableChangeFeedMonitor", reinterpret_cast(this), 3); + a_exitChoose4(); try { - #line 8829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - FutureStream> __when_expr_2 = streamsUsed[interfNum].results.getFuture(); - #line 8829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont3loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 46632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont3loopBody1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3loopBody1loopBody1when1(__when_expr_2.pop(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 8829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 46637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + a_body1cont2when1(std::move(value), 0); } catch (Error& error) { - loopDepth = a_body1cont3loopBody1loopBody1Catch1(error, loopDepth); + a_body1Catch2(error, 0); } catch (...) { - loopDepth = a_body1cont3loopBody1loopBody1Catch1(unknown_error(), loopDepth); + a_body1Catch2(unknown_error(), 0); } + fdb_probe_actor_exit("durableChangeFeedMonitor", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1cont3loopBody1break1(int loopDepth) + void a_callback_error(ActorCallback< DurableChangeFeedMonitorActor, 3, Void >*,Error err) { + fdb_probe_actor_enter("durableChangeFeedMonitor", reinterpret_cast(this), 3); + a_exitChoose4(); try { - return a_body1cont3loopBody1cont1(loopDepth); + a_body1Catch2(err, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + a_body1Catch2(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + a_body1Catch2(unknown_error(), 0); } + fdb_probe_actor_exit("durableChangeFeedMonitor", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1cont3loopBody1loopBody1cont1(int loopDepth) + int a_body1cont18cont1(int loopDepth) { - #line 8837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - interfNum++; - #line 46665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (loopDepth == 0) return a_body1cont3loopBody1loopHead1(0); + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1cont3loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference db; + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference results; + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key rangeID; + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version begin; + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version end; + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int replyBufferSize; + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool canReadPopped; + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ReadOptions readOptions; + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool encrypted; + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future tenantPrefix; + #line 10882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional cacheRange; + #line 10883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference data; + #line 10884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Error err; + #line 10885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version originalBegin; + #line 60775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via durableChangeFeedMonitor() + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class DurableChangeFeedMonitorActor final : public Actor, public ActorCallback< DurableChangeFeedMonitorActor, 0, Void >, public ActorCallback< DurableChangeFeedMonitorActor, 1, Key >, public ActorCallback< DurableChangeFeedMonitorActor, 2, bool >, public ActorCallback< DurableChangeFeedMonitorActor, 3, Void >, public FastAllocated, public DurableChangeFeedMonitorActorState { + #line 60780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DurableChangeFeedMonitorActor, 0, Void >; +friend struct ActorCallback< DurableChangeFeedMonitorActor, 1, Key >; +friend struct ActorCallback< DurableChangeFeedMonitorActor, 2, bool >; +friend struct ActorCallback< DurableChangeFeedMonitorActor, 3, Void >; + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + DurableChangeFeedMonitorActor(Reference const& db,Reference const& results,Key const& rangeID,Version const& begin,Version const& end,KeyRange const& range,int const& replyBufferSize,bool const& canReadPopped,ReadOptions const& readOptions,bool const& encrypted,Future const& tenantPrefix) + #line 60794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + DurableChangeFeedMonitorActorState(db, results, rangeID, begin, end, range, replyBufferSize, canReadPopped, readOptions, encrypted, tenantPrefix) + { + fdb_probe_actor_enter("durableChangeFeedMonitor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("durableChangeFeedMonitor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("durableChangeFeedMonitor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DurableChangeFeedMonitorActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DurableChangeFeedMonitorActor, 1, Key >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< DurableChangeFeedMonitorActor, 2, bool >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< DurableChangeFeedMonitorActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future durableChangeFeedMonitor( Reference const& db, Reference const& results, Key const& rangeID, Version const& begin, Version const& end, KeyRange const& range, int const& replyBufferSize, bool const& canReadPopped, ReadOptions const& readOptions, bool const& encrypted, Future const& tenantPrefix ) { + #line 10871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new DurableChangeFeedMonitorActor(db, results, rangeID, begin, end, range, replyBufferSize, canReadPopped, readOptions, encrypted, tenantPrefix)); + #line 60825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 10957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +Future DatabaseContext::getChangeFeedStream(Reference results, + Key rangeID, + Version begin, + Version end, + KeyRange range, + int replyBufferSize, + bool canReadPopped, + ReadOptions readOptions, + bool encrypted, + Future tenantPrefix) { + return durableChangeFeedMonitor(Reference::addRef(this), + results, + rangeID, + begin, + end, + range, + replyBufferSize, + canReadPopped, + readOptions, + encrypted, + tenantPrefix); +} + +Version OverlappingChangeFeedsInfo::getFeedMetadataVersion(const KeyRangeRef& range) const { + Version v = invalidVersion; + for (auto& it : feedMetadataVersions) { + if (it.second > v && it.first.intersects(range)) { + v = it.second; + } + } + return v; +} + + #line 60863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via singleLocationOverlappingChangeFeeds() + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SingleLocationOverlappingChangeFeedsActorState { + #line 60870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SingleLocationOverlappingChangeFeedsActorState(Database const& cx,Reference const& location,KeyRangeRef const& range,Version const& minVersion) + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + location(location), + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + minVersion(minVersion), + #line 10995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req() + #line 60885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("singleLocationOverlappingChangeFeeds", reinterpret_cast(this)); + + } + ~SingleLocationOverlappingChangeFeedsActorState() + { + fdb_probe_actor_destroy("singleLocationOverlappingChangeFeeds", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) { try { - #line 8833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() != error_code_end_of_stream) - #line 46675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 2)); - #line 46679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - loopDepth = a_body1cont3loopBody1loopBody1cont1(loopDepth); + #line 10996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.range = range; + #line 10997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req.minVersion = minVersion; + #line 10999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = loadBalance(cx.getPtr(), location, &StorageServerInterface::overlappingChangeFeeds, req, TaskPriority::DefaultPromiseEndpoint, AtMostOnce::False, cx->enableLocalityLoadBalance ? &cx->queueModel : nullptr); + #line 10999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 60906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 10999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 60911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 2)); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 2)); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont3loopBody1loopBody1cont3(Standalone const& res,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - #line 8830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - streamsUsed[interfNum].next = res; - #line 8831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - mutations.push(streamsUsed[interfNum]); - #line 46697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont3loopBody1loopBody1cont5(loopDepth); + this->~SingleLocationOverlappingChangeFeedsActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1cont3loopBody1loopBody1cont3(Standalone && res,int loopDepth) + int a_body1cont1(OverlappingChangeFeedsReply const& rep,int loopDepth) { - #line 8830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - streamsUsed[interfNum].next = res; - #line 8831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - mutations.push(streamsUsed[interfNum]); - #line 46708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont3loopBody1loopBody1cont5(loopDepth); + #line 11006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(rep); this->~SingleLocationOverlappingChangeFeedsActorState(); static_cast(this)->destroy(); return 0; } + #line 60934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< OverlappingChangeFeedsReply >::value()) OverlappingChangeFeedsReply(rep); + this->~SingleLocationOverlappingChangeFeedsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont3loopBody1loopBody1when1(Standalone const& res,int loopDepth) + int a_body1cont1(OverlappingChangeFeedsReply && rep,int loopDepth) { - loopDepth = a_body1cont3loopBody1loopBody1cont3(res, loopDepth); + #line 11006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(rep); this->~SingleLocationOverlappingChangeFeedsActorState(); static_cast(this)->destroy(); return 0; } + #line 60946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< OverlappingChangeFeedsReply >::value()) OverlappingChangeFeedsReply(rep); + this->~SingleLocationOverlappingChangeFeedsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont3loopBody1loopBody1when1(Standalone && res,int loopDepth) + int a_body1when1(OverlappingChangeFeedsReply const& rep,int loopDepth) { - loopDepth = a_body1cont3loopBody1loopBody1cont3(std::move(res), loopDepth); + loopDepth = a_body1cont1(rep, loopDepth); return loopDepth; } - void a_exitChoose3() + int a_body1when1(OverlappingChangeFeedsReply && rep,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorSingleCallback< MergeChangeFeedStreamInternalActor, 2, Standalone >::remove(); + loopDepth = a_body1cont1(std::move(rep), loopDepth); + return loopDepth; } - void a_callback_fire(ActorSingleCallback< MergeChangeFeedStreamInternalActor, 2, Standalone >*,Standalone const& value) + void a_exitChoose1() { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 2); - a_exitChoose3(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SingleLocationOverlappingChangeFeedsActor, 0, OverlappingChangeFeedsReply >::remove(); + + } + void a_callback_fire(ActorCallback< SingleLocationOverlappingChangeFeedsActor, 0, OverlappingChangeFeedsReply >*,OverlappingChangeFeedsReply const& value) + { + fdb_probe_actor_enter("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont3loopBody1loopBody1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { - a_body1cont3loopBody1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 2); + fdb_probe_actor_exit("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), 0); } - void a_callback_fire(ActorSingleCallback< MergeChangeFeedStreamInternalActor, 2, Standalone >*,Standalone && value) + void a_callback_fire(ActorCallback< SingleLocationOverlappingChangeFeedsActor, 0, OverlappingChangeFeedsReply >*,OverlappingChangeFeedsReply && value) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont3loopBody1loopBody1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { - a_body1cont3loopBody1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 2); + fdb_probe_actor_exit("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), 0); } - void a_callback_error(ActorSingleCallback< MergeChangeFeedStreamInternalActor, 2, Standalone >*,Error err) + void a_callback_error(ActorCallback< SingleLocationOverlappingChangeFeedsActor, 0, OverlappingChangeFeedsReply >*,Error err) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont3loopBody1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1cont3loopBody1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont3loopBody1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 2); + fdb_probe_actor_exit("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), 0); } - int a_body1cont3loopBody1loopBody1cont5(int loopDepth) + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database cx; + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference location; + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRangeRef range; + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version minVersion; + #line 10995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + OverlappingChangeFeedsRequest req; + #line 61027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via singleLocationOverlappingChangeFeeds() + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SingleLocationOverlappingChangeFeedsActor final : public Actor, public ActorCallback< SingleLocationOverlappingChangeFeedsActor, 0, OverlappingChangeFeedsReply >, public FastAllocated, public SingleLocationOverlappingChangeFeedsActorState { + #line 61032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< SingleLocationOverlappingChangeFeedsActor, 0, OverlappingChangeFeedsReply >; + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SingleLocationOverlappingChangeFeedsActor(Database const& cx,Reference const& location,KeyRangeRef const& range,Version const& minVersion) + #line 61043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + SingleLocationOverlappingChangeFeedsActorState(cx, location, range, minVersion) + { + fdb_probe_actor_enter("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("singleLocationOverlappingChangeFeeds"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< SingleLocationOverlappingChangeFeedsActor, 0, OverlappingChangeFeedsReply >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future singleLocationOverlappingChangeFeeds( Database const& cx, Reference const& location, KeyRangeRef const& range, Version const& minVersion ) { + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new SingleLocationOverlappingChangeFeedsActor(cx, location, range, minVersion)); + #line 61071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 11008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +bool compareChangeFeedResult(const OverlappingChangeFeedEntry& i, const OverlappingChangeFeedEntry& j) { + return i.feedId < j.feedId; +} + + #line 61080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via getOverlappingChangeFeedsActor() + #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetOverlappingChangeFeedsActorActorState { + #line 61087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetOverlappingChangeFeedsActorActorState(Reference const& db,KeyRangeRef const& range,Version const& minVersion) + #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db), + #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + minVersion(minVersion), + #line 11016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx(db), + #line 11017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:GetOverlappingChangeFeeds"_loc) + #line 61102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("getOverlappingChangeFeedsActor", reinterpret_cast(this)); + + } + ~GetOverlappingChangeFeedsActorActorState() + { + fdb_probe_actor_destroy("getOverlappingChangeFeedsActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) { try { - loopDepth = a_body1cont3loopBody1loopBody1cont1(loopDepth); + #line 11019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 61117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 2)); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 2)); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont3loopBody1cont2(Void const& _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - #line 8850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Standalone> nextOut; - #line 8851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - nextVersion = mutations.top().next.version; - #line 8853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - streamsUsed.push_back(mutations.top()); - #line 8854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - nextOut.push_back_deep(nextOut.arena(), mutations.top().next); - #line 8855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - mutations.pop(); - #line 8858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(;!mutations.empty() && mutations.top().next.version == nextVersion;) { - #line 8859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (mutations.top().next.mutations.size() && mutations.top().next.mutations.front().param1 != lastEpochEndPrivateKey) - #line 46805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - nextOut.back().mutations.append_deep( nextOut.arena(), mutations.top().next.mutations.begin(), mutations.top().next.mutations.size()); - #line 46809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - streamsUsed.push_back(mutations.top()); - #line 8865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - mutations.pop(); - #line 46815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(nextOut.size() == 1); - #line 8869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(nextVersion >= *begin); - #line 8871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - *begin = nextVersion + 1; - #line 8873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 46825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorSending", mergeCursorUID) .detail("Count", streamsUsed.size()) .detail("Version", nextVersion); - #line 46829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (nextOut.back().mutations.empty()) - #line 46833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(results->mutations.isEmpty()); - #line 46837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont3loopBody1cont4(loopDepth); - } - else - { - #line 8883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(nextOut.back().version > results->lastReturnedVersion.get()); - #line 8885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->mutations.send(nextOut); - #line 8886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_4 = results->mutations.onEmpty(); - #line 8886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 46850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 8886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 46855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + this->~GetOverlappingChangeFeedsActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 11021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_0 = getKeyRangeLocations(cx, TenantInfo(), range, CLIENT_KNOBS->CHANGE_FEED_LOCATION_LIMIT, Reverse::False, &StorageServerInterface::overlappingChangeFeeds, span.context, Optional(), UseProvisionalProxies::False, latestVersion); + #line 11021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 61150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 11021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 61155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1cont3loopBody1cont2(Void && _,int loopDepth) + int a_body1loopBody1cont1(int loopDepth) { - #line 8850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Standalone> nextOut; - #line 8851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - nextVersion = mutations.top().next.version; - #line 8853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - streamsUsed.push_back(mutations.top()); - #line 8854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - nextOut.push_back_deep(nextOut.arena(), mutations.top().next); - #line 8855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - mutations.pop(); - #line 8858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(;!mutations.empty() && mutations.top().next.version == nextVersion;) { - #line 8859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (mutations.top().next.mutations.size() && mutations.top().next.mutations.front().param1 != lastEpochEndPrivateKey) - #line 46877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 11070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || e.code() == error_code_future_version) + #line 61177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - nextOut.back().mutations.append_deep( nextOut.arena(), mutations.top().next.mutations.begin(), mutations.top().next.mutations.size()); - #line 46881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache({}, range); + #line 11073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY); + #line 11073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 61185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 11073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 61190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 11075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 61197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 8864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - streamsUsed.push_back(mutations.top()); - #line 8865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - mutations.pop(); - #line 46887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(nextOut.size() == 1); - #line 8869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(nextVersion >= *begin); - #line 8871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - *begin = nextVersion + 1; - #line 8873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 46897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorSending", mergeCursorUID) .detail("Count", streamsUsed.size()) .detail("Version", nextVersion); - #line 46901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 8880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (nextOut.back().mutations.empty()) - #line 46905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 11033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (locations.size() >= CLIENT_KNOBS->CHANGE_FEED_LOCATION_LIMIT) + #line 61212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(results->mutations.isEmpty()); - #line 46909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont3loopBody1cont4(loopDepth); + #line 11034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevError, "OverlappingRangeTooLarge") .detail("Range", range) .detail("Limit", CLIENT_KNOBS->CHANGE_FEED_LOCATION_LIMIT); + #line 11037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = delay(1.0); + #line 11037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 61220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 11037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 61225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } else { - #line 8883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(nextOut.back().version > results->lastReturnedVersion.get()); - #line 8885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->mutations.send(nextOut); - #line 8886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_4 = results->mutations.onEmpty(); - #line 8886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 46922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 8886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 46927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1loopBody1cont3(loopDepth); } return loopDepth; } - int a_body1cont3loopBody1cont1when1(Void const& _,int loopDepth) + int a_body1loopBody1when1(std::vector const& __locations,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont2(_, loopDepth); + #line 11021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + locations = __locations; + #line 61239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } - int a_body1cont3loopBody1cont1when1(Void && _,int loopDepth) + int a_body1loopBody1when1(std::vector && __locations,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont2(std::move(_), loopDepth); + locations = std::move(__locations); + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< MergeChangeFeedStreamInternalActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetOverlappingChangeFeedsActorActor, 0, std::vector >::remove(); } - void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 0, std::vector >*,std::vector const& value) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont3loopBody1cont1when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 0, std::vector >*,std::vector && value) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont3loopBody1cont1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< MergeChangeFeedStreamInternalActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< GetOverlappingChangeFeedsActorActor, 0, std::vector >*,Error err) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 0); } - int a_body1cont3loopBody1cont4(int loopDepth) + int a_body1loopBody1cont3(int loopDepth) { - #line 8890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (nextVersion > results->lastReturnedVersion.get()) - #line 47000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->lastReturnedVersion.set(nextVersion); - #line 47004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + allOverlappingRequests = std::vector>(); + #line 11042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : locations ) { + #line 11043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + allOverlappingRequests.push_back( singleLocationOverlappingChangeFeeds(cx, it.locations, it.range & range, minVersion)); + #line 61310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - if (loopDepth == 0) return a_body1cont3loopHead1(0); + #line 11046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = waitForAll(allOverlappingRequests); + #line 11046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 61316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 11046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 61321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont3loopBody1cont9(Void const& _,int loopDepth) + int a_body1loopBody1cont4(Void const& _,int loopDepth) { - #line 8887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_5 = delay(0); - #line 8887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 47016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont9when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 8887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 47021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 11038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1loopBody1Catch1(all_alternatives_failed(), loopDepth); + #line 61330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } - int a_body1cont3loopBody1cont9(Void && _,int loopDepth) + int a_body1loopBody1cont4(Void && _,int loopDepth) { - #line 8887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_5 = delay(0); - #line 8887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 47032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont3loopBody1cont9when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 8887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 47037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 11038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1loopBody1Catch1(all_alternatives_failed(), loopDepth); + #line 61338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" return loopDepth; } - int a_body1cont3loopBody1cont2when1(Void const& _,int loopDepth) + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont9(_, loopDepth); + loopDepth = a_body1loopBody1cont4(_, loopDepth); return loopDepth; } - int a_body1cont3loopBody1cont2when1(Void && _,int loopDepth) + int a_body1loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont9(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose5() + void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< MergeChangeFeedStreamInternalActor, 4, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetOverlappingChangeFeedsActorActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont3loopBody1cont2when1(value, 0); + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont3loopBody1cont2when1(std::move(value), 0); + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< MergeChangeFeedStreamInternalActor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< GetOverlappingChangeFeedsActorActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 4); + fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 1); } - int a_body1cont3loopBody1cont10(Void const& _,int loopDepth) + int a_body1loopBody1cont6(Void const& _,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont4(loopDepth); + #line 11048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + OverlappingChangeFeedsInfo result; + #line 11049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::unordered_map latestFeedMetadata; + #line 11050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < locations.size();i++) { + #line 11051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + result.arena.dependsOn(allOverlappingRequests[i].get().arena); + #line 11052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + result.arena.dependsOn(locations[i].range.arena()); + #line 11053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + result.feedMetadataVersions.push_back( { locations[i].range, allOverlappingRequests[i].get().feedMetadataVersion }); + #line 11055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : allOverlappingRequests[i].get().feeds ) { + #line 11056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto res = latestFeedMetadata.insert({ it.feedId, it }); + #line 11057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!res.second) + #line 61425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "deduping fetched overlapping feed by higher metadata version"); + #line 11059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.first->second.feedMetadataVersion < it.feedMetadataVersion) + #line 61431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + res.first->second = it; + #line 61435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + } + } + #line 11065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : latestFeedMetadata ) { + #line 11066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + result.feeds.push_back(result.arena, it.second); + #line 61444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetOverlappingChangeFeedsActorActorState(); static_cast(this)->destroy(); return 0; } + #line 61448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< OverlappingChangeFeedsInfo >::value()) OverlappingChangeFeedsInfo(result); + this->~GetOverlappingChangeFeedsActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont3loopBody1cont10(Void && _,int loopDepth) + int a_body1loopBody1cont6(Void && _,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont4(loopDepth); + #line 11048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + OverlappingChangeFeedsInfo result; + #line 11049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::unordered_map latestFeedMetadata; + #line 11050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < locations.size();i++) { + #line 11051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + result.arena.dependsOn(allOverlappingRequests[i].get().arena); + #line 11052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + result.arena.dependsOn(locations[i].range.arena()); + #line 11053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + result.feedMetadataVersions.push_back( { locations[i].range, allOverlappingRequests[i].get().feedMetadataVersion }); + #line 11055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : allOverlappingRequests[i].get().feeds ) { + #line 11056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto res = latestFeedMetadata.insert({ it.feedId, it }); + #line 11057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!res.second) + #line 61476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + CODE_PROBE(true, "deduping fetched overlapping feed by higher metadata version"); + #line 11059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (res.first->second.feedMetadataVersion < it.feedMetadataVersion) + #line 61482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + res.first->second = it; + #line 61486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + } + } + #line 11065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : latestFeedMetadata ) { + #line 11066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + result.feeds.push_back(result.arena, it.second); + #line 61495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetOverlappingChangeFeedsActorActorState(); static_cast(this)->destroy(); return 0; } + #line 61499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< OverlappingChangeFeedsInfo >::value()) OverlappingChangeFeedsInfo(result); + this->~GetOverlappingChangeFeedsActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont3loopBody1cont9when1(Void const& _,int loopDepth) + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont10(_, loopDepth); + loopDepth = a_body1loopBody1cont6(_, loopDepth); return loopDepth; } - int a_body1cont3loopBody1cont9when1(Void && _,int loopDepth) + int a_body1loopBody1cont3when1(Void && _,int loopDepth) { - loopDepth = a_body1cont3loopBody1cont10(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont6(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose6() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< MergeChangeFeedStreamInternalActor, 5, Void >::remove(); - - } - void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 5, Void >*,Void const& value) + void a_exitChoose3() { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1cont3loopBody1cont9when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 5); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetOverlappingChangeFeedsActorActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< MergeChangeFeedStreamInternalActor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont3loopBody1cont9when1(std::move(value), 0); + a_body1loopBody1cont3when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 5); + fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< MergeChangeFeedStreamInternalActor, 5, Void >*,Error err) + void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1Catch1(err, 0); + a_body1loopBody1cont3when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), 5); - - } - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference results; - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector> interfs; - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector streams; - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version* begin; - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version end; - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - UID mergeCursorUID; - #line 8788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Promise refresh; - #line 8791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::priority_queue> mutations; - #line 8815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int interfNum; - #line 8817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector streamsUsed; - #line 8823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version nextVersion; - #line 47202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -}; -// This generated class is to be used only via mergeChangeFeedStreamInternal() - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class MergeChangeFeedStreamInternalActor final : public Actor, public ActorCallback< MergeChangeFeedStreamInternalActor, 0, Void >, public ActorCallback< MergeChangeFeedStreamInternalActor, 1, Void >, public ActorSingleCallback< MergeChangeFeedStreamInternalActor, 2, Standalone >, public ActorCallback< MergeChangeFeedStreamInternalActor, 3, Void >, public ActorCallback< MergeChangeFeedStreamInternalActor, 4, Void >, public ActorCallback< MergeChangeFeedStreamInternalActor, 5, Void >, public FastAllocated, public MergeChangeFeedStreamInternalActorState { - #line 47207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< MergeChangeFeedStreamInternalActor, 0, Void >; -friend struct ActorCallback< MergeChangeFeedStreamInternalActor, 1, Void >; -friend struct ActorSingleCallback< MergeChangeFeedStreamInternalActor, 2, Standalone >; -friend struct ActorCallback< MergeChangeFeedStreamInternalActor, 3, Void >; -friend struct ActorCallback< MergeChangeFeedStreamInternalActor, 4, Void >; -friend struct ActorCallback< MergeChangeFeedStreamInternalActor, 5, Void >; - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - MergeChangeFeedStreamInternalActor(Reference const& results,std::vector> const& interfs,std::vector const& streams,Version* const& begin,Version const& end,UID const& mergeCursorUID) - #line 47223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - MergeChangeFeedStreamInternalActorState(results, interfs, streams, begin, end, mergeCursorUID) - { - fdb_probe_actor_enter("mergeChangeFeedStreamInternal", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("mergeChangeFeedStreamInternal"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("mergeChangeFeedStreamInternal", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< MergeChangeFeedStreamInternalActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< MergeChangeFeedStreamInternalActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorSingleCallback< MergeChangeFeedStreamInternalActor, 2, Standalone >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< MergeChangeFeedStreamInternalActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< MergeChangeFeedStreamInternalActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< MergeChangeFeedStreamInternalActor, 5, Void >*)0, actor_cancelled()); break; + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 2); } -}; -} - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future mergeChangeFeedStreamInternal( Reference const& results, std::vector> const& interfs, std::vector const& streams, Version* const& begin, Version const& end, UID const& mergeCursorUID ) { - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new MergeChangeFeedStreamInternalActor(results, interfs, streams, begin, end, mergeCursorUID)); - #line 47256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -} - -#line 8895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - - #line 47261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via mergeChangeFeedStream() - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class MergeChangeFeedStreamActorState { - #line 47268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - MergeChangeFeedStreamActorState(Reference const& db,std::vector> const& interfs,Reference const& results,Key const& rangeID,Version* const& begin,Version const& end,int const& replyBufferSize,bool const& canReadPopped) - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : db(db), - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - interfs(interfs), - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results(results), - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - rangeID(rangeID), - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - begin(begin), - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - end(end), - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - replyBufferSize(replyBufferSize), - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - canReadPopped(canReadPopped), - #line 8904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fetchers(interfs.size()), - #line 8905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - onErrors(interfs.size()), - #line 8906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - streams(interfs.size()) - #line 47295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - fdb_probe_actor_create("mergeChangeFeedStream", reinterpret_cast(this)); - - } - ~MergeChangeFeedStreamActorState() - { - fdb_probe_actor_destroy("mergeChangeFeedStream", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) + void a_callback_error(ActorCallback< GetOverlappingChangeFeedsActorActor, 2, Void >*,Error err) { + fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - #line 8908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(interfs.size() > 10); - #line 8909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(interfs.size() > 100); - #line 8911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - mergeCursorUID = UID(); - #line 8912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - debugUIDs = std::vector(); - #line 8913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->streams.clear(); - #line 8914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : interfs ) { - #line 8915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ChangeFeedStreamRequest req; - #line 8916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.rangeID = rangeID; - #line 8917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.begin = *begin; - #line 8918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.end = end; - #line 8919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.range = it.second; - #line 8920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.canReadPopped = canReadPopped; - #line 8922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.replyBufferSize = replyBufferSize / interfs.size(); - #line 8923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (replyBufferSize != -1 && req.replyBufferSize < CLIENT_KNOBS->CHANGE_FEED_STREAM_MIN_BYTES) - #line 47336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.replyBufferSize = CLIENT_KNOBS->CHANGE_FEED_STREAM_MIN_BYTES; - #line 47340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.debugUID = deterministicRandom()->randomUniqueID(); - #line 8927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - debugUIDs.push_back(req.debugUID); - #line 8928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - mergeCursorUID = UID(mergeCursorUID.first() ^ req.debugUID.first(), mergeCursorUID.second() ^ req.debugUID.second()); - #line 8931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->streams.push_back(it.first.changeFeedStream.getReplyStream(req)); - #line 47350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : results->storageData ) { - #line 8935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (it->debugGetReferenceCount() == 2) - #line 47356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - db->changeFeedUpdaters.erase(it->interfToken); - #line 47360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - #line 8939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->maxSeenVersion = invalidVersion; - #line 8940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->storageData.clear(); - #line 8941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Promise refresh = results->refresh; - #line 8942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->refresh = Promise(); - #line 8943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(int i = 0;i < interfs.size();i++) { - #line 8944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->storageData.push_back(db->getStorageData(interfs[i].first)); - #line 47375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->notAtLatest.set(interfs.size()); - #line 8947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - refresh.send(Void()); - #line 8949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(int i = 0;i < interfs.size();i++) { - #line 8950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 47385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientMergeCursorInit", debugUIDs[i]) .detail("CursorDebugUID", mergeCursorUID) .detail("Idx", i) .detail("FeedID", rangeID) .detail("MergeRange", KeyRangeRef(interfs.front().second.begin, interfs.back().second.end)) .detail("PartialRange", interfs[i].second) .detail("Begin", *begin) .detail("End", end) .detail("CanReadPopped", canReadPopped); - #line 47389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - onErrors[i] = results->streams[i].onError(); - #line 8962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fetchers[i] = partialChangeFeedStream(interfs[i].first, streams[i].results, results->streams[i], *begin, end, results, results->storageData[i], debugUIDs[i]); - #line 47395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = waitForAny(onErrors) || mergeChangeFeedStreamInternal(results, interfs, streams, begin, end, mergeCursorUID); - #line 8972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 47401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 47406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 2); - return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) + int a_body1loopBody1Catch1cont1(int loopDepth) { - this->~MergeChangeFeedStreamActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont1(Void const& _,int loopDepth) + int a_body1loopBody1Catch1cont2(Void const& _,int loopDepth) { - #line 8974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~MergeChangeFeedStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 47429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~MergeChangeFeedStreamActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1loopBody1Catch1cont2(Void && _,int loopDepth) { - #line 8974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~MergeChangeFeedStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 47441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~MergeChangeFeedStreamActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + loopDepth = a_body1loopBody1Catch1cont2(_, loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + loopDepth = a_body1loopBody1Catch1cont2(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< MergeChangeFeedStreamActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< MergeChangeFeedStreamActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("mergeChangeFeedStream", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1when1(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStream", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< MergeChangeFeedStreamActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("mergeChangeFeedStream", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStream", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< MergeChangeFeedStreamActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("mergeChangeFeedStream", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -47506,62 +61645,53 @@ class MergeChangeFeedStreamActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("mergeChangeFeedStream", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 3); } - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference db; - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector> interfs; - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference results; - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key rangeID; - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version* begin; - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version end; - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int replyBufferSize; - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bool canReadPopped; - #line 8904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector> fetchers; - #line 8905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector> onErrors; - #line 8906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector streams; - #line 8911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - UID mergeCursorUID; - #line 8912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector debugUIDs; - #line 47538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRangeRef range; + #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version minVersion; + #line 11016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database cx; + #line 11017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Span span; + #line 11021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector locations; + #line 11041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> allOverlappingRequests; + #line 61665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via mergeChangeFeedStream() - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class MergeChangeFeedStreamActor final : public Actor, public ActorCallback< MergeChangeFeedStreamActor, 0, Void >, public FastAllocated, public MergeChangeFeedStreamActorState { - #line 47543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via getOverlappingChangeFeedsActor() + #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetOverlappingChangeFeedsActorActor final : public Actor, public ActorCallback< GetOverlappingChangeFeedsActorActor, 0, std::vector >, public ActorCallback< GetOverlappingChangeFeedsActorActor, 1, Void >, public ActorCallback< GetOverlappingChangeFeedsActorActor, 2, Void >, public ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >, public FastAllocated, public GetOverlappingChangeFeedsActorActorState { + #line 61670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< MergeChangeFeedStreamActor, 0, Void >; - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - MergeChangeFeedStreamActor(Reference const& db,std::vector> const& interfs,Reference const& results,Key const& rangeID,Version* const& begin,Version const& end,int const& replyBufferSize,bool const& canReadPopped) - #line 47554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - MergeChangeFeedStreamActorState(db, interfs, results, rangeID, begin, end, replyBufferSize, canReadPopped) +friend struct ActorCallback< GetOverlappingChangeFeedsActorActor, 0, std::vector >; +friend struct ActorCallback< GetOverlappingChangeFeedsActorActor, 1, Void >; +friend struct ActorCallback< GetOverlappingChangeFeedsActorActor, 2, Void >; +friend struct ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >; + #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetOverlappingChangeFeedsActorActor(Reference const& db,KeyRangeRef const& range,Version const& minVersion) + #line 61684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + GetOverlappingChangeFeedsActorActorState(db, range, minVersion) { - fdb_probe_actor_enter("mergeChangeFeedStream", reinterpret_cast(this), -1); + fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("mergeChangeFeedStream"); + this->lineage.setActorName("getOverlappingChangeFeedsActor"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("mergeChangeFeedStream", reinterpret_cast(this), -1); + fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), -1); } void cancel() override @@ -47569,75 +61699,66 @@ friend struct ActorCallback< MergeChangeFeedStreamActor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< MergeChangeFeedStreamActor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetOverlappingChangeFeedsActorActor, 0, std::vector >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetOverlappingChangeFeedsActorActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetOverlappingChangeFeedsActorActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >*)0, actor_cancelled()); break; } } }; } - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future mergeChangeFeedStream( Reference const& db, std::vector> const& interfs, Reference const& results, Key const& rangeID, Version* const& begin, Version const& end, int const& replyBufferSize, bool const& canReadPopped ) { - #line 8896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new MergeChangeFeedStreamActor(db, interfs, results, rangeID, begin, end, replyBufferSize, canReadPopped)); - #line 47582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future getOverlappingChangeFeedsActor( Reference const& db, KeyRangeRef const& range, Version const& minVersion ) { + #line 11013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new GetOverlappingChangeFeedsActorActor(db, range, minVersion)); + #line 61715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 8976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 11080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +Future DatabaseContext::getOverlappingChangeFeeds(KeyRangeRef range, Version minVersion) { + return getOverlappingChangeFeedsActor(Reference::addRef(this), range, minVersion); +} - #line 47587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 61724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via getChangeFeedRange() - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetChangeFeedRangeActorState { - #line 47594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via popChangeFeedBackup() + #line 11085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 11085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class PopChangeFeedBackupActorState { + #line 61731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetChangeFeedRangeActorState(Reference const& db,Database const& cx,Key const& rangeID,Version const& begin = 0) - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : db(db), - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx(cx), - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + PopChangeFeedBackupActorState(Database const& cx,Key const& rangeID,Version const& version) + #line 11085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 11085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rangeID(rangeID), - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - begin(begin), - #line 8978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr(cx), - #line 8979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - rangeIDKey(rangeID.withPrefix(changeFeedPrefix)) - #line 47611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version) + #line 61742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("getChangeFeedRange", reinterpret_cast(this)); + fdb_probe_actor_create("popChangeFeedBackup", reinterpret_cast(this)); } - ~GetChangeFeedRangeActorState() + ~PopChangeFeedBackupActorState() { - fdb_probe_actor_destroy("getChangeFeedRange", reinterpret_cast(this)); + fdb_probe_actor_destroy("popChangeFeedBackup", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 8981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - auto cacheLoc = db->changeFeedCache.find(rangeID); - #line 8982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (cacheLoc != db->changeFeedCache.end()) - #line 47628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(cacheLoc->second); this->~GetChangeFeedRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 47632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< KeyRange >::value()) KeyRange(cacheLoc->second); - this->~GetChangeFeedRangeActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 8986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++cx->feedPopsFallback; + #line 11087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr = Transaction(cx); + #line 11088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 47640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 61761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -47650,8 +61771,8 @@ class GetChangeFeedRangeActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~GetChangeFeedRangeActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~PopChangeFeedBackupActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; @@ -47666,18 +61787,24 @@ class GetChangeFeedRangeActorState { int a_body1loopBody1(int loopDepth) { try { - #line 8988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 8989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = tr.getReadVersion(); - #line 8989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 47675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 11091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 11092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 11093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeIDKey = rangeID.withPrefix(changeFeedPrefix); + #line 11094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_0 = tr.get(rangeIDKey); + #line 11094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 61802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 8989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 47680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 11094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 61807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -47697,16 +61824,16 @@ class GetChangeFeedRangeActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 9006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = tr.onError(e); - #line 9006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 47704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 9006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 47709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = tr.onError(e); + #line 11115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 61831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 11115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 61836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -47717,97 +61844,121 @@ class GetChangeFeedRangeActorState { return loopDepth; } - int a_body1loopBody1cont2(Version const& readVer,int loopDepth) + int a_body1loopBody1cont2(Optional const& val,int loopDepth) { - #line 8990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (readVer < begin) - #line 47724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (val.present()) + #line 61851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY); - #line 8991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 47730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 47735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 11096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 11097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version popVersion; + #line 11098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedStatus status; + #line 11099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::tie(range, popVersion, status) = decodeChangeFeedValue(val.get()); + #line 11100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (version > popVersion) + #line 61863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.set(rangeIDKey, changeFeedValue(range, version, status)); + #line 61867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } } else { - #line 8994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_2 = tr.get(rangeIDKey); - #line 8994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 47744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when2(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 8994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 47749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 11104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(tr.getReadVersion().isReady()); + #line 11105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "ChangeFeedNotRegisteredPop") .detail("FeedID", rangeID) .detail("FullFeedKey", rangeIDKey) .detail("PopVersion", version) .detail("ReadVersion", tr.getReadVersion().get()); + #line 11110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1loopBody1Catch1(change_feed_not_registered(), loopDepth); + #line 61878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + #line 11112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = tr.commit(); + #line 11112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 61884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 11112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 61889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont2(Version && readVer,int loopDepth) + int a_body1loopBody1cont2(Optional && val,int loopDepth) { - #line 8990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (readVer < begin) - #line 47759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (val.present()) + #line 61898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 8991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY); - #line 8991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 47765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 8991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 47770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 11096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 11097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version popVersion; + #line 11098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ChangeFeedStatus status; + #line 11099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::tie(range, popVersion, status) = decodeChangeFeedValue(val.get()); + #line 11100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (version > popVersion) + #line 61910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.set(rangeIDKey, changeFeedValue(range, version, status)); + #line 61914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } } else { - #line 8994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_2 = tr.get(rangeIDKey); - #line 8994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 47779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when2(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 8994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 47784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 11104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(tr.getReadVersion().isReady()); + #line 11105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent(SevDebug, "ChangeFeedNotRegisteredPop") .detail("FeedID", rangeID) .detail("FullFeedKey", rangeIDKey) .detail("PopVersion", version) .detail("ReadVersion", tr.getReadVersion().get()); + #line 11110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1loopBody1Catch1(change_feed_not_registered(), loopDepth); + #line 61925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + #line 11112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = tr.commit(); + #line 11112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 61931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 11112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 61936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1when1(Version const& readVer,int loopDepth) + int a_body1loopBody1when1(Optional const& val,int loopDepth) { - loopDepth = a_body1loopBody1cont2(readVer, loopDepth); + loopDepth = a_body1loopBody1cont2(val, loopDepth); return loopDepth; } - int a_body1loopBody1when1(Version && readVer,int loopDepth) + int a_body1loopBody1when1(Optional && val,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(readVer), loopDepth); + loopDepth = a_body1loopBody1cont2(std::move(val), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetChangeFeedRangeActor, 0, Version >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PopChangeFeedBackupActor, 0, Optional >::remove(); } - void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 0, Version >*,Version const& value) + void a_callback_fire(ActorCallback< PopChangeFeedBackupActor, 0, Optional >*,Optional const& value) { - fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 0); + fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -47817,12 +61968,12 @@ class GetChangeFeedRangeActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 0); + fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 0, Version >*,Version && value) + void a_callback_fire(ActorCallback< PopChangeFeedBackupActor, 0, Optional >*,Optional && value) { - fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 0); + fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -47832,12 +61983,12 @@ class GetChangeFeedRangeActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 0); + fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetChangeFeedRangeActor, 0, Version >*,Error err) + void a_callback_error(ActorCallback< PopChangeFeedBackupActor, 0, Optional >*,Error err) { - fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 0); + fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1Catch1(err, 0); @@ -47847,54 +61998,54 @@ class GetChangeFeedRangeActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 0); - - } - int a_body1loopBody1cont3(int loopDepth) - { - loopDepth = a_body1loopBody1cont10(loopDepth); + fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1loopBody1cont4(Void const& _,int loopDepth) + int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 8992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr.reset(); - #line 47863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); + #line 11113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PopChangeFeedBackupActorState(); static_cast(this)->destroy(); return 0; } + #line 62008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PopChangeFeedBackupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1loopBody1cont4(Void && _,int loopDepth) + int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 8992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr.reset(); - #line 47872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); + #line 11113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PopChangeFeedBackupActorState(); static_cast(this)->destroy(); return 0; } + #line 62020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PopChangeFeedBackupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } int a_body1loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(_, loopDepth); + loopDepth = a_body1loopBody1cont3(_, loopDepth); return loopDepth; } int a_body1loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetChangeFeedRangeActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PopChangeFeedBackupActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PopChangeFeedBackupActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 1); + fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1cont2when1(value, 0); @@ -47904,12 +62055,12 @@ class GetChangeFeedRangeActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 1); + fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< PopChangeFeedBackupActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 1); + fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1cont2when1(std::move(value), 0); @@ -47919,12 +62070,12 @@ class GetChangeFeedRangeActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 1); + fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< GetChangeFeedRangeActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< PopChangeFeedBackupActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 1); + fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1Catch1(err, 0); @@ -47934,148 +62085,8 @@ class GetChangeFeedRangeActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 1); - - } - int a_body1loopBody1cont6(Optional const& val,int loopDepth) - { - #line 8995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!val.present()) - #line 47944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1loopBody1Catch1(change_feed_not_registered(), loopDepth); - #line 47948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (db->changeFeedCache.size() > CLIENT_KNOBS->CHANGE_FEED_CACHE_SIZE) - #line 47952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - db->changeFeedCache.clear(); - #line 47956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRange range = std::get<0>(decodeChangeFeedValue(val.get())); - #line 9002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - db->changeFeedCache[rangeID] = range; - #line 9003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(range); this->~GetChangeFeedRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 47964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< KeyRange >::value()) KeyRange(range); - this->~GetChangeFeedRangeActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont6(Optional && val,int loopDepth) - { - #line 8995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!val.present()) - #line 47976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1loopBody1Catch1(change_feed_not_registered(), loopDepth); - #line 47980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 8998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (db->changeFeedCache.size() > CLIENT_KNOBS->CHANGE_FEED_CACHE_SIZE) - #line 47984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 8999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - db->changeFeedCache.clear(); - #line 47988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRange range = std::get<0>(decodeChangeFeedValue(val.get())); - #line 9002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - db->changeFeedCache[rangeID] = range; - #line 9003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(range); this->~GetChangeFeedRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 47996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< KeyRange >::value()) KeyRange(range); - this->~GetChangeFeedRangeActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont2when2(Optional const& val,int loopDepth) - { - loopDepth = a_body1loopBody1cont6(val, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont2when2(Optional && val,int loopDepth) - { - loopDepth = a_body1loopBody1cont6(std::move(val), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetChangeFeedRangeActor, 2, Optional >::remove(); - - } - void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 2, Optional >*,Optional const& value) - { - fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont2when2(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 2, Optional >*,Optional && value) - { - fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont2when2(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< GetChangeFeedRangeActor, 2, Optional >*,Error err) - { - fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 2); - - } - int a_body1loopBody1cont10(int loopDepth) - { - try { - loopDepth = a_body1loopBody1cont1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } + fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 1); - return loopDepth; } int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { @@ -48101,16 +62112,16 @@ class GetChangeFeedRangeActorState { return loopDepth; } - void a_exitChoose4() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetChangeFeedRangeActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PopChangeFeedBackupActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PopChangeFeedBackupActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1loopBody1Catch1when1(value, 0); } @@ -48119,13 +62130,13 @@ class GetChangeFeedRangeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 3); + fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< GetChangeFeedRangeActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< PopChangeFeedBackupActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1loopBody1Catch1when1(std::move(value), 0); } @@ -48134,13 +62145,13 @@ class GetChangeFeedRangeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 3); + fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< GetChangeFeedRangeActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< PopChangeFeedBackupActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -48149,51 +62160,48 @@ class GetChangeFeedRangeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), 3); + fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 2); } - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference db; - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key rangeID; - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version begin; - #line 8978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 11087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction tr; - #line 8979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key rangeIDKey; - #line 48167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 62176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via getChangeFeedRange() - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetChangeFeedRangeActor final : public Actor, public ActorCallback< GetChangeFeedRangeActor, 0, Version >, public ActorCallback< GetChangeFeedRangeActor, 1, Void >, public ActorCallback< GetChangeFeedRangeActor, 2, Optional >, public ActorCallback< GetChangeFeedRangeActor, 3, Void >, public FastAllocated, public GetChangeFeedRangeActorState { - #line 48172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via popChangeFeedBackup() + #line 11085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class PopChangeFeedBackupActor final : public Actor, public ActorCallback< PopChangeFeedBackupActor, 0, Optional >, public ActorCallback< PopChangeFeedBackupActor, 1, Void >, public ActorCallback< PopChangeFeedBackupActor, 2, Void >, public FastAllocated, public PopChangeFeedBackupActorState { + #line 62181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetChangeFeedRangeActor, 0, Version >; -friend struct ActorCallback< GetChangeFeedRangeActor, 1, Void >; -friend struct ActorCallback< GetChangeFeedRangeActor, 2, Optional >; -friend struct ActorCallback< GetChangeFeedRangeActor, 3, Void >; - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetChangeFeedRangeActor(Reference const& db,Database const& cx,Key const& rangeID,Version const& begin = 0) - #line 48186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - GetChangeFeedRangeActorState(db, cx, rangeID, begin) +friend struct ActorCallback< PopChangeFeedBackupActor, 0, Optional >; +friend struct ActorCallback< PopChangeFeedBackupActor, 1, Void >; +friend struct ActorCallback< PopChangeFeedBackupActor, 2, Void >; + #line 11085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + PopChangeFeedBackupActor(Database const& cx,Key const& rangeID,Version const& version) + #line 62194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + PopChangeFeedBackupActorState(cx, rangeID, version) { - fdb_probe_actor_enter("getChangeFeedRange", reinterpret_cast(this), -1); + fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getChangeFeedRange"); + this->lineage.setActorName("popChangeFeedBackup"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("getChangeFeedRange", reinterpret_cast(this), -1); + fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), -1); } void cancel() override @@ -48201,77 +62209,113 @@ friend struct ActorCallback< GetChangeFeedRangeActor, 3, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetChangeFeedRangeActor, 0, Version >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetChangeFeedRangeActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< GetChangeFeedRangeActor, 2, Optional >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< GetChangeFeedRangeActor, 3, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< PopChangeFeedBackupActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< PopChangeFeedBackupActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< PopChangeFeedBackupActor, 2, Void >*)0, actor_cancelled()); break; } } }; } - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future getChangeFeedRange( Reference const& db, Database const& cx, Key const& rangeID, Version const& begin = 0 ) { - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new GetChangeFeedRangeActor(db, cx, rangeID, begin)); - #line 48217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] static Future popChangeFeedBackup( Database const& cx, Key const& rangeID, Version const& version ) { + #line 11085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new PopChangeFeedBackupActor(cx, rangeID, version)); + #line 62224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 9010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 11119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 48222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 62229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via singleChangeFeedStreamInternal() - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class SingleChangeFeedStreamInternalActorState { - #line 48229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via popChangeFeedMutationsActor() + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class PopChangeFeedMutationsActorActorState { + #line 62236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SingleChangeFeedStreamInternalActorState(KeyRange const& range,Reference const& results,Key const& rangeID,Version* const& begin,Version const& end) - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : range(range), - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results(results), - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + PopChangeFeedMutationsActorActorState(Reference const& db,Key const& rangeID,Version const& version) + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db), + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" rangeID(rangeID), - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - begin(begin), - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - end(end), - #line 9017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - refresh(results->refresh) - #line 48246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version), + #line 11121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx(db), + #line 11122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeIDKey(rangeID.withPrefix(changeFeedPrefix)), + #line 11123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + span("NAPI:PopChangeFeedMutations"_loc) + #line 62253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("singleChangeFeedStreamInternal", reinterpret_cast(this)); + fdb_probe_actor_create("popChangeFeedMutationsActor", reinterpret_cast(this)); } - ~SingleChangeFeedStreamInternalActorState() + ~PopChangeFeedMutationsActorActorState() { - fdb_probe_actor_destroy("singleChangeFeedStreamInternal", reinterpret_cast(this)); + fdb_probe_actor_destroy("popChangeFeedMutationsActor", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 9018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(results->streams.size() == 1); - #line 9019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(results->storageData.size() == 1); - #line 9020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - atLatest = false; - #line 9023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = results->mutations.onEmpty(); - #line 9023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 48269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->usedAnyChangeFeeds = true; + #line 11125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ++db->feedPops; + #line 11127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (db->rangeId_cacheData.count(rangeID)) + #line 62272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto& feeds = db->rangeId_cacheData[rangeID]; + #line 11129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& it : feeds ) { + #line 11130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (version > it.second->popped) + #line 62280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + it.second->popped = version; + #line 11132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key beginKey = changeFeedCacheKey(it.first.tenantPrefix, it.first.rangeId, it.first.range, 0); + #line 11133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key endKey = changeFeedCacheKey(it.first.tenantPrefix, it.first.rangeId, it.first.range, version); + #line 11134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->storage->clear(KeyRangeRef(beginKey, endKey)); + #line 11135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key durableFeedKey = changeFeedCacheFeedKey(it.first.tenantPrefix, it.first.rangeId, it.first.range); + #line 11136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Value durableFeedValue = changeFeedCacheFeedValue(it.second->version, it.second->popped); + #line 11137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->storage->set(KeyValueRef(durableFeedKey, durableFeedValue)); + #line 11138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->uncommittedCFBytes += beginKey.size() + endKey.size() + durableFeedKey.size() + durableFeedValue.size(); + #line 11140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (db->uncommittedCFBytes > CLIENT_KNOBS->CHANGE_FEED_CACHE_FLUSH_BYTES) + #line 62300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->commitChangeFeedStorage->set(true); + #line 62304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + } + } + } + #line 11147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = getChangeFeedRange(db, cx, rangeID); + #line 11147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 62313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 9023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 48274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 11147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 62318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -48284,65 +62328,53 @@ class SingleChangeFeedStreamInternalActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~SingleChangeFeedStreamInternalActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) - { - #line 9024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = delay(0); - #line 9024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 48299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 9024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 48304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + this->~PopChangeFeedMutationsActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1cont1(int loopDepth) { - #line 9024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = delay(0); - #line 9024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 48315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_1 = getKeyRangeLocations(cx, TenantInfo(), keys, 3, Reverse::False, &StorageServerInterface::changeFeedPop, span.context, Optional(), UseProvisionalProxies::False, latestVersion); + #line 11149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 62343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 9024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 48320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 11149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 62348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1when1(KeyRange const& __keys,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + #line 11147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + keys = __keys; + #line 62357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1when1(KeyRange && __keys,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + keys = std::move(__keys); + loopDepth = a_body1cont1(loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SingleChangeFeedStreamInternalActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 0, KeyRange >::remove(); } - void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 0, KeyRange >*,KeyRange const& value) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 0); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -48352,12 +62384,12 @@ class SingleChangeFeedStreamInternalActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 0); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 0, KeyRange >*,KeyRange && value) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 0); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -48367,12 +62399,12 @@ class SingleChangeFeedStreamInternalActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 0); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< SingleChangeFeedStreamInternalActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 0, KeyRange >*,Error err) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 0); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -48382,68 +62414,59 @@ class SingleChangeFeedStreamInternalActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 0); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 0); } - int a_body1cont2(Void const& _,int loopDepth) + int a_body1cont6(int loopDepth) { - #line 9025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(results->mutations.isEmpty()); - #line 9027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (*begin - 1 > results->lastReturnedVersion.get()) - #line 48394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (locations.size() > 2) + #line 62424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->lastReturnedVersion.set(*begin - 1); - #line 48398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = popChangeFeedBackup(cx, rangeID, version); + #line 11162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 62430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont6when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 11162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 62435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } - #line 9031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 48402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont2loopHead1(loopDepth); - - return loopDepth; - } - int a_body1cont2(Void && _,int loopDepth) - { - #line 9025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(results->mutations.isEmpty()); - #line 9027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (*begin - 1 > results->lastReturnedVersion.get()) - #line 48413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + else { - #line 9028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->lastReturnedVersion.set(*begin - 1); - #line 48417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont7(loopDepth); } - #line 9031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 48421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont2loopHead1(loopDepth); return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1cont1when1(std::vector const& __locations,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + #line 11149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + locations = __locations; + #line 62449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont6(loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1cont1when1(std::vector && __locations,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + locations = std::move(__locations); + loopDepth = a_body1cont6(loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SingleChangeFeedStreamInternalActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 1, std::vector >::remove(); } - void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 1, std::vector >*,std::vector const& value) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 1); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -48453,12 +62476,12 @@ class SingleChangeFeedStreamInternalActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 1); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 1, std::vector >*,std::vector && value) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 1); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -48468,12 +62491,12 @@ class SingleChangeFeedStreamInternalActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 1); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< SingleChangeFeedStreamInternalActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 1, std::vector >*,Error err) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 1); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -48483,140 +62506,135 @@ class SingleChangeFeedStreamInternalActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 1); - - } - int a_body1cont2loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont2loopBody1(loopDepth); - - return loopDepth; - } - int a_body1cont2loopBody1(int loopDepth) - { - #line 9033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - FutureStream __when_expr_2 = results->streams[0].getFuture(); - #line 9033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 48502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1when1(__when_expr_2.pop(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 9033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 48507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1cont2loopBody1cont1(int loopDepth) + int a_body1cont7(int loopDepth) { - #line 9034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - *begin = feedReply.mutations.back().version + 1; - #line 9036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (feedReply.popVersion > results->popVersion) - #line 48518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->popVersion = feedReply.popVersion; - #line 48522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bool anyMutations = false; - #line 9042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : feedReply.mutations ) { - #line 9043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!it.mutations.empty()) - #line 48530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - anyMutations = true; - #line 48534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - break; + #line 11166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto model = cx->enableLocalityLoadBalance ? &cx->queueModel : nullptr; + #line 11168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool foundFailed = false; + #line 11169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < locations.size() && !foundFailed;i++) { + #line 11170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int j = 0;j < locations[i].locations->size() && !foundFailed;j++) { + #line 11171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (IFailureMonitor::failureMonitor() .getState(locations[i].locations->get(j, &StorageServerInterface::changeFeedPop).getEndpoint()) .isFailed()) + #line 62524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + foundFailed = true; + #line 62528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (model && model ->getTssData(locations[i] .locations->get(j, &StorageServerInterface::changeFeedPop) .getEndpoint() .token.first()) .present()) + #line 62532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + foundFailed = true; + #line 62536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } } } - #line 9048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (anyMutations) - #line 48540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (foundFailed) + #line 62542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(feedReply.mutations.front().version > results->lastReturnedVersion.get()); - #line 9053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->mutations.send( Standalone>(feedReply.mutations, feedReply.arena)); - #line 9057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = results->mutations.onEmpty(); - #line 9057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 48550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1cont1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 9057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 48555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = popChangeFeedBackup(cx, rangeID, version); + #line 11189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 62548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont7when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 11189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 62553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } else { - loopDepth = a_body1cont2loopBody1cont2(loopDepth); + loopDepth = a_body1cont10(loopDepth); } return loopDepth; } - int a_body1cont2loopBody1when1(ChangeFeedStreamReply const& __feedReply,int loopDepth) + int a_body1cont8(Void const& _,int loopDepth) { - #line 9033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - feedReply = __feedReply; - #line 48569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont2loopBody1cont1(loopDepth); + #line 11163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PopChangeFeedMutationsActorActorState(); static_cast(this)->destroy(); return 0; } + #line 62567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PopChangeFeedMutationsActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont2loopBody1when1(ChangeFeedStreamReply && __feedReply,int loopDepth) + int a_body1cont8(Void && _,int loopDepth) { - feedReply = std::move(__feedReply); - loopDepth = a_body1cont2loopBody1cont1(loopDepth); + #line 11163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PopChangeFeedMutationsActorActorState(); static_cast(this)->destroy(); return 0; } + #line 62579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PopChangeFeedMutationsActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont6when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8(_, loopDepth); + + return loopDepth; + } + int a_body1cont6when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont8(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorSingleCallback< SingleChangeFeedStreamInternalActor, 2, ChangeFeedStreamReply >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 2, Void >::remove(); } - void a_callback_fire(ActorSingleCallback< SingleChangeFeedStreamInternalActor, 2, ChangeFeedStreamReply >*,ChangeFeedStreamReply const& value) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 2); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2loopBody1when1(value, 0); + a_body1cont6when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 2); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 2); } - void a_callback_fire(ActorSingleCallback< SingleChangeFeedStreamInternalActor, 2, ChangeFeedStreamReply >*,ChangeFeedStreamReply && value) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 2); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2loopBody1when1(std::move(value), 0); + a_body1cont6when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 2); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 2); } - void a_callback_error(ActorSingleCallback< SingleChangeFeedStreamInternalActor, 2, ChangeFeedStreamReply >*,Error err) + void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 2); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -48626,132 +62644,124 @@ class SingleChangeFeedStreamInternalActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 2); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 2); } - int a_body1cont2loopBody1cont2(int loopDepth) + int a_body1cont10(int loopDepth) { - #line 9063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (feedReply.mutations.back().version > results->lastReturnedVersion.get()) - #line 48636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->lastReturnedVersion.set(feedReply.mutations.back().version); - #line 48640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!refresh.canBeSet()) - #line 48644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - try { - #line 9070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_5 = Future(Void()); - #line 9070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1cont2Catch1(actor_cancelled(), loopDepth); - #line 48651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont2loopBody1cont2Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2loopBody1cont2when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 9070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 48656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont2loopBody1cont2Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont2loopBody1cont2Catch1(unknown_error(), loopDepth); + try { + #line 11195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> popRequests; + #line 11196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < locations.size();i++) { + #line 11197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int j = 0;j < locations[i].locations->size();j++) { + #line 11198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + popRequests.push_back(locations[i].locations->getInterface(j).changeFeedPop.getReply( ChangeFeedPopRequest(rangeID, version, locations[i].range))); + #line 62661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } } + #line 11203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = waitForAll(popRequests); + #line 11202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont10Catch1(actor_cancelled(), loopDepth); + #line 62668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont10Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont10when1(__when_expr_4.get(), loopDepth); }; + #line 11204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_5 = delay(CLIENT_KNOBS->CHANGE_FEED_POP_TIMEOUT); + #line 62672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont10Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont10when2(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 11203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 11204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 62679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } - else - { - loopDepth = a_body1cont2loopBody1cont8(loopDepth); + catch (Error& error) { + loopDepth = a_body1cont10Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont10Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1cont2loopBody1cont6(Void const& _,int loopDepth) + int a_body1cont15(Void const& _,int loopDepth) { - #line 9058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_4 = delay(0); - #line 9058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 48678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1cont6when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 9058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 48683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 11190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PopChangeFeedMutationsActorActorState(); static_cast(this)->destroy(); return 0; } + #line 62694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PopChangeFeedMutationsActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont2loopBody1cont6(Void && _,int loopDepth) + int a_body1cont15(Void && _,int loopDepth) { - #line 9058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_4 = delay(0); - #line 9058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 48694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1cont6when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 9058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 48699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 11190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PopChangeFeedMutationsActorActorState(); static_cast(this)->destroy(); return 0; } + #line 62706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PopChangeFeedMutationsActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont2loopBody1cont1when1(Void const& _,int loopDepth) + int a_body1cont7when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont6(_, loopDepth); + loopDepth = a_body1cont15(_, loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont1when1(Void && _,int loopDepth) + int a_body1cont7when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont6(std::move(_), loopDepth); + loopDepth = a_body1cont15(std::move(_), loopDepth); return loopDepth; } void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SingleChangeFeedStreamInternalActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 3); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont2loopBody1cont1when1(value, 0); + a_body1cont7when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 3); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 3); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont2loopBody1cont1when1(std::move(value), 0); + a_body1cont7when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 3); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< SingleChangeFeedStreamInternalActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 3); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 3); a_exitChoose4(); try { a_body1Catch1(err, 0); @@ -48761,409 +62771,282 @@ class SingleChangeFeedStreamInternalActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 3); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 3); + + } + int a_body1cont10cont1(int loopDepth) + { + #line 11218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PopChangeFeedMutationsActorActorState(); static_cast(this)->destroy(); return 0; } + #line 62781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PopChangeFeedMutationsActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont10Catch1(const Error& e,int loopDepth=0) + { + try { + #line 11209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (e.code() != error_code_unknown_change_feed && e.code() != error_code_wrong_shard_server && e.code() != error_code_all_alternatives_failed && e.code() != error_code_broken_promise && e.code() != error_code_server_overloaded) + #line 62794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 62798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db->changeFeedCache.erase(rangeID); + #line 11215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx->invalidateCache({}, keys); + #line 11216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_7 = popChangeFeedBackup(cx, rangeID, version); + #line 11216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 62808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont10Catch1when1(__when_expr_7.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 11216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 62813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + return loopDepth; } - int a_body1cont2loopBody1cont7(Void const& _,int loopDepth) + int a_body1cont10cont2(int loopDepth) { - loopDepth = a_body1cont2loopBody1cont2(loopDepth); + loopDepth = a_body1cont10cont5(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont7(Void && _,int loopDepth) + int a_body1cont10when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont2(loopDepth); + loopDepth = a_body1cont10cont2(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont6when1(Void const& _,int loopDepth) + int a_body1cont10when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont7(_, loopDepth); + loopDepth = a_body1cont10cont2(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont6when1(Void && _,int loopDepth) + int a_body1cont10when2(Void const& _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont7(std::move(_), loopDepth); + #line 11205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_6 = popChangeFeedBackup(cx, rangeID, version); + #line 11205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont10Catch1(actor_cancelled(), loopDepth); + #line 62848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont10Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont10when2when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 11205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 62853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - void a_exitChoose5() + int a_body1cont10when2(Void && _,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SingleChangeFeedStreamInternalActor, 4, Void >::remove(); + #line 11205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_6 = popChangeFeedBackup(cx, rangeID, version); + #line 11205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont10Catch1(actor_cancelled(), loopDepth); + #line 62864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont10Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont10when2when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 11205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 62869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + return loopDepth; } - void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 4, Void >*,Void const& value) + void a_exitChoose5() { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont2loopBody1cont6when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 4); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 4, Void >::remove(); + static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 5, Void >::remove(); } - void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 4, Void >*,Void const& value) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 4); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 4); a_exitChoose5(); try { - a_body1cont2loopBody1cont6when1(std::move(value), 0); + a_body1cont10when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont10Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont10Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 4); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< SingleChangeFeedStreamInternalActor, 4, Void >*,Error err) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 4); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 4); a_exitChoose5(); try { - a_body1Catch1(err, 0); + a_body1cont10when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont10Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 4); - - } - int a_body1cont2loopBody1cont8(int loopDepth) - { - #line 9079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!atLatest && feedReply.atLatestVersion) - #line 48846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - atLatest = true; - #line 9081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->notAtLatest.set(0); - #line 48852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (feedReply.minStreamVersion > results->storageData[0]->version.get()) - #line 48856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->storageData[0]->version.set(feedReply.minStreamVersion); - #line 48860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + a_body1cont10Catch1(unknown_error(), 0); } - if (loopDepth == 0) return a_body1cont2loopHead1(0); - - return loopDepth; - } - int a_body1cont2loopBody1cont10(int loopDepth) - { - loopDepth = a_body1cont2loopBody1cont8(loopDepth); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 4); - return loopDepth; } - int a_body1cont2loopBody1cont2Catch1(const Error& e,int loopDepth=0) + void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 4, Void >*,Error err) { + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 4); + a_exitChoose5(); try { - #line 9074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(e.code() == error_code_actor_cancelled); - #line 9075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 48879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + a_body1cont10Catch1(err, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + a_body1cont10Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + a_body1cont10Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 4); - return loopDepth; } - int a_body1cont2loopBody1cont11(Void const& _,int loopDepth) + int a_body1cont10when2cont1(Void const& _,int loopDepth) { - #line 9072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(false); - #line 48893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont2loopBody1cont11cont2(loopDepth); + loopDepth = a_body1cont10cont2(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont11(Void && _,int loopDepth) + int a_body1cont10when2cont1(Void && _,int loopDepth) { - #line 9072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT(false); - #line 48902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont2loopBody1cont11cont2(loopDepth); + loopDepth = a_body1cont10cont2(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont2when1(Void const& _,int loopDepth) + int a_body1cont10when2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont11(_, loopDepth); + loopDepth = a_body1cont10when2cont1(_, loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont2when1(Void && _,int loopDepth) + int a_body1cont10when2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont11(std::move(_), loopDepth); + loopDepth = a_body1cont10when2cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose6() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SingleChangeFeedStreamInternalActor, 5, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 6, Void >::remove(); } - void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 5, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 6, Void >*,Void const& value) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 5); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 6); a_exitChoose6(); try { - a_body1cont2loopBody1cont2when1(value, 0); + a_body1cont10when2when1(value, 0); } catch (Error& error) { - a_body1cont2loopBody1cont2Catch1(error, 0); + a_body1cont10Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1cont2Catch1(unknown_error(), 0); + a_body1cont10Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 5); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 6); } - void a_callback_fire(ActorCallback< SingleChangeFeedStreamInternalActor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 6, Void >*,Void && value) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 5); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 6); a_exitChoose6(); try { - a_body1cont2loopBody1cont2when1(std::move(value), 0); + a_body1cont10when2when1(std::move(value), 0); } catch (Error& error) { - a_body1cont2loopBody1cont2Catch1(error, 0); + a_body1cont10Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1cont2Catch1(unknown_error(), 0); + a_body1cont10Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 5); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 6); } - void a_callback_error(ActorCallback< SingleChangeFeedStreamInternalActor, 5, Void >*,Error err) + void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 6, Void >*,Error err) { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), 5); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 6); a_exitChoose6(); try { - a_body1cont2loopBody1cont2Catch1(err, 0); + a_body1cont10Catch1(err, 0); } catch (Error& error) { - a_body1cont2loopBody1cont2Catch1(error, 0); + a_body1cont10Catch1(error, 0); } catch (...) { - a_body1cont2loopBody1cont2Catch1(unknown_error(), 0); + a_body1cont10Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), 5); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 6); } - int a_body1cont2loopBody1cont11cont2(int loopDepth) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 5, Void >*,Void const& value) { + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 5); + a_exitChoose5(); try { - loopDepth = a_body1cont2loopBody1cont10(loopDepth); + a_body1cont10when2(value, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + a_body1cont10Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + a_body1cont10Catch1(unknown_error(), 0); } - - return loopDepth; - } - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRange range; - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference results; - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key rangeID; - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version* begin; - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version end; - #line 9017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Promise refresh; - #line 9020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bool atLatest; - #line 9033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ChangeFeedStreamReply feedReply; - #line 48999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -}; -// This generated class is to be used only via singleChangeFeedStreamInternal() - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class SingleChangeFeedStreamInternalActor final : public Actor, public ActorCallback< SingleChangeFeedStreamInternalActor, 0, Void >, public ActorCallback< SingleChangeFeedStreamInternalActor, 1, Void >, public ActorSingleCallback< SingleChangeFeedStreamInternalActor, 2, ChangeFeedStreamReply >, public ActorCallback< SingleChangeFeedStreamInternalActor, 3, Void >, public ActorCallback< SingleChangeFeedStreamInternalActor, 4, Void >, public ActorCallback< SingleChangeFeedStreamInternalActor, 5, Void >, public FastAllocated, public SingleChangeFeedStreamInternalActorState { - #line 49004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< SingleChangeFeedStreamInternalActor, 0, Void >; -friend struct ActorCallback< SingleChangeFeedStreamInternalActor, 1, Void >; -friend struct ActorSingleCallback< SingleChangeFeedStreamInternalActor, 2, ChangeFeedStreamReply >; -friend struct ActorCallback< SingleChangeFeedStreamInternalActor, 3, Void >; -friend struct ActorCallback< SingleChangeFeedStreamInternalActor, 4, Void >; -friend struct ActorCallback< SingleChangeFeedStreamInternalActor, 5, Void >; - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SingleChangeFeedStreamInternalActor(KeyRange const& range,Reference const& results,Key const& rangeID,Version* const& begin,Version const& end) - #line 49020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - SingleChangeFeedStreamInternalActorState(range, results, rangeID, begin, end) - { - fdb_probe_actor_enter("singleChangeFeedStreamInternal", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("singleChangeFeedStreamInternal"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("singleChangeFeedStreamInternal", reinterpret_cast(this), -1); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 5); } - void cancel() override + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 5, Void >*,Void && value) { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< SingleChangeFeedStreamInternalActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< SingleChangeFeedStreamInternalActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorSingleCallback< SingleChangeFeedStreamInternalActor, 2, ChangeFeedStreamReply >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< SingleChangeFeedStreamInternalActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< SingleChangeFeedStreamInternalActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< SingleChangeFeedStreamInternalActor, 5, Void >*)0, actor_cancelled()); break; + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 5); + a_exitChoose5(); + try { + a_body1cont10when2(std::move(value), 0); } + catch (Error& error) { + a_body1cont10Catch1(error, 0); + } catch (...) { + a_body1cont10Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 5); } -}; -} - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future singleChangeFeedStreamInternal( KeyRange const& range, Reference const& results, Key const& rangeID, Version* const& begin, Version const& end ) { - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new SingleChangeFeedStreamInternalActor(range, results, rangeID, begin, end)); - #line 49053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -} - -#line 9089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - - #line 49058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via singleChangeFeedStream() - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class SingleChangeFeedStreamActorState { - #line 49065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SingleChangeFeedStreamActorState(Reference const& db,StorageServerInterface const& interf,KeyRange const& range,Reference const& results,Key const& rangeID,Version* const& begin,Version const& end,int const& replyBufferSize,bool const& canReadPopped) - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : db(db), - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - interf(interf), - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - range(range), - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results(results), - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - rangeID(rangeID), - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - begin(begin), - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - end(end), - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - replyBufferSize(replyBufferSize), - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - canReadPopped(canReadPopped), - #line 9099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx(db), - #line 9100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req() - #line 49092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - fdb_probe_actor_create("singleChangeFeedStream", reinterpret_cast(this)); - - } - ~SingleChangeFeedStreamActorState() + void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 5, Void >*,Error err) { - fdb_probe_actor_destroy("singleChangeFeedStream", reinterpret_cast(this)); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 5); + a_exitChoose5(); + try { + a_body1cont10Catch1(err, 0); + } + catch (Error& error) { + a_body1cont10Catch1(error, 0); + } catch (...) { + a_body1cont10Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 5); } - int a_body1(int loopDepth=0) + int a_body1cont10cont5(int loopDepth) { try { - #line 9101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.rangeID = rangeID; - #line 9102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.begin = *begin; - #line 9103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.end = end; - #line 9104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.range = range; - #line 9105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.canReadPopped = canReadPopped; - #line 9106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.replyBufferSize = replyBufferSize; - #line 9107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.debugUID = deterministicRandom()->randomUniqueID(); - #line 9109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (DEBUG_CF_CLIENT_TRACE) - #line 49121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevDebug, "TraceChangeFeedClientSingleCursor", req.debugUID) .detail("FeedID", rangeID) .detail("Range", range) .detail("Begin", *begin) .detail("End", end) .detail("CanReadPopped", canReadPopped); - #line 49125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->streams.clear(); - #line 9120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : results->storageData ) { - #line 9121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (it->debugGetReferenceCount() == 2) - #line 49133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - db->changeFeedUpdaters.erase(it->interfToken); - #line 49137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - #line 9125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->streams.push_back(interf.changeFeedStream.getReplyStream(req)); - #line 9127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->maxSeenVersion = invalidVersion; - #line 9128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->storageData.clear(); - #line 9129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->storageData.push_back(db->getStorageData(interf)); - #line 9130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Promise refresh = results->refresh; - #line 9131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->refresh = Promise(); - #line 9132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->notAtLatest.set(1); - #line 9133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - refresh.send(Void()); - #line 9135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = results->streams[0].onError() || singleChangeFeedStreamInternal(range, results, rangeID, begin, end); - #line 9135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 49160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 9135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1cont10cont1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -49173,90 +63056,70 @@ class SingleChangeFeedStreamActorState { return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~SingleChangeFeedStreamActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) + int a_body1cont10Catch1cont1(Void const& _,int loopDepth) { - #line 9137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SingleChangeFeedStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 49188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~SingleChangeFeedStreamActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont10cont1(loopDepth); return loopDepth; } - int a_body1cont1(Void && _,int loopDepth) + int a_body1cont10Catch1cont1(Void && _,int loopDepth) { - #line 9137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SingleChangeFeedStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 49200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~SingleChangeFeedStreamActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont10cont1(loopDepth); return loopDepth; } - int a_body1when1(Void const& _,int loopDepth) + int a_body1cont10Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(_, loopDepth); + loopDepth = a_body1cont10Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1when1(Void && _,int loopDepth) + int a_body1cont10Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont10Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose7() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SingleChangeFeedStreamActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >::remove(); } - void a_callback_fire(ActorCallback< SingleChangeFeedStreamActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >*,Void const& value) { - fdb_probe_actor_enter("singleChangeFeedStream", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 7); + a_exitChoose7(); try { - a_body1when1(value, 0); + a_body1cont10Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStream", reinterpret_cast(this), 0); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 7); } - void a_callback_fire(ActorCallback< SingleChangeFeedStreamActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >*,Void && value) { - fdb_probe_actor_enter("singleChangeFeedStream", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 7); + a_exitChoose7(); try { - a_body1when1(std::move(value), 0); + a_body1cont10Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStream", reinterpret_cast(this), 0); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 7); } - void a_callback_error(ActorCallback< SingleChangeFeedStreamActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >*,Error err) { - fdb_probe_actor_enter("singleChangeFeedStream", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 7); + a_exitChoose7(); try { a_body1Catch1(err, 0); } @@ -49265,58 +63128,59 @@ class SingleChangeFeedStreamActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleChangeFeedStream", reinterpret_cast(this), 0); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 7); } - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference db; - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StorageServerInterface interf; - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRange range; - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference results; - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Key rangeID; - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version* begin; - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version end; - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int replyBufferSize; - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bool canReadPopped; - #line 9099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version version; + #line 11121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 9100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ChangeFeedStreamRequest req; - #line 49293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key rangeIDKey; + #line 11123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Span span; + #line 11147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange keys; + #line 11149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector locations; + #line 63150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via singleChangeFeedStream() - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class SingleChangeFeedStreamActor final : public Actor, public ActorCallback< SingleChangeFeedStreamActor, 0, Void >, public FastAllocated, public SingleChangeFeedStreamActorState { - #line 49298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via popChangeFeedMutationsActor() + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class PopChangeFeedMutationsActorActor final : public Actor, public ActorCallback< PopChangeFeedMutationsActorActor, 0, KeyRange >, public ActorCallback< PopChangeFeedMutationsActorActor, 1, std::vector >, public ActorCallback< PopChangeFeedMutationsActorActor, 2, Void >, public ActorCallback< PopChangeFeedMutationsActorActor, 3, Void >, public ActorCallback< PopChangeFeedMutationsActorActor, 4, Void >, public ActorCallback< PopChangeFeedMutationsActorActor, 5, Void >, public ActorCallback< PopChangeFeedMutationsActorActor, 6, Void >, public ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >, public FastAllocated, public PopChangeFeedMutationsActorActorState { + #line 63155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< SingleChangeFeedStreamActor, 0, Void >; - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SingleChangeFeedStreamActor(Reference const& db,StorageServerInterface const& interf,KeyRange const& range,Reference const& results,Key const& rangeID,Version* const& begin,Version const& end,int const& replyBufferSize,bool const& canReadPopped) - #line 49309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +friend struct ActorCallback< PopChangeFeedMutationsActorActor, 0, KeyRange >; +friend struct ActorCallback< PopChangeFeedMutationsActorActor, 1, std::vector >; +friend struct ActorCallback< PopChangeFeedMutationsActorActor, 2, Void >; +friend struct ActorCallback< PopChangeFeedMutationsActorActor, 3, Void >; +friend struct ActorCallback< PopChangeFeedMutationsActorActor, 4, Void >; +friend struct ActorCallback< PopChangeFeedMutationsActorActor, 5, Void >; +friend struct ActorCallback< PopChangeFeedMutationsActorActor, 6, Void >; +friend struct ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >; + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + PopChangeFeedMutationsActorActor(Reference const& db,Key const& rangeID,Version const& version) + #line 63173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - SingleChangeFeedStreamActorState(db, interf, range, results, rangeID, begin, end, replyBufferSize, canReadPopped) + PopChangeFeedMutationsActorActorState(db, rangeID, version) { - fdb_probe_actor_enter("singleChangeFeedStream", reinterpret_cast(this), -1); + fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("singleChangeFeedStream"); + this->lineage.setActorName("popChangeFeedMutationsActor"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("singleChangeFeedStream", reinterpret_cast(this), -1); + fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), -1); } void cancel() override @@ -49324,75 +63188,76 @@ friend struct ActorCallback< SingleChangeFeedStreamActor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< SingleChangeFeedStreamActor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< PopChangeFeedMutationsActorActor, 0, KeyRange >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< PopChangeFeedMutationsActorActor, 1, std::vector >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< PopChangeFeedMutationsActorActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< PopChangeFeedMutationsActorActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< PopChangeFeedMutationsActorActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< PopChangeFeedMutationsActorActor, 6, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >*)0, actor_cancelled()); break; } } }; } - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future singleChangeFeedStream( Reference const& db, StorageServerInterface const& interf, KeyRange const& range, Reference const& results, Key const& rangeID, Version* const& begin, Version const& end, int const& replyBufferSize, bool const& canReadPopped ) { - #line 9090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new SingleChangeFeedStreamActor(db, interf, range, results, rangeID, begin, end, replyBufferSize, canReadPopped)); - #line 49337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future popChangeFeedMutationsActor( Reference const& db, Key const& rangeID, Version const& version ) { + #line 11120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new PopChangeFeedMutationsActorActor(db, rangeID, version)); + #line 63207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 11220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +Future DatabaseContext::popChangeFeedMutations(Key rangeID, Version version) { + return popChangeFeedMutationsActor(Reference::addRef(this), rangeID, version); } -#line 9139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +Reference DatabaseContext::createTransaction() { + return makeReference(Database(Reference::addRef(this))); +} - #line 49342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// BlobGranule API. + #line 63221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via getChangeFeedStreamActor() - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetChangeFeedStreamActorActorState { - #line 49349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via getBlobRanges() + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetBlobRangesActorState { + #line 63228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetChangeFeedStreamActorActorState(Reference const& db,Reference const& results,Key const& rangeID,Version const& begin,Version const& end,KeyRange const& range,int const& replyBufferSize,bool const& canReadPopped) - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : db(db), - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results(results), - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - rangeID(rangeID), - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - begin(begin), - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - end(end), - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetBlobRangesActorState(Transaction* const& tr,KeyRange const& range,int const& batchLimit) + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : tr(tr), + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" range(range), - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - replyBufferSize(replyBufferSize), - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - canReadPopped(canReadPopped), - #line 9148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx(db), - #line 9149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:GetChangeFeedStream"_loc) - #line 49374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + batchLimit(batchLimit), + #line 11231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + blobRanges(), + #line 11232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + beginKey(range.begin) + #line 63243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("getChangeFeedStreamActor", reinterpret_cast(this)); + fdb_probe_actor_create("getBlobRanges", reinterpret_cast(this)); } - ~GetChangeFeedStreamActorActorState() + ~GetBlobRangesActorState() { - fdb_probe_actor_destroy("getChangeFeedStreamActor", reinterpret_cast(this)); + fdb_probe_actor_destroy("getBlobRanges", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 9151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->endVersion = end; - #line 9153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - sleepWithBackoff = CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY; - #line 9154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - lastBeginVersion = invalidVersion; - #line 9156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 11236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 49395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 63260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -49405,8 +63270,8 @@ class GetChangeFeedStreamActorActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~GetChangeFeedStreamActorActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~GetBlobRangesActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; @@ -49420,715 +63285,455 @@ class GetChangeFeedStreamActorActorState { } int a_body1loopBody1(int loopDepth) { - #line 9157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - keys = KeyRange(); - #line 49425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - try { - #line 9159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - lastBeginVersion = begin; - #line 9160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = getChangeFeedRange(db, cx, rangeID, begin); - #line 9160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 49433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 9160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); - } + #line 11238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = krmGetRangesUnaligned(tr, blobRangeKeys.begin, KeyRangeRef(beginKey, range.end), 2 * batchLimit + 2); + #line 11238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 63292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 11238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 63297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 9240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_actor_cancelled || e.code() == error_code_change_feed_popped) - #line 49460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : results->storageData ) { - #line 9242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (it->debugGetReferenceCount() == 2) - #line 49466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - db->changeFeedUpdaters.erase(it->interfToken); - #line 49470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - #line 9246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->streams.clear(); - #line 9247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->storageData.clear(); - #line 9248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_change_feed_popped) - #line 49479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 9250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->mutations.sendError(e); - #line 9251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->refresh.sendError(e); - #line 49487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - else - { - #line 9253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->refresh.sendError(change_feed_cancelled()); - #line 49493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 49497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (results->notAtLatest.get() == 0) - #line 49501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->notAtLatest.set(1); - #line 49505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed || e.code() == error_code_connection_failed || e.code() == error_code_unknown_change_feed || e.code() == error_code_broken_promise) - #line 49509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + blobRanges.arena().dependsOn(results.arena()); + #line 11242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < results.size() - 1;i++) { + #line 11243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (isBlobRangeActive(results[i].value)) + #line 63310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - db->changeFeedCache.erase(rangeID); - #line 9265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(Key(), keys); - #line 9266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (begin == lastBeginVersion) - #line 49517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - sleepWithBackoff = std::min(1.0, sleepWithBackoff * 1.5); - #line 49521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - else - { - #line 9271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - sleepWithBackoff = CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY; - #line 49527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_5 = delay(sleepWithBackoff); - #line 9273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 49533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 9273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 11244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + blobRanges.push_back(blobRanges.arena(), KeyRangeRef(results[i].key, results[i + 1].key)); + #line 63314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - else + #line 11246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (blobRanges.size() == batchLimit) + #line 63318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->mutations.sendError(e); - #line 9276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->refresh.sendError(change_feed_cancelled()); - #line 9277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : results->storageData ) { - #line 9278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (it->debugGetReferenceCount() == 2) - #line 49551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - db->changeFeedUpdaters.erase(it->interfToken); - #line 49555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - #line 9282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->streams.clear(); - #line 9283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - results->storageData.clear(); - #line 9284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetChangeFeedStreamActorActorState(); static_cast(this)->destroy(); return 0; } - #line 49564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~GetChangeFeedStreamActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 11247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(blobRanges); this->~GetBlobRangesActorState(); static_cast(this)->destroy(); return 0; } + #line 63322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(blobRanges)); // state_var_RVO + this->~GetBlobRangesActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + #line 11251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!results.more) + #line 63331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(blobRanges); this->~GetBlobRangesActorState(); static_cast(this)->destroy(); return 0; } + #line 63335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(blobRanges)); // state_var_RVO + this->~GetBlobRangesActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } + #line 11254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + beginKey = results.back().key; + #line 63343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1loopBody1cont2(KeyRange const& fullRange,int loopDepth) - { - #line 9161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - keys = fullRange & range; - #line 9162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_1 = getKeyRangeLocations(cx, Optional(), keys, CLIENT_KNOBS->CHANGE_FEED_LOCATION_LIMIT, Reverse::False, &StorageServerInterface::changeFeedStream, span.context, Optional(), UseProvisionalProxies::False, latestVersion); - #line 9162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 49587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 9162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 49592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont2(KeyRange && fullRange,int loopDepth) - { - #line 9161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - keys = fullRange & range; - #line 9162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_1 = getKeyRangeLocations(cx, Optional(), keys, CLIENT_KNOBS->CHANGE_FEED_LOCATION_LIMIT, Reverse::False, &StorageServerInterface::changeFeedStream, span.context, Optional(), UseProvisionalProxies::False, latestVersion); - #line 9162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 49605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 9162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 49610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1when1(KeyRange const& fullRange,int loopDepth) + int a_body1loopBody1when1(RangeResult const& __results,int loopDepth) { - loopDepth = a_body1loopBody1cont2(fullRange, loopDepth); + #line 11238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results = __results; + #line 63352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1when1(KeyRange && fullRange,int loopDepth) + int a_body1loopBody1when1(RangeResult && __results,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(fullRange), loopDepth); + results = std::move(__results); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetChangeFeedStreamActorActor, 0, KeyRange >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetBlobRangesActor, 0, RangeResult >::remove(); } - void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 0, KeyRange >*,KeyRange const& value) + void a_callback_fire(ActorCallback< GetBlobRangesActor, 0, RangeResult >*,RangeResult const& value) { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getBlobRanges", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getBlobRanges", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 0, KeyRange >*,KeyRange && value) + void a_callback_fire(ActorCallback< GetBlobRangesActor, 0, RangeResult >*,RangeResult && value) { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getBlobRanges", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("getBlobRanges", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetChangeFeedStreamActorActor, 0, KeyRange >*,Error err) + void a_callback_error(ActorCallback< GetBlobRangesActor, 0, RangeResult >*,Error err) { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("getBlobRanges", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1Catch1(err, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 0); - - } - int a_body1loopBody1cont3(int loopDepth) - { - #line 9174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (locations.size() >= CLIENT_KNOBS->CHANGE_FEED_LOCATION_LIMIT) - #line 49682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ASSERT_WE_THINK(false); - #line 9176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1loopBody1Catch1(unknown_change_feed(), loopDepth); - #line 49688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - chosenLocations = std::vector(locations.size()); - #line 9180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - loc = 0; - #line 9181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 49696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont3loopHead1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont2when1(std::vector const& __locations,int loopDepth) - { - #line 9162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - locations = __locations; - #line 49705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont3(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont2when1(std::vector && __locations,int loopDepth) - { - locations = std::move(__locations); - loopDepth = a_body1loopBody1cont3(loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetChangeFeedStreamActorActor, 1, std::vector >::remove(); - - } - void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 1, std::vector >*,std::vector const& value) - { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 1, std::vector >*,std::vector && value) - { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< GetChangeFeedStreamActorActor, 1, std::vector >*,Error err) - { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 1); - - } - int a_body1loopBody1cont4(int loopDepth) - { - #line 9221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (locations.size() > 1) - #line 49772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector> interfs; - #line 9223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(int i = 0;i < locations.size();i++) { - #line 9224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - interfs.emplace_back(locations[i].locations->getInterface(chosenLocations[i]), locations[i].range & range); - #line 49780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 9229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = mergeChangeFeedStream(db, interfs, results, rangeID, &begin, end, replyBufferSize, canReadPopped) || cx->connectionFileChanged(); - #line 9229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 49788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 9229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 9233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TEST(true); - #line 9234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StorageServerInterface interf = locations[0].locations->getInterface(chosenLocations[0]); - #line 9235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_4 = singleChangeFeedStream( db, interf, range, results, rangeID, &begin, end, replyBufferSize, canReadPopped) || cx->connectionFileChanged(); - #line 9235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 49806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont4when2(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 9235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("getBlobRanges", reinterpret_cast(this), 0); - return loopDepth; - } - int a_body1loopBody1cont3loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1cont3loopBody1(loopDepth); - - return loopDepth; } - int a_body1loopBody1cont3loopBody1(int loopDepth) + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Transaction* tr; + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int batchLimit; + #line 11231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone> blobRanges; + #line 11232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key beginKey; + #line 11238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + RangeResult results; + #line 63427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via getBlobRanges() + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetBlobRangesActor final : public Actor>>, public ActorCallback< GetBlobRangesActor, 0, RangeResult >, public FastAllocated, public GetBlobRangesActorState { + #line 63432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetBlobRangesActor, 0, RangeResult >; + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetBlobRangesActor(Transaction* const& tr,KeyRange const& range,int const& batchLimit) + #line 63443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>>(), + GetBlobRangesActorState(tr, range, batchLimit) { - #line 9181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!(loc < locations.size())) - #line 49828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - return a_body1loopBody1cont3break1(loopDepth==0?0:loopDepth-1); // break - } - #line 9184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int count = 0; - #line 9185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int useIdx = -1; - #line 9186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(int i = 0;i < locations[loc].locations->size();i++) { - #line 9187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!IFailureMonitor::failureMonitor() .getState(locations[loc] .locations->get(i, &StorageServerInterface::changeFeedStream) .getEndpoint()) .failed) - #line 49840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (deterministicRandom()->random01() <= 1.0 / ++count) - #line 49844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - useIdx = i; - #line 49848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - } - #line 9198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (useIdx >= 0) - #line 49854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - chosenLocations[loc] = useIdx; - #line 9200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - loc++; - #line 49860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - return a_body1loopBody1cont3loopHead1(loopDepth); // continue - } - #line 9204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector> ok(locations[loc].locations->size()); - #line 9205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(int i = 0;i < ok.size();i++) { - #line 9206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ok[i] = IFailureMonitor::failureMonitor().onStateEqual( locations[loc].locations->get(i, &StorageServerInterface::changeFeedStream).getEndpoint(), FailureStatus(false)); - #line 49869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (now() - g_network->networkInfo.newestAlternativesFailure > 1 || deterministicRandom()->random01() < 0.01) - #line 49873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent("AllAlternativesFailed").detail("Alternatives", locations[0].locations->description()); - #line 49877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = allAlternativesFailedDelay(quorum(ok, 1)); - #line 9217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 49883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont3loopBody1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 9217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 49888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_enter("getBlobRanges", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getBlobRanges"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getBlobRanges", reinterpret_cast(this), -1); - return loopDepth; } - int a_body1loopBody1cont3break1(int loopDepth) + void cancel() override { - try { - return a_body1loopBody1cont4(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetBlobRangesActor, 0, RangeResult >*)0, actor_cancelled()); break; } - return loopDepth; - } - int a_body1loopBody1cont3loopBody1cont1(Void const& _,int loopDepth) - { - #line 9218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - loc = 0; - #line 49910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (loopDepth == 0) return a_body1loopBody1cont3loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1cont3loopBody1cont1(Void && _,int loopDepth) - { - #line 9218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - loc = 0; - #line 49919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (loopDepth == 0) return a_body1loopBody1cont3loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1cont3loopBody1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont3loopBody1cont1(_, loopDepth); - - return loopDepth; } - int a_body1loopBody1cont3loopBody1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont3loopBody1cont1(std::move(_), loopDepth); +}; +} + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future>> getBlobRanges( Transaction* const& tr, KeyRange const& range, int const& batchLimit ) { + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new GetBlobRangesActor(tr, range, batchLimit)); + #line 63471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetChangeFeedStreamActorActor, 2, Void >::remove(); +#line 11257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - } - void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 2, Void >*,Void const& value) + #line 63476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via purgeBlobGranulesActor() + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class PurgeBlobGranulesActorActorState { + #line 63483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + PurgeBlobGranulesActorActorState(Reference const& db,KeyRange const& range,Version const& purgeVersion,Optional> const& tenant,bool const& force) + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db), + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + purgeVersion(purgeVersion), + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenant(tenant), + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + force(force), + #line 11263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx(db), + #line 11264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr(cx), + #line 11265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + purgeKey(), + #line 11266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + purgeRange(range) + #line 63506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont3loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 2); + fdb_probe_actor_create("purgeBlobGranulesActor", reinterpret_cast(this)); } - void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 2, Void >*,Void && value) + ~PurgeBlobGranulesActorActorState() { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont3loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1loopBody1Catch1(error, 0); - } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 2); + fdb_probe_actor_destroy("purgeBlobGranulesActor", reinterpret_cast(this)); } - void a_callback_error(ActorCallback< GetChangeFeedStreamActorActor, 2, Void >*,Error err) + int a_body1(int loopDepth=0) { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 2); - a_exitChoose3(); try { - a_body1loopBody1Catch1(err, 0); + #line 11268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 11269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (purgeVersion == latestVersion) + #line 63523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 63527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 2); - - } - int a_body1loopBody1cont6(int loopDepth) - { - loopDepth = a_body1loopBody1cont10(loopDepth); return loopDepth; } - int a_body1loopBody1cont7(Void const& _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - loopDepth = a_body1loopBody1cont6(loopDepth); + this->~PurgeBlobGranulesActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont7(Void && _,int loopDepth) + int a_body1cont1(int loopDepth) { - loopDepth = a_body1loopBody1cont6(loopDepth); + #line 11281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (purgeVersion <= 0) + #line 63555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("PurgeInvalidVersion").detail("Range", range).detail("Version", purgeVersion).detail("Force", force); + #line 11283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1Catch1(unsupported_operation(), loopDepth); + #line 63561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (tenant.present()) + #line 63565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = tenant.get()->ready(); + #line 11287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 63571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 11287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 63576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont4(loopDepth); + } return loopDepth; } - int a_body1loopBody1cont4when1(Void const& _,int loopDepth) + int a_body1cont2(int loopDepth) { - loopDepth = a_body1loopBody1cont7(_, loopDepth); + #line 11279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.reset(); + #line 63590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont4when1(Void && _,int loopDepth) + int a_body1loopHead1(int loopDepth) { - loopDepth = a_body1loopBody1cont7(std::move(_), loopDepth); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); return loopDepth; } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetChangeFeedStreamActorActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 3, Void >*,Void const& value) + int a_body1loopBody1(int loopDepth) { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 3); - a_exitChoose4(); try { - a_body1loopBody1cont4when1(value, 0); + #line 11272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = tr.getReadVersion(); + #line 11272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 63609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 11272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 63614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1loopBody1Catch1(error, loopDepth); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 3); + return loopDepth; } - void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 3, Void >*,Void && value) + int a_body1break1(int loopDepth) { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 3); - a_exitChoose4(); try { - a_body1loopBody1cont4when1(std::move(value), 0); + return a_body1cont2(loopDepth); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 3); + return loopDepth; } - void a_callback_error(ActorCallback< GetChangeFeedStreamActorActor, 3, Void >*,Error err) + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 3); - a_exitChoose4(); try { - a_body1loopBody1Catch1(err, 0); + #line 11276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = tr.onError(e); + #line 11276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 63651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 11276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 63656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 3); + return loopDepth; } - int a_body1loopBody1cont9(Void const& _,int loopDepth) + int a_body1loopBody1cont2(Version const& _purgeVersion,int loopDepth) { - loopDepth = a_body1loopBody1cont6(loopDepth); + #line 11273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + purgeVersion = _purgeVersion; + #line 63671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1loopBody1cont9(Void && _,int loopDepth) + int a_body1loopBody1cont2(Version && _purgeVersion,int loopDepth) { - loopDepth = a_body1loopBody1cont6(loopDepth); + #line 11273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + purgeVersion = _purgeVersion; + #line 63680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1loopBody1cont4when2(Void const& _,int loopDepth) + int a_body1loopBody1when1(Version const& _purgeVersion,int loopDepth) { - loopDepth = a_body1loopBody1cont9(_, loopDepth); + loopDepth = a_body1loopBody1cont2(_purgeVersion, loopDepth); return loopDepth; } - int a_body1loopBody1cont4when2(Void && _,int loopDepth) + int a_body1loopBody1when1(Version && _purgeVersion,int loopDepth) { - loopDepth = a_body1loopBody1cont9(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont2(std::move(_purgeVersion), loopDepth); return loopDepth; } - void a_exitChoose5() + void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetChangeFeedStreamActorActor, 4, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PurgeBlobGranulesActorActor, 0, Version >::remove(); } - void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 0, Version >*,Version const& value) { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1cont4when2(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 4); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 0, Version >*,Version && value) { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1cont4when2(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 4); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetChangeFeedStreamActorActor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< PurgeBlobGranulesActorActor, 0, Version >*,Error err) { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1loopBody1Catch1(err, 0); } @@ -50137,62 +63742,43 @@ class GetChangeFeedStreamActorActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 4); - - } - int a_body1loopBody1cont10(int loopDepth) - { - try { - loopDepth = a_body1loopBody1cont1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1loopBody1Catch1cont1(int loopDepth) + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont8(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1Catch1cont1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1Catch1cont8(Void && _,int loopDepth) + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont8(_, loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont8(std::move(_), loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose6() + void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetChangeFeedStreamActorActor, 5, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PurgeBlobGranulesActorActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 5, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1loopBody1Catch1when1(value, 0); } @@ -50201,13 +63787,13 @@ class GetChangeFeedStreamActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 5); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< GetChangeFeedStreamActorActor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1loopBody1Catch1when1(std::move(value), 0); } @@ -50216,13 +63802,13 @@ class GetChangeFeedStreamActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 5); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< GetChangeFeedStreamActorActor, 5, Void >*,Error err) + void a_callback_error(ActorCallback< PurgeBlobGranulesActorActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), 5); - a_exitChoose6(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -50231,254 +63817,88 @@ class GetChangeFeedStreamActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), 5); - - } - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference db; - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference results; - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key rangeID; - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version begin; - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version end; - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRange range; - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int replyBufferSize; - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bool canReadPopped; - #line 9148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Database cx; - #line 9149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Span span; - #line 9153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - double sleepWithBackoff; - #line 9154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version lastBeginVersion; - #line 9157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRange keys; - #line 9162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector locations; - #line 9179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector chosenLocations; - #line 9180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - int loc; - #line 50269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -}; -// This generated class is to be used only via getChangeFeedStreamActor() - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetChangeFeedStreamActorActor final : public Actor, public ActorCallback< GetChangeFeedStreamActorActor, 0, KeyRange >, public ActorCallback< GetChangeFeedStreamActorActor, 1, std::vector >, public ActorCallback< GetChangeFeedStreamActorActor, 2, Void >, public ActorCallback< GetChangeFeedStreamActorActor, 3, Void >, public ActorCallback< GetChangeFeedStreamActorActor, 4, Void >, public ActorCallback< GetChangeFeedStreamActorActor, 5, Void >, public FastAllocated, public GetChangeFeedStreamActorActorState { - #line 50274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< GetChangeFeedStreamActorActor, 0, KeyRange >; -friend struct ActorCallback< GetChangeFeedStreamActorActor, 1, std::vector >; -friend struct ActorCallback< GetChangeFeedStreamActorActor, 2, Void >; -friend struct ActorCallback< GetChangeFeedStreamActorActor, 3, Void >; -friend struct ActorCallback< GetChangeFeedStreamActorActor, 4, Void >; -friend struct ActorCallback< GetChangeFeedStreamActorActor, 5, Void >; - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetChangeFeedStreamActorActor(Reference const& db,Reference const& results,Key const& rangeID,Version const& begin,Version const& end,KeyRange const& range,int const& replyBufferSize,bool const& canReadPopped) - #line 50290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - GetChangeFeedStreamActorActorState(db, results, rangeID, begin, end, range, replyBufferSize, canReadPopped) - { - fdb_probe_actor_enter("getChangeFeedStreamActor", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getChangeFeedStreamActor"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("getChangeFeedStreamActor", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetChangeFeedStreamActorActor, 0, KeyRange >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetChangeFeedStreamActorActor, 1, std::vector >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< GetChangeFeedStreamActorActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< GetChangeFeedStreamActorActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< GetChangeFeedStreamActorActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< GetChangeFeedStreamActorActor, 5, Void >*)0, actor_cancelled()); break; - } - - } -}; -} - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future getChangeFeedStreamActor( Reference const& db, Reference const& results, Key const& rangeID, Version const& begin, Version const& end, KeyRange const& range, int const& replyBufferSize, bool const& canReadPopped ) { - #line 9140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new GetChangeFeedStreamActorActor(db, results, rangeID, begin, end, range, replyBufferSize, canReadPopped)); - #line 50323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -} - -#line 9289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - -Future DatabaseContext::getChangeFeedStream(Reference results, - Key rangeID, - Version begin, - Version end, - KeyRange range, - int replyBufferSize, - bool canReadPopped) { - return getChangeFeedStreamActor( - Reference::addRef(this), results, rangeID, begin, end, range, replyBufferSize, canReadPopped); -} - - #line 50339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via singleLocationOverlappingChangeFeeds() - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class SingleLocationOverlappingChangeFeedsActorState { - #line 50346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SingleLocationOverlappingChangeFeedsActorState(Database const& cx,Reference const& location,KeyRangeRef const& range,Version const& minVersion) - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : cx(cx), - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - location(location), - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - range(range), - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - minVersion(minVersion), - #line 9306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req() - #line 50361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - fdb_probe_actor_create("singleLocationOverlappingChangeFeeds", reinterpret_cast(this)); - - } - ~SingleLocationOverlappingChangeFeedsActorState() - { - fdb_probe_actor_destroy("singleLocationOverlappingChangeFeeds", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 9307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.range = range; - #line 9308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - req.minVersion = minVersion; - #line 9310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = loadBalance(cx.getPtr(), location, &StorageServerInterface::overlappingChangeFeeds, req, TaskPriority::DefaultPromiseEndpoint, AtMostOnce::False, cx->enableLocalityLoadBalance ? &cx->queueModel : nullptr); - #line 9310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 50382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 9310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 50387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) + int a_body1cont4(int loopDepth) { - this->~SingleLocationOverlappingChangeFeedsActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; + #line 11291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 63827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont4loopHead1(loopDepth); return loopDepth; } - int a_body1cont1(OverlappingChangeFeedsReply const& rep,int loopDepth) + int a_body1cont6(Void const& _,int loopDepth) { - #line 9317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(rep.rangeIds); this->~SingleLocationOverlappingChangeFeedsActorState(); static_cast(this)->destroy(); return 0; } - #line 50410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< std::vector >::value()) std::vector(rep.rangeIds); - this->~SingleLocationOverlappingChangeFeedsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 11288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + purgeRange = purgeRange.withPrefix(tenant.get()->prefix()); + #line 63836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont4(loopDepth); return loopDepth; } - int a_body1cont1(OverlappingChangeFeedsReply && rep,int loopDepth) + int a_body1cont6(Void && _,int loopDepth) { - #line 9317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(rep.rangeIds); this->~SingleLocationOverlappingChangeFeedsActorState(); static_cast(this)->destroy(); return 0; } - #line 50422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< std::vector >::value()) std::vector(rep.rangeIds); - this->~SingleLocationOverlappingChangeFeedsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 11288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + purgeRange = purgeRange.withPrefix(tenant.get()->prefix()); + #line 63845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont4(loopDepth); return loopDepth; } - int a_body1when1(OverlappingChangeFeedsReply const& rep,int loopDepth) + int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(rep, loopDepth); + loopDepth = a_body1cont6(_, loopDepth); return loopDepth; } - int a_body1when1(OverlappingChangeFeedsReply && rep,int loopDepth) + int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(rep), loopDepth); + loopDepth = a_body1cont6(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SingleLocationOverlappingChangeFeedsActor, 0, OverlappingChangeFeedsReply >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PurgeBlobGranulesActorActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< SingleLocationOverlappingChangeFeedsActor, 0, OverlappingChangeFeedsReply >*,OverlappingChangeFeedsReply const& value) + void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), 0); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< SingleLocationOverlappingChangeFeedsActor, 0, OverlappingChangeFeedsReply >*,OverlappingChangeFeedsReply && value) + void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), 0); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< SingleLocationOverlappingChangeFeedsActor, 0, OverlappingChangeFeedsReply >*,Error err) + void a_callback_error(ActorCallback< PurgeBlobGranulesActorActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -50487,191 +63907,102 @@ class SingleLocationOverlappingChangeFeedsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), 0); - - } - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Database cx; - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference location; - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRangeRef range; - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version minVersion; - #line 9306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - OverlappingChangeFeedsRequest req; - #line 50503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -}; -// This generated class is to be used only via singleLocationOverlappingChangeFeeds() - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class SingleLocationOverlappingChangeFeedsActor final : public Actor>, public ActorCallback< SingleLocationOverlappingChangeFeedsActor, 0, OverlappingChangeFeedsReply >, public FastAllocated, public SingleLocationOverlappingChangeFeedsActorState { - #line 50508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< SingleLocationOverlappingChangeFeedsActor, 0, OverlappingChangeFeedsReply >; - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - SingleLocationOverlappingChangeFeedsActor(Database const& cx,Reference const& location,KeyRangeRef const& range,Version const& minVersion) - #line 50519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor>(), - SingleLocationOverlappingChangeFeedsActorState(cx, location, range, minVersion) - { - fdb_probe_actor_enter("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("singleLocationOverlappingChangeFeeds"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("singleLocationOverlappingChangeFeeds", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< SingleLocationOverlappingChangeFeedsActor, 0, OverlappingChangeFeedsReply >*)0, actor_cancelled()); break; - } + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 2); } -}; -} - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future> singleLocationOverlappingChangeFeeds( Database const& cx, Reference const& location, KeyRangeRef const& range, Version const& minVersion ) { - #line 9301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future>(new SingleLocationOverlappingChangeFeedsActor(cx, location, range, minVersion)); - #line 50547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -} - -#line 9319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - -bool compareChangeFeedResult(const OverlappingChangeFeedEntry& i, const OverlappingChangeFeedEntry& j) { - return i.rangeId < j.rangeId; -} - - #line 50556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -namespace { -// This generated class is to be used only via getOverlappingChangeFeedsActor() - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetOverlappingChangeFeedsActorActorState { - #line 50563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" -public: - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetOverlappingChangeFeedsActorActorState(Reference const& db,KeyRangeRef const& range,Version const& minVersion) - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : db(db), - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - range(range), - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - minVersion(minVersion), - #line 9327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx(db), - #line 9328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:GetOverlappingChangeFeeds"_loc) - #line 50578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + int a_body1cont8(int loopDepth) { - fdb_probe_actor_create("getOverlappingChangeFeedsActor", reinterpret_cast(this)); + #line 11340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(purgeKey); this->~PurgeBlobGranulesActorActorState(); static_cast(this)->destroy(); return 0; } + #line 63917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Key >::value()) Key(std::move(purgeKey)); // state_var_RVO + this->~PurgeBlobGranulesActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + return loopDepth; } - ~GetOverlappingChangeFeedsActorActorState() + int a_body1cont4loopHead1(int loopDepth) { - fdb_probe_actor_destroy("getOverlappingChangeFeedsActor", reinterpret_cast(this)); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont4loopBody1(loopDepth); + return loopDepth; } - int a_body1(int loopDepth=0) + int a_body1cont4loopBody1(int loopDepth) { try { - #line 9330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 50593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); + #line 11293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 11294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 11295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 11298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + blobbifiedBegin = getBlobRanges(&tr, KeyRangeRef(purgeRange.begin, keyAfter(purgeRange.begin)), 1); + #line 11300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + blobbifiedEnd = getBlobRanges(&tr, KeyRangeRef(purgeRange.end, keyAfter(purgeRange.end)), 1); + #line 11302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = success(blobbifiedBegin) && success(blobbifiedEnd); + #line 11302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); + #line 63949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont4loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4loopBody1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 11302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 63954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + loopDepth = a_body1cont4loopBody1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1cont4loopBody1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~GetOverlappingChangeFeedsActorActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) + int a_body1cont4break1(int loopDepth) { try { - #line 9332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_0 = getKeyRangeLocations(cx, Optional(), range, CLIENT_KNOBS->CHANGE_FEED_LOCATION_LIMIT, Reverse::False, &StorageServerInterface::overlappingChangeFeeds, span.context, Optional(), UseProvisionalProxies::False, latestVersion); - #line 9332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 50626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 9332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 50631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + return a_body1cont8(loopDepth); } catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) + int a_body1cont4loopBody1cont1(int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); + if (loopDepth == 0) return a_body1cont4loopHead1(0); return loopDepth; } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1cont4loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 9367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) - #line 50653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(Key(), range); - #line 9369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = delay(CLIENT_KNOBS->WRONG_SHARD_SERVER_DELAY); - #line 9369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 50661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 9369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 50666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else + #line 11330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (BG_REQUEST_DEBUG) + #line 63989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 50673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("purgeBlobGranules for range [{0} - {1}) at version {2} encountered error {3}\n", purgeRange.begin.printable(), purgeRange.end.printable(), purgeVersion, e.name()); + #line 63993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + #line 11337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_6 = tr.onError(e); + #line 11337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 63999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1Catch1when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 11337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 64004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); @@ -50681,384 +64012,391 @@ class GetOverlappingChangeFeedsActorActorState { return loopDepth; } - int a_body1loopBody1cont2(int loopDepth) + int a_body1cont4loopBody1cont2(Void const& _,int loopDepth) { - #line 9344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (locations.size() >= CLIENT_KNOBS->CHANGE_FEED_LOCATION_LIMIT) - #line 50688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if ((!blobbifiedBegin.get().empty() && blobbifiedBegin.get().front().begin < purgeRange.begin) || (!blobbifiedEnd.get().empty() && blobbifiedEnd.get().front().begin < purgeRange.end)) + #line 64019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - TraceEvent(SevError, "OverlappingRangeTooLarge") .detail("Range", range) .detail("Limit", CLIENT_KNOBS->CHANGE_FEED_LOCATION_LIMIT); - #line 9348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = delay(1.0); - #line 9348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 50696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 9348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 50701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else + #line 11306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("UnalignedPurge") .detail("Range", purgeRange) .detail("Version", purgeVersion) .detail("Force", force); + #line 11310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1cont4loopBody1Catch1(unsupported_operation(), loopDepth); + #line 64025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Value purgeValue = blobGranulePurgeValueFor(purgeVersion, purgeRange, force); + #line 11314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.atomicOp( addVersionStampAtEnd(blobGranulePurgeKeys.begin), purgeValue, MutationRef::SetVersionstampedKey); + #line 11316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.set(blobGranulePurgeChangeKey, deterministicRandom()->randomUniqueID().toString()); + #line 11317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fTrVs = tr.getVersionstamp(); + #line 11318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = tr.commit(); + #line 11318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); + #line 64039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont4loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 11318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 64044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont4loopBody1cont2(Void && _,int loopDepth) + { + #line 11304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if ((!blobbifiedBegin.get().empty() && blobbifiedBegin.get().front().begin < purgeRange.begin) || (!blobbifiedEnd.get().empty() && blobbifiedEnd.get().front().begin < purgeRange.end)) + #line 64053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - loopDepth = a_body1loopBody1cont3(loopDepth); - } + #line 11306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("UnalignedPurge") .detail("Range", purgeRange) .detail("Version", purgeVersion) .detail("Force", force); + #line 11310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return a_body1cont4loopBody1Catch1(unsupported_operation(), loopDepth); + #line 64059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Value purgeValue = blobGranulePurgeValueFor(purgeVersion, purgeRange, force); + #line 11314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.atomicOp( addVersionStampAtEnd(blobGranulePurgeKeys.begin), purgeValue, MutationRef::SetVersionstampedKey); + #line 11316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr.set(blobGranulePurgeChangeKey, deterministicRandom()->randomUniqueID().toString()); + #line 11317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fTrVs = tr.getVersionstamp(); + #line 11318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = tr.commit(); + #line 11318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); + #line 64073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont4loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 11318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 64078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1when1(std::vector const& __locations,int loopDepth) + int a_body1cont4loopBody1when1(Void const& _,int loopDepth) { - #line 9332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - locations = __locations; - #line 50715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont2(loopDepth); + loopDepth = a_body1cont4loopBody1cont2(_, loopDepth); return loopDepth; } - int a_body1loopBody1when1(std::vector && __locations,int loopDepth) + int a_body1cont4loopBody1when1(Void && _,int loopDepth) { - locations = std::move(__locations); - loopDepth = a_body1loopBody1cont2(loopDepth); + loopDepth = a_body1cont4loopBody1cont2(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetOverlappingChangeFeedsActorActor, 0, std::vector >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PurgeBlobGranulesActorActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 0, std::vector >*,std::vector const& value) + void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1loopBody1when1(value, 0); + a_body1cont4loopBody1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 0, std::vector >*,std::vector && value) + void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1cont4loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< GetOverlappingChangeFeedsActorActor, 0, std::vector >*,Error err) + void a_callback_error(ActorCallback< PurgeBlobGranulesActorActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1loopBody1Catch1(err, 0); + a_body1cont4loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 3); } - int a_body1loopBody1cont3(int loopDepth) + int a_body1cont4loopBody1cont3(Void const& _,int loopDepth) { - #line 9352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - allOverlappingRequests = std::vector>>(); - #line 9353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : locations ) { - #line 9354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - allOverlappingRequests.push_back( singleLocationOverlappingChangeFeeds(cx, it.locations, it.range & range, minVersion)); - #line 50786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = waitForAll(allOverlappingRequests); - #line 9357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 50792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 9357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 50797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_5 = fTrVs; + #line 11319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); + #line 64152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont4loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont4loopBody1cont3when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 11319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 64157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont4(Void const& _,int loopDepth) - { - #line 9349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1loopBody1Catch1(all_alternatives_failed(), loopDepth); - #line 50806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - - return loopDepth; - } - int a_body1loopBody1cont4(Void && _,int loopDepth) + int a_body1cont4loopBody1cont3(Void && _,int loopDepth) { - #line 9349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1loopBody1Catch1(all_alternatives_failed(), loopDepth); - #line 50814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_5 = fTrVs; + #line 11319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont4loopBody1Catch1(actor_cancelled(), loopDepth); + #line 64168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont4loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont4loopBody1cont3when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 11319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 64173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + int a_body1cont4loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(_, loopDepth); + loopDepth = a_body1cont4loopBody1cont3(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(Void && _,int loopDepth) + int a_body1cont4loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + loopDepth = a_body1cont4loopBody1cont3(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose5() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetOverlappingChangeFeedsActorActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PurgeBlobGranulesActorActor, 4, Void >::remove(); } - void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 4, Void >*,Void const& value) { - fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1cont2when1(value, 0); + a_body1cont4loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1cont2when1(std::move(value), 0); + a_body1cont4loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< GetOverlappingChangeFeedsActorActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< PurgeBlobGranulesActorActor, 4, Void >*,Error err) { - fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1Catch1(err, 0); + a_body1cont4loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 4); } - int a_body1loopBody1cont6(Void const& _,int loopDepth) + int a_body1cont4loopBody1cont5(Standalone const& vs,int loopDepth) { - #line 9359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector result; - #line 9360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : allOverlappingRequests ) { - #line 9361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - result.insert(result.end(), it.get().begin(), it.get().end()); - #line 50889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + purgeKey = blobGranulePurgeKeys.begin.withSuffix(vs); + #line 11321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (BG_REQUEST_DEBUG) + #line 64247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("purgeBlobGranules for range [{0} - {1}) at version {2} registered {3}\n", purgeRange.begin.printable(), purgeRange.end.printable(), purgeVersion, purgeKey.printable()); + #line 64251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 9363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::sort(result.begin(), result.end(), compareChangeFeedResult); - #line 9364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - result.resize(std::unique(result.begin(), result.end()) - result.begin()); - #line 9365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(result); this->~GetOverlappingChangeFeedsActorActorState(); static_cast(this)->destroy(); return 0; } - #line 50897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< std::vector >::value()) std::vector(result); - this->~GetOverlappingChangeFeedsActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + return a_body1cont4break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1loopBody1cont6(Void && _,int loopDepth) + int a_body1cont4loopBody1cont5(Standalone && vs,int loopDepth) { - #line 9359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector result; - #line 9360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for( auto& it : allOverlappingRequests ) { - #line 9361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - result.insert(result.end(), it.get().begin(), it.get().end()); - #line 50913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + purgeKey = blobGranulePurgeKeys.begin.withSuffix(vs); + #line 11321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (BG_REQUEST_DEBUG) + #line 64263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("purgeBlobGranules for range [{0} - {1}) at version {2} registered {3}\n", purgeRange.begin.printable(), purgeRange.end.printable(), purgeVersion, purgeKey.printable()); + #line 64267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 9363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::sort(result.begin(), result.end(), compareChangeFeedResult); - #line 9364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - result.resize(std::unique(result.begin(), result.end()) - result.begin()); - #line 9365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(result); this->~GetOverlappingChangeFeedsActorActorState(); static_cast(this)->destroy(); return 0; } - #line 50921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< std::vector >::value()) std::vector(result); - this->~GetOverlappingChangeFeedsActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + return a_body1cont4break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + int a_body1cont4loopBody1cont3when1(Standalone const& vs,int loopDepth) { - loopDepth = a_body1loopBody1cont6(_, loopDepth); + loopDepth = a_body1cont4loopBody1cont5(vs, loopDepth); return loopDepth; } - int a_body1loopBody1cont3when1(Void && _,int loopDepth) + int a_body1cont4loopBody1cont3when1(Standalone && vs,int loopDepth) { - loopDepth = a_body1loopBody1cont6(std::move(_), loopDepth); + loopDepth = a_body1cont4loopBody1cont5(std::move(vs), loopDepth); return loopDepth; } - void a_exitChoose3() + void a_exitChoose6() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetOverlappingChangeFeedsActorActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PurgeBlobGranulesActorActor, 5, Standalone >::remove(); } - void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 5, Standalone >*,Standalone const& value) { - fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1loopBody1cont3when1(value, 0); + a_body1cont4loopBody1cont3when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 2); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 5); } - void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 5, Standalone >*,Standalone && value) { - fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1loopBody1cont3when1(std::move(value), 0); + a_body1cont4loopBody1cont3when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 2); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 5); } - void a_callback_error(ActorCallback< GetOverlappingChangeFeedsActorActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< PurgeBlobGranulesActorActor, 5, Standalone >*,Error err) { - fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1loopBody1Catch1(err, 0); + a_body1cont4loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont4loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont4loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 2); - - } - int a_body1loopBody1Catch1cont1(int loopDepth) - { - loopDepth = a_body1loopBody1cont1(loopDepth); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 5); - return loopDepth; } - int a_body1loopBody1Catch1cont2(Void const& _,int loopDepth) + int a_body1cont4loopBody1Catch1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + loopDepth = a_body1cont4loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont2(Void && _,int loopDepth) + int a_body1cont4loopBody1Catch1cont1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + loopDepth = a_body1cont4loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont4loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont2(_, loopDepth); + loopDepth = a_body1cont4loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1cont4loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont4loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose7() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PurgeBlobGranulesActorActor, 6, Void >::remove(); } - void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 6, Void >*,Void const& value) { - fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 6); + a_exitChoose7(); try { - a_body1loopBody1Catch1when1(value, 0); + a_body1cont4loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 3); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 6); } - void a_callback_fire(ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 6, Void >*,Void && value) { - fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 6); + a_exitChoose7(); try { - a_body1loopBody1Catch1when1(std::move(value), 0); + a_body1cont4loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 3); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 6); } - void a_callback_error(ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< PurgeBlobGranulesActorActor, 6, Void >*,Error err) { - fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 6); + a_exitChoose7(); try { a_body1Catch1(err, 0); } @@ -51067,53 +64405,66 @@ class GetOverlappingChangeFeedsActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), 3); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 6); } - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference db; - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRangeRef range; - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version minVersion; - #line 9327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Version purgeVersion; + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional> tenant; + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool force; + #line 11263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 9328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Span span; - #line 9332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector locations; - #line 9352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector>> allOverlappingRequests; - #line 51087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Transaction tr; + #line 11265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key purgeKey; + #line 11266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange purgeRange; + #line 11298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future>> blobbifiedBegin; + #line 11300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future>> blobbifiedEnd; + #line 11317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future> fTrVs; + #line 64435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via getOverlappingChangeFeedsActor() - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class GetOverlappingChangeFeedsActorActor final : public Actor>, public ActorCallback< GetOverlappingChangeFeedsActorActor, 0, std::vector >, public ActorCallback< GetOverlappingChangeFeedsActorActor, 1, Void >, public ActorCallback< GetOverlappingChangeFeedsActorActor, 2, Void >, public ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >, public FastAllocated, public GetOverlappingChangeFeedsActorActorState { - #line 51092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via purgeBlobGranulesActor() + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class PurgeBlobGranulesActorActor final : public Actor, public ActorCallback< PurgeBlobGranulesActorActor, 0, Version >, public ActorCallback< PurgeBlobGranulesActorActor, 1, Void >, public ActorCallback< PurgeBlobGranulesActorActor, 2, Void >, public ActorCallback< PurgeBlobGranulesActorActor, 3, Void >, public ActorCallback< PurgeBlobGranulesActorActor, 4, Void >, public ActorCallback< PurgeBlobGranulesActorActor, 5, Standalone >, public ActorCallback< PurgeBlobGranulesActorActor, 6, Void >, public FastAllocated, public PurgeBlobGranulesActorActorState { + #line 64440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetOverlappingChangeFeedsActorActor, 0, std::vector >; -friend struct ActorCallback< GetOverlappingChangeFeedsActorActor, 1, Void >; -friend struct ActorCallback< GetOverlappingChangeFeedsActorActor, 2, Void >; -friend struct ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >; - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - GetOverlappingChangeFeedsActorActor(Reference const& db,KeyRangeRef const& range,Version const& minVersion) - #line 51106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor>(), - GetOverlappingChangeFeedsActorActorState(db, range, minVersion) +friend struct ActorCallback< PurgeBlobGranulesActorActor, 0, Version >; +friend struct ActorCallback< PurgeBlobGranulesActorActor, 1, Void >; +friend struct ActorCallback< PurgeBlobGranulesActorActor, 2, Void >; +friend struct ActorCallback< PurgeBlobGranulesActorActor, 3, Void >; +friend struct ActorCallback< PurgeBlobGranulesActorActor, 4, Void >; +friend struct ActorCallback< PurgeBlobGranulesActorActor, 5, Standalone >; +friend struct ActorCallback< PurgeBlobGranulesActorActor, 6, Void >; + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + PurgeBlobGranulesActorActor(Reference const& db,KeyRange const& range,Version const& purgeVersion,Optional> const& tenant,bool const& force) + #line 64457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + PurgeBlobGranulesActorActorState(db, range, purgeVersion, tenant, force) { - fdb_probe_actor_enter("getOverlappingChangeFeedsActor", reinterpret_cast(this), -1); + fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getOverlappingChangeFeedsActor"); + this->lineage.setActorName("purgeBlobGranulesActor"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("getOverlappingChangeFeedsActor", reinterpret_cast(this), -1); + fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), -1); } void cancel() override @@ -51121,65 +64472,70 @@ friend struct ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetOverlappingChangeFeedsActorActor, 0, std::vector >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetOverlappingChangeFeedsActorActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< GetOverlappingChangeFeedsActorActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< GetOverlappingChangeFeedsActorActor, 3, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< PurgeBlobGranulesActorActor, 0, Version >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< PurgeBlobGranulesActorActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< PurgeBlobGranulesActorActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< PurgeBlobGranulesActorActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< PurgeBlobGranulesActorActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< PurgeBlobGranulesActorActor, 5, Standalone >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< PurgeBlobGranulesActorActor, 6, Void >*)0, actor_cancelled()); break; } } }; } - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future> getOverlappingChangeFeedsActor( Reference const& db, KeyRangeRef const& range, Version const& minVersion ) { - #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future>(new GetOverlappingChangeFeedsActorActor(db, range, minVersion)); - #line 51137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future purgeBlobGranulesActor( Reference const& db, KeyRange const& range, Version const& purgeVersion, Optional> const& tenant, bool const& force ) { + #line 11258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new PurgeBlobGranulesActorActor(db, range, purgeVersion, tenant, force)); + #line 64491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 9376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 11342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -Future> DatabaseContext::getOverlappingChangeFeeds(KeyRangeRef range, - Version minVersion) { - return getOverlappingChangeFeedsActor(Reference::addRef(this), range, minVersion); +Future DatabaseContext::purgeBlobGranules(KeyRange range, + Version purgeVersion, + Optional> tenant, + bool force) { + return purgeBlobGranulesActor(Reference::addRef(this), range, purgeVersion, tenant, force); } - #line 51147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 64503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via popChangeFeedBackup() - #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class PopChangeFeedBackupActorState { - #line 51154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via waitPurgeGranulesCompleteActor() + #line 11350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 11350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class WaitPurgeGranulesCompleteActorActorState { + #line 64510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - PopChangeFeedBackupActorState(Database const& cx,Key const& rangeID,Version const& version) - #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : cx(cx), - #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - rangeID(rangeID), - #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version(version), - #line 9383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr(cx) - #line 51167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WaitPurgeGranulesCompleteActorActorState(Reference const& db,Key const& purgeKey) + #line 11350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db), + #line 11350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + purgeKey(purgeKey), + #line 11351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + cx(db), + #line 11352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr(makeReference(cx)) + #line 64523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("popChangeFeedBackup", reinterpret_cast(this)); + fdb_probe_actor_create("waitPurgeGranulesCompleteActor", reinterpret_cast(this)); } - ~PopChangeFeedBackupActorState() + ~WaitPurgeGranulesCompleteActorActorState() { - fdb_probe_actor_destroy("popChangeFeedBackup", reinterpret_cast(this)); + fdb_probe_actor_destroy("waitPurgeGranulesCompleteActor", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 9384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 51182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 64538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -51192,8 +64548,8 @@ class PopChangeFeedBackupActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~PopChangeFeedBackupActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~WaitPurgeGranulesCompleteActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; @@ -51208,20 +64564,20 @@ class PopChangeFeedBackupActorState { int a_body1loopBody1(int loopDepth) { try { - #line 9386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 9387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - rangeIDKey = rangeID.withPrefix(changeFeedPrefix); - #line 9388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_0 = tr.get(rangeIDKey); - #line 9388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 51219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 11356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 11358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_0 = tr->get(purgeKey); + #line 11358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 64575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 9388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 51224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 11358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 64580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -51241,16 +64597,16 @@ class PopChangeFeedBackupActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 9403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = tr.onError(e); - #line 9403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 51248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 9403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = tr->onError(e); + #line 11373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 64604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 11373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 64609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -51261,113 +64617,119 @@ class PopChangeFeedBackupActorState { return loopDepth; } - int a_body1loopBody1cont2(Optional const& val,int loopDepth) + int a_body1loopBody1cont2(Optional const& purgeVal,int loopDepth) { - #line 9389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (val.present()) - #line 51268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!purgeVal.present()) + #line 64624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRange range; - #line 9391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version popVersion; - #line 9392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ChangeFeedStatus status; - #line 9393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::tie(range, popVersion, status) = decodeChangeFeedValue(val.get()); - #line 9394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (version > popVersion) - #line 51280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (BG_REQUEST_DEBUG) + #line 64628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr.set(rangeIDKey, changeFeedValue(range, version, status)); - #line 51284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("purgeBlobGranules for {0} succeeded\n", purgeKey.printable()); + #line 64632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + #line 11363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitPurgeGranulesCompleteActorActorState(); static_cast(this)->destroy(); return 0; } + #line 64636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WaitPurgeGranulesCompleteActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } - else + #line 11365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (BG_REQUEST_DEBUG) + #line 64644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1loopBody1Catch1(change_feed_not_registered(), loopDepth); - #line 51291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("purgeBlobGranules for {0} watching\n", purgeKey.printable()); + #line 64648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 9400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = tr.commit(); - #line 9400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 51297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + watchFuture = tr->watch(purgeKey); + #line 11369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = tr->commit(); + #line 11369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 64656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 9400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 11369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 64661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont2(Optional && val,int loopDepth) + int a_body1loopBody1cont2(Optional && purgeVal,int loopDepth) { - #line 9389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (val.present()) - #line 51311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!purgeVal.present()) + #line 64670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRange range; - #line 9391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version popVersion; - #line 9392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ChangeFeedStatus status; - #line 9393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::tie(range, popVersion, status) = decodeChangeFeedValue(val.get()); - #line 9394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (version > popVersion) - #line 51323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (BG_REQUEST_DEBUG) + #line 64674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr.set(rangeIDKey, changeFeedValue(range, version, status)); - #line 51327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("purgeBlobGranules for {0} succeeded\n", purgeKey.printable()); + #line 64678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } + #line 11363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitPurgeGranulesCompleteActorActorState(); static_cast(this)->destroy(); return 0; } + #line 64682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WaitPurgeGranulesCompleteActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } - else + #line 11365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (BG_REQUEST_DEBUG) + #line 64690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1loopBody1Catch1(change_feed_not_registered(), loopDepth); - #line 51334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("purgeBlobGranules for {0} watching\n", purgeKey.printable()); + #line 64694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 9400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_1 = tr.commit(); - #line 9400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 51340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + watchFuture = tr->watch(purgeKey); + #line 11369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = tr->commit(); + #line 11369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 64702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 9400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 11369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 64707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1when1(Optional const& val,int loopDepth) + int a_body1loopBody1when1(Optional const& purgeVal,int loopDepth) { - loopDepth = a_body1loopBody1cont2(val, loopDepth); + loopDepth = a_body1loopBody1cont2(purgeVal, loopDepth); return loopDepth; } - int a_body1loopBody1when1(Optional && val,int loopDepth) + int a_body1loopBody1when1(Optional && purgeVal,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(val), loopDepth); + loopDepth = a_body1loopBody1cont2(std::move(purgeVal), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< PopChangeFeedBackupActor, 0, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WaitPurgeGranulesCompleteActorActor, 0, Optional >::remove(); } - void a_callback_fire(ActorCallback< PopChangeFeedBackupActor, 0, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 0, Optional >*,Optional const& value) { - fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 0); + fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -51377,12 +64739,12 @@ class PopChangeFeedBackupActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< PopChangeFeedBackupActor, 0, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 0, Optional >*,Optional && value) { - fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 0); + fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -51392,12 +64754,12 @@ class PopChangeFeedBackupActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< PopChangeFeedBackupActor, 0, Optional >*,Error err) + void a_callback_error(ActorCallback< WaitPurgeGranulesCompleteActorActor, 0, Optional >*,Error err) { - fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 0); + fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1Catch1(err, 0); @@ -51407,85 +64769,174 @@ class PopChangeFeedBackupActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 0); + fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 0); } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 9401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PopChangeFeedBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 51417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~PopChangeFeedBackupActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 11370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = watchFuture; + #line 11370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 64781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 11370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 64786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 11370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = watchFuture; + #line 11370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 64797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 11370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 64802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WaitPurgeGranulesCompleteActorActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< WaitPurgeGranulesCompleteActorActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont7(Void const& _,int loopDepth) + { + #line 11371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->reset(); + #line 64874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont9(loopDepth); return loopDepth; } - int a_body1loopBody1cont3(Void && _,int loopDepth) + int a_body1loopBody1cont7(Void && _,int loopDepth) { - #line 9401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PopChangeFeedBackupActorState(); static_cast(this)->destroy(); return 0; } - #line 51429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~PopChangeFeedBackupActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 11371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->reset(); + #line 64883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1loopBody1cont9(loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont3(_, loopDepth); + loopDepth = a_body1loopBody1cont7(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(Void && _,int loopDepth) + int a_body1loopBody1cont3when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont7(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< PopChangeFeedBackupActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WaitPurgeGranulesCompleteActorActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< PopChangeFeedBackupActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1cont2when1(value, 0); + a_body1loopBody1cont3when1(value, 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< PopChangeFeedBackupActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1cont2when1(std::move(value), 0); + a_body1loopBody1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< PopChangeFeedBackupActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< WaitPurgeGranulesCompleteActorActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1loopBody1Catch1(err, 0); } @@ -51494,8 +64945,21 @@ class PopChangeFeedBackupActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 1); + fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 2); + + } + int a_body1loopBody1cont9(int loopDepth) + { + try { + loopDepth = a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + return loopDepth; } int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { @@ -51521,16 +64985,16 @@ class PopChangeFeedBackupActorState { return loopDepth; } - void a_exitChoose3() + void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< PopChangeFeedBackupActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< PopChangeFeedBackupActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1loopBody1Catch1when1(value, 0); } @@ -51539,13 +65003,13 @@ class PopChangeFeedBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 2); + fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< PopChangeFeedBackupActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1loopBody1Catch1when1(std::move(value), 0); } @@ -51554,13 +65018,13 @@ class PopChangeFeedBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 2); + fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< PopChangeFeedBackupActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -51569,48 +65033,49 @@ class PopChangeFeedBackupActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), 2); + fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 3); } - #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference db; + #line 11350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key purgeKey; + #line 11351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Database cx; - #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key rangeID; - #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 9383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Transaction tr; - #line 9387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key rangeIDKey; - #line 51585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference tr; + #line 11368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future watchFuture; + #line 65049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via popChangeFeedBackup() - #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class PopChangeFeedBackupActor final : public Actor, public ActorCallback< PopChangeFeedBackupActor, 0, Optional >, public ActorCallback< PopChangeFeedBackupActor, 1, Void >, public ActorCallback< PopChangeFeedBackupActor, 2, Void >, public FastAllocated, public PopChangeFeedBackupActorState { - #line 51590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via waitPurgeGranulesCompleteActor() + #line 11350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class WaitPurgeGranulesCompleteActorActor final : public Actor, public ActorCallback< WaitPurgeGranulesCompleteActorActor, 0, Optional >, public ActorCallback< WaitPurgeGranulesCompleteActorActor, 1, Void >, public ActorCallback< WaitPurgeGranulesCompleteActorActor, 2, Void >, public ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >, public FastAllocated, public WaitPurgeGranulesCompleteActorActorState { + #line 65054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< PopChangeFeedBackupActor, 0, Optional >; -friend struct ActorCallback< PopChangeFeedBackupActor, 1, Void >; -friend struct ActorCallback< PopChangeFeedBackupActor, 2, Void >; - #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - PopChangeFeedBackupActor(Database const& cx,Key const& rangeID,Version const& version) - #line 51603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +friend struct ActorCallback< WaitPurgeGranulesCompleteActorActor, 0, Optional >; +friend struct ActorCallback< WaitPurgeGranulesCompleteActorActor, 1, Void >; +friend struct ActorCallback< WaitPurgeGranulesCompleteActorActor, 2, Void >; +friend struct ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >; + #line 11350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + WaitPurgeGranulesCompleteActorActor(Reference const& db,Key const& purgeKey) + #line 65068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" : Actor(), - PopChangeFeedBackupActorState(cx, rangeID, version) + WaitPurgeGranulesCompleteActorActorState(db, purgeKey) { - fdb_probe_actor_enter("popChangeFeedBackup", reinterpret_cast(this), -1); + fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("popChangeFeedBackup"); + this->lineage.setActorName("waitPurgeGranulesCompleteActor"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("popChangeFeedBackup", reinterpret_cast(this), -1); + fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), -1); } void cancel() override @@ -51618,71 +65083,85 @@ friend struct ActorCallback< PopChangeFeedBackupActor, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< PopChangeFeedBackupActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< PopChangeFeedBackupActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< PopChangeFeedBackupActor, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< WaitPurgeGranulesCompleteActorActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WaitPurgeGranulesCompleteActorActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< WaitPurgeGranulesCompleteActorActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >*)0, actor_cancelled()); break; } } }; } - #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] static Future popChangeFeedBackup( Database const& cx, Key const& rangeID, Version const& version ) { - #line 9382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new PopChangeFeedBackupActor(cx, rangeID, version)); - #line 51633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future waitPurgeGranulesCompleteActor( Reference const& db, Key const& purgeKey ) { + #line 11350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new WaitPurgeGranulesCompleteActorActor(db, purgeKey)); + #line 65099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 9407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 11377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +Future DatabaseContext::waitPurgeGranulesComplete(Key purgeKey) { + return waitPurgeGranulesCompleteActor(Reference::addRef(this), purgeKey); +} - #line 51638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 65108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via popChangeFeedMutationsActor() - #line 9408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 9408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class PopChangeFeedMutationsActorActorState { - #line 51645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via setBlobRangeActor() + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SetBlobRangeActorActorState { + #line 65115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 9408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - PopChangeFeedMutationsActorActorState(Reference const& db,Key const& rangeID,Version const& version) - #line 9408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 9408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : db(db), - #line 9408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - rangeID(rangeID), - #line 9408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - version(version), - #line 9409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx(db), - #line 9410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - rangeIDKey(rangeID.withPrefix(changeFeedPrefix)), - #line 9411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - span("NAPI:PopChangeFeedMutations"_loc) - #line 51662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SetBlobRangeActorActorState(Reference const& cx,KeyRange const& range,bool const& active,Optional> const& tenant) + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + active(active), + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenant(tenant), + #line 11386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db(cx), + #line 11387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr(makeReference(db)) + #line 65132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("popChangeFeedMutationsActor", reinterpret_cast(this)); + fdb_probe_actor_create("setBlobRangeActor", reinterpret_cast(this)); } - ~PopChangeFeedMutationsActorActorState() + ~SetBlobRangeActorActorState() { - fdb_probe_actor_destroy("popChangeFeedMutationsActor", reinterpret_cast(this)); + fdb_probe_actor_destroy("setBlobRangeActor", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 9413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = getChangeFeedRange(db, cx, rangeID); - #line 9413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 9413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 11389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (tenant.present()) + #line 65147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = tenant.get()->ready(); + #line 11390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 65153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 11390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 65158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -51694,53 +65173,76 @@ class PopChangeFeedMutationsActorActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~PopChangeFeedMutationsActorActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~SetBlobRangeActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 9415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_1 = getKeyRangeLocations(cx, Optional(), keys, 3, Reverse::False, &StorageServerInterface::changeFeedPop, span.context, Optional(), UseProvisionalProxies::False, latestVersion); - #line 9415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 9415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 51714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 11394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + value = active ? blobRangeActive : blobRangeInactive; + #line 11395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (active && (!g_network->isSimulated() || !g_simulator->willRestart) && BUGGIFY_WITH_PROB(0.1)) + #line 65188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int randLen = deterministicRandom()->randomInt(2, 20); + #line 11399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + value = StringRef(deterministicRandom()->randomAlphaNumeric(randLen)); + #line 65194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone changeLog(BlobRangeChangeLogRef(range, value)); + #line 11402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + changeValue = blobRangeChangeLogValueFor(changeLog); + #line 11403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 65202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } - int a_body1when1(KeyRange const& __keys,int loopDepth) + int a_body1cont2(Void const& _,int loopDepth) { - #line 9413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - keys = __keys; - #line 51723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range = range.withPrefix(tenant.get()->prefix()); + #line 65211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1when1(KeyRange && __keys,int loopDepth) + int a_body1cont2(Void && _,int loopDepth) { - keys = std::move(__keys); + #line 11391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range = range.withPrefix(tenant.get()->prefix()); + #line 65220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 0, KeyRange >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SetBlobRangeActorActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 0, KeyRange >*,KeyRange const& value) + void a_callback_fire(ActorCallback< SetBlobRangeActorActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -51750,12 +65252,12 @@ class PopChangeFeedMutationsActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 0, KeyRange >*,KeyRange && value) + void a_callback_fire(ActorCallback< SetBlobRangeActorActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -51765,12 +65267,12 @@ class PopChangeFeedMutationsActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 0, KeyRange >*,Error err) + void a_callback_error(ActorCallback< SetBlobRangeActorActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -51780,345 +65282,630 @@ class PopChangeFeedMutationsActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 0); } - int a_body1cont2(int loopDepth) + int a_body1cont1loopHead1(int loopDepth) { - #line 9427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (locations.size() > 2) - #line 51790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1(int loopDepth) + { + try { + #line 11405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 11406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 11408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture>> __when_expr_1 = getBlobRanges(&tr->getTransaction(), range, 1); + #line 11408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 65306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 11408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 65311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 11444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_5 = tr->onError(e); + #line 11444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 65335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 11444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 65340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont1loopBody1cont2(Standalone> const& startBlobRanges,int loopDepth) + { + #line 11410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (active) + #line 65355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = popChangeFeedBackup(cx, rangeID, version); - #line 9428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 9428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!startBlobRanges.empty()) + #line 65359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(startBlobRanges.front().begin == range.begin && startBlobRanges.front().end == range.end); this->~SetBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 65363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(startBlobRanges.front().begin == range.begin && startBlobRanges.front().end == range.end); + this->~SetBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1cont1loopBody1cont3(loopDepth); + } + else + { + #line 11418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (startBlobRanges.empty()) + #line 65375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~SetBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 65379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~SetBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 11421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (startBlobRanges.front().begin < range.begin) + #line 65389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~SetBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 65393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~SetBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 11427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture>> __when_expr_2 = getBlobRanges(&tr->getTransaction(), singleKeyRange(range.end), 1); + #line 11427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 65404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 11427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 65409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } + + return loopDepth; + } + int a_body1cont1loopBody1cont2(Standalone> && startBlobRanges,int loopDepth) + { + #line 11410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (active) + #line 65419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!startBlobRanges.empty()) + #line 65423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(startBlobRanges.front().begin == range.begin && startBlobRanges.front().end == range.end); this->~SetBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 65427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(startBlobRanges.front().begin == range.begin && startBlobRanges.front().end == range.end); + this->~SetBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1cont1loopBody1cont3(loopDepth); + } else { - loopDepth = a_body1cont3(loopDepth); + #line 11418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (startBlobRanges.empty()) + #line 65439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~SetBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 65443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~SetBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 11421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (startBlobRanges.front().begin < range.begin) + #line 65453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~SetBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 65457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~SetBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 11427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture>> __when_expr_2 = getBlobRanges(&tr->getTransaction(), singleKeyRange(range.end), 1); + #line 11427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 65468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 11427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 65473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } return loopDepth; } - int a_body1cont1when1(std::vector const& __locations,int loopDepth) + int a_body1cont1loopBody1when1(Standalone> const& startBlobRanges,int loopDepth) { - #line 9415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - locations = __locations; - #line 51815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1cont1loopBody1cont2(startBlobRanges, loopDepth); return loopDepth; } - int a_body1cont1when1(std::vector && __locations,int loopDepth) + int a_body1cont1loopBody1when1(Standalone> && startBlobRanges,int loopDepth) { - locations = std::move(__locations); - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1cont1loopBody1cont2(std::move(startBlobRanges), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 1, std::vector >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SetBlobRangeActorActor, 1, Standalone> >::remove(); } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 1, std::vector >*,std::vector const& value) + void a_callback_fire(ActorCallback< SetBlobRangeActorActor, 1, Standalone> >*,Standalone> const& value) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 1); + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(value, 0); + a_body1cont1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 1, std::vector >*,std::vector && value) + void a_callback_fire(ActorCallback< SetBlobRangeActorActor, 1, Standalone> >*,Standalone> && value) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 1); + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(std::move(value), 0); + a_body1cont1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 1, std::vector >*,Error err) + void a_callback_error(ActorCallback< SetBlobRangeActorActor, 1, Standalone> >*,Error err) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 1); + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1Catch1(err, 0); + a_body1cont1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 1); } - int a_body1cont3(int loopDepth) + int a_body1cont1loopBody1cont3(int loopDepth) { - #line 9432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bool foundFailed = false; - #line 9433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(int i = 0;i < locations.size() && !foundFailed;i++) { - #line 9434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(int j = 0;j < locations[i].locations->size() && !foundFailed;j++) { - #line 9435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (IFailureMonitor::failureMonitor() .getState(locations[i].locations->get(j, &StorageServerInterface::changeFeedPop).getEndpoint()) .isFailed()) - #line 51888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - foundFailed = true; - #line 51892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - } - #line 9443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (foundFailed) - #line 51898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = popChangeFeedBackup(cx, rangeID, version); - #line 9444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 51904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 9444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 51909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont6(loopDepth); - } + #line 11434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->set(blobRangeChangeKey, deterministicRandom()->randomUniqueID().toString()); + #line 11437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_3 = krmSetRange(tr, blobRangeKeys.begin, range, value); + #line 11437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 65550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 11437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 65555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont4(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont6(Standalone> const& endBlobRanges,int loopDepth) { - #line 9429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PopChangeFeedMutationsActorActorState(); static_cast(this)->destroy(); return 0; } - #line 51923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~PopChangeFeedMutationsActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 11429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!endBlobRanges.empty() && endBlobRanges.front().begin < range.end) + #line 65564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~SetBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 65568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~SetBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1cont1loopBody1cont3(loopDepth); return loopDepth; } - int a_body1cont4(Void && _,int loopDepth) + int a_body1cont1loopBody1cont6(Standalone> && endBlobRanges,int loopDepth) { - #line 9429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PopChangeFeedMutationsActorActorState(); static_cast(this)->destroy(); return 0; } - #line 51935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~PopChangeFeedMutationsActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 11429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!endBlobRanges.empty() && endBlobRanges.front().begin < range.end) + #line 65582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~SetBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 65586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~SetBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1cont1loopBody1cont3(loopDepth); return loopDepth; } - int a_body1cont2when1(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont2when1(Standalone> const& endBlobRanges,int loopDepth) { - loopDepth = a_body1cont4(_, loopDepth); + loopDepth = a_body1cont1loopBody1cont6(endBlobRanges, loopDepth); return loopDepth; } - int a_body1cont2when1(Void && _,int loopDepth) + int a_body1cont1loopBody1cont2when1(Standalone> && endBlobRanges,int loopDepth) { - loopDepth = a_body1cont4(std::move(_), loopDepth); + loopDepth = a_body1cont1loopBody1cont6(std::move(endBlobRanges), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SetBlobRangeActorActor, 2, Standalone> >::remove(); } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< SetBlobRangeActorActor, 2, Standalone> >*,Standalone> const& value) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 2); + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2when1(value, 0); + a_body1cont1loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 2); + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< SetBlobRangeActorActor, 2, Standalone> >*,Standalone> && value) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 2); + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2when1(std::move(value), 0); + a_body1cont1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 2); + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< SetBlobRangeActorActor, 2, Standalone> >*,Error err) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 2); + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1Catch1(err, 0); + a_body1cont1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 2); + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 2); } - int a_body1cont6(int loopDepth) + int a_body1cont1loopBody1cont12(Void const& _,int loopDepth) + { + #line 11439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->getTransaction().atomicOp( addVersionStampAtEnd(blobRangeChangeLogKeys.begin), changeValue, MutationRef::SetVersionstampedKey); + #line 11441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = tr->commit(); + #line 11441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 65667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont1loopBody1cont12when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 11441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 65672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1loopBody1cont12(Void && _,int loopDepth) + { + #line 11439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->getTransaction().atomicOp( addVersionStampAtEnd(blobRangeChangeLogKeys.begin), changeValue, MutationRef::SetVersionstampedKey); + #line 11441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_4 = tr->commit(); + #line 11441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 65685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont1loopBody1cont12when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 11441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 65690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont12(_, loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont12(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SetBlobRangeActorActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SetBlobRangeActorActor, 3, Void >*,Void const& value) { + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 3); + a_exitChoose4(); try { - #line 9450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector> popRequests; - #line 9451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(int i = 0;i < locations.size();i++) { - #line 9452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - for(int j = 0;j < locations[i].locations->size();j++) { - #line 9453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - popRequests.push_back(locations[i].locations->getInterface(j).changeFeedPop.getReply( ChangeFeedPopRequest(rangeID, version, locations[i].range))); - #line 52017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - } - #line 9458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_4 = waitForAll(popRequests); - #line 9457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont6Catch1(actor_cancelled(), loopDepth); - #line 52024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont6Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; - #line 9459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_5 = delay(CLIENT_KNOBS->CHANGE_FEED_POP_TIMEOUT); - #line 52028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont6Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont6when2(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 9458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 52035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + a_body1cont1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< SetBlobRangeActorActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< SetBlobRangeActorActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 3); + + } + int a_body1cont1loopBody1cont12cont1(Void const& _,int loopDepth) + { + #line 11442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~SetBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 65762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~SetBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1loopBody1cont12cont1(Void && _,int loopDepth) + { + #line 11442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~SetBlobRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 65774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~SetBlobRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1loopBody1cont12when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont12cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont12when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont12cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SetBlobRangeActorActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SetBlobRangeActorActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont1loopBody1cont12when1(value, 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< SetBlobRangeActorActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont1loopBody1cont12when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< SetBlobRangeActorActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont1loopBody1Catch1(err, 0); } catch (Error& error) { - loopDepth = a_body1cont6Catch1(error, loopDepth); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - loopDepth = a_body1cont6Catch1(unknown_error(), loopDepth); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 4); - return loopDepth; } - int a_body1cont10(Void const& _,int loopDepth) + int a_body1cont1loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 9445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PopChangeFeedMutationsActorActorState(); static_cast(this)->destroy(); return 0; } - #line 52050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~PopChangeFeedMutationsActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont10(Void && _,int loopDepth) + int a_body1cont1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 9445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PopChangeFeedMutationsActorActorState(); static_cast(this)->destroy(); return 0; } - #line 52062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~PopChangeFeedMutationsActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont3when1(Void const& _,int loopDepth) + int a_body1cont1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont10(_, loopDepth); + loopDepth = a_body1cont1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1cont3when1(Void && _,int loopDepth) + int a_body1cont1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont10(std::move(_), loopDepth); + loopDepth = a_body1cont1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose6() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SetBlobRangeActorActor, 5, Void >::remove(); } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< SetBlobRangeActorActor, 5, Void >*,Void const& value) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1cont3when1(value, 0); + a_body1cont1loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 3); + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 5); } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< SetBlobRangeActorActor, 5, Void >*,Void && value) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 5); + a_exitChoose6(); try { - a_body1cont3when1(std::move(value), 0); + a_body1cont1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 3); + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 5); } - void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< SetBlobRangeActorActor, 5, Void >*,Error err) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), 5); + a_exitChoose6(); try { a_body1Catch1(err, 0); } @@ -52127,46 +65914,135 @@ class PopChangeFeedMutationsActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 3); + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), 5); } - int a_body1cont11(int loopDepth) + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference cx; + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool active; + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional> tenant; + #line 11386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database db; + #line 11387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference tr; + #line 11394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Value value; + #line 11402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Value changeValue; + #line 65936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via setBlobRangeActor() + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class SetBlobRangeActorActor final : public Actor, public ActorCallback< SetBlobRangeActorActor, 0, Void >, public ActorCallback< SetBlobRangeActorActor, 1, Standalone> >, public ActorCallback< SetBlobRangeActorActor, 2, Standalone> >, public ActorCallback< SetBlobRangeActorActor, 3, Void >, public ActorCallback< SetBlobRangeActorActor, 4, Void >, public ActorCallback< SetBlobRangeActorActor, 5, Void >, public FastAllocated, public SetBlobRangeActorActorState { + #line 65941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< SetBlobRangeActorActor, 0, Void >; +friend struct ActorCallback< SetBlobRangeActorActor, 1, Standalone> >; +friend struct ActorCallback< SetBlobRangeActorActor, 2, Standalone> >; +friend struct ActorCallback< SetBlobRangeActorActor, 3, Void >; +friend struct ActorCallback< SetBlobRangeActorActor, 4, Void >; +friend struct ActorCallback< SetBlobRangeActorActor, 5, Void >; + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + SetBlobRangeActorActor(Reference const& cx,KeyRange const& range,bool const& active,Optional> const& tenant) + #line 65957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + SetBlobRangeActorActorState(cx, range, active, tenant) { - #line 9473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PopChangeFeedMutationsActorActorState(); static_cast(this)->destroy(); return 0; } - #line 52137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~PopChangeFeedMutationsActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + fdb_probe_actor_enter("setBlobRangeActor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("setBlobRangeActor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("setBlobRangeActor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< SetBlobRangeActorActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< SetBlobRangeActorActor, 1, Standalone> >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< SetBlobRangeActorActor, 2, Standalone> >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< SetBlobRangeActorActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< SetBlobRangeActorActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< SetBlobRangeActorActor, 5, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future setBlobRangeActor( Reference const& cx, KeyRange const& range, bool const& active, Optional> const& tenant ) { + #line 11382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new SetBlobRangeActorActor(cx, range, active, tenant)); + #line 65990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 11448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + + #line 65995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via blobbifyRangeActor() + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class BlobbifyRangeActorActorState { + #line 66002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + BlobbifyRangeActorActorState(Reference const& cx,KeyRange const& range,bool const& doWait,Optional> const& tenant) + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + doWait(doWait), + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenant(tenant) + #line 66015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("blobbifyRangeActor", reinterpret_cast(this)); + + } + ~BlobbifyRangeActorActorState() + { + fdb_probe_actor_destroy("blobbifyRangeActor", reinterpret_cast(this)); - return loopDepth; } - int a_body1cont6Catch1(const Error& e,int loopDepth=0) + int a_body1(int loopDepth=0) { try { - #line 9464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (e.code() != error_code_unknown_change_feed && e.code() != error_code_wrong_shard_server && e.code() != error_code_all_alternatives_failed && e.code() != error_code_broken_promise && e.code() != error_code_server_overloaded) - #line 52150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (BG_REQUEST_DEBUG) + #line 66030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(e, loopDepth); - #line 52154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("BlobbifyRange [{0} - {1}) ({2})\n", range.begin.printable(), range.end.printable(), doWait); + #line 66034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 9469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - db->changeFeedCache.erase(rangeID); - #line 9470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx->invalidateCache(Key(), keys); - #line 9471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_7 = popChangeFeedBackup(cx, rangeID, version); - #line 9471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 52164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont6Catch1when1(__when_expr_7.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 9471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 52169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = setBlobRangeActor(cx, range, true, tenant); + #line 11456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 66040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 11456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 66045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -52177,305 +66053,324 @@ class PopChangeFeedMutationsActorActorState { return loopDepth; } - int a_body1cont12(int loopDepth) - { - loopDepth = a_body1cont12cont1(loopDepth); - - return loopDepth; - } - int a_body1cont6when1(Void const& _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - loopDepth = a_body1cont12(loopDepth); + this->~BlobbifyRangeActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1cont6when1(Void && _,int loopDepth) + int a_body1cont1(int loopDepth) { - loopDepth = a_body1cont12(loopDepth); + #line 11457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!doWait || !result) + #line 66068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(result); this->~BlobbifyRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 66072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(std::move(result)); // state_var_RVO + this->~BlobbifyRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 11461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 66080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } - int a_body1cont6when2(Void const& _,int loopDepth) + int a_body1when1(bool const& __result,int loopDepth) { - #line 9460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_6 = popChangeFeedBackup(cx, rangeID, version); - #line 9460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont6Catch1(actor_cancelled(), loopDepth); - #line 52204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont6Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont6when2when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 9460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 52209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 11456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + result = __result; + #line 66089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1cont6when2(Void && _,int loopDepth) + int a_body1when1(bool && __result,int loopDepth) { - #line 9460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_6 = popChangeFeedBackup(cx, rangeID, version); - #line 9460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont6Catch1(actor_cancelled(), loopDepth); - #line 52220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont6Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont6when2when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 9460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 52225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + result = std::move(__result); + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - void a_exitChoose5() + void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 4, Void >::remove(); - static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 5, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< BlobbifyRangeActorActor, 0, bool >::remove(); } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< BlobbifyRangeActorActor, 0, bool >*,bool const& value) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("blobbifyRangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont6when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { - a_body1cont6Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont6Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 4); + fdb_probe_actor_exit("blobbifyRangeActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< BlobbifyRangeActorActor, 0, bool >*,bool && value) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("blobbifyRangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont6when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { - a_body1cont6Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont6Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 4); + fdb_probe_actor_exit("blobbifyRangeActor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< BlobbifyRangeActorActor, 0, bool >*,Error err) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("blobbifyRangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont6Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1cont6Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont6Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 4); - - } - int a_body1cont6when2cont1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont12(loopDepth); + fdb_probe_actor_exit("blobbifyRangeActor", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1cont6when2cont1(Void && _,int loopDepth) + int a_body1cont1loopHead1(int loopDepth) { - loopDepth = a_body1cont12(loopDepth); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); return loopDepth; } - int a_body1cont6when2when1(Void const& _,int loopDepth) + int a_body1cont1loopBody1(int loopDepth) { - loopDepth = a_body1cont6when2cont1(_, loopDepth); + #line 11462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = cx->verifyBlobRange(range, latestVersion, tenant); + #line 11462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 66165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 11462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 66170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont6when2when1(Void && _,int loopDepth) + int a_body1cont1loopBody1cont1(Version const& verifyVersion,int loopDepth) { - loopDepth = a_body1cont6when2cont1(std::move(_), loopDepth); + #line 11463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (verifyVersion != invalidVersion) + #line 66179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (BG_REQUEST_DEBUG) + #line 66183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("BlobbifyRange [{0} - {1}) got complete @ {2}\n", range.begin.printable(), range.end.printable(), verifyVersion); + #line 66187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(result); this->~BlobbifyRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 66191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(std::move(result)); // state_var_RVO + this->~BlobbifyRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 11472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(0.1); + #line 11472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 66201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 11472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 66206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; return loopDepth; } - void a_exitChoose6() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 6, Void >::remove(); - - } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 6, Void >*,Void const& value) + int a_body1cont1loopBody1cont1(Version && verifyVersion,int loopDepth) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 6); - a_exitChoose6(); - try { - a_body1cont6when2when1(value, 0); - } - catch (Error& error) { - a_body1cont6Catch1(error, 0); - } catch (...) { - a_body1cont6Catch1(unknown_error(), 0); + #line 11463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (verifyVersion != invalidVersion) + #line 66215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (BG_REQUEST_DEBUG) + #line 66219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("BlobbifyRange [{0} - {1}) got complete @ {2}\n", range.begin.printable(), range.end.printable(), verifyVersion); + #line 66223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(result); this->~BlobbifyRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 66227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(std::move(result)); // state_var_RVO + this->~BlobbifyRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 6); + #line 11472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = delay(0.1); + #line 11472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 66237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 11472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 66242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + return loopDepth; } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 6, Void >*,Void && value) + int a_body1cont1loopBody1when1(Version const& verifyVersion,int loopDepth) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 6); - a_exitChoose6(); - try { - a_body1cont6when2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont6Catch1(error, 0); - } catch (...) { - a_body1cont6Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 6); + loopDepth = a_body1cont1loopBody1cont1(verifyVersion, loopDepth); + return loopDepth; } - void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 6, Void >*,Error err) + int a_body1cont1loopBody1when1(Version && verifyVersion,int loopDepth) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 6); - a_exitChoose6(); - try { - a_body1cont6Catch1(err, 0); - } - catch (Error& error) { - a_body1cont6Catch1(error, 0); - } catch (...) { - a_body1cont6Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 6); + loopDepth = a_body1cont1loopBody1cont1(std::move(verifyVersion), loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 5, Void >*,Void const& value) + void a_exitChoose2() { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 5); - a_exitChoose5(); - try { - a_body1cont6when2(value, 0); - } - catch (Error& error) { - a_body1cont6Catch1(error, 0); - } catch (...) { - a_body1cont6Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 5); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< BlobbifyRangeActorActor, 1, Version >::remove(); } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< BlobbifyRangeActorActor, 1, Version >*,Version const& value) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 5); - a_exitChoose5(); + fdb_probe_actor_enter("blobbifyRangeActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont6when2(std::move(value), 0); + a_body1cont1loopBody1when1(value, 0); } catch (Error& error) { - a_body1cont6Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont6Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 5); + fdb_probe_actor_exit("blobbifyRangeActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 5, Void >*,Error err) + void a_callback_fire(ActorCallback< BlobbifyRangeActorActor, 1, Version >*,Version && value) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 5); - a_exitChoose5(); + fdb_probe_actor_enter("blobbifyRangeActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont6Catch1(err, 0); + a_body1cont1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1cont6Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1cont6Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 5); + fdb_probe_actor_exit("blobbifyRangeActor", reinterpret_cast(this), 1); } - int a_body1cont12cont1(int loopDepth) + void a_callback_error(ActorCallback< BlobbifyRangeActorActor, 1, Version >*,Error err) { + fdb_probe_actor_enter("blobbifyRangeActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - loopDepth = a_body1cont11(loopDepth); + a_body1Catch1(err, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("blobbifyRangeActor", reinterpret_cast(this), 1); - return loopDepth; } - int a_body1cont6Catch1cont1(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont2(Void const& _,int loopDepth) { - loopDepth = a_body1cont11(loopDepth); + if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; } - int a_body1cont6Catch1cont1(Void && _,int loopDepth) + int a_body1cont1loopBody1cont2(Void && _,int loopDepth) { - loopDepth = a_body1cont11(loopDepth); + if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; } - int a_body1cont6Catch1when1(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont6Catch1cont1(_, loopDepth); + loopDepth = a_body1cont1loopBody1cont2(_, loopDepth); return loopDepth; } - int a_body1cont6Catch1when1(Void && _,int loopDepth) + int a_body1cont1loopBody1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont6Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont1loopBody1cont2(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose7() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< BlobbifyRangeActorActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >*,Void const& value) + void a_callback_fire(ActorCallback< BlobbifyRangeActorActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 7); - a_exitChoose7(); + fdb_probe_actor_enter("blobbifyRangeActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont6Catch1when1(value, 0); + a_body1cont1loopBody1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 7); + fdb_probe_actor_exit("blobbifyRangeActor", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >*,Void && value) + void a_callback_fire(ActorCallback< BlobbifyRangeActorActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 7); - a_exitChoose7(); + fdb_probe_actor_enter("blobbifyRangeActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont6Catch1when1(std::move(value), 0); + a_body1cont1loopBody1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 7); + fdb_probe_actor_exit("blobbifyRangeActor", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >*,Error err) + void a_callback_error(ActorCallback< BlobbifyRangeActorActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), 7); - a_exitChoose7(); + fdb_probe_actor_enter("blobbifyRangeActor", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -52484,59 +66379,48 @@ class PopChangeFeedMutationsActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), 7); + fdb_probe_actor_exit("blobbifyRangeActor", reinterpret_cast(this), 2); } - #line 9408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference db; - #line 9408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key rangeID; - #line 9408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version version; - #line 9409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Database cx; - #line 9410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key rangeIDKey; - #line 9411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Span span; - #line 9413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - KeyRange keys; - #line 9415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - std::vector locations; - #line 52506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference cx; + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool doWait; + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional> tenant; + #line 11456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + bool result; + #line 66395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via popChangeFeedMutationsActor() - #line 9408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class PopChangeFeedMutationsActorActor final : public Actor, public ActorCallback< PopChangeFeedMutationsActorActor, 0, KeyRange >, public ActorCallback< PopChangeFeedMutationsActorActor, 1, std::vector >, public ActorCallback< PopChangeFeedMutationsActorActor, 2, Void >, public ActorCallback< PopChangeFeedMutationsActorActor, 3, Void >, public ActorCallback< PopChangeFeedMutationsActorActor, 4, Void >, public ActorCallback< PopChangeFeedMutationsActorActor, 5, Void >, public ActorCallback< PopChangeFeedMutationsActorActor, 6, Void >, public ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >, public FastAllocated, public PopChangeFeedMutationsActorActorState { - #line 52511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via blobbifyRangeActor() + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class BlobbifyRangeActorActor final : public Actor, public ActorCallback< BlobbifyRangeActorActor, 0, bool >, public ActorCallback< BlobbifyRangeActorActor, 1, Version >, public ActorCallback< BlobbifyRangeActorActor, 2, Void >, public FastAllocated, public BlobbifyRangeActorActorState { + #line 66400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< PopChangeFeedMutationsActorActor, 0, KeyRange >; -friend struct ActorCallback< PopChangeFeedMutationsActorActor, 1, std::vector >; -friend struct ActorCallback< PopChangeFeedMutationsActorActor, 2, Void >; -friend struct ActorCallback< PopChangeFeedMutationsActorActor, 3, Void >; -friend struct ActorCallback< PopChangeFeedMutationsActorActor, 4, Void >; -friend struct ActorCallback< PopChangeFeedMutationsActorActor, 5, Void >; -friend struct ActorCallback< PopChangeFeedMutationsActorActor, 6, Void >; -friend struct ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >; - #line 9408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - PopChangeFeedMutationsActorActor(Reference const& db,Key const& rangeID,Version const& version) - #line 52529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - PopChangeFeedMutationsActorActorState(db, rangeID, version) +friend struct ActorCallback< BlobbifyRangeActorActor, 0, bool >; +friend struct ActorCallback< BlobbifyRangeActorActor, 1, Version >; +friend struct ActorCallback< BlobbifyRangeActorActor, 2, Void >; + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + BlobbifyRangeActorActor(Reference const& cx,KeyRange const& range,bool const& doWait,Optional> const& tenant) + #line 66413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + BlobbifyRangeActorActorState(cx, range, doWait, tenant) { - fdb_probe_actor_enter("popChangeFeedMutationsActor", reinterpret_cast(this), -1); + fdb_probe_actor_enter("blobbifyRangeActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("popChangeFeedMutationsActor"); + this->lineage.setActorName("blobbifyRangeActor"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("popChangeFeedMutationsActor", reinterpret_cast(this), -1); + fdb_probe_actor_exit("blobbifyRangeActor", reinterpret_cast(this), -1); } void cancel() override @@ -52544,86 +66428,96 @@ friend struct ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< PopChangeFeedMutationsActorActor, 0, KeyRange >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< PopChangeFeedMutationsActorActor, 1, std::vector >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< PopChangeFeedMutationsActorActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< PopChangeFeedMutationsActorActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< PopChangeFeedMutationsActorActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< PopChangeFeedMutationsActorActor, 6, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< PopChangeFeedMutationsActorActor, 7, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< BlobbifyRangeActorActor, 0, bool >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< BlobbifyRangeActorActor, 1, Version >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< BlobbifyRangeActorActor, 2, Void >*)0, actor_cancelled()); break; } } }; } - #line 9408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future popChangeFeedMutationsActor( Reference const& db, Key const& rangeID, Version const& version ) { - #line 9408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new PopChangeFeedMutationsActorActor(db, rangeID, version)); - #line 52563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future blobbifyRangeActor( Reference const& cx, KeyRange const& range, bool const& doWait, Optional> const& tenant ) { + #line 11449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new BlobbifyRangeActorActor(cx, range, doWait, tenant)); + #line 66443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 9475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 11475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -Future DatabaseContext::popChangeFeedMutations(Key rangeID, Version version) { - return popChangeFeedMutationsActor(Reference::addRef(this), rangeID, version); +Future DatabaseContext::blobbifyRange(KeyRange range, Optional> tenant) { + return blobbifyRangeActor(Reference::addRef(this), range, false, tenant); } -Reference DatabaseContext::createTransaction() { - return makeReference(Database(Reference::addRef(this))); +Future DatabaseContext::blobbifyRangeBlocking(KeyRange range, Optional> tenant) { + return blobbifyRangeActor(Reference::addRef(this), range, true, tenant); } - #line 52576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +Future DatabaseContext::unblobbifyRange(KeyRange range, Optional> tenant) { + return setBlobRangeActor(Reference::addRef(this), range, false, tenant); +} + + #line 66460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via purgeBlobGranulesActor() - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class PurgeBlobGranulesActorActorState { - #line 52583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via listBlobbifiedRangesActor() + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class ListBlobbifiedRangesActorActorState { + #line 66467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - PurgeBlobGranulesActorActorState(Reference const& db,KeyRange const& range,Version const& purgeVersion,bool const& force) - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : db(db), - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ListBlobbifiedRangesActorActorState(Reference const& cx,KeyRange const& range,int const& rangeLimit,Optional> const& tenant) + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" range(range), - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - purgeVersion(purgeVersion), - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - force(force), - #line 9488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx(db), - #line 9489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr(cx), - #line 9490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - purgeKey() - #line 52602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + rangeLimit(rangeLimit), + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenant(tenant), + #line 11493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db(cx), + #line 11494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr(db), + #line 11495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantPrefix(), + #line 11496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + blobRanges() + #line 66488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("purgeBlobGranulesActor", reinterpret_cast(this)); + fdb_probe_actor_create("listBlobbifiedRangesActor", reinterpret_cast(this)); } - ~PurgeBlobGranulesActorActorState() + ~ListBlobbifiedRangesActorActorState() { - fdb_probe_actor_destroy("purgeBlobGranulesActor", reinterpret_cast(this)); + fdb_probe_actor_destroy("listBlobbifiedRangesActor", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 9493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!force) - #line 52617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (tenant.present()) + #line 66503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return a_body1Catch1(unsupported_operation(), loopDepth); - #line 52621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = tenant.get()->ready(); + #line 11499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 66509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 11499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 66514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); } - #line 9496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - ; - #line 52625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -52635,369 +66529,357 @@ class PurgeBlobGranulesActorActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~PurgeBlobGranulesActorActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~ListBlobbifiedRangesActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 9528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(purgeKey); this->~PurgeBlobGranulesActorActorState(); static_cast(this)->destroy(); return 0; } - #line 52648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Key >::value()) Key(std::move(purgeKey)); // state_var_RVO - this->~PurgeBlobGranulesActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 11504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ; + #line 66542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } - int a_body1loopHead1(int loopDepth) + int a_body1cont2(Void const& _,int loopDepth) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + #line 11500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantPrefix = tenant.get()->prefix(); + #line 11501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range = range.withPrefix(tenantPrefix); + #line 66553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1(int loopDepth) + int a_body1cont2(Void && _,int loopDepth) { - try { - #line 9498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 9499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 9501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Value purgeValue = blobGranulePurgeValueFor(purgeVersion, range, force); - #line 9502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr.atomicOp( addVersionStampAtEnd(blobGranulePurgeKeys.begin), purgeValue, MutationRef::SetVersionstampedKey); - #line 9504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr.set(blobGranulePurgeChangeKey, deterministicRandom()->randomUniqueID().toString()); - #line 9505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fTrVs = tr.getVersionstamp(); - #line 9506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_0 = tr.commit(); - #line 9506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 52682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 9506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 52687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); - } + #line 11500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantPrefix = tenant.get()->prefix(); + #line 11501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range = range.withPrefix(tenantPrefix); + #line 66564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1break1(int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - try { - return a_body1cont1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } + loopDepth = a_body1cont2(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont1(int loopDepth) + int a_body1when1(Void && _,int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); + loopDepth = a_body1cont2(std::move(_), loopDepth); return loopDepth; } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ListBlobbifiedRangesActorActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ListBlobbifiedRangesActorActor, 0, Void >*,Void const& value) { + fdb_probe_actor_enter("listBlobbifiedRangesActor", reinterpret_cast(this), 0); + a_exitChoose1(); try { - #line 9518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 52722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("purgeBlobGranules for range [{0} - {1}) at version {2} encountered error {3}\n", range.begin.printable(), range.end.printable(), purgeVersion, e.name()); - #line 52726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = tr.onError(e); - #line 9525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 52732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 9525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 52737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + a_body1when1(value, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("listBlobbifiedRangesActor", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1loopBody1cont2(Void const& _,int loopDepth) + void a_callback_fire(ActorCallback< ListBlobbifiedRangesActorActor, 0, Void >*,Void && value) { - #line 9507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_1 = fTrVs; - #line 9507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 52754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 9507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 52759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_enter("listBlobbifiedRangesActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listBlobbifiedRangesActor", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1loopBody1cont2(Void && _,int loopDepth) + void a_callback_error(ActorCallback< ListBlobbifiedRangesActorActor, 0, Void >*,Error err) { - #line 9507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_1 = fTrVs; - #line 9507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 52770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 9507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 52775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_enter("listBlobbifiedRangesActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listBlobbifiedRangesActor", reinterpret_cast(this), 0); - return loopDepth; } - int a_body1loopBody1when1(Void const& _,int loopDepth) + int a_body1cont4(int loopDepth) { - loopDepth = a_body1loopBody1cont2(_, loopDepth); + #line 11513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!tenant.present()) + #line 66636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(blobRanges); this->~ListBlobbifiedRangesActorActorState(); static_cast(this)->destroy(); return 0; } + #line 66640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(blobRanges)); // state_var_RVO + this->~ListBlobbifiedRangesActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 11518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantBlobRanges = Standalone>(); + #line 11519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for( auto& blobRange : blobRanges ) { + #line 11521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!blobRange.begin.startsWith(tenantPrefix) || !blobRange.end.startsWith(tenantPrefix)) + #line 66652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + TraceEvent("ListBlobbifiedRangeSpansTenants") .suppressFor( 5) .detail("Tenant", tenant) .detail("Range", blobRange); + #line 66656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + continue; + } + #line 11528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tenantBlobRanges.push_back_deep(tenantBlobRanges.arena(), blobRange.removePrefix(tenantPrefix)); + #line 66661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(tenantBlobRanges); this->~ListBlobbifiedRangesActorActorState(); static_cast(this)->destroy(); return 0; } + #line 66665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(tenantBlobRanges)); // state_var_RVO + this->~ListBlobbifiedRangesActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1loopBody1when1(Void && _,int loopDepth) + int a_body1cont1loopHead1(int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); return loopDepth; } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< PurgeBlobGranulesActorActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 0, Void >*,Void const& value) + int a_body1cont1loopBody1(int loopDepth) { - fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 0); - a_exitChoose1(); try { - a_body1loopBody1when1(value, 0); + #line 11506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_1 = store(blobRanges, getBlobRanges(&tr, range, rangeLimit)); + #line 11506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 66687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 11506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 66692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1cont1loopBody1Catch1(error, loopDepth); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1cont1loopBody1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 0); + return loopDepth; } - void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 0, Void >*,Void && value) + int a_body1cont1break1(int loopDepth) { - fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 0); - a_exitChoose1(); try { - a_body1loopBody1when1(std::move(value), 0); + return a_body1cont4(loopDepth); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 0); + return loopDepth; } - void a_callback_error(ActorCallback< PurgeBlobGranulesActorActor, 0, Void >*,Error err) + int a_body1cont1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { - fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 0); - a_exitChoose1(); try { - a_body1loopBody1Catch1(err, 0); + #line 11509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = tr.onError(e); + #line 11509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 66729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 11509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 66734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } - fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 0); + return loopDepth; } - int a_body1loopBody1cont3(Standalone const& vs,int loopDepth) + int a_body1cont1loopBody1cont2(Void const& _,int loopDepth) { - #line 9508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - purgeKey = blobGranulePurgeKeys.begin.withSuffix(vs); - #line 9509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 52849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("purgeBlobGranules for range [{0} - {1}) at version {2} registered {3}\n", range.begin.printable(), range.end.printable(), purgeVersion, purgeKey.printable()); - #line 52853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1loopBody1cont3(Standalone && vs,int loopDepth) + int a_body1cont1loopBody1cont2(Void && _,int loopDepth) { - #line 9508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - purgeKey = blobGranulePurgeKeys.begin.withSuffix(vs); - #line 9509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 52865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("purgeBlobGranules for range [{0} - {1}) at version {2} registered {3}\n", range.begin.printable(), range.end.printable(), purgeVersion, purgeKey.printable()); - #line 52869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - return a_body1break1(loopDepth==0?0:loopDepth-1); // break + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } - int a_body1loopBody1cont2when1(Standalone const& vs,int loopDepth) + int a_body1cont1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont3(vs, loopDepth); + loopDepth = a_body1cont1loopBody1cont2(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(Standalone && vs,int loopDepth) + int a_body1cont1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont3(std::move(vs), loopDepth); + loopDepth = a_body1cont1loopBody1cont2(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< PurgeBlobGranulesActorActor, 1, Standalone >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ListBlobbifiedRangesActorActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 1, Standalone >*,Standalone const& value) + void a_callback_fire(ActorCallback< ListBlobbifiedRangesActorActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 1); + fdb_probe_actor_enter("listBlobbifiedRangesActor", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1cont2when1(value, 0); + a_body1cont1loopBody1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("listBlobbifiedRangesActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 1, Standalone >*,Standalone && value) + void a_callback_fire(ActorCallback< ListBlobbifiedRangesActorActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 1); + fdb_probe_actor_enter("listBlobbifiedRangesActor", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1cont2when1(std::move(value), 0); + a_body1cont1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("listBlobbifiedRangesActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< PurgeBlobGranulesActorActor, 1, Standalone >*,Error err) + void a_callback_error(ActorCallback< ListBlobbifiedRangesActorActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 1); + fdb_probe_actor_enter("listBlobbifiedRangesActor", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1Catch1(err, 0); + a_body1cont1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1cont1loopBody1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1cont1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("listBlobbifiedRangesActor", reinterpret_cast(this), 1); } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1cont1loopBody1Catch1cont1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1cont1loopBody1Catch1cont1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + loopDepth = a_body1cont1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1cont1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< PurgeBlobGranulesActorActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ListBlobbifiedRangesActorActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< ListBlobbifiedRangesActorActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 2); + fdb_probe_actor_enter("listBlobbifiedRangesActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1Catch1when1(value, 0); + a_body1cont1loopBody1Catch1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 2); + fdb_probe_actor_exit("listBlobbifiedRangesActor", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< PurgeBlobGranulesActorActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< ListBlobbifiedRangesActorActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 2); + fdb_probe_actor_enter("listBlobbifiedRangesActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1Catch1when1(std::move(value), 0); + a_body1cont1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 2); + fdb_probe_actor_exit("listBlobbifiedRangesActor", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< PurgeBlobGranulesActorActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< ListBlobbifiedRangesActorActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), 2); + fdb_probe_actor_enter("listBlobbifiedRangesActor", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -53007,54 +66889,56 @@ class PurgeBlobGranulesActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), 2); + fdb_probe_actor_exit("listBlobbifiedRangesActor", reinterpret_cast(this), 2); } - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference db; - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference cx; + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" KeyRange range; - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Version purgeVersion; - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - bool force; - #line 9488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Database cx; - #line 9489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + int rangeLimit; + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional> tenant; + #line 11493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database db; + #line 11494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Transaction tr; - #line 9490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key purgeKey; - #line 9505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future> fTrVs; - #line 53029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRef tenantPrefix; + #line 11496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone> blobRanges; + #line 11518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone> tenantBlobRanges; + #line 66913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via purgeBlobGranulesActor() - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class PurgeBlobGranulesActorActor final : public Actor, public ActorCallback< PurgeBlobGranulesActorActor, 0, Void >, public ActorCallback< PurgeBlobGranulesActorActor, 1, Standalone >, public ActorCallback< PurgeBlobGranulesActorActor, 2, Void >, public FastAllocated, public PurgeBlobGranulesActorActorState { - #line 53034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via listBlobbifiedRangesActor() + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class ListBlobbifiedRangesActorActor final : public Actor>>, public ActorCallback< ListBlobbifiedRangesActorActor, 0, Void >, public ActorCallback< ListBlobbifiedRangesActorActor, 1, Void >, public ActorCallback< ListBlobbifiedRangesActorActor, 2, Void >, public FastAllocated, public ListBlobbifiedRangesActorActorState { + #line 66918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< PurgeBlobGranulesActorActor, 0, Void >; -friend struct ActorCallback< PurgeBlobGranulesActorActor, 1, Standalone >; -friend struct ActorCallback< PurgeBlobGranulesActorActor, 2, Void >; - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - PurgeBlobGranulesActorActor(Reference const& db,KeyRange const& range,Version const& purgeVersion,bool const& force) - #line 53047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - PurgeBlobGranulesActorActorState(db, range, purgeVersion, force) +friend struct ActorCallback< ListBlobbifiedRangesActorActor, 0, Void >; +friend struct ActorCallback< ListBlobbifiedRangesActorActor, 1, Void >; +friend struct ActorCallback< ListBlobbifiedRangesActorActor, 2, Void >; + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ListBlobbifiedRangesActorActor(Reference const& cx,KeyRange const& range,int const& rangeLimit,Optional> const& tenant) + #line 66931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>>(), + ListBlobbifiedRangesActorActorState(cx, range, rangeLimit, tenant) { - fdb_probe_actor_enter("purgeBlobGranulesActor", reinterpret_cast(this), -1); + fdb_probe_actor_enter("listBlobbifiedRangesActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("purgeBlobGranulesActor"); + this->lineage.setActorName("listBlobbifiedRangesActor"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("purgeBlobGranulesActor", reinterpret_cast(this), -1); + fdb_probe_actor_exit("listBlobbifiedRangesActor", reinterpret_cast(this), -1); } void cancel() override @@ -53062,63 +66946,67 @@ friend struct ActorCallback< PurgeBlobGranulesActorActor, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< PurgeBlobGranulesActorActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< PurgeBlobGranulesActorActor, 1, Standalone >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< PurgeBlobGranulesActorActor, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< ListBlobbifiedRangesActorActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ListBlobbifiedRangesActorActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ListBlobbifiedRangesActorActor, 2, Void >*)0, actor_cancelled()); break; } } }; } - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future purgeBlobGranulesActor( Reference const& db, KeyRange const& range, Version const& purgeVersion, bool const& force ) { - #line 9484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new PurgeBlobGranulesActorActor(db, range, purgeVersion, force)); - #line 53077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future>> listBlobbifiedRangesActor( Reference const& cx, KeyRange const& range, int const& rangeLimit, Optional> const& tenant ) { + #line 11488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new ListBlobbifiedRangesActorActor(cx, range, rangeLimit, tenant)); + #line 66961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 9530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 11532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -Future DatabaseContext::purgeBlobGranules(KeyRange range, Version purgeVersion, bool force) { - return purgeBlobGranulesActor(Reference::addRef(this), range, purgeVersion, force); +Future>> DatabaseContext::listBlobbifiedRanges(KeyRange range, + int rangeLimit, + Optional> tenant) { + return listBlobbifiedRangesActor(Reference::addRef(this), range, rangeLimit, tenant); } - #line 53086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 66972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" namespace { -// This generated class is to be used only via waitPurgeGranulesCompleteActor() - #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -template - #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class WaitPurgeGranulesCompleteActorActorState { - #line 53093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via blobRestoreActor() + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class BlobRestoreActorActorState { + #line 66979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WaitPurgeGranulesCompleteActorActorState(Reference const& db,Key const& purgeKey) - #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - : db(db), - #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - purgeKey(purgeKey), - #line 9536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - cx(db), - #line 9537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr(makeReference(cx)) - #line 53106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + BlobRestoreActorActorState(Reference const& cx,KeyRange const& range,Optional const& version) + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : cx(cx), + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + range(range), + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + version(version), + #line 11540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + db(cx), + #line 11541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr(makeReference(db)) + #line 66994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - fdb_probe_actor_create("waitPurgeGranulesCompleteActor", reinterpret_cast(this)); + fdb_probe_actor_create("blobRestoreActor", reinterpret_cast(this)); } - ~WaitPurgeGranulesCompleteActorActorState() + ~BlobRestoreActorActorState() { - fdb_probe_actor_destroy("waitPurgeGranulesCompleteActor", reinterpret_cast(this)); + fdb_probe_actor_destroy("blobRestoreActor", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 9538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" ; - #line 53121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 67009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -53131,8 +67019,8 @@ class WaitPurgeGranulesCompleteActorActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~WaitPurgeGranulesCompleteActorActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~BlobRestoreActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; @@ -53147,20 +67035,24 @@ class WaitPurgeGranulesCompleteActorActorState { int a_body1loopBody1(int loopDepth) { try { - #line 9540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 9541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 9543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture> __when_expr_0 = tr->get(purgeKey); - #line 9543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 53158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 11547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + key = blobRestoreCommandKeyFor(range); + #line 11548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_0 = tr->get(key); + #line 11548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 67050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 9543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 53163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 11548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 67055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -53180,16 +67072,16 @@ class WaitPurgeGranulesCompleteActorActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 9558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_3 = tr->onError(e); - #line 9558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 53187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 9558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 53192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_2 = tr->onError(e); + #line 11566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 67079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 11566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 67084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -53200,119 +67092,121 @@ class WaitPurgeGranulesCompleteActorActorState { return loopDepth; } - int a_body1loopBody1cont2(Optional const& purgeVal,int loopDepth) + int a_body1loopBody1cont2(Optional const& value,int loopDepth) { - #line 9544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!purgeVal.present()) - #line 53207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (value.present()) + #line 67099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 53211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone restoreState = decodeBlobRestoreState(value.get()); + #line 11551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (restoreState.phase < BlobRestorePhase::DONE) + #line 67105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("purgeBlobGranules for {0} succeeded\n", purgeKey.printable()); - #line 53215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~BlobRestoreActorActorState(); static_cast(this)->destroy(); return 0; } + #line 67109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~BlobRestoreActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } - #line 9548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitPurgeGranulesCompleteActorActorState(); static_cast(this)->destroy(); return 0; } - #line 53219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~WaitPurgeGranulesCompleteActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 9550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 53227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("purgeBlobGranules for {0} watching\n", purgeKey.printable()); - #line 53231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } - #line 9553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - watchFuture = tr->watch(purgeKey); - #line 9554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + BlobRestoreState restoreState(BlobRestorePhase::INIT); + #line 11556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Value newValue = blobRestoreCommandValueFor(restoreState); + #line 11557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->set(key, newValue); + #line 11559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + BlobRestoreArg arg(version); + #line 11560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Value argValue = blobRestoreArgValueFor(arg); + #line 11561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->set(blobRestoreArgKeyFor(range), argValue); + #line 11563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = tr->commit(); - #line 9554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 53239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 67132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 9554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 53244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 11563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 67137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont2(Optional && purgeVal,int loopDepth) + int a_body1loopBody1cont2(Optional && value,int loopDepth) { - #line 9544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!purgeVal.present()) - #line 53253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (value.present()) + #line 67146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 53257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Standalone restoreState = decodeBlobRestoreState(value.get()); + #line 11551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (restoreState.phase < BlobRestorePhase::DONE) + #line 67152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" { - #line 9546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("purgeBlobGranules for {0} succeeded\n", purgeKey.printable()); - #line 53261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~BlobRestoreActorActorState(); static_cast(this)->destroy(); return 0; } + #line 67156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~BlobRestoreActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } - #line 9548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitPurgeGranulesCompleteActorActorState(); static_cast(this)->destroy(); return 0; } - #line 53265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~WaitPurgeGranulesCompleteActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; } - #line 9550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (BG_REQUEST_DEBUG) - #line 53273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - { - #line 9551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - fmt::print("purgeBlobGranules for {0} watching\n", purgeKey.printable()); - #line 53277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - } - #line 9553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - watchFuture = tr->watch(purgeKey); - #line 9554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + BlobRestoreState restoreState(BlobRestorePhase::INIT); + #line 11556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Value newValue = blobRestoreCommandValueFor(restoreState); + #line 11557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->set(key, newValue); + #line 11559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + BlobRestoreArg arg(version); + #line 11560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Value argValue = blobRestoreArgValueFor(arg); + #line 11561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + tr->set(blobRestoreArgKeyFor(range), argValue); + #line 11563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" StrictFuture __when_expr_1 = tr->commit(); - #line 9554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 53285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 67179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 9554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 53290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 11563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 67184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1when1(Optional const& purgeVal,int loopDepth) + int a_body1loopBody1when1(Optional const& value,int loopDepth) { - loopDepth = a_body1loopBody1cont2(purgeVal, loopDepth); + loopDepth = a_body1loopBody1cont2(value, loopDepth); return loopDepth; } - int a_body1loopBody1when1(Optional && purgeVal,int loopDepth) + int a_body1loopBody1when1(Optional && value,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(purgeVal), loopDepth); + loopDepth = a_body1loopBody1cont2(std::move(value), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WaitPurgeGranulesCompleteActorActor, 0, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< BlobRestoreActorActor, 0, Optional >::remove(); } - void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 0, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< BlobRestoreActorActor, 0, Optional >*,Optional const& value) { - fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("blobRestoreActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -53322,12 +67216,12 @@ class WaitPurgeGranulesCompleteActorActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("blobRestoreActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 0, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< BlobRestoreActorActor, 0, Optional >*,Optional && value) { - fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("blobRestoreActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -53337,12 +67231,12 @@ class WaitPurgeGranulesCompleteActorActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("blobRestoreActor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< WaitPurgeGranulesCompleteActorActor, 0, Optional >*,Error err) + void a_callback_error(ActorCallback< BlobRestoreActorActor, 0, Optional >*,Error err) { - fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 0); + fdb_probe_actor_enter("blobRestoreActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1Catch1(err, 0); @@ -53352,38 +67246,30 @@ class WaitPurgeGranulesCompleteActorActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("blobRestoreActor", reinterpret_cast(this), 0); } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 9555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = watchFuture; - #line 9555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 53364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 9555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 53369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 11564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~BlobRestoreActorActorState(); static_cast(this)->destroy(); return 0; } + #line 67256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~BlobRestoreActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 9555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - StrictFuture __when_expr_2 = watchFuture; - #line 9555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 53380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 9555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 53385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = 0; + #line 11564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(true); this->~BlobRestoreActorActorState(); static_cast(this)->destroy(); return 0; } + #line 67268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(true); + this->~BlobRestoreActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } @@ -53401,13 +67287,13 @@ class WaitPurgeGranulesCompleteActorActorState { } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WaitPurgeGranulesCompleteActorActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< BlobRestoreActorActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< BlobRestoreActorActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 1); + fdb_probe_actor_enter("blobRestoreActor", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1cont2when1(value, 0); @@ -53417,12 +67303,12 @@ class WaitPurgeGranulesCompleteActorActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("blobRestoreActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< BlobRestoreActorActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 1); + fdb_probe_actor_enter("blobRestoreActor", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1cont2when1(std::move(value), 0); @@ -53432,12 +67318,12 @@ class WaitPurgeGranulesCompleteActorActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("blobRestoreActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< WaitPurgeGranulesCompleteActorActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< BlobRestoreActorActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 1); + fdb_probe_actor_enter("blobRestoreActor", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1Catch1(err, 0); @@ -53447,167 +67333,322 @@ class WaitPurgeGranulesCompleteActorActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 1); + fdb_probe_actor_exit("blobRestoreActor", reinterpret_cast(this), 1); } - int a_body1loopBody1cont7(Void const& _,int loopDepth) + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 9556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr->reset(); - #line 53457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont9(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont7(Void && _,int loopDepth) + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 9556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - tr->reset(); - #line 53466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - loopDepth = a_body1loopBody1cont9(loopDepth); + loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont7(_, loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont3when1(Void && _,int loopDepth) + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont7(std::move(_), loopDepth); + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WaitPurgeGranulesCompleteActorActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< BlobRestoreActorActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< BlobRestoreActorActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 2); + fdb_probe_actor_enter("blobRestoreActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont3when1(value, 0); + a_body1loopBody1Catch1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 2); + fdb_probe_actor_exit("blobRestoreActor", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< BlobRestoreActorActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 2); + fdb_probe_actor_enter("blobRestoreActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont3when1(std::move(value), 0); + a_body1loopBody1Catch1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 2); + fdb_probe_actor_exit("blobRestoreActor", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< WaitPurgeGranulesCompleteActorActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< BlobRestoreActorActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 2); + fdb_probe_actor_enter("blobRestoreActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 2); + fdb_probe_actor_exit("blobRestoreActor", reinterpret_cast(this), 2); } - int a_body1loopBody1cont9(int loopDepth) + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference cx; + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + KeyRange range; + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Optional version; + #line 11540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Database db; + #line 11541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Reference tr; + #line 11547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Key key; + #line 67426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via blobRestoreActor() + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class BlobRestoreActorActor final : public Actor, public ActorCallback< BlobRestoreActorActor, 0, Optional >, public ActorCallback< BlobRestoreActorActor, 1, Void >, public ActorCallback< BlobRestoreActorActor, 2, Void >, public FastAllocated, public BlobRestoreActorActorState { + #line 67431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< BlobRestoreActorActor, 0, Optional >; +friend struct ActorCallback< BlobRestoreActorActor, 1, Void >; +friend struct ActorCallback< BlobRestoreActorActor, 2, Void >; + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + BlobRestoreActorActor(Reference const& cx,KeyRange const& range,Optional const& version) + #line 67444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor(), + BlobRestoreActorActorState(cx, range, version) + { + fdb_probe_actor_enter("blobRestoreActor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("blobRestoreActor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("blobRestoreActor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< BlobRestoreActorActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< BlobRestoreActorActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< BlobRestoreActorActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future blobRestoreActor( Reference const& cx, KeyRange const& range, Optional const& version ) { + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future(new BlobRestoreActorActor(cx, range, version)); + #line 67474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 11570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +Future DatabaseContext::blobRestore(KeyRange range, Optional version) { + return blobRestoreActor(Reference::addRef(this), range, version); +} + + #line 67483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +namespace { +// This generated class is to be used only via getHotRangeMetricsActor() + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetHotRangeMetricsActorActorState { + #line 67490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetHotRangeMetricsActorActorState(Reference const& db,StorageServerInterface const& ssi,ReadHotSubRangeRequest const& req) + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : db(db), + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ssi(ssi), + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + req(req) + #line 67501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("getHotRangeMetricsActor", reinterpret_cast(this)); + + } + ~GetHotRangeMetricsActorActorState() + { + fdb_probe_actor_destroy("getHotRangeMetricsActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) { try { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 11578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture> __when_expr_0 = ssi.getReadHotRanges.tryGetReply(req); + #line 11578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 67518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 11578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 67523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + int a_body1Catch1(Error error,int loopDepth=0) { - loopDepth = a_body1loopBody1cont1(loopDepth); + this->~GetHotRangeMetricsActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; return loopDepth; } - int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + int a_body1cont1(ErrorOr const& fs,int loopDepth) { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 11579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (fs.isError()) + #line 67546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("Error({}): cannot get read hot metrics from storage server {}.\n", fs.getError().what(), ssi.address().toString()); + #line 11583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(Standalone>()); this->~GetHotRangeMetricsActorActorState(); static_cast(this)->destroy(); return 0; } + #line 67552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(Standalone>()); + this->~GetHotRangeMetricsActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 11585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(fs.get().readHotRanges); this->~GetHotRangeMetricsActorActorState(); static_cast(this)->destroy(); return 0; } + #line 67562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(fs.get().readHotRanges); + this->~GetHotRangeMetricsActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } return loopDepth; } - int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + int a_body1cont1(ErrorOr && fs,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + #line 11579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (fs.isError()) + #line 67575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + #line 11580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + fmt::print("Error({}): cannot get read hot metrics from storage server {}.\n", fs.getError().what(), ssi.address().toString()); + #line 11583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(Standalone>()); this->~GetHotRangeMetricsActorActorState(); static_cast(this)->destroy(); return 0; } + #line 67581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(Standalone>()); + this->~GetHotRangeMetricsActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 11585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(fs.get().readHotRanges); this->~GetHotRangeMetricsActorActorState(); static_cast(this)->destroy(); return 0; } + #line 67591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(fs.get().readHotRanges); + this->~GetHotRangeMetricsActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } return loopDepth; } - int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + int a_body1when1(ErrorOr const& fs,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont1(fs, loopDepth); return loopDepth; } - void a_exitChoose4() + int a_body1when1(ErrorOr && fs,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >::remove(); + loopDepth = a_body1cont1(std::move(fs), loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >*,Void const& value) + void a_exitChoose1() { - fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 3); - a_exitChoose4(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetHotRangeMetricsActorActor, 0, ErrorOr >::remove(); + + } + void a_callback_fire(ActorCallback< GetHotRangeMetricsActorActor, 0, ErrorOr >*,ErrorOr const& value) + { + fdb_probe_actor_enter("getHotRangeMetricsActor", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1Catch1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getHotRangeMetricsActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetHotRangeMetricsActorActor, 0, ErrorOr >*,ErrorOr && value) { - fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getHotRangeMetricsActor", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1loopBody1Catch1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getHotRangeMetricsActor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< GetHotRangeMetricsActorActor, 0, ErrorOr >*,Error err) { - fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("getHotRangeMetricsActor", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1Catch1(err, 0); } @@ -53616,49 +67657,42 @@ class WaitPurgeGranulesCompleteActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), 3); + fdb_probe_actor_exit("getHotRangeMetricsActor", reinterpret_cast(this), 0); } - #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" Reference db; - #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Key purgeKey; - #line 9536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Database cx; - #line 9537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Reference tr; - #line 9553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - Future watchFuture; - #line 53632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StorageServerInterface ssi; + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ReadHotSubRangeRequest req; + #line 67669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" }; -// This generated class is to be used only via waitPurgeGranulesCompleteActor() - #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -class WaitPurgeGranulesCompleteActorActor final : public Actor, public ActorCallback< WaitPurgeGranulesCompleteActorActor, 0, Optional >, public ActorCallback< WaitPurgeGranulesCompleteActorActor, 1, Void >, public ActorCallback< WaitPurgeGranulesCompleteActorActor, 2, Void >, public ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >, public FastAllocated, public WaitPurgeGranulesCompleteActorActorState { - #line 53637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via getHotRangeMetricsActor() + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetHotRangeMetricsActorActor final : public Actor>>, public ActorCallback< GetHotRangeMetricsActorActor, 0, ErrorOr >, public FastAllocated, public GetHotRangeMetricsActorActorState { + #line 67674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< WaitPurgeGranulesCompleteActorActor, 0, Optional >; -friend struct ActorCallback< WaitPurgeGranulesCompleteActorActor, 1, Void >; -friend struct ActorCallback< WaitPurgeGranulesCompleteActorActor, 2, Void >; -friend struct ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >; - #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - WaitPurgeGranulesCompleteActorActor(Reference const& db,Key const& purgeKey) - #line 53651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" - : Actor(), - WaitPurgeGranulesCompleteActorActorState(db, purgeKey) +friend struct ActorCallback< GetHotRangeMetricsActorActor, 0, ErrorOr >; + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetHotRangeMetricsActorActor(Reference const& db,StorageServerInterface const& ssi,ReadHotSubRangeRequest const& req) + #line 67685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>>(), + GetHotRangeMetricsActorActorState(db, ssi, req) { - fdb_probe_actor_enter("waitPurgeGranulesCompleteActor", reinterpret_cast(this), -1); + fdb_probe_actor_enter("getHotRangeMetricsActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("waitPurgeGranulesCompleteActor"); + this->lineage.setActorName("getHotRangeMetricsActor"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("waitPurgeGranulesCompleteActor", reinterpret_cast(this), -1); + fdb_probe_actor_exit("getHotRangeMetricsActor", reinterpret_cast(this), -1); } void cancel() override @@ -53666,26 +67700,29 @@ friend struct ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< WaitPurgeGranulesCompleteActorActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< WaitPurgeGranulesCompleteActorActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< WaitPurgeGranulesCompleteActorActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< WaitPurgeGranulesCompleteActorActor, 3, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetHotRangeMetricsActorActor, 0, ErrorOr >*)0, actor_cancelled()); break; } } }; } - #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -[[nodiscard]] Future waitPurgeGranulesCompleteActor( Reference const& db, Key const& purgeKey ) { - #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" - return Future(new WaitPurgeGranulesCompleteActorActor(db, purgeKey)); - #line 53682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] static Future>> getHotRangeMetricsActor( Reference const& db, StorageServerInterface const& ssi, ReadHotSubRangeRequest const& req ) { + #line 11575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new GetHotRangeMetricsActorActor(db, ssi, req)); + #line 67713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" } -#line 9562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +#line 11588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" -Future DatabaseContext::waitPurgeGranulesComplete(Key purgeKey) { - return waitPurgeGranulesCompleteActor(Reference::addRef(this), purgeKey); +Future>> DatabaseContext::getHotRangeMetrics( + StorageServerInterface ssi, + const KeyRange& keys, + ReadHotSubRangeRequest::SplitType type, + int splitCount) { + + return getHotRangeMetricsActor( + Reference::addRef(this), ssi, ReadHotSubRangeRequest(keys, type, splitCount)); } int64_t getMaxKeySize(KeyRef const& key) { @@ -53697,7 +67734,7 @@ int64_t getMaxReadKeySize(KeyRef const& key) { } int64_t getMaxWriteKeySize(KeyRef const& key, bool hasRawAccess) { - int64_t tenantSize = hasRawAccess ? CLIENT_KNOBS->TENANT_PREFIX_SIZE_LIMIT : 0; + int64_t tenantSize = hasRawAccess ? TenantAPI::PREFIX_SIZE : 0; return key.startsWith(systemKeys.begin) ? CLIENT_KNOBS->SYSTEM_KEY_SIZE_LIMIT : CLIENT_KNOBS->KEY_SIZE_LIMIT + tenantSize; } @@ -53705,3 +67742,246 @@ int64_t getMaxWriteKeySize(KeyRef const& key, bool hasRawAccess) { int64_t getMaxClearKeySize(KeyRef const& key) { return getMaxKeySize(key); } + +namespace NativeAPI { + + #line 67748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +// This generated class is to be used only via getServerListAndProcessClasses() + #line 11619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +template + #line 11619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetServerListAndProcessClassesActorState { + #line 67754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + #line 11619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetServerListAndProcessClassesActorState(Transaction* const& tr) + #line 11619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + #line 11619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + : tr(tr), + #line 11621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + workers(getWorkers(tr)), + #line 11622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + serverList(tr->getRange(serverListKeys, CLIENT_KNOBS->TOO_MANY)) + #line 67765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + { + fdb_probe_actor_create("getServerListAndProcessClasses", reinterpret_cast(this)); + + } + ~GetServerListAndProcessClassesActorState() + { + fdb_probe_actor_destroy("getServerListAndProcessClasses", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 11623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + StrictFuture __when_expr_0 = success(workers) && success(serverList); + #line 11623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 67782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 11623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 67787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetServerListAndProcessClassesActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 11624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!serverList.get().more && serverList.get().size() < CLIENT_KNOBS->TOO_MANY); + #line 11626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::map>, ProcessData> id_data; + #line 11627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < workers.get().size();i++) { + #line 11628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + id_data[workers.get()[i].locality.processId()] = workers.get()[i]; + #line 67816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> results; + #line 11631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < serverList.get().size();i++) { + #line 11632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto ssi = decodeServerListValue(serverList.get()[i].value); + #line 11633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.emplace_back(ssi, id_data[ssi.locality.processId()].processClass); + #line 67826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetServerListAndProcessClassesActorState(); static_cast(this)->destroy(); return 0; } + #line 67830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(results); + this->~GetServerListAndProcessClassesActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 11624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + ASSERT(!serverList.get().more && serverList.get().size() < CLIENT_KNOBS->TOO_MANY); + #line 11626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::map>, ProcessData> id_data; + #line 11627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < workers.get().size();i++) { + #line 11628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + id_data[workers.get()[i].locality.processId()] = workers.get()[i]; + #line 67848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + std::vector> results; + #line 11631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + for(int i = 0;i < serverList.get().size();i++) { + #line 11632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + auto ssi = decodeServerListValue(serverList.get()[i].value); + #line 11633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + results.emplace_back(ssi, id_data[ssi.locality.processId()].processClass); + #line 67858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + } + #line 11636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~GetServerListAndProcessClassesActorState(); static_cast(this)->destroy(); return 0; } + #line 67862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(results); + this->~GetServerListAndProcessClassesActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetServerListAndProcessClassesActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetServerListAndProcessClassesActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getServerListAndProcessClasses", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getServerListAndProcessClasses", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetServerListAndProcessClassesActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getServerListAndProcessClasses", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getServerListAndProcessClasses", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetServerListAndProcessClassesActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getServerListAndProcessClasses", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getServerListAndProcessClasses", reinterpret_cast(this), 0); + + } + #line 11619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Transaction* tr; + #line 11621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future> workers; + #line 11622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + Future serverList; + #line 67939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +}; +// This generated class is to be used only via getServerListAndProcessClasses() + #line 11619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +class GetServerListAndProcessClassesActor final : public Actor>>, public ActorCallback< GetServerListAndProcessClassesActor, 0, Void >, public FastAllocated, public GetServerListAndProcessClassesActorState { + #line 67944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetServerListAndProcessClassesActor, 0, Void >; + #line 11619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + GetServerListAndProcessClassesActor(Transaction* const& tr) + #line 67955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" + : Actor>>(), + GetServerListAndProcessClassesActorState(tr) + { + fdb_probe_actor_enter("getServerListAndProcessClasses", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getServerListAndProcessClasses"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getServerListAndProcessClasses", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetServerListAndProcessClassesActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 11619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" +[[nodiscard]] Future>> getServerListAndProcessClasses( Transaction* const& tr ) { + #line 11619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + return Future>>(new GetServerListAndProcessClassesActor(tr)); + #line 67982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.cpp" +} + +#line 11638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.cpp" + +} // namespace NativeAPI diff --git a/src/fdbclient/ParallelStream.actor.cpp b/src/fdbclient/ParallelStream.actor.cpp index ffc1a12..a9c16e1 100644 --- a/src/fdbclient/ParallelStream.actor.cpp +++ b/src/fdbclient/ParallelStream.actor.cpp @@ -42,7 +42,7 @@ ACTOR static Future produce(ParallelStream: } ACTOR static Future consume(FutureStream stream, int expected) { - state int next; + state int next = 0; try { loop { ParallelStreamTest::TestValue value = waitNext(stream); diff --git a/src/fdbclient/ParallelStream.actor.g.cpp b/src/fdbclient/ParallelStream.actor.g.cpp index ea7843d..00a4ccb 100644 --- a/src/fdbclient/ParallelStream.actor.g.cpp +++ b/src/fdbclient/ParallelStream.actor.g.cpp @@ -350,7 +350,7 @@ class ConsumeActorState { #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.cpp" expected(expected), #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.cpp" - next() + next(0) #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.cpp" { fdb_probe_actor_create("consume", reinterpret_cast(this)); diff --git a/src/fdbclient/PaxosConfigTransaction.actor.cpp b/src/fdbclient/PaxosConfigTransaction.actor.cpp index d20ced3..e401f91 100644 --- a/src/fdbclient/PaxosConfigTransaction.actor.cpp +++ b/src/fdbclient/PaxosConfigTransaction.actor.cpp @@ -19,6 +19,7 @@ */ #include "fdbclient/DatabaseContext.h" +#include "fdbclient/MonitorLeader.h" #include "fdbclient/PaxosConfigTransaction.h" #include "flow/actorcompiler.h" // must be last include @@ -34,13 +35,16 @@ class CommitQuorum { Standalone> mutations; ConfigCommitAnnotation annotation; - ConfigTransactionCommitRequest getCommitRequest(ConfigGeneration generation) const { - return ConfigTransactionCommitRequest(generation, mutations, annotation); + ConfigTransactionCommitRequest getCommitRequest(ConfigGeneration generation, + CoordinatorsHash coordinatorsHash) const { + return ConfigTransactionCommitRequest(coordinatorsHash, generation, mutations, annotation); } void updateResult() { if (successful >= ctis.size() / 2 + 1 && result.canBeSet()) { - result.send(Void()); + // Calling send could delete this + auto local = this->result; + local.send(Void()); } else if (failed >= ctis.size() / 2 + 1 && result.canBeSet()) { // Rollforwards could cause a version that didn't have quorum to // commit, so send commit_unknown_result instead of commit_failed. @@ -62,14 +66,16 @@ class CommitQuorum { ACTOR static Future addRequestActor(CommitQuorum* self, ConfigGeneration generation, + CoordinatorsHash coordinatorsHash, ConfigTransactionInterface cti) { try { if (cti.hostname.present()) { - wait(timeoutError(retryGetReplyFromHostname( - self->getCommitRequest(generation), cti.hostname.get(), WLTOKEN_CONFIGTXN_COMMIT), + wait(timeoutError(retryGetReplyFromHostname(self->getCommitRequest(generation, coordinatorsHash), + cti.hostname.get(), + WLTOKEN_CONFIGTXN_COMMIT), CLIENT_KNOBS->COMMIT_QUORUM_TIMEOUT)); } else { - wait(timeoutError(cti.commit.getReply(self->getCommitRequest(generation)), + wait(timeoutError(cti.commit.getReply(self->getCommitRequest(generation, coordinatorsHash)), CLIENT_KNOBS->COMMIT_QUORUM_TIMEOUT)); } ++self->successful; @@ -109,11 +115,11 @@ class CommitQuorum { } void setTimestamp() { annotation.timestamp = now(); } size_t expectedSize() const { return annotation.expectedSize() + mutations.expectedSize(); } - Future commit(ConfigGeneration generation) { + Future commit(ConfigGeneration generation, CoordinatorsHash coordinatorsHash) { // Send commit message to all replicas, even those that did not return the used replica. // This way, slow replicas are kept up date. for (const auto& cti : ctis) { - actors.add(addRequestActor(this, generation, cti)); + actors.add(addRequestActor(this, generation, coordinatorsHash, cti)); } return result.getFuture(); } @@ -122,11 +128,13 @@ class CommitQuorum { class GetGenerationQuorum { ActorCollection actors{ false }; + CoordinatorsHash coordinatorsHash{ 0 }; std::vector ctis; std::map> seenGenerations; Promise result; size_t totalRepliesReceived{ 0 }; size_t maxAgreement{ 0 }; + Future coordinatorsChangedFuture; Optional lastSeenLiveVersion; Future getGenerationFuture; @@ -137,14 +145,15 @@ class GetGenerationQuorum { if (cti.hostname.present()) { wait(timeoutError(store(reply, retryGetReplyFromHostname( - ConfigTransactionGetGenerationRequest{ self->lastSeenLiveVersion }, + ConfigTransactionGetGenerationRequest{ self->coordinatorsHash, + self->lastSeenLiveVersion }, cti.hostname.get(), WLTOKEN_CONFIGTXN_GETGENERATION)), CLIENT_KNOBS->GET_GENERATION_QUORUM_TIMEOUT)); } else { wait(timeoutError(store(reply, - cti.getGeneration.getReply( - ConfigTransactionGetGenerationRequest{ self->lastSeenLiveVersion })), + cti.getGeneration.getReply(ConfigTransactionGetGenerationRequest{ + self->coordinatorsHash, self->lastSeenLiveVersion })), CLIENT_KNOBS->GET_GENERATION_QUORUM_TIMEOUT)); } @@ -155,6 +164,14 @@ class GetGenerationQuorum { auto& replicas = self->seenGenerations[gen]; replicas.push_back(cti); self->maxAgreement = std::max(replicas.size(), self->maxAgreement); + // TraceEvent("ConfigTransactionGotGenerationReply") + // .detail("From", cti.getGeneration.getEndpoint().getPrimaryAddress()) + // .detail("TotalRepliesReceived", self->totalRepliesReceived) + // .detail("ReplyGeneration", gen.toString()) + // .detail("Replicas", replicas.size()) + // .detail("Coordinators", self->ctis.size()) + // .detail("MaxAgreement", self->maxAgreement) + // .detail("LastSeenLiveVersion", self->lastSeenLiveVersion); if (replicas.size() >= self->ctis.size() / 2 + 1 && !self->result.isSet()) { self->result.send(gen); } else if (self->maxAgreement + (self->ctis.size() - self->totalRepliesReceived) < @@ -203,9 +220,23 @@ class GetGenerationQuorum { } } catch (Error& e) { if (e.code() == error_code_failed_to_reach_quorum) { - TEST(true); // Failed to reach quorum getting generation - wait(delayJittered( - std::clamp(0.005 * (1 << retries), 0.0, CLIENT_KNOBS->TIMEOUT_RETRY_UPPER_BOUND))); + CODE_PROBE(true, "Failed to reach quorum getting generation"); + if (self->coordinatorsChangedFuture.isReady()) { + throw coordinators_changed(); + } + if (deterministicRandom()->random01() < 0.95) { + // Add some random jitter to prevent clients from + // contending. + wait(delayJittered(std::clamp( + 0.006 * (1 << std::min(retries, 30)), 0.0, CLIENT_KNOBS->TIMEOUT_RETRY_UPPER_BOUND))); + } + if (deterministicRandom()->random01() < 0.05) { + // Randomly inject a delay of at least the generation + // reply timeout, to try to prevent contention between + // clients. + wait(delay(CLIENT_KNOBS->GET_GENERATION_QUORUM_TIMEOUT * + (deterministicRandom()->random01() + 1.0))); + } ++retries; self->actors.clear(false); self->seenGenerations.clear(); @@ -221,9 +252,12 @@ class GetGenerationQuorum { public: GetGenerationQuorum() = default; - explicit GetGenerationQuorum(std::vector const& ctis, + explicit GetGenerationQuorum(CoordinatorsHash coordinatorsHash, + std::vector const& ctis, + Future coordinatorsChangedFuture, Optional const& lastSeenLiveVersion = {}) - : ctis(ctis), lastSeenLiveVersion(lastSeenLiveVersion) {} + : coordinatorsHash(coordinatorsHash), ctis(ctis), coordinatorsChangedFuture(coordinatorsChangedFuture), + lastSeenLiveVersion(lastSeenLiveVersion) {} Future getGeneration() { if (!getGenerationFuture.isValid()) { getGenerationFuture = getGenerationActor(this); @@ -244,12 +278,14 @@ class GetGenerationQuorum { }; class PaxosConfigTransactionImpl { + CoordinatorsHash coordinatorsHash{ 0 }; std::vector ctis; GetGenerationQuorum getGenerationQuorum; CommitQuorum commitQuorum; int numRetries{ 0 }; Optional dID; Database cx; + Future watchClusterFileFuture; ACTOR static Future> get(PaxosConfigTransactionImpl* self, Key key) { state ConfigKey configKey = ConfigKey::decodeKey(key); @@ -267,18 +303,19 @@ class PaxosConfigTransactionImpl { } wait(waitForAll(fs)); state Reference configNodes(new ConfigTransactionInfo(readReplicas)); - ConfigTransactionGetReply reply = - wait(timeoutError(basicLoadBalance(configNodes, - &ConfigTransactionInterface::get, - ConfigTransactionGetRequest{ generation, configKey }), - CLIENT_KNOBS->GET_KNOB_TIMEOUT)); + ConfigTransactionGetReply reply = wait(timeoutError( + basicLoadBalance(configNodes, + &ConfigTransactionInterface::get, + ConfigTransactionGetRequest{ self->coordinatorsHash, generation, configKey }), + CLIENT_KNOBS->GET_KNOB_TIMEOUT)); if (reply.value.present()) { return reply.value.get().toValue(); } else { return Optional{}; } } catch (Error& e) { - if (e.code() != error_code_timed_out && e.code() != error_code_broken_promise) { + if (e.code() != error_code_timed_out && e.code() != error_code_broken_promise && + e.code() != error_code_coordinators_changed) { throw; } self->reset(); @@ -287,58 +324,87 @@ class PaxosConfigTransactionImpl { } ACTOR static Future getConfigClasses(PaxosConfigTransactionImpl* self) { - state ConfigGeneration generation = wait(self->getGenerationQuorum.getGeneration()); - state std::vector readReplicas = self->getGenerationQuorum.getReadReplicas(); - std::vector> fs; - for (ConfigTransactionInterface& readReplica : readReplicas) { - if (readReplica.hostname.present()) { - fs.push_back(tryInitializeRequestStream( - &readReplica.getClasses, readReplica.hostname.get(), WLTOKEN_CONFIGTXN_GETCLASSES)); + loop { + try { + state ConfigGeneration generation = wait(self->getGenerationQuorum.getGeneration()); + state std::vector readReplicas = + self->getGenerationQuorum.getReadReplicas(); + std::vector> fs; + for (ConfigTransactionInterface& readReplica : readReplicas) { + if (readReplica.hostname.present()) { + fs.push_back(tryInitializeRequestStream( + &readReplica.getClasses, readReplica.hostname.get(), WLTOKEN_CONFIGTXN_GETCLASSES)); + } + } + wait(waitForAll(fs)); + state Reference configNodes(new ConfigTransactionInfo(readReplicas)); + ConfigTransactionGetConfigClassesReply reply = wait( + basicLoadBalance(configNodes, + &ConfigTransactionInterface::getClasses, + ConfigTransactionGetConfigClassesRequest{ self->coordinatorsHash, generation })); + RangeResult result; + result.reserve(result.arena(), reply.configClasses.size()); + for (const auto& configClass : reply.configClasses) { + result.push_back_deep(result.arena(), KeyValueRef(configClass, ""_sr)); + } + return result; + } catch (Error& e) { + if (e.code() != error_code_coordinators_changed) { + throw; + } + self->reset(); } } - wait(waitForAll(fs)); - state Reference configNodes(new ConfigTransactionInfo(readReplicas)); - ConfigTransactionGetConfigClassesReply reply = - wait(basicLoadBalance(configNodes, - &ConfigTransactionInterface::getClasses, - ConfigTransactionGetConfigClassesRequest{ generation })); - RangeResult result; - result.reserve(result.arena(), reply.configClasses.size()); - for (const auto& configClass : reply.configClasses) { - result.push_back_deep(result.arena(), KeyValueRef(configClass, ""_sr)); - } - return result; } ACTOR static Future getKnobs(PaxosConfigTransactionImpl* self, Optional configClass) { - state ConfigGeneration generation = wait(self->getGenerationQuorum.getGeneration()); - state std::vector readReplicas = self->getGenerationQuorum.getReadReplicas(); - std::vector> fs; - for (ConfigTransactionInterface& readReplica : readReplicas) { - if (readReplica.hostname.present()) { - fs.push_back(tryInitializeRequestStream( - &readReplica.getKnobs, readReplica.hostname.get(), WLTOKEN_CONFIGTXN_GETKNOBS)); + loop { + try { + state ConfigGeneration generation = wait(self->getGenerationQuorum.getGeneration()); + state std::vector readReplicas = + self->getGenerationQuorum.getReadReplicas(); + std::vector> fs; + for (ConfigTransactionInterface& readReplica : readReplicas) { + if (readReplica.hostname.present()) { + fs.push_back(tryInitializeRequestStream( + &readReplica.getKnobs, readReplica.hostname.get(), WLTOKEN_CONFIGTXN_GETKNOBS)); + } + } + wait(waitForAll(fs)); + state Reference configNodes(new ConfigTransactionInfo(readReplicas)); + ConfigTransactionGetKnobsReply reply = wait(basicLoadBalance( + configNodes, + &ConfigTransactionInterface::getKnobs, + ConfigTransactionGetKnobsRequest{ self->coordinatorsHash, generation, configClass })); + RangeResult result; + result.reserve(result.arena(), reply.knobNames.size()); + for (const auto& knobName : reply.knobNames) { + result.push_back_deep(result.arena(), KeyValueRef(knobName, ""_sr)); + } + return result; + } catch (Error& e) { + if (e.code() != error_code_coordinators_changed) { + throw; + } + self->reset(); } } - wait(waitForAll(fs)); - state Reference configNodes(new ConfigTransactionInfo(readReplicas)); - ConfigTransactionGetKnobsReply reply = - wait(basicLoadBalance(configNodes, - &ConfigTransactionInterface::getKnobs, - ConfigTransactionGetKnobsRequest{ generation, configClass })); - RangeResult result; - result.reserve(result.arena(), reply.knobNames.size()); - for (const auto& knobName : reply.knobNames) { - result.push_back_deep(result.arena(), KeyValueRef(knobName, ""_sr)); - } - return result; } ACTOR static Future commit(PaxosConfigTransactionImpl* self) { - ConfigGeneration generation = wait(self->getGenerationQuorum.getGeneration()); - self->commitQuorum.setTimestamp(); - wait(self->commitQuorum.commit(generation)); - return Void(); + loop { + try { + ConfigGeneration generation = wait(self->getGenerationQuorum.getGeneration()); + self->commitQuorum.setTimestamp(); + wait(self->commitQuorum.commit(generation, self->coordinatorsHash)); + return Void(); + } catch (Error& e) { + if (e.code() != error_code_coordinators_changed) { + throw; + } + self->reset(); + } + } } ACTOR static Future onError(PaxosConfigTransactionImpl* self, Error e) { @@ -354,6 +420,20 @@ class PaxosConfigTransactionImpl { throw e; } + // Returns when the cluster interface updates with a new connection string. + ACTOR static Future watchClusterFile(Database cx) { + state Future leaderMonitor = + monitorLeader(cx->getConnectionRecord(), cx->statusClusterInterface); + state std::string connectionString = cx->getConnectionRecord()->getConnectionString().toString(); + + loop { + wait(cx->statusClusterInterface->onChange()); + if (cx->getConnectionRecord()->getConnectionString().toString() != connectionString) { + return Void(); + } + } + } + public: Future getReadVersion() { return map(getGenerationQuorum.getGeneration(), [](auto const& gen) { return gen.committedVersion; }); @@ -399,7 +479,25 @@ class PaxosConfigTransactionImpl { void debugTransaction(UID dID) { this->dID = dID; } void reset() { - getGenerationQuorum = GetGenerationQuorum{ ctis }; + ctis.clear(); + // Re-read connection string. If the cluster file changed, this will + // return the updated value. + const ClusterConnectionString& cs = cx->getConnectionRecord()->getConnectionString(); + ctis.reserve(cs.hostnames.size() + cs.coords.size()); + for (const auto& h : cs.hostnames) { + ctis.emplace_back(h); + } + for (const auto& c : cs.coords) { + ctis.emplace_back(c); + } + coordinatorsHash = std::hash()(cx->getConnectionRecord()->getConnectionString().toString()); + if (!cx->statusLeaderMon.isValid() || cx->statusLeaderMon.isReady()) { + cx->statusClusterInterface = makeReference>>(); + cx->statusLeaderMon = watchClusterFile(cx); + } + getGenerationQuorum = GetGenerationQuorum{ + coordinatorsHash, ctis, cx->statusLeaderMon, getGenerationQuorum.getLastSeenLiveVersion() + }; commitQuorum = CommitQuorum{ ctis }; } @@ -420,21 +518,10 @@ class PaxosConfigTransactionImpl { Future commit() { return commit(this); } - PaxosConfigTransactionImpl(Database const& cx) : cx(cx) { - const ClusterConnectionString& cs = cx->getConnectionRecord()->getConnectionString(); - ctis.reserve(cs.hostnames.size() + cs.coords.size()); - for (const auto& h : cs.hostnames) { - ctis.emplace_back(h); - } - for (const auto& c : cs.coords) { - ctis.emplace_back(c); - } - getGenerationQuorum = GetGenerationQuorum{ ctis }; - commitQuorum = CommitQuorum{ ctis }; - } + PaxosConfigTransactionImpl(Database const& cx) : cx(cx) { reset(); } PaxosConfigTransactionImpl(std::vector const& ctis) - : ctis(ctis), getGenerationQuorum(ctis), commitQuorum(ctis) {} + : ctis(ctis), getGenerationQuorum(0, ctis, Future()), commitQuorum(ctis) {} }; Future PaxosConfigTransaction::getReadVersion() { @@ -487,6 +574,14 @@ Version PaxosConfigTransaction::getCommittedVersion() const { return impl->getCommittedVersion(); } +double PaxosConfigTransaction::getTagThrottledDuration() const { + return 0.0; +} + +int64_t PaxosConfigTransaction::getTotalCost() const { + return 0; +} + int64_t PaxosConfigTransaction::getApproximateSize() const { return impl->getApproximateSize(); } diff --git a/src/fdbclient/PaxosConfigTransaction.actor.g.cpp b/src/fdbclient/PaxosConfigTransaction.actor.g.cpp index 2f4e67f..3d926cf 100644 --- a/src/fdbclient/PaxosConfigTransaction.actor.g.cpp +++ b/src/fdbclient/PaxosConfigTransaction.actor.g.cpp @@ -21,6 +21,7 @@ */ #include "fdbclient/DatabaseContext.h" +#include "fdbclient/MonitorLeader.h" #include "fdbclient/PaxosConfigTransaction.h" #include "flow/actorcompiler.h" // must be last include @@ -36,13 +37,16 @@ class CommitQuorum { Standalone> mutations; ConfigCommitAnnotation annotation; - ConfigTransactionCommitRequest getCommitRequest(ConfigGeneration generation) const { - return ConfigTransactionCommitRequest(generation, mutations, annotation); + ConfigTransactionCommitRequest getCommitRequest(ConfigGeneration generation, + CoordinatorsHash coordinatorsHash) const { + return ConfigTransactionCommitRequest(coordinatorsHash, generation, mutations, annotation); } void updateResult() { if (successful >= ctis.size() / 2 + 1 && result.canBeSet()) { - result.send(Void()); + // Calling send could delete this + auto local = this->result; + local.send(Void()); } else if (failed >= ctis.size() / 2 + 1 && result.canBeSet()) { // Rollforwards could cause a version that didn't have quorum to // commit, so send commit_unknown_result instead of commit_failed. @@ -62,24 +66,26 @@ class CommitQuorum { } } - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" // This generated class is to be used only via addRequestActor() - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" template - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class AddRequestActorActorState { - #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - AddRequestActorActorState(CommitQuorum* const& self,ConfigGeneration const& generation,ConfigTransactionInterface const& cti) - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + AddRequestActorActorState(CommitQuorum* const& self,ConfigGeneration const& generation,CoordinatorsHash const& coordinatorsHash,ConfigTransactionInterface const& cti) + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" : self(self), - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" generation(generation), - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + coordinatorsHash(coordinatorsHash), + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" cti(cti) - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { fdb_probe_actor_create("addRequestActor", reinterpret_cast(this)); @@ -93,34 +99,34 @@ class AddRequestActorActorState { { try { try { - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (cti.hostname.present()) - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_0 = timeoutError(retryGetReplyFromHostname( self->getCommitRequest(generation), cti.hostname.get(), WLTOKEN_CONFIGTXN_COMMIT), CLIENT_KNOBS->COMMIT_QUORUM_TIMEOUT); - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_0 = timeoutError(retryGetReplyFromHostname(self->getCommitRequest(generation, coordinatorsHash), cti.hostname.get(), WLTOKEN_CONFIGTXN_COMMIT), CLIENT_KNOBS->COMMIT_QUORUM_TIMEOUT); + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; } else { - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_1 = timeoutError(cti.commit.getReply(self->getCommitRequest(generation)), CLIENT_KNOBS->COMMIT_QUORUM_TIMEOUT); - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_1 = timeoutError(cti.commit.getReply(self->getCommitRequest(generation, coordinatorsHash)), CLIENT_KNOBS->COMMIT_QUORUM_TIMEOUT); + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; } } @@ -148,11 +154,11 @@ class AddRequestActorActorState { } int a_body1cont1(int loopDepth) { - #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" self->updateResult(); - #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AddRequestActorActorState(); static_cast(this)->destroy(); return 0; } - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AddRequestActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -163,27 +169,27 @@ class AddRequestActorActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (e.code() == error_code_actor_cancelled) - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (e.code() == error_code_not_committed || e.code() == error_code_timed_out) - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ++self->failed; - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } else { - #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ++self->maybeCommitted; - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } loopDepth = a_body1cont1(loopDepth); } @@ -197,9 +203,9 @@ class AddRequestActorActorState { } int a_body1cont2(int loopDepth) { - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ++self->successful; - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = a_body1cont6(loopDepth); return loopDepth; @@ -367,18 +373,20 @@ class AddRequestActorActorState { return loopDepth; } - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" CommitQuorum* self; - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ConfigGeneration generation; - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + CoordinatorsHash coordinatorsHash; + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ConfigTransactionInterface cti; - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" }; // This generated class is to be used only via addRequestActor() - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class AddRequestActorActor final : public Actor, public ActorCallback< AddRequestActorActor, 0, Void >, public ActorCallback< AddRequestActorActor, 1, Void >, public FastAllocated, public AddRequestActorActorState { - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -388,11 +396,11 @@ class AddRequestActorActor final : public Actor, public ActorCallback< Add #pragma clang diagnostic pop friend struct ActorCallback< AddRequestActorActor, 0, Void >; friend struct ActorCallback< AddRequestActorActor, 1, Void >; - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - AddRequestActorActor(CommitQuorum* const& self,ConfigGeneration const& generation,ConfigTransactionInterface const& cti) - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + AddRequestActorActor(CommitQuorum* const& self,ConfigGeneration const& generation,CoordinatorsHash const& coordinatorsHash,ConfigTransactionInterface const& cti) + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" : Actor(), - AddRequestActorActorState(self, generation, cti) + AddRequestActorActorState(self, generation, coordinatorsHash, cti) { fdb_probe_actor_enter("addRequestActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -414,14 +422,14 @@ friend struct ActorCallback< AddRequestActorActor, 1, Void >; } }; - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" -[[nodiscard]] static Future addRequestActor( CommitQuorum* const& self, ConfigGeneration const& generation, ConfigTransactionInterface const& cti ) { - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - return Future(new AddRequestActorActor(self, generation, cti)); - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +[[nodiscard]] static Future addRequestActor( CommitQuorum* const& self, ConfigGeneration const& generation, CoordinatorsHash const& coordinatorsHash, ConfigTransactionInterface const& cti ) { + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + return Future(new AddRequestActorActor(self, generation, coordinatorsHash, cti)); + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } -#line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +#line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" public: CommitQuorum() = default; @@ -443,11 +451,11 @@ friend struct ActorCallback< AddRequestActorActor, 1, Void >; } void setTimestamp() { annotation.timestamp = now(); } size_t expectedSize() const { return annotation.expectedSize() + mutations.expectedSize(); } - Future commit(ConfigGeneration generation) { + Future commit(ConfigGeneration generation, CoordinatorsHash coordinatorsHash) { // Send commit message to all replicas, even those that did not return the used replica. // This way, slow replicas are kept up date. for (const auto& cti : ctis) { - actors.add(addRequestActor(this, generation, cti)); + actors.add(addRequestActor(this, generation, coordinatorsHash, cti)); } return result.getFuture(); } @@ -456,30 +464,32 @@ friend struct ActorCallback< AddRequestActorActor, 1, Void >; class GetGenerationQuorum { ActorCollection actors{ false }; + CoordinatorsHash coordinatorsHash{ 0 }; std::vector ctis; std::map> seenGenerations; Promise result; size_t totalRepliesReceived{ 0 }; size_t maxAgreement{ 0 }; + Future coordinatorsChangedFuture; Optional lastSeenLiveVersion; Future getGenerationFuture; - #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" // This generated class is to be used only via addRequestActor() - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" template - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class AddRequestActorActor1State { - #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" AddRequestActorActor1State(GetGenerationQuorum* const& self,ConfigTransactionInterface const& cti) - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" : self(self), - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" cti(cti) - #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { fdb_probe_actor_create("addRequestActor", reinterpret_cast(this)); @@ -492,9 +502,9 @@ class AddRequestActorActor1State { int a_body1(int loopDepth=0) { try { - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ; - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -515,9 +525,9 @@ class AddRequestActorActor1State { } int a_body1cont1(int loopDepth) { - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AddRequestActorActor1State(); static_cast(this)->destroy(); return 0; } - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AddRequestActorActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -535,36 +545,36 @@ class AddRequestActorActor1State { int a_body1loopBody1(int loopDepth) { try { - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" reply = ConfigTransactionGetGenerationReply(); - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (cti.hostname.present()) - #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_0 = timeoutError(store(reply, retryGetReplyFromHostname( ConfigTransactionGetGenerationRequest{ self->lastSeenLiveVersion }, cti.hostname.get(), WLTOKEN_CONFIGTXN_GETGENERATION)), CLIENT_KNOBS->GET_GENERATION_QUORUM_TIMEOUT); - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_0 = timeoutError(store(reply, retryGetReplyFromHostname( ConfigTransactionGetGenerationRequest{ self->coordinatorsHash, self->lastSeenLiveVersion }, cti.hostname.get(), WLTOKEN_CONFIGTXN_GETGENERATION)), CLIENT_KNOBS->GET_GENERATION_QUORUM_TIMEOUT); + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; } else { - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_1 = timeoutError(store(reply, cti.getGeneration.getReply( ConfigTransactionGetGenerationRequest{ self->lastSeenLiveVersion })), CLIENT_KNOBS->GET_GENERATION_QUORUM_TIMEOUT); - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_1 = timeoutError(store(reply, cti.getGeneration.getReply(ConfigTransactionGetGenerationRequest{ self->coordinatorsHash, self->lastSeenLiveVersion })), CLIENT_KNOBS->GET_GENERATION_QUORUM_TIMEOUT); + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; } } @@ -592,37 +602,37 @@ class AddRequestActorActor1State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (e.code() == error_code_broken_promise) - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { return a_body1loopHead1(loopDepth); // continue } else { - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (e.code() == error_code_timed_out) - #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ++self->totalRepliesReceived; - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (self->totalRepliesReceived == self->ctis.size() && self->result.canBeSet() && !self->result.isError()) - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" auto local = self->result; - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" local.sendError(failed_to_reach_quorum()); - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } return a_body1break1(loopDepth==0?0:loopDepth-1); // break } else { - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } } } @@ -636,41 +646,41 @@ class AddRequestActorActor1State { } int a_body1loopBody1cont2(int loopDepth) { - #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ++self->totalRepliesReceived; - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" auto gen = reply.generation; - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" self->lastSeenLiveVersion = std::max(gen.liveVersion, self->lastSeenLiveVersion.orDefault(::invalidVersion)); - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" auto& replicas = self->seenGenerations[gen]; - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" replicas.push_back(cti); - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" self->maxAgreement = std::max(replicas.size(), self->maxAgreement); - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (replicas.size() >= self->ctis.size() / 2 + 1 && !self->result.isSet()) - #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" self->result.send(gen); - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } else { - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (self->maxAgreement + (self->ctis.size() - self->totalRepliesReceived) < (self->ctis.size() / 2 + 1)) - #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!self->result.isError()) - #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" auto local = self->result; - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" local.sendError(failed_to_reach_quorum()); - #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } } } @@ -828,18 +838,18 @@ class AddRequestActorActor1State { fdb_probe_actor_exit("addRequestActor", reinterpret_cast(this), 1); } - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" GetGenerationQuorum* self; - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ConfigTransactionInterface cti; - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ConfigTransactionGetGenerationReply reply; - #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" }; // This generated class is to be used only via addRequestActor() - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class AddRequestActorActor1 final : public Actor, public ActorCallback< AddRequestActorActor1, 0, Void >, public ActorCallback< AddRequestActorActor1, 1, Void >, public FastAllocated, public AddRequestActorActor1State { - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -849,9 +859,9 @@ class AddRequestActorActor1 final : public Actor, public ActorCallback< Ad #pragma clang diagnostic pop friend struct ActorCallback< AddRequestActorActor1, 0, Void >; friend struct ActorCallback< AddRequestActorActor1, 1, Void >; - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" AddRequestActorActor1(GetGenerationQuorum* const& self,ConfigTransactionInterface const& cti) - #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" : Actor(), AddRequestActorActor1State(self, cti) { @@ -875,31 +885,31 @@ friend struct ActorCallback< AddRequestActorActor1, 1, Void >; } }; - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" [[nodiscard]] static Future addRequestActor( GetGenerationQuorum* const& self, ConfigTransactionInterface const& cti ) { - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" return Future(new AddRequestActorActor1(self, cti)); - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } -#line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +#line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" // This generated class is to be used only via getGenerationActor() - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" template - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class GetGenerationActorActorState { - #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" GetGenerationActorActorState(GetGenerationQuorum* const& self) - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" : self(self), - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" retries(0) - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { fdb_probe_actor_create("getGenerationActor", reinterpret_cast(this)); @@ -912,9 +922,9 @@ class GetGenerationActorActorState { int a_body1(int loopDepth=0) { try { - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ; - #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -942,29 +952,29 @@ class GetGenerationActorActorState { } int a_body1loopBody1(int loopDepth) { - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" for( const auto& cti : self->ctis ) { - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" self->actors.add(addRequestActor(self, cti)); - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } try { - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" StrictFuture __when_expr_0 = self->result.getFuture(); - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" StrictFuture __when_expr_1 = self->actors.getResult(); - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -984,29 +994,46 @@ class GetGenerationActorActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (e.code() == error_code_failed_to_reach_quorum) - #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - TEST(true); - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_2 = delayJittered( std::clamp(0.005 * (1 << retries), 0.0, CLIENT_KNOBS->TIMEOUT_RETRY_UPPER_BOUND)); - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - loopDepth = 0; + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + CODE_PROBE(true, "Failed to reach quorum getting generation"); + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (self->coordinatorsChangedFuture.isReady()) + #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + { + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + return a_body1Catch1(coordinators_changed(), std::max(0, loopDepth - 1)); + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + } + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (deterministicRandom()->random01() < 0.95) + #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + { + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_2 = delayJittered(std::clamp( 0.006 * (1 << std::min(retries, 30)), 0.0, CLIENT_KNOBS->TIMEOUT_RETRY_UPPER_BOUND)); + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1Catch1cont2(loopDepth); + } } else { - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } } catch (Error& error) { @@ -1025,9 +1052,9 @@ class GetGenerationActorActorState { } int a_body1loopBody1when1(ConfigGeneration const& generation,int loopDepth) { - #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(generation); this->~GetGenerationActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< ConfigGeneration >::value()) ConfigGeneration(generation); this->~GetGenerationActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1037,9 +1064,9 @@ class GetGenerationActorActorState { } int a_body1loopBody1when1(ConfigGeneration && generation,int loopDepth) { - #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(generation); this->~GetGenerationActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< ConfigGeneration >::value()) ConfigGeneration(generation); this->~GetGenerationActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1049,18 +1076,18 @@ class GetGenerationActorActorState { } int a_body1loopBody1when2(Void const& _,int loopDepth) { - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ASSERT(false); - #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; } int a_body1loopBody1when2(Void && _,int loopDepth) { - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ASSERT(false); - #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = a_body1loopBody1cont3(loopDepth); return loopDepth; @@ -1181,53 +1208,52 @@ class GetGenerationActorActorState { return loopDepth; } - int a_body1loopBody1Catch1cont2(Void const& _,int loopDepth) + int a_body1loopBody1Catch1cont2(int loopDepth) { - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - ++retries; - #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - self->actors.clear(false); - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - self->seenGenerations.clear(); - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - self->result.reset(); - #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - self->totalRepliesReceived = 0; - #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - self->maxAgreement = 0; - #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (deterministicRandom()->random01() < 0.05) + #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + { + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_3 = delay(CLIENT_KNOBS->GET_GENERATION_QUORUM_TIMEOUT * (deterministicRandom()->random01() + 1.0)); + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1cont2when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1Catch1cont5(loopDepth); + } return loopDepth; } - int a_body1loopBody1Catch1cont2(Void && _,int loopDepth) + int a_body1loopBody1Catch1cont4(Void const& _,int loopDepth) { - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - ++retries; - #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - self->actors.clear(false); - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - self->seenGenerations.clear(); - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - self->result.reset(); - #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - self->totalRepliesReceived = 0; - #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - self->maxAgreement = 0; - #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + loopDepth = a_body1loopBody1Catch1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont4(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont2(loopDepth); return loopDepth; } int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont2(_, loopDepth); + loopDepth = a_body1loopBody1Catch1cont4(_, loopDepth); return loopDepth; } int a_body1loopBody1Catch1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1Catch1cont2(std::move(_), loopDepth); + loopDepth = a_body1loopBody1Catch1cont4(std::move(_), loopDepth); return loopDepth; } @@ -1282,16 +1308,110 @@ class GetGenerationActorActorState { fdb_probe_actor_exit("getGenerationActor", reinterpret_cast(this), 2); } - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + int a_body1loopBody1Catch1cont5(int loopDepth) + { + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + ++retries; + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + self->actors.clear(false); + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + self->seenGenerations.clear(); + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + self->result.reset(); + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + self->totalRepliesReceived = 0; + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + self->maxAgreement = 0; + #line 1325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont6(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont5(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont6(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont5(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont6(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont6(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetGenerationActorActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetGenerationActorActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("getGenerationActor", reinterpret_cast(this), 3); + a_exitChoose3(); + try { + a_body1loopBody1Catch1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getGenerationActor", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< GetGenerationActorActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("getGenerationActor", reinterpret_cast(this), 3); + a_exitChoose3(); + try { + a_body1loopBody1Catch1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getGenerationActor", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< GetGenerationActorActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("getGenerationActor", reinterpret_cast(this), 3); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getGenerationActor", reinterpret_cast(this), 3); + + } + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" GetGenerationQuorum* self; - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" int retries; - #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" }; // This generated class is to be used only via getGenerationActor() - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" -class GetGenerationActorActor final : public Actor, public ActorCallback< GetGenerationActorActor, 0, ConfigGeneration >, public ActorCallback< GetGenerationActorActor, 1, Void >, public ActorCallback< GetGenerationActorActor, 2, Void >, public FastAllocated, public GetGenerationActorActorState { - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +class GetGenerationActorActor final : public Actor, public ActorCallback< GetGenerationActorActor, 0, ConfigGeneration >, public ActorCallback< GetGenerationActorActor, 1, Void >, public ActorCallback< GetGenerationActorActor, 2, Void >, public ActorCallback< GetGenerationActorActor, 3, Void >, public FastAllocated, public GetGenerationActorActorState { + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1302,9 +1422,10 @@ class GetGenerationActorActor final : public Actor, public Act friend struct ActorCallback< GetGenerationActorActor, 0, ConfigGeneration >; friend struct ActorCallback< GetGenerationActorActor, 1, Void >; friend struct ActorCallback< GetGenerationActorActor, 2, Void >; - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +friend struct ActorCallback< GetGenerationActorActor, 3, Void >; + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" GetGenerationActorActor(GetGenerationQuorum* const& self) - #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" : Actor(), GetGenerationActorActorState(self) { @@ -1324,24 +1445,28 @@ friend struct ActorCallback< GetGenerationActorActor, 2, Void >; switch (wait_state) { case 1: this->a_callback_error((ActorCallback< GetGenerationActorActor, 0, ConfigGeneration >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< GetGenerationActorActor, 2, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetGenerationActorActor, 3, Void >*)0, actor_cancelled()); break; } } }; - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" [[nodiscard]] static Future getGenerationActor( GetGenerationQuorum* const& self ) { - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" return Future(new GetGenerationActorActor(self)); - #line 1335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } -#line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +#line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" public: GetGenerationQuorum() = default; - explicit GetGenerationQuorum(std::vector const& ctis, + explicit GetGenerationQuorum(CoordinatorsHash coordinatorsHash, + std::vector const& ctis, + Future coordinatorsChangedFuture, Optional const& lastSeenLiveVersion = {}) - : ctis(ctis), lastSeenLiveVersion(lastSeenLiveVersion) {} + : coordinatorsHash(coordinatorsHash), ctis(ctis), coordinatorsChangedFuture(coordinatorsChangedFuture), + lastSeenLiveVersion(lastSeenLiveVersion) {} Future getGeneration() { if (!getGenerationFuture.isValid()) { getGenerationFuture = getGenerationActor(this); @@ -1362,31 +1487,33 @@ friend struct ActorCallback< GetGenerationActorActor, 2, Void >; }; class PaxosConfigTransactionImpl { + CoordinatorsHash coordinatorsHash{ 0 }; std::vector ctis; GetGenerationQuorum getGenerationQuorum; CommitQuorum commitQuorum; int numRetries{ 0 }; Optional dID; Database cx; + Future watchClusterFileFuture; - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" // This generated class is to be used only via get() - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" template - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class GetActorState { - #line 1378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" GetActorState(PaxosConfigTransactionImpl* const& self,Key const& key) - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" : self(self), - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" key(key), - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" configKey(ConfigKey::decodeKey(key)) - #line 1389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { fdb_probe_actor_create("get", reinterpret_cast(this)); @@ -1399,9 +1526,9 @@ class GetActorState { int a_body1(int loopDepth=0) { try { - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ; - #line 1404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1430,16 +1557,16 @@ class GetActorState { int a_body1loopBody1(int loopDepth) { try { - #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" StrictFuture __when_expr_0 = self->getGenerationQuorum.getGeneration(); - #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1459,17 +1586,17 @@ class GetActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - if (e.code() != error_code_timed_out && e.code() != error_code_broken_promise) - #line 1464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (e.code() != error_code_timed_out && e.code() != error_code_broken_promise && e.code() != error_code_coordinators_changed) + #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } - #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" self->reset(); - #line 1472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); } catch (Error& error) { @@ -1482,40 +1609,40 @@ class GetActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" readReplicas = self->getGenerationQuorum.getReadReplicas(); - #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" std::vector> fs; - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" for( ConfigTransactionInterface& readReplica : readReplicas ) { - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (readReplica.hostname.present()) - #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" fs.push_back(tryInitializeRequestStream( &readReplica.get, readReplica.hostname.get(), WLTOKEN_CONFIGTXN_GET)); - #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } } - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" StrictFuture __when_expr_1 = waitForAll(fs); - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1when1(ConfigGeneration const& __generation,int loopDepth) { - #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" generation = __generation; - #line 1518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; @@ -1580,36 +1707,36 @@ class GetActorState { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" configNodes = Reference(new ConfigTransactionInfo(readReplicas)); - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_2 = timeoutError(basicLoadBalance(configNodes, &ConfigTransactionInterface::get, ConfigTransactionGetRequest{ generation, configKey }), CLIENT_KNOBS->GET_KNOB_TIMEOUT); - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_2 = timeoutError( basicLoadBalance(configNodes, &ConfigTransactionInterface::get, ConfigTransactionGetRequest{ self->coordinatorsHash, generation, configKey }), CLIENT_KNOBS->GET_KNOB_TIMEOUT); + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" configNodes = Reference(new ConfigTransactionInfo(readReplicas)); - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_2 = timeoutError(basicLoadBalance(configNodes, &ConfigTransactionInterface::get, ConfigTransactionGetRequest{ generation, configKey }), CLIENT_KNOBS->GET_KNOB_TIMEOUT); - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_2 = timeoutError( basicLoadBalance(configNodes, &ConfigTransactionInterface::get, ConfigTransactionGetRequest{ self->coordinatorsHash, generation, configKey }), CLIENT_KNOBS->GET_KNOB_TIMEOUT); + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1679,13 +1806,13 @@ class GetActorState { } int a_body1loopBody1cont6(ConfigTransactionGetReply const& reply,int loopDepth) { - #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (reply.value.present()) - #line 1684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(reply.value.get().toValue()); this->~GetActorState(); static_cast(this)->destroy(); return 0; } - #line 1688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(reply.value.get().toValue()); this->~GetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1693,9 +1820,9 @@ class GetActorState { } else { - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional{}); this->~GetActorState(); static_cast(this)->destroy(); return 0; } - #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional{}); this->~GetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1706,13 +1833,13 @@ class GetActorState { } int a_body1loopBody1cont6(ConfigTransactionGetReply && reply,int loopDepth) { - #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (reply.value.present()) - #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(reply.value.get().toValue()); this->~GetActorState(); static_cast(this)->destroy(); return 0; } - #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(reply.value.get().toValue()); this->~GetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1720,9 +1847,9 @@ class GetActorState { } else { - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional{}); this->~GetActorState(); static_cast(this)->destroy(); return 0; } - #line 1725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional{}); this->~GetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1794,24 +1921,24 @@ class GetActorState { fdb_probe_actor_exit("get", reinterpret_cast(this), 2); } - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" PaxosConfigTransactionImpl* self; - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" Key key; - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ConfigKey configKey; - #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ConfigGeneration generation; - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" std::vector readReplicas; - #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" Reference configNodes; - #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" }; // This generated class is to be used only via get() - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class GetActor final : public Actor>, public ActorCallback< GetActor, 0, ConfigGeneration >, public ActorCallback< GetActor, 1, Void >, public ActorCallback< GetActor, 2, ConfigTransactionGetReply >, public FastAllocated, public GetActorState { - #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1822,9 +1949,9 @@ class GetActor final : public Actor>, public ActorCallback< GetA friend struct ActorCallback< GetActor, 0, ConfigGeneration >; friend struct ActorCallback< GetActor, 1, Void >; friend struct ActorCallback< GetActor, 2, ConfigTransactionGetReply >; - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" GetActor(PaxosConfigTransactionImpl* const& self,Key const& key) - #line 1827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" : Actor>(), GetActorState(self, key) { @@ -1849,29 +1976,29 @@ friend struct ActorCallback< GetActor, 2, ConfigTransactionGetReply >; } }; - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" [[nodiscard]] static Future> get( PaxosConfigTransactionImpl* const& self, Key const& key ) { - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" return Future>(new GetActor(self, key)); - #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } -#line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +#line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - #line 1861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" // This generated class is to be used only via getConfigClasses() - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" template - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class GetConfigClassesActorState { - #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 1994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" GetConfigClassesActorState(PaxosConfigTransactionImpl* const& self) - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" : self(self) - #line 1874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { fdb_probe_actor_create("getConfigClasses", reinterpret_cast(this)); @@ -1884,17 +2011,10 @@ class GetConfigClassesActorState { int a_body1(int loopDepth=0) { try { - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_0 = self->getGenerationQuorum.getGeneration(); - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - loopDepth = 0; + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + ; + #line 2016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -1912,50 +2032,110 @@ class GetConfigClassesActorState { return loopDepth; } - int a_body1cont1(int loopDepth) + int a_body1loopHead1(int loopDepth) { - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - readReplicas = self->getGenerationQuorum.getReadReplicas(); - #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_0 = self->getGenerationQuorum.getGeneration(); + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (e.code() != error_code_coordinators_changed) + #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + { + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 2080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + } + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + self->reset(); + #line 2084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + readReplicas = self->getGenerationQuorum.getReadReplicas(); + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" std::vector> fs; - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" for( ConfigTransactionInterface& readReplica : readReplicas ) { - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (readReplica.hostname.present()) - #line 1925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" fs.push_back(tryInitializeRequestStream( &readReplica.getClasses, readReplica.hostname.get(), WLTOKEN_CONFIGTXN_GETCLASSES)); - #line 1929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } } - #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" StrictFuture __when_expr_1 = waitForAll(fs); - #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(ConfigGeneration const& __generation,int loopDepth) + int a_body1loopBody1when1(ConfigGeneration const& __generation,int loopDepth) { - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" generation = __generation; - #line 1950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); + #line 2130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } - int a_body1when1(ConfigGeneration && __generation,int loopDepth) + int a_body1loopBody1when1(ConfigGeneration && __generation,int loopDepth) { generation = std::move(__generation); - loopDepth = a_body1cont1(loopDepth); + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } @@ -1970,12 +2150,12 @@ class GetConfigClassesActorState { fdb_probe_actor_enter("getConfigClasses", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getConfigClasses", reinterpret_cast(this), 0); @@ -1985,12 +2165,12 @@ class GetConfigClassesActorState { fdb_probe_actor_enter("getConfigClasses", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getConfigClasses", reinterpret_cast(this), 0); @@ -2000,61 +2180,61 @@ class GetConfigClassesActorState { fdb_probe_actor_enter("getConfigClasses", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getConfigClasses", reinterpret_cast(this), 0); } - int a_body1cont2(Void const& _,int loopDepth) + int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" configNodes = Reference(new ConfigTransactionInfo(readReplicas)); - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_2 = basicLoadBalance(configNodes, &ConfigTransactionInterface::getClasses, ConfigTransactionGetConfigClassesRequest{ generation }); - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_2 = basicLoadBalance(configNodes, &ConfigTransactionInterface::getClasses, ConfigTransactionGetConfigClassesRequest{ self->coordinatorsHash, generation }); + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont2(Void && _,int loopDepth) + int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" configNodes = Reference(new ConfigTransactionInfo(readReplicas)); - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_2 = basicLoadBalance(configNodes, &ConfigTransactionInterface::getClasses, ConfigTransactionGetConfigClassesRequest{ generation }); - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_2 = basicLoadBalance(configNodes, &ConfigTransactionInterface::getClasses, ConfigTransactionGetConfigClassesRequest{ self->coordinatorsHash, generation }); + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + loopDepth = a_body1loopBody1cont3(_, loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); return loopDepth; } @@ -2069,12 +2249,12 @@ class GetConfigClassesActorState { fdb_probe_actor_enter("getConfigClasses", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(value, 0); + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getConfigClasses", reinterpret_cast(this), 1); @@ -2084,12 +2264,12 @@ class GetConfigClassesActorState { fdb_probe_actor_enter("getConfigClasses", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(std::move(value), 0); + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getConfigClasses", reinterpret_cast(this), 1); @@ -2099,31 +2279,31 @@ class GetConfigClassesActorState { fdb_probe_actor_enter("getConfigClasses", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getConfigClasses", reinterpret_cast(this), 1); } - int a_body1cont5(ConfigTransactionGetConfigClassesReply const& reply,int loopDepth) + int a_body1loopBody1cont6(ConfigTransactionGetConfigClassesReply const& reply,int loopDepth) { - #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" RangeResult result; - #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" result.reserve(result.arena(), reply.configClasses.size()); - #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" for( const auto& configClass : reply.configClasses ) { - #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(configClass, ""_sr)); - #line 2122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } - #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetConfigClassesActorState(); static_cast(this)->destroy(); return 0; } - #line 2126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetConfigClassesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2131,21 +2311,21 @@ class GetConfigClassesActorState { return loopDepth; } - int a_body1cont5(ConfigTransactionGetConfigClassesReply && reply,int loopDepth) + int a_body1loopBody1cont6(ConfigTransactionGetConfigClassesReply && reply,int loopDepth) { - #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" RangeResult result; - #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" result.reserve(result.arena(), reply.configClasses.size()); - #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" for( const auto& configClass : reply.configClasses ) { - #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(configClass, ""_sr)); - #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } - #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetConfigClassesActorState(); static_cast(this)->destroy(); return 0; } - #line 2148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetConfigClassesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2153,15 +2333,15 @@ class GetConfigClassesActorState { return loopDepth; } - int a_body1cont2when1(ConfigTransactionGetConfigClassesReply const& reply,int loopDepth) + int a_body1loopBody1cont3when1(ConfigTransactionGetConfigClassesReply const& reply,int loopDepth) { - loopDepth = a_body1cont5(reply, loopDepth); + loopDepth = a_body1loopBody1cont6(reply, loopDepth); return loopDepth; } - int a_body1cont2when1(ConfigTransactionGetConfigClassesReply && reply,int loopDepth) + int a_body1loopBody1cont3when1(ConfigTransactionGetConfigClassesReply && reply,int loopDepth) { - loopDepth = a_body1cont5(std::move(reply), loopDepth); + loopDepth = a_body1loopBody1cont6(std::move(reply), loopDepth); return loopDepth; } @@ -2176,12 +2356,12 @@ class GetConfigClassesActorState { fdb_probe_actor_enter("getConfigClasses", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2when1(value, 0); + a_body1loopBody1cont3when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getConfigClasses", reinterpret_cast(this), 2); @@ -2191,12 +2371,12 @@ class GetConfigClassesActorState { fdb_probe_actor_enter("getConfigClasses", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2when1(std::move(value), 0); + a_body1loopBody1cont3when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getConfigClasses", reinterpret_cast(this), 2); @@ -2206,30 +2386,30 @@ class GetConfigClassesActorState { fdb_probe_actor_enter("getConfigClasses", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getConfigClasses", reinterpret_cast(this), 2); } - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" PaxosConfigTransactionImpl* self; - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ConfigGeneration generation; - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" std::vector readReplicas; - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" Reference configNodes; - #line 2227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" }; // This generated class is to be used only via getConfigClasses() - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class GetConfigClassesActor final : public Actor, public ActorCallback< GetConfigClassesActor, 0, ConfigGeneration >, public ActorCallback< GetConfigClassesActor, 1, Void >, public ActorCallback< GetConfigClassesActor, 2, ConfigTransactionGetConfigClassesReply >, public FastAllocated, public GetConfigClassesActorState { - #line 2232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2240,9 +2420,9 @@ class GetConfigClassesActor final : public Actor, public ActorCallb friend struct ActorCallback< GetConfigClassesActor, 0, ConfigGeneration >; friend struct ActorCallback< GetConfigClassesActor, 1, Void >; friend struct ActorCallback< GetConfigClassesActor, 2, ConfigTransactionGetConfigClassesReply >; - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" GetConfigClassesActor(PaxosConfigTransactionImpl* const& self) - #line 2245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" : Actor(), GetConfigClassesActorState(self) { @@ -2267,31 +2447,31 @@ friend struct ActorCallback< GetConfigClassesActor, 2, ConfigTransactionGetConfi } }; - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" [[nodiscard]] static Future getConfigClasses( PaxosConfigTransactionImpl* const& self ) { - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" return Future(new GetConfigClassesActor(self)); - #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } -#line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +#line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - #line 2279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" // This generated class is to be used only via getKnobs() - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" template - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class GetKnobsActorState { - #line 2285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" GetKnobsActorState(PaxosConfigTransactionImpl* const& self,Optional const& configClass) - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" : self(self), - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" configClass(configClass) - #line 2294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { fdb_probe_actor_create("getKnobs", reinterpret_cast(this)); @@ -2304,17 +2484,10 @@ class GetKnobsActorState { int a_body1(int loopDepth=0) { try { - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_0 = self->getGenerationQuorum.getGeneration(); - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - loopDepth = 0; + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + ; + #line 2489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -2332,50 +2505,110 @@ class GetKnobsActorState { return loopDepth; } - int a_body1cont1(int loopDepth) + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_0 = self->getGenerationQuorum.getGeneration(); + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (e.code() != error_code_coordinators_changed) + #line 2549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + { + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 2553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + } + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + self->reset(); + #line 2557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) { - #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" readReplicas = self->getGenerationQuorum.getReadReplicas(); - #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" std::vector> fs; - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" for( ConfigTransactionInterface& readReplica : readReplicas ) { - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (readReplica.hostname.present()) - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" fs.push_back(tryInitializeRequestStream( &readReplica.getKnobs, readReplica.hostname.get(), WLTOKEN_CONFIGTXN_GETKNOBS)); - #line 2349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } } - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" StrictFuture __when_expr_1 = waitForAll(fs); - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(ConfigGeneration const& __generation,int loopDepth) + int a_body1loopBody1when1(ConfigGeneration const& __generation,int loopDepth) { - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" generation = __generation; - #line 2370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); + #line 2603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } - int a_body1when1(ConfigGeneration && __generation,int loopDepth) + int a_body1loopBody1when1(ConfigGeneration && __generation,int loopDepth) { generation = std::move(__generation); - loopDepth = a_body1cont1(loopDepth); + loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; } @@ -2390,12 +2623,12 @@ class GetKnobsActorState { fdb_probe_actor_enter("getKnobs", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getKnobs", reinterpret_cast(this), 0); @@ -2405,12 +2638,12 @@ class GetKnobsActorState { fdb_probe_actor_enter("getKnobs", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getKnobs", reinterpret_cast(this), 0); @@ -2420,61 +2653,61 @@ class GetKnobsActorState { fdb_probe_actor_enter("getKnobs", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getKnobs", reinterpret_cast(this), 0); } - int a_body1cont2(Void const& _,int loopDepth) + int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" configNodes = Reference(new ConfigTransactionInfo(readReplicas)); - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_2 = basicLoadBalance(configNodes, &ConfigTransactionInterface::getKnobs, ConfigTransactionGetKnobsRequest{ generation, configClass }); - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_2 = basicLoadBalance( configNodes, &ConfigTransactionInterface::getKnobs, ConfigTransactionGetKnobsRequest{ self->coordinatorsHash, generation, configClass }); + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont2(Void && _,int loopDepth) + int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" configNodes = Reference(new ConfigTransactionInfo(readReplicas)); - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_2 = basicLoadBalance(configNodes, &ConfigTransactionInterface::getKnobs, ConfigTransactionGetKnobsRequest{ generation, configClass }); - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_2 = basicLoadBalance( configNodes, &ConfigTransactionInterface::getKnobs, ConfigTransactionGetKnobsRequest{ self->coordinatorsHash, generation, configClass }); + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + loopDepth = a_body1loopBody1cont3(_, loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); return loopDepth; } @@ -2489,12 +2722,12 @@ class GetKnobsActorState { fdb_probe_actor_enter("getKnobs", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(value, 0); + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getKnobs", reinterpret_cast(this), 1); @@ -2504,12 +2737,12 @@ class GetKnobsActorState { fdb_probe_actor_enter("getKnobs", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(std::move(value), 0); + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getKnobs", reinterpret_cast(this), 1); @@ -2519,31 +2752,31 @@ class GetKnobsActorState { fdb_probe_actor_enter("getKnobs", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getKnobs", reinterpret_cast(this), 1); } - int a_body1cont5(ConfigTransactionGetKnobsReply const& reply,int loopDepth) + int a_body1loopBody1cont6(ConfigTransactionGetKnobsReply const& reply,int loopDepth) { - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" RangeResult result; - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" result.reserve(result.arena(), reply.knobNames.size()); - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" for( const auto& knobName : reply.knobNames ) { - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(knobName, ""_sr)); - #line 2542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetKnobsActorState(); static_cast(this)->destroy(); return 0; } - #line 2546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetKnobsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2551,21 +2784,21 @@ class GetKnobsActorState { return loopDepth; } - int a_body1cont5(ConfigTransactionGetKnobsReply && reply,int loopDepth) + int a_body1loopBody1cont6(ConfigTransactionGetKnobsReply && reply,int loopDepth) { - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" RangeResult result; - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" result.reserve(result.arena(), reply.knobNames.size()); - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" for( const auto& knobName : reply.knobNames ) { - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(knobName, ""_sr)); - #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetKnobsActorState(); static_cast(this)->destroy(); return 0; } - #line 2568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetKnobsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2573,15 +2806,15 @@ class GetKnobsActorState { return loopDepth; } - int a_body1cont2when1(ConfigTransactionGetKnobsReply const& reply,int loopDepth) + int a_body1loopBody1cont3when1(ConfigTransactionGetKnobsReply const& reply,int loopDepth) { - loopDepth = a_body1cont5(reply, loopDepth); + loopDepth = a_body1loopBody1cont6(reply, loopDepth); return loopDepth; } - int a_body1cont2when1(ConfigTransactionGetKnobsReply && reply,int loopDepth) + int a_body1loopBody1cont3when1(ConfigTransactionGetKnobsReply && reply,int loopDepth) { - loopDepth = a_body1cont5(std::move(reply), loopDepth); + loopDepth = a_body1loopBody1cont6(std::move(reply), loopDepth); return loopDepth; } @@ -2596,12 +2829,12 @@ class GetKnobsActorState { fdb_probe_actor_enter("getKnobs", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2when1(value, 0); + a_body1loopBody1cont3when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getKnobs", reinterpret_cast(this), 2); @@ -2611,12 +2844,12 @@ class GetKnobsActorState { fdb_probe_actor_enter("getKnobs", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1cont2when1(std::move(value), 0); + a_body1loopBody1cont3when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getKnobs", reinterpret_cast(this), 2); @@ -2626,32 +2859,32 @@ class GetKnobsActorState { fdb_probe_actor_enter("getKnobs", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("getKnobs", reinterpret_cast(this), 2); } - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" PaxosConfigTransactionImpl* self; - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" Optional configClass; - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" ConfigGeneration generation; - #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" std::vector readReplicas; - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" Reference configNodes; - #line 2649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" }; // This generated class is to be used only via getKnobs() - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class GetKnobsActor final : public Actor, public ActorCallback< GetKnobsActor, 0, ConfigGeneration >, public ActorCallback< GetKnobsActor, 1, Void >, public ActorCallback< GetKnobsActor, 2, ConfigTransactionGetKnobsReply >, public FastAllocated, public GetKnobsActorState { - #line 2654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2662,9 +2895,9 @@ class GetKnobsActor final : public Actor, public ActorCallback< Get friend struct ActorCallback< GetKnobsActor, 0, ConfigGeneration >; friend struct ActorCallback< GetKnobsActor, 1, Void >; friend struct ActorCallback< GetKnobsActor, 2, ConfigTransactionGetKnobsReply >; - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" GetKnobsActor(PaxosConfigTransactionImpl* const& self,Optional const& configClass) - #line 2667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" : Actor(), GetKnobsActorState(self, configClass) { @@ -2689,114 +2922,167 @@ friend struct ActorCallback< GetKnobsActor, 2, ConfigTransactionGetKnobsReply >; } }; - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" [[nodiscard]] static Future getKnobs( PaxosConfigTransactionImpl* const& self, Optional const& configClass ) { - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" return Future(new GetKnobsActor(self, configClass)); - #line 2696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } -#line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +#line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" // This generated class is to be used only via commit() - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" template - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class CommitActorState { - #line 2707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" CommitActorState(PaxosConfigTransactionImpl* const& self) - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" : self(self) - #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { fdb_probe_actor_create("commit", reinterpret_cast(this)); } ~CommitActorState() { - fdb_probe_actor_destroy("commit", reinterpret_cast(this)); + fdb_probe_actor_destroy("commit", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + ; + #line 2962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CommitActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + return loopDepth; } - int a_body1(int loopDepth=0) + int a_body1loopBody1(int loopDepth) { try { - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" StrictFuture __when_expr_0 = self->getGenerationQuorum.getGeneration(); - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + loopDepth = a_body1loopBody1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) + int a_body1loopBody1cont1(int loopDepth) { - this->~CommitActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; + if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1cont1(ConfigGeneration const& generation,int loopDepth) + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + try { + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (e.code() != error_code_coordinators_changed) + #line 3022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + { + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 3026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + } + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + self->reset(); + #line 3030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(ConfigGeneration const& generation,int loopDepth) + { + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" self->commitQuorum.setTimestamp(); - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_1 = self->commitQuorum.commit(generation); - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_1 = self->commitQuorum.commit(generation, self->coordinatorsHash); + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont1(ConfigGeneration && generation,int loopDepth) + int a_body1loopBody1cont2(ConfigGeneration && generation,int loopDepth) { - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" self->commitQuorum.setTimestamp(); - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - StrictFuture __when_expr_1 = self->commitQuorum.commit(generation); - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_1 = self->commitQuorum.commit(generation, self->coordinatorsHash); + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1when1(ConfigGeneration const& generation,int loopDepth) + int a_body1loopBody1when1(ConfigGeneration const& generation,int loopDepth) { - loopDepth = a_body1cont1(generation, loopDepth); + loopDepth = a_body1loopBody1cont2(generation, loopDepth); return loopDepth; } - int a_body1when1(ConfigGeneration && generation,int loopDepth) + int a_body1loopBody1when1(ConfigGeneration && generation,int loopDepth) { - loopDepth = a_body1cont1(std::move(generation), loopDepth); + loopDepth = a_body1loopBody1cont2(std::move(generation), loopDepth); return loopDepth; } @@ -2811,12 +3097,12 @@ class CommitActorState { fdb_probe_actor_enter("commit", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(value, 0); + a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("commit", reinterpret_cast(this), 0); @@ -2826,12 +3112,12 @@ class CommitActorState { fdb_probe_actor_enter("commit", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("commit", reinterpret_cast(this), 0); @@ -2841,21 +3127,21 @@ class CommitActorState { fdb_probe_actor_enter("commit", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("commit", reinterpret_cast(this), 0); } - int a_body1cont2(Void const& _,int loopDepth) + int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitActorState(); static_cast(this)->destroy(); return 0; } - #line 2858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CommitActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2863,11 +3149,11 @@ class CommitActorState { return loopDepth; } - int a_body1cont2(Void && _,int loopDepth) + int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitActorState(); static_cast(this)->destroy(); return 0; } - #line 2870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CommitActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2875,15 +3161,15 @@ class CommitActorState { return loopDepth; } - int a_body1cont1when1(Void const& _,int loopDepth) + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + loopDepth = a_body1loopBody1cont3(_, loopDepth); return loopDepth; } - int a_body1cont1when1(Void && _,int loopDepth) + int a_body1loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); return loopDepth; } @@ -2898,12 +3184,12 @@ class CommitActorState { fdb_probe_actor_enter("commit", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(value, 0); + a_body1loopBody1cont2when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("commit", reinterpret_cast(this), 1); @@ -2913,12 +3199,12 @@ class CommitActorState { fdb_probe_actor_enter("commit", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1cont1when1(std::move(value), 0); + a_body1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("commit", reinterpret_cast(this), 1); @@ -2928,24 +3214,24 @@ class CommitActorState { fdb_probe_actor_enter("commit", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1Catch1(err, 0); + a_body1loopBody1Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1loopBody1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1loopBody1Catch1(unknown_error(), 0); } fdb_probe_actor_exit("commit", reinterpret_cast(this), 1); } - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" PaxosConfigTransactionImpl* self; - #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" }; // This generated class is to be used only via commit() - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class CommitActor final : public Actor, public ActorCallback< CommitActor, 0, ConfigGeneration >, public ActorCallback< CommitActor, 1, Void >, public FastAllocated, public CommitActorState { - #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2955,9 +3241,9 @@ class CommitActor final : public Actor, public ActorCallback< CommitActor, #pragma clang diagnostic pop friend struct ActorCallback< CommitActor, 0, ConfigGeneration >; friend struct ActorCallback< CommitActor, 1, Void >; - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" CommitActor(PaxosConfigTransactionImpl* const& self) - #line 2960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" : Actor(), CommitActorState(self) { @@ -2981,31 +3267,31 @@ friend struct ActorCallback< CommitActor, 1, Void >; } }; - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" [[nodiscard]] static Future commit( PaxosConfigTransactionImpl* const& self ) { - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" return Future(new CommitActor(self)); - #line 2988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } -#line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +#line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" // This generated class is to be used only via onError() - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" template - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class OnErrorActorState { - #line 2999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" OnErrorActorState(PaxosConfigTransactionImpl* const& self,Error const& e) - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" : self(self), - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" e(e) - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { fdb_probe_actor_create("onError", reinterpret_cast(this)); @@ -3018,22 +3304,22 @@ class OnErrorActorState { int a_body1(int loopDepth=0) { try { - #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" TraceEvent("ConfigIncrementOnError").error(e).detail("NumRetries", self->numRetries); - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (e.code() == error_code_transaction_too_old || e.code() == error_code_not_committed) - #line 3025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" { - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" StrictFuture __when_expr_0 = delay(std::clamp((1 << self->numRetries++) * 0.01 * deterministicRandom()->random01(), 0.0, CLIENT_KNOBS->TIMEOUT_RETRY_UPPER_BOUND)); - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" loopDepth = 0; } else @@ -3059,19 +3345,19 @@ class OnErrorActorState { } int a_body1cont1(int loopDepth) { - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" return loopDepth; } int a_body1cont2(Void const& _,int loopDepth) { - #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" self->reset(); - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OnErrorActorState(); static_cast(this)->destroy(); return 0; } - #line 3074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~OnErrorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3081,11 +3367,11 @@ class OnErrorActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" self->reset(); - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OnErrorActorState(); static_cast(this)->destroy(); return 0; } - #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~OnErrorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3156,16 +3442,16 @@ class OnErrorActorState { fdb_probe_actor_exit("onError", reinterpret_cast(this), 0); } - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" PaxosConfigTransactionImpl* self; - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" Error e; - #line 3163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" }; // This generated class is to be used only via onError() - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" class OnErrorActor final : public Actor, public ActorCallback< OnErrorActor, 0, Void >, public FastAllocated, public OnErrorActorState { - #line 3168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3174,9 +3460,9 @@ class OnErrorActor final : public Actor, public ActorCallback< OnErrorActo void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< OnErrorActor, 0, Void >; - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" OnErrorActor(PaxosConfigTransactionImpl* const& self,Error const& e) - #line 3179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" : Actor(), OnErrorActorState(self, e) { @@ -3199,14 +3485,242 @@ friend struct ActorCallback< OnErrorActor, 0, Void >; } }; - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" [[nodiscard]] static Future onError( PaxosConfigTransactionImpl* const& self, Error const& e ) { - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" return Future(new OnErrorActor(self, e)); - #line 3206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + #line 3492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" +} + +#line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + + // Returns when the cluster interface updates with a new connection string. + #line 3498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" +// This generated class is to be used only via watchClusterFile() + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +template + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +class WatchClusterFileActorState { + #line 3504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" +public: + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + WatchClusterFileActorState(Database const& cx) + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + : cx(cx), + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + leaderMonitor(monitorLeader(cx->getConnectionRecord(), cx->statusClusterInterface)), + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + connectionString(cx->getConnectionRecord()->getConnectionString().toString()) + #line 3515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + { + fdb_probe_actor_create("watchClusterFile", reinterpret_cast(this)); + + } + ~WatchClusterFileActorState() + { + fdb_probe_actor_destroy("watchClusterFile", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + ; + #line 3530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~WatchClusterFileActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + StrictFuture __when_expr_0 = cx->statusClusterInterface->onChange(); + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1(Void const& _,int loopDepth) + { + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (cx->getConnectionRecord()->getConnectionString().toString() != connectionString) + #line 3576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + { + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WatchClusterFileActorState(); static_cast(this)->destroy(); return 0; } + #line 3580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WatchClusterFileActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1(Void && _,int loopDepth) + { + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (cx->getConnectionRecord()->getConnectionString().toString() != connectionString) + #line 3594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + { + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WatchClusterFileActorState(); static_cast(this)->destroy(); return 0; } + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WatchClusterFileActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WatchClusterFileActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WatchClusterFileActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("watchClusterFile", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchClusterFile", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< WatchClusterFileActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("watchClusterFile", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchClusterFile", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< WatchClusterFileActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("watchClusterFile", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchClusterFile", reinterpret_cast(this), 0); + + } + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + Database cx; + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + Future leaderMonitor; + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + std::string connectionString; + #line 3677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" +}; +// This generated class is to be used only via watchClusterFile() + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +class WatchClusterFileActor final : public Actor, public ActorCallback< WatchClusterFileActor, 0, Void >, public FastAllocated, public WatchClusterFileActorState { + #line 3682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< WatchClusterFileActor, 0, Void >; + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + WatchClusterFileActor(Database const& cx) + #line 3693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" + : Actor(), + WatchClusterFileActorState(cx) + { + fdb_probe_actor_enter("watchClusterFile", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("watchClusterFile"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("watchClusterFile", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< WatchClusterFileActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +[[nodiscard]] static Future watchClusterFile( Database const& cx ) { + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" + return Future(new WatchClusterFileActor(cx)); + #line 3720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.g.cpp" } -#line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" +#line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/PaxosConfigTransaction.actor.cpp" public: Future getReadVersion() { @@ -3253,7 +3767,25 @@ friend struct ActorCallback< OnErrorActor, 0, Void >; void debugTransaction(UID dID) { this->dID = dID; } void reset() { - getGenerationQuorum = GetGenerationQuorum{ ctis }; + ctis.clear(); + // Re-read connection string. If the cluster file changed, this will + // return the updated value. + const ClusterConnectionString& cs = cx->getConnectionRecord()->getConnectionString(); + ctis.reserve(cs.hostnames.size() + cs.coords.size()); + for (const auto& h : cs.hostnames) { + ctis.emplace_back(h); + } + for (const auto& c : cs.coords) { + ctis.emplace_back(c); + } + coordinatorsHash = std::hash()(cx->getConnectionRecord()->getConnectionString().toString()); + if (!cx->statusLeaderMon.isValid() || cx->statusLeaderMon.isReady()) { + cx->statusClusterInterface = makeReference>>(); + cx->statusLeaderMon = watchClusterFile(cx); + } + getGenerationQuorum = GetGenerationQuorum{ + coordinatorsHash, ctis, cx->statusLeaderMon, getGenerationQuorum.getLastSeenLiveVersion() + }; commitQuorum = CommitQuorum{ ctis }; } @@ -3274,21 +3806,10 @@ friend struct ActorCallback< OnErrorActor, 0, Void >; Future commit() { return commit(this); } - PaxosConfigTransactionImpl(Database const& cx) : cx(cx) { - const ClusterConnectionString& cs = cx->getConnectionRecord()->getConnectionString(); - ctis.reserve(cs.hostnames.size() + cs.coords.size()); - for (const auto& h : cs.hostnames) { - ctis.emplace_back(h); - } - for (const auto& c : cs.coords) { - ctis.emplace_back(c); - } - getGenerationQuorum = GetGenerationQuorum{ ctis }; - commitQuorum = CommitQuorum{ ctis }; - } + PaxosConfigTransactionImpl(Database const& cx) : cx(cx) { reset(); } PaxosConfigTransactionImpl(std::vector const& ctis) - : ctis(ctis), getGenerationQuorum(ctis), commitQuorum(ctis) {} + : ctis(ctis), getGenerationQuorum(0, ctis, Future()), commitQuorum(ctis) {} }; Future PaxosConfigTransaction::getReadVersion() { @@ -3341,6 +3862,14 @@ Version PaxosConfigTransaction::getCommittedVersion() const { return impl->getCommittedVersion(); } +double PaxosConfigTransaction::getTagThrottledDuration() const { + return 0.0; +} + +int64_t PaxosConfigTransaction::getTotalCost() const { + return 0; +} + int64_t PaxosConfigTransaction::getApproximateSize() const { return impl->getApproximateSize(); } diff --git a/src/fdbclient/RESTClient.actor.cpp b/src/fdbclient/RESTClient.actor.cpp new file mode 100644 index 0000000..d771b3c --- /dev/null +++ b/src/fdbclient/RESTClient.actor.cpp @@ -0,0 +1,386 @@ +/* + * RESTClient.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/RESTClient.h" + +#include "fdbrpc/HTTP.h" +#include "flow/IRateControl.h" +#include "fdbclient/RESTUtils.h" +#include "flow/Arena.h" +#include "flow/Error.h" +#include "flow/FastRef.h" +#include "flow/Knobs.h" +#include "flow/Net2Packet.h" +#include "flow/flow.h" +#include "flow/network.h" +#include "flow/serialize.h" +#include "flow/Trace.h" +#include "flow/UnitTest.h" +#include "flow/IConnection.h" + +#include +#include + +#include "flow/actorcompiler.h" // always the last include + +#define TRACE_REST_OP(opName, url) \ + do { \ + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::DEBUG) { \ + const std::string urlStr = url.toString(); \ + TraceEvent("RESTClientOp") \ + .detail("Op", #opName) \ + .detail("Url", urlStr) \ + .detail("IsSecure", url.connType.secure); \ + } \ + } while (0); + +json_spirit::mObject RESTClient::Stats::getJSON() { + json_spirit::mObject o; + + o["host_service"] = host_service; + o["requests_failed"] = requests_failed; + o["requests_successful"] = requests_successful; + o["bytes_sent"] = bytes_sent; + + return o; +} + +RESTClient::Stats RESTClient::Stats::operator-(const Stats& rhs) { + Stats r(host_service); + + r.requests_failed = requests_failed - rhs.requests_failed; + r.requests_successful = requests_successful - rhs.requests_successful; + r.bytes_sent = bytes_sent - rhs.bytes_sent; + + return r; +} + +RESTClient::RESTClient() : conectionPool(makeReference(knobs.connection_pool_size)) {} + +RESTClient::RESTClient(std::unordered_map& knobSettings) + : conectionPool(makeReference(knobs.connection_pool_size)) { + knobs.set(knobSettings); +} + +void RESTClient::setKnobs(const std::unordered_map& knobSettings) { + knobs.set(knobSettings); +} + +std::unordered_map RESTClient::getKnobs() const { + return knobs.get(); +} + +ACTOR Future> doRequest_impl(Reference client, + std::string verb, + HTTP::Headers headers, + RESTUrl url, + std::set successCodes) { + + state Reference req = makeReference(); + state UnsentPacketQueue content; + req->data.content = &content; + req->data.contentLen = url.body.size(); + req->data.headers = headers; + req->data.headers["Host"] = url.host; + req->verb = verb; + req->resource = url.resource; + + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::VERBOSE) { + TraceEvent("RESTDoRequestImpl").detail("Url", url.toString()); + } + + if (url.body.size() > 0) { + PacketWriter pw(req->data.content->getWriteBuffer(url.body.size()), nullptr, Unversioned()); + pw.serializeBytes(url.body); + } + + std::string statsKey = RESTClient::getStatsKey(url.host, url.service); + auto sItr = client->statsMap.find(statsKey); + if (sItr == client->statsMap.end()) { + client->statsMap.emplace(statsKey, std::make_unique(statsKey)); + } + + state int maxTries = std::min(client->knobs.request_tries, client->knobs.connect_tries); + state int thisTry = 1; + state double nextRetryDelay = 2.0; + state Reference sendReceiveRate = makeReference(); + state double reqTimeout = (client->knobs.request_timeout_secs * 1.0); + state RESTConnectionPoolKey connectPoolKey = RESTConnectionPool::getConnectionPoolKey(url.host, url.service); + state RESTClient::Stats* statsPtr = client->statsMap[statsKey].get(); + + loop { + state Optional err; + state Optional remoteAddress; + state bool connectionEstablished = false; + + state Reference r; + + try { + // Start connecting + Future frconn = + client->conectionPool->connect(connectPoolKey, url.connType.secure, client->knobs.max_connection_life); + + // Finish connecting, do request + state RESTConnectionPool::ReusableConnection rconn = + wait(timeoutError(frconn, client->knobs.connect_timeout)); + connectionEstablished = true; + + remoteAddress = rconn.conn->getPeerAddress(); + Reference _r = wait(timeoutError( + HTTP::doRequest(rconn.conn, req, sendReceiveRate, &statsPtr->bytes_sent, sendReceiveRate), reqTimeout)); + r = _r; + + // Since the response was parsed successfully (which is why we are here) reuse the connection unless we + // received the "Connection: close" header. + if (r->data.headers["Connection"] != "close") { + client->conectionPool->returnConnection(connectPoolKey, rconn, client->knobs.connection_pool_size); + } + rconn.conn.clear(); + } catch (Error& e) { + if (e.code() == error_code_actor_cancelled) { + throw; + } + err = e; + } + + // If err is not present then r is valid. + // If r->code is in successCodes then record the successful request and return r. + if (!err.present() && successCodes.count(r->code) != 0) { + statsPtr->requests_successful++; + return r; + } + + // Otherwise, this request is considered failed. Update failure count. + statsPtr->requests_failed++; + + // All errors in err are potentially retryable as well as certain HTTP response codes... + bool retryable = + err.present() || r->code == HTTP::HTTP_STATUS_CODE_INTERNAL_SERVER_ERROR || + r->code == HTTP::HTTP_STATUS_CODE_BAD_GATEWAY || r->code == HTTP::HTTP_STATUS_CODE_BAD_GATEWAY || + r->code == HTTP::HTTP_STATUS_CODE_SERVICE_UNAVAILABLE || + r->code == HTTP::HTTP_STATUS_CODE_TOO_MANY_REQUESTS || r->code == HTTP::HTTP_STATUS_CODE_TIMEOUT; + + // But only if our previous attempt was not the last allowable try. + retryable = retryable && (thisTry < maxTries); + + TraceEvent event(SevWarn, retryable ? "RESTClientFailedRetryable" : "RESTClientRequestFailed"); + + // Attach err to trace event if present, otherwise extract some stuff from the response + if (err.present()) { + event.errorUnsuppressed(err.get()); + } + event.suppressFor(60); + if (!err.present()) { + event.detail("ResponseCode", r->code); + } + + event.detail("ConnectionEstablished", connectionEstablished); + + if (remoteAddress.present()) + event.detail("RemoteEndpoint", remoteAddress.get()); + else + event.detail("RemoteHost", url.host); + + event.detail("Verb", verb).detail("Resource", url.resource).detail("ThisTry", thisTry); + + // If r is not valid or not code TOO_MANY_REQUESTS then increment the try count. + // TOO_MANY_REQUEST's will not count against the attempt limit. + if (!r || r->code != HTTP::HTTP_STATUS_CODE_TOO_MANY_REQUESTS) { + ++thisTry; + } + + // We will wait delay seconds before the next retry, start with nextRetryDelay. + double delay = nextRetryDelay; + // Double but limit the *next* nextRetryDelay. + nextRetryDelay = std::min(nextRetryDelay * 2, 60.0); + + if (retryable) { + // If r is valid then obey the Retry-After response header if present. + if (r) { + auto iRetryAfter = r->data.headers.find("Retry-After"); + if (iRetryAfter != r->data.headers.end()) { + event.detail("RetryAfterHeader", iRetryAfter->second); + char* pEnd; + double retryAfter = strtod(iRetryAfter->second.c_str(), &pEnd); + if (*pEnd) { + // If there were other characters then don't trust the parsed value + retryAfter = HTTP::HTTP_RETRYAFTER_DELAY_SECS; + } + // Update delay + delay = std::max(delay, retryAfter); + } + } + + // Log the delay then wait. + event.detail("RetryDelay", delay); + wait(::delay(delay)); + } else { + // We can't retry, so throw something. + + // This error code means the authentication header was not accepted, likely the account or key is wrong. + if (r && r->code == HTTP::HTTP_STATUS_CODE_NOT_ACCEPTABLE) { + throw http_not_accepted(); + } + + if (r && r->code == HTTP::HTTP_STATUS_CODE_UNAUTHORIZED) { + throw http_auth_failed(); + } + + // Recognize and throw specific errors + if (err.present()) { + int code = err.get().code(); + + // If we get a timed_out error during the the connect() phase, we'll call that connection_failed + // despite the fact that there was technically never a 'connection' to begin with. It + // differentiates between an active connection timing out vs a connection timing out, though not + // between an active connection failing vs connection attempt failing. + // TODO: Add more error types? + if (code == error_code_timed_out && !connectionEstablished) { + throw connection_failed(); + } + + if (code == error_code_timed_out || code == error_code_connection_failed || + code == error_code_lookup_failed) { + throw err.get(); + } + } + + throw http_request_failed(); + } + } +} + +Future> RESTClient::doPutOrPost(const std::string& verb, + Optional optHeaders, + RESTUrl& url, + std::set successCodes) { + HTTP::Headers headers; + if (optHeaders.present()) { + headers = optHeaders.get(); + } + + return doRequest_impl(Reference::addRef(this), verb, headers, url, successCodes); +} + +Future> RESTClient::doPost(const std::string& fullUrl, + const std::string& requestBody, + Optional optHeaders) { + RESTUrl url(fullUrl, requestBody); + TRACE_REST_OP("DoPost", url); + return doPutOrPost(HTTP::HTTP_VERB_POST, optHeaders, url, { HTTP::HTTP_STATUS_CODE_OK }); +} + +Future> RESTClient::doPut(const std::string& fullUrl, + const std::string& requestBody, + Optional optHeaders) { + RESTUrl url(fullUrl, requestBody); + TRACE_REST_OP("DoPut", url); + return doPutOrPost( + HTTP::HTTP_VERB_PUT, + optHeaders, + url, + // 201 - on successful resource create + // 200 / 204 - if target resource representation was successfully modified with the desired state + { HTTP::HTTP_STATUS_CODE_OK, HTTP::HTTP_STATUS_CODE_CREATED, HTTP::HTTP_STATUS_CODE_NO_CONTENT }); +} + +Future> RESTClient::doGetHeadDeleteOrTrace(const std::string& verb, + Optional optHeaders, + RESTUrl& url, + std::set successCodes) { + HTTP::Headers headers; + if (optHeaders.present()) { + headers = optHeaders.get(); + } + + return doRequest_impl(Reference::addRef(this), HTTP::HTTP_VERB_GET, headers, url, successCodes); +} + +Future> RESTClient::doGet(const std::string& fullUrl, + Optional optHeaders) { + RESTUrl url(fullUrl); + TRACE_REST_OP("DoGet", url); + return doGetHeadDeleteOrTrace(HTTP::HTTP_VERB_GET, optHeaders, url, { HTTP::HTTP_STATUS_CODE_OK }); +} + +Future> RESTClient::doHead(const std::string& fullUrl, + Optional optHeaders) { + RESTUrl url(fullUrl); + TRACE_REST_OP("DoHead", url); + return doGetHeadDeleteOrTrace(HTTP::HTTP_VERB_HEAD, optHeaders, url, { HTTP::HTTP_STATUS_CODE_OK }); +} + +Future> RESTClient::doDelete(const std::string& fullUrl, + Optional optHeaders) { + RESTUrl url(fullUrl); + TRACE_REST_OP("DoDelete", url); + return doGetHeadDeleteOrTrace( + HTTP::HTTP_VERB_DELETE, + optHeaders, + url, + // 200 - action has been enacted. + // 202 - action will likely succeed, but, has not yet been enacted. + // 204 - action has been enated, no further information is to supplied. + { HTTP::HTTP_STATUS_CODE_OK, HTTP::HTTP_STATUS_CODE_NO_CONTENT, HTTP::HTTP_STATUS_CODE_ACCEPTED }); +} + +Future> RESTClient::doTrace(const std::string& fullUrl, + Optional optHeaders) { + RESTUrl url(fullUrl); + TRACE_REST_OP("DoTrace", url); + return doGetHeadDeleteOrTrace(HTTP::HTTP_VERB_TRACE, optHeaders, url, { HTTP::HTTP_STATUS_CODE_OK }); +} + +// Only used to link unit tests +void forceLinkRESTClientTests() {} + +TEST_CASE("fdbrpc/RESTClient") { + RESTClient r; + std::unordered_map knobs = r.getKnobs(); + ASSERT_EQ(knobs["connection_pool_size"], FLOW_KNOBS->RESTCLIENT_MAX_CONNECTIONPOOL_SIZE); + ASSERT_EQ(knobs["connect_tries"], FLOW_KNOBS->RESTCLIENT_CONNECT_TRIES); + ASSERT_EQ(knobs["connect_timeout"], FLOW_KNOBS->RESTCLIENT_CONNECT_TIMEOUT); + ASSERT_EQ(knobs["max_connection_life"], FLOW_KNOBS->RESTCLIENT_MAX_CONNECTION_LIFE); + ASSERT_EQ(knobs["request_tries"], FLOW_KNOBS->RESTCLIENT_REQUEST_TRIES); + ASSERT_EQ(knobs["request_timeout_secs"], FLOW_KNOBS->RESTCLIENT_REQUEST_TIMEOUT_SEC); + + for (auto& itr : knobs) { + itr.second++; + } + r.setKnobs(knobs); + + std::unordered_map updated = r.getKnobs(); + for (auto& itr : updated) { + ASSERT_EQ(knobs[itr.first], itr.second); + } + + // invalid client knob + knobs["foo"] = 100; + try { + r.setKnobs(knobs); + ASSERT(false); + } catch (Error& e) { + if (e.code() != error_code_rest_invalid_rest_client_knob) { + throw e; + } + } + + return Void(); +} diff --git a/src/fdbclient/RESTClient.actor.g.cpp b/src/fdbclient/RESTClient.actor.g.cpp new file mode 100644 index 0000000..2afe341 --- /dev/null +++ b/src/fdbclient/RESTClient.actor.g.cpp @@ -0,0 +1,1083 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" +/* + * RESTClient.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/RESTClient.h" + +#include "fdbrpc/HTTP.h" +#include "flow/IRateControl.h" +#include "fdbclient/RESTUtils.h" +#include "flow/Arena.h" +#include "flow/Error.h" +#include "flow/FastRef.h" +#include "flow/Knobs.h" +#include "flow/Net2Packet.h" +#include "flow/flow.h" +#include "flow/network.h" +#include "flow/serialize.h" +#include "flow/Trace.h" +#include "flow/UnitTest.h" +#include "flow/IConnection.h" + +#include +#include + +#include "flow/actorcompiler.h" // always the last include + +#define TRACE_REST_OP(opName, url) \ + do { \ + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::DEBUG) { \ + const std::string urlStr = url.toString(); \ + TraceEvent("RESTClientOp") \ + .detail("Op", #opName) \ + .detail("Url", urlStr) \ + .detail("IsSecure", url.connType.secure); \ + } \ + } while (0); + +json_spirit::mObject RESTClient::Stats::getJSON() { + json_spirit::mObject o; + + o["host_service"] = host_service; + o["requests_failed"] = requests_failed; + o["requests_successful"] = requests_successful; + o["bytes_sent"] = bytes_sent; + + return o; +} + +RESTClient::Stats RESTClient::Stats::operator-(const Stats& rhs) { + Stats r(host_service); + + r.requests_failed = requests_failed - rhs.requests_failed; + r.requests_successful = requests_successful - rhs.requests_successful; + r.bytes_sent = bytes_sent - rhs.bytes_sent; + + return r; +} + +RESTClient::RESTClient() : conectionPool(makeReference(knobs.connection_pool_size)) {} + +RESTClient::RESTClient(std::unordered_map& knobSettings) + : conectionPool(makeReference(knobs.connection_pool_size)) { + knobs.set(knobSettings); +} + +void RESTClient::setKnobs(const std::unordered_map& knobSettings) { + knobs.set(knobSettings); +} + +std::unordered_map RESTClient::getKnobs() const { + return knobs.get(); +} + + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" +namespace { +// This generated class is to be used only via doRequest_impl() + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" +template + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" +class DoRequest_implActorState { + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" +public: + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + DoRequest_implActorState(Reference const& client,std::string const& verb,HTTP::Headers const& headers,RESTUrl const& url,std::set const& successCodes) + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + : client(client), + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + verb(verb), + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + headers(headers), + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + url(url), + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + successCodes(successCodes), + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + req(makeReference()), + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + content() + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + fdb_probe_actor_create("doRequest_impl", reinterpret_cast(this)); + + } + ~DoRequest_implActorState() + { + fdb_probe_actor_destroy("doRequest_impl", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + req->data.content = &content; + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + req->data.contentLen = url.body.size(); + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + req->data.headers = headers; + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + req->data.headers["Host"] = url.host; + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + req->verb = verb; + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + req->resource = url.resource; + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::VERBOSE) + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + TraceEvent("RESTDoRequestImpl").detail("Url", url.toString()); + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (url.body.size() > 0) + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + PacketWriter pw(req->data.content->getWriteBuffer(url.body.size()), nullptr, Unversioned()); + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + pw.serializeBytes(url.body); + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + std::string statsKey = RESTClient::getStatsKey(url.host, url.service); + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + auto sItr = client->statsMap.find(statsKey); + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (sItr == client->statsMap.end()) + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + client->statsMap.emplace(statsKey, std::make_unique(statsKey)); + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + maxTries = std::min(client->knobs.request_tries, client->knobs.connect_tries); + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + thisTry = 1; + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + nextRetryDelay = 2.0; + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + sendReceiveRate = makeReference(); + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + reqTimeout = (client->knobs.request_timeout_secs * 1.0); + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + connectPoolKey = RESTConnectionPool::getConnectionPoolKey(url.host, url.service); + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + statsPtr = client->statsMap[statsKey].get(); + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + ; + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~DoRequest_implActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + err = Optional(); + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + remoteAddress = Optional(); + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + connectionEstablished = false; + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + r = Reference(); + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + try { + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + Future frconn = client->conectionPool->connect(connectPoolKey, url.connType.secure, client->knobs.max_connection_life); + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + StrictFuture __when_expr_0 = timeoutError(frconn, client->knobs.connect_timeout); + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (!err.present() && successCodes.count(r->code) != 0) + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + statsPtr->requests_successful++; + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(r); this->~DoRequest_implActorState(); static_cast(this)->destroy(); return 0; } + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(r)); // state_var_RVO + this->~DoRequest_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + statsPtr->requests_failed++; + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + bool retryable = err.present() || r->code == HTTP::HTTP_STATUS_CODE_INTERNAL_SERVER_ERROR || r->code == HTTP::HTTP_STATUS_CODE_BAD_GATEWAY || r->code == HTTP::HTTP_STATUS_CODE_BAD_GATEWAY || r->code == HTTP::HTTP_STATUS_CODE_SERVICE_UNAVAILABLE || r->code == HTTP::HTTP_STATUS_CODE_TOO_MANY_REQUESTS || r->code == HTTP::HTTP_STATUS_CODE_TIMEOUT; + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + retryable = retryable && (thisTry < maxTries); + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + TraceEvent event(SevWarn, retryable ? "RESTClientFailedRetryable" : "RESTClientRequestFailed"); + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (err.present()) + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + event.errorUnsuppressed(err.get()); + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + event.suppressFor(60); + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (!err.present()) + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + event.detail("ResponseCode", r->code); + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + event.detail("ConnectionEstablished", connectionEstablished); + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (remoteAddress.present()) + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + event.detail("RemoteEndpoint", remoteAddress.get()); + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + else + { + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + event.detail("RemoteHost", url.host); + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + event.detail("Verb", verb).detail("Resource", url.resource).detail("ThisTry", thisTry); + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (!r || r->code != HTTP::HTTP_STATUS_CODE_TOO_MANY_REQUESTS) + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + ++thisTry; + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + double delay = nextRetryDelay; + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + nextRetryDelay = std::min(nextRetryDelay * 2, 60.0); + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (retryable) + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (r) + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + auto iRetryAfter = r->data.headers.find("Retry-After"); + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (iRetryAfter != r->data.headers.end()) + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + event.detail("RetryAfterHeader", iRetryAfter->second); + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + char* pEnd; + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + double retryAfter = strtod(iRetryAfter->second.c_str(), &pEnd); + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (*pEnd) + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + retryAfter = HTTP::HTTP_RETRYAFTER_DELAY_SECS; + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + delay = std::max(delay, retryAfter); + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + } + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + event.detail("RetryDelay", delay); + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + StrictFuture __when_expr_2 = ::delay(delay); + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (r && r->code == HTTP::HTTP_STATUS_CODE_NOT_ACCEPTABLE) + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + return a_body1Catch1(http_not_accepted(), std::max(0, loopDepth - 1)); + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (r && r->code == HTTP::HTTP_STATUS_CODE_UNAUTHORIZED) + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + return a_body1Catch1(http_auth_failed(), std::max(0, loopDepth - 1)); + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (err.present()) + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + int code = err.get().code(); + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (code == error_code_timed_out && !connectionEstablished) + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + return a_body1Catch1(connection_failed(), std::max(0, loopDepth - 1)); + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (code == error_code_timed_out || code == error_code_connection_failed || code == error_code_lookup_failed) + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + return a_body1Catch1(err.get(), std::max(0, loopDepth - 1)); + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + } + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + return a_body1Catch1(http_request_failed(), std::max(0, loopDepth - 1)); + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (e.code() == error_code_actor_cancelled) + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + err = e; + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + loopDepth = a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + connectionEstablished = true; + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + remoteAddress = rconn.conn->getPeerAddress(); + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + StrictFuture> __when_expr_1 = timeoutError( HTTP::doRequest(rconn.conn, req, sendReceiveRate, &statsPtr->bytes_sent, sendReceiveRate), reqTimeout); + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(RESTConnectionPool::ReusableConnection const& __rconn,int loopDepth) + { + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + rconn = __rconn; + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(RESTConnectionPool::ReusableConnection && __rconn,int loopDepth) + { + rconn = std::move(__rconn); + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoRequest_implActor, 0, RESTConnectionPool::ReusableConnection >::remove(); + + } + void a_callback_fire(ActorCallback< DoRequest_implActor, 0, RESTConnectionPool::ReusableConnection >*,RESTConnectionPool::ReusableConnection const& value) + { + fdb_probe_actor_enter("doRequest_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequest_impl", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< DoRequest_implActor, 0, RESTConnectionPool::ReusableConnection >*,RESTConnectionPool::ReusableConnection && value) + { + fdb_probe_actor_enter("doRequest_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequest_impl", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< DoRequest_implActor, 0, RESTConnectionPool::ReusableConnection >*,Error err) + { + fdb_probe_actor_enter("doRequest_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequest_impl", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(Reference const& _r,int loopDepth) + { + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + r = _r; + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (r->data.headers["Connection"] != "close") + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + client->conectionPool->returnConnection(connectPoolKey, rconn, client->knobs.connection_pool_size); + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + rconn.conn.clear(); + #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + loopDepth = a_body1loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3(Reference && _r,int loopDepth) + { + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + r = _r; + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (r->data.headers["Connection"] != "close") + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + client->conectionPool->returnConnection(connectPoolKey, rconn, client->knobs.connection_pool_size); + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + rconn.conn.clear(); + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + loopDepth = a_body1loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Reference const& _r,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_r, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Reference && _r,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_r), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoRequest_implActor, 1, Reference >::remove(); + + } + void a_callback_fire(ActorCallback< DoRequest_implActor, 1, Reference >*,Reference const& value) + { + fdb_probe_actor_enter("doRequest_impl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequest_impl", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< DoRequest_implActor, 1, Reference >*,Reference && value) + { + fdb_probe_actor_enter("doRequest_impl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequest_impl", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< DoRequest_implActor, 1, Reference >*,Error err) + { + fdb_probe_actor_enter("doRequest_impl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequest_impl", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont6(int loopDepth) + { + try { + loopDepth = a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont7(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont14(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont7(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont14(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont7(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont14(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont14(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoRequest_implActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DoRequest_implActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("doRequest_impl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequest_impl", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< DoRequest_implActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("doRequest_impl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequest_impl", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< DoRequest_implActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("doRequest_impl", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequest_impl", reinterpret_cast(this), 2); + + } + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + Reference client; + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + std::string verb; + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + HTTP::Headers headers; + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + RESTUrl url; + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + std::set successCodes; + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + Reference req; + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + UnsentPacketQueue content; + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + int maxTries; + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + int thisTry; + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + double nextRetryDelay; + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + Reference sendReceiveRate; + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + double reqTimeout; + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + RESTConnectionPoolKey connectPoolKey; + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + RESTClient::Stats* statsPtr; + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + Optional err; + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + Optional remoteAddress; + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + bool connectionEstablished; + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + Reference r; + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + RESTConnectionPool::ReusableConnection rconn; + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" +}; +// This generated class is to be used only via doRequest_impl() + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" +class DoRequest_implActor final : public Actor>, public ActorCallback< DoRequest_implActor, 0, RESTConnectionPool::ReusableConnection >, public ActorCallback< DoRequest_implActor, 1, Reference >, public ActorCallback< DoRequest_implActor, 2, Void >, public FastAllocated, public DoRequest_implActorState { + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DoRequest_implActor, 0, RESTConnectionPool::ReusableConnection >; +friend struct ActorCallback< DoRequest_implActor, 1, Reference >; +friend struct ActorCallback< DoRequest_implActor, 2, Void >; + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + DoRequest_implActor(Reference const& client,std::string const& verb,HTTP::Headers const& headers,RESTUrl const& url,std::set const& successCodes) + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + : Actor>(), + DoRequest_implActorState(client, verb, headers, url, successCodes) + { + fdb_probe_actor_enter("doRequest_impl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("doRequest_impl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("doRequest_impl", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DoRequest_implActor, 0, RESTConnectionPool::ReusableConnection >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DoRequest_implActor, 1, Reference >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< DoRequest_implActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" +[[nodiscard]] Future> doRequest_impl( Reference const& client, std::string const& verb, HTTP::Headers const& headers, RESTUrl const& url, std::set const& successCodes ) { + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + return Future>(new DoRequest_implActor(client, verb, headers, url, successCodes)); + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" +} + +#line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + +Future> RESTClient::doPutOrPost(const std::string& verb, + Optional optHeaders, + RESTUrl& url, + std::set successCodes) { + HTTP::Headers headers; + if (optHeaders.present()) { + headers = optHeaders.get(); + } + + return doRequest_impl(Reference::addRef(this), verb, headers, url, successCodes); +} + +Future> RESTClient::doPost(const std::string& fullUrl, + const std::string& requestBody, + Optional optHeaders) { + RESTUrl url(fullUrl, requestBody); + TRACE_REST_OP("DoPost", url); + return doPutOrPost(HTTP::HTTP_VERB_POST, optHeaders, url, { HTTP::HTTP_STATUS_CODE_OK }); +} + +Future> RESTClient::doPut(const std::string& fullUrl, + const std::string& requestBody, + Optional optHeaders) { + RESTUrl url(fullUrl, requestBody); + TRACE_REST_OP("DoPut", url); + return doPutOrPost( + HTTP::HTTP_VERB_PUT, + optHeaders, + url, + // 201 - on successful resource create + // 200 / 204 - if target resource representation was successfully modified with the desired state + { HTTP::HTTP_STATUS_CODE_OK, HTTP::HTTP_STATUS_CODE_CREATED, HTTP::HTTP_STATUS_CODE_NO_CONTENT }); +} + +Future> RESTClient::doGetHeadDeleteOrTrace(const std::string& verb, + Optional optHeaders, + RESTUrl& url, + std::set successCodes) { + HTTP::Headers headers; + if (optHeaders.present()) { + headers = optHeaders.get(); + } + + return doRequest_impl(Reference::addRef(this), HTTP::HTTP_VERB_GET, headers, url, successCodes); +} + +Future> RESTClient::doGet(const std::string& fullUrl, + Optional optHeaders) { + RESTUrl url(fullUrl); + TRACE_REST_OP("DoGet", url); + return doGetHeadDeleteOrTrace(HTTP::HTTP_VERB_GET, optHeaders, url, { HTTP::HTTP_STATUS_CODE_OK }); +} + +Future> RESTClient::doHead(const std::string& fullUrl, + Optional optHeaders) { + RESTUrl url(fullUrl); + TRACE_REST_OP("DoHead", url); + return doGetHeadDeleteOrTrace(HTTP::HTTP_VERB_HEAD, optHeaders, url, { HTTP::HTTP_STATUS_CODE_OK }); +} + +Future> RESTClient::doDelete(const std::string& fullUrl, + Optional optHeaders) { + RESTUrl url(fullUrl); + TRACE_REST_OP("DoDelete", url); + return doGetHeadDeleteOrTrace( + HTTP::HTTP_VERB_DELETE, + optHeaders, + url, + // 200 - action has been enacted. + // 202 - action will likely succeed, but, has not yet been enacted. + // 204 - action has been enated, no further information is to supplied. + { HTTP::HTTP_STATUS_CODE_OK, HTTP::HTTP_STATUS_CODE_NO_CONTENT, HTTP::HTTP_STATUS_CODE_ACCEPTED }); +} + +Future> RESTClient::doTrace(const std::string& fullUrl, + Optional optHeaders) { + RESTUrl url(fullUrl); + TRACE_REST_OP("DoTrace", url); + return doGetHeadDeleteOrTrace(HTTP::HTTP_VERB_TRACE, optHeaders, url, { HTTP::HTTP_STATUS_CODE_OK }); +} + +// Only used to link unit tests +void forceLinkRESTClientTests() {} + + #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase354() + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" +template + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" +class FlowTestCase354ActorState { + #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" +public: + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + FlowTestCase354ActorState(UnitTestParameters const& params) + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + : params(params) + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase354", reinterpret_cast(this)); + + } + ~FlowTestCase354ActorState() + { + fdb_probe_actor_destroy("flowTestCase354", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + RESTClient r; + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + std::unordered_map knobs = r.getKnobs(); + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + ASSERT_EQ(knobs["connection_pool_size"], FLOW_KNOBS->RESTCLIENT_MAX_CONNECTIONPOOL_SIZE); + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + ASSERT_EQ(knobs["connect_tries"], FLOW_KNOBS->RESTCLIENT_CONNECT_TRIES); + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + ASSERT_EQ(knobs["connect_timeout"], FLOW_KNOBS->RESTCLIENT_CONNECT_TIMEOUT); + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + ASSERT_EQ(knobs["max_connection_life"], FLOW_KNOBS->RESTCLIENT_MAX_CONNECTION_LIFE); + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + ASSERT_EQ(knobs["request_tries"], FLOW_KNOBS->RESTCLIENT_REQUEST_TRIES); + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + ASSERT_EQ(knobs["request_timeout_secs"], FLOW_KNOBS->RESTCLIENT_REQUEST_TIMEOUT_SEC); + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + for( auto& itr : knobs ) { + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + itr.second++; + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + r.setKnobs(knobs); + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + std::unordered_map updated = r.getKnobs(); + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + for( auto& itr : updated ) { + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + ASSERT_EQ(knobs[itr.first], itr.second); + #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + knobs["foo"] = 100; + #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + try { + #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + r.setKnobs(knobs); + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + ASSERT(false); + #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + loopDepth = a_body1cont5(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase354ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase354ActorState(); static_cast(this)->destroy(); return 0; } + #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase354ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + if (e.code() != error_code_rest_invalid_rest_client_knob) + #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + { + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + } + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont5(int loopDepth) + { + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + UnitTestParameters params; + #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase354() + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" +class FlowTestCase354Actor final : public Actor, public FastAllocated, public FlowTestCase354ActorState { + #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + FlowTestCase354Actor(UnitTestParameters const& params) + #line 1052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" + : Actor(), + FlowTestCase354ActorState(params) + { + fdb_probe_actor_enter("flowTestCase354", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase354"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase354", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" +static Future flowTestCase354( UnitTestParameters const& params ) { + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" + return Future(new FlowTestCase354Actor(params)); + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase354, "fdbrpc/RESTClient") + +#line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTClient.actor.cpp" diff --git a/src/fdbclient/RESTUtils.actor.cpp b/src/fdbclient/RESTUtils.actor.cpp new file mode 100644 index 0000000..4255135 --- /dev/null +++ b/src/fdbclient/RESTUtils.actor.cpp @@ -0,0 +1,360 @@ +/* + * RESTUtils.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/RESTUtils.h" +#include "fdbclient/Knobs.h" + +#include "flow/flat_buffers.h" +#include "flow/UnitTest.h" +#include "flow/IConnection.h" + +#include +#include + +#include "flow/actorcompiler.h" // always the last include + +const std::unordered_map RESTConnectionType::supportedConnTypes = { + { "http", RESTConnectionType("http", RESTConnectionType::NOT_SECURE_CONNECTION) }, + { "https", RESTConnectionType("https", RESTConnectionType::SECURE_CONNECTION) } +}; + +RESTConnectionType RESTConnectionType::getConnectionType(const std::string& protocol) { + auto itr = RESTConnectionType::supportedConnTypes.find(protocol); + if (itr == RESTConnectionType::supportedConnTypes.end()) { + TraceEvent("RESTConnectionTypeUnsupportedPrototocol").detail("Protocol", protocol); + CODE_PROBE(true, "REST URI unsupported protocol"); + throw rest_unsupported_protocol(); + } + return itr->second; +} + +bool RESTConnectionType::isProtocolSupported(const std::string& protocol) { + auto itr = RESTConnectionType::supportedConnTypes.find(protocol); + return itr != RESTConnectionType::supportedConnTypes.end(); +} + +bool RESTConnectionType::isSecure(const std::string& protocol) { + auto itr = RESTConnectionType::supportedConnTypes.find(protocol); + if (itr == RESTConnectionType::supportedConnTypes.end()) { + TraceEvent("RESTConnectionTypeUnsupportedPrototocol").detail("Protocol", protocol); + throw rest_unsupported_protocol(); + } + return itr->second.secure == RESTConnectionType::SECURE_CONNECTION; +} + +RESTClientKnobs::RESTClientKnobs() { + connection_pool_size = FLOW_KNOBS->RESTCLIENT_MAX_CONNECTIONPOOL_SIZE; + connect_tries = FLOW_KNOBS->RESTCLIENT_CONNECT_TRIES; + connect_timeout = FLOW_KNOBS->RESTCLIENT_CONNECT_TIMEOUT; + max_connection_life = FLOW_KNOBS->RESTCLIENT_MAX_CONNECTION_LIFE; + request_tries = FLOW_KNOBS->RESTCLIENT_REQUEST_TRIES; + request_timeout_secs = FLOW_KNOBS->RESTCLIENT_REQUEST_TIMEOUT_SEC; + + knobMap["connection_pool_size"] = std::addressof(connection_pool_size); + knobMap["pz"] = std::addressof(connection_pool_size); + knobMap["connect_tries"] = std::addressof(connect_tries); + knobMap["ct"] = std::addressof(connect_tries); + knobMap["connect_timeout"] = std::addressof(connect_timeout); + knobMap["cto"] = std::addressof(connect_timeout); + knobMap["max_connection_life"] = std::addressof(max_connection_life); + knobMap["mcl"] = std::addressof(max_connection_life); + knobMap["request_tries"] = std::addressof(request_tries); + knobMap["rt"] = std::addressof(request_tries); + knobMap["request_timeout_secs"] = std::addressof(request_timeout_secs); + knobMap["rtom"] = std::addressof(request_timeout_secs); +} + +void RESTClientKnobs::set(const std::unordered_map& knobSettings) { + TraceEvent trace = TraceEvent("RESTClientSetKnobs"); + + for (const auto& itr : knobSettings) { + const auto& kItr = RESTClientKnobs::knobMap.find(itr.first); + if (kItr == RESTClientKnobs::knobMap.end()) { + trace.detail("RESTClientInvalidKnobName", itr.first); + throw rest_invalid_rest_client_knob(); + } + ASSERT_EQ(itr.first.compare(kItr->first), 0); + *(kItr->second) = itr.second; + trace.detail(itr.first.c_str(), itr.second); + } +} + +std::unordered_map RESTClientKnobs::get() const { + std::unordered_map details = { + { "connection_pool_size", connection_pool_size }, + { "connect_tries", connect_tries }, + { "connect_timeout", connect_timeout }, + { "max_connection_life", max_connection_life }, + { "request_tries", request_tries }, + { "request_timeout_secs", request_timeout_secs }, + }; + + return details; +} + +ACTOR Future connect_impl(Reference connectionPool, + RESTConnectionPoolKey connectKey, + bool isSecure, + int maxConnLife) { + + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::VERBOSE) { + TraceEvent("RESTUtilConnectStart") + .detail("Host", connectKey.first) + .detail("Service", connectKey.second) + .detail("IsSecure", isSecure) + .detail("ConnectPoolNumKeys", connectionPool->connectionPoolMap.size()); + } + + auto poolItr = connectionPool->connectionPoolMap.find(connectKey); + while (poolItr != connectionPool->connectionPoolMap.end() && !poolItr->second.empty()) { + RESTConnectionPool::ReusableConnection rconn = poolItr->second.front(); + poolItr->second.pop(); + + if (rconn.expirationTime > now()) { + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::DEBUG) { + TraceEvent("RESTUtilReuseConn") + .detail("Host", connectKey.first) + .detail("Service", connectKey.second) + .detail("RemoteEndpoint", rconn.conn->getPeerAddress()) + .detail("ExpireIn", rconn.expirationTime - now()) + .detail("NumConnsInPool", poolItr->second.size()); + } + return rconn; + } + } + + ASSERT(poolItr == connectionPool->connectionPoolMap.end() || poolItr->second.empty()); + + // No valid connection exists, create a new one + state Reference conn = + wait(INetworkConnections::net()->connect(connectKey.first, connectKey.second, isSecure)); + wait(conn->connectHandshake()); + + TraceEvent("RESTTUilCreateNewConn") + .suppressFor(60) + .detail("Host", connectKey.first) + .detail("Service", connectKey.second) + .detail("RemoteEndpoint", conn->getPeerAddress()) + .detail("ConnPoolSize", connectionPool->connectionPoolMap.size()); + + return RESTConnectionPool::ReusableConnection({ conn, now() + maxConnLife }); +} + +Future RESTConnectionPool::connect(RESTConnectionPoolKey connectKey, + const bool isSecure, + const int maxConnLife) { + return connect_impl(Reference::addRef(this), connectKey, isSecure, maxConnLife); +} + +void RESTConnectionPool::returnConnection(RESTConnectionPoolKey connectKey, + ReusableConnection& rconn, + const int maxConnections) { + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::VERBOSE) { + TraceEvent("RESTUtilReturnConnStart") + .detail("Host", connectKey.first) + .detail("Service", connectKey.second) + .detail("ConnectPoolNumKeys", connectionPoolMap.size()); + } + + auto poolItr = connectionPoolMap.find(connectKey); + // If it expires in the future then add it to the pool in the front iff connection pool size is not maxed + if (rconn.expirationTime > now()) { + bool returned = true; + if (poolItr == connectionPoolMap.end()) { + connectionPoolMap.insert({ connectKey, std::queue({ rconn }) }); + } else if (poolItr->second.size() < maxConnections) { + poolItr->second.push(rconn); + } else { + // Connection pool at its capacity; do nothing + returned = false; + } + + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::DEBUG && returned) { + poolItr = connectionPoolMap.find(connectKey); + TraceEvent("RESTUtilReturnConnToPool") + .detail("Host", connectKey.first) + .detail("Service", connectKey.second) + .detail("ConnPoolSize", connectionPoolMap.size()) + .detail("CachedConns", poolItr->second.size()) + .detail("TimeToExpire", rconn.expirationTime - now()); + } + } + rconn.conn = Reference(); +} + +RESTUrl::RESTUrl(const std::string& fUrl) { + parseUrl(fUrl); +} + +RESTUrl::RESTUrl(const std::string& fullUrl, const std::string& b) : body(b) { + parseUrl(fullUrl); +} + +void RESTUrl::parseUrl(const std::string& fullUrl) { + // Sample valid URIs + // 1. With 'host' & 'resource' := ':///' + // 2. With 'host', 'service' & 'resource' := '://:port/' + // 3. With 'host', 'service', 'resource' & 'reqParameters' := '://:port/?' + + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::VERBOSE) { + TraceEvent("RESTParseURI").detail("URI", fullUrl); + } + + try { + StringRef t(fullUrl); + StringRef p = t.eat("://"); + std::string protocol = p.toString(); + boost::algorithm::to_lower(protocol); + this->connType = RESTConnectionType::getConnectionType(protocol); + if (!this->connType.secure && !CLIENT_KNOBS->REST_KMS_ALLOW_NOT_SECURE_CONNECTION) { + TraceEvent(SevWarnAlways, "RESTUtilsUnSupportedNotSecureConn").detail("Protocol", protocol); + CODE_PROBE(true, "REST URI not-secure connection not supported"); + throw rest_unsupported_protocol(); + } + + // extract 'resource' and optional 'parameter list' if supplied in the URL + uint8_t foundSeparator = 0; + StringRef hostPort = t.eatAny("/?", &foundSeparator); + this->resource = "/"; + if (foundSeparator == '/') { + this->resource += t.eat("?").toString(); + this->reqParameters = t.eat().toString(); + } + + // hostPort is at least a host or IP address, optionally followed by :portNumber or :serviceName + StringRef hRef(hostPort); + StringRef h = hRef.eat(":"); + if (h.size() == 0) { + CODE_PROBE(true, "REST URI empty host"); + throw std::string("host cannot be empty"); + } + this->host = h.toString(); + this->service = hRef.eat().toString(); + + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::DEBUG) { + TraceEvent("RESTUtilParseURI") + .detail("URI", fullUrl) + .detail("Host", this->host) + .detail("Service", this->service) + .detail("Resource", this->resource) + .detail("ReqParameters", this->reqParameters) + .detail("ConnectionType", this->connType.toString()); + } + } catch (std::string& err) { + TraceEvent(SevWarnAlways, "RESTUtilParseError").detail("URI", fullUrl).detail("Error", err); + throw rest_invalid_uri(); + } +} + +// Only used to link unit tests +void forceLinkRESTUtilsTests() {} + +TEST_CASE("/RESTUtils/InvalidProtocol") { + try { + std::string uri("httpx://foo/bar"); + RESTUrl r(uri); + ASSERT(false); + } catch (Error& e) { + if (e.code() != error_code_rest_unsupported_protocol) { + throw e; + } + } + return Void(); +} + +TEST_CASE("/RESTUtils/MissingHost") { + try { + std::string uri("https://:/bar"); + RESTUrl r(uri); + ASSERT(false); + } catch (Error& e) { + if (e.code() != error_code_rest_invalid_uri) { + throw e; + } + } + return Void(); +} + +TEST_CASE("/RESTUtils/ValidURIWithService") { + std::string uri("https://host:80/foo/bar"); + RESTUrl r(uri); + ASSERT_EQ(r.connType.secure, RESTConnectionType::SECURE_CONNECTION); + ASSERT_EQ(r.host.compare("host"), 0); + ASSERT_EQ(r.service.compare("80"), 0); + ASSERT_EQ(r.resource.compare("/foo/bar"), 0); + return Void(); +} + +TEST_CASE("/RESTUtils/ValidURIWithoutService") { + std::string uri("https://host/foo/bar"); + RESTUrl r(uri); + ASSERT_EQ(r.connType.secure, RESTConnectionType::SECURE_CONNECTION); + ASSERT_EQ(r.host.compare("host"), 0); + ASSERT(r.service.empty()); + ASSERT_EQ(r.resource.compare("/foo/bar"), 0); + return Void(); +} + +TEST_CASE("/RESTUtils/ValidURIWithExtraForwardSlash") { + std::string uri("https://host//foo/bar"); + RESTUrl r(uri); + ASSERT_EQ(r.connType.secure, RESTConnectionType::SECURE_CONNECTION); + ASSERT_EQ(r.host.compare("host"), 0); + ASSERT(r.service.empty()); + ASSERT_EQ(r.resource.compare("//foo/bar"), 0); + return Void(); +} + +TEST_CASE("/RESTUtils/ValidURIWithParamsSecure") { + std::string uri("https://host/foo/bar?param1,param2"); + RESTUrl r(uri); + ASSERT_EQ(r.connType.secure, RESTConnectionType::SECURE_CONNECTION); + ASSERT_EQ(r.host.compare("host"), 0); + ASSERT(r.service.empty()); + ASSERT_EQ(r.resource.compare("/foo/bar"), 0); + ASSERT_EQ(r.reqParameters.compare("param1,param2"), 0); + return Void(); +} + +TEST_CASE("/RESTUtils/ValidURIWithParamsKnobNotEnabled") { + auto& g_knobs = IKnobCollection::getMutableGlobalKnobCollection(); + g_knobs.setKnob("rest_kms_allow_not_secure_connection", KnobValueRef::create(bool{ false })); + std::string uri("http://host/foo/bar?param1,param2"); + try { + RESTUrl r(uri); + ASSERT(false); + } catch (Error& e) { + ASSERT_EQ(e.code(), error_code_rest_unsupported_protocol); + } + return Void(); +} + +TEST_CASE("/RESTUtils/ValidURIWithParams") { + auto& g_knobs = IKnobCollection::getMutableGlobalKnobCollection(); + g_knobs.setKnob("rest_kms_allow_not_secure_connection", KnobValueRef::create(bool{ true })); + std::string uri("http://host/foo/bar?param1,param2"); + RESTUrl r(uri); + ASSERT_EQ(r.connType.secure, RESTConnectionType::NOT_SECURE_CONNECTION); + ASSERT_EQ(r.host.compare("host"), 0); + ASSERT(r.service.empty()); + ASSERT_EQ(r.resource.compare("/foo/bar"), 0); + ASSERT_EQ(r.reqParameters.compare("param1,param2"), 0); + return Void(); +} \ No newline at end of file diff --git a/src/fdbclient/RESTUtils.actor.g.cpp b/src/fdbclient/RESTUtils.actor.g.cpp new file mode 100644 index 0000000..50e92f2 --- /dev/null +++ b/src/fdbclient/RESTUtils.actor.g.cpp @@ -0,0 +1,1593 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +/* + * RESTUtils.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/RESTUtils.h" +#include "fdbclient/Knobs.h" + +#include "flow/flat_buffers.h" +#include "flow/UnitTest.h" +#include "flow/IConnection.h" + +#include +#include + +#include "flow/actorcompiler.h" // always the last include + +const std::unordered_map RESTConnectionType::supportedConnTypes = { + { "http", RESTConnectionType("http", RESTConnectionType::NOT_SECURE_CONNECTION) }, + { "https", RESTConnectionType("https", RESTConnectionType::SECURE_CONNECTION) } +}; + +RESTConnectionType RESTConnectionType::getConnectionType(const std::string& protocol) { + auto itr = RESTConnectionType::supportedConnTypes.find(protocol); + if (itr == RESTConnectionType::supportedConnTypes.end()) { + TraceEvent("RESTConnectionTypeUnsupportedPrototocol").detail("Protocol", protocol); + CODE_PROBE(true, "REST URI unsupported protocol"); + throw rest_unsupported_protocol(); + } + return itr->second; +} + +bool RESTConnectionType::isProtocolSupported(const std::string& protocol) { + auto itr = RESTConnectionType::supportedConnTypes.find(protocol); + return itr != RESTConnectionType::supportedConnTypes.end(); +} + +bool RESTConnectionType::isSecure(const std::string& protocol) { + auto itr = RESTConnectionType::supportedConnTypes.find(protocol); + if (itr == RESTConnectionType::supportedConnTypes.end()) { + TraceEvent("RESTConnectionTypeUnsupportedPrototocol").detail("Protocol", protocol); + throw rest_unsupported_protocol(); + } + return itr->second.secure == RESTConnectionType::SECURE_CONNECTION; +} + +RESTClientKnobs::RESTClientKnobs() { + connection_pool_size = FLOW_KNOBS->RESTCLIENT_MAX_CONNECTIONPOOL_SIZE; + connect_tries = FLOW_KNOBS->RESTCLIENT_CONNECT_TRIES; + connect_timeout = FLOW_KNOBS->RESTCLIENT_CONNECT_TIMEOUT; + max_connection_life = FLOW_KNOBS->RESTCLIENT_MAX_CONNECTION_LIFE; + request_tries = FLOW_KNOBS->RESTCLIENT_REQUEST_TRIES; + request_timeout_secs = FLOW_KNOBS->RESTCLIENT_REQUEST_TIMEOUT_SEC; + + knobMap["connection_pool_size"] = std::addressof(connection_pool_size); + knobMap["pz"] = std::addressof(connection_pool_size); + knobMap["connect_tries"] = std::addressof(connect_tries); + knobMap["ct"] = std::addressof(connect_tries); + knobMap["connect_timeout"] = std::addressof(connect_timeout); + knobMap["cto"] = std::addressof(connect_timeout); + knobMap["max_connection_life"] = std::addressof(max_connection_life); + knobMap["mcl"] = std::addressof(max_connection_life); + knobMap["request_tries"] = std::addressof(request_tries); + knobMap["rt"] = std::addressof(request_tries); + knobMap["request_timeout_secs"] = std::addressof(request_timeout_secs); + knobMap["rtom"] = std::addressof(request_timeout_secs); +} + +void RESTClientKnobs::set(const std::unordered_map& knobSettings) { + TraceEvent trace = TraceEvent("RESTClientSetKnobs"); + + for (const auto& itr : knobSettings) { + const auto& kItr = RESTClientKnobs::knobMap.find(itr.first); + if (kItr == RESTClientKnobs::knobMap.end()) { + trace.detail("RESTClientInvalidKnobName", itr.first); + throw rest_invalid_rest_client_knob(); + } + ASSERT_EQ(itr.first.compare(kItr->first), 0); + *(kItr->second) = itr.second; + trace.detail(itr.first.c_str(), itr.second); + } +} + +std::unordered_map RESTClientKnobs::get() const { + std::unordered_map details = { + { "connection_pool_size", connection_pool_size }, + { "connect_tries", connect_tries }, + { "connect_timeout", connect_timeout }, + { "max_connection_life", max_connection_life }, + { "request_tries", request_tries }, + { "request_timeout_secs", request_timeout_secs }, + }; + + return details; +} + + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via connect_impl() + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +template + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class Connect_implActorState { + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + Connect_implActorState(Reference const& connectionPool,RESTConnectionPoolKey const& connectKey,bool const& isSecure,int const& maxConnLife) + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + : connectionPool(connectionPool), + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + connectKey(connectKey), + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + isSecure(isSecure), + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + maxConnLife(maxConnLife) + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + { + fdb_probe_actor_create("connect_impl", reinterpret_cast(this)); + + } + ~Connect_implActorState() + { + fdb_probe_actor_destroy("connect_impl", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::VERBOSE) + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + { + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + TraceEvent("RESTUtilConnectStart") .detail("Host", connectKey.first) .detail("Service", connectKey.second) .detail("IsSecure", isSecure) .detail("ConnectPoolNumKeys", connectionPool->connectionPoolMap.size()); + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + } + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + auto poolItr = connectionPool->connectionPoolMap.find(connectKey); + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + for(;poolItr != connectionPool->connectionPoolMap.end() && !poolItr->second.empty();) { + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + RESTConnectionPool::ReusableConnection rconn = poolItr->second.front(); + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + poolItr->second.pop(); + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (rconn.expirationTime > now()) + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + { + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::DEBUG) + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + { + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + TraceEvent("RESTUtilReuseConn") .detail("Host", connectKey.first) .detail("Service", connectKey.second) .detail("RemoteEndpoint", rconn.conn->getPeerAddress()) .detail("ExpireIn", rconn.expirationTime - now()) .detail("NumConnsInPool", poolItr->second.size()); + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + } + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(rconn); this->~Connect_implActorState(); static_cast(this)->destroy(); return 0; } + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + new (&static_cast(this)->SAV< RESTConnectionPool::ReusableConnection >::value()) RESTConnectionPool::ReusableConnection(rconn); + this->~Connect_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT(poolItr == connectionPool->connectionPoolMap.end() || poolItr->second.empty()); + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + StrictFuture> __when_expr_0 = INetworkConnections::net()->connect(connectKey.first, connectKey.second, isSecure); + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~Connect_implActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + StrictFuture __when_expr_1 = conn->connectHandshake(); + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Reference const& __conn,int loopDepth) + { + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + conn = __conn; + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Reference && __conn,int loopDepth) + { + conn = std::move(__conn); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< Connect_implActor, 0, Reference >::remove(); + + } + void a_callback_fire(ActorCallback< Connect_implActor, 0, Reference >*,Reference const& value) + { + fdb_probe_actor_enter("connect_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("connect_impl", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< Connect_implActor, 0, Reference >*,Reference && value) + { + fdb_probe_actor_enter("connect_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("connect_impl", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< Connect_implActor, 0, Reference >*,Error err) + { + fdb_probe_actor_enter("connect_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("connect_impl", reinterpret_cast(this), 0); + + } + int a_body1cont6(Void const& _,int loopDepth) + { + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + TraceEvent("RESTTUilCreateNewConn") .suppressFor(60) .detail("Host", connectKey.first) .detail("Service", connectKey.second) .detail("RemoteEndpoint", conn->getPeerAddress()) .detail("ConnPoolSize", connectionPool->connectionPoolMap.size()); + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(RESTConnectionPool::ReusableConnection({ conn, now() + maxConnLife })); this->~Connect_implActorState(); static_cast(this)->destroy(); return 0; } + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + new (&static_cast(this)->SAV< RESTConnectionPool::ReusableConnection >::value()) RESTConnectionPool::ReusableConnection(RESTConnectionPool::ReusableConnection({ conn, now() + maxConnLife })); + this->~Connect_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont6(Void && _,int loopDepth) + { + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + TraceEvent("RESTTUilCreateNewConn") .suppressFor(60) .detail("Host", connectKey.first) .detail("Service", connectKey.second) .detail("RemoteEndpoint", conn->getPeerAddress()) .detail("ConnPoolSize", connectionPool->connectionPoolMap.size()); + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(RESTConnectionPool::ReusableConnection({ conn, now() + maxConnLife })); this->~Connect_implActorState(); static_cast(this)->destroy(); return 0; } + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + new (&static_cast(this)->SAV< RESTConnectionPool::ReusableConnection >::value()) RESTConnectionPool::ReusableConnection(RESTConnectionPool::ReusableConnection({ conn, now() + maxConnLife })); + this->~Connect_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont6(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont6(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< Connect_implActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< Connect_implActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("connect_impl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("connect_impl", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< Connect_implActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("connect_impl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("connect_impl", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< Connect_implActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("connect_impl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("connect_impl", reinterpret_cast(this), 1); + + } + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + Reference connectionPool; + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + RESTConnectionPoolKey connectKey; + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + bool isSecure; + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + int maxConnLife; + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + Reference conn; + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +}; +// This generated class is to be used only via connect_impl() + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class Connect_implActor final : public Actor, public ActorCallback< Connect_implActor, 0, Reference >, public ActorCallback< Connect_implActor, 1, Void >, public FastAllocated, public Connect_implActorState { + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< Connect_implActor, 0, Reference >; +friend struct ActorCallback< Connect_implActor, 1, Void >; + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + Connect_implActor(Reference const& connectionPool,RESTConnectionPoolKey const& connectKey,bool const& isSecure,int const& maxConnLife) + #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + : Actor(), + Connect_implActorState(connectionPool, connectKey, isSecure, maxConnLife) + { + fdb_probe_actor_enter("connect_impl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("connect_impl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("connect_impl", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< Connect_implActor, 0, Reference >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< Connect_implActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +[[nodiscard]] Future connect_impl( Reference const& connectionPool, RESTConnectionPoolKey const& connectKey, bool const& isSecure, int const& maxConnLife ) { + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + return Future(new Connect_implActor(connectionPool, connectKey, isSecure, maxConnLife)); + #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +} + +#line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + +Future RESTConnectionPool::connect(RESTConnectionPoolKey connectKey, + const bool isSecure, + const int maxConnLife) { + return connect_impl(Reference::addRef(this), connectKey, isSecure, maxConnLife); +} + +void RESTConnectionPool::returnConnection(RESTConnectionPoolKey connectKey, + ReusableConnection& rconn, + const int maxConnections) { + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::VERBOSE) { + TraceEvent("RESTUtilReturnConnStart") + .detail("Host", connectKey.first) + .detail("Service", connectKey.second) + .detail("ConnectPoolNumKeys", connectionPoolMap.size()); + } + + auto poolItr = connectionPoolMap.find(connectKey); + // If it expires in the future then add it to the pool in the front iff connection pool size is not maxed + if (rconn.expirationTime > now()) { + bool returned = true; + if (poolItr == connectionPoolMap.end()) { + connectionPoolMap.insert({ connectKey, std::queue({ rconn }) }); + } else if (poolItr->second.size() < maxConnections) { + poolItr->second.push(rconn); + } else { + // Connection pool at its capacity; do nothing + returned = false; + } + + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::DEBUG && returned) { + poolItr = connectionPoolMap.find(connectKey); + TraceEvent("RESTUtilReturnConnToPool") + .detail("Host", connectKey.first) + .detail("Service", connectKey.second) + .detail("ConnPoolSize", connectionPoolMap.size()) + .detail("CachedConns", poolItr->second.size()) + .detail("TimeToExpire", rconn.expirationTime - now()); + } + } + rconn.conn = Reference(); +} + +RESTUrl::RESTUrl(const std::string& fUrl) { + parseUrl(fUrl); +} + +RESTUrl::RESTUrl(const std::string& fullUrl, const std::string& b) : body(b) { + parseUrl(fullUrl); +} + +void RESTUrl::parseUrl(const std::string& fullUrl) { + // Sample valid URIs + // 1. With 'host' & 'resource' := ':///' + // 2. With 'host', 'service' & 'resource' := '://:port/' + // 3. With 'host', 'service', 'resource' & 'reqParameters' := '://:port/?' + + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::VERBOSE) { + TraceEvent("RESTParseURI").detail("URI", fullUrl); + } + + try { + StringRef t(fullUrl); + StringRef p = t.eat("://"); + std::string protocol = p.toString(); + boost::algorithm::to_lower(protocol); + this->connType = RESTConnectionType::getConnectionType(protocol); + if (!this->connType.secure && !CLIENT_KNOBS->REST_KMS_ALLOW_NOT_SECURE_CONNECTION) { + TraceEvent(SevWarnAlways, "RESTUtilsUnSupportedNotSecureConn").detail("Protocol", protocol); + CODE_PROBE(true, "REST URI not-secure connection not supported"); + throw rest_unsupported_protocol(); + } + + // extract 'resource' and optional 'parameter list' if supplied in the URL + uint8_t foundSeparator = 0; + StringRef hostPort = t.eatAny("/?", &foundSeparator); + this->resource = "/"; + if (foundSeparator == '/') { + this->resource += t.eat("?").toString(); + this->reqParameters = t.eat().toString(); + } + + // hostPort is at least a host or IP address, optionally followed by :portNumber or :serviceName + StringRef hRef(hostPort); + StringRef h = hRef.eat(":"); + if (h.size() == 0) { + CODE_PROBE(true, "REST URI empty host"); + throw std::string("host cannot be empty"); + } + this->host = h.toString(); + this->service = hRef.eat().toString(); + + if (FLOW_KNOBS->REST_LOG_LEVEL >= RESTLogSeverity::DEBUG) { + TraceEvent("RESTUtilParseURI") + .detail("URI", fullUrl) + .detail("Host", this->host) + .detail("Service", this->service) + .detail("Resource", this->resource) + .detail("ReqParameters", this->reqParameters) + .detail("ConnectionType", this->connType.toString()); + } + } catch (std::string& err) { + TraceEvent(SevWarnAlways, "RESTUtilParseError").detail("URI", fullUrl).detail("Error", err); + throw rest_invalid_uri(); + } +} + +// Only used to link unit tests +void forceLinkRESTUtilsTests() {} + + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase269() + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +template + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase269ActorState { + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase269ActorState(UnitTestParameters const& params) + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + : params(params) + #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase269", reinterpret_cast(this)); + + } + ~FlowTestCase269ActorState() + { + fdb_probe_actor_destroy("flowTestCase269", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + try { + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + std::string uri("httpx://foo/bar"); + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + RESTUrl r(uri); + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT(false); + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + loopDepth = a_body1cont3(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase269ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase269ActorState(); static_cast(this)->destroy(); return 0; } + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase269ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (e.code() != error_code_rest_unsupported_protocol) + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + { + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + } + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3(int loopDepth) + { + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + UnitTestParameters params; + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase269() + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase269Actor final : public Actor, public FastAllocated, public FlowTestCase269ActorState { + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase269Actor(UnitTestParameters const& params) + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + : Actor(), + FlowTestCase269ActorState(params) + { + fdb_probe_actor_enter("flowTestCase269", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase269"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase269", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +static Future flowTestCase269( UnitTestParameters const& params ) { + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + return Future(new FlowTestCase269Actor(params)); + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase269, "/RESTUtils/InvalidProtocol") + +#line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase282() + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +template + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase282ActorState { + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase282ActorState(UnitTestParameters const& params) + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + : params(params) + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase282", reinterpret_cast(this)); + + } + ~FlowTestCase282ActorState() + { + fdb_probe_actor_destroy("flowTestCase282", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + try { + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + std::string uri("https://:/bar"); + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + RESTUrl r(uri); + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT(false); + #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + loopDepth = a_body1cont3(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase282ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase282ActorState(); static_cast(this)->destroy(); return 0; } + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase282ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (e.code() != error_code_rest_invalid_uri) + #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + { + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + } + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3(int loopDepth) + { + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + UnitTestParameters params; + #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase282() + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase282Actor final : public Actor, public FastAllocated, public FlowTestCase282ActorState { + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase282Actor(UnitTestParameters const& params) + #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + : Actor(), + FlowTestCase282ActorState(params) + { + fdb_probe_actor_enter("flowTestCase282", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase282"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase282", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +static Future flowTestCase282( UnitTestParameters const& params ) { + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + return Future(new FlowTestCase282Actor(params)); + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase282, "/RESTUtils/MissingHost") + +#line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + + #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase295() + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +template + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase295ActorState { + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase295ActorState(UnitTestParameters const& params) + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + : params(params) + #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase295", reinterpret_cast(this)); + + } + ~FlowTestCase295ActorState() + { + fdb_probe_actor_destroy("flowTestCase295", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + std::string uri("https://host:80/foo/bar"); + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + RESTUrl r(uri); + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.connType.secure, RESTConnectionType::SECURE_CONNECTION); + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.host.compare("host"), 0); + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.service.compare("80"), 0); + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.resource.compare("/foo/bar"), 0); + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase295ActorState(); static_cast(this)->destroy(); return 0; } + #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase295ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase295ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + UnitTestParameters params; + #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase295() + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase295Actor final : public Actor, public FastAllocated, public FlowTestCase295ActorState { + #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase295Actor(UnitTestParameters const& params) + #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + : Actor(), + FlowTestCase295ActorState(params) + { + fdb_probe_actor_enter("flowTestCase295", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase295"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase295", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +static Future flowTestCase295( UnitTestParameters const& params ) { + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + return Future(new FlowTestCase295Actor(params)); + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase295, "/RESTUtils/ValidURIWithService") + +#line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + + #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase305() + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +template + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase305ActorState { + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase305ActorState(UnitTestParameters const& params) + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + : params(params) + #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase305", reinterpret_cast(this)); + + } + ~FlowTestCase305ActorState() + { + fdb_probe_actor_destroy("flowTestCase305", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + std::string uri("https://host/foo/bar"); + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + RESTUrl r(uri); + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.connType.secure, RESTConnectionType::SECURE_CONNECTION); + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.host.compare("host"), 0); + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT(r.service.empty()); + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.resource.compare("/foo/bar"), 0); + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase305ActorState(); static_cast(this)->destroy(); return 0; } + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase305ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase305ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + UnitTestParameters params; + #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase305() + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase305Actor final : public Actor, public FastAllocated, public FlowTestCase305ActorState { + #line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase305Actor(UnitTestParameters const& params) + #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + : Actor(), + FlowTestCase305ActorState(params) + { + fdb_probe_actor_enter("flowTestCase305", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase305"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase305", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +static Future flowTestCase305( UnitTestParameters const& params ) { + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + return Future(new FlowTestCase305Actor(params)); + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase305, "/RESTUtils/ValidURIWithoutService") + +#line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase315() + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +template + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase315ActorState { + #line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase315ActorState(UnitTestParameters const& params) + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + : params(params) + #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase315", reinterpret_cast(this)); + + } + ~FlowTestCase315ActorState() + { + fdb_probe_actor_destroy("flowTestCase315", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + std::string uri("https://host//foo/bar"); + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + RESTUrl r(uri); + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.connType.secure, RESTConnectionType::SECURE_CONNECTION); + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.host.compare("host"), 0); + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT(r.service.empty()); + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.resource.compare("//foo/bar"), 0); + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase315ActorState(); static_cast(this)->destroy(); return 0; } + #line 1135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase315ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase315ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + UnitTestParameters params; + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase315() + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase315Actor final : public Actor, public FastAllocated, public FlowTestCase315ActorState { + #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase315Actor(UnitTestParameters const& params) + #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + : Actor(), + FlowTestCase315ActorState(params) + { + fdb_probe_actor_enter("flowTestCase315", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase315"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase315", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +static Future flowTestCase315( UnitTestParameters const& params ) { + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + return Future(new FlowTestCase315Actor(params)); + #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase315, "/RESTUtils/ValidURIWithExtraForwardSlash") + +#line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase325() + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +template + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase325ActorState { + #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase325ActorState(UnitTestParameters const& params) + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + : params(params) + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase325", reinterpret_cast(this)); + + } + ~FlowTestCase325ActorState() + { + fdb_probe_actor_destroy("flowTestCase325", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + std::string uri("https://host/foo/bar?param1,param2"); + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + RESTUrl r(uri); + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.connType.secure, RESTConnectionType::SECURE_CONNECTION); + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.host.compare("host"), 0); + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT(r.service.empty()); + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.resource.compare("/foo/bar"), 0); + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.reqParameters.compare("param1,param2"), 0); + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase325ActorState(); static_cast(this)->destroy(); return 0; } + #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase325ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase325ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + UnitTestParameters params; + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase325() + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase325Actor final : public Actor, public FastAllocated, public FlowTestCase325ActorState { + #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase325Actor(UnitTestParameters const& params) + #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + : Actor(), + FlowTestCase325ActorState(params) + { + fdb_probe_actor_enter("flowTestCase325", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase325"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase325", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +static Future flowTestCase325( UnitTestParameters const& params ) { + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + return Future(new FlowTestCase325Actor(params)); + #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase325, "/RESTUtils/ValidURIWithParamsSecure") + +#line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase336() + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +template + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase336ActorState { + #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase336ActorState(UnitTestParameters const& params) + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + : params(params) + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase336", reinterpret_cast(this)); + + } + ~FlowTestCase336ActorState() + { + fdb_probe_actor_destroy("flowTestCase336", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + auto& g_knobs = IKnobCollection::getMutableGlobalKnobCollection(); + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + g_knobs.setKnob("rest_kms_allow_not_secure_connection", KnobValueRef::create(bool{ false })); + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + std::string uri("http://host/foo/bar?param1,param2"); + #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + try { + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + RESTUrl r(uri); + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT(false); + #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + loopDepth = a_body1cont3(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase336ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase336ActorState(); static_cast(this)->destroy(); return 0; } + #line 1390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase336ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(e.code(), error_code_rest_unsupported_protocol); + #line 1403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3(int loopDepth) + { + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + UnitTestParameters params; + #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase336() + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase336Actor final : public Actor, public FastAllocated, public FlowTestCase336ActorState { + #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase336Actor(UnitTestParameters const& params) + #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + : Actor(), + FlowTestCase336ActorState(params) + { + fdb_probe_actor_enter("flowTestCase336", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase336"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase336", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +static Future flowTestCase336( UnitTestParameters const& params ) { + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + return Future(new FlowTestCase336Actor(params)); + #line 1471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase336, "/RESTUtils/ValidURIWithParamsKnobNotEnabled") + +#line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + + #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase349() + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +template + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase349ActorState { + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase349ActorState(UnitTestParameters const& params) + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + : params(params) + #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase349", reinterpret_cast(this)); + + } + ~FlowTestCase349ActorState() + { + fdb_probe_actor_destroy("flowTestCase349", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + auto& g_knobs = IKnobCollection::getMutableGlobalKnobCollection(); + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + g_knobs.setKnob("rest_kms_allow_not_secure_connection", KnobValueRef::create(bool{ true })); + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + std::string uri("http://host/foo/bar?param1,param2"); + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + RESTUrl r(uri); + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.connType.secure, RESTConnectionType::NOT_SECURE_CONNECTION); + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.host.compare("host"), 0); + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT(r.service.empty()); + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.resource.compare("/foo/bar"), 0); + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + ASSERT_EQ(r.reqParameters.compare("param1,param2"), 0); + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase349ActorState(); static_cast(this)->destroy(); return 0; } + #line 1524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase349ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase349ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + UnitTestParameters params; + #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase349() + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +class FlowTestCase349Actor final : public Actor, public FastAllocated, public FlowTestCase349ActorState { + #line 1553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + FlowTestCase349Actor(UnitTestParameters const& params) + #line 1563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" + : Actor(), + FlowTestCase349ActorState(params) + { + fdb_probe_actor_enter("flowTestCase349", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase349"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase349", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" +static Future flowTestCase349( UnitTestParameters const& params ) { + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.cpp" + return Future(new FlowTestCase349Actor(params)); + #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RESTUtils.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase349, "/RESTUtils/ValidURIWithParams") + diff --git a/src/fdbclient/RYWIterator.cpp b/src/fdbclient/RYWIterator.cpp index 949f164..3966df3 100644 --- a/src/fdbclient/RYWIterator.cpp +++ b/src/fdbclient/RYWIterator.cpp @@ -231,28 +231,28 @@ void testSnapshotCache() { WriteMap writes(&arena); Standalone> keys; - keys.push_back_deep(keys.arena(), KeyValueRef(LiteralStringRef("d"), LiteralStringRef("doo"))); - keys.push_back_deep(keys.arena(), KeyValueRef(LiteralStringRef("e"), LiteralStringRef("eoo"))); - keys.push_back_deep(keys.arena(), KeyValueRef(LiteralStringRef("e\x00"), LiteralStringRef("zoo"))); - keys.push_back_deep(keys.arena(), KeyValueRef(LiteralStringRef("f"), LiteralStringRef("foo"))); - cache.insert(KeyRangeRef(LiteralStringRef("d"), LiteralStringRef("f\x00")), keys); + keys.push_back_deep(keys.arena(), KeyValueRef("d"_sr, "doo"_sr)); + keys.push_back_deep(keys.arena(), KeyValueRef("e"_sr, "eoo"_sr)); + keys.push_back_deep(keys.arena(), KeyValueRef("e\x00"_sr, "zoo"_sr)); + keys.push_back_deep(keys.arena(), KeyValueRef("f"_sr, "foo"_sr)); + cache.insert(KeyRangeRef("d"_sr, "f\x00"_sr), keys); - cache.insert(KeyRangeRef(LiteralStringRef("g"), LiteralStringRef("h")), Standalone>()); + cache.insert(KeyRangeRef("g"_sr, "h"_sr), Standalone>()); Standalone> keys2; - keys2.push_back_deep(keys2.arena(), KeyValueRef(LiteralStringRef("k"), LiteralStringRef("koo"))); - keys2.push_back_deep(keys2.arena(), KeyValueRef(LiteralStringRef("l"), LiteralStringRef("loo"))); - cache.insert(KeyRangeRef(LiteralStringRef("j"), LiteralStringRef("m")), keys2); + keys2.push_back_deep(keys2.arena(), KeyValueRef("k"_sr, "koo"_sr)); + keys2.push_back_deep(keys2.arena(), KeyValueRef("l"_sr, "loo"_sr)); + cache.insert(KeyRangeRef("j"_sr, "m"_sr), keys2); - writes.mutate(LiteralStringRef("c"), MutationRef::SetValue, LiteralStringRef("c--"), true); - writes.clear(KeyRangeRef(LiteralStringRef("c\x00"), LiteralStringRef("e")), true); - writes.mutate(LiteralStringRef("c\x00"), MutationRef::SetValue, LiteralStringRef("c00--"), true); + writes.mutate("c"_sr, MutationRef::SetValue, "c--"_sr, true); + writes.clear(KeyRangeRef("c\x00"_sr, "e"_sr), true); + writes.mutate("c\x00"_sr, MutationRef::SetValue, "c00--"_sr, true); WriteMap::iterator it3(&writes); - writes.mutate(LiteralStringRef("d"), MutationRef::SetValue, LiteralStringRef("d--"), true); - writes.mutate(LiteralStringRef("e"), MutationRef::SetValue, LiteralStringRef("e++"), true); - writes.mutate(LiteralStringRef("i"), MutationRef::SetValue, LiteralStringRef("i--"), true); + writes.mutate("d"_sr, MutationRef::SetValue, "d--"_sr, true); + writes.mutate("e"_sr, MutationRef::SetValue, "e++"_sr, true); + writes.mutate("i"_sr, MutationRef::SetValue, "i--"_sr, true); - KeyRange searchKeys = KeyRangeRef(LiteralStringRef("a"), LiteralStringRef("z")); + KeyRange searchKeys = KeyRangeRef("a"_sr, "z"_sr); RYWIterator it(&cache, &writes); it.skip(searchKeys.begin); @@ -425,7 +425,7 @@ TEST_CASE("/fdbclient/WriteMap/emptiness") { Arena arena = Arena(); WriteMap writes = WriteMap(&arena); ASSERT(writes.empty()); - writes.mutate(LiteralStringRef("apple"), MutationRef::SetValue, LiteralStringRef("red"), true); + writes.mutate("apple"_sr, MutationRef::SetValue, "red"_sr, true); ASSERT(!writes.empty()); return Void(); } @@ -457,11 +457,11 @@ TEST_CASE("/fdbclient/WriteMap/clear") { ASSERT(writes.empty()); ASSERT(getWriteMapCount(&writes) == 1); - writes.mutate(LiteralStringRef("apple"), MutationRef::SetValue, LiteralStringRef("red"), true); + writes.mutate("apple"_sr, MutationRef::SetValue, "red"_sr, true); ASSERT(!writes.empty()); ASSERT(getWriteMapCount(&writes) == 3); - KeyRangeRef range = KeyRangeRef(LiteralStringRef("a"), LiteralStringRef("j")); + KeyRangeRef range = KeyRangeRef("a"_sr, "j"_sr); writes.clear(range, true); ASSERT(getWriteMapCount(&writes) == 3); @@ -474,22 +474,19 @@ TEST_CASE("/fdbclient/WriteMap/setVersionstampedKey") { ASSERT(writes.empty()); ASSERT(getWriteMapCount(&writes) == 1); - writes.mutate(LiteralStringRef("stamp:XXXXXXXX\x06\x00\x00\x00"), - MutationRef::SetVersionstampedKey, - LiteralStringRef("1"), - true); + writes.mutate("stamp:XXXXXXXX\x06\x00\x00\x00"_sr, MutationRef::SetVersionstampedKey, "1"_sr, true); ASSERT(!writes.empty()); ASSERT(getWriteMapCount(&writes) == 3); - writes.mutate(LiteralStringRef("stamp:ZZZZZZZZZZ"), MutationRef::AddValue, LiteralStringRef("2"), true); + writes.mutate("stamp:ZZZZZZZZZZ"_sr, MutationRef::AddValue, "2"_sr, true); ASSERT(getWriteMapCount(&writes) == 5); WriteMap::iterator it(&writes); it.skip(allKeys.begin); ASSERT(it.beginKey() < allKeys.end); - ASSERT(it.beginKey().compare(LiteralStringRef("")) == 0); - ASSERT(it.endKey().compare(LiteralStringRef("stamp:XXXXXXXX\x06\x00\x00\x00")) == 0); + ASSERT(it.beginKey().compare(""_sr) == 0); + ASSERT(it.endKey().compare("stamp:XXXXXXXX\x06\x00\x00\x00"_sr) == 0); ASSERT(!it.is_cleared_range()); ASSERT(!it.is_conflict_range()); ASSERT(!it.is_operation()); @@ -498,8 +495,8 @@ TEST_CASE("/fdbclient/WriteMap/setVersionstampedKey") { ++it; ASSERT(it.beginKey() < allKeys.end); - ASSERT(it.beginKey().compare(LiteralStringRef("stamp:XXXXXXXX\x06\x00\x00\x00")) == 0); - ASSERT(it.endKey().compare(LiteralStringRef("stamp:XXXXXXXX\x06\x00\x00\x00\x00")) == 0); + ASSERT(it.beginKey().compare("stamp:XXXXXXXX\x06\x00\x00\x00"_sr) == 0); + ASSERT(it.endKey().compare("stamp:XXXXXXXX\x06\x00\x00\x00\x00"_sr) == 0); ASSERT(!it.is_cleared_range()); ASSERT(it.is_conflict_range()); ASSERT(it.is_operation()); @@ -509,8 +506,8 @@ TEST_CASE("/fdbclient/WriteMap/setVersionstampedKey") { ++it; ASSERT(it.beginKey() < allKeys.end); - ASSERT(it.beginKey().compare(LiteralStringRef("stamp:XXXXXXXX\x06\x00\x00\x00\x00")) == 0); - ASSERT(it.endKey().compare(LiteralStringRef("stamp:ZZZZZZZZZZ")) == 0); + ASSERT(it.beginKey().compare("stamp:XXXXXXXX\x06\x00\x00\x00\x00"_sr) == 0); + ASSERT(it.endKey().compare("stamp:ZZZZZZZZZZ"_sr) == 0); ASSERT(!it.is_cleared_range()); ASSERT(!it.is_conflict_range()); ASSERT(!it.is_operation()); @@ -519,8 +516,8 @@ TEST_CASE("/fdbclient/WriteMap/setVersionstampedKey") { ++it; ASSERT(it.beginKey() < allKeys.end); - ASSERT(it.beginKey().compare(LiteralStringRef("stamp:ZZZZZZZZZZ")) == 0); - ASSERT(it.endKey().compare(LiteralStringRef("stamp:ZZZZZZZZZZ\x00")) == 0); + ASSERT(it.beginKey().compare("stamp:ZZZZZZZZZZ"_sr) == 0); + ASSERT(it.endKey().compare("stamp:ZZZZZZZZZZ\x00"_sr) == 0); ASSERT(!it.is_cleared_range()); ASSERT(it.is_conflict_range()); ASSERT(it.is_operation()); @@ -530,8 +527,8 @@ TEST_CASE("/fdbclient/WriteMap/setVersionstampedKey") { ++it; ASSERT(it.beginKey() < allKeys.end); - ASSERT(it.beginKey().compare(LiteralStringRef("stamp:ZZZZZZZZZZ\x00")) == 0); - ASSERT(it.endKey().compare(LiteralStringRef("\xff\xff")) == 0); + ASSERT(it.beginKey().compare("stamp:ZZZZZZZZZZ\x00"_sr) == 0); + ASSERT(it.endKey().compare("\xff\xff"_sr) == 0); ASSERT(!it.is_cleared_range()); ASSERT(!it.is_conflict_range()); ASSERT(!it.is_operation()); @@ -550,22 +547,19 @@ TEST_CASE("/fdbclient/WriteMap/setVersionstampedValue") { ASSERT(writes.empty()); ASSERT(getWriteMapCount(&writes) == 1); - writes.mutate(LiteralStringRef("stamp"), - MutationRef::SetVersionstampedValue, - LiteralStringRef("XXXXXXXX\x00\x00\x00\x00\x00\x00"), - true); + writes.mutate("stamp"_sr, MutationRef::SetVersionstampedValue, "XXXXXXXX\x00\x00\x00\x00\x00\x00"_sr, true); ASSERT(!writes.empty()); ASSERT(getWriteMapCount(&writes) == 3); - writes.mutate(LiteralStringRef("stamp123"), MutationRef::AddValue, LiteralStringRef("1"), true); + writes.mutate("stamp123"_sr, MutationRef::AddValue, "1"_sr, true); ASSERT(getWriteMapCount(&writes) == 5); WriteMap::iterator it(&writes); it.skip(allKeys.begin); ASSERT(it.beginKey() < allKeys.end); - ASSERT(it.beginKey().compare(LiteralStringRef("")) == 0); - ASSERT(it.endKey().compare(LiteralStringRef("stamp")) == 0); + ASSERT(it.beginKey().compare(""_sr) == 0); + ASSERT(it.endKey().compare("stamp"_sr) == 0); ASSERT(!it.is_cleared_range()); ASSERT(!it.is_conflict_range()); ASSERT(!it.is_operation()); @@ -574,8 +568,8 @@ TEST_CASE("/fdbclient/WriteMap/setVersionstampedValue") { ++it; ASSERT(it.beginKey() < allKeys.end); - ASSERT(it.beginKey().compare(LiteralStringRef("stamp")) == 0); - ASSERT(it.endKey().compare(LiteralStringRef("stamp\x00")) == 0); + ASSERT(it.beginKey().compare("stamp"_sr) == 0); + ASSERT(it.endKey().compare("stamp\x00"_sr) == 0); ASSERT(!it.is_cleared_range()); ASSERT(it.is_conflict_range()); ASSERT(it.is_operation()); @@ -585,8 +579,8 @@ TEST_CASE("/fdbclient/WriteMap/setVersionstampedValue") { ++it; ASSERT(it.beginKey() < allKeys.end); - ASSERT(it.beginKey().compare(LiteralStringRef("stamp\x00")) == 0); - ASSERT(it.endKey().compare(LiteralStringRef("stamp123")) == 0); + ASSERT(it.beginKey().compare("stamp\x00"_sr) == 0); + ASSERT(it.endKey().compare("stamp123"_sr) == 0); ASSERT(!it.is_cleared_range()); ASSERT(!it.is_conflict_range()); ASSERT(!it.is_operation()); @@ -595,8 +589,8 @@ TEST_CASE("/fdbclient/WriteMap/setVersionstampedValue") { ++it; ASSERT(it.beginKey() < allKeys.end); - ASSERT(it.beginKey().compare(LiteralStringRef("stamp123")) == 0); - ASSERT(it.endKey().compare(LiteralStringRef("stamp123\x00")) == 0); + ASSERT(it.beginKey().compare("stamp123"_sr) == 0); + ASSERT(it.endKey().compare("stamp123\x00"_sr) == 0); ASSERT(!it.is_cleared_range()); ASSERT(it.is_conflict_range()); ASSERT(it.is_operation()); @@ -606,8 +600,8 @@ TEST_CASE("/fdbclient/WriteMap/setVersionstampedValue") { ++it; ASSERT(it.beginKey() < allKeys.end); - ASSERT(it.beginKey().compare(LiteralStringRef("stamp123\x00")) == 0); - ASSERT(it.endKey().compare(LiteralStringRef("\xff\xff")) == 0); + ASSERT(it.beginKey().compare("stamp123\x00"_sr) == 0); + ASSERT(it.endKey().compare("\xff\xff"_sr) == 0); ASSERT(!it.is_cleared_range()); ASSERT(!it.is_conflict_range()); ASSERT(!it.is_operation()); @@ -626,10 +620,10 @@ TEST_CASE("/fdbclient/WriteMap/addValue") { ASSERT(writes.empty()); ASSERT(getWriteMapCount(&writes) == 1); - writes.mutate(LiteralStringRef("apple123"), MutationRef::SetValue, LiteralStringRef("17"), true); + writes.mutate("apple123"_sr, MutationRef::SetValue, "17"_sr, true); ASSERT(getWriteMapCount(&writes) == 3); - writes.mutate(LiteralStringRef("apple123"), MutationRef::AddValue, LiteralStringRef("1"), true); + writes.mutate("apple123"_sr, MutationRef::AddValue, "1"_sr, true); ASSERT(getWriteMapCount(&writes) == 3); return Void(); diff --git a/src/fdbclient/RandomKeyValueUtils.cpp b/src/fdbclient/RandomKeyValueUtils.cpp new file mode 100644 index 0000000..a50cbcd --- /dev/null +++ b/src/fdbclient/RandomKeyValueUtils.cpp @@ -0,0 +1,81 @@ +/* + * RandomKeyValueUtils.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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. + */ + +#include "fdbclient/RandomKeyValueUtils.h" +#include "flow/UnitTest.h" + +template +void printNextN(T generator, int count = 10) { + fmt::print("Generating from .next() on {}\n", generator.toString()); + for (int i = 0; i < count; ++i) { + fmt::print(" {}\n", generator.next()); + } + fmt::print("\n"); +} + +TEST_CASE("/randomKeyValueUtils/generate") { + + printNextN(RandomIntGenerator(3, 10, false), 5); + printNextN(RandomIntGenerator("3..10"), 5); + printNextN(RandomIntGenerator("a..z"), 5); + // Works in reverse too + printNextN(RandomIntGenerator("10..3"), 5); + // Skewed low + printNextN(RandomIntGenerator("^3..10"), 5); + // Skewed high + printNextN(RandomIntGenerator("^10..3"), 5); + printNextN(RandomIntGenerator("5"), 5); + + printNextN(RandomStringGenerator(RandomIntGenerator(3, 10, false), RandomIntGenerator('d', 'g', false)), 10); + printNextN(RandomStringGenerator("3..10", "d..g"), 10); + printNextN(RandomStringGenerator("3..10/d..g"), 10); + printNextN(RandomStringGenerator("5/a..c"), 5); + printNextN(RandomStringGenerator("5/a..a"), 5); + + printNextN(RandomKeySetGenerator("0..5", "3..10/d..g"), 20); + // Index generator will use a min of 0 so this is the same as 0:5 + printNextN(RandomKeySetGenerator("5", "3..10/d..g"), 20); + + printNextN(RandomKeyTupleSetGenerator( + RandomIntGenerator(10), + RandomKeyTupleGenerator(std::vector{ + RandomKeySetGenerator( + RandomIntGenerator(5), + RandomStringGenerator(RandomIntGenerator(5), RandomIntGenerator('a', 'c', false))), + RandomKeySetGenerator(RandomIntGenerator(5), + RandomStringGenerator(RandomIntGenerator(3, 10, true), + RandomIntGenerator('d', 'f', false))) })), + 10); + + // Same as above in string form + printNextN(RandomKeyTupleSetGenerator("10::5::5/a..c,5::^3..10/d..f"), 10); + + // uniform random selection from 1000 pregenerated key tuples. Tuples have 4 parts + // len 5 chars a-d with 2 choices + // len 10 chars k-t with 10000 choices + // len 5-8 chars z-z with 2 choices + printNextN(RandomKeyTupleSetGenerator("1000::2::5/a..d,10000::10/k..t,2::5..8/z"), 100); + + printNextN(RandomValueGenerator("10..100/r..z"), 20); + + return Void(); +} + +void forceLinkRandomKeyValueUtilsTests() {} diff --git a/src/fdbclient/ReadYourWrites.actor.cpp b/src/fdbclient/ReadYourWrites.actor.cpp index 67fb693..5a2756e 100644 --- a/src/fdbclient/ReadYourWrites.actor.cpp +++ b/src/fdbclient/ReadYourWrites.actor.cpp @@ -252,6 +252,8 @@ class RYWImpl { if (read.begin.getKey() < read.end.getKey()) { rangeBegin = read.begin.getKey(); + // If the end offset is 1 (first greater than / first greater or equal) or more, then no changes to the + // range after the returned results can change the outcome. rangeEnd = read.end.offset > 0 && result.more ? read.begin.getKey() : read.end.getKey(); } else { rangeBegin = read.end.getKey(); @@ -288,7 +290,9 @@ class RYWImpl { bool endInArena = false; if (read.begin.getKey() < read.end.getKey()) { - rangeBegin = read.begin.offset <= 0 && result.more ? read.end.getKey() : read.begin.getKey(); + // If the begin offset is 1 (first greater than / first greater or equal) or less, then no changes to the + // range prior to the returned results can change the outcome. + rangeBegin = read.begin.offset <= 1 && result.more ? read.end.getKey() : read.begin.getKey(); rangeEnd = read.end.getKey(); } else { rangeBegin = read.end.getKey(); @@ -464,7 +468,7 @@ class RYWImpl { if (!it.is_unreadable() && !it.is_unknown_range() && key.offset > 1) { *readThroughEnd = true; - key.setKey(maxKey); // maxKey is a KeyRef, but points to a LiteralStringRef. TODO: how can we ASSERT this? + key.setKey(maxKey); // maxKey is a KeyRef, but points to a literal. TODO: how can we ASSERT this? key.offset = 1; return; } @@ -686,7 +690,8 @@ class RYWImpl { break; if (it.is_unknown_range()) { - if (limits.hasByteLimit() && result.size() && itemsPastEnd >= 1 - end.offset) { + if (limits.hasByteLimit() && limits.hasSatisfiedMinRows() && result.size() && + itemsPastEnd >= 1 - end.offset) { result.more = true; break; } @@ -1150,7 +1155,6 @@ class RYWImpl { else read.end = KeySelector(firstGreaterOrEqual(key), key.arena()); } - MappedRangeResult v = wait(ryw->tr.getMappedRange( read.begin, read.end, read.mapper, read.limits, snapshot, backwards ? Reverse::True : Reverse::False)); return v; @@ -1216,7 +1220,7 @@ class RYWImpl { // isolation support. But it is not default and is rarely used. So we disallow it until we have thorough test // coverage for it.) if (snapshot) { - TEST(true); // getMappedRange not supported for snapshot. + CODE_PROBE(true, "getMappedRange not supported for snapshot.", probe::decoration::rare); throw unsupported_operation(); } // For now, getMappedRange requires read-your-writes being NOT disabled. But the support of RYW is limited @@ -1225,7 +1229,7 @@ class RYWImpl { // which returns the written value transparently. In another word, it makes sure not break RYW semantics without // actually implementing reading from the writes. if (ryw->options.readYourWritesDisabled) { - TEST(true); // getMappedRange not supported for read-your-writes disabled. + CODE_PROBE(true, "getMappedRange not supported for read-your-writes disabled.", probe::decoration::rare); throw unsupported_operation(); } @@ -1245,7 +1249,7 @@ class RYWImpl { ++it; ASSERT(itCopy->value.size()); - TEST(itCopy->value.size() > 1); // Multiple watches on the same key triggered by RYOW + CODE_PROBE(itCopy->value.size() > 1, "Multiple watches on the same key triggered by RYOW"); for (int i = 0; i < itCopy->value.size(); i++) { if (itCopy->value[i]->onChangeTrigger.isSet()) { @@ -1333,6 +1337,11 @@ class RYWImpl { ACTOR static void simulateTimeoutInFlightCommit(ReadYourWritesTransaction* ryw_) { state Reference ryw = Reference::addRef(ryw_); ASSERT(ryw->options.timeoutInSeconds > 0); + // An actual in-flight commit (i.e. one that's past the point where cancelling the transaction would stop it) + // would already have a read version. We need to get a read version too, otherwise committing a conflicting + // transaction may not ensure this transaction is no longer in-flight, since this transaction could get a read + // version _after_. + wait(success(ryw->getReadVersion())); if (!ryw->resetPromise.isSet()) ryw->resetPromise.sendError(transaction_timed_out()); wait(delay(deterministicRandom()->random01() * 5)); @@ -1414,7 +1423,85 @@ class RYWImpl { } } + // This function must not block unless a non-empty commitFuture is passed in + // If commitFuture is specified, this will wait for the future and report the result of + // the future in the output. If commitFuture isn't specified, then the transaction will + // be reported uncommitted. In that case, an optional error can be provided to indicate + // why the transaction was uncommitted. + ACTOR static Future printDebugMessages(ReadYourWritesTransaction* self, + Optional> commitFuture, + Optional error = Optional()) { + state std::string prefix; + state std::string commitResult; + state ErrorOr result; + state std::vector debugTraces = std::move(self->debugTraces); + state std::vector debugMessages = std::move(self->debugMessages); + + self->debugTraces.clear(); + self->debugMessages.clear(); + + if (commitFuture.present()) { + try { + wait(store(result, errorOr(commitFuture.get()))); + } catch (Error& e) { + result = e; + } + } + + Version readVersion = self->getReadVersion().canGet() ? self->getReadVersion().get() : -1; + Version commitVersion = result.present() ? self->getCommittedVersion() : -1; + + if (result.present()) { + commitResult = "Committed"; + } else if (result.getError().code() == error_code_commit_unknown_result || + result.getError().code() == error_code_operation_cancelled || + result.getError().code() == error_code_transaction_timed_out) { + commitResult = "Maybe committed"; + } else if (commitFuture.present()) { + commitResult = "Not committed"; + } else { + commitResult = "Uncommitted"; + } + + for (auto& event : debugTraces) { + event.detail("CommitResult", commitResult).detail("ReadVersion", readVersion); + + if (result.present()) { + event.detail("CommitVersion", commitVersion); + } else if (commitFuture.present()) { + event.errorUnsuppressed(result.getError()); + } else if (error.present()) { + event.errorUnsuppressed(error.get()); + } + + event.log(); + } + + for (auto message : debugMessages) { + std::string cvString = result.present() ? fmt::format(" cv={}", commitVersion) : ""; + std::string errorString; + if (commitFuture.present() && result.isError()) { + errorString = fmt::format(" error={}", result.getError().name()); + } else if (error.present()) { + errorString = fmt::format(" error={}", error.get().name()); + } + + fmt::print("[{} rv={}{}{}] {}\n", commitResult, readVersion, cvString, errorString, message); + } + + if (result.isError()) { + throw result.getError(); + } + + return Void(); + } + ACTOR static Future onError(ReadYourWritesTransaction* ryw, Error e) { + if (ryw->debugTraces.size() > 0 || ryw->debugMessages.size() > 0) { + // printDebugMessages returns a future but will not block if called with an empty second argument + ASSERT(printDebugMessages(ryw, {}, e).isReady()); + } + try { if (ryw->resetPromise.isSet()) { throw ryw->resetPromise.getFuture().getError(); @@ -1460,8 +1547,8 @@ class RYWImpl { } }; -ReadYourWritesTransaction::ReadYourWritesTransaction(Database const& cx, Optional tenantName) - : ISingleThreadTransaction(cx->deferredError), tr(cx, tenantName), cache(&arena), writes(&arena), retries(0), +ReadYourWritesTransaction::ReadYourWritesTransaction(Database const& cx, Optional> const& tenant) + : ISingleThreadTransaction(cx->deferredError), tr(cx, tenant), cache(&arena), writes(&arena), retries(0), approximateSize(0), creationTime(now()), commitStarted(false), versionStampFuture(tr.getVersionstamp()), specialKeySpaceWriteMap(std::make_pair(false, Optional()), specialKeys.end), options(tr) { std::copy( @@ -1470,11 +1557,11 @@ ReadYourWritesTransaction::ReadYourWritesTransaction(Database const& cx, Optiona } void ReadYourWritesTransaction::construct(Database const& cx) { - *this = ReadYourWritesTransaction(cx, Optional()); + *this = ReadYourWritesTransaction(cx); } -void ReadYourWritesTransaction::construct(Database const& cx, TenantName const& tenantName) { - *this = ReadYourWritesTransaction(cx, tenantName); +void ReadYourWritesTransaction::construct(Database const& cx, Reference const& tenant) { + *this = ReadYourWritesTransaction(cx, tenant); } ACTOR Future timebomb(double endTime, Promise resetPromise) { @@ -1542,15 +1629,15 @@ ACTOR Future getWorkerInterfaces(Reference> ReadYourWritesTransaction::get(const Key& key, Snapshot snapshot) { - TEST(true); // ReadYourWritesTransaction::get + CODE_PROBE(true, "ReadYourWritesTransaction::get"); if (getDatabase()->apiVersionAtLeast(630)) { if (specialKeys.contains(key)) { - TEST(true); // Special keys get + CODE_PROBE(true, "Special keys get"); return getDatabase()->specialKeySpace->get(this, key); } } else { - if (key == LiteralStringRef("\xff\xff/status/json")) { + if (key == "\xff\xff/status/json"_sr) { if (tr.getDatabase().getPtr() && tr.getDatabase()->getConnectionRecord()) { ++tr.getDatabase()->transactionStatusRequests; return getJSON(tr.getDatabase()); @@ -1559,7 +1646,7 @@ Future> ReadYourWritesTransaction::get(const Key& key, Snapshot } } - if (key == LiteralStringRef("\xff\xff/cluster_file_path")) { + if (key == "\xff\xff/cluster_file_path"_sr) { try { if (tr.getDatabase().getPtr() && tr.getDatabase()->getConnectionRecord()) { Optional output = StringRef(tr.getDatabase()->getConnectionRecord()->getLocation()); @@ -1571,7 +1658,7 @@ Future> ReadYourWritesTransaction::get(const Key& key, Snapshot return Optional(); } - if (key == LiteralStringRef("\xff\xff/connection_string")) { + if (key == "\xff\xff/connection_string"_sr) { try { if (tr.getDatabase().getPtr() && tr.getDatabase()->getConnectionRecord()) { Reference f = tr.getDatabase()->getConnectionRecord(); @@ -1629,11 +1716,11 @@ Future ReadYourWritesTransaction::getRange(KeySelector begin, if (getDatabase()->apiVersionAtLeast(630)) { if (specialKeys.contains(begin.getKey()) && specialKeys.begin <= end.getKey() && end.getKey() <= specialKeys.end) { - TEST(true); // Special key space get range + CODE_PROBE(true, "Special key space get range"); return getDatabase()->specialKeySpace->getRange(this, begin, end, limits, reverse); } } else { - if (begin.getKey() == LiteralStringRef("\xff\xff/worker_interfaces")) { + if (begin.getKey() == "\xff\xff/worker_interfaces"_sr) { if (tr.getDatabase().getPtr() && tr.getDatabase()->getConnectionRecord()) { return getWorkerInterfaces(tr.getDatabase()->getConnectionRecord()); } else { @@ -1655,7 +1742,7 @@ Future ReadYourWritesTransaction::getRange(KeySelector begin, // This optimization prevents nullptr operations from being added to the conflict range if (limits.isReached()) { - TEST(true); // RYW range read limit 0 + CODE_PROBE(true, "RYW range read limit 0"); return RangeResult(); } @@ -1669,7 +1756,7 @@ Future ReadYourWritesTransaction::getRange(KeySelector begin, end.removeOrEqual(end.arena()); if (begin.offset >= end.offset && begin.getKey() >= end.getKey()) { - TEST(true); // RYW range inverted + CODE_PROBE(true, "RYW range inverted"); return RangeResult(); } @@ -1698,11 +1785,11 @@ Future ReadYourWritesTransaction::getMappedRange(KeySelector if (getDatabase()->apiVersionAtLeast(630)) { if (specialKeys.contains(begin.getKey()) && specialKeys.begin <= end.getKey() && end.getKey() <= specialKeys.end) { - TEST(true); // Special key space get range (getMappedRange) + CODE_PROBE(true, "Special key space get range (getMappedRange)", probe::decoration::rare); throw client_invalid_operation(); // Not support special keys. } } else { - if (begin.getKey() == LiteralStringRef("\xff\xff/worker_interfaces")) { + if (begin.getKey() == "\xff\xff/worker_interfaces"_sr) { throw client_invalid_operation(); // Not support special keys. } } @@ -1720,7 +1807,7 @@ Future ReadYourWritesTransaction::getMappedRange(KeySelector // This optimization prevents nullptr operations from being added to the conflict range if (limits.isReached()) { - TEST(true); // RYW range read limit 0 (getMappedRange) + CODE_PROBE(true, "RYW range read limit 0 (getMappedRange)", probe::decoration::rare); return MappedRangeResult(); } @@ -1734,7 +1821,7 @@ Future ReadYourWritesTransaction::getMappedRange(KeySelector end.removeOrEqual(end.arena()); if (begin.offset >= end.offset && begin.getKey() >= end.getKey()) { - TEST(true); // RYW range inverted (getMappedRange) + CODE_PROBE(true, "RYW range inverted (getMappedRange)", probe::decoration::rare); return MappedRangeResult(); } @@ -1770,7 +1857,10 @@ Future ReadYourWritesTransaction::getEstimatedRangeSizeBytes(const KeyR if (resetPromise.isSet()) return resetPromise.getFuture().getError(); - return map(waitOrError(tr.getDatabase()->getStorageMetrics(keys, -1), resetPromise.getFuture()), + // Pass in the TransactionState only if tenant is present + Optional> trState = + tr.trState->hasTenant() ? tr.trState : Optional>(); + return map(waitOrError(tr.getDatabase()->getStorageMetrics(keys, -1, trState), resetPromise.getFuture()), [](const StorageMetrics& m) { return m.bytes; }); } @@ -1789,7 +1879,8 @@ Future>> ReadYourWritesTransaction::getRangeSplitPo return waitOrError(tr.getRangeSplitPoints(range, chunkSize), resetPromise.getFuture()); } -Future>> ReadYourWritesTransaction::getBlobGranuleRanges(const KeyRange& range) { +Future>> ReadYourWritesTransaction::getBlobGranuleRanges(const KeyRange& range, + int rangeLimit) { if (checkUsedDuringCommit()) { return used_during_commit(); } @@ -1800,7 +1891,7 @@ Future>> ReadYourWritesTransaction::getBlobGra if (range.begin > maxKey || range.end > maxKey) return key_outside_legal_range(); - return waitOrError(tr.getBlobGranuleRanges(range), resetPromise.getFuture()); + return waitOrError(tr.getBlobGranuleRanges(range, rangeLimit), resetPromise.getFuture()); } Future>> ReadYourWritesTransaction::readBlobGranules( @@ -1808,7 +1899,6 @@ Future>> ReadYourWritesTransaction::re Version begin, Optional readVersion, Version* readVersionOut) { - if (!options.readYourWritesDisabled) { return blob_granule_no_ryw(); } @@ -1827,6 +1917,31 @@ Future>> ReadYourWritesTransaction::re return waitOrError(tr.readBlobGranules(range, begin, readVersion, readVersionOut), resetPromise.getFuture()); } +Future>> ReadYourWritesTransaction::summarizeBlobGranules( + const KeyRange& range, + Optional summaryVersion, + int rangeLimit) { + if (checkUsedDuringCommit()) { + return used_during_commit(); + } + + if (resetPromise.isSet()) + return resetPromise.getFuture().getError(); + + KeyRef maxKey = getMaxReadKey(); + if (range.begin > maxKey || range.end > maxKey) + return key_outside_legal_range(); + + return waitOrError(tr.summarizeBlobGranules(range, summaryVersion, rangeLimit), resetPromise.getFuture()); +} + +void ReadYourWritesTransaction::addGranuleMaterializeStats(const GranuleMaterializeStats& stats) { + if (checkUsedDuringCommit()) { + throw used_during_commit(); + } + tr.addGranuleMaterializeStats(stats); +} + void ReadYourWritesTransaction::addReadConflictRange(KeyRangeRef const& keys) { if (checkUsedDuringCommit()) { throw used_during_commit(); @@ -1995,7 +2110,7 @@ void ReadYourWritesTransaction::getWriteConflicts(KeyRangeMap* result) { } } -void ReadYourWritesTransaction::setTransactionID(uint64_t id) { +void ReadYourWritesTransaction::setTransactionID(UID id) { tr.setTransactionID(id); } @@ -2004,7 +2119,7 @@ void ReadYourWritesTransaction::setToken(uint64_t token) { } RangeResult ReadYourWritesTransaction::getReadConflictRangeIntersecting(KeyRangeRef kr) { - TEST(true); // Special keys read conflict range + CODE_PROBE(true, "Special keys read conflict range"); ASSERT(readConflictRangeKeysRange.contains(kr)); ASSERT(!tr.trState->options.checkWritesEnabled); RangeResult result; @@ -2018,22 +2133,20 @@ RangeResult ReadYourWritesTransaction::getReadConflictRangeIntersecting(KeyRange if (kr.begin <= iter->begin() && iter->begin() < kr.end) { result.push_back(result.arena(), KeyValueRef(iter->begin().withPrefix(readConflictRangeKeysRange.begin, result.arena()), - iter->value() ? LiteralStringRef("1") : LiteralStringRef("0"))); + iter->value() ? "1"_sr : "0"_sr)); } } } else { - CoalescedKeyRefRangeMap readConflicts{ LiteralStringRef("0"), specialKeys.end }; + CoalescedKeyRefRangeMap readConflicts{ "0"_sr, specialKeys.end }; for (const auto& range : tr.readConflictRanges()) - readConflicts.insert(range.withPrefix(readConflictRangeKeysRange.begin, result.arena()), - LiteralStringRef("1")); + readConflicts.insert(range.withPrefix(readConflictRangeKeysRange.begin, result.arena()), "1"_sr); for (const auto& range : nativeReadRanges) - readConflicts.insert(range.withPrefix(readConflictRangeKeysRange.begin, result.arena()), - LiteralStringRef("1")); + readConflicts.insert(range.withPrefix(readConflictRangeKeysRange.begin, result.arena()), "1"_sr); for (const auto& f : tr.getExtraReadConflictRanges()) { if (f.isReady() && f.get().first < f.get().second) readConflicts.insert(KeyRangeRef(f.get().first, f.get().second) .withPrefix(readConflictRangeKeysRange.begin, result.arena()), - LiteralStringRef("1")); + "1"_sr); } auto beginIter = readConflicts.rangeContaining(kr.begin); if (beginIter->begin() != kr.begin) @@ -2046,12 +2159,12 @@ RangeResult ReadYourWritesTransaction::getReadConflictRangeIntersecting(KeyRange } RangeResult ReadYourWritesTransaction::getWriteConflictRangeIntersecting(KeyRangeRef kr) { - TEST(true); // Special keys write conflict range + CODE_PROBE(true, "Special keys write conflict range"); ASSERT(writeConflictRangeKeysRange.contains(kr)); RangeResult result; // Memory owned by result - CoalescedKeyRefRangeMap writeConflicts{ LiteralStringRef("0"), specialKeys.end }; + CoalescedKeyRefRangeMap writeConflicts{ "0"_sr, specialKeys.end }; if (!options.readYourWritesDisabled) { KeyRangeRef strippedWriteRangePrefix = kr.removePrefix(writeConflictRangeKeysRange.begin); @@ -2064,15 +2177,13 @@ RangeResult ReadYourWritesTransaction::getWriteConflictRangeIntersecting(KeyRang writeConflicts.insert( KeyRangeRef(it.beginKey().toArena(result.arena()), it.endKey().toArena(result.arena())) .withPrefix(writeConflictRangeKeysRange.begin, result.arena()), - LiteralStringRef("1")); + "1"_sr); } } else { for (const auto& range : tr.writeConflictRanges()) - writeConflicts.insert(range.withPrefix(writeConflictRangeKeysRange.begin, result.arena()), - LiteralStringRef("1")); + writeConflicts.insert(range.withPrefix(writeConflictRangeKeysRange.begin, result.arena()), "1"_sr); for (const auto& range : nativeWriteRanges) - writeConflicts.insert(range.withPrefix(writeConflictRangeKeysRange.begin, result.arena()), - LiteralStringRef("1")); + writeConflicts.insert(range.withPrefix(writeConflictRangeKeysRange.begin, result.arena()), "1"_sr); } for (const auto& k : versionStampKeys) { @@ -2092,8 +2203,7 @@ RangeResult ReadYourWritesTransaction::getWriteConflictRangeIntersecting(KeyRang } else { range = getVersionstampKeyRange(result.arena(), k, tr.getCachedReadVersion().orDefault(0), getMaxReadKey()); } - writeConflicts.insert(range.withPrefix(writeConflictRangeKeysRange.begin, result.arena()), - LiteralStringRef("1")); + writeConflicts.insert(range.withPrefix(writeConflictRangeKeysRange.begin, result.arena()), "1"_sr); } auto beginIter = writeConflicts.rangeContaining(kr.begin); @@ -2139,19 +2249,19 @@ void ReadYourWritesTransaction::atomicOp(const KeyRef& key, const ValueRef& oper KeyRef k; if (!tr.apiVersionAtLeast(520) && operationType == MutationRef::SetVersionstampedKey) { - k = key.withSuffix(LiteralStringRef("\x00\x00"), arena); + k = key.withSuffix("\x00\x00"_sr, arena); } else { k = KeyRef(arena, key); } ValueRef v; if (!tr.apiVersionAtLeast(520) && operationType == MutationRef::SetVersionstampedValue) { - v = operand.withSuffix(LiteralStringRef("\x00\x00\x00\x00"), arena); + v = operand.withSuffix("\x00\x00\x00\x00"_sr, arena); } else { v = ValueRef(arena, operand); } if (operationType == MutationRef::SetVersionstampedKey) { - TEST(options.readYourWritesDisabled); // SetVersionstampedKey without ryw enabled + CODE_PROBE(options.readYourWritesDisabled, "SetVersionstampedKey without ryw enabled"); // this does validation of the key and needs to be performed before the readYourWritesDisabled path KeyRangeRef range = getVersionstampKeyRange(arena, k, tr.getCachedReadVersion().orDefault(0), getMaxReadKey()); versionStampKeys.push_back(arena, k); @@ -2197,17 +2307,17 @@ void ReadYourWritesTransaction::set(const KeyRef& key, const ValueRef& value) { } else { // These three special keys are deprecated in 7.0 and an alternative C API is added // TODO : Rewrite related code using C api - if (key == LiteralStringRef("\xff\xff/reboot_worker")) { + if (key == "\xff\xff/reboot_worker"_sr) { BinaryReader::fromStringRef(value, IncludeVersion()) .reboot.send(RebootRequest()); return; } - if (key == LiteralStringRef("\xff\xff/suspend_worker")) { + if (key == "\xff\xff/suspend_worker"_sr) { BinaryReader::fromStringRef(value, IncludeVersion()) .reboot.send(RebootRequest(false, false, options.timeoutInSeconds)); return; } - if (key == LiteralStringRef("\xff\xff/reboot_and_check_worker")) { + if (key == "\xff\xff/reboot_and_check_worker"_sr) { BinaryReader::fromStringRef(value, IncludeVersion()) .reboot.send(RebootRequest(false, true)); return; @@ -2390,14 +2500,16 @@ void ReadYourWritesTransaction::addWriteConflictRange(KeyRangeRef const& keys) { } Future ReadYourWritesTransaction::commit() { + Future result; if (checkUsedDuringCommit()) { - return used_during_commit(); + result = used_during_commit(); + } else if (resetPromise.isSet()) { + result = resetPromise.getFuture().getError(); + } else { + result = RYWImpl::commit(this); } - if (resetPromise.isSet()) - return resetPromise.getFuture().getError(); - - return RYWImpl::commit(this); + return debugMessages.size() > 0 || debugTraces.size() > 0 ? RYWImpl::printDebugMessages(this, result) : result; } Future> ReadYourWritesTransaction::getVersionstamp() { @@ -2410,9 +2522,12 @@ Future> ReadYourWritesTransaction::getVersionstamp() { void ReadYourWritesTransaction::setOption(FDBTransactionOptions::Option option, Optional value) { setOptionImpl(option, value); - - if (FDBTransactionOptions::optionInfo.getMustExist(option).persistent) { - persistentOptions.emplace_back(option, value.castTo>()); + auto const& opt = FDBTransactionOptions::optionInfo.getMustExist(option); + if (opt.persistent) { + if (opt.sensitive) + sensitivePersistentOptions.emplace_back(option, value.castTo()); + else + persistentOptions.emplace_back(option, value.castTo>()); } } @@ -2421,7 +2536,7 @@ void ReadYourWritesTransaction::setOptionImpl(FDBTransactionOptions::Option opti case FDBTransactionOptions::READ_YOUR_WRITES_DISABLE: validateOptionValueNotPresent(value); - if (!reading.isReady() || !cache.empty() || !writes.empty()) + if (reading.getFutureCount() > 0 || !cache.empty() || !writes.empty()) throw client_invalid_operation(); options.readYourWritesDisabled = true; @@ -2525,10 +2640,13 @@ void ReadYourWritesTransaction::operator=(ReadYourWritesTransaction&& r) noexcep cache.arena = &arena; writes.arena = &arena; persistentOptions = std::move(r.persistentOptions); + sensitivePersistentOptions = std::move(r.sensitivePersistentOptions); nativeReadRanges = std::move(r.nativeReadRanges); nativeWriteRanges = std::move(r.nativeWriteRanges); versionStampKeys = std::move(r.versionStampKeys); specialKeySpaceWriteMap = std::move(r.specialKeySpaceWriteMap); + debugTraces = std::move(r.debugTraces); + debugMessages = std::move(r.debugMessages); } ReadYourWritesTransaction::ReadYourWritesTransaction(ReadYourWritesTransaction&& r) noexcept @@ -2544,10 +2662,13 @@ ReadYourWritesTransaction::ReadYourWritesTransaction(ReadYourWritesTransaction&& watchMap = std::move(r.watchMap); r.resetPromise = Promise(); persistentOptions = std::move(r.persistentOptions); + sensitivePersistentOptions = std::move(r.sensitivePersistentOptions); nativeReadRanges = std::move(r.nativeReadRanges); nativeWriteRanges = std::move(r.nativeWriteRanges); versionStampKeys = std::move(r.versionStampKeys); specialKeySpaceWriteMap = std::move(r.specialKeySpaceWriteMap); + debugTraces = std::move(r.debugTraces); + debugMessages = std::move(r.debugMessages); } Future ReadYourWritesTransaction::onError(Error const& e) { @@ -2556,13 +2677,16 @@ Future ReadYourWritesTransaction::onError(Error const& e) { void ReadYourWritesTransaction::applyPersistentOptions() { Optional timeout; - for (auto option : persistentOptions) { + for (auto const& option : persistentOptions) { if (option.first == FDBTransactionOptions::TIMEOUT) { timeout = option.second.castTo(); } else { setOptionImpl(option.first, option.second.castTo()); } } + for (auto const& option : sensitivePersistentOptions) { + setOptionImpl(option.first, option.second.castTo()); + } // Setting a timeout can immediately cause a transaction to fail. The only timeout // that matters is the one most recently set, so we ignore any earlier set timeouts @@ -2609,11 +2733,17 @@ void ReadYourWritesTransaction::cancel() { } void ReadYourWritesTransaction::reset() { + if (debugTraces.size() > 0 || debugMessages.size() > 0) { + // printDebugMessages returns a future but will not block if called with an empty second argument + ASSERT(RYWImpl::printDebugMessages(this, {}).isReady()); + } + retries = 0; approximateSize = 0; creationTime = now(); timeoutActor.cancel(); persistentOptions.clear(); + sensitivePersistentOptions.clear(); options.reset(tr); transactionDebugInfo.clear(); tr.fullReset(); @@ -2641,6 +2771,11 @@ KeyRef ReadYourWritesTransaction::getMaxWriteKey() { ReadYourWritesTransaction::~ReadYourWritesTransaction() { if (!resetPromise.isSet()) resetPromise.sendError(transaction_cancelled()); + + if (debugTraces.size() || debugMessages.size()) { + // printDebugMessages returns a future but will not block if called with an empty second argument + [[maybe_unused]] Future f = RYWImpl::printDebugMessages(this, {}); + } } bool ReadYourWritesTransaction::checkUsedDuringCommit() { @@ -2681,3 +2816,13 @@ void ReadYourWritesTransaction::debugLogRetries(Optional error) { } } } + +void ReadYourWritesTransaction::debugTrace(BaseTraceEvent&& event) { + if (event.isEnabled()) { + debugTraces.emplace_back(std::move(event)); + } +} + +void ReadYourWritesTransaction::debugPrint(std::string const& message) { + debugMessages.push_back(message); +} diff --git a/src/fdbclient/ReadYourWrites.actor.g.cpp b/src/fdbclient/ReadYourWrites.actor.g.cpp index ce98782..3b57e35 100644 --- a/src/fdbclient/ReadYourWrites.actor.g.cpp +++ b/src/fdbclient/ReadYourWrites.actor.g.cpp @@ -1565,6 +1565,8 @@ template if (read.begin.getKey() < read.end.getKey()) { rangeBegin = read.begin.getKey(); + // If the end offset is 1 (first greater than / first greater or equal) or more, then no changes to the + // range after the returned results can change the outcome. rangeEnd = read.end.offset > 0 && result.more ? read.begin.getKey() : read.end.getKey(); } else { rangeBegin = read.end.getKey(); @@ -1601,7 +1603,9 @@ template bool endInArena = false; if (read.begin.getKey() < read.end.getKey()) { - rangeBegin = read.begin.offset <= 0 && result.more ? read.end.getKey() : read.begin.getKey(); + // If the begin offset is 1 (first greater than / first greater or equal) or less, then no changes to the + // range prior to the returned results can change the outcome. + rangeBegin = read.begin.offset <= 1 && result.more ? read.end.getKey() : read.begin.getKey(); rangeEnd = read.end.getKey(); } else { rangeBegin = read.end.getKey(); @@ -1659,24 +1663,24 @@ template } } - #line 1662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" // This generated class is to be used only via readWithConflictRangeThrough() - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class ReadWithConflictRangeThroughActorState { - #line 1668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadWithConflictRangeThroughActorState(ReadYourWritesTransaction* const& ryw,Req const& req,Snapshot const& snapshot) - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : ryw(ryw), - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" req(req), - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" snapshot(snapshot) - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("readWithConflictRangeThrough", reinterpret_cast(this)); @@ -1689,22 +1693,22 @@ class ReadWithConflictRangeThroughActorState { int a_body1(int loopDepth=0) { try { - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_0 = readThrough(ryw, req, snapshot); - #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_1 = ryw->resetPromise.getFuture(); - #line 1700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1725,9 +1729,9 @@ class ReadWithConflictRangeThroughActorState { } int a_body1when1(typename Req::Result const& result,int loopDepth) { - #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~ReadWithConflictRangeThroughActorState(); static_cast(this)->destroy(); return 0; } - #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< typename Req::Result >::value()) typename Req::Result(result); this->~ReadWithConflictRangeThroughActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1737,9 +1741,9 @@ class ReadWithConflictRangeThroughActorState { } int a_body1when1(typename Req::Result && result,int loopDepth) { - #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~ReadWithConflictRangeThroughActorState(); static_cast(this)->destroy(); return 0; } - #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< typename Req::Result >::value()) typename Req::Result(result); this->~ReadWithConflictRangeThroughActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1749,17 +1753,17 @@ class ReadWithConflictRangeThroughActorState { } int a_body1when2(Void const& _,int loopDepth) { - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(internal_error(), loopDepth); - #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return loopDepth; } int a_body1when2(Void && _,int loopDepth) { - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(internal_error(), loopDepth); - #line 1762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return loopDepth; } @@ -1860,20 +1864,20 @@ class ReadWithConflictRangeThroughActorState { fdb_probe_actor_exit("readWithConflictRangeThrough", reinterpret_cast(this), 1); } - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadYourWritesTransaction* ryw; - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Req req; - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Snapshot snapshot; - #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; // This generated class is to be used only via readWithConflictRangeThrough() - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class ReadWithConflictRangeThroughActor final : public Actor, public ActorCallback< ReadWithConflictRangeThroughActor, 0, typename Req::Result >, public ActorCallback< ReadWithConflictRangeThroughActor, 1, Void >, public FastAllocated>, public ReadWithConflictRangeThroughActorState> { - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -1883,9 +1887,9 @@ class ReadWithConflictRangeThroughActor final : public Actor, 0, typename Req::Result >; friend struct ActorCallback< ReadWithConflictRangeThroughActor, 1, Void >; - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadWithConflictRangeThroughActor(ReadYourWritesTransaction* const& ryw,Req const& req,Snapshot const& snapshot) - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor(), ReadWithConflictRangeThroughActorState>(ryw, req, snapshot) { @@ -1908,34 +1912,34 @@ friend struct ActorCallback< ReadWithConflictRangeThroughActor, 1, Void >; } }; - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" [[nodiscard]] static Future readWithConflictRangeThrough( ReadYourWritesTransaction* const& ryw, Req const& req, Snapshot const& snapshot ) { - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return Future(new ReadWithConflictRangeThroughActor(ryw, req, snapshot)); - #line 1917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" +#line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" // This generated class is to be used only via readWithConflictRangeSnapshot() - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class ReadWithConflictRangeSnapshotActorState { - #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadWithConflictRangeSnapshotActorState(ReadYourWritesTransaction* const& ryw,Req const& req) - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : ryw(ryw), - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" req(req), - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" it(&ryw->cache, &ryw->writes) - #line 1938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("readWithConflictRangeSnapshot", reinterpret_cast(this)); @@ -1948,22 +1952,22 @@ class ReadWithConflictRangeSnapshotActorState { int a_body1(int loopDepth=0) { try { - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_0 = read(ryw, req, &it); - #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_1 = ryw->resetPromise.getFuture(); - #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1984,9 +1988,9 @@ class ReadWithConflictRangeSnapshotActorState { } int a_body1when1(typename Req::Result const& result,int loopDepth) { - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~ReadWithConflictRangeSnapshotActorState(); static_cast(this)->destroy(); return 0; } - #line 1989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< typename Req::Result >::value()) typename Req::Result(result); this->~ReadWithConflictRangeSnapshotActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1996,9 +2000,9 @@ class ReadWithConflictRangeSnapshotActorState { } int a_body1when1(typename Req::Result && result,int loopDepth) { - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~ReadWithConflictRangeSnapshotActorState(); static_cast(this)->destroy(); return 0; } - #line 2001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< typename Req::Result >::value()) typename Req::Result(result); this->~ReadWithConflictRangeSnapshotActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2008,17 +2012,17 @@ class ReadWithConflictRangeSnapshotActorState { } int a_body1when2(Void const& _,int loopDepth) { - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(internal_error(), loopDepth); - #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return loopDepth; } int a_body1when2(Void && _,int loopDepth) { - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(internal_error(), loopDepth); - #line 2021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return loopDepth; } @@ -2119,20 +2123,20 @@ class ReadWithConflictRangeSnapshotActorState { fdb_probe_actor_exit("readWithConflictRangeSnapshot", reinterpret_cast(this), 1); } - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadYourWritesTransaction* ryw; - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Req req; - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" SnapshotCache::iterator it; - #line 2128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; // This generated class is to be used only via readWithConflictRangeSnapshot() - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class ReadWithConflictRangeSnapshotActor final : public Actor, public ActorCallback< ReadWithConflictRangeSnapshotActor, 0, typename Req::Result >, public ActorCallback< ReadWithConflictRangeSnapshotActor, 1, Void >, public FastAllocated>, public ReadWithConflictRangeSnapshotActorState> { - #line 2135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -2142,9 +2146,9 @@ class ReadWithConflictRangeSnapshotActor final : public Actor, 0, typename Req::Result >; friend struct ActorCallback< ReadWithConflictRangeSnapshotActor, 1, Void >; - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadWithConflictRangeSnapshotActor(ReadYourWritesTransaction* const& ryw,Req const& req) - #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor(), ReadWithConflictRangeSnapshotActorState>(ryw, req) { @@ -2167,36 +2171,36 @@ friend struct ActorCallback< ReadWithConflictRangeSnapshotActor, 1, Void >; } }; - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" [[nodiscard]] static Future readWithConflictRangeSnapshot( ReadYourWritesTransaction* const& ryw, Req const& req ) { - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return Future(new ReadWithConflictRangeSnapshotActor(ryw, req)); - #line 2176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 2180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" +#line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 2184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" // This generated class is to be used only via readWithConflictRangeRYW() - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class ReadWithConflictRangeRYWActorState { - #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadWithConflictRangeRYWActorState(ReadYourWritesTransaction* const& ryw,Req const& req,Snapshot const& snapshot) - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : ryw(ryw), - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" req(req), - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - snapshot(snapshot), #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + snapshot(snapshot), + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" it(&ryw->cache, &ryw->writes) - #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("readWithConflictRangeRYW", reinterpret_cast(this)); @@ -2209,22 +2213,22 @@ class ReadWithConflictRangeRYWActorState { int a_body1(int loopDepth=0) { try { - #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_0 = read(ryw, req, &it); - #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_1 = ryw->resetPromise.getFuture(); - #line 2220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2245,17 +2249,17 @@ class ReadWithConflictRangeRYWActorState { } int a_body1when1(typename Req::Result const& result,int loopDepth) { - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!snapshot) - #line 2250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" addConflictRange(ryw, req, it.extractWriteMapIterator(), result); - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~ReadWithConflictRangeRYWActorState(); static_cast(this)->destroy(); return 0; } - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< typename Req::Result >::value()) typename Req::Result(result); this->~ReadWithConflictRangeRYWActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2265,17 +2269,17 @@ class ReadWithConflictRangeRYWActorState { } int a_body1when1(typename Req::Result && result,int loopDepth) { - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!snapshot) - #line 2270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" addConflictRange(ryw, req, it.extractWriteMapIterator(), result); - #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~ReadWithConflictRangeRYWActorState(); static_cast(this)->destroy(); return 0; } - #line 2278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< typename Req::Result >::value()) typename Req::Result(result); this->~ReadWithConflictRangeRYWActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2285,17 +2289,17 @@ class ReadWithConflictRangeRYWActorState { } int a_body1when2(Void const& _,int loopDepth) { - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(internal_error(), loopDepth); - #line 2290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return loopDepth; } int a_body1when2(Void && _,int loopDepth) { - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(internal_error(), loopDepth); - #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return loopDepth; } @@ -2396,22 +2400,22 @@ class ReadWithConflictRangeRYWActorState { fdb_probe_actor_exit("readWithConflictRangeRYW", reinterpret_cast(this), 1); } - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadYourWritesTransaction* ryw; - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Req req; - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - Snapshot snapshot; #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + Snapshot snapshot; + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" RYWIterator it; - #line 2407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; // This generated class is to be used only via readWithConflictRangeRYW() - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class ReadWithConflictRangeRYWActor final : public Actor, public ActorCallback< ReadWithConflictRangeRYWActor, 0, typename Req::Result >, public ActorCallback< ReadWithConflictRangeRYWActor, 1, Void >, public FastAllocated>, public ReadWithConflictRangeRYWActorState> { - #line 2414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -2421,9 +2425,9 @@ class ReadWithConflictRangeRYWActor final : public Actor, #pragma clang diagnostic pop friend struct ActorCallback< ReadWithConflictRangeRYWActor, 0, typename Req::Result >; friend struct ActorCallback< ReadWithConflictRangeRYWActor, 1, Void >; - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadWithConflictRangeRYWActor(ReadYourWritesTransaction* const& ryw,Req const& req,Snapshot const& snapshot) - #line 2426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor(), ReadWithConflictRangeRYWActorState>(ryw, req, snapshot) { @@ -2446,16 +2450,16 @@ friend struct ActorCallback< ReadWithConflictRangeRYWActor, 1, Void >; } }; - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" [[nodiscard]] static Future readWithConflictRangeRYW( ReadYourWritesTransaction* const& ryw, Req const& req, Snapshot const& snapshot ) { - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return Future(new ReadWithConflictRangeRYWActor(ryw, req, snapshot)); - #line 2455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +#line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template static inline Future readWithConflictRange(ReadYourWritesTransaction* ryw, Req const& req, @@ -2531,7 +2535,7 @@ template if (!it.is_unreadable() && !it.is_unknown_range() && key.offset > 1) { *readThroughEnd = true; - key.setKey(maxKey); // maxKey is a KeyRef, but points to a LiteralStringRef. TODO: how can we ASSERT this? + key.setKey(maxKey); // maxKey is a KeyRef, but points to a literal. TODO: how can we ASSERT this? key.offset = 1; return; } @@ -2653,48 +2657,48 @@ template } // TODO: read to begin, read through end flags for result - #line 2656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" // This generated class is to be used only via getRangeValue() - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class GetRangeValueActorState { - #line 2662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetRangeValueActorState(ReadYourWritesTransaction* const& ryw,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Iter* const& pit) - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : ryw(ryw), - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" begin(begin), - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" end(end), - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" limits(limits), - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" pit(pit), - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" it(*pit), - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" itEnd(*pit), - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result(), - #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" additionalRows(0), - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" itemsPastEnd(0), - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" requestCount(0), - #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readToBegin(false), - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readThroughEnd(false), - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" actualBeginOffset(begin.offset), - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" actualEndOffset(end.offset) - #line 2697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("getRangeValue", reinterpret_cast(this)); @@ -2707,17 +2711,17 @@ class GetRangeValueActorState { int a_body1(int loopDepth=0) { try { - #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache(begin, it, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualBeginOffset); - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache(end, itEnd, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualEndOffset); - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (actualBeginOffset >= actualEndOffset && begin.getKey() >= end.getKey()) - #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(false, false)); this->~GetRangeValueActorState(); static_cast(this)->destroy(); return 0; } - #line 2720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(false, false)); this->~GetRangeValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2725,33 +2729,33 @@ class GetRangeValueActorState { } else { - #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if ((begin.isFirstGreaterOrEqual() && begin.getKey() == ryw->getMaxReadKey()) || (end.isFirstGreaterOrEqual() && end.getKey() == allKeys.begin)) - #line 2730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueActorState(); static_cast(this)->destroy(); return 0; } - #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!end.isFirstGreaterOrEqual() && begin.getKey() > end.getKey()) - #line 2743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_0 = read(ryw, GetKeyReq(end), pit); - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } else @@ -2777,38 +2781,38 @@ class GetRangeValueActorState { } int a_body1cont1(int loopDepth) { - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ; - #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont5(Key const& resolvedEnd,int loopDepth) { - #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedEnd == allKeys.begin) - #line 2791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readToBegin = true; - #line 2795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedEnd == ryw->getMaxReadKey()) - #line 2799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readThroughEnd = true; - #line 2803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (begin.getKey() >= resolvedEnd && !begin.isBackward()) - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(false, false)); this->~GetRangeValueActorState(); static_cast(this)->destroy(); return 0; } - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(false, false)); this->~GetRangeValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2816,53 +2820,53 @@ class GetRangeValueActorState { } else { - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedEnd == allKeys.begin) - #line 2821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueActorState(); static_cast(this)->destroy(); return 0; } - #line 2825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( begin, it, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualBeginOffset); - #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( end, itEnd, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualEndOffset); - #line 2836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } int a_body1cont5(Key && resolvedEnd,int loopDepth) { - #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedEnd == allKeys.begin) - #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readToBegin = true; - #line 2849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedEnd == ryw->getMaxReadKey()) - #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readThroughEnd = true; - #line 2857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (begin.getKey() >= resolvedEnd && !begin.isBackward()) - #line 2861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(false, false)); this->~GetRangeValueActorState(); static_cast(this)->destroy(); return 0; } - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(false, false)); this->~GetRangeValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2870,24 +2874,24 @@ class GetRangeValueActorState { } else { - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedEnd == allKeys.begin) - #line 2875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueActorState(); static_cast(this)->destroy(); return 0; } - #line 2879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( begin, it, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualBeginOffset); - #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( end, itEnd, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualEndOffset); - #line 2890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -2957,35 +2961,35 @@ class GetRangeValueActorState { } int a_body1cont12(int loopDepth) { - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.more = result.more || limits.isReached(); - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (end.isFirstGreaterOrEqual()) - #line 2964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int keepItems = std::lower_bound(result.begin(), result.end(), end.getKey(), KeyValueRef::OrderByKey()) - result.begin(); - #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (keepItems < result.size()) - #line 2970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.more = false; - #line 2974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.resize(result.arena(), keepItems); - #line 2978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.readToBegin = readToBegin; - #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.readThroughEnd = !result.more && readThroughEnd; - #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.arena().dependsOn(ryw->arena); - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetRangeValueActorState(); static_cast(this)->destroy(); return 0; } - #line 2988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 2992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(result)); // state_var_RVO this->~GetRangeValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3002,56 +3006,56 @@ class GetRangeValueActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!result.size() && actualBeginOffset >= actualEndOffset && begin.getKey() >= end.getKey()) - #line 3007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(false, false)); this->~GetRangeValueActorState(); static_cast(this)->destroy(); return 0; } - #line 3011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(false, false)); this->~GetRangeValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (end.offset <= 1 && end.getKey() == allKeys.begin) - #line 3019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueActorState(); static_cast(this)->destroy(); return 0; } - #line 3023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if ((begin.offset >= end.offset && begin.getKey() >= end.getKey()) || (begin.offset >= 1 && begin.getKey() >= ryw->getMaxReadKey())) - #line 3031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (end.isFirstGreaterOrEqual()) - #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!result.size()) - #line 3041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_1 = read(ryw, GetKeyReq(end), pit); - #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } else @@ -3076,235 +3080,235 @@ class GetRangeValueActorState { } int a_body1cont1loopBody1cont1(int loopDepth) { - #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!it.is_unreadable() && !it.is_unknown_range() && it.beginKey() > itEnd.beginKey()) - #line 3081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (end.isFirstGreaterOrEqual()) - #line 3085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueActorState(); static_cast(this)->destroy(); return 0; } - #line 3091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (limits.isReached() && itemsPastEnd >= 1 - end.offset) - #line 3099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (it == itEnd && ((!it.is_unreadable() && !it.is_unknown_range()) || (begin.offset > 0 && end.isFirstGreaterOrEqual() && end.getKey() == it.beginKey()))) - #line 3105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (it.is_unknown_range()) - #line 3111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" - { - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - if (limits.hasByteLimit() && result.size() && itemsPastEnd >= 1 - end.offset) #line 3115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (limits.hasByteLimit() && limits.hasSatisfiedMinRows() && result.size() && itemsPastEnd >= 1 - end.offset) + #line 3119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.more = true; - #line 3119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Iter ucEnd(it); - #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int singleClears = 0; - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int clearLimit = requestCount ? 1 << std::min(requestCount, 20) : 0; - #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (it.beginKey() < itEnd.beginKey()) - #line 3130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" singleClears = std::min(skipUncached(ucEnd, itEnd, BUGGIFY ? 0 : clearLimit + 100), clearLimit); - #line 3134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_end = KeySelector(); - #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (ucEnd != itEnd) - #line 3140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Key k = ucEnd.endKey().toStandaloneStringRef(); - #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_end = KeySelector(firstGreaterOrEqual(k), k.arena()); - #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (end.offset < 1) - #line 3148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" additionalRows += 1 - end.offset; - #line 3152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } } else { - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (end.offset < 1) - #line 3159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_end = KeySelector(firstGreaterOrEqual(end.getKey()), end.arena()); - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" additionalRows += 1 - end.offset; - #line 3165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } else { - #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_end = end; - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (end.offset > 1) - #line 3173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" singleClears += countUncached(std::move(ucEnd), ryw->getMaxReadKey(), clearLimit - singleClears); - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_end.offset += singleClears; - #line 3179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } } } - #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" additionalRows += singleClears; - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_begin = KeySelector(); - #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (begin.isFirstGreaterOrEqual()) - #line 3189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Key k = it.beginKey() > begin.getKey() ? it.beginKey().toStandaloneStringRef() : Key(begin.getKey(), begin.arena()); - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" begin = KeySelector(firstGreaterOrEqual(k), k.arena()); - #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_begin = begin; - #line 3197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } else { - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (begin.offset > 1) - #line 3203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_begin = KeySelector(firstGreaterOrEqual(begin.getKey()), begin.arena()); - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" additionalRows += begin.offset - 1; - #line 3209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } else { - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_begin = begin; - #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ucEnd = it; - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" singleClears = countUncachedBack(std::move(ucEnd), clearLimit); - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_begin.offset -= singleClears; - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" additionalRows += singleClears; - #line 3223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } } - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (read_end.getKey() < read_begin.getKey()) - #line 3228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_end.setKey(read_begin.getKey()); - #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_end.arena().dependsOn(read_begin.arena()); - #line 3234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" requestLimit = limits; - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" setRequestLimits(requestLimit, additionalRows, 2 - read_begin.offset, requestCount); - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" requestCount++; - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ASSERT(!requestLimit.hasRowLimit() || requestLimit.rows > 0); - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ASSERT(requestLimit.hasRowLimit() || requestLimit.hasByteLimit()); - #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" additionalRows = 0; - #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_2 = ryw->tr.getRange(read_begin, read_end, requestLimit, Snapshot::True, Reverse::False); - #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } else { - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (it.is_kv()) - #line 3264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeyValueRef const* start = it.kv(ryw->arena); - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (start == nullptr) - #line 3270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ++it; - #line 3274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return a_body1cont1loopHead1(loopDepth); // continue } - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - it.skipContiguous(end.isFirstGreaterOrEqual() ? end.getKey() : ryw->getMaxReadKey()); #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + it.skipContiguous(end.isFirstGreaterOrEqual() ? end.getKey() : ryw->getMaxReadKey()); + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int maxCount = it.kv(ryw->arena) - start + 1; - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int count = 0; - #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" for(;count < maxCount && !limits.isReached();count++) { - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" limits.decrement(start[count]); - #line 3287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" itemsPastEnd += maxCount - count; - #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (count) - #line 3293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.append(result.arena(), start, count); - #line 3297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ++it; - #line 3301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } else { - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ++it; - #line 3307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } loopDepth = a_body1cont1loopBody1cont10(loopDepth); } @@ -3313,50 +3317,50 @@ class GetRangeValueActorState { } int a_body1cont1loopBody1cont4(Key const& resolvedEnd,int loopDepth) { - #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedEnd == allKeys.begin) - #line 3318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readToBegin = true; - #line 3322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedEnd == ryw->getMaxReadKey()) - #line 3326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readThroughEnd = true; - #line 3330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" end = firstGreaterOrEqual(resolvedEnd); - #line 3334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1cont1loopBody1cont4(Key && resolvedEnd,int loopDepth) { - #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedEnd == allKeys.begin) - #line 3343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readToBegin = true; - #line 3347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedEnd == ryw->getMaxReadKey()) - #line 3351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readThroughEnd = true; - #line 3355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" end = firstGreaterOrEqual(resolvedEnd); - #line 3359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -3432,42 +3436,42 @@ class GetRangeValueActorState { } int a_body1cont1loopBody1cont15(RangeResult const& snapshot_read,int loopDepth) { - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeyRangeRef range = getKnownKeyRange(snapshot_read, read_begin, read_end, ryw->arena); - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (ryw->cache.insert(range, snapshot_read)) - #line 3439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->arena.dependsOn(snapshot_read.arena()); - #line 3443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( begin, it, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualBeginOffset); - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( end, itEnd, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualEndOffset); - #line 3449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont10(loopDepth); return loopDepth; } int a_body1cont1loopBody1cont15(RangeResult && snapshot_read,int loopDepth) { - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeyRangeRef range = getKnownKeyRange(snapshot_read, read_begin, read_end, ryw->arena); - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (ryw->cache.insert(range, snapshot_read)) - #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->arena.dependsOn(snapshot_read.arena()); - #line 3464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( begin, it, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualBeginOffset); - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( end, itEnd, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualEndOffset); - #line 3470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont10(loopDepth); return loopDepth; @@ -3535,50 +3539,50 @@ class GetRangeValueActorState { fdb_probe_actor_exit("getRangeValue", reinterpret_cast(this), 2); } - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadYourWritesTransaction* ryw; - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeySelector begin; - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeySelector end; - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetRangeLimits limits; - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Iter* pit; - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Iter& it; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Iter itEnd; - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" RangeResult result; - #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int64_t additionalRows; - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int itemsPastEnd; - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int requestCount; - #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" bool readToBegin; - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" bool readThroughEnd; - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int actualBeginOffset; - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int actualEndOffset; - #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeySelector read_end; - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeySelector read_begin; - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetRangeLimits requestLimit; - #line 3574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; // This generated class is to be used only via getRangeValue() - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class GetRangeValueActor final : public Actor, public ActorCallback< GetRangeValueActor, 0, Key >, public ActorCallback< GetRangeValueActor, 1, Key >, public ActorCallback< GetRangeValueActor, 2, RangeResult >, public FastAllocated>, public GetRangeValueActorState> { - #line 3581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -3589,9 +3593,9 @@ class GetRangeValueActor final : public Actor, public ActorCallback friend struct ActorCallback< GetRangeValueActor, 0, Key >; friend struct ActorCallback< GetRangeValueActor, 1, Key >; friend struct ActorCallback< GetRangeValueActor, 2, RangeResult >; - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetRangeValueActor(ReadYourWritesTransaction* const& ryw,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Iter* const& pit) - #line 3594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor(), GetRangeValueActorState>(ryw, begin, end, limits, pit) { @@ -3616,16 +3620,16 @@ friend struct ActorCallback< GetRangeValueActor, 2, RangeResult >; } }; - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" [[nodiscard]] static Future getRangeValue( ReadYourWritesTransaction* const& ryw, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Iter* const& pit ) { - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return Future(new GetRangeValueActor(ryw, begin, end, limits, pit)); - #line 3625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +#line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" static KeyRangeRef getKnownKeyRangeBack(RangeResultRef data, KeySelector begin, KeySelector end, Arena& arena) { StringRef beginKey = !data.more && begin.offset <= 1 ? begin.getKey() : allKeys.end; @@ -3707,48 +3711,48 @@ template return singleEmpty; } - #line 3710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" // This generated class is to be used only via getRangeValueBack() - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class GetRangeValueBackActorState { - #line 3716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetRangeValueBackActorState(ReadYourWritesTransaction* const& ryw,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Iter* const& pit) - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : ryw(ryw), - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" begin(begin), - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" end(end), - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" limits(limits), - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" pit(pit), - #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" it(*pit), - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" itEnd(*pit), - #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result(), - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" additionalRows(0), - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" itemsPastBegin(0), - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" requestCount(0), - #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readToBegin(false), - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readThroughEnd(false), - #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" actualBeginOffset(begin.offset), - #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" actualEndOffset(end.offset) - #line 3751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("getRangeValueBack", reinterpret_cast(this)); @@ -3761,17 +3765,17 @@ class GetRangeValueBackActorState { int a_body1(int loopDepth=0) { try { - #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache(end, it, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualEndOffset); - #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( begin, itEnd, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualBeginOffset); - #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (actualBeginOffset >= actualEndOffset && begin.getKey() >= end.getKey()) - #line 3770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(false, false)); this->~GetRangeValueBackActorState(); static_cast(this)->destroy(); return 0; } - #line 3774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(false, false)); this->~GetRangeValueBackActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3779,33 +3783,33 @@ class GetRangeValueBackActorState { } else { - #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if ((begin.isFirstGreaterOrEqual() && begin.getKey() == ryw->getMaxReadKey()) || (end.isFirstGreaterOrEqual() && end.getKey() == allKeys.begin)) - #line 3784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueBackActorState(); static_cast(this)->destroy(); return 0; } - #line 3788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueBackActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!begin.isFirstGreaterOrEqual() && begin.getKey() > end.getKey()) - #line 3797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_0 = read(ryw, GetKeyReq(begin), pit); - #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } else @@ -3831,38 +3835,38 @@ class GetRangeValueBackActorState { } int a_body1cont1(int loopDepth) { - #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ; - #line 3836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont5(Key const& resolvedBegin,int loopDepth) { - #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedBegin == allKeys.begin) - #line 3845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readToBegin = true; - #line 3849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedBegin == ryw->getMaxReadKey()) - #line 3853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readThroughEnd = true; - #line 3857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedBegin >= end.getKey() && end.offset <= 1) - #line 3861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(false, false)); this->~GetRangeValueBackActorState(); static_cast(this)->destroy(); return 0; } - #line 3865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(false, false)); this->~GetRangeValueBackActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3870,53 +3874,53 @@ class GetRangeValueBackActorState { } else { - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedBegin == ryw->getMaxReadKey()) - #line 3875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueBackActorState(); static_cast(this)->destroy(); return 0; } - #line 3879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueBackActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache(end, it, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualEndOffset); - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( begin, itEnd, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualBeginOffset); - #line 3890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } int a_body1cont5(Key && resolvedBegin,int loopDepth) { - #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedBegin == allKeys.begin) - #line 3899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readToBegin = true; - #line 3903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedBegin == ryw->getMaxReadKey()) - #line 3907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readThroughEnd = true; - #line 3911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedBegin >= end.getKey() && end.offset <= 1) - #line 3915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(false, false)); this->~GetRangeValueBackActorState(); static_cast(this)->destroy(); return 0; } - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(false, false)); this->~GetRangeValueBackActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3924,24 +3928,24 @@ class GetRangeValueBackActorState { } else { - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedBegin == ryw->getMaxReadKey()) - #line 3929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueBackActorState(); static_cast(this)->destroy(); return 0; } - #line 3933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueBackActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache(end, it, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualEndOffset); - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( begin, itEnd, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualBeginOffset); - #line 3944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -4011,35 +4015,35 @@ class GetRangeValueBackActorState { } int a_body1cont12(int loopDepth) { - #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.more = result.more || limits.isReached(); - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (begin.isFirstGreaterOrEqual()) - #line 4018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int keepItems = result.rend() - std::lower_bound(result.rbegin(), result.rend(), begin.getKey(), KeyValueRef::OrderByKey()); - #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (keepItems < result.size()) - #line 4024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.more = false; - #line 4028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.resize(result.arena(), keepItems); - #line 4032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.readToBegin = !result.more && readToBegin; - #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.readThroughEnd = readThroughEnd; - #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.arena().dependsOn(ryw->arena); - #line 1121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetRangeValueBackActorState(); static_cast(this)->destroy(); return 0; } - #line 4042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(result)); // state_var_RVO this->~GetRangeValueBackActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4056,56 +4060,56 @@ class GetRangeValueBackActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!result.size() && actualBeginOffset >= actualEndOffset && begin.getKey() >= end.getKey()) - #line 4061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(false, false)); this->~GetRangeValueBackActorState(); static_cast(this)->destroy(); return 0; } - #line 4065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(false, false)); this->~GetRangeValueBackActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!begin.isBackward() && begin.getKey() >= ryw->getMaxReadKey()) - #line 4073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueBackActorState(); static_cast(this)->destroy(); return 0; } - #line 4077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueBackActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if ((begin.offset >= end.offset && begin.getKey() >= end.getKey()) || (end.offset <= 1 && end.getKey() == allKeys.begin)) - #line 4085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (begin.isFirstGreaterOrEqual()) - #line 4089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!result.size()) - #line 4095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_1 = read(ryw, GetKeyReq(begin), pit); - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } else @@ -4130,246 +4134,246 @@ class GetRangeValueBackActorState { } int a_body1cont1loopBody1cont1(int loopDepth) { - #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (itemsPastBegin >= begin.offset - 1 && !it.is_unreadable() && !it.is_unknown_range() && it.beginKey() < itEnd.beginKey()) - #line 4135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (begin.isFirstGreaterOrEqual()) - #line 4139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueBackActorState(); static_cast(this)->destroy(); return 0; } - #line 4145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(readToBegin, readThroughEnd)); this->~GetRangeValueBackActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (limits.isReached() && itemsPastBegin >= begin.offset - 1) - #line 4153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (end.isFirstGreaterOrEqual() && end.getKey() == it.beginKey()) - #line 4159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (itemsPastBegin >= begin.offset - 1 && it == itEnd) - #line 4163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" --it; - #line 4169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (it.is_unknown_range()) - #line 4173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (limits.hasByteLimit() && result.size() && itemsPastBegin >= begin.offset - 1) - #line 4177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.more = true; - #line 4181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Iter ucEnd(it); - #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int singleClears = 0; - #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int clearLimit = requestCount ? 1 << std::min(requestCount, 20) : 0; - #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (it.beginKey() > itEnd.beginKey()) - #line 4192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" singleClears = std::min(skipUncachedBack(ucEnd, itEnd, BUGGIFY ? 0 : clearLimit + 100), clearLimit); - #line 4196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_begin = KeySelector(); - #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (ucEnd != itEnd) - #line 4202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Key k = ucEnd.beginKey().toStandaloneStringRef(); - #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_begin = KeySelector(firstGreaterOrEqual(k), k.arena()); - #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (begin.offset > 1) - #line 4210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" additionalRows += begin.offset - 1; - #line 4214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } } else { - #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (begin.offset > 1) - #line 4221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_begin = KeySelector(firstGreaterOrEqual(begin.getKey()), begin.arena()); - #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" additionalRows += begin.offset - 1; - #line 4227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } else { - #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_begin = begin; - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (begin.offset < 1) - #line 4235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" singleClears += countUncachedBack(std::move(ucEnd), clearLimit - singleClears); - #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_begin.offset -= singleClears; - #line 4241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } } } - #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" additionalRows += singleClears; - #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_end = KeySelector(); - #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (end.isFirstGreaterOrEqual()) - #line 4251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Key k = it.endKey() < end.getKey() ? it.endKey().toStandaloneStringRef() : end.getKey(); - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" end = KeySelector(firstGreaterOrEqual(k), k.arena()); - #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_end = end; - #line 4259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } else { - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (end.offset < 1) - #line 4265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_end = KeySelector(firstGreaterOrEqual(end.getKey()), end.arena()); - #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" additionalRows += 1 - end.offset; - #line 4271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } else { - #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_end = end; - #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ucEnd = it; - #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" singleClears = countUncached(std::move(ucEnd), ryw->getMaxReadKey(), clearLimit); - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_end.offset += singleClears; - #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" additionalRows += singleClears; - #line 4285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } } - #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (read_begin.getKey() > read_end.getKey()) - #line 4290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_begin.setKey(read_end.getKey()); - #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read_begin.arena().dependsOn(read_end.arena()); - #line 4296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" requestLimit = limits; - #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" setRequestLimits(requestLimit, additionalRows, read_end.offset, requestCount); - #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" requestCount++; - #line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ASSERT(!requestLimit.hasRowLimit() || requestLimit.rows > 0); - #line 1052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ASSERT(requestLimit.hasRowLimit() || requestLimit.hasByteLimit()); - #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" additionalRows = 0; - #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_2 = ryw->tr.getRange(read_begin, read_end, requestLimit, Snapshot::True, Reverse::True); - #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } else { - #line 1078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeyValueRef const* end = it.is_kv() ? it.kv(ryw->arena) : nullptr; - #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (end != nullptr) - #line 4328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" it.skipContiguousBack(begin.isFirstGreaterOrEqual() ? begin.getKey() : allKeys.begin); - #line 1081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeyValueRef const* start = it.kv(ryw->arena); - #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ASSERT(start != nullptr); - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int maxCount = end - start + 1; - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int count = 0; - #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" for(;count < maxCount && !limits.isReached();count++) { - #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" limits.decrement(start[maxCount - count - 1]); - #line 4344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" itemsPastBegin += maxCount - count; - #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (count) - #line 4350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int size = result.size(); - #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.resize(result.arena(), size + count); - #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" for(int i = 0;i < count;i++) { - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result[size + i] = start[maxCount - i - 1]; - #line 4360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } } } - #line 1100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (it == itEnd) - #line 4366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" --it; - #line 4372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont10(loopDepth); } @@ -4377,50 +4381,50 @@ class GetRangeValueBackActorState { } int a_body1cont1loopBody1cont4(Key const& resolvedBegin,int loopDepth) { - #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedBegin == allKeys.begin) - #line 4382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readToBegin = true; - #line 4386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedBegin == ryw->getMaxReadKey()) - #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readThroughEnd = true; - #line 4394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" begin = firstGreaterOrEqual(resolvedBegin); - #line 4398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1cont1loopBody1cont4(Key && resolvedBegin,int loopDepth) { - #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedBegin == allKeys.begin) - #line 4407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readToBegin = true; - #line 4411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (resolvedBegin == ryw->getMaxReadKey()) - #line 4415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" readThroughEnd = true; - #line 4419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" begin = firstGreaterOrEqual(resolvedBegin); - #line 4423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -4496,62 +4500,62 @@ class GetRangeValueBackActorState { } int a_body1cont1loopBody1cont16(RangeResult const& snapshot_read,int loopDepth) { - #line 1059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeyRangeRef range = getKnownKeyRangeBack(snapshot_read, read_begin, read_end, ryw->arena); - #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" RangeResultRef reversed; - #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" reversed.resize(ryw->arena, snapshot_read.size()); - #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" for(int i = 0;i < snapshot_read.size();i++) { - #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" reversed[snapshot_read.size() - i - 1] = snapshot_read[i]; - #line 4509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (ryw->cache.insert(range, reversed)) - #line 4513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->arena.dependsOn(snapshot_read.arena()); - #line 4517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( end, it, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualEndOffset); - #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( begin, itEnd, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualBeginOffset); - #line 4523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont10(loopDepth); return loopDepth; } int a_body1cont1loopBody1cont16(RangeResult && snapshot_read,int loopDepth) { - #line 1059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeyRangeRef range = getKnownKeyRangeBack(snapshot_read, read_begin, read_end, ryw->arena); - #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" RangeResultRef reversed; - #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" reversed.resize(ryw->arena, snapshot_read.size()); - #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" for(int i = 0;i < snapshot_read.size();i++) { - #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" reversed[snapshot_read.size() - i - 1] = snapshot_read[i]; - #line 4540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (ryw->cache.insert(range, reversed)) - #line 4544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->arena.dependsOn(snapshot_read.arena()); - #line 4548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( end, it, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualEndOffset); - #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resolveKeySelectorFromCache( begin, itEnd, ryw->getMaxReadKey(), &readToBegin, &readThroughEnd, &actualBeginOffset); - #line 4554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont10(loopDepth); return loopDepth; @@ -4619,50 +4623,50 @@ class GetRangeValueBackActorState { fdb_probe_actor_exit("getRangeValueBack", reinterpret_cast(this), 2); } - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadYourWritesTransaction* ryw; - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeySelector begin; - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeySelector end; - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetRangeLimits limits; - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Iter* pit; - #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Iter& it; - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Iter itEnd; - #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" RangeResult result; - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int64_t additionalRows; - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int itemsPastBegin; - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int requestCount; - #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" bool readToBegin; - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" bool readThroughEnd; - #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int actualBeginOffset; - #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" int actualEndOffset; - #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeySelector read_begin; - #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" KeySelector read_end; - #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetRangeLimits requestLimit; - #line 4658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; // This generated class is to be used only via getRangeValueBack() - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class GetRangeValueBackActor final : public Actor, public ActorCallback< GetRangeValueBackActor, 0, Key >, public ActorCallback< GetRangeValueBackActor, 1, Key >, public ActorCallback< GetRangeValueBackActor, 2, RangeResult >, public FastAllocated>, public GetRangeValueBackActorState> { - #line 4665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -4673,9 +4677,9 @@ class GetRangeValueBackActor final : public Actor, public ActorCall friend struct ActorCallback< GetRangeValueBackActor, 0, Key >; friend struct ActorCallback< GetRangeValueBackActor, 1, Key >; friend struct ActorCallback< GetRangeValueBackActor, 2, RangeResult >; - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetRangeValueBackActor(ReadYourWritesTransaction* const& ryw,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Iter* const& pit) - #line 4678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor(), GetRangeValueBackActorState>(ryw, begin, end, limits, pit) { @@ -4700,16 +4704,16 @@ friend struct ActorCallback< GetRangeValueBackActor, 2, RangeResult >; } }; - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" [[nodiscard]] static Future getRangeValueBack( ReadYourWritesTransaction* const& ryw, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Iter* const& pit ) { - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return Future(new GetRangeValueBackActor(ryw, begin, end, limits, pit)); - #line 4709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +#line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" #ifndef __INTEL_COMPILER #pragma region GetMappedRange @@ -4727,24 +4731,24 @@ template // read.limits, it); }; - #line 4730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" // This generated class is to be used only via readThrough() - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class ReadThroughActor2State { - #line 4736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadThroughActor2State(ReadYourWritesTransaction* const& ryw,GetMappedRangeReq const& read,Snapshot const& snapshot) - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : ryw(ryw), - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read(read), - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" snapshot(snapshot) - #line 4747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("readThrough", reinterpret_cast(this)); @@ -4757,20 +4761,20 @@ class ReadThroughActor2State { int a_body1(int loopDepth=0) { try { - #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (backwards && read.end.offset > 1) - #line 4762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_0 = ryw->tr.getKey(read.end, snapshot); - #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } else @@ -4796,35 +4800,35 @@ class ReadThroughActor2State { } int a_body1cont1(int loopDepth) { - #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_1 = ryw->tr.getMappedRange( read.begin, read.end, read.mapper, read.limits, snapshot, backwards ? Reverse::True : Reverse::False); - #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Key const& key,int loopDepth) { - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (key > ryw->getMaxReadKey()) - #line 4817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read.end = firstGreaterOrEqual(ryw->getMaxReadKey()); - #line 4821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } else { - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read.end = KeySelector(firstGreaterOrEqual(key), key.arena()); - #line 4827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } loopDepth = a_body1cont1(loopDepth); @@ -4832,19 +4836,19 @@ class ReadThroughActor2State { } int a_body1cont2(Key && key,int loopDepth) { - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (key > ryw->getMaxReadKey()) - #line 4837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read.end = firstGreaterOrEqual(ryw->getMaxReadKey()); - #line 4841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } else { - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" read.end = KeySelector(firstGreaterOrEqual(key), key.arena()); - #line 4847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } loopDepth = a_body1cont1(loopDepth); @@ -4915,9 +4919,9 @@ class ReadThroughActor2State { } int a_body1cont6(MappedRangeResult const& v,int loopDepth) { - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(v); this->~ReadThroughActor2State(); static_cast(this)->destroy(); return 0; } - #line 4920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< MappedRangeResult >::value()) MappedRangeResult(v); this->~ReadThroughActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4927,9 +4931,9 @@ class ReadThroughActor2State { } int a_body1cont6(MappedRangeResult && v,int loopDepth) { - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(v); this->~ReadThroughActor2State(); static_cast(this)->destroy(); return 0; } - #line 4932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 4936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< MappedRangeResult >::value()) MappedRangeResult(v); this->~ReadThroughActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5000,20 +5004,20 @@ class ReadThroughActor2State { fdb_probe_actor_exit("readThrough", reinterpret_cast(this), 1); } - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetMappedRangeReq read; - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Snapshot snapshot; - #line 5009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; // This generated class is to be used only via readThrough() - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class ReadThroughActor2 final : public Actor, public ActorCallback< ReadThroughActor2, 0, Key >, public ActorCallback< ReadThroughActor2, 1, MappedRangeResult >, public FastAllocated>, public ReadThroughActor2State> { - #line 5016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -5023,9 +5027,9 @@ class ReadThroughActor2 final : public Actor, public ActorCal #pragma clang diagnostic pop friend struct ActorCallback< ReadThroughActor2, 0, Key >; friend struct ActorCallback< ReadThroughActor2, 1, MappedRangeResult >; - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadThroughActor2(ReadYourWritesTransaction* const& ryw,GetMappedRangeReq const& read,Snapshot const& snapshot) - #line 5028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor(), ReadThroughActor2State>(ryw, read, snapshot) { @@ -5049,16 +5053,16 @@ friend struct ActorCallback< ReadThroughActor2, 1, MappedRangeResult } }; - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" [[nodiscard]] static Future readThrough( ReadYourWritesTransaction* const& ryw, GetMappedRangeReq const& read, Snapshot const& snapshot ) { - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return Future(new ReadThroughActor2(ryw, read, snapshot)); - #line 5058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +#line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template static void addConflictRangeAndMustUnmodified(ReadYourWritesTransaction* ryw, @@ -5092,24 +5096,24 @@ template } // For Snapshot::True and NOT readYourWritesDisabled. - #line 5095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" // This generated class is to be used only via readWithConflictRangeRYW() - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class ReadWithConflictRangeRYWActor1State { - #line 5101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadWithConflictRangeRYWActor1State(ReadYourWritesTransaction* const& ryw,GetMappedRangeReq const& req,Snapshot const& snapshot) - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : ryw(ryw), - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" req(req), - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" snapshot(snapshot) - #line 5112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("readWithConflictRangeRYW", reinterpret_cast(this)); @@ -5122,22 +5126,22 @@ class ReadWithConflictRangeRYWActor1State { int a_body1(int loopDepth=0) { try { - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_0 = readThrough(ryw, req, Snapshot::True); - #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_1 = ryw->resetPromise.getFuture(); - #line 5133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5158,13 +5162,13 @@ class ReadWithConflictRangeRYWActor1State { } int a_body1when1(MappedRangeResult const& result,int loopDepth) { - #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" WriteMap::iterator writes(&ryw->writes); - #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" addConflictRangeAndMustUnmodified(ryw, req, writes, result); - #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~ReadWithConflictRangeRYWActor1State(); static_cast(this)->destroy(); return 0; } - #line 5167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< MappedRangeResult >::value()) MappedRangeResult(result); this->~ReadWithConflictRangeRYWActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5174,13 +5178,13 @@ class ReadWithConflictRangeRYWActor1State { } int a_body1when1(MappedRangeResult && result,int loopDepth) { - #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" WriteMap::iterator writes(&ryw->writes); - #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" addConflictRangeAndMustUnmodified(ryw, req, writes, result); - #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~ReadWithConflictRangeRYWActor1State(); static_cast(this)->destroy(); return 0; } - #line 5183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< MappedRangeResult >::value()) MappedRangeResult(result); this->~ReadWithConflictRangeRYWActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5190,17 +5194,17 @@ class ReadWithConflictRangeRYWActor1State { } int a_body1when2(Void const& _,int loopDepth) { - #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(internal_error(), loopDepth); - #line 5195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return loopDepth; } int a_body1when2(Void && _,int loopDepth) { - #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(internal_error(), loopDepth); - #line 5203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return loopDepth; } @@ -5301,20 +5305,20 @@ class ReadWithConflictRangeRYWActor1State { fdb_probe_actor_exit("readWithConflictRangeRYW", reinterpret_cast(this), 1); } - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetMappedRangeReq req; - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Snapshot snapshot; - #line 5310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; // This generated class is to be used only via readWithConflictRangeRYW() - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class ReadWithConflictRangeRYWActor1 final : public Actor, public ActorCallback< ReadWithConflictRangeRYWActor1, 0, MappedRangeResult >, public ActorCallback< ReadWithConflictRangeRYWActor1, 1, Void >, public FastAllocated>, public ReadWithConflictRangeRYWActor1State> { - #line 5317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -5324,9 +5328,9 @@ class ReadWithConflictRangeRYWActor1 final : public Actor, pu #pragma clang diagnostic pop friend struct ActorCallback< ReadWithConflictRangeRYWActor1, 0, MappedRangeResult >; friend struct ActorCallback< ReadWithConflictRangeRYWActor1, 1, Void >; - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadWithConflictRangeRYWActor1(ReadYourWritesTransaction* const& ryw,GetMappedRangeReq const& req,Snapshot const& snapshot) - #line 5329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor(), ReadWithConflictRangeRYWActor1State>(ryw, req, snapshot) { @@ -5349,16 +5353,16 @@ friend struct ActorCallback< ReadWithConflictRangeRYWActor1, 1, Void } }; - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" [[nodiscard]] static Future readWithConflictRangeRYW( ReadYourWritesTransaction* const& ryw, GetMappedRangeReq const& req, Snapshot const& snapshot ) { - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return Future(new ReadWithConflictRangeRYWActor1(ryw, req, snapshot)); - #line 5358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +#line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template static inline Future readWithConflictRangeForGetMappedRange( @@ -5369,7 +5373,7 @@ template // isolation support. But it is not default and is rarely used. So we disallow it until we have thorough test // coverage for it.) if (snapshot) { - TEST(true); // getMappedRange not supported for snapshot. + CODE_PROBE(true, "getMappedRange not supported for snapshot.", probe::decoration::rare); throw unsupported_operation(); } // For now, getMappedRange requires read-your-writes being NOT disabled. But the support of RYW is limited @@ -5378,7 +5382,7 @@ template // which returns the written value transparently. In another word, it makes sure not break RYW semantics without // actually implementing reading from the writes. if (ryw->options.readYourWritesDisabled) { - TEST(true); // getMappedRange not supported for read-your-writes disabled. + CODE_PROBE(true, "getMappedRange not supported for read-your-writes disabled.", probe::decoration::rare); throw unsupported_operation(); } @@ -5398,7 +5402,7 @@ template ++it; ASSERT(itCopy->value.size()); - TEST(itCopy->value.size() > 1); // Multiple watches on the same key triggered by RYOW + CODE_PROBE(itCopy->value.size() > 1, "Multiple watches on the same key triggered by RYOW"); for (int i = 0; i < itCopy->value.size(); i++) { if (itCopy->value[i]->onChangeTrigger.isSet()) { @@ -5430,30 +5434,30 @@ template triggerWatches(ryw, singleKeyRange(key), val, valueKnown); } - #line 5433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" // This generated class is to be used only via watch() - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class WatchActorState { - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" WatchActorState(ReadYourWritesTransaction* const& ryw,Key const& key) - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : ryw(ryw), - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" key(key), - #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" val(), - #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" watchFuture(), - #line 1283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" watch(new Watch(key)), - #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" done() - #line 5456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("watch", reinterpret_cast(this)); @@ -5466,37 +5470,37 @@ class WatchActorState { int a_body1(int loopDepth=0) { try { - #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->reading.add(done.getFuture()); - #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!ryw->options.readYourWritesDisabled) - #line 5473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->watchMap[key].push_back(watch); - #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" val = readWithConflictRange(ryw, GetValueReq(key), Snapshot::False); - #line 5479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } else { - #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->approximateSize += 2 * key.expectedSize() + 1; - #line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" val = ryw->tr.get(key); - #line 5487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } try { - #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_0 = ryw->resetPromise.getFuture() || success(val) || watch->onChangeTrigger.getFuture(); - #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 5494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5523,52 +5527,52 @@ class WatchActorState { } int a_body1cont1(int loopDepth) { - #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (watch->onChangeTrigger.getFuture().isReady()) - #line 5528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" done.send(Void()); - #line 1305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (watch->onChangeTrigger.getFuture().isError()) - #line 5534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(watch->onChangeTrigger.getFuture().getError(), loopDepth); - #line 5538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WatchActorState(); static_cast(this)->destroy(); return 0; } - #line 5542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WatchActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" watch->valuePresent = true; - #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" watch->value = val.get(); - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (watch->setPresent && (watch->setValue.present() != watch->value.present() || (watch->value.present() && watch->setValue.get() != watch->value.get()))) - #line 5554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" watch->onChangeTrigger.send(Void()); - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" done.send(Void()); - #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WatchActorState(); static_cast(this)->destroy(); return 0; } - #line 5562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WatchActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } try { - #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" watchFuture = ryw->tr.watch(watch); - #line 5571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = a_body1cont11(loopDepth); } catch (Error& error) { @@ -5582,11 +5586,11 @@ class WatchActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" done.send(Void()); - #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 5589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -5686,18 +5690,18 @@ class WatchActorState { } int a_body1cont6(int loopDepth) { - #line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" done.send(Void()); - #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_1 = watchFuture; - #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont6when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -5705,11 +5709,11 @@ class WatchActorState { int a_body1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" done.send(Void()); - #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 5712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -5734,9 +5738,9 @@ class WatchActorState { } int a_body1cont12(Void const& _,int loopDepth) { - #line 1330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WatchActorState(); static_cast(this)->destroy(); return 0; } - #line 5739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WatchActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5746,9 +5750,9 @@ class WatchActorState { } int a_body1cont12(Void && _,int loopDepth) { - #line 1330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WatchActorState(); static_cast(this)->destroy(); return 0; } - #line 5751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WatchActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5819,24 +5823,24 @@ class WatchActorState { fdb_probe_actor_exit("watch", reinterpret_cast(this), 1); } - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Key key; - #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Future> val; - #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Future watchFuture; - #line 1283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Reference watch; - #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Promise done; - #line 5834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; // This generated class is to be used only via watch() - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class WatchActor final : public Actor, public ActorCallback< WatchActor, 0, Void >, public ActorCallback< WatchActor, 1, Void >, public FastAllocated, public WatchActorState { - #line 5839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5846,9 +5850,9 @@ class WatchActor final : public Actor, public ActorCallback< WatchActor, 0 #pragma clang diagnostic pop friend struct ActorCallback< WatchActor, 0, Void >; friend struct ActorCallback< WatchActor, 1, Void >; - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" WatchActor(ReadYourWritesTransaction* const& ryw,Key const& key) - #line 5851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor(), WatchActorState(ryw, key) { @@ -5872,31 +5876,31 @@ friend struct ActorCallback< WatchActor, 1, Void >; } }; - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" [[nodiscard]] static Future watch( ReadYourWritesTransaction* const& ryw, Key const& key ) { - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return Future(new WatchActor(ryw, key)); - #line 5879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +#line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 5884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" // This generated class is to be used only via simulateTimeoutInFlightCommit() - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class SimulateTimeoutInFlightCommitActorState { - #line 5890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" SimulateTimeoutInFlightCommitActorState(ReadYourWritesTransaction* const& ryw_) - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : ryw_(ryw_), - #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw(Reference::addRef(ryw_)) - #line 5899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("simulateTimeoutInFlightCommit", reinterpret_cast(this)); @@ -5909,25 +5913,17 @@ class SimulateTimeoutInFlightCommitActorState { int a_body1(int loopDepth=0) { try { - #line 1335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ASSERT(ryw->options.timeoutInSeconds > 0); - #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - if (!ryw->resetPromise.isSet()) - #line 5916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" - { - #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - ryw->resetPromise.sendError(transaction_timed_out()); - #line 5920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" - } - #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - StrictFuture __when_expr_0 = delay(deterministicRandom()->random01() * 5); - #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + StrictFuture __when_expr_0 = success(ryw->getReadVersion()); + #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 5926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" static_cast(this)->actor_wait_state = 1; - #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5947,34 +5943,46 @@ class SimulateTimeoutInFlightCommitActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - TraceEvent("ClientBuggifyInFlightCommit").log(); - #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - StrictFuture __when_expr_1 = ryw->tr.commit(); - #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (!ryw->resetPromise.isSet()) + #line 5948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + ryw->resetPromise.sendError(transaction_timed_out()); + #line 5952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + StrictFuture __when_expr_1 = delay(deterministicRandom()->random01() * 5); + #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - #line 5956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" static_cast(this)->actor_wait_state = 2; - #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - TraceEvent("ClientBuggifyInFlightCommit").log(); - #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - StrictFuture __when_expr_1 = ryw->tr.commit(); - #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (!ryw->resetPromise.isSet()) + #line 5971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + ryw->resetPromise.sendError(transaction_timed_out()); + #line 5975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + StrictFuture __when_expr_1 = delay(deterministicRandom()->random01() * 5); + #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - #line 5973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" static_cast(this)->actor_wait_state = 2; - #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 5985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -6042,27 +6050,49 @@ class SimulateTimeoutInFlightCommitActorState { fdb_probe_actor_exit("simulateTimeoutInFlightCommit", reinterpret_cast(this), 0); } - int a_body1cont3(Void const& _,int loopDepth) + int a_body1cont2(Void const& _,int loopDepth) { - loopDepth = a_body1cont4(loopDepth); + #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + TraceEvent("ClientBuggifyInFlightCommit").log(); + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + StrictFuture __when_expr_2 = ryw->tr.commit(); + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + static_cast(this)->actor_wait_state = 3; + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont3(Void && _,int loopDepth) + int a_body1cont2(Void && _,int loopDepth) { - loopDepth = a_body1cont4(loopDepth); + #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + TraceEvent("ClientBuggifyInFlightCommit").log(); + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + StrictFuture __when_expr_2 = ryw->tr.commit(); + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + #line 6078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + static_cast(this)->actor_wait_state = 3; + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + loopDepth = 0; return loopDepth; } int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont3(_, loopDepth); + loopDepth = a_body1cont2(_, loopDepth); return loopDepth; } int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont3(std::move(_), loopDepth); + loopDepth = a_body1cont2(std::move(_), loopDepth); return loopDepth; } @@ -6117,25 +6147,100 @@ class SimulateTimeoutInFlightCommitActorState { fdb_probe_actor_exit("simulateTimeoutInFlightCommit", reinterpret_cast(this), 1); } - int a_body1cont4(int loopDepth) + int a_body1cont4(Void const& _,int loopDepth) + { + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont4(Void && _,int loopDepth) + { + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SimulateTimeoutInFlightCommitActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SimulateTimeoutInFlightCommitActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("simulateTimeoutInFlightCommit", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("simulateTimeoutInFlightCommit", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< SimulateTimeoutInFlightCommitActor, 2, Void >*,Void && value) { - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + fdb_probe_actor_enter("simulateTimeoutInFlightCommit", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("simulateTimeoutInFlightCommit", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< SimulateTimeoutInFlightCommitActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("simulateTimeoutInFlightCommit", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("simulateTimeoutInFlightCommit", reinterpret_cast(this), 2); + + } + int a_body1cont5(int loopDepth) + { + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" delete static_cast(this); - #line 6124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return 0; return loopDepth; } - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadYourWritesTransaction* ryw_; - #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Reference ryw; - #line 6133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; // This generated class is to be used only via simulateTimeoutInFlightCommit() - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" -class SimulateTimeoutInFlightCommitActor final : public Actor, public ActorCallback< SimulateTimeoutInFlightCommitActor, 0, Void >, public ActorCallback< SimulateTimeoutInFlightCommitActor, 1, Void >, public FastAllocated, public SimulateTimeoutInFlightCommitActorState { - #line 6138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +class SimulateTimeoutInFlightCommitActor final : public Actor, public ActorCallback< SimulateTimeoutInFlightCommitActor, 0, Void >, public ActorCallback< SimulateTimeoutInFlightCommitActor, 1, Void >, public ActorCallback< SimulateTimeoutInFlightCommitActor, 2, Void >, public FastAllocated, public SimulateTimeoutInFlightCommitActorState { + #line 6243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6145,9 +6250,10 @@ class SimulateTimeoutInFlightCommitActor final : public Actor, public Acto #pragma clang diagnostic pop friend struct ActorCallback< SimulateTimeoutInFlightCommitActor, 0, Void >; friend struct ActorCallback< SimulateTimeoutInFlightCommitActor, 1, Void >; - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +friend struct ActorCallback< SimulateTimeoutInFlightCommitActor, 2, Void >; + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" SimulateTimeoutInFlightCommitActor(ReadYourWritesTransaction* const& ryw_) - #line 6150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor(), SimulateTimeoutInFlightCommitActorState(ryw_) { @@ -6161,29 +6267,29 @@ friend struct ActorCallback< SimulateTimeoutInFlightCommitActor, 1, Void >; } }; - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" static void simulateTimeoutInFlightCommit( ReadYourWritesTransaction* const& ryw_ ) { - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" new SimulateTimeoutInFlightCommitActor(ryw_); - #line 6168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +#line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 6173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" // This generated class is to be used only via commit() - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class CommitActorState { - #line 6179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" CommitActorState(ReadYourWritesTransaction* const& ryw) - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : ryw(ryw) - #line 6186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("commit", reinterpret_cast(this)); @@ -6197,22 +6303,22 @@ class CommitActorState { { try { try { - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->commitStarted = true; - #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (ryw->options.specialKeySpaceChangeConfiguration) - #line 6204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_0 = ryw->getDatabase()->specialKeySpace->commit(ryw); - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 6210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } else @@ -6245,26 +6351,26 @@ class CommitActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!ryw->tr.apiVersionAtLeast(410)) - #line 6250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->commitStarted = false; - #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!ryw->resetPromise.isSet()) - #line 6256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->tr.reset(); - #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->resetRyow(); - #line 6262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } } - #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 6267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -6276,18 +6382,18 @@ class CommitActorState { } int a_body1cont2(int loopDepth) { - #line 1350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Future ready = ryw->reading; - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_1 = ryw->resetPromise.getFuture() || ready; - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 6285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -6369,53 +6475,53 @@ class CommitActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (ryw->options.readYourWritesDisabled) - #line 6374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->nativeReadRanges = ryw->tr.readConflictRanges(); - #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->nativeWriteRanges = ryw->tr.writeConflictRanges(); - #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" for( const auto& f : ryw->tr.getExtraReadConflictRanges() ) { - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (f.isReady() && f.get().first < f.get().second) - #line 6384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->nativeReadRanges.push_back( ryw->nativeReadRanges.arena(), KeyRangeRef(f.get().first, f.get().second) .withPrefix(readConflictRangeKeysRange.begin, ryw->nativeReadRanges.arena())); - #line 6388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } } - #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (ryw->resetPromise.isSet()) - #line 6393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch2(ryw->resetPromise.getFuture().getError(), loopDepth); - #line 6397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (CLIENT_BUGGIFY && ryw->options.timeoutInSeconds > 0) - #line 6401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" simulateTimeoutInFlightCommit(ryw); - #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch2(transaction_timed_out(), loopDepth); - #line 6407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_2 = ryw->resetPromise.getFuture() || ryw->tr.commit(); - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 6413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont4when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } else @@ -6427,53 +6533,53 @@ class CommitActorState { } int a_body1cont4(Void && _,int loopDepth) { - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (ryw->options.readYourWritesDisabled) - #line 6432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->nativeReadRanges = ryw->tr.readConflictRanges(); - #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->nativeWriteRanges = ryw->tr.writeConflictRanges(); - #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" for( const auto& f : ryw->tr.getExtraReadConflictRanges() ) { - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (f.isReady() && f.get().first < f.get().second) - #line 6442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->nativeReadRanges.push_back( ryw->nativeReadRanges.arena(), KeyRangeRef(f.get().first, f.get().second) .withPrefix(readConflictRangeKeysRange.begin, ryw->nativeReadRanges.arena())); - #line 6446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } } - #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (ryw->resetPromise.isSet()) - #line 6451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch2(ryw->resetPromise.getFuture().getError(), loopDepth); - #line 6455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (CLIENT_BUGGIFY && ryw->options.timeoutInSeconds > 0) - #line 6459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" simulateTimeoutInFlightCommit(ryw); - #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch2(transaction_timed_out(), loopDepth); - #line 6465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_2 = ryw->resetPromise.getFuture() || ryw->tr.commit(); - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 6471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont4when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } else @@ -6548,60 +6654,60 @@ class CommitActorState { } int a_body1cont5(int loopDepth) { - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->writeRangeToNativeTransaction(KeyRangeRef(StringRef(), allKeys.end)); - #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" auto conflictRanges = ryw->readConflicts.ranges(); - #line 1386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" for(auto iter = conflictRanges.begin();iter != conflictRanges.end();++iter) { - #line 1387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (iter->value()) - #line 6559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->tr.addReadConflictRange(iter->range()); - #line 6563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } } - #line 1392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (CLIENT_BUGGIFY && ryw->options.timeoutInSeconds > 0) - #line 6568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" simulateTimeoutInFlightCommit(ryw); - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch2(transaction_timed_out(), loopDepth); - #line 6574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_3 = ryw->resetPromise.getFuture() || ryw->tr.commit(); - #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 6580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont6(Void const& _,int loopDepth) { - #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->debugLogRetries(); - #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!ryw->tr.apiVersionAtLeast(410)) - #line 6596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->reset(); - #line 6600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitActorState(); static_cast(this)->destroy(); return 0; } - #line 6604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CommitActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6611,19 +6717,19 @@ class CommitActorState { } int a_body1cont6(Void && _,int loopDepth) { - #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->debugLogRetries(); - #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!ryw->tr.apiVersionAtLeast(410)) - #line 6618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->reset(); - #line 6622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitActorState(); static_cast(this)->destroy(); return 0; } - #line 6626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 6732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CommitActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6689,107 +6795,480 @@ class CommitActorState { catch (Error& error) { a_body1Catch2(error, 0); } catch (...) { - a_body1Catch2(unknown_error(), 0); + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("commit", reinterpret_cast(this), 2); + + } + int a_body1cont13(Void const& _,int loopDepth) + { + #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + ryw->debugLogRetries(); + #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (!ryw->tr.apiVersionAtLeast(410)) + #line 6809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + ryw->reset(); + #line 6813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitActorState(); static_cast(this)->destroy(); return 0; } + #line 6817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CommitActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont13(Void && _,int loopDepth) + { + #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + ryw->debugLogRetries(); + #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (!ryw->tr.apiVersionAtLeast(410)) + #line 6831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + ryw->reset(); + #line 6835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitActorState(); static_cast(this)->destroy(); return 0; } + #line 6839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CommitActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont5when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont13(_, loopDepth); + + return loopDepth; + } + int a_body1cont5when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont13(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CommitActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CommitActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("commit", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont5when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("commit", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< CommitActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("commit", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont5when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("commit", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< CommitActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("commit", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("commit", reinterpret_cast(this), 3); + + } + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + ReadYourWritesTransaction* ryw; + #line 6912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" +}; +// This generated class is to be used only via commit() + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +class CommitActor final : public Actor, public ActorCallback< CommitActor, 0, Void >, public ActorCallback< CommitActor, 1, Void >, public ActorCallback< CommitActor, 2, Void >, public ActorCallback< CommitActor, 3, Void >, public FastAllocated, public CommitActorState { + #line 6917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CommitActor, 0, Void >; +friend struct ActorCallback< CommitActor, 1, Void >; +friend struct ActorCallback< CommitActor, 2, Void >; +friend struct ActorCallback< CommitActor, 3, Void >; + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + CommitActor(ReadYourWritesTransaction* const& ryw) + #line 6931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + : Actor(), + CommitActorState(ryw) + { + fdb_probe_actor_enter("commit", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("commit"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("commit", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CommitActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CommitActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< CommitActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< CommitActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +[[nodiscard]] static Future commit( ReadYourWritesTransaction* const& ryw ) { + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + return Future(new CommitActor(ryw)); + #line 6961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" +} + +#line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + + // This function must not block unless a non-empty commitFuture is passed in + // If commitFuture is specified, this will wait for the future and report the result of + // the future in the output. If commitFuture isn't specified, then the transaction will + // be reported uncommitted. In that case, an optional error can be provided to indicate + // why the transaction was uncommitted. + #line 6971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" +// This generated class is to be used only via printDebugMessages() + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +template + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +class PrintDebugMessagesActorState { + #line 6977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" +public: + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + PrintDebugMessagesActorState(ReadYourWritesTransaction* const& self,Optional> const& commitFuture,Optional const& error = Optional()) + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + : self(self), + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + commitFuture(commitFuture), + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + error(error), + #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + prefix(), + #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + commitResult(), + #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + result(), + #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + debugTraces(std::move(self->debugTraces)), + #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + debugMessages(std::move(self->debugMessages)) + #line 6998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + fdb_probe_actor_create("printDebugMessages", reinterpret_cast(this)); + + } + ~PrintDebugMessagesActorState() + { + fdb_probe_actor_destroy("printDebugMessages", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 1440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + self->debugTraces.clear(); + #line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + self->debugMessages.clear(); + #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (commitFuture.present()) + #line 7017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + try { + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + StrictFuture __when_expr_0 = store(result, errorOr(commitFuture.get())); + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 7024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + else + { + loopDepth = a_body1cont1(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~PrintDebugMessagesActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 1451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + Version readVersion = self->getReadVersion().canGet() ? self->getReadVersion().get() : -1; + #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + Version commitVersion = result.present() ? self->getCommittedVersion() : -1; + #line 1454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (result.present()) + #line 7067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + commitResult = "Committed"; + #line 7071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + else + { + #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (result.getError().code() == error_code_commit_unknown_result || result.getError().code() == error_code_operation_cancelled || result.getError().code() == error_code_transaction_timed_out) + #line 7077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 1459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + commitResult = "Maybe committed"; + #line 7081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + else + { + #line 1460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (commitFuture.present()) + #line 7087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + commitResult = "Not committed"; + #line 7091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + else + { + #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + commitResult = "Uncommitted"; + #line 7097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + } + } + #line 1466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + for( auto& event : debugTraces ) { + #line 1467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + event.detail("CommitResult", commitResult).detail("ReadVersion", readVersion); + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (result.present()) + #line 7107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + event.detail("CommitVersion", commitVersion); + #line 7111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + else + { + #line 1471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (commitFuture.present()) + #line 7117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 1472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + event.errorUnsuppressed(result.getError()); + #line 7121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + else + { + #line 1473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (error.present()) + #line 7127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 1474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + event.errorUnsuppressed(error.get()); + #line 7131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + } + } + #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + event.log(); + #line 7137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + for( auto message : debugMessages ) { + #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + std::string cvString = result.present() ? fmt::format(" cv={}", commitVersion) : ""; + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + std::string errorString; + #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (commitFuture.present() && result.isError()) + #line 7147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + errorString = fmt::format(" error={}", result.getError().name()); + #line 7151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + else + { + #line 1485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (error.present()) + #line 7157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + errorString = fmt::format(" error={}", error.get().name()); + #line 7161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + } + #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + fmt::print("[{} rv={}{}{}] {}\n", commitResult, readVersion, cvString, errorString, message); + #line 7166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + #line 1492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (result.isError()) + #line 7170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + return a_body1Catch1(result.getError(), loopDepth); + #line 7174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } + #line 1496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PrintDebugMessagesActorState(); static_cast(this)->destroy(); return 0; } + #line 7178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~PrintDebugMessagesActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 1447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + result = e; + #line 7197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + loopDepth = a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - fdb_probe_actor_exit("commit", reinterpret_cast(this), 2); + return loopDepth; } - int a_body1cont13(Void const& _,int loopDepth) + int a_body1cont3(Void const& _,int loopDepth) { - #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - ryw->debugLogRetries(); - #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - if (!ryw->tr.apiVersionAtLeast(410)) - #line 6703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" - { - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - ryw->reset(); - #line 6707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" - } - #line 1403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitActorState(); static_cast(this)->destroy(); return 0; } - #line 6711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~CommitActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont4(loopDepth); return loopDepth; } - int a_body1cont13(Void && _,int loopDepth) + int a_body1cont3(Void && _,int loopDepth) { - #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - ryw->debugLogRetries(); - #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - if (!ryw->tr.apiVersionAtLeast(410)) - #line 6725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" - { - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - ryw->reset(); - #line 6729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" - } - #line 1403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitActorState(); static_cast(this)->destroy(); return 0; } - #line 6733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~CommitActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + loopDepth = a_body1cont4(loopDepth); return loopDepth; } - int a_body1cont5when1(Void const& _,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont13(_, loopDepth); + loopDepth = a_body1cont3(_, loopDepth); return loopDepth; } - int a_body1cont5when1(Void && _,int loopDepth) + int a_body1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont13(std::move(_), loopDepth); + loopDepth = a_body1cont3(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CommitActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< PrintDebugMessagesActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< CommitActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< PrintDebugMessagesActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("commit", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("printDebugMessages", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont5when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch2(error, 0); } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("commit", reinterpret_cast(this), 3); + fdb_probe_actor_exit("printDebugMessages", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< CommitActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< PrintDebugMessagesActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("commit", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("printDebugMessages", reinterpret_cast(this), 0); + a_exitChoose1(); try { - a_body1cont5when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch2(error, 0); } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("commit", reinterpret_cast(this), 3); + fdb_probe_actor_exit("printDebugMessages", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< CommitActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< PrintDebugMessagesActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("commit", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("printDebugMessages", reinterpret_cast(this), 0); + a_exitChoose1(); try { a_body1Catch2(err, 0); } @@ -6798,41 +7277,65 @@ class CommitActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("commit", reinterpret_cast(this), 3); + fdb_probe_actor_exit("printDebugMessages", reinterpret_cast(this), 0); } - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - ReadYourWritesTransaction* ryw; - #line 6806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + int a_body1cont4(int loopDepth) + { + try { + loopDepth = a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + ReadYourWritesTransaction* self; + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + Optional> commitFuture; + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + Optional error; + #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + std::string prefix; + #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + std::string commitResult; + #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + ErrorOr result; + #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + std::vector debugTraces; + #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + std::vector debugMessages; + #line 7312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; -// This generated class is to be used only via commit() - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" -class CommitActor final : public Actor, public ActorCallback< CommitActor, 0, Void >, public ActorCallback< CommitActor, 1, Void >, public ActorCallback< CommitActor, 2, Void >, public ActorCallback< CommitActor, 3, Void >, public FastAllocated, public CommitActorState { - #line 6811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" +// This generated class is to be used only via printDebugMessages() + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +class PrintDebugMessagesActor final : public Actor, public ActorCallback< PrintDebugMessagesActor, 0, Void >, public FastAllocated, public PrintDebugMessagesActorState { + #line 7317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< CommitActor, 0, Void >; -friend struct ActorCallback< CommitActor, 1, Void >; -friend struct ActorCallback< CommitActor, 2, Void >; -friend struct ActorCallback< CommitActor, 3, Void >; - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - CommitActor(ReadYourWritesTransaction* const& ryw) - #line 6825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" +friend struct ActorCallback< PrintDebugMessagesActor, 0, Void >; + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + PrintDebugMessagesActor(ReadYourWritesTransaction* const& self,Optional> const& commitFuture,Optional const& error = Optional()) + #line 7328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor(), - CommitActorState(ryw) + PrintDebugMessagesActorState(self, commitFuture, error) { - fdb_probe_actor_enter("commit", reinterpret_cast(this), -1); + fdb_probe_actor_enter("printDebugMessages", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("commit"); + this->lineage.setActorName("printDebugMessages"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("commit", reinterpret_cast(this), -1); + fdb_probe_actor_exit("printDebugMessages", reinterpret_cast(this), -1); } void cancel() override @@ -6840,39 +7343,36 @@ friend struct ActorCallback< CommitActor, 3, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< CommitActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< CommitActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< CommitActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< CommitActor, 3, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< PrintDebugMessagesActor, 0, Void >*)0, actor_cancelled()); break; } } }; - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" -[[nodiscard]] static Future commit( ReadYourWritesTransaction* const& ryw ) { - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - return Future(new CommitActor(ryw)); - #line 6855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +[[nodiscard]] static Future printDebugMessages( ReadYourWritesTransaction* const& self, Optional> const& commitFuture, Optional const& error = Optional() ) { + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + return Future(new PrintDebugMessagesActor(self, commitFuture, error)); + #line 7355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 1416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +#line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 6860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" // This generated class is to be used only via onError() - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class OnErrorActorState { - #line 6866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" OnErrorActorState(ReadYourWritesTransaction* const& ryw,Error const& e) - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : ryw(ryw), - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" e(e) - #line 6875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("onError", reinterpret_cast(this)); @@ -6885,43 +7385,51 @@ class OnErrorActorState { int a_body1(int loopDepth=0) { try { + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + if (ryw->debugTraces.size() > 0 || ryw->debugMessages.size() > 0) + #line 7390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + { + #line 1502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + ASSERT(printDebugMessages(ryw, {}, e).isReady()); + #line 7394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + } try { - #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (ryw->resetPromise.isSet()) - #line 6891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch2(ryw->resetPromise.getFuture().getError(), loopDepth); - #line 6895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" bool retry_limit_hit = ryw->options.maxRetries != -1 && ryw->retries >= ryw->options.maxRetries; - #line 1424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (ryw->retries < std::numeric_limits::max()) - #line 6901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->retries++; - #line 6905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (retry_limit_hit) - #line 6909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch2(e, loopDepth); - #line 6913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_0 = ryw->resetPromise.getFuture() || ryw->tr.onError(e); - #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 6919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6949,36 +7457,36 @@ class OnErrorActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!ryw->resetPromise.isSet()) - #line 6954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (ryw->tr.apiVersionAtLeast(610)) - #line 6958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->resetPromise.sendError(transaction_cancelled()); - #line 6962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } else { - #line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->resetRyow(); - #line 6968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } } - #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (e.code() == error_code_broken_promise) - #line 6973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(transaction_cancelled(), loopDepth); - #line 6977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 6981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -6988,15 +7496,15 @@ class OnErrorActorState { return loopDepth; } - int a_body1cont2(Void const& _,int loopDepth) + int a_body1cont3(Void const& _,int loopDepth) { - #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->debugLogRetries(e); - #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->resetRyow(); - #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OnErrorActorState(); static_cast(this)->destroy(); return 0; } - #line 6999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~OnErrorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7004,15 +7512,15 @@ class OnErrorActorState { return loopDepth; } - int a_body1cont2(Void && _,int loopDepth) + int a_body1cont3(Void && _,int loopDepth) { - #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->debugLogRetries(e); - #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ryw->resetRyow(); - #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OnErrorActorState(); static_cast(this)->destroy(); return 0; } - #line 7015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~OnErrorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7022,13 +7530,13 @@ class OnErrorActorState { } int a_body1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + loopDepth = a_body1cont3(_, loopDepth); return loopDepth; } int a_body1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont3(std::move(_), loopDepth); return loopDepth; } @@ -7083,16 +7591,16 @@ class OnErrorActorState { fdb_probe_actor_exit("onError", reinterpret_cast(this), 0); } - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Error e; - #line 7090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; // This generated class is to be used only via onError() - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class OnErrorActor final : public Actor, public ActorCallback< OnErrorActor, 0, Void >, public FastAllocated, public OnErrorActorState { - #line 7095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7101,9 +7609,9 @@ class OnErrorActor final : public Actor, public ActorCallback< OnErrorActo void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< OnErrorActor, 0, Void >; - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" OnErrorActor(ReadYourWritesTransaction* const& ryw,Error const& e) - #line 7106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor(), OnErrorActorState(ryw, e) { @@ -7126,29 +7634,29 @@ friend struct ActorCallback< OnErrorActor, 0, Void >; } }; - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" [[nodiscard]] static Future onError( ReadYourWritesTransaction* const& ryw, Error const& e ) { - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return Future(new OnErrorActor(ryw, e)); - #line 7133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 1449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +#line 1536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 7138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" // This generated class is to be used only via getReadVersion() - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class GetReadVersionActorState { - #line 7144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetReadVersionActorState(ReadYourWritesTransaction* const& ryw) - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : ryw(ryw) - #line 7151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("getReadVersion", reinterpret_cast(this)); @@ -7161,22 +7669,22 @@ class GetReadVersionActorState { int a_body1(int loopDepth=0) { try { - #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_0 = ryw->tr.getReadVersion(); - #line 1451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_1 = ryw->resetPromise.getFuture(); - #line 7172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7197,9 +7705,9 @@ class GetReadVersionActorState { } int a_body1when1(Version const& v,int loopDepth) { - #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(v); this->~GetReadVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 7202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< Version >::value()) Version(v); this->~GetReadVersionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7209,9 +7717,9 @@ class GetReadVersionActorState { } int a_body1when1(Version && v,int loopDepth) { - #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(v); this->~GetReadVersionActorState(); static_cast(this)->destroy(); return 0; } - #line 7214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< Version >::value()) Version(v); this->~GetReadVersionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7221,17 +7729,17 @@ class GetReadVersionActorState { } int a_body1when2(Void const& _,int loopDepth) { - #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(internal_error(), loopDepth); - #line 7226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return loopDepth; } int a_body1when2(Void && _,int loopDepth) { - #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(internal_error(), loopDepth); - #line 7234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return loopDepth; } @@ -7332,14 +7840,14 @@ class GetReadVersionActorState { fdb_probe_actor_exit("getReadVersion", reinterpret_cast(this), 1); } - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ReadYourWritesTransaction* ryw; - #line 7337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; // This generated class is to be used only via getReadVersion() - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class GetReadVersionActor final : public Actor, public ActorCallback< GetReadVersionActor, 0, Version >, public ActorCallback< GetReadVersionActor, 1, Void >, public FastAllocated, public GetReadVersionActorState { - #line 7342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7349,9 +7857,9 @@ class GetReadVersionActor final : public Actor, public ActorCallback< G #pragma clang diagnostic pop friend struct ActorCallback< GetReadVersionActor, 0, Version >; friend struct ActorCallback< GetReadVersionActor, 1, Void >; - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetReadVersionActor(ReadYourWritesTransaction* const& ryw) - #line 7354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor(), GetReadVersionActorState(ryw) { @@ -7374,18 +7882,18 @@ friend struct ActorCallback< GetReadVersionActor, 1, Void >; } }; - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" [[nodiscard]] static Future getReadVersion( ReadYourWritesTransaction* const& ryw ) { - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return Future(new GetReadVersionActor(ryw)); - #line 7381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +#line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" }; -ReadYourWritesTransaction::ReadYourWritesTransaction(Database const& cx, Optional tenantName) - : ISingleThreadTransaction(cx->deferredError), tr(cx, tenantName), cache(&arena), writes(&arena), retries(0), +ReadYourWritesTransaction::ReadYourWritesTransaction(Database const& cx, Optional> const& tenant) + : ISingleThreadTransaction(cx->deferredError), tr(cx, tenant), cache(&arena), writes(&arena), retries(0), approximateSize(0), creationTime(now()), commitStarted(false), versionStampFuture(tr.getVersionstamp()), specialKeySpaceWriteMap(std::make_pair(false, Optional()), specialKeys.end), options(tr) { std::copy( @@ -7394,30 +7902,30 @@ ReadYourWritesTransaction::ReadYourWritesTransaction(Database const& cx, Optiona } void ReadYourWritesTransaction::construct(Database const& cx) { - *this = ReadYourWritesTransaction(cx, Optional()); + *this = ReadYourWritesTransaction(cx); } -void ReadYourWritesTransaction::construct(Database const& cx, TenantName const& tenantName) { - *this = ReadYourWritesTransaction(cx, tenantName); +void ReadYourWritesTransaction::construct(Database const& cx, Reference const& tenant) { + *this = ReadYourWritesTransaction(cx, tenant); } - #line 7404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" namespace { // This generated class is to be used only via timebomb() - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class TimebombActorState { - #line 7411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" TimebombActorState(double const& endTime,Promise const& resetPromise) - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : endTime(endTime), - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resetPromise(resetPromise) - #line 7420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("timebomb", reinterpret_cast(this)); @@ -7430,9 +7938,9 @@ class TimebombActorState { int a_body1(int loopDepth=0) { try { - #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ; - #line 7435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -7453,17 +7961,17 @@ class TimebombActorState { } int a_body1cont1(int loopDepth) { - #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!resetPromise.isSet()) - #line 7458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { - #line 1485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" resetPromise.sendError(transaction_timed_out()); - #line 7462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return a_body1Catch1(transaction_timed_out(), loopDepth); - #line 7466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" return loopDepth; } @@ -7476,22 +7984,22 @@ class TimebombActorState { } int a_body1loopBody1(int loopDepth) { - #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!(now() < endTime)) - #line 7481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_0 = delayUntil(std::min(endTime + 0.0001, now() + CLIENT_KNOBS->TRANSACTION_TIMEOUT_DELAY_INTERVAL)); - #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 7489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 7997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -7584,16 +8092,16 @@ class TimebombActorState { fdb_probe_actor_exit("timebomb", reinterpret_cast(this), 0); } - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" double endTime; - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Promise resetPromise; - #line 7591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; // This generated class is to be used only via timebomb() - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class TimebombActor final : public Actor, public ActorCallback< TimebombActor, 0, Void >, public FastAllocated, public TimebombActorState { - #line 7596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7602,9 +8110,9 @@ class TimebombActor final : public Actor, public ActorCallback< TimebombAc void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< TimebombActor, 0, Void >; - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" TimebombActor(double const& endTime,Promise const& resetPromise) - #line 7607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor(), TimebombActorState(endTime, resetPromise) { @@ -7628,14 +8136,14 @@ friend struct ActorCallback< TimebombActor, 0, Void >; } }; } - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" [[nodiscard]] Future timebomb( double const& endTime, Promise const& resetPromise ) { - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return Future(new TimebombActor(endTime, resetPromise)); - #line 7635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +#line 1575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" void ReadYourWritesTransaction::resetTimeout() { timeoutActor = @@ -7662,21 +8170,21 @@ Optional getValueFromJSON(StatusObject statusObj) { } } - #line 7665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" namespace { // This generated class is to be used only via getJSON() - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class GetJSONActorState { - #line 7672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetJSONActorState(Database const& db) - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : db(db) - #line 7679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("getJSON", reinterpret_cast(this)); @@ -7689,16 +8197,16 @@ class GetJSONActorState { int a_body1(int loopDepth=0) { try { - #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_0 = StatusClient::statusFetcher(db); - #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7719,9 +8227,9 @@ class GetJSONActorState { } int a_body1cont1(StatusObject const& statusObj,int loopDepth) { - #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(getValueFromJSON(statusObj)); this->~GetJSONActorState(); static_cast(this)->destroy(); return 0; } - #line 7724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(getValueFromJSON(statusObj)); this->~GetJSONActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7731,9 +8239,9 @@ class GetJSONActorState { } int a_body1cont1(StatusObject && statusObj,int loopDepth) { - #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(getValueFromJSON(statusObj)); this->~GetJSONActorState(); static_cast(this)->destroy(); return 0; } - #line 7736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(getValueFromJSON(statusObj)); this->~GetJSONActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7804,14 +8312,14 @@ class GetJSONActorState { fdb_probe_actor_exit("getJSON", reinterpret_cast(this), 0); } - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Database db; - #line 7809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; // This generated class is to be used only via getJSON() - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class GetJSONActor final : public Actor>, public ActorCallback< GetJSONActor, 0, StatusObject >, public FastAllocated, public GetJSONActorState { - #line 7814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7820,9 +8328,9 @@ class GetJSONActor final : public Actor>, public ActorCallback< void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetJSONActor, 0, StatusObject >; - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetJSONActor(Database const& db) - #line 7825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor>(), GetJSONActorState(db) { @@ -7846,34 +8354,34 @@ friend struct ActorCallback< GetJSONActor, 0, StatusObject >; } }; } - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" [[nodiscard]] Future> getJSON( Database const& db ) { - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return Future>(new GetJSONActor(db)); - #line 7853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 1518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +#line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 7858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" namespace { // This generated class is to be used only via getWorkerInterfaces() - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" template - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class GetWorkerInterfacesActorState { - #line 7865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetWorkerInterfacesActorState(Reference const& connRecord) - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" : connRecord(connRecord), - #line 1520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" clusterInterface(new AsyncVar>), - #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" leaderMon(monitorLeader(connRecord, clusterInterface)) - #line 7876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" { fdb_probe_actor_create("getWorkerInterfaces", reinterpret_cast(this)); @@ -7886,9 +8394,9 @@ class GetWorkerInterfacesActorState { int a_body1(int loopDepth=0) { try { - #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" ; - #line 7891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -7916,22 +8424,22 @@ class GetWorkerInterfacesActorState { } int a_body1loopBody1(int loopDepth) { - #line 1525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture> __when_expr_0 = clusterInterface->get().present() ? brokenPromiseToNever( clusterInterface->get().get().getClientWorkers.getReply(GetClientWorkersRequest())) : Never(); - #line 1524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 7923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" StrictFuture __when_expr_1 = clusterInterface->onChange(); - #line 7927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -7944,17 +8452,17 @@ class GetWorkerInterfacesActorState { } int a_body1loopBody1when1(std::vector const& workers,int loopDepth) { - #line 1530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" RangeResult result; - #line 1531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" for( auto& it : workers ) { - #line 1532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.push_back_deep( result.arena(), KeyValueRef(it.address().toString(), BinaryWriter::toValue(it, IncludeVersion()))); - #line 7953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetWorkerInterfacesActorState(); static_cast(this)->destroy(); return 0; } - #line 7957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetWorkerInterfacesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7964,17 +8472,17 @@ class GetWorkerInterfacesActorState { } int a_body1loopBody1when1(std::vector && workers,int loopDepth) { - #line 1530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" RangeResult result; - #line 1531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" for( auto& it : workers ) { - #line 1532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" result.push_back_deep( result.arena(), KeyValueRef(it.address().toString(), BinaryWriter::toValue(it, IncludeVersion()))); - #line 7973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } - #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetWorkerInterfacesActorState(); static_cast(this)->destroy(); return 0; } - #line 7977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetWorkerInterfacesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8091,18 +8599,18 @@ class GetWorkerInterfacesActorState { fdb_probe_actor_exit("getWorkerInterfaces", reinterpret_cast(this), 1); } - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Reference connRecord; - #line 1520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Reference>> clusterInterface; - #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Future leaderMon; - #line 8100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" }; // This generated class is to be used only via getWorkerInterfaces() - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" class GetWorkerInterfacesActor final : public Actor, public ActorCallback< GetWorkerInterfacesActor, 0, std::vector >, public ActorCallback< GetWorkerInterfacesActor, 1, Void >, public FastAllocated, public GetWorkerInterfacesActorState { - #line 8105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8112,9 +8620,9 @@ class GetWorkerInterfacesActor final : public Actor, public ActorCa #pragma clang diagnostic pop friend struct ActorCallback< GetWorkerInterfacesActor, 0, std::vector >; friend struct ActorCallback< GetWorkerInterfacesActor, 1, Void >; - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" GetWorkerInterfacesActor(Reference const& connRecord) - #line 8117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" : Actor(), GetWorkerInterfacesActorState(connRecord) { @@ -8138,25 +8646,25 @@ friend struct ActorCallback< GetWorkerInterfacesActor, 1, Void >; } }; } - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" [[nodiscard]] Future getWorkerInterfaces( Reference const& connRecord ) { - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" + #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" return Future(new GetWorkerInterfacesActor(connRecord)); - #line 8145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" + #line 8653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.g.cpp" } -#line 1543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" +#line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ReadYourWrites.actor.cpp" Future> ReadYourWritesTransaction::get(const Key& key, Snapshot snapshot) { - TEST(true); // ReadYourWritesTransaction::get + CODE_PROBE(true, "ReadYourWritesTransaction::get"); if (getDatabase()->apiVersionAtLeast(630)) { if (specialKeys.contains(key)) { - TEST(true); // Special keys get + CODE_PROBE(true, "Special keys get"); return getDatabase()->specialKeySpace->get(this, key); } } else { - if (key == LiteralStringRef("\xff\xff/status/json")) { + if (key == "\xff\xff/status/json"_sr) { if (tr.getDatabase().getPtr() && tr.getDatabase()->getConnectionRecord()) { ++tr.getDatabase()->transactionStatusRequests; return getJSON(tr.getDatabase()); @@ -8165,7 +8673,7 @@ Future> ReadYourWritesTransaction::get(const Key& key, Snapshot } } - if (key == LiteralStringRef("\xff\xff/cluster_file_path")) { + if (key == "\xff\xff/cluster_file_path"_sr) { try { if (tr.getDatabase().getPtr() && tr.getDatabase()->getConnectionRecord()) { Optional output = StringRef(tr.getDatabase()->getConnectionRecord()->getLocation()); @@ -8177,7 +8685,7 @@ Future> ReadYourWritesTransaction::get(const Key& key, Snapshot return Optional(); } - if (key == LiteralStringRef("\xff\xff/connection_string")) { + if (key == "\xff\xff/connection_string"_sr) { try { if (tr.getDatabase().getPtr() && tr.getDatabase()->getConnectionRecord()) { Reference f = tr.getDatabase()->getConnectionRecord(); @@ -8235,11 +8743,11 @@ Future ReadYourWritesTransaction::getRange(KeySelector begin, if (getDatabase()->apiVersionAtLeast(630)) { if (specialKeys.contains(begin.getKey()) && specialKeys.begin <= end.getKey() && end.getKey() <= specialKeys.end) { - TEST(true); // Special key space get range + CODE_PROBE(true, "Special key space get range"); return getDatabase()->specialKeySpace->getRange(this, begin, end, limits, reverse); } } else { - if (begin.getKey() == LiteralStringRef("\xff\xff/worker_interfaces")) { + if (begin.getKey() == "\xff\xff/worker_interfaces"_sr) { if (tr.getDatabase().getPtr() && tr.getDatabase()->getConnectionRecord()) { return getWorkerInterfaces(tr.getDatabase()->getConnectionRecord()); } else { @@ -8261,7 +8769,7 @@ Future ReadYourWritesTransaction::getRange(KeySelector begin, // This optimization prevents nullptr operations from being added to the conflict range if (limits.isReached()) { - TEST(true); // RYW range read limit 0 + CODE_PROBE(true, "RYW range read limit 0"); return RangeResult(); } @@ -8275,7 +8783,7 @@ Future ReadYourWritesTransaction::getRange(KeySelector begin, end.removeOrEqual(end.arena()); if (begin.offset >= end.offset && begin.getKey() >= end.getKey()) { - TEST(true); // RYW range inverted + CODE_PROBE(true, "RYW range inverted"); return RangeResult(); } @@ -8304,11 +8812,11 @@ Future ReadYourWritesTransaction::getMappedRange(KeySelector if (getDatabase()->apiVersionAtLeast(630)) { if (specialKeys.contains(begin.getKey()) && specialKeys.begin <= end.getKey() && end.getKey() <= specialKeys.end) { - TEST(true); // Special key space get range (getMappedRange) + CODE_PROBE(true, "Special key space get range (getMappedRange)", probe::decoration::rare); throw client_invalid_operation(); // Not support special keys. } } else { - if (begin.getKey() == LiteralStringRef("\xff\xff/worker_interfaces")) { + if (begin.getKey() == "\xff\xff/worker_interfaces"_sr) { throw client_invalid_operation(); // Not support special keys. } } @@ -8326,7 +8834,7 @@ Future ReadYourWritesTransaction::getMappedRange(KeySelector // This optimization prevents nullptr operations from being added to the conflict range if (limits.isReached()) { - TEST(true); // RYW range read limit 0 (getMappedRange) + CODE_PROBE(true, "RYW range read limit 0 (getMappedRange)", probe::decoration::rare); return MappedRangeResult(); } @@ -8340,7 +8848,7 @@ Future ReadYourWritesTransaction::getMappedRange(KeySelector end.removeOrEqual(end.arena()); if (begin.offset >= end.offset && begin.getKey() >= end.getKey()) { - TEST(true); // RYW range inverted (getMappedRange) + CODE_PROBE(true, "RYW range inverted (getMappedRange)", probe::decoration::rare); return MappedRangeResult(); } @@ -8376,7 +8884,10 @@ Future ReadYourWritesTransaction::getEstimatedRangeSizeBytes(const KeyR if (resetPromise.isSet()) return resetPromise.getFuture().getError(); - return map(waitOrError(tr.getDatabase()->getStorageMetrics(keys, -1), resetPromise.getFuture()), + // Pass in the TransactionState only if tenant is present + Optional> trState = + tr.trState->hasTenant() ? tr.trState : Optional>(); + return map(waitOrError(tr.getDatabase()->getStorageMetrics(keys, -1, trState), resetPromise.getFuture()), [](const StorageMetrics& m) { return m.bytes; }); } @@ -8395,7 +8906,8 @@ Future>> ReadYourWritesTransaction::getRangeSplitPo return waitOrError(tr.getRangeSplitPoints(range, chunkSize), resetPromise.getFuture()); } -Future>> ReadYourWritesTransaction::getBlobGranuleRanges(const KeyRange& range) { +Future>> ReadYourWritesTransaction::getBlobGranuleRanges(const KeyRange& range, + int rangeLimit) { if (checkUsedDuringCommit()) { return used_during_commit(); } @@ -8406,7 +8918,7 @@ Future>> ReadYourWritesTransaction::getBlobGra if (range.begin > maxKey || range.end > maxKey) return key_outside_legal_range(); - return waitOrError(tr.getBlobGranuleRanges(range), resetPromise.getFuture()); + return waitOrError(tr.getBlobGranuleRanges(range, rangeLimit), resetPromise.getFuture()); } Future>> ReadYourWritesTransaction::readBlobGranules( @@ -8414,7 +8926,6 @@ Future>> ReadYourWritesTransaction::re Version begin, Optional readVersion, Version* readVersionOut) { - if (!options.readYourWritesDisabled) { return blob_granule_no_ryw(); } @@ -8433,6 +8944,31 @@ Future>> ReadYourWritesTransaction::re return waitOrError(tr.readBlobGranules(range, begin, readVersion, readVersionOut), resetPromise.getFuture()); } +Future>> ReadYourWritesTransaction::summarizeBlobGranules( + const KeyRange& range, + Optional summaryVersion, + int rangeLimit) { + if (checkUsedDuringCommit()) { + return used_during_commit(); + } + + if (resetPromise.isSet()) + return resetPromise.getFuture().getError(); + + KeyRef maxKey = getMaxReadKey(); + if (range.begin > maxKey || range.end > maxKey) + return key_outside_legal_range(); + + return waitOrError(tr.summarizeBlobGranules(range, summaryVersion, rangeLimit), resetPromise.getFuture()); +} + +void ReadYourWritesTransaction::addGranuleMaterializeStats(const GranuleMaterializeStats& stats) { + if (checkUsedDuringCommit()) { + throw used_during_commit(); + } + tr.addGranuleMaterializeStats(stats); +} + void ReadYourWritesTransaction::addReadConflictRange(KeyRangeRef const& keys) { if (checkUsedDuringCommit()) { throw used_during_commit(); @@ -8601,7 +9137,7 @@ void ReadYourWritesTransaction::getWriteConflicts(KeyRangeMap* result) { } } -void ReadYourWritesTransaction::setTransactionID(uint64_t id) { +void ReadYourWritesTransaction::setTransactionID(UID id) { tr.setTransactionID(id); } @@ -8610,7 +9146,7 @@ void ReadYourWritesTransaction::setToken(uint64_t token) { } RangeResult ReadYourWritesTransaction::getReadConflictRangeIntersecting(KeyRangeRef kr) { - TEST(true); // Special keys read conflict range + CODE_PROBE(true, "Special keys read conflict range"); ASSERT(readConflictRangeKeysRange.contains(kr)); ASSERT(!tr.trState->options.checkWritesEnabled); RangeResult result; @@ -8624,22 +9160,20 @@ RangeResult ReadYourWritesTransaction::getReadConflictRangeIntersecting(KeyRange if (kr.begin <= iter->begin() && iter->begin() < kr.end) { result.push_back(result.arena(), KeyValueRef(iter->begin().withPrefix(readConflictRangeKeysRange.begin, result.arena()), - iter->value() ? LiteralStringRef("1") : LiteralStringRef("0"))); + iter->value() ? "1"_sr : "0"_sr)); } } } else { - CoalescedKeyRefRangeMap readConflicts{ LiteralStringRef("0"), specialKeys.end }; + CoalescedKeyRefRangeMap readConflicts{ "0"_sr, specialKeys.end }; for (const auto& range : tr.readConflictRanges()) - readConflicts.insert(range.withPrefix(readConflictRangeKeysRange.begin, result.arena()), - LiteralStringRef("1")); + readConflicts.insert(range.withPrefix(readConflictRangeKeysRange.begin, result.arena()), "1"_sr); for (const auto& range : nativeReadRanges) - readConflicts.insert(range.withPrefix(readConflictRangeKeysRange.begin, result.arena()), - LiteralStringRef("1")); + readConflicts.insert(range.withPrefix(readConflictRangeKeysRange.begin, result.arena()), "1"_sr); for (const auto& f : tr.getExtraReadConflictRanges()) { if (f.isReady() && f.get().first < f.get().second) readConflicts.insert(KeyRangeRef(f.get().first, f.get().second) .withPrefix(readConflictRangeKeysRange.begin, result.arena()), - LiteralStringRef("1")); + "1"_sr); } auto beginIter = readConflicts.rangeContaining(kr.begin); if (beginIter->begin() != kr.begin) @@ -8652,12 +9186,12 @@ RangeResult ReadYourWritesTransaction::getReadConflictRangeIntersecting(KeyRange } RangeResult ReadYourWritesTransaction::getWriteConflictRangeIntersecting(KeyRangeRef kr) { - TEST(true); // Special keys write conflict range + CODE_PROBE(true, "Special keys write conflict range"); ASSERT(writeConflictRangeKeysRange.contains(kr)); RangeResult result; // Memory owned by result - CoalescedKeyRefRangeMap writeConflicts{ LiteralStringRef("0"), specialKeys.end }; + CoalescedKeyRefRangeMap writeConflicts{ "0"_sr, specialKeys.end }; if (!options.readYourWritesDisabled) { KeyRangeRef strippedWriteRangePrefix = kr.removePrefix(writeConflictRangeKeysRange.begin); @@ -8670,15 +9204,13 @@ RangeResult ReadYourWritesTransaction::getWriteConflictRangeIntersecting(KeyRang writeConflicts.insert( KeyRangeRef(it.beginKey().toArena(result.arena()), it.endKey().toArena(result.arena())) .withPrefix(writeConflictRangeKeysRange.begin, result.arena()), - LiteralStringRef("1")); + "1"_sr); } } else { for (const auto& range : tr.writeConflictRanges()) - writeConflicts.insert(range.withPrefix(writeConflictRangeKeysRange.begin, result.arena()), - LiteralStringRef("1")); + writeConflicts.insert(range.withPrefix(writeConflictRangeKeysRange.begin, result.arena()), "1"_sr); for (const auto& range : nativeWriteRanges) - writeConflicts.insert(range.withPrefix(writeConflictRangeKeysRange.begin, result.arena()), - LiteralStringRef("1")); + writeConflicts.insert(range.withPrefix(writeConflictRangeKeysRange.begin, result.arena()), "1"_sr); } for (const auto& k : versionStampKeys) { @@ -8698,8 +9230,7 @@ RangeResult ReadYourWritesTransaction::getWriteConflictRangeIntersecting(KeyRang } else { range = getVersionstampKeyRange(result.arena(), k, tr.getCachedReadVersion().orDefault(0), getMaxReadKey()); } - writeConflicts.insert(range.withPrefix(writeConflictRangeKeysRange.begin, result.arena()), - LiteralStringRef("1")); + writeConflicts.insert(range.withPrefix(writeConflictRangeKeysRange.begin, result.arena()), "1"_sr); } auto beginIter = writeConflicts.rangeContaining(kr.begin); @@ -8745,19 +9276,19 @@ void ReadYourWritesTransaction::atomicOp(const KeyRef& key, const ValueRef& oper KeyRef k; if (!tr.apiVersionAtLeast(520) && operationType == MutationRef::SetVersionstampedKey) { - k = key.withSuffix(LiteralStringRef("\x00\x00"), arena); + k = key.withSuffix("\x00\x00"_sr, arena); } else { k = KeyRef(arena, key); } ValueRef v; if (!tr.apiVersionAtLeast(520) && operationType == MutationRef::SetVersionstampedValue) { - v = operand.withSuffix(LiteralStringRef("\x00\x00\x00\x00"), arena); + v = operand.withSuffix("\x00\x00\x00\x00"_sr, arena); } else { v = ValueRef(arena, operand); } if (operationType == MutationRef::SetVersionstampedKey) { - TEST(options.readYourWritesDisabled); // SetVersionstampedKey without ryw enabled + CODE_PROBE(options.readYourWritesDisabled, "SetVersionstampedKey without ryw enabled"); // this does validation of the key and needs to be performed before the readYourWritesDisabled path KeyRangeRef range = getVersionstampKeyRange(arena, k, tr.getCachedReadVersion().orDefault(0), getMaxReadKey()); versionStampKeys.push_back(arena, k); @@ -8803,17 +9334,17 @@ void ReadYourWritesTransaction::set(const KeyRef& key, const ValueRef& value) { } else { // These three special keys are deprecated in 7.0 and an alternative C API is added // TODO : Rewrite related code using C api - if (key == LiteralStringRef("\xff\xff/reboot_worker")) { + if (key == "\xff\xff/reboot_worker"_sr) { BinaryReader::fromStringRef(value, IncludeVersion()) .reboot.send(RebootRequest()); return; } - if (key == LiteralStringRef("\xff\xff/suspend_worker")) { + if (key == "\xff\xff/suspend_worker"_sr) { BinaryReader::fromStringRef(value, IncludeVersion()) .reboot.send(RebootRequest(false, false, options.timeoutInSeconds)); return; } - if (key == LiteralStringRef("\xff\xff/reboot_and_check_worker")) { + if (key == "\xff\xff/reboot_and_check_worker"_sr) { BinaryReader::fromStringRef(value, IncludeVersion()) .reboot.send(RebootRequest(false, true)); return; @@ -8996,14 +9527,16 @@ void ReadYourWritesTransaction::addWriteConflictRange(KeyRangeRef const& keys) { } Future ReadYourWritesTransaction::commit() { + Future result; if (checkUsedDuringCommit()) { - return used_during_commit(); + result = used_during_commit(); + } else if (resetPromise.isSet()) { + result = resetPromise.getFuture().getError(); + } else { + result = RYWImpl::commit(this); } - if (resetPromise.isSet()) - return resetPromise.getFuture().getError(); - - return RYWImpl::commit(this); + return debugMessages.size() > 0 || debugTraces.size() > 0 ? RYWImpl::printDebugMessages(this, result) : result; } Future> ReadYourWritesTransaction::getVersionstamp() { @@ -9016,9 +9549,12 @@ Future> ReadYourWritesTransaction::getVersionstamp() { void ReadYourWritesTransaction::setOption(FDBTransactionOptions::Option option, Optional value) { setOptionImpl(option, value); - - if (FDBTransactionOptions::optionInfo.getMustExist(option).persistent) { - persistentOptions.emplace_back(option, value.castTo>()); + auto const& opt = FDBTransactionOptions::optionInfo.getMustExist(option); + if (opt.persistent) { + if (opt.sensitive) + sensitivePersistentOptions.emplace_back(option, value.castTo()); + else + persistentOptions.emplace_back(option, value.castTo>()); } } @@ -9027,7 +9563,7 @@ void ReadYourWritesTransaction::setOptionImpl(FDBTransactionOptions::Option opti case FDBTransactionOptions::READ_YOUR_WRITES_DISABLE: validateOptionValueNotPresent(value); - if (!reading.isReady() || !cache.empty() || !writes.empty()) + if (reading.getFutureCount() > 0 || !cache.empty() || !writes.empty()) throw client_invalid_operation(); options.readYourWritesDisabled = true; @@ -9131,10 +9667,13 @@ void ReadYourWritesTransaction::operator=(ReadYourWritesTransaction&& r) noexcep cache.arena = &arena; writes.arena = &arena; persistentOptions = std::move(r.persistentOptions); + sensitivePersistentOptions = std::move(r.sensitivePersistentOptions); nativeReadRanges = std::move(r.nativeReadRanges); nativeWriteRanges = std::move(r.nativeWriteRanges); versionStampKeys = std::move(r.versionStampKeys); specialKeySpaceWriteMap = std::move(r.specialKeySpaceWriteMap); + debugTraces = std::move(r.debugTraces); + debugMessages = std::move(r.debugMessages); } ReadYourWritesTransaction::ReadYourWritesTransaction(ReadYourWritesTransaction&& r) noexcept @@ -9150,10 +9689,13 @@ ReadYourWritesTransaction::ReadYourWritesTransaction(ReadYourWritesTransaction&& watchMap = std::move(r.watchMap); r.resetPromise = Promise(); persistentOptions = std::move(r.persistentOptions); + sensitivePersistentOptions = std::move(r.sensitivePersistentOptions); nativeReadRanges = std::move(r.nativeReadRanges); nativeWriteRanges = std::move(r.nativeWriteRanges); versionStampKeys = std::move(r.versionStampKeys); specialKeySpaceWriteMap = std::move(r.specialKeySpaceWriteMap); + debugTraces = std::move(r.debugTraces); + debugMessages = std::move(r.debugMessages); } Future ReadYourWritesTransaction::onError(Error const& e) { @@ -9162,13 +9704,16 @@ Future ReadYourWritesTransaction::onError(Error const& e) { void ReadYourWritesTransaction::applyPersistentOptions() { Optional timeout; - for (auto option : persistentOptions) { + for (auto const& option : persistentOptions) { if (option.first == FDBTransactionOptions::TIMEOUT) { timeout = option.second.castTo(); } else { setOptionImpl(option.first, option.second.castTo()); } } + for (auto const& option : sensitivePersistentOptions) { + setOptionImpl(option.first, option.second.castTo()); + } // Setting a timeout can immediately cause a transaction to fail. The only timeout // that matters is the one most recently set, so we ignore any earlier set timeouts @@ -9215,11 +9760,17 @@ void ReadYourWritesTransaction::cancel() { } void ReadYourWritesTransaction::reset() { + if (debugTraces.size() > 0 || debugMessages.size() > 0) { + // printDebugMessages returns a future but will not block if called with an empty second argument + ASSERT(RYWImpl::printDebugMessages(this, {}).isReady()); + } + retries = 0; approximateSize = 0; creationTime = now(); timeoutActor.cancel(); persistentOptions.clear(); + sensitivePersistentOptions.clear(); options.reset(tr); transactionDebugInfo.clear(); tr.fullReset(); @@ -9247,6 +9798,11 @@ KeyRef ReadYourWritesTransaction::getMaxWriteKey() { ReadYourWritesTransaction::~ReadYourWritesTransaction() { if (!resetPromise.isSet()) resetPromise.sendError(transaction_cancelled()); + + if (debugTraces.size() || debugMessages.size()) { + // printDebugMessages returns a future but will not block if called with an empty second argument + [[maybe_unused]] Future f = RYWImpl::printDebugMessages(this, {}); + } } bool ReadYourWritesTransaction::checkUsedDuringCommit() { @@ -9287,3 +9843,13 @@ void ReadYourWritesTransaction::debugLogRetries(Optional error) { } } } + +void ReadYourWritesTransaction::debugTrace(BaseTraceEvent&& event) { + if (event.isEnabled()) { + debugTraces.emplace_back(std::move(event)); + } +} + +void ReadYourWritesTransaction::debugPrint(std::string const& message) { + debugMessages.push_back(message); +} diff --git a/src/fdbclient/Schemas.cpp b/src/fdbclient/Schemas.cpp index 278fb9b..953996e 100644 --- a/src/fdbclient/Schemas.cpp +++ b/src/fdbclient/Schemas.cpp @@ -21,13 +21,17 @@ #include "fdbclient/Schemas.h" // NOTE: also change mr-status-json-schemas.rst.inc -const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( +const KeyRef JSONSchemas::statusSchema = R"statusSchema( { "cluster":{ "storage_wiggler": { + "error": "some error description", "wiggle_server_ids":["0ccb4e0feddb55"], "wiggle_server_addresses": ["127.0.0.1"], "primary": { + "state": {"$enum":["running", "paused", "unknown"]}, + "last_state_change_datetime": "2022-04-02 00:05:05.123 +0000", + "last_state_change_timestamp": 1648857905.123, "last_round_start_datetime": "2022-04-02 00:05:05.123 +0000", "last_round_start_timestamp": 1648857905.123, "last_round_finish_datetime": "1970-01-01 00:00:00.000 +0000", @@ -42,6 +46,9 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "finished_wiggle": 1 }, "remote": { + "state": {"$enum":["running", "paused", "unknown"]}, + "last_state_change_datetime": "2022-04-02 00:05:05.123 +0000", + "last_state_change_timestamp": 1648857905.123, "last_round_start_datetime": "2022-04-02 00:05:05.123 +0000", "last_round_start_timestamp": 1648857905.123, "last_round_finish_datetime": "1970-01-01 00:00:00.000 +0000", @@ -130,6 +137,7 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "blob_manager", "blob_worker", "encrypt_key_proxy", + "consistency_scan", "storage_cache", "router", "coordinator" @@ -137,7 +145,21 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( }, "storage_metadata":{ "created_time_datetime":"1970-01-01 00:00:00.000 +0000", - "created_time_timestamp": 0 + "created_time_timestamp": 0, + "storage_engine":{ + "$enum":[ + "ssd", + "ssd-1", + "ssd-2", + "ssd-redwood-1", + "ssd-rocksdb-v1", + "ssd-sharded-rocksdb", + "memory", + "memory-1", + "memory-2", + "memory-radixtree-beta", + "unknown" + ]} }, "data_version":12341234, "durable_version":12341234, @@ -406,7 +428,9 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "log_server_min_free_space", "log_server_min_free_space_ratio", "storage_server_durability_lag", - "storage_server_list_fetch_failed" + "storage_server_list_fetch_failed", + "blob_worker_lag", + "blob_worker_missing" ] }, "description":"The database is not being saturated by the workload." @@ -427,7 +451,9 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "log_server_min_free_space", "log_server_min_free_space_ratio", "storage_server_durability_lag", - "storage_server_list_fetch_failed" + "storage_server_list_fetch_failed", + "blob_worker_lag", + "blob_worker_missing" ] }, "description":"The database is not being saturated by the workload." @@ -536,6 +562,7 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "unreachable_ratekeeper_worker", "unreachable_blobManager_worker", "unreachable_encryptKeyProxy_worker", + "unreachable_consistencyScan_worker", "unreadable_configuration", "full_replication_timeout", "client_issues", @@ -555,7 +582,8 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "duplicate_mutation_fetch_timeout", "primary_dc_missing", "fetch_primary_dc_timeout", - "fetch_storage_wiggler_stats_timeout" + "fetch_storage_wiggler_stats_timeout", + "fetch_consistency_scan_info_timeout" ] }, "issues":[ @@ -574,8 +602,6 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "description":"abc" } ], -)statusSchema" - R"statusSchema( "recovery_state":{ "seconds_since_last_recovered":1, "required_resolvers":1, @@ -697,12 +723,15 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( }, "cluster_controller_timestamp":1415650089, "protocol_version":"fdb00a400050001", + "newest_protocol_version":"fdb00a500040001", + "lowest_compatible_protocol_version":"fdb00a500040001", "connection_string":"a:a@127.0.0.1:4000", "full_replication":true, "maintenance_zone":"0ccb4e0fdbdb5583010f6b77d9d10ece", "maintenance_seconds_remaining":1.0, "data_distribution_disabled_for_ss_failures":true, "data_distribution_disabled_for_rebalance":true, + "data_distribution_disabled_hex": "1", "data_distribution_disabled":true, "active_primary_dc":"pv", "bounce_impact":{ @@ -762,15 +791,28 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "storage_replication_policy":"(zoneid^3x1)", "logs":2, "log_version":2, - "log_engine":1, + "log_engine":{ + "$enum":[ + "ssd", + "ssd-1", + "ssd-2", + "ssd-redwood-1", + "ssd-rocksdb-v1", + "ssd-sharded-rocksdb", + "memory", + "memory-1", + "memory-2", + "memory-radixtree-beta" + ]}, "log_spill":1, "storage_engine":{ "$enum":[ "ssd", "ssd-1", "ssd-2", - "ssd-redwood-1-experimental", + "ssd-redwood-1", "ssd-rocksdb-v1", + "ssd-sharded-rocksdb", "memory", "memory-1", "memory-2", @@ -782,8 +824,9 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "ssd", "ssd-1", "ssd-2", - "ssd-redwood-1-experimental", + "ssd-redwood-1", "ssd-rocksdb-v1", + "ssd-sharded-rocksdb", "memory", "memory-1", "memory-2", @@ -813,6 +856,7 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "ssd-2", "ssd-redwood-1", "ssd-rocksdb-v1", + "ssd-sharded-rocksdb", "memory", "memory-1", "memory-2", @@ -831,8 +875,27 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "disabled", "optional_experimental", "required_experimental" + ]}, + "encryption_at_rest_mode": { + "$enum":[ + "disabled", + "domain_aware", + "cluster_aware" ]} }, + "consistency_scan_info":{ + "consistency_scan_enabled":false, + "restart":false, + "max_rate":0, + "target_interval":0, + "bytes_read_prev_round":0, + "last_round_start_datetime":"2022-04-20 00:05:05.123 +0000", + "last_round_finish_datetime":"1970-01-01 00:00:00.000 +0000", + "last_round_start_timestamp":1648857905.123, + "last_round_finish_timestamp":0, + "smoothed_round_seconds":1, + "finished_rounds":1 + }, "data":{ "least_operating_space_bytes_log_server":0, "average_partition_size_bytes":0, @@ -849,6 +912,7 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "healthy_repartitioning", "healthy_removing_server", "healthy_rebalancing", + "healthy_perpetual_wiggle", "healthy" ] }, @@ -884,6 +948,7 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "healthy_repartitioning", "healthy_removing_server", "healthy_rebalancing", + "healthy_perpetual_wiggle", "healthy" ] }, @@ -924,6 +989,34 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "logical_core_utilization":0.4 } } + }, + "metacluster" : { + "cluster_type" : "management", + "metacluster_name":"metacluster1", + "metacluster_id":12345, + "data_cluster_name" : "data_cluster1", + "data_cluster_id" : 12346, + "num_data_clusters":10 + }, + "kms_is_healthy": true, + "encryption_at_rest": { + "ekp_is_healthy": true + }, + "tenants":{ + "num_tenants":0, + "num_tenant_groups":10, + "tenant_group_capacity":20 + }, + "idempotency_ids":{ + "size_bytes": 0, + "expired_version": 0, + "expired_age": 0, + "oldest_id_version": 0, + "oldest_id_age": 0 + }, + "version_epoch":{ + "enabled": false, + "epoch": 0 } }, "client":{ @@ -965,9 +1058,9 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema( "up_to_date":true } } -})statusSchema"); +})statusSchema"_sr; -const KeyRef JSONSchemas::clusterConfigurationSchema = LiteralStringRef(R"configSchema( +const KeyRef JSONSchemas::clusterConfigurationSchema = R"configSchema( { "create":{ "$enum":[ @@ -1037,9 +1130,9 @@ const KeyRef JSONSchemas::clusterConfigurationSchema = LiteralStringRef(R"config "auto_logs":3, "commit_proxies":5, "grv_proxies":1 -})configSchema"); +})configSchema"_sr; -const KeyRef JSONSchemas::latencyBandConfigurationSchema = LiteralStringRef(R"configSchema( +const KeyRef JSONSchemas::latencyBandConfigurationSchema = R"configSchema( { "get_read_version":{ "bands":[ @@ -1059,30 +1152,30 @@ const KeyRef JSONSchemas::latencyBandConfigurationSchema = LiteralStringRef(R"co ], "max_commit_bytes":0 } -})configSchema"); +})configSchema"_sr; -const KeyRef JSONSchemas::dataDistributionStatsSchema = LiteralStringRef(R"""( +const KeyRef JSONSchemas::dataDistributionStatsSchema = R"""( { "shard_bytes": 1947000 } -)"""); +)"""_sr; -const KeyRef JSONSchemas::logHealthSchema = LiteralStringRef(R"""( +const KeyRef JSONSchemas::logHealthSchema = R"""( { "log_queue": 156 } -)"""); +)"""_sr; -const KeyRef JSONSchemas::storageHealthSchema = LiteralStringRef(R"""( +const KeyRef JSONSchemas::storageHealthSchema = R"""( { "cpu_usage": 3.28629447047675, "disk_usage": 0.19997897369207954, "storage_durability_lag": 5050809, "storage_queue": 2030 } -)"""); +)"""_sr; -const KeyRef JSONSchemas::aggregateHealthSchema = LiteralStringRef(R"""( +const KeyRef JSONSchemas::aggregateHealthSchema = R"""( { "batch_limited": false, "limiting_storage_durability_lag": 5050809, @@ -1092,12 +1185,12 @@ const KeyRef JSONSchemas::aggregateHealthSchema = LiteralStringRef(R"""( "worst_storage_queue": 2030, "worst_log_queue": 156 } -)"""); +)"""_sr; -const KeyRef JSONSchemas::managementApiErrorSchema = LiteralStringRef(R"""( +const KeyRef JSONSchemas::managementApiErrorSchema = R"""( { "retriable": false, "command": "exclude", "message": "The reason of the error" } -)"""); +)"""_sr; diff --git a/src/fdbclient/ServerKnobs.cpp b/src/fdbclient/ServerKnobs.cpp index 7987479..97900d1 100644 --- a/src/fdbclient/ServerKnobs.cpp +++ b/src/fdbclient/ServerKnobs.cpp @@ -19,6 +19,7 @@ */ #include "fdbclient/ServerKnobs.h" +#include "flow/CompressionUtils.h" #include "flow/IRandom.h" #include "flow/flow.h" @@ -30,19 +31,20 @@ ServerKnobs::ServerKnobs(Randomize randomize, ClientKnobs* clientKnobs, IsSimula void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSimulated isSimulated) { // clang-format off - init( ALLOW_DANGEROUS_KNOBS, isSimulated ); + init( ALLOW_DANGEROUS_KNOBS, isSimulated ); // Versions init( VERSIONS_PER_SECOND, 1e6 ); init( MAX_VERSIONS_IN_FLIGHT, 100 * VERSIONS_PER_SECOND ); init( MAX_VERSIONS_IN_FLIGHT_FORCED, 6e5 * VERSIONS_PER_SECOND ); //one week of versions - init( ENABLE_VERSION_VECTOR_TLOG_UNICAST, false ); if (randomize && BUGGIFY) ENABLE_VERSION_VECTOR_TLOG_UNICAST = true; - init( ENABLE_VERSION_VECTOR, false ); if (ENABLE_VERSION_VECTOR_TLOG_UNICAST == true) ENABLE_VERSION_VECTOR = true; + init( ENABLE_VERSION_VECTOR, false ); + init( ENABLE_VERSION_VECTOR_TLOG_UNICAST, false ); bool buggifyShortReadWindow = randomize && BUGGIFY && !ENABLE_VERSION_VECTOR; init( MAX_READ_TRANSACTION_LIFE_VERSIONS, 5 * VERSIONS_PER_SECOND ); if (randomize && BUGGIFY) MAX_READ_TRANSACTION_LIFE_VERSIONS = VERSIONS_PER_SECOND; else if (buggifyShortReadWindow) MAX_READ_TRANSACTION_LIFE_VERSIONS = std::max(1, 0.1 * VERSIONS_PER_SECOND); else if( randomize && BUGGIFY ) MAX_READ_TRANSACTION_LIFE_VERSIONS = 10 * VERSIONS_PER_SECOND; init( MAX_WRITE_TRANSACTION_LIFE_VERSIONS, 5 * VERSIONS_PER_SECOND ); if (randomize && BUGGIFY) MAX_WRITE_TRANSACTION_LIFE_VERSIONS=std::max(1, 1 * VERSIONS_PER_SECOND); init( MAX_COMMIT_BATCH_INTERVAL, 2.0 ); if( randomize && BUGGIFY ) MAX_COMMIT_BATCH_INTERVAL = 0.5; // Each commit proxy generates a CommitTransactionBatchRequest at least this often, so that versions always advance smoothly MAX_COMMIT_BATCH_INTERVAL = std::min(MAX_COMMIT_BATCH_INTERVAL, MAX_READ_TRANSACTION_LIFE_VERSIONS/double(2*VERSIONS_PER_SECOND)); // Ensure that the proxy commits 2 times every MAX_READ_TRANSACTION_LIFE_VERSIONS, otherwise the master will not give out versions fast enough + MAX_COMMIT_BATCH_INTERVAL = std::min(MAX_COMMIT_BATCH_INTERVAL, MAX_WRITE_TRANSACTION_LIFE_VERSIONS/double(2*VERSIONS_PER_SECOND)); // Ensure that the proxy commits 2 times every MAX_WRITE_TRANSACTION_LIFE_VERSIONS, otherwise the master will not give out versions fast enough init( MAX_VERSION_RATE_MODIFIER, 0.1 ); init( MAX_VERSION_RATE_OFFSET, VERSIONS_PER_SECOND ); // If the calculated version is more than this amount away from the expected version, it will be clamped to this value. This prevents huge version jumps. init( ENABLE_VERSION_VECTOR_HA_OPTIMIZATION, false ); @@ -50,7 +52,6 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi // TLogs init( TLOG_TIMEOUT, 0.4 ); //cannot buggify because of availability init( TLOG_SLOW_REJOIN_WARN_TIMEOUT_SECS, 60 ); if( randomize && BUGGIFY ) TLOG_SLOW_REJOIN_WARN_TIMEOUT_SECS = deterministicRandom()->randomInt(5,10); - init( RECOVERY_TLOG_SMART_QUORUM_DELAY, 0.25 ); if( randomize && BUGGIFY ) RECOVERY_TLOG_SMART_QUORUM_DELAY = 0.0; // smaller might be better for bug amplification init( TLOG_STORAGE_MIN_UPDATE_INTERVAL, 0.5 ); init( BUGGIFY_TLOG_STORAGE_MIN_UPDATE_INTERVAL, 30 ); init( DESIRED_TOTAL_BYTES, 150000 ); if( randomize && BUGGIFY ) DESIRED_TOTAL_BYTES = 10000; @@ -58,10 +59,6 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( UPDATE_DELAY, 0.001 ); init( MAXIMUM_PEEK_BYTES, 10e6 ); init( APPLY_MUTATION_BYTES, 1e6 ); - init( RECOVERY_DATA_BYTE_LIMIT, 100000 ); - init( BUGGIFY_RECOVERY_DATA_LIMIT, 1000 ); - init( LONG_TLOG_COMMIT_TIME, 0.25 ); //cannot buggify because of recovery time - init( LARGE_TLOG_COMMIT_BYTES, 4<<20 ); init( BUGGIFY_RECOVER_MEMORY_LIMIT, 1e6 ); init( BUGGIFY_WORKER_REMOVED_MAX_LAG, 30 ); init( UPDATE_STORAGE_BYTE_LIMIT, 1e6 ); @@ -95,7 +92,9 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( MAX_CACHE_VERSIONS, 10e6 ); init( TLOG_IGNORE_POP_AUTO_ENABLE_DELAY, 300.0 ); init( TXS_POPPED_MAX_DELAY, 1.0 ); if ( randomize && BUGGIFY ) TXS_POPPED_MAX_DELAY = deterministicRandom()->random01(); - init( TLOG_MAX_CREATE_DURATION, 10.0 ); if ( isSimulated ) TLOG_MAX_CREATE_DURATION = 20.0; + // In some rare simulation tests, particularly with log_spill:=1 configured, the 10 second limit is exceeded, causing SevError trace events + // and simulation test failure. Increasing the knob value to 15.0 in simulation is a workaround to avoid these failures. + init( TLOG_MAX_CREATE_DURATION, 10.0 ); if (isSimulated) TLOG_MAX_CREATE_DURATION = 15.0; init( PEEK_LOGGING_AMOUNT, 5 ); init( PEEK_LOGGING_DELAY, 5.0 ); init( PEEK_RESET_INTERVAL, 300.0 ); if ( randomize && BUGGIFY ) PEEK_RESET_INTERVAL = 20.0; @@ -115,16 +114,19 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( TLOG_POPPED_VER_LAG_THRESHOLD_FOR_TLOGPOP_TRACE, 250e6 ); init( BLOCKING_PEEK_TIMEOUT, 0.4 ); init( ENABLE_DETAILED_TLOG_POP_TRACE, false ); if ( randomize && BUGGIFY ) ENABLE_DETAILED_TLOG_POP_TRACE = true; - init( PEEK_BATCHING_EMPTY_MSG, false ); if ( randomize && BUGGIFY ) PEEK_BATCHING_EMPTY_MSG = true; - init( PEEK_BATCHING_EMPTY_MSG_INTERVAL, 0.001 ); if ( randomize && BUGGIFY ) PEEK_BATCHING_EMPTY_MSG_INTERVAL = 0.01; + init( PEEK_BATCHING_EMPTY_MSG, true ); if ( randomize && BUGGIFY ) PEEK_BATCHING_EMPTY_MSG = false; + init( PEEK_BATCHING_EMPTY_MSG_INTERVAL, 0.005 ); if ( randomize && BUGGIFY ) PEEK_BATCHING_EMPTY_MSG_INTERVAL = 0.01; init( POP_FROM_LOG_DELAY, 1 ); if ( randomize && BUGGIFY ) POP_FROM_LOG_DELAY = 0; init( TLOG_PULL_ASYNC_DATA_WARNING_TIMEOUT_SECS, 120 ); // disk snapshot max timeout, to be put in TLog, storage and coordinator nodes init( MAX_FORKED_PROCESS_OUTPUT, 1024 ); - init( SNAP_CREATE_MAX_TIMEOUT, 300.0 ); + init( SNAP_CREATE_MAX_TIMEOUT, isSimulated ? 70.0 : 300.0 ); + init( SNAP_MINIMUM_TIME_GAP, 5.0 ); + init( SNAP_NETWORK_FAILURE_RETRY_LIMIT, 10 ); init( MAX_STORAGE_SNAPSHOT_FAULT_TOLERANCE, 1 ); init( MAX_COORDINATOR_SNAPSHOT_FAULT_TOLERANCE, 1 ); + init( SNAPSHOT_ALL_STATEFUL_PROCESSES, false ); if ( randomize && BUGGIFY ) SNAPSHOT_ALL_STATEFUL_PROCESSES = true; // Data distribution queue init( HEALTH_POLL_TIME, 1.0 ); @@ -133,16 +135,16 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( BG_REBALANCE_POLLING_INTERVAL, 10.0 ); init( BG_REBALANCE_SWITCH_CHECK_INTERVAL, 5.0 ); if (randomize && BUGGIFY) BG_REBALANCE_SWITCH_CHECK_INTERVAL = 1.0; init( DD_QUEUE_LOGGING_INTERVAL, 5.0 ); + init( DD_QUEUE_COUNTER_REFRESH_INTERVAL, 60.0 ); + // 100 / 60 < 2 trace/sec ~ 2 * 200 = 400b/sec + init( DD_QUEUE_COUNTER_MAX_LOG, 100 ); if( randomize && BUGGIFY ) DD_QUEUE_COUNTER_MAX_LOG = 1; + init( DD_QUEUE_COUNTER_SUMMARIZE, true ); + init( WIGGLING_RELOCATION_PARALLELISM_PER_SOURCE_SERVER, 2 ); if( randomize && BUGGIFY ) WIGGLING_RELOCATION_PARALLELISM_PER_SOURCE_SERVER = 1; init( RELOCATION_PARALLELISM_PER_SOURCE_SERVER, 2 ); if( randomize && BUGGIFY ) RELOCATION_PARALLELISM_PER_SOURCE_SERVER = 1; init( RELOCATION_PARALLELISM_PER_DEST_SERVER, 10 ); if( randomize && BUGGIFY ) RELOCATION_PARALLELISM_PER_DEST_SERVER = 1; // Note: if this is smaller than FETCH_KEYS_PARALLELISM, this will artificially reduce performance. The current default of 10 is probably too high but is set conservatively for now. - init( DD_QUEUE_MAX_KEY_SERVERS, 100 ); if( randomize && BUGGIFY ) DD_QUEUE_MAX_KEY_SERVERS = 1; + init( DD_QUEUE_MAX_KEY_SERVERS, 100 ); // Do not buggify init( DD_REBALANCE_PARALLELISM, 50 ); init( DD_REBALANCE_RESET_AMOUNT, 30 ); - init( BG_DD_MAX_WAIT, 120.0 ); - init( BG_DD_MIN_WAIT, 0.1 ); - init( BG_DD_INCREASE_RATE, 1.10 ); - init( BG_DD_DECREASE_RATE, 1.02 ); - init( BG_DD_SATURATION_DELAY, 1.0 ); init( INFLIGHT_PENALTY_HEALTHY, 1.0 ); init( INFLIGHT_PENALTY_UNHEALTHY, 500.0 ); init( INFLIGHT_PENALTY_ONE_LEFT, 1000.0 ); @@ -150,9 +152,11 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( PRIORITY_RECOVER_MOVE, 110 ); init( PRIORITY_REBALANCE_UNDERUTILIZED_TEAM, 120 ); - init( PRIORITY_REBALANCE_OVERUTILIZED_TEAM, 121 ); - init( PRIORITY_PERPETUAL_STORAGE_WIGGLE, 139 ); + init( PRIORITY_REBALANCE_READ_UNDERUTIL_TEAM, 121 ); + init( PRIORITY_REBALANCE_OVERUTILIZED_TEAM, 122 ); + init( PRIORITY_REBALANCE_READ_OVERUTIL_TEAM, 123 ); init( PRIORITY_TEAM_HEALTHY, 140 ); + init( PRIORITY_PERPETUAL_STORAGE_WIGGLE, 141 ); init( PRIORITY_TEAM_CONTAINS_UNDESIRED_SERVER, 150 ); init( PRIORITY_TEAM_REDUNDANT, 200 ); init( PRIORITY_MERGE_SHARD, 340 ); @@ -163,8 +167,35 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( PRIORITY_TEAM_FAILED, 805 ); init( PRIORITY_TEAM_0_LEFT, 809 ); init( PRIORITY_SPLIT_SHARD, 950 ); if( randomize && BUGGIFY ) PRIORITY_SPLIT_SHARD = 350; + init( PRIORITY_ENFORCE_MOVE_OUT_OF_PHYSICAL_SHARD, 960 ); if( randomize && BUGGIFY ) PRIORITY_ENFORCE_MOVE_OUT_OF_PHYSICAL_SHARD = 360; // Set as the lowest priority // Data distribution + init( AVAILABLE_SPACE_PIVOT_RATIO, 0.5 ); + init( CPU_PIVOT_RATIO, 0.9 ); + // In order to make sure GetTeam has enough eligible destination team: + ASSERT_GT(AVAILABLE_SPACE_PIVOT_RATIO + CPU_PIVOT_RATIO, 1.0 ); + // In simulation, the CPU percent of every storage server is hard-coded as 100.0%. It is difficult to test pivot CPU in normal simulation. TODO: add mock DD Test case for it. + // TODO: choose a meaning value for real cluster + init( MAX_DEST_CPU_PERCENT, 100.0 ); + init( DD_TEAM_PIVOT_UPDATE_DELAY, 5.0 ); + + init( ALLOW_LARGE_SHARD, false ); if( randomize && BUGGIFY ) ALLOW_LARGE_SHARD = true; + init( MAX_LARGE_SHARD_BYTES, 1000000000 ); // 1G + init( SHARD_ENCODE_LOCATION_METADATA, false ); if( randomize && BUGGIFY ) SHARD_ENCODE_LOCATION_METADATA = true; + init( ENABLE_DD_PHYSICAL_SHARD, false ); // EXPERIMENTAL; If true, SHARD_ENCODE_LOCATION_METADATA must be true; When true, optimization of data move between DCs is disabled + init( DD_PHYSICAL_SHARD_MOVE_PROBABILITY, 0.0 ); if( isSimulated ) DD_PHYSICAL_SHARD_MOVE_PROBABILITY = 0.5; + init( MAX_PHYSICAL_SHARD_BYTES, 10000000 ); // 10 MB; for ENABLE_DD_PHYSICAL_SHARD; smaller leads to larger number of physicalShard per storage server + init( PHYSICAL_SHARD_METRICS_DELAY, 300.0 ); // 300 seconds; for ENABLE_DD_PHYSICAL_SHARD + init( ANONYMOUS_PHYSICAL_SHARD_TRANSITION_TIME, 600.0 ); if( randomize && BUGGIFY ) ANONYMOUS_PHYSICAL_SHARD_TRANSITION_TIME = 0.0; // 600 seconds; for ENABLE_DD_PHYSICAL_SHARD + init( PHYSICAL_SHARD_MOVE_VERBOSE_TRACKING, false ); + init( READ_REBALANCE_CPU_THRESHOLD, 15.0 ); + init( READ_REBALANCE_SRC_PARALLELISM, 20 ); + init( READ_REBALANCE_SHARD_TOPK, READ_REBALANCE_SRC_PARALLELISM * 2 ); + init( READ_REBALANCE_DIFF_FRAC, 0.3); + init( READ_REBALANCE_MAX_SHARD_FRAC, 0.2); // FIXME: add buggify here when we have DD test, seems DD is pretty sensitive to this parameter + + // TODO: now we set it to a large number so that the shard average traffic can guard this change. Consider change it to a lower value in the future. + init( READ_REBALANCE_MIN_READ_BYTES_KS, std::numeric_limits::max() ); init( RETRY_RELOCATESHARD_DELAY, 0.1 ); init( DATA_DISTRIBUTION_FAILURE_REACTION_TIME, 60.0 ); if( randomize && BUGGIFY ) DATA_DISTRIBUTION_FAILURE_REACTION_TIME = 1.0; bool buggifySmallShards = randomize && BUGGIFY; @@ -175,11 +206,17 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( SHARD_BYTES_PER_SQRT_BYTES, 45 ); if( buggifySmallShards ) SHARD_BYTES_PER_SQRT_BYTES = 0;//Approximately 10000 bytes per shard init( MAX_SHARD_BYTES, 500000000 ); init( KEY_SERVER_SHARD_BYTES, 500000000 ); + + init( SHARD_MAX_READ_OPS_PER_KSEC, 45000 * 1000 ); + init( SHARD_READ_OPS_CHANGE_THRESHOLD, SHARD_MAX_READ_OPS_PER_KSEC / 4); if(randomize && BUGGIFY) SHARD_READ_OPS_CHANGE_THRESHOLD = 2000; + /* + * The assumption is when the read ops reach to 45k/s the Storage Server instance will be CPU-saturated. + */ init( SHARD_MAX_READ_DENSITY_RATIO, 8.0); if (randomize && BUGGIFY) SHARD_MAX_READ_DENSITY_RATIO = 2.0; /* The bytesRead/byteSize radio. Will be declared as read hot when larger than this. 8.0 was chosen to avoid reporting table scan as read hot. */ - init ( SHARD_READ_HOT_BANDWITH_MIN_PER_KSECONDS, 1666667 * 1000); + init ( SHARD_READ_HOT_BANDWIDTH_MIN_PER_KSECONDS, 1666667 * 1000); /* The read bandwidth of a given shard needs to be larger than this value in order to be evaluated if it's read hot. The roughly 1.67MB per second is calculated as following: - Heuristic data suggests that each storage process can do max 500K read operations per second @@ -212,7 +249,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi shards. The bandwidth sample maintained by the storage server needs to be accurate enough to reliably measure this minimum bandwidth. See - BANDWIDTH_UNITS_PER_SAMPLE. If this number is too low, the storage server needs to spend more memory and time on sampling. + BYTES_WRITTEN_UNITS_PER_SAMPLE. If this number is too low, the storage server needs to spend more memory and time on sampling. */ init( SHARD_SPLIT_BYTES_PER_KSEC, 250 * 1000 * 1000 ); if( buggifySmallBandwidthSplit ) SHARD_SPLIT_BYTES_PER_KSEC = 50 * 1000 * 1000; @@ -244,9 +281,10 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( BEST_TEAM_OPTION_COUNT, 4 ); init( BEST_OF_AMT, 4 ); init( SERVER_LIST_DELAY, 1.0 ); + init( RATEKEEPER_MONITOR_SS_DELAY, 10.0 ); + init( RATEKEEPER_MONITOR_SS_THRESHOLD, 5 ); init( RECRUITMENT_IDLE_DELAY, 1.0 ); init( STORAGE_RECRUITMENT_DELAY, 10.0 ); - init( BLOB_WORKER_RECRUITMENT_DELAY, 10.0 ); init( TSS_HACK_IDENTITY_MAPPING, false ); // THIS SHOULD NEVER BE SET IN PROD. Only for performance testing init( TSS_RECRUITMENT_TIMEOUT, 3*STORAGE_RECRUITMENT_DELAY ); if (randomize && BUGGIFY ) TSS_RECRUITMENT_TIMEOUT = 1.0; // Super low timeout should cause tss recruitments to fail init( TSS_DD_CHECK_INTERVAL, 60.0 ); if (randomize && BUGGIFY ) TSS_DD_CHECK_INTERVAL = 1.0; // May kill all TSS quickly @@ -272,7 +310,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( DD_FAILURE_TIME, 1.0 ); if( randomize && BUGGIFY ) DD_FAILURE_TIME = 10.0; init( DD_ZERO_HEALTHY_TEAM_DELAY, 1.0 ); init( REMOTE_KV_STORE, false ); - init( REMOTE_KV_STORE_INIT_DELAY, 0.1 ); + init( REBOOT_KV_STORE_DELAY, 0.1 ); init( REMOTE_KV_STORE_MAX_INIT_DURATION, 10.0 ); init( REBALANCE_MAX_RETRIES, 100 ); init( DD_OVERLAP_PENALTY, 10000 ); @@ -288,9 +326,24 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( DD_TEAM_ZERO_SERVER_LEFT_LOG_DELAY, 120 ); if( randomize && BUGGIFY ) DD_TEAM_ZERO_SERVER_LEFT_LOG_DELAY = 5; init( DD_STORAGE_WIGGLE_PAUSE_THRESHOLD, 10 ); if( randomize && BUGGIFY ) DD_STORAGE_WIGGLE_PAUSE_THRESHOLD = 1000; init( DD_STORAGE_WIGGLE_STUCK_THRESHOLD, 20 ); + init( DD_STORAGE_WIGGLE_MIN_SS_AGE_SEC, isSimulated ? 2 : 21 * 60 * 60 * 24 ); if(randomize && BUGGIFY) DD_STORAGE_WIGGLE_MIN_SS_AGE_SEC = isSimulated ? 0: 120; + init( DD_TENANT_AWARENESS_ENABLED, false ); + init( STORAGE_QUOTA_ENABLED, true ); if(isSimulated) STORAGE_QUOTA_ENABLED = deterministicRandom()->coinflip(); + init( TENANT_CACHE_LIST_REFRESH_INTERVAL, 5 ); if( randomize && BUGGIFY ) TENANT_CACHE_LIST_REFRESH_INTERVAL = deterministicRandom()->randomInt(1, 10); + init( TENANT_CACHE_STORAGE_USAGE_REFRESH_INTERVAL, 60 ); if(isSimulated) TENANT_CACHE_STORAGE_USAGE_REFRESH_INTERVAL = 10; if( randomize && BUGGIFY ) TENANT_CACHE_STORAGE_USAGE_REFRESH_INTERVAL = deterministicRandom()->randomInt(5, 15); + init( TENANT_CACHE_STORAGE_QUOTA_REFRESH_INTERVAL, 10 ); if( randomize && BUGGIFY ) TENANT_CACHE_STORAGE_QUOTA_REFRESH_INTERVAL = deterministicRandom()->randomInt(5, 15); + init( TENANT_CACHE_STORAGE_USAGE_TRACE_INTERVAL, 300 ); + init( CP_FETCH_TENANTS_OVER_STORAGE_QUOTA_INTERVAL, 5 ); if( randomize && BUGGIFY ) CP_FETCH_TENANTS_OVER_STORAGE_QUOTA_INTERVAL = deterministicRandom()->randomInt(1, 10); init( DD_BUILD_EXTRA_TEAMS_OVERRIDE, 10 ); if( randomize && BUGGIFY ) DD_BUILD_EXTRA_TEAMS_OVERRIDE = 2; - init( ENABLE_STORAGE_QUEUE_AWARE_TEAM_SELECTION, false ); if( randomize && BUGGIFY ) ENABLE_STORAGE_QUEUE_AWARE_TEAM_SELECTION = true; - init( DD_TARGET_STORAGE_QUEUE_SIZE, TARGET_BYTES_PER_STORAGE_SERVER/3 ); if( randomize && BUGGIFY ) DD_TARGET_STORAGE_QUEUE_SIZE = TARGET_BYTES_PER_STORAGE_SERVER/10; + init( DD_SHARD_TRACKING_LOG_SEVERITY, 1 ); + init( ENFORCE_SHARD_COUNT_PER_TEAM, false ); if( randomize && BUGGIFY ) ENFORCE_SHARD_COUNT_PER_TEAM = true; + init( DESIRED_MAX_SHARDS_PER_TEAM, 1000 ); if( randomize && BUGGIFY ) DESIRED_MAX_SHARDS_PER_TEAM = 10; + + // Large teams are disabled when SHARD_ENCODE_LOCATION_METADATA is enabled + init( DD_MAX_SHARDS_ON_LARGE_TEAMS, 100 ); if( randomize && BUGGIFY ) DD_MAX_SHARDS_ON_LARGE_TEAMS = deterministicRandom()->randomInt(0, 3); + init( DD_MAXIMUM_LARGE_TEAM_CLEANUP, 10000 ); if( randomize && BUGGIFY ) DD_MAXIMUM_LARGE_TEAM_CLEANUP = 10; + init( DD_LARGE_TEAM_DELAY, 60.0 ); + init( DD_FIX_WRONG_REPLICAS_DELAY, 60.0 ); // TeamRemover init( TR_FLAG_DISABLE_MACHINE_TEAM_REMOVER, false ); if( randomize && BUGGIFY ) TR_FLAG_DISABLE_MACHINE_TEAM_REMOVER = deterministicRandom()->random01() < 0.1 ? true : false; // false by default. disable the consistency check when it's true @@ -310,7 +363,6 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( CLEAR_TIME_ESTIMATE, .00005 ); init( COMMIT_TIME_ESTIMATE, .005 ); init( CHECK_FREE_PAGE_AMOUNT, 100 ); if( randomize && BUGGIFY ) CHECK_FREE_PAGE_AMOUNT = 5; - init( DISK_METRIC_LOGGING_INTERVAL, 5.0 ); init( SOFT_HEAP_LIMIT, 300e6 ); init( SQLITE_PAGE_SCAN_ERROR_LIMIT, 10000 ); @@ -369,26 +421,31 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( REPLACE_CONTENTS_BYTES, 1e5 ); // KeyValueStoreRocksDB + init( ROCKSDB_SET_READ_TIMEOUT, !isSimulated ); init( ROCKSDB_LEVEL_COMPACTION_DYNAMIC_LEVEL_BYTES, true ); if( randomize && BUGGIFY ) ROCKSDB_LEVEL_COMPACTION_DYNAMIC_LEVEL_BYTES = false; init( ROCKSDB_SUGGEST_COMPACT_CLEAR_RANGE, false ); - init( ROCKSDB_THREAD_PROMISE_PRIORITY, 7500 ); + init( ROCKSDB_READ_RANGE_ROW_LIMIT, 65535 ); if( randomize && BUGGIFY ) ROCKSDB_READ_RANGE_ROW_LIMIT = deterministicRandom()->randomInt(2, 10); init( ROCKSDB_READER_THREAD_PRIORITY, 0 ); - init( ROCKSDB_WRITER_THREAD_PRIORITY, 0 ); + init( ROCKSDB_WRITER_THREAD_PRIORITY, 0 ); + init( ROCKSDB_COMPACTION_THREAD_PRIORITY, 0 ); init( ROCKSDB_BACKGROUND_PARALLELISM, 2 ); - init( ROCKSDB_READ_PARALLELISM, 4 ); + init( ROCKSDB_READ_PARALLELISM, isSimulated? 2: 4 ); + init( ROCKSDB_CHECKPOINT_READER_PARALLELISM, 4 ); + // If true, do not process and store RocksDB logs + init( ROCKSDB_MUTE_LOGS, true ); // Use a smaller memtable in simulation to avoid OOMs. - int64_t memtableBytes = isSimulated ? 32 * 1024 : 512 * 1024 * 1024; + int64_t memtableBytes = isSimulated ? 1024 * 1024 : 512 * 1024 * 1024; init( ROCKSDB_MEMTABLE_BYTES, memtableBytes ); init( ROCKSDB_LEVEL_STYLE_COMPACTION, true ); init( ROCKSDB_UNSAFE_AUTO_FSYNC, false ); init( ROCKSDB_PERIODIC_COMPACTION_SECONDS, 0 ); - init( ROCKSDB_PREFIX_LEN, 0 ); if( randomize && BUGGIFY ) ROCKSDB_PREFIX_LEN = deterministicRandom()->randomInt(1, 20); + init( ROCKSDB_PREFIX_LEN, 0 ); if( randomize && BUGGIFY ) ROCKSDB_PREFIX_LEN = deterministicRandom()->randomInt(1, 20); init( ROCKSDB_MEMTABLE_PREFIX_BLOOM_SIZE_RATIO, 0.1 ); init( ROCKSDB_BLOOM_BITS_PER_KEY, 10 ); init( ROCKSDB_BLOOM_WHOLE_KEY_FILTERING, false ); init( ROCKSDB_MAX_AUTO_READAHEAD_SIZE, 65536 ); // If rocksdb block cache size is 0, the default 8MB is used. - int64_t blockCacheSize = isSimulated ? 16 * 1024 * 1024 : 2147483648 /* 2GB */; + int64_t blockCacheSize = isSimulated ? 16 * 1024 : 2147483648 /* 2GB */; init( ROCKSDB_BLOCK_CACHE_SIZE, blockCacheSize ); init( ROCKSDB_METRICS_DELAY, 60.0 ); // ROCKSDB_READ_VALUE_TIMEOUT, ROCKSDB_READ_VALUE_PREFIX_TIMEOUT, ROCKSDB_READ_RANGE_TIMEOUT knobs: @@ -397,6 +454,8 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( ROCKSDB_READ_VALUE_TIMEOUT, isSimulated ? 300.0 : 5.0 ); init( ROCKSDB_READ_VALUE_PREFIX_TIMEOUT, isSimulated ? 300.0 : 5.0 ); init( ROCKSDB_READ_RANGE_TIMEOUT, isSimulated ? 300.0 : 5.0 ); + init( ROCKSDB_READ_CHECKPOINT_TIMEOUT, isSimulated ? 300.0 : 5.0 ); + init( ROCKSDB_CHECKPOINT_READ_AHEAD_SIZE, 2 << 20 ); // 2M init( ROCKSDB_READ_QUEUE_WAIT, 1.0 ); init( ROCKSDB_READ_QUEUE_HARD_MAX, 1000 ); init( ROCKSDB_READ_QUEUE_SOFT_MAX, 500 ); @@ -416,9 +475,12 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( ROCKSDB_PERFCONTEXT_ENABLE, false ); if( randomize && BUGGIFY ) ROCKSDB_PERFCONTEXT_ENABLE = deterministicRandom()->coinflip(); init( ROCKSDB_PERFCONTEXT_SAMPLE_RATE, 0.0001 ); + init( ROCKSDB_METRICS_SAMPLE_INTERVAL, 0.0); init( ROCKSDB_MAX_SUBCOMPACTIONS, 0 ); init( ROCKSDB_SOFT_PENDING_COMPACT_BYTES_LIMIT, 64000000000 ); // 64GB, Rocksdb option, Writes will slow down. init( ROCKSDB_HARD_PENDING_COMPACT_BYTES_LIMIT, 100000000000 ); // 100GB, Rocksdb option, Writes will stall. + init( SHARD_SOFT_PENDING_COMPACT_BYTES_LIMIT, 0 ); + init( SHARD_HARD_PENDING_COMPACT_BYTES_LIMIT, 0 ); init( ROCKSDB_CAN_COMMIT_COMPACT_BYTES_LIMIT, 50000000000 ); // 50GB, Commit waits. // Enabling ROCKSDB_PARANOID_FILE_CHECKS knob will have overhead. Be cautious to enable in prod. init( ROCKSDB_PARANOID_FILE_CHECKS, false ); if( randomize && BUGGIFY ) ROCKSDB_PARANOID_FILE_CHECKS = deterministicRandom()->coinflip(); @@ -436,7 +498,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( ROCKSDB_FORCE_DELETERANGE_FOR_CLEARRANGE, false ); // ROCKSDB_STATS_LEVEL=1 indicates rocksdb::StatsLevel::kExceptHistogramOrTimers // Refer StatsLevel: https://github.com/facebook/rocksdb/blob/main/include/rocksdb/statistics.h#L594 - init( ROCKSDB_STATS_LEVEL, 1 ); if( randomize && BUGGIFY ) ROCKSDB_STATS_LEVEL = deterministicRandom()->randomInt(0, 6); + init( ROCKSDB_STATS_LEVEL, 1 ); init( ROCKSDB_ENABLE_COMPACT_ON_DELETION, false ); // CDCF: CompactOnDeletionCollectorFactory. The below 3 are parameters of the CompactOnDeletionCollectorFactory // which controls the compaction on deleted data. @@ -446,15 +508,47 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi // Can commit will delay ROCKSDB_CAN_COMMIT_DELAY_ON_OVERLOAD seconds for // ROCKSDB_CAN_COMMIT_DELAY_TIMES_ON_OVERLOAD times, if rocksdb overloaded. // Set ROCKSDB_CAN_COMMIT_DELAY_TIMES_ON_OVERLOAD to 0, to disable - init( ROCKSDB_CAN_COMMIT_DELAY_ON_OVERLOAD, 1 ); - init( ROCKSDB_CAN_COMMIT_DELAY_TIMES_ON_OVERLOAD, 5 ); + init( ROCKSDB_CAN_COMMIT_DELAY_ON_OVERLOAD, 0.2 ); + init( ROCKSDB_CAN_COMMIT_DELAY_TIMES_ON_OVERLOAD, 20 ); init( ROCKSDB_COMPACTION_READAHEAD_SIZE, 32768 ); // 32 KB, performs bigger reads when doing compaction. init( ROCKSDB_BLOCK_SIZE, 32768 ); // 32 KB, size of the block in rocksdb cache. - init( ROCKSDB_MAX_LOG_FILE_SIZE, 10485760 ); // 10MB. - init( ROCKSDB_KEEP_LOG_FILE_NUM, 200 ); // Keeps 2GB log per storage server. - // Temporary knob to enable trace events which prints details about all the backup keys update(write/clear) operations. - // Caution: To be enabled only under supervision. - init( SS_BACKUP_KEYS_OP_LOGS, false ); + init( ENABLE_SHARDED_ROCKSDB, false ); + init( ROCKSDB_WRITE_BUFFER_SIZE, isSimulated? 128 << 20 : 1 << 30 ); // 1G + init( ROCKSDB_CF_WRITE_BUFFER_SIZE, isSimulated? 16 << 20 : 64 << 20 ); // 64M, RocksDB default. + init( ROCKSDB_MAX_TOTAL_WAL_SIZE, 0 ); // RocksDB default. + init( ROCKSDB_MAX_BACKGROUND_JOBS, 2 ); // RocksDB default. + init( ROCKSDB_DELETE_OBSOLETE_FILE_PERIOD, 21600 ); // 6h, RocksDB default. + init( ROCKSDB_PHYSICAL_SHARD_CLEAN_UP_DELAY, isSimulated ? 10.0 : 300.0 ); // Delays shard clean up, must be larger than ROCKSDB_READ_VALUE_TIMEOUT to prevent reading deleted shard. + init( ROCKSDB_EMPTY_RANGE_CHECK, isSimulated ? true : false); + init( ROCKSDB_CREATE_BYTES_SAMPLE_FILE_RETRY_MAX, 50 ); + init( ROCKSDB_ATOMIC_FLUSH, false ); + init( ROCKSDB_IMPORT_MOVE_FILES, false ); + init( ROCKSDB_CHECKPOINT_REPLAY_MARKER, false ); + init( ROCKSDB_VERIFY_CHECKSUM_BEFORE_RESTORE, true ); + init( ROCKSDB_ENABLE_CHECKPOINT_VALIDATION, false ); if( randomize && BUGGIFY ) ROCKSDB_ENABLE_CHECKPOINT_VALIDATION = deterministicRandom()->coinflip(); + init( ROCKSDB_RETURN_OVERLOADED_ON_TIMEOUT, false ); if ( randomize && BUGGIFY ) ROCKSDB_RETURN_OVERLOADED_ON_TIMEOUT = true; + init( ROCKSDB_COMPACTION_PRI, 3 ); // kMinOverlappingRatio, RocksDB default. + init( ROCKSDB_WAL_RECOVERY_MODE, 2 ); // kPointInTimeRecovery, RocksDB default. + init( ROCKSDB_TARGET_FILE_SIZE_BASE, 16777216 ); // 16MB, RocksDB default. + init( ROCKSDB_TARGET_FILE_SIZE_MULTIPLIER, 1 ); // RocksDB default. + init( ROCKSDB_MAX_OPEN_FILES, 50000 ); // Should be smaller than OS's fd limit. + init( ROCKSDB_USE_POINT_DELETE_FOR_SYSTEM_KEYS, false ); if (isSimulated) ROCKSDB_USE_POINT_DELETE_FOR_SYSTEM_KEYS = deterministicRandom()->coinflip(); + init( ROCKSDB_CF_RANGE_DELETION_LIMIT, 1000 ); + init (ROCKSDB_WAIT_ON_CF_FLUSH, false ); + init (ROCKSDB_ALLOW_WRITE_STALL_ON_FLUSH, false ); + init (ROCKSDB_CF_METRICS_DELAY, 900.0 ); + init (ROCKSDB_MAX_LOG_FILE_SIZE, 10485760 ); // 10MB. + init (ROCKSDB_KEEP_LOG_FILE_NUM, 200 ); // Keeps 2GB log per storage server. + init (ROCKSDB_SKIP_STATS_UPDATE_ON_OPEN, false ); if (isSimulated) ROCKSDB_SKIP_STATS_UPDATE_ON_OPEN = deterministicRandom()->coinflip(); + init (ROCKSDB_SKIP_FILE_SIZE_CHECK_ON_OPEN, false ); if (isSimulated) ROCKSDB_SKIP_FILE_SIZE_CHECK_ON_OPEN = deterministicRandom()->coinflip(); + init (SHARDED_ROCKSDB_VALIDATE_MAPPING_RATIO, 0.01 ); if (isSimulated) SHARDED_ROCKSDB_VALIDATE_MAPPING_RATIO = deterministicRandom()->random01(); + init (SHARD_METADATA_SCAN_BYTES_LIMIT, 10485760 ); // 10MB + init (ROCKSDB_MAX_MANIFEST_FILE_SIZE, 100 << 20 ); if (isSimulated) ROCKSDB_MAX_MANIFEST_FILE_SIZE = 500 << 20; // 500MB in simulation + init (ROCKSDB_MAX_WRITE_BUFFER_NUMBER, 6 ); // RocksDB default. + init (SHARDED_ROCKSDB_AVERAGE_FILE_SIZE, 8 << 20 ); // 8MB + init (SHARDED_ROCKSDB_COMPACTION_PERIOD, isSimulated? 3600 : 2592000 ); // 30d + init (SHARDED_ROCKSDB_COMPACTION_ACTOR_DELAY, 3600 ); // 1h + init (SHARDED_ROCKSDB_COMPACTION_SHARD_LIMIT, 1 ); // Leader election bool longLeaderElection = randomize && BUGGIFY; @@ -479,6 +573,8 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( START_TRANSACTION_MAX_EMPTY_QUEUE_BUDGET, 10.0 ); init( START_TRANSACTION_MAX_QUEUE_SIZE, 1e6 ); init( KEY_LOCATION_MAX_QUEUE_SIZE, 1e6 ); + init( TENANT_ID_REQUEST_MAX_QUEUE_SIZE, 1e6 ); + init( BLOB_GRANULE_LOCATION_MAX_QUEUE_SIZE, 1e5 ); if ( randomize && BUGGIFY ) BLOB_GRANULE_LOCATION_MAX_QUEUE_SIZE = 100; init( COMMIT_PROXY_LIVENESS_TIMEOUT, 20.0 ); init( COMMIT_TRANSACTION_BATCH_INTERVAL_FROM_IDLE, 0.0005 ); if( randomize && BUGGIFY ) COMMIT_TRANSACTION_BATCH_INTERVAL_FROM_IDLE = 0.005; @@ -490,6 +586,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( COMMIT_BATCHES_MEM_BYTES_HARD_LIMIT, 8LL << 30 ); if (randomize && BUGGIFY) COMMIT_BATCHES_MEM_BYTES_HARD_LIMIT = deterministicRandom()->randomInt64(100LL << 20, 8LL << 30); init( COMMIT_BATCHES_MEM_FRACTION_OF_TOTAL, 0.5 ); init( COMMIT_BATCHES_MEM_TO_TOTAL_MEM_SCALE_FACTOR, 5.0 ); + init( COMMIT_TRIGGER_DELAY, 0.01 ); if (randomize && BUGGIFY) COMMIT_TRIGGER_DELAY = deterministicRandom()->random01() * 4; // these settings disable batch bytes scaling. Try COMMIT_TRANSACTION_BATCH_BYTES_MAX=1e6, COMMIT_TRANSACTION_BATCH_BYTES_SCALE_BASE=50000, COMMIT_TRANSACTION_BATCH_BYTES_SCALE_POWER=0.5? init( COMMIT_TRANSACTION_BATCH_BYTES_MIN, 100000 ); @@ -519,15 +616,20 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( PROXY_REJECT_BATCH_QUEUED_TOO_LONG, true ); bool buggfyUseResolverPrivateMutations = randomize && BUGGIFY && !ENABLE_VERSION_VECTOR_TLOG_UNICAST; - init( PROXY_USE_RESOLVER_PRIVATE_MUTATIONS, false ); if( buggfyUseResolverPrivateMutations ) PROXY_USE_RESOLVER_PRIVATE_MUTATIONS = deterministicRandom()->coinflip(); - if (ENABLE_VERSION_VECTOR_TLOG_UNICAST == true) PROXY_USE_RESOLVER_PRIVATE_MUTATIONS = true; + + init( BURSTINESS_METRICS_ENABLED , false ); + init( BURSTINESS_METRICS_LOG_INTERVAL, 0.1 ); init( RESET_MASTER_BATCHES, 200 ); init( RESET_RESOLVER_BATCHES, 200 ); init( RESET_MASTER_DELAY, 300.0 ); init( RESET_RESOLVER_DELAY, 300.0 ); + init( GLOBAL_CONFIG_MIGRATE_TIMEOUT, 5.0 ); + init( GLOBAL_CONFIG_REFRESH_INTERVAL, 1.0 ); if ( randomize && BUGGIFY ) GLOBAL_CONFIG_REFRESH_INTERVAL = 0.1; + init( GLOBAL_CONFIG_REFRESH_TIMEOUT, 10.0 ); if ( randomize && BUGGIFY ) GLOBAL_CONFIG_REFRESH_TIMEOUT = 1.0; + // Master Server // masterCommitter() in the master server will allow lower priority tasks (e.g. DataDistibution) // by delay()ing for this amount of time between accepted batches of TransactionRequests. @@ -576,6 +678,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( ATTEMPT_RECRUITMENT_DELAY, 0.035 ); init( WAIT_FOR_DISTRIBUTOR_JOIN_DELAY, 1.0 ); init( WAIT_FOR_RATEKEEPER_JOIN_DELAY, 1.0 ); + init( WAIT_FOR_CONSISTENCYSCAN_JOIN_DELAY, 1.0 ); init( WAIT_FOR_BLOB_MANAGER_JOIN_DELAY, 1.0 ); init( WAIT_FOR_ENCRYPT_KEY_PROXY_JOIN_DELAY, 1.0 ); init( WORKER_FAILURE_TIME, 1.0 ); if( randomize && BUGGIFY ) WORKER_FAILURE_TIME = 10.0; @@ -586,7 +689,9 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( CHECK_REMOTE_HEALTH_INTERVAL, 60 ); init( FORCE_RECOVERY_CHECK_DELAY, 5.0 ); init( RATEKEEPER_FAILURE_TIME, 1.0 ); + init( CONSISTENCYSCAN_FAILURE_TIME, 1.0 ); init( BLOB_MANAGER_FAILURE_TIME, 1.0 ); + init( BLOB_MIGRATOR_FAILURE_TIME, 1.0 ); init( REPLACE_INTERFACE_DELAY, 60.0 ); init( REPLACE_INTERFACE_CHECK_DELAY, 5.0 ); init( COORDINATOR_REGISTER_INTERVAL, 5.0 ); @@ -595,7 +700,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( CC_WORKER_HEALTH_CHECKING_INTERVAL, 60.0 ); init( CC_DEGRADED_LINK_EXPIRATION_INTERVAL, 300.0 ); init( CC_MIN_DEGRADATION_INTERVAL, 120.0 ); - init( ENCRYPT_KEY_PROXY_FAILURE_TIME, 0.1 ); + init( ENCRYPT_KEY_PROXY_FAILURE_TIME, 0.1 ); if ( isSimulated ) ENCRYPT_KEY_PROXY_FAILURE_TIME = 1.0 + deterministicRandom()->random01(); init( CC_DEGRADED_PEER_DEGREE_TO_EXCLUDE, 3 ); init( CC_MAX_EXCLUSION_DUE_TO_HEALTH, 2 ); init( CC_HEALTH_TRIGGER_RECOVERY, false ); @@ -624,6 +729,8 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( DBINFO_SEND_AMOUNT, 5 ); init( DBINFO_BATCH_DELAY, 0.1 ); init( SINGLETON_RECRUIT_BME_DELAY, 10.0 ); + init( RECORD_RECOVER_AT_IN_CSTATE, false ); + init( TRACK_TLOG_RECOVERY, false ); //Move Keys init( SHARD_READY_DELAY, 0.25 ); @@ -632,8 +739,10 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( REMOVE_RETRY_DELAY, 1.0 ); init( MOVE_KEYS_KRM_LIMIT, 2000 ); if( randomize && BUGGIFY ) MOVE_KEYS_KRM_LIMIT = 2; init( MOVE_KEYS_KRM_LIMIT_BYTES, 1e5 ); if( randomize && BUGGIFY ) MOVE_KEYS_KRM_LIMIT_BYTES = 5e4; //This must be sufficiently larger than CLIENT_KNOBS->KEY_SIZE_LIMIT (fdbclient/Knobs.h) to ensure that at least two entries will be returned from an attempt to read a key range map + init( MOVE_SHARD_KRM_ROW_LIMIT, 20000 ); + init( MOVE_SHARD_KRM_BYTE_LIMIT, 1e6 ); init( MAX_SKIP_TAGS, 1 ); //The TLogs require tags to be densely packed to be memory efficient, so be careful increasing this knob - init( MAX_ADDED_SOURCES_MULTIPLIER, 2.0 ); + init( MAX_ADDED_SOURCES_MULTIPLIER, 0.0 ); if( randomize && BUGGIFY ) MAX_ADDED_SOURCES_MULTIPLIER = 2.0; //FdbServer bool longReboots = randomize && BUGGIFY; @@ -655,18 +764,27 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( RATEKEEPER_PRINT_LIMIT_REASON, false ); if( randomize && BUGGIFY ) RATEKEEPER_PRINT_LIMIT_REASON = true; init( RATEKEEPER_MIN_RATE, 0.0 ); init( RATEKEEPER_MAX_RATE, 1e9 ); + init( RATEKEEPER_BATCH_MIN_RATE, 0.0 ); + init( RATEKEEPER_BATCH_MAX_RATE, 1e9 ); bool smallStorageTarget = randomize && BUGGIFY; init( TARGET_BYTES_PER_STORAGE_SERVER, 1000e6 ); if( smallStorageTarget ) TARGET_BYTES_PER_STORAGE_SERVER = 3000e3; init( SPRING_BYTES_STORAGE_SERVER, 100e6 ); if( smallStorageTarget ) SPRING_BYTES_STORAGE_SERVER = 300e3; init( AUTO_TAG_THROTTLE_STORAGE_QUEUE_BYTES, 800e6 ); if( smallStorageTarget ) AUTO_TAG_THROTTLE_STORAGE_QUEUE_BYTES = 2500e3; + init( AUTO_TAG_THROTTLE_SPRING_BYTES_STORAGE_SERVER, 200e6 ); if( smallStorageTarget ) AUTO_TAG_THROTTLE_SPRING_BYTES_STORAGE_SERVER = 500e3; init( TARGET_BYTES_PER_STORAGE_SERVER_BATCH, 750e6 ); if( smallStorageTarget ) TARGET_BYTES_PER_STORAGE_SERVER_BATCH = 1500e3; init( SPRING_BYTES_STORAGE_SERVER_BATCH, 100e6 ); if( smallStorageTarget ) SPRING_BYTES_STORAGE_SERVER_BATCH = 150e3; init( STORAGE_HARD_LIMIT_BYTES, 1500e6 ); if( smallStorageTarget ) STORAGE_HARD_LIMIT_BYTES = 4500e3; init( STORAGE_HARD_LIMIT_BYTES_OVERAGE, 5000e3 ); if( smallStorageTarget ) STORAGE_HARD_LIMIT_BYTES_OVERAGE = 100e3; // byte+version overage ensures storage server makes enough progress on freeing up storage queue memory at hard limit by ensuring it advances desiredOldestVersion enough per commit cycle. + init( STORAGE_HARD_LIMIT_BYTES_SPEED_UP_SIM, STORAGE_HARD_LIMIT_BYTES ); if( smallStorageTarget ) STORAGE_HARD_LIMIT_BYTES_SPEED_UP_SIM *= 10; + init( STORAGE_HARD_LIMIT_BYTES_OVERAGE_SPEED_UP_SIM, STORAGE_HARD_LIMIT_BYTES_OVERAGE ); if( smallStorageTarget ) STORAGE_HARD_LIMIT_BYTES_OVERAGE_SPEED_UP_SIM *= 10; init( STORAGE_HARD_LIMIT_VERSION_OVERAGE, VERSIONS_PER_SECOND / 4.0 ); init( STORAGE_DURABILITY_LAG_HARD_MAX, 2000e6 ); if( smallStorageTarget ) STORAGE_DURABILITY_LAG_HARD_MAX = 100e6; init( STORAGE_DURABILITY_LAG_SOFT_MAX, 250e6 ); if( smallStorageTarget ) STORAGE_DURABILITY_LAG_SOFT_MAX = 10e6; + init( STORAGE_INCLUDE_FEED_STORAGE_QUEUE, true ); if ( randomize && BUGGIFY ) STORAGE_INCLUDE_FEED_STORAGE_QUEUE = false; + init( STORAGE_SHARD_CONSISTENCY_CHECK_INTERVAL, 0.0); if ( isSimulated ) STORAGE_SHARD_CONSISTENCY_CHECK_INTERVAL = 5.0; + init (STORAGE_FETCH_KEYS_DELAY, 0.0 ); if ( randomize && BUGGIFY ) { STORAGE_FETCH_KEYS_DELAY = deterministicRandom()->random01() * 5.0; } + init (STORAGE_FETCH_KEYS_USE_COMMIT_BUDGET, false ); if (isSimulated) STORAGE_FETCH_KEYS_USE_COMMIT_BUDGET = deterministicRandom()->coinflip(); //FIXME: Low priority reads are disabled by assigning very high knob values, reduce knobs for 7.0 init( LOW_PRIORITY_STORAGE_QUEUE_BYTES, 775e8 ); if( smallStorageTarget ) LOW_PRIORITY_STORAGE_QUEUE_BYTES = 1750e3; @@ -688,7 +806,6 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( MIN_AVAILABLE_SPACE_RATIO, 0.05 ); init( MIN_AVAILABLE_SPACE_RATIO_SAFETY_BUFFER, 0.01 ); init( TARGET_AVAILABLE_SPACE_RATIO, 0.30 ); - init( AVAILABLE_SPACE_UPDATE_DELAY, 5.0 ); init( MAX_TL_SS_VERSION_DIFFERENCE, 1e99 ); // if( randomize && BUGGIFY ) MAX_TL_SS_VERSION_DIFFERENCE = std::max(1.0, 0.25 * VERSIONS_PER_SECOND); // spring starts at half this value //FIXME: this knob causes ratekeeper to clamp on idle cluster in simulation that have a large number of logs init( MAX_TL_SS_VERSION_DIFFERENCE_BATCH, 1e99 ); @@ -704,6 +821,20 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( DURABILITY_LAG_REDUCTION_RATE, 0.9999 ); init( DURABILITY_LAG_INCREASE_RATE, 1.001 ); init( STORAGE_SERVER_LIST_FETCH_TIMEOUT, 20.0 ); + init( BW_THROTTLING_ENABLED, true ); + + bool buggifySmallBWLag = randomize && BUGGIFY; + init( TARGET_BW_LAG, 90.0 ); if(buggifySmallBWLag) TARGET_BW_LAG = 10.0; + init( TARGET_BW_LAG_BATCH, 60.0 ); if(buggifySmallBWLag) TARGET_BW_LAG_BATCH = 4.0; + init( TARGET_BW_LAG_UPDATE, 9.0 ); if(buggifySmallBWLag) TARGET_BW_LAG_UPDATE = 1.0; + init( MIN_BW_HISTORY, 10 ); + init( BW_ESTIMATION_INTERVAL, 10.0 ); if(buggifySmallBWLag) BW_ESTIMATION_INTERVAL = 2.0; + init( BW_LAG_INCREASE_AMOUNT, 1.1 ); + init( BW_LAG_DECREASE_AMOUNT, 0.9 ); + init( BW_FETCH_WORKERS_INTERVAL, 5.0 ); + init( BW_RW_LOGGING_INTERVAL, 5.0 ); + init( BW_MAX_BLOCKED_INTERVAL, 10.0 ); if(buggifySmallBWLag) BW_MAX_BLOCKED_INTERVAL = 2.0; + init( BW_RK_SIM_QUIESCE_DELAY, 500.0 ); init( MAX_AUTO_THROTTLED_TRANSACTION_TAGS, 5 ); if(randomize && BUGGIFY) MAX_AUTO_THROTTLED_TRANSACTION_TAGS = 1; init( MAX_MANUAL_THROTTLED_TRANSACTION_TAGS, 40 ); if(randomize && BUGGIFY) MAX_MANUAL_THROTTLED_TRANSACTION_TAGS = 1; @@ -716,17 +847,35 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( AUTO_TAG_THROTTLE_UPDATE_FREQUENCY, 10.0 ); if(randomize && BUGGIFY) AUTO_TAG_THROTTLE_UPDATE_FREQUENCY = 0.5; init( TAG_THROTTLE_EXPIRED_CLEANUP_INTERVAL, 30.0 ); if(randomize && BUGGIFY) TAG_THROTTLE_EXPIRED_CLEANUP_INTERVAL = 1.0; init( AUTO_TAG_THROTTLING_ENABLED, true ); if(randomize && BUGGIFY) AUTO_TAG_THROTTLING_ENABLED = false; + init( SS_THROTTLE_TAGS_TRACKED, 1 ); if(randomize && BUGGIFY) SS_THROTTLE_TAGS_TRACKED = deterministicRandom()->randomInt(1, 10); + init( GLOBAL_TAG_THROTTLING, true ); if(isSimulated) GLOBAL_TAG_THROTTLING = deterministicRandom()->coinflip(); + init( ENFORCE_TAG_THROTTLING_ON_PROXIES, GLOBAL_TAG_THROTTLING ); + init( GLOBAL_TAG_THROTTLING_MIN_RATE, 1.0 ); + init( GLOBAL_TAG_THROTTLING_MAX_TAGS_TRACKED, 10 ); + init( GLOBAL_TAG_THROTTLING_TAG_EXPIRE_AFTER, 240.0 ); + init( GLOBAL_TAG_THROTTLING_PROXY_LOGGING_INTERVAL, 60.0 ); + init( GLOBAL_TAG_THROTTLING_TRACE_INTERVAL, 5.0 ); + init( GLOBAL_TAG_THROTTLING_REPORT_ONLY, false ); + + init( GLOBAL_TAG_THROTTLING_TARGET_RATE_FOLDING_TIME, 10.0 ); + init( GLOBAL_TAG_THROTTLING_TRANSACTION_COUNT_FOLDING_TIME, 2.0 ); + init( GLOBAL_TAG_THROTTLING_TRANSACTION_RATE_FOLDING_TIME, 10.0 ); + init( GLOBAL_TAG_THROTTLING_COST_FOLDING_TIME, 10.0 ); //Storage Metrics init( STORAGE_METRICS_AVERAGE_INTERVAL, 120.0 ); init( STORAGE_METRICS_AVERAGE_INTERVAL_PER_KSECONDS, 1000.0 / STORAGE_METRICS_AVERAGE_INTERVAL ); // milliHz! init( SPLIT_JITTER_AMOUNT, 0.05 ); if( randomize && BUGGIFY ) SPLIT_JITTER_AMOUNT = 0.2; init( IOPS_UNITS_PER_SAMPLE, 10000 * 1000 / STORAGE_METRICS_AVERAGE_INTERVAL_PER_KSECONDS / 100 ); - init( BANDWIDTH_UNITS_PER_SAMPLE, SHARD_MIN_BYTES_PER_KSEC / STORAGE_METRICS_AVERAGE_INTERVAL_PER_KSECONDS / 25 ); + init( BYTES_WRITTEN_UNITS_PER_SAMPLE, SHARD_MIN_BYTES_PER_KSEC / STORAGE_METRICS_AVERAGE_INTERVAL_PER_KSECONDS / 25 ); init( BYTES_READ_UNITS_PER_SAMPLE, 100000 ); // 100K bytes + init( OPS_READ_UNITES_PER_SAMPLE, 100 * STORAGE_METRICS_AVERAGE_INTERVAL ); // during a sampling interval, in average every 100 op being sampled once init( READ_HOT_SUB_RANGE_CHUNK_SIZE, 10000000); // 10MB init( EMPTY_READ_PENALTY, 20 ); // 20 bytes + init( DD_SHARD_COMPARE_LIMIT, 1000 ); init( READ_SAMPLING_ENABLED, false ); if ( randomize && BUGGIFY ) READ_SAMPLING_ENABLED = true;// enable/disable read sampling + init( DD_TRACE_MOVE_BYTES_AVERAGE_INTERVAL, 120); + init( MOVING_WINDOW_SAMPLE_SIZE, 10000000); // 10MB //Storage Server init( STORAGE_LOGGING_DELAY, 5.0 ); @@ -735,36 +884,68 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( STORAGE_LIMIT_BYTES, 500000 ); init( BUGGIFY_LIMIT_BYTES, 1000 ); init( FETCH_USING_STREAMING, false ); if( randomize && isSimulated && BUGGIFY ) FETCH_USING_STREAMING = true; //Determines if fetch keys uses streaming reads + init( FETCH_USING_BLOB, false ); init( FETCH_BLOCK_BYTES, 2e6 ); init( FETCH_KEYS_PARALLELISM_BYTES, 4e6 ); if( randomize && BUGGIFY ) FETCH_KEYS_PARALLELISM_BYTES = 3e6; init( FETCH_KEYS_PARALLELISM, 2 ); + init( FETCH_KEYS_PARALLELISM_CHANGE_FEED, 6 ); init( FETCH_KEYS_LOWER_PRIORITY, 0 ); - init( FETCH_CHANGEFEED_PARALLELISM, 2 ); + init( SERVE_FETCH_CHECKPOINT_PARALLELISM, 4 ); + init( SERVE_AUDIT_STORAGE_PARALLELISM, 1 ); + init( PERSIST_FINISH_AUDIT_COUNT, 10 ); if ( isSimulated ) PERSIST_FINISH_AUDIT_COUNT = deterministicRandom()->randomInt(1, PERSIST_FINISH_AUDIT_COUNT+1); + init( AUDIT_RETRY_COUNT_MAX, 10000 ); if ( isSimulated ) AUDIT_RETRY_COUNT_MAX = 10; + init( CONCURRENT_AUDIT_TASK_COUNT_MAX, 20 ); if ( isSimulated ) CONCURRENT_AUDIT_TASK_COUNT_MAX = deterministicRandom()->randomInt(1, CONCURRENT_AUDIT_TASK_COUNT_MAX+1); + init( AUDIT_DATAMOVE_PRE_CHECK, false ); if ( isSimulated ) AUDIT_DATAMOVE_PRE_CHECK = true; + init( AUDIT_DATAMOVE_POST_CHECK, false ); if ( isSimulated ) AUDIT_DATAMOVE_POST_CHECK = true; + init( AUDIT_DATAMOVE_POST_CHECK_RETRY_COUNT_MAX, 50 ); + init( AUDIT_STORAGE_RATE_PER_SERVER_MAX, 50e6 ); // per second + init( ENABLE_AUDIT_VERBOSE_TRACE, false ); + init( LOGGING_STORAGE_COMMIT_WHEN_IO_TIMEOUT, true ); + init( LOGGING_RECENT_STORAGE_COMMIT_SIZE, 20 ); + init( LOGGING_COMPLETE_STORAGE_COMMIT_PROBABILITY, 0.001 ); + init( LOGGING_ROCKSDB_BG_WORK_WHEN_IO_TIMEOUT, true ); + init( LOGGING_ROCKSDB_BG_WORK_PERIOD_SEC, 10 ); + init( LOGGING_ROCKSDB_BG_WORK_PROBABILITY, 0.001 ); init( BUGGIFY_BLOCK_BYTES, 10000 ); init( STORAGE_RECOVERY_VERSION_LAG_LIMIT, 2 * MAX_READ_TRANSACTION_LIFE_VERSIONS ); init( STORAGE_COMMIT_BYTES, 10000000 ); if( randomize && BUGGIFY ) STORAGE_COMMIT_BYTES = 2000000; init( STORAGE_FETCH_BYTES, 2500000 ); if( randomize && BUGGIFY ) STORAGE_FETCH_BYTES = 500000; + init( STORAGE_ROCKSDB_FETCH_BYTES, 2500000 ); if( randomize && BUGGIFY ) STORAGE_FETCH_BYTES = 500000; init( STORAGE_DURABILITY_LAG_REJECT_THRESHOLD, 0.25 ); init( STORAGE_DURABILITY_LAG_MIN_RATE, 0.1 ); init( STORAGE_COMMIT_INTERVAL, 0.5 ); if( randomize && BUGGIFY ) STORAGE_COMMIT_INTERVAL = 2.0; - init( UPDATE_SHARD_VERSION_INTERVAL, 0.25 ); if( randomize && BUGGIFY ) UPDATE_SHARD_VERSION_INTERVAL = 1.0; + + // Constants which affect the fraction of data which is sampled + // by storage severs to estimate key-range sizes and splits. + // + // The rough goal is for the sample size to be a fixed fraction of the total + // size of all keys and values, 1/BYTE_SAMPLING_FACTOR, which defaults to 1/250. + // This includes an estimated overhead per entry of BYTE_SAMPLING_OVERHEAD, + // which defaults to 100 bytes. + // + // NOTE: This BYTE_SAMPLING_FACTOR and BYTE_SAMPLING_OVERHEAD knobs can't be + // changed after a database has been created. Data which has been already + // sampled can't be resampled, and the estimates of the size of key ranges + // implicitly includes these constants. init( BYTE_SAMPLING_FACTOR, 250 ); //cannot buggify because of differences in restarting tests init( BYTE_SAMPLING_OVERHEAD, 100 ); + + // Adjustable only for test of PhysicalShardMove. Should always be 0 for other cases. + init( MIN_BYTE_SAMPLING_PROBABILITY, 0 ); + init( MAX_STORAGE_SERVER_WATCH_BYTES, 100e6 ); if( randomize && BUGGIFY ) MAX_STORAGE_SERVER_WATCH_BYTES = 10e3; init( MAX_BYTE_SAMPLE_CLEAR_MAP_SIZE, 1e9 ); if( randomize && BUGGIFY ) MAX_BYTE_SAMPLE_CLEAR_MAP_SIZE = 1e3; init( LONG_BYTE_SAMPLE_RECOVERY_DELAY, 60.0 ); init( BYTE_SAMPLE_LOAD_PARALLELISM, 8 ); if( randomize && BUGGIFY ) BYTE_SAMPLE_LOAD_PARALLELISM = 1; init( BYTE_SAMPLE_LOAD_DELAY, 0.0 ); if( randomize && BUGGIFY ) BYTE_SAMPLE_LOAD_DELAY = 0.1; init( BYTE_SAMPLE_START_DELAY, 1.0 ); if( randomize && BUGGIFY ) BYTE_SAMPLE_START_DELAY = 0.0; - init( UPDATE_STORAGE_PROCESS_STATS_INTERVAL, 5.0 ); init( BEHIND_CHECK_DELAY, 2.0 ); init( BEHIND_CHECK_COUNT, 2 ); init( BEHIND_CHECK_VERSIONS, 5 * VERSIONS_PER_SECOND ); init( WAIT_METRICS_WRONG_SHARD_CHANCE, isSimulated ? 1.0 : 0.1 ); - init( MIN_TAG_READ_PAGES_RATE, 1.0e4 ); if( randomize && BUGGIFY ) MIN_TAG_READ_PAGES_RATE = 0; - init( MIN_TAG_WRITE_PAGES_RATE, 3200 ); if( randomize && BUGGIFY ) MIN_TAG_WRITE_PAGES_RATE = 0; - init( TAG_MEASUREMENT_INTERVAL, 30.0 ); if( randomize && BUGGIFY ) TAG_MEASUREMENT_INTERVAL = 1.0; - init( READ_COST_BYTE_FACTOR, 16384 ); if( randomize && BUGGIFY ) READ_COST_BYTE_FACTOR = 4096; + init( MIN_TAG_READ_PAGES_RATE, 100 ); if( randomize && BUGGIFY ) MIN_TAG_READ_PAGES_RATE = 0; + init( MIN_TAG_WRITE_PAGES_RATE, 100 ); if( randomize && BUGGIFY ) MIN_TAG_WRITE_PAGES_RATE = 0; + init( TAG_MEASUREMENT_INTERVAL, 5.0 ); if( randomize && BUGGIFY ) TAG_MEASUREMENT_INTERVAL = 10.0; init( PREFIX_COMPRESS_KVS_MEM_SNAPSHOTS, true ); if( randomize && BUGGIFY ) PREFIX_COMPRESS_KVS_MEM_SNAPSHOTS = false; init( REPORT_DD_METRICS, true ); init( DD_METRICS_REPORT_INTERVAL, 30.0 ); @@ -782,6 +963,18 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( MAX_PARALLEL_QUICK_GET_VALUE, 10 ); if ( randomize && BUGGIFY ) MAX_PARALLEL_QUICK_GET_VALUE = deterministicRandom()->randomInt(1, 100); init( QUICK_GET_KEY_VALUES_LIMIT, 2000 ); init( QUICK_GET_KEY_VALUES_LIMIT_BYTES, 1e7 ); + init( STORAGE_FEED_QUERY_HARD_LIMIT, 100000 ); + // Read priority definitions in the form of a list of their relative concurrency share weights + init( STORAGESERVER_READ_PRIORITIES, "120,10,20,40,60" ); + // The total concurrency which will be shared by active priorities according to their relative weights + init( STORAGE_SERVER_READ_CONCURRENCY, 70 ); + // The priority number which each ReadType maps to in enumeration order + // This exists for flexibility but assigning each ReadType to its own unique priority number makes the most sense + // The enumeration is currently: eager, fetch, low, normal, high + init( STORAGESERVER_READTYPE_PRIORITY_MAP, "0,1,2,3,4" ); + init( SPLIT_METRICS_MAX_ROWS, 10000 ); if( randomize && BUGGIFY ) SPLIT_METRICS_MAX_ROWS = 10; + init( PHYSICAL_SHARD_MOVE_LOG_SEVERITY, 1); + init( FETCH_SHARD_BUFFER_BYTE_LIMIT, 20e6 ); //Wait Failure init( MAX_OUTSTANDING_WAIT_FAILURE_REQUESTS, 250 ); if( randomize && BUGGIFY ) MAX_OUTSTANDING_WAIT_FAILURE_REQUESTS = 2; @@ -789,9 +982,10 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi //Worker init( WORKER_LOGGING_INTERVAL, 5.0 ); + init( ROLE_REFRESH_LOGGING_INTERVAL, 60.0 ); init( HEAP_PROFILER_INTERVAL, 30.0 ); init( UNKNOWN_CC_TIMEOUT, 600.0 ); - init( DEGRADED_RESET_INTERVAL, 24*60*60 ); if ( randomize && BUGGIFY ) DEGRADED_RESET_INTERVAL = 10; + init( DEGRADED_RESET_INTERVAL, 24*60*60 ); // FIXME: short interval causes false positive degraded state to flap, e.g. when everyone tries and fails to connect to dead coordinator: if ( randomize && BUGGIFY ) DEGRADED_RESET_INTERVAL = 10; init( DEGRADED_WARNING_LIMIT, 1 ); init( DEGRADED_WARNING_RESET_DELAY, 7*24*60*60 ); init( TRACE_LOG_FLUSH_FAILURE_CHECK_INTERVAL_SECONDS, 10 ); @@ -811,8 +1005,9 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( WORKER_HEALTH_REPORT_RECENT_DESTROYED_PEER, true ); init( GRAY_FAILURE_ENABLE_TLOG_RECOVERY_MONITORING, true ); init( STORAGE_SERVER_REBOOT_ON_IO_TIMEOUT, false ); if ( randomize && BUGGIFY ) STORAGE_SERVER_REBOOT_ON_IO_TIMEOUT = true; - init( CONSISTENCY_CHECK_ROCKSDB_ENGINE, false ); - init( CONSISTENCY_CHECK_SQLITE_ENGINE, false ); + init( STORAGE_DISK_CLEANUP_MAX_RETRIES, 10 ); + init( STORAGE_DISK_CLEANUP_RETRY_INTERVAL, isSimulated ? 2 : 30 ); + init( WORKER_START_STORAGE_DELAY, 0.0 ); if ( randomize && BUGGIFY ) WORKER_START_STORAGE_DELAY = 1.0; // Test harness init( WORKER_POLL_DELAY, 1.0 ); @@ -825,7 +1020,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi // Dynamic Knobs (implementation) init( COMPACTION_INTERVAL, isSimulated ? 5.0 : 300.0 ); - init( UPDATE_NODE_TIMEOUT, 3.0 ); + init( BROADCASTER_SELF_UPDATE_DELAY, 1.0 ); init( GET_COMMITTED_VERSION_TIMEOUT, 3.0 ); init( GET_SNAPSHOT_AND_CHANGES_TIMEOUT, 3.0 ); init( FETCH_CHANGES_TIMEOUT, 3.0 ); @@ -841,14 +1036,6 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( DISABLE_DUPLICATE_LOG_WARNING, false ); init( HISTOGRAM_REPORT_INTERVAL, 300.0 ); - // IPager - init( PAGER_RESERVED_PAGES, 1 ); - - // IndirectShadowPager - init( FREE_PAGE_VACUUM_THRESHOLD, 1 ); - init( VACUUM_QUEUE_SIZE, 100000 ); - init( VACUUM_BYTES_PER_SECOND, 1e6 ); - // Timekeeper init( TIME_KEEPER_DELAY, 10 ); init( TIME_KEEPER_MAX_ENTRIES, 3600 * 24 * 30 * 6 ); if( randomize && BUGGIFY ) { TIME_KEEPER_MAX_ENTRIES = 2; } @@ -860,18 +1047,16 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( FASTRESTORE_NUM_LOADERS, 3 ); if( randomize && BUGGIFY ) { FASTRESTORE_NUM_LOADERS = deterministicRandom()->random01() * 10 + 1; } init( FASTRESTORE_NUM_APPLIERS, 3 ); if( randomize && BUGGIFY ) { FASTRESTORE_NUM_APPLIERS = deterministicRandom()->random01() * 10 + 1; } init( FASTRESTORE_TXN_BATCH_MAX_BYTES, 1024.0 * 1024.0 ); if( randomize && BUGGIFY ) { FASTRESTORE_TXN_BATCH_MAX_BYTES = deterministicRandom()->random01() * 1024.0 * 1024.0 + 1.0; } - init( FASTRESTORE_VERSIONBATCH_MAX_BYTES, 10.0 * 1024.0 * 1024.0 ); if( randomize && BUGGIFY ) { FASTRESTORE_VERSIONBATCH_MAX_BYTES = deterministicRandom()->random01() < 0.2 ? 10 * 1024 : deterministicRandom()->random01() < 0.4 ? 100 * 1024 * 1024 : deterministicRandom()->random01() * 1000.0 * 1024.0 * 1024.0; } // too small value may increase chance of TooManyFile error + init( FASTRESTORE_VERSIONBATCH_MAX_BYTES, 10.0 * 1024.0 * 1024.0 ); if( randomize && BUGGIFY ) { FASTRESTORE_VERSIONBATCH_MAX_BYTES = deterministicRandom()->random01() < 0.2 ? 50 * 1024 : deterministicRandom()->random01() < 0.4 ? 100 * 1024 * 1024 : deterministicRandom()->random01() * 1000.0 * 1024.0 * 1024.0; } // too small value may increase chance of TooManyFile error init( FASTRESTORE_VB_PARALLELISM, 5 ); if( randomize && BUGGIFY ) { FASTRESTORE_VB_PARALLELISM = deterministicRandom()->random01() < 0.2 ? 2 : deterministicRandom()->random01() * 10 + 1; } init( FASTRESTORE_VB_MONITOR_DELAY, 30 ); if( randomize && BUGGIFY ) { FASTRESTORE_VB_MONITOR_DELAY = deterministicRandom()->random01() * 20 + 1; } init( FASTRESTORE_VB_LAUNCH_DELAY, 1.0 ); if( randomize && BUGGIFY ) { FASTRESTORE_VB_LAUNCH_DELAY = deterministicRandom()->random01() < 0.2 ? 0.1 : deterministicRandom()->random01() * 10.0 + 1; } init( FASTRESTORE_ROLE_LOGGING_DELAY, 5 ); if( randomize && BUGGIFY ) { FASTRESTORE_ROLE_LOGGING_DELAY = deterministicRandom()->random01() * 60 + 1; } init( FASTRESTORE_UPDATE_PROCESS_STATS_INTERVAL, 5 ); if( randomize && BUGGIFY ) { FASTRESTORE_UPDATE_PROCESS_STATS_INTERVAL = deterministicRandom()->random01() * 60 + 1; } init( FASTRESTORE_ATOMICOP_WEIGHT, 1 ); if( randomize && BUGGIFY ) { FASTRESTORE_ATOMICOP_WEIGHT = deterministicRandom()->random01() * 200 + 1; } - init( FASTRESTORE_APPLYING_PARALLELISM, 10000 ); if( randomize && BUGGIFY ) { FASTRESTORE_APPLYING_PARALLELISM = deterministicRandom()->random01() * 10 + 1; } init( FASTRESTORE_MONITOR_LEADER_DELAY, 5 ); if( randomize && BUGGIFY ) { FASTRESTORE_MONITOR_LEADER_DELAY = deterministicRandom()->random01() * 100; } init( FASTRESTORE_STRAGGLER_THRESHOLD_SECONDS, 60 ); if( randomize && BUGGIFY ) { FASTRESTORE_STRAGGLER_THRESHOLD_SECONDS = deterministicRandom()->random01() * 240 + 10; } init( FASTRESTORE_TRACK_REQUEST_LATENCY, false ); if( randomize && BUGGIFY ) { FASTRESTORE_TRACK_REQUEST_LATENCY = false; } - init( FASTRESTORE_TRACK_LOADER_SEND_REQUESTS, false ); if( randomize && BUGGIFY ) { FASTRESTORE_TRACK_LOADER_SEND_REQUESTS = true; } init( FASTRESTORE_MEMORY_THRESHOLD_MB_SOFT, 6144 ); if( randomize && BUGGIFY ) { FASTRESTORE_MEMORY_THRESHOLD_MB_SOFT = 1; } init( FASTRESTORE_WAIT_FOR_MEMORY_LATENCY, 10 ); if( randomize && BUGGIFY ) { FASTRESTORE_WAIT_FOR_MEMORY_LATENCY = 60; } init( FASTRESTORE_HEARTBEAT_DELAY, 10 ); if( randomize && BUGGIFY ) { FASTRESTORE_HEARTBEAT_DELAY = deterministicRandom()->random01() * 120 + 2; } @@ -906,9 +1091,9 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( REDWOOD_DEFAULT_EXTENT_SIZE, 32 * 1024 * 1024 ); init( REDWOOD_DEFAULT_EXTENT_READ_SIZE, 1024 * 1024 ); init( REDWOOD_EXTENT_CONCURRENT_READS, 4 ); - init( REDWOOD_KVSTORE_CONCURRENT_READS, 64 ); init( REDWOOD_KVSTORE_RANGE_PREFETCH, true ); init( REDWOOD_PAGE_REBUILD_MAX_SLACK, 0.33 ); + init( REDWOOD_PAGE_REBUILD_SLACK_DISTRIBUTION, 0.50 ); init( REDWOOD_LAZY_CLEAR_BATCH_SIZE_PAGES, 10 ); init( REDWOOD_LAZY_CLEAR_MIN_PAGES, 0 ); init( REDWOOD_LAZY_CLEAR_MAX_PAGES, 1e6 ); @@ -919,43 +1104,140 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi init( REDWOOD_HISTOGRAM_INTERVAL, 30.0 ); init( REDWOOD_EVICT_UPDATED_PAGES, true ); if( randomize && BUGGIFY ) { REDWOOD_EVICT_UPDATED_PAGES = false; } init( REDWOOD_DECODECACHE_REUSE_MIN_HEIGHT, 2 ); if( randomize && BUGGIFY ) { REDWOOD_DECODECACHE_REUSE_MIN_HEIGHT = deterministicRandom()->randomInt(1, 7); } + init( REDWOOD_NODE_MAX_UNBALANCE, 2 ); + init( REDWOOD_IO_PRIORITIES, "32,32,32,32" ); // Server request latency measurement - init( LATENCY_SAMPLE_SIZE, 100000 ); + init( LATENCY_SKETCH_ACCURACY, 0.01 ); + init( FILE_LATENCY_SKETCH_ACCURACY, 0.01 ); init( LATENCY_METRICS_LOGGING_INTERVAL, 60.0 ); // Cluster recovery - init ( CLUSTER_RECOVERY_EVENT_NAME_PREFIX, "Master"); + init ( CLUSTER_RECOVERY_EVENT_NAME_PREFIX, "Master" ); - // encrypt key proxy - init( ENABLE_ENCRYPTION, false ); - init( ENCRYPTION_MODE, "AES-256-CTR"); + // Encryption + init( SIM_KMS_MAX_KEYS, 4096 ); + init( ENCRYPT_PROXY_MAX_DBG_TRACE_LENGTH, 100000 ); + + // encrypt key proxy + init( ENABLE_BLOB_GRANULE_COMPRESSION, false ); if ( randomize && BUGGIFY ) { ENABLE_BLOB_GRANULE_COMPRESSION = deterministicRandom()->coinflip(); } + init( BLOB_GRANULE_COMPRESSION_FILTER, "NONE" ); if ( randomize && BUGGIFY ) { BLOB_GRANULE_COMPRESSION_FILTER = CompressionUtils::toString(CompressionUtils::getRandomFilter()); } + init( ENCRYPTION_LOGGING_INTERVAL, 5.0 ); + + // KMS connector type + init( KMS_CONNECTOR_TYPE, "RESTKmsConnector" ); // Blob granlues - init( BG_URL, isSimulated ? "file://fdbblob/" : "" ); // TODO: store in system key space or something, eventually - init( BG_SNAPSHOT_FILE_TARGET_BYTES, 10000000 ); if( buggifySmallShards ) BG_SNAPSHOT_FILE_TARGET_BYTES = 100000; else if (simulationMediumShards || (randomize && BUGGIFY) ) BG_SNAPSHOT_FILE_TARGET_BYTES = 1000000; - init( BG_DELTA_BYTES_BEFORE_COMPACT, BG_SNAPSHOT_FILE_TARGET_BYTES/2 ); + init( BG_URL, isSimulated ? "file://simfdb/fdbblob/" : "" ); // TODO: store in system key space or something, eventually + bool buggifyMediumGranules = simulationMediumShards || (randomize && BUGGIFY); + // BlobGranuleVerify* simulation tests use "knobs", BlobGranuleCorrectness* use "tenant", default in real clusters is "knobs" + init( BG_METADATA_SOURCE, "knobs" ); + // All clients must be writing this before server can make use of it. FIXME: Enable in next release + init( BG_USE_BLOB_RANGE_CHANGE_LOG, false ); if ( randomize && BUGGIFY ) BG_USE_BLOB_RANGE_CHANGE_LOG = true; + init( BG_SNAPSHOT_FILE_TARGET_BYTES, 20000000 ); if ( buggifySmallShards ) BG_SNAPSHOT_FILE_TARGET_BYTES = 50000 * deterministicRandom()->randomInt(1, 4); else if (buggifyMediumGranules) BG_SNAPSHOT_FILE_TARGET_BYTES = 50000 * deterministicRandom()->randomInt(1, 20); + init( BG_SNAPSHOT_FILE_TARGET_CHUNK_BYTES, 64*1024 ); if ( randomize && BUGGIFY ) BG_SNAPSHOT_FILE_TARGET_CHUNK_BYTES = BG_SNAPSHOT_FILE_TARGET_BYTES / (1 << deterministicRandom()->randomInt(0, 8)); + init( BG_DELTA_BYTES_BEFORE_COMPACT, BG_SNAPSHOT_FILE_TARGET_BYTES/2 ); if ( randomize && BUGGIFY ) BG_DELTA_BYTES_BEFORE_COMPACT *= (1.0 + deterministicRandom()->random01() * 3.0)/2.0; init( BG_DELTA_FILE_TARGET_BYTES, BG_DELTA_BYTES_BEFORE_COMPACT/10 ); + init( BG_DELTA_FILE_TARGET_CHUNK_BYTES, 32*1024 ); if ( randomize && BUGGIFY ) BG_DELTA_FILE_TARGET_CHUNK_BYTES = BG_DELTA_FILE_TARGET_BYTES / (1 << deterministicRandom()->randomInt(0, 7)); init( BG_MAX_SPLIT_FANOUT, 10 ); if( randomize && BUGGIFY ) BG_MAX_SPLIT_FANOUT = deterministicRandom()->randomInt(5, 15); + init( BG_MAX_MERGE_FANIN, 10 ); if( randomize && BUGGIFY ) BG_MAX_MERGE_FANIN = deterministicRandom()->randomInt(2, 15); init( BG_HOT_SNAPSHOT_VERSIONS, 5000000 ); init( BG_CONSISTENCY_CHECK_ENABLED, true ); if (randomize && BUGGIFY) BG_CONSISTENCY_CHECK_ENABLED = false; init( BG_CONSISTENCY_CHECK_TARGET_SPEED_KB, 1000 ); if (randomize && BUGGIFY) BG_CONSISTENCY_CHECK_TARGET_SPEED_KB *= (deterministicRandom()->randomInt(2, 50) / 10); + init( BG_KEY_TUPLE_TRUNCATE_OFFSET, 0 ); + init( BG_ENABLE_SPLIT_TRUNCATED, false ); if (randomize && BUGGIFY) BG_ENABLE_SPLIT_TRUNCATED = true; + init( BG_ENABLE_READ_DRIVEN_COMPACTION, true ); if (randomize && BUGGIFY) BG_ENABLE_READ_DRIVEN_COMPACTION = false; + init( BG_RDC_BYTES_FACTOR, 2 ); if (randomize && BUGGIFY) BG_RDC_BYTES_FACTOR = deterministicRandom()->randomInt(1, 10); + init( BG_RDC_READ_FACTOR, 3 ); if (randomize && BUGGIFY) BG_RDC_READ_FACTOR = deterministicRandom()->randomInt(1, 10); + init( BG_WRITE_MULTIPART, false ); if (randomize && BUGGIFY) BG_WRITE_MULTIPART = true; + init( BG_ENABLE_DYNAMIC_WRITE_AMP, true ); if (randomize && BUGGIFY) BG_ENABLE_DYNAMIC_WRITE_AMP = false; + init( BG_DYNAMIC_WRITE_AMP_MIN_FACTOR, 0.5 ); + init( BG_DYNAMIC_WRITE_AMP_DECREASE_FACTOR, 0.8 ); + + init( BG_ENABLE_MERGING, true ); if (randomize && BUGGIFY) BG_ENABLE_MERGING = false; + init( BG_MERGE_CANDIDATE_THRESHOLD_SECONDS, isSimulated ? 20.0 : 30 * 60 ); if (randomize && BUGGIFY) BG_MERGE_CANDIDATE_THRESHOLD_SECONDS = 5.0; + init( BG_MERGE_CANDIDATE_DELAY_SECONDS, BG_MERGE_CANDIDATE_THRESHOLD_SECONDS / 10.0 ); init( BLOB_WORKER_INITIAL_SNAPSHOT_PARALLELISM, 8 ); if( randomize && BUGGIFY ) BLOB_WORKER_INITIAL_SNAPSHOT_PARALLELISM = 1; + // The resnapshot/delta parallelism knobs are deprecated and replaced by the budget_bytes knobs! FIXME: remove after next release + init( BLOB_WORKER_RESNAPSHOT_PARALLELISM, 40 ); if( randomize && BUGGIFY ) BLOB_WORKER_RESNAPSHOT_PARALLELISM = deterministicRandom()->randomInt(1, 10); + init( BLOB_WORKER_DELTA_FILE_WRITE_PARALLELISM, 2000 ); if( randomize && BUGGIFY ) BLOB_WORKER_DELTA_FILE_WRITE_PARALLELISM = deterministicRandom()->randomInt(10, 100); + init( BLOB_WORKER_RDC_PARALLELISM, 2 ); if( randomize && BUGGIFY ) BLOB_WORKER_RDC_PARALLELISM = deterministicRandom()->randomInt(1, 6); + init( BLOB_WORKER_RESNAPSHOT_BUDGET_BYTES, 1024*1024*1024 ); if( randomize && BUGGIFY ) BLOB_WORKER_RESNAPSHOT_BUDGET_BYTES = deterministicRandom()->random01() * 10 * BG_SNAPSHOT_FILE_TARGET_BYTES; + init( BLOB_WORKER_DELTA_WRITE_BUDGET_BYTES, 1024*1024*1024 ); if( randomize && BUGGIFY ) BLOB_WORKER_DELTA_WRITE_BUDGET_BYTES = (5 + 45*deterministicRandom()->random01()) * BG_DELTA_FILE_TARGET_BYTES; init( BLOB_WORKER_TIMEOUT, 10.0 ); if( randomize && BUGGIFY ) BLOB_WORKER_TIMEOUT = 1.0; - init( BLOB_WORKER_REQUEST_TIMEOUT, 5.0 ); if( randomize && BUGGIFY ) BLOB_WORKER_REQUEST_TIMEOUT = 1.0; + // more than MVCC window since behind delta files can block for that window for committed check + init( BLOB_WORKER_REQUEST_TIMEOUT, 10.0 ); if( randomize && BUGGIFY ) BLOB_WORKER_REQUEST_TIMEOUT = 1.0; init( BLOB_WORKERLIST_FETCH_INTERVAL, 1.0 ); init( BLOB_WORKER_BATCH_GRV_INTERVAL, 0.1 ); - + init( BLOB_WORKER_EMPTY_GRV_INTERVAL, 0.5 ); + init( BLOB_WORKER_GRV_HISTORY_MAX_SIZE, 10000 ); if ( randomize && BUGGIFY ) BLOB_WORKER_GRV_HISTORY_MAX_SIZE = deterministicRandom()->randomInt(1, 20); + init( BLOB_WORKER_GRV_HISTORY_MIN_VERSION_GRANULARITY, 100000 ); if ( randomize && BUGGIFY ) BLOB_WORKER_GRV_HISTORY_MIN_VERSION_GRANULARITY = deterministicRandom()->randomSkewedUInt32(1, 1000000); + init( BLOB_WORKER_DO_REJECT_WHEN_FULL, true ); if ( randomize && BUGGIFY ) BLOB_WORKER_DO_REJECT_WHEN_FULL = false; + init( BLOB_WORKER_REJECT_WHEN_FULL_THRESHOLD, 0.9 ); + init( BLOB_WORKER_FORCE_FLUSH_CLEANUP_DELAY, 30.0 ); if ( randomize && BUGGIFY ) BLOB_WORKER_FORCE_FLUSH_CLEANUP_DELAY = deterministicRandom()->randomInt(0, 10) - 1; + init( BLOB_WORKER_DISK_ENABLED, false ); if ( randomize && BUGGIFY ) BLOB_WORKER_DISK_ENABLED = true; + init( BLOB_WORKER_STORE_TYPE, 3 ); + init( BLOB_WORKER_REJOIN_TIME, 10.0 ); init( BLOB_MANAGER_STATUS_EXP_BACKOFF_MIN, 0.1 ); init( BLOB_MANAGER_STATUS_EXP_BACKOFF_MAX, 5.0 ); init( BLOB_MANAGER_STATUS_EXP_BACKOFF_EXPONENT, 1.5 ); + init( BLOB_MANAGER_CONCURRENT_MERGE_CHECKS, 64 ); if( randomize && BUGGIFY ) BLOB_MANAGER_CONCURRENT_MERGE_CHECKS = 1 << deterministicRandom()->randomInt(0, 7); + init( BLOB_MANIFEST_BACKUP, false ); + init( BLOB_MANIFEST_BACKUP_INTERVAL, isSimulated ? 5.0 : 300.0 ); + init( BLOB_FULL_RESTORE_MODE, false ); + init( BLOB_MIGRATOR_CHECK_INTERVAL, isSimulated ? 1.0 : 5.0 ); + init( BLOB_MANIFEST_RW_ROWS, isSimulated ? 10 : 1000 ); + init( BLOB_RESTORE_MLOGS_URL, isSimulated ? "file://simfdb/backups/" : "" ); + init( BLOB_MIGRATOR_ERROR_RETRIES, 20 ); + init( BLOB_RESTORE_MANIFEST_URL, isSimulated ? "file://simfdb/fdbblob/manifest" : "" ); + init( BLOB_RESTORE_MANIFEST_FILE_MAX_SIZE, isSimulated ? 10000 : 10000000 ); + init( BLOB_RESTORE_MANIFEST_RETENTION_MAX, 10 ); + init( BLOB_RESTORE_MLOGS_RETENTION_SECS, isSimulated ? 120 : 3600 * 24 * 14 ); init( BGCC_TIMEOUT, isSimulated ? 10.0 : 120.0 ); init( BGCC_MIN_INTERVAL, isSimulated ? 1.0 : 10.0 ); + // Blob Metadata + init( BLOB_METADATA_CACHE_TTL, isSimulated ? 120 : 24 * 60 * 60 ); + if ( randomize && BUGGIFY) { BLOB_METADATA_CACHE_TTL = deterministicRandom()->randomInt(50, 100); } + + // HTTP KMS Connector + init( REST_KMS_CONNECTOR_KMS_DISCOVERY_URL_MODE, "file"); + init( REST_KMS_CONNECTOR_VALIDATION_TOKEN_MODE, "file"); + init( REST_KMS_CONNECTOR_VALIDATION_TOKEN_MAX_SIZE, 1024); + init( REST_KMS_CONNECTOR_VALIDATION_TOKENS_MAX_PAYLOAD_SIZE, 10 * 1024); + init( REST_KMS_CONNECTOR_REFRESH_KMS_URLS, true); + init( REST_KMS_CONNECTOR_REFRESH_KMS_URLS_INTERVAL_SEC, 600); + // Below KMS configurations are responsible for: + // Discovering KMS URLs, fetch encryption keys endpoint and validation token details. + // Configurations are expected to be passed as command-line arguments. + // NOTE: Care must be taken when attempting to update below configurations for a up/running FDB cluster. + init( REST_KMS_CONNECTOR_DISCOVER_KMS_URL_FILE, ""); + init( REST_KMS_CONNECTOR_GET_ENCRYPTION_KEYS_ENDPOINT, ""); + init( REST_KMS_CONNECTOR_GET_LATEST_ENCRYPTION_KEYS_ENDPOINT, ""); + init( REST_KMS_CONNECTOR_GET_BLOB_METADATA_ENDPOINT, ""); + // Details to fetch validation token from a localhost file + // acceptable format: "$,$,.." + // NOTE: 'token-name" can NOT contain '$' character + init( REST_KMS_CONNECTOR_VALIDATION_TOKEN_DETAILS, ""); + init( ENABLE_REST_KMS_COMMUNICATION, false); if( randomize && BUGGIFY ) ENABLE_REST_KMS_COMMUNICATION = true; + init( REST_KMS_CONNECTOR_REMOVE_TRAILING_NEWLINE, false); + init( REST_KMS_CURRENT_BLOB_METADATA_REQUEST_VERSION, 1); + init( REST_KMS_MAX_BLOB_METADATA_REQUEST_VERSION, 1); + init( REST_KMS_CURRENT_CIPHER_REQUEST_VERSION, 1); + init( REST_KMS_MAX_CIPHER_REQUEST_VERSION, 1); + + // Drop in-memory state associated with an idempotency id after this many seconds. Once dropped, this id cannot be + // expired proactively, but will eventually get cleaned up by the idempotency id cleaner. + init( IDEMPOTENCY_ID_IN_MEMORY_LIFETIME, 10); + // Attempt to clean old idempotency ids automatically this often + init( IDEMPOTENCY_IDS_CLEANER_POLLING_INTERVAL, 10); + // Don't clean idempotency ids younger than this + init( IDEMPOTENCY_IDS_MIN_AGE_SECONDS, 3600 * 24 * 7); + // clang-format on if (clientKnobs) { diff --git a/src/fdbclient/SimpleConfigTransaction.actor.cpp b/src/fdbclient/SimpleConfigTransaction.actor.cpp index 500d287..f3d2b47 100644 --- a/src/fdbclient/SimpleConfigTransaction.actor.cpp +++ b/src/fdbclient/SimpleConfigTransaction.actor.cpp @@ -24,7 +24,6 @@ #include "fdbclient/DatabaseContext.h" #include "fdbclient/IKnobCollection.h" #include "fdbclient/SimpleConfigTransaction.h" -#include "fdbserver/Knobs.h" #include "flow/Arena.h" #include "flow/actorcompiler.h" // This must be the last #include. @@ -44,11 +43,13 @@ class SimpleConfigTransactionImpl { state ConfigTransactionGetGenerationReply reply; if (self->cti.hostname.present()) { wait(store(reply, - retryGetReplyFromHostname(ConfigTransactionGetGenerationRequest{}, + retryGetReplyFromHostname(ConfigTransactionGetGenerationRequest{ 0, Optional() }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GETGENERATION))); } else { - wait(store(reply, retryBrokenPromise(self->cti.getGeneration, ConfigTransactionGetGenerationRequest{}))); + wait(store(reply, + retryBrokenPromise(self->cti.getGeneration, + ConfigTransactionGetGenerationRequest{ 0, Optional() }))); } if (self->dID.present()) { TraceEvent("SimpleConfigTransactionGotReadVersion", self->dID.get()) @@ -71,11 +72,12 @@ class SimpleConfigTransactionImpl { state ConfigTransactionGetReply reply; if (self->cti.hostname.present()) { wait(store(reply, - retryGetReplyFromHostname(ConfigTransactionGetRequest{ generation, configKey }, + retryGetReplyFromHostname(ConfigTransactionGetRequest{ 0, generation, configKey }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GET))); } else { - wait(store(reply, retryBrokenPromise(self->cti.get, ConfigTransactionGetRequest{ generation, configKey }))); + wait(store(reply, + retryBrokenPromise(self->cti.get, ConfigTransactionGetRequest{ 0, generation, configKey }))); } if (self->dID.present()) { TraceEvent("SimpleConfigTransactionGotValue", self->dID.get()) @@ -96,13 +98,13 @@ class SimpleConfigTransactionImpl { state ConfigTransactionGetConfigClassesReply reply; if (self->cti.hostname.present()) { wait(store(reply, - retryGetReplyFromHostname(ConfigTransactionGetConfigClassesRequest{ generation }, + retryGetReplyFromHostname(ConfigTransactionGetConfigClassesRequest{ 0, generation }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GETCLASSES))); } else { wait(store( reply, - retryBrokenPromise(self->cti.getClasses, ConfigTransactionGetConfigClassesRequest{ generation }))); + retryBrokenPromise(self->cti.getClasses, ConfigTransactionGetConfigClassesRequest{ 0, generation }))); } RangeResult result; for (const auto& configClass : reply.configClasses) { @@ -119,13 +121,13 @@ class SimpleConfigTransactionImpl { state ConfigTransactionGetKnobsReply reply; if (self->cti.hostname.present()) { wait(store(reply, - retryGetReplyFromHostname(ConfigTransactionGetKnobsRequest{ generation, configClass }, + retryGetReplyFromHostname(ConfigTransactionGetKnobsRequest{ 0, generation, configClass }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GETKNOBS))); } else { - wait(store( - reply, - retryBrokenPromise(self->cti.getKnobs, ConfigTransactionGetKnobsRequest{ generation, configClass }))); + wait(store(reply, + retryBrokenPromise(self->cti.getKnobs, + ConfigTransactionGetKnobsRequest{ 0, generation, configClass }))); } RangeResult result; for (const auto& knobName : reply.knobNames) { @@ -138,6 +140,7 @@ class SimpleConfigTransactionImpl { if (!self->getGenerationFuture.isValid()) { self->getGenerationFuture = getGeneration(self); } + self->toCommit.coordinatorsHash = 0; wait(store(self->toCommit.generation, self->getGenerationFuture)); self->toCommit.annotation.timestamp = now(); if (self->cti.hostname.present()) { @@ -293,6 +296,14 @@ Version SimpleConfigTransaction::getCommittedVersion() const { return impl->getCommittedVersion(); } +double SimpleConfigTransaction::getTagThrottledDuration() const { + return 0.0; +} + +int64_t SimpleConfigTransaction::getTotalCost() const { + return 0; +} + int64_t SimpleConfigTransaction::getApproximateSize() const { return impl->getApproximateSize(); } diff --git a/src/fdbclient/SimpleConfigTransaction.actor.g.cpp b/src/fdbclient/SimpleConfigTransaction.actor.g.cpp index cc5cba0..10cea6f 100644 --- a/src/fdbclient/SimpleConfigTransaction.actor.g.cpp +++ b/src/fdbclient/SimpleConfigTransaction.actor.g.cpp @@ -26,7 +26,6 @@ #include "fdbclient/DatabaseContext.h" #include "fdbclient/IKnobCollection.h" #include "fdbclient/SimpleConfigTransaction.h" -#include "fdbserver/Knobs.h" #include "flow/Arena.h" #include "flow/actorcompiler.h" // This must be the last #include. @@ -39,20 +38,20 @@ class SimpleConfigTransactionImpl { Optional dID; Database cx; - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" // This generated class is to be used only via getGeneration() - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" template - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" class GetGenerationActorState { - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" public: - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" GetGenerationActorState(SimpleConfigTransactionImpl* const& self) - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" : self(self) - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { fdb_probe_actor_create("getGeneration", reinterpret_cast(this)); @@ -65,44 +64,44 @@ class GetGenerationActorState { int a_body1(int loopDepth=0) { try { - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (self->dID.present()) - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" TraceEvent("SimpleConfigTransactionGettingReadVersion", self->dID.get()); - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" reply = ConfigTransactionGetGenerationReply(); - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (self->cti.hostname.present()) - #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - StrictFuture __when_expr_0 = store(reply, retryGetReplyFromHostname(ConfigTransactionGetGenerationRequest{}, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GETGENERATION)); - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + StrictFuture __when_expr_0 = store(reply, retryGetReplyFromHostname(ConfigTransactionGetGenerationRequest{ 0, Optional() }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GETGENERATION)); + #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } else { - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - StrictFuture __when_expr_1 = store(reply, retryBrokenPromise(self->cti.getGeneration, ConfigTransactionGetGenerationRequest{})); - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + StrictFuture __when_expr_1 = store(reply, retryBrokenPromise(self->cti.getGeneration, ConfigTransactionGetGenerationRequest{ 0, Optional() })); + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } } @@ -124,17 +123,17 @@ class GetGenerationActorState { } int a_body1cont1(int loopDepth) { - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (self->dID.present()) - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" TraceEvent("SimpleConfigTransactionGotReadVersion", self->dID.get()) .detail("Version", reply.generation.liveVersion); - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(reply.generation); this->~GetGenerationActorState(); static_cast(this)->destroy(); return 0; } - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< ConfigGeneration >::value()) ConfigGeneration(reply.generation); this->~GetGenerationActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -292,16 +291,16 @@ class GetGenerationActorState { fdb_probe_actor_exit("getGeneration", reinterpret_cast(this), 1); } - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" SimpleConfigTransactionImpl* self; - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" ConfigTransactionGetGenerationReply reply; - #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" }; // This generated class is to be used only via getGeneration() - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" class GetGenerationActor final : public Actor, public ActorCallback< GetGenerationActor, 0, Void >, public ActorCallback< GetGenerationActor, 1, Void >, public FastAllocated, public GetGenerationActorState { - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -311,9 +310,9 @@ class GetGenerationActor final : public Actor, public ActorCal #pragma clang diagnostic pop friend struct ActorCallback< GetGenerationActor, 0, Void >; friend struct ActorCallback< GetGenerationActor, 1, Void >; - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" GetGenerationActor(SimpleConfigTransactionImpl* const& self) - #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" : Actor(), GetGenerationActorState(self) { @@ -337,31 +336,31 @@ friend struct ActorCallback< GetGenerationActor, 1, Void >; } }; - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" [[nodiscard]] static Future getGeneration( SimpleConfigTransactionImpl* const& self ) { - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" return Future(new GetGenerationActor(self)); - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } -#line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" +#line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" // This generated class is to be used only via get() - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" template - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" class GetActorState { - #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" public: - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" GetActorState(SimpleConfigTransactionImpl* const& self,KeyRef const& key) - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" : self(self), - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" key(key) - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { fdb_probe_actor_create("get", reinterpret_cast(this)); @@ -374,26 +373,26 @@ class GetActorState { int a_body1(int loopDepth=0) { try { - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (!self->getGenerationFuture.isValid()) - #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" self->getGenerationFuture = getGeneration(self); - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - configKey = ConfigKey::decodeKey(key); #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + configKey = ConfigKey::decodeKey(key); + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" StrictFuture __when_expr_0 = self->getGenerationFuture; - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -414,44 +413,44 @@ class GetActorState { } int a_body1cont1(ConfigGeneration const& generation,int loopDepth) { - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (self->dID.present()) - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" TraceEvent("SimpleConfigTransactionGettingValue", self->dID.get()) .detail("ConfigClass", configKey.configClass) .detail("KnobName", configKey.knobName); - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } - #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - reply = ConfigTransactionGetReply(); #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + reply = ConfigTransactionGetReply(); + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (self->cti.hostname.present()) - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - StrictFuture __when_expr_1 = store(reply, retryGetReplyFromHostname(ConfigTransactionGetRequest{ generation, configKey }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GET)); - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + StrictFuture __when_expr_1 = store(reply, retryGetReplyFromHostname(ConfigTransactionGetRequest{ 0, generation, configKey }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GET)); + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } else { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - StrictFuture __when_expr_2 = store(reply, retryBrokenPromise(self->cti.get, ConfigTransactionGetRequest{ generation, configKey })); - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + StrictFuture __when_expr_2 = store(reply, retryBrokenPromise(self->cti.get, ConfigTransactionGetRequest{ 0, generation, configKey })); + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } @@ -459,44 +458,44 @@ class GetActorState { } int a_body1cont1(ConfigGeneration && generation,int loopDepth) { - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (self->dID.present()) - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" TraceEvent("SimpleConfigTransactionGettingValue", self->dID.get()) .detail("ConfigClass", configKey.configClass) .detail("KnobName", configKey.knobName); - #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } - #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - reply = ConfigTransactionGetReply(); #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + reply = ConfigTransactionGetReply(); + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (self->cti.hostname.present()) - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - StrictFuture __when_expr_1 = store(reply, retryGetReplyFromHostname(ConfigTransactionGetRequest{ generation, configKey }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GET)); - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + StrictFuture __when_expr_1 = store(reply, retryGetReplyFromHostname(ConfigTransactionGetRequest{ 0, generation, configKey }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GET)); + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } else { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - StrictFuture __when_expr_2 = store(reply, retryBrokenPromise(self->cti.get, ConfigTransactionGetRequest{ generation, configKey })); - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + StrictFuture __when_expr_2 = store(reply, retryBrokenPromise(self->cti.get, ConfigTransactionGetRequest{ 0, generation, configKey })); + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } @@ -567,21 +566,21 @@ class GetActorState { } int a_body1cont3(int loopDepth) { - #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (self->dID.present()) - #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" TraceEvent("SimpleConfigTransactionGotValue", self->dID.get()) .detail("Value", reply.value.get().toString()); - #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } - #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (reply.value.present()) - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(reply.value.get().toValue()); this->~GetActorState(); static_cast(this)->destroy(); return 0; } - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(reply.value.get().toValue()); this->~GetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -589,9 +588,9 @@ class GetActorState { } else { - #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional{}); this->~GetActorState(); static_cast(this)->destroy(); return 0; } - #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional{}); this->~GetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -750,20 +749,20 @@ class GetActorState { fdb_probe_actor_exit("get", reinterpret_cast(this), 2); } - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" SimpleConfigTransactionImpl* self; - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" KeyRef key; - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" ConfigKey configKey; - #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" ConfigTransactionGetReply reply; - #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" }; // This generated class is to be used only via get() - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" class GetActor final : public Actor>, public ActorCallback< GetActor, 0, ConfigGeneration >, public ActorCallback< GetActor, 1, Void >, public ActorCallback< GetActor, 2, Void >, public FastAllocated, public GetActorState { - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -774,9 +773,9 @@ class GetActor final : public Actor>, public ActorCallback< GetA friend struct ActorCallback< GetActor, 0, ConfigGeneration >; friend struct ActorCallback< GetActor, 1, Void >; friend struct ActorCallback< GetActor, 2, Void >; - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" GetActor(SimpleConfigTransactionImpl* const& self,KeyRef const& key) - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" : Actor>(), GetActorState(self, key) { @@ -801,29 +800,29 @@ friend struct ActorCallback< GetActor, 2, Void >; } }; - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" [[nodiscard]] static Future> get( SimpleConfigTransactionImpl* const& self, KeyRef const& key ) { - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" return Future>(new GetActor(self, key)); - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } -#line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" +#line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" // This generated class is to be used only via getConfigClasses() - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" template - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" class GetConfigClassesActorState { - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" public: - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" GetConfigClassesActorState(SimpleConfigTransactionImpl* const& self) - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" : self(self) - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { fdb_probe_actor_create("getConfigClasses", reinterpret_cast(this)); @@ -836,24 +835,24 @@ class GetConfigClassesActorState { int a_body1(int loopDepth=0) { try { - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (!self->getGenerationFuture.isValid()) - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" self->getGenerationFuture = getGeneration(self); - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" StrictFuture __when_expr_0 = self->getGenerationFuture; - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -874,36 +873,36 @@ class GetConfigClassesActorState { } int a_body1cont1(ConfigGeneration const& generation,int loopDepth) { - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" reply = ConfigTransactionGetConfigClassesReply(); - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (self->cti.hostname.present()) - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - StrictFuture __when_expr_1 = store(reply, retryGetReplyFromHostname(ConfigTransactionGetConfigClassesRequest{ generation }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GETCLASSES)); - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + StrictFuture __when_expr_1 = store(reply, retryGetReplyFromHostname(ConfigTransactionGetConfigClassesRequest{ 0, generation }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GETCLASSES)); + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } else { - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - StrictFuture __when_expr_2 = store( reply, retryBrokenPromise(self->cti.getClasses, ConfigTransactionGetConfigClassesRequest{ generation })); - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + StrictFuture __when_expr_2 = store( reply, retryBrokenPromise(self->cti.getClasses, ConfigTransactionGetConfigClassesRequest{ 0, generation })); + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } @@ -911,36 +910,36 @@ class GetConfigClassesActorState { } int a_body1cont1(ConfigGeneration && generation,int loopDepth) { - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" reply = ConfigTransactionGetConfigClassesReply(); - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (self->cti.hostname.present()) - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - StrictFuture __when_expr_1 = store(reply, retryGetReplyFromHostname(ConfigTransactionGetConfigClassesRequest{ generation }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GETCLASSES)); - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + StrictFuture __when_expr_1 = store(reply, retryGetReplyFromHostname(ConfigTransactionGetConfigClassesRequest{ 0, generation }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GETCLASSES)); + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } else { - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - StrictFuture __when_expr_2 = store( reply, retryBrokenPromise(self->cti.getClasses, ConfigTransactionGetConfigClassesRequest{ generation })); - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + StrictFuture __when_expr_2 = store( reply, retryBrokenPromise(self->cti.getClasses, ConfigTransactionGetConfigClassesRequest{ 0, generation })); + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } @@ -1011,17 +1010,17 @@ class GetConfigClassesActorState { } int a_body1cont3(int loopDepth) { - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" RangeResult result; - #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" for( const auto& configClass : reply.configClasses ) { - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(configClass, ""_sr)); - #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetConfigClassesActorState(); static_cast(this)->destroy(); return 0; } - #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetConfigClassesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1179,16 +1178,16 @@ class GetConfigClassesActorState { fdb_probe_actor_exit("getConfigClasses", reinterpret_cast(this), 2); } - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" SimpleConfigTransactionImpl* self; - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" ConfigTransactionGetConfigClassesReply reply; - #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" }; // This generated class is to be used only via getConfigClasses() - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" class GetConfigClassesActor final : public Actor, public ActorCallback< GetConfigClassesActor, 0, ConfigGeneration >, public ActorCallback< GetConfigClassesActor, 1, Void >, public ActorCallback< GetConfigClassesActor, 2, Void >, public FastAllocated, public GetConfigClassesActorState { - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1199,9 +1198,9 @@ class GetConfigClassesActor final : public Actor, public ActorCallb friend struct ActorCallback< GetConfigClassesActor, 0, ConfigGeneration >; friend struct ActorCallback< GetConfigClassesActor, 1, Void >; friend struct ActorCallback< GetConfigClassesActor, 2, Void >; - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" GetConfigClassesActor(SimpleConfigTransactionImpl* const& self) - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" : Actor(), GetConfigClassesActorState(self) { @@ -1226,31 +1225,31 @@ friend struct ActorCallback< GetConfigClassesActor, 2, Void >; } }; - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" [[nodiscard]] static Future getConfigClasses( SimpleConfigTransactionImpl* const& self ) { - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" return Future(new GetConfigClassesActor(self)); - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } -#line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" +#line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" // This generated class is to be used only via getKnobs() - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" template - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" class GetKnobsActorState { - #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" public: - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" GetKnobsActorState(SimpleConfigTransactionImpl* const& self,Optional const& configClass) - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" : self(self), - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" configClass(configClass) - #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { fdb_probe_actor_create("getKnobs", reinterpret_cast(this)); @@ -1263,24 +1262,24 @@ class GetKnobsActorState { int a_body1(int loopDepth=0) { try { - #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (!self->getGenerationFuture.isValid()) - #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" self->getGenerationFuture = getGeneration(self); - #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } - #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" StrictFuture __when_expr_0 = self->getGenerationFuture; - #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1301,36 +1300,36 @@ class GetKnobsActorState { } int a_body1cont1(ConfigGeneration const& generation,int loopDepth) { - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" reply = ConfigTransactionGetKnobsReply(); - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (self->cti.hostname.present()) - #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - StrictFuture __when_expr_1 = store(reply, retryGetReplyFromHostname(ConfigTransactionGetKnobsRequest{ generation, configClass }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GETKNOBS)); - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + StrictFuture __when_expr_1 = store(reply, retryGetReplyFromHostname(ConfigTransactionGetKnobsRequest{ 0, generation, configClass }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GETKNOBS)); + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } else { - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - StrictFuture __when_expr_2 = store( reply, retryBrokenPromise(self->cti.getKnobs, ConfigTransactionGetKnobsRequest{ generation, configClass })); - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + StrictFuture __when_expr_2 = store(reply, retryBrokenPromise(self->cti.getKnobs, ConfigTransactionGetKnobsRequest{ 0, generation, configClass })); + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } @@ -1338,36 +1337,36 @@ class GetKnobsActorState { } int a_body1cont1(ConfigGeneration && generation,int loopDepth) { - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" reply = ConfigTransactionGetKnobsReply(); - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (self->cti.hostname.present()) - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - StrictFuture __when_expr_1 = store(reply, retryGetReplyFromHostname(ConfigTransactionGetKnobsRequest{ generation, configClass }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GETKNOBS)); - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + StrictFuture __when_expr_1 = store(reply, retryGetReplyFromHostname(ConfigTransactionGetKnobsRequest{ 0, generation, configClass }, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_GETKNOBS)); + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } else { - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - StrictFuture __when_expr_2 = store( reply, retryBrokenPromise(self->cti.getKnobs, ConfigTransactionGetKnobsRequest{ generation, configClass })); - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + StrictFuture __when_expr_2 = store(reply, retryBrokenPromise(self->cti.getKnobs, ConfigTransactionGetKnobsRequest{ 0, generation, configClass })); + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } @@ -1438,17 +1437,17 @@ class GetKnobsActorState { } int a_body1cont3(int loopDepth) { - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" RangeResult result; - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" for( const auto& knobName : reply.knobNames ) { - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(knobName, ""_sr)); - #line 1447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetKnobsActorState(); static_cast(this)->destroy(); return 0; } - #line 1451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetKnobsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1606,18 +1605,18 @@ class GetKnobsActorState { fdb_probe_actor_exit("getKnobs", reinterpret_cast(this), 2); } - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" SimpleConfigTransactionImpl* self; - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" Optional configClass; - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" ConfigTransactionGetKnobsReply reply; - #line 1615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" }; // This generated class is to be used only via getKnobs() - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" class GetKnobsActor final : public Actor, public ActorCallback< GetKnobsActor, 0, ConfigGeneration >, public ActorCallback< GetKnobsActor, 1, Void >, public ActorCallback< GetKnobsActor, 2, Void >, public FastAllocated, public GetKnobsActorState { - #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1628,9 +1627,9 @@ class GetKnobsActor final : public Actor, public ActorCallback< Get friend struct ActorCallback< GetKnobsActor, 0, ConfigGeneration >; friend struct ActorCallback< GetKnobsActor, 1, Void >; friend struct ActorCallback< GetKnobsActor, 2, Void >; - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" GetKnobsActor(SimpleConfigTransactionImpl* const& self,Optional const& configClass) - #line 1633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" : Actor(), GetKnobsActorState(self, configClass) { @@ -1655,29 +1654,29 @@ friend struct ActorCallback< GetKnobsActor, 2, Void >; } }; - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" [[nodiscard]] static Future getKnobs( SimpleConfigTransactionImpl* const& self, Optional const& configClass ) { - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" return Future(new GetKnobsActor(self, configClass)); - #line 1662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } -#line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" +#line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - #line 1667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" // This generated class is to be used only via commit() - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" template - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" class CommitActorState { - #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" public: - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" CommitActorState(SimpleConfigTransactionImpl* const& self) - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" : self(self) - #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { fdb_probe_actor_create("commit", reinterpret_cast(this)); @@ -1690,24 +1689,26 @@ class CommitActorState { int a_body1(int loopDepth=0) { try { - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (!self->getGenerationFuture.isValid()) - #line 1695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" self->getGenerationFuture = getGeneration(self); - #line 1699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + self->toCommit.coordinatorsHash = 0; + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" StrictFuture __when_expr_0 = store(self->toCommit.generation, self->getGenerationFuture); - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1728,36 +1729,36 @@ class CommitActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" self->toCommit.annotation.timestamp = now(); - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (self->cti.hostname.present()) - #line 1735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" StrictFuture __when_expr_1 = retryGetReplyFromHostname(self->toCommit, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_COMMIT); - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } else { - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" StrictFuture __when_expr_2 = retryBrokenPromise(self->cti.commit, self->toCommit); - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } @@ -1765,36 +1766,36 @@ class CommitActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" self->toCommit.annotation.timestamp = now(); - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (self->cti.hostname.present()) - #line 1772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" StrictFuture __when_expr_1 = retryGetReplyFromHostname(self->toCommit, self->cti.hostname.get(), WLTOKEN_CONFIGTXN_COMMIT); - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } else { - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" StrictFuture __when_expr_2 = retryBrokenPromise(self->cti.commit, self->toCommit); - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } @@ -1865,11 +1866,11 @@ class CommitActorState { } int a_body1cont3(int loopDepth) { - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" self->committed = true; - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitActorState(); static_cast(this)->destroy(); return 0; } - #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CommitActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2027,14 +2028,14 @@ class CommitActorState { fdb_probe_actor_exit("commit", reinterpret_cast(this), 2); } - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" SimpleConfigTransactionImpl* self; - #line 2032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" }; // This generated class is to be used only via commit() - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" class CommitActor final : public Actor, public ActorCallback< CommitActor, 0, Void >, public ActorCallback< CommitActor, 1, Void >, public ActorCallback< CommitActor, 2, Void >, public FastAllocated, public CommitActorState { - #line 2037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2045,9 +2046,9 @@ class CommitActor final : public Actor, public ActorCallback< CommitActor, friend struct ActorCallback< CommitActor, 0, Void >; friend struct ActorCallback< CommitActor, 1, Void >; friend struct ActorCallback< CommitActor, 2, Void >; - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" CommitActor(SimpleConfigTransactionImpl* const& self) - #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" : Actor(), CommitActorState(self) { @@ -2072,31 +2073,31 @@ friend struct ActorCallback< CommitActor, 2, Void >; } }; - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" [[nodiscard]] static Future commit( SimpleConfigTransactionImpl* const& self ) { - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" return Future(new CommitActor(self)); - #line 2079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } -#line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" +#line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - #line 2084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" // This generated class is to be used only via onError() - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" template - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" class OnErrorActorState { - #line 2090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" public: - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" OnErrorActorState(SimpleConfigTransactionImpl* const& self,Error const& e) - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" : self(self), - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" e(e) - #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { fdb_probe_actor_create("onError", reinterpret_cast(this)); @@ -2109,20 +2110,20 @@ class OnErrorActorState { int a_body1(int loopDepth=0) { try { - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (e.code() == error_code_transaction_too_old || e.code() == error_code_not_committed) - #line 2114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" { - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" StrictFuture __when_expr_0 = delay((1 << self->numRetries++) * 0.01 * deterministicRandom()->random01()); - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" loopDepth = 0; } else @@ -2148,19 +2149,19 @@ class OnErrorActorState { } int a_body1cont1(int loopDepth) { - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 2153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" return loopDepth; } int a_body1cont2(Void const& _,int loopDepth) { - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" self->reset(); - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OnErrorActorState(); static_cast(this)->destroy(); return 0; } - #line 2163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~OnErrorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2170,11 +2171,11 @@ class OnErrorActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" self->reset(); - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OnErrorActorState(); static_cast(this)->destroy(); return 0; } - #line 2177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~OnErrorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2245,16 +2246,16 @@ class OnErrorActorState { fdb_probe_actor_exit("onError", reinterpret_cast(this), 0); } - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" SimpleConfigTransactionImpl* self; - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" Error e; - #line 2252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" }; // This generated class is to be used only via onError() - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" class OnErrorActor final : public Actor, public ActorCallback< OnErrorActor, 0, Void >, public FastAllocated, public OnErrorActorState { - #line 2257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2263,9 +2264,9 @@ class OnErrorActor final : public Actor, public ActorCallback< OnErrorActo void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< OnErrorActor, 0, Void >; - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" OnErrorActor(SimpleConfigTransactionImpl* const& self,Error const& e) - #line 2268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" : Actor(), OnErrorActorState(self, e) { @@ -2288,14 +2289,14 @@ friend struct ActorCallback< OnErrorActor, 0, Void >; } }; - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" [[nodiscard]] static Future onError( SimpleConfigTransactionImpl* const& self, Error const& e ) { - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" return Future(new OnErrorActor(self, e)); - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" + #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.g.cpp" } -#line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" +#line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SimpleConfigTransaction.actor.cpp" public: SimpleConfigTransactionImpl(Database const& cx) : cx(cx) { @@ -2431,6 +2432,14 @@ Version SimpleConfigTransaction::getCommittedVersion() const { return impl->getCommittedVersion(); } +double SimpleConfigTransaction::getTagThrottledDuration() const { + return 0.0; +} + +int64_t SimpleConfigTransaction::getTotalCost() const { + return 0; +} + int64_t SimpleConfigTransaction::getApproximateSize() const { return impl->getApproximateSize(); } diff --git a/src/fdbclient/SpecialKeySpace.actor.cpp b/src/fdbclient/SpecialKeySpace.actor.cpp index 1f0970b..5d1bb88 100644 --- a/src/fdbclient/SpecialKeySpace.actor.cpp +++ b/src/fdbclient/SpecialKeySpace.actor.cpp @@ -57,84 +57,63 @@ static bool isAlphaNumeric(const std::string& key) { } } // namespace -const KeyRangeRef TenantMapRangeImpl::submoduleRange = KeyRangeRef("tenant_map/"_sr, "tenant_map0"_sr); - std::unordered_map SpecialKeySpace::moduleToBoundary = { - { SpecialKeySpace::MODULE::TRANSACTION, - KeyRangeRef(LiteralStringRef("\xff\xff/transaction/"), LiteralStringRef("\xff\xff/transaction0")) }, + { SpecialKeySpace::MODULE::TRANSACTION, KeyRangeRef("\xff\xff/transaction/"_sr, "\xff\xff/transaction0"_sr) }, { SpecialKeySpace::MODULE::WORKERINTERFACE, - KeyRangeRef(LiteralStringRef("\xff\xff/worker_interfaces/"), LiteralStringRef("\xff\xff/worker_interfaces0")) }, - { SpecialKeySpace::MODULE::STATUSJSON, singleKeyRange(LiteralStringRef("\xff\xff/status/json")) }, - { SpecialKeySpace::MODULE::CONNECTIONSTRING, singleKeyRange(LiteralStringRef("\xff\xff/connection_string")) }, - { SpecialKeySpace::MODULE::CLUSTERFILEPATH, singleKeyRange(LiteralStringRef("\xff\xff/cluster_file_path")) }, - { SpecialKeySpace::MODULE::METRICS, - KeyRangeRef(LiteralStringRef("\xff\xff/metrics/"), LiteralStringRef("\xff\xff/metrics0")) }, - { SpecialKeySpace::MODULE::MANAGEMENT, - KeyRangeRef(LiteralStringRef("\xff\xff/management/"), LiteralStringRef("\xff\xff/management0")) }, - { SpecialKeySpace::MODULE::ERRORMSG, singleKeyRange(LiteralStringRef("\xff\xff/error_message")) }, - { SpecialKeySpace::MODULE::CONFIGURATION, - KeyRangeRef(LiteralStringRef("\xff\xff/configuration/"), LiteralStringRef("\xff\xff/configuration0")) }, - { SpecialKeySpace::MODULE::GLOBALCONFIG, - KeyRangeRef(LiteralStringRef("\xff\xff/global_config/"), LiteralStringRef("\xff\xff/global_config0")) }, - { SpecialKeySpace::MODULE::TRACING, - KeyRangeRef(LiteralStringRef("\xff\xff/tracing/"), LiteralStringRef("\xff\xff/tracing0")) }, - { SpecialKeySpace::MODULE::ACTORLINEAGE, - KeyRangeRef(LiteralStringRef("\xff\xff/actor_lineage/"), LiteralStringRef("\xff\xff/actor_lineage0")) }, + KeyRangeRef("\xff\xff/worker_interfaces/"_sr, "\xff\xff/worker_interfaces0"_sr) }, + { SpecialKeySpace::MODULE::STATUSJSON, singleKeyRange("\xff\xff/status/json"_sr) }, + { SpecialKeySpace::MODULE::CONNECTIONSTRING, singleKeyRange("\xff\xff/connection_string"_sr) }, + { SpecialKeySpace::MODULE::CLUSTERFILEPATH, singleKeyRange("\xff\xff/cluster_file_path"_sr) }, + { SpecialKeySpace::MODULE::METRICS, KeyRangeRef("\xff\xff/metrics/"_sr, "\xff\xff/metrics0"_sr) }, + { SpecialKeySpace::MODULE::MANAGEMENT, KeyRangeRef("\xff\xff/management/"_sr, "\xff\xff/management0"_sr) }, + { SpecialKeySpace::MODULE::ERRORMSG, singleKeyRange("\xff\xff/error_message"_sr) }, + { SpecialKeySpace::MODULE::CONFIGURATION, KeyRangeRef("\xff\xff/configuration/"_sr, "\xff\xff/configuration0"_sr) }, + { SpecialKeySpace::MODULE::GLOBALCONFIG, KeyRangeRef("\xff\xff/global_config/"_sr, "\xff\xff/global_config0"_sr) }, + { SpecialKeySpace::MODULE::TRACING, KeyRangeRef("\xff\xff/tracing/"_sr, "\xff\xff/tracing0"_sr) }, + { SpecialKeySpace::MODULE::ACTORLINEAGE, KeyRangeRef("\xff\xff/actor_lineage/"_sr, "\xff\xff/actor_lineage0"_sr) }, { SpecialKeySpace::MODULE::ACTOR_PROFILER_CONF, - KeyRangeRef(LiteralStringRef("\xff\xff/actor_profiler_conf/"), - LiteralStringRef("\xff\xff/actor_profiler_conf0")) } + KeyRangeRef("\xff\xff/actor_profiler_conf/"_sr, "\xff\xff/actor_profiler_conf0"_sr) }, + { SpecialKeySpace::MODULE::CLUSTERID, singleKeyRange("\xff\xff/cluster_id"_sr) }, }; std::unordered_map SpecialKeySpace::managementApiCommandToRange = { - { "exclude", - KeyRangeRef(LiteralStringRef("excluded/"), LiteralStringRef("excluded0")) - .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, - { "failed", - KeyRangeRef(LiteralStringRef("failed/"), LiteralStringRef("failed0")) - .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + { "exclude", KeyRangeRef("excluded/"_sr, "excluded0"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + { "failed", KeyRangeRef("failed/"_sr, "failed0"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, { "excludedlocality", - KeyRangeRef(LiteralStringRef("excluded_locality/"), LiteralStringRef("excluded_locality0")) + KeyRangeRef("excluded_locality/"_sr, "excluded_locality0"_sr) .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, { "failedlocality", - KeyRangeRef(LiteralStringRef("failed_locality/"), LiteralStringRef("failed_locality0")) + KeyRangeRef("failed_locality/"_sr, "failed_locality0"_sr) .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, - { "lock", singleKeyRange(LiteralStringRef("db_locked")).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + { "lock", singleKeyRange("db_locked"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, { "consistencycheck", - singleKeyRange(LiteralStringRef("consistency_check_suspended")) - .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + singleKeyRange("consistency_check_suspended"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, { "coordinators", - KeyRangeRef(LiteralStringRef("coordinators/"), LiteralStringRef("coordinators0")) - .withPrefix(moduleToBoundary[MODULE::CONFIGURATION].begin) }, + KeyRangeRef("coordinators/"_sr, "coordinators0"_sr).withPrefix(moduleToBoundary[MODULE::CONFIGURATION].begin) }, { "advanceversion", - singleKeyRange(LiteralStringRef("min_required_commit_version")) - .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, - { "versionepoch", - singleKeyRange(LiteralStringRef("version_epoch")).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, - { "profile", - KeyRangeRef(LiteralStringRef("profiling/"), LiteralStringRef("profiling0")) - .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + singleKeyRange("min_required_commit_version"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + { "versionepoch", singleKeyRange("version_epoch"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + { "profile", KeyRangeRef("profiling/"_sr, "profiling0"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, { "maintenance", - KeyRangeRef(LiteralStringRef("maintenance/"), LiteralStringRef("maintenance0")) - .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + KeyRangeRef("maintenance/"_sr, "maintenance0"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, { "datadistribution", - KeyRangeRef(LiteralStringRef("data_distribution/"), LiteralStringRef("data_distribution0")) + KeyRangeRef("data_distribution/"_sr, "data_distribution0"_sr) .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, - { "tenantmap", TenantMapRangeImpl::submoduleRange.withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) } + { "tenant", KeyRangeRef("tenant/"_sr, "tenant0"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + { "tenantmap", + KeyRangeRef("tenant_map/"_sr, "tenant_map0"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) } }; std::unordered_map SpecialKeySpace::actorLineageApiCommandToRange = { - { "state", - KeyRangeRef(LiteralStringRef("state/"), LiteralStringRef("state0")) - .withPrefix(moduleToBoundary[MODULE::ACTORLINEAGE].begin) }, - { "time", - KeyRangeRef(LiteralStringRef("time/"), LiteralStringRef("time0")) - .withPrefix(moduleToBoundary[MODULE::ACTORLINEAGE].begin) } + { "state", KeyRangeRef("state/"_sr, "state0"_sr).withPrefix(moduleToBoundary[MODULE::ACTORLINEAGE].begin) }, + { "time", KeyRangeRef("time/"_sr, "time0"_sr).withPrefix(moduleToBoundary[MODULE::ACTORLINEAGE].begin) } }; std::set SpecialKeySpace::options = { "excluded/force", "failed/force", "excluded_locality/force", - "failed_locality/force" }; + "failed_locality/force", + "worker_interfaces/verify" }; std::set SpecialKeySpace::tracingOptions = { kTracingTransactionIdKey, kTracingTokenKey }; @@ -156,6 +135,11 @@ ACTOR Future moveKeySelectorOverRangeActor(const SpecialKeyRangeReadImpl* // never being called if KeySelector is already normalized ASSERT(ks->offset != 1); + // Throw error if module doesn't support tenants and we have a tenant + if (ryw->getTenant().present() && !skrImpl->supportsTenants()) { + throw illegal_tenant_access(); + } + state Key startKey(skrImpl->getKeyRange().begin); state Key endKey(skrImpl->getKeyRange().end); state RangeResult result; @@ -368,16 +352,31 @@ ACTOR Future SpecialKeySpace::getRangeAggregationActor(SpecialKeySp // Handle all corner cases like what RYW does // return if range inverted if (actualBeginOffset >= actualEndOffset && begin.getKey() >= end.getKey()) { - TEST(true); // inverted range + CODE_PROBE(true, "inverted range"); return RangeResultRef(false, false); } // If touches begin or end, return with readToBegin and readThroughEnd flags if (begin.getKey() == moduleBoundary.end || end.getKey() == moduleBoundary.begin) { - TEST(true); // query touches begin or end + CODE_PROBE(true, "query touches begin or end"); return result; } state RangeMap::Ranges ranges = sks->getReadImpls().intersectingRanges(KeyRangeRef(begin.getKey(), end.getKey())); + + // Check tenant legality separately from below iterations + // because it may be partially completed and returned + // before illegal range is checked due to the limits handler + if (ryw->getTenant().present()) { + for (auto iter : ranges) { + if (iter->value() == nullptr) { + continue; + } + if (!iter->value()->supportsTenants()) { + throw illegal_tenant_access(); + } + } + } + // TODO : workaround to write this two together to make the code compact // The issue here is boost::iterator_range<> doest not provide rbegin(), rend() iter = reverse ? ranges.end() : ranges.begin(); @@ -457,7 +456,7 @@ Future SpecialKeySpace::getRange(ReadYourWritesTransaction* ryw, if (!limits.isValid()) return range_limits_invalid(); if (limits.isReached()) { - TEST(true); // read limit 0 + CODE_PROBE(true, "Special Key Space range read limit 0"); return RangeResult(); } // make sure orEqual == false @@ -465,7 +464,7 @@ Future SpecialKeySpace::getRange(ReadYourWritesTransaction* ryw, end.removeOrEqual(end.arena()); if (begin.offset >= end.offset && begin.getKey() >= end.getKey()) { - TEST(true); // range inverted + CODE_PROBE(true, "range inverted"); return RangeResult(); } @@ -503,6 +502,9 @@ void SpecialKeySpace::set(ReadYourWritesTransaction* ryw, const KeyRef& key, con .detail("Value", value.toString()); throw special_keys_no_write_module_found(); } + if (!impl->supportsTenants() && ryw->getTenant().present()) { + throw illegal_tenant_access(); + } return impl->set(ryw, key, value); } @@ -520,6 +522,9 @@ void SpecialKeySpace::clear(ReadYourWritesTransaction* ryw, const KeyRangeRef& r TraceEvent(SevDebug, "SpecialKeySpaceNoWriteModuleFound").detail("Range", range); throw special_keys_no_write_module_found(); } + if (!begin->supportsTenants() && ryw->getTenant().present()) { + throw illegal_tenant_access(); + } return begin->clear(ryw, range); } @@ -529,6 +534,9 @@ void SpecialKeySpace::clear(ReadYourWritesTransaction* ryw, const KeyRef& key) { auto impl = writeImpls[key]; if (impl == nullptr) throw special_keys_no_write_module_found(); + if (!impl->supportsTenants() && ryw->getTenant().present()) { + throw illegal_tenant_access(); + } return impl->clear(ryw, key); } @@ -540,8 +548,8 @@ bool validateSnakeCaseNaming(const KeyRef& k) { // Suffix can be \xff\xff or \x00 in single key range if (key.endsWith(specialKeys.begin)) key = key.removeSuffix(specialKeys.end); - else if (key.endsWith(LiteralStringRef("\x00"))) - key = key.removeSuffix(LiteralStringRef("\x00")); + else if (key.endsWith("\x00"_sr)) + key = key.removeSuffix("\x00"_sr); for (const char& c : key.toString()) { // only small letters, numbers, '/', '_' is allowed ASSERT((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '/' || c == '_'); @@ -553,6 +561,8 @@ void SpecialKeySpace::registerKeyRange(SpecialKeySpace::MODULE module, SpecialKeySpace::IMPLTYPE type, const KeyRangeRef& kr, SpecialKeyRangeReadImpl* impl) { + // Not allowed to register an empty range + ASSERT(!kr.empty()); // module boundary check if (module == SpecialKeySpace::MODULE::TESTONLY) { ASSERT(normalKeys.contains(kr)); @@ -614,6 +624,16 @@ ACTOR Future commitActor(SpecialKeySpace* sks, ReadYourWritesTransaction* ++iter; } state std::vector::const_iterator it; + // Check validity of tenant support before iterating through + // module ptrs and potentially getting partial commits + if (ryw->getTenant().present()) { + for (it = writeModulePtrs.begin(); it != writeModulePtrs.end(); ++it) { + if (!(*it)->supportsTenants()) { + throw illegal_tenant_access(); + } + } + } + for (it = writeModulePtrs.begin(); it != writeModulePtrs.end(); ++it) { Optional msg = wait((*it)->commit(ryw)); if (msg.present()) { @@ -712,8 +732,8 @@ ACTOR Future ddMetricsGetRangeActor(ReadYourWritesTransaction* ryw, loop { try { auto keys = kr.removePrefix(ddStatsRange.begin); - Standalone> resultWithoutPrefix = wait( - waitDataDistributionMetricsList(ryw->getDatabase(), keys, CLIENT_KNOBS->STORAGE_METRICS_SHARD_LIMIT)); + Standalone> resultWithoutPrefix = + wait(waitDataDistributionMetricsList(ryw->getDatabase(), keys, CLIENT_KNOBS->TOO_MANY)); RangeResult result; for (const auto& ddMetricsRef : resultWithoutPrefix) { // each begin key is the previous end key, thus we only encode the begin key in the result @@ -749,7 +769,7 @@ Future DDStatsRangeImpl::getRange(ReadYourWritesTransaction* ryw, } Key SpecialKeySpace::getManagementApiCommandOptionSpecialKey(const std::string& command, const std::string& option) { - Key prefix = LiteralStringRef("options/").withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin); + Key prefix = "options/"_sr.withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin); auto pair = command + "/" + option; ASSERT(options.find(pair) != options.end()); return prefix.withSuffix(pair); @@ -880,11 +900,11 @@ void ExcludeServersRangeImpl::set(ReadYourWritesTransaction* ryw, const KeyRef& Key ExcludeServersRangeImpl::decode(const KeyRef& key) const { return key.removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin) - .withPrefix(LiteralStringRef("\xff/conf/")); + .withPrefix("\xff/conf/"_sr); } Key ExcludeServersRangeImpl::encode(const KeyRef& key) const { - return key.removePrefix(LiteralStringRef("\xff/conf/")) + return key.removePrefix("\xff/conf/"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin); } @@ -953,9 +973,9 @@ ACTOR Future checkExclusion(Database db, } StatusObject status = wait(StatusClient::statusFetcher(db)); state std::string errorString = - "ERROR: Could not calculate the impact of this exclude on the total free space in the cluster.\n" + "ERROR: Could not calculate the impact of this exclude on the total available space in the cluster.\n" "Please try the exclude again in 30 seconds.\n" - "Call set(\"0xff0xff/management/options/exclude/force\", ...) first to exclude without checking free " + "Call set(\"0xff0xff/management/options/exclude/force\", ...) first to exclude without checking available " "space.\n"; StatusObjectReader statusObj(status); @@ -977,8 +997,10 @@ ACTOR Future checkExclusion(Database db, state std::unordered_set diskLocalities; state int64_t totalKvStoreFreeBytes = 0; + state int64_t totalKvStoreFreeBytesNotExcluded = 0; state int64_t totalKvStoreUsedBytes = 0; - state int64_t totalKvStoreUsedBytesNonExcluded = 0; + state int64_t totalKvStoreUsedBytesNotExcluded = 0; + state int64_t totalKvStoreAvailableBytes = 0; // Keep track if we exclude any storage process with the provided adddresses state bool excludedAddressesContainsStorageRole = false; @@ -1004,6 +1026,9 @@ ACTOR Future checkExclusion(Database db, for (StatusObjectReader role : rolesArray) { if (role["role"].get_str() == "storage") { ssTotalCount++; + if (excluded) { + ssExcludedCount++; + } // Check if we are excluding a process that serves the storage role. We only have to check the free // capacity if we are excluding at least one process that serves the storage role. @@ -1025,23 +1050,28 @@ ACTOR Future checkExclusion(Database db, return false; } + int64_t available_bytes; + if (!role.get("kvstore_available_bytes", available_bytes)) { + *msg = ManagementAPIError::toJsonString( + false, markFailed ? "exclude failed" : "exclude", errorString); + return false; + } + totalKvStoreUsedBytes += used_bytes; + totalKvStoreFreeBytes += free_bytes; + totalKvStoreAvailableBytes += available_bytes; if (!excluded) { - totalKvStoreUsedBytesNonExcluded += used_bytes; + totalKvStoreUsedBytesNotExcluded += used_bytes; if (disk_id.empty() || diskLocalities.find(disk_id) == diskLocalities.end()) { - totalKvStoreFreeBytes += free_bytes; + totalKvStoreFreeBytesNotExcluded += free_bytes; if (!disk_id.empty()) { diskLocalities.insert(disk_id); } } } } - - if (excluded) { - ssExcludedCount++; - } } } } catch (...) // std::exception @@ -1056,11 +1086,27 @@ ACTOR Future checkExclusion(Database db, return true; } - double finalFreeRatio = 1 - (totalKvStoreUsedBytes / (totalKvStoreUsedBytesNonExcluded + totalKvStoreFreeBytes)); - if (ssExcludedCount == ssTotalCount || finalFreeRatio <= 0.1) { - std::string temp = "ERROR: This exclude may cause the total free space in the cluster to drop below 10%.\n" + // The numerator is the total space in use by FDB that is not immediately reusable. + // This is calculated as: used + free - available = used + free - (free - reusable) = used - reusable. + // The denominator is the total capacity usable by FDB (either used or unused currently) on non-excluded servers. + double finalUnavailableRatio = + (double)(totalKvStoreUsedBytes + totalKvStoreFreeBytes - totalKvStoreAvailableBytes) / + std::max((double)(totalKvStoreUsedBytesNotExcluded + totalKvStoreFreeBytesNotExcluded), (double)1); + + TraceEvent(SevInfo, "CheckExclusionDetails") + .detail("SsTotalCount", ssTotalCount) + .detail("SsExcludedCount", ssExcludedCount) + .detail("FinalUnavailableRatio", finalUnavailableRatio) + .detail("TotalKvStoreUsedBytes", totalKvStoreUsedBytes) + .detail("TotalKvStoreFreeBytes", totalKvStoreFreeBytes) + .detail("TotalKvStoreAvailableBytes", totalKvStoreAvailableBytes) + .detail("TotalKvStoreUsedBytesNotExcluded", totalKvStoreUsedBytesNotExcluded) + .detail("TotalKvStoreFreeBytesNotExcluded", totalKvStoreFreeBytesNotExcluded); + + if (ssExcludedCount == ssTotalCount || finalUnavailableRatio > 0.9) { + std::string temp = "ERROR: This exclude may cause the total available space in the cluster to drop below 10%.\n" "Call set(\"0xff0xff/management/options/exclude/force\", ...) first to exclude without " - "checking free space.\n"; + "checking available space.\n"; *msg = ManagementAPIError::toJsonString(false, markFailed ? "exclude failed" : "exclude", temp); return false; } @@ -1147,11 +1193,11 @@ void FailedServersRangeImpl::set(ReadYourWritesTransaction* ryw, const KeyRef& k Key FailedServersRangeImpl::decode(const KeyRef& key) const { return key.removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin) - .withPrefix(LiteralStringRef("\xff/conf/")); + .withPrefix("\xff/conf/"_sr); } Key FailedServersRangeImpl::encode(const KeyRef& key) const { - return key.removePrefix(LiteralStringRef("\xff/conf/")) + return key.removePrefix("\xff/conf/"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin); } @@ -1230,6 +1276,12 @@ ACTOR Future getProcessClassActor(ReadYourWritesTransaction* ryw, K std::sort(workers.begin(), workers.end(), [](const ProcessData& lhs, const ProcessData& rhs) { return formatIpPort(lhs.address.ip, lhs.address.port) < formatIpPort(rhs.address.ip, rhs.address.port); }); + // Note: ProcessData can contain duplicate workers in corner cases + auto last = std::unique(workers.begin(), workers.end(), [](const ProcessData& lhs, const ProcessData& rhs) { + return formatIpPort(lhs.address.ip, lhs.address.port) == formatIpPort(rhs.address.ip, rhs.address.port); + }); + // remove duplicates + workers.erase(last, workers.end()); RangeResult result; for (auto& w : workers) { // exclude :tls in keys even the network addresss is TLS @@ -1313,8 +1365,7 @@ Future> ProcessClassRangeImpl::commit(ReadYourWritesTransa // validate class type ValueRef processClassType = entry.second.get(); ProcessClass processClass(processClassType.toString(), ProcessClass::DBSource); - if (processClass.classType() == ProcessClass::InvalidClass && - processClassType != LiteralStringRef("default")) { + if (processClass.classType() == ProcessClass::InvalidClass && processClassType != "default"_sr) { std::string error = "ERROR: \'" + processClassType.toString() + "\' is not a valid process class\n"; errorMsg = ManagementAPIError::toJsonString(false, "setclass", error); return errorMsg; @@ -1348,6 +1399,12 @@ ACTOR Future getProcessClassSourceActor(ReadYourWritesTransaction* std::sort(workers.begin(), workers.end(), [](const ProcessData& lhs, const ProcessData& rhs) { return formatIpPort(lhs.address.ip, lhs.address.port) < formatIpPort(rhs.address.ip, rhs.address.port); }); + // Note: ProcessData can contain duplicate workers in corner cases + auto last = std::unique(workers.begin(), workers.end(), [](const ProcessData& lhs, const ProcessData& rhs) { + return formatIpPort(lhs.address.ip, lhs.address.port) == formatIpPort(rhs.address.ip, rhs.address.port); + }); + // remove duplicates + workers.erase(last, workers.end()); RangeResult result; for (auto& w : workers) { // exclude :tls in keys even the network addresss is TLS @@ -1414,11 +1471,10 @@ ACTOR Future> lockDatabaseCommitActor(ReadYourWritesTransa throw database_locked(); } else if (!val.present()) { // lock database - ryw->getTransaction().atomicOp(databaseLockedKey, - BinaryWriter::toValue(uid, Unversioned()) - .withPrefix(LiteralStringRef("0123456789")) - .withSuffix(LiteralStringRef("\x00\x00\x00\x00")), - MutationRef::SetVersionstampedValue); + ryw->getTransaction().atomicOp( + databaseLockedKey, + BinaryWriter::toValue(uid, Unversioned()).withPrefix("0123456789"_sr).withSuffix("\x00\x00\x00\x00"_sr), + MutationRef::SetVersionstampedValue); ryw->getTransaction().addWriteConflictRange(normalKeys); } @@ -1617,10 +1673,10 @@ Future TracingOptionsImpl::getRange(ReadYourWritesTransaction* ryw, if (key.endsWith(kTracingTransactionIdKey)) { result.push_back_deep(result.arena(), - KeyValueRef(key, std::to_string(ryw->getTransactionState()->spanID.first()))); + KeyValueRef(key, ryw->getTransactionState()->spanContext.traceID.toString())); } else if (key.endsWith(kTracingTokenKey)) { result.push_back_deep(result.arena(), - KeyValueRef(key, std::to_string(ryw->getTransactionState()->spanID.second()))); + KeyValueRef(key, std::to_string(ryw->getTransactionState()->spanContext.spanID))); } } return result; @@ -1628,20 +1684,22 @@ Future TracingOptionsImpl::getRange(ReadYourWritesTransaction* ryw, void TracingOptionsImpl::set(ReadYourWritesTransaction* ryw, const KeyRef& key, const ValueRef& value) { if (ryw->getApproximateSize() > 0) { - ryw->setSpecialKeySpaceErrorMsg("tracing options must be set first"); + ryw->setSpecialKeySpaceErrorMsg( + ManagementAPIError::toJsonString(false, "configure trace", "tracing options must be set first")); ryw->getSpecialKeySpaceWriteMap().insert(key, std::make_pair(true, Optional())); return; } if (key.endsWith(kTracingTransactionIdKey)) { - ryw->setTransactionID(std::stoul(value.toString())); + ryw->setTransactionID(UID::fromString(value.toString())); } else if (key.endsWith(kTracingTokenKey)) { if (value.toString() == "true") { ryw->setToken(deterministicRandom()->randomUInt64()); } else if (value.toString() == "false") { ryw->setToken(0); } else { - ryw->setSpecialKeySpaceErrorMsg("token must be set to true/false"); + ryw->setSpecialKeySpaceErrorMsg( + ManagementAPIError::toJsonString(false, "configure trace token", "token must be set to true/false")); throw special_keys_api_failure(); } } @@ -1655,12 +1713,12 @@ Future> TracingOptionsImpl::commit(ReadYourWritesTransacti } void TracingOptionsImpl::clear(ReadYourWritesTransaction* ryw, const KeyRangeRef& range) { - ryw->setSpecialKeySpaceErrorMsg("clear range disabled"); + ryw->setSpecialKeySpaceErrorMsg(ManagementAPIError::toJsonString(false, "clear trace", "clear range disabled")); throw special_keys_api_failure(); } void TracingOptionsImpl::clear(ReadYourWritesTransaction* ryw, const KeyRef& key) { - ryw->setSpecialKeySpaceErrorMsg("clear disabled"); + ryw->setSpecialKeySpaceErrorMsg(ManagementAPIError::toJsonString(false, "clear trace", "clear disabled")); throw special_keys_api_failure(); } @@ -1670,7 +1728,7 @@ ACTOR Future coordinatorsGetRangeActor(ReadYourWritesTransaction* r state ClusterConnectionString cs = ryw->getDatabase()->getConnectionRecord()->getConnectionString(); state std::vector coordinator_processes = wait(cs.tryResolveHostnames()); RangeResult result; - Key cluster_decription_key = prefix.withSuffix(LiteralStringRef("cluster_description")); + Key cluster_decription_key = prefix.withSuffix("cluster_description"_sr); if (kr.contains(cluster_decription_key)) { result.push_back_deep(result.arena(), KeyValueRef(cluster_decription_key, cs.clusterKeyName())); } @@ -1685,7 +1743,7 @@ ACTOR Future coordinatorsGetRangeActor(ReadYourWritesTransaction* r processes_str += ","; processes_str += w.toString(); } - Key processes_key = prefix.withSuffix(LiteralStringRef("processes")); + Key processes_key = prefix.withSuffix("processes"_sr); if (kr.contains(processes_key)) { result.push_back_deep(result.arena(), KeyValueRef(processes_key, Value(processes_str))); } @@ -1707,7 +1765,7 @@ ACTOR static Future> coordinatorsCommitActor(ReadYourWrite state bool parse_error = false; // check update for coordinators - Key processes_key = LiteralStringRef("processes").withPrefix(kr.begin); + Key processes_key = "processes"_sr.withPrefix(kr.begin); auto processes_entry = ryw->getSpecialKeySpaceWriteMap()[processes_key]; if (processes_entry.first) { ASSERT(processes_entry.second.present()); // no clear should be seen here @@ -1747,7 +1805,7 @@ ACTOR static Future> coordinatorsCommitActor(ReadYourWrite std::string newName; // check update for cluster_description - Key cluster_decription_key = LiteralStringRef("cluster_description").withPrefix(kr.begin); + Key cluster_decription_key = "cluster_description"_sr.withPrefix(kr.begin); auto entry = ryw->getSpecialKeySpaceWriteMap()[cluster_decription_key]; if (entry.first) { // check valid description [a-zA-Z0-9_]+ @@ -1761,11 +1819,15 @@ ACTOR static Future> coordinatorsCommitActor(ReadYourWrite } } + auto configDBEntry = ryw->getSpecialKeySpaceWriteMap()["config_db"_sr.withPrefix(kr.begin)]; + TraceEvent(SevDebug, "SKSChangeCoordinatorsStart") .detail("NewConnectionString", conn.toString()) - .detail("Description", entry.first ? entry.second.get().toString() : ""); + .detail("Description", entry.first ? entry.second.get().toString() : "") + .detail("ConfigDBDisabled", configDBEntry.first); - Optional r = wait(changeQuorumChecker(&ryw->getTransaction(), &conn, newName)); + Optional r = + wait(changeQuorumChecker(&ryw->getTransaction(), &conn, newName, configDBEntry.first)); TraceEvent(SevDebug, "SKSChangeCoordinatorsFinish") .detail("Result", r.present() ? static_cast(r.get()) : -1); // -1 means success @@ -1895,6 +1957,12 @@ Future AdvanceVersionImpl::getRange(ReadYourWritesTransaction* ryw, } ACTOR static Future> advanceVersionCommitActor(ReadYourWritesTransaction* ryw, Version v) { + Optional> versionEpochValue = wait(ryw->getTransaction().get(versionEpochKey)); + if (versionEpochValue.present()) { + return ManagementAPIError::toJsonString( + false, "advanceversion", "Illegal to modify the version while the version epoch is enabled"); + } + // Max version we can set for minRequiredCommitVersionKey, // making sure the cluster can still be alive for 1000 years after the recovery static const Version maxAllowedVerion = @@ -1982,7 +2050,7 @@ Future ClientProfilingImpl::getRange(ReadYourWritesTransaction* ryw KeyRef prefix = getKeyRange().begin; RangeResult result = RangeResult(); // client_txn_sample_rate - Key sampleRateKey = LiteralStringRef("client_txn_sample_rate").withPrefix(prefix); + Key sampleRateKey = "client_txn_sample_rate"_sr.withPrefix(prefix); ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); @@ -2003,7 +2071,7 @@ Future ClientProfilingImpl::getRange(ReadYourWritesTransaction* ryw } } // client_txn_size_limit - Key txnSizeLimitKey = LiteralStringRef("client_txn_size_limit").withPrefix(prefix); + Key txnSizeLimitKey = "client_txn_size_limit"_sr.withPrefix(prefix); if (kr.contains(txnSizeLimitKey)) { auto entry = ryw->getSpecialKeySpaceWriteMap()[txnSizeLimitKey]; if (!ryw->readYourWritesDisabled() && entry.first) { @@ -2029,7 +2097,7 @@ Future> ClientProfilingImpl::commit(ReadYourWritesTransact Standalone> clears; // client_txn_sample_rate - Key sampleRateKey = LiteralStringRef("client_txn_sample_rate").withPrefix(getKeyRange().begin); + Key sampleRateKey = "client_txn_sample_rate"_sr.withPrefix(getKeyRange().begin); auto rateEntry = ryw->getSpecialKeySpaceWriteMap()[sampleRateKey]; if (rateEntry.first && rateEntry.second.present()) { @@ -2040,7 +2108,7 @@ Future> ClientProfilingImpl::commit(ReadYourWritesTransact } else { try { double sampleRate = boost::lexical_cast(sampleRateStr); - Tuple rate = Tuple().appendDouble(sampleRate); + Tuple rate = Tuple::makeTuple(sampleRate); insertions.push_back_deep(insertions.arena(), KeyValueRef(fdbClientInfoTxnSampleRate, rate.pack())); } catch (boost::bad_lexical_cast& e) { return Optional(ManagementAPIError::toJsonString( @@ -2049,7 +2117,7 @@ Future> ClientProfilingImpl::commit(ReadYourWritesTransact } } // client_txn_size_limit - Key txnSizeLimitKey = LiteralStringRef("client_txn_size_limit").withPrefix(getKeyRange().begin); + Key txnSizeLimitKey = "client_txn_size_limit"_sr.withPrefix(getKeyRange().begin); auto sizeLimitEntry = ryw->getSpecialKeySpaceWriteMap()[txnSizeLimitKey]; if (sizeLimitEntry.first && sizeLimitEntry.second.present()) { std::string sizeLimitStr = sizeLimitEntry.second.get().toString(); @@ -2059,7 +2127,7 @@ Future> ClientProfilingImpl::commit(ReadYourWritesTransact } else { try { int64_t sizeLimit = boost::lexical_cast(sizeLimitStr); - Tuple size = Tuple().append(sizeLimit); + Tuple size = Tuple::makeTuple(sizeLimit); insertions.push_back_deep(insertions.arena(), KeyValueRef(fdbClientInfoTxnSizeLimit, size.pack())); } catch (boost::bad_lexical_cast& e) { return Optional(ManagementAPIError::toJsonString( @@ -2094,11 +2162,11 @@ void parse(StringRef& val, double& d) { } void parse(StringRef& val, WaitState& w) { - if (val == LiteralStringRef("disk") || val == LiteralStringRef("Disk")) { + if (val == "disk"_sr || val == "Disk"_sr) { w = WaitState::Disk; - } else if (val == LiteralStringRef("network") || val == LiteralStringRef("Network")) { + } else if (val == "network"_sr || val == "Network"_sr) { w = WaitState::Network; - } else if (val == LiteralStringRef("running") || val == LiteralStringRef("Running")) { + } else if (val == "running"_sr || val == "Running"_sr) { w = WaitState::Running; } else { throw std::range_error("failed to parse run state"); @@ -2199,7 +2267,8 @@ ACTOR static Future actorLineageGetRangeActor(ReadYourWritesTransac state std::vector endValues = kr.end.removePrefix(prefix).splitAny("/"_sr); // Require index (either "state" or "time") and address:port. if (beginValues.size() < 2 || endValues.size() < 2) { - ryw->setSpecialKeySpaceErrorMsg("missing required parameters (index, host)"); + ryw->setSpecialKeySpaceErrorMsg( + ManagementAPIError::toJsonString(false, "read actor_lineage", "missing required parameters (index, host)")); throw special_keys_api_failure(); } @@ -2218,12 +2287,14 @@ ACTOR static Future actorLineageGetRangeActor(ReadYourWritesTransac parse(endValues.begin() + 1, endValues.end(), endRangeHost, timeEnd, waitStateEnd, seqEnd); } } else { - ryw->setSpecialKeySpaceErrorMsg("invalid index in actor_lineage"); + ryw->setSpecialKeySpaceErrorMsg( + ManagementAPIError::toJsonString(false, "read actor_lineage", "invalid index in actor_lineage")); throw special_keys_api_failure(); } } catch (Error& e) { if (e.code() != special_keys_api_failure().code()) { - ryw->setSpecialKeySpaceErrorMsg("failed to parse key"); + ryw->setSpecialKeySpaceErrorMsg( + ManagementAPIError::toJsonString(false, "read actor_lineage", "failed to parse key")); throw special_keys_api_failure(); } else { throw e; @@ -2233,7 +2304,8 @@ ACTOR static Future actorLineageGetRangeActor(ReadYourWritesTransac if (kr.begin != kr.end && host != endRangeHost) { // The client doesn't know about all the hosts, so a get range covering // multiple hosts has no way of knowing which IP:port combos to use. - ryw->setSpecialKeySpaceErrorMsg("the host must remain the same on both ends of the range"); + ryw->setSpecialKeySpaceErrorMsg(ManagementAPIError::toJsonString( + false, "read actor_lineage", "the host must remain the same on both ends of the range")); throw special_keys_api_failure(); } @@ -2494,7 +2566,7 @@ ACTOR static Future DataDistributionGetRangeActor(ReadYourWritesTra KeyRangeRef kr) { state RangeResult result; // dataDistributionModeKey - state Key modeKey = LiteralStringRef("mode").withPrefix(prefix); + state Key modeKey = "mode"_sr.withPrefix(prefix); ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); @@ -2510,7 +2582,7 @@ ACTOR static Future DataDistributionGetRangeActor(ReadYourWritesTra } } // rebalanceDDIgnoreKey - state Key rebalanceIgnoredKey = LiteralStringRef("rebalance_ignored").withPrefix(prefix); + state Key rebalanceIgnoredKey = "rebalance_ignored"_sr.withPrefix(prefix); if (kr.contains(rebalanceIgnoredKey)) { auto entry = ryw->getSpecialKeySpaceWriteMap()[rebalanceIgnoredKey]; if (ryw->readYourWritesDisabled() || !entry.first) { @@ -2537,8 +2609,8 @@ Future> DataDistributionImpl::commit(ReadYourWritesTransac Optional msg; KeyRangeRef kr = getKeyRange(); - Key modeKey = LiteralStringRef("mode").withPrefix(kr.begin); - Key rebalanceIgnoredKey = LiteralStringRef("rebalance_ignored").withPrefix(kr.begin); + Key modeKey = "mode"_sr.withPrefix(kr.begin); + Key rebalanceIgnoredKey = "rebalance_ignored"_sr.withPrefix(kr.begin); auto ranges = ryw->getSpecialKeySpaceWriteMap().containedRanges(kr); for (auto iter = ranges.begin(); iter != ranges.end(); ++iter) { if (!iter->value().first) @@ -2548,7 +2620,7 @@ Future> DataDistributionImpl::commit(ReadYourWritesTransac try { int mode = boost::lexical_cast(iter->value().second.get().toString()); Value modeVal = BinaryWriter::toValue(mode, Unversioned()); - if (mode == 0 || mode == 1) { + if (mode == 0 || mode == 1 || mode == 2) { // Whenever configuration changes or DD related system keyspace is changed, // actor must grab the moveKeysLockOwnerKey and update moveKeysLockWriteKey. // This prevents concurrent write to the same system keyspace. @@ -2573,14 +2645,18 @@ Future> DataDistributionImpl::commit(ReadYourWritesTransac iter->value().second.get().toString()); } } else if (iter->range() == singleKeyRange(rebalanceIgnoredKey)) { - if (iter->value().second.get().size()) - msg = - ManagementAPIError::toJsonString(false, - "datadistribution", - "Value is unused for the data_distribution/rebalance_ignored " - "key, please set it to an empty value"); - else - ryw->getTransaction().set(rebalanceDDIgnoreKey, LiteralStringRef("on")); + ValueRef val = iter->value().second.get(); + try { + boost::lexical_cast(iter->value().second.get().toString()); + } catch (boost::bad_lexical_cast& e) { + ManagementAPIError::toJsonString( + false, + "datadistribution", + "Invalid datadistribution rebalance ignore option (int or empty): " + + iter->value().second.get().toString()); + val = ""_sr; + } + ryw->getTransaction().set(rebalanceDDIgnoreKey, iter->value().second.get()); } else { msg = ManagementAPIError::toJsonString( false, @@ -2721,11 +2797,11 @@ void ExcludedLocalitiesRangeImpl::set(ReadYourWritesTransaction* ryw, const KeyR Key ExcludedLocalitiesRangeImpl::decode(const KeyRef& key) const { return key.removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin) - .withPrefix(LiteralStringRef("\xff/conf/")); + .withPrefix("\xff/conf/"_sr); } Key ExcludedLocalitiesRangeImpl::encode(const KeyRef& key) const { - return key.removePrefix(LiteralStringRef("\xff/conf/")) + return key.removePrefix("\xff/conf/"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin); } @@ -2750,11 +2826,11 @@ void FailedLocalitiesRangeImpl::set(ReadYourWritesTransaction* ryw, const KeyRef Key FailedLocalitiesRangeImpl::decode(const KeyRef& key) const { return key.removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin) - .withPrefix(LiteralStringRef("\xff/conf/")); + .withPrefix("\xff/conf/"_sr); } Key FailedLocalitiesRangeImpl::encode(const KeyRef& key) const { - return key.removePrefix(LiteralStringRef("\xff/conf/")) + return key.removePrefix("\xff/conf/"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin); } @@ -2763,103 +2839,62 @@ Future> FailedLocalitiesRangeImpl::commit(ReadYourWritesTr return excludeLocalityCommitActor(ryw, true); } -ACTOR Future getTenantList(ReadYourWritesTransaction* ryw, KeyRangeRef kr, GetRangeLimits limitsHint) { - state KeyRef managementPrefix = - kr.begin.substr(0, - SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin.size() + - TenantMapRangeImpl::submoduleRange.begin.size()); - - kr = kr.removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin); - TenantNameRef beginTenant = kr.begin.removePrefix(TenantMapRangeImpl::submoduleRange.begin); - - TenantNameRef endTenant = kr.end; - if (endTenant.startsWith(TenantMapRangeImpl::submoduleRange.begin)) { - endTenant = endTenant.removePrefix(TenantMapRangeImpl::submoduleRange.begin); - } else { - endTenant = "\xff"_sr; - } - - std::map tenants = - wait(ManagementAPI::listTenantsTransaction(&ryw->getTransaction(), beginTenant, endTenant, limitsHint.rows)); - - RangeResult results; - for (auto tenant : tenants) { - json_spirit::mObject tenantEntry; - tenantEntry["id"] = tenant.second.id; - tenantEntry["prefix"] = tenant.second.prefix.toString(); - std::string tenantEntryString = json_spirit::write_string(json_spirit::mValue(tenantEntry)); - ValueRef tenantEntryBytes(results.arena(), tenantEntryString); - results.push_back(results.arena(), - KeyValueRef(tenant.first.withPrefix(managementPrefix, results.arena()), tenantEntryBytes)); - } - - return results; -} - -TenantMapRangeImpl::TenantMapRangeImpl(KeyRangeRef kr) : SpecialKeyRangeRWImpl(kr) {} - -Future TenantMapRangeImpl::getRange(ReadYourWritesTransaction* ryw, - KeyRangeRef kr, - GetRangeLimits limitsHint) const { - return getTenantList(ryw, kr, limitsHint); -} - -ACTOR Future deleteTenantRange(ReadYourWritesTransaction* ryw, TenantName beginTenant, TenantName endTenant) { - std::map tenants = wait( - ManagementAPI::listTenantsTransaction(&ryw->getTransaction(), beginTenant, endTenant, CLIENT_KNOBS->TOO_MANY)); - - if (tenants.size() == CLIENT_KNOBS->TOO_MANY) { - TraceEvent(SevWarn, "DeleteTenantRangeTooLange") - .detail("BeginTenant", beginTenant) - .detail("EndTenant", endTenant); - ryw->setSpecialKeySpaceErrorMsg("too many tenants to range delete"); - throw special_keys_api_failure(); - } - - std::vector> deleteFutures; - for (auto tenant : tenants) { - deleteFutures.push_back(ManagementAPI::deleteTenantTransaction(&ryw->getTransaction(), tenant.first)); - } +// Defined in ReadYourWrites.actor.cpp +ACTOR Future getWorkerInterfaces(Reference clusterRecord); +// Defined in NativeAPI.actor.cpp +ACTOR Future verifyInterfaceActor(Reference connectLock, ClientWorkerInterface workerInterf); - wait(waitForAll(deleteFutures)); - return Void(); -} - -Future> TenantMapRangeImpl::commit(ReadYourWritesTransaction* ryw) { - auto ranges = ryw->getSpecialKeySpaceWriteMap().containedRanges(range); - std::vector> tenantManagementFutures; - for (auto range : ranges) { - if (!range.value().first) { - continue; - } - - TenantNameRef tenantName = - range.begin() - .removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin) - .removePrefix(TenantMapRangeImpl::submoduleRange.begin); +ACTOR static Future workerInterfacesImplGetRangeActor(ReadYourWritesTransaction* ryw, + KeyRef prefix, + KeyRangeRef kr) { + if (!ryw->getDatabase().getPtr() || !ryw->getDatabase()->getConnectionRecord()) + return RangeResult(); - if (range.value().second.present()) { - tenantManagementFutures.push_back( - success(ManagementAPI::createTenantTransaction(&ryw->getTransaction(), tenantName))); - } else { - // For a single key clear, just issue the delete - if (KeyRangeRef(range.begin(), range.end()).singleKeyRange()) { - tenantManagementFutures.push_back( - ManagementAPI::deleteTenantTransaction(&ryw->getTransaction(), tenantName)); + state RangeResult interfs = wait(getWorkerInterfaces(ryw->getDatabase()->getConnectionRecord())); + // for options' special keys, the boolean flag indicates if it's a SET operation + auto [verify, _] = ryw->getSpecialKeySpaceWriteMap()[SpecialKeySpace::getManagementApiCommandOptionSpecialKey( + "worker_interfaces", "verify")]; + state RangeResult result; + if (verify) { + // if verify option is set, we try to talk to every worker and only returns those we can talk to + Reference connectLock(new FlowLock(CLIENT_KNOBS->CLI_CONNECT_PARALLELISM)); + state std::vector> verifyInterfs; + for (const auto& [k_, value] : interfs) { + auto k = k_.withPrefix(prefix); + if (kr.contains(k)) { + ClientWorkerInterface workerInterf = + BinaryReader::fromStringRef(value, IncludeVersion()); + verifyInterfs.push_back(verifyInterfaceActor(connectLock, workerInterf)); } else { - TenantNameRef endTenant = range.end().removePrefix( - SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin); - if (endTenant.startsWith(submoduleRange.begin)) { - endTenant = endTenant.removePrefix(submoduleRange.begin); - } else { - endTenant = "\xff"_sr; - } - tenantManagementFutures.push_back(deleteTenantRange(ryw, tenantName, endTenant)); + verifyInterfs.push_back(false); + } + } + wait(waitForAll(verifyInterfs)); + // state int index; + for (int index = 0; index < interfs.size(); index++) { + if (verifyInterfs[index].get()) { + // if we can establish a connection, add the kv pair into the result + result.push_back_deep(result.arena(), + KeyValueRef(interfs[index].key.withPrefix(prefix), interfs[index].value)); } } + } else { + for (const auto& [k_, v] : interfs) { + auto k = k_.withPrefix(prefix); + if (kr.contains(k)) + result.push_back_deep(result.arena(), KeyValueRef(k, v)); + } } + std::sort(result.begin(), result.end(), KeyValueRef::OrderByKey{}); + return result; +} + +WorkerInterfacesSpecialKeyImpl::WorkerInterfacesSpecialKeyImpl(KeyRangeRef kr) : SpecialKeyRangeReadImpl(kr) {} - return tag(waitForAll(tenantManagementFutures), Optional()); +Future WorkerInterfacesSpecialKeyImpl::getRange(ReadYourWritesTransaction* ryw, + KeyRangeRef kr, + GetRangeLimits limitsHint) const { + return workerInterfacesImplGetRangeActor(ryw, getKeyRange().begin, kr); } ACTOR Future validateSpecialSubrangeRead(ReadYourWritesTransaction* ryw, diff --git a/src/fdbclient/SpecialKeySpace.actor.g.cpp b/src/fdbclient/SpecialKeySpace.actor.g.cpp index 52064aa..a188d0a 100644 --- a/src/fdbclient/SpecialKeySpace.actor.g.cpp +++ b/src/fdbclient/SpecialKeySpace.actor.g.cpp @@ -59,84 +59,63 @@ static bool isAlphaNumeric(const std::string& key) { } } // namespace -const KeyRangeRef TenantMapRangeImpl::submoduleRange = KeyRangeRef("tenant_map/"_sr, "tenant_map0"_sr); - std::unordered_map SpecialKeySpace::moduleToBoundary = { - { SpecialKeySpace::MODULE::TRANSACTION, - KeyRangeRef(LiteralStringRef("\xff\xff/transaction/"), LiteralStringRef("\xff\xff/transaction0")) }, + { SpecialKeySpace::MODULE::TRANSACTION, KeyRangeRef("\xff\xff/transaction/"_sr, "\xff\xff/transaction0"_sr) }, { SpecialKeySpace::MODULE::WORKERINTERFACE, - KeyRangeRef(LiteralStringRef("\xff\xff/worker_interfaces/"), LiteralStringRef("\xff\xff/worker_interfaces0")) }, - { SpecialKeySpace::MODULE::STATUSJSON, singleKeyRange(LiteralStringRef("\xff\xff/status/json")) }, - { SpecialKeySpace::MODULE::CONNECTIONSTRING, singleKeyRange(LiteralStringRef("\xff\xff/connection_string")) }, - { SpecialKeySpace::MODULE::CLUSTERFILEPATH, singleKeyRange(LiteralStringRef("\xff\xff/cluster_file_path")) }, - { SpecialKeySpace::MODULE::METRICS, - KeyRangeRef(LiteralStringRef("\xff\xff/metrics/"), LiteralStringRef("\xff\xff/metrics0")) }, - { SpecialKeySpace::MODULE::MANAGEMENT, - KeyRangeRef(LiteralStringRef("\xff\xff/management/"), LiteralStringRef("\xff\xff/management0")) }, - { SpecialKeySpace::MODULE::ERRORMSG, singleKeyRange(LiteralStringRef("\xff\xff/error_message")) }, - { SpecialKeySpace::MODULE::CONFIGURATION, - KeyRangeRef(LiteralStringRef("\xff\xff/configuration/"), LiteralStringRef("\xff\xff/configuration0")) }, - { SpecialKeySpace::MODULE::GLOBALCONFIG, - KeyRangeRef(LiteralStringRef("\xff\xff/global_config/"), LiteralStringRef("\xff\xff/global_config0")) }, - { SpecialKeySpace::MODULE::TRACING, - KeyRangeRef(LiteralStringRef("\xff\xff/tracing/"), LiteralStringRef("\xff\xff/tracing0")) }, - { SpecialKeySpace::MODULE::ACTORLINEAGE, - KeyRangeRef(LiteralStringRef("\xff\xff/actor_lineage/"), LiteralStringRef("\xff\xff/actor_lineage0")) }, + KeyRangeRef("\xff\xff/worker_interfaces/"_sr, "\xff\xff/worker_interfaces0"_sr) }, + { SpecialKeySpace::MODULE::STATUSJSON, singleKeyRange("\xff\xff/status/json"_sr) }, + { SpecialKeySpace::MODULE::CONNECTIONSTRING, singleKeyRange("\xff\xff/connection_string"_sr) }, + { SpecialKeySpace::MODULE::CLUSTERFILEPATH, singleKeyRange("\xff\xff/cluster_file_path"_sr) }, + { SpecialKeySpace::MODULE::METRICS, KeyRangeRef("\xff\xff/metrics/"_sr, "\xff\xff/metrics0"_sr) }, + { SpecialKeySpace::MODULE::MANAGEMENT, KeyRangeRef("\xff\xff/management/"_sr, "\xff\xff/management0"_sr) }, + { SpecialKeySpace::MODULE::ERRORMSG, singleKeyRange("\xff\xff/error_message"_sr) }, + { SpecialKeySpace::MODULE::CONFIGURATION, KeyRangeRef("\xff\xff/configuration/"_sr, "\xff\xff/configuration0"_sr) }, + { SpecialKeySpace::MODULE::GLOBALCONFIG, KeyRangeRef("\xff\xff/global_config/"_sr, "\xff\xff/global_config0"_sr) }, + { SpecialKeySpace::MODULE::TRACING, KeyRangeRef("\xff\xff/tracing/"_sr, "\xff\xff/tracing0"_sr) }, + { SpecialKeySpace::MODULE::ACTORLINEAGE, KeyRangeRef("\xff\xff/actor_lineage/"_sr, "\xff\xff/actor_lineage0"_sr) }, { SpecialKeySpace::MODULE::ACTOR_PROFILER_CONF, - KeyRangeRef(LiteralStringRef("\xff\xff/actor_profiler_conf/"), - LiteralStringRef("\xff\xff/actor_profiler_conf0")) } + KeyRangeRef("\xff\xff/actor_profiler_conf/"_sr, "\xff\xff/actor_profiler_conf0"_sr) }, + { SpecialKeySpace::MODULE::CLUSTERID, singleKeyRange("\xff\xff/cluster_id"_sr) }, }; std::unordered_map SpecialKeySpace::managementApiCommandToRange = { - { "exclude", - KeyRangeRef(LiteralStringRef("excluded/"), LiteralStringRef("excluded0")) - .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, - { "failed", - KeyRangeRef(LiteralStringRef("failed/"), LiteralStringRef("failed0")) - .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + { "exclude", KeyRangeRef("excluded/"_sr, "excluded0"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + { "failed", KeyRangeRef("failed/"_sr, "failed0"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, { "excludedlocality", - KeyRangeRef(LiteralStringRef("excluded_locality/"), LiteralStringRef("excluded_locality0")) + KeyRangeRef("excluded_locality/"_sr, "excluded_locality0"_sr) .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, { "failedlocality", - KeyRangeRef(LiteralStringRef("failed_locality/"), LiteralStringRef("failed_locality0")) + KeyRangeRef("failed_locality/"_sr, "failed_locality0"_sr) .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, - { "lock", singleKeyRange(LiteralStringRef("db_locked")).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + { "lock", singleKeyRange("db_locked"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, { "consistencycheck", - singleKeyRange(LiteralStringRef("consistency_check_suspended")) - .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + singleKeyRange("consistency_check_suspended"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, { "coordinators", - KeyRangeRef(LiteralStringRef("coordinators/"), LiteralStringRef("coordinators0")) - .withPrefix(moduleToBoundary[MODULE::CONFIGURATION].begin) }, + KeyRangeRef("coordinators/"_sr, "coordinators0"_sr).withPrefix(moduleToBoundary[MODULE::CONFIGURATION].begin) }, { "advanceversion", - singleKeyRange(LiteralStringRef("min_required_commit_version")) - .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, - { "versionepoch", - singleKeyRange(LiteralStringRef("version_epoch")).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, - { "profile", - KeyRangeRef(LiteralStringRef("profiling/"), LiteralStringRef("profiling0")) - .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + singleKeyRange("min_required_commit_version"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + { "versionepoch", singleKeyRange("version_epoch"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + { "profile", KeyRangeRef("profiling/"_sr, "profiling0"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, { "maintenance", - KeyRangeRef(LiteralStringRef("maintenance/"), LiteralStringRef("maintenance0")) - .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + KeyRangeRef("maintenance/"_sr, "maintenance0"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, { "datadistribution", - KeyRangeRef(LiteralStringRef("data_distribution/"), LiteralStringRef("data_distribution0")) + KeyRangeRef("data_distribution/"_sr, "data_distribution0"_sr) .withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, - { "tenantmap", TenantMapRangeImpl::submoduleRange.withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) } + { "tenant", KeyRangeRef("tenant/"_sr, "tenant0"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) }, + { "tenantmap", + KeyRangeRef("tenant_map/"_sr, "tenant_map0"_sr).withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin) } }; std::unordered_map SpecialKeySpace::actorLineageApiCommandToRange = { - { "state", - KeyRangeRef(LiteralStringRef("state/"), LiteralStringRef("state0")) - .withPrefix(moduleToBoundary[MODULE::ACTORLINEAGE].begin) }, - { "time", - KeyRangeRef(LiteralStringRef("time/"), LiteralStringRef("time0")) - .withPrefix(moduleToBoundary[MODULE::ACTORLINEAGE].begin) } + { "state", KeyRangeRef("state/"_sr, "state0"_sr).withPrefix(moduleToBoundary[MODULE::ACTORLINEAGE].begin) }, + { "time", KeyRangeRef("time/"_sr, "time0"_sr).withPrefix(moduleToBoundary[MODULE::ACTORLINEAGE].begin) } }; std::set SpecialKeySpace::options = { "excluded/force", "failed/force", "excluded_locality/force", - "failed_locality/force" }; + "failed_locality/force", + "worker_interfaces/verify" }; std::set SpecialKeySpace::tracingOptions = { kTracingTransactionIdKey, kTracingTokenKey }; @@ -148,27 +127,27 @@ RangeResult rywGetRange(ReadYourWritesTransaction* ryw, const KeyRangeRef& kr, c // The cache object is used to cache the first read result from the rpc call during the key resolution, // then when we need to do key resolution or result filtering, // we, instead of rpc call, read from this cache object have consistent results - #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via moveKeySelectorOverRangeActor() - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class MoveKeySelectorOverRangeActorActorState { - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" MoveKeySelectorOverRangeActorActorState(const SpecialKeyRangeReadImpl* const& skrImpl,ReadYourWritesTransaction* const& ryw,KeySelector* const& ks,KeyRangeMap>* const& cache) - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : skrImpl(skrImpl), - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw(ryw), - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ks(ks), - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" cache(cache) - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("moveKeySelectorOverRangeActor", reinterpret_cast(this)); @@ -181,76 +160,84 @@ class MoveKeySelectorOverRangeActorActorState { int a_body1(int loopDepth=0) { try { - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(!ks->orEqual); - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(ks->offset != 1); - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (ryw->getTenant().present() && !skrImpl->supportsTenants()) + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + return a_body1Catch1(illegal_tenant_access(), loopDepth); + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + } + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" startKey = Key(skrImpl->getKeyRange().begin); - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" endKey = Key(skrImpl->getKeyRange().end); - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result = RangeResult(); - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (ks->offset < 1) - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (skrImpl->getKeyRange().contains(ks->getKey())) - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" endKey = ks->getKey(); - #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } else { - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (skrImpl->getKeyRange().contains(ks->getKey())) - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" startKey = ks->getKey(); - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(startKey < endKey); - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" DisabledTraceEvent(SevDebug, "NormalizeKeySelector") .detail("OriginalKey", ks->getKey()) .detail("OriginalOffset", ks->offset) .detail("SpecialKeyRangeStart", skrImpl->getKeyRange().begin) .detail("SpecialKeyRangeEnd", skrImpl->getKeyRange().end); - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetRangeLimits limitsHint(ks->offset >= 1 ? ks->offset : 1 - ks->offset); - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (skrImpl->isAsync()) - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" const SpecialKeyRangeAsyncImpl* ptr = dynamic_cast(skrImpl); - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_0 = ptr->getRange(ryw, KeyRangeRef(startKey, endKey), limitsHint, cache); - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } else { - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_1 = skrImpl->getRange(ryw, KeyRangeRef(startKey, endKey), limitsHint); - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } } @@ -272,69 +259,69 @@ class MoveKeySelectorOverRangeActorActorState { } int a_body1cont1(int loopDepth) { - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (result.size() == 0) - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" TraceEvent(SevDebug, "ZeroElementsIntheRange").detail("Start", startKey).detail("End", endKey); - #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~MoveKeySelectorOverRangeActorActorState(); static_cast(this)->destroy(); return 0; } - #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~MoveKeySelectorOverRangeActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (ks->offset < 1) - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (result.size() >= 1 - ks->offset) - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ks->setKey(KeyRef(ks->arena(), result[result.size() - (1 - ks->offset)].key)); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ks->offset = 1; - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ks->setKey(KeyRef(ks->arena(), result[0].key)); - #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ks->offset += result.size(); - #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } else { - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (result.size() >= ks->offset) - #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ks->setKey(KeyRef(ks->arena(), result[ks->offset - 1].key)); - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ks->offset = 1; - #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ks->setKey(KeyRef(ks->arena(), keyAfter(result[result.size() - 1].key))); - #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ks->offset -= result.size(); - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" DisabledTraceEvent(SevDebug, "NormalizeKeySelector") .detail("NormalizedKey", ks->getKey()) .detail("NormalizedOffset", ks->offset) .detail("SpecialKeyRangeStart", skrImpl->getKeyRange().begin) .detail("SpecialKeyRangeEnd", skrImpl->getKeyRange().end); - #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~MoveKeySelectorOverRangeActorActorState(); static_cast(this)->destroy(); return 0; } - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~MoveKeySelectorOverRangeActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -342,33 +329,33 @@ class MoveKeySelectorOverRangeActorActorState { return loopDepth; } - int a_body1cont6(RangeResult const& result_,int loopDepth) + int a_body1cont7(RangeResult const& result_,int loopDepth) { - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result = result_; - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1cont6(RangeResult && result_,int loopDepth) + int a_body1cont7(RangeResult && result_,int loopDepth) { - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result = result_; - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } int a_body1when1(RangeResult const& result_,int loopDepth) { - loopDepth = a_body1cont6(result_, loopDepth); + loopDepth = a_body1cont7(result_, loopDepth); return loopDepth; } int a_body1when1(RangeResult && result_,int loopDepth) { - loopDepth = a_body1cont6(std::move(result_), loopDepth); + loopDepth = a_body1cont7(std::move(result_), loopDepth); return loopDepth; } @@ -423,33 +410,33 @@ class MoveKeySelectorOverRangeActorActorState { fdb_probe_actor_exit("moveKeySelectorOverRangeActor", reinterpret_cast(this), 0); } - int a_body1cont8(RangeResult const& result_,int loopDepth) + int a_body1cont9(RangeResult const& result_,int loopDepth) { - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result = result_; - #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1cont8(RangeResult && result_,int loopDepth) + int a_body1cont9(RangeResult && result_,int loopDepth) { - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result = result_; - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } int a_body1when2(RangeResult const& result_,int loopDepth) { - loopDepth = a_body1cont8(result_, loopDepth); + loopDepth = a_body1cont9(result_, loopDepth); return loopDepth; } int a_body1when2(RangeResult && result_,int loopDepth) { - loopDepth = a_body1cont8(std::move(result_), loopDepth); + loopDepth = a_body1cont9(std::move(result_), loopDepth); return loopDepth; } @@ -504,26 +491,26 @@ class MoveKeySelectorOverRangeActorActorState { fdb_probe_actor_exit("moveKeySelectorOverRangeActor", reinterpret_cast(this), 1); } - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" const SpecialKeyRangeReadImpl* skrImpl; - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeySelector* ks; - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeMap>* cache; - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key startKey; - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key endKey; - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via moveKeySelectorOverRangeActor() - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class MoveKeySelectorOverRangeActorActor final : public Actor, public ActorCallback< MoveKeySelectorOverRangeActorActor, 0, RangeResult >, public ActorCallback< MoveKeySelectorOverRangeActorActor, 1, RangeResult >, public FastAllocated, public MoveKeySelectorOverRangeActorActorState { - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -533,9 +520,9 @@ class MoveKeySelectorOverRangeActorActor final : public Actor, public Acto #pragma clang diagnostic pop friend struct ActorCallback< MoveKeySelectorOverRangeActorActor, 0, RangeResult >; friend struct ActorCallback< MoveKeySelectorOverRangeActorActor, 1, RangeResult >; - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" MoveKeySelectorOverRangeActorActor(const SpecialKeyRangeReadImpl* const& skrImpl,ReadYourWritesTransaction* const& ryw,KeySelector* const& ks,KeyRangeMap>* const& cache) - #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), MoveKeySelectorOverRangeActorActorState(skrImpl, ryw, ks, cache) { @@ -560,14 +547,14 @@ friend struct ActorCallback< MoveKeySelectorOverRangeActorActor, 1, RangeResult } }; } - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future moveKeySelectorOverRangeActor( const SpecialKeyRangeReadImpl* const& skrImpl, ReadYourWritesTransaction* const& ryw, KeySelector* const& ks, KeyRangeMap>* const& cache ) { - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new MoveKeySelectorOverRangeActorActor(skrImpl, ryw, ks, cache)); - #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" // This function will normalize the given KeySelector to a standard KeySelector: // orEqual == false && offset == 1 (Standard form) @@ -577,35 +564,35 @@ friend struct ActorCallback< MoveKeySelectorOverRangeActorActor, 1, RangeResult // to maintain; Thus, separate each part to make the code easy to understand and more compact // Boundary is the range of the legal key space, which, by default is the range of the module // And (\xff\xff, \xff\xff\xff) if SPECIAL_KEY_SPACE_RELAXED is turned on - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via normalizeKeySelectorActor() - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class NormalizeKeySelectorActorActorState { - #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" NormalizeKeySelectorActorActorState(SpecialKeySpace* const& sks,ReadYourWritesTransaction* const& ryw,KeySelector* const& ks,KeyRangeRef const& boundary,int* const& actualOffset,RangeResult* const& result,KeyRangeMap>* const& cache) - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : sks(sks), - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw(ryw), - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ks(ks), - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" boundary(boundary), - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" actualOffset(actualOffset), - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result(result), - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" cache(cache), - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" iter(ks->offset < 1 ? sks->getReadImpls().rangeContainingKeyBefore(ks->getKey()) : sks->getReadImpls().rangeContaining(ks->getKey())) - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("normalizeKeySelectorActor", reinterpret_cast(this)); @@ -618,9 +605,9 @@ class NormalizeKeySelectorActorActorState { int a_body1(int loopDepth=0) { try { - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ; - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -641,39 +628,39 @@ class NormalizeKeySelectorActorActorState { } int a_body1cont1(int loopDepth) { - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" *actualOffset = ks->offset; - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!ks->isFirstGreaterOrEqual()) - #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" TraceEvent(SevDebug, "ReadToBoundary") .detail("TerminateKey", ks->getKey()) .detail("TerminateOffset", ks->offset); - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (ks->offset < 1) - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result->readToBegin = true; - #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ks->setKey(boundary.begin); - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result->readThroughEnd = true; - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ks->setKey(boundary.end); - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ks->offset = 1; - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~NormalizeKeySelectorActorActorState(); static_cast(this)->destroy(); return 0; } - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~NormalizeKeySelectorActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -690,26 +677,26 @@ class NormalizeKeySelectorActorActorState { } int a_body1loopBody1(int loopDepth) { - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!((ks->offset < 1 && iter->begin() >= boundary.begin) || (ks->offset > 1 && iter->begin() < boundary.end))) - #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (iter->value() != nullptr) - #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_0 = moveKeySelectorOverRangeActor(iter->value(), ryw, ks, cache); - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } else @@ -734,32 +721,32 @@ class NormalizeKeySelectorActorActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (ks->offset < 1) - #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (iter == sks->getReadImpls().ranges().begin()) - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } else { - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" --iter; - #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } else { - #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (ks->offset > 1) - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ++iter; - #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } if (loopDepth == 0) return a_body1loopHead1(0); @@ -841,28 +828,28 @@ class NormalizeKeySelectorActorActorState { fdb_probe_actor_exit("normalizeKeySelectorActor", reinterpret_cast(this), 0); } - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" SpecialKeySpace* sks; - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeySelector* ks; - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef boundary; - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int* actualOffset; - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult* result; - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeMap>* cache; - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeMap::iterator iter; - #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via normalizeKeySelectorActor() - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class NormalizeKeySelectorActorActor final : public Actor, public ActorCallback< NormalizeKeySelectorActorActor, 0, Void >, public FastAllocated, public NormalizeKeySelectorActorActorState { - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -871,9 +858,9 @@ class NormalizeKeySelectorActorActor final : public Actor, public ActorCal void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< NormalizeKeySelectorActorActor, 0, Void >; - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" NormalizeKeySelectorActorActor(SpecialKeySpace* const& sks,ReadYourWritesTransaction* const& ryw,KeySelector* const& ks,KeyRangeRef const& boundary,int* const& actualOffset,RangeResult* const& result,KeyRangeMap>* const& cache) - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), NormalizeKeySelectorActorActorState(sks, ryw, ks, boundary, actualOffset, result, cache) { @@ -897,14 +884,14 @@ friend struct ActorCallback< NormalizeKeySelectorActorActor, 0, Void >; } }; } - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future normalizeKeySelectorActor( SpecialKeySpace* const& sks, ReadYourWritesTransaction* const& ryw, KeySelector* const& ks, KeyRangeRef const& boundary, int* const& actualOffset, RangeResult* const& result, KeyRangeMap>* const& cache ) { - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new NormalizeKeySelectorActorActor(sks, ryw, ks, boundary, actualOffset, result, cache)); - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" SpecialKeySpace::SpecialKeySpace(KeyRef spaceStartKey, KeyRef spaceEndKey, bool testOnly) : readImpls(nullptr, spaceEndKey), @@ -934,30 +921,30 @@ void SpecialKeySpace::modulesBoundaryInit() { } } - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" // This generated class is to be used only via checkRYWValid() - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class SpecialKeySpace_CheckRYWValidActorState { - #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" SpecialKeySpace_CheckRYWValidActorState(SpecialKeySpace* const& sks,ReadYourWritesTransaction* const& ryw,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Reverse const& reverse) - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : sks(sks), - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw(ryw), - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" begin(begin), - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" end(end), - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" limits(limits), - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" reverse(reverse) - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("checkRYWValid", reinterpret_cast(this)); @@ -970,24 +957,24 @@ class SpecialKeySpace_CheckRYWValidActorState { int a_body1(int loopDepth=0) { try { - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(ryw); - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_0 = SpecialKeySpace::getRangeAggregationActor(sks, ryw, begin, end, limits, reverse); - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_1 = ryw->resetFuture(); - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1008,9 +995,9 @@ class SpecialKeySpace_CheckRYWValidActorState { } int a_body1when1(RangeResult const& result,int loopDepth) { - #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~SpecialKeySpace_CheckRYWValidActorState(); static_cast(this)->destroy(); return 0; } - #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~SpecialKeySpace_CheckRYWValidActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1020,9 +1007,9 @@ class SpecialKeySpace_CheckRYWValidActorState { } int a_body1when1(RangeResult && result,int loopDepth) { - #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~SpecialKeySpace_CheckRYWValidActorState(); static_cast(this)->destroy(); return 0; } - #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~SpecialKeySpace_CheckRYWValidActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1032,17 +1019,17 @@ class SpecialKeySpace_CheckRYWValidActorState { } int a_body1when2(Void const& _,int loopDepth) { - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(internal_error(), loopDepth); - #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" return loopDepth; } int a_body1when2(Void && _,int loopDepth) { - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(internal_error(), loopDepth); - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" return loopDepth; } @@ -1143,24 +1130,24 @@ class SpecialKeySpace_CheckRYWValidActorState { fdb_probe_actor_exit("checkRYWValid", reinterpret_cast(this), 1); } - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" SpecialKeySpace* sks; - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeySelector begin; - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeySelector end; - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetRangeLimits limits; - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Reverse reverse; - #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via checkRYWValid() - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class SpecialKeySpace_CheckRYWValidActor final : public Actor, public ActorCallback< SpecialKeySpace_CheckRYWValidActor, 0, RangeResult >, public ActorCallback< SpecialKeySpace_CheckRYWValidActor, 1, Void >, public FastAllocated, public SpecialKeySpace_CheckRYWValidActorState { - #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1170,9 +1157,9 @@ class SpecialKeySpace_CheckRYWValidActor final : public Actor, publ #pragma clang diagnostic pop friend struct ActorCallback< SpecialKeySpace_CheckRYWValidActor, 0, RangeResult >; friend struct ActorCallback< SpecialKeySpace_CheckRYWValidActor, 1, Void >; - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" SpecialKeySpace_CheckRYWValidActor(SpecialKeySpace* const& sks,ReadYourWritesTransaction* const& ryw,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Reverse const& reverse) - #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), SpecialKeySpace_CheckRYWValidActorState(sks, ryw, begin, end, limits, reverse) { @@ -1195,53 +1182,53 @@ friend struct ActorCallback< SpecialKeySpace_CheckRYWValidActor, 1, Void >; } }; - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future SpecialKeySpace::checkRYWValid( SpecialKeySpace* const& sks, ReadYourWritesTransaction* const& ryw, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Reverse const& reverse ) { - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new SpecialKeySpace_CheckRYWValidActor(sks, ryw, begin, end, limits, reverse)); - #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" // This generated class is to be used only via getRangeAggregationActor() - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class SpecialKeySpace_GetRangeAggregationActorActorState { - #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" SpecialKeySpace_GetRangeAggregationActorActorState(SpecialKeySpace* const& sks,ReadYourWritesTransaction* const& ryw,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Reverse const& reverse) - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : sks(sks), - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw(ryw), - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" begin(begin), - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" end(end), - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" limits(limits), - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" reverse(reverse), - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result(), - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" pairs(), - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" iter(), - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" actualBeginOffset(), - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" actualEndOffset(), - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" moduleBoundary(), - #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" cache(Optional(), specialKeys.end) - #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("getRangeAggregationActor", reinterpret_cast(this)); @@ -1254,56 +1241,56 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { int a_body1(int loopDepth=0) { try { - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (ryw->specialKeySpaceRelaxed()) - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" moduleBoundary = sks->range; - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto beginIter = sks->getModules().rangeContaining(begin.getKey()); - #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (beginIter->begin() <= end.getKey() && end.getKey() <= beginIter->end()) - #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (beginIter->value() == SpecialKeySpace::MODULE::UNKNOWN) - #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(special_keys_no_module_found(), loopDepth); - #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" moduleBoundary = beginIter->range(); - #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } else { - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" TraceEvent(SevInfo, "SpecialKeyCrossModuleRead") .detail("Begin", begin) .detail("End", end) .detail("BoundaryBegin", beginIter->begin()) .detail("BoundaryEnd", beginIter->end()); - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(special_keys_cross_module_read(), loopDepth); - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_0 = normalizeKeySelectorActor(sks, ryw, &begin, moduleBoundary, &actualBeginOffset, &result, &cache); - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1324,32 +1311,32 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_1 = normalizeKeySelectorActor(sks, ryw, &end, moduleBoundary, &actualEndOffset, &result, &cache); - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_1 = normalizeKeySelectorActor(sks, ryw, &end, moduleBoundary, &actualEndOffset, &result, &cache); - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1419,52 +1406,74 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { } int a_body1cont8(Void const& _,int loopDepth) { - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (actualBeginOffset >= actualEndOffset && begin.getKey() >= end.getKey()) - #line 1424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - TEST(true); - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + CODE_PROBE(true, "inverted range"); + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(false, false)); this->~SpecialKeySpace_GetRangeAggregationActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(false, false)); this->~SpecialKeySpace_GetRangeAggregationActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (begin.getKey() == moduleBoundary.end || end.getKey() == moduleBoundary.begin) - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - TEST(true); - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + CODE_PROBE(true, "query touches begin or end"); + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~SpecialKeySpace_GetRangeAggregationActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(result)); // state_var_RVO this->~SpecialKeySpace_GetRangeAggregationActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ranges = sks->getReadImpls().intersectingRanges(KeyRangeRef(begin.getKey(), end.getKey())); - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (ryw->getTenant().present()) + #line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + for( auto iter : ranges ) { + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (iter->value() == nullptr) + #line 1447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + continue; + } + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!iter->value()->supportsTenants()) + #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + return a_body1Catch1(illegal_tenant_access(), loopDepth); + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + } + } + } + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" iter = reverse ? ranges.end() : ranges.begin(); - #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (reverse) - #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ; - #line 1460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont8loopHead1(loopDepth); } else { - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" iter = ranges.begin(); - #line 1467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont8loopHead2(loopDepth); } @@ -1472,52 +1481,74 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { } int a_body1cont8(Void && _,int loopDepth) { - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (actualBeginOffset >= actualEndOffset && begin.getKey() >= end.getKey()) - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - TEST(true); - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + CODE_PROBE(true, "inverted range"); + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(RangeResultRef(false, false)); this->~SpecialKeySpace_GetRangeAggregationActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResultRef(false, false)); this->~SpecialKeySpace_GetRangeAggregationActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (begin.getKey() == moduleBoundary.end || end.getKey() == moduleBoundary.begin) - #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - TEST(true); - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + CODE_PROBE(true, "query touches begin or end"); + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~SpecialKeySpace_GetRangeAggregationActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(result)); // state_var_RVO this->~SpecialKeySpace_GetRangeAggregationActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ranges = sks->getReadImpls().intersectingRanges(KeyRangeRef(begin.getKey(), end.getKey())); - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (ryw->getTenant().present()) + #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + for( auto iter : ranges ) { + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (iter->value() == nullptr) + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + continue; + } + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!iter->value()->supportsTenants()) + #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + return a_body1Catch1(illegal_tenant_access(), loopDepth); + #line 1532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + } + } + } + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" iter = reverse ? ranges.end() : ranges.begin(); - #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (reverse) - #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ; - #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont8loopHead1(loopDepth); } else { - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" iter = ranges.begin(); - #line 1520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont8loopHead2(loopDepth); } @@ -1588,9 +1619,9 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { } int a_body1cont9(int loopDepth) { - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~SpecialKeySpace_GetRangeAggregationActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(result)); // state_var_RVO this->~SpecialKeySpace_GetRangeAggregationActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1598,7 +1629,7 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { return loopDepth; } - int a_body1cont12(int loopDepth) + int a_body1cont16(int loopDepth) { loopDepth = a_body1cont9(loopDepth); @@ -1613,56 +1644,56 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { } int a_body1cont8loopBody1(int loopDepth) { - #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!(iter != ranges.begin())) - #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { return a_body1cont8break1(loopDepth==0?0:loopDepth-1); // break } - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" --iter; - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (iter->value() == nullptr) - #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { return a_body1cont8loopHead1(loopDepth); // continue } - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr = iter->range(); - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef keyStart = kr.contains(begin.getKey()) ? begin.getKey() : kr.begin; - #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef keyEnd = kr.contains(end.getKey()) ? end.getKey() : kr.end; - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (iter->value()->isAsync() && cache.rangeContaining(keyStart).value().present()) - #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" const SpecialKeyRangeAsyncImpl* ptr = dynamic_cast(iter->value()); - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_2 = ptr->getRange(ryw, KeyRangeRef(keyStart, keyEnd), limits, &cache); - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } else { - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_3 = iter->value()->getRange(ryw, KeyRangeRef(keyStart, keyEnd), limits); - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody1when2(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } @@ -1671,7 +1702,7 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { int a_body1cont8break1(int loopDepth) { try { - return a_body1cont12(loopDepth); + return a_body1cont16(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -1683,27 +1714,27 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { } int a_body1cont8loopBody1cont1(int loopDepth) { - #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.arena().dependsOn(pairs.arena()); - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(int i = pairs.size() - 1;i >= 0;--i) { - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(iter->range().contains(pairs[i].key)); - #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back(result.arena(), pairs[i]); - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" limits.decrement(pairs[i]); - #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (limits.isReached()) - #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.more = true; - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.readToBegin = false; - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~SpecialKeySpace_GetRangeAggregationActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(result)); // state_var_RVO this->~SpecialKeySpace_GetRangeAggregationActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1716,18 +1747,18 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { } int a_body1cont8loopBody1cont4(RangeResult const& pairs_,int loopDepth) { - #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" pairs = pairs_; - #line 1721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont8loopBody1cont1(loopDepth); return loopDepth; } int a_body1cont8loopBody1cont4(RangeResult && pairs_,int loopDepth) { - #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" pairs = pairs_; - #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont8loopBody1cont1(loopDepth); return loopDepth; @@ -1797,18 +1828,18 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { } int a_body1cont8loopBody1cont6(RangeResult const& pairs_,int loopDepth) { - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" pairs = pairs_; - #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont8loopBody1cont1(loopDepth); return loopDepth; } int a_body1cont8loopBody1cont6(RangeResult && pairs_,int loopDepth) { - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" pairs = pairs_; - #line 1811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont8loopBody1cont1(loopDepth); return loopDepth; @@ -1876,7 +1907,7 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { fdb_probe_actor_exit("getRangeAggregationActor", reinterpret_cast(this), 3); } - int a_body1cont13(int loopDepth) + int a_body1cont17(int loopDepth) { loopDepth = a_body1cont9(loopDepth); @@ -1891,54 +1922,54 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { } int a_body1cont8loopBody2(int loopDepth) { - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!(iter != ranges.end())) - #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { return a_body1cont8break2(loopDepth==0?0:loopDepth-1); // break } - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (iter->value() == nullptr) - #line 1902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { return a_body1cont8continue1(loopDepth); // continue } - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr = iter->range(); - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef keyStart = kr.contains(begin.getKey()) ? begin.getKey() : kr.begin; - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef keyEnd = kr.contains(end.getKey()) ? end.getKey() : kr.end; - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (iter->value()->isAsync() && cache.rangeContaining(keyStart).value().present()) - #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" const SpecialKeyRangeAsyncImpl* ptr = dynamic_cast(iter->value()); - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_4 = ptr->getRange(ryw, KeyRangeRef(keyStart, keyEnd), limits, &cache); - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody2when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } else { - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_5 = iter->value()->getRange(ryw, KeyRangeRef(keyStart, keyEnd), limits); - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont8loopBody2when2(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } @@ -1947,7 +1978,7 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { int a_body1cont8break2(int loopDepth) { try { - return a_body1cont13(loopDepth); + return a_body1cont17(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -1959,63 +1990,63 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { } int a_body1cont8continue1(int loopDepth) { - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ++iter; - #line 1964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (loopDepth == 0) return a_body1cont8loopHead2(0); return loopDepth; } int a_body1cont8loopBody2cont1(int loopDepth) { - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.arena().dependsOn(pairs.arena()); - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(int i = 0;i < pairs.size();++i) { - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(iter->range().contains(pairs[i].key)); - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back(result.arena(), pairs[i]); - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" limits.decrement(pairs[i]); - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (limits.isReached()) - #line 1983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.more = true; - #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.readThroughEnd = false; - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~SpecialKeySpace_GetRangeAggregationActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(result)); // state_var_RVO this->~SpecialKeySpace_GetRangeAggregationActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ++iter; - #line 2000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (loopDepth == 0) return a_body1cont8loopHead2(0); return loopDepth; } int a_body1cont8loopBody2cont4(RangeResult const& pairs_,int loopDepth) { - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" pairs = pairs_; - #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont8loopBody2cont1(loopDepth); return loopDepth; } int a_body1cont8loopBody2cont4(RangeResult && pairs_,int loopDepth) { - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" pairs = pairs_; - #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont8loopBody2cont1(loopDepth); return loopDepth; @@ -2085,18 +2116,18 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { } int a_body1cont8loopBody2cont6(RangeResult const& pairs_,int loopDepth) { - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" pairs = pairs_; - #line 2090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont8loopBody2cont1(loopDepth); return loopDepth; } int a_body1cont8loopBody2cont6(RangeResult && pairs_,int loopDepth) { - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" pairs = pairs_; - #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont8loopBody2cont1(loopDepth); return loopDepth; @@ -2164,40 +2195,40 @@ class SpecialKeySpace_GetRangeAggregationActorActorState { fdb_probe_actor_exit("getRangeAggregationActor", reinterpret_cast(this), 5); } - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" SpecialKeySpace* sks; - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeySelector begin; - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeySelector end; - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetRangeLimits limits; - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Reverse reverse; - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult pairs; - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeMap::iterator iter; - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int actualBeginOffset; - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int actualEndOffset; - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef moduleBoundary; - #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeMap> cache; - #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeMap::Ranges ranges; - #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via getRangeAggregationActor() - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class SpecialKeySpace_GetRangeAggregationActorActor final : public Actor, public ActorCallback< SpecialKeySpace_GetRangeAggregationActorActor, 0, Void >, public ActorCallback< SpecialKeySpace_GetRangeAggregationActorActor, 1, Void >, public ActorCallback< SpecialKeySpace_GetRangeAggregationActorActor, 2, RangeResult >, public ActorCallback< SpecialKeySpace_GetRangeAggregationActorActor, 3, RangeResult >, public ActorCallback< SpecialKeySpace_GetRangeAggregationActorActor, 4, RangeResult >, public ActorCallback< SpecialKeySpace_GetRangeAggregationActorActor, 5, RangeResult >, public FastAllocated, public SpecialKeySpace_GetRangeAggregationActorActorState { - #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2211,9 +2242,9 @@ friend struct ActorCallback< SpecialKeySpace_GetRangeAggregationActorActor, 2, R friend struct ActorCallback< SpecialKeySpace_GetRangeAggregationActorActor, 3, RangeResult >; friend struct ActorCallback< SpecialKeySpace_GetRangeAggregationActorActor, 4, RangeResult >; friend struct ActorCallback< SpecialKeySpace_GetRangeAggregationActorActor, 5, RangeResult >; - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" SpecialKeySpace_GetRangeAggregationActorActor(SpecialKeySpace* const& sks,ReadYourWritesTransaction* const& ryw,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Reverse const& reverse) - #line 2216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), SpecialKeySpace_GetRangeAggregationActorActorState(sks, ryw, begin, end, limits, reverse) { @@ -2241,14 +2272,14 @@ friend struct ActorCallback< SpecialKeySpace_GetRangeAggregationActorActor, 5, R } }; - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future SpecialKeySpace::getRangeAggregationActor( SpecialKeySpace* const& sks, ReadYourWritesTransaction* const& ryw, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Reverse const& reverse ) { - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new SpecialKeySpace_GetRangeAggregationActorActor(sks, ryw, begin, end, limits, reverse)); - #line 2248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Future SpecialKeySpace::getRange(ReadYourWritesTransaction* ryw, KeySelector begin, @@ -2259,7 +2290,7 @@ Future SpecialKeySpace::getRange(ReadYourWritesTransaction* ryw, if (!limits.isValid()) return range_limits_invalid(); if (limits.isReached()) { - TEST(true); // read limit 0 + CODE_PROBE(true, "Special Key Space range read limit 0"); return RangeResult(); } // make sure orEqual == false @@ -2267,31 +2298,31 @@ Future SpecialKeySpace::getRange(ReadYourWritesTransaction* ryw, end.removeOrEqual(end.arena()); if (begin.offset >= end.offset && begin.getKey() >= end.getKey()) { - TEST(true); // range inverted + CODE_PROBE(true, "range inverted"); return RangeResult(); } return checkRYWValid(this, ryw, begin, end, limits, reverse); } - #line 2277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" // This generated class is to be used only via getActor() - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class SpecialKeySpace_GetActorActorState { - #line 2283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" SpecialKeySpace_GetActorActorState(SpecialKeySpace* const& sks,ReadYourWritesTransaction* const& ryw,KeyRef const& key) - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : sks(sks), - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw(ryw), - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" key(key) - #line 2294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("getActor", reinterpret_cast(this)); @@ -2304,16 +2335,16 @@ class SpecialKeySpace_GetActorActorState { int a_body1(int loopDepth=0) { try { - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_0 = sks->getRange(ryw, KeySelector(firstGreaterOrEqual(key)), KeySelector(firstGreaterOrEqual(keyAfter(key))), GetRangeLimits(CLIENT_KNOBS->TOO_MANY), Reverse::False); - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2334,15 +2365,15 @@ class SpecialKeySpace_GetActorActorState { } int a_body1cont1(RangeResult const& result,int loopDepth) { - #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(result.size() <= 1); - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (result.size()) - #line 2341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional(result[0].value)); this->~SpecialKeySpace_GetActorActorState(); static_cast(this)->destroy(); return 0; } - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(result[0].value)); this->~SpecialKeySpace_GetActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2350,9 +2381,9 @@ class SpecialKeySpace_GetActorActorState { } else { - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~SpecialKeySpace_GetActorActorState(); static_cast(this)->destroy(); return 0; } - #line 2355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~SpecialKeySpace_GetActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2363,15 +2394,15 @@ class SpecialKeySpace_GetActorActorState { } int a_body1cont1(RangeResult && result,int loopDepth) { - #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(result.size() <= 1); - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (result.size()) - #line 2370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional(result[0].value)); this->~SpecialKeySpace_GetActorActorState(); static_cast(this)->destroy(); return 0; } - #line 2374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(result[0].value)); this->~SpecialKeySpace_GetActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2379,9 +2410,9 @@ class SpecialKeySpace_GetActorActorState { } else { - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~SpecialKeySpace_GetActorActorState(); static_cast(this)->destroy(); return 0; } - #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~SpecialKeySpace_GetActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2453,18 +2484,18 @@ class SpecialKeySpace_GetActorActorState { fdb_probe_actor_exit("getActor", reinterpret_cast(this), 0); } - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" SpecialKeySpace* sks; - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef key; - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via getActor() - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class SpecialKeySpace_GetActorActor final : public Actor>, public ActorCallback< SpecialKeySpace_GetActorActor, 0, RangeResult >, public FastAllocated, public SpecialKeySpace_GetActorActorState { - #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2473,9 +2504,9 @@ class SpecialKeySpace_GetActorActor final : public Actor>, publi void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< SpecialKeySpace_GetActorActor, 0, RangeResult >; - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" SpecialKeySpace_GetActorActor(SpecialKeySpace* const& sks,ReadYourWritesTransaction* const& ryw,KeyRef const& key) - #line 2478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor>(), SpecialKeySpace_GetActorActorState(sks, ryw, key) { @@ -2498,14 +2529,14 @@ friend struct ActorCallback< SpecialKeySpace_GetActorActor, 0, RangeResult >; } }; - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future> SpecialKeySpace::getActor( SpecialKeySpace* const& sks, ReadYourWritesTransaction* const& ryw, KeyRef const& key ) { - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future>(new SpecialKeySpace_GetActorActor(sks, ryw, key)); - #line 2505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Future> SpecialKeySpace::get(ReadYourWritesTransaction* ryw, const Key& key) { return getActor(this, ryw, key); @@ -2521,6 +2552,9 @@ void SpecialKeySpace::set(ReadYourWritesTransaction* ryw, const KeyRef& key, con .detail("Value", value.toString()); throw special_keys_no_write_module_found(); } + if (!impl->supportsTenants() && ryw->getTenant().present()) { + throw illegal_tenant_access(); + } return impl->set(ryw, key, value); } @@ -2538,6 +2572,9 @@ void SpecialKeySpace::clear(ReadYourWritesTransaction* ryw, const KeyRangeRef& r TraceEvent(SevDebug, "SpecialKeySpaceNoWriteModuleFound").detail("Range", range); throw special_keys_no_write_module_found(); } + if (!begin->supportsTenants() && ryw->getTenant().present()) { + throw illegal_tenant_access(); + } return begin->clear(ryw, range); } @@ -2547,6 +2584,9 @@ void SpecialKeySpace::clear(ReadYourWritesTransaction* ryw, const KeyRef& key) { auto impl = writeImpls[key]; if (impl == nullptr) throw special_keys_no_write_module_found(); + if (!impl->supportsTenants() && ryw->getTenant().present()) { + throw illegal_tenant_access(); + } return impl->clear(ryw, key); } @@ -2558,8 +2598,8 @@ bool validateSnakeCaseNaming(const KeyRef& k) { // Suffix can be \xff\xff or \x00 in single key range if (key.endsWith(specialKeys.begin)) key = key.removeSuffix(specialKeys.end); - else if (key.endsWith(LiteralStringRef("\x00"))) - key = key.removeSuffix(LiteralStringRef("\x00")); + else if (key.endsWith("\x00"_sr)) + key = key.removeSuffix("\x00"_sr); for (const char& c : key.toString()) { // only small letters, numbers, '/', '_' is allowed ASSERT((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '/' || c == '_'); @@ -2571,6 +2611,8 @@ void SpecialKeySpace::registerKeyRange(SpecialKeySpace::MODULE module, SpecialKeySpace::IMPLTYPE type, const KeyRangeRef& kr, SpecialKeyRangeReadImpl* impl) { + // Not allowed to register an empty range + ASSERT(!kr.empty()); // module boundary check if (module == SpecialKeySpace::MODULE::TESTONLY) { ASSERT(normalKeys.contains(kr)); @@ -2614,29 +2656,29 @@ KeyRange SpecialKeySpace::decode(const KeyRangeRef& kr) { return KeyRangeRef(begin->value()->decode(kr.begin), begin->value()->decode(kr.end)); } - #line 2617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via commitActor() - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class CommitActorActorState { - #line 2624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" CommitActorActorState(SpecialKeySpace* const& sks,ReadYourWritesTransaction* const& ryw) - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : sks(sks), - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw(ryw), - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ranges(ryw->getSpecialKeySpaceWriteMap().containedRanges(specialKeys)), - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" iter(ranges.begin()), - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" writeModulePtrs() - #line 2639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("commitActor", reinterpret_cast(this)); @@ -2649,38 +2691,54 @@ class CommitActorActorState { int a_body1(int loopDepth=0) { try { - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::unordered_set deduplicate; - #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(;iter != ranges.end();) { - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::pair> entry = iter->value(); - #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (entry.first) - #line 2660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto modulePtr = sks->getRWImpls().rangeContaining(iter->begin())->value(); - #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto [_, inserted] = deduplicate.insert(modulePtr); - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (inserted) - #line 2668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" writeModulePtrs.push_back(modulePtr); - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ++iter; - #line 2677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" it = std::vector::const_iterator(); - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (ryw->getTenant().present()) + #line 2725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + for(it = writeModulePtrs.begin();it != writeModulePtrs.end();++it) { + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!(*it)->supportsTenants()) + #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + return a_body1Catch1(illegal_tenant_access(), loopDepth); + #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + } + } + } + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" it = writeModulePtrs.begin(); - #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2701,9 +2759,9 @@ class CommitActorActorState { } int a_body1cont1(int loopDepth) { - #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 2706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2720,22 +2778,22 @@ class CommitActorActorState { } int a_body1loopBody1(int loopDepth) { - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!(it != writeModulePtrs.end())) - #line 2725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = (*it)->commit(ryw); - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2755,42 +2813,42 @@ class CommitActorActorState { } int a_body1loopBody1cont1(Optional const& msg,int loopDepth) { - #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (msg.present()) - #line 2760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->setSpecialKeySpaceErrorMsg(msg.get()); - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" TraceEvent(SevDebug, "SpecialKeySpaceManagementAPIError") .detail("Reason", msg.get()) .detail("Range", (*it)->getKeyRange().toString()); - #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(special_keys_api_failure(), std::max(0, loopDepth - 1)); - #line 2768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ++it; - #line 2772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(Optional && msg,int loopDepth) { - #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (msg.present()) - #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->setSpecialKeySpaceErrorMsg(msg.get()); - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" TraceEvent(SevDebug, "SpecialKeySpaceManagementAPIError") .detail("Reason", msg.get()) .detail("Range", (*it)->getKeyRange().toString()); - #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(special_keys_api_failure(), std::max(0, loopDepth - 1)); - #line 2789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ++it; - #line 2793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -2858,24 +2916,24 @@ class CommitActorActorState { fdb_probe_actor_exit("commitActor", reinterpret_cast(this), 0); } - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" SpecialKeySpace* sks; - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeMap>, KeyRangeRef>::Ranges ranges; - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeMap>, KeyRangeRef>::iterator iter; - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::vector writeModulePtrs; - #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::vector::const_iterator it; - #line 2873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via commitActor() - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class CommitActorActor final : public Actor, public ActorCallback< CommitActorActor, 0, Optional >, public FastAllocated, public CommitActorActorState { - #line 2878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2884,9 +2942,9 @@ class CommitActorActor final : public Actor, public ActorCallback< CommitA void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< CommitActorActor, 0, Optional >; - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" CommitActorActor(SpecialKeySpace* const& sks,ReadYourWritesTransaction* const& ryw) - #line 2889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), CommitActorActorState(sks, ryw) { @@ -2910,14 +2968,14 @@ friend struct ActorCallback< CommitActorActor, 0, Optional >; } }; } - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future commitActor( SpecialKeySpace* const& sks, ReadYourWritesTransaction* const& ryw ) { - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new CommitActorActor(sks, ryw)); - #line 2917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Future SpecialKeySpace::commit(ReadYourWritesTransaction* ryw) { return commitActor(this, ryw); @@ -2959,23 +3017,23 @@ Future SKSCTestAsyncReadImpl::getRange(ReadYourWritesTransaction* r ReadConflictRangeImpl::ReadConflictRangeImpl(KeyRangeRef kr) : SpecialKeyRangeReadImpl(kr) {} - #line 2962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via getReadConflictRangeImpl() - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GetReadConflictRangeImplActorState { - #line 2969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetReadConflictRangeImplActorState(ReadYourWritesTransaction* const& ryw,KeyRange const& kr) - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr) - #line 2978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("getReadConflictRangeImpl", reinterpret_cast(this)); @@ -2988,16 +3046,16 @@ class GetReadConflictRangeImplActorState { int a_body1(int loopDepth=0) { try { - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_0 = ryw->pendingReads(); - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3018,9 +3076,9 @@ class GetReadConflictRangeImplActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(ryw->getReadConflictRangeIntersecting(kr)); this->~GetReadConflictRangeImplActorState(); static_cast(this)->destroy(); return 0; } - #line 3023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(ryw->getReadConflictRangeIntersecting(kr)); this->~GetReadConflictRangeImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3030,9 +3088,9 @@ class GetReadConflictRangeImplActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(ryw->getReadConflictRangeIntersecting(kr)); this->~GetReadConflictRangeImplActorState(); static_cast(this)->destroy(); return 0; } - #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(ryw->getReadConflictRangeIntersecting(kr)); this->~GetReadConflictRangeImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3103,16 +3161,16 @@ class GetReadConflictRangeImplActorState { fdb_probe_actor_exit("getReadConflictRangeImpl", reinterpret_cast(this), 0); } - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRange kr; - #line 3110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via getReadConflictRangeImpl() - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GetReadConflictRangeImplActor final : public Actor, public ActorCallback< GetReadConflictRangeImplActor, 0, Void >, public FastAllocated, public GetReadConflictRangeImplActorState { - #line 3115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3121,9 +3179,9 @@ class GetReadConflictRangeImplActor final : public Actor, public Ac void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetReadConflictRangeImplActor, 0, Void >; - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetReadConflictRangeImplActor(ReadYourWritesTransaction* const& ryw,KeyRange const& kr) - #line 3126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), GetReadConflictRangeImplActorState(ryw, kr) { @@ -3147,14 +3205,14 @@ friend struct ActorCallback< GetReadConflictRangeImplActor, 0, Void >; } }; } - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] static Future getReadConflictRangeImpl( ReadYourWritesTransaction* const& ryw, KeyRange const& kr ) { - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new GetReadConflictRangeImplActor(ryw, kr)); - #line 3154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Future ReadConflictRangeImpl::getRange(ReadYourWritesTransaction* ryw, KeyRangeRef kr, @@ -3192,23 +3250,23 @@ Future ConflictingKeysImpl::getRange(ReadYourWritesTransaction* ryw return result; } - #line 3195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via ddMetricsGetRangeActor() - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class DdMetricsGetRangeActorActorState { - #line 3202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" DdMetricsGetRangeActorActorState(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr) - #line 3211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("ddMetricsGetRangeActor", reinterpret_cast(this)); @@ -3221,9 +3279,9 @@ class DdMetricsGetRangeActorActorState { int a_body1(int loopDepth=0) { try { - #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ; - #line 3226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -3252,18 +3310,18 @@ class DdMetricsGetRangeActorActorState { int a_body1loopBody1(int loopDepth) { try { - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto keys = kr.removePrefix(ddStatsRange.begin); - #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - StrictFuture>> __when_expr_0 = waitDataDistributionMetricsList(ryw->getDatabase(), keys, CLIENT_KNOBS->STORAGE_METRICS_SHARD_LIMIT); - #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + StrictFuture>> __when_expr_0 = waitDataDistributionMetricsList(ryw->getDatabase(), keys, CLIENT_KNOBS->TOO_MANY); + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); - #line 3266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3277,24 +3335,24 @@ class DdMetricsGetRangeActorActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" err = Error(e); - #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (e.code() == error_code_dd_not_found) - #line 3284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" TraceEvent(SevWarnAlways, "DataDistributorNotPresent") .detail("Operation", "DDMetricsReqestThroughSpecialKeys"); - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_1 = delayJittered(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY); - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } else @@ -3312,27 +3370,27 @@ class DdMetricsGetRangeActorActorState { } int a_body1loopBody1cont2(Standalone> const& resultWithoutPrefix,int loopDepth) { - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& ddMetricsRef : resultWithoutPrefix ) { - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef beginKey = ddMetricsRef.beginKey.withPrefix(ddStatsRange.begin, result.arena()); - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" json_spirit::mObject statsObj; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" statsObj["shard_bytes"] = ddMetricsRef.shardBytes; - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string statsString = json_spirit::write_string(json_spirit::mValue(statsObj), json_spirit::Output_options::raw_utf8); - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ValueRef bytes(result.arena(), statsString); - #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back(result.arena(), KeyValueRef(beginKey, bytes)); - #line 3331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~DdMetricsGetRangeActorActorState(); static_cast(this)->destroy(); return 0; } - #line 3335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~DdMetricsGetRangeActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3342,27 +3400,27 @@ class DdMetricsGetRangeActorActorState { } int a_body1loopBody1cont2(Standalone> && resultWithoutPrefix,int loopDepth) { - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& ddMetricsRef : resultWithoutPrefix ) { - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef beginKey = ddMetricsRef.beginKey.withPrefix(ddStatsRange.begin, result.arena()); - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" json_spirit::mObject statsObj; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" statsObj["shard_bytes"] = ddMetricsRef.shardBytes; - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string statsString = json_spirit::write_string(json_spirit::mValue(statsObj), json_spirit::Output_options::raw_utf8); - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ValueRef bytes(result.arena(), statsString); - #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back(result.arena(), KeyValueRef(beginKey, bytes)); - #line 3361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~DdMetricsGetRangeActorActorState(); static_cast(this)->destroy(); return 0; } - #line 3365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~DdMetricsGetRangeActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3435,9 +3493,9 @@ class DdMetricsGetRangeActorActorState { } int a_body1loopBody1Catch1cont1(int loopDepth) { - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(err, std::max(0, loopDepth - 1)); - #line 3440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" return loopDepth; } @@ -3516,18 +3574,18 @@ class DdMetricsGetRangeActorActorState { fdb_probe_actor_exit("ddMetricsGetRangeActor", reinterpret_cast(this), 1); } - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - KeyRangeRef kr; #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + KeyRangeRef kr; + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Error err; - #line 3525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via ddMetricsGetRangeActor() - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class DdMetricsGetRangeActorActor final : public Actor, public ActorCallback< DdMetricsGetRangeActorActor, 0, Standalone> >, public ActorCallback< DdMetricsGetRangeActorActor, 1, Void >, public FastAllocated, public DdMetricsGetRangeActorActorState { - #line 3530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3537,9 +3595,9 @@ class DdMetricsGetRangeActorActor final : public Actor, public Acto #pragma clang diagnostic pop friend struct ActorCallback< DdMetricsGetRangeActorActor, 0, Standalone> >; friend struct ActorCallback< DdMetricsGetRangeActorActor, 1, Void >; - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" DdMetricsGetRangeActorActor(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 3542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), DdMetricsGetRangeActorActorState(ryw, kr) { @@ -3564,14 +3622,14 @@ friend struct ActorCallback< DdMetricsGetRangeActorActor, 1, Void >; } }; } - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future ddMetricsGetRangeActor( ReadYourWritesTransaction* const& ryw, KeyRangeRef const& kr ) { - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new DdMetricsGetRangeActorActor(ryw, kr)); - #line 3571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" DDStatsRangeImpl::DDStatsRangeImpl(KeyRangeRef kr) : SpecialKeyRangeAsyncImpl(kr) {} @@ -3582,7 +3640,7 @@ Future DDStatsRangeImpl::getRange(ReadYourWritesTransaction* ryw, } Key SpecialKeySpace::getManagementApiCommandOptionSpecialKey(const std::string& command, const std::string& option) { - Key prefix = LiteralStringRef("options/").withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin); + Key prefix = "options/"_sr.withPrefix(moduleToBoundary[MODULE::MANAGEMENT].begin); auto pair = command + "/" + option; ASSERT(options.find(pair) != options.end()); return prefix.withSuffix(pair); @@ -3685,25 +3743,25 @@ RangeResult rywGetRange(ReadYourWritesTransaction* ryw, const KeyRangeRef& kr, c } // read from those readwrite modules in which special keys have one-to-one mapping with real persisted keys - #line 3688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via rwModuleWithMappingGetRangeActor() - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class RwModuleWithMappingGetRangeActorActorState { - #line 3695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RwModuleWithMappingGetRangeActorActorState(ReadYourWritesTransaction* const& ryw,const SpecialKeyRangeRWImpl* const& impl,KeyRangeRef const& kr) - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" impl(impl), - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr) - #line 3706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("rwModuleWithMappingGetRangeActor", reinterpret_cast(this)); @@ -3716,16 +3774,16 @@ class RwModuleWithMappingGetRangeActorActorState { int a_body1(int loopDepth=0) { try { - #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_0 = ryw->getTransaction().getRange(ryw->getDatabase()->specialKeySpace->decode(kr), CLIENT_KNOBS->TOO_MANY); - #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3746,19 +3804,19 @@ class RwModuleWithMappingGetRangeActorActorState { } int a_body1cont1(RangeResult const& resultWithoutPrefix,int loopDepth) { - #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(!resultWithoutPrefix.more && resultWithoutPrefix.size() < CLIENT_KNOBS->TOO_MANY); - #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const KeyValueRef& kv : resultWithoutPrefix ) { - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(impl->encode(kv.key), kv.value)); - #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(rywGetRange(ryw, kr, result)); this->~RwModuleWithMappingGetRangeActorActorState(); static_cast(this)->destroy(); return 0; } - #line 3761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(rywGetRange(ryw, kr, result)); this->~RwModuleWithMappingGetRangeActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3768,19 +3826,19 @@ class RwModuleWithMappingGetRangeActorActorState { } int a_body1cont1(RangeResult && resultWithoutPrefix,int loopDepth) { - #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(!resultWithoutPrefix.more && resultWithoutPrefix.size() < CLIENT_KNOBS->TOO_MANY); - #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const KeyValueRef& kv : resultWithoutPrefix ) { - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(impl->encode(kv.key), kv.value)); - #line 3779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(rywGetRange(ryw, kr, result)); this->~RwModuleWithMappingGetRangeActorActorState(); static_cast(this)->destroy(); return 0; } - #line 3783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(rywGetRange(ryw, kr, result)); this->~RwModuleWithMappingGetRangeActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3851,18 +3909,18 @@ class RwModuleWithMappingGetRangeActorActorState { fdb_probe_actor_exit("rwModuleWithMappingGetRangeActor", reinterpret_cast(this), 0); } - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" const SpecialKeyRangeRWImpl* impl; - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 3860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via rwModuleWithMappingGetRangeActor() - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class RwModuleWithMappingGetRangeActorActor final : public Actor, public ActorCallback< RwModuleWithMappingGetRangeActorActor, 0, RangeResult >, public FastAllocated, public RwModuleWithMappingGetRangeActorActorState { - #line 3865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3871,9 +3929,9 @@ class RwModuleWithMappingGetRangeActorActor final : public Actor, p void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< RwModuleWithMappingGetRangeActorActor, 0, RangeResult >; - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RwModuleWithMappingGetRangeActorActor(ReadYourWritesTransaction* const& ryw,const SpecialKeyRangeRWImpl* const& impl,KeyRangeRef const& kr) - #line 3876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), RwModuleWithMappingGetRangeActorActorState(ryw, impl, kr) { @@ -3897,14 +3955,14 @@ friend struct ActorCallback< RwModuleWithMappingGetRangeActorActor, 0, RangeResu } }; } - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future rwModuleWithMappingGetRangeActor( ReadYourWritesTransaction* const& ryw, const SpecialKeyRangeRWImpl* const& impl, KeyRangeRef const& kr ) { - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new RwModuleWithMappingGetRangeActorActor(ryw, impl, kr)); - #line 3904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 3962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ExcludeServersRangeImpl::ExcludeServersRangeImpl(KeyRangeRef kr) : SpecialKeyRangeRWImpl(kr) {} @@ -3922,11 +3980,11 @@ void ExcludeServersRangeImpl::set(ReadYourWritesTransaction* ryw, const KeyRef& Key ExcludeServersRangeImpl::decode(const KeyRef& key) const { return key.removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin) - .withPrefix(LiteralStringRef("\xff/conf/")); + .withPrefix("\xff/conf/"_sr); } Key ExcludeServersRangeImpl::encode(const KeyRef& key) const { - return key.removePrefix(LiteralStringRef("\xff/conf/")) + return key.removePrefix("\xff/conf/"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin); } @@ -3965,29 +4023,29 @@ bool parseNetWorkAddrFromKeys(ReadYourWritesTransaction* ryw, return true; } - #line 3968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via checkExclusion() - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class CheckExclusionActorState { - #line 3975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" CheckExclusionActorState(Database const& db,std::vector* const& addresses,std::set* const& exclusions,bool const& markFailed,Optional* const& msg) - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : db(db), - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" addresses(addresses), - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" exclusions(exclusions), - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" markFailed(markFailed), - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" msg(msg) - #line 3990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("checkExclusion", reinterpret_cast(this)); @@ -4000,24 +4058,24 @@ class CheckExclusionActorState { int a_body1(int loopDepth=0) { try { - #line 932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (markFailed) - #line 4005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" safe = bool(); - #line 4009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" try { - #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_0 = checkSafeExclusions(db, *addresses); - #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 4015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4049,33 +4107,33 @@ class CheckExclusionActorState { } int a_body1cont1(int loopDepth) { - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_1 = StatusClient::statusFetcher(db); - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(int loopDepth) { - #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!safe) - #line 4070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string temp = "ERROR: It is unsafe to exclude the specified servers at this time.\n" "Please check that this exclusion does not bring down an entire storage team.\n" "Please also ensure that the exclusion will keep a majority of coordinators alive.\n" "You may add more storage processes or coordinators to make the operation safe.\n" "Call set(\"0xff0xff/management/failed/\", ...) to exclude without " "performing safety checks.\n"; - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" *msg = ManagementAPIError::toJsonString(false, markFailed ? "exclude failed" : "exclude", temp); - #line 951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4088,19 +4146,19 @@ class CheckExclusionActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (e.code() == error_code_actor_cancelled) - #line 4093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 4097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" TraceEvent("CheckSafeExclusionsError").error(e); - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" safe = false; - #line 4103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); } catch (Error& error) { @@ -4113,18 +4171,18 @@ class CheckExclusionActorState { } int a_body1cont3(bool const& _safe,int loopDepth) { - #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" safe = _safe; - #line 4118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont5(loopDepth); return loopDepth; } int a_body1cont3(bool && _safe,int loopDepth) { - #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" safe = _safe; - #line 4127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont5(loopDepth); return loopDepth; @@ -4207,182 +4265,206 @@ class CheckExclusionActorState { } int a_body1cont8(StatusObject const& status,int loopDepth) { - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - errorString = "ERROR: Could not calculate the impact of this exclude on the total free space in the cluster.\n" "Please try the exclude again in 30 seconds.\n" "Call set(\"0xff0xff/management/options/exclude/force\", ...) first to exclude without checking free " "space.\n"; - #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + errorString = "ERROR: Could not calculate the impact of this exclude on the total available space in the cluster.\n" "Please try the exclude again in 30 seconds.\n" "Call set(\"0xff0xff/management/options/exclude/force\", ...) first to exclude without checking available " "space.\n"; + #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StatusObjectReader statusObj(status); - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StatusObjectReader statusObjCluster; - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!statusObj.get("cluster", statusObjCluster)) - #line 4218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" *msg = ManagementAPIError::toJsonString(false, markFailed ? "exclude failed" : "exclude", errorString); - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StatusObjectReader processesMap; - #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!statusObjCluster.get("processes", processesMap)) - #line 4234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" *msg = ManagementAPIError::toJsonString(false, markFailed ? "exclude failed" : "exclude", errorString); - #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ssTotalCount = 0; - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ssExcludedCount = 0; - #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" diskLocalities = std::unordered_set(); - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" totalKvStoreFreeBytes = 0; - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + totalKvStoreFreeBytesNotExcluded = 0; + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" totalKvStoreUsedBytes = 0; - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - totalKvStoreUsedBytesNonExcluded = 0; - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + totalKvStoreUsedBytesNotExcluded = 0; + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + totalKvStoreAvailableBytes = 0; + #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" excludedAddressesContainsStorageRole = false; - #line 4260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" try { - #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto proc : processesMap.obj() ) { - #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StatusObjectReader process(proc.second); - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string addrStr; - #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!process.get("address", addrStr)) - #line 4270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" *msg = ManagementAPIError::toJsonString(false, markFailed ? "exclude failed" : "exclude", errorString); - #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" NetworkAddress addr = NetworkAddress::parse(addrStr); - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool includedInExclusion = addressExcluded(*exclusions, addr); - #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool excluded = (process.has("excluded") && process.last().get_bool()) || includedInExclusion; - #line 997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StatusObjectReader localityObj; - #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string disk_id; - #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (process.get("locality", localityObj)) - #line 4294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" process.get("disk_id", disk_id); - #line 4298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StatusArray rolesArray = proc.second.get_obj()["roles"].get_array(); - #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( StatusObjectReader role : rolesArray ) { - #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (role["role"].get_str() == "storage") - #line 4306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ssTotalCount++; - #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (excluded) + #line 4374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + ssExcludedCount++; + #line 4378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + } + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!excludedAddressesContainsStorageRole && includedInExclusion) - #line 4312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" excludedAddressesContainsStorageRole = true; - #line 4316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int64_t used_bytes; - #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!role.get("kvstore_used_bytes", used_bytes)) - #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" *msg = ManagementAPIError::toJsonString( false, markFailed ? "exclude failed" : "exclude", errorString); - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int64_t free_bytes; - #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!role.get("kvstore_free_bytes", free_bytes)) - #line 4338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" *msg = ManagementAPIError::toJsonString( false, markFailed ? "exclude failed" : "exclude", errorString); - #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + int64_t available_bytes; + #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!role.get("kvstore_available_bytes", available_bytes)) + #line 4424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 1055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + *msg = ManagementAPIError::toJsonString( false, markFailed ? "exclude failed" : "exclude", errorString); + #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } + #line 4430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~CheckExclusionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" totalKvStoreUsedBytes += used_bytes; - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + totalKvStoreFreeBytes += free_bytes; + #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + totalKvStoreAvailableBytes += available_bytes; + #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!excluded) - #line 4354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - totalKvStoreUsedBytesNonExcluded += used_bytes; - #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + totalKvStoreUsedBytesNotExcluded += used_bytes; + #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (disk_id.empty() || diskLocalities.find(disk_id) == diskLocalities.end()) - #line 4360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - totalKvStoreFreeBytes += free_bytes; - #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + totalKvStoreFreeBytesNotExcluded += free_bytes; + #line 1069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!disk_id.empty()) - #line 4366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" diskLocalities.insert(disk_id); - #line 4370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } } - } - #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (excluded) - #line 4377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - { - #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ssExcludedCount++; - #line 4381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } } - loopDepth = a_body1cont25(loopDepth); + loopDepth = a_body1cont26(loopDepth); } catch (Error& error) { loopDepth = a_body1cont8Catch1(error, loopDepth); @@ -4394,182 +4476,206 @@ class CheckExclusionActorState { } int a_body1cont8(StatusObject && status,int loopDepth) { - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - errorString = "ERROR: Could not calculate the impact of this exclude on the total free space in the cluster.\n" "Please try the exclude again in 30 seconds.\n" "Call set(\"0xff0xff/management/options/exclude/force\", ...) first to exclude without checking free " "space.\n"; - #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + errorString = "ERROR: Could not calculate the impact of this exclude on the total available space in the cluster.\n" "Please try the exclude again in 30 seconds.\n" "Call set(\"0xff0xff/management/options/exclude/force\", ...) first to exclude without checking available " "space.\n"; + #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StatusObjectReader statusObj(status); - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StatusObjectReader statusObjCluster; - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!statusObj.get("cluster", statusObjCluster)) - #line 4405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" *msg = ManagementAPIError::toJsonString(false, markFailed ? "exclude failed" : "exclude", errorString); - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StatusObjectReader processesMap; - #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!statusObjCluster.get("processes", processesMap)) - #line 4421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" *msg = ManagementAPIError::toJsonString(false, markFailed ? "exclude failed" : "exclude", errorString); - #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ssTotalCount = 0; - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ssExcludedCount = 0; - #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" diskLocalities = std::unordered_set(); - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" totalKvStoreFreeBytes = 0; - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + totalKvStoreFreeBytesNotExcluded = 0; + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" totalKvStoreUsedBytes = 0; - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - totalKvStoreUsedBytesNonExcluded = 0; - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + totalKvStoreUsedBytesNotExcluded = 0; + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + totalKvStoreAvailableBytes = 0; + #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" excludedAddressesContainsStorageRole = false; - #line 4447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" try { - #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto proc : processesMap.obj() ) { - #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StatusObjectReader process(proc.second); - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string addrStr; - #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!process.get("address", addrStr)) - #line 4457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" *msg = ManagementAPIError::toJsonString(false, markFailed ? "exclude failed" : "exclude", errorString); - #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" NetworkAddress addr = NetworkAddress::parse(addrStr); - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool includedInExclusion = addressExcluded(*exclusions, addr); - #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool excluded = (process.has("excluded") && process.last().get_bool()) || includedInExclusion; - #line 997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StatusObjectReader localityObj; - #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string disk_id; - #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (process.get("locality", localityObj)) - #line 4481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" process.get("disk_id", disk_id); - #line 4485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StatusArray rolesArray = proc.second.get_obj()["roles"].get_array(); - #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( StatusObjectReader role : rolesArray ) { - #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (role["role"].get_str() == "storage") - #line 4493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ssTotalCount++; - #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (excluded) + #line 4585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + ssExcludedCount++; + #line 4589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + } + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!excludedAddressesContainsStorageRole && includedInExclusion) - #line 4499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" excludedAddressesContainsStorageRole = true; - #line 4503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int64_t used_bytes; - #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!role.get("kvstore_used_bytes", used_bytes)) - #line 4509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" *msg = ManagementAPIError::toJsonString( false, markFailed ? "exclude failed" : "exclude", errorString); - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int64_t free_bytes; - #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!role.get("kvstore_free_bytes", free_bytes)) - #line 4525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" *msg = ManagementAPIError::toJsonString( false, markFailed ? "exclude failed" : "exclude", errorString); - #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + int64_t available_bytes; + #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!role.get("kvstore_available_bytes", available_bytes)) + #line 4635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 1055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + *msg = ManagementAPIError::toJsonString( false, markFailed ? "exclude failed" : "exclude", errorString); + #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } + #line 4641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + new (&static_cast(this)->SAV< bool >::value()) bool(false); + this->~CheckExclusionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" totalKvStoreUsedBytes += used_bytes; - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + totalKvStoreFreeBytes += free_bytes; + #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + totalKvStoreAvailableBytes += available_bytes; + #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!excluded) - #line 4541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - totalKvStoreUsedBytesNonExcluded += used_bytes; - #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + totalKvStoreUsedBytesNotExcluded += used_bytes; + #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (disk_id.empty() || diskLocalities.find(disk_id) == diskLocalities.end()) - #line 4547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - totalKvStoreFreeBytes += free_bytes; - #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + totalKvStoreFreeBytesNotExcluded += free_bytes; + #line 1069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!disk_id.empty()) - #line 4553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" diskLocalities.insert(disk_id); - #line 4557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } } - } - #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (excluded) - #line 4564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - { - #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ssExcludedCount++; - #line 4568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } } - loopDepth = a_body1cont25(loopDepth); + loopDepth = a_body1cont26(loopDepth); } catch (Error& error) { loopDepth = a_body1cont8Catch1(error, loopDepth); @@ -4644,39 +4750,41 @@ class CheckExclusionActorState { } int a_body1cont9(int loopDepth) { - #line 1055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!excludedAddressesContainsStorageRole) - #line 4649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - double finalFreeRatio = 1 - (totalKvStoreUsedBytes / (totalKvStoreUsedBytesNonExcluded + totalKvStoreFreeBytes)); - #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (ssExcludedCount == ssTotalCount || finalFreeRatio <= 0.1) - #line 4663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + double finalUnavailableRatio = (double)(totalKvStoreUsedBytes + totalKvStoreFreeBytes - totalKvStoreAvailableBytes) / std::max((double)(totalKvStoreUsedBytesNotExcluded + totalKvStoreFreeBytesNotExcluded), (double)1); + #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + TraceEvent(SevInfo, "CheckExclusionDetails") .detail("SsTotalCount", ssTotalCount) .detail("SsExcludedCount", ssExcludedCount) .detail("FinalUnavailableRatio", finalUnavailableRatio) .detail("TotalKvStoreUsedBytes", totalKvStoreUsedBytes) .detail("TotalKvStoreFreeBytes", totalKvStoreFreeBytes) .detail("TotalKvStoreAvailableBytes", totalKvStoreAvailableBytes) .detail("TotalKvStoreUsedBytesNotExcluded", totalKvStoreUsedBytesNotExcluded) .detail("TotalKvStoreFreeBytesNotExcluded", totalKvStoreFreeBytesNotExcluded); + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (ssExcludedCount == ssTotalCount || finalUnavailableRatio > 0.9) + #line 4771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - std::string temp = "ERROR: This exclude may cause the total free space in the cluster to drop below 10%.\n" "Call set(\"0xff0xff/management/options/exclude/force\", ...) first to exclude without " "checking free space.\n"; - #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + std::string temp = "ERROR: This exclude may cause the total available space in the cluster to drop below 10%.\n" "Call set(\"0xff0xff/management/options/exclude/force\", ...) first to exclude without " "checking available space.\n"; + #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" *msg = ManagementAPIError::toJsonString(false, markFailed ? "exclude failed" : "exclude", temp); - #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4687,11 +4795,11 @@ class CheckExclusionActorState { int a_body1cont8Catch1(const Error& __current_error,int loopDepth=0) { try { - #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" *msg = ManagementAPIError::toJsonString(false, markFailed ? "exclude failed" : "exclude", errorString); - #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckExclusionActorState(); static_cast(this)->destroy(); return 0; } - #line 4694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~CheckExclusionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4705,7 +4813,7 @@ class CheckExclusionActorState { return loopDepth; } - int a_body1cont25(int loopDepth) + int a_body1cont26(int loopDepth) { try { loopDepth = a_body1cont9(loopDepth); @@ -4718,40 +4826,44 @@ class CheckExclusionActorState { return loopDepth; } - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Database db; - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::vector* addresses; - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::set* exclusions; - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool markFailed; - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Optional* msg; - #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool safe; - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - std::string errorString; #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + std::string errorString; + #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int ssTotalCount; - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int ssExcludedCount; - #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::unordered_set diskLocalities; - #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int64_t totalKvStoreFreeBytes; - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + int64_t totalKvStoreFreeBytesNotExcluded; + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int64_t totalKvStoreUsedBytes; - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - int64_t totalKvStoreUsedBytesNonExcluded; - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + int64_t totalKvStoreUsedBytesNotExcluded; + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + int64_t totalKvStoreAvailableBytes; + #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool excludedAddressesContainsStorageRole; - #line 4749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via checkExclusion() - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class CheckExclusionActor final : public Actor, public ActorCallback< CheckExclusionActor, 0, bool >, public ActorCallback< CheckExclusionActor, 1, StatusObject >, public FastAllocated, public CheckExclusionActorState { - #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4761,9 +4873,9 @@ class CheckExclusionActor final : public Actor, public ActorCallback< Chec #pragma clang diagnostic pop friend struct ActorCallback< CheckExclusionActor, 0, bool >; friend struct ActorCallback< CheckExclusionActor, 1, StatusObject >; - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" CheckExclusionActor(Database const& db,std::vector* const& addresses,std::set* const& exclusions,bool const& markFailed,Optional* const& msg) - #line 4766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), CheckExclusionActorState(db, addresses, exclusions, markFailed, msg) { @@ -4788,14 +4900,14 @@ friend struct ActorCallback< CheckExclusionActor, 1, StatusObject >; } }; } - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future checkExclusion( Database const& db, std::vector* const& addresses, std::set* const& exclusions, bool const& markFailed, Optional* const& msg ) { - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new CheckExclusionActor(db, addresses, exclusions, markFailed, msg)); - #line 4795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" void includeServers(ReadYourWritesTransaction* ryw) { ryw->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); @@ -4834,29 +4946,29 @@ void includeServers(ReadYourWritesTransaction* ryw) { } } - #line 4837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via excludeCommitActor() - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class ExcludeCommitActorActorState { - #line 4844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ExcludeCommitActorActorState(ReadYourWritesTransaction* const& ryw,bool const& failed) - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" failed(failed), - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result(), - #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" addresses(), - #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" exclusions() - #line 4859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("excludeCommitActor", reinterpret_cast(this)); @@ -4869,34 +4981,34 @@ class ExcludeCommitActorActorState { int a_body1(int loopDepth=0) { try { - #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!parseNetWorkAddrFromKeys(ryw, failed, addresses, exclusions, result)) - #line 4874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(result); this->~ExcludeCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 4878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 4990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(result)); // state_var_RVO this->~ExcludeCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto force = ryw->getSpecialKeySpaceWriteMap()[SpecialKeySpace::getManagementApiCommandOptionSpecialKey( failed ? "failed" : "excluded", "force")]; - #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (addresses.size() && !(force.first && force.second.present())) - #line 4888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_0 = checkExclusion(ryw->getDatabase(), &addresses, &exclusions, failed, &result); - #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } else @@ -4922,29 +5034,29 @@ class ExcludeCommitActorActorState { } int a_body1cont1(int loopDepth) { - #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_1 = excludeServers(&(ryw->getTransaction()), addresses, failed); - #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(bool const& safe,int loopDepth) { - #line 1121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!safe) - #line 4943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(result); this->~ExcludeCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 4947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(result)); // state_var_RVO this->~ExcludeCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4956,13 +5068,13 @@ class ExcludeCommitActorActorState { } int a_body1cont3(bool && safe,int loopDepth) { - #line 1121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!safe) - #line 4961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(result); this->~ExcludeCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 4965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(result)); // state_var_RVO this->~ExcludeCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5037,11 +5149,11 @@ class ExcludeCommitActorActorState { } int a_body1cont6(Void const& _,int loopDepth) { - #line 1125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" includeServers(ryw); - #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(result); this->~ExcludeCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 5044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(result)); // state_var_RVO this->~ExcludeCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5051,11 +5163,11 @@ class ExcludeCommitActorActorState { } int a_body1cont6(Void && _,int loopDepth) { - #line 1125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" includeServers(ryw); - #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(result); this->~ExcludeCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 5058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(result)); // state_var_RVO this->~ExcludeCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5126,22 +5238,22 @@ class ExcludeCommitActorActorState { fdb_probe_actor_exit("excludeCommitActor", reinterpret_cast(this), 1); } - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool failed; - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Optional result; - #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::vector addresses; - #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::set exclusions; - #line 5139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via excludeCommitActor() - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class ExcludeCommitActorActor final : public Actor>, public ActorCallback< ExcludeCommitActorActor, 0, bool >, public ActorCallback< ExcludeCommitActorActor, 1, Void >, public FastAllocated, public ExcludeCommitActorActorState { - #line 5144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5151,9 +5263,9 @@ class ExcludeCommitActorActor final : public Actor>, publi #pragma clang diagnostic pop friend struct ActorCallback< ExcludeCommitActorActor, 0, bool >; friend struct ActorCallback< ExcludeCommitActorActor, 1, Void >; - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ExcludeCommitActorActor(ReadYourWritesTransaction* const& ryw,bool const& failed) - #line 5156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor>(), ExcludeCommitActorActorState(ryw, failed) { @@ -5178,14 +5290,14 @@ friend struct ActorCallback< ExcludeCommitActorActor, 1, Void >; } }; } - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future> excludeCommitActor( ReadYourWritesTransaction* const& ryw, bool const& failed ) { - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future>(new ExcludeCommitActorActor(ryw, failed)); - #line 5185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Future> ExcludeServersRangeImpl::commit(ReadYourWritesTransaction* ryw) { return excludeCommitActor(ryw, false); @@ -5207,11 +5319,11 @@ void FailedServersRangeImpl::set(ReadYourWritesTransaction* ryw, const KeyRef& k Key FailedServersRangeImpl::decode(const KeyRef& key) const { return key.removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin) - .withPrefix(LiteralStringRef("\xff/conf/")); + .withPrefix("\xff/conf/"_sr); } Key FailedServersRangeImpl::encode(const KeyRef& key) const { - return key.removePrefix(LiteralStringRef("\xff/conf/")) + return key.removePrefix("\xff/conf/"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin); } @@ -5219,29 +5331,29 @@ Future> FailedServersRangeImpl::commit(ReadYourWritesTrans return excludeCommitActor(ryw, true); } - #line 5222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via ExclusionInProgressActor() - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class ExclusionInProgressActorActorState { - #line 5229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ExclusionInProgressActorActorState(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" prefix(prefix), - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr), - #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result(), - #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" tr(ryw->getTransaction()) - #line 5244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("ExclusionInProgressActor", reinterpret_cast(this)); @@ -5254,22 +5366,22 @@ class ExclusionInProgressActorActorState { int a_body1(int loopDepth=0) { try { - #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" tr.setOption(FDBTransactionOptions::RAW_ACCESS); - #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = (getAllExcludedServers(&tr)); - #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5290,29 +5402,29 @@ class ExclusionInProgressActorActorState { } int a_body1cont1(int loopDepth) { - #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" exclusions = std::set(excl.begin(), excl.end()); - #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" inProgressExclusion = std::set(); - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_1 = tr.getRange(serverListKeys, CLIENT_KNOBS->TOO_MANY); - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(std::vector const& __excl,int loopDepth) { - #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" excl = __excl; - #line 5315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -5377,48 +5489,48 @@ class ExclusionInProgressActorActorState { } int a_body1cont2(int loopDepth) { - #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(!serverList.more && serverList.size() < CLIENT_KNOBS->TOO_MANY); - #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto& s : serverList ) { - #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto addresses = decodeServerListValue(s.value).getKeyValues.getEndpoint().addresses; - #line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (addressExcluded(exclusions, addresses.address)) - #line 5388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" inProgressExclusion.insert(addresses.address); - #line 5392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (addresses.secondaryAddress.present() && addressExcluded(exclusions, addresses.secondaryAddress.get())) - #line 5396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" inProgressExclusion.insert(addresses.secondaryAddress.get()); - #line 5400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture>> __when_expr_2 = tr.get(logsKey); - #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast> >*>(static_cast(this))); - #line 5412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1when1(RangeResult const& __serverList,int loopDepth) { - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" serverList = __serverList; - #line 5421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -5483,58 +5595,58 @@ class ExclusionInProgressActorActorState { } int a_body1cont3(Optional> const& value,int loopDepth) { - #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(value.present()); - #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto logs = decodeLogsValue(value.get()); - #line 1190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto const& log : logs.first ) { - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (log.second == NetworkAddress() || addressExcluded(exclusions, log.second)) - #line 5494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" inProgressExclusion.insert(log.second); - #line 5498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto const& log : logs.second ) { - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (log.second == NetworkAddress() || addressExcluded(exclusions, log.second)) - #line 5505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" inProgressExclusion.insert(log.second); - #line 5509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::set inProgressAddresses; - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto const& address : inProgressExclusion ) { - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" inProgressAddresses.insert(formatIpPort(address.ip, address.port)); - #line 5518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto const& address : inProgressAddresses ) { - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key addrKey = prefix.withSuffix(address); - #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.contains(addrKey)) - #line 5526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back(result.arena(), KeyValueRef(addrKey, ValueRef())); - #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.arena().dependsOn(addrKey.arena()); - #line 5532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~ExclusionInProgressActorActorState(); static_cast(this)->destroy(); return 0; } - #line 5537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(result)); // state_var_RVO this->~ExclusionInProgressActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5544,58 +5656,58 @@ class ExclusionInProgressActorActorState { } int a_body1cont3(Optional> && value,int loopDepth) { - #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(value.present()); - #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto logs = decodeLogsValue(value.get()); - #line 1190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto const& log : logs.first ) { - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (log.second == NetworkAddress() || addressExcluded(exclusions, log.second)) - #line 5555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" inProgressExclusion.insert(log.second); - #line 5559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto const& log : logs.second ) { - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (log.second == NetworkAddress() || addressExcluded(exclusions, log.second)) - #line 5566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" inProgressExclusion.insert(log.second); - #line 5570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::set inProgressAddresses; - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto const& address : inProgressExclusion ) { - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" inProgressAddresses.insert(formatIpPort(address.ip, address.port)); - #line 5579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto const& address : inProgressAddresses ) { - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key addrKey = prefix.withSuffix(address); - #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.contains(addrKey)) - #line 5587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back(result.arena(), KeyValueRef(addrKey, ValueRef())); - #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.arena().dependsOn(addrKey.arena()); - #line 5593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~ExclusionInProgressActorActorState(); static_cast(this)->destroy(); return 0; } - #line 5598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(result)); // state_var_RVO this->~ExclusionInProgressActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5666,30 +5778,30 @@ class ExclusionInProgressActorActorState { fdb_probe_actor_exit("ExclusionInProgressActor", reinterpret_cast(this), 2); } - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef prefix; - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Transaction& tr; - #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::vector excl; - #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::set exclusions; - #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::set inProgressExclusion; - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult serverList; - #line 5687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via ExclusionInProgressActor() - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class ExclusionInProgressActorActor final : public Actor, public ActorCallback< ExclusionInProgressActorActor, 0, std::vector >, public ActorCallback< ExclusionInProgressActorActor, 1, RangeResult >, public ActorCallback< ExclusionInProgressActorActor, 2, Optional> >, public FastAllocated, public ExclusionInProgressActorActorState { - #line 5692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5700,9 +5812,9 @@ class ExclusionInProgressActorActor final : public Actor, public Ac friend struct ActorCallback< ExclusionInProgressActorActor, 0, std::vector >; friend struct ActorCallback< ExclusionInProgressActorActor, 1, RangeResult >; friend struct ActorCallback< ExclusionInProgressActorActor, 2, Optional> >; - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ExclusionInProgressActorActor(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) - #line 5705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), ExclusionInProgressActorActorState(ryw, prefix, kr) { @@ -5728,14 +5840,14 @@ friend struct ActorCallback< ExclusionInProgressActorActor, 2, Optional ExclusionInProgressActor( ReadYourWritesTransaction* const& ryw, KeyRef const& prefix, KeyRangeRef const& kr ) { - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new ExclusionInProgressActorActor(ryw, prefix, kr)); - #line 5735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ExclusionInProgressRangeImpl::ExclusionInProgressRangeImpl(KeyRangeRef kr) : SpecialKeyRangeAsyncImpl(kr) {} @@ -5745,25 +5857,25 @@ Future ExclusionInProgressRangeImpl::getRange(ReadYourWritesTransac return ExclusionInProgressActor(ryw, getKeyRange().begin, kr); } - #line 5748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via getProcessClassActor() - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GetProcessClassActorActorState { - #line 5755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetProcessClassActorActorState(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" prefix(prefix), - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr) - #line 5766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("getProcessClassActor", reinterpret_cast(this)); @@ -5776,18 +5888,18 @@ class GetProcessClassActorActorState { int a_body1(int loopDepth=0) { try { - #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->setOption(FDBTransactionOptions::RAW_ACCESS); - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = getWorkers(&ryw->getTransaction()); - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5808,30 +5920,34 @@ class GetProcessClassActorActorState { } int a_body1cont1(std::vector const& _workers,int loopDepth) { - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto workers = _workers; - #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::sort(workers.begin(), workers.end(), [](const ProcessData& lhs, const ProcessData& rhs) { return formatIpPort(lhs.address.ip, lhs.address.port) < formatIpPort(rhs.address.ip, rhs.address.port); }); - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + auto last = std::unique(workers.begin(), workers.end(), [](const ProcessData& lhs, const ProcessData& rhs) { return formatIpPort(lhs.address.ip, lhs.address.port) == formatIpPort(rhs.address.ip, rhs.address.port); }); + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + workers.erase(last, workers.end()); + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto& w : workers ) { - #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef k(prefix.withSuffix(formatIpPort(w.address.ip, w.address.port), result.arena())); - #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.contains(k)) - #line 5823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ValueRef v(result.arena(), w.processClass.toString()); - #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back(result.arena(), KeyValueRef(k, v)); - #line 5829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(rywGetRange(ryw, kr, result)); this->~GetProcessClassActorActorState(); static_cast(this)->destroy(); return 0; } - #line 5834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(rywGetRange(ryw, kr, result)); this->~GetProcessClassActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5841,30 +5957,34 @@ class GetProcessClassActorActorState { } int a_body1cont1(std::vector && _workers,int loopDepth) { - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto workers = _workers; - #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::sort(workers.begin(), workers.end(), [](const ProcessData& lhs, const ProcessData& rhs) { return formatIpPort(lhs.address.ip, lhs.address.port) < formatIpPort(rhs.address.ip, rhs.address.port); }); - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + auto last = std::unique(workers.begin(), workers.end(), [](const ProcessData& lhs, const ProcessData& rhs) { return formatIpPort(lhs.address.ip, lhs.address.port) == formatIpPort(rhs.address.ip, rhs.address.port); }); + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + workers.erase(last, workers.end()); + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto& w : workers ) { - #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef k(prefix.withSuffix(formatIpPort(w.address.ip, w.address.port), result.arena())); - #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.contains(k)) - #line 5856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ValueRef v(result.arena(), w.processClass.toString()); - #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back(result.arena(), KeyValueRef(k, v)); - #line 5862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(rywGetRange(ryw, kr, result)); this->~GetProcessClassActorActorState(); static_cast(this)->destroy(); return 0; } - #line 5867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 5987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(rywGetRange(ryw, kr, result)); this->~GetProcessClassActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5935,18 +6055,18 @@ class GetProcessClassActorActorState { fdb_probe_actor_exit("getProcessClassActor", reinterpret_cast(this), 0); } - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef prefix; - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 5944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via getProcessClassActor() - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GetProcessClassActorActor final : public Actor, public ActorCallback< GetProcessClassActorActor, 0, std::vector >, public FastAllocated, public GetProcessClassActorActorState { - #line 5949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5955,9 +6075,9 @@ class GetProcessClassActorActor final : public Actor, public ActorC void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetProcessClassActorActor, 0, std::vector >; - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetProcessClassActorActor(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) - #line 5960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), GetProcessClassActorActorState(ryw, prefix, kr) { @@ -5981,32 +6101,32 @@ friend struct ActorCallback< GetProcessClassActorActor, 0, std::vector getProcessClassActor( ReadYourWritesTransaction* const& ryw, KeyRef const& prefix, KeyRangeRef const& kr ) { - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new GetProcessClassActorActor(ryw, prefix, kr)); - #line 5988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 5993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via processClassCommitActor() - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class ProcessClassCommitActorActorState { - #line 6000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ProcessClassCommitActorActorState(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& range) - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" range(range) - #line 6009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("processClassCommitActor", reinterpret_cast(this)); @@ -6019,24 +6139,24 @@ class ProcessClassCommitActorActorState { int a_body1(int loopDepth=0) { try { - #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); - #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->setOption(FDBTransactionOptions::RAW_ACCESS); - #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = getWorkers(&ryw->getTransaction()); - #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 6039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6057,69 +6177,69 @@ class ProcessClassCommitActorActorState { } int a_body1cont1(std::vector const& workers,int loopDepth) { - #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto ranges = ryw->getSpecialKeySpaceWriteMap().containedRanges(range); - #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto iter = ranges.begin(); - #line 1256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(;iter != ranges.end();) { - #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto entry = iter->value(); - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (entry.first && entry.second.present()) - #line 6070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key address = iter->begin().removePrefix(range.begin); - #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" AddressExclusion addr = AddressExclusion::parse(address); - #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ValueRef processClassType = entry.second.get(); - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ProcessClass processClass(processClassType.toString(), ProcessClass::DBSource); - #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool foundChange = false; - #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(int i = 0;i < workers.size();i++) { - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (addr.excludes(workers[i].address)) - #line 6086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (processClass.classType() != ProcessClass::InvalidClass) - #line 6090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().set(processClassKeyFor(workers[i].locality.processId().get()), processClassValue(processClass)); - #line 6094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().clear(processClassKeyFor(workers[i].locality.processId().get())); - #line 6100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" foundChange = true; - #line 6104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (foundChange) - #line 6109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().set(processClassChangeKey, deterministicRandom()->randomUniqueID().toString()); - #line 6113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ++iter; - #line 6118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~ProcessClassCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 6122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~ProcessClassCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6129,69 +6249,69 @@ class ProcessClassCommitActorActorState { } int a_body1cont1(std::vector && workers,int loopDepth) { - #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto ranges = ryw->getSpecialKeySpaceWriteMap().containedRanges(range); - #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto iter = ranges.begin(); - #line 1256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(;iter != ranges.end();) { - #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto entry = iter->value(); - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (entry.first && entry.second.present()) - #line 6142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key address = iter->begin().removePrefix(range.begin); - #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" AddressExclusion addr = AddressExclusion::parse(address); - #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ValueRef processClassType = entry.second.get(); - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ProcessClass processClass(processClassType.toString(), ProcessClass::DBSource); - #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool foundChange = false; - #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(int i = 0;i < workers.size();i++) { - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (addr.excludes(workers[i].address)) - #line 6158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (processClass.classType() != ProcessClass::InvalidClass) - #line 6162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().set(processClassKeyFor(workers[i].locality.processId().get()), processClassValue(processClass)); - #line 6166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().clear(processClassKeyFor(workers[i].locality.processId().get())); - #line 6172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" foundChange = true; - #line 6176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (foundChange) - #line 6181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().set(processClassChangeKey, deterministicRandom()->randomUniqueID().toString()); - #line 6185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ++iter; - #line 6190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~ProcessClassCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 6194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~ProcessClassCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6262,16 +6382,16 @@ class ProcessClassCommitActorActorState { fdb_probe_actor_exit("processClassCommitActor", reinterpret_cast(this), 0); } - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef range; - #line 6269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via processClassCommitActor() - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class ProcessClassCommitActorActor final : public Actor>, public ActorCallback< ProcessClassCommitActorActor, 0, std::vector >, public FastAllocated, public ProcessClassCommitActorActorState { - #line 6274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6280,9 +6400,9 @@ class ProcessClassCommitActorActor final : public Actor>, void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ProcessClassCommitActorActor, 0, std::vector >; - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ProcessClassCommitActorActor(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& range) - #line 6285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor>(), ProcessClassCommitActorActorState(ryw, range) { @@ -6306,14 +6426,14 @@ friend struct ActorCallback< ProcessClassCommitActorActor, 0, std::vector> processClassCommitActor( ReadYourWritesTransaction* const& ryw, KeyRangeRef const& range ) { - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future>(new ProcessClassCommitActorActor(ryw, range)); - #line 6313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ProcessClassRangeImpl::ProcessClassRangeImpl(KeyRangeRef kr) : SpecialKeyRangeRWImpl(kr) {} @@ -6345,8 +6465,7 @@ Future> ProcessClassRangeImpl::commit(ReadYourWritesTransa // validate class type ValueRef processClassType = entry.second.get(); ProcessClass processClass(processClassType.toString(), ProcessClass::DBSource); - if (processClass.classType() == ProcessClass::InvalidClass && - processClassType != LiteralStringRef("default")) { + if (processClass.classType() == ProcessClass::InvalidClass && processClassType != "default"_sr) { std::string error = "ERROR: \'" + processClassType.toString() + "\' is not a valid process class\n"; errorMsg = ManagementAPIError::toJsonString(false, "setclass", error); return errorMsg; @@ -6372,25 +6491,25 @@ void ProcessClassRangeImpl::clear(ReadYourWritesTransaction* ryw, const KeyRef& ryw, "setclass", "Clear range operation is meaningless thus forbidden for setclass"); } - #line 6375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via getProcessClassSourceActor() - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GetProcessClassSourceActorActorState { - #line 6382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetProcessClassSourceActorActorState(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" prefix(prefix), - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr) - #line 6393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("getProcessClassSourceActor", reinterpret_cast(this)); @@ -6403,18 +6522,18 @@ class GetProcessClassSourceActorActorState { int a_body1(int loopDepth=0) { try { - #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->setOption(FDBTransactionOptions::RAW_ACCESS); - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = getWorkers(&ryw->getTransaction()); - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 6417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6435,34 +6554,38 @@ class GetProcessClassSourceActorActorState { } int a_body1cont1(std::vector const& _workers,int loopDepth) { - #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto workers = _workers; - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::sort(workers.begin(), workers.end(), [](const ProcessData& lhs, const ProcessData& rhs) { return formatIpPort(lhs.address.ip, lhs.address.port) < formatIpPort(rhs.address.ip, rhs.address.port); }); - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + auto last = std::unique(workers.begin(), workers.end(), [](const ProcessData& lhs, const ProcessData& rhs) { return formatIpPort(lhs.address.ip, lhs.address.port) == formatIpPort(rhs.address.ip, rhs.address.port); }); + #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + workers.erase(last, workers.end()); + #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto& w : workers ) { - #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key k(prefix.withSuffix(formatIpPort(w.address.ip, w.address.port))); - #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.contains(k)) - #line 6450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Value v(w.processClass.sourceString()); - #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back(result.arena(), KeyValueRef(k, v)); - #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.arena().dependsOn(k.arena()); - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.arena().dependsOn(v.arena()); - #line 6460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetProcessClassSourceActorActorState(); static_cast(this)->destroy(); return 0; } - #line 6465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetProcessClassSourceActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6472,34 +6595,38 @@ class GetProcessClassSourceActorActorState { } int a_body1cont1(std::vector && _workers,int loopDepth) { - #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto workers = _workers; - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::sort(workers.begin(), workers.end(), [](const ProcessData& lhs, const ProcessData& rhs) { return formatIpPort(lhs.address.ip, lhs.address.port) < formatIpPort(rhs.address.ip, rhs.address.port); }); - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + auto last = std::unique(workers.begin(), workers.end(), [](const ProcessData& lhs, const ProcessData& rhs) { return formatIpPort(lhs.address.ip, lhs.address.port) == formatIpPort(rhs.address.ip, rhs.address.port); }); + #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + workers.erase(last, workers.end()); + #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( auto& w : workers ) { - #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key k(prefix.withSuffix(formatIpPort(w.address.ip, w.address.port))); - #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.contains(k)) - #line 6487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Value v(w.processClass.sourceString()); - #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back(result.arena(), KeyValueRef(k, v)); - #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.arena().dependsOn(k.arena()); - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.arena().dependsOn(v.arena()); - #line 6497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetProcessClassSourceActorActorState(); static_cast(this)->destroy(); return 0; } - #line 6502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetProcessClassSourceActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6570,18 +6697,18 @@ class GetProcessClassSourceActorActorState { fdb_probe_actor_exit("getProcessClassSourceActor", reinterpret_cast(this), 0); } - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef prefix; - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 6579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via getProcessClassSourceActor() - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GetProcessClassSourceActorActor final : public Actor, public ActorCallback< GetProcessClassSourceActorActor, 0, std::vector >, public FastAllocated, public GetProcessClassSourceActorActorState { - #line 6584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6590,9 +6717,9 @@ class GetProcessClassSourceActorActor final : public Actor, public void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetProcessClassSourceActorActor, 0, std::vector >; - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetProcessClassSourceActorActor(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) - #line 6595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), GetProcessClassSourceActorActorState(ryw, prefix, kr) { @@ -6616,14 +6743,14 @@ friend struct ActorCallback< GetProcessClassSourceActorActor, 0, std::vector getProcessClassSourceActor( ReadYourWritesTransaction* const& ryw, KeyRef const& prefix, KeyRangeRef const& kr ) { - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new GetProcessClassSourceActorActor(ryw, prefix, kr)); - #line 6623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ProcessClassSourceRangeImpl::ProcessClassSourceRangeImpl(KeyRangeRef kr) : SpecialKeyRangeReadImpl(kr) {} @@ -6633,23 +6760,23 @@ Future ProcessClassSourceRangeImpl::getRange(ReadYourWritesTransact return getProcessClassSourceActor(ryw, getKeyRange().begin, kr); } - #line 6636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via getLockedKeyActor() - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GetLockedKeyActorActorState { - #line 6643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetLockedKeyActorActorState(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr) - #line 6652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("getLockedKeyActor", reinterpret_cast(this)); @@ -6662,20 +6789,20 @@ class GetLockedKeyActorActorState { int a_body1(int loopDepth=0) { try { - #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); - #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = ryw->getTransaction().get(databaseLockedKey); - #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 6678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6696,21 +6823,21 @@ class GetLockedKeyActorActorState { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 1378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (val.present()) - #line 6703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" UID uid = UID::fromString(BinaryReader::fromStringRef(val.get().substr(10), Unversioned()).toString()); - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(kr.begin, Value(uid.toString()))); - #line 6709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetLockedKeyActorActorState(); static_cast(this)->destroy(); return 0; } - #line 6713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetLockedKeyActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6720,21 +6847,21 @@ class GetLockedKeyActorActorState { } int a_body1cont1(Optional && val,int loopDepth) { - #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 1378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (val.present()) - #line 6727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" UID uid = UID::fromString(BinaryReader::fromStringRef(val.get().substr(10), Unversioned()).toString()); - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(kr.begin, Value(uid.toString()))); - #line 6733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetLockedKeyActorActorState(); static_cast(this)->destroy(); return 0; } - #line 6737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetLockedKeyActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6805,16 +6932,16 @@ class GetLockedKeyActorActorState { fdb_probe_actor_exit("getLockedKeyActor", reinterpret_cast(this), 0); } - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 6812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via getLockedKeyActor() - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GetLockedKeyActorActor final : public Actor, public ActorCallback< GetLockedKeyActorActor, 0, Optional >, public FastAllocated, public GetLockedKeyActorActorState { - #line 6817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6823,9 +6950,9 @@ class GetLockedKeyActorActor final : public Actor, public ActorCall void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetLockedKeyActorActor, 0, Optional >; - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetLockedKeyActorActor(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 6828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), GetLockedKeyActorActorState(ryw, kr) { @@ -6849,14 +6976,14 @@ friend struct ActorCallback< GetLockedKeyActorActor, 0, Optional >; } }; } - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future getLockedKeyActor( ReadYourWritesTransaction* const& ryw, KeyRangeRef const& kr ) { - #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new GetLockedKeyActorActor(ryw, kr)); - #line 6856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 6983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" LockDatabaseImpl::LockDatabaseImpl(KeyRangeRef kr) : SpecialKeyRangeRWImpl(kr) {} @@ -6878,25 +7005,25 @@ Future LockDatabaseImpl::getRange(ReadYourWritesTransaction* ryw, } } - #line 6881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via lockDatabaseCommitActor() - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class LockDatabaseCommitActorActorState { - #line 6888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" LockDatabaseCommitActorActorState(ReadYourWritesTransaction* const& ryw,UID const& uid) - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" uid(uid), - #line 1406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" msg() - #line 6899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("lockDatabaseCommitActor", reinterpret_cast(this)); @@ -6909,20 +7036,20 @@ class LockDatabaseCommitActorActorState { int a_body1(int loopDepth=0) { try { - #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); - #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = ryw->getTransaction().get(databaseLockedKey); - #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 6925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6943,30 +7070,30 @@ class LockDatabaseCommitActorActorState { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (val.present() && BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) != uid) - #line 6948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(database_locked(), loopDepth); - #line 6952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!val.present()) - #line 6958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ryw->getTransaction().atomicOp(databaseLockedKey, BinaryWriter::toValue(uid, Unversioned()) .withPrefix(LiteralStringRef("0123456789")) .withSuffix(LiteralStringRef("\x00\x00\x00\x00")), MutationRef::SetVersionstampedValue); - #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + ryw->getTransaction().atomicOp( databaseLockedKey, BinaryWriter::toValue(uid, Unversioned()).withPrefix("0123456789"_sr).withSuffix("\x00\x00\x00\x00"_sr), MutationRef::SetVersionstampedValue); + #line 1478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().addWriteConflictRange(normalKeys); - #line 6964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(msg); this->~LockDatabaseCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 6969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(msg)); // state_var_RVO this->~LockDatabaseCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6976,30 +7103,30 @@ class LockDatabaseCommitActorActorState { } int a_body1cont1(Optional && val,int loopDepth) { - #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (val.present() && BinaryReader::fromStringRef(val.get().substr(10), Unversioned()) != uid) - #line 6981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(database_locked(), loopDepth); - #line 6985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!val.present()) - #line 6991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ryw->getTransaction().atomicOp(databaseLockedKey, BinaryWriter::toValue(uid, Unversioned()) .withPrefix(LiteralStringRef("0123456789")) .withSuffix(LiteralStringRef("\x00\x00\x00\x00")), MutationRef::SetVersionstampedValue); - #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + ryw->getTransaction().atomicOp( databaseLockedKey, BinaryWriter::toValue(uid, Unversioned()).withPrefix("0123456789"_sr).withSuffix("\x00\x00\x00\x00"_sr), MutationRef::SetVersionstampedValue); + #line 1478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().addWriteConflictRange(normalKeys); - #line 6997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(msg); this->~LockDatabaseCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(msg)); // state_var_RVO this->~LockDatabaseCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7070,18 +7197,18 @@ class LockDatabaseCommitActorActorState { fdb_probe_actor_exit("lockDatabaseCommitActor", reinterpret_cast(this), 0); } - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" UID uid; - #line 1406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Optional msg; - #line 7079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via lockDatabaseCommitActor() - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class LockDatabaseCommitActorActor final : public Actor>, public ActorCallback< LockDatabaseCommitActorActor, 0, Optional >, public FastAllocated, public LockDatabaseCommitActorActorState { - #line 7084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7090,9 +7217,9 @@ class LockDatabaseCommitActorActor final : public Actor>, void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< LockDatabaseCommitActorActor, 0, Optional >; - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" LockDatabaseCommitActorActor(ReadYourWritesTransaction* const& ryw,UID const& uid) - #line 7095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor>(), LockDatabaseCommitActorActorState(ryw, uid) { @@ -7116,30 +7243,30 @@ friend struct ActorCallback< LockDatabaseCommitActorActor, 0, Optional >; } }; } - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future> lockDatabaseCommitActor( ReadYourWritesTransaction* const& ryw, UID const& uid ) { - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future>(new LockDatabaseCommitActorActor(ryw, uid)); - #line 7123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 7128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via unlockDatabaseCommitActor() - #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class UnlockDatabaseCommitActorActorState { - #line 7135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" UnlockDatabaseCommitActorActorState(ReadYourWritesTransaction* const& ryw) - #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw) - #line 7142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("unlockDatabaseCommitActor", reinterpret_cast(this)); @@ -7152,20 +7279,20 @@ class UnlockDatabaseCommitActorActorState { int a_body1(int loopDepth=0) { try { - #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); - #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = ryw->getTransaction().get(databaseLockedKey); - #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 7168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7186,17 +7313,17 @@ class UnlockDatabaseCommitActorActorState { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (val.present()) - #line 7191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().clear(singleKeyRange(databaseLockedKey)); - #line 7195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~UnlockDatabaseCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~UnlockDatabaseCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7206,17 +7333,17 @@ class UnlockDatabaseCommitActorActorState { } int a_body1cont1(Optional && val,int loopDepth) { - #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (val.present()) - #line 7211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().clear(singleKeyRange(databaseLockedKey)); - #line 7215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~UnlockDatabaseCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~UnlockDatabaseCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7287,14 +7414,14 @@ class UnlockDatabaseCommitActorActorState { fdb_probe_actor_exit("unlockDatabaseCommitActor", reinterpret_cast(this), 0); } - #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 7292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via unlockDatabaseCommitActor() - #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class UnlockDatabaseCommitActorActor final : public Actor>, public ActorCallback< UnlockDatabaseCommitActorActor, 0, Optional >, public FastAllocated, public UnlockDatabaseCommitActorActorState { - #line 7297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7303,9 +7430,9 @@ class UnlockDatabaseCommitActorActor final : public Actor> void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< UnlockDatabaseCommitActorActor, 0, Optional >; - #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" UnlockDatabaseCommitActorActor(ReadYourWritesTransaction* const& ryw) - #line 7308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor>(), UnlockDatabaseCommitActorActorState(ryw) { @@ -7329,14 +7456,14 @@ friend struct ActorCallback< UnlockDatabaseCommitActorActor, 0, Optional } }; } - #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future> unlockDatabaseCommitActor( ReadYourWritesTransaction* const& ryw ) { - #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future>(new UnlockDatabaseCommitActorActor(ryw)); - #line 7336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Future> LockDatabaseImpl::commit(ReadYourWritesTransaction* ryw) { auto lockId = ryw->getSpecialKeySpaceWriteMap()[SpecialKeySpace::getManagementApiCommandPrefix("lock")].second; @@ -7355,23 +7482,23 @@ Future> LockDatabaseImpl::commit(ReadYourWritesTransaction } } - #line 7358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via getConsistencyCheckKeyActor() - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GetConsistencyCheckKeyActorActorState { - #line 7365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetConsistencyCheckKeyActorActorState(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr) - #line 7374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("getConsistencyCheckKeyActor", reinterpret_cast(this)); @@ -7384,22 +7511,22 @@ class GetConsistencyCheckKeyActorActorState { int a_body1(int loopDepth=0) { try { - #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); - #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = ryw->getTransaction().get(fdbShouldConsistencyCheckBeSuspended); - #line 1459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 7402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7420,21 +7547,21 @@ class GetConsistencyCheckKeyActorActorState { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 1460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool ccSuspendSetting = val.present() ? BinaryReader::fromStringRef(val.get(), Unversioned()) : false; - #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (ccSuspendSetting) - #line 7429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(kr.begin, ValueRef())); - #line 7433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetConsistencyCheckKeyActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetConsistencyCheckKeyActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7444,21 +7571,21 @@ class GetConsistencyCheckKeyActorActorState { } int a_body1cont1(Optional && val,int loopDepth) { - #line 1460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool ccSuspendSetting = val.present() ? BinaryReader::fromStringRef(val.get(), Unversioned()) : false; - #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (ccSuspendSetting) - #line 7453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(kr.begin, ValueRef())); - #line 7457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetConsistencyCheckKeyActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetConsistencyCheckKeyActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7529,16 +7656,16 @@ class GetConsistencyCheckKeyActorActorState { fdb_probe_actor_exit("getConsistencyCheckKeyActor", reinterpret_cast(this), 0); } - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 7536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via getConsistencyCheckKeyActor() - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GetConsistencyCheckKeyActorActor final : public Actor, public ActorCallback< GetConsistencyCheckKeyActorActor, 0, Optional >, public FastAllocated, public GetConsistencyCheckKeyActorActorState { - #line 7541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7547,9 +7674,9 @@ class GetConsistencyCheckKeyActorActor final : public Actor, public void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetConsistencyCheckKeyActorActor, 0, Optional >; - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetConsistencyCheckKeyActorActor(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 7552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), GetConsistencyCheckKeyActorActorState(ryw, kr) { @@ -7573,14 +7700,14 @@ friend struct ActorCallback< GetConsistencyCheckKeyActorActor, 0, Optional getConsistencyCheckKeyActor( ReadYourWritesTransaction* const& ryw, KeyRangeRef const& kr ) { - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new GetConsistencyCheckKeyActorActor(ryw, kr)); - #line 7580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ConsistencyCheckImpl::ConsistencyCheckImpl(KeyRangeRef kr) : SpecialKeyRangeRWImpl(kr) {} @@ -7661,25 +7788,25 @@ void GlobalConfigImpl::set(ReadYourWritesTransaction* ryw, const KeyRef& key, co // Writes global configuration changes to durable memory. Also writes the // changes made in the transaction to a recent history set, and updates the // latest version which the global configuration was updated at. - #line 7664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via globalConfigCommitActor() - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GlobalConfigCommitActorActorState { - #line 7671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GlobalConfigCommitActorActorState(GlobalConfigImpl* const& globalConfig,ReadYourWritesTransaction* const& ryw) - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : globalConfig(globalConfig), - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw(ryw), - #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" tr(ryw->getTransaction()) - #line 7682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("globalConfigCommitActor", reinterpret_cast(this)); @@ -7692,18 +7819,18 @@ class GlobalConfigCommitActorActorState { int a_body1(int loopDepth=0) { try { - #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->setOption(FDBTransactionOptions::RAW_ACCESS); - #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_0 = tr.getRange(globalConfigHistoryKeys, CLIENT_KNOBS->TOO_MANY); - #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7724,70 +7851,70 @@ class GlobalConfigCommitActorActorState { } int a_body1cont1(RangeResult const& history,int loopDepth) { - #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" constexpr int kGlobalConfigMaxHistorySize = 3; - #line 1556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (history.size() > kGlobalConfigMaxHistorySize - 1) - #line 7731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(int i = 0;i < history.size() - (kGlobalConfigMaxHistorySize - 1);++i) { - #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" tr.clear(history[i].key); - #line 7737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Standalone> insertions; - #line 1563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Standalone> clears; - #line 1568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ranges = ryw->getSpecialKeySpaceWriteMap().containedRanges(specialKeys); - #line 1570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" iter = ranges.begin(); - #line 1571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(;iter != ranges.end();) { - #line 1572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::pair> entry = iter->value(); - #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (entry.first) - #line 7754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (entry.second.present() && iter->begin().startsWith(globalConfig->getKeyRange().begin)) - #line 7758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key bareKey = iter->begin().removePrefix(globalConfig->getKeyRange().begin); - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" insertions.push_back_deep(insertions.arena(), KeyValueRef(bareKey, entry.second.get())); - #line 7764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!entry.second.present() && iter->range().begin.startsWith(globalConfig->getKeyRange().begin) && iter->range().end.startsWith(globalConfig->getKeyRange().begin)) - #line 7770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef bareRangeBegin = iter->range().begin.removePrefix(globalConfig->getKeyRange().begin); - #line 1580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef bareRangeEnd = iter->range().end.removePrefix(globalConfig->getKeyRange().begin); - #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" clears.push_back_deep(clears.arena(), KeyRangeRef(bareRangeBegin, bareRangeEnd)); - #line 7778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } } - #line 1584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ++iter; - #line 7784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GlobalConfig::applyChanges(tr, insertions, clears); - #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GlobalConfigCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~GlobalConfigCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7797,70 +7924,70 @@ class GlobalConfigCommitActorActorState { } int a_body1cont1(RangeResult && history,int loopDepth) { - #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" constexpr int kGlobalConfigMaxHistorySize = 3; - #line 1556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (history.size() > kGlobalConfigMaxHistorySize - 1) - #line 7804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(int i = 0;i < history.size() - (kGlobalConfigMaxHistorySize - 1);++i) { - #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" tr.clear(history[i].key); - #line 7810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Standalone> insertions; - #line 1563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Standalone> clears; - #line 1568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ranges = ryw->getSpecialKeySpaceWriteMap().containedRanges(specialKeys); - #line 1570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" iter = ranges.begin(); - #line 1571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(;iter != ranges.end();) { - #line 1572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::pair> entry = iter->value(); - #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (entry.first) - #line 7827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (entry.second.present() && iter->begin().startsWith(globalConfig->getKeyRange().begin)) - #line 7831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key bareKey = iter->begin().removePrefix(globalConfig->getKeyRange().begin); - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" insertions.push_back_deep(insertions.arena(), KeyValueRef(bareKey, entry.second.get())); - #line 7837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!entry.second.present() && iter->range().begin.startsWith(globalConfig->getKeyRange().begin) && iter->range().end.startsWith(globalConfig->getKeyRange().begin)) - #line 7843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef bareRangeBegin = iter->range().begin.removePrefix(globalConfig->getKeyRange().begin); - #line 1580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef bareRangeEnd = iter->range().end.removePrefix(globalConfig->getKeyRange().begin); - #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" clears.push_back_deep(clears.arena(), KeyRangeRef(bareRangeBegin, bareRangeEnd)); - #line 7851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } } - #line 1584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ++iter; - #line 7857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GlobalConfig::applyChanges(tr, insertions, clears); - #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GlobalConfigCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 7863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 7990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~GlobalConfigCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7931,22 +8058,22 @@ class GlobalConfigCommitActorActorState { fdb_probe_actor_exit("globalConfigCommitActor", reinterpret_cast(this), 0); } - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GlobalConfigImpl* globalConfig; - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Transaction& tr; - #line 1568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeMap>, KeyRangeRef>::Ranges ranges; - #line 1570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeMap>, KeyRangeRef>::iterator iter; - #line 7944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via globalConfigCommitActor() - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GlobalConfigCommitActorActor final : public Actor>, public ActorCallback< GlobalConfigCommitActorActor, 0, RangeResult >, public FastAllocated, public GlobalConfigCommitActorActorState { - #line 7949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7955,9 +8082,9 @@ class GlobalConfigCommitActorActor final : public Actor>, void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GlobalConfigCommitActorActor, 0, RangeResult >; - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GlobalConfigCommitActorActor(GlobalConfigImpl* const& globalConfig,ReadYourWritesTransaction* const& ryw) - #line 7960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor>(), GlobalConfigCommitActorActorState(globalConfig, ryw) { @@ -7981,14 +8108,14 @@ friend struct ActorCallback< GlobalConfigCommitActorActor, 0, RangeResult >; } }; } - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future> globalConfigCommitActor( GlobalConfigImpl* const& globalConfig, ReadYourWritesTransaction* const& ryw ) { - #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future>(new GlobalConfigCommitActorActor(globalConfig, ryw)); - #line 7988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" // Called when a transaction includes keys in the global configuration special-key-space range. Future> GlobalConfigImpl::commit(ReadYourWritesTransaction* ryw) { @@ -8019,10 +8146,10 @@ Future TracingOptionsImpl::getRange(ReadYourWritesTransaction* ryw, if (key.endsWith(kTracingTransactionIdKey)) { result.push_back_deep(result.arena(), - KeyValueRef(key, std::to_string(ryw->getTransactionState()->spanID.first()))); + KeyValueRef(key, ryw->getTransactionState()->spanContext.traceID.toString())); } else if (key.endsWith(kTracingTokenKey)) { result.push_back_deep(result.arena(), - KeyValueRef(key, std::to_string(ryw->getTransactionState()->spanID.second()))); + KeyValueRef(key, std::to_string(ryw->getTransactionState()->spanContext.spanID))); } } return result; @@ -8030,20 +8157,22 @@ Future TracingOptionsImpl::getRange(ReadYourWritesTransaction* ryw, void TracingOptionsImpl::set(ReadYourWritesTransaction* ryw, const KeyRef& key, const ValueRef& value) { if (ryw->getApproximateSize() > 0) { - ryw->setSpecialKeySpaceErrorMsg("tracing options must be set first"); + ryw->setSpecialKeySpaceErrorMsg( + ManagementAPIError::toJsonString(false, "configure trace", "tracing options must be set first")); ryw->getSpecialKeySpaceWriteMap().insert(key, std::make_pair(true, Optional())); return; } if (key.endsWith(kTracingTransactionIdKey)) { - ryw->setTransactionID(std::stoul(value.toString())); + ryw->setTransactionID(UID::fromString(value.toString())); } else if (key.endsWith(kTracingTokenKey)) { if (value.toString() == "true") { ryw->setToken(deterministicRandom()->randomUInt64()); } else if (value.toString() == "false") { ryw->setToken(0); } else { - ryw->setSpecialKeySpaceErrorMsg("token must be set to true/false"); + ryw->setSpecialKeySpaceErrorMsg( + ManagementAPIError::toJsonString(false, "configure trace token", "token must be set to true/false")); throw special_keys_api_failure(); } } @@ -8057,38 +8186,38 @@ Future> TracingOptionsImpl::commit(ReadYourWritesTransacti } void TracingOptionsImpl::clear(ReadYourWritesTransaction* ryw, const KeyRangeRef& range) { - ryw->setSpecialKeySpaceErrorMsg("clear range disabled"); + ryw->setSpecialKeySpaceErrorMsg(ManagementAPIError::toJsonString(false, "clear trace", "clear range disabled")); throw special_keys_api_failure(); } void TracingOptionsImpl::clear(ReadYourWritesTransaction* ryw, const KeyRef& key) { - ryw->setSpecialKeySpaceErrorMsg("clear disabled"); + ryw->setSpecialKeySpaceErrorMsg(ManagementAPIError::toJsonString(false, "clear trace", "clear disabled")); throw special_keys_api_failure(); } CoordinatorsImpl::CoordinatorsImpl(KeyRangeRef kr) : SpecialKeyRangeRWImpl(kr) {} - #line 8071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via coordinatorsGetRangeActor() - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class CoordinatorsGetRangeActorActorState { - #line 8078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" CoordinatorsGetRangeActorActorState(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" prefix(prefix), - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr), - #line 1670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" cs(ryw->getDatabase()->getConnectionRecord()->getConnectionString()) - #line 8091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("coordinatorsGetRangeActor", reinterpret_cast(this)); @@ -8101,16 +8230,16 @@ class CoordinatorsGetRangeActorActorState { int a_body1(int loopDepth=0) { try { - #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = cs.tryResolveHostnames(); - #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 8113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8131,49 +8260,49 @@ class CoordinatorsGetRangeActorActorState { } int a_body1cont1(int loopDepth) { - #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - Key cluster_decription_key = prefix.withSuffix(LiteralStringRef("cluster_description")); - #line 1674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + Key cluster_decription_key = prefix.withSuffix("cluster_description"_sr); + #line 1732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.contains(cluster_decription_key)) - #line 8140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(cluster_decription_key, cs.clusterKeyName())); - #line 8144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::sort(coordinator_processes.begin(), coordinator_processes.end(), [](const NetworkAddress& lhs, const NetworkAddress& rhs) { return lhs.toString() < rhs.toString(); }); - #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string processes_str; - #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& w : coordinator_processes ) { - #line 1684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (processes_str.size()) - #line 8154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" processes_str += ","; - #line 8158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" processes_str += w.toString(); - #line 8162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - Key processes_key = prefix.withSuffix(LiteralStringRef("processes")); - #line 1689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + Key processes_key = prefix.withSuffix("processes"_sr); + #line 1747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.contains(processes_key)) - #line 8168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(processes_key, Value(processes_str))); - #line 8172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(rywGetRange(ryw, kr, result)); this->~CoordinatorsGetRangeActorActorState(); static_cast(this)->destroy(); return 0; } - #line 8176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(rywGetRange(ryw, kr, result)); this->~CoordinatorsGetRangeActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8183,9 +8312,9 @@ class CoordinatorsGetRangeActorActorState { } int a_body1when1(std::vector const& __coordinator_processes,int loopDepth) { - #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" coordinator_processes = __coordinator_processes; - #line 8188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -8248,22 +8377,22 @@ class CoordinatorsGetRangeActorActorState { fdb_probe_actor_exit("coordinatorsGetRangeActor", reinterpret_cast(this), 0); } - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef prefix; - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 1670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ClusterConnectionString cs; - #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::vector coordinator_processes; - #line 8261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via coordinatorsGetRangeActor() - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class CoordinatorsGetRangeActorActor final : public Actor, public ActorCallback< CoordinatorsGetRangeActorActor, 0, std::vector >, public FastAllocated, public CoordinatorsGetRangeActorActorState { - #line 8266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8272,9 +8401,9 @@ class CoordinatorsGetRangeActorActor final : public Actor, public A void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< CoordinatorsGetRangeActorActor, 0, std::vector >; - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" CoordinatorsGetRangeActorActor(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) - #line 8277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), CoordinatorsGetRangeActorActorState(ryw, prefix, kr) { @@ -8298,14 +8427,14 @@ friend struct ActorCallback< CoordinatorsGetRangeActorActor, 0, std::vector coordinatorsGetRangeActor( ReadYourWritesTransaction* const& ryw, KeyRef const& prefix, KeyRangeRef const& kr ) { - #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new CoordinatorsGetRangeActorActor(ryw, prefix, kr)); - #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Future CoordinatorsImpl::getRange(ReadYourWritesTransaction* ryw, KeyRangeRef kr, @@ -8314,33 +8443,33 @@ Future CoordinatorsImpl::getRange(ReadYourWritesTransaction* ryw, return coordinatorsGetRangeActor(ryw, prefix, kr); } - #line 8317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via coordinatorsCommitActor() - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class CoordinatorsCommitActorActorState { - #line 8324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" CoordinatorsCommitActorActorState(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr), - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" conn(), - #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" process_address_or_hostname_strs(), - #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" msg(), - #line 1706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" index(), - #line 1707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" parse_error(false) - #line 8343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("coordinatorsCommitActor", reinterpret_cast(this)); @@ -8353,35 +8482,35 @@ class CoordinatorsCommitActorActorState { int a_body1(int loopDepth=0) { try { - #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - Key processes_key = LiteralStringRef("processes").withPrefix(kr.begin); - #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + Key processes_key = "processes"_sr.withPrefix(kr.begin); + #line 1769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto processes_entry = ryw->getSpecialKeySpaceWriteMap()[processes_key]; - #line 1712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (processes_entry.first) - #line 8362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(processes_entry.second.present()); - #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto processesStr = processes_entry.second.get().toString(); - #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" boost::split(process_address_or_hostname_strs, processesStr, [](char c) { return c == ','; }); - #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!process_address_or_hostname_strs.size()) - #line 8372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(ManagementAPIError::toJsonString( false, "coordinators", "New coordinators\' processes are empty, please specify new processes\' network addresses with format " "\"IP:PORT,IP:PORT,...,IP:PORT\" or \"HOSTNAME:PORT,HOSTNAME:PORT,...,HOSTNAME:PORT\"")); this->~CoordinatorsCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 8376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(ManagementAPIError::toJsonString( false, "coordinators", "New coordinators\' processes are empty, please specify new processes\' network addresses with format " "\"IP:PORT,IP:PORT,...,IP:PORT\" or \"HOSTNAME:PORT,HOSTNAME:PORT,...,HOSTNAME:PORT\"")); this->~CoordinatorsCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" index = 0; - #line 8384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } else @@ -8407,47 +8536,49 @@ class CoordinatorsCommitActorActorState { } int a_body1cont1(int loopDepth) { - #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string newName; - #line 1750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - Key cluster_decription_key = LiteralStringRef("cluster_description").withPrefix(kr.begin); - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + Key cluster_decription_key = "cluster_description"_sr.withPrefix(kr.begin); + #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto entry = ryw->getSpecialKeySpaceWriteMap()[cluster_decription_key]; - #line 1752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (entry.first) - #line 8418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (entry.second.present() && isAlphaNumeric(entry.second.get().toString())) - #line 8422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" newName = entry.second.get().toString(); - #line 8426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(ManagementAPIError::toJsonString( false, "coordinators", "Cluster description must match [A-Za-z0-9_]+")); this->~CoordinatorsCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 8432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(ManagementAPIError::toJsonString( false, "coordinators", "Cluster description must match [A-Za-z0-9_]+")); this->~CoordinatorsCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 1764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - TraceEvent(SevDebug, "SKSChangeCoordinatorsStart") .detail("NewConnectionString", conn.toString()) .detail("Description", entry.first ? entry.second.get().toString() : ""); - #line 1768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - StrictFuture> __when_expr_0 = changeQuorumChecker(&ryw->getTransaction(), &conn, newName); - #line 1768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + auto configDBEntry = ryw->getSpecialKeySpaceWriteMap()["config_db"_sr.withPrefix(kr.begin)]; + #line 1824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + TraceEvent(SevDebug, "SKSChangeCoordinatorsStart") .detail("NewConnectionString", conn.toString()) .detail("Description", entry.first ? entry.second.get().toString() : "") .detail("ConfigDBDisabled", configDBEntry.first); + #line 1829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + StrictFuture> __when_expr_0 = changeQuorumChecker(&ryw->getTransaction(), &conn, newName, configDBEntry.first); + #line 1829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1cont1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 8450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -8467,38 +8598,38 @@ class CoordinatorsCommitActorActorState { } int a_body1loopBody1(int loopDepth) { - #line 1723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!(index < process_address_or_hostname_strs.size())) - #line 8472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } try { - #line 1725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (Hostname::isHostname(process_address_or_hostname_strs[index])) - #line 8479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" conn.hostnames.push_back(Hostname::parse(process_address_or_hostname_strs[index])); - #line 8483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" NetworkAddress a = NetworkAddress::parse(process_address_or_hostname_strs[index]); - #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!a.isValid()) - #line 8491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" parse_error = true; - #line 8495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 1732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" conn.coords.push_back(a); - #line 8501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } loopDepth = a_body1loopBody1cont8(loopDepth); @@ -8526,23 +8657,23 @@ class CoordinatorsCommitActorActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 1740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (parse_error) - #line 8531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string error = "ERROR: \'" + process_address_or_hostname_strs[index] + "\' is not a valid network endpoint address\n"; - #line 1743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(ManagementAPIError::toJsonString(false, "coordinators", error)); this->~CoordinatorsCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 8537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(ManagementAPIError::toJsonString(false, "coordinators", error)); this->~CoordinatorsCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" index++; - #line 8545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -8550,11 +8681,11 @@ class CoordinatorsCommitActorActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" TraceEvent(SevDebug, "SpecialKeysNetworkParseError").error(e); - #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" parse_error = true; - #line 8557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); } catch (Error& error) { @@ -8580,44 +8711,44 @@ class CoordinatorsCommitActorActorState { } int a_body1cont4(Optional const& r,int loopDepth) { - #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" TraceEvent(SevDebug, "SKSChangeCoordinatorsFinish") .detail("Result", r.present() ? static_cast(r.get()) : -1); - #line 1772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (r.present()) - #line 8587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto res = r.get(); - #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool retriable = false; - #line 1775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (res == CoordinatorsResult::COORDINATOR_UNREACHABLE) - #line 8595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" retriable = true; - #line 8599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 1777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (res == CoordinatorsResult::SUCCESS) - #line 8605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" TraceEvent(SevError, "SpecialKeysForCoordinators").detail("UnexpectedSuccessfulResult", ""); - #line 1779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(false); - #line 8611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" msg = ManagementAPIError::toJsonString(retriable, "coordinators", ManagementAPI::generateErrorMessage(res)); - #line 8616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(msg); this->~CoordinatorsCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 8620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(msg)); // state_var_RVO this->~CoordinatorsCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8627,44 +8758,44 @@ class CoordinatorsCommitActorActorState { } int a_body1cont4(Optional && r,int loopDepth) { - #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" TraceEvent(SevDebug, "SKSChangeCoordinatorsFinish") .detail("Result", r.present() ? static_cast(r.get()) : -1); - #line 1772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (r.present()) - #line 8634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto res = r.get(); - #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool retriable = false; - #line 1775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (res == CoordinatorsResult::COORDINATOR_UNREACHABLE) - #line 8642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" retriable = true; - #line 8646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 1777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (res == CoordinatorsResult::SUCCESS) - #line 8652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" TraceEvent(SevError, "SpecialKeysForCoordinators").detail("UnexpectedSuccessfulResult", ""); - #line 1779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(false); - #line 8658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" msg = ManagementAPIError::toJsonString(retriable, "coordinators", ManagementAPI::generateErrorMessage(res)); - #line 8663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(msg); this->~CoordinatorsCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 8667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(msg)); // state_var_RVO this->~CoordinatorsCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8735,26 +8866,26 @@ class CoordinatorsCommitActorActorState { fdb_probe_actor_exit("coordinatorsCommitActor", reinterpret_cast(this), 0); } - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ClusterConnectionString conn; - #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::vector process_address_or_hostname_strs; - #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Optional msg; - #line 1706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int index; - #line 1707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool parse_error; - #line 8752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via coordinatorsCommitActor() - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class CoordinatorsCommitActorActor final : public Actor>, public ActorCallback< CoordinatorsCommitActorActor, 0, Optional >, public FastAllocated, public CoordinatorsCommitActorActorState { - #line 8757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8763,9 +8894,9 @@ class CoordinatorsCommitActorActor final : public Actor>, void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< CoordinatorsCommitActorActor, 0, Optional >; - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" CoordinatorsCommitActorActor(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 8768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor>(), CoordinatorsCommitActorActorState(ryw, kr) { @@ -8789,14 +8920,14 @@ friend struct ActorCallback< CoordinatorsCommitActorActor, 0, Optional> coordinatorsCommitActor( ReadYourWritesTransaction* const& ryw, KeyRangeRef const& kr ) { - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future>(new CoordinatorsCommitActorActor(ryw, kr)); - #line 8796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Future> CoordinatorsImpl::commit(ReadYourWritesTransaction* ryw) { return coordinatorsCommitActor(ryw, getKeyRange()); @@ -8813,29 +8944,29 @@ void CoordinatorsImpl::clear(ReadYourWritesTransaction* ryw, const KeyRef& key) CoordinatorsAutoImpl::CoordinatorsAutoImpl(KeyRangeRef kr) : SpecialKeyRangeReadImpl(kr) {} - #line 8816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via CoordinatorsAutoImplActor() - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class CoordinatorsAutoImplActorActorState { - #line 8823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" CoordinatorsAutoImplActorActorState(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr), - #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" res(), - #line 1803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" autoCoordinatorsKey(), - #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" tr(ryw->getTransaction()) - #line 8838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("CoordinatorsAutoImplActor", reinterpret_cast(this)); @@ -8848,24 +8979,24 @@ class CoordinatorsAutoImplActorActorState { int a_body1(int loopDepth=0) { try { - #line 1806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" tr.setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" tr.setOption(FDBTransactionOptions::RAW_ACCESS); - #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" tr.setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); - #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = tr.get(coordinatorsKey); - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 8868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 8999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8886,60 +9017,60 @@ class CoordinatorsAutoImplActorActorState { } int a_body1cont1(Optional const& currentKey,int loopDepth) { - #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!currentKey.present()) - #line 8891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->setSpecialKeySpaceErrorMsg( ManagementAPIError::toJsonString(false, "auto_coordinators", "The coordinator key does not exist")); - #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(special_keys_api_failure(), loopDepth); - #line 8897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" old = ClusterConnectionString(currentKey.get().toString()); - #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result = CoordinatorsResult::SUCCESS; - #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_1 = old.tryResolveHostnames(); - #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 8912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Optional && currentKey,int loopDepth) { - #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!currentKey.present()) - #line 8921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->setSpecialKeySpaceErrorMsg( ManagementAPIError::toJsonString(false, "auto_coordinators", "The coordinator key does not exist")); - #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(special_keys_api_failure(), loopDepth); - #line 8927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" old = ClusterConnectionString(currentKey.get().toString()); - #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result = CoordinatorsResult::SUCCESS; - #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_1 = old.tryResolveHostnames(); - #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 8942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9009,32 +9140,32 @@ class CoordinatorsAutoImplActorActorState { } int a_body1cont2(std::vector const& oldCoordinators,int loopDepth) { - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_2 = autoQuorumChange()->getDesiredCoordinators( &tr, oldCoordinators, Reference(new ClusterConnectionMemoryRecord(old)), result); - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 9021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(std::vector && oldCoordinators,int loopDepth) { - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_2 = autoQuorumChange()->getDesiredCoordinators( &tr, oldCoordinators, Reference(new ClusterConnectionMemoryRecord(old)), result); - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 9037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9104,53 +9235,53 @@ class CoordinatorsAutoImplActorActorState { } int a_body1cont4(std::vector const& _desiredCoordinators,int loopDepth) { - #line 1827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (result == CoordinatorsResult::NOT_ENOUGH_MACHINES) - #line 9109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->setSpecialKeySpaceErrorMsg(ManagementAPIError::toJsonString( true, "auto_coordinators", "Too few fdbserver machines to provide coordination at the current redundancy level")); - #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(special_keys_api_failure(), loopDepth); - #line 9115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (result == CoordinatorsResult::SAME_NETWORK_ADDRESSES) - #line 9119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& host : old.hostnames ) { - #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" autoCoordinatorsKey += autoCoordinatorsKey.size() ? "," : ""; - #line 1840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" autoCoordinatorsKey += host.toString(); - #line 9127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& coord : old.coords ) { - #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" autoCoordinatorsKey += autoCoordinatorsKey.size() ? "," : ""; - #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" autoCoordinatorsKey += coord.toString(); - #line 9135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } else { - #line 1847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& address : _desiredCoordinators ) { - #line 1848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" autoCoordinatorsKey += autoCoordinatorsKey.size() ? "," : ""; - #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" autoCoordinatorsKey += address.toString(); - #line 9146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" res.push_back_deep(res.arena(), KeyValueRef(kr.begin, Value(autoCoordinatorsKey))); - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(res); this->~CoordinatorsAutoImplActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(res)); // state_var_RVO this->~CoordinatorsAutoImplActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9160,53 +9291,53 @@ class CoordinatorsAutoImplActorActorState { } int a_body1cont4(std::vector && _desiredCoordinators,int loopDepth) { - #line 1827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (result == CoordinatorsResult::NOT_ENOUGH_MACHINES) - #line 9165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->setSpecialKeySpaceErrorMsg(ManagementAPIError::toJsonString( true, "auto_coordinators", "Too few fdbserver machines to provide coordination at the current redundancy level")); - #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(special_keys_api_failure(), loopDepth); - #line 9171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (result == CoordinatorsResult::SAME_NETWORK_ADDRESSES) - #line 9175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& host : old.hostnames ) { - #line 1839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" autoCoordinatorsKey += autoCoordinatorsKey.size() ? "," : ""; - #line 1840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" autoCoordinatorsKey += host.toString(); - #line 9183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& coord : old.coords ) { - #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" autoCoordinatorsKey += autoCoordinatorsKey.size() ? "," : ""; - #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" autoCoordinatorsKey += coord.toString(); - #line 9191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } else { - #line 1847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& address : _desiredCoordinators ) { - #line 1848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" autoCoordinatorsKey += autoCoordinatorsKey.size() ? "," : ""; - #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" autoCoordinatorsKey += address.toString(); - #line 9202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" res.push_back_deep(res.arena(), KeyValueRef(kr.begin, Value(autoCoordinatorsKey))); - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(res); this->~CoordinatorsAutoImplActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(res)); // state_var_RVO this->~CoordinatorsAutoImplActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9277,26 +9408,26 @@ class CoordinatorsAutoImplActorActorState { fdb_probe_actor_exit("CoordinatorsAutoImplActor", reinterpret_cast(this), 2); } - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult res; - #line 1803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string autoCoordinatorsKey; - #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Transaction& tr; - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ClusterConnectionString old; - #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" CoordinatorsResult result; - #line 9294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via CoordinatorsAutoImplActor() - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class CoordinatorsAutoImplActorActor final : public Actor, public ActorCallback< CoordinatorsAutoImplActorActor, 0, Optional >, public ActorCallback< CoordinatorsAutoImplActorActor, 1, std::vector >, public ActorCallback< CoordinatorsAutoImplActorActor, 2, std::vector >, public FastAllocated, public CoordinatorsAutoImplActorActorState { - #line 9299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9307,9 +9438,9 @@ class CoordinatorsAutoImplActorActor final : public Actor, public A friend struct ActorCallback< CoordinatorsAutoImplActorActor, 0, Optional >; friend struct ActorCallback< CoordinatorsAutoImplActorActor, 1, std::vector >; friend struct ActorCallback< CoordinatorsAutoImplActorActor, 2, std::vector >; - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" CoordinatorsAutoImplActorActor(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 9312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), CoordinatorsAutoImplActorActorState(ryw, kr) { @@ -9335,14 +9466,14 @@ friend struct ActorCallback< CoordinatorsAutoImplActorActor, 2, std::vector CoordinatorsAutoImplActor( ReadYourWritesTransaction* const& ryw, KeyRangeRef const& kr ) { - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new CoordinatorsAutoImplActorActor(ryw, kr)); - #line 9342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Future CoordinatorsAutoImpl::getRange(ReadYourWritesTransaction* ryw, KeyRangeRef kr, @@ -9352,23 +9483,23 @@ Future CoordinatorsAutoImpl::getRange(ReadYourWritesTransaction* ry return CoordinatorsAutoImplActor(ryw, kr); } - #line 9355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via getMinCommitVersionActor() - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GetMinCommitVersionActorActorState { - #line 9362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetMinCommitVersionActorActorState(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr) - #line 9371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("getMinCommitVersionActor", reinterpret_cast(this)); @@ -9381,20 +9512,20 @@ class GetMinCommitVersionActorActorState { int a_body1(int loopDepth=0) { try { - #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); - #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = ryw->getTransaction().get(minRequiredCommitVersionKey); - #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 9397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9415,23 +9546,23 @@ class GetMinCommitVersionActorActorState { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 1868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (val.present()) - #line 9422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Version minRequiredCommitVersion = BinaryReader::fromStringRef(val.get(), Unversioned()); - #line 1871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ValueRef version(result.arena(), boost::lexical_cast(minRequiredCommitVersion)); - #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(kr.begin, version)); - #line 9430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetMinCommitVersionActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetMinCommitVersionActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9441,23 +9572,23 @@ class GetMinCommitVersionActorActorState { } int a_body1cont1(Optional && val,int loopDepth) { - #line 1868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 1869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (val.present()) - #line 9448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Version minRequiredCommitVersion = BinaryReader::fromStringRef(val.get(), Unversioned()); - #line 1871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ValueRef version(result.arena(), boost::lexical_cast(minRequiredCommitVersion)); - #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(kr.begin, version)); - #line 9456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetMinCommitVersionActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetMinCommitVersionActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9528,16 +9659,16 @@ class GetMinCommitVersionActorActorState { fdb_probe_actor_exit("getMinCommitVersionActor", reinterpret_cast(this), 0); } - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via getMinCommitVersionActor() - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GetMinCommitVersionActorActor final : public Actor, public ActorCallback< GetMinCommitVersionActorActor, 0, Optional >, public FastAllocated, public GetMinCommitVersionActorActorState { - #line 9540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9546,9 +9677,9 @@ class GetMinCommitVersionActorActor final : public Actor, public Ac void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetMinCommitVersionActorActor, 0, Optional >; - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetMinCommitVersionActorActor(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 9551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), GetMinCommitVersionActorActorState(ryw, kr) { @@ -9572,14 +9703,14 @@ friend struct ActorCallback< GetMinCommitVersionActorActor, 0, Optional > } }; } - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] static Future getMinCommitVersionActor( ReadYourWritesTransaction* const& ryw, KeyRangeRef const& kr ) { - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new GetMinCommitVersionActorActor(ryw, kr)); - #line 9579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" AdvanceVersionImpl::AdvanceVersionImpl(KeyRangeRef kr) : SpecialKeyRangeRWImpl(kr) {} @@ -9601,23 +9732,23 @@ Future AdvanceVersionImpl::getRange(ReadYourWritesTransaction* ryw, } } - #line 9604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via advanceVersionCommitActor() - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class AdvanceVersionCommitActorActorState { - #line 9611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" AdvanceVersionCommitActorActorState(ReadYourWritesTransaction* const& ryw,Version const& v) - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" v(v) - #line 9620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("advanceVersionCommitActor", reinterpret_cast(this)); @@ -9630,36 +9761,16 @@ class AdvanceVersionCommitActorActorState { int a_body1(int loopDepth=0) { try { - #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - static const Version maxAllowedVerion = std::numeric_limits::max() - 1 - CLIENT_KNOBS->VERSIONS_PER_SECOND * 3600 * 24 * 365 * 1000; - #line 1903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ryw->getTransaction().setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); - #line 1905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - TraceEvent(SevDebug, "AdvanceVersion").detail("MaxAllowedVersion", maxAllowedVerion); - #line 1906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (v > maxAllowedVerion) - #line 9643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - { - #line 1907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(ManagementAPIError::toJsonString( false, "advanceversion", "The given version is larger than the maximum allowed value(2**63-1-version_per_second*3600*24*365*1000)")); this->~AdvanceVersionCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(ManagementAPIError::toJsonString( false, "advanceversion", "The given version is larger than the maximum allowed value(2**63-1-version_per_second*3600*24*365*1000)")); - this->~AdvanceVersionCommitActorActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - StrictFuture __when_expr_0 = ryw->getTransaction().getReadVersion(); - #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + StrictFuture>> __when_expr_0 = ryw->getTransaction().get(versionEpochKey); + #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 9773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9678,29 +9789,188 @@ class AdvanceVersionCommitActorActorState { return loopDepth; } - int a_body1cont1(Version const& rv,int loopDepth) + int a_body1cont1(Optional> const& versionEpochValue,int loopDepth) { - #line 1913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (rv <= v) - #line 9685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - { - #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ryw->getTransaction().set(minRequiredCommitVersionKey, BinaryWriter::toValue(v + 1, Unversioned())); - #line 9689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - } - else + #line 1961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (versionEpochValue.present()) + #line 9796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(ManagementAPIError::toJsonString( false, "advanceversion", "Current read version is larger than the given version")); this->~AdvanceVersionCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(ManagementAPIError::toJsonString( false, "advanceversion", "Current read version is larger than the given version")); + #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(ManagementAPIError::toJsonString( false, "advanceversion", "Illegal to modify the version while the version epoch is enabled")); this->~AdvanceVersionCommitActorActorState(); static_cast(this)->destroy(); return 0; } + #line 9800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(ManagementAPIError::toJsonString( false, "advanceversion", "Illegal to modify the version while the version epoch is enabled")); this->~AdvanceVersionCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + static const Version maxAllowedVerion = std::numeric_limits::max() - 1 - CLIENT_KNOBS->VERSIONS_PER_SECOND * 3600 * 24 * 365 * 1000; + #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + ryw->getTransaction().setOption(FDBTransactionOptions::LOCK_AWARE); + #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); + #line 1973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + TraceEvent(SevDebug, "AdvanceVersion").detail("MaxAllowedVersion", maxAllowedVerion); + #line 1974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (v > maxAllowedVerion) + #line 9816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 1975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(ManagementAPIError::toJsonString( false, "advanceversion", "The given version is larger than the maximum allowed value(2**63-1-version_per_second*3600*24*365*1000)")); this->~AdvanceVersionCommitActorActorState(); static_cast(this)->destroy(); return 0; } + #line 9820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(ManagementAPIError::toJsonString( false, "advanceversion", "The given version is larger than the maximum allowed value(2**63-1-version_per_second*3600*24*365*1000)")); + this->~AdvanceVersionCommitActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + StrictFuture __when_expr_1 = ryw->getTransaction().getReadVersion(); + #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 9830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional> && versionEpochValue,int loopDepth) + { + #line 1961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (versionEpochValue.present()) + #line 9844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(ManagementAPIError::toJsonString( false, "advanceversion", "Illegal to modify the version while the version epoch is enabled")); this->~AdvanceVersionCommitActorActorState(); static_cast(this)->destroy(); return 0; } + #line 9848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(ManagementAPIError::toJsonString( false, "advanceversion", "Illegal to modify the version while the version epoch is enabled")); + this->~AdvanceVersionCommitActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + static const Version maxAllowedVerion = std::numeric_limits::max() - 1 - CLIENT_KNOBS->VERSIONS_PER_SECOND * 3600 * 24 * 365 * 1000; + #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + ryw->getTransaction().setOption(FDBTransactionOptions::LOCK_AWARE); + #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); + #line 1973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + TraceEvent(SevDebug, "AdvanceVersion").detail("MaxAllowedVersion", maxAllowedVerion); + #line 1974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (v > maxAllowedVerion) + #line 9864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 1975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(ManagementAPIError::toJsonString( false, "advanceversion", "The given version is larger than the maximum allowed value(2**63-1-version_per_second*3600*24*365*1000)")); this->~AdvanceVersionCommitActorActorState(); static_cast(this)->destroy(); return 0; } + #line 9868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(ManagementAPIError::toJsonString( false, "advanceversion", "The given version is larger than the maximum allowed value(2**63-1-version_per_second*3600*24*365*1000)")); + this->~AdvanceVersionCommitActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + StrictFuture __when_expr_1 = ryw->getTransaction().getReadVersion(); + #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 9878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Optional> const& versionEpochValue,int loopDepth) + { + loopDepth = a_body1cont1(versionEpochValue, loopDepth); + + return loopDepth; + } + int a_body1when1(Optional> && versionEpochValue,int loopDepth) + { + loopDepth = a_body1cont1(std::move(versionEpochValue), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AdvanceVersionCommitActorActor, 0, Optional> >::remove(); + + } + void a_callback_fire(ActorCallback< AdvanceVersionCommitActorActor, 0, Optional> >*,Optional> const& value) + { + fdb_probe_actor_enter("advanceVersionCommitActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("advanceVersionCommitActor", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< AdvanceVersionCommitActorActor, 0, Optional> >*,Optional> && value) + { + fdb_probe_actor_enter("advanceVersionCommitActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("advanceVersionCommitActor", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< AdvanceVersionCommitActorActor, 0, Optional> >*,Error err) + { + fdb_probe_actor_enter("advanceVersionCommitActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("advanceVersionCommitActor", reinterpret_cast(this), 0); + + } + int a_body1cont2(Version const& rv,int loopDepth) + { + #line 1981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (rv <= v) + #line 9955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + ryw->getTransaction().set(minRequiredCommitVersionKey, BinaryWriter::toValue(v + 1, Unversioned())); + #line 9959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + } + else + { + #line 1984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(ManagementAPIError::toJsonString( false, "advanceversion", "Current read version is larger than the given version")); this->~AdvanceVersionCommitActorActorState(); static_cast(this)->destroy(); return 0; } + #line 9965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(ManagementAPIError::toJsonString( false, "advanceversion", "Current read version is larger than the given version")); + this->~AdvanceVersionCommitActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 1987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~AdvanceVersionCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~AdvanceVersionCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9708,29 +9978,29 @@ class AdvanceVersionCommitActorActorState { return loopDepth; } - int a_body1cont1(Version && rv,int loopDepth) + int a_body1cont2(Version && rv,int loopDepth) { - #line 1913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (rv <= v) - #line 9715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().set(minRequiredCommitVersionKey, BinaryWriter::toValue(v + 1, Unversioned())); - #line 9719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 1916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(ManagementAPIError::toJsonString( false, "advanceversion", "Current read version is larger than the given version")); this->~AdvanceVersionCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 9995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(ManagementAPIError::toJsonString( false, "advanceversion", "Current read version is larger than the given version")); this->~AdvanceVersionCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~AdvanceVersionCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~AdvanceVersionCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9738,58 +10008,58 @@ class AdvanceVersionCommitActorActorState { return loopDepth; } - int a_body1when1(Version const& rv,int loopDepth) + int a_body1cont1when1(Version const& rv,int loopDepth) { - loopDepth = a_body1cont1(rv, loopDepth); + loopDepth = a_body1cont2(rv, loopDepth); return loopDepth; } - int a_body1when1(Version && rv,int loopDepth) + int a_body1cont1when1(Version && rv,int loopDepth) { - loopDepth = a_body1cont1(std::move(rv), loopDepth); + loopDepth = a_body1cont2(std::move(rv), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose2() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< AdvanceVersionCommitActorActor, 0, Version >::remove(); + static_cast(this)->ActorCallback< AdvanceVersionCommitActorActor, 1, Version >::remove(); } - void a_callback_fire(ActorCallback< AdvanceVersionCommitActorActor, 0, Version >*,Version const& value) + void a_callback_fire(ActorCallback< AdvanceVersionCommitActorActor, 1, Version >*,Version const& value) { - fdb_probe_actor_enter("advanceVersionCommitActor", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("advanceVersionCommitActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("advanceVersionCommitActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("advanceVersionCommitActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< AdvanceVersionCommitActorActor, 0, Version >*,Version && value) + void a_callback_fire(ActorCallback< AdvanceVersionCommitActorActor, 1, Version >*,Version && value) { - fdb_probe_actor_enter("advanceVersionCommitActor", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("advanceVersionCommitActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("advanceVersionCommitActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("advanceVersionCommitActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< AdvanceVersionCommitActorActor, 0, Version >*,Error err) + void a_callback_error(ActorCallback< AdvanceVersionCommitActorActor, 1, Version >*,Error err) { - fdb_probe_actor_enter("advanceVersionCommitActor", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("advanceVersionCommitActor", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -9798,19 +10068,19 @@ class AdvanceVersionCommitActorActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("advanceVersionCommitActor", reinterpret_cast(this), 0); + fdb_probe_actor_exit("advanceVersionCommitActor", reinterpret_cast(this), 1); } - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Version v; - #line 9808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via advanceVersionCommitActor() - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" -class AdvanceVersionCommitActorActor final : public Actor>, public ActorCallback< AdvanceVersionCommitActorActor, 0, Version >, public FastAllocated, public AdvanceVersionCommitActorActorState { - #line 9813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +class AdvanceVersionCommitActorActor final : public Actor>, public ActorCallback< AdvanceVersionCommitActorActor, 0, Optional> >, public ActorCallback< AdvanceVersionCommitActorActor, 1, Version >, public FastAllocated, public AdvanceVersionCommitActorActorState { + #line 10083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9818,10 +10088,11 @@ class AdvanceVersionCommitActorActor final : public Actor> #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< AdvanceVersionCommitActorActor, 0, Version >; - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +friend struct ActorCallback< AdvanceVersionCommitActorActor, 0, Optional> >; +friend struct ActorCallback< AdvanceVersionCommitActorActor, 1, Version >; + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" AdvanceVersionCommitActorActor(ReadYourWritesTransaction* const& ryw,Version const& v) - #line 9824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor>(), AdvanceVersionCommitActorActorState(ryw, v) { @@ -9839,20 +10110,21 @@ friend struct ActorCallback< AdvanceVersionCommitActorActor, 0, Version >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< AdvanceVersionCommitActorActor, 0, Version >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< AdvanceVersionCommitActorActor, 0, Optional> >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< AdvanceVersionCommitActorActor, 1, Version >*)0, actor_cancelled()); break; } } }; } - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] static Future> advanceVersionCommitActor( ReadYourWritesTransaction* const& ryw, Version const& v ) { - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future>(new AdvanceVersionCommitActorActor(ryw, v)); - #line 9852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 1989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Future> AdvanceVersionImpl::commit(ReadYourWritesTransaction* ryw) { ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); @@ -9873,23 +10145,23 @@ Future> AdvanceVersionImpl::commit(ReadYourWritesTransacti return Optional(); } - #line 9876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via getVersionEpochActor() - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GetVersionEpochActorActorState { - #line 9883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetVersionEpochActorActorState(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr) - #line 9892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("getVersionEpochActor", reinterpret_cast(this)); @@ -9902,20 +10174,20 @@ class GetVersionEpochActorActorState { int a_body1(int loopDepth=0) { try { - #line 1942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::LOCK_AWARE); - #line 1943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = ryw->getTransaction().get(versionEpochKey); - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 9918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9936,23 +10208,23 @@ class GetVersionEpochActorActorState { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 1945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 1946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (val.present()) - #line 9943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int64_t versionEpoch = BinaryReader::fromStringRef(val.get(), Unversioned()); - #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ValueRef version(result.arena(), boost::lexical_cast(versionEpoch)); - #line 1949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(kr.begin, version)); - #line 9951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetVersionEpochActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetVersionEpochActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9962,23 +10234,23 @@ class GetVersionEpochActorActorState { } int a_body1cont1(Optional && val,int loopDepth) { - #line 1945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 1946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (val.present()) - #line 9969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 1947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int64_t versionEpoch = BinaryReader::fromStringRef(val.get(), Unversioned()); - #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ValueRef version(result.arena(), boost::lexical_cast(versionEpoch)); - #line 1949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(kr.begin, version)); - #line 9977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 1951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetVersionEpochActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetVersionEpochActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10049,16 +10321,16 @@ class GetVersionEpochActorActorState { fdb_probe_actor_exit("getVersionEpochActor", reinterpret_cast(this), 0); } - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 10056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via getVersionEpochActor() - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class GetVersionEpochActorActor final : public Actor, public ActorCallback< GetVersionEpochActorActor, 0, Optional >, public FastAllocated, public GetVersionEpochActorActorState { - #line 10061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -10067,9 +10339,9 @@ class GetVersionEpochActorActor final : public Actor, public ActorC void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetVersionEpochActorActor, 0, Optional >; - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetVersionEpochActorActor(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 10072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), GetVersionEpochActorActorState(ryw, kr) { @@ -10093,14 +10365,14 @@ friend struct ActorCallback< GetVersionEpochActorActor, 0, Optional >; } }; } - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] static Future getVersionEpochActor( ReadYourWritesTransaction* const& ryw, KeyRangeRef const& kr ) { - #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new GetVersionEpochActorActor(ryw, kr)); - #line 10100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 1953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 2021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" VersionEpochImpl::VersionEpochImpl(KeyRangeRef kr) : SpecialKeyRangeRWImpl(kr) {} @@ -10133,7 +10405,7 @@ Future ClientProfilingImpl::getRange(ReadYourWritesTransaction* ryw KeyRef prefix = getKeyRange().begin; RangeResult result = RangeResult(); // client_txn_sample_rate - Key sampleRateKey = LiteralStringRef("client_txn_sample_rate").withPrefix(prefix); + Key sampleRateKey = "client_txn_sample_rate"_sr.withPrefix(prefix); ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); @@ -10154,7 +10426,7 @@ Future ClientProfilingImpl::getRange(ReadYourWritesTransaction* ryw } } // client_txn_size_limit - Key txnSizeLimitKey = LiteralStringRef("client_txn_size_limit").withPrefix(prefix); + Key txnSizeLimitKey = "client_txn_size_limit"_sr.withPrefix(prefix); if (kr.contains(txnSizeLimitKey)) { auto entry = ryw->getSpecialKeySpaceWriteMap()[txnSizeLimitKey]; if (!ryw->readYourWritesDisabled() && entry.first) { @@ -10180,7 +10452,7 @@ Future> ClientProfilingImpl::commit(ReadYourWritesTransact Standalone> clears; // client_txn_sample_rate - Key sampleRateKey = LiteralStringRef("client_txn_sample_rate").withPrefix(getKeyRange().begin); + Key sampleRateKey = "client_txn_sample_rate"_sr.withPrefix(getKeyRange().begin); auto rateEntry = ryw->getSpecialKeySpaceWriteMap()[sampleRateKey]; if (rateEntry.first && rateEntry.second.present()) { @@ -10191,7 +10463,7 @@ Future> ClientProfilingImpl::commit(ReadYourWritesTransact } else { try { double sampleRate = boost::lexical_cast(sampleRateStr); - Tuple rate = Tuple().appendDouble(sampleRate); + Tuple rate = Tuple::makeTuple(sampleRate); insertions.push_back_deep(insertions.arena(), KeyValueRef(fdbClientInfoTxnSampleRate, rate.pack())); } catch (boost::bad_lexical_cast& e) { return Optional(ManagementAPIError::toJsonString( @@ -10200,7 +10472,7 @@ Future> ClientProfilingImpl::commit(ReadYourWritesTransact } } // client_txn_size_limit - Key txnSizeLimitKey = LiteralStringRef("client_txn_size_limit").withPrefix(getKeyRange().begin); + Key txnSizeLimitKey = "client_txn_size_limit"_sr.withPrefix(getKeyRange().begin); auto sizeLimitEntry = ryw->getSpecialKeySpaceWriteMap()[txnSizeLimitKey]; if (sizeLimitEntry.first && sizeLimitEntry.second.present()) { std::string sizeLimitStr = sizeLimitEntry.second.get().toString(); @@ -10210,7 +10482,7 @@ Future> ClientProfilingImpl::commit(ReadYourWritesTransact } else { try { int64_t sizeLimit = boost::lexical_cast(sizeLimitStr); - Tuple size = Tuple().append(sizeLimit); + Tuple size = Tuple::makeTuple(sizeLimit); insertions.push_back_deep(insertions.arena(), KeyValueRef(fdbClientInfoTxnSizeLimit, size.pack())); } catch (boost::bad_lexical_cast& e) { return Optional(ManagementAPIError::toJsonString( @@ -10245,11 +10517,11 @@ void parse(StringRef& val, double& d) { } void parse(StringRef& val, WaitState& w) { - if (val == LiteralStringRef("disk") || val == LiteralStringRef("Disk")) { + if (val == "disk"_sr || val == "Disk"_sr) { w = WaitState::Disk; - } else if (val == LiteralStringRef("network") || val == LiteralStringRef("Network")) { + } else if (val == "network"_sr || val == "Network"_sr) { w = WaitState::Network; - } else if (val == LiteralStringRef("running") || val == LiteralStringRef("Running")) { + } else if (val == "running"_sr || val == "Running"_sr) { w = WaitState::Running; } else { throw std::range_error("failed to parse run state"); @@ -10331,45 +10603,45 @@ void parse(std::vector::iterator it, std::vector::iterator } } - #line 10334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via actorLineageGetRangeActor() - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class ActorLineageGetRangeActorActorState { - #line 10341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ActorLineageGetRangeActorActorState(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" prefix(prefix), - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr), - #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result(), - #line 2190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" host(), - #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" waitStateStart(WaitState{ 0 }), - #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" waitStateEnd(WaitState{ 2 }), - #line 2193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" timeStart(0), - #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" timeEnd(std::numeric_limits::max()), - #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" seqStart(0), - #line 2196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" seqEnd(std::numeric_limits::max()), - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" beginValues(kr.begin.removePrefix(prefix).splitAny("/"_sr)), - #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" endValues(kr.end.removePrefix(prefix).splitAny("/"_sr)) - #line 10372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("actorLineageGetRangeActor", reinterpret_cast(this)); @@ -10382,59 +10654,59 @@ class ActorLineageGetRangeActorActorState { int a_body1(int loopDepth=0) { try { - #line 2201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (beginValues.size() < 2 || endValues.size() < 2) - #line 10387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ryw->setSpecialKeySpaceErrorMsg("missing required parameters (index, host)"); - #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + ryw->setSpecialKeySpaceErrorMsg( ManagementAPIError::toJsonString(false, "read actor_lineage", "missing required parameters (index, host)")); + #line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(special_keys_api_failure(), loopDepth); - #line 10393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" endRangeHost = NetworkAddress(); - #line 10397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" try { - #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (SpecialKeySpace::getActorLineageApiCommandRange("state").contains(kr)) - #line 10401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" parse(beginValues.begin() + 1, beginValues.end(), host, waitStateStart, timeStart, seqStart); - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.begin != kr.end) - #line 10407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" parse(endValues.begin() + 1, endValues.end(), endRangeHost, waitStateEnd, timeEnd, seqEnd); - #line 10411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } else { - #line 2214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (SpecialKeySpace::getActorLineageApiCommandRange("time").contains(kr)) - #line 10418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" parse(beginValues.begin() + 1, beginValues.end(), host, timeStart, waitStateStart, seqStart); - #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.begin != kr.end) - #line 10424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" parse(endValues.begin() + 1, endValues.end(), endRangeHost, timeEnd, waitStateEnd, seqEnd); - #line 10428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } else { - #line 2221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ryw->setSpecialKeySpaceErrorMsg("invalid index in actor_lineage"); - #line 2222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + ryw->setSpecialKeySpaceErrorMsg( ManagementAPIError::toJsonString(false, "read actor_lineage", "invalid index in actor_lineage")); + #line 2292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch2(special_keys_api_failure(), loopDepth); - #line 10437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } loopDepth = a_body1cont10(loopDepth); @@ -10463,30 +10735,30 @@ class ActorLineageGetRangeActorActorState { } int a_body1cont1(int loopDepth) { - #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.begin != kr.end && host != endRangeHost) - #line 10468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ryw->setSpecialKeySpaceErrorMsg("the host must remain the same on both ends of the range"); - #line 2237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + ryw->setSpecialKeySpaceErrorMsg(ManagementAPIError::toJsonString( false, "read actor_lineage", "the host must remain the same on both ends of the range")); + #line 2309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(special_keys_api_failure(), loopDepth); - #line 10474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" process = ProcessInterface(); - #line 2243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" process.getInterface = RequestStream(Endpoint::wellKnown({ host }, WLTOKEN_PROCESS)); - #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_0 = retryBrokenPromise(process.getInterface, GetProcessInterfaceRequest{}); - #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1cont1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -10494,21 +10766,21 @@ class ActorLineageGetRangeActorActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 2225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (e.code() != special_keys_api_failure().code()) - #line 10499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ryw->setSpecialKeySpaceErrorMsg("failed to parse key"); - #line 2227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + ryw->setSpecialKeySpaceErrorMsg( ManagementAPIError::toJsonString(false, "read actor_lineage", "failed to parse key")); + #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(special_keys_api_failure(), loopDepth); - #line 10505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 2229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 10511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } catch (Error& error) { @@ -10534,56 +10806,56 @@ class ActorLineageGetRangeActorActorState { } int a_body1cont11(ProcessInterface const& p,int loopDepth) { - #line 2245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" process = p; - #line 2247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ActorLineageRequest actorLineageRequest; - #line 2248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" actorLineageRequest.waitStateStart = waitStateStart; - #line 2249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" actorLineageRequest.waitStateEnd = waitStateEnd; - #line 2250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" actorLineageRequest.timeStart = timeStart; - #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" actorLineageRequest.timeEnd = timeEnd; - #line 2252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_1 = process.actorLineage.getReply(actorLineageRequest); - #line 2252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont11when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont11(ProcessInterface && p,int loopDepth) { - #line 2245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" process = p; - #line 2247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ActorLineageRequest actorLineageRequest; - #line 2248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" actorLineageRequest.waitStateStart = waitStateStart; - #line 2249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" actorLineageRequest.waitStateEnd = waitStateEnd; - #line 2250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" actorLineageRequest.timeStart = timeStart; - #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" actorLineageRequest.timeEnd = timeEnd; - #line 2252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_1 = process.actorLineage.getReply(actorLineageRequest); - #line 2252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont11when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -10653,127 +10925,127 @@ class ActorLineageGetRangeActorActorState { } int a_body1cont11cont1(ActorLineageReply const& reply,int loopDepth) { - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" time_t dt = 0; - #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int seq = -1; - #line 2256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& sample : reply.samples ) { - #line 2257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" time_t datetime = (time_t)sample.time; - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" char buf[50]; - #line 2259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" struct tm* tm; - #line 2260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" tm = localtime(&datetime); - #line 2261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" size_t size = strftime(buf, 50, "%FT%T%z", tm); - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string date(buf, size); - #line 2264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" seq = dt == datetime ? seq + 1 : 0; - #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" dt = datetime; - #line 2267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& [waitState, data] : sample.data ) { - #line 2268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (seq < seqStart) - #line 10682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { continue; } else { - #line 2270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (seq >= seqEnd) - #line 10690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { break; } } - #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::ostringstream streamKey; - #line 2275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (SpecialKeySpace::getActorLineageApiCommandRange("state").contains(kr)) - #line 10699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" streamKey << SpecialKeySpace::getActorLineageApiCommandPrefix("state").toString() << host.toString() << "/" << to_string(waitState) << "/" << date; - #line 10703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 2278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (SpecialKeySpace::getActorLineageApiCommandRange("time").contains(kr)) - #line 10709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" streamKey << SpecialKeySpace::getActorLineageApiCommandPrefix("time").toString() << host.toString() << "/" << date << "/" << to_string(waitState); - #line 10713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(false); - #line 10719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 10991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 2284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" streamKey << "/" << seq; - #line 2286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" msgpack::object_handle oh = msgpack::unpack(data.data(), data.size()); - #line 2287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" msgpack::object deserialized = oh.get(); - #line 2289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::ostringstream stream; - #line 2290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" stream << deserialized; - #line 2292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(streamKey.str(), stream.str())); - #line 10734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (sample.data.size() == 0) - #line 10738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::ostringstream streamKey; - #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (SpecialKeySpace::getActorLineageApiCommandRange("state").contains(kr)) - #line 10744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" streamKey << SpecialKeySpace::getActorLineageApiCommandPrefix("state").toString() << host.toString() << "/Running/" << date; - #line 10748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (SpecialKeySpace::getActorLineageApiCommandRange("time").contains(kr)) - #line 10754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" streamKey << SpecialKeySpace::getActorLineageApiCommandPrefix("time").toString() << host.toString() << "/" << date << "/Running"; - #line 10758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 2304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(false); - #line 10764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 2306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" streamKey << "/" << seq; - #line 2307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(streamKey.str(), "{}"_sr)); - #line 10771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 2311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~ActorLineageGetRangeActorActorState(); static_cast(this)->destroy(); return 0; } - #line 10776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(result)); // state_var_RVO this->~ActorLineageGetRangeActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10783,127 +11055,127 @@ class ActorLineageGetRangeActorActorState { } int a_body1cont11cont1(ActorLineageReply && reply,int loopDepth) { - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" time_t dt = 0; - #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int seq = -1; - #line 2256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& sample : reply.samples ) { - #line 2257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" time_t datetime = (time_t)sample.time; - #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" char buf[50]; - #line 2259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" struct tm* tm; - #line 2260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" tm = localtime(&datetime); - #line 2261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" size_t size = strftime(buf, 50, "%FT%T%z", tm); - #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string date(buf, size); - #line 2264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" seq = dt == datetime ? seq + 1 : 0; - #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" dt = datetime; - #line 2267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& [waitState, data] : sample.data ) { - #line 2268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (seq < seqStart) - #line 10812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { continue; } else { - #line 2270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (seq >= seqEnd) - #line 10820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { break; } } - #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::ostringstream streamKey; - #line 2275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (SpecialKeySpace::getActorLineageApiCommandRange("state").contains(kr)) - #line 10829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" streamKey << SpecialKeySpace::getActorLineageApiCommandPrefix("state").toString() << host.toString() << "/" << to_string(waitState) << "/" << date; - #line 10833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 2278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (SpecialKeySpace::getActorLineageApiCommandRange("time").contains(kr)) - #line 10839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" streamKey << SpecialKeySpace::getActorLineageApiCommandPrefix("time").toString() << host.toString() << "/" << date << "/" << to_string(waitState); - #line 10843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(false); - #line 10849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 2284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" streamKey << "/" << seq; - #line 2286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" msgpack::object_handle oh = msgpack::unpack(data.data(), data.size()); - #line 2287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" msgpack::object deserialized = oh.get(); - #line 2289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::ostringstream stream; - #line 2290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" stream << deserialized; - #line 2292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(streamKey.str(), stream.str())); - #line 10864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (sample.data.size() == 0) - #line 10868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::ostringstream streamKey; - #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (SpecialKeySpace::getActorLineageApiCommandRange("state").contains(kr)) - #line 10874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" streamKey << SpecialKeySpace::getActorLineageApiCommandPrefix("state").toString() << host.toString() << "/Running/" << date; - #line 10878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (SpecialKeySpace::getActorLineageApiCommandRange("time").contains(kr)) - #line 10884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" streamKey << SpecialKeySpace::getActorLineageApiCommandPrefix("time").toString() << host.toString() << "/" << date << "/Running"; - #line 10888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 2304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(false); - #line 10894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 2306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" streamKey << "/" << seq; - #line 2307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(streamKey.str(), "{}"_sr)); - #line 10901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 2311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~ActorLineageGetRangeActorActorState(); static_cast(this)->destroy(); return 0; } - #line 10906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(result)); // state_var_RVO this->~ActorLineageGetRangeActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10974,42 +11246,42 @@ class ActorLineageGetRangeActorActorState { fdb_probe_actor_exit("actorLineageGetRangeActor", reinterpret_cast(this), 1); } - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef prefix; - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 2190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" NetworkAddress host; - #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" WaitState waitStateStart; - #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" WaitState waitStateEnd; - #line 2193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" time_t timeStart; - #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" time_t timeEnd; - #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int seqStart; - #line 2196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int seqEnd; - #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::vector beginValues; - #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::vector endValues; - #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" NetworkAddress endRangeHost; - #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ProcessInterface process; - #line 11007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via actorLineageGetRangeActor() - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class ActorLineageGetRangeActorActor final : public Actor, public ActorCallback< ActorLineageGetRangeActorActor, 0, ProcessInterface >, public ActorCallback< ActorLineageGetRangeActorActor, 1, ActorLineageReply >, public FastAllocated, public ActorLineageGetRangeActorActorState { - #line 11012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -11019,9 +11291,9 @@ class ActorLineageGetRangeActorActor final : public Actor, public A #pragma clang diagnostic pop friend struct ActorCallback< ActorLineageGetRangeActorActor, 0, ProcessInterface >; friend struct ActorCallback< ActorLineageGetRangeActorActor, 1, ActorLineageReply >; - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ActorLineageGetRangeActorActor(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) - #line 11024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), ActorLineageGetRangeActorActorState(ryw, prefix, kr) { @@ -11046,14 +11318,14 @@ friend struct ActorCallback< ActorLineageGetRangeActorActor, 1, ActorLineageRepl } }; } - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] static Future actorLineageGetRangeActor( ReadYourWritesTransaction* const& ryw, KeyRef const& prefix, KeyRangeRef const& kr ) { - #line 2183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new ActorLineageGetRangeActorActor(ryw, prefix, kr)); - #line 11053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 2313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 2385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Future ActorLineageImpl::getRange(ReadYourWritesTransaction* ryw, KeyRangeRef kr, @@ -11135,27 +11407,27 @@ MaintenanceImpl::MaintenanceImpl(KeyRangeRef kr) : SpecialKeyRangeRWImpl(kr) {} // we will calculate the remaining time(truncated to integer, the same as fdbcli) and return back as the value // If the zoneId is the special one `ignoreSSFailuresZoneString`, // value will be 0 (same as fdbcli) - #line 11138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via MaintenanceGetRangeActor() - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class MaintenanceGetRangeActorActorState { - #line 11145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" MaintenanceGetRangeActorActorState(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" prefix(prefix), - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr), - #line 2397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result() - #line 11158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("MaintenanceGetRangeActor", reinterpret_cast(this)); @@ -11168,20 +11440,20 @@ class MaintenanceGetRangeActorActorState { int a_body1(int loopDepth=0) { try { - #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); - #line 2401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = ryw->getTransaction().get(healthyZoneKey); - #line 2401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 11184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11202,33 +11474,33 @@ class MaintenanceGetRangeActorActorState { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 2402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (val.present()) - #line 11207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto healthyZone = decodeHealthyZoneValue(val.get()); - #line 2404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if ((healthyZone.first == ignoreSSFailuresZoneString) || (healthyZone.second > ryw->getTransaction().getReadVersion().get())) - #line 11213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key zone_key = healthyZone.first.withPrefix(prefix); - #line 2407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" double seconds = healthyZone.first == ignoreSSFailuresZoneString ? 0 : (healthyZone.second - ryw->getTransaction().getReadVersion().get()) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND; - #line 2411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.contains(zone_key)) - #line 11221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(zone_key, Value(boost::lexical_cast(seconds)))); - #line 11225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } } - #line 2417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(rywGetRange(ryw, kr, result)); this->~MaintenanceGetRangeActorActorState(); static_cast(this)->destroy(); return 0; } - #line 11231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(rywGetRange(ryw, kr, result)); this->~MaintenanceGetRangeActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11238,33 +11510,33 @@ class MaintenanceGetRangeActorActorState { } int a_body1cont1(Optional && val,int loopDepth) { - #line 2402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (val.present()) - #line 11243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto healthyZone = decodeHealthyZoneValue(val.get()); - #line 2404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if ((healthyZone.first == ignoreSSFailuresZoneString) || (healthyZone.second > ryw->getTransaction().getReadVersion().get())) - #line 11249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key zone_key = healthyZone.first.withPrefix(prefix); - #line 2407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" double seconds = healthyZone.first == ignoreSSFailuresZoneString ? 0 : (healthyZone.second - ryw->getTransaction().getReadVersion().get()) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND; - #line 2411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.contains(zone_key)) - #line 11257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(zone_key, Value(boost::lexical_cast(seconds)))); - #line 11261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } } - #line 2417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(rywGetRange(ryw, kr, result)); this->~MaintenanceGetRangeActorActorState(); static_cast(this)->destroy(); return 0; } - #line 11267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(rywGetRange(ryw, kr, result)); this->~MaintenanceGetRangeActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11335,20 +11607,20 @@ class MaintenanceGetRangeActorActorState { fdb_probe_actor_exit("MaintenanceGetRangeActor", reinterpret_cast(this), 0); } - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef prefix; - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 2397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 11346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via MaintenanceGetRangeActor() - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class MaintenanceGetRangeActorActor final : public Actor, public ActorCallback< MaintenanceGetRangeActorActor, 0, Optional >, public FastAllocated, public MaintenanceGetRangeActorActorState { - #line 11351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -11357,9 +11629,9 @@ class MaintenanceGetRangeActorActor final : public Actor, public Ac void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< MaintenanceGetRangeActorActor, 0, Optional >; - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" MaintenanceGetRangeActorActor(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) - #line 11362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), MaintenanceGetRangeActorActorState(ryw, prefix, kr) { @@ -11383,14 +11655,14 @@ friend struct ActorCallback< MaintenanceGetRangeActorActor, 0, Optional > } }; } - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] static Future MaintenanceGetRangeActor( ReadYourWritesTransaction* const& ryw, KeyRef const& prefix, KeyRangeRef const& kr ) { - #line 2394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new MaintenanceGetRangeActorActor(ryw, prefix, kr)); - #line 11390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 2419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 2491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Future MaintenanceImpl::getRange(ReadYourWritesTransaction* ryw, KeyRangeRef kr, @@ -11403,23 +11675,23 @@ Future MaintenanceImpl::getRange(ReadYourWritesTransaction* ryw, // In addition, if the zoneId now is 'ignoreSSFailuresZoneString', // which means the data distribution is disabled for storage failures. // Only clear this specific key is allowed, any other operations will throw error - #line 11406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via maintenanceCommitActor() - #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class MaintenanceCommitActorActorState { - #line 11413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" MaintenanceCommitActorActorState(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr) - #line 11422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("maintenanceCommitActor", reinterpret_cast(this)); @@ -11432,22 +11704,22 @@ class MaintenanceCommitActorActorState { int a_body1(int loopDepth=0) { try { - #line 2433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::LOCK_AWARE); - #line 2434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); - #line 2435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); - #line 2436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = ryw->getTransaction().get(healthyZoneKey); - #line 2436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 11450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11468,73 +11740,73 @@ class MaintenanceCommitActorActorState { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 2437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Optional> healthyZone = val.present() ? decodeHealthyZoneValue(val.get()) : Optional>(); - #line 2440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ranges = ryw->getSpecialKeySpaceWriteMap().containedRanges(kr); - #line 2442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key zoneId; - #line 2443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" double seconds; - #line 2444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool isSet = false; - #line 2448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(auto iter = ranges.begin();iter != ranges.end();++iter) { - #line 2449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!iter->value().first) - #line 11485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { continue; } - #line 2451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (iter->value().second.present()) - #line 11491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (isSet) - #line 11495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional(ManagementAPIError::toJsonString( false, "maintenance", "Multiple zones given for maintenance, only one allowed at the same time"))); this->~MaintenanceCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 11499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(ManagementAPIError::toJsonString( false, "maintenance", "Multiple zones given for maintenance, only one allowed at the same time"))); this->~MaintenanceCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" isSet = true; - #line 2456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" zoneId = iter->begin().removePrefix(kr.begin); - #line 2457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" seconds = boost::lexical_cast(iter->value().second.get().toString()); - #line 11511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 2460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!isSet && healthyZone.present() && iter.range().contains(healthyZone.get().first.withPrefix(kr.begin))) - #line 11517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().clear(healthyZoneKey); - #line 11521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } } - #line 2465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (isSet) - #line 11527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (healthyZone.present() && healthyZone.get().first == ignoreSSFailuresZoneString) - #line 11531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string msg = "Maintenance mode cannot be used while data distribution is disabled for storage " "server failures."; - #line 2469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional(ManagementAPIError::toJsonString(false, "maintenance", msg))); this->~MaintenanceCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 11537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(ManagementAPIError::toJsonString(false, "maintenance", msg))); this->~MaintenanceCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11542,15 +11814,15 @@ class MaintenanceCommitActorActorState { } else { - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (seconds < 0) - #line 11547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string msg = "The specified maintenance time " + boost::lexical_cast(seconds) + " is a negative value"; - #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional(ManagementAPIError::toJsonString(false, "maintenance", msg))); this->~MaintenanceCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 11553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(ManagementAPIError::toJsonString(false, "maintenance", msg))); this->~MaintenanceCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11558,17 +11830,17 @@ class MaintenanceCommitActorActorState { } else { - #line 2475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" TraceEvent(SevDebug, "SKSMaintenanceSet").detail("ZoneId", zoneId.toString()); - #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().set(healthyZoneKey, healthyZoneValue(zoneId, ryw->getTransaction().getReadVersion().get() + (seconds * CLIENT_KNOBS->CORE_VERSIONSPERSECOND))); - #line 11565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } } - #line 2482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~MaintenanceCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 11571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~MaintenanceCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11578,73 +11850,73 @@ class MaintenanceCommitActorActorState { } int a_body1cont1(Optional && val,int loopDepth) { - #line 2437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Optional> healthyZone = val.present() ? decodeHealthyZoneValue(val.get()) : Optional>(); - #line 2440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ranges = ryw->getSpecialKeySpaceWriteMap().containedRanges(kr); - #line 2442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key zoneId; - #line 2443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" double seconds; - #line 2444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool isSet = false; - #line 2448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(auto iter = ranges.begin();iter != ranges.end();++iter) { - #line 2449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!iter->value().first) - #line 11595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { continue; } - #line 2451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (iter->value().second.present()) - #line 11601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (isSet) - #line 11605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional(ManagementAPIError::toJsonString( false, "maintenance", "Multiple zones given for maintenance, only one allowed at the same time"))); this->~MaintenanceCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 11609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(ManagementAPIError::toJsonString( false, "maintenance", "Multiple zones given for maintenance, only one allowed at the same time"))); this->~MaintenanceCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" isSet = true; - #line 2456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" zoneId = iter->begin().removePrefix(kr.begin); - #line 2457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" seconds = boost::lexical_cast(iter->value().second.get().toString()); - #line 11621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 2460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!isSet && healthyZone.present() && iter.range().contains(healthyZone.get().first.withPrefix(kr.begin))) - #line 11627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().clear(healthyZoneKey); - #line 11631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } } - #line 2465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (isSet) - #line 11637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (healthyZone.present() && healthyZone.get().first == ignoreSSFailuresZoneString) - #line 11641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string msg = "Maintenance mode cannot be used while data distribution is disabled for storage " "server failures."; - #line 2469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional(ManagementAPIError::toJsonString(false, "maintenance", msg))); this->~MaintenanceCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 11647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(ManagementAPIError::toJsonString(false, "maintenance", msg))); this->~MaintenanceCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11652,15 +11924,15 @@ class MaintenanceCommitActorActorState { } else { - #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (seconds < 0) - #line 11657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::string msg = "The specified maintenance time " + boost::lexical_cast(seconds) + " is a negative value"; - #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional(ManagementAPIError::toJsonString(false, "maintenance", msg))); this->~MaintenanceCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 11663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(ManagementAPIError::toJsonString(false, "maintenance", msg))); this->~MaintenanceCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11668,17 +11940,17 @@ class MaintenanceCommitActorActorState { } else { - #line 2475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" TraceEvent(SevDebug, "SKSMaintenanceSet").detail("ZoneId", zoneId.toString()); - #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().set(healthyZoneKey, healthyZoneValue(zoneId, ryw->getTransaction().getReadVersion().get() + (seconds * CLIENT_KNOBS->CORE_VERSIONSPERSECOND))); - #line 11675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } } - #line 2482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~MaintenanceCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 11681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 11953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~MaintenanceCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11749,18 +12021,18 @@ class MaintenanceCommitActorActorState { fdb_probe_actor_exit("maintenanceCommitActor", reinterpret_cast(this), 0); } - #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 2440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeMap>, KeyRangeRef>::Ranges ranges; - #line 11758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via maintenanceCommitActor() - #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class MaintenanceCommitActorActor final : public Actor>, public ActorCallback< MaintenanceCommitActorActor, 0, Optional >, public FastAllocated, public MaintenanceCommitActorActorState { - #line 11763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -11769,9 +12041,9 @@ class MaintenanceCommitActorActor final : public Actor>, p void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< MaintenanceCommitActorActor, 0, Optional >; - #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" MaintenanceCommitActorActor(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr) - #line 11774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor>(), MaintenanceCommitActorActorState(ryw, kr) { @@ -11795,14 +12067,14 @@ friend struct ActorCallback< MaintenanceCommitActorActor, 0, Optional >; } }; } - #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] static Future> maintenanceCommitActor( ReadYourWritesTransaction* const& ryw, KeyRangeRef const& kr ) { - #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future>(new MaintenanceCommitActorActor(ryw, kr)); - #line 11802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 2484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 2556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Future> MaintenanceImpl::commit(ReadYourWritesTransaction* ryw) { return maintenanceCommitActor(ryw, getKeyRange()); @@ -11811,29 +12083,29 @@ Future> MaintenanceImpl::commit(ReadYourWritesTransaction* DataDistributionImpl::DataDistributionImpl(KeyRangeRef kr) : SpecialKeyRangeRWImpl(kr) {} // Read the system keys dataDistributionModeKey and rebalanceDDIgnoreKey - #line 11814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via DataDistributionGetRangeActor() - #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class DataDistributionGetRangeActorActorState { - #line 11821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" DataDistributionGetRangeActorActorState(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) - #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" prefix(prefix), - #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" kr(kr), - #line 2495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result(), - #line 2497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - modeKey(LiteralStringRef("mode").withPrefix(prefix)) - #line 11836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + modeKey("mode"_sr.withPrefix(prefix)) + #line 12108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("DataDistributionGetRangeActor", reinterpret_cast(this)); @@ -11846,28 +12118,28 @@ class DataDistributionGetRangeActorActorState { int a_body1(int loopDepth=0) { try { - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->getTransaction().setOption(FDBTransactionOptions::RAW_ACCESS); - #line 2501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.contains(modeKey)) - #line 11853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto entry = ryw->getSpecialKeySpaceWriteMap()[modeKey]; - #line 2503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (ryw->readYourWritesDisabled() || !entry.first) - #line 11859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = ryw->getTransaction().get(dataDistributionModeKey); - #line 2504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 11870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } else @@ -11898,28 +12170,28 @@ class DataDistributionGetRangeActorActorState { } int a_body1cont1(int loopDepth) { - #line 2513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - rebalanceIgnoredKey = LiteralStringRef("rebalance_ignored").withPrefix(prefix); - #line 2514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + rebalanceIgnoredKey = "rebalance_ignored"_sr.withPrefix(prefix); + #line 2586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.contains(rebalanceIgnoredKey)) - #line 11905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto entry = ryw->getSpecialKeySpaceWriteMap()[rebalanceIgnoredKey]; - #line 2516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (ryw->readYourWritesDisabled() || !entry.first) - #line 11911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_1 = ryw->getTransaction().get(rebalanceDDIgnoreKey); - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 11922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } else @@ -11942,38 +12214,38 @@ class DataDistributionGetRangeActorActorState { } int a_body1cont3(Optional const& f,int loopDepth) { - #line 2505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int mode = -1; - #line 2506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (f.present()) - #line 11949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" mode = BinaryReader::fromStringRef(f.get(), Unversioned()); - #line 11953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(modeKey, Value(boost::lexical_cast(mode)))); - #line 11957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; } int a_body1cont3(Optional && f,int loopDepth) { - #line 2505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int mode = -1; - #line 2506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (f.present()) - #line 11968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" mode = BinaryReader::fromStringRef(f.get(), Unversioned()); - #line 11972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(modeKey, Value(boost::lexical_cast(mode)))); - #line 11976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -12043,9 +12315,9 @@ class DataDistributionGetRangeActorActorState { } int a_body1cont6(int loopDepth) { - #line 2523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(rywGetRange(ryw, kr, result)); this->~DataDistributionGetRangeActorActorState(); static_cast(this)->destroy(); return 0; } - #line 12048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(rywGetRange(ryw, kr, result)); this->~DataDistributionGetRangeActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -12061,13 +12333,13 @@ class DataDistributionGetRangeActorActorState { } int a_body1cont8(Optional const& f,int loopDepth) { - #line 2518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (f.present()) - #line 12066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(rebalanceIgnoredKey, Value())); - #line 12070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } loopDepth = a_body1cont7(loopDepth); @@ -12075,13 +12347,13 @@ class DataDistributionGetRangeActorActorState { } int a_body1cont8(Optional && f,int loopDepth) { - #line 2518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (f.present()) - #line 12080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result.push_back_deep(result.arena(), KeyValueRef(rebalanceIgnoredKey, Value())); - #line 12084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } loopDepth = a_body1cont7(loopDepth); @@ -12150,24 +12422,24 @@ class DataDistributionGetRangeActorActorState { fdb_probe_actor_exit("DataDistributionGetRangeActor", reinterpret_cast(this), 1); } - #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRef prefix; - #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeyRangeRef kr; - #line 2495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 2497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key modeKey; - #line 2513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Key rebalanceIgnoredKey; - #line 12165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via DataDistributionGetRangeActor() - #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class DataDistributionGetRangeActorActor final : public Actor, public ActorCallback< DataDistributionGetRangeActorActor, 0, Optional >, public ActorCallback< DataDistributionGetRangeActorActor, 1, Optional >, public FastAllocated, public DataDistributionGetRangeActorActorState { - #line 12170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -12177,9 +12449,9 @@ class DataDistributionGetRangeActorActor final : public Actor, publ #pragma clang diagnostic pop friend struct ActorCallback< DataDistributionGetRangeActorActor, 0, Optional >; friend struct ActorCallback< DataDistributionGetRangeActorActor, 1, Optional >; - #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" DataDistributionGetRangeActorActor(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) - #line 12182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), DataDistributionGetRangeActorActorState(ryw, prefix, kr) { @@ -12204,14 +12476,14 @@ friend struct ActorCallback< DataDistributionGetRangeActorActor, 1, Optional DataDistributionGetRangeActor( ReadYourWritesTransaction* const& ryw, KeyRef const& prefix, KeyRangeRef const& kr ) { - #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new DataDistributionGetRangeActorActor(ryw, prefix, kr)); - #line 12211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 2525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 2597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Future DataDistributionImpl::getRange(ReadYourWritesTransaction* ryw, KeyRangeRef kr, @@ -12227,8 +12499,8 @@ Future> DataDistributionImpl::commit(ReadYourWritesTransac Optional msg; KeyRangeRef kr = getKeyRange(); - Key modeKey = LiteralStringRef("mode").withPrefix(kr.begin); - Key rebalanceIgnoredKey = LiteralStringRef("rebalance_ignored").withPrefix(kr.begin); + Key modeKey = "mode"_sr.withPrefix(kr.begin); + Key rebalanceIgnoredKey = "rebalance_ignored"_sr.withPrefix(kr.begin); auto ranges = ryw->getSpecialKeySpaceWriteMap().containedRanges(kr); for (auto iter = ranges.begin(); iter != ranges.end(); ++iter) { if (!iter->value().first) @@ -12238,7 +12510,7 @@ Future> DataDistributionImpl::commit(ReadYourWritesTransac try { int mode = boost::lexical_cast(iter->value().second.get().toString()); Value modeVal = BinaryWriter::toValue(mode, Unversioned()); - if (mode == 0 || mode == 1) { + if (mode == 0 || mode == 1 || mode == 2) { // Whenever configuration changes or DD related system keyspace is changed, // actor must grab the moveKeysLockOwnerKey and update moveKeysLockWriteKey. // This prevents concurrent write to the same system keyspace. @@ -12263,14 +12535,18 @@ Future> DataDistributionImpl::commit(ReadYourWritesTransac iter->value().second.get().toString()); } } else if (iter->range() == singleKeyRange(rebalanceIgnoredKey)) { - if (iter->value().second.get().size()) - msg = - ManagementAPIError::toJsonString(false, - "datadistribution", - "Value is unused for the data_distribution/rebalance_ignored " - "key, please set it to an empty value"); - else - ryw->getTransaction().set(rebalanceDDIgnoreKey, LiteralStringRef("on")); + ValueRef val = iter->value().second.get(); + try { + boost::lexical_cast(iter->value().second.get().toString()); + } catch (boost::bad_lexical_cast& e) { + ManagementAPIError::toJsonString( + false, + "datadistribution", + "Invalid datadistribution rebalance ignore option (int or empty): " + + iter->value().second.get().toString()); + val = ""_sr; + } + ryw->getTransaction().set(rebalanceDDIgnoreKey, iter->value().second.get()); } else { msg = ManagementAPIError::toJsonString( false, @@ -12368,31 +12644,31 @@ bool parseLocalitiesFromKeys(ReadYourWritesTransaction* ryw, // On commit, parses the special exclusion keys and get the localities to be excluded, check for exclusions // and add them to the exclusion list. Also, clears the special management api keys with includeLocalities. - #line 12371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via excludeLocalityCommitActor() - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class ExcludeLocalityCommitActorActorState { - #line 12378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ExcludeLocalityCommitActorActorState(ReadYourWritesTransaction* const& ryw,bool const& failed) - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" failed(failed), - #line 2682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result(), - #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" localities(), - #line 2684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" addresses(), - #line 2685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" exclusions() - #line 12395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("excludeLocalityCommitActor", reinterpret_cast(this)); @@ -12405,18 +12681,18 @@ class ExcludeLocalityCommitActorActorState { int a_body1(int loopDepth=0) { try { - #line 2687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ryw->setOption(FDBTransactionOptions::RAW_ACCESS); - #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture> __when_expr_0 = getWorkers(&ryw->getTransaction()); - #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 12419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -12437,34 +12713,34 @@ class ExcludeLocalityCommitActorActorState { } int a_body1cont1(int loopDepth) { - #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!parseLocalitiesFromKeys(ryw, failed, localities, addresses, exclusions, workers, result)) - #line 12442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(result); this->~ExcludeLocalityCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 12446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(result)); // state_var_RVO this->~ExcludeLocalityCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 2693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" auto force = ryw->getSpecialKeySpaceWriteMap()[SpecialKeySpace::getManagementApiCommandOptionSpecialKey( failed ? "failed_locality" : "excluded_locality", "force")]; - #line 2696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (localities.size() && !(force.first && force.second.present())) - #line 12456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_1 = checkExclusion(ryw->getDatabase(), &addresses, &exclusions, failed, &result); - #line 2697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } else @@ -12476,9 +12752,9 @@ class ExcludeLocalityCommitActorActorState { } int a_body1when1(std::vector const& __workers,int loopDepth) { - #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" workers = __workers; - #line 12481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -12543,29 +12819,29 @@ class ExcludeLocalityCommitActorActorState { } int a_body1cont2(int loopDepth) { - #line 2702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_2 = excludeLocalities(&ryw->getTransaction(), localities, failed); - #line 2702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4(bool const& safe,int loopDepth) { - #line 2698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!safe) - #line 12564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(result); this->~ExcludeLocalityCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 12568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(result)); // state_var_RVO this->~ExcludeLocalityCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -12577,13 +12853,13 @@ class ExcludeLocalityCommitActorActorState { } int a_body1cont4(bool && safe,int loopDepth) { - #line 2698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!safe) - #line 12582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(result); this->~ExcludeLocalityCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 12586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(result)); // state_var_RVO this->~ExcludeLocalityCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -12658,11 +12934,11 @@ class ExcludeLocalityCommitActorActorState { } int a_body1cont7(Void const& _,int loopDepth) { - #line 2703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" includeLocalities(ryw); - #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(result); this->~ExcludeLocalityCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 12665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(result)); // state_var_RVO this->~ExcludeLocalityCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -12672,11 +12948,11 @@ class ExcludeLocalityCommitActorActorState { } int a_body1cont7(Void && _,int loopDepth) { - #line 2703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" includeLocalities(ryw); - #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(result); this->~ExcludeLocalityCommitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 12679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 12955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(result)); // state_var_RVO this->~ExcludeLocalityCommitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -12747,26 +13023,26 @@ class ExcludeLocalityCommitActorActorState { fdb_probe_actor_exit("excludeLocalityCommitActor", reinterpret_cast(this), 2); } - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" bool failed; - #line 2682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Optional result; - #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::unordered_set localities; - #line 2684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::vector addresses; - #line 2685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::set exclusions; - #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::vector workers; - #line 12764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via excludeLocalityCommitActor() - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class ExcludeLocalityCommitActorActor final : public Actor>, public ActorCallback< ExcludeLocalityCommitActorActor, 0, std::vector >, public ActorCallback< ExcludeLocalityCommitActorActor, 1, bool >, public ActorCallback< ExcludeLocalityCommitActorActor, 2, Void >, public FastAllocated, public ExcludeLocalityCommitActorActorState { - #line 12769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -12777,9 +13053,9 @@ class ExcludeLocalityCommitActorActor final : public Actor friend struct ActorCallback< ExcludeLocalityCommitActorActor, 0, std::vector >; friend struct ActorCallback< ExcludeLocalityCommitActorActor, 1, bool >; friend struct ActorCallback< ExcludeLocalityCommitActorActor, 2, Void >; - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ExcludeLocalityCommitActorActor(ReadYourWritesTransaction* const& ryw,bool const& failed) - #line 12782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor>(), ExcludeLocalityCommitActorActorState(ryw, failed) { @@ -12805,14 +13081,14 @@ friend struct ActorCallback< ExcludeLocalityCommitActorActor, 2, Void >; } }; } - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future> excludeLocalityCommitActor( ReadYourWritesTransaction* const& ryw, bool const& failed ) { - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future>(new ExcludeLocalityCommitActorActor(ryw, failed)); - #line 12812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 2707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ExcludedLocalitiesRangeImpl::ExcludedLocalitiesRangeImpl(KeyRangeRef kr) : SpecialKeyRangeRWImpl(kr) {} @@ -12830,11 +13106,11 @@ void ExcludedLocalitiesRangeImpl::set(ReadYourWritesTransaction* ryw, const KeyR Key ExcludedLocalitiesRangeImpl::decode(const KeyRef& key) const { return key.removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin) - .withPrefix(LiteralStringRef("\xff/conf/")); + .withPrefix("\xff/conf/"_sr); } Key ExcludedLocalitiesRangeImpl::encode(const KeyRef& key) const { - return key.removePrefix(LiteralStringRef("\xff/conf/")) + return key.removePrefix("\xff/conf/"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin); } @@ -12859,11 +13135,11 @@ void FailedLocalitiesRangeImpl::set(ReadYourWritesTransaction* ryw, const KeyRef Key FailedLocalitiesRangeImpl::decode(const KeyRef& key) const { return key.removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin) - .withPrefix(LiteralStringRef("\xff/conf/")); + .withPrefix("\xff/conf/"_sr); } Key FailedLocalitiesRangeImpl::encode(const KeyRef& key) const { - return key.removePrefix(LiteralStringRef("\xff/conf/")) + return key.removePrefix("\xff/conf/"_sr) .withPrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin); } @@ -12872,316 +13148,70 @@ Future> FailedLocalitiesRangeImpl::commit(ReadYourWritesTr return excludeLocalityCommitActor(ryw, true); } - #line 12875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" -namespace { -// This generated class is to be used only via getTenantList() - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" -template - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" -class GetTenantListActorState { - #line 12882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" -public: - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - GetTenantListActorState(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr,GetRangeLimits const& limitsHint) - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - : ryw(ryw), - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - kr(kr), - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - limitsHint(limitsHint), - #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - managementPrefix(kr.begin.substr(0, SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin.size() + TenantMapRangeImpl::submoduleRange.begin.size())) - #line 12895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - { - fdb_probe_actor_create("getTenantList", reinterpret_cast(this)); - - } - ~GetTenantListActorState() - { - fdb_probe_actor_destroy("getTenantList", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 2772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - kr = kr.removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin); - #line 2773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - TenantNameRef beginTenant = kr.begin.removePrefix(TenantMapRangeImpl::submoduleRange.begin); - #line 2775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - TenantNameRef endTenant = kr.end; - #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (endTenant.startsWith(TenantMapRangeImpl::submoduleRange.begin)) - #line 12916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - { - #line 2777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - endTenant = endTenant.removePrefix(TenantMapRangeImpl::submoduleRange.begin); - #line 12920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - } - else - { - #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - endTenant = "\xff"_sr; - #line 12926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - } - #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - StrictFuture> __when_expr_0 = ManagementAPI::listTenantsTransaction(&ryw->getTransaction(), beginTenant, endTenant, limitsHint.rows); - #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 12937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~GetTenantListActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(std::map const& tenants,int loopDepth) - { - #line 2785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - RangeResult results; - #line 2786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - for( auto tenant : tenants ) { - #line 2787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - json_spirit::mObject tenantEntry; - #line 2788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - tenantEntry["id"] = tenant.second.id; - #line 2789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - tenantEntry["prefix"] = tenant.second.prefix.toString(); - #line 2790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - std::string tenantEntryString = json_spirit::write_string(json_spirit::mValue(tenantEntry)); - #line 2791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ValueRef tenantEntryBytes(results.arena(), tenantEntryString); - #line 2792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - results.push_back(results.arena(), KeyValueRef(tenant.first.withPrefix(managementPrefix, results.arena()), tenantEntryBytes)); - #line 12974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - } - #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(results); this->~GetTenantListActorState(); static_cast(this)->destroy(); return 0; } - #line 12978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(results); - this->~GetTenantListActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont1(std::map && tenants,int loopDepth) - { - #line 2785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - RangeResult results; - #line 2786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - for( auto tenant : tenants ) { - #line 2787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - json_spirit::mObject tenantEntry; - #line 2788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - tenantEntry["id"] = tenant.second.id; - #line 2789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - tenantEntry["prefix"] = tenant.second.prefix.toString(); - #line 2790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - std::string tenantEntryString = json_spirit::write_string(json_spirit::mValue(tenantEntry)); - #line 2791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ValueRef tenantEntryBytes(results.arena(), tenantEntryString); - #line 2792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - results.push_back(results.arena(), KeyValueRef(tenant.first.withPrefix(managementPrefix, results.arena()), tenantEntryBytes)); - #line 13004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - } - #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(results); this->~GetTenantListActorState(); static_cast(this)->destroy(); return 0; } - #line 13008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(results); - this->~GetTenantListActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1when1(std::map const& tenants,int loopDepth) - { - loopDepth = a_body1cont1(tenants, loopDepth); - - return loopDepth; - } - int a_body1when1(std::map && tenants,int loopDepth) - { - loopDepth = a_body1cont1(std::move(tenants), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetTenantListActor, 0, std::map >::remove(); - - } - void a_callback_fire(ActorCallback< GetTenantListActor, 0, std::map >*,std::map const& value) - { - fdb_probe_actor_enter("getTenantList", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getTenantList", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< GetTenantListActor, 0, std::map >*,std::map && value) - { - fdb_probe_actor_enter("getTenantList", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getTenantList", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< GetTenantListActor, 0, std::map >*,Error err) - { - fdb_probe_actor_enter("getTenantList", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getTenantList", reinterpret_cast(this), 0); - - } - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ReadYourWritesTransaction* ryw; - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - KeyRangeRef kr; - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - GetRangeLimits limitsHint; - #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - KeyRef managementPrefix; - #line 13087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" -}; -// This generated class is to be used only via getTenantList() - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" -class GetTenantListActor final : public Actor, public ActorCallback< GetTenantListActor, 0, std::map >, public FastAllocated, public GetTenantListActorState { - #line 13092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< GetTenantListActor, 0, std::map >; - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - GetTenantListActor(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr,GetRangeLimits const& limitsHint) - #line 13103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - : Actor(), - GetTenantListActorState(ryw, kr, limitsHint) - { - fdb_probe_actor_enter("getTenantList", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("getTenantList"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("getTenantList", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetTenantListActor, 0, std::map >*)0, actor_cancelled()); break; - } - - } -}; -} - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" -[[nodiscard]] Future getTenantList( ReadYourWritesTransaction* const& ryw, KeyRangeRef const& kr, GetRangeLimits const& limitsHint ) { - #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - return Future(new GetTenantListActor(ryw, kr, limitsHint)); - #line 13131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" -} - -#line 2798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +// Defined in ReadYourWrites.actor.cpp + #line 13152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" +[[nodiscard]] Future getWorkerInterfaces( Reference const& clusterRecord ); -TenantMapRangeImpl::TenantMapRangeImpl(KeyRangeRef kr) : SpecialKeyRangeRWImpl(kr) {} +#line 2844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +// Defined in NativeAPI.actor.cpp + #line 13157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" +[[nodiscard]] Future verifyInterfaceActor( Reference const& connectLock, ClientWorkerInterface const& workerInterf ); -Future TenantMapRangeImpl::getRange(ReadYourWritesTransaction* ryw, - KeyRangeRef kr, - GetRangeLimits limitsHint) const { - return getTenantList(ryw, kr, limitsHint); -} +#line 2846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 13144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { -// This generated class is to be used only via deleteTenantRange() - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" -template - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" -class DeleteTenantRangeActorState { - #line 13151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" +// This generated class is to be used only via workerInterfacesImplGetRangeActor() + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +template + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +class WorkerInterfacesImplGetRangeActorActorState { + #line 13169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - DeleteTenantRangeActorState(ReadYourWritesTransaction* const& ryw,TenantName const& beginTenant,TenantName const& endTenant) - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + WorkerInterfacesImplGetRangeActorActorState(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - beginTenant(beginTenant), - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - endTenant(endTenant) - #line 13162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + prefix(prefix), + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + kr(kr) + #line 13180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - fdb_probe_actor_create("deleteTenantRange", reinterpret_cast(this)); + fdb_probe_actor_create("workerInterfacesImplGetRangeActor", reinterpret_cast(this)); } - ~DeleteTenantRangeActorState() + ~WorkerInterfacesImplGetRangeActorActorState() { - fdb_probe_actor_destroy("deleteTenantRange", reinterpret_cast(this)); + fdb_probe_actor_destroy("workerInterfacesImplGetRangeActor", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - StrictFuture> __when_expr_0 = ManagementAPI::listTenantsTransaction(&ryw->getTransaction(), beginTenant, endTenant, CLIENT_KNOBS->TOO_MANY); - #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!ryw->getDatabase().getPtr() || !ryw->getDatabase()->getConnectionRecord()) + #line 13195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(RangeResult()); this->~WorkerInterfacesImplGetRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 13199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResult()); + this->~WorkerInterfacesImplGetRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + StrictFuture __when_expr_0 = getWorkerInterfaces(ryw->getDatabase()->getConnectionRecord()); + #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 13209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 13184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 13214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13194,105 +13224,104 @@ class DeleteTenantRangeActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~DeleteTenantRangeActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(std::map const& tenants,int loopDepth) - { - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (tenants.size() == CLIENT_KNOBS->TOO_MANY) - #line 13207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - { - #line 2812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - TraceEvent(SevWarn, "DeleteTenantRangeTooLange") .detail("BeginTenant", beginTenant) .detail("EndTenant", endTenant); - #line 2815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ryw->setSpecialKeySpaceErrorMsg("too many tenants to range delete"); - #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - return a_body1Catch1(special_keys_api_failure(), loopDepth); - #line 13215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - } - #line 2819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - std::vector> deleteFutures; - #line 2820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - for( auto tenant : tenants ) { - #line 2821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - deleteFutures.push_back(ManagementAPI::deleteTenantTransaction(&ryw->getTransaction(), tenant.first)); - #line 13223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - } - #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - StrictFuture __when_expr_1 = waitForAll(deleteFutures); - #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + this->~WorkerInterfacesImplGetRangeActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(std::map && tenants,int loopDepth) + int a_body1cont1(int loopDepth) { - #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (tenants.size() == CLIENT_KNOBS->TOO_MANY) - #line 13243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + auto [verify, _] = ryw->getSpecialKeySpaceWriteMap()[SpecialKeySpace::getManagementApiCommandOptionSpecialKey( "worker_interfaces", "verify")]; + #line 2857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + result = RangeResult(); + #line 2858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (verify) + #line 13241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - TraceEvent(SevWarn, "DeleteTenantRangeTooLange") .detail("BeginTenant", beginTenant) .detail("EndTenant", endTenant); - #line 2815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - ryw->setSpecialKeySpaceErrorMsg("too many tenants to range delete"); - #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - return a_body1Catch1(special_keys_api_failure(), loopDepth); - #line 13251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - } - #line 2819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - std::vector> deleteFutures; - #line 2820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - for( auto tenant : tenants ) { - #line 2821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - deleteFutures.push_back(ManagementAPI::deleteTenantTransaction(&ryw->getTransaction(), tenant.first)); + #line 2860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + Reference connectLock(new FlowLock(CLIENT_KNOBS->CLI_CONNECT_PARALLELISM)); + #line 2861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + verifyInterfs = std::vector>(); + #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + for( const auto& [k_, value] : interfs ) { + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + auto k = k_.withPrefix(prefix); + #line 2864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (kr.contains(k)) + #line 13253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + ClientWorkerInterface workerInterf = BinaryReader::fromStringRef(value, IncludeVersion()); + #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + verifyInterfs.push_back(verifyInterfaceActor(connectLock, workerInterf)); #line 13259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - } - #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - StrictFuture __when_expr_1 = waitForAll(deleteFutures); - #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + } + else + { + #line 2869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + verifyInterfs.push_back(false); #line 13265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - loopDepth = 0; + } + } + #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + StrictFuture __when_expr_1 = waitForAll(verifyInterfs); + #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 13272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 13277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 2882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + for( const auto& [k_, v] : interfs ) { + #line 2883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + auto k = k_.withPrefix(prefix); + #line 2884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (kr.contains(k)) + #line 13288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 2885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + result.push_back_deep(result.arena(), KeyValueRef(k, v)); + #line 13292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + } + } + loopDepth = a_body1cont3(loopDepth); + } return loopDepth; } - int a_body1when1(std::map const& tenants,int loopDepth) + int a_body1when1(RangeResult const& __interfs,int loopDepth) { - loopDepth = a_body1cont1(tenants, loopDepth); + #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + interfs = __interfs; + #line 13304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); return loopDepth; } - int a_body1when1(std::map && tenants,int loopDepth) + int a_body1when1(RangeResult && __interfs,int loopDepth) { - loopDepth = a_body1cont1(std::move(tenants), loopDepth); + interfs = std::move(__interfs); + loopDepth = a_body1cont1(loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DeleteTenantRangeActor, 0, std::map >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WorkerInterfacesImplGetRangeActorActor, 0, RangeResult >::remove(); } - void a_callback_fire(ActorCallback< DeleteTenantRangeActor, 0, std::map >*,std::map const& value) + void a_callback_fire(ActorCallback< WorkerInterfacesImplGetRangeActorActor, 0, RangeResult >*,RangeResult const& value) { - fdb_probe_actor_enter("deleteTenantRange", reinterpret_cast(this), 0); + fdb_probe_actor_enter("workerInterfacesImplGetRangeActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -13302,12 +13331,12 @@ class DeleteTenantRangeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("deleteTenantRange", reinterpret_cast(this), 0); + fdb_probe_actor_exit("workerInterfacesImplGetRangeActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< DeleteTenantRangeActor, 0, std::map >*,std::map && value) + void a_callback_fire(ActorCallback< WorkerInterfacesImplGetRangeActorActor, 0, RangeResult >*,RangeResult && value) { - fdb_probe_actor_enter("deleteTenantRange", reinterpret_cast(this), 0); + fdb_probe_actor_enter("workerInterfacesImplGetRangeActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -13317,12 +13346,12 @@ class DeleteTenantRangeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("deleteTenantRange", reinterpret_cast(this), 0); + fdb_probe_actor_exit("workerInterfacesImplGetRangeActor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< DeleteTenantRangeActor, 0, std::map >*,Error err) + void a_callback_error(ActorCallback< WorkerInterfacesImplGetRangeActorActor, 0, RangeResult >*,Error err) { - fdb_probe_actor_enter("deleteTenantRange", reinterpret_cast(this), 0); + fdb_probe_actor_enter("workerInterfacesImplGetRangeActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -13332,54 +13361,78 @@ class DeleteTenantRangeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("deleteTenantRange", reinterpret_cast(this), 0); + fdb_probe_actor_exit("workerInterfacesImplGetRangeActor", reinterpret_cast(this), 0); } - int a_body1cont2(Void const& _,int loopDepth) + int a_body1cont3(int loopDepth) { - #line 2825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteTenantRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 13342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~DeleteTenantRangeActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 2888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + std::sort(result.begin(), result.end(), KeyValueRef::OrderByKey{}); + #line 2889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(result); this->~WorkerInterfacesImplGetRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 13373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(result)); // state_var_RVO + this->~WorkerInterfacesImplGetRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1cont2(Void && _,int loopDepth) + int a_body1cont4(Void const& _,int loopDepth) { - #line 2825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteTenantRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 13354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~DeleteTenantRangeActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 2874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + for(int index = 0;index < interfs.size();index++) { + #line 2875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (verifyInterfs[index].get()) + #line 13387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 2877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + result.push_back_deep(result.arena(), KeyValueRef(interfs[index].key.withPrefix(prefix), interfs[index].value)); + #line 13391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + } + } + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1cont4(Void && _,int loopDepth) + { + #line 2874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + for(int index = 0;index < interfs.size();index++) { + #line 2875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + if (verifyInterfs[index].get()) + #line 13404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + { + #line 2877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + result.push_back_deep(result.arena(), KeyValueRef(interfs[index].key.withPrefix(prefix), interfs[index].value)); + #line 13408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + } + } + loopDepth = a_body1cont3(loopDepth); return loopDepth; } int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(_, loopDepth); + loopDepth = a_body1cont4(_, loopDepth); return loopDepth; } int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2(std::move(_), loopDepth); + loopDepth = a_body1cont4(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DeleteTenantRangeActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WorkerInterfacesImplGetRangeActorActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< DeleteTenantRangeActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< WorkerInterfacesImplGetRangeActorActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("deleteTenantRange", reinterpret_cast(this), 1); + fdb_probe_actor_enter("workerInterfacesImplGetRangeActor", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -13389,12 +13442,12 @@ class DeleteTenantRangeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("deleteTenantRange", reinterpret_cast(this), 1); + fdb_probe_actor_exit("workerInterfacesImplGetRangeActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< DeleteTenantRangeActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< WorkerInterfacesImplGetRangeActorActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("deleteTenantRange", reinterpret_cast(this), 1); + fdb_probe_actor_enter("workerInterfacesImplGetRangeActor", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -13404,12 +13457,12 @@ class DeleteTenantRangeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("deleteTenantRange", reinterpret_cast(this), 1); + fdb_probe_actor_exit("workerInterfacesImplGetRangeActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< DeleteTenantRangeActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< WorkerInterfacesImplGetRangeActorActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("deleteTenantRange", reinterpret_cast(this), 1); + fdb_probe_actor_enter("workerInterfacesImplGetRangeActor", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -13419,43 +13472,49 @@ class DeleteTenantRangeActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("deleteTenantRange", reinterpret_cast(this), 1); + fdb_probe_actor_exit("workerInterfacesImplGetRangeActor", reinterpret_cast(this), 1); } - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - TenantName beginTenant; - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - TenantName endTenant; - #line 13431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + KeyRef prefix; + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + KeyRangeRef kr; + #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + RangeResult interfs; + #line 2857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + RangeResult result; + #line 2861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + std::vector> verifyInterfs; + #line 13490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; -// This generated class is to be used only via deleteTenantRange() - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" -class DeleteTenantRangeActor final : public Actor, public ActorCallback< DeleteTenantRangeActor, 0, std::map >, public ActorCallback< DeleteTenantRangeActor, 1, Void >, public FastAllocated, public DeleteTenantRangeActorState { - #line 13436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" +// This generated class is to be used only via workerInterfacesImplGetRangeActor() + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +class WorkerInterfacesImplGetRangeActorActor final : public Actor, public ActorCallback< WorkerInterfacesImplGetRangeActorActor, 0, RangeResult >, public ActorCallback< WorkerInterfacesImplGetRangeActorActor, 1, Void >, public FastAllocated, public WorkerInterfacesImplGetRangeActorActorState { + #line 13495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< DeleteTenantRangeActor, 0, std::map >; -friend struct ActorCallback< DeleteTenantRangeActor, 1, Void >; - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - DeleteTenantRangeActor(ReadYourWritesTransaction* const& ryw,TenantName const& beginTenant,TenantName const& endTenant) - #line 13448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" - : Actor(), - DeleteTenantRangeActorState(ryw, beginTenant, endTenant) +friend struct ActorCallback< WorkerInterfacesImplGetRangeActorActor, 0, RangeResult >; +friend struct ActorCallback< WorkerInterfacesImplGetRangeActorActor, 1, Void >; + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + WorkerInterfacesImplGetRangeActorActor(ReadYourWritesTransaction* const& ryw,KeyRef const& prefix,KeyRangeRef const& kr) + #line 13507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + : Actor(), + WorkerInterfacesImplGetRangeActorActorState(ryw, prefix, kr) { - fdb_probe_actor_enter("deleteTenantRange", reinterpret_cast(this), -1); + fdb_probe_actor_enter("workerInterfacesImplGetRangeActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("deleteTenantRange"); + this->lineage.setActorName("workerInterfacesImplGetRangeActor"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("deleteTenantRange", reinterpret_cast(this), -1); + fdb_probe_actor_exit("workerInterfacesImplGetRangeActor", reinterpret_cast(this), -1); } void cancel() override @@ -13463,84 +13522,55 @@ friend struct ActorCallback< DeleteTenantRangeActor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< DeleteTenantRangeActor, 0, std::map >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< DeleteTenantRangeActor, 1, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< WorkerInterfacesImplGetRangeActorActor, 0, RangeResult >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WorkerInterfacesImplGetRangeActorActor, 1, Void >*)0, actor_cancelled()); break; } } }; } - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" -[[nodiscard]] Future deleteTenantRange( ReadYourWritesTransaction* const& ryw, TenantName const& beginTenant, TenantName const& endTenant ) { - #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - return Future(new DeleteTenantRangeActor(ryw, beginTenant, endTenant)); - #line 13477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +[[nodiscard]] static Future workerInterfacesImplGetRangeActor( ReadYourWritesTransaction* const& ryw, KeyRef const& prefix, KeyRangeRef const& kr ) { + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + return Future(new WorkerInterfacesImplGetRangeActorActor(ryw, prefix, kr)); + #line 13536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - -Future> TenantMapRangeImpl::commit(ReadYourWritesTransaction* ryw) { - auto ranges = ryw->getSpecialKeySpaceWriteMap().containedRanges(range); - std::vector> tenantManagementFutures; - for (auto range : ranges) { - if (!range.value().first) { - continue; - } - - TenantNameRef tenantName = - range.begin() - .removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin) - .removePrefix(TenantMapRangeImpl::submoduleRange.begin); +#line 2891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - if (range.value().second.present()) { - tenantManagementFutures.push_back( - success(ManagementAPI::createTenantTransaction(&ryw->getTransaction(), tenantName))); - } else { - // For a single key clear, just issue the delete - if (KeyRangeRef(range.begin(), range.end()).singleKeyRange()) { - tenantManagementFutures.push_back( - ManagementAPI::deleteTenantTransaction(&ryw->getTransaction(), tenantName)); - } else { - TenantNameRef endTenant = range.end().removePrefix( - SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin); - if (endTenant.startsWith(submoduleRange.begin)) { - endTenant = endTenant.removePrefix(submoduleRange.begin); - } else { - endTenant = "\xff"_sr; - } - tenantManagementFutures.push_back(deleteTenantRange(ryw, tenantName, endTenant)); - } - } - } +WorkerInterfacesSpecialKeyImpl::WorkerInterfacesSpecialKeyImpl(KeyRangeRef kr) : SpecialKeyRangeReadImpl(kr) {} - return tag(waitForAll(tenantManagementFutures), Optional()); +Future WorkerInterfacesSpecialKeyImpl::getRange(ReadYourWritesTransaction* ryw, + KeyRangeRef kr, + GetRangeLimits limitsHint) const { + return workerInterfacesImplGetRangeActor(ryw, getKeyRange().begin, kr); } - #line 13519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" namespace { // This generated class is to be used only via validateSpecialSubrangeRead() - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" template - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class ValidateSpecialSubrangeReadActorState { - #line 13526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ValidateSpecialSubrangeReadActorState(ReadYourWritesTransaction* const& ryw,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Reverse const& reverse,RangeResult const& result) - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" : ryw(ryw), - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" begin(begin), - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" end(end), - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" limits(limits), - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" reverse(reverse), - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" result(result) - #line 13543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { fdb_probe_actor_create("validateSpecialSubrangeRead", reinterpret_cast(this)); @@ -13553,20 +13583,20 @@ class ValidateSpecialSubrangeReadActorState { int a_body1(int loopDepth=0) { try { - #line 2871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!result.size()) - #line 13558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_0 = ryw->getRange(begin, end, limits, Snapshot::True, reverse); - #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; } else @@ -13592,110 +13622,110 @@ class ValidateSpecialSubrangeReadActorState { } int a_body1cont1(int loopDepth) { - #line 2877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (reverse) - #line 13597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(std::is_sorted(result.begin(), result.end(), KeyValueRef::OrderByKeyBack{})); - #line 13601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } else { - #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(std::is_sorted(result.begin(), result.end(), KeyValueRef::OrderByKey{})); - #line 13607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::vector candidateKeys; - #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (reverse) - #line 13613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(int i = result.size() - 1;i >= 0;--i) { - #line 2888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" candidateKeys.emplace_back(result[i].key); - #line 2889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (i - 1 >= 0) - #line 13621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" candidateKeys.emplace_back(keyBetween(KeyRangeRef(result[i].key, result[i - 1].key))); - #line 13625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } } else { - #line 2894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(int i = 0;i < result.size();++i) { - #line 2895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" candidateKeys.emplace_back(result[i].key); - #line 2896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (i + 1 < result.size()) - #line 13637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" candidateKeys.emplace_back(keyBetween(KeyRangeRef(result[i].key, result[i + 1].key))); - #line 13641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } } - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::sort(candidateKeys.begin(), candidateKeys.end()); - #line 2902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" int originalSize = candidateKeys.size(); - #line 2904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for(int i = 0;i < originalSize - 1;++i) { - #line 2905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" candidateKeys.emplace_back(keyBetween(KeyRangeRef(candidateKeys[i], candidateKeys[i + 1]))); - #line 13653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::vector keys; - #line 2908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" keys = { deterministicRandom()->randomChoice(candidateKeys), deterministicRandom()->randomChoice(candidateKeys) }; - #line 2909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" std::sort(keys.begin(), keys.end()); - #line 2910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" testBegin = firstGreaterOrEqual(keys[0]); - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" testEnd = firstGreaterOrEqual(keys[1]); - #line 2915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" expectedResult = RangeResult(); - #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& kr : result ) { - #line 2919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (kr.key >= keys[0] && kr.key < keys[1]) - #line 13671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" expectedResult.push_back(expectedResult.arena(), kr); - #line 13675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } } - #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" StrictFuture __when_expr_1 = ryw->getRange(testBegin, testEnd, limits, Snapshot::True, reverse); - #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(RangeResult const& testResult,int loopDepth) { - #line 2873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(testResult == result); - #line 2874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ValidateSpecialSubrangeReadActorState(); static_cast(this)->destroy(); return 0; } - #line 13698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ValidateSpecialSubrangeReadActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -13705,11 +13735,11 @@ class ValidateSpecialSubrangeReadActorState { } int a_body1cont2(RangeResult && testResult,int loopDepth) { - #line 2873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(testResult == result); - #line 2874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ValidateSpecialSubrangeReadActorState(); static_cast(this)->destroy(); return 0; } - #line 13712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ValidateSpecialSubrangeReadActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -13782,47 +13812,47 @@ class ValidateSpecialSubrangeReadActorState { } int a_body1cont4(RangeResult const& testResult,int loopDepth) { - #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (testResult != expectedResult) - #line 13787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print("Reverse: {}\n", reverse); - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print("Original range: [{}, {})\n", begin.toString(), end.toString()); - #line 2929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print("Original result:\n"); - #line 2930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& kr : result ) { - #line 2931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print(" {} -> {}\n", kr.key.printable(), kr.value.printable()); - #line 13799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print("Test range: [{}, {})\n", testBegin.getKey().printable(), testEnd.getKey().printable()); - #line 2934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print("Expected:\n"); - #line 2935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& kr : expectedResult ) { - #line 2936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print(" {} -> {}\n", kr.key.printable(), kr.value.printable()); - #line 13809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print("Got:\n"); - #line 2939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& kr : testResult ) { - #line 2940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print(" {} -> {}\n", kr.key.printable(), kr.value.printable()); - #line 13817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(testResult == expectedResult); - #line 13821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ValidateSpecialSubrangeReadActorState(); static_cast(this)->destroy(); return 0; } - #line 13825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ValidateSpecialSubrangeReadActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -13832,47 +13862,47 @@ class ValidateSpecialSubrangeReadActorState { } int a_body1cont4(RangeResult && testResult,int loopDepth) { - #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (testResult != expectedResult) - #line 13837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" { - #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print("Reverse: {}\n", reverse); - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print("Original range: [{}, {})\n", begin.toString(), end.toString()); - #line 2929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print("Original result:\n"); - #line 2930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& kr : result ) { - #line 2931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print(" {} -> {}\n", kr.key.printable(), kr.value.printable()); - #line 13849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print("Test range: [{}, {})\n", testBegin.getKey().printable(), testEnd.getKey().printable()); - #line 2934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print("Expected:\n"); - #line 2935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& kr : expectedResult ) { - #line 2936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print(" {} -> {}\n", kr.key.printable(), kr.value.printable()); - #line 13859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print("Got:\n"); - #line 2939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" for( const auto& kr : testResult ) { - #line 2940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" fmt::print(" {} -> {}\n", kr.key.printable(), kr.value.printable()); - #line 13867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ASSERT(testResult == expectedResult); - #line 13871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } - #line 2944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ValidateSpecialSubrangeReadActorState(); static_cast(this)->destroy(); return 0; } - #line 13875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ValidateSpecialSubrangeReadActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -13943,30 +13973,30 @@ class ValidateSpecialSubrangeReadActorState { fdb_probe_actor_exit("validateSpecialSubrangeRead", reinterpret_cast(this), 1); } - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ReadYourWritesTransaction* ryw; - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeySelector begin; - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeySelector end; - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" GetRangeLimits limits; - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" Reverse reverse; - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult result; - #line 2910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeySelector testBegin; - #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" KeySelector testEnd; - #line 2915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" RangeResult expectedResult; - #line 13964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" }; // This generated class is to be used only via validateSpecialSubrangeRead() - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" class ValidateSpecialSubrangeReadActor final : public Actor, public ActorCallback< ValidateSpecialSubrangeReadActor, 0, RangeResult >, public ActorCallback< ValidateSpecialSubrangeReadActor, 1, RangeResult >, public FastAllocated, public ValidateSpecialSubrangeReadActorState { - #line 13969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 13999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -13976,9 +14006,9 @@ class ValidateSpecialSubrangeReadActor final : public Actor, public ActorC #pragma clang diagnostic pop friend struct ActorCallback< ValidateSpecialSubrangeReadActor, 0, RangeResult >; friend struct ActorCallback< ValidateSpecialSubrangeReadActor, 1, RangeResult >; - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" ValidateSpecialSubrangeReadActor(ReadYourWritesTransaction* const& ryw,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Reverse const& reverse,RangeResult const& result) - #line 13981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 14011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" : Actor(), ValidateSpecialSubrangeReadActorState(ryw, begin, end, limits, reverse, result) { @@ -14003,11 +14033,11 @@ friend struct ActorCallback< ValidateSpecialSubrangeReadActor, 1, RangeResult >; } }; } - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" [[nodiscard]] Future validateSpecialSubrangeRead( ReadYourWritesTransaction* const& ryw, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Reverse const& reverse, RangeResult const& result ) { - #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" return Future(new ValidateSpecialSubrangeReadActor(ryw, begin, end, limits, reverse, result)); - #line 14010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" + #line 14040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.cpp" } -#line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" +#line 2981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.cpp" diff --git a/src/fdbclient/StatusClient.actor.cpp b/src/fdbclient/StatusClient.actor.cpp index 653b849..cfad730 100644 --- a/src/fdbclient/StatusClient.actor.cpp +++ b/src/fdbclient/StatusClient.actor.cpp @@ -349,13 +349,7 @@ ACTOR Future> clientCoordinatorsStatusFetcher(Reference(this)->SAV>::futures) { (void)(Optional()); this->~ClientCoordinatorsStatusFetcherActorState(); static_cast(this)->destroy(); return 0; } #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); @@ -453,60 +453,48 @@ class ClientCoordinatorsStatusFetcherActorState { #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusObject coordStatus; #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" - if (coord.clientLeaderServers[i].hostname.present()) - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" - { + coordStatus["address"] = coord.clientLeaderServers[i].getAddressString(); #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" - coordStatus["address"] = coord.clientLeaderServers[i].hostname.get().toString(); - #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" - } - else - { - #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" - coordStatus["address"] = coord.clientLeaderServers[i].getLeader.getEndpoint().getPrimaryAddress().toString(); - #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" - } - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (leaderServers[i].isReady()) - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" coordStatus["reachable"] = true; - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } else { - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" coordinatorsUnavailable++; - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" coordStatus["reachable"] = false; - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } - #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (coordProtocols[i].isReady()) - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" uint64_t protocolVersionInt = coordProtocols[i].get().version.version(); - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" std::stringstream hexSs; - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" hexSs << std::hex << std::setw(2 * sizeof(protocolVersionInt)) << std::setfill('0') << protocolVersionInt; - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" coordStatus["protocol"] = hexSs.str(); - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" coordsStatus.push_back(coordStatus); - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObj["coordinators"] = coordsStatus; - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" *coordinatorsFaultTolerance = (leaderServers.size() - 1) / 2 - coordinatorsUnavailable; - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(statusObj); this->~ClientCoordinatorsStatusFetcherActorState(); static_cast(this)->destroy(); return 0; } - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(statusObj)); // state_var_RVO this->~ClientCoordinatorsStatusFetcherActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -527,60 +515,48 @@ class ClientCoordinatorsStatusFetcherActorState { #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusObject coordStatus; #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" - if (coord.clientLeaderServers[i].hostname.present()) - #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" - { + coordStatus["address"] = coord.clientLeaderServers[i].getAddressString(); #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" - coordStatus["address"] = coord.clientLeaderServers[i].hostname.get().toString(); - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" - } - else - { - #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" - coordStatus["address"] = coord.clientLeaderServers[i].getLeader.getEndpoint().getPrimaryAddress().toString(); - #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" - } - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (leaderServers[i].isReady()) - #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" coordStatus["reachable"] = true; - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } else { - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" coordinatorsUnavailable++; - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" coordStatus["reachable"] = false; - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } - #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (coordProtocols[i].isReady()) - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" uint64_t protocolVersionInt = coordProtocols[i].get().version.version(); - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" std::stringstream hexSs; - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" hexSs << std::hex << std::setw(2 * sizeof(protocolVersionInt)) << std::setfill('0') << protocolVersionInt; - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" coordStatus["protocol"] = hexSs.str(); - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" coordsStatus.push_back(coordStatus); - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObj["coordinators"] = coordsStatus; - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" *coordinatorsFaultTolerance = (leaderServers.size() - 1) / 2 - coordinatorsUnavailable; - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(statusObj); this->~ClientCoordinatorsStatusFetcherActorState(); static_cast(this)->destroy(); return 0; } - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(statusObj)); // state_var_RVO this->~ClientCoordinatorsStatusFetcherActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -665,12 +641,12 @@ class ClientCoordinatorsStatusFetcherActorState { std::vector>> leaderServers; #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" std::vector> coordProtocols; - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" }; // This generated class is to be used only via clientCoordinatorsStatusFetcher() #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" class ClientCoordinatorsStatusFetcherActor final : public Actor>, public ActorCallback< ClientCoordinatorsStatusFetcherActor, 0, Void >, public FastAllocated, public ClientCoordinatorsStatusFetcherActorState { - #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -681,7 +657,7 @@ class ClientCoordinatorsStatusFetcherActor final : public Actor; #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" ClientCoordinatorsStatusFetcherActor(Reference const& connRecord,bool* const& quorum_reachable,int* const& coordinatorsFaultTolerance) - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" : Actor>(), ClientCoordinatorsStatusFetcherActorState(connRecord, quorum_reachable, coordinatorsFaultTolerance) { @@ -709,36 +685,36 @@ friend struct ActorCallback< ClientCoordinatorsStatusFetcherActor, 0, Void >; [[nodiscard]] Future> clientCoordinatorsStatusFetcher( Reference const& connRecord, bool* const& quorum_reachable, int* const& coordinatorsFaultTolerance ) { #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" return Future>(new ClientCoordinatorsStatusFetcherActor(connRecord, quorum_reachable, coordinatorsFaultTolerance)); - #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } -#line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" +#line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" // Client section of the json output // Will NOT throw, errors will be put into messages array - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" namespace { // This generated class is to be used only via clientStatusFetcher() - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" template - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" class ClientStatusFetcherActorState { - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" public: - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" ClientStatusFetcherActorState(Reference const& connRecord,StatusArray* const& messages,bool* const& quorum_reachable,int* const& coordinatorsFaultTolerance) - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" : connRecord(connRecord), - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" messages(messages), - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" quorum_reachable(quorum_reachable), - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" coordinatorsFaultTolerance(coordinatorsFaultTolerance), - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObj() - #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { fdb_probe_actor_create("clientStatusFetcher", reinterpret_cast(this)); @@ -751,16 +727,16 @@ class ClientStatusFetcherActorState { int a_body1(int loopDepth=0) { try { - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StrictFuture> __when_expr_0 = clientCoordinatorsStatusFetcher(connRecord, quorum_reachable, coordinatorsFaultTolerance); - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -781,25 +757,25 @@ class ClientStatusFetcherActorState { } int a_body1cont1(int loopDepth) { - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StrictFuture __when_expr_1 = connRecord->upToDate(); - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(Optional const& __coordsStatusObj,int loopDepth) { - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" coordsStatusObj = __coordsStatusObj; - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -864,49 +840,49 @@ class ClientStatusFetcherActorState { } int a_body1cont2(int loopDepth) { - #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (coordsStatusObj.present()) - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObj["coordinators"] = coordsStatusObj.get(); - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (!*quorum_reachable) - #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" messages->push_back(makeMessage("quorum_not_reachable", "Unable to reach a quorum of coordinators.")); - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } } else { - #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" messages->push_back(makeMessage("status_incomplete_coordinators", "Could not fetch coordinator info.")); - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusObject statusObjClusterFile; - #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObjClusterFile["path"] = connRecord->getLocation(); - #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObjClusterFile["up_to_date"] = contentsUpToDate; - #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObj["cluster_file"] = statusObjClusterFile; - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (!contentsUpToDate) - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StrictFuture __when_expr_2 = connRecord->getStoredConnectionString(); - #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = 0; } else @@ -918,9 +894,9 @@ class ClientStatusFetcherActorState { } int a_body1cont1when1(bool const& __contentsUpToDate,int loopDepth) { - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" contentsUpToDate = __contentsUpToDate; - #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -985,9 +961,9 @@ class ClientStatusFetcherActorState { } int a_body1cont3(int loopDepth) { - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(statusObj); this->~ClientStatusFetcherActorState(); static_cast(this)->destroy(); return 0; } - #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" new (&static_cast(this)->SAV< StatusObject >::value()) StatusObject(std::move(statusObj)); // state_var_RVO this->~ClientStatusFetcherActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -997,42 +973,42 @@ class ClientStatusFetcherActorState { } int a_body1cont7(ClusterConnectionString const& storedConnectionString,int loopDepth) { - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" std::string description = "Cluster file contents do not match current cluster connection string."; - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" description += "\nThe file contains the connection string: "; - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" description += storedConnectionString.toString().c_str(); - #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" description += "\nThe current connection string is: "; - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" description += connRecord->getConnectionString().toString().c_str(); - #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" description += "\nVerify the cluster file and its parent directory are writable and that the cluster file has " "not been overwritten externally. To change coordinators without manual intervention, the " "cluster file and its containing folder must be writable by all servers and clients. If a " "majority of the coordinators referenced by the old connection string are lost, the database " "will stop working until the correct cluster file is distributed to all processes."; - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" messages->push_back(makeMessage("incorrect_cluster_file_contents", description.c_str())); - #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; } int a_body1cont7(ClusterConnectionString && storedConnectionString,int loopDepth) { - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" std::string description = "Cluster file contents do not match current cluster connection string."; - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" description += "\nThe file contains the connection string: "; - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" description += storedConnectionString.toString().c_str(); - #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" description += "\nThe current connection string is: "; - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" description += connRecord->getConnectionString().toString().c_str(); - #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" description += "\nVerify the cluster file and its parent directory are writable and that the cluster file has " "not been overwritten externally. To change coordinators without manual intervention, the " "cluster file and its containing folder must be writable by all servers and clients. If a " "majority of the coordinators referenced by the old connection string are lost, the database " "will stop working until the correct cluster file is distributed to all processes."; - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" messages->push_back(makeMessage("incorrect_cluster_file_contents", description.c_str())); - #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; @@ -1100,26 +1076,26 @@ class ClientStatusFetcherActorState { fdb_probe_actor_exit("clientStatusFetcher", reinterpret_cast(this), 2); } - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" Reference connRecord; - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusArray* messages; - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" bool* quorum_reachable; - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" int* coordinatorsFaultTolerance; - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusObject statusObj; - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" Optional coordsStatusObj; - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" bool contentsUpToDate; - #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" }; // This generated class is to be used only via clientStatusFetcher() - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" class ClientStatusFetcherActor final : public Actor, public ActorCallback< ClientStatusFetcherActor, 0, Optional >, public ActorCallback< ClientStatusFetcherActor, 1, bool >, public ActorCallback< ClientStatusFetcherActor, 2, ClusterConnectionString >, public FastAllocated, public ClientStatusFetcherActorState { - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1130,9 +1106,9 @@ class ClientStatusFetcherActor final : public Actor, public ActorC friend struct ActorCallback< ClientStatusFetcherActor, 0, Optional >; friend struct ActorCallback< ClientStatusFetcherActor, 1, bool >; friend struct ActorCallback< ClientStatusFetcherActor, 2, ClusterConnectionString >; - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" ClientStatusFetcherActor(Reference const& connRecord,StatusArray* const& messages,bool* const& quorum_reachable,int* const& coordinatorsFaultTolerance) - #line 1135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" : Actor(), ClientStatusFetcherActorState(connRecord, messages, quorum_reachable, coordinatorsFaultTolerance) { @@ -1158,39 +1134,39 @@ friend struct ActorCallback< ClientStatusFetcherActor, 2, ClusterConnectionStrin } }; } - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" [[nodiscard]] Future clientStatusFetcher( Reference const& connRecord, StatusArray* const& messages, bool* const& quorum_reachable, int* const& coordinatorsFaultTolerance ) { - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" return Future(new ClientStatusFetcherActor(connRecord, messages, quorum_reachable, coordinatorsFaultTolerance)); - #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } -#line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" +#line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" // Cluster section of json output - #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" namespace { // This generated class is to be used only via clusterStatusFetcher() - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" template - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" class ClusterStatusFetcherActorState { - #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" public: - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" ClusterStatusFetcherActorState(ClusterInterface const& cI,StatusArray* const& messages) - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" : cI(cI), - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" messages(messages), - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" req(), - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" clusterTimeout(delay(30.0)), - #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" oStatusObj() - #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { fdb_probe_actor_create("clusterStatusFetcher", reinterpret_cast(this)); @@ -1203,16 +1179,16 @@ class ClusterStatusFetcherActorState { int a_body1(int loopDepth=0) { try { - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StrictFuture __when_expr_0 = delay(0.0); - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1233,22 +1209,22 @@ class ClusterStatusFetcherActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusReply = cI.databaseStatus.tryGetReply(req); - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" ; - #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusReply = cI.databaseStatus.tryGetReply(req); - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" ; - #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -1318,9 +1294,9 @@ class ClusterStatusFetcherActorState { } int a_body1cont2(int loopDepth) { - #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(oStatusObj); this->~ClusterStatusFetcherActorState(); static_cast(this)->destroy(); return 0; } - #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(std::move(oStatusObj)); // state_var_RVO this->~ClusterStatusFetcherActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1337,22 +1313,22 @@ class ClusterStatusFetcherActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StrictFuture> __when_expr_1 = statusReply; - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StrictFuture __when_expr_2 = clusterTimeout; - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1372,41 +1348,41 @@ class ClusterStatusFetcherActorState { } int a_body1cont1loopBody1when1(ErrorOr const& result,int loopDepth) { - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (result.isError()) - #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (result.getError().code() == error_code_request_maybe_delivered) - #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" messages->push_back(makeMessage("unreachable_cluster_controller", ("Unable to communicate with the cluster controller at " + cI.address().toString() + " to get status.") .c_str())); - #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } else { - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (result.getError().code() == error_code_server_overloaded) - #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" messages->push_back(makeMessage("server_overloaded", "The cluster controller is currently processing too many " "status requests and is unable to respond")); - #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } else { - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" messages->push_back( makeMessage("status_incomplete_error", "Cluster encountered an error fetching status.")); - #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } } } else { - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" oStatusObj = result.get().statusObj; - #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break @@ -1414,41 +1390,41 @@ class ClusterStatusFetcherActorState { } int a_body1cont1loopBody1when1(ErrorOr && result,int loopDepth) { - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (result.isError()) - #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (result.getError().code() == error_code_request_maybe_delivered) - #line 1423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" messages->push_back(makeMessage("unreachable_cluster_controller", ("Unable to communicate with the cluster controller at " + cI.address().toString() + " to get status.") .c_str())); - #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } else { - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (result.getError().code() == error_code_server_overloaded) - #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" messages->push_back(makeMessage("server_overloaded", "The cluster controller is currently processing too many " "status requests and is unable to respond")); - #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } else { - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" messages->push_back( makeMessage("status_incomplete_error", "Cluster encountered an error fetching status.")); - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } } } else { - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" oStatusObj = result.get().statusObj; - #line 1451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break @@ -1456,18 +1432,18 @@ class ClusterStatusFetcherActorState { } int a_body1cont1loopBody1when2(Void const& _,int loopDepth) { - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" messages->push_back(makeMessage("status_incomplete_timeout", "Timed out fetching cluster status.")); - #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1cont1loopBody1when2(Void && _,int loopDepth) { - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" messages->push_back(makeMessage("status_incomplete_timeout", "Timed out fetching cluster status.")); - #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -1569,24 +1545,24 @@ class ClusterStatusFetcherActorState { fdb_probe_actor_exit("clusterStatusFetcher", reinterpret_cast(this), 2); } - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" ClusterInterface cI; - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusArray* messages; - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusRequest req; - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" Future clusterTimeout; - #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" Optional oStatusObj; - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" Future> statusReply; - #line 1584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" }; // This generated class is to be used only via clusterStatusFetcher() - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" class ClusterStatusFetcherActor final : public Actor>, public ActorCallback< ClusterStatusFetcherActor, 0, Void >, public ActorCallback< ClusterStatusFetcherActor, 1, ErrorOr >, public ActorCallback< ClusterStatusFetcherActor, 2, Void >, public FastAllocated, public ClusterStatusFetcherActorState { - #line 1589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1597,9 +1573,9 @@ class ClusterStatusFetcherActor final : public Actor>, pu friend struct ActorCallback< ClusterStatusFetcherActor, 0, Void >; friend struct ActorCallback< ClusterStatusFetcherActor, 1, ErrorOr >; friend struct ActorCallback< ClusterStatusFetcherActor, 2, Void >; - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" ClusterStatusFetcherActor(ClusterInterface const& cI,StatusArray* const& messages) - #line 1602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" : Actor>(), ClusterStatusFetcherActorState(cI, messages) { @@ -1624,14 +1600,14 @@ friend struct ActorCallback< ClusterStatusFetcherActor, 2, Void >; } }; } - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" [[nodiscard]] Future> clusterStatusFetcher( ClusterInterface const& cI, StatusArray* const& messages ) { - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" return Future>(new ClusterStatusFetcherActor(cI, messages)); - #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } -#line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" +#line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" // Create and return a database_status section. // Will not throw, will not return an empty section. @@ -1681,23 +1657,23 @@ StatusObject getClientDatabaseStatus(StatusObjectReader client, StatusObjectRead return databaseStatus; } - #line 1684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" namespace { // This generated class is to be used only via statusFetcherImpl() - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" template - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" class StatusFetcherImplActorState { - #line 1691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" public: - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusFetcherImplActorState(Reference const& connRecord,Reference>> const& clusterInterface) - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" : connRecord(connRecord), - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" clusterInterface(clusterInterface) - #line 1700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { fdb_probe_actor_create("statusFetcherImpl", reinterpret_cast(this)); @@ -1710,38 +1686,38 @@ class StatusFetcherImplActorState { int a_body1(int loopDepth=0) { try { - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (!g_network) - #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" return a_body1Catch1(network_not_setup(), loopDepth); - #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObj = StatusObject(); - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObjClient = StatusObject(); - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" clientMessages = StatusArray(); - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" quorum_reachable = false; - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" coordinatorsFaultTolerance = 0; - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" try { - #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" clientTime = g_network->timer(); - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StrictFuture __when_expr_0 = clientStatusFetcher(connRecord, &clientMessages, &quorum_reachable, &coordinatorsFaultTolerance); - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 1739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1768,18 +1744,18 @@ class StatusFetcherImplActorState { } int a_body1cont1(int loopDepth) { - #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObjCluster = StatusObject(); - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (quorum_reachable) - #line 1775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { try { - #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" interfaceTimeout = delay(2.0); - #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" ; - #line 1782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); } catch (Error& error) { @@ -1798,19 +1774,19 @@ class StatusFetcherImplActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (e.code() == error_code_actor_cancelled) - #line 1803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } - #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" TraceEvent(SevError, "ClientStatusFetchError").error(e); - #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" clientMessages.push_back( makeMessage("status_incomplete_client", "Could not retrieve client status information.")); - #line 1813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); } catch (Error& error) { @@ -1823,15 +1799,15 @@ class StatusFetcherImplActorState { } int a_body1cont3(StatusObject const& _statusObjClient,int loopDepth) { - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObjClient = _statusObjClient; - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (clientTime != -1) - #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObjClient["timestamp"] = clientTime; - #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } loopDepth = a_body1cont6(loopDepth); @@ -1839,15 +1815,15 @@ class StatusFetcherImplActorState { } int a_body1cont3(StatusObject && _statusObjClient,int loopDepth) { - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObjClient = _statusObjClient; - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (clientTime != -1) - #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObjClient["timestamp"] = clientTime; - #line 1850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } loopDepth = a_body1cont6(loopDepth); @@ -1931,27 +1907,27 @@ class StatusFetcherImplActorState { } int a_body1cont7(int loopDepth) { - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObjClient["messages"] = clientMessages; - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObjClient["database_status"] = getClientDatabaseStatus(statusObjClient, statusObjCluster); - #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObj["client"] = statusObjClient; - #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" JSONDoc doc(statusObj); - #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" auto& layers_valid = doc.create("cluster.layers._valid"); - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (layers_valid.is_null()) - #line 1946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" layers_valid = false; - #line 1950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(statusObj); this->~StatusFetcherImplActorState(); static_cast(this)->destroy(); return 0; } - #line 1954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" new (&static_cast(this)->SAV< StatusObject >::value()) StatusObject(std::move(statusObj)); // state_var_RVO this->~StatusFetcherImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1968,11 +1944,11 @@ class StatusFetcherImplActorState { int a_body1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" TraceEvent(e.code() == error_code_all_alternatives_failed ? SevInfo : SevError, "ClusterStatusFetchError") .error(e); - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" clientMessages.push_back( makeMessage("status_incomplete_cluster", "Could not retrieve cluster status information.")); - #line 1975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = a_body1cont8(loopDepth); } catch (Error& error) { @@ -1985,9 +1961,9 @@ class StatusFetcherImplActorState { } int a_body1cont9(int loopDepth) { - #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObj["cluster"] = statusObjCluster; - #line 1990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = a_body1cont11(loopDepth); return loopDepth; @@ -2001,20 +1977,20 @@ class StatusFetcherImplActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (clusterInterface->get().present()) - #line 2006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StrictFuture> __when_expr_1 = clusterStatusFetcher(clusterInterface->get().get(), &clientMessages); - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = 0; } else @@ -2039,53 +2015,53 @@ class StatusFetcherImplActorState { } int a_body1cont1loopBody1cont1(int loopDepth) { - #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StrictFuture __when_expr_2 = clusterInterface->onChange(); - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StrictFuture __when_expr_3 = interfaceTimeout; - #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1when2(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont2(Optional const& _statusObjCluster,int loopDepth) { - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (_statusObjCluster.present()) - #line 2066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObjCluster = _statusObjCluster.get(); - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (statusObjCluster.count("fault_tolerance")) - #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusObject::Map& faultToleranceWriteable = statusObjCluster["fault_tolerance"].get_obj(); - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusObjectReader faultToleranceReader(faultToleranceWriteable); - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" int maxDataLoss, maxAvailLoss; - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (faultToleranceReader.get("max_zone_failures_without_losing_data", maxDataLoss) && faultToleranceReader.get("max_zone_failures_without_losing_availability", maxAvailLoss)) - #line 2082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" faultToleranceWriteable["max_zone_failures_without_losing_data"] = std::min(maxDataLoss, coordinatorsFaultTolerance); - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" faultToleranceWriteable["max_zone_failures_without_losing_availability"] = std::min(maxAvailLoss, coordinatorsFaultTolerance); - #line 2088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } } } @@ -2095,31 +2071,31 @@ class StatusFetcherImplActorState { } int a_body1cont1loopBody1cont2(Optional && _statusObjCluster,int loopDepth) { - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (_statusObjCluster.present()) - #line 2100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" statusObjCluster = _statusObjCluster.get(); - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (statusObjCluster.count("fault_tolerance")) - #line 2106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusObject::Map& faultToleranceWriteable = statusObjCluster["fault_tolerance"].get_obj(); - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusObjectReader faultToleranceReader(faultToleranceWriteable); - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" int maxDataLoss, maxAvailLoss; - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (faultToleranceReader.get("max_zone_failures_without_losing_data", maxDataLoss) && faultToleranceReader.get("max_zone_failures_without_losing_availability", maxAvailLoss)) - #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" faultToleranceWriteable["max_zone_failures_without_losing_data"] = std::min(maxDataLoss, coordinatorsFaultTolerance); - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" faultToleranceWriteable["max_zone_failures_without_losing_availability"] = std::min(maxAvailLoss, coordinatorsFaultTolerance); - #line 2122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } } } @@ -2210,18 +2186,18 @@ class StatusFetcherImplActorState { } int a_body1cont1loopBody1cont1when2(Void const& _,int loopDepth) { - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" clientMessages.push_back(makeMessage("no_cluster_controller", "Unable to locate a cluster controller within 2 seconds. " "Check that there are server processes running.")); - #line 2215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1cont1loopBody1cont1when2(Void && _,int loopDepth) { - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" clientMessages.push_back(makeMessage("no_cluster_controller", "Unable to locate a cluster controller within 2 seconds. " "Check that there are server processes running.")); - #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -2336,32 +2312,32 @@ class StatusFetcherImplActorState { return loopDepth; } - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" Reference connRecord; - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" Reference>> clusterInterface; - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusObject statusObj; - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusObject statusObjClient; - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusArray clientMessages; - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" bool quorum_reachable; - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" int coordinatorsFaultTolerance; - #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" int64_t clientTime; - #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusObject statusObjCluster; - #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" Future interfaceTimeout; - #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" }; // This generated class is to be used only via statusFetcherImpl() - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" class StatusFetcherImplActor final : public Actor, public ActorCallback< StatusFetcherImplActor, 0, StatusObject >, public ActorCallback< StatusFetcherImplActor, 1, Optional >, public ActorCallback< StatusFetcherImplActor, 2, Void >, public ActorCallback< StatusFetcherImplActor, 3, Void >, public FastAllocated, public StatusFetcherImplActorState { - #line 2364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2373,9 +2349,9 @@ friend struct ActorCallback< StatusFetcherImplActor, 0, StatusObject >; friend struct ActorCallback< StatusFetcherImplActor, 1, Optional >; friend struct ActorCallback< StatusFetcherImplActor, 2, Void >; friend struct ActorCallback< StatusFetcherImplActor, 3, Void >; - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StatusFetcherImplActor(Reference const& connRecord,Reference>> const& clusterInterface) - #line 2378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" : Actor(), StatusFetcherImplActorState(connRecord, clusterInterface) { @@ -2401,32 +2377,32 @@ friend struct ActorCallback< StatusFetcherImplActor, 3, Void >; } }; } - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" [[nodiscard]] Future statusFetcherImpl( Reference const& connRecord, Reference>> const& clusterInterface ) { - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" return Future(new StatusFetcherImplActor(connRecord, clusterInterface)); - #line 2408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } -#line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" +#line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" - #line 2413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" namespace { // This generated class is to be used only via timeoutMonitorLeader() - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" template - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" class TimeoutMonitorLeaderActorState { - #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" public: - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" TimeoutMonitorLeaderActorState(Database const& db) - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" : db(db), - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" leadMon(monitorLeader(db->getConnectionRecord(), db->statusClusterInterface)) - #line 2429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { fdb_probe_actor_create("timeoutMonitorLeader", reinterpret_cast(this)); @@ -2439,9 +2415,9 @@ class TimeoutMonitorLeaderActorState { int a_body1(int loopDepth=0) { try { - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" ; - #line 2444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2469,31 +2445,31 @@ class TimeoutMonitorLeaderActorState { } int a_body1loopBody1(int loopDepth) { - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" StrictFuture __when_expr_0 = delay(CLIENT_KNOBS->STATUS_IDLE_TIMEOUT + 0.00001 + db->lastStatusFetch - now()); - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (now() - db->lastStatusFetch > CLIENT_KNOBS->STATUS_IDLE_TIMEOUT) - #line 2490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" db->statusClusterInterface = Reference>>(); - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TimeoutMonitorLeaderActorState(); static_cast(this)->destroy(); return 0; } - #line 2496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TimeoutMonitorLeaderActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2505,15 +2481,15 @@ class TimeoutMonitorLeaderActorState { } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (now() - db->lastStatusFetch > CLIENT_KNOBS->STATUS_IDLE_TIMEOUT) - #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" { - #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" db->statusClusterInterface = Reference>>(); - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TimeoutMonitorLeaderActorState(); static_cast(this)->destroy(); return 0; } - #line 2516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TimeoutMonitorLeaderActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2586,16 +2562,16 @@ class TimeoutMonitorLeaderActorState { fdb_probe_actor_exit("timeoutMonitorLeader", reinterpret_cast(this), 0); } - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" Database db; - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" Future leadMon; - #line 2593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" }; // This generated class is to be used only via timeoutMonitorLeader() - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" class TimeoutMonitorLeaderActor final : public Actor, public ActorCallback< TimeoutMonitorLeaderActor, 0, Void >, public FastAllocated, public TimeoutMonitorLeaderActorState { - #line 2598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2604,9 +2580,9 @@ class TimeoutMonitorLeaderActor final : public Actor, public ActorCallback void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< TimeoutMonitorLeaderActor, 0, Void >; - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" TimeoutMonitorLeaderActor(Database const& db) - #line 2609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" : Actor(), TimeoutMonitorLeaderActorState(db) { @@ -2630,14 +2606,14 @@ friend struct ActorCallback< TimeoutMonitorLeaderActor, 0, Void >; } }; } - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" [[nodiscard]] Future timeoutMonitorLeader( Database const& db ) { - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" return Future(new TimeoutMonitorLeaderActor(db)); - #line 2637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" + #line 2613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.g.cpp" } -#line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" +#line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/StatusClient.actor.cpp" Future StatusClient::statusFetcher(Database db) { db->lastStatusFetch = now(); diff --git a/src/fdbclient/StorageCheckpoint.h b/src/fdbclient/StorageCheckpoint.h deleted file mode 100644 index d7890eb..0000000 --- a/src/fdbclient/StorageCheckpoint.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * StorageCheckpoint.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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. - */ - -#ifndef FDBCLIENT_STORAGCHECKPOINT_H -#define FDBCLIENT_STORAGCHECKPOINT_H -#pragma once - -#include "fdbclient/FDBTypes.h" - -// FDB storage checkpoint format. -enum CheckpointFormat { - InvalidFormat = 0, - // For RocksDB, checkpoint generated via rocksdb::Checkpoint::ExportColumnFamily(). - RocksDBColumnFamily = 1, - // For RocksDB, checkpoint generated via rocksdb::Checkpoint::CreateCheckpoint(). - RocksDB = 2, -}; - -// Metadata of a FDB checkpoint. -struct CheckpointMetaData { - enum CheckpointState { - InvalidState = 0, - Pending = 1, // Checkpoint creation pending. - Complete = 2, // Checkpoint is created and ready to be read. - Deleting = 3, // Checkpoint deletion requested. - Fail = 4, - }; - - constexpr static FileIdentifier file_identifier = 13804342; - Version version; - KeyRange range; - int16_t format; // CheckpointFormat. - UID ssID; // Storage server ID on which this checkpoint is created. - UID checkpointID; // A unique id for this checkpoint. - int16_t state; // CheckpointState. - int referenceCount; // A reference count on the checkpoint, it can only be deleted when this is 0. - int64_t gcTime; // Time to delete this checkpoint, a Unix timestamp in seconds. - - // A serialized metadata associated with format, this data can be understood by the corresponding KVS. - Standalone serializedCheckpoint; - - CheckpointMetaData() = default; - CheckpointMetaData(KeyRange const& range, CheckpointFormat format, UID const& ssID, UID const& checkpointID) - : version(invalidVersion), range(range), format(format), ssID(ssID), checkpointID(checkpointID), state(Pending), - referenceCount(0), gcTime(0) {} - CheckpointMetaData(Version version, KeyRange const& range, CheckpointFormat format, UID checkpointID) - : version(version), range(range), format(format), ssID(UID()), checkpointID(checkpointID), state(Pending), - referenceCount(0), gcTime(0) {} - - CheckpointState getState() const { return static_cast(state); } - - void setState(CheckpointState state) { this->state = static_cast(state); } - - CheckpointFormat getFormat() const { return static_cast(format); } - - void setFormat(CheckpointFormat format) { this->format = static_cast(format); } - - std::string toString() const { - std::string res = "Checkpoint MetaData:\nRange: " + range.toString() + "\nVersion: " + std::to_string(version) + - "\nFormat: " + std::to_string(format) + "\nServer: " + ssID.toString() + - "\nID: " + checkpointID.toString() + "\nState: " + std::to_string(static_cast(state)) + - "\n"; - return res; - } - - template - void serialize(Ar& ar) { - serializer(ar, version, range, format, state, checkpointID, ssID, gcTime, serializedCheckpoint); - } -}; - -#endif diff --git a/src/fdbclient/StorageServerInterface.cpp b/src/fdbclient/StorageServerInterface.cpp index d557927..518c0a2 100644 --- a/src/fdbclient/StorageServerInterface.cpp +++ b/src/fdbclient/StorageServerInterface.cpp @@ -21,7 +21,7 @@ // TODO this should really be renamed "TSSComparison.cpp" #include "fdbclient/StorageServerInterface.h" #include "fdbclient/BlobWorkerInterface.h" -#include "flow/crc32c.h" // for crc32c_append, to checksum values in tss trace events +#include "crc32/crc32c.h" // for crc32c_append, to checksum values in tss trace events // Includes template specializations for all tss operations on storage server types. // New StorageServerInterface reply types must be added here or it won't compile. @@ -49,7 +49,7 @@ void TSS_traceMismatch(TraceEvent& event, const GetValueReply& src, const GetValueReply& tss) { event.detail("Key", req.key) - .detail("Tenant", req.tenantInfo.name) + .detail("Tenant", req.tenantInfo.tenantId) .detail("Version", req.version) .detail("SSReply", src.value.present() ? traceChecksumValue(src.value.get()) : "missing") .detail("TSSReply", tss.value.present() ? traceChecksumValue(tss.value.get()) : "missing"); @@ -107,7 +107,7 @@ void TSS_traceMismatch(TraceEvent& event, const GetKeyRequest& req, const GetKey event .detail("KeySelector", format("%s%s:%d", req.sel.orEqual ? "=" : "", req.sel.getKey().printable().c_str(), req.sel.offset)) - .detail("Tenant", req.tenantInfo.name) + .detail("Tenant", req.tenantInfo.tenantId) .detail("Version", req.version) .detail("SSReply", format("%s%s:%d", src.sel.orEqual ? "=" : "", src.sel.getKey().printable().c_str(), src.sel.offset)) @@ -129,7 +129,7 @@ const char* TSS_mismatchTraceName(const GetKeyValuesRequest& req) { static void traceKeyValuesSummary(TraceEvent& event, const KeySelectorRef& begin, const KeySelectorRef& end, - Optional tenant, + int64_t tenantId, Version version, int limit, int limitBytes, @@ -141,7 +141,7 @@ static void traceKeyValuesSummary(TraceEvent& event, std::string tssSummaryString = format("(%d)%s", tssSize, tssMore ? "+" : ""); event.detail("Begin", format("%s%s:%d", begin.orEqual ? "=" : "", begin.getKey().printable().c_str(), begin.offset)) .detail("End", format("%s%s:%d", end.orEqual ? "=" : "", end.getKey().printable().c_str(), end.offset)) - .detail("Tenant", tenant) + .detail("Tenant", tenantId) .detail("Version", version) .detail("Limit", limit) .detail("LimitBytes", limitBytes) @@ -149,10 +149,20 @@ static void traceKeyValuesSummary(TraceEvent& event, .detail("TSSReplySummary", tssSummaryString); } +// convert a StringRef to Hex string +static std::string hexStringRef(const StringRef& s) { + std::string result; + result.reserve(s.size() * 2); + for (int i = 0; i < s.size(); i++) { + result.append(format("%02x", s[i])); + } + return result; +} + static void traceKeyValuesDiff(TraceEvent& event, const KeySelectorRef& begin, const KeySelectorRef& end, - Optional tenant, + int64_t tenantId, Version version, int limit, int limitBytes, @@ -161,22 +171,24 @@ static void traceKeyValuesDiff(TraceEvent& event, const VectorRef& tssKV, bool tssMore) { traceKeyValuesSummary( - event, begin, end, tenant, version, limit, limitBytes, ssKV.size(), ssMore, tssKV.size(), tssMore); + event, begin, end, tenantId, version, limit, limitBytes, ssKV.size(), ssMore, tssKV.size(), tssMore); bool mismatchFound = false; for (int i = 0; i < std::max(ssKV.size(), tssKV.size()); i++) { if (i >= ssKV.size() || i >= tssKV.size() || ssKV[i] != tssKV[i]) { event.detail("MismatchIndex", i); if (i >= ssKV.size() || i >= tssKV.size() || ssKV[i].key != tssKV[i].key) { event.detail("MismatchSSKey", i < ssKV.size() ? ssKV[i].key : "missing"_sr); - event.detail("MismatchSSKeyHex", i < ssKV.size() ? ssKV[i].key.toHex() : "missing"_sr); + event.detail("MismatchSSKeyHex", i < ssKV.size() ? hexStringRef(ssKV[i].key) : "missing"_sr); event.detail("MismatchTSSKey", i < tssKV.size() ? tssKV[i].key : "missing"_sr); - event.detail("MismatchTSSKeyHex", i < tssKV.size() ? tssKV[i].key.toHex() : "missing"_sr) + event.detail("MismatchTSSKeyHex", i < tssKV.size() ? hexStringRef(tssKV[i].key) : "missing"_sr) .setMaxFieldLength(-1); } else { event.detail("MismatchKey", ssKV[i].key); - event.detail("MismatchSSKeyHex", ssKV[i].key.toHex()); event.detail("MismatchSSValue", traceChecksumValue(ssKV[i].value)); - event.detail("MismatchTSSValue", traceChecksumValue(tssKV[i].value)).setMaxFieldLength(-1); + event.detail("MismatchSSValueHex", hexStringRef(traceChecksumValue(ssKV[i].value))); + event.detail("MismatchTSSValue", traceChecksumValue(tssKV[i].value)); + event.detail("MismatchTSSValueHex", hexStringRef(traceChecksumValue(tssKV[i].value))) + .setMaxFieldLength(-1); } mismatchFound = true; break; @@ -193,7 +205,7 @@ void TSS_traceMismatch(TraceEvent& event, traceKeyValuesDiff(event, req.begin, req.end, - req.tenantInfo.name, + req.tenantInfo.tenantId, req.version, req.limit, req.limitBytes, @@ -222,7 +234,7 @@ void TSS_traceMismatch(TraceEvent& event, traceKeyValuesSummary(event, req.begin, req.end, - req.tenantInfo.name, + req.tenantInfo.tenantId, req.version, req.limit, req.limitBytes, @@ -253,7 +265,7 @@ void TSS_traceMismatch(TraceEvent& event, traceKeyValuesDiff(event, req.begin, req.end, - req.tenantInfo.name, + req.tenantInfo.tenantId, req.version, req.limit, req.limitBytes, @@ -346,7 +358,7 @@ void TSS_traceMismatch(TraceEvent& event, // change feed template <> bool TSS_doCompare(const OverlappingChangeFeedsReply& src, const OverlappingChangeFeedsReply& tss) { - ASSERT(false); + // We duplicate for load, no need to validate replies return true; } diff --git a/src/fdbclient/Subspace.cpp b/src/fdbclient/Subspace.cpp index b71c5a0..f0da865 100644 --- a/src/fdbclient/Subspace.cpp +++ b/src/fdbclient/Subspace.cpp @@ -41,7 +41,7 @@ Subspace::Subspace(StringRef const& rawPrefix) { Subspace::~Subspace() {} Key Subspace::key() const { - return StringRef(rawPrefix.begin(), rawPrefix.size()); + return Key(StringRef(rawPrefix.begin(), rawPrefix.size()), rawPrefix.arena()); } Key Subspace::pack(const Tuple& tuple) const { diff --git a/src/fdbclient/SystemData.cpp b/src/fdbclient/SystemData.cpp index 255fccc..eae7cf1 100644 --- a/src/fdbclient/SystemData.cpp +++ b/src/fdbclient/SystemData.cpp @@ -19,30 +19,53 @@ */ #include "fdbclient/SystemData.h" +#include "fdbclient/BlobGranuleCommon.h" #include "fdbclient/FDBTypes.h" -#include "fdbclient/NativeAPI.actor.h" #include "fdbclient/StorageServerInterface.h" #include "flow/Arena.h" #include "flow/TDMetric.actor.h" #include "flow/serialize.h" #include "flow/UnitTest.h" -const KeyRef systemKeysPrefix = LiteralStringRef("\xff"); +const KeyRef systemKeysPrefix = "\xff"_sr; const KeyRangeRef normalKeys(KeyRef(), systemKeysPrefix); -const KeyRangeRef systemKeys(systemKeysPrefix, LiteralStringRef("\xff\xff")); -const KeyRangeRef nonMetadataSystemKeys(LiteralStringRef("\xff\x02"), LiteralStringRef("\xff\x03")); +const KeyRangeRef systemKeys(systemKeysPrefix, "\xff\xff"_sr); +const KeyRangeRef nonMetadataSystemKeys("\xff\x02"_sr, "\xff\x03"_sr); const KeyRangeRef allKeys = KeyRangeRef(normalKeys.begin, systemKeys.end); -const KeyRef afterAllKeys = LiteralStringRef("\xff\xff\x00"); -const KeyRangeRef specialKeys = KeyRangeRef(LiteralStringRef("\xff\xff"), LiteralStringRef("\xff\xff\xff")); +const KeyRef afterAllKeys = "\xff\xff\x00"_sr; +const KeyRangeRef specialKeys = KeyRangeRef("\xff\xff"_sr, "\xff\xff\xff"_sr); + +SystemKey::SystemKey(Key const& k) : Key(k) { + // In simulation, if k is not in the known key set then make sure no known key is a prefix of it, then add it to the + // known set. + if (g_network->isSimulated()) { + static std::unordered_set knownKeys; + + if (!knownKeys.contains(k)) { + for (auto& known : knownKeys) { + if (k.startsWith(known) || known.startsWith(k)) { + TraceEvent(SevError, "SystemKeyPrefixConflict").detail("NewKey", k).detail("ExistingKey", known); + UNSTOPPABLE_ASSERT(false); + } + } + knownKeys.insert(k); + } + } +} // keyServersKeys.contains(k) iff k.startsWith(keyServersPrefix) -const KeyRangeRef keyServersKeys(LiteralStringRef("\xff/keyServers/"), LiteralStringRef("\xff/keyServers0")); +const KeyRangeRef keyServersKeys("\xff/keyServers/"_sr, "\xff/keyServers0"_sr); const KeyRef keyServersPrefix = keyServersKeys.begin; const KeyRef keyServersEnd = keyServersKeys.end; -const KeyRangeRef keyServersKeyServersKeys(LiteralStringRef("\xff/keyServers/\xff/keyServers/"), - LiteralStringRef("\xff/keyServers/\xff/keyServers0")); +const KeyRangeRef keyServersKeyServersKeys("\xff/keyServers/\xff/keyServers/"_sr, + "\xff/keyServers/\xff/keyServers0"_sr); const KeyRef keyServersKeyServersKey = keyServersKeyServersKeys.begin; +// These constants are selected to be easily recognized during debugging. +// Note that the last bit of the follwing constants is 0, indicating that physical shard move is disabled. +const UID anonymousShardId = UID(0x666666, 0x88888888); +const uint64_t emptyShardId = 0x2222222; + const Key keyServersKey(const KeyRef& k) { return k.withPrefix(keyServersPrefix); } @@ -87,6 +110,21 @@ const Value keyServersValue(RangeResult result, const std::vector& src, con return keyServersValue(srcTag, destTag); } + +const Value keyServersValue(const std::vector& src, + const std::vector& dest, + const UID& srcID, + const UID& destID) { + BinaryWriter wr(IncludeVersion(ProtocolVersion::withShardEncodeLocationMetaData())); + if (dest.empty()) { + ASSERT(!destID.isValid()); + wr << src << dest << srcID; + } else { + wr << src << dest << srcID << destID; + } + return wr.toValue(); +} + const Value keyServersValue(const std::vector& srcTag, const std::vector& destTag) { // src and dest are expected to be sorted BinaryWriter wr(IncludeVersion(ProtocolVersion::withKeyServerValueV2())); @@ -106,6 +144,11 @@ void decodeKeyServersValue(RangeResult result, } BinaryReader rd(value, IncludeVersion()); + if (rd.protocolVersion().hasShardEncodeLocationMetaData()) { + UID srcId, destId; + decodeKeyServersValue(result, value, src, dest, srcId, destId); + return; + } if (!rd.protocolVersion().hasKeyServerValueV2()) { rd >> src >> dest; return; @@ -145,6 +188,42 @@ void decodeKeyServersValue(RangeResult result, } } +void decodeKeyServersValue(RangeResult result, + const ValueRef& value, + std::vector& src, + std::vector& dest, + UID& srcID, + UID& destID, + bool missingIsError) { + src.clear(); + dest.clear(); + srcID = UID(); + destID = UID(); + + if (value.size() == 0) { + return; + } + + BinaryReader rd(value, IncludeVersion()); + if (rd.protocolVersion().hasShardEncodeLocationMetaData()) { + rd >> src >> dest >> srcID; + if (rd.empty()) { + ASSERT(dest.empty()); + } else { + rd >> destID; + rd.assertEnd(); + } + } else { + decodeKeyServersValue(result, value, src, dest, missingIsError); + if (!src.empty()) { + srcID = anonymousShardId; + } + if (!dest.empty()) { + destID = anonymousShardId; + } + } +} + void decodeKeyServersValue(std::map const& tag_uid, const ValueRef& value, std::vector& src, @@ -167,6 +246,16 @@ void decodeKeyServersValue(std::map const& tag_uid, if (value.size() != sizeof(ProtocolVersion) + sizeof(int) + srcLen * sizeof(Tag) + sizeof(int) + destLen * sizeof(Tag)) { rd >> src >> dest; + if (rd.protocolVersion().hasShardEncodeLocationMetaData()) { + UID srcId, destId; + rd >> srcId; + if (rd.empty()) { + ASSERT(dest.empty()); + destId = UID(); + } else { + rd >> destId; + } + } rd.assertEnd(); return; } @@ -199,21 +288,113 @@ void decodeKeyServersValue(std::map const& tag_uid, std::sort(dest.begin(), dest.end()); } +bool isSystemKey(KeyRef key) { + return key.size() && key[0] == systemKeys.begin[0]; +} + const KeyRangeRef conflictingKeysRange = - KeyRangeRef(LiteralStringRef("\xff\xff/transaction/conflicting_keys/"), - LiteralStringRef("\xff\xff/transaction/conflicting_keys/\xff\xff")); -const ValueRef conflictingKeysTrue = LiteralStringRef("1"); -const ValueRef conflictingKeysFalse = LiteralStringRef("0"); + KeyRangeRef("\xff\xff/transaction/conflicting_keys/"_sr, "\xff\xff/transaction/conflicting_keys/\xff\xff"_sr); +const ValueRef conflictingKeysTrue = "1"_sr; +const ValueRef conflictingKeysFalse = "0"_sr; const KeyRangeRef readConflictRangeKeysRange = - KeyRangeRef(LiteralStringRef("\xff\xff/transaction/read_conflict_range/"), - LiteralStringRef("\xff\xff/transaction/read_conflict_range/\xff\xff")); + KeyRangeRef("\xff\xff/transaction/read_conflict_range/"_sr, "\xff\xff/transaction/read_conflict_range/\xff\xff"_sr); + +const KeyRangeRef writeConflictRangeKeysRange = KeyRangeRef("\xff\xff/transaction/write_conflict_range/"_sr, + "\xff\xff/transaction/write_conflict_range/\xff\xff"_sr); + +const KeyRangeRef auditKeys = KeyRangeRef("\xff/audits/"_sr, "\xff/audits0"_sr); +const KeyRef auditPrefix = auditKeys.begin; +const KeyRangeRef auditRanges = KeyRangeRef("\xff/auditRanges/"_sr, "\xff/auditRanges0"_sr); +const KeyRef auditRangePrefix = auditRanges.begin; +const KeyRangeRef auditServers = KeyRangeRef("\xff/auditServers/"_sr, "\xff/auditServers0"_sr); +const KeyRef auditServerPrefix = auditServers.begin; + +const Key auditKey(const AuditType type, const UID& auditId) { + BinaryWriter wr(Unversioned()); + wr.serializeBytes(auditPrefix); + wr << static_cast(type); + wr.serializeBytes("/"_sr); + wr << bigEndian64(auditId.first()); + return wr.toValue(); +} + +const KeyRange auditKeyRange(const AuditType type) { + BinaryWriter wr(Unversioned()); + wr.serializeBytes(auditPrefix); + wr << static_cast(type); + wr.serializeBytes("/"_sr); + return prefixRange(wr.toValue()); +} + +const Key auditRangeBasedProgressPrefixFor(const AuditType type, const UID& auditId) { + BinaryWriter wr(Unversioned()); + wr.serializeBytes(auditRangePrefix); + wr << static_cast(type); + wr.serializeBytes("/"_sr); + wr << bigEndian64(auditId.first()); + wr.serializeBytes("/"_sr); + return wr.toValue(); +} + +const KeyRange auditRangeBasedProgressRangeFor(const AuditType type, const UID& auditId) { + BinaryWriter wr(Unversioned()); + wr.serializeBytes(auditRangePrefix); + wr << static_cast(type); + wr.serializeBytes("/"_sr); + wr << bigEndian64(auditId.first()); + wr.serializeBytes("/"_sr); + return prefixRange(wr.toValue()); +} + +const KeyRange auditRangeBasedProgressRangeFor(const AuditType type) { + BinaryWriter wr(Unversioned()); + wr.serializeBytes(auditRangePrefix); + wr << static_cast(type); + wr.serializeBytes("/"_sr); + return prefixRange(wr.toValue()); +} + +const Key auditServerBasedProgressPrefixFor(const AuditType type, const UID& auditId, const UID& serverId) { + BinaryWriter wr(Unversioned()); + wr.serializeBytes(auditServerPrefix); + wr << static_cast(type); + wr.serializeBytes("/"_sr); + wr << bigEndian64(auditId.first()); + wr.serializeBytes("/"_sr); + wr << bigEndian64(serverId.first()); + wr.serializeBytes("/"_sr); + return wr.toValue(); +} + +const KeyRange auditServerBasedProgressRangeFor(const AuditType type, const UID& auditId) { + BinaryWriter wr(Unversioned()); + wr.serializeBytes(auditServerPrefix); + wr << static_cast(type); + wr.serializeBytes("/"_sr); + wr << bigEndian64(auditId.first()); + wr.serializeBytes("/"_sr); + return prefixRange(wr.toValue()); +} + +const KeyRange auditServerBasedProgressRangeFor(const AuditType type) { + BinaryWriter wr(Unversioned()); + wr.serializeBytes(auditServerPrefix); + wr << static_cast(type); + wr.serializeBytes("/"_sr); + return prefixRange(wr.toValue()); +} -const KeyRangeRef writeConflictRangeKeysRange = - KeyRangeRef(LiteralStringRef("\xff\xff/transaction/write_conflict_range/"), - LiteralStringRef("\xff\xff/transaction/write_conflict_range/\xff\xff")); +const Value auditStorageStateValue(const AuditStorageState& auditStorageState) { + return ObjectWriter::toValue(auditStorageState, IncludeVersion()); +} -const KeyRef clusterIdKey = LiteralStringRef("\xff/clusterId"); +AuditStorageState decodeAuditStorageState(const ValueRef& value) { + AuditStorageState auditState; + ObjectReader reader(value.begin(), IncludeVersion()); + reader.deserialize(auditState); + return auditState; +} const KeyRef checkpointPrefix = "\xff/checkpoint/"_sr; @@ -242,8 +423,35 @@ CheckpointMetaData decodeCheckpointValue(const ValueRef& value) { return checkpoint; } +// "\xff/dataMoves/[[UID]] := [[DataMoveMetaData]]" +const KeyRangeRef dataMoveKeys("\xff/dataMoves/"_sr, "\xff/dataMoves0"_sr); +const Key dataMoveKeyFor(UID dataMoveId) { + BinaryWriter wr(Unversioned()); + wr.serializeBytes(dataMoveKeys.begin); + wr << dataMoveId; + return wr.toValue(); +} + +const Value dataMoveValue(const DataMoveMetaData& dataMoveMetaData) { + return ObjectWriter::toValue(dataMoveMetaData, IncludeVersion()); +} + +UID decodeDataMoveKey(const KeyRef& key) { + UID id; + BinaryReader rd(key.removePrefix(dataMoveKeys.begin), Unversioned()); + rd >> id; + return id; +} + +DataMoveMetaData decodeDataMoveValue(const ValueRef& value) { + DataMoveMetaData dataMove; + ObjectReader reader(value.begin(), IncludeVersion()); + reader.deserialize(dataMove); + return dataMove; +} + // "\xff/cacheServer/[[UID]] := StorageServerInterface" -const KeyRangeRef storageCacheServerKeys(LiteralStringRef("\xff/cacheServer/"), LiteralStringRef("\xff/cacheServer0")); +const KeyRangeRef storageCacheServerKeys("\xff/cacheServer/"_sr, "\xff/cacheServer0"_sr); const KeyRef storageCacheServersPrefix = storageCacheServerKeys.begin; const KeyRef storageCacheServersEnd = storageCacheServerKeys.end; @@ -255,16 +463,16 @@ const Key storageCacheServerKey(UID id) { } const Value storageCacheServerValue(const StorageServerInterface& ssi) { - auto protocolVersion = currentProtocolVersion; + auto protocolVersion = currentProtocolVersion(); protocolVersion.addObjectSerializerFlag(); return ObjectWriter::toValue(ssi, IncludeVersion(protocolVersion)); } -const KeyRangeRef ddStatsRange = KeyRangeRef(LiteralStringRef("\xff\xff/metrics/data_distribution_stats/"), - LiteralStringRef("\xff\xff/metrics/data_distribution_stats/\xff\xff")); +const KeyRangeRef ddStatsRange = + KeyRangeRef("\xff\xff/metrics/data_distribution_stats/"_sr, "\xff\xff/metrics/data_distribution_stats/\xff\xff"_sr); // "\xff/storageCache/[[begin]]" := "[[vector]]" -const KeyRangeRef storageCacheKeys(LiteralStringRef("\xff/storageCache/"), LiteralStringRef("\xff/storageCache0")); +const KeyRangeRef storageCacheKeys("\xff/storageCache/"_sr, "\xff/storageCache0"_sr); const KeyRef storageCachePrefix = storageCacheKeys.begin; const Key storageCacheKey(const KeyRef& k) { @@ -302,16 +510,39 @@ std::pair>, std::vectorrandomUInt64(); + if (enablePSM) { + split |= 1U; + } else { + split &= ~1U; + } + } while (split == anonymousShardId.second() || split == 0 || split == emptyShardId); + } + return UID(physicalShardId, split); +} + const Key serverKeysKey(UID serverID, const KeyRef& key) { BinaryWriter wr(Unversioned()); wr.serializeBytes(serverKeysPrefix); wr << serverID; - wr.serializeBytes(LiteralStringRef("/")); + wr.serializeBytes("/"_sr); wr.serializeBytes(key); return wr.toValue(); } @@ -319,7 +550,7 @@ const Key serverKeysPrefixFor(UID serverID) { BinaryWriter wr(Unversioned()); wr.serializeBytes(serverKeysPrefix); wr << serverID; - wr.serializeBytes(LiteralStringRef("/")); + wr.serializeBytes("/"_sr); return wr.toValue(); } UID serverKeysDecodeServer(const KeyRef& key) { @@ -328,17 +559,81 @@ UID serverKeysDecodeServer(const KeyRef& key) { rd >> server_id; return server_id; } + +std::pair serverKeysDecodeServerBegin(const KeyRef& key) { + UID server_id; + BinaryReader rd(key.removePrefix(serverKeysPrefix), Unversioned()); + rd >> server_id; + rd.readBytes(1); // skip "/" + const auto remainingBytes = rd.remainingBytes(); + KeyRef ref = KeyRef(rd.arenaRead(remainingBytes), remainingBytes); + // std::cout << ref.size() << " " << ref.toString() << std::endl; + return std::make_pair(server_id, Key(ref)); +} + bool serverHasKey(ValueRef storedValue) { - return storedValue == serverKeysTrue || storedValue == serverKeysTrueEmptyRange; + UID shardId; + bool assigned, emptyRange; + EnablePhysicalShardMove enablePSM = EnablePhysicalShardMove::False; + decodeServerKeysValue(storedValue, assigned, emptyRange, enablePSM, shardId); + return assigned; +} + +const Value serverKeysValue(const UID& id) { + if (!id.isValid()) { + return serverKeysFalse; + } + + BinaryWriter wr(IncludeVersion(ProtocolVersion::withShardEncodeLocationMetaData())); + wr << id; + return wr.toValue(); +} + +void decodeServerKeysValue(const ValueRef& value, + bool& assigned, + bool& emptyRange, + EnablePhysicalShardMove& enablePSM, + UID& id) { + enablePSM = EnablePhysicalShardMove::False; + if (value.size() == 0) { + assigned = false; + emptyRange = false; + id = UID(); + } else if (value == serverKeysTrue) { + assigned = true; + emptyRange = false; + id = anonymousShardId; + } else if (value == serverKeysTrueEmptyRange) { + assigned = true; + emptyRange = true; + id = anonymousShardId; + } else if (value == serverKeysFalse) { + assigned = false; + emptyRange = false; + id = UID(); + } else { + BinaryReader rd(value, IncludeVersion()); + ASSERT(rd.protocolVersion().hasShardEncodeLocationMetaData()); + rd >> id; + assigned = id.second() != 0; + emptyRange = id.second() == emptyShardId; + if (id.second() & 1U) { + enablePSM = EnablePhysicalShardMove::True; + } + } } -const KeyRef cacheKeysPrefix = LiteralStringRef("\xff\x02/cacheKeys/"); +bool physicalShardMoveEnabled(const UID& dataMoveId) { + return (dataMoveId.second() & 1U); +} + +const KeyRef cacheKeysPrefix = "\xff\x02/cacheKeys/"_sr; const Key cacheKeysKey(uint16_t idx, const KeyRef& key) { BinaryWriter wr(Unversioned()); wr.serializeBytes(cacheKeysPrefix); wr << idx; - wr.serializeBytes(LiteralStringRef("/")); + wr.serializeBytes("/"_sr); wr.serializeBytes(key); return wr.toValue(); } @@ -346,7 +641,7 @@ const Key cacheKeysPrefixFor(uint16_t idx) { BinaryWriter wr(Unversioned()); wr.serializeBytes(cacheKeysPrefix); wr << idx; - wr.serializeBytes(LiteralStringRef("/")); + wr.serializeBytes("/"_sr); return wr.toValue(); } uint16_t cacheKeysDecodeIndex(const KeyRef& key) { @@ -359,9 +654,8 @@ KeyRef cacheKeysDecodeKey(const KeyRef& key) { return key.substr(cacheKeysPrefix.size() + sizeof(uint16_t) + 1); } -const KeyRef cacheChangeKey = LiteralStringRef("\xff\x02/cacheChangeKey"); -const KeyRangeRef cacheChangeKeys(LiteralStringRef("\xff\x02/cacheChangeKeys/"), - LiteralStringRef("\xff\x02/cacheChangeKeys0")); +const KeyRef cacheChangeKey = "\xff\x02/cacheChangeKey"_sr; +const KeyRangeRef cacheChangeKeys("\xff\x02/cacheChangeKeys/"_sr, "\xff\x02/cacheChangeKeys0"_sr); const KeyRef cacheChangePrefix = cacheChangeKeys.begin; const Key cacheChangeKeyFor(uint16_t idx) { BinaryWriter wr(Unversioned()); @@ -376,9 +670,9 @@ uint16_t cacheChangeKeyDecodeIndex(const KeyRef& key) { return idx; } -const KeyRangeRef tssMappingKeys(LiteralStringRef("\xff/tss/"), LiteralStringRef("\xff/tss0")); +const KeyRangeRef tssMappingKeys("\xff/tss/"_sr, "\xff/tss0"_sr); -const KeyRangeRef tssQuarantineKeys(LiteralStringRef("\xff/tssQ/"), LiteralStringRef("\xff/tssQ0")); +const KeyRangeRef tssQuarantineKeys("\xff/tssQ/"_sr, "\xff/tssQ0"_sr); const Key tssQuarantineKeyFor(UID serverID) { BinaryWriter wr(Unversioned()); @@ -394,22 +688,32 @@ UID decodeTssQuarantineKey(KeyRef const& key) { return serverID; } -const KeyRangeRef tssMismatchKeys(LiteralStringRef("\xff/tssMismatch/"), LiteralStringRef("\xff/tssMismatch0")); +const KeyRangeRef tssMismatchKeys("\xff/tssMismatch/"_sr, "\xff/tssMismatch0"_sr); -const KeyRangeRef serverMetadataKeys(LiteralStringRef("\xff/serverMetadata/"), - LiteralStringRef("\xff/serverMetadata0")); +const KeyRef serverMetadataChangeKey = "\xff\x02/serverMetadataChanges"_sr; +const KeyRangeRef serverMetadataKeys("\xff/serverMetadata/"_sr, "\xff/serverMetadata0"_sr); -const KeyRangeRef serverTagKeys(LiteralStringRef("\xff/serverTag/"), LiteralStringRef("\xff/serverTag0")); +UID decodeServerMetadataKey(const KeyRef& key) { + // Key is packed by KeyBackedObjectMap::packKey + return TupleCodec::unpack(key.removePrefix(serverMetadataKeys.begin)); +} + +StorageMetadataType decodeServerMetadataValue(const KeyRef& value) { + StorageMetadataType type; + ObjectReader rd(value.begin(), IncludeVersion()); + rd.deserialize(type); + return type; +} + +const KeyRangeRef serverTagKeys("\xff/serverTag/"_sr, "\xff/serverTag0"_sr); const KeyRef serverTagPrefix = serverTagKeys.begin; -const KeyRangeRef serverTagConflictKeys(LiteralStringRef("\xff/serverTagConflict/"), - LiteralStringRef("\xff/serverTagConflict0")); +const KeyRangeRef serverTagConflictKeys("\xff/serverTagConflict/"_sr, "\xff/serverTagConflict0"_sr); const KeyRef serverTagConflictPrefix = serverTagConflictKeys.begin; // serverTagHistoryKeys is the old tag a storage server uses before it is migrated to a different location. // For example, we can copy a SS file to a remote DC and start the SS there; // The new SS will need to consume the last bits of data from the old tag it is responsible for. -const KeyRangeRef serverTagHistoryKeys(LiteralStringRef("\xff/serverTagHistory/"), - LiteralStringRef("\xff/serverTagHistory0")); +const KeyRangeRef serverTagHistoryKeys("\xff/serverTagHistory/"_sr, "\xff/serverTagHistory0"_sr); const KeyRef serverTagHistoryPrefix = serverTagHistoryKeys.begin; const Key serverTagKeyFor(UID serverID) { @@ -494,12 +798,11 @@ const Key serverTagConflictKeyFor(Tag tag) { return wr.toValue(); } -const KeyRangeRef tagLocalityListKeys(LiteralStringRef("\xff/tagLocalityList/"), - LiteralStringRef("\xff/tagLocalityList0")); +const KeyRangeRef tagLocalityListKeys("\xff/tagLocalityList/"_sr, "\xff/tagLocalityList0"_sr); const KeyRef tagLocalityListPrefix = tagLocalityListKeys.begin; const Key tagLocalityListKeyFor(Optional dcID) { - BinaryWriter wr(AssumeVersion(currentProtocolVersion)); + BinaryWriter wr(AssumeVersion(currentProtocolVersion())); wr.serializeBytes(tagLocalityListKeys.begin); wr << dcID; return wr.toValue(); @@ -512,7 +815,7 @@ const Value tagLocalityListValue(int8_t const& tagLocality) { } Optional decodeTagLocalityListKey(KeyRef const& key) { Optional dcID; - BinaryReader rd(key.removePrefix(tagLocalityListKeys.begin), AssumeVersion(currentProtocolVersion)); + BinaryReader rd(key.removePrefix(tagLocalityListKeys.begin), AssumeVersion(currentProtocolVersion())); rd >> dcID; return dcID; } @@ -523,12 +826,11 @@ int8_t decodeTagLocalityListValue(ValueRef const& value) { return s; } -const KeyRangeRef datacenterReplicasKeys(LiteralStringRef("\xff\x02/datacenterReplicas/"), - LiteralStringRef("\xff\x02/datacenterReplicas0")); +const KeyRangeRef datacenterReplicasKeys("\xff\x02/datacenterReplicas/"_sr, "\xff\x02/datacenterReplicas0"_sr); const KeyRef datacenterReplicasPrefix = datacenterReplicasKeys.begin; const Key datacenterReplicasKeyFor(Optional dcID) { - BinaryWriter wr(AssumeVersion(currentProtocolVersion)); + BinaryWriter wr(AssumeVersion(currentProtocolVersion())); wr.serializeBytes(datacenterReplicasKeys.begin); wr << dcID; return wr.toValue(); @@ -541,7 +843,7 @@ const Value datacenterReplicasValue(int const& replicas) { } Optional decodeDatacenterReplicasKey(KeyRef const& key) { Optional dcID; - BinaryReader rd(key.removePrefix(datacenterReplicasKeys.begin), AssumeVersion(currentProtocolVersion)); + BinaryReader rd(key.removePrefix(datacenterReplicasKeys.begin), AssumeVersion(currentProtocolVersion())); rd >> dcID; return dcID; } @@ -557,27 +859,26 @@ extern const KeyRangeRef tLogDatacentersKeys; extern const KeyRef tLogDatacentersPrefix; const Key tLogDatacentersKeyFor(Optional dcID); -const KeyRangeRef tLogDatacentersKeys(LiteralStringRef("\xff\x02/tLogDatacenters/"), - LiteralStringRef("\xff\x02/tLogDatacenters0")); +const KeyRangeRef tLogDatacentersKeys("\xff\x02/tLogDatacenters/"_sr, "\xff\x02/tLogDatacenters0"_sr); const KeyRef tLogDatacentersPrefix = tLogDatacentersKeys.begin; const Key tLogDatacentersKeyFor(Optional dcID) { - BinaryWriter wr(AssumeVersion(currentProtocolVersion)); + BinaryWriter wr(AssumeVersion(currentProtocolVersion())); wr.serializeBytes(tLogDatacentersKeys.begin); wr << dcID; return wr.toValue(); } Optional decodeTLogDatacentersKey(KeyRef const& key) { Optional dcID; - BinaryReader rd(key.removePrefix(tLogDatacentersKeys.begin), AssumeVersion(currentProtocolVersion)); + BinaryReader rd(key.removePrefix(tLogDatacentersKeys.begin), AssumeVersion(currentProtocolVersion())); rd >> dcID; return dcID; } -const KeyRef primaryDatacenterKey = LiteralStringRef("\xff/primaryDatacenter"); +const KeyRef primaryDatacenterKey = "\xff/primaryDatacenter"_sr; // serverListKeys.contains(k) iff k.startsWith( serverListKeys.begin ) because '/'+1 == '0' -const KeyRangeRef serverListKeys(LiteralStringRef("\xff/serverList/"), LiteralStringRef("\xff/serverList0")); +const KeyRangeRef serverListKeys("\xff/serverList/"_sr, "\xff/serverList0"_sr); const KeyRef serverListPrefix = serverListKeys.begin; const Key serverListKeyFor(UID serverID) { @@ -588,7 +889,7 @@ const Key serverListKeyFor(UID serverID) { } const Value serverListValue(StorageServerInterface const& server) { - auto protocolVersion = currentProtocolVersion; + auto protocolVersion = currentProtocolVersion(); protocolVersion.addObjectSerializerFlag(); return ObjectWriter::toValue(server, IncludeVersion(protocolVersion)); } @@ -619,12 +920,25 @@ StorageServerInterface decodeServerListValue(ValueRef const& value) { return decodeServerListValueFB(value); } +Value swVersionValue(SWVersion const& swversion) { + auto protocolVersion = currentProtocolVersion(); + protocolVersion.addObjectSerializerFlag(); + return ObjectWriter::toValue(swversion, IncludeVersion(protocolVersion)); +} + +SWVersion decodeSWVersionValue(ValueRef const& value) { + SWVersion s; + ObjectReader reader(value.begin(), IncludeVersion()); + reader.deserialize(s); + return s; +} + // processClassKeys.contains(k) iff k.startsWith( processClassKeys.begin ) because '/'+1 == '0' -const KeyRangeRef processClassKeys(LiteralStringRef("\xff/processClass/"), LiteralStringRef("\xff/processClass0")); +const KeyRangeRef processClassKeys("\xff/processClass/"_sr, "\xff/processClass0"_sr); const KeyRef processClassPrefix = processClassKeys.begin; -const KeyRef processClassChangeKey = LiteralStringRef("\xff/processClassChanges"); -const KeyRef processClassVersionKey = LiteralStringRef("\xff/processClassChangesVersion"); -const ValueRef processClassVersionValue = LiteralStringRef("1"); +const KeyRef processClassChangeKey = "\xff/processClassChanges"_sr; +const KeyRef processClassVersionKey = "\xff/processClassChangesVersion"_sr; +const ValueRef processClassVersionValue = "1"_sr; const Key processClassKeyFor(StringRef processID) { BinaryWriter wr(Unversioned()); @@ -660,21 +974,27 @@ ProcessClass decodeProcessClassValue(ValueRef const& value) { return s; } -const KeyRangeRef configKeys(LiteralStringRef("\xff/conf/"), LiteralStringRef("\xff/conf0")); +const KeyRangeRef configKeys("\xff/conf/"_sr, "\xff/conf0"_sr); const KeyRef configKeysPrefix = configKeys.begin; -const KeyRef perpetualStorageWiggleKey(LiteralStringRef("\xff/conf/perpetual_storage_wiggle")); -const KeyRef perpetualStorageWiggleLocalityKey(LiteralStringRef("\xff/conf/perpetual_storage_wiggle_locality")); -const KeyRef perpetualStorageWiggleIDPrefix( - LiteralStringRef("\xff/storageWiggleID/")); // withSuffix /primary or /remote -const KeyRef perpetualStorageWiggleStatsPrefix( - LiteralStringRef("\xff/storageWiggleStats/")); // withSuffix /primary or /remote +const KeyRef perpetualStorageWiggleKey("\xff/conf/perpetual_storage_wiggle"_sr); +const KeyRef perpetualStorageWiggleLocalityKey("\xff/conf/perpetual_storage_wiggle_locality"_sr); +// The below two are there for compatible upgrade and downgrade. After 7.3, the perpetual wiggle related keys should use +// format "\xff/storageWiggle/[primary | remote]/[fieldName]". See class StorageWiggleData for the data schema. +const KeyRef perpetualStorageWiggleIDPrefix("\xff/storageWiggleID/"_sr); // withSuffix /primary/ or /remote/ +const KeyRef perpetualStorageWiggleStatsPrefix("\xff/storageWiggleStats/"_sr); // withSuffix /primary or /remote +const KeyRef perpetualStorageWigglePrefix("\xff/storageWiggle/"_sr); + +const KeyRef triggerDDTeamInfoPrintKey("\xff/triggerDDTeamInfoPrint"_sr); + +const KeyRef consistencyScanInfoKey = "\xff/consistencyScanInfo"_sr; -const KeyRef triggerDDTeamInfoPrintKey(LiteralStringRef("\xff/triggerDDTeamInfoPrint")); +const KeyRef encryptionAtRestModeConfKey("\xff/conf/encryption_at_rest_mode"_sr); +const KeyRef tenantModeConfKey("\xff/conf/tenant_mode"_sr); -const KeyRangeRef excludedServersKeys(LiteralStringRef("\xff/conf/excluded/"), LiteralStringRef("\xff/conf/excluded0")); +const KeyRangeRef excludedServersKeys("\xff/conf/excluded/"_sr, "\xff/conf/excluded0"_sr); const KeyRef excludedServersPrefix = excludedServersKeys.begin; -const KeyRef excludedServersVersionKey = LiteralStringRef("\xff/conf/excluded"); +const KeyRef excludedServersVersionKey = "\xff/conf/excluded"_sr; AddressExclusion decodeExcludedServersKey(KeyRef const& key) { ASSERT(key.startsWith(excludedServersPrefix)); // Returns an invalid NetworkAddress if given an invalid key (within the prefix) @@ -689,10 +1009,9 @@ std::string encodeExcludedServersKey(AddressExclusion const& addr) { return excludedServersPrefix.toString() + addr.toString(); } -const KeyRangeRef excludedLocalityKeys(LiteralStringRef("\xff/conf/excluded_locality/"), - LiteralStringRef("\xff/conf/excluded_locality0")); +const KeyRangeRef excludedLocalityKeys("\xff/conf/excluded_locality/"_sr, "\xff/conf/excluded_locality0"_sr); const KeyRef excludedLocalityPrefix = excludedLocalityKeys.begin; -const KeyRef excludedLocalityVersionKey = LiteralStringRef("\xff/conf/excluded_locality"); +const KeyRef excludedLocalityVersionKey = "\xff/conf/excluded_locality"_sr; std::string decodeExcludedLocalityKey(KeyRef const& key) { ASSERT(key.startsWith(excludedLocalityPrefix)); return key.removePrefix(excludedLocalityPrefix).toString(); @@ -701,9 +1020,9 @@ std::string encodeExcludedLocalityKey(std::string const& locality) { return excludedLocalityPrefix.toString() + locality; } -const KeyRangeRef failedServersKeys(LiteralStringRef("\xff/conf/failed/"), LiteralStringRef("\xff/conf/failed0")); +const KeyRangeRef failedServersKeys("\xff/conf/failed/"_sr, "\xff/conf/failed0"_sr); const KeyRef failedServersPrefix = failedServersKeys.begin; -const KeyRef failedServersVersionKey = LiteralStringRef("\xff/conf/failed"); +const KeyRef failedServersVersionKey = "\xff/conf/failed"_sr; AddressExclusion decodeFailedServersKey(KeyRef const& key) { ASSERT(key.startsWith(failedServersPrefix)); // Returns an invalid NetworkAddress if given an invalid key (within the prefix) @@ -718,10 +1037,9 @@ std::string encodeFailedServersKey(AddressExclusion const& addr) { return failedServersPrefix.toString() + addr.toString(); } -const KeyRangeRef failedLocalityKeys(LiteralStringRef("\xff/conf/failed_locality/"), - LiteralStringRef("\xff/conf/failed_locality0")); +const KeyRangeRef failedLocalityKeys("\xff/conf/failed_locality/"_sr, "\xff/conf/failed_locality0"_sr); const KeyRef failedLocalityPrefix = failedLocalityKeys.begin; -const KeyRef failedLocalityVersionKey = LiteralStringRef("\xff/conf/failed_locality"); +const KeyRef failedLocalityVersionKey = "\xff/conf/failed_locality"_sr; std::string decodeFailedLocalityKey(KeyRef const& key) { ASSERT(key.startsWith(failedLocalityPrefix)); return key.removePrefix(failedLocalityPrefix).toString(); @@ -730,20 +1048,18 @@ std::string encodeFailedLocalityKey(std::string const& locality) { return failedLocalityPrefix.toString() + locality; } -// const KeyRangeRef globalConfigKeys( LiteralStringRef("\xff/globalConfig/"), LiteralStringRef("\xff/globalConfig0") ); +// const KeyRangeRef globalConfigKeys( "\xff/globalConfig/"_sr, "\xff/globalConfig0"_sr ); // const KeyRef globalConfigPrefix = globalConfigKeys.begin; -const KeyRangeRef globalConfigDataKeys(LiteralStringRef("\xff/globalConfig/k/"), - LiteralStringRef("\xff/globalConfig/k0")); +const KeyRangeRef globalConfigDataKeys("\xff/globalConfig/k/"_sr, "\xff/globalConfig/k0"_sr); const KeyRef globalConfigKeysPrefix = globalConfigDataKeys.begin; -const KeyRangeRef globalConfigHistoryKeys(LiteralStringRef("\xff/globalConfig/h/"), - LiteralStringRef("\xff/globalConfig/h0")); +const KeyRangeRef globalConfigHistoryKeys("\xff/globalConfig/h/"_sr, "\xff/globalConfig/h0"_sr); const KeyRef globalConfigHistoryPrefix = globalConfigHistoryKeys.begin; -const KeyRef globalConfigVersionKey = LiteralStringRef("\xff/globalConfig/v"); +const KeyRef globalConfigVersionKey = "\xff/globalConfig/v"_sr; -const KeyRangeRef workerListKeys(LiteralStringRef("\xff/worker/"), LiteralStringRef("\xff/worker0")); +const KeyRangeRef workerListKeys("\xff/worker/"_sr, "\xff/worker0"_sr); const KeyRef workerListPrefix = workerListKeys.begin; const Key workerListKeyFor(StringRef processID) { @@ -773,11 +1089,10 @@ ProcessData decodeWorkerListValue(ValueRef const& value) { return s; } -const KeyRangeRef backupProgressKeys(LiteralStringRef("\xff\x02/backupProgress/"), - LiteralStringRef("\xff\x02/backupProgress0")); +const KeyRangeRef backupProgressKeys("\xff\x02/backupProgress/"_sr, "\xff\x02/backupProgress0"_sr); const KeyRef backupProgressPrefix = backupProgressKeys.begin; -const KeyRef backupStartedKey = LiteralStringRef("\xff\x02/backupStarted"); -extern const KeyRef backupPausedKey = LiteralStringRef("\xff\x02/backupPaused"); +const KeyRef backupStartedKey = "\xff\x02/backupStarted"_sr; +extern const KeyRef backupPausedKey = "\xff\x02/backupPaused"_sr; const Key backupProgressKeyFor(UID workerID) { BinaryWriter wr(Unversioned()); @@ -820,98 +1135,104 @@ std::vector> decodeBackupStartedValue(const ValueRef& va return ids; } -const KeyRef coordinatorsKey = LiteralStringRef("\xff/coordinators"); -const KeyRef logsKey = LiteralStringRef("\xff/logs"); -const KeyRef minRequiredCommitVersionKey = LiteralStringRef("\xff/minRequiredCommitVersion"); -const KeyRef versionEpochKey = LiteralStringRef("\xff/versionEpoch"); +bool mutationForKey(const MutationRef& m, const KeyRef& key) { + return isSingleKeyMutation((MutationRef::Type)m.type) && m.param1 == key; +} + +const KeyRef previousCoordinatorsKey = "\xff/previousCoordinators"_sr; +const KeyRef coordinatorsKey = "\xff/coordinators"_sr; +const KeyRef logsKey = "\xff/logs"_sr; +const KeyRef minRequiredCommitVersionKey = "\xff/minRequiredCommitVersion"_sr; +const KeyRef versionEpochKey = "\xff/versionEpoch"_sr; -const KeyRef globalKeysPrefix = LiteralStringRef("\xff/globals"); -const KeyRef lastEpochEndKey = LiteralStringRef("\xff/globals/lastEpochEnd"); -const KeyRef lastEpochEndPrivateKey = LiteralStringRef("\xff\xff/globals/lastEpochEnd"); -const KeyRef killStorageKey = LiteralStringRef("\xff/globals/killStorage"); -const KeyRef killStoragePrivateKey = LiteralStringRef("\xff\xff/globals/killStorage"); -const KeyRef rebootWhenDurableKey = LiteralStringRef("\xff/globals/rebootWhenDurable"); -const KeyRef rebootWhenDurablePrivateKey = LiteralStringRef("\xff\xff/globals/rebootWhenDurable"); -const KeyRef primaryLocalityKey = LiteralStringRef("\xff/globals/primaryLocality"); -const KeyRef primaryLocalityPrivateKey = LiteralStringRef("\xff\xff/globals/primaryLocality"); -const KeyRef fastLoggingEnabled = LiteralStringRef("\xff/globals/fastLoggingEnabled"); -const KeyRef fastLoggingEnabledPrivateKey = LiteralStringRef("\xff\xff/globals/fastLoggingEnabled"); +const KeyRef globalKeysPrefix = "\xff/globals"_sr; +const KeyRef lastEpochEndKey = "\xff/globals/lastEpochEnd"_sr; +const KeyRef lastEpochEndPrivateKey = "\xff\xff/globals/lastEpochEnd"_sr; +const KeyRef killStorageKey = "\xff/globals/killStorage"_sr; +const KeyRef killStoragePrivateKey = "\xff\xff/globals/killStorage"_sr; +const KeyRef rebootWhenDurableKey = "\xff/globals/rebootWhenDurable"_sr; +const KeyRef rebootWhenDurablePrivateKey = "\xff\xff/globals/rebootWhenDurable"_sr; +const KeyRef primaryLocalityKey = "\xff/globals/primaryLocality"_sr; +const KeyRef primaryLocalityPrivateKey = "\xff\xff/globals/primaryLocality"_sr; +const KeyRef fastLoggingEnabled = "\xff/globals/fastLoggingEnabled"_sr; +const KeyRef fastLoggingEnabledPrivateKey = "\xff\xff/globals/fastLoggingEnabled"_sr; // Whenever configuration changes or DD related system keyspace is changed(e.g.., serverList), // actor must grab the moveKeysLockOwnerKey and update moveKeysLockWriteKey. // This prevents concurrent write to the same system keyspace. // When the owner of the DD related system keyspace changes, DD will reboot -const KeyRef moveKeysLockOwnerKey = LiteralStringRef("\xff/moveKeysLock/Owner"); -const KeyRef moveKeysLockWriteKey = LiteralStringRef("\xff/moveKeysLock/Write"); +const KeyRef moveKeysLockOwnerKey = "\xff/moveKeysLock/Owner"_sr; +const KeyRef moveKeysLockWriteKey = "\xff/moveKeysLock/Write"_sr; -const KeyRef dataDistributionModeKey = LiteralStringRef("\xff/dataDistributionMode"); +const KeyRef dataDistributionModeKey = "\xff/dataDistributionMode"_sr; const UID dataDistributionModeLock = UID(6345, 3425); // Keys to view and control tag throttling -const KeyRangeRef tagThrottleKeys = - KeyRangeRef(LiteralStringRef("\xff\x02/throttledTags/tag/"), LiteralStringRef("\xff\x02/throttledTags/tag0")); +const KeyRangeRef tagThrottleKeys = KeyRangeRef("\xff\x02/throttledTags/tag/"_sr, "\xff\x02/throttledTags/tag0"_sr); const KeyRef tagThrottleKeysPrefix = tagThrottleKeys.begin; -const KeyRef tagThrottleAutoKeysPrefix = LiteralStringRef("\xff\x02/throttledTags/tag/\x01"); -const KeyRef tagThrottleSignalKey = LiteralStringRef("\xff\x02/throttledTags/signal"); -const KeyRef tagThrottleAutoEnabledKey = LiteralStringRef("\xff\x02/throttledTags/autoThrottlingEnabled"); -const KeyRef tagThrottleLimitKey = LiteralStringRef("\xff\x02/throttledTags/manualThrottleLimit"); -const KeyRef tagThrottleCountKey = LiteralStringRef("\xff\x02/throttledTags/manualThrottleCount"); +const KeyRef tagThrottleAutoKeysPrefix = "\xff\x02/throttledTags/tag/\x01"_sr; +const KeyRef tagThrottleSignalKey = "\xff\x02/throttledTags/signal"_sr; +const KeyRef tagThrottleAutoEnabledKey = "\xff\x02/throttledTags/autoThrottlingEnabled"_sr; +const KeyRef tagThrottleLimitKey = "\xff\x02/throttledTags/manualThrottleLimit"_sr; +const KeyRef tagThrottleCountKey = "\xff\x02/throttledTags/manualThrottleCount"_sr; // Client status info prefix -const KeyRangeRef fdbClientInfoPrefixRange(LiteralStringRef("\xff\x02/fdbClientInfo/"), - LiteralStringRef("\xff\x02/fdbClientInfo0")); +const KeyRangeRef fdbClientInfoPrefixRange("\xff\x02/fdbClientInfo/"_sr, "\xff\x02/fdbClientInfo0"_sr); // See remaining fields in GlobalConfig.actor.h // ConsistencyCheck settings -const KeyRef fdbShouldConsistencyCheckBeSuspended = LiteralStringRef("\xff\x02/ConsistencyCheck/Suspend"); +const KeyRef fdbShouldConsistencyCheckBeSuspended = "\xff\x02/ConsistencyCheck/Suspend"_sr; // Request latency measurement key -const KeyRef latencyBandConfigKey = LiteralStringRef("\xff\x02/latencyBandConfig"); +const KeyRef latencyBandConfigKey = "\xff\x02/latencyBandConfig"_sr; // Keyspace to maintain wall clock to version map -const KeyRangeRef timeKeeperPrefixRange(LiteralStringRef("\xff\x02/timeKeeper/map/"), - LiteralStringRef("\xff\x02/timeKeeper/map0")); -const KeyRef timeKeeperVersionKey = LiteralStringRef("\xff\x02/timeKeeper/version"); -const KeyRef timeKeeperDisableKey = LiteralStringRef("\xff\x02/timeKeeper/disable"); +const KeyRangeRef timeKeeperPrefixRange("\xff\x02/timeKeeper/map/"_sr, "\xff\x02/timeKeeper/map0"_sr); +const KeyRef timeKeeperVersionKey = "\xff\x02/timeKeeper/version"_sr; +const KeyRef timeKeeperDisableKey = "\xff\x02/timeKeeper/disable"_sr; + +// Durable cluster ID key. Added "Key" to the end to differentiate from the key +// "\xff/clusterId" which was stored in the txnStateStore in FDB 7.1, whereas +// this key is stored in the database in 7.2+. +const KeyRef clusterIdKey = "\xff/clusterIdKey"_sr; // Backup Log Mutation constant variables -const KeyRef backupEnabledKey = LiteralStringRef("\xff/backupEnabled"); -const KeyRangeRef backupLogKeys(LiteralStringRef("\xff\x02/blog/"), LiteralStringRef("\xff\x02/blog0")); -const KeyRangeRef applyLogKeys(LiteralStringRef("\xff\x02/alog/"), LiteralStringRef("\xff\x02/alog0")); +const KeyRef backupEnabledKey = "\xff/backupEnabled"_sr; +const KeyRangeRef backupLogKeys("\xff\x02/blog/"_sr, "\xff\x02/blog0"_sr); +const KeyRangeRef applyLogKeys("\xff\x02/alog/"_sr, "\xff\x02/alog0"_sr); +bool isBackupLogMutation(const MutationRef& m) { + return isSingleKeyMutation((MutationRef::Type)m.type) && + (backupLogKeys.contains(m.param1) || applyLogKeys.contains(m.param1)); +} // static_assert( backupLogKeys.begin.size() == backupLogPrefixBytes, "backupLogPrefixBytes incorrect" ); -const KeyRef backupVersionKey = LiteralStringRef("\xff/backupDataFormat"); -const ValueRef backupVersionValue = LiteralStringRef("4"); +const KeyRef backupVersionKey = "\xff/backupDataFormat"_sr; +const ValueRef backupVersionValue = "4"_sr; const int backupVersion = 4; // Log Range constant variables // \xff/logRanges/[16-byte UID][begin key] := serialize( make_pair([end key], [destination key prefix]), // IncludeVersion() ) -const KeyRangeRef logRangesRange(LiteralStringRef("\xff/logRanges/"), LiteralStringRef("\xff/logRanges0")); +const KeyRangeRef logRangesRange("\xff/logRanges/"_sr, "\xff/logRanges0"_sr); // Layer status metadata prefix -const KeyRangeRef layerStatusMetaPrefixRange(LiteralStringRef("\xff\x02/status/"), - LiteralStringRef("\xff\x02/status0")); +const KeyRangeRef layerStatusMetaPrefixRange("\xff\x02/status/"_sr, "\xff\x02/status0"_sr); // Backup agent status root -const KeyRangeRef backupStatusPrefixRange(LiteralStringRef("\xff\x02/backupstatus/"), - LiteralStringRef("\xff\x02/backupstatus0")); +const KeyRangeRef backupStatusPrefixRange("\xff\x02/backupstatus/"_sr, "\xff\x02/backupstatus0"_sr); // Restore configuration constant variables -const KeyRangeRef fileRestorePrefixRange(LiteralStringRef("\xff\x02/restore-agent/"), - LiteralStringRef("\xff\x02/restore-agent0")); +const KeyRangeRef fileRestorePrefixRange("\xff\x02/restore-agent/"_sr, "\xff\x02/restore-agent0"_sr); // Backup Agent configuration constant variables -const KeyRangeRef fileBackupPrefixRange(LiteralStringRef("\xff\x02/backup-agent/"), - LiteralStringRef("\xff\x02/backup-agent0")); +const KeyRangeRef fileBackupPrefixRange("\xff\x02/backup-agent/"_sr, "\xff\x02/backup-agent0"_sr); // DR Agent configuration constant variables -const KeyRangeRef databaseBackupPrefixRange(LiteralStringRef("\xff\x02/db-backup-agent/"), - LiteralStringRef("\xff\x02/db-backup-agent0")); +const KeyRangeRef databaseBackupPrefixRange("\xff\x02/db-backup-agent/"_sr, "\xff\x02/db-backup-agent0"_sr); // \xff\x02/sharedLogRangesConfig/destUidLookup/[keyRange] -const KeyRef destUidLookupPrefix = LiteralStringRef("\xff\x02/sharedLogRangesConfig/destUidLookup/"); +const KeyRef destUidLookupPrefix = "\xff\x02/sharedLogRangesConfig/destUidLookup/"_sr; // \xff\x02/sharedLogRangesConfig/backuplatestVersions/[destUid]/[logUid] -const KeyRef backupLatestVersionsPrefix = LiteralStringRef("\xff\x02/sharedLogRangesConfig/backupLatestVersions/"); +const KeyRef backupLatestVersionsPrefix = "\xff\x02/sharedLogRangesConfig/backupLatestVersions/"_sr; // Returns the encoded key comprised of begin key and log uid Key logRangesEncodeKey(KeyRef keyBegin, UID logUid) { @@ -966,31 +1287,27 @@ Key uidPrefixKey(KeyRef keyPrefix, UID logUid) { // Apply mutations constant variables // \xff/applyMutationsEnd/[16-byte UID] := serialize( endVersion, Unversioned() ) // This indicates what is the highest version the mutation log can be applied -const KeyRangeRef applyMutationsEndRange(LiteralStringRef("\xff/applyMutationsEnd/"), - LiteralStringRef("\xff/applyMutationsEnd0")); +const KeyRangeRef applyMutationsEndRange("\xff/applyMutationsEnd/"_sr, "\xff/applyMutationsEnd0"_sr); // \xff/applyMutationsBegin/[16-byte UID] := serialize( beginVersion, Unversioned() ) -const KeyRangeRef applyMutationsBeginRange(LiteralStringRef("\xff/applyMutationsBegin/"), - LiteralStringRef("\xff/applyMutationsBegin0")); +const KeyRangeRef applyMutationsBeginRange("\xff/applyMutationsBegin/"_sr, "\xff/applyMutationsBegin0"_sr); // \xff/applyMutationsAddPrefix/[16-byte UID] := addPrefix -const KeyRangeRef applyMutationsAddPrefixRange(LiteralStringRef("\xff/applyMutationsAddPrefix/"), - LiteralStringRef("\xff/applyMutationsAddPrefix0")); +const KeyRangeRef applyMutationsAddPrefixRange("\xff/applyMutationsAddPrefix/"_sr, "\xff/applyMutationsAddPrefix0"_sr); // \xff/applyMutationsRemovePrefix/[16-byte UID] := removePrefix -const KeyRangeRef applyMutationsRemovePrefixRange(LiteralStringRef("\xff/applyMutationsRemovePrefix/"), - LiteralStringRef("\xff/applyMutationsRemovePrefix0")); +const KeyRangeRef applyMutationsRemovePrefixRange("\xff/applyMutationsRemovePrefix/"_sr, + "\xff/applyMutationsRemovePrefix0"_sr); -const KeyRangeRef applyMutationsKeyVersionMapRange(LiteralStringRef("\xff/applyMutationsKeyVersionMap/"), - LiteralStringRef("\xff/applyMutationsKeyVersionMap0")); -const KeyRangeRef applyMutationsKeyVersionCountRange(LiteralStringRef("\xff\x02/applyMutationsKeyVersionCount/"), - LiteralStringRef("\xff\x02/applyMutationsKeyVersionCount0")); +const KeyRangeRef applyMutationsKeyVersionMapRange("\xff/applyMutationsKeyVersionMap/"_sr, + "\xff/applyMutationsKeyVersionMap0"_sr); +const KeyRangeRef applyMutationsKeyVersionCountRange("\xff\x02/applyMutationsKeyVersionCount/"_sr, + "\xff\x02/applyMutationsKeyVersionCount0"_sr); -const KeyRef systemTuplesPrefix = LiteralStringRef("\xff/a/"); -const KeyRef metricConfChangeKey = LiteralStringRef("\x01TDMetricConfChanges\x00"); +const KeyRef systemTuplesPrefix = "\xff/a/"_sr; +const KeyRef metricConfChangeKey = "\x01TDMetricConfChanges\x00"_sr; -const KeyRangeRef metricConfKeys(LiteralStringRef("\x01TDMetricConf\x00\x01"), - LiteralStringRef("\x01TDMetricConf\x00\x02")); +const KeyRangeRef metricConfKeys("\x01TDMetricConf\x00\x01"_sr, "\x01TDMetricConf\x00\x02"_sr); const KeyRef metricConfPrefix = metricConfKeys.begin; /* @@ -999,15 +1316,15 @@ const Key metricConfKey( KeyRef const& prefix, MetricNameRef const& name, KeyRef wr.serializeBytes( prefix ); wr.serializeBytes( metricConfPrefix ); wr.serializeBytes( name.type ); - wr.serializeBytes( LiteralStringRef("\x00\x01") ); + wr.serializeBytes( "\x00\x01"_sr ); wr.serializeBytes( name.name ); - wr.serializeBytes( LiteralStringRef("\x00\x01") ); + wr.serializeBytes( "\x00\x01"_sr ); wr.serializeBytes( name.address ); - wr.serializeBytes( LiteralStringRef("\x00\x01") ); + wr.serializeBytes( "\x00\x01"_sr ); wr.serializeBytes( name.id ); - wr.serializeBytes( LiteralStringRef("\x00\x01") ); + wr.serializeBytes( "\x00\x01"_sr ); wr.serializeBytes( key ); - wr.serializeBytes( LiteralStringRef("\x00") ); + wr.serializeBytes( "\x00"_sr ); return wr.toValue(); } @@ -1030,23 +1347,22 @@ std::pair decodeMetricConfKey( KeyRef const& prefix, KeyR } */ -const KeyRef maxUIDKey = LiteralStringRef("\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"); +const KeyRef maxUIDKey = "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"_sr; -const KeyRef databaseLockedKey = LiteralStringRef("\xff/dbLocked"); -const KeyRef databaseLockedKeyEnd = LiteralStringRef("\xff/dbLocked\x00"); -const KeyRef metadataVersionKey = LiteralStringRef("\xff/metadataVersion"); -const KeyRef metadataVersionKeyEnd = LiteralStringRef("\xff/metadataVersion\x00"); -const KeyRef metadataVersionRequiredValue = - LiteralStringRef("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"); -const KeyRef mustContainSystemMutationsKey = LiteralStringRef("\xff/mustContainSystemMutations"); +const KeyRef databaseLockedKey = "\xff/dbLocked"_sr; +const KeyRef databaseLockedKeyEnd = "\xff/dbLocked\x00"_sr; +const KeyRef metadataVersionKey = "\xff/metadataVersion"_sr; +const KeyRef metadataVersionKeyEnd = "\xff/metadataVersion\x00"_sr; +const KeyRef metadataVersionRequiredValue = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"_sr; +const KeyRef mustContainSystemMutationsKey = "\xff/mustContainSystemMutations"_sr; -const KeyRangeRef monitorConfKeys(LiteralStringRef("\xff\x02/monitorConf/"), LiteralStringRef("\xff\x02/monitorConf0")); +const KeyRangeRef monitorConfKeys("\xff\x02/monitorConf/"_sr, "\xff\x02/monitorConf0"_sr); -const KeyRef restoreRequestDoneKey = LiteralStringRef("\xff\x02/restoreRequestDone"); +const KeyRef restoreRequestDoneKey = "\xff\x02/restoreRequestDone"_sr; -const KeyRef healthyZoneKey = LiteralStringRef("\xff\x02/healthyZone"); -const StringRef ignoreSSFailuresZoneString = LiteralStringRef("IgnoreSSFailures"); -const KeyRef rebalanceDDIgnoreKey = LiteralStringRef("\xff\x02/rebalanceDDIgnored"); +const KeyRef healthyZoneKey = "\xff\x02/healthyZone"_sr; +const StringRef ignoreSSFailuresZoneString = "IgnoreSSFailures"_sr; +const KeyRef rebalanceDDIgnoreKey = "\xff\x02/rebalanceDDIgnored"_sr; const Value healthyZoneValue(StringRef const& zoneId, Version version) { BinaryWriter wr(IncludeVersion(ProtocolVersion::withHealthyZoneValue())); @@ -1063,16 +1379,15 @@ std::pair decodeHealthyZoneValue(ValueRef const& value) { return std::make_pair(zoneId, version); } -const KeyRangeRef testOnlyTxnStateStorePrefixRange(LiteralStringRef("\xff/TESTONLYtxnStateStore/"), - LiteralStringRef("\xff/TESTONLYtxnStateStore0")); +const KeyRangeRef testOnlyTxnStateStorePrefixRange("\xff/TESTONLYtxnStateStore/"_sr, "\xff/TESTONLYtxnStateStore0"_sr); -const KeyRef writeRecoveryKey = LiteralStringRef("\xff/writeRecovery"); -const ValueRef writeRecoveryKeyTrue = LiteralStringRef("1"); -const KeyRef snapshotEndVersionKey = LiteralStringRef("\xff/snapshotEndVersion"); +const KeyRef writeRecoveryKey = "\xff/writeRecovery"_sr; +const ValueRef writeRecoveryKeyTrue = "1"_sr; +const KeyRef snapshotEndVersionKey = "\xff/snapshotEndVersion"_sr; -const KeyRangeRef changeFeedKeys(LiteralStringRef("\xff\x02/feed/"), LiteralStringRef("\xff\x02/feed0")); +const KeyRangeRef changeFeedKeys("\xff\x02/feed/"_sr, "\xff\x02/feed0"_sr); const KeyRef changeFeedPrefix = changeFeedKeys.begin; -const KeyRef changeFeedPrivatePrefix = LiteralStringRef("\xff\xff\x02/feed/"); +const KeyRef changeFeedPrivatePrefix = "\xff\xff\x02/feed/"_sr; const Value changeFeedValue(KeyRangeRef const& range, Version popVersion, ChangeFeedStatus status) { BinaryWriter wr(IncludeVersion(ProtocolVersion::withChangeFeed())); @@ -1093,7 +1408,7 @@ std::tuple decodeChangeFeedValue(ValueRef c return std::make_tuple(range, version, status); } -const KeyRangeRef changeFeedDurableKeys(LiteralStringRef("\xff\xff/cf/"), LiteralStringRef("\xff\xff/cf0")); +const KeyRangeRef changeFeedDurableKeys("\xff\xff/cf/"_sr, "\xff\xff/cf0"_sr); const KeyRef changeFeedDurablePrefix = changeFeedDurableKeys.begin; const Value changeFeedDurableKey(Key const& feed, Version version) { @@ -1126,6 +1441,79 @@ std::pair>, Version> decodeChangeFeedDurableVa return std::make_pair(mutations, knownCommittedVersion); } +const KeyRangeRef changeFeedCacheKeys("\xff\xff/cc/"_sr, "\xff\xff/cc0"_sr); +const KeyRef changeFeedCachePrefix = changeFeedCacheKeys.begin; + +const Value changeFeedCacheKey(Key const& prefix, Key const& feed, KeyRange const& range, Version version) { + BinaryWriter wr(AssumeVersion(ProtocolVersion::withChangeFeed())); + wr.serializeBytes(prefix); + wr.serializeBytes(changeFeedCachePrefix); + wr << feed; + wr << range; + wr << bigEndian64(version); + return wr.toValue(); +} +std::tuple decodeChangeFeedCacheKey(KeyRef const& prefix, ValueRef const& key) { + Key feed; + KeyRange range; + Version version; + BinaryReader reader(key.removePrefix(prefix).removePrefix(changeFeedCachePrefix), + AssumeVersion(ProtocolVersion::withChangeFeed())); + reader >> feed; + reader >> range; + reader >> version; + return std::make_tuple(feed, range, bigEndian64(version)); +} + +// The versions of these mutations must be less than or equal to the version in the changeFeedCacheKey +const Value changeFeedCacheValue(Standalone> const& mutations) { + BinaryWriter wr(IncludeVersion(ProtocolVersion::withChangeFeed())); + wr << mutations; + return wr.toValue(); +} +Standalone> decodeChangeFeedCacheValue(ValueRef const& value) { + Standalone> mutations; + BinaryReader reader(value, IncludeVersion()); + reader >> mutations; + return mutations; +} + +const KeyRangeRef changeFeedCacheFeedKeys("\xff\xff/ccd/"_sr, "\xff\xff/ccd0"_sr); +const KeyRef changeFeedCacheFeedPrefix = changeFeedCacheFeedKeys.begin; + +const Value changeFeedCacheFeedKey(Key const& prefix, Key const& feed, KeyRange const& range) { + BinaryWriter wr(AssumeVersion(ProtocolVersion::withChangeFeed())); + wr.serializeBytes(changeFeedCacheFeedPrefix); + wr << prefix; + wr << feed; + wr << range; + return wr.toValue(); +} +std::tuple decodeChangeFeedCacheFeedKey(ValueRef const& key) { + Key prefix; + Key feed; + KeyRange range; + BinaryReader reader(key.removePrefix(changeFeedCacheFeedPrefix), AssumeVersion(ProtocolVersion::withChangeFeed())); + reader >> prefix; + reader >> feed; + reader >> range; + return std::make_tuple(prefix, feed, range); +} +const Value changeFeedCacheFeedValue(Version const& version, Version const& popped) { + BinaryWriter wr(IncludeVersion(ProtocolVersion::withChangeFeed())); + wr << version; + wr << popped; + return wr.toValue(); +} +std::pair decodeChangeFeedCacheFeedValue(ValueRef const& value) { + Version version; + Version popped; + BinaryReader reader(value, IncludeVersion()); + reader >> version; + reader >> popped; + return std::make_pair(version, popped); +} + const KeyRef configTransactionDescriptionKey = "\xff\xff/description"_sr; const KeyRange globalConfigKnobKeys = singleKeyRange("\xff\xff/globalKnobs"_sr); const KeyRangeRef configKnobKeys("\xff\xff/knobs/"_sr, "\xff\xff/knobs0"_sr); @@ -1133,9 +1521,10 @@ const KeyRangeRef configClassKeys("\xff\xff/configClasses/"_sr, "\xff\xff/config // key to watch for changes in active blob ranges + KeyRangeMap of active blob ranges // Blob Manager + Worker stuff is all \xff\x02 to avoid Transaction State Store -const KeyRef blobRangeChangeKey = LiteralStringRef("\xff\x02/blobRangeChange"); -const KeyRangeRef blobRangeKeys(LiteralStringRef("\xff\x02/blobRange/"), LiteralStringRef("\xff\x02/blobRange0")); -const KeyRef blobManagerEpochKey = LiteralStringRef("\xff\x02/blobManagerEpoch"); +const KeyRef blobRangeChangeKey = "\xff\x02/blobRangeChange"_sr; +const KeyRangeRef blobRangeKeys("\xff\x02/blobRange/"_sr, "\xff\x02/blobRange0"_sr); +const KeyRangeRef blobRangeChangeLogKeys("\xff\x02/blobRangeLog/"_sr, "\xff\x02/blobRangeLog0"_sr); +const KeyRef blobManagerEpochKey = "\xff\x02/blobManagerEpoch"_sr; const Value blobManagerEpochValueFor(int64_t epoch) { BinaryWriter wr(IncludeVersion(ProtocolVersion::withBlobGranule())); @@ -1151,14 +1540,44 @@ int64_t decodeBlobManagerEpochValue(ValueRef const& value) { } // blob granule data -const KeyRangeRef blobGranuleFileKeys(LiteralStringRef("\xff\x02/bgf/"), LiteralStringRef("\xff\x02/bgf0")); -const KeyRangeRef blobGranuleMappingKeys(LiteralStringRef("\xff\x02/bgm/"), LiteralStringRef("\xff\x02/bgm0")); -const KeyRangeRef blobGranuleLockKeys(LiteralStringRef("\xff\x02/bgl/"), LiteralStringRef("\xff\x02/bgl0")); -const KeyRangeRef blobGranuleSplitKeys(LiteralStringRef("\xff\x02/bgs/"), LiteralStringRef("\xff\x02/bgs0")); -const KeyRangeRef blobGranuleHistoryKeys(LiteralStringRef("\xff\x02/bgh/"), LiteralStringRef("\xff\x02/bgh0")); -const KeyRangeRef blobGranulePurgeKeys(LiteralStringRef("\xff\x02/bgp/"), LiteralStringRef("\xff\x02/bgp0")); -const KeyRangeRef blobGranuleVersionKeys(LiteralStringRef("\xff\x02/bgv/"), LiteralStringRef("\xff\x02/bgv0")); -const KeyRef blobGranulePurgeChangeKey = LiteralStringRef("\xff\x02/bgpChange"); +const KeyRef blobRangeActive = "1"_sr; +const KeyRef blobRangeInactive = StringRef(); + +bool isBlobRangeActive(const ValueRef& blobRangeValue) { + // Empty or "0" is inactive + // "1" is active + // Support future change where serialized metadata struct is also active + return !blobRangeValue.empty() && blobRangeValue != blobRangeInactive; +} + +const Key blobRangeChangeLogReadKeyFor(Version version) { + BinaryWriter wr(AssumeVersion(ProtocolVersion::withBlobRangeChangeLog())); + wr.serializeBytes(blobRangeChangeLogKeys.begin); + wr << bigEndian64(version); + return wr.toValue(); +} + +const Value blobRangeChangeLogValueFor(const Standalone& value) { + return ObjectWriter::toValue(value, IncludeVersion(ProtocolVersion::withBlobRangeChangeLog())); +} + +Standalone decodeBlobRangeChangeLogValue(ValueRef const& value) { + Standalone result; + ObjectReader reader(value.begin(), IncludeVersion()); + reader.deserialize(result); + return result; +} + +const KeyRangeRef blobGranuleFileKeys("\xff\x02/bgf/"_sr, "\xff\x02/bgf0"_sr); +const KeyRangeRef blobGranuleMappingKeys("\xff\x02/bgm/"_sr, "\xff\x02/bgm0"_sr); +const KeyRangeRef blobGranuleLockKeys("\xff\x02/bgl/"_sr, "\xff\x02/bgl0"_sr); +const KeyRangeRef blobGranuleSplitKeys("\xff\x02/bgs/"_sr, "\xff\x02/bgs0"_sr); +const KeyRangeRef blobGranuleMergeKeys("\xff\x02/bgmerge/"_sr, "\xff\x02/bgmerge0"_sr); +const KeyRangeRef blobGranuleMergeBoundaryKeys("\xff\x02/bgmergebounds/"_sr, "\xff\x02/bgmergebounds0"_sr); +const KeyRangeRef blobGranuleHistoryKeys("\xff\x02/bgh/"_sr, "\xff\x02/bgh0"_sr); +const KeyRangeRef blobGranulePurgeKeys("\xff\x02/bgp/"_sr, "\xff\x02/bgp0"_sr); +const KeyRangeRef blobGranuleForcePurgedKeys("\xff\x02/bgpforce/"_sr, "\xff\x02/bgpforce0"_sr); +const KeyRef blobGranulePurgeChangeKey = "\xff\x02/bgpChange"_sr; const uint8_t BG_FILE_TYPE_DELTA = 'D'; const uint8_t BG_FILE_TYPE_SNAPSHOT = 'S'; @@ -1193,26 +1612,49 @@ const KeyRange blobGranuleFileKeyRangeFor(UID granuleID) { return KeyRangeRef(startKey, strinc(startKey)); } -const Value blobGranuleFileValueFor(StringRef const& filename, int64_t offset, int64_t length, int64_t fullFileLength) { - BinaryWriter wr(IncludeVersion(ProtocolVersion::withBlobGranule())); +const Value blobGranuleFileValueFor(StringRef const& filename, + int64_t offset, + int64_t length, + int64_t fullFileLength, + int64_t logicalSize, + Optional cipherKeysMeta) { + auto protocolVersion = CLIENT_KNOBS->ENABLE_BLOB_GRANULE_FILE_LOGICAL_SIZE + ? ProtocolVersion::withBlobGranuleFileLogicalSize() + : ProtocolVersion::withBlobGranule(); + BinaryWriter wr(IncludeVersion(protocolVersion)); wr << filename; wr << offset; wr << length; wr << fullFileLength; + wr << cipherKeysMeta; + if (CLIENT_KNOBS->ENABLE_BLOB_GRANULE_FILE_LOGICAL_SIZE) { + wr << logicalSize; + } return wr.toValue(); } -std::tuple, int64_t, int64_t, int64_t> decodeBlobGranuleFileValue(ValueRef const& value) { +std::tuple, int64_t, int64_t, int64_t, int64_t, Optional> +decodeBlobGranuleFileValue(ValueRef const& value) { StringRef filename; int64_t offset; int64_t length; int64_t fullFileLength; + int64_t logicalSize; + Optional cipherKeysMeta; + BinaryReader reader(value, IncludeVersion()); reader >> filename; reader >> offset; reader >> length; reader >> fullFileLength; - return std::tuple(filename, offset, length, fullFileLength); + reader >> cipherKeysMeta; + if (reader.protocolVersion().hasBlobGranuleFileLogicalSize()) { + reader >> logicalSize; + } else { + // fall back to estimating logical size as physical size + logicalSize = length; + } + return std::tuple(filename, offset, length, fullFileLength, logicalSize, cipherKeysMeta); } const Value blobGranulePurgeValueFor(Version version, KeyRange range, bool force) { @@ -1300,6 +1742,25 @@ const KeyRange blobGranuleSplitKeyRangeFor(UID const& parentGranuleID) { return KeyRangeRef(startKey, strinc(startKey)); } +const Key blobGranuleMergeKeyFor(UID const& mergeGranuleID) { + // TODO should we bump this assumed version to 7.2 as blob granule merging is not in 7.1? 7.1 won't try to read this + // data though since it didn't exist before + BinaryWriter wr(AssumeVersion(ProtocolVersion::withBlobGranule())); + wr.serializeBytes(blobGranuleMergeKeys.begin); + wr << mergeGranuleID; + + return wr.toValue(); +} + +UID decodeBlobGranuleMergeKey(KeyRef const& key) { + UID mergeGranuleID; + BinaryReader reader(key.removePrefix(blobGranuleMergeKeys.begin), + AssumeVersion(ProtocolVersion::withBlobGranule())); + + reader >> mergeGranuleID; + return mergeGranuleID; +} + const Value blobGranuleSplitValueFor(BlobGranuleSplitState st) { BinaryWriter wr(IncludeVersion(ProtocolVersion::withBlobGranule())); wr << st; @@ -1316,6 +1777,59 @@ std::pair decodeBlobGranuleSplitValue(const Valu return std::pair(st, bigEndian64(v)); } +const Value blobGranuleMergeValueFor(KeyRange mergeKeyRange, + std::vector parentGranuleIDs, + std::vector parentGranuleRanges, + std::vector parentGranuleStartVersions) { + ASSERT(parentGranuleIDs.size() == parentGranuleRanges.size() - 1); + ASSERT(parentGranuleIDs.size() == parentGranuleStartVersions.size()); + + BinaryWriter wr(IncludeVersion(ProtocolVersion::withBlobGranule())); + wr << mergeKeyRange; + wr << parentGranuleIDs; + wr << parentGranuleRanges; + wr << parentGranuleStartVersions; + return addVersionStampAtEnd(wr.toValue()); +} +std::tuple, std::vector, std::vector> decodeBlobGranuleMergeValue( + ValueRef const& value) { + KeyRange range; + Version v; + std::vector parentGranuleIDs; + std::vector parentGranuleRanges; + std::vector parentGranuleStartVersions; + + BinaryReader reader(value, IncludeVersion()); + reader >> range; + reader >> parentGranuleIDs; + reader >> parentGranuleRanges; + reader >> parentGranuleStartVersions; + reader >> v; + + ASSERT(parentGranuleIDs.size() == parentGranuleRanges.size() - 1); + ASSERT(parentGranuleIDs.size() == parentGranuleStartVersions.size()); + ASSERT(bigEndian64(v) >= 0); + + return std::tuple(range, bigEndian64(v), parentGranuleIDs, parentGranuleRanges, parentGranuleStartVersions); +} + +const Key blobGranuleMergeBoundaryKeyFor(const KeyRef& key) { + return key.withPrefix(blobGranuleMergeBoundaryKeys.begin); +} + +const Value blobGranuleMergeBoundaryValueFor(BlobGranuleMergeBoundary const& boundary) { + BinaryWriter wr(IncludeVersion(ProtocolVersion::withBlobGranule())); + wr << boundary; + return wr.toValue(); +} + +Standalone decodeBlobGranuleMergeBoundaryValue(const ValueRef& value) { + Standalone boundaryValue; + BinaryReader reader(value, IncludeVersion()); + reader >> boundaryValue; + return boundaryValue; +} + const Key blobGranuleHistoryKeyFor(KeyRangeRef const& range, Version version) { BinaryWriter wr(AssumeVersion(ProtocolVersion::withBlobGranule())); wr.serializeBytes(blobGranuleHistoryKeys.begin); @@ -1339,6 +1853,8 @@ const KeyRange blobGranuleHistoryKeyRangeFor(KeyRangeRef const& range) { } const Value blobGranuleHistoryValueFor(Standalone const& historyValue) { + ASSERT(historyValue.parentVersions.empty() || + historyValue.parentBoundaries.size() - 1 == historyValue.parentVersions.size()); BinaryWriter wr(IncludeVersion(ProtocolVersion::withBlobGranule())); wr << historyValue; return wr.toValue(); @@ -1348,10 +1864,12 @@ Standalone decodeBlobGranuleHistoryValue(const ValueRef Standalone historyValue; BinaryReader reader(value, IncludeVersion()); reader >> historyValue; + ASSERT(historyValue.parentVersions.empty() || + historyValue.parentBoundaries.size() - 1 == historyValue.parentVersions.size()); return historyValue; } -const KeyRangeRef blobWorkerListKeys(LiteralStringRef("\xff\x02/bwList/"), LiteralStringRef("\xff\x02/bwList0")); +const KeyRangeRef blobWorkerListKeys("\xff\x02/bwList/"_sr, "\xff\x02/bwList0"_sr); const Key blobWorkerListKeyFor(UID workerID) { BinaryWriter wr(AssumeVersion(ProtocolVersion::withBlobGranule())); @@ -1378,22 +1896,98 @@ BlobWorkerInterface decodeBlobWorkerListValue(ValueRef const& value) { return interf; } -Value encodeTenantEntry(TenantMapEntry const& tenantEntry) { - return ObjectWriter::toValue(tenantEntry, IncludeVersion()); +const KeyRangeRef blobWorkerAffinityKeys("\xff\x02/bwa/"_sr, "\xff\x02/bwa0"_sr); + +const Key blobWorkerAffinityKeyFor(UID workerID) { + BinaryWriter wr(AssumeVersion(ProtocolVersion::withBlobGranule())); + wr.serializeBytes(blobWorkerAffinityKeys.begin); + wr << workerID; + return wr.toValue(); +} + +UID decodeBlobWorkerAffinityKey(KeyRef const& key) { + UID workerID; + BinaryReader reader(key.removePrefix(blobWorkerAffinityKeys.begin), + AssumeVersion(ProtocolVersion::withBlobGranule())); + reader >> workerID; + return workerID; +} + +const Value blobWorkerAffinityValue(UID const& id) { + return ObjectWriter::toValue(id, IncludeVersion(ProtocolVersion::withBlobGranuleFile())); } -TenantMapEntry decodeTenantEntry(ValueRef const& value) { - TenantMapEntry entry; +UID decodeBlobWorkerAffinityValue(ValueRef const& value) { + UID id; ObjectReader reader(value.begin(), IncludeVersion()); - reader.deserialize(entry); - return entry; + reader.deserialize(id); + return id; +} + +const KeyRangeRef blobRestoreCommandKeys("\xff\x02/blobRestoreCommand/"_sr, "\xff\x02/blobRestoreCommand0"_sr); + +const Value blobRestoreCommandKeyFor(const KeyRangeRef range) { + BinaryWriter wr(AssumeVersion(ProtocolVersion::withBlobGranule())); + wr.serializeBytes(blobRestoreCommandKeys.begin); + wr << range; + return wr.toValue(); +} + +const KeyRange decodeBlobRestoreCommandKeyFor(const KeyRef key) { + KeyRange range; + BinaryReader reader(key.removePrefix(blobRestoreCommandKeys.begin), + AssumeVersion(ProtocolVersion::withBlobGranule())); + reader >> range; + return range; +} + +const Value blobRestoreCommandValueFor(BlobRestoreState restoreState) { + BinaryWriter wr(IncludeVersion(ProtocolVersion::withBlobGranule())); + wr << restoreState; + return wr.toValue(); +} + +Standalone decodeBlobRestoreState(ValueRef const& value) { + Standalone restoreState; + BinaryReader reader(value, IncludeVersion()); + reader >> restoreState; + return restoreState; } -const KeyRangeRef tenantMapKeys("\xff/tenantMap/"_sr, "\xff/tenantMap0"_sr); -const KeyRef tenantMapPrefix = tenantMapKeys.begin; -const KeyRef tenantMapPrivatePrefix = "\xff\xff/tenantMap/"_sr; -const KeyRef tenantLastIdKey = "\xff/tenantLastId/"_sr; -const KeyRef tenantDataPrefixKey = "\xff/tenantDataPrefix"_sr; +const KeyRangeRef blobRestoreArgKeys("\xff\x02/blobRestoreArgs/"_sr, "\xff\x02/blobRestoreArgs0"_sr); + +const Value blobRestoreArgKeyFor(const KeyRangeRef range) { + BinaryWriter wr(AssumeVersion(ProtocolVersion::withBlobGranule())); + wr.serializeBytes(blobRestoreArgKeys.begin); + wr << range; + return wr.toValue(); +} + +const KeyRange decodeBlobRestoreArgKeyFor(const KeyRef key) { + KeyRange range; + BinaryReader reader(key.removePrefix(blobRestoreArgKeys.begin), AssumeVersion(ProtocolVersion::withBlobGranule())); + reader >> range; + return range; +} + +const Value blobRestoreArgValueFor(BlobRestoreArg args) { + BinaryWriter wr(IncludeVersion(ProtocolVersion::withBlobGranule())); + wr << args; + return wr.toValue(); +} + +Standalone decodeBlobRestoreArg(ValueRef const& value) { + Standalone args; + BinaryReader reader(value, IncludeVersion()); + reader >> args; + return args; +} + +const Key blobManifestVersionKey = "\xff\x02/blobManifestVersion"_sr; +const Key blobGranulesLastFlushKey = "\xff\x02/blobGranulesLastFlushTs"_sr; + +const KeyRangeRef idempotencyIdKeys("\xff\x02/idmp/"_sr, "\xff\x02/idmp0"_sr); +const KeyRef idempotencyIdsExpiredVersion("\xff\x02/idmpExpiredVersion"_sr); // for tests void testSSISerdes(StorageServerInterface const& ssi) { @@ -1451,3 +2045,91 @@ TEST_CASE("/SystemData/SerDes/SSI") { return Void(); } + +// Tests compatibility of different keyServersValue() and decodeKeyServersValue(). +TEST_CASE("noSim/SystemData/compat/KeyServers") { + printf("testing keyServers serdes\n"); + std::vector src, dest; + std::map tag_uid; + std::map uid_tag; + std::vector srcTag, destTag; + const int n = 3; + int8_t locality = 1; + uint16_t id = 1; + UID srcId = deterministicRandom()->randomUniqueID(), destId = deterministicRandom()->randomUniqueID(); + for (int i = 0; i < n; ++i) { + src.push_back(deterministicRandom()->randomUniqueID()); + tag_uid.emplace(Tag(locality, id), src.back()); + uid_tag.emplace(src.back(), Tag(locality, id++)); + dest.push_back(deterministicRandom()->randomUniqueID()); + tag_uid.emplace(Tag(locality, id), dest.back()); + uid_tag.emplace(dest.back(), Tag(locality, id++)); + } + std::sort(src.begin(), src.end()); + std::sort(dest.begin(), dest.end()); + RangeResult idTag; + for (int i = 0; i < src.size(); ++i) { + idTag.push_back_deep(idTag.arena(), KeyValueRef(serverTagKeyFor(src[i]), serverTagValue(uid_tag[src[i]]))); + } + for (int i = 0; i < dest.size(); ++i) { + idTag.push_back_deep(idTag.arena(), KeyValueRef(serverTagKeyFor(dest[i]), serverTagValue(uid_tag[dest[i]]))); + } + + auto decodeAndVerify = + [&src, &dest, &tag_uid, &idTag](ValueRef v, const UID expectedSrcId, const UID expectedDestId) { + std::vector resSrc, resDest; + UID resSrcId, resDestId; + + decodeKeyServersValue(idTag, v, resSrc, resDest, resSrcId, resDestId); + TraceEvent("VerifyKeyServersSerDes") + .detail("ExpectedSrc", describe(src)) + .detail("ActualSrc", describe(resSrc)) + .detail("ExpectedDest", describe(dest)) + .detail("ActualDest", describe(resDest)) + .detail("ExpectedDestID", expectedDestId) + .detail("ActualDestID", resDestId) + .detail("ExpectedSrcID", expectedSrcId) + .detail("ActualSrcID", resSrcId); + ASSERT(std::equal(src.begin(), src.end(), resSrc.begin())); + ASSERT(std::equal(dest.begin(), dest.end(), resDest.begin())); + ASSERT(resSrcId == expectedSrcId); + ASSERT(resDestId == expectedDestId); + + resSrc.clear(); + resDest.clear(); + decodeKeyServersValue(idTag, v, resSrc, resDest); + ASSERT(std::equal(src.begin(), src.end(), resSrc.begin())); + ASSERT(std::equal(dest.begin(), dest.end(), resDest.begin())); + + resSrc.clear(); + resDest.clear(); + decodeKeyServersValue(tag_uid, v, resSrc, resDest); + ASSERT(std::equal(src.begin(), src.end(), resSrc.begin())); + ASSERT(std::equal(dest.begin(), dest.end(), resDest.begin())); + }; + + Value v = keyServersValue(src, dest, srcId, destId); + decodeAndVerify(v, srcId, destId); + + printf("ssi serdes test part.1 complete\n"); + + v = keyServersValue(idTag, src, dest); + decodeAndVerify(v, anonymousShardId, anonymousShardId); + + printf("ssi serdes test part.2 complete\n"); + + dest.clear(); + destId = UID(); + + v = keyServersValue(src, dest, srcId, destId); + decodeAndVerify(v, srcId, destId); + + printf("ssi serdes test part.3 complete\n"); + + v = keyServersValue(idTag, src, dest); + decodeAndVerify(v, anonymousShardId, UID()); + + printf("ssi serdes test complete\n"); + + return Void(); +} diff --git a/src/fdbclient/TagThrottle.actor.cpp b/src/fdbclient/TagThrottle.actor.cpp index 16c0b04..ad2cb76 100644 --- a/src/fdbclient/TagThrottle.actor.cpp +++ b/src/fdbclient/TagThrottle.actor.cpp @@ -18,12 +18,16 @@ * limitations under the License. */ -#include "fdbclient/TagThrottle.actor.h" #include "fdbclient/CommitProxyInterface.h" #include "fdbclient/DatabaseContext.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/TagThrottle.actor.h" +#include "fdbclient/Tuple.h" #include "flow/actorcompiler.h" // has to be last include +double const ClientTagThrottleLimits::NO_EXPIRATION = std::numeric_limits::max(); + void TagSet::addTag(TransactionTagRef tag) { ASSERT(CLIENT_KNOBS->MAX_TRANSACTION_TAG_LENGTH < 256); // Tag length is encoded with a single byte ASSERT(CLIENT_KNOBS->MAX_TAGS_PER_TRANSACTION < 256); // Number of tags is encoded with a single byte @@ -124,8 +128,42 @@ TagThrottleValue TagThrottleValue::fromValue(const ValueRef& value) { return throttleValue; } -FDB_DEFINE_BOOLEAN_PARAM(ContainsRecommended); -FDB_DEFINE_BOOLEAN_PARAM(Capitalize); +KeyRangeRef const tagQuotaKeys = KeyRangeRef("\xff/tagQuota/"_sr, "\xff/tagQuota0"_sr); +KeyRef const tagQuotaPrefix = tagQuotaKeys.begin; + +Key ThrottleApi::getTagQuotaKey(TransactionTagRef tag) { + return tag.withPrefix(tagQuotaPrefix); +} + +bool ThrottleApi::TagQuotaValue::isValid() const { + return reservedQuota <= totalQuota && reservedQuota >= 0; +} + +Value ThrottleApi::TagQuotaValue::toValue() const { + return Tuple::makeTuple(reservedQuota, totalQuota).pack(); +} + +ThrottleApi::TagQuotaValue ThrottleApi::TagQuotaValue::fromValue(ValueRef value) { + auto tuple = Tuple::unpack(value); + if (tuple.size() != 2) { + throw invalid_throttle_quota_value(); + } + TagQuotaValue result; + try { + result.reservedQuota = tuple.getInt(0); + result.totalQuota = tuple.getInt(1); + } catch (Error& e) { + TraceEvent(SevWarnAlways, "TagQuotaValueFailedToDeserialize").error(e); + throw invalid_throttle_quota_value(); + } + if (!result.isValid()) { + TraceEvent(SevWarnAlways, "TagQuotaValueInvalidQuotas") + .detail("ReservedQuota", result.reservedQuota) + .detail("TotalQuota", result.totalQuota); + throw invalid_throttle_quota_value(); + } + return result; +} TEST_CASE("TagSet/toString") { { diff --git a/src/fdbclient/TagThrottle.actor.g.cpp b/src/fdbclient/TagThrottle.actor.g.cpp index 2d401b4..66aa0b0 100644 --- a/src/fdbclient/TagThrottle.actor.g.cpp +++ b/src/fdbclient/TagThrottle.actor.g.cpp @@ -20,12 +20,16 @@ * limitations under the License. */ -#include "fdbclient/TagThrottle.actor.h" #include "fdbclient/CommitProxyInterface.h" #include "fdbclient/DatabaseContext.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/TagThrottle.actor.h" +#include "fdbclient/Tuple.h" #include "flow/actorcompiler.h" // has to be last include +double const ClientTagThrottleLimits::NO_EXPIRATION = std::numeric_limits::max(); + void TagSet::addTag(TransactionTagRef tag) { ASSERT(CLIENT_KNOBS->MAX_TRANSACTION_TAG_LENGTH < 256); // Tag length is encoded with a single byte ASSERT(CLIENT_KNOBS->MAX_TAGS_PER_TRANSACTION < 256); // Number of tags is encoded with a single byte @@ -126,70 +130,104 @@ TagThrottleValue TagThrottleValue::fromValue(const ValueRef& value) { return throttleValue; } -FDB_DEFINE_BOOLEAN_PARAM(ContainsRecommended); -FDB_DEFINE_BOOLEAN_PARAM(Capitalize); +KeyRangeRef const tagQuotaKeys = KeyRangeRef("\xff/tagQuota/"_sr, "\xff/tagQuota0"_sr); +KeyRef const tagQuotaPrefix = tagQuotaKeys.begin; + +Key ThrottleApi::getTagQuotaKey(TransactionTagRef tag) { + return tag.withPrefix(tagQuotaPrefix); +} + +bool ThrottleApi::TagQuotaValue::isValid() const { + return reservedQuota <= totalQuota && reservedQuota >= 0; +} + +Value ThrottleApi::TagQuotaValue::toValue() const { + return Tuple::makeTuple(reservedQuota, totalQuota).pack(); +} + +ThrottleApi::TagQuotaValue ThrottleApi::TagQuotaValue::fromValue(ValueRef value) { + auto tuple = Tuple::unpack(value); + if (tuple.size() != 2) { + throw invalid_throttle_quota_value(); + } + TagQuotaValue result; + try { + result.reservedQuota = tuple.getInt(0); + result.totalQuota = tuple.getInt(1); + } catch (Error& e) { + TraceEvent(SevWarnAlways, "TagQuotaValueFailedToDeserialize").error(e); + throw invalid_throttle_quota_value(); + } + if (!result.isValid()) { + TraceEvent(SevWarnAlways, "TagQuotaValueInvalidQuotas") + .detail("ReservedQuota", result.reservedQuota) + .detail("TotalQuota", result.totalQuota); + throw invalid_throttle_quota_value(); + } + return result; +} - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase130() - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" -template - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" -class FlowTestCase130ActorState { - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" +// This generated class is to be used only via flowTestCase168() + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" +template + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" +class FlowTestCase168ActorState { + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" public: - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" - FlowTestCase130ActorState(UnitTestParameters const& params) - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + FlowTestCase168ActorState(UnitTestParameters const& params) + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" : params(params) - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase130", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase168", reinterpret_cast(this)); } - ~FlowTestCase130ActorState() + ~FlowTestCase168ActorState() { - fdb_probe_actor_destroy("flowTestCase130", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase168", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { { - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" TagSet tagSet; - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" tagSet.addTag("a"_sr); - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" ASSERT(tagSet.toString() == "tag `a'"); - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" ASSERT(tagSet.toString(Capitalize::True) == "Tag `a'"); - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" } { - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" TagSet tagSet; - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" tagSet.addTag("a"_sr); - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" tagSet.addTag("b"_sr); - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" auto tagString = tagSet.toString(); - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" ASSERT(tagString == "tags (`a', `b')" || tagString == "tags (`b', `a')"); - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" auto capitalizedTagString = tagSet.toString(Capitalize::True); - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" ASSERT(capitalizedTagString == "Tags (`a', `b')" || capitalizedTagString == "Tags (`b', `a')"); - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" } - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase130ActorState(); static_cast(this)->destroy(); return 0; } - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase130ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase168ActorState(); static_cast(this)->destroy(); return 0; } + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase168ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -202,40 +240,40 @@ class FlowTestCase130ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase130ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase168ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" UnitTestParameters params; - #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase130() - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" -class FlowTestCase130Actor final : public Actor, public FastAllocated, public FlowTestCase130ActorState { - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" +// This generated class is to be used only via flowTestCase168() + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" +class FlowTestCase168Actor final : public Actor, public FastAllocated, public FlowTestCase168ActorState { + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" - FlowTestCase130Actor(UnitTestParameters const& params) - #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + FlowTestCase168Actor(UnitTestParameters const& params) + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" : Actor(), - FlowTestCase130ActorState(params) + FlowTestCase168ActorState(params) { - fdb_probe_actor_enter("flowTestCase130", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase168", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase130"); + this->lineage.setActorName("flowTestCase168"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase130", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase168", reinterpret_cast(this), -1); } void cancel() override @@ -248,12 +286,12 @@ class FlowTestCase130Actor final : public Actor, public FastAllocated flowTestCase130( UnitTestParameters const& params ) { - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" - return Future(new FlowTestCase130Actor(params)); - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" +static Future flowTestCase168( UnitTestParameters const& params ) { + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" + return Future(new FlowTestCase168Actor(params)); + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase130, "TagSet/toString") +ACTOR_TEST_CASE(flowTestCase168, "TagSet/toString") -#line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" +#line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.cpp" diff --git a/src/fdbclient/TaskBucket.actor.cpp b/src/fdbclient/TaskBucket.actor.cpp index dc3d752..203b644 100644 --- a/src/fdbclient/TaskBucket.actor.cpp +++ b/src/fdbclient/TaskBucket.actor.cpp @@ -19,14 +19,10 @@ */ #include "fdbclient/TaskBucket.h" +#include "fdbclient/FDBTypes.h" #include "fdbclient/ReadYourWrites.h" #include "flow/actorcompiler.h" // has to be last include -FDB_DEFINE_BOOLEAN_PARAM(AccessSystemKeys); -FDB_DEFINE_BOOLEAN_PARAM(PriorityBatch); -FDB_DEFINE_BOOLEAN_PARAM(VerifyTask); -FDB_DEFINE_BOOLEAN_PARAM(UpdateParams); - Reference Task::getDoneFuture(Reference fb) { return fb->unpack(params[reservedTaskParamKeyDone]); } @@ -66,7 +62,7 @@ struct UnblockFutureTaskFunc : TaskFuncBase { return Void(); } }; -StringRef UnblockFutureTaskFunc::name = LiteralStringRef("UnblockFuture"); +StringRef UnblockFutureTaskFunc::name = "UnblockFuture"_sr; REGISTER_TASKFUNC(UnblockFutureTaskFunc); struct AddTaskFunc : TaskFuncBase { @@ -88,7 +84,7 @@ struct AddTaskFunc : TaskFuncBase { return Void(); }; }; -StringRef AddTaskFunc::name = LiteralStringRef("AddTask"); +StringRef AddTaskFunc::name = "AddTask"_sr; REGISTER_TASKFUNC(AddTaskFunc); struct IdleTaskFunc : TaskFuncBase { @@ -109,18 +105,18 @@ struct IdleTaskFunc : TaskFuncBase { return tb->finish(tr, task); }; }; -StringRef IdleTaskFunc::name = LiteralStringRef("idle"); +StringRef IdleTaskFunc::name = "idle"_sr; REGISTER_TASKFUNC(IdleTaskFunc); -Key Task::reservedTaskParamKeyType = LiteralStringRef("type"); -Key Task::reservedTaskParamKeyAddTask = LiteralStringRef("_add_task"); -Key Task::reservedTaskParamKeyDone = LiteralStringRef("done"); -Key Task::reservedTaskParamKeyPriority = LiteralStringRef("priority"); -Key Task::reservedTaskParamKeyFuture = LiteralStringRef("future"); -Key Task::reservedTaskParamKeyBlockID = LiteralStringRef("blockid"); -Key Task::reservedTaskParamKeyVersion = LiteralStringRef("version"); -Key Task::reservedTaskParamValidKey = LiteralStringRef("_validkey"); -Key Task::reservedTaskParamValidValue = LiteralStringRef("_validvalue"); +Key Task::reservedTaskParamKeyType = "type"_sr; +Key Task::reservedTaskParamKeyAddTask = "_add_task"_sr; +Key Task::reservedTaskParamKeyDone = "done"_sr; +Key Task::reservedTaskParamKeyPriority = "priority"_sr; +Key Task::reservedTaskParamKeyFuture = "future"_sr; +Key Task::reservedTaskParamKeyBlockID = "blockid"_sr; +Key Task::reservedTaskParamKeyVersion = "version"_sr; +Key Task::reservedTaskParamValidKey = "_validkey"_sr; +Key Task::reservedTaskParamValidValue = "_validvalue"_sr; // IMPORTANT: Task() must result in an EMPTY parameter set, so params should only // be set for non-default constructor arguments. To change this behavior look at all @@ -170,19 +166,22 @@ class TaskBucketImpl { // Get keyspace for the specified priority level state Subspace space = taskBucket->getAvailableSpace(priority); - { // Get a task key that is <= a random UID task key, if successful then return it - Key k = wait(tr->getKey(lastLessOrEqual(space.pack(uid)), Snapshot::True)); - if (space.contains(k)) - return Optional(k); + RangeResult value = + wait(tr->getRange(KeyRangeRef(space.key(), space.pack(uid)), 1, Snapshot::True, Reverse::True)); + if (!value.empty()) { + return Optional(value[0].key); + } } { // Get a task key that is <= the maximum possible UID, if successful return it. - Key k = wait(tr->getKey(lastLessOrEqual(space.pack(maxUIDKey)), Snapshot::True)); - if (space.contains(k)) - return Optional(k); + RangeResult value = + wait(tr->getRange(KeyRangeRef(space.key(), space.pack(maxUIDKey)), 1, Snapshot::True, Reverse::True)); + if (!value.empty()) { + return Optional(value[0].key); + } } return Optional(); @@ -199,7 +198,7 @@ class TaskBucketImpl { // many other new tasks get added so that the timed out tasks never get chances to re-run if (deterministicRandom()->random01() < CLIENT_KNOBS->TASKBUCKET_CHECK_TIMEOUT_CHANCE) { bool anyTimeouts = wait(requeueTimedOutTasks(tr, taskBucket)); - TEST(anyTimeouts); // Found a task that timed out + CODE_PROBE(anyTimeouts, "Found a task that timed out"); } state std::vector>> taskKeyFutures(CLIENT_KNOBS->TASKBUCKET_MAX_PRIORITY + 1); @@ -233,7 +232,7 @@ class TaskBucketImpl { bool anyTimeouts = wait(requeueTimedOutTasks(tr, taskBucket)); // If there were timeouts, try to get a task since there should now be one in one of the available spaces. if (anyTimeouts) { - TEST(true); // Try to get one task from timeouts subspace + CODE_PROBE(true, "Try to get one task from timeouts subspace"); Reference task = wait(getOne(tr, taskBucket)); return task; } @@ -412,7 +411,7 @@ class TaskBucketImpl { Reference futureBucket, Reference task) { state Reference taskFunc; - state VerifyTask verifyTask = false; + state VerifyTask verifyTask(false); if (!task || !TaskFuncBase::isValidTask(task)) return false; @@ -579,8 +578,8 @@ class TaskBucketImpl { int maxConcurrentTasks) { state Reference> paused = makeReference>(true); state Future watchPausedFuture = watchPaused(cx, taskBucket, paused); - taskBucket->metricLogger = traceCounters( - "TaskBucketMetrics", taskBucket->dbgid, CLIENT_KNOBS->TASKBUCKET_LOGGING_DELAY, &taskBucket->cc); + taskBucket->metricLogger = taskBucket->cc.traceCounters( + "TaskBucketMetrics", taskBucket->dbgid, CLIENT_KNOBS->TASKBUCKET_LOGGING_DELAY); loop { while (paused->get()) { wait(paused->onChange() || watchPausedFuture); @@ -651,10 +650,7 @@ class TaskBucketImpl { Reference task) { taskBucket->setOptions(tr); - Tuple t; - t.append(task->timeoutVersion); - t.append(task->key); - + Tuple t = Tuple::makeTuple(task->timeoutVersion, task->key); RangeResult values = wait(tr->getRange(taskBucket->timeouts.range(t), 1)); if (values.size() > 0) return false; @@ -707,7 +703,7 @@ class TaskBucketImpl { wait(delay(CLIENT_KNOBS->TASKBUCKET_CHECK_ACTIVE_DELAY)); bool isActiveKey = wait(getActiveKey(tr, taskBucket, startingValue)); if (isActiveKey) { - TEST(true); // checkActive return true + CODE_PROBE(true, "checkActive return true"); return true; } break; @@ -717,7 +713,7 @@ class TaskBucketImpl { } } - TEST(true); // checkActive return false + CODE_PROBE(true, "checkActive return false"); return false; } @@ -725,7 +721,7 @@ class TaskBucketImpl { Reference taskBucket) { taskBucket->setOptions(tr); - Optional val = wait(tr->get(taskBucket->prefix.pack(LiteralStringRef("task_count")))); + Optional val = wait(tr->get(taskBucket->prefix.pack("task_count"_sr))); if (!val.present()) return 0; @@ -742,7 +738,7 @@ class TaskBucketImpl { // Returns True if any tasks were affected. ACTOR static Future requeueTimedOutTasks(Reference tr, Reference taskBucket) { - TEST(true); // Looks for tasks that have timed out and returns them to be available tasks. + CODE_PROBE(true, "Looks for tasks that have timed out and returns them to be available tasks."); Version end = wait(tr->getReadVersion()); state KeyRange range( KeyRangeRef(taskBucket->timeouts.get(0).range().begin, taskBucket->timeouts.get(end).range().end)); @@ -849,12 +845,12 @@ class TaskBucketImpl { // If we're updating the task params the clear the old space and write params to the new space if (updateParams) { - TEST(true); // Extended a task while updating parameters + CODE_PROBE(true, "Extended a task while updating parameters"); for (auto& p : task->params) { tr->set(newTimeoutSpace.pack(p.key), p.value); } } else { - TEST(true); // Extended a task without updating parameters + CODE_PROBE(true, "Extended a task without updating parameters"); // Otherwise, read and transplant the params from the old to new timeout spaces RangeResult params = wait(tr->getRange(oldTimeoutSpace.range(), CLIENT_KNOBS->TOO_MANY)); for (auto& kv : params) { @@ -873,13 +869,13 @@ TaskBucket::TaskBucket(const Subspace& subspace, AccessSystemKeys sysAccess, PriorityBatch priorityBatch, LockAware lockAware) - : cc("TaskBucket"), dispatchSlotChecksStarted("DispatchSlotChecksStarted", cc), dispatchErrors("DispatchErrors", cc), + : dbgid(deterministicRandom()->randomUniqueID()), cc("TaskBucket", dbgid.toString()), + dispatchSlotChecksStarted("DispatchSlotChecksStarted", cc), dispatchErrors("DispatchErrors", cc), dispatchDoTasks("DispatchDoTasks", cc), dispatchEmptyTasks("DispatchEmptyTasks", cc), - dispatchSlotChecksComplete("DispatchSlotChecksComplete", cc), dbgid(deterministicRandom()->randomUniqueID()), - prefix(subspace), active(prefix.get(LiteralStringRef("ac"))), pauseKey(prefix.pack(LiteralStringRef("pause"))), - available(prefix.get(LiteralStringRef("av"))), available_prioritized(prefix.get(LiteralStringRef("avp"))), - timeouts(prefix.get(LiteralStringRef("to"))), timeout(CLIENT_KNOBS->TASKBUCKET_TIMEOUT_VERSIONS), - system_access(sysAccess), priority_batch(priorityBatch), lockAware(lockAware) {} + dispatchSlotChecksComplete("DispatchSlotChecksComplete", cc), prefix(subspace), active(prefix.get("ac"_sr)), + pauseKey(prefix.pack("pause"_sr)), available(prefix.get("av"_sr)), available_prioritized(prefix.get("avp"_sr)), + timeouts(prefix.get("to"_sr)), timeout(CLIENT_KNOBS->TASKBUCKET_TIMEOUT_VERSIONS), system_access(sysAccess), + priority_batch(priorityBatch), lockAware(lockAware) {} TaskBucket::~TaskBucket() {} @@ -922,9 +918,7 @@ Key TaskBucket::addTask(Reference tr, Reference for (auto& param : task->params) tr->set(taskSpace.pack(param.key), param.value); - tr->atomicOp(prefix.pack(LiteralStringRef("task_count")), - LiteralStringRef("\x01\x00\x00\x00\x00\x00\x00\x00"), - MutationRef::AddValue); + tr->atomicOp(prefix.pack("task_count"_sr), "\x01\x00\x00\x00\x00\x00\x00\x00"_sr, MutationRef::AddValue); return key; } @@ -996,13 +990,9 @@ Future TaskBucket::isEmpty(Reference tr) { Future TaskBucket::finish(Reference tr, Reference task) { setOptions(tr); - Tuple t; - t.append(task->timeoutVersion); - t.append(task->key); + Tuple t = Tuple::makeTuple(task->timeoutVersion, task->key); - tr->atomicOp(prefix.pack(LiteralStringRef("task_count")), - LiteralStringRef("\xff\xff\xff\xff\xff\xff\xff\xff"), - MutationRef::AddValue); + tr->atomicOp(prefix.pack("task_count"_sr), "\xff\xff\xff\xff\xff\xff\xff\xff"_sr, MutationRef::AddValue); tr->clear(timeouts.range(t)); return Void(); @@ -1033,7 +1023,7 @@ Future TaskBucket::getTaskCount(Reference tr } Future TaskBucket::watchTaskCount(Reference tr) { - return tr->watch(prefix.pack(LiteralStringRef("task_count"))); + return tr->watch(prefix.pack("task_count"_sr)); } Future TaskBucket::debugPrintRange(Reference tr, Subspace subspace, Key msg) { @@ -1108,7 +1098,7 @@ class TaskFutureImpl { Key key = StringRef(deterministicRandom()->randomUniqueID().toString()); taskFuture->addBlock(tr, key); auto task = makeReference(); - task->params[Task::reservedTaskParamKeyType] = LiteralStringRef("UnblockFuture"); + task->params[Task::reservedTaskParamKeyType] = "UnblockFuture"_sr; task->params[Task::reservedTaskParamKeyFuture] = taskFuture->key; task->params[Task::reservedTaskParamKeyBlockID] = key; onSetFutures.push_back(vectorFuture[i]->onSet(tr, taskBucket, task)); @@ -1138,10 +1128,10 @@ class TaskFutureImpl { bool is_set = wait(isSet(tr, taskFuture)); if (is_set) { - TEST(true); // is_set == true + CODE_PROBE(true, "is_set == true"); wait(performAction(tr, taskBucket, taskFuture, task)); } else { - TEST(true); // is_set == false + CODE_PROBE(true, "is_set == false"); Subspace callbackSpace = taskFuture->callbacks.get(StringRef(deterministicRandom()->randomUniqueID().toString())); for (auto& v : task->params) { @@ -1222,7 +1212,7 @@ class TaskFutureImpl { taskFuture->futureBucket->setOptions(tr); task->params[Task::reservedTaskParamKeyAddTask] = task->params[Task::reservedTaskParamKeyType]; - task->params[Task::reservedTaskParamKeyType] = LiteralStringRef("AddTask"); + task->params[Task::reservedTaskParamKeyType] = "AddTask"_sr; wait(onSet(tr, taskBucket, taskFuture, task)); return Void(); @@ -1287,14 +1277,14 @@ TaskFuture::TaskFuture(const Reference bucket, Key k) : futureBuck } prefix = futureBucket->prefix.get(key); - blocks = prefix.get(LiteralStringRef("bl")); - callbacks = prefix.get(LiteralStringRef("cb")); + blocks = prefix.get("bl"_sr); + callbacks = prefix.get("cb"_sr); } TaskFuture::~TaskFuture() {} void TaskFuture::addBlock(Reference tr, StringRef block_id) { - tr->set(blocks.pack(block_id), LiteralStringRef("")); + tr->set(blocks.pack(block_id), ""_sr); } Future TaskFuture::set(Reference tr, Reference taskBucket) { diff --git a/src/fdbclient/TaskBucket.actor.g.cpp b/src/fdbclient/TaskBucket.actor.g.cpp index 66fc28f..240a97a 100644 --- a/src/fdbclient/TaskBucket.actor.g.cpp +++ b/src/fdbclient/TaskBucket.actor.g.cpp @@ -21,14 +21,10 @@ */ #include "fdbclient/TaskBucket.h" +#include "fdbclient/FDBTypes.h" #include "fdbclient/ReadYourWrites.h" #include "flow/actorcompiler.h" // has to be last include -FDB_DEFINE_BOOLEAN_PARAM(AccessSystemKeys); -FDB_DEFINE_BOOLEAN_PARAM(PriorityBatch); -FDB_DEFINE_BOOLEAN_PARAM(VerifyTask); -FDB_DEFINE_BOOLEAN_PARAM(UpdateParams); - Reference Task::getDoneFuture(Reference fb) { return fb->unpack(params[reservedTaskParamKeyDone]); } @@ -50,28 +46,28 @@ struct UnblockFutureTaskFunc : TaskFuncBase { return _finish(tr, tb, fb, task); }; - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via _finish() - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class _finishActorState { - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" _finishActorState(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" futureBucket(futureBucket), - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task(task), - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" future(futureBucket->unpack(task->params[Task::reservedTaskParamKeyFuture])) - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("_finish", reinterpret_cast(this)); @@ -84,20 +80,20 @@ class _finishActorState { int a_body1(int loopDepth=0) { try { - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" futureBucket->setOptions(tr); - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->clear(future->blocks.pack(task->params[Task::reservedTaskParamKeyBlockID])); - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = future->isSet(tr); - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast<_finishActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_finishActor*>(this)->actor_wait_state = 1; - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_finishActor*>(this))); - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -118,20 +114,20 @@ class _finishActorState { } int a_body1cont1(bool const& is_set,int loopDepth) { - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (is_set) - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = future->performAllActions(tr, taskBucket); - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast<_finishActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor*>(this)->actor_wait_state = 2; - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor*>(this))); - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -143,20 +139,20 @@ class _finishActorState { } int a_body1cont1(bool && is_set,int loopDepth) { - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (is_set) - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = future->performAllActions(tr, taskBucket); - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast<_finishActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast<_finishActor*>(this)->actor_wait_state = 2; - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_finishActor*>(this))); - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -231,9 +227,9 @@ class _finishActorState { } int a_body1cont2(int loopDepth) { - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast<_finishActor*>(this)->SAV::futures) { (void)(Void()); this->~_finishActorState(); static_cast<_finishActor*>(this)->destroy(); return 0; } - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast<_finishActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_finishActorState(); static_cast<_finishActor*>(this)->finishSendAndDelPromiseRef(); @@ -316,22 +312,22 @@ class _finishActorState { fdb_probe_actor_exit("_finish", reinterpret_cast(this), 1); } - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference futureBucket; - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference future; - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via _finish() - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class _finishActor final : public Actor, public ActorCallback< _finishActor, 0, bool >, public ActorCallback< _finishActor, 1, Void >, public FastAllocated<_finishActor>, public _finishActorState<_finishActor> { - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated<_finishActor>::operator new; using FastAllocated<_finishActor>::operator delete; @@ -341,9 +337,9 @@ class _finishActor final : public Actor, public ActorCallback< _finishActo #pragma clang diagnostic pop friend struct ActorCallback< _finishActor, 0, bool >; friend struct ActorCallback< _finishActor, 1, Void >; - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" _finishActor(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), _finishActorState<_finishActor>(tr, taskBucket, futureBucket, task) { @@ -367,16 +363,16 @@ friend struct ActorCallback< _finishActor, 1, Void >; } }; - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future _finish( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new _finishActor(tr, taskBucket, futureBucket, task)); - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" }; -StringRef UnblockFutureTaskFunc::name = LiteralStringRef("UnblockFuture"); +StringRef UnblockFutureTaskFunc::name = "UnblockFuture"_sr; REGISTER_TASKFUNC(UnblockFutureTaskFunc); struct AddTaskFunc : TaskFuncBase { @@ -398,7 +394,7 @@ struct AddTaskFunc : TaskFuncBase { return Void(); }; }; -StringRef AddTaskFunc::name = LiteralStringRef("AddTask"); +StringRef AddTaskFunc::name = "AddTask"_sr; REGISTER_TASKFUNC(AddTaskFunc); struct IdleTaskFunc : TaskFuncBase { @@ -419,18 +415,18 @@ struct IdleTaskFunc : TaskFuncBase { return tb->finish(tr, task); }; }; -StringRef IdleTaskFunc::name = LiteralStringRef("idle"); +StringRef IdleTaskFunc::name = "idle"_sr; REGISTER_TASKFUNC(IdleTaskFunc); -Key Task::reservedTaskParamKeyType = LiteralStringRef("type"); -Key Task::reservedTaskParamKeyAddTask = LiteralStringRef("_add_task"); -Key Task::reservedTaskParamKeyDone = LiteralStringRef("done"); -Key Task::reservedTaskParamKeyPriority = LiteralStringRef("priority"); -Key Task::reservedTaskParamKeyFuture = LiteralStringRef("future"); -Key Task::reservedTaskParamKeyBlockID = LiteralStringRef("blockid"); -Key Task::reservedTaskParamKeyVersion = LiteralStringRef("version"); -Key Task::reservedTaskParamValidKey = LiteralStringRef("_validkey"); -Key Task::reservedTaskParamValidValue = LiteralStringRef("_validvalue"); +Key Task::reservedTaskParamKeyType = "type"_sr; +Key Task::reservedTaskParamKeyAddTask = "_add_task"_sr; +Key Task::reservedTaskParamKeyDone = "done"_sr; +Key Task::reservedTaskParamKeyPriority = "priority"_sr; +Key Task::reservedTaskParamKeyFuture = "future"_sr; +Key Task::reservedTaskParamKeyBlockID = "blockid"_sr; +Key Task::reservedTaskParamKeyVersion = "version"_sr; +Key Task::reservedTaskParamValidKey = "_validkey"_sr; +Key Task::reservedTaskParamValidValue = "_validvalue"_sr; // IMPORTANT: Task() must result in an EMPTY parameter set, so params should only // be set for non-default constructor arguments. To change this behavior look at all @@ -473,24 +469,24 @@ unsigned int Task::getPriority() const { class TaskBucketImpl { public: - #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via getTaskKey() - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class GetTaskKeyActorState { - #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" GetTaskKeyActorState(Reference const& tr,Reference const& taskBucket,int const& priority = 0) - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" priority(priority) - #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("getTaskKey", reinterpret_cast(this)); @@ -503,22 +499,22 @@ class GetTaskKeyActorState { int a_body1(int loopDepth=0) { try { - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Standalone uid = StringRef(deterministicRandom()->randomUniqueID().toString()); - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" space = taskBucket->getAvailableSpace(priority); - #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - StrictFuture __when_expr_0 = tr->getKey(lastLessOrEqual(space.pack(uid)), Snapshot::True); - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + StrictFuture __when_expr_0 = tr->getRange(KeyRangeRef(space.key(), space.pack(uid)), 1, Snapshot::True, Reverse::True); + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } } @@ -541,31 +537,31 @@ class GetTaskKeyActorState { int a_body1cont1(int loopDepth) { { - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - StrictFuture __when_expr_1 = tr->getKey(lastLessOrEqual(space.pack(maxUIDKey)), Snapshot::True); - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + StrictFuture __when_expr_1 = tr->getRange(KeyRangeRef(space.key(), space.pack(maxUIDKey)), 1, Snapshot::True, Reverse::True); + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } return loopDepth; } - int a_body1cont2(Key const& k,int loopDepth) + int a_body1cont2(RangeResult const& value,int loopDepth) { - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - if (space.contains(k)) - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + if (!value.empty()) + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(Optional(k)); this->~GetTaskKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(k)); + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(Optional(value[0].key)); this->~GetTaskKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(value[0].key)); this->~GetTaskKeyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -574,16 +570,16 @@ class GetTaskKeyActorState { return loopDepth; } - int a_body1cont2(Key && k,int loopDepth) + int a_body1cont2(RangeResult && value,int loopDepth) { - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - if (space.contains(k)) - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + if (!value.empty()) + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(Optional(k)); this->~GetTaskKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(k)); + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(Optional(value[0].key)); this->~GetTaskKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(value[0].key)); this->~GetTaskKeyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -592,25 +588,25 @@ class GetTaskKeyActorState { return loopDepth; } - int a_body1when1(Key const& k,int loopDepth) + int a_body1when1(RangeResult const& value,int loopDepth) { - loopDepth = a_body1cont2(k, loopDepth); + loopDepth = a_body1cont2(value, loopDepth); return loopDepth; } - int a_body1when1(Key && k,int loopDepth) + int a_body1when1(RangeResult && value,int loopDepth) { - loopDepth = a_body1cont2(std::move(k), loopDepth); + loopDepth = a_body1cont2(std::move(value), loopDepth); return loopDepth; } void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetTaskKeyActor, 0, Key >::remove(); + static_cast(this)->ActorCallback< GetTaskKeyActor, 0, RangeResult >::remove(); } - void a_callback_fire(ActorCallback< GetTaskKeyActor, 0, Key >*,Key const& value) + void a_callback_fire(ActorCallback< GetTaskKeyActor, 0, RangeResult >*,RangeResult const& value) { fdb_probe_actor_enter("getTaskKey", reinterpret_cast(this), 0); a_exitChoose1(); @@ -625,7 +621,7 @@ class GetTaskKeyActorState { fdb_probe_actor_exit("getTaskKey", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetTaskKeyActor, 0, Key >*,Key && value) + void a_callback_fire(ActorCallback< GetTaskKeyActor, 0, RangeResult >*,RangeResult && value) { fdb_probe_actor_enter("getTaskKey", reinterpret_cast(this), 0); a_exitChoose1(); @@ -640,7 +636,7 @@ class GetTaskKeyActorState { fdb_probe_actor_exit("getTaskKey", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetTaskKeyActor, 0, Key >*,Error err) + void a_callback_error(ActorCallback< GetTaskKeyActor, 0, RangeResult >*,Error err) { fdb_probe_actor_enter("getTaskKey", reinterpret_cast(this), 0); a_exitChoose1(); @@ -657,9 +653,9 @@ class GetTaskKeyActorState { } int a_body1cont5(int loopDepth) { - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GetTaskKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~GetTaskKeyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -667,16 +663,16 @@ class GetTaskKeyActorState { return loopDepth; } - int a_body1cont6(Key const& k,int loopDepth) + int a_body1cont6(RangeResult const& value,int loopDepth) { - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - if (space.contains(k)) - #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + if (!value.empty()) + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(Optional(k)); this->~GetTaskKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(k)); + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(Optional(value[0].key)); this->~GetTaskKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(value[0].key)); this->~GetTaskKeyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -685,16 +681,16 @@ class GetTaskKeyActorState { return loopDepth; } - int a_body1cont6(Key && k,int loopDepth) + int a_body1cont6(RangeResult && value,int loopDepth) { - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - if (space.contains(k)) - #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + if (!value.empty()) + #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(Optional(k)); this->~GetTaskKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" - new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(k)); + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(Optional(value[0].key)); this->~GetTaskKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional(value[0].key)); this->~GetTaskKeyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -703,25 +699,25 @@ class GetTaskKeyActorState { return loopDepth; } - int a_body1cont1when1(Key const& k,int loopDepth) + int a_body1cont1when1(RangeResult const& value,int loopDepth) { - loopDepth = a_body1cont6(k, loopDepth); + loopDepth = a_body1cont6(value, loopDepth); return loopDepth; } - int a_body1cont1when1(Key && k,int loopDepth) + int a_body1cont1when1(RangeResult && value,int loopDepth) { - loopDepth = a_body1cont6(std::move(k), loopDepth); + loopDepth = a_body1cont6(std::move(value), loopDepth); return loopDepth; } void a_exitChoose2() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetTaskKeyActor, 1, Key >::remove(); + static_cast(this)->ActorCallback< GetTaskKeyActor, 1, RangeResult >::remove(); } - void a_callback_fire(ActorCallback< GetTaskKeyActor, 1, Key >*,Key const& value) + void a_callback_fire(ActorCallback< GetTaskKeyActor, 1, RangeResult >*,RangeResult const& value) { fdb_probe_actor_enter("getTaskKey", reinterpret_cast(this), 1); a_exitChoose2(); @@ -736,7 +732,7 @@ class GetTaskKeyActorState { fdb_probe_actor_exit("getTaskKey", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< GetTaskKeyActor, 1, Key >*,Key && value) + void a_callback_fire(ActorCallback< GetTaskKeyActor, 1, RangeResult >*,RangeResult && value) { fdb_probe_actor_enter("getTaskKey", reinterpret_cast(this), 1); a_exitChoose2(); @@ -751,7 +747,7 @@ class GetTaskKeyActorState { fdb_probe_actor_exit("getTaskKey", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< GetTaskKeyActor, 1, Key >*,Error err) + void a_callback_error(ActorCallback< GetTaskKeyActor, 1, RangeResult >*,Error err) { fdb_probe_actor_enter("getTaskKey", reinterpret_cast(this), 1); a_exitChoose2(); @@ -766,20 +762,20 @@ class GetTaskKeyActorState { fdb_probe_actor_exit("getTaskKey", reinterpret_cast(this), 1); } - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" int priority; - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Subspace space; - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via getTaskKey() - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" -class GetTaskKeyActor final : public Actor>, public ActorCallback< GetTaskKeyActor, 0, Key >, public ActorCallback< GetTaskKeyActor, 1, Key >, public FastAllocated, public GetTaskKeyActorState { - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +class GetTaskKeyActor final : public Actor>, public ActorCallback< GetTaskKeyActor, 0, RangeResult >, public ActorCallback< GetTaskKeyActor, 1, RangeResult >, public FastAllocated, public GetTaskKeyActorState { + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -787,11 +783,11 @@ class GetTaskKeyActor final : public Actor>, public ActorCallback< #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetTaskKeyActor, 0, Key >; -friend struct ActorCallback< GetTaskKeyActor, 1, Key >; - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +friend struct ActorCallback< GetTaskKeyActor, 0, RangeResult >; +friend struct ActorCallback< GetTaskKeyActor, 1, RangeResult >; + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" GetTaskKeyActor(Reference const& tr,Reference const& taskBucket,int const& priority = 0) - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor>(), GetTaskKeyActorState(tr, taskBucket, priority) { @@ -809,37 +805,37 @@ friend struct ActorCallback< GetTaskKeyActor, 1, Key >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetTaskKeyActor, 0, Key >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetTaskKeyActor, 1, Key >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetTaskKeyActor, 0, RangeResult >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetTaskKeyActor, 1, RangeResult >*)0, actor_cancelled()); break; } } }; - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future> getTaskKey( Reference const& tr, Reference const& taskBucket, int const& priority = 0 ) { - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future>(new GetTaskKeyActor(tr, taskBucket, priority)); - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via getOne() - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class GetOneActorState { - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" GetOneActorState(Reference const& tr,Reference const& taskBucket) - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket) - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("getOne", reinterpret_cast(this)); @@ -852,30 +848,30 @@ class GetOneActorState { int a_body1(int loopDepth=0) { try { - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (taskBucket->priority_batch) - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->setOption(FDBTransactionOptions::PRIORITY_BATCH); - #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket->setOptions(tr); - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (deterministicRandom()->random01() < CLIENT_KNOBS->TASKBUCKET_CHECK_TIMEOUT_CHANCE) - #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = requeueTimedOutTasks(tr, taskBucket); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -901,41 +897,41 @@ class GetOneActorState { } int a_body1cont1(int loopDepth) { - #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskKeyFutures = std::vector>>(CLIENT_KNOBS->TASKBUCKET_MAX_PRIORITY + 1); - #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" pri = int(); - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for(pri = CLIENT_KNOBS->TASKBUCKET_MAX_PRIORITY;pri >= 0;--pri) { - #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskKeyFutures[pri] = getTaskKey(tr, taskBucket, pri); - #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskKey = Optional(); - #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" availableSpace = Subspace(); - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" pri = CLIENT_KNOBS->TASKBUCKET_MAX_PRIORITY; - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont3(bool const& anyTimeouts,int loopDepth) { - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(anyTimeouts); - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(anyTimeouts, "Found a task that timed out"); + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } int a_body1cont3(bool && anyTimeouts,int loopDepth) { - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(anyTimeouts); - #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(anyTimeouts, "Found a task that timed out"); + #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -1005,20 +1001,20 @@ class GetOneActorState { } int a_body1cont5(int loopDepth) { - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!taskKey.present()) - #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_2 = requeueTimedOutTasks(tr, taskBucket); - #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont5when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -1037,33 +1033,33 @@ class GetOneActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!(pri >= 0)) - #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (taskKey.present()) - #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskKeyFutures[pri].cancel(); - #line 1052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont1(loopDepth); } else { - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture> __when_expr_1 = taskKeyFutures[pri]; - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } @@ -1084,24 +1080,24 @@ class GetOneActorState { } int a_body1cont1loopBody1cont1(int loopDepth) { - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" --pri; - #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; } int a_body1cont1loopBody1cont4(Optional const& key,int loopDepth) { - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (key.present()) - #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskKey = key; - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" availableSpace = taskBucket->getAvailableSpace(pri); - #line 1104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } loopDepth = a_body1cont1loopBody1cont1(loopDepth); @@ -1109,15 +1105,15 @@ class GetOneActorState { } int a_body1cont1loopBody1cont4(Optional && key,int loopDepth) { - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (key.present()) - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskKey = key; - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" availableSpace = taskBucket->getAvailableSpace(pri); - #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } loopDepth = a_body1cont1loopBody1cont1(loopDepth); @@ -1188,48 +1184,48 @@ class GetOneActorState { } int a_body1cont7(int loopDepth) { - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" t = availableSpace.unpack(taskKey.get()); - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskUID = t.getString(0); - #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskAvailableSpace = availableSpace.get(taskUID); - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task = Reference(new Task()); - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->key = taskUID; - #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_4 = tr->getRange(taskAvailableSpace.range(), CLIENT_KNOBS->TOO_MANY); - #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont7when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont8(bool const& anyTimeouts,int loopDepth) { - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (anyTimeouts) - #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(true, "Try to get one task from timeouts subspace"); #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(true); - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture> __when_expr_3 = getOne(tr, taskBucket); - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont8when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -1241,22 +1237,22 @@ class GetOneActorState { } int a_body1cont8(bool && anyTimeouts,int loopDepth) { - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (anyTimeouts) - #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(true, "Try to get one task from timeouts subspace"); #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(true); - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture> __when_expr_3 = getOne(tr, taskBucket); - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont8when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -1331,9 +1327,9 @@ class GetOneActorState { } int a_body1cont9(int loopDepth) { - #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Reference()); this->~GetOneActorState(); static_cast(this)->destroy(); return 0; } - #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(Reference()); this->~GetOneActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1343,9 +1339,9 @@ class GetOneActorState { } int a_body1cont10(Reference const& task,int loopDepth) { - #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(task); this->~GetOneActorState(); static_cast(this)->destroy(); return 0; } - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(task); this->~GetOneActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1355,9 +1351,9 @@ class GetOneActorState { } int a_body1cont10(Reference && task,int loopDepth) { - #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(task); this->~GetOneActorState(); static_cast(this)->destroy(); return 0; } - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(task); this->~GetOneActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1430,25 +1426,25 @@ class GetOneActorState { } int a_body1cont12(int loopDepth) { - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_5 = tr->getReadVersion(); - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont12when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont7when1(RangeResult const& __values,int loopDepth) { - #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" values = __values; - #line 1451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont12(loopDepth); return loopDepth; @@ -1513,27 +1509,27 @@ class GetOneActorState { } int a_body1cont12cont1(Version const& version,int loopDepth) { - #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->timeoutVersion = version + (uint64_t)(taskBucket->timeout * (CLIENT_KNOBS->TASKBUCKET_TIMEOUT_JITTER_OFFSET + CLIENT_KNOBS->TASKBUCKET_TIMEOUT_JITTER_RANGE * deterministicRandom()->random01())); - #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Subspace timeoutSpace = taskBucket->timeouts.get(task->timeoutVersion).get(taskUID); - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& s : values ) { - #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key param = taskAvailableSpace.unpack(s.key).getString(0); - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->params[param] = s.value; - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->set(timeoutSpace.pack(param), s.value); - #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->clear(taskAvailableSpace.range()); - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->set(taskBucket->active.key(), deterministicRandom()->randomUniqueID().toString()); - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(task); this->~GetOneActorState(); static_cast(this)->destroy(); return 0; } - #line 1536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(task)); // state_var_RVO this->~GetOneActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1543,27 +1539,27 @@ class GetOneActorState { } int a_body1cont12cont1(Version && version,int loopDepth) { - #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->timeoutVersion = version + (uint64_t)(taskBucket->timeout * (CLIENT_KNOBS->TASKBUCKET_TIMEOUT_JITTER_OFFSET + CLIENT_KNOBS->TASKBUCKET_TIMEOUT_JITTER_RANGE * deterministicRandom()->random01())); - #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Subspace timeoutSpace = taskBucket->timeouts.get(task->timeoutVersion).get(taskUID); - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& s : values ) { - #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key param = taskAvailableSpace.unpack(s.key).getString(0); - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->params[param] = s.value; - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->set(timeoutSpace.pack(param), s.value); - #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->clear(taskAvailableSpace.range()); - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->set(taskBucket->active.key(), deterministicRandom()->randomUniqueID().toString()); - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(task); this->~GetOneActorState(); static_cast(this)->destroy(); return 0; } - #line 1566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(task)); // state_var_RVO this->~GetOneActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1634,34 +1630,34 @@ class GetOneActorState { fdb_probe_actor_exit("getOne", reinterpret_cast(this), 5); } - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" std::vector>> taskKeyFutures; - #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" int pri; - #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Optional taskKey; - #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Subspace availableSpace; - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Tuple t; - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key taskUID; - #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Subspace taskAvailableSpace; - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" RangeResult values; - #line 1659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via getOne() - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class GetOneActor final : public Actor>, public ActorCallback< GetOneActor, 0, bool >, public ActorCallback< GetOneActor, 1, Optional >, public ActorCallback< GetOneActor, 2, bool >, public ActorCallback< GetOneActor, 3, Reference >, public ActorCallback< GetOneActor, 4, RangeResult >, public ActorCallback< GetOneActor, 5, Version >, public FastAllocated, public GetOneActorState { - #line 1664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1675,9 +1671,9 @@ friend struct ActorCallback< GetOneActor, 2, bool >; friend struct ActorCallback< GetOneActor, 3, Reference >; friend struct ActorCallback< GetOneActor, 4, RangeResult >; friend struct ActorCallback< GetOneActor, 5, Version >; - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" GetOneActor(Reference const& tr,Reference const& taskBucket) - #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor>(), GetOneActorState(tr, taskBucket) { @@ -1705,34 +1701,34 @@ friend struct ActorCallback< GetOneActor, 5, Version >; } }; - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future> getOne( Reference const& tr, Reference const& taskBucket ) { - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future>(new GetOneActor(tr, taskBucket)); - #line 1712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" // Verify that the user configured task verification key still has the user specified value - #line 1718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via taskVerify() - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class TaskVerifyActorState { - #line 1724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TaskVerifyActorState(Reference const& tb,Reference const& tr,Reference const& task) - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tb(tb), - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr(tr), - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task(task) - #line 1735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("taskVerify", reinterpret_cast(this)); @@ -1745,46 +1741,46 @@ class TaskVerifyActorState { int a_body1(int loopDepth=0) { try { - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (task->params.find(Task::reservedTaskParamValidKey) == task->params.end()) - #line 1750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent("TaskBucketTaskVerifyInvalidTask") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("ReservedTaskParamValidKey", "missing"); - #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~TaskVerifyActorState(); static_cast(this)->destroy(); return 0; } - #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~TaskVerifyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (task->params.find(Task::reservedTaskParamValidValue) == task->params.end()) - #line 1764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent("TaskBucketTaskVerifyInvalidTask") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("ReservedTaskParamValidKey", task->params[Task::reservedTaskParamValidKey]) .detail("ReservedTaskParamValidValue", "missing"); - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~TaskVerifyActorState(); static_cast(this)->destroy(); return 0; } - #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~TaskVerifyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tb->setOptions(tr); - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture> __when_expr_0 = tr->get(task->params[Task::reservedTaskParamValidKey]); - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1805,37 +1801,37 @@ class TaskVerifyActorState { } int a_body1cont1(Optional const& keyValue,int loopDepth) { - #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!keyValue.present()) - #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent("TaskBucketTaskVerifyInvalidTask") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("ReservedTaskParamValidKey", task->params[Task::reservedTaskParamValidKey]) .detail("ReservedTaskParamValidValue", task->params[Task::reservedTaskParamValidValue]) .detail("KeyValue", "missing"); - #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~TaskVerifyActorState(); static_cast(this)->destroy(); return 0; } - #line 1816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~TaskVerifyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (keyValue.get().compare(StringRef(task->params[Task::reservedTaskParamValidValue]))) - #line 1824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent("TaskBucketTaskVerifyAbortedTask") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("ReservedTaskParamValidKey", task->params[Task::reservedTaskParamValidKey]) .detail("ReservedTaskParamValidValue", task->params[Task::reservedTaskParamValidValue]) .detail("KeyValue", keyValue.get()); - #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~TaskVerifyActorState(); static_cast(this)->destroy(); return 0; } - #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~TaskVerifyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~TaskVerifyActorState(); static_cast(this)->destroy(); return 0; } - #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~TaskVerifyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1845,37 +1841,37 @@ class TaskVerifyActorState { } int a_body1cont1(Optional && keyValue,int loopDepth) { - #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!keyValue.present()) - #line 1850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent("TaskBucketTaskVerifyInvalidTask") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("ReservedTaskParamValidKey", task->params[Task::reservedTaskParamValidKey]) .detail("ReservedTaskParamValidValue", task->params[Task::reservedTaskParamValidValue]) .detail("KeyValue", "missing"); - #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~TaskVerifyActorState(); static_cast(this)->destroy(); return 0; } - #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~TaskVerifyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (keyValue.get().compare(StringRef(task->params[Task::reservedTaskParamValidValue]))) - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent("TaskBucketTaskVerifyAbortedTask") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("ReservedTaskParamValidKey", task->params[Task::reservedTaskParamValidKey]) .detail("ReservedTaskParamValidValue", task->params[Task::reservedTaskParamValidValue]) .detail("KeyValue", keyValue.get()); - #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~TaskVerifyActorState(); static_cast(this)->destroy(); return 0; } - #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~TaskVerifyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~TaskVerifyActorState(); static_cast(this)->destroy(); return 0; } - #line 1878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~TaskVerifyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1946,18 +1942,18 @@ class TaskVerifyActorState { fdb_probe_actor_exit("taskVerify", reinterpret_cast(this), 0); } - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tb; - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 1955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via taskVerify() - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class TaskVerifyActor final : public Actor, public ActorCallback< TaskVerifyActor, 0, Optional >, public FastAllocated, public TaskVerifyActorState { - #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1966,9 +1962,9 @@ class TaskVerifyActor final : public Actor, public ActorCallback< TaskVeri void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< TaskVerifyActor, 0, Optional >; - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TaskVerifyActor(Reference const& tb,Reference const& tr,Reference const& task) - #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), TaskVerifyActorState(tb, tr, task) { @@ -1991,33 +1987,33 @@ friend struct ActorCallback< TaskVerifyActor, 0, Optional >; } }; - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future taskVerify( Reference const& tb, Reference const& tr, Reference const& task ) { - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new TaskVerifyActor(tb, tr, task)); - #line 1998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 1999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via taskVerify() - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class TaskVerifyActor1State { - #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TaskVerifyActor1State(Reference const& tb,Database const& cx,Reference const& task) - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tb(tb), - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" cx(cx), - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task(task) - #line 2020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("taskVerify", reinterpret_cast(this)); @@ -2030,9 +2026,9 @@ class TaskVerifyActor1State { int a_body1(int loopDepth=0) { try { - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ; - #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2060,20 +2056,20 @@ class TaskVerifyActor1State { } int a_body1loopBody1(int loopDepth) { - #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" try { - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = taskVerify(tb, tr, task); - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2093,16 +2089,16 @@ class TaskVerifyActor1State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = tr->onError(e); - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2115,9 +2111,9 @@ class TaskVerifyActor1State { } int a_body1loopBody1cont2(bool const& verified,int loopDepth) { - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(verified); this->~TaskVerifyActor1State(); static_cast(this)->destroy(); return 0; } - #line 2120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(verified); this->~TaskVerifyActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2127,9 +2123,9 @@ class TaskVerifyActor1State { } int a_body1loopBody1cont2(bool && verified,int loopDepth) { - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(verified); this->~TaskVerifyActor1State(); static_cast(this)->destroy(); return 0; } - #line 2132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(verified); this->~TaskVerifyActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2275,20 +2271,20 @@ class TaskVerifyActor1State { fdb_probe_actor_exit("taskVerify", reinterpret_cast(this), 1); } - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tb; - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Database cx; - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 2286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via taskVerify() - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class TaskVerifyActor1 final : public Actor, public ActorCallback< TaskVerifyActor1, 0, bool >, public ActorCallback< TaskVerifyActor1, 1, Void >, public FastAllocated, public TaskVerifyActor1State { - #line 2291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2298,9 +2294,9 @@ class TaskVerifyActor1 final : public Actor, public ActorCallback< TaskVer #pragma clang diagnostic pop friend struct ActorCallback< TaskVerifyActor1, 0, bool >; friend struct ActorCallback< TaskVerifyActor1, 1, Void >; - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TaskVerifyActor1(Reference const& tb,Database const& cx,Reference const& task) - #line 2303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), TaskVerifyActor1State(tb, cx, task) { @@ -2324,39 +2320,39 @@ friend struct ActorCallback< TaskVerifyActor1, 1, Void >; } }; - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future taskVerify( Reference const& tb, Database const& cx, Reference const& task ) { - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new TaskVerifyActor1(tb, cx, task)); - #line 2331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 2336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via finishTaskRun() - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class FinishTaskRunActorState { - #line 2342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" FinishTaskRunActorState(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task,Reference const& taskFunc,VerifyTask const& verifyTask) - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" futureBucket(futureBucket), - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task(task), - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFunc(taskFunc), - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" verifyTask(verifyTask) - #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("finishTaskRun", reinterpret_cast(this)); @@ -2369,16 +2365,16 @@ class FinishTaskRunActorState { int a_body1(int loopDepth=0) { try { - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = taskBucket->isFinished(tr, task); - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2399,34 +2395,34 @@ class FinishTaskRunActorState { } int a_body1cont1(bool const& isFinished,int loopDepth) { - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (isFinished) - #line 2404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FinishTaskRunActorState(); static_cast(this)->destroy(); return 0; } - #line 2408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~FinishTaskRunActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" validTask = true; - #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (verifyTask) - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = taskVerify(taskBucket, tr, task); - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -2438,34 +2434,34 @@ class FinishTaskRunActorState { } int a_body1cont1(bool && isFinished,int loopDepth) { - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (isFinished) - #line 2443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FinishTaskRunActorState(); static_cast(this)->destroy(); return 0; } - #line 2447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~FinishTaskRunActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" validTask = true; - #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (verifyTask) - #line 2457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = taskVerify(taskBucket, tr, task); - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -2540,34 +2536,34 @@ class FinishTaskRunActorState { } int a_body1cont2(int loopDepth) { - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!validTask) - #line 2545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_2 = taskBucket->finish(tr, task); - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else { - #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_3 = taskFunc->finish(tr, taskBucket, futureBucket, task); - #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont2when2(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } @@ -2575,18 +2571,18 @@ class FinishTaskRunActorState { } int a_body1cont4(bool const& _validTask,int loopDepth) { - #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" validTask = _validTask; - #line 2580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; } int a_body1cont4(bool && _validTask,int loopDepth) { - #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" validTask = _validTask; - #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -2656,9 +2652,9 @@ class FinishTaskRunActorState { } int a_body1cont6(int loopDepth) { - #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FinishTaskRunActorState(); static_cast(this)->destroy(); return 0; } - #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~FinishTaskRunActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2816,26 +2812,26 @@ class FinishTaskRunActorState { fdb_probe_actor_exit("finishTaskRun", reinterpret_cast(this), 3); } - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference futureBucket; - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskFunc; - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" VerifyTask verifyTask; - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" bool validTask; - #line 2833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via finishTaskRun() - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class FinishTaskRunActor final : public Actor, public ActorCallback< FinishTaskRunActor, 0, bool >, public ActorCallback< FinishTaskRunActor, 1, bool >, public ActorCallback< FinishTaskRunActor, 2, Void >, public ActorCallback< FinishTaskRunActor, 3, Void >, public FastAllocated, public FinishTaskRunActorState { - #line 2838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2847,9 +2843,9 @@ friend struct ActorCallback< FinishTaskRunActor, 0, bool >; friend struct ActorCallback< FinishTaskRunActor, 1, bool >; friend struct ActorCallback< FinishTaskRunActor, 2, Void >; friend struct ActorCallback< FinishTaskRunActor, 3, Void >; - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" FinishTaskRunActor(Reference const& tr,Reference const& taskBucket,Reference const& futureBucket,Reference const& task,Reference const& taskFunc,VerifyTask const& verifyTask) - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), FinishTaskRunActorState(tr, taskBucket, futureBucket, task, taskFunc, verifyTask) { @@ -2875,33 +2871,33 @@ friend struct ActorCallback< FinishTaskRunActor, 3, Void >; } }; - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future finishTaskRun( Reference const& tr, Reference const& taskBucket, Reference const& futureBucket, Reference const& task, Reference const& taskFunc, VerifyTask const& verifyTask ) { - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new FinishTaskRunActor(tr, taskBucket, futureBucket, task, taskFunc, verifyTask)); - #line 2882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 2887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via doOne() - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class DoOneActorState { - #line 2893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" DoOneActorState(Database const& cx,Reference const& taskBucket,Reference const& futureBucket) - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : cx(cx), - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" futureBucket(futureBucket) - #line 2904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("doOne", reinterpret_cast(this)); @@ -2914,16 +2910,16 @@ class DoOneActorState { int a_body1(int loopDepth=0) { try { - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture> __when_expr_0 = taskBucket->getOne(cx); - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2944,25 +2940,25 @@ class DoOneActorState { } int a_body1cont1(int loopDepth) { - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = taskBucket->doTask(cx, futureBucket, task); - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(Reference const& __task,int loopDepth) { - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task = __task; - #line 2965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -3027,9 +3023,9 @@ class DoOneActorState { } int a_body1cont2(bool const& result,int loopDepth) { - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~DoOneActorState(); static_cast(this)->destroy(); return 0; } - #line 3032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(result); this->~DoOneActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3039,9 +3035,9 @@ class DoOneActorState { } int a_body1cont2(bool && result,int loopDepth) { - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(result); this->~DoOneActorState(); static_cast(this)->destroy(); return 0; } - #line 3044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(result); this->~DoOneActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3112,20 +3108,20 @@ class DoOneActorState { fdb_probe_actor_exit("doOne", reinterpret_cast(this), 1); } - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Database cx; - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference futureBucket; - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 3123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via doOne() - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class DoOneActor final : public Actor, public ActorCallback< DoOneActor, 0, Reference >, public ActorCallback< DoOneActor, 1, bool >, public FastAllocated, public DoOneActorState { - #line 3128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3135,9 +3131,9 @@ class DoOneActor final : public Actor, public ActorCallback< DoOneActor, 0 #pragma clang diagnostic pop friend struct ActorCallback< DoOneActor, 0, Reference >; friend struct ActorCallback< DoOneActor, 1, bool >; - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" DoOneActor(Database const& cx,Reference const& taskBucket,Reference const& futureBucket) - #line 3140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), DoOneActorState(cx, taskBucket, futureBucket) { @@ -3161,37 +3157,37 @@ friend struct ActorCallback< DoOneActor, 1, bool >; } }; - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future doOne( Database const& cx, Reference const& taskBucket, Reference const& futureBucket ) { - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new DoOneActor(cx, taskBucket, futureBucket)); - #line 3168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 3173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via extendTimeoutRepeatedly() - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class ExtendTimeoutRepeatedlyActorState { - #line 3179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ExtendTimeoutRepeatedlyActorState(Database const& cx,Reference const& taskBucket,Reference const& task) - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : cx(cx), - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task(task), - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr(new ReadYourWritesTransaction(cx)), - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" start(now()) - #line 3194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("extendTimeoutRepeatedly", reinterpret_cast(this)); @@ -3204,16 +3200,16 @@ class ExtendTimeoutRepeatedlyActorState { int a_body1(int loopDepth=0) { try { - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = runRYWTransaction(cx, [=](Reference tr) { taskBucket->setOptions(tr); return map(tr->getReadVersion(), [=](Version v) { return v; }); }); - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3234,18 +3230,18 @@ class ExtendTimeoutRepeatedlyActorState { } int a_body1cont1(int loopDepth) { - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ; - #line 3239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1when1(Version const& __versionNow,int loopDepth) { - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" versionNow = __versionNow; - #line 3248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -3317,66 +3313,66 @@ class ExtendTimeoutRepeatedlyActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" releaser = FlowLock::Releaser(); - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = delay(0.8 * (BUGGIFY ? (2 * deterministicRandom()->random01()) : 1.0) * (double)(task->timeoutVersion - (uint64_t)versionNow) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND); - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont1(Void const& _,int loopDepth) { - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (now() - start > 300) - #line 3340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent(SevWarnAlways, "TaskBucketLongExtend") .detail("Duration", now() - start) .detail("TaskUID", task->key) .detail("TaskType", task->params[Task::reservedTaskParamKeyType]) .detail("Priority", task->getPriority()); - #line 3344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_2 = task->extendMutex.take(); - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont1(Void && _,int loopDepth) { - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (now() - start > 300) - #line 3364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent(SevWarnAlways, "TaskBucketLongExtend") .detail("Duration", now() - start) .detail("TaskUID", task->key) .detail("TaskType", task->params[Task::reservedTaskParamKeyType]) .detail("Priority", task->getPriority()); - #line 3368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_2 = task->extendMutex.take(); - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3446,22 +3442,22 @@ class ExtendTimeoutRepeatedlyActorState { } int a_body1cont1loopBody1cont2(Void const& _,int loopDepth) { - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" releaser = FlowLock::Releaser(task->extendMutex, 1); - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ; - #line 3453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont2loopHead1(loopDepth); return loopDepth; } int a_body1cont1loopBody1cont2(Void && _,int loopDepth) { - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" releaser = FlowLock::Releaser(task->extendMutex, 1); - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ; - #line 3464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont2loopHead1(loopDepth); return loopDepth; @@ -3545,20 +3541,20 @@ class ExtendTimeoutRepeatedlyActorState { int a_body1cont1loopBody1cont2loopBody1(int loopDepth) { try { - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->reset(); - #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket->setOptions(tr); - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_3 = taskBucket->extendTimeout(tr, task, UpdateParams::False); - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1cont2loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont2loopBody1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3591,16 +3587,16 @@ class ExtendTimeoutRepeatedlyActorState { int a_body1cont1loopBody1cont2loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_5 = tr->onError(e); - #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 3598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 2)); else return a_body1cont1loopBody1cont2loopBody1Catch1when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3613,25 +3609,25 @@ class ExtendTimeoutRepeatedlyActorState { } int a_body1cont1loopBody1cont2loopBody1cont2(int loopDepth) { - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_4 = tr->commit(); - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont2loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont1loopBody1cont2loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont1loopBody1cont2loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1cont2loopBody1when1(Version const& __newTimeout,int loopDepth) { - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" newTimeout = __newTimeout; - #line 3634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont1loopBody1cont2loopBody1cont2(loopDepth); return loopDepth; @@ -3696,22 +3692,22 @@ class ExtendTimeoutRepeatedlyActorState { } int a_body1cont1loopBody1cont2loopBody1cont3(Void const& _,int loopDepth) { - #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->timeoutVersion = newTimeout; - #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" versionNow = tr->getCommittedVersion(); - #line 3703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" return a_body1cont1loopBody1cont2break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1cont1loopBody1cont2loopBody1cont3(Void && _,int loopDepth) { - #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->timeoutVersion = newTimeout; - #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" versionNow = tr->getCommittedVersion(); - #line 3714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" return a_body1cont1loopBody1cont2break1(loopDepth==0?0:loopDepth-1); // break return loopDepth; @@ -3854,28 +3850,28 @@ class ExtendTimeoutRepeatedlyActorState { fdb_probe_actor_exit("extendTimeoutRepeatedly", reinterpret_cast(this), 5); } - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Database cx; - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" double start; - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Version versionNow; - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" FlowLock::Releaser releaser; - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Version newTimeout; - #line 3873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via extendTimeoutRepeatedly() - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class ExtendTimeoutRepeatedlyActor final : public Actor, public ActorCallback< ExtendTimeoutRepeatedlyActor, 0, Version >, public ActorCallback< ExtendTimeoutRepeatedlyActor, 1, Void >, public ActorCallback< ExtendTimeoutRepeatedlyActor, 2, Void >, public ActorCallback< ExtendTimeoutRepeatedlyActor, 3, Version >, public ActorCallback< ExtendTimeoutRepeatedlyActor, 4, Void >, public ActorCallback< ExtendTimeoutRepeatedlyActor, 5, Void >, public FastAllocated, public ExtendTimeoutRepeatedlyActorState { - #line 3878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3889,9 +3885,9 @@ friend struct ActorCallback< ExtendTimeoutRepeatedlyActor, 2, Void >; friend struct ActorCallback< ExtendTimeoutRepeatedlyActor, 3, Version >; friend struct ActorCallback< ExtendTimeoutRepeatedlyActor, 4, Void >; friend struct ActorCallback< ExtendTimeoutRepeatedlyActor, 5, Void >; - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ExtendTimeoutRepeatedlyActor(Database const& cx,Reference const& taskBucket,Reference const& task) - #line 3894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), ExtendTimeoutRepeatedlyActorState(cx, taskBucket, task) { @@ -3919,39 +3915,39 @@ friend struct ActorCallback< ExtendTimeoutRepeatedlyActor, 5, Void >; } }; - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future extendTimeoutRepeatedly( Database const& cx, Reference const& taskBucket, Reference const& task ) { - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new ExtendTimeoutRepeatedlyActor(cx, taskBucket, task)); - #line 3926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 3931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via doTask() - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class DoTaskActorState { - #line 3937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" DoTaskActorState(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : cx(cx), - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" futureBucket(futureBucket), - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task(task), - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFunc(), - #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" verifyTask(false) - #line 3954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("doTask", reinterpret_cast(this)); @@ -3964,34 +3960,34 @@ class DoTaskActorState { int a_body1(int loopDepth=0) { try { - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!task || !TaskFuncBase::isValidTask(task)) - #line 3969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~DoTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 3973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~DoTaskActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } try { - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFunc = TaskFuncBase::create(task->params[Task::reservedTaskParamKeyType]); - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (taskFunc) - #line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" verifyTask.set(task->params.find(Task::reservedTaskParamValidKey) != task->params.end()); - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (verifyTask) - #line 3990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ; - #line 3994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 3990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } else @@ -4028,9 +4024,9 @@ class DoTaskActorState { } int a_body1cont1(int loopDepth) { - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~DoTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 4033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~DoTaskActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4041,20 +4037,20 @@ class DoTaskActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent(SevWarn, "TaskBucketExecuteFailure") .error(e) .detail("TaskUID", task->key) .detail("TaskType", task->params[Task::reservedTaskParamKeyType].printable()) .detail("Priority", task->getPriority()); - #line 4046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" try { - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_8 = taskFunc->handleError(cx, task, e); - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2Catch1(actor_cancelled(), loopDepth); - #line 4052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch2Catch1(__when_expr_8.getError(), loopDepth); else return a_body1Catch2when1(__when_expr_8.get(), loopDepth); }; static_cast(this)->actor_wait_state = 9; - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4079,16 +4075,16 @@ class DoTaskActorState { } int a_body1cont4(int loopDepth) { - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_5 = taskFunc->execute(cx, taskBucket, futureBucket, task) || extendTimeoutRepeatedly(cx, taskBucket, task); - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 4086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch2(__when_expr_5.getError(), loopDepth); else return a_body1cont4when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4108,22 +4104,22 @@ class DoTaskActorState { } int a_body1loopBody1(int loopDepth) { - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket->setOptions(tr); - #line 4115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" try { - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = taskVerify(taskBucket, tr, task); - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4156,16 +4152,16 @@ class DoTaskActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_4 = tr->onError(e); - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch2(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4178,20 +4174,20 @@ class DoTaskActorState { } int a_body1loopBody1cont2(bool const& validTask,int loopDepth) { - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!validTask) - #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = taskBucket->isFinished(tr, task); - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -4203,20 +4199,20 @@ class DoTaskActorState { } int a_body1loopBody1cont2(bool && validTask,int loopDepth) { - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!validTask) - #line 4208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = taskBucket->isFinished(tr, task); - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -4297,20 +4293,20 @@ class DoTaskActorState { } int a_body1loopBody1cont4(bool const& isFinished,int loopDepth) { - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!isFinished) - #line 4302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_2 = taskBucket->finish(tr, task); - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -4322,20 +4318,20 @@ class DoTaskActorState { } int a_body1loopBody1cont4(bool && isFinished,int loopDepth) { - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!isFinished) - #line 4327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_2 = taskBucket->finish(tr, task); - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -4410,16 +4406,16 @@ class DoTaskActorState { } int a_body1loopBody1cont5(int loopDepth) { - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_3 = tr->commit(); - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4501,9 +4497,9 @@ class DoTaskActorState { } int a_body1loopBody1cont7(Void const& _,int loopDepth) { - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~DoTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 4506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~DoTaskActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4513,9 +4509,9 @@ class DoTaskActorState { } int a_body1loopBody1cont7(Void && _,int loopDepth) { - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~DoTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 4518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~DoTaskActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4663,20 +4659,20 @@ class DoTaskActorState { } int a_body1cont6(Void const& _,int loopDepth) { - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (BUGGIFY) - #line 4668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_6 = delay(10.0); - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 4674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch2(__when_expr_6.getError(), loopDepth); else return a_body1cont6when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -4688,20 +4684,20 @@ class DoTaskActorState { } int a_body1cont6(Void && _,int loopDepth) { - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (BUGGIFY) - #line 4693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_6 = delay(10.0); - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 4699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch2(__when_expr_6.getError(), loopDepth); else return a_body1cont6when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -4776,16 +4772,16 @@ class DoTaskActorState { } int a_body1cont7(int loopDepth) { - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_7 = runRYWTransaction(cx, [=](Reference tr) { return finishTaskRun(tr, taskBucket, futureBucket, task, taskFunc, verifyTask); }); - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch2(__when_expr_7.getError(), loopDepth); else return a_body1cont7when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4962,9 +4958,9 @@ class DoTaskActorState { int a_body1Catch2Catch1(const Error& e,int loopDepth=0) { try { - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent(SevWarn, "TaskBucketExecuteFailureLogErrorFailed") .error(e) .detail("TaskUID", task->key.printable()) .detail("TaskType", task->params[Task::reservedTaskParamKeyType].printable()) .detail("Priority", task->getPriority()); - #line 4967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 4963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1Catch2cont1(loopDepth); } catch (Error& error) { @@ -5063,26 +5059,26 @@ class DoTaskActorState { return loopDepth; } - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Database cx; - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference futureBucket; - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskFunc; - #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" VerifyTask verifyTask; - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 5080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via doTask() - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class DoTaskActor final : public Actor, public ActorCallback< DoTaskActor, 0, bool >, public ActorCallback< DoTaskActor, 1, bool >, public ActorCallback< DoTaskActor, 2, Void >, public ActorCallback< DoTaskActor, 3, Void >, public ActorCallback< DoTaskActor, 4, Void >, public ActorCallback< DoTaskActor, 5, Void >, public ActorCallback< DoTaskActor, 6, Void >, public ActorCallback< DoTaskActor, 7, Void >, public ActorCallback< DoTaskActor, 8, Void >, public FastAllocated, public DoTaskActorState { - #line 5085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5099,9 +5095,9 @@ friend struct ActorCallback< DoTaskActor, 5, Void >; friend struct ActorCallback< DoTaskActor, 6, Void >; friend struct ActorCallback< DoTaskActor, 7, Void >; friend struct ActorCallback< DoTaskActor, 8, Void >; - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" DoTaskActor(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,Reference const& task) - #line 5104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), DoTaskActorState(cx, taskBucket, futureBucket, task) { @@ -5132,39 +5128,39 @@ friend struct ActorCallback< DoTaskActor, 8, Void >; } }; - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future doTask( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, Reference const& task ) { - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new DoTaskActor(cx, taskBucket, futureBucket, task)); - #line 5139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 5144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via dispatch() - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class DispatchActorState { - #line 5150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" DispatchActorState(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,std::shared_ptr const& pollDelay,int const& maxConcurrentTasks) - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : cx(cx), - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" futureBucket(futureBucket), - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" pollDelay(pollDelay), - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" maxConcurrentTasks(maxConcurrentTasks), - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tasks(maxConcurrentTasks) - #line 5167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("dispatch", reinterpret_cast(this)); @@ -5177,29 +5173,29 @@ class DispatchActorState { int a_body1(int loopDepth=0) { try { - #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& f : tasks ) { - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" f = Never(); - #line 5184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" availableSlots = std::vector(); - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" availableSlots.reserve(tasks.size()); - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for(int i = 0;i < tasks.size();++i) { - #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" availableSlots.push_back(i); - #line 5194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" getTasks = std::vector>>(); - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" getBatchSize = 1; - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ; - #line 5202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -5227,47 +5223,47 @@ class DispatchActorState { } int a_body1loopBody1(int loopDepth) { - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ++taskBucket->dispatchSlotChecksStarted; - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ; - #line 5234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1loopBody1loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1cont1(int loopDepth) { - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ++taskBucket->dispatchSlotChecksComplete; - #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Future w = ready(waitForAny(tasks)); - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!availableSlots.empty()) - #line 5247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (*pollDelay > 600) - #line 5251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent(SevWarnAlways, "TaskBucketLongPollDelay").suppressFor(1.0).detail("Delay", *pollDelay); - #line 5255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" w = w || delay(*pollDelay * (0.9 + deterministicRandom()->random01() / 5)); - #line 5259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = w; - #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -5281,30 +5277,30 @@ class DispatchActorState { } int a_body1loopBody1loopBody1(int loopDepth) { - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!(!availableSlots.empty())) - #line 5286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" getTasks.clear(); - #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for(int i = 0, imax = std::min(getBatchSize, availableSlots.size());i < imax;++i) { - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" getTasks.push_back(taskBucket->getOne(cx)); - #line 5296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = waitForAllReady(getTasks); - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 5302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -5324,60 +5320,60 @@ class DispatchActorState { } int a_body1loopBody1loopBody1cont1(Void const& _,int loopDepth) { - #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" bool done = false; - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for(int i = 0;i < getTasks.size();++i) { - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (getTasks[i].isError()) - #line 5333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ++taskBucket->dispatchErrors; - #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" done = true; - #line 5339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" continue; } - #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task = getTasks[i].get(); - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (task) - #line 5346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ++taskBucket->dispatchDoTasks; - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" int slot = availableSlots.back(); - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" availableSlots.pop_back(); - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tasks[slot] = taskBucket->doTask(cx, futureBucket, task); - #line 5356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } else { - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ++taskBucket->dispatchEmptyTasks; - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" done = true; - #line 5364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } } - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (done) - #line 5369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" getBatchSize = 1; - #line 5373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } else { - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" getBatchSize = std::min(getBatchSize * 2, maxConcurrentTasks); - #line 5380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } if (loopDepth == 0) return a_body1loopBody1loopHead1(0); @@ -5385,60 +5381,60 @@ class DispatchActorState { } int a_body1loopBody1loopBody1cont1(Void && _,int loopDepth) { - #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" bool done = false; - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for(int i = 0;i < getTasks.size();++i) { - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (getTasks[i].isError()) - #line 5394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ++taskBucket->dispatchErrors; - #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" done = true; - #line 5400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" continue; } - #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task = getTasks[i].get(); - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (task) - #line 5407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ++taskBucket->dispatchDoTasks; - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" int slot = availableSlots.back(); - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" availableSlots.pop_back(); - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tasks[slot] = taskBucket->doTask(cx, futureBucket, task); - #line 5417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } else { - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ++taskBucket->dispatchEmptyTasks; - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" done = true; - #line 5425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } } - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (done) - #line 5430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" getBatchSize = 1; - #line 5434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } else { - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" getBatchSize = std::min(getBatchSize * 2, maxConcurrentTasks); - #line 5441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } if (loopDepth == 0) return a_body1loopBody1loopHead1(0); @@ -5509,17 +5505,17 @@ class DispatchActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for(int i = 0;i < tasks.size();++i) { - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (tasks[i].isReady()) - #line 5516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" availableSlots.push_back(i); - #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tasks[i] = Never(); - #line 5522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } } if (loopDepth == 0) return a_body1loopHead1(0); @@ -5528,17 +5524,17 @@ class DispatchActorState { } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for(int i = 0;i < tasks.size();++i) { - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (tasks[i].isReady()) - #line 5535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" availableSlots.push_back(i); - #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tasks[i] = Never(); - #line 5541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } } if (loopDepth == 0) return a_body1loopHead1(0); @@ -5608,30 +5604,30 @@ class DispatchActorState { fdb_probe_actor_exit("dispatch", reinterpret_cast(this), 1); } - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Database cx; - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference futureBucket; - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" std::shared_ptr pollDelay; - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" int maxConcurrentTasks; - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" std::vector> tasks; - #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" std::vector availableSlots; - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" std::vector>> getTasks; - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" unsigned int getBatchSize; - #line 5629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via dispatch() - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class DispatchActor final : public Actor, public ActorCallback< DispatchActor, 0, Void >, public ActorCallback< DispatchActor, 1, Void >, public FastAllocated, public DispatchActorState { - #line 5634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5641,9 +5637,9 @@ class DispatchActor final : public Actor, public ActorCallback< DispatchAc #pragma clang diagnostic pop friend struct ActorCallback< DispatchActor, 0, Void >; friend struct ActorCallback< DispatchActor, 1, Void >; - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" DispatchActor(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,std::shared_ptr const& pollDelay,int const& maxConcurrentTasks) - #line 5646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), DispatchActorState(cx, taskBucket, futureBucket, pollDelay, maxConcurrentTasks) { @@ -5667,33 +5663,33 @@ friend struct ActorCallback< DispatchActor, 1, Void >; } }; - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future dispatch( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, std::shared_ptr const& pollDelay, int const& maxConcurrentTasks ) { - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new DispatchActor(cx, taskBucket, futureBucket, pollDelay, maxConcurrentTasks)); - #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 5679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via watchPaused() - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class WatchPausedActorState { - #line 5685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" WatchPausedActorState(Database const& cx,Reference const& taskBucket,Reference> const& paused) - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : cx(cx), - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" paused(paused) - #line 5696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("watchPaused", reinterpret_cast(this)); @@ -5706,9 +5702,9 @@ class WatchPausedActorState { int a_body1(int loopDepth=0) { try { - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ; - #line 5711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -5736,22 +5732,22 @@ class WatchPausedActorState { } int a_body1loopBody1(int loopDepth) { - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 5741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" try { - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket->setOptions(tr); - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture> __when_expr_0 = tr->get(taskBucket->pauseKey); - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 5749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5771,16 +5767,16 @@ class WatchPausedActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_3 = tr->onError(e); - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5793,40 +5789,40 @@ class WatchPausedActorState { } int a_body1loopBody1cont2(Optional const& pausedVal,int loopDepth) { - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" paused->set(pausedVal.present()); - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" watchPausedFuture = tr->watch(taskBucket->pauseKey); - #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = tr->commit(); - #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 5804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Optional && pausedVal,int loopDepth) { - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" paused->set(pausedVal.present()); - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" watchPausedFuture = tr->watch(taskBucket->pauseKey); - #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = tr->commit(); - #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 5824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -5896,32 +5892,32 @@ class WatchPausedActorState { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_2 = watchPausedFuture; - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 5903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_2 = watchPausedFuture; - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 5919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 5920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -6152,22 +6148,22 @@ class WatchPausedActorState { fdb_probe_actor_exit("watchPaused", reinterpret_cast(this), 3); } - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Database cx; - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference> paused; - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Future watchPausedFuture; - #line 6165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via watchPaused() - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class WatchPausedActor final : public Actor, public ActorCallback< WatchPausedActor, 0, Optional >, public ActorCallback< WatchPausedActor, 1, Void >, public ActorCallback< WatchPausedActor, 2, Void >, public ActorCallback< WatchPausedActor, 3, Void >, public FastAllocated, public WatchPausedActorState { - #line 6170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6179,9 +6175,9 @@ friend struct ActorCallback< WatchPausedActor, 0, Optional >; friend struct ActorCallback< WatchPausedActor, 1, Void >; friend struct ActorCallback< WatchPausedActor, 2, Void >; friend struct ActorCallback< WatchPausedActor, 3, Void >; - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" WatchPausedActor(Database const& cx,Reference const& taskBucket,Reference> const& paused) - #line 6184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), WatchPausedActorState(cx, taskBucket, paused) { @@ -6207,41 +6203,41 @@ friend struct ActorCallback< WatchPausedActor, 3, Void >; } }; - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future watchPaused( Database const& cx, Reference const& taskBucket, Reference> const& paused ) { - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new WatchPausedActor(cx, taskBucket, paused)); - #line 6214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 6219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via run() - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class RunActorState { - #line 6225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" RunActorState(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,std::shared_ptr const& pollDelay,int const& maxConcurrentTasks) - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : cx(cx), - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" futureBucket(futureBucket), - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" pollDelay(pollDelay), - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" maxConcurrentTasks(maxConcurrentTasks), - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" paused(makeReference>(true)), - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" watchPausedFuture(watchPaused(cx, taskBucket, paused)) - #line 6244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("run", reinterpret_cast(this)); @@ -6254,11 +6250,11 @@ class RunActorState { int a_body1(int loopDepth=0) { try { - #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - taskBucket->metricLogger = traceCounters( "TaskBucketMetrics", taskBucket->dbgid, CLIENT_KNOBS->TASKBUCKET_LOGGING_DELAY, &taskBucket->cc); - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + taskBucket->metricLogger = taskBucket->cc.traceCounters( "TaskBucketMetrics", taskBucket->dbgid, CLIENT_KNOBS->TASKBUCKET_LOGGING_DELAY); + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ; - #line 6261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -6286,25 +6282,25 @@ class RunActorState { } int a_body1loopBody1(int loopDepth) { - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ; - #line 6291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1loopBody1loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1cont1(int loopDepth) { - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = dispatch(cx, taskBucket, futureBucket, pollDelay, maxConcurrentTasks) || paused->onChange() || watchPausedFuture; - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -6318,22 +6314,22 @@ class RunActorState { } int a_body1loopBody1loopBody1(int loopDepth) { - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!(paused->get())) - #line 6323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = paused->onChange() || watchPausedFuture; - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 6331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -6501,26 +6497,26 @@ class RunActorState { fdb_probe_actor_exit("run", reinterpret_cast(this), 1); } - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Database cx; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference futureBucket; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" std::shared_ptr pollDelay; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" int maxConcurrentTasks; - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference> paused; - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Future watchPausedFuture; - #line 6518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via run() - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class RunActor final : public Actor, public ActorCallback< RunActor, 0, Void >, public ActorCallback< RunActor, 1, Void >, public FastAllocated, public RunActorState { - #line 6523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6530,9 +6526,9 @@ class RunActor final : public Actor, public ActorCallback< RunActor, 0, Vo #pragma clang diagnostic pop friend struct ActorCallback< RunActor, 0, Void >; friend struct ActorCallback< RunActor, 1, Void >; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" RunActor(Database const& cx,Reference const& taskBucket,Reference const& futureBucket,std::shared_ptr const& pollDelay,int const& maxConcurrentTasks) - #line 6535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), RunActorState(cx, taskBucket, futureBucket, pollDelay, maxConcurrentTasks) { @@ -6556,14 +6552,14 @@ friend struct ActorCallback< RunActor, 1, Void >; } }; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future run( Database const& cx, Reference const& taskBucket, Reference const& futureBucket, std::shared_ptr const& pollDelay, int const& maxConcurrentTasks ) { - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new RunActor(cx, taskBucket, futureBucket, pollDelay, maxConcurrentTasks)); - #line 6563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" static Future> addIdle(Reference tr, Reference taskBucket) { @@ -6577,22 +6573,22 @@ friend struct ActorCallback< RunActor, 1, Void >; return runRYWTransaction(cx, [=](Reference tr) { return addIdle(tr, taskBucket); }); } - #line 6580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via isEmpty() - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class IsEmptyActorState { - #line 6586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" IsEmptyActorState(Reference const& tr,Reference const& taskBucket) - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket) - #line 6595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("isEmpty", reinterpret_cast(this)); @@ -6605,21 +6601,21 @@ class IsEmptyActorState { int a_body1(int loopDepth=0) { try { - #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket->setOptions(tr); - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" resultFutures = std::vector>(); - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for(int pri = 0;pri <= CLIENT_KNOBS->TASKBUCKET_MAX_PRIORITY;++pri) { - #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" resultFutures.push_back(tr->getRange(taskBucket->getAvailableSpace(pri).range(), 1)); - #line 6616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" i = int(); - #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" i = 0; - #line 6622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -6640,16 +6636,16 @@ class IsEmptyActorState { } int a_body1cont1(int loopDepth) { - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = tr->getRange(taskBucket->timeouts.range(), 1); - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -6663,22 +6659,22 @@ class IsEmptyActorState { } int a_body1loopBody1(int loopDepth) { - #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!(i < resultFutures.size())) - #line 6668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = resultFutures[i]; - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -6698,42 +6694,42 @@ class IsEmptyActorState { } int a_body1loopBody1cont1(RangeResult const& results,int loopDepth) { - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (results.size() > 0) - #line 6703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsEmptyActorState(); static_cast(this)->destroy(); return 0; } - #line 6707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsEmptyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ++i; - #line 6715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(RangeResult && results,int loopDepth) { - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (results.size() > 0) - #line 6724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsEmptyActorState(); static_cast(this)->destroy(); return 0; } - #line 6728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsEmptyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ++i; - #line 6736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -6803,21 +6799,21 @@ class IsEmptyActorState { } int a_body1cont3(RangeResult const& values,int loopDepth) { - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (values.size() > 0) - #line 6808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsEmptyActorState(); static_cast(this)->destroy(); return 0; } - #line 6812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsEmptyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~IsEmptyActorState(); static_cast(this)->destroy(); return 0; } - #line 6820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~IsEmptyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6827,21 +6823,21 @@ class IsEmptyActorState { } int a_body1cont3(RangeResult && values,int loopDepth) { - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (values.size() > 0) - #line 6832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsEmptyActorState(); static_cast(this)->destroy(); return 0; } - #line 6836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsEmptyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~IsEmptyActorState(); static_cast(this)->destroy(); return 0; } - #line 6844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~IsEmptyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6912,20 +6908,20 @@ class IsEmptyActorState { fdb_probe_actor_exit("isEmpty", reinterpret_cast(this), 1); } - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" std::vector> resultFutures; - #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" int i; - #line 6923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via isEmpty() - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class IsEmptyActor final : public Actor, public ActorCallback< IsEmptyActor, 0, RangeResult >, public ActorCallback< IsEmptyActor, 1, RangeResult >, public FastAllocated, public IsEmptyActorState { - #line 6928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6935,9 +6931,9 @@ class IsEmptyActor final : public Actor, public ActorCallback< IsEmptyActo #pragma clang diagnostic pop friend struct ActorCallback< IsEmptyActor, 0, RangeResult >; friend struct ActorCallback< IsEmptyActor, 1, RangeResult >; - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" IsEmptyActor(Reference const& tr,Reference const& taskBucket) - #line 6940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), IsEmptyActorState(tr, taskBucket) { @@ -6961,31 +6957,31 @@ friend struct ActorCallback< IsEmptyActor, 1, RangeResult >; } }; - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future isEmpty( Reference const& tr, Reference const& taskBucket ) { - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new IsEmptyActor(tr, taskBucket)); - #line 6968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 6973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via isBusy() - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class IsBusyActorState { - #line 6979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" IsBusyActorState(Reference const& tr,Reference const& taskBucket) - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket) - #line 6988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 6984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("isBusy", reinterpret_cast(this)); @@ -6998,21 +6994,21 @@ class IsBusyActorState { int a_body1(int loopDepth=0) { try { - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket->setOptions(tr); - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" resultFutures = std::vector>(); - #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for(int pri = 0;pri <= CLIENT_KNOBS->TASKBUCKET_MAX_PRIORITY;++pri) { - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" resultFutures.push_back(tr->getRange(taskBucket->getAvailableSpace(pri).range(), 1)); - #line 7009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" i = int(); - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" i = 0; - #line 7015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -7033,9 +7029,9 @@ class IsBusyActorState { } int a_body1cont1(int loopDepth) { - #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsBusyActorState(); static_cast(this)->destroy(); return 0; } - #line 7038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsBusyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7052,22 +7048,22 @@ class IsBusyActorState { } int a_body1loopBody1(int loopDepth) { - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!(i < resultFutures.size())) - #line 7057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = resultFutures[i]; - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 7065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -7087,42 +7083,42 @@ class IsBusyActorState { } int a_body1loopBody1cont1(RangeResult const& results,int loopDepth) { - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (results.size() > 0) - #line 7092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~IsBusyActorState(); static_cast(this)->destroy(); return 0; } - #line 7096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~IsBusyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ++i; - #line 7104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(RangeResult && results,int loopDepth) { - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (results.size() > 0) - #line 7113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~IsBusyActorState(); static_cast(this)->destroy(); return 0; } - #line 7117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~IsBusyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ++i; - #line 7125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -7190,20 +7186,20 @@ class IsBusyActorState { fdb_probe_actor_exit("isBusy", reinterpret_cast(this), 0); } - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" std::vector> resultFutures; - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" int i; - #line 7201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via isBusy() - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class IsBusyActor final : public Actor, public ActorCallback< IsBusyActor, 0, RangeResult >, public FastAllocated, public IsBusyActorState { - #line 7206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7212,9 +7208,9 @@ class IsBusyActor final : public Actor, public ActorCallback< IsBusyActor, void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< IsBusyActor, 0, RangeResult >; - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" IsBusyActor(Reference const& tr,Reference const& taskBucket) - #line 7217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), IsBusyActorState(tr, taskBucket) { @@ -7237,34 +7233,34 @@ friend struct ActorCallback< IsBusyActor, 0, RangeResult >; } }; - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future isBusy( Reference const& tr, Reference const& taskBucket ) { - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new IsBusyActor(tr, taskBucket)); - #line 7244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" // Verify that the task's keys are still in the timeout space at the expected timeout prefix - #line 7250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via isFinished() - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class IsFinishedActorState { - #line 7256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" IsFinishedActorState(Reference const& tr,Reference const& taskBucket,Reference const& task) - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task(task) - #line 7267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("isFinished", reinterpret_cast(this)); @@ -7277,24 +7273,20 @@ class IsFinishedActorState { int a_body1(int loopDepth=0) { try { - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket->setOptions(tr); + #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + Tuple t = Tuple::makeTuple(task->timeoutVersion, task->key); #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - Tuple t; - #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - t.append(task->timeoutVersion); - #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - t.append(task->key); - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = tr->getRange(taskBucket->timeouts.range(t), 1); - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7315,21 +7307,21 @@ class IsFinishedActorState { } int a_body1cont1(RangeResult const& values,int loopDepth) { - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (values.size() > 0) - #line 7320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsFinishedActorState(); static_cast(this)->destroy(); return 0; } - #line 7324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsFinishedActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~IsFinishedActorState(); static_cast(this)->destroy(); return 0; } - #line 7332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~IsFinishedActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7339,21 +7331,21 @@ class IsFinishedActorState { } int a_body1cont1(RangeResult && values,int loopDepth) { - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (values.size() > 0) - #line 7344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsFinishedActorState(); static_cast(this)->destroy(); return 0; } - #line 7348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsFinishedActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~IsFinishedActorState(); static_cast(this)->destroy(); return 0; } - #line 7356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~IsFinishedActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7424,18 +7416,18 @@ class IsFinishedActorState { fdb_probe_actor_exit("isFinished", reinterpret_cast(this), 0); } - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 7433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via isFinished() - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class IsFinishedActor final : public Actor, public ActorCallback< IsFinishedActor, 0, RangeResult >, public FastAllocated, public IsFinishedActorState { - #line 7438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7444,9 +7436,9 @@ class IsFinishedActor final : public Actor, public ActorCallback< IsFinish void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< IsFinishedActor, 0, RangeResult >; - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" IsFinishedActor(Reference const& tr,Reference const& taskBucket,Reference const& task) - #line 7449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), IsFinishedActorState(tr, taskBucket, task) { @@ -7469,33 +7461,33 @@ friend struct ActorCallback< IsFinishedActor, 0, RangeResult >; } }; - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future isFinished( Reference const& tr, Reference const& taskBucket, Reference const& task ) { - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new IsFinishedActor(tr, taskBucket, task)); - #line 7476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 7481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via getActiveKey() - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class GetActiveKeyActorState { - #line 7487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" GetActiveKeyActorState(Reference const& tr,Reference const& taskBucket,Optional const& startingValue) - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" startingValue(startingValue) - #line 7498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("getActiveKey", reinterpret_cast(this)); @@ -7508,18 +7500,18 @@ class GetActiveKeyActorState { int a_body1(int loopDepth=0) { try { - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket->setOptions(tr); - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture> __when_expr_0 = tr->get(taskBucket->active.key()); - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 7522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7540,21 +7532,21 @@ class GetActiveKeyActorState { } int a_body1cont1(Optional const& new_value,int loopDepth) { - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (new_value != startingValue) - #line 7545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~GetActiveKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 7549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~GetActiveKeyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~GetActiveKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 7557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~GetActiveKeyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7564,21 +7556,21 @@ class GetActiveKeyActorState { } int a_body1cont1(Optional && new_value,int loopDepth) { - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (new_value != startingValue) - #line 7569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~GetActiveKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 7573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~GetActiveKeyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~GetActiveKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 7581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~GetActiveKeyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -7649,18 +7641,18 @@ class GetActiveKeyActorState { fdb_probe_actor_exit("getActiveKey", reinterpret_cast(this), 0); } - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Optional startingValue; - #line 7658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via getActiveKey() - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class GetActiveKeyActor final : public Actor, public ActorCallback< GetActiveKeyActor, 0, Optional >, public FastAllocated, public GetActiveKeyActorState { - #line 7663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -7669,9 +7661,9 @@ class GetActiveKeyActor final : public Actor, public ActorCallback< GetAct void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetActiveKeyActor, 0, Optional >; - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" GetActiveKeyActor(Reference const& tr,Reference const& taskBucket,Optional const& startingValue) - #line 7674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), GetActiveKeyActorState(tr, taskBucket, startingValue) { @@ -7694,35 +7686,35 @@ friend struct ActorCallback< GetActiveKeyActor, 0, Optional >; } }; - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future getActiveKey( Reference const& tr, Reference const& taskBucket, Optional const& startingValue ) { - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new GetActiveKeyActor(tr, taskBucket, startingValue)); - #line 7701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 7706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via checkActive() - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class CheckActiveActorState { - #line 7712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" CheckActiveActorState(Database const& cx,Reference const& taskBucket) - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : cx(cx), - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr(new ReadYourWritesTransaction(cx)), - #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" startingValue() - #line 7725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("checkActive", reinterpret_cast(this)); @@ -7735,9 +7727,9 @@ class CheckActiveActorState { int a_body1(int loopDepth=0) { try { - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ; - #line 7740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -7758,11 +7750,11 @@ class CheckActiveActorState { } int a_body1cont1(int loopDepth) { - #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" idx = 0; - #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ; - #line 7765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -7777,18 +7769,18 @@ class CheckActiveActorState { int a_body1loopBody1(int loopDepth) { try { - #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket->setOptions(tr); - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = isBusy(tr, taskBucket); - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 7786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7821,16 +7813,16 @@ class CheckActiveActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_4 = tr->onError(e); - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 7828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7843,20 +7835,20 @@ class CheckActiveActorState { } int a_body1loopBody1cont2(bool const& is_busy,int loopDepth) { - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!is_busy) - #line 7848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = success(addIdle(tr, taskBucket)); - #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 7854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -7868,20 +7860,20 @@ class CheckActiveActorState { } int a_body1loopBody1cont2(bool && is_busy,int loopDepth) { - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!is_busy) - #line 7873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = success(addIdle(tr, taskBucket)); - #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 7879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -7956,16 +7948,16 @@ class CheckActiveActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture> __when_expr_2 = tr->get(taskBucket->active.key()); - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 7963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 7968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 7960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -8047,36 +8039,36 @@ class CheckActiveActorState { } int a_body1loopBody1cont5(Optional const& val,int loopDepth) { - #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" startingValue = val; - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_3 = tr->commit(); - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 8056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont5(Optional && val,int loopDepth) { - #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" startingValue = val; - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_3 = tr->commit(); - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 8074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -8296,11 +8288,11 @@ class CheckActiveActorState { } int a_body1cont2(int loopDepth) { - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(true); - #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(true, "checkActive return false"); + #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~CheckActiveActorState(); static_cast(this)->destroy(); return 0; } - #line 8303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~CheckActiveActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8317,17 +8309,17 @@ class CheckActiveActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!(idx < CLIENT_KNOBS->TASKBUCKET_CHECK_ACTIVE_AMOUNT)) - #line 8322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr = Reference(new ReadYourWritesTransaction(cx)); - #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ; - #line 8330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = a_body1cont1loopBody1loopHead1(loopDepth); return loopDepth; @@ -8347,9 +8339,9 @@ class CheckActiveActorState { } int a_body1cont1loopBody1cont1(int loopDepth) { - #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ++idx; - #line 8352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; @@ -8364,18 +8356,18 @@ class CheckActiveActorState { int a_body1cont1loopBody1loopBody1(int loopDepth) { try { - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket->setOptions(tr); - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_5 = delay(CLIENT_KNOBS->TASKBUCKET_CHECK_ACTIVE_DELAY); - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 8373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont1loopBody1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont1loopBody1loopBody1when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8408,16 +8400,16 @@ class CheckActiveActorState { int a_body1cont1loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_7 = tr->onError(e); - #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 8415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), std::max(0, loopDepth - 2)); else return a_body1cont1loopBody1loopBody1Catch1when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8430,32 +8422,32 @@ class CheckActiveActorState { } int a_body1cont1loopBody1loopBody1cont2(Void const& _,int loopDepth) { - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_6 = getActiveKey(tr, taskBucket, startingValue); - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 8437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont1loopBody1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont1loopBody1loopBody1cont2when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1loopBody1loopBody1cont2(Void && _,int loopDepth) { - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_6 = getActiveKey(tr, taskBucket, startingValue); - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 8453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1cont1loopBody1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont1loopBody1loopBody1cont2when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -8525,15 +8517,15 @@ class CheckActiveActorState { } int a_body1cont1loopBody1loopBody1cont3(bool const& isActiveKey,int loopDepth) { - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (isActiveKey) - #line 8530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(true); - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(true, "checkActive return true"); + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~CheckActiveActorState(); static_cast(this)->destroy(); return 0; } - #line 8536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~CheckActiveActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8545,15 +8537,15 @@ class CheckActiveActorState { } int a_body1cont1loopBody1loopBody1cont3(bool && isActiveKey,int loopDepth) { - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (isActiveKey) - #line 8550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(true); - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(true, "checkActive return true"); + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~CheckActiveActorState(); static_cast(this)->destroy(); return 0; } - #line 8556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~CheckActiveActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8701,22 +8693,22 @@ class CheckActiveActorState { fdb_probe_actor_exit("checkActive", reinterpret_cast(this), 7); } - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Database cx; - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Optional startingValue; - #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" int idx; - #line 8714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via checkActive() - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class CheckActiveActor final : public Actor, public ActorCallback< CheckActiveActor, 0, bool >, public ActorCallback< CheckActiveActor, 1, Void >, public ActorCallback< CheckActiveActor, 2, Optional >, public ActorCallback< CheckActiveActor, 3, Void >, public ActorCallback< CheckActiveActor, 4, Void >, public ActorCallback< CheckActiveActor, 5, Void >, public ActorCallback< CheckActiveActor, 6, bool >, public ActorCallback< CheckActiveActor, 7, Void >, public FastAllocated, public CheckActiveActorState { - #line 8719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8732,9 +8724,9 @@ friend struct ActorCallback< CheckActiveActor, 4, Void >; friend struct ActorCallback< CheckActiveActor, 5, Void >; friend struct ActorCallback< CheckActiveActor, 6, bool >; friend struct ActorCallback< CheckActiveActor, 7, Void >; - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" CheckActiveActor(Database const& cx,Reference const& taskBucket) - #line 8737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), CheckActiveActorState(cx, taskBucket) { @@ -8764,31 +8756,31 @@ friend struct ActorCallback< CheckActiveActor, 7, Void >; } }; - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future checkActive( Database const& cx, Reference const& taskBucket ) { - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new CheckActiveActor(cx, taskBucket)); - #line 8771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 8776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via getTaskCount() - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class GetTaskCountActorState { - #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" GetTaskCountActorState(Reference const& tr,Reference const& taskBucket) - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket) - #line 8791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("getTaskCount", reinterpret_cast(this)); @@ -8801,18 +8793,18 @@ class GetTaskCountActorState { int a_body1(int loopDepth=0) { try { - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket->setOptions(tr); - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - StrictFuture> __when_expr_0 = tr->get(taskBucket->prefix.pack(LiteralStringRef("task_count"))); - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + StrictFuture> __when_expr_0 = tr->get(taskBucket->prefix.pack("task_count"_sr)); + #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 8815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8833,27 +8825,27 @@ class GetTaskCountActorState { } int a_body1cont1(Optional const& val,int loopDepth) { - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!val.present()) - #line 8838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(0); this->~GetTaskCountActorState(); static_cast(this)->destroy(); return 0; } - #line 8842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< int64_t >::value()) int64_t(0); this->~GetTaskCountActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ASSERT(val.get().size() == sizeof(int64_t)); - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" int64_t intValue = 0; - #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" memcpy(&intValue, val.get().begin(), val.get().size()); - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(intValue); this->~GetTaskCountActorState(); static_cast(this)->destroy(); return 0; } - #line 8856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< int64_t >::value()) int64_t(intValue); this->~GetTaskCountActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8863,27 +8855,27 @@ class GetTaskCountActorState { } int a_body1cont1(Optional && val,int loopDepth) { - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!val.present()) - #line 8868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(0); this->~GetTaskCountActorState(); static_cast(this)->destroy(); return 0; } - #line 8872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< int64_t >::value()) int64_t(0); this->~GetTaskCountActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ASSERT(val.get().size() == sizeof(int64_t)); - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" int64_t intValue = 0; - #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" memcpy(&intValue, val.get().begin(), val.get().size()); - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(intValue); this->~GetTaskCountActorState(); static_cast(this)->destroy(); return 0; } - #line 8886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< int64_t >::value()) int64_t(intValue); this->~GetTaskCountActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8954,16 +8946,16 @@ class GetTaskCountActorState { fdb_probe_actor_exit("getTaskCount", reinterpret_cast(this), 0); } - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 8961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via getTaskCount() - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class GetTaskCountActor final : public Actor, public ActorCallback< GetTaskCountActor, 0, Optional >, public FastAllocated, public GetTaskCountActorState { - #line 8966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8972,9 +8964,9 @@ class GetTaskCountActor final : public Actor, public ActorCallback< Get void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetTaskCountActor, 0, Optional >; - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" GetTaskCountActor(Reference const& tr,Reference const& taskBucket) - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), GetTaskCountActorState(tr, taskBucket) { @@ -8997,33 +8989,33 @@ friend struct ActorCallback< GetTaskCountActor, 0, Optional >; } }; - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future getTaskCount( Reference const& tr, Reference const& taskBucket ) { - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new GetTaskCountActor(tr, taskBucket)); - #line 9004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 8996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" // Looks for tasks that have timed out and returns them to be available tasks. // Returns True if any tasks were affected. - #line 9011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via requeueTimedOutTasks() - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class RequeueTimedOutTasksActorState { - #line 9017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" RequeueTimedOutTasksActorState(Reference const& tr,Reference const& taskBucket) - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket) - #line 9026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("requeueTimedOutTasks", reinterpret_cast(this)); @@ -9036,18 +9028,18 @@ class RequeueTimedOutTasksActorState { int a_body1(int loopDepth=0) { try { - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(true); - #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(true, "Looks for tasks that have timed out and returns them to be available tasks."); + #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = tr->getReadVersion(); - #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9068,36 +9060,36 @@ class RequeueTimedOutTasksActorState { } int a_body1cont1(Version const& end,int loopDepth) { - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" range = KeyRange(KeyRangeRef(taskBucket->timeouts.get(0).range().begin, taskBucket->timeouts.get(end).range().end)); - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = tr->getRange(range, CLIENT_KNOBS->TASKBUCKET_MAX_TASK_KEYS); - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Version && end,int loopDepth) { - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" range = KeyRange(KeyRangeRef(taskBucket->timeouts.get(0).range().begin, taskBucket->timeouts.get(end).range().end)); - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = tr->getRange(range, CLIENT_KNOBS->TASKBUCKET_MAX_TASK_KEYS); - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9167,83 +9159,83 @@ class RequeueTimedOutTasksActorState { } int a_body1cont2(RangeResult const& values,int loopDepth) { - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Task task; - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key lastKey; - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& iter : values ) { - #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Tuple t = taskBucket->timeouts.unpack(iter.key); - #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key uid = t.getString(1); - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key param = t.getString(2); - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (uid != task.key) - #line 9184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Subspace space = taskBucket->getAvailableSpace(task.getPriority()).get(task.key); - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& p : task.params ) { - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->set(space.pack(p.key), p.value); - #line 9192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task.params.clear(); - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task.key = uid; - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" lastKey = iter.key; - #line 9200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task.params[param] = iter.value; - #line 9204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!values.more) - #line 9208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Subspace space = taskBucket->getAvailableSpace(task.getPriority()).get(task.key); - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& p : task.params ) { - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->set(space.pack(p.key), p.value); - #line 9216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (values.size() > 0) - #line 9220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->clear(range); - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~RequeueTimedOutTasksActorState(); static_cast(this)->destroy(); return 0; } - #line 9226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~RequeueTimedOutTasksActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~RequeueTimedOutTasksActorState(); static_cast(this)->destroy(); return 0; } - #line 9234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~RequeueTimedOutTasksActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ASSERT(lastKey != Key()); - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->clear(KeyRangeRef(range.begin, lastKey)); - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~RequeueTimedOutTasksActorState(); static_cast(this)->destroy(); return 0; } - #line 9246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~RequeueTimedOutTasksActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9253,83 +9245,83 @@ class RequeueTimedOutTasksActorState { } int a_body1cont2(RangeResult && values,int loopDepth) { - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Task task; - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key lastKey; - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& iter : values ) { - #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Tuple t = taskBucket->timeouts.unpack(iter.key); - #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key uid = t.getString(1); - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key param = t.getString(2); - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (uid != task.key) - #line 9270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Subspace space = taskBucket->getAvailableSpace(task.getPriority()).get(task.key); - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& p : task.params ) { - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->set(space.pack(p.key), p.value); - #line 9278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task.params.clear(); - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task.key = uid; - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" lastKey = iter.key; - #line 9286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task.params[param] = iter.value; - #line 9290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!values.more) - #line 9294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Subspace space = taskBucket->getAvailableSpace(task.getPriority()).get(task.key); - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& p : task.params ) { - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->set(space.pack(p.key), p.value); - #line 9302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (values.size() > 0) - #line 9306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->clear(range); - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~RequeueTimedOutTasksActorState(); static_cast(this)->destroy(); return 0; } - #line 9312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~RequeueTimedOutTasksActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~RequeueTimedOutTasksActorState(); static_cast(this)->destroy(); return 0; } - #line 9320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~RequeueTimedOutTasksActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ASSERT(lastKey != Key()); - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->clear(KeyRangeRef(range.begin, lastKey)); - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~RequeueTimedOutTasksActorState(); static_cast(this)->destroy(); return 0; } - #line 9332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~RequeueTimedOutTasksActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9400,18 +9392,18 @@ class RequeueTimedOutTasksActorState { fdb_probe_actor_exit("requeueTimedOutTasks", reinterpret_cast(this), 1); } - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" KeyRange range; - #line 9409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via requeueTimedOutTasks() - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class RequeueTimedOutTasksActor final : public Actor, public ActorCallback< RequeueTimedOutTasksActor, 0, Version >, public ActorCallback< RequeueTimedOutTasksActor, 1, RangeResult >, public FastAllocated, public RequeueTimedOutTasksActorState { - #line 9414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9421,9 +9413,9 @@ class RequeueTimedOutTasksActor final : public Actor, public ActorCallback #pragma clang diagnostic pop friend struct ActorCallback< RequeueTimedOutTasksActor, 0, Version >; friend struct ActorCallback< RequeueTimedOutTasksActor, 1, RangeResult >; - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" RequeueTimedOutTasksActor(Reference const& tr,Reference const& taskBucket) - #line 9426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), RequeueTimedOutTasksActorState(tr, taskBucket) { @@ -9447,33 +9439,33 @@ friend struct ActorCallback< RequeueTimedOutTasksActor, 1, RangeResult >; } }; - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future requeueTimedOutTasks( Reference const& tr, Reference const& taskBucket ) { - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new RequeueTimedOutTasksActor(tr, taskBucket)); - #line 9454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 9459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via debugPrintRange() - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class DebugPrintRangeActorState { - #line 9465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" DebugPrintRangeActorState(Reference const& tr,Subspace const& subspace,Key const& msg) - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" subspace(subspace), - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" msg(msg) - #line 9476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("debugPrintRange", reinterpret_cast(this)); @@ -9486,20 +9478,20 @@ class DebugPrintRangeActorState { int a_body1(int loopDepth=0) { try { - #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->setOption(FDBTransactionOptions::LOCK_AWARE); - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = tr->getRange(subspace.range(), CLIENT_KNOBS->TOO_MANY); - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9520,11 +9512,11 @@ class DebugPrintRangeActorState { } int a_body1cont1(RangeResult const& values,int loopDepth) { - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent("TaskBucketDebugPrintRange") .detail("Key", subspace.key()) .detail("Count", values.size()) .detail("Msg", msg); - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DebugPrintRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 9527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DebugPrintRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9534,11 +9526,11 @@ class DebugPrintRangeActorState { } int a_body1cont1(RangeResult && values,int loopDepth) { - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent("TaskBucketDebugPrintRange") .detail("Key", subspace.key()) .detail("Count", values.size()) .detail("Msg", msg); - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DebugPrintRangeActorState(); static_cast(this)->destroy(); return 0; } - #line 9541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DebugPrintRangeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9609,18 +9601,18 @@ class DebugPrintRangeActorState { fdb_probe_actor_exit("debugPrintRange", reinterpret_cast(this), 0); } - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Subspace subspace; - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key msg; - #line 9618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via debugPrintRange() - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class DebugPrintRangeActor final : public Actor, public ActorCallback< DebugPrintRangeActor, 0, RangeResult >, public FastAllocated, public DebugPrintRangeActorState { - #line 9623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9629,9 +9621,9 @@ class DebugPrintRangeActor final : public Actor, public ActorCallback< Deb void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< DebugPrintRangeActor, 0, RangeResult >; - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" DebugPrintRangeActor(Reference const& tr,Subspace const& subspace,Key const& msg) - #line 9634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), DebugPrintRangeActorState(tr, subspace, msg) { @@ -9654,37 +9646,37 @@ friend struct ActorCallback< DebugPrintRangeActor, 0, RangeResult >; } }; - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future debugPrintRange( Reference const& tr, Subspace const& subspace, Key const& msg ) { - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new DebugPrintRangeActor(tr, subspace, msg)); - #line 9661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 9666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via extendTimeout() - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class ExtendTimeoutActorState { - #line 9672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ExtendTimeoutActorState(Reference const& tr,Reference const& taskBucket,Reference const& task,UpdateParams const& updateParams,Version const& newTimeoutVersion) - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task(task), - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" updateParams(updateParams), - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" newTimeoutVersion(newTimeoutVersion) - #line 9687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("extendTimeout", reinterpret_cast(this)); @@ -9697,18 +9689,18 @@ class ExtendTimeoutActorState { int a_body1(int loopDepth=0) { try { - #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket->setOptions(tr); - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = taskBucket->keepRunning(tr, task); - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9729,36 +9721,36 @@ class ExtendTimeoutActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" oldTimeoutSpace = taskBucket->timeouts.get(task->timeoutVersion).get(task->key); - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = tr->getReadVersion(); - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" oldTimeoutSpace = taskBucket->timeouts.get(task->timeoutVersion).get(task->key); - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = tr->getReadVersion(); - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9828,67 +9820,67 @@ class ExtendTimeoutActorState { } int a_body1cont2(Version const& version,int loopDepth) { - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (newTimeoutVersion == invalidVersion) - #line 9833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" newTimeoutVersion = version + taskBucket->timeout; - #line 9837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } else { - #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (newTimeoutVersion <= version) - #line 9843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" newTimeoutVersion = version + 1; - #line 9847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } } - #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (newTimeoutVersion <= task->timeoutVersion) - #line 9852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" newTimeoutVersion = task->timeoutVersion + 1; - #line 9856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" newTimeoutSpace = taskBucket->timeouts.get(newTimeoutVersion).get(task->key); - #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->addReadConflictRange(oldTimeoutSpace.range()); - #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->addWriteConflictRange(newTimeoutSpace.range()); - #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (updateParams) - #line 9866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(true); - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(true, "Extended a task while updating parameters"); + #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& p : task->params ) { - #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->set(newTimeoutSpace.pack(p.key), p.value); - #line 9874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } loopDepth = a_body1cont3(loopDepth); } else { - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(true); - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(true, "Extended a task without updating parameters"); + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_2 = tr->getRange(oldTimeoutSpace.range(), CLIENT_KNOBS->TOO_MANY); - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } @@ -9896,67 +9888,67 @@ class ExtendTimeoutActorState { } int a_body1cont2(Version && version,int loopDepth) { - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (newTimeoutVersion == invalidVersion) - #line 9901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" newTimeoutVersion = version + taskBucket->timeout; - #line 9905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } else { - #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (newTimeoutVersion <= version) - #line 9911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" newTimeoutVersion = version + 1; - #line 9915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } } - #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (newTimeoutVersion <= task->timeoutVersion) - #line 9920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" newTimeoutVersion = task->timeoutVersion + 1; - #line 9924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" newTimeoutSpace = taskBucket->timeouts.get(newTimeoutVersion).get(task->key); - #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->addReadConflictRange(oldTimeoutSpace.range()); - #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->addWriteConflictRange(newTimeoutSpace.range()); - #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (updateParams) - #line 9934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(true); - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(true, "Extended a task while updating parameters"); + #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& p : task->params ) { - #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->set(newTimeoutSpace.pack(p.key), p.value); - #line 9942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } loopDepth = a_body1cont3(loopDepth); } else { - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(true); - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(true, "Extended a task without updating parameters"); + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_2 = tr->getRange(oldTimeoutSpace.range(), CLIENT_KNOBS->TOO_MANY); - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 9951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } @@ -10027,11 +10019,11 @@ class ExtendTimeoutActorState { } int a_body1cont3(int loopDepth) { - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->clear(oldTimeoutSpace.range()); - #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(newTimeoutVersion); this->~ExtendTimeoutActorState(); static_cast(this)->destroy(); return 0; } - #line 10034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Version >::value()) Version(std::move(newTimeoutVersion)); // state_var_RVO this->~ExtendTimeoutActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10041,13 +10033,13 @@ class ExtendTimeoutActorState { } int a_body1cont10(RangeResult const& params,int loopDepth) { - #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& kv : params ) { - #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Tuple paramKey = oldTimeoutSpace.unpack(kv.key); - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->set(newTimeoutSpace.pack(paramKey), kv.value); - #line 10050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } loopDepth = a_body1cont3(loopDepth); @@ -10055,13 +10047,13 @@ class ExtendTimeoutActorState { } int a_body1cont10(RangeResult && params,int loopDepth) { - #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& kv : params ) { - #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Tuple paramKey = oldTimeoutSpace.unpack(kv.key); - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->set(newTimeoutSpace.pack(paramKey), kv.value); - #line 10064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } loopDepth = a_body1cont3(loopDepth); @@ -10130,26 +10122,26 @@ class ExtendTimeoutActorState { fdb_probe_actor_exit("extendTimeout", reinterpret_cast(this), 2); } - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" UpdateParams updateParams; - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Version newTimeoutVersion; - #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Subspace oldTimeoutSpace; - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Subspace newTimeoutSpace; - #line 10147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via extendTimeout() - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class ExtendTimeoutActor final : public Actor, public ActorCallback< ExtendTimeoutActor, 0, Void >, public ActorCallback< ExtendTimeoutActor, 1, Version >, public ActorCallback< ExtendTimeoutActor, 2, RangeResult >, public FastAllocated, public ExtendTimeoutActorState { - #line 10152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -10160,9 +10152,9 @@ class ExtendTimeoutActor final : public Actor, public ActorCallback< Ex friend struct ActorCallback< ExtendTimeoutActor, 0, Void >; friend struct ActorCallback< ExtendTimeoutActor, 1, Version >; friend struct ActorCallback< ExtendTimeoutActor, 2, RangeResult >; - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ExtendTimeoutActor(Reference const& tr,Reference const& taskBucket,Reference const& task,UpdateParams const& updateParams,Version const& newTimeoutVersion) - #line 10165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), ExtendTimeoutActorState(tr, taskBucket, task, updateParams, newTimeoutVersion) { @@ -10187,27 +10179,27 @@ friend struct ActorCallback< ExtendTimeoutActor, 2, RangeResult >; } }; - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future extendTimeout( Reference const& tr, Reference const& taskBucket, Reference const& task, UpdateParams const& updateParams, Version const& newTimeoutVersion ) { - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new ExtendTimeoutActor(tr, taskBucket, task, updateParams, newTimeoutVersion)); - #line 10194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" }; TaskBucket::TaskBucket(const Subspace& subspace, AccessSystemKeys sysAccess, PriorityBatch priorityBatch, LockAware lockAware) - : cc("TaskBucket"), dispatchSlotChecksStarted("DispatchSlotChecksStarted", cc), dispatchErrors("DispatchErrors", cc), + : dbgid(deterministicRandom()->randomUniqueID()), cc("TaskBucket", dbgid.toString()), + dispatchSlotChecksStarted("DispatchSlotChecksStarted", cc), dispatchErrors("DispatchErrors", cc), dispatchDoTasks("DispatchDoTasks", cc), dispatchEmptyTasks("DispatchEmptyTasks", cc), - dispatchSlotChecksComplete("DispatchSlotChecksComplete", cc), dbgid(deterministicRandom()->randomUniqueID()), - prefix(subspace), active(prefix.get(LiteralStringRef("ac"))), pauseKey(prefix.pack(LiteralStringRef("pause"))), - available(prefix.get(LiteralStringRef("av"))), available_prioritized(prefix.get(LiteralStringRef("avp"))), - timeouts(prefix.get(LiteralStringRef("to"))), timeout(CLIENT_KNOBS->TASKBUCKET_TIMEOUT_VERSIONS), - system_access(sysAccess), priority_batch(priorityBatch), lockAware(lockAware) {} + dispatchSlotChecksComplete("DispatchSlotChecksComplete", cc), prefix(subspace), active(prefix.get("ac"_sr)), + pauseKey(prefix.pack("pause"_sr)), available(prefix.get("av"_sr)), available_prioritized(prefix.get("avp"_sr)), + timeouts(prefix.get("to"_sr)), timeout(CLIENT_KNOBS->TASKBUCKET_TIMEOUT_VERSIONS), system_access(sysAccess), + priority_batch(priorityBatch), lockAware(lockAware) {} TaskBucket::~TaskBucket() {} @@ -10250,9 +10242,7 @@ Key TaskBucket::addTask(Reference tr, Reference for (auto& param : task->params) tr->set(taskSpace.pack(param.key), param.value); - tr->atomicOp(prefix.pack(LiteralStringRef("task_count")), - LiteralStringRef("\x01\x00\x00\x00\x00\x00\x00\x00"), - MutationRef::AddValue); + tr->atomicOp(prefix.pack("task_count"_sr), "\x01\x00\x00\x00\x00\x00\x00\x00"_sr, MutationRef::AddValue); return key; } @@ -10262,27 +10252,27 @@ void TaskBucket::setValidationCondition(Reference task, KeyRef vKey, KeyRe task->params[Task::reservedTaskParamValidValue] = vValue; } - #line 10265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" namespace { // This generated class is to be used only via actorAddTask() - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class ActorAddTaskActorState { - #line 10272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ActorAddTaskActorState(TaskBucket* const& tb,Reference const& tr,Reference const& task,KeyRef const& validationKey) - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tb(tb), - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr(tr), - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task(task), - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" validationKey(validationKey) - #line 10285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("actorAddTask", reinterpret_cast(this)); @@ -10295,18 +10285,18 @@ class ActorAddTaskActorState { int a_body1(int loopDepth=0) { try { - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tb->setOptions(tr); - #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture> __when_expr_0 = tr->get(validationKey); - #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 10309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -10327,21 +10317,21 @@ class ActorAddTaskActorState { } int a_body1cont1(Optional const& validationValue,int loopDepth) { - #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!validationValue.present()) - #line 10332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent(SevError, "TaskBucketAddTaskInvalidKey") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("ValidationKey", validationKey); - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return a_body1Catch1(invalid_option_value(), loopDepth); - #line 10338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TaskBucket::setValidationCondition(task, validationKey, validationValue.get()); - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(tb->addTask(tr, task)); this->~ActorAddTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 10344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(tb->addTask(tr, task)); this->~ActorAddTaskActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10351,21 +10341,21 @@ class ActorAddTaskActorState { } int a_body1cont1(Optional && validationValue,int loopDepth) { - #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!validationValue.present()) - #line 10356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent(SevError, "TaskBucketAddTaskInvalidKey") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("ValidationKey", validationKey); - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return a_body1Catch1(invalid_option_value(), loopDepth); - #line 10362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TaskBucket::setValidationCondition(task, validationKey, validationValue.get()); - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(tb->addTask(tr, task)); this->~ActorAddTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 10368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(tb->addTask(tr, task)); this->~ActorAddTaskActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10436,20 +10426,20 @@ class ActorAddTaskActorState { fdb_probe_actor_exit("actorAddTask", reinterpret_cast(this), 0); } - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TaskBucket* tb; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" KeyRef validationKey; - #line 10447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via actorAddTask() - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class ActorAddTaskActor final : public Actor, public ActorCallback< ActorAddTaskActor, 0, Optional >, public FastAllocated, public ActorAddTaskActorState { - #line 10452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -10458,9 +10448,9 @@ class ActorAddTaskActor final : public Actor, public ActorCallback< ActorAd void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ActorAddTaskActor, 0, Optional >; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" ActorAddTaskActor(TaskBucket* const& tb,Reference const& tr,Reference const& task,KeyRef const& validationKey) - #line 10463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), ActorAddTaskActorState(tb, tr, task, validationKey) { @@ -10484,14 +10474,14 @@ friend struct ActorCallback< ActorAddTaskActor, 0, Optional >; } }; } - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future actorAddTask( TaskBucket* const& tb, Reference const& tr, Reference const& task, KeyRef const& validationKey ) { - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new ActorAddTaskActor(tb, tr, task, validationKey)); - #line 10491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Future TaskBucket::addTask(Reference tr, Reference task, KeyRef validationKey) { return actorAddTask(this, tr, task, validationKey); @@ -10535,13 +10525,9 @@ Future TaskBucket::isEmpty(Reference tr) { Future TaskBucket::finish(Reference tr, Reference task) { setOptions(tr); - Tuple t; - t.append(task->timeoutVersion); - t.append(task->key); + Tuple t = Tuple::makeTuple(task->timeoutVersion, task->key); - tr->atomicOp(prefix.pack(LiteralStringRef("task_count")), - LiteralStringRef("\xff\xff\xff\xff\xff\xff\xff\xff"), - MutationRef::AddValue); + tr->atomicOp(prefix.pack("task_count"_sr), "\xff\xff\xff\xff\xff\xff\xff\xff"_sr, MutationRef::AddValue); tr->clear(timeouts.range(t)); return Void(); @@ -10572,7 +10558,7 @@ Future TaskBucket::getTaskCount(Reference tr } Future TaskBucket::watchTaskCount(Reference tr) { - return tr->watch(prefix.pack(LiteralStringRef("task_count"))); + return tr->watch(prefix.pack("task_count"_sr)); } Future TaskBucket::debugPrintRange(Reference tr, Subspace subspace, Key msg) { @@ -10581,22 +10567,22 @@ Future TaskBucket::debugPrintRange(Reference tr class FutureBucketImpl { public: - #line 10584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via isEmpty() - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class IsEmptyActor1State { - #line 10590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" IsEmptyActor1State(Reference const& tr,Reference const& futureBucket) - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" futureBucket(futureBucket) - #line 10599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("isEmpty", reinterpret_cast(this)); @@ -10609,18 +10595,18 @@ class IsEmptyActor1State { int a_body1(int loopDepth=0) { try { - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" futureBucket->setOptions(tr); - #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = tr->getKey(lastLessOrEqual(futureBucket->prefix.pack(maxUIDKey))); - #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -10641,9 +10627,9 @@ class IsEmptyActor1State { } int a_body1cont1(Key const& lastKey,int loopDepth) { - #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(!futureBucket->prefix.contains(lastKey)); this->~IsEmptyActor1State(); static_cast(this)->destroy(); return 0; } - #line 10646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(!futureBucket->prefix.contains(lastKey)); this->~IsEmptyActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10653,9 +10639,9 @@ class IsEmptyActor1State { } int a_body1cont1(Key && lastKey,int loopDepth) { - #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(!futureBucket->prefix.contains(lastKey)); this->~IsEmptyActor1State(); static_cast(this)->destroy(); return 0; } - #line 10658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(!futureBucket->prefix.contains(lastKey)); this->~IsEmptyActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10726,16 +10712,16 @@ class IsEmptyActor1State { fdb_probe_actor_exit("isEmpty", reinterpret_cast(this), 0); } - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference futureBucket; - #line 10733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via isEmpty() - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class IsEmptyActor1 final : public Actor, public ActorCallback< IsEmptyActor1, 0, Key >, public FastAllocated, public IsEmptyActor1State { - #line 10738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -10744,9 +10730,9 @@ class IsEmptyActor1 final : public Actor, public ActorCallback< IsEmptyAct void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< IsEmptyActor1, 0, Key >; - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" IsEmptyActor1(Reference const& tr,Reference const& futureBucket) - #line 10749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), IsEmptyActor1State(tr, futureBucket) { @@ -10769,14 +10755,14 @@ friend struct ActorCallback< IsEmptyActor1, 0, Key >; } }; - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future isEmpty( Reference const& tr, Reference const& futureBucket ) { - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new IsEmptyActor1(tr, futureBucket)); - #line 10776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" }; FutureBucket::FutureBucket(const Subspace& subspace, AccessSystemKeys sysAccess, LockAware lockAware) @@ -10810,26 +10796,26 @@ Reference FutureBucket::unpack(Key key) { class TaskFutureImpl { public: - #line 10813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via join() - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class JoinActorState { - #line 10819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" JoinActorState(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture,std::vector> const& vectorFuture) - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture(taskFuture), - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" vectorFuture(vectorFuture) - #line 10832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("join", reinterpret_cast(this)); @@ -10842,18 +10828,18 @@ class JoinActorState { int a_body1(int loopDepth=0) { try { - #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture->futureBucket->setOptions(tr); - #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = isSet(tr, taskFuture); - #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -10874,60 +10860,60 @@ class JoinActorState { } int a_body1cont1(bool const& is_set,int loopDepth) { - #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (is_set) - #line 10879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~JoinActorState(); static_cast(this)->destroy(); return 0; } - #line 10883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~JoinActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->clear(taskFuture->blocks.pack(StringRef())); - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = _join(tr, taskBucket, taskFuture, vectorFuture); - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(bool && is_set,int loopDepth) { - #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (is_set) - #line 10909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~JoinActorState(); static_cast(this)->destroy(); return 0; } - #line 10913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~JoinActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->clear(taskFuture->blocks.pack(StringRef())); - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = _join(tr, taskBucket, taskFuture, vectorFuture); - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -10997,9 +10983,9 @@ class JoinActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~JoinActorState(); static_cast(this)->destroy(); return 0; } - #line 11002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 10988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~JoinActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11009,9 +10995,9 @@ class JoinActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~JoinActorState(); static_cast(this)->destroy(); return 0; } - #line 11014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~JoinActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11082,20 +11068,20 @@ class JoinActorState { fdb_probe_actor_exit("join", reinterpret_cast(this), 1); } - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskFuture; - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" std::vector> vectorFuture; - #line 11093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via join() - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class JoinActor final : public Actor, public ActorCallback< JoinActor, 0, bool >, public ActorCallback< JoinActor, 1, Void >, public FastAllocated, public JoinActorState { - #line 11098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -11105,9 +11091,9 @@ class JoinActor final : public Actor, public ActorCallback< JoinActor, 0, #pragma clang diagnostic pop friend struct ActorCallback< JoinActor, 0, bool >; friend struct ActorCallback< JoinActor, 1, Void >; - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" JoinActor(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture,std::vector> const& vectorFuture) - #line 11110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), JoinActorState(tr, taskBucket, taskFuture, vectorFuture) { @@ -11131,35 +11117,35 @@ friend struct ActorCallback< JoinActor, 1, Void >; } }; - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future join( Reference const& tr, Reference const& taskBucket, Reference const& taskFuture, std::vector> const& vectorFuture ) { - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new JoinActor(tr, taskBucket, taskFuture, vectorFuture)); - #line 11138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 11143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via _join() - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class _joinActorState { - #line 11149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" _joinActorState(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture,std::vector> const& vectorFuture) - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture(taskFuture), - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" vectorFuture(vectorFuture) - #line 11162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("_join", reinterpret_cast(this)); @@ -11172,36 +11158,36 @@ class _joinActorState { int a_body1(int loopDepth=0) { try { - #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" std::vector> onSetFutures; - #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for(int i = 0;i < vectorFuture.size();++i) { - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key key = StringRef(deterministicRandom()->randomUniqueID().toString()); - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture->addBlock(tr, key); - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" auto task = makeReference(); - #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - task->params[Task::reservedTaskParamKeyType] = LiteralStringRef("UnblockFuture"); - #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + task->params[Task::reservedTaskParamKeyType] = "UnblockFuture"_sr; + #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->params[Task::reservedTaskParamKeyFuture] = taskFuture->key; - #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->params[Task::reservedTaskParamKeyBlockID] = key; - #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" onSetFutures.push_back(vectorFuture[i]->onSet(tr, taskBucket, task)); - #line 11193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = waitForAll(onSetFutures); - #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast<_joinActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast<_joinActor*>(this)->actor_wait_state = 1; - #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_joinActor*>(this))); - #line 11204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11222,9 +11208,9 @@ class _joinActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast<_joinActor*>(this)->SAV::futures) { (void)(Void()); this->~_joinActorState(); static_cast<_joinActor*>(this)->destroy(); return 0; } - #line 11227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast<_joinActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_joinActorState(); static_cast<_joinActor*>(this)->finishSendAndDelPromiseRef(); @@ -11234,9 +11220,9 @@ class _joinActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast<_joinActor*>(this)->SAV::futures) { (void)(Void()); this->~_joinActorState(); static_cast<_joinActor*>(this)->destroy(); return 0; } - #line 11239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast<_joinActor*>(this)->SAV< Void >::value()) Void(Void()); this->~_joinActorState(); static_cast<_joinActor*>(this)->finishSendAndDelPromiseRef(); @@ -11307,20 +11293,20 @@ class _joinActorState { fdb_probe_actor_exit("_join", reinterpret_cast(this), 0); } - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskFuture; - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" std::vector> vectorFuture; - #line 11318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via _join() - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class _joinActor final : public Actor, public ActorCallback< _joinActor, 0, Void >, public FastAllocated<_joinActor>, public _joinActorState<_joinActor> { - #line 11323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated<_joinActor>::operator new; using FastAllocated<_joinActor>::operator delete; @@ -11329,9 +11315,9 @@ class _joinActor final : public Actor, public ActorCallback< _joinActor, 0 void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< _joinActor, 0, Void >; - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" _joinActor(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture,std::vector> const& vectorFuture) - #line 11334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), _joinActorState<_joinActor>(tr, taskBucket, taskFuture, vectorFuture) { @@ -11354,31 +11340,31 @@ friend struct ActorCallback< _joinActor, 0, Void >; } }; - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future _join( Reference const& tr, Reference const& taskBucket, Reference const& taskFuture, std::vector> const& vectorFuture ) { - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new _joinActor(tr, taskBucket, taskFuture, vectorFuture)); - #line 11361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 1121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 11366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via isSet() - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class IsSetActorState { - #line 11372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" IsSetActorState(Reference const& tr,Reference const& taskFuture) - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture(taskFuture) - #line 11381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("isSet", reinterpret_cast(this)); @@ -11391,18 +11377,18 @@ class IsSetActorState { int a_body1(int loopDepth=0) { try { - #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture->futureBucket->setOptions(tr); - #line 1125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = tr->getRange(taskFuture->blocks.range(), 1); - #line 1125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11423,21 +11409,21 @@ class IsSetActorState { } int a_body1cont1(RangeResult const& values,int loopDepth) { - #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (values.size() > 0) - #line 11428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsSetActorState(); static_cast(this)->destroy(); return 0; } - #line 11432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsSetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~IsSetActorState(); static_cast(this)->destroy(); return 0; } - #line 11440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~IsSetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11447,21 +11433,21 @@ class IsSetActorState { } int a_body1cont1(RangeResult && values,int loopDepth) { - #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (values.size() > 0) - #line 11452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~IsSetActorState(); static_cast(this)->destroy(); return 0; } - #line 11456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~IsSetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~IsSetActorState(); static_cast(this)->destroy(); return 0; } - #line 11464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~IsSetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11532,16 +11518,16 @@ class IsSetActorState { fdb_probe_actor_exit("isSet", reinterpret_cast(this), 0); } - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskFuture; - #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via isSet() - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class IsSetActor final : public Actor, public ActorCallback< IsSetActor, 0, RangeResult >, public FastAllocated, public IsSetActorState { - #line 11544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -11550,9 +11536,9 @@ class IsSetActor final : public Actor, public ActorCallback< IsSetActor, 0 void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< IsSetActor, 0, RangeResult >; - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" IsSetActor(Reference const& tr,Reference const& taskFuture) - #line 11555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), IsSetActorState(tr, taskFuture) { @@ -11575,35 +11561,35 @@ friend struct ActorCallback< IsSetActor, 0, RangeResult >; } }; - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future isSet( Reference const& tr, Reference const& taskFuture ) { - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new IsSetActor(tr, taskFuture)); - #line 11582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 1121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 11587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via onSet() - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class OnSetActorState { - #line 11593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" OnSetActorState(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture,Reference const& task) - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture(taskFuture), - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task(task) - #line 11606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("onSet", reinterpret_cast(this)); @@ -11616,18 +11602,18 @@ class OnSetActorState { int a_body1(int loopDepth=0) { try { - #line 1136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture->futureBucket->setOptions(tr); - #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = isSet(tr, taskFuture); - #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11648,35 +11634,35 @@ class OnSetActorState { } int a_body1cont1(bool const& is_set,int loopDepth) { - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (is_set) - #line 11653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(true); - #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(true, "is_set == true"); + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = performAction(tr, taskBucket, taskFuture, task); - #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else { - #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(true); - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(true, "is_set == false"); + #line 1135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Subspace callbackSpace = taskFuture->callbacks.get(StringRef(deterministicRandom()->randomUniqueID().toString())); - #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& v : task->params ) { - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->set(callbackSpace.pack(v.key), v.value); - #line 11679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } loopDepth = a_body1cont2(loopDepth); } @@ -11685,35 +11671,35 @@ class OnSetActorState { } int a_body1cont1(bool && is_set,int loopDepth) { - #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (is_set) - #line 11690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(true); - #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(true, "is_set == true"); + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = performAction(tr, taskBucket, taskFuture, task); - #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else { - #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - TEST(true); - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + CODE_PROBE(true, "is_set == false"); + #line 1135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Subspace callbackSpace = taskFuture->callbacks.get(StringRef(deterministicRandom()->randomUniqueID().toString())); - #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& v : task->params ) { - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->set(callbackSpace.pack(v.key), v.value); - #line 11716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } loopDepth = a_body1cont2(loopDepth); } @@ -11785,9 +11771,9 @@ class OnSetActorState { } int a_body1cont2(int loopDepth) { - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OnSetActorState(); static_cast(this)->destroy(); return 0; } - #line 11790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~OnSetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -11870,20 +11856,20 @@ class OnSetActorState { fdb_probe_actor_exit("onSet", reinterpret_cast(this), 1); } - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskFuture; - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 11881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via onSet() - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class OnSetActor final : public Actor, public ActorCallback< OnSetActor, 0, bool >, public ActorCallback< OnSetActor, 1, Void >, public FastAllocated, public OnSetActorState { - #line 11886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -11893,9 +11879,9 @@ class OnSetActor final : public Actor, public ActorCallback< OnSetActor, 0 #pragma clang diagnostic pop friend struct ActorCallback< OnSetActor, 0, bool >; friend struct ActorCallback< OnSetActor, 1, Void >; - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" OnSetActor(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture,Reference const& task) - #line 11898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), OnSetActorState(tr, taskBucket, taskFuture, task) { @@ -11919,33 +11905,33 @@ friend struct ActorCallback< OnSetActor, 1, Void >; } }; - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future onSet( Reference const& tr, Reference const& taskBucket, Reference const& taskFuture, Reference const& task ) { - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new OnSetActor(tr, taskBucket, taskFuture, task)); - #line 11926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 11931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via set() - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class SetActorState { - #line 11937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" SetActorState(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture) - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture(taskFuture) - #line 11948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("set", reinterpret_cast(this)); @@ -11958,20 +11944,20 @@ class SetActorState { int a_body1(int loopDepth=0) { try { - #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture->futureBucket->setOptions(tr); - #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->clear(taskFuture->blocks.range()); - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = performAllActions(tr, taskBucket, taskFuture); - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 11969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11992,9 +11978,9 @@ class SetActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SetActorState(); static_cast(this)->destroy(); return 0; } - #line 11997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -12004,9 +11990,9 @@ class SetActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SetActorState(); static_cast(this)->destroy(); return 0; } - #line 12009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 11995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SetActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -12077,18 +12063,18 @@ class SetActorState { fdb_probe_actor_exit("set", reinterpret_cast(this), 0); } - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskFuture; - #line 12086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via set() - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class SetActor final : public Actor, public ActorCallback< SetActor, 0, Void >, public FastAllocated, public SetActorState { - #line 12091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -12097,9 +12083,9 @@ class SetActor final : public Actor, public ActorCallback< SetActor, 0, Vo void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< SetActor, 0, Void >; - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" SetActor(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture) - #line 12102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), SetActorState(tr, taskBucket, taskFuture) { @@ -12122,35 +12108,35 @@ friend struct ActorCallback< SetActor, 0, Void >; } }; - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future set( Reference const& tr, Reference const& taskBucket, Reference const& taskFuture ) { - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new SetActor(tr, taskBucket, taskFuture)); - #line 12129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 12134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via performAction() - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class PerformActionActorState { - #line 12140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" PerformActionActorState(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture,Reference const& task) - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture(taskFuture), - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task(task) - #line 12153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("performAction", reinterpret_cast(this)); @@ -12163,28 +12149,28 @@ class PerformActionActorState { int a_body1(int loopDepth=0) { try { - #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture->futureBucket->setOptions(tr); - #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (task && TaskFuncBase::isValidTask(task)) - #line 12170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskFunc = TaskFuncBase::create(task->params[Task::reservedTaskParamKeyType]); - #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (taskFunc.getPtr()) - #line 12176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = taskFunc->finish(tr, taskBucket, taskFuture->futureBucket, task); - #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } else @@ -12215,9 +12201,9 @@ class PerformActionActorState { } int a_body1cont1(int loopDepth) { - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PerformActionActorState(); static_cast(this)->destroy(); return 0; } - #line 12220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~PerformActionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -12306,20 +12292,20 @@ class PerformActionActorState { fdb_probe_actor_exit("performAction", reinterpret_cast(this), 0); } - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskFuture; - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 12317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via performAction() - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class PerformActionActor final : public Actor, public ActorCallback< PerformActionActor, 0, Void >, public FastAllocated, public PerformActionActorState { - #line 12322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -12328,9 +12314,9 @@ class PerformActionActor final : public Actor, public ActorCallback< Perfo void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< PerformActionActor, 0, Void >; - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" PerformActionActor(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture,Reference const& task) - #line 12333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), PerformActionActorState(tr, taskBucket, taskFuture, task) { @@ -12353,33 +12339,33 @@ friend struct ActorCallback< PerformActionActor, 0, Void >; } }; - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future performAction( Reference const& tr, Reference const& taskBucket, Reference const& taskFuture, Reference const& task ) { - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new PerformActionActor(tr, taskBucket, taskFuture, task)); - #line 12360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 12365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via performAllActions() - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class PerformAllActionsActorState { - #line 12371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" PerformAllActionsActorState(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture) - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture(taskFuture) - #line 12382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("performAllActions", reinterpret_cast(this)); @@ -12392,18 +12378,18 @@ class PerformAllActionsActorState { int a_body1(int loopDepth=0) { try { - #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture->futureBucket->setOptions(tr); - #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = tr->getRange(taskFuture->callbacks.range(), CLIENT_KNOBS->TOO_MANY); - #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -12424,112 +12410,112 @@ class PerformAllActionsActorState { } int a_body1cont1(RangeResult const& values,int loopDepth) { - #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->clear(taskFuture->callbacks.range()); - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" std::vector> actions; - #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (values.size() != 0) - #line 12433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task = Reference(new Task()); - #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key lastTaskID; - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& s : values ) { - #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Tuple t = taskFuture->callbacks.unpack(s.key); - #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key taskID = t.getString(0); - #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key key = t.getString(1); - #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (taskID.size() != 0 && taskID != lastTaskID) - #line 12449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" actions.push_back(performAction(tr, taskBucket, taskFuture, task)); - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task = makeReference(); - #line 12455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->params[key] = s.value; - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" lastTaskID = taskID; - #line 12461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" actions.push_back(performAction(tr, taskBucket, taskFuture, task)); - #line 12465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = waitForAll(actions); - #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(RangeResult && values,int loopDepth) { - #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" tr->clear(taskFuture->callbacks.range()); - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" std::vector> actions; - #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (values.size() != 0) - #line 12489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task = Reference(new Task()); - #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key lastTaskID; - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" for( auto& s : values ) { - #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Tuple t = taskFuture->callbacks.unpack(s.key); - #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key taskID = t.getString(0); - #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Key key = t.getString(1); - #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (taskID.size() != 0 && taskID != lastTaskID) - #line 12505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" actions.push_back(performAction(tr, taskBucket, taskFuture, task)); - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task = makeReference(); - #line 12511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->params[key] = s.value; - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" lastTaskID = taskID; - #line 12517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" actions.push_back(performAction(tr, taskBucket, taskFuture, task)); - #line 12521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = waitForAll(actions); - #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -12599,9 +12585,9 @@ class PerformAllActionsActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PerformAllActionsActorState(); static_cast(this)->destroy(); return 0; } - #line 12604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~PerformAllActionsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -12611,9 +12597,9 @@ class PerformAllActionsActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~PerformAllActionsActorState(); static_cast(this)->destroy(); return 0; } - #line 12616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~PerformAllActionsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -12684,20 +12670,20 @@ class PerformAllActionsActorState { fdb_probe_actor_exit("performAllActions", reinterpret_cast(this), 1); } - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskFuture; - #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 12695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via performAllActions() - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class PerformAllActionsActor final : public Actor, public ActorCallback< PerformAllActionsActor, 0, RangeResult >, public ActorCallback< PerformAllActionsActor, 1, Void >, public FastAllocated, public PerformAllActionsActorState { - #line 12700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -12707,9 +12693,9 @@ class PerformAllActionsActor final : public Actor, public ActorCallback< P #pragma clang diagnostic pop friend struct ActorCallback< PerformAllActionsActor, 0, RangeResult >; friend struct ActorCallback< PerformAllActionsActor, 1, Void >; - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" PerformAllActionsActor(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture) - #line 12712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), PerformAllActionsActorState(tr, taskBucket, taskFuture) { @@ -12733,35 +12719,35 @@ friend struct ActorCallback< PerformAllActionsActor, 1, Void >; } }; - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future performAllActions( Reference const& tr, Reference const& taskBucket, Reference const& taskFuture ) { - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new PerformAllActionsActor(tr, taskBucket, taskFuture)); - #line 12740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 12745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via onSetAddTask() - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class OnSetAddTaskActorState { - #line 12751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" OnSetAddTaskActorState(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture,Reference const& task) - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture(taskFuture), - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task(task) - #line 12764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("onSetAddTask", reinterpret_cast(this)); @@ -12774,22 +12760,22 @@ class OnSetAddTaskActorState { int a_body1(int loopDepth=0) { try { - #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture->futureBucket->setOptions(tr); - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->params[Task::reservedTaskParamKeyAddTask] = task->params[Task::reservedTaskParamKeyType]; - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - task->params[Task::reservedTaskParamKeyType] = LiteralStringRef("AddTask"); - #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + task->params[Task::reservedTaskParamKeyType] = "AddTask"_sr; + #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = onSet(tr, taskBucket, taskFuture, task); - #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 12792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -12810,9 +12796,9 @@ class OnSetAddTaskActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OnSetAddTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 12815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~OnSetAddTaskActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -12822,9 +12808,9 @@ class OnSetAddTaskActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OnSetAddTaskActorState(); static_cast(this)->destroy(); return 0; } - #line 12827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~OnSetAddTaskActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -12895,20 +12881,20 @@ class OnSetAddTaskActorState { fdb_probe_actor_exit("onSetAddTask", reinterpret_cast(this), 0); } - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskFuture; - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 12906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via onSetAddTask() - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class OnSetAddTaskActor final : public Actor, public ActorCallback< OnSetAddTaskActor, 0, Void >, public FastAllocated, public OnSetAddTaskActorState { - #line 12911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -12917,9 +12903,9 @@ class OnSetAddTaskActor final : public Actor, public ActorCallback< OnSetA void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< OnSetAddTaskActor, 0, Void >; - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" OnSetAddTaskActor(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture,Reference const& task) - #line 12922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), OnSetAddTaskActorState(tr, taskBucket, taskFuture, task) { @@ -12942,37 +12928,37 @@ friend struct ActorCallback< OnSetAddTaskActor, 0, Void >; } }; - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future onSetAddTask( Reference const& tr, Reference const& taskBucket, Reference const& taskFuture, Reference const& task ) { - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new OnSetAddTaskActor(tr, taskBucket, taskFuture, task)); - #line 12949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 12954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via onSetAddTask() - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class OnSetAddTaskActor1State { - #line 12960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" OnSetAddTaskActor1State(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture,Reference const& task,KeyRef const& validationKey) - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture(taskFuture), - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task(task), - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" validationKey(validationKey) - #line 12975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("onSetAddTask", reinterpret_cast(this)); @@ -12985,18 +12971,18 @@ class OnSetAddTaskActor1State { int a_body1(int loopDepth=0) { try { - #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture->futureBucket->setOptions(tr); - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture> __when_expr_0 = tr->get(validationKey); - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 12994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 12999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 12985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13017,60 +13003,60 @@ class OnSetAddTaskActor1State { } int a_body1cont1(Optional const& validationValue,int loopDepth) { - #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!validationValue.present()) - #line 13022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent(SevError, "TaskBucketOnSetAddTaskInvalidKey") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("ValidationKey", validationKey); - #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return a_body1Catch1(invalid_option_value(), loopDepth); - #line 13028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->params[Task::reservedTaskParamValidKey] = validationKey; - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->params[Task::reservedTaskParamValidValue] = validationValue.get(); - #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = onSetAddTask(tr, taskBucket, taskFuture, task); - #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Optional && validationValue,int loopDepth) { - #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!validationValue.present()) - #line 13052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TraceEvent(SevError, "TaskBucketOnSetAddTaskInvalidKey") .detail("Task", task->params[Task::reservedTaskParamKeyType]) .detail("ValidationKey", validationKey); - #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return a_body1Catch1(invalid_option_value(), loopDepth); - #line 13058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } - #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->params[Task::reservedTaskParamValidKey] = validationKey; - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" task->params[Task::reservedTaskParamValidValue] = validationValue.get(); - #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_1 = onSetAddTask(tr, taskBucket, taskFuture, task); - #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -13140,9 +13126,9 @@ class OnSetAddTaskActor1State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OnSetAddTaskActor1State(); static_cast(this)->destroy(); return 0; } - #line 13145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~OnSetAddTaskActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -13152,9 +13138,9 @@ class OnSetAddTaskActor1State { } int a_body1cont2(Void && _,int loopDepth) { - #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OnSetAddTaskActor1State(); static_cast(this)->destroy(); return 0; } - #line 13157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~OnSetAddTaskActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -13225,22 +13211,22 @@ class OnSetAddTaskActor1State { fdb_probe_actor_exit("onSetAddTask", reinterpret_cast(this), 1); } - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskFuture; - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference task; - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" KeyRef validationKey; - #line 13238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via onSetAddTask() - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class OnSetAddTaskActor1 final : public Actor, public ActorCallback< OnSetAddTaskActor1, 0, Optional >, public ActorCallback< OnSetAddTaskActor1, 1, Void >, public FastAllocated, public OnSetAddTaskActor1State { - #line 13243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -13250,9 +13236,9 @@ class OnSetAddTaskActor1 final : public Actor, public ActorCallback< OnSet #pragma clang diagnostic pop friend struct ActorCallback< OnSetAddTaskActor1, 0, Optional >; friend struct ActorCallback< OnSetAddTaskActor1, 1, Void >; - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" OnSetAddTaskActor1(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture,Reference const& task,KeyRef const& validationKey) - #line 13255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), OnSetAddTaskActor1State(tr, taskBucket, taskFuture, task, validationKey) { @@ -13276,14 +13262,14 @@ friend struct ActorCallback< OnSetAddTaskActor1, 1, Void >; } }; - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future onSetAddTask( Reference const& tr, Reference const& taskBucket, Reference const& taskFuture, Reference const& task, KeyRef const& validationKey ) { - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new OnSetAddTaskActor1(tr, taskBucket, taskFuture, task, validationKey)); - #line 13283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" static Future onSetAddTask(Reference tr, Reference taskBucket, @@ -13299,24 +13285,24 @@ friend struct ActorCallback< OnSetAddTaskActor1, 1, Void >; return onSetAddTask(tr, taskBucket, taskFuture, task); } - #line 13302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" // This generated class is to be used only via joinedFuture() - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class JoinedFutureActorState { - #line 13308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" JoinedFutureActorState(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture) - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : tr(tr), - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskBucket(taskBucket), - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture(taskFuture) - #line 13319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("joinedFuture", reinterpret_cast(this)); @@ -13329,24 +13315,24 @@ class JoinedFutureActorState { int a_body1(int loopDepth=0) { try { - #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" taskFuture->futureBucket->setOptions(tr); - #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" std::vector> vectorFuture; - #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" future = taskFuture->futureBucket->future(tr); - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" vectorFuture.push_back(future); - #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture __when_expr_0 = join(tr, taskBucket, taskFuture, vectorFuture); - #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 13349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13367,9 +13353,9 @@ class JoinedFutureActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(future); this->~JoinedFutureActorState(); static_cast(this)->destroy(); return 0; } - #line 13372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(future)); // state_var_RVO this->~JoinedFutureActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -13379,9 +13365,9 @@ class JoinedFutureActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(future); this->~JoinedFutureActorState(); static_cast(this)->destroy(); return 0; } - #line 13384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(future)); // state_var_RVO this->~JoinedFutureActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -13452,20 +13438,20 @@ class JoinedFutureActorState { fdb_probe_actor_exit("joinedFuture", reinterpret_cast(this), 0); } - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference tr; - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskBucket; - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference taskFuture; - #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Reference future; - #line 13463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via joinedFuture() - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class JoinedFutureActor final : public Actor>, public ActorCallback< JoinedFutureActor, 0, Void >, public FastAllocated, public JoinedFutureActorState { - #line 13468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -13474,9 +13460,9 @@ class JoinedFutureActor final : public Actor>, public Acto void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< JoinedFutureActor, 0, Void >; - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" JoinedFutureActor(Reference const& tr,Reference const& taskBucket,Reference const& taskFuture) - #line 13479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor>(), JoinedFutureActorState(tr, taskBucket, taskFuture) { @@ -13499,14 +13485,14 @@ friend struct ActorCallback< JoinedFutureActor, 0, Void >; } }; - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] static Future> joinedFuture( Reference const& tr, Reference const& taskBucket, Reference const& taskFuture ) { - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future>(new JoinedFutureActor(tr, taskBucket, taskFuture)); - #line 13506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" }; TaskFuture::TaskFuture() {} @@ -13517,14 +13503,14 @@ TaskFuture::TaskFuture(const Reference bucket, Key k) : futureBuck } prefix = futureBucket->prefix.get(key); - blocks = prefix.get(LiteralStringRef("bl")); - callbacks = prefix.get(LiteralStringRef("cb")); + blocks = prefix.get("bl"_sr); + callbacks = prefix.get("cb"_sr); } TaskFuture::~TaskFuture() {} void TaskFuture::addBlock(Reference tr, StringRef block_id) { - tr->set(blocks.pack(block_id), LiteralStringRef("")); + tr->set(blocks.pack(block_id), ""_sr); } Future TaskFuture::set(Reference tr, Reference taskBucket) { @@ -13578,23 +13564,23 @@ Future> TaskFuture::joinedFuture(Reference::addRef(this)); } - #line 13581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" namespace { // This generated class is to be used only via getCompletionKey() - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" template - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class GetCompletionKeyActorState { - #line 13588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" GetCompletionKeyActorState(TaskCompletionKey* const& self,Future> const& f) - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" : self(self), - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" f(f) - #line 13597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" { fdb_probe_actor_create("getCompletionKey", reinterpret_cast(this)); @@ -13607,16 +13593,16 @@ class GetCompletionKeyActorState { int a_body1(int loopDepth=0) { try { - #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" StrictFuture> __when_expr_0 = f; - #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 13614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 13619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -13637,13 +13623,13 @@ class GetCompletionKeyActorState { } int a_body1cont1(Reference const& taskFuture,int loopDepth) { - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" self->joinFuture.clear(); - #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" self->key = taskFuture->key; - #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(self->key.get()); this->~GetCompletionKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 13646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(self->key.get()); this->~GetCompletionKeyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -13653,13 +13639,13 @@ class GetCompletionKeyActorState { } int a_body1cont1(Reference && taskFuture,int loopDepth) { - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" self->joinFuture.clear(); - #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" self->key = taskFuture->key; - #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(self->key.get()); this->~GetCompletionKeyActorState(); static_cast(this)->destroy(); return 0; } - #line 13662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" new (&static_cast(this)->SAV< Key >::value()) Key(self->key.get()); this->~GetCompletionKeyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -13730,16 +13716,16 @@ class GetCompletionKeyActorState { fdb_probe_actor_exit("getCompletionKey", reinterpret_cast(this), 0); } - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" TaskCompletionKey* self; - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Future> f; - #line 13737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" }; // This generated class is to be used only via getCompletionKey() - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" class GetCompletionKeyActor final : public Actor, public ActorCallback< GetCompletionKeyActor, 0, Reference >, public FastAllocated, public GetCompletionKeyActorState { - #line 13742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -13748,9 +13734,9 @@ class GetCompletionKeyActor final : public Actor, public ActorCallback< Get void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetCompletionKeyActor, 0, Reference >; - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" GetCompletionKeyActor(TaskCompletionKey* const& self,Future> const& f) - #line 13753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" : Actor(), GetCompletionKeyActorState(self, f) { @@ -13774,14 +13760,14 @@ friend struct ActorCallback< GetCompletionKeyActor, 0, Reference >; } }; } - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" [[nodiscard]] Future getCompletionKey( TaskCompletionKey* const& self, Future> const& f ) { - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" return Future(new GetCompletionKeyActor(self, f)); - #line 13781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" + #line 13767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.g.cpp" } -#line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" +#line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TaskBucket.actor.cpp" Future TaskCompletionKey::get(Reference tr, Reference taskBucket) { ASSERT(key.present() == (joinFuture.getPtr() == nullptr)); diff --git a/src/fdbclient/Tenant.cpp b/src/fdbclient/Tenant.cpp index 5a651b4..ff49b90 100644 --- a/src/fdbclient/Tenant.cpp +++ b/src/fdbclient/Tenant.cpp @@ -18,39 +18,235 @@ * limitations under the License. */ +#include "fdbclient/NativeAPI.actor.h" #include "fdbclient/SystemData.h" #include "fdbclient/Tenant.h" +#include "fdbrpc/TenantInfo.h" +#include "flow/BooleanParam.h" +#include "flow/IRandom.h" +#include "libb64/decode.h" +#include "libb64/encode.h" +#include "flow/ApiVersion.h" #include "flow/UnitTest.h" +namespace TenantAPI { + +KeyRef idToPrefix(Arena& p, int64_t id) { + int64_t swapped = bigEndian64(id); + return StringRef(p, reinterpret_cast(&swapped), TenantAPI::PREFIX_SIZE); +} + +Key idToPrefix(int64_t id) { + Arena p(TenantAPI::PREFIX_SIZE); + return Key(idToPrefix(p, id), p); +} + +int64_t prefixToId(KeyRef prefix, EnforceValidTenantId enforceValidTenantId) { + ASSERT(prefix.size() == TenantAPI::PREFIX_SIZE); + int64_t id = *reinterpret_cast(prefix.begin()); + id = bigEndian64(id); + if (enforceValidTenantId) { + ASSERT(id >= 0); + } else if (id < 0) { + return TenantInfo::INVALID_TENANT; + } + return id; +} + +KeyRangeRef clampRangeToTenant(KeyRangeRef range, TenantInfo const& tenantInfo, Arena& arena) { + if (tenantInfo.hasTenant()) { + return KeyRangeRef(range.begin.startsWith(tenantInfo.prefix.get()) ? range.begin : tenantInfo.prefix.get(), + range.end.startsWith(tenantInfo.prefix.get()) + ? range.end + : allKeys.end.withPrefix(tenantInfo.prefix.get(), arena)); + } else { + return range; + } +} + +bool withinSingleTenant(KeyRangeRef const& range) { + if (range.begin >= "\x80"_sr || range.begin.size() < TenantAPI::PREFIX_SIZE) { + return false; + } + auto tRange = prefixRange(range.begin.substr(0, TenantAPI::PREFIX_SIZE)); + return tRange.contains(range); +} + +std::string tenantLockStateToString(TenantLockState tenantState) { + switch (tenantState) { + case TenantLockState::UNLOCKED: + return "unlocked"; + case TenantLockState::READ_ONLY: + return "read only"; + case TenantLockState::LOCKED: + return "locked"; + default: + UNREACHABLE(); + } +} + +TenantLockState stringToTenantLockState(std::string stateStr) { + std::transform(stateStr.begin(), stateStr.end(), stateStr.begin(), [](unsigned char c) { return std::tolower(c); }); + if (stateStr == "unlocked") { + return TenantLockState::UNLOCKED; + } else if (stateStr == "read only") { + return TenantLockState::READ_ONLY; + } else if (stateStr == "locked") { + return TenantLockState::LOCKED; + } + + UNREACHABLE(); +} +} // namespace TenantAPI + +json_spirit::mObject binaryToJson(StringRef bytes) { + json_spirit::mObject obj; + std::string encodedBytes = base64::encoder::from_string(bytes.toString()); + // Remove trailing newline + encodedBytes.resize(encodedBytes.size() - 1); + + obj["base64"] = encodedBytes; + obj["printable"] = printable(bytes); + + return obj; +} + +TenantMapEntry::TenantMapEntry() {} +TenantMapEntry::TenantMapEntry(int64_t id, TenantName tenantName) : tenantName(tenantName) { + setId(id); +} +TenantMapEntry::TenantMapEntry(int64_t id, TenantName tenantName, Optional tenantGroup) + : tenantName(tenantName), tenantGroup(tenantGroup) { + setId(id); +} + +void TenantMapEntry::setId(int64_t id) { + ASSERT(id >= 0); + this->id = id; + prefix = TenantAPI::idToPrefix(id); +} + +std::string TenantMapEntry::toJson() const { + json_spirit::mObject tenantEntry; + tenantEntry["id"] = id; + tenantEntry["name"] = binaryToJson(tenantName); + tenantEntry["prefix"] = binaryToJson(prefix); + + if (tenantGroup.present()) { + tenantEntry["tenant_group"] = binaryToJson(tenantGroup.get()); + } + + tenantEntry["lock_state"] = TenantAPI::tenantLockStateToString(tenantLockState); + if (tenantLockId.present()) { + tenantEntry["lock_id"] = tenantLockId.get().toString(); + } + + return json_spirit::write_string(json_spirit::mValue(tenantEntry)); +} + +bool TenantMapEntry::matchesConfiguration(TenantMapEntry const& other) const { + return tenantGroup == other.tenantGroup && tenantLockState == other.tenantLockState && + tenantLockId == other.tenantLockId; +} + +void TenantMapEntry::configure(Standalone parameter, Optional value) { + if (parameter == "tenant_group"_sr) { + tenantGroup = value; + } else { + TraceEvent(SevWarnAlways, "UnknownTenantConfigurationParameter").detail("Parameter", parameter); + throw invalid_tenant_configuration(); + } +} + +bool TenantMapEntry::operator==(TenantMapEntry const& other) const { + return id == other.id && tenantName == other.tenantName && tenantLockState == other.tenantLockState && + tenantLockId == other.tenantLockId && tenantGroup == other.tenantGroup && + configurationSequenceNum == other.configurationSequenceNum; +} + +bool TenantMapEntry::operator!=(TenantMapEntry const& other) const { + return !(*this == other); +} + +json_spirit::mObject TenantGroupEntry::toJson() const { + json_spirit::mObject tenantGroupEntry; + // No fields currently + return tenantGroupEntry; +} + +bool TenantGroupEntry::operator==(TenantGroupEntry const& other) const { + return true; +} +bool TenantGroupEntry::operator!=(TenantGroupEntry const& other) const { + return !(*this == other); +} + +bool TenantTombstoneCleanupData::operator==(TenantTombstoneCleanupData const& other) const { + return tombstonesErasedThrough == other.tombstonesErasedThrough && + nextTombstoneEraseVersion == other.nextTombstoneEraseVersion && + nextTombstoneEraseId == other.nextTombstoneEraseId; +} + +bool TenantTombstoneCleanupData::operator!=(TenantTombstoneCleanupData const& other) const { + return !(*this == other); +} + +TenantMetadataSpecification& TenantMetadata::instance() { + static TenantMetadataSpecification _instance = TenantMetadataSpecification("\xff/"_sr); + return _instance; +} + +Key TenantMetadata::tenantMapPrivatePrefix() { + static Key _prefix = "\xff"_sr.withSuffix(tenantMap().subspace.begin); + return _prefix; +} + +KeyBackedProperty& TenantMetadata::tenantIdPrefix() { + static KeyBackedProperty instance(TenantMetadata::instance().subspace.withSuffix("idPrefix"_sr)); + return instance; +} + +TEST_CASE("/fdbclient/libb64/base64decoder") { + Standalone buf = makeString(100); + for (int i = 0; i < 1000; ++i) { + int length = deterministicRandom()->randomInt(0, 100); + deterministicRandom()->randomBytes(mutateString(buf), length); + + StringRef str = buf.substr(0, length); + std::string encodedStr = base64::encoder::from_string(str.toString()); + // Remove trailing newline + encodedStr.resize(encodedStr.size() - 1); + + std::string decodedStr = base64::decoder::from_string(encodedStr); + ASSERT(decodedStr == str.toString()); + } + + return Void(); +} + TEST_CASE("/fdbclient/TenantMapEntry/Serialization") { - TenantMapEntry entry1(1, ""_sr); + TenantMapEntry entry1(1, "name"_sr); ASSERT(entry1.prefix == "\x00\x00\x00\x00\x00\x00\x00\x01"_sr); - TenantMapEntry entry2 = decodeTenantEntry(encodeTenantEntry(entry1)); + TenantMapEntry entry2 = TenantMapEntry::decode(entry1.encode()); ASSERT(entry1.id == entry2.id && entry1.prefix == entry2.prefix); - TenantMapEntry entry3(std::numeric_limits::max(), "foo"_sr); - ASSERT(entry3.prefix == "foo\xfe\xff\xff\xff\xff\xff\xff\xff"_sr); - TenantMapEntry entry4 = decodeTenantEntry(encodeTenantEntry(entry3)); + TenantMapEntry entry3(std::numeric_limits::max(), "name"_sr); + ASSERT(entry3.prefix == "\x7f\xff\xff\xff\xff\xff\xff\xff"_sr); + TenantMapEntry entry4 = TenantMapEntry::decode(entry3.encode()); ASSERT(entry3.id == entry4.id && entry3.prefix == entry4.prefix); for (int i = 0; i < 100; ++i) { int bits = deterministicRandom()->randomInt(1, 64); - int64_t min = bits == 1 ? 0 : (1 << (bits - 1)); - int64_t maxPlusOne = std::min(1 << bits, std::numeric_limits::max()); + int64_t min = bits == 1 ? 0 : (UINT64_C(1) << (bits - 1)); + int64_t maxPlusOne = std::min(UINT64_C(1) << bits, std::numeric_limits::max()); int64_t id = deterministicRandom()->randomInt64(min, maxPlusOne); - int subspaceLength = deterministicRandom()->randomInt(0, 20); - Standalone subspace = makeString(subspaceLength); - generateRandomData(mutateString(subspace), subspaceLength); - - TenantMapEntry entry(id, subspace); + TenantMapEntry entry(id, "name"_sr); int64_t bigEndianId = bigEndian64(id); - ASSERT(entry.id == id && entry.prefix.startsWith(subspace) && - entry.prefix.endsWith(StringRef(reinterpret_cast(&bigEndianId), 8)) && - entry.prefix.size() == subspaceLength + 8); + ASSERT(entry.id == id && entry.prefix == StringRef(reinterpret_cast(&bigEndianId), 8)); - TenantMapEntry decodedEntry = decodeTenantEntry(encodeTenantEntry(entry)); - ASSERT(decodedEntry.id = entry.id && decodedEntry.prefix == entry.prefix); + TenantMapEntry decodedEntry = TenantMapEntry::decode(entry.encode()); + ASSERT(decodedEntry.id == entry.id && decodedEntry.prefix == entry.prefix); } return Void(); diff --git a/src/fdbclient/Tenant.h b/src/fdbclient/Tenant.h deleted file mode 100644 index f7e69e6..0000000 --- a/src/fdbclient/Tenant.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Tenant.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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. - */ - -#ifndef FDBCLIENT_TENANT_H -#define FDBCLIENT_TENANT_H -#pragma once - -#include "fdbclient/FDBTypes.h" -#include "fdbclient/VersionedMap.h" -#include "flow/flat_buffers.h" - -typedef StringRef TenantNameRef; -typedef Standalone TenantName; - -struct TenantMapEntry { - constexpr static FileIdentifier file_identifier = 12247338; - - static Key idToPrefix(int64_t id) { - int64_t swapped = bigEndian64(id); - return StringRef(reinterpret_cast(&swapped), 8); - } - - static int64_t prefixToId(KeyRef prefix) { - ASSERT(prefix.size() == 8); - int64_t id = *reinterpret_cast(prefix.begin()); - id = bigEndian64(id); - ASSERT(id >= 0); - return id; - } - - int64_t id; - Key prefix; - - constexpr static int ROOT_PREFIX_SIZE = sizeof(id); - -private: - void initPrefix(KeyRef subspace) { - ASSERT(id >= 0); - prefix = makeString(8 + subspace.size()); - uint8_t* data = mutateString(prefix); - memcpy(data, subspace.begin(), subspace.size()); - int64_t swapped = bigEndian64(id); - memcpy(data + subspace.size(), &swapped, 8); - } - -public: - TenantMapEntry() : id(-1) {} - TenantMapEntry(int64_t id, KeyRef subspace) : id(id) { initPrefix(subspace); } - - template - void serialize(Ar& ar) { - KeyRef subspace; - if (ar.isDeserializing) { - serializer(ar, id, subspace); - if (id >= 0) { - initPrefix(subspace); - } - } else { - ASSERT(prefix.size() >= 8 || (prefix.empty() && id == -1)); - if (!prefix.empty()) { - subspace = prefix.substr(0, prefix.size() - 8); - } - serializer(ar, id, subspace); - } - } -}; - -typedef VersionedMap TenantMap; -typedef VersionedMap TenantPrefixIndex; - -#endif \ No newline at end of file diff --git a/src/fdbclient/TenantManagement.actor.cpp b/src/fdbclient/TenantManagement.actor.cpp new file mode 100644 index 0000000..d0c01de --- /dev/null +++ b/src/fdbclient/TenantManagement.actor.cpp @@ -0,0 +1,105 @@ +/* + * TenantManagement.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include +#include +#include "fdbclient/Atomic.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/TenantManagement.actor.h" +#include "fdbclient/Tuple.h" +#include "flow/Trace.h" +#include "flow/actorcompiler.h" // has to be last include + +namespace TenantAPI { + +TenantMode tenantModeForClusterType(ClusterType clusterType, TenantMode tenantMode) { + if (clusterType == ClusterType::METACLUSTER_MANAGEMENT) { + return TenantMode::DISABLED; + } else if (clusterType == ClusterType::METACLUSTER_DATA) { + return TenantMode::REQUIRED; + } else { + return tenantMode; + } +} + +int64_t extractTenantIdFromMutation(MutationRef m) { + ASSERT(!isSystemKey(m.param1)); + + if (isSingleKeyMutation((MutationRef::Type)m.type)) { + // The first 8 bytes of the key of this OP is also an 8-byte number + if (m.type == MutationRef::SetVersionstampedKey && m.param1.size() >= 4) { + // when the timestamp overlap with first 8 bytes + if (parseVersionstampOffset(m.param1) < 8) { + return TenantInfo::INVALID_TENANT; + } + } + } else { + // Assumes clear range mutations are split on tenant boundaries + ASSERT_EQ(m.type, MutationRef::Type::ClearRange); + } + + return extractTenantIdFromKeyRef(m.param1); +} + +int64_t extractTenantIdFromKeyRef(StringRef s) { + if (s.size() < TenantAPI::PREFIX_SIZE) { + return TenantInfo::INVALID_TENANT; + } + // Parse mutation key to determine tenant prefix + StringRef prefix = s.substr(0, TenantAPI::PREFIX_SIZE); + return TenantAPI::prefixToId(prefix, EnforceValidTenantId::False); +} + +bool tenantMapChanging(MutationRef const& mutation, KeyRangeRef const& tenantMapRange) { + if (isSingleKeyMutation((MutationRef::Type)mutation.type) && mutation.param1.startsWith(tenantMapRange.begin)) { + return true; + } else if (mutation.type == MutationRef::ClearRange && + tenantMapRange.intersects(KeyRangeRef(mutation.param1, mutation.param2))) { + return true; + } + return false; +} + +// validates whether the the ID created by adding delta to baseID is a valid ID in the same tenant prefix +int64_t computeNextTenantId(int64_t baseId, int64_t delta) { + if ((baseId & 0xFFFFFFFFFFFF) + delta > 0xFFFFFFFFFFFF) { + TraceEvent(g_network->isSimulated() ? SevWarnAlways : SevError, "NoMoreTenantIds") + .detail("LastTenantId", baseId) + .detail("TenantIdPrefix", getTenantIdPrefix(baseId)); + throw cluster_no_capacity(); + } + + return baseId + delta; +} + +// returns the maximum allowable tenant id in which the 2 byte prefix is not overriden +int64_t getMaxAllowableTenantId(int64_t curTenantId) { + // The maximum tenant id allowed is 1 for the first 48 bits (6 bytes) with the first 16 bits (2 bytes) being the + // tenant prefix + int64_t maxTenantId = curTenantId | 0xFFFFFFFFFFFFLL; + ASSERT(maxTenantId > 0); + return maxTenantId; +} + +int64_t getTenantIdPrefix(int64_t tenantId) { + return tenantId >> 48; +} + +} // namespace TenantAPI diff --git a/src/fdbclient/TenantManagement.actor.g.cpp b/src/fdbclient/TenantManagement.actor.g.cpp new file mode 100644 index 0000000..bc1df39 --- /dev/null +++ b/src/fdbclient/TenantManagement.actor.g.cpp @@ -0,0 +1,107 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TenantManagement.actor.cpp" +/* + * TenantManagement.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include +#include +#include "fdbclient/Atomic.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/TenantManagement.actor.h" +#include "fdbclient/Tuple.h" +#include "flow/Trace.h" +#include "flow/actorcompiler.h" // has to be last include + +namespace TenantAPI { + +TenantMode tenantModeForClusterType(ClusterType clusterType, TenantMode tenantMode) { + if (clusterType == ClusterType::METACLUSTER_MANAGEMENT) { + return TenantMode::DISABLED; + } else if (clusterType == ClusterType::METACLUSTER_DATA) { + return TenantMode::REQUIRED; + } else { + return tenantMode; + } +} + +int64_t extractTenantIdFromMutation(MutationRef m) { + ASSERT(!isSystemKey(m.param1)); + + if (isSingleKeyMutation((MutationRef::Type)m.type)) { + // The first 8 bytes of the key of this OP is also an 8-byte number + if (m.type == MutationRef::SetVersionstampedKey && m.param1.size() >= 4) { + // when the timestamp overlap with first 8 bytes + if (parseVersionstampOffset(m.param1) < 8) { + return TenantInfo::INVALID_TENANT; + } + } + } else { + // Assumes clear range mutations are split on tenant boundaries + ASSERT_EQ(m.type, MutationRef::Type::ClearRange); + } + + return extractTenantIdFromKeyRef(m.param1); +} + +int64_t extractTenantIdFromKeyRef(StringRef s) { + if (s.size() < TenantAPI::PREFIX_SIZE) { + return TenantInfo::INVALID_TENANT; + } + // Parse mutation key to determine tenant prefix + StringRef prefix = s.substr(0, TenantAPI::PREFIX_SIZE); + return TenantAPI::prefixToId(prefix, EnforceValidTenantId::False); +} + +bool tenantMapChanging(MutationRef const& mutation, KeyRangeRef const& tenantMapRange) { + if (isSingleKeyMutation((MutationRef::Type)mutation.type) && mutation.param1.startsWith(tenantMapRange.begin)) { + return true; + } else if (mutation.type == MutationRef::ClearRange && + tenantMapRange.intersects(KeyRangeRef(mutation.param1, mutation.param2))) { + return true; + } + return false; +} + +// validates whether the the ID created by adding delta to baseID is a valid ID in the same tenant prefix +int64_t computeNextTenantId(int64_t baseId, int64_t delta) { + if ((baseId & 0xFFFFFFFFFFFF) + delta > 0xFFFFFFFFFFFF) { + TraceEvent(g_network->isSimulated() ? SevWarnAlways : SevError, "NoMoreTenantIds") + .detail("LastTenantId", baseId) + .detail("TenantIdPrefix", getTenantIdPrefix(baseId)); + throw cluster_no_capacity(); + } + + return baseId + delta; +} + +// returns the maximum allowable tenant id in which the 2 byte prefix is not overriden +int64_t getMaxAllowableTenantId(int64_t curTenantId) { + // The maximum tenant id allowed is 1 for the first 48 bits (6 bytes) with the first 16 bits (2 bytes) being the + // tenant prefix + int64_t maxTenantId = curTenantId | 0xFFFFFFFFFFFFLL; + ASSERT(maxTenantId > 0); + return maxTenantId; +} + +int64_t getTenantIdPrefix(int64_t tenantId) { + return tenantId >> 48; +} + +} // namespace TenantAPI diff --git a/src/fdbclient/ThreadSafeTransaction.cpp b/src/fdbclient/ThreadSafeTransaction.cpp index f2afbc5..cc4f464 100644 --- a/src/fdbclient/ThreadSafeTransaction.cpp +++ b/src/fdbclient/ThreadSafeTransaction.cpp @@ -20,11 +20,14 @@ #include "fdbclient/BlobGranuleFiles.h" #include "fdbclient/ClusterConnectionFile.h" +#include "fdbclient/ClusterConnectionMemoryRecord.h" +#include "fdbclient/CoordinationInterface.h" #include "fdbclient/ThreadSafeTransaction.h" #include "fdbclient/DatabaseContext.h" #include "fdbclient/versions.h" #include "fdbclient/GenericManagementAPI.actor.h" #include "fdbclient/NativeAPI.actor.h" +#include "flow/Arena.h" #include "flow/ProtocolVersion.h" // Users of ThreadSafeTransaction might share Reference between different threads as long as they don't @@ -53,8 +56,8 @@ Reference ThreadSafeDatabase::openTenant(TenantNameRef tenantName) { } Reference ThreadSafeDatabase::createTransaction() { - auto type = isConfigDB ? ISingleThreadTransaction::Type::SIMPLE_CONFIG : ISingleThreadTransaction::Type::RYW; - return Reference(new ThreadSafeTransaction(db, type, Optional())); + auto type = isConfigDB ? ISingleThreadTransaction::Type::PAXOS_CONFIG : ISingleThreadTransaction::Type::RYW; + return Reference(new ThreadSafeTransaction(db, type, Optional(), nullptr)); } void ThreadSafeDatabase::setOption(FDBDatabaseOptions::Option option, Optional value) { @@ -86,6 +89,7 @@ ThreadFuture ThreadSafeDatabase::rebootWorker(const StringRef& address, DatabaseContext* db = this->db; Key addressKey = address; return onMainThread([db, addressKey, check, duration]() -> Future { + db->checkDeferredError(); return db->rebootWorker(addressKey, check, duration); }); } @@ -93,14 +97,20 @@ ThreadFuture ThreadSafeDatabase::rebootWorker(const StringRef& address, ThreadFuture ThreadSafeDatabase::forceRecoveryWithDataLoss(const StringRef& dcid) { DatabaseContext* db = this->db; Key dcidKey = dcid; - return onMainThread([db, dcidKey]() -> Future { return db->forceRecoveryWithDataLoss(dcidKey); }); + return onMainThread([db, dcidKey]() -> Future { + db->checkDeferredError(); + return db->forceRecoveryWithDataLoss(dcidKey); + }); } ThreadFuture ThreadSafeDatabase::createSnapshot(const StringRef& uid, const StringRef& snapshot_command) { DatabaseContext* db = this->db; Key snapUID = uid; Key cmd = snapshot_command; - return onMainThread([db, snapUID, cmd]() -> Future { return db->createSnapshot(snapUID, cmd); }); + return onMainThread([db, snapUID, cmd]() -> Future { + db->checkDeferredError(); + return db->createSnapshot(snapUID, cmd); + }); } ThreadFuture ThreadSafeDatabase::createSharedState() { @@ -124,37 +134,103 @@ double ThreadSafeDatabase::getMainThreadBusyness() { // Note: this will never return if the server is running a protocol from FDB 5.0 or older ThreadFuture ThreadSafeDatabase::getServerProtocol(Optional expectedVersion) { DatabaseContext* db = this->db; - return onMainThread( - [db, expectedVersion]() -> Future { return db->getClusterProtocol(expectedVersion); }); + return onMainThread([db, expectedVersion]() -> Future { + db->checkDeferredError(); + return db->getClusterProtocol(expectedVersion); + }); } ThreadFuture ThreadSafeDatabase::purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) { DatabaseContext* db = this->db; KeyRange range = keyRange; return onMainThread([db, range, purgeVersion, force]() -> Future { - return db->purgeBlobGranules(range, purgeVersion, force); + db->checkDeferredError(); + return db->purgeBlobGranules(range, purgeVersion, {}, force); }); } ThreadFuture ThreadSafeDatabase::waitPurgeGranulesComplete(const KeyRef& purgeKey) { DatabaseContext* db = this->db; Key key = purgeKey; - return onMainThread([db, key]() -> Future { return db->waitPurgeGranulesComplete(key); }); + return onMainThread([db, key]() -> Future { + db->checkDeferredError(); + return db->waitPurgeGranulesComplete(key); + }); } -ThreadSafeDatabase::ThreadSafeDatabase(std::string connFilename, int apiVersion) { - ClusterConnectionFile* connFile = - new ClusterConnectionFile(ClusterConnectionFile::lookupClusterFileName(connFilename).first); +ThreadFuture ThreadSafeDatabase::blobbifyRange(const KeyRangeRef& keyRange) { + DatabaseContext* db = this->db; + KeyRange range = keyRange; + return onMainThread([=]() -> Future { + db->checkDeferredError(); + return db->blobbifyRange(range); + }); +} +ThreadFuture ThreadSafeDatabase::blobbifyRangeBlocking(const KeyRangeRef& keyRange) { + DatabaseContext* db = this->db; + KeyRange range = keyRange; + return onMainThread([=]() -> Future { + db->checkDeferredError(); + return db->blobbifyRangeBlocking(range); + }); +} + +ThreadFuture ThreadSafeDatabase::unblobbifyRange(const KeyRangeRef& keyRange) { + DatabaseContext* db = this->db; + KeyRange range = keyRange; + return onMainThread([=]() -> Future { + db->checkDeferredError(); + return db->unblobbifyRange(range); + }); +} + +ThreadFuture>> ThreadSafeDatabase::listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) { + DatabaseContext* db = this->db; + KeyRange range = keyRange; + return onMainThread([=]() -> Future>> { + db->checkDeferredError(); + return db->listBlobbifiedRanges(range, rangeLimit); + }); +} + +ThreadFuture ThreadSafeDatabase::verifyBlobRange(const KeyRangeRef& keyRange, Optional version) { + DatabaseContext* db = this->db; + KeyRange range = keyRange; + return onMainThread([=]() -> Future { + db->checkDeferredError(); + return db->verifyBlobRange(range, version); + }); +} + +ThreadFuture ThreadSafeDatabase::flushBlobRange(const KeyRangeRef& keyRange, + bool compact, + Optional version) { + DatabaseContext* db = this->db; + KeyRange range = keyRange; + return onMainThread([=]() -> Future { + db->checkDeferredError(); + return db->flushBlobRange(range, compact, version); + }); +} + +ThreadSafeDatabase::ThreadSafeDatabase(ConnectionRecordType connectionRecordType, + std::string connectionRecordString, + int apiVersion) { // Allocate memory for the Database from this thread (so the pointer is known for subsequent method calls) // but run its constructor on the main thread DatabaseContext* db = this->db = DatabaseContext::allocateOnForeignThread(); - onMainThreadVoid([db, connFile, apiVersion]() { + onMainThreadVoid([db, connectionRecordType, connectionRecordString, apiVersion]() { try { - Database::createDatabase( - Reference(connFile), apiVersion, IsInternal::False, LocalityData(), db) - .extractPtr(); + Reference connectionRecord = + connectionRecordType == ConnectionRecordType::FILE + ? Reference(ClusterConnectionFile::openOrDefault(connectionRecordString)) + : Reference( + new ClusterConnectionMemoryRecord(ClusterConnectionString(connectionRecordString))); + + Database::createDatabase(connectionRecord, apiVersion, IsInternal::False, LocalityData(), db).extractPtr(); } catch (Error& e) { new (db) DatabaseContext(e); } catch (...) { @@ -163,22 +239,128 @@ ThreadSafeDatabase::ThreadSafeDatabase(std::string connFilename, int apiVersion) }); } +ThreadFuture> ThreadSafeDatabase::getClientStatus() { + DatabaseContext* db = this->db; + return onMainThread([db] { return Future>(db->getClientStatus()); }); +} + ThreadSafeDatabase::~ThreadSafeDatabase() { DatabaseContext* db = this->db; onMainThreadVoid([db]() { db->delref(); }); } +ThreadSafeTenant::ThreadSafeTenant(Reference db, TenantName name) : db(db), name(name) { + Tenant* tenant = this->tenant = Tenant::allocateOnForeignThread(); + DatabaseContext* cx = db->db; + onMainThreadVoid([tenant, cx, name]() { + cx->addref(); + new (tenant) Tenant(Database(cx), name); + }); +} + Reference ThreadSafeTenant::createTransaction() { - auto type = db->isConfigDB ? ISingleThreadTransaction::Type::SIMPLE_CONFIG : ISingleThreadTransaction::Type::RYW; - return Reference(new ThreadSafeTransaction(db->db, type, name)); + auto type = db->isConfigDB ? ISingleThreadTransaction::Type::PAXOS_CONFIG : ISingleThreadTransaction::Type::RYW; + return Reference(new ThreadSafeTransaction(db->db, type, name, tenant)); +} + +ThreadFuture ThreadSafeTenant::getId() { + Tenant* tenant = this->tenant; + return onMainThread([tenant]() -> Future { return tenant->getIdFuture(); }); +} + +ThreadFuture ThreadSafeTenant::purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) { + DatabaseContext* db = this->db->db; + Tenant* tenantPtr = this->tenant; + KeyRange range = keyRange; + return onMainThread([db, range, purgeVersion, tenantPtr, force]() -> Future { + db->addref(); + return db->purgeBlobGranules(range, purgeVersion, Reference::addRef(tenantPtr), force); + }); +} + +ThreadFuture ThreadSafeTenant::waitPurgeGranulesComplete(const KeyRef& purgeKey) { + DatabaseContext* db = this->db->db; + Key key = purgeKey; + return onMainThread([db, key]() -> Future { + db->checkDeferredError(); + return db->waitPurgeGranulesComplete(key); + }); +} + +ThreadFuture ThreadSafeTenant::blobbifyRange(const KeyRangeRef& keyRange) { + DatabaseContext* db = this->db->db; + KeyRange range = keyRange; + return onMainThread([=]() -> Future { + db->checkDeferredError(); + db->addref(); + return db->blobbifyRange(range, Reference::addRef(tenant)); + }); +} + +ThreadFuture ThreadSafeTenant::blobbifyRangeBlocking(const KeyRangeRef& keyRange) { + DatabaseContext* db = this->db->db; + KeyRange range = keyRange; + return onMainThread([=]() -> Future { + db->checkDeferredError(); + db->addref(); + return db->blobbifyRangeBlocking(range, Reference::addRef(tenant)); + }); +} + +ThreadFuture ThreadSafeTenant::unblobbifyRange(const KeyRangeRef& keyRange) { + DatabaseContext* db = this->db->db; + KeyRange range = keyRange; + return onMainThread([=]() -> Future { + db->checkDeferredError(); + db->addref(); + return db->unblobbifyRange(range, Reference::addRef(tenant)); + }); } -ThreadSafeTenant::~ThreadSafeTenant() {} +ThreadFuture>> ThreadSafeTenant::listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) { + DatabaseContext* db = this->db->db; + KeyRange range = keyRange; + return onMainThread([=]() -> Future>> { + db->checkDeferredError(); + db->addref(); + return db->listBlobbifiedRanges(range, rangeLimit, Reference::addRef(tenant)); + }); +} + +ThreadFuture ThreadSafeTenant::verifyBlobRange(const KeyRangeRef& keyRange, Optional version) { + DatabaseContext* db = this->db->db; + KeyRange range = keyRange; + return onMainThread([=]() -> Future { + db->checkDeferredError(); + db->addref(); + return db->verifyBlobRange(range, version, Reference::addRef(tenant)); + }); +} + +ThreadFuture ThreadSafeTenant::flushBlobRange(const KeyRangeRef& keyRange, + bool compact, + Optional version) { + DatabaseContext* db = this->db->db; + KeyRange range = keyRange; + return onMainThread([=]() -> Future { + db->checkDeferredError(); + db->addref(); + return db->flushBlobRange(range, compact, version, Reference::addRef(tenant)); + }); +} + +ThreadSafeTenant::~ThreadSafeTenant() { + Tenant* t = this->tenant; + if (t) + onMainThreadVoid([t]() { t->delref(); }); +} ThreadSafeTransaction::ThreadSafeTransaction(DatabaseContext* cx, ISingleThreadTransaction::Type type, - Optional tenant) - : tenantName(tenant), initialized(std::make_shared(false)) { + Optional tenantName, + Tenant* tenantPtr) + : tenantName(tenantName), initialized(std::make_shared(false)) { // Allocate memory for the transaction from this thread (so the pointer is known for subsequent method calls) // but run its constructor on the main thread @@ -189,19 +371,21 @@ ThreadSafeTransaction::ThreadSafeTransaction(DatabaseContext* cx, auto tr = this->tr = ISingleThreadTransaction::allocateOnForeignThread(type); auto init = this->initialized; // No deferred error -- if the construction of the RYW transaction fails, we have no where to put it - onMainThreadVoid([tr, cx, type, tenant, init]() { + onMainThreadVoid([tr, cx, type, tenantPtr, init]() { cx->addref(); - if (tenant.present()) { + Database db(cx); + if (tenantPtr) { + Reference tenant = Reference::addRef(tenantPtr); if (type == ISingleThreadTransaction::Type::RYW) { - new (tr) ReadYourWritesTransaction(Database(cx), tenant.get()); + new (tr) ReadYourWritesTransaction(db, tenant); } else { - tr->construct(Database(cx), tenant.get()); + tr->construct(db, tenant); } } else { if (type == ISingleThreadTransaction::Type::RYW) { - new (tr) ReadYourWritesTransaction(Database(cx)); + new (tr) ReadYourWritesTransaction(db); } else { - tr->construct(Database(cx)); + tr->construct(db); } } *init = true; @@ -338,13 +522,14 @@ ThreadFuture>> ThreadSafeTransaction::getAddre } ThreadFuture>> ThreadSafeTransaction::getBlobGranuleRanges( - const KeyRangeRef& keyRange) { + const KeyRangeRef& keyRange, + int rangeLimit) { ISingleThreadTransaction* tr = this->tr; KeyRange r = keyRange; - return onMainThread([tr, r]() -> Future>> { + return onMainThread([=]() -> Future>> { tr->checkDeferredError(); - return tr->getBlobGranuleRanges(r); + return tr->getBlobGranuleRanges(r, rangeLimit); }); } @@ -352,34 +537,53 @@ ThreadResult ThreadSafeTransaction::readBlobGranules(const KeyRange Version beginVersion, Optional readVersion, ReadBlobGranuleContext granule_context) { - // FIXME: prevent from calling this from another main thread! + // This should not be called directly, bypassMultiversionApi should not be set + return ThreadResult(unsupported_operation()); +} +ThreadFuture>> ThreadSafeTransaction::readBlobGranulesStart( + const KeyRangeRef& keyRange, + Version beginVersion, + Optional readVersion, + Version* readVersionOut) { ISingleThreadTransaction* tr = this->tr; KeyRange r = keyRange; - int64_t readVersionOut; - ThreadFuture>> getFilesFuture = onMainThread( - [tr, r, beginVersion, readVersion, &readVersionOut]() -> Future>> { + return onMainThread( + [tr, r, beginVersion, readVersion, readVersionOut]() -> Future>> { tr->checkDeferredError(); - return tr->readBlobGranules(r, beginVersion, readVersion, &readVersionOut); + return tr->readBlobGranules(r, beginVersion, readVersion, readVersionOut); }); +} - // FIXME: can this safely avoid another main thread jump? - getFilesFuture.blockUntilReadyCheckOnMainThread(); - - // propagate error to client - if (getFilesFuture.isError()) { - return ThreadResult(getFilesFuture.getError()); +ThreadResult ThreadSafeTransaction::readBlobGranulesFinish( + ThreadFuture>> startFuture, + const KeyRangeRef& keyRange, + Version beginVersion, + Version readVersion, + ReadBlobGranuleContext granuleContext) { + // do this work off of fdb network threads for performance! + Standalone> files = startFuture.get(); + GranuleMaterializeStats stats; + auto ret = loadAndMaterializeBlobGranules(files, keyRange, beginVersion, readVersion, granuleContext, stats); + if (!ret.isError()) { + ISingleThreadTransaction* tr = this->tr; + onMainThreadVoid([tr, stats]() { tr->addGranuleMaterializeStats(stats); }); } + return ret; +} - Standalone> files = getFilesFuture.get(); +ThreadFuture>> ThreadSafeTransaction::summarizeBlobGranules( + const KeyRangeRef& keyRange, + Optional summaryVersion, + int rangeLimit) { + ISingleThreadTransaction* tr = this->tr; + KeyRange r = keyRange; - // do this work off of fdb network threads for performance! - if (granule_context.debugNoMaterialize) { - return ThreadResult(blob_granule_not_materialized()); - } else { - return loadAndMaterializeBlobGranules(files, keyRange, beginVersion, readVersionOut, granule_context); - } + return onMainThread([=]() -> Future>> { + tr->checkDeferredError(); + return tr->summarizeBlobGranules(r, summaryVersion, rangeLimit); + }); } void ThreadSafeTransaction::addReadConflictRange(const KeyRangeRef& keys) { @@ -477,22 +681,50 @@ Version ThreadSafeTransaction::getCommittedVersion() { ThreadFuture ThreadSafeTransaction::getVersionVector() { ISingleThreadTransaction* tr = this->tr; - return onMainThread([tr]() -> Future { return tr->getVersionVector(); }); + return onMainThread([tr]() -> Future { + tr->checkDeferredError(); + return tr->getVersionVector(); + }); +} + +ThreadFuture ThreadSafeTransaction::getSpanContext() { + ISingleThreadTransaction* tr = this->tr; + return onMainThread([tr]() -> Future { + tr->checkDeferredError(); + return tr->getSpanContext(); + }); +} + +ThreadFuture ThreadSafeTransaction::getTagThrottledDuration() { + ISingleThreadTransaction* tr = this->tr; + return onMainThread([tr]() -> Future { + tr->checkDeferredError(); + return tr->getTagThrottledDuration(); + }); } -ThreadFuture ThreadSafeTransaction::getSpanID() { +ThreadFuture ThreadSafeTransaction::getTotalCost() { ISingleThreadTransaction* tr = this->tr; - return onMainThread([tr]() -> Future { return tr->getSpanID(); }); + return onMainThread([tr]() -> Future { + tr->checkDeferredError(); + return tr->getTotalCost(); + }); } ThreadFuture ThreadSafeTransaction::getApproximateSize() { ISingleThreadTransaction* tr = this->tr; - return onMainThread([tr]() -> Future { return tr->getApproximateSize(); }); + return onMainThread([tr]() -> Future { + tr->checkDeferredError(); + return tr->getApproximateSize(); + }); } ThreadFuture> ThreadSafeTransaction::getVersionstamp() { ISingleThreadTransaction* tr = this->tr; - return onMainThread([tr]() -> Future> { return tr->getVersionstamp(); }); + return onMainThread([tr]() -> Future> { + tr->checkDeferredError(); + return tr->getVersionstamp(); + }); } void ThreadSafeTransaction::setOption(FDBTransactionOptions::Option option, Optional value) { @@ -549,21 +781,40 @@ void ThreadSafeTransaction::reset() { onMainThreadVoid([tr]() { tr->reset(); }); } +void ThreadSafeTransaction::debugTrace(BaseTraceEvent&& ev) { + if (ev.isEnabled()) { + ISingleThreadTransaction* tr = this->tr; + std::shared_ptr evPtr = std::make_shared(std::move(ev)); + onMainThreadVoid([tr, evPtr]() { tr->debugTrace(std::move(*evPtr)); }); + } +}; + +void ThreadSafeTransaction::debugPrint(std::string const& message) { + ISingleThreadTransaction* tr = this->tr; + onMainThreadVoid([tr, message]() { tr->debugPrint(message); }); +} + extern const char* getSourceVersion(); -ThreadSafeApi::ThreadSafeApi() - : apiVersion(-1), clientVersion(format("%s,%s,%llx", FDB_VT_VERSION, getSourceVersion(), currentProtocolVersion)), - transportId(0) {} +ThreadSafeApi::ThreadSafeApi() : apiVersion(-1), transportId(0) {} void ThreadSafeApi::selectApiVersion(int apiVersion) { - this->apiVersion = apiVersion; + this->apiVersion = ApiVersion(apiVersion); } const char* ThreadSafeApi::getClientVersion() { - // There is only one copy of the ThreadSafeAPI, and it never gets deleted. Also, clientVersion is never modified. + // There is only one copy of the ThreadSafeAPI, and it never gets deleted. + // Also, clientVersion is initialized on demand and never modified afterwards. + if (clientVersion.empty()) { + clientVersion = format("%s,%s,%llx", FDB_VT_VERSION, getSourceVersion(), currentProtocolVersion()); + } return clientVersion.c_str(); } +void ThreadSafeApi::useFutureProtocolVersion() { + ::useFutureProtocolVersion(); +} + void ThreadSafeApi::setNetworkOption(FDBNetworkOptions::Option option, Optional value) { if (option == FDBNetworkOptions::EXTERNAL_CLIENT_TRANSPORT_ID) { if (value.present()) { @@ -582,10 +833,10 @@ void ThreadSafeApi::runNetwork() { Optional runErr; try { ::runNetwork(); - } catch (Error& e) { + } catch (const Error& e) { TraceEvent(SevError, "RunNetworkError").error(e); runErr = e; - } catch (std::exception& e) { + } catch (const std::exception& e) { runErr = unknown_error(); TraceEvent(SevError, "RunNetworkError").error(unknown_error()).detail("RootException", e.what()); } catch (...) { @@ -596,9 +847,9 @@ void ThreadSafeApi::runNetwork() { for (auto& hook : threadCompletionHooks) { try { hook.first(hook.second); - } catch (Error& e) { + } catch (const Error& e) { TraceEvent(SevError, "NetworkShutdownHookError").error(e); - } catch (std::exception& e) { + } catch (const std::exception& e) { TraceEvent(SevError, "NetworkShutdownHookError").error(unknown_error()).detail("RootException", e.what()); } catch (...) { TraceEvent(SevError, "NetworkShutdownHookError").error(unknown_error()); @@ -606,7 +857,6 @@ void ThreadSafeApi::runNetwork() { } if (runErr.present()) { - closeTraceFile(); throw runErr.get(); } @@ -618,7 +868,13 @@ void ThreadSafeApi::stopNetwork() { } Reference ThreadSafeApi::createDatabase(const char* clusterFilePath) { - return Reference(new ThreadSafeDatabase(clusterFilePath, apiVersion)); + return Reference( + new ThreadSafeDatabase(ThreadSafeDatabase::ConnectionRecordType::FILE, clusterFilePath, apiVersion.version())); +} + +Reference ThreadSafeApi::createDatabaseFromConnectionString(const char* connectionString) { + return Reference(new ThreadSafeDatabase( + ThreadSafeDatabase::ConnectionRecordType::CONNECTION_STRING, connectionString, apiVersion.version())); } void ThreadSafeApi::addNetworkThreadCompletionHook(void (*hook)(void*), void* hookParameter) { diff --git a/src/flow/Tracing.actor.cpp b/src/fdbclient/Tracing.actor.cpp similarity index 57% rename from src/flow/Tracing.actor.cpp rename to src/fdbclient/Tracing.actor.cpp index 144f663..978b683 100644 --- a/src/flow/Tracing.actor.cpp +++ b/src/fdbclient/Tracing.actor.cpp @@ -18,13 +18,18 @@ * limitations under the License. */ -#include "flow/Tracing.h" +#include "flow/Msgpack.h" +#include "fdbclient/Tracing.h" +#include "flow/IRandom.h" #include "flow/UnitTest.h" #include "flow/Knobs.h" +#include "flow/IConnection.h" +#include "fdbclient/IKnobCollection.h" #include "flow/network.h" #include #include #include +#include "flow/IUDPSocket.h" #include "flow/actorcompiler.h" // has to be last include @@ -42,28 +47,11 @@ constexpr float kQueueSizeLogInterval = 5.0; struct NoopTracer : ITracer { TracerType type() const override { return TracerType::DISABLED; } void trace(Span const& span) override {} - void trace(OTELSpan const& span) override {} }; struct LogfileTracer : ITracer { TracerType type() const override { return TracerType::LOG_FILE; } void trace(Span const& span) override { - TraceEvent te(SevInfo, "TracingSpan", span.context); - te.detail("Location", span.location.name) - .detail("Begin", format("%.6f", span.begin)) - .detail("End", format("%.6f", span.end)); - if (span.parents.size() == 1) { - te.detail("Parent", *span.parents.begin()); - } else { - for (auto parent : span.parents) { - TraceEvent(SevInfo, "TracingSpanAddParent", span.context).detail("AddParent", parent); - } - } - for (const auto& [key, value] : span.tags) { - TraceEvent(SevInfo, "TracingSpanTag", span.context).detail("Key", key).detail("Value", value); - } - } - void trace(OTELSpan const& span) override { TraceEvent te(SevInfo, "TracingSpan", span.context.traceID); te.detail("SpanID", span.context.spanID) .detail("Location", span.location.name) @@ -94,41 +82,6 @@ struct LogfileTracer : ITracer { } }; -struct TraceRequest { - std::unique_ptr buffer; - // Amount of data in buffer (bytes). - std::size_t data_size; - // Size of buffer (bytes). - std::size_t buffer_size; - - void write_byte(uint8_t byte) { write_bytes(&byte, 1); } - - void write_bytes(const uint8_t* buf, std::size_t n) { - resize(n); - std::copy(buf, buf + n, buffer.get() + data_size); - data_size += n; - } - - void resize(std::size_t n) { - if (data_size + n <= buffer_size) { - return; - } - - std::size_t size = buffer_size; - while (size < data_size + n) { - size *= 2; - } - - TraceEvent(SevInfo, "TracingSpanResizedBuffer").detail("OldSize", buffer_size).detail("NewSize", size); - auto new_buffer = std::make_unique(size); - std::copy(buffer.get(), buffer.get() + data_size, new_buffer.get()); - buffer = std::move(new_buffer); - buffer_size = size; - } - - void reset() { data_size = 0; } -}; - // A server listening for UDP trace messages, run only in simulation. ACTOR Future simulationStartServer() { // We're going to force the address to be loopback regardless of FLOW_KNOBS->TRACING_UDP_LISTENER_ADDR @@ -182,197 +135,89 @@ ACTOR Future traceLog(int* pendingMessages, bool* sendError) { struct UDPTracer : public ITracer { // Serializes span fields as an array into the supplied TraceRequest // buffer. - void serialize_span(const Span& span, TraceRequest& request) { - // If you change the serialization format here, make sure to update the - // fluentd filter to be able to correctly parse the updated format! See - // the msgpack specification for more info on the bit patterns used - // here. - uint8_t size = 8; - if (span.parents.size() == 0) - --size; - request.write_byte(size | 0b10010000); // write as array - - serialize_string(g_network->getLocalAddress().toString(), request); // ip:port - - serialize_value(span.context.first(), request, 0xcf); // trace id - serialize_value(span.context.second(), request, 0xcf); // token (span id) - - serialize_value(span.begin, request, 0xcb); // start time - serialize_value(span.end - span.begin, request, 0xcb); // duration - - serialize_string(span.location.name.toString(), request); - - serialize_map(span.tags, request); - - serialize_vector(span.parents, request); - } - - void serialize_span(const OTELSpan& span, TraceRequest& request) { - uint16_t size = 14; - request.write_byte(size | 0b10010000); // write as array - serialize_value(span.context.traceID.first(), request, 0xcf); // trace id - serialize_value(span.context.traceID.second(), request, 0xcf); // trace id - serialize_value(span.context.spanID, request, 0xcf); // spanid - // parent value - serialize_value(span.parentContext.traceID.first(), request, 0xcf); // trace id - serialize_value(span.parentContext.traceID.second(), request, 0xcf); // trace id - serialize_value(span.parentContext.spanID, request, 0xcf); // spanId + void serialize_span(const Span& span, MsgpackBuffer& buf) { + uint16_t size = 12; + buf.write_byte(size | 0b10010000); // write as array + serialize_value(span.context.traceID.first(), buf, 0xcf); // trace id + serialize_value(span.context.traceID.second(), buf, 0xcf); // trace id + serialize_value(span.context.spanID, buf, 0xcf); // spanid + // parent span id + serialize_value(span.parentContext.spanID, buf, 0xcf); // spanId // Payload - serialize_string(span.location.name.toString(), request); - serialize_value(span.begin, request, 0xcb); // start time - serialize_value(span.end, request, 0xcb); // end + serialize_string(span.location.name.toString(), buf); + serialize_value(span.begin, buf, 0xcb); // start time + serialize_value(span.end, buf, 0xcb); // end // Kind - serialize_value(span.kind, request, 0xcc); + serialize_value(span.kind, buf, 0xcc); // Status - serialize_value(span.status, request, 0xcc); + serialize_value(span.status, buf, 0xcc); // Links - serialize_vector(span.links, request); + serialize_vector(span.links, buf); // Events - serialize_vector(span.events, request); + serialize_vector(span.events, buf); // Attributes - serialize_map(span.attributes, request); + serialize_map(span.attributes, buf); } private: - // Writes the given value in big-endian format to the request. Sets the - // first byte to msgpack_type. - template - inline void serialize_value(const T& val, TraceRequest& request, uint8_t msgpack_type) { - request.write_byte(msgpack_type); - - const uint8_t* p = reinterpret_cast(std::addressof(val)); - for (size_t i = 0; i < sizeof(T); ++i) { - request.write_byte(p[sizeof(T) - i - 1]); - } - } - - // Writes the given string to the request as a sequence of bytes. Inserts a - // format byte at the beginning of the string according to the its length, - // as specified by the msgpack specification. - inline void serialize_string(const uint8_t* c, int length, TraceRequest& request) { - if (length <= 31) { - // A size 0 string is ok. We still need to write a byte - // identifiying the item as a string, but can set the size to 0. - request.write_byte(static_cast(length) | 0b10100000); - } else if (length <= 255) { - request.write_byte(0xd9); - request.write_byte(static_cast(length)); - } else if (length <= 65535) { - request.write_byte(0xda); - request.write_byte(reinterpret_cast(&length)[1]); - request.write_byte(reinterpret_cast(&length)[0]); - } else { - TraceEvent(SevWarn, "TracingSpanSerializeString") - .detail("Failed to MessagePack encode very large string", length); - ASSERT_WE_THINK(false); - } - - request.write_bytes(c, length); - } - - inline void serialize_string(const std::string& str, TraceRequest& request) { - serialize_string(reinterpret_cast(str.data()), str.size(), request); - } - - // Writes the given vector of SpanIDs to the request. If the vector is - // empty, the request is not modified. - inline void serialize_vector(const SmallVectorRef& vec, TraceRequest& request) { - int size = vec.size(); - if (size == 0) { - return; - } - if (size <= 15) { - request.write_byte(static_cast(size) | 0b10010000); - } else if (size <= 65535) { - request.write_byte(0xdc); - request.write_byte(reinterpret_cast(&size)[1]); - request.write_byte(reinterpret_cast(&size)[0]); - } else { - TraceEvent(SevWarn, "TracingSpanSerializeVector") - .detail("Failed to MessagePack encode very large vector", size); - ASSERT_WE_THINK(false); - } - - for (const auto& parentContext : vec) { - serialize_value(parentContext.second(), request, 0xcf); - } - } - // Writes the given vector of linked SpanContext's to the request. If the vector is // empty, the request is not modified. - inline void serialize_vector(const SmallVectorRef& vec, TraceRequest& request) { + inline void serialize_vector(const SmallVectorRef& vec, MsgpackBuffer& buf) { int size = vec.size(); if (size <= 15) { - request.write_byte(static_cast(size) | 0b10010000); + buf.write_byte(static_cast(size) | 0b10010000); } else if (size <= 65535) { - request.write_byte(0xdc); - request.write_byte(reinterpret_cast(&size)[1]); - request.write_byte(reinterpret_cast(&size)[0]); + buf.write_byte(0xdc); + buf.write_byte(reinterpret_cast(&size)[1]); + buf.write_byte(reinterpret_cast(&size)[0]); } else { TraceEvent(SevWarn, "TracingSpanSerializeVector").detail("Failed to MessagePack encode large vector", size); ASSERT_WE_THINK(false); } for (const auto& link : vec) { - serialize_value(link.traceID.first(), request, 0xcf); // trace id - serialize_value(link.traceID.second(), request, 0xcf); // trace id - serialize_value(link.spanID, request, 0xcf); // spanid + serialize_value(link.traceID.first(), buf, 0xcf); // trace id + serialize_value(link.traceID.second(), buf, 0xcf); // trace id + serialize_value(link.spanID, buf, 0xcf); // spanid } } - // Writes the given vector of linked SpanContext's to the request. If the vector is + // Writes the given vector of linked SpanEventRef's to the request. If the vector is // empty, the request is not modified. - inline void serialize_vector(const SmallVectorRef& vec, TraceRequest& request) { + inline void serialize_vector(const SmallVectorRef& vec, MsgpackBuffer& buf) { int size = vec.size(); if (size <= 15) { - request.write_byte(static_cast(size) | 0b10010000); + buf.write_byte(static_cast(size) | 0b10010000); } else if (size <= 65535) { - request.write_byte(0xdc); - request.write_byte(reinterpret_cast(&size)[1]); - request.write_byte(reinterpret_cast(&size)[0]); + buf.write_byte(0xdc); + buf.write_byte(reinterpret_cast(&size)[1]); + buf.write_byte(reinterpret_cast(&size)[0]); } else { TraceEvent(SevWarn, "TracingSpanSerializeVector").detail("Failed to MessagePack encode large vector", size); ASSERT_WE_THINK(false); } for (const auto& event : vec) { - serialize_string(event.name.toString(), request); // event name - serialize_value(event.time, request, 0xcb); // event time - serialize_vector(event.attributes, request); + serialize_string(event.name.toString(), buf); // event name + serialize_value(event.time, buf, 0xcb); // event time + serialize_vector(event.attributes, buf); } } - inline void serialize_vector(const SmallVectorRef& vals, TraceRequest& request) { + inline void serialize_vector(const SmallVectorRef& vals, MsgpackBuffer& buf) { int size = vals.size(); if (size <= 15) { // N.B. We're actually writing this out as a fixmap here in messagepack format! // fixmap 1000xxxx 0x80 - 0x8f - request.write_byte(static_cast(size) | 0b10000000); + buf.write_byte(static_cast(size) | 0b10000000); } else { TraceEvent(SevWarn, "TracingSpanSerializeVector").detail("Failed to MessagePack encode large vector", size); ASSERT_WE_THINK(false); } for (const auto& kv : vals) { - serialize_string(kv.key.toString(), request); - serialize_string(kv.value.toString(), request); - } - } - - template - inline void serialize_map(const Map& map, TraceRequest& request) { - int size = map.size(); - - if (size <= 15) { - request.write_byte(static_cast(size) | 0b10000000); - } else { - TraceEvent(SevWarn, "TracingSpanSerializeMap").detail("Failed to MessagePack encode large map", size); - ASSERT_WE_THINK(false); - } - - for (const auto& [key, value] : map) { - serialize_string(key.begin(), key.size(), request); - serialize_string(value.begin(), value.size(), request); + serialize_string(kv.key.toString(), buf); + serialize_string(kv.value.toString(), buf); } } }; @@ -402,9 +247,9 @@ ACTOR Future fastTraceLogger(int* unreadyMessages, int* failedMessages, in struct FastUDPTracer : public UDPTracer { FastUDPTracer() : unready_socket_messages_(0), failed_messages_(0), total_messages_(0), socket_fd_(-1), send_error_(false) { - request_ = TraceRequest{ .buffer = std::make_unique(kTraceBufferSize), - .data_size = 0, - .buffer_size = kTraceBufferSize }; + request_ = MsgpackBuffer{ .buffer = std::make_unique(kTraceBufferSize), + .data_size = 0, + .buffer_size = kTraceBufferSize }; } TracerType type() const override { return TracerType::NETWORK_LOSSY; } @@ -453,12 +298,6 @@ struct FastUDPTracer : public UDPTracer { request_.reset(); } - void trace(OTELSpan const& span) override { - prepare(span.location.name.size()); - serialize_span(span, request_); - write(); - } - void trace(Span const& span) override { prepare(span.location.name.size()); serialize_span(span, request_); @@ -466,7 +305,7 @@ struct FastUDPTracer : public UDPTracer { } private: - TraceRequest request_; + MsgpackBuffer request_; int unready_socket_messages_; int failed_messages_; @@ -513,52 +352,34 @@ void openTracer(TracerType type) { ITracer::~ITracer() {} Span& Span::operator=(Span&& o) { - if (begin > 0.0 && context.second() > 0) { + if (begin > 0.0 && context.isSampled()) { end = g_network->now(); g_tracer->trace(*this); } arena = std::move(o.arena); - context = o.context; - begin = o.begin; - end = o.end; - location = o.location; - parents = std::move(o.parents); - o.begin = 0; - return *this; -} + // All memory referenced in *Ref fields of Span is now (potentially) + // invalid, and o no longer has ownership of any memory referenced by *Ref + // fields of o. We must ensure that o no longer references any memory it no + // longer owns, and that *this no longer references any memory it no longer + // owns. Not every field references arena memory, but this std::exchange + // pattern provides a nice template for getting this right in a concise way + // should we add more fields to Span. + + attributes = std::exchange(o.attributes, decltype(o.attributes)()); + begin = std::exchange(o.begin, decltype(o.begin)()); + context = std::exchange(o.context, decltype(o.context)()); + end = std::exchange(o.end, decltype(o.end)()); + events = std::exchange(o.events, decltype(o.events)()); + kind = std::exchange(o.kind, decltype(o.kind)()); + links = std::exchange(o.links, decltype(o.links)()); + location = std::exchange(o.location, decltype(o.location)()); + parentContext = std::exchange(o.parentContext, decltype(o.parentContext)()); + status = std::exchange(o.status, decltype(o.status)()); -Span::~Span() { - if (begin > 0.0 && context.second() > 0) { - end = g_network->now(); - g_tracer->trace(*this); - } -} - -OTELSpan& OTELSpan::operator=(OTELSpan&& o) { - if (begin > 0.0 && o.context.isSampled() > 0) { - end = g_network->now(); - g_tracer->trace(*this); - } - arena = std::move(o.arena); - context = o.context; - parentContext = o.parentContext; - begin = o.begin; - end = o.end; - location = o.location; - links = std::move(o.links); - events = std::move(o.events); - status = o.status; - kind = o.kind; - o.context = SpanContext(); - o.parentContext = SpanContext(); - o.kind = SpanKind::INTERNAL; - o.begin = 0.0; - o.end = 0.0; - o.status = SpanStatus::UNSET; return *this; } -OTELSpan::~OTELSpan() { +Span::~Span() { if (begin > 0.0 && context.isSampled()) { end = g_network->now(); g_tracer->trace(*this); @@ -567,16 +388,11 @@ OTELSpan::~OTELSpan() { TEST_CASE("/flow/Tracing/CreateOTELSpan") { // Sampling disabled, no parent. - OTELSpan notSampled("foo"_loc); + Span notSampled("foo"_loc); ASSERT(!notSampled.context.isSampled()); - // Force Sampling - OTELSpan sampled("foo"_loc, []() { return 1.0; }); - ASSERT(sampled.context.isSampled()); - // Ensure child traceID matches parent, when parent is sampled. - OTELSpan childTraceIDMatchesParent( - "foo"_loc, []() { return 1.0; }, SpanContext(UID(100, 101), 200, TraceFlags::sampled)); + Span childTraceIDMatchesParent("foo"_loc, SpanContext(UID(100, 101), 200, TraceFlags::sampled)); ASSERT(childTraceIDMatchesParent.context.traceID.first() == childTraceIDMatchesParent.parentContext.traceID.first()); ASSERT(childTraceIDMatchesParent.context.traceID.second() == @@ -584,40 +400,33 @@ TEST_CASE("/flow/Tracing/CreateOTELSpan") { // When the parent isn't sampled AND it has legitimate values we should not sample a child, // even if the child was randomly selected for sampling. - OTELSpan parentNotSampled( - "foo"_loc, []() { return 1.0; }, SpanContext(UID(1, 1), 1, TraceFlags::unsampled)); + Span parentNotSampled("foo"_loc, SpanContext(UID(1, 1), 1, TraceFlags::unsampled)); ASSERT(!parentNotSampled.context.isSampled()); - // When the parent isn't sampled AND it has zero values for traceID and spanID this means - // we should defer to the child as the new root of the trace as there was no actual parent. - // If the child was sampled we should send the child trace with a null parent. - OTELSpan noParent( - "foo"_loc, []() { return 1.0; }, SpanContext(UID(0, 0), 0, TraceFlags::unsampled)); - ASSERT(noParent.context.isSampled()); return Void(); }; TEST_CASE("/flow/Tracing/AddEvents") { // Use helper method to add an OTELEventRef to an OTELSpan. - OTELSpan span1("span_with_event"_loc); + Span span1("span_with_event"_loc); auto arena = span1.arena; SmallVectorRef attrs; attrs.push_back(arena, KeyValueRef("foo"_sr, "bar"_sr)); - span1.addEvent(LiteralStringRef("read_version"), 1.0, attrs); + span1.addEvent("read_version"_sr, 1.0, attrs); ASSERT(span1.events[0].name.toString() == "read_version"); ASSERT(span1.events[0].time == 1.0); ASSERT(span1.events[0].attributes.begin()->key.toString() == "foo"); ASSERT(span1.events[0].attributes.begin()->value.toString() == "bar"); // Use helper method to add an OTELEventRef with no attributes to an OTELSpan - OTELSpan span2("span_with_event"_loc); - span2.addEvent(StringRef(span2.arena, LiteralStringRef("commit_succeed")), 1234567.100); + Span span2("span_with_event"_loc); + span2.addEvent(StringRef(span2.arena, "commit_succeed"_sr), 1234567.100); ASSERT(span2.events[0].name.toString() == "commit_succeed"); ASSERT(span2.events[0].time == 1234567.100); ASSERT(span2.events[0].attributes.size() == 0); // Add fully constructed OTELEventRef to OTELSpan passed by value. - OTELSpan span3("span_with_event"_loc); + Span span3("span_with_event"_loc); auto s3Arena = span3.arena; SmallVectorRef s3Attrs; s3Attrs.push_back(s3Arena, KeyValueRef("xyz"_sr, "123"_sr)); @@ -636,33 +445,45 @@ TEST_CASE("/flow/Tracing/AddEvents") { }; TEST_CASE("/flow/Tracing/AddAttributes") { - OTELSpan span1("span_with_attrs"_loc); + Span span1("span_with_attrs"_loc, + SpanContext(deterministicRandom()->randomUniqueID(), + deterministicRandom()->randomUInt64(), + TraceFlags::sampled)); auto arena = span1.arena; - span1.addAttribute(StringRef(arena, LiteralStringRef("foo")), StringRef(arena, LiteralStringRef("bar"))); - span1.addAttribute(StringRef(arena, LiteralStringRef("operation")), StringRef(arena, LiteralStringRef("grv"))); + span1.addAttribute(StringRef(arena, "foo"_sr), StringRef(arena, "bar"_sr)); + span1.addAttribute(StringRef(arena, "operation"_sr), StringRef(arena, "grv"_sr)); ASSERT_EQ(span1.attributes.size(), 3); // Includes default attribute of "address" ASSERT(span1.attributes[1] == KeyValueRef("foo"_sr, "bar"_sr)); ASSERT(span1.attributes[2] == KeyValueRef("operation"_sr, "grv"_sr)); - OTELSpan span3("span_with_attrs"_loc); - auto s3Arena = span3.arena; - span3.addAttribute(StringRef(s3Arena, LiteralStringRef("a")), StringRef(s3Arena, LiteralStringRef("1"))) - .addAttribute(StringRef(s3Arena, LiteralStringRef("b")), LiteralStringRef("2")) - .addAttribute(StringRef(s3Arena, LiteralStringRef("c")), LiteralStringRef("3")); - - ASSERT_EQ(span3.attributes.size(), 4); // Includes default attribute of "address" - ASSERT(span3.attributes[1] == KeyValueRef("a"_sr, "1"_sr)); - ASSERT(span3.attributes[2] == KeyValueRef("b"_sr, "2"_sr)); - ASSERT(span3.attributes[3] == KeyValueRef("c"_sr, "3"_sr)); + Span span2("span_with_attrs"_loc, + SpanContext(deterministicRandom()->randomUniqueID(), + deterministicRandom()->randomUInt64(), + TraceFlags::sampled)); + auto s2Arena = span2.arena; + span2.addAttribute(StringRef(s2Arena, "a"_sr), StringRef(s2Arena, "1"_sr)) + .addAttribute(StringRef(s2Arena, "b"_sr), "2"_sr) + .addAttribute(StringRef(s2Arena, "c"_sr), "3"_sr); + + ASSERT_EQ(span2.attributes.size(), 4); // Includes default attribute of "address" + ASSERT(span2.attributes[1] == KeyValueRef("a"_sr, "1"_sr)); + ASSERT(span2.attributes[2] == KeyValueRef("b"_sr, "2"_sr)); + ASSERT(span2.attributes[3] == KeyValueRef("c"_sr, "3"_sr)); return Void(); }; TEST_CASE("/flow/Tracing/AddLinks") { - OTELSpan span1("span_with_links"_loc); + Span span1("span_with_links"_loc); + ASSERT(!span1.context.isSampled()); + ASSERT(!span1.context.isValid()); span1.addLink(SpanContext(UID(100, 101), 200, TraceFlags::sampled)); span1.addLink(SpanContext(UID(200, 201), 300, TraceFlags::unsampled)) .addLink(SpanContext(UID(300, 301), 400, TraceFlags::sampled)); + // Ensure the root span is now sampled and traceID and spanIDs are set. + ASSERT(span1.context.isSampled()); + ASSERT(span1.context.isValid()); + // Ensure links are present. ASSERT(span1.links[0].traceID == UID(100, 101)); ASSERT(span1.links[0].spanID == 200); ASSERT(span1.links[0].m_Flags == TraceFlags::sampled); @@ -673,11 +494,16 @@ TEST_CASE("/flow/Tracing/AddLinks") { ASSERT(span1.links[2].spanID == 400); ASSERT(span1.links[2].m_Flags == TraceFlags::sampled); - OTELSpan span2("span_with_links"_loc); + Span span2("span_with_links"_loc); + ASSERT(!span2.context.isSampled()); + ASSERT(!span2.context.isValid()); auto link1 = SpanContext(UID(1, 1), 1, TraceFlags::sampled); auto link2 = SpanContext(UID(2, 2), 2, TraceFlags::sampled); auto link3 = SpanContext(UID(3, 3), 3, TraceFlags::sampled); span2.addLinks({ link1, link2 }).addLinks({ link3 }); + // Ensure the root span is now sampled and traceID and spanIDs are set. + ASSERT(span2.context.isSampled()); + ASSERT(span2.context.isValid()); ASSERT(span2.links[0].traceID == UID(1, 1)); ASSERT(span2.links[0].spanID == 1); ASSERT(span2.links[0].m_Flags == TraceFlags::sampled); @@ -741,24 +567,24 @@ std::string readMPString(uint8_t* index) { // Windows doesn't like lack of header and declaration of constructor for FastUDPTracer #ifndef WIN32 TEST_CASE("/flow/Tracing/FastUDPMessagePackEncoding") { - OTELSpan span1("encoded_span"_loc); - auto request = TraceRequest{ .buffer = std::make_unique(kTraceBufferSize), - .data_size = 0, - .buffer_size = kTraceBufferSize }; + Span span1("encoded_span"_loc); + auto request = MsgpackBuffer{ .buffer = std::make_unique(kTraceBufferSize), + .data_size = 0, + .buffer_size = kTraceBufferSize }; auto tracer = FastUDPTracer(); tracer.serialize_span(span1, request); auto data = request.buffer.get(); - ASSERT(data[0] == 0b10011110); // Default array size. + ASSERT(data[0] == 0b10011100); // Default array size. request.reset(); // Test - constructor OTELSpan(const Location& location, const SpanContext parent, const SpanContext& link) // Will delegate to other constructors. - OTELSpan span2("encoded_span"_loc, - SpanContext(UID(100, 101), 1, TraceFlags::sampled), - SpanContext(UID(200, 201), 2, TraceFlags::sampled)); + Span span2("encoded_span"_loc, + SpanContext(UID(100, 101), 1, TraceFlags::sampled), + { SpanContext(UID(200, 201), 2, TraceFlags::sampled) }); tracer.serialize_span(span2, request); data = request.buffer.get(); - ASSERT(data[0] == 0b10011110); // 14 element array. + ASSERT(data[0] == 0b10011100); // 12 element array. // Verify the Parent Trace ID overwrites this spans Trace ID ASSERT(data[1] == 0xcf); ASSERT(swapUint64BE(&data[2]) == 100); @@ -766,85 +592,81 @@ TEST_CASE("/flow/Tracing/FastUDPMessagePackEncoding") { ASSERT(swapUint64BE(&data[11]) == 101); ASSERT(data[19] == 0xcf); // We don't care about the next 8 bytes, they are the ID for the span itself and will be random. - // Parent TraceID and Parent SpanID. + // Parent SpanID. ASSERT(data[28] == 0xcf); - ASSERT(swapUint64BE(&data[29]) == 100); - ASSERT(data[37] == 0xcf); - ASSERT(swapUint64BE(&data[38]) == 101); - ASSERT(data[46] == 0xcf); - ASSERT(swapUint64BE(&data[47]) == 1); + ASSERT(swapUint64BE(&data[29]) == 1); // Read and verify span name - ASSERT(readMPString(&data[55]) == "encoded_span"); + ASSERT(readMPString(&data[37]) == "encoded_span"); // Verify begin/end is encoded, we don't care about the values - ASSERT(data[68] == 0xcb); - ASSERT(data[77] == 0xcb); + ASSERT(data[50] == 0xcb); + ASSERT(data[59] == 0xcb); // SpanKind - ASSERT(data[86] == 0xcc); - ASSERT(data[87] == static_cast(SpanKind::SERVER)); + ASSERT(data[68] == 0xcc); + ASSERT(data[69] == static_cast(SpanKind::SERVER)); // Status - ASSERT(data[88] == 0xcc); - ASSERT(data[89] == static_cast(SpanStatus::OK)); + ASSERT(data[70] == 0xcc); + ASSERT(data[71] == static_cast(SpanStatus::OK)); // Linked SpanContext - ASSERT(data[90] == 0b10010001); + ASSERT(data[72] == 0b10010001); + ASSERT(data[73] == 0xcf); + ASSERT(swapUint64BE(&data[74]) == 200); + ASSERT(data[82] == 0xcf); + ASSERT(swapUint64BE(&data[83]) == 201); ASSERT(data[91] == 0xcf); - ASSERT(swapUint64BE(&data[92]) == 200); - ASSERT(data[100] == 0xcf); - ASSERT(swapUint64BE(&data[101]) == 201); - ASSERT(data[109] == 0xcf); - ASSERT(swapUint64BE(&data[110]) == 2); + ASSERT(swapUint64BE(&data[92]) == 2); // Events - ASSERT(data[118] == 0b10010000); // empty + ASSERT(data[100] == 0b10010000); // empty // Attributes - ASSERT(data[119] == 0b10000001); // single k/v pair - ASSERT(data[120] == 0b10100111); // length of key string "address" == 7 + ASSERT(data[101] == 0b10000001); // single k/v pair + ASSERT(data[102] == 0b10100111); // length of key string "address" == 7 request.reset(); // Exercise all fluent interfaces, include links, events, and attributes. - OTELSpan span3("encoded_span_3"_loc); + Span span3("encoded_span_3"_loc, SpanContext()); auto s3Arena = span3.arena; SmallVectorRef attrs; attrs.push_back(s3Arena, KeyValueRef("foo"_sr, "bar"_sr)); span3.addAttribute("operation"_sr, "grv"_sr) .addLink(SpanContext(UID(300, 301), 400, TraceFlags::sampled)) - .addEvent(StringRef(s3Arena, LiteralStringRef("event1")), 100.101, attrs); + .addEvent(StringRef(s3Arena, "event1"_sr), 100.101, attrs); tracer.serialize_span(span3, request); data = request.buffer.get(); - ASSERT(data[0] == 0b10011110); // 14 element array. - // We don't care about the next 54 bytes as there is no parent and a randomly assigned Trace and SpanID + ASSERT(data[0] == 0b10011100); // 12 element array. + // We don't care about the next 36 bytes as there is no parent and a randomly assigned Trace and SpanID // Read and verify span name - ASSERT(readMPString(&data[55]) == "encoded_span_3"); + ASSERT(readMPString(&data[37]) == "encoded_span_3"); // Verify begin/end is encoded, we don't care about the values - ASSERT(data[70] == 0xcb); - ASSERT(data[79] == 0xcb); + ASSERT(data[52] == 0xcb); + ASSERT(data[61] == 0xcb); // SpanKind - ASSERT(data[88] == 0xcc); - ASSERT(data[89] == static_cast(SpanKind::SERVER)); + ASSERT(data[70] == 0xcc); + ASSERT(data[71] == static_cast(SpanKind::SERVER)); // Status - ASSERT(data[90] == 0xcc); - ASSERT(data[91] == static_cast(SpanStatus::OK)); + ASSERT(data[72] == 0xcc); + ASSERT(data[73] == static_cast(SpanStatus::OK)); // Linked SpanContext - ASSERT(data[92] == 0b10010001); + ASSERT(data[74] == 0b10010001); + ASSERT(data[75] == 0xcf); + ASSERT(swapUint64BE(&data[76]) == 300); + ASSERT(data[84] == 0xcf); + ASSERT(swapUint64BE(&data[85]) == 301); ASSERT(data[93] == 0xcf); - ASSERT(swapUint64BE(&data[94]) == 300); - ASSERT(data[102] == 0xcf); - ASSERT(swapUint64BE(&data[103]) == 301); - ASSERT(data[111] == 0xcf); - ASSERT(swapUint64BE(&data[112]) == 400); + ASSERT(swapUint64BE(&data[94]) == 400); // Events - ASSERT(data[120] == 0b10010001); // empty - ASSERT(readMPString(&data[121]) == "event1"); - ASSERT(data[128] == 0xcb); - ASSERT(swapDoubleBE(&data[129]) == 100.101); + ASSERT(data[102] == 0b10010001); // empty + ASSERT(readMPString(&data[103]) == "event1"); + ASSERT(data[110] == 0xcb); + ASSERT(swapDoubleBE(&data[111]) == 100.101); // Events Attributes - ASSERT(data[137] == 0b10000001); // single k/v pair - ASSERT(readMPString(&data[138]) == "foo"); - ASSERT(readMPString(&data[142]) == "bar"); + ASSERT(data[119] == 0b10000001); // single k/v pair + ASSERT(readMPString(&data[120]) == "foo"); + ASSERT(readMPString(&data[124]) == "bar"); // Attributes - ASSERT(data[146] == 0b10000010); // two k/v pair + ASSERT(data[128] == 0b10000010); // two k/v pair // Reconstruct map from MessagePack wire format data and verify. std::unordered_map attributes; - auto index = 147; + auto index = 129; auto firstKey = readMPString(&data[index]); index += firstKey.length() + 1; // +1 for control byte @@ -870,17 +692,17 @@ TEST_CASE("/flow/Tracing/FastUDPMessagePackEncoding") { "SGKKUrpIb/7zePhBDi+gzUzyAcbQ2zUbFWI1KNi3zQk58uUG6wWJZkw+GCs7Cc3V" "OUxOljwCJkC4QTgdsbbFhxUC+rtoHV5xAqoTQwR0FXnWigUjP7NtdL6huJUr3qRv" "40c4yUI1a4+P5vJa"; - auto span4 = OTELSpan(); + Span span4; auto location = Location(); location.name = StringRef(span4.arena, longString); span4.location = location; tracer.serialize_span(span4, request); data = request.buffer.get(); - ASSERT(data[0] == 0b10011110); // 14 element array. - // We don't care about the next 54 bytes as there is no parent and a randomly assigned Trace and SpanID + ASSERT(data[0] == 0b10011100); // 12 element array. + // We don't care about the next 36 bytes as there is no parent and a randomly assigned Trace and SpanID // Read and verify span name - ASSERT(data[55] == 0xda); - ASSERT(readMPString(&data[55]) == longString); + ASSERT(data[37] == 0xda); + ASSERT(readMPString(&data[37]) == longString); return Void(); }; #endif diff --git a/src/fdbclient/Tracing.actor.g.cpp b/src/fdbclient/Tracing.actor.g.cpp new file mode 100644 index 0000000..a946deb --- /dev/null +++ b/src/fdbclient/Tracing.actor.g.cpp @@ -0,0 +1,1789 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +/* + * Tracing.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "flow/Msgpack.h" +#include "fdbclient/Tracing.h" +#include "flow/IRandom.h" +#include "flow/UnitTest.h" +#include "flow/Knobs.h" +#include "flow/IConnection.h" +#include "fdbclient/IKnobCollection.h" +#include "flow/network.h" +#include +#include +#include +#include "flow/IUDPSocket.h" + +#include "flow/actorcompiler.h" // has to be last include + +#ifdef NO_INTELLISENSE +namespace { +#endif + +// Initial size of buffer used to store serialized traces. Buffer will be +// resized when necessary. +constexpr int kTraceBufferSize = 1024; + +// The time interval between each report of the tracer queue size (seconds). +constexpr float kQueueSizeLogInterval = 5.0; + +struct NoopTracer : ITracer { + TracerType type() const override { return TracerType::DISABLED; } + void trace(Span const& span) override {} +}; + +struct LogfileTracer : ITracer { + TracerType type() const override { return TracerType::LOG_FILE; } + void trace(Span const& span) override { + TraceEvent te(SevInfo, "TracingSpan", span.context.traceID); + te.detail("SpanID", span.context.spanID) + .detail("Location", span.location.name) + .detail("Begin", format("%.6f", span.begin)) + .detail("End", format("%.6f", span.end)) + .detail("Kind", span.kind) + .detail("Status", span.status) + .detail("ParentSpanID", span.parentContext.spanID); + + for (const auto& link : span.links) { + TraceEvent(SevInfo, "TracingSpanLink", span.context.traceID) + .detail("TraceID", link.traceID) + .detail("SpanID", link.spanID); + } + for (const auto& [key, value] : span.attributes) { + TraceEvent(SevInfo, "TracingSpanTag", span.context.traceID).detail("Key", key).detail("Value", value); + } + for (const auto& event : span.events) { + TraceEvent(SevInfo, "TracingSpanEvent", span.context.traceID) + .detail("Name", event.name) + .detail("Time", event.time); + for (const auto& [key, value] : event.attributes) { + TraceEvent(SevInfo, "TracingSpanEventAttribute", span.context.traceID) + .detail("Key", key) + .detail("Value", value); + } + } + } +}; + +// A server listening for UDP trace messages, run only in simulation. + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +// This generated class is to be used only via simulationStartServer() + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +template + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +class SimulationStartServerActorState { + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +public: + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + SimulationStartServerActorState() + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + { + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + fdb_probe_actor_create("simulationStartServer", reinterpret_cast(this)); + + } + ~SimulationStartServerActorState() + { + fdb_probe_actor_destroy("simulationStartServer", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + TraceEvent(SevInfo, "UDPServerStarted") .detail("Address", "127.0.0.1") .detail("Port", FLOW_KNOBS->TRACING_UDP_LISTENER_PORT); + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + localAddress = NetworkAddress::parse("127.0.0.1:" + std::to_string(FLOW_KNOBS->TRACING_UDP_LISTENER_PORT)); + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + StrictFuture> __when_expr_0 = INetworkConnections::net()->createUDPSocket(localAddress); + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~SimulationStartServerActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + serverSocket->bind(localAddress); + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + packetString = makeString(IUDPSocket::MAX_PACKET_SIZE); + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + packet = mutateString(packetString); + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ; + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1when1(Reference const& __serverSocket,int loopDepth) + { + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + serverSocket = __serverSocket; + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Reference && __serverSocket,int loopDepth) + { + serverSocket = std::move(__serverSocket); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SimulationStartServerActor, 0, Reference >::remove(); + + } + void a_callback_fire(ActorCallback< SimulationStartServerActor, 0, Reference >*,Reference const& value) + { + fdb_probe_actor_enter("simulationStartServer", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("simulationStartServer", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< SimulationStartServerActor, 0, Reference >*,Reference && value) + { + fdb_probe_actor_enter("simulationStartServer", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("simulationStartServer", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< SimulationStartServerActor, 0, Reference >*,Error err) + { + fdb_probe_actor_enter("simulationStartServer", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("simulationStartServer", reinterpret_cast(this), 0); + + } + int a_body1cont1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1(int loopDepth) + { + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + StrictFuture __when_expr_1 = serverSocket->receive(packet, packet + IUDPSocket::MAX_PACKET_SIZE); + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1loopBody1cont1(int const& size,int loopDepth) + { + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto message = packetString.substr(0, size); + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(message[0] == (4 | 0b10010000) || (5 | 0b10010000)); + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1cont1(int && size,int loopDepth) + { + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto message = packetString.substr(0, size); + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(message[0] == (4 | 0b10010000) || (5 | 0b10010000)); + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1when1(int const& size,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont1(size, loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1when1(int && size,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont1(std::move(size), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SimulationStartServerActor, 1, int >::remove(); + + } + void a_callback_fire(ActorCallback< SimulationStartServerActor, 1, int >*,int const& value) + { + fdb_probe_actor_enter("simulationStartServer", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("simulationStartServer", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< SimulationStartServerActor, 1, int >*,int && value) + { + fdb_probe_actor_enter("simulationStartServer", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("simulationStartServer", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< SimulationStartServerActor, 1, int >*,Error err) + { + fdb_probe_actor_enter("simulationStartServer", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("simulationStartServer", reinterpret_cast(this), 1); + + } + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + NetworkAddress localAddress; + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Reference serverSocket; + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Standalone packetString; + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + uint8_t* packet; + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +}; +// This generated class is to be used only via simulationStartServer() + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +class SimulationStartServerActor final : public Actor, public ActorCallback< SimulationStartServerActor, 0, Reference >, public ActorCallback< SimulationStartServerActor, 1, int >, public FastAllocated, public SimulationStartServerActorState { + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< SimulationStartServerActor, 0, Reference >; +friend struct ActorCallback< SimulationStartServerActor, 1, int >; + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + SimulationStartServerActor() + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + : Actor(), + SimulationStartServerActorState() + { + fdb_probe_actor_enter("simulationStartServer", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("simulationStartServer"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("simulationStartServer", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< SimulationStartServerActor, 0, Reference >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< SimulationStartServerActor, 1, int >*)0, actor_cancelled()); break; + } + + } +}; + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +[[nodiscard]] Future simulationStartServer( ) { + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + return Future(new SimulationStartServerActor()); + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +} + +#line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + +/* +// Runs on an interval, printing debug information and performing other +// connection tasks. +ACTOR Future traceLog(int* pendingMessages, bool* sendError) { + state bool sendErrorReset = false; + + loop { + TraceEvent("TracingSpanQueueSize").detail("PendingMessages", *pendingMessages); + + // Wait at least one full loop before attempting to send messages + // again. + if (sendErrorReset) { + sendErrorReset = false; + *sendError = false; + } else if (*sendError) { + sendErrorReset = true; + } + + wait(delay(kQueueSizeLogInterval)); + } +} +*/ + +struct UDPTracer : public ITracer { + // Serializes span fields as an array into the supplied TraceRequest + // buffer. + void serialize_span(const Span& span, MsgpackBuffer& buf) { + uint16_t size = 12; + buf.write_byte(size | 0b10010000); // write as array + serialize_value(span.context.traceID.first(), buf, 0xcf); // trace id + serialize_value(span.context.traceID.second(), buf, 0xcf); // trace id + serialize_value(span.context.spanID, buf, 0xcf); // spanid + // parent span id + serialize_value(span.parentContext.spanID, buf, 0xcf); // spanId + // Payload + serialize_string(span.location.name.toString(), buf); + serialize_value(span.begin, buf, 0xcb); // start time + serialize_value(span.end, buf, 0xcb); // end + // Kind + serialize_value(span.kind, buf, 0xcc); + // Status + serialize_value(span.status, buf, 0xcc); + // Links + serialize_vector(span.links, buf); + // Events + serialize_vector(span.events, buf); + // Attributes + serialize_map(span.attributes, buf); + } + +private: + // Writes the given vector of linked SpanContext's to the request. If the vector is + // empty, the request is not modified. + inline void serialize_vector(const SmallVectorRef& vec, MsgpackBuffer& buf) { + int size = vec.size(); + if (size <= 15) { + buf.write_byte(static_cast(size) | 0b10010000); + } else if (size <= 65535) { + buf.write_byte(0xdc); + buf.write_byte(reinterpret_cast(&size)[1]); + buf.write_byte(reinterpret_cast(&size)[0]); + } else { + TraceEvent(SevWarn, "TracingSpanSerializeVector").detail("Failed to MessagePack encode large vector", size); + ASSERT_WE_THINK(false); + } + + for (const auto& link : vec) { + serialize_value(link.traceID.first(), buf, 0xcf); // trace id + serialize_value(link.traceID.second(), buf, 0xcf); // trace id + serialize_value(link.spanID, buf, 0xcf); // spanid + } + } + + // Writes the given vector of linked SpanEventRef's to the request. If the vector is + // empty, the request is not modified. + inline void serialize_vector(const SmallVectorRef& vec, MsgpackBuffer& buf) { + int size = vec.size(); + if (size <= 15) { + buf.write_byte(static_cast(size) | 0b10010000); + } else if (size <= 65535) { + buf.write_byte(0xdc); + buf.write_byte(reinterpret_cast(&size)[1]); + buf.write_byte(reinterpret_cast(&size)[0]); + } else { + TraceEvent(SevWarn, "TracingSpanSerializeVector").detail("Failed to MessagePack encode large vector", size); + ASSERT_WE_THINK(false); + } + + for (const auto& event : vec) { + serialize_string(event.name.toString(), buf); // event name + serialize_value(event.time, buf, 0xcb); // event time + serialize_vector(event.attributes, buf); + } + } + + inline void serialize_vector(const SmallVectorRef& vals, MsgpackBuffer& buf) { + int size = vals.size(); + if (size <= 15) { + // N.B. We're actually writing this out as a fixmap here in messagepack format! + // fixmap 1000xxxx 0x80 - 0x8f + buf.write_byte(static_cast(size) | 0b10000000); + } else { + TraceEvent(SevWarn, "TracingSpanSerializeVector").detail("Failed to MessagePack encode large vector", size); + ASSERT_WE_THINK(false); + } + + for (const auto& kv : vals) { + serialize_string(kv.key.toString(), buf); + serialize_string(kv.value.toString(), buf); + } + } +}; + +#ifndef WIN32 + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +// This generated class is to be used only via fastTraceLogger() + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +template + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +class FastTraceLoggerActorState { + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +public: + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + FastTraceLoggerActorState(int* const& unreadyMessages,int* const& failedMessages,int* const& totalMessages,bool* const& sendError) + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + : unreadyMessages(unreadyMessages), + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + failedMessages(failedMessages), + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + totalMessages(totalMessages), + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + sendError(sendError), + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + sendErrorReset(false) + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + { + fdb_probe_actor_create("fastTraceLogger", reinterpret_cast(this)); + + } + ~FastTraceLoggerActorState() + { + fdb_probe_actor_destroy("fastTraceLogger", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ; + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FastTraceLoggerActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + TraceEvent("TracingSpanStats") .detail("UnreadyMessages", *unreadyMessages) .detail("FailedMessages", *failedMessages) .detail("TotalMessages", *totalMessages) .detail("SendError", *sendError); + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + if (sendErrorReset) + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + { + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + sendErrorReset = false; + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + *sendError = false; + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + } + else + { + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + if (*sendError) + #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + { + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + sendErrorReset = true; + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + } + } + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + StrictFuture __when_expr_0 = delay(kQueueSizeLogInterval); + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1(Void const& _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1(Void && _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FastTraceLoggerActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FastTraceLoggerActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("fastTraceLogger", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("fastTraceLogger", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FastTraceLoggerActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("fastTraceLogger", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("fastTraceLogger", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< FastTraceLoggerActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("fastTraceLogger", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("fastTraceLogger", reinterpret_cast(this), 0); + + } + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + int* unreadyMessages; + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + int* failedMessages; + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + int* totalMessages; + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + bool* sendError; + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + bool sendErrorReset; + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +}; +// This generated class is to be used only via fastTraceLogger() + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +class FastTraceLoggerActor final : public Actor, public ActorCallback< FastTraceLoggerActor, 0, Void >, public FastAllocated, public FastTraceLoggerActorState { + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< FastTraceLoggerActor, 0, Void >; + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + FastTraceLoggerActor(int* const& unreadyMessages,int* const& failedMessages,int* const& totalMessages,bool* const& sendError) + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + : Actor(), + FastTraceLoggerActorState(unreadyMessages, failedMessages, totalMessages, sendError) + { + fdb_probe_actor_enter("fastTraceLogger", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("fastTraceLogger"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("fastTraceLogger", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< FastTraceLoggerActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +[[nodiscard]] Future fastTraceLogger( int* const& unreadyMessages, int* const& failedMessages, int* const& totalMessages, bool* const& sendError ) { + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + return Future(new FastTraceLoggerActor(unreadyMessages, failedMessages, totalMessages, sendError)); + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +} + +#line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + +struct FastUDPTracer : public UDPTracer { + FastUDPTracer() + : unready_socket_messages_(0), failed_messages_(0), total_messages_(0), socket_fd_(-1), send_error_(false) { + request_ = MsgpackBuffer{ .buffer = std::make_unique(kTraceBufferSize), + .data_size = 0, + .buffer_size = kTraceBufferSize }; + } + + TracerType type() const override { return TracerType::NETWORK_LOSSY; } + + void prepare(int size) { + static std::once_flag once; + std::call_once(once, [&]() { + log_actor_ = fastTraceLogger(&unready_socket_messages_, &failed_messages_, &total_messages_, &send_error_); + std::string destAddr = FLOW_KNOBS->TRACING_UDP_LISTENER_ADDR; + if (g_network->isSimulated()) { + udp_server_actor_ = simulationStartServer(); + // Force loopback when in simulation mode + destAddr = "127.0.0.1"; + } + NetworkAddress destAddress = + NetworkAddress::parse(destAddr + ":" + std::to_string(FLOW_KNOBS->TRACING_UDP_LISTENER_PORT)); + + socket_ = INetworkConnections::net()->createUDPSocket(destAddress); + }); + + if (size == 0) { + return; + } + + ++total_messages_; + if (!socket_.isReady()) { + ++unready_socket_messages_; + return; + } else if (socket_fd_ == -1) { + socket_fd_ = socket_.get()->native_handle(); + } + + if (send_error_) { + return; + } + } + + void write() { + int bytesSent = send(socket_fd_, request_.buffer.get(), request_.data_size, MSG_DONTWAIT); + if (bytesSent == -1) { + // Will forgo checking errno here, and assume all error messages + // should be treated the same. + ++failed_messages_; + send_error_ = true; + } + request_.reset(); + } + + void trace(Span const& span) override { + prepare(span.location.name.size()); + serialize_span(span, request_); + write(); + } + +private: + MsgpackBuffer request_; + + int unready_socket_messages_; + int failed_messages_; + int total_messages_; + + int socket_fd_; + bool send_error_; + + Future> socket_; + Future log_actor_; + Future udp_server_actor_; +}; +#endif + +ITracer* g_tracer = new NoopTracer(); + +#ifdef NO_INTELLISENSE +} // namespace +#endif + +void openTracer(TracerType type) { + if (g_tracer->type() == type) { + return; + } + delete g_tracer; + switch (type) { + case TracerType::DISABLED: + g_tracer = new NoopTracer{}; + break; + case TracerType::LOG_FILE: + g_tracer = new LogfileTracer{}; + break; + case TracerType::NETWORK_LOSSY: +#ifndef WIN32 + g_tracer = new FastUDPTracer{}; +#endif + break; + case TracerType::SIM_END: + ASSERT(false); + break; + } +} + +ITracer::~ITracer() {} + +Span& Span::operator=(Span&& o) { + if (begin > 0.0 && context.isSampled()) { + end = g_network->now(); + g_tracer->trace(*this); + } + arena = std::move(o.arena); + // All memory referenced in *Ref fields of Span is now (potentially) + // invalid, and o no longer has ownership of any memory referenced by *Ref + // fields of o. We must ensure that o no longer references any memory it no + // longer owns, and that *this no longer references any memory it no longer + // owns. Not every field references arena memory, but this std::exchange + // pattern provides a nice template for getting this right in a concise way + // should we add more fields to Span. + + attributes = std::exchange(o.attributes, decltype(o.attributes)()); + begin = std::exchange(o.begin, decltype(o.begin)()); + context = std::exchange(o.context, decltype(o.context)()); + end = std::exchange(o.end, decltype(o.end)()); + events = std::exchange(o.events, decltype(o.events)()); + kind = std::exchange(o.kind, decltype(o.kind)()); + links = std::exchange(o.links, decltype(o.links)()); + location = std::exchange(o.location, decltype(o.location)()); + parentContext = std::exchange(o.parentContext, decltype(o.parentContext)()); + status = std::exchange(o.status, decltype(o.status)()); + + return *this; +} + +Span::~Span() { + if (begin > 0.0 && context.isSampled()) { + end = g_network->now(); + g_tracer->trace(*this); + } +} + + #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase389() + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +template + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +class FlowTestCase389ActorState { + #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +public: + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + FlowTestCase389ActorState(UnitTestParameters const& params) + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + : params(params) + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase389", reinterpret_cast(this)); + + } + ~FlowTestCase389ActorState() + { + fdb_probe_actor_destroy("flowTestCase389", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Span notSampled("foo"_loc); + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(!notSampled.context.isSampled()); + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Span childTraceIDMatchesParent("foo"_loc, SpanContext(UID(100, 101), 200, TraceFlags::sampled)); + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(childTraceIDMatchesParent.context.traceID.first() == childTraceIDMatchesParent.parentContext.traceID.first()); + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(childTraceIDMatchesParent.context.traceID.second() == childTraceIDMatchesParent.parentContext.traceID.second()); + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Span parentNotSampled("foo"_loc, SpanContext(UID(1, 1), 1, TraceFlags::unsampled)); + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(!parentNotSampled.context.isSampled()); + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase389ActorState(); static_cast(this)->destroy(); return 0; } + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase389ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase389ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + UnitTestParameters params; + #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase389() + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +class FlowTestCase389Actor final : public Actor, public FastAllocated, public FlowTestCase389ActorState { + #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + FlowTestCase389Actor(UnitTestParameters const& params) + #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + : Actor(), + FlowTestCase389ActorState(params) + { + fdb_probe_actor_enter("flowTestCase389", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase389"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase389", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +static Future flowTestCase389( UnitTestParameters const& params ) { + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + return Future(new FlowTestCase389Actor(params)); + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase389, "/flow/Tracing/CreateOTELSpan") + +#line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + + + #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase409() + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +template + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +class FlowTestCase409ActorState { + #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +public: + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + FlowTestCase409ActorState(UnitTestParameters const& params) + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + : params(params) + #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase409", reinterpret_cast(this)); + + } + ~FlowTestCase409ActorState() + { + fdb_probe_actor_destroy("flowTestCase409", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Span span1("span_with_event"_loc); + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto arena = span1.arena; + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + SmallVectorRef attrs; + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + attrs.push_back(arena, KeyValueRef("foo"_sr, "bar"_sr)); + #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + span1.addEvent("read_version"_sr, 1.0, attrs); + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.events[0].name.toString() == "read_version"); + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.events[0].time == 1.0); + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.events[0].attributes.begin()->key.toString() == "foo"); + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.events[0].attributes.begin()->value.toString() == "bar"); + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Span span2("span_with_event"_loc); + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + span2.addEvent(StringRef(span2.arena, "commit_succeed"_sr), 1234567.100); + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.events[0].name.toString() == "commit_succeed"); + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.events[0].time == 1234567.100); + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.events[0].attributes.size() == 0); + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Span span3("span_with_event"_loc); + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto s3Arena = span3.arena; + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + SmallVectorRef s3Attrs; + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + s3Attrs.push_back(s3Arena, KeyValueRef("xyz"_sr, "123"_sr)); + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + span3.addEvent("commit_fail"_sr, 1234567.100, s3Attrs).addEvent("commit_succeed"_sr, 1111.001, s3Attrs); + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span3.events[0].name.toString() == "commit_fail"); + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span3.events[0].time == 1234567.100); + #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span3.events[0].attributes.size() == 1); + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span3.events[0].attributes.begin()->key.toString() == "xyz"); + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span3.events[0].attributes.begin()->value.toString() == "123"); + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span3.events[1].name.toString() == "commit_succeed"); + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span3.events[1].time == 1111.001); + #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span3.events[1].attributes.size() == 1); + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span3.events[1].attributes.begin()->key.toString() == "xyz"); + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span3.events[1].attributes.begin()->value.toString() == "123"); + #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase409ActorState(); static_cast(this)->destroy(); return 0; } + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase409ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase409ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + UnitTestParameters params; + #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase409() + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +class FlowTestCase409Actor final : public Actor, public FastAllocated, public FlowTestCase409ActorState { + #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + FlowTestCase409Actor(UnitTestParameters const& params) + #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + : Actor(), + FlowTestCase409ActorState(params) + { + fdb_probe_actor_enter("flowTestCase409", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase409"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase409", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +static Future flowTestCase409( UnitTestParameters const& params ) { + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + return Future(new FlowTestCase409Actor(params)); + #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase409, "/flow/Tracing/AddEvents") + +#line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + + + #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase447() + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +template + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +class FlowTestCase447ActorState { + #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +public: + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + FlowTestCase447ActorState(UnitTestParameters const& params) + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + : params(params) + #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase447", reinterpret_cast(this)); + + } + ~FlowTestCase447ActorState() + { + fdb_probe_actor_destroy("flowTestCase447", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Span span1("span_with_attrs"_loc, SpanContext(deterministicRandom()->randomUniqueID(), deterministicRandom()->randomUInt64(), TraceFlags::sampled)); + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto arena = span1.arena; + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + span1.addAttribute(StringRef(arena, "foo"_sr), StringRef(arena, "bar"_sr)); + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + span1.addAttribute(StringRef(arena, "operation"_sr), StringRef(arena, "grv"_sr)); + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT_EQ(span1.attributes.size(), 3); + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.attributes[1] == KeyValueRef("foo"_sr, "bar"_sr)); + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.attributes[2] == KeyValueRef("operation"_sr, "grv"_sr)); + #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Span span2("span_with_attrs"_loc, SpanContext(deterministicRandom()->randomUniqueID(), deterministicRandom()->randomUInt64(), TraceFlags::sampled)); + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto s2Arena = span2.arena; + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + span2.addAttribute(StringRef(s2Arena, "a"_sr), StringRef(s2Arena, "1"_sr)) .addAttribute(StringRef(s2Arena, "b"_sr), "2"_sr) .addAttribute(StringRef(s2Arena, "c"_sr), "3"_sr); + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT_EQ(span2.attributes.size(), 4); + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.attributes[1] == KeyValueRef("a"_sr, "1"_sr)); + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.attributes[2] == KeyValueRef("b"_sr, "2"_sr)); + #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.attributes[3] == KeyValueRef("c"_sr, "3"_sr)); + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase447ActorState(); static_cast(this)->destroy(); return 0; } + #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase447ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase447ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + UnitTestParameters params; + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase447() + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +class FlowTestCase447Actor final : public Actor, public FastAllocated, public FlowTestCase447ActorState { + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + FlowTestCase447Actor(UnitTestParameters const& params) + #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + : Actor(), + FlowTestCase447ActorState(params) + { + fdb_probe_actor_enter("flowTestCase447", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase447"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase447", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +static Future flowTestCase447( UnitTestParameters const& params ) { + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + return Future(new FlowTestCase447Actor(params)); + #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase447, "/flow/Tracing/AddAttributes") + +#line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + + + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase475() + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +template + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +class FlowTestCase475ActorState { + #line 1295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +public: + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + FlowTestCase475ActorState(UnitTestParameters const& params) + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + : params(params) + #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase475", reinterpret_cast(this)); + + } + ~FlowTestCase475ActorState() + { + fdb_probe_actor_destroy("flowTestCase475", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Span span1("span_with_links"_loc); + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(!span1.context.isSampled()); + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(!span1.context.isValid()); + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + span1.addLink(SpanContext(UID(100, 101), 200, TraceFlags::sampled)); + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + span1.addLink(SpanContext(UID(200, 201), 300, TraceFlags::unsampled)) .addLink(SpanContext(UID(300, 301), 400, TraceFlags::sampled)); + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.context.isSampled()); + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.context.isValid()); + #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.links[0].traceID == UID(100, 101)); + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.links[0].spanID == 200); + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.links[0].m_Flags == TraceFlags::sampled); + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.links[1].traceID == UID(200, 201)); + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.links[1].spanID == 300); + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.links[1].m_Flags == TraceFlags::unsampled); + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.links[2].traceID == UID(300, 301)); + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.links[2].spanID == 400); + #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span1.links[2].m_Flags == TraceFlags::sampled); + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Span span2("span_with_links"_loc); + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(!span2.context.isSampled()); + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(!span2.context.isValid()); + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto link1 = SpanContext(UID(1, 1), 1, TraceFlags::sampled); + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto link2 = SpanContext(UID(2, 2), 2, TraceFlags::sampled); + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto link3 = SpanContext(UID(3, 3), 3, TraceFlags::sampled); + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + span2.addLinks({ link1, link2 }).addLinks({ link3 }); + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.context.isSampled()); + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.context.isValid()); + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.links[0].traceID == UID(1, 1)); + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.links[0].spanID == 1); + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.links[0].m_Flags == TraceFlags::sampled); + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.links[1].traceID == UID(2, 2)); + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.links[1].spanID == 2); + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.links[1].m_Flags == TraceFlags::sampled); + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.links[2].traceID == UID(3, 3)); + #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.links[2].spanID == 3); + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(span2.links[2].m_Flags == TraceFlags::sampled); + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase475ActorState(); static_cast(this)->destroy(); return 0; } + #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase475ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase475ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + UnitTestParameters params; + #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase475() + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +class FlowTestCase475Actor final : public Actor, public FastAllocated, public FlowTestCase475ActorState { + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + FlowTestCase475Actor(UnitTestParameters const& params) + #line 1424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + : Actor(), + FlowTestCase475ActorState(params) + { + fdb_probe_actor_enter("flowTestCase475", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase475"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase475", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +static Future flowTestCase475( UnitTestParameters const& params ) { + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + return Future(new FlowTestCase475Actor(params)); + #line 1451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase475, "/flow/Tracing/AddLinks") + +#line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + + +uint16_t swapUint16BE(uint8_t* index) { + uint16_t value; + memcpy(&value, index, sizeof(value)); + return fromBigEndian16(value); +} + +uint64_t swapUint64BE(uint8_t* index) { + uint64_t value; + memcpy(&value, index, sizeof(value)); + return fromBigEndian64(value); +} + +double swapDoubleBE(uint8_t* index) { + double value; + memcpy(&value, index, sizeof(value)); + char* const p = reinterpret_cast(&value); + for (size_t i = 0; i < sizeof(double) / 2; ++i) + std::swap(p[i], p[sizeof(double) - i - 1]); + return value; +} + +std::string readMPString(uint8_t* index, int len) { + uint8_t data[len + 1]; + std::copy(index, index + len, data); + data[len] = '\0'; + return reinterpret_cast(data); +} + +std::string readMPString(uint8_t* index) { + auto len = 0; + switch (*index) { + case 0xda: + index++; // read the size in the next 2 bytes + len = swapUint16BE(index); + index += 2; // move index past the size bytes + break; + default: + // We & out the bits here that contain the length the initial 3 higher order bits are + // to signify this is a string of len <= 31 chars. + len = static_cast(*index & 0b00011111); + index++; + } + uint8_t data[len + 1]; + std::copy(index, index + len, data); + data[len] = '\0'; + return reinterpret_cast(data); +} + +// Windows doesn't like lack of header and declaration of constructor for FastUDPTracer +#ifndef WIN32 + #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase569() + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +template + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +class FlowTestCase569ActorState { + #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +public: + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + FlowTestCase569ActorState(UnitTestParameters const& params) + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + : params(params) + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase569", reinterpret_cast(this)); + + } + ~FlowTestCase569ActorState() + { + fdb_probe_actor_destroy("flowTestCase569", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Span span1("encoded_span"_loc); + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto request = MsgpackBuffer{ .buffer = std::make_unique(kTraceBufferSize), .data_size = 0, .buffer_size = kTraceBufferSize }; + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto tracer = FastUDPTracer(); + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + tracer.serialize_span(span1, request); + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto data = request.buffer.get(); + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[0] == 0b10011100); + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + request.reset(); + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Span span2("encoded_span"_loc, SpanContext(UID(100, 101), 1, TraceFlags::sampled), { SpanContext(UID(200, 201), 2, TraceFlags::sampled) }); + #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + tracer.serialize_span(span2, request); + #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + data = request.buffer.get(); + #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[0] == 0b10011100); + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[1] == 0xcf); + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(swapUint64BE(&data[2]) == 100); + #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[10] == 0xcf); + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(swapUint64BE(&data[11]) == 101); + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[19] == 0xcf); + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[28] == 0xcf); + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(swapUint64BE(&data[29]) == 1); + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(readMPString(&data[37]) == "encoded_span"); + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[50] == 0xcb); + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[59] == 0xcb); + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[68] == 0xcc); + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[69] == static_cast(SpanKind::SERVER)); + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[70] == 0xcc); + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[71] == static_cast(SpanStatus::OK)); + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[72] == 0b10010001); + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[73] == 0xcf); + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(swapUint64BE(&data[74]) == 200); + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[82] == 0xcf); + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(swapUint64BE(&data[83]) == 201); + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[91] == 0xcf); + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(swapUint64BE(&data[92]) == 2); + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[100] == 0b10010000); + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[101] == 0b10000001); + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[102] == 0b10100111); + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + request.reset(); + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Span span3("encoded_span_3"_loc, SpanContext()); + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto s3Arena = span3.arena; + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + SmallVectorRef attrs; + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + attrs.push_back(s3Arena, KeyValueRef("foo"_sr, "bar"_sr)); + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + span3.addAttribute("operation"_sr, "grv"_sr) .addLink(SpanContext(UID(300, 301), 400, TraceFlags::sampled)) .addEvent(StringRef(s3Arena, "event1"_sr), 100.101, attrs); + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + tracer.serialize_span(span3, request); + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + data = request.buffer.get(); + #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[0] == 0b10011100); + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(readMPString(&data[37]) == "encoded_span_3"); + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[52] == 0xcb); + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[61] == 0xcb); + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[70] == 0xcc); + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[71] == static_cast(SpanKind::SERVER)); + #line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[72] == 0xcc); + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[73] == static_cast(SpanStatus::OK)); + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[74] == 0b10010001); + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[75] == 0xcf); + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(swapUint64BE(&data[76]) == 300); + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[84] == 0xcf); + #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(swapUint64BE(&data[85]) == 301); + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[93] == 0xcf); + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(swapUint64BE(&data[94]) == 400); + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[102] == 0b10010001); + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(readMPString(&data[103]) == "event1"); + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[110] == 0xcb); + #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(swapDoubleBE(&data[111]) == 100.101); + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[119] == 0b10000001); + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(readMPString(&data[120]) == "foo"); + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(readMPString(&data[124]) == "bar"); + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[128] == 0b10000010); + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + std::unordered_map attributes; + #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto index = 129; + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto firstKey = readMPString(&data[index]); + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + index += firstKey.length() + 1; + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto firstValue = readMPString(&data[index]); + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + index += firstValue.length() + 1; + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + attributes[firstKey] = firstValue; + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto secondKey = readMPString(&data[index]); + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + index += secondKey.length() + 1; + #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto secondValue = readMPString(&data[index]); + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + attributes[secondKey] = secondValue; + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(attributes.find("address") != attributes.end()); + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(attributes["operation"] == "grv"); + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + request.reset(); + #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + const char* longString = "yGUtj42gSKfdqib3f0Ri4OVhD7eWyTbKsH/g9+x4UWyXry7NIBFIapPV9f1qdTRl" "2jXcZI8Ua/Gp8k9EBn7peaEN1uj4w9kf4FQ2Lalu0VrA4oquQoaKYr+wPsLBak9i" "uyZDF9sX/HW4pVvQhPQdXQWME5E7m58XFMpZ3H8HNXuytWInEuh97SRLlI0RhrvG" "ixNpYtYlvghsLCrEdZMMGnS2gXgGufIdg1xKJd30fUbZLHcYIC4DTnL5RBpkbQCR" "SGKKUrpIb/7zePhBDi+gzUzyAcbQ2zUbFWI1KNi3zQk58uUG6wWJZkw+GCs7Cc3V" "OUxOljwCJkC4QTgdsbbFhxUC+rtoHV5xAqoTQwR0FXnWigUjP7NtdL6huJUr3qRv" "40c4yUI1a4+P5vJa"; + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + Span span4; + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + auto location = Location(); + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + location.name = StringRef(span4.arena, longString); + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + span4.location = location; + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + tracer.serialize_span(span4, request); + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + data = request.buffer.get(); + #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[0] == 0b10011100); + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(data[37] == 0xda); + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + ASSERT(readMPString(&data[37]) == longString); + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase569ActorState(); static_cast(this)->destroy(); return 0; } + #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase569ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase569ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + UnitTestParameters params; + #line 1741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase569() + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +class FlowTestCase569Actor final : public Actor, public FastAllocated, public FlowTestCase569ActorState { + #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + FlowTestCase569Actor(UnitTestParameters const& params) + #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" + : Actor(), + FlowTestCase569ActorState(params) + { + fdb_probe_actor_enter("flowTestCase569", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase569"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase569", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" +static Future flowTestCase569( UnitTestParameters const& params ) { + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + return Future(new FlowTestCase569Actor(params)); + #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase569, "/flow/Tracing/FastUDPMessagePackEncoding") + +#line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/Tracing.actor.cpp" + +#endif diff --git a/src/fdbclient/Tuple.cpp b/src/fdbclient/Tuple.cpp index 729c910..5a8d9ae 100644 --- a/src/fdbclient/Tuple.cpp +++ b/src/fdbclient/Tuple.cpp @@ -19,8 +19,11 @@ */ #include "fdbclient/Tuple.h" +#include "flow/UnitTest.h" const uint8_t VERSIONSTAMP_96_CODE = 0x33; +const uint8_t USER_TYPE_START = 0x40; +const uint8_t USER_TYPE_END = 0x4f; // TODO: Many functions copied from bindings/flow/Tuple.cpp. Merge at some point. static float bigEndianFloat(float orig) { @@ -58,7 +61,7 @@ static void adjustFloatingPoint(uint8_t* bytes, size_t size, bool encode) { } } -Tuple::Tuple(StringRef const& str, bool exclude_incomplete) { +Tuple::Tuple(StringRef const& str, bool exclude_incomplete, bool include_user_type) { data.append(data.arena(), str.begin(), str.size()); size_t i = 0; @@ -79,6 +82,9 @@ Tuple::Tuple(StringRef const& str, bool exclude_incomplete) { i += 1; } else if (data[i] == VERSIONSTAMP_96_CODE) { i += VERSIONSTAMP_TUPLE_SIZE + 1; + } else if (include_user_type && isUserType(data[i])) { + // User defined codes must come at the end of a Tuple and are not delimited. + i = data.size(); } else { throw invalid_tuple_data_type(); } @@ -93,6 +99,56 @@ Tuple Tuple::unpack(StringRef const& str, bool exclude_incomplete) { return Tuple(str, exclude_incomplete); } +std::string Tuple::tupleToString(const Tuple& tuple) { + std::string str; + if (tuple.size() > 1) { + str += "("; + } + for (int i = 0; i < tuple.size(); ++i) { + Tuple::ElementType type = tuple.getType(i); + if (type == Tuple::NULL_TYPE) { + str += "NULL"; + } else if (type == Tuple::BYTES || type == Tuple::UTF8) { + if (type == Tuple::UTF8) { + str += "u"; + } + str += "\'" + tuple.getString(i).printable() + "\'"; + } else if (type == Tuple::INT) { + str += format("%ld", tuple.getInt(i)); + } else if (type == Tuple::FLOAT) { + str += format("%f", tuple.getFloat(i)); + } else if (type == Tuple::DOUBLE) { + str += format("%f", tuple.getDouble(i)); + } else if (type == Tuple::BOOL) { + str += tuple.getBool(i) ? "true" : "false"; + } else if (type == Tuple::VERSIONSTAMP) { + TupleVersionstamp versionstamp = tuple.getVersionstamp(i); + str += format("Transaction Version: '%ld', BatchNumber: '%hd', UserVersion : '%hd'", + versionstamp.getVersion(), + versionstamp.getBatchNumber(), + versionstamp.getUserVersion()); + } else { + ASSERT(false); + } + + if (i < tuple.size() - 1) { + str += ", "; + } + } + if (tuple.size() > 1) { + str += ")"; + } + return str; +} + +Tuple Tuple::unpackUserType(StringRef const& str, bool exclude_incomplete) { + return Tuple(str, exclude_incomplete, true); +} + +bool Tuple::isUserType(uint8_t code) const { + return code >= USER_TYPE_START && code <= USER_TYPE_END; +} + Tuple& Tuple::append(Tuple const& tuple) { for (size_t offset : tuple.offsets) { offsets.push_back(offset + data.size()); @@ -103,7 +159,7 @@ Tuple& Tuple::append(Tuple const& tuple) { return *this; } -Tuple& Tuple::appendVersionstamp(Versionstamp const& vs) { +Tuple& Tuple::append(TupleVersionstamp const& vs) { offsets.push_back(data.size()); data.push_back(data.arena(), VERSIONSTAMP_96_CODE); @@ -134,6 +190,10 @@ Tuple& Tuple::append(StringRef const& str, bool utf8) { return *this; } +Tuple& Tuple::append(UnicodeStr const& str) { + return append(str.str, true); +} + Tuple& Tuple::appendRaw(StringRef const& str) { offsets.push_back(data.size()); @@ -166,7 +226,11 @@ Tuple& Tuple::append(int64_t value) { return *this; } -Tuple& Tuple::appendBool(bool value) { +Tuple& Tuple::append(int32_t value) { + return append((int64_t)value); +} + +Tuple& Tuple::append(bool value) { offsets.push_back(data.size()); if (value) { data.push_back(data.arena(), 0x27); @@ -176,7 +240,7 @@ Tuple& Tuple::appendBool(bool value) { return *this; } -Tuple& Tuple::appendFloat(float value) { +Tuple& Tuple::append(float value) { offsets.push_back(data.size()); float swap = bigEndianFloat(value); uint8_t* bytes = (uint8_t*)&swap; @@ -187,7 +251,7 @@ Tuple& Tuple::appendFloat(float value) { return *this; } -Tuple& Tuple::appendDouble(double value) { +Tuple& Tuple::append(double value) { offsets.push_back(data.size()); double swap = value; swap = bigEndianDouble(swap); @@ -199,12 +263,25 @@ Tuple& Tuple::appendDouble(double value) { return *this; } -Tuple& Tuple::appendNull() { +Tuple& Tuple::append(std::nullptr_t) { offsets.push_back(data.size()); data.push_back(data.arena(), (uint8_t)'\x00'); return *this; } +Tuple& Tuple::appendNull() { + return append(nullptr); +} + +Tuple& Tuple::append(Tuple::UserTypeStr const& udt) { + offsets.push_back(data.size()); + ASSERT(isUserType(udt.code)); + data.push_back(data.arena(), udt.code); + data.append(data.arena(), udt.str.begin(), udt.str.size()); + + return *this; +} + Tuple::ElementType Tuple::getType(size_t index) const { if (index >= offsets.size()) { throw invalid_tuple_index(); @@ -228,6 +305,8 @@ Tuple::ElementType Tuple::getType(size_t index) const { return ElementType::BOOL; } else if (code == VERSIONSTAMP_96_CODE) { return ElementType::VERSIONSTAMP; + } else if (isUserType(code)) { + return ElementType::USER_TYPE; } else { throw invalid_tuple_data_type(); } @@ -376,7 +455,7 @@ double Tuple::getDouble(size_t index) const { return bigEndianDouble(swap); } -Versionstamp Tuple::getVersionstamp(size_t index) const { +TupleVersionstamp Tuple::getVersionstamp(size_t index) const { if (index >= offsets.size()) { throw invalid_tuple_index(); } @@ -385,7 +464,30 @@ Versionstamp Tuple::getVersionstamp(size_t index) const { if (code != VERSIONSTAMP_96_CODE) { throw invalid_tuple_data_type(); } - return Versionstamp(StringRef(data.begin() + offsets[index] + 1, VERSIONSTAMP_TUPLE_SIZE)); + return TupleVersionstamp(StringRef(data.begin() + offsets[index] + 1, VERSIONSTAMP_TUPLE_SIZE)); +} + +Tuple::UserTypeStr Tuple::getUserType(size_t index) const { + // Valid index. + if (index >= offsets.size()) { + throw invalid_tuple_index(); + } + + // Valid user type code. + ASSERT_LT(offsets[index], data.size()); + uint8_t code = data[offsets[index]]; + if (!isUserType(code)) { + throw invalid_tuple_data_type(); + } + + size_t start = offsets[index] + 1; + + Standalone str; + VectorRef staging; + staging.append(str.arena(), data.begin() + start, data.size() - start); + str.StringRef::operator=(StringRef(staging.begin(), staging.size())); + + return Tuple::UserTypeStr(code, str); } KeyRange Tuple::range(Tuple const& tuple) const { @@ -426,3 +528,76 @@ StringRef Tuple::subTupleRawString(size_t index) const { size_t endPos = end < offsets.size() ? offsets[end] : data.size(); return StringRef(data.begin() + offsets[index], endPos - offsets[index]); } + +TEST_CASE("/fdbclient/Tuple/makeTuple") { + Tuple t1 = Tuple::makeTuple(1, + 1.0f, + 1.0, + false, + "byteStr"_sr, + Tuple::UnicodeStr("str"_sr), + nullptr, + TupleVersionstamp("000000000000"_sr), + Tuple::UserTypeStr(0x41, "12345678"_sr)); + Tuple t2 = Tuple() + .append(1) + .append(1.0f) + .append(1.0) + .append(false) + .append("byteStr"_sr) + .append(Tuple::UnicodeStr("str"_sr)) + .append(nullptr) + .append(TupleVersionstamp("000000000000"_sr)) + .append(Tuple::UserTypeStr(0x41, "12345678"_sr)); + + ASSERT(t1.pack() == t2.pack()); + ASSERT(t1.getType(0) == Tuple::INT); + ASSERT(t1.getType(1) == Tuple::FLOAT); + ASSERT(t1.getType(2) == Tuple::DOUBLE); + ASSERT(t1.getType(3) == Tuple::BOOL); + ASSERT(t1.getType(4) == Tuple::BYTES); + ASSERT(t1.getType(5) == Tuple::UTF8); + ASSERT(t1.getType(6) == Tuple::NULL_TYPE); + ASSERT(t1.getType(7) == Tuple::VERSIONSTAMP); + ASSERT(t1.getType(8) == Tuple::USER_TYPE); + ASSERT(t1.size() == 9); + + return Void(); +} + +TEST_CASE("/fdbclient/Tuple/unpack") { + Tuple t1 = Tuple::makeTuple(1, + 1.0f, + 1.0, + false, + "byteStr"_sr, + Tuple::UnicodeStr("str"_sr), + nullptr, + TupleVersionstamp("000000000000"_sr), + Tuple::UserTypeStr(0x41, "12345678"_sr)); + + Standalone packed = t1.pack(); + Tuple t2 = Tuple::unpackUserType(packed); + ASSERT(t2.pack() == t1.pack()); + ASSERT(t2.getInt(0) == t1.getInt(0)); + ASSERT(t2.getFloat(1) == t1.getFloat(1)); + ASSERT(t2.getDouble(2) == t1.getDouble(2)); + ASSERT(t2.getBool(3) == t1.getBool(3)); + ASSERT(t2.getString(4) == t1.getString(4)); + ASSERT(t2.getString(5) == t1.getString(5)); + ASSERT(t2.getType(6) == Tuple::NULL_TYPE); + ASSERT(t2.getVersionstamp(7) == t1.getVersionstamp(7)); + ASSERT(t2.getUserType(8) == t1.getUserType(8)); + ASSERT(t2.size() == 9); + + try { + Tuple t3 = Tuple::unpack(packed); + ASSERT(false); + } catch (Error& e) { + if (e.code() != error_code_invalid_tuple_data_type) { + throw e; + } + } + + return Void(); +} diff --git a/src/fdbclient/Versionstamp.cpp b/src/fdbclient/TupleVersionstamp.cpp similarity index 64% rename from src/fdbclient/Versionstamp.cpp rename to src/fdbclient/TupleVersionstamp.cpp index 7a61936..91e0182 100644 --- a/src/fdbclient/Versionstamp.cpp +++ b/src/fdbclient/TupleVersionstamp.cpp @@ -1,13 +1,13 @@ -#include "fdbclient/Versionstamp.h" +#include "fdbclient/TupleVersionstamp.h" -Versionstamp::Versionstamp(StringRef str) { +TupleVersionstamp::TupleVersionstamp(StringRef str) { if (str.size() != VERSIONSTAMP_TUPLE_SIZE) { throw invalid_versionstamp_size(); } data = str; } -int16_t Versionstamp::getBatchNumber() const { +int16_t TupleVersionstamp::getBatchNumber() const { const uint8_t* begin = data.begin(); begin += 8; int16_t batchNumber = *(int16_t*)(begin); @@ -15,7 +15,7 @@ int16_t Versionstamp::getBatchNumber() const { return batchNumber; } -int16_t Versionstamp::getUserVersion() const { +int16_t TupleVersionstamp::getUserVersion() const { const uint8_t* begin = data.begin(); begin += 10; int16_t userVersion = *(int16_t*)(begin); @@ -23,22 +23,22 @@ int16_t Versionstamp::getUserVersion() const { return userVersion; } -const uint8_t* Versionstamp::begin() const { +const uint8_t* TupleVersionstamp::begin() const { return data.begin(); } -int64_t Versionstamp::getVersion() const { +int64_t TupleVersionstamp::getVersion() const { const uint8_t* begin = data.begin(); int64_t version = *(int64_t*)begin; version = bigEndian64(version); return version; } -size_t Versionstamp::size() const { +size_t TupleVersionstamp::size() const { return VERSIONSTAMP_TUPLE_SIZE; } -bool Versionstamp::operator==(const Versionstamp& other) const { +bool TupleVersionstamp::operator==(const TupleVersionstamp& other) const { return getVersion() == other.getVersion() && getBatchNumber() == other.getBatchNumber() && getUserVersion() == other.getUserVersion(); } \ No newline at end of file diff --git a/src/fdbclient/VersionVector.cpp b/src/fdbclient/VersionVector.cpp new file mode 100644 index 0000000..ffd11a1 --- /dev/null +++ b/src/fdbclient/VersionVector.cpp @@ -0,0 +1,380 @@ +/* + * VersionVector.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "flow/Arena.h" +#include "flow/UnitTest.h" +#include "fdbclient/VersionVector.h" + +namespace unit_tests { + +struct TestContextArena { + Arena& _arena; + Arena& arena() { return _arena; } + ProtocolVersion protocolVersion() const { return g_network->protocolVersion(); } + uint8_t* allocate(size_t size) { return new (_arena) uint8_t[size]; } +}; + +TEST_CASE("/fdbclient/VersionVector/emptyVV") { + Arena arena; + TestContextArena context{ arena }; + + { + VersionVector serializedVV; // an empty version vector + size_t size = dynamic_size_traits::size(serializedVV, context); + + uint8_t* buf = context.allocate(size); + dynamic_size_traits::save(buf, serializedVV, context); + + VersionVector deserializedVV; + dynamic_size_traits::load(buf, size, deserializedVV, context); + + ASSERT(serializedVV.compare(deserializedVV)); + } + + { + VersionVector serializedVV(133200164); // "VersionVector::maxVersion" is set, empty otherwise + size_t size = dynamic_size_traits::size(serializedVV, context); + + uint8_t* buf = context.allocate(size); + dynamic_size_traits::save(buf, serializedVV, context); + + VersionVector deserializedVV; + dynamic_size_traits::load(buf, size, deserializedVV, context); + + ASSERT(serializedVV.compare(deserializedVV)); + } + + return Void(); +} + +TEST_CASE("/fdbclient/VersionVector/simpleVV") { + Arena arena; + TestContextArena context{ arena }; + + VersionVector serializedVV; + serializedVV.setVersion(Tag(-1, 2), 3619339); + serializedVV.setVersion(Tag(0, 13), 13292611); + + std::set tags; + tags.emplace(0, 2); + tags.emplace(0, 1); + tags.emplace(0, 0); + serializedVV.setVersion(tags, 13391141); + + size_t size = dynamic_size_traits::size(serializedVV, context); + + uint8_t* buf = context.allocate(size); + dynamic_size_traits::save(buf, serializedVV, context); + + VersionVector deserializedVV; + dynamic_size_traits::load(buf, size, deserializedVV, context); + + ASSERT(serializedVV.compare(deserializedVV)); + + return Void(); +} + +// Populates version vector (with randomly generated tag localities, ids, and commit versions) +// based on the given specifications. +// @param vv Version vector +// @param tagCount total number of storage servers in the cluster +// @param localityCount total number of localities/regions in the cluster +// @param maxTagId maximum value of any tag id in the cluster +// @param maxCommitVersionDelta maximum difference between commit versions in the version vector +// @note assumes each locality contains the same number of tags +// @note picks locality values randomly from range [tagLocalityInvalid+1, INT8_MAX) +void populateVersionVector(VersionVector& vv, + int tagCount, + int localityCount, + int maxTagId, + const uint64_t maxCommitVersionDelta) { + std::vector ids; + std::vector localities; + Version minVersion; + std::vector versions; + int tagsPerLocality = tagCount / localityCount; + + // Populate localities. + while (localities.size() < (size_t)localityCount) { + int8_t locality = deterministicRandom()->randomInt(tagLocalityInvalid + 1, INT8_MAX); + if (std::find(localities.begin(), localities.end(), locality) == localities.end()) { + localities.push_back(locality); + } + } + + // Populate ids. + for (int i = 0; i < tagCount; i++) { + // Some of the ids could be duplicates, that's fine. + ids.push_back(deterministicRandom()->randomInt(0, maxTagId)); + } + + // Choose a value for minVersion. (Choose a value in such a way that + // "minVersion + maxCommitVersionDelta" does not exceed INT64_MAX.) + if (maxCommitVersionDelta <= UINT16_MAX) { + minVersion = deterministicRandom()->randomUInt32(); + } else if (maxCommitVersionDelta <= UINT32_MAX) { + minVersion = deterministicRandom()->randomInt(0, UINT16_MAX); + } else { + minVersion = 0; + } + + // Populate versions. + Version versionDelta; + for (int i = 0; i < tagCount; i++) { + if (maxCommitVersionDelta <= UINT8_MAX) { + versionDelta = deterministicRandom()->randomInt(0, UINT8_MAX); + } else if (maxCommitVersionDelta <= UINT16_MAX) { + versionDelta = deterministicRandom()->randomInt(0, UINT16_MAX); + } else if (maxCommitVersionDelta <= UINT32_MAX) { + versionDelta = deterministicRandom()->randomUInt32(); + } else { + versionDelta = deterministicRandom()->randomInt64(0, INT64_MAX); + } + // Some of the versions could be duplicates, that's fine. + versions.push_back(minVersion + versionDelta); + } + + // Sort versions. + std::sort(versions.begin(), versions.end()); + + // Populate the version vector. + std::set tags; + int tagIndex = 0; + for (int i = 0; i < localities.size() && tagIndex < tagCount; i++) { + for (int j = 0; j < tagsPerLocality && tagIndex < tagCount; j++, tagIndex++) { + if (Tag(localities[i], ids[tagIndex]) == invalidTag) { + continue; // skip this tag (this version also gets skipped, that's fine) + } + if (versions[tagIndex] == vv.getMaxVersion()) { + tags.emplace(localities[i], ids[tagIndex]); + continue; // skip this version; this tag will get the next higher version + } + if (tags.empty()) { + vv.setVersion(Tag(localities[i], ids[tagIndex]), versions[tagIndex]); + } else { + vv.setVersion(tags, versions[tagIndex]); + tags.clear(); + } + } + } + ASSERT(tagIndex == tagCount); +} + +TEST_CASE("/fdbclient/VersionVector/testA") { + Arena arena; + TestContextArena context{ arena }; + + VersionVector serializedVV; + // 80 storage servers spread over 2 regions, maxTagId < INT8_MAX, and + // maxCommitVersionDelta < UINT8_MAX. + populateVersionVector(serializedVV, 80, 2, INT8_MAX, UINT8_MAX); + + size_t size = dynamic_size_traits::size(serializedVV, context); + + uint8_t* buf = context.allocate(size); + dynamic_size_traits::save(buf, serializedVV, context); + + VersionVector deserializedVV; + dynamic_size_traits::load(buf, size, deserializedVV, context); + + ASSERT(serializedVV.compare(deserializedVV)); + + return Void(); +} + +TEST_CASE("/fdbclient/VersionVector/testB") { + Arena arena; + TestContextArena context{ arena }; + + VersionVector serializedVV; + // 800 storage servers spread over 2 regions, maxTagId < INT16_MAX, and + // maxCommitVersionDelta < UINT8_MAX. + populateVersionVector(serializedVV, 800, 2, INT16_MAX, UINT8_MAX); + + size_t size = dynamic_size_traits::size(serializedVV, context); + + uint8_t* buf = context.allocate(size); + dynamic_size_traits::save(buf, serializedVV, context); + + VersionVector deserializedVV; + dynamic_size_traits::load(buf, size, deserializedVV, context); + + ASSERT(serializedVV.compare(deserializedVV)); + + return Void(); +} + +TEST_CASE("/fdbclient/VersionVector/testC") { + Arena arena; + TestContextArena context{ arena }; + + VersionVector serializedVV; + // 800 storage servers spread over 2 regions, maxTagId < INT16_MAX, and + // maxCommitVersionDelta < UINT16_MAX. + populateVersionVector(serializedVV, 800, 2, INT16_MAX, UINT16_MAX); + + size_t size = dynamic_size_traits::size(serializedVV, context); + + uint8_t* buf = context.allocate(size); + dynamic_size_traits::save(buf, serializedVV, context); + + VersionVector deserializedVV; + dynamic_size_traits::load(buf, size, deserializedVV, context); + + ASSERT(serializedVV.compare(deserializedVV)); + + return Void(); +} + +TEST_CASE("/fdbclient/VersionVector/testD") { + Arena arena; + TestContextArena context{ arena }; + + VersionVector serializedVV; + // 800 storage servers spread over 2 regions, maxTagId < INT16_MAX, and + // maxCommitVersionDelta < UINT32_MAX. + populateVersionVector(serializedVV, 800, 2, INT16_MAX, UINT32_MAX); + + size_t size = dynamic_size_traits::size(serializedVV, context); + + uint8_t* buf = context.allocate(size); + dynamic_size_traits::save(buf, serializedVV, context); + + VersionVector deserializedVV; + dynamic_size_traits::load(buf, size, deserializedVV, context); + + ASSERT(serializedVV.compare(deserializedVV)); + + return Void(); +} + +TEST_CASE("/fdbclient/VersionVector/testE") { + Arena arena; + TestContextArena context{ arena }; + + VersionVector serializedVV; + // 800 storage servers spread over 2 regions, maxTagId < INT16_MAX, and + // maxCommitVersionDelta < UINT64_MAX. + populateVersionVector(serializedVV, 800, 2, INT16_MAX, UINT64_MAX); + + size_t size = dynamic_size_traits::size(serializedVV, context); + + uint8_t* buf = context.allocate(size); + dynamic_size_traits::save(buf, serializedVV, context); + + VersionVector deserializedVV; + dynamic_size_traits::load(buf, size, deserializedVV, context); + + ASSERT(serializedVV.compare(deserializedVV)); + + return Void(); +} + +TEST_CASE("/fdbclient/VersionVector/testF") { + Arena arena; + TestContextArena context{ arena }; + + VersionVector serializedVV; + // 1600 storage servers spread over 4 regions, maxTagId < INT16_MAX, and + // maxCommitVersionDelta < UINT8_MAX. + populateVersionVector(serializedVV, 1600, 4, INT16_MAX, UINT8_MAX); + + size_t size = dynamic_size_traits::size(serializedVV, context); + + uint8_t* buf = context.allocate(size); + dynamic_size_traits::save(buf, serializedVV, context); + + VersionVector deserializedVV; + dynamic_size_traits::load(buf, size, deserializedVV, context); + + ASSERT(serializedVV.compare(deserializedVV)); + + return Void(); +} + +TEST_CASE("/fdbclient/VersionVector/testG") { + Arena arena; + TestContextArena context{ arena }; + + VersionVector serializedVV; + // 1600 storage servers spread over 4 regions, maxTagId < INT16_MAX, and + // maxCommitVersionDelta < UINT16_MAX. + populateVersionVector(serializedVV, 1600, 4, INT16_MAX, UINT16_MAX); + + size_t size = dynamic_size_traits::size(serializedVV, context); + + uint8_t* buf = context.allocate(size); + dynamic_size_traits::save(buf, serializedVV, context); + + VersionVector deserializedVV; + dynamic_size_traits::load(buf, size, deserializedVV, context); + + ASSERT(serializedVV.compare(deserializedVV)); + + return Void(); +} + +TEST_CASE("/fdbclient/VersionVector/testH") { + Arena arena; + TestContextArena context{ arena }; + + VersionVector serializedVV; + // 3200 storage servers spread over 4 regions, maxTagId < INT16_MAX, and + // maxCommitVersionDelta < UINT32_MAX. + populateVersionVector(serializedVV, 3200, 4, INT16_MAX, UINT32_MAX); + + size_t size = dynamic_size_traits::size(serializedVV, context); + + uint8_t* buf = context.allocate(size); + dynamic_size_traits::save(buf, serializedVV, context); + + VersionVector deserializedVV; + dynamic_size_traits::load(buf, size, deserializedVV, context); + + ASSERT(serializedVV.compare(deserializedVV)); + + return Void(); +} + +TEST_CASE("/fdbclient/VersionVector/testI") { + Arena arena; + TestContextArena context{ arena }; + + VersionVector serializedVV; + // 3200 storage servers spread over 4 regions, maxTagId < INT16_MAX, and + // maxCommitVersionDelta < UINT64_MAX. + populateVersionVector(serializedVV, 3200, 4, INT16_MAX, UINT64_MAX); + + size_t size = dynamic_size_traits::size(serializedVV, context); + + uint8_t* buf = context.allocate(size); + dynamic_size_traits::save(buf, serializedVV, context); + + VersionVector deserializedVV; + dynamic_size_traits::load(buf, size, deserializedVV, context); + + ASSERT(serializedVV.compare(deserializedVV)); + + return Void(); +} + +} // namespace unit_tests + +void forceLinkVersionVectorTests() {} diff --git a/src/fdbclient/VersionVector.h b/src/fdbclient/VersionVector.h deleted file mode 100644 index 82eeb12..0000000 --- a/src/fdbclient/VersionVector.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * VersionVector.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2021 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. - */ - -#ifndef FDBCLIENT_VERSION_VECTOR_H -#define FDBCLIENT_VERSION_VECTOR_H - -#pragma once - -#include -#include - -#include "fdbclient/FDBTypes.h" -#include "fdbclient/Knobs.h" - -struct VersionVector { - boost::container::flat_map versions; - Version maxVersion; // Specifies the max version in this version vector. (Note: - // there may or may not be a corresponding entry for this - // version in the "versions" map.) - - VersionVector() : maxVersion(invalidVersion) {} - VersionVector(Version version) : maxVersion(version) {} - -private: - // Only invoked by getDelta() and applyDelta(), where tag has been validated - // and version is guaranteed to be larger than the existing value. - inline void setVersionNoCheck(const Tag& tag, Version version) { versions[tag] = version; } - -public: - Version getMaxVersion() const { return maxVersion; } - - int size() const { return versions.size(); } - - void setVersion(const Tag& tag, Version version) { - ASSERT(tag != invalidTag); - ASSERT(version > maxVersion); - versions[tag] = version; - maxVersion = version; - } - - void setVersion(const std::set& tags, Version version, int8_t localityFilter = tagLocalityInvalid) { - ASSERT(version > maxVersion); - for (auto& tag : tags) { - ASSERT(tag != invalidTag); - ASSERT(tag.locality > tagLocalityInvalid); - if (localityFilter == tagLocalityInvalid || tag.locality == localityFilter) { - versions[tag] = version; - } - } - maxVersion = version; - } - - bool hasVersion(const Tag& tag) const { - ASSERT(tag != invalidTag); - return versions.find(tag) != versions.end(); - } - - // @pre assumes that the given tag has an entry in the version vector. - Version getVersion(const Tag& tag) const { - ASSERT(tag != invalidTag); - auto iter = versions.find(tag); - ASSERT(iter != versions.end()); - return iter->second; - } - - void clear() { - versions.clear(); - maxVersion = invalidVersion; - } - - // @note this method, together with method applyDelta(), helps minimize - // the number of version vector entries that get sent from sequencer to - // grv proxy (and from grv proxy to client) on the read path. - void getDelta(Version refVersion, VersionVector& delta) const { - ASSERT(refVersion <= maxVersion); - - delta.clear(); - - if (refVersion == maxVersion) { - return; // rerurn an invalid version vector - } - - if (CLIENT_KNOBS->SEND_ENTIRE_VERSION_VECTOR) { - delta = *this; - } else { - for (const auto& [tag, version] : versions) { - if (version > refVersion) { - delta.setVersionNoCheck(tag, version); - } - } - delta.maxVersion = maxVersion; - } - } - - // @note this method, together with method getDelta(), helps minimize - // the number of version vector entries that get sent from sequencer to - // grv proxy (and from grv proxy to client) on the read path. - void applyDelta(const VersionVector& delta) { - if (delta.maxVersion == invalidVersion) { - return; - } - - if (maxVersion >= delta.maxVersion) { - return; - } - - if (CLIENT_KNOBS->SEND_ENTIRE_VERSION_VECTOR) { - *this = delta; - } else { - for (const auto& [tag, version] : delta.versions) { - if (version > maxVersion) { - setVersionNoCheck(tag, version); - } - } - maxVersion = delta.maxVersion; - } - } - - std::string toString() const { - std::stringstream vector; - vector << "["; - for (const auto& [tag, version] : versions) { - vector << '{' << tag.toString() << "," << version << '}'; - } - vector << " maxversion: " << maxVersion << "]"; - return vector.str(); - } - - bool operator==(const VersionVector& vv) const { return maxVersion == vv.maxVersion; } - bool operator!=(const VersionVector& vv) const { return maxVersion != vv.maxVersion; } - bool operator<(const VersionVector& vv) const { return maxVersion < vv.maxVersion; } - - template - void serialize(Ar& ar) { - serializer(ar, versions, maxVersion); - } -}; - -static const VersionVector minVersionVector{ 0 }; -static const VersionVector maxVersionVector{ MAX_VERSION }; -static const VersionVector invalidVersionVector{ invalidVersion }; - -#endif /* FDBCLIENT_VERSION_VECTOR_H */ diff --git a/src/fdbclient/WriteMap.cpp b/src/fdbclient/WriteMap.cpp new file mode 100644 index 0000000..56aedd8 --- /dev/null +++ b/src/fdbclient/WriteMap.cpp @@ -0,0 +1,596 @@ +/* + * WriteMap.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbclient/WriteMap.h" + +void OperationStack::reset(RYWMutation initialEntry) { + defaultConstructed = false; + singletonOperation = initialEntry; + optionalOperations = Optional>(); +} + +void OperationStack::poppush(RYWMutation entry) { + if (hasVector()) { + optionalOperations.get().pop_back(); + optionalOperations.get().push_back(entry); + } else + singletonOperation = entry; +} + +void OperationStack::push(RYWMutation entry) { + if (defaultConstructed) { + singletonOperation = entry; + defaultConstructed = false; + } else if (hasVector()) + optionalOperations.get().push_back(entry); + else { + optionalOperations = std::vector(); + optionalOperations.get().push_back(entry); + } +} + +bool OperationStack::isDependent() const { + if (!size()) + return false; + return singletonOperation.type != MutationRef::SetValue && singletonOperation.type != MutationRef::ClearRange && + singletonOperation.type != MutationRef::SetVersionstampedValue && + singletonOperation.type != MutationRef::SetVersionstampedKey; +} + +bool OperationStack::operator==(const OperationStack& r) const { + if (size() != r.size()) + return false; + + if (size() == 0) + return true; + + if (singletonOperation != r.singletonOperation) + return false; + + if (size() == 1) + return true; + + for (int i = 0; i < optionalOperations.get().size(); i++) { + if (optionalOperations.get()[i] != r.optionalOperations.get()[i]) + return false; + } + + return true; +} + +WriteMap& WriteMap::operator=(WriteMap&& r) noexcept { + writeMapEmpty = r.writeMapEmpty; + writes = std::move(r.writes); + ver = r.ver; + scratch_iterator = std::move(r.scratch_iterator); + arena = r.arena; + return *this; +} + +void WriteMap::mutate(KeyRef key, MutationRef::Type operation, ValueRef param, bool addConflict) { + writeMapEmpty = false; + auto& it = scratch_iterator; + it.reset(writes, ver); + it.skip(key); + + bool is_cleared = it.entry().following_keys_cleared; + bool following_conflict = it.entry().following_keys_conflict; + bool is_conflict = addConflict || it.is_conflict_range(); + bool following_unreadable = it.entry().following_keys_unreadable; + bool is_unreadable = it.is_unreadable() || operation == MutationRef::SetVersionstampedValue || + operation == MutationRef::SetVersionstampedKey; + bool is_dependent = operation != MutationRef::SetValue && operation != MutationRef::SetVersionstampedValue && + operation != MutationRef::SetVersionstampedKey; + + if (it.entry().key != key) { + if (it.is_cleared_range() && is_dependent) { + it.tree.clear(); + OperationStack op(RYWMutation(Optional(), MutationRef::SetValue)); + coalesceOver(op, RYWMutation(param, operation), *arena); + PTreeImpl::insert( + writes, + ver, + WriteMapEntry( + key, std::move(op), true, following_conflict, is_conflict, following_unreadable, is_unreadable)); + } else { + it.tree.clear(); + PTreeImpl::insert(writes, + ver, + WriteMapEntry(key, + OperationStack(RYWMutation(param, operation)), + is_cleared, + following_conflict, + is_conflict, + following_unreadable, + is_unreadable)); + } + } else { + if (!it.is_unreadable() && + (operation == MutationRef::SetValue || operation == MutationRef::SetVersionstampedValue)) { + it.tree.clear(); + PTreeImpl::remove(writes, ver, key); + PTreeImpl::insert(writes, + ver, + WriteMapEntry(key, + OperationStack(RYWMutation(param, operation)), + is_cleared, + following_conflict, + is_conflict, + following_unreadable, + is_unreadable)); + } else { + WriteMapEntry e(it.entry()); + e.is_conflict = is_conflict; + e.is_unreadable = is_unreadable; + if (e.stack.size() == 0 && it.is_cleared_range() && is_dependent) { + e.stack.push(RYWMutation(Optional(), MutationRef::SetValue)); + coalesceOver(e.stack, RYWMutation(param, operation), *arena); + } else if (!is_unreadable && e.stack.size() > 0) + coalesceOver(e.stack, RYWMutation(param, operation), *arena); + else + e.stack.push(RYWMutation(param, operation)); + + it.tree.clear(); + PTreeImpl::remove( + writes, + ver, + e.key); // FIXME: Make PTreeImpl::insert do this automatically (see also VersionedMap.h FIXME) + PTreeImpl::insert(writes, ver, std::move(e)); + } + } +} + +void WriteMap::clear(KeyRangeRef keys, bool addConflict) { + writeMapEmpty = false; + if (!addConflict) { + clearNoConflict(keys); + return; + } + + auto& it = scratch_iterator; + it.reset(writes, ver); + it.skip(keys.begin); + + bool insert_begin = !it.is_cleared_range() || !it.is_conflict_range() || it.is_unreadable(); + + if (it.endKey() == keys.end) { + ++it; + } else if (it.endKey() < keys.end) { + it.skip(keys.end); + } + + bool insert_end = (it.is_unmodified_range() || !it.is_conflict_range() || it.is_unreadable()) && + (!it.keyAtBegin() || it.beginKey() != keys.end); + bool end_coalesce_clear = + it.is_cleared_range() && it.beginKey() == keys.end && it.is_conflict_range() && !it.is_unreadable(); + bool end_conflict = it.is_conflict_range(); + bool end_cleared = it.is_cleared_range(); + bool end_unreadable = it.is_unreadable(); + + it.tree.clear(); + + PTreeImpl::remove(writes, + ver, + ExtStringRef(keys.begin, !insert_begin ? 1 : 0), + ExtStringRef(keys.end, end_coalesce_clear ? 1 : 0)); + + if (insert_begin) + PTreeImpl::insert(writes, ver, WriteMapEntry(keys.begin, OperationStack(), true, true, true, false, false)); + + if (insert_end) + PTreeImpl::insert( + writes, + ver, + WriteMapEntry( + keys.end, OperationStack(), end_cleared, end_conflict, end_conflict, end_unreadable, end_unreadable)); +} + +void WriteMap::addUnmodifiedAndUnreadableRange(KeyRangeRef keys) { + auto& it = scratch_iterator; + it.reset(writes, ver); + it.skip(keys.begin); + + bool insert_begin = !it.is_unmodified_range() || it.is_conflict_range() || !it.is_unreadable(); + + if (it.endKey() == keys.end) { + ++it; + } else if (it.endKey() < keys.end) { + it.skip(keys.end); + } + + bool insert_end = (it.is_cleared_range() || it.is_conflict_range() || !it.is_unreadable()) && + (!it.keyAtBegin() || it.beginKey() != keys.end); + bool end_coalesce_unmodified = + it.is_unmodified_range() && it.beginKey() == keys.end && !it.is_conflict_range() && it.is_unreadable(); + bool end_conflict = it.is_conflict_range(); + bool end_cleared = it.is_cleared_range(); + bool end_unreadable = it.is_unreadable(); + + it.tree.clear(); + + PTreeImpl::remove(writes, + ver, + ExtStringRef(keys.begin, !insert_begin ? 1 : 0), + ExtStringRef(keys.end, end_coalesce_unmodified ? 1 : 0)); + + if (insert_begin) + PTreeImpl::insert(writes, ver, WriteMapEntry(keys.begin, OperationStack(), false, false, false, true, true)); + + if (insert_end) + PTreeImpl::insert( + writes, + ver, + WriteMapEntry( + keys.end, OperationStack(), end_cleared, end_conflict, end_conflict, end_unreadable, end_unreadable)); +} + +void WriteMap::addConflictRange(KeyRangeRef keys) { + writeMapEmpty = false; + auto& it = scratch_iterator; + it.reset(writes, ver); + it.skip(keys.begin); + + std::vector removals; + std::vector insertions; + + if (!it.entry().following_keys_conflict || !it.entry().is_conflict) { + if (it.keyAtBegin() && it.beginKey() == keys.begin) { + removals.push_back(keys.begin); + } + insertions.push_back(WriteMapEntry(keys.begin, + it.is_operation() ? OperationStack(it.op()) : OperationStack(), + it.entry().following_keys_cleared, + true, + true, + it.entry().following_keys_unreadable, + it.entry().is_unreadable)); + } + + while (it.endKey() < keys.end) { + ++it; + if (it.keyAtBegin() && (!it.entry().following_keys_conflict || !it.entry().is_conflict)) { + WriteMapEntry e(it.entry()); + e.following_keys_conflict = true; + e.is_conflict = true; + removals.push_back(e.key); + insertions.push_back(std::move(e)); + } + } + + ASSERT(it.beginKey() != keys.end); + if (!it.entry().following_keys_conflict || !it.entry().is_conflict) { + bool isCleared = it.entry().following_keys_cleared; + bool isUnreadable = it.entry().is_unreadable; + bool followingUnreadable = it.entry().following_keys_unreadable; + ++it; + + if (!it.keyAtBegin() || it.beginKey() != keys.end) { + insertions.push_back( + WriteMapEntry(keys.end, OperationStack(), isCleared, false, false, followingUnreadable, isUnreadable)); + } + } + + it.tree.clear(); + + // SOMEDAY: optimize this code by having a PTree removal/insertion that takes and returns an iterator + for (int i = 0; i < removals.size(); i++) { + PTreeImpl::remove( + writes, + ver, + removals[i]); // FIXME: Make PTreeImpl::insert do this automatically (see also VersionedMap.h FIXME) + } + + for (int i = 0; i < insertions.size(); i++) { + PTreeImpl::insert(writes, ver, std::move(insertions[i])); + } +} + +WriteMap::iterator::SEGMENT_TYPE WriteMap::iterator::type() const { + if (offset) + return entry().following_keys_cleared ? CLEARED_RANGE : UNMODIFIED_RANGE; + else + return entry().stack.isDependent() ? DEPENDENT_WRITE : INDEPENDENT_WRITE; +} + +WriteMap::iterator& WriteMap::iterator::operator++() { + if (!offset && !equalsKeyAfter(entry().key, nextEntry().key)) { + offset = true; + } else { + beginLen = endLen; + finger.resize(beginLen); + endLen = PTreeImpl::halfNext(at, finger); + offset = !entry().stack.size(); + } + return *this; +} +WriteMap::iterator& WriteMap::iterator::operator--() { + if (offset && entry().stack.size()) { + offset = false; + } else { + endLen = beginLen; + finger.resize(endLen); + beginLen = PTreeImpl::halfPrevious(at, finger); + offset = !entry().stack.size() || !equalsKeyAfter(entry().key, nextEntry().key); + } + return *this; +} + +void WriteMap::iterator::skip( + KeyRef key) { // Changes *this to the segment containing key (so that beginKey()<=key && key < endKey()) + finger.clear(); + + if (key == allKeys.end) + PTreeImpl::last(tree, at, finger); + else + PTreeImpl::upper_bound(tree, at, key, finger); + endLen = finger.size(); + beginLen = PTreeImpl::halfPrevious(at, finger); + + offset = !entry().stack.size() || (entry().key != key); +} + +void WriteMap::iterator::reset(Tree const& tree, Version ver) { + this->tree = tree; + this->at = ver; + this->finger.clear(); + beginLen = endLen = 0; + offset = false; +} + +RYWMutation WriteMap::coalesce(RYWMutation existingEntry, RYWMutation newEntry, Arena& arena) { + ASSERT(newEntry.value.present()); + + if (newEntry.type == MutationRef::SetValue || newEntry.type == MutationRef::SetVersionstampedValue) { + // independent mutations + return newEntry; + } else if (newEntry.type == MutationRef::AddValue) { + switch (existingEntry.type) { + case MutationRef::SetValue: + return RYWMutation(doLittleEndianAdd(existingEntry.value, newEntry.value.get(), arena), + MutationRef::SetValue); + case MutationRef::AddValue: + return RYWMutation(doLittleEndianAdd(existingEntry.value, newEntry.value.get(), arena), + MutationRef::AddValue); + default: + throw operation_failed(); + } + } else if (newEntry.type == MutationRef::CompareAndClear) { + switch (existingEntry.type) { + case MutationRef::SetValue: + if (doCompareAndClear(existingEntry.value, newEntry.value.get(), arena).present()) { + return existingEntry; + } else { + return RYWMutation(Optional(), MutationRef::SetValue); + } + default: + throw operation_failed(); + } + } else if (newEntry.type == MutationRef::AppendIfFits) { + switch (existingEntry.type) { + case MutationRef::SetValue: + return RYWMutation(doAppendIfFits(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); + case MutationRef::AppendIfFits: + return RYWMutation(doAppendIfFits(existingEntry.value, newEntry.value.get(), arena), + MutationRef::AppendIfFits); + default: + throw operation_failed(); + } + } else if (newEntry.type == MutationRef::And) { + switch (existingEntry.type) { + case MutationRef::SetValue: + return RYWMutation(doAnd(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); + case MutationRef::And: + return RYWMutation(doAnd(existingEntry.value, newEntry.value.get(), arena), MutationRef::And); + default: + throw operation_failed(); + } + } else if (newEntry.type == MutationRef::Or) { + switch (existingEntry.type) { + case MutationRef::SetValue: + return RYWMutation(doOr(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); + case MutationRef::Or: + return RYWMutation(doOr(existingEntry.value, newEntry.value.get(), arena), MutationRef::Or); + default: + throw operation_failed(); + } + } else if (newEntry.type == MutationRef::Xor) { + switch (existingEntry.type) { + case MutationRef::SetValue: + return RYWMutation(doXor(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); + case MutationRef::Xor: + return RYWMutation(doXor(existingEntry.value, newEntry.value.get(), arena), MutationRef::Xor); + default: + throw operation_failed(); + } + } else if (newEntry.type == MutationRef::Max) { + switch (existingEntry.type) { + case MutationRef::SetValue: + return RYWMutation(doMax(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); + case MutationRef::Max: + return RYWMutation(doMax(existingEntry.value, newEntry.value.get(), arena), MutationRef::Max); + default: + throw operation_failed(); + } + } else if (newEntry.type == MutationRef::Min) { + switch (existingEntry.type) { + case MutationRef::SetValue: + return RYWMutation(doMin(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); + case MutationRef::Min: + return RYWMutation(doMin(existingEntry.value, newEntry.value.get(), arena), MutationRef::Min); + default: + throw operation_failed(); + } + } else if (newEntry.type == MutationRef::ByteMin) { + switch (existingEntry.type) { + case MutationRef::SetValue: + return RYWMutation(doByteMin(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); + case MutationRef::ByteMin: + return RYWMutation(doByteMin(existingEntry.value, newEntry.value.get(), arena), MutationRef::ByteMin); + default: + throw operation_failed(); + } + } else if (newEntry.type == MutationRef::ByteMax) { + switch (existingEntry.type) { + case MutationRef::SetValue: + return RYWMutation(doByteMax(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); + case MutationRef::ByteMax: + return RYWMutation(doByteMax(existingEntry.value, newEntry.value.get(), arena), MutationRef::ByteMax); + default: + throw operation_failed(); + } + } else if (newEntry.type == MutationRef::MinV2) { + switch (existingEntry.type) { + case MutationRef::SetValue: + return RYWMutation(doMinV2(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); + case MutationRef::MinV2: + return RYWMutation(doMinV2(existingEntry.value, newEntry.value.get(), arena), MutationRef::MinV2); + default: + throw operation_failed(); + } + } else if (newEntry.type == MutationRef::AndV2) { + switch (existingEntry.type) { + case MutationRef::SetValue: + return RYWMutation(doAndV2(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); + case MutationRef::AndV2: + return RYWMutation(doAndV2(existingEntry.value, newEntry.value.get(), arena), MutationRef::AndV2); + default: + throw operation_failed(); + } + } else + throw operation_failed(); +} + +void WriteMap::coalesceOver(OperationStack& stack, RYWMutation newEntry, Arena& arena) { + RYWMutation existingEntry = stack.top(); + if (existingEntry.type == newEntry.type && newEntry.type != MutationRef::CompareAndClear) { + if (isNonAssociativeOp(existingEntry.type) && existingEntry.value.present() && + existingEntry.value.get().size() != newEntry.value.get().size()) { + stack.push(newEntry); + } else { + stack.poppush(coalesce(existingEntry, newEntry, arena)); + } + } else { + if (isAtomicOp(newEntry.type) && isAtomicOp(existingEntry.type)) { + stack.push(newEntry); + } else { + stack.poppush(coalesce(existingEntry, newEntry, arena)); + } + } +} + +RYWMutation WriteMap::coalesceUnder(OperationStack const& stack, Optional const& value, Arena& arena) { + if (!stack.isDependent() && stack.size() == 1) + return stack.at(0); + + RYWMutation currentEntry = RYWMutation(value, MutationRef::SetValue); + for (int i = 0; i < stack.size(); ++i) { + currentEntry = coalesce(currentEntry, stack.at(i), arena); + } + + return currentEntry; +} + +void WriteMap::dump() { + iterator it(this); + it.skip(allKeys.begin); + while (it.beginKey() < allKeys.end) { + TraceEvent("WriteMapDump") + .detail("Begin", it.beginKey().toStandaloneStringRef()) + .detail("End", it.endKey()) + .detail("Cleared", it.is_cleared_range()) + .detail("Conflicted", it.is_conflict_range()) + .detail("Operation", it.is_operation()) + .detail("Unmodified", it.is_unmodified_range()) + .detail("Independent", it.is_operation() && it.is_independent()) + .detail("StackSize", it.is_operation() ? it.op().size() : 0); + ++it; + } +} + +void WriteMap::clearNoConflict(KeyRangeRef keys) { + auto& it = scratch_iterator; + it.reset(writes, ver); + + // Find all write conflict ranges within the cleared range + it.skip(keys.begin); + + bool insert_begin = !it.is_cleared_range() || it.is_unreadable(); + + bool lastConflicted = it.is_conflict_range(); + + bool conflicted = lastConflicted; + std::vector conflict_ranges; + + if (insert_begin) { + conflict_ranges.push_back(keys.begin); + } else { + conflicted = !conflicted; + } + + while (it.endKey() < keys.end) { + ++it; + if (lastConflicted != it.is_conflict_range()) { + conflict_ranges.push_back(it.beginKey()); + lastConflicted = it.is_conflict_range(); + } + } + + if (it.endKey() == keys.end) + ++it; + + ASSERT(it.beginKey() <= keys.end && keys.end < it.endKey()); + + bool insert_end = + ((it.is_unmodified_range() || it.is_unreadable()) && (!it.keyAtBegin() || it.beginKey() != keys.end)) || + (it.entry().is_conflict && !it.entry().following_keys_conflict && it.beginKey() == keys.end && + !it.keyAtBegin()); + bool end_cleared = it.is_cleared_range(); + bool end_coalesce_clear = it.is_cleared_range() && it.beginKey() == keys.end && + it.is_conflict_range() == lastConflicted && !it.is_unreadable(); + bool end_conflict = it.is_conflict_range(); + bool end_unreadable = it.is_unreadable(); + + CODE_PROBE(it.is_conflict_range() != lastConflicted, "not last conflicted"); + + it.tree.clear(); + + PTreeImpl::remove(writes, + ver, + ExtStringRef(keys.begin, !insert_begin ? 1 : 0), + ExtStringRef(keys.end, end_coalesce_clear ? 1 : 0)); + + for (int i = 0; i < conflict_ranges.size(); i++) { + PTreeImpl::insert( + writes, + ver, + WriteMapEntry( + conflict_ranges[i].toArenaOrRef(*arena), OperationStack(), true, conflicted, conflicted, false, false)); + conflicted = !conflicted; + } + + ASSERT(conflicted != lastConflicted); + + if (insert_end) + PTreeImpl::insert( + writes, + ver, + WriteMapEntry( + keys.end, OperationStack(), end_cleared, end_conflict, end_conflict, end_unreadable, end_unreadable)); +} diff --git a/src/fdbclient/WriteMap.h b/src/fdbclient/WriteMap.h deleted file mode 100644 index b0529b8..0000000 --- a/src/fdbclient/WriteMap.h +++ /dev/null @@ -1,806 +0,0 @@ -/* - * WriteMap.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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. - */ - -#ifndef FDBCLIENT_WRITEMAP_H -#define FDBCLIENT_WRITEMAP_H -#pragma once - -#include "fdbclient/FDBTypes.h" -#include "fdbclient/VersionedMap.h" -#include "fdbclient/SnapshotCache.h" -#include "fdbclient/Atomic.h" - -struct RYWMutation { - Optional value; - enum MutationRef::Type type; - - RYWMutation(Optional const& entry, MutationRef::Type type) : value(entry), type(type) {} - RYWMutation() : value(), type(MutationRef::NoOp) {} - - bool operator==(const RYWMutation& r) const { return value == r.value && type == r.type; } - bool operator!=(const RYWMutation& r) const { return !(*this == r); } -}; - -class OperationStack { -private: - RYWMutation singletonOperation; - Optional> optionalOperations; - bool hasVector() const { return optionalOperations.present(); } - bool defaultConstructed; - -public: - OperationStack() { defaultConstructed = true; } // Don't use this! - explicit OperationStack(RYWMutation initialEntry) { - defaultConstructed = false; - singletonOperation = initialEntry; - } - void reset(RYWMutation initialEntry) { - defaultConstructed = false; - singletonOperation = initialEntry; - optionalOperations = Optional>(); - } - void poppush(RYWMutation entry) { - if (hasVector()) { - optionalOperations.get().pop_back(); - optionalOperations.get().push_back(entry); - } else - singletonOperation = entry; - } - void push(RYWMutation entry) { - if (defaultConstructed) { - singletonOperation = entry; - defaultConstructed = false; - } else if (hasVector()) - optionalOperations.get().push_back(entry); - else { - optionalOperations = std::vector(); - optionalOperations.get().push_back(entry); - } - } - bool isDependent() const { - if (!size()) - return false; - return singletonOperation.type != MutationRef::SetValue && singletonOperation.type != MutationRef::ClearRange && - singletonOperation.type != MutationRef::SetVersionstampedValue && - singletonOperation.type != MutationRef::SetVersionstampedKey; - } - const RYWMutation& top() const { return hasVector() ? optionalOperations.get().back() : singletonOperation; } - RYWMutation& operator[](int n) { return (n == 0) ? singletonOperation : optionalOperations.get()[n - 1]; } - - const RYWMutation& at(int n) const { return (n == 0) ? singletonOperation : optionalOperations.get()[n - 1]; } - - int size() const { return defaultConstructed ? 0 : hasVector() ? optionalOperations.get().size() + 1 : 1; } - - bool operator==(const OperationStack& r) const { - if (size() != r.size()) - return false; - - if (size() == 0) - return true; - - if (singletonOperation != r.singletonOperation) - return false; - - if (size() == 1) - return true; - - for (int i = 0; i < optionalOperations.get().size(); i++) { - if (optionalOperations.get()[i] != r.optionalOperations.get()[i]) - return false; - } - - return true; - } -}; - -struct WriteMapEntry { - KeyRef key; - OperationStack stack; - bool following_keys_cleared; - bool following_keys_conflict; - bool is_conflict; - bool following_keys_unreadable; - bool is_unreadable; - - WriteMapEntry(KeyRef const& key, - OperationStack&& stack, - bool following_keys_cleared, - bool following_keys_conflict, - bool is_conflict, - bool following_keys_unreadable, - bool is_unreadable) - : key(key), stack(std::move(stack)), following_keys_cleared(following_keys_cleared), - following_keys_conflict(following_keys_conflict), is_conflict(is_conflict), - following_keys_unreadable(following_keys_unreadable), is_unreadable(is_unreadable) {} - - int compare(StringRef const& r) const { return key.compare(r); } - - int compare(ExtStringRef const& r) const { return -r.compare(key); } - - int compare(WriteMapEntry const& r) const { return key.compare(r.key); } - - std::string toString() const { return printable(key); } -}; - -inline int compare(StringRef const& l, WriteMapEntry const& r) { - return l.compare(r.key); -} - -inline int compare(ExtStringRef const& l, WriteMapEntry const& r) { - return l.compare(r.key); -} - -inline bool operator<(const WriteMapEntry& lhs, const WriteMapEntry& rhs) { - return lhs.key < rhs.key; -} -inline bool operator<(const WriteMapEntry& lhs, const StringRef& rhs) { - return lhs.key < rhs; -} -inline bool operator<(const StringRef& lhs, const WriteMapEntry& rhs) { - return lhs < rhs.key; -} -inline bool operator<(const WriteMapEntry& lhs, const ExtStringRef& rhs) { - return rhs.compare(lhs.key) > 0; -} -inline bool operator<(const ExtStringRef& lhs, const WriteMapEntry& rhs) { - return lhs.compare(rhs.key) < 0; -} - -class WriteMap { -private: - typedef PTreeImpl::PTree PTreeT; - typedef PTreeImpl::PTreeFinger PTreeFingerT; - typedef Reference Tree; - -public: - explicit WriteMap(Arena* arena) : arena(arena), writeMapEmpty(true), ver(-1), scratch_iterator(this) { - PTreeImpl::insert( - writes, ver, WriteMapEntry(allKeys.begin, OperationStack(), false, false, false, false, false)); - PTreeImpl::insert(writes, ver, WriteMapEntry(allKeys.end, OperationStack(), false, false, false, false, false)); - PTreeImpl::insert( - writes, ver, WriteMapEntry(afterAllKeys, OperationStack(), false, false, false, false, false)); - } - - WriteMap(WriteMap&& r) noexcept - : arena(r.arena), writeMapEmpty(r.writeMapEmpty), writes(std::move(r.writes)), ver(r.ver), - scratch_iterator(std::move(r.scratch_iterator)) {} - WriteMap& operator=(WriteMap&& r) noexcept { - writeMapEmpty = r.writeMapEmpty; - writes = std::move(r.writes); - ver = r.ver; - scratch_iterator = std::move(r.scratch_iterator); - arena = r.arena; - return *this; - } - - // a write with addConflict false on top of an existing write with a conflict range will not remove the conflict - void mutate(KeyRef key, MutationRef::Type operation, ValueRef param, bool addConflict) { - writeMapEmpty = false; - auto& it = scratch_iterator; - it.reset(writes, ver); - it.skip(key); - - bool is_cleared = it.entry().following_keys_cleared; - bool following_conflict = it.entry().following_keys_conflict; - bool is_conflict = addConflict || it.is_conflict_range(); - bool following_unreadable = it.entry().following_keys_unreadable; - bool is_unreadable = it.is_unreadable() || operation == MutationRef::SetVersionstampedValue || - operation == MutationRef::SetVersionstampedKey; - bool is_dependent = operation != MutationRef::SetValue && operation != MutationRef::SetVersionstampedValue && - operation != MutationRef::SetVersionstampedKey; - - if (it.entry().key != key) { - if (it.is_cleared_range() && is_dependent) { - it.tree.clear(); - OperationStack op(RYWMutation(Optional(), MutationRef::SetValue)); - coalesceOver(op, RYWMutation(param, operation), *arena); - PTreeImpl::insert(writes, - ver, - WriteMapEntry(key, - std::move(op), - true, - following_conflict, - is_conflict, - following_unreadable, - is_unreadable)); - } else { - it.tree.clear(); - PTreeImpl::insert(writes, - ver, - WriteMapEntry(key, - OperationStack(RYWMutation(param, operation)), - is_cleared, - following_conflict, - is_conflict, - following_unreadable, - is_unreadable)); - } - } else { - if (!it.is_unreadable() && - (operation == MutationRef::SetValue || operation == MutationRef::SetVersionstampedValue)) { - it.tree.clear(); - PTreeImpl::remove(writes, ver, key); - PTreeImpl::insert(writes, - ver, - WriteMapEntry(key, - OperationStack(RYWMutation(param, operation)), - is_cleared, - following_conflict, - is_conflict, - following_unreadable, - is_unreadable)); - } else { - WriteMapEntry e(it.entry()); - e.is_conflict = is_conflict; - e.is_unreadable = is_unreadable; - if (e.stack.size() == 0 && it.is_cleared_range() && is_dependent) { - e.stack.push(RYWMutation(Optional(), MutationRef::SetValue)); - coalesceOver(e.stack, RYWMutation(param, operation), *arena); - } else if (!is_unreadable && e.stack.size() > 0) - coalesceOver(e.stack, RYWMutation(param, operation), *arena); - else - e.stack.push(RYWMutation(param, operation)); - - it.tree.clear(); - PTreeImpl::remove( - writes, - ver, - e.key); // FIXME: Make PTreeImpl::insert do this automatically (see also VersionedMap.h FIXME) - PTreeImpl::insert(writes, ver, std::move(e)); - } - } - } - - void clear(KeyRangeRef keys, bool addConflict) { - writeMapEmpty = false; - if (!addConflict) { - clearNoConflict(keys); - return; - } - - auto& it = scratch_iterator; - it.reset(writes, ver); - it.skip(keys.begin); - - bool insert_begin = !it.is_cleared_range() || !it.is_conflict_range() || it.is_unreadable(); - - if (it.endKey() == keys.end) { - ++it; - } else if (it.endKey() < keys.end) { - it.skip(keys.end); - } - - bool insert_end = (it.is_unmodified_range() || !it.is_conflict_range() || it.is_unreadable()) && - (!it.keyAtBegin() || it.beginKey() != keys.end); - bool end_coalesce_clear = - it.is_cleared_range() && it.beginKey() == keys.end && it.is_conflict_range() && !it.is_unreadable(); - bool end_conflict = it.is_conflict_range(); - bool end_cleared = it.is_cleared_range(); - bool end_unreadable = it.is_unreadable(); - - it.tree.clear(); - - PTreeImpl::remove(writes, - ver, - ExtStringRef(keys.begin, !insert_begin ? 1 : 0), - ExtStringRef(keys.end, end_coalesce_clear ? 1 : 0)); - - if (insert_begin) - PTreeImpl::insert(writes, ver, WriteMapEntry(keys.begin, OperationStack(), true, true, true, false, false)); - - if (insert_end) - PTreeImpl::insert(writes, - ver, - WriteMapEntry(keys.end, - OperationStack(), - end_cleared, - end_conflict, - end_conflict, - end_unreadable, - end_unreadable)); - } - - void addUnmodifiedAndUnreadableRange(KeyRangeRef keys) { - auto& it = scratch_iterator; - it.reset(writes, ver); - it.skip(keys.begin); - - bool insert_begin = !it.is_unmodified_range() || it.is_conflict_range() || !it.is_unreadable(); - - if (it.endKey() == keys.end) { - ++it; - } else if (it.endKey() < keys.end) { - it.skip(keys.end); - } - - bool insert_end = (it.is_cleared_range() || it.is_conflict_range() || !it.is_unreadable()) && - (!it.keyAtBegin() || it.beginKey() != keys.end); - bool end_coalesce_unmodified = - it.is_unmodified_range() && it.beginKey() == keys.end && !it.is_conflict_range() && it.is_unreadable(); - bool end_conflict = it.is_conflict_range(); - bool end_cleared = it.is_cleared_range(); - bool end_unreadable = it.is_unreadable(); - - it.tree.clear(); - - PTreeImpl::remove(writes, - ver, - ExtStringRef(keys.begin, !insert_begin ? 1 : 0), - ExtStringRef(keys.end, end_coalesce_unmodified ? 1 : 0)); - - if (insert_begin) - PTreeImpl::insert( - writes, ver, WriteMapEntry(keys.begin, OperationStack(), false, false, false, true, true)); - - if (insert_end) - PTreeImpl::insert(writes, - ver, - WriteMapEntry(keys.end, - OperationStack(), - end_cleared, - end_conflict, - end_conflict, - end_unreadable, - end_unreadable)); - } - - void addConflictRange(KeyRangeRef keys) { - writeMapEmpty = false; - auto& it = scratch_iterator; - it.reset(writes, ver); - it.skip(keys.begin); - - std::vector removals; - std::vector insertions; - - if (!it.entry().following_keys_conflict || !it.entry().is_conflict) { - if (it.keyAtBegin() && it.beginKey() == keys.begin) { - removals.push_back(keys.begin); - } - insertions.push_back(WriteMapEntry(keys.begin, - it.is_operation() ? OperationStack(it.op()) : OperationStack(), - it.entry().following_keys_cleared, - true, - true, - it.entry().following_keys_unreadable, - it.entry().is_unreadable)); - } - - while (it.endKey() < keys.end) { - ++it; - if (it.keyAtBegin() && (!it.entry().following_keys_conflict || !it.entry().is_conflict)) { - WriteMapEntry e(it.entry()); - e.following_keys_conflict = true; - e.is_conflict = true; - removals.push_back(e.key); - insertions.push_back(std::move(e)); - } - } - - ASSERT(it.beginKey() != keys.end); - if (!it.entry().following_keys_conflict || !it.entry().is_conflict) { - bool isCleared = it.entry().following_keys_cleared; - bool isUnreadable = it.entry().is_unreadable; - bool followingUnreadable = it.entry().following_keys_unreadable; - ++it; - - if (!it.keyAtBegin() || it.beginKey() != keys.end) { - insertions.push_back(WriteMapEntry( - keys.end, OperationStack(), isCleared, false, false, followingUnreadable, isUnreadable)); - } - } - - it.tree.clear(); - - // SOMEDAY: optimize this code by having a PTree removal/insertion that takes and returns an iterator - for (int i = 0; i < removals.size(); i++) { - PTreeImpl::remove( - writes, - ver, - removals[i]); // FIXME: Make PTreeImpl::insert do this automatically (see also VersionedMap.h FIXME) - } - - for (int i = 0; i < insertions.size(); i++) { - PTreeImpl::insert(writes, ver, std::move(insertions[i])); - } - } - - struct iterator { - // Iterates over three types of segments: unmodified ranges, cleared ranges, and modified keys. - // Modified keys may be dependent (need to be collapsed with a snapshot value) or independent (value is known - // regardless of the snapshot value) Every key will belong to exactly one segment. The first segment begins at - // "" and the last segment ends at \xff\xff. - - explicit iterator(WriteMap* map) : tree(map->writes), at(map->ver), offset(false) { ++map->ver; } - // Creates an iterator which is conceptually before the beginning of map (you may essentially only call skip() - // or ++ on it) This iterator also represents a snapshot (will be unaffected by future writes) - - enum SEGMENT_TYPE { UNMODIFIED_RANGE, CLEARED_RANGE, INDEPENDENT_WRITE, DEPENDENT_WRITE }; - - SEGMENT_TYPE type() const { - if (offset) - return entry().following_keys_cleared ? CLEARED_RANGE : UNMODIFIED_RANGE; - else - return entry().stack.isDependent() ? DEPENDENT_WRITE : INDEPENDENT_WRITE; - } - bool is_cleared_range() const { return offset && entry().following_keys_cleared; } - bool is_unmodified_range() const { return offset && !entry().following_keys_cleared; } - bool is_operation() const { return !offset; } - bool is_conflict_range() const { return offset ? entry().following_keys_conflict : entry().is_conflict; } - bool is_unreadable() const { return offset ? entry().following_keys_unreadable : entry().is_unreadable; } - - bool is_independent() const { - ASSERT(is_operation()); - return entry().following_keys_cleared || !entry().stack.isDependent(); - } - - ExtStringRef beginKey() const { return ExtStringRef(entry().key, offset && entry().stack.size()); } - ExtStringRef endKey() const { return offset ? nextEntry().key : ExtStringRef(entry().key, 1); } - - OperationStack const& op() const { - ASSERT(is_operation()); - return entry().stack; - } - - iterator& operator++() { - if (!offset && !equalsKeyAfter(entry().key, nextEntry().key)) { - offset = true; - } else { - beginLen = endLen; - finger.resize(beginLen); - endLen = PTreeImpl::halfNext(at, finger); - offset = !entry().stack.size(); - } - return *this; - } - iterator& operator--() { - if (offset && entry().stack.size()) { - offset = false; - } else { - endLen = beginLen; - finger.resize(endLen); - beginLen = PTreeImpl::halfPrevious(at, finger); - offset = !entry().stack.size() || !equalsKeyAfter(entry().key, nextEntry().key); - } - return *this; - } - bool operator==(const iterator& r) const { - return offset == r.offset && beginLen == r.beginLen && finger[beginLen - 1] == r.finger[beginLen - 1]; - } - - void skip( - KeyRef key) { // Changes *this to the segment containing key (so that beginKey()<=key && key < endKey()) - finger.clear(); - - if (key == allKeys.end) - PTreeImpl::last(tree, at, finger); - else - PTreeImpl::upper_bound(tree, at, key, finger); - endLen = finger.size(); - beginLen = PTreeImpl::halfPrevious(at, finger); - - offset = !entry().stack.size() || (entry().key != key); - } - - private: - friend class WriteMap; - void reset(Tree const& tree, Version ver) { - this->tree = tree; - this->at = ver; - this->finger.clear(); - beginLen = endLen = 0; - offset = false; - } - - WriteMapEntry const& entry() const { return finger[beginLen - 1]->data; } - WriteMapEntry const& nextEntry() const { return finger[endLen - 1]->data; } - - bool keyAtBegin() { return !offset || !entry().stack.size(); } - - Tree tree; - Version at; - int beginLen, endLen; - PTreeFingerT finger; - bool offset; // false-> the operation stack at entry(); true-> the following cleared or unmodified range - }; - - bool empty() const { return writeMapEmpty; } - - static RYWMutation coalesce(RYWMutation existingEntry, RYWMutation newEntry, Arena& arena) { - ASSERT(newEntry.value.present()); - - if (newEntry.type == MutationRef::SetValue || newEntry.type == MutationRef::SetVersionstampedValue) { - // independent mutations - return newEntry; - } else if (newEntry.type == MutationRef::AddValue) { - switch (existingEntry.type) { - case MutationRef::SetValue: - return RYWMutation(doLittleEndianAdd(existingEntry.value, newEntry.value.get(), arena), - MutationRef::SetValue); - case MutationRef::AddValue: - return RYWMutation(doLittleEndianAdd(existingEntry.value, newEntry.value.get(), arena), - MutationRef::AddValue); - default: - throw operation_failed(); - } - } else if (newEntry.type == MutationRef::CompareAndClear) { - switch (existingEntry.type) { - case MutationRef::SetValue: - if (doCompareAndClear(existingEntry.value, newEntry.value.get(), arena).present()) { - return existingEntry; - } else { - return RYWMutation(Optional(), MutationRef::SetValue); - } - default: - throw operation_failed(); - } - } else if (newEntry.type == MutationRef::AppendIfFits) { - switch (existingEntry.type) { - case MutationRef::SetValue: - return RYWMutation(doAppendIfFits(existingEntry.value, newEntry.value.get(), arena), - MutationRef::SetValue); - case MutationRef::AppendIfFits: - return RYWMutation(doAppendIfFits(existingEntry.value, newEntry.value.get(), arena), - MutationRef::AppendIfFits); - default: - throw operation_failed(); - } - } else if (newEntry.type == MutationRef::And) { - switch (existingEntry.type) { - case MutationRef::SetValue: - return RYWMutation(doAnd(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); - case MutationRef::And: - return RYWMutation(doAnd(existingEntry.value, newEntry.value.get(), arena), MutationRef::And); - default: - throw operation_failed(); - } - } else if (newEntry.type == MutationRef::Or) { - switch (existingEntry.type) { - case MutationRef::SetValue: - return RYWMutation(doOr(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); - case MutationRef::Or: - return RYWMutation(doOr(existingEntry.value, newEntry.value.get(), arena), MutationRef::Or); - default: - throw operation_failed(); - } - } else if (newEntry.type == MutationRef::Xor) { - switch (existingEntry.type) { - case MutationRef::SetValue: - return RYWMutation(doXor(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); - case MutationRef::Xor: - return RYWMutation(doXor(existingEntry.value, newEntry.value.get(), arena), MutationRef::Xor); - default: - throw operation_failed(); - } - } else if (newEntry.type == MutationRef::Max) { - switch (existingEntry.type) { - case MutationRef::SetValue: - return RYWMutation(doMax(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); - case MutationRef::Max: - return RYWMutation(doMax(existingEntry.value, newEntry.value.get(), arena), MutationRef::Max); - default: - throw operation_failed(); - } - } else if (newEntry.type == MutationRef::Min) { - switch (existingEntry.type) { - case MutationRef::SetValue: - return RYWMutation(doMin(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); - case MutationRef::Min: - return RYWMutation(doMin(existingEntry.value, newEntry.value.get(), arena), MutationRef::Min); - default: - throw operation_failed(); - } - } else if (newEntry.type == MutationRef::ByteMin) { - switch (existingEntry.type) { - case MutationRef::SetValue: - return RYWMutation(doByteMin(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); - case MutationRef::ByteMin: - return RYWMutation(doByteMin(existingEntry.value, newEntry.value.get(), arena), MutationRef::ByteMin); - default: - throw operation_failed(); - } - } else if (newEntry.type == MutationRef::ByteMax) { - switch (existingEntry.type) { - case MutationRef::SetValue: - return RYWMutation(doByteMax(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); - case MutationRef::ByteMax: - return RYWMutation(doByteMax(existingEntry.value, newEntry.value.get(), arena), MutationRef::ByteMax); - default: - throw operation_failed(); - } - } else if (newEntry.type == MutationRef::MinV2) { - switch (existingEntry.type) { - case MutationRef::SetValue: - return RYWMutation(doMinV2(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); - case MutationRef::MinV2: - return RYWMutation(doMinV2(existingEntry.value, newEntry.value.get(), arena), MutationRef::MinV2); - default: - throw operation_failed(); - } - } else if (newEntry.type == MutationRef::AndV2) { - switch (existingEntry.type) { - case MutationRef::SetValue: - return RYWMutation(doAndV2(existingEntry.value, newEntry.value.get(), arena), MutationRef::SetValue); - case MutationRef::AndV2: - return RYWMutation(doAndV2(existingEntry.value, newEntry.value.get(), arena), MutationRef::AndV2); - default: - throw operation_failed(); - } - } else - throw operation_failed(); - } - - static void coalesceOver(OperationStack& stack, RYWMutation newEntry, Arena& arena) { - RYWMutation existingEntry = stack.top(); - if (existingEntry.type == newEntry.type && newEntry.type != MutationRef::CompareAndClear) { - if (isNonAssociativeOp(existingEntry.type) && existingEntry.value.present() && - existingEntry.value.get().size() != newEntry.value.get().size()) { - stack.push(newEntry); - } else { - stack.poppush(coalesce(existingEntry, newEntry, arena)); - } - } else { - if (isAtomicOp(newEntry.type) && isAtomicOp(existingEntry.type)) { - stack.push(newEntry); - } else { - stack.poppush(coalesce(existingEntry, newEntry, arena)); - } - } - } - - static RYWMutation coalesceUnder(OperationStack const& stack, Optional const& value, Arena& arena) { - if (!stack.isDependent() && stack.size() == 1) - return stack.at(0); - - RYWMutation currentEntry = RYWMutation(value, MutationRef::SetValue); - for (int i = 0; i < stack.size(); ++i) { - currentEntry = coalesce(currentEntry, stack.at(i), arena); - } - - return currentEntry; - } - -private: - friend class ReadYourWritesTransaction; - Arena* arena; - bool writeMapEmpty; - Tree writes; - Version ver; // an internal version number for the tree - no connection to database versions! Currently this is - // incremented after reads, so that consecutive writes have the same version and those separated by - // reads have different versions. - iterator scratch_iterator; // Avoid unnecessary memory allocation in write operations - - void dump() { - iterator it(this); - it.skip(allKeys.begin); - while (it.beginKey() < allKeys.end) { - TraceEvent("WriteMapDump") - .detail("Begin", it.beginKey().toStandaloneStringRef()) - .detail("End", it.endKey()) - .detail("Cleared", it.is_cleared_range()) - .detail("Conflicted", it.is_conflict_range()) - .detail("Operation", it.is_operation()) - .detail("Unmodified", it.is_unmodified_range()) - .detail("Independent", it.is_operation() && it.is_independent()) - .detail("StackSize", it.is_operation() ? it.op().size() : 0); - ++it; - } - } - - // SOMEDAY: clearNoConflict replaces cleared sets with two map entries for everyone one item cleared - void clearNoConflict(KeyRangeRef keys) { - auto& it = scratch_iterator; - it.reset(writes, ver); - - // Find all write conflict ranges within the cleared range - it.skip(keys.begin); - - bool insert_begin = !it.is_cleared_range() || it.is_unreadable(); - - bool lastConflicted = it.is_conflict_range(); - - bool conflicted = lastConflicted; - std::vector conflict_ranges; - - if (insert_begin) { - conflict_ranges.push_back(keys.begin); - } else { - conflicted = !conflicted; - } - - while (it.endKey() < keys.end) { - ++it; - if (lastConflicted != it.is_conflict_range()) { - conflict_ranges.push_back(it.beginKey()); - lastConflicted = it.is_conflict_range(); - } - } - - if (it.endKey() == keys.end) - ++it; - - ASSERT(it.beginKey() <= keys.end && keys.end < it.endKey()); - - bool insert_end = - ((it.is_unmodified_range() || it.is_unreadable()) && (!it.keyAtBegin() || it.beginKey() != keys.end)) || - (it.entry().is_conflict && !it.entry().following_keys_conflict && it.beginKey() == keys.end && - !it.keyAtBegin()); - bool end_cleared = it.is_cleared_range(); - bool end_coalesce_clear = it.is_cleared_range() && it.beginKey() == keys.end && - it.is_conflict_range() == lastConflicted && !it.is_unreadable(); - bool end_conflict = it.is_conflict_range(); - bool end_unreadable = it.is_unreadable(); - - TEST(it.is_conflict_range() != lastConflicted); // not last conflicted - - it.tree.clear(); - - PTreeImpl::remove(writes, - ver, - ExtStringRef(keys.begin, !insert_begin ? 1 : 0), - ExtStringRef(keys.end, end_coalesce_clear ? 1 : 0)); - - for (int i = 0; i < conflict_ranges.size(); i++) { - PTreeImpl::insert(writes, - ver, - WriteMapEntry(conflict_ranges[i].toArenaOrRef(*arena), - OperationStack(), - true, - conflicted, - conflicted, - false, - false)); - conflicted = !conflicted; - } - - ASSERT(conflicted != lastConflicted); - - if (insert_end) - PTreeImpl::insert(writes, - ver, - WriteMapEntry(keys.end, - OperationStack(), - end_cleared, - end_conflict, - end_conflict, - end_unreadable, - end_unreadable)); - } -}; - -/* - - for write in writes: # write.type in [ 'none', 'clear', 'independent', 'dependent' ] - for read in reads[ write.begin : write.end ]: # read.type in [ 'unknown', 'empty', 'value' ] - if write.type == "none": - yield read - elif write.type == "clear": - yield empty() - elif write.type == "independent": - yield value( write ) - else: # Dependent write - if read.type == "unknown": - yield read - else: - yield value( collapse( read, write ) ) - -*/ - -#endif diff --git a/src/fdbclient/ActorLineageProfiler.h b/src/fdbclient/include/fdbclient/ActorLineageProfiler.h similarity index 100% rename from src/fdbclient/ActorLineageProfiler.h rename to src/fdbclient/include/fdbclient/ActorLineageProfiler.h diff --git a/src/fdbclient/AnnotateActor.h b/src/fdbclient/include/fdbclient/AnnotateActor.h similarity index 100% rename from src/fdbclient/AnnotateActor.h rename to src/fdbclient/include/fdbclient/AnnotateActor.h diff --git a/src/fdbclient/AsyncFileS3BlobStore.actor.g.h b/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h similarity index 79% rename from src/fdbclient/AsyncFileS3BlobStore.actor.g.h rename to src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h index 7bac1b3..6cf4879 100644 --- a/src/fdbclient/AsyncFileS3BlobStore.actor.g.h +++ b/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" /* * AsyncFileS3BlobStore.actor.h * @@ -33,32 +33,32 @@ #include #include -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/serialize.h" #include "flow/Net2Packet.h" -#include "fdbrpc/IRateControl.h" +#include "flow/IRateControl.h" #include "fdbclient/S3BlobStore.h" #include "openssl/md5.h" -#include "fdbrpc/libb64/encode.h" +#include "libb64/encode.h" #include "flow/actorcompiler.h" // This must be the last #include. - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" namespace { // This generated class is to be used only via joinErrorGroup() - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" template - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" class JoinErrorGroupActorState { - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" public: - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" JoinErrorGroupActorState(Future const& f,Promise const& p) - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" : f(f), - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" p(p) - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" { fdb_probe_actor_create("joinErrorGroup", reinterpret_cast(this)); @@ -72,16 +72,16 @@ class JoinErrorGroupActorState { { try { try { - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" StrictFuture __when_expr_0 = success(f) || p.getFuture(); - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -109,17 +109,17 @@ class JoinErrorGroupActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (p.canBeSet()) - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" { - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" p.sendError(e); - #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" } - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" return a_body1Catch1(e, loopDepth); - #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -131,9 +131,9 @@ class JoinErrorGroupActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (!static_cast(this)->SAV::futures) { (void)(f.get()); this->~JoinErrorGroupActorState(); static_cast(this)->destroy(); return 0; } - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" new (&static_cast(this)->SAV< T >::value()) T(f.get()); this->~JoinErrorGroupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -143,9 +143,9 @@ class JoinErrorGroupActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (!static_cast(this)->SAV::futures) { (void)(f.get()); this->~JoinErrorGroupActorState(); static_cast(this)->destroy(); return 0; } - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" new (&static_cast(this)->SAV< T >::value()) T(f.get()); this->~JoinErrorGroupActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -216,18 +216,18 @@ class JoinErrorGroupActorState { fdb_probe_actor_exit("joinErrorGroup", reinterpret_cast(this), 0); } - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" Future f; - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" Promise p; - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" }; // This generated class is to be used only via joinErrorGroup() - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" template - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" class JoinErrorGroupActor final : public Actor, public ActorCallback< JoinErrorGroupActor, 0, Void >, public FastAllocated>, public JoinErrorGroupActorState> { - #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -236,9 +236,9 @@ class JoinErrorGroupActor final : public Actor, public ActorCallback< JoinErr void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< JoinErrorGroupActor, 0, Void >; - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" JoinErrorGroupActor(Future const& f,Promise const& p) - #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" : Actor(), JoinErrorGroupActorState>(f, p) { @@ -262,16 +262,16 @@ friend struct ActorCallback< JoinErrorGroupActor, 0, Void >; } }; } - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" template - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" [[nodiscard]] static Future joinErrorGroup( Future const& f, Promise const& p ) { - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" return Future(new JoinErrorGroupActor(f, p)); - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" } -#line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" +#line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" // This class represents a write-only file that lives in an S3-style blob store. It writes using the REST API, // using multi-part upload and beginning to transfer each part as soon as it is large enough. // All write operations file operations must be sequential and contiguous. @@ -316,26 +316,26 @@ class AsyncFileS3BlobStoreWrite final : public IAsyncFile, public ReferenceCount Future read(void* data, int length, int64_t offset) override { throw file_not_readable(); } - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" // This generated class is to be used only via write_impl() - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" template - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" class Write_implActorState { - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" public: - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" Write_implActorState(Reference const& f,const uint8_t* const& data,int const& length) - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" : f(f), - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" data(data), - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" length(length), - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" p(f->m_parts.back().getPtr()) - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" { fdb_probe_actor_create("write_impl", reinterpret_cast(this)); @@ -348,9 +348,9 @@ class Write_implActorState { int a_body1(int loopDepth=0) { try { - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" ; - #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -371,11 +371,11 @@ class Write_implActorState { } int a_body1cont1(int loopDepth) { - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" p->write((const uint8_t*)data, length); - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Write_implActorState(); static_cast(this)->destroy(); return 0; } - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Write_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -392,30 +392,30 @@ class Write_implActorState { } int a_body1loopBody1(int loopDepth) { - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (!(p->length + length >= f->m_bstore->knobs.multipart_min_part_size)) - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" int finishlen = f->m_bstore->knobs.multipart_min_part_size - p->length; - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" p->write((const uint8_t*)data, finishlen); - #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" length -= finishlen; - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" data = (const uint8_t*)data + finishlen; - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" StrictFuture __when_expr_0 = f->endCurrentPart(f.getPtr(), true); - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" loopDepth = 0; return loopDepth; @@ -435,18 +435,18 @@ class Write_implActorState { } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" p = f->m_parts.back().getPtr(); - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" p = f->m_parts.back().getPtr(); - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -514,20 +514,20 @@ class Write_implActorState { fdb_probe_actor_exit("write_impl", reinterpret_cast(this), 0); } - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" Reference f; - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" const uint8_t* data; - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" int length; - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" Part* p; - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" }; // This generated class is to be used only via write_impl() - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" class Write_implActor final : public Actor, public ActorCallback< Write_implActor, 0, Void >, public FastAllocated, public Write_implActorState { - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -536,9 +536,9 @@ class Write_implActor final : public Actor, public ActorCallback< Write_im void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Write_implActor, 0, Void >; - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" Write_implActor(Reference const& f,const uint8_t* const& data,int const& length) - #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" : Actor(), Write_implActorState(f, data, length) { @@ -561,14 +561,14 @@ friend struct ActorCallback< Write_implActor, 0, Void >; } }; - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" [[nodiscard]] static Future write_impl( Reference const& f, const uint8_t* const& data, int const& length ) { - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" return Future(new Write_implActor(f, data, length)); - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" } -#line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" +#line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" Future write(void const* data, int length, int64_t offset) override { if (offset != m_cursor) @@ -585,22 +585,22 @@ friend struct ActorCallback< Write_implActor, 0, Void >; return Void(); } - #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" // This generated class is to be used only via doPartUpload() - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" template - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" class DoPartUploadActorState { - #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" public: - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" DoPartUploadActorState(AsyncFileS3BlobStoreWrite* const& f,Part* const& p) - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" : f(f), - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" p(p) - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" { fdb_probe_actor_create("doPartUpload", reinterpret_cast(this)); @@ -613,18 +613,18 @@ class DoPartUploadActorState { int a_body1(int loopDepth=0) { try { - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" p->finalizeMD5(); - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" StrictFuture __when_expr_0 = f->getUploadID(); - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -645,32 +645,32 @@ class DoPartUploadActorState { } int a_body1cont1(std::string const& upload_id,int loopDepth) { - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" StrictFuture __when_expr_1 = f->m_bstore->uploadPart( f->m_bucket, f->m_object, upload_id, p->number, &p->content, p->length, p->md5string); - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1cont1(std::string && upload_id,int loopDepth) { - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" StrictFuture __when_expr_1 = f->m_bstore->uploadPart( f->m_bucket, f->m_object, upload_id, p->number, &p->content, p->length, p->md5string); - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" loopDepth = 0; return loopDepth; @@ -740,9 +740,9 @@ class DoPartUploadActorState { } int a_body1cont2(std::string const& etag,int loopDepth) { - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (!static_cast(this)->SAV::futures) { (void)(etag); this->~DoPartUploadActorState(); static_cast(this)->destroy(); return 0; } - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" new (&static_cast(this)->SAV< std::string >::value()) std::string(etag); this->~DoPartUploadActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -752,9 +752,9 @@ class DoPartUploadActorState { } int a_body1cont2(std::string && etag,int loopDepth) { - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (!static_cast(this)->SAV::futures) { (void)(etag); this->~DoPartUploadActorState(); static_cast(this)->destroy(); return 0; } - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" new (&static_cast(this)->SAV< std::string >::value()) std::string(etag); this->~DoPartUploadActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -825,16 +825,16 @@ class DoPartUploadActorState { fdb_probe_actor_exit("doPartUpload", reinterpret_cast(this), 1); } - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" AsyncFileS3BlobStoreWrite* f; - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" Part* p; - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" }; // This generated class is to be used only via doPartUpload() - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" class DoPartUploadActor final : public Actor, public ActorCallback< DoPartUploadActor, 0, std::string >, public ActorCallback< DoPartUploadActor, 1, std::string >, public FastAllocated, public DoPartUploadActorState { - #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -844,9 +844,9 @@ class DoPartUploadActor final : public Actor, public ActorCallback< #pragma clang diagnostic pop friend struct ActorCallback< DoPartUploadActor, 0, std::string >; friend struct ActorCallback< DoPartUploadActor, 1, std::string >; - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" DoPartUploadActor(AsyncFileS3BlobStoreWrite* const& f,Part* const& p) - #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" : Actor(), DoPartUploadActorState(f, p) { @@ -870,29 +870,29 @@ friend struct ActorCallback< DoPartUploadActor, 1, std::string >; } }; - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" [[nodiscard]] static Future doPartUpload( AsyncFileS3BlobStoreWrite* const& f, Part* const& p ) { - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" return Future(new DoPartUploadActor(f, p)); - #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" } -#line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" +#line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" // This generated class is to be used only via doFinishUpload() - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" template - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" class DoFinishUploadActorState { - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" public: - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" DoFinishUploadActorState(AsyncFileS3BlobStoreWrite* const& f) - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" : f(f) - #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" { fdb_probe_actor_create("doFinishUpload", reinterpret_cast(this)); @@ -905,24 +905,24 @@ class DoFinishUploadActorState { int a_body1(int loopDepth=0) { try { - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (f->m_parts.size() == 1) - #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" { - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" Reference part = f->m_parts.back(); - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" part->finalizeMD5(); - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" StrictFuture __when_expr_0 = f->m_bstore->writeEntireFileFromBuffer( f->m_bucket, f->m_object, &part->content, part->length, part->md5string); - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" loopDepth = 0; } else @@ -948,25 +948,25 @@ class DoFinishUploadActorState { } int a_body1cont1(int loopDepth) { - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" StrictFuture __when_expr_1 = f->endCurrentPart(f); - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1cont2(Void const& _,int loopDepth) { - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DoFinishUploadActorState(); static_cast(this)->destroy(); return 0; } - #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DoFinishUploadActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -976,9 +976,9 @@ class DoFinishUploadActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DoFinishUploadActorState(); static_cast(this)->destroy(); return 0; } - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DoFinishUploadActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1051,26 +1051,26 @@ class DoFinishUploadActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" partSet = S3BlobStoreEndpoint::MultiPartSetT(); - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" p = std::vector>::iterator(); - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" p = f->m_parts.begin(); - #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" loopDepth = a_body1cont4loopHead1(loopDepth); return loopDepth; } int a_body1cont4(Void && _,int loopDepth) { - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" partSet = S3BlobStoreEndpoint::MultiPartSetT(); - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" p = std::vector>::iterator(); - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" p = f->m_parts.begin(); - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" loopDepth = a_body1cont4loopHead1(loopDepth); return loopDepth; @@ -1140,16 +1140,16 @@ class DoFinishUploadActorState { } int a_body1cont5(int loopDepth) { - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" StrictFuture __when_expr_3 = f->m_bstore->finishMultiPartUpload(f->m_bucket, f->m_object, f->m_upload_id.get(), partSet); - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" loopDepth = 0; return loopDepth; @@ -1163,22 +1163,22 @@ class DoFinishUploadActorState { } int a_body1cont4loopBody1(int loopDepth) { - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (!(p != f->m_parts.end())) - #line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" { return a_body1cont4break1(loopDepth==0?0:loopDepth-1); // break } - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" StrictFuture __when_expr_2 = (*p)->etag; - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont4loopBody1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" loopDepth = 0; return loopDepth; @@ -1198,34 +1198,34 @@ class DoFinishUploadActorState { } int a_body1cont4loopBody1cont1(std::string const& tag,int loopDepth) { - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if ((*p)->length > 0) - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" { - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" partSet[(*p)->number] = tag; - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" } - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" ++p; - #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" if (loopDepth == 0) return a_body1cont4loopHead1(0); return loopDepth; } int a_body1cont4loopBody1cont1(std::string && tag,int loopDepth) { - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if ((*p)->length > 0) - #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" { - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" partSet[(*p)->number] = tag; - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" } - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" ++p; - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" if (loopDepth == 0) return a_body1cont4loopHead1(0); return loopDepth; @@ -1295,9 +1295,9 @@ class DoFinishUploadActorState { } int a_body1cont6(Void const& _,int loopDepth) { - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DoFinishUploadActorState(); static_cast(this)->destroy(); return 0; } - #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DoFinishUploadActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1307,9 +1307,9 @@ class DoFinishUploadActorState { } int a_body1cont6(Void && _,int loopDepth) { - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DoFinishUploadActorState(); static_cast(this)->destroy(); return 0; } - #line 1312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DoFinishUploadActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1380,18 +1380,18 @@ class DoFinishUploadActorState { fdb_probe_actor_exit("doFinishUpload", reinterpret_cast(this), 3); } - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" AsyncFileS3BlobStoreWrite* f; - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" S3BlobStoreEndpoint::MultiPartSetT partSet; - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" std::vector>::iterator p; - #line 1389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" }; // This generated class is to be used only via doFinishUpload() - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" class DoFinishUploadActor final : public Actor, public ActorCallback< DoFinishUploadActor, 0, Void >, public ActorCallback< DoFinishUploadActor, 1, Void >, public ActorCallback< DoFinishUploadActor, 2, std::string >, public ActorCallback< DoFinishUploadActor, 3, Void >, public FastAllocated, public DoFinishUploadActorState { - #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1403,9 +1403,9 @@ friend struct ActorCallback< DoFinishUploadActor, 0, Void >; friend struct ActorCallback< DoFinishUploadActor, 1, Void >; friend struct ActorCallback< DoFinishUploadActor, 2, std::string >; friend struct ActorCallback< DoFinishUploadActor, 3, Void >; - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" DoFinishUploadActor(AsyncFileS3BlobStoreWrite* const& f) - #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" : Actor(), DoFinishUploadActorState(f) { @@ -1431,14 +1431,14 @@ friend struct ActorCallback< DoFinishUploadActor, 3, Void >; } }; - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" [[nodiscard]] static Future doFinishUpload( AsyncFileS3BlobStoreWrite* const& f ) { - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" return Future(new DoFinishUploadActor(f)); - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" } -#line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" +#line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" // Ready once all data has been sent AND acknowledged from the remote side Future sync() override { @@ -1492,22 +1492,22 @@ friend struct ActorCallback< DoFinishUploadActor, 3, Void >; FlowLock m_concurrentUploads; // End the current part and start uploading it, but also wait for a part to finish if too many are in transit. - #line 1495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" // This generated class is to be used only via endCurrentPart() - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" template - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" class EndCurrentPartActorState { - #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" public: - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" EndCurrentPartActorState(AsyncFileS3BlobStoreWrite* const& f,bool const& startNew = false) - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" : f(f), - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" startNew(startNew) - #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" { fdb_probe_actor_create("endCurrentPart", reinterpret_cast(this)); @@ -1520,28 +1520,28 @@ class EndCurrentPartActorState { int a_body1(int loopDepth=0) { try { - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (f->m_parts.back()->length == 0) - #line 1525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" { - #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~EndCurrentPartActorState(); static_cast(this)->destroy(); return 0; } - #line 1529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~EndCurrentPartActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" StrictFuture __when_expr_0 = f->m_concurrentUploads.take(); - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -1562,21 +1562,21 @@ class EndCurrentPartActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" auto releaser = std::make_shared(f->m_concurrentUploads, 1); - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" f->m_parts.back()->etag = holdWhile(std::move(releaser), joinErrorGroup(doPartUpload(f, f->m_parts.back().getPtr()), f->m_error)); - #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (startNew) - #line 1571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" { - #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" f->m_parts.push_back( Reference(new Part(f->m_parts.size() + 1, f->m_bstore->knobs.multipart_min_part_size))); - #line 1575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" } - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~EndCurrentPartActorState(); static_cast(this)->destroy(); return 0; } - #line 1579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~EndCurrentPartActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1586,21 +1586,21 @@ class EndCurrentPartActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" auto releaser = std::make_shared(f->m_concurrentUploads, 1); - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" f->m_parts.back()->etag = holdWhile(std::move(releaser), joinErrorGroup(doPartUpload(f, f->m_parts.back().getPtr()), f->m_error)); - #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (startNew) - #line 1595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" { - #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" f->m_parts.push_back( Reference(new Part(f->m_parts.size() + 1, f->m_bstore->knobs.multipart_min_part_size))); - #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" } - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~EndCurrentPartActorState(); static_cast(this)->destroy(); return 0; } - #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~EndCurrentPartActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1671,16 +1671,16 @@ class EndCurrentPartActorState { fdb_probe_actor_exit("endCurrentPart", reinterpret_cast(this), 0); } - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" AsyncFileS3BlobStoreWrite* f; - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" bool startNew; - #line 1678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" }; // This generated class is to be used only via endCurrentPart() - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" class EndCurrentPartActor final : public Actor, public ActorCallback< EndCurrentPartActor, 0, Void >, public FastAllocated, public EndCurrentPartActorState { - #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1689,9 +1689,9 @@ class EndCurrentPartActor final : public Actor, public ActorCallback< EndC void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< EndCurrentPartActor, 0, Void >; - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" EndCurrentPartActor(AsyncFileS3BlobStoreWrite* const& f,bool const& startNew = false) - #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" : Actor(), EndCurrentPartActorState(f, startNew) { @@ -1714,14 +1714,14 @@ friend struct ActorCallback< EndCurrentPartActor, 0, Void >; } }; - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" [[nodiscard]] static Future endCurrentPart( AsyncFileS3BlobStoreWrite* const& f, bool const& startNew = false ) { - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" return Future(new EndCurrentPartActor(f, startNew)); - #line 1721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.g.h" + #line 1721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.g.h" } -#line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/AsyncFileS3BlobStore.actor.h" +#line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h" Future getUploadID() { if (!m_upload_id.isValid()) diff --git a/src/fdbclient/AsyncFileS3BlobStore.actor.h b/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h similarity index 99% rename from src/fdbclient/AsyncFileS3BlobStore.actor.h rename to src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h index 1b14886..bdc4b00 100644 --- a/src/fdbclient/AsyncFileS3BlobStore.actor.h +++ b/src/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h @@ -31,13 +31,13 @@ #include #include -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/serialize.h" #include "flow/Net2Packet.h" -#include "fdbrpc/IRateControl.h" +#include "flow/IRateControl.h" #include "fdbclient/S3BlobStore.h" #include "openssl/md5.h" -#include "fdbrpc/libb64/encode.h" +#include "libb64/encode.h" #include "flow/actorcompiler.h" // This must be the last #include. ACTOR template diff --git a/src/fdbclient/AsyncTaskThread.h b/src/fdbclient/include/fdbclient/AsyncTaskThread.h similarity index 98% rename from src/fdbclient/AsyncTaskThread.h rename to src/fdbclient/include/fdbclient/AsyncTaskThread.h index 8f40a23..7693123 100644 --- a/src/fdbclient/AsyncTaskThread.h +++ b/src/fdbclient/include/fdbclient/AsyncTaskThread.h @@ -21,9 +21,10 @@ #ifndef __ASYNC_TASK_THREAD_H__ #define __ASYNC_TASK_THREAD_H__ -#include +#include #include #include +#include #include "flow/network.h" #include "flow/ThreadHelper.actor.h" diff --git a/src/fdbclient/Atomic.h b/src/fdbclient/include/fdbclient/Atomic.h similarity index 96% rename from src/fdbclient/Atomic.h rename to src/fdbclient/include/fdbclient/Atomic.h index 6643bcd..507cbe1 100644 --- a/src/fdbclient/Atomic.h +++ b/src/fdbclient/include/fdbclient/Atomic.h @@ -120,7 +120,7 @@ inline ValueRef doAppendIfFits(const Optional& existingValueOptional, if (!otherOperand.size()) return existingValue; if (existingValue.size() + otherOperand.size() > CLIENT_KNOBS->VALUE_SIZE_LIMIT) { - TEST(true) // AppendIfFIts resulted in truncation + CODE_PROBE(true, "AppendIfFits resulted in truncation"); return existingValue; } @@ -255,6 +255,13 @@ static void placeVersionstamp(uint8_t* destination, Version version, uint16_t tr memcpy(destination + sizeof(version), &transactionNumber, sizeof(transactionNumber)); } +inline int32_t parseVersionstampOffset(StringRef& key) { + ASSERT_GE(key.size(), 4); + int32_t pos; + memcpy(&pos, key.end() - sizeof(int32_t), sizeof(int32_t)); + pos = littleEndian32(pos); + return pos; +} /* * Returns the range corresponding to the specified versionstamp key. */ @@ -265,9 +272,7 @@ inline KeyRangeRef getVersionstampKeyRange(Arena& arena, const KeyRef& key, Vers if (begin.size() < 4) throw client_invalid_operation(); - int32_t pos; - memcpy(&pos, begin.end() - sizeof(int32_t), sizeof(int32_t)); - pos = littleEndian32(pos); + int32_t pos = parseVersionstampOffset(begin); begin = begin.substr(0, begin.size() - 4); end = end.substr(0, end.size() - 3); mutateString(end)[end.size() - 1] = 0; @@ -285,9 +290,7 @@ inline void transformVersionstampKey(StringRef& key, Version version, uint16_t t if (key.size() < 4) throw client_invalid_operation(); - int32_t pos; - memcpy(&pos, key.end() - sizeof(int32_t), sizeof(int32_t)); - pos = littleEndian32(pos); + int32_t pos = parseVersionstampOffset(key); if (pos < 0 || pos + 10 > key.size()) throw client_invalid_operation(); @@ -299,9 +302,7 @@ inline void transformVersionstampMutation(MutationRef& mutation, Version version, uint16_t transactionNumber) { if ((mutation.*param).size() >= 4) { - int32_t pos; - memcpy(&pos, (mutation.*param).end() - sizeof(int32_t), sizeof(int32_t)); - pos = littleEndian32(pos); + int32_t pos = parseVersionstampOffset(mutation.*param); mutation.*param = (mutation.*param).substr(0, (mutation.*param).size() - 4); if (pos >= 0 && pos + 10 <= (mutation.*param).size()) { diff --git a/src/fdbclient/include/fdbclient/Audit.h b/src/fdbclient/include/fdbclient/Audit.h new file mode 100644 index 0000000..a0d5864 --- /dev/null +++ b/src/fdbclient/include/fdbclient/Audit.h @@ -0,0 +1,144 @@ +/* + * Audit.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBCLIENT_AUDIT_H +#define FDBCLIENT_AUDIT_H +#pragma once + +#include "fdbclient/FDBTypes.h" +#include "fdbrpc/fdbrpc.h" + +enum class AuditPhase : uint8_t { + Invalid = 0, + Running = 1, + Complete = 2, + Error = 3, + Failed = 4, +}; + +enum class AuditType : uint8_t { + Invalid = 0, + ValidateHA = 1, + ValidateReplica = 2, + ValidateLocationMetadata = 3, + ValidateStorageServerShard = 4, +}; + +struct AuditStorageState { + constexpr static FileIdentifier file_identifier = 13804340; + + AuditStorageState() : type(0), auditServerId(UID()), phase(0), ddId(UID()) {} + AuditStorageState(UID id, UID auditServerId, AuditType type) + : id(id), auditServerId(auditServerId), type(static_cast(type)), phase(0), ddId(UID()) {} + AuditStorageState(UID id, KeyRange range, AuditType type) + : id(id), auditServerId(UID()), range(range), type(static_cast(type)), phase(0), ddId(UID()) {} + AuditStorageState(UID id, AuditType type) + : id(id), auditServerId(UID()), type(static_cast(type)), phase(0), ddId(UID()) {} + + template + void serialize(Ar& ar) { + serializer(ar, id, auditServerId, range, type, phase, error, ddId, engineType); + } + + inline void setType(AuditType type) { this->type = static_cast(type); } + inline AuditType getType() const { return static_cast(this->type); } + + inline void setPhase(AuditPhase phase) { this->phase = static_cast(phase); } + inline AuditPhase getPhase() const { return static_cast(this->phase); } + + std::string toString() const { + std::string res = "AuditStorageState: [ID]: " + id.toString() + + ", [Range]: " + Traceable::toString(range) + + ", [Type]: " + std::to_string(type) + ", [Phase]: " + std::to_string(phase); + if (!error.empty()) { + res += "[Error]: " + error; + } + + return res; + } + + UID id; + UID ddId; // ddId indicates this audit is managed by which dd + // ddId is used to check if dd has changed + // When a new dd starts in the middle of an onging audit, + // The ongoing audit's ddId gets updated + // When SS updates the progress, it checks ddId + // If the ddId is updated, SS Audit actors of the old dd will stop themselves + // New dd will issue new requests to SSes to continue the remaining work + UID auditServerId; // UID of SS who is working on this audit task + KeyRange range; + uint8_t type; + uint8_t phase; + KeyValueStoreType engineType; + std::string error; +}; + +struct AuditStorageRequest { + constexpr static FileIdentifier file_identifier = 13804341; + + AuditStorageRequest() = default; + AuditStorageRequest(UID id, KeyRange range, AuditType type) + : id(id), range(range), type(static_cast(type)) {} + + inline void setType(AuditType type) { this->type = static_cast(this->type); } + inline AuditType getType() const { return static_cast(this->type); } + + template + void serialize(Ar& ar) { + serializer(ar, id, range, type, targetServers, reply, ddId); + } + + UID id; + UID ddId; // UID of DD who claims the audit + KeyRange range; + uint8_t type; + std::vector targetServers; + ReplyPromise reply; +}; + +// Triggers an audit of the specific type, an audit id is returned if an audit is scheduled successfully. +// If there is an running audit, the corresponding id will be returned, unless force is true; +// When cancel is set, the ongoing audit will be cancelled. +struct TriggerAuditRequest { + constexpr static FileIdentifier file_identifier = 1384445; + + TriggerAuditRequest() = default; + TriggerAuditRequest(AuditType type, KeyRange range, KeyValueStoreType engineType) + : type(static_cast(type)), range(range), cancel(false), engineType(engineType) {} + + TriggerAuditRequest(AuditType type, UID id) : type(static_cast(type)), id(id), cancel(true) {} + + void setType(AuditType type) { this->type = static_cast(this->type); } + AuditType getType() const { return static_cast(this->type); } + + template + void serialize(Ar& ar) { + serializer(ar, type, range, id, cancel, reply, engineType); + } + + UID id; + uint8_t type; + KeyRange range; + KeyValueStoreType engineType; + bool cancel; + ReplyPromise reply; +}; + +#endif diff --git a/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h b/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h new file mode 100644 index 0000000..dfd8284 --- /dev/null +++ b/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h @@ -0,0 +1,141 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" +/* + * AuditUtils.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_AUDITUTILS_ACTOR_G_H) +#define FDBCLIENT_AUDITUTILS_ACTOR_G_H +#include "fdbclient/AuditUtils.actor.g.h" +#elif !defined(FDBCLIENT_AUDITUTILS_ACTOR_H) +#define FDBCLIENT_AUDITUTILS_ACTOR_H +#pragma once + +#include "fdbclient/Audit.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/NativeAPI.actor.h" +#include "fdbrpc/fdbrpc.h" + +#include "flow/actorcompiler.h" // has to be last include + +struct MoveKeyLockInfo { + UID prevOwner, myOwner, prevWrite; +}; + + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future cancelAuditMetadata( Database const& cx, AuditType const& auditType, UID const& auditId ); + +#line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future persistNewAuditState( Database const& cx, AuditStorageState const& auditState, MoveKeyLockInfo const& lock, bool const& ddEnabled ); + +#line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future persistAuditState( Database const& cx, AuditStorageState const& auditState, std::string const& context, MoveKeyLockInfo const& lock, bool const& ddEnabled ); + +#line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future getAuditState( Database const& cx, AuditType const& type, UID const& id ); + +#line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future> getAuditStates( Database const& cx, AuditType const& auditType, bool const& newFirst, Optional const& num = Optional(), Optional const& phase = Optional() ); + +#line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future persistAuditStateByRange( Database const& cx, AuditStorageState const& auditState ); + +#line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future> getAuditStateByRange( Database const& cx, AuditType const& type, UID const& auditId, KeyRange const& range ); + +#line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future persistAuditStateByServer( Database const& cx, AuditStorageState const& auditState ); + +#line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future> getAuditStateByServer( Database const& cx, AuditType const& type, UID const& auditId, UID const& auditServerId, KeyRange const& range ); + +#line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future clearAuditMetadataForType( Database const& cx, AuditType const& auditType, UID const& maxAuditIdToClear, int const& numFinishAuditToKeep ); + +#line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future checkStorageServerRemoved( Database const& cx, UID const& ssid ); + +#line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" +AuditPhase stringToAuditPhase(std::string auditPhaseStr); + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future checkAuditProgressCompleteByRange( Database const& cx, AuditType const& auditType, UID const& auditId, KeyRange const& auditRange ); + +#line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future checkAuditProgressCompleteByServer( Database const& cx, AuditType const& auditType, UID const& auditId, KeyRange const& auditRange, UID const& serverId, std::shared_ptr> const& checkProgressBudget ); + +#line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future> initAuditMetadata( Database const& cx, MoveKeyLockInfo const& lock, bool const& ddEnabled, UID const& dataDistributorId, int const& persistFinishAuditCount ); + +#line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + +struct AuditGetServerKeysRes { + KeyRange completeRange; + Version readAtVersion; + UID serverId; + std::vector ownRanges; + int64_t readBytes; + AuditGetServerKeysRes() = default; + AuditGetServerKeysRes(KeyRange completeRange, + Version readAtVersion, + UID serverId, + std::vector ownRanges, + int64_t readBytes) + : completeRange(completeRange), readAtVersion(readAtVersion), serverId(serverId), ownRanges(ownRanges), + readBytes(readBytes) {} +}; + +struct AuditGetKeyServersRes { + KeyRange completeRange; + Version readAtVersion; + int64_t readBytes; + std::unordered_map> rangeOwnershipMap; + AuditGetKeyServersRes() = default; + AuditGetKeyServersRes(KeyRange completeRange, + Version readAtVersion, + std::unordered_map> rangeOwnershipMap, + int64_t readBytes) + : completeRange(completeRange), readAtVersion(readAtVersion), rangeOwnershipMap(rangeOwnershipMap), + readBytes(readBytes) {} +}; + +std::vector coalesceRangeList(std::vector ranges); +Optional> rangesSame(std::vector rangesA, std::vector rangesB); + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future getThisServerKeysFromServerKeys( UID const& serverID, Transaction* const& tr, KeyRange const& range ); + +#line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.g.h" +[[nodiscard]] Future getShardMapFromKeyServers( UID const& auditServerId, Transaction* const& tr, KeyRange const& range ); + +#line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/AuditUtils.actor.h" + +#include "flow/unactorcompiler.h" +#endif diff --git a/src/fdbclient/include/fdbclient/AuditUtils.actor.h b/src/fdbclient/include/fdbclient/AuditUtils.actor.h new file mode 100644 index 0000000..74de591 --- /dev/null +++ b/src/fdbclient/include/fdbclient/AuditUtils.actor.h @@ -0,0 +1,121 @@ +/* + * AuditUtils.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_AUDITUTILS_ACTOR_G_H) +#define FDBCLIENT_AUDITUTILS_ACTOR_G_H +#include "fdbclient/AuditUtils.actor.g.h" +#elif !defined(FDBCLIENT_AUDITUTILS_ACTOR_H) +#define FDBCLIENT_AUDITUTILS_ACTOR_H +#pragma once + +#include "fdbclient/Audit.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/NativeAPI.actor.h" +#include "fdbrpc/fdbrpc.h" + +#include "flow/actorcompiler.h" // has to be last include + +struct MoveKeyLockInfo { + UID prevOwner, myOwner, prevWrite; +}; + +ACTOR Future cancelAuditMetadata(Database cx, AuditType auditType, UID auditId); +ACTOR Future persistNewAuditState(Database cx, AuditStorageState auditState, MoveKeyLockInfo lock, bool ddEnabled); +ACTOR Future persistAuditState(Database cx, + AuditStorageState auditState, + std::string context, + MoveKeyLockInfo lock, + bool ddEnabled); +ACTOR Future getAuditState(Database cx, AuditType type, UID id); +ACTOR Future> getAuditStates(Database cx, + AuditType auditType, + bool newFirst, + Optional num = Optional(), + Optional phase = Optional()); +ACTOR Future persistAuditStateByRange(Database cx, AuditStorageState auditState); +ACTOR Future> getAuditStateByRange(Database cx, + AuditType type, + UID auditId, + KeyRange range); +ACTOR Future persistAuditStateByServer(Database cx, AuditStorageState auditState); +ACTOR Future> getAuditStateByServer(Database cx, + AuditType type, + UID auditId, + UID auditServerId, + KeyRange range); +ACTOR Future clearAuditMetadataForType(Database cx, + AuditType auditType, + UID maxAuditIdToClear, + int numFinishAuditToKeep); +ACTOR Future checkStorageServerRemoved(Database cx, UID ssid); +AuditPhase stringToAuditPhase(std::string auditPhaseStr); +ACTOR Future checkAuditProgressCompleteByRange(Database cx, + AuditType auditType, + UID auditId, + KeyRange auditRange); +ACTOR Future checkAuditProgressCompleteByServer(Database cx, + AuditType auditType, + UID auditId, + KeyRange auditRange, + UID serverId, + std::shared_ptr> checkProgressBudget); +ACTOR Future> initAuditMetadata(Database cx, + MoveKeyLockInfo lock, + bool ddEnabled, + UID dataDistributorId, + int persistFinishAuditCount); + +struct AuditGetServerKeysRes { + KeyRange completeRange; + Version readAtVersion; + UID serverId; + std::vector ownRanges; + int64_t readBytes; + AuditGetServerKeysRes() = default; + AuditGetServerKeysRes(KeyRange completeRange, + Version readAtVersion, + UID serverId, + std::vector ownRanges, + int64_t readBytes) + : completeRange(completeRange), readAtVersion(readAtVersion), serverId(serverId), ownRanges(ownRanges), + readBytes(readBytes) {} +}; + +struct AuditGetKeyServersRes { + KeyRange completeRange; + Version readAtVersion; + int64_t readBytes; + std::unordered_map> rangeOwnershipMap; + AuditGetKeyServersRes() = default; + AuditGetKeyServersRes(KeyRange completeRange, + Version readAtVersion, + std::unordered_map> rangeOwnershipMap, + int64_t readBytes) + : completeRange(completeRange), readAtVersion(readAtVersion), rangeOwnershipMap(rangeOwnershipMap), + readBytes(readBytes) {} +}; + +std::vector coalesceRangeList(std::vector ranges); +Optional> rangesSame(std::vector rangesA, std::vector rangesB); +ACTOR Future getThisServerKeysFromServerKeys(UID serverID, Transaction* tr, KeyRange range); +ACTOR Future getShardMapFromKeyServers(UID auditServerId, Transaction* tr, KeyRange range); + +#include "flow/unactorcompiler.h" +#endif diff --git a/src/fdbclient/BackupAgent.actor.g.h b/src/fdbclient/include/fdbclient/BackupAgent.actor.g.h similarity index 80% rename from src/fdbclient/BackupAgent.actor.g.h rename to src/fdbclient/include/fdbclient/BackupAgent.actor.g.h index 9740008..84d9f7b 100644 --- a/src/fdbclient/BackupAgent.actor.g.h +++ b/src/fdbclient/include/fdbclient/BackupAgent.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.h" /* * BackupAgent.actor.h * @@ -31,32 +31,33 @@ #include "fdbclient/NativeAPI.actor.h" #include "fdbclient/TaskBucket.h" #include "fdbclient/Notified.h" -#include "fdbrpc/IAsyncFile.h" -#include "fdbclient/KeyBackedTypes.h" +#include "flow/IAsyncFile.h" +#include "fdbclient/KeyBackedTypes.actor.h" #include #include #include "fdbclient/BackupContainer.h" #include "flow/actorcompiler.h" // has to be last include -FDB_DECLARE_BOOLEAN_PARAM(LockDB); -FDB_DECLARE_BOOLEAN_PARAM(UnlockDB); -FDB_DECLARE_BOOLEAN_PARAM(StopWhenDone); -FDB_DECLARE_BOOLEAN_PARAM(Verbose); -FDB_DECLARE_BOOLEAN_PARAM(WaitForComplete); -FDB_DECLARE_BOOLEAN_PARAM(ForceAction); -FDB_DECLARE_BOOLEAN_PARAM(Terminator); -FDB_DECLARE_BOOLEAN_PARAM(IncrementalBackupOnly); -FDB_DECLARE_BOOLEAN_PARAM(UsePartitionedLog); -FDB_DECLARE_BOOLEAN_PARAM(OnlyApplyMutationLogs); -FDB_DECLARE_BOOLEAN_PARAM(InconsistentSnapshotOnly); -FDB_DECLARE_BOOLEAN_PARAM(ShowErrors); -FDB_DECLARE_BOOLEAN_PARAM(AbortOldBackup); -FDB_DECLARE_BOOLEAN_PARAM(DstOnly); // TODO: More descriptive name? -FDB_DECLARE_BOOLEAN_PARAM(WaitForDestUID); -FDB_DECLARE_BOOLEAN_PARAM(CheckBackupUID); -FDB_DECLARE_BOOLEAN_PARAM(DeleteData); -FDB_DECLARE_BOOLEAN_PARAM(SetValidation); -FDB_DECLARE_BOOLEAN_PARAM(PartialBackup); +FDB_BOOLEAN_PARAM(LockDB); +FDB_BOOLEAN_PARAM(UnlockDB); +FDB_BOOLEAN_PARAM(StopWhenDone); +FDB_BOOLEAN_PARAM(Verbose); +FDB_BOOLEAN_PARAM(WaitForComplete); +FDB_BOOLEAN_PARAM(ForceAction); +FDB_BOOLEAN_PARAM(Terminator); +FDB_BOOLEAN_PARAM(IncrementalBackupOnly); +FDB_BOOLEAN_PARAM(UsePartitionedLog); +FDB_BOOLEAN_PARAM(OnlyApplyMutationLogs); +FDB_BOOLEAN_PARAM(SnapshotBackupUseTenantCache); +FDB_BOOLEAN_PARAM(InconsistentSnapshotOnly); +FDB_BOOLEAN_PARAM(ShowErrors); +FDB_BOOLEAN_PARAM(AbortOldBackup); +FDB_BOOLEAN_PARAM(DstOnly); // TODO: More descriptive name? +FDB_BOOLEAN_PARAM(WaitForDestUID); +FDB_BOOLEAN_PARAM(CheckBackupUID); +FDB_BOOLEAN_PARAM(DeleteData); +FDB_BOOLEAN_PARAM(SetValidation); +FDB_BOOLEAN_PARAM(PartialBackup); extern Optional fileBackupAgentProxy; @@ -147,7 +148,7 @@ class FileBackupAgent : public BackupAgentBase { futureBucket = std::move(r.futureBucket); } - KeyBackedProperty lastBackupTimestamp() { return config.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty lastBackupTimestamp() { return config.pack(__FUNCTION__sr); } Future run(Database cx, double pollDelay, int maxConcurrentTasks) { return taskBucket->run(cx, futureBucket, std::make_shared(pollDelay), maxConcurrentTasks); @@ -194,51 +195,53 @@ class FileBackupAgent : public BackupAgentBase { Key url, Optional proxy, Standalone> ranges, + Standalone> beginVersions, WaitForComplete = WaitForComplete::True, Version targetVersion = ::invalidVersion, Verbose = Verbose::True, Key addPrefix = Key(), Key removePrefix = Key(), LockDB = LockDB::True, + UnlockDB = UnlockDB::True, + OnlyApplyMutationLogs = OnlyApplyMutationLogs::False, + InconsistentSnapshotOnly = InconsistentSnapshotOnly::False, + Optional const& encryptionKeyFileName = {}); + + Future restore(Database cx, + Optional cxOrig, + Key tagName, + Key url, + Optional proxy, + WaitForComplete = WaitForComplete::True, + Version targetVersion = ::invalidVersion, + Verbose = Verbose::True, + KeyRange range = KeyRange(), + Key addPrefix = Key(), + Key removePrefix = Key(), + LockDB = LockDB::True, OnlyApplyMutationLogs = OnlyApplyMutationLogs::False, InconsistentSnapshotOnly = InconsistentSnapshotOnly::False, Version beginVersion = ::invalidVersion, Optional const& encryptionKeyFileName = {}); + Future restore(Database cx, Optional cxOrig, Key tagName, Key url, Optional proxy, + Standalone> ranges, WaitForComplete waitForComplete = WaitForComplete::True, Version targetVersion = ::invalidVersion, Verbose verbose = Verbose::True, - KeyRange range = normalKeys, Key addPrefix = Key(), Key removePrefix = Key(), LockDB lockDB = LockDB::True, + UnlockDB unlockDB = UnlockDB::True, OnlyApplyMutationLogs onlyApplyMutationLogs = OnlyApplyMutationLogs::False, InconsistentSnapshotOnly inconsistentSnapshotOnly = InconsistentSnapshotOnly::False, Version beginVersion = ::invalidVersion, - Optional const& encryptionKeyFileName = {}) { - Standalone> rangeRef; - rangeRef.push_back_deep(rangeRef.arena(), range); - return restore(cx, - cxOrig, - tagName, - url, - proxy, - rangeRef, - waitForComplete, - targetVersion, - verbose, - addPrefix, - removePrefix, - lockDB, - onlyApplyMutationLogs, - inconsistentSnapshotOnly, - beginVersion, - encryptionKeyFileName); - } + Optional const& encryptionKeyFileName = {}); + Future atomicRestore(Database cx, Key tagName, Standalone> ranges, @@ -246,13 +249,10 @@ class FileBackupAgent : public BackupAgentBase { Key removePrefix = Key()); Future atomicRestore(Database cx, Key tagName, - KeyRange range = normalKeys, + KeyRange range = KeyRange(), Key addPrefix = Key(), - Key removePrefix = Key()) { - Standalone> rangeRef; - rangeRef.push_back_deep(rangeRef.arena(), range); - return atomicRestore(cx, tagName, rangeRef, addPrefix, removePrefix); - } + Key removePrefix = Key()); + // Tries to abort the restore for a tag. Returns the final (stable) state of the tag. Future abortRestore(Reference tr, Key tagName); Future abortRestore(Database cx, Key tagName); @@ -276,6 +276,7 @@ class FileBackupAgent : public BackupAgentBase { int snapshotIntervalSeconds, std::string const& tagName, Standalone> backupRanges, + bool encryptionEnabled, StopWhenDone = StopWhenDone::True, UsePartitionedLog = UsePartitionedLog::False, IncrementalBackupOnly = IncrementalBackupOnly::False, @@ -287,6 +288,7 @@ class FileBackupAgent : public BackupAgentBase { int snapshotIntervalSeconds, std::string const& tagName, Standalone> backupRanges, + bool encryptionEnabled, StopWhenDone stopWhenDone = StopWhenDone::True, UsePartitionedLog partitionedLog = UsePartitionedLog::False, IncrementalBackupOnly incrementalBackupOnly = IncrementalBackupOnly::False, @@ -299,6 +301,7 @@ class FileBackupAgent : public BackupAgentBase { snapshotIntervalSeconds, tagName, backupRanges, + encryptionEnabled, stopWhenDone, partitionedLog, incrementalBackupOnly, @@ -363,12 +366,14 @@ class FileBackupAgent : public BackupAgentBase { }; template <> -inline Tuple Codec::pack(FileBackupAgent::ERestoreState const& val) { - return Tuple().append(val); +inline Standalone TupleCodec::pack( + FileBackupAgent::ERestoreState const& val) { + return Tuple::makeTuple(static_cast(val)).pack(); } template <> -inline FileBackupAgent::ERestoreState Codec::unpack(Tuple const& val) { - return (FileBackupAgent::ERestoreState)val.getInt(0); +inline FileBackupAgent::ERestoreState TupleCodec::unpack( + Standalone const& val) { + return (FileBackupAgent::ERestoreState)Tuple::unpack(val).getInt(0); } class DatabaseBackupAgent : public BackupAgentBase { @@ -550,31 +555,31 @@ std::pair decodeBKMutationLogKey(Key key); Future logError(Database cx, Key keyErrors, const std::string& message); Future logError(Reference tr, Key keyErrors, const std::string& message); Future checkVersion(Reference const& tr); - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.g.h" + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.g.h" [[nodiscard]] Future readCommitted( Database const& cx, PromiseStream const& results, Reference const& lock, KeyRangeRef const& range, Terminator const& terminator = Terminator::True, AccessSystemKeys const& systemAccess = AccessSystemKeys::False, LockAware const& lockAware = LockAware::False ); -#line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.h" - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.g.h" +#line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.h" + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.g.h" [[nodiscard]] Future readCommitted( Database const& cx, PromiseStream const& results, Future const& active, Reference const& lock, KeyRangeRef const& range, std::function(Key key)> const& groupBy, Terminator const& terminator = Terminator::True, AccessSystemKeys const& systemAccess = AccessSystemKeys::False, LockAware const& lockAware = LockAware::False ); -#line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.h" - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.g.h" -[[nodiscard]] Future applyMutations( Database const& cx, Key const& uid, Key const& addPrefix, Key const& removePrefix, Version const& beginVersion, Version* const& endVersion, RequestStream const& commit, NotifiedVersion* const& committedVersion, Reference> const& keyVersion ); +#line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.h" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.g.h" +[[nodiscard]] Future applyMutations( Database const& cx, Key const& uid, Key const& addPrefix, Key const& removePrefix, Version const& beginVersion, Version* const& endVersion, PublicRequestStream const& commit, NotifiedVersion* const& committedVersion, Reference> const& keyVersion, std::map* const& tenantMap, bool const& provisionalProxy ); -#line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.h" - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.g.h" +#line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.h" + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.g.h" [[nodiscard]] Future cleanupBackup( Database const& cx, DeleteData const& deleteData ); -#line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.h" +#line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.h" using EBackupState = BackupAgentBase::EnumState; template <> -inline Tuple Codec::pack(EBackupState const& val) { - return Tuple().append(static_cast(val)); +inline Standalone TupleCodec::pack(EBackupState const& val) { + return Tuple::makeTuple(static_cast(val)).pack(); } template <> -inline EBackupState Codec::unpack(Tuple const& val) { - return static_cast(val.getInt(0)); +inline EBackupState TupleCodec::unpack(Standalone const& val) { + return static_cast(Tuple::unpack(val).getInt(0)); } // Key backed tags are a single-key slice of the TagUidMap, defined below. @@ -608,14 +613,14 @@ class KeyBackedTag : public KeyBackedProperty { typedef KeyBackedMap TagMap; // Map of tagName to {UID, aborted_flag} located in the fileRestorePrefixRange keyspace. class TagUidMap : public KeyBackedMap { - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.g.h" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.g.h" [[nodiscard]] static Future> getAll_impl( TagUidMap* const& tagsMap, Reference const& tr, Snapshot const& snapshot ); template friend class TagUidMap_GetAll_implActorState; -#line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.h" +#line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.h" public: - TagUidMap(const StringRef& prefix) : TagMap(LiteralStringRef("tag->uid/").withPrefix(prefix)), prefix(prefix) {} + TagUidMap(const StringRef& prefix) : TagMap("tag->uid/"_sr.withPrefix(prefix)), prefix(prefix) {} Future> getAll(Reference tr, Snapshot snapshot = Snapshot::False) { @@ -625,34 +630,39 @@ template friend class TagUidMap_GetAll_implActorState; Key prefix; }; -static inline KeyBackedTag makeRestoreTag(std::string tagName) { - return KeyBackedTag(tagName, fileRestorePrefixRange.begin); -} - -static inline KeyBackedTag makeBackupTag(std::string tagName) { - return KeyBackedTag(tagName, fileBackupPrefixRange.begin); -} - -static inline Future> getAllRestoreTags(Reference tr, - Snapshot snapshot = Snapshot::False) { - return TagUidMap(fileRestorePrefixRange.begin).getAll(tr, snapshot); -} - -static inline Future> getAllBackupTags(Reference tr, - Snapshot snapshot = Snapshot::False) { - return TagUidMap(fileBackupPrefixRange.begin).getAll(tr, snapshot); -} +class KeyBackedTaskConfig : public KeyBackedClass { +protected: + UID uid; + Subspace configSpace; -class KeyBackedConfig { public: static struct { - static TaskParam uid() { return LiteralStringRef(__FUNCTION__); } + static TaskParam uid() { return __FUNCTION__sr; } } TaskParams; - KeyBackedConfig(StringRef prefix, UID uid = UID()) - : uid(uid), prefix(prefix), configSpace(uidPrefixKey(LiteralStringRef("uid->config/").withPrefix(prefix), uid)) {} + KeyBackedTaskConfig(StringRef prefix, UID uid = UID()) + : KeyBackedClass(prefix), uid(uid), configSpace(uidPrefixKey("uid->config/"_sr.withPrefix(prefix), uid)) {} + + KeyBackedTaskConfig(StringRef prefix, Reference task) + : KeyBackedTaskConfig(prefix, TaskParams.uid().get(task)) {} + + KeyBackedProperty tag() { return configSpace.pack(__FUNCTION__sr); } + + UID getUid() { return uid; } + + Key getUidAsKey() { return BinaryWriter::toValue(uid, Unversioned()); } + + template + void clear(TrType tr) { + tr->clear(configSpace.range()); + } - KeyBackedConfig(StringRef prefix, Reference task) : KeyBackedConfig(prefix, TaskParams.uid().get(task)) {} + // lastError is a pair of error message and timestamp expressed as an int64_t + KeyBackedProperty> lastError() { return configSpace.pack(__FUNCTION__sr); } + + KeyBackedMap> lastErrorPerType() { + return configSpace.pack(__FUNCTION__sr); + } Future toTask(Reference tr, Reference task, @@ -668,34 +678,17 @@ class KeyBackedConfig { // restore uid. Get this uid's tag, then get the KEY for the tag's uid but don't read it. That becomes the // validation key which TaskBucket will check, and its value must be this restore config's uid. UID u = uid; // 'this' could be invalid in lambda - Key p = prefix; + Key p = subspace.key(); return map(tag().get(tr), [u, p, task](Optional const& tag) -> Void { if (!tag.present()) throw restore_error(); // Validation contition is that the uidPair key must be exactly {u, false} TaskBucket::setValidationCondition( - task, KeyBackedTag(tag.get(), p).key, Codec::pack({ u, false }).pack()); + task, KeyBackedTag(tag.get(), p).key, TupleCodec::pack({ u, false })); return Void(); }); } - KeyBackedProperty tag() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - - UID getUid() { return uid; } - - Key getUidAsKey() { return BinaryWriter::toValue(uid, Unversioned()); } - - void clear(Reference tr) { tr->clear(configSpace.range()); } - - // lastError is a pair of error message and timestamp expressed as an int64_t - KeyBackedProperty> lastError() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } - - KeyBackedMap> lastErrorPerType() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } - // Updates the error per type map and the last error property Future updateErrorInfo(Database cx, Error e, std::string message) { // Avoid capture of this ptr @@ -712,17 +705,29 @@ class KeyBackedConfig { }); }); } - -protected: - UID uid; - Key prefix; - Subspace configSpace; }; +static inline KeyBackedTag makeRestoreTag(std::string tagName) { + return KeyBackedTag(tagName, fileRestorePrefixRange.begin); +} + +static inline KeyBackedTag makeBackupTag(std::string tagName) { + return KeyBackedTag(tagName, fileBackupPrefixRange.begin); +} + +static inline Future> getAllRestoreTags(Reference tr, + Snapshot snapshot = Snapshot::False) { + return TagUidMap(fileRestorePrefixRange.begin).getAll(tr, snapshot); +} + +static inline Future> getAllBackupTags(Reference tr, + Snapshot snapshot = Snapshot::False) { + return TagUidMap(fileBackupPrefixRange.begin).getAll(tr, snapshot); +} + template <> -inline Tuple Codec>::pack(Reference const& bc) { - Tuple tuple; - tuple.append(StringRef(bc->getURL())); +inline Standalone TupleCodec>::pack(Reference const& bc) { + Tuple tuple = Tuple::makeTuple(bc->getURL()); if (bc->getEncryptionKeyFileName().present()) { tuple.append(bc->getEncryptionKeyFileName().get()); @@ -736,30 +741,32 @@ inline Tuple Codec>::pack(Reference -inline Reference Codec>::unpack(Tuple const& val) { - ASSERT(val.size() >= 1); - auto url = val.getString(0).toString(); +inline Reference TupleCodec>::unpack(Standalone const& val) { + Tuple t = Tuple::unpack(val); + ASSERT(t.size() >= 1); + + auto url = t.getString(0).toString(); Optional encryptionKeyFileName; - if (val.size() > 1 && !val.getString(1).empty()) { - encryptionKeyFileName = val.getString(1).toString(); + if (t.size() > 1 && !t.getString(1).empty()) { + encryptionKeyFileName = t.getString(1).toString(); } Optional proxy; - if (val.size() > 2 && !val.getString(2).empty()) { - proxy = val.getString(2).toString(); + if (t.size() > 2 && !t.getString(2).empty()) { + proxy = t.getString(2).toString(); } return IBackupContainer::openContainer(url, proxy, encryptionKeyFileName); } -class BackupConfig : public KeyBackedConfig { +class BackupConfig : public KeyBackedTaskConfig { public: - BackupConfig(UID uid = UID()) : KeyBackedConfig(fileBackupPrefixRange.begin, uid) {} - BackupConfig(Reference task) : KeyBackedConfig(fileBackupPrefixRange.begin, task) {} + BackupConfig(UID uid = UID()) : KeyBackedTaskConfig(fileBackupPrefixRange.begin, uid) {} + BackupConfig(Reference task) : KeyBackedTaskConfig(fileBackupPrefixRange.begin, task) {} // rangeFileMap maps a keyrange file's End to its Begin and Filename struct RangeSlice { @@ -767,9 +774,7 @@ class BackupConfig : public KeyBackedConfig { Version version; std::string fileName; int64_t fileSize; - Tuple pack() const { - return Tuple().append(begin).append(version).append(StringRef(fileName)).append(fileSize); - } + Tuple pack() const { return Tuple::makeTuple(begin, version, fileName, fileSize); } static RangeSlice unpack(Tuple const& t) { RangeSlice r; int i = 0; @@ -783,47 +788,41 @@ class BackupConfig : public KeyBackedConfig { // Map of range end boundaries to info about the backup file written for that range. typedef KeyBackedMap RangeFileMapT; - RangeFileMapT snapshotRangeFileMap() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + RangeFileMapT snapshotRangeFileMap() { return configSpace.pack(__FUNCTION__sr); } // Number of kv range files that were both committed to persistent storage AND inserted into // the snapshotRangeFileMap. Note that since insertions could replace 1 or more existing // map entries this is not necessarily the number of entries currently in the map. // This value exists to help with sizing of kv range folders for BackupContainers that // require it. - KeyBackedBinaryValue snapshotRangeFileCount() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue snapshotRangeFileCount() { return configSpace.pack(__FUNCTION__sr); } // Coalesced set of ranges already dispatched for writing. typedef KeyBackedMap RangeDispatchMapT; - RangeDispatchMapT snapshotRangeDispatchMap() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + RangeDispatchMapT snapshotRangeDispatchMap() { return configSpace.pack(__FUNCTION__sr); } // Interval to use for the first (initial) snapshot. - KeyBackedProperty initialSnapshotIntervalSeconds() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } + KeyBackedProperty initialSnapshotIntervalSeconds() { return configSpace.pack(__FUNCTION__sr); } // Interval to use for determining the target end version for new snapshots - KeyBackedProperty snapshotIntervalSeconds() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty snapshotIntervalSeconds() { return configSpace.pack(__FUNCTION__sr); } // When the current snapshot began - KeyBackedProperty snapshotBeginVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty snapshotBeginVersion() { return configSpace.pack(__FUNCTION__sr); } // When the current snapshot is desired to end. // This can be changed at runtime to speed up or slow down a snapshot - KeyBackedProperty snapshotTargetEndVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty snapshotTargetEndVersion() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty snapshotBatchSize() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty snapshotBatchSize() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty snapshotBatchFuture() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty snapshotBatchFuture() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty snapshotBatchDispatchDoneKey() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty snapshotBatchDispatchDoneKey() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty snapshotDispatchLastShardsBehind() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } + KeyBackedProperty snapshotDispatchLastShardsBehind() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty snapshotDispatchLastVersion() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } + KeyBackedProperty snapshotDispatchLastVersion() { return configSpace.pack(__FUNCTION__sr); } Future initNewSnapshot(Reference tr, int64_t intervalSeconds = -1) { BackupConfig& copy = *this; // Capture this by value instead of this ptr @@ -857,51 +856,50 @@ class BackupConfig : public KeyBackedConfig { }); } - KeyBackedBinaryValue rangeBytesWritten() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue rangeBytesWritten() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedBinaryValue logBytesWritten() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue logBytesWritten() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty stateEnum() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty stateEnum() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty> backupContainer() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } + KeyBackedProperty> backupContainer() { return configSpace.pack(__FUNCTION__sr); } // Set to true when all backup workers for saving mutation logs have been started. - KeyBackedProperty allWorkerStarted() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty allWorkerStarted() { return configSpace.pack(__FUNCTION__sr); } // Each backup worker adds its (epoch, tag.id) to this property. KeyBackedProperty>> startedBackupWorkers() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); + return configSpace.pack(__FUNCTION__sr); } // Set to true if backup worker is enabled. - KeyBackedProperty backupWorkerEnabled() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty backupWorkerEnabled() { return configSpace.pack(__FUNCTION__sr); } // Set to true if partitioned log is enabled (only useful if backup worker is also enabled). - KeyBackedProperty partitionedLogEnabled() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty partitionedLogEnabled() { return configSpace.pack(__FUNCTION__sr); } // Set to true if only requesting incremental backup without base snapshot. - KeyBackedProperty incrementalBackupOnly() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty incrementalBackupOnly() { return configSpace.pack(__FUNCTION__sr); } // Latest version for which all prior versions have saved by backup workers. - KeyBackedProperty latestBackupWorkerSavedVersion() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } + KeyBackedProperty latestBackupWorkerSavedVersion() { return configSpace.pack(__FUNCTION__sr); } // Stop differntial logging if already started or don't start after completing KV ranges - KeyBackedProperty stopWhenDone() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty stopWhenDone() { return configSpace.pack(__FUNCTION__sr); } + + // Enable snapshot backup file encryption + KeyBackedProperty enableSnapshotBackupEncryption() { return configSpace.pack(__FUNCTION__sr); } // Latest version for which all prior versions have had their log copy tasks completed - KeyBackedProperty latestLogEndVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty latestLogEndVersion() { return configSpace.pack(__FUNCTION__sr); } // The end version of the last complete snapshot - KeyBackedProperty latestSnapshotEndVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty latestSnapshotEndVersion() { return configSpace.pack(__FUNCTION__sr); } // The end version of the first complete snapshot - KeyBackedProperty firstSnapshotEndVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty firstSnapshotEndVersion() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty destUidValue() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty destUidValue() { return configSpace.pack(__FUNCTION__sr); } Future> getLatestRestorableVersion(Reference tr) { tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); @@ -932,7 +930,7 @@ class BackupConfig : public KeyBackedConfig { }); } - KeyBackedProperty> backupRanges() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty> backupRanges() { return configSpace.pack(__FUNCTION__sr); } void startMutationLogs(Reference tr, KeyRangeRef backupRange, Key destUidValue) { Key mutationLogsDestKey = destUidValue.withPrefix(backupLogKeys.begin); @@ -1000,18 +998,18 @@ struct StringRefReader { namespace fileBackup { Standalone> decodeRangeFileBlock(const Standalone& buf); - #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.g.h" -[[nodiscard]] Future>> decodeRangeFileBlock( Reference const& file, int64_t const& offset, int const& len ); + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.g.h" +[[nodiscard]] Future>> decodeRangeFileBlock( Reference const& file, int64_t const& offset, int const& len, Database const& cx ); -#line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.h" +#line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.h" Standalone> decodeMutationLogFileBlock(const Standalone& buf); // Reads a mutation log block from file and parses into batch mutation blocks for further parsing. - #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.g.h" + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.g.h" [[nodiscard]] Future>> decodeMutationLogFileBlock( Reference const& file, int64_t const& offset, int const& len ); -#line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.h" +#line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.h" // Return a block of contiguous padding bytes "\0xff" for backup files, growing if needed. Value makePadding(int size); @@ -1021,12 +1019,48 @@ Value makePadding(int size); // For testing addPrefix feature in fast restore. // Transform db content in restoreRanges by removePrefix and then addPrefix. // Assume: DB is locked - #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.g.h" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.g.h" [[nodiscard]] Future transformRestoredDatabase( Database const& cx, Standalone> const& backupRanges, Key const& addPrefix, Key const& removePrefix ); -#line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BackupAgent.actor.h" +#line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BackupAgent.actor.h" void simulateBlobFailure(); +// Add the set of ranges that are backed up in a default backup to the given vector. This consists of all normal keys +// and the system backup ranges. +void addDefaultBackupRanges(Standalone>& backupKeys); + +// Return a vector containing the key ranges in system key-space that should be backed up in a default backup. +VectorRef const& getSystemBackupRanges(); + +// Return a key-range map that can be used to check whether a system key is a candidate backup key (i.e. whether it is +// part of any system backup ranges). +KeyRangeMap const& systemBackupMutationMask(); + +// Returns true if the given set of ranges exactly matches the set of ranges included in a default backup. +template +bool isDefaultBackup(Container ranges) { + std::unordered_set uniqueRanges(ranges.begin(), ranges.end()); + auto& systemBackupRanges = getSystemBackupRanges(); + + if (uniqueRanges.size() != systemBackupRanges.size() + 1) { + return false; + } + + if (!uniqueRanges.count(normalKeys)) { + return false; + } + for (auto range : getSystemBackupRanges()) { + if (!uniqueRanges.count(range)) { + return false; + } + } + + return true; +} + +// Returns a key-range used to denote that a shared mutation stream belongs to the default backup set. +KeyRangeRef const& getDefaultBackupSharedRange(); + #include "flow/unactorcompiler.h" #endif diff --git a/src/fdbclient/BackupAgent.actor.h b/src/fdbclient/include/fdbclient/BackupAgent.actor.h similarity index 83% rename from src/fdbclient/BackupAgent.actor.h rename to src/fdbclient/include/fdbclient/BackupAgent.actor.h index 0aee518..c893175 100644 --- a/src/fdbclient/BackupAgent.actor.h +++ b/src/fdbclient/include/fdbclient/BackupAgent.actor.h @@ -29,32 +29,33 @@ #include "fdbclient/NativeAPI.actor.h" #include "fdbclient/TaskBucket.h" #include "fdbclient/Notified.h" -#include "fdbrpc/IAsyncFile.h" -#include "fdbclient/KeyBackedTypes.h" +#include "flow/IAsyncFile.h" +#include "fdbclient/KeyBackedTypes.actor.h" #include #include #include "fdbclient/BackupContainer.h" #include "flow/actorcompiler.h" // has to be last include -FDB_DECLARE_BOOLEAN_PARAM(LockDB); -FDB_DECLARE_BOOLEAN_PARAM(UnlockDB); -FDB_DECLARE_BOOLEAN_PARAM(StopWhenDone); -FDB_DECLARE_BOOLEAN_PARAM(Verbose); -FDB_DECLARE_BOOLEAN_PARAM(WaitForComplete); -FDB_DECLARE_BOOLEAN_PARAM(ForceAction); -FDB_DECLARE_BOOLEAN_PARAM(Terminator); -FDB_DECLARE_BOOLEAN_PARAM(IncrementalBackupOnly); -FDB_DECLARE_BOOLEAN_PARAM(UsePartitionedLog); -FDB_DECLARE_BOOLEAN_PARAM(OnlyApplyMutationLogs); -FDB_DECLARE_BOOLEAN_PARAM(InconsistentSnapshotOnly); -FDB_DECLARE_BOOLEAN_PARAM(ShowErrors); -FDB_DECLARE_BOOLEAN_PARAM(AbortOldBackup); -FDB_DECLARE_BOOLEAN_PARAM(DstOnly); // TODO: More descriptive name? -FDB_DECLARE_BOOLEAN_PARAM(WaitForDestUID); -FDB_DECLARE_BOOLEAN_PARAM(CheckBackupUID); -FDB_DECLARE_BOOLEAN_PARAM(DeleteData); -FDB_DECLARE_BOOLEAN_PARAM(SetValidation); -FDB_DECLARE_BOOLEAN_PARAM(PartialBackup); +FDB_BOOLEAN_PARAM(LockDB); +FDB_BOOLEAN_PARAM(UnlockDB); +FDB_BOOLEAN_PARAM(StopWhenDone); +FDB_BOOLEAN_PARAM(Verbose); +FDB_BOOLEAN_PARAM(WaitForComplete); +FDB_BOOLEAN_PARAM(ForceAction); +FDB_BOOLEAN_PARAM(Terminator); +FDB_BOOLEAN_PARAM(IncrementalBackupOnly); +FDB_BOOLEAN_PARAM(UsePartitionedLog); +FDB_BOOLEAN_PARAM(OnlyApplyMutationLogs); +FDB_BOOLEAN_PARAM(SnapshotBackupUseTenantCache); +FDB_BOOLEAN_PARAM(InconsistentSnapshotOnly); +FDB_BOOLEAN_PARAM(ShowErrors); +FDB_BOOLEAN_PARAM(AbortOldBackup); +FDB_BOOLEAN_PARAM(DstOnly); // TODO: More descriptive name? +FDB_BOOLEAN_PARAM(WaitForDestUID); +FDB_BOOLEAN_PARAM(CheckBackupUID); +FDB_BOOLEAN_PARAM(DeleteData); +FDB_BOOLEAN_PARAM(SetValidation); +FDB_BOOLEAN_PARAM(PartialBackup); extern Optional fileBackupAgentProxy; @@ -145,7 +146,7 @@ class FileBackupAgent : public BackupAgentBase { futureBucket = std::move(r.futureBucket); } - KeyBackedProperty lastBackupTimestamp() { return config.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty lastBackupTimestamp() { return config.pack(__FUNCTION__sr); } Future run(Database cx, double pollDelay, int maxConcurrentTasks) { return taskBucket->run(cx, futureBucket, std::make_shared(pollDelay), maxConcurrentTasks); @@ -192,51 +193,53 @@ class FileBackupAgent : public BackupAgentBase { Key url, Optional proxy, Standalone> ranges, + Standalone> beginVersions, WaitForComplete = WaitForComplete::True, Version targetVersion = ::invalidVersion, Verbose = Verbose::True, Key addPrefix = Key(), Key removePrefix = Key(), LockDB = LockDB::True, + UnlockDB = UnlockDB::True, + OnlyApplyMutationLogs = OnlyApplyMutationLogs::False, + InconsistentSnapshotOnly = InconsistentSnapshotOnly::False, + Optional const& encryptionKeyFileName = {}); + + Future restore(Database cx, + Optional cxOrig, + Key tagName, + Key url, + Optional proxy, + WaitForComplete = WaitForComplete::True, + Version targetVersion = ::invalidVersion, + Verbose = Verbose::True, + KeyRange range = KeyRange(), + Key addPrefix = Key(), + Key removePrefix = Key(), + LockDB = LockDB::True, OnlyApplyMutationLogs = OnlyApplyMutationLogs::False, InconsistentSnapshotOnly = InconsistentSnapshotOnly::False, Version beginVersion = ::invalidVersion, Optional const& encryptionKeyFileName = {}); + Future restore(Database cx, Optional cxOrig, Key tagName, Key url, Optional proxy, + Standalone> ranges, WaitForComplete waitForComplete = WaitForComplete::True, Version targetVersion = ::invalidVersion, Verbose verbose = Verbose::True, - KeyRange range = normalKeys, Key addPrefix = Key(), Key removePrefix = Key(), LockDB lockDB = LockDB::True, + UnlockDB unlockDB = UnlockDB::True, OnlyApplyMutationLogs onlyApplyMutationLogs = OnlyApplyMutationLogs::False, InconsistentSnapshotOnly inconsistentSnapshotOnly = InconsistentSnapshotOnly::False, Version beginVersion = ::invalidVersion, - Optional const& encryptionKeyFileName = {}) { - Standalone> rangeRef; - rangeRef.push_back_deep(rangeRef.arena(), range); - return restore(cx, - cxOrig, - tagName, - url, - proxy, - rangeRef, - waitForComplete, - targetVersion, - verbose, - addPrefix, - removePrefix, - lockDB, - onlyApplyMutationLogs, - inconsistentSnapshotOnly, - beginVersion, - encryptionKeyFileName); - } + Optional const& encryptionKeyFileName = {}); + Future atomicRestore(Database cx, Key tagName, Standalone> ranges, @@ -244,13 +247,10 @@ class FileBackupAgent : public BackupAgentBase { Key removePrefix = Key()); Future atomicRestore(Database cx, Key tagName, - KeyRange range = normalKeys, + KeyRange range = KeyRange(), Key addPrefix = Key(), - Key removePrefix = Key()) { - Standalone> rangeRef; - rangeRef.push_back_deep(rangeRef.arena(), range); - return atomicRestore(cx, tagName, rangeRef, addPrefix, removePrefix); - } + Key removePrefix = Key()); + // Tries to abort the restore for a tag. Returns the final (stable) state of the tag. Future abortRestore(Reference tr, Key tagName); Future abortRestore(Database cx, Key tagName); @@ -274,6 +274,7 @@ class FileBackupAgent : public BackupAgentBase { int snapshotIntervalSeconds, std::string const& tagName, Standalone> backupRanges, + bool encryptionEnabled, StopWhenDone = StopWhenDone::True, UsePartitionedLog = UsePartitionedLog::False, IncrementalBackupOnly = IncrementalBackupOnly::False, @@ -285,6 +286,7 @@ class FileBackupAgent : public BackupAgentBase { int snapshotIntervalSeconds, std::string const& tagName, Standalone> backupRanges, + bool encryptionEnabled, StopWhenDone stopWhenDone = StopWhenDone::True, UsePartitionedLog partitionedLog = UsePartitionedLog::False, IncrementalBackupOnly incrementalBackupOnly = IncrementalBackupOnly::False, @@ -297,6 +299,7 @@ class FileBackupAgent : public BackupAgentBase { snapshotIntervalSeconds, tagName, backupRanges, + encryptionEnabled, stopWhenDone, partitionedLog, incrementalBackupOnly, @@ -361,12 +364,14 @@ class FileBackupAgent : public BackupAgentBase { }; template <> -inline Tuple Codec::pack(FileBackupAgent::ERestoreState const& val) { - return Tuple().append(val); +inline Standalone TupleCodec::pack( + FileBackupAgent::ERestoreState const& val) { + return Tuple::makeTuple(static_cast(val)).pack(); } template <> -inline FileBackupAgent::ERestoreState Codec::unpack(Tuple const& val) { - return (FileBackupAgent::ERestoreState)val.getInt(0); +inline FileBackupAgent::ERestoreState TupleCodec::unpack( + Standalone const& val) { + return (FileBackupAgent::ERestoreState)Tuple::unpack(val).getInt(0); } class DatabaseBackupAgent : public BackupAgentBase { @@ -570,19 +575,21 @@ ACTOR Future applyMutations(Database cx, Key removePrefix, Version beginVersion, Version* endVersion, - RequestStream commit, + PublicRequestStream commit, NotifiedVersion* committedVersion, - Reference> keyVersion); + Reference> keyVersion, + std::map* tenantMap, + bool provisionalProxy); ACTOR Future cleanupBackup(Database cx, DeleteData deleteData); using EBackupState = BackupAgentBase::EnumState; template <> -inline Tuple Codec::pack(EBackupState const& val) { - return Tuple().append(static_cast(val)); +inline Standalone TupleCodec::pack(EBackupState const& val) { + return Tuple::makeTuple(static_cast(val)).pack(); } template <> -inline EBackupState Codec::unpack(Tuple const& val) { - return static_cast(val.getInt(0)); +inline EBackupState TupleCodec::unpack(Standalone const& val) { + return static_cast(Tuple::unpack(val).getInt(0)); } // Key backed tags are a single-key slice of the TagUidMap, defined below. @@ -621,7 +628,7 @@ class TagUidMap : public KeyBackedMap { Snapshot snapshot); public: - TagUidMap(const StringRef& prefix) : TagMap(LiteralStringRef("tag->uid/").withPrefix(prefix)), prefix(prefix) {} + TagUidMap(const StringRef& prefix) : TagMap("tag->uid/"_sr.withPrefix(prefix)), prefix(prefix) {} Future> getAll(Reference tr, Snapshot snapshot = Snapshot::False) { @@ -631,34 +638,39 @@ class TagUidMap : public KeyBackedMap { Key prefix; }; -static inline KeyBackedTag makeRestoreTag(std::string tagName) { - return KeyBackedTag(tagName, fileRestorePrefixRange.begin); -} - -static inline KeyBackedTag makeBackupTag(std::string tagName) { - return KeyBackedTag(tagName, fileBackupPrefixRange.begin); -} - -static inline Future> getAllRestoreTags(Reference tr, - Snapshot snapshot = Snapshot::False) { - return TagUidMap(fileRestorePrefixRange.begin).getAll(tr, snapshot); -} - -static inline Future> getAllBackupTags(Reference tr, - Snapshot snapshot = Snapshot::False) { - return TagUidMap(fileBackupPrefixRange.begin).getAll(tr, snapshot); -} +class KeyBackedTaskConfig : public KeyBackedClass { +protected: + UID uid; + Subspace configSpace; -class KeyBackedConfig { public: static struct { - static TaskParam uid() { return LiteralStringRef(__FUNCTION__); } + static TaskParam uid() { return __FUNCTION__sr; } } TaskParams; - KeyBackedConfig(StringRef prefix, UID uid = UID()) - : uid(uid), prefix(prefix), configSpace(uidPrefixKey(LiteralStringRef("uid->config/").withPrefix(prefix), uid)) {} + KeyBackedTaskConfig(StringRef prefix, UID uid = UID()) + : KeyBackedClass(prefix), uid(uid), configSpace(uidPrefixKey("uid->config/"_sr.withPrefix(prefix), uid)) {} + + KeyBackedTaskConfig(StringRef prefix, Reference task) + : KeyBackedTaskConfig(prefix, TaskParams.uid().get(task)) {} + + KeyBackedProperty tag() { return configSpace.pack(__FUNCTION__sr); } + + UID getUid() { return uid; } + + Key getUidAsKey() { return BinaryWriter::toValue(uid, Unversioned()); } + + template + void clear(TrType tr) { + tr->clear(configSpace.range()); + } - KeyBackedConfig(StringRef prefix, Reference task) : KeyBackedConfig(prefix, TaskParams.uid().get(task)) {} + // lastError is a pair of error message and timestamp expressed as an int64_t + KeyBackedProperty> lastError() { return configSpace.pack(__FUNCTION__sr); } + + KeyBackedMap> lastErrorPerType() { + return configSpace.pack(__FUNCTION__sr); + } Future toTask(Reference tr, Reference task, @@ -674,34 +686,17 @@ class KeyBackedConfig { // restore uid. Get this uid's tag, then get the KEY for the tag's uid but don't read it. That becomes the // validation key which TaskBucket will check, and its value must be this restore config's uid. UID u = uid; // 'this' could be invalid in lambda - Key p = prefix; + Key p = subspace.key(); return map(tag().get(tr), [u, p, task](Optional const& tag) -> Void { if (!tag.present()) throw restore_error(); // Validation contition is that the uidPair key must be exactly {u, false} TaskBucket::setValidationCondition( - task, KeyBackedTag(tag.get(), p).key, Codec::pack({ u, false }).pack()); + task, KeyBackedTag(tag.get(), p).key, TupleCodec::pack({ u, false })); return Void(); }); } - KeyBackedProperty tag() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } - - UID getUid() { return uid; } - - Key getUidAsKey() { return BinaryWriter::toValue(uid, Unversioned()); } - - void clear(Reference tr) { tr->clear(configSpace.range()); } - - // lastError is a pair of error message and timestamp expressed as an int64_t - KeyBackedProperty> lastError() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } - - KeyBackedMap> lastErrorPerType() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } - // Updates the error per type map and the last error property Future updateErrorInfo(Database cx, Error e, std::string message) { // Avoid capture of this ptr @@ -718,17 +713,29 @@ class KeyBackedConfig { }); }); } - -protected: - UID uid; - Key prefix; - Subspace configSpace; }; +static inline KeyBackedTag makeRestoreTag(std::string tagName) { + return KeyBackedTag(tagName, fileRestorePrefixRange.begin); +} + +static inline KeyBackedTag makeBackupTag(std::string tagName) { + return KeyBackedTag(tagName, fileBackupPrefixRange.begin); +} + +static inline Future> getAllRestoreTags(Reference tr, + Snapshot snapshot = Snapshot::False) { + return TagUidMap(fileRestorePrefixRange.begin).getAll(tr, snapshot); +} + +static inline Future> getAllBackupTags(Reference tr, + Snapshot snapshot = Snapshot::False) { + return TagUidMap(fileBackupPrefixRange.begin).getAll(tr, snapshot); +} + template <> -inline Tuple Codec>::pack(Reference const& bc) { - Tuple tuple; - tuple.append(StringRef(bc->getURL())); +inline Standalone TupleCodec>::pack(Reference const& bc) { + Tuple tuple = Tuple::makeTuple(bc->getURL()); if (bc->getEncryptionKeyFileName().present()) { tuple.append(bc->getEncryptionKeyFileName().get()); @@ -742,30 +749,32 @@ inline Tuple Codec>::pack(Reference -inline Reference Codec>::unpack(Tuple const& val) { - ASSERT(val.size() >= 1); - auto url = val.getString(0).toString(); +inline Reference TupleCodec>::unpack(Standalone const& val) { + Tuple t = Tuple::unpack(val); + ASSERT(t.size() >= 1); + + auto url = t.getString(0).toString(); Optional encryptionKeyFileName; - if (val.size() > 1 && !val.getString(1).empty()) { - encryptionKeyFileName = val.getString(1).toString(); + if (t.size() > 1 && !t.getString(1).empty()) { + encryptionKeyFileName = t.getString(1).toString(); } Optional proxy; - if (val.size() > 2 && !val.getString(2).empty()) { - proxy = val.getString(2).toString(); + if (t.size() > 2 && !t.getString(2).empty()) { + proxy = t.getString(2).toString(); } return IBackupContainer::openContainer(url, proxy, encryptionKeyFileName); } -class BackupConfig : public KeyBackedConfig { +class BackupConfig : public KeyBackedTaskConfig { public: - BackupConfig(UID uid = UID()) : KeyBackedConfig(fileBackupPrefixRange.begin, uid) {} - BackupConfig(Reference task) : KeyBackedConfig(fileBackupPrefixRange.begin, task) {} + BackupConfig(UID uid = UID()) : KeyBackedTaskConfig(fileBackupPrefixRange.begin, uid) {} + BackupConfig(Reference task) : KeyBackedTaskConfig(fileBackupPrefixRange.begin, task) {} // rangeFileMap maps a keyrange file's End to its Begin and Filename struct RangeSlice { @@ -773,9 +782,7 @@ class BackupConfig : public KeyBackedConfig { Version version; std::string fileName; int64_t fileSize; - Tuple pack() const { - return Tuple().append(begin).append(version).append(StringRef(fileName)).append(fileSize); - } + Tuple pack() const { return Tuple::makeTuple(begin, version, fileName, fileSize); } static RangeSlice unpack(Tuple const& t) { RangeSlice r; int i = 0; @@ -789,47 +796,41 @@ class BackupConfig : public KeyBackedConfig { // Map of range end boundaries to info about the backup file written for that range. typedef KeyBackedMap RangeFileMapT; - RangeFileMapT snapshotRangeFileMap() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + RangeFileMapT snapshotRangeFileMap() { return configSpace.pack(__FUNCTION__sr); } // Number of kv range files that were both committed to persistent storage AND inserted into // the snapshotRangeFileMap. Note that since insertions could replace 1 or more existing // map entries this is not necessarily the number of entries currently in the map. // This value exists to help with sizing of kv range folders for BackupContainers that // require it. - KeyBackedBinaryValue snapshotRangeFileCount() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue snapshotRangeFileCount() { return configSpace.pack(__FUNCTION__sr); } // Coalesced set of ranges already dispatched for writing. typedef KeyBackedMap RangeDispatchMapT; - RangeDispatchMapT snapshotRangeDispatchMap() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + RangeDispatchMapT snapshotRangeDispatchMap() { return configSpace.pack(__FUNCTION__sr); } // Interval to use for the first (initial) snapshot. - KeyBackedProperty initialSnapshotIntervalSeconds() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } + KeyBackedProperty initialSnapshotIntervalSeconds() { return configSpace.pack(__FUNCTION__sr); } // Interval to use for determining the target end version for new snapshots - KeyBackedProperty snapshotIntervalSeconds() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty snapshotIntervalSeconds() { return configSpace.pack(__FUNCTION__sr); } // When the current snapshot began - KeyBackedProperty snapshotBeginVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty snapshotBeginVersion() { return configSpace.pack(__FUNCTION__sr); } // When the current snapshot is desired to end. // This can be changed at runtime to speed up or slow down a snapshot - KeyBackedProperty snapshotTargetEndVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty snapshotTargetEndVersion() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty snapshotBatchSize() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty snapshotBatchSize() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty snapshotBatchFuture() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty snapshotBatchFuture() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty snapshotBatchDispatchDoneKey() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty snapshotBatchDispatchDoneKey() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty snapshotDispatchLastShardsBehind() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } + KeyBackedProperty snapshotDispatchLastShardsBehind() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty snapshotDispatchLastVersion() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } + KeyBackedProperty snapshotDispatchLastVersion() { return configSpace.pack(__FUNCTION__sr); } Future initNewSnapshot(Reference tr, int64_t intervalSeconds = -1) { BackupConfig& copy = *this; // Capture this by value instead of this ptr @@ -863,51 +864,50 @@ class BackupConfig : public KeyBackedConfig { }); } - KeyBackedBinaryValue rangeBytesWritten() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue rangeBytesWritten() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedBinaryValue logBytesWritten() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedBinaryValue logBytesWritten() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty stateEnum() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty stateEnum() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty> backupContainer() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } + KeyBackedProperty> backupContainer() { return configSpace.pack(__FUNCTION__sr); } // Set to true when all backup workers for saving mutation logs have been started. - KeyBackedProperty allWorkerStarted() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty allWorkerStarted() { return configSpace.pack(__FUNCTION__sr); } // Each backup worker adds its (epoch, tag.id) to this property. KeyBackedProperty>> startedBackupWorkers() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); + return configSpace.pack(__FUNCTION__sr); } // Set to true if backup worker is enabled. - KeyBackedProperty backupWorkerEnabled() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty backupWorkerEnabled() { return configSpace.pack(__FUNCTION__sr); } // Set to true if partitioned log is enabled (only useful if backup worker is also enabled). - KeyBackedProperty partitionedLogEnabled() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty partitionedLogEnabled() { return configSpace.pack(__FUNCTION__sr); } // Set to true if only requesting incremental backup without base snapshot. - KeyBackedProperty incrementalBackupOnly() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty incrementalBackupOnly() { return configSpace.pack(__FUNCTION__sr); } // Latest version for which all prior versions have saved by backup workers. - KeyBackedProperty latestBackupWorkerSavedVersion() { - return configSpace.pack(LiteralStringRef(__FUNCTION__)); - } + KeyBackedProperty latestBackupWorkerSavedVersion() { return configSpace.pack(__FUNCTION__sr); } // Stop differntial logging if already started or don't start after completing KV ranges - KeyBackedProperty stopWhenDone() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty stopWhenDone() { return configSpace.pack(__FUNCTION__sr); } + + // Enable snapshot backup file encryption + KeyBackedProperty enableSnapshotBackupEncryption() { return configSpace.pack(__FUNCTION__sr); } // Latest version for which all prior versions have had their log copy tasks completed - KeyBackedProperty latestLogEndVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty latestLogEndVersion() { return configSpace.pack(__FUNCTION__sr); } // The end version of the last complete snapshot - KeyBackedProperty latestSnapshotEndVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty latestSnapshotEndVersion() { return configSpace.pack(__FUNCTION__sr); } // The end version of the first complete snapshot - KeyBackedProperty firstSnapshotEndVersion() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty firstSnapshotEndVersion() { return configSpace.pack(__FUNCTION__sr); } - KeyBackedProperty destUidValue() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty destUidValue() { return configSpace.pack(__FUNCTION__sr); } Future> getLatestRestorableVersion(Reference tr) { tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); @@ -938,7 +938,7 @@ class BackupConfig : public KeyBackedConfig { }); } - KeyBackedProperty> backupRanges() { return configSpace.pack(LiteralStringRef(__FUNCTION__)); } + KeyBackedProperty> backupRanges() { return configSpace.pack(__FUNCTION__sr); } void startMutationLogs(Reference tr, KeyRangeRef backupRange, Key destUidValue) { Key mutationLogsDestKey = destUidValue.withPrefix(backupLogKeys.begin); @@ -1008,7 +1008,8 @@ Standalone> decodeRangeFileBlock(const Standalone>> decodeRangeFileBlock(Reference file, int64_t offset, - int len); + int len, + Database cx); Standalone> decodeMutationLogFileBlock(const Standalone& buf); @@ -1032,5 +1033,41 @@ ACTOR Future transformRestoredDatabase(Database cx, void simulateBlobFailure(); +// Add the set of ranges that are backed up in a default backup to the given vector. This consists of all normal keys +// and the system backup ranges. +void addDefaultBackupRanges(Standalone>& backupKeys); + +// Return a vector containing the key ranges in system key-space that should be backed up in a default backup. +VectorRef const& getSystemBackupRanges(); + +// Return a key-range map that can be used to check whether a system key is a candidate backup key (i.e. whether it is +// part of any system backup ranges). +KeyRangeMap const& systemBackupMutationMask(); + +// Returns true if the given set of ranges exactly matches the set of ranges included in a default backup. +template +bool isDefaultBackup(Container ranges) { + std::unordered_set uniqueRanges(ranges.begin(), ranges.end()); + auto& systemBackupRanges = getSystemBackupRanges(); + + if (uniqueRanges.size() != systemBackupRanges.size() + 1) { + return false; + } + + if (!uniqueRanges.count(normalKeys)) { + return false; + } + for (auto range : getSystemBackupRanges()) { + if (!uniqueRanges.count(range)) { + return false; + } + } + + return true; +} + +// Returns a key-range used to denote that a shared mutation stream belongs to the default backup set. +KeyRangeRef const& getDefaultBackupSharedRange(); + #include "flow/unactorcompiler.h" #endif diff --git a/src/fdbclient/BackupContainer.h b/src/fdbclient/include/fdbclient/BackupContainer.h similarity index 97% rename from src/fdbclient/BackupContainer.h rename to src/fdbclient/include/fdbclient/BackupContainer.h index f6523bd..772b05b 100644 --- a/src/fdbclient/BackupContainer.h +++ b/src/fdbclient/include/fdbclient/BackupContainer.h @@ -23,12 +23,14 @@ #pragma once #include "flow/flow.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "fdbclient/FDBTypes.h" #include "fdbclient/NativeAPI.actor.h" #include "fdbclient/ReadYourWrites.h" #include +FDB_BOOLEAN_PARAM(IncludeKeyRangeMap); + class ReadYourWritesTransaction; Future> timeKeeperEpochsFromVersion(Version const& v, Reference const& tr); @@ -67,6 +69,9 @@ static const uint32_t PARTITIONED_MLOG_VERSION = 4110; // Snapshot file version written by FileBackupAgent static const uint32_t BACKUP_AGENT_SNAPSHOT_FILE_VERSION = 1001; +// Encrypted Snapshot file version written by FileBackupAgent +static const uint32_t BACKUP_AGENT_ENCRYPTED_SNAPSHOT_FILE_VERSION = 1002; + struct LogFile { Version beginVersion; Version endVersion; @@ -243,14 +248,15 @@ class IBackupContainer { // snapshot of the key ranges this backup is targeting. virtual Future writeKeyspaceSnapshotFile(const std::vector& fileNames, const std::vector>& beginEndKeys, - int64_t totalBytes) = 0; + int64_t totalBytes, + IncludeKeyRangeMap includeKeyRangeMap) = 0; // Open a file for read by name virtual Future> readFile(const std::string& name) = 0; // Returns the key ranges in the snapshot file. This is an expensive function // and should only be used in simulation for sanity check. - virtual Future getSnapshotFileKeyRange(const RangeFile& file) = 0; + virtual Future getSnapshotFileKeyRange(const RangeFile& file, Database cx) = 0; struct ExpireProgress { std::string step; diff --git a/src/fdbclient/BackupContainerAzureBlobStore.h b/src/fdbclient/include/fdbclient/BackupContainerAzureBlobStore.h similarity index 95% rename from src/fdbclient/BackupContainerAzureBlobStore.h rename to src/fdbclient/include/fdbclient/BackupContainerAzureBlobStore.h index 77285ce..2c96ecb 100644 --- a/src/fdbclient/BackupContainerAzureBlobStore.h +++ b/src/fdbclient/include/fdbclient/BackupContainerAzureBlobStore.h @@ -25,8 +25,6 @@ #include "fdbclient/AsyncTaskThread.h" #include "fdbclient/BackupContainerFileSystem.h" -#include "storage_credential.h" -#include "storage_account.h" #include "blob/blob_client.h" class BackupContainerAzureBlobStore final : public BackupContainerFileSystem, @@ -58,6 +56,8 @@ class BackupContainerAzureBlobStore final : public BackupContainerFileSystem, Future> writeFile(const std::string& fileName) override; + Future writeEntireFile(const std::string& fileName, const std::string& fileContents) override; + Future listFiles(const std::string& path = "", std::function folderPathFilter = nullptr) override; diff --git a/src/fdbclient/BackupContainerFileSystem.h b/src/fdbclient/include/fdbclient/BackupContainerFileSystem.h similarity index 94% rename from src/fdbclient/BackupContainerFileSystem.h rename to src/fdbclient/include/fdbclient/BackupContainerFileSystem.h index 17245c9..b217a39 100644 --- a/src/fdbclient/BackupContainerFileSystem.h +++ b/src/fdbclient/include/fdbclient/BackupContainerFileSystem.h @@ -27,8 +27,6 @@ #include "fdbclient/FDBTypes.h" #include "flow/Trace.h" -#include "fdbclient/BackupContainer.h" - /* BackupContainerFileSystem implements a backup container which stores files in a nested folder structure. * Inheritors must only defined methods for writing, reading, deleting, sizing, and listing files. * @@ -83,7 +81,8 @@ class BackupContainerFileSystem : public IBackupContainer { // TODO: refactor this to separate out the "deal with blob store" stuff from the backup business logic static Reference openContainerFS(const std::string& url, const Optional& proxy, - const Optional& encryptionKeyFileName); + const Optional& encryptionKeyFileName, + bool isBackup = true); // Get a list of fileNames and their sizes in the container under the given path // Although not required, an implementation can avoid traversing unwanted subfolders @@ -98,6 +97,9 @@ class BackupContainerFileSystem : public IBackupContainer { // Open a file for write by fileName virtual Future> writeFile(const std::string& fileName) = 0; + // write entire file + virtual Future writeEntireFile(const std::string& fileName, const std::string& contents) = 0; + // Delete a file virtual Future deleteFile(const std::string& fileName) = 0; @@ -123,7 +125,8 @@ class BackupContainerFileSystem : public IBackupContainer { Future writeKeyspaceSnapshotFile(const std::vector& fileNames, const std::vector>& beginEndKeys, - int64_t totalBytes) final; + int64_t totalBytes, + IncludeKeyRangeMap IncludeKeyRangeMap) final; // List log files, unsorted, which contain data at any version >= beginVersion and <= targetVersion. // "partitioned" flag indicates if new partitioned mutation logs or old logs should be listed. @@ -152,7 +155,7 @@ class BackupContainerFileSystem : public IBackupContainer { ExpireProgress* progress, Version restorableBeginVersion) final; - Future getSnapshotFileKeyRange(const RangeFile& file) final; + Future getSnapshotFileKeyRange(const RangeFile& file, Database cx) final; Future> getRestoreSet(Version targetVersion, VectorRef keyRangesFilter, @@ -165,6 +168,8 @@ class BackupContainerFileSystem : public IBackupContainer { void setEncryptionKey(Optional const& encryptionKeyFileName); Future encryptionSetupComplete() const; + Future writeEntireFileFallback(const std::string& fileName, const std::string& fileContents); + private: struct VersionProperty { VersionProperty(Reference bc, const std::string& name) diff --git a/src/fdbclient/BackupContainerLocalDirectory.h b/src/fdbclient/include/fdbclient/BackupContainerLocalDirectory.h similarity index 95% rename from src/fdbclient/BackupContainerLocalDirectory.h rename to src/fdbclient/include/fdbclient/BackupContainerLocalDirectory.h index e6e949b..a93283b 100644 --- a/src/fdbclient/BackupContainerLocalDirectory.h +++ b/src/fdbclient/include/fdbclient/BackupContainerLocalDirectory.h @@ -46,6 +46,8 @@ class BackupContainerLocalDirectory : public BackupContainerFileSystem, Future> writeFile(const std::string& path) final; + Future writeEntireFile(const std::string& path, const std::string& contents) final; + Future deleteFile(const std::string& path) final; Future listFiles(const std::string& path, std::function) final; diff --git a/src/fdbclient/BackupContainerS3BlobStore.h b/src/fdbclient/include/fdbclient/BackupContainerS3BlobStore.h similarity index 90% rename from src/fdbclient/BackupContainerS3BlobStore.h rename to src/fdbclient/include/fdbclient/BackupContainerS3BlobStore.h index 1333136..213f35a 100644 --- a/src/fdbclient/BackupContainerS3BlobStore.h +++ b/src/fdbclient/include/fdbclient/BackupContainerS3BlobStore.h @@ -33,6 +33,9 @@ class BackupContainerS3BlobStore final : public BackupContainerFileSystem, // All backup data goes into a single bucket std::string m_bucket; + // if not used for backup, don't prefix paths with fdbbackup-specific logic + bool isBackup; + std::string dataPath(const std::string& path); // Get the path of the backups's index entry @@ -44,7 +47,8 @@ class BackupContainerS3BlobStore final : public BackupContainerFileSystem, BackupContainerS3BlobStore(Reference bstore, const std::string& name, const S3BlobStoreEndpoint::ParametersT& params, - const Optional& encryptionKeyFileName); + const Optional& encryptionKeyFileName, + bool isBackup); void addref() override; void delref() override; @@ -57,6 +61,8 @@ class BackupContainerS3BlobStore final : public BackupContainerFileSystem, Future> writeFile(const std::string& path) final; + Future writeEntireFile(const std::string& path, const std::string& contents) final; + Future deleteFile(const std::string& path) final; Future listFiles(const std::string& path, std::function pathFilter) final; diff --git a/src/fdbclient/include/fdbclient/BlobCipher.h b/src/fdbclient/include/fdbclient/BlobCipher.h new file mode 100644 index 0000000..8b2d614 --- /dev/null +++ b/src/fdbclient/include/fdbclient/BlobCipher.h @@ -0,0 +1,1092 @@ +/* + * BlobCipher.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ +#ifndef FDBCLIENT_BLOB_CIPHER_H +#define FDBCLIENT_BLOB_CIPHER_H +#pragma once + +#include "fdbrpc/Stats.h" + +#include "fdbclient/Knobs.h" +#include "flow/Arena.h" +#include "flow/EncryptUtils.h" +#include "flow/FastRef.h" +#include "flow/FileIdentifier.h" +#include "flow/flow.h" +#include "flow/genericactors.actor.h" +#include "flow/Knobs.h" +#include "flow/network.h" +#include "flow/ObjectSerializer.h" +#include "flow/ObjectSerializerTraits.h" +#include "flow/Platform.h" +#include "flow/ProtocolVersion.h" +#include "flow/serialize.h" +#include "flow/Trace.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define AES_256_KEY_LENGTH 32 +#define AES_256_IV_LENGTH 16 + +constexpr const int INVALID_ENCRYPT_HEADERS_FLAG_VERSION = 0; +constexpr const int INVALID_ENCRYPT_HEADER_ALGO_HEADER_VERSION = 0; + +class BlobCipherMetrics : public NonCopyable { +public: + static BlobCipherMetrics* getInstance() { + static BlobCipherMetrics* instance = nullptr; + if (instance == nullptr) { + instance = new BlobCipherMetrics; + } + return instance; + } + + // Order of this enum has to match initializer of counterSets. + enum UsageType : int { + TLOG = 0, + TLOG_POST_RESOLUTION, + KV_MEMORY, + KV_REDWOOD, + BLOB_GRANULE, + BACKUP, + RESTORE, + TEST, + MAX, + }; + + struct CounterSet { + Counter encryptCPUTimeNS; + Counter decryptCPUTimeNS; + LatencySample getCipherKeysLatency; + LatencySample getLatestCipherKeysLatency; + + CounterSet(CounterCollection& cc, std::string name); + }; + + static CounterSet& counters(UsageType t) { + ASSERT(t < UsageType::MAX); + return getInstance()->counterSets[int(t)]; + } + +private: + BlobCipherMetrics(); + + CounterCollection cc; + Future traceFuture; + +public: + Counter cipherKeyCacheHit; + Counter cipherKeyCacheMiss; + Counter cipherKeyCacheExpired; + Counter latestCipherKeyCacheHit; + Counter latestCipherKeyCacheMiss; + Counter latestCipherKeyCacheNeedsRefresh; + LatencySample getCipherKeysLatency; + LatencySample getLatestCipherKeysLatency; + LatencySample getBlobMetadataLatency; + std::array counterSets; +}; + +std::string toString(BlobCipherMetrics::UsageType type); + +// Encryption operations buffer management +// Approach limits number of copies needed during encryption or decryption operations. +// For encryption EncryptBuf is allocated using client supplied Arena and provided to AES library to capture +// the ciphertext. Similarly, on decryption EncryptBuf is allocated using client supplied Arena and provided +// to the AES library to capture decipher text and passed back to the clients. Given the object passed around +// is reference-counted, it gets freed once refrenceCount goes to 0. + +class EncryptBuf : public ReferenceCounted, NonCopyable { +public: + EncryptBuf(int size, Arena& arena) : allocSize(size), logicalSize(size) { + if (size > 0) { + buffer = new (arena) uint8_t[size](); + } else { + buffer = nullptr; + } + } + + int getLogicalSize() { return logicalSize; } + void setLogicalSize(int value) { + ASSERT(value <= allocSize); + logicalSize = value; + } + uint8_t* begin() { return buffer; } + + StringRef toStringRef() { return StringRef(buffer, logicalSize); } + +private: + int allocSize; + int logicalSize; + uint8_t* buffer; +}; + +class BlobCipherKey; + +#pragma pack(push, 1) // exact fit - no padding +struct BlobCipherDetails { + constexpr static FileIdentifier file_identifier = 1945731; + + // Encryption domain boundary identifier. + EncryptCipherDomainId encryptDomainId = INVALID_ENCRYPT_DOMAIN_ID; + // BaseCipher encryption key identifier + EncryptCipherBaseKeyId baseCipherId = INVALID_ENCRYPT_CIPHER_KEY_ID; + // Random salt + EncryptCipherRandomSalt salt = INVALID_ENCRYPT_RANDOM_SALT; + + static uint32_t getSize() { + return sizeof(EncryptCipherDomainId) + sizeof(EncryptCipherBaseKeyId) + sizeof(EncryptCipherRandomSalt); + } + + BlobCipherDetails() {} + BlobCipherDetails(const EncryptCipherDomainId& dId, + const EncryptCipherBaseKeyId& bId, + const EncryptCipherRandomSalt& random) + : encryptDomainId(dId), baseCipherId(bId), salt(random) {} + + void validateCipherDetailsWithCipherKey(Reference headerCipherKey); + + bool operator==(const BlobCipherDetails& o) const { + return encryptDomainId == o.encryptDomainId && baseCipherId == o.baseCipherId && salt == o.salt; + } + bool operator!=(const BlobCipherDetails& o) const { return !(*this == o); } + + bool isValid() const { + return this->encryptDomainId != INVALID_ENCRYPT_DOMAIN_ID && + this->baseCipherId != INVALID_ENCRYPT_CIPHER_KEY_ID && this->salt != INVALID_ENCRYPT_RANDOM_SALT; + } + + template + void serialize(Ar& ar) { + serializer(ar, encryptDomainId, baseCipherId, salt); + } +}; +#pragma pack(pop) + +namespace std { +template <> +struct hash { + std::size_t operator()(BlobCipherDetails const& details) const { + std::size_t seed = 0; + boost::hash_combine(seed, std::hash{}(details.encryptDomainId)); + boost::hash_combine(seed, std::hash{}(details.baseCipherId)); + boost::hash_combine(seed, std::hash{}(details.salt)); + return seed; + } +}; +} // namespace std + +struct EncryptHeaderCipherDetails { + BlobCipherDetails textCipherDetails; + Optional headerCipherDetails; + + EncryptHeaderCipherDetails() = default; + EncryptHeaderCipherDetails(const BlobCipherDetails& tCipherDetails) : textCipherDetails(tCipherDetails) {} + EncryptHeaderCipherDetails(const BlobCipherDetails& tCipherDetails, const BlobCipherDetails& hCipherDetails) + : textCipherDetails(tCipherDetails), headerCipherDetails(hCipherDetails) {} +}; + +#pragma pack(push, 1) // exact fit - no padding + +// Why BinarySerialization instead of ObjectSerialization? +// +// By running experiments comparing: BlobCipherEncryptHeaderFlagsV1 and AesCtr algorithms header (with/without +// authentication encryption), below table summarizes on-disk storage penalty (bytes) due to storing +// BlobCipherEncryptHeader using both formats: +// +// ---------------------------------------------------------------------------------------------------------- +// | S.No | ObjFlags | BinaryFlags | ObjectAlgo | BinaryAlgo | TotalObject | TotalBinary | +// | ----------------- | ----------- | ------------ | ----------- | ---------- | ------------ | ------------ | +// | AesCtrNoAuth | 40 | 3 | 104 | 40 | 208 | 46 | +// | AesCtrHmacSha | 40 | 3 | 184 | 96 | 288 | 102 | +// | AesCtrAesCmac | 40 | 3 | 168 | 80 | 272 | 86 | +// ---------------------------------------------------------------------------------------------------------- + +struct BlobCipherEncryptHeaderFlagsV1 { + // Serializable fields + + uint8_t encryptMode; + uint8_t authTokenMode; + uint8_t authTokenAlgo; + + BlobCipherEncryptHeaderFlagsV1() {} + BlobCipherEncryptHeaderFlagsV1(const EncryptCipherMode& cipherMode, + const EncryptAuthTokenMode& tokenMode, + const EncryptAuthTokenAlgo& authAlgo) + : encryptMode(cipherMode), authTokenMode(tokenMode), authTokenAlgo(authAlgo) {} + + bool operator==(const BlobCipherEncryptHeaderFlagsV1& o) const { + return encryptMode == o.encryptMode && authTokenMode == o.authTokenMode && authTokenAlgo == o.authTokenAlgo; + } + + static Standalone toStringRef(const BlobCipherEncryptHeaderFlagsV1& flags, Arena& arena) { + BinaryWriter wr(AssumeVersion(ProtocolVersion::withEncryptionAtRest())); + wr.serializeBytes(&flags, sizeof(BlobCipherEncryptHeaderFlagsV1)); + return wr.toValue(arena); + } + + template + void serialize(Ar& ar) { + serializer(ar, encryptMode, authTokenMode, authTokenAlgo); + } +}; + +// Encryption header is stored as plaintext on a persistent storage to assist reconstruction of cipher-key(s) +// for reads. FIPS compliance recommendation is to leverage cryptographic digest mechanism to generate +// 'authentication token' (crypto-secure) to protect against malicious tampering and/or bit rot/flip scenarios. +// +// Encryption header support two modes of generation 'authentication tokens': +// 1) SingleAuthTokenMode: the scheme generates single crypto-secrure auth token to protect {cipherText + +// header} payload. Scheme is geared towards optimizing cost due to crypto-secure auth-token generation, +// however, on decryption client needs to be read 'header' + 'encrypted-buffer' to validate the 'auth-token'. +// The scheme is ideal for usecases where payload represented by the encryptionHeader is not large and it is +// desirable to minimize CPU/latency penalty due to crypto-secure ops, such as: CommitProxies encrypted inline +// transactions, StorageServer encrypting pages etc. +// SOMEDAY: Another potential scheme could be 'MultiAuthTokenMode': Scheme generates separate authTokens +// for 'encrypted buffer' & 'encryption-header'. The scheme is ideal where payload represented by +// encryptionHeader is large enough such that it is desirable to optimize cost of upfront reading full +// 'encrypted buffer', compared to reading only encryptionHeader and ensuring its sanity; for instance: +// backup-files. + +template +struct AesCtrWithAuthV1 { + using Self = AesCtrWithAuthV1; + + // Serializable fields + + // Text cipher encryption information + BlobCipherDetails cipherTextDetails; + // Text cipher Key Check Value + EncryptCipherKeyCheckValue textKCV; + // Header cipher encryption information + BlobCipherDetails cipherHeaderDetails; + // Header cipher Key Check Value + EncryptCipherKeyCheckValue headerKCV; + // Initialization vector + uint8_t iv[AES_256_IV_LENGTH]; + // Authentication token + uint8_t authToken[Params::authTokenSize]; + + AesCtrWithAuthV1() = default; + AesCtrWithAuthV1(const BlobCipherDetails& textDetails, + const EncryptCipherKeyCheckValue tKCV, + const BlobCipherDetails& headerDetails, + const EncryptCipherKeyCheckValue hKCV, + const uint8_t* ivBuf, + const int ivLen) + : cipherTextDetails(textDetails), textKCV(tKCV), cipherHeaderDetails(headerDetails), headerKCV(hKCV) { + ASSERT_EQ(ivLen, AES_256_IV_LENGTH); + memcpy(&iv[0], ivBuf, ivLen); + memset(&authToken[0], 0, Params::authTokenSize); + } + + bool operator==(const Self& o) const { + return cipherHeaderDetails == o.cipherHeaderDetails && cipherTextDetails == o.cipherTextDetails && + textKCV == o.textKCV && headerKCV == o.headerKCV && memcmp(&iv[0], &o.iv[0], AES_256_IV_LENGTH) == 0 && + memcmp(&authToken[0], &o.authToken[0], Params::authTokenSize) == 0; + } + + static uint32_t getSize() { + return BlobCipherDetails::getSize() * 2 + sizeof(EncryptCipherKeyCheckValue) * 2 + AES_256_IV_LENGTH + + Params::authTokenSize; + } + + template + void serialize(Ar& ar) { + serializer(ar, cipherTextDetails, textKCV, cipherHeaderDetails, headerKCV); + ar.serializeBytes(iv, AES_256_IV_LENGTH); + ar.serializeBytes(authToken, Params::authTokenSize); + } +}; + +template +struct AesCtrWithAuth { + // Serializable fields + + // Algorithm header version + uint8_t version = 1; + // List of supported versions. + union { + AesCtrWithAuthV1 v1; + }; + + AesCtrWithAuth() { + // Only V1 is supported + ASSERT_EQ(1, Params::getDefaultHeaderVersion()); + } + + AesCtrWithAuth(AesCtrWithAuthV1& v) : v1(v) { + // Only V1 is supported + ASSERT_EQ(1, Params::getDefaultHeaderVersion()); + } + + static uint32_t getSize() { return AesCtrWithAuthV1::getSize() + 1; } + + static Standalone toStringRef(const AesCtrWithAuth& algoHeader) { + BinaryWriter wr(AssumeVersion(ProtocolVersion::withEncryptionAtRest())); + wr << algoHeader; + return wr.toValue(); + } + + template + void serialize(Ar& ar) { + if (ar.isSerializing) { + ASSERT_EQ(1, version); + } + serializer(ar, version); + if (ar.isDeserializing && version != 1) { + TraceEvent(SevWarn, "BlobCipherEncryptHeaderUnsupportedAlgoHeaderVersion") + .detail("HeaderType", "AesCtrWith" + Params::authAlgoName()) + .detail("Version", version); + throw not_implemented(); + } + serializer(ar, v1); + } +}; + +struct AesCtrWithHmacParams { + static constexpr int authTokenSize = AUTH_TOKEN_HMAC_SHA_SIZE; + + static std::string authAlgoName() { return "Hmac"; } + static uint8_t getDefaultHeaderVersion() { return CLIENT_KNOBS->ENCRYPT_HEADER_AES_CTR_HMAC_SHA_AUTH_VERSION; } +}; +using AesCtrWithHmac = AesCtrWithAuth; + +struct AesCtrWithCmacParams { + static constexpr int authTokenSize = AUTH_TOKEN_AES_CMAC_SIZE; + + static std::string authAlgoName() { return "Cmac"; } + static uint8_t getDefaultHeaderVersion() { return CLIENT_KNOBS->ENCRYPT_HEADER_AES_CTR_AES_CMAC_AUTH_VERSION; } +}; +using AesCtrWithCmac = AesCtrWithAuth; + +struct AesCtrNoAuthV1 { + // Serializable fields + + // Text cipher encryption information + BlobCipherDetails cipherTextDetails; + // Text cipher Key Check Value + EncryptCipherKeyCheckValue textKCV; + // Initialization vector + uint8_t iv[AES_256_IV_LENGTH]; + + AesCtrNoAuthV1() = default; + AesCtrNoAuthV1(const BlobCipherDetails& textDetails, + const EncryptCipherKeyCheckValue tKCV, + const uint8_t* ivBuf, + const int ivLen) + : cipherTextDetails(textDetails), textKCV(tKCV) { + ASSERT_EQ(ivLen, AES_256_IV_LENGTH); + memcpy(&iv[0], ivBuf, ivLen); + } + + bool operator==(const AesCtrNoAuthV1& o) const { + return cipherTextDetails == o.cipherTextDetails && textKCV == o.textKCV && + memcmp(&iv[0], &o.iv[0], AES_256_IV_LENGTH) == 0; + } + + static uint32_t getSize() { + return BlobCipherDetails::getSize() + sizeof(EncryptCipherKeyCheckValue) + AES_256_IV_LENGTH; + } + + template + void serialize(Ar& ar) { + serializer(ar, cipherTextDetails, textKCV); + ar.serializeBytes(iv, AES_256_IV_LENGTH); + } +}; + +struct AesCtrNoAuth { + // Serializable fields + + // Algorithm header version + uint8_t version = 1; + // List of supported versions. + union { + AesCtrNoAuthV1 v1; + }; + + AesCtrNoAuth() { + // Only V1 is supported + ASSERT_EQ(1, CLIENT_KNOBS->ENCRYPT_HEADER_AES_CTR_NO_AUTH_VERSION); + } + + AesCtrNoAuth(AesCtrNoAuthV1& v) : v1(v) { + // Only V1 is supported + ASSERT_EQ(1, CLIENT_KNOBS->ENCRYPT_HEADER_AES_CTR_NO_AUTH_VERSION); + } + + static uint32_t getSize() { return AesCtrNoAuthV1::getSize() + 1; } + + static Standalone toStringRef(const AesCtrNoAuth& algoHeader) { + BinaryWriter wr(AssumeVersion(ProtocolVersion::withEncryptionAtRest())); + wr << algoHeader; + return wr.toValue(); + } + + template + void serialize(Ar& ar) { + if (ar.isSerializing) { + ASSERT_EQ(1, version); + } + serializer(ar, version); + if (ar.isDeserializing && version != 1) { + TraceEvent(SevWarn, "BlobCipherEncryptHeaderUnsupportedAlgoHeaderVersion") + .detail("HeaderType", "AesCtrNoAuth") + .detail("Version", version); + throw not_implemented(); + } + serializer(ar, v1); + } +}; + +struct EncryptHeaderCipherKCVs { + EncryptCipherKeyCheckValue textKCV; + Optional headerKCV; + + EncryptHeaderCipherKCVs() = default; + EncryptHeaderCipherKCVs(const EncryptCipherKeyCheckValue tKCV) : textKCV(tKCV) {} + EncryptHeaderCipherKCVs(const EncryptCipherKeyCheckValue tKCV, const EncryptCipherKeyCheckValue hKCV) + : textKCV(tKCV), headerKCV(hKCV) {} +}; + +struct BlobCipherEncryptHeaderRef { + // Serializable fields + std::variant flags; + std::variant algoHeader; + + BlobCipherEncryptHeaderRef() = default; + BlobCipherEncryptHeaderRef(const BlobCipherEncryptHeaderRef& src) = default; + + static BlobCipherEncryptHeaderRef fromStringRef(const StringRef& header) { + return BinaryReader::fromStringRef( + header, AssumeVersion(ProtocolVersion::withEncryptionAtRest())); + } + + static Standalone toStringRef(const BlobCipherEncryptHeaderRef& headerRef) { + return BinaryWriter::toValue(headerRef, AssumeVersion(ProtocolVersion::withEncryptionAtRest())); + } + + // Routine computes EncryptHeaderSize based on input params. + static uint32_t getHeaderSize(const int flagVersion, + const int algoHeaderVersion, + const EncryptCipherMode cipherMode, + const EncryptAuthTokenMode authMode, + const EncryptAuthTokenAlgo authAlgo); + + int flagsVersion() const { return flags.index() + 1; } + + int algoHeaderVersion() const { + return std::visit([&](auto& h) { return h.version; }, algoHeader); + } + + template + void serialize(Ar& ar) { + serializer(ar, flags, algoHeader); + } + + const uint8_t* getIV() const; + const EncryptHeaderCipherDetails getCipherDetails() const; + EncryptAuthTokenMode getAuthTokenMode() const; + EncryptCipherDomainId getDomainId() const; + EncryptHeaderCipherKCVs getKCVs() const; + + // API supports following validation: + // 1. Ensure input BlobCipherDetails (textDetails and/or headerDetails) matches with the input + // 2. Ensure persited KCV matches with the input values + // 3. Ensure input IV buffer matches with the persisted ones. + // + // Currently API is used by BlobGranule encryption where encryption key lookup based on persisted + // BlobGranuleCipherKeyCtx + void validateEncryptionHeaderDetails(const BlobCipherDetails& textCipherDetails, + const BlobCipherDetails& headerCipherDetails, + const EncryptHeaderCipherKCVs& kcvs, + const StringRef& ivRef) const; +}; + +#pragma pack(pop) + +// BlobCipher Encryption header format +// This header is persisted along with encrypted buffer, it contains information necessary +// to assist decrypting the buffers to serve read requests. +// +// The total space overhead is 104 bytes. + +#pragma pack(push, 1) // exact fit - no padding +typedef struct BlobCipherEncryptHeader { + static constexpr int headerSize = 112; + union { + struct { + uint8_t size; // reading first byte is sufficient to determine header + // length. ALWAYS THE FIRST HEADER ELEMENT. + uint8_t headerVersion{}; + uint8_t encryptMode{}; + uint8_t authTokenMode{}; + uint8_t authTokenAlgo{}; + uint8_t _reserved[3]{}; + } flags; + uint64_t _padding{}; + }; + + // Cipher text encryption information + BlobCipherDetails cipherTextDetails; + // Text Key Check Value + EncryptCipherKeyCheckValue textKCV; + // Cipher header encryption information + BlobCipherDetails cipherHeaderDetails; + // Header Key Check Value + EncryptCipherKeyCheckValue headerKCV; + // Initialization vector used to encrypt the payload. + uint8_t iv[AES_256_IV_LENGTH]; + + // Encryption header is stored as plaintext on a persistent storage to assist reconstruction of cipher-key(s) + // for reads. FIPS compliance recommendation is to leverage cryptographic digest mechanism to generate + // 'authentication token' (crypto-secure) to protect against malicious tampering and/or bit rot/flip scenarios. + + // Encryption header support two modes of generation 'authentication tokens': + // 1) SingleAuthTokenMode: the scheme generates single crypto-secrure auth token to protect {cipherText + + // header} payload. Scheme is geared towards optimizing cost due to crypto-secure auth-token generation, + // however, on decryption client needs to be read 'header' + 'encrypted-buffer' to validate the 'auth-token'. + // The scheme is ideal for usecases where payload represented by the encryptionHeader is not large and it is + // desirable to minimize CPU/latency penalty due to crypto-secure ops, such as: CommitProxies encrypted inline + // transactions, StorageServer encrypting pages etc. + // SOMEDAY: Another potential scheme could be 'MultiAuthTokenMode': Scheme generates separate authTokens + // for 'encrypted buffer' & 'encryption-header'. The scheme is ideal where payload represented by + // encryptionHeader is large enough such that it is desirable to optimize cost of upfront reading full + // 'encrypted buffer', compared to reading only encryptionHeader and ensuring its sanity; for instance: + // backup-files. + + struct { + uint8_t authToken[AUTH_TOKEN_MAX_SIZE]{}; + } singleAuthToken; + + BlobCipherEncryptHeader() {} + + static BlobCipherEncryptHeader fromStringRef(StringRef headerRef) { + BlobCipherEncryptHeader header; + BinaryReader rd(headerRef, AssumeVersion(ProtocolVersion::withEncryptionAtRest())); + rd >> header; + return header; + } + + static StringRef toStringRef(BlobCipherEncryptHeader& header, Arena& arena) { + BinaryWriter wr(AssumeVersion(ProtocolVersion::withEncryptionAtRest())); + wr.serializeBytes(&header, header.flags.size); + return wr.toValue(arena); + } + + template + void serialize(Ar& ar) { + ar.serializeBytes(this, headerSize); + } + + std::string toString() const { + return format("domain id: %" PRId64 ", cipher id: %" PRIu64, + cipherTextDetails.encryptDomainId, + cipherTextDetails.baseCipherId); + } +} BlobCipherEncryptHeader; +#pragma pack(pop) + +// Ensure no struct-packing issues +static_assert(sizeof(BlobCipherEncryptHeader) == BlobCipherEncryptHeader::headerSize, + "BlobCipherEncryptHeader size mismatch"); + +// This interface is in-memory representation of CipherKey used for encryption/decryption information. +// It caches base encryption key properties as well as caches the 'derived encryption' key obtained by applying +// HMAC-SHA-256 derivation technique. + +class BlobCipherKey : public ReferenceCounted, NonCopyable { +public: + BlobCipherKey(const EncryptCipherDomainId& domainId, + const EncryptCipherBaseKeyId& baseCiphId, + const uint8_t* baseCiph, + const int baseCiphLen, + const EncryptCipherKeyCheckValue baseCipherKCV, + const int64_t refreshAt, + int64_t expireAt); + BlobCipherKey(const EncryptCipherDomainId& domainId, + const EncryptCipherBaseKeyId& baseCiphId, + const uint8_t* baseCiph, + const int baseCiphLen, + const EncryptCipherKeyCheckValue baseCipherKCV, + const EncryptCipherRandomSalt& salt, + const int64_t refreshAt, + const int64_t expireAt); + + uint8_t* data() const { return cipher.get(); } + uint64_t getRefreshAtTS() const { return refreshAtTS; } + uint64_t getExpireAtTS() const { return expireAtTS; } + EncryptCipherDomainId getDomainId() const { return encryptDomainId; } + EncryptCipherRandomSalt getSalt() const { return randomSalt; } + EncryptCipherBaseKeyId getBaseCipherId() const { return baseCipherId; } + int getBaseCipherLen() const { return baseCipherLen; } + EncryptCipherKeyCheckValue getBaseCipherKCV() const { return baseCipherKCV; } + uint8_t* rawCipher() const { return cipher.get(); } + uint8_t* rawBaseCipher() const { return baseCipher.get(); } + bool isEqual(const Reference toCompare) { + return encryptDomainId == toCompare->getDomainId() && baseCipherId == toCompare->getBaseCipherId() && + randomSalt == toCompare->getSalt() && baseCipherLen == toCompare->getBaseCipherLen() && + memcmp(cipher.get(), toCompare->rawCipher(), AES_256_KEY_LENGTH) == 0 && + memcmp(baseCipher.get(), toCompare->rawBaseCipher(), baseCipherLen) == 0; + } + + bool isCipherDetailMatches(const BlobCipherDetails& details) { + return encryptDomainId == details.encryptDomainId && baseCipherId == details.baseCipherId && + randomSalt == details.salt; + } + + inline bool needsRefresh() { + if (refreshAtTS == std::numeric_limits::max()) { + return false; + } + return now() + INetwork::TIME_EPS >= refreshAtTS ? true : false; + } + + inline bool isExpired() { + if (expireAtTS == std::numeric_limits::max()) { + return false; + } + return now() + INetwork::TIME_EPS >= expireAtTS ? true : false; + } + + BlobCipherDetails details() const { return BlobCipherDetails{ encryptDomainId, baseCipherId, randomSalt }; } + + void reset(); + +private: + // Encryption domain boundary identifier + EncryptCipherDomainId encryptDomainId; + // Base encryption cipher key properties + std::unique_ptr baseCipher; + EncryptCipherKeyCheckValue baseCipherKCV; + int baseCipherLen; + EncryptCipherBaseKeyId baseCipherId; + // Random salt used for encryption cipher key derivation + EncryptCipherRandomSalt randomSalt; + // Derived encryption cipher key + std::unique_ptr cipher; + // CipherKey needs refreshAt + int64_t refreshAtTS; + // CipherKey is valid until + int64_t expireAtTS; + + void initKey(const EncryptCipherDomainId& domainId, + const EncryptCipherBaseKeyId& baseCiphId, + const uint8_t* baseCiph, + const int baseCiphLen, + const EncryptCipherKeyCheckValue baseCipherKCV, + const EncryptCipherRandomSalt& salt, + const int64_t refreshAt, + const int64_t expireAt); + void applyHmacSha256Derivation(); +}; + +// This interface allows FDB processes participating in encryption to store and +// index recently used encyption cipher keys. FDB encryption has two dimensions: +// 1. Mapping on cipher encryption keys per "encryption domains" +// 2. Per encryption domain, the cipher keys are index using {baseCipherKeyId, salt} tuple. +// +// The design supports NIST recommendation of limiting lifetime of an encryption +// key. For details refer to: +// https://csrc.nist.gov/publications/detail/sp/800-57-part-1/rev-3/archive/2012-07-10 +// +// Below gives a pictoral representation of in-memory datastructure implemented +// to index encryption keys: +// { encryptionDomain -> { {baseCipherId, salt} -> cipherKey } } +// +// Supported cache lookups schemes: +// 1. Lookup cipher based on { encryptionDomainId, baseCipherKeyId, salt } triplet. +// 2. Lookup latest cipher key for a given encryptionDomainId. +// +// Client is responsible to handle cache-miss usecase, the corrective operation +// might vary based on the calling process, for instance: EncryptKeyServer +// cache-miss shall invoke RPC to external Encryption Key Manager to fetch the +// required encryption key, however, CPs/SSs cache-miss would result in RPC to +// EncryptKeyServer to refresh the desired encryption key. + +using BlobCipherKeyIdCacheKey = std::pair; +using BlobCipherKeyIdCacheKeyHash = boost::hash; +using BlobCipherKeyIdCacheMap = + std::unordered_map, BlobCipherKeyIdCacheKeyHash>; +using BlobCipherKeyIdCacheMapCItr = + std::unordered_map, BlobCipherKeyIdCacheKeyHash>::const_iterator; + +struct BlobCipherKeyIdCache : ReferenceCounted { +public: + explicit BlobCipherKeyIdCache(EncryptCipherDomainId dId, size_t* sizeStat); + + BlobCipherKeyIdCacheKey getCacheKey(const EncryptCipherBaseKeyId& baseCipherId, + const EncryptCipherRandomSalt& salt); + + // API returns the last inserted cipherKey. + // If none exists, null reference is returned. + + Reference getLatestCipherKey(); + + // API returns cipherKey corresponding to input 'baseCipherKeyId'. + // If none exists, null reference is returned. + + Reference getCipherByBaseCipherId(const EncryptCipherBaseKeyId& baseCipherKeyId, + const EncryptCipherRandomSalt& salt); + + // API enables inserting base encryption cipher details to the BlobCipherKeyIdCache. + // Given cipherKeys are immutable, attempting to re-insert same 'identical' cipherKey + // is treated as a NOP (success), however, an attempt to update cipherKey would throw + // 'encrypt_update_cipher' exception. Returns the inserted cipher key if success. + // + // API NOTE: Recommended usecase is to update encryption cipher-key is updated the external + // keyManagementSolution to limit an encryption key lifetime + + Reference insertBaseCipherKey(const EncryptCipherBaseKeyId& baseCipherId, + const uint8_t* baseCipher, + const int baseCipherLen, + const EncryptCipherKeyCheckValue baseCipherKCV, + const int64_t refreshAt, + const int64_t expireAt); + + // API enables inserting base encryption cipher details to the BlobCipherKeyIdCache + // Given cipherKeys are immutable, attempting to re-insert same 'identical' cipherKey + // is treated as a NOP (success), however, an attempt to update cipherKey would throw + // 'encrypt_update_cipher' exception. Returns the inserted cipher key if sucess. + // + // API NOTE: Recommended usecase is to update encryption cipher-key regeneration while performing + // decryption. The encryptionheader would contain relevant details including: 'encryptDomainId', + // 'baseCipherId' & 'salt'. The caller needs to fetch 'baseCipherKey' detail and re-populate KeyCache. + // Also, the invocation will NOT update the latest cipher-key details. + + Reference insertBaseCipherKey(const EncryptCipherBaseKeyId& baseCipherId, + const uint8_t* baseCipher, + const int baseCipherLen, + const EncryptCipherKeyCheckValue baseCipherKCV, + const EncryptCipherRandomSalt& salt, + const int64_t refreshAt, + const int64_t expireAt); + + // API cleanup the cache by dropping all cached cipherKeys + void cleanup(); + + // API returns list of all 'cached' cipherKeys + std::vector> getAllCipherKeys(); + + // Return number of cipher keys in the cahce. + size_t getSize() const { return keyIdCache.size(); } + +private: + EncryptCipherDomainId domainId; + BlobCipherKeyIdCacheMap keyIdCache; + Optional latestBaseCipherKeyId; + Optional latestRandomSalt; + size_t* sizeStat; // pointer to the outer BlobCipherKeyCache size count. +}; + +using BlobCipherDomainCacheMap = std::unordered_map>; + +class BlobCipherKeyCache : NonCopyable, public ReferenceCounted { +public: + // Public visibility constructior ONLY to assist FlowSingleton instance creation. + // API Note: Constructor is expected to be instantiated only in simulation mode. + + explicit BlobCipherKeyCache(bool ignored) { ASSERT(g_network->isSimulated()); } + + // Enable clients to insert base encryption cipher details to the BlobCipherKeyCache. + // The cipherKeys are indexed using 'baseCipherId', given cipherKeys are immutable, + // attempting to re-insert same 'identical' cipherKey is treated as a NOP (success), + // however, an attempt to update cipherKey would throw 'encrypt_update_cipher' exception. + // Returns the inserted cipher key if success. + // + // API NOTE: Recommended use case is to update encryption cipher-key is updated the external + // keyManagementSolution to limit an encryption key lifetime + + Reference insertCipherKey(const EncryptCipherDomainId& domainId, + const EncryptCipherBaseKeyId& baseCipherId, + const uint8_t* baseCipher, + const int baseCipherLen, + const EncryptCipherKeyCheckValue baseCipherKCV, + const int64_t refreshAt, + const int64_t expireAt); + + // Enable clients to insert base encryption cipher details to the BlobCipherKeyCache. + // The cipherKeys are indexed using 'baseCipherId', given cipherKeys are immutable, + // attempting to re-insert same 'identical' cipherKey is treated as a NOP (success), + // however, an attempt to update cipherKey would throw 'encrypt_update_cipher' exception. + // Returns the inserted cipher key if success. + // + // API NOTE: Recommended usecase is to update encryption cipher-key regeneration while performing + // decryption. The encryptionheader would contain relevant details including: 'encryptDomainId', + // 'baseCipherId' & 'salt'. The caller needs to fetch 'baseCipherKey' detail and re-populate KeyCache. + // Also, the invocation will NOT update the latest cipher-key details. + + Reference insertCipherKey(const EncryptCipherDomainId& domainId, + const EncryptCipherBaseKeyId& baseCipherId, + const uint8_t* baseCipher, + const int baseCipherLen, + const EncryptCipherKeyCheckValue baseCipherKCV, + const EncryptCipherRandomSalt& salt, + const int64_t refreshAt, + const int64_t expireAt); + + // API returns the last insert cipherKey for a given encryption domain Id. + // If domain Id is invalid, it would throw 'encrypt_invalid_id' exception, + // otherwise, and if none exists, it would return null reference. + + Reference getLatestCipherKey(const EncryptCipherDomainId& domainId); + + // API returns cipherKey corresponding to {encryptionDomainId, baseCipherId} tuple. + // If none exists, it would return null reference. + + Reference getCipherKey(const EncryptCipherDomainId& domainId, + const EncryptCipherBaseKeyId& baseCipherId, + const EncryptCipherRandomSalt& salt); + + // API returns point in time list of all 'cached' cipherKeys for a given encryption domainId. + std::vector> getAllCiphers(const EncryptCipherDomainId& domainId); + + // API enables dropping all 'cached' cipherKeys for a given encryption domain Id. + // Useful to cleanup cache if an encryption domain gets removed/destroyed etc. + void resetEncryptDomainId(const EncryptCipherDomainId domainId); + + // Total number of cipher keys in the cache. + size_t getSize() const { return size; } + + static Reference getInstance() { + static bool cleanupRegistered = false; + if (!cleanupRegistered) { + // We try to avoid cipher keys appear in core dumps, so we clean them up before crash. + // TODO(yiwu): use of MADV_DONTDUMP instead of the crash handler. + registerCrashHandlerCallback(BlobCipherKeyCache::cleanup); + cleanupRegistered = true; + } + if (g_network->isSimulated()) { + return FlowSingleton::getInstance( + []() { return makeReference(g_network->isSimulated()); }); + } else { + static BlobCipherKeyCache instance; + return Reference::addRef(&instance); + } + } + + // Ensures cached encryption key(s) (plaintext) never gets persisted as part + // of FDB process/core dump. + static void cleanup() noexcept; + +private: + BlobCipherDomainCacheMap domainCacheMap; + size_t size = 0; + + BlobCipherKeyCache() {} +}; + +// This interface enables data block encryption. An invocation to encrypt() will +// do two things: +// 1) generate encrypted ciphertext for given plaintext input. +// 2) generate BlobCipherEncryptHeader (including the 'header authTokens') and persit for decryption on reads. + +class EncryptBlobCipherAes265Ctr final : NonCopyable, public ReferenceCounted { +public: + static constexpr uint8_t ENCRYPT_HEADER_VERSION = 1; + + EncryptBlobCipherAes265Ctr(Reference tCipherKey, + Optional> hCipherKey, + const uint8_t* iv, + const int ivLen, + const EncryptAuthTokenMode mode, + BlobCipherMetrics::UsageType usageType); + EncryptBlobCipherAes265Ctr(Reference tCipherKey, + Optional> hCipherKey, + const uint8_t* iv, + const int ivLen, + const EncryptAuthTokenMode mode, + const EncryptAuthTokenAlgo algo, + BlobCipherMetrics::UsageType usageType); + EncryptBlobCipherAes265Ctr(Reference tCipherKey, + Optional> hCipherKey, + const EncryptAuthTokenMode mode, + BlobCipherMetrics::UsageType usageType); + EncryptBlobCipherAes265Ctr(Reference tCipherKey, + Optional> hCipherKey, + const EncryptAuthTokenMode mode, + const EncryptAuthTokenAlgo algo, + BlobCipherMetrics::UsageType usageType); + ~EncryptBlobCipherAes265Ctr(); + + Reference encrypt(const uint8_t* plaintext, + const int plaintextLen, + BlobCipherEncryptHeader* header, + Arena&); + StringRef encrypt(const uint8_t*, const int, BlobCipherEncryptHeaderRef*, Arena&); + + void encryptInplace(uint8_t* plaintext, const int plaintextLen, BlobCipherEncryptHeader* header); + + void encryptInplace(uint8_t* plaintext, const int plaintextLen, BlobCipherEncryptHeaderRef* headerRef); + +private: + void init(); + + void updateEncryptHeader(const uint8_t*, const int, BlobCipherEncryptHeaderRef* headerRef); + void updateEncryptHeader(const uint8_t*, const int, BlobCipherEncryptHeader* header); + void updateEncryptHeaderFlagsV1(BlobCipherEncryptHeaderRef* headerRef, BlobCipherEncryptHeaderFlagsV1* flags); + void setCipherAlgoHeaderV1(const uint8_t*, + const int, + const BlobCipherEncryptHeaderFlagsV1&, + BlobCipherEncryptHeaderRef*); + void setCipherAlgoHeaderNoAuthV1(const BlobCipherEncryptHeaderFlagsV1&, BlobCipherEncryptHeaderRef*); + template + void setCipherAlgoHeaderWithAuthV1(const uint8_t*, + const int, + const BlobCipherEncryptHeaderFlagsV1&, + BlobCipherEncryptHeaderRef*); + + EVP_CIPHER_CTX* ctx; + Reference textCipherKey; + Optional> headerCipherKeyOpt; + EncryptAuthTokenMode authTokenMode; + uint8_t iv[AES_256_IV_LENGTH]; + BlobCipherMetrics::UsageType usageType; + EncryptAuthTokenAlgo authTokenAlgo; +}; + +// This interface enable data block decryption. An invocation to decrypt() would generate +// 'plaintext' for a given 'ciphertext' input, the caller needs to supply BlobCipherEncryptHeader. + +class DecryptBlobCipherAes256Ctr final : NonCopyable, public ReferenceCounted { +public: + DecryptBlobCipherAes256Ctr(Reference tCipherKey, + Optional> hCipherKey, + const uint8_t* iv, + BlobCipherMetrics::UsageType usageType); + ~DecryptBlobCipherAes256Ctr(); + + Reference decrypt(const uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeader& header, + Arena&); + StringRef decrypt(const uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeaderRef& headerRef, + Arena&); + + void decryptInplace(uint8_t* ciphertext, const int ciphertextLen, const BlobCipherEncryptHeader& header); + + void decryptInplace(uint8_t* ciphertext, const int ciphertextLen, const BlobCipherEncryptHeaderRef& headerRef); + +private: + EVP_CIPHER_CTX* ctx; + BlobCipherMetrics::UsageType usageType; + Reference textCipherKey; + Optional> headerCipherKeyOpt; + bool authTokensValidationDone; + + // API is resposible to validate persisted EncryptionHeader sanity, it does following checks + // 1. Parse and validate EncryptionHeaderFlags (version compliant checks) + // 2. Parse and validate KCVs + // 3. Parse and validate auth-tokens if applicable. + // + // Routine is invoked for every decryption buffer request and is done transparently to the caller + + void validateEncryptHeader(const uint8_t*, + const int, + const BlobCipherEncryptHeaderRef&, + EncryptAuthTokenMode*, + EncryptAuthTokenAlgo*); + void validateEncryptHeaderFlagsV1(const uint32_t, const BlobCipherEncryptHeaderFlagsV1&); + void validateAuthTokensV1(const uint8_t*, + const int, + const BlobCipherEncryptHeaderFlagsV1&, + const BlobCipherEncryptHeaderRef&); + void validateHeaderSingleAuthTokenV1(const uint8_t*, + const int, + const BlobCipherEncryptHeaderFlagsV1&, + const BlobCipherEncryptHeaderRef&); + template + void validateAuthTokenV1(const uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeaderFlagsV1&, + const BlobCipherEncryptHeaderRef&); + void vaidateEncryptHeaderCipherKCVs(const BlobCipherEncryptHeaderRef&, const BlobCipherEncryptHeaderFlagsV1&); + + void verifyEncryptHeaderMetadata(const BlobCipherEncryptHeader& header); + void verifyAuthTokens(const uint8_t* ciphertext, const int ciphertextLen, const BlobCipherEncryptHeader& header); + void verifyHeaderSingleAuthToken(const uint8_t* ciphertext, + const int ciphertextLen, + const BlobCipherEncryptHeader& header); +}; + +class HmacSha256DigestGen final : NonCopyable { +public: + HmacSha256DigestGen(const unsigned char* key, size_t len); + ~HmacSha256DigestGen(); + HMAC_CTX* getCtx() const { return ctx; } + unsigned int digest(const std::vector>& payload, + unsigned char* buf, + unsigned int bufLen); + +private: + HMAC_CTX* ctx; +}; + +class Aes256CmacDigestGen final : NonCopyable { +public: + Aes256CmacDigestGen(const unsigned char* key, size_t len); + ~Aes256CmacDigestGen(); + CMAC_CTX* getCtx() const { return ctx; } + size_t digest(const std::vector>& payload, uint8_t* digest, int digestlen); + +private: + CMAC_CTX* ctx; +}; + +class Sha256KCV final : NonCopyable { +public: + Sha256KCV(); + ~Sha256KCV(); + + EncryptCipherKeyCheckValue computeKCV(const uint8_t* cipher, const int len); + + static void checkEqual(const Reference& cipher, const EncryptCipherKeyCheckValue persited); + +private: + EVP_MD_CTX* ctx; +}; + +void computeAuthToken(const std::vector>& payload, + const uint8_t* key, + const int keyLen, + unsigned char* digestBuf, + const EncryptAuthTokenAlgo algo, + unsigned int digestMaxBufSz); + +EncryptAuthTokenMode getEncryptAuthTokenMode(const EncryptAuthTokenMode mode); +int getEncryptCurrentAlgoHeaderVersion(const EncryptAuthTokenMode mode, const EncryptAuthTokenAlgo algo); + +#endif // FDBCLIENT_BLOB_CIPHER_H \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/BlobConnectionProvider.h b/src/fdbclient/include/fdbclient/BlobConnectionProvider.h new file mode 100644 index 0000000..f5d9f08 --- /dev/null +++ b/src/fdbclient/include/fdbclient/BlobConnectionProvider.h @@ -0,0 +1,47 @@ +/* + * BlobConnectionProvider.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef BLOB_CONNECTION_PROVIDER_H +#define BLOB_CONNECTION_PROVIDER_H + +#include "fdbclient/BackupContainerFileSystem.h" +#include "fdbclient/BlobMetadataUtils.h" + +struct BlobConnectionProvider : NonCopyable, ReferenceCounted { + // chooses a partition and prepends the necessary prefix to the filename (if necessary) for writing a file, and + // returns it and the backup container + virtual std::pair, std::string> createForWrite(std::string newFileName) = 0; + + // given a file, return the backup container and full file path necessary to access it. File path should be + // something returned from createForWrite + virtual Reference getForRead(std::string filePath) = 0; + + virtual bool isExpired() const = 0; + virtual bool needsRefresh() const = 0; + virtual void update(Standalone newBlobMetadata) = 0; + + virtual ~BlobConnectionProvider() {} + + static Reference newBlobConnectionProvider(std::string blobUrl); + + static Reference newBlobConnectionProvider(Standalone blobMetadata); +}; + +#endif \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/BlobGranuleCommon.h b/src/fdbclient/include/fdbclient/BlobGranuleCommon.h new file mode 100644 index 0000000..04d3a00 --- /dev/null +++ b/src/fdbclient/include/fdbclient/BlobGranuleCommon.h @@ -0,0 +1,432 @@ +/* + * BlobGranuleCommon.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBCLIENT_BLOBGRANULECOMMON_H +#define FDBCLIENT_BLOBGRANULECOMMON_H +#pragma once + +#include "fdbclient/BlobCipher.h" +#include "fdbclient/CommitTransaction.h" +#include "fdbclient/FDBTypes.h" + +#include "flow/EncryptUtils.h" +#include "flow/IRandom.h" +#include "flow/serialize.h" + +#include + +#define BG_ENCRYPT_COMPRESS_DEBUG false + +// file format of actual blob files +struct GranuleSnapshot : VectorRef { + + constexpr static FileIdentifier file_identifier = 1300395; + + template + void serialize(Ar& ar) { + serializer(ar, ((VectorRef&)*this)); + } +}; + +// Deltas in version order +struct GranuleDeltas : VectorRef { + constexpr static FileIdentifier file_identifier = 8563013; + + template + void serialize(Ar& ar) { + serializer(ar, ((VectorRef&)*this)); + } +}; + +#pragma pack(push, 4) +struct GranuleMutationRef { + MutationRef::Type type; + Version version; + StringRef param1; + StringRef param2; + + GranuleMutationRef() {} + GranuleMutationRef(MutationRef::Type t, Version v, StringRef param1, StringRef param2) + : type(t), version(v), param1(param1), param2(param2) {} + GranuleMutationRef(Arena& to, MutationRef::Type t, Version v, StringRef param1, StringRef param2) + : type(t), version(v), param1(to, param1), param2(to, param2) {} + GranuleMutationRef(Arena& to, const GranuleMutationRef& from) + : type(from.type), version(from.version), param1(to, from.param1), param2(to, from.param2) {} +}; +#pragma pack(pop) + +struct GranuleMaterializeStats { + // file-level stats + int64_t inputBytes; + int64_t outputBytes; + + // merge stats + int32_t snapshotRows; + int32_t rowsCleared; + int32_t rowsInserted; + int32_t rowsUpdated; + + GranuleMaterializeStats() + : inputBytes(0), outputBytes(0), snapshotRows(0), rowsCleared(0), rowsInserted(0), rowsUpdated(0) {} +}; + +struct BlobGranuleCipherKeysMeta { + EncryptCipherDomainId textDomainId; + EncryptCipherBaseKeyId textBaseCipherId; + EncryptCipherKeyCheckValue textBaseCipherKCV; + EncryptCipherRandomSalt textSalt; + EncryptCipherDomainId headerDomainId; + EncryptCipherBaseKeyId headerBaseCipherId; + EncryptCipherKeyCheckValue headerBaseCipherKCV; + EncryptCipherRandomSalt headerSalt; + std::string ivStr; + + BlobGranuleCipherKeysMeta() {} + BlobGranuleCipherKeysMeta(const EncryptCipherDomainId tDomainId, + const EncryptCipherBaseKeyId tBaseCipherId, + const EncryptCipherKeyCheckValue tBaseCipherKCV, + const EncryptCipherRandomSalt tSalt, + const EncryptCipherDomainId hDomainId, + const EncryptCipherBaseKeyId hBaseCipherId, + const EncryptCipherKeyCheckValue hBaseCipherKCV, + const EncryptCipherRandomSalt hSalt, + const std::string& iv) + : textDomainId(tDomainId), textBaseCipherId(tBaseCipherId), textBaseCipherKCV(tBaseCipherKCV), textSalt(tSalt), + headerDomainId(hDomainId), headerBaseCipherId(hBaseCipherId), headerBaseCipherKCV(hBaseCipherKCV), + headerSalt(hSalt), ivStr(iv) {} + + template + void serialize(Ar& ar) { + serializer(ar, + textDomainId, + textBaseCipherId, + textBaseCipherKCV, + textSalt, + headerDomainId, + headerBaseCipherId, + headerBaseCipherKCV, + headerSalt, + ivStr); + } +}; + +// When updating this struct with new fields, you must update and add new api versioning for corresponding struct in +// fdb_c.h! +struct BlobGranuleCipherKey { + constexpr static FileIdentifier file_identifier = 7274734; + EncryptCipherDomainId encryptDomainId; + EncryptCipherBaseKeyId baseCipherId; + EncryptCipherKeyCheckValue baseCipherKCV; + EncryptCipherRandomSalt salt; + StringRef baseCipher; + + static BlobGranuleCipherKey fromBlobCipherKey(Reference keyRef, Arena& arena) { + BlobGranuleCipherKey cipherKey; + cipherKey.encryptDomainId = keyRef->getDomainId(); + cipherKey.baseCipherId = keyRef->getBaseCipherId(); + cipherKey.baseCipherKCV = keyRef->getBaseCipherKCV(); + cipherKey.salt = keyRef->getSalt(); + cipherKey.baseCipher = makeString(keyRef->getBaseCipherLen(), arena); + memcpy(mutateString(cipherKey.baseCipher), keyRef->rawBaseCipher(), keyRef->getBaseCipherLen()); + + return cipherKey; + } + + template + void serialize(Ar& ar) { + serializer(ar, encryptDomainId, baseCipherId, baseCipherKCV, salt, baseCipher); + } +}; + +// When updating this struct with new fields, you must update and add new api versioning for corresponding struct in +// fdb_c.h! +struct BlobGranuleCipherKeysCtx { + constexpr static FileIdentifier file_identifier = 1278718; + BlobGranuleCipherKey textCipherKey; + BlobGranuleCipherKey headerCipherKey; + StringRef ivRef; + + static BlobGranuleCipherKeysMeta toCipherKeysMeta(const BlobGranuleCipherKeysCtx& ctx) { + return BlobGranuleCipherKeysMeta(ctx.textCipherKey.encryptDomainId, + ctx.textCipherKey.baseCipherId, + ctx.textCipherKey.baseCipherKCV, + ctx.textCipherKey.salt, + ctx.headerCipherKey.encryptDomainId, + ctx.headerCipherKey.baseCipherId, + ctx.headerCipherKey.baseCipherKCV, + ctx.headerCipherKey.salt, + ctx.ivRef.toString()); + } + + template + void serialize(Ar& ar) { + serializer(ar, textCipherKey, headerCipherKey, ivRef); + } +}; + +struct BlobGranuleFileEncryptionKeys { + Reference textCipherKey; + Reference headerCipherKey; +}; + +struct BlobGranuleCipherKeysMetaRef { + EncryptCipherDomainId textDomainId; + EncryptCipherBaseKeyId textBaseCipherId; + EncryptCipherRandomSalt textSalt; + EncryptCipherDomainId headerDomainId; + EncryptCipherBaseKeyId headerBaseCipherId; + EncryptCipherRandomSalt headerSalt; + StringRef ivRef; + + BlobGranuleCipherKeysMetaRef() {} + BlobGranuleCipherKeysMetaRef(Arena& to, BlobGranuleCipherKeysMeta cipherKeysMeta) + : textDomainId(cipherKeysMeta.textDomainId), textBaseCipherId(cipherKeysMeta.textBaseCipherId), + textSalt(cipherKeysMeta.textSalt), headerDomainId(cipherKeysMeta.headerDomainId), + headerBaseCipherId(cipherKeysMeta.headerBaseCipherId), headerSalt(cipherKeysMeta.headerSalt), + ivRef(StringRef(to, cipherKeysMeta.ivStr)) {} + + template + void serialize(Ar& ar) { + serializer(ar, textDomainId, textBaseCipherId, textSalt, headerDomainId, headerBaseCipherId, headerSalt, ivRef); + } +}; + +struct BlobFilePointerRef { + constexpr static FileIdentifier file_identifier = 5253554; + // Serializable fields + StringRef filename; + int64_t offset; + int64_t length; + int64_t fullFileLength; + Version fileVersion; + Optional cipherKeysCtx; + + // Non-serializable fields + Optional + cipherKeysMetaRef; // Placeholder to cache information sufficient to lookup encryption ciphers + + BlobFilePointerRef() {} + + BlobFilePointerRef(Arena& to, + const std::string& filename, + int64_t offset, + int64_t length, + int64_t fullFileLength, + Version fileVersion) + : filename(to, filename), offset(offset), length(length), fullFileLength(fullFileLength), + fileVersion(fileVersion) {} + + BlobFilePointerRef(Arena& to, + const std::string& filename, + int64_t offset, + int64_t length, + int64_t fullFileLength, + Version fileVersion, + Optional ciphKeysCtx) + : filename(to, filename), offset(offset), length(length), fullFileLength(fullFileLength), + fileVersion(fileVersion), cipherKeysCtx(ciphKeysCtx) {} + + BlobFilePointerRef(Arena& to, + const std::string& filename, + int64_t offset, + int64_t length, + int64_t fullFileLength, + Version fileVersion, + Optional ciphKeysMeta) + : filename(to, filename), offset(offset), length(length), fullFileLength(fullFileLength), + fileVersion(fileVersion) { + if (ciphKeysMeta.present()) { + cipherKeysMetaRef = BlobGranuleCipherKeysMetaRef(to, ciphKeysMeta.get()); + } + } + + template + void serialize(Ar& ar) { + serializer(ar, filename, offset, length, fullFileLength, fileVersion, cipherKeysCtx); + } + + std::string toString() const { + std::stringstream ss; + ss << filename.toString() << ":" << offset << ":" << length << ":" << fullFileLength << "@" << fileVersion; + if (cipherKeysCtx.present()) { + ss << ":CipherKeysCtx:TextCipher:" << cipherKeysCtx.get().textCipherKey.encryptDomainId << ":" + << cipherKeysCtx.get().textCipherKey.baseCipherId << ":" << cipherKeysCtx.get().textCipherKey.salt + << ":HeaderCipher:" << cipherKeysCtx.get().headerCipherKey.encryptDomainId << ":" + << cipherKeysCtx.get().headerCipherKey.baseCipherId << ":" << cipherKeysCtx.get().headerCipherKey.salt; + } + return std::move(ss).str(); + } +}; + +// the assumption of this response is that the client will deserialize the files +// and apply the mutations themselves +// TODO could filter out delta files that don't intersect the key range being +// requested? +// TODO since client request passes version, we don't need to include the +// version of each mutation in the response if we pruned it there +struct BlobGranuleChunkRef { + constexpr static FileIdentifier file_identifier = 865198; + KeyRangeRef keyRange; + Version includedVersion; + // FIXME: remove snapshotVersion, it is deprecated with fileVersion in BlobFilePointerRef + Version snapshotVersion; + Optional snapshotFile; // not set if it's an incremental read + VectorRef deltaFiles; + GranuleDeltas newDeltas; + Optional tenantPrefix; + + template + void serialize(Ar& ar) { + serializer(ar, keyRange, includedVersion, snapshotVersion, snapshotFile, deltaFiles, newDeltas, tenantPrefix); + } +}; + +struct BlobGranuleSummaryRef { + constexpr static FileIdentifier file_identifier = 9774587; + KeyRangeRef keyRange; + Version snapshotVersion; + int64_t snapshotSize; + Version deltaVersion; + int64_t deltaSize; + + template + void serialize(Ar& ar) { + serializer(ar, keyRange, snapshotVersion, snapshotSize, deltaVersion, deltaSize); + } +}; + +BlobGranuleSummaryRef summarizeGranuleChunk(Arena& ar, const BlobGranuleChunkRef& chunk); + +enum BlobGranuleSplitState { Unknown = 0, Initialized = 1, Assigned = 2, Done = 3 }; + +// Boundary metadata for each range indexed by the beginning of the range. +struct BlobGranuleMergeBoundary { + constexpr static FileIdentifier file_identifier = 557861; + + // Hard boundaries represent backing regions we want to keep separate. + bool buddy; + + template + void serialize(Ar& ar) { + serializer(ar, buddy); + } +}; + +struct BlobGranuleHistoryValue { + constexpr static FileIdentifier file_identifier = 991434; + UID granuleID; + VectorRef parentBoundaries; + VectorRef parentVersions; + + template + void serialize(Ar& ar) { + serializer(ar, granuleID, parentBoundaries, parentVersions); + } +}; + +struct GranuleHistory { + KeyRange range; + Version version; + Standalone value; + + GranuleHistory() {} + + GranuleHistory(KeyRange range, Version version, Standalone value) + : range(range), version(version), value(value) {} +}; + +// A manifest to assist full fdb restore from blob granule files +struct BlobManifestTailer { + constexpr static FileIdentifier file_identifier = 379431; + int64_t totalRows; + int64_t totalSegments; + int64_t totalBytes; + + template + void serialize(Ar& ar) { + serializer(ar, totalRows, totalSegments, totalBytes); + } +}; + +// Defines blob restore state +enum BlobRestorePhase { + INIT = 0, + STARTING_MIGRATOR = 1, + LOADING_MANIFEST = 2, + LOADED_MANIFEST = 3, + COPYING_DATA = 4, + APPLYING_MLOGS = 5, + DONE = 6, + ERROR = 7, + MAX = 8 +}; +struct BlobRestoreState { + constexpr static FileIdentifier file_identifier = 378657; + BlobRestorePhase phase; + int progress; + VectorRef phaseStartTs; + Optional error; + + BlobRestoreState() : phase(BlobRestorePhase::INIT), progress(0){}; + BlobRestoreState(BlobRestorePhase phase) : phase(phase), progress(0){}; + BlobRestoreState(BlobRestorePhase phase, int progress) : phase(phase), progress(progress){}; + BlobRestoreState(StringRef errorMessage) : phase(BlobRestorePhase::ERROR), progress(0), error(errorMessage){}; + + template + void serialize(Ar& ar) { + serializer(ar, phase, progress, phaseStartTs, error); + } +}; + +struct BlobRestoreArg { + constexpr static FileIdentifier file_identifier = 947689; + Optional version; + + BlobRestoreArg() {} + BlobRestoreArg(Optional v) : version(v){}; + + template + void serialize(Ar& ar) { + serializer(ar, version); + } +}; + +// Value of blob range change log. +struct BlobRangeChangeLogRef { + constexpr static FileIdentifier file_identifier = 9774587; + + KeyRangeRef range; + ValueRef value; + + BlobRangeChangeLogRef() {} + BlobRangeChangeLogRef(KeyRangeRef range, ValueRef value) : range(range), value(value) {} + BlobRangeChangeLogRef(Arena& to, KeyRangeRef range, ValueRef value) : range(to, range), value(to, value) {} + BlobRangeChangeLogRef(Arena& to, const BlobRangeChangeLogRef& from) + : range(to, from.range), value(to, from.value) {} + + int expectedSize() const { return range.expectedSize() + value.expectedSize(); } + + template + void serialize(Ar& ar) { + serializer(ar, range, value); + } +}; + +#endif diff --git a/src/fdbclient/include/fdbclient/BlobGranuleFiles.h b/src/fdbclient/include/fdbclient/BlobGranuleFiles.h new file mode 100644 index 0000000..6f70668 --- /dev/null +++ b/src/fdbclient/include/fdbclient/BlobGranuleFiles.h @@ -0,0 +1,73 @@ +/* + * BlobGranuleFiles.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBCLIENT_BLOBGRANULEFILES_H +#define FDBCLIENT_BLOBGRANULEFILES_H + +// This file contains functions for readers who want to materialize blob granules from the underlying files + +#include "fdbclient/BlobGranuleCommon.h" +#include "fdbclient/SystemData.h" +#include "flow/CompressionUtils.h" + +Value serializeChunkedSnapshot(const Standalone& fileNameRef, + const Standalone& snapshot, + int chunkSize, + Optional compressFilter, + Optional cipherKeysCtx = {}, + bool isSnapshotSorted = true); + +Value serializeChunkedDeltaFile(const Standalone& fileNameRef, + const Standalone& deltas, + const KeyRangeRef& fileRange, + int chunkSize, + Optional compressFilter, + Optional cipherKeysCtx = {}); + +ErrorOr loadAndMaterializeBlobGranules(const Standalone>& files, + const KeyRangeRef& keyRange, + Version beginVersion, + Version readVersion, + ReadBlobGranuleContext granuleContext, + GranuleMaterializeStats& stats); + +RangeResult materializeBlobGranule(const BlobGranuleChunkRef& chunk, + KeyRangeRef keyRange, + Version beginVersion, + Version readVersion, + Optional snapshotData, + const std::vector& deltaFileData, + GranuleMaterializeStats& stats); + +std::string randomBGFilename(UID blobWorkerID, UID granuleID, Version version, std::string suffix); + +// For benchmark testing only. It should never be called in prod. +void sortDeltasByKey(const Standalone& deltasByVersion, const KeyRangeRef& fileRange); + +// just for client passthrough. reads all key-value pairs from a snapshot file, and all mutations from a delta file +RangeResult bgReadSnapshotFile(const StringRef& data, + Optional tenantPrefix, + Optional encryptionCtx, + const KeyRangeRef& keys = normalKeys); +Standalone> bgReadDeltaFile(const StringRef& data, + Optional tenantPrefix, + Optional encryptionCtx); + +#endif diff --git a/src/fdbclient/BlobGranuleReader.actor.g.h b/src/fdbclient/include/fdbclient/BlobGranuleReader.actor.g.h similarity index 67% rename from src/fdbclient/BlobGranuleReader.actor.g.h rename to src/fdbclient/include/fdbclient/BlobGranuleReader.actor.g.h index 262c845..34ce9e9 100644 --- a/src/fdbclient/BlobGranuleReader.actor.g.h +++ b/src/fdbclient/include/fdbclient/BlobGranuleReader.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleReader.actor.h" /* * BlobGranuleReader.actor.h * @@ -31,6 +31,7 @@ #define BLOB_GRANULE_READER_CLIENT_H #include "fdbclient/BackupContainerFileSystem.h" +#include "fdbclient/BlobConnectionProvider.h" #include "fdbclient/BlobGranuleCommon.h" #include "fdbclient/BlobGranuleFiles.h" #include "fdbclient/BlobWorkerInterface.h" @@ -40,15 +41,17 @@ // Reads the fileset in the reply using the provided blob store, and filters data and mutations by key + version from // the request - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.h" -[[nodiscard]] Future readBlobGranule( BlobGranuleChunkRef const& chunk, KeyRangeRef const& keyRange, Version const& beginVersion, Version const& readVersion, Reference const& bstore, Optional const& stats = Optional() ); + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleReader.actor.g.h" +[[nodiscard]] Future readBlobGranule( BlobGranuleChunkRef const& chunk, KeyRangeRef const& keyRange, Version const& beginVersion, Version const& readVersion, Reference const& bstore, Optional const& stats = Optional() ); -#line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.h" +#line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleReader.actor.h" - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.g.h" -[[nodiscard]] Future readBlobGranules( BlobGranuleFileRequest const& request, BlobGranuleFileReply const& reply, Reference const& bstore, PromiseStream const& results ); + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleReader.actor.g.h" +[[nodiscard]] Future readBlobGranules( BlobGranuleFileRequest const& request, BlobGranuleFileReply const& reply, Reference const& bstore, PromiseStream const& results ); -#line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/BlobGranuleReader.actor.h" +#line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleReader.actor.h" + +bool isRangeFullyCovered(KeyRange range, Standalone> blobChunks); #include "flow/unactorcompiler.h" #endif diff --git a/src/fdbclient/BlobGranuleReader.actor.h b/src/fdbclient/include/fdbclient/BlobGranuleReader.actor.h similarity index 87% rename from src/fdbclient/BlobGranuleReader.actor.h rename to src/fdbclient/include/fdbclient/BlobGranuleReader.actor.h index 958dc81..395b76b 100644 --- a/src/fdbclient/BlobGranuleReader.actor.h +++ b/src/fdbclient/include/fdbclient/BlobGranuleReader.actor.h @@ -29,6 +29,7 @@ #define BLOB_GRANULE_READER_CLIENT_H #include "fdbclient/BackupContainerFileSystem.h" +#include "fdbclient/BlobConnectionProvider.h" #include "fdbclient/BlobGranuleCommon.h" #include "fdbclient/BlobGranuleFiles.h" #include "fdbclient/BlobWorkerInterface.h" @@ -42,13 +43,15 @@ ACTOR Future readBlobGranule(BlobGranuleChunkRef chunk, KeyRangeRef keyRange, Version beginVersion, Version readVersion, - Reference bstore, + Reference bstore, Optional stats = Optional()); ACTOR Future readBlobGranules(BlobGranuleFileRequest request, BlobGranuleFileReply reply, - Reference bstore, + Reference bstore, PromiseStream results); +bool isRangeFullyCovered(KeyRange range, Standalone> blobChunks); + #include "flow/unactorcompiler.h" #endif diff --git a/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h b/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h new file mode 100644 index 0000000..3ecd3cc --- /dev/null +++ b/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h @@ -0,0 +1,1153 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" +/* + * BlobGranuleRequest.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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(FDBCLIENT_BLOB_GRANULE_REQUEST_ACTOR_G_H) +#define FDBCLIENT_BLOB_GRANULE_REQUEST_ACTOR_G_H +#include "fdbclient/BlobGranuleRequest.actor.g.h" +#elif !defined(FDBCLIENT_BLOB_GRANULE_REQUEST_ACTOR_H) +#define FDBCLIENT_BLOB_GRANULE_REQUEST_ACTOR_H + +#include "flow/flow.h" +#include "flow/Knobs.h" + +// #include "fdbclient/NativeAPI.actor.h" +#include "flow/Arena.h" +#include "fdbclient/DatabaseContext.h" +#include "fdbclient/BlobWorkerInterface.h" + +#include "flow/actorcompiler.h" // This must be the last #include. + +#define BGR_DEBUG false + + #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" +namespace { +// This generated class is to be used only via txnDoBlobGranuleRequests() + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" +template + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" +class TxnDoBlobGranuleRequestsActorState { + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" +public: + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + TxnDoBlobGranuleRequestsActorState(Transaction* const& tr,Key* const& beginKey,Key const& endKey,Request const& request,RequestStream BlobWorkerInterface::* const& channel) + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + : tr(tr), + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + beginKey(beginKey), + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + endKey(endKey), + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + request(request), + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + channel(channel) + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + fdb_probe_actor_create("txnDoBlobGranuleRequests", reinterpret_cast(this)); + + } + ~TxnDoBlobGranuleRequestsActorState() + { + fdb_probe_actor_destroy("txnDoBlobGranuleRequests", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + StrictFuture __when_expr_0 = krmGetRanges( tr, blobGranuleMappingKeys.begin, KeyRangeRef(*beginKey, endKey), 64, GetRangeLimits::BYTE_LIMIT_UNLIMITED); + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~TxnDoBlobGranuleRequestsActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + i = 0; + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + requests = std::vector>>(); + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + results = Standalone>(); + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + ; + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + loopDepth = a_body1cont1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1when1(RangeResult const& __blobGranuleMapping,int loopDepth) + { + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + blobGranuleMapping = __blobGranuleMapping; + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(RangeResult && __blobGranuleMapping,int loopDepth) + { + blobGranuleMapping = std::move(__blobGranuleMapping); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TxnDoBlobGranuleRequestsActor, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< TxnDoBlobGranuleRequestsActor, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("txnDoBlobGranuleRequests", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("txnDoBlobGranuleRequests", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< TxnDoBlobGranuleRequestsActor, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("txnDoBlobGranuleRequests", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("txnDoBlobGranuleRequests", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< TxnDoBlobGranuleRequestsActor, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("txnDoBlobGranuleRequests", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("txnDoBlobGranuleRequests", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + j = 0; + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + ; + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + loopDepth = a_body1cont2loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1(int loopDepth) + { + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (!(i < blobGranuleMapping.size() - 1)) + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (!blobGranuleMapping[i].value.size()) + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (BGR_DEBUG) + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + fmt::print("ERROR: No valid granule data for range [{0} - {1}) \n", blobGranuleMapping[i].key.printable(), blobGranuleMapping[i + 1].key.printable()); + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + return a_body1Catch1(blob_granule_transaction_too_old(), std::max(0, loopDepth - 1)); + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + workerId = decodeBlobGranuleMappingValue(blobGranuleMapping[i].value); + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (workerId == UID()) + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (BGR_DEBUG) + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + fmt::print("ERROR: Invalid Blob Worker ID for range [{0} - {1}) \n", blobGranuleMapping[i].key.printable(), blobGranuleMapping[i + 1].key.printable()); + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + return a_body1Catch1(blob_granule_transaction_too_old(), std::max(0, loopDepth - 1)); + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (!tr->trState->cx->blobWorker_interf.count(workerId)) + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + StrictFuture> __when_expr_1 = tr->get(blobWorkerListKeyFor(workerId)); + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1loopBody1cont1(loopDepth); + } + + return loopDepth; + } + int a_body1cont1break1(int loopDepth) + { + try { + return a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1loopBody1cont1(int loopDepth) + { + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (BGR_DEBUG) + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + fmt::print("Requesting range [{0} - {1}) from worker {2}!\n", blobGranuleMapping[i].key.printable(), blobGranuleMapping[i + 1].key.printable(), workerId.toString().substr(0, 5)); + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + KeyRangeRef range(blobGranuleMapping[i].key, blobGranuleMapping[i + 1].key); + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + request.reply.reset(); + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + request.setRange(range); + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + BlobWorkerInterface bwi = tr->trState->cx->blobWorker_interf[workerId]; + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + RequestStream const* stream = &(bwi.*channel); + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + Future> response = stream->tryGetReply(request); + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + requests.push_back(response); + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + i++; + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1cont7(Optional const& workerInterface,int loopDepth) + { + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (workerInterface.present()) + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + tr->trState->cx->blobWorker_interf[workerId] = decodeBlobWorkerListValue(workerInterface.get()); + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + else + { + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (BGR_DEBUG) + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + fmt::print("ERROR: Worker for range [{1} - {2}) does not exist!\n", workerId.toString().substr(0, 5), blobGranuleMapping[i].key.printable(), blobGranuleMapping[i + 1].key.printable()); + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + return a_body1Catch1(blob_granule_request_failed(), std::max(0, loopDepth - 1)); + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + loopDepth = a_body1cont1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont7(Optional && workerInterface,int loopDepth) + { + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (workerInterface.present()) + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + tr->trState->cx->blobWorker_interf[workerId] = decodeBlobWorkerListValue(workerInterface.get()); + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + else + { + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (BGR_DEBUG) + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + fmt::print("ERROR: Worker for range [{1} - {2}) does not exist!\n", workerId.toString().substr(0, 5), blobGranuleMapping[i].key.printable(), blobGranuleMapping[i + 1].key.printable()); + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + return a_body1Catch1(blob_granule_request_failed(), std::max(0, loopDepth - 1)); + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + loopDepth = a_body1cont1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1when1(Optional const& workerInterface,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont7(workerInterface, loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1when1(Optional && workerInterface,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont7(std::move(workerInterface), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TxnDoBlobGranuleRequestsActor, 1, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< TxnDoBlobGranuleRequestsActor, 1, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("txnDoBlobGranuleRequests", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("txnDoBlobGranuleRequests", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< TxnDoBlobGranuleRequestsActor, 1, Optional >*,Optional && value) + { + fdb_probe_actor_enter("txnDoBlobGranuleRequests", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("txnDoBlobGranuleRequests", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< TxnDoBlobGranuleRequestsActor, 1, Optional >*,Error err) + { + fdb_probe_actor_enter("txnDoBlobGranuleRequests", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("txnDoBlobGranuleRequests", reinterpret_cast(this), 1); + + } + int a_body1cont3(int loopDepth) + { + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (i < blobGranuleMapping.size() - 1) + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + *beginKey = blobGranuleMapping[i].key; + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + return a_body1Catch1(blob_granule_request_failed(), loopDepth); + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + else + { + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (blobGranuleMapping.more) + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + *beginKey = blobGranuleMapping.back().key; + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + else + { + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + *beginKey = endKey; + #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + } + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~TxnDoBlobGranuleRequestsActorState(); static_cast(this)->destroy(); return 0; } + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO + this->~TxnDoBlobGranuleRequestsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont2loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1(int loopDepth) + { + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (!(j < requests.size())) + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break + } + try { + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + StrictFuture> __when_expr_2 = requests[j]; + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont2loopBody1Catch1(actor_cancelled(), loopDepth); + #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont2loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2loopBody1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont2loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont2loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2break1(int loopDepth) + { + try { + return a_body1cont3(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2loopBody1cont1(int loopDepth) + { + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + j++; + #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + if (loopDepth == 0) return a_body1cont2loopHead1(0); + + return loopDepth; + } + int a_body1cont2loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_request_maybe_delivered || e.code() == error_code_broken_promise || e.code() == error_code_connection_failed) + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + i = j; + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break + } + else + { + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (BGR_DEBUG) + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + fmt::print("ERROR: Error doing request for range [{0} - {1}): {2}!\n", blobGranuleMapping[j].key.printable(), blobGranuleMapping[j + 1].key.printable(), e.name()); + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont2loopBody1cont3(ErrorOr const& result,int loopDepth) + { + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (result.isError()) + #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + return a_body1cont2loopBody1Catch1(result.getError(), loopDepth); + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + results.push_back(results.arena(), result.get()); + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + loopDepth = a_body1cont2loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1cont3(ErrorOr && result,int loopDepth) + { + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (result.isError()) + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + return a_body1cont2loopBody1Catch1(result.getError(), loopDepth); + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + results.push_back(results.arena(), result.get()); + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + loopDepth = a_body1cont2loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1when1(ErrorOr const& result,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont3(result, loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1when1(ErrorOr && result,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont3(std::move(result), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TxnDoBlobGranuleRequestsActor, 2, ErrorOr >::remove(); + + } + void a_callback_fire(ActorCallback< TxnDoBlobGranuleRequestsActor, 2, ErrorOr >*,ErrorOr const& value) + { + fdb_probe_actor_enter("txnDoBlobGranuleRequests", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("txnDoBlobGranuleRequests", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< TxnDoBlobGranuleRequestsActor, 2, ErrorOr >*,ErrorOr && value) + { + fdb_probe_actor_enter("txnDoBlobGranuleRequests", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("txnDoBlobGranuleRequests", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< TxnDoBlobGranuleRequestsActor, 2, ErrorOr >*,Error err) + { + fdb_probe_actor_enter("txnDoBlobGranuleRequests", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont2loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont2loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("txnDoBlobGranuleRequests", reinterpret_cast(this), 2); + + } + int a_body1cont2loopBody1cont6(int loopDepth) + { + try { + loopDepth = a_body1cont2loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + Transaction* tr; + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + Key* beginKey; + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + Key endKey; + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + Request request; + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + RequestStream BlobWorkerInterface::* channel; + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + RangeResult blobGranuleMapping; + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + int i; + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + std::vector>> requests; + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + Standalone> results; + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + UID workerId; + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + int j; + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" +}; +// This generated class is to be used only via txnDoBlobGranuleRequests() + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" +template + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" +class TxnDoBlobGranuleRequestsActor final : public Actor>>, public ActorCallback< TxnDoBlobGranuleRequestsActor, 0, RangeResult >, public ActorCallback< TxnDoBlobGranuleRequestsActor, 1, Optional >, public ActorCallback< TxnDoBlobGranuleRequestsActor, 2, ErrorOr >, public FastAllocated>, public TxnDoBlobGranuleRequestsActorState> { + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< TxnDoBlobGranuleRequestsActor, 0, RangeResult >; +friend struct ActorCallback< TxnDoBlobGranuleRequestsActor, 1, Optional >; +friend struct ActorCallback< TxnDoBlobGranuleRequestsActor, 2, ErrorOr >; + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + TxnDoBlobGranuleRequestsActor(Transaction* const& tr,Key* const& beginKey,Key const& endKey,Request const& request,RequestStream BlobWorkerInterface::* const& channel) + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + : Actor>>(), + TxnDoBlobGranuleRequestsActorState>(tr, beginKey, endKey, request, channel) + { + fdb_probe_actor_enter("txnDoBlobGranuleRequests", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("txnDoBlobGranuleRequests"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("txnDoBlobGranuleRequests", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< TxnDoBlobGranuleRequestsActor, 0, RangeResult >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< TxnDoBlobGranuleRequestsActor, 1, Optional >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< TxnDoBlobGranuleRequestsActor, 2, ErrorOr >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" +template + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" +[[nodiscard]] Future>> txnDoBlobGranuleRequests( Transaction* const& tr, Key* const& beginKey, Key const& endKey, Request const& request, RequestStream BlobWorkerInterface::* const& channel ) { + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + return Future>>(new TxnDoBlobGranuleRequestsActor(tr, beginKey, endKey, request, channel)); + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" +} + +#line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + +// FIXME: port other request types to this function + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" +namespace { +// This generated class is to be used only via doBlobGranuleRequests() + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" +template + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" +class DoBlobGranuleRequestsActorState { + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" +public: + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + DoBlobGranuleRequestsActorState(Database const& cx,KeyRange const& range,Request const& request,RequestStream BlobWorkerInterface::* const& channel) + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + : cx(cx), + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + range(range), + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + request(request), + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + channel(channel), + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + beginKey(range.begin), + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + endKey(range.end), + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + tr(cx), + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + results() + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + fdb_probe_actor_create("doBlobGranuleRequests", reinterpret_cast(this)); + + } + ~DoBlobGranuleRequestsActorState() + { + fdb_probe_actor_destroy("doBlobGranuleRequests", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + ; + #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~DoBlobGranuleRequestsActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (beginKey >= endKey) + #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~DoBlobGranuleRequestsActorState(); static_cast(this)->destroy(); return 0; } + #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + new (&static_cast(this)->SAV< Standalone> >::value()) Standalone>(std::move(results)); // state_var_RVO + this->~DoBlobGranuleRequestsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + try { + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + StrictFuture>> __when_expr_0 = txnDoBlobGranuleRequests(&tr, &beginKey, endKey, request, channel); + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + StrictFuture __when_expr_1 = tr.onError(e); + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont3(Standalone> const& partialResults,int loopDepth) + { + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (!partialResults.empty()) + #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + results.arena().dependsOn(partialResults.arena()); + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + results.append(results.arena(), partialResults.begin(), partialResults.size()); + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + loopDepth = a_body1loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3(Standalone> && partialResults,int loopDepth) + { + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + if (!partialResults.empty()) + #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + { + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + results.arena().dependsOn(partialResults.arena()); + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + results.append(results.arena(), partialResults.begin(), partialResults.size()); + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + } + loopDepth = a_body1loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Standalone> const& partialResults,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(partialResults, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Standalone> && partialResults,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(partialResults), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoBlobGranuleRequestsActor, 0, Standalone> >::remove(); + + } + void a_callback_fire(ActorCallback< DoBlobGranuleRequestsActor, 0, Standalone> >*,Standalone> const& value) + { + fdb_probe_actor_enter("doBlobGranuleRequests", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doBlobGranuleRequests", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< DoBlobGranuleRequestsActor, 0, Standalone> >*,Standalone> && value) + { + fdb_probe_actor_enter("doBlobGranuleRequests", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doBlobGranuleRequests", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< DoBlobGranuleRequestsActor, 0, Standalone> >*,Error err) + { + fdb_probe_actor_enter("doBlobGranuleRequests", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doBlobGranuleRequests", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont6(int loopDepth) + { + try { + loopDepth = a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoBlobGranuleRequestsActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DoBlobGranuleRequestsActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("doBlobGranuleRequests", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doBlobGranuleRequests", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< DoBlobGranuleRequestsActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("doBlobGranuleRequests", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doBlobGranuleRequests", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< DoBlobGranuleRequestsActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("doBlobGranuleRequests", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doBlobGranuleRequests", reinterpret_cast(this), 1); + + } + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + Database cx; + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + KeyRange range; + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + Request request; + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + RequestStream BlobWorkerInterface::* channel; + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + Key beginKey; + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + Key endKey; + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + Transaction tr; + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + Standalone> results; + #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" +}; +// This generated class is to be used only via doBlobGranuleRequests() + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" +template + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" +class DoBlobGranuleRequestsActor final : public Actor>>, public ActorCallback< DoBlobGranuleRequestsActor, 0, Standalone> >, public ActorCallback< DoBlobGranuleRequestsActor, 1, Void >, public FastAllocated>, public DoBlobGranuleRequestsActorState> { + #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DoBlobGranuleRequestsActor, 0, Standalone> >; +friend struct ActorCallback< DoBlobGranuleRequestsActor, 1, Void >; + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + DoBlobGranuleRequestsActor(Database const& cx,KeyRange const& range,Request const& request,RequestStream BlobWorkerInterface::* const& channel) + #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" + : Actor>>(), + DoBlobGranuleRequestsActorState>(cx, range, request, channel) + { + fdb_probe_actor_enter("doBlobGranuleRequests", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("doBlobGranuleRequests"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("doBlobGranuleRequests", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DoBlobGranuleRequestsActor, 0, Standalone> >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DoBlobGranuleRequestsActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" +template + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" +[[nodiscard]] Future>> doBlobGranuleRequests( Database const& cx, KeyRange const& range, Request const& request, RequestStream BlobWorkerInterface::* const& channel ) { + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + return Future>>(new DoBlobGranuleRequestsActor(cx, range, request, channel)); + #line 1146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.g.h" +} + +#line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h" + +#include "flow/unactorcompiler.h" + +#endif \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h b/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h new file mode 100644 index 0000000..16a896e --- /dev/null +++ b/src/fdbclient/include/fdbclient/BlobGranuleRequest.actor.h @@ -0,0 +1,187 @@ +/* + * BlobGranuleRequest.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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(FDBCLIENT_BLOB_GRANULE_REQUEST_ACTOR_G_H) +#define FDBCLIENT_BLOB_GRANULE_REQUEST_ACTOR_G_H +#include "fdbclient/BlobGranuleRequest.actor.g.h" +#elif !defined(FDBCLIENT_BLOB_GRANULE_REQUEST_ACTOR_H) +#define FDBCLIENT_BLOB_GRANULE_REQUEST_ACTOR_H + +#include "flow/flow.h" +#include "flow/Knobs.h" + +// #include "fdbclient/NativeAPI.actor.h" +#include "flow/Arena.h" +#include "fdbclient/DatabaseContext.h" +#include "fdbclient/BlobWorkerInterface.h" + +#include "flow/actorcompiler.h" // This must be the last #include. + +#define BGR_DEBUG false + +ACTOR template +Future>> txnDoBlobGranuleRequests( + Transaction* tr, + Key* beginKey, + Key endKey, + Request request, + RequestStream BlobWorkerInterface::*channel) { + // TODO KNOB + state RangeResult blobGranuleMapping = wait(krmGetRanges( + tr, blobGranuleMappingKeys.begin, KeyRangeRef(*beginKey, endKey), 64, GetRangeLimits::BYTE_LIMIT_UNLIMITED)); + + state int i = 0; + state std::vector>> requests; + state Standalone> results; + + for (; i < blobGranuleMapping.size() - 1; i++) { + if (!blobGranuleMapping[i].value.size()) { + if (BGR_DEBUG) { + fmt::print("ERROR: No valid granule data for range [{0} - {1}) \n", + blobGranuleMapping[i].key.printable(), + blobGranuleMapping[i + 1].key.printable()); + } + // no granule for range + throw blob_granule_transaction_too_old(); + } + + state UID workerId = decodeBlobGranuleMappingValue(blobGranuleMapping[i].value); + if (workerId == UID()) { + if (BGR_DEBUG) { + fmt::print("ERROR: Invalid Blob Worker ID for range [{0} - {1}) \n", + blobGranuleMapping[i].key.printable(), + blobGranuleMapping[i + 1].key.printable()); + } + // no worker for granule + throw blob_granule_transaction_too_old(); + } + + if (!tr->trState->cx->blobWorker_interf.count(workerId)) { + Optional workerInterface = wait(tr->get(blobWorkerListKeyFor(workerId))); + // from the time the mapping was read from the db, the associated blob worker + // could have died and so its interface wouldn't be present as part of the blobWorkerList + // we persist in the db. + if (workerInterface.present()) { + tr->trState->cx->blobWorker_interf[workerId] = decodeBlobWorkerListValue(workerInterface.get()); + } else { + if (BGR_DEBUG) { + fmt::print("ERROR: Worker for range [{1} - {2}) does not exist!\n", + workerId.toString().substr(0, 5), + blobGranuleMapping[i].key.printable(), + blobGranuleMapping[i + 1].key.printable()); + } + // throw to force read version to increase and to retry reading mapping + throw blob_granule_request_failed(); + } + } + + if (BGR_DEBUG) { + fmt::print("Requesting range [{0} - {1}) from worker {2}!\n", + blobGranuleMapping[i].key.printable(), + blobGranuleMapping[i + 1].key.printable(), + workerId.toString().substr(0, 5)); + } + + KeyRangeRef range(blobGranuleMapping[i].key, blobGranuleMapping[i + 1].key); + request.reply.reset(); + request.setRange(range); + // TODO consolidate? + BlobWorkerInterface bwi = tr->trState->cx->blobWorker_interf[workerId]; + RequestStream const* stream = &(bwi.*channel); + Future> response = stream->tryGetReply(request); + requests.push_back(response); + } + // wait for each request. If it has an error, retry from there if it is a retriable error + state int j = 0; + for (; j < requests.size(); j++) { + try { + ErrorOr result = wait(requests[j]); + if (result.isError()) { + throw result.getError(); + } + results.push_back(results.arena(), result.get()); + } catch (Error& e) { + if (e.code() == error_code_wrong_shard_server || e.code() == error_code_request_maybe_delivered || + e.code() == error_code_broken_promise || e.code() == error_code_connection_failed) { + // re-read mapping and retry from failed req + i = j; + break; + } else { + if (BGR_DEBUG) { + fmt::print("ERROR: Error doing request for range [{0} - {1}): {2}!\n", + blobGranuleMapping[j].key.printable(), + blobGranuleMapping[j + 1].key.printable(), + e.name()); + } + throw; + } + } + } + if (i < blobGranuleMapping.size() - 1) { + // a request failed, retry from that point next time + *beginKey = blobGranuleMapping[i].key; + throw blob_granule_request_failed(); + } else if (blobGranuleMapping.more) { + *beginKey = blobGranuleMapping.back().key; + // no requests failed but there is more to read, continue reading + } else { + *beginKey = endKey; + } + return results; +} + +// FIXME: port other request types to this function +ACTOR template +Future>> doBlobGranuleRequests( + Database cx, + KeyRange range, + Request request, + RequestStream BlobWorkerInterface::*channel) { + state Key beginKey = range.begin; + state Key endKey = range.end; + state Transaction tr(cx); + state Standalone> results; + loop { + if (beginKey >= endKey) { + return results; + } + try { + tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + tr.setOption(FDBTransactionOptions::LOCK_AWARE); + Standalone> partialResults = + wait(txnDoBlobGranuleRequests(&tr, &beginKey, endKey, request, channel)); + if (!partialResults.empty()) { + results.arena().dependsOn(partialResults.arena()); + results.append(results.arena(), partialResults.begin(), partialResults.size()); + } + } catch (Error& e) { + wait(tr.onError(e)); + } + } +} + +#include "flow/unactorcompiler.h" + +#endif \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/BlobMetadataUtils.h b/src/fdbclient/include/fdbclient/BlobMetadataUtils.h new file mode 100644 index 0000000..3214c20 --- /dev/null +++ b/src/fdbclient/include/fdbclient/BlobMetadataUtils.h @@ -0,0 +1,89 @@ +/* + * BlobMetadataUtils.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef BLOB_METADATA_UTILS_H +#define BLOB_METADATA_UTILS_H + +#include "flow/Arena.h" +#include "flow/FileIdentifier.h" + +using BlobMetadataDomainId = int64_t; + +/* + * There are 3 cases for blob metadata. + * 1. A non-partitioned blob store. baseUrl is set, and partitions is empty. Files will be written with this prefix. + * 2. A sub-path partitioned blob store. baseUrl is set, and partitions contains 2 or more sub-paths. Files will be + * written with a prefix of the base url and then one of the sub-paths. + * 3. A separate-storage-location partitioned blob store. baseUrl is NOT set, and partitions contains 2 or more full + * fdb blob urls. Files will be written with one of the partition prefixes. + * Partitioning is desired in blob stores such as s3 that can run into metadata hotspotting issues. + */ +struct BlobMetadataDetailsRef { + constexpr static FileIdentifier file_identifier = 6685526; + BlobMetadataDomainId domainId; + Optional base; + VectorRef partitions; + + // cache options + double refreshAt; + double expireAt; + + BlobMetadataDetailsRef() {} + BlobMetadataDetailsRef(Arena& arena, const BlobMetadataDetailsRef& from) + : domainId(from.domainId), partitions(arena, from.partitions), refreshAt(from.refreshAt), + expireAt(from.expireAt) { + if (from.base.present()) { + base = StringRef(arena, from.base.get()); + } + } + + explicit BlobMetadataDetailsRef(Arena& ar, + BlobMetadataDomainId domainId, + Optional baseLocation, + VectorRef partitions, + double refreshAt, + double expireAt) + : domainId(domainId), partitions(ar, partitions), refreshAt(refreshAt), expireAt(expireAt) { + if (baseLocation.present()) { + base = StringRef(ar, baseLocation.get()); + } + } + + explicit BlobMetadataDetailsRef(BlobMetadataDomainId domainId, + Optional base, + VectorRef partitions, + double refreshAt, + double expireAt) + : domainId(domainId), base(base), partitions(partitions), refreshAt(refreshAt), expireAt(expireAt) {} + + int expectedSize() const { + return sizeof(BlobMetadataDetailsRef) + (base.present() ? base.get().size() : 0) + partitions.expectedSize(); + } + + template + void serialize(Ar& ar) { + serializer(ar, domainId, base, partitions, refreshAt, expireAt); + } +}; + +Standalone createRandomTestBlobMetadata(const std::string& baseUrl, + BlobMetadataDomainId domainId); + +#endif \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/BlobWorkerCommon.h b/src/fdbclient/include/fdbclient/BlobWorkerCommon.h new file mode 100644 index 0000000..d251577 --- /dev/null +++ b/src/fdbclient/include/fdbclient/BlobWorkerCommon.h @@ -0,0 +1,133 @@ +/* + * BlobWorkerCommon.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBCLIENT_BLOBWORKERCOMMON_H +#define FDBCLIENT_BLOBWORKERCOMMON_H + +#include "fdbrpc/Stats.h" + +struct BlobWorkerStats { + CounterCollection cc; + Counter s3PutReqs, s3GetReqs, s3DeleteReqs; + Counter deltaFilesWritten, snapshotFilesWritten; + Counter deltaBytesWritten, snapshotBytesWritten; + Counter bytesReadFromFDBForInitialSnapshot; + Counter bytesReadFromS3ForCompaction; + Counter rangeAssignmentRequests, readRequests, summaryReads; + Counter wrongShardServer; + Counter changeFeedInputBytes; + Counter readReqTotalFilesReturned; + Counter readReqDeltaBytesReturned; + Counter commitVersionChecks; + Counter granuleUpdateErrors; + Counter granuleRequestTimeouts; + Counter readRequestsWithBegin; + Counter readRequestsCollapsed; + Counter flushGranuleReqs; + Counter compressionBytesRaw; + Counter compressionBytesFinal; + Counter fullRejections; + Counter forceFlushCleanups; + Counter readDrivenCompactions; + Counter oldFeedSnapshots; + Counter blockInFlightSnapshots; + + int64_t numRangesAssigned; + int64_t mutationBytesBuffered; + int activeReadRequests; + // TODO: add gauge for granules blocking on old snapshots, once this guage is fixed + int granulesPendingSplitCheck; + Version minimumCFVersion; + Version cfVersionLag; + int notAtLatestChangeFeeds; + int64_t lastResidentMemory; + int64_t estimatedMaxResidentMemory; + + LatencySample snapshotBlobWriteLatencySample; + LatencySample deltaBlobWriteLatencySample; + LatencySample reSnapshotLatencySample; + LatencySample readLatencySample; + LatencySample deltaUpdateSample; + + Reference initialSnapshotLock; + Reference resnapshotBudget; + Reference deltaWritesBudget; + + Future logger; + + // Current stats maintained for a given blob worker process + explicit BlobWorkerStats(UID id, + double interval, + Reference initialSnapshotLock, + Reference resnapshotBudget, + Reference deltaWritesBudget, + double sampleLoggingInterval, + double fileOpLatencySketchAccuracy, + double requestLatencySketchAccuracy) + : cc("BlobWorkerStats", id.toString()), + + s3PutReqs("S3PutReqs", cc), s3GetReqs("S3GetReqs", cc), s3DeleteReqs("S3DeleteReqs", cc), + deltaFilesWritten("DeltaFilesWritten", cc), snapshotFilesWritten("SnapshotFilesWritten", cc), + deltaBytesWritten("DeltaBytesWritten", cc), snapshotBytesWritten("SnapshotBytesWritten", cc), + bytesReadFromFDBForInitialSnapshot("BytesReadFromFDBForInitialSnapshot", cc), + bytesReadFromS3ForCompaction("BytesReadFromS3ForCompaction", cc), + rangeAssignmentRequests("RangeAssignmentRequests", cc), readRequests("ReadRequests", cc), + summaryReads("SummaryReads", cc), wrongShardServer("WrongShardServer", cc), + changeFeedInputBytes("ChangeFeedInputBytes", cc), readReqTotalFilesReturned("ReadReqTotalFilesReturned", cc), + readReqDeltaBytesReturned("ReadReqDeltaBytesReturned", cc), commitVersionChecks("CommitVersionChecks", cc), + granuleUpdateErrors("GranuleUpdateErrors", cc), granuleRequestTimeouts("GranuleRequestTimeouts", cc), + readRequestsWithBegin("ReadRequestsWithBegin", cc), readRequestsCollapsed("ReadRequestsCollapsed", cc), + flushGranuleReqs("FlushGranuleReqs", cc), compressionBytesRaw("CompressionBytesRaw", cc), + compressionBytesFinal("CompressionBytesFinal", cc), fullRejections("FullRejections", cc), + forceFlushCleanups("ForceFlushCleanups", cc), readDrivenCompactions("ReadDrivenCompactions", cc), + oldFeedSnapshots("OldFeedSnapshots", cc), blockInFlightSnapshots("BlockInFlightSnapshots", cc), + numRangesAssigned(0), mutationBytesBuffered(0), activeReadRequests(0), granulesPendingSplitCheck(0), + minimumCFVersion(0), cfVersionLag(0), notAtLatestChangeFeeds(0), lastResidentMemory(0), + snapshotBlobWriteLatencySample("SnapshotBlobWriteMetrics", + id, + sampleLoggingInterval, + fileOpLatencySketchAccuracy), + deltaBlobWriteLatencySample("DeltaBlobWriteMetrics", id, sampleLoggingInterval, fileOpLatencySketchAccuracy), + reSnapshotLatencySample("GranuleResnapshotMetrics", id, sampleLoggingInterval, fileOpLatencySketchAccuracy), + readLatencySample("GranuleReadLatencyMetrics", id, sampleLoggingInterval, requestLatencySketchAccuracy), + deltaUpdateSample("DeltaUpdateMetrics", id, sampleLoggingInterval, fileOpLatencySketchAccuracy), + estimatedMaxResidentMemory(0), initialSnapshotLock(initialSnapshotLock), resnapshotBudget(resnapshotBudget), + deltaWritesBudget(deltaWritesBudget) { + specialCounter(cc, "NumRangesAssigned", [this]() { return this->numRangesAssigned; }); + specialCounter(cc, "MutationBytesBuffered", [this]() { return this->mutationBytesBuffered; }); + specialCounter(cc, "ActiveReadRequests", [this]() { return this->activeReadRequests; }); + specialCounter(cc, "GranulesPendingSplitCheck", [this]() { return this->granulesPendingSplitCheck; }); + specialCounter(cc, "MinimumChangeFeedVersion", [this]() { return this->minimumCFVersion; }); + specialCounter(cc, "CFVersionLag", [this]() { return this->cfVersionLag; }); + specialCounter(cc, "NotAtLatestChangeFeeds", [this]() { return this->notAtLatestChangeFeeds; }); + specialCounter(cc, "LastResidentMemory", [this]() { return this->lastResidentMemory; }); + specialCounter(cc, "EstimatedMaxResidentMemory", [this]() { return this->estimatedMaxResidentMemory; }); + specialCounter(cc, "InitialSnapshotsActive", [this]() { return this->initialSnapshotLock->activePermits(); }); + specialCounter(cc, "InitialSnapshotsWaiting", [this]() { return this->initialSnapshotLock->waiters(); }); + specialCounter(cc, "ReSnapshotBytesActive", [this]() { return this->resnapshotBudget->activePermits(); }); + specialCounter(cc, "ReSnapshotBytesWaiting", [this]() { return this->resnapshotBudget->waiters(); }); + specialCounter(cc, "DeltaFileWriteBytesActive", [this]() { return this->deltaWritesBudget->activePermits(); }); + specialCounter(cc, "DeltaFileWriteBytesWaiting", [this]() { return this->deltaWritesBudget->waiters(); }); + + logger = cc.traceCounters("BlobWorkerMetrics", id, interval, "BlobWorkerMetrics"); + } +}; + +#endif diff --git a/src/fdbclient/BlobWorkerInterface.h b/src/fdbclient/include/fdbclient/BlobWorkerInterface.h similarity index 69% rename from src/fdbclient/BlobWorkerInterface.h rename to src/fdbclient/include/fdbclient/BlobWorkerInterface.h index 72d740f..5b2290a 100644 --- a/src/fdbclient/BlobWorkerInterface.h +++ b/src/fdbclient/include/fdbclient/BlobWorkerInterface.h @@ -26,17 +26,20 @@ #include "fdbclient/FDBTypes.h" #include "fdbrpc/fdbrpc.h" #include "fdbrpc/Locality.h" +#include "fdbrpc/TenantInfo.h" +#include "fdbrpc/TimedRequest.h" struct BlobWorkerInterface { constexpr static FileIdentifier file_identifier = 8358753; - // TODO: mimic what StorageServerInterface does with sequential endpoint IDs RequestStream> waitFailure; - RequestStream blobGranuleFileRequest; + PublicRequestStream blobGranuleFileRequest; RequestStream assignBlobRangeRequest; RequestStream revokeBlobRangeRequest; RequestStream granuleAssignmentsRequest; RequestStream granuleStatusStreamRequest; RequestStream haltBlobWorker; + RequestStream flushGranuleRequest; + RequestStream minBlobVersionRequest; struct LocalityData locality; UID myId; @@ -54,6 +57,8 @@ struct BlobWorkerInterface { streams.push_back(granuleAssignmentsRequest.getReceiver()); streams.push_back(granuleStatusStreamRequest.getReceiver()); streams.push_back(haltBlobWorker.getReceiver()); + streams.push_back(flushGranuleRequest.getReceiver()); + streams.push_back(minBlobVersionRequest.getReceiver()); FlowTransport::transport().addEndpoints(streams); } UID id() const { return myId; } @@ -69,7 +74,7 @@ struct BlobWorkerInterface { serializer(ar, myId, locality, waitFailure); if (Archive::isDeserializing) { blobGranuleFileRequest = - RequestStream(waitFailure.getEndpoint().getAdjustedEndpoint(1)); + PublicRequestStream(waitFailure.getEndpoint().getAdjustedEndpoint(1)); assignBlobRangeRequest = RequestStream(waitFailure.getEndpoint().getAdjustedEndpoint(2)); revokeBlobRangeRequest = @@ -80,6 +85,10 @@ struct BlobWorkerInterface { RequestStream(waitFailure.getEndpoint().getAdjustedEndpoint(5)); haltBlobWorker = RequestStream(waitFailure.getEndpoint().getAdjustedEndpoint(6)); + flushGranuleRequest = + RequestStream(waitFailure.getEndpoint().getAdjustedEndpoint(7)); + minBlobVersionRequest = + RequestStream(waitFailure.getEndpoint().getAdjustedEndpoint(8)); } } }; @@ -97,20 +106,24 @@ struct BlobGranuleFileReply { // TODO could do a reply promise stream of file mutations to bound memory requirements? // Have to load whole snapshot file into memory though so it doesn't actually matter too much -struct BlobGranuleFileRequest { +struct BlobGranuleFileRequest : TimedRequest { constexpr static FileIdentifier file_identifier = 4150141; Arena arena; KeyRangeRef keyRange; Version beginVersion = 0; Version readVersion; bool canCollapseBegin = true; + TenantInfo tenantInfo; + bool summarize = false; ReplyPromise reply; BlobGranuleFileRequest() {} + bool verify() const { return tenantInfo.isAuthorized(); } + template void serialize(Ar& ar) { - serializer(ar, keyRange, beginVersion, readVersion, canCollapseBegin, reply, arena); + serializer(ar, keyRange, beginVersion, readVersion, canCollapseBegin, tenantInfo, summarize, reply, arena); } }; @@ -131,6 +144,28 @@ struct RevokeBlobRangeRequest { } }; +struct MinBlobVersionReply { + constexpr static FileIdentifier file_identifier = 6857512; + Version version; + + template + void serialize(Ar& ar) { + serializer(ar, version); + } +}; + +struct MinBlobVersionRequest { + constexpr static FileIdentifier file_identifier = 4833278; + Version grv; + ReplyPromise reply; + + MinBlobVersionRequest() {} + + template + void serialize(Ar& ar) { + serializer(ar, grv, reply); + } +}; /* * Continue: Blob worker should continue handling a granule that was evaluated for a split * Normal: Blob worker should open the granule and start processing it @@ -166,23 +201,39 @@ struct GranuleStatusReply : public ReplyPromiseStreamReply { KeyRange granuleRange; bool doSplit; bool writeHotSplit; - int64_t epoch; - int64_t seqno; + bool initialSplitTooBig; + int64_t continueEpoch; + int64_t continueSeqno; UID granuleID; Version startVersion; + Version blockedVersion; + bool mergeCandidate; + int64_t originalEpoch; + int64_t originalSeqno; + Optional proposedSplitKey; GranuleStatusReply() {} explicit GranuleStatusReply(KeyRange range, bool doSplit, bool writeHotSplit, - int64_t epoch, - int64_t seqno, + bool initialSplitTooBig, + int64_t continueEpoch, + int64_t continueSeqno, UID granuleID, - Version startVersion) - : granuleRange(range), doSplit(doSplit), writeHotSplit(writeHotSplit), epoch(epoch), seqno(seqno), - granuleID(granuleID), startVersion(startVersion) {} - - int expectedSize() const { return sizeof(GranuleStatusReply) + granuleRange.expectedSize(); } + Version startVersion, + Version blockedVersion, + bool mergeCandidate, + int64_t originalEpoch, + int64_t originalSeqno) + : granuleRange(range), doSplit(doSplit), writeHotSplit(writeHotSplit), initialSplitTooBig(initialSplitTooBig), + continueEpoch(continueEpoch), continueSeqno(continueSeqno), granuleID(granuleID), startVersion(startVersion), + blockedVersion(blockedVersion), mergeCandidate(mergeCandidate), originalEpoch(originalEpoch), + originalSeqno(originalSeqno) {} + + int expectedSize() const { + return sizeof(GranuleStatusReply) + granuleRange.expectedSize() + + (proposedSplitKey.present() ? proposedSplitKey.get().expectedSize() : 0); + } template void serialize(Ar& ar) { @@ -192,10 +243,16 @@ struct GranuleStatusReply : public ReplyPromiseStreamReply { granuleRange, doSplit, writeHotSplit, - epoch, - seqno, + initialSplitTooBig, + continueEpoch, + continueSeqno, granuleID, - startVersion); + startVersion, + blockedVersion, + mergeCandidate, + originalEpoch, + originalSeqno, + proposedSplitKey); } }; @@ -270,4 +327,25 @@ struct GetGranuleAssignmentsRequest { } }; +struct FlushGranuleRequest { + constexpr static FileIdentifier file_identifier = 5855784; + int64_t managerEpoch; + KeyRange granuleRange; + Version flushVersion; + bool compactAfter; + ReplyPromise reply; + + FlushGranuleRequest() : managerEpoch(-1), flushVersion(invalidVersion), compactAfter(false) {} + explicit FlushGranuleRequest(int64_t managerEpoch, KeyRange granuleRange, Version flushVersion, bool compactAfter) + : managerEpoch(managerEpoch), granuleRange(granuleRange), flushVersion(flushVersion), compactAfter(compactAfter) { + } + + void setRange(const KeyRangeRef& range) { granuleRange = range; } + + template + void serialize(Ar& ar) { + serializer(ar, managerEpoch, granuleRange, flushVersion, compactAfter, reply); + } +}; + #endif diff --git a/src/fdbclient/include/fdbclient/BuildIdempotencyIdMutations.h b/src/fdbclient/include/fdbclient/BuildIdempotencyIdMutations.h new file mode 100644 index 0000000..e8617ff --- /dev/null +++ b/src/fdbclient/include/fdbclient/BuildIdempotencyIdMutations.h @@ -0,0 +1,58 @@ +/* + * BuildIdempotencyIdMutations.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBCLIENT_BUILD_IDEMPOTENCY_ID_MUTATIONS_H +#define FDBCLIENT_BUILD_IDEMPOTENCY_ID_MUTATIONS_H + +#include "fdbclient/CommitProxyInterface.h" +#include "fdbclient/IdempotencyId.actor.h" + +#pragma once + +// Iterate through trs looking for idempotency ids for committed transactions. Call onKvReady for each constructed key +// value pair. +template +void buildIdempotencyIdMutations(const std::vector& trs, + IdempotencyIdKVBuilder& idempotencyKVBuilder, + Version commitVersion, + const std::vector& committed, + uint8_t committedValue, + bool locked, + const OnKVReady& onKvReady) { + idempotencyKVBuilder.setCommitVersion(commitVersion); + for (int h = 0; h < trs.size(); h += 256) { + int end = std::min(trs.size() - h, 256); + for (int l = 0; l < end; ++l) { + uint16_t batchIndex = h + l; + if ((committed[batchIndex] == committedValue && (!locked || trs[batchIndex].isLockAware()))) { + const auto& idempotency_id = trs[batchIndex].idempotencyId; + if (idempotency_id.valid()) { + idempotencyKVBuilder.add(idempotency_id, batchIndex); + } + } + } + Optional kv = idempotencyKVBuilder.buildAndClear(); + if (kv.present()) { + onKvReady(kv.get()); + } + } +} + +#endif \ No newline at end of file diff --git a/src/fdbclient/ClientBooleanParams.h b/src/fdbclient/include/fdbclient/ClientBooleanParams.h similarity index 70% rename from src/fdbclient/ClientBooleanParams.h rename to src/fdbclient/include/fdbclient/ClientBooleanParams.h index 7cf86b8..d20df28 100644 --- a/src/fdbclient/ClientBooleanParams.h +++ b/src/fdbclient/include/fdbclient/ClientBooleanParams.h @@ -22,11 +22,11 @@ #include "flow/BooleanParam.h" -FDB_DECLARE_BOOLEAN_PARAM(EnableLocalityLoadBalance); -FDB_DECLARE_BOOLEAN_PARAM(LockAware); -FDB_DECLARE_BOOLEAN_PARAM(Reverse); -FDB_DECLARE_BOOLEAN_PARAM(Snapshot); -FDB_DECLARE_BOOLEAN_PARAM(IsInternal); -FDB_DECLARE_BOOLEAN_PARAM(AddConflictRange); -FDB_DECLARE_BOOLEAN_PARAM(UseMetrics); -FDB_DECLARE_BOOLEAN_PARAM(IsSwitchable); +FDB_BOOLEAN_PARAM(EnableLocalityLoadBalance); +FDB_BOOLEAN_PARAM(LockAware); +FDB_BOOLEAN_PARAM(Reverse); +FDB_BOOLEAN_PARAM(Snapshot); +FDB_BOOLEAN_PARAM(IsInternal); +FDB_BOOLEAN_PARAM(AddConflictRange); +FDB_BOOLEAN_PARAM(UseMetrics); +FDB_BOOLEAN_PARAM(IsSwitchable); diff --git a/src/fdbclient/ClientKnobCollection.h b/src/fdbclient/include/fdbclient/ClientKnobCollection.h similarity index 100% rename from src/fdbclient/ClientKnobCollection.h rename to src/fdbclient/include/fdbclient/ClientKnobCollection.h diff --git a/src/fdbclient/ClientKnobs.h b/src/fdbclient/include/fdbclient/ClientKnobs.h similarity index 76% rename from src/fdbclient/ClientKnobs.h rename to src/fdbclient/include/fdbclient/ClientKnobs.h index aa00197..c4846ab 100644 --- a/src/fdbclient/ClientKnobs.h +++ b/src/fdbclient/include/fdbclient/ClientKnobs.h @@ -26,8 +26,8 @@ #include "flow/Knobs.h" #include "flow/flow.h" -FDB_DECLARE_BOOLEAN_PARAM(Randomize); -FDB_DECLARE_BOOLEAN_PARAM(IsSimulated); +FDB_BOOLEAN_PARAM(Randomize); +FDB_BOOLEAN_PARAM(IsSimulated); class ClientKnobs : public KnobsImpl { public: @@ -39,10 +39,6 @@ class ClientKnobs : public KnobsImpl { double FAILURE_MAX_DELAY; double FAILURE_MIN_DELAY; - double FAILURE_TIMEOUT_DELAY; - double CLIENT_FAILURE_TIMEOUT_DELAY; - double FAILURE_EMERGENCY_DELAY; - double FAILURE_MAX_GENERATIONS; double RECOVERY_DELAY_START_GENERATION; double RECOVERY_DELAY_SECONDS_PER_GENERATION; double MAX_GENERATIONS; @@ -82,7 +78,11 @@ class ClientKnobs : public KnobsImpl { int64_t CHANGE_FEED_CACHE_SIZE; double CHANGE_FEED_POP_TIMEOUT; int64_t CHANGE_FEED_STREAM_MIN_BYTES; - int64_t TENANT_PREFIX_SIZE_LIMIT; + double CHANGE_FEED_START_INTERVAL; + bool CHANGE_FEED_COALESCE_LOCATIONS; + int64_t CHANGE_FEED_CACHE_FLUSH_BYTES; + double CHANGE_FEED_CACHE_EXPIRE_TIME; + int64_t CHANGE_FEED_CACHE_LIMIT_BYTES; int MAX_BATCH_SIZE; double GRV_BATCH_TIMEOUT; @@ -94,8 +94,6 @@ class ClientKnobs : public KnobsImpl { int LOCATION_CACHE_EVICTION_SIZE_SIM; double LOCATION_CACHE_ENDPOINT_FAILURE_GRACE_PERIOD; double LOCATION_CACHE_FAILED_ENDPOINT_RETRY_INTERVAL; - int TENANT_CACHE_EVICTION_SIZE; - int TENANT_CACHE_EVICTION_SIZE_SIM; int GET_RANGE_SHARD_LIMIT; int WARM_RANGE_SHARD_LIMIT; @@ -163,10 +161,8 @@ class ClientKnobs : public KnobsImpl { double BACKUP_AGGREGATE_POLL_RATE; double BACKUP_AGGREGATE_POLL_RATE_UPDATE_INTERVAL; int BACKUP_LOG_WRITE_BATCH_MAX_SIZE; - int BACKUP_LOG_ATOMIC_OPS_SIZE; int BACKUP_MAX_LOG_RANGES; int BACKUP_SIM_COPY_LOG_RANGES; - int BACKUP_OPERATION_COST_OVERHEAD; int BACKUP_VERSION_DELAY; int BACKUP_MAP_KEY_LOWER_LIMIT; int BACKUP_MAP_KEY_UPPER_LIMIT; @@ -197,17 +193,22 @@ class ClientKnobs : public KnobsImpl { double BACKUP_STATUS_JITTER; double MIN_CLEANUP_SECONDS; int64_t FASTRESTORE_ATOMICOP_WEIGHT; // workload amplication factor for atomic op - bool BACKUP_AGENT_VERBOSE_LOGGING; + int RESTORE_RANGES_READ_BATCH; + int BLOB_GRANULE_RESTORE_CHECK_INTERVAL; + bool BACKUP_CONTAINER_LOCAL_ALLOW_RELATIVE_PATH; // Configuration int32_t DEFAULT_AUTO_COMMIT_PROXIES; int32_t DEFAULT_AUTO_GRV_PROXIES; int32_t DEFAULT_COMMIT_GRV_PROXIES_RATIO; int32_t DEFAULT_MAX_GRV_PROXIES; - bool UNLINKONLOAD_FDBCLIB; int32_t DEFAULT_AUTO_RESOLVERS; int32_t DEFAULT_AUTO_LOGS; + double GLOBAL_CONFIG_REFRESH_BACKOFF; + double GLOBAL_CONFIG_REFRESH_MAX_BACKOFF; + double GLOBAL_CONFIG_REFRESH_TIMEOUT; + // Dynamic Knobs double COMMIT_QUORUM_TIMEOUT; double GET_GENERATION_QUORUM_TIMEOUT; @@ -220,7 +221,6 @@ class ClientKnobs : public KnobsImpl { double CSI_STATUS_DELAY; bool HTTP_REQUEST_AWS_V4_HEADER; // setting this knob to true will enable AWS V4 style header. - bool HTTP_RESPONSE_SKIP_VERIFY_CHECKSUM_FOR_PARTIAL_CONTENT; // skip verify md5 checksum for 206 response std::string BLOBSTORE_ENCRYPTION_TYPE; int BLOBSTORE_CONNECT_TRIES; int BLOBSTORE_CONNECT_TIMEOUT; @@ -239,11 +239,17 @@ class ClientKnobs : public KnobsImpl { int BLOBSTORE_CONCURRENT_LISTS; int BLOBSTORE_CONCURRENT_WRITES_PER_FILE; int BLOBSTORE_CONCURRENT_READS_PER_FILE; + int BLOBSTORE_ENABLE_READ_CACHE; int BLOBSTORE_READ_BLOCK_SIZE; int BLOBSTORE_READ_AHEAD_BLOCKS; int BLOBSTORE_READ_CACHE_BLOCKS_PER_FILE; int BLOBSTORE_MAX_SEND_BYTES_PER_SECOND; int BLOBSTORE_MAX_RECV_BYTES_PER_SECOND; + bool BLOBSTORE_GLOBAL_CONNECTION_POOL; + bool BLOBSTORE_ENABLE_LOGGING; + double BLOBSTORE_STATS_LOGGING_INTERVAL; + double BLOBSTORE_LATENCY_LOGGING_INTERVAL; + double BLOBSTORE_LATENCY_LOGGING_ACCURACY; int CONSISTENCY_CHECK_RATE_LIMIT_MAX; int CONSISTENCY_CHECK_ONE_ROUND_TARGET_COMPLETION_TIME; @@ -259,23 +265,61 @@ class ClientKnobs : public KnobsImpl { int MAX_TRANSACTION_TAG_LENGTH; int MAX_TAGS_PER_TRANSACTION; int COMMIT_SAMPLE_COST; // The expectation of sampling is every COMMIT_SAMPLE_COST sample once - int WRITE_COST_BYTE_FACTOR; int INCOMPLETE_SHARD_PLUS; // The size of (possible) incomplete shard when estimate clear range double READ_TAG_SAMPLE_RATE; // Communicated to clients from cluster double TAG_THROTTLE_SMOOTHING_WINDOW; double TAG_THROTTLE_RECHECK_INTERVAL; double TAG_THROTTLE_EXPIRATION_INTERVAL; + int64_t TAG_THROTTLING_PAGE_SIZE; // Used to round up the cost of operations + // Cost multiplier for writes (because write operations are more expensive than reads): + double GLOBAL_TAG_THROTTLING_RW_FUNGIBILITY_RATIO; + // Maximum duration that a transaction can be tag throttled by proxy before being rejected + double PROXY_MAX_TAG_THROTTLE_DURATION; // busyness reporting double BUSYNESS_SPIKE_START_THRESHOLD; double BUSYNESS_SPIKE_SATURATED_THRESHOLD; - // multi-version client control - int MVC_CLIENTLIB_CHUNK_SIZE; - int MVC_CLIENTLIB_CHUNKS_PER_TRANSACTION; - // Blob Granules int BG_MAX_GRANULE_PARALLELISM; + int BG_TOO_MANY_GRANULES; + int64_t BLOB_METADATA_REFRESH_INTERVAL; + bool ENABLE_BLOB_GRANULE_FILE_LOGICAL_SIZE; + + // The coordinator key/value in storage server might be inconsistent to the value stored in the cluster file. + // This might happen when a recovery is happening together with a cluster controller coordinator key change. + // During this process the database will be marked as "bad state" in changeQuorumChecker while later it will be + // available again. Using a backoffed retry when it happens. + int CHANGE_QUORUM_BAD_STATE_RETRY_TIMES; + double CHANGE_QUORUM_BAD_STATE_RETRY_DELAY; + + // Tenants and Metacluster + int MAX_TENANTS_PER_CLUSTER; + int TENANT_TOMBSTONE_CLEANUP_INTERVAL; + int MAX_DATA_CLUSTERS; + int REMOVE_CLUSTER_TENANT_BATCH_SIZE; + int METACLUSTER_ASSIGNMENT_CLUSTERS_TO_CHECK; + double METACLUSTER_ASSIGNMENT_FIRST_CHOICE_DELAY; + double METACLUSTER_ASSIGNMENT_AVAILABILITY_TIMEOUT; + int METACLUSTER_RESTORE_BATCH_SIZE; + int TENANT_ENTRY_CACHE_LIST_REFRESH_INTERVAL; // How often the TenantEntryCache is refreshed + bool CLIENT_ENABLE_USING_CLUSTER_ID_KEY; + + // Encryption-at-rest + bool ENABLE_ENCRYPTION_CPU_TIME_LOGGING; + // This Knob will be a comma-delimited string (i.e 0,1,2,3) that specifies which tenants the the EKP should throw + // key_not_found errors for. If TenantInfo::INVALID_TENANT is contained within the list then no tenants will be + // dropped. This Knob should ONLY be used in simulation for testing purposes + std::string SIMULATION_EKP_TENANT_IDS_TO_DROP; + bool ENABLE_CONFIGURABLE_ENCRYPTION; + int ENCRYPT_HEADER_FLAGS_VERSION; + int ENCRYPT_HEADER_AES_CTR_NO_AUTH_VERSION; + int ENCRYPT_HEADER_AES_CTR_AES_CMAC_AUTH_VERSION; + int ENCRYPT_HEADER_AES_CTR_HMAC_SHA_AUTH_VERSION; + + // REST KMS configurations + bool REST_KMS_ALLOW_NOT_SECURE_CONNECTION; + int SIM_KMS_VAULT_MAX_KEYS; ClientKnobs(Randomize randomize); void initialize(Randomize randomize); diff --git a/src/fdbclient/ClientLogEvents.h b/src/fdbclient/include/fdbclient/ClientLogEvents.h similarity index 100% rename from src/fdbclient/ClientLogEvents.h rename to src/fdbclient/include/fdbclient/ClientLogEvents.h diff --git a/src/fdbclient/ClientVersion.h b/src/fdbclient/include/fdbclient/ClientVersion.h similarity index 90% rename from src/fdbclient/ClientVersion.h rename to src/fdbclient/include/fdbclient/ClientVersion.h index fe3068a..c395a69 100644 --- a/src/fdbclient/ClientVersion.h +++ b/src/fdbclient/include/fdbclient/ClientVersion.h @@ -37,7 +37,7 @@ struct ClientVersionRef { ClientVersionRef(StringRef clientVersion, StringRef sourceVersion, StringRef protocolVersion) : clientVersion(clientVersion), sourceVersion(sourceVersion), protocolVersion(protocolVersion) {} ClientVersionRef(StringRef versionString) { - std::vector parts = versionString.splitAny(LiteralStringRef(",")); + std::vector parts = versionString.splitAny(","_sr); if (parts.size() != 3) { initUnknown(); return; @@ -48,9 +48,9 @@ struct ClientVersionRef { } void initUnknown() { - clientVersion = LiteralStringRef("Unknown"); - sourceVersion = LiteralStringRef("Unknown"); - protocolVersion = LiteralStringRef("Unknown"); + clientVersion = "Unknown"_sr; + sourceVersion = "Unknown"_sr; + protocolVersion = "Unknown"_sr; } template diff --git a/src/fdbclient/ClientWorkerInterface.h b/src/fdbclient/include/fdbclient/ClientWorkerInterface.h similarity index 100% rename from src/fdbclient/ClientWorkerInterface.h rename to src/fdbclient/include/fdbclient/ClientWorkerInterface.h diff --git a/src/fdbclient/ClusterConnectionFile.h b/src/fdbclient/include/fdbclient/ClusterConnectionFile.h similarity index 91% rename from src/fdbclient/ClusterConnectionFile.h rename to src/fdbclient/include/fdbclient/ClusterConnectionFile.h index 623c04c..43181b0 100644 --- a/src/fdbclient/ClusterConnectionFile.h +++ b/src/fdbclient/include/fdbclient/ClusterConnectionFile.h @@ -23,7 +23,6 @@ #define FDBCLIENT_CLUSTERCONNECTIONFILE_H #include "fdbclient/CoordinationInterface.h" -#include "flow/actorcompiler.h" // has to be last include // An implementation of IClusterConnectionRecord backed by a file. class ClusterConnectionFile : public IClusterConnectionRecord, ReferenceCounted, NonCopyable { @@ -34,6 +33,11 @@ class ClusterConnectionFile : public IClusterConnectionRecord, ReferenceCounted< // Creates a cluster file with a given connection string and saves it to the specified file. explicit ClusterConnectionFile(std::string const& filename, ClusterConnectionString const& contents); + // Creates a cluster file from the given filename. If the filename is empty, attempts to load the default + // cluster file instead. + static Reference openOrDefault(std::string const& filename); + static Reference openOrDefault(const char* filename); + // Sets the connections string held by this object and persists it. Future setAndPersistConnectionString(ClusterConnectionString const&) override; @@ -72,5 +76,4 @@ class ClusterConnectionFile : public IClusterConnectionRecord, ReferenceCounted< std::string filename; }; -#include "flow/unactorcompiler.h" -#endif \ No newline at end of file +#endif diff --git a/src/fdbclient/ClusterConnectionKey.actor.g.h b/src/fdbclient/include/fdbclient/ClusterConnectionKey.actor.g.h similarity index 90% rename from src/fdbclient/ClusterConnectionKey.actor.g.h rename to src/fdbclient/include/fdbclient/ClusterConnectionKey.actor.g.h index 6686377..3206b76 100644 --- a/src/fdbclient/ClusterConnectionKey.actor.g.h +++ b/src/fdbclient/include/fdbclient/ClusterConnectionKey.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ClusterConnectionKey.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ClusterConnectionKey.actor.h" /* * ClusterConnectionKey.actor.h * @@ -47,11 +47,11 @@ class ClusterConnectionKey : public IClusterConnectionRecord, ReferenceCounted> loadClusterConnectionKey( Database const& db, Key const& connectionStringKey ); template friend class ClusterConnectionKey_LoadClusterConnectionKeyActorState; -#line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ClusterConnectionKey.actor.h" +#line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ClusterConnectionKey.actor.h" // Sets the connections string held by this object and persists it. Future setAndPersistConnectionString(ClusterConnectionString const&) override; @@ -82,21 +82,21 @@ template friend class ClusterConnectionKey_LoadClusterConnectionKeyActor Future persist() override; private: - #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ClusterConnectionKey.actor.g.h" + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ClusterConnectionKey.actor.g.h" [[nodiscard]] static Future getStoredConnectionStringImpl( Reference const& self ); template friend class ClusterConnectionKey_GetStoredConnectionStringImplActorState; -#line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ClusterConnectionKey.actor.h" - #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ClusterConnectionKey.actor.g.h" +#line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ClusterConnectionKey.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ClusterConnectionKey.actor.g.h" [[nodiscard]] static Future upToDateImpl( Reference const& self, ClusterConnectionString* const& connectionString ); template friend class ClusterConnectionKey_UpToDateImplActorState; -#line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ClusterConnectionKey.actor.h" - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ClusterConnectionKey.actor.g.h" +#line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ClusterConnectionKey.actor.h" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ClusterConnectionKey.actor.g.h" [[nodiscard]] static Future persistImpl( Reference const& self ); template friend class ClusterConnectionKey_PersistImplActorState; -#line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ClusterConnectionKey.actor.h" +#line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ClusterConnectionKey.actor.h" // The database where the connection key is stored. Note that this does not need to be the same database as the one // that the connection string would connect to. diff --git a/src/fdbclient/ClusterConnectionKey.actor.h b/src/fdbclient/include/fdbclient/ClusterConnectionKey.actor.h similarity index 100% rename from src/fdbclient/ClusterConnectionKey.actor.h rename to src/fdbclient/include/fdbclient/ClusterConnectionKey.actor.h diff --git a/src/fdbclient/ClusterConnectionMemoryRecord.h b/src/fdbclient/include/fdbclient/ClusterConnectionMemoryRecord.h similarity index 100% rename from src/fdbclient/ClusterConnectionMemoryRecord.h rename to src/fdbclient/include/fdbclient/ClusterConnectionMemoryRecord.h diff --git a/src/fdbclient/ClusterInterface.h b/src/fdbclient/include/fdbclient/ClusterInterface.h similarity index 89% rename from src/fdbclient/ClusterInterface.h rename to src/fdbclient/include/fdbclient/ClusterInterface.h index 14935f1..a0cd31a 100644 --- a/src/fdbclient/ClusterInterface.h +++ b/src/fdbclient/include/fdbclient/ClusterInterface.h @@ -40,6 +40,7 @@ struct ClusterInterface { RequestStream moveShard; RequestStream repairSystemData; RequestStream splitShard; + RequestStream triggerAudit; bool operator==(ClusterInterface const& r) const { return id() == r.id(); } bool operator!=(ClusterInterface const& r) const { return id() != r.id(); } @@ -51,7 +52,7 @@ struct ClusterInterface { databaseStatus.getFuture().isReady() || ping.getFuture().isReady() || getClientWorkers.getFuture().isReady() || forceRecovery.getFuture().isReady() || moveShard.getFuture().isReady() || repairSystemData.getFuture().isReady() || - splitShard.getFuture().isReady(); + splitShard.getFuture().isReady() || triggerAudit.getFuture().isReady(); } void initEndpoints() { @@ -64,6 +65,7 @@ struct ClusterInterface { moveShard.getEndpoint(TaskPriority::ClusterController); repairSystemData.getEndpoint(TaskPriority::ClusterController); splitShard.getEndpoint(TaskPriority::ClusterController); + triggerAudit.getEndpoint(TaskPriority::ClusterController); } template @@ -77,7 +79,8 @@ struct ClusterInterface { forceRecovery, moveShard, repairSystemData, - splitShard); + splitShard, + triggerAudit); } }; @@ -98,32 +101,44 @@ struct ClusterControllerClientInterface { } }; -template -struct ItemWithExamples { - T item; - int count; - std::vector> examples; - - ItemWithExamples() : item{}, count(0) {} - ItemWithExamples(T const& item, int count, std::vector> const& examples) - : item(item), count(count), examples(examples) {} - - template - void serialize(Ar& ar) { - serializer(ar, item, count, examples); - } -}; - struct OpenDatabaseRequest { constexpr static FileIdentifier file_identifier = 2799502; // Sent by the native API to the cluster controller to open a database and track client // info changes. Returns immediately if the current client info id is different from // knownClientInfoID; otherwise returns when it next changes (or perhaps after a long interval) - int clientCount; - std::vector> issues; - std::vector>> supportedVersions; - std::vector> maxProtocolSupported; + struct Samples { + int count; + + // network address / trace log group + std::set> samples; + + Samples() : count(0), samples{} {} + + template + void serialize(Ar& ar) { + serializer(ar, count, samples); + } + + // Merges a set of Samples into *this + Samples& operator+=(const Samples& other) { + count += other.count; + samples.insert(std::begin(other.samples), std::end(other.samples)); + + return *this; + } + }; + + int clientCount = 0; + + // Maps issue to Samples + std::map issues; + + // Maps ClientVersionRef to Samples + std::map, Samples> supportedVersions; + + // Maps max protocol to Samples + std::map maxProtocolSupported; UID knownClientInfoID; ReplyPromise reply; @@ -137,6 +152,10 @@ struct OpenDatabaseRequest { } }; +// Instantiated in NativeAPI.actor.cpp +extern template class RequestStream; +extern template struct NetNotifiedQueue; + struct SystemFailureStatus { constexpr static FileIdentifier file_identifier = 3194108; NetworkAddressList addresses; diff --git a/src/fdbclient/CommitProxyInterface.h b/src/fdbclient/include/fdbclient/CommitProxyInterface.h similarity index 67% rename from src/fdbclient/CommitProxyInterface.h rename to src/fdbclient/include/fdbclient/CommitProxyInterface.h index f5b96b3..b15f26e 100644 --- a/src/fdbclient/CommitProxyInterface.h +++ b/src/fdbclient/include/fdbclient/CommitProxyInterface.h @@ -25,16 +25,20 @@ #include #include +#include "fdbclient/BlobWorkerInterface.h" +#include "fdbclient/CommitTransaction.h" +#include "fdbclient/EncryptKeyProxyInterface.h" #include "fdbclient/FDBTypes.h" +#include "fdbclient/GetEncryptCipherKeys.h" +#include "fdbclient/GlobalConfig.h" +#include "fdbclient/GrvProxyInterface.h" +#include "fdbclient/IdempotencyId.actor.h" #include "fdbclient/StorageServerInterface.h" -#include "fdbclient/CommitTransaction.h" #include "fdbclient/TagThrottle.actor.h" -#include "fdbclient/GlobalConfig.h" #include "fdbclient/VersionVector.h" #include "fdbrpc/Stats.h" #include "fdbrpc/TimedRequest.h" -#include "GrvProxyInterface.h" struct CommitProxyInterface { constexpr static FileIdentifier file_identifier = 8954922; @@ -43,13 +47,13 @@ struct CommitProxyInterface { Optional processId; bool provisional; - RequestStream commit; - RequestStream + PublicRequestStream commit; + PublicRequestStream getConsistentReadVersion; // Returns a version which (1) is committed, and (2) is >= the latest version reported // committed (by a commit response) when this request was sent // (at some point between when this request is sent and when its response is // received, the latest version reported committed) - RequestStream getKeyServersLocations; + PublicRequestStream getKeyServersLocations; RequestStream getStorageServerRejoinInfo; RequestStream> waitFailure; @@ -59,6 +63,9 @@ struct CommitProxyInterface { RequestStream proxySnapReq; RequestStream exclusionSafetyCheckReq; RequestStream getDDMetrics; + PublicRequestStream expireIdempotencyId; + PublicRequestStream getTenantId; + PublicRequestStream getBlobGranuleLocations; UID id() const { return commit.getEndpoint().token; } std::string toString() const { return id().shortString(); } @@ -72,9 +79,9 @@ struct CommitProxyInterface { serializer(ar, processId, provisional, commit); if (Archive::isDeserializing) { getConsistentReadVersion = - RequestStream(commit.getEndpoint().getAdjustedEndpoint(1)); + PublicRequestStream(commit.getEndpoint().getAdjustedEndpoint(1)); getKeyServersLocations = - RequestStream(commit.getEndpoint().getAdjustedEndpoint(2)); + PublicRequestStream(commit.getEndpoint().getAdjustedEndpoint(2)); getStorageServerRejoinInfo = RequestStream(commit.getEndpoint().getAdjustedEndpoint(3)); waitFailure = RequestStream>(commit.getEndpoint().getAdjustedEndpoint(4)); @@ -85,6 +92,11 @@ struct CommitProxyInterface { exclusionSafetyCheckReq = RequestStream(commit.getEndpoint().getAdjustedEndpoint(8)); getDDMetrics = RequestStream(commit.getEndpoint().getAdjustedEndpoint(9)); + expireIdempotencyId = + PublicRequestStream(commit.getEndpoint().getAdjustedEndpoint(10)); + getTenantId = PublicRequestStream(commit.getEndpoint().getAdjustedEndpoint(11)); + getBlobGranuleLocations = PublicRequestStream( + commit.getEndpoint().getAdjustedEndpoint(12)); } } @@ -101,6 +113,9 @@ struct CommitProxyInterface { streams.push_back(proxySnapReq.getReceiver()); streams.push_back(exclusionSafetyCheckReq.getReceiver()); streams.push_back(getDDMetrics.getReceiver()); + streams.push_back(expireIdempotencyId.getReceiver()); + streams.push_back(getTenantId.getReceiver()); + streams.push_back(getBlobGranuleLocations.getReceiver()); FlowTransport::transport().addEndpoints(streams); } }; @@ -116,8 +131,12 @@ struct ClientDBInfo { firstCommitProxy; // not serialized, used for commitOnFirstProxy when the commit proxies vector has been shrunk Optional forward; std::vector history; + UID clusterId; + Optional encryptKeyProxy; TenantMode tenantMode; + ClusterType clusterType = ClusterType::STANDALONE; + Optional metaclusterName; ClientDBInfo() {} @@ -129,7 +148,40 @@ struct ClientDBInfo { if constexpr (!is_fb_function) { ASSERT(ar.protocolVersion().isValid()); } - serializer(ar, grvProxies, commitProxies, id, forward, history, tenantMode); + serializer(ar, + grvProxies, + commitProxies, + id, + forward, + history, + tenantMode, + encryptKeyProxy, + clusterId, + clusterType, + metaclusterName); + } +}; + +// Compile ReplyPromise> takes long time, extern template is used to fix this. The +// corresponding instantiations are done in CommitProxyInterface.cpp +extern template class ReplyPromise; +extern template class ReplyPromise>; + +struct ExpireIdempotencyIdRequest { + constexpr static FileIdentifier file_identifier = 1900933; + Version commitVersion = invalidVersion; + uint8_t batchIndexHighByte = 0; + TenantInfo tenant; + + ExpireIdempotencyIdRequest() {} + ExpireIdempotencyIdRequest(Version commitVersion, uint8_t batchIndexHighByte, TenantInfo tenant) + : commitVersion(commitVersion), batchIndexHighByte(batchIndexHighByte), tenant(tenant) {} + + bool verify() const { return tenant.isAuthorized(); } + + template + void serialize(Ar& ar) { + serializer(ar, commitVersion, batchIndexHighByte, tenant); } }; @@ -156,29 +208,42 @@ struct CommitID { struct CommitTransactionRequest : TimedRequest { constexpr static FileIdentifier file_identifier = 93948; - enum { FLAG_IS_LOCK_AWARE = 0x1, FLAG_FIRST_IN_BATCH = 0x2 }; + enum { FLAG_IS_LOCK_AWARE = 0x1, FLAG_FIRST_IN_BATCH = 0x2, FLAG_BYPASS_STORAGE_QUOTA = 0x4 }; bool isLockAware() const { return (flags & FLAG_IS_LOCK_AWARE) != 0; } bool firstInBatch() const { return (flags & FLAG_FIRST_IN_BATCH) != 0; } + bool bypassStorageQuota() const { return (flags & FLAG_BYPASS_STORAGE_QUOTA) != 0; } Arena arena; - SpanID spanContext; + SpanContext spanContext; CommitTransactionRef transaction; ReplyPromise reply; uint32_t flags; Optional debugID; Optional commitCostEstimation; Optional tagSet; + IdempotencyIdRef idempotencyId; TenantInfo tenantInfo; - CommitTransactionRequest() : CommitTransactionRequest(SpanID()) {} - CommitTransactionRequest(SpanID const& context) : spanContext(context), flags(0) {} + CommitTransactionRequest() : CommitTransactionRequest(SpanContext()) {} + CommitTransactionRequest(SpanContext const& context) : spanContext(context), flags(0) {} + + bool verify() const { return tenantInfo.isAuthorized(); } template void serialize(Ar& ar) { - serializer( - ar, transaction, reply, arena, flags, debugID, commitCostEstimation, tagSet, spanContext, tenantInfo); + serializer(ar, + transaction, + reply, + flags, + debugID, + commitCostEstimation, + tagSet, + spanContext, + tenantInfo, + idempotencyId, + arena); } }; @@ -205,6 +270,7 @@ struct GetReadVersionReply : public BasicLoadBalancedReply { bool rkBatchThrottled = false; TransactionTagMap tagThrottleInfo; + double proxyTagThrottledDuration{ 0.0 }; VersionVector ssVersionVectorDelta; UID proxyId; // GRV proxy ID to detect old GRV proxies at client side @@ -223,7 +289,8 @@ struct GetReadVersionReply : public BasicLoadBalancedReply { rkDefaultThrottled, rkBatchThrottled, ssVersionVectorDelta, - proxyId); + proxyId, + proxyTagThrottledDuration); } }; @@ -242,12 +309,16 @@ struct GetReadVersionRequest : TimedRequest { FLAG_PRIORITY_MASK = PRIORITY_SYSTEM_IMMEDIATE, }; - SpanID spanContext; + SpanContext spanContext; uint32_t transactionCount; uint32_t flags; TransactionPriority priority; TransactionTagMap tags; + // Not serialized, because this field does not need to be sent to master. + // It is used for reporting to clients the amount of time spent delayed by + // the TagQueue + double proxyTagThrottledDuration{ 0.0 }; Optional debugID; ReplyPromise reply; @@ -255,7 +326,7 @@ struct GetReadVersionRequest : TimedRequest { Version maxVersion; // max version in the client's version vector cache GetReadVersionRequest() : transactionCount(1), flags(0), maxVersion(invalidVersion) {} - GetReadVersionRequest(SpanID spanContext, + GetReadVersionRequest(SpanContext spanContext, uint32_t transactionCount, TransactionPriority priority, Version maxVersion, @@ -280,8 +351,12 @@ struct GetReadVersionRequest : TimedRequest { } } + bool verify() const { return true; } + bool operator<(GetReadVersionRequest const& rhs) const { return priority < rhs.priority; } + bool isTagged() const { return !tags.empty(); } + template void serialize(Ar& ar) { serializer(ar, transactionCount, flags, tags, debugID, reply, spanContext, maxVersion); @@ -300,10 +375,45 @@ struct GetReadVersionRequest : TimedRequest { } }; +struct GetTenantIdReply { + constexpr static FileIdentifier file_identifier = 11441284; + int64_t tenantId = TenantInfo::INVALID_TENANT; + + GetTenantIdReply() {} + GetTenantIdReply(int64_t tenantId) : tenantId(tenantId) {} + + template + void serialize(Ar& ar) { + serializer(ar, tenantId); + } +}; + +struct GetTenantIdRequest { + constexpr static FileIdentifier file_identifier = 11299717; + TenantName tenantName; + ReplyPromise reply; + + // This version is used to specify the minimum metadata version a proxy must have in order to declare that + // a tenant is not present. If the metadata version is lower, the proxy must wait in case the tenant gets + // created. If latestVersion is specified, then the proxy will wait until it is sure that it has received + // updates from other proxies before answering. + Version minTenantVersion; + + GetTenantIdRequest() : minTenantVersion(latestVersion) {} + GetTenantIdRequest(TenantNameRef const& tenantName, Version minTenantVersion) + : tenantName(tenantName), minTenantVersion(minTenantVersion) {} + + bool verify() const { return true; } + + template + void serialize(Ar& ar) { + serializer(ar, reply, tenantName, minTenantVersion); + } +}; + struct GetKeyServerLocationsReply { constexpr static FileIdentifier file_identifier = 10636023; Arena arena; - TenantMapEntry tenantEntry; std::vector>> results; // if any storage servers in results have a TSS pair, that mapping is in here @@ -318,15 +428,19 @@ struct GetKeyServerLocationsReply { template void serialize(Ar& ar) { - serializer(ar, results, resultsTssMapping, tenantEntry, arena, resultsTagMapping); + serializer(ar, results, resultsTssMapping, resultsTagMapping, arena); } }; +// Instantiated in CommitProxyInterface.cpp +extern template class ReplyPromise; +extern template struct NetSAV; + struct GetKeyServerLocationsRequest { constexpr static FileIdentifier file_identifier = 9144680; Arena arena; - SpanID spanContext; - Optional tenant; + SpanContext spanContext; + TenantInfo tenant; KeyRef begin; Optional end; int limit; @@ -340,8 +454,8 @@ struct GetKeyServerLocationsRequest { Version minTenantVersion; GetKeyServerLocationsRequest() : limit(0), reverse(false), minTenantVersion(latestVersion) {} - GetKeyServerLocationsRequest(SpanID spanContext, - Optional const& tenant, + GetKeyServerLocationsRequest(SpanContext spanContext, + TenantInfo const& tenant, KeyRef const& begin, Optional const& end, int limit, @@ -351,12 +465,66 @@ struct GetKeyServerLocationsRequest { : arena(arena), spanContext(spanContext), tenant(tenant), begin(begin), end(end), limit(limit), reverse(reverse), minTenantVersion(minTenantVersion) {} + bool verify() const { return tenant.isAuthorized(); } + template void serialize(Ar& ar) { serializer(ar, begin, end, limit, reverse, reply, spanContext, tenant, minTenantVersion, arena); } }; +struct GetBlobGranuleLocationsReply { + constexpr static FileIdentifier file_identifier = 2923309; + Arena arena; + std::vector> results; + std::vector bwInterfs; + bool more; + + template + void serialize(Ar& ar) { + serializer(ar, results, bwInterfs, more, arena); + } +}; + +struct GetBlobGranuleLocationsRequest { + constexpr static FileIdentifier file_identifier = 2508597; + Arena arena; + SpanContext spanContext; + TenantInfo tenant; + KeyRef begin; + Optional end; + int limit; + bool reverse; + bool justGranules; + ReplyPromise reply; + + // This version is used to specify the minimum metadata version a proxy must have in order to declare that + // a tenant is not present. If the metadata version is lower, the proxy must wait in case the tenant gets + // created. If latestVersion is specified, then the proxy will wait until it is sure that it has received + // updates from other proxies before answering. + Version minTenantVersion; + + GetBlobGranuleLocationsRequest() : limit(0), reverse(false), justGranules(false), minTenantVersion(latestVersion) {} + GetBlobGranuleLocationsRequest(SpanContext spanContext, + TenantInfo const& tenant, + KeyRef const& begin, + Optional const& end, + int limit, + bool reverse, + bool justGranules, + Version minTenantVersion, + Arena const& arena) + : arena(arena), spanContext(spanContext), tenant(tenant), begin(begin), end(end), limit(limit), reverse(reverse), + justGranules(justGranules), minTenantVersion(minTenantVersion) {} + + bool verify() const { return tenant.isAuthorized(); } + + template + void serialize(Ar& ar) { + serializer(ar, begin, end, limit, reverse, reply, spanContext, tenant, minTenantVersion, justGranules, arena); + } +}; + struct GetRawCommittedVersionReply { constexpr static FileIdentifier file_identifier = 1314732; Optional debugID; @@ -378,12 +546,12 @@ struct GetRawCommittedVersionReply { struct GetRawCommittedVersionRequest { constexpr static FileIdentifier file_identifier = 12954034; - SpanID spanContext; + SpanContext spanContext; Optional debugID; ReplyPromise reply; Version maxVersion; // max version in the grv proxy's version vector cache - explicit GetRawCommittedVersionRequest(SpanID spanContext, + explicit GetRawCommittedVersionRequest(SpanContext spanContext, Optional const& debugID = Optional(), Version maxVersion = invalidVersion) : spanContext(spanContext), debugID(debugID), maxVersion(maxVersion) {} @@ -402,10 +570,11 @@ struct GetStorageServerRejoinInfoReply { Optional newTag; bool newLocality; std::vector> history; + EncryptionAtRestMode encryptMode; template void serialize(Ar& ar) { - serializer(ar, version, tag, newTag, newLocality, history); + serializer(ar, version, tag, newTag, newLocality, history, encryptMode); } }; @@ -520,7 +689,7 @@ struct ProxySnapRequest { template void serialize(Ar& ar) { - serializer(ar, snapPayload, snapUID, reply, arena, debugID); + serializer(ar, snapPayload, snapUID, reply, debugID, arena); } }; @@ -551,4 +720,37 @@ struct ExclusionSafetyCheckRequest { } }; +struct GlobalConfigRefreshReply { + constexpr static FileIdentifier file_identifier = 12680327; + Arena arena; + RangeResultRef result; + + GlobalConfigRefreshReply() {} + GlobalConfigRefreshReply(Arena const& arena, RangeResultRef result) : arena(arena), result(result) {} + + template + void serialize(Ar& ar) { + serializer(ar, result, arena); + } +}; + +struct GlobalConfigRefreshRequest { + constexpr static FileIdentifier file_identifier = 2828131; + Version lastKnown; + ReplyPromise reply; + + GlobalConfigRefreshRequest() {} + explicit GlobalConfigRefreshRequest(Version lastKnown) : lastKnown(lastKnown) {} + + bool verify() const noexcept { return true; } + + template + void serialize(Ar& ar) { + serializer(ar, lastKnown, reply); + } +}; + +// Instantiated in CommitProxyInterface.cpp +extern template class GetEncryptCipherKeys; + #endif diff --git a/src/fdbclient/include/fdbclient/CommitTransaction.h b/src/fdbclient/include/fdbclient/CommitTransaction.h new file mode 100644 index 0000000..256e7e7 --- /dev/null +++ b/src/fdbclient/include/fdbclient/CommitTransaction.h @@ -0,0 +1,533 @@ +/* + * CommitTransaction.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FLOW_FDBCLIENT_COMMITTRANSACTION_H +#define FLOW_FDBCLIENT_COMMITTRANSACTION_H +#pragma once + +#include "fdbclient/BlobCipher.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/GetEncryptCipherKeys.h" +#include "fdbclient/Knobs.h" +#include "fdbclient/Tracing.h" +#include "flow/EncryptUtils.h" +#include "flow/Knobs.h" + +#include + +// The versioned message has wire format : -1, version, messages +static const int32_t VERSION_HEADER = -1; + +static const char* typeString[] = { "SetValue", + "ClearRange", + "AddValue", + "DebugKeyRange", + "DebugKey", + "NoOp", + "And", + "Or", + "Xor", + "AppendIfFits", + "AvailableForReuse", + "Reserved_For_LogProtocolMessage", + "Max", + "Min", + "SetVersionstampedKey", + "SetVersionstampedValue", + "ByteMin", + "ByteMax", + "MinV2", + "AndV2", + "CompareAndClear", + "Reserved_For_SpanContextMessage", + "MAX_ATOMIC_OP" }; + +struct MutationRef { + static const int OVERHEAD_BYTES = 12; // 12 is the size of Header in MutationList entries + enum Type : uint8_t { + SetValue = 0, + ClearRange, + AddValue, + DebugKeyRange, + DebugKey, + NoOp, + And, + Or, + Xor, + AppendIfFits, + AvailableForReuse, + Reserved_For_LogProtocolMessage /* See fdbserver/LogProtocolMessage.h */, + Max, + Min, + SetVersionstampedKey, + SetVersionstampedValue, + ByteMin, + ByteMax, + MinV2, + AndV2, + CompareAndClear, + Reserved_For_SpanContextMessage /* See fdbserver/SpanContextMessage.h */, + Reserved_For_OTELSpanContextMessage, + Encrypted, /* Represents an encrypted mutation and cannot be used directly before decrypting */ + MAX_ATOMIC_OP + }; + // This is stored this way for serialization purposes. + uint8_t type; + StringRef param1, param2; + + MutationRef() : type(MAX_ATOMIC_OP) {} + MutationRef(Type t, StringRef a, StringRef b) : type(t), param1(a), param2(b) {} + MutationRef(Arena& to, Type t, StringRef a, StringRef b) : type(t), param1(to, a), param2(to, b) {} + MutationRef(Arena& to, const MutationRef& from) + : type(from.type), param1(to, from.param1), param2(to, from.param2) {} + int totalSize() const { return OVERHEAD_BYTES + param1.size() + param2.size(); } + int expectedSize() const { return param1.size() + param2.size(); } + int weightedTotalSize() const { + // AtomicOp can cause more workload to FDB cluster than the same-size set mutation; + // Amplify atomicOp size to consider such extra workload. + // A good value for FASTRESTORE_ATOMICOP_WEIGHT needs experimental evaluations. + if (isAtomicOp()) { + return totalSize() * CLIENT_KNOBS->FASTRESTORE_ATOMICOP_WEIGHT; + } else { + return totalSize(); + } + } + + std::string toString() const { + return format("code: %s param1: %s param2: %s", + type < MutationRef::MAX_ATOMIC_OP ? typeString[(int)type] : "Unset", + printable(param1).c_str(), + printable(param2).c_str()); + } + + bool isAtomicOp() const { return (ATOMIC_MASK & (1 << type)) != 0; } + bool isValid() const { return type < MAX_ATOMIC_OP; } + + template + void serialize(Ar& ar) { + if (ar.isSerializing && type == ClearRange && equalsKeyAfter(param1, param2)) { + StringRef empty; + serializer(ar, type, param2, empty); + } else { + serializer(ar, type, param1, param2); + } + if (ar.isDeserializing && type == ClearRange && param2 == StringRef() && param1 != StringRef()) { + ASSERT(param1[param1.size() - 1] == '\x00'); + param2 = param1; + param1 = param2.substr(0, param2.size() - 1); + } + } + + // An encrypted mutation has type Encrypted, encryption header (which contains encryption metadata) as param1, + // and the payload as param2. It can be serialize/deserialize as normal mutation, but can only be used after + // decryption via decrypt(). + bool isEncrypted() const { return type == Encrypted; } + + const BlobCipherEncryptHeader* encryptionHeader() const { + ASSERT(isEncrypted()); + return reinterpret_cast(param1.begin()); + } + + const BlobCipherEncryptHeaderRef configurableEncryptionHeader() const { + ASSERT(isEncrypted()); + return BlobCipherEncryptHeaderRef::fromStringRef(param1); + } + + EncryptCipherDomainId encryptDomainId() const { + ASSERT(isEncrypted()); + return CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION ? configurableEncryptionHeader().getDomainId() + : encryptionHeader()->cipherTextDetails.encryptDomainId; + } + + void updateEncryptCipherDetails(std::unordered_set& cipherDetails) { + ASSERT(isEncrypted()); + + if (CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION) { + BlobCipherEncryptHeaderRef header = configurableEncryptionHeader(); + EncryptHeaderCipherDetails details = header.getCipherDetails(); + ASSERT(details.textCipherDetails.isValid()); + cipherDetails.insert(details.textCipherDetails); + if (details.headerCipherDetails.present()) { + ASSERT(details.headerCipherDetails.get().isValid()); + cipherDetails.insert(details.headerCipherDetails.get()); + } + } else { + const BlobCipherEncryptHeader* header = encryptionHeader(); + cipherDetails.insert(header->cipherTextDetails); + if (header->cipherHeaderDetails.isValid()) { + cipherDetails.insert(header->cipherHeaderDetails); + } + } + } + + MutationRef encrypt(TextAndHeaderCipherKeys cipherKeys, + Arena& arena, + BlobCipherMetrics::UsageType usageType) const { + uint8_t iv[AES_256_IV_LENGTH] = { 0 }; + deterministicRandom()->randomBytes(iv, AES_256_IV_LENGTH); + BinaryWriter bw(AssumeVersion(ProtocolVersion::withEncryptionAtRest())); + bw << *this; + + EncryptBlobCipherAes265Ctr cipher( + cipherKeys.cipherTextKey, + cipherKeys.cipherHeaderKey, + iv, + AES_256_IV_LENGTH, + getEncryptAuthTokenMode(EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE), + usageType); + + StringRef serializedHeader; + StringRef payload; + if (CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION) { + BlobCipherEncryptHeaderRef header; + payload = cipher.encrypt(static_cast(bw.getData()), bw.getLength(), &header, arena); + Standalone headerStr = BlobCipherEncryptHeaderRef::toStringRef(header); + arena.dependsOn(headerStr.arena()); + serializedHeader = headerStr; + } else { + BlobCipherEncryptHeader* header = new (arena) BlobCipherEncryptHeader; + serializedHeader = StringRef(reinterpret_cast(header), sizeof(BlobCipherEncryptHeader)); + payload = + cipher.encrypt(static_cast(bw.getData()), bw.getLength(), header, arena)->toStringRef(); + } + return MutationRef(Encrypted, serializedHeader, payload); + } + + MutationRef encrypt(const std::unordered_map>& cipherKeys, + const EncryptCipherDomainId& domainId, + Arena& arena, + BlobCipherMetrics::UsageType usageType) const { + ASSERT_NE(domainId, INVALID_ENCRYPT_DOMAIN_ID); + auto getCipherKey = [&](const EncryptCipherDomainId& domainId) { + auto iter = cipherKeys.find(domainId); + ASSERT(iter != cipherKeys.end() && iter->second.isValid()); + return iter->second; + }; + Reference textCipherKey = getCipherKey(domainId); + Reference headerCipherKey; + if (FLOW_KNOBS->ENCRYPT_HEADER_AUTH_TOKEN_ENABLED) { + headerCipherKey = getCipherKey(ENCRYPT_HEADER_DOMAIN_ID); + } + uint8_t iv[AES_256_IV_LENGTH] = { 0 }; + deterministicRandom()->randomBytes(iv, AES_256_IV_LENGTH); + BinaryWriter bw(AssumeVersion(ProtocolVersion::withEncryptionAtRest())); + bw << *this; + + EncryptBlobCipherAes265Ctr cipher( + textCipherKey, + headerCipherKey, + iv, + AES_256_IV_LENGTH, + getEncryptAuthTokenMode(EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE), + usageType); + + if (CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION) { + BlobCipherEncryptHeaderRef header; + StringRef payload = + cipher.encrypt(static_cast(bw.getData()), bw.getLength(), &header, arena); + Standalone serializedHeader = BlobCipherEncryptHeaderRef::toStringRef(header); + arena.dependsOn(serializedHeader.arena()); + return MutationRef(Encrypted, serializedHeader, payload); + } else { + BlobCipherEncryptHeader* header = new (arena) BlobCipherEncryptHeader; + StringRef serializedHeader = + StringRef(reinterpret_cast(header), sizeof(BlobCipherEncryptHeader)); + StringRef payload = + cipher.encrypt(static_cast(bw.getData()), bw.getLength(), header, arena)->toStringRef(); + return MutationRef(Encrypted, serializedHeader, payload); + } + } + + MutationRef encryptMetadata(const std::unordered_map>& cipherKeys, + Arena& arena, + BlobCipherMetrics::UsageType usageType) const { + return encrypt(cipherKeys, SYSTEM_KEYSPACE_ENCRYPT_DOMAIN_ID, arena, usageType); + } + + MutationRef decrypt(TextAndHeaderCipherKeys cipherKeys, + Arena& arena, + BlobCipherMetrics::UsageType usageType, + StringRef* buf = nullptr) const { + StringRef plaintext; + if (CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION) { + const BlobCipherEncryptHeaderRef header = configurableEncryptionHeader(); + DecryptBlobCipherAes256Ctr cipher( + cipherKeys.cipherTextKey, cipherKeys.cipherHeaderKey, header.getIV(), usageType); + plaintext = cipher.decrypt(param2.begin(), param2.size(), header, arena); + } else { + const BlobCipherEncryptHeader* header = encryptionHeader(); + DecryptBlobCipherAes256Ctr cipher( + cipherKeys.cipherTextKey, cipherKeys.cipherHeaderKey, header->iv, usageType); + plaintext = cipher.decrypt(param2.begin(), param2.size(), *header, arena)->toStringRef(); + } + if (buf != nullptr) { + *buf = plaintext; + } + ArenaReader reader(arena, plaintext, AssumeVersion(ProtocolVersion::withEncryptionAtRest())); + MutationRef mutation; + reader >> mutation; + return mutation; + } + + MutationRef decrypt(const std::unordered_map>& cipherKeys, + Arena& arena, + BlobCipherMetrics::UsageType usageType, + StringRef* buf = nullptr) const { + TextAndHeaderCipherKeys textAndHeaderKeys = getCipherKeys(cipherKeys); + return decrypt(textAndHeaderKeys, arena, usageType, buf); + } + + TextAndHeaderCipherKeys getCipherKeys( + const std::unordered_map>& cipherKeys) const { + auto getCipherKey = [&](const BlobCipherDetails& details) -> Reference { + if (!details.isValid()) { + return {}; + } + auto iter = cipherKeys.find(details); + ASSERT(iter != cipherKeys.end() && iter->second.isValid()); + return iter->second; + }; + TextAndHeaderCipherKeys textAndHeaderKeys; + if (CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION) { + const BlobCipherEncryptHeaderRef header = configurableEncryptionHeader(); + EncryptHeaderCipherDetails cipherDetails = header.getCipherDetails(); + ASSERT(cipherDetails.textCipherDetails.isValid()); + textAndHeaderKeys.cipherTextKey = getCipherKey(cipherDetails.textCipherDetails); + if (cipherDetails.headerCipherDetails.present()) { + ASSERT(cipherDetails.headerCipherDetails.get().isValid()); + textAndHeaderKeys.cipherHeaderKey = getCipherKey(cipherDetails.headerCipherDetails.get()); + } else { + ASSERT(!FLOW_KNOBS->ENCRYPT_HEADER_AUTH_TOKEN_ENABLED); + } + } else { + const BlobCipherEncryptHeader* header = encryptionHeader(); + textAndHeaderKeys.cipherHeaderKey = getCipherKey(header->cipherHeaderDetails); + textAndHeaderKeys.cipherTextKey = getCipherKey(header->cipherTextDetails); + } + return textAndHeaderKeys; + } + + // These masks define which mutation types have particular properties (they are used to implement + // isSingleKeyMutation() etc) + enum { + ATOMIC_MASK = (1 << AddValue) | (1 << And) | (1 << Or) | (1 << Xor) | (1 << AppendIfFits) | (1 << Max) | + (1 << Min) | (1 << SetVersionstampedKey) | (1 << SetVersionstampedValue) | (1 << ByteMin) | + (1 << ByteMax) | (1 << MinV2) | (1 << AndV2) | (1 << CompareAndClear), + SINGLE_KEY_MASK = ATOMIC_MASK | (1 << SetValue), + NON_ASSOCIATIVE_MASK = (1 << AddValue) | (1 << Or) | (1 << Xor) | (1 << Max) | (1 << Min) | + (1 << SetVersionstampedKey) | (1 << SetVersionstampedValue) | (1 << MinV2) | + (1 << CompareAndClear) + }; +}; + +template <> +struct Traceable : std::true_type { + static std::string toString(MutationRef const& value) { return value.toString(); } +}; + +static inline std::string getTypeString(MutationRef::Type type) { + return type < MutationRef::MAX_ATOMIC_OP ? typeString[(int)type] : "Unset"; +} + +static inline std::string getTypeString(uint8_t type) { + return type < MutationRef::MAX_ATOMIC_OP ? typeString[type] : "Unset"; +} + +// A 'single key mutation' is one which affects exactly the value of the key specified by its param1 +static inline bool isSingleKeyMutation(MutationRef::Type type) { + return (MutationRef::SINGLE_KEY_MASK & (1 << type)) != 0; +} + +// Returns true if the given type can be safely cast to MutationRef::Type and used as a parameter to +// isSingleKeyMutation, isAtomicOp, etc. It does NOT mean that the type is a valid type of a MutationRef in any +// particular context. +static inline bool isValidMutationType(uint32_t type) { + return (type < MutationRef::MAX_ATOMIC_OP); +} + +// An 'atomic operation' is a single key mutation which sets the key specified by its param1 to a +// nontrivial function of the previous value of the key and param2, and thus requires a +// read/modify/write to implement. (Basically a single key mutation other than a set) +static inline bool isAtomicOp(MutationRef::Type mutationType) { + return (MutationRef::ATOMIC_MASK & (1 << mutationType)) != 0; +} + +// Returns true for operations which do not obey the associative law (i.e. a*(b*c) == (a*b)*c) in all cases +// unless a, b, and c have equal lengths, in which case even these operations are associative. +static inline bool isNonAssociativeOp(MutationRef::Type mutationType) { + return (MutationRef::NON_ASSOCIATIVE_MASK & (1 << mutationType)) != 0; +} + +struct CommitTransactionRef { + CommitTransactionRef() = default; + CommitTransactionRef(Arena& a, const CommitTransactionRef& from) + : read_conflict_ranges(a, from.read_conflict_ranges), write_conflict_ranges(a, from.write_conflict_ranges), + mutations(a, from.mutations), read_snapshot(from.read_snapshot), + report_conflicting_keys(from.report_conflicting_keys), lock_aware(from.lock_aware), + spanContext(from.spanContext) {} + + VectorRef read_conflict_ranges; + VectorRef write_conflict_ranges; + VectorRef mutations; // metadata mutations + // encryptedMutations should be a 1-1 corespondence with mutations field above. That is either + // encryptedMutations.size() == 0 or encryptedMutations.size() == mutations.size() and encryptedMutations[i] = + // mutations[i].encrypt(). Currently this field is not serialized so clients should NOT set this field during a + // usual commit path. It is currently only used during backup mutation log restores. + VectorRef> encryptedMutations; + Version read_snapshot = 0; + bool report_conflicting_keys = false; + bool lock_aware = false; // set when metadata mutations are present + Optional spanContext; + + // set by Commit Proxy + // The tenants associated with this transaction. This field only existing + // when tenant mode is required and this transaction has metadata mutations + Optional> tenantIds; + + template + force_inline void serialize(Ar& ar) { + if constexpr (is_fb_function) { + serializer(ar, + read_conflict_ranges, + write_conflict_ranges, + mutations, + read_snapshot, + report_conflicting_keys, + lock_aware, + spanContext, + tenantIds); + } else { + serializer(ar, read_conflict_ranges, write_conflict_ranges, mutations, read_snapshot); + if (ar.protocolVersion().hasReportConflictingKeys()) { + serializer(ar, report_conflicting_keys); + } + if (ar.protocolVersion().hasResolverPrivateMutations()) { + serializer(ar, lock_aware); + if (!ar.protocolVersion().hasOTELSpanContext()) { + Optional context; + serializer(ar, context); + if (context.present()) { + SpanContext res; + res.traceID = context.get(); + spanContext = res; + } + } + } + if (ar.protocolVersion().hasOTELSpanContext()) { + serializer(ar, spanContext); + } + } + } + + // Convenience for internal code required to manipulate these without the Native API + void set(Arena& arena, KeyRef const& key, ValueRef const& value) { + mutations.push_back_deep(arena, MutationRef(MutationRef::SetValue, key, value)); + write_conflict_ranges.push_back(arena, singleKeyRange(key, arena)); + } + + void clear(Arena& arena, KeyRangeRef const& keys) { + mutations.push_back_deep(arena, MutationRef(MutationRef::ClearRange, keys.begin, keys.end)); + write_conflict_ranges.push_back_deep(arena, keys); + } + + size_t expectedSize() const { + return read_conflict_ranges.expectedSize() + write_conflict_ranges.expectedSize() + mutations.expectedSize(); + } +}; + +struct MutationsAndVersionRef { + VectorRef mutations; + Version version = invalidVersion; + Version knownCommittedVersion = invalidVersion; + + MutationsAndVersionRef() {} + explicit MutationsAndVersionRef(Version version, Version knownCommittedVersion) + : version(version), knownCommittedVersion(knownCommittedVersion) {} + MutationsAndVersionRef(VectorRef mutations, Version version, Version knownCommittedVersion) + : mutations(mutations), version(version), knownCommittedVersion(knownCommittedVersion) {} + MutationsAndVersionRef(Arena& to, VectorRef mutations, Version version, Version knownCommittedVersion) + : mutations(to, mutations), version(version), knownCommittedVersion(knownCommittedVersion) {} + MutationsAndVersionRef(Arena& to, const MutationsAndVersionRef& from) + : mutations(to, from.mutations), version(from.version), knownCommittedVersion(from.knownCommittedVersion) {} + int expectedSize() const { return mutations.expectedSize(); } + + struct OrderByVersion { + bool operator()(MutationsAndVersionRef const& a, MutationsAndVersionRef const& b) const { + return a.version < b.version; + } + }; + + template + void serialize(Ar& ar) { + serializer(ar, mutations, version, knownCommittedVersion); + } +}; + +struct MutationRefAndCipherKeys { + MutationRef mutation; + TextAndHeaderCipherKeys cipherKeys; +}; + +struct EncryptedMutationsAndVersionRef { + VectorRef mutations; + Optional> encrypted; + std::vector cipherKeys; + Version version = invalidVersion; + Version knownCommittedVersion = invalidVersion; + + EncryptedMutationsAndVersionRef() {} + explicit EncryptedMutationsAndVersionRef(Version version, Version knownCommittedVersion) + : version(version), knownCommittedVersion(knownCommittedVersion) {} + EncryptedMutationsAndVersionRef(VectorRef mutations, + VectorRef encrypted, + const std::vector& cipherKeys, + Version version, + Version knownCommittedVersion) + : mutations(mutations), encrypted(encrypted), cipherKeys(cipherKeys), version(version), + knownCommittedVersion(knownCommittedVersion) {} + EncryptedMutationsAndVersionRef(Arena& to, + VectorRef mutations, + Optional> encrypt, + const std::vector& cipherKeys, + Version version, + Version knownCommittedVersion) + : mutations(to, mutations), cipherKeys(cipherKeys), version(version), + knownCommittedVersion(knownCommittedVersion) { + if (encrypt.present()) { + encrypted = VectorRef(to, encrypt.get()); + } + } + EncryptedMutationsAndVersionRef(Arena& to, const EncryptedMutationsAndVersionRef& from) + : mutations(to, from.mutations), cipherKeys(from.cipherKeys), version(from.version), + knownCommittedVersion(from.knownCommittedVersion) { + if (from.encrypted.present()) { + encrypted = VectorRef(to, from.encrypted.get()); + } + } + int expectedSize() const { return mutations.expectedSize(); } + + struct OrderByVersion { + bool operator()(EncryptedMutationsAndVersionRef const& a, EncryptedMutationsAndVersionRef const& b) const { + return a.version < b.version; + } + }; +}; + +#endif diff --git a/src/fdbclient/ConfigKnobs.h b/src/fdbclient/include/fdbclient/ConfigKnobs.h similarity index 99% rename from src/fdbclient/ConfigKnobs.h rename to src/fdbclient/include/fdbclient/ConfigKnobs.h index 536bca1..168e2fe 100644 --- a/src/fdbclient/ConfigKnobs.h +++ b/src/fdbclient/include/fdbclient/ConfigKnobs.h @@ -25,6 +25,8 @@ #include "fdbclient/FDBTypes.h" +typedef uint64_t CoordinatorsHash; + /* * KnobValueRefs are stored in the configuration database, and in local configuration files. They are created from * ParsedKnobValue objects, so it is assumed that the value type is correct for the corresponding knob name diff --git a/src/fdbclient/ConfigTransactionInterface.h b/src/fdbclient/include/fdbclient/ConfigTransactionInterface.h similarity index 78% rename from src/fdbclient/ConfigTransactionInterface.h rename to src/fdbclient/include/fdbclient/ConfigTransactionInterface.h index 98b65e4..dad60f2 100644 --- a/src/fdbclient/ConfigTransactionInterface.h +++ b/src/fdbclient/include/fdbclient/ConfigTransactionInterface.h @@ -65,16 +65,18 @@ struct ConfigTransactionGetGenerationReply { struct ConfigTransactionGetGenerationRequest { static constexpr FileIdentifier file_identifier = 138941; + CoordinatorsHash coordinatorsHash{ 0 }; // A hint to catch up lagging nodes: Optional lastSeenLiveVersion; ReplyPromise reply; ConfigTransactionGetGenerationRequest() = default; - explicit ConfigTransactionGetGenerationRequest(Optional const& lastSeenLiveVersion) - : lastSeenLiveVersion(lastSeenLiveVersion) {} + explicit ConfigTransactionGetGenerationRequest(CoordinatorsHash coordinatorsHash, + Optional const& lastSeenLiveVersion) + : coordinatorsHash(coordinatorsHash), lastSeenLiveVersion(lastSeenLiveVersion) {} template void serialize(Ar& ar) { - serializer(ar, lastSeenLiveVersion, reply); + serializer(ar, coordinatorsHash, lastSeenLiveVersion, reply); } }; @@ -92,39 +94,43 @@ struct ConfigTransactionGetReply { struct ConfigTransactionGetRequest { static constexpr FileIdentifier file_identifier = 923040; + CoordinatorsHash coordinatorsHash{ 0 }; ConfigGeneration generation; ConfigKey key; ReplyPromise reply; ConfigTransactionGetRequest() = default; - explicit ConfigTransactionGetRequest(ConfigGeneration generation, ConfigKey key) - : generation(generation), key(key) {} + explicit ConfigTransactionGetRequest(CoordinatorsHash coordinatorsHash, ConfigGeneration generation, ConfigKey key) + : coordinatorsHash(coordinatorsHash), generation(generation), key(key) {} template void serialize(Ar& ar) { - serializer(ar, generation, key, reply); + serializer(ar, coordinatorsHash, generation, key, reply); } }; struct ConfigTransactionCommitRequest { static constexpr FileIdentifier file_identifier = 103841; Arena arena; + CoordinatorsHash coordinatorsHash{ 0 }; ConfigGeneration generation{ ::invalidVersion, ::invalidVersion }; VectorRef mutations; ConfigCommitAnnotationRef annotation; ReplyPromise reply; ConfigTransactionCommitRequest() = default; - explicit ConfigTransactionCommitRequest(ConfigGeneration generation, + explicit ConfigTransactionCommitRequest(CoordinatorsHash coordinatorsHash, + ConfigGeneration generation, VectorRef mutations, ConfigCommitAnnotationRef annotation) - : generation(generation), mutations(arena, mutations), annotation(arena, annotation) {} + : coordinatorsHash(coordinatorsHash), generation(generation), mutations(arena, mutations), + annotation(arena, annotation) {} size_t expectedSize() const { return mutations.expectedSize() + annotation.expectedSize(); } template void serialize(Ar& ar) { - serializer(ar, arena, generation, mutations, annotation, reply); + serializer(ar, coordinatorsHash, generation, mutations, annotation, reply, arena); } }; @@ -144,15 +150,17 @@ struct ConfigTransactionGetConfigClassesReply { struct ConfigTransactionGetConfigClassesRequest { static constexpr FileIdentifier file_identifier = 7163400; + CoordinatorsHash coordinatorsHash{ 0 }; ConfigGeneration generation; ReplyPromise reply; ConfigTransactionGetConfigClassesRequest() = default; - explicit ConfigTransactionGetConfigClassesRequest(ConfigGeneration generation) : generation(generation) {} + explicit ConfigTransactionGetConfigClassesRequest(CoordinatorsHash coordinatorsHash, ConfigGeneration generation) + : coordinatorsHash(coordinatorsHash), generation(generation) {} template void serialize(Ar& ar) { - serializer(ar, generation); + serializer(ar, coordinatorsHash, generation); } }; @@ -171,17 +179,20 @@ struct ConfigTransactionGetKnobsReply { struct ConfigTransactionGetKnobsRequest { static constexpr FileIdentifier file_identifier = 987410; + CoordinatorsHash coordinatorsHash{ 0 }; ConfigGeneration generation; Optional configClass; ReplyPromise reply; ConfigTransactionGetKnobsRequest() = default; - explicit ConfigTransactionGetKnobsRequest(ConfigGeneration generation, Optional configClass) - : generation(generation), configClass(configClass) {} + explicit ConfigTransactionGetKnobsRequest(CoordinatorsHash coordinatorsHash, + ConfigGeneration generation, + Optional configClass) + : coordinatorsHash(coordinatorsHash), generation(generation), configClass(configClass) {} template void serialize(Ar& ar) { - serializer(ar, generation, configClass, reply); + serializer(ar, coordinatorsHash, generation, configClass, reply); } }; diff --git a/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.g.h b/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.g.h new file mode 100644 index 0000000..96cbf04 --- /dev/null +++ b/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.g.h @@ -0,0 +1,184 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.h" +/* + * ConsistencyScanInterface.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2019 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. + */ + +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_CONSISTENCYSCANINTERFACE_ACTOR_G_H) +#define FDBCLIENT_CONSISTENCYSCANINTERFACE_ACTOR_G_H +#include "fdbclient/ConsistencyScanInterface.actor.g.h" +#elif !defined(FDBCLIENT_CONSISTENCYSCANINTERFACE_ACTOR_H) +#define FDBCLIENT_CONSISTENCYSCANINTERFACE_ACTOR_H + +#include "fdbclient/CommitProxyInterface.h" +#include "fdbclient/DatabaseConfiguration.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/RunRYWTransaction.actor.h" +#include "fdbrpc/fdbrpc.h" +#include "fdbrpc/Locality.h" + +#include "flow/actorcompiler.h" // must be last include + +struct ConsistencyScanInterface { + constexpr static FileIdentifier file_identifier = 4983265; + RequestStream> waitFailure; + RequestStream haltConsistencyScan; + struct LocalityData locality; + UID myId; + + ConsistencyScanInterface() {} + explicit ConsistencyScanInterface(const struct LocalityData& l, UID id) : locality(l), myId(id) {} + + void initEndpoints() {} + UID id() const { return myId; } + NetworkAddress address() const { return waitFailure.getEndpoint().getPrimaryAddress(); } + bool operator==(const ConsistencyScanInterface& r) const { return id() == r.id(); } + bool operator!=(const ConsistencyScanInterface& r) const { return !(*this == r); } + + template + void serialize(Archive& ar) { + serializer(ar, waitFailure, haltConsistencyScan, locality, myId); + } +}; + +struct HaltConsistencyScanRequest { + constexpr static FileIdentifier file_identifier = 2323417; + UID requesterID; + ReplyPromise reply; + + HaltConsistencyScanRequest() {} + explicit HaltConsistencyScanRequest(UID uid) : requesterID(uid) {} + + template + void serialize(Ar& ar) { + serializer(ar, requesterID, reply); + } +}; + +// consistency scan configuration and metrics +struct ConsistencyScanInfo { + constexpr static FileIdentifier file_identifier = 732125; + bool consistency_scan_enabled = false; + bool restart = false; + int64_t max_rate = 0; + int64_t target_interval = CLIENT_KNOBS->CONSISTENCY_CHECK_ONE_ROUND_TARGET_COMPLETION_TIME; + int64_t bytes_read_prev_round = 0; + KeyRef progress_key = KeyRef(); + + // Round Metrics - one round of complete validation across all SSs + // Start and finish are in epoch seconds + double last_round_start = 0; + double last_round_finish = 0; + TimerSmoother smoothed_round_duration; + int finished_rounds = 0; + + ConsistencyScanInfo() : smoothed_round_duration(20.0 * 60) {} + ConsistencyScanInfo(bool enabled, bool r, uint64_t rate, uint64_t interval) + : consistency_scan_enabled(enabled), restart(r), max_rate(rate), target_interval(interval), + smoothed_round_duration(20.0 * 60) {} + + template + void serialize(Ar& ar) { + double round_total; + if (!ar.isDeserializing) { + round_total = smoothed_round_duration.getTotal(); + } + serializer(ar, + consistency_scan_enabled, + restart, + max_rate, + target_interval, + bytes_read_prev_round, + last_round_start, + last_round_finish, + round_total, + finished_rounds); + if (ar.isDeserializing) { + smoothed_round_duration.reset(round_total); + } + } + + static Future setInfo(Reference tr, ConsistencyScanInfo info) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + tr->set(consistencyScanInfoKey, ObjectWriter::toValue(info, IncludeVersion())); + return Void(); + } + + static Future setInfo(Database cx, ConsistencyScanInfo info) { + return runRYWTransaction( + cx, [=](Reference tr) -> Future { return setInfo(tr, info); }); + } + + static Future> getInfo(Reference tr) { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + return tr->get(consistencyScanInfoKey); + } + + static Future> getInfo(Database cx) { + return runRYWTransaction( + cx, [=](Reference tr) -> Future> { return getInfo(tr); }); + } + + StatusObject toJSON() const { + StatusObject result; + result["consistency_scan_enabled"] = consistency_scan_enabled; + result["restart"] = restart; + result["max_rate"] = max_rate; + result["target_interval"] = target_interval; + result["bytes_read_prev_round"] = bytes_read_prev_round; + result["last_round_start_datetime"] = epochsToGMTString(last_round_start); + result["last_round_finish_datetime"] = epochsToGMTString(last_round_finish); + result["last_round_start_timestamp"] = last_round_start; + result["last_round_finish_timestamp"] = last_round_finish; + result["smoothed_round_seconds"] = smoothed_round_duration.smoothTotal(); + result["finished_rounds"] = finished_rounds; + return result; + } + + std::string toString() const { + return format("consistency_scan_enabled = %d, restart = %d, max_rate = %ld, target_interval = %ld", + consistency_scan_enabled, + restart, + max_rate, + target_interval); + } +}; + + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.g.h" +[[nodiscard]] Future getVersion( Database const& cx ); + +#line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.h" + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.g.h" +[[nodiscard]] Future getKeyServers( Database const& cx, Promise>>> const& keyServersPromise, KeyRangeRef const& kr, bool const& performQuiescentChecks, bool const& failureIsError, bool* const& success ); + +#line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.h" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.g.h" +[[nodiscard]] Future getKeyLocations( Database const& cx, std::vector>> const& shards, Promise>> const& keyLocationPromise, bool const& performQuiescentChecks, bool* const& success ); + +#line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.h" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.g.h" +[[nodiscard]] Future checkDataConsistency( Database const& cx, VectorRef const& keyLocations, DatabaseConfiguration const& configuration, std::map const& tssMapping, bool const& performQuiescentChecks, bool const& performTSSCheck, bool const& firstClient, bool const& failureIsError, int const& clientId, int const& clientCount, bool const& distributed, bool const& shuffleShards, int const& shardSampleFactor, int64_t const& sharedRandomNumber, int64_t const& repetitions, int64_t* const& bytesReadInPreviousRound, int const& restart, int64_t const& maxRate, int64_t const& targetInterval, KeyRef const& progressKey, bool* const& success ); + +#line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.h" + +#include "flow/unactorcompiler.h" + +#endif // FDBCLIENT_CONSISTENCYSCANINTERFACE_H \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.h b/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.h new file mode 100644 index 0000000..e831ce5 --- /dev/null +++ b/src/fdbclient/include/fdbclient/ConsistencyScanInterface.actor.h @@ -0,0 +1,200 @@ +/* + * ConsistencyScanInterface.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2019 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. + */ + +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_CONSISTENCYSCANINTERFACE_ACTOR_G_H) +#define FDBCLIENT_CONSISTENCYSCANINTERFACE_ACTOR_G_H +#include "fdbclient/ConsistencyScanInterface.actor.g.h" +#elif !defined(FDBCLIENT_CONSISTENCYSCANINTERFACE_ACTOR_H) +#define FDBCLIENT_CONSISTENCYSCANINTERFACE_ACTOR_H + +#include "fdbclient/CommitProxyInterface.h" +#include "fdbclient/DatabaseConfiguration.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/RunRYWTransaction.actor.h" +#include "fdbrpc/fdbrpc.h" +#include "fdbrpc/Locality.h" + +#include "flow/actorcompiler.h" // must be last include + +struct ConsistencyScanInterface { + constexpr static FileIdentifier file_identifier = 4983265; + RequestStream> waitFailure; + RequestStream haltConsistencyScan; + struct LocalityData locality; + UID myId; + + ConsistencyScanInterface() {} + explicit ConsistencyScanInterface(const struct LocalityData& l, UID id) : locality(l), myId(id) {} + + void initEndpoints() {} + UID id() const { return myId; } + NetworkAddress address() const { return waitFailure.getEndpoint().getPrimaryAddress(); } + bool operator==(const ConsistencyScanInterface& r) const { return id() == r.id(); } + bool operator!=(const ConsistencyScanInterface& r) const { return !(*this == r); } + + template + void serialize(Archive& ar) { + serializer(ar, waitFailure, haltConsistencyScan, locality, myId); + } +}; + +struct HaltConsistencyScanRequest { + constexpr static FileIdentifier file_identifier = 2323417; + UID requesterID; + ReplyPromise reply; + + HaltConsistencyScanRequest() {} + explicit HaltConsistencyScanRequest(UID uid) : requesterID(uid) {} + + template + void serialize(Ar& ar) { + serializer(ar, requesterID, reply); + } +}; + +// consistency scan configuration and metrics +struct ConsistencyScanInfo { + constexpr static FileIdentifier file_identifier = 732125; + bool consistency_scan_enabled = false; + bool restart = false; + int64_t max_rate = 0; + int64_t target_interval = CLIENT_KNOBS->CONSISTENCY_CHECK_ONE_ROUND_TARGET_COMPLETION_TIME; + int64_t bytes_read_prev_round = 0; + KeyRef progress_key = KeyRef(); + + // Round Metrics - one round of complete validation across all SSs + // Start and finish are in epoch seconds + double last_round_start = 0; + double last_round_finish = 0; + TimerSmoother smoothed_round_duration; + int finished_rounds = 0; + + ConsistencyScanInfo() : smoothed_round_duration(20.0 * 60) {} + ConsistencyScanInfo(bool enabled, bool r, uint64_t rate, uint64_t interval) + : consistency_scan_enabled(enabled), restart(r), max_rate(rate), target_interval(interval), + smoothed_round_duration(20.0 * 60) {} + + template + void serialize(Ar& ar) { + double round_total; + if (!ar.isDeserializing) { + round_total = smoothed_round_duration.getTotal(); + } + serializer(ar, + consistency_scan_enabled, + restart, + max_rate, + target_interval, + bytes_read_prev_round, + last_round_start, + last_round_finish, + round_total, + finished_rounds); + if (ar.isDeserializing) { + smoothed_round_duration.reset(round_total); + } + } + + static Future setInfo(Reference tr, ConsistencyScanInfo info) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + tr->set(consistencyScanInfoKey, ObjectWriter::toValue(info, IncludeVersion())); + return Void(); + } + + static Future setInfo(Database cx, ConsistencyScanInfo info) { + return runRYWTransaction( + cx, [=](Reference tr) -> Future { return setInfo(tr, info); }); + } + + static Future> getInfo(Reference tr) { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + return tr->get(consistencyScanInfoKey); + } + + static Future> getInfo(Database cx) { + return runRYWTransaction( + cx, [=](Reference tr) -> Future> { return getInfo(tr); }); + } + + StatusObject toJSON() const { + StatusObject result; + result["consistency_scan_enabled"] = consistency_scan_enabled; + result["restart"] = restart; + result["max_rate"] = max_rate; + result["target_interval"] = target_interval; + result["bytes_read_prev_round"] = bytes_read_prev_round; + result["last_round_start_datetime"] = epochsToGMTString(last_round_start); + result["last_round_finish_datetime"] = epochsToGMTString(last_round_finish); + result["last_round_start_timestamp"] = last_round_start; + result["last_round_finish_timestamp"] = last_round_finish; + result["smoothed_round_seconds"] = smoothed_round_duration.smoothTotal(); + result["finished_rounds"] = finished_rounds; + return result; + } + + std::string toString() const { + return format("consistency_scan_enabled = %d, restart = %d, max_rate = %ld, target_interval = %ld", + consistency_scan_enabled, + restart, + max_rate, + target_interval); + } +}; + +ACTOR Future getVersion(Database cx); +ACTOR Future getKeyServers( + Database cx, + Promise>>> keyServersPromise, + KeyRangeRef kr, + bool performQuiescentChecks, + bool failureIsError, + bool* success); +ACTOR Future getKeyLocations(Database cx, + std::vector>> shards, + Promise>> keyLocationPromise, + bool performQuiescentChecks, + bool* success); +ACTOR Future checkDataConsistency(Database cx, + VectorRef keyLocations, + DatabaseConfiguration configuration, + std::map tssMapping, + bool performQuiescentChecks, + bool performTSSCheck, + bool firstClient, + bool failureIsError, + int clientId, + int clientCount, + bool distributed, + bool shuffleShards, + int shardSampleFactor, + int64_t sharedRandomNumber, + int64_t repetitions, + int64_t* bytesReadInPreviousRound, + int restart, + int64_t maxRate, + int64_t targetInterval, + KeyRef progressKey, + bool* success); + +#include "flow/unactorcompiler.h" + +#endif // FDBCLIENT_CONSISTENCYSCANINTERFACE_H \ No newline at end of file diff --git a/src/fdbclient/ConvertUTF.h b/src/fdbclient/include/fdbclient/ConvertUTF.h similarity index 100% rename from src/fdbclient/ConvertUTF.h rename to src/fdbclient/include/fdbclient/ConvertUTF.h diff --git a/src/fdbclient/CoordinationInterface.h b/src/fdbclient/include/fdbclient/CoordinationInterface.h similarity index 89% rename from src/fdbclient/CoordinationInterface.h rename to src/fdbclient/include/fdbclient/CoordinationInterface.h index 7897ded..2870215 100644 --- a/src/fdbclient/CoordinationInterface.h +++ b/src/fdbclient/include/fdbclient/CoordinationInterface.h @@ -27,14 +27,14 @@ #include "fdbrpc/Locality.h" #include "fdbclient/CommitProxyInterface.h" #include "fdbclient/ClusterInterface.h" -#include "fdbclient/WellKnownEndpoints.h" +#include "fdbrpc/WellKnownEndpoints.h" #include "flow/Hostname.h" const int MAX_CLUSTER_FILE_BYTES = 60000; struct ClientLeaderRegInterface { - RequestStream getLeader; - RequestStream openDatabase; + PublicRequestStream getLeader; + PublicRequestStream openDatabase; RequestStream checkDescriptorMutable; Optional hostname; @@ -46,6 +46,8 @@ struct ClientLeaderRegInterface { bool operator==(const ClientLeaderRegInterface& rhs) const { return getLeader == rhs.getLeader && openDatabase == rhs.openDatabase; } + + std::string getAddressString() const; }; // A string containing the information necessary to connect to a cluster. @@ -61,6 +63,8 @@ struct ClientLeaderRegInterface { // - There is no address present more than once class ClusterConnectionString { public: + constexpr static FileIdentifier file_identifier = 13602011; + ClusterConnectionString() {} ClusterConnectionString(const std::string& connectionString); ClusterConnectionString(const std::vector& coordinators, Key key); @@ -82,12 +86,30 @@ class ClusterConnectionString { std::vector coords; std::vector hostnames; + size_t getNumberOfCoordinators() const { return coords.size() + hostnames.size(); } + + // Determine the local source IP used to connect to the cluster by connecting to the first available coordinator. + // Throw bind_failed() if no connection attempts were successful. + // This function blocks on connection attempts. + IPAddress determineLocalSourceIP() const; + + bool operator==(const ClusterConnectionString& other) const noexcept { + return key == other.key && keyDesc == other.keyDesc && coords == other.coords && hostnames == other.hostnames; + } + bool operator!=(const ClusterConnectionString& other) const noexcept { return !(*this == other); } + private: void parseConnString(); Key key, keyDesc; + +public: + template + void serialize(Ar& ar) { + serializer(ar, coords, hostnames, key, keyDesc); + } }; -FDB_DECLARE_BOOLEAN_PARAM(ConnectionStringNeedsPersisted); +FDB_BOOLEAN_PARAM(ConnectionStringNeedsPersisted); // A record that stores the connection string used to connect to a cluster. This record can be updated when a cluster // notifies a connected party that the connection string has changed. @@ -155,6 +177,11 @@ class IClusterConnectionRecord { bool connectionStringNeedsPersisted; }; +template <> +struct Traceable : std::true_type { + static std::string toString(IClusterConnectionRecord const& record) { return record.toString(); } +}; + struct LeaderInfo { constexpr static FileIdentifier file_identifier = 8338794; // The first 7 bits of changeID represent cluster controller process class fitness, the lower the better @@ -222,6 +249,8 @@ struct GetLeaderRequest { GetLeaderRequest() {} explicit GetLeaderRequest(Key key, UID kl) : key(key), knownLeader(kl) {} + bool verify() const { return true; } + template void serialize(Ar& ar) { serializer(ar, key, knownLeader, reply); @@ -243,6 +272,8 @@ struct OpenDatabaseCoordRequest { ReplyPromise> reply; bool internal{ true }; + bool verify() const { return true; } + template void serialize(Ar& ar) { serializer(ar, @@ -258,6 +289,8 @@ struct OpenDatabaseCoordRequest { } }; +extern template struct NetNotifiedQueue; + class ClientCoordinators { public: std::vector clientLeaderServers; @@ -289,6 +322,9 @@ struct ProtocolInfoRequest { constexpr static FileIdentifier file_identifier = 13261233; ReplyPromise reply{ PeerCompatibilityPolicy{ RequirePeer::AtLeast, ProtocolVersion::withStableInterfaces() } }; + + bool verify() const noexcept { return true; } + template void serialize(Ar& ar) { serializer(ar, reply); diff --git a/src/fdbclient/include/fdbclient/DataDistributionConfig.actor.g.h b/src/fdbclient/include/fdbclient/DataDistributionConfig.actor.g.h new file mode 100644 index 0000000..e07e13d --- /dev/null +++ b/src/fdbclient/include/fdbclient/DataDistributionConfig.actor.g.h @@ -0,0 +1,116 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/DataDistributionConfig.actor.h" +/* + * DataDistributionConfig.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_DATA_DISTRIBUTION_CONFIG_ACTOR_G_H) +#define FDBCLIENT_DATA_DISTRIBUTION_CONFIG_ACTOR_G_H +#include "fdbclient/DataDistributionConfig.actor.g.h" +#elif !defined(FDBCLIENT_DATA_DISTRIBUTION_CONFIG_ACTOR_H) +#define FDBCLIENT_DATA_DISTRIBUTION_CONFIG_ACTOR_H + +#include "flow/serialize.h" +#include "fdbclient/NativeAPI.actor.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/KeyBackedTypes.actor.h" +#include "fdbclient/KeyBackedRangeMap.actor.h" +#include "fdbclient/ReadYourWrites.h" +#include "fdbclient/RunTransaction.actor.h" +#include "fdbclient/DatabaseContext.h" +#include "fdbclient/json_spirit/json_spirit_value.h" +#include "flow/actorcompiler.h" // This must be the last #include. + +// DD Configuration for a key range range. +// There are many properties here, all Optional, because for a given key range range a property +// can be unspecified which means it continues the setting of the preceding range. +struct DDRangeConfig { + constexpr static FileIdentifier file_identifier = 9193856; + + DDRangeConfig(Optional replicationFactor = {}, Optional teamID = {}) + : replicationFactor(replicationFactor), teamID(teamID) {} + + Optional replicationFactor; + // Ranges with different team IDs should be assigned to different storage teams + // Shards with the same team ID can be assigned to the same storage team but nothing enforces/prefers this. + Optional teamID; + + DDRangeConfig apply(DDRangeConfig const& update) const { + DDRangeConfig result = *this; + if (update.replicationFactor.present()) { + result.replicationFactor = update.replicationFactor; + } + if (update.teamID.present()) { + result.teamID = update.teamID; + } + + return result; + } + + bool operator==(DDRangeConfig const& rhs) const = default; + + // String description of the range config + std::string toString() const { return fmt::format("replication={} teamID={}", replicationFactor, teamID); } + + template + void serialize(Ar& ar) { + serializer(ar, replicationFactor, teamID); + } + + json_spirit::mObject toJSON() const { + json_spirit::mObject doc; + if (teamID.present()) { + doc["teamID"] = *teamID; + } + if (replicationFactor.present()) { + doc["replicationFactor"] = *replicationFactor; + } + return doc; + } +}; + +template <> +struct Traceable : std::true_type { + static std::string toString(const DDRangeConfig& c) { return c.toString(); } +}; + +template <> +struct fmt::formatter : FormatUsingTraceable {}; + +struct DDConfiguration : public KeyBackedClass { + DDConfiguration(KeyRef prefix = SystemKey("\xff\x02/ddconfig/"_sr)) : KeyBackedClass(prefix) {} + + // RangeConfigMap is a KeyBackedRangeMap of DDRangeConfig values describing various option overrides for key ranges + typedef KeyBackedRangeMap, + ObjectCodec> + RangeConfigMap; + + typedef RangeConfigMap::LocalSnapshot RangeConfigMapSnapshot; + + // Range configuration options set by Users + RangeConfigMap userRangeConfig() const { return { subspace.pack(__FUNCTION__sr), trigger, IncludeVersion() }; } + + static json_spirit::mValue toJSON(RangeConfigMapSnapshot const& snapshot, bool includeDefaultRanges = false); +}; + +#include "flow/unactorcompiler.h" +#endif diff --git a/src/fdbclient/include/fdbclient/DataDistributionConfig.actor.h b/src/fdbclient/include/fdbclient/DataDistributionConfig.actor.h new file mode 100644 index 0000000..1f43e33 --- /dev/null +++ b/src/fdbclient/include/fdbclient/DataDistributionConfig.actor.h @@ -0,0 +1,114 @@ +/* + * DataDistributionConfig.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_DATA_DISTRIBUTION_CONFIG_ACTOR_G_H) +#define FDBCLIENT_DATA_DISTRIBUTION_CONFIG_ACTOR_G_H +#include "fdbclient/DataDistributionConfig.actor.g.h" +#elif !defined(FDBCLIENT_DATA_DISTRIBUTION_CONFIG_ACTOR_H) +#define FDBCLIENT_DATA_DISTRIBUTION_CONFIG_ACTOR_H + +#include "flow/serialize.h" +#include "fdbclient/NativeAPI.actor.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/KeyBackedTypes.actor.h" +#include "fdbclient/KeyBackedRangeMap.actor.h" +#include "fdbclient/ReadYourWrites.h" +#include "fdbclient/RunTransaction.actor.h" +#include "fdbclient/DatabaseContext.h" +#include "fdbclient/json_spirit/json_spirit_value.h" +#include "flow/actorcompiler.h" // This must be the last #include. + +// DD Configuration for a key range range. +// There are many properties here, all Optional, because for a given key range range a property +// can be unspecified which means it continues the setting of the preceding range. +struct DDRangeConfig { + constexpr static FileIdentifier file_identifier = 9193856; + + DDRangeConfig(Optional replicationFactor = {}, Optional teamID = {}) + : replicationFactor(replicationFactor), teamID(teamID) {} + + Optional replicationFactor; + // Ranges with different team IDs should be assigned to different storage teams + // Shards with the same team ID can be assigned to the same storage team but nothing enforces/prefers this. + Optional teamID; + + DDRangeConfig apply(DDRangeConfig const& update) const { + DDRangeConfig result = *this; + if (update.replicationFactor.present()) { + result.replicationFactor = update.replicationFactor; + } + if (update.teamID.present()) { + result.teamID = update.teamID; + } + + return result; + } + + bool operator==(DDRangeConfig const& rhs) const = default; + + // String description of the range config + std::string toString() const { return fmt::format("replication={} teamID={}", replicationFactor, teamID); } + + template + void serialize(Ar& ar) { + serializer(ar, replicationFactor, teamID); + } + + json_spirit::mObject toJSON() const { + json_spirit::mObject doc; + if (teamID.present()) { + doc["teamID"] = *teamID; + } + if (replicationFactor.present()) { + doc["replicationFactor"] = *replicationFactor; + } + return doc; + } +}; + +template <> +struct Traceable : std::true_type { + static std::string toString(const DDRangeConfig& c) { return c.toString(); } +}; + +template <> +struct fmt::formatter : FormatUsingTraceable {}; + +struct DDConfiguration : public KeyBackedClass { + DDConfiguration(KeyRef prefix = SystemKey("\xff\x02/ddconfig/"_sr)) : KeyBackedClass(prefix) {} + + // RangeConfigMap is a KeyBackedRangeMap of DDRangeConfig values describing various option overrides for key ranges + typedef KeyBackedRangeMap, + ObjectCodec> + RangeConfigMap; + + typedef RangeConfigMap::LocalSnapshot RangeConfigMapSnapshot; + + // Range configuration options set by Users + RangeConfigMap userRangeConfig() const { return { subspace.pack(__FUNCTION__sr), trigger, IncludeVersion() }; } + + static json_spirit::mValue toJSON(RangeConfigMapSnapshot const& snapshot, bool includeDefaultRanges = false); +}; + +#include "flow/unactorcompiler.h" +#endif diff --git a/src/fdbclient/DatabaseConfiguration.h b/src/fdbclient/include/fdbclient/DatabaseConfiguration.h similarity index 96% rename from src/fdbclient/DatabaseConfiguration.h rename to src/fdbclient/include/fdbclient/DatabaseConfiguration.h index 923a2d0..1303d94 100644 --- a/src/fdbclient/DatabaseConfiguration.h +++ b/src/fdbclient/include/fdbclient/DatabaseConfiguration.h @@ -119,6 +119,10 @@ struct DatabaseConfiguration { StatusObject toJSON(bool noPolicies = false) const; StatusArray getRegionJSON() const; + // Given a JSON object representing a DatabaseConfiguration, generate a configuration command + // that would set a database to those options. + static std::string configureStringFromJSON(const StatusObject& json); + RegionInfo getRegion(Optional dcId) const { if (!dcId.present()) { return RegionInfo(); @@ -257,13 +261,16 @@ struct DatabaseConfiguration { bool blobGranulesEnabled; TenantMode tenantMode; + EncryptionAtRestMode encryptionAtRestMode; + // Excluded servers (no state should be here) - bool isExcludedServer(NetworkAddressList) const; + bool isExcludedServer(NetworkAddressList, const LocalityData& locality) const; bool isExcludedLocality(const LocalityData& locality) const; bool isMachineExcluded(const LocalityData& locality) const; std::set getExcludedServers() const; std::set getExcludedLocalities() const; + // report auto value or configured value int32_t getDesiredCommitProxies() const { if (commitProxyCount == -1) return autoCommitProxyCount; diff --git a/src/fdbclient/DatabaseContext.h b/src/fdbclient/include/fdbclient/DatabaseContext.h similarity index 65% rename from src/fdbclient/DatabaseContext.h rename to src/fdbclient/include/fdbclient/DatabaseContext.h index b051fe9..c26e509 100644 --- a/src/fdbclient/DatabaseContext.h +++ b/src/fdbclient/include/fdbclient/DatabaseContext.h @@ -21,10 +21,12 @@ #ifndef DatabaseContext_h #define DatabaseContext_h #include "fdbclient/Notified.h" +#include "flow/ApiVersion.h" #include "flow/FastAlloc.h" #include "flow/FastRef.h" #include "fdbclient/GlobalConfig.actor.h" #include "fdbclient/StorageServerInterface.h" +#include "flow/IRandom.h" #include "flow/genericactors.actor.h" #include #include @@ -36,12 +38,13 @@ #include "fdbclient/CommitProxyInterface.h" #include "fdbclient/SpecialKeySpace.actor.h" #include "fdbclient/VersionVector.h" +#include "fdbclient/IKeyValueStore.h" #include "fdbrpc/QueueModel.h" #include "fdbrpc/MultiInterface.h" #include "flow/TDMetric.actor.h" #include "fdbclient/EventTypes.actor.h" -#include "fdbrpc/ContinuousSample.h" #include "fdbrpc/Smoother.h" +#include "fdbrpc/DDSketch.h" class StorageServerInfo : public ReferencedInterface { public: @@ -116,23 +119,7 @@ class ClientTagThrottleData : NonCopyable { bool canRecheck() const { return lastCheck < now() - CLIENT_KNOBS->TAG_THROTTLE_RECHECK_INTERVAL; } - double throttleDuration() const { - if (expiration <= now()) { - return 0.0; - } - - double capacity = - (smoothRate.smoothTotal() - smoothReleased.smoothRate()) * CLIENT_KNOBS->TAG_THROTTLE_SMOOTHING_WINDOW; - if (capacity >= 1) { - return 0.0; - } - - if (tpsRate == 0) { - return std::max(0.0, expiration - now()); - } - - return std::min(expiration - now(), capacity / tpsRate); - } + double throttleDuration() const; }; struct WatchParameters : public ReferenceCounted { @@ -142,7 +129,7 @@ struct WatchParameters : public ReferenceCounted { const Version version; const TagSet tags; - const SpanID spanID; + const SpanContext spanContext; const TaskPriority taskID; const Optional debugID; const UseProvisionalProxies useProvisionalProxies; @@ -152,24 +139,22 @@ struct WatchParameters : public ReferenceCounted { Optional value, Version version, TagSet tags, - SpanID spanID, + SpanContext spanContext, TaskPriority taskID, Optional debugID, UseProvisionalProxies useProvisionalProxies) - : tenant(tenant), key(key), value(value), version(version), tags(tags), spanID(spanID), taskID(taskID), + : tenant(tenant), key(key), value(value), version(version), tags(tags), spanContext(spanContext), taskID(taskID), debugID(debugID), useProvisionalProxies(useProvisionalProxies) {} }; class WatchMetadata : public ReferenceCounted { public: Promise watchPromise; - Future watchFuture; Future watchFutureSS; Reference parameters; - WatchMetadata(Reference parameters) - : watchFuture(watchPromise.getFuture()), parameters(parameters) {} + WatchMetadata(Reference parameters) : parameters(parameters) {} }; struct MutationAndVersionStream { @@ -183,10 +168,11 @@ struct ChangeFeedStorageData : ReferenceCounted { Future updater; NotifiedVersion version; NotifiedVersion desired; - Promise destroyed; UID interfToken; + DatabaseContext* context; + double created; - ~ChangeFeedStorageData() { destroyed.send(Void()); } + ~ChangeFeedStorageData(); }; struct ChangeFeedData : ReferenceCounted { @@ -196,6 +182,8 @@ struct ChangeFeedData : ReferenceCounted { Version getVersion(); Future whenAtLeast(Version version); + UID dbgid; + DatabaseContext* context; NotifiedVersion lastReturnedVersion; std::vector> storageData; AsyncVar notAtLatest; @@ -204,8 +192,10 @@ struct ChangeFeedData : ReferenceCounted { Version endVersion = invalidVersion; Version popVersion = invalidVersion; // like TLog pop version, set by SS and client can check it to see if they missed data + double created = 0; - ChangeFeedData() : notAtLatest(1) {} + explicit ChangeFeedData(DatabaseContext* context = nullptr); + ~ChangeFeedData(); }; struct EndpointFailureInfo { @@ -214,15 +204,61 @@ struct EndpointFailureInfo { }; struct KeyRangeLocationInfo { - TenantMapEntry tenantEntry; KeyRange range; Reference locations; KeyRangeLocationInfo() {} - KeyRangeLocationInfo(TenantMapEntry tenantEntry, KeyRange range, Reference locations) - : tenantEntry(tenantEntry), range(range), locations(locations) {} + KeyRangeLocationInfo(KeyRange range, Reference locations) : range(range), locations(locations) {} }; +struct OverlappingChangeFeedsInfo { + Arena arena; + VectorRef feeds; + // would prefer to use key range map but it complicates copy/move constructors + std::vector> feedMetadataVersions; + + // for a feed that wasn't present, returns the metadata version it would have been fetched at. + Version getFeedMetadataVersion(const KeyRangeRef& feedRange) const; +}; + +struct ChangeFeedCacheRange { + Key tenantPrefix; + Key rangeId; + KeyRange range; + + ChangeFeedCacheRange(Key tenantPrefix, Key rangeId, KeyRange range) + : tenantPrefix(tenantPrefix), rangeId(rangeId), range(range) {} + ChangeFeedCacheRange(std::tuple range) + : tenantPrefix(std::get<0>(range)), rangeId(std::get<1>(range)), range(std::get<2>(range)) {} + + bool operator==(const ChangeFeedCacheRange& rhs) const { + return tenantPrefix == rhs.tenantPrefix && rangeId == rhs.rangeId && range == rhs.range; + } +}; + +struct ChangeFeedCacheData : ReferenceCounted { + Version version = -1; // The first version durably stored in the cache + Version latest = + -1; // The last version durably store in the cache; this version will not be readable from disk before a commit + Version popped = -1; // The popped version of this change feed + bool active = false; + double inactiveTime = 0; +}; + +namespace std { +template <> +struct hash { + static constexpr std::hash hashFunc{}; + std::size_t operator()(ChangeFeedCacheRange const& range) const { + std::size_t seed = 0; + boost::hash_combine(seed, hashFunc(range.rangeId)); + boost::hash_combine(seed, hashFunc(range.range.begin)); + boost::hash_combine(seed, hashFunc(range.range.end)); + return seed; + } +}; +} // namespace std + class DatabaseContext : public ReferenceCounted, public FastAllocated, NonCopyable { public: static DatabaseContext* allocateOnForeignThread() { @@ -237,7 +273,7 @@ class DatabaseContext : public ReferenceCounted, public FastAll EnableLocalityLoadBalance, TaskPriority taskID = TaskPriority::DefaultEndpoint, LockAware = LockAware::False, - int apiVersion = Database::API_VERSION_LATEST, + int _apiVersion = ApiVersion::LATEST_VERSION, IsSwitchable = IsSwitchable::False); ~DatabaseContext(); @@ -253,7 +289,7 @@ class DatabaseContext : public ReferenceCounted, public FastAll enableLocalityLoadBalance, lockAware, internal, - apiVersion, + apiVersion.version(), switchable, defaultTenant)); cx->globalConfig->init(Reference const>(cx->clientInfo), @@ -261,22 +297,17 @@ class DatabaseContext : public ReferenceCounted, public FastAll return cx; } - Optional getCachedLocation(const Optional& tenant, + Optional getCachedLocation(const TenantInfo& tenant, const KeyRef&, Reverse isBackward = Reverse::False); - bool getCachedLocations(const Optional& tenant, + bool getCachedLocations(const TenantInfo& tenant, const KeyRangeRef&, std::vector&, int limit, Reverse reverse); - void cacheTenant(const TenantName& tenant, const TenantMapEntry& tenantEntry); - Reference setCachedLocation(const Optional& tenant, - const TenantMapEntry& tenantEntry, - const KeyRangeRef&, - const std::vector&); - void invalidateCachedTenant(const TenantNameRef& tenant); - void invalidateCache(const KeyRef& tenantPrefix, const KeyRef& key, Reverse isBackward = Reverse::False); - void invalidateCache(const KeyRef& tenantPrefix, const KeyRangeRef& keys); + Reference setCachedLocation(const KeyRangeRef&, const std::vector&); + void invalidateCache(const Optional& tenantPrefix, const KeyRef& key, Reverse isBackward = Reverse::False); + void invalidateCache(const Optional& tenantPrefix, const KeyRangeRef& keys); // Records that `endpoint` is failed on a healthy server. void setFailedEndpointOnHealthyServer(const Endpoint& endpoint); @@ -296,38 +327,70 @@ class DatabaseContext : public ReferenceCounted, public FastAll bool isCurrentGrvProxy(UID proxyId) const; Future onProxiesChanged(); Future getHealthMetrics(bool detailed); + // Get storage stats of a storage server from the cached healthy metrics if now() - lastUpdate < maxStaleness. + // Otherwise, ask GRVProxy for the up-to-date health metrics. + Future> getStorageStats(const UID& id, double maxStaleness); // Pass a negative value for `shardLimit` to indicate no limit on the shard number. - Future getStorageMetrics(KeyRange const& keys, int shardLimit); - Future, int>> waitStorageMetrics(KeyRange const& keys, - StorageMetrics const& min, - StorageMetrics const& max, - StorageMetrics const& permittedError, - int shardLimit, - int expectedShardCount); + // Pass a valid `trState` with `hasTenant() == true` to make the function tenant-aware. + Future getStorageMetrics( + KeyRange const& keys, + int shardLimit, + Optional> trState = Optional>()); + Future, int>> waitStorageMetrics( + KeyRange const& keys, + StorageMetrics const& min, + StorageMetrics const& max, + StorageMetrics const& permittedError, + int shardLimit, + int expectedShardCount, + Optional> trState = Optional>()); Future splitStorageMetricsStream(PromiseStream const& resultsStream, KeyRange const& keys, StorageMetrics const& limit, - StorageMetrics const& estimated); + StorageMetrics const& estimated, + Optional const& minSplitBytes = {}); Future>> splitStorageMetrics(KeyRange const& keys, StorageMetrics const& limit, - StorageMetrics const& estimated); + StorageMetrics const& estimated, + Optional const& minSplitBytes = {}); Future>> getReadHotRanges(KeyRange const& keys); + Future>> getHotRangeMetrics(StorageServerInterface ssi, + KeyRange const& keys, + ReadHotSubRangeRequest::SplitType type, + int splitCount); // Returns the protocol version reported by the coordinator this client is connected to // If an expected version is given, the future won't return until the protocol version is different than expected // Note: this will never return if the server is running a protocol from FDB 5.0 or older Future getClusterProtocol(Optional expectedVersion = Optional()); - // Update the watch counter for the database - void addWatch(); - void removeWatch(); + // Increases the counter of the number of watches in this DatabaseContext by 1. If the number of watches is too + // many, throws too_many_watches. + void increaseWatchCounter(); + + // Decrease the counter of the number of watches in this DatabaseContext by 1 + void decreaseWatchCounter(); // watch map operations + + // Gets the watch metadata per tenant id and key Reference getWatchMetadata(int64_t tenantId, KeyRef key) const; + + // Refreshes the watch metadata. If the same watch is used (this is determined by the tenant id and the key), the + // metadata will be updated. void setWatchMetadata(Reference metadata); - void deleteWatchMetadata(int64_t tenant, KeyRef key); - void clearWatchMetadata(); + + // Removes the watch metadata + // If removeReferenceCount is set to be true, the corresponding WatchRefCount record is removed, too. + void deleteWatchMetadata(int64_t tenant, KeyRef key, bool removeReferenceCount = false); + + // Increases reference count to the given watch. Returns the number of references to the watch. + int32_t increaseWatchRefCount(const int64_t tenant, KeyRef key, const Version& version); + + // Decreases reference count to the given watch. If the reference count is dropped to 0, the watch metadata will be + // removed. Returns the number of references to the watch. + int32_t decreaseWatchRefCount(const int64_t tenant, KeyRef key, const Version& version); void setOption(FDBDatabaseOptions::Option option, Optional value); @@ -342,10 +405,11 @@ class DatabaseContext : public ReferenceCounted, public FastAll } } - int apiVersionAtLeast(int minVersion) const { return apiVersion < 0 || apiVersion >= minVersion; } + int apiVersionAtLeast(int minVersion) const { return apiVersion.version() >= minVersion; } - Future onConnected(); // Returns after a majority of coordination servers are available and have reported a - // leader. The cluster file therefore is valid, but the database might be unavailable. + Future onConnected() + const; // Returns after a majority of coordination servers are available and have reported a + // leader. The cluster file therefore is valid, but the database might be unavailable. Reference getConnectionRecord(); // Switch the database to use the new connection file, and recreate all pending watches for committed transactions. @@ -373,14 +437,36 @@ class DatabaseContext : public ReferenceCounted, public FastAll Version end = std::numeric_limits::max(), KeyRange range = allKeys, int replyBufferSize = -1, - bool canReadPopped = true); + bool canReadPopped = true, + ReadOptions readOptions = { ReadType::NORMAL, CacheResult::False }, + bool encrypted = false, + Future tenantPrefix = Key()); - Future> getOverlappingChangeFeeds(KeyRangeRef ranges, Version minVersion); + Future getOverlappingChangeFeeds(KeyRangeRef ranges, Version minVersion); Future popChangeFeedMutations(Key rangeID, Version version); - Future purgeBlobGranules(KeyRange keyRange, Version purgeVersion, bool force = false); + // BlobGranule API. + Future purgeBlobGranules(KeyRange keyRange, + Version purgeVersion, + Optional> tenant, + bool force = false); Future waitPurgeGranulesComplete(Key purgeKey); + Future blobbifyRange(KeyRange range, Optional> tenant = {}); + Future blobbifyRangeBlocking(KeyRange range, Optional> tenant = {}); + Future unblobbifyRange(KeyRange range, Optional> tenant = {}); + Future>> listBlobbifiedRanges(KeyRange range, + int rangeLimit, + Optional> tenant = {}); + Future verifyBlobRange(const KeyRange& range, + Optional version, + Optional> tenant = {}); + Future flushBlobRange(const KeyRange& range, + bool compact, + Optional version, + Optional> tenant = {}); + Future blobRestore(const KeyRange range, Optional version); + // private: explicit DatabaseContext(Reference>> connectionRecord, Reference> clientDBInfo, @@ -391,7 +477,7 @@ class DatabaseContext : public ReferenceCounted, public FastAll EnableLocalityLoadBalance, LockAware, IsInternal = IsInternal::True, - int apiVersion = Database::API_VERSION_LATEST, + int _apiVersion = ApiVersion::LATEST_VERSION, IsSwitchable = IsSwitchable::False, Optional defaultTenant = Optional()); @@ -399,6 +485,8 @@ class DatabaseContext : public ReferenceCounted, public FastAll void expireThrottles(); + UID dbId; + // Key DB-specific information Reference>> connectionRecord; AsyncTrigger proxiesChangeTrigger; @@ -420,12 +508,12 @@ class DatabaseContext : public ReferenceCounted, public FastAll Optional defaultTenant; struct VersionRequest { - SpanID spanContext; + SpanContext spanContext; Promise reply; TagSet tags; Optional debugID; - VersionRequest(SpanID spanContext, TagSet tags = TagSet(), Optional debugID = Optional()) + VersionRequest(SpanContext spanContext, TagSet tags = TagSet(), Optional debugID = Optional()) : spanContext(spanContext), tags(tags), debugID(debugID) {} }; @@ -454,10 +542,8 @@ class DatabaseContext : public ReferenceCounted, public FastAll // Cache of location information int locationCacheSize; - int tenantCacheSize; CoalescedKeyRangeMap> locationCache; std::unordered_map failedEndpointsOnHealthyServersInfo; - std::unordered_map tenantCache; std::map server_interf; std::map blobWorker_interf; // blob workers don't change endpoints for the same ID @@ -468,9 +554,23 @@ class DatabaseContext : public ReferenceCounted, public FastAll std::unordered_map> tssMetrics; // map from changeFeedId -> changeFeedRange std::unordered_map changeFeedCache; - std::unordered_map> changeFeedUpdaters; + std::unordered_map changeFeedUpdaters; + std::map notAtLatestChangeFeeds; + + IKeyValueStore* storage = nullptr; + Future changeFeedStorageCommitter; + Future initializeChangeFeedCache = Void(); + int64_t uncommittedCFBytes = 0; + Reference> commitChangeFeedStorage; + + std::unordered_map> changeFeedCaches; + std::unordered_map>> rangeId_cacheData; + + void setStorage(IKeyValueStore* storage); Reference getStorageData(StorageServerInterface interf); + Version getMinimumChangeFeedVersion(); + void setDesiredChangeFeedVersion(Version v); // map from ssid -> ss tag // @note this map allows the client to identify the latest commit versions @@ -478,7 +578,6 @@ class DatabaseContext : public ReferenceCounted, public FastAll // servers by their tags). std::unordered_map ssidTagMapping; - UID dbId; IsInternal internal; // Only contexts created through the C client and fdbcli are non-internal PrioritizedTransactionTagMap throttledTags; @@ -517,7 +616,11 @@ class DatabaseContext : public ReferenceCounted, public FastAll Counter transactionsCommitCompleted; Counter transactionKeyServerLocationRequests; Counter transactionKeyServerLocationRequestsCompleted; + Counter transactionBlobGranuleLocationRequests; + Counter transactionBlobGranuleLocationRequestsCompleted; Counter transactionStatusRequests; + Counter transactionTenantLookupRequests; + Counter transactionTenantLookupRequestsCompleted; Counter transactionsTooOld; Counter transactionsFutureVersions; Counter transactionsNotCommitted; @@ -530,8 +633,28 @@ class DatabaseContext : public ReferenceCounted, public FastAll Counter transactionGrvTimedOutBatches; Counter transactionCommitVersionNotFoundForSS; - ContinuousSample latencies, readLatencies, commitLatencies, GRVLatencies, mutationsPerCommit, - bytesPerCommit, bgLatencies, bgGranulesPerRequest; + // Blob Granule Read metrics. Omit from logging if not used. + bool anyBGReads; + CounterCollection ccBG; + Counter bgReadInputBytes; + Counter bgReadOutputBytes; + Counter bgReadSnapshotRows; + Counter bgReadRowsCleared; + Counter bgReadRowsInserted; + Counter bgReadRowsUpdated; + DDSketch bgLatencies, bgGranulesPerRequest; + + // Change Feed metrics. Omit change feed metrics from logging if not used + bool usedAnyChangeFeeds; + CounterCollection ccFeed; + Counter feedStreamStarts; + Counter feedMergeStreamStarts; + Counter feedErrors; + Counter feedNonRetriableErrors; + Counter feedPops; + Counter feedPopsFallback; + + DDSketch latencies, readLatencies, commitLatencies, GRVLatencies, mutationsPerCommit, bytesPerCommit; int outstandingWatches; int maxOutstandingWatches; @@ -560,7 +683,6 @@ class DatabaseContext : public ReferenceCounted, public FastAll bool transactionTracingSample; double verifyCausalReadsProp = 0.0; bool blobGranuleNoMaterialize = false; - bool anyBlobGranuleRequests = false; Future logger; Future throttleExpirer; @@ -581,7 +703,7 @@ class DatabaseContext : public ReferenceCounted, public FastAll Future statusLeaderMon; double lastStatusFetch; - int apiVersion; + ApiVersion apiVersion; int mvCacheInsertLocation; std::vector>> metadataVersionCache; @@ -598,9 +720,10 @@ class DatabaseContext : public ReferenceCounted, public FastAll AsyncTrigger updateCache; std::vector> specialKeySpaceModules; std::unique_ptr specialKeySpace; - void registerSpecialKeySpaceModule(SpecialKeySpace::MODULE module, - SpecialKeySpace::IMPLTYPE type, - std::unique_ptr&& impl); + void registerSpecialKeysImpl(SpecialKeySpace::MODULE module, + SpecialKeySpace::IMPLTYPE type, + std::unique_ptr&& impl, + int deprecatedVersion = -1); static bool debugUseTags; static const std::vector debugTransactionTagChoices; @@ -635,9 +758,8 @@ class DatabaseContext : public ReferenceCounted, public FastAll // Returns the latest commit versions that mutated the specified storage servers /// @note returns the latest commit version for a storage server only if the latest - // commit version of that storage server is below the specified "readVersion". + // commit version of that storage server is below the transaction's readVersion. void getLatestCommitVersions(const Reference& locationInfo, - Version readVersion, Reference info, VersionVector& latestCommitVersions); @@ -649,6 +771,8 @@ class DatabaseContext : public ReferenceCounted, public FastAll Version readVersion, VersionVector& latestCommitVersion); + TenantMode getTenantMode() const { return clientInfo->get().tenantMode; } + // used in template functions to create a transaction using TransactionT = ReadYourWritesTransaction; Reference createTransaction(); @@ -656,6 +780,40 @@ class DatabaseContext : public ReferenceCounted, public FastAll std::unique_ptr globalConfig; EventCacheHolder connectToDatabaseEventCacheHolder; + Future lookupTenant(TenantName tenant); + + // Get client-side status information as a JSON string with the following schema: + // { "Healthy" : , + // "ClusterID" : , + // "Coordinators" : [

    , ... ], + // "CurrentCoordinator" :
    + // "GrvProxies" : [
    , ... ], + // "CommitProxies" : [
    ", ... ], + // "StorageServers" : [ { "Address" :
    , "SSID" : }, ... ], + // "Connections" : [ + // { "Address" : "
    ", + // "Status" : , + // "Compatible" : , + // "ConnectFailedCount" : , + // "LastConnectTime" : , + // "PingCount" : , + // "PingTimeoutCount" : , + // "BytesSampleTime" : , + // "BytesReceived" : , + // "BytesSent" : , + // "ProtocolVersion" : + // }, + // ... + // ] + // } + // + // The addresses in the Connections array match the addresses of Coordinators, GrvProxies, + // CommitProxies and StorageServers, there is one entry per different address + // + // If the database context is initialized with an error, the JSON contains just the error code + // { "InitializationError" : } + Standalone getClientStatus(); + // Gets a database level backoff delay future, time in seconds. Future getBackoff() const { return backoffDelay > 0.0 ? delay(backoffDelay) : Future(Void()); } @@ -665,9 +823,45 @@ class DatabaseContext : public ReferenceCounted, public FastAll void updateBackoff(const Error& err); private: - std::unordered_map, Reference, boost::hash>> - watchMap; + using WatchMapKey = std::pair; + using WatchMapKeyHasher = boost::hash; + using WatchMapValue = Reference; + using WatchMap_t = std::unordered_map; + + WatchMap_t watchMap; + + // The reason of using a multiset of Versions as counter instead of a simpler integer counter is due to the + // possible race condition: + // + // 1. A watch to key A is set, the watchValueMap ACTOR, noted as X, starts waiting. + // 2. All watches are cleared due to connection string change. + // 3. The watch to key A is restarted with watchValueMap ACTOR Y. + // 4. X receives the cancel exception, and tries to dereference the counter. This causes Y gets cancelled. + // + // By introducing versions, this race condition is solved. + using WatchCounterMapValue = std::multiset; + using WatchCounterMap_t = std::unordered_map; + // Maps the number of the WatchMapKey being used. + WatchCounterMap_t watchCounterMap; double backoffDelay = 0.0; + + void initializeSpecialCounters(); +}; + +// Similar to tr.onError(), but doesn't require a DatabaseContext. +struct Backoff { + Backoff(double backoff = CLIENT_KNOBS->DEFAULT_BACKOFF, double maxBackoff = CLIENT_KNOBS->DEFAULT_MAX_BACKOFF) + : backoff(backoff), maxBackoff(maxBackoff) {} + + Future onError() { + double currentBackoff = backoff; + backoff = std::min(backoff * CLIENT_KNOBS->BACKOFF_GROWTH_RATE, maxBackoff); + return delay(currentBackoff * deterministicRandom()->random01()); + } + +private: + double backoff; + double maxBackoff; }; #endif diff --git a/src/fdbclient/include/fdbclient/EncryptKeyProxyInterface.h b/src/fdbclient/include/fdbclient/EncryptKeyProxyInterface.h new file mode 100644 index 0000000..cbf31d9 --- /dev/null +++ b/src/fdbclient/include/fdbclient/EncryptKeyProxyInterface.h @@ -0,0 +1,303 @@ +/* + * EncryptKeyProxyInterface.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBSERVER_ENCRYPTKEYPROXYINTERFACE_H +#define FDBSERVER_ENCRYPTKEYPROXYINTERFACE_H +#pragma once + +#include "fdbclient/BlobMetadataUtils.h" +#include "fdbclient/FDBTypes.h" +#include "fdbrpc/fdbrpc.h" +#include "fdbrpc/Locality.h" +#include "flow/Arena.h" +#include "flow/EncryptUtils.h" +#include "flow/FileIdentifier.h" +#include "flow/IRandom.h" +#include "flow/network.h" + +#include + +#define DEBUG_ENCRYPT_KEY_PROXY false + +struct KMSHealthStatus { + constexpr static FileIdentifier file_identifier = 2378149; + bool canConnectToKms; + bool canConnectToEKP; + double lastUpdatedTS; + + KMSHealthStatus() : canConnectToEKP(false), canConnectToKms(false), lastUpdatedTS(-1) {} + KMSHealthStatus(bool canConnectToKms, bool canConnectToEKP, double lastUpdatedTS) + : canConnectToKms(canConnectToKms), canConnectToEKP(canConnectToEKP), lastUpdatedTS(lastUpdatedTS) {} + + bool operator==(const KMSHealthStatus& other) { + return canConnectToKms == other.canConnectToKms && canConnectToEKP == other.canConnectToEKP; + } + + std::string toString() const { + std::stringstream ss; + ss << "CanConnectToKms(" << canConnectToKms << ")" + << ", CanConnectToEKP(" << canConnectToEKP << ")" + << ", LastUpdatedTS(" << lastUpdatedTS << ")"; + return ss.str(); + } + + template + void serialize(Ar& ar) { + serializer(ar, canConnectToKms, canConnectToEKP, lastUpdatedTS); + } +}; + +struct EncryptKeyProxyInterface { + constexpr static FileIdentifier file_identifier = 1303419; + struct LocalityData locality; + UID myId; + RequestStream> waitFailure; + RequestStream haltEncryptKeyProxy; + RequestStream getBaseCipherKeysByIds; + RequestStream getLatestBaseCipherKeys; + RequestStream getLatestBlobMetadata; + RequestStream getHealthStatus; + + EncryptKeyProxyInterface() {} + explicit EncryptKeyProxyInterface(const struct LocalityData& loc, UID id) : locality(loc), myId(id) {} + + NetworkAddress address() const { return haltEncryptKeyProxy.getEndpoint().getPrimaryAddress(); } + NetworkAddressList addresses() const { return haltEncryptKeyProxy.getEndpoint().addresses; } + + UID id() const { return myId; } + + bool operator==(const EncryptKeyProxyInterface& toCompare) const { return myId == toCompare.myId; } + bool operator!=(const EncryptKeyProxyInterface& toCompare) const { return !(*this == toCompare); } + + template + void serialize(Archive& ar) { + if constexpr (!is_fb_function) { + ASSERT(ar.protocolVersion().isValid()); + } + serializer(ar, locality, myId, waitFailure); + if (Archive::isDeserializing) { + haltEncryptKeyProxy = + RequestStream(waitFailure.getEndpoint().getAdjustedEndpoint(1)); + getBaseCipherKeysByIds = RequestStream( + waitFailure.getEndpoint().getAdjustedEndpoint(2)); + getLatestBaseCipherKeys = RequestStream( + waitFailure.getEndpoint().getAdjustedEndpoint(3)); + getLatestBlobMetadata = + RequestStream(waitFailure.getEndpoint().getAdjustedEndpoint(4)); + getHealthStatus = RequestStream( + waitFailure.getEndpoint().getAdjustedEndpoint(5)); + } + } + + void initEndpoints() { + std::vector> streams; + streams.push_back(waitFailure.getReceiver()); + streams.push_back(haltEncryptKeyProxy.getReceiver(TaskPriority::DefaultPromiseEndpoint)); + streams.push_back(getBaseCipherKeysByIds.getReceiver(TaskPriority::Worker)); + streams.push_back(getLatestBaseCipherKeys.getReceiver(TaskPriority::Worker)); + streams.push_back(getLatestBlobMetadata.getReceiver(TaskPriority::Worker)); + streams.push_back(getHealthStatus.getReceiver(TaskPriority::Worker)); + FlowTransport::transport().addEndpoints(streams); + } +}; + +struct HaltEncryptKeyProxyRequest { + constexpr static FileIdentifier file_identifier = 2378138; + UID requesterID; + ReplyPromise reply; + + HaltEncryptKeyProxyRequest() : requesterID(deterministicRandom()->randomUniqueID()) {} + explicit HaltEncryptKeyProxyRequest(UID uid) : requesterID(uid) {} + + template + void serialize(Ar& ar) { + serializer(ar, requesterID, reply); + } +}; + +struct EncryptKeyProxyHealthStatusRequest { + constexpr static FileIdentifier file_identifier = 2378139; + ReplyPromise reply; + + EncryptKeyProxyHealthStatusRequest() {} + + template + void serialize(Ar& ar) { + serializer(ar, reply); + } +}; + +struct EKPBaseCipherDetails { + constexpr static FileIdentifier file_identifier = 2149615; + int64_t encryptDomainId; + uint64_t baseCipherId; + Standalone baseCipherKey; + EncryptCipherKeyCheckValue baseCipherKCV; + int64_t refreshAt; + int64_t expireAt; + + EKPBaseCipherDetails() + : encryptDomainId(0), baseCipherId(0), baseCipherKey(Standalone()), baseCipherKCV(0), refreshAt(0), + expireAt(-1) {} + explicit EKPBaseCipherDetails(int64_t dId, + uint64_t id, + Standalone key, + EncryptCipherKeyCheckValue cipherKCV) + : encryptDomainId(dId), baseCipherId(id), baseCipherKey(key), baseCipherKCV(cipherKCV), + refreshAt(std::numeric_limits::max()), expireAt(std::numeric_limits::max()) {} + explicit EKPBaseCipherDetails(int64_t dId, + uint64_t id, + Standalone key, + EncryptCipherKeyCheckValue cipherKCV, + int64_t refAt, + int64_t expAt) + : encryptDomainId(dId), baseCipherId(id), baseCipherKey(key), baseCipherKCV(cipherKCV), refreshAt(refAt), + expireAt(expAt) {} + + bool operator==(const EKPBaseCipherDetails& r) const { + return encryptDomainId == r.encryptDomainId && baseCipherId == r.baseCipherId && refreshAt == r.refreshAt && + expireAt == r.expireAt && baseCipherKey.toString() == r.baseCipherKey.toString(); + } + + template + void serialize(Ar& ar) { + serializer(ar, encryptDomainId, baseCipherId, baseCipherKey, baseCipherKCV, refreshAt, expireAt); + } +}; + +struct EKPGetBaseCipherKeysByIdsReply { + constexpr static FileIdentifier file_identifier = 9485259; + std::vector baseCipherDetails; + int numHits; + Optional error; + + EKPGetBaseCipherKeysByIdsReply() : numHits(0) {} + + template + void serialize(Ar& ar) { + serializer(ar, baseCipherDetails, numHits, error); + } +}; + +struct EKPGetBaseCipherKeysRequestInfo { + constexpr static FileIdentifier file_identifier = 2180516; + // Encryption cipher domain identifier + EncryptCipherDomainId domainId; + // Encryption cipher KMS assigned identifier + EncryptCipherBaseKeyId baseCipherId; + + EKPGetBaseCipherKeysRequestInfo() + : domainId(INVALID_ENCRYPT_DOMAIN_ID), baseCipherId(INVALID_ENCRYPT_CIPHER_KEY_ID) {} + EKPGetBaseCipherKeysRequestInfo(const EncryptCipherDomainId dId, const EncryptCipherBaseKeyId bCId) + : domainId(dId), baseCipherId(bCId) {} + + bool operator==(const EKPGetBaseCipherKeysRequestInfo& info) const { + return domainId == info.domainId && baseCipherId == info.baseCipherId; + } + + template + void serialize(Ar& ar) { + serializer(ar, domainId, baseCipherId); + } +}; + +struct EKPGetBaseCipherKeysByIdsRequest { + constexpr static FileIdentifier file_identifier = 4930263; + std::vector baseCipherInfos; + Optional debugId; + ReplyPromise reply; + + EKPGetBaseCipherKeysByIdsRequest() {} + + template + void serialize(Ar& ar) { + serializer(ar, baseCipherInfos, debugId, reply); + } +}; + +struct EKPGetLatestBaseCipherKeysReply { + constexpr static FileIdentifier file_identifier = 4831583; + std::vector baseCipherDetails; + int numHits; + Optional error; + + EKPGetLatestBaseCipherKeysReply() : numHits(0) {} + explicit EKPGetLatestBaseCipherKeysReply(const std::vector& cipherDetails) + : baseCipherDetails(cipherDetails), numHits(0) {} + + template + void serialize(Ar& ar) { + serializer(ar, baseCipherDetails, numHits, error); + } +}; + +struct EKPGetBaseCipherKeysRequestInfo_Hash { + std::size_t operator()(const EKPGetBaseCipherKeysRequestInfo& info) const { + boost::hash> hasher; + return hasher(std::make_pair(info.domainId, info.baseCipherId)); + } +}; + +struct EKPGetLatestBaseCipherKeysRequest { + constexpr static FileIdentifier file_identifier = 1910123; + std::vector encryptDomainIds; + Optional debugId; + ReplyPromise reply; + + EKPGetLatestBaseCipherKeysRequest() {} + explicit EKPGetLatestBaseCipherKeysRequest(const std::vector& ids) : encryptDomainIds(ids) {} + + template + void serialize(Ar& ar) { + serializer(ar, encryptDomainIds, debugId, reply); + } +}; + +// partition and credentials information for a given blob domain + +struct EKPGetLatestBlobMetadataReply { + constexpr static FileIdentifier file_identifier = 5761581; + Standalone> blobMetadataDetails; + + EKPGetLatestBlobMetadataReply() {} + explicit EKPGetLatestBlobMetadataReply(const Standalone>& blobMetadataDetails) + : blobMetadataDetails(blobMetadataDetails) {} + + template + void serialize(Ar& ar) { + serializer(ar, blobMetadataDetails); + } +}; + +struct EKPGetLatestBlobMetadataRequest { + constexpr static FileIdentifier file_identifier = 3821549; + std::vector domainIds; + Optional debugId; + ReplyPromise reply; + + EKPGetLatestBlobMetadataRequest() {} + + template + void serialize(Ar& ar) { + serializer(ar, domainIds, debugId, reply); + } +}; + +#endif diff --git a/src/fdbclient/EventTypes.actor.g.h b/src/fdbclient/include/fdbclient/EventTypes.actor.g.h similarity index 83% rename from src/fdbclient/EventTypes.actor.g.h rename to src/fdbclient/include/fdbclient/EventTypes.actor.g.h index e24272c..f5af52e 100644 --- a/src/fdbclient/EventTypes.actor.g.h +++ b/src/fdbclient/include/fdbclient/EventTypes.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/EventTypes.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/EventTypes.actor.h" /* * EventTypes.actor.h * @@ -28,19 +28,19 @@ #define FDBCLIENT_EVENTTYPES_ACTOR_G_H #include "fdbclient/EventTypes.actor.g.h" #elif !defined(FDBCLIENT_EVENTTYPES_ACTOR_H) -#define FDBCLIENT_EVENTTYPESS_ACTOR_H +#define FDBCLIENT_EVENTTYPES_ACTOR_H #include "flow/flow.h" #include "flow/TDMetric.actor.h" #include "flow/actorcompiler.h" // This must be the last #include. template<> struct Descriptor { - static StringRef typeName() { return LiteralStringRef("GetValueComplete"); } + static StringRef typeName() { return "GetValueComplete"_sr; } typedef GetValueComplete type; struct latencyDescriptor { - static StringRef name() { return LiteralStringRef("latency"); } - static StringRef typeName() { return LiteralStringRef("int64_t"); } - static StringRef comment() { return LiteralStringRef(" ns"); } + static StringRef name() { return "latency"_sr; } + static StringRef typeName() { return "int64_t"_sr; } + static StringRef comment() { return " ns"_sr; } typedef int64_t type; static inline type get(GetValueComplete& from); }; @@ -51,7 +51,7 @@ struct GetValueComplete { int64_t latency; // ns }; int64_t Descriptor::latencyDescriptor::get(GetValueComplete& from) { return from.latency; } -#line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/EventTypes.actor.h" +#line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/EventTypes.actor.h" #include "flow/unactorcompiler.h" diff --git a/src/fdbclient/EventTypes.actor.h b/src/fdbclient/include/fdbclient/EventTypes.actor.h similarity index 97% rename from src/fdbclient/EventTypes.actor.h rename to src/fdbclient/include/fdbclient/EventTypes.actor.h index 39a75e0..dc946ce 100644 --- a/src/fdbclient/EventTypes.actor.h +++ b/src/fdbclient/include/fdbclient/EventTypes.actor.h @@ -26,7 +26,7 @@ #define FDBCLIENT_EVENTTYPES_ACTOR_G_H #include "fdbclient/EventTypes.actor.g.h" #elif !defined(FDBCLIENT_EVENTTYPES_ACTOR_H) -#define FDBCLIENT_EVENTTYPESS_ACTOR_H +#define FDBCLIENT_EVENTTYPES_ACTOR_H #include "flow/flow.h" #include "flow/TDMetric.actor.h" diff --git a/src/fdbclient/ClientBooleanParams.cpp b/src/fdbclient/include/fdbclient/FDBAWSCredentialsProvider.h similarity index 64% rename from src/fdbclient/ClientBooleanParams.cpp rename to src/fdbclient/include/fdbclient/FDBAWSCredentialsProvider.h index 43febb3..52ea84f 100644 --- a/src/fdbclient/ClientBooleanParams.cpp +++ b/src/fdbclient/include/fdbclient/FDBAWSCredentialsProvider.h @@ -1,5 +1,5 @@ /* - * ClientBooleanParams.cpp + * FDBAWSCredentialsProvider.h * * This source file is part of the FoundationDB open source project * @@ -18,13 +18,19 @@ * limitations under the License. */ -#include "fdbclient/ClientBooleanParams.h" +#if (!defined FDB_AWS_CREDENTIALS_PROVIDER_H) && (defined WITH_AWS_BACKUP) +#define FDB_AWS_CREDENTIALS_PROVIDER_H +#pragma once -FDB_DEFINE_BOOLEAN_PARAM(EnableLocalityLoadBalance); -FDB_DEFINE_BOOLEAN_PARAM(LockAware); -FDB_DEFINE_BOOLEAN_PARAM(Reverse); -FDB_DEFINE_BOOLEAN_PARAM(Snapshot); -FDB_DEFINE_BOOLEAN_PARAM(IsInternal); -FDB_DEFINE_BOOLEAN_PARAM(AddConflictRange); -FDB_DEFINE_BOOLEAN_PARAM(UseMetrics); -FDB_DEFINE_BOOLEAN_PARAM(IsSwitchable); +#ifdef WITH_AWS_BACKUP + +#include "aws/core/Aws.h" +#include "aws/core/auth/AWSCredentialsProviderChain.h" + +namespace FDBAWSCredentialsProvider { +Aws::Auth::AWSCredentials getAwsCredentials(); +} + +#endif + +#endif diff --git a/src/fdbclient/FDBOptions.g.h b/src/fdbclient/include/fdbclient/FDBOptions.g.h similarity index 87% rename from src/fdbclient/FDBOptions.g.h rename to src/fdbclient/include/fdbclient/FDBOptions.g.h index 117b949..786619f 100644 --- a/src/fdbclient/FDBOptions.g.h +++ b/src/fdbclient/include/fdbclient/FDBOptions.g.h @@ -44,6 +44,14 @@ struct FDBNetworkOptions { /* Parameter: (String) The identifier that will be part of all trace file names */ TRACE_FILE_IDENTIFIER=36, + /* Use the same base trace file name for all client threads as it did before version 7.2. The current default behavior is to use distinct trace file names for client threads by including their version and thread index. */ + /* Parameter: Option takes no parameter */ + TRACE_SHARE_AMONG_CLIENT_THREADS=37, + + /* Initialize trace files on network setup, determine the local IP later. Otherwise tracing is initialized when opening the first database. */ + /* Parameter: Option takes no parameter */ + TRACE_INITIALIZE_ON_SETUP=38, + /* Set file suffix for partially written log files. */ /* Parameter: (String) Append this suffix to partially written log files. When a log file is complete, it is renamed to remove the suffix. No separator is added between the file and the suffix. If you want to add a file extension, you should include the separator - e.g. '.tmp' instead of 'tmp' to add the 'tmp' extension. */ TRACE_PARTIAL_FILE_SUFFIX=39, @@ -128,10 +136,22 @@ struct FDBNetworkOptions { /* Parameter: (Int) Number of client threads to be spawned. Each cluster will be serviced by a single client thread. */ CLIENT_THREADS_PER_VERSION=65, + /* Adds an external client library to be used with a future version protocol. This option can be used testing purposes only! */ + /* Parameter: (String) path to client library */ + FUTURE_VERSION_CLIENT_LIBRARY=66, + /* Retain temporary external client library copies that are created for enabling multi-threading. */ /* Parameter: Option takes no parameter */ RETAIN_CLIENT_LIBRARY_COPIES=67, + /* Ignore the failure to initialize some of the external clients */ + /* Parameter: Option takes no parameter */ + IGNORE_EXTERNAL_CLIENT_FAILURES=68, + + /* Fail with an error if there is no client matching the server version the client is connecting to */ + /* Parameter: Option takes no parameter */ + FAIL_INCOMPATIBLE_CLIENT=69, + /* Disables logging of client statistics, such as sampled transaction activity. */ /* Parameter: Option takes no parameter */ DISABLE_CLIENT_STATISTICS_LOGGING=70, @@ -144,6 +164,10 @@ struct FDBNetworkOptions { /* Parameter: Option takes no parameter */ ENABLE_RUN_LOOP_PROFILING=71, + /* Prevents the multi-version client API from being disabled, even if no external clients are configured. This option is required to use GRV caching. */ + /* Parameter: Option takes no parameter */ + DISABLE_CLIENT_BYPASS=72, + /* Enable client buggify - will make requests randomly fail (intended for client testing) */ /* Parameter: Option takes no parameter */ CLIENT_BUGGIFY_ENABLE=80, @@ -164,6 +188,10 @@ struct FDBNetworkOptions { /* Parameter: (String) Distributed tracer type. Choose from none, log_file, or network_lossy */ DISTRIBUTED_CLIENT_TRACER=90, + /* Sets the directory for storing temporary files created by FDB client, such as temporary copies of client libraries. Defaults to /tmp */ + /* Parameter: (String) Client directory for temporary files. */ + CLIENT_TMP_DIR=91, + /* This option is set automatically to communicate the list of supported clients to the active client. */ /* Parameter: (String) [release version],[source version],[protocol version];... This is a hidden parameter and should not be used directly by applications.*/ SUPPORTED_CLIENT_VERSIONS=1000, @@ -239,16 +267,28 @@ struct FDBDatabaseOptions { /* Parameter: Option takes no parameter */ TRANSACTION_INCLUDE_PORT_IN_ADDRESS=505, + /* Set a random idempotency id for all transactions. See the transaction option description for more information. This feature is in development and not ready for general use. */ + /* Parameter: Option takes no parameter */ + TRANSACTION_AUTOMATIC_IDEMPOTENCY=506, + /* Allows ``get`` operations to read from sections of keyspace that have become unreadable because of versionstamp operations. This sets the ``bypass_unreadable`` option of each transaction created by this database. See the transaction option description for more information. */ /* Parameter: Option takes no parameter */ TRANSACTION_BYPASS_UNREADABLE=700, + /* By default, operations that are performed on a transaction while it is being committed will not only fail themselves, but they will attempt to fail other in-flight operations (such as the commit) as well. This behavior is intended to help developers discover situations where operations could be unintentionally executed after the transaction has been reset. Setting this option removes that protection, causing only the offending operation to fail. */ + /* Parameter: Option takes no parameter */ + TRANSACTION_USED_DURING_COMMIT_PROTECTION_DISABLE=701, + + /* Enables conflicting key reporting on all transactions, allowing them to retrieve the keys that are conflicting with other transactions. */ + /* Parameter: Option takes no parameter */ + TRANSACTION_REPORT_CONFLICTING_KEYS=702, + /* Use configuration database. */ /* Parameter: Option takes no parameter */ USE_CONFIG_DATABASE=800, - /* An integer between 0 and 100 (default is 0) expressing the probability that a client will verify it can't read stale data whenever it detects a recovery. */ - /* Parameter: Option takes no parameter */ + /* Enables verification of causal read risky by checking whether clients are able to read stale data when they detect a recovery, and logging an error if so. */ + /* Parameter: (Int) integer between 0 and 100 expressing the probability a client will verify it can't read stale data */ TEST_CAUSAL_READ_RISKY=900 }; @@ -298,6 +338,26 @@ struct FDBTransactionOptions { /* Parameter: Option takes no parameter */ READ_AHEAD_DISABLE=52, + /* Storage server should cache disk blocks needed for subsequent read requests in this transaction. This is the default behavior. */ + /* Parameter: Option takes no parameter */ + READ_SERVER_SIDE_CACHE_ENABLE=507, + + /* Storage server should not cache disk blocks needed for subsequent read requests in this transaction. This can be used to avoid cache pollution for reads not expected to be repeated. */ + /* Parameter: Option takes no parameter */ + READ_SERVER_SIDE_CACHE_DISABLE=508, + + /* Use normal read priority for subsequent read requests in this transaction. This is the default read priority. */ + /* Parameter: Option takes no parameter */ + READ_PRIORITY_NORMAL=509, + + /* Use low read priority for subsequent read requests in this transaction. */ + /* Parameter: Option takes no parameter */ + READ_PRIORITY_LOW=510, + + /* Use high read priority for subsequent read requests in this transaction. */ + /* Parameter: Option takes no parameter */ + READ_PRIORITY_HIGH=511, + /* */ /* Parameter: Option takes no parameter */ DURABILITY_DATACENTER=110, @@ -334,6 +394,10 @@ struct FDBTransactionOptions { /* Parameter: Option takes no parameter */ RAW_ACCESS=303, + /* Allows this transaction to bypass storage quota enforcement. Should only be used for transactions that directly or indirectly decrease the size of the tenant group's data. */ + /* Parameter: Option takes no parameter */ + BYPASS_STORAGE_QUOTA=304, + /* */ /* Parameter: Option takes no parameter This is a hidden parameter and should not be used directly by applications.*/ DEBUG_DUMP=400, @@ -378,6 +442,14 @@ struct FDBTransactionOptions { /* Parameter: (Int) value in bytes */ SIZE_LIMIT=503, + /* Associate this transaction with this ID for the purpose of checking whether or not this transaction has already committed. Must be at least 16 bytes and less than 256 bytes. This feature is in development and not ready for general use. Unless the automatic_idempotency option is set after this option, the client will not automatically attempt to remove this id from the cluster after a successful commit. */ + /* Parameter: (String) Unique ID This is a hidden parameter and should not be used directly by applications.*/ + IDEMPOTENCY_ID=504, + + /* Automatically assign a random 16 byte idempotency id for this transaction. Prevents commits from failing with ``commit_unknown_result``. WARNING: If you are also using the multiversion client or transaction timeouts, if either cluster_version_changed or transaction_timed_out was thrown during a commit, then that commit may have already succeeded or may succeed in the future. This feature is in development and not ready for general use. */ + /* Parameter: Option takes no parameter */ + AUTOMATIC_IDEMPOTENCY=505, + /* Snapshot read operations will see the results of writes done in the same transaction. This is the default behavior. */ /* Parameter: Option takes no parameter */ SNAPSHOT_RYW_ENABLE=600, @@ -438,13 +510,17 @@ struct FDBTransactionOptions { /* Parameter: Option takes no parameter */ BYPASS_UNREADABLE=1100, - /* Allows this transaction to use cached GRV from the database context. Defaults to off. Upon first usage, starts a background updater to periodically update the cache to avoid stale read versions. */ + /* Allows this transaction to use cached GRV from the database context. Defaults to off. Upon first usage, starts a background updater to periodically update the cache to avoid stale read versions. The disable_client_bypass option must also be set. */ /* Parameter: Option takes no parameter */ USE_GRV_CACHE=1101, /* Specifically instruct this transaction to NOT use cached GRV. Primarily used for the read version cache's background updater to avoid attempting to read a cached entry in specific situations. */ /* Parameter: Option takes no parameter This is a hidden parameter and should not be used directly by applications.*/ - SKIP_GRV_CACHE=1102 + SKIP_GRV_CACHE=1102, + + /* Attach given authorization token to the transaction such that subsequent tenant-aware requests are authorized */ + /* Parameter: (String) A JSON Web Token authorized to access data belonging to one or more tenants, indicated by 'tenants' claim of the token's payload. */ + AUTHORIZATION_TOKEN=2000 }; static FDBOptionInfoMap optionInfo; diff --git a/src/fdbclient/FDBOptions.h b/src/fdbclient/include/fdbclient/FDBOptions.h similarity index 87% rename from src/fdbclient/FDBOptions.h rename to src/fdbclient/include/fdbclient/FDBOptions.h index b366046..f6553fd 100644 --- a/src/fdbclient/FDBOptions.h +++ b/src/fdbclient/include/fdbclient/FDBOptions.h @@ -36,6 +36,7 @@ struct FDBOptionInfo { bool hasParameter; bool hidden; bool persistent; + bool sensitive; // If non-negative, this specifies the code for the transaction option that this option is the default value for. // Options that have a defaultFor will only retain the value from time they were most recently set (i.e. there can @@ -52,10 +53,11 @@ struct FDBOptionInfo { bool hasParameter, bool hidden, bool persistent, + bool sensitive, int defaultFor, ParamType paramType) : name(name), comment(comment), parameterComment(parameterComment), hasParameter(hasParameter), hidden(hidden), - persistent(persistent), defaultFor(defaultFor), paramType(paramType) {} + persistent(persistent), sensitive(sensitive), defaultFor(defaultFor), paramType(paramType) {} FDBOptionInfo() {} }; @@ -109,8 +111,10 @@ class UniqueOrderedOptionList { }; #define ADD_OPTION_INFO( \ - type, var, name, comment, parameterComment, hasParameter, hidden, persistent, defaultFor, paramType) \ + type, var, name, comment, parameterComment, hasParameter, hidden, persistent, sensitive, defaultFor, paramType) \ type::optionInfo.insert( \ - var, FDBOptionInfo(name, comment, parameterComment, hasParameter, hidden, persistent, defaultFor, paramType)); + var, \ + FDBOptionInfo( \ + name, comment, parameterComment, hasParameter, hidden, persistent, sensitive, defaultFor, paramType)); #endif diff --git a/src/fdbclient/FDBTypes.h b/src/fdbclient/include/fdbclient/FDBTypes.h similarity index 73% rename from src/fdbclient/FDBTypes.h rename to src/fdbclient/include/fdbclient/FDBTypes.h index 34246a4..5d0b13b 100644 --- a/src/fdbclient/FDBTypes.h +++ b/src/fdbclient/include/fdbclient/FDBTypes.h @@ -23,35 +23,18 @@ #include #include +#include #include #include #include #include #include -#include "flow/Arena.h" #include "flow/FastRef.h" #include "flow/ProtocolVersion.h" #include "flow/flow.h" - -enum class TraceFlags : uint8_t { unsampled = 0b00000000, sampled = 0b00000001 }; - -inline TraceFlags operator&(TraceFlags lhs, TraceFlags rhs) { - return static_cast(static_cast>(lhs) & - static_cast>(rhs)); -} - -struct SpanContext { - UID traceID; - uint64_t spanID; - TraceFlags m_Flags; - SpanContext() : traceID(UID()), spanID(0), m_Flags(TraceFlags::unsampled) {} - SpanContext(UID traceID, uint64_t spanID, TraceFlags flags) : traceID(traceID), spanID(spanID), m_Flags(flags) {} - SpanContext(UID traceID, uint64_t spanID) : traceID(traceID), spanID(spanID), m_Flags(TraceFlags::unsampled) {} - SpanContext(Arena arena, const SpanContext& span) - : traceID(span.traceID), spanID(span.spanID), m_Flags(span.m_Flags) {} - bool isSampled() const { return (m_Flags & TraceFlags::sampled) == TraceFlags::sampled; } -}; +#include "fdbclient/Status.h" +#include "fdbrpc/Locality.h" typedef int64_t Version; typedef uint64_t LogEpoch; @@ -60,6 +43,12 @@ typedef StringRef KeyRef; typedef StringRef ValueRef; typedef int64_t Generation; typedef UID SpanID; +typedef uint64_t CoordinatorsHash; + +// invalidKey is intentionally far beyond the system space. It is meant to be used as a safe initial value for a key +// before it is set to something meaningful to avoid mistakes where a default constructed key is written to instead of +// the intended target. +static const KeyRef invalidKey = "\xff\xff\xff\xff\xff\xff\xff\xff"_sr; enum { tagLocalitySpecial = -1, // tag with this locality means it is invalidTag (id=0), txsTag (id=1), or cacheTag (id=2) @@ -224,6 +213,10 @@ inline std::string describe(const int item) { return format("%d", item); } +inline std::string describe(const Version item) { + return format("%ld", item); +} + // Allows describeList to work on a vector of std::string std::string describe(const std::string& s); @@ -345,6 +338,26 @@ struct KeyRangeRef { bool empty() const { return begin == end; } bool singleKeyRange() const { return equalsKeyAfter(begin, end); } + // Return true if it's fully covered by given range list. Note that ranges should be sorted + bool isCovered(std::vector& ranges) { + ASSERT(std::is_sorted(ranges.begin(), ranges.end(), KeyRangeRef::ArbitraryOrder())); + KeyRangeRef clone(begin, end); + for (auto r : ranges) { + if (clone.begin < r.begin) + return false; // uncovered gap between clone.begin and r.begin + if (clone.end <= r.end) + return true; // range is fully covered + // If a range of ranges is totally at the left of clone, + // clone needs not update + // If a range of ranges is partially at the left of clone, + // clone = clone - the overlap + if (clone.end > r.end && r.end > clone.begin) + // {clone.begin, r.end} is covered. need to check coverage for {r.end, clone.end} + clone = KeyRangeRef(r.end, clone.end); + } + return false; + } + Standalone withPrefix(const StringRef& prefix) const { return KeyRangeRef(begin.withPrefix(prefix), end.withPrefix(prefix)); } @@ -395,7 +408,7 @@ struct KeyRangeRef { } }; - std::string toString() const { return "Begin:" + begin.printable() + "End:" + end.printable(); } + std::string toString() const { return "{ begin=" + begin.printable() + " end=" + end.printable() + " }"; } }; template <> @@ -421,6 +434,22 @@ inline KeyRangeRef operator&(const KeyRangeRef& lhs, const KeyRangeRef& rhs) { return KeyRangeRef(b, e); } +// Calculates the complement of `lhs` from `rhs`. +inline std::vector operator-(const KeyRangeRef& lhs, const KeyRangeRef& rhs) { + if ((lhs & rhs).empty()) { + return { lhs }; + } + + std::vector result; + if (lhs.begin < rhs.begin) { + result.push_back(KeyRangeRef(lhs.begin, rhs.begin)); + } + if (lhs.end > rhs.end) { + result.push_back(KeyRangeRef(rhs.end, lhs.end)); + } + return result; +} + struct KeyValueRef { KeyRef key; ValueRef value; @@ -514,6 +543,32 @@ using KeySelector = Standalone; using RangeResult = Standalone; using MappedRangeResult = Standalone; +namespace std { +template <> +struct hash { + static constexpr std::hash hashFunc{}; + std::size_t operator()(KeyRangeRef const& range) const { + std::size_t seed = 0; + boost::hash_combine(seed, hashFunc(range.begin)); + boost::hash_combine(seed, hashFunc(range.end)); + return seed; + } +}; +} // namespace std + +namespace std { +template <> +struct hash { + static constexpr std::hash hashFunc{}; + std::size_t operator()(KeyRangeRef const& range) const { + std::size_t seed = 0; + boost::hash_combine(seed, hashFunc(range.begin)); + boost::hash_combine(seed, hashFunc(range.end)); + return seed; + } +}; +} // namespace std + enum { invalidVersion = -1, latestVersion = -2, @@ -521,36 +576,37 @@ enum { MAX_VERSION = std::numeric_limits::max() }; -inline Key keyAfter(const KeyRef& key) { - if (key == LiteralStringRef("\xff\xff")) - return key; - - Standalone r; - uint8_t* s = new (r.arena()) uint8_t[key.size() + 1]; - if (key.size() > 0) { - memcpy(s, key.begin(), key.size()); - } - s[key.size()] = 0; - ((StringRef&)r) = StringRef(s, key.size() + 1); - return r; -} inline KeyRef keyAfter(const KeyRef& key, Arena& arena) { - if (key == LiteralStringRef("\xff\xff")) - return key; + // Don't include fdbclient/SystemData.h for the allKeys symbol to avoid a cyclic include + static const auto allKeysEnd = "\xff\xff"_sr; + if (key == allKeysEnd) { + return allKeysEnd; + } uint8_t* t = new (arena) uint8_t[key.size() + 1]; - memcpy(t, key.begin(), key.size()); + if (!key.empty()) { + memcpy(t, key.begin(), key.size()); + } t[key.size()] = 0; return KeyRef(t, key.size() + 1); } -inline KeyRange singleKeyRange(const KeyRef& a) { - return KeyRangeRef(a, keyAfter(a)); +inline Key keyAfter(const KeyRef& key) { + Key result; + result.contents() = keyAfter(key, result.arena()); + return result; } inline KeyRangeRef singleKeyRange(KeyRef const& key, Arena& arena) { uint8_t* t = new (arena) uint8_t[key.size() + 1]; - memcpy(t, key.begin(), key.size()); + if (!key.empty()) { + memcpy(t, key.begin(), key.size()); + } t[key.size()] = 0; return KeyRangeRef(KeyRef(t, key.size()), KeyRef(t, key.size() + 1)); } +inline KeyRange singleKeyRange(const KeyRef& a) { + KeyRange result; + result.contents() = singleKeyRange(a, result.arena()); + return result; +} inline KeyRange prefixRange(KeyRef prefix) { Standalone range; KeyRef start = KeyRef(range.arena(), prefix); @@ -565,6 +621,11 @@ inline KeyRange prefixRange(KeyRef prefix) { // The returned reference is valid as long as keys is valid. KeyRef keyBetween(const KeyRangeRef& keys); +// Returns a randomKey between keys. If it's impossible, return keys.end. +Key randomKeyBetween(const KeyRangeRef& keys); + +KeyRangeRef toPrefixRelativeRange(KeyRangeRef range, Optional prefix); + struct KeySelectorRef { private: KeyRef key; // Find the last item less than key @@ -678,15 +739,15 @@ struct GetRangeLimits { void decrement(MappedKeyValueRef const& data); // True if either the row or byte limit has been reached - bool isReached(); + bool isReached() const; // True if data would cause the row or byte limit to be reached - bool reachedBy(VectorRef const& data); + bool reachedBy(VectorRef const& data) const; - bool hasByteLimit(); - bool hasRowLimit(); + bool hasByteLimit() const; + bool hasRowLimit() const; - bool hasSatisfiedMinRows(); + bool hasSatisfiedMinRows() const; bool isValid() const { return (rows >= 0 || rows == ROW_LIMIT_UNLIMITED) && (bytes >= 0 || bytes == BYTE_LIMIT_UNLIMITED) && minRows >= 0 && (minRows <= rows || rows == ROW_LIMIT_UNLIMITED); @@ -695,11 +756,62 @@ struct GetRangeLimits { struct RangeResultRef : VectorRef { constexpr static FileIdentifier file_identifier = 3985192; - bool more; // True if (but not necessarily only if) values remain in the *key* range requested (possibly beyond the - // limits requested) False implies that no such values remain - Optional readThrough; // Only present when 'more' is true. When present, this value represent the end (or - // beginning if reverse) of the range which was read to produce these results. This is - // guaranteed to be less than the requested range. + + // True if the range may have more keys in it (possibly beyond the specified limits). + // 'more' can be true even if there are no keys left in the range, e.g. if a shard boundary is hit, it may or may + // not have more keys left, but 'more' will be set to true in that case. + // Additionally, 'getRangeStream()' always sets 'more' to true and uses the 'end_of_stream' error to indicate that a + // range is exhausted. + // If 'more' is false, the range is guaranteed to have been exhausted. + bool more; + + // Only present when 'more' is true, for example, when the read reaches the shard boundary, 'readThrough' is set to + // the shard boundary and the client's next range read should start with the 'readThrough'. + // But 'more' is true does not necessarily guarantee 'readThrough' is present, for example, when the read reaches + // size limit, 'readThrough' might not be set, the next read should just start from the keyAfter of the current + // query result's last key. + // In both cases, please use the getter function 'getReadThrough()' instead, which represents the end (or beginning + // if reverse) of the range which was read. + Optional readThrough; + + // return the value represents the end of the range which was read. If 'reverse' is true, returns the last key, as + // it should be used as the new "end" of the next query and the end key should be non-inclusive. + Key getReadThrough(bool reverse = false) const { + ASSERT(more); + if (readThrough.present()) { + return readThrough.get(); + } + ASSERT(size() > 0); + return reverse ? back().key : keyAfter(back().key); + } + + // Helper function to get the next range scan's BeginKeySelector, use it when the range read is non-reverse, + // otherwise, please use nextEndKeySelector(). + KeySelectorRef nextBeginKeySelector() const { + ASSERT(more); + if (readThrough.present()) { + return firstGreaterOrEqual(readThrough.get()); + } + ASSERT(size() > 0); + return firstGreaterThan(back().key); + } + + // Helper function to get the next range scan's EndKeySelector, use it when the range read is reverse. + KeySelectorRef nextEndKeySelector() const { + ASSERT(more); + if (readThrough.present()) { + return firstGreaterOrEqual(readThrough.get()); + } + ASSERT(size() > 0); + return firstGreaterOrEqual(back().key); + } + + void setReadThrough(KeyRef key) { + ASSERT(more); + ASSERT(!readThrough.present()); + readThrough = key; + } + bool readToBegin; bool readThroughEnd; @@ -719,7 +831,7 @@ struct RangeResultRef : VectorRef { serializer(ar, ((VectorRef&)*this), more, readThrough, readToBegin, readThroughEnd); } - int logicalSize() const { + int64_t logicalSize() const { return VectorRef::expectedSize() - VectorRef::size() * sizeof(KeyValueRef); } @@ -820,6 +932,12 @@ struct MappedRangeResultRef : VectorRef { bool readToBegin; bool readThroughEnd; + void setReadThrough(KeyRef key) { + ASSERT(more); + ASSERT(!readThrough.present()); + readThrough = key; + } + MappedRangeResultRef() : more(false), readToBegin(false), readThroughEnd(false) {} MappedRangeResultRef(Arena& p, const MappedRangeResultRef& toCopy) : VectorRef(p, toCopy), more(toCopy.more), @@ -857,6 +975,7 @@ struct KeyValueStoreType { SSD_REDWOOD_V1 = 3, MEMORY_RADIXTREE = 4, SSD_ROCKSDB_V1 = 5, + SSD_SHARDED_ROCKSDB = 6, NONE = 7, END }; @@ -874,46 +993,14 @@ struct KeyValueStoreType { serializer(ar, type); } - std::string toString() const { - switch (type) { - case SSD_BTREE_V1: - return "ssd-1"; - case SSD_BTREE_V2: - return "ssd-2"; - case SSD_REDWOOD_V1: - return "ssd-redwood-1-experimental"; - case SSD_ROCKSDB_V1: - return "ssd-rocksdb-v1"; - case MEMORY: - return "memory"; - case MEMORY_RADIXTREE: - return "memory-radixtree-beta"; - case NONE: - return "none"; - default: - return "unknown"; - } - } + // Get string representation of engine type. Each enum has one canonical string + // representation, but the reverse is not true (see fromString() below) + static std::string getStoreTypeStr(const StoreType& storeType); // Convert a string to a KeyValueStoreType // This is a many-to-one mapping as there are aliases for some storage engines - static KeyValueStoreType fromString(const std::string& str) { - static std::map names = { { "ssd-1", SSD_BTREE_V1 }, - { "ssd-2", SSD_BTREE_V2 }, - { "ssd", SSD_BTREE_V2 }, - { "redwood", SSD_REDWOOD_V1 }, - { "ssd-redwood-1", SSD_REDWOOD_V1 }, - { "ssd-redwood-1-experimental", SSD_REDWOOD_V1 }, - { "ssd-rocksdb-v1", SSD_ROCKSDB_V1 }, - { "memory", MEMORY }, - { "memory-radixtree-beta", MEMORY_RADIXTREE }, - { "none", NONE } }; - auto it = names.find(str); - if (it == names.end()) { - throw unknown_storage_engine(); - } - return it->second; - } + static KeyValueStoreType fromString(const std::string& str); + std::string toString() const { return getStoreTypeStr((StoreType)type); } // Whether the storage type is a valid storage type. bool isValid() const { return type != NONE && type != END; } @@ -963,17 +1050,17 @@ struct TLogVersion { } static ErrorOr FromStringRef(StringRef s) { - if (s == LiteralStringRef("2")) + if (s == "2"_sr) return V2; - if (s == LiteralStringRef("3")) + if (s == "3"_sr) return V3; - if (s == LiteralStringRef("4")) + if (s == "4"_sr) return V4; - if (s == LiteralStringRef("5")) + if (s == "5"_sr) return V5; - if (s == LiteralStringRef("6")) + if (s == "6"_sr) return V6; - if (s == LiteralStringRef("7")) + if (s == "7"_sr) return V7; return default_error_or(); } @@ -1023,9 +1110,9 @@ struct TLogSpillType { } static ErrorOr FromStringRef(StringRef s) { - if (s == LiteralStringRef("1")) + if (s == "1"_sr) return VALUE; - if (s == LiteralStringRef("2")) + if (s == "2"_sr) return REFERENCE; return default_error_or(); } @@ -1038,9 +1125,9 @@ struct StorageBytes { constexpr static FileIdentifier file_identifier = 3928581; // Free space on the filesystem int64_t free; - // Total space on the filesystem + // Total capacity on the filesystem usable by non-privileged users. int64_t total; - // Used by *this* store, not total - free + // Total size of all files owned by *this* storage instance, not total - free int64_t used; // Amount of space available for use by the store, which includes free space on the filesystem // and internal free space within the store data that is immediately reusable. @@ -1111,45 +1198,6 @@ struct LogMessageVersion { } }; -struct AddressExclusion { - IPAddress ip; - int port; - - AddressExclusion() : ip(0), port(0) {} - explicit AddressExclusion(const IPAddress& ip) : ip(ip), port(0) {} - explicit AddressExclusion(const IPAddress& ip, int port) : ip(ip), port(port) {} - - bool operator<(AddressExclusion const& r) const { - if (ip != r.ip) - return ip < r.ip; - return port < r.port; - } - bool operator==(AddressExclusion const& r) const { return ip == r.ip && port == r.port; } - - bool isWholeMachine() const { return port == 0; } - bool isValid() const { return ip.isValid() || port != 0; } - - bool excludes(NetworkAddress const& addr) const { - if (isWholeMachine()) - return ip == addr.ip; - return ip == addr.ip && port == addr.port; - } - - // This is for debugging and IS NOT to be used for serialization to persistant state - std::string toString() const { - if (!isWholeMachine()) - return formatIpPort(ip, port); - return ip.toString(); - } - - static AddressExclusion parse(StringRef const&); - - template - void serialize(Ar& ar) { - serializer(ar, ip, port); - } -}; - inline bool addressExcluded(std::set const& exclusions, NetworkAddress const& addr) { return exclusions.count(AddressExclusion(addr.ip, addr.port)) || exclusions.count(AddressExclusion(addr.ip)); } @@ -1211,10 +1259,10 @@ class Database; struct HealthMetrics { struct StorageStats { - int64_t storageQueue; - int64_t storageDurabilityLag; - double diskUsage; - double cpuUsage; + int64_t storageQueue = 0; + int64_t storageDurabilityLag = 0; + double diskUsage = 0.0; + double cpuUsage = 0.0; bool operator==(StorageStats const& r) const { return ((storageQueue == r.storageQueue) && (storageDurabilityLag == r.storageDurabilityLag) && @@ -1391,6 +1439,25 @@ struct TenantMode { serializer(ar, mode); } + // This does not go back-and-forth cleanly with toString + // The '_experimental' suffix, if present, needs to be removed in order to be parsed. + static TenantMode fromString(std::string mode) { + if (mode.find("_experimental") != std::string::npos) { + mode.replace(mode.find("_experimental"), std::string::npos, ""); + } + if (mode == "disabled") { + return TenantMode::DISABLED; + } else if (mode == "optional") { + return TenantMode::OPTIONAL_TENANT; + } else if (mode == "required") { + return TenantMode::REQUIRED; + } else { + TraceEvent(SevError, "UnknownTenantMode").detail("TenantMode", mode); + ASSERT(false); + throw internal_error(); + } + } + std::string toString() const { switch (mode) { case DISABLED: @@ -1405,8 +1472,122 @@ struct TenantMode { return ""; } + Value toValue() const { return ValueRef(format("%d", (int)mode)); } + + static TenantMode fromValue(Optional val) { + if (!val.present()) { + return DISABLED; + } + + // A failed parsing returns 0 (DISABLED) + int num = atoi(val.get().toString().c_str()); + if (num < 0 || num >= END) { + return DISABLED; + } + + return static_cast(num); + } + uint32_t mode; }; + +template <> +struct Traceable : std::true_type { + static std::string toString(const TenantMode& value) { return value.toString(); } +}; + +struct EncryptionAtRestMode { + // These enumerated values are stored in the database configuration, so can NEVER be changed. Only add new ones + // just before END. + enum Mode { DISABLED = 0, DOMAIN_AWARE = 1, CLUSTER_AWARE = 2, END = 3 }; + + EncryptionAtRestMode() : mode(DISABLED) {} + EncryptionAtRestMode(Mode mode) : mode(mode) { + if ((uint32_t)mode >= END) { + this->mode = DISABLED; + } + } + operator Mode() const { return Mode(mode); } + + template + void serialize(Ar& ar) { + serializer(ar, mode); + } + + std::string toString() const { + switch (mode) { + case DISABLED: + return "disabled"; + case DOMAIN_AWARE: + return "domain_aware"; + case CLUSTER_AWARE: + return "cluster_aware"; + default: + ASSERT(false); + } + return ""; + } + + static EncryptionAtRestMode fromString(std::string mode) { + if (mode == "disabled") { + return EncryptionAtRestMode::DISABLED; + } else if (mode == "cluster_aware") { + return EncryptionAtRestMode::CLUSTER_AWARE; + } else if (mode == "domain_aware") { + return EncryptionAtRestMode::DOMAIN_AWARE; + } else { + TraceEvent(SevError, "UnknownEncryptMode").detail("EncryptMode", mode); + ASSERT(false); + throw internal_error(); + } + } + + Value toValue() const { return ValueRef(format("%d", (int)mode)); } + + bool isEquals(const EncryptionAtRestMode& e) const { return this->mode == e.mode; } + + bool operator==(const EncryptionAtRestMode& e) const { return isEquals(e); } + bool operator!=(const EncryptionAtRestMode& e) const { return !isEquals(e); } + bool operator==(Mode m) const { return mode == m; } + bool operator!=(Mode m) const { return mode != m; } + + bool isEncryptionEnabled() const { return mode != EncryptionAtRestMode::DISABLED; } + + static EncryptionAtRestMode fromValueRef(Optional val) { + if (!val.present()) { + return DISABLED; + } + + // A failed parsing returns 0 (DISABLED) + int num = atoi(val.get().toString().c_str()); + if (num < 0 || num >= END) { + return DISABLED; + } + + return static_cast(num); + } + + static EncryptionAtRestMode fromValue(Optional val) { + if (!val.present()) { + return EncryptionAtRestMode(); + } + + return EncryptionAtRestMode::fromValueRef(Optional(val.get().contents())); + } + + uint32_t mode; +}; + +template <> +struct Traceable : std::true_type { + static std::string toString(const EncryptionAtRestMode& mode) { return mode.toString(); } +}; + +typedef StringRef ClusterNameRef; +typedef Standalone ClusterName; + +enum class ClusterType { STANDALONE, METACLUSTER_MANAGEMENT, METACLUSTER_DATA }; + struct GRVCacheSpace { Version cachedReadVersion; double lastGrvTime; @@ -1428,15 +1609,26 @@ struct DatabaseSharedState { std::atomic refCount; DatabaseSharedState() - : protocolVersion(currentProtocolVersion), mutexLock(Mutex()), grvCacheSpace(GRVCacheSpace()), refCount(0) {} + : protocolVersion(currentProtocolVersion()), mutexLock(Mutex()), grvCacheSpace(GRVCacheSpace()), refCount(0) {} }; +const static std::regex wiggleLocalityValidation("([\\w_]+:[\\w\\-_\\.0-9]+)(;[\\w_]+:[\\w\\-_\\.0-9]+)*"); inline bool isValidPerpetualStorageWiggleLocality(std::string locality) { - int pos = locality.find(':'); - // locality should be either 0 or in the format ':' - return ((pos > 0 && pos < locality.size() - 1) || locality == "0"); + if (locality == "0") { + return true; + } + return std::regex_match(locality, wiggleLocalityValidation); } +// Parses `perpetual_storage_wiggle_locality` database option. +std::vector, Optional>> ParsePerpetualStorageWiggleLocality( + const std::string& localityKeyValues); + +// Whether the locality matches any locality filter in `localityKeyValues` (which is supposed to be parsed from +// ParsePerpetualStorageWiggleLocality). +bool localityMatchInList(const std::vector, Optional>>& localityKeyValues, + const LocalityData& locality); + // matches what's in fdb_c.h struct ReadBlobGranuleContext { // User context to pass along to functions @@ -1464,21 +1656,50 @@ struct ReadBlobGranuleContext { int granuleParallelism = 1; }; -// Store metadata associated with each storage server. Now it only contains data be used in perpetual storage wiggle. +// Store metadata associated with each storage server. Now it only contains data be used in perpetual storage +// wiggle. struct StorageMetadataType { constexpr static FileIdentifier file_identifier = 732123; // when the SS is initialized, in epoch seconds, comes from currentTime() double createdTime; + KeyValueStoreType storeType; + + // no need to serialize part (should be assigned after initialization) + bool wrongConfigured = false; + StorageMetadataType() : createdTime(0) {} - StorageMetadataType(uint64_t t) : createdTime(t) {} + StorageMetadataType(double t, KeyValueStoreType storeType = KeyValueStoreType::END, bool wrongConfigured = false) + : createdTime(t), storeType(storeType), wrongConfigured(wrongConfigured) {} static double currentTime() { return g_network->timer(); } + bool operator==(const StorageMetadataType& b) const { + return createdTime == b.createdTime && storeType == b.storeType && wrongConfigured == b.wrongConfigured; + } + + bool operator<(const StorageMetadataType& b) const { + if (wrongConfigured == b.wrongConfigured) { + // the older SS has smaller createdTime + return createdTime < b.createdTime; + } + return wrongConfigured > b.wrongConfigured; + } + + bool operator>(const StorageMetadataType& b) const { return b < *this; } + // To change this serialization, ProtocolVersion::StorageMetadata must be updated, and downgrades need // to be considered template void serialize(Ar& ar) { - serializer(ar, createdTime); + serializer(ar, createdTime, storeType); + } + + StatusObject toJSON() const { + StatusObject result; + result["created_time_timestamp"] = createdTime; + result["created_time_datetime"] = epochsToGMTString(createdTime); + result["storage_engine"] = storeType.toString(); + return result; } }; @@ -1496,4 +1717,92 @@ struct StorageWiggleValue { serializer(ar, id); } }; + +enum class ReadType { EAGER = 0, FETCH = 1, LOW = 2, NORMAL = 3, HIGH = 4, MIN = EAGER, MAX = HIGH }; + +FDB_BOOLEAN_PARAM(CacheResult); + +// store options for storage engine read +// ReadType describes the usage and priority of the read +// cacheResult determines whether the storage engine cache for this read +// consistencyCheckStartVersion indicates the consistency check which began at this version +// debugID helps to trace the path of the read +struct ReadOptions { + ReadType type; + // Once CacheResult is serializable, change type from bool to CacheResult + bool cacheResult; + bool lockAware = false; + Optional debugID; + Optional consistencyCheckStartVersion; + + ReadOptions(Optional debugID = Optional(), + ReadType type = ReadType::NORMAL, + CacheResult cache = CacheResult::True, + Optional version = Optional()) + : type(type), cacheResult(cache), debugID(debugID), consistencyCheckStartVersion(version){}; + + ReadOptions(ReadType type, CacheResult cache = CacheResult::True) : ReadOptions({}, type, cache) {} + + template + void serialize(Ar& ar) { + serializer(ar, type, cacheResult, debugID, consistencyCheckStartVersion, lockAware); + } +}; + +// Can be used to identify types (e.g. IDatabase) that can be used to create transactions with a `createTransaction` +// function +template +struct transaction_creator_traits : std::false_type {}; + +template +struct transaction_creator_traits> : std::true_type {}; + +template +struct transaction_creator_traits> : transaction_creator_traits {}; + +template +constexpr bool is_transaction_creator = transaction_creator_traits::value; + +struct Versionstamp { + Version version = invalidVersion; + uint16_t batchNumber = 0; + + bool operator==(const Versionstamp& r) const { return version == r.version && batchNumber == r.batchNumber; } + bool operator!=(const Versionstamp& r) const { return !(*this == r); } + bool operator<(const Versionstamp& r) const { + return version < r.version || (version == r.version && batchNumber < r.batchNumber); + } + bool operator>(const Versionstamp& r) const { return r < *this; } + bool operator<=(const Versionstamp& r) const { return !(*this > r); } + bool operator>=(const Versionstamp& r) const { return !(*this < r); } + + template + void serialize(Ar& ar) { + int64_t beVersion; + int16_t beBatch; + + if constexpr (!Ar::isDeserializing) { + beVersion = bigEndian64(version); + beBatch = bigEndian16(batchNumber); + } + + serializer(ar, beVersion, beBatch); + + if constexpr (Ar::isDeserializing) { + version = bigEndian64(beVersion); + batchNumber = bigEndian16(beBatch); + } + } +}; + +template +inline void save(Ar& ar, const Versionstamp& value) { + return const_cast(value).serialize(ar); +} + +template +inline void load(Ar& ar, Versionstamp& value) { + value.serialize(ar); +} + #endif diff --git a/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h b/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h new file mode 100644 index 0000000..5f4d935 --- /dev/null +++ b/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h @@ -0,0 +1,4555 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +/* + * GenericManagementAPI.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_GENERIC_MANAGEMENT_API_ACTOR_G_H) +#define FDBCLIENT_GENERIC_MANAGEMENT_API_ACTOR_G_H +#include "fdbclient/GenericManagementAPI.actor.g.h" +#elif !defined(FDBCLIENT_GENERIC_MANAGEMENT_API_ACTOR_H) +#define FDBCLIENT_GENERIC_MANAGEMENT_API_ACTOR_H + +/* This file defines "management" interfaces that have been templated to support both IClientAPI +and Native version of databases, transactions, etc., and includes functions for performing cluster +managment tasks. It isn't exposed to C clients or anywhere outside our code base and doesn't need +to be versioned. It doesn't do anything you can't do with the standard API and some knowledge of +the contents of the system key space. +*/ + +#include +#include +#include "fdbclient/ClientBooleanParams.h" +#include "fdbclient/DatabaseConfiguration.h" +#include "fdbclient/Status.h" +#include "fdbclient/Subspace.h" +#include "fdbclient/DatabaseConfiguration.h" +#include "fdbclient/MetaclusterRegistration.h" +#include "fdbclient/Status.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/StorageWiggleMetrics.actor.h" +#include "flow/actorcompiler.h" // has to be last include + +// ConfigurationResult enumerates normal outcomes of changeConfig() and various error +// conditions specific to it. changeConfig may also throw an Error to report other problems. +enum class ConfigurationResult { + NO_OPTIONS_PROVIDED, + CONFLICTING_OPTIONS, + UNKNOWN_OPTION, + INCOMPLETE_CONFIGURATION, + INVALID_CONFIGURATION, + STORAGE_MIGRATION_DISABLED, + DATABASE_ALREADY_CREATED, + DATABASE_CREATED, + DATABASE_UNAVAILABLE, + STORAGE_IN_UNKNOWN_DCID, + REGION_NOT_FULLY_REPLICATED, + MULTIPLE_ACTIVE_REGIONS, + REGIONS_CHANGED, + NOT_ENOUGH_WORKERS, + REGION_REPLICATION_MISMATCH, + DCID_MISSING, + LOCKED_NOT_NEW, + SUCCESS_WARN_PPW_GRADUAL, + SUCCESS, + SUCCESS_WARN_ROCKSDB_EXPERIMENTAL, + SUCCESS_WARN_SHARDED_ROCKSDB_EXPERIMENTAL, + DATABASE_CREATED_WARN_ROCKSDB_EXPERIMENTAL, + DATABASE_CREATED_WARN_SHARDED_ROCKSDB_EXPERIMENTAL, + DATABASE_IS_REGISTERED, + ENCRYPTION_AT_REST_MODE_ALREADY_SET +}; + +enum class CoordinatorsResult { + INVALID_NETWORK_ADDRESSES, + SAME_NETWORK_ADDRESSES, + NOT_COORDINATORS, // FIXME: not detected + DATABASE_UNREACHABLE, // FIXME: not detected + BAD_DATABASE_STATE, + COORDINATOR_UNREACHABLE, + NOT_ENOUGH_MACHINES, + SUCCESS +}; + +struct ConfigureAutoResult { + std::map address_class; + int32_t processes; + int32_t machines; + + std::string old_replication; + int32_t old_commit_proxies; + int32_t old_grv_proxies; + int32_t old_resolvers; + int32_t old_logs; + int32_t old_processes_with_transaction; + int32_t old_machines_with_transaction; + + std::string auto_replication; + int32_t auto_commit_proxies; + int32_t auto_grv_proxies; + int32_t auto_resolvers; + int32_t auto_logs; + int32_t auto_processes_with_transaction; + int32_t auto_machines_with_transaction; + + int32_t desired_commit_proxies; + int32_t desired_grv_proxies; + int32_t desired_resolvers; + int32_t desired_logs; + + ConfigureAutoResult() + : processes(-1), machines(-1), old_commit_proxies(-1), old_grv_proxies(-1), old_resolvers(-1), old_logs(-1), + old_processes_with_transaction(-1), old_machines_with_transaction(-1), auto_commit_proxies(-1), + auto_grv_proxies(-1), auto_resolvers(-1), auto_logs(-1), auto_processes_with_transaction(-1), + auto_machines_with_transaction(-1), desired_commit_proxies(-1), desired_grv_proxies(-1), desired_resolvers(-1), + desired_logs(-1) {} + + bool isValid() const { return processes != -1; } +}; + +ConfigurationResult buildConfiguration( + std::vector const& modeTokens, + std::map& outConf); // Accepts a vector of configuration tokens +ConfigurationResult buildConfiguration( + std::string const& modeString, + std::map& outConf); // Accepts tokens separated by spaces in a single string + +bool isCompleteConfiguration(std::map const& options); + +ConfigureAutoResult parseConfig(StatusObject const& status); + +bool isEncryptionAtRestModeConfigValid(Optional oldConfiguration, + std::map newConfig, + bool creating); +bool isTenantModeModeConfigValid(DatabaseConfiguration oldConfiguration, DatabaseConfiguration newConfiguration); + +// Management API written in template code to support both IClientAPI and NativeAPI +namespace ManagementAPI { + + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +// This generated class is to be used only via changeCachedRange() + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +template + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +class ChangeCachedRangeActorState { + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +public: + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ChangeCachedRangeActorState(Reference const& db,KeyRangeRef const& range,bool const& add) + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + : db(db), + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + range(range), + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + add(add), + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr(db->createTransaction()), + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + sysRange(KeyRangeRef(storageCacheKey(range.begin), storageCacheKey(range.end))), + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + sysRangeClear(KeyRangeRef(storageCacheKey(range.begin), keyAfter(storageCacheKey(range.end)))), + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + privateRange(KeyRangeRef(cacheKeysKey(0, range.begin), cacheKeysKey(0, range.end))), + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + trueValue(storageCacheValue(std::vector{ 0 })), + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + falseValue(storageCacheValue(std::vector{})) + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + fdb_probe_actor_create("changeCachedRange", reinterpret_cast(this)); + + } + ~ChangeCachedRangeActorState() + { + fdb_probe_actor_destroy("changeCachedRange", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ; + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ChangeCachedRangeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + try { + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->clear(sysRangeClear); + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->clear(privateRange); + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->addReadConflictRange(privateRange); + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + previousFuture = tr->getRange(KeyRangeRef(storageCachePrefix, sysRange.begin), 1, Snapshot::False, Reverse::True); + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_0 = safeThreadFutureToFuture(previousFuture); + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + err = e; + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_3 = safeThreadFutureToFuture(tr->onError(e)); + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(RangeResult const& previous,int loopDepth) + { + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + bool prevIsCached = false; + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!previous.empty()) + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::vector prevVal; + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + decodeStorageCacheValue(previous[0].value, prevVal); + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + prevIsCached = !prevVal.empty(); + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (prevIsCached && !add) + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(sysRange.begin, falseValue); + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(privateRange.begin, serverKeysFalse); + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + else + { + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!prevIsCached && add) + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(sysRange.begin, trueValue); + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(privateRange.begin, serverKeysTrue); + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + afterFuture = tr->getRange(KeyRangeRef(sysRange.end, storageCacheKeys.end), 1, Snapshot::False, Reverse::False); + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_1 = safeThreadFutureToFuture(afterFuture); + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(RangeResult && previous,int loopDepth) + { + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + bool prevIsCached = false; + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!previous.empty()) + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::vector prevVal; + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + decodeStorageCacheValue(previous[0].value, prevVal); + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + prevIsCached = !prevVal.empty(); + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (prevIsCached && !add) + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(sysRange.begin, falseValue); + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(privateRange.begin, serverKeysFalse); + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + else + { + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!prevIsCached && add) + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(sysRange.begin, trueValue); + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(privateRange.begin, serverKeysTrue); + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + afterFuture = tr->getRange(KeyRangeRef(sysRange.end, storageCacheKeys.end), 1, Snapshot::False, Reverse::False); + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_1 = safeThreadFutureToFuture(afterFuture); + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(RangeResult const& previous,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(previous, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(RangeResult && previous,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(previous), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeCachedRangeActor, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ChangeCachedRangeActor, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(RangeResult const& after,int loopDepth) + { + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + bool afterIsCached = false; + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!after.empty()) + #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::vector afterVal; + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + decodeStorageCacheValue(after[0].value, afterVal); + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + afterIsCached = afterVal.empty(); + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (afterIsCached && !add) + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(sysRange.end, trueValue); + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(privateRange.end, serverKeysTrue); + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + else + { + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!afterIsCached && add) + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(sysRange.end, falseValue); + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(privateRange.end, serverKeysFalse); + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->commit()); + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(RangeResult && after,int loopDepth) + { + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + bool afterIsCached = false; + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!after.empty()) + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::vector afterVal; + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + decodeStorageCacheValue(after[0].value, afterVal); + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + afterIsCached = afterVal.empty(); + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (afterIsCached && !add) + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(sysRange.end, trueValue); + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(privateRange.end, serverKeysTrue); + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + else + { + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!afterIsCached && add) + #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(sysRange.end, falseValue); + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(privateRange.end, serverKeysFalse); + #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->commit()); + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(RangeResult const& after,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(after, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(RangeResult && after,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(after), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeCachedRangeActor, 1, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 1, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 1, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< ChangeCachedRangeActor, 1, RangeResult >*,Error err) + { + fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont8(Void const& _,int loopDepth) + { + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeCachedRangeActorState(); static_cast(this)->destroy(); return 0; } + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeCachedRangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont8(Void && _,int loopDepth) + { + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeCachedRangeActorState(); static_cast(this)->destroy(); return 0; } + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeCachedRangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeCachedRangeActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< ChangeCachedRangeActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 2); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + TraceEvent(SevDebug, "ChangeCachedRangeError").error(err); + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + TraceEvent(SevDebug, "ChangeCachedRangeError").error(err); + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeCachedRangeActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< ChangeCachedRangeActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< ChangeCachedRangeActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), 3); + + } + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Reference db; + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + KeyRangeRef range; + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + bool add; + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Reference tr; + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + KeyRange sysRange; + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + KeyRange sysRangeClear; + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + KeyRange privateRange; + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Value trueValue; + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Value falseValue; + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + typename DB::TransactionT::template FutureT previousFuture; + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + typename DB::TransactionT::template FutureT afterFuture; + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Error err; + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +}; +// This generated class is to be used only via changeCachedRange() + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +template + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +class ChangeCachedRangeActor final : public Actor, public ActorCallback< ChangeCachedRangeActor, 0, RangeResult >, public ActorCallback< ChangeCachedRangeActor, 1, RangeResult >, public ActorCallback< ChangeCachedRangeActor, 2, Void >, public ActorCallback< ChangeCachedRangeActor, 3, Void >, public FastAllocated>, public ChangeCachedRangeActorState> { + #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ChangeCachedRangeActor, 0, RangeResult >; +friend struct ActorCallback< ChangeCachedRangeActor, 1, RangeResult >; +friend struct ActorCallback< ChangeCachedRangeActor, 2, Void >; +friend struct ActorCallback< ChangeCachedRangeActor, 3, Void >; + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ChangeCachedRangeActor(Reference const& db,KeyRangeRef const& range,bool const& add) + #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + : Actor(), + ChangeCachedRangeActorState>(db, range, add) + { + fdb_probe_actor_enter("changeCachedRange", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("changeCachedRange"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("changeCachedRange", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ChangeCachedRangeActor, 0, RangeResult >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ChangeCachedRangeActor, 1, RangeResult >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ChangeCachedRangeActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< ChangeCachedRangeActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +template + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +[[nodiscard]] Future changeCachedRange( Reference const& db, KeyRangeRef const& range, bool const& add ) { + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + return Future(new ChangeCachedRangeActor(db, range, add)); + #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +} + +#line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + +template +Future addCachedRange(Reference db, KeyRangeRef range) { + return changeCachedRange(db, range, true); +} + +template +Future removeCachedRange(Reference db, KeyRangeRef range) { + return changeCachedRange(db, range, false); +} + + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +// This generated class is to be used only via getWorkers() + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +template + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +class GetWorkersActorState { + #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +public: + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + GetWorkersActorState(Reference const& tr,typename Tr::template FutureT const& processClassesF,typename Tr::template FutureT const& processDataF) + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + : tr(tr), + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + processClassesF(processClassesF), + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + processDataF(processDataF) + #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + fdb_probe_actor_create("getWorkers", reinterpret_cast(this)); + + } + ~GetWorkersActorState() + { + fdb_probe_actor_destroy("getWorkers", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + processClassesF = tr->getRange(processClassKeys, CLIENT_KNOBS->TOO_MANY); + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + processDataF = tr->getRange(workerListKeys, CLIENT_KNOBS->TOO_MANY); + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + processClasses = safeThreadFutureToFuture(processClassesF); + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + processData = safeThreadFutureToFuture(processDataF); + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_0 = success(processClasses) && success(processData); + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetWorkersActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ASSERT(!processClasses.get().more && processClasses.get().size() < CLIENT_KNOBS->TOO_MANY); + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ASSERT(!processData.get().more && processData.get().size() < CLIENT_KNOBS->TOO_MANY); + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::map>, ProcessClass> id_class; + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for(int i = 0;i < processClasses.get().size();i++) { + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + id_class[decodeProcessClassKey(processClasses.get()[i].key)] = decodeProcessClassValue(processClasses.get()[i].value); + #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::vector results; + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for(int i = 0;i < processData.get().size();i++) { + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ProcessData data = decodeWorkerListValue(processData.get()[i].value); + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ProcessClass processClass = id_class[data.locality.processId()]; + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (processClass.classSource() == ProcessClass::DBSource || data.processClass.classType() == ProcessClass::UnsetClass) + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + data.processClass = processClass; + #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (data.processClass.classType() != ProcessClass::TesterClass) + #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + results.push_back(data); + #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(results); this->~GetWorkersActorState(); static_cast(this)->destroy(); return 0; } + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); + this->~GetWorkersActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ASSERT(!processClasses.get().more && processClasses.get().size() < CLIENT_KNOBS->TOO_MANY); + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ASSERT(!processData.get().more && processData.get().size() < CLIENT_KNOBS->TOO_MANY); + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::map>, ProcessClass> id_class; + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for(int i = 0;i < processClasses.get().size();i++) { + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + id_class[decodeProcessClassKey(processClasses.get()[i].key)] = decodeProcessClassValue(processClasses.get()[i].value); + #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::vector results; + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for(int i = 0;i < processData.get().size();i++) { + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ProcessData data = decodeWorkerListValue(processData.get()[i].value); + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ProcessClass processClass = id_class[data.locality.processId()]; + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (processClass.classSource() == ProcessClass::DBSource || data.processClass.classType() == ProcessClass::UnsetClass) + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + data.processClass = processClass; + #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (data.processClass.classType() != ProcessClass::TesterClass) + #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + results.push_back(data); + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(results); this->~GetWorkersActorState(); static_cast(this)->destroy(); return 0; } + #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); + this->~GetWorkersActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetWorkersActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetWorkersActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getWorkers", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getWorkers", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetWorkersActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getWorkers", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getWorkers", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetWorkersActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getWorkers", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getWorkers", reinterpret_cast(this), 0); + + } + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Reference tr; + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + typename Tr::template FutureT processClassesF; + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + typename Tr::template FutureT processDataF; + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Future processClasses; + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Future processData; + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +}; +// This generated class is to be used only via getWorkers() + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +template + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +class GetWorkersActor final : public Actor>, public ActorCallback< GetWorkersActor, 0, Void >, public FastAllocated>, public GetWorkersActorState> { + #line 1129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetWorkersActor, 0, Void >; + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + GetWorkersActor(Reference const& tr,typename Tr::template FutureT const& processClassesF,typename Tr::template FutureT const& processDataF) + #line 1140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + : Actor>(), + GetWorkersActorState>(tr, processClassesF, processDataF) + { + fdb_probe_actor_enter("getWorkers", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getWorkers"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getWorkers", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetWorkersActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +template + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +[[nodiscard]] Future> getWorkers( Reference const& tr, typename Tr::template FutureT const& processClassesF, typename Tr::template FutureT const& processDataF ) { + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + return Future>(new GetWorkersActor(tr, processClassesF, processDataF)); + #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +} + +#line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + +// All versions of changeConfig apply the given set of configuration tokens to the database, and return a +// ConfigurationResult (or error). + +// Accepts a full configuration in key/value format (from buildConfiguration) + #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +// This generated class is to be used only via changeConfig() + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +template + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +class ChangeConfigActorState { + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +public: + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ChangeConfigActorState(Reference const& db,std::map const& m,bool const& force) + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + : db(db), + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + m(m), + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + force(force), + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + initIdKey("\xff/init_id"_sr), + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr(db->createTransaction()) + #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + fdb_probe_actor_create("changeConfig", reinterpret_cast(this)); + + } + ~ChangeConfigActorState() + { + fdb_probe_actor_destroy("changeConfig", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!m.size()) + #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::NO_OPTIONS_PROVIDED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::NO_OPTIONS_PROVIDED); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::string initKey = configKeysPrefix.toString() + "initialized"; + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + creating = m.count(initKey) != 0; + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + locked = Optional(); + #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + auto iter = m.find(databaseLockedKey.toString()); + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (iter != m.end()) + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!creating) + #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::LOCKED_NOT_NEW); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::LOCKED_NOT_NEW); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + locked = UID::fromString(iter->second); + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + m.erase(iter); + #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (creating) + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + m[initIdKey.toString()] = deterministicRandom()->randomUniqueID().toString(); + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!isCompleteConfiguration(m)) + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::INCOMPLETE_CONFIGURATION); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::INCOMPLETE_CONFIGURATION); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!isEncryptionAtRestModeConfigValid(Optional(), m, creating)) + #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::INVALID_CONFIGURATION); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::INVALID_CONFIGURATION); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + else + { + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (m.count(encryptionAtRestModeConfKey.toString()) != 0) + #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::ENCRYPTION_AT_REST_MODE_ALREADY_SET); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::ENCRYPTION_AT_REST_MODE_ALREADY_SET); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tooLong = delay(60); + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + versionKey = BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned()); + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + oldReplicationUsesDcId = false; + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + resetPPWStats = false; + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + warnPPWGradual = false; + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + warnRocksDBIsExperimental = false; + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + warnShardedRocksDBIsExperimental = false; + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ; + #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ChangeConfigActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (warnPPWGradual) + #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::SUCCESS_WARN_PPW_GRADUAL); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::SUCCESS_WARN_PPW_GRADUAL); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (warnRocksDBIsExperimental) + #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::SUCCESS_WARN_ROCKSDB_EXPERIMENTAL); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::SUCCESS_WARN_ROCKSDB_EXPERIMENTAL); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (warnShardedRocksDBIsExperimental) + #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::SUCCESS_WARN_SHARDED_ROCKSDB_EXPERIMENTAL); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::SUCCESS_WARN_SHARDED_ROCKSDB_EXPERIMENTAL); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::SUCCESS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::SUCCESS); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + } + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!creating && !force) + #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + fConfigF = tr->getRange(configKeys, CLIENT_KNOBS->TOO_MANY); + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + fConfig = safeThreadFutureToFuture(fConfigF); + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + processClassesF = typename DB::TransactionT::template FutureT(); + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + processDataF = typename DB::TransactionT::template FutureT(); + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + fWorkers = getWorkers(tr, processClassesF, processDataF); + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_0 = success(fConfig) || tooLong; + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont2(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + e1 = Error(e); + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if ((e.code() == error_code_not_committed || e.code() == error_code_transaction_too_old) && creating) + #line 1478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->reset(); + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ; + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = a_body1loopBody1Catch1loopHead1(loopDepth); + } + else + { + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (creating) + #line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::INITIALIZE_NEW_DATABASE); + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->addReadConflictRange(singleKeyRange(initIdKey)); + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + else + { + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (m.size()) + #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::CAUSAL_WRITE_RISKY); + #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->addReadConflictRange(singleKeyRange(m.begin()->first)); + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (locked.present()) + #line 1527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ASSERT(creating); + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->atomicOp(databaseLockedKey, BinaryWriter::toValue(locked.get(), Unversioned()) .withPrefix("0123456789"_sr) .withSuffix("\x00\x00\x00\x00"_sr), MutationRef::SetVersionstampedValue); + #line 1533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for(auto i = m.begin();i != m.end();++i) { + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(StringRef(i->first), StringRef(i->second)); + #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (i->first == perpetualStorageWiggleKey) + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (i->second == "0") + #line 1545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + resetPPWStats = true; + #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + else + { + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (i->first == "1") + #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + resetPPWStats = false; + #line 1559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + } + } + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!creating && resetPPWStats) + #line 1566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + wiggleData = StorageWiggleData(); + #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_6 = wiggleData.resetStorageWiggleMetrics(tr, PrimaryRegion(true)); + #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1loopBody1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont24(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!fConfig.isReady()) + #line 1593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (fConfig.isReady()) + #line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ASSERT(fConfig.get().size() < CLIENT_KNOBS->TOO_MANY); + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + oldConfig = DatabaseConfiguration(); + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + oldConfig.fromKeyValues((VectorRef)fConfig.get()); + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + newConfig = oldConfig; + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto kv : m ) { + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + newConfig.set(kv.first, kv.second); + #line 1619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!newConfig.isValid() || !isEncryptionAtRestModeConfigValid(oldConfig, m, creating) || !isTenantModeModeConfigValid(oldConfig, newConfig)) + #line 1623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::INVALID_CONFIGURATION); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::INVALID_CONFIGURATION); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.tLogPolicy->attributeKeys().count("dcid") && newConfig.regions.size() > 0) + #line 1635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::REGION_REPLICATION_MISMATCH); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::REGION_REPLICATION_MISMATCH); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + oldReplicationUsesDcId = oldReplicationUsesDcId || oldConfig.tLogPolicy->attributeKeys().count("dcid"); + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (oldConfig.usableRegions != newConfig.usableRegions) + #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::map dcId_priority; + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : newConfig.regions ) { + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + dcId_priority[it.dcId] = it.priority; + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : oldConfig.regions ) { + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!dcId_priority.count(it.dcId) || dcId_priority[it.dcId] != it.priority) + #line 1663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::REGIONS_CHANGED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::REGIONS_CHANGED); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + int activeRegionCount = 0; + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : newConfig.regions ) { + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (it.priority >= 0) + #line 1680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + activeRegionCount++; + #line 1684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (activeRegionCount > 1) + #line 1689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::MULTIPLE_ACTIVE_REGIONS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::MULTIPLE_ACTIVE_REGIONS); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + fServerListF = tr->getRange(serverListKeys, CLIENT_KNOBS->TOO_MANY); + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + fServerList = (newConfig.regions.size()) ? safeThreadFutureToFuture(fServerListF) : Future(); + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.usableRegions == 2) + #line 1706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (oldReplicationUsesDcId) + #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + fLocalityListF = tr->getRange(tagLocalityListKeys, CLIENT_KNOBS->TOO_MANY); + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + fLocalityList = safeThreadFutureToFuture(fLocalityListF); + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_1 = success(fLocalityList) || tooLong; + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + else + { + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + replicasFuturesF = std::vector>>(); + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + replicasFutures = std::vector>>(); + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : newConfig.regions ) { + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (it.priority >= 0) + #line 1738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + replicasFuturesF.push_back(tr->get(datacenterReplicasKeyFor(it.dcId))); + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + replicasFutures.push_back(safeThreadFutureToFuture(replicasFuturesF.back())); + #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_2 = waitForAll(replicasFutures) || tooLong; + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + } + else + { + loopDepth = a_body1loopBody1cont6(loopDepth); + } + } + else + { + loopDepth = a_body1loopBody1cont4(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!fConfig.isReady()) + #line 1776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (fConfig.isReady()) + #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ASSERT(fConfig.get().size() < CLIENT_KNOBS->TOO_MANY); + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + oldConfig = DatabaseConfiguration(); + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + oldConfig.fromKeyValues((VectorRef)fConfig.get()); + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + newConfig = oldConfig; + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto kv : m ) { + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + newConfig.set(kv.first, kv.second); + #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!newConfig.isValid() || !isEncryptionAtRestModeConfigValid(oldConfig, m, creating) || !isTenantModeModeConfigValid(oldConfig, newConfig)) + #line 1806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::INVALID_CONFIGURATION); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::INVALID_CONFIGURATION); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.tLogPolicy->attributeKeys().count("dcid") && newConfig.regions.size() > 0) + #line 1818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::REGION_REPLICATION_MISMATCH); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::REGION_REPLICATION_MISMATCH); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + oldReplicationUsesDcId = oldReplicationUsesDcId || oldConfig.tLogPolicy->attributeKeys().count("dcid"); + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (oldConfig.usableRegions != newConfig.usableRegions) + #line 1832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::map dcId_priority; + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : newConfig.regions ) { + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + dcId_priority[it.dcId] = it.priority; + #line 1840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : oldConfig.regions ) { + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!dcId_priority.count(it.dcId) || dcId_priority[it.dcId] != it.priority) + #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::REGIONS_CHANGED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::REGIONS_CHANGED); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + int activeRegionCount = 0; + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : newConfig.regions ) { + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (it.priority >= 0) + #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + activeRegionCount++; + #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (activeRegionCount > 1) + #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::MULTIPLE_ACTIVE_REGIONS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::MULTIPLE_ACTIVE_REGIONS); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + fServerListF = tr->getRange(serverListKeys, CLIENT_KNOBS->TOO_MANY); + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + fServerList = (newConfig.regions.size()) ? safeThreadFutureToFuture(fServerListF) : Future(); + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.usableRegions == 2) + #line 1889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (oldReplicationUsesDcId) + #line 1893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + fLocalityListF = tr->getRange(tagLocalityListKeys, CLIENT_KNOBS->TOO_MANY); + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + fLocalityList = safeThreadFutureToFuture(fLocalityListF); + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_1 = success(fLocalityList) || tooLong; + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + else + { + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + replicasFuturesF = std::vector>>(); + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + replicasFutures = std::vector>>(); + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : newConfig.regions ) { + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (it.priority >= 0) + #line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + replicasFuturesF.push_back(tr->get(datacenterReplicasKeyFor(it.dcId))); + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + replicasFutures.push_back(safeThreadFutureToFuture(replicasFuturesF.back())); + #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_2 = waitForAll(replicasFutures) || tooLong; + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + } + else + { + loopDepth = a_body1loopBody1cont6(loopDepth); + } + } + else + { + loopDepth = a_body1loopBody1cont4(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeConfigActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ChangeConfigActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont4(int loopDepth) + { + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont6(int loopDepth) + { + #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.regions.size()) + #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_3 = success(fServerList) || tooLong; + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont22(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont17(int loopDepth) + { + loopDepth = a_body1loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont18(Void const& _,int loopDepth) + { + #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!fLocalityList.isReady()) + #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + RangeResult localityList = fLocalityList.get(); + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ASSERT(!localityList.more && localityList.size() < CLIENT_KNOBS->TOO_MANY); + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::set localityDcIds; + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& s : localityList ) { + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + auto dc = decodeTagLocalityListKey(s.key); + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (dc.present()) + #line 2081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + localityDcIds.insert(dc.get()); + #line 2085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : newConfig.regions ) { + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (localityDcIds.count(it.dcId) == 0) + #line 2092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DCID_MISSING); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DCID_MISSING); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + loopDepth = a_body1loopBody1cont17(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont18(Void && _,int loopDepth) + { + #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!fLocalityList.isReady()) + #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + RangeResult localityList = fLocalityList.get(); + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ASSERT(!localityList.more && localityList.size() < CLIENT_KNOBS->TOO_MANY); + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::set localityDcIds; + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& s : localityList ) { + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + auto dc = decodeTagLocalityListKey(s.key); + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (dc.present()) + #line 2133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + localityDcIds.insert(dc.get()); + #line 2137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : newConfig.regions ) { + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (localityDcIds.count(it.dcId) == 0) + #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DCID_MISSING); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DCID_MISSING); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + loopDepth = a_body1loopBody1cont17(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont18(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont18(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeConfigActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< ChangeConfigActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont19(Void const& _,int loopDepth) + { + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : replicasFutures ) { + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!it.isReady()) + #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!it.get().present()) + #line 2240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::REGION_NOT_FULLY_REPLICATED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::REGION_NOT_FULLY_REPLICATED); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + loopDepth = a_body1loopBody1cont17(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont19(Void && _,int loopDepth) + { + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : replicasFutures ) { + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!it.isReady()) + #line 2261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!it.get().present()) + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::REGION_NOT_FULLY_REPLICATED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::REGION_NOT_FULLY_REPLICATED); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + loopDepth = a_body1loopBody1cont17(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when2(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont19(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when2(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont19(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeConfigActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when2(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when2(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< ChangeConfigActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 2); + + } + int a_body1loopBody1cont22(int loopDepth) + { + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_4 = success(fWorkers) || tooLong; + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont22when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont23(Void const& _,int loopDepth) + { + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!fServerList.isReady()) + #line 2371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + RangeResult serverList = fServerList.get(); + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ASSERT(!serverList.more && serverList.size() < CLIENT_KNOBS->TOO_MANY); + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::set newDcIds; + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : newConfig.regions ) { + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + newDcIds.insert(it.dcId); + #line 2391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::set> missingDcIds; + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& s : serverList ) { + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + auto ssi = decodeServerListValue(s.value); + #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!ssi.locality.dcId().present() || !newDcIds.count(ssi.locality.dcId().get())) + #line 2401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + missingDcIds.insert(ssi.locality.dcId()); + #line 2405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (missingDcIds.size() > (oldReplicationUsesDcId ? 1 : 0)) + #line 2410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::STORAGE_IN_UNKNOWN_DCID); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::STORAGE_IN_UNKNOWN_DCID); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1loopBody1cont22(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont23(Void && _,int loopDepth) + { + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!fServerList.isReady()) + #line 2428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + RangeResult serverList = fServerList.get(); + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ASSERT(!serverList.more && serverList.size() < CLIENT_KNOBS->TOO_MANY); + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::set newDcIds; + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : newConfig.regions ) { + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + newDcIds.insert(it.dcId); + #line 2448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::set> missingDcIds; + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& s : serverList ) { + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + auto ssi = decodeServerListValue(s.value); + #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!ssi.locality.dcId().present() || !newDcIds.count(ssi.locality.dcId().get())) + #line 2458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + missingDcIds.insert(ssi.locality.dcId()); + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (missingDcIds.size() > (oldReplicationUsesDcId ? 1 : 0)) + #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::STORAGE_IN_UNKNOWN_DCID); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::STORAGE_IN_UNKNOWN_DCID); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1loopBody1cont22(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont6when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont23(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont6when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont23(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeConfigActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont6when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont6when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< ChangeConfigActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 3); + + } + int a_body1loopBody1cont22cont1(Void const& _,int loopDepth) + { + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!fWorkers.isReady()) + #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.regions.size()) + #line 2560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::map, std::set>> dcId_zoneIds; + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : fWorkers.get() ) { + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (it.processClass.machineClassFitness(ProcessClass::Storage) <= ProcessClass::WorstFit) + #line 2568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + dcId_zoneIds[it.locality.dcId()].insert(it.locality.zoneId()); + #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& region : newConfig.regions ) { + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (dcId_zoneIds[region.dcId].size() < std::max(newConfig.storageTeamSize, newConfig.tLogReplicationFactor)) + #line 2579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::NOT_ENOUGH_WORKERS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::NOT_ENOUGH_WORKERS); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (region.satelliteTLogReplicationFactor > 0 && region.priority >= 0) + #line 2591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + int totalSatelliteProcesses = 0; + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& sat : region.satellites ) { + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + totalSatelliteProcesses += dcId_zoneIds[sat.dcId].size(); + #line 2599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (totalSatelliteProcesses < region.satelliteTLogReplicationFactor) + #line 2603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::NOT_ENOUGH_WORKERS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::NOT_ENOUGH_WORKERS); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + } + } + else + { + #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::set> zoneIds; + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : fWorkers.get() ) { + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (it.processClass.machineClassFitness(ProcessClass::Storage) <= ProcessClass::WorstFit) + #line 2624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + zoneIds.insert(it.locality.zoneId()); + #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (zoneIds.size() < std::max(newConfig.storageTeamSize, newConfig.tLogReplicationFactor)) + #line 2633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::NOT_ENOUGH_WORKERS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::NOT_ENOUGH_WORKERS); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.storageServerStoreType != oldConfig.storageServerStoreType && newConfig.storageMigrationType == StorageMigrationType::DISABLED) + #line 2646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::STORAGE_MIGRATION_DISABLED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::STORAGE_MIGRATION_DISABLED); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.storageMigrationType == StorageMigrationType::GRADUAL && newConfig.perpetualStorageWiggleSpeed == 0) + #line 2660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + warnPPWGradual = true; + #line 2664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + else + { + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.storageServerStoreType != oldConfig.storageServerStoreType && newConfig.storageServerStoreType == KeyValueStoreType::SSD_ROCKSDB_V1) + #line 2670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + warnRocksDBIsExperimental = true; + #line 2674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + else + { + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.storageServerStoreType != oldConfig.storageServerStoreType && newConfig.storageServerStoreType == KeyValueStoreType::SSD_SHARDED_ROCKSDB) + #line 2680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + warnShardedRocksDBIsExperimental = true; + #line 2684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + } + } + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.tenantMode != oldConfig.tenantMode) + #line 2691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture> __when_expr_5 = metacluster::metadata::metaclusterRegistration().get(tr); + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont22cont1when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_5.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont22cont2(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont22cont1(Void && _,int loopDepth) + { + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!fWorkers.isReady()) + #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_UNAVAILABLE); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_UNAVAILABLE); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.regions.size()) + #line 2728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::map, std::set>> dcId_zoneIds; + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : fWorkers.get() ) { + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (it.processClass.machineClassFitness(ProcessClass::Storage) <= ProcessClass::WorstFit) + #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + dcId_zoneIds[it.locality.dcId()].insert(it.locality.zoneId()); + #line 2740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& region : newConfig.regions ) { + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (dcId_zoneIds[region.dcId].size() < std::max(newConfig.storageTeamSize, newConfig.tLogReplicationFactor)) + #line 2747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::NOT_ENOUGH_WORKERS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::NOT_ENOUGH_WORKERS); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (region.satelliteTLogReplicationFactor > 0 && region.priority >= 0) + #line 2759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + int totalSatelliteProcesses = 0; + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& sat : region.satellites ) { + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + totalSatelliteProcesses += dcId_zoneIds[sat.dcId].size(); + #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (totalSatelliteProcesses < region.satelliteTLogReplicationFactor) + #line 2771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::NOT_ENOUGH_WORKERS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::NOT_ENOUGH_WORKERS); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + } + } + else + { + #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::set> zoneIds; + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : fWorkers.get() ) { + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (it.processClass.machineClassFitness(ProcessClass::Storage) <= ProcessClass::WorstFit) + #line 2792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + zoneIds.insert(it.locality.zoneId()); + #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (zoneIds.size() < std::max(newConfig.storageTeamSize, newConfig.tLogReplicationFactor)) + #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::NOT_ENOUGH_WORKERS); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::NOT_ENOUGH_WORKERS); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.storageServerStoreType != oldConfig.storageServerStoreType && newConfig.storageMigrationType == StorageMigrationType::DISABLED) + #line 2814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::STORAGE_MIGRATION_DISABLED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::STORAGE_MIGRATION_DISABLED); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.storageMigrationType == StorageMigrationType::GRADUAL && newConfig.perpetualStorageWiggleSpeed == 0) + #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + warnPPWGradual = true; + #line 2832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + else + { + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.storageServerStoreType != oldConfig.storageServerStoreType && newConfig.storageServerStoreType == KeyValueStoreType::SSD_ROCKSDB_V1) + #line 2838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + warnRocksDBIsExperimental = true; + #line 2842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + else + { + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.storageServerStoreType != oldConfig.storageServerStoreType && newConfig.storageServerStoreType == KeyValueStoreType::SSD_SHARDED_ROCKSDB) + #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + warnShardedRocksDBIsExperimental = true; + #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + } + } + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (newConfig.tenantMode != oldConfig.tenantMode) + #line 2859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture> __when_expr_5 = metacluster::metadata::metaclusterRegistration().get(tr); + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont22cont1when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_5.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont22cont2(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont22when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont22cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont22when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont22cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeConfigActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont22when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont22when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< ChangeConfigActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 4); + + } + int a_body1loopBody1cont22cont2(int loopDepth) + { + loopDepth = a_body1loopBody1cont4(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont22cont23(Optional const& metaclusterRegistration,int loopDepth) + { + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (metaclusterRegistration.present()) + #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_IS_REGISTERED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_IS_REGISTERED); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1loopBody1cont22cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont22cont23(Optional && metaclusterRegistration,int loopDepth) + { + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (metaclusterRegistration.present()) + #line 2971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_IS_REGISTERED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 2975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_IS_REGISTERED); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1loopBody1cont22cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont22cont1when1(Optional const& metaclusterRegistration,int loopDepth) + { + loopDepth = a_body1loopBody1cont22cont23(metaclusterRegistration, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont22cont1when1(Optional && metaclusterRegistration,int loopDepth) + { + loopDepth = a_body1loopBody1cont22cont23(std::move(metaclusterRegistration), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeConfigActor, 5, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 5, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1loopBody1cont22cont1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 5, Optional >*,Optional && value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1loopBody1cont22cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< ChangeConfigActor, 5, Optional >*,Error err) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 5); + + } + int a_body1loopBody1cont24(int loopDepth) + { + #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->addReadConflictRange(singleKeyRange(moveKeysLockOwnerKey)); + #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(moveKeysLockOwnerKey, versionKey); + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_8 = safeThreadFutureToFuture(tr->commit()); + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1loopBody1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1loopBody1cont24when1(__when_expr_8.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 9; + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont34(Void const& _,int loopDepth) + { + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_7 = wiggleData.resetStorageWiggleMetrics(tr, PrimaryRegion(false)); + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1loopBody1cont34when1(__when_expr_7.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 8; + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont34(Void && _,int loopDepth) + { + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_7 = wiggleData.resetStorageWiggleMetrics(tr, PrimaryRegion(false)); + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1loopBody1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1loopBody1cont34when1(__when_expr_7.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 8; + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont34(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont34(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose7() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeConfigActor, 6, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 6, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 6); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 6, Void >*,Void && value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 6); + + } + void a_callback_error(ActorCallback< ChangeConfigActor, 6, Void >*,Error err) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 6); + + } + int a_body1loopBody1cont34cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont24(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont34cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont24(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont34when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont34cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont34when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont34cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose8() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeConfigActor, 7, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 7, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 7); + a_exitChoose8(); + try { + a_body1loopBody1cont34when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 7); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 7, Void >*,Void && value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 7); + a_exitChoose8(); + try { + a_body1loopBody1cont34when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 7); + + } + void a_callback_error(ActorCallback< ChangeConfigActor, 7, Void >*,Error err) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 7); + a_exitChoose8(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 7); + + } + int a_body1loopBody1cont24cont1(Void const& _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont24cont1(Void && _,int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont24when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont24cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont24when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont24cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose9() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeConfigActor, 8, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 8, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 8); + a_exitChoose9(); + try { + a_body1loopBody1cont24when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 8); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 8, Void >*,Void && value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 8); + a_exitChoose9(); + try { + a_body1loopBody1cont24when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 8); + + } + void a_callback_error(ActorCallback< ChangeConfigActor, 8, Void >*,Error err) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 8); + a_exitChoose9(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 8); + + } + int a_body1loopBody1Catch1cont1(int loopDepth) + { + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_11 = safeThreadFutureToFuture(tr->onError(e1)); + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_11.isReady()) { if (__when_expr_11.isError()) return a_body1Catch1(__when_expr_11.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1cont1when1(__when_expr_11.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 12; + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_11.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1Catch1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1Catch1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1loopBody1(int loopDepth) + { + try { + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + vF = tr->get(initIdKey); + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture> __when_expr_9 = safeThreadFutureToFuture(vF); + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1loopBody1Catch1loopBody1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1loopBody1Catch1loopBody1when1(__when_expr_9.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 10; + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_9.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 3358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1Catch1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopBody1Catch1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1loopBody1Catch1(const Error& e2,int loopDepth=0) + { + try { + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_10 = safeThreadFutureToFuture(tr->onError(e2)); + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); + #line 3382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_10.isReady()) { if (__when_expr_10.isError()) return a_body1Catch1(__when_expr_10.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1Catch1loopBody1Catch1when1(__when_expr_10.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 11; + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_10.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 2)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 2)); + } + + return loopDepth; + } + int a_body1loopBody1Catch1loopBody1cont2(Optional const& v,int loopDepth) + { + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (v != m[initIdKey.toString()]) + #line 3402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_ALREADY_CREATED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 3406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_ALREADY_CREATED); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (m[configKeysPrefix.toString() + "storage_engine"] == std::to_string(KeyValueStoreType::SSD_ROCKSDB_V1)) + #line 3416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_CREATED_WARN_ROCKSDB_EXPERIMENTAL); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_CREATED_WARN_ROCKSDB_EXPERIMENTAL); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (m[configKeysPrefix.toString() + "storage_engine"] == std::to_string(KeyValueStoreType::SSD_SHARDED_ROCKSDB)) + #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_CREATED_WARN_SHARDED_ROCKSDB_EXPERIMENTAL); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 3434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_CREATED_WARN_SHARDED_ROCKSDB_EXPERIMENTAL); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_CREATED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 3444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_CREATED); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + } + + return loopDepth; + } + int a_body1loopBody1Catch1loopBody1cont2(Optional && v,int loopDepth) + { + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (v != m[initIdKey.toString()]) + #line 3459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_ALREADY_CREATED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 3463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_ALREADY_CREATED); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (m[configKeysPrefix.toString() + "storage_engine"] == std::to_string(KeyValueStoreType::SSD_ROCKSDB_V1)) + #line 3473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_CREATED_WARN_ROCKSDB_EXPERIMENTAL); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 3477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_CREATED_WARN_ROCKSDB_EXPERIMENTAL); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (m[configKeysPrefix.toString() + "storage_engine"] == std::to_string(KeyValueStoreType::SSD_SHARDED_ROCKSDB)) + #line 3487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_CREATED_WARN_SHARDED_ROCKSDB_EXPERIMENTAL); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 3491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_CREATED_WARN_SHARDED_ROCKSDB_EXPERIMENTAL); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::DATABASE_CREATED); this->~ChangeConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 3501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::DATABASE_CREATED); + this->~ChangeConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + } + } + + return loopDepth; + } + int a_body1loopBody1Catch1loopBody1when1(Optional const& v,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1loopBody1cont2(v, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1loopBody1when1(Optional && v,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1loopBody1cont2(std::move(v), loopDepth); + + return loopDepth; + } + void a_exitChoose10() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeConfigActor, 9, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 9, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 9); + a_exitChoose10(); + try { + a_body1loopBody1Catch1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 9); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 9, Optional >*,Optional && value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 9); + a_exitChoose10(); + try { + a_body1loopBody1Catch1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 9); + + } + void a_callback_error(ActorCallback< ChangeConfigActor, 9, Optional >*,Error err) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 9); + a_exitChoose10(); + try { + a_body1loopBody1Catch1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 9); + + } + int a_body1loopBody1Catch1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose11() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeConfigActor, 10, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 10, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 10); + a_exitChoose11(); + try { + a_body1loopBody1Catch1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 10); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 10, Void >*,Void && value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 10); + a_exitChoose11(); + try { + a_body1loopBody1Catch1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 10); + + } + void a_callback_error(ActorCallback< ChangeConfigActor, 10, Void >*,Error err) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 10); + a_exitChoose11(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 10); + + } + int a_body1loopBody1Catch1cont3(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont3(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose12() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeConfigActor, 11, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 11, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 11); + a_exitChoose12(); + try { + a_body1loopBody1Catch1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 11); + + } + void a_callback_fire(ActorCallback< ChangeConfigActor, 11, Void >*,Void && value) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 11); + a_exitChoose12(); + try { + a_body1loopBody1Catch1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 11); + + } + void a_callback_error(ActorCallback< ChangeConfigActor, 11, Void >*,Error err) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), 11); + a_exitChoose12(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), 11); + + } + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Reference db; + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::map m; + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + bool force; + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StringRef initIdKey; + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Reference tr; + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + bool creating; + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Optional locked; + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Future tooLong; + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Key versionKey; + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + bool oldReplicationUsesDcId; + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + bool resetPPWStats; + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + bool warnPPWGradual; + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + bool warnRocksDBIsExperimental; + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + bool warnShardedRocksDBIsExperimental; + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + typename DB::TransactionT::template FutureT fConfigF; + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Future fConfig; + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + typename DB::TransactionT::template FutureT processClassesF; + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + typename DB::TransactionT::template FutureT processDataF; + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Future> fWorkers; + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + DatabaseConfiguration oldConfig; + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + DatabaseConfiguration newConfig; + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + typename DB::TransactionT::template FutureT fServerListF; + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Future fServerList; + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + typename DB::TransactionT::template FutureT fLocalityListF; + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Future fLocalityList; + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::vector>> replicasFuturesF; + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::vector>> replicasFutures; + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StorageWiggleData wiggleData; + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Error e1; + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + typename DB::TransactionT::template FutureT> vF; + #line 3785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +}; +// This generated class is to be used only via changeConfig() + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +template + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +class ChangeConfigActor final : public Actor, public ActorCallback< ChangeConfigActor, 0, Void >, public ActorCallback< ChangeConfigActor, 1, Void >, public ActorCallback< ChangeConfigActor, 2, Void >, public ActorCallback< ChangeConfigActor, 3, Void >, public ActorCallback< ChangeConfigActor, 4, Void >, public ActorCallback< ChangeConfigActor, 5, Optional >, public ActorCallback< ChangeConfigActor, 6, Void >, public ActorCallback< ChangeConfigActor, 7, Void >, public ActorCallback< ChangeConfigActor, 8, Void >, public ActorCallback< ChangeConfigActor, 9, Optional >, public ActorCallback< ChangeConfigActor, 10, Void >, public ActorCallback< ChangeConfigActor, 11, Void >, public FastAllocated>, public ChangeConfigActorState> { + #line 3792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ChangeConfigActor, 0, Void >; +friend struct ActorCallback< ChangeConfigActor, 1, Void >; +friend struct ActorCallback< ChangeConfigActor, 2, Void >; +friend struct ActorCallback< ChangeConfigActor, 3, Void >; +friend struct ActorCallback< ChangeConfigActor, 4, Void >; +friend struct ActorCallback< ChangeConfigActor, 5, Optional >; +friend struct ActorCallback< ChangeConfigActor, 6, Void >; +friend struct ActorCallback< ChangeConfigActor, 7, Void >; +friend struct ActorCallback< ChangeConfigActor, 8, Void >; +friend struct ActorCallback< ChangeConfigActor, 9, Optional >; +friend struct ActorCallback< ChangeConfigActor, 10, Void >; +friend struct ActorCallback< ChangeConfigActor, 11, Void >; + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ChangeConfigActor(Reference const& db,std::map const& m,bool const& force) + #line 3814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + : Actor(), + ChangeConfigActorState>(db, m, force) + { + fdb_probe_actor_enter("changeConfig", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("changeConfig"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("changeConfig", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ChangeConfigActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ChangeConfigActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ChangeConfigActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< ChangeConfigActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< ChangeConfigActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< ChangeConfigActor, 5, Optional >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< ChangeConfigActor, 6, Void >*)0, actor_cancelled()); break; + case 8: this->a_callback_error((ActorCallback< ChangeConfigActor, 7, Void >*)0, actor_cancelled()); break; + case 9: this->a_callback_error((ActorCallback< ChangeConfigActor, 8, Void >*)0, actor_cancelled()); break; + case 10: this->a_callback_error((ActorCallback< ChangeConfigActor, 9, Optional >*)0, actor_cancelled()); break; + case 11: this->a_callback_error((ActorCallback< ChangeConfigActor, 10, Void >*)0, actor_cancelled()); break; + case 12: this->a_callback_error((ActorCallback< ChangeConfigActor, 11, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +template + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +[[nodiscard]] Future changeConfig( Reference const& db, std::map const& m, bool const& force ) { + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + return Future(new ChangeConfigActor(db, m, force)); + #line 3854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +} + +#line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + + #line 3859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +// This generated class is to be used only via autoConfig() + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +template + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +class AutoConfigActorState { + #line 3865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +public: + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + AutoConfigActorState(Reference const& db,ConfigureAutoResult const& conf) + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + : db(db), + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + conf(conf), + #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr(db->createTransaction()), + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + versionKey(BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned())) + #line 3878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + fdb_probe_actor_create("autoConfig", reinterpret_cast(this)); + + } + ~AutoConfigActorState() + { + fdb_probe_actor_destroy("autoConfig", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!conf.address_class.size()) + #line 3893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::INCOMPLETE_CONFIGURATION); this->~AutoConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 3897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::INCOMPLETE_CONFIGURATION); + this->~AutoConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ; + #line 3905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~AutoConfigActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES); + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + processClassesF = typename DB::TransactionT::template FutureT(); + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + processDataF = typename DB::TransactionT::template FutureT(); + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture> __when_expr_0 = getWorkers(tr, processClassesF, processDataF); + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 3955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->onError(e)); + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(std::vector const& workers,int loopDepth) + { + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::map>> address_processId; + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& w : workers ) { + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + address_processId[w.address] = w.locality.processId(); + #line 4003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : conf.address_class ) { + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (it.second.classSource() == ProcessClass::CommandLineSource) + #line 4009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->clear(processClassKeyFor(address_processId[it.first].get())); + #line 4013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + else + { + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(processClassKeyFor(address_processId[it.first].get()), processClassValue(it.second)); + #line 4019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (conf.address_class.size()) + #line 4024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(processClassChangeKey, deterministicRandom()->randomUniqueID().toString()); + #line 4028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (conf.auto_logs != conf.old_logs) + #line 4032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(configKeysPrefix.toString() + "auto_logs", format("%d", conf.auto_logs)); + #line 4036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (conf.auto_commit_proxies != conf.old_commit_proxies) + #line 4040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(configKeysPrefix.toString() + "auto_commit_proxies", format("%d", conf.auto_commit_proxies)); + #line 4044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (conf.auto_grv_proxies != conf.old_grv_proxies) + #line 4048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(configKeysPrefix.toString() + "auto_grv_proxies", format("%d", conf.auto_grv_proxies)); + #line 4052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (conf.auto_resolvers != conf.old_resolvers) + #line 4056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(configKeysPrefix.toString() + "auto_resolvers", format("%d", conf.auto_resolvers)); + #line 4060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (conf.auto_replication != conf.old_replication) + #line 4064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::vector modes; + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + modes.push_back(conf.auto_replication); + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::map m; + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + auto r = buildConfiguration(modes, m); + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (r != ConfigurationResult::SUCCESS) + #line 4076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(r); this->~AutoConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 4080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(r); + this->~AutoConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& kv : m ) { + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(kv.first, kv.second); + #line 4090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->addReadConflictRange(singleKeyRange(moveKeysLockOwnerKey)); + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(moveKeysLockOwnerKey, versionKey); + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->commit()); + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 4101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(std::vector && workers,int loopDepth) + { + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::map>> address_processId; + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& w : workers ) { + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + address_processId[w.address] = w.locality.processId(); + #line 4119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& it : conf.address_class ) { + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (it.second.classSource() == ProcessClass::CommandLineSource) + #line 4125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->clear(processClassKeyFor(address_processId[it.first].get())); + #line 4129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + else + { + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(processClassKeyFor(address_processId[it.first].get()), processClassValue(it.second)); + #line 4135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (conf.address_class.size()) + #line 4140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(processClassChangeKey, deterministicRandom()->randomUniqueID().toString()); + #line 4144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (conf.auto_logs != conf.old_logs) + #line 4148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(configKeysPrefix.toString() + "auto_logs", format("%d", conf.auto_logs)); + #line 4152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (conf.auto_commit_proxies != conf.old_commit_proxies) + #line 4156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(configKeysPrefix.toString() + "auto_commit_proxies", format("%d", conf.auto_commit_proxies)); + #line 4160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (conf.auto_grv_proxies != conf.old_grv_proxies) + #line 4164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(configKeysPrefix.toString() + "auto_grv_proxies", format("%d", conf.auto_grv_proxies)); + #line 4168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (conf.auto_resolvers != conf.old_resolvers) + #line 4172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(configKeysPrefix.toString() + "auto_resolvers", format("%d", conf.auto_resolvers)); + #line 4176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (conf.auto_replication != conf.old_replication) + #line 4180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::vector modes; + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + modes.push_back(conf.auto_replication); + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + std::map m; + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + auto r = buildConfiguration(modes, m); + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (r != ConfigurationResult::SUCCESS) + #line 4192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + { + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(r); this->~AutoConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 4196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(r); + this->~AutoConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + for( auto& kv : m ) { + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(kv.first, kv.second); + #line 4206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + } + } + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->addReadConflictRange(singleKeyRange(moveKeysLockOwnerKey)); + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + tr->set(moveKeysLockOwnerKey, versionKey); + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->commit()); + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 4217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(std::vector const& workers,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(workers, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(std::vector && workers,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(workers), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AutoConfigActor, 0, std::vector >::remove(); + + } + void a_callback_fire(ActorCallback< AutoConfigActor, 0, std::vector >*,std::vector const& value) + { + fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< AutoConfigActor, 0, std::vector >*,std::vector && value) + { + fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< AutoConfigActor, 0, std::vector >*,Error err) + { + fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::SUCCESS); this->~AutoConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 4294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::SUCCESS); + this->~AutoConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(ConfigurationResult::SUCCESS); this->~AutoConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 4306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + new (&static_cast(this)->SAV< ConfigurationResult >::value()) ConfigurationResult(ConfigurationResult::SUCCESS); + this->~AutoConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AutoConfigActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AutoConfigActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< AutoConfigActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< AutoConfigActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 1); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AutoConfigActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AutoConfigActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< AutoConfigActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< AutoConfigActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), 2); + + } + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Reference db; + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + ConfigureAutoResult conf; + #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Reference tr; + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + Key versionKey; + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + typename DB::TransactionT::template FutureT processClassesF; + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + typename DB::TransactionT::template FutureT processDataF; + #line 4464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +}; +// This generated class is to be used only via autoConfig() + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +template + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +class AutoConfigActor final : public Actor, public ActorCallback< AutoConfigActor, 0, std::vector >, public ActorCallback< AutoConfigActor, 1, Void >, public ActorCallback< AutoConfigActor, 2, Void >, public FastAllocated>, public AutoConfigActorState> { + #line 4471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< AutoConfigActor, 0, std::vector >; +friend struct ActorCallback< AutoConfigActor, 1, Void >; +friend struct ActorCallback< AutoConfigActor, 2, Void >; + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + AutoConfigActor(Reference const& db,ConfigureAutoResult const& conf) + #line 4484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" + : Actor(), + AutoConfigActorState>(db, conf) + { + fdb_probe_actor_enter("autoConfig", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("autoConfig"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("autoConfig", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< AutoConfigActor, 0, std::vector >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< AutoConfigActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< AutoConfigActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +template + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" +[[nodiscard]] Future autoConfig( Reference const& db, ConfigureAutoResult const& conf ) { + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + return Future(new AutoConfigActor(db, conf)); + #line 4515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.g.h" +} + +#line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h" + +// Accepts tokens separated by spaces in a single string +template +Future changeConfig(Reference db, std::string const& modes, bool force) { + TraceEvent("ChangeConfig").detail("Mode", modes); + std::map m; + auto r = buildConfiguration(modes, m); + if (r != ConfigurationResult::SUCCESS) + return r; + return changeConfig(db, m, force); +} + +// Accepts a vector of configuration tokens +template +Future changeConfig(Reference db, + std::vector const& modes, + Optional const& conf, + bool force) { + if (modes.size() && modes[0] == "auto"_sr && conf.present()) { + return autoConfig(db, conf.get()); + } + + std::map m; + auto r = buildConfiguration(modes, m); + if (r != ConfigurationResult::SUCCESS) + return r; + return changeConfig(db, m, force); +} + +// return the corresponding error message for the CoordinatorsResult +// used by special keys and fdbcli +std::string generateErrorMessage(const CoordinatorsResult& res); + +} // namespace ManagementAPI + +#include "flow/unactorcompiler.h" +#endif diff --git a/src/fdbclient/GenericManagementAPI.actor.h b/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h similarity index 72% rename from src/fdbclient/GenericManagementAPI.actor.h rename to src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h index 87e11b7..27cd83d 100644 --- a/src/fdbclient/GenericManagementAPI.actor.h +++ b/src/fdbclient/include/fdbclient/GenericManagementAPI.actor.h @@ -39,8 +39,10 @@ the contents of the system key space. #include "fdbclient/Status.h" #include "fdbclient/Subspace.h" #include "fdbclient/DatabaseConfiguration.h" +#include "fdbclient/MetaclusterRegistration.h" #include "fdbclient/Status.h" #include "fdbclient/SystemData.h" +#include "fdbclient/StorageWiggleMetrics.actor.h" #include "flow/actorcompiler.h" // has to be last include // ConfigurationResult enumerates normal outcomes of changeConfig() and various error @@ -66,7 +68,11 @@ enum class ConfigurationResult { SUCCESS_WARN_PPW_GRADUAL, SUCCESS, SUCCESS_WARN_ROCKSDB_EXPERIMENTAL, + SUCCESS_WARN_SHARDED_ROCKSDB_EXPERIMENTAL, DATABASE_CREATED_WARN_ROCKSDB_EXPERIMENTAL, + DATABASE_CREATED_WARN_SHARDED_ROCKSDB_EXPERIMENTAL, + DATABASE_IS_REGISTERED, + ENCRYPTION_AT_REST_MODE_ALREADY_SET }; enum class CoordinatorsResult { @@ -127,20 +133,10 @@ bool isCompleteConfiguration(std::map const& options); ConfigureAutoResult parseConfig(StatusObject const& status); -template -struct transaction_future_type { - using type = typename Transaction::template FutureT; -}; - -template -struct transaction_future_type { - using type = typename transaction_future_type::type; -}; - -template -struct transaction_future_type, T> { - using type = typename transaction_future_type::type; -}; +bool isEncryptionAtRestModeConfigValid(Optional oldConfiguration, + std::map newConfig, + bool creating); +bool isTenantModeModeConfigValid(DatabaseConfiguration oldConfiguration, DatabaseConfiguration newConfiguration); // Management API written in template code to support both IClientAPI and NativeAPI namespace ManagementAPI { @@ -259,7 +255,7 @@ Future> getWorkers(Reference tr, // Accepts a full configuration in key/value format (from buildConfiguration) ACTOR template Future changeConfig(Reference db, std::map m, bool force) { - state StringRef initIdKey = LiteralStringRef("\xff/init_id"); + state StringRef initIdKey = "\xff/init_id"_sr; state Reference tr = db->createTransaction(); if (!m.size()) { @@ -285,13 +281,24 @@ Future changeConfig(Reference db, std::map(), m, creating)) { + return ConfigurationResult::INVALID_CONFIGURATION; + } + } else if (m.count(encryptionAtRestModeConfKey.toString()) != 0) { + // Encryption data at-rest mode can be set only at the time of database creation + return ConfigurationResult::ENCRYPTION_AT_REST_MODE_ALREADY_SET; } state Future tooLong = delay(60); state Key versionKey = BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned()); state bool oldReplicationUsesDcId = false; + // the caller need to reset the perpetual wiggle stats if pw=0 in case the reset txn on DD side is cancelled + // due to DD can die at the same time + state bool resetPPWStats = false; state bool warnPPWGradual = false; state bool warnRocksDBIsExperimental = false; + state bool warnShardedRocksDBIsExperimental = false; + loop { try { tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); @@ -320,7 +327,8 @@ Future changeConfig(Reference db, std::map changeConfig(Reference db, std::map metaclusterRegistration = + wait(metacluster::metadata::metaclusterRegistration().get(tr)); + if (metaclusterRegistration.present()) { + return ConfigurationResult::DATABASE_IS_REGISTERED; + } } } } @@ -499,13 +518,26 @@ Future changeConfig(Reference db, std::mapatomicOp(databaseLockedKey, BinaryWriter::toValue(locked.get(), Unversioned()) - .withPrefix(LiteralStringRef("0123456789")) - .withSuffix(LiteralStringRef("\x00\x00\x00\x00")), + .withPrefix("0123456789"_sr) + .withSuffix("\x00\x00\x00\x00"_sr), MutationRef::SetVersionstampedValue); } for (auto i = m.begin(); i != m.end(); ++i) { tr->set(StringRef(i->first), StringRef(i->second)); + if (i->first == perpetualStorageWiggleKey) { + if (i->second == "0") { + resetPPWStats = true; + } else if (i->first == "1") { + resetPPWStats = false; // the latter setting will override the former setting + } + } + } + + if (!creating && resetPPWStats) { + state StorageWiggleData wiggleData; + wait(wiggleData.resetStorageWiggleMetrics(tr, PrimaryRegion(true))); + wait(wiggleData.resetStorageWiggleMetrics(tr, PrimaryRegion(false))); } tr->addReadConflictRange(singleKeyRange(moveKeysLockOwnerKey)); @@ -533,6 +565,9 @@ Future changeConfig(Reference db, std::map changeConfig(Reference db, std::map changeConfig(Reference db, std::vector const& modes, Optional const& conf, bool force) { - if (modes.size() && modes[0] == LiteralStringRef("auto") && conf.present()) { + if (modes.size() && modes[0] == "auto"_sr && conf.present()) { return autoConfig(db, conf.get()); } @@ -654,257 +691,6 @@ Future changeConfig(Reference db, // used by special keys and fdbcli std::string generateErrorMessage(const CoordinatorsResult& res); -ACTOR template -Future> tryGetTenantTransaction(Transaction tr, TenantName name) { - state Key tenantMapKey = name.withPrefix(tenantMapPrefix); - - tr->setOption(FDBTransactionOptions::RAW_ACCESS); - tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); - - state typename transaction_future_type>::type tenantFuture = tr->get(tenantMapKey); - Optional val = wait(safeThreadFutureToFuture(tenantFuture)); - return val.map([](Optional v) { return decodeTenantEntry(v.get()); }); -} - -ACTOR template -Future> tryGetTenant(Reference db, TenantName name) { - state Reference tr = db->createTransaction(); - - loop { - try { - tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - Optional entry = wait(tryGetTenantTransaction(tr, name)); - return entry; - } catch (Error& e) { - wait(safeThreadFutureToFuture(tr->onError(e))); - } - } -} - -ACTOR template -Future getTenantTransaction(Transaction tr, TenantName name) { - Optional entry = wait(tryGetTenantTransaction(tr, name)); - if (!entry.present()) { - throw tenant_not_found(); - } - - return entry.get(); -} - -ACTOR template -Future getTenant(Reference db, TenantName name) { - Optional entry = wait(tryGetTenant(db, name)); - if (!entry.present()) { - throw tenant_not_found(); - } - - return entry.get(); -} - -// Creates a tenant with the given name. If the tenant already exists, an empty optional will be returned. -ACTOR template -Future> createTenantTransaction(Transaction tr, TenantNameRef name) { - state Key tenantMapKey = name.withPrefix(tenantMapPrefix); - - if (name.startsWith("\xff"_sr)) { - throw invalid_tenant_name(); - } - - tr->setOption(FDBTransactionOptions::RAW_ACCESS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - - state Future> tenantEntryFuture = tryGetTenantTransaction(tr, name); - state typename transaction_future_type>::type tenantDataPrefixFuture = - tr->get(tenantDataPrefixKey); - state typename transaction_future_type>::type lastIdFuture = tr->get(tenantLastIdKey); - state typename transaction_future_type>::type tenantModeFuture = - tr->get(configKeysPrefix.withSuffix("tenant_mode"_sr)); - - Optional tenantMode = wait(safeThreadFutureToFuture(tenantModeFuture)); - - if (!tenantMode.present() || tenantMode.get() == StringRef(format("%d", TenantMode::DISABLED))) { - throw tenants_disabled(); - } - - Optional tenantEntry = wait(tenantEntryFuture); - if (tenantEntry.present()) { - return Optional(); - } - - state Optional lastIdVal = wait(safeThreadFutureToFuture(lastIdFuture)); - Optional tenantDataPrefix = wait(safeThreadFutureToFuture(tenantDataPrefixFuture)); - - if (tenantDataPrefix.present() && - tenantDataPrefix.get().size() + TenantMapEntry::ROOT_PREFIX_SIZE > CLIENT_KNOBS->TENANT_PREFIX_SIZE_LIMIT) { - TraceEvent(SevWarnAlways, "TenantPrefixTooLarge") - .detail("TenantSubspace", tenantDataPrefix.get()) - .detail("TenantSubspaceLength", tenantDataPrefix.get().size()) - .detail("RootPrefixLength", TenantMapEntry::ROOT_PREFIX_SIZE) - .detail("MaxTenantPrefixSize", CLIENT_KNOBS->TENANT_PREFIX_SIZE_LIMIT); - - throw client_invalid_operation(); - } - - state TenantMapEntry newTenant(lastIdVal.present() ? TenantMapEntry::prefixToId(lastIdVal.get()) + 1 : 0, - tenantDataPrefix.present() ? (KeyRef)tenantDataPrefix.get() : ""_sr); - - state typename transaction_future_type::type prefixRangeFuture = - tr->getRange(prefixRange(newTenant.prefix), 1); - RangeResult contents = wait(safeThreadFutureToFuture(prefixRangeFuture)); - if (!contents.empty()) { - throw tenant_prefix_allocator_conflict(); - } - - tr->set(tenantLastIdKey, TenantMapEntry::idToPrefix(newTenant.id)); - tr->set(tenantMapKey, encodeTenantEntry(newTenant)); - - return newTenant; -} - -ACTOR template -Future createTenant(Reference db, TenantName name) { - state Reference tr = db->createTransaction(); - - state bool firstTry = true; - loop { - try { - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - - if (firstTry) { - Optional entry = wait(tryGetTenantTransaction(tr, name)); - if (entry.present()) { - throw tenant_already_exists(); - } - - firstTry = false; - } - - state Optional newTenant = wait(createTenantTransaction(tr, name)); - - if (BUGGIFY) { - throw commit_unknown_result(); - } - - wait(safeThreadFutureToFuture(tr->commit())); - - if (BUGGIFY) { - throw commit_unknown_result(); - } - - TraceEvent("CreatedTenant") - .detail("Tenant", name) - .detail("TenantId", newTenant.present() ? newTenant.get().id : -1) - .detail("Prefix", newTenant.present() ? (StringRef)newTenant.get().prefix : "Unknown"_sr) - .detail("Version", tr->getCommittedVersion()); - - return Void(); - } catch (Error& e) { - wait(safeThreadFutureToFuture(tr->onError(e))); - } - } -} - -ACTOR template -Future deleteTenantTransaction(Transaction tr, TenantNameRef name) { - state Key tenantMapKey = name.withPrefix(tenantMapPrefix); - - tr->setOption(FDBTransactionOptions::RAW_ACCESS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - - state Optional tenantEntry = wait(tryGetTenantTransaction(tr, name)); - if (!tenantEntry.present()) { - return Void(); - } - - state typename transaction_future_type::type prefixRangeFuture = - tr->getRange(prefixRange(tenantEntry.get().prefix), 1); - RangeResult contents = wait(safeThreadFutureToFuture(prefixRangeFuture)); - if (!contents.empty()) { - throw tenant_not_empty(); - } - - tr->clear(tenantMapKey); - - return Void(); -} - -ACTOR template -Future deleteTenant(Reference db, TenantName name) { - state Reference tr = db->createTransaction(); - - state bool firstTry = true; - loop { - try { - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - - if (firstTry) { - Optional entry = wait(tryGetTenantTransaction(tr, name)); - if (!entry.present()) { - throw tenant_not_found(); - } - - firstTry = false; - } - - wait(deleteTenantTransaction(tr, name)); - - if (BUGGIFY) { - throw commit_unknown_result(); - } - - wait(safeThreadFutureToFuture(tr->commit())); - - if (BUGGIFY) { - throw commit_unknown_result(); - } - - TraceEvent("DeletedTenant").detail("Tenant", name).detail("Version", tr->getCommittedVersion()); - return Void(); - } catch (Error& e) { - wait(safeThreadFutureToFuture(tr->onError(e))); - } - } -} - -ACTOR template -Future> listTenantsTransaction(Transaction tr, - TenantNameRef begin, - TenantNameRef end, - int limit) { - state KeyRange range = KeyRangeRef(begin, end).withPrefix(tenantMapPrefix); - - tr->setOption(FDBTransactionOptions::RAW_ACCESS); - tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); - - state typename transaction_future_type::type listFuture = - tr->getRange(firstGreaterOrEqual(range.begin), firstGreaterOrEqual(range.end), limit); - RangeResult results = wait(safeThreadFutureToFuture(listFuture)); - - std::map tenants; - for (auto kv : results) { - tenants[kv.key.removePrefix(tenantMapPrefix)] = decodeTenantEntry(kv.value); - } - - return tenants; -} - -ACTOR template -Future> listTenants(Reference db, - TenantName begin, - TenantName end, - int limit) { - state Reference tr = db->createTransaction(); - - loop { - try { - tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - std::map tenants = wait(listTenantsTransaction(tr, begin, end, limit)); - return tenants; - } catch (Error& e) { - wait(safeThreadFutureToFuture(tr->onError(e))); - } - } -} } // namespace ManagementAPI #include "flow/unactorcompiler.h" diff --git a/src/fdbclient/include/fdbclient/GenericTransactionHelper.h b/src/fdbclient/include/fdbclient/GenericTransactionHelper.h new file mode 100644 index 0000000..ddff69e --- /dev/null +++ b/src/fdbclient/include/fdbclient/GenericTransactionHelper.h @@ -0,0 +1,42 @@ +/* + * GenericTransactionHelper.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBCLIENT_GENERIC_TRANSACTION_HELPER_H +#define FDBCLIENT_GENERIC_TRANSACTION_HELPER_H +#pragma once + +#include "flow/FastRef.h" + +template +struct transaction_future_type { + using type = typename Transaction::template FutureT; +}; + +template +struct transaction_future_type { + using type = typename transaction_future_type::type; +}; + +template +struct transaction_future_type, T> { + using type = typename transaction_future_type::type; +}; + +#endif \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/GetEncryptCipherKeys.h b/src/fdbclient/include/fdbclient/GetEncryptCipherKeys.h new file mode 100644 index 0000000..7be32c7 --- /dev/null +++ b/src/fdbclient/include/fdbclient/GetEncryptCipherKeys.h @@ -0,0 +1,88 @@ +/* + * GetEncryptCipherKeys.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBCLIENT_GETCIPHERKEYS_H +#define FDBCLIENT_GETCIPHERKEYS_H +#pragma once + +#include "flow/EncryptUtils.h" +#include "flow/genericactors.actor.h" +#include "fdbclient/BlobCipher.h" +#include "fdbclient/EncryptKeyProxyInterface.h" +#include "fdbclient/Knobs.h" +#include "fdbrpc/Stats.h" +#include "fdbrpc/TenantInfo.h" +#include "flow/Knobs.h" +#include "flow/IRandom.h" + +#include +#include +#include + +using BaseCipherIndex = std::pair; + +struct TextAndHeaderCipherKeys { + Reference cipherTextKey; + Reference cipherHeaderKey; +}; + +template +class GetEncryptCipherKeys { +public: + // Get latest cipher keys for given encryption domains. It tries to get the cipher keys from local cache. + // In case of cache miss, it fetches the cipher keys from EncryptKeyProxy and put the result in the local cache + // before return. + static Future>> getLatestEncryptCipherKeys( + Reference const> db, + std::unordered_set domainIds, + BlobCipherMetrics::UsageType usageType); + + // Get latest cipher key for given a encryption domain. It tries to get the cipher key from the local cache. + // In case of cache miss, it fetches the cipher key from EncryptKeyProxy and put the result in the local cache + // before return. + static Future> getLatestEncryptCipherKey(Reference const> db, + EncryptCipherDomainId domainId, + BlobCipherMetrics::UsageType usageType); + + // Get cipher keys specified by the list of cipher details. It tries to get the cipher keys from local cache. + // In case of cache miss, it fetches the cipher keys from EncryptKeyProxy and put the result in the local cache + // before return. + static Future>> getEncryptCipherKeys( + Reference const> db, + std::unordered_set cipherDetails, + BlobCipherMetrics::UsageType usageType); + + static Future getLatestEncryptCipherKeysForDomain(Reference const> db, + EncryptCipherDomainId domainId, + BlobCipherMetrics::UsageType usageType); + + static Future getLatestSystemEncryptCipherKeys(const Reference const>& db, + BlobCipherMetrics::UsageType usageType); + + static Future getEncryptCipherKeys(Reference const> db, + BlobCipherEncryptHeader header, + BlobCipherMetrics::UsageType usageType); + + static Future getEncryptCipherKeys(Reference const> db, + BlobCipherEncryptHeaderRef header, + BlobCipherMetrics::UsageType usageType); +}; + +#endif \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h b/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h new file mode 100644 index 0000000..b989ad3 --- /dev/null +++ b/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h @@ -0,0 +1,2807 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +/* + * GetEncryptCipherKeys_impl.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 +#include "flow/EncryptUtils.h" +#include "flow/genericactors.actor.h" +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_GETCIPHERKEYS_IMPL_ACTOR_G_H) +#define FDBCLIENT_GETCIPHERKEYS_IMPL_ACTOR_G_H +#include "fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +#elif !defined(FDBCLIENT_GETCIPHERKEYS_IMPL_ACTOR_H) +#define FDBCLIENT_GETCIPHERKEYS_IMPL_ACTOR_H + +#include "fdbclient/CommitProxyInterface.h" +#include "fdbclient/GlobalConfig.actor.h" +#include "fdbclient/SpecialKeySpace.actor.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/Tuple.h" +#include "flow/flow.h" +#include "flow/genericactors.actor.h" + +#include "flow/actorcompiler.h" // This must be the last #include. + +template +Optional getEncryptKeyProxyInterface(const Reference const>& db) { + if constexpr (std::is_same_v) { + return db->get().encryptKeyProxy; + } else { + return db->get().client.encryptKeyProxy; + } +} + +template +Optional getEncryptKeyProxyId(const Reference const>& db) { + return getEncryptKeyProxyInterface(db).map(&EncryptKeyProxyInterface::id); +} + + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +namespace { +// This generated class is to be used only via _onEncryptKeyProxyChange() + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _onEncryptKeyProxyChangeActorState { + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _onEncryptKeyProxyChangeActorState(Reference const> const& db) + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + : db(db), + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + previousProxyId(getEncryptKeyProxyId(db)), + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + currentProxyId() + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + fdb_probe_actor_create("_onEncryptKeyProxyChange", reinterpret_cast(this)); + + } + ~_onEncryptKeyProxyChangeActorState() + { + fdb_probe_actor_destroy("_onEncryptKeyProxyChange", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ; + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~_onEncryptKeyProxyChangeActorState(); + static_cast<_onEncryptKeyProxyChangeActor*>(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent("GetEncryptCipherKeysEncryptKeyProxyChanged") .detail("PreviousProxyId", previousProxyId.orDefault(UID())) .detail("CurrentProxyId", currentProxyId.orDefault(UID())); + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_onEncryptKeyProxyChangeActor*>(this)->SAV::futures) { (void)(Void()); this->~_onEncryptKeyProxyChangeActorState(); static_cast<_onEncryptKeyProxyChangeActor*>(this)->destroy(); return 0; } + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_onEncryptKeyProxyChangeActor*>(this)->SAV< Void >::value()) Void(Void()); + this->~_onEncryptKeyProxyChangeActorState(); + static_cast<_onEncryptKeyProxyChangeActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + StrictFuture __when_expr_0 = db->onChange(); + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (static_cast<_onEncryptKeyProxyChangeActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast<_onEncryptKeyProxyChangeActor*>(this)->actor_wait_state = 1; + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_onEncryptKeyProxyChangeActor*>(this))); + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(Void const& _,int loopDepth) + { + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + currentProxyId = getEncryptKeyProxyId(db); + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (currentProxyId != previousProxyId) + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1(Void && _,int loopDepth) + { + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + currentProxyId = getEncryptKeyProxyId(db); + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (currentProxyId != previousProxyId) + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast<_onEncryptKeyProxyChangeActor*>(this)->actor_wait_state > 0) static_cast<_onEncryptKeyProxyChangeActor*>(this)->actor_wait_state = 0; + static_cast<_onEncryptKeyProxyChangeActor*>(this)->ActorCallback< _onEncryptKeyProxyChangeActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _onEncryptKeyProxyChangeActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("_onEncryptKeyProxyChange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_onEncryptKeyProxyChange", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _onEncryptKeyProxyChangeActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("_onEncryptKeyProxyChange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_onEncryptKeyProxyChange", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< _onEncryptKeyProxyChangeActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("_onEncryptKeyProxyChange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_onEncryptKeyProxyChange", reinterpret_cast(this), 0); + + } + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference const> db; + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Optional previousProxyId; + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Optional currentProxyId; + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +}; +// This generated class is to be used only via _onEncryptKeyProxyChange() + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _onEncryptKeyProxyChangeActor final : public Actor, public ActorCallback< _onEncryptKeyProxyChangeActor, 0, Void >, public FastAllocated<_onEncryptKeyProxyChangeActor>, public _onEncryptKeyProxyChangeActorState> { + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + using FastAllocated<_onEncryptKeyProxyChangeActor>::operator new; + using FastAllocated<_onEncryptKeyProxyChangeActor>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< _onEncryptKeyProxyChangeActor, 0, Void >; + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _onEncryptKeyProxyChangeActor(Reference const> const& db) + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + : Actor(), + _onEncryptKeyProxyChangeActorState>(db) + { + fdb_probe_actor_enter("_onEncryptKeyProxyChange", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("_onEncryptKeyProxyChange"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("_onEncryptKeyProxyChange", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< _onEncryptKeyProxyChangeActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +[[nodiscard]] Future _onEncryptKeyProxyChange( Reference const> const& db ) { + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return Future(new _onEncryptKeyProxyChangeActor(db)); + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +} + +#line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +namespace { +// This generated class is to be used only via _getUncachedLatestEncryptCipherKeys() + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getUncachedLatestEncryptCipherKeysActorState { + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getUncachedLatestEncryptCipherKeysActorState(Reference const> const& db,EKPGetLatestBaseCipherKeysRequest const& request,BlobCipherMetrics::UsageType const& usageType) + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + : db(db), + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + request(request), + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + usageType(usageType) + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + fdb_probe_actor_create("_getUncachedLatestEncryptCipherKeys", reinterpret_cast(this)); + + } + ~_getUncachedLatestEncryptCipherKeysActorState() + { + fdb_probe_actor_destroy("_getUncachedLatestEncryptCipherKeys", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Optional proxy = getEncryptKeyProxyInterface(db); + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!proxy.present()) + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent("GetLatestEncryptCipherKeysEncryptKeyProxyNotPresent").detail("UsageType", toString(usageType)); + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + this->~_getUncachedLatestEncryptCipherKeysActorState(); + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->sendAndDelPromiseRef(Never()); + return 0; + } + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + request.reply.reset(); + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + try { + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + StrictFuture __when_expr_0 = proxy.get().getLatestBaseCipherKeys.getReply(request); + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->actor_wait_state = 1; + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this))); + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~_getUncachedLatestEncryptCipherKeysActorState(); + static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent("GetLatestEncryptCipherKeysCaughtError").error(e); + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (e.code() == error_code_broken_promise) + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + this->~_getUncachedLatestEncryptCipherKeysActorState(); + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->sendAndDelPromiseRef(Never()); + return 0; + } + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch1(e, loopDepth); + #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3(EKPGetLatestBaseCipherKeysReply const& reply,int loopDepth) + { + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (reply.error.present()) + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent(SevWarn, "GetLatestEncryptCipherKeysRequestFailed").error(reply.error.get()); + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch2(reply.error.get(), loopDepth); + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->SAV::futures) { (void)(reply); this->~_getUncachedLatestEncryptCipherKeysActorState(); static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->destroy(); return 0; } + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->SAV< EKPGetLatestBaseCipherKeysReply >::value()) EKPGetLatestBaseCipherKeysReply(reply); + this->~_getUncachedLatestEncryptCipherKeysActorState(); + static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3(EKPGetLatestBaseCipherKeysReply && reply,int loopDepth) + { + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (reply.error.present()) + #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent(SevWarn, "GetLatestEncryptCipherKeysRequestFailed").error(reply.error.get()); + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch2(reply.error.get(), loopDepth); + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->SAV::futures) { (void)(reply); this->~_getUncachedLatestEncryptCipherKeysActorState(); static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->destroy(); return 0; } + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->SAV< EKPGetLatestBaseCipherKeysReply >::value()) EKPGetLatestBaseCipherKeysReply(reply); + this->~_getUncachedLatestEncryptCipherKeysActorState(); + static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(EKPGetLatestBaseCipherKeysReply const& reply,int loopDepth) + { + loopDepth = a_body1cont3(reply, loopDepth); + + return loopDepth; + } + int a_body1when1(EKPGetLatestBaseCipherKeysReply && reply,int loopDepth) + { + loopDepth = a_body1cont3(std::move(reply), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->actor_wait_state > 0) static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->actor_wait_state = 0; + static_cast<_getUncachedLatestEncryptCipherKeysActor*>(this)->ActorCallback< _getUncachedLatestEncryptCipherKeysActor, 0, EKPGetLatestBaseCipherKeysReply >::remove(); + + } + void a_callback_fire(ActorCallback< _getUncachedLatestEncryptCipherKeysActor, 0, EKPGetLatestBaseCipherKeysReply >*,EKPGetLatestBaseCipherKeysReply const& value) + { + fdb_probe_actor_enter("_getUncachedLatestEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("_getUncachedLatestEncryptCipherKeys", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _getUncachedLatestEncryptCipherKeysActor, 0, EKPGetLatestBaseCipherKeysReply >*,EKPGetLatestBaseCipherKeysReply && value) + { + fdb_probe_actor_enter("_getUncachedLatestEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("_getUncachedLatestEncryptCipherKeys", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< _getUncachedLatestEncryptCipherKeysActor, 0, EKPGetLatestBaseCipherKeysReply >*,Error err) + { + fdb_probe_actor_enter("_getUncachedLatestEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("_getUncachedLatestEncryptCipherKeys", reinterpret_cast(this), 0); + + } + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference const> db; + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + EKPGetLatestBaseCipherKeysRequest request; + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BlobCipherMetrics::UsageType usageType; + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +}; +// This generated class is to be used only via _getUncachedLatestEncryptCipherKeys() + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getUncachedLatestEncryptCipherKeysActor final : public Actor, public ActorCallback< _getUncachedLatestEncryptCipherKeysActor, 0, EKPGetLatestBaseCipherKeysReply >, public FastAllocated<_getUncachedLatestEncryptCipherKeysActor>, public _getUncachedLatestEncryptCipherKeysActorState> { + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + using FastAllocated<_getUncachedLatestEncryptCipherKeysActor>::operator new; + using FastAllocated<_getUncachedLatestEncryptCipherKeysActor>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< _getUncachedLatestEncryptCipherKeysActor, 0, EKPGetLatestBaseCipherKeysReply >; + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getUncachedLatestEncryptCipherKeysActor(Reference const> const& db,EKPGetLatestBaseCipherKeysRequest const& request,BlobCipherMetrics::UsageType const& usageType) + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + : Actor(), + _getUncachedLatestEncryptCipherKeysActorState>(db, request, usageType) + { + fdb_probe_actor_enter("_getUncachedLatestEncryptCipherKeys", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("_getUncachedLatestEncryptCipherKeys"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("_getUncachedLatestEncryptCipherKeys", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< _getUncachedLatestEncryptCipherKeysActor, 0, EKPGetLatestBaseCipherKeysReply >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +[[nodiscard]] Future _getUncachedLatestEncryptCipherKeys( Reference const> const& db, EKPGetLatestBaseCipherKeysRequest const& request, BlobCipherMetrics::UsageType const& usageType ) { + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return Future(new _getUncachedLatestEncryptCipherKeysActor(db, request, usageType)); + #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +} + +#line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +namespace { +// This generated class is to be used only via _getLatestEncryptCipherKeys() + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getLatestEncryptCipherKeysActorState { + #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getLatestEncryptCipherKeysActorState(Reference const> const& db,std::unordered_set const& domainIds,BlobCipherMetrics::UsageType const& usageType) + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + : db(db), + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + domainIds(domainIds), + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + usageType(usageType), + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + cipherKeyCache(BlobCipherKeyCache::getInstance()), + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + cipherKeys(), + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + request() + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + fdb_probe_actor_create("_getLatestEncryptCipherKeys", reinterpret_cast(this)); + + } + ~_getLatestEncryptCipherKeysActorState() + { + fdb_probe_actor_destroy("_getLatestEncryptCipherKeys", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!db.isValid()) + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent(SevError, "GetLatestEncryptCipherKeysServerDBInfoNotAvailable"); + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch1(encrypt_ops_error(), loopDepth); + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + for( auto& domainId : domainIds ) { + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference cachedCipherKey = cipherKeyCache->getLatestCipherKey(domainId); + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (cachedCipherKey.isValid()) + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + cipherKeys[domainId] = cachedCipherKey; + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + else + { + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + request.encryptDomainIds.emplace_back(domainId); + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + } + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (request.encryptDomainIds.empty()) + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getLatestEncryptCipherKeysActor*>(this)->SAV>>::futures) { (void)(cipherKeys); this->~_getLatestEncryptCipherKeysActorState(); static_cast<_getLatestEncryptCipherKeysActor*>(this)->destroy(); return 0; } + #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getLatestEncryptCipherKeysActor*>(this)->SAV< std::unordered_map> >::value()) std::unordered_map>(std::move(cipherKeys)); // state_var_RVO + this->~_getLatestEncryptCipherKeysActorState(); + static_cast<_getLatestEncryptCipherKeysActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + startTime = now(); + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ; + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~_getLatestEncryptCipherKeysActorState(); + static_cast<_getLatestEncryptCipherKeysActor*>(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + double elapsed = now() - startTime; + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BlobCipherMetrics::getInstance()->getLatestCipherKeysLatency.addMeasurement(elapsed); + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BlobCipherMetrics::counters(usageType).getLatestCipherKeysLatency.addMeasurement(elapsed); + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getLatestEncryptCipherKeysActor*>(this)->SAV>>::futures) { (void)(cipherKeys); this->~_getLatestEncryptCipherKeysActorState(); static_cast<_getLatestEncryptCipherKeysActor*>(this)->destroy(); return 0; } + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getLatestEncryptCipherKeysActor*>(this)->SAV< std::unordered_map> >::value()) std::unordered_map>(std::move(cipherKeys)); // state_var_RVO + this->~_getLatestEncryptCipherKeysActorState(); + static_cast<_getLatestEncryptCipherKeysActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + StrictFuture __when_expr_0 = _getUncachedLatestEncryptCipherKeys(db, request, usageType); + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (static_cast<_getLatestEncryptCipherKeysActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + StrictFuture __when_expr_1 = _onEncryptKeyProxyChange(db); + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; + static_cast<_getLatestEncryptCipherKeysActor*>(this)->actor_wait_state = 1; + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_getLatestEncryptCipherKeysActor*>(this))); + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_getLatestEncryptCipherKeysActor*>(this))); + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(EKPGetLatestBaseCipherKeysReply const& reply,int loopDepth) + { + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + for( const EKPBaseCipherDetails& details : reply.baseCipherDetails ) { + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + EncryptCipherDomainId domainId = details.encryptDomainId; + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (domainIds.count(domainId) > 0 && cipherKeys.count(domainId) == 0) + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference cipherKey = cipherKeyCache->insertCipherKey(domainId, details.baseCipherId, details.baseCipherKey.begin(), details.baseCipherKey.size(), details.baseCipherKCV, details.refreshAt, details.expireAt); + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(cipherKey.isValid()); + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + cipherKeys[domainId] = cipherKey; + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + } + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + for( auto domainId : request.encryptDomainIds ) { + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (cipherKeys.count(domainId) == 0) + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent(SevWarn, "GetLatestEncryptCipherKeysKeyMissing").detail("DomainId", domainId); + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch1(encrypt_key_not_found(), std::max(0, loopDepth - 1)); + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + } + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when1(EKPGetLatestBaseCipherKeysReply && reply,int loopDepth) + { + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + for( const EKPBaseCipherDetails& details : reply.baseCipherDetails ) { + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + EncryptCipherDomainId domainId = details.encryptDomainId; + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (domainIds.count(domainId) > 0 && cipherKeys.count(domainId) == 0) + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference cipherKey = cipherKeyCache->insertCipherKey(domainId, details.baseCipherId, details.baseCipherKey.begin(), details.baseCipherKey.size(), details.baseCipherKCV, details.refreshAt, details.expireAt); + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(cipherKey.isValid()); + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + cipherKeys[domainId] = cipherKey; + #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + } + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + for( auto domainId : request.encryptDomainIds ) { + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (cipherKeys.count(domainId) == 0) + #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent(SevWarn, "GetLatestEncryptCipherKeysKeyMissing").detail("DomainId", domainId); + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch1(encrypt_key_not_found(), std::max(0, loopDepth - 1)); + #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + } + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when2(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast<_getLatestEncryptCipherKeysActor*>(this)->actor_wait_state > 0) static_cast<_getLatestEncryptCipherKeysActor*>(this)->actor_wait_state = 0; + static_cast<_getLatestEncryptCipherKeysActor*>(this)->ActorCallback< _getLatestEncryptCipherKeysActor, 0, EKPGetLatestBaseCipherKeysReply >::remove(); + static_cast<_getLatestEncryptCipherKeysActor*>(this)->ActorCallback< _getLatestEncryptCipherKeysActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _getLatestEncryptCipherKeysActor, 0, EKPGetLatestBaseCipherKeysReply >*,EKPGetLatestBaseCipherKeysReply const& value) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getLatestEncryptCipherKeys", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _getLatestEncryptCipherKeysActor, 0, EKPGetLatestBaseCipherKeysReply >*,EKPGetLatestBaseCipherKeysReply && value) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getLatestEncryptCipherKeys", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< _getLatestEncryptCipherKeysActor, 0, EKPGetLatestBaseCipherKeysReply >*,Error err) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getLatestEncryptCipherKeys", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _getLatestEncryptCipherKeysActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKeys", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1loopBody1when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getLatestEncryptCipherKeys", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< _getLatestEncryptCipherKeysActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKeys", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1loopBody1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getLatestEncryptCipherKeys", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< _getLatestEncryptCipherKeysActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKeys", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getLatestEncryptCipherKeys", reinterpret_cast(this), 1); + + } + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference const> db; + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + std::unordered_set domainIds; + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BlobCipherMetrics::UsageType usageType; + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference cipherKeyCache; + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + std::unordered_map> cipherKeys; + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + EKPGetLatestBaseCipherKeysRequest request; + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + double startTime; + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +}; +// This generated class is to be used only via _getLatestEncryptCipherKeys() + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getLatestEncryptCipherKeysActor final : public Actor>>, public ActorCallback< _getLatestEncryptCipherKeysActor, 0, EKPGetLatestBaseCipherKeysReply >, public ActorCallback< _getLatestEncryptCipherKeysActor, 1, Void >, public FastAllocated<_getLatestEncryptCipherKeysActor>, public _getLatestEncryptCipherKeysActorState> { + #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + using FastAllocated<_getLatestEncryptCipherKeysActor>::operator new; + using FastAllocated<_getLatestEncryptCipherKeysActor>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< _getLatestEncryptCipherKeysActor, 0, EKPGetLatestBaseCipherKeysReply >; +friend struct ActorCallback< _getLatestEncryptCipherKeysActor, 1, Void >; + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getLatestEncryptCipherKeysActor(Reference const> const& db,std::unordered_set const& domainIds,BlobCipherMetrics::UsageType const& usageType) + #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + : Actor>>(), + _getLatestEncryptCipherKeysActorState>(db, domainIds, usageType) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKeys", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("_getLatestEncryptCipherKeys"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("_getLatestEncryptCipherKeys", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< _getLatestEncryptCipherKeysActor, 0, EKPGetLatestBaseCipherKeysReply >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +[[nodiscard]] Future>> _getLatestEncryptCipherKeys( Reference const> const& db, std::unordered_set const& domainIds, BlobCipherMetrics::UsageType const& usageType ) { + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return Future>>(new _getLatestEncryptCipherKeysActor(db, domainIds, usageType)); + #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +} + +#line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + + #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +namespace { +// This generated class is to be used only via _getLatestEncryptCipherKey() + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getLatestEncryptCipherKeyActorState { + #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getLatestEncryptCipherKeyActorState(Reference const> const& db,EncryptCipherDomainId const& domainId,BlobCipherMetrics::UsageType const& usageType) + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + : db(db), + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + domainId(domainId), + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + usageType(usageType) + #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + fdb_probe_actor_create("_getLatestEncryptCipherKey", reinterpret_cast(this)); + + } + ~_getLatestEncryptCipherKeyActorState() + { + fdb_probe_actor_destroy("_getLatestEncryptCipherKey", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + std::unordered_set domainIds{ domainId }; + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + StrictFuture>> __when_expr_0 = _getLatestEncryptCipherKeys(db, domainIds, usageType); + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (static_cast<_getLatestEncryptCipherKeyActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast<_getLatestEncryptCipherKeyActor*>(this)->actor_wait_state = 1; + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast<_getLatestEncryptCipherKeyActor*>(this))); + #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~_getLatestEncryptCipherKeyActorState(); + static_cast<_getLatestEncryptCipherKeyActor*>(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(std::unordered_map> const& cipherKey,int loopDepth) + { + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getLatestEncryptCipherKeyActor*>(this)->SAV>::futures) { (void)(cipherKey.at(domainId)); this->~_getLatestEncryptCipherKeyActorState(); static_cast<_getLatestEncryptCipherKeyActor*>(this)->destroy(); return 0; } + #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getLatestEncryptCipherKeyActor*>(this)->SAV< Reference >::value()) Reference(cipherKey.at(domainId)); + this->~_getLatestEncryptCipherKeyActorState(); + static_cast<_getLatestEncryptCipherKeyActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(std::unordered_map> && cipherKey,int loopDepth) + { + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getLatestEncryptCipherKeyActor*>(this)->SAV>::futures) { (void)(cipherKey.at(domainId)); this->~_getLatestEncryptCipherKeyActorState(); static_cast<_getLatestEncryptCipherKeyActor*>(this)->destroy(); return 0; } + #line 1077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getLatestEncryptCipherKeyActor*>(this)->SAV< Reference >::value()) Reference(cipherKey.at(domainId)); + this->~_getLatestEncryptCipherKeyActorState(); + static_cast<_getLatestEncryptCipherKeyActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(std::unordered_map> const& cipherKey,int loopDepth) + { + loopDepth = a_body1cont1(cipherKey, loopDepth); + + return loopDepth; + } + int a_body1when1(std::unordered_map> && cipherKey,int loopDepth) + { + loopDepth = a_body1cont1(std::move(cipherKey), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast<_getLatestEncryptCipherKeyActor*>(this)->actor_wait_state > 0) static_cast<_getLatestEncryptCipherKeyActor*>(this)->actor_wait_state = 0; + static_cast<_getLatestEncryptCipherKeyActor*>(this)->ActorCallback< _getLatestEncryptCipherKeyActor, 0, std::unordered_map> >::remove(); + + } + void a_callback_fire(ActorCallback< _getLatestEncryptCipherKeyActor, 0, std::unordered_map> >*,std::unordered_map> const& value) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKey", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getLatestEncryptCipherKey", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _getLatestEncryptCipherKeyActor, 0, std::unordered_map> >*,std::unordered_map> && value) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKey", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getLatestEncryptCipherKey", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< _getLatestEncryptCipherKeyActor, 0, std::unordered_map> >*,Error err) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKey", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getLatestEncryptCipherKey", reinterpret_cast(this), 0); + + } + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference const> db; + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + EncryptCipherDomainId domainId; + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BlobCipherMetrics::UsageType usageType; + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +}; +// This generated class is to be used only via _getLatestEncryptCipherKey() + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getLatestEncryptCipherKeyActor final : public Actor>, public ActorCallback< _getLatestEncryptCipherKeyActor, 0, std::unordered_map> >, public FastAllocated<_getLatestEncryptCipherKeyActor>, public _getLatestEncryptCipherKeyActorState> { + #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + using FastAllocated<_getLatestEncryptCipherKeyActor>::operator new; + using FastAllocated<_getLatestEncryptCipherKeyActor>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< _getLatestEncryptCipherKeyActor, 0, std::unordered_map> >; + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getLatestEncryptCipherKeyActor(Reference const> const& db,EncryptCipherDomainId const& domainId,BlobCipherMetrics::UsageType const& usageType) + #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + : Actor>(), + _getLatestEncryptCipherKeyActorState>(db, domainId, usageType) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKey", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("_getLatestEncryptCipherKey"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("_getLatestEncryptCipherKey", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< _getLatestEncryptCipherKeyActor, 0, std::unordered_map> >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +[[nodiscard]] Future> _getLatestEncryptCipherKey( Reference const> const& db, EncryptCipherDomainId const& domainId, BlobCipherMetrics::UsageType const& usageType ) { + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return Future>(new _getLatestEncryptCipherKeyActor(db, domainId, usageType)); + #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +} + +#line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +namespace { +// This generated class is to be used only via _getUncachedEncryptCipherKeys() + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getUncachedEncryptCipherKeysActorState { + #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getUncachedEncryptCipherKeysActorState(Reference const> const& db,EKPGetBaseCipherKeysByIdsRequest const& request,BlobCipherMetrics::UsageType const& usageType) + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + : db(db), + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + request(request), + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + usageType(usageType) + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + fdb_probe_actor_create("_getUncachedEncryptCipherKeys", reinterpret_cast(this)); + + } + ~_getUncachedEncryptCipherKeysActorState() + { + fdb_probe_actor_destroy("_getUncachedEncryptCipherKeys", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Optional proxy = getEncryptKeyProxyInterface(db); + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!proxy.present()) + #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent("GetEncryptCipherKeysEncryptKeyProxyNotPresent").detail("UsageType", toString(usageType)); + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + this->~_getUncachedEncryptCipherKeysActorState(); + #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + static_cast<_getUncachedEncryptCipherKeysActor*>(this)->sendAndDelPromiseRef(Never()); + return 0; + } + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + request.reply.reset(); + #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + try { + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + StrictFuture __when_expr_0 = proxy.get().getBaseCipherKeysByIds.getReply(request); + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (static_cast<_getUncachedEncryptCipherKeysActor*>(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast<_getUncachedEncryptCipherKeysActor*>(this)->actor_wait_state = 1; + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_getUncachedEncryptCipherKeysActor*>(this))); + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~_getUncachedEncryptCipherKeysActorState(); + static_cast<_getUncachedEncryptCipherKeysActor*>(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent("GetEncryptCipherKeysCaughtError").error(e); + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (e.code() == error_code_broken_promise) + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + this->~_getUncachedEncryptCipherKeysActorState(); + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + static_cast<_getUncachedEncryptCipherKeysActor*>(this)->sendAndDelPromiseRef(Never()); + return 0; + } + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch1(e, loopDepth); + #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3(EKPGetBaseCipherKeysByIdsReply const& reply,int loopDepth) + { + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (reply.error.present()) + #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent(SevWarn, "GetEncryptCipherKeysRequestFailed").error(reply.error.get()); + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch2(reply.error.get(), loopDepth); + #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (g_network && g_network->isSimulated() && usageType == BlobCipherMetrics::RESTORE) + #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + std::unordered_set tenantIdsToDrop = parseStringToUnorderedSet(CLIENT_KNOBS->SIMULATION_EKP_TENANT_IDS_TO_DROP, ','); + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!tenantIdsToDrop.count(TenantInfo::INVALID_TENANT)) + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + for( auto& baseCipherInfo : request.baseCipherInfos ) { + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (tenantIdsToDrop.count(baseCipherInfo.domainId)) + #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent("GetEncryptCipherKeysSimulatedError").detail("DomainId", baseCipherInfo.domainId); + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (deterministicRandom()->coinflip()) + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch2(encrypt_keys_fetch_failed(), loopDepth); + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + else + { + #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch2(encrypt_key_not_found(), loopDepth); + #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + } + } + } + } + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getUncachedEncryptCipherKeysActor*>(this)->SAV::futures) { (void)(reply); this->~_getUncachedEncryptCipherKeysActorState(); static_cast<_getUncachedEncryptCipherKeysActor*>(this)->destroy(); return 0; } + #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getUncachedEncryptCipherKeysActor*>(this)->SAV< EKPGetBaseCipherKeysByIdsReply >::value()) EKPGetBaseCipherKeysByIdsReply(reply); + this->~_getUncachedEncryptCipherKeysActorState(); + static_cast<_getUncachedEncryptCipherKeysActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3(EKPGetBaseCipherKeysByIdsReply && reply,int loopDepth) + { + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (reply.error.present()) + #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent(SevWarn, "GetEncryptCipherKeysRequestFailed").error(reply.error.get()); + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch2(reply.error.get(), loopDepth); + #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (g_network && g_network->isSimulated() && usageType == BlobCipherMetrics::RESTORE) + #line 1389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + std::unordered_set tenantIdsToDrop = parseStringToUnorderedSet(CLIENT_KNOBS->SIMULATION_EKP_TENANT_IDS_TO_DROP, ','); + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!tenantIdsToDrop.count(TenantInfo::INVALID_TENANT)) + #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + for( auto& baseCipherInfo : request.baseCipherInfos ) { + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (tenantIdsToDrop.count(baseCipherInfo.domainId)) + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent("GetEncryptCipherKeysSimulatedError").detail("DomainId", baseCipherInfo.domainId); + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (deterministicRandom()->coinflip()) + #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch2(encrypt_keys_fetch_failed(), loopDepth); + #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + else + { + #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch2(encrypt_key_not_found(), loopDepth); + #line 1417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + } + } + } + } + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getUncachedEncryptCipherKeysActor*>(this)->SAV::futures) { (void)(reply); this->~_getUncachedEncryptCipherKeysActorState(); static_cast<_getUncachedEncryptCipherKeysActor*>(this)->destroy(); return 0; } + #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getUncachedEncryptCipherKeysActor*>(this)->SAV< EKPGetBaseCipherKeysByIdsReply >::value()) EKPGetBaseCipherKeysByIdsReply(reply); + this->~_getUncachedEncryptCipherKeysActorState(); + static_cast<_getUncachedEncryptCipherKeysActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(EKPGetBaseCipherKeysByIdsReply const& reply,int loopDepth) + { + loopDepth = a_body1cont3(reply, loopDepth); + + return loopDepth; + } + int a_body1when1(EKPGetBaseCipherKeysByIdsReply && reply,int loopDepth) + { + loopDepth = a_body1cont3(std::move(reply), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast<_getUncachedEncryptCipherKeysActor*>(this)->actor_wait_state > 0) static_cast<_getUncachedEncryptCipherKeysActor*>(this)->actor_wait_state = 0; + static_cast<_getUncachedEncryptCipherKeysActor*>(this)->ActorCallback< _getUncachedEncryptCipherKeysActor, 0, EKPGetBaseCipherKeysByIdsReply >::remove(); + + } + void a_callback_fire(ActorCallback< _getUncachedEncryptCipherKeysActor, 0, EKPGetBaseCipherKeysByIdsReply >*,EKPGetBaseCipherKeysByIdsReply const& value) + { + fdb_probe_actor_enter("_getUncachedEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("_getUncachedEncryptCipherKeys", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _getUncachedEncryptCipherKeysActor, 0, EKPGetBaseCipherKeysByIdsReply >*,EKPGetBaseCipherKeysByIdsReply && value) + { + fdb_probe_actor_enter("_getUncachedEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("_getUncachedEncryptCipherKeys", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< _getUncachedEncryptCipherKeysActor, 0, EKPGetBaseCipherKeysByIdsReply >*,Error err) + { + fdb_probe_actor_enter("_getUncachedEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("_getUncachedEncryptCipherKeys", reinterpret_cast(this), 0); + + } + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference const> db; + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + EKPGetBaseCipherKeysByIdsRequest request; + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BlobCipherMetrics::UsageType usageType; + #line 1502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +}; +// This generated class is to be used only via _getUncachedEncryptCipherKeys() + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getUncachedEncryptCipherKeysActor final : public Actor, public ActorCallback< _getUncachedEncryptCipherKeysActor, 0, EKPGetBaseCipherKeysByIdsReply >, public FastAllocated<_getUncachedEncryptCipherKeysActor>, public _getUncachedEncryptCipherKeysActorState> { + #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + using FastAllocated<_getUncachedEncryptCipherKeysActor>::operator new; + using FastAllocated<_getUncachedEncryptCipherKeysActor>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< _getUncachedEncryptCipherKeysActor, 0, EKPGetBaseCipherKeysByIdsReply >; + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getUncachedEncryptCipherKeysActor(Reference const> const& db,EKPGetBaseCipherKeysByIdsRequest const& request,BlobCipherMetrics::UsageType const& usageType) + #line 1520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + : Actor(), + _getUncachedEncryptCipherKeysActorState>(db, request, usageType) + { + fdb_probe_actor_enter("_getUncachedEncryptCipherKeys", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("_getUncachedEncryptCipherKeys"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("_getUncachedEncryptCipherKeys", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< _getUncachedEncryptCipherKeysActor, 0, EKPGetBaseCipherKeysByIdsReply >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +[[nodiscard]] Future _getUncachedEncryptCipherKeys( Reference const> const& db, EKPGetBaseCipherKeysByIdsRequest const& request, BlobCipherMetrics::UsageType const& usageType ) { + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return Future(new _getUncachedEncryptCipherKeysActor(db, request, usageType)); + #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +} + +#line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + +// Get cipher keys specified by the list of cipher details. It tries to get the cipher keys from local cache. +// In case of cache miss, it fetches the cipher keys from EncryptKeyProxy and put the result in the local cache +// before return. + #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +namespace { +// This generated class is to be used only via _getEncryptCipherKeys() + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getEncryptCipherKeysActorState { + #line 1565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getEncryptCipherKeysActorState(Reference const> const& db,std::unordered_set const& cipherDetails,BlobCipherMetrics::UsageType const& usageType) + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + : db(db), + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + cipherDetails(cipherDetails), + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + usageType(usageType), + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + cipherKeyCache(BlobCipherKeyCache::getInstance()), + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + cipherKeys(), + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + uncachedBaseCipherIds(), + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + request() + #line 1584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + fdb_probe_actor_create("_getEncryptCipherKeys", reinterpret_cast(this)); + + } + ~_getEncryptCipherKeysActorState() + { + fdb_probe_actor_destroy("_getEncryptCipherKeys", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!db.isValid()) + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent(SevError, "GetEncryptCipherKeysServerDBInfoNotAvailable"); + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch1(encrypt_ops_error(), loopDepth); + #line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + for( const BlobCipherDetails& details : cipherDetails ) { + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference cachedCipherKey = cipherKeyCache->getCipherKey(details.encryptDomainId, details.baseCipherId, details.salt); + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (cachedCipherKey.isValid()) + #line 1613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + cipherKeys.emplace(details, cachedCipherKey); + #line 1617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + else + { + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + uncachedBaseCipherIds.insert(std::make_pair(details.encryptDomainId, details.baseCipherId)); + #line 1623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + } + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (uncachedBaseCipherIds.empty()) + #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getEncryptCipherKeysActor*>(this)->SAV>>::futures) { (void)(cipherKeys); this->~_getEncryptCipherKeysActorState(); static_cast<_getEncryptCipherKeysActor*>(this)->destroy(); return 0; } + #line 1632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getEncryptCipherKeysActor*>(this)->SAV< std::unordered_map> >::value()) std::unordered_map>(std::move(cipherKeys)); // state_var_RVO + this->~_getEncryptCipherKeysActorState(); + static_cast<_getEncryptCipherKeysActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + for( const BaseCipherIndex& id : uncachedBaseCipherIds ) { + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + request.baseCipherInfos.emplace_back(id.first , id.second ); + #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + startTime = now(); + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ; + #line 1648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~_getEncryptCipherKeysActorState(); + static_cast<_getEncryptCipherKeysActor*>(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + double elapsed = now() - startTime; + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BlobCipherMetrics::getInstance()->getCipherKeysLatency.addMeasurement(elapsed); + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BlobCipherMetrics::counters(usageType).getCipherKeysLatency.addMeasurement(elapsed); + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getEncryptCipherKeysActor*>(this)->SAV>>::futures) { (void)(cipherKeys); this->~_getEncryptCipherKeysActorState(); static_cast<_getEncryptCipherKeysActor*>(this)->destroy(); return 0; } + #line 1677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getEncryptCipherKeysActor*>(this)->SAV< std::unordered_map> >::value()) std::unordered_map>(std::move(cipherKeys)); // state_var_RVO + this->~_getEncryptCipherKeysActorState(); + static_cast<_getEncryptCipherKeysActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + StrictFuture __when_expr_0 = _getUncachedEncryptCipherKeys(db, request, usageType); + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (static_cast<_getEncryptCipherKeysActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + StrictFuture __when_expr_1 = _onEncryptKeyProxyChange(db); + #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; + static_cast<_getEncryptCipherKeysActor*>(this)->actor_wait_state = 1; + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast<_getEncryptCipherKeysActor*>(this))); + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast<_getEncryptCipherKeysActor*>(this))); + #line 1709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(EKPGetBaseCipherKeysByIdsReply const& reply,int loopDepth) + { + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + std::unordered_map> baseCipherKeys; + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + for( const EKPBaseCipherDetails& baseDetails : reply.baseCipherDetails ) { + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BaseCipherIndex baseIdx = std::make_pair(baseDetails.encryptDomainId, baseDetails.baseCipherId); + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + baseCipherKeys[baseIdx] = baseDetails; + #line 1743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + for( const BlobCipherDetails& details : cipherDetails ) { + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (cipherKeys.count(details) > 0) + #line 1749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + continue; + } + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BaseCipherIndex baseIdx = std::make_pair(details.encryptDomainId, details.baseCipherId); + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + const auto& itr = baseCipherKeys.find(baseIdx); + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (itr == baseCipherKeys.end()) + #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent(SevError, "GetEncryptCipherKeysKeyMissing") .detail("DomainId", details.encryptDomainId) .detail("BaseCipherId", details.baseCipherId); + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch1(encrypt_key_not_found(), std::max(0, loopDepth - 1)); + #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference cipherKey = cipherKeyCache->insertCipherKey(details.encryptDomainId, details.baseCipherId, itr->second.baseCipherKey.begin(), itr->second.baseCipherKey.size(), itr->second.baseCipherKCV, details.salt, itr->second.refreshAt, itr->second.expireAt); + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(cipherKey.isValid()); + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + cipherKeys[details] = cipherKey; + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when1(EKPGetBaseCipherKeysByIdsReply && reply,int loopDepth) + { + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + std::unordered_map> baseCipherKeys; + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + for( const EKPBaseCipherDetails& baseDetails : reply.baseCipherDetails ) { + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BaseCipherIndex baseIdx = std::make_pair(baseDetails.encryptDomainId, baseDetails.baseCipherId); + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + baseCipherKeys[baseIdx] = baseDetails; + #line 1789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + for( const BlobCipherDetails& details : cipherDetails ) { + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (cipherKeys.count(details) > 0) + #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + continue; + } + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BaseCipherIndex baseIdx = std::make_pair(details.encryptDomainId, details.baseCipherId); + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + const auto& itr = baseCipherKeys.find(baseIdx); + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (itr == baseCipherKeys.end()) + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TraceEvent(SevError, "GetEncryptCipherKeysKeyMissing") .detail("DomainId", details.encryptDomainId) .detail("BaseCipherId", details.baseCipherId); + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return a_body1Catch1(encrypt_key_not_found(), std::max(0, loopDepth - 1)); + #line 1811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference cipherKey = cipherKeyCache->insertCipherKey(details.encryptDomainId, details.baseCipherId, itr->second.baseCipherKey.begin(), itr->second.baseCipherKey.size(), itr->second.baseCipherKCV, details.salt, itr->second.refreshAt, itr->second.expireAt); + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(cipherKey.isValid()); + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + cipherKeys[details] = cipherKey; + #line 1819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when2(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when2(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast<_getEncryptCipherKeysActor*>(this)->actor_wait_state > 0) static_cast<_getEncryptCipherKeysActor*>(this)->actor_wait_state = 0; + static_cast<_getEncryptCipherKeysActor*>(this)->ActorCallback< _getEncryptCipherKeysActor, 0, EKPGetBaseCipherKeysByIdsReply >::remove(); + static_cast<_getEncryptCipherKeysActor*>(this)->ActorCallback< _getEncryptCipherKeysActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< _getEncryptCipherKeysActor, 0, EKPGetBaseCipherKeysByIdsReply >*,EKPGetBaseCipherKeysByIdsReply const& value) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _getEncryptCipherKeysActor, 0, EKPGetBaseCipherKeysByIdsReply >*,EKPGetBaseCipherKeysByIdsReply && value) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< _getEncryptCipherKeysActor, 0, EKPGetBaseCipherKeysByIdsReply >*,Error err) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _getEncryptCipherKeysActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1loopBody1when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< _getEncryptCipherKeysActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1loopBody1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< _getEncryptCipherKeysActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), 1); + + } + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference const> db; + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + std::unordered_set cipherDetails; + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BlobCipherMetrics::UsageType usageType; + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference cipherKeyCache; + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + std::unordered_map> cipherKeys; + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + std::unordered_set> uncachedBaseCipherIds; + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + EKPGetBaseCipherKeysByIdsRequest request; + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + double startTime; + #line 1950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +}; +// This generated class is to be used only via _getEncryptCipherKeys() + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getEncryptCipherKeysActor final : public Actor>>, public ActorCallback< _getEncryptCipherKeysActor, 0, EKPGetBaseCipherKeysByIdsReply >, public ActorCallback< _getEncryptCipherKeysActor, 1, Void >, public FastAllocated<_getEncryptCipherKeysActor>, public _getEncryptCipherKeysActorState> { + #line 1957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + using FastAllocated<_getEncryptCipherKeysActor>::operator new; + using FastAllocated<_getEncryptCipherKeysActor>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< _getEncryptCipherKeysActor, 0, EKPGetBaseCipherKeysByIdsReply >; +friend struct ActorCallback< _getEncryptCipherKeysActor, 1, Void >; + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getEncryptCipherKeysActor(Reference const> const& db,std::unordered_set const& cipherDetails,BlobCipherMetrics::UsageType const& usageType) + #line 1969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + : Actor>>(), + _getEncryptCipherKeysActorState>(db, cipherDetails, usageType) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("_getEncryptCipherKeys"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< _getEncryptCipherKeysActor, 0, EKPGetBaseCipherKeysByIdsReply >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +[[nodiscard]] Future>> _getEncryptCipherKeys( Reference const> const& db, std::unordered_set const& cipherDetails, BlobCipherMetrics::UsageType const& usageType ) { + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return Future>>(new _getEncryptCipherKeysActor(db, cipherDetails, usageType)); + #line 1999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +} + +#line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + + #line 2004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +namespace { +// This generated class is to be used only via _getLatestEncryptCipherKeysForDomain() + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getLatestEncryptCipherKeysForDomainActorState { + #line 2011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getLatestEncryptCipherKeysForDomainActorState(Reference const> const& db,EncryptCipherDomainId const& domainId,BlobCipherMetrics::UsageType const& usageType) + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + : db(db), + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + domainId(domainId), + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + usageType(usageType) + #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + fdb_probe_actor_create("_getLatestEncryptCipherKeysForDomain", reinterpret_cast(this)); + + } + ~_getLatestEncryptCipherKeysForDomainActorState() + { + fdb_probe_actor_destroy("_getLatestEncryptCipherKeysForDomain", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + std::unordered_set domainIds = { domainId, ENCRYPT_HEADER_DOMAIN_ID }; + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + StrictFuture>> __when_expr_0 = _getLatestEncryptCipherKeys(db, domainIds, usageType); + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this)->actor_wait_state = 1; + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this))); + #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~_getLatestEncryptCipherKeysForDomainActorState(); + static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(std::unordered_map> const& cipherKeys,int loopDepth) + { + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(cipherKeys.count(domainId) > 0); + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(cipherKeys.count(ENCRYPT_HEADER_DOMAIN_ID) > 0); + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TextAndHeaderCipherKeys result{ cipherKeys.at(domainId), cipherKeys.at(ENCRYPT_HEADER_DOMAIN_ID) }; + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(result.cipherTextKey.isValid()); + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(result.cipherHeaderKey.isValid()); + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this)->SAV::futures) { (void)(result); this->~_getLatestEncryptCipherKeysForDomainActorState(); static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this)->destroy(); return 0; } + #line 2079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this)->SAV< TextAndHeaderCipherKeys >::value()) TextAndHeaderCipherKeys(result); + this->~_getLatestEncryptCipherKeysForDomainActorState(); + static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(std::unordered_map> && cipherKeys,int loopDepth) + { + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(cipherKeys.count(domainId) > 0); + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(cipherKeys.count(ENCRYPT_HEADER_DOMAIN_ID) > 0); + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TextAndHeaderCipherKeys result{ cipherKeys.at(domainId), cipherKeys.at(ENCRYPT_HEADER_DOMAIN_ID) }; + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(result.cipherTextKey.isValid()); + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(result.cipherHeaderKey.isValid()); + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this)->SAV::futures) { (void)(result); this->~_getLatestEncryptCipherKeysForDomainActorState(); static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this)->destroy(); return 0; } + #line 2101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this)->SAV< TextAndHeaderCipherKeys >::value()) TextAndHeaderCipherKeys(result); + this->~_getLatestEncryptCipherKeysForDomainActorState(); + static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(std::unordered_map> const& cipherKeys,int loopDepth) + { + loopDepth = a_body1cont1(cipherKeys, loopDepth); + + return loopDepth; + } + int a_body1when1(std::unordered_map> && cipherKeys,int loopDepth) + { + loopDepth = a_body1cont1(std::move(cipherKeys), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this)->actor_wait_state > 0) static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this)->actor_wait_state = 0; + static_cast<_getLatestEncryptCipherKeysForDomainActor*>(this)->ActorCallback< _getLatestEncryptCipherKeysForDomainActor, 0, std::unordered_map> >::remove(); + + } + void a_callback_fire(ActorCallback< _getLatestEncryptCipherKeysForDomainActor, 0, std::unordered_map> >*,std::unordered_map> const& value) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKeysForDomain", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getLatestEncryptCipherKeysForDomain", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _getLatestEncryptCipherKeysForDomainActor, 0, std::unordered_map> >*,std::unordered_map> && value) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKeysForDomain", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getLatestEncryptCipherKeysForDomain", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< _getLatestEncryptCipherKeysForDomainActor, 0, std::unordered_map> >*,Error err) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKeysForDomain", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getLatestEncryptCipherKeysForDomain", reinterpret_cast(this), 0); + + } + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference const> db; + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + EncryptCipherDomainId domainId; + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BlobCipherMetrics::UsageType usageType; + #line 2178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +}; +// This generated class is to be used only via _getLatestEncryptCipherKeysForDomain() + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getLatestEncryptCipherKeysForDomainActor final : public Actor, public ActorCallback< _getLatestEncryptCipherKeysForDomainActor, 0, std::unordered_map> >, public FastAllocated<_getLatestEncryptCipherKeysForDomainActor>, public _getLatestEncryptCipherKeysForDomainActorState> { + #line 2185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + using FastAllocated<_getLatestEncryptCipherKeysForDomainActor>::operator new; + using FastAllocated<_getLatestEncryptCipherKeysForDomainActor>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< _getLatestEncryptCipherKeysForDomainActor, 0, std::unordered_map> >; + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getLatestEncryptCipherKeysForDomainActor(Reference const> const& db,EncryptCipherDomainId const& domainId,BlobCipherMetrics::UsageType const& usageType) + #line 2196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + : Actor(), + _getLatestEncryptCipherKeysForDomainActorState>(db, domainId, usageType) + { + fdb_probe_actor_enter("_getLatestEncryptCipherKeysForDomain", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("_getLatestEncryptCipherKeysForDomain"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("_getLatestEncryptCipherKeysForDomain", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< _getLatestEncryptCipherKeysForDomainActor, 0, std::unordered_map> >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +[[nodiscard]] Future _getLatestEncryptCipherKeysForDomain( Reference const> const& db, EncryptCipherDomainId const& domainId, BlobCipherMetrics::UsageType const& usageType ) { + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return Future(new _getLatestEncryptCipherKeysForDomainActor(db, domainId, usageType)); + #line 2226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +} + +#line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + +template +Future _getLatestSystemEncryptCipherKeys(const Reference const>& db, + BlobCipherMetrics::UsageType usageType) { + return _getLatestEncryptCipherKeysForDomain(db, SYSTEM_KEYSPACE_ENCRYPT_DOMAIN_ID, usageType); +} + + #line 2237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +namespace { +// This generated class is to be used only via _getEncryptCipherKeys() + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getEncryptCipherKeysActor1State { + #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getEncryptCipherKeysActor1State(Reference const> const& db,BlobCipherEncryptHeader const& header,BlobCipherMetrics::UsageType const& usageType) + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + : db(db), + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + header(header), + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + usageType(usageType), + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + authenticatedEncryption(header.flags.authTokenMode != ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) + #line 2257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + fdb_probe_actor_create("_getEncryptCipherKeys", reinterpret_cast(this)); + + } + ~_getEncryptCipherKeysActor1State() + { + fdb_probe_actor_destroy("_getEncryptCipherKeys", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(header.cipherTextDetails.isValid()); + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(!authenticatedEncryption || header.cipherHeaderDetails.isValid()); + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + std::unordered_set cipherDetails{ header.cipherTextDetails }; + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (authenticatedEncryption) + #line 2278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + cipherDetails.insert(header.cipherHeaderDetails); + #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + StrictFuture>> __when_expr_0 = _getEncryptCipherKeys(db, cipherDetails, usageType); + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (static_cast<_getEncryptCipherKeysActor1*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast<_getEncryptCipherKeysActor1*>(this)->actor_wait_state = 1; + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast<_getEncryptCipherKeysActor1*>(this))); + #line 2293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~_getEncryptCipherKeysActor1State(); + static_cast<_getEncryptCipherKeysActor1*>(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(std::unordered_map> const& cipherKeys,int loopDepth) + { + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TextAndHeaderCipherKeys result; + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + auto setCipherKey = [&](const BlobCipherDetails& details, TextAndHeaderCipherKeys& result) { ASSERT(details.isValid()); auto iter = cipherKeys.find(details); ASSERT(iter != cipherKeys.end() && iter->second.isValid()); isEncryptHeaderDomain(details.encryptDomainId) ? result.cipherHeaderKey = iter->second : result.cipherTextKey = iter->second; }; + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + setCipherKey(header.cipherTextDetails, result); + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (authenticatedEncryption) + #line 2322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + setCipherKey(header.cipherHeaderDetails, result); + #line 2326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(result.cipherTextKey.isValid() && (!authenticatedEncryption || result.cipherHeaderKey.isValid())); + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getEncryptCipherKeysActor1*>(this)->SAV::futures) { (void)(result); this->~_getEncryptCipherKeysActor1State(); static_cast<_getEncryptCipherKeysActor1*>(this)->destroy(); return 0; } + #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getEncryptCipherKeysActor1*>(this)->SAV< TextAndHeaderCipherKeys >::value()) TextAndHeaderCipherKeys(result); + this->~_getEncryptCipherKeysActor1State(); + static_cast<_getEncryptCipherKeysActor1*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(std::unordered_map> && cipherKeys,int loopDepth) + { + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TextAndHeaderCipherKeys result; + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + auto setCipherKey = [&](const BlobCipherDetails& details, TextAndHeaderCipherKeys& result) { ASSERT(details.isValid()); auto iter = cipherKeys.find(details); ASSERT(iter != cipherKeys.end() && iter->second.isValid()); isEncryptHeaderDomain(details.encryptDomainId) ? result.cipherHeaderKey = iter->second : result.cipherTextKey = iter->second; }; + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + setCipherKey(header.cipherTextDetails, result); + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (authenticatedEncryption) + #line 2350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + setCipherKey(header.cipherHeaderDetails, result); + #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(result.cipherTextKey.isValid() && (!authenticatedEncryption || result.cipherHeaderKey.isValid())); + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getEncryptCipherKeysActor1*>(this)->SAV::futures) { (void)(result); this->~_getEncryptCipherKeysActor1State(); static_cast<_getEncryptCipherKeysActor1*>(this)->destroy(); return 0; } + #line 2360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getEncryptCipherKeysActor1*>(this)->SAV< TextAndHeaderCipherKeys >::value()) TextAndHeaderCipherKeys(result); + this->~_getEncryptCipherKeysActor1State(); + static_cast<_getEncryptCipherKeysActor1*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(std::unordered_map> const& cipherKeys,int loopDepth) + { + loopDepth = a_body1cont1(cipherKeys, loopDepth); + + return loopDepth; + } + int a_body1when1(std::unordered_map> && cipherKeys,int loopDepth) + { + loopDepth = a_body1cont1(std::move(cipherKeys), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast<_getEncryptCipherKeysActor1*>(this)->actor_wait_state > 0) static_cast<_getEncryptCipherKeysActor1*>(this)->actor_wait_state = 0; + static_cast<_getEncryptCipherKeysActor1*>(this)->ActorCallback< _getEncryptCipherKeysActor1, 0, std::unordered_map> >::remove(); + + } + void a_callback_fire(ActorCallback< _getEncryptCipherKeysActor1, 0, std::unordered_map> >*,std::unordered_map> const& value) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _getEncryptCipherKeysActor1, 0, std::unordered_map> >*,std::unordered_map> && value) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< _getEncryptCipherKeysActor1, 0, std::unordered_map> >*,Error err) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), 0); + + } + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference const> db; + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BlobCipherEncryptHeader header; + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BlobCipherMetrics::UsageType usageType; + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + bool authenticatedEncryption; + #line 2439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +}; +// This generated class is to be used only via _getEncryptCipherKeys() + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getEncryptCipherKeysActor1 final : public Actor, public ActorCallback< _getEncryptCipherKeysActor1, 0, std::unordered_map> >, public FastAllocated<_getEncryptCipherKeysActor1>, public _getEncryptCipherKeysActor1State> { + #line 2446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + using FastAllocated<_getEncryptCipherKeysActor1>::operator new; + using FastAllocated<_getEncryptCipherKeysActor1>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< _getEncryptCipherKeysActor1, 0, std::unordered_map> >; + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getEncryptCipherKeysActor1(Reference const> const& db,BlobCipherEncryptHeader const& header,BlobCipherMetrics::UsageType const& usageType) + #line 2457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + : Actor(), + _getEncryptCipherKeysActor1State>(db, header, usageType) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("_getEncryptCipherKeys"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< _getEncryptCipherKeysActor1, 0, std::unordered_map> >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +[[nodiscard]] Future _getEncryptCipherKeys( Reference const> const& db, BlobCipherEncryptHeader const& header, BlobCipherMetrics::UsageType const& usageType ) { + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return Future(new _getEncryptCipherKeysActor1(db, header, usageType)); + #line 2487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +} + +#line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + + #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +namespace { +// This generated class is to be used only via _getEncryptCipherKeys() + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getEncryptCipherKeysActor2State { + #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getEncryptCipherKeysActor2State(Reference const> const& db,BlobCipherEncryptHeaderRef const& header,BlobCipherMetrics::UsageType const& usageType) + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + : db(db), + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + header(header), + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + usageType(usageType) + #line 2510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + fdb_probe_actor_create("_getEncryptCipherKeys", reinterpret_cast(this)); + + } + ~_getEncryptCipherKeysActor2State() + { + fdb_probe_actor_destroy("_getEncryptCipherKeys", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + authenticatedEncryption = header.getAuthTokenMode() != ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE; + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + details = header.getCipherDetails(); + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(details.textCipherDetails.isValid()); + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(!authenticatedEncryption || (details.headerCipherDetails.present() && details.headerCipherDetails.get().isValid())); + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + std::unordered_set cipherDetails{ details.textCipherDetails }; + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (authenticatedEncryption) + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + cipherDetails.insert(details.headerCipherDetails.get()); + #line 2541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + StrictFuture>> __when_expr_0 = _getEncryptCipherKeys(db, cipherDetails, usageType); + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (static_cast<_getEncryptCipherKeysActor2*>(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast<_getEncryptCipherKeysActor2*>(this)->actor_wait_state = 1; + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast<_getEncryptCipherKeysActor2*>(this))); + #line 2552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~_getEncryptCipherKeysActor2State(); + static_cast<_getEncryptCipherKeysActor2*>(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(std::unordered_map> const& cipherKeys,int loopDepth) + { + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TextAndHeaderCipherKeys result; + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + auto setCipherKey = [&](const BlobCipherDetails& details, TextAndHeaderCipherKeys& result) { ASSERT(details.isValid()); auto iter = cipherKeys.find(details); ASSERT(iter != cipherKeys.end() && iter->second.isValid()); isEncryptHeaderDomain(details.encryptDomainId) ? result.cipherHeaderKey = iter->second : result.cipherTextKey = iter->second; }; + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + setCipherKey(details.textCipherDetails, result); + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (authenticatedEncryption) + #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + setCipherKey(details.headerCipherDetails.get(), result); + #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(result.cipherTextKey.isValid() && (!authenticatedEncryption || result.cipherHeaderKey.isValid())); + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getEncryptCipherKeysActor2*>(this)->SAV::futures) { (void)(result); this->~_getEncryptCipherKeysActor2State(); static_cast<_getEncryptCipherKeysActor2*>(this)->destroy(); return 0; } + #line 2591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getEncryptCipherKeysActor2*>(this)->SAV< TextAndHeaderCipherKeys >::value()) TextAndHeaderCipherKeys(result); + this->~_getEncryptCipherKeysActor2State(); + static_cast<_getEncryptCipherKeysActor2*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(std::unordered_map> && cipherKeys,int loopDepth) + { + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + TextAndHeaderCipherKeys result; + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + auto setCipherKey = [&](const BlobCipherDetails& details, TextAndHeaderCipherKeys& result) { ASSERT(details.isValid()); auto iter = cipherKeys.find(details); ASSERT(iter != cipherKeys.end() && iter->second.isValid()); isEncryptHeaderDomain(details.encryptDomainId) ? result.cipherHeaderKey = iter->second : result.cipherTextKey = iter->second; }; + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + setCipherKey(details.textCipherDetails, result); + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (authenticatedEncryption) + #line 2609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + { + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + setCipherKey(details.headerCipherDetails.get(), result); + #line 2613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + } + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + ASSERT(result.cipherTextKey.isValid() && (!authenticatedEncryption || result.cipherHeaderKey.isValid())); + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + if (!static_cast<_getEncryptCipherKeysActor2*>(this)->SAV::futures) { (void)(result); this->~_getEncryptCipherKeysActor2State(); static_cast<_getEncryptCipherKeysActor2*>(this)->destroy(); return 0; } + #line 2619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + new (&static_cast<_getEncryptCipherKeysActor2*>(this)->SAV< TextAndHeaderCipherKeys >::value()) TextAndHeaderCipherKeys(result); + this->~_getEncryptCipherKeysActor2State(); + static_cast<_getEncryptCipherKeysActor2*>(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(std::unordered_map> const& cipherKeys,int loopDepth) + { + loopDepth = a_body1cont1(cipherKeys, loopDepth); + + return loopDepth; + } + int a_body1when1(std::unordered_map> && cipherKeys,int loopDepth) + { + loopDepth = a_body1cont1(std::move(cipherKeys), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast<_getEncryptCipherKeysActor2*>(this)->actor_wait_state > 0) static_cast<_getEncryptCipherKeysActor2*>(this)->actor_wait_state = 0; + static_cast<_getEncryptCipherKeysActor2*>(this)->ActorCallback< _getEncryptCipherKeysActor2, 0, std::unordered_map> >::remove(); + + } + void a_callback_fire(ActorCallback< _getEncryptCipherKeysActor2, 0, std::unordered_map> >*,std::unordered_map> const& value) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< _getEncryptCipherKeysActor2, 0, std::unordered_map> >*,std::unordered_map> && value) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< _getEncryptCipherKeysActor2, 0, std::unordered_map> >*,Error err) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), 0); + + } + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + Reference const> db; + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BlobCipherEncryptHeaderRef header; + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + BlobCipherMetrics::UsageType usageType; + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + bool authenticatedEncryption; + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + EncryptHeaderCipherDetails details; + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +}; +// This generated class is to be used only via _getEncryptCipherKeys() + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +class _getEncryptCipherKeysActor2 final : public Actor, public ActorCallback< _getEncryptCipherKeysActor2, 0, std::unordered_map> >, public FastAllocated<_getEncryptCipherKeysActor2>, public _getEncryptCipherKeysActor2State> { + #line 2707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +public: + using FastAllocated<_getEncryptCipherKeysActor2>::operator new; + using FastAllocated<_getEncryptCipherKeysActor2>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< _getEncryptCipherKeysActor2, 0, std::unordered_map> >; + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + _getEncryptCipherKeysActor2(Reference const> const& db,BlobCipherEncryptHeaderRef const& header,BlobCipherMetrics::UsageType const& usageType) + #line 2718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" + : Actor(), + _getEncryptCipherKeysActor2State>(db, header, usageType) + { + fdb_probe_actor_enter("_getEncryptCipherKeys", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("_getEncryptCipherKeys"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("_getEncryptCipherKeys", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< _getEncryptCipherKeysActor2, 0, std::unordered_map> >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +template + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" +[[nodiscard]] Future _getEncryptCipherKeys( Reference const> const& db, BlobCipherEncryptHeaderRef const& header, BlobCipherMetrics::UsageType const& usageType ) { + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + return Future(new _getEncryptCipherKeysActor2(db, header, usageType)); + #line 2748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +} + +#line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h" + +template +Future>> +GetEncryptCipherKeys::getLatestEncryptCipherKeys(Reference const> db, + std::unordered_set domainIds, + BlobCipherMetrics::UsageType usageType) { + return _getLatestEncryptCipherKeys(db, domainIds, usageType); +} + +template +Future> GetEncryptCipherKeys::getLatestEncryptCipherKey( + Reference const> db, + EncryptCipherDomainId domainId, + BlobCipherMetrics::UsageType usageType) { + return _getLatestEncryptCipherKey(db, domainId, usageType); +} + +template +Future>> GetEncryptCipherKeys::getEncryptCipherKeys( + Reference const> db, + std::unordered_set cipherDetails, + BlobCipherMetrics::UsageType usageType) { + return _getEncryptCipherKeys(db, cipherDetails, usageType); +} + +template +Future GetEncryptCipherKeys::getLatestEncryptCipherKeysForDomain( + Reference const> db, + EncryptCipherDomainId domainId, + BlobCipherMetrics::UsageType usageType) { + return _getLatestEncryptCipherKeysForDomain(db, domainId, usageType); +} + +template +Future GetEncryptCipherKeys::getLatestSystemEncryptCipherKeys( + const Reference const>& db, + BlobCipherMetrics::UsageType usageType) { + return _getLatestSystemEncryptCipherKeys(db, usageType); +} + +template +Future GetEncryptCipherKeys::getEncryptCipherKeys(Reference const> db, + BlobCipherEncryptHeader header, + BlobCipherMetrics::UsageType usageType) { + return _getEncryptCipherKeys(db, header, usageType); +} + +template +Future GetEncryptCipherKeys::getEncryptCipherKeys(Reference const> db, + BlobCipherEncryptHeaderRef header, + BlobCipherMetrics::UsageType usageType) { + return _getEncryptCipherKeys(db, header, usageType); +} + +#include "flow/unactorcompiler.h" +#endif \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h b/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h new file mode 100644 index 0000000..939f375 --- /dev/null +++ b/src/fdbclient/include/fdbclient/GetEncryptCipherKeys_impl.actor.h @@ -0,0 +1,446 @@ +/* + * GetEncryptCipherKeys_impl.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 +#include "flow/EncryptUtils.h" +#include "flow/genericactors.actor.h" +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_GETCIPHERKEYS_IMPL_ACTOR_G_H) +#define FDBCLIENT_GETCIPHERKEYS_IMPL_ACTOR_G_H +#include "fdbclient/GetEncryptCipherKeys_impl.actor.g.h" +#elif !defined(FDBCLIENT_GETCIPHERKEYS_IMPL_ACTOR_H) +#define FDBCLIENT_GETCIPHERKEYS_IMPL_ACTOR_H + +#include "fdbclient/CommitProxyInterface.h" +#include "fdbclient/GlobalConfig.actor.h" +#include "fdbclient/SpecialKeySpace.actor.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/Tuple.h" +#include "flow/flow.h" +#include "flow/genericactors.actor.h" + +#include "flow/actorcompiler.h" // This must be the last #include. + +template +Optional getEncryptKeyProxyInterface(const Reference const>& db) { + if constexpr (std::is_same_v) { + return db->get().encryptKeyProxy; + } else { + return db->get().client.encryptKeyProxy; + } +} + +template +Optional getEncryptKeyProxyId(const Reference const>& db) { + return getEncryptKeyProxyInterface(db).map(&EncryptKeyProxyInterface::id); +} + +ACTOR template +Future _onEncryptKeyProxyChange(Reference const> db) { + state Optional previousProxyId = getEncryptKeyProxyId(db); + state Optional currentProxyId; + loop { + wait(db->onChange()); + currentProxyId = getEncryptKeyProxyId(db); + if (currentProxyId != previousProxyId) { + break; + } + } + TraceEvent("GetEncryptCipherKeysEncryptKeyProxyChanged") + .detail("PreviousProxyId", previousProxyId.orDefault(UID())) + .detail("CurrentProxyId", currentProxyId.orDefault(UID())); + return Void(); +} + +ACTOR template +Future _getUncachedLatestEncryptCipherKeys(Reference const> db, + EKPGetLatestBaseCipherKeysRequest request, + BlobCipherMetrics::UsageType usageType) { + Optional proxy = getEncryptKeyProxyInterface(db); + if (!proxy.present()) { + // Wait for onEncryptKeyProxyChange. + TraceEvent("GetLatestEncryptCipherKeysEncryptKeyProxyNotPresent").detail("UsageType", toString(usageType)); + return Never(); + } + request.reply.reset(); + try { + EKPGetLatestBaseCipherKeysReply reply = wait(proxy.get().getLatestBaseCipherKeys.getReply(request)); + if (reply.error.present()) { + TraceEvent(SevWarn, "GetLatestEncryptCipherKeysRequestFailed").error(reply.error.get()); + throw reply.error.get(); + } + return reply; + } catch (Error& e) { + TraceEvent("GetLatestEncryptCipherKeysCaughtError").error(e); + if (e.code() == error_code_broken_promise) { + // Wait for onEncryptKeyProxyChange. + return Never(); + } + throw; + } +} + +ACTOR template +Future>> _getLatestEncryptCipherKeys( + Reference const> db, + std::unordered_set domainIds, + BlobCipherMetrics::UsageType usageType) { + state Reference cipherKeyCache = BlobCipherKeyCache::getInstance(); + state std::unordered_map> cipherKeys; + state EKPGetLatestBaseCipherKeysRequest request; + + if (!db.isValid()) { + TraceEvent(SevError, "GetLatestEncryptCipherKeysServerDBInfoNotAvailable"); + throw encrypt_ops_error(); + } + + // Collect cached cipher keys. + for (auto& domainId : domainIds) { + Reference cachedCipherKey = cipherKeyCache->getLatestCipherKey(domainId); + if (cachedCipherKey.isValid()) { + cipherKeys[domainId] = cachedCipherKey; + } else { + request.encryptDomainIds.emplace_back(domainId); + } + } + if (request.encryptDomainIds.empty()) { + return cipherKeys; + } + // Fetch any uncached cipher keys. + state double startTime = now(); + loop choose { + when(EKPGetLatestBaseCipherKeysReply reply = + wait(_getUncachedLatestEncryptCipherKeys(db, request, usageType))) { + // Insert base cipher keys into cache and construct result. + for (const EKPBaseCipherDetails& details : reply.baseCipherDetails) { + EncryptCipherDomainId domainId = details.encryptDomainId; + if (domainIds.count(domainId) > 0 && cipherKeys.count(domainId) == 0) { + Reference cipherKey = cipherKeyCache->insertCipherKey(domainId, + details.baseCipherId, + details.baseCipherKey.begin(), + details.baseCipherKey.size(), + details.baseCipherKCV, + details.refreshAt, + details.expireAt); + ASSERT(cipherKey.isValid()); + cipherKeys[domainId] = cipherKey; + } + } + // Check for any missing cipher keys. + for (auto domainId : request.encryptDomainIds) { + if (cipherKeys.count(domainId) == 0) { + TraceEvent(SevWarn, "GetLatestEncryptCipherKeysKeyMissing").detail("DomainId", domainId); + throw encrypt_key_not_found(); + } + } + break; + } + // In case encryptKeyProxy has changed, retry the request. + when(wait(_onEncryptKeyProxyChange(db))) {} + } + double elapsed = now() - startTime; + BlobCipherMetrics::getInstance()->getLatestCipherKeysLatency.addMeasurement(elapsed); + BlobCipherMetrics::counters(usageType).getLatestCipherKeysLatency.addMeasurement(elapsed); + return cipherKeys; +} + +ACTOR template +Future> _getLatestEncryptCipherKey(Reference const> db, + EncryptCipherDomainId domainId, + BlobCipherMetrics::UsageType usageType) { + std::unordered_set domainIds{ domainId }; + std::unordered_map> cipherKey = + wait(_getLatestEncryptCipherKeys(db, domainIds, usageType)); + + return cipherKey.at(domainId); +} + +ACTOR template +Future _getUncachedEncryptCipherKeys(Reference const> db, + EKPGetBaseCipherKeysByIdsRequest request, + BlobCipherMetrics::UsageType usageType) { + Optional proxy = getEncryptKeyProxyInterface(db); + if (!proxy.present()) { + // Wait for onEncryptKeyProxyChange. + TraceEvent("GetEncryptCipherKeysEncryptKeyProxyNotPresent").detail("UsageType", toString(usageType)); + return Never(); + } + request.reply.reset(); + try { + EKPGetBaseCipherKeysByIdsReply reply = wait(proxy.get().getBaseCipherKeysByIds.getReply(request)); + if (reply.error.present()) { + TraceEvent(SevWarn, "GetEncryptCipherKeysRequestFailed").error(reply.error.get()); + throw reply.error.get(); + } + // The code below is used only during simulation to test backup/restore ability to handle encryption keys + // not being found for deleted tenants + if (g_network && g_network->isSimulated() && usageType == BlobCipherMetrics::RESTORE) { + std::unordered_set tenantIdsToDrop = + parseStringToUnorderedSet(CLIENT_KNOBS->SIMULATION_EKP_TENANT_IDS_TO_DROP, ','); + if (!tenantIdsToDrop.count(TenantInfo::INVALID_TENANT)) { + for (auto& baseCipherInfo : request.baseCipherInfos) { + if (tenantIdsToDrop.count(baseCipherInfo.domainId)) { + TraceEvent("GetEncryptCipherKeysSimulatedError").detail("DomainId", baseCipherInfo.domainId); + if (deterministicRandom()->coinflip()) { + throw encrypt_keys_fetch_failed(); + } else { + throw encrypt_key_not_found(); + } + } + } + } + } + return reply; + } catch (Error& e) { + TraceEvent("GetEncryptCipherKeysCaughtError").error(e); + if (e.code() == error_code_broken_promise) { + // Wait for onEncryptKeyProxyChange. + return Never(); + } + throw; + } +} + +// Get cipher keys specified by the list of cipher details. It tries to get the cipher keys from local cache. +// In case of cache miss, it fetches the cipher keys from EncryptKeyProxy and put the result in the local cache +// before return. +ACTOR template +Future>> _getEncryptCipherKeys( + Reference const> db, + std::unordered_set cipherDetails, + BlobCipherMetrics::UsageType usageType) { + state Reference cipherKeyCache = BlobCipherKeyCache::getInstance(); + state std::unordered_map> cipherKeys; + state std::unordered_set> uncachedBaseCipherIds; + state EKPGetBaseCipherKeysByIdsRequest request; + + if (!db.isValid()) { + TraceEvent(SevError, "GetEncryptCipherKeysServerDBInfoNotAvailable"); + throw encrypt_ops_error(); + } + + // Collect cached cipher keys. + for (const BlobCipherDetails& details : cipherDetails) { + Reference cachedCipherKey = + cipherKeyCache->getCipherKey(details.encryptDomainId, details.baseCipherId, details.salt); + if (cachedCipherKey.isValid()) { + cipherKeys.emplace(details, cachedCipherKey); + } else { + uncachedBaseCipherIds.insert(std::make_pair(details.encryptDomainId, details.baseCipherId)); + } + } + if (uncachedBaseCipherIds.empty()) { + return cipherKeys; + } + for (const BaseCipherIndex& id : uncachedBaseCipherIds) { + request.baseCipherInfos.emplace_back(id.first /*domainId*/, id.second /*baseCipherId*/); + } + // Fetch any uncached cipher keys. + state double startTime = now(); + loop choose { + when(EKPGetBaseCipherKeysByIdsReply reply = wait(_getUncachedEncryptCipherKeys(db, request, usageType))) { + std::unordered_map> baseCipherKeys; + for (const EKPBaseCipherDetails& baseDetails : reply.baseCipherDetails) { + BaseCipherIndex baseIdx = std::make_pair(baseDetails.encryptDomainId, baseDetails.baseCipherId); + baseCipherKeys[baseIdx] = baseDetails; + } + // Insert base cipher keys into cache and construct result. + for (const BlobCipherDetails& details : cipherDetails) { + if (cipherKeys.count(details) > 0) { + continue; + } + BaseCipherIndex baseIdx = std::make_pair(details.encryptDomainId, details.baseCipherId); + const auto& itr = baseCipherKeys.find(baseIdx); + if (itr == baseCipherKeys.end()) { + TraceEvent(SevError, "GetEncryptCipherKeysKeyMissing") + .detail("DomainId", details.encryptDomainId) + .detail("BaseCipherId", details.baseCipherId); + throw encrypt_key_not_found(); + } + Reference cipherKey = cipherKeyCache->insertCipherKey(details.encryptDomainId, + details.baseCipherId, + itr->second.baseCipherKey.begin(), + itr->second.baseCipherKey.size(), + itr->second.baseCipherKCV, + details.salt, + itr->second.refreshAt, + itr->second.expireAt); + ASSERT(cipherKey.isValid()); + cipherKeys[details] = cipherKey; + } + break; + } + // In case encryptKeyProxy has changed, retry the request. + when(wait(_onEncryptKeyProxyChange(db))) {} + } + double elapsed = now() - startTime; + BlobCipherMetrics::getInstance()->getCipherKeysLatency.addMeasurement(elapsed); + BlobCipherMetrics::counters(usageType).getCipherKeysLatency.addMeasurement(elapsed); + return cipherKeys; +} + +ACTOR template +Future _getLatestEncryptCipherKeysForDomain(Reference const> db, + EncryptCipherDomainId domainId, + BlobCipherMetrics::UsageType usageType) { + // TODO: Do not fetch header cipher key if authentication is diabled. + std::unordered_set domainIds = { domainId, ENCRYPT_HEADER_DOMAIN_ID }; + std::unordered_map> cipherKeys = + wait(_getLatestEncryptCipherKeys(db, domainIds, usageType)); + ASSERT(cipherKeys.count(domainId) > 0); + ASSERT(cipherKeys.count(ENCRYPT_HEADER_DOMAIN_ID) > 0); + TextAndHeaderCipherKeys result{ cipherKeys.at(domainId), cipherKeys.at(ENCRYPT_HEADER_DOMAIN_ID) }; + ASSERT(result.cipherTextKey.isValid()); + ASSERT(result.cipherHeaderKey.isValid()); + return result; +} + +template +Future _getLatestSystemEncryptCipherKeys(const Reference const>& db, + BlobCipherMetrics::UsageType usageType) { + return _getLatestEncryptCipherKeysForDomain(db, SYSTEM_KEYSPACE_ENCRYPT_DOMAIN_ID, usageType); +} + +ACTOR template +Future _getEncryptCipherKeys(Reference const> db, + BlobCipherEncryptHeader header, + BlobCipherMetrics::UsageType usageType) { + state bool authenticatedEncryption = header.flags.authTokenMode != ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE; + + ASSERT(header.cipherTextDetails.isValid()); + ASSERT(!authenticatedEncryption || header.cipherHeaderDetails.isValid()); + + std::unordered_set cipherDetails{ header.cipherTextDetails }; + if (authenticatedEncryption) { + cipherDetails.insert(header.cipherHeaderDetails); + } + + std::unordered_map> cipherKeys = + wait(_getEncryptCipherKeys(db, cipherDetails, usageType)); + + TextAndHeaderCipherKeys result; + auto setCipherKey = [&](const BlobCipherDetails& details, TextAndHeaderCipherKeys& result) { + ASSERT(details.isValid()); + auto iter = cipherKeys.find(details); + ASSERT(iter != cipherKeys.end() && iter->second.isValid()); + isEncryptHeaderDomain(details.encryptDomainId) ? result.cipherHeaderKey = iter->second + : result.cipherTextKey = iter->second; + }; + setCipherKey(header.cipherTextDetails, result); + if (authenticatedEncryption) { + setCipherKey(header.cipherHeaderDetails, result); + } + ASSERT(result.cipherTextKey.isValid() && (!authenticatedEncryption || result.cipherHeaderKey.isValid())); + + return result; +} + +ACTOR template +Future _getEncryptCipherKeys(Reference const> db, + BlobCipherEncryptHeaderRef header, + BlobCipherMetrics::UsageType usageType) { + ASSERT(CLIENT_KNOBS->ENABLE_CONFIGURABLE_ENCRYPTION); + + state bool authenticatedEncryption = header.getAuthTokenMode() != ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE; + state EncryptHeaderCipherDetails details = header.getCipherDetails(); + + ASSERT(details.textCipherDetails.isValid()); + ASSERT(!authenticatedEncryption || + (details.headerCipherDetails.present() && details.headerCipherDetails.get().isValid())); + + std::unordered_set cipherDetails{ details.textCipherDetails }; + if (authenticatedEncryption) { + cipherDetails.insert(details.headerCipherDetails.get()); + } + + std::unordered_map> cipherKeys = + wait(_getEncryptCipherKeys(db, cipherDetails, usageType)); + TextAndHeaderCipherKeys result; + + auto setCipherKey = [&](const BlobCipherDetails& details, TextAndHeaderCipherKeys& result) { + ASSERT(details.isValid()); + auto iter = cipherKeys.find(details); + ASSERT(iter != cipherKeys.end() && iter->second.isValid()); + isEncryptHeaderDomain(details.encryptDomainId) ? result.cipherHeaderKey = iter->second + : result.cipherTextKey = iter->second; + }; + setCipherKey(details.textCipherDetails, result); + if (authenticatedEncryption) { + setCipherKey(details.headerCipherDetails.get(), result); + } + ASSERT(result.cipherTextKey.isValid() && (!authenticatedEncryption || result.cipherHeaderKey.isValid())); + + return result; +} + +template +Future>> +GetEncryptCipherKeys::getLatestEncryptCipherKeys(Reference const> db, + std::unordered_set domainIds, + BlobCipherMetrics::UsageType usageType) { + return _getLatestEncryptCipherKeys(db, domainIds, usageType); +} + +template +Future> GetEncryptCipherKeys::getLatestEncryptCipherKey( + Reference const> db, + EncryptCipherDomainId domainId, + BlobCipherMetrics::UsageType usageType) { + return _getLatestEncryptCipherKey(db, domainId, usageType); +} + +template +Future>> GetEncryptCipherKeys::getEncryptCipherKeys( + Reference const> db, + std::unordered_set cipherDetails, + BlobCipherMetrics::UsageType usageType) { + return _getEncryptCipherKeys(db, cipherDetails, usageType); +} + +template +Future GetEncryptCipherKeys::getLatestEncryptCipherKeysForDomain( + Reference const> db, + EncryptCipherDomainId domainId, + BlobCipherMetrics::UsageType usageType) { + return _getLatestEncryptCipherKeysForDomain(db, domainId, usageType); +} + +template +Future GetEncryptCipherKeys::getLatestSystemEncryptCipherKeys( + const Reference const>& db, + BlobCipherMetrics::UsageType usageType) { + return _getLatestSystemEncryptCipherKeys(db, usageType); +} + +template +Future GetEncryptCipherKeys::getEncryptCipherKeys(Reference const> db, + BlobCipherEncryptHeader header, + BlobCipherMetrics::UsageType usageType) { + return _getEncryptCipherKeys(db, header, usageType); +} + +template +Future GetEncryptCipherKeys::getEncryptCipherKeys(Reference const> db, + BlobCipherEncryptHeaderRef header, + BlobCipherMetrics::UsageType usageType) { + return _getEncryptCipherKeys(db, header, usageType); +} + +#include "flow/unactorcompiler.h" +#endif \ No newline at end of file diff --git a/src/fdbclient/GlobalConfig.actor.g.h b/src/fdbclient/include/fdbclient/GlobalConfig.actor.g.h similarity index 93% rename from src/fdbclient/GlobalConfig.actor.g.h rename to src/fdbclient/include/fdbclient/GlobalConfig.actor.g.h index 4076065..549682a 100644 --- a/src/fdbclient/GlobalConfig.actor.g.h +++ b/src/fdbclient/include/fdbclient/GlobalConfig.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GlobalConfig.actor.h" /* * GlobalConfig.actor.h * @@ -165,21 +165,16 @@ class GlobalConfig : NonCopyable { // of the global configuration keyspace. void erase(KeyRangeRef range); - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.h" -[[nodiscard]] static Future migrate( GlobalConfig* const& self ); -template friend class GlobalConfig_MigrateActorState; - -#line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.h" - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.h" -[[nodiscard]] static Future refresh( GlobalConfig* const& self ); + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GlobalConfig.actor.g.h" +[[nodiscard]] static Future refresh( GlobalConfig* const& self, Version const& lastKnown ); template friend class GlobalConfig_RefreshActorState; -#line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.h" - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.g.h" +#line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GlobalConfig.actor.h" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GlobalConfig.actor.g.h" [[nodiscard]] static Future updater( GlobalConfig* const& self, const ClientDBInfo* const& dbInfo ); template friend class GlobalConfig_UpdaterActorState; -#line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/GlobalConfig.actor.h" +#line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/GlobalConfig.actor.h" DatabaseContext* cx; AsyncTrigger dbInfoChanged; @@ -193,4 +188,6 @@ template friend class GlobalConfig_UpdaterActorState; std::unordered_map)>> callbacks; }; +#include "flow/unactorcompiler.h" + #endif diff --git a/src/fdbclient/GlobalConfig.actor.h b/src/fdbclient/include/fdbclient/GlobalConfig.actor.h similarity index 98% rename from src/fdbclient/GlobalConfig.actor.h rename to src/fdbclient/include/fdbclient/GlobalConfig.actor.h index c7757b6..fb03106 100644 --- a/src/fdbclient/GlobalConfig.actor.h +++ b/src/fdbclient/include/fdbclient/GlobalConfig.actor.h @@ -163,8 +163,7 @@ class GlobalConfig : NonCopyable { // of the global configuration keyspace. void erase(KeyRangeRef range); - ACTOR static Future migrate(GlobalConfig* self); - ACTOR static Future refresh(GlobalConfig* self); + ACTOR static Future refresh(GlobalConfig* self, Version lastKnown); ACTOR static Future updater(GlobalConfig* self, const ClientDBInfo* dbInfo); DatabaseContext* cx; @@ -179,4 +178,6 @@ class GlobalConfig : NonCopyable { std::unordered_map)>> callbacks; }; +#include "flow/unactorcompiler.h" + #endif diff --git a/src/fdbclient/GlobalConfig.h b/src/fdbclient/include/fdbclient/GlobalConfig.h similarity index 100% rename from src/fdbclient/GlobalConfig.h rename to src/fdbclient/include/fdbclient/GlobalConfig.h diff --git a/src/fdbclient/GrvProxyInterface.h b/src/fdbclient/include/fdbclient/GrvProxyInterface.h similarity index 85% rename from src/fdbclient/GrvProxyInterface.h rename to src/fdbclient/include/fdbclient/GrvProxyInterface.h index 10dd815..0209ad4 100644 --- a/src/fdbclient/GrvProxyInterface.h +++ b/src/fdbclient/include/fdbclient/GrvProxyInterface.h @@ -1,4 +1,3 @@ - /* * GrvProxyInterface.h * @@ -26,8 +25,9 @@ #include "fdbrpc/fdbrpc.h" #include "fdbclient/FDBTypes.h" -// GrvProxy is proxy primarily specializing on serving GetReadVersion. It also serves health metrics since it -// communicates with RateKeeper to gather health information of the cluster. +// GrvProxy is proxy primarily specializing on serving GetReadVersion. It also +// serves health metrics since it communicates with RateKeeper to gather health +// information of the cluster, and handles proxied GlobalConfig requests. struct GrvProxyInterface { constexpr static FileIdentifier file_identifier = 8743216; enum { LocationAwareLoadBalance = 1 }; @@ -36,13 +36,14 @@ struct GrvProxyInterface { Optional processId; bool provisional; - RequestStream + PublicRequestStream getConsistentReadVersion; // Returns a version which (1) is committed, and (2) is >= the latest version reported // committed (by a commit response) when this request was sent // (at some point between when this request is sent and when its response is received, the latest version reported // committed) RequestStream> waitFailure; // reports heartbeat to master. RequestStream getHealthMetrics; + PublicRequestStream refreshGlobalConfig; UID id() const { return getConsistentReadVersion.getEndpoint().token; } std::string toString() const { return id().shortString(); } @@ -59,6 +60,8 @@ struct GrvProxyInterface { RequestStream>(getConsistentReadVersion.getEndpoint().getAdjustedEndpoint(1)); getHealthMetrics = RequestStream( getConsistentReadVersion.getEndpoint().getAdjustedEndpoint(2)); + refreshGlobalConfig = PublicRequestStream( + getConsistentReadVersion.getEndpoint().getAdjustedEndpoint(3)); } } @@ -67,6 +70,7 @@ struct GrvProxyInterface { streams.push_back(getConsistentReadVersion.getReceiver(TaskPriority::ReadSocket)); streams.push_back(waitFailure.getReceiver()); streams.push_back(getHealthMetrics.getReceiver()); + streams.push_back(refreshGlobalConfig.getReceiver()); FlowTransport::transport().addEndpoints(streams); } }; diff --git a/src/fdbclient/HighContentionPrefixAllocator.actor.g.h b/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h similarity index 71% rename from src/fdbclient/HighContentionPrefixAllocator.actor.g.h rename to src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h index 926c147..2852c2c 100644 --- a/src/fdbclient/HighContentionPrefixAllocator.actor.g.h +++ b/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" /* * HighContentionPrefixAllocator.actor.h * @@ -61,26 +61,26 @@ class HighContentionPrefixAllocator { Subspace counters; Subspace recent; - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" // This generated class is to be used only via allocate() - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" template - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" class AllocateActorState { - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" public: - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" AllocateActorState(HighContentionPrefixAllocator* const& self,Reference const& tr) - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" : self(self), - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" tr(tr), - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" start(0), - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" window(0) - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { fdb_probe_actor_create("allocate", reinterpret_cast(this)); @@ -93,9 +93,9 @@ class AllocateActorState { int a_body1(int loopDepth=0) { try { - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" ; - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -123,56 +123,56 @@ class AllocateActorState { } int a_body1loopBody1(int loopDepth) { - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" rangeFuture = tr->getRange(self->counters.range(), 1, Snapshot::True, Reverse::True); - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" StrictFuture __when_expr_0 = safeThreadFutureToFuture(rangeFuture); - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(RangeResult const& range,int loopDepth) { - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (range.size() > 0) - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" start = self->counters.unpack(range[0].key).getInt(0); - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" } - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" windowAdvanced = false; - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" ; - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1cont1(RangeResult && range,int loopDepth) { - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (range.size() > 0) - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" start = self->counters.unpack(range[0].key).getInt(0); - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" } - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" windowAdvanced = false; - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" ; - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); return loopDepth; @@ -242,9 +242,9 @@ class AllocateActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" ; - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" loopDepth = a_body1loopBody1cont2loopHead1(loopDepth); return loopDepth; @@ -258,34 +258,34 @@ class AllocateActorState { } int a_body1loopBody1cont1loopBody1(int loopDepth) { - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (windowAdvanced) - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { - #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" tr->clear(KeyRangeRef(self->counters.key(), self->counters.get(start).key())); - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" tr->setOption(FDBTransactionOptions::NEXT_WRITE_NO_WRITE_CONFLICT_RANGE); - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" tr->clear(KeyRangeRef(self->recent.key(), self->recent.get(start).key())); - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" } - #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" int64_t inc = 1; - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" tr->atomicOp(self->counters.get(start).key(), StringRef((uint8_t*)&inc, 8), MutationRef::AddValue); - #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" countFuture = tr->get(self->counters.get(start).key(), Snapshot::True); - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" StrictFuture> __when_expr_1 = safeThreadFutureToFuture(countFuture); - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" loopDepth = 0; return loopDepth; @@ -305,74 +305,74 @@ class AllocateActorState { } int a_body1loopBody1cont1loopBody1cont1(Optional const& countValue,int loopDepth) { - #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" int64_t count = 0; - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (countValue.present()) - #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (countValue.get().size() != 8) - #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" return a_body1Catch1(invalid_directory_layer_metadata(), std::max(0, loopDepth - 2)); - #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" } - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" count = *(int64_t*)countValue.get().begin(); - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" } - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" window = HighContentionPrefixAllocator::windowSize(start); - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (count * 2 < window) - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" start += window; - #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" windowAdvanced = true; - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" if (loopDepth == 0) return a_body1loopBody1cont1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1loopBody1cont1(Optional && countValue,int loopDepth) { - #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" int64_t count = 0; - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (countValue.present()) - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (countValue.get().size() != 8) - #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" return a_body1Catch1(invalid_directory_layer_metadata(), std::max(0, loopDepth - 2)); - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" } - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" count = *(int64_t*)countValue.get().begin(); - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" } - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" window = HighContentionPrefixAllocator::windowSize(start); - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (count * 2 < window) - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" start += window; - #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" windowAdvanced = true; - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" if (loopDepth == 0) return a_body1loopBody1cont1loopHead1(0); return loopDepth; @@ -455,26 +455,26 @@ class AllocateActorState { } int a_body1loopBody1cont2loopBody1(int loopDepth) { - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" candidate = deterministicRandom()->randomInt(start, start + window); - #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" latestCounterFuture = tr->getRange(self->counters.range(), 1, Snapshot::True, Reverse::True); - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" candidateValueFuture = tr->get(self->recent.get(candidate).key()); - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" tr->setOption(FDBTransactionOptions::NEXT_WRITE_NO_WRITE_CONFLICT_RANGE); - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" tr->set(self->recent.get(candidate).key(), ValueRef()); - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" StrictFuture __when_expr_2 = success(safeThreadFutureToFuture(latestCounterFuture)) && success(safeThreadFutureToFuture(candidateValueFuture)); - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont2loopBody1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" loopDepth = 0; return loopDepth; @@ -494,32 +494,32 @@ class AllocateActorState { } int a_body1loopBody1cont2loopBody1cont1(Void const& _,int loopDepth) { - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" int64_t currentWindowStart = 0; - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (latestCounterFuture.get().size() > 0) - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" currentWindowStart = self->counters.unpack(latestCounterFuture.get()[0].key).getInt(0); - #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" } - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (currentWindowStart > start) - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { return a_body1loopBody1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (!candidateValueFuture.get().present()) - #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" tr->addWriteConflictRange(singleKeyRange(self->recent.get(candidate).key())); - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(Tuple().append(candidate).pack()); this->~AllocateActorState(); static_cast(this)->destroy(); return 0; } - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" - new (&static_cast(this)->SAV< Standalone >::value()) Standalone(Tuple().append(candidate).pack()); + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(Tuple::makeTuple(candidate).pack()); this->~AllocateActorState(); static_cast(this)->destroy(); return 0; } + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" + new (&static_cast(this)->SAV< Standalone >::value()) Standalone(Tuple::makeTuple(candidate).pack()); this->~AllocateActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -530,32 +530,32 @@ class AllocateActorState { } int a_body1loopBody1cont2loopBody1cont1(Void && _,int loopDepth) { - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" int64_t currentWindowStart = 0; - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (latestCounterFuture.get().size() > 0) - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" currentWindowStart = self->counters.unpack(latestCounterFuture.get()[0].key).getInt(0); - #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" } - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (currentWindowStart > start) - #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { return a_body1loopBody1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" if (!candidateValueFuture.get().present()) - #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" { - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" tr->addWriteConflictRange(singleKeyRange(self->recent.get(candidate).key())); - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(Tuple().append(candidate).pack()); this->~AllocateActorState(); static_cast(this)->destroy(); return 0; } - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" - new (&static_cast(this)->SAV< Standalone >::value()) Standalone(Tuple().append(candidate).pack()); + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(Tuple::makeTuple(candidate).pack()); this->~AllocateActorState(); static_cast(this)->destroy(); return 0; } + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" + new (&static_cast(this)->SAV< Standalone >::value()) Standalone(Tuple::makeTuple(candidate).pack()); this->~AllocateActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -627,34 +627,34 @@ class AllocateActorState { fdb_probe_actor_exit("allocate", reinterpret_cast(this), 2); } - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" HighContentionPrefixAllocator* self; - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" Reference tr; - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" int64_t start; - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" int64_t window; - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" typename TransactionT::template FutureT rangeFuture; - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" bool windowAdvanced; - #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" typename TransactionT::template FutureT> countFuture; - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" int64_t candidate; - #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" typename TransactionT::template FutureT latestCounterFuture; - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" typename TransactionT::template FutureT> candidateValueFuture; - #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" }; // This generated class is to be used only via allocate() - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" template - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" class AllocateActor final : public Actor>, public ActorCallback< AllocateActor, 0, RangeResult >, public ActorCallback< AllocateActor, 1, Optional >, public ActorCallback< AllocateActor, 2, Void >, public FastAllocated>, public AllocateActorState> { - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -665,9 +665,9 @@ class AllocateActor final : public Actor>, public ActorCal friend struct ActorCallback< AllocateActor, 0, RangeResult >; friend struct ActorCallback< AllocateActor, 1, Optional >; friend struct ActorCallback< AllocateActor, 2, Void >; - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" AllocateActor(HighContentionPrefixAllocator* const& self,Reference const& tr) - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" : Actor>(), AllocateActorState>(self, tr) { @@ -692,16 +692,16 @@ friend struct ActorCallback< AllocateActor, 2, Void >; } }; - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" template - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" [[nodiscard]] Future> allocate( HighContentionPrefixAllocator* const& self, Reference const& tr ) { - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" return Future>(new AllocateActor(self, tr)); - #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.g.h" + #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.g.h" } -#line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/HighContentionPrefixAllocator.actor.h" +#line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h" }; #include "flow/unactorcompiler.h" diff --git a/src/fdbclient/HighContentionPrefixAllocator.actor.h b/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h similarity index 99% rename from src/fdbclient/HighContentionPrefixAllocator.actor.h rename to src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h index 57e185c..20ec964 100644 --- a/src/fdbclient/HighContentionPrefixAllocator.actor.h +++ b/src/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h @@ -134,7 +134,7 @@ class HighContentionPrefixAllocator { if (!candidateValueFuture.get().present()) { tr->addWriteConflictRange(singleKeyRange(self->recent.get(candidate).key())); - return Tuple().append(candidate).pack(); + return Tuple::makeTuple(candidate).pack(); } } } diff --git a/src/fdbclient/IClientApi.h b/src/fdbclient/include/fdbclient/IClientApi.h similarity index 73% rename from src/fdbclient/IClientApi.h rename to src/fdbclient/include/fdbclient/IClientApi.h index a87663e..1f41f9c 100644 --- a/src/fdbclient/IClientApi.h +++ b/src/fdbclient/include/fdbclient/IClientApi.h @@ -20,13 +20,14 @@ #ifndef FDBCLIENT_ICLIENTAPI_H #define FDBCLIENT_ICLIENTAPI_H -#include "flow/ProtocolVersion.h" #pragma once +#include "fdbclient/BlobGranuleCommon.h" #include "fdbclient/FDBOptions.g.h" #include "fdbclient/FDBTypes.h" #include "fdbclient/Tenant.h" - +#include "fdbclient/Tracing.h" +#include "flow/ProtocolVersion.h" #include "flow/ThreadHelper.actor.h" struct VersionVector; @@ -77,13 +78,30 @@ class ITransaction { virtual ThreadFuture>> getRangeSplitPoints(const KeyRangeRef& range, int64_t chunkSize) = 0; - virtual ThreadFuture>> getBlobGranuleRanges(const KeyRangeRef& keyRange) = 0; + virtual ThreadFuture>> getBlobGranuleRanges(const KeyRangeRef& keyRange, + int rowLimit) = 0; virtual ThreadResult readBlobGranules(const KeyRangeRef& keyRange, Version beginVersion, Optional readVersion, ReadBlobGranuleContext granuleContext) = 0; + virtual ThreadFuture>> readBlobGranulesStart( + const KeyRangeRef& keyRange, + Version beginVersion, + Optional readVersion, + Version* readVersionOut) = 0; + + virtual ThreadResult readBlobGranulesFinish( + ThreadFuture>> startFuture, + const KeyRangeRef& keyRange, + Version beginVersion, + Version readVersion, + ReadBlobGranuleContext granuleContext) = 0; + + virtual ThreadFuture>> + summarizeBlobGranules(const KeyRangeRef& keyRange, Optional summaryVersion, int rangeLimit) = 0; + virtual void atomicOp(const KeyRef& key, const ValueRef& value, uint32_t operationType) = 0; virtual void set(const KeyRef& key, const ValueRef& value) = 0; virtual void clear(const KeyRef& begin, const KeyRef& end) = 0; @@ -96,11 +114,13 @@ class ITransaction { virtual ThreadFuture commit() = 0; virtual Version getCommittedVersion() = 0; - // @todo This API and the "getSpanID()" API may help with debugging simulation + // @todo This API and the "getSpanContext()" API may help with debugging simulation // test failures. (These APIs are not currently invoked anywhere.) Remove them // later if they are not really needed. virtual ThreadFuture getVersionVector() = 0; - virtual ThreadFuture getSpanID() = 0; + virtual ThreadFuture getSpanContext() = 0; + virtual ThreadFuture getTagThrottledDuration() = 0; + virtual ThreadFuture getTotalCost() = 0; virtual ThreadFuture getApproximateSize() = 0; virtual void setOption(FDBTransactionOptions::Option option, Optional value = Optional()) = 0; @@ -120,6 +140,14 @@ class ITransaction { virtual bool isValid() { return true; } virtual Optional getTenant() = 0; + + virtual void debugTrace(BaseTraceEvent&& event) = 0; + virtual void debugPrint(std::string const& message) = 0; + + template + void debugFmtPrint(std::string const& message, Args&&... args) { + debugPrint(fmt::format(fmt::runtime(message), std::forward(args)...)); + }; }; class ITenant { @@ -128,6 +156,19 @@ class ITenant { virtual Reference createTransaction() = 0; + virtual ThreadFuture getId() = 0; + virtual ThreadFuture purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) = 0; + virtual ThreadFuture waitPurgeGranulesComplete(const KeyRef& purgeKey) = 0; + + virtual ThreadFuture blobbifyRange(const KeyRangeRef& keyRange) = 0; + virtual ThreadFuture blobbifyRangeBlocking(const KeyRangeRef& keyRange) = 0; + virtual ThreadFuture unblobbifyRange(const KeyRangeRef& keyRange) = 0; + virtual ThreadFuture>> listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) = 0; + + virtual ThreadFuture verifyBlobRange(const KeyRangeRef& keyRange, Optional version) = 0; + virtual ThreadFuture flushBlobRange(const KeyRangeRef& keyRange, bool compact, Optional version) = 0; + virtual void addref() = 0; virtual void delref() = 0; }; @@ -168,10 +209,22 @@ class IDatabase { virtual ThreadFuture purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) = 0; virtual ThreadFuture waitPurgeGranulesComplete(const KeyRef& purgeKey) = 0; + virtual ThreadFuture blobbifyRange(const KeyRangeRef& keyRange) = 0; + virtual ThreadFuture blobbifyRangeBlocking(const KeyRangeRef& keyRange) = 0; + virtual ThreadFuture unblobbifyRange(const KeyRangeRef& keyRange) = 0; + virtual ThreadFuture>> listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) = 0; + + virtual ThreadFuture verifyBlobRange(const KeyRangeRef& keyRange, Optional version) = 0; + virtual ThreadFuture flushBlobRange(const KeyRangeRef& keyRange, bool compact, Optional version) = 0; + // Interface to manage shared state across multiple connections to the same Database virtual ThreadFuture createSharedState() = 0; virtual void setSharedState(DatabaseSharedState* p) = 0; + // Return a JSON string containing database client-side status information + virtual ThreadFuture> getClientStatus() = 0; + // used in template functions as the Transaction type that can be created through createTransaction() using TransactionT = ITransaction; }; @@ -186,6 +239,7 @@ class IClientApi { virtual void selectApiVersion(int apiVersion) = 0; virtual const char* getClientVersion() = 0; + virtual void useFutureProtocolVersion() = 0; virtual void setNetworkOption(FDBNetworkOptions::Option option, Optional value = Optional()) = 0; @@ -194,6 +248,7 @@ class IClientApi { virtual void stopNetwork() = 0; virtual Reference createDatabase(const char* clusterFilePath) = 0; + virtual Reference createDatabaseFromConnectionString(const char* connectionString) = 0; virtual void addNetworkThreadCompletionHook(void (*hook)(void*), void* hookParameter) = 0; }; diff --git a/src/fdbclient/include/fdbclient/IClosable.h b/src/fdbclient/include/fdbclient/IClosable.h new file mode 100644 index 0000000..5a575de --- /dev/null +++ b/src/fdbclient/include/fdbclient/IClosable.h @@ -0,0 +1,40 @@ +/* + * IClosable.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ +#ifndef FDBCLIENT_ICLOSABLE_H +#define FDBCLIENT_ICLOSABLE_H +#pragma once +#include "flow/flow.h" +class IClosable { +public: + // IClosable is a base interface for any disk-backed data structure that needs to support asynchronous errors, + // shutdown and deletion + + virtual Future getError() + const = 0; // asynchronously throws an error if there is an internal error. Never set + // inside (on the stack of) a call to another API function on this object. + virtual Future onClosed() + const = 0; // the future is set to Void when this is totally shut down after dispose() or + // close(). But this function cannot be called after dispose or close! + virtual void dispose() = 0; // permanently delete the data AND invalidate this interface + virtual void close() = 0; // invalidate this interface, but do not delete the data. Outstanding operations may or + // may not take effect in the background. +}; + +#endif \ No newline at end of file diff --git a/src/fdbclient/IConfigTransaction.h b/src/fdbclient/include/fdbclient/IConfigTransaction.h similarity index 80% rename from src/fdbclient/IConfigTransaction.h rename to src/fdbclient/include/fdbclient/IConfigTransaction.h index 63e058e..eaf9d4d 100644 --- a/src/fdbclient/IConfigTransaction.h +++ b/src/fdbclient/include/fdbclient/IConfigTransaction.h @@ -45,7 +45,7 @@ class IConfigTransaction : public ISingleThreadTransaction { // Not implemented: void setVersion(Version) override { throw client_invalid_operation(); } VersionVector getVersionVector() const override { throw client_invalid_operation(); } - UID getSpanID() const override { throw client_invalid_operation(); } + SpanContext getSpanContext() const override { throw client_invalid_operation(); } Future getKey(KeySelector const& key, Snapshot snapshot = Snapshot::False) override { throw client_invalid_operation(); } @@ -55,7 +55,7 @@ class IConfigTransaction : public ISingleThreadTransaction { Future>> getRangeSplitPoints(KeyRange const& range, int64_t chunkSize) override { throw client_invalid_operation(); } - Future>> getBlobGranuleRanges(KeyRange const& range) override { + Future>> getBlobGranuleRanges(KeyRange const& range, int rowLimit) override { throw client_invalid_operation(); } Future>> readBlobGranules(KeyRange const& range, @@ -64,7 +64,13 @@ class IConfigTransaction : public ISingleThreadTransaction { Version* readVersionOut) override { throw client_invalid_operation(); } + Future>> summarizeBlobGranules(KeyRange const& range, + Optional readVersion, + int rangeLimit) override { + throw client_invalid_operation(); + } Future getEstimatedRangeSizeBytes(KeyRange const& keys) override { throw client_invalid_operation(); } + void addGranuleMaterializeStats(const GranuleMaterializeStats& stats) override { throw client_invalid_operation(); } void addReadConflictRange(KeyRangeRef const& keys) override { throw client_invalid_operation(); } void makeSelfConflicting() override { throw client_invalid_operation(); } void atomicOp(KeyRef const& key, ValueRef const& operand, uint32_t operationType) override { @@ -76,4 +82,12 @@ class IConfigTransaction : public ISingleThreadTransaction { // Implemented: void getWriteConflicts(KeyRangeMap* result) override{}; + + void debugTrace(BaseTraceEvent&& event) override { + event.detail("CommitResult", "Deferred logging unsupported").log(); + }; + + virtual void debugPrint(std::string const& message) override { + fmt::print("[Deferred logging unsupported] {}\n", message); + } }; diff --git a/src/fdbclient/include/fdbclient/IKeyValueStore.h b/src/fdbclient/include/fdbclient/IKeyValueStore.h new file mode 100644 index 0000000..04a1a67 --- /dev/null +++ b/src/fdbclient/include/fdbclient/IKeyValueStore.h @@ -0,0 +1,203 @@ +/* + * IKeyValueStore.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBCLIENT_IKEYVALUESTORE_H +#define FDBCLIENT_IKEYVALUESTORE_H +#include "flow/Trace.h" +#pragma once + +#include "fdbclient/FDBTypes.h" +#include "fdbclient/StorageCheckpoint.h" +#include "fdbclient/Tenant.h" +#include "fdbclient/IClosable.h" +#include "fdbclient/KeyRangeMap.h" + +struct CheckpointRequest { + const Version version; // The FDB version at which the checkpoint is created. + const std::vector ranges; // Keyranges this checkpoint must contain. + const CheckpointFormat format; + const UID checkpointID; + const std::string checkpointDir; // The local directory where the checkpoint file will be created. + + CheckpointRequest(const Version version, + const std::vector& ranges, + const CheckpointFormat format, + const UID& id, + const std::string& checkpointDir) + : version(version), ranges(ranges), format(format), checkpointID(id), checkpointDir(checkpointDir) {} +}; + +class IKeyValueStore : public IClosable { +public: + virtual KeyValueStoreType getType() const = 0; + // Returns true if the KV store supports shards, i.e., implements addRange(), removeRange(), and + // persistRangeMapping(). + virtual bool shardAware() const { return false; } + virtual void set(KeyValueRef keyValue, const Arena* arena = nullptr) = 0; + virtual void clear(KeyRangeRef range, const Arena* arena = nullptr) = 0; + virtual Future canCommit() { return Void(); } + virtual Future commit( + bool sequential = false) = 0; // returns when prior sets and clears are (atomically) durable + + virtual Future> readValue(KeyRef key, Optional options = Optional()) = 0; + + // Like readValue(), but returns only the first maxLength bytes of the value if it is longer + virtual Future> readValuePrefix(KeyRef key, + int maxLength, + Optional options = Optional()) = 0; + + // If rowLimit>=0, reads first rows sorted ascending, otherwise reads last rows sorted descending + // The total size of the returned value (less the last entry) will be less than byteLimit + virtual Future readRange(KeyRangeRef keys, + int rowLimit = 1 << 30, + int byteLimit = 1 << 30, + Optional options = Optional()) = 0; + + // Shard management APIs. + // Adds key range to a physical shard. + virtual Future addRange(KeyRangeRef range, std::string id) { return Void(); } + + // Removes a key range from KVS and returns a list of empty physical shards after the removal. + virtual std::vector removeRange(KeyRangeRef range) { return std::vector(); } + + // Replace the specified range, the default implementation ignores `blockRange` and writes the key one by one. + virtual Future replaceRange(KeyRange range, Standalone> data); + + // Persists key range and physical shard mapping. + virtual void persistRangeMapping(KeyRangeRef range, bool isAdd) {} + + // Returns key range to physical shard mapping. + virtual CoalescedKeyRangeMap getExistingRanges() { throw not_implemented(); } + + // To debug MEMORY_RADIXTREE type ONLY + // Returns (1) how many key & value pairs have been inserted (2) how many nodes have been created (3) how many + // key size is less than 12 bytes + virtual std::tuple getSize() const { return std::make_tuple(0, 0, 0); } + + // Returns the amount of free and total space for this store, in bytes + virtual StorageBytes getStorageBytes() const = 0; + + virtual void logRecentRocksDBBackgroundWorkStats(UID ssId, std::string logReason) { throw not_implemented(); } + + virtual void resyncLog() {} + + virtual void enableSnapshot() {} + + // Create a checkpoint. + virtual Future checkpoint(const CheckpointRequest& request) { throw not_implemented(); } + + // Restore from a checkpoint. + virtual Future restore(const std::vector& checkpoints) { throw not_implemented(); } + + // Same as above, with a target shardId, and a list of target ranges, ranges must be a subset of the checkpoint + // ranges. + virtual Future restore(const std::string& shardId, + const std::vector& ranges, + const std::vector& checkpoints) { + throw not_implemented(); + } + + // Delete a checkpoint. + virtual Future deleteCheckpoint(const CheckpointMetaData& checkpoint) { throw not_implemented(); } + + /* + Concurrency contract + Causal consistency: + A read which begins after a commit ends sees the effects of the commit. + A read which ends before a commit begins does not see the effects of the commit. + + Thus, a read returns a version as of a call to commit which began before the read ends such that no subsequent + commit ended before the read begins: + + commit() // can't be this version (subsequent commit ends before read begins) + endcommit() + commit() // could be this or any later version (no subsequent commit ends before read begins) + endcommit() + commit() + read() + */ + // `init()` MUST be idempotent as it will be called more than once on a KeyValueStore in case + // of a rollback. + virtual Future init() { return Void(); } + + // Obtain the encryption mode of the storage. The encryption mode needs to match the encryption mode of the cluster. + virtual Future encryptionMode() = 0; + +protected: + virtual ~IKeyValueStore() {} +}; + +extern IKeyValueStore* keyValueStoreSQLite(std::string const& filename, + UID logID, + KeyValueStoreType storeType, + bool checkChecksums = false, + bool checkIntegrity = false); +extern IKeyValueStore* keyValueStoreRedwoodV1(std::string const& filename, + UID logID, + Reference const> db = {}, + Optional encryptionMode = {}, + int64_t pageCacheBytes = 0); +extern IKeyValueStore* keyValueStoreRocksDB(std::string const& path, + UID logID, + KeyValueStoreType storeType, + bool checkChecksums = false, + bool checkIntegrity = false); +extern IKeyValueStore* keyValueStoreShardedRocksDB(std::string const& path, + UID logID, + KeyValueStoreType storeType, + bool checkChecksums = false, + bool checkIntegrity = false); +extern IKeyValueStore* keyValueStoreMemory(std::string const& basename, + UID logID, + int64_t memoryLimit, + std::string ext = "fdq", + KeyValueStoreType storeType = KeyValueStoreType::MEMORY); +extern IKeyValueStore* keyValueStoreLogSystem(class IDiskQueue* queue, + Reference const> db, + UID logID, + int64_t memoryLimit, + bool disableSnapshot, + bool replaceContent, + bool exactRecovery, + bool enableEncryption); + +extern IKeyValueStore* openRemoteKVStore(KeyValueStoreType storeType, + std::string const& filename, + UID logID, + int64_t memoryLimit, + bool checkChecksums = false, + bool checkIntegrity = false); + +IKeyValueStore* openKVStore(KeyValueStoreType storeType, + std::string const& filename, + UID logID, + int64_t memoryLimit, + bool checkChecksums = false, + bool checkIntegrity = false, + bool openRemotely = false, + Reference const> db = {}, + Optional encryptionMode = {}, + int64_t pageCacheBytes = 0); + +void GenerateIOLogChecksumFile(std::string filename); +Future KVFileCheck(std::string const& filename, bool const& integrity); +Future KVFileDump(std::string const& filename); + +#endif diff --git a/src/fdbclient/IKnobCollection.h b/src/fdbclient/include/fdbclient/IKnobCollection.h similarity index 100% rename from src/fdbclient/IKnobCollection.h rename to src/fdbclient/include/fdbclient/IKnobCollection.h diff --git a/src/fdbclient/ISingleThreadTransaction.h b/src/fdbclient/include/fdbclient/ISingleThreadTransaction.h similarity index 83% rename from src/fdbclient/ISingleThreadTransaction.h rename to src/fdbclient/include/fdbclient/ISingleThreadTransaction.h index bb5a491..4ab9a3b 100644 --- a/src/fdbclient/ISingleThreadTransaction.h +++ b/src/fdbclient/include/fdbclient/ISingleThreadTransaction.h @@ -47,10 +47,10 @@ class ISingleThreadTransaction : public ReferenceCounted create(Type, Database const&); - static Reference create(Type, Database const&, TenantName const&); + static Reference create(Type, Database const&, Reference const&); virtual void construct(Database const&) = 0; - virtual void construct(Database const&, TenantName const&) { + virtual void construct(Database const&, Reference const&) { // By default, a transaction implementation does not support tenants. ASSERT(false); } @@ -79,11 +79,15 @@ class ISingleThreadTransaction : public ReferenceCounted>> getAddressesForKey(Key const& key) = 0; virtual Future>> getRangeSplitPoints(KeyRange const& range, int64_t chunkSize) = 0; virtual Future getEstimatedRangeSizeBytes(KeyRange const& keys) = 0; - virtual Future>> getBlobGranuleRanges(KeyRange const& range) = 0; + virtual Future>> getBlobGranuleRanges(KeyRange const& range, int rangeLimit) = 0; virtual Future>> readBlobGranules(KeyRange const& range, Version begin, Optional readVersion, Version* readVersionOut = nullptr) = 0; + virtual Future>> summarizeBlobGranules(KeyRange const& range, + Optional summaryVersion, + int rangeLimit) = 0; + virtual void addGranuleMaterializeStats(const GranuleMaterializeStats& stats) = 0; virtual void addReadConflictRange(KeyRangeRef const& keys) = 0; virtual void makeSelfConflicting() = 0; virtual void atomicOp(KeyRef const& key, ValueRef const& operand, uint32_t operationType) = 0; @@ -95,7 +99,9 @@ class ISingleThreadTransaction : public ReferenceCounted commit() = 0; virtual Version getCommittedVersion() const = 0; virtual VersionVector getVersionVector() const = 0; - virtual UID getSpanID() const = 0; + virtual SpanContext getSpanContext() const = 0; + virtual double getTagThrottledDuration() const = 0; + virtual int64_t getTotalCost() const = 0; virtual int64_t getApproximateSize() const = 0; virtual Future> getVersionstamp() = 0; virtual void setOption(FDBTransactionOptions::Option option, Optional value = Optional()) = 0; @@ -106,6 +112,14 @@ class ISingleThreadTransaction : public ReferenceCounted* result) = 0; + virtual void debugTrace(BaseTraceEvent&& event) = 0; + virtual void debugPrint(std::string const& message) = 0; + + template + void debugFmtPrint(std::string const& message, Args&&... args) { + debugPrint(fmt::format(fmt::runtime(message), std::forward(args)...)); + }; + // Used by ThreadSafeTransaction for exceptions thrown in void methods Error deferredError; }; diff --git a/src/fdbclient/include/fdbclient/IdempotencyId.actor.g.h b/src/fdbclient/include/fdbclient/IdempotencyId.actor.g.h new file mode 100644 index 0000000..6e8e7d1 --- /dev/null +++ b/src/fdbclient/include/fdbclient/IdempotencyId.actor.g.h @@ -0,0 +1,210 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/IdempotencyId.actor.h" +/* + * IdempotencyId.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +// When actually compiled (NO_INTELLISENSE), include the generated version of this file. In intellisense use the source +// version. +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_IDEMPOTENCY_ID_ACTOR_G_H) +#define FDBCLIENT_IDEMPOTENCY_ID_ACTOR_G_H +#include "fdbclient/IdempotencyId.actor.g.h" +#elif !defined(FDBCLIENT_IDEMPOTENCY_ID_ACTOR_H) +#define FDBCLIENT_IDEMPOTENCY_ID_ACTOR_H + +#pragma once + +#include "fdbclient/FDBTypes.h" +#include "fdbclient/JsonBuilder.h" +#include "fdbclient/PImpl.h" +#include "flow/Arena.h" +#include "flow/IRandom.h" +#include "flow/serialize.h" +#include "flow/actorcompiler.h" // this has to be the last include + +struct CommitResult { + Version commitVersion; + uint16_t batchIndex; +}; + +// The type of the value stored at the key |idempotencyIdsExpiredVersion| +struct IdempotencyIdsExpiredVersion { + static constexpr auto file_identifier = 3746945; + // Any version at or below expired might have had its idempotency id expired. Any version greater than `expired` + // definitely has not had it's idempotency id expired. + Version expired = 0; + int64_t expiredTime = 0; + + template + void serialize(Archive& ar) { + serializer(ar, expired, expiredTime); + } +}; + +// See design/idempotency_ids.md for more information. Designed so that the common case of a random 16 byte id does not +// usually require indirection. Either invalid or an id with length >= 16 and < 256. +struct IdempotencyIdRef { + static constexpr auto file_identifier = 3858470; + + // Create an invalid IdempotencyIdRef + IdempotencyIdRef() : first(0) {} + + // Borrows memory from the StringRef + explicit IdempotencyIdRef(StringRef id) { + if (id.empty()) { + first = 0; + return; + } + ASSERT(id.size() >= 16); + ASSERT(id.size() < 256); + if (id.size() == 16 && + /* If it's 16 bytes but first < 256 we still need to use an indirection to avoid ambiguity. */ + reinterpret_cast(id.begin())[0] >= 256) { + first = reinterpret_cast(id.begin())[0]; + second.id = reinterpret_cast(id.begin())[1]; + } else { + first = id.size(); + second.ptr = id.begin(); + } + } + + IdempotencyIdRef(Arena& arena, IdempotencyIdRef t) + : IdempotencyIdRef(t.valid() && t.indirect() ? StringRef(arena, t.asStringRefUnsafe()) : t.asStringRefUnsafe()) {} + + int expectedSize() const { + if (valid() && indirect()) { + return first; + } + return 0; + } + + bool operator==(const IdempotencyIdRef& other) const { return asStringRefUnsafe() == other.asStringRefUnsafe(); } + + IdempotencyIdRef(IdempotencyIdRef&& other) = default; + IdempotencyIdRef& operator=(IdempotencyIdRef&& other) = default; + IdempotencyIdRef(const IdempotencyIdRef& other) = default; + IdempotencyIdRef& operator=(const IdempotencyIdRef& other) = default; + + template + void serialize(Archive& ar) { + // Only support network messages/object serializer for now + ASSERT(false); + } + + bool valid() const { return first != 0; } + + // Result may reference this, so *this must outlive result. + StringRef asStringRefUnsafe() const { + if (!valid()) { + return StringRef(); + } + if (indirect()) { + return StringRef(second.ptr, first); + } else { + return StringRef(reinterpret_cast(this), sizeof(*this)); + } + } + +private: + bool indirect() const { return first < 256; } + // first == 0 means this id is invalid. This representation is not ambiguous + // because if first < 256, then first is the length of the id, but a valid + // id as at least 16 bytes long. + uint64_t first; + union { + uint64_t id; + const uint8_t* ptr; + } second; // If first < 256, then ptr is valid. Otherwise id is valid. +}; + +using IdempotencyId = Standalone; + +namespace std { +template <> +struct hash { + std::size_t operator()(const IdempotencyIdRef& id) const { return std::hash{}(id.asStringRefUnsafe()); } +}; +template <> +struct hash { + std::size_t operator()(const IdempotencyId& id) const { return std::hash{}(id.asStringRefUnsafe()); } +}; +} // namespace std + +template <> +struct dynamic_size_traits : std::true_type { + template + static size_t size(const IdempotencyIdRef& t, Context&) { + return t.asStringRefUnsafe().size(); + } + template + static void save(uint8_t* out, const IdempotencyIdRef& t, Context&) { + StringRef s = t.asStringRefUnsafe(); + std::copy(s.begin(), s.end(), out); + } + + template + static void load(const uint8_t* ptr, size_t sz, IdempotencyIdRef& id, Context& context) { + id = IdempotencyIdRef(StringRef(context.tryReadZeroCopy(ptr, sz), sz)); + } +}; + +// The plan is to use this as a key in a potentially large hashtable, so it should be compact. +static_assert(sizeof(IdempotencyIdRef) == 16); + +// Use in the commit proxy to construct a kv pair according to the format described in design/idempotency_ids.md +struct IdempotencyIdKVBuilder : NonCopyable { + IdempotencyIdKVBuilder(); + void setCommitVersion(Version commitVersion); + // All calls to add must share the same high order byte of batchIndex (until the next call to buildAndClear) + void add(const IdempotencyIdRef& id, uint16_t batchIndex); + // Must call setCommitVersion before calling buildAndClear. After calling buildAndClear, this object is ready to + // start a new kv pair for the high order byte of batchIndex. + Optional buildAndClear(); + + ~IdempotencyIdKVBuilder(); + +private: + PImpl impl; +}; + +// Check if id is present in kv, and if so return the commit version and batchIndex +Optional kvContainsIdempotencyId(const KeyValueRef& kv, const IdempotencyIdRef& id); + +// Make a range containing only the idempotency key associated with version and highOrderBatchIndex +KeyRangeRef makeIdempotencySingleKeyRange(Arena& arena, Version version, uint8_t highOrderBatchIndex); + +void decodeIdempotencyKey(KeyRef key, Version& commitVersion, uint8_t& highOrderBatchIndex); + + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/IdempotencyId.actor.g.h" +[[nodiscard]] Future getIdmpKeyStatus( Database const& db ); + +#line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/IdempotencyId.actor.h" + +// Delete zero or more idempotency ids older than minAgeSeconds +// +// Normally idempotency ids are deleted as part of the normal commit process, so this only needs to clean ids that +// leaked during a failure scenario. The rate of leaked idempotency ids should be low. The rate is zero during normal +// operation, and proportional to the number of in-flight transactions during a failure scenario. + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/IdempotencyId.actor.g.h" +[[nodiscard]] Future cleanIdempotencyIds( Database const& db, double const& minAgeSeconds ); + +#line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/IdempotencyId.actor.h" + +#include "flow/unactorcompiler.h" +#endif diff --git a/src/fdbclient/include/fdbclient/IdempotencyId.actor.h b/src/fdbclient/include/fdbclient/IdempotencyId.actor.h new file mode 100644 index 0000000..4893978 --- /dev/null +++ b/src/fdbclient/include/fdbclient/IdempotencyId.actor.h @@ -0,0 +1,202 @@ +/* + * IdempotencyId.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +// When actually compiled (NO_INTELLISENSE), include the generated version of this file. In intellisense use the source +// version. +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_IDEMPOTENCY_ID_ACTOR_G_H) +#define FDBCLIENT_IDEMPOTENCY_ID_ACTOR_G_H +#include "fdbclient/IdempotencyId.actor.g.h" +#elif !defined(FDBCLIENT_IDEMPOTENCY_ID_ACTOR_H) +#define FDBCLIENT_IDEMPOTENCY_ID_ACTOR_H + +#pragma once + +#include "fdbclient/FDBTypes.h" +#include "fdbclient/JsonBuilder.h" +#include "fdbclient/PImpl.h" +#include "flow/Arena.h" +#include "flow/IRandom.h" +#include "flow/serialize.h" +#include "flow/actorcompiler.h" // this has to be the last include + +struct CommitResult { + Version commitVersion; + uint16_t batchIndex; +}; + +// The type of the value stored at the key |idempotencyIdsExpiredVersion| +struct IdempotencyIdsExpiredVersion { + static constexpr auto file_identifier = 3746945; + // Any version at or below expired might have had its idempotency id expired. Any version greater than `expired` + // definitely has not had it's idempotency id expired. + Version expired = 0; + int64_t expiredTime = 0; + + template + void serialize(Archive& ar) { + serializer(ar, expired, expiredTime); + } +}; + +// See design/idempotency_ids.md for more information. Designed so that the common case of a random 16 byte id does not +// usually require indirection. Either invalid or an id with length >= 16 and < 256. +struct IdempotencyIdRef { + static constexpr auto file_identifier = 3858470; + + // Create an invalid IdempotencyIdRef + IdempotencyIdRef() : first(0) {} + + // Borrows memory from the StringRef + explicit IdempotencyIdRef(StringRef id) { + if (id.empty()) { + first = 0; + return; + } + ASSERT(id.size() >= 16); + ASSERT(id.size() < 256); + if (id.size() == 16 && + /* If it's 16 bytes but first < 256 we still need to use an indirection to avoid ambiguity. */ + reinterpret_cast(id.begin())[0] >= 256) { + first = reinterpret_cast(id.begin())[0]; + second.id = reinterpret_cast(id.begin())[1]; + } else { + first = id.size(); + second.ptr = id.begin(); + } + } + + IdempotencyIdRef(Arena& arena, IdempotencyIdRef t) + : IdempotencyIdRef(t.valid() && t.indirect() ? StringRef(arena, t.asStringRefUnsafe()) : t.asStringRefUnsafe()) {} + + int expectedSize() const { + if (valid() && indirect()) { + return first; + } + return 0; + } + + bool operator==(const IdempotencyIdRef& other) const { return asStringRefUnsafe() == other.asStringRefUnsafe(); } + + IdempotencyIdRef(IdempotencyIdRef&& other) = default; + IdempotencyIdRef& operator=(IdempotencyIdRef&& other) = default; + IdempotencyIdRef(const IdempotencyIdRef& other) = default; + IdempotencyIdRef& operator=(const IdempotencyIdRef& other) = default; + + template + void serialize(Archive& ar) { + // Only support network messages/object serializer for now + ASSERT(false); + } + + bool valid() const { return first != 0; } + + // Result may reference this, so *this must outlive result. + StringRef asStringRefUnsafe() const { + if (!valid()) { + return StringRef(); + } + if (indirect()) { + return StringRef(second.ptr, first); + } else { + return StringRef(reinterpret_cast(this), sizeof(*this)); + } + } + +private: + bool indirect() const { return first < 256; } + // first == 0 means this id is invalid. This representation is not ambiguous + // because if first < 256, then first is the length of the id, but a valid + // id as at least 16 bytes long. + uint64_t first; + union { + uint64_t id; + const uint8_t* ptr; + } second; // If first < 256, then ptr is valid. Otherwise id is valid. +}; + +using IdempotencyId = Standalone; + +namespace std { +template <> +struct hash { + std::size_t operator()(const IdempotencyIdRef& id) const { return std::hash{}(id.asStringRefUnsafe()); } +}; +template <> +struct hash { + std::size_t operator()(const IdempotencyId& id) const { return std::hash{}(id.asStringRefUnsafe()); } +}; +} // namespace std + +template <> +struct dynamic_size_traits : std::true_type { + template + static size_t size(const IdempotencyIdRef& t, Context&) { + return t.asStringRefUnsafe().size(); + } + template + static void save(uint8_t* out, const IdempotencyIdRef& t, Context&) { + StringRef s = t.asStringRefUnsafe(); + std::copy(s.begin(), s.end(), out); + } + + template + static void load(const uint8_t* ptr, size_t sz, IdempotencyIdRef& id, Context& context) { + id = IdempotencyIdRef(StringRef(context.tryReadZeroCopy(ptr, sz), sz)); + } +}; + +// The plan is to use this as a key in a potentially large hashtable, so it should be compact. +static_assert(sizeof(IdempotencyIdRef) == 16); + +// Use in the commit proxy to construct a kv pair according to the format described in design/idempotency_ids.md +struct IdempotencyIdKVBuilder : NonCopyable { + IdempotencyIdKVBuilder(); + void setCommitVersion(Version commitVersion); + // All calls to add must share the same high order byte of batchIndex (until the next call to buildAndClear) + void add(const IdempotencyIdRef& id, uint16_t batchIndex); + // Must call setCommitVersion before calling buildAndClear. After calling buildAndClear, this object is ready to + // start a new kv pair for the high order byte of batchIndex. + Optional buildAndClear(); + + ~IdempotencyIdKVBuilder(); + +private: + PImpl impl; +}; + +// Check if id is present in kv, and if so return the commit version and batchIndex +Optional kvContainsIdempotencyId(const KeyValueRef& kv, const IdempotencyIdRef& id); + +// Make a range containing only the idempotency key associated with version and highOrderBatchIndex +KeyRangeRef makeIdempotencySingleKeyRange(Arena& arena, Version version, uint8_t highOrderBatchIndex); + +void decodeIdempotencyKey(KeyRef key, Version& commitVersion, uint8_t& highOrderBatchIndex); + +ACTOR Future getIdmpKeyStatus(Database db); + +// Delete zero or more idempotency ids older than minAgeSeconds +// +// Normally idempotency ids are deleted as part of the normal commit process, so this only needs to clean ids that +// leaked during a failure scenario. The rate of leaked idempotency ids should be low. The rate is zero during normal +// operation, and proportional to the number of in-flight transactions during a failure scenario. +ACTOR Future cleanIdempotencyIds(Database db, double minAgeSeconds); + +#include "flow/unactorcompiler.h" +#endif diff --git a/src/fdbclient/JSONDoc.h b/src/fdbclient/include/fdbclient/JSONDoc.h similarity index 100% rename from src/fdbclient/JSONDoc.h rename to src/fdbclient/include/fdbclient/JSONDoc.h diff --git a/src/fdbclient/JsonBuilder.h b/src/fdbclient/include/fdbclient/JsonBuilder.h similarity index 96% rename from src/fdbclient/JsonBuilder.h rename to src/fdbclient/include/fdbclient/JsonBuilder.h index e35fc86..036df5f 100644 --- a/src/fdbclient/JsonBuilder.h +++ b/src/fdbclient/include/fdbclient/JsonBuilder.h @@ -14,8 +14,10 @@ typedef JsonBuilder JsonString; template class JsonBuilderObjectSetter; -// Class for building JSON string values. -// Default value is null, as in the JSON type +// Class for building JSON strings linearly. +// JSON data structure is only appendable. No key deduplication is done in JSON Objects, and the output is not readable +// other than obtaining a complete JSON string of what has been written to the builder. Default value is null, as in the +// JSON type class JsonBuilder { protected: enum EType { NULLVALUE, OBJECT, ARRAY }; diff --git a/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h b/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h new file mode 100644 index 0000000..a93a985 --- /dev/null +++ b/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h @@ -0,0 +1,1523 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +/* + * KeyBackedRangeMap.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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 + +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_KEYBACKEDRANGEMAP_ACTOR_G_H) +#define FDBCLIENT_KEYBACKEDRANGEMAP_ACTOR_G_H +#include "fdbclient/KeyBackedRangeMap.actor.g.h" +#elif !defined(FDBCLIENT_KEYBACKEDRANGEMAP_ACTOR_H) +#define FDBCLIENT_KEYBACKEDRANGEMAP_ACTOR_H + +#include "flow/FastRef.h" +#include "fdbclient/KeyBackedTypes.actor.h" +#include "flow/actorcompiler.h" // This must be the last #include. + +// A local in-memory representation of a KeyBackedRangeMap snapshot +// It is invalid to look up a range in this map which not within the range of +// [first key of snapshot, last key of snapshot) +// This is ReferenceCounted as it can be large and there is no reason to copy it as +// it should not be modified locally. +template +struct KeyRangeMapSnapshot : public ReferenceCounted> { + typedef std::map Map; + + // A default constructed map snapshot can't be used to look anything up because no ranges are covered. + KeyRangeMapSnapshot() {} + + // Initialize map with a single range from min to max with a given ValueType + KeyRangeMapSnapshot(const KeyType& min, const KeyType& max, const ValueType& val = {}) { + map[min] = val; + map[max] = val; + } + + struct RangeValue { + TypedRange range; + ValueType value; + }; + + // Iterator for ranges in the map. Ranges are represented by a key, its value, and the next key in the map. + struct RangeIter { + typename Map::const_iterator impl; + + using iterator_category = std::bidirectional_iterator_tag; + using value_type = RangeIter; + using pointer = RangeIter*; + using reference = RangeIter&; + + TypedRange range() const { return { impl->first, std::next(impl)->first }; } + const ValueType& value() const { return impl->second; } + + const RangeIter& operator*() const { return *this; } + const RangeIter* operator->() const { return this; } + + RangeIter operator++(int) { return { impl++ }; } + RangeIter operator--(int) { return { impl-- }; } + RangeIter& operator++() { + ++impl; + return *this; + } + RangeIter& operator--() { + --impl; + return *this; + } + + bool operator==(const RangeIter& rhs) const { return impl == rhs.impl; } + bool operator!=(const RangeIter& rhs) const { return impl != rhs.impl; } + }; + + // Range-for compatible object representing a list of contiguous ranges. + struct Ranges { + RangeIter iBegin, iEnd; + RangeIter begin() const { return iBegin; } + RangeIter end() const { return iEnd; } + }; + + RangeIter rangeContaining(const KeyType& begin) const { + ASSERT(map.size() >= 2); + auto i = map.upper_bound(begin); + ASSERT(i != map.begin()); + ASSERT(i != map.end()); + return { --i }; + } + + // Get a set of Ranges which cover [begin, end) + Ranges intersectingRanges(const KeyType& begin, const KeyType& end) const { + return { rangeContaining(begin), { map.lower_bound(end) } }; + } + + Ranges ranges() const { return { { map.begin() }, { std::prev(map.end()) } }; } + + Map map; +}; + +// KeyBackedKeyRangeMap is similar to KeyRangeMap but without a Metric +// It is assumed that any range not covered by the map is set to a default ValueType() +// The ValueType must have +// // Return a copy of *this updated with properties in value +// ValueType apply(ValueType const& value) const; +// +// // Return true if the two values are identical in meaning so adjacent ranges using either value can be merged +// bool operator==(ValueType const& value) const; +// For debug output, KeyType and ValueType must both be supported by fmt::formatter<> +template , + typename ValueCodec = TupleCodec> +class KeyBackedRangeMap { +public: + typedef KeyBackedMap Map; + typedef typename Map::KeySelector KeySelector; + typedef typename Map::RangeResultType RangeResultType; + typedef KeyRangeMapSnapshot LocalSnapshot; + typedef typename LocalSnapshot::RangeValue RangeValue; + + KeyBackedRangeMap(KeyRef prefix = invalidKey, Optional trigger = {}, ValueCodec valueCodec = {}) + : kvMap(prefix, trigger, valueCodec) {} + + // Get the RangeValue for the range that contains key, if there is a begin and end in the map which contain key + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +// This generated class is to be used only via getRangeForKey() + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +template + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +class GetRangeForKeyActorState { + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +public: + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + GetRangeForKeyActorState(KeyBackedRangeMap const& self,Transaction const& tr,KeyType const& key,Snapshot const& snapshot = Snapshot::False) + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + : self(self), + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + tr(tr), + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + key(key), + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + snapshot(snapshot), + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + begin(self.kvMap.seekLessOrEqual(tr, key, snapshot)), + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + end(self.kvMap.seekGreaterThan(tr, key, snapshot)) + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + fdb_probe_actor_create("getRangeForKey", reinterpret_cast(this)); + + } + ~GetRangeForKeyActorState() + { + fdb_probe_actor_destroy("getRangeForKey", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + StrictFuture __when_expr_0 = success(begin) && success(end); + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetRangeForKeyActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (begin.get().present() && end.get().present()) + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(RangeValue{ { begin.get()->key, end.get()->key }, begin.get()->value }); this->~GetRangeForKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(RangeValue{ { begin.get()->key, end.get()->key }, begin.get()->value }); + this->~GetRangeForKeyActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GetRangeForKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~GetRangeForKeyActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (begin.get().present() && end.get().present()) + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(RangeValue{ { begin.get()->key, end.get()->key }, begin.get()->value }); this->~GetRangeForKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(RangeValue{ { begin.get()->key, end.get()->key }, begin.get()->value }); + this->~GetRangeForKeyActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~GetRangeForKeyActorState(); static_cast(this)->destroy(); return 0; } + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~GetRangeForKeyActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetRangeForKeyActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetRangeForKeyActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getRangeForKey", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRangeForKey", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetRangeForKeyActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getRangeForKey", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRangeForKey", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetRangeForKeyActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getRangeForKey", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRangeForKey", reinterpret_cast(this), 0); + + } + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + KeyBackedRangeMap self; + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + Transaction tr; + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + KeyType key; + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + Snapshot snapshot; + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + Future> begin; + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + Future> end; + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +}; +// This generated class is to be used only via getRangeForKey() + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +template + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +class GetRangeForKeyActor final : public Actor>, public ActorCallback< GetRangeForKeyActor, 0, Void >, public FastAllocated>, public GetRangeForKeyActorState> { + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetRangeForKeyActor, 0, Void >; + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + GetRangeForKeyActor(KeyBackedRangeMap const& self,Transaction const& tr,KeyType const& key,Snapshot const& snapshot = Snapshot::False) + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + : Actor>(), + GetRangeForKeyActorState>(self, tr, key, snapshot) + { + fdb_probe_actor_enter("getRangeForKey", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getRangeForKey"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getRangeForKey", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetRangeForKeyActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +template + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +[[nodiscard]] static Future> getRangeForKey( KeyBackedRangeMap const& self, Transaction const& tr, KeyType const& key, Snapshot const& snapshot = Snapshot::False ) { + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + return Future>(new GetRangeForKeyActor(self, tr, key, snapshot)); + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +} + +#line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + + template + Future> getRangeForKey(Transaction tr, + KeyType const& key, + Snapshot snapshot = Snapshot::False) const { + return getRangeForKey(*this, tr, key, snapshot); + } + + // Update the range from begin to end by either applying valueUpdate to it, or if replace is true then replace + // the the range with the given value. + // Adjacent ranges that are identical will be coalesced in the update transaction. + // Since the transaction type may not be RYW, this method must take care to not rely on reading its own updates. + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +// This generated class is to be used only via updateRangeActor() + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +template + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +class UpdateRangeActorActorState { + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +public: + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + UpdateRangeActorActorState(KeyBackedRangeMap const& self,Transaction const& tr,KeyType const& begin,KeyType const& end,ValueType const& valueUpdate,bool const& replace) + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + : self(self), + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + tr(tr), + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + begin(begin), + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + end(end), + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + valueUpdate(valueUpdate), + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + replace(replace) + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + fdb_probe_actor_create("updateRangeActor", reinterpret_cast(this)); + + } + ~UpdateRangeActorActorState() + { + fdb_probe_actor_destroy("updateRangeActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange start {} to {} value {}\n", begin, end, valueUpdate); + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + StrictFuture> __when_expr_0 = self.kvMap.seekLessThan(tr, begin); + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~UpdateRangeActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional const& beginKV,int loopDepth) + { + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + rangeBegin = KeySelector::firstGreaterOrEqual(beginKV.present() ? beginKV->key : begin); + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + rangeEnd = KeySelector::firstGreaterThan(end); + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + readSize = BUGGIFY ? 1 : 100000; + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + boundariesFuture = self.kvMap.getRange(tr, rangeBegin, rangeEnd, GetRangeLimits(readSize)); + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + original = ValueType(); + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + previous = Optional(); + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + beginDone = false; + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + endFound = false; + #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ; + #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + loopDepth = a_body1cont1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont1(Optional && beginKV,int loopDepth) + { + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + rangeBegin = KeySelector::firstGreaterOrEqual(beginKV.present() ? beginKV->key : begin); + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + rangeEnd = KeySelector::firstGreaterThan(end); + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + readSize = BUGGIFY ? 1 : 100000; + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + boundariesFuture = self.kvMap.getRange(tr, rangeBegin, rangeEnd, GetRangeLimits(readSize)); + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + original = ValueType(); + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + previous = Optional(); + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + beginDone = false; + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + endFound = false; + #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ; + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + loopDepth = a_body1cont1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1when1(Optional const& beginKV,int loopDepth) + { + loopDepth = a_body1cont1(beginKV, loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && beginKV,int loopDepth) + { + loopDepth = a_body1cont1(std::move(beginKV), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< UpdateRangeActorActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< UpdateRangeActorActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("updateRangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateRangeActor", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< UpdateRangeActorActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("updateRangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateRangeActor", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< UpdateRangeActorActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("updateRangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateRangeActor", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange beginDone {} endFound {} previous {} default {}\n", beginDone, endFound, previous, ValueType()); + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (!beginDone) + #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ValueType val = replace ? valueUpdate : previous.orDefault(ValueType()).apply(valueUpdate); + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (previous != val) + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange set begin\n"); + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + self.kvMap.set(tr, begin, valueUpdate); + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + previous = val; + #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + } + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (!endFound && previous != original) + #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange set end\n"); + #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + self.kvMap.set(tr, end, original); + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~UpdateRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1(int loopDepth) + { + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange loop\n"); + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + StrictFuture __when_expr_1 = boundariesFuture; + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1break1(int loopDepth) + { + try { + return a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1loopBody1cont1(RangeResultType const& boundaries,int loopDepth) + { + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + for( auto const& bv : boundaries.results ) { + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange result key={} value={}\n", bv.first, bv.second); + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ASSERT(!endFound); + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + original = bv.second; + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (bv.first > begin) + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (!beginDone) + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange !beginDone\n"); + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ValueType val = replace ? valueUpdate : previous.orDefault(ValueType()).apply(valueUpdate); + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (previous != val) + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + self.kvMap.set(tr, begin, val); + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + previous = val; + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + beginDone = true; + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (bv.first < end) + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange Case C\n"); + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ValueType val = replace ? valueUpdate : bv.second.apply(valueUpdate); + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (previous == val) + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + self.kvMap.erase(tr, bv.first); + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + else + { + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + self.kvMap.set(tr, bv.first, val); + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + previous = val; + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + } + else + { + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (bv.first == end) + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange Case D\n"); + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (previous == bv.second) + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + self.kvMap.erase(tr, end); + #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + endFound = true; + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + } + } + else + { + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (bv.first == begin) + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange Case B\n"); + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ValueType val = replace ? valueUpdate : bv.second.apply(valueUpdate); + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (previous == val) + #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + self.kvMap.erase(tr, begin); + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + else + { + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + self.kvMap.set(tr, begin, val); + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + beginDone = true; + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + previous = val; + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + else + { + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange Case A\n"); + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + previous = bv.second; + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + } + } + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (!boundaries.more) + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ASSERT(!boundaries.results.empty()); + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + rangeBegin = KeySelector::firstGreaterThan(boundaries.results.back().first); + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + boundariesFuture = self.kvMap.getRange(tr, rangeBegin, rangeEnd, GetRangeLimits(readSize)); + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1cont1(RangeResultType && boundaries,int loopDepth) + { + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + for( auto const& bv : boundaries.results ) { + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange result key={} value={}\n", bv.first, bv.second); + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ASSERT(!endFound); + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + original = bv.second; + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (bv.first > begin) + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (!beginDone) + #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange !beginDone\n"); + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ValueType val = replace ? valueUpdate : previous.orDefault(ValueType()).apply(valueUpdate); + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (previous != val) + #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + self.kvMap.set(tr, begin, val); + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + previous = val; + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + beginDone = true; + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (bv.first < end) + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange Case C\n"); + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ValueType val = replace ? valueUpdate : bv.second.apply(valueUpdate); + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (previous == val) + #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + self.kvMap.erase(tr, bv.first); + #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + else + { + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + self.kvMap.set(tr, bv.first, val); + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + previous = val; + #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + } + else + { + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (bv.first == end) + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange Case D\n"); + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (previous == bv.second) + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + self.kvMap.erase(tr, end); + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + endFound = true; + #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + } + } + else + { + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (bv.first == begin) + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange Case B\n"); + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ValueType val = replace ? valueUpdate : bv.second.apply(valueUpdate); + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (previous == val) + #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + self.kvMap.erase(tr, begin); + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + else + { + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + self.kvMap.set(tr, begin, val); + #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + beginDone = true; + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + previous = val; + #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + else + { + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP updateRange Case A\n"); + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + previous = bv.second; + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + } + } + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (!boundaries.more) + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ASSERT(!boundaries.results.empty()); + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + rangeBegin = KeySelector::firstGreaterThan(boundaries.results.back().first); + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + boundariesFuture = self.kvMap.getRange(tr, rangeBegin, rangeEnd, GetRangeLimits(readSize)); + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1when1(RangeResultType const& boundaries,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont1(boundaries, loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1when1(RangeResultType && boundaries,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont1(std::move(boundaries), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< UpdateRangeActorActor, 1, RangeResultType >::remove(); + + } + void a_callback_fire(ActorCallback< UpdateRangeActorActor, 1, RangeResultType >*,RangeResultType const& value) + { + fdb_probe_actor_enter("updateRangeActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateRangeActor", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< UpdateRangeActorActor, 1, RangeResultType >*,RangeResultType && value) + { + fdb_probe_actor_enter("updateRangeActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateRangeActor", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< UpdateRangeActorActor, 1, RangeResultType >*,Error err) + { + fdb_probe_actor_enter("updateRangeActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateRangeActor", reinterpret_cast(this), 1); + + } + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + KeyBackedRangeMap self; + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + Transaction tr; + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + KeyType begin; + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + KeyType end; + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ValueType valueUpdate; + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + bool replace; + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + KeySelector rangeBegin; + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + KeySelector rangeEnd; + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + int readSize; + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + Future boundariesFuture; + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ValueType original; + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + Optional previous; + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + bool beginDone; + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + bool endFound; + #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +}; +// This generated class is to be used only via updateRangeActor() + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +template + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +class UpdateRangeActorActor final : public Actor, public ActorCallback< UpdateRangeActorActor, 0, Optional >, public ActorCallback< UpdateRangeActorActor, 1, RangeResultType >, public FastAllocated>, public UpdateRangeActorActorState> { + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< UpdateRangeActorActor, 0, Optional >; +friend struct ActorCallback< UpdateRangeActorActor, 1, RangeResultType >; + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + UpdateRangeActorActor(KeyBackedRangeMap const& self,Transaction const& tr,KeyType const& begin,KeyType const& end,ValueType const& valueUpdate,bool const& replace) + #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + : Actor(), + UpdateRangeActorActorState>(self, tr, begin, end, valueUpdate, replace) + { + fdb_probe_actor_enter("updateRangeActor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("updateRangeActor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("updateRangeActor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< UpdateRangeActorActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< UpdateRangeActorActor, 1, RangeResultType >*)0, actor_cancelled()); break; + } + + } +}; + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +template + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +[[nodiscard]] static Future updateRangeActor( KeyBackedRangeMap const& self, Transaction const& tr, KeyType const& begin, KeyType const& end, ValueType const& valueUpdate, bool const& replace ) { + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + return Future(new UpdateRangeActorActor(self, tr, begin, end, valueUpdate, replace)); + #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +} + +#line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + + template + Future updateRange(Transaction tr, + KeyType const& begin, + KeyType const& end, + ValueType const& valueUpdate, + bool replace = false) const { + if constexpr (is_transaction_creator) { + return runTransaction(tr, [=, self = *this](decltype(tr->createTransaction()) tr) { + return self.updateRange(tr, begin, end, valueUpdate, replace); + }); + } else { + return updateRangeActor(*this, tr, begin, end, valueUpdate, replace); + } + } + + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +// This generated class is to be used only via getSnapshotActor() + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +template + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +class GetSnapshotActorActorState { + #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +public: + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + GetSnapshotActorActorState(KeyBackedRangeMap const& self,Transaction const& tr,KeyType const& begin,KeyType const& end) + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + : self(self), + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + tr(tr), + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + begin(begin), + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + end(end) + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + fdb_probe_actor_create("getSnapshotActor", reinterpret_cast(this)); + + } + ~GetSnapshotActorActorState() + { + fdb_probe_actor_destroy("getSnapshotActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP snapshot start\n"); + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + StrictFuture> __when_expr_0 = self.kvMap.seekLessOrEqual(tr, begin); + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 1130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetSnapshotActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional const& beginKV,int loopDepth) + { + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + rangeBegin = KeySelector::firstGreaterOrEqual(beginKV.present() ? beginKV->key : begin); + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + rangeEnd = KeySelector::firstGreaterThan(end); + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + readSize = BUGGIFY ? 1 : 100000; + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + boundariesFuture = self.kvMap.getRange(tr, rangeBegin, rangeEnd, GetRangeLimits(readSize)); + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + result = makeReference(); + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ; + #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + loopDepth = a_body1cont1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont1(Optional && beginKV,int loopDepth) + { + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + rangeBegin = KeySelector::firstGreaterOrEqual(beginKV.present() ? beginKV->key : begin); + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + rangeEnd = KeySelector::firstGreaterThan(end); + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + readSize = BUGGIFY ? 1 : 100000; + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + boundariesFuture = self.kvMap.getRange(tr, rangeBegin, rangeEnd, GetRangeLimits(readSize)); + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + result = makeReference(); + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ; + #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + loopDepth = a_body1cont1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1when1(Optional const& beginKV,int loopDepth) + { + loopDepth = a_body1cont1(beginKV, loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && beginKV,int loopDepth) + { + loopDepth = a_body1cont1(std::move(beginKV), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetSnapshotActorActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< GetSnapshotActorActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("getSnapshotActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getSnapshotActor", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetSnapshotActorActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("getSnapshotActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getSnapshotActor", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetSnapshotActorActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("getSnapshotActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getSnapshotActor", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (result->map.empty() || result->map.begin()->first > begin) + #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + result->map[begin] = ValueType(); + #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (result->map.rbegin()->first < end) + #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + result->map[end] = ValueType(); + #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP snapshot end\n"); + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(result); this->~GetSnapshotActorActorState(); static_cast(this)->destroy(); return 0; } + #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(result)); // state_var_RVO + this->~GetSnapshotActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1(int loopDepth) + { + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + kbt_debug("RANGEMAP snapshot loop\n"); + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + StrictFuture __when_expr_1 = boundariesFuture; + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1break1(int loopDepth) + { + try { + return a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1loopBody1cont1(RangeResultType const& boundaries,int loopDepth) + { + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + for( auto const& bv : boundaries.results ) { + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + result->map[bv.first] = bv.second; + #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (!boundaries.more) + #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ASSERT(!boundaries.results.empty()); + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + rangeBegin = KeySelector::firstGreaterThan(boundaries.results.back().first); + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + boundariesFuture = self.kvMap.getRange(tr, rangeBegin, rangeEnd, GetRangeLimits(readSize)); + #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1cont1(RangeResultType && boundaries,int loopDepth) + { + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + for( auto const& bv : boundaries.results ) { + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + result->map[bv.first] = bv.second; + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + } + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + if (!boundaries.more) + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + { + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + ASSERT(!boundaries.results.empty()); + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + rangeBegin = KeySelector::firstGreaterThan(boundaries.results.back().first); + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + boundariesFuture = self.kvMap.getRange(tr, rangeBegin, rangeEnd, GetRangeLimits(readSize)); + #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1when1(RangeResultType const& boundaries,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont1(boundaries, loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1when1(RangeResultType && boundaries,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont1(std::move(boundaries), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetSnapshotActorActor, 1, RangeResultType >::remove(); + + } + void a_callback_fire(ActorCallback< GetSnapshotActorActor, 1, RangeResultType >*,RangeResultType const& value) + { + fdb_probe_actor_enter("getSnapshotActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getSnapshotActor", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetSnapshotActorActor, 1, RangeResultType >*,RangeResultType && value) + { + fdb_probe_actor_enter("getSnapshotActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getSnapshotActor", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetSnapshotActorActor, 1, RangeResultType >*,Error err) + { + fdb_probe_actor_enter("getSnapshotActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getSnapshotActor", reinterpret_cast(this), 1); + + } + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + KeyBackedRangeMap self; + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + Transaction tr; + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + KeyType begin; + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + KeyType end; + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + KeySelector rangeBegin; + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + KeySelector rangeEnd; + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + int readSize; + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + Future boundariesFuture; + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + Reference result; + #line 1449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +}; +// This generated class is to be used only via getSnapshotActor() + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +template + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +class GetSnapshotActorActor final : public Actor>, public ActorCallback< GetSnapshotActorActor, 0, Optional >, public ActorCallback< GetSnapshotActorActor, 1, RangeResultType >, public FastAllocated>, public GetSnapshotActorActorState> { + #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetSnapshotActorActor, 0, Optional >; +friend struct ActorCallback< GetSnapshotActorActor, 1, RangeResultType >; + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + GetSnapshotActorActor(KeyBackedRangeMap const& self,Transaction const& tr,KeyType const& begin,KeyType const& end) + #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" + : Actor>(), + GetSnapshotActorActorState>(self, tr, begin, end) + { + fdb_probe_actor_enter("getSnapshotActor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getSnapshotActor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getSnapshotActor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetSnapshotActorActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetSnapshotActorActor, 1, RangeResultType >*)0, actor_cancelled()); break; + } + + } +}; + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +template + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" +[[nodiscard]] static Future> getSnapshotActor( KeyBackedRangeMap const& self, Transaction const& tr, KeyType const& begin, KeyType const& end ) { + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + return Future>(new GetSnapshotActorActor(self, tr, begin, end)); + #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.g.h" +} + +#line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h" + + // Return a LocalSnapshot of all ranges from the map which cover the range of begin through end. + // If the map in the database does not have boundaries <=begin or >=end then these boundaries will be + // added to the returned snapshot with a default ValueType. + template + Future> getSnapshot(Transaction tr, KeyType const& begin, KeyType const& end) const { + if constexpr (is_transaction_creator) { + return runTransaction(tr, [=, self = *this](decltype(tr->createTransaction()) tr) { + return self.getSnapshot(tr, begin, end); + }); + } else { + return getSnapshotActor(*this, tr, begin, end); + } + } + +private: + Map kvMap; +}; + +#include "flow/unactorcompiler.h" + +#endif diff --git a/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h b/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h new file mode 100644 index 0000000..32cc2c6 --- /dev/null +++ b/src/fdbclient/include/fdbclient/KeyBackedRangeMap.actor.h @@ -0,0 +1,386 @@ +/* + * KeyBackedRangeMap.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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 + +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_KEYBACKEDRANGEMAP_ACTOR_G_H) +#define FDBCLIENT_KEYBACKEDRANGEMAP_ACTOR_G_H +#include "fdbclient/KeyBackedRangeMap.actor.g.h" +#elif !defined(FDBCLIENT_KEYBACKEDRANGEMAP_ACTOR_H) +#define FDBCLIENT_KEYBACKEDRANGEMAP_ACTOR_H + +#include "flow/FastRef.h" +#include "fdbclient/KeyBackedTypes.actor.h" +#include "flow/actorcompiler.h" // This must be the last #include. + +// A local in-memory representation of a KeyBackedRangeMap snapshot +// It is invalid to look up a range in this map which not within the range of +// [first key of snapshot, last key of snapshot) +// This is ReferenceCounted as it can be large and there is no reason to copy it as +// it should not be modified locally. +template +struct KeyRangeMapSnapshot : public ReferenceCounted> { + typedef std::map Map; + + // A default constructed map snapshot can't be used to look anything up because no ranges are covered. + KeyRangeMapSnapshot() {} + + // Initialize map with a single range from min to max with a given ValueType + KeyRangeMapSnapshot(const KeyType& min, const KeyType& max, const ValueType& val = {}) { + map[min] = val; + map[max] = val; + } + + struct RangeValue { + TypedRange range; + ValueType value; + }; + + // Iterator for ranges in the map. Ranges are represented by a key, its value, and the next key in the map. + struct RangeIter { + typename Map::const_iterator impl; + + using iterator_category = std::bidirectional_iterator_tag; + using value_type = RangeIter; + using pointer = RangeIter*; + using reference = RangeIter&; + + TypedRange range() const { return { impl->first, std::next(impl)->first }; } + const ValueType& value() const { return impl->second; } + + const RangeIter& operator*() const { return *this; } + const RangeIter* operator->() const { return this; } + + RangeIter operator++(int) { return { impl++ }; } + RangeIter operator--(int) { return { impl-- }; } + RangeIter& operator++() { + ++impl; + return *this; + } + RangeIter& operator--() { + --impl; + return *this; + } + + bool operator==(const RangeIter& rhs) const { return impl == rhs.impl; } + bool operator!=(const RangeIter& rhs) const { return impl != rhs.impl; } + }; + + // Range-for compatible object representing a list of contiguous ranges. + struct Ranges { + RangeIter iBegin, iEnd; + RangeIter begin() const { return iBegin; } + RangeIter end() const { return iEnd; } + }; + + RangeIter rangeContaining(const KeyType& begin) const { + ASSERT(map.size() >= 2); + auto i = map.upper_bound(begin); + ASSERT(i != map.begin()); + ASSERT(i != map.end()); + return { --i }; + } + + // Get a set of Ranges which cover [begin, end) + Ranges intersectingRanges(const KeyType& begin, const KeyType& end) const { + return { rangeContaining(begin), { map.lower_bound(end) } }; + } + + Ranges ranges() const { return { { map.begin() }, { std::prev(map.end()) } }; } + + Map map; +}; + +// KeyBackedKeyRangeMap is similar to KeyRangeMap but without a Metric +// It is assumed that any range not covered by the map is set to a default ValueType() +// The ValueType must have +// // Return a copy of *this updated with properties in value +// ValueType apply(ValueType const& value) const; +// +// // Return true if the two values are identical in meaning so adjacent ranges using either value can be merged +// bool operator==(ValueType const& value) const; +// For debug output, KeyType and ValueType must both be supported by fmt::formatter<> +template , + typename ValueCodec = TupleCodec> +class KeyBackedRangeMap { +public: + typedef KeyBackedMap Map; + typedef typename Map::KeySelector KeySelector; + typedef typename Map::RangeResultType RangeResultType; + typedef KeyRangeMapSnapshot LocalSnapshot; + typedef typename LocalSnapshot::RangeValue RangeValue; + + KeyBackedRangeMap(KeyRef prefix = invalidKey, Optional trigger = {}, ValueCodec valueCodec = {}) + : kvMap(prefix, trigger, valueCodec) {} + + // Get the RangeValue for the range that contains key, if there is a begin and end in the map which contain key + ACTOR template + static Future> getRangeForKey(KeyBackedRangeMap self, + Transaction tr, + KeyType key, + Snapshot snapshot = Snapshot::False) { + state Future> begin = self.kvMap.seekLessOrEqual(tr, key, snapshot); + state Future> end = self.kvMap.seekGreaterThan(tr, key, snapshot); + wait(success(begin) && success(end)); + + if (begin.get().present() && end.get().present()) { + return RangeValue{ { begin.get()->key, end.get()->key }, begin.get()->value }; + } + return Optional(); + } + + template + Future> getRangeForKey(Transaction tr, + KeyType const& key, + Snapshot snapshot = Snapshot::False) const { + return getRangeForKey(*this, tr, key, snapshot); + } + + // Update the range from begin to end by either applying valueUpdate to it, or if replace is true then replace + // the the range with the given value. + // Adjacent ranges that are identical will be coalesced in the update transaction. + // Since the transaction type may not be RYW, this method must take care to not rely on reading its own updates. + ACTOR template + static Future updateRangeActor(KeyBackedRangeMap self, + Transaction tr, + KeyType begin, + KeyType end, + ValueType valueUpdate, + bool replace) { + kbt_debug("RANGEMAP updateRange start {} to {} value {}\n", begin, end, valueUpdate); + + // In order to update and coalsce the range, we need all range boundaries from + // lastLessThan(begin) inclusive + // through + // firstGreaterOrEqual(end) inclusive, which is firstGreaterThan(end) exclusive + // so we can + // - compare each modified range boundary to the previous boundary to see if the modified boundary + // can be removed, which is the case if its value matches the previous boundary's value + // - compare the boundary after the last modified boundary to see if it can be removed because + // its value matches the last modified boundary's value + Optional beginKV = wait(self.kvMap.seekLessThan(tr, begin)); + state KeySelector rangeBegin = KeySelector::firstGreaterOrEqual(beginKV.present() ? beginKV->key : begin); + + // rangeEnd is past end so the result will include end if it exists + state KeySelector rangeEnd = KeySelector::firstGreaterThan(end); + + state int readSize = BUGGIFY ? 1 : 100000; + state Future boundariesFuture = + self.kvMap.getRange(tr, rangeBegin, rangeEnd, GetRangeLimits(readSize)); + + // As we walk through the range boundaries, keep two values about the last visited boundary + state ValueType original; // value prior to modification + state Optional previous; // value after modification + // Indicates that begin has been either seen/updated or created. + state bool beginDone = false; + // Indicates that end was found + state bool endFound = false; + + // The results will contain + // A) 0 or 1 key < begin Use this to initialize previous. + // B) 0 or 1 key == begin Create/update this value if it doesn't exist. + // Possibly delete it if update matches previous range. + // C) >=0 keys > begin and < end Update these, delete if they match previous + // D) 0 or 1 key == end. Delete this key if it matches previous. Set to default if it doesn't exist. + loop { + kbt_debug("RANGEMAP updateRange loop\n"); + RangeResultType boundaries = wait(boundariesFuture); + for (auto const& bv : boundaries.results) { + kbt_debug("RANGEMAP updateRange result key={} value={}\n", bv.first, bv.second); + // Should never see a result past the end key + ASSERT(!endFound); + + original = bv.second; + + if (bv.first > begin) { + if (!beginDone) { + kbt_debug("RANGEMAP updateRange !beginDone\n"); + // Begin was not found and we've passed it. + ValueType val = replace ? valueUpdate : previous.orDefault(ValueType()).apply(valueUpdate); + // Set begin if the new val is different from the previous range value if it exists + if (previous != val) { + self.kvMap.set(tr, begin, val); + previous = val; + } + beginDone = true; + } + if (bv.first < end) { + // Case C + kbt_debug("RANGEMAP updateRange Case C\n"); + ValueType val = replace ? valueUpdate : bv.second.apply(valueUpdate); + if (previous == val) { + self.kvMap.erase(tr, bv.first); + } else { + self.kvMap.set(tr, bv.first, val); + previous = val; + } + } else { + if (bv.first == end) { + // Case D + kbt_debug("RANGEMAP updateRange Case D\n"); + if (previous == bv.second) { + self.kvMap.erase(tr, end); + } + endFound = true; + } + } + } else if (bv.first == begin) { + // Case B + kbt_debug("RANGEMAP updateRange Case B\n"); + ValueType val = replace ? valueUpdate : bv.second.apply(valueUpdate); + if (previous == val) { + self.kvMap.erase(tr, begin); + } else { + self.kvMap.set(tr, begin, val); + } + beginDone = true; + previous = val; + } else { + // Case A + kbt_debug("RANGEMAP updateRange Case A\n"); + previous = bv.second; + } + } + if (!boundaries.more) { + break; + } + ASSERT(!boundaries.results.empty()); + + // Continue reading starting from the first key after the last key read. + rangeBegin = KeySelector::firstGreaterThan(boundaries.results.back().first); + boundariesFuture = self.kvMap.getRange(tr, rangeBegin, rangeEnd, GetRangeLimits(readSize)); + } + + kbt_debug("RANGEMAP updateRange beginDone {} endFound {} previous {} default {}\n", + beginDone, + endFound, + previous, + ValueType()); + + // If begin was never found or passed/created + if (!beginDone) { + ValueType val = replace ? valueUpdate : previous.orDefault(ValueType()).apply(valueUpdate); + if (previous != val) { + kbt_debug("RANGEMAP updateRange set begin\n"); + self.kvMap.set(tr, begin, valueUpdate); + previous = val; + } + } + + // If end was not found, we may need to set it to restore the value of the range that begin-end has split. + // The value that the range starting at end should have is in original, the unmodified value of the last + // range boundary visited. If the previous range value leading up to end is not the same as original, then + // set end to original to restore the range >= end to what it was before this update. + if (!endFound && previous != original) { + kbt_debug("RANGEMAP updateRange set end\n"); + self.kvMap.set(tr, end, original); + } + + return Void(); + } + + template + Future updateRange(Transaction tr, + KeyType const& begin, + KeyType const& end, + ValueType const& valueUpdate, + bool replace = false) const { + if constexpr (is_transaction_creator) { + return runTransaction(tr, [=, self = *this](decltype(tr->createTransaction()) tr) { + return self.updateRange(tr, begin, end, valueUpdate, replace); + }); + } else { + return updateRangeActor(*this, tr, begin, end, valueUpdate, replace); + } + } + + ACTOR template + static Future> getSnapshotActor(KeyBackedRangeMap self, + Transaction tr, + KeyType begin, + KeyType end) { + kbt_debug("RANGEMAP snapshot start\n"); + + // The range read should start at KeySelector::lastLessOrEqual(begin) to get the range which covers begin. + // However this could touch a key outside of the map subspace which can lead to various errors. + // Use seekLessOrEqual() to find a begin key safely. + Optional beginKV = wait(self.kvMap.seekLessOrEqual(tr, begin)); + state KeySelector rangeBegin = KeySelector::firstGreaterOrEqual(beginKV.present() ? beginKV->key : begin); + + // rangeEnd is past end so the result will include end if it exists + state KeySelector rangeEnd = KeySelector::firstGreaterThan(end); + + state int readSize = BUGGIFY ? 1 : 100000; + state Future boundariesFuture = + self.kvMap.getRange(tr, rangeBegin, rangeEnd, GetRangeLimits(readSize)); + + state Reference result = makeReference(); + loop { + kbt_debug("RANGEMAP snapshot loop\n"); + RangeResultType boundaries = wait(boundariesFuture); + for (auto const& bv : boundaries.results) { + result->map[bv.first] = bv.second; + } + if (!boundaries.more) { + break; + } + ASSERT(!boundaries.results.empty()); + + // Continue reading starting from the first key after the last key read. + rangeBegin = KeySelector::firstGreaterThan(boundaries.results.back().first); + boundariesFuture = self.kvMap.getRange(tr, rangeBegin, rangeEnd, GetRangeLimits(readSize)); + } + + // LocalSnapshot requires initialization of the widest range it will be queried with, so we must ensure that has + // been done now. If the map does not start at or before begin then add begin with a default value type + if (result->map.empty() || result->map.begin()->first > begin) { + result->map[begin] = ValueType(); + } + // The map is no longer empty, so if the last key is not >= end then add end with a default value type + if (result->map.rbegin()->first < end) { + result->map[end] = ValueType(); + } + + kbt_debug("RANGEMAP snapshot end\n"); + return result; + } + + // Return a LocalSnapshot of all ranges from the map which cover the range of begin through end. + // If the map in the database does not have boundaries <=begin or >=end then these boundaries will be + // added to the returned snapshot with a default ValueType. + template + Future> getSnapshot(Transaction tr, KeyType const& begin, KeyType const& end) const { + if constexpr (is_transaction_creator) { + return runTransaction(tr, [=, self = *this](decltype(tr->createTransaction()) tr) { + return self.getSnapshot(tr, begin, end); + }); + } else { + return getSnapshotActor(*this, tr, begin, end); + } + } + +private: + Map kvMap; +}; + +#include "flow/unactorcompiler.h" + +#endif diff --git a/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h b/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h new file mode 100644 index 0000000..01a79d4 --- /dev/null +++ b/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h @@ -0,0 +1,2799 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +/* + * KeyBackedTypes.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 + +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_KEYBACKEDTYPES_ACTOR_G_H) +#define FDBCLIENT_KEYBACKEDTYPES_ACTOR_G_H +#include "fdbclient/KeyBackedTypes.actor.g.h" +#elif !defined(FDBCLIENT_KEYBACKEDTYPES_ACTOR_H) +#define FDBCLIENT_KEYBACKEDTYPES_ACTOR_H + +#include +#include +#include + +#include "fdbclient/ClientBooleanParams.h" +#include "fdbclient/CommitTransaction.h" +#include "fdbclient/RunTransaction.actor.h" +#include "fdbclient/FDBOptions.g.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/GenericTransactionHelper.h" +#include "fdbclient/Subspace.h" +#include "flow/ObjectSerializer.h" +#include "flow/Platform.h" +#include "flow/genericactors.actor.h" +#include "flow/serialize.h" +#include "flow/ThreadHelper.actor.h" + +#include "flow/actorcompiler.h" // This must be the last #include. + +#define KEYBACKEDTYPES_DEBUG 0 +#if KEYBACKEDTYPES_DEBUG || !defined(NO_INTELLISENSE) +#define kbt_debug fmt::print +#else +#define kbt_debug(...) +#endif + +// TupleCodec is a utility struct to convert a type to and from a value using Tuple encoding. +// It is used by the template classes below like KeyBackedProperty and KeyBackedMap to convert +// key parts and values from various types to Value strings and back. +// New types can be supported either by writing a new specialization or adding these +// methods to the type so that the default specialization can be used: +// static T T::unpack(Standalone const& val) +// Standalone T::pack(T const& val) const +// Since TupleCodec is a struct, partial specialization can be used, such as the std::pair +// partial specialization below allowing any std::pair where T1 and T2 are already +// supported by TupleCodec. +template +struct TupleCodec { + static inline Standalone pack(T const& val) { return val.pack().pack(); } + static inline T unpack(Standalone const& val) { return T::unpack(Tuple::unpack(val)); } +}; + +// If T is Tuple then conversion is simple. +template <> +inline Standalone TupleCodec::pack(Tuple const& val) { + return val.pack(); +} +template <> +inline Tuple TupleCodec::unpack(Standalone const& val) { + return Tuple::unpack(val); +} + +template <> +inline Standalone TupleCodec::pack(int64_t const& val) { + return Tuple::makeTuple(val).pack(); +} +template <> +inline int64_t TupleCodec::unpack(Standalone const& val) { + return Tuple::unpack(val).getInt(0); +} + +template <> +inline Standalone TupleCodec::pack(bool const& val) { + return Tuple::makeTuple(val ? 1 : 0).pack(); +} +template <> +inline bool TupleCodec::unpack(Standalone const& val) { + return Tuple::unpack(val).getInt(0) == 1; +} + +template <> +inline Standalone TupleCodec>::pack(Standalone const& val) { + return Tuple::makeTuple(val).pack(); +} +template <> +inline Standalone TupleCodec>::unpack(Standalone const& val) { + return Tuple::unpack(val).getString(0); +} + +template <> +inline Standalone TupleCodec::pack(UID const& val) { + return TupleCodec>::pack(BinaryWriter::toValue(val, Unversioned())); +} +template <> +inline UID TupleCodec::unpack(Standalone const& val) { + return BinaryReader::fromStringRef(TupleCodec>::unpack(val), Unversioned()); +} + +// This is backward compatible with TupleCodec> +template <> +inline Standalone TupleCodec::pack(std::string const& val) { + return Tuple::makeTuple(val).pack(); +} +template <> +inline std::string TupleCodec::unpack(Standalone const& val) { + return Tuple::unpack(val).getString(0).toString(); +} + +// Partial specialization to cover all std::pairs as long as the component types are TupleCodec compatible +template +struct TupleCodec> { + static Standalone pack(typename std::pair const& val) { + // Packing a concatenated tuple is the same as concatenating two packed tuples + return TupleCodec::pack(val.first).withSuffix(TupleCodec::pack(val.second)); + } + static std::pair unpack(Standalone const& val) { + Tuple t = Tuple::unpack(val); + ASSERT(t.size() == 2); + return { TupleCodec::unpack(t.subTupleRawString(0)), + TupleCodec::unpack(t.subTupleRawString(1)) }; + } +}; + +template +struct TupleCodec> { + static Standalone pack(typename std::vector const& val) { + Tuple t; + for (T item : val) { + // fdbclient doesn't support nested tuples yet. For now, flatten the tuple into StringRef + t.append(TupleCodec::pack(item)); + } + return t.pack(); + } + + static std::vector unpack(Standalone const& val) { + Tuple t = Tuple::unpack(val); + std::vector v; + + for (int i = 0; i < t.size(); i++) { + v.push_back(TupleCodec::unpack(t.getString(i))); + } + + return v; + } +}; + +template <> +inline Standalone TupleCodec::pack(KeyRange const& val) { + return Tuple::makeTuple(val.begin, val.end).pack(); +} +template <> +inline KeyRange TupleCodec::unpack(Standalone const& val) { + Tuple t = Tuple::unpack(val); + return KeyRangeRef(t.getString(0), t.getString(1)); +} + +struct NullCodec { + static Standalone pack(Standalone val) { return val; } + static Standalone unpack(Standalone val) { return val; } +}; + +template +struct BinaryCodec { + static Standalone pack(T val) { return BinaryWriter::toValue(val, Unversioned()); } + static T unpack(Standalone val) { return BinaryReader::fromStringRef(val, Unversioned()); } +}; + +// Codec for using Flatbuffer compatible types via ObjectWriter/ObjectReader +template +struct ObjectCodec { + ObjectCodec(VersionOptions vo) : vo(vo) {} + VersionOptions vo; + + inline Standalone pack(T const& val) const { return ObjectWriter::toValue(val, vo); } + inline T unpack(Standalone const& val) const { return ObjectReader::fromStringRef(val, vo); } +}; + +template +struct KeyBackedRangeResult { + std::vector results; + bool more; + + bool operator==(KeyBackedRangeResult const& other) const { return results == other.results && more == other.more; } + bool operator!=(KeyBackedRangeResult const& other) const { return !(*this == other); } +}; + +class WatchableTrigger { +private: + Key key; + +public: + WatchableTrigger(Key k) : key(k) {} + + template + void update(Transaction tr, AddConflictRange conflict = AddConflictRange::False) { + std::array value; + value.fill(0); + tr->atomicOp(key, StringRef(value.data(), value.size()), MutationRef::SetVersionstampedValue); + if (conflict) { + tr->addReadConflictRange(singleKeyRange(key)); + } + } + + template + Future> get(Transaction tr, Snapshot snapshot = Snapshot::False) const { + typename transaction_future_type>::type getFuture = tr->get(key, snapshot); + + return holdWhile( + getFuture, + map(safeThreadFutureToFuture(getFuture), [](Optional const& val) -> Optional { + if (val.present()) { + return BinaryReader::fromStringRef(*val, Unversioned()); + } + return {}; + })); + } + + template + Future watch(Transaction tr) const { + typename transaction_future_type::type watchFuture = tr->watch(key); + return holdWhile(watchFuture, safeThreadFutureToFuture(watchFuture)); + } + +// Forward declaration of this static template actor does not work correctly, so this actor is forward declared +// in a way that works for both compiling and in IDEs. +#if defined(NO_INTELLISENSE) + template + static Future onChangeActor(WatchableTrigger const& self, + Reference const& db, + Optional const& initialVersion, + Promise const& watching); +#else + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +[[nodiscard]] static Future onChangeActor( WatchableTrigger const& self, Reference const& db, Optional const& initialVersion, Promise const& watching ); +template friend class WatchableTrigger_OnChangeActorActorState; + +#line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +#endif + + // Watch the trigger until it changes. The result will be ready when it is observed that the trigger value's + // version is greater than initialVersion, and the observed trigger value version will be returned. + // + // If initialVersion is not present it will be initialized internally to the first read version successfully + // obtained from the db. + // + // initialVersion can be thought of as a "last known version" but it could also be used to indiciate some future + // version after which you want to be notifified if the trigger's value changes. + // + // If watching can be set, the initialized value of initialVersion will be sent to it once known. + template + Future onChange(Reference db, + Optional initialVersion = {}, + Promise watching = {}) const { + return onChangeActor(*this, db, initialVersion, watching); + } +}; + + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +// This generated class is to be used only via onChangeActor() + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +class WatchableTrigger_OnChangeActorActorState { + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +public: + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + WatchableTrigger_OnChangeActorActorState(WatchableTrigger const& self,Reference const& db,Optional const& initialVersion,Promise const& watching) + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + : self(self), + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + db(db), + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + initialVersion(initialVersion), + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + watching(watching), + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + tr(db->createTransaction()) + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + fdb_probe_actor_create("onChangeActor", reinterpret_cast(this)); + + } + ~WatchableTrigger_OnChangeActorActorState() + { + fdb_probe_actor_destroy("onChangeActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ; + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~WatchableTrigger_OnChangeActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if constexpr (can_set_transaction_options) + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + db->setOptions(tr); + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + try { + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!initialVersion.present()) + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + StrictFuture __when_expr_0 = store(initialVersion, safeThreadFutureToFuture(tr->getReadVersion())); + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont3(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + StrictFuture __when_expr_4 = safeThreadFutureToFuture(tr->onError(e)); + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont3(int loopDepth) + { + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (watching.canBeSet()) + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + watching.send(*initialVersion); + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + StrictFuture> __when_expr_1 = self.get(tr); + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont4(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WatchableTrigger_OnChangeActorActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WatchableTrigger_OnChangeActorActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< WatchableTrigger_OnChangeActorActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< WatchableTrigger_OnChangeActorActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont5(Optional const& currentVal,int loopDepth) + { + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (currentVal.present() && currentVal->version > *initialVersion) + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(currentVal->version); this->~WatchableTrigger_OnChangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + new (&static_cast(this)->SAV< Version >::value()) Version(currentVal->version); + this->~WatchableTrigger_OnChangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + watch = self.watch(tr); + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->commit()); + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont5(Optional && currentVal,int loopDepth) + { + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (currentVal.present() && currentVal->version > *initialVersion) + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(currentVal->version); this->~WatchableTrigger_OnChangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + new (&static_cast(this)->SAV< Version >::value()) Version(currentVal->version); + this->~WatchableTrigger_OnChangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + watch = self.watch(tr); + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->commit()); + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3when1(Optional const& currentVal,int loopDepth) + { + loopDepth = a_body1loopBody1cont5(currentVal, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Optional && currentVal,int loopDepth) + { + loopDepth = a_body1loopBody1cont5(std::move(currentVal), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WatchableTrigger_OnChangeActorActor, 1, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< WatchableTrigger_OnChangeActorActor, 1, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< WatchableTrigger_OnChangeActorActor, 1, Optional >*,Optional && value) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< WatchableTrigger_OnChangeActorActor, 1, Optional >*,Error err) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont7(Void const& _,int loopDepth) + { + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + StrictFuture __when_expr_3 = watch; + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont7when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont7(Void && _,int loopDepth) + { + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + StrictFuture __when_expr_3 = watch; + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont7when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont5when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont7(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont7(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WatchableTrigger_OnChangeActorActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WatchableTrigger_OnChangeActorActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont5when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< WatchableTrigger_OnChangeActorActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont5when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< WatchableTrigger_OnChangeActorActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 2); + + } + int a_body1loopBody1cont9(Void const& _,int loopDepth) + { + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + tr->reset(); + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = a_body1loopBody1cont11(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont9(Void && _,int loopDepth) + { + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + tr->reset(); + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = a_body1loopBody1cont11(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont7when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont9(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont7when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont9(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WatchableTrigger_OnChangeActorActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WatchableTrigger_OnChangeActorActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont7when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< WatchableTrigger_OnChangeActorActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont7when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< WatchableTrigger_OnChangeActorActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 3); + + } + int a_body1loopBody1cont11(int loopDepth) + { + try { + loopDepth = a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WatchableTrigger_OnChangeActorActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WatchableTrigger_OnChangeActorActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< WatchableTrigger_OnChangeActorActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< WatchableTrigger_OnChangeActorActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), 4); + + } + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + WatchableTrigger self; + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Reference db; + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Optional initialVersion; + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Promise watching; + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Reference tr; + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Future watch; + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +}; +// This generated class is to be used only via onChangeActor() + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +class WatchableTrigger_OnChangeActorActor final : public Actor, public ActorCallback< WatchableTrigger_OnChangeActorActor, 0, Void >, public ActorCallback< WatchableTrigger_OnChangeActorActor, 1, Optional >, public ActorCallback< WatchableTrigger_OnChangeActorActor, 2, Void >, public ActorCallback< WatchableTrigger_OnChangeActorActor, 3, Void >, public ActorCallback< WatchableTrigger_OnChangeActorActor, 4, Void >, public FastAllocated>, public WatchableTrigger_OnChangeActorActorState> { + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< WatchableTrigger_OnChangeActorActor, 0, Void >; +friend struct ActorCallback< WatchableTrigger_OnChangeActorActor, 1, Optional >; +friend struct ActorCallback< WatchableTrigger_OnChangeActorActor, 2, Void >; +friend struct ActorCallback< WatchableTrigger_OnChangeActorActor, 3, Void >; +friend struct ActorCallback< WatchableTrigger_OnChangeActorActor, 4, Void >; + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + WatchableTrigger_OnChangeActorActor(WatchableTrigger const& self,Reference const& db,Optional const& initialVersion,Promise const& watching) + #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + : Actor(), + WatchableTrigger_OnChangeActorActorState>(self, db, initialVersion, watching) + { + fdb_probe_actor_enter("onChangeActor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("onChangeActor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("onChangeActor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< WatchableTrigger_OnChangeActorActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WatchableTrigger_OnChangeActorActor, 1, Optional >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< WatchableTrigger_OnChangeActorActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< WatchableTrigger_OnChangeActorActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< WatchableTrigger_OnChangeActorActor, 4, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +[[nodiscard]] Future WatchableTrigger::onChangeActor( WatchableTrigger const& self, Reference const& db, Optional const& initialVersion, Promise const& watching ) { + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + return Future(new WatchableTrigger_OnChangeActorActor(self, db, initialVersion, watching)); + #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +} + +#line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + +// Convenient read/write access to a single value of type T stored at key +// Even though 'this' is not actually mutated, methods that change the db key are not const. +template > +class KeyBackedProperty { +public: + KeyBackedProperty(KeyRef key = invalidKey, Optional trigger = {}, Codec codec = {}) + : key(key), trigger(trigger), codec(codec) {} + + template + Future> get(Transaction tr, Snapshot snapshot = Snapshot::False) const { + + if constexpr (is_transaction_creator) { + return runTransaction(tr, [=, self = *this](decltype(tr->createTransaction()) tr) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + return self.get(tr, snapshot); + }); + } else { + typename transaction_future_type>::type getFuture = tr->get(key, snapshot); + + return holdWhile( + getFuture, + map(safeThreadFutureToFuture(getFuture), [codec = codec](Optional const& val) -> Optional { + if (val.present()) + return codec.unpack(val.get()); + return {}; + })); + } + } + + // Get property's value or defaultValue if it doesn't exist + template + Future getD(Transaction tr, Snapshot snapshot = Snapshot::False, T defaultValue = T()) const { + if constexpr (is_transaction_creator) { + return runTransaction(tr, [=, self = *this](decltype(tr->createTransaction()) tr) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + return self.getD(tr, snapshot, defaultValue); + }); + } else { + return map(get(tr, snapshot), + [=](Optional val) -> T { return val.present() ? val.get() : defaultValue; }); + } + } + + // Get property's value or throw error if it doesn't exist + template + Future getOrThrow(Transaction tr, Snapshot snapshot = Snapshot::False, Error err = key_not_found()) const { + if constexpr (is_transaction_creator) { + return runTransaction(tr, [=, self = *this](decltype(tr->createTransaction()) tr) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + return self.getOrThrow(tr, snapshot, err); + }); + } else { + return map(get(tr, snapshot), [=](Optional val) -> T { + if (!val.present()) { + throw err; + } + + return val.get(); + }); + } + } + + template + void set(Transaction tr, T const& val) { + if constexpr (is_transaction_creator) { + return runTransaction(tr, [=, self = *this](decltype(tr->createTransaction()) tr) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + return self.set(tr, val); + }); + } else { + tr->set(key, packValue(val)); + if (trigger.present()) { + trigger->update(tr); + } + } + } + + template + void clear(Transaction tr) { + if constexpr (is_transaction_creator) { + return runTransaction(tr, [=, self = *this](decltype(tr->createTransaction()) tr) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + return self.clear(tr); + }); + } else { + tr->clear(key); + if (trigger.present()) { + trigger->update(tr); + } + } + } + + template + Future watch(Transaction tr) { + return tr->watch(key); + } + + Value packValue(T const& value) const { return codec.pack(value); } + T unpackValue(ValueRef const& value) const { return codec.unpack(value); } + + Key key; + Optional trigger; + Codec codec; +}; + +// KeyBackedObjectProperty is a convenience wrapper of KeyBackedProperty which uses ObjectCodec as +// the codec +template +class KeyBackedObjectProperty : public KeyBackedProperty> { + typedef ObjectCodec TCodec; + typedef KeyBackedProperty Base; + +public: + KeyBackedObjectProperty(KeyRef key, VersionOptions vo, Optional trigger = {}) + : Base(key, trigger, TCodec(vo)) {} +}; + +// KeyBackedBinaryValue is a convenience wrapper of KeyBackedProperty but using BinaryCodec as the codec and adds +// atomic ops and version stamp operations. +template +class KeyBackedBinaryValue : public KeyBackedProperty> { + typedef KeyBackedProperty> Base; + +public: + KeyBackedBinaryValue(KeyRef key = invalidKey, Optional trigger = {}) : Base(key, trigger) {} + + template + void atomicOp(Transaction tr, T const& val, MutationRef::Type type) { + tr->atomicOp(this->key, BinaryWriter::toValue(val, Unversioned()), type); + if (this->trigger.present()) { + this->trigger->update(tr); + } + } + + template + void setVersionstamp(Transaction tr, T const& val, int offset) { + tr->atomicOp( + this->key, + BinaryWriter::toValue(val, Unversioned()).withSuffix(StringRef(reinterpret_cast(&offset), 4)), + MutationRef::SetVersionstampedValue); + if (this->trigger.present()) { + this->trigger->update(tr); + } + } +}; + +template +struct TypedKVPair { + KeyType key; + ValueType value; +}; + +template +struct TypedRange { + KeyType begin; + KeyType end; +}; + +template +struct TypedKeySelector { + KeyType key; + bool orEqual; + int offset; + + TypedKeySelector operator+(int delta) { return { key, orEqual, offset + delta }; } + + TypedKeySelector operator-(int delta) { return { key, orEqual, offset - delta }; } + + KeySelector pack(const KeyRef& prefix) const { + Key packed = KeyCodec::pack(key).withPrefix(prefix); + return KeySelector(KeySelectorRef(packed, orEqual, offset), packed.arena()); + } + + static TypedKeySelector lastLessThan(const KeyType& k) { return { k, false, 0 }; } + + static TypedKeySelector lastLessOrEqual(const KeyType& k) { return { k, true, 0 }; } + + static TypedKeySelector firstGreaterThan(const KeyType& k) { return { k, true, +1 }; } + + static TypedKeySelector firstGreaterOrEqual(const KeyType& k) { return { k, false, +1 }; } +}; + +// Convenient read/write access to a sorted map of KeyType to ValueType under prefix +// Even though 'this' is not actually mutated, methods that change db keys are not const. +template , + typename ValueCodec = TupleCodec<_ValueType>> +class KeyBackedMap { +public: + KeyBackedMap(KeyRef prefix = invalidKey, Optional trigger = {}, ValueCodec valueCodec = {}) + : subspace(prefixRange(prefix)), trigger(trigger), valueCodec(valueCodec) {} + + typedef _KeyType KeyType; + typedef _ValueType ValueType; + typedef std::pair PairType; + typedef KeyBackedRangeResult RangeResultType; + typedef TypedKVPair KVType; + typedef KeyBackedProperty SingleRecordProperty; + typedef TypedKeySelector KeySelector; + + // If end is not present one key past the end of the map is used. + template + Future getRange(Transaction tr, + Optional const& begin, + Optional const& end, + int limit, + Snapshot snapshot = Snapshot::False, + Reverse reverse = Reverse::False) const { + Key beginKey = begin.present() ? packKey(begin.get()) : subspace.begin; + Key endKey = end.present() ? packKey(end.get()) : subspace.end; + + typename transaction_future_type::type getRangeFuture = + tr->getRange(KeyRangeRef(beginKey, endKey), GetRangeLimits(limit), snapshot, reverse); + + return holdWhile( + getRangeFuture, + map(safeThreadFutureToFuture(getRangeFuture), + [prefix = subspace.begin, valueCodec = valueCodec](RangeResult const& kvs) -> RangeResultType { + RangeResultType rangeResult; + for (int i = 0; i < kvs.size(); ++i) { + KeyType key = KeyCodec::unpack(kvs[i].key.removePrefix(prefix)); + ValueType val = valueCodec.unpack(kvs[i].value); + rangeResult.results.push_back(PairType(key, val)); + } + rangeResult.more = kvs.more; + return rangeResult; + })); + } + + #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +// This generated class is to be used only via getRangeActor() + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +class GetRangeActorActorState { + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +public: + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + GetRangeActorActorState(KeyBackedMap const& self,Transaction const& tr,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Snapshot const& snapshot,Reverse const& reverse) + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + : self(self), + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + tr(tr), + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + begin(begin), + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + end(end), + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + limits(limits), + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + snapshot(snapshot), + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + reverse(reverse) + #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + fdb_probe_actor_create("getRangeActor", reinterpret_cast(this)); + + } + ~GetRangeActorActorState() + { + fdb_probe_actor_destroy("getRangeActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + kbt_debug("MAP GETRANGE KeySelectors {} - {}\n", begin.pack(self.subspace.begin).toString(), end.pack(self.subspace.begin).toString()); + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ksBegin = begin.pack(self.subspace.begin); + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ksEnd = end.pack(self.subspace.begin); + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + getRangeFuture = tr->getRange(ksBegin, ksEnd, limits, snapshot, reverse); + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + rangeResult = RangeResultType(); + #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ; + #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetRangeActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(rangeResult); this->~GetRangeActorActorState(); static_cast(this)->destroy(); return 0; } + #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + new (&static_cast(this)->SAV< RangeResultType >::value()) RangeResultType(std::move(rangeResult)); // state_var_RVO + this->~GetRangeActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + StrictFuture __when_expr_0 = safeThreadFutureToFuture(getRangeFuture); + #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(RangeResult const& kvs,int loopDepth) + { + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + kbt_debug("MAP GETRANGE KeySelectors {} - {} results={} more={}\n", begin.pack(self.subspace.begin).toString(), end.pack(self.subspace.begin).toString(), kvs.size(), kvs.more); + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + for( auto const& kv : kvs ) { + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + kbt_debug(" {} -> {}\n", kv.key.printable(), kv.value.printable()); + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (self.subspace.contains(kv.key)) + #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + KeyType key = self.unpackKey(kv.key); + #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ValueType val = self.unpackValue(kv.value); + #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + rangeResult.results.push_back(PairType(key, val)); + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + } + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!kvs.more) + #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!rangeResult.results.empty()) + #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + rangeResult.more = self.subspace.contains(kvs.back().key); + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (reverse) + #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ksEnd = ::firstGreaterOrEqual(kvs.back().key); + #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + else + { + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ksBegin = ::firstGreaterThan(kvs.back().key); + #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + getRangeFuture = tr->getRange(ksBegin, ksEnd, limits, snapshot, reverse); + #line 1371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1(RangeResult && kvs,int loopDepth) + { + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + kbt_debug("MAP GETRANGE KeySelectors {} - {} results={} more={}\n", begin.pack(self.subspace.begin).toString(), end.pack(self.subspace.begin).toString(), kvs.size(), kvs.more); + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + for( auto const& kv : kvs ) { + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + kbt_debug(" {} -> {}\n", kv.key.printable(), kv.value.printable()); + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (self.subspace.contains(kv.key)) + #line 1386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + KeyType key = self.unpackKey(kv.key); + #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ValueType val = self.unpackValue(kv.value); + #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + rangeResult.results.push_back(PairType(key, val)); + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + } + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!kvs.more) + #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!rangeResult.results.empty()) + #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + rangeResult.more = self.subspace.contains(kvs.back().key); + #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (reverse) + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ksEnd = ::firstGreaterOrEqual(kvs.back().key); + #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + else + { + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ksBegin = ::firstGreaterThan(kvs.back().key); + #line 1424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + getRangeFuture = tr->getRange(ksBegin, ksEnd, limits, snapshot, reverse); + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(RangeResult const& kvs,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(kvs, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(RangeResult && kvs,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(std::move(kvs), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetRangeActorActor, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< GetRangeActorActor, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("getRangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRangeActor", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetRangeActorActor, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("getRangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRangeActor", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetRangeActorActor, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("getRangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRangeActor", reinterpret_cast(this), 0); + + } + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + KeyBackedMap self; + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Transaction tr; + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + KeySelector begin; + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + KeySelector end; + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + GetRangeLimits limits; + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Snapshot snapshot; + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Reverse reverse; + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ::KeySelector ksBegin; + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ::KeySelector ksEnd; + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + typename transaction_future_type::type getRangeFuture; + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + RangeResultType rangeResult; + #line 1518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +}; +// This generated class is to be used only via getRangeActor() + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +class GetRangeActorActor final : public Actor, public ActorCallback< GetRangeActorActor, 0, RangeResult >, public FastAllocated>, public GetRangeActorActorState> { + #line 1525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetRangeActorActor, 0, RangeResult >; + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + GetRangeActorActor(KeyBackedMap const& self,Transaction const& tr,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Snapshot const& snapshot,Reverse const& reverse) + #line 1536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + : Actor(), + GetRangeActorActorState>(self, tr, begin, end, limits, snapshot, reverse) + { + fdb_probe_actor_enter("getRangeActor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getRangeActor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getRangeActor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetRangeActorActor, 0, RangeResult >*)0, actor_cancelled()); break; + } + + } +}; + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +[[nodiscard]] static Future getRangeActor( KeyBackedMap const& self, Transaction const& tr, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Snapshot const& snapshot, Reverse const& reverse ) { + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + return Future(new GetRangeActorActor(self, tr, begin, end, limits, snapshot, reverse)); + #line 1565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +} + +#line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + + // GetRange with typed KeySelectors + template + Future getRange(Transaction tr, + KeySelector begin, + KeySelector end, + GetRangeLimits limits, + Snapshot snapshot = Snapshot::False, + Reverse reverse = Reverse::False) const { + return getRangeActor(*this, tr, begin, end, limits, snapshot, reverse); + } + + // Find the closest key which is <, <=, >, or >= query + // These operation can be accomplished using KeySelectors however they run the risk of touching keys outside of + // map subspace, which can cause problems if this touches an offline range or a key which is unreadable by range + // read operations due to having been modified with a version stamp operation in the current transaction. + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +// This generated class is to be used only via seek() + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +class SeekActorState { + #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +public: + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + SeekActorState(KeyBackedMap const& self,Transaction const& tr,KeyType const& query,bool const& lessThan,bool const& orEqual,Snapshot const& snapshot) + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + : self(self), + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + tr(tr), + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + query(query), + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + lessThan(lessThan), + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + orEqual(orEqual), + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + snapshot(snapshot) + #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + fdb_probe_actor_create("seek", reinterpret_cast(this)); + + } + ~SeekActorState() + { + fdb_probe_actor_destroy("seek", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Key begin; + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Key end; + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (lessThan) + #line 1627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + begin = self.subspace.begin; + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + end = self.packKey(query); + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (orEqual) + #line 1635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + end = keyAfter(end); + #line 1639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + } + else + { + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + begin = self.packKey(query); + #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!orEqual) + #line 1648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + begin = keyAfter(begin); + #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + end = self.subspace.end; + #line 1656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + getRangeFuture = tr->getRange(KeyRangeRef(begin, end), 1, snapshot, Reverse{ lessThan }); + #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + StrictFuture __when_expr_0 = safeThreadFutureToFuture(getRangeFuture); + #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~SeekActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(RangeResult const& kvs,int loopDepth) + { + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (kvs.empty()) + #line 1692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~SeekActorState(); static_cast(this)->destroy(); return 0; } + #line 1696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~SeekActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(self.unpackKV(kvs.front())); this->~SeekActorState(); static_cast(this)->destroy(); return 0; } + #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(self.unpackKV(kvs.front())); + this->~SeekActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(RangeResult && kvs,int loopDepth) + { + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (kvs.empty()) + #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~SeekActorState(); static_cast(this)->destroy(); return 0; } + #line 1720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~SeekActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(self.unpackKV(kvs.front())); this->~SeekActorState(); static_cast(this)->destroy(); return 0; } + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(self.unpackKV(kvs.front())); + this->~SeekActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(RangeResult const& kvs,int loopDepth) + { + loopDepth = a_body1cont1(kvs, loopDepth); + + return loopDepth; + } + int a_body1when1(RangeResult && kvs,int loopDepth) + { + loopDepth = a_body1cont1(std::move(kvs), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SeekActor, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< SeekActor, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("seek", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("seek", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< SeekActor, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("seek", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("seek", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< SeekActor, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("seek", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("seek", reinterpret_cast(this), 0); + + } + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + KeyBackedMap self; + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Transaction tr; + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + KeyType query; + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + bool lessThan; + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + bool orEqual; + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Snapshot snapshot; + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + typename transaction_future_type::type getRangeFuture; + #line 1813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +}; +// This generated class is to be used only via seek() + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +class SeekActor final : public Actor>, public ActorCallback< SeekActor, 0, RangeResult >, public FastAllocated>, public SeekActorState> { + #line 1820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< SeekActor, 0, RangeResult >; + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + SeekActor(KeyBackedMap const& self,Transaction const& tr,KeyType const& query,bool const& lessThan,bool const& orEqual,Snapshot const& snapshot) + #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + : Actor>(), + SeekActorState>(self, tr, query, lessThan, orEqual, snapshot) + { + fdb_probe_actor_enter("seek", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("seek"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("seek", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< SeekActor, 0, RangeResult >*)0, actor_cancelled()); break; + } + + } +}; + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +[[nodiscard]] static Future> seek( KeyBackedMap const& self, Transaction const& tr, KeyType const& query, bool const& lessThan, bool const& orEqual, Snapshot const& snapshot ) { + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + return Future>(new SeekActor(self, tr, query, lessThan, orEqual, snapshot)); + #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +} + +#line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + + template + Future> seekLessThan(Transaction tr, KeyType query, Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, true, false, snapshot); + } + + template + Future> seekLessOrEqual(Transaction tr, KeyType query, Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, true, true, snapshot); + } + + template + Future> seekGreaterThan(Transaction tr, KeyType query, Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, false, false, snapshot); + } + + template + Future> seekGreaterOrEqual(Transaction tr, + KeyType query, + Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, false, true, snapshot); + } + + template + Future> get(Transaction tr, KeyType const& key, Snapshot snapshot = Snapshot::False) const { + typename transaction_future_type>::type getFuture = + tr->get(packKey(key), snapshot); + + return holdWhile(getFuture, + map(safeThreadFutureToFuture(getFuture), + [valueCodec = valueCodec](Optional const& val) -> Optional { + if (val.present()) + return valueCodec.unpack(val.get()); + return {}; + })); + } + + // Get key's value or defaultValue if it doesn't exist + template + Future getD(Transaction tr, + KeyType const& key, + Snapshot snapshot = Snapshot::False, + ValueType defaultValue = ValueType()) const { + return map(get(tr, key, snapshot), + [=](Optional val) -> ValueType { return val.orDefault(defaultValue); }); + } + + // Returns a Property that can be get/set that represents key's entry in this this. + SingleRecordProperty getProperty(KeyType const& key) const { return { packKey(key), trigger, valueCodec }; } + + // Returns the expectedSize of the set key + template + int set(Transaction tr, KeyType const& key, ValueType const& val) { + Key k = packKey(key); + Value v = packValue(val); + kbt_debug("MAP SET {} -> {}\n", k.printable(), v.printable()); + tr->set(k, v); + if (trigger.present()) { + trigger->update(tr); + } + return k.expectedSize() + v.expectedSize(); + } + + template + void atomicOp(Transaction tr, KeyType const& key, ValueType const& val, MutationRef::Type type) { + Key k = packKey(key); + Value v = packValue(val); + tr->atomicOp(k, v, type); + if (trigger.present()) { + trigger->update(tr); + } + } + + template + void erase(Transaction tr, KeyType const& key) { + kbt_debug("MAP ERASE {}\n", packKey(key).printable()); + tr->clear(packKey(key)); + if (trigger.present()) { + trigger->update(tr); + } + } + + template + void erase(Transaction tr, KeyType const& begin, KeyType const& end) { + tr->clear(KeyRangeRef(packKey(begin), packKey(end))); + if (trigger.present()) { + trigger->update(tr); + } + } + + template + void clear(Transaction tr) { + tr->clear(subspace); + if (trigger.present()) { + trigger->update(tr); + } + } + + template + void addReadConflictKey(Transaction tr, KeyType const& key) { + Key k = packKey(key); + tr->addReadConflictRange(singleKeyRange(k)); + } + + template + void addReadConflictRange(Transaction tr, KeyType const& begin, KeyType const& end) { + tr->addReadConflictRange(packKey(begin), packKey(end)); + } + + template + void addWriteConflictKey(Transaction tr, KeyType const& key) { + Key k = packKey(key); + tr->addWriteConflictRange(singleKeyRange(k)); + } + + template + void addWriteConflictRange(Transaction tr, KeyType const& begin, KeyType const& end) { + tr->addWriteConflictRange(packKey(begin), packKey(end)); + } + + KeyRange subspace; + Optional trigger; + ValueCodec valueCodec; + + Key packKey(KeyType const& key) const { return subspace.begin.withSuffix(KeyCodec::pack(key)); } + KeyType unpackKey(KeyRef const& key) const { return KeyCodec::unpack(key.removePrefix(subspace.begin)); } + + Value packValue(ValueType const& value) const { return valueCodec.pack(value); } + ValueType unpackValue(ValueRef const& value) const { return valueCodec.unpack(value); } + + KVType unpackKV(KeyValueRef const& kv) const { return { unpackKey(kv.key), unpackValue(kv.value) }; } +}; + +// KeyBackedObjectMap is a convenience wrapper of KeyBackedMap which uses ObjectCodec<_ValueType, VersionOptions> as +// the value codec +template > +class KeyBackedObjectMap + : public KeyBackedMap<_KeyType, _ValueType, KeyCodec, ObjectCodec<_ValueType, VersionOptions>> { + typedef ObjectCodec<_ValueType, VersionOptions> ValueCodec; + typedef KeyBackedMap<_KeyType, _ValueType, KeyCodec, ValueCodec> Base; + +public: + KeyBackedObjectMap(KeyRef key, VersionOptions vo, Optional trigger = {}) + : Base(key, trigger, ValueCodec(vo)) {} +}; + +template > +class KeyBackedSet { +public: + KeyBackedSet(KeyRef key = invalidKey, Optional trigger = {}) + : subspace(prefixRange(key)), trigger(trigger) {} + + typedef _ValueType ValueType; + typedef KeyBackedRangeResult RangeResultType; + typedef TypedKeySelector KeySelector; + + template + Future getRange(Transaction tr, + Optional const& begin, + Optional const& end, + int limit, + Snapshot snapshot = Snapshot::False, + Reverse reverse = Reverse::False) const { + Key beginKey = begin.present() ? packKey(begin.get()) : subspace.begin; + Key endKey = end.present() ? packKey(end.get()) : subspace.end; + + typename transaction_future_type::type getRangeFuture = + tr->getRange(KeyRangeRef(beginKey, endKey), GetRangeLimits(limit), snapshot, reverse); + + return holdWhile(getRangeFuture, + map(safeThreadFutureToFuture(getRangeFuture), + [prefix = subspace.begin](RangeResult const& kvs) -> RangeResultType { + RangeResultType rangeResult; + for (auto const& kv : kvs) { + rangeResult.results.push_back(Codec::unpack(kv.key.removePrefix(prefix))); + } + rangeResult.more = kvs.more; + return rangeResult; + })); + } + + #line 2045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +// This generated class is to be used only via getRangeActor() + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +class GetRangeActorActor1State { + #line 2051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +public: + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + GetRangeActorActor1State(KeyBackedSet const& self,Transaction const& tr,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Snapshot const& snapshot,Reverse const& reverse) + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + : self(self), + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + tr(tr), + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + begin(begin), + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + end(end), + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + limits(limits), + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + snapshot(snapshot), + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + reverse(reverse) + #line 2070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + fdb_probe_actor_create("getRangeActor", reinterpret_cast(this)); + + } + ~GetRangeActorActor1State() + { + fdb_probe_actor_destroy("getRangeActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + kbt_debug("MAP GETRANGE KeySelectors {} - {}\n", begin.pack(self.subspace.begin).toString(), end.pack(self.subspace.begin).toString()); + #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ksBegin = begin.pack(self.subspace.begin); + #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ksEnd = end.pack(self.subspace.begin); + #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + getRangeFuture = tr->getRange(ksBegin, ksEnd, limits, snapshot, reverse); + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + rangeResult = RangeResultType(); + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ; + #line 2095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetRangeActorActor1State(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(rangeResult); this->~GetRangeActorActor1State(); static_cast(this)->destroy(); return 0; } + #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + new (&static_cast(this)->SAV< RangeResultType >::value()) RangeResultType(std::move(rangeResult)); // state_var_RVO + this->~GetRangeActorActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + StrictFuture __when_expr_0 = safeThreadFutureToFuture(getRangeFuture); + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(RangeResult const& kvs,int loopDepth) + { + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + kbt_debug("MAP GETRANGE KeySelectors {} - {} results={} more={}\n", begin.pack(self.subspace.begin).toString(), end.pack(self.subspace.begin).toString(), kvs.size(), kvs.more); + #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + for( auto const& kv : kvs ) { + #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + kbt_debug(" {} -> {}\n", kv.key.printable(), kv.value.printable()); + #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (self.subspace.contains(kv.key)) + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + rangeResult.results.push_back(self.unpackKey(kv.key)); + #line 2176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + } + #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!kvs.more) + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!rangeResult.results.empty()) + #line 2187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + rangeResult.more = self.subspace.contains(kvs.back().key); + #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (reverse) + #line 2196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ksEnd = ::firstGreaterOrEqual(kvs.back().key); + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + else + { + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ksBegin = ::firstGreaterThan(kvs.back().key); + #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + getRangeFuture = tr->getRange(ksBegin, ksEnd, limits, snapshot, reverse); + #line 2210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1(RangeResult && kvs,int loopDepth) + { + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + kbt_debug("MAP GETRANGE KeySelectors {} - {} results={} more={}\n", begin.pack(self.subspace.begin).toString(), end.pack(self.subspace.begin).toString(), kvs.size(), kvs.more); + #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + for( auto const& kv : kvs ) { + #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + kbt_debug(" {} -> {}\n", kv.key.printable(), kv.value.printable()); + #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (self.subspace.contains(kv.key)) + #line 2225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + rangeResult.results.push_back(self.unpackKey(kv.key)); + #line 2229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + } + #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!kvs.more) + #line 2234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!rangeResult.results.empty()) + #line 2240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + rangeResult.more = self.subspace.contains(kvs.back().key); + #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (reverse) + #line 2249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ksEnd = ::firstGreaterOrEqual(kvs.back().key); + #line 2253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + else + { + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ksBegin = ::firstGreaterThan(kvs.back().key); + #line 2259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + getRangeFuture = tr->getRange(ksBegin, ksEnd, limits, snapshot, reverse); + #line 2263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(RangeResult const& kvs,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(kvs, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(RangeResult && kvs,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(std::move(kvs), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetRangeActorActor1, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< GetRangeActorActor1, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("getRangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRangeActor", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetRangeActorActor1, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("getRangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRangeActor", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetRangeActorActor1, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("getRangeActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRangeActor", reinterpret_cast(this), 0); + + } + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + KeyBackedSet self; + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Transaction tr; + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + KeySelector begin; + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + KeySelector end; + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + GetRangeLimits limits; + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Snapshot snapshot; + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Reverse reverse; + #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ::KeySelector ksBegin; + #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ::KeySelector ksEnd; + #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + typename transaction_future_type::type getRangeFuture; + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + RangeResultType rangeResult; + #line 2353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +}; +// This generated class is to be used only via getRangeActor() + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +class GetRangeActorActor1 final : public Actor, public ActorCallback< GetRangeActorActor1, 0, RangeResult >, public FastAllocated>, public GetRangeActorActor1State> { + #line 2360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetRangeActorActor1, 0, RangeResult >; + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + GetRangeActorActor1(KeyBackedSet const& self,Transaction const& tr,KeySelector const& begin,KeySelector const& end,GetRangeLimits const& limits,Snapshot const& snapshot,Reverse const& reverse) + #line 2371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + : Actor(), + GetRangeActorActor1State>(self, tr, begin, end, limits, snapshot, reverse) + { + fdb_probe_actor_enter("getRangeActor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getRangeActor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getRangeActor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetRangeActorActor1, 0, RangeResult >*)0, actor_cancelled()); break; + } + + } +}; + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +[[nodiscard]] static Future getRangeActor( KeyBackedSet const& self, Transaction const& tr, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Snapshot const& snapshot, Reverse const& reverse ) { + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + return Future(new GetRangeActorActor1(self, tr, begin, end, limits, snapshot, reverse)); + #line 2400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +} + +#line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + + // GetRange with typed KeySelectors + template + Future getRange(Transaction tr, + KeySelector begin, + KeySelector end, + GetRangeLimits limits, + Snapshot snapshot = Snapshot::False, + Reverse reverse = Reverse::False) const { + return getRangeActor(*this, tr, begin, end, limits, snapshot, reverse); + } + + // Find the closest key which is <, <=, >, or >= query + // These operation can be accomplished using KeySelectors however they run the risk of touching keys outside of + // map subspace, which can cause problems if this touches an offline range or a key which is unreadable by range + // read operations due to having been modified with a version stamp operation in the current transaction. + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +// This generated class is to be used only via seek() + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +class SeekActor1State { + #line 2426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +public: + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + SeekActor1State(KeyBackedSet const& self,Transaction const& tr,ValueType const& query,bool const& lessThan,bool const& orEqual,Snapshot const& snapshot) + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + : self(self), + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + tr(tr), + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + query(query), + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + lessThan(lessThan), + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + orEqual(orEqual), + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + snapshot(snapshot) + #line 2443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + fdb_probe_actor_create("seek", reinterpret_cast(this)); + + } + ~SeekActor1State() + { + fdb_probe_actor_destroy("seek", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Key begin; + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Key end; + #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (lessThan) + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + begin = self.subspace.begin; + #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + end = self.packKey(query); + #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (orEqual) + #line 2470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + end = keyAfter(end); + #line 2474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + } + else + { + #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + begin = self.packKey(query); + #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!orEqual) + #line 2483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + begin = keyAfter(begin); + #line 2487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + end = self.subspace.end; + #line 2491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + } + #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + getRangeFuture = tr->getRange(KeyRangeRef(begin, end), 1, snapshot, Reverse{ lessThan }); + #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + StrictFuture __when_expr_0 = safeThreadFutureToFuture(getRangeFuture); + #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~SeekActor1State(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(RangeResult const& kvs,int loopDepth) + { + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (kvs.empty()) + #line 2527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~SeekActor1State(); static_cast(this)->destroy(); return 0; } + #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~SeekActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(self.unpackKey(kvs.front())); this->~SeekActor1State(); static_cast(this)->destroy(); return 0; } + #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(self.unpackKey(kvs.front())); + this->~SeekActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(RangeResult && kvs,int loopDepth) + { + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (kvs.empty()) + #line 2551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + { + #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~SeekActor1State(); static_cast(this)->destroy(); return 0; } + #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~SeekActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(self.unpackKey(kvs.front())); this->~SeekActor1State(); static_cast(this)->destroy(); return 0; } + #line 2563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(self.unpackKey(kvs.front())); + this->~SeekActor1State(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(RangeResult const& kvs,int loopDepth) + { + loopDepth = a_body1cont1(kvs, loopDepth); + + return loopDepth; + } + int a_body1when1(RangeResult && kvs,int loopDepth) + { + loopDepth = a_body1cont1(std::move(kvs), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SeekActor1, 0, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< SeekActor1, 0, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("seek", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("seek", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< SeekActor1, 0, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("seek", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("seek", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< SeekActor1, 0, RangeResult >*,Error err) + { + fdb_probe_actor_enter("seek", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("seek", reinterpret_cast(this), 0); + + } + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + KeyBackedSet self; + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Transaction tr; + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + ValueType query; + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + bool lessThan; + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + bool orEqual; + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + Snapshot snapshot; + #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + typename transaction_future_type::type getRangeFuture; + #line 2648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +}; +// This generated class is to be used only via seek() + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +class SeekActor1 final : public Actor>, public ActorCallback< SeekActor1, 0, RangeResult >, public FastAllocated>, public SeekActor1State> { + #line 2655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< SeekActor1, 0, RangeResult >; + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + SeekActor1(KeyBackedSet const& self,Transaction const& tr,ValueType const& query,bool const& lessThan,bool const& orEqual,Snapshot const& snapshot) + #line 2666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" + : Actor>(), + SeekActor1State>(self, tr, query, lessThan, orEqual, snapshot) + { + fdb_probe_actor_enter("seek", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("seek"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("seek", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< SeekActor1, 0, RangeResult >*)0, actor_cancelled()); break; + } + + } +}; + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +template + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" +[[nodiscard]] static Future> seek( KeyBackedSet const& self, Transaction const& tr, ValueType const& query, bool const& lessThan, bool const& orEqual, Snapshot const& snapshot ) { + #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + return Future>(new SeekActor1(self, tr, query, lessThan, orEqual, snapshot)); + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.g.h" +} + +#line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h" + + template + Future> seekLessThan(Transaction tr, + ValueType query, + Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, true, false, snapshot); + } + + template + Future> seekLessOrEqual(Transaction tr, + ValueType query, + Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, true, true, snapshot); + } + + template + Future> seekGreaterThan(Transaction tr, + ValueType query, + Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, false, false, snapshot); + } + + template + Future> seekGreaterOrEqual(Transaction tr, + ValueType query, + Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, false, true, snapshot); + } + + template + Future exists(Transaction tr, ValueType const& val, Snapshot snapshot = Snapshot::False) const { + typename transaction_future_type>::type getFuture = + tr->get(packKey(val), snapshot); + + return holdWhile(getFuture, map(safeThreadFutureToFuture(getFuture), [](Optional const& val) -> bool { + return val.present(); + })); + } + + // Returns the expectedSize of the set key + template + int insert(Transaction tr, ValueType const& val) { + Key k = packKey(val); + tr->set(k, StringRef()); + if (trigger.present()) { + trigger->update(tr); + } + return k.expectedSize(); + } + + template + void erase(Transaction tr, ValueType const& val) { + tr->clear(packKey(val)); + if (trigger.present()) { + trigger->update(tr); + } + } + + template + void erase(Transaction tr, ValueType const& begin, ValueType const& end) { + tr->clear(KeyRangeRef(packKey(begin), packKey(end))); + if (trigger.present()) { + trigger->update(tr); + } + } + + template + void clear(Transaction tr) { + tr->clear(subspace); + if (trigger.present()) { + trigger->update(tr); + } + } + + KeyRange subspace; + Optional trigger; + + Key packKey(ValueType const& value) const { return subspace.begin.withSuffix(Codec::pack(value)); } + ValueType unpackKey(KeyRef const& key) const { return Codec::unpack(key.removePrefix(subspace.begin)); } +}; + +// KeyBackedClass is a convenient base class for a set of related KeyBacked types that exist +// under a single key prefix and other help functions relevant to the concepts that the class +// represent. +// +// A WatchableTrigger called trigger is provided, which a default key which is under the struct's +// root space. Alternatively, a custom WatchableTrigger can be provided to the constructor +// to use any other database key instead. + +class KeyBackedClass { +public: + KeyBackedClass(StringRef prefix, Optional triggerOverride = {}) + : subspace(prefix), trigger(triggerOverride.orDefault(subspace.pack("_changeTrigger"_sr))) {} + + Subspace subspace; + WatchableTrigger trigger; +}; + +#include "flow/unactorcompiler.h" + +#endif diff --git a/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h b/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h new file mode 100644 index 0000000..0281e98 --- /dev/null +++ b/src/fdbclient/include/fdbclient/KeyBackedTypes.actor.h @@ -0,0 +1,1081 @@ +/* + * KeyBackedTypes.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 + +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_KEYBACKEDTYPES_ACTOR_G_H) +#define FDBCLIENT_KEYBACKEDTYPES_ACTOR_G_H +#include "fdbclient/KeyBackedTypes.actor.g.h" +#elif !defined(FDBCLIENT_KEYBACKEDTYPES_ACTOR_H) +#define FDBCLIENT_KEYBACKEDTYPES_ACTOR_H + +#include +#include +#include + +#include "fdbclient/ClientBooleanParams.h" +#include "fdbclient/CommitTransaction.h" +#include "fdbclient/RunTransaction.actor.h" +#include "fdbclient/FDBOptions.g.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/GenericTransactionHelper.h" +#include "fdbclient/Subspace.h" +#include "flow/ObjectSerializer.h" +#include "flow/Platform.h" +#include "flow/genericactors.actor.h" +#include "flow/serialize.h" +#include "flow/ThreadHelper.actor.h" + +#include "flow/actorcompiler.h" // This must be the last #include. + +#define KEYBACKEDTYPES_DEBUG 0 +#if KEYBACKEDTYPES_DEBUG || !defined(NO_INTELLISENSE) +#define kbt_debug fmt::print +#else +#define kbt_debug(...) +#endif + +// TupleCodec is a utility struct to convert a type to and from a value using Tuple encoding. +// It is used by the template classes below like KeyBackedProperty and KeyBackedMap to convert +// key parts and values from various types to Value strings and back. +// New types can be supported either by writing a new specialization or adding these +// methods to the type so that the default specialization can be used: +// static T T::unpack(Standalone const& val) +// Standalone T::pack(T const& val) const +// Since TupleCodec is a struct, partial specialization can be used, such as the std::pair +// partial specialization below allowing any std::pair where T1 and T2 are already +// supported by TupleCodec. +template +struct TupleCodec { + static inline Standalone pack(T const& val) { return val.pack().pack(); } + static inline T unpack(Standalone const& val) { return T::unpack(Tuple::unpack(val)); } +}; + +// If T is Tuple then conversion is simple. +template <> +inline Standalone TupleCodec::pack(Tuple const& val) { + return val.pack(); +} +template <> +inline Tuple TupleCodec::unpack(Standalone const& val) { + return Tuple::unpack(val); +} + +template <> +inline Standalone TupleCodec::pack(int64_t const& val) { + return Tuple::makeTuple(val).pack(); +} +template <> +inline int64_t TupleCodec::unpack(Standalone const& val) { + return Tuple::unpack(val).getInt(0); +} + +template <> +inline Standalone TupleCodec::pack(bool const& val) { + return Tuple::makeTuple(val ? 1 : 0).pack(); +} +template <> +inline bool TupleCodec::unpack(Standalone const& val) { + return Tuple::unpack(val).getInt(0) == 1; +} + +template <> +inline Standalone TupleCodec>::pack(Standalone const& val) { + return Tuple::makeTuple(val).pack(); +} +template <> +inline Standalone TupleCodec>::unpack(Standalone const& val) { + return Tuple::unpack(val).getString(0); +} + +template <> +inline Standalone TupleCodec::pack(UID const& val) { + return TupleCodec>::pack(BinaryWriter::toValue(val, Unversioned())); +} +template <> +inline UID TupleCodec::unpack(Standalone const& val) { + return BinaryReader::fromStringRef(TupleCodec>::unpack(val), Unversioned()); +} + +// This is backward compatible with TupleCodec> +template <> +inline Standalone TupleCodec::pack(std::string const& val) { + return Tuple::makeTuple(val).pack(); +} +template <> +inline std::string TupleCodec::unpack(Standalone const& val) { + return Tuple::unpack(val).getString(0).toString(); +} + +// Partial specialization to cover all std::pairs as long as the component types are TupleCodec compatible +template +struct TupleCodec> { + static Standalone pack(typename std::pair const& val) { + // Packing a concatenated tuple is the same as concatenating two packed tuples + return TupleCodec::pack(val.first).withSuffix(TupleCodec::pack(val.second)); + } + static std::pair unpack(Standalone const& val) { + Tuple t = Tuple::unpack(val); + ASSERT(t.size() == 2); + return { TupleCodec::unpack(t.subTupleRawString(0)), + TupleCodec::unpack(t.subTupleRawString(1)) }; + } +}; + +template +struct TupleCodec> { + static Standalone pack(typename std::vector const& val) { + Tuple t; + for (T item : val) { + // fdbclient doesn't support nested tuples yet. For now, flatten the tuple into StringRef + t.append(TupleCodec::pack(item)); + } + return t.pack(); + } + + static std::vector unpack(Standalone const& val) { + Tuple t = Tuple::unpack(val); + std::vector v; + + for (int i = 0; i < t.size(); i++) { + v.push_back(TupleCodec::unpack(t.getString(i))); + } + + return v; + } +}; + +template <> +inline Standalone TupleCodec::pack(KeyRange const& val) { + return Tuple::makeTuple(val.begin, val.end).pack(); +} +template <> +inline KeyRange TupleCodec::unpack(Standalone const& val) { + Tuple t = Tuple::unpack(val); + return KeyRangeRef(t.getString(0), t.getString(1)); +} + +struct NullCodec { + static Standalone pack(Standalone val) { return val; } + static Standalone unpack(Standalone val) { return val; } +}; + +template +struct BinaryCodec { + static Standalone pack(T val) { return BinaryWriter::toValue(val, Unversioned()); } + static T unpack(Standalone val) { return BinaryReader::fromStringRef(val, Unversioned()); } +}; + +// Codec for using Flatbuffer compatible types via ObjectWriter/ObjectReader +template +struct ObjectCodec { + ObjectCodec(VersionOptions vo) : vo(vo) {} + VersionOptions vo; + + inline Standalone pack(T const& val) const { return ObjectWriter::toValue(val, vo); } + inline T unpack(Standalone const& val) const { return ObjectReader::fromStringRef(val, vo); } +}; + +template +struct KeyBackedRangeResult { + std::vector results; + bool more; + + bool operator==(KeyBackedRangeResult const& other) const { return results == other.results && more == other.more; } + bool operator!=(KeyBackedRangeResult const& other) const { return !(*this == other); } +}; + +class WatchableTrigger { +private: + Key key; + +public: + WatchableTrigger(Key k) : key(k) {} + + template + void update(Transaction tr, AddConflictRange conflict = AddConflictRange::False) { + std::array value; + value.fill(0); + tr->atomicOp(key, StringRef(value.data(), value.size()), MutationRef::SetVersionstampedValue); + if (conflict) { + tr->addReadConflictRange(singleKeyRange(key)); + } + } + + template + Future> get(Transaction tr, Snapshot snapshot = Snapshot::False) const { + typename transaction_future_type>::type getFuture = tr->get(key, snapshot); + + return holdWhile( + getFuture, + map(safeThreadFutureToFuture(getFuture), [](Optional const& val) -> Optional { + if (val.present()) { + return BinaryReader::fromStringRef(*val, Unversioned()); + } + return {}; + })); + } + + template + Future watch(Transaction tr) const { + typename transaction_future_type::type watchFuture = tr->watch(key); + return holdWhile(watchFuture, safeThreadFutureToFuture(watchFuture)); + } + +// Forward declaration of this static template actor does not work correctly, so this actor is forward declared +// in a way that works for both compiling and in IDEs. +#if defined(NO_INTELLISENSE) + template + static Future onChangeActor(WatchableTrigger const& self, + Reference const& db, + Optional const& initialVersion, + Promise const& watching); +#else + ACTOR template + static Future onChangeActor(WatchableTrigger self, + Reference db, + Optional initialVersion, + Promise watching); +#endif + + // Watch the trigger until it changes. The result will be ready when it is observed that the trigger value's + // version is greater than initialVersion, and the observed trigger value version will be returned. + // + // If initialVersion is not present it will be initialized internally to the first read version successfully + // obtained from the db. + // + // initialVersion can be thought of as a "last known version" but it could also be used to indiciate some future + // version after which you want to be notifified if the trigger's value changes. + // + // If watching can be set, the initialized value of initialVersion will be sent to it once known. + template + Future onChange(Reference db, + Optional initialVersion = {}, + Promise watching = {}) const { + return onChangeActor(*this, db, initialVersion, watching); + } +}; + +ACTOR template +Future WatchableTrigger::onChangeActor(WatchableTrigger self, + Reference db, + Optional initialVersion, + Promise watching) { + state Reference tr = db->createTransaction(); + + loop { + if constexpr (can_set_transaction_options) { + db->setOptions(tr); + } + try { + // If the initialVersion is not set yet, then initialize it with the read version + if (!initialVersion.present()) { + wait(store(initialVersion, safeThreadFutureToFuture(tr->getReadVersion()))); + } + if (watching.canBeSet()) { + watching.send(*initialVersion); + } + + // Get the trigger's latest value. + Optional currentVal = wait(self.get(tr)); + + // If the trigger has a value and its version is > initialVersion then the trigger has fired so break + if (currentVal.present() && currentVal->version > *initialVersion) { + return currentVal->version; + } + + // Otherwise, watch the key and repeat the loop once the watch fires + state Future watch = self.watch(tr); + wait(safeThreadFutureToFuture(tr->commit())); + wait(watch); + tr->reset(); + } catch (Error& e) { + wait(safeThreadFutureToFuture(tr->onError(e))); + } + } +} + +// Convenient read/write access to a single value of type T stored at key +// Even though 'this' is not actually mutated, methods that change the db key are not const. +template > +class KeyBackedProperty { +public: + KeyBackedProperty(KeyRef key = invalidKey, Optional trigger = {}, Codec codec = {}) + : key(key), trigger(trigger), codec(codec) {} + + template + Future> get(Transaction tr, Snapshot snapshot = Snapshot::False) const { + + if constexpr (is_transaction_creator) { + return runTransaction(tr, [=, self = *this](decltype(tr->createTransaction()) tr) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + return self.get(tr, snapshot); + }); + } else { + typename transaction_future_type>::type getFuture = tr->get(key, snapshot); + + return holdWhile( + getFuture, + map(safeThreadFutureToFuture(getFuture), [codec = codec](Optional const& val) -> Optional { + if (val.present()) + return codec.unpack(val.get()); + return {}; + })); + } + } + + // Get property's value or defaultValue if it doesn't exist + template + Future getD(Transaction tr, Snapshot snapshot = Snapshot::False, T defaultValue = T()) const { + if constexpr (is_transaction_creator) { + return runTransaction(tr, [=, self = *this](decltype(tr->createTransaction()) tr) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + return self.getD(tr, snapshot, defaultValue); + }); + } else { + return map(get(tr, snapshot), + [=](Optional val) -> T { return val.present() ? val.get() : defaultValue; }); + } + } + + // Get property's value or throw error if it doesn't exist + template + Future getOrThrow(Transaction tr, Snapshot snapshot = Snapshot::False, Error err = key_not_found()) const { + if constexpr (is_transaction_creator) { + return runTransaction(tr, [=, self = *this](decltype(tr->createTransaction()) tr) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + return self.getOrThrow(tr, snapshot, err); + }); + } else { + return map(get(tr, snapshot), [=](Optional val) -> T { + if (!val.present()) { + throw err; + } + + return val.get(); + }); + } + } + + template + void set(Transaction tr, T const& val) { + if constexpr (is_transaction_creator) { + return runTransaction(tr, [=, self = *this](decltype(tr->createTransaction()) tr) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + return self.set(tr, val); + }); + } else { + tr->set(key, packValue(val)); + if (trigger.present()) { + trigger->update(tr); + } + } + } + + template + void clear(Transaction tr) { + if constexpr (is_transaction_creator) { + return runTransaction(tr, [=, self = *this](decltype(tr->createTransaction()) tr) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + return self.clear(tr); + }); + } else { + tr->clear(key); + if (trigger.present()) { + trigger->update(tr); + } + } + } + + template + Future watch(Transaction tr) { + return tr->watch(key); + } + + Value packValue(T const& value) const { return codec.pack(value); } + T unpackValue(ValueRef const& value) const { return codec.unpack(value); } + + Key key; + Optional trigger; + Codec codec; +}; + +// KeyBackedObjectProperty is a convenience wrapper of KeyBackedProperty which uses ObjectCodec as +// the codec +template +class KeyBackedObjectProperty : public KeyBackedProperty> { + typedef ObjectCodec TCodec; + typedef KeyBackedProperty Base; + +public: + KeyBackedObjectProperty(KeyRef key, VersionOptions vo, Optional trigger = {}) + : Base(key, trigger, TCodec(vo)) {} +}; + +// KeyBackedBinaryValue is a convenience wrapper of KeyBackedProperty but using BinaryCodec as the codec and adds +// atomic ops and version stamp operations. +template +class KeyBackedBinaryValue : public KeyBackedProperty> { + typedef KeyBackedProperty> Base; + +public: + KeyBackedBinaryValue(KeyRef key = invalidKey, Optional trigger = {}) : Base(key, trigger) {} + + template + void atomicOp(Transaction tr, T const& val, MutationRef::Type type) { + tr->atomicOp(this->key, BinaryWriter::toValue(val, Unversioned()), type); + if (this->trigger.present()) { + this->trigger->update(tr); + } + } + + template + void setVersionstamp(Transaction tr, T const& val, int offset) { + tr->atomicOp( + this->key, + BinaryWriter::toValue(val, Unversioned()).withSuffix(StringRef(reinterpret_cast(&offset), 4)), + MutationRef::SetVersionstampedValue); + if (this->trigger.present()) { + this->trigger->update(tr); + } + } +}; + +template +struct TypedKVPair { + KeyType key; + ValueType value; +}; + +template +struct TypedRange { + KeyType begin; + KeyType end; +}; + +template +struct TypedKeySelector { + KeyType key; + bool orEqual; + int offset; + + TypedKeySelector operator+(int delta) { return { key, orEqual, offset + delta }; } + + TypedKeySelector operator-(int delta) { return { key, orEqual, offset - delta }; } + + KeySelector pack(const KeyRef& prefix) const { + Key packed = KeyCodec::pack(key).withPrefix(prefix); + return KeySelector(KeySelectorRef(packed, orEqual, offset), packed.arena()); + } + + static TypedKeySelector lastLessThan(const KeyType& k) { return { k, false, 0 }; } + + static TypedKeySelector lastLessOrEqual(const KeyType& k) { return { k, true, 0 }; } + + static TypedKeySelector firstGreaterThan(const KeyType& k) { return { k, true, +1 }; } + + static TypedKeySelector firstGreaterOrEqual(const KeyType& k) { return { k, false, +1 }; } +}; + +// Convenient read/write access to a sorted map of KeyType to ValueType under prefix +// Even though 'this' is not actually mutated, methods that change db keys are not const. +template , + typename ValueCodec = TupleCodec<_ValueType>> +class KeyBackedMap { +public: + KeyBackedMap(KeyRef prefix = invalidKey, Optional trigger = {}, ValueCodec valueCodec = {}) + : subspace(prefixRange(prefix)), trigger(trigger), valueCodec(valueCodec) {} + + typedef _KeyType KeyType; + typedef _ValueType ValueType; + typedef std::pair PairType; + typedef KeyBackedRangeResult RangeResultType; + typedef TypedKVPair KVType; + typedef KeyBackedProperty SingleRecordProperty; + typedef TypedKeySelector KeySelector; + + // If end is not present one key past the end of the map is used. + template + Future getRange(Transaction tr, + Optional const& begin, + Optional const& end, + int limit, + Snapshot snapshot = Snapshot::False, + Reverse reverse = Reverse::False) const { + Key beginKey = begin.present() ? packKey(begin.get()) : subspace.begin; + Key endKey = end.present() ? packKey(end.get()) : subspace.end; + + typename transaction_future_type::type getRangeFuture = + tr->getRange(KeyRangeRef(beginKey, endKey), GetRangeLimits(limit), snapshot, reverse); + + return holdWhile( + getRangeFuture, + map(safeThreadFutureToFuture(getRangeFuture), + [prefix = subspace.begin, valueCodec = valueCodec](RangeResult const& kvs) -> RangeResultType { + RangeResultType rangeResult; + for (int i = 0; i < kvs.size(); ++i) { + KeyType key = KeyCodec::unpack(kvs[i].key.removePrefix(prefix)); + ValueType val = valueCodec.unpack(kvs[i].value); + rangeResult.results.push_back(PairType(key, val)); + } + rangeResult.more = kvs.more; + return rangeResult; + })); + } + + ACTOR template + static Future getRangeActor(KeyBackedMap self, + Transaction tr, + KeySelector begin, + KeySelector end, + GetRangeLimits limits, + Snapshot snapshot, + Reverse reverse) { + kbt_debug("MAP GETRANGE KeySelectors {} - {}\n", + begin.pack(self.subspace.begin).toString(), + end.pack(self.subspace.begin).toString()); + + state ::KeySelector ksBegin = begin.pack(self.subspace.begin); + state ::KeySelector ksEnd = end.pack(self.subspace.begin); + state typename transaction_future_type::type getRangeFuture = + tr->getRange(ksBegin, ksEnd, limits, snapshot, reverse); + + // Since the getRange result must be filtered to keys within the map subspace, it is possible that the given + // TypedKeySelectors and GetRangeLimits yields a result in which no KV pairs are within the map subspace. If + // this happens, we can't return any map KV pairs for the caller to base the next request on, so we will loop + // and continue with the next request here. + state RangeResultType rangeResult; + loop { + RangeResult kvs = wait(safeThreadFutureToFuture(getRangeFuture)); + kbt_debug("MAP GETRANGE KeySelectors {} - {} results={} more={}\n", + begin.pack(self.subspace.begin).toString(), + end.pack(self.subspace.begin).toString(), + kvs.size(), + kvs.more); + + for (auto const& kv : kvs) { + kbt_debug(" {} -> {}\n", kv.key.printable(), kv.value.printable()); + + // KeySelectors could resolve to keys outside the map subspace so we must filter + if (self.subspace.contains(kv.key)) { + KeyType key = self.unpackKey(kv.key); + ValueType val = self.unpackValue(kv.value); + rangeResult.results.push_back(PairType(key, val)); + } + } + + // Stop if there are no more raw results + if (!kvs.more) { + break; + } + + // There may be more raw results in the range, so now determine if we need to read any of them or if we can + // return what we have found so far. If the filtered result set is not empty then we can return it + if (!rangeResult.results.empty()) { + // kvs.more is known to be true and kvs is not empty since the filtered result set is not empty. Set + // the output rangeResult.more to true if the last raw result was within the map range, else false. + rangeResult.more = self.subspace.contains(kvs.back().key); + break; + } + + // At this point, the filtered rangeResult is empty but there may be more raw results in the db. We cannot + // return this rangeResult to the caller because the caller won't know which key to start reading at for the + // next chunk, so we will use the raw keys to read the next chunk here and repeat the loop. + if (reverse) { + // The last key is the end of the new getRange, which includes the back key with orEqual because + // getRange end is exclusive + ksEnd = ::firstGreaterOrEqual(kvs.back().key); + } else { + // The last key is the exclusive begin of the new getRange + ksBegin = ::firstGreaterThan(kvs.back().key); + } + getRangeFuture = tr->getRange(ksBegin, ksEnd, limits, snapshot, reverse); + } + + return rangeResult; + } + + // GetRange with typed KeySelectors + template + Future getRange(Transaction tr, + KeySelector begin, + KeySelector end, + GetRangeLimits limits, + Snapshot snapshot = Snapshot::False, + Reverse reverse = Reverse::False) const { + return getRangeActor(*this, tr, begin, end, limits, snapshot, reverse); + } + + // Find the closest key which is <, <=, >, or >= query + // These operation can be accomplished using KeySelectors however they run the risk of touching keys outside of + // map subspace, which can cause problems if this touches an offline range or a key which is unreadable by range + // read operations due to having been modified with a version stamp operation in the current transaction. + ACTOR template + static Future> seek(KeyBackedMap self, + Transaction tr, + KeyType query, + bool lessThan, + bool orEqual, + Snapshot snapshot) { + // Operations map to the following getRange operations + // < query getRange begin query 1 reverse + // <= query getRange begin keyAfter(query) reverse + // >= query getRange key end 1 forward + // > query getRange keyAfter(query) end 1 forward + Key begin; + Key end; + + if (lessThan) { + begin = self.subspace.begin; + end = self.packKey(query); + if (orEqual) { + end = keyAfter(end); + } + } else { + begin = self.packKey(query); + if (!orEqual) { + begin = keyAfter(begin); + } + end = self.subspace.end; + } + + state typename transaction_future_type::type getRangeFuture = + tr->getRange(KeyRangeRef(begin, end), 1, snapshot, Reverse{ lessThan }); + + RangeResult kvs = wait(safeThreadFutureToFuture(getRangeFuture)); + if (kvs.empty()) { + return Optional(); + } + + return self.unpackKV(kvs.front()); + } + + template + Future> seekLessThan(Transaction tr, KeyType query, Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, true, false, snapshot); + } + + template + Future> seekLessOrEqual(Transaction tr, KeyType query, Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, true, true, snapshot); + } + + template + Future> seekGreaterThan(Transaction tr, KeyType query, Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, false, false, snapshot); + } + + template + Future> seekGreaterOrEqual(Transaction tr, + KeyType query, + Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, false, true, snapshot); + } + + template + Future> get(Transaction tr, KeyType const& key, Snapshot snapshot = Snapshot::False) const { + typename transaction_future_type>::type getFuture = + tr->get(packKey(key), snapshot); + + return holdWhile(getFuture, + map(safeThreadFutureToFuture(getFuture), + [valueCodec = valueCodec](Optional const& val) -> Optional { + if (val.present()) + return valueCodec.unpack(val.get()); + return {}; + })); + } + + // Get key's value or defaultValue if it doesn't exist + template + Future getD(Transaction tr, + KeyType const& key, + Snapshot snapshot = Snapshot::False, + ValueType defaultValue = ValueType()) const { + return map(get(tr, key, snapshot), + [=](Optional val) -> ValueType { return val.orDefault(defaultValue); }); + } + + // Returns a Property that can be get/set that represents key's entry in this this. + SingleRecordProperty getProperty(KeyType const& key) const { return { packKey(key), trigger, valueCodec }; } + + // Returns the expectedSize of the set key + template + int set(Transaction tr, KeyType const& key, ValueType const& val) { + Key k = packKey(key); + Value v = packValue(val); + kbt_debug("MAP SET {} -> {}\n", k.printable(), v.printable()); + tr->set(k, v); + if (trigger.present()) { + trigger->update(tr); + } + return k.expectedSize() + v.expectedSize(); + } + + template + void atomicOp(Transaction tr, KeyType const& key, ValueType const& val, MutationRef::Type type) { + Key k = packKey(key); + Value v = packValue(val); + tr->atomicOp(k, v, type); + if (trigger.present()) { + trigger->update(tr); + } + } + + template + void erase(Transaction tr, KeyType const& key) { + kbt_debug("MAP ERASE {}\n", packKey(key).printable()); + tr->clear(packKey(key)); + if (trigger.present()) { + trigger->update(tr); + } + } + + template + void erase(Transaction tr, KeyType const& begin, KeyType const& end) { + tr->clear(KeyRangeRef(packKey(begin), packKey(end))); + if (trigger.present()) { + trigger->update(tr); + } + } + + template + void clear(Transaction tr) { + tr->clear(subspace); + if (trigger.present()) { + trigger->update(tr); + } + } + + template + void addReadConflictKey(Transaction tr, KeyType const& key) { + Key k = packKey(key); + tr->addReadConflictRange(singleKeyRange(k)); + } + + template + void addReadConflictRange(Transaction tr, KeyType const& begin, KeyType const& end) { + tr->addReadConflictRange(packKey(begin), packKey(end)); + } + + template + void addWriteConflictKey(Transaction tr, KeyType const& key) { + Key k = packKey(key); + tr->addWriteConflictRange(singleKeyRange(k)); + } + + template + void addWriteConflictRange(Transaction tr, KeyType const& begin, KeyType const& end) { + tr->addWriteConflictRange(packKey(begin), packKey(end)); + } + + KeyRange subspace; + Optional trigger; + ValueCodec valueCodec; + + Key packKey(KeyType const& key) const { return subspace.begin.withSuffix(KeyCodec::pack(key)); } + KeyType unpackKey(KeyRef const& key) const { return KeyCodec::unpack(key.removePrefix(subspace.begin)); } + + Value packValue(ValueType const& value) const { return valueCodec.pack(value); } + ValueType unpackValue(ValueRef const& value) const { return valueCodec.unpack(value); } + + KVType unpackKV(KeyValueRef const& kv) const { return { unpackKey(kv.key), unpackValue(kv.value) }; } +}; + +// KeyBackedObjectMap is a convenience wrapper of KeyBackedMap which uses ObjectCodec<_ValueType, VersionOptions> as +// the value codec +template > +class KeyBackedObjectMap + : public KeyBackedMap<_KeyType, _ValueType, KeyCodec, ObjectCodec<_ValueType, VersionOptions>> { + typedef ObjectCodec<_ValueType, VersionOptions> ValueCodec; + typedef KeyBackedMap<_KeyType, _ValueType, KeyCodec, ValueCodec> Base; + +public: + KeyBackedObjectMap(KeyRef key, VersionOptions vo, Optional trigger = {}) + : Base(key, trigger, ValueCodec(vo)) {} +}; + +template > +class KeyBackedSet { +public: + KeyBackedSet(KeyRef key = invalidKey, Optional trigger = {}) + : subspace(prefixRange(key)), trigger(trigger) {} + + typedef _ValueType ValueType; + typedef KeyBackedRangeResult RangeResultType; + typedef TypedKeySelector KeySelector; + + template + Future getRange(Transaction tr, + Optional const& begin, + Optional const& end, + int limit, + Snapshot snapshot = Snapshot::False, + Reverse reverse = Reverse::False) const { + Key beginKey = begin.present() ? packKey(begin.get()) : subspace.begin; + Key endKey = end.present() ? packKey(end.get()) : subspace.end; + + typename transaction_future_type::type getRangeFuture = + tr->getRange(KeyRangeRef(beginKey, endKey), GetRangeLimits(limit), snapshot, reverse); + + return holdWhile(getRangeFuture, + map(safeThreadFutureToFuture(getRangeFuture), + [prefix = subspace.begin](RangeResult const& kvs) -> RangeResultType { + RangeResultType rangeResult; + for (auto const& kv : kvs) { + rangeResult.results.push_back(Codec::unpack(kv.key.removePrefix(prefix))); + } + rangeResult.more = kvs.more; + return rangeResult; + })); + } + + ACTOR template + static Future getRangeActor(KeyBackedSet self, + Transaction tr, + KeySelector begin, + KeySelector end, + GetRangeLimits limits, + Snapshot snapshot, + Reverse reverse) { + kbt_debug("MAP GETRANGE KeySelectors {} - {}\n", + begin.pack(self.subspace.begin).toString(), + end.pack(self.subspace.begin).toString()); + + state ::KeySelector ksBegin = begin.pack(self.subspace.begin); + state ::KeySelector ksEnd = end.pack(self.subspace.begin); + state typename transaction_future_type::type getRangeFuture = + tr->getRange(ksBegin, ksEnd, limits, snapshot, reverse); + + // Since the getRange result must be filtered to keys within the map subspace, it is possible that the given + // TypedKeySelectors and GetRangeLimits yields a result in which no KV pairs are within the map subspace. If + // this happens, we can't return any map KV pairs for the caller to base the next request on, so we will loop + // and continue with the next request here. + state RangeResultType rangeResult; + loop { + RangeResult kvs = wait(safeThreadFutureToFuture(getRangeFuture)); + kbt_debug("MAP GETRANGE KeySelectors {} - {} results={} more={}\n", + begin.pack(self.subspace.begin).toString(), + end.pack(self.subspace.begin).toString(), + kvs.size(), + kvs.more); + + for (auto const& kv : kvs) { + kbt_debug(" {} -> {}\n", kv.key.printable(), kv.value.printable()); + + // KeySelectors could resolve to keys outside the map subspace so we must filter + if (self.subspace.contains(kv.key)) { + rangeResult.results.push_back(self.unpackKey(kv.key)); + } + } + + // Stop if there are no more raw results + if (!kvs.more) { + break; + } + + // There may be more raw results in the range, so now determine if we need to read any of them or if we can + // return what we have found so far. If the filtered result set is not empty then we can return it + if (!rangeResult.results.empty()) { + // kvs.more is known to be true and kvs is not empty since the filtered result set is not empty. Set + // the output rangeResult.more to true if the last raw result was within the map range, else false. + rangeResult.more = self.subspace.contains(kvs.back().key); + break; + } + + // At this point, the filtered rangeResult is empty but there may be more raw results in the db. We cannot + // return this rangeResult to the caller because the caller won't know which key to start reading at for the + // next chunk, so we will use the raw keys to read the next chunk here and repeat the loop. + if (reverse) { + // The last key is the end of the new getRange, which includes the back key with orEqual because + // getRange end is exclusive + ksEnd = ::firstGreaterOrEqual(kvs.back().key); + } else { + // The last key is the exclusive begin of the new getRange + ksBegin = ::firstGreaterThan(kvs.back().key); + } + getRangeFuture = tr->getRange(ksBegin, ksEnd, limits, snapshot, reverse); + } + + return rangeResult; + } + + // GetRange with typed KeySelectors + template + Future getRange(Transaction tr, + KeySelector begin, + KeySelector end, + GetRangeLimits limits, + Snapshot snapshot = Snapshot::False, + Reverse reverse = Reverse::False) const { + return getRangeActor(*this, tr, begin, end, limits, snapshot, reverse); + } + + // Find the closest key which is <, <=, >, or >= query + // These operation can be accomplished using KeySelectors however they run the risk of touching keys outside of + // map subspace, which can cause problems if this touches an offline range or a key which is unreadable by range + // read operations due to having been modified with a version stamp operation in the current transaction. + ACTOR template + static Future> seek(KeyBackedSet self, + Transaction tr, + ValueType query, + bool lessThan, + bool orEqual, + Snapshot snapshot) { + // Operations map to the following getRange operations + // < query getRange begin query 1 reverse + // <= query getRange begin keyAfter(query) reverse + // >= query getRange key end 1 forward + // > query getRange keyAfter(query) end 1 forward + Key begin; + Key end; + + if (lessThan) { + begin = self.subspace.begin; + end = self.packKey(query); + if (orEqual) { + end = keyAfter(end); + } + } else { + begin = self.packKey(query); + if (!orEqual) { + begin = keyAfter(begin); + } + end = self.subspace.end; + } + + state typename transaction_future_type::type getRangeFuture = + tr->getRange(KeyRangeRef(begin, end), 1, snapshot, Reverse{ lessThan }); + + RangeResult kvs = wait(safeThreadFutureToFuture(getRangeFuture)); + if (kvs.empty()) { + return Optional(); + } + + return self.unpackKey(kvs.front()); + } + + template + Future> seekLessThan(Transaction tr, + ValueType query, + Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, true, false, snapshot); + } + + template + Future> seekLessOrEqual(Transaction tr, + ValueType query, + Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, true, true, snapshot); + } + + template + Future> seekGreaterThan(Transaction tr, + ValueType query, + Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, false, false, snapshot); + } + + template + Future> seekGreaterOrEqual(Transaction tr, + ValueType query, + Snapshot snapshot = Snapshot::False) const { + return seek(*this, tr, query, false, true, snapshot); + } + + template + Future exists(Transaction tr, ValueType const& val, Snapshot snapshot = Snapshot::False) const { + typename transaction_future_type>::type getFuture = + tr->get(packKey(val), snapshot); + + return holdWhile(getFuture, map(safeThreadFutureToFuture(getFuture), [](Optional const& val) -> bool { + return val.present(); + })); + } + + // Returns the expectedSize of the set key + template + int insert(Transaction tr, ValueType const& val) { + Key k = packKey(val); + tr->set(k, StringRef()); + if (trigger.present()) { + trigger->update(tr); + } + return k.expectedSize(); + } + + template + void erase(Transaction tr, ValueType const& val) { + tr->clear(packKey(val)); + if (trigger.present()) { + trigger->update(tr); + } + } + + template + void erase(Transaction tr, ValueType const& begin, ValueType const& end) { + tr->clear(KeyRangeRef(packKey(begin), packKey(end))); + if (trigger.present()) { + trigger->update(tr); + } + } + + template + void clear(Transaction tr) { + tr->clear(subspace); + if (trigger.present()) { + trigger->update(tr); + } + } + + KeyRange subspace; + Optional trigger; + + Key packKey(ValueType const& value) const { return subspace.begin.withSuffix(Codec::pack(value)); } + ValueType unpackKey(KeyRef const& key) const { return Codec::unpack(key.removePrefix(subspace.begin)); } +}; + +// KeyBackedClass is a convenient base class for a set of related KeyBacked types that exist +// under a single key prefix and other help functions relevant to the concepts that the class +// represent. +// +// A WatchableTrigger called trigger is provided, which a default key which is under the struct's +// root space. Alternatively, a custom WatchableTrigger can be provided to the constructor +// to use any other database key instead. + +class KeyBackedClass { +public: + KeyBackedClass(StringRef prefix, Optional triggerOverride = {}) + : subspace(prefix), trigger(triggerOverride.orDefault(subspace.pack("_changeTrigger"_sr))) {} + + Subspace subspace; + WatchableTrigger trigger; +}; + +#include "flow/unactorcompiler.h" + +#endif diff --git a/src/fdbclient/include/fdbclient/KeyLocationService.h b/src/fdbclient/include/fdbclient/KeyLocationService.h new file mode 100644 index 0000000..50e8e88 --- /dev/null +++ b/src/fdbclient/include/fdbclient/KeyLocationService.h @@ -0,0 +1,48 @@ +/* + * KeyLocationService.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ +#ifndef FOUNDATIONDB_KEYLOCATIONSERVICE_H +#define FOUNDATIONDB_KEYLOCATIONSERVICE_H + +#include "fdbclient/NativeAPI.actor.h" +#include "fdbclient/DatabaseContext.h" + +class IKeyLocationService { + + // If isBackward == true, returns the shard containing the key before 'key' (an infinitely long, inexpressible key). + // Otherwise returns the shard containing key. It's possible the returned location is a failed interface. + virtual Future getKeyLocation(TenantInfo tenant, + Key key, + SpanContext spanContext, + Optional debugID, + UseProvisionalProxies useProvisionalProxies, + Reverse isBackward, + Version version) = 0; + + virtual Future> getKeyRangeLocations(TenantInfo tenant, + KeyRange keys, + int limit, + Reverse reverse, + SpanContext spanContext, + Optional debugID, + UseProvisionalProxies useProvisionalProxies, + Version version) = 0; +}; + +#endif // FOUNDATIONDB_KEYLOCATIONSERVICE_H diff --git a/src/fdbclient/KeyRangeMap.h b/src/fdbclient/include/fdbclient/KeyRangeMap.h similarity index 94% rename from src/fdbclient/KeyRangeMap.h rename to src/fdbclient/include/fdbclient/KeyRangeMap.h index 88cce02..6e059dd 100644 --- a/src/fdbclient/KeyRangeMap.h +++ b/src/fdbclient/include/fdbclient/KeyRangeMap.h @@ -86,6 +86,7 @@ class CoalescedKeyRefRangeMap : public RangeMap(endKey, v), mapEnd(endKey) {} + void operator=(CoalescedKeyRefRangeMap&& r) noexcept { mapEnd = std::move(r.mapEnd); RangeMap::operator=(std::move(r)); @@ -100,10 +101,14 @@ class CoalescedKeyRangeMap : public RangeMap(endKey, v), mapEnd(endKey) {} + void operator=(CoalescedKeyRangeMap&& r) noexcept { mapEnd = std::move(r.mapEnd); RangeMap::operator=(std::move(r)); } + + CoalescedKeyRangeMap(CoalescedKeyRangeMap&& source) = default; + void insert(const KeyRangeRef& keys, const Val& value); void insert(const KeyRef& key, const Val& value); Key mapEnd; @@ -136,6 +141,16 @@ Future krmGetRanges(Reference const& tr, KeyRange const& keys, int const& limit = CLIENT_KNOBS->KRM_GET_RANGE_LIMIT, int const& limitBytes = CLIENT_KNOBS->KRM_GET_RANGE_LIMIT_BYTES); +Future krmGetRangesUnaligned(Transaction* const& tr, + Key const& mapPrefix, + KeyRange const& keys, + int const& limit = CLIENT_KNOBS->KRM_GET_RANGE_LIMIT, + int const& limitBytes = CLIENT_KNOBS->KRM_GET_RANGE_LIMIT_BYTES); +Future krmGetRangesUnaligned(Reference const& tr, + Key const& mapPrefix, + KeyRange const& keys, + int const& limit = CLIENT_KNOBS->KRM_GET_RANGE_LIMIT, + int const& limitBytes = CLIENT_KNOBS->KRM_GET_RANGE_LIMIT_BYTES); void krmSetPreviouslyEmptyRange(Transaction* tr, const KeyRef& mapPrefix, const KeyRangeRef& keys, @@ -162,7 +177,7 @@ Future krmSetRangeCoalescing(Reference const& t KeyRange const& range, KeyRange const& maxRange, Value const& value); -RangeResult krmDecodeRanges(KeyRef mapPrefix, KeyRange keys, RangeResult kv); +RangeResult krmDecodeRanges(KeyRef mapPrefix, KeyRange keys, RangeResult kv, bool align = true); template std::vector> KeyRangeMap::getAffectedRangesAfterInsertion( diff --git a/src/fdbclient/Knobs.h b/src/fdbclient/include/fdbclient/Knobs.h similarity index 100% rename from src/fdbclient/Knobs.h rename to src/fdbclient/include/fdbclient/Knobs.h diff --git a/src/fdbclient/LocalClientAPI.h b/src/fdbclient/include/fdbclient/LocalClientAPI.h similarity index 100% rename from src/fdbclient/LocalClientAPI.h rename to src/fdbclient/include/fdbclient/LocalClientAPI.h diff --git a/src/fdbclient/ManagementAPI.actor.g.h b/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h similarity index 53% rename from src/fdbclient/ManagementAPI.actor.g.h rename to src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h index 4f63703..338434f 100644 --- a/src/fdbclient/ManagementAPI.actor.g.h +++ b/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" /* * ManagementAPI.actor.h * @@ -43,14 +43,18 @@ standard API and some knowledge of the contents of the system key space. #include "fdbclient/MonitorLeader.h" #include "flow/actorcompiler.h" // has to be last include - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" -[[nodiscard]] Future getDatabaseConfiguration( Database const& cx ); + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" +[[nodiscard]] Future getDatabaseConfiguration( Transaction* const& tr, bool const& useSystemPriority = false ); -#line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" +[[nodiscard]] Future getDatabaseConfiguration( Database const& cx, bool const& useSystemPriority = false ); + +#line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future waitForFullReplication( Database const& cx ); -#line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" struct IQuorumChange : ReferenceCounted { virtual ~IQuorumChange() {} @@ -62,223 +66,230 @@ struct IQuorumChange : ReferenceCounted { }; // Change to use the given set of coordination servers - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" -[[nodiscard]] Future> changeQuorumChecker( Transaction* const& tr, ClusterConnectionString* const& conn, std::string const& newName ); + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" +[[nodiscard]] Future> changeQuorumChecker( Transaction* const& tr, ClusterConnectionString* const& conn, std::string const& newName, bool const& disableConfigDB ); -#line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future changeQuorum( Database const& cx, Reference const& change ); -#line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" Reference autoQuorumChange(int desired = -1); Reference nameQuorumChange(std::string const& name, Reference const& other); // Exclude the given set of servers from use as state servers. Returns as soon as the change is durable, without // necessarily waiting for the servers to be evacuated. A NetworkAddress with a port of 0 means all servers on the // given IP. - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future excludeServers( Database const& cx, std::vector const& servers, bool const& failed = false ); -#line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future excludeServers( Transaction* const& tr, std::vector const& servers, bool const& failed = false ); -#line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" // Exclude the servers matching the given set of localities from use as state servers. Returns as soon as the change // is durable, without necessarily waiting for the servers to be evacuated. - #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future excludeLocalities( Database const& cx, std::unordered_set const& localities, bool const& failed = false ); -#line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future excludeLocalities( Transaction* const& tr, std::unordered_set const& localities, bool const& failed = false ); -#line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" // Remove the given servers from the exclusion list. A NetworkAddress with a port of 0 means all servers on the given // IP. A NetworkAddress() means all servers (don't exclude anything) - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future includeServers( Database const& cx, std::vector const& servers, bool const& failed = false ); -#line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" // Remove the given localities from the exclusion list. - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future includeLocalities( Database const& cx, std::vector const& localities, bool const& failed = false, bool const& includeAll = false ); -#line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" // Set the process class of processes with the given address. A NetworkAddress with a port of 0 means all servers on // the given IP. - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future setClass( Database const& cx, AddressExclusion const& server, ProcessClass const& processClass ); -#line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" // Get the current list of excluded servers including both "exclude" and "failed". - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future> getAllExcludedServers( Database const& cx ); -#line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future> getAllExcludedServers( Transaction* const& tr ); -#line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" // Get the current list of excluded servers. - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future> getExcludedServerList( Transaction* const& tr ); -#line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" // Get the current list of failed servers. - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future> getExcludedFailedServerList( Transaction* const& tr ); -#line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" // Get the current list of excluded localities - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future> getAllExcludedLocalities( Database const& cx ); -#line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future> getAllExcludedLocalities( Transaction* const& tr ); -#line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" // Get the current list of excluded localities. - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future> getExcludedLocalityList( Transaction* const& tr ); -#line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" // Get the current list of failed localities. - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future> getExcludedFailedLocalityList( Transaction* const& tr ); -#line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" std::set getAddressesByLocality(const std::vector& workers, const std::string& locality); // Check for the given, previously excluded servers to be evacuated (no longer used for state). If waitForExclusion is // true, this actor returns once it is safe to shut down all such machines without impacting fault tolerance, until and // unless any of them are explicitly included with includeServers() - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future> checkForExcludingServers( Database const& cx, std::vector const& servers, bool const& waitForAllExcluded ); -#line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future checkForExcludingServersTxActor( ReadYourWritesTransaction* const& tr, std::set* const& exclusions, std::set* const& inProgressExclusion ); -#line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" // Gets a list of all workers in the cluster (excluding testers) - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future> getWorkers( Database const& cx ); -#line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future> getWorkers( Transaction* const& tr ); -#line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future timeKeeperSetDisable( Database const& cx ); -#line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future lockDatabase( Transaction* const& tr, UID const& id ); -#line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future lockDatabase( Reference const& tr, UID const& id ); -#line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future lockDatabase( Database const& cx, UID const& id ); -#line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" - #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future unlockDatabase( Transaction* const& tr, UID const& id ); -#line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future unlockDatabase( Reference const& tr, UID const& id ); -#line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future unlockDatabase( Database const& cx, UID const& id ); -#line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future checkDatabaseLock( Transaction* const& tr, UID const& id ); -#line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future checkDatabaseLock( Reference const& tr, UID const& id ); -#line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future updateChangeFeed( Transaction* const& tr, Key const& rangeID, ChangeFeedStatus const& status, KeyRange const& range = KeyRange() ); -#line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future updateChangeFeed( Reference const& tr, Key const& rangeID, ChangeFeedStatus const& status, KeyRange const& range = KeyRange() ); -#line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future updateChangeFeed( Database const& cx, Key const& rangeID, ChangeFeedStatus const& status, KeyRange const& range = KeyRange() ); -#line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" - #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future advanceVersion( Database const& cx, Version const& v ); -#line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future setDDMode( Database const& cx, int const& mode ); -#line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" - #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future forceRecovery( Reference const& clusterFile, Standalone const& dcId ); -#line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" -[[nodiscard]] Future printHealthyZone( Database const& cx ); +// Start an audit on range of the specific type. + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" +[[nodiscard]] Future auditStorage( Reference const& clusterFile, KeyRange const& range, AuditType const& type, KeyValueStoreType const& engineType, double const& timeoutSeconds ); + +#line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" +// Cancel an audit given type and id + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" +[[nodiscard]] Future cancelAuditStorage( Reference const& clusterFile, AuditType const& type, UID const& auditId, double const& timeoutSeconds ); -#line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" -[[nodiscard]] Future setDDIgnoreRebalanceSwitch( Database const& cx, bool const& ignoreRebalance ); +#line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" +[[nodiscard]] Future printHealthyZone( Database const& cx ); -#line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future clearHealthyZone( Database const& cx, bool const& printWarning = false, bool const& clearSSFailureZoneString = false ); -#line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" +#line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future setHealthyZone( Database const& cx, StringRef const& zoneId, double const& seconds, bool const& printWarning = false ); -#line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future waitForPrimaryDC( Database const& cx, StringRef const& dcId ); -#line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" // Gets the cluster connection string - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future> getConnectionString( Database const& cx ); -#line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" void schemaCoverage(std::string const& spath, bool covered = true); bool schemaMatch(json_spirit::mValue const& schema, @@ -291,10 +302,10 @@ bool schemaMatch(json_spirit::mValue const& schema, // execute payload in 'snapCmd' on all the coordinators, TLogs and // storage nodes - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.g.h" + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.g.h" [[nodiscard]] Future mgmtSnapCreate( Database const& cx, Standalone const& snapCmd, UID const& snapUID ); -#line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ManagementAPI.actor.h" +#line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ManagementAPI.actor.h" #include "flow/unactorcompiler.h" #endif diff --git a/src/fdbclient/ManagementAPI.actor.h b/src/fdbclient/include/fdbclient/ManagementAPI.actor.h similarity index 91% rename from src/fdbclient/ManagementAPI.actor.h rename to src/fdbclient/include/fdbclient/ManagementAPI.actor.h index f9d204b..3fe3b4e 100644 --- a/src/fdbclient/ManagementAPI.actor.h +++ b/src/fdbclient/include/fdbclient/ManagementAPI.actor.h @@ -41,7 +41,8 @@ standard API and some knowledge of the contents of the system key space. #include "fdbclient/MonitorLeader.h" #include "flow/actorcompiler.h" // has to be last include -ACTOR Future getDatabaseConfiguration(Database cx); +ACTOR Future getDatabaseConfiguration(Transaction* tr, bool useSystemPriority = false); +ACTOR Future getDatabaseConfiguration(Database cx, bool useSystemPriority = false); ACTOR Future waitForFullReplication(Database cx); struct IQuorumChange : ReferenceCounted { @@ -56,7 +57,8 @@ struct IQuorumChange : ReferenceCounted { // Change to use the given set of coordination servers ACTOR Future> changeQuorumChecker(Transaction* tr, ClusterConnectionString* conn, - std::string newName); + std::string newName, + bool disableConfigDB); ACTOR Future changeQuorum(Database cx, Reference change); Reference autoQuorumChange(int desired = -1); Reference nameQuorumChange(std::string const& name, Reference const& other); @@ -148,8 +150,19 @@ ACTOR Future setDDMode(Database cx, int mode); ACTOR Future forceRecovery(Reference clusterFile, Standalone dcId); +// Start an audit on range of the specific type. +ACTOR Future auditStorage(Reference clusterFile, + KeyRange range, + AuditType type, + KeyValueStoreType engineType, + double timeoutSeconds); +// Cancel an audit given type and id +ACTOR Future cancelAuditStorage(Reference clusterFile, + AuditType type, + UID auditId, + double timeoutSeconds); + ACTOR Future printHealthyZone(Database cx); -ACTOR Future setDDIgnoreRebalanceSwitch(Database cx, bool ignoreRebalance); ACTOR Future clearHealthyZone(Database cx, bool printWarning = false, bool clearSSFailureZoneString = false); ACTOR Future setHealthyZone(Database cx, StringRef zoneId, double seconds, bool printWarning = false); diff --git a/src/fdbclient/include/fdbclient/MetaclusterRegistration.h b/src/fdbclient/include/fdbclient/MetaclusterRegistration.h new file mode 100644 index 0000000..aab199b --- /dev/null +++ b/src/fdbclient/include/fdbclient/MetaclusterRegistration.h @@ -0,0 +1,119 @@ +/* + * MetaclusterRegistration.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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. + */ + +#ifndef FDBCLIENT_METACLUSTERREGISTRATION_H +#define FDBCLIENT_METACLUSTERREGISTRATION_H +#pragma once + +#include "fdbclient/FDBTypes.h" +#include "fdbclient/KeyBackedTypes.actor.h" +#include "flow/BooleanParam.h" + +std::string clusterTypeToString(const ClusterType& clusterType); + +struct MetaclusterRegistrationEntry { + constexpr static FileIdentifier file_identifier = 13448589; + + ClusterType clusterType; + + ClusterName metaclusterName; + ClusterName name; + UID metaclusterId; + UID id; + + MetaclusterRegistrationEntry() = default; + MetaclusterRegistrationEntry(ClusterName metaclusterName, UID metaclusterId) + : clusterType(ClusterType::METACLUSTER_MANAGEMENT), metaclusterName(metaclusterName), name(metaclusterName), + metaclusterId(metaclusterId), id(metaclusterId) {} + MetaclusterRegistrationEntry(ClusterName metaclusterName, ClusterName name, UID metaclusterId, UID id) + : clusterType(ClusterType::METACLUSTER_DATA), metaclusterName(metaclusterName), name(name), + metaclusterId(metaclusterId), id(id) { + ASSERT(metaclusterName != name && metaclusterId != id); + } + + // Returns true if this entry is associated with the same cluster as the passed in entry. If one entry is from the + // management cluster and the other is from a data cluster, this checks whether they are part of the same + // metacluster. + bool matches(MetaclusterRegistrationEntry const& other) const { + if (metaclusterName != other.metaclusterName || metaclusterId != other.metaclusterId) { + return false; + } else if (clusterType == ClusterType::METACLUSTER_DATA && other.clusterType == ClusterType::METACLUSTER_DATA && + (name != other.name || id != other.id)) { + return false; + } + + return true; + } + + MetaclusterRegistrationEntry toManagementClusterRegistration() const { + ASSERT(clusterType == ClusterType::METACLUSTER_DATA); + return MetaclusterRegistrationEntry(metaclusterName, metaclusterId); + } + + MetaclusterRegistrationEntry toDataClusterRegistration(ClusterName name, UID id) const { + ASSERT(clusterType == ClusterType::METACLUSTER_MANAGEMENT); + return MetaclusterRegistrationEntry(metaclusterName, name, metaclusterId, id); + } + + Value encode() const { return ObjectWriter::toValue(*this, IncludeVersion()); } + static MetaclusterRegistrationEntry decode(ValueRef const& value) { + return ObjectReader::fromStringRef(value, IncludeVersion()); + } + static Optional decode(Optional value) { + return value.map([](ValueRef const& v) { return MetaclusterRegistrationEntry::decode(v); }); + } + + std::string toString() const { + if (clusterType == ClusterType::METACLUSTER_MANAGEMENT) { + return fmt::format( + "metacluster name: {}, metacluster id: {}", printable(metaclusterName), metaclusterId.shortString()); + } else { + return fmt::format("metacluster name: {}, metacluster id: {}, data cluster name: {}, data cluster id: {}", + printable(metaclusterName), + metaclusterId.shortString(), + printable(name), + id.shortString()); + } + } + + bool operator==(MetaclusterRegistrationEntry const& other) const { + return clusterType == other.clusterType && metaclusterName == other.metaclusterName && name == other.name && + metaclusterId == other.metaclusterId && id == other.id; + } + + bool operator!=(MetaclusterRegistrationEntry const& other) const { return !(*this == other); } + + template + void serialize(Ar& ar) { + serializer(ar, clusterType, metaclusterName, name, metaclusterId, id); + } +}; + +template <> +struct Traceable : std::true_type { + static std::string toString(MetaclusterRegistrationEntry const& entry) { return entry.toString(); } +}; + +// Registration information for a metacluster, stored on both management and data clusters +namespace metacluster::metadata { +KeyBackedObjectProperty& metaclusterRegistration(); +}; // namespace metacluster::metadata + +#endif diff --git a/src/fdbclient/MonitorLeader.h b/src/fdbclient/include/fdbclient/MonitorLeader.h similarity index 99% rename from src/fdbclient/MonitorLeader.h rename to src/fdbclient/include/fdbclient/MonitorLeader.h index 86f2545..0aff580 100644 --- a/src/fdbclient/MonitorLeader.h +++ b/src/fdbclient/include/fdbclient/MonitorLeader.h @@ -26,7 +26,6 @@ #include "fdbclient/CoordinationInterface.h" #include "fdbclient/ClusterInterface.h" #include "fdbclient/CommitProxyInterface.h" -#include "fdbclient/ClientBooleanParams.h" #define CLUSTER_FILE_ENV_VAR_NAME "FDB_CLUSTER_FILE" diff --git a/src/fdbclient/MultiVersionAssignmentVars.h b/src/fdbclient/include/fdbclient/MultiVersionAssignmentVars.h similarity index 87% rename from src/fdbclient/MultiVersionAssignmentVars.h rename to src/fdbclient/include/fdbclient/MultiVersionAssignmentVars.h index 265ce0b..6b09436 100644 --- a/src/fdbclient/MultiVersionAssignmentVars.h +++ b/src/fdbclient/include/fdbclient/MultiVersionAssignmentVars.h @@ -28,16 +28,24 @@ template class AbortableSingleAssignmentVar final : public ThreadSingleAssignmentVar, public ThreadCallback { public: AbortableSingleAssignmentVar(ThreadFuture future, ThreadFuture abortSignal) - : future(future), abortSignal(abortSignal), hasBeenSet(false), callbacksCleared(false) { + : future(future), abortSignal(abortSignal), hasBeenSet(false), callbacksCleared(true) { int userParam; ThreadSingleAssignmentVar::addref(); ThreadSingleAssignmentVar::addref(); - // abortSignal comes first, because otherwise future could immediately call fire/error and attempt to remove - // this callback from abortSignal prematurely abortSignal.callOrSetAsCallback(this, userParam, 0); future.callOrSetAsCallback(this, userParam, 0); + + // One of the signals could be already fired + // Make sure that the other is cancelled, and the references removed + lock.enter(); + callbacksCleared = false; + bool hasBeenSet_ = hasBeenSet; + lock.leave(); + if (hasBeenSet_) { + cancelCallbacks(); + } } void cancel() override { @@ -104,12 +112,30 @@ class AbortableSingleAssignmentVar final : public ThreadSingleAssignmentVar, callbacksCleared = true; lock.leave(); - future.getPtr()->addref(); // Cancel will delref our future, but we don't want to destroy it until this - // callback gets destroyed + bool notificationRequired = true; + + if (future.clearCallback(this)) { + ThreadSingleAssignmentVar::delref(); + } else { + notificationRequired = false; + } + + // Cancel will delref our future, but we don't want to destroy it until this + // callback gets destroyed + future.getPtr()->addref(); future.getPtr()->cancel(); if (abortSignal.clearCallback(this)) { ThreadSingleAssignmentVar::delref(); + } else { + notificationRequired = false; + } + + if (notificationRequired) { + // The future has been cancelled before any of the signals were + // fired. Notify the futures about the cancellation + ASSERT(!hasBeenSet); + ThreadSingleAssignmentVar::sendError(operation_cancelled()); } } else { lock.leave(); @@ -236,8 +262,15 @@ class MapSingleAssignmentVar final : public ThreadSingleAssignmentVar, Thread } void cancel() override { - source.getPtr()->addref(); // Cancel will delref our future, but we don't want to destroy it until this callback - // gets destroyed + // Break the cyclic reference between this and the source future + if (source.clearCallback(this)) { + // If we successfully cleared the callback, it was not fired yet. + // In that case, set operation_cancelled() as the result of the future + sendResult(mapValue(operation_cancelled())); + ThreadSingleAssignmentVar::delref(); + } + source.getPtr()->addref(); // Cancel will delref the source future, but we don't want + // to destroy it until this callback gets destroyed source.getPtr()->cancel(); ThreadSingleAssignmentVar::cancel(); } diff --git a/src/fdbclient/MultiVersionTransaction.h b/src/fdbclient/include/fdbclient/MultiVersionTransaction.h similarity index 64% rename from src/fdbclient/MultiVersionTransaction.h rename to src/fdbclient/include/fdbclient/MultiVersionTransaction.h index 6e172d3..23d4a9c 100644 --- a/src/fdbclient/MultiVersionTransaction.h +++ b/src/fdbclient/include/fdbclient/MultiVersionTransaction.h @@ -20,15 +20,17 @@ #ifndef FDBCLIENT_MULTIVERSIONTRANSACTION_H #define FDBCLIENT_MULTIVERSIONTRANSACTION_H -#include "flow/ProtocolVersion.h" +#include "flow/Arena.h" #pragma once -#include "bindings/c/foundationdb/fdb_c_options.g.h" +#include "fdbclient/fdb_c_options.g.h" #include "fdbclient/FDBOptions.g.h" #include "fdbclient/FDBTypes.h" #include "fdbclient/IClientApi.h" - +#include "flow/ApiVersion.h" +#include "flow/ProtocolVersion.h" #include "flow/ThreadHelper.actor.h" +#include "flow/WipedString.h" // FdbCApi is used as a wrapper around the FoundationDB C API that gets loaded from an external client library. // All of the required functions loaded from that external library are stored in function pointers in this struct. @@ -89,6 +91,14 @@ struct FdbCApi : public ThreadSafeReferenceCounted { const void* endKey; int endKeyLength; } FDBKeyRange; + + typedef struct granulesummary { + FDBKeyRange key_range; + int64_t snapshot_version; + int64_t snapshot_size; + int64_t delta_version; + int64_t delta_size; + } FDBGranuleSummary; #pragma pack(pop) typedef struct readgranulecontext { @@ -122,11 +132,14 @@ struct FdbCApi : public ThreadSafeReferenceCounted { // Network fdb_error_t (*selectApiVersion)(int runtimeVersion, int headerVersion); const char* (*getClientVersion)(); + void (*useFutureProtocolVersion)(); + fdb_error_t (*setNetworkOption)(FDBNetworkOption option, uint8_t const* value, int valueLength); fdb_error_t (*setupNetwork)(); fdb_error_t (*runNetwork)(); fdb_error_t (*stopNetwork)(); fdb_error_t (*createDatabase)(const char* clusterFilePath, FDBDatabase** db); + fdb_error_t (*createDatabaseFromConnectionString)(const char* connectionString, FDBDatabase** db); // Database fdb_error_t (*databaseOpenTenant)(FDBDatabase* database, @@ -156,18 +169,116 @@ struct FdbCApi : public ThreadSafeReferenceCounted { double (*databaseGetMainThreadBusyness)(FDBDatabase* database); FDBFuture* (*databaseGetServerProtocol)(FDBDatabase* database, uint64_t expectedVersion); - FDBFuture* (*purgeBlobGranules)(FDBDatabase* db, - uint8_t const* begin_key_name, - int begin_key_name_length, - uint8_t const* end_key_name, - int end_key_name_length, - int64_t purge_version, - fdb_bool_t force); - - FDBFuture* (*waitPurgeGranulesComplete)(FDBDatabase* db, uint8_t const* purge_key_name, int purge_key_name_length); + FDBFuture* (*databasePurgeBlobGranules)(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t purge_version, + fdb_bool_t force); + + FDBFuture* (*databaseWaitPurgeGranulesComplete)(FDBDatabase* db, + uint8_t const* purge_key_name, + int purge_key_name_length); + + FDBFuture* (*databaseBlobbifyRange)(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length); + + FDBFuture* (*databaseBlobbifyRangeBlocking)(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length); + + FDBFuture* (*databaseUnblobbifyRange)(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length); + + FDBFuture* (*databaseListBlobbifiedRanges)(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int rangeLimit); + + FDBFuture* (*databaseVerifyBlobRange)(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t version); + + FDBFuture* (*databaseFlushBlobRange)(FDBDatabase* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + fdb_bool_t compact, + int64_t version); + + FDBFuture* (*databaseGetClientStatus)(FDBDatabase* db); // Tenant fdb_error_t (*tenantCreateTransaction)(FDBTenant* tenant, FDBTransaction** outTransaction); + + FDBFuture* (*tenantPurgeBlobGranules)(FDBTenant* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t purge_version, + fdb_bool_t force); + + FDBFuture* (*tenantWaitPurgeGranulesComplete)(FDBTenant* db, + uint8_t const* purge_key_name, + int purge_key_name_length); + + FDBFuture* (*tenantBlobbifyRange)(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length); + + FDBFuture* (*tenantBlobbifyRangeBlocking)(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length); + + FDBFuture* (*tenantUnblobbifyRange)(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length); + + FDBFuture* (*tenantListBlobbifiedRanges)(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int rangeLimit); + + FDBFuture* (*tenantVerifyBlobRange)(FDBTenant* tenant, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t version); + + FDBFuture* (*tenantFlushBlobRange)(FDBTenant* db, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + fdb_bool_t compact, + int64_t version); + + FDBFuture* (*tenantGetId)(FDBTenant* tenant); void (*tenantDestroy)(FDBTenant* tenant); // Transaction @@ -253,23 +364,52 @@ struct FdbCApi : public ThreadSafeReferenceCounted { int end_key_name_length, int64_t chunkSize); - FDBFuture* (*transactionGetBlobGranuleRanges)(FDBTransaction* db, + FDBFuture* (*transactionGetBlobGranuleRanges)(FDBTransaction* tr, uint8_t const* begin_key_name, int begin_key_name_length, uint8_t const* end_key_name, - int end_key_name_length); + int end_key_name_length, + int rangeLimit); - FDBResult* (*transactionReadBlobGranules)(FDBTransaction* db, + FDBResult* (*transactionReadBlobGranules)(FDBTransaction* tr, uint8_t const* begin_key_name, int begin_key_name_length, uint8_t const* end_key_name, int end_key_name_length, int64_t beginVersion, - int64_t readVersion, - FDBReadBlobGranuleContext granule_context); + int64_t readVersion); + + FDBFuture* (*transactionReadBlobGranulesStart)(FDBTransaction* tr, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t beginVersion, + int64_t readVersion, + int64_t* readVersionOut); + + FDBResult* (*transactionReadBlobGranulesFinish)(FDBTransaction* tr, + FDBFuture* startFuture, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t beginVersion, + int64_t readVersion, + FDBReadBlobGranuleContext* granule_context); + + FDBFuture* (*transactionSummarizeBlobGranules)(FDBTransaction* tr, + uint8_t const* begin_key_name, + int begin_key_name_length, + uint8_t const* end_key_name, + int end_key_name_length, + int64_t summaryVersion, + int rangeLimit); FDBFuture* (*transactionCommit)(FDBTransaction* tr); fdb_error_t (*transactionGetCommittedVersion)(FDBTransaction* tr, int64_t* outVersion); + FDBFuture* (*transactionGetTagThrottledDuration)(FDBTransaction* tr); + FDBFuture* (*transactionGetTotalCost)(FDBTransaction* tr); FDBFuture* (*transactionGetApproximateSize)(FDBTransaction* tr); FDBFuture* (*transactionWatch)(FDBTransaction* tr, uint8_t const* keyName, int keyNameLength); FDBFuture* (*transactionOnError)(FDBTransaction* tr, fdb_error_t error); @@ -287,7 +427,8 @@ struct FdbCApi : public ThreadSafeReferenceCounted { fdb_error_t (*futureGetDatabase)(FDBFuture* f, FDBDatabase** outDb); fdb_error_t (*futureGetInt64)(FDBFuture* f, int64_t* outValue); fdb_error_t (*futureGetUInt64)(FDBFuture* f, uint64_t* outValue); - fdb_error_t (*futureGetBool)(FDBFuture* f, bool* outValue); + fdb_error_t (*futureGetBool)(FDBFuture* f, fdb_bool_t* outValue); + fdb_error_t (*futureGetDouble)(FDBFuture* f, double* outValue); fdb_error_t (*futureGetError)(FDBFuture* f); fdb_error_t (*futureGetKey)(FDBFuture* f, uint8_t const** outKey, int* outKeyLength); fdb_error_t (*futureGetValue)(FDBFuture* f, fdb_bool_t* outPresent, uint8_t const** outValue, int* outValueLength); @@ -299,6 +440,7 @@ struct FdbCApi : public ThreadSafeReferenceCounted { FDBMappedKeyValue const** outKVM, int* outCount, fdb_bool_t* outMore); + fdb_error_t (*futureGetGranuleSummaryArray)(FDBFuture* f, const FDBGranuleSummary** out_summaries, int* outCount); fdb_error_t (*futureGetSharedState)(FDBFuture* f, DatabaseSharedState** outPtr); fdb_error_t (*futureSetCallback)(FDBFuture* f, FDBCallback callback, void* callback_parameter); void (*futureCancel)(FDBFuture* f); @@ -356,13 +498,30 @@ class DLTransaction : public ITransaction, ThreadSafeReferenceCounted getEstimatedRangeSizeBytes(const KeyRangeRef& keys) override; ThreadFuture>> getRangeSplitPoints(const KeyRangeRef& range, int64_t chunkSize) override; - ThreadFuture>> getBlobGranuleRanges(const KeyRangeRef& keyRange) override; + ThreadFuture>> getBlobGranuleRanges(const KeyRangeRef& keyRange, + int rangeLimit) override; ThreadResult readBlobGranules(const KeyRangeRef& keyRange, Version beginVersion, Optional readVersion, ReadBlobGranuleContext granule_context) override; + ThreadFuture>> readBlobGranulesStart(const KeyRangeRef& keyRange, + Version beginVersion, + Optional readVersion, + Version* readVersionOut) override; + + ThreadResult readBlobGranulesFinish( + ThreadFuture>> startFuture, + const KeyRangeRef& keyRange, + Version beginVersion, + Version readVersion, + ReadBlobGranuleContext granuleContext) override; + + ThreadFuture>> summarizeBlobGranules(const KeyRangeRef& keyRange, + Optional summaryVersion, + int rangeLimit) override; + void addReadConflictRange(const KeyRangeRef& keys) override; void atomicOp(const KeyRef& key, const ValueRef& value, uint32_t operationType) override; @@ -378,7 +537,9 @@ class DLTransaction : public ITransaction, ThreadSafeReferenceCounted commit() override; Version getCommittedVersion() override; ThreadFuture getVersionVector() override; - ThreadFuture getSpanID() override { return UID(); }; + ThreadFuture getSpanContext() override { return SpanContext(); }; + ThreadFuture getTagThrottledDuration() override; + ThreadFuture getTotalCost() override; ThreadFuture getApproximateSize() override; void setOption(FDBTransactionOptions::Option option, Optional value = Optional()) override; @@ -391,6 +552,9 @@ class DLTransaction : public ITransaction, ThreadSafeReferenceCounted::addref(); } void delref() override { ThreadSafeReferenceCounted::delref(); } @@ -410,6 +574,19 @@ class DLTenant : public ITenant, ThreadSafeReferenceCounted { Reference createTransaction() override; + ThreadFuture getId() override; + ThreadFuture purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) override; + ThreadFuture waitPurgeGranulesComplete(const KeyRef& purgeKey) override; + + ThreadFuture blobbifyRange(const KeyRangeRef& keyRange) override; + ThreadFuture blobbifyRangeBlocking(const KeyRangeRef& keyRange) override; + ThreadFuture unblobbifyRange(const KeyRangeRef& keyRange) override; + ThreadFuture>> listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) override; + + ThreadFuture verifyBlobRange(const KeyRangeRef& keyRange, Optional version) override; + ThreadFuture flushBlobRange(const KeyRangeRef& keyRange, bool compact, Optional version) override; + void addref() override { ThreadSafeReferenceCounted::addref(); } void delref() override { ThreadSafeReferenceCounted::delref(); } @@ -453,9 +630,21 @@ class DLDatabase : public IDatabase, ThreadSafeReferenceCounted { ThreadFuture purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) override; ThreadFuture waitPurgeGranulesComplete(const KeyRef& purgeKey) override; + ThreadFuture blobbifyRange(const KeyRangeRef& keyRange) override; + ThreadFuture blobbifyRangeBlocking(const KeyRangeRef& keyRange) override; + ThreadFuture unblobbifyRange(const KeyRangeRef& keyRange) override; + ThreadFuture>> listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) override; + + ThreadFuture verifyBlobRange(const KeyRangeRef& keyRange, Optional version) override; + ThreadFuture flushBlobRange(const KeyRangeRef& keyRange, bool compact, Optional version) override; + ThreadFuture createSharedState() override; void setSharedState(DatabaseSharedState* p) override; + // Return a JSON string containing database client-side status information + ThreadFuture> getClientStatus() override; + private: const Reference api; FdbCApi::FDBDatabase* @@ -471,15 +660,18 @@ class DLApi : public IClientApi { void selectApiVersion(int apiVersion) override; const char* getClientVersion() override; + void useFutureProtocolVersion() override; void setNetworkOption(FDBNetworkOptions::Option option, Optional value = Optional()) override; void setupNetwork() override; void runNetwork() override; void stopNetwork() override; - Reference createDatabase(const char* clusterFilePath) override; + Reference createDatabase(const char* clusterFile) override; Reference createDatabase609(const char* clusterFilePath); // legacy database creation + Reference createDatabaseFromConnectionString(const char* connectionString) override; + void addNetworkThreadCompletionHook(void (*hook)(void*), void* hookParameter) override; private: @@ -547,13 +739,30 @@ class MultiVersionTransaction : public ITransaction, ThreadSafeReferenceCounted< ThreadFuture>> getRangeSplitPoints(const KeyRangeRef& range, int64_t chunkSize) override; - ThreadFuture>> getBlobGranuleRanges(const KeyRangeRef& keyRange) override; + ThreadFuture>> getBlobGranuleRanges(const KeyRangeRef& keyRange, + int rangeLimit) override; ThreadResult readBlobGranules(const KeyRangeRef& keyRange, Version beginVersion, Optional readVersion, ReadBlobGranuleContext granule_context) override; + ThreadFuture>> readBlobGranulesStart(const KeyRangeRef& keyRange, + Version beginVersion, + Optional readVersion, + Version* readVersionOut) override; + + ThreadResult readBlobGranulesFinish( + ThreadFuture>> startFuture, + const KeyRangeRef& keyRange, + Version beginVersion, + Version readVersion, + ReadBlobGranuleContext granuleContext) override; + + ThreadFuture>> summarizeBlobGranules(const KeyRangeRef& keyRange, + Optional summaryVersion, + int rangeLimit) override; + void atomicOp(const KeyRef& key, const ValueRef& value, uint32_t operationType) override; void set(const KeyRef& key, const ValueRef& value) override; void clear(const KeyRef& begin, const KeyRef& end) override; @@ -567,7 +776,9 @@ class MultiVersionTransaction : public ITransaction, ThreadSafeReferenceCounted< ThreadFuture commit() override; Version getCommittedVersion() override; ThreadFuture getVersionVector() override; - ThreadFuture getSpanID() override; + ThreadFuture getSpanContext() override; + ThreadFuture getTagThrottledDuration() override; + ThreadFuture getTotalCost() override; ThreadFuture getApproximateSize() override; void setOption(FDBTransactionOptions::Option option, Optional value = Optional()) override; @@ -583,6 +794,12 @@ class MultiVersionTransaction : public ITransaction, ThreadSafeReferenceCounted< // return true if the underlying transaction pointer is not empty bool isValid() override; + // These currently only work for local clients. To support external clients, + // we would likely need to store the events/messages in the MVC layer and add a hook + // here to commit. + void debugTrace(BaseTraceEvent&& event) override; + void debugPrint(std::string const& message) override; + private: const Reference db; const Optional> tenant; @@ -591,6 +808,7 @@ class MultiVersionTransaction : public ITransaction, ThreadSafeReferenceCounted< struct TransactionInfo { Reference transaction; ThreadFuture onChange; + ErrorOr dbError = ErrorOr(Void()); }; // Timeout related variables for MultiVersionTransaction objects that do not have an underlying ITransaction @@ -612,6 +830,8 @@ class MultiVersionTransaction : public ITransaction, ThreadSafeReferenceCounted< // if we don't have an underlying database object to connect with. void setTimeout(Optional value); + void resetTimeout(); + // Creates a ThreadFuture that will signal an error if the transaction times out. template ThreadFuture makeTimeout(); @@ -619,22 +839,29 @@ class MultiVersionTransaction : public ITransaction, ThreadSafeReferenceCounted< template ThreadResult abortableTimeoutResult(ThreadFuture abortSignal); + template + ThreadResult abortableResult(ThreadResult result, ThreadFuture abortSignal); + TransactionInfo transaction; TransactionInfo getTransaction(); - void updateTransaction(); + void updateTransaction(bool setPersistentOptions); void setDefaultOptions(UniqueOrderedOptionList options); - std::vector>>> persistentOptions; + template + ThreadFuture executeOperation(ThreadFuture (ITransaction::*func)(Args...), Args&&... args); - const Optional tenantName; + std::vector>>> persistentOptions; + std::vector>> sensitivePersistentOptions; }; struct ClientDesc { std::string const libPath; bool const external; + bool const useFutureVersion; - ClientDesc(std::string libPath, bool external) : libPath(libPath), external(external) {} + ClientDesc(std::string libPath, bool external, bool useFutureVersion) + : libPath(libPath), external(external), useFutureVersion(useFutureVersion) {} }; struct ClientInfo : ClientDesc, ThreadSafeReferenceCounted { @@ -643,17 +870,22 @@ struct ClientInfo : ClientDesc, ThreadSafeReferenceCounted { IClientApi* api; bool failed; std::atomic_bool initialized; + int threadIndex; std::vector> threadCompletionHooks; ClientInfo() - : ClientDesc(std::string(), false), protocolVersion(0), api(nullptr), failed(true), initialized(false) {} + : ClientDesc(std::string(), false, false), protocolVersion(0), api(nullptr), failed(true), initialized(false), + threadIndex(0) {} ClientInfo(IClientApi* api) - : ClientDesc("internal", false), protocolVersion(0), api(api), failed(false), initialized(false) {} - ClientInfo(IClientApi* api, std::string libPath) - : ClientDesc(libPath, true), protocolVersion(0), api(api), failed(false), initialized(false) {} + : ClientDesc("internal", false, false), protocolVersion(0), api(api), failed(false), initialized(false), + threadIndex(0) {} + ClientInfo(IClientApi* api, std::string libPath, bool useFutureVersion, int threadIndex) + : ClientDesc(libPath, true, useFutureVersion), protocolVersion(0), api(api), failed(false), initialized(false), + threadIndex(threadIndex) {} void loadVersion(); bool canReplace(Reference other) const; + std::string getTraceFileIdentifier(const std::string& baseIdentifier); }; class MultiVersionApi; @@ -663,18 +895,33 @@ class MultiVersionApi; // it connects with a different version. class MultiVersionTenant final : public ITenant, ThreadSafeReferenceCounted { public: - MultiVersionTenant(Reference db, StringRef tenantName); + MultiVersionTenant(Reference db, TenantNameRef tenantName); ~MultiVersionTenant() override; Reference createTransaction() override; + template + ThreadFuture executeOperation(ThreadFuture (ITenant::*func)(Args...), Args&&... args); + + ThreadFuture getId() override; + ThreadFuture purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) override; + ThreadFuture waitPurgeGranulesComplete(const KeyRef& purgeKey) override; + + ThreadFuture blobbifyRange(const KeyRangeRef& keyRange) override; + ThreadFuture blobbifyRangeBlocking(const KeyRangeRef& keyRange) override; + ThreadFuture unblobbifyRange(const KeyRangeRef& keyRange) override; + ThreadFuture>> listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) override; + ThreadFuture verifyBlobRange(const KeyRangeRef& keyRange, Optional version) override; + ThreadFuture flushBlobRange(const KeyRangeRef& keyRange, bool compact, Optional version) override; + void addref() override { ThreadSafeReferenceCounted::addref(); } void delref() override { ThreadSafeReferenceCounted::delref(); } // A struct that manages the current connection state of the MultiVersionDatabase. This wraps the underlying // IDatabase object that is currently interacting with the cluster. struct TenantState : ThreadSafeReferenceCounted { - TenantState(Reference db, StringRef tenantName); + TenantState(Reference db, TenantNameRef tenantName); // Creates a new underlying tenant object whenever the database connection changes. This change is signaled // to open transactions via an AsyncVar. @@ -684,7 +931,7 @@ class MultiVersionTenant final : public ITenant, ThreadSafeReferenceCounted>> tenantVar; - const Standalone tenantName; + const TenantName tenantName; Reference db; @@ -697,6 +944,57 @@ class MultiVersionTenant final : public ITenant, ThreadSafeReferenceCounted tenantState; }; +class ClusterConnectionRecord { +private: + enum class Type { FILE, CONNECTION_STRING }; + ClusterConnectionRecord(Type type, std::string const& recordStr) : type(type), recordStr(recordStr) {} + + Type type; + std::string recordStr; + +public: + static ClusterConnectionRecord fromFile(std::string const& clusterFilePath) { + return ClusterConnectionRecord(Type::FILE, clusterFilePath); + } + + static ClusterConnectionRecord fromConnectionString(std::string const& connectionString) { + return ClusterConnectionRecord(Type::CONNECTION_STRING, connectionString); + } + + Reference createDatabase(IClientApi* api) const { + switch (type) { + case Type::FILE: + return api->createDatabase(recordStr.c_str()); + case Type::CONNECTION_STRING: + return api->createDatabaseFromConnectionString(recordStr.c_str()); + default: + ASSERT(false); + throw internal_error(); + } + } + + std::string toString() const { + switch (type) { + case Type::FILE: + if (recordStr.empty()) { + return "default file"; + } else { + return "file: " + recordStr; + } + case Type::CONNECTION_STRING: + return "connection string: " + recordStr; + default: + ASSERT(false); + throw internal_error(); + } + } +}; + +template <> +struct Traceable : std::true_type { + static std::string toString(ClusterConnectionRecord const& connectionRecord) { return connectionRecord.toString(); } +}; + // An implementation of IDatabase that wraps a database created either locally or through a dynamically loaded // external client. The MultiVersionDatabase monitors the protocol version of the cluster and automatically // replaces the wrapped database when the protocol version changes. @@ -704,7 +1002,7 @@ class MultiVersionDatabase final : public IDatabase, ThreadSafeReferenceCounted< public: MultiVersionDatabase(MultiVersionApi* api, int threadIdx, - std::string clusterFilePath, + ClusterConnectionRecord const& connectionRecord, Reference db, Reference versionMonitorDb, bool openConnectors = true); @@ -729,6 +1027,9 @@ class MultiVersionDatabase final : public IDatabase, ThreadSafeReferenceCounted< // For internal use in testing static Reference debugCreateFromExistingDatabase(Reference db); + template + ThreadFuture executeOperation(ThreadFuture (IDatabase::*func)(Args...), Args&&... args); + ThreadFuture rebootWorker(const StringRef& address, bool check, int duration) override; ThreadFuture forceRecoveryWithDataLoss(const StringRef& dcid) override; ThreadFuture createSnapshot(const StringRef& uid, const StringRef& snapshot_command) override; @@ -736,17 +1037,31 @@ class MultiVersionDatabase final : public IDatabase, ThreadSafeReferenceCounted< ThreadFuture purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) override; ThreadFuture waitPurgeGranulesComplete(const KeyRef& purgeKey) override; + ThreadFuture blobbifyRange(const KeyRangeRef& keyRange) override; + ThreadFuture blobbifyRangeBlocking(const KeyRangeRef& keyRange) override; + ThreadFuture unblobbifyRange(const KeyRangeRef& keyRange) override; + ThreadFuture>> listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) override; + ThreadFuture verifyBlobRange(const KeyRangeRef& keyRange, Optional version) override; + ThreadFuture flushBlobRange(const KeyRangeRef& keyRange, bool compact, Optional version) override; + ThreadFuture createSharedState() override; void setSharedState(DatabaseSharedState* p) override; + // Return a JSON string containing database client-side status information + ThreadFuture> getClientStatus() override; + // private: struct LegacyVersionMonitor; + // Database initialization state + enum class InitializationState { INITIALIZING, INITIALIZATION_FAILED, CREATED, INCOMPATIBLE, CLOSED }; + // A struct that manages the current connection state of the MultiVersionDatabase. This wraps the underlying // IDatabase object that is currently interacting with the cluster. struct DatabaseState : ThreadSafeReferenceCounted { - DatabaseState(std::string clusterFilePath, Reference versionMonitorDb); + DatabaseState(ClusterConnectionRecord const& connectionRecord, Reference versionMonitorDb); // Replaces the active database connection with a new one. Must be called from the main thread. void updateDatabase(Reference newDb, Reference client); @@ -766,24 +1081,42 @@ class MultiVersionDatabase final : public IDatabase, ThreadSafeReferenceCounted< // Must be called from the main thread void startLegacyVersionMonitors(); + // Set a new database connnection + void setDatabase(Reference db); + + // Get database intialization error if initialization failed + ErrorOr getInitializationError(); + + // Return a JSON string containing database client-side status information + Standalone getClientStatus(ErrorOr> dbContextStatus); + // Cleans up state for the legacy version monitors to break reference cycles void close(); Reference db; const Reference>> dbVar; - std::string clusterFilePath; + ClusterConnectionRecord connectionRecord; + std::string clusterId; // Used to monitor the cluster protocol version. Will be the same as db unless we have either not connected // yet or if the client version associated with db does not support protocol monitoring. In those cases, // this will be a specially created local db. Reference versionMonitorDb; - bool closed; + // The current database initialization state + std::atomic initializationState; + + // Last error received during database initialization + // Set on transition to INITIALIZATION_FAILED state, never changed afterwards + Error initializationError; ThreadFuture changed; ThreadFuture dbReady; ThreadFuture protocolVersionMonitor; + Future sharedStateUpdater; + bool isConfigDB; + // Versions older than 6.1 do not benefit from having their database connections closed. Additionally, // there are various issues that result in negative behavior in some cases if the connections are closed. // Therefore, we leave them open. @@ -840,6 +1173,7 @@ class MultiVersionApi : public IClientApi { public: void selectApiVersion(int apiVersion) override; const char* getClientVersion() override; + void useFutureProtocolVersion() override; void setNetworkOption(FDBNetworkOptions::Option option, Optional value = Optional()) override; void setupNetwork() override; @@ -848,23 +1182,40 @@ class MultiVersionApi : public IClientApi { void addNetworkThreadCompletionHook(void (*hook)(void*), void* hookParameter) override; // Creates an IDatabase object that represents a connection to the cluster + Reference createDatabase(ClusterConnectionRecord const& connectionRecord); Reference createDatabase(const char* clusterFilePath) override; + Reference createDatabaseFromConnectionString(const char* connectionString) override; + static MultiVersionApi* api; Reference getLocalClient(); void runOnExternalClients(int threadId, std::function)>, - bool runOnFailedClients = false); - void runOnExternalClientsAllThreads(std::function)>, bool runOnFailedClients = false); + bool runOnFailedClients = false, + bool failOnError = false); + void runOnExternalClientsAllThreads(std::function)>, + bool runOnFailedClients = false, + bool failOnError = false); + bool hasNonFailedExternalClients(); void updateSupportedVersions(); bool callbackOnMainThread; bool localClientDisabled; - ThreadFuture updateClusterSharedStateMap(std::string clusterFilePath, Reference db); - void clearClusterSharedStateMapEntry(std::string clusterFilePath); + Future updateClusterSharedStateMap(ClusterConnectionRecord const& connectionRecord, + ProtocolVersion dbProtocolVersion, + Reference db); + void clearClusterSharedStateMapEntry(std::string clusterId, ProtocolVersion dbProtocolVersion); - static bool apiVersionAtLeast(int minVersion); + // Map of cluster ID -> DatabaseSharedState pointer Future + // Upon cluster version upgrade, clear the map entry for that cluster + struct SharedStateInfo { + ThreadFuture sharedStateFuture; + ProtocolVersion protocolVersion; + }; + std::map clusterSharedStateMap; + + ApiVersion getApiVersion() { return apiVersion; } private: MultiVersionApi(); @@ -873,7 +1224,7 @@ class MultiVersionApi : public IClientApi { void disableMultiVersionClientApi(); void setCallbacksOnExternalThreads(); - void addExternalLibrary(std::string path); + void addExternalLibrary(std::string path, bool useFutureVersion); void addExternalLibraryDirectory(std::string path); // Return a vector of (pathname, unlink_on_close) pairs. Makes threadCount - 1 copies of the library stored in // path, and returns a vector of length threadCount. @@ -886,25 +1237,29 @@ class MultiVersionApi : public IClientApi { Reference localClient; std::map externalClientDescriptions; std::map>> externalClients; - // Map of clusterFilePath -> DatabaseSharedState pointer Future - // Upon cluster version upgrade, clear the map entry for that cluster - std::map> clusterSharedStateMap; bool networkStartSetup; volatile bool networkSetup; + bool disableBypass; volatile bool bypassMultiClientApi; volatile bool externalClient; + bool ignoreExternalClientFailures; + bool failIncompatibleClient; bool retainClientLibCopies; - - int apiVersion; + ApiVersion apiVersion; int nextThread = 0; int threadCount; + std::string tmpDir; + bool traceShareBaseNameAmongThreads; + std::string traceFileIdentifier; Mutex lock; std::vector>>> options; std::map>> setEnvOptions; volatile bool envOptionsLoaded; + + friend struct MultiVersionDatabase::DatabaseState; }; #endif diff --git a/src/fdbclient/MutationList.h b/src/fdbclient/include/fdbclient/MutationList.h similarity index 100% rename from src/fdbclient/MutationList.h rename to src/fdbclient/include/fdbclient/MutationList.h diff --git a/src/fdbclient/MutationLogReader.actor.g.h b/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h similarity index 67% rename from src/fdbclient/MutationLogReader.actor.g.h rename to src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h index 2d2f032..c367e92 100644 --- a/src/fdbclient/MutationLogReader.actor.g.h +++ b/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" /* * MutationLogReader.actor.h * @@ -70,11 +70,11 @@ class PipelinedReader { void startReading(Database cx); Future getNext(Database cx); - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.h" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h" [[nodiscard]] static Future getNext_impl( PipelinedReader* const& self, Database const& cx ); template friend class PipelinedReader_GetNext_implActorState; -#line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" +#line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" void release() { readerLimit.release(); } @@ -86,8 +86,9 @@ template friend class PipelinedReader_GetNext_implActorState; Future done() { return reader; } private: - Version beginVersion, endVersion, currentBeginVersion; - unsigned pipelineDepth; + [[maybe_unused]] Version beginVersion; + Version endVersion, currentBeginVersion; + [[maybe_unused]] unsigned pipelineDepth; Future reader; }; @@ -114,32 +115,32 @@ class MutationLogReader : public ReferenceCounted { } } - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.h" + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h" // This generated class is to be used only via Create() - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" template - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" class CreateActorState { - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.h" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h" public: - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" CreateActorState(Database const& cx,Version const& bv,Version const& ev,Key const& uid,Key const& beginKey,unsigned const& pd) - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" : cx(cx), - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" bv(bv), - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" ev(ev), - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" uid(uid), - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" beginKey(beginKey), - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" pd(pd), - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" self(new MutationLogReader(cx, bv, ev, uid, beginKey, pd)) - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h" { fdb_probe_actor_create("Create", reinterpret_cast(this)); @@ -152,16 +153,16 @@ class CreateActorState { int a_body1(int loopDepth=0) { try { - #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" StrictFuture __when_expr_0 = self->initializePQ(self.getPtr()); - #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.h" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.h" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -182,9 +183,9 @@ class CreateActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(self); this->~CreateActorState(); static_cast(this)->destroy(); return 0; } - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.h" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(self)); // state_var_RVO this->~CreateActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -194,9 +195,9 @@ class CreateActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(self); this->~CreateActorState(); static_cast(this)->destroy(); return 0; } - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.h" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(self)); // state_var_RVO this->~CreateActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -267,26 +268,26 @@ class CreateActorState { fdb_probe_actor_exit("Create", reinterpret_cast(this), 0); } - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" Database cx; - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" Version bv; - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" Version ev; - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" Key uid; - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" Key beginKey; - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" unsigned pd; - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" Reference self; - #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.h" + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h" }; // This generated class is to be used only via Create() - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" class CreateActor final : public Actor>, public ActorCallback< CreateActor, 0, Void >, public FastAllocated, public CreateActorState { - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.h" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -295,9 +296,9 @@ class CreateActor final : public Actor>, public Act void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< CreateActor, 0, Void >; - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" CreateActor(Database const& cx,Version const& bv,Version const& ev,Key const& uid,Key const& beginKey,unsigned const& pd) - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.h" + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h" : Actor>(), CreateActorState(cx, bv, ev, uid, beginKey, pd) { @@ -320,28 +321,28 @@ friend struct ActorCallback< CreateActor, 0, Void >; } }; - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" [[nodiscard]] static Future> Create( Database const& cx, Version const& bv, Version const& ev, Key const& uid, Key const& beginKey, unsigned const& pd ) { - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" return Future>(new CreateActor(cx, bv, ev, uid, beginKey, pd)); - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.h" + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h" } -#line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" +#line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" Future> getNext(); private: - #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.h" + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h" [[nodiscard]] static Future initializePQ( MutationLogReader* const& self ); template friend class MutationLogReader_InitializePQActorState; -#line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.g.h" +#line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.g.h" [[nodiscard]] static Future> getNext_impl( MutationLogReader* const& self ); template friend class MutationLogReader_GetNext_implActorState; -#line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/MutationLogReader.actor.h" +#line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/MutationLogReader.actor.h" std::vector> pipelinedReaders; std::priority_queue priorityQueue; diff --git a/src/fdbclient/MutationLogReader.actor.h b/src/fdbclient/include/fdbclient/MutationLogReader.actor.h similarity index 97% rename from src/fdbclient/MutationLogReader.actor.h rename to src/fdbclient/include/fdbclient/MutationLogReader.actor.h index 671d461..831135a 100644 --- a/src/fdbclient/MutationLogReader.actor.h +++ b/src/fdbclient/include/fdbclient/MutationLogReader.actor.h @@ -80,8 +80,9 @@ class PipelinedReader { Future done() { return reader; } private: - Version beginVersion, endVersion, currentBeginVersion; - unsigned pipelineDepth; + [[maybe_unused]] Version beginVersion; + Version endVersion, currentBeginVersion; + [[maybe_unused]] unsigned pipelineDepth; Future reader; }; diff --git a/src/fdbclient/NameLineage.h b/src/fdbclient/include/fdbclient/NameLineage.h similarity index 100% rename from src/fdbclient/NameLineage.h rename to src/fdbclient/include/fdbclient/NameLineage.h diff --git a/src/fdbclient/NativeAPI.actor.g.h b/src/fdbclient/include/fdbclient/NativeAPI.actor.g.h similarity index 66% rename from src/fdbclient/NativeAPI.actor.g.h rename to src/fdbclient/include/fdbclient/NativeAPI.actor.g.h index a013c8b..c63de0d 100644 --- a/src/fdbclient/NativeAPI.actor.g.h +++ b/src/fdbclient/include/fdbclient/NativeAPI.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.h" /* * NativeAPI.actor.h * @@ -29,9 +29,9 @@ #include "flow/BooleanParam.h" #include "flow/flow.h" +#include "flow/WipedString.h" #include "flow/TDMetric.actor.h" #include "flow/IRandom.h" -#include "flow/Tracing.h" #include "fdbclient/FDBTypes.h" #include "fdbclient/CommitProxyInterface.h" #include "fdbclient/ClientBooleanParams.h" @@ -40,6 +40,7 @@ #include "fdbclient/ClusterInterface.h" #include "fdbclient/ClientLogEvents.h" #include "fdbclient/KeyRangeMap.h" +#include "fdbclient/Tracing.h" #include "flow/actorcompiler.h" // has to be last include // CLIENT_BUGGIFY should be used to randomly introduce failures at run time (like BUGGIFY but for client side testing) @@ -48,7 +49,7 @@ (getSBVar(__FILE__, __LINE__, BuggifyType::Client) && deterministicRandom()->random01() < (x)) #define CLIENT_BUGGIFY CLIENT_BUGGIFY_WITH_PROB(P_BUGGIFIED_SECTION_FIRES[int(BuggifyType::Client)]) -FDB_DECLARE_BOOLEAN_PARAM(UseProvisionalProxies); +FDB_BOOLEAN_PARAM(UseProvisionalProxies); // Incomplete types that are reference counted class DatabaseContext; @@ -73,6 +74,7 @@ struct NetworkOptions { std::string traceClockSource; std::string traceFileIdentifier; std::string tracePartialFileSuffix; + bool traceInitializeOnSetup; Optional logClientInfo; Reference>>> supportedVersions; bool runLoopProfilingEnabled; @@ -84,8 +86,6 @@ struct NetworkOptions { class Database { public: - enum { API_VERSION_LATEST = -1 }; - // Creates a database object that represents a connection to a cluster // This constructor uses a preallocated DatabaseContext that may have been created // on another thread @@ -100,6 +100,9 @@ class Database { IsInternal internal = IsInternal::True, LocalityData const& clientLocality = LocalityData()); + static Database createSimulatedExtraDatabase(std::string connectionString, + Optional defaultTenant = Optional()); + Database() {} // an uninitialized database can be destructed or reassigned safely; that's it void operator=(Database const& rhs) { db = rhs.db; } Database(Database const& rhs) : db(rhs.db) {} @@ -162,6 +165,7 @@ struct TransactionOptions { bool useGrvCache : 1; bool skipGrvCache : 1; bool rawAccess : 1; + bool bypassStorageQuota : 1; TransactionPriority priority; @@ -228,6 +232,7 @@ struct Watch : public ReferenceCounted, NonCopyable { Promise onChangeTrigger; Promise onSetWatchTrigger; Future watchFuture; + Optional readOptions; Watch() : valuePresent(false), setPresent(false), watchFuture(Never()) {} Watch(Key key) : key(key), valuePresent(false), setPresent(false), watchFuture(Never()) {} @@ -237,17 +242,60 @@ struct Watch : public ReferenceCounted, NonCopyable { void setWatch(Future watchFuture); }; +class Tenant : public ReferenceCounted, public FastAllocated, NonCopyable { +public: + Tenant(Database cx, TenantName name); + explicit Tenant(int64_t id); + Tenant(Future id, Optional name); + + static Tenant* allocateOnForeignThread() { return (Tenant*)Tenant::operator new(sizeof(Tenant)); } + + Future ready() const { return success(idFuture); } + int64_t id() const; + Future getIdFuture() const; + KeyRef prefix() const; + std::string description() const; + + Optional name; + +private: + mutable int64_t bigEndianId = -1; + Future idFuture; +}; + +template <> +struct Traceable : std::true_type { + static std::string toString(const Tenant& tenant) { return printable(tenant.description()); } +}; + +FDB_BOOLEAN_PARAM(AllowInvalidTenantID); +FDB_BOOLEAN_PARAM(ResolveDefaultTenant); + struct TransactionState : ReferenceCounted { Database cx; - int64_t tenantId = TenantInfo::INVALID_TENANT; + Future readVersionFuture; + Promise> metadataVersion; + Optional authToken; Reference trLogInfo; TransactionOptions options; + Optional readOptions; - Optional debugID; TaskPriority taskID; - SpanID spanID; + SpanContext spanContext; UseProvisionalProxies useProvisionalProxies = UseProvisionalProxies::False; bool readVersionObtainedFromGrvProxy; + // Measured by summing the bytes accessed by each read and write operation + // after rounding up to the nearest page size and applying a write penalty + int64_t totalCost = 0; + + double proxyTagThrottledDuration = 0.0; + + // Special flag to skip prepending tenant prefix to mutations and conflict ranges + // when a dummy, internal transaction gets commited. The sole purpose of commitDummyTransaction() is to + // resolve the state of earlier transaction that returned commit_unknown_result or request_maybe_delivered. + // Therefore, the dummy transaction can simply reuse one conflict range of the earlier commit, if it already has + // been prefixed. + bool skipApplyTenantPrefix = false; int numErrors = 0; double startTime = 0; @@ -260,34 +308,54 @@ struct TransactionState : ReferenceCounted { // prefix/ : '0' - any keys equal or larger than this key are (definitely) not conflicting keys std::shared_ptr> conflictingKeys; + bool automaticIdempotency = false; + + Future startFuture; + // Only available so that Transaction can have a default constructor, for use in state variables - TransactionState(TaskPriority taskID, SpanID spanID) : taskID(taskID), spanID(spanID), tenantSet(false) {} + TransactionState(TaskPriority taskID, SpanContext spanContext) + : taskID(taskID), spanContext(spanContext), tenantSet(false) {} // VERSION_VECTOR changed default values of readVersionObtainedFromGrvProxy TransactionState(Database cx, - Optional tenant, + Optional> tenant, TaskPriority taskID, - SpanID spanID, + SpanContext spanContext, Reference trLogInfo); Reference cloneAndReset(Reference newTrLogInfo, bool generateNewSpan) const; - TenantInfo getTenantInfo(); - Optional const& tenant(); - bool hasTenant() const; + Version readVersion() { + ASSERT(readVersionFuture.isValid() && readVersionFuture.isReady()); + return readVersionFuture.get(); + } + + TenantInfo getTenantInfo(AllowInvalidTenantID allowInvalidTenantId = AllowInvalidTenantID::False); + + Optional> const& tenant(); + bool hasTenant(ResolveDefaultTenant ResolveDefaultTenant = ResolveDefaultTenant::True); + int64_t tenantId() const { return tenant_.present() ? tenant_.get()->id() : TenantInfo::INVALID_TENANT; } + + Future startTransaction(uint32_t readVersionFlags = 0); + Future getReadVersion(uint32_t flags); private: - Optional tenant_; + Optional> tenant_; bool tenantSet; }; class Transaction : NonCopyable { public: - explicit Transaction(Database const& cx, Optional const& tenant = Optional()); + explicit Transaction(Database const& cx, Optional> const& tenant = Optional>()); ~Transaction(); void setVersion(Version v); - Future getReadVersion() { return getReadVersion(0); } + Future getReadVersion() { + if (!trState->readVersionFuture.isValid()) { + trState->readVersionFuture = trState->getReadVersion(0); + } + return trState->readVersionFuture; + } Future getRawReadVersion(); Optional getCachedReadVersion() const; @@ -345,19 +413,19 @@ class Transaction : NonCopyable { public: // A method for streaming data from the storage server that is more efficient than getRange when reading large // amounts of data - [[nodiscard]] Future getRangeStream(const PromiseStream>& results, + [[nodiscard]] Future getRangeStream(PromiseStream>& results, const KeySelector& begin, const KeySelector& end, int limit, Snapshot = Snapshot::False, Reverse = Reverse::False); - [[nodiscard]] Future getRangeStream(const PromiseStream>& results, + [[nodiscard]] Future getRangeStream(PromiseStream>& results, const KeySelector& begin, const KeySelector& end, GetRangeLimits limits, Snapshot = Snapshot::False, Reverse = Reverse::False); - [[nodiscard]] Future getRangeStream(const PromiseStream>& results, + [[nodiscard]] Future getRangeStream(PromiseStream>& results, const KeyRange& keys, int limit, Snapshot snapshot = Snapshot::False, @@ -369,7 +437,7 @@ class Transaction : NonCopyable { snapshot, reverse); } - [[nodiscard]] Future getRangeStream(const PromiseStream>& results, + [[nodiscard]] Future getRangeStream(PromiseStream>& results, const KeyRange& keys, GetRangeLimits limits, Snapshot snapshot = Snapshot::False, @@ -395,12 +463,18 @@ class Transaction : NonCopyable { // The returned list would still be in form of [keys.begin, splitPoint1, splitPoint2, ... , keys.end] Future>> getRangeSplitPoints(KeyRange const& keys, int64_t chunkSize); - Future>> getBlobGranuleRanges(const KeyRange& range); + Future>> getBlobGranuleRanges(const KeyRange& range, int rangeLimit); Future>> readBlobGranules(const KeyRange& range, Version begin, Optional readVersion, Version* readVersionOut = nullptr); + Future>> summarizeBlobGranules(const KeyRange& range, + Optional summaryVersion, + int rangeLimit); + + void addGranuleMaterializeStats(const GranuleMaterializeStats& stats); + // If checkWriteConflictRanges is true, existing write conflict ranges will be searched for this key void set(const KeyRef& key, const ValueRef& value, AddConflictRange = AddConflictRange::True); void atomicOp(const KeyRef& key, @@ -418,6 +492,10 @@ class Transaction : NonCopyable { // May be called only after commit() returns success Version getCommittedVersion() const { return trState->committedVersion; } + int64_t getTotalCost() const { return trState->totalCost; } + + double getTagThrottledDuration() const; + // Will be fulfilled only after commit() returns success [[nodiscard]] Future> getVersionstamp(); @@ -435,9 +513,15 @@ class Transaction : NonCopyable { void fullReset(); double getBackoff(int errCode); - void debugTransaction(UID dID) { trState->debugID = dID; } + void debugTransaction(UID dID) { + if (trState->readOptions.present()) { + trState->readOptions.get().debugID = dID; + } else { + trState->readOptions = ReadOptions(dID); + } + } VersionVector getVersionVector() const; - UID getSpanID() const { return trState->spanID; } + SpanContext getSpanContext() const { return trState->spanContext; } Future commitMutations(); void setupWatches(); @@ -449,7 +533,8 @@ class Transaction : NonCopyable { Database getDatabase() const { return trState->cx; } static Reference createTrLogInfoProbabilistically(const Database& cx); - void setTransactionID(uint64_t id); + Transaction& getTransaction() { return *this; } + void setTransactionID(UID id); void setToken(uint64_t token); const std::vector>>& getExtraReadConflictRanges() const { return extraConflictRanges; } @@ -460,10 +545,11 @@ class Transaction : NonCopyable { return Standalone>(tr.transaction.write_conflict_ranges, tr.arena); } - Optional getTenant() { return trState->tenant(); } + Optional> getTenant() { return trState->tenant(); } Reference trState; std::vector> watches; + TagSet const& getTags() const; Span span; // used in template functions as returned Future type @@ -471,8 +557,6 @@ class Transaction : NonCopyable { using FutureT = Future; private: - Future getReadVersion(uint32_t flags); - template Future getRangeInternal(const KeySelector& begin, const KeySelector& end, @@ -485,21 +569,19 @@ class Transaction : NonCopyable { double backoff; CommitTransactionRequest tr; - Future readVersion; - Promise> metadataVersion; std::vector>> extraConflictRanges; Promise commitResult; Future committing; }; - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.h" -[[nodiscard]] Future waitForCommittedVersion( Database const& cx, Version const& version, SpanID const& spanContext ); + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.g.h" +[[nodiscard]] Future waitForCommittedVersion( Database const& cx, Version const& version, SpanContext const& spanContext ); -#line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.h" - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.h" +#line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.h" + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.g.h" [[nodiscard]] Future>> waitDataDistributionMetricsList( Database const& cx, KeyRange const& keys, int const& shardLimit ); -#line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.h" +#line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.h" std::string unprintable(const std::string&); @@ -509,50 +591,71 @@ int64_t extractIntOption(Optional value, // Takes a snapshot of the cluster, specifically the following persistent // states: coordinator, TLog and storage state - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.h" + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.g.h" [[nodiscard]] Future snapCreate( Database const& cx, Standalone const& snapCmd, UID const& snapUID ); -#line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.h" +#line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.h" // Adds necessary mutation(s) to the transaction, so that *one* checkpoint will be created for -// each and every shards overlapping with `range`. Each checkpoint will be created at a random -// storage server for each shard. +// each and every shards overlapping with `ranges`. // All checkpoint(s) will be created at the transaction's commit version. -Future createCheckpoint(Transaction* tr, KeyRangeRef range, CheckpointFormat format); +Future createCheckpoint(Transaction* tr, + const std::vector& ranges, + CheckpointFormat format, + Optional dataMoveId = Optional()); // Same as above. -Future createCheckpoint(Reference tr, KeyRangeRef range, CheckpointFormat format); +Future createCheckpoint(Reference tr, + const std::vector& ranges, + CheckpointFormat format, + Optional dataMoveId = Optional()); -// Gets checkpoint metadata for `keys` at the specific version, with the particular format. -// One CheckpointMetaData will be returned for each distinctive shard. -// The collective keyrange of the returned checkpoint(s) is a super-set of `keys`. -// checkpoint_not_found() error will be returned if the specific checkpoint(s) cannot be found. - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.h" -[[nodiscard]] Future> getCheckpointMetaData( Database const& cx, KeyRange const& keys, Version const& version, CheckpointFormat const& format, double const& timeout = 5.0 ); +// Gets checkpoint metadata for `ranges` at the specific version, with the particular format. +// Returns a list of [range, checkpoint], where the `checkpoint` has data over `range`. +// checkpoint_not_found() error will be returned if the specific checkpoint cannot be found. + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.g.h" +[[nodiscard]] Future>> getCheckpointMetaData( Database const& cx, std::vector const& ranges, Version const& version, CheckpointFormat const& format, Optional const& dataMoveId = Optional(), double const& timeout = 5.0 ); -#line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.h" +#line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.h" // Checks with Data Distributor that it is safe to mark all servers in exclusions as failed - #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.h" + #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.g.h" [[nodiscard]] Future checkSafeExclusions( Database const& cx, std::vector const& exclusions ); -#line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.h" +#line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.h" +// Measured in bytes, rounded up to the nearest page size. Multiply by fungibility ratio +// because writes are more expensive than reads. inline uint64_t getWriteOperationCost(uint64_t bytes) { - return bytes / std::max(1, CLIENT_KNOBS->WRITE_COST_BYTE_FACTOR) + 1; + if (bytes == 0) { + return CLIENT_KNOBS->GLOBAL_TAG_THROTTLING_RW_FUNGIBILITY_RATIO * CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE; + } else { + return CLIENT_KNOBS->GLOBAL_TAG_THROTTLING_RW_FUNGIBILITY_RATIO * CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE * + ((bytes - 1) / CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE + 1); + } +} + +// Measured in bytes, rounded up to the nearest page size. +inline uint64_t getReadOperationCost(uint64_t bytes) { + if (bytes == 0) { + return CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE; + } else { + return ((bytes - 1) / CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE + 1) * CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE; + } } // Create a transaction to set the value of system key \xff/conf/perpetual_storage_wiggle. If enable == true, the value -// will be 1. Otherwise, the value will be 0. - #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.h" -[[nodiscard]] Future setPerpetualStorageWiggle( Database const& cx, bool const& enable, LockAware const& lockAware = LockAware::False ); +// will be 1. Otherwise, the value will be 0. The caller should take care of the reset of StorageWiggleMetrics if +// necessary. Returns the FDB version at which the transaction was committed. + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.g.h" +[[nodiscard]] Future setPerpetualStorageWiggle( Database const& cx, bool const& enable, LockAware const& lockAware = LockAware::False ); -#line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.h" +#line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.h" - #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.h" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.g.h" [[nodiscard]] Future>> readStorageWiggleValues( Database const& cx, bool const& primary, bool const& use_system_priority ); -#line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.h" +#line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.h" // Returns the maximum legal size of a key. This size will be determined by the prefix of the passed in key // (system keys have a larger maximum size). This should be used for generic max key size requests. @@ -569,10 +672,31 @@ int64_t getMaxWriteKeySize(KeyRef const& key, bool hasRawAccess); int64_t getMaxClearKeySize(KeyRef const& key); struct KeyRangeLocationInfo; - #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.g.h" -[[nodiscard]] Future getKeyLocation_internal( Database const& cx, Optional const& tenant, Key const& key, SpanID const& spanID, Optional const& debugID, UseProvisionalProxies const& useProvisionalProxies, Reverse const& isBackward, Version const& version ); +// Return the aggregated StorageMetrics of range keys to the caller. The locations tell which interface should +// serve the request. The final result is within (min-permittedError/2, max + permittedError/2) if valid. + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.g.h" +[[nodiscard]] Future> waitStorageMetricsWithLocation( TenantInfo const& tenantInfo, Version const& version, KeyRange const& keys, std::vector const& locations, StorageMetrics const& min, StorageMetrics const& max, StorageMetrics const& permittedError ); + +#line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.h" + +// Return the suggested split points from storage server.The locations tell which interface should +// serve the request. `limit` is the current estimated storage metrics of `keys`.The returned points, if present, +// guarantee the metrics of split result is within limit. + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.g.h" +[[nodiscard]] Future>>> splitStorageMetricsWithLocations( std::vector const& locations, KeyRange const& keys, StorageMetrics const& limit, StorageMetrics const& estimated, Optional const& minSplitBytes ); + +#line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.h" + +namespace NativeAPI { + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.g.h" +[[nodiscard]] Future>> getServerListAndProcessClasses( Transaction* const& tr ); + +#line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.h" +} + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.g.h" +[[nodiscard]] Future getKeyLocation_internal( Database const& cx, TenantInfo const& tenant, Key const& key, SpanContext const& spanContext, Optional const& debugID, UseProvisionalProxies const& useProvisionalProxies, Reverse const& isBackward, Version const& version ); -#line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/NativeAPI.actor.h" +#line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/NativeAPI.actor.h" #include "flow/unactorcompiler.h" #endif diff --git a/src/fdbclient/NativeAPI.actor.h b/src/fdbclient/include/fdbclient/NativeAPI.actor.h similarity index 73% rename from src/fdbclient/NativeAPI.actor.h rename to src/fdbclient/include/fdbclient/NativeAPI.actor.h index f98b5c1..9234308 100644 --- a/src/fdbclient/NativeAPI.actor.h +++ b/src/fdbclient/include/fdbclient/NativeAPI.actor.h @@ -27,9 +27,9 @@ #include "flow/BooleanParam.h" #include "flow/flow.h" +#include "flow/WipedString.h" #include "flow/TDMetric.actor.h" #include "flow/IRandom.h" -#include "flow/Tracing.h" #include "fdbclient/FDBTypes.h" #include "fdbclient/CommitProxyInterface.h" #include "fdbclient/ClientBooleanParams.h" @@ -38,6 +38,7 @@ #include "fdbclient/ClusterInterface.h" #include "fdbclient/ClientLogEvents.h" #include "fdbclient/KeyRangeMap.h" +#include "fdbclient/Tracing.h" #include "flow/actorcompiler.h" // has to be last include // CLIENT_BUGGIFY should be used to randomly introduce failures at run time (like BUGGIFY but for client side testing) @@ -46,7 +47,7 @@ (getSBVar(__FILE__, __LINE__, BuggifyType::Client) && deterministicRandom()->random01() < (x)) #define CLIENT_BUGGIFY CLIENT_BUGGIFY_WITH_PROB(P_BUGGIFIED_SECTION_FIRES[int(BuggifyType::Client)]) -FDB_DECLARE_BOOLEAN_PARAM(UseProvisionalProxies); +FDB_BOOLEAN_PARAM(UseProvisionalProxies); // Incomplete types that are reference counted class DatabaseContext; @@ -71,6 +72,7 @@ struct NetworkOptions { std::string traceClockSource; std::string traceFileIdentifier; std::string tracePartialFileSuffix; + bool traceInitializeOnSetup; Optional logClientInfo; Reference>>> supportedVersions; bool runLoopProfilingEnabled; @@ -82,8 +84,6 @@ struct NetworkOptions { class Database { public: - enum { API_VERSION_LATEST = -1 }; - // Creates a database object that represents a connection to a cluster // This constructor uses a preallocated DatabaseContext that may have been created // on another thread @@ -98,6 +98,9 @@ class Database { IsInternal internal = IsInternal::True, LocalityData const& clientLocality = LocalityData()); + static Database createSimulatedExtraDatabase(std::string connectionString, + Optional defaultTenant = Optional()); + Database() {} // an uninitialized database can be destructed or reassigned safely; that's it void operator=(Database const& rhs) { db = rhs.db; } Database(Database const& rhs) : db(rhs.db) {} @@ -160,6 +163,7 @@ struct TransactionOptions { bool useGrvCache : 1; bool skipGrvCache : 1; bool rawAccess : 1; + bool bypassStorageQuota : 1; TransactionPriority priority; @@ -226,6 +230,7 @@ struct Watch : public ReferenceCounted, NonCopyable { Promise onChangeTrigger; Promise onSetWatchTrigger; Future watchFuture; + Optional readOptions; Watch() : valuePresent(false), setPresent(false), watchFuture(Never()) {} Watch(Key key) : key(key), valuePresent(false), setPresent(false), watchFuture(Never()) {} @@ -235,17 +240,60 @@ struct Watch : public ReferenceCounted, NonCopyable { void setWatch(Future watchFuture); }; +class Tenant : public ReferenceCounted, public FastAllocated, NonCopyable { +public: + Tenant(Database cx, TenantName name); + explicit Tenant(int64_t id); + Tenant(Future id, Optional name); + + static Tenant* allocateOnForeignThread() { return (Tenant*)Tenant::operator new(sizeof(Tenant)); } + + Future ready() const { return success(idFuture); } + int64_t id() const; + Future getIdFuture() const; + KeyRef prefix() const; + std::string description() const; + + Optional name; + +private: + mutable int64_t bigEndianId = -1; + Future idFuture; +}; + +template <> +struct Traceable : std::true_type { + static std::string toString(const Tenant& tenant) { return printable(tenant.description()); } +}; + +FDB_BOOLEAN_PARAM(AllowInvalidTenantID); +FDB_BOOLEAN_PARAM(ResolveDefaultTenant); + struct TransactionState : ReferenceCounted { Database cx; - int64_t tenantId = TenantInfo::INVALID_TENANT; + Future readVersionFuture; + Promise> metadataVersion; + Optional authToken; Reference trLogInfo; TransactionOptions options; + Optional readOptions; - Optional debugID; TaskPriority taskID; - SpanID spanID; + SpanContext spanContext; UseProvisionalProxies useProvisionalProxies = UseProvisionalProxies::False; bool readVersionObtainedFromGrvProxy; + // Measured by summing the bytes accessed by each read and write operation + // after rounding up to the nearest page size and applying a write penalty + int64_t totalCost = 0; + + double proxyTagThrottledDuration = 0.0; + + // Special flag to skip prepending tenant prefix to mutations and conflict ranges + // when a dummy, internal transaction gets commited. The sole purpose of commitDummyTransaction() is to + // resolve the state of earlier transaction that returned commit_unknown_result or request_maybe_delivered. + // Therefore, the dummy transaction can simply reuse one conflict range of the earlier commit, if it already has + // been prefixed. + bool skipApplyTenantPrefix = false; int numErrors = 0; double startTime = 0; @@ -258,34 +306,54 @@ struct TransactionState : ReferenceCounted { // prefix/ : '0' - any keys equal or larger than this key are (definitely) not conflicting keys std::shared_ptr> conflictingKeys; + bool automaticIdempotency = false; + + Future startFuture; + // Only available so that Transaction can have a default constructor, for use in state variables - TransactionState(TaskPriority taskID, SpanID spanID) : taskID(taskID), spanID(spanID), tenantSet(false) {} + TransactionState(TaskPriority taskID, SpanContext spanContext) + : taskID(taskID), spanContext(spanContext), tenantSet(false) {} // VERSION_VECTOR changed default values of readVersionObtainedFromGrvProxy TransactionState(Database cx, - Optional tenant, + Optional> tenant, TaskPriority taskID, - SpanID spanID, + SpanContext spanContext, Reference trLogInfo); Reference cloneAndReset(Reference newTrLogInfo, bool generateNewSpan) const; - TenantInfo getTenantInfo(); - Optional const& tenant(); - bool hasTenant() const; + Version readVersion() { + ASSERT(readVersionFuture.isValid() && readVersionFuture.isReady()); + return readVersionFuture.get(); + } + + TenantInfo getTenantInfo(AllowInvalidTenantID allowInvalidTenantId = AllowInvalidTenantID::False); + + Optional> const& tenant(); + bool hasTenant(ResolveDefaultTenant ResolveDefaultTenant = ResolveDefaultTenant::True); + int64_t tenantId() const { return tenant_.present() ? tenant_.get()->id() : TenantInfo::INVALID_TENANT; } + + Future startTransaction(uint32_t readVersionFlags = 0); + Future getReadVersion(uint32_t flags); private: - Optional tenant_; + Optional> tenant_; bool tenantSet; }; class Transaction : NonCopyable { public: - explicit Transaction(Database const& cx, Optional const& tenant = Optional()); + explicit Transaction(Database const& cx, Optional> const& tenant = Optional>()); ~Transaction(); void setVersion(Version v); - Future getReadVersion() { return getReadVersion(0); } + Future getReadVersion() { + if (!trState->readVersionFuture.isValid()) { + trState->readVersionFuture = trState->getReadVersion(0); + } + return trState->readVersionFuture; + } Future getRawReadVersion(); Optional getCachedReadVersion() const; @@ -343,19 +411,19 @@ class Transaction : NonCopyable { public: // A method for streaming data from the storage server that is more efficient than getRange when reading large // amounts of data - [[nodiscard]] Future getRangeStream(const PromiseStream>& results, + [[nodiscard]] Future getRangeStream(PromiseStream>& results, const KeySelector& begin, const KeySelector& end, int limit, Snapshot = Snapshot::False, Reverse = Reverse::False); - [[nodiscard]] Future getRangeStream(const PromiseStream>& results, + [[nodiscard]] Future getRangeStream(PromiseStream>& results, const KeySelector& begin, const KeySelector& end, GetRangeLimits limits, Snapshot = Snapshot::False, Reverse = Reverse::False); - [[nodiscard]] Future getRangeStream(const PromiseStream>& results, + [[nodiscard]] Future getRangeStream(PromiseStream>& results, const KeyRange& keys, int limit, Snapshot snapshot = Snapshot::False, @@ -367,7 +435,7 @@ class Transaction : NonCopyable { snapshot, reverse); } - [[nodiscard]] Future getRangeStream(const PromiseStream>& results, + [[nodiscard]] Future getRangeStream(PromiseStream>& results, const KeyRange& keys, GetRangeLimits limits, Snapshot snapshot = Snapshot::False, @@ -393,12 +461,18 @@ class Transaction : NonCopyable { // The returned list would still be in form of [keys.begin, splitPoint1, splitPoint2, ... , keys.end] Future>> getRangeSplitPoints(KeyRange const& keys, int64_t chunkSize); - Future>> getBlobGranuleRanges(const KeyRange& range); + Future>> getBlobGranuleRanges(const KeyRange& range, int rangeLimit); Future>> readBlobGranules(const KeyRange& range, Version begin, Optional readVersion, Version* readVersionOut = nullptr); + Future>> summarizeBlobGranules(const KeyRange& range, + Optional summaryVersion, + int rangeLimit); + + void addGranuleMaterializeStats(const GranuleMaterializeStats& stats); + // If checkWriteConflictRanges is true, existing write conflict ranges will be searched for this key void set(const KeyRef& key, const ValueRef& value, AddConflictRange = AddConflictRange::True); void atomicOp(const KeyRef& key, @@ -416,6 +490,10 @@ class Transaction : NonCopyable { // May be called only after commit() returns success Version getCommittedVersion() const { return trState->committedVersion; } + int64_t getTotalCost() const { return trState->totalCost; } + + double getTagThrottledDuration() const; + // Will be fulfilled only after commit() returns success [[nodiscard]] Future> getVersionstamp(); @@ -433,9 +511,15 @@ class Transaction : NonCopyable { void fullReset(); double getBackoff(int errCode); - void debugTransaction(UID dID) { trState->debugID = dID; } + void debugTransaction(UID dID) { + if (trState->readOptions.present()) { + trState->readOptions.get().debugID = dID; + } else { + trState->readOptions = ReadOptions(dID); + } + } VersionVector getVersionVector() const; - UID getSpanID() const { return trState->spanID; } + SpanContext getSpanContext() const { return trState->spanContext; } Future commitMutations(); void setupWatches(); @@ -447,7 +531,8 @@ class Transaction : NonCopyable { Database getDatabase() const { return trState->cx; } static Reference createTrLogInfoProbabilistically(const Database& cx); - void setTransactionID(uint64_t id); + Transaction& getTransaction() { return *this; } + void setTransactionID(UID id); void setToken(uint64_t token); const std::vector>>& getExtraReadConflictRanges() const { return extraConflictRanges; } @@ -458,10 +543,11 @@ class Transaction : NonCopyable { return Standalone>(tr.transaction.write_conflict_ranges, tr.arena); } - Optional getTenant() { return trState->tenant(); } + Optional> getTenant() { return trState->tenant(); } Reference trState; std::vector> watches; + TagSet const& getTags() const; Span span; // used in template functions as returned Future type @@ -469,8 +555,6 @@ class Transaction : NonCopyable { using FutureT = Future; private: - Future getReadVersion(uint32_t flags); - template Future getRangeInternal(const KeySelector& begin, const KeySelector& end, @@ -483,14 +567,12 @@ class Transaction : NonCopyable { double backoff; CommitTransactionRequest tr; - Future readVersion; - Promise> metadataVersion; std::vector>> extraConflictRanges; Promise commitResult; Future committing; }; -ACTOR Future waitForCommittedVersion(Database cx, Version version, SpanID spanContext); +ACTOR Future waitForCommittedVersion(Database cx, Version version, SpanContext spanContext); ACTOR Future>> waitDataDistributionMetricsList(Database cx, KeyRange keys, int shardLimit); @@ -506,34 +588,57 @@ int64_t extractIntOption(Optional value, ACTOR Future snapCreate(Database cx, Standalone snapCmd, UID snapUID); // Adds necessary mutation(s) to the transaction, so that *one* checkpoint will be created for -// each and every shards overlapping with `range`. Each checkpoint will be created at a random -// storage server for each shard. +// each and every shards overlapping with `ranges`. // All checkpoint(s) will be created at the transaction's commit version. -Future createCheckpoint(Transaction* tr, KeyRangeRef range, CheckpointFormat format); +Future createCheckpoint(Transaction* tr, + const std::vector& ranges, + CheckpointFormat format, + Optional dataMoveId = Optional()); // Same as above. -Future createCheckpoint(Reference tr, KeyRangeRef range, CheckpointFormat format); - -// Gets checkpoint metadata for `keys` at the specific version, with the particular format. -// One CheckpointMetaData will be returned for each distinctive shard. -// The collective keyrange of the returned checkpoint(s) is a super-set of `keys`. -// checkpoint_not_found() error will be returned if the specific checkpoint(s) cannot be found. -ACTOR Future> getCheckpointMetaData(Database cx, - KeyRange keys, - Version version, - CheckpointFormat format, - double timeout = 5.0); +Future createCheckpoint(Reference tr, + const std::vector& ranges, + CheckpointFormat format, + Optional dataMoveId = Optional()); + +// Gets checkpoint metadata for `ranges` at the specific version, with the particular format. +// Returns a list of [range, checkpoint], where the `checkpoint` has data over `range`. +// checkpoint_not_found() error will be returned if the specific checkpoint cannot be found. +ACTOR Future>> getCheckpointMetaData( + Database cx, + std::vector ranges, + Version version, + CheckpointFormat format, + Optional dataMoveId = Optional(), + double timeout = 5.0); // Checks with Data Distributor that it is safe to mark all servers in exclusions as failed ACTOR Future checkSafeExclusions(Database cx, std::vector exclusions); +// Measured in bytes, rounded up to the nearest page size. Multiply by fungibility ratio +// because writes are more expensive than reads. inline uint64_t getWriteOperationCost(uint64_t bytes) { - return bytes / std::max(1, CLIENT_KNOBS->WRITE_COST_BYTE_FACTOR) + 1; + if (bytes == 0) { + return CLIENT_KNOBS->GLOBAL_TAG_THROTTLING_RW_FUNGIBILITY_RATIO * CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE; + } else { + return CLIENT_KNOBS->GLOBAL_TAG_THROTTLING_RW_FUNGIBILITY_RATIO * CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE * + ((bytes - 1) / CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE + 1); + } +} + +// Measured in bytes, rounded up to the nearest page size. +inline uint64_t getReadOperationCost(uint64_t bytes) { + if (bytes == 0) { + return CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE; + } else { + return ((bytes - 1) / CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE + 1) * CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE; + } } // Create a transaction to set the value of system key \xff/conf/perpetual_storage_wiggle. If enable == true, the value -// will be 1. Otherwise, the value will be 0. -ACTOR Future setPerpetualStorageWiggle(Database cx, bool enable, LockAware lockAware = LockAware::False); +// will be 1. Otherwise, the value will be 0. The caller should take care of the reset of StorageWiggleMetrics if +// necessary. Returns the FDB version at which the transaction was committed. +ACTOR Future setPerpetualStorageWiggle(Database cx, bool enable, LockAware lockAware = LockAware::False); ACTOR Future>> readStorageWiggleValues(Database cx, bool primary, @@ -554,10 +659,34 @@ int64_t getMaxWriteKeySize(KeyRef const& key, bool hasRawAccess); int64_t getMaxClearKeySize(KeyRef const& key); struct KeyRangeLocationInfo; +// Return the aggregated StorageMetrics of range keys to the caller. The locations tell which interface should +// serve the request. The final result is within (min-permittedError/2, max + permittedError/2) if valid. +ACTOR Future> waitStorageMetricsWithLocation(TenantInfo tenantInfo, + Version version, + KeyRange keys, + std::vector locations, + StorageMetrics min, + StorageMetrics max, + StorageMetrics permittedError); + +// Return the suggested split points from storage server.The locations tell which interface should +// serve the request. `limit` is the current estimated storage metrics of `keys`.The returned points, if present, +// guarantee the metrics of split result is within limit. +ACTOR Future>>> splitStorageMetricsWithLocations( + std::vector locations, + KeyRange keys, + StorageMetrics limit, + StorageMetrics estimated, + Optional minSplitBytes); + +namespace NativeAPI { +ACTOR Future>> getServerListAndProcessClasses( + Transaction* tr); +} ACTOR Future getKeyLocation_internal(Database cx, - Optional tenant, + TenantInfo tenant, Key key, - SpanID spanID, + SpanContext spanContext, Optional debugID, UseProvisionalProxies useProvisionalProxies, Reverse isBackward, diff --git a/src/fdbclient/Notified.h b/src/fdbclient/include/fdbclient/Notified.h similarity index 100% rename from src/fdbclient/Notified.h rename to src/fdbclient/include/fdbclient/Notified.h diff --git a/src/fdbclient/PImpl.h b/src/fdbclient/include/fdbclient/PImpl.h similarity index 94% rename from src/fdbclient/PImpl.h rename to src/fdbclient/include/fdbclient/PImpl.h index 424761e..992753f 100644 --- a/src/fdbclient/PImpl.h +++ b/src/fdbclient/include/fdbclient/PImpl.h @@ -39,4 +39,6 @@ class PImpl { T const& operator*() const { return *impl; } T* operator->() { return impl.get(); } T const* operator->() const { return impl.get(); } + T* get() { return impl.get(); } + T const* get() const { return impl.get(); } }; diff --git a/src/fdbclient/ParallelStream.actor.g.h b/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h similarity index 83% rename from src/fdbclient/ParallelStream.actor.g.h rename to src/fdbclient/include/fdbclient/ParallelStream.actor.g.h index 316e35a..c9c5f02 100644 --- a/src/fdbclient/ParallelStream.actor.g.h +++ b/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" /* * ParallelStream.actor.h * @@ -73,24 +73,24 @@ class ParallelStream { public: // A background actor which take results from the oldest fragment and sends them to the main output stream - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" // This generated class is to be used only via flushToClient() - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" template - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" class FlushToClientActorState { - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" public: - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" FlushToClientActorState(ParallelStream* const& self) - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" : self(self), - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" messagesBetweenYields(1000), - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" messagesSinceYield(0) - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" { fdb_probe_actor_create("flushToClient", reinterpret_cast(this)); @@ -104,9 +104,9 @@ class FlushToClientActorState { { try { try { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" ; - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -134,19 +134,19 @@ class FlushToClientActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" if (e.code() == error_code_actor_cancelled) - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" { - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" return a_body1Catch1(e, loopDepth); - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" } - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" self->results.sendError(e); - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlushToClientActorState(); static_cast(this)->destroy(); return 0; } - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~FlushToClientActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -169,34 +169,34 @@ class FlushToClientActorState { } int a_body1loopBody1(int loopDepth) { - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" FutureStream> __when_expr_0 = self->fragments.getFuture(); - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(int loopDepth) { - #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" ; - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1when1(Reference const& __fragment,int loopDepth) { - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" fragment = __fragment; - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -275,16 +275,16 @@ class FlushToClientActorState { int a_body1loopBody1cont1loopBody1(int loopDepth) { try { - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" StrictFuture __when_expr_1 = self->results.onEmpty(); - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -317,20 +317,20 @@ class FlushToClientActorState { int a_body1loopBody1cont1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" if (e.code() == error_code_end_of_stream) - #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" { - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" fragment.clear(); - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break } else { - #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" return a_body1Catch2(e, std::max(0, loopDepth - 2)); - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" } } catch (Error& error) { @@ -343,32 +343,32 @@ class FlushToClientActorState { } int a_body1loopBody1cont1loopBody1cont2(Void const& _,int loopDepth) { - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" FutureStream __when_expr_2 = fragment->stream.getFuture(); - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont1loopBody1cont2when1(__when_expr_2.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1loopBody1cont2(Void && _,int loopDepth) { - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" FutureStream __when_expr_2 = fragment->stream.getFuture(); - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont1loopBody1cont2when1(__when_expr_2.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" loopDepth = 0; return loopDepth; @@ -438,22 +438,22 @@ class FlushToClientActorState { } int a_body1loopBody1cont1loopBody1cont3(T const& value,int loopDepth) { - #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" self->results.send(value); - #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" if (++messagesSinceYield == messagesBetweenYields) - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" { - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" StrictFuture __when_expr_3 = yield(); - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" loopDepth = 0; } else @@ -465,22 +465,22 @@ class FlushToClientActorState { } int a_body1loopBody1cont1loopBody1cont3(T && value,int loopDepth) { - #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" self->results.send(value); - #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" if (++messagesSinceYield == messagesBetweenYields) - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" { - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" StrictFuture __when_expr_3 = yield(); - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" loopDepth = 0; } else @@ -561,18 +561,18 @@ class FlushToClientActorState { } int a_body1loopBody1cont1loopBody1cont5(Void const& _,int loopDepth) { - #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" messagesSinceYield = 0; - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" loopDepth = a_body1loopBody1cont1loopBody1cont4(loopDepth); return loopDepth; } int a_body1loopBody1cont1loopBody1cont5(Void && _,int loopDepth) { - #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" messagesSinceYield = 0; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" loopDepth = a_body1loopBody1cont1loopBody1cont4(loopDepth); return loopDepth; @@ -653,20 +653,20 @@ class FlushToClientActorState { return loopDepth; } - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" ParallelStream* self; - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" const int messagesBetweenYields; - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" int messagesSinceYield; - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" Reference fragment; - #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" }; // This generated class is to be used only via flushToClient() - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" class FlushToClientActor final : public Actor, public ActorSingleCallback< FlushToClientActor, 0, Reference >, public ActorCallback< FlushToClientActor, 1, Void >, public ActorSingleCallback< FlushToClientActor, 2, T >, public ActorCallback< FlushToClientActor, 3, Void >, public FastAllocated, public FlushToClientActorState { - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -678,9 +678,9 @@ friend struct ActorSingleCallback< FlushToClientActor, 0, Reference >; friend struct ActorCallback< FlushToClientActor, 1, Void >; friend struct ActorSingleCallback< FlushToClientActor, 2, T >; friend struct ActorCallback< FlushToClientActor, 3, Void >; - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" FlushToClientActor(ParallelStream* const& self) - #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" : Actor(), FlushToClientActorState(self) { @@ -706,14 +706,14 @@ friend struct ActorCallback< FlushToClientActor, 3, Void >; } }; - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" [[nodiscard]] static Future flushToClient( ParallelStream* const& self ) { - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" return Future(new FlushToClientActor(self)); - #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" } -#line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" +#line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" ParallelStream(PromiseStream results, size_t bufferLimit) : results(results) { semaphore = makeReference(1, bufferLimit); @@ -721,20 +721,20 @@ friend struct ActorCallback< FlushToClientActor, 3, Void >; } // Creates a fragment to get merged into the main output stream - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" // This generated class is to be used only via createFragmentImpl() - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" template - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" class CreateFragmentImplActorState { - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" public: - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" CreateFragmentImplActorState(ParallelStream* const& self) - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" : self(self) - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" { fdb_probe_actor_create("createFragmentImpl", reinterpret_cast(this)); @@ -747,16 +747,16 @@ class CreateFragmentImplActorState { int a_body1(int loopDepth=0) { try { - #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" StrictFuture __when_expr_0 = self->semaphore->take(); - #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -777,13 +777,13 @@ class CreateFragmentImplActorState { } int a_body1cont1(int64_t const& permitNumber,int loopDepth) { - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" auto fragment = makeReference(self->semaphore, permitNumber, FragmentConstructorTag()); - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" self->fragments.send(fragment); - #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" if (!static_cast(this)->SAV::futures) { (void)(fragment.getPtr()); this->~CreateFragmentImplActorState(); static_cast(this)->destroy(); return 0; } - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" new (&static_cast(this)->SAV< Fragment* >::value()) Fragment*(fragment.getPtr()); this->~CreateFragmentImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -793,13 +793,13 @@ class CreateFragmentImplActorState { } int a_body1cont1(int64_t && permitNumber,int loopDepth) { - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" auto fragment = makeReference(self->semaphore, permitNumber, FragmentConstructorTag()); - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" self->fragments.send(fragment); - #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" if (!static_cast(this)->SAV::futures) { (void)(fragment.getPtr()); this->~CreateFragmentImplActorState(); static_cast(this)->destroy(); return 0; } - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" new (&static_cast(this)->SAV< Fragment* >::value()) Fragment*(fragment.getPtr()); this->~CreateFragmentImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -870,14 +870,14 @@ class CreateFragmentImplActorState { fdb_probe_actor_exit("createFragmentImpl", reinterpret_cast(this), 0); } - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" ParallelStream* self; - #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" }; // This generated class is to be used only via createFragmentImpl() - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" class CreateFragmentImplActor final : public Actor, public ActorCallback< CreateFragmentImplActor, 0, int64_t >, public FastAllocated, public CreateFragmentImplActorState { - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -886,9 +886,9 @@ class CreateFragmentImplActor final : public Actor, public ActorCallb void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< CreateFragmentImplActor, 0, int64_t >; - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" CreateFragmentImplActor(ParallelStream* const& self) - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" : Actor(), CreateFragmentImplActorState(self) { @@ -911,14 +911,14 @@ friend struct ActorCallback< CreateFragmentImplActor, 0, int64_t >; } }; - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" [[nodiscard]] static Future createFragmentImpl( ParallelStream* const& self ) { - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" return Future(new CreateFragmentImplActor(self)); - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.g.h" + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.g.h" } -#line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/ParallelStream.actor.h" +#line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/ParallelStream.actor.h" Future createFragment() { return createFragmentImpl(this); } diff --git a/src/fdbclient/ParallelStream.actor.h b/src/fdbclient/include/fdbclient/ParallelStream.actor.h similarity index 100% rename from src/fdbclient/ParallelStream.actor.h rename to src/fdbclient/include/fdbclient/ParallelStream.actor.h diff --git a/src/fdbclient/PaxosConfigTransaction.h b/src/fdbclient/include/fdbclient/PaxosConfigTransaction.h similarity index 97% rename from src/fdbclient/PaxosConfigTransaction.h rename to src/fdbclient/include/fdbclient/PaxosConfigTransaction.h index 67487ff..a34666d 100644 --- a/src/fdbclient/PaxosConfigTransaction.h +++ b/src/fdbclient/include/fdbclient/PaxosConfigTransaction.h @@ -63,6 +63,8 @@ class PaxosConfigTransaction final : public IConfigTransaction, public FastAlloc void clear(KeyRef const&) override; Future commit() override; Version getCommittedVersion() const override; + double getTagThrottledDuration() const override; + int64_t getTotalCost() const override; int64_t getApproximateSize() const override; void setOption(FDBTransactionOptions::Option option, Optional value = Optional()) override; Future onError(Error const& e) override; diff --git a/src/fdbclient/ProcessInterface.h b/src/fdbclient/include/fdbclient/ProcessInterface.h similarity index 98% rename from src/fdbclient/ProcessInterface.h rename to src/fdbclient/include/fdbclient/ProcessInterface.h index b18a226..2612588 100644 --- a/src/fdbclient/ProcessInterface.h +++ b/src/fdbclient/include/fdbclient/ProcessInterface.h @@ -21,7 +21,7 @@ #include "fdbclient/AnnotateActor.h" #include "fdbclient/FDBTypes.h" #include "fdbrpc/fdbrpc.h" -#include "fdbclient/WellKnownEndpoints.h" +#include "fdbrpc/WellKnownEndpoints.h" struct ProcessInterface { constexpr static FileIdentifier file_identifier = 985636; diff --git a/src/fdbclient/include/fdbclient/RESTClient.h b/src/fdbclient/include/fdbclient/RESTClient.h new file mode 100644 index 0000000..7b37430 --- /dev/null +++ b/src/fdbclient/include/fdbclient/RESTClient.h @@ -0,0 +1,98 @@ +/* + * RESTClient.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBRPC_RESTCLIENT_H +#define FDBRPC_RESTCLIENT_H + +#pragma once + +#include "fdbclient/JSONDoc.h" +#include "fdbrpc/HTTP.h" +#include "fdbclient/RESTUtils.h" +#include "flow/Arena.h" +#include "flow/FastRef.h" +#include "flow/flow.h" +#include "flow/Net2Packet.h" + +#include + +// This interface enables sending REST HTTP requests and receiving REST HTTP responses from a resource identified by a +// URI. + +class RESTClient : public ReferenceCounted { +public: + struct Stats { + explicit Stats(const std::string& hService) + : host_service(hService), requests_successful(0), requests_failed(0), bytes_sent(0) {} + Stats operator-(const Stats& rhs); + void clear() { requests_failed = requests_successful = bytes_sent = 0; } + json_spirit::mObject getJSON(); + + std::string host_service; + int64_t requests_successful; + int64_t requests_failed; + int64_t bytes_sent; + }; + + RESTClientKnobs knobs; + Reference conectionPool; + // Connection stats maintained per "host:service" + std::unordered_map> statsMap; + + RESTClient(); + explicit RESTClient(std::unordered_map& params); + + void setKnobs(const std::unordered_map& knobSettings); + std::unordered_map getKnobs() const; + + // Supports common REST APIs. + // On invocation of below methods, input 'fullUrl' is parsed using RESTUrl interface, + // RESTConnectionPool is used to leverage cached connection if any for 'host:service' pair. API then leverage + // HTTP::doRequest to accomplish the specified operation + + Future> doGet(const std::string& fullUrl, + Optional optHeaders = Optional()); + Future> doHead(const std::string& fullUrl, + Optional optHeaders = Optional()); + Future> doDelete(const std::string& fullUrl, + Optional optHeaders = Optional()); + Future> doTrace(const std::string& fullUrl, + Optional optHeaders = Optional()); + Future> doPut(const std::string& fullUrl, + const std::string& requestBody, + Optional optHeaders = Optional()); + Future> doPost(const std::string& fullUrl, + const std::string& requestBody, + Optional optHeaders = Optional()); + + static std::string getStatsKey(const std::string& host, const std::string& service) { return host + ":" + service; } + +private: + Future> doGetHeadDeleteOrTrace(const std::string& verb, + Optional optHeaders, + RESTUrl& url, + std::set successCodes); + Future> doPutOrPost(const std::string& verb, + Optional headers, + RESTUrl& url, + std::set successCodes); +}; + +#endif diff --git a/src/fdbclient/include/fdbclient/RESTUtils.h b/src/fdbclient/include/fdbclient/RESTUtils.h new file mode 100644 index 0000000..3ec8aa1 --- /dev/null +++ b/src/fdbclient/include/fdbclient/RESTUtils.h @@ -0,0 +1,139 @@ +/* + * RESTUtils.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDRPC_REST_UTILS_H +#define FDRPC_REST_UTILS_H + +#pragma once + +#include "flow/flow.h" +#include "flow/FastRef.h" +#include "flow/Net2Packet.h" + +#include +#include +#include +#include + +// Util interface managing REST active connection pool. +// The interface internally constructs and maintains map {"host:service" -> activeConnection}; any new connection +// request would first access cached connection if possible (not expired), if none exists, it would establish a new +// connection and return to the caller. Caller on accomplishing the task at-hand, should return the connection back to +// the pool. + +using RESTConnectionPoolKey = std::pair; + +enum RESTLogSeverity { INFO = 1, DEBUG = 2, VERBOSE = 3 }; + +class IConnection; + +class RESTConnectionPool : public ReferenceCounted { +public: + struct ReusableConnection { + Reference conn; + double expirationTime; + }; + + // Maximum number of connections cached in the connection-pool. + int maxConnPerConnectKey; + std::unordered_map, boost::hash> + connectionPoolMap; + + RESTConnectionPool(const int maxConnsPerKey) : maxConnPerConnectKey(maxConnsPerKey) {} + + // Routine is responsible to provide an usable TCP connection object; it reuses an active connection from + // connection-pool if availalbe, otherwise, establish a new TCP connection + Future connect(RESTConnectionPoolKey connectKey, const bool isSecure, const int maxConnLife); + void returnConnection(RESTConnectionPoolKey connectKey, ReusableConnection& conn, const int maxConnections); + + static RESTConnectionPoolKey getConnectionPoolKey(const std::string& host, const std::string& service) { + return std::make_pair(host, service); + } +}; + +struct RESTConnectionType { + std::string protocol; + int secure; + + constexpr static int SECURE_CONNECTION = 1; + constexpr static int NOT_SECURE_CONNECTION = 0; + + RESTConnectionType() : protocol("https"), secure(RESTConnectionType::SECURE_CONNECTION) {} + explicit RESTConnectionType(const std::string& p, const int s) : protocol(p), secure(s) {} + std::string toString() const { return format("%s:%d", this->protocol.c_str(), this->secure); } + + static const std::unordered_map supportedConnTypes; + static RESTConnectionType getConnectionType(const std::string&); + static bool isProtocolSupported(const std::string&); + static bool isSecure(const std::string&); +}; + +// Util interface facilitating management and update for RESTClient knob parameters +struct RESTClientKnobs { + int connection_pool_size, connect_timeout, connect_tries, max_connection_life, request_tries, request_timeout_secs; + + RESTClientKnobs(); + + void set(const std::unordered_map& knobSettings); + std::unordered_map get() const; + std::unordered_map knobMap; + + static std::vector getKnobDescriptions() { + return { + "connection_pool_size (pz) Maximum numbers of active connections in the connection-pool", + "connect_tries (or ct) Number of times to try to connect for each request.", + "connect_timeout (or cto) Number of seconds to wait for a connect request to succeed.", + "max_connection_life (or mcl) Maximum number of seconds to use a single TCP connection.", + "request_tries (or rt) Number of times to try each request until a parsable HTTP " + "response other than 429 is received.", + "request_timeout_secs (or rtom) Number of seconds to wait for a request to succeed after a " + "connection is established.", + }; + } +}; + +// Util interface facilitating parsing of an input REST 'full_url' +struct RESTUrl { +public: + // Connection resources - host and port details + std::string host; + std::string service; + // resource identified by URI + std::string resource; + // optional REST request parameters + std::string reqParameters; + // Request 'body' payload + std::string body; + // URL connection type + RESTConnectionType connType; + + explicit RESTUrl(const std::string& fullUrl); + explicit RESTUrl(const std::string& fullUrl, const std::string& body); + + std::string toString() const { + return fmt::format( + "Host {} Service {} Resource {} ReqParams {} Body {}", host, service, resource, reqParameters, body); + } + +private: + void parseUrl(const std::string& fullUrl); +}; + +#endif \ No newline at end of file diff --git a/src/fdbclient/RYWIterator.h b/src/fdbclient/include/fdbclient/RYWIterator.h similarity index 100% rename from src/fdbclient/RYWIterator.h rename to src/fdbclient/include/fdbclient/RYWIterator.h diff --git a/src/fdbclient/include/fdbclient/RandomKeyValueUtils.h b/src/fdbclient/include/fdbclient/RandomKeyValueUtils.h new file mode 100644 index 0000000..7824d71 --- /dev/null +++ b/src/fdbclient/include/fdbclient/RandomKeyValueUtils.h @@ -0,0 +1,324 @@ +/* + * RandomKeyValueUtils.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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 + +#include +#include +#include +#include + +#include "flow/Arena.h" +#include "flow/Error.h" +#include "flow/IRandom.h" +#include "fdbclient/FDBTypes.h" +// Random unsigned int generator which generates integers between and including first and last +// Distribution can be uniform, skewed small, or skewed large +// String Definition Format: [^]first[..last] +// last is optional and defaults to first +// If ^ is present, the generated numbers skew toward first, otherwise are uniform random +// If either first or last begins with a letter character it will be interpreted as its ASCII byte value. +struct RandomIntGenerator { + enum Skew { LARGE, SMALL, NONE }; + + unsigned int min; + unsigned int max; + unsigned int val; + bool alpha = false; + Skew skew = NONE; + + unsigned int parseInt(StringRef s) { + if (s.size() == 0) { + return 0; + } else if (std::isalpha(s[0])) { + alpha = true; + return (unsigned int)s[0]; + } else { + return atol(s.toString().c_str()); + } + } + + RandomIntGenerator(unsigned int only = 0) : min(only), max(only) {} + RandomIntGenerator(unsigned int first, unsigned int last, bool skewTowardFirst) : min(first), max(last) { + if (first != last && skewTowardFirst) { + skew = (first < last) ? SMALL : LARGE; + } + if (min > max) { + std::swap(min, max); + } + } + RandomIntGenerator(const char* cstr) : RandomIntGenerator(std::string(cstr)) {} + RandomIntGenerator(std::string str) : RandomIntGenerator(StringRef(str)) {} + RandomIntGenerator(StringRef str) { + bool skewTowardFirst = false; + if (!str.empty() && str[0] == '^') { + skewTowardFirst = true; + str = str.substr(1); + } + + StringRef first = str.eat(".."); + StringRef last = str; + if (last.size() == 0) { + last = first; + } + + min = parseInt(first); + max = parseInt(last); + if (skewTowardFirst && min != max) { + skew = (min < max) ? SMALL : LARGE; + } + if (min > max) { + std::swap(min, max); + } + } + + // Generate and return a random number + unsigned int next() { + switch (skew) { + case SMALL: + return val = deterministicRandom()->randomSkewedUInt32(min, max + 1); + case LARGE: + return val = max - deterministicRandom()->randomSkewedUInt32(min, max + 1); + case NONE: + default: + return val = deterministicRandom()->randomInt(min, max + 1); + } + } + // Return the last random number returned by next() + unsigned int last() const { return val; } + + std::string formatLimit(int x) const { + return (alpha && std::isalpha(x)) ? fmt::format("{}", (char)x) : fmt::format("{}", x); + } + + std::string toString() const { + if (min == max) { + return fmt::format("{}", min); + } + if (skew == NONE || skew == SMALL) { + return fmt::format("{}{}..{}", (skew == NONE) ? "" : "^", formatLimit(min), formatLimit(max)); + } + ASSERT(skew == LARGE); + return fmt::format("^{}..{}", formatLimit(max), formatLimit(min)); + } +}; + +// Random string generator +// Generates random strings of a random size from a size int generator and made of random chars +// from a random char int generator +// +// String Definition Format: sizeRange[/byteRange] +// sizeRange and byteRange are RandomIntGenerators +// The default `byteRange` is 0:255 +struct RandomStringGenerator { + RandomStringGenerator() {} + RandomStringGenerator(RandomIntGenerator size, RandomIntGenerator byteset) : size(size), bytes(byteset) {} + RandomStringGenerator(const char* cstr) : RandomStringGenerator(std::string(cstr)) {} + RandomStringGenerator(std::string str) : RandomStringGenerator(StringRef(str)) {} + RandomStringGenerator(StringRef str) { + StringRef sSize = str.eat("/"); + StringRef sBytes = str; + if (sBytes.size() == 0) { + sBytes = "0:255"_sr; + } + size = RandomIntGenerator(sSize.toString()); + bytes = RandomIntGenerator(sBytes); + } + + RandomIntGenerator size; + RandomIntGenerator bytes; + Standalone val; + + Standalone next() { + val = makeString(size.next()); + for (int i = 0; i < val.size(); ++i) { + mutateString(val)[i] = (uint8_t)bytes.next(); + } + return val; + } + + Standalone last() { return val; }; + + std::string toString() const { return fmt::format("{}/{}", size.toString(), bytes.toString()); } +}; + +// Same construction, definition, and usage as RandomStringGenerator but sacrifices randomness +// and uniqueness for performance. +// It uses a large pre-generated string and generates random substrings from it. +struct RandomValueGenerator { + template + RandomValueGenerator(Args&&... args) : strings(std::forward(args)...) { + // Make a similar RandomStringGenerator to generate the noise block from + noise = RandomStringGenerator(RandomIntGenerator(std::max(2e6, strings.size.max)), strings.bytes).next(); + } + + RandomStringGenerator strings; + Standalone noise; + Value val; + + Value next() { + int len = strings.size.next(); + val = Value(noise.substr(deterministicRandom()->randomInt(0, noise.size() - len + 1), len), noise.arena()); + return val; + } + + Value last() const { return val; }; + + std::string toString() const { return fmt::format("{}", strings.toString()); } +}; + +// Base class for randomly generated key sets +// Returns a random or nearby key at some distance from a vector of keys generated at init time. +// Requires a RandomIntGenerator as the index generator for selecting which random next key to return. The given index +// generator should have a min of 0 and if it doesn't its min will be updated to 0. +struct RandomStringSetGeneratorBase { + Arena arena; + std::vector keys; + RandomIntGenerator indexGenerator; + int iVal; + KeyRange rangeVal; + + template + void init(RandomIntGenerator originalIndexGenerator, KeyGen& keyGen) { + indexGenerator = originalIndexGenerator; + indexGenerator.min = 0; + std::set uniqueKeys; + int inserts = 0; + while (uniqueKeys.size() < indexGenerator.max) { + auto k = keyGen.next(); + uniqueKeys.insert(k); + if (++inserts > 3 * indexGenerator.max) { + // StringGenerator cardinality is too low, unable to find enough unique keys. + ASSERT(false); + } + } + // Adjust indexGenerator max down by 1 because indices are 0-based. + --indexGenerator.max; + + for (auto& k : uniqueKeys) { + keys.push_back(KeyRef(arena, k)); + } + iVal = 0; + } + + Key last() const { return Key(keys[iVal], arena); }; + KeyRange lastRange() const { return rangeVal; } + + Key next() { + iVal = indexGenerator.next(); + return last(); + } + + // Next sequential with some jump distance and optional wrap-around which is false + Key next(int distance, bool wrap = false) { + iVal += distance; + if (wrap) { + iVal %= keys.size(); + } else { + iVal = std::clamp(iVal, 0, keys.size() - 1); + } + + return last(); + } + + KeyRange nextRange(int width) { + int begin = indexGenerator.next(); + int end = (begin + width) % keys.size(); + if (begin > end) { + std::swap(begin, end); + } + rangeVal = KeyRange(KeyRangeRef(keys[begin], keys[end]), arena); + return rangeVal; + } + + KeyRange nextRange() { return nextRange(deterministicRandom()->randomSkewedUInt32(0, keys.size())); } +}; + +template +struct RandomStringSetGenerator : public RandomStringSetGeneratorBase { + RandomStringSetGenerator(RandomIntGenerator indexGen, StringGenT stringGen) + : indexGen(indexGen), stringGen(stringGen) { + init(indexGen, stringGen); + } + RandomStringSetGenerator(const char* cstr) : RandomStringSetGenerator(std::string(cstr)) {} + RandomStringSetGenerator(std::string str) : RandomStringSetGenerator(StringRef(str)) {} + RandomStringSetGenerator(StringRef str) { + indexGen = str.eat("::"); + stringGen = str; + init(indexGen, stringGen); + } + + RandomIntGenerator indexGen; + StringGenT stringGen; + + std::string toString() const { return fmt::format("{}::{}", indexGen.toString(), stringGen.toString()); } +}; + +typedef RandomStringSetGenerator RandomKeySetGenerator; + +// Generate random keys which are composed of tuple segments from a list of RandomKeySets +// String Definition Format: RandomKeySet[,RandomKeySet]... +struct RandomKeyTupleGenerator { + RandomKeyTupleGenerator(){}; + RandomKeyTupleGenerator(std::vector tupleParts) : tuples(tupleParts) {} + RandomKeyTupleGenerator(std::string s) : RandomKeyTupleGenerator(StringRef(s)) {} + RandomKeyTupleGenerator(StringRef s) { + while (!s.empty()) { + tuples.push_back(s.eat(",")); + } + } + + std::vector tuples; + Key val; + + Key next() { + int totalBytes = 0; + for (auto& t : tuples) { + totalBytes += t.next().size(); + } + val = makeString(totalBytes); + totalBytes = 0; + + for (auto& t : tuples) { + memcpy(mutateString(val) + totalBytes, t.last().begin(), t.last().size()); + totalBytes += t.last().size(); + } + return val; + } + + Key last() const { return val; }; + + std::string toString() const { + std::string s; + for (auto const& t : tuples) { + if (!s.empty()) { + s += ','; + } + s += t.toString(); + } + return s; + } +}; + +typedef RandomStringSetGenerator RandomKeyTupleSetGenerator; + +struct RandomMutationGenerator { + RandomKeyTupleSetGenerator keys; + RandomValueGenerator valueGen; +}; diff --git a/src/fdbclient/ReadYourWrites.h b/src/fdbclient/include/fdbclient/ReadYourWrites.h similarity index 85% rename from src/fdbclient/ReadYourWrites.h rename to src/fdbclient/include/fdbclient/ReadYourWrites.h index 341dc4e..16d6493 100644 --- a/src/fdbclient/ReadYourWrites.h +++ b/src/fdbclient/include/fdbclient/ReadYourWrites.h @@ -20,12 +20,14 @@ #ifndef FDBCLIENT_READYOURWRITES_H #define FDBCLIENT_READYOURWRITES_H +#include "fdbclient/Status.h" #pragma once #include "fdbclient/NativeAPI.actor.h" #include "fdbclient/KeyRangeMap.h" #include "fdbclient/RYWIterator.h" #include "fdbclient/ISingleThreadTransaction.h" +#include "flow/WipedString.h" #include // SOMEDAY: Optimize getKey to avoid using getRange @@ -68,11 +70,12 @@ class ReadYourWritesTransaction final : NonCopyable, public ISingleThreadTransaction, public FastAllocated { public: - explicit ReadYourWritesTransaction(Database const& cx, Optional tenant = Optional()); + explicit ReadYourWritesTransaction(Database const& cx, + Optional> const& tenant = Optional>()); ~ReadYourWritesTransaction(); void construct(Database const&) override; - void construct(Database const&, TenantName const& tenant) override; + void construct(Database const&, Reference const& tenant) override; void setVersion(Version v) override { tr.setVersion(v); } Future getReadVersion() override; Optional getCachedReadVersion() const override { return tr.getCachedReadVersion(); } @@ -119,12 +122,17 @@ class ReadYourWritesTransaction final : NonCopyable, Future>> getRangeSplitPoints(const KeyRange& range, int64_t chunkSize) override; Future getEstimatedRangeSizeBytes(const KeyRange& keys) override; - Future>> getBlobGranuleRanges(const KeyRange& range) override; + Future>> getBlobGranuleRanges(const KeyRange& range, int rangeLimit) override; Future>> readBlobGranules(const KeyRange& range, Version begin, Optional readVersion, Version* readVersionOut) override; + Future>> summarizeBlobGranules(const KeyRange& range, + Optional summaryVersion, + int rangeLimit) override; + void addGranuleMaterializeStats(const GranuleMaterializeStats& stats) override; + void addReadConflictRange(KeyRangeRef const& keys) override; void makeSelfConflicting() override { tr.makeSelfConflicting(); } @@ -140,8 +148,10 @@ class ReadYourWritesTransaction final : NonCopyable, [[nodiscard]] Future commit() override; Version getCommittedVersion() const override { return tr.getCommittedVersion(); } VersionVector getVersionVector() const override { return tr.getVersionVector(); } - UID getSpanID() const override { return tr.getSpanID(); } + SpanContext getSpanContext() const override { return tr.getSpanContext(); } + double getTagThrottledDuration() const override { return tr.getTagThrottledDuration(); } + int64_t getTotalCost() const override { return tr.getTotalCost(); } int64_t getApproximateSize() const override { return approximateSize; } [[nodiscard]] Future> getVersionstamp() override; @@ -177,7 +187,7 @@ class ReadYourWritesTransaction final : NonCopyable, Reference getTransactionState() const { return tr.trState; } - void setTransactionID(uint64_t id); + void setTransactionID(UID id); void setToken(uint64_t token); // Read from the special key space readConflictRangeKeysRange @@ -191,15 +201,32 @@ class ReadYourWritesTransaction final : NonCopyable, KeyRangeMap>>& getSpecialKeySpaceWriteMap() { return specialKeySpaceWriteMap; } bool readYourWritesDisabled() const { return options.readYourWritesDisabled; } const Optional& getSpecialKeySpaceErrorMsg() { return specialKeySpaceErrorMsg; } - void setSpecialKeySpaceErrorMsg(const std::string& msg) { specialKeySpaceErrorMsg = msg; } + void setSpecialKeySpaceErrorMsg(const std::string& msg) { + if (g_network && g_network->isSimulated()) { + try { + readJSONStrictly(msg); + } catch (Error& e) { + TraceEvent(SevError, "InvalidSpecialKeySpaceErrorMessage").error(e).detail("Message", msg); + ASSERT(false); + } + } + specialKeySpaceErrorMsg = msg; + } Transaction& getTransaction() { return tr; } - Optional getTenant() { return tr.getTenant(); } + Optional> getTenant() { return tr.getTenant(); } + TagSet const& getTags() const { return tr.getTags(); } // used in template functions as returned Future type template using FutureT = Future; + virtual void debugTrace(BaseTraceEvent&& event) override; + void debugPrint(std::string const& message) override; + + std::vector debugTraces; + std::vector debugMessages; + private: friend class RYWImpl; @@ -249,6 +276,7 @@ class ReadYourWritesTransaction final : NonCopyable, void applyPersistentOptions(); std::vector>>> persistentOptions; + std::vector>> sensitivePersistentOptions; ReadYourWritesTransactionOptions options; }; diff --git a/src/fdbclient/RestoreInterface.h b/src/fdbclient/include/fdbclient/RestoreInterface.h similarity index 100% rename from src/fdbclient/RestoreInterface.h rename to src/fdbclient/include/fdbclient/RestoreInterface.h diff --git a/src/fdbclient/RunTransaction.actor.g.h b/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h similarity index 53% rename from src/fdbclient/RunTransaction.actor.g.h rename to src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h index f9ef422..eef31db 100644 --- a/src/fdbclient/RunTransaction.actor.g.h +++ b/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h @@ -1,7 +1,7 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" /* - * RunTransaction.actor.h + * RunRYWTransaction.actor.h * * This source file is part of the FoundationDB open source project * @@ -24,37 +24,46 @@ // When actually compiled (NO_INTELLISENSE), include the generated version of this file. In intellisense use the source // version. -#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_RUNTRANSACTION_ACTOR_G_H) -#define FDBCLIENT_RUNTRANSACTION_ACTOR_G_H -#include "fdbclient/RunTransaction.actor.g.h" -#elif !defined(FDBCLIENT_RUNTRANSACTION_ACTOR_H) -#define FDBCLIENT_RUNTRANSACTION_ACTOR_H +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_RUNRYWTRANSACTION_ACTOR_G_H) +#define FDBCLIENT_RUNRYWTRANSACTION_ACTOR_G_H +#include "fdbclient/RunRYWTransaction.actor.g.h" +#elif !defined(FDBCLIENT_RUNRYWTRANSACTION_ACTOR_H) +#define FDBCLIENT_RUNRYWTRANSACTION_ACTOR_H #include #include "flow/flow.h" +#include "fdbclient/RunTransaction.actor.h" #include "fdbclient/ReadYourWrites.h" #include "flow/actorcompiler.h" // This must be the last #include. - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" +// Runs a RYW transaction in a retry loop on the given Database. +// +// Takes a function func that accepts a Reference as a parameter and returns a non-Void +// Future. This function is run inside the transaction, and when the transaction is successfully committed the result of +// the function is returned. +// +// The supplied function should be idempotent. Otherwise, outcome of this function will depend on how many times the +// transaction is retried. + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" namespace { // This generated class is to be used only via runRYWTransaction() - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" template - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" class RunRYWTransactionActorState { - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" public: - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" RunRYWTransactionActorState(Database const& cx,Function const& func) - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" : cx(cx), - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" func(func), - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" tr(new ReadYourWritesTransaction(cx)) - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" { fdb_probe_actor_create("runRYWTransaction", reinterpret_cast(this)); @@ -67,9 +76,9 @@ class RunRYWTransactionActorState { int a_body1(int loopDepth=0) { try { - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" ; - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -98,16 +107,16 @@ class RunRYWTransactionActorState { int a_body1loopBody1(int loopDepth) { try { - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" StrictFuture()(Reference()).getValue())> __when_expr_0 = func(tr); - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" __when_expr_0.addCallbackAndClear(static_cast()(Reference()).getValue()) >*>(static_cast(this))); - #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -127,16 +136,16 @@ class RunRYWTransactionActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" StrictFuture __when_expr_2 = tr->onError(e); - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -149,25 +158,25 @@ class RunRYWTransactionActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" StrictFuture __when_expr_1 = tr->commit(); - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1loopBody1when1(decltype(std::declval()(Reference()).getValue()) const& __result,int loopDepth) { - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" result = __result; - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; @@ -232,9 +241,9 @@ class RunRYWTransactionActorState { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (!static_cast(this)->SAV()(Reference()).getValue())>::futures) { (void)(result); this->~RunRYWTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" new (&static_cast(this)->SAV< decltype(std::declval()(Reference()).getValue()) >::value()) decltype(std::declval()(Reference()).getValue())(std::move(result)); // state_var_RVO this->~RunRYWTransactionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -244,9 +253,9 @@ class RunRYWTransactionActorState { } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (!static_cast(this)->SAV()(Reference()).getValue())>::futures) { (void)(result); this->~RunRYWTransactionActorState(); static_cast(this)->destroy(); return 0; } - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" new (&static_cast(this)->SAV< decltype(std::declval()(Reference()).getValue()) >::value()) decltype(std::declval()(Reference()).getValue())(std::move(result)); // state_var_RVO this->~RunRYWTransactionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -392,22 +401,22 @@ class RunRYWTransactionActorState { fdb_probe_actor_exit("runRYWTransaction", reinterpret_cast(this), 2); } - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" Database cx; - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" Function func; - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" Reference tr; - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" decltype(std::declval()(Reference()).getValue()) result; - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" }; // This generated class is to be used only via runRYWTransaction() - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" template - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" class RunRYWTransactionActor final : public Actor()(Reference()).getValue())>, public ActorCallback< RunRYWTransactionActor, 0, decltype(std::declval()(Reference()).getValue()) >, public ActorCallback< RunRYWTransactionActor, 1, Void >, public ActorCallback< RunRYWTransactionActor, 2, Void >, public FastAllocated>, public RunRYWTransactionActorState> { - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -418,9 +427,9 @@ class RunRYWTransactionActor final : public Actor, 0, decltype(std::declval()(Reference()).getValue()) >; friend struct ActorCallback< RunRYWTransactionActor, 1, Void >; friend struct ActorCallback< RunRYWTransactionActor, 2, Void >; - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" RunRYWTransactionActor(Database const& cx,Function const& func) - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" : Actor()(Reference()).getValue())>(), RunRYWTransactionActorState>(cx, func) { @@ -446,36 +455,474 @@ friend struct ActorCallback< RunRYWTransactionActor, 2, Void >; } }; } - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" template - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" [[nodiscard]] Future()(Reference()).getValue())> runRYWTransaction( Database const& cx, Function const& func ) { - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" return Future()(Reference()).getValue())>(new RunRYWTransactionActor(cx, func)); - #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" } -#line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" +#line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" - #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" +// Runs a RYW transaction in a retry loop on the given Database. +// +// Takes a function func that accepts a Reference as a parameter and returns a Void +// Future. This function is run inside the transaction. +// +// The supplied function should be idempotent. Otherwise, outcome of this function will depend on how many times the +// transaction is retried. + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" +namespace { +// This generated class is to be used only via runRYWTransactionVoid() + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" +template + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" +class RunRYWTransactionVoidActorState { + #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" +public: + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + RunRYWTransactionVoidActorState(Database const& cx,Function const& func) + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + : cx(cx), + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + func(func), + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + tr(new ReadYourWritesTransaction(cx)) + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" + { + fdb_probe_actor_create("runRYWTransactionVoid", reinterpret_cast(this)); + + } + ~RunRYWTransactionVoidActorState() + { + fdb_probe_actor_destroy("runRYWTransactionVoid", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + ; + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~RunRYWTransactionVoidActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + StrictFuture __when_expr_0 = func(tr); + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + StrictFuture __when_expr_2 = tr->onError(e); + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Void const& _,int loopDepth) + { + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + StrictFuture __when_expr_1 = tr->commit(); + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Void && _,int loopDepth) + { + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + StrictFuture __when_expr_1 = tr->commit(); + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RunRYWTransactionVoidActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RunRYWTransactionVoidActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("runRYWTransactionVoid", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runRYWTransactionVoid", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< RunRYWTransactionVoidActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("runRYWTransactionVoid", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runRYWTransactionVoid", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< RunRYWTransactionVoidActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("runRYWTransactionVoid", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runRYWTransactionVoid", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RunRYWTransactionVoidActorState(); static_cast(this)->destroy(); return 0; } + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RunRYWTransactionVoidActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RunRYWTransactionVoidActorState(); static_cast(this)->destroy(); return 0; } + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RunRYWTransactionVoidActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RunRYWTransactionVoidActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RunRYWTransactionVoidActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("runRYWTransactionVoid", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runRYWTransactionVoid", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< RunRYWTransactionVoidActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("runRYWTransactionVoid", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runRYWTransactionVoid", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< RunRYWTransactionVoidActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("runRYWTransactionVoid", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runRYWTransactionVoid", reinterpret_cast(this), 1); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RunRYWTransactionVoidActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RunRYWTransactionVoidActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("runRYWTransactionVoid", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runRYWTransactionVoid", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< RunRYWTransactionVoidActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("runRYWTransactionVoid", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runRYWTransactionVoid", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< RunRYWTransactionVoidActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("runRYWTransactionVoid", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runRYWTransactionVoid", reinterpret_cast(this), 2); + + } + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + Database cx; + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + Function func; + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + Reference tr; + #line 850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" +}; +// This generated class is to be used only via runRYWTransactionVoid() + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" +template + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" +class RunRYWTransactionVoidActor final : public Actor, public ActorCallback< RunRYWTransactionVoidActor, 0, Void >, public ActorCallback< RunRYWTransactionVoidActor, 1, Void >, public ActorCallback< RunRYWTransactionVoidActor, 2, Void >, public FastAllocated>, public RunRYWTransactionVoidActorState> { + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< RunRYWTransactionVoidActor, 0, Void >; +friend struct ActorCallback< RunRYWTransactionVoidActor, 1, Void >; +friend struct ActorCallback< RunRYWTransactionVoidActor, 2, Void >; + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + RunRYWTransactionVoidActor(Database const& cx,Function const& func) + #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" + : Actor(), + RunRYWTransactionVoidActorState>(cx, func) + { + fdb_probe_actor_enter("runRYWTransactionVoid", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("runRYWTransactionVoid"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("runRYWTransactionVoid", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< RunRYWTransactionVoidActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< RunRYWTransactionVoidActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< RunRYWTransactionVoidActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" +template + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" +[[nodiscard]] Future runRYWTransactionVoid( Database const& cx, Function const& func ) { + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + return Future(new RunRYWTransactionVoidActor(cx, func)); + #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" +} + +#line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" namespace { // This generated class is to be used only via runRYWTransactionFailIfLocked() - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" template - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" class RunRYWTransactionFailIfLockedActorState { - #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" public: - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" RunRYWTransactionFailIfLockedActorState(Database const& cx,Function const& func) - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" : cx(cx), - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" func(func), - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" tr(new ReadYourWritesTransaction(cx)) - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" { fdb_probe_actor_create("runRYWTransactionFailIfLocked", reinterpret_cast(this)); @@ -488,9 +935,9 @@ class RunRYWTransactionFailIfLockedActorState { int a_body1(int loopDepth=0) { try { - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" ; - #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -519,16 +966,16 @@ class RunRYWTransactionFailIfLockedActorState { int a_body1loopBody1(int loopDepth) { try { - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" StrictFuture()(Reference()).getValue())> __when_expr_0 = func(tr); - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" __when_expr_0.addCallbackAndClear(static_cast()(Reference()).getValue()) >*>(static_cast(this))); - #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -548,24 +995,24 @@ class RunRYWTransactionFailIfLockedActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (e.code() == error_code_database_locked) - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" { - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" } - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" StrictFuture __when_expr_2 = tr->onError(e); - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -578,25 +1025,25 @@ class RunRYWTransactionFailIfLockedActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" StrictFuture __when_expr_1 = tr->commit(); - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1loopBody1when1(decltype(std::declval()(Reference()).getValue()) const& __result,int loopDepth) { - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" result = __result; - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; @@ -661,9 +1108,9 @@ class RunRYWTransactionFailIfLockedActorState { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (!static_cast(this)->SAV()(Reference()).getValue())>::futures) { (void)(result); this->~RunRYWTransactionFailIfLockedActorState(); static_cast(this)->destroy(); return 0; } - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" new (&static_cast(this)->SAV< decltype(std::declval()(Reference()).getValue()) >::value()) decltype(std::declval()(Reference()).getValue())(std::move(result)); // state_var_RVO this->~RunRYWTransactionFailIfLockedActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -673,9 +1120,9 @@ class RunRYWTransactionFailIfLockedActorState { } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (!static_cast(this)->SAV()(Reference()).getValue())>::futures) { (void)(result); this->~RunRYWTransactionFailIfLockedActorState(); static_cast(this)->destroy(); return 0; } - #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" new (&static_cast(this)->SAV< decltype(std::declval()(Reference()).getValue()) >::value()) decltype(std::declval()(Reference()).getValue())(std::move(result)); // state_var_RVO this->~RunRYWTransactionFailIfLockedActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -821,22 +1268,22 @@ class RunRYWTransactionFailIfLockedActorState { fdb_probe_actor_exit("runRYWTransactionFailIfLocked", reinterpret_cast(this), 2); } - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" Database cx; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" Function func; - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" Reference tr; - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" decltype(std::declval()(Reference()).getValue()) result; - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" }; // This generated class is to be used only via runRYWTransactionFailIfLocked() - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" template - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" class RunRYWTransactionFailIfLockedActor final : public Actor()(Reference()).getValue())>, public ActorCallback< RunRYWTransactionFailIfLockedActor, 0, decltype(std::declval()(Reference()).getValue()) >, public ActorCallback< RunRYWTransactionFailIfLockedActor, 1, Void >, public ActorCallback< RunRYWTransactionFailIfLockedActor, 2, Void >, public FastAllocated>, public RunRYWTransactionFailIfLockedActorState> { - #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -847,9 +1294,9 @@ class RunRYWTransactionFailIfLockedActor final : public Actor, 0, decltype(std::declval()(Reference()).getValue()) >; friend struct ActorCallback< RunRYWTransactionFailIfLockedActor, 1, Void >; friend struct ActorCallback< RunRYWTransactionFailIfLockedActor, 2, Void >; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" RunRYWTransactionFailIfLockedActor(Database const& cx,Function const& func) - #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" : Actor()(Reference()).getValue())>(), RunRYWTransactionFailIfLockedActorState>(cx, func) { @@ -875,36 +1322,36 @@ friend struct ActorCallback< RunRYWTransactionFailIfLockedActor, 2, Vo } }; } - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" template - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" [[nodiscard]] Future()(Reference()).getValue())> runRYWTransactionFailIfLocked( Database const& cx, Function const& func ) { - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" return Future()(Reference()).getValue())>(new RunRYWTransactionFailIfLockedActor(cx, func)); - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" } -#line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" +#line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" - #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" namespace { // This generated class is to be used only via runRYWTransactionNoRetry() - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" template - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" class RunRYWTransactionNoRetryActorState { - #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" public: - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" RunRYWTransactionNoRetryActorState(Database const& cx,Function const& func) - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" : cx(cx), - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" func(func), - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" tr(new ReadYourWritesTransaction(cx)) - #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" { fdb_probe_actor_create("runRYWTransactionNoRetry", reinterpret_cast(this)); @@ -917,16 +1364,16 @@ class RunRYWTransactionNoRetryActorState { int a_body1(int loopDepth=0) { try { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" StrictFuture()(Reference()).getValue())> __when_expr_0 = func(tr); - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" __when_expr_0.addCallbackAndClear(static_cast()(Reference()).getValue()) >*>(static_cast(this))); - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -947,25 +1394,25 @@ class RunRYWTransactionNoRetryActorState { } int a_body1cont1(int loopDepth) { - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" StrictFuture __when_expr_1 = tr->commit(); - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1when1(decltype(std::declval()(Reference()).getValue()) const& __result,int loopDepth) { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" result = __result; - #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -1030,9 +1477,9 @@ class RunRYWTransactionNoRetryActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (!static_cast(this)->SAV()(Reference()).getValue())>::futures) { (void)(result); this->~RunRYWTransactionNoRetryActorState(); static_cast(this)->destroy(); return 0; } - #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" new (&static_cast(this)->SAV< decltype(std::declval()(Reference()).getValue()) >::value()) decltype(std::declval()(Reference()).getValue())(std::move(result)); // state_var_RVO this->~RunRYWTransactionNoRetryActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1042,9 +1489,9 @@ class RunRYWTransactionNoRetryActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" if (!static_cast(this)->SAV()(Reference()).getValue())>::futures) { (void)(result); this->~RunRYWTransactionNoRetryActorState(); static_cast(this)->destroy(); return 0; } - #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" new (&static_cast(this)->SAV< decltype(std::declval()(Reference()).getValue()) >::value()) decltype(std::declval()(Reference()).getValue())(std::move(result)); // state_var_RVO this->~RunRYWTransactionNoRetryActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1115,22 +1562,22 @@ class RunRYWTransactionNoRetryActorState { fdb_probe_actor_exit("runRYWTransactionNoRetry", reinterpret_cast(this), 1); } - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" Database cx; - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" Function func; - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" Reference tr; - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" decltype(std::declval()(Reference()).getValue()) result; - #line 1126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" }; // This generated class is to be used only via runRYWTransactionNoRetry() - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" template - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" class RunRYWTransactionNoRetryActor final : public Actor()(Reference()).getValue())>, public ActorCallback< RunRYWTransactionNoRetryActor, 0, decltype(std::declval()(Reference()).getValue()) >, public ActorCallback< RunRYWTransactionNoRetryActor, 1, Void >, public FastAllocated>, public RunRYWTransactionNoRetryActorState> { - #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -1140,9 +1587,9 @@ class RunRYWTransactionNoRetryActor final : public Actor, 0, decltype(std::declval()(Reference()).getValue()) >; friend struct ActorCallback< RunRYWTransactionNoRetryActor, 1, Void >; - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" RunRYWTransactionNoRetryActor(Database const& cx,Function const& func) - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" : Actor()(Reference()).getValue())>(), RunRYWTransactionNoRetryActorState>(cx, func) { @@ -1167,16 +1614,16 @@ friend struct ActorCallback< RunRYWTransactionNoRetryActor, 1, Void >; } }; } - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" template - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" [[nodiscard]] Future()(Reference()).getValue())> runRYWTransactionNoRetry( Database const& cx, Function const& func ) { - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" return Future()(Reference()).getValue())>(new RunRYWTransactionNoRetryActor(cx, func)); - #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.g.h" + #line 1623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.g.h" } -#line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/RunTransaction.actor.h" +#line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h" #include "flow/unactorcompiler.h" #endif diff --git a/src/fdbclient/RunTransaction.actor.h b/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h similarity index 62% rename from src/fdbclient/RunTransaction.actor.h rename to src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h index 91530a0..3804fb1 100644 --- a/src/fdbclient/RunTransaction.actor.h +++ b/src/fdbclient/include/fdbclient/RunRYWTransaction.actor.h @@ -1,5 +1,5 @@ /* - * RunTransaction.actor.h + * RunRYWTransaction.actor.h * * This source file is part of the FoundationDB open source project * @@ -22,18 +22,27 @@ // When actually compiled (NO_INTELLISENSE), include the generated version of this file. In intellisense use the source // version. -#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_RUNTRANSACTION_ACTOR_G_H) -#define FDBCLIENT_RUNTRANSACTION_ACTOR_G_H -#include "fdbclient/RunTransaction.actor.g.h" -#elif !defined(FDBCLIENT_RUNTRANSACTION_ACTOR_H) -#define FDBCLIENT_RUNTRANSACTION_ACTOR_H +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_RUNRYWTRANSACTION_ACTOR_G_H) +#define FDBCLIENT_RUNRYWTRANSACTION_ACTOR_G_H +#include "fdbclient/RunRYWTransaction.actor.g.h" +#elif !defined(FDBCLIENT_RUNRYWTRANSACTION_ACTOR_H) +#define FDBCLIENT_RUNRYWTRANSACTION_ACTOR_H #include #include "flow/flow.h" +#include "fdbclient/RunTransaction.actor.h" #include "fdbclient/ReadYourWrites.h" #include "flow/actorcompiler.h" // This must be the last #include. +// Runs a RYW transaction in a retry loop on the given Database. +// +// Takes a function func that accepts a Reference as a parameter and returns a non-Void +// Future. This function is run inside the transaction, and when the transaction is successfully committed the result of +// the function is returned. +// +// The supplied function should be idempotent. Otherwise, outcome of this function will depend on how many times the +// transaction is retried. ACTOR template Future()(Reference()).getValue())> runRYWTransaction( Database cx, @@ -41,7 +50,6 @@ Future()(Reference()) state Reference tr(new ReadYourWritesTransaction(cx)); loop { try { - // func should be idempodent; otherwise, retry will get undefined result state decltype(std::declval()(Reference()).getValue()) result = wait(func(tr)); wait(tr->commit()); @@ -52,6 +60,27 @@ Future()(Reference()) } } +// Runs a RYW transaction in a retry loop on the given Database. +// +// Takes a function func that accepts a Reference as a parameter and returns a Void +// Future. This function is run inside the transaction. +// +// The supplied function should be idempotent. Otherwise, outcome of this function will depend on how many times the +// transaction is retried. +ACTOR template +Future runRYWTransactionVoid(Database cx, Function func) { + state Reference tr(new ReadYourWritesTransaction(cx)); + loop { + try { + wait(func(tr)); + wait(tr->commit()); + return Void(); + } catch (Error& e) { + wait(tr->onError(e)); + } + } +} + ACTOR template Future()(Reference()).getValue())> runRYWTransactionFailIfLocked(Database cx, Function func) { diff --git a/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h b/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h new file mode 100644 index 0000000..2b30961 --- /dev/null +++ b/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h @@ -0,0 +1,966 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" +/* + * RunTransaction.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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(FDBCLIENT_RUNTRANSACTION_ACTOR_G_H) +#define FDBCLIENT_RUNTRANSACTION_ACTOR_G_H +#include "fdbclient/RunTransaction.actor.g.h" +#elif !defined(FDBCLIENT_RUNTRANSACTION_ACTOR_H) +#define FDBCLIENT_RUNTRANSACTION_ACTOR_H + +#include + +#include "flow/flow.h" +#include "fdbclient/FDBOptions.g.h" +#include "flow/actorcompiler.h" // This must be the last #include. + +template +struct transaction_option_setter : std::false_type {}; + +template +struct transaction_option_setter> : transaction_option_setter {}; + +template +constexpr bool can_set_transaction_options = transaction_option_setter::value; + + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" +namespace { +// This generated class is to be used only via runTransaction() + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" +template + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" +class RunTransactionActorState { + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" +public: + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + RunTransactionActorState(Reference const& db,Function const& func) + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + : db(db), + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + func(func), + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + tr(db->createTransaction()) + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + { + fdb_probe_actor_create("runTransaction", reinterpret_cast(this)); + + } + ~RunTransactionActorState() + { + fdb_probe_actor_destroy("runTransaction", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + ; + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~RunTransactionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + if constexpr (can_set_transaction_options) + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + { + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + db->setOptions(tr); + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + } + try { + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + StrictFuture()(Reference()).getValue())> __when_expr_0 = func(tr); + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + __when_expr_0.addCallbackAndClear(static_cast()(Reference()).getValue()) >*>(static_cast(this))); + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->onError(e)); + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont3(int loopDepth) + { + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->commit()); + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(decltype(std::declval()(Reference()).getValue()) const& __result,int loopDepth) + { + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + result = __result; + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(decltype(std::declval()(Reference()).getValue()) && __result,int loopDepth) + { + result = std::move(__result); + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RunTransactionActor, 0, decltype(std::declval()(Reference()).getValue()) >::remove(); + + } + void a_callback_fire(ActorCallback< RunTransactionActor, 0, decltype(std::declval()(Reference()).getValue()) >*,decltype(std::declval()(Reference()).getValue()) const& value) + { + fdb_probe_actor_enter("runTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransaction", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< RunTransactionActor, 0, decltype(std::declval()(Reference()).getValue()) >*,decltype(std::declval()(Reference()).getValue()) && value) + { + fdb_probe_actor_enter("runTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransaction", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< RunTransactionActor, 0, decltype(std::declval()(Reference()).getValue()) >*,Error err) + { + fdb_probe_actor_enter("runTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransaction", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont4(Void const& _,int loopDepth) + { + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + if (!static_cast(this)->SAV()(Reference()).getValue())>::futures) { (void)(result); this->~RunTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + new (&static_cast(this)->SAV< decltype(std::declval()(Reference()).getValue()) >::value()) decltype(std::declval()(Reference()).getValue())(std::move(result)); // state_var_RVO + this->~RunTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + if (!static_cast(this)->SAV()(Reference()).getValue())>::futures) { (void)(result); this->~RunTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + new (&static_cast(this)->SAV< decltype(std::declval()(Reference()).getValue()) >::value()) decltype(std::declval()(Reference()).getValue())(std::move(result)); // state_var_RVO + this->~RunTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RunTransactionActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RunTransactionActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("runTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransaction", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< RunTransactionActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("runTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransaction", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< RunTransactionActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("runTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransaction", reinterpret_cast(this), 1); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RunTransactionActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RunTransactionActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("runTransaction", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransaction", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< RunTransactionActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("runTransaction", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransaction", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< RunTransactionActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("runTransaction", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransaction", reinterpret_cast(this), 2); + + } + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + Reference db; + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + Function func; + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + Reference tr; + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + decltype(std::declval()(Reference()).getValue()) result; + #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" +}; +// This generated class is to be used only via runTransaction() + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" +template + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" +class RunTransactionActor final : public Actor()(Reference()).getValue())>, public ActorCallback< RunTransactionActor, 0, decltype(std::declval()(Reference()).getValue()) >, public ActorCallback< RunTransactionActor, 1, Void >, public ActorCallback< RunTransactionActor, 2, Void >, public FastAllocated>, public RunTransactionActorState> { + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor()(Reference()).getValue())>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< RunTransactionActor, 0, decltype(std::declval()(Reference()).getValue()) >; +friend struct ActorCallback< RunTransactionActor, 1, Void >; +friend struct ActorCallback< RunTransactionActor, 2, Void >; + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + RunTransactionActor(Reference const& db,Function const& func) + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + : Actor()(Reference()).getValue())>(), + RunTransactionActorState>(db, func) + { + fdb_probe_actor_enter("runTransaction", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("runTransaction"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("runTransaction", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< RunTransactionActor, 0, decltype(std::declval()(Reference()).getValue()) >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< RunTransactionActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< RunTransactionActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" +template + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" +[[nodiscard]] Future()(Reference()).getValue())> runTransaction( Reference const& db, Function const& func ) { + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + return Future()(Reference()).getValue())>(new RunTransactionActor(db, func)); + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" +} + +#line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" +namespace { +// This generated class is to be used only via runTransactionVoid() + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" +template + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" +class RunTransactionVoidActorState { + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" +public: + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + RunTransactionVoidActorState(Reference const& db,Function const& func) + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + : db(db), + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + func(func), + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + tr(db->createTransaction()) + #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + { + fdb_probe_actor_create("runTransactionVoid", reinterpret_cast(this)); + + } + ~RunTransactionVoidActorState() + { + fdb_probe_actor_destroy("runTransactionVoid", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + ; + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~RunTransactionVoidActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + if constexpr (can_set_transaction_options) + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + { + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + db->setOptions(tr); + #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + } + try { + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + StrictFuture __when_expr_0 = func(tr); + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->onError(e)); + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->commit()); + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->commit()); + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RunTransactionVoidActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RunTransactionVoidActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("runTransactionVoid", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransactionVoid", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< RunTransactionVoidActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("runTransactionVoid", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransactionVoid", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< RunTransactionVoidActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("runTransactionVoid", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransactionVoid", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont4(Void const& _,int loopDepth) + { + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RunTransactionVoidActorState(); static_cast(this)->destroy(); return 0; } + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RunTransactionVoidActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RunTransactionVoidActorState(); static_cast(this)->destroy(); return 0; } + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RunTransactionVoidActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RunTransactionVoidActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RunTransactionVoidActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("runTransactionVoid", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransactionVoid", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< RunTransactionVoidActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("runTransactionVoid", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransactionVoid", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< RunTransactionVoidActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("runTransactionVoid", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransactionVoid", reinterpret_cast(this), 1); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RunTransactionVoidActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RunTransactionVoidActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("runTransactionVoid", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransactionVoid", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< RunTransactionVoidActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("runTransactionVoid", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransactionVoid", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< RunTransactionVoidActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("runTransactionVoid", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("runTransactionVoid", reinterpret_cast(this), 2); + + } + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + Reference db; + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + Function func; + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + Reference tr; + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" +}; +// This generated class is to be used only via runTransactionVoid() + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" +template + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" +class RunTransactionVoidActor final : public Actor, public ActorCallback< RunTransactionVoidActor, 0, Void >, public ActorCallback< RunTransactionVoidActor, 1, Void >, public ActorCallback< RunTransactionVoidActor, 2, Void >, public FastAllocated>, public RunTransactionVoidActorState> { + #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< RunTransactionVoidActor, 0, Void >; +friend struct ActorCallback< RunTransactionVoidActor, 1, Void >; +friend struct ActorCallback< RunTransactionVoidActor, 2, Void >; + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + RunTransactionVoidActor(Reference const& db,Function const& func) + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" + : Actor(), + RunTransactionVoidActorState>(db, func) + { + fdb_probe_actor_enter("runTransactionVoid", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("runTransactionVoid"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("runTransactionVoid", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< RunTransactionVoidActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< RunTransactionVoidActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< RunTransactionVoidActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" +template + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" +[[nodiscard]] Future runTransactionVoid( Reference const& db, Function const& func ) { + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + return Future(new RunTransactionVoidActor(db, func)); + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.g.h" +} + +#line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/RunTransaction.actor.h" + +// SystemTransactionGenerator is a Database-like wrapper which produces transactions which have selected +// options set for lock awareness, reading and optionally writing the system keys, and immediate priority. +// All options are false by default. +template +struct SystemTransactionGenerator : ReferenceCounted> { + typedef typename DB::TransactionT TransactionT; + + SystemTransactionGenerator(Reference db, bool write, bool lockAware, bool immediate) + : db(db), write(write), lockAware(lockAware), immediate(immediate) {} + + Reference createTransaction() const { return db->createTransaction(); } + + void setOptions(Reference tr) const { + if (write) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + } else { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + } + + if (immediate) { + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + } + + if (lockAware) { + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + } + } + + Reference db; + bool write; + bool lockAware; + bool immediate; +}; + +template +struct transaction_option_setter> : std::true_type {}; + +// Convenient wrapper for creating SystemTransactionGenerators. +template +auto SystemDB(Reference db, bool write = false, bool lockAware = false, bool immediate = false) { + return makeReference>(db, write, lockAware, immediate); +} + +// SystemDB with all options true +template +auto SystemDBWriteLockedNow(Reference db) { + return makeReference>(db, true, true, true); +} + +#include "flow/unactorcompiler.h" +#endif diff --git a/src/fdbclient/include/fdbclient/RunTransaction.actor.h b/src/fdbclient/include/fdbclient/RunTransaction.actor.h new file mode 100644 index 0000000..d0874a9 --- /dev/null +++ b/src/fdbclient/include/fdbclient/RunTransaction.actor.h @@ -0,0 +1,136 @@ +/* + * RunTransaction.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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(FDBCLIENT_RUNTRANSACTION_ACTOR_G_H) +#define FDBCLIENT_RUNTRANSACTION_ACTOR_G_H +#include "fdbclient/RunTransaction.actor.g.h" +#elif !defined(FDBCLIENT_RUNTRANSACTION_ACTOR_H) +#define FDBCLIENT_RUNTRANSACTION_ACTOR_H + +#include + +#include "flow/flow.h" +#include "fdbclient/FDBOptions.g.h" +#include "flow/actorcompiler.h" // This must be the last #include. + +template +struct transaction_option_setter : std::false_type {}; + +template +struct transaction_option_setter> : transaction_option_setter {}; + +template +constexpr bool can_set_transaction_options = transaction_option_setter::value; + +ACTOR template +Future()(Reference()).getValue())> runTransaction( + Reference db, + Function func) { + state Reference tr = db->createTransaction(); + loop { + if constexpr (can_set_transaction_options) { + db->setOptions(tr); + } + + try { + // func should be idempotent; otherwise, retry will get undefined result + state decltype(std::declval()(Reference()).getValue()) result = + wait(func(tr)); + wait(safeThreadFutureToFuture(tr->commit())); + return result; + } catch (Error& e) { + wait(safeThreadFutureToFuture(tr->onError(e))); + } + } +} + +ACTOR template +Future runTransactionVoid(Reference db, Function func) { + state Reference tr = db->createTransaction(); + loop { + if constexpr (can_set_transaction_options) { + db->setOptions(tr); + } + try { + // func should be idempotent; otherwise, retry will get undefined result + wait(func(tr)); + wait(safeThreadFutureToFuture(tr->commit())); + return Void(); + } catch (Error& e) { + wait(safeThreadFutureToFuture(tr->onError(e))); + } + } +} + +// SystemTransactionGenerator is a Database-like wrapper which produces transactions which have selected +// options set for lock awareness, reading and optionally writing the system keys, and immediate priority. +// All options are false by default. +template +struct SystemTransactionGenerator : ReferenceCounted> { + typedef typename DB::TransactionT TransactionT; + + SystemTransactionGenerator(Reference db, bool write, bool lockAware, bool immediate) + : db(db), write(write), lockAware(lockAware), immediate(immediate) {} + + Reference createTransaction() const { return db->createTransaction(); } + + void setOptions(Reference tr) const { + if (write) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + } else { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + } + + if (immediate) { + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + } + + if (lockAware) { + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + } + } + + Reference db; + bool write; + bool lockAware; + bool immediate; +}; + +template +struct transaction_option_setter> : std::true_type {}; + +// Convenient wrapper for creating SystemTransactionGenerators. +template +auto SystemDB(Reference db, bool write = false, bool lockAware = false, bool immediate = false) { + return makeReference>(db, write, lockAware, immediate); +} + +// SystemDB with all options true +template +auto SystemDBWriteLockedNow(Reference db) { + return makeReference>(db, true, true, true); +} + +#include "flow/unactorcompiler.h" +#endif diff --git a/src/fdbclient/S3BlobStore.h b/src/fdbclient/include/fdbclient/S3BlobStore.h similarity index 70% rename from src/fdbclient/S3BlobStore.h rename to src/fdbclient/include/fdbclient/S3BlobStore.h index 86e0e54..eb6fc0b 100644 --- a/src/fdbclient/S3BlobStore.h +++ b/src/fdbclient/include/fdbclient/S3BlobStore.h @@ -21,13 +21,52 @@ #pragma once #include +#include #include +#include "flow/IRandom.h" #include "flow/flow.h" #include "flow/Net2Packet.h" #include "fdbclient/Knobs.h" -#include "fdbrpc/IRateControl.h" +#include "flow/IRateControl.h" #include "fdbrpc/HTTP.h" +#include "fdbrpc/Stats.h" #include "fdbclient/JSONDoc.h" +#include "flow/IConnection.h" + +#include + +// unique key that indentifies interchangeable connections for the same settings and destination +// FIXME: can we define std::hash as a struct member of a S3BlobStoreEndpoint? +struct BlobStoreConnectionPoolKey { + std::string host; + std::string service; + std::string region; + bool isTLS; + + BlobStoreConnectionPoolKey(const std::string& host, + const std::string& service, + const std::string& region, + bool isTLS) + : host(host), service(service), region(region), isTLS(isTLS) {} + + bool operator==(const BlobStoreConnectionPoolKey& other) const { + return isTLS == other.isTLS && host == other.host && service == other.service && region == other.region; + } +}; + +namespace std { +template <> +struct hash { + std::size_t operator()(const BlobStoreConnectionPoolKey& key) const { + std::size_t seed = 0; + boost::hash_combine(seed, std::hash{}(key.host)); + boost::hash_combine(seed, std::hash{}(key.service)); + boost::hash_combine(seed, std::hash{}(key.region)); + boost::hash_combine(seed, std::hash{}(key.isTLS)); + return seed; + } +}; +} // namespace std // Representation of all the things you need to connect to a blob store instance with some credentials. // Reference counted because a very large number of them could be needed. @@ -46,6 +85,54 @@ class S3BlobStoreEndpoint : public ReferenceCounted { static Stats s_stats; + struct BlobStats { + UID id; + CounterCollection cc; + Counter requestsSuccessful; + Counter requestsFailed; + Counter newConnections; + Counter expiredConnections; + Counter reusedConnections; + Counter fastRetries; + + LatencySample requestLatency; + + // init not in static codepath, to avoid initialization race issues and so no blob connections means no + // unecessary blob stats traces + BlobStats() + : id(deterministicRandom()->randomUniqueID()), cc("BlobStoreStats", id.toString()), + requestsSuccessful("RequestsSuccessful", cc), requestsFailed("RequestsFailed", cc), + newConnections("NewConnections", cc), expiredConnections("ExpiredConnections", cc), + reusedConnections("ReusedConnections", cc), fastRetries("FastRetries", cc), + requestLatency("BlobStoreRequestLatency", + id, + CLIENT_KNOBS->BLOBSTORE_LATENCY_LOGGING_INTERVAL, + CLIENT_KNOBS->BLOBSTORE_LATENCY_LOGGING_ACCURACY) {} + }; + // null when initialized, so no blob stats until a blob connection is used + static std::unique_ptr blobStats; + static Future statsLogger; + + void maybeStartStatsLogger() { + if (!blobStats && CLIENT_KNOBS->BLOBSTORE_ENABLE_LOGGING) { + blobStats = std::make_unique(); + specialCounter( + blobStats->cc, "GlobalConnectionPoolCount", [this]() { return this->globalConnectionPool.size(); }); + specialCounter(blobStats->cc, "GlobalConnectionPoolSize", [this]() { + // FIXME: could track this explicitly via an int variable with extra logic, but this should be small and + // infrequent + int totalConnections = 0; + for (auto& it : this->globalConnectionPool) { + totalConnections += it.second->pool.size(); + } + return totalConnections; + }); + + statsLogger = blobStats->cc.traceCounters( + "BlobStoreMetrics", blobStats->id, CLIENT_KNOBS->BLOBSTORE_STATS_LOGGING_INTERVAL, "BlobStoreMetrics"); + } + } + struct Credentials { std::string key; std::string secret; @@ -58,8 +145,8 @@ class S3BlobStoreEndpoint : public ReferenceCounted { requests_per_second, list_requests_per_second, write_requests_per_second, read_requests_per_second, delete_requests_per_second, multipart_max_part_size, multipart_min_part_size, concurrent_requests, concurrent_uploads, concurrent_lists, concurrent_reads_per_file, concurrent_writes_per_file, - read_block_size, read_ahead_blocks, read_cache_blocks_per_file, max_send_bytes_per_second, - max_recv_bytes_per_second, sdk_auth; + enable_read_cache, read_block_size, read_ahead_blocks, read_cache_blocks_per_file, + max_send_bytes_per_second, max_recv_bytes_per_second, sdk_auth, global_connection_pool; bool set(StringRef name, int value); std::string getURLParameters() const; static std::vector getKnobDescriptions() { @@ -86,6 +173,7 @@ class S3BlobStoreEndpoint : public ReferenceCounted { "concurrent_lists (or cl) Max concurrent list operations that can be in progress at once.", "concurrent_reads_per_file (or crps) Max concurrent reads in progress for any one file.", "concurrent_writes_per_file (or cwps) Max concurrent uploads in progress for any one file.", + "enable_read_cache (or erc) Whether read block caching is enabled.", "read_block_size (or rbs) Block size in bytes to be used for reads.", "read_ahead_blocks (or rab) Number of blocks to read ahead of requested offset.", "read_cache_blocks_per_file (or rcb) Size of the read cache for a file in blocks.", @@ -93,11 +181,27 @@ class S3BlobStoreEndpoint : public ReferenceCounted { "max_recv_bytes_per_second (or rbps) Max receive bytes per second for all requests combined (NOT YET " "USED).", "sdk_auth (or sa) Use AWS SDK to resolve credentials. Only valid if " - "BUILD_AWS_BACKUP is enabled." + "BUILD_AWS_BACKUP is enabled.", + "global_connection_pool (or gcp) Enable shared connection pool between all blobstore instances." }; } + + bool isTLS() const { return secure_connection == 1; } }; + struct ReusableConnection { + Reference conn; + double expirationTime; + }; + + // basically, reference counted queue with option to add other fields + struct ConnectionPoolData : NonCopyable, ReferenceCounted { + std::queue pool; + }; + + // global connection pool for multiple blobstore endpoints with same connection settings and request destination + static std::unordered_map> globalConnectionPool; + S3BlobStoreEndpoint(std::string const& host, std::string const& service, std::string region, @@ -121,15 +225,34 @@ class S3BlobStoreEndpoint : public ReferenceCounted { if (host.empty() || (proxyHost.present() != proxyPort.present())) throw connection_string_invalid(); + + // set connection pool instance + if (useProxy || !knobs.global_connection_pool) { + // don't use global connection pool if there's a proxy, as it complicates the logic + // FIXME: handle proxies? + connectionPool = makeReference(); + } else { + BlobStoreConnectionPoolKey key(host, service, region, knobs.isTLS()); + auto it = globalConnectionPool.find(key); + if (it != globalConnectionPool.end()) { + connectionPool = it->second; + } else { + connectionPool = makeReference(); + globalConnectionPool.insert({ key, connectionPool }); + } + } + ASSERT(connectionPool.isValid()); + + maybeStartStatsLogger(); } static std::string getURLFormat(bool withResource = false) { const char* resource = ""; if (withResource) resource = ""; - return format( - "blobstore://::@[:]/%s[?=[&=]...]", - resource); + return format("blobstore://::@[:]/" + "%s[?=[&=]...]", + resource); } typedef std::map ParametersT; @@ -147,12 +270,10 @@ class S3BlobStoreEndpoint : public ReferenceCounted { // parameters in addition to the passed params string std::string getResourceURL(std::string resource, std::string params) const; - struct ReusableConnection { - Reference conn; - double expirationTime; - }; - std::queue connectionPool; - Future connect(); + // FIXME: add periodic connection reaper to pool + // local connection pool for this blobstore + Reference connectionPool; + Future connect(bool* reusingConn); void returnConnection(ReusableConnection& conn); std::string host; @@ -199,20 +320,15 @@ class S3BlobStoreEndpoint : public ReferenceCounted { std::string getRegion() const { return region; } - // Prepend the HTTP request header to the given PacketBuffer, returning the new head of the buffer chain - static PacketBuffer* writeRequestHeader(std::string const& request, - HTTP::Headers const& headers, - PacketBuffer* dest); - // Do an HTTP request to the Blob Store, read the response. Handles authentication. // Every blob store interaction should ultimately go through this function - Future> doRequest(std::string const& verb, - std::string const& resource, - const HTTP::Headers& headers, - UnsentPacketQueue* pContent, - int contentLen, - std::set successCodes); + Future> doRequest(std::string const& verb, + std::string const& resource, + const HTTP::Headers& headers, + UnsentPacketQueue* pContent, + int contentLen, + std::set successCodes); struct ObjectInfo { std::string name; diff --git a/src/fdbclient/Schemas.h b/src/fdbclient/include/fdbclient/Schemas.h similarity index 100% rename from src/fdbclient/Schemas.h rename to src/fdbclient/include/fdbclient/Schemas.h diff --git a/src/fdbclient/ServerKnobCollection.h b/src/fdbclient/include/fdbclient/ServerKnobCollection.h similarity index 100% rename from src/fdbclient/ServerKnobCollection.h rename to src/fdbclient/include/fdbclient/ServerKnobCollection.h diff --git a/src/fdbclient/ServerKnobs.h b/src/fdbclient/include/fdbclient/ServerKnobs.h similarity index 66% rename from src/fdbclient/ServerKnobs.h rename to src/fdbclient/include/fdbclient/ServerKnobs.h index 1d23ee2..9d90534 100644 --- a/src/fdbclient/ServerKnobs.h +++ b/src/fdbclient/include/fdbclient/ServerKnobs.h @@ -50,7 +50,6 @@ class ServerKnobs : public KnobsImpl { bool PEEK_USING_STREAMING; double TLOG_TIMEOUT; // tlog OR commit proxy failure - master's reaction time double TLOG_SLOW_REJOIN_WARN_TIMEOUT_SECS; // Warns if a tlog takes too long to rejoin - double RECOVERY_TLOG_SMART_QUORUM_DELAY; // smaller might be better for bug amplification double TLOG_STORAGE_MIN_UPDATE_INTERVAL; double BUGGIFY_TLOG_STORAGE_MIN_UPDATE_INTERVAL; int DESIRED_TOTAL_BYTES; @@ -58,10 +57,6 @@ class ServerKnobs : public KnobsImpl { double UPDATE_DELAY; int MAXIMUM_PEEK_BYTES; int APPLY_MUTATION_BYTES; - int RECOVERY_DATA_BYTE_LIMIT; - int BUGGIFY_RECOVERY_DATA_LIMIT; - double LONG_TLOG_COMMIT_TIME; - int64_t LARGE_TLOG_COMMIT_BYTES; double BUGGIFY_RECOVER_MEMORY_LIMIT; double BUGGIFY_WORKER_REMOVED_MAX_LAG; int64_t UPDATE_STORAGE_BYTE_LIMIT; @@ -126,16 +121,18 @@ class ServerKnobs : public KnobsImpl { double BG_REBALANCE_POLLING_INTERVAL; double BG_REBALANCE_SWITCH_CHECK_INTERVAL; double DD_QUEUE_LOGGING_INTERVAL; + double DD_QUEUE_COUNTER_REFRESH_INTERVAL; + double DD_QUEUE_COUNTER_MAX_LOG; // max number of servers for which trace events will be generated in each round of + // DD_QUEUE_COUNTER_REFRESH_INTERVAL duration + bool DD_QUEUE_COUNTER_SUMMARIZE; // Enable summary of remaining servers when the number of servers with ongoing + // relocations in the last minute exceeds DD_QUEUE_COUNTER_MAX_LOG + double WIGGLING_RELOCATION_PARALLELISM_PER_SOURCE_SERVER; // take effects when pertual wiggle priority is larger + // than healthy priority double RELOCATION_PARALLELISM_PER_SOURCE_SERVER; double RELOCATION_PARALLELISM_PER_DEST_SERVER; int DD_QUEUE_MAX_KEY_SERVERS; int DD_REBALANCE_PARALLELISM; int DD_REBALANCE_RESET_AMOUNT; - double BG_DD_MAX_WAIT; - double BG_DD_MIN_WAIT; - double BG_DD_INCREASE_RATE; - double BG_DD_DECREASE_RATE; - double BG_DD_SATURATION_DELAY; double INFLIGHT_PENALTY_HEALTHY; double INFLIGHT_PENALTY_REDUNDANT; double INFLIGHT_PENALTY_UNHEALTHY; @@ -147,31 +144,100 @@ class ServerKnobs : public KnobsImpl { // is possible within but not between priority groups; fewer priority groups // mean better worst case time bounds // Maximum allowable priority is 999. + // Update the status json .data.team_tracker.state field when necessary + // + // Priority for movement resume from previous unfinished in-flight movement when a new DD + // start int PRIORITY_RECOVER_MOVE; + // A load-balance priority for disk valley filler int PRIORITY_REBALANCE_UNDERUTILIZED_TEAM; + // A load-balance priority disk mountain chopper int PRIORITY_REBALANCE_OVERUTILIZED_TEAM; + // A load-balance priority read valley filler + int PRIORITY_REBALANCE_READ_OVERUTIL_TEAM; + // A load-balance priority read mountain chopper + int PRIORITY_REBALANCE_READ_UNDERUTIL_TEAM; + // A team healthy priority for wiggle a storage server int PRIORITY_PERPETUAL_STORAGE_WIGGLE; + // A team healthy priority when all servers in a team are healthy. When a team changes from any unhealthy states to + // healthy, the unfinished relocations will be overriden to healthy priority int PRIORITY_TEAM_HEALTHY; + // A team healthy priority when there's undesired servers in the team. (ex. same ip + // address as other SS process, or SS is lagging too far ...) int PRIORITY_TEAM_CONTAINS_UNDESIRED_SERVER; + // A team healthy priority for removing redundant team to make the team count within a good range int PRIORITY_TEAM_REDUNDANT; + // A shard boundary priority for merge small and write cold shard. int PRIORITY_MERGE_SHARD; + // A team healthy priority for populate remote region int PRIORITY_POPULATE_REGION; + // A team healthy priority when the replica > 3 and there's at least one unhealthy server in a team. + // Or when the team contains a server with wrong configuration (ex. storage engine, + // locality, excluded ...) int PRIORITY_TEAM_UNHEALTHY; + // A team healthy priority when there should be >= 3 replicas and there's 2 healthy servers in a team int PRIORITY_TEAM_2_LEFT; + // A team healthy priority when there should be >= 2 replicas and there's 1 healthy server in a team int PRIORITY_TEAM_1_LEFT; - int PRIORITY_TEAM_FAILED; // Priority when a server in the team is excluded as failed + // A team healthy priority when a server in the team is excluded as failed + int PRIORITY_TEAM_FAILED; + // A team healthy priority when there's no healthy server in a team int PRIORITY_TEAM_0_LEFT; + // A shard boundary priority for split large or write hot shard. int PRIORITY_SPLIT_SHARD; + // Priority when a physical shard is oversize or anonymous. When DD enable physical shard, the shard created before + // it are default to be 'anonymous' for compatibility. + int PRIORITY_ENFORCE_MOVE_OUT_OF_PHYSICAL_SHARD; // Data distribution + // DD use AVAILABLE_SPACE_PIVOT_RATIO to calculate pivotAvailableSpaceRatio. Given a array that's descend + // sorted by available space ratio, the pivot position is AVAILABLE_SPACE_PIVOT_RATIO * team count. + // When pivotAvailableSpaceRatio is lower than TARGET_AVAILABLE_SPACE_RATIO, the DD won't move any shard to the team + // has available space ratio < pivotAvailableSpaceRatio. + double AVAILABLE_SPACE_PIVOT_RATIO; + // DD won't move shard to teams that has CPU > AllTeamCPUAscend[pivot], where pivot = CPU_PIVOT_RATIO * + // team count. + double CPU_PIVOT_RATIO; + // DD won't move shard to teams that has CPU > MAX_DEST_CPU_PERCENT + double MAX_DEST_CPU_PERCENT; + // The constant interval DD update pivot values for team selection. It should be >= + // min(STORAGE_METRICS_POLLING_DELAY,DETAILED_METRIC_UPDATE_RATE) otherwise the pivot won't change; + double DD_TEAM_PIVOT_UPDATE_DELAY; + + bool ALLOW_LARGE_SHARD; + int MAX_LARGE_SHARD_BYTES; + + bool SHARD_ENCODE_LOCATION_METADATA; // If true, location metadata will contain shard ID. + bool ENABLE_DD_PHYSICAL_SHARD; // EXPERIMENTAL; If true, SHARD_ENCODE_LOCATION_METADATA must be true. + double DD_PHYSICAL_SHARD_MOVE_PROBABILITY; // Percentage of physical shard move, in the range of [0, 1]. + int64_t MAX_PHYSICAL_SHARD_BYTES; + double PHYSICAL_SHARD_METRICS_DELAY; + double ANONYMOUS_PHYSICAL_SHARD_TRANSITION_TIME; + bool PHYSICAL_SHARD_MOVE_VERBOSE_TRACKING; + + double READ_REBALANCE_CPU_THRESHOLD; // read rebalance only happens if the source servers' CPU > threshold + int READ_REBALANCE_SRC_PARALLELISM; // the max count a server become a source server within a certain interval + int READ_REBALANCE_SHARD_TOPK; // top k shards from which to select randomly for read-rebalance + double + READ_REBALANCE_DIFF_FRAC; // only when (srcLoad - destLoad)/srcLoad > DIFF_FRAC the read rebalance will happen + double READ_REBALANCE_MAX_SHARD_FRAC; // only move shard whose readLoad < (srcLoad - destLoad) * MAX_SHARD_FRAC + double + READ_REBALANCE_MIN_READ_BYTES_KS; // only move shard whose readLoad > min(MIN_READ_BYTES_KS, shard avg traffic); + double RETRY_RELOCATESHARD_DELAY; double DATA_DISTRIBUTION_FAILURE_REACTION_TIME; int MIN_SHARD_BYTES, SHARD_BYTES_RATIO, SHARD_BYTES_PER_SQRT_BYTES, MAX_SHARD_BYTES, KEY_SERVER_SHARD_BYTES; int64_t SHARD_MAX_BYTES_PER_KSEC, // Shards with more than this bandwidth will be split immediately SHARD_MIN_BYTES_PER_KSEC, // Shards with more than this bandwidth will not be merged SHARD_SPLIT_BYTES_PER_KSEC; // When splitting a shard, it is split into pieces with less than this bandwidth + int64_t SHARD_MAX_READ_OPS_PER_KSEC; // When the read operations count is larger than this threshold, a range will + // be considered hot + // When the sampled read operations changes more than this threshold, the + // shard metrics will update immediately + int64_t SHARD_READ_OPS_CHANGE_THRESHOLD; + double SHARD_MAX_READ_DENSITY_RATIO; - int64_t SHARD_READ_HOT_BANDWITH_MIN_PER_KSECONDS; + int64_t SHARD_READ_HOT_BANDWIDTH_MIN_PER_KSECONDS; double SHARD_MAX_BYTES_READ_PER_KSEC_JITTER; double STORAGE_METRIC_TIMEOUT; double METRIC_DELAY; @@ -183,16 +249,17 @@ class ServerKnobs : public KnobsImpl { // load balance in the cluster double PERPETUAL_WIGGLE_MIN_BYTES_BALANCE_RATIO; // target min : average space load balance ratio after re-include // before perpetual wiggle will start the next wiggle - double PERPETUAL_WIGGLE_DELAY; // The min interval between the last wiggle finish and the next wiggle start + double PERPETUAL_WIGGLE_DELAY; // The max interval between the last wiggle finish and the next wiggle start bool PERPETUAL_WIGGLE_DISABLE_REMOVER; // Whether the start of perpetual wiggle replace team remover double LOG_ON_COMPLETION_DELAY; int BEST_TEAM_MAX_TEAM_TRIES; int BEST_TEAM_OPTION_COUNT; int BEST_OF_AMT; double SERVER_LIST_DELAY; + double RATEKEEPER_MONITOR_SS_DELAY; + int RATEKEEPER_MONITOR_SS_THRESHOLD; double RECRUITMENT_IDLE_DELAY; double STORAGE_RECRUITMENT_DELAY; - double BLOB_WORKER_RECRUITMENT_DELAY; bool TSS_HACK_IDENTITY_MAPPING; double TSS_RECRUITMENT_TIMEOUT; double TSS_DD_CHECK_INTERVAL; @@ -231,8 +298,20 @@ class ServerKnobs : public KnobsImpl { int DD_TEAM_ZERO_SERVER_LEFT_LOG_DELAY; int DD_STORAGE_WIGGLE_PAUSE_THRESHOLD; // How many unhealthy relocations are ongoing will pause storage wiggle int DD_STORAGE_WIGGLE_STUCK_THRESHOLD; // How many times bestTeamStuck accumulate will pause storage wiggle - bool ENABLE_STORAGE_QUEUE_AWARE_TEAM_SELECTION; // experimental! - int64_t DD_TARGET_STORAGE_QUEUE_SIZE; + int64_t + DD_STORAGE_WIGGLE_MIN_SS_AGE_SEC; // Minimal age of a correct-configured server before it's chosen to be wiggled + bool DD_TENANT_AWARENESS_ENABLED; + bool STORAGE_QUOTA_ENABLED; // Whether storage quota enforcement for tenant groups and all the relevant storage + // usage / quota monitors are enabled. + int TENANT_CACHE_LIST_REFRESH_INTERVAL; // How often the TenantCache is refreshed + int TENANT_CACHE_STORAGE_USAGE_REFRESH_INTERVAL; // How often the storage bytes used by each tenant is refreshed + // in the TenantCache + int TENANT_CACHE_STORAGE_QUOTA_REFRESH_INTERVAL; // How often the storage quota allocated to each tenant is + // refreshed in the TenantCache + int TENANT_CACHE_STORAGE_USAGE_TRACE_INTERVAL; // The minimum interval between consecutive trace events logging the + // storage bytes used by a tenant group + int CP_FETCH_TENANTS_OVER_STORAGE_QUOTA_INTERVAL; // How often the commit proxies send requests to the data + // distributor to fetch the list of tenants over storage quota // TeamRemover to remove redundant teams bool TR_FLAG_DISABLE_MACHINE_TEAM_REMOVER; // disable the machineTeamRemover actor @@ -250,12 +329,24 @@ class ServerKnobs : public KnobsImpl { double DD_FAILURE_TIME; double DD_ZERO_HEALTHY_TEAM_DELAY; int DD_BUILD_EXTRA_TEAMS_OVERRIDE; // build extra teams to allow data movement to progress. must be larger than 0 + int DD_SHARD_TRACKING_LOG_SEVERITY; + bool ENFORCE_SHARD_COUNT_PER_TEAM; // Whether data movement selects dst team not exceeding + // DESIRED_MAX_SHARDS_PER_TEAM. + int DESIRED_MAX_SHARDS_PER_TEAM; // When ENFORCE_SHARD_COUNT_PER_TEAM is true, this is the desired, but not strictly + // enforced, max shard count per team. + + int DD_MAX_SHARDS_ON_LARGE_TEAMS; // the maximum number of shards that can be assigned to large teams + int DD_MAXIMUM_LARGE_TEAM_CLEANUP; // the maximum number of large teams data distribution will attempt to cleanup + // without yielding + double DD_LARGE_TEAM_DELAY; // the amount of time data distribution will wait before returning less replicas than + // requested + double DD_FIX_WRONG_REPLICAS_DELAY; // the amount of time between attempts to increase the replication factor of + // under replicated shards // Run storage enginee on a child process on the same machine with storage process bool REMOTE_KV_STORE; - // A delay to avoid race on file resources if the new kv store process started immediately after the previous kv - // store process died - double REMOTE_KV_STORE_INIT_DELAY; + // A delay to avoid race on file resources after seeing lock_file_failure + double REBOOT_KV_STORE_DELAY; // max waiting time for the remote kv store to initialize double REMOTE_KV_STORE_MAX_INIT_DURATION; @@ -267,7 +358,6 @@ class ServerKnobs : public KnobsImpl { double CLEAR_TIME_ESTIMATE; double COMMIT_TIME_ESTIMATE; int CHECK_FREE_PAGE_AMOUNT; - double DISK_METRIC_LOGGING_INTERVAL; int64_t SOFT_HEAP_LIMIT; int SQLITE_PAGE_SCAN_ERROR_LIMIT; @@ -301,16 +391,20 @@ class ServerKnobs : public KnobsImpl { int64_t REPLACE_CONTENTS_BYTES; // KeyValueStoreRocksDB + bool ROCKSDB_SET_READ_TIMEOUT; bool ROCKSDB_LEVEL_COMPACTION_DYNAMIC_LEVEL_BYTES; bool ROCKSDB_SUGGEST_COMPACT_CLEAR_RANGE; - int ROCKSDB_THREAD_PROMISE_PRIORITY; + int ROCKSDB_READ_RANGE_ROW_LIMIT; int ROCKSDB_READER_THREAD_PRIORITY; int ROCKSDB_WRITER_THREAD_PRIORITY; + int ROCKSDB_COMPACTION_THREAD_PRIORITY; int ROCKSDB_BACKGROUND_PARALLELISM; int ROCKSDB_READ_PARALLELISM; + int ROCKSDB_CHECKPOINT_READER_PARALLELISM; int64_t ROCKSDB_MEMTABLE_BYTES; bool ROCKSDB_LEVEL_STYLE_COMPACTION; bool ROCKSDB_UNSAFE_AUTO_FSYNC; + bool ROCKSDB_MUTE_LOGS; int64_t ROCKSDB_PERIODIC_COMPACTION_SECONDS; int ROCKSDB_PREFIX_LEN; double ROCKSDB_MEMTABLE_PREFIX_BLOOM_SIZE_RATIO; @@ -322,6 +416,8 @@ class ServerKnobs : public KnobsImpl { double ROCKSDB_READ_VALUE_TIMEOUT; double ROCKSDB_READ_VALUE_PREFIX_TIMEOUT; double ROCKSDB_READ_RANGE_TIMEOUT; + double ROCKSDB_READ_CHECKPOINT_TIMEOUT; + int64_t ROCKSDB_CHECKPOINT_READ_AHEAD_SIZE; double ROCKSDB_READ_QUEUE_WAIT; int ROCKSDB_READ_QUEUE_SOFT_MAX; int ROCKSDB_READ_QUEUE_HARD_MAX; @@ -340,12 +436,15 @@ class ServerKnobs : public KnobsImpl { bool ROCKSDB_DISABLE_AUTO_COMPACTIONS; bool ROCKSDB_PERFCONTEXT_ENABLE; // Enable rocks perf context metrics. May cause performance overhead double ROCKSDB_PERFCONTEXT_SAMPLE_RATE; + double ROCKSDB_METRICS_SAMPLE_INTERVAL; int ROCKSDB_MAX_SUBCOMPACTIONS; int64_t ROCKSDB_SOFT_PENDING_COMPACT_BYTES_LIMIT; int64_t ROCKSDB_HARD_PENDING_COMPACT_BYTES_LIMIT; + int64_t SHARD_SOFT_PENDING_COMPACT_BYTES_LIMIT; + int64_t SHARD_HARD_PENDING_COMPACT_BYTES_LIMIT; int64_t ROCKSDB_CAN_COMMIT_COMPACT_BYTES_LIMIT; bool ROCKSDB_PARANOID_FILE_CHECKS; - int ROCKSDB_CAN_COMMIT_DELAY_ON_OVERLOAD; + double ROCKSDB_CAN_COMMIT_DELAY_ON_OVERLOAD; int ROCKSDB_CAN_COMMIT_DELAY_TIMES_ON_OVERLOAD; bool ROCKSDB_DISABLE_WAL_EXPERIMENTAL; int64_t ROCKSDB_WAL_TTL_SECONDS; @@ -362,9 +461,43 @@ class ServerKnobs : public KnobsImpl { int ROCKSDB_STATS_LEVEL; int64_t ROCKSDB_COMPACTION_READAHEAD_SIZE; int64_t ROCKSDB_BLOCK_SIZE; + bool ENABLE_SHARDED_ROCKSDB; + int64_t ROCKSDB_WRITE_BUFFER_SIZE; + int64_t ROCKSDB_CF_WRITE_BUFFER_SIZE; + int64_t ROCKSDB_MAX_TOTAL_WAL_SIZE; + int64_t ROCKSDB_MAX_BACKGROUND_JOBS; + int64_t ROCKSDB_DELETE_OBSOLETE_FILE_PERIOD; + double ROCKSDB_PHYSICAL_SHARD_CLEAN_UP_DELAY; + bool ROCKSDB_EMPTY_RANGE_CHECK; + int ROCKSDB_CREATE_BYTES_SAMPLE_FILE_RETRY_MAX; + bool ROCKSDB_ATOMIC_FLUSH; + bool ROCKSDB_IMPORT_MOVE_FILES; + bool ROCKSDB_CHECKPOINT_REPLAY_MARKER; + bool ROCKSDB_VERIFY_CHECKSUM_BEFORE_RESTORE; + bool ROCKSDB_ENABLE_CHECKPOINT_VALIDATION; + bool ROCKSDB_RETURN_OVERLOADED_ON_TIMEOUT; + int ROCKSDB_COMPACTION_PRI; + int ROCKSDB_WAL_RECOVERY_MODE; + int ROCKSDB_TARGET_FILE_SIZE_BASE; + int ROCKSDB_TARGET_FILE_SIZE_MULTIPLIER; + int ROCKSDB_MAX_OPEN_FILES; + bool ROCKSDB_USE_POINT_DELETE_FOR_SYSTEM_KEYS; + int ROCKSDB_CF_RANGE_DELETION_LIMIT; + bool ROCKSDB_WAIT_ON_CF_FLUSH; + bool ROCKSDB_ALLOW_WRITE_STALL_ON_FLUSH; + double ROCKSDB_CF_METRICS_DELAY; int ROCKSDB_MAX_LOG_FILE_SIZE; int ROCKSDB_KEEP_LOG_FILE_NUM; - bool SS_BACKUP_KEYS_OP_LOGS; + bool ROCKSDB_SKIP_STATS_UPDATE_ON_OPEN; + bool ROCKSDB_SKIP_FILE_SIZE_CHECK_ON_OPEN; + double SHARDED_ROCKSDB_VALIDATE_MAPPING_RATIO; + int SHARD_METADATA_SCAN_BYTES_LIMIT; + int ROCKSDB_MAX_MANIFEST_FILE_SIZE; + int ROCKSDB_MAX_WRITE_BUFFER_NUMBER; + int SHARDED_ROCKSDB_AVERAGE_FILE_SIZE; + double SHARDED_ROCKSDB_COMPACTION_PERIOD; + double SHARDED_ROCKSDB_COMPACTION_ACTOR_DELAY; + int SHARDED_ROCKSDB_COMPACTION_SHARD_LIMIT; // Leader election int MAX_NOTIFICATIONS; @@ -388,6 +521,8 @@ class ServerKnobs : public KnobsImpl { double START_TRANSACTION_MAX_EMPTY_QUEUE_BUDGET; int START_TRANSACTION_MAX_QUEUE_SIZE; int KEY_LOCATION_MAX_QUEUE_SIZE; + int TENANT_ID_REQUEST_MAX_QUEUE_SIZE; + int BLOB_GRANULE_LOCATION_MAX_QUEUE_SIZE; double COMMIT_PROXY_LIVENESS_TIMEOUT; double COMMIT_TRANSACTION_BATCH_INTERVAL_FROM_IDLE; @@ -403,6 +538,7 @@ class ServerKnobs : public KnobsImpl { int64_t COMMIT_BATCHES_MEM_BYTES_HARD_LIMIT; double COMMIT_BATCHES_MEM_FRACTION_OF_TOTAL; double COMMIT_BATCHES_MEM_TO_TOTAL_MEM_SCALE_FACTOR; + double COMMIT_TRIGGER_DELAY; double RESOLVER_COALESCE_TIME; int BUGGIFIED_ROW_LIMIT; @@ -423,12 +559,20 @@ class ServerKnobs : public KnobsImpl { double REPORT_TRANSACTION_COST_ESTIMATION_DELAY; bool PROXY_REJECT_BATCH_QUEUED_TOO_LONG; bool PROXY_USE_RESOLVER_PRIVATE_MUTATIONS; + bool BURSTINESS_METRICS_ENABLED; + // Interval on which to emit burstiness metrics on the commit proxy (in + // seconds). + double BURSTINESS_METRICS_LOG_INTERVAL; int RESET_MASTER_BATCHES; int RESET_RESOLVER_BATCHES; double RESET_MASTER_DELAY; double RESET_RESOLVER_DELAY; + double GLOBAL_CONFIG_MIGRATE_TIMEOUT; + double GLOBAL_CONFIG_REFRESH_INTERVAL; + double GLOBAL_CONFIG_REFRESH_TIMEOUT; + // Master Server double COMMIT_SLEEP_TIME; double MIN_BALANCE_TIME; @@ -473,6 +617,7 @@ class ServerKnobs : public KnobsImpl { double ATTEMPT_RECRUITMENT_DELAY; double WAIT_FOR_DISTRIBUTOR_JOIN_DELAY; double WAIT_FOR_RATEKEEPER_JOIN_DELAY; + double WAIT_FOR_CONSISTENCYSCAN_JOIN_DELAY; double WAIT_FOR_BLOB_MANAGER_JOIN_DELAY; double WAIT_FOR_ENCRYPT_KEY_PROXY_JOIN_DELAY; double WORKER_FAILURE_TIME; @@ -486,7 +631,9 @@ class ServerKnobs : public KnobsImpl { double CHECK_REMOTE_HEALTH_INTERVAL; // Remote DC health refresh interval. double FORCE_RECOVERY_CHECK_DELAY; double RATEKEEPER_FAILURE_TIME; + double CONSISTENCYSCAN_FAILURE_TIME; double BLOB_MANAGER_FAILURE_TIME; + double BLOB_MIGRATOR_FAILURE_TIME; double REPLACE_INTERFACE_DELAY; double REPLACE_INTERFACE_CHECK_DELAY; double COORDINATOR_REGISTER_INTERVAL; @@ -542,6 +689,8 @@ class ServerKnobs : public KnobsImpl { int DBINFO_SEND_AMOUNT; double DBINFO_BATCH_DELAY; double SINGLETON_RECRUIT_BME_DELAY; + bool RECORD_RECOVER_AT_IN_CSTATE; + bool TRACK_TLOG_RECOVERY; // Move Keys double SHARD_READY_DELAY; @@ -552,6 +701,8 @@ class ServerKnobs : public KnobsImpl { int MOVE_KEYS_KRM_LIMIT_BYTES; // This must be sufficiently larger than CLIENT_KNOBS->KEY_SIZE_LIMIT // (fdbclient/Knobs.h) to ensure that at least two entries will be returned from an // attempt to read a key range map + int MOVE_SHARD_KRM_ROW_LIMIT; + int MOVE_SHARD_KRM_BYTE_LIMIT; int MAX_SKIP_TAGS; double MAX_ADDED_SOURCES_MULTIPLIER; @@ -567,6 +718,7 @@ class ServerKnobs : public KnobsImpl { double SMOOTHING_AMOUNT; double SLOW_SMOOTHING_AMOUNT; double METRIC_UPDATE_RATE; + // The interval of detailed HealthMetric is pushed to GRV proxies double DETAILED_METRIC_UPDATE_RATE; double LAST_LIMITED_RATIO; double RATEKEEPER_DEFAULT_LIMIT; @@ -574,17 +726,25 @@ class ServerKnobs : public KnobsImpl { bool RATEKEEPER_PRINT_LIMIT_REASON; double RATEKEEPER_MIN_RATE; double RATEKEEPER_MAX_RATE; + double RATEKEEPER_BATCH_MIN_RATE; + double RATEKEEPER_BATCH_MAX_RATE; int64_t TARGET_BYTES_PER_STORAGE_SERVER; int64_t SPRING_BYTES_STORAGE_SERVER; int64_t AUTO_TAG_THROTTLE_STORAGE_QUEUE_BYTES; + int64_t AUTO_TAG_THROTTLE_SPRING_BYTES_STORAGE_SERVER; int64_t TARGET_BYTES_PER_STORAGE_SERVER_BATCH; int64_t SPRING_BYTES_STORAGE_SERVER_BATCH; int64_t STORAGE_HARD_LIMIT_BYTES; int64_t STORAGE_HARD_LIMIT_BYTES_OVERAGE; + int64_t STORAGE_HARD_LIMIT_BYTES_SPEED_UP_SIM; + int64_t STORAGE_HARD_LIMIT_BYTES_OVERAGE_SPEED_UP_SIM; int64_t STORAGE_HARD_LIMIT_VERSION_OVERAGE; int64_t STORAGE_DURABILITY_LAG_HARD_MAX; int64_t STORAGE_DURABILITY_LAG_SOFT_MAX; + bool STORAGE_INCLUDE_FEED_STORAGE_QUEUE; + double STORAGE_FETCH_KEYS_DELAY; + bool STORAGE_FETCH_KEYS_USE_COMMIT_BUDGET; int64_t LOW_PRIORITY_STORAGE_QUEUE_BYTES; int64_t LOW_PRIORITY_DURABILITY_LAG; @@ -598,6 +758,7 @@ class ServerKnobs : public KnobsImpl { int64_t TLOG_RECOVER_MEMORY_LIMIT; double TLOG_IGNORE_POP_AUTO_ENABLE_DELAY; + // Tag throttling int64_t MAX_MANUAL_THROTTLED_TRANSACTION_TAGS; int64_t MAX_AUTO_THROTTLED_TRANSACTION_TAGS; double MIN_TAG_COST; @@ -610,14 +771,47 @@ class ServerKnobs : public KnobsImpl { double AUTO_TAG_THROTTLE_UPDATE_FREQUENCY; double TAG_THROTTLE_EXPIRED_CLEANUP_INTERVAL; bool AUTO_TAG_THROTTLING_ENABLED; + // Limit to the number of throttling tags each storage server + // will track and send to the ratekeeper + int64_t SS_THROTTLE_TAGS_TRACKED; + // Use global tag throttling strategy. i.e. throttle based on the cluster-wide + // throughput for tags and their associated quotas. + bool GLOBAL_TAG_THROTTLING; + // Enforce tag throttling on proxies rather than on clients + bool ENFORCE_TAG_THROTTLING_ON_PROXIES; + // Minimum number of transactions per second that the global tag throttler must allow for each tag. + // When the measured tps for a tag gets too low, the denominator in the + // average cost calculation gets small, resulting in an unstable calculation. + // To protect against this, we do not compute the average cost when the + // measured tps drops below this threshold + double GLOBAL_TAG_THROTTLING_MIN_RATE; + // Maximum number of tags tracked by global tag throttler. Additional tags will be ignored + // until some existing tags expire + int64_t GLOBAL_TAG_THROTTLING_MAX_TAGS_TRACKED; + // Global tag throttler forgets about throughput from a tag once no new transactions from that + // tag have been received for this duration (in seconds): + int64_t GLOBAL_TAG_THROTTLING_TAG_EXPIRE_AFTER; + // Interval at which latency bands are logged for each tag on grv proxy + double GLOBAL_TAG_THROTTLING_PROXY_LOGGING_INTERVAL; + // Interval at which ratekeeper logs statistics for each tag: + double GLOBAL_TAG_THROTTLING_TRACE_INTERVAL; + // If this knob is set to true, the global tag throttler will still + // compute rates, but these rates won't be sent to GRV proxies for + // enforcement. + bool GLOBAL_TAG_THROTTLING_REPORT_ONLY; + + double GLOBAL_TAG_THROTTLING_TARGET_RATE_FOLDING_TIME; + double GLOBAL_TAG_THROTTLING_TRANSACTION_COUNT_FOLDING_TIME; + double GLOBAL_TAG_THROTTLING_TRANSACTION_RATE_FOLDING_TIME; + double GLOBAL_TAG_THROTTLING_COST_FOLDING_TIME; double MAX_TRANSACTIONS_PER_BYTE; int64_t MIN_AVAILABLE_SPACE; + // DD won't move data to a team that has available space ratio < MIN_AVAILABLE_SPACE_RATIO double MIN_AVAILABLE_SPACE_RATIO; double MIN_AVAILABLE_SPACE_RATIO_SAFETY_BUFFER; double TARGET_AVAILABLE_SPACE_RATIO; - double AVAILABLE_SPACE_UPDATE_DELAY; double MAX_TL_SS_VERSION_DIFFERENCE; // spring starts at half this value double MAX_TL_SS_VERSION_DIFFERENCE_BATCH; @@ -632,29 +826,53 @@ class ServerKnobs : public KnobsImpl { double INITIAL_DURABILITY_LAG_MULTIPLIER; double DURABILITY_LAG_REDUCTION_RATE; double DURABILITY_LAG_INCREASE_RATE; - double STORAGE_SERVER_LIST_FETCH_TIMEOUT; + bool BW_THROTTLING_ENABLED; + double TARGET_BW_LAG; + double TARGET_BW_LAG_BATCH; + double TARGET_BW_LAG_UPDATE; + int MIN_BW_HISTORY; + double BW_ESTIMATION_INTERVAL; + double BW_LAG_INCREASE_AMOUNT; + double BW_LAG_DECREASE_AMOUNT; + double BW_FETCH_WORKERS_INTERVAL; + double BW_RW_LOGGING_INTERVAL; + double BW_MAX_BLOCKED_INTERVAL; + double BW_RK_SIM_QUIESCE_DELAY; // disk snapshot int64_t MAX_FORKED_PROCESS_OUTPUT; + // retry limit after network failures + int64_t SNAP_NETWORK_FAILURE_RETRY_LIMIT; + // time limit for creating snapshot double SNAP_CREATE_MAX_TIMEOUT; + // minimum gap time between two snapshot requests for the same process + double SNAP_MINIMUM_TIME_GAP; // Maximum number of storage servers a snapshot can fail to // capture while still succeeding int64_t MAX_STORAGE_SNAPSHOT_FAULT_TOLERANCE; // Maximum number of coordinators a snapshot can fail to // capture while still succeeding int64_t MAX_COORDINATOR_SNAPSHOT_FAULT_TOLERANCE; + // if true, all processes with class "storage", "transaction" and "log" will be snapshotted even not recruited as + // the role + bool SNAPSHOT_ALL_STATEFUL_PROCESSES; // Storage Metrics double STORAGE_METRICS_AVERAGE_INTERVAL; double STORAGE_METRICS_AVERAGE_INTERVAL_PER_KSECONDS; double SPLIT_JITTER_AMOUNT; int64_t IOPS_UNITS_PER_SAMPLE; - int64_t BANDWIDTH_UNITS_PER_SAMPLE; + int64_t BYTES_WRITTEN_UNITS_PER_SAMPLE; int64_t BYTES_READ_UNITS_PER_SAMPLE; + int64_t OPS_READ_UNITES_PER_SAMPLE; int64_t READ_HOT_SUB_RANGE_CHUNK_SIZE; int64_t EMPTY_READ_PENALTY; + int DD_SHARD_COMPARE_LIMIT; // when read-aware DD is enabled, at most how many shards are compared together bool READ_SAMPLING_ENABLED; + // Rolling window duration over which the average bytes moved by DD is calculated for the 'MovingData' trace event. + double DD_TRACE_MOVE_BYTES_AVERAGE_INTERVAL; + int64_t MOVING_WINDOW_SAMPLE_SIZE; // Storage Server double STORAGE_LOGGING_DELAY; @@ -663,28 +881,46 @@ class ServerKnobs : public KnobsImpl { int STORAGE_LIMIT_BYTES; int BUGGIFY_LIMIT_BYTES; bool FETCH_USING_STREAMING; + bool FETCH_USING_BLOB; int FETCH_BLOCK_BYTES; int FETCH_KEYS_PARALLELISM_BYTES; int FETCH_KEYS_PARALLELISM; + int FETCH_KEYS_PARALLELISM_CHANGE_FEED; int FETCH_KEYS_LOWER_PRIORITY; - int FETCH_CHANGEFEED_PARALLELISM; + int SERVE_FETCH_CHECKPOINT_PARALLELISM; + int SERVE_AUDIT_STORAGE_PARALLELISM; + int PERSIST_FINISH_AUDIT_COUNT; // Num of persist complete/failed audits for each type + int AUDIT_RETRY_COUNT_MAX; + int CONCURRENT_AUDIT_TASK_COUNT_MAX; + bool AUDIT_DATAMOVE_PRE_CHECK; + bool AUDIT_DATAMOVE_POST_CHECK; + int AUDIT_DATAMOVE_POST_CHECK_RETRY_COUNT_MAX; + int AUDIT_STORAGE_RATE_PER_SERVER_MAX; + bool ENABLE_AUDIT_VERBOSE_TRACE; + bool LOGGING_STORAGE_COMMIT_WHEN_IO_TIMEOUT; + double LOGGING_COMPLETE_STORAGE_COMMIT_PROBABILITY; + int LOGGING_RECENT_STORAGE_COMMIT_SIZE; + bool LOGGING_ROCKSDB_BG_WORK_WHEN_IO_TIMEOUT; + double LOGGING_ROCKSDB_BG_WORK_PROBABILITY; + double LOGGING_ROCKSDB_BG_WORK_PERIOD_SEC; int BUGGIFY_BLOCK_BYTES; int64_t STORAGE_RECOVERY_VERSION_LAG_LIMIT; double STORAGE_DURABILITY_LAG_REJECT_THRESHOLD; double STORAGE_DURABILITY_LAG_MIN_RATE; int STORAGE_COMMIT_BYTES; int STORAGE_FETCH_BYTES; + int STORAGE_ROCKSDB_FETCH_BYTES; double STORAGE_COMMIT_INTERVAL; - double UPDATE_SHARD_VERSION_INTERVAL; int BYTE_SAMPLING_FACTOR; int BYTE_SAMPLING_OVERHEAD; + double MIN_BYTE_SAMPLING_PROBABILITY; // Adjustable only for test of PhysicalShardMove. Should always be 0 for other + // cases int MAX_STORAGE_SERVER_WATCH_BYTES; int MAX_BYTE_SAMPLE_CLEAR_MAP_SIZE; double LONG_BYTE_SAMPLE_RECOVERY_DELAY; int BYTE_SAMPLE_LOAD_PARALLELISM; double BYTE_SAMPLE_LOAD_DELAY; double BYTE_SAMPLE_START_DELAY; - double UPDATE_STORAGE_PROCESS_STATS_INTERVAL; double BEHIND_CHECK_DELAY; int BEHIND_CHECK_COUNT; int64_t BEHIND_CHECK_VERSIONS; @@ -692,7 +928,6 @@ class ServerKnobs : public KnobsImpl { int64_t MIN_TAG_READ_PAGES_RATE; int64_t MIN_TAG_WRITE_PAGES_RATE; double TAG_MEASUREMENT_INTERVAL; - int64_t READ_COST_BYTE_FACTOR; bool PREFIX_COMPRESS_KVS_MEM_SNAPSHOTS; bool REPORT_DD_METRICS; double DD_METRICS_REPORT_INTERVAL; @@ -710,6 +945,14 @@ class ServerKnobs : public KnobsImpl { int CHECKPOINT_TRANSFER_BLOCK_BYTES; int QUICK_GET_KEY_VALUES_LIMIT; int QUICK_GET_KEY_VALUES_LIMIT_BYTES; + int STORAGE_FEED_QUERY_HARD_LIMIT; + std::string STORAGESERVER_READ_PRIORITIES; + int STORAGE_SERVER_READ_CONCURRENCY; + std::string STORAGESERVER_READTYPE_PRIORITY_MAP; + int SPLIT_METRICS_MAX_ROWS; + double STORAGE_SHARD_CONSISTENCY_CHECK_INTERVAL; + int PHYSICAL_SHARD_MOVE_LOG_SEVERITY; + int FETCH_SHARD_BUFFER_BYTE_LIMIT; // Wait Failure int MAX_OUTSTANDING_WAIT_FAILURE_REQUESTS; @@ -717,6 +960,7 @@ class ServerKnobs : public KnobsImpl { // Worker double WORKER_LOGGING_INTERVAL; + double ROLE_REFRESH_LOGGING_INTERVAL; double HEAP_PROFILER_INTERVAL; double UNKNOWN_CC_TIMEOUT; double DEGRADED_RESET_INTERVAL; @@ -751,13 +995,9 @@ class ServerKnobs : public KnobsImpl { // Enabling this can reduce toil of manually restarting the SS. // Enable with caution: If io_timeout is caused by disk failure, we won't // want to restart the SS, which increases risk of data corruption. - bool CONSISTENCY_CHECK_ROCKSDB_ENGINE; // When set, consistency check only check data corruption for a - // shard which is in at least one SS with the rocksdb engine. - bool CONSISTENCY_CHECK_SQLITE_ENGINE; // When set, consistency check only check data corruption for a - // shard which is in at least one SS with the sqlite engine. - // When both CONSISTENCY_CHECK_ROCKSDB_ENGINE and - // CONSISTENCY_CHECK_SQLITE_ENGINE are set, consistency check only checks for - // the rocksdb engine. + int STORAGE_DISK_CLEANUP_MAX_RETRIES; // Max retries to cleanup left-over disk files from last storage server + int STORAGE_DISK_CLEANUP_RETRY_INTERVAL; // Sleep interval between cleanup retries + double WORKER_START_STORAGE_DELAY; // Test harness double WORKER_POLL_DELAY; @@ -771,7 +1011,7 @@ class ServerKnobs : public KnobsImpl { // Dynamic Knobs (implementation) double COMPACTION_INTERVAL; - double UPDATE_NODE_TIMEOUT; + double BROADCASTER_SELF_UPDATE_DELAY; double GET_COMMITTED_VERSION_TIMEOUT; double GET_SNAPSHOT_AND_CHANGES_TIMEOUT; double FETCH_CHANGES_TIMEOUT; @@ -787,14 +1027,6 @@ class ServerKnobs : public KnobsImpl { bool DISABLE_DUPLICATE_LOG_WARNING; double HISTOGRAM_REPORT_INTERVAL; - // IPager - int PAGER_RESERVED_PAGES; - - // IndirectShadowPager - int FREE_PAGE_VACUUM_THRESHOLD; - int VACUUM_QUEUE_SIZE; - int VACUUM_BYTES_PER_SECOND; - // Timekeeper int64_t TIME_KEEPER_DELAY; int64_t TIME_KEEPER_MAX_ENTRIES; @@ -817,11 +1049,9 @@ class ServerKnobs : public KnobsImpl { int64_t FASTRESTORE_ROLE_LOGGING_DELAY; int64_t FASTRESTORE_UPDATE_PROCESS_STATS_INTERVAL; // How quickly to update process metrics for restore int64_t FASTRESTORE_ATOMICOP_WEIGHT; // workload amplication factor for atomic op - int64_t FASTRESTORE_APPLYING_PARALLELISM; // number of outstanding txns writing to dest. DB int64_t FASTRESTORE_MONITOR_LEADER_DELAY; int64_t FASTRESTORE_STRAGGLER_THRESHOLD_SECONDS; bool FASTRESTORE_TRACK_REQUEST_LATENCY; // true to track reply latency of each request in a request batch - bool FASTRESTORE_TRACK_LOADER_SEND_REQUESTS; // track requests of load send mutations to appliers? int64_t FASTRESTORE_MEMORY_THRESHOLD_MB_SOFT; // threshold when pipelined actors should be delayed int64_t FASTRESTORE_WAIT_FOR_MEMORY_LATENCY; int64_t FASTRESTORE_HEARTBEAT_DELAY; // interval for master to ping loaders and appliers @@ -858,9 +1088,15 @@ class ServerKnobs : public KnobsImpl { int REDWOOD_DEFAULT_EXTENT_SIZE; // Extent size for new Redwood files int REDWOOD_DEFAULT_EXTENT_READ_SIZE; // Extent read size for Redwood files int REDWOOD_EXTENT_CONCURRENT_READS; // Max number of simultaneous extent disk reads in progress. - int REDWOOD_KVSTORE_CONCURRENT_READS; // Max number of simultaneous point or range reads in progress. bool REDWOOD_KVSTORE_RANGE_PREFETCH; // Whether to use range read prefetching - double REDWOOD_PAGE_REBUILD_MAX_SLACK; // When rebuilding pages, max slack to allow in page + double REDWOOD_PAGE_REBUILD_MAX_SLACK; // When rebuilding pages, max slack to allow in page before extending it + double REDWOOD_PAGE_REBUILD_SLACK_DISTRIBUTION; // When rebuilding pages, use this ratio of slack distribution + // between the rightmost (new) page and the previous page. Defaults + // to .5 (50%) so that slack is evenly distributed between the + // pages. A value close to 0 indicates most slack to remain in the + // old page, where a value close to 1 causes the new page to have + // most of the slack. Immutable workloads with an increasing key + // pattern benefit from setting this to a value close to 1. int REDWOOD_LAZY_CLEAR_BATCH_SIZE_PAGES; // Number of pages to try to pop from the lazy delete queue and process at // once int REDWOOD_LAZY_CLEAR_MIN_PAGES; // Minimum number of pages to free before ending a lazy clear cycle, unless the @@ -876,41 +1112,129 @@ class ServerKnobs : public KnobsImpl { double REDWOOD_HISTOGRAM_INTERVAL; bool REDWOOD_EVICT_UPDATED_PAGES; // Whether to prioritize eviction of updated pages from cache. int REDWOOD_DECODECACHE_REUSE_MIN_HEIGHT; // Minimum height for which to keep and reuse page decode caches + int REDWOOD_NODE_MAX_UNBALANCE; // Maximum imbalance in a node before it should be rebuilt instead of updated + + std::string REDWOOD_IO_PRIORITIES; // Server request latency measurement - int LATENCY_SAMPLE_SIZE; + double LATENCY_SKETCH_ACCURACY; + double FILE_LATENCY_SKETCH_ACCURACY; double LATENCY_METRICS_LOGGING_INTERVAL; // Cluster recovery std::string CLUSTER_RECOVERY_EVENT_NAME_PREFIX; // Encryption - bool ENABLE_ENCRYPTION; - std::string ENCRYPTION_MODE; + int SIM_KMS_MAX_KEYS; + int ENCRYPT_PROXY_MAX_DBG_TRACE_LENGTH; + double ENCRYPTION_LOGGING_INTERVAL; + + // Compression + bool ENABLE_BLOB_GRANULE_COMPRESSION; + std::string BLOB_GRANULE_COMPRESSION_FILTER; + + // Key Management Service (KMS) Connector + std::string KMS_CONNECTOR_TYPE; // blob granule stuff // FIXME: configure url with database configuration instead of knob eventually std::string BG_URL; + // Whether to use knobs or EKP for blob metadata and credentials + std::string BG_METADATA_SOURCE; + + bool BG_USE_BLOB_RANGE_CHANGE_LOG; + int BG_SNAPSHOT_FILE_TARGET_BYTES; + int BG_SNAPSHOT_FILE_TARGET_CHUNK_BYTES; int BG_DELTA_FILE_TARGET_BYTES; + int BG_DELTA_FILE_TARGET_CHUNK_BYTES; int BG_DELTA_BYTES_BEFORE_COMPACT; int BG_MAX_SPLIT_FANOUT; + int BG_MAX_MERGE_FANIN; int BG_HOT_SNAPSHOT_VERSIONS; int BG_CONSISTENCY_CHECK_ENABLED; int BG_CONSISTENCY_CHECK_TARGET_SPEED_KB; + bool BG_ENABLE_MERGING; + int BG_MERGE_CANDIDATE_THRESHOLD_SECONDS; + int BG_MERGE_CANDIDATE_DELAY_SECONDS; + int BG_KEY_TUPLE_TRUNCATE_OFFSET; + bool BG_ENABLE_SPLIT_TRUNCATED; + bool BG_ENABLE_READ_DRIVEN_COMPACTION; + int BG_RDC_BYTES_FACTOR; + int BG_RDC_READ_FACTOR; + bool BG_WRITE_MULTIPART; + bool BG_ENABLE_DYNAMIC_WRITE_AMP; + double BG_DYNAMIC_WRITE_AMP_MIN_FACTOR; + double BG_DYNAMIC_WRITE_AMP_DECREASE_FACTOR; int BLOB_WORKER_INITIAL_SNAPSHOT_PARALLELISM; + int BLOB_WORKER_RESNAPSHOT_PARALLELISM; + int BLOB_WORKER_DELTA_FILE_WRITE_PARALLELISM; + int BLOB_WORKER_RDC_PARALLELISM; + // The resnapshot/delta parallelism knobs are deprecated and replaced by the budget_bytes knobs! FIXME: remove after + // next release + int64_t BLOB_WORKER_RESNAPSHOT_BUDGET_BYTES; + int64_t BLOB_WORKER_DELTA_WRITE_BUDGET_BYTES; + double BLOB_WORKER_TIMEOUT; // Blob Manager's reaction time to a blob worker failure double BLOB_WORKER_REQUEST_TIMEOUT; // Blob Worker's server-side request timeout double BLOB_WORKERLIST_FETCH_INTERVAL; double BLOB_WORKER_BATCH_GRV_INTERVAL; + double BLOB_WORKER_EMPTY_GRV_INTERVAL; + int BLOB_WORKER_GRV_HISTORY_MAX_SIZE; + int64_t BLOB_WORKER_GRV_HISTORY_MIN_VERSION_GRANULARITY; + bool BLOB_WORKER_DO_REJECT_WHEN_FULL; + double BLOB_WORKER_REJECT_WHEN_FULL_THRESHOLD; + double BLOB_WORKER_FORCE_FLUSH_CLEANUP_DELAY; + bool BLOB_WORKER_DISK_ENABLED; + int BLOB_WORKER_STORE_TYPE; + double BLOB_WORKER_REJOIN_TIME; double BLOB_MANAGER_STATUS_EXP_BACKOFF_MIN; double BLOB_MANAGER_STATUS_EXP_BACKOFF_MAX; double BLOB_MANAGER_STATUS_EXP_BACKOFF_EXPONENT; + int BLOB_MANAGER_CONCURRENT_MERGE_CHECKS; double BGCC_TIMEOUT; double BGCC_MIN_INTERVAL; + bool BLOB_MANIFEST_BACKUP; + double BLOB_MANIFEST_BACKUP_INTERVAL; + bool BLOB_FULL_RESTORE_MODE; + double BLOB_MIGRATOR_CHECK_INTERVAL; + int BLOB_MANIFEST_RW_ROWS; + std::string BLOB_RESTORE_MLOGS_URL; + int BLOB_MIGRATOR_ERROR_RETRIES; + std::string BLOB_RESTORE_MANIFEST_URL; + int BLOB_RESTORE_MANIFEST_FILE_MAX_SIZE; + int BLOB_RESTORE_MANIFEST_RETENTION_MAX; + int BLOB_RESTORE_MLOGS_RETENTION_SECS; + + // Blob metadata + int64_t BLOB_METADATA_CACHE_TTL; + + // HTTP KMS Connector + std::string REST_KMS_CONNECTOR_KMS_DISCOVERY_URL_MODE; + std::string REST_KMS_CONNECTOR_DISCOVER_KMS_URL_FILE; + std::string REST_KMS_CONNECTOR_VALIDATION_TOKEN_MODE; + std::string REST_KMS_CONNECTOR_VALIDATION_TOKEN_DETAILS; + bool ENABLE_REST_KMS_COMMUNICATION; + bool REST_KMS_CONNECTOR_REMOVE_TRAILING_NEWLINE; + int REST_KMS_CONNECTOR_VALIDATION_TOKEN_MAX_SIZE; + int REST_KMS_CONNECTOR_VALIDATION_TOKENS_MAX_PAYLOAD_SIZE; + bool REST_KMS_CONNECTOR_REFRESH_KMS_URLS; + double REST_KMS_CONNECTOR_REFRESH_KMS_URLS_INTERVAL_SEC; + std::string REST_KMS_CONNECTOR_GET_ENCRYPTION_KEYS_ENDPOINT; + std::string REST_KMS_CONNECTOR_GET_LATEST_ENCRYPTION_KEYS_ENDPOINT; + std::string REST_KMS_CONNECTOR_GET_BLOB_METADATA_ENDPOINT; + int REST_KMS_CURRENT_BLOB_METADATA_REQUEST_VERSION; + int REST_KMS_MAX_BLOB_METADATA_REQUEST_VERSION; + int REST_KMS_CURRENT_CIPHER_REQUEST_VERSION; + int REST_KMS_MAX_CIPHER_REQUEST_VERSION; + + // Idempotency ids + double IDEMPOTENCY_ID_IN_MEMORY_LIFETIME; + double IDEMPOTENCY_IDS_CLEANER_POLLING_INTERVAL; + double IDEMPOTENCY_IDS_MIN_AGE_SECONDS; ServerKnobs(Randomize, ClientKnobs*, IsSimulated); void initialize(Randomize, ClientKnobs*, IsSimulated); diff --git a/src/fdbclient/include/fdbclient/SimKmsVault.cpp b/src/fdbclient/include/fdbclient/SimKmsVault.cpp new file mode 100644 index 0000000..dd18ea4 --- /dev/null +++ b/src/fdbclient/include/fdbclient/SimKmsVault.cpp @@ -0,0 +1,185 @@ +/* + * SimKmsVault.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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. + */ + +#include "fdbclient/SimKmsVault.h" +#include "fdbclient/BlobCipher.h" +#include "fdbclient/ClientKnobs.h" + +#include "fdbclient/Knobs.h" +#include "flow/Arena.h" +#include "flow/EncryptUtils.h" +#include "flow/FastRef.h" +#include "flow/IRandom.h" +#include "flow/network.h" + +SimKmsVaultKeyCtx::SimKmsVaultKeyCtx(EncryptCipherBaseKeyId kId, const uint8_t* data, const int dataLen) + : id(kId), keyLen(dataLen) { + key = makeString(keyLen); + memcpy(mutateString(key), data, keyLen); + kcv = Sha256KCV().computeKCV((const uint8_t*)data, dataLen); + if (DEBUG_SIM_KEY_CIPHER) { + TraceEvent(SevDebug, "SimKmsVaultKeyCtxInit") + .detail("BaseCipherId", kId) + .detail("BaseCipherLen", dataLen) + .detail("KCV", kcv); + } +} + +int SimKmsVaultKeyCtx::getKeyLen(const EncryptCipherBaseKeyId id) { + ASSERT_GT(id, INVALID_ENCRYPT_CIPHER_KEY_ID); + + int ret = AES_256_KEY_LENGTH; + if ((id % 2) == 0) { + ret += (id % (MAX_BASE_CIPHER_LEN - AES_256_KEY_LENGTH)); + } + CODE_PROBE(ret == AES_256_KEY_LENGTH, "SimKmsVault BaseCipherKeyLen AES_256_KEY_LENGTH"); + CODE_PROBE(ret != AES_256_KEY_LENGTH, "SimKmsVault BaseCipherKeyLen variable length"); + + return ret; +} + +class SimKmsVaultCtx : NonCopyable, public ReferenceCounted { +public: + // Public visibility constructior ONLY to assist FlowSingleton instance creation. + // API Note: Constructor is expected to be instantiated only in simulation mode. + + explicit SimKmsVaultCtx(bool ignored) { + ASSERT(g_network->isSimulated()); + init(); + } + + static Reference getInstance() { + if (g_network->isSimulated()) { + return FlowSingleton::getInstance( + []() { return makeReference(g_network->isSimulated()); }); + } else { + static SimKmsVaultCtx instance; + return Reference::addRef(&instance); + } + } + + Reference getByBaseCipherId(const EncryptCipherBaseKeyId baseCipherId) { + auto itr = keyvault.find(baseCipherId); + if (itr == keyvault.end()) { + return Reference(); + } + return itr->second; + } + + EncryptCipherBaseKeyId getBaseCipherIdFromDomainId(const EncryptCipherDomainId domainId) const { + return 1 + abs(domainId) % maxEncryptionKeys; + } + + uint32_t maxKeys() const { return maxEncryptionKeys; } + +private: + SimKmsVaultCtx() { init(); } + + void init() { + maxEncryptionKeys = CLIENT_KNOBS->SIM_KMS_VAULT_MAX_KEYS; + // Vault needs to ensure 'stable encryption key semantics' across process restarts, the encryption keys are + // generated using following scheme: + // a. HMAC_SHA algorithm is used to generate the key (digest) + // b. HMAC_SHA uses an 'deterministic' seed (SHA_KEY) and 'data' buffer to generate a vault key + // c. To generate variable length vault-key, a known 'char' is used for padding + const unsigned char SHA_KEY[] = "0c39e7906db6d51ac0573d328ce1b6be"; + + // Construct encryption keyStore. + // Note the keys generated must be the same after restart. + for (int i = 1; i <= maxEncryptionKeys; i++) { + const int keyLen = SimKmsVaultKeyCtx::getKeyLen(i); + uint8_t key[keyLen]; + uint8_t digest[AUTH_TOKEN_HMAC_SHA_SIZE]; + + // TODO: Allow baseCipherKeyLen < AES_256_KEY_LENGTH + ASSERT_EQ(AES_256_KEY_LENGTH, AUTH_TOKEN_HMAC_SHA_SIZE); + computeAuthToken({ { reinterpret_cast(&i), sizeof(i) } }, + SHA_KEY, + AES_256_KEY_LENGTH, + &digest[0], + EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA, + AUTH_TOKEN_HMAC_SHA_SIZE); + memcpy(&key[0], &digest[0], std::min(keyLen, AUTH_TOKEN_HMAC_SHA_SIZE)); + // Simulate variable length 'baseCipher' returned by external KMS + if (keyLen > AUTH_TOKEN_HMAC_SHA_SIZE) { + // pad it with known value + memset(&key[AUTH_TOKEN_HMAC_SHA_SIZE], 'b', (keyLen - AUTH_TOKEN_HMAC_SHA_SIZE)); + } + keyvault[i] = makeReference(i, &key[0], keyLen); + } + } + + uint32_t maxEncryptionKeys; + std::unordered_map> keyvault; +}; + +namespace SimKmsVault { + +Reference getByBaseCipherId(const EncryptCipherBaseKeyId baseCipherId) { + Reference ctx = SimKmsVaultCtx::getInstance(); + return ctx->getByBaseCipherId(baseCipherId); +} + +Reference getByDomainId(const EncryptCipherDomainId domainId) { + Reference ctx = SimKmsVaultCtx::getInstance(); + const EncryptCipherBaseKeyId baseCipherId = ctx->getBaseCipherIdFromDomainId(domainId); + return ctx->getByBaseCipherId(baseCipherId); +} + +uint32_t maxSimKeys() { + Reference vaultCtx = SimKmsVaultCtx::getInstance(); + return vaultCtx->maxKeys(); +} + +} // namespace SimKmsVault + +// Only used to link unit tests +void forceLinkSimKmsVaultTests() {} + +TEST_CASE("/simKmsVault") { + auto& g_knobs = IKnobCollection::getMutableGlobalKnobCollection(); + g_knobs.setKnob("sim_kms_vault_max_keys", KnobValueRef::create(int{ 20 })); + + Reference vaultCtx = SimKmsVaultCtx::getInstance(); + ASSERT_EQ(vaultCtx->maxKeys(), CLIENT_KNOBS->SIM_KMS_VAULT_MAX_KEYS); + + // Test non-existing baseCiphers + Reference keyCtx = SimKmsVault::getByBaseCipherId(vaultCtx->maxKeys() + 1); + ASSERT(!keyCtx.isValid()); + + const int nIterations = deterministicRandom()->randomInt(512, 786); + for (int i = 0; i < nIterations; i++) { + Reference keyCtx; + if (deterministicRandom()->coinflip()) { + const EncryptCipherBaseKeyId baseCipherId = deterministicRandom()->randomInt(1, vaultCtx->maxKeys() + 1); + keyCtx = SimKmsVault::getByBaseCipherId(baseCipherId); + ASSERT(keyCtx.isValid()); + ASSERT_EQ(keyCtx->id, baseCipherId); + } else { + const EncryptCipherDomainId domainId = deterministicRandom()->randomInt64(1, 100001); + keyCtx = SimKmsVault::getByDomainId(domainId); + ASSERT(keyCtx.isValid()); + ASSERT_EQ(keyCtx->id, vaultCtx->getBaseCipherIdFromDomainId(domainId)); + } + ASSERT_GT(keyCtx->kcv, 0); + ASSERT(!keyCtx->key.empty()); + } + return Void(); +} diff --git a/src/fdbclient/include/fdbclient/SimKmsVault.h b/src/fdbclient/include/fdbclient/SimKmsVault.h new file mode 100644 index 0000000..fab5c82 --- /dev/null +++ b/src/fdbclient/include/fdbclient/SimKmsVault.h @@ -0,0 +1,50 @@ +/* + * RESTKmsSimVault.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBCLIENT_SIM_KMS_VAULT_H +#define FDBCLIENT_SIM_KMS_VAULT_H +#pragma once + +#include "flow/EncryptUtils.h" + +#define DEBUG_SIM_KEY_CIPHER DEBUG_ENCRYPT_KEY_CIPHER + +struct SimKmsVaultKeyCtx : NonCopyable, public ReferenceCounted { + static const int minCipherLen = 4; + static const int maxCipherLen = 256; + + EncryptCipherBaseKeyId id; + int keyLen; + Standalone key; + EncryptCipherKeyCheckValue kcv; + + SimKmsVaultKeyCtx() : id(INVALID_ENCRYPT_CIPHER_KEY_ID), keyLen(-1), kcv(0) {} + explicit SimKmsVaultKeyCtx(EncryptCipherBaseKeyId kId, const uint8_t* data, const int dataLen); + + static int getKeyLen(const EncryptCipherBaseKeyId id); +}; + +namespace SimKmsVault { +Reference getByBaseCipherId(const EncryptCipherBaseKeyId baseCipherId); +Reference getByDomainId(const EncryptCipherDomainId domainId); +uint32_t maxSimKeys(); +} // namespace SimKmsVault + +#endif diff --git a/src/fdbclient/SimpleConfigTransaction.h b/src/fdbclient/include/fdbclient/SimpleConfigTransaction.h similarity index 97% rename from src/fdbclient/SimpleConfigTransaction.h rename to src/fdbclient/include/fdbclient/SimpleConfigTransaction.h index 83d8411..b3eb0e3 100644 --- a/src/fdbclient/SimpleConfigTransaction.h +++ b/src/fdbclient/include/fdbclient/SimpleConfigTransaction.h @@ -75,6 +75,8 @@ class SimpleConfigTransaction final : public IConfigTransaction, public FastAllo void reset() override; void debugTransaction(UID dID) override; void checkDeferredError() const override; + double getTagThrottledDuration() const override; + int64_t getTotalCost() const override; int64_t getApproximateSize() const override; void set(KeyRef const&, ValueRef const&) override; void clear(KeyRangeRef const&) override { throw client_invalid_operation(); } diff --git a/src/fdbclient/SimpleIni.h b/src/fdbclient/include/fdbclient/SimpleIni.h similarity index 100% rename from src/fdbclient/SimpleIni.h rename to src/fdbclient/include/fdbclient/SimpleIni.h diff --git a/src/fdbclient/SnapshotCache.h b/src/fdbclient/include/fdbclient/SnapshotCache.h similarity index 100% rename from src/fdbclient/SnapshotCache.h rename to src/fdbclient/include/fdbclient/SnapshotCache.h diff --git a/src/fdbclient/SpecialKeySpace.actor.g.h b/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h similarity index 80% rename from src/fdbclient/SpecialKeySpace.actor.g.h rename to src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h index 5ffaccd..a32986a 100644 --- a/src/fdbclient/SpecialKeySpace.actor.g.h +++ b/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" /* * SpecialKeySpace.actor.h * @@ -31,7 +31,6 @@ #include "flow/flow.h" #include "flow/Arena.h" #include "fdbclient/FDBTypes.h" -#include "fdbclient/GlobalConfig.actor.h" #include "fdbclient/KeyRangeMap.h" #include "fdbclient/ReadYourWrites.h" #include "flow/actorcompiler.h" // This must be the last #include. @@ -63,6 +62,8 @@ class SpecialKeyRangeReadImpl { // TODO : give this function a more descriptive name virtual bool isAsync() const { return false; } + virtual bool supportsTenants() const { return false; } + virtual ~SpecialKeyRangeReadImpl() {} protected: @@ -134,28 +135,28 @@ class SpecialKeyRangeAsyncImpl : public SpecialKeyRangeReadImpl { bool isAsync() const override { return true; } - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" // This generated class is to be used only via getRangeAsyncActor() - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" template - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" class GetRangeAsyncActorActorState { - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" public: - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" GetRangeAsyncActorActorState(const SpecialKeyRangeReadImpl* const& skrAyncImpl,ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr,GetRangeLimits const& limits,KeyRangeMap>* const& cache) - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" : skrAyncImpl(skrAyncImpl), - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" ryw(ryw), - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" kr(kr), - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" limits(limits), - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" cache(cache) - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" { fdb_probe_actor_create("getRangeAsyncActor", reinterpret_cast(this)); @@ -168,26 +169,26 @@ class GetRangeAsyncActorActorState { int a_body1(int loopDepth=0) { try { - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" ASSERT(skrAyncImpl->getKeyRange().contains(kr)); - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" ASSERT(cache != nullptr); - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" ASSERT(cache->rangeContaining(kr.begin) == cache->rangeContainingKeyBefore(kr.end)); - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" if (!(*cache)[kr.begin].present()) - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" { - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" StrictFuture __when_expr_0 = skrAyncImpl->getRange(ryw, skrAyncImpl->getKeyRange(), limits); - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" loopDepth = 0; } else @@ -213,33 +214,33 @@ class GetRangeAsyncActorActorState { } int a_body1cont1(int loopDepth) { - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" const auto& allResults = (*cache)[kr.begin].get(); - #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" int start = 0, end = allResults.size(); - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" for(;start < allResults.size() && allResults[start].key < kr.begin;) { - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" ++start; - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" } - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" for(;end > 0 && allResults[end - 1].key >= kr.end;) { - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" --end; - #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" } - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" if (start < end) - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" { - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" RangeResult result = RangeResultRef(allResults.slice(start, end), false); - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" result.arena().dependsOn(allResults.arena()); - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetRangeAsyncActorActorState(); static_cast(this)->destroy(); return 0; } - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(result); this->~GetRangeAsyncActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -247,9 +248,9 @@ class GetRangeAsyncActorActorState { } else { - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" if (!static_cast(this)->SAV::futures) { (void)(RangeResult()); this->~GetRangeAsyncActorActorState(); static_cast(this)->destroy(); return 0; } - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(RangeResult()); this->~GetRangeAsyncActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -260,18 +261,18 @@ class GetRangeAsyncActorActorState { } int a_body1cont2(RangeResult const& result_,int loopDepth) { - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" cache->insert(skrAyncImpl->getKeyRange(), result_); - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" loopDepth = a_body1cont1(loopDepth); return loopDepth; } int a_body1cont2(RangeResult && result_,int loopDepth) { - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" cache->insert(skrAyncImpl->getKeyRange(), result_); - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -339,22 +340,22 @@ class GetRangeAsyncActorActorState { fdb_probe_actor_exit("getRangeAsyncActor", reinterpret_cast(this), 0); } - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" const SpecialKeyRangeReadImpl* skrAyncImpl; - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" ReadYourWritesTransaction* ryw; - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" KeyRangeRef kr; - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" GetRangeLimits limits; - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" KeyRangeMap>* cache; - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" }; // This generated class is to be used only via getRangeAsyncActor() - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" class GetRangeAsyncActorActor final : public Actor, public ActorCallback< GetRangeAsyncActorActor, 0, RangeResult >, public FastAllocated, public GetRangeAsyncActorActorState { - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -363,9 +364,9 @@ class GetRangeAsyncActorActor final : public Actor, public ActorCal void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetRangeAsyncActorActor, 0, RangeResult >; - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" GetRangeAsyncActorActor(const SpecialKeyRangeReadImpl* const& skrAyncImpl,ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr,GetRangeLimits const& limits,KeyRangeMap>* const& cache) - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" : Actor(), GetRangeAsyncActorActorState(skrAyncImpl, ryw, kr, limits, cache) { @@ -388,14 +389,14 @@ friend struct ActorCallback< GetRangeAsyncActorActor, 0, RangeResult >; } }; - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" [[nodiscard]] static Future getRangeAsyncActor( const SpecialKeyRangeReadImpl* const& skrAyncImpl, ReadYourWritesTransaction* const& ryw, KeyRangeRef const& kr, GetRangeLimits const& limits, KeyRangeMap>* const& cache ) { - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" return Future(new GetRangeAsyncActorActor(skrAyncImpl, ryw, kr, limits, cache)); - #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" } -#line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" +#line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" }; class SpecialKeySpace { @@ -404,6 +405,7 @@ class SpecialKeySpace { ACTORLINEAGE, // Sampling data ACTOR_PROFILER_CONF, // profiler configuration CLUSTERFILEPATH, + CLUSTERID, // An immutable UID for a cluster CONFIGURATION, // Configuration of the cluster CONNECTIONSTRING, ERRORMSG, // A single key space contains a json string which describes the last error in special-key-space @@ -471,22 +473,22 @@ class SpecialKeySpace { static const std::set& getTracingOptions() { return tracingOptions; } private: - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" [[nodiscard]] static Future> getActor( SpecialKeySpace* const& sks, ReadYourWritesTransaction* const& ryw, KeyRef const& key ); template friend class SpecialKeySpace_GetActorActorState; -#line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" +#line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" - #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" [[nodiscard]] static Future checkRYWValid( SpecialKeySpace* const& sks, ReadYourWritesTransaction* const& ryw, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Reverse const& reverse ); template friend class SpecialKeySpace_CheckRYWValidActorState; -#line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" +#line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" + #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" [[nodiscard]] static Future getRangeAggregationActor( SpecialKeySpace* const& sks, ReadYourWritesTransaction* const& ryw, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Reverse const& reverse ); template friend class SpecialKeySpace_GetRangeAggregationActorActorState; -#line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" +#line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" KeyRangeMap readImpls; KeyRangeMap modules; @@ -539,6 +541,7 @@ class ConflictingKeysImpl : public SpecialKeyRangeReadImpl { Future getRange(ReadYourWritesTransaction* ryw, KeyRangeRef kr, GetRangeLimits limitsHint) const override; + bool supportsTenants() const override { return true; }; }; class ReadConflictRangeImpl : public SpecialKeyRangeReadImpl { @@ -547,6 +550,7 @@ class ReadConflictRangeImpl : public SpecialKeyRangeReadImpl { Future getRange(ReadYourWritesTransaction* ryw, KeyRangeRef kr, GetRangeLimits limitsHint) const override; + bool supportsTenants() const override { return true; }; }; class WriteConflictRangeImpl : public SpecialKeyRangeReadImpl { @@ -555,6 +559,7 @@ class WriteConflictRangeImpl : public SpecialKeyRangeReadImpl { Future getRange(ReadYourWritesTransaction* ryw, KeyRangeRef kr, GetRangeLimits limitsHint) const override; + bool supportsTenants() const override { return true; }; }; class DDStatsRangeImpl : public SpecialKeyRangeAsyncImpl { @@ -672,7 +677,6 @@ class ConsistencyCheckImpl : public SpecialKeyRangeRWImpl { Future> commit(ReadYourWritesTransaction* ryw) override; }; -class GlobalConfig; class GlobalConfigImpl : public SpecialKeyRangeRWImpl { public: explicit GlobalConfigImpl(KeyRangeRef kr); @@ -734,6 +738,7 @@ class VersionEpochImpl : public SpecialKeyRangeRWImpl { Future> commit(ReadYourWritesTransaction* ryw) override; }; +// Deprecated as of 7.2 class ClientProfilingImpl : public SpecialKeyRangeRWImpl { public: explicit ClientProfilingImpl(KeyRangeRef kr); @@ -786,24 +791,22 @@ class DataDistributionImpl : public SpecialKeyRangeRWImpl { Future> commit(ReadYourWritesTransaction* ryw) override; }; -class TenantMapRangeImpl : public SpecialKeyRangeRWImpl { +class WorkerInterfacesSpecialKeyImpl : public SpecialKeyRangeReadImpl { public: - const static KeyRangeRef submoduleRange; + explicit WorkerInterfacesSpecialKeyImpl(KeyRangeRef kr); - explicit TenantMapRangeImpl(KeyRangeRef kr); Future getRange(ReadYourWritesTransaction* ryw, KeyRangeRef kr, GetRangeLimits limitsHint) const override; - Future> commit(ReadYourWritesTransaction* ryw) override; }; // If the underlying set of key-value pairs of a key space is not changing, then we expect repeating a read to give the // same result. Additionally, we can generate the expected result of any read if that read is reading a subrange. This // actor performs a read of an arbitrary subrange of [begin, end) and validates the results. - #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.g.h" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.g.h" [[nodiscard]] Future validateSpecialSubrangeRead( ReadYourWritesTransaction* const& ryw, KeySelector const& begin, KeySelector const& end, GetRangeLimits const& limits, Reverse const& reverse, RangeResult const& result ); -#line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/SpecialKeySpace.actor.h" +#line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h" #include "flow/unactorcompiler.h" #endif diff --git a/src/fdbclient/SpecialKeySpace.actor.h b/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h similarity index 98% rename from src/fdbclient/SpecialKeySpace.actor.h rename to src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h index 9d23368..d2ce7f5 100644 --- a/src/fdbclient/SpecialKeySpace.actor.h +++ b/src/fdbclient/include/fdbclient/SpecialKeySpace.actor.h @@ -29,7 +29,6 @@ #include "flow/flow.h" #include "flow/Arena.h" #include "fdbclient/FDBTypes.h" -#include "fdbclient/GlobalConfig.actor.h" #include "fdbclient/KeyRangeMap.h" #include "fdbclient/ReadYourWrites.h" #include "flow/actorcompiler.h" // This must be the last #include. @@ -61,6 +60,8 @@ class SpecialKeyRangeReadImpl { // TODO : give this function a more descriptive name virtual bool isAsync() const { return false; } + virtual bool supportsTenants() const { return false; } + virtual ~SpecialKeyRangeReadImpl() {} protected: @@ -168,6 +169,7 @@ class SpecialKeySpace { ACTORLINEAGE, // Sampling data ACTOR_PROFILER_CONF, // profiler configuration CLUSTERFILEPATH, + CLUSTERID, // An immutable UID for a cluster CONFIGURATION, // Configuration of the cluster CONNECTIONSTRING, ERRORMSG, // A single key space contains a json string which describes the last error in special-key-space @@ -301,6 +303,7 @@ class ConflictingKeysImpl : public SpecialKeyRangeReadImpl { Future getRange(ReadYourWritesTransaction* ryw, KeyRangeRef kr, GetRangeLimits limitsHint) const override; + bool supportsTenants() const override { return true; }; }; class ReadConflictRangeImpl : public SpecialKeyRangeReadImpl { @@ -309,6 +312,7 @@ class ReadConflictRangeImpl : public SpecialKeyRangeReadImpl { Future getRange(ReadYourWritesTransaction* ryw, KeyRangeRef kr, GetRangeLimits limitsHint) const override; + bool supportsTenants() const override { return true; }; }; class WriteConflictRangeImpl : public SpecialKeyRangeReadImpl { @@ -317,6 +321,7 @@ class WriteConflictRangeImpl : public SpecialKeyRangeReadImpl { Future getRange(ReadYourWritesTransaction* ryw, KeyRangeRef kr, GetRangeLimits limitsHint) const override; + bool supportsTenants() const override { return true; }; }; class DDStatsRangeImpl : public SpecialKeyRangeAsyncImpl { @@ -434,7 +439,6 @@ class ConsistencyCheckImpl : public SpecialKeyRangeRWImpl { Future> commit(ReadYourWritesTransaction* ryw) override; }; -class GlobalConfig; class GlobalConfigImpl : public SpecialKeyRangeRWImpl { public: explicit GlobalConfigImpl(KeyRangeRef kr); @@ -496,6 +500,7 @@ class VersionEpochImpl : public SpecialKeyRangeRWImpl { Future> commit(ReadYourWritesTransaction* ryw) override; }; +// Deprecated as of 7.2 class ClientProfilingImpl : public SpecialKeyRangeRWImpl { public: explicit ClientProfilingImpl(KeyRangeRef kr); @@ -548,15 +553,13 @@ class DataDistributionImpl : public SpecialKeyRangeRWImpl { Future> commit(ReadYourWritesTransaction* ryw) override; }; -class TenantMapRangeImpl : public SpecialKeyRangeRWImpl { +class WorkerInterfacesSpecialKeyImpl : public SpecialKeyRangeReadImpl { public: - const static KeyRangeRef submoduleRange; + explicit WorkerInterfacesSpecialKeyImpl(KeyRangeRef kr); - explicit TenantMapRangeImpl(KeyRangeRef kr); Future getRange(ReadYourWritesTransaction* ryw, KeyRangeRef kr, GetRangeLimits limitsHint) const override; - Future> commit(ReadYourWritesTransaction* ryw) override; }; // If the underlying set of key-value pairs of a key space is not changing, then we expect repeating a read to give the diff --git a/src/fdbclient/StackLineage.h b/src/fdbclient/include/fdbclient/StackLineage.h similarity index 100% rename from src/fdbclient/StackLineage.h rename to src/fdbclient/include/fdbclient/StackLineage.h diff --git a/src/fdbclient/Status.h b/src/fdbclient/include/fdbclient/Status.h similarity index 100% rename from src/fdbclient/Status.h rename to src/fdbclient/include/fdbclient/Status.h diff --git a/src/fdbclient/StatusClient.h b/src/fdbclient/include/fdbclient/StatusClient.h similarity index 100% rename from src/fdbclient/StatusClient.h rename to src/fdbclient/include/fdbclient/StatusClient.h diff --git a/src/fdbclient/include/fdbclient/StorageCheckpoint.h b/src/fdbclient/include/fdbclient/StorageCheckpoint.h new file mode 100644 index 0000000..b2cf76d --- /dev/null +++ b/src/fdbclient/include/fdbclient/StorageCheckpoint.h @@ -0,0 +1,204 @@ +/* + * StorageCheckpoint.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBCLIENT_STORAGCHECKPOINT_H +#define FDBCLIENT_STORAGCHECKPOINT_H +#pragma once + +#include "fdbclient/FDBTypes.h" + +const std::string checkpointBytesSampleFileName = "metadata_bytes.sst"; +const std::string emptySstFilePath = "Dummy Empty SST File Path"; + +// FDB storage checkpoint format. +enum CheckpointFormat { + InvalidFormat = 0, + // For RocksDB, checkpoint generated via rocksdb::Checkpoint::ExportColumnFamily(). + DataMoveRocksCF = 1, + // For RocksDB, checkpoint generated via rocksdb::Checkpoint::CreateCheckpoint(). + RocksDB = 2, + // Checkpoint fetched as key-value pairs. + RocksDBKeyValues = 3, +}; + +// Metadata of a FDB checkpoint. +struct CheckpointMetaData { + enum CheckpointState { + InvalidState = 0, + Pending = 1, // Checkpoint creation pending. + Complete = 2, // Checkpoint is created and ready to be read. + Deleting = 3, // Checkpoint deletion requested. + Fail = 4, + }; + + constexpr static FileIdentifier file_identifier = 13804342; + Version version; + std::vector ranges; + int16_t format; // CheckpointFormat. + std::vector src; // Storage server(s) on which this checkpoint is created. + UID checkpointID; // A unique id for this checkpoint. + int16_t state; // CheckpointState. + Optional bytesSampleFile; + + // A serialized metadata associated with format, this data can be understood by the corresponding KVS. + Standalone serializedCheckpoint; + + Optional actionId; // Unique ID defined by the application. + + std::string dir; + + CheckpointMetaData() = default; + CheckpointMetaData(const std::vector& ranges, + CheckpointFormat format, + const std::vector& src, + UID const& checkpointID, + UID const& actionId) + : version(invalidVersion), ranges(ranges), format(format), src(src), checkpointID(checkpointID), state(Pending), + actionId(actionId) {} + CheckpointMetaData(const std::vector& ranges, + Version version, + CheckpointFormat format, + UID const& checkpointID) + : version(version), ranges(ranges), format(format), checkpointID(checkpointID), state(Pending) {} + CheckpointMetaData(Version version, CheckpointFormat format, UID checkpointID) + : version(version), format(format), checkpointID(checkpointID), state(Pending) {} + + CheckpointState getState() const { return static_cast(state); } + + void setState(CheckpointState state) { this->state = static_cast(state); } + + CheckpointFormat getFormat() const { return static_cast(format); } + + void setFormat(CheckpointFormat format) { this->format = static_cast(format); } + + bool hasRange(const KeyRangeRef range) const { + for (const auto& checkpointRange : ranges) { + if (checkpointRange.contains(range)) { + return true; + } + } + return false; + } + + bool hasRanges(const std::vector& ranges) const { + for (const auto& range : ranges) { + if (!this->hasRange(range)) { + return false; + } + } + return true; + } + + bool containsKey(const KeyRef key) const { + for (const auto& range : ranges) { + if (range.contains(key)) { + return true; + } + } + + return false; + } + + bool operator==(const CheckpointMetaData& r) const { return checkpointID == r.checkpointID; } + + std::string toString() const { + std::string res = "Checkpoint MetaData: [Ranges]: " + describe(ranges) + + " [Version]: " + std::to_string(version) + " [Format]: " + std::to_string(format) + + " [Checkpoint Dir:] " + dir + " [Server]: " + describe(src) + + " [ID]: " + checkpointID.toString() + " [State]: " + std::to_string(static_cast(state)) + + (actionId.present() ? (" [Action ID]: " + actionId.get().toString()) : "") + + (bytesSampleFile.present() ? " [bytesSampleFile]: " + bytesSampleFile.get() : ""); + ; + return res; + } + + template + void serialize(Ar& ar) { + serializer(ar, + version, + ranges, + format, + state, + checkpointID, + src, + serializedCheckpoint, + actionId, + bytesSampleFile, + dir); + } +}; + +namespace std { +template <> +class hash { +public: + size_t operator()(CheckpointMetaData const& checkpoint) const { return checkpoint.checkpointID.hash(); } +}; +} // namespace std + +// A DataMoveMetaData object corresponds to a single data move. +struct DataMoveMetaData { + enum Phase { + InvalidPhase = 0, + Prepare = 1, // System keyspace is being modified. + Running = 2, // System keyspace has been modified, data move in action. + Completing = 3, // Data transfer has finished, finalizing system keyspace. + Deleting = 4, // Data move is cancelled. + }; + + constexpr static FileIdentifier file_identifier = 13804362; + UID id; // A unique id for this data move. + Version version; + std::vector ranges; + int priority; + std::set src; + std::set dest; + std::set checkpoints; + int16_t phase; // DataMoveMetaData::Phase. + int8_t mode; + + DataMoveMetaData() = default; + DataMoveMetaData(UID id, Version version, KeyRange range) : id(id), version(version), priority(0), mode(0) { + this->ranges.push_back(range); + } + DataMoveMetaData(UID id, KeyRange range) : id(id), version(invalidVersion), priority(0), mode(0) { + this->ranges.push_back(range); + } + DataMoveMetaData(UID id) : id(id), version(invalidVersion), priority(0), mode(0) {} + + Phase getPhase() const { return static_cast(phase); } + + void setPhase(Phase phase) { this->phase = static_cast(phase); } + + std::string toString() const { + std::string res = "DataMoveMetaData: [ID]: " + id.shortString() + ", [Range]: " + describe(ranges) + + ", [Phase]: " + std::to_string(static_cast(phase)) + + ", [Source Servers]: " + describe(src) + ", [Destination Servers]: " + describe(dest) + + ", [Checkpoints]: " + describe(checkpoints); + return res; + } + + template + void serialize(Ar& ar) { + serializer(ar, id, version, ranges, priority, src, dest, checkpoints, phase, mode); + } +}; + +#endif diff --git a/src/fdbclient/StorageServerInterface.h b/src/fdbclient/include/fdbclient/StorageServerInterface.h similarity index 70% rename from src/fdbclient/StorageServerInterface.h rename to src/fdbclient/include/fdbclient/StorageServerInterface.h index ab8ed94..6e3d2c1 100644 --- a/src/fdbclient/StorageServerInterface.h +++ b/src/fdbclient/include/fdbclient/StorageServerInterface.h @@ -22,19 +22,22 @@ #define FDBCLIENT_STORAGESERVERINTERFACE_H #pragma once -#include +#include "fdbclient/Audit.h" #include "fdbclient/FDBTypes.h" #include "fdbclient/StorageCheckpoint.h" +#include "fdbclient/StorageServerShard.h" #include "fdbrpc/Locality.h" #include "fdbrpc/QueueModel.h" #include "fdbrpc/fdbrpc.h" #include "fdbrpc/LoadBalance.actor.h" #include "fdbrpc/Stats.h" #include "fdbrpc/TimedRequest.h" +#include "fdbrpc/TenantInfo.h" #include "fdbrpc/TSSComparison.h" #include "fdbclient/CommitTransaction.h" #include "fdbclient/TagThrottle.actor.h" #include "fdbclient/Tenant.h" +#include "fdbclient/Tracing.h" #include "flow/UnitTest.h" #include "fdbclient/VersionVector.h" @@ -52,6 +55,34 @@ struct VersionReply { } }; +// This struct is used by RK to forward the commit cost to SS, see discussion in #7258 +struct UpdateCommitCostRequest { + constexpr static FileIdentifier file_identifier = 4159439; + + // Ratekeeper ID, it is only reasonable to compare postTime from the same Ratekeeper + UID ratekeeperID; + + // The time the request being posted + double postTime; + + double elapsed; + TransactionTag busiestTag; + + // Properties that are defined in TransactionCommitCostEstimation + int opsSum; + uint64_t costSum; + + uint64_t totalWriteCosts; + bool reported; + + ReplyPromise reply; + + template + void serialize(Ar& ar) { + serializer(ar, ratekeeperID, postTime, elapsed, busiestTag, opsSum, costSum, totalWriteCosts, reported, reply); + } +}; + struct StorageServerInterface { constexpr static FileIdentifier file_identifier = 15302073; enum { BUSY_ALLOWED = 0, BUSY_FORCE = 1, BUSY_LOCAL = 2 }; @@ -63,32 +94,35 @@ struct StorageServerInterface { UID uniqueID; Optional tssPairID; - RequestStream getValue; - RequestStream getKey; + PublicRequestStream getValue; + PublicRequestStream getKey; // Throws a wrong_shard_server if the keys in the request or result depend on data outside this server OR if a large // selector offset prevents all data from being read in one range read - RequestStream getKeyValues; - RequestStream getMappedKeyValues; + PublicRequestStream getKeyValues; + PublicRequestStream getMappedKeyValues; RequestStream getShardState; - RequestStream waitMetrics; + PublicRequestStream waitMetrics; RequestStream splitMetrics; RequestStream getStorageMetrics; RequestStream> waitFailure; RequestStream getQueuingMetrics; RequestStream> getKeyValueStoreType; - RequestStream watchValue; + PublicRequestStream watchValue; RequestStream getReadHotRanges; RequestStream getRangeSplitPoints; - RequestStream getKeyValuesStream; + PublicRequestStream getKeyValuesStream; RequestStream changeFeedStream; RequestStream overlappingChangeFeeds; RequestStream changeFeedPop; RequestStream changeFeedVersionUpdate; RequestStream checkpoint; RequestStream fetchCheckpoint; + RequestStream fetchCheckpointKeyValues; + RequestStream updateCommitCostRequest; + RequestStream auditStorage; private: bool acceptingRequests; @@ -122,11 +156,13 @@ struct StorageServerInterface { serializer(ar, uniqueID, locality, getValue); } if (Ar::isDeserializing) { - getKey = RequestStream(getValue.getEndpoint().getAdjustedEndpoint(1)); - getKeyValues = RequestStream(getValue.getEndpoint().getAdjustedEndpoint(2)); + getKey = PublicRequestStream(getValue.getEndpoint().getAdjustedEndpoint(1)); + getKeyValues = + PublicRequestStream(getValue.getEndpoint().getAdjustedEndpoint(2)); getShardState = RequestStream(getValue.getEndpoint().getAdjustedEndpoint(3)); - waitMetrics = RequestStream(getValue.getEndpoint().getAdjustedEndpoint(4)); + waitMetrics = + PublicRequestStream(getValue.getEndpoint().getAdjustedEndpoint(4)); splitMetrics = RequestStream(getValue.getEndpoint().getAdjustedEndpoint(5)); getStorageMetrics = RequestStream(getValue.getEndpoint().getAdjustedEndpoint(6)); @@ -135,15 +171,16 @@ struct StorageServerInterface { RequestStream(getValue.getEndpoint().getAdjustedEndpoint(8)); getKeyValueStoreType = RequestStream>(getValue.getEndpoint().getAdjustedEndpoint(9)); - watchValue = RequestStream(getValue.getEndpoint().getAdjustedEndpoint(10)); + watchValue = + PublicRequestStream(getValue.getEndpoint().getAdjustedEndpoint(10)); getReadHotRanges = RequestStream(getValue.getEndpoint().getAdjustedEndpoint(11)); getRangeSplitPoints = RequestStream(getValue.getEndpoint().getAdjustedEndpoint(12)); - getKeyValuesStream = - RequestStream(getValue.getEndpoint().getAdjustedEndpoint(13)); - getMappedKeyValues = - RequestStream(getValue.getEndpoint().getAdjustedEndpoint(14)); + getKeyValuesStream = PublicRequestStream( + getValue.getEndpoint().getAdjustedEndpoint(13)); + getMappedKeyValues = PublicRequestStream( + getValue.getEndpoint().getAdjustedEndpoint(14)); changeFeedStream = RequestStream(getValue.getEndpoint().getAdjustedEndpoint(15)); overlappingChangeFeeds = @@ -155,6 +192,12 @@ struct StorageServerInterface { checkpoint = RequestStream(getValue.getEndpoint().getAdjustedEndpoint(19)); fetchCheckpoint = RequestStream(getValue.getEndpoint().getAdjustedEndpoint(20)); + fetchCheckpointKeyValues = RequestStream( + getValue.getEndpoint().getAdjustedEndpoint(21)); + updateCommitCostRequest = + RequestStream(getValue.getEndpoint().getAdjustedEndpoint(22)); + auditStorage = + RequestStream(getValue.getEndpoint().getAdjustedEndpoint(23)); } } else { ASSERT(Ar::isDeserializing); @@ -204,6 +247,9 @@ struct StorageServerInterface { streams.push_back(changeFeedVersionUpdate.getReceiver()); streams.push_back(checkpoint.getReceiver()); streams.push_back(fetchCheckpoint.getReceiver()); + streams.push_back(fetchCheckpointKeyValues.getReceiver()); + streams.push_back(updateCommitCostRequest.getReceiver()); + streams.push_back(auditStorage.getReceiver()); FlowTransport::transport().addEndpoints(streams); } }; @@ -214,6 +260,14 @@ struct StorageInfo : NonCopyable, public ReferenceCounted { StorageInfo() : tag(invalidTag) {} }; +struct StorageServerMetaInfo : public StorageServerInterface { + Optional metadata; + + StorageServerMetaInfo(const StorageServerInterface& interface, + Optional metadata = Optional()) + : StorageServerInterface(interface), metadata(metadata) {} +}; + struct ServerCacheInfo { std::vector tags; // all tags in both primary and remote DC for the key-range std::vector> src_info; @@ -233,21 +287,6 @@ struct ServerCacheInfo { } }; -struct TenantInfo { - static const int64_t INVALID_TENANT = -1; - - Optional name; - int64_t tenantId; - - TenantInfo() : tenantId(INVALID_TENANT) {} - TenantInfo(TenantName name, int64_t tenantId) : name(name), tenantId(tenantId) {} - - template - void serialize(Ar& ar) { - serializer(ar, name, tenantId); - } -}; - struct GetValueReply : public LoadBalancedReply { constexpr static FileIdentifier file_identifier = 1378929; Optional value; @@ -264,31 +303,33 @@ struct GetValueReply : public LoadBalancedReply { struct GetValueRequest : TimedRequest { constexpr static FileIdentifier file_identifier = 8454530; - SpanID spanContext; + SpanContext spanContext; TenantInfo tenantInfo; Key key; Version version; Optional tags; - Optional debugID; ReplyPromise reply; + Optional options; VersionVector ssLatestCommitVersions; // includes the latest commit versions, as known // to this client, of all storage replicas that // serve the given key - GetValueRequest() {} - GetValueRequest(SpanID spanContext, + + bool verify() const { return tenantInfo.isAuthorized(); } + + GetValueRequest(SpanContext spanContext, const TenantInfo& tenantInfo, const Key& key, Version ver, Optional tags, - Optional debugID, + Optional options, VersionVector latestCommitVersions) - : spanContext(spanContext), tenantInfo(tenantInfo), key(key), version(ver), tags(tags), debugID(debugID), + : spanContext(spanContext), tenantInfo(tenantInfo), key(key), version(ver), tags(tags), options(options), ssLatestCommitVersions(latestCommitVersions) {} template void serialize(Ar& ar) { - serializer(ar, key, version, tags, debugID, reply, spanContext, tenantInfo, ssLatestCommitVersions); + serializer(ar, key, version, tags, reply, spanContext, tenantInfo, options, ssLatestCommitVersions); } }; @@ -308,7 +349,7 @@ struct WatchValueReply { struct WatchValueRequest { constexpr static FileIdentifier file_identifier = 14747733; - SpanID spanContext; + SpanContext spanContext; TenantInfo tenantInfo; Key key; Optional value; @@ -319,7 +360,7 @@ struct WatchValueRequest { WatchValueRequest() {} - WatchValueRequest(SpanID spanContext, + WatchValueRequest(SpanContext spanContext, TenantInfo tenantInfo, const Key& key, Optional value, @@ -329,6 +370,8 @@ struct WatchValueRequest { : spanContext(spanContext), tenantInfo(tenantInfo), key(key), value(value), version(ver), tags(tags), debugID(debugID) {} + bool verify() const { return tenantInfo.isAuthorized(); } + template void serialize(Ar& ar) { serializer(ar, key, value, version, tags, debugID, reply, spanContext, tenantInfo); @@ -353,7 +396,7 @@ struct GetKeyValuesReply : public LoadBalancedReply { struct GetKeyValuesRequest : TimedRequest { constexpr static FileIdentifier file_identifier = 6795746; - SpanID spanContext; + SpanContext spanContext; Arena arena; TenantInfo tenantInfo; KeySelectorRef begin, end; @@ -362,15 +405,16 @@ struct GetKeyValuesRequest : TimedRequest { KeyRef mapper = KeyRef(); Version version; // or latestVersion int limit, limitBytes; - bool isFetchKeys; Optional tags; - Optional debugID; + Optional options; ReplyPromise reply; VersionVector ssLatestCommitVersions; // includes the latest commit versions, as known // to this client, of all storage replicas that // serve the given key - GetKeyValuesRequest() : isFetchKeys(false) {} + GetKeyValuesRequest() {} + + bool verify() const { return tenantInfo.isAuthorized(); } template void serialize(Ar& ar) { @@ -380,14 +424,13 @@ struct GetKeyValuesRequest : TimedRequest { version, limit, limitBytes, - isFetchKeys, tags, - debugID, reply, spanContext, tenantInfo, - arena, - ssLatestCommitVersions); + options, + ssLatestCommitVersions, + arena); } }; @@ -411,22 +454,24 @@ struct GetMappedKeyValuesReply : public LoadBalancedReply { struct GetMappedKeyValuesRequest : TimedRequest { constexpr static FileIdentifier file_identifier = 6795747; - SpanID spanContext; + SpanContext spanContext; Arena arena; TenantInfo tenantInfo; KeySelectorRef begin, end; KeyRef mapper; Version version; // or latestVersion int limit, limitBytes; - bool isFetchKeys; Optional tags; - Optional debugID; + Optional options; ReplyPromise reply; VersionVector ssLatestCommitVersions; // includes the latest commit versions, as known // to this client, of all storage replicas that // serve the given key range - GetMappedKeyValuesRequest() : isFetchKeys(false) {} + GetMappedKeyValuesRequest() {} + + bool verify() const { return tenantInfo.isAuthorized(); } + template void serialize(Ar& ar) { serializer(ar, @@ -436,14 +481,13 @@ struct GetMappedKeyValuesRequest : TimedRequest { version, limit, limitBytes, - isFetchKeys, tags, - debugID, reply, spanContext, tenantInfo, - arena, - ssLatestCommitVersions); + options, + ssLatestCommitVersions, + arena); } }; @@ -476,21 +520,22 @@ struct GetKeyValuesStreamReply : public ReplyPromiseStreamReply { struct GetKeyValuesStreamRequest { constexpr static FileIdentifier file_identifier = 6795746; - SpanID spanContext; + SpanContext spanContext; Arena arena; TenantInfo tenantInfo; KeySelectorRef begin, end; Version version; // or latestVersion int limit, limitBytes; - bool isFetchKeys; Optional tags; - Optional debugID; + Optional options; ReplyPromiseStream reply; VersionVector ssLatestCommitVersions; // includes the latest commit versions, as known // to this client, of all storage replicas that // serve the given key range - GetKeyValuesStreamRequest() : isFetchKeys(false) {} + GetKeyValuesStreamRequest() {} + + bool verify() const { return tenantInfo.isAuthorized(); } template void serialize(Ar& ar) { @@ -500,14 +545,13 @@ struct GetKeyValuesStreamRequest { version, limit, limitBytes, - isFetchKeys, tags, - debugID, reply, spanContext, tenantInfo, - arena, - ssLatestCommitVersions); + options, + ssLatestCommitVersions, + arena); } }; @@ -527,33 +571,35 @@ struct GetKeyReply : public LoadBalancedReply { struct GetKeyRequest : TimedRequest { constexpr static FileIdentifier file_identifier = 10457870; - SpanID spanContext; + SpanContext spanContext; Arena arena; TenantInfo tenantInfo; KeySelectorRef sel; Version version; // or latestVersion Optional tags; - Optional debugID; ReplyPromise reply; + Optional options; VersionVector ssLatestCommitVersions; // includes the latest commit versions, as known // to this client, of all storage replicas that // serve the given key GetKeyRequest() {} - GetKeyRequest(SpanID spanContext, + bool verify() const { return tenantInfo.isAuthorized(); } + + GetKeyRequest(SpanContext spanContext, TenantInfo tenantInfo, KeySelectorRef const& sel, Version version, Optional tags, - Optional debugID, + Optional options, VersionVector latestCommitVersions) - : spanContext(spanContext), tenantInfo(tenantInfo), sel(sel), version(version), debugID(debugID), + : spanContext(spanContext), tenantInfo(tenantInfo), sel(sel), version(version), tags(tags), options(options), ssLatestCommitVersions(latestCommitVersions) {} template void serialize(Ar& ar) { - serializer(ar, sel, version, tags, debugID, reply, spanContext, tenantInfo, arena, ssLatestCommitVersions); + serializer(ar, sel, version, tags, reply, spanContext, tenantInfo, options, ssLatestCommitVersions, arena); } }; @@ -562,12 +608,13 @@ struct GetShardStateReply { Version first; Version second; + std::vector shards; GetShardStateReply() = default; GetShardStateReply(Version first, Version second) : first(first), second(second) {} template void serialize(Ar& ar) { - serializer(ar, first, second); + serializer(ar, first, second, shards); } }; @@ -577,55 +624,69 @@ struct GetShardStateRequest { KeyRange keys; int32_t mode; + bool includePhysicalShard; ReplyPromise reply; - GetShardStateRequest() {} - GetShardStateRequest(KeyRange const& keys, waitMode mode) : keys(keys), mode(mode) {} + GetShardStateRequest() = default; + GetShardStateRequest(KeyRange const& keys, waitMode mode, bool includePhysicalShard) + : keys(keys), mode(mode), includePhysicalShard(includePhysicalShard) {} + GetShardStateRequest(KeyRange const& keys, waitMode mode) : keys(keys), mode(mode), includePhysicalShard(false) {} template void serialize(Ar& ar) { - serializer(ar, keys, mode, reply); + serializer(ar, keys, mode, reply, includePhysicalShard); } }; struct StorageMetrics { constexpr static FileIdentifier file_identifier = 13622226; int64_t bytes = 0; // total storage - // FIXME: currently, neither of bytesPerKSecond or iosPerKSecond are actually used in DataDistribution calculations. - // This may change in the future, but this comment is left here to avoid any confusion for the time being. - int64_t bytesPerKSecond = 0; // network bandwidth (average over 10s) + int64_t bytesWrittenPerKSecond = 0; // bytes write to SQ + + // FIXME: currently, iosPerKSecond is not used in DataDistribution calculations. int64_t iosPerKSecond = 0; int64_t bytesReadPerKSecond = 0; + int64_t opsReadPerKSecond = 0; static const int64_t infinity = 1LL << 60; + // assume each read op has a constant load cost (knob EMPTY_READ_PENALTY), + // return max(op * cost, bytesRead) + int64_t readLoadKSecond() const; + bool allLessOrEqual(const StorageMetrics& rhs) const { - return bytes <= rhs.bytes && bytesPerKSecond <= rhs.bytesPerKSecond && iosPerKSecond <= rhs.iosPerKSecond && - bytesReadPerKSecond <= rhs.bytesReadPerKSecond; + return bytes <= rhs.bytes && bytesWrittenPerKSecond <= rhs.bytesWrittenPerKSecond && + iosPerKSecond <= rhs.iosPerKSecond && bytesReadPerKSecond <= rhs.bytesReadPerKSecond && + opsReadPerKSecond <= rhs.opsReadPerKSecond; } void operator+=(const StorageMetrics& rhs) { bytes += rhs.bytes; - bytesPerKSecond += rhs.bytesPerKSecond; + bytesWrittenPerKSecond += rhs.bytesWrittenPerKSecond; iosPerKSecond += rhs.iosPerKSecond; bytesReadPerKSecond += rhs.bytesReadPerKSecond; + opsReadPerKSecond += rhs.opsReadPerKSecond; } void operator-=(const StorageMetrics& rhs) { bytes -= rhs.bytes; - bytesPerKSecond -= rhs.bytesPerKSecond; + bytesWrittenPerKSecond -= rhs.bytesWrittenPerKSecond; iosPerKSecond -= rhs.iosPerKSecond; bytesReadPerKSecond -= rhs.bytesReadPerKSecond; + opsReadPerKSecond -= rhs.opsReadPerKSecond; } template void operator*=(F f) { bytes *= f; - bytesPerKSecond *= f; + bytesWrittenPerKSecond *= f; iosPerKSecond *= f; bytesReadPerKSecond *= f; + opsReadPerKSecond *= f; + } + bool allZero() const { + return !bytes && !bytesWrittenPerKSecond && !iosPerKSecond && !bytesReadPerKSecond && !opsReadPerKSecond; } - bool allZero() const { return !bytes && !bytesPerKSecond && !iosPerKSecond && !bytesReadPerKSecond; } template void serialize(Ar& ar) { - serializer(ar, bytes, bytesPerKSecond, iosPerKSecond, bytesReadPerKSecond); + serializer(ar, bytes, bytesWrittenPerKSecond, iosPerKSecond, bytesReadPerKSecond, opsReadPerKSecond); } void negate() { operator*=(-1.0); } @@ -653,16 +714,18 @@ struct StorageMetrics { } bool operator==(StorageMetrics const& rhs) const { - return bytes == rhs.bytes && bytesPerKSecond == rhs.bytesPerKSecond && iosPerKSecond == rhs.iosPerKSecond && - bytesReadPerKSecond == rhs.bytesReadPerKSecond; + return bytes == rhs.bytes && bytesWrittenPerKSecond == rhs.bytesWrittenPerKSecond && + iosPerKSecond == rhs.iosPerKSecond && bytesReadPerKSecond == rhs.bytesReadPerKSecond && + opsReadPerKSecond == rhs.opsReadPerKSecond; } std::string toString() const { - return format("Bytes: %lld, BPerKSec: %lld, iosPerKSec: %lld, BReadPerKSec: %lld", + return format("Bytes: %lld, BWritePerKSec: %lld, iosPerKSec: %lld, BReadPerKSec: %lld, OpReadPerKSec: %lld", bytes, - bytesPerKSecond, + bytesWrittenPerKSecond, iosPerKSecond, - bytesReadPerKSecond); + bytesReadPerKSecond, + opsReadPerKSecond); } }; @@ -671,17 +734,27 @@ struct WaitMetricsRequest { // Send a reversed range for min, max to receive an immediate report constexpr static FileIdentifier file_identifier = 1795961; Arena arena; + // Setting the tenantInfo makes the request tenant-aware. + TenantInfo tenantInfo; + // Set `minVersion` to a version where the tenant info was read. Not needed for non-tenant-aware request. + Version minVersion = 0; KeyRangeRef keys; StorageMetrics min, max; ReplyPromise reply; + bool verify() const { return tenantInfo.isAuthorized(); } + WaitMetricsRequest() {} - WaitMetricsRequest(KeyRangeRef const& keys, StorageMetrics const& min, StorageMetrics const& max) - : keys(arena, keys), min(min), max(max) {} + WaitMetricsRequest(TenantInfo tenantInfo, + Version minVersion, + KeyRangeRef const& keys, + StorageMetrics const& min, + StorageMetrics const& max) + : tenantInfo(tenantInfo), minVersion(minVersion), keys(arena, keys), min(min), max(max) {} template void serialize(Ar& ar) { - serializer(ar, keys, min, max, reply, arena); + serializer(ar, keys, min, max, reply, tenantInfo, minVersion, arena); } }; @@ -689,10 +762,11 @@ struct SplitMetricsReply { constexpr static FileIdentifier file_identifier = 11530792; Standalone> splits; StorageMetrics used; + bool more = false; template void serialize(Ar& ar) { - serializer(ar, splits, used); + serializer(ar, splits, used, more); } }; @@ -705,18 +779,21 @@ struct SplitMetricsRequest { StorageMetrics estimated; bool isLastShard; ReplyPromise reply; + Optional minSplitBytes; SplitMetricsRequest() {} SplitMetricsRequest(KeyRangeRef const& keys, StorageMetrics const& limits, StorageMetrics const& used, StorageMetrics const& estimated, - bool isLastShard) - : keys(arena, keys), limits(limits), used(used), estimated(estimated), isLastShard(isLastShard) {} + bool isLastShard, + Optional minSplitBytes) + : keys(arena, keys), limits(limits), used(used), estimated(estimated), isLastShard(isLastShard), + minSplitBytes(minSplitBytes) {} template void serialize(Ar& ar) { - serializer(ar, keys, limits, used, estimated, isLastShard, reply, arena); + serializer(ar, keys, limits, used, estimated, isLastShard, reply, minSplitBytes, arena); } }; @@ -729,20 +806,30 @@ struct ReadHotRangeWithMetrics { // The density for key range [A,C) is 30 * 100 / 200 = 15 double density; // How many bytes of data was sent in a period of time because of read requests. - double readBandwidth; + double readBandwidthSec; + + int64_t bytes; // storage bytes + double readOpsSec; // an interpolated value over sampling interval ReadHotRangeWithMetrics() = default; ReadHotRangeWithMetrics(KeyRangeRef const& keys, double density, double readBandwidth) - : keys(keys), density(density), readBandwidth(readBandwidth) {} + : keys(keys), density(density), readBandwidthSec(readBandwidth) {} + + ReadHotRangeWithMetrics(KeyRangeRef const& keys, int64_t bytes, double readBandwidth, double readOpsKSec) + : keys(keys), density(readBandwidth / std::max((int64_t)1, bytes)), readBandwidthSec(readBandwidth), bytes(bytes), + readOpsSec(readOpsKSec) {} ReadHotRangeWithMetrics(Arena& arena, const ReadHotRangeWithMetrics& rhs) - : keys(arena, rhs.keys), density(rhs.density), readBandwidth(rhs.readBandwidth) {} + : keys(arena, rhs.keys), density(rhs.density), readBandwidthSec(rhs.readBandwidthSec), bytes(rhs.bytes), + readOpsSec(rhs.readOpsSec) {} - int expectedSize() const { return keys.expectedSize() + sizeof(density) + sizeof(readBandwidth); } + int expectedSize() const { + return keys.expectedSize() + sizeof(density) + sizeof(readBandwidthSec) + sizeof(bytes) + sizeof(readOpsSec); + } template void serialize(Ar& ar) { - serializer(ar, keys, density, readBandwidth); + serializer(ar, keys, density, readBandwidthSec, bytes, readOpsSec); } }; @@ -757,16 +844,22 @@ struct ReadHotSubRangeReply { }; struct ReadHotSubRangeRequest { constexpr static FileIdentifier file_identifier = 10259266; + enum SplitType : uint8_t { BYTES, READ_BYTES, READ_OPS }; + Arena arena; KeyRangeRef keys; ReplyPromise reply; + uint8_t type = SplitType::BYTES; + int chunkCount = 1; + ReadHotSubRangeRequest() {} - ReadHotSubRangeRequest(KeyRangeRef const& keys) : keys(arena, keys) {} + ReadHotSubRangeRequest(KeyRangeRef const& keys, SplitType type = SplitType::BYTES, int chunkCount = 1) + : keys(arena, keys), type(type), chunkCount(chunkCount) {} template void serialize(Ar& ar) { - serializer(ar, keys, reply, arena); + serializer(ar, keys, reply, type, chunkCount, arena); } }; @@ -828,7 +921,7 @@ struct ChangeFeedStreamReply : public ReplyPromiseStreamReply { struct ChangeFeedStreamRequest { constexpr static FileIdentifier file_identifier = 6795746; - SpanID spanContext; + SpanContext spanContext; Arena arena; Key rangeID; Version begin = 0; @@ -836,16 +929,28 @@ struct ChangeFeedStreamRequest { KeyRange range; int replyBufferSize = -1; bool canReadPopped = true; - UID debugUID; // This is only used for debugging and tracing, but being able to link a client + server side stream - // is so useful for testing, and this is such small overhead compared to streaming large amounts of - // change feed data, it is left in the interface + UID id; // This must be globally unique among ChangeFeedStreamRequest instances + Optional options; + bool encrypted = false; ReplyPromiseStream reply; ChangeFeedStreamRequest() {} template void serialize(Ar& ar) { - serializer(ar, rangeID, begin, end, range, reply, spanContext, replyBufferSize, canReadPopped, debugUID, arena); + serializer(ar, + rangeID, + begin, + end, + range, + reply, + spanContext, + replyBufferSize, + canReadPopped, + id, + options, + encrypted, + arena); } }; @@ -872,18 +977,21 @@ struct ChangeFeedPopRequest { struct GetCheckpointRequest { constexpr static FileIdentifier file_identifier = 13804343; Version version; // The FDB version at which the checkpoint is created. - KeyRange range; + std::vector ranges; int16_t format; // CheckpointFormat. - Optional checkpointID; // When present, look for the checkpoint with the exact UID. + Optional actionId; ReplyPromise reply; GetCheckpointRequest() {} - GetCheckpointRequest(Version version, KeyRange const& range, CheckpointFormat format) - : version(version), range(range), format(format) {} + GetCheckpointRequest(std::vector ranges, + Version version, + CheckpointFormat format, + const Optional& actionId) + : version(version), ranges(ranges), format(format), actionId(actionId) {} template void serialize(Ar& ar) { - serializer(ar, version, range, format, checkpointID, reply); + serializer(ar, version, ranges, format, actionId, reply); } }; @@ -920,40 +1028,83 @@ struct FetchCheckpointRequest { } }; -struct OverlappingChangeFeedEntry { - Key rangeId; +struct FetchCheckpointKeyValuesStreamReply : public ReplyPromiseStreamReply { + constexpr static FileIdentifier file_identifier = 13804353; + Arena arena; + VectorRef data; + + FetchCheckpointKeyValuesStreamReply() = default; + + int expectedSize() const { return data.expectedSize(); } + + template + void serialize(Ar& ar) { + serializer(ar, ReplyPromiseStreamReply::acknowledgeToken, ReplyPromiseStreamReply::sequence, data, arena); + } +}; + +// Fetch checkpoint in the format of key-value pairs. +struct FetchCheckpointKeyValuesRequest { + constexpr static FileIdentifier file_identifier = 13804354; + UID checkpointID; KeyRange range; + ReplyPromiseStream reply; + + FetchCheckpointKeyValuesRequest() = default; + FetchCheckpointKeyValuesRequest(UID checkpointID, KeyRange range) : checkpointID(checkpointID), range(range) {} + + template + void serialize(Ar& ar) { + serializer(ar, checkpointID, range, reply); + } +}; + +struct OverlappingChangeFeedEntry { + KeyRef feedId; + KeyRangeRef range; Version emptyVersion; Version stopVersion; + Version feedMetadataVersion; bool operator==(const OverlappingChangeFeedEntry& r) const { - return rangeId == r.rangeId && range == r.range && emptyVersion == r.emptyVersion && - stopVersion == r.stopVersion; + return feedId == r.feedId && range == r.range && emptyVersion == r.emptyVersion && + stopVersion == r.stopVersion && feedMetadataVersion == r.feedMetadataVersion; } OverlappingChangeFeedEntry() {} - OverlappingChangeFeedEntry(Key const& rangeId, KeyRange const& range, Version emptyVersion, Version stopVersion) - : rangeId(rangeId), range(range), emptyVersion(emptyVersion), stopVersion(stopVersion) {} + OverlappingChangeFeedEntry(KeyRef const& feedId, + KeyRangeRef const& range, + Version emptyVersion, + Version stopVersion, + Version feedMetadataVersion) + : feedId(feedId), range(range), emptyVersion(emptyVersion), stopVersion(stopVersion), + feedMetadataVersion(feedMetadataVersion) {} + + OverlappingChangeFeedEntry(Arena& arena, const OverlappingChangeFeedEntry& rhs) + : feedId(arena, rhs.feedId), range(arena, rhs.range), emptyVersion(rhs.emptyVersion), + stopVersion(rhs.stopVersion), feedMetadataVersion(rhs.feedMetadataVersion) {} template void serialize(Ar& ar) { - serializer(ar, rangeId, range, emptyVersion, stopVersion); + serializer(ar, feedId, range, emptyVersion, stopVersion, feedMetadataVersion); } }; struct OverlappingChangeFeedsReply { constexpr static FileIdentifier file_identifier = 11815134; - std::vector rangeIds; + VectorRef feeds; bool cached; Arena arena; + Version feedMetadataVersion; - OverlappingChangeFeedsReply() : cached(false) {} - explicit OverlappingChangeFeedsReply(std::vector const& rangeIds) - : rangeIds(rangeIds), cached(false) {} + OverlappingChangeFeedsReply() : cached(false), feedMetadataVersion(invalidVersion) {} + explicit OverlappingChangeFeedsReply(VectorRef const& feeds, + Version feedMetadataVersion) + : feeds(feeds), cached(false), feedMetadataVersion(feedMetadataVersion) {} template void serialize(Ar& ar) { - serializer(ar, rangeIds, arena); + serializer(ar, feeds, feedMetadataVersion, arena); } }; @@ -1001,19 +1152,18 @@ struct ChangeFeedVersionUpdateRequest { struct GetStorageMetricsReply { constexpr static FileIdentifier file_identifier = 15491478; - StorageMetrics load; - StorageMetrics available; - StorageMetrics capacity; + StorageMetrics load; // sum of key-value metrics (logical bytes) + StorageMetrics available; // physical bytes + StorageMetrics capacity; // physical bytes double bytesInputRate; int64_t versionLag; double lastUpdate; - int64_t bytesDurable, bytesInput; GetStorageMetricsReply() : bytesInputRate(0) {} template void serialize(Ar& ar) { - serializer(ar, load, available, capacity, bytesInputRate, versionLag, lastUpdate, bytesDurable, bytesInput); + serializer(ar, load, available, capacity, bytesInputRate, versionLag, lastUpdate); } }; @@ -1084,4 +1234,13 @@ struct StorageQueuingMetricsRequest { } }; +// Memory size for storing mutation in the mutation log and the versioned map. +inline int mvccStorageBytes(int mutationBytes) { + // Why * 2: + // - 1 insertion into version map costs 2 nodes in avg; + // - The mutation will be stored in both mutation log and versioned map; + return VersionedMap::overheadPerItem * 2 + + (mutationBytes + MutationRef::OVERHEAD_BYTES) * 2; +} + #endif diff --git a/src/fdbclient/include/fdbclient/StorageServerShard.h b/src/fdbclient/include/fdbclient/StorageServerShard.h new file mode 100644 index 0000000..c29849b --- /dev/null +++ b/src/fdbclient/include/fdbclient/StorageServerShard.h @@ -0,0 +1,109 @@ +/* + * StorageServerShard.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBCLIENT_STORAGESERVERSHARD_H +#define FDBCLIENT_STORAGESERVERSHARD_H +#pragma once + +#include "fdbclient/FDBTypes.h" +#include "flow/flow.h" + +// Represents a data shard on a storage server hosting a continuous keyrange. +struct StorageServerShard { + constexpr static FileIdentifier file_identifier = 4028358; + + enum ShardState { + NotAssigned = 0, // The key range is not assiged to the storage server. + Adding = 1, // A new shard is being moved to the storage server. + ReadWritePending = 2, // The shard is waiting for the `ReadWrite` state to be persisted. + ReadWrite = 3, // Shard is read-write. + MovingIn = 4, // Same as `Adding`, but the shard is being moved in via physical shard move. + Error = 5, // Something is wrong. + }; + + StorageServerShard() = default; + StorageServerShard(KeyRange range, + Version version, + const uint64_t id, + const uint64_t desiredId, + ShardState shardState, + Optional moveInShardId) + : range(range), version(version), id(id), desiredId(desiredId), shardState(shardState), + moveInShardId(moveInShardId) {} + StorageServerShard(KeyRange range, + Version version, + const uint64_t id, + const uint64_t desiredId, + ShardState shardState) + : range(range), version(version), id(id), desiredId(desiredId), shardState(shardState) {} + + static StorageServerShard notAssigned(KeyRange range, Version version = 0) { + return StorageServerShard(range, version, 0, 0, NotAssigned); + } + + ShardState getShardState() const { return static_cast(this->shardState); }; + + void setShardState(const ShardState shardState) { this->shardState = static_cast(shardState); } + + std::string getShardStateString() const { + const ShardState ss = getShardState(); + switch (ss) { + case NotAssigned: + return "NotAssigned"; + case Adding: + return "Adding"; + case ReadWritePending: + return "ReadWritePending"; + case ReadWrite: + return "ReadWrite"; + case MovingIn: + return "MovingIn"; + case Error: + return "Error"; + } + + return "InvalidState"; + } + + std::string toString() const { + std::string res = "StorageServerShard: [Range]: " + Traceable::toString(range) + + " [Shard ID]: " + format("%016llx", this->id) + " [Version]: " + std::to_string(version) + + " [State]: " + getShardStateString() + + " [Desired Shard ID]: " + format("%016llx", this->desiredId); + if (moveInShardId.present()) { + res += " [MoveInShard ID]: " + this->moveInShardId.get().toString(); + } + return res; + } + + template + void serialize(Ar& ar) { + serializer(ar, range, version, id, desiredId, shardState, moveInShardId); + } + + KeyRange range; + Version version; // Shard creation version. + uint64_t id; // The actual shard ID. + uint64_t desiredId; // The intended shard ID. + int8_t shardState; + Optional moveInShardId; // If present, it is the associated MoveInShardMetaData. +}; + +#endif diff --git a/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h b/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h new file mode 100644 index 0000000..dc234e4 --- /dev/null +++ b/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h @@ -0,0 +1,869 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +/* + * StorageWiggleMetrics.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_STORAGEWIGGLEMETRICS_ACTOR_G_H) +#define FDBCLIENT_STORAGEWIGGLEMETRICS_ACTOR_G_H +#include "fdbclient/StorageWiggleMetrics.actor.g.h" +#elif !defined(FDBCLIENT_STORAGEWIGGLEMETRICS_ACTOR_H) +#define FDBCLIENT_STORAGEWIGGLEMETRICS_ACTOR_H + +#include "fdbrpc/Smoother.h" +#include "flow/ObjectSerializer.h" +#include "flow/serialize.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/KeyBackedTypes.actor.h" +#include "fdbclient/RunTransaction.actor.h" +#include "flow/actorcompiler.h" + +FDB_BOOLEAN_PARAM(PrimaryRegion); + +struct StorageWiggleMetrics { + constexpr static FileIdentifier file_identifier = 4728961; + + // round statistics + // One StorageServer wiggle round is considered 'complete', when all StorageServers with creationTime < T are + // wiggled + // Start and finish are in epoch seconds + double last_round_start = 0; + double last_round_finish = 0; + TimerSmoother smoothed_round_duration; + int finished_round = 0; // finished round since storage wiggle is open + + // step statistics + // 1 wiggle step as 1 storage server is wiggled in the current round + // Start and finish are in epoch seconds + double last_wiggle_start = 0; + double last_wiggle_finish = 0; + TimerSmoother smoothed_wiggle_duration; + int finished_wiggle = 0; // finished step since storage wiggle is open + + StorageWiggleMetrics() : smoothed_round_duration(20.0 * 60), smoothed_wiggle_duration(10.0 * 60) {} + + template + void serialize(Ar& ar) { + double step_total, round_total; + if (!ar.isDeserializing) { + step_total = smoothed_wiggle_duration.getTotal(); + round_total = smoothed_round_duration.getTotal(); + } + serializer(ar, + last_wiggle_start, + last_wiggle_finish, + step_total, + finished_wiggle, + last_round_start, + last_round_finish, + round_total, + finished_round); + if (ar.isDeserializing) { + smoothed_round_duration.reset(round_total); + smoothed_wiggle_duration.reset(step_total); + } + } + + StatusObject toJSON() const { + StatusObject result; + result["last_round_start_datetime"] = epochsToGMTString(last_round_start); + result["last_round_finish_datetime"] = epochsToGMTString(last_round_finish); + result["last_round_start_timestamp"] = last_round_start; + result["last_round_finish_timestamp"] = last_round_finish; + result["smoothed_round_seconds"] = smoothed_round_duration.smoothTotal(); + result["finished_round"] = finished_round; + + result["last_wiggle_start_datetime"] = epochsToGMTString(last_wiggle_start); + result["last_wiggle_finish_datetime"] = epochsToGMTString(last_wiggle_finish); + result["last_wiggle_start_timestamp"] = last_wiggle_start; + result["last_wiggle_finish_timestamp"] = last_wiggle_finish; + result["smoothed_wiggle_seconds"] = smoothed_wiggle_duration.smoothTotal(); + result["finished_wiggle"] = finished_wiggle; + return result; + } + + void reset() { + StorageWiggleMetrics newMetrics; + newMetrics.smoothed_round_duration.reset(smoothed_round_duration.getTotal()); + newMetrics.smoothed_wiggle_duration.reset(smoothed_wiggle_duration.getTotal()); + *this = std::move(newMetrics); + } +}; + +struct StorageWiggleDelay { + constexpr static FileIdentifier file_identifier = 102937; + double delaySeconds = 0; + explicit StorageWiggleDelay(double sec = 0) : delaySeconds(sec) {} + + template + void serialize(Ar& ar) { + serializer(ar, delaySeconds); + } +}; + +namespace { +// Persistent the total delay time to the database, and return accumulated delay time. + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +// This generated class is to be used only via addPerpetualWiggleDelay_impl() + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +template + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +class AddPerpetualWiggleDelay_implActorState { + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +public: + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + AddPerpetualWiggleDelay_implActorState(TrType const& tr,KeyBackedObjectProperty const& delayProperty,double const& secDelta) + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + : tr(tr), + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + delayProperty(delayProperty), + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + secDelta(secDelta) + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + { + fdb_probe_actor_create("addPerpetualWiggleDelay_impl", reinterpret_cast(this)); + + } + ~AddPerpetualWiggleDelay_implActorState() + { + fdb_probe_actor_destroy("addPerpetualWiggleDelay_impl", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + StrictFuture __when_expr_0 = delayProperty.getD(tr, Snapshot::False); + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~AddPerpetualWiggleDelay_implActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + delayObj.delaySeconds += secDelta; + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + delayProperty.set(tr, delayObj); + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(delayObj.delaySeconds); this->~AddPerpetualWiggleDelay_implActorState(); static_cast(this)->destroy(); return 0; } + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + new (&static_cast(this)->SAV< double >::value()) double(delayObj.delaySeconds); + this->~AddPerpetualWiggleDelay_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(StorageWiggleDelay const& __delayObj,int loopDepth) + { + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + delayObj = __delayObj; + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(StorageWiggleDelay && __delayObj,int loopDepth) + { + delayObj = std::move(__delayObj); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AddPerpetualWiggleDelay_implActor, 0, StorageWiggleDelay >::remove(); + + } + void a_callback_fire(ActorCallback< AddPerpetualWiggleDelay_implActor, 0, StorageWiggleDelay >*,StorageWiggleDelay const& value) + { + fdb_probe_actor_enter("addPerpetualWiggleDelay_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addPerpetualWiggleDelay_impl", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< AddPerpetualWiggleDelay_implActor, 0, StorageWiggleDelay >*,StorageWiggleDelay && value) + { + fdb_probe_actor_enter("addPerpetualWiggleDelay_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addPerpetualWiggleDelay_impl", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< AddPerpetualWiggleDelay_implActor, 0, StorageWiggleDelay >*,Error err) + { + fdb_probe_actor_enter("addPerpetualWiggleDelay_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("addPerpetualWiggleDelay_impl", reinterpret_cast(this), 0); + + } + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + TrType tr; + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + KeyBackedObjectProperty delayProperty; + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + double secDelta; + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + StorageWiggleDelay delayObj; + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +}; +// This generated class is to be used only via addPerpetualWiggleDelay_impl() + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +template + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +class AddPerpetualWiggleDelay_implActor final : public Actor, public ActorCallback< AddPerpetualWiggleDelay_implActor, 0, StorageWiggleDelay >, public FastAllocated>, public AddPerpetualWiggleDelay_implActorState> { + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< AddPerpetualWiggleDelay_implActor, 0, StorageWiggleDelay >; + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + AddPerpetualWiggleDelay_implActor(TrType const& tr,KeyBackedObjectProperty const& delayProperty,double const& secDelta) + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + : Actor(), + AddPerpetualWiggleDelay_implActorState>(tr, delayProperty, secDelta) + { + fdb_probe_actor_enter("addPerpetualWiggleDelay_impl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("addPerpetualWiggleDelay_impl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("addPerpetualWiggleDelay_impl", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< AddPerpetualWiggleDelay_implActor, 0, StorageWiggleDelay >*)0, actor_cancelled()); break; + } + + } +}; + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +template + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +[[nodiscard]] Future addPerpetualWiggleDelay_impl( TrType const& tr, KeyBackedObjectProperty const& delayProperty, double const& secDelta ) { + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + return Future(new AddPerpetualWiggleDelay_implActor(tr, delayProperty, secDelta)); + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +} + +#line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + +// set all fields except for smoothed durations to default values. If the metrics is not given, load from system key +// space + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +// This generated class is to be used only via resetStorageWiggleMetrics_impl() + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +template + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +class ResetStorageWiggleMetrics_implActorState { + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +public: + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + ResetStorageWiggleMetrics_implActorState(TrType const& tr,KeyBackedObjectProperty const& metricsProperty,Optional const& metrics) + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + : tr(tr), + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + metricsProperty(metricsProperty), + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + metrics(metrics) + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + { + fdb_probe_actor_create("resetStorageWiggleMetrics_impl", reinterpret_cast(this)); + + } + ~ResetStorageWiggleMetrics_implActorState() + { + fdb_probe_actor_destroy("resetStorageWiggleMetrics_impl", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + if (!metrics.present()) + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + { + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + StrictFuture __when_expr_0 = store(metrics, metricsProperty.get(tr)); + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ResetStorageWiggleMetrics_implActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + if (metrics.present()) + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + { + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + metrics.get().reset(); + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + metricsProperty.set(tr, metrics.get()); + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + } + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ResetStorageWiggleMetrics_implActorState(); static_cast(this)->destroy(); return 0; } + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ResetStorageWiggleMetrics_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ResetStorageWiggleMetrics_implActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ResetStorageWiggleMetrics_implActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("resetStorageWiggleMetrics_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("resetStorageWiggleMetrics_impl", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ResetStorageWiggleMetrics_implActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("resetStorageWiggleMetrics_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("resetStorageWiggleMetrics_impl", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ResetStorageWiggleMetrics_implActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("resetStorageWiggleMetrics_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("resetStorageWiggleMetrics_impl", reinterpret_cast(this), 0); + + } + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + TrType tr; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + KeyBackedObjectProperty metricsProperty; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + Optional metrics; + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +}; +// This generated class is to be used only via resetStorageWiggleMetrics_impl() + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +template + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +class ResetStorageWiggleMetrics_implActor final : public Actor, public ActorCallback< ResetStorageWiggleMetrics_implActor, 0, Void >, public FastAllocated>, public ResetStorageWiggleMetrics_implActorState> { + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ResetStorageWiggleMetrics_implActor, 0, Void >; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + ResetStorageWiggleMetrics_implActor(TrType const& tr,KeyBackedObjectProperty const& metricsProperty,Optional const& metrics) + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + : Actor(), + ResetStorageWiggleMetrics_implActorState>(tr, metricsProperty, metrics) + { + fdb_probe_actor_enter("resetStorageWiggleMetrics_impl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("resetStorageWiggleMetrics_impl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("resetStorageWiggleMetrics_impl", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ResetStorageWiggleMetrics_implActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +template + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +[[nodiscard]] Future resetStorageWiggleMetrics_impl( TrType const& tr, KeyBackedObjectProperty const& metricsProperty, Optional const& metrics ) { + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + return Future(new ResetStorageWiggleMetrics_implActor(tr, metricsProperty, metrics)); + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +} + +#line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +} // namespace + +// After 7.3, the perpetual wiggle related keys should use format "\xff/storageWiggle/[primary | remote]/[fieldName]" +class StorageWiggleData { +protected: + Key prefix; + +public: + struct DataForDc : public KeyBackedClass { + DataForDc(StringRef prefix) : KeyBackedClass(prefix) {} + + auto storageWiggleDelay() const { + auto key = subspace.pack("storageWiggleDelay"_sr); + return KeyBackedObjectProperty(key, IncludeVersion()); + } + }; + + StorageWiggleData() : prefix(perpetualStorageWigglePrefix) {} + + auto perpetualWiggleSpeed() const { return KeyBackedProperty(perpetualStorageWiggleKey); } + + auto wigglingStorageServer(PrimaryRegion primaryDc) const { + Key mapPrefix = perpetualStorageWiggleIDPrefix.withSuffix(primaryDc ? "primary/"_sr : "remote/"_sr); + return KeyBackedObjectMap(mapPrefix, IncludeVersion()); + } + + auto storageWiggleMetrics(PrimaryRegion primaryDc) const { + Key key = perpetualStorageWiggleStatsPrefix.withSuffix(primaryDc ? "primary"_sr : "remote"_sr); + return KeyBackedObjectProperty(key, IncludeVersion()); + } + + DataForDc forDc(PrimaryRegion primaryDc) const { + return DataForDc(primaryDc ? prefix.withSuffix("primary/"_sr) : prefix.withSuffix("remote/"_sr)); + } + + // Persistent the total delay time to the database, and return accumulated delay time. + template + Future addPerpetualWiggleDelay(Reference db, PrimaryRegion primary, double secDelta) { + return runTransaction(db, [=, self = *this](Reference tr) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + + return addPerpetualWiggleDelay_impl(tr, self.forDc(primary).storageWiggleDelay(), secDelta); + }); + } + + // clear the persistent total delay in database + template + Future clearPerpetualWiggleDelay(Reference db, PrimaryRegion primary) { + return runTransaction(db, [=, self = *this](Reference tr) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + self.forDc(primary).storageWiggleDelay().clear(tr); + return Future(Void()); + }); + } + + // set all fields except for smoothed durations to default values. If the metrics is not given, load from system key + // space + template + Future resetStorageWiggleMetrics(TrType tr, + PrimaryRegion primary, + Optional metrics = Optional()) { + return resetStorageWiggleMetrics_impl(tr, storageWiggleMetrics(primary), metrics); + } + + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +// This generated class is to be used only via updateStorageWiggleMetrics_impl() + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +template + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +class UpdateStorageWiggleMetrics_implActorState { + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +public: + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + UpdateStorageWiggleMetrics_implActorState(KeyBackedProperty const& wiggleSpeed,KeyBackedObjectProperty const& storageMetrics,TrType const& tr,StorageWiggleMetrics const& metrics,PrimaryRegion const& primary) + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + : wiggleSpeed(wiggleSpeed), + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + storageMetrics(storageMetrics), + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + tr(tr), + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + metrics(metrics), + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + primary(primary) + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + { + fdb_probe_actor_create("updateStorageWiggleMetrics_impl", reinterpret_cast(this)); + + } + ~UpdateStorageWiggleMetrics_implActorState() + { + fdb_probe_actor_destroy("updateStorageWiggleMetrics_impl", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + StrictFuture> __when_expr_0 = wiggleSpeed.get(tr); + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~UpdateStorageWiggleMetrics_implActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional const& v,int loopDepth) + { + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + if (v.present() && v == "1"_sr) + #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + { + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + storageMetrics.set(tr, metrics); + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + } + else + { + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + CODE_PROBE(true, "Intend to update StorageWiggleMetrics after PW disabled"); + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + } + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateStorageWiggleMetrics_implActorState(); static_cast(this)->destroy(); return 0; } + #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~UpdateStorageWiggleMetrics_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Optional && v,int loopDepth) + { + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + if (v.present() && v == "1"_sr) + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + { + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + storageMetrics.set(tr, metrics); + #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + } + else + { + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + CODE_PROBE(true, "Intend to update StorageWiggleMetrics after PW disabled"); + #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + } + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateStorageWiggleMetrics_implActorState(); static_cast(this)->destroy(); return 0; } + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~UpdateStorageWiggleMetrics_implActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Optional const& v,int loopDepth) + { + loopDepth = a_body1cont1(v, loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && v,int loopDepth) + { + loopDepth = a_body1cont1(std::move(v), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< UpdateStorageWiggleMetrics_implActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< UpdateStorageWiggleMetrics_implActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("updateStorageWiggleMetrics_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateStorageWiggleMetrics_impl", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< UpdateStorageWiggleMetrics_implActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("updateStorageWiggleMetrics_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateStorageWiggleMetrics_impl", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< UpdateStorageWiggleMetrics_implActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("updateStorageWiggleMetrics_impl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("updateStorageWiggleMetrics_impl", reinterpret_cast(this), 0); + + } + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + KeyBackedProperty wiggleSpeed; + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + KeyBackedObjectProperty storageMetrics; + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + TrType tr; + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + StorageWiggleMetrics metrics; + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + PrimaryRegion primary; + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +}; +// This generated class is to be used only via updateStorageWiggleMetrics_impl() + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +template + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +class UpdateStorageWiggleMetrics_implActor final : public Actor, public ActorCallback< UpdateStorageWiggleMetrics_implActor, 0, Optional >, public FastAllocated>, public UpdateStorageWiggleMetrics_implActorState> { + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< UpdateStorageWiggleMetrics_implActor, 0, Optional >; + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + UpdateStorageWiggleMetrics_implActor(KeyBackedProperty const& wiggleSpeed,KeyBackedObjectProperty const& storageMetrics,TrType const& tr,StorageWiggleMetrics const& metrics,PrimaryRegion const& primary) + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" + : Actor(), + UpdateStorageWiggleMetrics_implActorState>(wiggleSpeed, storageMetrics, tr, metrics, primary) + { + fdb_probe_actor_enter("updateStorageWiggleMetrics_impl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("updateStorageWiggleMetrics_impl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("updateStorageWiggleMetrics_impl", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< UpdateStorageWiggleMetrics_implActor, 0, Optional >*)0, actor_cancelled()); break; + } + + } +}; + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +template + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" +[[nodiscard]] static Future updateStorageWiggleMetrics_impl( KeyBackedProperty const& wiggleSpeed, KeyBackedObjectProperty const& storageMetrics, TrType const& tr, StorageWiggleMetrics const& metrics, PrimaryRegion const& primary ) { + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + return Future(new UpdateStorageWiggleMetrics_implActor(wiggleSpeed, storageMetrics, tr, metrics, primary)); + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.g.h" +} + +#line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h" + + // update the serialized metrics when the perpetual wiggle is enabled + template + Future updateStorageWiggleMetrics(TrType tr, StorageWiggleMetrics metrics, PrimaryRegion primary) { + return updateStorageWiggleMetrics_impl( + perpetualWiggleSpeed(), storageWiggleMetrics(primary), tr, metrics, primary); + } +}; + +#include "flow/unactorcompiler.h" +#endif \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h b/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h new file mode 100644 index 0000000..8e68e46 --- /dev/null +++ b/src/fdbclient/include/fdbclient/StorageWiggleMetrics.actor.h @@ -0,0 +1,246 @@ +/* + * StorageWiggleMetrics.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_STORAGEWIGGLEMETRICS_ACTOR_G_H) +#define FDBCLIENT_STORAGEWIGGLEMETRICS_ACTOR_G_H +#include "fdbclient/StorageWiggleMetrics.actor.g.h" +#elif !defined(FDBCLIENT_STORAGEWIGGLEMETRICS_ACTOR_H) +#define FDBCLIENT_STORAGEWIGGLEMETRICS_ACTOR_H + +#include "fdbrpc/Smoother.h" +#include "flow/ObjectSerializer.h" +#include "flow/serialize.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/KeyBackedTypes.actor.h" +#include "fdbclient/RunTransaction.actor.h" +#include "flow/actorcompiler.h" + +FDB_BOOLEAN_PARAM(PrimaryRegion); + +struct StorageWiggleMetrics { + constexpr static FileIdentifier file_identifier = 4728961; + + // round statistics + // One StorageServer wiggle round is considered 'complete', when all StorageServers with creationTime < T are + // wiggled + // Start and finish are in epoch seconds + double last_round_start = 0; + double last_round_finish = 0; + TimerSmoother smoothed_round_duration; + int finished_round = 0; // finished round since storage wiggle is open + + // step statistics + // 1 wiggle step as 1 storage server is wiggled in the current round + // Start and finish are in epoch seconds + double last_wiggle_start = 0; + double last_wiggle_finish = 0; + TimerSmoother smoothed_wiggle_duration; + int finished_wiggle = 0; // finished step since storage wiggle is open + + StorageWiggleMetrics() : smoothed_round_duration(20.0 * 60), smoothed_wiggle_duration(10.0 * 60) {} + + template + void serialize(Ar& ar) { + double step_total, round_total; + if (!ar.isDeserializing) { + step_total = smoothed_wiggle_duration.getTotal(); + round_total = smoothed_round_duration.getTotal(); + } + serializer(ar, + last_wiggle_start, + last_wiggle_finish, + step_total, + finished_wiggle, + last_round_start, + last_round_finish, + round_total, + finished_round); + if (ar.isDeserializing) { + smoothed_round_duration.reset(round_total); + smoothed_wiggle_duration.reset(step_total); + } + } + + StatusObject toJSON() const { + StatusObject result; + result["last_round_start_datetime"] = epochsToGMTString(last_round_start); + result["last_round_finish_datetime"] = epochsToGMTString(last_round_finish); + result["last_round_start_timestamp"] = last_round_start; + result["last_round_finish_timestamp"] = last_round_finish; + result["smoothed_round_seconds"] = smoothed_round_duration.smoothTotal(); + result["finished_round"] = finished_round; + + result["last_wiggle_start_datetime"] = epochsToGMTString(last_wiggle_start); + result["last_wiggle_finish_datetime"] = epochsToGMTString(last_wiggle_finish); + result["last_wiggle_start_timestamp"] = last_wiggle_start; + result["last_wiggle_finish_timestamp"] = last_wiggle_finish; + result["smoothed_wiggle_seconds"] = smoothed_wiggle_duration.smoothTotal(); + result["finished_wiggle"] = finished_wiggle; + return result; + } + + void reset() { + StorageWiggleMetrics newMetrics; + newMetrics.smoothed_round_duration.reset(smoothed_round_duration.getTotal()); + newMetrics.smoothed_wiggle_duration.reset(smoothed_wiggle_duration.getTotal()); + *this = std::move(newMetrics); + } +}; + +struct StorageWiggleDelay { + constexpr static FileIdentifier file_identifier = 102937; + double delaySeconds = 0; + explicit StorageWiggleDelay(double sec = 0) : delaySeconds(sec) {} + + template + void serialize(Ar& ar) { + serializer(ar, delaySeconds); + } +}; + +namespace { +// Persistent the total delay time to the database, and return accumulated delay time. +ACTOR template +Future addPerpetualWiggleDelay_impl( + TrType tr, + KeyBackedObjectProperty delayProperty, + double secDelta) { + + state StorageWiggleDelay delayObj = wait(delayProperty.getD(tr, Snapshot::False)); + delayObj.delaySeconds += secDelta; + delayProperty.set(tr, delayObj); + + return delayObj.delaySeconds; +} + +// set all fields except for smoothed durations to default values. If the metrics is not given, load from system key +// space +ACTOR template +Future resetStorageWiggleMetrics_impl( + TrType tr, + KeyBackedObjectProperty metricsProperty, + Optional metrics) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + if (!metrics.present()) { + wait(store(metrics, metricsProperty.get(tr))); + } + + if (metrics.present()) { + metrics.get().reset(); + metricsProperty.set(tr, metrics.get()); + } + return Void(); +} +} // namespace + +// After 7.3, the perpetual wiggle related keys should use format "\xff/storageWiggle/[primary | remote]/[fieldName]" +class StorageWiggleData { +protected: + Key prefix; + +public: + struct DataForDc : public KeyBackedClass { + DataForDc(StringRef prefix) : KeyBackedClass(prefix) {} + + auto storageWiggleDelay() const { + auto key = subspace.pack("storageWiggleDelay"_sr); + return KeyBackedObjectProperty(key, IncludeVersion()); + } + }; + + StorageWiggleData() : prefix(perpetualStorageWigglePrefix) {} + + auto perpetualWiggleSpeed() const { return KeyBackedProperty(perpetualStorageWiggleKey); } + + auto wigglingStorageServer(PrimaryRegion primaryDc) const { + Key mapPrefix = perpetualStorageWiggleIDPrefix.withSuffix(primaryDc ? "primary/"_sr : "remote/"_sr); + return KeyBackedObjectMap(mapPrefix, IncludeVersion()); + } + + auto storageWiggleMetrics(PrimaryRegion primaryDc) const { + Key key = perpetualStorageWiggleStatsPrefix.withSuffix(primaryDc ? "primary"_sr : "remote"_sr); + return KeyBackedObjectProperty(key, IncludeVersion()); + } + + DataForDc forDc(PrimaryRegion primaryDc) const { + return DataForDc(primaryDc ? prefix.withSuffix("primary/"_sr) : prefix.withSuffix("remote/"_sr)); + } + + // Persistent the total delay time to the database, and return accumulated delay time. + template + Future addPerpetualWiggleDelay(Reference db, PrimaryRegion primary, double secDelta) { + return runTransaction(db, [=, self = *this](Reference tr) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + + return addPerpetualWiggleDelay_impl(tr, self.forDc(primary).storageWiggleDelay(), secDelta); + }); + } + + // clear the persistent total delay in database + template + Future clearPerpetualWiggleDelay(Reference db, PrimaryRegion primary) { + return runTransaction(db, [=, self = *this](Reference tr) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + self.forDc(primary).storageWiggleDelay().clear(tr); + return Future(Void()); + }); + } + + // set all fields except for smoothed durations to default values. If the metrics is not given, load from system key + // space + template + Future resetStorageWiggleMetrics(TrType tr, + PrimaryRegion primary, + Optional metrics = Optional()) { + return resetStorageWiggleMetrics_impl(tr, storageWiggleMetrics(primary), metrics); + } + + ACTOR template + static Future updateStorageWiggleMetrics_impl( + KeyBackedProperty wiggleSpeed, + KeyBackedObjectProperty storageMetrics, + TrType tr, + StorageWiggleMetrics metrics, + PrimaryRegion primary) { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + Optional v = wait(wiggleSpeed.get(tr)); + if (v.present() && v == "1"_sr) { + storageMetrics.set(tr, metrics); + } else { + CODE_PROBE(true, "Intend to update StorageWiggleMetrics after PW disabled"); + } + return Void(); + } + + // update the serialized metrics when the perpetual wiggle is enabled + template + Future updateStorageWiggleMetrics(TrType tr, StorageWiggleMetrics metrics, PrimaryRegion primary) { + return updateStorageWiggleMetrics_impl( + perpetualWiggleSpeed(), storageWiggleMetrics(primary), tr, metrics, primary); + } +}; + +#include "flow/unactorcompiler.h" +#endif \ No newline at end of file diff --git a/src/fdbclient/Subspace.h b/src/fdbclient/include/fdbclient/Subspace.h similarity index 95% rename from src/fdbclient/Subspace.h rename to src/fdbclient/include/fdbclient/Subspace.h index ef88fc3..0cc8508 100644 --- a/src/fdbclient/Subspace.h +++ b/src/fdbclient/include/fdbclient/Subspace.h @@ -42,9 +42,7 @@ class Subspace { template Key pack(T const& item) const { - Tuple t; - t.append(item); - return pack(t); + return pack(Tuple::makeTuple(item)); } Key pack(StringRef const& item, bool utf8 = false) const { @@ -58,9 +56,7 @@ class Subspace { template Subspace get(T const& item) const { - Tuple t; - t.append(item); - return get(t); + return get(Tuple::makeTuple(item)); } Subspace get(StringRef const& item, bool utf8 = false) const { diff --git a/src/fdbclient/SystemData.h b/src/fdbclient/include/fdbclient/SystemData.h similarity index 75% rename from src/fdbclient/SystemData.h rename to src/fdbclient/include/fdbclient/SystemData.h index 4069c68..27508a1 100644 --- a/src/fdbclient/SystemData.h +++ b/src/fdbclient/include/fdbclient/SystemData.h @@ -25,14 +25,25 @@ // Functions and constants documenting the organization of the reserved keyspace in the database beginning with "\xFF" #include "fdbclient/FDBTypes.h" +#include "fdbclient/BlobGranuleCommon.h" #include "fdbclient/BlobWorkerInterface.h" // TODO move the functions that depend on this out of here and into BlobWorkerInterface.h to remove this depdendency #include "fdbclient/StorageServerInterface.h" -#include "Tenant.h" +#include "fdbclient/Tenant.h" // Don't warn on constants being defined in this file. #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-variable" +FDB_BOOLEAN_PARAM(AssignEmptyRange); +FDB_BOOLEAN_PARAM(UnassignShard); +FDB_BOOLEAN_PARAM(EnablePhysicalShardMove); + +// SystemKey is just a Key but with a special type so that instances of it can be found easily throughput the code base +// and in simulation constructions will verify that no SystemKey is a direct prefix of any other. +struct SystemKey : Key { + SystemKey(Key const& k); +}; + struct RestoreLoaderInterface; struct RestoreApplierInterface; struct RestoreMasterInterface; @@ -49,14 +60,27 @@ extern const KeyRef afterAllKeys; // An internal mapping of where shards are located in the database. [[begin]] is the start of the shard range // and the result is a list of serverIDs or Tags where these shards are located. These values can be changed // as data movement occurs. +// With ShardEncodeLocationMetaData, the encoding format is: +// "\xff/keyServers/[[begin]]" := "[[std::vector, std::vector], srcID, destID]", where srcID +// and destID are the source and destination `shard id`, respectively. extern const KeyRangeRef keyServersKeys, keyServersKeyServersKeys; extern const KeyRef keyServersPrefix, keyServersEnd, keyServersKeyServersKey; + +// Used during the transition to the new location metadata format with shard IDs. +// If `SHARD_ENCODE_LOCATION_METADATA` is enabled, any shard that doesn't have a shard ID will be assigned this +// temporary ID, until a permanent ID is assigned to it. +extern const UID anonymousShardId; +extern const uint64_t assignedEmptyShardId; const Key keyServersKey(const KeyRef& k); const KeyRef keyServersKey(const KeyRef& k, Arena& arena); const Value keyServersValue(RangeResult result, const std::vector& src, const std::vector& dest = std::vector()); const Value keyServersValue(const std::vector& srcTag, const std::vector& destTag = std::vector()); +const Value keyServersValue(const std::vector& src, + const std::vector& dest, + const UID& srcID, + const UID& destID); // `result` must be the full result of getting serverTagKeys void decodeKeyServersValue(RangeResult result, const ValueRef& value, @@ -67,8 +91,37 @@ void decodeKeyServersValue(std::map const& tag_uid, const ValueRef& value, std::vector& src, std::vector& dest); - -extern const KeyRef clusterIdKey; +void decodeKeyServersValue(RangeResult result, + const ValueRef& value, + std::vector& src, + std::vector& dest, + UID& srcID, + UID& destID, + bool missingIsError = true); +bool isSystemKey(KeyRef key); + +extern const KeyRangeRef auditKeys; +extern const KeyRef auditPrefix; +extern const KeyRangeRef auditRanges; +extern const KeyRef auditRangePrefix; + +// Key for a particular audit +const Key auditKey(const AuditType type, const UID& auditId); +// KeyRange for whole audit +const KeyRange auditKeyRange(const AuditType type); +// Prefix for audit work progress by range +const Key auditRangeBasedProgressPrefixFor(const AuditType type, const UID& auditId); +// Range for audit work progress by range +const KeyRange auditRangeBasedProgressRangeFor(const AuditType type, const UID& auditId); +const KeyRange auditRangeBasedProgressRangeFor(const AuditType type); +// Prefix for audit work progress by server +const Key auditServerBasedProgressPrefixFor(const AuditType type, const UID& auditId, const UID& serverId); +// Range for audit work progress by server +const KeyRange auditServerBasedProgressRangeFor(const AuditType type, const UID& auditId); +const KeyRange auditServerBasedProgressRangeFor(const AuditType type); + +const Value auditStorageStateValue(const AuditStorageState& auditStorageState); +AuditStorageState decodeAuditStorageState(const ValueRef& value); // "\xff/checkpoint/[[UID]] := [[CheckpointMetaData]]" extern const KeyRef checkpointPrefix; @@ -77,6 +130,13 @@ const Value checkpointValue(const CheckpointMetaData& checkpoint); UID decodeCheckpointKey(const KeyRef& key); CheckpointMetaData decodeCheckpointValue(const ValueRef& value); +// "\xff/dataMoves/[[UID]] := [[DataMoveMetaData]]" +extern const KeyRangeRef dataMoveKeys; +const Key dataMoveKeyFor(UID dataMoveId); +const Value dataMoveValue(const DataMoveMetaData& dataMove); +UID decodeDataMoveKey(const KeyRef& key); +DataMoveMetaData decodeDataMoveValue(const ValueRef& value); + // "\xff/storageCacheServer/[[UID]] := StorageServerInterface" // This will be added by the cache server on initialization and removed by DD // TODO[mpilman]: We will need a way to map uint16_t ids to UIDs in a future @@ -99,12 +159,25 @@ void decodeStorageCacheValue(const ValueRef& value, std::vector& serve // Using the serverID as a prefix, then followed by the beginning of the shard range // as the key, the value indicates whether the shard does or does not exist on the server. // These values can be changed as data movement occurs. +extern const KeyRangeRef serverKeysRange; extern const KeyRef serverKeysPrefix; extern const ValueRef serverKeysTrue, serverKeysTrueEmptyRange, serverKeysFalse; +const UID newDataMoveId(const uint64_t physicalShardId, + AssignEmptyRange assignEmptyRange, + EnablePhysicalShardMove enablePSM = EnablePhysicalShardMove::False, + UnassignShard unassignShard = UnassignShard::False); const Key serverKeysKey(UID serverID, const KeyRef& keys); const Key serverKeysPrefixFor(UID serverID); UID serverKeysDecodeServer(const KeyRef& key); +std::pair serverKeysDecodeServerBegin(const KeyRef& key); bool serverHasKey(ValueRef storedValue); +const Value serverKeysValue(const UID& id); +void decodeServerKeysValue(const ValueRef& value, + bool& assigned, + bool& emptyRange, + EnablePhysicalShardMove& enablePSM, + UID& id); +bool physicalShardMoveEnabled(const UID& dataMoveId); extern const KeyRangeRef conflictingKeysRange; extern const ValueRef conflictingKeysTrue, conflictingKeysFalse; @@ -125,6 +198,9 @@ extern const KeyRef cacheChangePrefix; const Key cacheChangeKeyFor(uint16_t idx); uint16_t cacheChangeKeyDecodeIndex(const KeyRef& key); +// For persisting the consistency scan configuration and metrics +extern const KeyRef consistencyScanInfoKey; + // "\xff/tss/[[serverId]]" := "[[tssId]]" extern const KeyRangeRef tssMappingKeys; @@ -143,6 +219,12 @@ extern const KeyRangeRef tssMismatchKeys; // Note: storageInterfaceUID is the one stated in the file name extern const KeyRangeRef serverMetadataKeys; +// Any update to serverMetadataKeys will update this key to a random UID. +extern const KeyRef serverMetadataChangeKey; + +UID decodeServerMetadataKey(const KeyRef&); +StorageMetadataType decodeServerMetadataValue(const KeyRef&); + // "\xff/serverTag/[[serverID]]" = "[[Tag]]" // Provides the Tag for the given serverID. Used to access a // storage server's corresponding TLog in order to apply mutations. @@ -205,6 +287,9 @@ const Value serverListValue(StorageServerInterface const&); UID decodeServerListKey(KeyRef const&); StorageServerInterface decodeServerListValue(ValueRef const&); +Value swVersionValue(SWVersion const& swversion); +SWVersion decodeSWVersionValue(ValueRef const&); + // "\xff/processClass/[[processID]]" := "[[ProcessClass]]" // Contains a mapping from processID to processClass extern const KeyRangeRef processClassKeys; @@ -228,10 +313,17 @@ extern const KeyRef perpetualStorageWiggleKey; extern const KeyRef perpetualStorageWiggleLocalityKey; extern const KeyRef perpetualStorageWiggleIDPrefix; extern const KeyRef perpetualStorageWiggleStatsPrefix; +extern const KeyRef perpetualStorageWigglePrefix; // Change the value of this key to anything and that will trigger detailed data distribution team info log. extern const KeyRef triggerDDTeamInfoPrintKey; +// Encryption data at-rest config key +extern const KeyRef encryptionAtRestModeConfKey; + +// Tenant mode config key +extern const KeyRef tenantModeConfKey; + // The differences between excluded and failed can be found in "command-line-interface.rst" // and in the help message of the fdbcli command "exclude". @@ -333,6 +425,12 @@ std::vector> decodeBackupStartedValue(const ValueRef& va // 1 = Send a signal to pause/already paused. extern const KeyRef backupPausedKey; +// "\xff/previousCoordinators" = "[[ClusterConnectionString]]" +// Set to the encoded structure of the cluster's previous set of coordinators. +// Changed when performing quorumChange. +// See "CoordinationInterface.h" struct ClusterConnectionString for more details +extern const KeyRef previousCoordinatorsKey; + // "\xff/coordinators" = "[[ClusterConnectionString]]" // Set to the encoded structure of the cluster's current set of coordinators. // Changed when performing quorumChange. @@ -362,6 +460,8 @@ std::pair>, std::vector decodeHealthyZoneValue(ValueRef const&); @@ -533,6 +643,22 @@ std::pair decodeChangeFeedDurableKey(ValueRef const& key); const Value changeFeedDurableValue(Standalone> const& mutations, Version knownCommittedVersion); std::pair>, Version> decodeChangeFeedDurableValue(ValueRef const& value); +extern const KeyRangeRef changeFeedCacheKeys; +extern const KeyRef changeFeedCachePrefix; + +const Value changeFeedCacheKey(Key const& prefix, Key const& feed, KeyRange const& range, Version version); +std::tuple decodeChangeFeedCacheKey(Key const& prefix, ValueRef const& key); +const Value changeFeedCacheValue(Standalone> const& mutations); +Standalone> decodeChangeFeedCacheValue(ValueRef const& value); + +extern const KeyRangeRef changeFeedCacheFeedKeys; +extern const KeyRef changeFeedCacheFeedPrefix; + +const Value changeFeedCacheFeedKey(Key const& prefix, Key const& feed, KeyRange const& range); +std::tuple decodeChangeFeedCacheFeedKey(ValueRef const& key); +const Value changeFeedCacheFeedValue(Version const& version, Version const& popped); +std::pair decodeChangeFeedCacheFeedValue(ValueRef const& value); + // Configuration database special keys extern const KeyRef configTransactionDescriptionKey; extern const KeyRange globalConfigKnobKeys; @@ -542,12 +668,21 @@ extern const KeyRangeRef configClassKeys; // blob range special keys extern const KeyRef blobRangeChangeKey; extern const KeyRangeRef blobRangeKeys; +extern const KeyRangeRef blobRangeChangeLogKeys; extern const KeyRef blobManagerEpochKey; const Value blobManagerEpochValueFor(int64_t epoch); int64_t decodeBlobManagerEpochValue(ValueRef const& value); // blob granule keys +extern const StringRef blobRangeActive; +extern const StringRef blobRangeInactive; + +bool isBlobRangeActive(const ValueRef& blobRangeValue); + +const Key blobRangeChangeLogReadKeyFor(Version version); +const Value blobRangeChangeLogValueFor(const Standalone& value); +Standalone decodeBlobRangeChangeLogValue(ValueRef const& value); extern const uint8_t BG_FILE_TYPE_DELTA; extern const uint8_t BG_FILE_TYPE_SNAPSHOT; @@ -555,7 +690,6 @@ extern const uint8_t BG_FILE_TYPE_SNAPSHOT; // FIXME: flip order of {filetype, version} // \xff\x02/bgf/(granuleUID, {snapshot|delta}, fileVersion) = [[filename]] extern const KeyRangeRef blobGranuleFileKeys; - // \xff\x02/bgm/[[beginKey]] = [[BlobWorkerUID]] extern const KeyRangeRef blobGranuleMappingKeys; @@ -565,20 +699,34 @@ extern const KeyRangeRef blobGranuleLockKeys; // \xff\x02/bgs/(parentGranuleUID, granuleUID) = [[BlobGranuleSplitState]] extern const KeyRangeRef blobGranuleSplitKeys; +// \xff\x02/bgmerge/mergeGranuleId = [[BlobGranuleMergeState]] +extern const KeyRangeRef blobGranuleMergeKeys; + +// \xff\x02/bgmergebounds/beginkey = [[BlobGranuleMergeBoundary]] +extern const KeyRangeRef blobGranuleMergeBoundaryKeys; + // \xff\x02/bgh/(beginKey,endKey,startVersion) = { granuleUID, [parentGranuleHistoryKeys] } extern const KeyRangeRef blobGranuleHistoryKeys; // \xff\x02/bgp/(start,end) = (version, force) extern const KeyRangeRef blobGranulePurgeKeys; -extern const KeyRangeRef blobGranuleVersionKeys; +// \xff\x02/bgpforce/(start) = {1|0} (key range map) +extern const KeyRangeRef blobGranuleForcePurgedKeys; extern const KeyRef blobGranulePurgeChangeKey; const Key blobGranuleFileKeyFor(UID granuleID, Version fileVersion, uint8_t fileType); std::tuple decodeBlobGranuleFileKey(KeyRef const& key); const KeyRange blobGranuleFileKeyRangeFor(UID granuleID); -const Value blobGranuleFileValueFor(StringRef const& filename, int64_t offset, int64_t length, int64_t fullFileLength); -std::tuple, int64_t, int64_t, int64_t> decodeBlobGranuleFileValue(ValueRef const& value); +const Value blobGranuleFileValueFor( + StringRef const& filename, + int64_t offset, + int64_t length, + int64_t fullFileLength, + int64_t logicalSize, + Optional cipherKeysMeta = Optional()); +std::tuple, int64_t, int64_t, int64_t, int64_t, Optional> +decodeBlobGranuleFileValue(ValueRef const& value); const Value blobGranulePurgeValueFor(Version version, KeyRange range, bool force); std::tuple decodeBlobGranulePurgeValue(ValueRef const& value); @@ -595,10 +743,26 @@ const Key blobGranuleSplitKeyFor(UID const& parentGranuleID, UID const& granuleI std::pair decodeBlobGranuleSplitKey(KeyRef const& key); const KeyRange blobGranuleSplitKeyRangeFor(UID const& parentGranuleID); +const Key blobGranuleMergeKeyFor(UID const& mergeGranuleID); +UID decodeBlobGranuleMergeKey(KeyRef const& key); + // these are versionstamped const Value blobGranuleSplitValueFor(BlobGranuleSplitState st); std::pair decodeBlobGranuleSplitValue(ValueRef const& value); +const Value blobGranuleMergeValueFor(KeyRange mergeKeyRange, + std::vector parentGranuleIDs, + std::vector parentGranuleRanges, + std::vector parentGranuleStartVersions); +// FIXME: probably just define object type for this? +std::tuple, std::vector, std::vector> decodeBlobGranuleMergeValue( + ValueRef const& value); + +// BlobGranuleMergeBoundary. +const Key blobGranuleMergeBoundaryKeyFor(const KeyRef& key); +const Value blobGranuleMergeBoundaryValueFor(BlobGranuleMergeBoundary const& boundary); +Standalone decodeBlobGranuleMergeBoundaryValue(const ValueRef& value); + const Key blobGranuleHistoryKeyFor(KeyRangeRef const& range, Version version); std::pair decodeBlobGranuleHistoryKey(KeyRef const& key); const KeyRange blobGranuleHistoryKeyRangeFor(KeyRangeRef const& range); @@ -614,15 +778,30 @@ UID decodeBlobWorkerListKey(KeyRef const& key); const Value blobWorkerListValue(BlobWorkerInterface const& interface); BlobWorkerInterface decodeBlobWorkerListValue(ValueRef const& value); -// State for the tenant map -extern const KeyRangeRef tenantMapKeys; -extern const KeyRef tenantMapPrefix; -extern const KeyRef tenantMapPrivatePrefix; -extern const KeyRef tenantLastIdKey; -extern const KeyRef tenantDataPrefixKey; - -Value encodeTenantEntry(TenantMapEntry const& tenantEntry); -TenantMapEntry decodeTenantEntry(ValueRef const& value); +// \xff/bwa/[[BlobWorkerID]] = [[UID]] +extern const KeyRangeRef blobWorkerAffinityKeys; + +const Key blobWorkerAffinityKeyFor(UID workerID); +UID decodeBlobWorkerAffinityKey(KeyRef const& key); +const Value blobWorkerAffinityValue(UID const& id); +UID decodeBlobWorkerAffinityValue(ValueRef const& value); + +// Blob restore command +extern const KeyRangeRef blobRestoreCommandKeys; +const Value blobRestoreCommandKeyFor(const KeyRangeRef range); +const KeyRange decodeBlobRestoreCommandKeyFor(const KeyRef key); +const Value blobRestoreCommandValueFor(BlobRestoreState restoreState); +Standalone decodeBlobRestoreState(ValueRef const& value); +extern const KeyRangeRef blobRestoreArgKeys; +const Value blobRestoreArgKeyFor(const KeyRangeRef range); +const KeyRange decodeBlobRestoreArgKeyFor(const KeyRef key); +const Value blobRestoreArgValueFor(BlobRestoreArg args); +Standalone decodeBlobRestoreArg(ValueRef const& value); +extern const Key blobManifestVersionKey; +extern const Key blobGranulesLastFlushKey; + +extern const KeyRangeRef idempotencyIdKeys; +extern const KeyRef idempotencyIdsExpiredVersion; #pragma clang diagnostic pop diff --git a/src/fdbclient/TagThrottle.actor.g.h b/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h similarity index 58% rename from src/fdbclient/TagThrottle.actor.g.h rename to src/fdbclient/include/fdbclient/TagThrottle.actor.g.h index 7672211..fcbc8ca 100644 --- a/src/fdbclient/TagThrottle.actor.g.h +++ b/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" /* * TagThrottle.actor.h * @@ -42,8 +42,8 @@ typedef StringRef TransactionTagRef; typedef Standalone TransactionTag; -FDB_DECLARE_BOOLEAN_PARAM(ContainsRecommended); -FDB_DECLARE_BOOLEAN_PARAM(Capitalize); +FDB_BOOLEAN_PARAM(ContainsRecommended); +FDB_BOOLEAN_PARAM(Capitalize); class TagSet { public: @@ -209,6 +209,8 @@ struct ClientTagThrottleLimits { double tpsRate; double expiration; + static double const NO_EXPIRATION; + ClientTagThrottleLimits() : tpsRate(0), expiration(0) {} ClientTagThrottleLimits(double tpsRate, double expiration) : tpsRate(tpsRate), expiration(expiration) {} @@ -253,22 +255,22 @@ namespace ThrottleApi { // The template functions can be called with Native API like DatabaseContext, Transaction/ReadYourWritesTransaction // or using IClientAPI like IDatabase, ITransaction - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" // This generated class is to be used only via getValidAutoEnabled() - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" class GetValidAutoEnabledActorState { - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" GetValidAutoEnabledActorState(Reference const& tr) - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" : tr(tr), - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - result() - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + valueF(tr->get(tagThrottleAutoEnabledKey)) + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { fdb_probe_actor_create("getValidAutoEnabled", reinterpret_cast(this)); @@ -281,10 +283,17 @@ class GetValidAutoEnabledActorState { int a_body1(int loopDepth=0) { try { - #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - ; - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - loopDepth = a_body1loopHead1(loopDepth); + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + StrictFuture> __when_expr_0 = safeThreadFutureToFuture(valueF); + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + loopDepth = 0; } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -302,170 +311,133 @@ class GetValidAutoEnabledActorState { return loopDepth; } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) + int a_body1cont1(Optional const& value,int loopDepth) { - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - valueF = tr->get(tagThrottleAutoEnabledKey); - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - StrictFuture> __when_expr_0 = safeThreadFutureToFuture(valueF); - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont1(Optional const& value,int loopDepth) - { - #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!value.present()) - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - tr->reset(); - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - StrictFuture __when_expr_1 = delay(CLIENT_KNOBS->DEFAULT_BACKOFF); - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - loopDepth = 0; + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)({}); this->~GetValidAutoEnabledActorState(); static_cast(this)->destroy(); return 0; } + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional({}); + this->~GetValidAutoEnabledActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } else { - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (value.get() == LiteralStringRef("1")) - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (value.get() == "1"_sr) + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - result = true; - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - loopDepth = a_body1loopBody1cont5(loopDepth); + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(true); this->~GetValidAutoEnabledActorState(); static_cast(this)->destroy(); return 0; } + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(true); + this->~GetValidAutoEnabledActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } else { - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (value.get() == LiteralStringRef("0")) - #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (value.get() == "0"_sr) + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - result = false; - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - loopDepth = a_body1loopBody1cont7(loopDepth); + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(false); this->~GetValidAutoEnabledActorState(); static_cast(this)->destroy(); return 0; } + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(false); + this->~GetValidAutoEnabledActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } else { - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" TraceEvent(SevWarnAlways, "InvalidAutoTagThrottlingValue").detail("Value", value.get()); - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - tr->reset(); - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->DEFAULT_BACKOFF); - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when2(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - loopDepth = 0; + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)({}); this->~GetValidAutoEnabledActorState(); static_cast(this)->destroy(); return 0; } + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional({}); + this->~GetValidAutoEnabledActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } } } return loopDepth; } - int a_body1loopBody1cont1(Optional && value,int loopDepth) + int a_body1cont1(Optional && value,int loopDepth) { - #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!value.present()) - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - tr->reset(); - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - StrictFuture __when_expr_1 = delay(CLIENT_KNOBS->DEFAULT_BACKOFF); - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - loopDepth = 0; + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)({}); this->~GetValidAutoEnabledActorState(); static_cast(this)->destroy(); return 0; } + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional({}); + this->~GetValidAutoEnabledActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } else { - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (value.get() == LiteralStringRef("1")) - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (value.get() == "1"_sr) + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - result = true; - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - loopDepth = a_body1loopBody1cont5(loopDepth); + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(true); this->~GetValidAutoEnabledActorState(); static_cast(this)->destroy(); return 0; } + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(true); + this->~GetValidAutoEnabledActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } else { - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (value.get() == LiteralStringRef("0")) - #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (value.get() == "0"_sr) + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - result = false; - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - loopDepth = a_body1loopBody1cont7(loopDepth); + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(false); this->~GetValidAutoEnabledActorState(); static_cast(this)->destroy(); return 0; } + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(false); + this->~GetValidAutoEnabledActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } else { - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" TraceEvent(SevWarnAlways, "InvalidAutoTagThrottlingValue").detail("Value", value.get()); - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - tr->reset(); - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - StrictFuture __when_expr_2 = delay(CLIENT_KNOBS->DEFAULT_BACKOFF); - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when2(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - loopDepth = 0; + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)({}); this->~GetValidAutoEnabledActorState(); static_cast(this)->destroy(); return 0; } + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional({}); + this->~GetValidAutoEnabledActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; } } } return loopDepth; } - int a_body1loopBody1when1(Optional const& value,int loopDepth) + int a_body1when1(Optional const& value,int loopDepth) { - loopDepth = a_body1loopBody1cont1(value, loopDepth); + loopDepth = a_body1cont1(value, loopDepth); return loopDepth; } - int a_body1loopBody1when1(Optional && value,int loopDepth) + int a_body1when1(Optional && value,int loopDepth) { - loopDepth = a_body1loopBody1cont1(std::move(value), loopDepth); + loopDepth = a_body1cont1(std::move(value), loopDepth); return loopDepth; } @@ -480,7 +452,7 @@ class GetValidAutoEnabledActorState { fdb_probe_actor_enter("getValidAutoEnabled", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(value, 0); + a_body1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -495,7 +467,7 @@ class GetValidAutoEnabledActorState { fdb_probe_actor_enter("getValidAutoEnabled", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -520,208 +492,30 @@ class GetValidAutoEnabledActorState { fdb_probe_actor_exit("getValidAutoEnabled", reinterpret_cast(this), 0); } - int a_body1loopBody1cont2(int loopDepth) - { - #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(result); this->~GetValidAutoEnabledActorState(); static_cast(this)->destroy(); return 0; } - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - new (&static_cast(this)->SAV< bool >::value()) bool(std::move(result)); // state_var_RVO - this->~GetValidAutoEnabledActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1loopBody1cont3(Void const& _,int loopDepth) - { - return a_body1loopHead1(loopDepth); // continue - - return loopDepth; - } - int a_body1loopBody1cont3(Void && _,int loopDepth) - { - return a_body1loopHead1(loopDepth); // continue - - return loopDepth; - } - int a_body1loopBody1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetValidAutoEnabledActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GetValidAutoEnabledActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("getValidAutoEnabled", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getValidAutoEnabled", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< GetValidAutoEnabledActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("getValidAutoEnabled", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1loopBody1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getValidAutoEnabled", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< GetValidAutoEnabledActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("getValidAutoEnabled", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getValidAutoEnabled", reinterpret_cast(this), 1); - - } - int a_body1loopBody1cont5(int loopDepth) - { - loopDepth = a_body1loopBody1cont2(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont7(int loopDepth) - { - loopDepth = a_body1loopBody1cont5(loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont9(Void const& _,int loopDepth) - { - return a_body1loopHead1(loopDepth); // continue - - return loopDepth; - } - int a_body1loopBody1cont9(Void && _,int loopDepth) - { - return a_body1loopHead1(loopDepth); // continue - - return loopDepth; - } - int a_body1loopBody1cont1when2(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont9(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1cont1when2(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont9(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetValidAutoEnabledActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< GetValidAutoEnabledActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("getValidAutoEnabled", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont1when2(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getValidAutoEnabled", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< GetValidAutoEnabledActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("getValidAutoEnabled", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1loopBody1cont1when2(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getValidAutoEnabled", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< GetValidAutoEnabledActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("getValidAutoEnabled", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("getValidAutoEnabled", reinterpret_cast(this), 2); - - } - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Reference tr; - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - bool result; - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" typename Tr::template FutureT> valueF; - #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" }; // This generated class is to be used only via getValidAutoEnabled() - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" -class GetValidAutoEnabledActor final : public Actor, public ActorCallback< GetValidAutoEnabledActor, 0, Optional >, public ActorCallback< GetValidAutoEnabledActor, 1, Void >, public ActorCallback< GetValidAutoEnabledActor, 2, Void >, public FastAllocated>, public GetValidAutoEnabledActorState> { - #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" +class GetValidAutoEnabledActor final : public Actor>, public ActorCallback< GetValidAutoEnabledActor, 0, Optional >, public FastAllocated>, public GetValidAutoEnabledActorState> { + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetValidAutoEnabledActor, 0, Optional >; -friend struct ActorCallback< GetValidAutoEnabledActor, 1, Void >; -friend struct ActorCallback< GetValidAutoEnabledActor, 2, Void >; - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" GetValidAutoEnabledActor(Reference const& tr) - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - : Actor(), + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + : Actor>(), GetValidAutoEnabledActorState>(tr) { fdb_probe_actor_enter("getValidAutoEnabled", reinterpret_cast(this), -1); @@ -739,41 +533,39 @@ friend struct ActorCallback< GetValidAutoEnabledActor, 2, Void >; this->actor_wait_state = -1; switch (wait_state) { case 1: this->a_callback_error((ActorCallback< GetValidAutoEnabledActor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetValidAutoEnabledActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< GetValidAutoEnabledActor, 2, Void >*)0, actor_cancelled()); break; } } }; - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" -[[nodiscard]] Future getValidAutoEnabled( Reference const& tr ) { - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - return Future(new GetValidAutoEnabledActor(tr)); - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" +[[nodiscard]] Future> getValidAutoEnabled( Reference const& tr ) { + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + return Future>(new GetValidAutoEnabledActor(tr)); + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } -#line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" +#line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" // This generated class is to be used only via getRecommendedTags() - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" class GetRecommendedTagsActorState { - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" GetRecommendedTagsActorState(Reference const& db,int const& limit) - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" : db(db), - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" limit(limit), - #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr(db->createTransaction()) - #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { fdb_probe_actor_create("getRecommendedTags", reinterpret_cast(this)); @@ -786,9 +578,9 @@ class GetRecommendedTagsActorState { int a_body1(int loopDepth=0) { try { - #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" ; - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -816,20 +608,19 @@ class GetRecommendedTagsActorState { } int a_body1loopBody1(int loopDepth) { - #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" try { - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - StrictFuture __when_expr_0 = getValidAutoEnabled(tr); - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + StrictFuture> __when_expr_0 = getValidAutoEnabled(tr); + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -849,16 +640,16 @@ class GetRecommendedTagsActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->onError(e)); - #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + StrictFuture __when_expr_3 = safeThreadFutureToFuture(tr->onError(e)); + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -869,73 +660,91 @@ class GetRecommendedTagsActorState { return loopDepth; } - int a_body1loopBody1cont2(bool const& enableAuto,int loopDepth) + int a_body1loopBody1cont2(Optional const& enableAuto,int loopDepth) { - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (enableAuto) - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!enableAuto.present()) + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(std::vector()); this->~GetRecommendedTagsActorState(); static_cast(this)->destroy(); return 0; } - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::vector()); - this->~GetRecommendedTagsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + tr->reset(); + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + StrictFuture __when_expr_1 = delay(CLIENT_KNOBS->DEFAULT_BACKOFF); + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + loopDepth = 0; + } + else + { + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (enableAuto.get()) + #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + { + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(std::vector()); this->~GetRecommendedTagsActorState(); static_cast(this)->destroy(); return 0; } + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::vector()); + this->~GetRecommendedTagsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1loopBody1cont3(loopDepth); } - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - f = tr->getRange(KeyRangeRef(tagThrottleAutoKeysPrefix, tagThrottleKeys.end), limit); - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - StrictFuture __when_expr_1 = safeThreadFutureToFuture(f); - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont2(bool && enableAuto,int loopDepth) + int a_body1loopBody1cont2(Optional && enableAuto,int loopDepth) { - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (enableAuto) - #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!enableAuto.present()) + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(std::vector()); this->~GetRecommendedTagsActorState(); static_cast(this)->destroy(); return 0; } - #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::vector()); - this->~GetRecommendedTagsActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + tr->reset(); + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + StrictFuture __when_expr_1 = delay(CLIENT_KNOBS->DEFAULT_BACKOFF); + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + loopDepth = 0; + } + else + { + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (enableAuto.get()) + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + { + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(std::vector()); this->~GetRecommendedTagsActorState(); static_cast(this)->destroy(); return 0; } + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::vector()); + this->~GetRecommendedTagsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + loopDepth = a_body1loopBody1cont3(loopDepth); } - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - f = tr->getRange(KeyRangeRef(tagThrottleAutoKeysPrefix, tagThrottleKeys.end), limit); - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - StrictFuture __when_expr_1 = safeThreadFutureToFuture(f); - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - loopDepth = 0; return loopDepth; } - int a_body1loopBody1when1(bool const& enableAuto,int loopDepth) + int a_body1loopBody1when1(Optional const& enableAuto,int loopDepth) { loopDepth = a_body1loopBody1cont2(enableAuto, loopDepth); return loopDepth; } - int a_body1loopBody1when1(bool && enableAuto,int loopDepth) + int a_body1loopBody1when1(Optional && enableAuto,int loopDepth) { loopDepth = a_body1loopBody1cont2(std::move(enableAuto), loopDepth); @@ -944,10 +753,10 @@ class GetRecommendedTagsActorState { void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRecommendedTagsActor, 0, bool >::remove(); + static_cast(this)->ActorCallback< GetRecommendedTagsActor, 0, Optional >::remove(); } - void a_callback_fire(ActorCallback< GetRecommendedTagsActor, 0, bool >*,bool const& value) + void a_callback_fire(ActorCallback< GetRecommendedTagsActor, 0, Optional >*,Optional const& value) { fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 0); a_exitChoose1(); @@ -962,7 +771,7 @@ class GetRecommendedTagsActorState { fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< GetRecommendedTagsActor, 0, bool >*,bool && value) + void a_callback_fire(ActorCallback< GetRecommendedTagsActor, 0, Optional >*,Optional && value) { fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 0); a_exitChoose1(); @@ -977,7 +786,7 @@ class GetRecommendedTagsActorState { fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< GetRecommendedTagsActor, 0, bool >*,Error err) + void a_callback_error(ActorCallback< GetRecommendedTagsActor, 0, Optional >*,Error err) { fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 0); a_exitChoose1(); @@ -992,19 +801,112 @@ class GetRecommendedTagsActorState { fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 0); } - int a_body1loopBody1cont3(RangeResult const& throttles,int loopDepth) + int a_body1loopBody1cont3(int loopDepth) + { + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + f = tr->getRange(KeyRangeRef(tagThrottleAutoKeysPrefix, tagThrottleKeys.end), limit); + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + StrictFuture __when_expr_2 = safeThreadFutureToFuture(f); + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont4(Void const& _,int loopDepth) + { + return a_body1loopHead1(loopDepth); // continue + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + return a_body1loopHead1(loopDepth); // continue + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetRecommendedTagsActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetRecommendedTagsActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetRecommendedTagsActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetRecommendedTagsActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont8(RangeResult const& throttles,int loopDepth) { - #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" std::vector results; - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" for( auto throttle : throttles ) { - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" results.push_back(TagThrottleInfo(TagThrottleKey::fromKey(throttle.key), TagThrottleValue::fromValue(throttle.value))); - #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~GetRecommendedTagsActorState(); static_cast(this)->destroy(); return 0; } - #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); this->~GetRecommendedTagsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1012,19 +914,19 @@ class GetRecommendedTagsActorState { return loopDepth; } - int a_body1loopBody1cont3(RangeResult && throttles,int loopDepth) + int a_body1loopBody1cont8(RangeResult && throttles,int loopDepth) { - #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" std::vector results; - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" for( auto throttle : throttles ) { - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" results.push_back(TagThrottleInfo(TagThrottleKey::fromKey(throttle.key), TagThrottleValue::fromValue(throttle.value))); - #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~GetRecommendedTagsActorState(); static_cast(this)->destroy(); return 0; } - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); this->~GetRecommendedTagsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1032,58 +934,58 @@ class GetRecommendedTagsActorState { return loopDepth; } - int a_body1loopBody1cont2when1(RangeResult const& throttles,int loopDepth) + int a_body1loopBody1cont3when1(RangeResult const& throttles,int loopDepth) { - loopDepth = a_body1loopBody1cont3(throttles, loopDepth); + loopDepth = a_body1loopBody1cont8(throttles, loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(RangeResult && throttles,int loopDepth) + int a_body1loopBody1cont3when1(RangeResult && throttles,int loopDepth) { - loopDepth = a_body1loopBody1cont3(std::move(throttles), loopDepth); + loopDepth = a_body1loopBody1cont8(std::move(throttles), loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose3() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRecommendedTagsActor, 1, RangeResult >::remove(); + static_cast(this)->ActorCallback< GetRecommendedTagsActor, 2, RangeResult >::remove(); } - void a_callback_fire(ActorCallback< GetRecommendedTagsActor, 1, RangeResult >*,RangeResult const& value) + void a_callback_fire(ActorCallback< GetRecommendedTagsActor, 2, RangeResult >*,RangeResult const& value) { - fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1cont2when1(value, 0); + a_body1loopBody1cont3when1(value, 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< GetRecommendedTagsActor, 1, RangeResult >*,RangeResult && value) + void a_callback_fire(ActorCallback< GetRecommendedTagsActor, 2, RangeResult >*,RangeResult && value) { - fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1cont2when1(std::move(value), 0); + a_body1loopBody1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< GetRecommendedTagsActor, 1, RangeResult >*,Error err) + void a_callback_error(ActorCallback< GetRecommendedTagsActor, 2, RangeResult >*,Error err) { - fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1loopBody1Catch1(err, 0); } @@ -1092,7 +994,7 @@ class GetRecommendedTagsActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 2); } int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) @@ -1119,16 +1021,16 @@ class GetRecommendedTagsActorState { return loopDepth; } - void a_exitChoose3() + void a_exitChoose4() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetRecommendedTagsActor, 2, Void >::remove(); + static_cast(this)->ActorCallback< GetRecommendedTagsActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< GetRecommendedTagsActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetRecommendedTagsActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1loopBody1Catch1when1(value, 0); } @@ -1137,13 +1039,13 @@ class GetRecommendedTagsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< GetRecommendedTagsActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetRecommendedTagsActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1loopBody1Catch1when1(std::move(value), 0); } @@ -1152,13 +1054,13 @@ class GetRecommendedTagsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< GetRecommendedTagsActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< GetRecommendedTagsActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("getRecommendedTags", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -1167,25 +1069,25 @@ class GetRecommendedTagsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getRecommendedTags", reinterpret_cast(this), 3); } - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Reference db; - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" int limit; - #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Reference tr; - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" typename DB::TransactionT::template FutureT f; - #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" }; // This generated class is to be used only via getRecommendedTags() - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" -class GetRecommendedTagsActor final : public Actor>, public ActorCallback< GetRecommendedTagsActor, 0, bool >, public ActorCallback< GetRecommendedTagsActor, 1, RangeResult >, public ActorCallback< GetRecommendedTagsActor, 2, Void >, public FastAllocated>, public GetRecommendedTagsActorState> { - #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" +class GetRecommendedTagsActor final : public Actor>, public ActorCallback< GetRecommendedTagsActor, 0, Optional >, public ActorCallback< GetRecommendedTagsActor, 1, Void >, public ActorCallback< GetRecommendedTagsActor, 2, RangeResult >, public ActorCallback< GetRecommendedTagsActor, 3, Void >, public FastAllocated>, public GetRecommendedTagsActorState> { + #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -1193,12 +1095,13 @@ class GetRecommendedTagsActor final : public Actor> #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< GetRecommendedTagsActor, 0, bool >; -friend struct ActorCallback< GetRecommendedTagsActor, 1, RangeResult >; -friend struct ActorCallback< GetRecommendedTagsActor, 2, Void >; - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" +friend struct ActorCallback< GetRecommendedTagsActor, 0, Optional >; +friend struct ActorCallback< GetRecommendedTagsActor, 1, Void >; +friend struct ActorCallback< GetRecommendedTagsActor, 2, RangeResult >; +friend struct ActorCallback< GetRecommendedTagsActor, 3, Void >; + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" GetRecommendedTagsActor(Reference const& db,int const& limit) - #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" : Actor>(), GetRecommendedTagsActorState>(db, limit) { @@ -1216,46 +1119,47 @@ friend struct ActorCallback< GetRecommendedTagsActor, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< GetRecommendedTagsActor, 0, bool >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetRecommendedTagsActor, 1, RangeResult >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< GetRecommendedTagsActor, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< GetRecommendedTagsActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetRecommendedTagsActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetRecommendedTagsActor, 2, RangeResult >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< GetRecommendedTagsActor, 3, Void >*)0, actor_cancelled()); break; } } }; - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" [[nodiscard]] Future> getRecommendedTags( Reference const& db, int const& limit ) { - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" return Future>(new GetRecommendedTagsActor(db, limit)); - #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } -#line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" +#line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" - #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" // This generated class is to be used only via getThrottledTags() - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" class GetThrottledTagsActorState { - #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" GetThrottledTagsActorState(Reference const& db,int const& limit,ContainsRecommended const& containsRecommended = ContainsRecommended::False) - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" : db(db), - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" limit(limit), - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" containsRecommended(containsRecommended), - #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr(db->createTransaction()), - #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - reportAuto(containsRecommended) - #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + reportAuto() + #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { fdb_probe_actor_create("getThrottledTags", reinterpret_cast(this)); @@ -1268,9 +1172,9 @@ class GetThrottledTagsActorState { int a_body1(int loopDepth=0) { try { - #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" ; - #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1298,30 +1202,20 @@ class GetThrottledTagsActorState { } int a_body1loopBody1(int loopDepth) { - #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); - #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" try { - #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (!containsRecommended) - #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - { - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - StrictFuture __when_expr_0 = store(reportAuto, getValidAutoEnabled(tr)); - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - loopDepth = 0; - } - else - { - loopDepth = a_body1loopBody1cont2(loopDepth); - } + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + StrictFuture __when_expr_0 = store(reportAuto, getValidAutoEnabled(tr)); + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + loopDepth = 0; } catch (Error& error) { loopDepth = a_body1loopBody1Catch1(error, loopDepth); @@ -1340,16 +1234,16 @@ class GetThrottledTagsActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->onError(e)); - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + StrictFuture __when_expr_3 = safeThreadFutureToFuture(tr->onError(e)); + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -1360,45 +1254,69 @@ class GetThrottledTagsActorState { return loopDepth; } - int a_body1loopBody1cont2(int loopDepth) - { - #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - f = tr->getRange( reportAuto ? tagThrottleKeys : KeyRangeRef(tagThrottleKeysPrefix, tagThrottleAutoKeysPrefix), limit); - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - StrictFuture __when_expr_1 = safeThreadFutureToFuture(f); - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont3(Void const& _,int loopDepth) + int a_body1loopBody1cont2(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont2(loopDepth); + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!reportAuto.present()) + #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + { + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + tr->reset(); + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + StrictFuture __when_expr_1 = delay(CLIENT_KNOBS->DEFAULT_BACKOFF); + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont3(loopDepth); + } return loopDepth; } - int a_body1loopBody1cont3(Void && _,int loopDepth) + int a_body1loopBody1cont2(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont2(loopDepth); + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!reportAuto.present()) + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + { + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + tr->reset(); + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + StrictFuture __when_expr_1 = delay(CLIENT_KNOBS->DEFAULT_BACKOFF); + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont3(loopDepth); + } return loopDepth; } int a_body1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont3(_, loopDepth); + loopDepth = a_body1loopBody1cont2(_, loopDepth); return loopDepth; } int a_body1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); return loopDepth; } @@ -1453,19 +1371,112 @@ class GetThrottledTagsActorState { fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 0); } - int a_body1loopBody1cont4(RangeResult const& throttles,int loopDepth) + int a_body1loopBody1cont3(int loopDepth) + { + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + f = tr->getRange( reportAuto.get() ? tagThrottleKeys : KeyRangeRef(tagThrottleKeysPrefix, tagThrottleAutoKeysPrefix), limit); + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + StrictFuture __when_expr_2 = safeThreadFutureToFuture(f); + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont4(Void const& _,int loopDepth) + { + return a_body1loopHead1(loopDepth); // continue + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + return a_body1loopHead1(loopDepth); // continue + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetThrottledTagsActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetThrottledTagsActor, 1, Void >*,Void const& value) { - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetThrottledTagsActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetThrottledTagsActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont6(RangeResult const& throttles,int loopDepth) + { + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" std::vector results; - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" for( auto throttle : throttles ) { - #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" results.push_back(TagThrottleInfo(TagThrottleKey::fromKey(throttle.key), TagThrottleValue::fromValue(throttle.value))); - #line 1464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~GetThrottledTagsActorState(); static_cast(this)->destroy(); return 0; } - #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); this->~GetThrottledTagsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1473,19 +1484,19 @@ class GetThrottledTagsActorState { return loopDepth; } - int a_body1loopBody1cont4(RangeResult && throttles,int loopDepth) + int a_body1loopBody1cont6(RangeResult && throttles,int loopDepth) { - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" std::vector results; - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" for( auto throttle : throttles ) { - #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" results.push_back(TagThrottleInfo(TagThrottleKey::fromKey(throttle.key), TagThrottleValue::fromValue(throttle.value))); - #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(results); this->~GetThrottledTagsActorState(); static_cast(this)->destroy(); return 0; } - #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(results); this->~GetThrottledTagsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1493,58 +1504,58 @@ class GetThrottledTagsActorState { return loopDepth; } - int a_body1loopBody1cont2when1(RangeResult const& throttles,int loopDepth) + int a_body1loopBody1cont3when1(RangeResult const& throttles,int loopDepth) { - loopDepth = a_body1loopBody1cont4(throttles, loopDepth); + loopDepth = a_body1loopBody1cont6(throttles, loopDepth); return loopDepth; } - int a_body1loopBody1cont2when1(RangeResult && throttles,int loopDepth) + int a_body1loopBody1cont3when1(RangeResult && throttles,int loopDepth) { - loopDepth = a_body1loopBody1cont4(std::move(throttles), loopDepth); + loopDepth = a_body1loopBody1cont6(std::move(throttles), loopDepth); return loopDepth; } - void a_exitChoose2() + void a_exitChoose3() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetThrottledTagsActor, 1, RangeResult >::remove(); + static_cast(this)->ActorCallback< GetThrottledTagsActor, 2, RangeResult >::remove(); } - void a_callback_fire(ActorCallback< GetThrottledTagsActor, 1, RangeResult >*,RangeResult const& value) + void a_callback_fire(ActorCallback< GetThrottledTagsActor, 2, RangeResult >*,RangeResult const& value) { - fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1cont2when1(value, 0); + a_body1loopBody1cont3when1(value, 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< GetThrottledTagsActor, 1, RangeResult >*,RangeResult && value) + void a_callback_fire(ActorCallback< GetThrottledTagsActor, 2, RangeResult >*,RangeResult && value) { - fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1cont2when1(std::move(value), 0); + a_body1loopBody1cont3when1(std::move(value), 0); } catch (Error& error) { a_body1loopBody1Catch1(error, 0); } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< GetThrottledTagsActor, 1, RangeResult >*,Error err) + void a_callback_error(ActorCallback< GetThrottledTagsActor, 2, RangeResult >*,Error err) { - fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 1); - a_exitChoose2(); + fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1loopBody1Catch1(err, 0); } @@ -1553,7 +1564,7 @@ class GetThrottledTagsActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 1); + fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 2); } int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) @@ -1580,16 +1591,16 @@ class GetThrottledTagsActorState { return loopDepth; } - void a_exitChoose3() + void a_exitChoose4() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< GetThrottledTagsActor, 2, Void >::remove(); + static_cast(this)->ActorCallback< GetThrottledTagsActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< GetThrottledTagsActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< GetThrottledTagsActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1loopBody1Catch1when1(value, 0); } @@ -1598,13 +1609,13 @@ class GetThrottledTagsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< GetThrottledTagsActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< GetThrottledTagsActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1loopBody1Catch1when1(std::move(value), 0); } @@ -1613,13 +1624,13 @@ class GetThrottledTagsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< GetThrottledTagsActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< GetThrottledTagsActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("getThrottledTags", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -1628,29 +1639,29 @@ class GetThrottledTagsActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 2); + fdb_probe_actor_exit("getThrottledTags", reinterpret_cast(this), 3); } - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Reference db; - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" int limit; - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" ContainsRecommended containsRecommended; - #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Reference tr; - #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - bool reportAuto; - #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + Optional reportAuto; + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" typename DB::TransactionT::template FutureT f; - #line 1646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" }; // This generated class is to be used only via getThrottledTags() - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" -class GetThrottledTagsActor final : public Actor>, public ActorCallback< GetThrottledTagsActor, 0, Void >, public ActorCallback< GetThrottledTagsActor, 1, RangeResult >, public ActorCallback< GetThrottledTagsActor, 2, Void >, public FastAllocated>, public GetThrottledTagsActorState> { - #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" +class GetThrottledTagsActor final : public Actor>, public ActorCallback< GetThrottledTagsActor, 0, Void >, public ActorCallback< GetThrottledTagsActor, 1, Void >, public ActorCallback< GetThrottledTagsActor, 2, RangeResult >, public ActorCallback< GetThrottledTagsActor, 3, Void >, public FastAllocated>, public GetThrottledTagsActorState> { + #line 1664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -1659,11 +1670,12 @@ class GetThrottledTagsActor final : public Actor>, void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< GetThrottledTagsActor, 0, Void >; -friend struct ActorCallback< GetThrottledTagsActor, 1, RangeResult >; -friend struct ActorCallback< GetThrottledTagsActor, 2, Void >; - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" +friend struct ActorCallback< GetThrottledTagsActor, 1, Void >; +friend struct ActorCallback< GetThrottledTagsActor, 2, RangeResult >; +friend struct ActorCallback< GetThrottledTagsActor, 3, Void >; + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" GetThrottledTagsActor(Reference const& db,int const& limit,ContainsRecommended const& containsRecommended = ContainsRecommended::False) - #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" : Actor>(), GetThrottledTagsActorState>(db, limit, containsRecommended) { @@ -1682,49 +1694,49 @@ friend struct ActorCallback< GetThrottledTagsActor, 2, Void >; this->actor_wait_state = -1; switch (wait_state) { case 1: this->a_callback_error((ActorCallback< GetThrottledTagsActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< GetThrottledTagsActor, 1, RangeResult >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< GetThrottledTagsActor, 2, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetThrottledTagsActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< GetThrottledTagsActor, 2, RangeResult >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< GetThrottledTagsActor, 3, Void >*)0, actor_cancelled()); break; } } }; - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" [[nodiscard]] Future> getThrottledTags( Reference const& db, int const& limit, ContainsRecommended const& containsRecommended = ContainsRecommended::False ) { - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" return Future>(new GetThrottledTagsActor(db, limit, containsRecommended)); - #line 1697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } -#line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" +#line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template void signalThrottleChange(Reference tr) { - tr->atomicOp( - tagThrottleSignalKey, LiteralStringRef("XXXXXXXXXX\x00\x00\x00\x00"), MutationRef::SetVersionstampedValue); + tr->atomicOp(tagThrottleSignalKey, "XXXXXXXXXX\x00\x00\x00\x00"_sr, MutationRef::SetVersionstampedValue); } - #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" // This generated class is to be used only via updateThrottleCount() - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" class UpdateThrottleCountActorState { - #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" UpdateThrottleCountActorState(Reference const& tr,int64_t const& delta) - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" : tr(tr), - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" delta(delta), - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" countVal(tr->get(tagThrottleCountKey)), - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" limitVal(tr->get(tagThrottleLimitKey)) - #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { fdb_probe_actor_create("updateThrottleCount", reinterpret_cast(this)); @@ -1737,16 +1749,16 @@ class UpdateThrottleCountActorState { int a_body1(int loopDepth=0) { try { - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_0 = success(safeThreadFutureToFuture(countVal)) && success(safeThreadFutureToFuture(limitVal)); - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -1767,49 +1779,49 @@ class UpdateThrottleCountActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" int64_t count = 0; - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" int64_t limit = 0; - #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (countVal.get().present()) - #line 1776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" BinaryReader reader(countVal.get().get(), Unversioned()); - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" reader >> count; - #line 1782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (limitVal.get().present()) - #line 1786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" BinaryReader reader(limitVal.get().get(), Unversioned()); - #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" reader >> limit; - #line 1792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" count += delta; - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (count > limit) - #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" return a_body1Catch1(too_many_tag_throttles(), loopDepth); - #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" BinaryWriter writer(Unversioned()); - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" writer << count; - #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr->set(tagThrottleCountKey, writer.toValue()); - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateThrottleCountActorState(); static_cast(this)->destroy(); return 0; } - #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~UpdateThrottleCountActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1819,49 +1831,49 @@ class UpdateThrottleCountActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" int64_t count = 0; - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" int64_t limit = 0; - #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (countVal.get().present()) - #line 1828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" BinaryReader reader(countVal.get().get(), Unversioned()); - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" reader >> count; - #line 1834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (limitVal.get().present()) - #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" BinaryReader reader(limitVal.get().get(), Unversioned()); - #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" reader >> limit; - #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" count += delta; - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (count > limit) - #line 1850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" return a_body1Catch1(too_many_tag_throttles(), loopDepth); - #line 1854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" BinaryWriter writer(Unversioned()); - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" writer << count; - #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr->set(tagThrottleCountKey, writer.toValue()); - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~UpdateThrottleCountActorState(); static_cast(this)->destroy(); return 0; } - #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~UpdateThrottleCountActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1932,22 +1944,22 @@ class UpdateThrottleCountActorState { fdb_probe_actor_exit("updateThrottleCount", reinterpret_cast(this), 0); } - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Reference tr; - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" int64_t delta; - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" typename Tr::template FutureT> countVal; - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" typename Tr::template FutureT> limitVal; - #line 1943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" }; // This generated class is to be used only via updateThrottleCount() - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" class UpdateThrottleCountActor final : public Actor, public ActorCallback< UpdateThrottleCountActor, 0, Void >, public FastAllocated>, public UpdateThrottleCountActorState> { - #line 1950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -1956,9 +1968,9 @@ class UpdateThrottleCountActor final : public Actor, public ActorCallback< void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< UpdateThrottleCountActor, 0, Void >; - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" UpdateThrottleCountActor(Reference const& tr,int64_t const& delta) - #line 1961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 1973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" : Actor(), UpdateThrottleCountActorState>(tr, delta) { @@ -1981,47 +1993,47 @@ friend struct ActorCallback< UpdateThrottleCountActor, 0, Void >; } }; - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" [[nodiscard]] Future updateThrottleCount( Reference const& tr, int64_t const& delta ) { - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" return Future(new UpdateThrottleCountActor(tr, delta)); - #line 1990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } -#line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" +#line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" - #line 1995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" // This generated class is to be used only via unthrottleMatchingThrottles() - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" class UnthrottleMatchingThrottlesActorState { - #line 2001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" UnthrottleMatchingThrottlesActorState(Reference const& db,KeyRef const& beginKey,KeyRef const& endKey,Optional const& priority,bool const& onlyExpiredThrottles) - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" : db(db), - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" beginKey(beginKey), - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" endKey(endKey), - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" priority(priority), - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" onlyExpiredThrottles(onlyExpiredThrottles), - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr(db->createTransaction()), - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" begin(firstGreaterOrEqual(beginKey)), - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" end(firstGreaterOrEqual(endKey)), - #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" removed(false) - #line 2024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { fdb_probe_actor_create("unthrottleMatchingThrottles", reinterpret_cast(this)); @@ -2034,9 +2046,9 @@ class UnthrottleMatchingThrottlesActorState { int a_body1(int loopDepth=0) { try { - #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" ; - #line 2039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2064,22 +2076,22 @@ class UnthrottleMatchingThrottlesActorState { } int a_body1loopBody1(int loopDepth) { - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" try { - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" f = tr->getRange(begin, end, 1000); - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_0 = safeThreadFutureToFuture(f); - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2099,16 +2111,16 @@ class UnthrottleMatchingThrottlesActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_3 = safeThreadFutureToFuture(tr->onError(e)); - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2121,63 +2133,63 @@ class UnthrottleMatchingThrottlesActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" unthrottledTags = 0; - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" uint64_t manualUnthrottledTags = 0; - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" for( auto tag : tags ) { - #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (onlyExpiredThrottles) - #line 2132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" double expirationTime = TagThrottleValue::fromValue(tag.value).expirationTime; - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (expirationTime == 0 || expirationTime > now()) - #line 2138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { continue; } } - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" TagThrottleKey key = TagThrottleKey::fromKey(tag.key); - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (priority.present() && key.priority != priority.get()) - #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { continue; } - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (key.throttleType == TagThrottleType::MANUAL) - #line 2153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" ++manualUnthrottledTags; - #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" removed = true; - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr->clear(tag.key); - #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" unthrottledTags++; - #line 2165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (manualUnthrottledTags > 0) - #line 2169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_1 = updateThrottleCount(tr, -manualUnthrottledTags); - #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } else @@ -2189,9 +2201,9 @@ class UnthrottleMatchingThrottlesActorState { } int a_body1loopBody1when1(RangeResult const& __tags,int loopDepth) { - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tags = __tags; - #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; @@ -2256,24 +2268,24 @@ class UnthrottleMatchingThrottlesActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (unthrottledTags > 0) - #line 2261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" signalThrottleChange(tr); - #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->commit()); - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; return loopDepth; @@ -2355,46 +2367,46 @@ class UnthrottleMatchingThrottlesActorState { } int a_body1loopBody1cont10(Void const& _,int loopDepth) { - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!tags.more) - #line 2360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!static_cast(this)->SAV::futures) { (void)(removed); this->~UnthrottleMatchingThrottlesActorState(); static_cast(this)->destroy(); return 0; } - #line 2364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" new (&static_cast(this)->SAV< bool >::value()) bool(std::move(removed)); // state_var_RVO this->~UnthrottleMatchingThrottlesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" ASSERT(tags.size() > 0); - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" begin = KeySelector(firstGreaterThan(tags[tags.size() - 1].key), tags.arena()); - #line 2374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = a_body1loopBody1cont10cont3(loopDepth); return loopDepth; } int a_body1loopBody1cont10(Void && _,int loopDepth) { - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!tags.more) - #line 2383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!static_cast(this)->SAV::futures) { (void)(removed); this->~UnthrottleMatchingThrottlesActorState(); static_cast(this)->destroy(); return 0; } - #line 2387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" new (&static_cast(this)->SAV< bool >::value()) bool(std::move(removed)); // state_var_RVO this->~UnthrottleMatchingThrottlesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" ASSERT(tags.size() > 0); - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" begin = KeySelector(firstGreaterThan(tags[tags.size() - 1].key), tags.arena()); - #line 2397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = a_body1loopBody1cont10cont3(loopDepth); return loopDepth; @@ -2550,38 +2562,38 @@ class UnthrottleMatchingThrottlesActorState { fdb_probe_actor_exit("unthrottleMatchingThrottles", reinterpret_cast(this), 3); } - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Reference db; - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" KeyRef beginKey; - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" KeyRef endKey; - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Optional priority; - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" bool onlyExpiredThrottles; - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Reference tr; - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" KeySelector begin; - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" KeySelector end; - #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" bool removed; - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" typename DB::TransactionT::template FutureT f; - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" RangeResult tags; - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" uint64_t unthrottledTags; - #line 2577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" }; // This generated class is to be used only via unthrottleMatchingThrottles() - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" class UnthrottleMatchingThrottlesActor final : public Actor, public ActorCallback< UnthrottleMatchingThrottlesActor, 0, RangeResult >, public ActorCallback< UnthrottleMatchingThrottlesActor, 1, Void >, public ActorCallback< UnthrottleMatchingThrottlesActor, 2, Void >, public ActorCallback< UnthrottleMatchingThrottlesActor, 3, Void >, public FastAllocated>, public UnthrottleMatchingThrottlesActorState> { - #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -2593,9 +2605,9 @@ friend struct ActorCallback< UnthrottleMatchingThrottlesActor, 0, RangeResul friend struct ActorCallback< UnthrottleMatchingThrottlesActor, 1, Void >; friend struct ActorCallback< UnthrottleMatchingThrottlesActor, 2, Void >; friend struct ActorCallback< UnthrottleMatchingThrottlesActor, 3, Void >; - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" UnthrottleMatchingThrottlesActor(Reference const& db,KeyRef const& beginKey,KeyRef const& endKey,Optional const& priority,bool const& onlyExpiredThrottles) - #line 2598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" : Actor(), UnthrottleMatchingThrottlesActorState>(db, beginKey, endKey, priority, onlyExpiredThrottles) { @@ -2621,16 +2633,16 @@ friend struct ActorCallback< UnthrottleMatchingThrottlesActor, 3, Void >; } }; - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" [[nodiscard]] Future unthrottleMatchingThrottles( Reference const& db, KeyRef const& beginKey, KeyRef const& endKey, Optional const& priority, bool const& onlyExpiredThrottles ) { - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" return Future(new UnthrottleMatchingThrottlesActor(db, beginKey, endKey, priority, onlyExpiredThrottles)); - #line 2630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } -#line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" +#line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template Future expire(DB db) { @@ -2654,30 +2666,30 @@ Future unthrottleAll(Reference db, return unthrottleMatchingThrottles(db, begin, end, priority, false); } - #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" // This generated class is to be used only via unthrottleTags() - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" class UnthrottleTagsActorState { - #line 2663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" UnthrottleTagsActorState(Reference const& db,TagSet const& tags,Optional const& throttleType,Optional const& priority) - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" : db(db), - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tags(tags), - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" throttleType(throttleType), - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" priority(priority), - #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr(db->createTransaction()), - #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" keys() - #line 2680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { fdb_probe_actor_create("unthrottleTags", reinterpret_cast(this)); @@ -2690,35 +2702,35 @@ class UnthrottleTagsActorState { int a_body1(int loopDepth=0) { try { - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" for( auto p : allTransactionPriorities ) { - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!priority.present() || priority.get() == p) - #line 2697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!throttleType.present() || throttleType.get() == TagThrottleType::AUTO) - #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" keys.push_back(TagThrottleKey(tags, TagThrottleType::AUTO, p).toKey()); - #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!throttleType.present() || throttleType.get() == TagThrottleType::MANUAL) - #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" keys.push_back(TagThrottleKey(tags, TagThrottleType::MANUAL, p).toKey()); - #line 2713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } } } - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" removed = false; - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" ; - #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2746,34 +2758,34 @@ class UnthrottleTagsActorState { } int a_body1loopBody1(int loopDepth) { - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 2751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" try { - #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" valueFutures = std::vector>>(); - #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" values = std::vector>>(); - #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" values.reserve(keys.size()); - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" for( auto key : keys ) { - #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" valueFutures.push_back(tr->get(key)); - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" values.push_back(safeThreadFutureToFuture(valueFutures.back())); - #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_0 = waitForAll(values); - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2793,16 +2805,16 @@ class UnthrottleTagsActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_3 = safeThreadFutureToFuture(tr->onError(e)); - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2815,43 +2827,43 @@ class UnthrottleTagsActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" int delta = 0; - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" for(int i = 0;i < values.size();++i) { - #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (values[i].get().present()) - #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (TagThrottleKey::fromKey(keys[i]).throttleType == TagThrottleType::MANUAL) - #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" delta -= 1; - #line 2832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr->clear(keys[i]); - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" removed = true; - #line 2838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } } - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (delta != 0) - #line 2843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_1 = updateThrottleCount(tr, delta); - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } else @@ -2863,43 +2875,43 @@ class UnthrottleTagsActorState { } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" int delta = 0; - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" for(int i = 0;i < values.size();++i) { - #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (values[i].get().present()) - #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (TagThrottleKey::fromKey(keys[i]).throttleType == TagThrottleType::MANUAL) - #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" delta -= 1; - #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr->clear(keys[i]); - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" removed = true; - #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } } - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (delta != 0) - #line 2891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_1 = updateThrottleCount(tr, delta); - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } else @@ -2974,22 +2986,22 @@ class UnthrottleTagsActorState { } int a_body1loopBody1cont4(int loopDepth) { - #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (removed) - #line 2979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" signalThrottleChange(tr); - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->commit()); - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 2999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } else @@ -3076,9 +3088,9 @@ class UnthrottleTagsActorState { } int a_body1loopBody1cont9(int loopDepth) { - #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!static_cast(this)->SAV::futures) { (void)(removed); this->~UnthrottleTagsActorState(); static_cast(this)->destroy(); return 0; } - #line 3081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" new (&static_cast(this)->SAV< bool >::value()) bool(std::move(removed)); // state_var_RVO this->~UnthrottleTagsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3236,32 +3248,32 @@ class UnthrottleTagsActorState { fdb_probe_actor_exit("unthrottleTags", reinterpret_cast(this), 3); } - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Reference db; - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" TagSet tags; - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Optional throttleType; - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Optional priority; - #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Reference tr; - #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" std::vector keys; - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" bool removed; - #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" std::vector>> valueFutures; - #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" std::vector>> values; - #line 3257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" }; // This generated class is to be used only via unthrottleTags() - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" class UnthrottleTagsActor final : public Actor, public ActorCallback< UnthrottleTagsActor, 0, Void >, public ActorCallback< UnthrottleTagsActor, 1, Void >, public ActorCallback< UnthrottleTagsActor, 2, Void >, public ActorCallback< UnthrottleTagsActor, 3, Void >, public FastAllocated>, public UnthrottleTagsActorState> { - #line 3264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -3273,9 +3285,9 @@ friend struct ActorCallback< UnthrottleTagsActor, 0, Void >; friend struct ActorCallback< UnthrottleTagsActor, 1, Void >; friend struct ActorCallback< UnthrottleTagsActor, 2, Void >; friend struct ActorCallback< UnthrottleTagsActor, 3, Void >; - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" UnthrottleTagsActor(Reference const& db,TagSet const& tags,Optional const& throttleType,Optional const& priority) - #line 3278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" : Actor(), UnthrottleTagsActorState>(db, tags, throttleType, priority) { @@ -3301,49 +3313,49 @@ friend struct ActorCallback< UnthrottleTagsActor, 3, Void >; } }; - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" [[nodiscard]] Future unthrottleTags( Reference const& db, TagSet const& tags, Optional const& throttleType, Optional const& priority ) { - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" return Future(new UnthrottleTagsActor(db, tags, throttleType, priority)); - #line 3310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } -#line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" +#line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" - #line 3315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" // This generated class is to be used only via throttleTags() - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" class ThrottleTagsActorState { - #line 3321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" ThrottleTagsActorState(Reference const& db,TagSet const& tags,double const& tpsRate,double const& initialDuration,TagThrottleType const& throttleType,TransactionPriority const& priority,Optional const& expirationTime = Optional(),Optional const& reason = Optional()) - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" : db(db), - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tags(tags), - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tpsRate(tpsRate), - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" initialDuration(initialDuration), - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" throttleType(throttleType), - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" priority(priority), - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" expirationTime(expirationTime), - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" reason(reason), - #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr(db->createTransaction()), - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" key(TagThrottleKey(tags, throttleType, priority).toKey()) - #line 3346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { fdb_probe_actor_create("throttleTags", reinterpret_cast(this)); @@ -3356,27 +3368,27 @@ class ThrottleTagsActorState { int a_body1(int loopDepth=0) { try { - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" ASSERT(initialDuration > 0); - #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (throttleType == TagThrottleType::MANUAL) - #line 3363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" reason = TagThrottledReason::MANUAL; - #line 3367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" TagThrottleValue throttle(tpsRate, expirationTime.present() ? expirationTime.get() : 0, initialDuration, reason.present() ? reason.get() : TagThrottledReason::UNSET); - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" BinaryWriter wr(IncludeVersion(ProtocolVersion::withTagThrottleValueReason())); - #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" wr << throttle; - #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" value = wr.toValue(); - #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" ; - #line 3379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -3404,26 +3416,26 @@ class ThrottleTagsActorState { } int a_body1loopBody1(int loopDepth) { - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 3409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" try { - #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (throttleType == TagThrottleType::MANUAL) - #line 3413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" oldThrottleF = tr->get(key); - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture> __when_expr_0 = safeThreadFutureToFuture(oldThrottleF); - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } else @@ -3448,16 +3460,16 @@ class ThrottleTagsActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_3 = safeThreadFutureToFuture(tr->onError(e)); - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -3470,46 +3482,46 @@ class ThrottleTagsActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr->set(key, value); - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (throttleType == TagThrottleType::MANUAL) - #line 3477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" signalThrottleChange(tr); - #line 3481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->commit()); - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont3(Optional const& oldThrottle,int loopDepth) { - #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!oldThrottle.present()) - #line 3501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_1 = updateThrottleCount(tr, 1); - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } else @@ -3521,20 +3533,20 @@ class ThrottleTagsActorState { } int a_body1loopBody1cont3(Optional && oldThrottle,int loopDepth) { - #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!oldThrottle.present()) - #line 3526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_1 = updateThrottleCount(tr, 1); - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } else @@ -3690,9 +3702,9 @@ class ThrottleTagsActorState { } int a_body1loopBody1cont6(Void const& _,int loopDepth) { - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ThrottleTagsActorState(); static_cast(this)->destroy(); return 0; } - #line 3695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ThrottleTagsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3702,9 +3714,9 @@ class ThrottleTagsActorState { } int a_body1loopBody1cont6(Void && _,int loopDepth) { - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ThrottleTagsActorState(); static_cast(this)->destroy(); return 0; } - #line 3707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ThrottleTagsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3850,38 +3862,38 @@ class ThrottleTagsActorState { fdb_probe_actor_exit("throttleTags", reinterpret_cast(this), 3); } - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Reference db; - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" TagSet tags; - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" double tpsRate; - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" double initialDuration; - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" TagThrottleType throttleType; - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" TransactionPriority priority; - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Optional expirationTime; - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Optional reason; - #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Reference tr; - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Key key; - #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Value value; - #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" typename DB::TransactionT::template FutureT> oldThrottleF; - #line 3877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" }; // This generated class is to be used only via throttleTags() - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" class ThrottleTagsActor final : public Actor, public ActorCallback< ThrottleTagsActor, 0, Optional >, public ActorCallback< ThrottleTagsActor, 1, Void >, public ActorCallback< ThrottleTagsActor, 2, Void >, public ActorCallback< ThrottleTagsActor, 3, Void >, public FastAllocated>, public ThrottleTagsActorState> { - #line 3884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -3893,9 +3905,9 @@ friend struct ActorCallback< ThrottleTagsActor, 0, Optional >; friend struct ActorCallback< ThrottleTagsActor, 1, Void >; friend struct ActorCallback< ThrottleTagsActor, 2, Void >; friend struct ActorCallback< ThrottleTagsActor, 3, Void >; - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" ThrottleTagsActor(Reference const& db,TagSet const& tags,double const& tpsRate,double const& initialDuration,TagThrottleType const& throttleType,TransactionPriority const& priority,Optional const& expirationTime = Optional(),Optional const& reason = Optional()) - #line 3898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" : Actor(), ThrottleTagsActorState>(db, tags, tpsRate, initialDuration, throttleType, priority, expirationTime, reason) { @@ -3921,35 +3933,35 @@ friend struct ActorCallback< ThrottleTagsActor, 3, Void >; } }; - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" [[nodiscard]] Future throttleTags( Reference const& db, TagSet const& tags, double const& tpsRate, double const& initialDuration, TagThrottleType const& throttleType, TransactionPriority const& priority, Optional const& expirationTime = Optional(), Optional const& reason = Optional() ) { - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" return Future(new ThrottleTagsActor(db, tags, tpsRate, initialDuration, throttleType, priority, expirationTime, reason)); - #line 3930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } -#line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" +#line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" - #line 3935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" // This generated class is to be used only via enableAuto() - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" class EnableAutoActorState { - #line 3941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" EnableAutoActorState(Reference const& db,bool const& enabled) - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" : db(db), - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" enabled(enabled), - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr(db->createTransaction()) - #line 3952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { fdb_probe_actor_create("enableAuto", reinterpret_cast(this)); @@ -3962,9 +3974,9 @@ class EnableAutoActorState { int a_body1(int loopDepth=0) { try { - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" ; - #line 3967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 3979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -3992,22 +4004,22 @@ class EnableAutoActorState { } int a_body1loopBody1(int loopDepth) { - #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - #line 3997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 4009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" try { - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" valueF = tr->get(tagThrottleAutoEnabledKey); - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture> __when_expr_0 = safeThreadFutureToFuture(valueF); - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 4017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 4022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -4027,16 +4039,16 @@ class EnableAutoActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_2 = safeThreadFutureToFuture(tr->onError(e)); - #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 4046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 4051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -4049,24 +4061,24 @@ class EnableAutoActorState { } int a_body1loopBody1cont2(Optional const& value,int loopDepth) { - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (!value.present() || (enabled && value.get() != LiteralStringRef("1")) || (!enabled && value.get() != LiteralStringRef("0"))) - #line 4054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!value.present() || (enabled && value.get() != "1"_sr) || (!enabled && value.get() != "0"_sr)) + #line 4066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - tr->set(tagThrottleAutoEnabledKey, LiteralStringRef(enabled ? "1" : "0")); - #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + tr->set(tagThrottleAutoEnabledKey, enabled ? "1"_sr : "0"_sr); + #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" signalThrottleChange(tr); - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->commit()); - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 4076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 4081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } else @@ -4078,24 +4090,24 @@ class EnableAutoActorState { } int a_body1loopBody1cont2(Optional && value,int loopDepth) { - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - if (!value.present() || (enabled && value.get() != LiteralStringRef("1")) || (!enabled && value.get() != LiteralStringRef("0"))) - #line 4083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + if (!value.present() || (enabled && value.get() != "1"_sr) || (!enabled && value.get() != "0"_sr)) + #line 4095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" { - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" - tr->set(tagThrottleAutoEnabledKey, LiteralStringRef(enabled ? "1" : "0")); - #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + tr->set(tagThrottleAutoEnabledKey, enabled ? "1"_sr : "0"_sr); + #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" signalThrottleChange(tr); - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->commit()); - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 4105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 4110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" loopDepth = 0; } else @@ -4170,9 +4182,9 @@ class EnableAutoActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~EnableAutoActorState(); static_cast(this)->destroy(); return 0; } - #line 4175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 4187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~EnableAutoActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4330,22 +4342,22 @@ class EnableAutoActorState { fdb_probe_actor_exit("enableAuto", reinterpret_cast(this), 2); } - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Reference db; - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" bool enabled; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" Reference tr; - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" typename DB::TransactionT::template FutureT> valueF; - #line 4341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" }; // This generated class is to be used only via enableAuto() - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" class EnableAutoActor final : public Actor, public ActorCallback< EnableAutoActor, 0, Optional >, public ActorCallback< EnableAutoActor, 1, Void >, public ActorCallback< EnableAutoActor, 2, Void >, public FastAllocated>, public EnableAutoActorState> { - #line 4348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 4360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -4356,9 +4368,9 @@ class EnableAutoActor final : public Actor, public ActorCallback< EnableAu friend struct ActorCallback< EnableAutoActor, 0, Optional >; friend struct ActorCallback< EnableAutoActor, 1, Void >; friend struct ActorCallback< EnableAutoActor, 2, Void >; - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" EnableAutoActor(Reference const& db,bool const& enabled) - #line 4361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 4373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" : Actor(), EnableAutoActorState>(db, enabled) { @@ -4383,16 +4395,39 @@ friend struct ActorCallback< EnableAutoActor, 2, Void >; } }; - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" template - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" [[nodiscard]] Future enableAuto( Reference const& db, bool const& enabled ) { - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" return Future(new EnableAutoActor(db, enabled)); - #line 4392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.g.h" + #line 4404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.g.h" } -#line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/TagThrottle.actor.h" +#line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TagThrottle.actor.h" + +class TagQuotaValue { +public: + int64_t reservedQuota{ 0 }; + int64_t totalQuota{ 0 }; + bool isValid() const; + Value toValue() const; + static TagQuotaValue fromValue(ValueRef); +}; + +Key getTagQuotaKey(TransactionTagRef); + +template +void setTagQuota(Reference tr, TransactionTagRef tag, int64_t reservedQuota, int64_t totalQuota) { + TagQuotaValue tagQuotaValue; + tagQuotaValue.reservedQuota = reservedQuota; + tagQuotaValue.totalQuota = totalQuota; + if (!tagQuotaValue.isValid()) { + throw invalid_throttle_quota_value(); + } + tr->set(getTagQuotaKey(tag), tagQuotaValue.toValue()); + signalThrottleChange(tr); +} }; // namespace ThrottleApi diff --git a/src/fdbclient/TagThrottle.actor.h b/src/fdbclient/include/fdbclient/TagThrottle.actor.h similarity index 89% rename from src/fdbclient/TagThrottle.actor.h rename to src/fdbclient/include/fdbclient/TagThrottle.actor.h index 3330abb..2828b2e 100644 --- a/src/fdbclient/TagThrottle.actor.h +++ b/src/fdbclient/include/fdbclient/TagThrottle.actor.h @@ -40,8 +40,8 @@ typedef StringRef TransactionTagRef; typedef Standalone TransactionTag; -FDB_DECLARE_BOOLEAN_PARAM(ContainsRecommended); -FDB_DECLARE_BOOLEAN_PARAM(Capitalize); +FDB_BOOLEAN_PARAM(ContainsRecommended); +FDB_BOOLEAN_PARAM(Capitalize); class TagSet { public: @@ -207,6 +207,8 @@ struct ClientTagThrottleLimits { double tpsRate; double expiration; + static double const NO_EXPIRATION; + ClientTagThrottleLimits() : tpsRate(0), expiration(0) {} ClientTagThrottleLimits(double tpsRate, double expiration) : tpsRate(tpsRate), expiration(expiration) {} @@ -252,38 +254,34 @@ namespace ThrottleApi { // or using IClientAPI like IDatabase, ITransaction ACTOR template -Future getValidAutoEnabled(Reference tr) { - state bool result; - loop { - // hold the returned standalone object's memory - state typename Tr::template FutureT> valueF = tr->get(tagThrottleAutoEnabledKey); - Optional value = wait(safeThreadFutureToFuture(valueF)); - if (!value.present()) { - tr->reset(); - wait(delay(CLIENT_KNOBS->DEFAULT_BACKOFF)); - continue; - } else if (value.get() == LiteralStringRef("1")) { - result = true; - } else if (value.get() == LiteralStringRef("0")) { - result = false; - } else { - TraceEvent(SevWarnAlways, "InvalidAutoTagThrottlingValue").detail("Value", value.get()); - tr->reset(); - wait(delay(CLIENT_KNOBS->DEFAULT_BACKOFF)); - continue; - } - return result; - }; +Future> getValidAutoEnabled(Reference tr) { + // hold the returned standalone object's memory + state typename Tr::template FutureT> valueF = tr->get(tagThrottleAutoEnabledKey); + Optional value = wait(safeThreadFutureToFuture(valueF)); + if (!value.present()) { + return {}; + } else if (value.get() == "1"_sr) { + return true; + } else if (value.get() == "0"_sr) { + return false; + } else { + TraceEvent(SevWarnAlways, "InvalidAutoTagThrottlingValue").detail("Value", value.get()); + return {}; + } } ACTOR template Future> getRecommendedTags(Reference db, int limit) { state Reference tr = db->createTransaction(); loop { - tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); try { - bool enableAuto = wait(getValidAutoEnabled(tr)); - if (enableAuto) { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + Optional enableAuto = wait(getValidAutoEnabled(tr)); + if (!enableAuto.present()) { + tr->reset(); + wait(delay(CLIENT_KNOBS->DEFAULT_BACKOFF)); + continue; + } else if (enableAuto.get()) { return std::vector(); } state typename DB::TransactionT::template FutureT f = @@ -305,15 +303,19 @@ ACTOR template Future> getThrottledTags(Reference db, int limit, ContainsRecommended containsRecommended = ContainsRecommended::False) { state Reference tr = db->createTransaction(); - state bool reportAuto = containsRecommended; + state Optional reportAuto; loop { - tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); try { - if (!containsRecommended) { - wait(store(reportAuto, getValidAutoEnabled(tr))); + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + wait(store(reportAuto, getValidAutoEnabled(tr))); + if (!reportAuto.present()) { + tr->reset(); + wait(delay(CLIENT_KNOBS->DEFAULT_BACKOFF)); + continue; } state typename DB::TransactionT::template FutureT f = tr->getRange( - reportAuto ? tagThrottleKeys : KeyRangeRef(tagThrottleKeysPrefix, tagThrottleAutoKeysPrefix), limit); + reportAuto.get() ? tagThrottleKeys : KeyRangeRef(tagThrottleKeysPrefix, tagThrottleAutoKeysPrefix), + limit); RangeResult throttles = wait(safeThreadFutureToFuture(f)); std::vector results; for (auto throttle : throttles) { @@ -329,8 +331,7 @@ getThrottledTags(Reference db, int limit, ContainsRecommended containsRecomm template void signalThrottleChange(Reference tr) { - tr->atomicOp( - tagThrottleSignalKey, LiteralStringRef("XXXXXXXXXX\x00\x00\x00\x00"), MutationRef::SetVersionstampedValue); + tr->atomicOp(tagThrottleSignalKey, "XXXXXXXXXX\x00\x00\x00\x00"_sr, MutationRef::SetVersionstampedValue); } ACTOR template @@ -581,9 +582,8 @@ Future enableAuto(Reference db, bool enabled) { state typename DB::TransactionT::template FutureT> valueF = tr->get(tagThrottleAutoEnabledKey); Optional value = wait(safeThreadFutureToFuture(valueF)); - if (!value.present() || (enabled && value.get() != LiteralStringRef("1")) || - (!enabled && value.get() != LiteralStringRef("0"))) { - tr->set(tagThrottleAutoEnabledKey, LiteralStringRef(enabled ? "1" : "0")); + if (!value.present() || (enabled && value.get() != "1"_sr) || (!enabled && value.get() != "0"_sr)) { + tr->set(tagThrottleAutoEnabledKey, enabled ? "1"_sr : "0"_sr); signalThrottleChange(tr); wait(safeThreadFutureToFuture(tr->commit())); @@ -595,6 +595,29 @@ Future enableAuto(Reference db, bool enabled) { } } +class TagQuotaValue { +public: + int64_t reservedQuota{ 0 }; + int64_t totalQuota{ 0 }; + bool isValid() const; + Value toValue() const; + static TagQuotaValue fromValue(ValueRef); +}; + +Key getTagQuotaKey(TransactionTagRef); + +template +void setTagQuota(Reference tr, TransactionTagRef tag, int64_t reservedQuota, int64_t totalQuota) { + TagQuotaValue tagQuotaValue; + tagQuotaValue.reservedQuota = reservedQuota; + tagQuotaValue.totalQuota = totalQuota; + if (!tagQuotaValue.isValid()) { + throw invalid_throttle_quota_value(); + } + tr->set(getTagQuotaKey(tag), tagQuotaValue.toValue()); + signalThrottleChange(tr); +} + }; // namespace ThrottleApi template diff --git a/src/fdbclient/TaskBucket.h b/src/fdbclient/include/fdbclient/TaskBucket.h similarity index 96% rename from src/fdbclient/TaskBucket.h rename to src/fdbclient/include/fdbclient/TaskBucket.h index c87a353..61280dd 100644 --- a/src/fdbclient/TaskBucket.h +++ b/src/fdbclient/include/fdbclient/TaskBucket.h @@ -28,17 +28,17 @@ #include "fdbclient/FDBTypes.h" #include "fdbclient/NativeAPI.actor.h" -#include "fdbclient/RunTransaction.actor.h" +#include "fdbclient/RunRYWTransaction.actor.h" #include "fdbclient/Subspace.h" -#include "fdbclient/KeyBackedTypes.h" +#include "fdbclient/KeyBackedTypes.actor.h" class FutureBucket; class TaskFuture; -FDB_DECLARE_BOOLEAN_PARAM(AccessSystemKeys); -FDB_DECLARE_BOOLEAN_PARAM(PriorityBatch); -FDB_DECLARE_BOOLEAN_PARAM(VerifyTask); -FDB_DECLARE_BOOLEAN_PARAM(UpdateParams); +FDB_BOOLEAN_PARAM(AccessSystemKeys); +FDB_BOOLEAN_PARAM(PriorityBatch); +FDB_BOOLEAN_PARAM(VerifyTask); +FDB_BOOLEAN_PARAM(UpdateParams); // A Task is a set of key=value parameters that constitute a unit of work for a TaskFunc to perform. // The parameter keys are specific to the TaskFunc that the Task is for, except for a set of reserved @@ -103,8 +103,8 @@ template class TaskParam { public: TaskParam(StringRef key) : key(key) {} - T get(Reference task) const { return Codec::unpack(Tuple::unpack(task->params[key])); } - void set(Reference task, T const& val) const { task->params[key] = Codec::pack(val).pack(); } + T get(Reference task) const { return TupleCodec::unpack(task->params[key]); } + void set(Reference task, T const& val) const { task->params[key] = TupleCodec::pack(val); } bool exists(Reference task) const { return task->params.find(key) != task->params.end(); } T getOrDefault(Reference task, const T defaultValue = T()) const { if (!exists(task)) @@ -115,7 +115,7 @@ class TaskParam { }; struct ReservedTaskParams { - static TaskParam scheduledVersion() { return LiteralStringRef(__FUNCTION__); } + static TaskParam scheduledVersion() { return __FUNCTION__sr; } }; class FutureBucket; @@ -274,6 +274,7 @@ class TaskBucket : public ReferenceCounted { Database src; Map>>> key_version; + UID dbgid; CounterCollection cc; Counter dispatchSlotChecksStarted; @@ -281,7 +282,6 @@ class TaskBucket : public ReferenceCounted { Counter dispatchDoTasks; Counter dispatchEmptyTasks; Counter dispatchSlotChecksComplete; - UID dbgid; double getTimeoutSeconds() const { return (double)timeout / CLIENT_KNOBS->CORE_VERSIONSPERSECOND; } @@ -480,7 +480,8 @@ struct TaskFuncBase : IDispatched, std::func }; #define REGISTER_TASKFUNC(TaskFunc) REGISTER_FACTORY(TaskFuncBase, TaskFunc, name) #define REGISTER_TASKFUNC_ALIAS(TaskFunc, Alias) \ - REGISTER_DISPATCHED_ALIAS(TaskFunc, Alias, TaskFunc::name, LiteralStringRef(#Alias)) + REGISTER_DISPATCHED_ALIAS( \ + TaskFunc, Alias, TaskFunc::name, StringRef(reinterpret_cast(#Alias), sizeof(#Alias) - 1)) struct TaskCompletionKey { Future get(Reference tr, Reference taskBucket); diff --git a/src/fdbclient/include/fdbclient/Tenant.h b/src/fdbclient/include/fdbclient/Tenant.h new file mode 100644 index 0000000..3f62919 --- /dev/null +++ b/src/fdbclient/include/fdbclient/Tenant.h @@ -0,0 +1,247 @@ +/* + * Tenant.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBCLIENT_TENANT_H +#define FDBCLIENT_TENANT_H +#pragma once + +#include "fdbclient/FDBTypes.h" +#include "fdbclient/KeyBackedTypes.actor.h" +#include "fdbclient/VersionedMap.h" +#include "fdbrpc/TenantInfo.h" +#include "flow/BooleanParam.h" +#include "flow/flat_buffers.h" + +FDB_BOOLEAN_PARAM(EnforceValidTenantId); + +namespace TenantAPI { +KeyRef idToPrefix(Arena& p, int64_t id); +Key idToPrefix(int64_t id); +int64_t prefixToId(KeyRef prefix, EnforceValidTenantId = EnforceValidTenantId::True); +KeyRangeRef clampRangeToTenant(KeyRangeRef range, TenantInfo const& tenantInfo, Arena& arena); + +// return true if begin and end has the same non-negative prefix id +bool withinSingleTenant(KeyRangeRef const&); + +constexpr static int PREFIX_SIZE = sizeof(int64_t); + +// Represents the lock state the tenant could be in. +// Can be used in conjunction with the other tenant states above. +enum class TenantLockState : uint8_t { UNLOCKED, READ_ONLY, LOCKED }; + +std::string tenantLockStateToString(TenantLockState tenantState); +TenantLockState stringToTenantLockState(std::string stateStr); +} // namespace TenantAPI + +json_spirit::mObject binaryToJson(StringRef bytes); + +struct TenantMapEntryTxnStateStore { + constexpr static FileIdentifier file_identifier = 11267001; + + int64_t id = -1; + TenantName tenantName; + TenantAPI::TenantLockState tenantLockState = TenantAPI::TenantLockState::UNLOCKED; + + TenantMapEntryTxnStateStore() {} + TenantMapEntryTxnStateStore(int64_t id, TenantName tenantName, TenantAPI::TenantLockState tenantLockState) + : id(id), tenantName(tenantName), tenantLockState(tenantLockState) {} + + Value encode() const { return ObjectWriter::toValue(*this, IncludeVersion()); } + static TenantMapEntryTxnStateStore decode(ValueRef const& value) { + return ObjectReader::fromStringRef(value, IncludeVersion()); + } + + template + void serialize(Ar& ar) { + serializer(ar, id, tenantLockState, tenantName); + } +}; + +struct TenantMapEntry { + constexpr static FileIdentifier file_identifier = 7054389; + + int64_t id = -1; + Key prefix; + TenantName tenantName; + TenantAPI::TenantLockState tenantLockState = TenantAPI::TenantLockState::UNLOCKED; + Optional tenantLockId; + Optional tenantGroup; + int64_t configurationSequenceNum = 0; + + TenantMapEntry(); + TenantMapEntry(int64_t id, TenantName tenantName); + TenantMapEntry(int64_t id, TenantName tenantName, Optional tenantGroup); + + void setId(int64_t id); + std::string toJson() const; + + bool matchesConfiguration(TenantMapEntry const& other) const; + void configure(Standalone parameter, Optional value); + + Value encode() const { return ObjectWriter::toValue(*this, IncludeVersion()); } + static TenantMapEntry decode(ValueRef const& value) { + return ObjectReader::fromStringRef(value, IncludeVersion()); + } + + TenantMapEntryTxnStateStore toTxnStateStoreEntry() const { + return TenantMapEntryTxnStateStore(id, tenantName, tenantLockState); + } + + bool operator==(TenantMapEntry const& other) const; + bool operator!=(TenantMapEntry const& other) const; + + template + void serialize(Ar& ar) { + serializer(ar, id, tenantName, tenantLockState, tenantLockId, tenantGroup, configurationSequenceNum); + if constexpr (Ar::isDeserializing) { + if (id >= 0) { + prefix = TenantAPI::idToPrefix(id); + } + } + } +}; + +struct TenantGroupEntry { + constexpr static FileIdentifier file_identifier = 10764222; + + TenantGroupEntry() = default; + + json_spirit::mObject toJson() const; + + Value encode() { return ObjectWriter::toValue(*this, IncludeVersion()); } + static TenantGroupEntry decode(ValueRef const& value) { + return ObjectReader::fromStringRef(value, IncludeVersion()); + } + + bool operator==(TenantGroupEntry const& other) const; + bool operator!=(TenantGroupEntry const& other) const; + + template + void serialize(Ar& ar) { + serializer(ar); + } +}; + +class StandardTenantTypes { +public: + using TenantMapEntryT = TenantMapEntry; + using TenantGroupEntryT = TenantGroupEntry; +}; + +struct TenantTombstoneCleanupData { + constexpr static FileIdentifier file_identifier = 3291339; + + // All tombstones have been erased up to and including this id. + // We should not generate new tombstones at IDs equal to or older than this. + int64_t tombstonesErasedThrough = -1; + + // The version at which we will next erase tombstones. + Version nextTombstoneEraseVersion = invalidVersion; + + // When we reach the nextTombstoneEraseVersion, we will erase tombstones up through this ID. + int64_t nextTombstoneEraseId = -1; + + bool operator==(TenantTombstoneCleanupData const& other) const; + bool operator!=(TenantTombstoneCleanupData const& other) const; + + template + void serialize(Ar& ar) { + serializer(ar, tombstonesErasedThrough, nextTombstoneEraseVersion, nextTombstoneEraseId); + } +}; + +// This is used so that tenant IDs will be ordered and so that we can easily map arbitrary ranges in the tenant map to +// the affected tenant IDs. +struct TenantIdCodec { + static Standalone pack(int64_t val) { + int64_t swapped = bigEndian64(val); + return StringRef((uint8_t*)&swapped, sizeof(swapped)); + } + static int64_t unpack(Standalone val) { return bigEndian64(*(int64_t*)val.begin()); } + + static Optional lowerBound(Standalone val) { + if (val >= "\x80"_sr) { + return {}; + } + if (val.size() == 8) { + return unpack(val); + } else if (val.size() > 8) { + int64_t result = unpack(val); + if (result == std::numeric_limits::max()) { + return {}; + } + return result + 1; + } else { + int64_t result = 0; + memcpy(&result, val.begin(), val.size()); + return bigEndian64(result); + } + } +}; + +template +struct TenantMetadataSpecification { + Key subspace; + + KeyBackedObjectMap + tenantMap; + KeyBackedMap tenantNameIndex; + KeyBackedProperty lastTenantId; + KeyBackedBinaryValue tenantCount; + KeyBackedSet tenantTombstones; + KeyBackedObjectProperty tombstoneCleanupData; + KeyBackedSet tenantGroupTenantIndex; + KeyBackedObjectMap + tenantGroupMap; + KeyBackedMap storageQuota; + KeyBackedBinaryValue lastTenantModification; + + TenantMetadataSpecification(KeyRef prefix) + : subspace(prefix.withSuffix("tenant/"_sr)), tenantMap(subspace.withSuffix("map/"_sr), IncludeVersion()), + tenantNameIndex(subspace.withSuffix("nameIndex/"_sr)), lastTenantId(subspace.withSuffix("lastId"_sr)), + tenantCount(subspace.withSuffix("count"_sr)), tenantTombstones(subspace.withSuffix("tombstones/"_sr)), + tombstoneCleanupData(subspace.withSuffix("tombstoneCleanup"_sr), IncludeVersion()), + tenantGroupTenantIndex(subspace.withSuffix("tenantGroup/tenantIndex/"_sr)), + tenantGroupMap(subspace.withSuffix("tenantGroup/map/"_sr), IncludeVersion()), + storageQuota(subspace.withSuffix("storageQuota/"_sr)), + lastTenantModification(subspace.withSuffix("lastModification"_sr)) {} +}; + +struct TenantMetadata { + static TenantMetadataSpecification& instance(); + + static inline auto& subspace() { return instance().subspace; } + static inline auto& tenantMap() { return instance().tenantMap; } + static inline auto& tenantNameIndex() { return instance().tenantNameIndex; } + static inline auto& lastTenantId() { return instance().lastTenantId; } + static inline auto& tenantCount() { return instance().tenantCount; } + static inline auto& tenantTombstones() { return instance().tenantTombstones; } + static inline auto& tombstoneCleanupData() { return instance().tombstoneCleanupData; } + static inline auto& tenantGroupTenantIndex() { return instance().tenantGroupTenantIndex; } + static inline auto& tenantGroupMap() { return instance().tenantGroupMap; } + static inline auto& storageQuota() { return instance().storageQuota; } + static inline auto& lastTenantModification() { return instance().lastTenantModification; } + // This system keys stores the tenant id prefix that is used during metacluster/standalone cluster creation. If the + // key is not present then we will assume the prefix to be 0 + static KeyBackedProperty& tenantIdPrefix(); + + static Key tenantMapPrivatePrefix(); +}; +#endif diff --git a/src/fdbclient/include/fdbclient/TenantData.actor.g.h b/src/fdbclient/include/fdbclient/TenantData.actor.g.h new file mode 100644 index 0000000..6231ff5 --- /dev/null +++ b/src/fdbclient/include/fdbclient/TenantData.actor.g.h @@ -0,0 +1,516 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" +/* + * TenantData.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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(FDBCLIENT_TENANTDATA_ACTOR_G_H) +#define FDBCLIENT_TENANTDATA_ACTOR_G_H +#include "fdbclient/TenantData.actor.g.h" +#elif !defined(FDBCLIENT_TENANTDATA_ACTOR_H) +#define FDBCLIENT_TENANTDATA_ACTOR_H + +#include "fdbclient/FDBOptions.g.h" +#include "fdbclient/KeyBackedTypes.actor.h" +#include "fdbclient/MetaclusterRegistration.h" +#include "fdbclient/Tenant.h" +#include "fdbclient/TenantManagement.actor.h" +#include "flow/BooleanParam.h" + +#include "flow/actorcompiler.h" // This must be the last #include. + +template +class TenantData { +public: + Reference db; + TenantMetadataSpecification* tenantMetadata; + + Optional metaclusterRegistration; + ClusterType clusterType; + + std::map tenantMap; + std::map tenantNameIndex; + int64_t lastTenantId; + int64_t tenantCount; + std::set tenantTombstones; + Optional tombstoneCleanupData; + std::map tenantGroupMap; + std::map> tenantGroupIndex; + std::map storageQuotas; + +private: + // Note: this check can only be run on metaclusters with a reasonable number of tenants, as should be + // the case with the current metacluster simulation workloads + static inline const int metaclusterMaxTenants = 10e6; + + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" +// This generated class is to be used only via loadTenantMetadata() + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" +template + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" +class LoadTenantMetadataActorState { + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" +public: + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + LoadTenantMetadataActorState(TenantData* const& self,Transaction const& tr) + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + : self(self), + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + tr(tr), + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + tenantList(), + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + tenantNameIndexList(), + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + tenantTombstoneList(), + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + tenantGroupList(), + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + tenantGroupTenantTuples(), + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + storageQuotaList() + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" + { + fdb_probe_actor_create("loadTenantMetadata", reinterpret_cast(this)); + + } + ~LoadTenantMetadataActorState() + { + fdb_probe_actor_destroy("loadTenantMetadata", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + StrictFuture __when_expr_0 = store(self->metaclusterRegistration, metacluster::metadata::metaclusterRegistration().get(tr)); + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~LoadTenantMetadataActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->clusterType = self->metaclusterRegistration.present() ? self->metaclusterRegistration.get().clusterType : ClusterType::STANDALONE; + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + StrictFuture __when_expr_1 = store(tenantList, self->tenantMetadata->tenantMap.getRange(tr, {}, {}, metaclusterMaxTenants)) && store(tenantNameIndexList, self->tenantMetadata->tenantNameIndex.getRange(tr, {}, {}, metaclusterMaxTenants)) && store(self->lastTenantId, self->tenantMetadata->lastTenantId.getD(tr, Snapshot::False, -1)) && store(self->tenantCount, self->tenantMetadata->tenantCount.getD(tr, Snapshot::False, 0)) && store(tenantTombstoneList, self->tenantMetadata->tenantTombstones.getRange(tr, {}, {}, metaclusterMaxTenants)) && store(self->tombstoneCleanupData, self->tenantMetadata->tombstoneCleanupData.get(tr)) && store(tenantGroupTenantTuples, self->tenantMetadata->tenantGroupTenantIndex.getRange(tr, {}, {}, metaclusterMaxTenants)) && store(tenantGroupList, self->tenantMetadata->tenantGroupMap.getRange(tr, {}, {}, metaclusterMaxTenants)) && store(storageQuotaList, self->tenantMetadata->storageQuota.getRange(tr, {}, {}, metaclusterMaxTenants)); + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->clusterType = self->metaclusterRegistration.present() ? self->metaclusterRegistration.get().clusterType : ClusterType::STANDALONE; + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + StrictFuture __when_expr_1 = store(tenantList, self->tenantMetadata->tenantMap.getRange(tr, {}, {}, metaclusterMaxTenants)) && store(tenantNameIndexList, self->tenantMetadata->tenantNameIndex.getRange(tr, {}, {}, metaclusterMaxTenants)) && store(self->lastTenantId, self->tenantMetadata->lastTenantId.getD(tr, Snapshot::False, -1)) && store(self->tenantCount, self->tenantMetadata->tenantCount.getD(tr, Snapshot::False, 0)) && store(tenantTombstoneList, self->tenantMetadata->tenantTombstones.getRange(tr, {}, {}, metaclusterMaxTenants)) && store(self->tombstoneCleanupData, self->tenantMetadata->tombstoneCleanupData.get(tr)) && store(tenantGroupTenantTuples, self->tenantMetadata->tenantGroupTenantIndex.getRange(tr, {}, {}, metaclusterMaxTenants)) && store(tenantGroupList, self->tenantMetadata->tenantGroupMap.getRange(tr, {}, {}, metaclusterMaxTenants)) && store(storageQuotaList, self->tenantMetadata->storageQuota.getRange(tr, {}, {}, metaclusterMaxTenants)); + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< LoadTenantMetadataActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< LoadTenantMetadataActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("loadTenantMetadata", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("loadTenantMetadata", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< LoadTenantMetadataActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("loadTenantMetadata", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("loadTenantMetadata", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< LoadTenantMetadataActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("loadTenantMetadata", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("loadTenantMetadata", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT(!tenantList.more); + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->tenantMap = std::map(tenantList.results.begin(), tenantList.results.end()); + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT(!tenantNameIndexList.more); + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->tenantNameIndex = std::map(tenantNameIndexList.results.begin(), tenantNameIndexList.results.end()); + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT(!tenantTombstoneList.more); + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->tenantTombstones = std::set(tenantTombstoneList.results.begin(), tenantTombstoneList.results.end()); + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT(!tenantGroupList.more); + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->tenantGroupMap = std::map( tenantGroupList.results.begin(), tenantGroupList.results.end()); + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT(!storageQuotaList.more); + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->storageQuotas = std::map(storageQuotaList.results.begin(), storageQuotaList.results.end()); + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->tenantGroupIndex.clear(); + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + for( auto t : tenantGroupTenantTuples.results ) { + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT_EQ(t.size(), 2); + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + TenantGroupName tenantGroupName = t.getString(0); + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + int64_t tenantId = t.getInt(1); + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT(self->tenantGroupMap.count(tenantGroupName)); + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT(self->tenantMap.count(tenantId)); + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->tenantGroupIndex[tenantGroupName].insert(tenantId); + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" + } + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT_EQ(self->tenantGroupIndex.size(), self->tenantGroupMap.size()); + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~LoadTenantMetadataActorState(); static_cast(this)->destroy(); return 0; } + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~LoadTenantMetadataActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT(!tenantList.more); + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->tenantMap = std::map(tenantList.results.begin(), tenantList.results.end()); + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT(!tenantNameIndexList.more); + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->tenantNameIndex = std::map(tenantNameIndexList.results.begin(), tenantNameIndexList.results.end()); + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT(!tenantTombstoneList.more); + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->tenantTombstones = std::set(tenantTombstoneList.results.begin(), tenantTombstoneList.results.end()); + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT(!tenantGroupList.more); + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->tenantGroupMap = std::map( tenantGroupList.results.begin(), tenantGroupList.results.end()); + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT(!storageQuotaList.more); + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->storageQuotas = std::map(storageQuotaList.results.begin(), storageQuotaList.results.end()); + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->tenantGroupIndex.clear(); + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + for( auto t : tenantGroupTenantTuples.results ) { + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT_EQ(t.size(), 2); + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + TenantGroupName tenantGroupName = t.getString(0); + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + int64_t tenantId = t.getInt(1); + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT(self->tenantGroupMap.count(tenantGroupName)); + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT(self->tenantMap.count(tenantId)); + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + self->tenantGroupIndex[tenantGroupName].insert(tenantId); + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" + } + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + ASSERT_EQ(self->tenantGroupIndex.size(), self->tenantGroupMap.size()); + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~LoadTenantMetadataActorState(); static_cast(this)->destroy(); return 0; } + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~LoadTenantMetadataActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< LoadTenantMetadataActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< LoadTenantMetadataActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("loadTenantMetadata", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("loadTenantMetadata", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< LoadTenantMetadataActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("loadTenantMetadata", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("loadTenantMetadata", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< LoadTenantMetadataActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("loadTenantMetadata", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("loadTenantMetadata", reinterpret_cast(this), 1); + + } + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + TenantData* self; + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + Transaction tr; + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + KeyBackedRangeResult> tenantList; + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + KeyBackedRangeResult> tenantNameIndexList; + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + KeyBackedRangeResult tenantTombstoneList; + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + KeyBackedRangeResult> tenantGroupList; + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + KeyBackedRangeResult tenantGroupTenantTuples; + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + KeyBackedRangeResult> storageQuotaList; + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" +}; +// This generated class is to be used only via loadTenantMetadata() + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" +template + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" +class LoadTenantMetadataActor final : public Actor, public ActorCallback< LoadTenantMetadataActor, 0, Void >, public ActorCallback< LoadTenantMetadataActor, 1, Void >, public FastAllocated>, public LoadTenantMetadataActorState> { + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< LoadTenantMetadataActor, 0, Void >; +friend struct ActorCallback< LoadTenantMetadataActor, 1, Void >; + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + LoadTenantMetadataActor(TenantData* const& self,Transaction const& tr) + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" + : Actor(), + LoadTenantMetadataActorState>(self, tr) + { + fdb_probe_actor_enter("loadTenantMetadata", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("loadTenantMetadata"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("loadTenantMetadata", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< LoadTenantMetadataActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< LoadTenantMetadataActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" +template + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" +[[nodiscard]] static Future loadTenantMetadata( TenantData* const& self, Transaction const& tr ) { + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + return Future(new LoadTenantMetadataActor(self, tr)); + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.g.h" +} + +#line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantData.actor.h" + +public: + TenantData() {} + TenantData(Reference db, TenantMetadataSpecification* tenantMetadata) + : db(db), tenantMetadata(tenantMetadata) {} + + Future load() { + return runTransactionVoid(db, [this](Reference tr) { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + return loadTenantMetadata(this, tr); + }); + } + + template + Future load(Transaction tr) { + return loadTenantMetadata(this, tr); + } + + // Similar to operator==, but useful in assertions for identifying which member is different + void assertEquals(TenantData const& other) const { + ASSERT(metaclusterRegistration == other.metaclusterRegistration); + ASSERT_EQ(clusterType, other.clusterType); + ASSERT(tenantMap == other.tenantMap); + ASSERT(tenantNameIndex == other.tenantNameIndex); + ASSERT_EQ(lastTenantId, other.lastTenantId); + ASSERT_EQ(tenantCount, other.tenantCount); + ASSERT(tenantTombstones == other.tenantTombstones); + ASSERT(tombstoneCleanupData == other.tombstoneCleanupData); + ASSERT(tenantGroupMap == other.tenantGroupMap); + ASSERT(tenantGroupIndex == other.tenantGroupIndex); + ASSERT(storageQuotas == other.storageQuotas); + } + + bool operator==(TenantData const& other) const { + return metaclusterRegistration == other.metaclusterRegistration && clusterType == other.clusterType && + tenantMap == other.tenantMap && tenantNameIndex == other.tenantNameIndex && + lastTenantId == other.lastTenantId && tenantCount == other.tenantCount && + tenantTombstones == other.tenantTombstones && tombstoneCleanupData == other.tombstoneCleanupData && + tenantGroupMap == other.tenantGroupMap && tenantGroupIndex == other.tenantGroupIndex && + storageQuotas == other.storageQuotas; + } + + bool operator!=(TenantData const& other) const { return !(*this == other); } +}; + +#include "flow/unactorcompiler.h" + +#endif diff --git a/src/fdbclient/include/fdbclient/TenantData.actor.h b/src/fdbclient/include/fdbclient/TenantData.actor.h new file mode 100644 index 0000000..49f353a --- /dev/null +++ b/src/fdbclient/include/fdbclient/TenantData.actor.h @@ -0,0 +1,171 @@ +/* + * TenantData.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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(FDBCLIENT_TENANTDATA_ACTOR_G_H) +#define FDBCLIENT_TENANTDATA_ACTOR_G_H +#include "fdbclient/TenantData.actor.g.h" +#elif !defined(FDBCLIENT_TENANTDATA_ACTOR_H) +#define FDBCLIENT_TENANTDATA_ACTOR_H + +#include "fdbclient/FDBOptions.g.h" +#include "fdbclient/KeyBackedTypes.actor.h" +#include "fdbclient/MetaclusterRegistration.h" +#include "fdbclient/Tenant.h" +#include "fdbclient/TenantManagement.actor.h" +#include "flow/BooleanParam.h" + +#include "flow/actorcompiler.h" // This must be the last #include. + +template +class TenantData { +public: + Reference db; + TenantMetadataSpecification* tenantMetadata; + + Optional metaclusterRegistration; + ClusterType clusterType; + + std::map tenantMap; + std::map tenantNameIndex; + int64_t lastTenantId; + int64_t tenantCount; + std::set tenantTombstones; + Optional tombstoneCleanupData; + std::map tenantGroupMap; + std::map> tenantGroupIndex; + std::map storageQuotas; + +private: + // Note: this check can only be run on metaclusters with a reasonable number of tenants, as should be + // the case with the current metacluster simulation workloads + static inline const int metaclusterMaxTenants = 10e6; + + ACTOR template + static Future loadTenantMetadata(TenantData* self, Transaction tr) { + state KeyBackedRangeResult> tenantList; + state KeyBackedRangeResult> tenantNameIndexList; + state KeyBackedRangeResult tenantTombstoneList; + state KeyBackedRangeResult> tenantGroupList; + state KeyBackedRangeResult tenantGroupTenantTuples; + state KeyBackedRangeResult> storageQuotaList; + + wait(store(self->metaclusterRegistration, metacluster::metadata::metaclusterRegistration().get(tr))); + + self->clusterType = self->metaclusterRegistration.present() ? self->metaclusterRegistration.get().clusterType + : ClusterType::STANDALONE; + + wait(store(tenantList, self->tenantMetadata->tenantMap.getRange(tr, {}, {}, metaclusterMaxTenants)) && + store(tenantNameIndexList, + self->tenantMetadata->tenantNameIndex.getRange(tr, {}, {}, metaclusterMaxTenants)) && + store(self->lastTenantId, self->tenantMetadata->lastTenantId.getD(tr, Snapshot::False, -1)) && + store(self->tenantCount, self->tenantMetadata->tenantCount.getD(tr, Snapshot::False, 0)) && + store(tenantTombstoneList, + self->tenantMetadata->tenantTombstones.getRange(tr, {}, {}, metaclusterMaxTenants)) && + store(self->tombstoneCleanupData, self->tenantMetadata->tombstoneCleanupData.get(tr)) && + store(tenantGroupTenantTuples, + self->tenantMetadata->tenantGroupTenantIndex.getRange(tr, {}, {}, metaclusterMaxTenants)) && + store(tenantGroupList, self->tenantMetadata->tenantGroupMap.getRange(tr, {}, {}, metaclusterMaxTenants)) && + store(storageQuotaList, self->tenantMetadata->storageQuota.getRange(tr, {}, {}, metaclusterMaxTenants))); + + ASSERT(!tenantList.more); + self->tenantMap = std::map(tenantList.results.begin(), + tenantList.results.end()); + + ASSERT(!tenantNameIndexList.more); + self->tenantNameIndex = + std::map(tenantNameIndexList.results.begin(), tenantNameIndexList.results.end()); + + ASSERT(!tenantTombstoneList.more); + self->tenantTombstones = + std::set(tenantTombstoneList.results.begin(), tenantTombstoneList.results.end()); + + ASSERT(!tenantGroupList.more); + self->tenantGroupMap = std::map( + tenantGroupList.results.begin(), tenantGroupList.results.end()); + + ASSERT(!storageQuotaList.more); + self->storageQuotas = + std::map(storageQuotaList.results.begin(), storageQuotaList.results.end()); + + self->tenantGroupIndex.clear(); + for (auto t : tenantGroupTenantTuples.results) { + ASSERT_EQ(t.size(), 2); + TenantGroupName tenantGroupName = t.getString(0); + int64_t tenantId = t.getInt(1); + ASSERT(self->tenantGroupMap.count(tenantGroupName)); + ASSERT(self->tenantMap.count(tenantId)); + self->tenantGroupIndex[tenantGroupName].insert(tenantId); + } + ASSERT_EQ(self->tenantGroupIndex.size(), self->tenantGroupMap.size()); + + return Void(); + } + +public: + TenantData() {} + TenantData(Reference db, TenantMetadataSpecification* tenantMetadata) + : db(db), tenantMetadata(tenantMetadata) {} + + Future load() { + return runTransactionVoid(db, [this](Reference tr) { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + return loadTenantMetadata(this, tr); + }); + } + + template + Future load(Transaction tr) { + return loadTenantMetadata(this, tr); + } + + // Similar to operator==, but useful in assertions for identifying which member is different + void assertEquals(TenantData const& other) const { + ASSERT(metaclusterRegistration == other.metaclusterRegistration); + ASSERT_EQ(clusterType, other.clusterType); + ASSERT(tenantMap == other.tenantMap); + ASSERT(tenantNameIndex == other.tenantNameIndex); + ASSERT_EQ(lastTenantId, other.lastTenantId); + ASSERT_EQ(tenantCount, other.tenantCount); + ASSERT(tenantTombstones == other.tenantTombstones); + ASSERT(tombstoneCleanupData == other.tombstoneCleanupData); + ASSERT(tenantGroupMap == other.tenantGroupMap); + ASSERT(tenantGroupIndex == other.tenantGroupIndex); + ASSERT(storageQuotas == other.storageQuotas); + } + + bool operator==(TenantData const& other) const { + return metaclusterRegistration == other.metaclusterRegistration && clusterType == other.clusterType && + tenantMap == other.tenantMap && tenantNameIndex == other.tenantNameIndex && + lastTenantId == other.lastTenantId && tenantCount == other.tenantCount && + tenantTombstones == other.tenantTombstones && tombstoneCleanupData == other.tombstoneCleanupData && + tenantGroupMap == other.tenantGroupMap && tenantGroupIndex == other.tenantGroupIndex && + storageQuotas == other.storageQuotas; + } + + bool operator!=(TenantData const& other) const { return !(*this == other); } +}; + +#include "flow/unactorcompiler.h" + +#endif diff --git a/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h b/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h new file mode 100644 index 0000000..e75471d --- /dev/null +++ b/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h @@ -0,0 +1,4060 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +/* + * TenantEntryCache.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_TENANTENTRYCACHE_ACTOR_G_H) +#define FDBCLIENT_TENANTENTRYCACHE_ACTOR_G_H +#include "fdbclient/TenantEntryCache.actor.g.h" +#elif !defined(FDBCLIENT_TENANTENTRYCACHE_ACTOR_H) +#define FDBCLIENT_TENANTENTRYCACHE_ACTOR_H + +#pragma once + +#include "fdbclient/DatabaseContext.h" +#include "fdbclient/FDBOptions.g.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/RunRYWTransaction.actor.h" +#include "fdbclient/Tenant.h" +#include "fdbclient/TenantManagement.actor.h" +#include "fdbclient/Knobs.h" +#include "fdbrpc/TenantName.h" +#include "flow/IndexedSet.h" + +#include +#include + +#include "flow/actorcompiler.h" // has to be last include + +using TenantNameEntryPair = std::pair; +using TenantNameEntryPairVec = std::vector; + +enum class TenantEntryCacheRefreshReason { + INIT = 1, + PERIODIC_TASK = 2, + CACHE_MISS = 3, + REMOVE_ENTRY = 4, + WATCH_TRIGGER = 5 +}; +enum class TenantEntryCacheRefreshMode { PERIODIC_TASK = 1, WATCH = 2, NONE = 3 }; + +template +struct TenantEntryCachePayload { + TenantMapEntry entry; + // Custom client payload + T payload; +}; + +template +using TenantEntryCachePayloadFunc = std::function(const TenantMapEntry&)>; + +// In-memory cache for TenantEntryMap objects. It supports three indices: +// 1. Lookup by 'TenantId' +// 2. Lookup by 'TenantPrefix' +// 3. Lookup by 'TenantName' +// TODO: Currently this cache performs poorly if there are tenant access happening to unknown tenants which happens most +// frequently in optional tenant mode but can also happen in required mode if there are alot of tenants created. Further +// as a consequence of the design we cannot be sure that the state of a given tenant is accurate even if its present in +// the cache. + +template +class TenantEntryCache : public ReferenceCounted>, NonCopyable { +private: + UID uid; + Database db; + TenantEntryCachePayloadFunc createPayloadFunc; + TenantEntryCacheRefreshMode refreshMode; + + Future refresher; + Future watchRefresher; + Future lastTenantIdRefresher; + Promise setInitialWatch; + Optional lastTenantId; + Map> mapByTenantId; + Map> mapByTenantName; + + CounterCollection metrics; + Counter hits; + Counter misses; + Counter refreshByCacheInit; + Counter refreshByCacheMiss; + Counter numRefreshes; + Counter refreshByWatchTrigger; + + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +// This generated class is to be used only via getTenantList() + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +template + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class GetTenantListActorState { + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + GetTenantListActorState(Reference const& tr) + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + : tr(tr) + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + fdb_probe_actor_create("getTenantList", reinterpret_cast(this)); + + } + ~GetTenantListActorState() + { + fdb_probe_actor_destroy("getTenantList", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture>> __when_expr_0 = TenantMetadata::tenantMap().getRange(tr, {}, {}, CLIENT_KNOBS->MAX_TENANTS_PER_CLUSTER + 1); + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetTenantListActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(KeyBackedRangeResult> const& tenantList,int loopDepth) + { + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + ASSERT(tenantList.results.size() <= CLIENT_KNOBS->MAX_TENANTS_PER_CLUSTER && !tenantList.more); + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent(SevDebug, "TenantEntryCacheGetTenantList").detail("Count", tenantList.results.size()); + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(tenantList.results); this->~GetTenantListActorState(); static_cast(this)->destroy(); return 0; } + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(tenantList.results); + this->~GetTenantListActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(KeyBackedRangeResult> && tenantList,int loopDepth) + { + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + ASSERT(tenantList.results.size() <= CLIENT_KNOBS->MAX_TENANTS_PER_CLUSTER && !tenantList.more); + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent(SevDebug, "TenantEntryCacheGetTenantList").detail("Count", tenantList.results.size()); + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(tenantList.results); this->~GetTenantListActorState(); static_cast(this)->destroy(); return 0; } + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(tenantList.results); + this->~GetTenantListActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(KeyBackedRangeResult> const& tenantList,int loopDepth) + { + loopDepth = a_body1cont1(tenantList, loopDepth); + + return loopDepth; + } + int a_body1when1(KeyBackedRangeResult> && tenantList,int loopDepth) + { + loopDepth = a_body1cont1(std::move(tenantList), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetTenantListActor, 0, KeyBackedRangeResult> >::remove(); + + } + void a_callback_fire(ActorCallback< GetTenantListActor, 0, KeyBackedRangeResult> >*,KeyBackedRangeResult> const& value) + { + fdb_probe_actor_enter("getTenantList", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenantList", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetTenantListActor, 0, KeyBackedRangeResult> >*,KeyBackedRangeResult> && value) + { + fdb_probe_actor_enter("getTenantList", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenantList", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetTenantListActor, 0, KeyBackedRangeResult> >*,Error err) + { + fdb_probe_actor_enter("getTenantList", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenantList", reinterpret_cast(this), 0); + + } + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + Reference tr; + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +}; +// This generated class is to be used only via getTenantList() + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class GetTenantListActor final : public Actor>>, public ActorCallback< GetTenantListActor, 0, KeyBackedRangeResult> >, public FastAllocated, public GetTenantListActorState { + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetTenantListActor, 0, KeyBackedRangeResult> >; + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + GetTenantListActor(Reference const& tr) + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + : Actor>>(), + GetTenantListActorState(tr) + { + fdb_probe_actor_enter("getTenantList", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getTenantList"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getTenantList", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetTenantListActor, 0, KeyBackedRangeResult> >*)0, actor_cancelled()); break; + } + + } +}; + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +[[nodiscard]] static Future>> getTenantList( Reference const& tr ) { + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + return Future>>(new GetTenantListActor(tr)); + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +} + +#line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +// This generated class is to be used only via refreshCacheById() + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +template + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class RefreshCacheByIdActorState { + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + RefreshCacheByIdActorState(int64_t const& tenantId,TenantEntryCache* const& cache,TenantEntryCacheRefreshReason const& reason) + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + : tenantId(tenantId), + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache(cache), + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + reason(reason) + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + fdb_probe_actor_create("refreshCacheById", reinterpret_cast(this)); + + } + ~RefreshCacheByIdActorState() + { + fdb_probe_actor_destroy("refreshCacheById", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent(SevDebug, "TenantEntryCacheIDRefreshStart", cache->id()).detail("Reason", static_cast(reason)); + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr = cache->getDatabase()->createTransaction(); + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + ; + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~RefreshCacheByIdActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent(SevDebug, "TenantEntryCacheIDRefreshEnd", cache->id()).detail("Reason", static_cast(reason)); + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RefreshCacheByIdActorState(); static_cast(this)->destroy(); return 0; } + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RefreshCacheByIdActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture> __when_expr_0 = TenantMetadata::tenantMap().get(tr, tenantId); + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_1 = tr->onError(e); + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (entry.present()) + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache->put(entry.get()); + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + updateCacheRefreshMetrics(cache, reason); + #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + } + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& __entry,int loopDepth) + { + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + entry = __entry; + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && __entry,int loopDepth) + { + entry = std::move(__entry); + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RefreshCacheByIdActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< RefreshCacheByIdActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("refreshCacheById", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheById", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< RefreshCacheByIdActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("refreshCacheById", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheById", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< RefreshCacheByIdActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("refreshCacheById", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheById", reinterpret_cast(this), 0); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RefreshCacheByIdActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RefreshCacheByIdActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("refreshCacheById", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheById", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< RefreshCacheByIdActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("refreshCacheById", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheById", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< RefreshCacheByIdActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("refreshCacheById", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheById", reinterpret_cast(this), 1); + + } + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + int64_t tenantId; + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TenantEntryCache* cache; + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TenantEntryCacheRefreshReason reason; + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + Reference tr; + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + Optional entry; + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +}; +// This generated class is to be used only via refreshCacheById() + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class RefreshCacheByIdActor final : public Actor, public ActorCallback< RefreshCacheByIdActor, 0, Optional >, public ActorCallback< RefreshCacheByIdActor, 1, Void >, public FastAllocated, public RefreshCacheByIdActorState { + #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< RefreshCacheByIdActor, 0, Optional >; +friend struct ActorCallback< RefreshCacheByIdActor, 1, Void >; + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + RefreshCacheByIdActor(int64_t const& tenantId,TenantEntryCache* const& cache,TenantEntryCacheRefreshReason const& reason) + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + : Actor(), + RefreshCacheByIdActorState(tenantId, cache, reason) + { + fdb_probe_actor_enter("refreshCacheById", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("refreshCacheById"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("refreshCacheById", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< RefreshCacheByIdActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< RefreshCacheByIdActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +[[nodiscard]] static Future refreshCacheById( int64_t const& tenantId, TenantEntryCache* const& cache, TenantEntryCacheRefreshReason const& reason ) { + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + return Future(new RefreshCacheByIdActor(tenantId, cache, reason)); + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +} + +#line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +// This generated class is to be used only via refreshCacheByName() + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +template + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class RefreshCacheByNameActorState { + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + RefreshCacheByNameActorState(TenantName const& name,TenantEntryCache* const& cache,TenantEntryCacheRefreshReason const& reason) + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + : name(name), + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache(cache), + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + reason(reason) + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + fdb_probe_actor_create("refreshCacheByName", reinterpret_cast(this)); + + } + ~RefreshCacheByNameActorState() + { + fdb_probe_actor_destroy("refreshCacheByName", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent(SevDebug, "TenantEntryCacheNameRefreshStart", cache->id()) .detail("Reason", static_cast(reason)); + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr = cache->getDatabase()->createTransaction(); + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + ; + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~RefreshCacheByNameActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent(SevDebug, "TenantEntryCacheNameRefreshEnd", cache->id()).detail("Reason", static_cast(reason)); + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RefreshCacheByNameActorState(); static_cast(this)->destroy(); return 0; } + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RefreshCacheByNameActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture> __when_expr_0 = TenantMetadata::tenantNameIndex().get(tr, name); + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_2 = tr->onError(e); + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (tenantId.present()) + #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture> __when_expr_1 = TenantMetadata::tenantMap().get(tr, tenantId.get()); + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont3(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& __tenantId,int loopDepth) + { + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tenantId = __tenantId; + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && __tenantId,int loopDepth) + { + tenantId = std::move(__tenantId); + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RefreshCacheByNameActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< RefreshCacheByNameActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("refreshCacheByName", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheByName", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< RefreshCacheByNameActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("refreshCacheByName", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheByName", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< RefreshCacheByNameActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("refreshCacheByName", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheByName", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(int loopDepth) + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1cont4(Optional const& entry,int loopDepth) + { + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (entry.present()) + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache->put(entry.get()); + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + updateCacheRefreshMetrics(cache, reason); + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + } + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(Optional && entry,int loopDepth) + { + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (entry.present()) + #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache->put(entry.get()); + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + updateCacheRefreshMetrics(cache, reason); + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + } + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Optional const& entry,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(entry, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Optional && entry,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(entry), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RefreshCacheByNameActor, 1, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< RefreshCacheByNameActor, 1, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("refreshCacheByName", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheByName", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< RefreshCacheByNameActor, 1, Optional >*,Optional && value) + { + fdb_probe_actor_enter("refreshCacheByName", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheByName", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< RefreshCacheByNameActor, 1, Optional >*,Error err) + { + fdb_probe_actor_enter("refreshCacheByName", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheByName", reinterpret_cast(this), 1); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RefreshCacheByNameActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RefreshCacheByNameActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("refreshCacheByName", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheByName", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< RefreshCacheByNameActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("refreshCacheByName", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheByName", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< RefreshCacheByNameActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("refreshCacheByName", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheByName", reinterpret_cast(this), 2); + + } + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TenantName name; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TenantEntryCache* cache; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TenantEntryCacheRefreshReason reason; + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + Reference tr; + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + Optional tenantId; + #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +}; +// This generated class is to be used only via refreshCacheByName() + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class RefreshCacheByNameActor final : public Actor, public ActorCallback< RefreshCacheByNameActor, 0, Optional >, public ActorCallback< RefreshCacheByNameActor, 1, Optional >, public ActorCallback< RefreshCacheByNameActor, 2, Void >, public FastAllocated, public RefreshCacheByNameActorState { + #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< RefreshCacheByNameActor, 0, Optional >; +friend struct ActorCallback< RefreshCacheByNameActor, 1, Optional >; +friend struct ActorCallback< RefreshCacheByNameActor, 2, Void >; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + RefreshCacheByNameActor(TenantName const& name,TenantEntryCache* const& cache,TenantEntryCacheRefreshReason const& reason) + #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + : Actor(), + RefreshCacheByNameActorState(name, cache, reason) + { + fdb_probe_actor_enter("refreshCacheByName", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("refreshCacheByName"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("refreshCacheByName", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< RefreshCacheByNameActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< RefreshCacheByNameActor, 1, Optional >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< RefreshCacheByNameActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +[[nodiscard]] static Future refreshCacheByName( TenantName const& name, TenantEntryCache* const& cache, TenantEntryCacheRefreshReason const& reason ) { + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + return Future(new RefreshCacheByNameActor(name, cache, reason)); + #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +} + +#line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + + static void updateCacheRefreshMetrics(TenantEntryCache* cache, TenantEntryCacheRefreshReason reason) { + if (reason == TenantEntryCacheRefreshReason::INIT) { + cache->refreshByCacheInit += 1; + } else if (reason == TenantEntryCacheRefreshReason::CACHE_MISS) { + cache->refreshByCacheMiss += 1; + } else if (reason == TenantEntryCacheRefreshReason::WATCH_TRIGGER) { + cache->refreshByWatchTrigger += 1; + } + + cache->numRefreshes += 1; + } + + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +// This generated class is to be used only via refreshCacheUsingWatch() + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +template + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class RefreshCacheUsingWatchActorState { + #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + RefreshCacheUsingWatchActorState(TenantEntryCache* const& cache,TenantEntryCacheRefreshReason const& reason) + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + : cache(cache), + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + reason(reason) + #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + fdb_probe_actor_create("refreshCacheUsingWatch", reinterpret_cast(this)); + + } + ~RefreshCacheUsingWatchActorState() + { + fdb_probe_actor_destroy("refreshCacheUsingWatch", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent(SevDebug, "TenantEntryCacheRefreshUsingWatchStart", cache->id()) .detail("Reason", static_cast(reason)); + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr = cache->getDatabase()->createTransaction(); + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + ; + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~RefreshCacheUsingWatchActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tenantModifiedWatch = TenantMetadata::lastTenantModification().watch(tr); + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_0 = tr->commit(); + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (e.code() != error_code_actor_cancelled) + #line 1256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent("TenantEntryCacheRefreshUsingWatchError", cache->id()) .errorUnsuppressed(e) .suppressFor(1.0); + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + } + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_3 = tr->onError(e); + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Void const& _,int loopDepth) + { + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent(SevDebug, "TenantEntryCacheRefreshWatchSet", cache->id()); + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (cache->setInitialWatch.canBeSet()) + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache->setInitialWatch.send(Void()); + #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + } + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_1 = tenantModifiedWatch; + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Void && _,int loopDepth) + { + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent(SevDebug, "TenantEntryCacheRefreshWatchSet", cache->id()); + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (cache->setInitialWatch.canBeSet()) + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache->setInitialWatch.send(Void()); + #line 1318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + } + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_1 = tenantModifiedWatch; + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RefreshCacheUsingWatchActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RefreshCacheUsingWatchActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< RefreshCacheUsingWatchActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< RefreshCacheUsingWatchActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent(SevDebug, "TenantEntryCacheRefreshUsingWatchTriggered", cache->id()) .detail("Reason", static_cast(reason)); + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_2 = refreshImpl(cache, reason); + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent(SevDebug, "TenantEntryCacheRefreshUsingWatchTriggered", cache->id()) .detail("Reason", static_cast(reason)); + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_2 = refreshImpl(cache, reason); + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RefreshCacheUsingWatchActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RefreshCacheUsingWatchActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< RefreshCacheUsingWatchActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< RefreshCacheUsingWatchActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont5(Void const& _,int loopDepth) + { + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->reset(); + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = a_body1loopBody1cont7(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont5(Void && _,int loopDepth) + { + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->reset(); + #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = a_body1loopBody1cont7(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont5(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont5(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RefreshCacheUsingWatchActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RefreshCacheUsingWatchActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< RefreshCacheUsingWatchActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< RefreshCacheUsingWatchActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 2); + + } + int a_body1loopBody1cont7(int loopDepth) + { + try { + loopDepth = a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_4 = refreshImpl(cache, reason); + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1cont1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_4 = refreshImpl(cache, reason); + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1cont1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RefreshCacheUsingWatchActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RefreshCacheUsingWatchActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< RefreshCacheUsingWatchActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< RefreshCacheUsingWatchActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 3); + + } + int a_body1loopBody1Catch1cont3(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont3(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RefreshCacheUsingWatchActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RefreshCacheUsingWatchActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1Catch1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< RefreshCacheUsingWatchActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1Catch1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< RefreshCacheUsingWatchActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), 4); + + } + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TenantEntryCache* cache; + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TenantEntryCacheRefreshReason reason; + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + Reference tr; + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + Future tenantModifiedWatch; + #line 1768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +}; +// This generated class is to be used only via refreshCacheUsingWatch() + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class RefreshCacheUsingWatchActor final : public Actor, public ActorCallback< RefreshCacheUsingWatchActor, 0, Void >, public ActorCallback< RefreshCacheUsingWatchActor, 1, Void >, public ActorCallback< RefreshCacheUsingWatchActor, 2, Void >, public ActorCallback< RefreshCacheUsingWatchActor, 3, Void >, public ActorCallback< RefreshCacheUsingWatchActor, 4, Void >, public FastAllocated, public RefreshCacheUsingWatchActorState { + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< RefreshCacheUsingWatchActor, 0, Void >; +friend struct ActorCallback< RefreshCacheUsingWatchActor, 1, Void >; +friend struct ActorCallback< RefreshCacheUsingWatchActor, 2, Void >; +friend struct ActorCallback< RefreshCacheUsingWatchActor, 3, Void >; +friend struct ActorCallback< RefreshCacheUsingWatchActor, 4, Void >; + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + RefreshCacheUsingWatchActor(TenantEntryCache* const& cache,TenantEntryCacheRefreshReason const& reason) + #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + : Actor(), + RefreshCacheUsingWatchActorState(cache, reason) + { + fdb_probe_actor_enter("refreshCacheUsingWatch", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("refreshCacheUsingWatch"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("refreshCacheUsingWatch", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< RefreshCacheUsingWatchActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< RefreshCacheUsingWatchActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< RefreshCacheUsingWatchActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< RefreshCacheUsingWatchActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< RefreshCacheUsingWatchActor, 4, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +[[nodiscard]] static Future refreshCacheUsingWatch( TenantEntryCache* const& cache, TenantEntryCacheRefreshReason const& reason ) { + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + return Future(new RefreshCacheUsingWatchActor(cache, reason)); + #line 1819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +} + +#line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + + static bool tenantsEnabled(TenantEntryCache* cache) { + // Avoid using the cache if the tenant mode is disabled. However since we use clientInfo, sometimes it may not + // be fully up to date (i.e it may indicate the tenantMode is disabled when in fact it is required). Thus if + // there is at least one tenant that has been created on the cluster then use the cache to avoid an incorrect + // miss. + if (cache->getDatabase()->clientInfo->get().tenantMode == TenantMode::DISABLED) { + if (!cache->lastTenantId.present()) { + return false; + } + return cache->lastTenantId.get() >= 0; + } + return true; + } + + #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +// This generated class is to be used only via setLastTenantId() + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +template + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class SetLastTenantIdActorState { + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + SetLastTenantIdActorState(TenantEntryCache* const& cache) + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + : cache(cache), + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr(cache->getDatabase()->createTransaction()) + #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + fdb_probe_actor_create("setLastTenantId", reinterpret_cast(this)); + + } + ~SetLastTenantIdActorState() + { + fdb_probe_actor_destroy("setLastTenantId", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + ; + #line 1868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~SetLastTenantIdActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture> __when_expr_0 = TenantMetadata::lastTenantId().get(tr); + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 1907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_1 = tr->onError(e); + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Optional const& lastTenantId,int loopDepth) + { + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache->lastTenantId = lastTenantId; + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SetLastTenantIdActorState(); static_cast(this)->destroy(); return 0; } + #line 1958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~SetLastTenantIdActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Optional && lastTenantId,int loopDepth) + { + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache->lastTenantId = lastTenantId; + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SetLastTenantIdActorState(); static_cast(this)->destroy(); return 0; } + #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~SetLastTenantIdActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& lastTenantId,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(lastTenantId, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && lastTenantId,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(lastTenantId), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SetLastTenantIdActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< SetLastTenantIdActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("setLastTenantId", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("setLastTenantId", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< SetLastTenantIdActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("setLastTenantId", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("setLastTenantId", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< SetLastTenantIdActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("setLastTenantId", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("setLastTenantId", reinterpret_cast(this), 0); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SetLastTenantIdActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SetLastTenantIdActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("setLastTenantId", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("setLastTenantId", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< SetLastTenantIdActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("setLastTenantId", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("setLastTenantId", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< SetLastTenantIdActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("setLastTenantId", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("setLastTenantId", reinterpret_cast(this), 1); + + } + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TenantEntryCache* cache; + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + Reference tr; + #line 2122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +}; +// This generated class is to be used only via setLastTenantId() + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class SetLastTenantIdActor final : public Actor, public ActorCallback< SetLastTenantIdActor, 0, Optional >, public ActorCallback< SetLastTenantIdActor, 1, Void >, public FastAllocated, public SetLastTenantIdActorState { + #line 2127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< SetLastTenantIdActor, 0, Optional >; +friend struct ActorCallback< SetLastTenantIdActor, 1, Void >; + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + SetLastTenantIdActor(TenantEntryCache* const& cache) + #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + : Actor(), + SetLastTenantIdActorState(cache) + { + fdb_probe_actor_enter("setLastTenantId", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("setLastTenantId"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("setLastTenantId", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< SetLastTenantIdActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< SetLastTenantIdActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +[[nodiscard]] static Future setLastTenantId( TenantEntryCache* const& cache ) { + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + return Future(new SetLastTenantIdActor(cache)); + #line 2167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +} + +#line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +// This generated class is to be used only via lastTenantIdWatch() + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +template + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class LastTenantIdWatchActorState { + #line 2178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + LastTenantIdWatchActorState(TenantEntryCache* const& cache) + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + : cache(cache) + #line 2185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + fdb_probe_actor_create("lastTenantIdWatch", reinterpret_cast(this)); + + } + ~LastTenantIdWatchActorState() + { + fdb_probe_actor_destroy("lastTenantIdWatch", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent(SevDebug, "TenantEntryCacheLastTenantIdWatchStart", cache->id()); + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr = cache->getDatabase()->createTransaction(); + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + ; + #line 2204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~LastTenantIdWatchActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + lastTenantIdWatch = tr->watch(TenantMetadata::lastTenantId().key); + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_0 = tr->commit(); + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + err = Error(e); + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (err.code() != error_code_actor_cancelled) + #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent("TenantEntryCacheLastTenantIdWatchError", cache->id()) .errorUnsuppressed(err) .suppressFor(1.0); + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_3 = setLastTenantId(cache); + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Void const& _,int loopDepth) + { + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_1 = lastTenantIdWatch; + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Void && _,int loopDepth) + { + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_1 = lastTenantIdWatch; + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< LastTenantIdWatchActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< LastTenantIdWatchActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< LastTenantIdWatchActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< LastTenantIdWatchActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_2 = setLastTenantId(cache); + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_2 = setLastTenantId(cache); + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< LastTenantIdWatchActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< LastTenantIdWatchActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< LastTenantIdWatchActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< LastTenantIdWatchActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont4(Void const& _,int loopDepth) + { + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->reset(); + #line 2497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = a_body1loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr->reset(); + #line 2506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = a_body1loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< LastTenantIdWatchActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< LastTenantIdWatchActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< LastTenantIdWatchActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< LastTenantIdWatchActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 2); + + } + int a_body1loopBody1cont6(int loopDepth) + { + try { + loopDepth = a_body1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(int loopDepth) + { + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_4 = tr->onError(err); + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1cont1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1Catch1cont2(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont2(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< LastTenantIdWatchActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< LastTenantIdWatchActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< LastTenantIdWatchActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< LastTenantIdWatchActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 3); + + } + int a_body1loopBody1Catch1cont3(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont3(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< LastTenantIdWatchActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< LastTenantIdWatchActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1Catch1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< LastTenantIdWatchActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1Catch1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< LastTenantIdWatchActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), 4); + + } + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TenantEntryCache* cache; + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + Reference tr; + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + Future lastTenantIdWatch; + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + Error err; + #line 2761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +}; +// This generated class is to be used only via lastTenantIdWatch() + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class LastTenantIdWatchActor final : public Actor, public ActorCallback< LastTenantIdWatchActor, 0, Void >, public ActorCallback< LastTenantIdWatchActor, 1, Void >, public ActorCallback< LastTenantIdWatchActor, 2, Void >, public ActorCallback< LastTenantIdWatchActor, 3, Void >, public ActorCallback< LastTenantIdWatchActor, 4, Void >, public FastAllocated, public LastTenantIdWatchActorState { + #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< LastTenantIdWatchActor, 0, Void >; +friend struct ActorCallback< LastTenantIdWatchActor, 1, Void >; +friend struct ActorCallback< LastTenantIdWatchActor, 2, Void >; +friend struct ActorCallback< LastTenantIdWatchActor, 3, Void >; +friend struct ActorCallback< LastTenantIdWatchActor, 4, Void >; + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + LastTenantIdWatchActor(TenantEntryCache* const& cache) + #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + : Actor(), + LastTenantIdWatchActorState(cache) + { + fdb_probe_actor_enter("lastTenantIdWatch", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("lastTenantIdWatch"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("lastTenantIdWatch", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< LastTenantIdWatchActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< LastTenantIdWatchActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< LastTenantIdWatchActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< LastTenantIdWatchActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< LastTenantIdWatchActor, 4, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +[[nodiscard]] static Future lastTenantIdWatch( TenantEntryCache* const& cache ) { + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + return Future(new LastTenantIdWatchActor(cache)); + #line 2812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +} + +#line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + + #line 2817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +// This generated class is to be used only via refreshImpl() + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +template + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class RefreshImplActorState { + #line 2823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + RefreshImplActorState(TenantEntryCache* const& cache,TenantEntryCacheRefreshReason const& reason) + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + : cache(cache), + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + reason(reason) + #line 2832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + fdb_probe_actor_create("refreshImpl", reinterpret_cast(this)); + + } + ~RefreshImplActorState() + { + fdb_probe_actor_destroy("refreshImpl", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent(SevDebug, "TenantEntryCacheRefreshStart", cache->id()).detail("Reason", static_cast(reason)); + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tr = cache->getDatabase()->createTransaction(); + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + ; + #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~RefreshImplActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent(SevDebug, "TenantEntryCacheRefreshEnd", cache->id()).detail("Reason", static_cast(reason)); + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RefreshImplActorState(); static_cast(this)->destroy(); return 0; } + #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RefreshImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture>> __when_expr_0 = getTenantList(tr); + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (e.code() != error_code_actor_cancelled) + #line 2938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent("TenantEntryCacheRefreshError", cache->id()).errorUnsuppressed(e).suppressFor(1.0); + #line 2942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + } + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_1 = tr->onError(e); + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache->clear(); + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + for( auto& tenant : tenantList ) { + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache->put(tenant.second); + #line 2972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + } + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + updateCacheRefreshMetrics(cache, reason); + #line 2976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + + return loopDepth; + } + int a_body1loopBody1when1(std::vector> const& __tenantList,int loopDepth) + { + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tenantList = __tenantList; + #line 2985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(std::vector> && __tenantList,int loopDepth) + { + tenantList = std::move(__tenantList); + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RefreshImplActor, 0, std::vector> >::remove(); + + } + void a_callback_fire(ActorCallback< RefreshImplActor, 0, std::vector> >*,std::vector> const& value) + { + fdb_probe_actor_enter("refreshImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshImpl", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< RefreshImplActor, 0, std::vector> >*,std::vector> && value) + { + fdb_probe_actor_enter("refreshImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshImpl", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< RefreshImplActor, 0, std::vector> >*,Error err) + { + fdb_probe_actor_enter("refreshImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshImpl", reinterpret_cast(this), 0); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RefreshImplActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RefreshImplActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("refreshImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshImpl", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< RefreshImplActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("refreshImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshImpl", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< RefreshImplActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("refreshImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("refreshImpl", reinterpret_cast(this), 1); + + } + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TenantEntryCache* cache; + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TenantEntryCacheRefreshReason reason; + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + Reference tr; + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + std::vector> tenantList; + #line 3131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +}; +// This generated class is to be used only via refreshImpl() + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class RefreshImplActor final : public Actor, public ActorCallback< RefreshImplActor, 0, std::vector> >, public ActorCallback< RefreshImplActor, 1, Void >, public FastAllocated, public RefreshImplActorState { + #line 3136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< RefreshImplActor, 0, std::vector> >; +friend struct ActorCallback< RefreshImplActor, 1, Void >; + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + RefreshImplActor(TenantEntryCache* const& cache,TenantEntryCacheRefreshReason const& reason) + #line 3148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + : Actor(), + RefreshImplActorState(cache, reason) + { + fdb_probe_actor_enter("refreshImpl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("refreshImpl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("refreshImpl", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< RefreshImplActor, 0, std::vector> >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< RefreshImplActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +[[nodiscard]] static Future refreshImpl( TenantEntryCache* const& cache, TenantEntryCacheRefreshReason const& reason ) { + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + return Future(new RefreshImplActor(cache, reason)); + #line 3176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +} + +#line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + + #line 3181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +// This generated class is to be used only via getByIdImpl() + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +template + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class GetByIdImplActorState { + #line 3187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + GetByIdImplActorState(TenantEntryCache* const& cache,int64_t const& tenantId) + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + : cache(cache), + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + tenantId(tenantId) + #line 3196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + fdb_probe_actor_create("getByIdImpl", reinterpret_cast(this)); + + } + ~GetByIdImplActorState() + { + fdb_probe_actor_destroy("getByIdImpl", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + Optional> ret = cache->lookupById(tenantId); + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (ret.present()) + #line 3213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache->hits += 1; + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(ret); this->~GetByIdImplActorState(); static_cast(this)->destroy(); return 0; } + #line 3219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + new (&static_cast(this)->SAV< Optional> >::value()) Optional>(ret); + this->~GetByIdImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!tenantsEnabled(cache)) + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(Optional>()); this->~GetByIdImplActorState(); static_cast(this)->destroy(); return 0; } + #line 3231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + new (&static_cast(this)->SAV< Optional> >::value()) Optional>(Optional>()); + this->~GetByIdImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent("TenantEntryCacheGetByIdRefresh").detail("TenantId", tenantId); + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (cache->refreshMode == TenantEntryCacheRefreshMode::WATCH) + #line 3241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_0 = refreshCacheById(tenantId, cache, TenantEntryCacheRefreshReason::CACHE_MISS); + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + else + { + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_1 = refreshImpl(cache, TenantEntryCacheRefreshReason::CACHE_MISS); + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetByIdImplActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache->misses += 1; + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(cache->lookupById(tenantId)); this->~GetByIdImplActorState(); static_cast(this)->destroy(); return 0; } + #line 3292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + new (&static_cast(this)->SAV< Optional> >::value()) Optional>(cache->lookupById(tenantId)); + this->~GetByIdImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont4(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont4(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetByIdImplActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetByIdImplActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getByIdImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getByIdImpl", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetByIdImplActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getByIdImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getByIdImpl", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetByIdImplActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getByIdImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getByIdImpl", reinterpret_cast(this), 0); + + } + int a_body1cont5(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont5(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont5(_, loopDepth); + + return loopDepth; + } + int a_body1when2(Void && _,int loopDepth) + { + loopDepth = a_body1cont5(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetByIdImplActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetByIdImplActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("getByIdImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getByIdImpl", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetByIdImplActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("getByIdImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getByIdImpl", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetByIdImplActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("getByIdImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getByIdImpl", reinterpret_cast(this), 1); + + } + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TenantEntryCache* cache; + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + int64_t tenantId; + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +}; +// This generated class is to be used only via getByIdImpl() + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class GetByIdImplActor final : public Actor>>, public ActorCallback< GetByIdImplActor, 0, Void >, public ActorCallback< GetByIdImplActor, 1, Void >, public FastAllocated, public GetByIdImplActorState { + #line 3459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetByIdImplActor, 0, Void >; +friend struct ActorCallback< GetByIdImplActor, 1, Void >; + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + GetByIdImplActor(TenantEntryCache* const& cache,int64_t const& tenantId) + #line 3471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + : Actor>>(), + GetByIdImplActorState(cache, tenantId) + { + fdb_probe_actor_enter("getByIdImpl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getByIdImpl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getByIdImpl", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetByIdImplActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetByIdImplActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +[[nodiscard]] static Future>> getByIdImpl( TenantEntryCache* const& cache, int64_t const& tenantId ) { + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + return Future>>(new GetByIdImplActor(cache, tenantId)); + #line 3499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +} + +#line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + + #line 3504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +// This generated class is to be used only via getByNameImpl() + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +template + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class GetByNameImplActorState { + #line 3510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + GetByNameImplActorState(TenantEntryCache* const& cache,TenantName const& name) + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + : cache(cache), + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + name(name) + #line 3519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + fdb_probe_actor_create("getByNameImpl", reinterpret_cast(this)); + + } + ~GetByNameImplActorState() + { + fdb_probe_actor_destroy("getByNameImpl", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + Optional> ret = cache->lookupByName(name); + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (ret.present()) + #line 3536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache->hits += 1; + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(ret); this->~GetByNameImplActorState(); static_cast(this)->destroy(); return 0; } + #line 3542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + new (&static_cast(this)->SAV< Optional> >::value()) Optional>(ret); + this->~GetByNameImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!tenantsEnabled(cache)) + #line 3550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(Optional>()); this->~GetByNameImplActorState(); static_cast(this)->destroy(); return 0; } + #line 3554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + new (&static_cast(this)->SAV< Optional> >::value()) Optional>(Optional>()); + this->~GetByNameImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TraceEvent("TenantEntryCacheGetByNameRefresh").detail("TenantName", name); + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (cache->refreshMode == TenantEntryCacheRefreshMode::WATCH) + #line 3564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + { + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_0 = refreshCacheByName(name, cache, TenantEntryCacheRefreshReason::CACHE_MISS); + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + else + { + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + StrictFuture __when_expr_1 = refreshImpl(cache, TenantEntryCacheRefreshReason::CACHE_MISS); + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + loopDepth = 0; + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetByNameImplActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + cache->misses += 1; + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(cache->lookupByName(name)); this->~GetByNameImplActorState(); static_cast(this)->destroy(); return 0; } + #line 3615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + new (&static_cast(this)->SAV< Optional> >::value()) Optional>(cache->lookupByName(name)); + this->~GetByNameImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont4(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont4(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetByNameImplActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetByNameImplActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getByNameImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getByNameImpl", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetByNameImplActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getByNameImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getByNameImpl", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetByNameImplActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getByNameImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getByNameImpl", reinterpret_cast(this), 0); + + } + int a_body1cont5(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont5(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont5(_, loopDepth); + + return loopDepth; + } + int a_body1when2(Void && _,int loopDepth) + { + loopDepth = a_body1cont5(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetByNameImplActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetByNameImplActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("getByNameImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getByNameImpl", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetByNameImplActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("getByNameImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getByNameImpl", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetByNameImplActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("getByNameImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getByNameImpl", reinterpret_cast(this), 1); + + } + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TenantEntryCache* cache; + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + TenantName name; + #line 3777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +}; +// This generated class is to be used only via getByNameImpl() + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +class GetByNameImplActor final : public Actor>>, public ActorCallback< GetByNameImplActor, 0, Void >, public ActorCallback< GetByNameImplActor, 1, Void >, public FastAllocated, public GetByNameImplActorState { + #line 3782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetByNameImplActor, 0, Void >; +friend struct ActorCallback< GetByNameImplActor, 1, Void >; + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + GetByNameImplActor(TenantEntryCache* const& cache,TenantName const& name) + #line 3794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" + : Actor>>(), + GetByNameImplActorState(cache, name) + { + fdb_probe_actor_enter("getByNameImpl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getByNameImpl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getByNameImpl", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetByNameImplActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetByNameImplActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" +[[nodiscard]] static Future>> getByNameImpl( TenantEntryCache* const& cache, TenantName const& name ) { + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + return Future>>(new GetByNameImplActor(cache, name)); + #line 3822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.g.h" +} + +#line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h" + + Optional> lookupById(int64_t tenantId) { + Optional> ret; + auto itr = mapByTenantId.find(tenantId); + if (itr == mapByTenantId.end()) { + return ret; + } + + return itr->value; + } + + Optional> lookupByName(TenantName name) { + Optional> ret; + auto itr = mapByTenantName.find(name); + if (itr == mapByTenantName.end()) { + return ret; + } + + return itr->value; + } + + Future refresh(TenantEntryCacheRefreshReason reason) { return refreshImpl(this, reason); } + + static TenantEntryCachePayload defaultCreatePayload(const TenantMapEntry& entry) { + TenantEntryCachePayload payload; + payload.entry = entry; + + return payload; + } + + Future removeEntryInt(Optional tenantId, + Optional tenantPrefix, + Optional tenantName, + bool refreshCache) { + typename Map>::iterator itrId; + typename Map>::iterator itrName; + + if (tenantId.present() || tenantPrefix.present()) { + // Ensure either tenantId OR tenantPrefix is valid (but not both) + ASSERT(tenantId.present() != tenantPrefix.present()); + ASSERT(!tenantName.present()); + + int64_t tId = tenantId.present() ? tenantId.get() : TenantAPI::prefixToId(tenantPrefix.get()); + TraceEvent("TenantEntryCacheRemoveEntry").detail("Id", tId); + itrId = mapByTenantId.find(tId); + if (itrId == mapByTenantId.end()) { + return Void(); + } + // Ensure byId and byName cache are in-sync + itrName = mapByTenantName.find(itrId->value.entry.tenantName); + ASSERT(itrName != mapByTenantName.end()); + } else if (tenantName.present()) { + ASSERT(!tenantId.present() && !tenantPrefix.present()); + + TraceEvent("TenantEntryCacheRemoveEntry").detail("Name", tenantName.get()); + itrName = mapByTenantName.find(tenantName.get()); + if (itrName == mapByTenantName.end()) { + return Void(); + } + // Ensure byId and byName cache are in-sync + itrId = mapByTenantId.find(itrName->value.entry.id); + ASSERT(itrId != mapByTenantId.end()); + } else { + // Invalid input, one of: tenantId, tenantPrefix or tenantName needs to be valid. + throw operation_failed(); + } + + ASSERT(itrId != mapByTenantId.end() && itrName != mapByTenantName.end()); + + TraceEvent("TenantEntryCacheRemoveEntry") + .detail("Id", itrId->key) + .detail("Prefix", itrId->value.entry.prefix) + .detail("Name", itrName->key); + + mapByTenantId.erase(itrId); + mapByTenantName.erase(itrName); + + if (refreshCache) { + return refreshImpl(this, TenantEntryCacheRefreshReason::REMOVE_ENTRY); + } + + return Void(); + } + +public: + TenantEntryCache(Database db) + : uid(deterministicRandom()->randomUniqueID()), db(db), createPayloadFunc(defaultCreatePayload), + refreshMode(TenantEntryCacheRefreshMode::PERIODIC_TASK), metrics("TenantEntryCacheMetrics", uid.toString()), + hits("TenantEntryCacheHits", metrics), misses("TenantEntryCacheMisses", metrics), + refreshByCacheInit("TenantEntryCacheRefreshInit", metrics), + refreshByCacheMiss("TenantEntryCacheRefreshMiss", metrics), + numRefreshes("TenantEntryCacheNumRefreshes", metrics), + refreshByWatchTrigger("TenantEntryCacheRefreshWatchTrigger", metrics) { + TraceEvent("TenantEntryCacheCreatedDefaultFunc", uid); + } + + TenantEntryCache(Database db, TenantEntryCacheRefreshMode mode) + : uid(deterministicRandom()->randomUniqueID()), db(db), createPayloadFunc(defaultCreatePayload), + refreshMode(mode), metrics("TenantEntryCacheMetrics", uid.toString()), hits("TenantEntryCacheHits", metrics), + misses("TenantEntryCacheMisses", metrics), refreshByCacheInit("TenantEntryCacheRefreshInit", metrics), + refreshByCacheMiss("TenantEntryCacheRefreshMiss", metrics), + numRefreshes("TenantEntryCacheNumRefreshes", metrics), + refreshByWatchTrigger("TenantEntryCacheRefreshWatchTrigger", metrics) { + TraceEvent("TenantEntryCacheCreatedDefaultFunc", uid); + } + + TenantEntryCache(Database db, TenantEntryCachePayloadFunc fn) + : uid(deterministicRandom()->randomUniqueID()), db(db), createPayloadFunc(fn), + refreshMode(TenantEntryCacheRefreshMode::PERIODIC_TASK), metrics("TenantEntryCacheMetrics", uid.toString()), + hits("TenantEntryCacheHits", metrics), misses("TenantEntryCacheMisses", metrics), + refreshByCacheInit("TenantEntryCacheRefreshInit", metrics), + refreshByCacheMiss("TenantEntryCacheRefreshMiss", metrics), + numRefreshes("TenantEntryCacheNumRefreshes", metrics), + refreshByWatchTrigger("TenantEntryCacheRefreshWatchTrigger", metrics) { + TraceEvent("TenantEntryCacheCreated", uid); + } + + TenantEntryCache(Database db, UID id, TenantEntryCachePayloadFunc fn) + : uid(id), db(db), createPayloadFunc(fn), refreshMode(TenantEntryCacheRefreshMode::PERIODIC_TASK), + metrics("TenantEntryCacheMetrics", uid.toString()), hits("TenantEntryCacheHits", metrics), + misses("TenantEntryCacheMisses", metrics), refreshByCacheInit("TenantEntryCacheRefreshInit", metrics), + refreshByCacheMiss("TenantEntryCacheRefreshMiss", metrics), + numRefreshes("TenantEntryCacheNumRefreshes", metrics), + refreshByWatchTrigger("TenantEntryCacheRefreshWatchTrigger", metrics) { + TraceEvent("TenantEntryCacheCreated", uid); + } + + TenantEntryCache(Database db, UID id, TenantEntryCachePayloadFunc fn, TenantEntryCacheRefreshMode mode) + : uid(id), db(db), createPayloadFunc(fn), refreshMode(mode), metrics("TenantEntryCacheMetrics", uid.toString()), + hits("TenantEntryCacheHits", metrics), misses("TenantEntryCacheMisses", metrics), + refreshByCacheInit("TenantEntryCacheRefreshInit", metrics), + refreshByCacheMiss("TenantEntryCacheRefreshMiss", metrics), + numRefreshes("TenantEntryCacheNumRefreshes", metrics), + refreshByWatchTrigger("TenantEntryCacheRefreshWatchTrigger", metrics) { + TraceEvent("TenantEntryCacheCreated", uid); + } + + Future init(bool waitForInitalWatch = false) { + TraceEvent("TenantEntryCacheInit", uid); + + Future f = refreshImpl(this, TenantEntryCacheRefreshReason::INIT); + + // Launch reaper task to periodically refresh cache by scanning database KeyRange + TenantEntryCacheRefreshReason reason = TenantEntryCacheRefreshReason::PERIODIC_TASK; + Future initalWatchFuture = Void(); + lastTenantIdRefresher = lastTenantIdWatch(this); + if (refreshMode == TenantEntryCacheRefreshMode::PERIODIC_TASK) { + refresher = recurringAsync([&, reason]() { return refresh(reason); }, + CLIENT_KNOBS->TENANT_ENTRY_CACHE_LIST_REFRESH_INTERVAL, /* interval */ + true, /* absoluteIntervalDelay */ + CLIENT_KNOBS->TENANT_ENTRY_CACHE_LIST_REFRESH_INTERVAL, /* intialDelay */ + TaskPriority::Worker); + } else if (refreshMode == TenantEntryCacheRefreshMode::WATCH) { + if (waitForInitalWatch) { + initalWatchFuture = setInitialWatch.getFuture(); + } + watchRefresher = refreshCacheUsingWatch(this, TenantEntryCacheRefreshReason::WATCH_TRIGGER); + } + + Future setLastTenant = setLastTenantId(this); + + return f && initalWatchFuture && setLastTenant; + } + + Database getDatabase() const { return db; } + UID id() const { return uid; } + + void clear() { + mapByTenantId.clear(); + mapByTenantName.clear(); + } + + Future removeEntryById(int64_t tenantId, bool refreshCache = false) { + return removeEntryInt(tenantId, Optional(), Optional(), refreshCache); + } + Future removeEntryByPrefix(KeyRef tenantPrefix, bool refreshCache = false) { + return removeEntryInt(Optional(), tenantPrefix, Optional(), refreshCache); + } + Future removeEntryByName(TenantName tenantName, bool refreshCache = false) { + return removeEntryInt(Optional(), Optional(), tenantName, refreshCache); + } + + void put(const TenantMapEntry& entry) { + TenantEntryCachePayload payload = createPayloadFunc(entry); + auto idItr = mapByTenantId.find(entry.id); + auto nameItr = mapByTenantName.find(entry.tenantName); + + Optional existingName; + Optional existingId; + if (nameItr != mapByTenantName.end()) { + existingId = nameItr->value.entry.id; + } + if (idItr != mapByTenantId.end()) { + existingName = idItr->value.entry.tenantName; + } + if (existingId.present()) { + mapByTenantId.erase(existingId.get()); + } + if (existingName.present()) { + mapByTenantName.erase(existingName.get()); + } + + mapByTenantId[entry.id] = payload; + mapByTenantName[entry.tenantName] = payload; + + TraceEvent("TenantEntryCachePut", uid) + .detail("TenantName", entry.tenantName) + .detail("TenantNameExisting", existingName) + .detail("TenantID", entry.id) + .detail("TenantIDExisting", existingId) + .detail("TenantPrefix", entry.prefix); + + CODE_PROBE(idItr == mapByTenantId.end() && nameItr == mapByTenantName.end(), "TenantCache new entry"); + CODE_PROBE(idItr != mapByTenantId.end() && nameItr == mapByTenantName.end(), "TenantCache entry name updated"); + CODE_PROBE(idItr == mapByTenantId.end() && nameItr != mapByTenantName.end(), "TenantCache entry id updated"); + CODE_PROBE(idItr != mapByTenantId.end() && nameItr != mapByTenantName.end(), + "TenantCache entry id and name updated"); + } + + Future>> getById(int64_t tenantId) { return getByIdImpl(this, tenantId); } + Future>> getByPrefix(KeyRef prefix) { + int64_t id = TenantAPI::prefixToId(prefix); + return getByIdImpl(this, id); + } + Future>> getByName(TenantName name) { return getByNameImpl(this, name); } + + // Counter access APIs + Counter::Value numCacheRefreshes() const { return numRefreshes.getValue(); } + Counter::Value numRefreshByMisses() const { return refreshByCacheMiss.getValue(); } + Counter::Value numRefreshByInit() const { return refreshByCacheInit.getValue(); } + Counter::Value numWatchRefreshes() const { return refreshByWatchTrigger.getValue(); } +}; + +#include "flow/unactorcompiler.h" +#endif // FDBCLIENT_TENANTENTRYCACHE_ACTOR_H \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h b/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h new file mode 100644 index 0000000..160dbd6 --- /dev/null +++ b/src/fdbclient/include/fdbclient/TenantEntryCache.actor.h @@ -0,0 +1,591 @@ +/* + * TenantEntryCache.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_TENANTENTRYCACHE_ACTOR_G_H) +#define FDBCLIENT_TENANTENTRYCACHE_ACTOR_G_H +#include "fdbclient/TenantEntryCache.actor.g.h" +#elif !defined(FDBCLIENT_TENANTENTRYCACHE_ACTOR_H) +#define FDBCLIENT_TENANTENTRYCACHE_ACTOR_H + +#pragma once + +#include "fdbclient/DatabaseContext.h" +#include "fdbclient/FDBOptions.g.h" +#include "fdbclient/FDBTypes.h" +#include "fdbclient/RunRYWTransaction.actor.h" +#include "fdbclient/Tenant.h" +#include "fdbclient/TenantManagement.actor.h" +#include "fdbclient/Knobs.h" +#include "fdbrpc/TenantName.h" +#include "flow/IndexedSet.h" + +#include +#include + +#include "flow/actorcompiler.h" // has to be last include + +using TenantNameEntryPair = std::pair; +using TenantNameEntryPairVec = std::vector; + +enum class TenantEntryCacheRefreshReason { + INIT = 1, + PERIODIC_TASK = 2, + CACHE_MISS = 3, + REMOVE_ENTRY = 4, + WATCH_TRIGGER = 5 +}; +enum class TenantEntryCacheRefreshMode { PERIODIC_TASK = 1, WATCH = 2, NONE = 3 }; + +template +struct TenantEntryCachePayload { + TenantMapEntry entry; + // Custom client payload + T payload; +}; + +template +using TenantEntryCachePayloadFunc = std::function(const TenantMapEntry&)>; + +// In-memory cache for TenantEntryMap objects. It supports three indices: +// 1. Lookup by 'TenantId' +// 2. Lookup by 'TenantPrefix' +// 3. Lookup by 'TenantName' +// TODO: Currently this cache performs poorly if there are tenant access happening to unknown tenants which happens most +// frequently in optional tenant mode but can also happen in required mode if there are alot of tenants created. Further +// as a consequence of the design we cannot be sure that the state of a given tenant is accurate even if its present in +// the cache. + +template +class TenantEntryCache : public ReferenceCounted>, NonCopyable { +private: + UID uid; + Database db; + TenantEntryCachePayloadFunc createPayloadFunc; + TenantEntryCacheRefreshMode refreshMode; + + Future refresher; + Future watchRefresher; + Future lastTenantIdRefresher; + Promise setInitialWatch; + Optional lastTenantId; + Map> mapByTenantId; + Map> mapByTenantName; + + CounterCollection metrics; + Counter hits; + Counter misses; + Counter refreshByCacheInit; + Counter refreshByCacheMiss; + Counter numRefreshes; + Counter refreshByWatchTrigger; + + ACTOR static Future>> getTenantList( + Reference tr) { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + + KeyBackedRangeResult> tenantList = + wait(TenantMetadata::tenantMap().getRange(tr, {}, {}, CLIENT_KNOBS->MAX_TENANTS_PER_CLUSTER + 1)); + ASSERT(tenantList.results.size() <= CLIENT_KNOBS->MAX_TENANTS_PER_CLUSTER && !tenantList.more); + + TraceEvent(SevDebug, "TenantEntryCacheGetTenantList").detail("Count", tenantList.results.size()); + + return tenantList.results; + } + + ACTOR static Future refreshCacheById(int64_t tenantId, + TenantEntryCache* cache, + TenantEntryCacheRefreshReason reason) { + TraceEvent(SevDebug, "TenantEntryCacheIDRefreshStart", cache->id()).detail("Reason", static_cast(reason)); + state Reference tr = cache->getDatabase()->createTransaction(); + loop { + try { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + state Optional entry = wait(TenantMetadata::tenantMap().get(tr, tenantId)); + if (entry.present()) { + cache->put(entry.get()); + updateCacheRefreshMetrics(cache, reason); + } + break; + } catch (Error& e) { + wait(tr->onError(e)); + } + } + TraceEvent(SevDebug, "TenantEntryCacheIDRefreshEnd", cache->id()).detail("Reason", static_cast(reason)); + return Void(); + } + + ACTOR static Future refreshCacheByName(TenantName name, + TenantEntryCache* cache, + TenantEntryCacheRefreshReason reason) { + TraceEvent(SevDebug, "TenantEntryCacheNameRefreshStart", cache->id()) + .detail("Reason", static_cast(reason)); + state Reference tr = cache->getDatabase()->createTransaction(); + loop { + try { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + state Optional tenantId = wait(TenantMetadata::tenantNameIndex().get(tr, name)); + if (tenantId.present()) { + Optional entry = wait(TenantMetadata::tenantMap().get(tr, tenantId.get())); + if (entry.present()) { + cache->put(entry.get()); + updateCacheRefreshMetrics(cache, reason); + } + } + break; + } catch (Error& e) { + wait(tr->onError(e)); + } + } + TraceEvent(SevDebug, "TenantEntryCacheNameRefreshEnd", cache->id()).detail("Reason", static_cast(reason)); + return Void(); + } + + static void updateCacheRefreshMetrics(TenantEntryCache* cache, TenantEntryCacheRefreshReason reason) { + if (reason == TenantEntryCacheRefreshReason::INIT) { + cache->refreshByCacheInit += 1; + } else if (reason == TenantEntryCacheRefreshReason::CACHE_MISS) { + cache->refreshByCacheMiss += 1; + } else if (reason == TenantEntryCacheRefreshReason::WATCH_TRIGGER) { + cache->refreshByWatchTrigger += 1; + } + + cache->numRefreshes += 1; + } + + ACTOR static Future refreshCacheUsingWatch(TenantEntryCache* cache, TenantEntryCacheRefreshReason reason) { + TraceEvent(SevDebug, "TenantEntryCacheRefreshUsingWatchStart", cache->id()) + .detail("Reason", static_cast(reason)); + + state Reference tr = cache->getDatabase()->createTransaction(); + loop { + try { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + state Future tenantModifiedWatch = TenantMetadata::lastTenantModification().watch(tr); + wait(tr->commit()); + TraceEvent(SevDebug, "TenantEntryCacheRefreshWatchSet", cache->id()); + // setInitialWatch is set to indicate that an inital watch has been set for the lastTenantModification + // key. Currently this is only used in simulation to avoid a race condition where a tenant is created + // before the inital watch is set. However, it can be enabled by passing waitForInitalWatch = true to + // the init() method. + if (cache->setInitialWatch.canBeSet()) { + cache->setInitialWatch.send(Void()); + } + wait(tenantModifiedWatch); + // If watch triggered then refresh the cache as tenant metadata was updated + TraceEvent(SevDebug, "TenantEntryCacheRefreshUsingWatchTriggered", cache->id()) + .detail("Reason", static_cast(reason)); + wait(refreshImpl(cache, reason)); + tr->reset(); + } catch (Error& e) { + if (e.code() != error_code_actor_cancelled) { + TraceEvent("TenantEntryCacheRefreshUsingWatchError", cache->id()) + .errorUnsuppressed(e) + .suppressFor(1.0); + } + wait(tr->onError(e)); + // In case the watch threw an error then refresh the cache just in case it was updated + wait(refreshImpl(cache, reason)); + } + } + } + + static bool tenantsEnabled(TenantEntryCache* cache) { + // Avoid using the cache if the tenant mode is disabled. However since we use clientInfo, sometimes it may not + // be fully up to date (i.e it may indicate the tenantMode is disabled when in fact it is required). Thus if + // there is at least one tenant that has been created on the cluster then use the cache to avoid an incorrect + // miss. + if (cache->getDatabase()->clientInfo->get().tenantMode == TenantMode::DISABLED) { + if (!cache->lastTenantId.present()) { + return false; + } + return cache->lastTenantId.get() >= 0; + } + return true; + } + + ACTOR static Future setLastTenantId(TenantEntryCache* cache) { + state Reference tr = cache->getDatabase()->createTransaction(); + loop { + try { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + Optional lastTenantId = wait(TenantMetadata::lastTenantId().get(tr)); + cache->lastTenantId = lastTenantId; + return Void(); + } catch (Error& e) { + wait(tr->onError(e)); + } + } + } + + ACTOR static Future lastTenantIdWatch(TenantEntryCache* cache) { + TraceEvent(SevDebug, "TenantEntryCacheLastTenantIdWatchStart", cache->id()); + // monitor for any changes on the last tenant id and update it as necessary + state Reference tr = cache->getDatabase()->createTransaction(); + loop { + try { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); + state Future lastTenantIdWatch = tr->watch(TenantMetadata::lastTenantId().key); + wait(tr->commit()); + wait(lastTenantIdWatch); + wait(setLastTenantId(cache)); + tr->reset(); + } catch (Error& e) { + state Error err(e); + if (err.code() != error_code_actor_cancelled) { + TraceEvent("TenantEntryCacheLastTenantIdWatchError", cache->id()) + .errorUnsuppressed(err) + .suppressFor(1.0); + // In case watch errors out refresh the lastTenantId in case it has changed or we would have missed + // an update + wait(setLastTenantId(cache)); + } + wait(tr->onError(err)); + } + } + } + + ACTOR static Future refreshImpl(TenantEntryCache* cache, TenantEntryCacheRefreshReason reason) { + TraceEvent(SevDebug, "TenantEntryCacheRefreshStart", cache->id()).detail("Reason", static_cast(reason)); + + state Reference tr = cache->getDatabase()->createTransaction(); + loop { + try { + state std::vector> tenantList = wait(getTenantList(tr)); + + // Refresh cache entries reflecting the latest database state + cache->clear(); + for (auto& tenant : tenantList) { + cache->put(tenant.second); + } + + updateCacheRefreshMetrics(cache, reason); + break; + } catch (Error& e) { + if (e.code() != error_code_actor_cancelled) { + TraceEvent("TenantEntryCacheRefreshError", cache->id()).errorUnsuppressed(e).suppressFor(1.0); + } + wait(tr->onError(e)); + } + } + + TraceEvent(SevDebug, "TenantEntryCacheRefreshEnd", cache->id()).detail("Reason", static_cast(reason)); + + return Void(); + } + + ACTOR static Future>> getByIdImpl(TenantEntryCache* cache, + int64_t tenantId) { + Optional> ret = cache->lookupById(tenantId); + if (ret.present()) { + cache->hits += 1; + return ret; + } + + if (!tenantsEnabled(cache)) { + // If tenants are disabled on the cluster avoid using the cache + return Optional>(); + } + + TraceEvent("TenantEntryCacheGetByIdRefresh").detail("TenantId", tenantId); + + if (cache->refreshMode == TenantEntryCacheRefreshMode::WATCH) { + // Entry not found. Do a point refresh + // TODO: Don't initiate refresh if tenantId < maxTenantId (stored as a system key currently) as we know that + // such a tenant does not exist (it has either never existed or has been deleted) + wait(refreshCacheById(tenantId, cache, TenantEntryCacheRefreshReason::CACHE_MISS)); + } else { + // Entry not found. Refresh cacheEntries by scanning underlying KeyRange. + wait(refreshImpl(cache, TenantEntryCacheRefreshReason::CACHE_MISS)); + } + + cache->misses += 1; + return cache->lookupById(tenantId); + } + + ACTOR static Future>> getByNameImpl(TenantEntryCache* cache, + TenantName name) { + Optional> ret = cache->lookupByName(name); + if (ret.present()) { + cache->hits += 1; + return ret; + } + + if (!tenantsEnabled(cache)) { + // If tenants are disabled on the cluster avoid using the cache + return Optional>(); + } + + TraceEvent("TenantEntryCacheGetByNameRefresh").detail("TenantName", name); + + if (cache->refreshMode == TenantEntryCacheRefreshMode::WATCH) { + // Entry not found. Do a point refresh + wait(refreshCacheByName(name, cache, TenantEntryCacheRefreshReason::CACHE_MISS)); + } else { + // Entry not found. Refresh cacheEntries by scanning underlying KeyRange. + wait(refreshImpl(cache, TenantEntryCacheRefreshReason::CACHE_MISS)); + } + + cache->misses += 1; + return cache->lookupByName(name); + } + + Optional> lookupById(int64_t tenantId) { + Optional> ret; + auto itr = mapByTenantId.find(tenantId); + if (itr == mapByTenantId.end()) { + return ret; + } + + return itr->value; + } + + Optional> lookupByName(TenantName name) { + Optional> ret; + auto itr = mapByTenantName.find(name); + if (itr == mapByTenantName.end()) { + return ret; + } + + return itr->value; + } + + Future refresh(TenantEntryCacheRefreshReason reason) { return refreshImpl(this, reason); } + + static TenantEntryCachePayload defaultCreatePayload(const TenantMapEntry& entry) { + TenantEntryCachePayload payload; + payload.entry = entry; + + return payload; + } + + Future removeEntryInt(Optional tenantId, + Optional tenantPrefix, + Optional tenantName, + bool refreshCache) { + typename Map>::iterator itrId; + typename Map>::iterator itrName; + + if (tenantId.present() || tenantPrefix.present()) { + // Ensure either tenantId OR tenantPrefix is valid (but not both) + ASSERT(tenantId.present() != tenantPrefix.present()); + ASSERT(!tenantName.present()); + + int64_t tId = tenantId.present() ? tenantId.get() : TenantAPI::prefixToId(tenantPrefix.get()); + TraceEvent("TenantEntryCacheRemoveEntry").detail("Id", tId); + itrId = mapByTenantId.find(tId); + if (itrId == mapByTenantId.end()) { + return Void(); + } + // Ensure byId and byName cache are in-sync + itrName = mapByTenantName.find(itrId->value.entry.tenantName); + ASSERT(itrName != mapByTenantName.end()); + } else if (tenantName.present()) { + ASSERT(!tenantId.present() && !tenantPrefix.present()); + + TraceEvent("TenantEntryCacheRemoveEntry").detail("Name", tenantName.get()); + itrName = mapByTenantName.find(tenantName.get()); + if (itrName == mapByTenantName.end()) { + return Void(); + } + // Ensure byId and byName cache are in-sync + itrId = mapByTenantId.find(itrName->value.entry.id); + ASSERT(itrId != mapByTenantId.end()); + } else { + // Invalid input, one of: tenantId, tenantPrefix or tenantName needs to be valid. + throw operation_failed(); + } + + ASSERT(itrId != mapByTenantId.end() && itrName != mapByTenantName.end()); + + TraceEvent("TenantEntryCacheRemoveEntry") + .detail("Id", itrId->key) + .detail("Prefix", itrId->value.entry.prefix) + .detail("Name", itrName->key); + + mapByTenantId.erase(itrId); + mapByTenantName.erase(itrName); + + if (refreshCache) { + return refreshImpl(this, TenantEntryCacheRefreshReason::REMOVE_ENTRY); + } + + return Void(); + } + +public: + TenantEntryCache(Database db) + : uid(deterministicRandom()->randomUniqueID()), db(db), createPayloadFunc(defaultCreatePayload), + refreshMode(TenantEntryCacheRefreshMode::PERIODIC_TASK), metrics("TenantEntryCacheMetrics", uid.toString()), + hits("TenantEntryCacheHits", metrics), misses("TenantEntryCacheMisses", metrics), + refreshByCacheInit("TenantEntryCacheRefreshInit", metrics), + refreshByCacheMiss("TenantEntryCacheRefreshMiss", metrics), + numRefreshes("TenantEntryCacheNumRefreshes", metrics), + refreshByWatchTrigger("TenantEntryCacheRefreshWatchTrigger", metrics) { + TraceEvent("TenantEntryCacheCreatedDefaultFunc", uid); + } + + TenantEntryCache(Database db, TenantEntryCacheRefreshMode mode) + : uid(deterministicRandom()->randomUniqueID()), db(db), createPayloadFunc(defaultCreatePayload), + refreshMode(mode), metrics("TenantEntryCacheMetrics", uid.toString()), hits("TenantEntryCacheHits", metrics), + misses("TenantEntryCacheMisses", metrics), refreshByCacheInit("TenantEntryCacheRefreshInit", metrics), + refreshByCacheMiss("TenantEntryCacheRefreshMiss", metrics), + numRefreshes("TenantEntryCacheNumRefreshes", metrics), + refreshByWatchTrigger("TenantEntryCacheRefreshWatchTrigger", metrics) { + TraceEvent("TenantEntryCacheCreatedDefaultFunc", uid); + } + + TenantEntryCache(Database db, TenantEntryCachePayloadFunc fn) + : uid(deterministicRandom()->randomUniqueID()), db(db), createPayloadFunc(fn), + refreshMode(TenantEntryCacheRefreshMode::PERIODIC_TASK), metrics("TenantEntryCacheMetrics", uid.toString()), + hits("TenantEntryCacheHits", metrics), misses("TenantEntryCacheMisses", metrics), + refreshByCacheInit("TenantEntryCacheRefreshInit", metrics), + refreshByCacheMiss("TenantEntryCacheRefreshMiss", metrics), + numRefreshes("TenantEntryCacheNumRefreshes", metrics), + refreshByWatchTrigger("TenantEntryCacheRefreshWatchTrigger", metrics) { + TraceEvent("TenantEntryCacheCreated", uid); + } + + TenantEntryCache(Database db, UID id, TenantEntryCachePayloadFunc fn) + : uid(id), db(db), createPayloadFunc(fn), refreshMode(TenantEntryCacheRefreshMode::PERIODIC_TASK), + metrics("TenantEntryCacheMetrics", uid.toString()), hits("TenantEntryCacheHits", metrics), + misses("TenantEntryCacheMisses", metrics), refreshByCacheInit("TenantEntryCacheRefreshInit", metrics), + refreshByCacheMiss("TenantEntryCacheRefreshMiss", metrics), + numRefreshes("TenantEntryCacheNumRefreshes", metrics), + refreshByWatchTrigger("TenantEntryCacheRefreshWatchTrigger", metrics) { + TraceEvent("TenantEntryCacheCreated", uid); + } + + TenantEntryCache(Database db, UID id, TenantEntryCachePayloadFunc fn, TenantEntryCacheRefreshMode mode) + : uid(id), db(db), createPayloadFunc(fn), refreshMode(mode), metrics("TenantEntryCacheMetrics", uid.toString()), + hits("TenantEntryCacheHits", metrics), misses("TenantEntryCacheMisses", metrics), + refreshByCacheInit("TenantEntryCacheRefreshInit", metrics), + refreshByCacheMiss("TenantEntryCacheRefreshMiss", metrics), + numRefreshes("TenantEntryCacheNumRefreshes", metrics), + refreshByWatchTrigger("TenantEntryCacheRefreshWatchTrigger", metrics) { + TraceEvent("TenantEntryCacheCreated", uid); + } + + Future init(bool waitForInitalWatch = false) { + TraceEvent("TenantEntryCacheInit", uid); + + Future f = refreshImpl(this, TenantEntryCacheRefreshReason::INIT); + + // Launch reaper task to periodically refresh cache by scanning database KeyRange + TenantEntryCacheRefreshReason reason = TenantEntryCacheRefreshReason::PERIODIC_TASK; + Future initalWatchFuture = Void(); + lastTenantIdRefresher = lastTenantIdWatch(this); + if (refreshMode == TenantEntryCacheRefreshMode::PERIODIC_TASK) { + refresher = recurringAsync([&, reason]() { return refresh(reason); }, + CLIENT_KNOBS->TENANT_ENTRY_CACHE_LIST_REFRESH_INTERVAL, /* interval */ + true, /* absoluteIntervalDelay */ + CLIENT_KNOBS->TENANT_ENTRY_CACHE_LIST_REFRESH_INTERVAL, /* intialDelay */ + TaskPriority::Worker); + } else if (refreshMode == TenantEntryCacheRefreshMode::WATCH) { + if (waitForInitalWatch) { + initalWatchFuture = setInitialWatch.getFuture(); + } + watchRefresher = refreshCacheUsingWatch(this, TenantEntryCacheRefreshReason::WATCH_TRIGGER); + } + + Future setLastTenant = setLastTenantId(this); + + return f && initalWatchFuture && setLastTenant; + } + + Database getDatabase() const { return db; } + UID id() const { return uid; } + + void clear() { + mapByTenantId.clear(); + mapByTenantName.clear(); + } + + Future removeEntryById(int64_t tenantId, bool refreshCache = false) { + return removeEntryInt(tenantId, Optional(), Optional(), refreshCache); + } + Future removeEntryByPrefix(KeyRef tenantPrefix, bool refreshCache = false) { + return removeEntryInt(Optional(), tenantPrefix, Optional(), refreshCache); + } + Future removeEntryByName(TenantName tenantName, bool refreshCache = false) { + return removeEntryInt(Optional(), Optional(), tenantName, refreshCache); + } + + void put(const TenantMapEntry& entry) { + TenantEntryCachePayload payload = createPayloadFunc(entry); + auto idItr = mapByTenantId.find(entry.id); + auto nameItr = mapByTenantName.find(entry.tenantName); + + Optional existingName; + Optional existingId; + if (nameItr != mapByTenantName.end()) { + existingId = nameItr->value.entry.id; + } + if (idItr != mapByTenantId.end()) { + existingName = idItr->value.entry.tenantName; + } + if (existingId.present()) { + mapByTenantId.erase(existingId.get()); + } + if (existingName.present()) { + mapByTenantName.erase(existingName.get()); + } + + mapByTenantId[entry.id] = payload; + mapByTenantName[entry.tenantName] = payload; + + TraceEvent("TenantEntryCachePut", uid) + .detail("TenantName", entry.tenantName) + .detail("TenantNameExisting", existingName) + .detail("TenantID", entry.id) + .detail("TenantIDExisting", existingId) + .detail("TenantPrefix", entry.prefix); + + CODE_PROBE(idItr == mapByTenantId.end() && nameItr == mapByTenantName.end(), "TenantCache new entry"); + CODE_PROBE(idItr != mapByTenantId.end() && nameItr == mapByTenantName.end(), "TenantCache entry name updated"); + CODE_PROBE(idItr == mapByTenantId.end() && nameItr != mapByTenantName.end(), "TenantCache entry id updated"); + CODE_PROBE(idItr != mapByTenantId.end() && nameItr != mapByTenantName.end(), + "TenantCache entry id and name updated"); + } + + Future>> getById(int64_t tenantId) { return getByIdImpl(this, tenantId); } + Future>> getByPrefix(KeyRef prefix) { + int64_t id = TenantAPI::prefixToId(prefix); + return getByIdImpl(this, id); + } + Future>> getByName(TenantName name) { return getByNameImpl(this, name); } + + // Counter access APIs + Counter::Value numCacheRefreshes() const { return numRefreshes.getValue(); } + Counter::Value numRefreshByMisses() const { return refreshByCacheMiss.getValue(); } + Counter::Value numRefreshByInit() const { return refreshByCacheInit.getValue(); } + Counter::Value numWatchRefreshes() const { return refreshByWatchTrigger.getValue(); } +}; + +#include "flow/unactorcompiler.h" +#endif // FDBCLIENT_TENANTENTRYCACHE_ACTOR_H \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h b/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h new file mode 100644 index 0000000..5931e15 --- /dev/null +++ b/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h @@ -0,0 +1,9265 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +/* + * TenantManagement.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_TENANT_MANAGEMENT_ACTOR_G_H) +#define FDBCLIENT_TENANT_MANAGEMENT_ACTOR_G_H +#include "fdbclient/TenantManagement.actor.g.h" +#elif !defined(FDBCLIENT_TENANT_MANAGEMENT_ACTOR_H) +#define FDBCLIENT_TENANT_MANAGEMENT_ACTOR_H + +#include +#include +#include +#include "fdbclient/ClientBooleanParams.h" +#include "fdbclient/GenericTransactionHelper.h" +#include "fdbclient/Knobs.h" +#include "fdbclient/MetaclusterRegistration.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/Tenant.h" +#include "flow/IRandom.h" +#include "flow/ThreadHelper.actor.h" +#include "flow/actorcompiler.h" // has to be last include + +namespace TenantAPI { + +static const int TENANT_ID_PREFIX_MIN_VALUE = 0; +static const int TENANT_ID_PREFIX_MAX_VALUE = 32767; + +template +Future> tryGetTenantTransaction(Transaction tr, int64_t tenantId) { + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + return TenantMetadata::tenantMap().get(tr, tenantId); +} + + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via tryGetTenantTransaction() + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class TryGetTenantTransactionActorState { + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TryGetTenantTransactionActorState(Transaction const& tr,TenantName const& name) + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : tr(tr), + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + name(name) + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("tryGetTenantTransaction", reinterpret_cast(this)); + + } + ~TryGetTenantTransactionActorState() + { + fdb_probe_actor_destroy("tryGetTenantTransaction", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_0 = TenantMetadata::tenantNameIndex().get(tr, name); + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~TryGetTenantTransactionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional const& tenantId,int loopDepth) + { + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantId.present()) + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_1 = TenantMetadata::tenantMap().get(tr, tenantId.get()); + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~TryGetTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~TryGetTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + + return loopDepth; + } + int a_body1cont1(Optional && tenantId,int loopDepth) + { + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantId.present()) + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_1 = TenantMetadata::tenantMap().get(tr, tenantId.get()); + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~TryGetTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~TryGetTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + + return loopDepth; + } + int a_body1when1(Optional const& tenantId,int loopDepth) + { + loopDepth = a_body1cont1(tenantId, loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && tenantId,int loopDepth) + { + loopDepth = a_body1cont1(std::move(tenantId), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TryGetTenantTransactionActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< TryGetTenantTransactionActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("tryGetTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenantTransaction", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< TryGetTenantTransactionActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("tryGetTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenantTransaction", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< TryGetTenantTransactionActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("tryGetTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenantTransaction", reinterpret_cast(this), 0); + + } + int a_body1cont3(Optional const& entry,int loopDepth) + { + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(entry); this->~TryGetTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(entry); + this->~TryGetTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3(Optional && entry,int loopDepth) + { + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(entry); this->~TryGetTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(entry); + this->~TryGetTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Optional const& entry,int loopDepth) + { + loopDepth = a_body1cont3(entry, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Optional && entry,int loopDepth) + { + loopDepth = a_body1cont3(std::move(entry), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TryGetTenantTransactionActor, 1, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< TryGetTenantTransactionActor, 1, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("tryGetTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenantTransaction", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< TryGetTenantTransactionActor, 1, Optional >*,Optional && value) + { + fdb_probe_actor_enter("tryGetTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenantTransaction", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< TryGetTenantTransactionActor, 1, Optional >*,Error err) + { + fdb_probe_actor_enter("tryGetTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenantTransaction", reinterpret_cast(this), 1); + + } + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Transaction tr; + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantName name; + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via tryGetTenantTransaction() + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class TryGetTenantTransactionActor final : public Actor>, public ActorCallback< TryGetTenantTransactionActor, 0, Optional >, public ActorCallback< TryGetTenantTransactionActor, 1, Optional >, public FastAllocated>, public TryGetTenantTransactionActorState> { + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< TryGetTenantTransactionActor, 0, Optional >; +friend struct ActorCallback< TryGetTenantTransactionActor, 1, Optional >; + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TryGetTenantTransactionActor(Transaction const& tr,TenantName const& name) + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor>(), + TryGetTenantTransactionActorState>(tr, name) + { + fdb_probe_actor_enter("tryGetTenantTransaction", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("tryGetTenantTransaction"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("tryGetTenantTransaction", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< TryGetTenantTransactionActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< TryGetTenantTransactionActor, 1, Optional >*)0, actor_cancelled()); break; + } + + } +}; + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future> tryGetTenantTransaction( Transaction const& tr, TenantName const& name ) { + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future>(new TryGetTenantTransactionActor(tr, name)); + #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via tryGetTenant() + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class TryGetTenantActorState { + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TryGetTenantActorState(Reference const& db,Tenant const& tenant) + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : db(db), + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenant(tenant), + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr(db->createTransaction()) + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("tryGetTenant", reinterpret_cast(this)); + + } + ~TryGetTenantActorState() + { + fdb_probe_actor_destroy("tryGetTenant", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ; + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~TryGetTenantActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_0 = tryGetTenantTransaction(tr, tenant); + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->onError(e)); + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Optional const& entry,int loopDepth) + { + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(entry); this->~TryGetTenantActorState(); static_cast(this)->destroy(); return 0; } + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(entry); + this->~TryGetTenantActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Optional && entry,int loopDepth) + { + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(entry); this->~TryGetTenantActorState(); static_cast(this)->destroy(); return 0; } + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(entry); + this->~TryGetTenantActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& entry,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(entry, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && entry,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(entry), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TryGetTenantActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< TryGetTenantActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("tryGetTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenant", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< TryGetTenantActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("tryGetTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenant", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< TryGetTenantActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("tryGetTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenant", reinterpret_cast(this), 0); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TryGetTenantActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< TryGetTenantActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("tryGetTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenant", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< TryGetTenantActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("tryGetTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenant", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< TryGetTenantActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("tryGetTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenant", reinterpret_cast(this), 1); + + } + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Reference db; + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Tenant tenant; + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Reference tr; + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via tryGetTenant() + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class TryGetTenantActor final : public Actor>, public ActorCallback< TryGetTenantActor, 0, Optional >, public ActorCallback< TryGetTenantActor, 1, Void >, public FastAllocated>, public TryGetTenantActorState> { + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< TryGetTenantActor, 0, Optional >; +friend struct ActorCallback< TryGetTenantActor, 1, Void >; + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TryGetTenantActor(Reference const& db,Tenant const& tenant) + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor>(), + TryGetTenantActorState>(db, tenant) + { + fdb_probe_actor_enter("tryGetTenant", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("tryGetTenant"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("tryGetTenant", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< TryGetTenantActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< TryGetTenantActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future> tryGetTenant( Reference const& db, Tenant const& tenant ) { + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future>(new TryGetTenantActor(db, tenant)); + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via getTenantTransaction() + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class GetTenantTransactionActorState { + #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + GetTenantTransactionActorState(Transaction const& tr,Tenant const& tenant) + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : tr(tr), + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenant(tenant) + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("getTenantTransaction", reinterpret_cast(this)); + + } + ~GetTenantTransactionActorState() + { + fdb_probe_actor_destroy("getTenantTransaction", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_0 = tryGetTenantTransaction(tr, tenant); + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetTenantTransactionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional const& entry,int loopDepth) + { + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!entry.present()) + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_not_found(), loopDepth); + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(entry.get()); this->~GetTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< TenantMapEntry >::value()) TenantMapEntry(entry.get()); + this->~GetTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Optional && entry,int loopDepth) + { + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!entry.present()) + #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_not_found(), loopDepth); + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(entry.get()); this->~GetTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< TenantMapEntry >::value()) TenantMapEntry(entry.get()); + this->~GetTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Optional const& entry,int loopDepth) + { + loopDepth = a_body1cont1(entry, loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && entry,int loopDepth) + { + loopDepth = a_body1cont1(std::move(entry), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetTenantTransactionActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< GetTenantTransactionActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("getTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenantTransaction", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetTenantTransactionActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("getTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenantTransaction", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetTenantTransactionActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("getTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenantTransaction", reinterpret_cast(this), 0); + + } + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Transaction tr; + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Tenant tenant; + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via getTenantTransaction() + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class GetTenantTransactionActor final : public Actor, public ActorCallback< GetTenantTransactionActor, 0, Optional >, public FastAllocated>, public GetTenantTransactionActorState> { + #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetTenantTransactionActor, 0, Optional >; + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + GetTenantTransactionActor(Transaction const& tr,Tenant const& tenant) + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor(), + GetTenantTransactionActorState>(tr, tenant) + { + fdb_probe_actor_enter("getTenantTransaction", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getTenantTransaction"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getTenantTransaction", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetTenantTransactionActor, 0, Optional >*)0, actor_cancelled()); break; + } + + } +}; + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future getTenantTransaction( Transaction const& tr, Tenant const& tenant ) { + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future(new GetTenantTransactionActor(tr, tenant)); + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + + #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via getTenant() + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class GetTenantActorState { + #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + GetTenantActorState(Reference const& db,Tenant const& tenant) + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : db(db), + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenant(tenant) + #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("getTenant", reinterpret_cast(this)); + + } + ~GetTenantActorState() + { + fdb_probe_actor_destroy("getTenant", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_0 = tryGetTenant(db, tenant); + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetTenantActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional const& entry,int loopDepth) + { + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!entry.present()) + #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_not_found(), loopDepth); + #line 997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(entry.get()); this->~GetTenantActorState(); static_cast(this)->destroy(); return 0; } + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< TenantMapEntry >::value()) TenantMapEntry(entry.get()); + this->~GetTenantActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Optional && entry,int loopDepth) + { + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!entry.present()) + #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_not_found(), loopDepth); + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(entry.get()); this->~GetTenantActorState(); static_cast(this)->destroy(); return 0; } + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< TenantMapEntry >::value()) TenantMapEntry(entry.get()); + this->~GetTenantActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Optional const& entry,int loopDepth) + { + loopDepth = a_body1cont1(entry, loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && entry,int loopDepth) + { + loopDepth = a_body1cont1(std::move(entry), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetTenantActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< GetTenantActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("getTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenant", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetTenantActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("getTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenant", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetTenantActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("getTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenant", reinterpret_cast(this), 0); + + } + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Reference db; + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Tenant tenant; + #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via getTenant() + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class GetTenantActor final : public Actor, public ActorCallback< GetTenantActor, 0, Optional >, public FastAllocated>, public GetTenantActorState> { + #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetTenantActor, 0, Optional >; + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + GetTenantActor(Reference const& db,Tenant const& tenant) + #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor(), + GetTenantActorState>(db, tenant) + { + fdb_probe_actor_enter("getTenant", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getTenant"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getTenant", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetTenantActor, 0, Optional >*)0, actor_cancelled()); break; + } + + } +}; + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future getTenant( Reference const& db, Tenant const& tenant ) { + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future(new GetTenantActor(db, tenant)); + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + + #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via getClusterType() + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class GetClusterTypeActorState { + #line 1154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + GetClusterTypeActorState(Transaction const& tr) + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : tr(tr) + #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("getClusterType", reinterpret_cast(this)); + + } + ~GetClusterTypeActorState() + { + fdb_probe_actor_destroy("getClusterType", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_0 = metacluster::metadata::metaclusterRegistration().get(tr); + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetClusterTypeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional const& metaclusterRegistration,int loopDepth) + { + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(metaclusterRegistration.present() ? metaclusterRegistration.get().clusterType : ClusterType::STANDALONE); this->~GetClusterTypeActorState(); static_cast(this)->destroy(); return 0; } + #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< ClusterType >::value()) ClusterType(metaclusterRegistration.present() ? metaclusterRegistration.get().clusterType : ClusterType::STANDALONE); + this->~GetClusterTypeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Optional && metaclusterRegistration,int loopDepth) + { + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(metaclusterRegistration.present() ? metaclusterRegistration.get().clusterType : ClusterType::STANDALONE); this->~GetClusterTypeActorState(); static_cast(this)->destroy(); return 0; } + #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< ClusterType >::value()) ClusterType(metaclusterRegistration.present() ? metaclusterRegistration.get().clusterType : ClusterType::STANDALONE); + this->~GetClusterTypeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Optional const& metaclusterRegistration,int loopDepth) + { + loopDepth = a_body1cont1(metaclusterRegistration, loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && metaclusterRegistration,int loopDepth) + { + loopDepth = a_body1cont1(std::move(metaclusterRegistration), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetClusterTypeActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< GetClusterTypeActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("getClusterType", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getClusterType", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetClusterTypeActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("getClusterType", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getClusterType", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetClusterTypeActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("getClusterType", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getClusterType", reinterpret_cast(this), 0); + + } + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Transaction tr; + #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via getClusterType() + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class GetClusterTypeActor final : public Actor, public ActorCallback< GetClusterTypeActor, 0, Optional >, public FastAllocated>, public GetClusterTypeActorState> { + #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetClusterTypeActor, 0, Optional >; + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + GetClusterTypeActor(Transaction const& tr) + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor(), + GetClusterTypeActorState>(tr) + { + fdb_probe_actor_enter("getClusterType", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getClusterType"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getClusterType", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetClusterTypeActor, 0, Optional >*)0, actor_cancelled()); break; + } + + } +}; + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future getClusterType( Transaction const& tr ) { + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future(new GetClusterTypeActor(tr)); + #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + + #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via checkTenantMode() + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class CheckTenantModeActorState { + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + CheckTenantModeActorState(Transaction const& tr,ClusterType const& expectedClusterType) + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : tr(tr), + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + expectedClusterType(expectedClusterType), + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantModeFuture(tr->get(configKeysPrefix.withSuffix("tenant_mode"_sr))) + #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("checkTenantMode", reinterpret_cast(this)); + + } + ~CheckTenantModeActorState() + { + fdb_probe_actor_destroy("checkTenantMode", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_0 = getClusterType(tr); + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CheckTenantModeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_1 = safeThreadFutureToFuture(tenantModeFuture); + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(ClusterType const& __actualClusterType,int loopDepth) + { + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + actualClusterType = __actualClusterType; + #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(ClusterType && __actualClusterType,int loopDepth) + { + actualClusterType = std::move(__actualClusterType); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckTenantModeActor, 0, ClusterType >::remove(); + + } + void a_callback_fire(ActorCallback< CheckTenantModeActor, 0, ClusterType >*,ClusterType const& value) + { + fdb_probe_actor_enter("checkTenantMode", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkTenantMode", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CheckTenantModeActor, 0, ClusterType >*,ClusterType && value) + { + fdb_probe_actor_enter("checkTenantMode", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkTenantMode", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CheckTenantModeActor, 0, ClusterType >*,Error err) + { + fdb_probe_actor_enter("checkTenantMode", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkTenantMode", reinterpret_cast(this), 0); + + } + int a_body1cont2(Optional const& tenantModeValue,int loopDepth) + { + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMode tenantMode = TenantMode::fromValue(tenantModeValue.castTo()); + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (actualClusterType != expectedClusterType) + #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(invalid_metacluster_operation(), loopDepth); + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + else + { + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (actualClusterType == ClusterType::STANDALONE && tenantMode == TenantMode::DISABLED) + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenants_disabled(), loopDepth); + #line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + } + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckTenantModeActorState(); static_cast(this)->destroy(); return 0; } + #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CheckTenantModeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(Optional && tenantModeValue,int loopDepth) + { + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMode tenantMode = TenantMode::fromValue(tenantModeValue.castTo()); + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (actualClusterType != expectedClusterType) + #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(invalid_metacluster_operation(), loopDepth); + #line 1527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + else + { + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (actualClusterType == ClusterType::STANDALONE && tenantMode == TenantMode::DISABLED) + #line 1533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenants_disabled(), loopDepth); + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + } + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckTenantModeActorState(); static_cast(this)->destroy(); return 0; } + #line 1542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CheckTenantModeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Optional const& tenantModeValue,int loopDepth) + { + loopDepth = a_body1cont2(tenantModeValue, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Optional && tenantModeValue,int loopDepth) + { + loopDepth = a_body1cont2(std::move(tenantModeValue), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckTenantModeActor, 1, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< CheckTenantModeActor, 1, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("checkTenantMode", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkTenantMode", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< CheckTenantModeActor, 1, Optional >*,Optional && value) + { + fdb_probe_actor_enter("checkTenantMode", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkTenantMode", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< CheckTenantModeActor, 1, Optional >*,Error err) + { + fdb_probe_actor_enter("checkTenantMode", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkTenantMode", reinterpret_cast(this), 1); + + } + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Transaction tr; + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ClusterType expectedClusterType; + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + typename transaction_future_type>::type tenantModeFuture; + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ClusterType actualClusterType; + #line 1621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via checkTenantMode() + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class CheckTenantModeActor final : public Actor, public ActorCallback< CheckTenantModeActor, 0, ClusterType >, public ActorCallback< CheckTenantModeActor, 1, Optional >, public FastAllocated>, public CheckTenantModeActorState> { + #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CheckTenantModeActor, 0, ClusterType >; +friend struct ActorCallback< CheckTenantModeActor, 1, Optional >; + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + CheckTenantModeActor(Transaction const& tr,ClusterType const& expectedClusterType) + #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor(), + CheckTenantModeActorState>(tr, expectedClusterType) + { + fdb_probe_actor_enter("checkTenantMode", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("checkTenantMode"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("checkTenantMode", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CheckTenantModeActor, 0, ClusterType >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CheckTenantModeActor, 1, Optional >*)0, actor_cancelled()); break; + } + + } +}; + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future checkTenantMode( Transaction const& tr, ClusterType const& expectedClusterType ) { + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future(new CheckTenantModeActor(tr, expectedClusterType)); + #line 1670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + +TenantMode tenantModeForClusterType(ClusterType clusterType, TenantMode tenantMode); +int64_t extractTenantIdFromMutation(MutationRef m); +int64_t extractTenantIdFromKeyRef(StringRef s); +bool tenantMapChanging(MutationRef const& mutation, KeyRangeRef const& tenantMapRange); +int64_t computeNextTenantId(int64_t tenantId, int64_t delta); +int64_t getMaxAllowableTenantId(int64_t curTenantId); +int64_t getTenantIdPrefix(int64_t tenantId); + +// Returns true if the specified ID has already been deleted and false if not. If the ID is old enough +// that we no longer keep tombstones for it, an error is thrown. + #line 1685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via checkTombstone() + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class CheckTombstoneActorState { + #line 1691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + CheckTombstoneActorState(Transaction const& tr,int64_t const& id) + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : tr(tr), + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + id(id), + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tombstoneFuture(TenantMetadata::tenantTombstones().exists(tr, id)) + #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("checkTombstone", reinterpret_cast(this)); + + } + ~CheckTombstoneActorState() + { + fdb_probe_actor_destroy("checkTombstone", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_0 = TenantMetadata::tombstoneCleanupData().get(tr); + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 1724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CheckTombstoneActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional const& tombstoneCleanupData,int loopDepth) + { + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tombstoneCleanupData.present() && tombstoneCleanupData.get().tombstonesErasedThrough >= id) + #line 1747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_creation_permanently_failed(), loopDepth); + #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = tombstoneFuture; + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Optional && tombstoneCleanupData,int loopDepth) + { + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tombstoneCleanupData.present() && tombstoneCleanupData.get().tombstonesErasedThrough >= id) + #line 1771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_creation_permanently_failed(), loopDepth); + #line 1775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = tombstoneFuture; + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Optional const& tombstoneCleanupData,int loopDepth) + { + loopDepth = a_body1cont1(tombstoneCleanupData, loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && tombstoneCleanupData,int loopDepth) + { + loopDepth = a_body1cont1(std::move(tombstoneCleanupData), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckTombstoneActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< CheckTombstoneActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("checkTombstone", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkTombstone", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CheckTombstoneActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("checkTombstone", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkTombstone", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CheckTombstoneActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("checkTombstone", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkTombstone", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(hasTombstone); this->~CheckTombstoneActorState(); static_cast(this)->destroy(); return 0; } + #line 1858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< bool >::value()) bool(std::move(hasTombstone)); // state_var_RVO + this->~CheckTombstoneActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(bool const& __hasTombstone,int loopDepth) + { + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + hasTombstone = __hasTombstone; + #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(bool && __hasTombstone,int loopDepth) + { + hasTombstone = std::move(__hasTombstone); + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckTombstoneActor, 1, bool >::remove(); + + } + void a_callback_fire(ActorCallback< CheckTombstoneActor, 1, bool >*,bool const& value) + { + fdb_probe_actor_enter("checkTombstone", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkTombstone", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< CheckTombstoneActor, 1, bool >*,bool && value) + { + fdb_probe_actor_enter("checkTombstone", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkTombstone", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< CheckTombstoneActor, 1, bool >*,Error err) + { + fdb_probe_actor_enter("checkTombstone", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkTombstone", reinterpret_cast(this), 1); + + } + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Transaction tr; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + int64_t id; + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Future tombstoneFuture; + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + bool hasTombstone; + #line 1941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via checkTombstone() + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class CheckTombstoneActor final : public Actor, public ActorCallback< CheckTombstoneActor, 0, Optional >, public ActorCallback< CheckTombstoneActor, 1, bool >, public FastAllocated>, public CheckTombstoneActorState> { + #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CheckTombstoneActor, 0, Optional >; +friend struct ActorCallback< CheckTombstoneActor, 1, bool >; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + CheckTombstoneActor(Transaction const& tr,int64_t const& id) + #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor(), + CheckTombstoneActorState>(tr, id) + { + fdb_probe_actor_enter("checkTombstone", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("checkTombstone"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("checkTombstone", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CheckTombstoneActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CheckTombstoneActor, 1, bool >*)0, actor_cancelled()); break; + } + + } +}; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future checkTombstone( Transaction const& tr, int64_t const& id ) { + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future(new CheckTombstoneActor(tr, id)); + #line 1990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + +// Creates a tenant. If the tenant already exists, the boolean return parameter will be false +// and the existing entry will be returned. If the tenant cannot be created, then the optional will be empty. + #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via createTenantTransaction() + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class CreateTenantTransactionActorState { + #line 2003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + CreateTenantTransactionActorState(Transaction const& tr,TenantMapEntry const& tenantEntry,ClusterType const& clusterType = ClusterType::STANDALONE) + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : tr(tr), + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantEntry(tenantEntry), + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + clusterType(clusterType) + #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("createTenantTransaction", reinterpret_cast(this)); + + } + ~CreateTenantTransactionActorState() + { + fdb_probe_actor_destroy("createTenantTransaction", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ASSERT(clusterType != ClusterType::METACLUSTER_MANAGEMENT); + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ASSERT(tenantEntry.id >= 0); + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantEntry.tenantName.startsWith("\xff"_sr)) + #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(invalid_tenant_name(), loopDepth); + #line 2037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantEntry.tenantGroup.present() && tenantEntry.tenantGroup.get().startsWith("\xff"_sr)) + #line 2041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(invalid_tenant_group_name(), loopDepth); + #line 2045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + existingEntryFuture = tryGetTenantTransaction(tr, tenantEntry.tenantName); + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantModeCheck = checkTenantMode(tr, clusterType); + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tombstoneFuture = (clusterType == ClusterType::STANDALONE) ? false : checkTombstone(tr, tenantEntry.id); + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + existingTenantGroupEntryFuture = Future>(); + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantEntry.tenantGroup.present()) + #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + existingTenantGroupEntryFuture = TenantMetadata::tenantGroupMap().get(tr, tenantEntry.tenantGroup.get()); + #line 2063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_0 = tenantModeCheck; + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CreateTenantTransactionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_1 = existingEntryFuture; + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_1 = existingEntryFuture; + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantTransactionActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CreateTenantTransactionActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 0); + + } + int a_body1cont5(Optional const& existingEntry,int loopDepth) + { + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (existingEntry.present()) + #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV, bool>>::futures) { (void)(std::make_pair(existingEntry.get(), false)); this->~CreateTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 2196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< std::pair, bool> >::value()) std::pair, bool>(std::make_pair(existingEntry.get(), false)); + this->~CreateTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_2 = tombstoneFuture; + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont5when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont5(Optional && existingEntry,int loopDepth) + { + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (existingEntry.present()) + #line 2220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV, bool>>::futures) { (void)(std::make_pair(existingEntry.get(), false)); this->~CreateTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< std::pair, bool> >::value()) std::pair, bool>(std::make_pair(existingEntry.get(), false)); + this->~CreateTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_2 = tombstoneFuture; + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont5when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(Optional const& existingEntry,int loopDepth) + { + loopDepth = a_body1cont5(existingEntry, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Optional && existingEntry,int loopDepth) + { + loopDepth = a_body1cont5(std::move(existingEntry), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantTransactionActor, 1, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 1, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 1, Optional >*,Optional && value) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< CreateTenantTransactionActor, 1, Optional >*,Error err) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 1); + + } + int a_body1cont6(int loopDepth) + { + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (hasTombstone) + #line 2311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV, bool>>::futures) { (void)(std::make_pair(Optional(), false)); this->~CreateTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< std::pair, bool> >::value()) std::pair, bool>(std::make_pair(Optional(), false)); + this->~CreateTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + prefixRangeFuture = tr->getRange(prefixRange(tenantEntry.prefix), 1); + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_3 = safeThreadFutureToFuture(prefixRangeFuture); + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont5when1(bool const& __hasTombstone,int loopDepth) + { + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + hasTombstone = __hasTombstone; + #line 2341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont5when1(bool && __hasTombstone,int loopDepth) + { + hasTombstone = std::move(__hasTombstone); + loopDepth = a_body1cont6(loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantTransactionActor, 2, bool >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 2, bool >*,bool const& value) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont5when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 2, bool >*,bool && value) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont5when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< CreateTenantTransactionActor, 2, bool >*,Error err) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 2); + + } + int a_body1cont8(RangeResult const& contents,int loopDepth) + { + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!contents.empty()) + #line 2408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_prefix_allocator_conflict(), loopDepth); + #line 2412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantMap().set(tr, tenantEntry.id, tenantEntry); + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantNameIndex().set(tr, tenantEntry.tenantName, tenantEntry.id); + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::lastTenantModification().setVersionstamp(tr, Versionstamp(), 0); + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantEntry.tenantGroup.present()) + #line 2422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupTenantIndex().insert( tr, Tuple::makeTuple(tenantEntry.tenantGroup.get(), tenantEntry.id)); + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_4 = existingTenantGroupEntryFuture; + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont8when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_4.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont10(loopDepth); + } + + return loopDepth; + } + int a_body1cont8(RangeResult && contents,int loopDepth) + { + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!contents.empty()) + #line 2449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_prefix_allocator_conflict(), loopDepth); + #line 2453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantMap().set(tr, tenantEntry.id, tenantEntry); + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantNameIndex().set(tr, tenantEntry.tenantName, tenantEntry.id); + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::lastTenantModification().setVersionstamp(tr, Versionstamp(), 0); + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantEntry.tenantGroup.present()) + #line 2463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupTenantIndex().insert( tr, Tuple::makeTuple(tenantEntry.tenantGroup.get(), tenantEntry.id)); + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_4 = existingTenantGroupEntryFuture; + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont8when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_4.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont10(loopDepth); + } + + return loopDepth; + } + int a_body1cont6when1(RangeResult const& contents,int loopDepth) + { + loopDepth = a_body1cont8(contents, loopDepth); + + return loopDepth; + } + int a_body1cont6when1(RangeResult && contents,int loopDepth) + { + loopDepth = a_body1cont8(std::move(contents), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantTransactionActor, 3, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 3, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont6when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 3, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont6when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< CreateTenantTransactionActor, 3, RangeResult >*,Error err) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 3); + + } + int a_body1cont10(int loopDepth) + { + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantCount().atomicOp(tr, 1, MutationRef::AddValue); + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_5 = TenantMetadata::tenantCount().getD(tr, Snapshot::False, 0); + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont10when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont12(Optional const& existingTenantGroup,int loopDepth) + { + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!existingTenantGroup.present()) + #line 2571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupMap().set(tr, tenantEntry.tenantGroup.get(), TenantGroupEntry()); + #line 2575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + loopDepth = a_body1cont10(loopDepth); + + return loopDepth; + } + int a_body1cont12(Optional && existingTenantGroup,int loopDepth) + { + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!existingTenantGroup.present()) + #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupMap().set(tr, tenantEntry.tenantGroup.get(), TenantGroupEntry()); + #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + loopDepth = a_body1cont10(loopDepth); + + return loopDepth; + } + int a_body1cont8when1(Optional const& existingTenantGroup,int loopDepth) + { + loopDepth = a_body1cont12(existingTenantGroup, loopDepth); + + return loopDepth; + } + int a_body1cont8when1(Optional && existingTenantGroup,int loopDepth) + { + loopDepth = a_body1cont12(std::move(existingTenantGroup), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantTransactionActor, 4, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 4, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont8when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 4, Optional >*,Optional && value) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont8when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< CreateTenantTransactionActor, 4, Optional >*,Error err) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 4); + + } + int a_body1cont10cont1(int64_t const& tenantCount,int loopDepth) + { + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantCount > CLIENT_KNOBS->MAX_TENANTS_PER_CLUSTER) + #line 2662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(cluster_no_capacity(), loopDepth); + #line 2666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV, bool>>::futures) { (void)(std::make_pair(tenantEntry, true)); this->~CreateTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 2670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< std::pair, bool> >::value()) std::pair, bool>(std::make_pair(tenantEntry, true)); + this->~CreateTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont10cont1(int64_t && tenantCount,int loopDepth) + { + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantCount > CLIENT_KNOBS->MAX_TENANTS_PER_CLUSTER) + #line 2682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(cluster_no_capacity(), loopDepth); + #line 2686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV, bool>>::futures) { (void)(std::make_pair(tenantEntry, true)); this->~CreateTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< std::pair, bool> >::value()) std::pair, bool>(std::make_pair(tenantEntry, true)); + this->~CreateTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont10when1(int64_t const& tenantCount,int loopDepth) + { + loopDepth = a_body1cont10cont1(tenantCount, loopDepth); + + return loopDepth; + } + int a_body1cont10when1(int64_t && tenantCount,int loopDepth) + { + loopDepth = a_body1cont10cont1(std::move(tenantCount), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantTransactionActor, 5, int64_t >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 5, int64_t >*,int64_t const& value) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont10when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< CreateTenantTransactionActor, 5, int64_t >*,int64_t && value) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont10when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< CreateTenantTransactionActor, 5, int64_t >*,Error err) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), 5); + + } + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Transaction tr; + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMapEntry tenantEntry; + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ClusterType clusterType; + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Future> existingEntryFuture; + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Future tenantModeCheck; + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Future tombstoneFuture; + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Future> existingTenantGroupEntryFuture; + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + bool hasTombstone; + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + typename transaction_future_type::type prefixRangeFuture; + #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via createTenantTransaction() + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class CreateTenantTransactionActor final : public Actor, bool>>, public ActorCallback< CreateTenantTransactionActor, 0, Void >, public ActorCallback< CreateTenantTransactionActor, 1, Optional >, public ActorCallback< CreateTenantTransactionActor, 2, bool >, public ActorCallback< CreateTenantTransactionActor, 3, RangeResult >, public ActorCallback< CreateTenantTransactionActor, 4, Optional >, public ActorCallback< CreateTenantTransactionActor, 5, int64_t >, public FastAllocated>, public CreateTenantTransactionActorState> { + #line 2786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor, bool>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CreateTenantTransactionActor, 0, Void >; +friend struct ActorCallback< CreateTenantTransactionActor, 1, Optional >; +friend struct ActorCallback< CreateTenantTransactionActor, 2, bool >; +friend struct ActorCallback< CreateTenantTransactionActor, 3, RangeResult >; +friend struct ActorCallback< CreateTenantTransactionActor, 4, Optional >; +friend struct ActorCallback< CreateTenantTransactionActor, 5, int64_t >; + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + CreateTenantTransactionActor(Transaction const& tr,TenantMapEntry const& tenantEntry,ClusterType const& clusterType = ClusterType::STANDALONE) + #line 2802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor, bool>>(), + CreateTenantTransactionActorState>(tr, tenantEntry, clusterType) + { + fdb_probe_actor_enter("createTenantTransaction", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("createTenantTransaction"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("createTenantTransaction", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CreateTenantTransactionActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CreateTenantTransactionActor, 1, Optional >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< CreateTenantTransactionActor, 2, bool >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< CreateTenantTransactionActor, 3, RangeResult >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< CreateTenantTransactionActor, 4, Optional >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< CreateTenantTransactionActor, 5, int64_t >*)0, actor_cancelled()); break; + } + + } +}; + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future, bool>> createTenantTransaction( Transaction const& tr, TenantMapEntry const& tenantEntry, ClusterType const& clusterType = ClusterType::STANDALONE ) { + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future, bool>>(new CreateTenantTransactionActor(tr, tenantEntry, clusterType)); + #line 2836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via getNextTenantId() + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class GetNextTenantIdActorState { + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + GetNextTenantIdActorState(Transaction const& tr) + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : tr(tr) + #line 2854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("getNextTenantId", reinterpret_cast(this)); + + } + ~GetNextTenantIdActorState() + { + fdb_probe_actor_destroy("getNextTenantId", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_0 = TenantMetadata::lastTenantId().get(tr); + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetNextTenantIdActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!lastId.present()) + #line 2899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = TenantMetadata::tenantIdPrefix().getD(tr, Snapshot::False, 0); + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont2(loopDepth); + } + + return loopDepth; + } + int a_body1when1(Optional const& __lastId,int loopDepth) + { + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + lastId = __lastId; + #line 2924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && __lastId,int loopDepth) + { + lastId = std::move(__lastId); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetNextTenantIdActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< GetNextTenantIdActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("getNextTenantId", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getNextTenantId", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetNextTenantIdActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("getNextTenantId", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getNextTenantId", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetNextTenantIdActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("getNextTenantId", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getNextTenantId", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + int64_t delta = 1; + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (BUGGIFY) + #line 2993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + delta += deterministicRandom()->randomSkewedUInt32(1, 1e9); + #line 2997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(TenantAPI::computeNextTenantId(lastId.get(), delta)); this->~GetNextTenantIdActorState(); static_cast(this)->destroy(); return 0; } + #line 3001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< int64_t >::value()) int64_t(TenantAPI::computeNextTenantId(lastId.get(), delta)); + this->~GetNextTenantIdActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3(int64_t const& tenantIdPrefix,int loopDepth) + { + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + lastId = tenantIdPrefix << 48; + #line 3013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont3(int64_t && tenantIdPrefix,int loopDepth) + { + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + lastId = tenantIdPrefix << 48; + #line 3022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(int64_t const& tenantIdPrefix,int loopDepth) + { + loopDepth = a_body1cont3(tenantIdPrefix, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(int64_t && tenantIdPrefix,int loopDepth) + { + loopDepth = a_body1cont3(std::move(tenantIdPrefix), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetNextTenantIdActor, 1, int64_t >::remove(); + + } + void a_callback_fire(ActorCallback< GetNextTenantIdActor, 1, int64_t >*,int64_t const& value) + { + fdb_probe_actor_enter("getNextTenantId", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getNextTenantId", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< GetNextTenantIdActor, 1, int64_t >*,int64_t && value) + { + fdb_probe_actor_enter("getNextTenantId", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getNextTenantId", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< GetNextTenantIdActor, 1, int64_t >*,Error err) + { + fdb_probe_actor_enter("getNextTenantId", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getNextTenantId", reinterpret_cast(this), 1); + + } + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Transaction tr; + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Optional lastId; + #line 3094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via getNextTenantId() + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class GetNextTenantIdActor final : public Actor, public ActorCallback< GetNextTenantIdActor, 0, Optional >, public ActorCallback< GetNextTenantIdActor, 1, int64_t >, public FastAllocated>, public GetNextTenantIdActorState> { + #line 3101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetNextTenantIdActor, 0, Optional >; +friend struct ActorCallback< GetNextTenantIdActor, 1, int64_t >; + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + GetNextTenantIdActor(Transaction const& tr) + #line 3113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor(), + GetNextTenantIdActorState>(tr) + { + fdb_probe_actor_enter("getNextTenantId", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getNextTenantId"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getNextTenantId", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetNextTenantIdActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< GetNextTenantIdActor, 1, int64_t >*)0, actor_cancelled()); break; + } + + } +}; + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future getNextTenantId( Transaction const& tr ) { + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future(new GetNextTenantIdActor(tr)); + #line 3143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + + #line 3148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via createTenant() + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class CreateTenantActorState { + #line 3154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + CreateTenantActorState(Reference const& db,TenantName const& name,TenantMapEntry const& tenantEntry = TenantMapEntry(),ClusterType const& clusterType = ClusterType::STANDALONE) + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : db(db), + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + name(name), + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantEntry(tenantEntry), + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + clusterType(clusterType), + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr(db->createTransaction()), + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + checkExistence(clusterType != ClusterType::METACLUSTER_DATA), + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + generateTenantId(tenantEntry.id < 0) + #line 3173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("createTenant", reinterpret_cast(this)); + + } + ~CreateTenantActorState() + { + fdb_probe_actor_destroy("createTenant", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ASSERT(clusterType == ClusterType::STANDALONE || !generateTenantId); + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantEntry.tenantName = name; + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ; + #line 3192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CreateTenantActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantIdFuture = Future(); + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (generateTenantId) + #line 3229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantIdFuture = getNextTenantId(tr); + #line 3233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (checkExistence) + #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_0 = TenantMetadata::tenantNameIndex().get(tr, name); + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 3248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont2(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_4 = safeThreadFutureToFuture(tr->onError(e)); + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (generateTenantId) + #line 3297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = tenantIdFuture; + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont7(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont4(Optional const& existingId,int loopDepth) + { + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (existingId.present()) + #line 3322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1loopBody1Catch1(tenant_already_exists(), loopDepth); + #line 3326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + checkExistence = false; + #line 3330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(Optional && existingId,int loopDepth) + { + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (existingId.present()) + #line 3339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1loopBody1Catch1(tenant_already_exists(), loopDepth); + #line 3343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + checkExistence = false; + #line 3347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& existingId,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(existingId, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && existingId,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(existingId), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CreateTenantActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CreateTenantActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont7(int loopDepth) + { + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture, bool>> __when_expr_2 = createTenantTransaction(tr, tenantEntry, clusterType); + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont7when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_2.addCallbackAndClear(static_cast, bool> >*>(static_cast(this))); + #line 3426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont8(int64_t const& tenantId,int loopDepth) + { + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantEntry.setId(tenantId); + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::lastTenantId().set(tr, tenantId); + #line 3437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopBody1cont7(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont8(int64_t && tenantId,int loopDepth) + { + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantEntry.setId(tenantId); + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::lastTenantId().set(tr, tenantId); + #line 3448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopBody1cont7(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(int64_t const& tenantId,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(tenantId, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(int64_t && tenantId,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(std::move(tenantId), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantActor, 1, int64_t >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantActor, 1, int64_t >*,int64_t const& value) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< CreateTenantActor, 1, int64_t >*,int64_t && value) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< CreateTenantActor, 1, int64_t >*,Error err) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont10(int loopDepth) + { + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (newTenant.second) + #line 3520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ASSERT(newTenant.first.present()); + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_3 = buggifiedCommit(tr, BUGGIFY_WITH_PROB(0.1)); + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 3528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont10when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont10cont1(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont7when1(std::pair, bool> const& __newTenant,int loopDepth) + { + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + newTenant = __newTenant; + #line 3547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopBody1cont10(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont7when1(std::pair, bool> && __newTenant,int loopDepth) + { + newTenant = std::move(__newTenant); + loopDepth = a_body1loopBody1cont10(loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantActor, 2, std::pair, bool> >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantActor, 2, std::pair, bool> >*,std::pair, bool> const& value) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont7when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< CreateTenantActor, 2, std::pair, bool> >*,std::pair, bool> && value) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont7when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< CreateTenantActor, 2, std::pair, bool> >*,Error err) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 2); + + } + int a_body1loopBody1cont10cont1(int loopDepth) + { + #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(newTenant.first); this->~CreateTenantActorState(); static_cast(this)->destroy(); return 0; } + #line 3614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(newTenant.first); + this->~CreateTenantActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont10cont2(Void const& _,int loopDepth) + { + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TraceEvent("CreatedTenant") .detail("Tenant", name) .detail("TenantId", newTenant.first.get().id) .detail("Prefix", newTenant.first.get().prefix) .detail("TenantGroup", tenantEntry.tenantGroup) .detail("Version", tr->getCommittedVersion()); + #line 3626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopBody1cont10cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont10cont2(Void && _,int loopDepth) + { + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TraceEvent("CreatedTenant") .detail("Tenant", name) .detail("TenantId", newTenant.first.get().id) .detail("Prefix", newTenant.first.get().prefix) .detail("TenantGroup", tenantEntry.tenantGroup) .detail("Version", tr->getCommittedVersion()); + #line 3635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopBody1cont10cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont10when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont10cont2(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont10when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont10cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont10when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< CreateTenantActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont10when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< CreateTenantActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 3); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< CreateTenantActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< CreateTenantActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 4); + + } + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Reference db; + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantName name; + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMapEntry tenantEntry; + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ClusterType clusterType; + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Reference tr; + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + bool checkExistence; + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + bool generateTenantId; + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Future tenantIdFuture; + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + std::pair, bool> newTenant; + #line 3796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via createTenant() + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class CreateTenantActor final : public Actor>, public ActorCallback< CreateTenantActor, 0, Optional >, public ActorCallback< CreateTenantActor, 1, int64_t >, public ActorCallback< CreateTenantActor, 2, std::pair, bool> >, public ActorCallback< CreateTenantActor, 3, Void >, public ActorCallback< CreateTenantActor, 4, Void >, public FastAllocated>, public CreateTenantActorState> { + #line 3803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CreateTenantActor, 0, Optional >; +friend struct ActorCallback< CreateTenantActor, 1, int64_t >; +friend struct ActorCallback< CreateTenantActor, 2, std::pair, bool> >; +friend struct ActorCallback< CreateTenantActor, 3, Void >; +friend struct ActorCallback< CreateTenantActor, 4, Void >; + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + CreateTenantActor(Reference const& db,TenantName const& name,TenantMapEntry const& tenantEntry = TenantMapEntry(),ClusterType const& clusterType = ClusterType::STANDALONE) + #line 3818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor>(), + CreateTenantActorState>(db, name, tenantEntry, clusterType) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("createTenant"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CreateTenantActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CreateTenantActor, 1, int64_t >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< CreateTenantActor, 2, std::pair, bool> >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< CreateTenantActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< CreateTenantActor, 4, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future> createTenant( Reference const& db, TenantName const& name, TenantMapEntry const& tenantEntry = TenantMapEntry(), ClusterType const& clusterType = ClusterType::STANDALONE ) { + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future>(new CreateTenantActor(db, name, tenantEntry, clusterType)); + #line 3851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + + #line 3856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via markTenantTombstones() + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class MarkTenantTombstonesActorState { + #line 3862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + MarkTenantTombstonesActorState(Transaction const& tr,int64_t const& tenantId) + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : tr(tr), + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantId(tenantId), + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + latestTombstoneFuture(TenantMetadata::tenantTombstones().getRange(tr, {}, {}, 1, Snapshot::False, Reverse::True)) + #line 3873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("markTenantTombstones", reinterpret_cast(this)); + + } + ~MarkTenantTombstonesActorState() + { + fdb_probe_actor_destroy("markTenantTombstones", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_0 = TenantMetadata::tombstoneCleanupData().get(tr); + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 3895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~MarkTenantTombstonesActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->getReadVersion()); + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Optional const& __cleanupData,int loopDepth) + { + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + cleanupData = __cleanupData; + #line 3934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && __cleanupData,int loopDepth) + { + cleanupData = std::move(__cleanupData); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< MarkTenantTombstonesActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< MarkTenantTombstonesActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("markTenantTombstones", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("markTenantTombstones", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< MarkTenantTombstonesActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("markTenantTombstones", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("markTenantTombstones", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< MarkTenantTombstonesActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("markTenantTombstones", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("markTenantTombstones", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!cleanupData.present() || cleanupData.get().nextTombstoneEraseVersion <= transactionReadVersion) + #line 4001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + deleteThroughId = cleanupData.present() ? cleanupData.get().nextTombstoneEraseId : -1; + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (deleteThroughId >= 0) + #line 4007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantTombstones().erase(tr, 0, deleteThroughId + 1); + #line 4011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_2 = latestTombstoneFuture; + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 4022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantId > cleanupData.get().tombstonesErasedThrough) + #line 4029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantTombstones().insert(tr, tenantId); + #line 4033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + loopDepth = a_body1cont3(loopDepth); + } + + return loopDepth; + } + int a_body1cont1when1(Version const& __transactionReadVersion,int loopDepth) + { + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + transactionReadVersion = __transactionReadVersion; + #line 4044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Version && __transactionReadVersion,int loopDepth) + { + transactionReadVersion = std::move(__transactionReadVersion); + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< MarkTenantTombstonesActor, 1, Version >::remove(); + + } + void a_callback_fire(ActorCallback< MarkTenantTombstonesActor, 1, Version >*,Version const& value) + { + fdb_probe_actor_enter("markTenantTombstones", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("markTenantTombstones", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< MarkTenantTombstonesActor, 1, Version >*,Version && value) + { + fdb_probe_actor_enter("markTenantTombstones", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("markTenantTombstones", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< MarkTenantTombstonesActor, 1, Version >*,Error err) + { + fdb_probe_actor_enter("markTenantTombstones", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("markTenantTombstones", reinterpret_cast(this), 1); + + } + int a_body1cont3(int loopDepth) + { + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~MarkTenantTombstonesActorState(); static_cast(this)->destroy(); return 0; } + #line 4111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~MarkTenantTombstonesActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont4(KeyBackedRangeResult const& latestTombstone,int loopDepth) + { + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + int64_t nextDeleteThroughId = std::max(deleteThroughId, tenantId); + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!latestTombstone.results.empty()) + #line 4125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + nextDeleteThroughId = std::max(nextDeleteThroughId, latestTombstone.results[0]); + #line 4129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantTombstoneCleanupData updatedCleanupData; + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + updatedCleanupData.tombstonesErasedThrough = deleteThroughId; + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + updatedCleanupData.nextTombstoneEraseId = nextDeleteThroughId; + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + updatedCleanupData.nextTombstoneEraseVersion = transactionReadVersion + CLIENT_KNOBS->TENANT_TOMBSTONE_CLEANUP_INTERVAL * CLIENT_KNOBS->VERSIONS_PER_SECOND; + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tombstoneCleanupData().set(tr, updatedCleanupData); + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantId > updatedCleanupData.tombstonesErasedThrough) + #line 4143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantTombstones().insert(tr, tenantId); + #line 4147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1cont4(KeyBackedRangeResult && latestTombstone,int loopDepth) + { + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + int64_t nextDeleteThroughId = std::max(deleteThroughId, tenantId); + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!latestTombstone.results.empty()) + #line 4159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + nextDeleteThroughId = std::max(nextDeleteThroughId, latestTombstone.results[0]); + #line 4163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantTombstoneCleanupData updatedCleanupData; + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + updatedCleanupData.tombstonesErasedThrough = deleteThroughId; + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + updatedCleanupData.nextTombstoneEraseId = nextDeleteThroughId; + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + updatedCleanupData.nextTombstoneEraseVersion = transactionReadVersion + CLIENT_KNOBS->TENANT_TOMBSTONE_CLEANUP_INTERVAL * CLIENT_KNOBS->VERSIONS_PER_SECOND; + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tombstoneCleanupData().set(tr, updatedCleanupData); + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantId > updatedCleanupData.tombstonesErasedThrough) + #line 4177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantTombstones().insert(tr, tenantId); + #line 4181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1cont2when1(KeyBackedRangeResult const& latestTombstone,int loopDepth) + { + loopDepth = a_body1cont4(latestTombstone, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(KeyBackedRangeResult && latestTombstone,int loopDepth) + { + loopDepth = a_body1cont4(std::move(latestTombstone), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< MarkTenantTombstonesActor, 2, KeyBackedRangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< MarkTenantTombstonesActor, 2, KeyBackedRangeResult >*,KeyBackedRangeResult const& value) + { + fdb_probe_actor_enter("markTenantTombstones", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("markTenantTombstones", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< MarkTenantTombstonesActor, 2, KeyBackedRangeResult >*,KeyBackedRangeResult && value) + { + fdb_probe_actor_enter("markTenantTombstones", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("markTenantTombstones", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< MarkTenantTombstonesActor, 2, KeyBackedRangeResult >*,Error err) + { + fdb_probe_actor_enter("markTenantTombstones", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("markTenantTombstones", reinterpret_cast(this), 2); + + } + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Transaction tr; + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + int64_t tenantId; + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Future> latestTombstoneFuture; + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Optional cleanupData; + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Version transactionReadVersion; + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + int64_t deleteThroughId; + #line 4262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via markTenantTombstones() + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class MarkTenantTombstonesActor final : public Actor, public ActorCallback< MarkTenantTombstonesActor, 0, Optional >, public ActorCallback< MarkTenantTombstonesActor, 1, Version >, public ActorCallback< MarkTenantTombstonesActor, 2, KeyBackedRangeResult >, public FastAllocated>, public MarkTenantTombstonesActorState> { + #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< MarkTenantTombstonesActor, 0, Optional >; +friend struct ActorCallback< MarkTenantTombstonesActor, 1, Version >; +friend struct ActorCallback< MarkTenantTombstonesActor, 2, KeyBackedRangeResult >; + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + MarkTenantTombstonesActor(Transaction const& tr,int64_t const& tenantId) + #line 4282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor(), + MarkTenantTombstonesActorState>(tr, tenantId) + { + fdb_probe_actor_enter("markTenantTombstones", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("markTenantTombstones"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("markTenantTombstones", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< MarkTenantTombstonesActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< MarkTenantTombstonesActor, 1, Version >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< MarkTenantTombstonesActor, 2, KeyBackedRangeResult >*)0, actor_cancelled()); break; + } + + } +}; + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future markTenantTombstones( Transaction const& tr, int64_t const& tenantId ) { + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future(new MarkTenantTombstonesActor(tr, tenantId)); + #line 4313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + +// Deletes a tenant with the given ID. If no matching tenant is found, this function returns without deleting anything. +// This behavior allows the function to be used idempotently: if the transaction is retried after having succeeded, it +// will see that the tenant is absent and do nothing. + #line 4321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via deleteTenantTransaction() + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class DeleteTenantTransactionActorState { + #line 4327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + DeleteTenantTransactionActorState(Transaction const& tr,int64_t const& tenantId,ClusterType const& clusterType = ClusterType::STANDALONE) + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : tr(tr), + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantId(tenantId), + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + clusterType(clusterType) + #line 4338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("deleteTenantTransaction", reinterpret_cast(this)); + + } + ~DeleteTenantTransactionActorState() + { + fdb_probe_actor_destroy("deleteTenantTransaction", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ASSERT(tenantId != TenantInfo::INVALID_TENANT); + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ASSERT(clusterType != ClusterType::METACLUSTER_MANAGEMENT); + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantEntryFuture = tryGetTenantTransaction(tr, tenantId); + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_0 = checkTenantMode(tr, clusterType); + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~DeleteTenantTransactionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_1 = tenantEntryFuture; + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 4398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_1 = tenantEntryFuture; + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 4414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DeleteTenantTransactionActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DeleteTenantTransactionActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< DeleteTenantTransactionActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< DeleteTenantTransactionActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantEntry.present()) + #line 4486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + prefixRangeFuture = tr->getRange(prefixRange(tenantEntry.get().prefix), 1); + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_2 = safeThreadFutureToFuture(prefixRangeFuture); + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont3(loopDepth); + } + + return loopDepth; + } + int a_body1cont1when1(Optional const& __tenantEntry,int loopDepth) + { + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantEntry = __tenantEntry; + #line 4513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Optional && __tenantEntry,int loopDepth) + { + tenantEntry = std::move(__tenantEntry); + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DeleteTenantTransactionActor, 1, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< DeleteTenantTransactionActor, 1, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< DeleteTenantTransactionActor, 1, Optional >*,Optional && value) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< DeleteTenantTransactionActor, 1, Optional >*,Error err) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 1); + + } + int a_body1cont3(int loopDepth) + { + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (clusterType == ClusterType::METACLUSTER_DATA) + #line 4580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_4 = markTenantTombstones(tr, tenantId); + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont3when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont10(loopDepth); + } + + return loopDepth; + } + int a_body1cont4(RangeResult const& contents,int loopDepth) + { + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!contents.empty()) + #line 4605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_not_empty(), loopDepth); + #line 4609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantMap().erase(tr, tenantId); + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantNameIndex().erase(tr, tenantEntry.get().tenantName); + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantCount().atomicOp(tr, -1, MutationRef::AddValue); + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::lastTenantModification().setVersionstamp(tr, Versionstamp(), 0); + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantEntry.get().tenantGroup.present()) + #line 4621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupTenantIndex().erase( tr, Tuple::makeTuple(tenantEntry.get().tenantGroup.get(), tenantId)); + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture::RangeResultType> __when_expr_3 = TenantMetadata::tenantGroupTenantIndex().getRange( tr, Tuple::makeTuple(tenantEntry.get().tenantGroup.get()), Tuple::makeTuple(keyAfter(tenantEntry.get().tenantGroup.get())), 2); + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_3.addCallbackAndClear(static_cast::RangeResultType >*>(static_cast(this))); + #line 4634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont5(loopDepth); + } + + return loopDepth; + } + int a_body1cont4(RangeResult && contents,int loopDepth) + { + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!contents.empty()) + #line 4648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_not_empty(), loopDepth); + #line 4652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantMap().erase(tr, tenantId); + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantNameIndex().erase(tr, tenantEntry.get().tenantName); + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantCount().atomicOp(tr, -1, MutationRef::AddValue); + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::lastTenantModification().setVersionstamp(tr, Versionstamp(), 0); + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantEntry.get().tenantGroup.present()) + #line 4664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupTenantIndex().erase( tr, Tuple::makeTuple(tenantEntry.get().tenantGroup.get(), tenantId)); + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture::RangeResultType> __when_expr_3 = TenantMetadata::tenantGroupTenantIndex().getRange( tr, Tuple::makeTuple(tenantEntry.get().tenantGroup.get()), Tuple::makeTuple(keyAfter(tenantEntry.get().tenantGroup.get())), 2); + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_3.addCallbackAndClear(static_cast::RangeResultType >*>(static_cast(this))); + #line 4677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont5(loopDepth); + } + + return loopDepth; + } + int a_body1cont2when1(RangeResult const& contents,int loopDepth) + { + loopDepth = a_body1cont4(contents, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(RangeResult && contents,int loopDepth) + { + loopDepth = a_body1cont4(std::move(contents), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DeleteTenantTransactionActor, 2, RangeResult >::remove(); + + } + void a_callback_fire(ActorCallback< DeleteTenantTransactionActor, 2, RangeResult >*,RangeResult const& value) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< DeleteTenantTransactionActor, 2, RangeResult >*,RangeResult && value) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< DeleteTenantTransactionActor, 2, RangeResult >*,Error err) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 2); + + } + int a_body1cont5(int loopDepth) + { + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1cont7(KeyBackedSet::RangeResultType const& tenantsInGroup,int loopDepth) + { + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantsInGroup.results.empty() || (tenantsInGroup.results.size() == 1 && tenantsInGroup.results[0].getInt(1) == tenantId)) + #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupMap().erase(tr, tenantEntry.get().tenantGroup.get()); + #line 4764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont7(KeyBackedSet::RangeResultType && tenantsInGroup,int loopDepth) + { + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenantsInGroup.results.empty() || (tenantsInGroup.results.size() == 1 && tenantsInGroup.results[0].getInt(1) == tenantId)) + #line 4774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupMap().erase(tr, tenantEntry.get().tenantGroup.get()); + #line 4778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont4when1(KeyBackedSet::RangeResultType const& tenantsInGroup,int loopDepth) + { + loopDepth = a_body1cont7(tenantsInGroup, loopDepth); + + return loopDepth; + } + int a_body1cont4when1(KeyBackedSet::RangeResultType && tenantsInGroup,int loopDepth) + { + loopDepth = a_body1cont7(std::move(tenantsInGroup), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DeleteTenantTransactionActor, 3, KeyBackedSet::RangeResultType >::remove(); + + } + void a_callback_fire(ActorCallback< DeleteTenantTransactionActor, 3, KeyBackedSet::RangeResultType >*,KeyBackedSet::RangeResultType const& value) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont4when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< DeleteTenantTransactionActor, 3, KeyBackedSet::RangeResultType >*,KeyBackedSet::RangeResultType && value) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont4when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< DeleteTenantTransactionActor, 3, KeyBackedSet::RangeResultType >*,Error err) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 3); + + } + int a_body1cont10(int loopDepth) + { + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 4851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DeleteTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont11(Void const& _,int loopDepth) + { + loopDepth = a_body1cont10(loopDepth); + + return loopDepth; + } + int a_body1cont11(Void && _,int loopDepth) + { + loopDepth = a_body1cont10(loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont11(_, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont11(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DeleteTenantTransactionActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DeleteTenantTransactionActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< DeleteTenantTransactionActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< DeleteTenantTransactionActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), 4); + + } + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Transaction tr; + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + int64_t tenantId; + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ClusterType clusterType; + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Future> tenantEntryFuture; + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Optional tenantEntry; + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + typename transaction_future_type::type prefixRangeFuture; + #line 4946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via deleteTenantTransaction() + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class DeleteTenantTransactionActor final : public Actor, public ActorCallback< DeleteTenantTransactionActor, 0, Void >, public ActorCallback< DeleteTenantTransactionActor, 1, Optional >, public ActorCallback< DeleteTenantTransactionActor, 2, RangeResult >, public ActorCallback< DeleteTenantTransactionActor, 3, KeyBackedSet::RangeResultType >, public ActorCallback< DeleteTenantTransactionActor, 4, Void >, public FastAllocated>, public DeleteTenantTransactionActorState> { + #line 4953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DeleteTenantTransactionActor, 0, Void >; +friend struct ActorCallback< DeleteTenantTransactionActor, 1, Optional >; +friend struct ActorCallback< DeleteTenantTransactionActor, 2, RangeResult >; +friend struct ActorCallback< DeleteTenantTransactionActor, 3, KeyBackedSet::RangeResultType >; +friend struct ActorCallback< DeleteTenantTransactionActor, 4, Void >; + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + DeleteTenantTransactionActor(Transaction const& tr,int64_t const& tenantId,ClusterType const& clusterType = ClusterType::STANDALONE) + #line 4968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor(), + DeleteTenantTransactionActorState>(tr, tenantId, clusterType) + { + fdb_probe_actor_enter("deleteTenantTransaction", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("deleteTenantTransaction"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("deleteTenantTransaction", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DeleteTenantTransactionActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DeleteTenantTransactionActor, 1, Optional >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< DeleteTenantTransactionActor, 2, RangeResult >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< DeleteTenantTransactionActor, 3, KeyBackedSet::RangeResultType >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< DeleteTenantTransactionActor, 4, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future deleteTenantTransaction( Transaction const& tr, int64_t const& tenantId, ClusterType const& clusterType = ClusterType::STANDALONE ) { + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future(new DeleteTenantTransactionActor(tr, tenantId, clusterType)); + #line 5001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + +// Deletes the tenant with the given name. If tenantId is specified, the tenant being deleted must also have the same +// ID. + #line 5008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via deleteTenant() + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class DeleteTenantActorState { + #line 5014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + DeleteTenantActorState(Reference const& db,TenantName const& name,Optional const& tenantId = Optional(),ClusterType const& clusterType = ClusterType::STANDALONE) + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : db(db), + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + name(name), + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantId(tenantId), + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + clusterType(clusterType), + #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr(db->createTransaction()), + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + checkExistence(clusterType == ClusterType::STANDALONE) + #line 5031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("deleteTenant", reinterpret_cast(this)); + + } + ~DeleteTenantActorState() + { + fdb_probe_actor_destroy("deleteTenant", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ; + #line 5046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~DeleteTenantActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (checkExistence) + #line 5081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_0 = TenantMetadata::tenantNameIndex().get(tr, name); + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 5092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont2(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_3 = safeThreadFutureToFuture(tr->onError(e)); + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 5121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = deleteTenantTransaction(tr, tenantId.get(), clusterType); + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Optional const& actualId,int loopDepth) + { + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!actualId.present() || (tenantId.present() && tenantId != actualId)) + #line 5157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1loopBody1Catch1(tenant_not_found(), loopDepth); + #line 5161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantId = actualId; + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + checkExistence = false; + #line 5167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3(Optional && actualId,int loopDepth) + { + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!actualId.present() || (tenantId.present() && tenantId != actualId)) + #line 5176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1loopBody1Catch1(tenant_not_found(), loopDepth); + #line 5180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantId = actualId; + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + checkExistence = false; + #line 5186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& actualId,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(actualId, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && actualId,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(actualId), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DeleteTenantActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< DeleteTenantActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< DeleteTenantActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< DeleteTenantActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont6(Void const& _,int loopDepth) + { + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_2 = buggifiedCommit(tr, BUGGIFY_WITH_PROB(0.1)); + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont6(Void && _,int loopDepth) + { + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_2 = buggifiedCommit(tr, BUGGIFY_WITH_PROB(0.1)); + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 5276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont6(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont6(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DeleteTenantActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DeleteTenantActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< DeleteTenantActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< DeleteTenantActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont7(Void const& _,int loopDepth) + { + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TraceEvent("DeletedTenant") .detail("Tenant", name) .detail("TenantId", tenantId) .detail("Version", tr->getCommittedVersion()); + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteTenantActorState(); static_cast(this)->destroy(); return 0; } + #line 5355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DeleteTenantActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont7(Void && _,int loopDepth) + { + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TraceEvent("DeletedTenant") .detail("Tenant", name) .detail("TenantId", tenantId) .detail("Version", tr->getCommittedVersion()); + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteTenantActorState(); static_cast(this)->destroy(); return 0; } + #line 5369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DeleteTenantActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont6when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont7(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont6when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont7(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DeleteTenantActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DeleteTenantActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont6when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< DeleteTenantActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont6when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< DeleteTenantActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 2); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DeleteTenantActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DeleteTenantActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< DeleteTenantActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< DeleteTenantActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), 3); + + } + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Reference db; + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantName name; + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Optional tenantId; + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ClusterType clusterType; + #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Reference tr; + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + bool checkExistence; + #line 5527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via deleteTenant() + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class DeleteTenantActor final : public Actor, public ActorCallback< DeleteTenantActor, 0, Optional >, public ActorCallback< DeleteTenantActor, 1, Void >, public ActorCallback< DeleteTenantActor, 2, Void >, public ActorCallback< DeleteTenantActor, 3, Void >, public FastAllocated>, public DeleteTenantActorState> { + #line 5534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DeleteTenantActor, 0, Optional >; +friend struct ActorCallback< DeleteTenantActor, 1, Void >; +friend struct ActorCallback< DeleteTenantActor, 2, Void >; +friend struct ActorCallback< DeleteTenantActor, 3, Void >; + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + DeleteTenantActor(Reference const& db,TenantName const& name,Optional const& tenantId = Optional(),ClusterType const& clusterType = ClusterType::STANDALONE) + #line 5548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor(), + DeleteTenantActorState>(db, name, tenantId, clusterType) + { + fdb_probe_actor_enter("deleteTenant", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("deleteTenant"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("deleteTenant", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DeleteTenantActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DeleteTenantActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< DeleteTenantActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< DeleteTenantActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future deleteTenant( Reference const& db, TenantName const& name, Optional const& tenantId = Optional(), ClusterType const& clusterType = ClusterType::STANDALONE ) { + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future(new DeleteTenantActor(db, name, tenantId, clusterType)); + #line 5580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + +// This should only be called from a transaction that has already confirmed that the tenant entry +// is present. The tenantEntry should start with the existing entry and modify only those fields that need +// to be changed. This must only be called on a non-management cluster. + #line 5588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via configureTenantTransaction() + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class ConfigureTenantTransactionActorState { + #line 5594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ConfigureTenantTransactionActorState(Transaction const& tr,TenantMapEntry const& originalEntry,TenantMapEntry const& updatedTenantEntry) + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : tr(tr), + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + originalEntry(originalEntry), + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + updatedTenantEntry(updatedTenantEntry) + #line 5605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("configureTenantTransaction", reinterpret_cast(this)); + + } + ~ConfigureTenantTransactionActorState() + { + fdb_probe_actor_destroy("configureTenantTransaction", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ASSERT(updatedTenantEntry.id == originalEntry.id); + #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantMap().set(tr, updatedTenantEntry.id, updatedTenantEntry); + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::lastTenantModification().setVersionstamp(tr, Versionstamp(), 0); + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (originalEntry.tenantGroup != updatedTenantEntry.tenantGroup) + #line 5628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (updatedTenantEntry.tenantGroup.present() && updatedTenantEntry.tenantGroup.get().startsWith("\xff"_sr)) + #line 5632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(invalid_tenant_group_name(), loopDepth); + #line 5636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (originalEntry.tenantGroup.present()) + #line 5640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupTenantIndex().erase( tr, Tuple::makeTuple(originalEntry.tenantGroup.get(), updatedTenantEntry.id)); + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture::RangeResultType> __when_expr_0 = TenantMetadata::tenantGroupTenantIndex().getRange( tr, Tuple::makeTuple(originalEntry.tenantGroup.get()), Tuple::makeTuple(keyAfter(originalEntry.tenantGroup.get())), 2); + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast::RangeResultType >*>(static_cast(this))); + #line 5653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont2(loopDepth); + } + } + else + { + loopDepth = a_body1cont1(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ConfigureTenantTransactionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ASSERT_EQ(updatedTenantEntry.tenantLockId.present(), updatedTenantEntry.tenantLockState != TenantLockState::UNLOCKED); + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ConfigureTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 5688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ConfigureTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(int loopDepth) + { + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (updatedTenantEntry.tenantGroup.present()) + #line 5700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_1 = TenantMetadata::tenantGroupMap().get(tr, updatedTenantEntry.tenantGroup.get()); + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 5711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont7(loopDepth); + } + + return loopDepth; + } + int a_body1cont4(KeyBackedSet::RangeResultType const& tenants,int loopDepth) + { + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenants.results.empty() || (tenants.results.size() == 1 && tenants.results[0].getInt(1) == updatedTenantEntry.id)) + #line 5725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupMap().erase(tr, originalEntry.tenantGroup.get()); + #line 5729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont4(KeyBackedSet::RangeResultType && tenants,int loopDepth) + { + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (tenants.results.empty() || (tenants.results.size() == 1 && tenants.results[0].getInt(1) == updatedTenantEntry.id)) + #line 5739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupMap().erase(tr, originalEntry.tenantGroup.get()); + #line 5743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1when1(KeyBackedSet::RangeResultType const& tenants,int loopDepth) + { + loopDepth = a_body1cont4(tenants, loopDepth); + + return loopDepth; + } + int a_body1when1(KeyBackedSet::RangeResultType && tenants,int loopDepth) + { + loopDepth = a_body1cont4(std::move(tenants), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ConfigureTenantTransactionActor, 0, KeyBackedSet::RangeResultType >::remove(); + + } + void a_callback_fire(ActorCallback< ConfigureTenantTransactionActor, 0, KeyBackedSet::RangeResultType >*,KeyBackedSet::RangeResultType const& value) + { + fdb_probe_actor_enter("configureTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("configureTenantTransaction", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ConfigureTenantTransactionActor, 0, KeyBackedSet::RangeResultType >*,KeyBackedSet::RangeResultType && value) + { + fdb_probe_actor_enter("configureTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("configureTenantTransaction", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ConfigureTenantTransactionActor, 0, KeyBackedSet::RangeResultType >*,Error err) + { + fdb_probe_actor_enter("configureTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("configureTenantTransaction", reinterpret_cast(this), 0); + + } + int a_body1cont7(int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont8(Optional const& entry,int loopDepth) + { + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!entry.present()) + #line 5822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupMap().set(tr, updatedTenantEntry.tenantGroup.get(), TenantGroupEntry()); + #line 5826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupTenantIndex().insert( tr, Tuple::makeTuple(updatedTenantEntry.tenantGroup.get(), updatedTenantEntry.id)); + #line 5830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1cont7(loopDepth); + + return loopDepth; + } + int a_body1cont8(Optional && entry,int loopDepth) + { + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!entry.present()) + #line 5839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupMap().set(tr, updatedTenantEntry.tenantGroup.get(), TenantGroupEntry()); + #line 5843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantGroupTenantIndex().insert( tr, Tuple::makeTuple(updatedTenantEntry.tenantGroup.get(), updatedTenantEntry.id)); + #line 5847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1cont7(loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Optional const& entry,int loopDepth) + { + loopDepth = a_body1cont8(entry, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Optional && entry,int loopDepth) + { + loopDepth = a_body1cont8(std::move(entry), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ConfigureTenantTransactionActor, 1, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< ConfigureTenantTransactionActor, 1, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("configureTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("configureTenantTransaction", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ConfigureTenantTransactionActor, 1, Optional >*,Optional && value) + { + fdb_probe_actor_enter("configureTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("configureTenantTransaction", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< ConfigureTenantTransactionActor, 1, Optional >*,Error err) + { + fdb_probe_actor_enter("configureTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("configureTenantTransaction", reinterpret_cast(this), 1); + + } + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Transaction tr; + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMapEntry originalEntry; + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMapEntry updatedTenantEntry; + #line 5921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via configureTenantTransaction() + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class ConfigureTenantTransactionActor final : public Actor, public ActorCallback< ConfigureTenantTransactionActor, 0, KeyBackedSet::RangeResultType >, public ActorCallback< ConfigureTenantTransactionActor, 1, Optional >, public FastAllocated>, public ConfigureTenantTransactionActorState> { + #line 5928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ConfigureTenantTransactionActor, 0, KeyBackedSet::RangeResultType >; +friend struct ActorCallback< ConfigureTenantTransactionActor, 1, Optional >; + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ConfigureTenantTransactionActor(Transaction const& tr,TenantMapEntry const& originalEntry,TenantMapEntry const& updatedTenantEntry) + #line 5940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor(), + ConfigureTenantTransactionActorState>(tr, originalEntry, updatedTenantEntry) + { + fdb_probe_actor_enter("configureTenantTransaction", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("configureTenantTransaction"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("configureTenantTransaction", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ConfigureTenantTransactionActor, 0, KeyBackedSet::RangeResultType >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ConfigureTenantTransactionActor, 1, Optional >*)0, actor_cancelled()); break; + } + + } +}; + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future configureTenantTransaction( Transaction const& tr, TenantMapEntry const& originalEntry, TenantMapEntry const& updatedTenantEntry ) { + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future(new ConfigureTenantTransactionActor(tr, originalEntry, updatedTenantEntry)); + #line 5970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + +template +bool checkLockState(TenantMapEntryT entry, TenantLockState desiredLockState, UID lockId) { + if (entry.tenantLockId == lockId && entry.tenantLockState == desiredLockState) { + return true; + } + + if (entry.tenantLockId.present() && entry.tenantLockId.get() != lockId) { + throw tenant_locked(); + } + + return false; +} + + #line 5988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via changeLockState() + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class ChangeLockStateActorState { + #line 5994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ChangeLockStateActorState(Transaction const& tr,int64_t const& tenant,TenantLockState const& desiredLockState,UID const& lockId) + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : tr(tr), + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenant(tenant), + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + desiredLockState(desiredLockState), + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + lockId(lockId), + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantModeCheck(TenantAPI::checkTenantMode(tr, ClusterType::STANDALONE)) + #line 6009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("changeLockState", reinterpret_cast(this)); + + } + ~ChangeLockStateActorState() + { + fdb_probe_actor_destroy("changeLockState", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_0 = TenantAPI::getTenantTransaction(tr, tenant); + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ChangeLockStateActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = tenantModeCheck; + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(TenantMapEntry const& __entry,int loopDepth) + { + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + entry = __entry; + #line 6070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(TenantMapEntry && __entry,int loopDepth) + { + entry = std::move(__entry); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeLockStateActor, 0, TenantMapEntry >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeLockStateActor, 0, TenantMapEntry >*,TenantMapEntry const& value) + { + fdb_probe_actor_enter("changeLockState", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeLockState", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ChangeLockStateActor, 0, TenantMapEntry >*,TenantMapEntry && value) + { + fdb_probe_actor_enter("changeLockState", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeLockState", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ChangeLockStateActor, 0, TenantMapEntry >*,Error err) + { + fdb_probe_actor_enter("changeLockState", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeLockState", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!checkLockState(entry, desiredLockState, lockId)) + #line 6137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMapEntry newState = entry; + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + newState.tenantLockState = desiredLockState; + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + newState.tenantLockId = (desiredLockState == TenantLockState::UNLOCKED) ? Optional() : lockId; + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_2 = configureTenantTransaction(tr, entry, newState); + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont3(loopDepth); + } + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!checkLockState(entry, desiredLockState, lockId)) + #line 6168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMapEntry newState = entry; + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + newState.tenantLockState = desiredLockState; + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + newState.tenantLockId = (desiredLockState == TenantLockState::UNLOCKED) ? Optional() : lockId; + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_2 = configureTenantTransaction(tr, entry, newState); + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont3(loopDepth); + } + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeLockStateActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeLockStateActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeLockState", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeLockState", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ChangeLockStateActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("changeLockState", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeLockState", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< ChangeLockStateActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("changeLockState", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeLockState", reinterpret_cast(this), 1); + + } + int a_body1cont3(int loopDepth) + { + #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeLockStateActorState(); static_cast(this)->destroy(); return 0; } + #line 6262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeLockStateActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont4(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1cont4(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeLockStateActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeLockStateActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeLockState", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeLockState", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< ChangeLockStateActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("changeLockState", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeLockState", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< ChangeLockStateActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("changeLockState", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeLockState", reinterpret_cast(this), 2); + + } + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Transaction tr; + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + int64_t tenant; + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantLockState desiredLockState; + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + UID lockId; + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Future tenantModeCheck; + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMapEntry entry; + #line 6357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via changeLockState() + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class ChangeLockStateActor final : public Actor, public ActorCallback< ChangeLockStateActor, 0, TenantMapEntry >, public ActorCallback< ChangeLockStateActor, 1, Void >, public ActorCallback< ChangeLockStateActor, 2, Void >, public FastAllocated>, public ChangeLockStateActorState> { + #line 6364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ChangeLockStateActor, 0, TenantMapEntry >; +friend struct ActorCallback< ChangeLockStateActor, 1, Void >; +friend struct ActorCallback< ChangeLockStateActor, 2, Void >; + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ChangeLockStateActor(Transaction const& tr,int64_t const& tenant,TenantLockState const& desiredLockState,UID const& lockId) + #line 6377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor(), + ChangeLockStateActorState>(tr, tenant, desiredLockState, lockId) + { + fdb_probe_actor_enter("changeLockState", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("changeLockState"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("changeLockState", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ChangeLockStateActor, 0, TenantMapEntry >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ChangeLockStateActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ChangeLockStateActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future changeLockState( Transaction const& tr, int64_t const& tenant, TenantLockState const& desiredLockState, UID const& lockId ) { + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future(new ChangeLockStateActor(tr, tenant, desiredLockState, lockId)); + #line 6408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + +template +Future>> listTenantsTransaction(Transaction tr, + TenantName begin, + TenantName end, + int limit) { + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + auto future = TenantMetadata::tenantNameIndex().getRange(tr, begin, end, limit); + return fmap([](auto f) -> std::vector> { return f.results; }, future); +} + +template +Future>> listTenants(Reference db, + TenantName begin, + TenantName end, + int limit) { + return runTransaction(db, [=](Reference tr) { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + return listTenantsTransaction(tr, begin, end, limit); + }); +} + + #line 6435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via listTenantMetadataTransaction() + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class ListTenantMetadataTransactionActorState { + #line 6441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ListTenantMetadataTransactionActorState(Transaction const& tr,TenantName const& begin,TenantName const& end,int const& limit) + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : tr(tr), + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + begin(begin), + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + end(end), + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + limit(limit) + #line 6454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("listTenantMetadataTransaction", reinterpret_cast(this)); + + } + ~ListTenantMetadataTransactionActorState() + { + fdb_probe_actor_destroy("listTenantMetadataTransaction", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture>> __when_expr_0 = listTenantsTransaction(tr, begin, end, limit); + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 6476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ListTenantMetadataTransactionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(std::vector> const& matchingTenants,int loopDepth) + { + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantEntryFutures = std::vector>(); + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + for( auto const& [name, id] : matchingTenants ) { + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantEntryFutures.push_back(getTenantTransaction(tr, id)); + #line 6503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = waitForAll(tenantEntryFutures); + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(std::vector> && matchingTenants,int loopDepth) + { + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantEntryFutures = std::vector>(); + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + for( auto const& [name, id] : matchingTenants ) { + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantEntryFutures.push_back(getTenantTransaction(tr, id)); + #line 6527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = waitForAll(tenantEntryFutures); + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(std::vector> const& matchingTenants,int loopDepth) + { + loopDepth = a_body1cont1(matchingTenants, loopDepth); + + return loopDepth; + } + int a_body1when1(std::vector> && matchingTenants,int loopDepth) + { + loopDepth = a_body1cont1(std::move(matchingTenants), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ListTenantMetadataTransactionActor, 0, std::vector> >::remove(); + + } + void a_callback_fire(ActorCallback< ListTenantMetadataTransactionActor, 0, std::vector> >*,std::vector> const& value) + { + fdb_probe_actor_enter("listTenantMetadataTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantMetadataTransaction", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ListTenantMetadataTransactionActor, 0, std::vector> >*,std::vector> && value) + { + fdb_probe_actor_enter("listTenantMetadataTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantMetadataTransaction", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ListTenantMetadataTransactionActor, 0, std::vector> >*,Error err) + { + fdb_probe_actor_enter("listTenantMetadataTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantMetadataTransaction", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + std::vector> results; + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + for( auto const& f : tenantEntryFutures ) { + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + results.emplace_back(f.get().tenantName, f.get()); + #line 6614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~ListTenantMetadataTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 6618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(results); + this->~ListTenantMetadataTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + std::vector> results; + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + for( auto const& f : tenantEntryFutures ) { + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + results.emplace_back(f.get().tenantName, f.get()); + #line 6634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(results); this->~ListTenantMetadataTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 6638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(results); + this->~ListTenantMetadataTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ListTenantMetadataTransactionActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ListTenantMetadataTransactionActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("listTenantMetadataTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantMetadataTransaction", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ListTenantMetadataTransactionActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("listTenantMetadataTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantMetadataTransaction", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< ListTenantMetadataTransactionActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("listTenantMetadataTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantMetadataTransaction", reinterpret_cast(this), 1); + + } + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Transaction tr; + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantName begin; + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantName end; + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + int limit; + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + std::vector> tenantEntryFutures; + #line 6719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via listTenantMetadataTransaction() + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class ListTenantMetadataTransactionActor final : public Actor>>, public ActorCallback< ListTenantMetadataTransactionActor, 0, std::vector> >, public ActorCallback< ListTenantMetadataTransactionActor, 1, Void >, public FastAllocated>, public ListTenantMetadataTransactionActorState> { + #line 6726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ListTenantMetadataTransactionActor, 0, std::vector> >; +friend struct ActorCallback< ListTenantMetadataTransactionActor, 1, Void >; + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ListTenantMetadataTransactionActor(Transaction const& tr,TenantName const& begin,TenantName const& end,int const& limit) + #line 6738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor>>(), + ListTenantMetadataTransactionActorState>(tr, begin, end, limit) + { + fdb_probe_actor_enter("listTenantMetadataTransaction", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("listTenantMetadataTransaction"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("listTenantMetadataTransaction", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ListTenantMetadataTransactionActor, 0, std::vector> >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ListTenantMetadataTransactionActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future>> listTenantMetadataTransaction( Transaction const& tr, TenantName const& begin, TenantName const& end, int const& limit ) { + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future>>(new ListTenantMetadataTransactionActor(tr, begin, end, limit)); + #line 6768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + +template +Future>> listTenantMetadata(Reference db, + TenantName begin, + TenantName end, + int limit) { + return runTransaction(db, [=](Reference tr) { + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + return listTenantMetadataTransaction(tr, begin, end, limit); + }); +} + + #line 6785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via renameTenantTransaction() + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class RenameTenantTransactionActorState { + #line 6791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + RenameTenantTransactionActorState(Transaction const& tr,TenantName const& oldName,TenantName const& newName,Optional const& tenantId = Optional(),ClusterType const& clusterType = ClusterType::STANDALONE,Optional const& configureSequenceNum = Optional()) + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : tr(tr), + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + oldName(oldName), + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + newName(newName), + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantId(tenantId), + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + clusterType(clusterType), + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + configureSequenceNum(configureSequenceNum) + #line 6808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("renameTenantTransaction", reinterpret_cast(this)); + + } + ~RenameTenantTransactionActorState() + { + fdb_probe_actor_destroy("renameTenantTransaction", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ASSERT(clusterType == ClusterType::STANDALONE || (tenantId.present() && configureSequenceNum.present())); + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ASSERT(clusterType != ClusterType::METACLUSTER_MANAGEMENT); + #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantModeCheck = checkTenantMode(tr, clusterType); + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + oldNameIdFuture = tenantId.present() ? Future>() : TenantMetadata::tenantNameIndex().get(tr, oldName); + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + newNameIdFuture = TenantMetadata::tenantNameIndex().get(tr, newName); + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_0 = tenantModeCheck; + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~RenameTenantTransactionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!tenantId.present()) + #line 6865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = store(tenantId, oldNameIdFuture); + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont2(loopDepth); + } + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!tenantId.present()) + #line 6890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = store(tenantId, oldNameIdFuture); + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont2(loopDepth); + } + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RenameTenantTransactionActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RenameTenantTransactionActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< RenameTenantTransactionActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< RenameTenantTransactionActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_2 = getTenantTransaction(tr, tenantId.get()); + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!tenantId.present()) + #line 6994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_not_found(), loopDepth); + #line 6998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!tenantId.present()) + #line 7008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_not_found(), loopDepth); + #line 7012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RenameTenantTransactionActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RenameTenantTransactionActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< RenameTenantTransactionActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< RenameTenantTransactionActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 1); + + } + int a_body1cont6(int loopDepth) + { + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_3 = newNameIdFuture; + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 7092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2when1(TenantMapEntry const& __entry,int loopDepth) + { + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + entry = __entry; + #line 7101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont2when1(TenantMapEntry && __entry,int loopDepth) + { + entry = std::move(__entry); + loopDepth = a_body1cont6(loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RenameTenantTransactionActor, 2, TenantMapEntry >::remove(); + + } + void a_callback_fire(ActorCallback< RenameTenantTransactionActor, 2, TenantMapEntry >*,TenantMapEntry const& value) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< RenameTenantTransactionActor, 2, TenantMapEntry >*,TenantMapEntry && value) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< RenameTenantTransactionActor, 2, TenantMapEntry >*,Error err) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 2); + + } + int a_body1cont7(Optional const& newNameId,int loopDepth) + { + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (entry.tenantName != oldName) + #line 7168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_not_found(), loopDepth); + #line 7172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (newNameId.present()) + #line 7176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_already_exists(), loopDepth); + #line 7180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (configureSequenceNum.present()) + #line 7184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (entry.configurationSequenceNum > configureSequenceNum.get()) + #line 7188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RenameTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 7192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RenameTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + entry.configurationSequenceNum = configureSequenceNum.get(); + #line 7200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + entry.tenantName = newName; + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantMap().set(tr, tenantId.get(), entry); + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantNameIndex().set(tr, newName, tenantId.get()); + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantNameIndex().erase(tr, oldName); + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::lastTenantModification().setVersionstamp(tr, Versionstamp(), 0); + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (clusterType == ClusterType::METACLUSTER_DATA) + #line 7214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_4 = markTenantTombstones(tr, tenantId.get()); + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont7when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont8(loopDepth); + } + + return loopDepth; + } + int a_body1cont7(Optional && newNameId,int loopDepth) + { + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (entry.tenantName != oldName) + #line 7239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_not_found(), loopDepth); + #line 7243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (newNameId.present()) + #line 7247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1Catch1(tenant_already_exists(), loopDepth); + #line 7251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (configureSequenceNum.present()) + #line 7255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (entry.configurationSequenceNum > configureSequenceNum.get()) + #line 7259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RenameTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 7263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RenameTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + entry.configurationSequenceNum = configureSequenceNum.get(); + #line 7271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + entry.tenantName = newName; + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantMap().set(tr, tenantId.get(), entry); + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantNameIndex().set(tr, newName, tenantId.get()); + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::tenantNameIndex().erase(tr, oldName); + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMetadata::lastTenantModification().setVersionstamp(tr, Versionstamp(), 0); + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (clusterType == ClusterType::METACLUSTER_DATA) + #line 7285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_4 = markTenantTombstones(tr, tenantId.get()); + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont7when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont8(loopDepth); + } + + return loopDepth; + } + int a_body1cont6when1(Optional const& newNameId,int loopDepth) + { + loopDepth = a_body1cont7(newNameId, loopDepth); + + return loopDepth; + } + int a_body1cont6when1(Optional && newNameId,int loopDepth) + { + loopDepth = a_body1cont7(std::move(newNameId), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RenameTenantTransactionActor, 3, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< RenameTenantTransactionActor, 3, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont6when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< RenameTenantTransactionActor, 3, Optional >*,Optional && value) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont6when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< RenameTenantTransactionActor, 3, Optional >*,Error err) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 3); + + } + int a_body1cont8(int loopDepth) + { + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RenameTenantTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 7373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RenameTenantTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont13(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8(loopDepth); + + return loopDepth; + } + int a_body1cont13(Void && _,int loopDepth) + { + loopDepth = a_body1cont8(loopDepth); + + return loopDepth; + } + int a_body1cont7when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont13(_, loopDepth); + + return loopDepth; + } + int a_body1cont7when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont13(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RenameTenantTransactionActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RenameTenantTransactionActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont7when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< RenameTenantTransactionActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont7when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< RenameTenantTransactionActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), 4); + + } + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Transaction tr; + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantName oldName; + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantName newName; + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Optional tenantId; + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ClusterType clusterType; + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Optional configureSequenceNum; + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Future tenantModeCheck; + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Future> oldNameIdFuture; + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Future> newNameIdFuture; + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMapEntry entry; + #line 7476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via renameTenantTransaction() + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class RenameTenantTransactionActor final : public Actor, public ActorCallback< RenameTenantTransactionActor, 0, Void >, public ActorCallback< RenameTenantTransactionActor, 1, Void >, public ActorCallback< RenameTenantTransactionActor, 2, TenantMapEntry >, public ActorCallback< RenameTenantTransactionActor, 3, Optional >, public ActorCallback< RenameTenantTransactionActor, 4, Void >, public FastAllocated>, public RenameTenantTransactionActorState> { + #line 7483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< RenameTenantTransactionActor, 0, Void >; +friend struct ActorCallback< RenameTenantTransactionActor, 1, Void >; +friend struct ActorCallback< RenameTenantTransactionActor, 2, TenantMapEntry >; +friend struct ActorCallback< RenameTenantTransactionActor, 3, Optional >; +friend struct ActorCallback< RenameTenantTransactionActor, 4, Void >; + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + RenameTenantTransactionActor(Transaction const& tr,TenantName const& oldName,TenantName const& newName,Optional const& tenantId = Optional(),ClusterType const& clusterType = ClusterType::STANDALONE,Optional const& configureSequenceNum = Optional()) + #line 7498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor(), + RenameTenantTransactionActorState>(tr, oldName, newName, tenantId, clusterType, configureSequenceNum) + { + fdb_probe_actor_enter("renameTenantTransaction", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("renameTenantTransaction"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("renameTenantTransaction", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< RenameTenantTransactionActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< RenameTenantTransactionActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< RenameTenantTransactionActor, 2, TenantMapEntry >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< RenameTenantTransactionActor, 3, Optional >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< RenameTenantTransactionActor, 4, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future renameTenantTransaction( Transaction const& tr, TenantName const& oldName, TenantName const& newName, Optional const& tenantId = Optional(), ClusterType const& clusterType = ClusterType::STANDALONE, Optional const& configureSequenceNum = Optional() ) { + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future(new RenameTenantTransactionActor(tr, oldName, newName, tenantId, clusterType, configureSequenceNum)); + #line 7531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + + #line 7536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via renameTenant() + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class RenameTenantActorState { + #line 7542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + RenameTenantActorState(Reference const& db,TenantName const& oldName,TenantName const& newName,Optional const& tenantId = Optional(),ClusterType const& clusterType = ClusterType::STANDALONE) + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : db(db), + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + oldName(oldName), + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + newName(newName), + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tenantId(tenantId), + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + clusterType(clusterType), + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr(db->createTransaction()) + #line 7559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("renameTenant", reinterpret_cast(this)); + + } + ~RenameTenantActorState() + { + fdb_probe_actor_destroy("renameTenant", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ASSERT(clusterType == ClusterType::STANDALONE || tenantId.present()); + #line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + firstTry = true; + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ; + #line 7578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~RenameTenantActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!tenantId.present()) + #line 7611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_0 = store(tenantId, TenantMetadata::tenantNameIndex().get(tr, oldName)); + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont2(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_5 = safeThreadFutureToFuture(tr->onError(e)); + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 7651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + newNameIdFuture = TenantMetadata::tenantNameIndex().get(tr, newName); + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = getTenantTransaction(tr, tenantId.get()); + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!tenantId.present()) + #line 7689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1loopBody1Catch1(tenant_not_found(), loopDepth); + #line 7693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!tenantId.present()) + #line 7703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1loopBody1Catch1(tenant_not_found(), loopDepth); + #line 7707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RenameTenantActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RenameTenantActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< RenameTenantActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< RenameTenantActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont6(int loopDepth) + { + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_2 = newNameIdFuture; + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont6when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 7787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(TenantMapEntry const& __entry,int loopDepth) + { + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + entry = __entry; + #line 7796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(TenantMapEntry && __entry,int loopDepth) + { + entry = std::move(__entry); + loopDepth = a_body1loopBody1cont6(loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RenameTenantActor, 1, TenantMapEntry >::remove(); + + } + void a_callback_fire(ActorCallback< RenameTenantActor, 1, TenantMapEntry >*,TenantMapEntry const& value) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< RenameTenantActor, 1, TenantMapEntry >*,TenantMapEntry && value) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< RenameTenantActor, 1, TenantMapEntry >*,Error err) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont7(Optional const& newNameId,int loopDepth) + { + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!firstTry && entry.tenantName == newName) + #line 7863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RenameTenantActorState(); static_cast(this)->destroy(); return 0; } + #line 7867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RenameTenantActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (entry.tenantName != oldName) + #line 7877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1loopBody1Catch1(tenant_not_found(), loopDepth); + #line 7881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + else + { + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (newNameId.present() && newNameId.get() != tenantId.get()) + #line 7887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1loopBody1Catch1(tenant_already_exists(), loopDepth); + #line 7891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + } + } + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + firstTry = false; + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_3 = renameTenantTransaction(tr, oldName, newName, tenantId, clusterType); + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont7when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont7(Optional && newNameId,int loopDepth) + { + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!firstTry && entry.tenantName == newName) + #line 7915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RenameTenantActorState(); static_cast(this)->destroy(); return 0; } + #line 7919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RenameTenantActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + else + { + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (entry.tenantName != oldName) + #line 7929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1loopBody1Catch1(tenant_not_found(), loopDepth); + #line 7933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + else + { + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (newNameId.present() && newNameId.get() != tenantId.get()) + #line 7939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return a_body1loopBody1Catch1(tenant_already_exists(), loopDepth); + #line 7943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + } + } + } + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + firstTry = false; + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_3 = renameTenantTransaction(tr, oldName, newName, tenantId, clusterType); + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont7when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont6when1(Optional const& newNameId,int loopDepth) + { + loopDepth = a_body1loopBody1cont7(newNameId, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont6when1(Optional && newNameId,int loopDepth) + { + loopDepth = a_body1loopBody1cont7(std::move(newNameId), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RenameTenantActor, 2, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< RenameTenantActor, 2, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont6when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< RenameTenantActor, 2, Optional >*,Optional && value) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont6when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< RenameTenantActor, 2, Optional >*,Error err) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 2); + + } + int a_body1loopBody1cont8(Void const& _,int loopDepth) + { + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_4 = buggifiedCommit(tr, BUGGIFY_WITH_PROB(0.1)); + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 8032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont8when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 8037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont8(Void && _,int loopDepth) + { + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_4 = buggifiedCommit(tr, BUGGIFY_WITH_PROB(0.1)); + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 8048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont8when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 8053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont7when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont7when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont8(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RenameTenantActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RenameTenantActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont7when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< RenameTenantActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1cont7when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< RenameTenantActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 3); + + } + int a_body1loopBody1cont14(Void const& _,int loopDepth) + { + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TraceEvent("TenantRenamed") .detail("OldName", oldName) .detail("NewName", newName) .detail("TenantId", tenantId.get()); + #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RenameTenantActorState(); static_cast(this)->destroy(); return 0; } + #line 8127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RenameTenantActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont14(Void && _,int loopDepth) + { + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TraceEvent("TenantRenamed") .detail("OldName", oldName) .detail("NewName", newName) .detail("TenantId", tenantId.get()); + #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RenameTenantActorState(); static_cast(this)->destroy(); return 0; } + #line 8141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RenameTenantActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont8when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont14(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont8when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont14(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RenameTenantActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RenameTenantActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont8when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< RenameTenantActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1cont8when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< RenameTenantActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 4); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RenameTenantActor, 5, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RenameTenantActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< RenameTenantActor, 5, Void >*,Void && value) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< RenameTenantActor, 5, Void >*,Error err) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), 5); + + } + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Reference db; + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantName oldName; + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantName newName; + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Optional tenantId; + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ClusterType clusterType; + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Reference tr; + #line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + bool firstTry; + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Future> newNameIdFuture; + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantMapEntry entry; + #line 8305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via renameTenant() + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class RenameTenantActor final : public Actor, public ActorCallback< RenameTenantActor, 0, Void >, public ActorCallback< RenameTenantActor, 1, TenantMapEntry >, public ActorCallback< RenameTenantActor, 2, Optional >, public ActorCallback< RenameTenantActor, 3, Void >, public ActorCallback< RenameTenantActor, 4, Void >, public ActorCallback< RenameTenantActor, 5, Void >, public FastAllocated>, public RenameTenantActorState> { + #line 8312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< RenameTenantActor, 0, Void >; +friend struct ActorCallback< RenameTenantActor, 1, TenantMapEntry >; +friend struct ActorCallback< RenameTenantActor, 2, Optional >; +friend struct ActorCallback< RenameTenantActor, 3, Void >; +friend struct ActorCallback< RenameTenantActor, 4, Void >; +friend struct ActorCallback< RenameTenantActor, 5, Void >; + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + RenameTenantActor(Reference const& db,TenantName const& oldName,TenantName const& newName,Optional const& tenantId = Optional(),ClusterType const& clusterType = ClusterType::STANDALONE) + #line 8328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor(), + RenameTenantActorState>(db, oldName, newName, tenantId, clusterType) + { + fdb_probe_actor_enter("renameTenant", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("renameTenant"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("renameTenant", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< RenameTenantActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< RenameTenantActor, 1, TenantMapEntry >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< RenameTenantActor, 2, Optional >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< RenameTenantActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< RenameTenantActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< RenameTenantActor, 5, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future renameTenant( Reference const& db, TenantName const& oldName, TenantName const& newName, Optional const& tenantId = Optional(), ClusterType const& clusterType = ClusterType::STANDALONE ) { + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future(new RenameTenantActor(db, oldName, newName, tenantId, clusterType)); + #line 8362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + +template +Future> tryGetTenantGroupTransaction(Transaction tr, TenantGroupName name) { + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + return TenantMetadata::tenantGroupMap().get(tr, name); +} + + #line 8373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via tryGetTenantGroup() + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class TryGetTenantGroupActorState { + #line 8379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TryGetTenantGroupActorState(Reference const& db,TenantGroupName const& name) + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : db(db), + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + name(name), + #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr(db->createTransaction()) + #line 8390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("tryGetTenantGroup", reinterpret_cast(this)); + + } + ~TryGetTenantGroupActorState() + { + fdb_probe_actor_destroy("tryGetTenantGroup", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ; + #line 8405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~TryGetTenantGroupActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture> __when_expr_0 = tryGetTenantGroupTransaction(tr, name); + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 8442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 8447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->onError(e)); + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 8471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 8476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(Optional const& entry,int loopDepth) + { + #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(entry); this->~TryGetTenantGroupActorState(); static_cast(this)->destroy(); return 0; } + #line 8491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(entry); + this->~TryGetTenantGroupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont2(Optional && entry,int loopDepth) + { + #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(entry); this->~TryGetTenantGroupActorState(); static_cast(this)->destroy(); return 0; } + #line 8503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(entry); + this->~TryGetTenantGroupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1when1(Optional const& entry,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(entry, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Optional && entry,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(entry), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TryGetTenantGroupActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< TryGetTenantGroupActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("tryGetTenantGroup", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenantGroup", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< TryGetTenantGroupActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("tryGetTenantGroup", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenantGroup", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< TryGetTenantGroupActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("tryGetTenantGroup", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenantGroup", reinterpret_cast(this), 0); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TryGetTenantGroupActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< TryGetTenantGroupActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("tryGetTenantGroup", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenantGroup", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< TryGetTenantGroupActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("tryGetTenantGroup", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenantGroup", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< TryGetTenantGroupActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("tryGetTenantGroup", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("tryGetTenantGroup", reinterpret_cast(this), 1); + + } + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Reference db; + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantGroupName name; + #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Reference tr; + #line 8655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via tryGetTenantGroup() + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class TryGetTenantGroupActor final : public Actor>, public ActorCallback< TryGetTenantGroupActor, 0, Optional >, public ActorCallback< TryGetTenantGroupActor, 1, Void >, public FastAllocated>, public TryGetTenantGroupActorState> { + #line 8662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< TryGetTenantGroupActor, 0, Optional >; +friend struct ActorCallback< TryGetTenantGroupActor, 1, Void >; + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TryGetTenantGroupActor(Reference const& db,TenantGroupName const& name) + #line 8674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor>(), + TryGetTenantGroupActorState>(db, name) + { + fdb_probe_actor_enter("tryGetTenantGroup", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("tryGetTenantGroup"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("tryGetTenantGroup", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< TryGetTenantGroupActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< TryGetTenantGroupActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future> tryGetTenantGroup( Reference const& db, TenantGroupName const& name ) { + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future>(new TryGetTenantGroupActor(db, name)); + #line 8704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + + #line 8709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via listTenantGroupsTransaction() + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class ListTenantGroupsTransactionActorState { + #line 8715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ListTenantGroupsTransactionActorState(Transaction const& tr,TenantGroupName const& begin,TenantGroupName const& end,int const& limit) + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : tr(tr), + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + begin(begin), + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + end(end), + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + limit(limit) + #line 8728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("listTenantGroupsTransaction", reinterpret_cast(this)); + + } + ~ListTenantGroupsTransactionActorState() + { + fdb_probe_actor_destroy("listTenantGroupsTransaction", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture>> __when_expr_0 = TenantMetadata::tenantGroupMap().getRange(tr, begin, end, limit); + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 8747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 8752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ListTenantGroupsTransactionActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(KeyBackedRangeResult> const& results,int loopDepth) + { + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(results.results); this->~ListTenantGroupsTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 8775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(results.results); + this->~ListTenantGroupsTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(KeyBackedRangeResult> && results,int loopDepth) + { + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(results.results); this->~ListTenantGroupsTransactionActorState(); static_cast(this)->destroy(); return 0; } + #line 8787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(results.results); + this->~ListTenantGroupsTransactionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(KeyBackedRangeResult> const& results,int loopDepth) + { + loopDepth = a_body1cont1(results, loopDepth); + + return loopDepth; + } + int a_body1when1(KeyBackedRangeResult> && results,int loopDepth) + { + loopDepth = a_body1cont1(std::move(results), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ListTenantGroupsTransactionActor, 0, KeyBackedRangeResult> >::remove(); + + } + void a_callback_fire(ActorCallback< ListTenantGroupsTransactionActor, 0, KeyBackedRangeResult> >*,KeyBackedRangeResult> const& value) + { + fdb_probe_actor_enter("listTenantGroupsTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantGroupsTransaction", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ListTenantGroupsTransactionActor, 0, KeyBackedRangeResult> >*,KeyBackedRangeResult> && value) + { + fdb_probe_actor_enter("listTenantGroupsTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantGroupsTransaction", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ListTenantGroupsTransactionActor, 0, KeyBackedRangeResult> >*,Error err) + { + fdb_probe_actor_enter("listTenantGroupsTransaction", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantGroupsTransaction", reinterpret_cast(this), 0); + + } + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Transaction tr; + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantGroupName begin; + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantGroupName end; + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + int limit; + #line 8866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via listTenantGroupsTransaction() + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class ListTenantGroupsTransactionActor final : public Actor>>, public ActorCallback< ListTenantGroupsTransactionActor, 0, KeyBackedRangeResult> >, public FastAllocated>, public ListTenantGroupsTransactionActorState> { + #line 8873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ListTenantGroupsTransactionActor, 0, KeyBackedRangeResult> >; + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ListTenantGroupsTransactionActor(Transaction const& tr,TenantGroupName const& begin,TenantGroupName const& end,int const& limit) + #line 8884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor>>(), + ListTenantGroupsTransactionActorState>(tr, begin, end, limit) + { + fdb_probe_actor_enter("listTenantGroupsTransaction", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("listTenantGroupsTransaction"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("listTenantGroupsTransaction", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ListTenantGroupsTransactionActor, 0, KeyBackedRangeResult> >*)0, actor_cancelled()); break; + } + + } +}; + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future>> listTenantGroupsTransaction( Transaction const& tr, TenantGroupName const& begin, TenantGroupName const& end, int const& limit ) { + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future>>(new ListTenantGroupsTransactionActor(tr, begin, end, limit)); + #line 8913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + + #line 8918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +// This generated class is to be used only via listTenantGroups() + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class ListTenantGroupsActorState { + #line 8924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ListTenantGroupsActorState(Reference const& db,TenantGroupName const& begin,TenantGroupName const& end,int const& limit) + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + : db(db), + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + begin(begin), + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + end(end), + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + limit(limit), + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr(db->createTransaction()) + #line 8939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + { + fdb_probe_actor_create("listTenantGroups", reinterpret_cast(this)); + + } + ~ListTenantGroupsActorState() + { + fdb_probe_actor_destroy("listTenantGroups", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ; + #line 8954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ListTenantGroupsActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture>> __when_expr_0 = listTenantGroupsTransaction(tr, begin, end, limit); + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 8991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 8996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + StrictFuture __when_expr_1 = safeThreadFutureToFuture(tr->onError(e)); + #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 9020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(std::vector> const& tenantGroups,int loopDepth) + { + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(tenantGroups); this->~ListTenantGroupsActorState(); static_cast(this)->destroy(); return 0; } + #line 9040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(tenantGroups); + this->~ListTenantGroupsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont2(std::vector> && tenantGroups,int loopDepth) + { + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + if (!static_cast(this)->SAV>>::futures) { (void)(tenantGroups); this->~ListTenantGroupsActorState(); static_cast(this)->destroy(); return 0; } + #line 9052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + new (&static_cast(this)->SAV< std::vector> >::value()) std::vector>(tenantGroups); + this->~ListTenantGroupsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1when1(std::vector> const& tenantGroups,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(tenantGroups, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(std::vector> && tenantGroups,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(std::move(tenantGroups), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ListTenantGroupsActor, 0, std::vector> >::remove(); + + } + void a_callback_fire(ActorCallback< ListTenantGroupsActor, 0, std::vector> >*,std::vector> const& value) + { + fdb_probe_actor_enter("listTenantGroups", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantGroups", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ListTenantGroupsActor, 0, std::vector> >*,std::vector> && value) + { + fdb_probe_actor_enter("listTenantGroups", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantGroups", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ListTenantGroupsActor, 0, std::vector> >*,Error err) + { + fdb_probe_actor_enter("listTenantGroups", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantGroups", reinterpret_cast(this), 0); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ListTenantGroupsActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ListTenantGroupsActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("listTenantGroups", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantGroups", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ListTenantGroupsActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("listTenantGroups", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantGroups", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< ListTenantGroupsActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("listTenantGroups", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listTenantGroups", reinterpret_cast(this), 1); + + } + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Reference db; + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantGroupName begin; + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + TenantGroupName end; + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + int limit; + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + Reference tr; + #line 9208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +}; +// This generated class is to be used only via listTenantGroups() + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +class ListTenantGroupsActor final : public Actor>>, public ActorCallback< ListTenantGroupsActor, 0, std::vector> >, public ActorCallback< ListTenantGroupsActor, 1, Void >, public FastAllocated>, public ListTenantGroupsActorState> { + #line 9215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ListTenantGroupsActor, 0, std::vector> >; +friend struct ActorCallback< ListTenantGroupsActor, 1, Void >; + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + ListTenantGroupsActor(Reference const& db,TenantGroupName const& begin,TenantGroupName const& end,int const& limit) + #line 9227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" + : Actor>>(), + ListTenantGroupsActorState>(db, begin, end, limit) + { + fdb_probe_actor_enter("listTenantGroups", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("listTenantGroups"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("listTenantGroups", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ListTenantGroupsActor, 0, std::vector> >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ListTenantGroupsActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +template + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" +[[nodiscard]] Future>> listTenantGroups( Reference const& db, TenantGroupName const& begin, TenantGroupName const& end, int const& limit ) { + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + return Future>>(new ListTenantGroupsActor(db, begin, end, limit)); + #line 9257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.g.h" +} + +#line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantManagement.actor.h" + +} // namespace TenantAPI + +#include "flow/unactorcompiler.h" +#endif \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/TenantManagement.actor.h b/src/fdbclient/include/fdbclient/TenantManagement.actor.h new file mode 100644 index 0000000..79b40c8 --- /dev/null +++ b/src/fdbclient/include/fdbclient/TenantManagement.actor.h @@ -0,0 +1,744 @@ +/* + * TenantManagement.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_TENANT_MANAGEMENT_ACTOR_G_H) +#define FDBCLIENT_TENANT_MANAGEMENT_ACTOR_G_H +#include "fdbclient/TenantManagement.actor.g.h" +#elif !defined(FDBCLIENT_TENANT_MANAGEMENT_ACTOR_H) +#define FDBCLIENT_TENANT_MANAGEMENT_ACTOR_H + +#include +#include +#include +#include "fdbclient/ClientBooleanParams.h" +#include "fdbclient/GenericTransactionHelper.h" +#include "fdbclient/Knobs.h" +#include "fdbclient/MetaclusterRegistration.h" +#include "fdbclient/SystemData.h" +#include "fdbclient/Tenant.h" +#include "flow/IRandom.h" +#include "flow/ThreadHelper.actor.h" +#include "flow/actorcompiler.h" // has to be last include + +namespace TenantAPI { + +static const int TENANT_ID_PREFIX_MIN_VALUE = 0; +static const int TENANT_ID_PREFIX_MAX_VALUE = 32767; + +template +Future> tryGetTenantTransaction(Transaction tr, int64_t tenantId) { + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + return TenantMetadata::tenantMap().get(tr, tenantId); +} + +ACTOR template +Future> tryGetTenantTransaction(Transaction tr, TenantName name) { + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + Optional tenantId = wait(TenantMetadata::tenantNameIndex().get(tr, name)); + if (tenantId.present()) { + Optional entry = wait(TenantMetadata::tenantMap().get(tr, tenantId.get())); + return entry; + } else { + return Optional(); + } +} + +ACTOR template +Future> tryGetTenant(Reference db, Tenant tenant) { + state Reference tr = db->createTransaction(); + + loop { + try { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + Optional entry = wait(tryGetTenantTransaction(tr, tenant)); + return entry; + } catch (Error& e) { + wait(safeThreadFutureToFuture(tr->onError(e))); + } + } +} + +ACTOR template +Future getTenantTransaction(Transaction tr, Tenant tenant) { + Optional entry = wait(tryGetTenantTransaction(tr, tenant)); + if (!entry.present()) { + throw tenant_not_found(); + } + + return entry.get(); +} + +ACTOR template +Future getTenant(Reference db, Tenant tenant) { + Optional entry = wait(tryGetTenant(db, tenant)); + if (!entry.present()) { + throw tenant_not_found(); + } + + return entry.get(); +} + +ACTOR template +Future getClusterType(Transaction tr) { + Optional metaclusterRegistration = + wait(metacluster::metadata::metaclusterRegistration().get(tr)); + + return metaclusterRegistration.present() ? metaclusterRegistration.get().clusterType : ClusterType::STANDALONE; +} + +ACTOR template +Future checkTenantMode(Transaction tr, ClusterType expectedClusterType) { + state typename transaction_future_type>::type tenantModeFuture = + tr->get(configKeysPrefix.withSuffix("tenant_mode"_sr)); + + state ClusterType actualClusterType = wait(getClusterType(tr)); + Optional tenantModeValue = wait(safeThreadFutureToFuture(tenantModeFuture)); + + TenantMode tenantMode = TenantMode::fromValue(tenantModeValue.castTo()); + if (actualClusterType != expectedClusterType) { + throw invalid_metacluster_operation(); + } else if (actualClusterType == ClusterType::STANDALONE && tenantMode == TenantMode::DISABLED) { + throw tenants_disabled(); + } + + return Void(); +} + +TenantMode tenantModeForClusterType(ClusterType clusterType, TenantMode tenantMode); +int64_t extractTenantIdFromMutation(MutationRef m); +int64_t extractTenantIdFromKeyRef(StringRef s); +bool tenantMapChanging(MutationRef const& mutation, KeyRangeRef const& tenantMapRange); +int64_t computeNextTenantId(int64_t tenantId, int64_t delta); +int64_t getMaxAllowableTenantId(int64_t curTenantId); +int64_t getTenantIdPrefix(int64_t tenantId); + +// Returns true if the specified ID has already been deleted and false if not. If the ID is old enough +// that we no longer keep tombstones for it, an error is thrown. +ACTOR template +Future checkTombstone(Transaction tr, int64_t id) { + state Future tombstoneFuture = TenantMetadata::tenantTombstones().exists(tr, id); + + // If we are trying to create a tenant older than the oldest tombstones we still maintain, then we fail it + // with an error. + Optional tombstoneCleanupData = wait(TenantMetadata::tombstoneCleanupData().get(tr)); + if (tombstoneCleanupData.present() && tombstoneCleanupData.get().tombstonesErasedThrough >= id) { + throw tenant_creation_permanently_failed(); + } + + state bool hasTombstone = wait(tombstoneFuture); + return hasTombstone; +} + +// Creates a tenant. If the tenant already exists, the boolean return parameter will be false +// and the existing entry will be returned. If the tenant cannot be created, then the optional will be empty. +ACTOR template +Future, bool>> +createTenantTransaction(Transaction tr, TenantMapEntry tenantEntry, ClusterType clusterType = ClusterType::STANDALONE) { + ASSERT(clusterType != ClusterType::METACLUSTER_MANAGEMENT); + ASSERT(tenantEntry.id >= 0); + + if (tenantEntry.tenantName.startsWith("\xff"_sr)) { + throw invalid_tenant_name(); + } + if (tenantEntry.tenantGroup.present() && tenantEntry.tenantGroup.get().startsWith("\xff"_sr)) { + throw invalid_tenant_group_name(); + } + + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + + state Future> existingEntryFuture = tryGetTenantTransaction(tr, tenantEntry.tenantName); + state Future tenantModeCheck = checkTenantMode(tr, clusterType); + state Future tombstoneFuture = + (clusterType == ClusterType::STANDALONE) ? false : checkTombstone(tr, tenantEntry.id); + state Future> existingTenantGroupEntryFuture; + if (tenantEntry.tenantGroup.present()) { + existingTenantGroupEntryFuture = TenantMetadata::tenantGroupMap().get(tr, tenantEntry.tenantGroup.get()); + } + + wait(tenantModeCheck); + Optional existingEntry = wait(existingEntryFuture); + if (existingEntry.present()) { + return std::make_pair(existingEntry.get(), false); + } + + state bool hasTombstone = wait(tombstoneFuture); + if (hasTombstone) { + return std::make_pair(Optional(), false); + } + + state typename transaction_future_type::type prefixRangeFuture = + tr->getRange(prefixRange(tenantEntry.prefix), 1); + + RangeResult contents = wait(safeThreadFutureToFuture(prefixRangeFuture)); + if (!contents.empty()) { + throw tenant_prefix_allocator_conflict(); + } + + TenantMetadata::tenantMap().set(tr, tenantEntry.id, tenantEntry); + TenantMetadata::tenantNameIndex().set(tr, tenantEntry.tenantName, tenantEntry.id); + TenantMetadata::lastTenantModification().setVersionstamp(tr, Versionstamp(), 0); + + if (tenantEntry.tenantGroup.present()) { + TenantMetadata::tenantGroupTenantIndex().insert( + tr, Tuple::makeTuple(tenantEntry.tenantGroup.get(), tenantEntry.id)); + + // Create the tenant group associated with this tenant if it doesn't already exist + Optional existingTenantGroup = wait(existingTenantGroupEntryFuture); + if (!existingTenantGroup.present()) { + TenantMetadata::tenantGroupMap().set(tr, tenantEntry.tenantGroup.get(), TenantGroupEntry()); + } + } + + // This is idempotent because we only add an entry to the tenant map if it isn't already there + TenantMetadata::tenantCount().atomicOp(tr, 1, MutationRef::AddValue); + + // Read the tenant count after incrementing the counter so that simultaneous attempts to create + // tenants in the same transaction are properly reflected. + int64_t tenantCount = wait(TenantMetadata::tenantCount().getD(tr, Snapshot::False, 0)); + if (tenantCount > CLIENT_KNOBS->MAX_TENANTS_PER_CLUSTER) { + throw cluster_no_capacity(); + } + + return std::make_pair(tenantEntry, true); +} + +ACTOR template +Future getNextTenantId(Transaction tr) { + state Optional lastId = wait(TenantMetadata::lastTenantId().get(tr)); + if (!lastId.present()) { + // If the last tenant id is not present fetch the tenantIdPrefix (if any) and initalize the lastId + int64_t tenantIdPrefix = wait(TenantMetadata::tenantIdPrefix().getD(tr, Snapshot::False, 0)); + // Shift by 6 bytes to make the prefix the first two bytes of the tenant id + lastId = tenantIdPrefix << 48; + } + + int64_t delta = 1; + if (BUGGIFY) { + delta += deterministicRandom()->randomSkewedUInt32(1, 1e9); + } + + return TenantAPI::computeNextTenantId(lastId.get(), delta); +} + +ACTOR template +Future> createTenant(Reference db, + TenantName name, + TenantMapEntry tenantEntry = TenantMapEntry(), + ClusterType clusterType = ClusterType::STANDALONE) { + state Reference tr = db->createTransaction(); + + state bool checkExistence = clusterType != ClusterType::METACLUSTER_DATA; + state bool generateTenantId = tenantEntry.id < 0; + + ASSERT(clusterType == ClusterType::STANDALONE || !generateTenantId); + + tenantEntry.tenantName = name; + + loop { + try { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + + state Future tenantIdFuture; + if (generateTenantId) { + tenantIdFuture = getNextTenantId(tr); + } + + if (checkExistence) { + Optional existingId = wait(TenantMetadata::tenantNameIndex().get(tr, name)); + if (existingId.present()) { + throw tenant_already_exists(); + } + + checkExistence = false; + } + + if (generateTenantId) { + int64_t tenantId = wait(tenantIdFuture); + tenantEntry.setId(tenantId); + TenantMetadata::lastTenantId().set(tr, tenantId); + } + + state std::pair, bool> newTenant = + wait(createTenantTransaction(tr, tenantEntry, clusterType)); + + if (newTenant.second) { + ASSERT(newTenant.first.present()); + wait(buggifiedCommit(tr, BUGGIFY_WITH_PROB(0.1))); + + TraceEvent("CreatedTenant") + .detail("Tenant", name) + .detail("TenantId", newTenant.first.get().id) + .detail("Prefix", newTenant.first.get().prefix) + .detail("TenantGroup", tenantEntry.tenantGroup) + .detail("Version", tr->getCommittedVersion()); + } + + return newTenant.first; + } catch (Error& e) { + wait(safeThreadFutureToFuture(tr->onError(e))); + } + } +} + +ACTOR template +Future markTenantTombstones(Transaction tr, int64_t tenantId) { + // In data clusters, we store a tombstone + state Future> latestTombstoneFuture = + TenantMetadata::tenantTombstones().getRange(tr, {}, {}, 1, Snapshot::False, Reverse::True); + state Optional cleanupData = wait(TenantMetadata::tombstoneCleanupData().get(tr)); + state Version transactionReadVersion = wait(safeThreadFutureToFuture(tr->getReadVersion())); + + // If it has been long enough since we last cleaned up the tenant tombstones, we do that first + if (!cleanupData.present() || cleanupData.get().nextTombstoneEraseVersion <= transactionReadVersion) { + state int64_t deleteThroughId = cleanupData.present() ? cleanupData.get().nextTombstoneEraseId : -1; + // Delete all tombstones up through the one currently marked in the cleanup data + if (deleteThroughId >= 0) { + TenantMetadata::tenantTombstones().erase(tr, 0, deleteThroughId + 1); + } + + KeyBackedRangeResult latestTombstone = wait(latestTombstoneFuture); + int64_t nextDeleteThroughId = std::max(deleteThroughId, tenantId); + if (!latestTombstone.results.empty()) { + nextDeleteThroughId = std::max(nextDeleteThroughId, latestTombstone.results[0]); + } + + // The next cleanup will happen at or after TENANT_TOMBSTONE_CLEANUP_INTERVAL seconds have elapsed and + // will clean up tombstones through the most recently allocated ID. + TenantTombstoneCleanupData updatedCleanupData; + updatedCleanupData.tombstonesErasedThrough = deleteThroughId; + updatedCleanupData.nextTombstoneEraseId = nextDeleteThroughId; + updatedCleanupData.nextTombstoneEraseVersion = + transactionReadVersion + + CLIENT_KNOBS->TENANT_TOMBSTONE_CLEANUP_INTERVAL * CLIENT_KNOBS->VERSIONS_PER_SECOND; + + TenantMetadata::tombstoneCleanupData().set(tr, updatedCleanupData); + + // If the tenant being deleted is within the tombstone window, record the tombstone + if (tenantId > updatedCleanupData.tombstonesErasedThrough) { + TenantMetadata::tenantTombstones().insert(tr, tenantId); + } + } else if (tenantId > cleanupData.get().tombstonesErasedThrough) { + // If the tenant being deleted is within the tombstone window, record the tombstone + TenantMetadata::tenantTombstones().insert(tr, tenantId); + } + return Void(); +} + +// Deletes a tenant with the given ID. If no matching tenant is found, this function returns without deleting anything. +// This behavior allows the function to be used idempotently: if the transaction is retried after having succeeded, it +// will see that the tenant is absent and do nothing. +ACTOR template +Future deleteTenantTransaction(Transaction tr, + int64_t tenantId, + ClusterType clusterType = ClusterType::STANDALONE) { + ASSERT(tenantId != TenantInfo::INVALID_TENANT); + ASSERT(clusterType != ClusterType::METACLUSTER_MANAGEMENT); + + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + + state Future> tenantEntryFuture = tryGetTenantTransaction(tr, tenantId); + wait(checkTenantMode(tr, clusterType)); + + state Optional tenantEntry = wait(tenantEntryFuture); + if (tenantEntry.present()) { + state typename transaction_future_type::type prefixRangeFuture = + tr->getRange(prefixRange(tenantEntry.get().prefix), 1); + + RangeResult contents = wait(safeThreadFutureToFuture(prefixRangeFuture)); + if (!contents.empty()) { + throw tenant_not_empty(); + } + + // This is idempotent because we only erase an entry from the tenant map if it is present + TenantMetadata::tenantMap().erase(tr, tenantId); + TenantMetadata::tenantNameIndex().erase(tr, tenantEntry.get().tenantName); + TenantMetadata::tenantCount().atomicOp(tr, -1, MutationRef::AddValue); + TenantMetadata::lastTenantModification().setVersionstamp(tr, Versionstamp(), 0); + + if (tenantEntry.get().tenantGroup.present()) { + TenantMetadata::tenantGroupTenantIndex().erase( + tr, Tuple::makeTuple(tenantEntry.get().tenantGroup.get(), tenantId)); + KeyBackedSet::RangeResultType tenantsInGroup = + wait(TenantMetadata::tenantGroupTenantIndex().getRange( + tr, + Tuple::makeTuple(tenantEntry.get().tenantGroup.get()), + Tuple::makeTuple(keyAfter(tenantEntry.get().tenantGroup.get())), + 2)); + if (tenantsInGroup.results.empty() || + (tenantsInGroup.results.size() == 1 && tenantsInGroup.results[0].getInt(1) == tenantId)) { + TenantMetadata::tenantGroupMap().erase(tr, tenantEntry.get().tenantGroup.get()); + } + } + } + + if (clusterType == ClusterType::METACLUSTER_DATA) { + wait(markTenantTombstones(tr, tenantId)); + } + + return Void(); +} + +// Deletes the tenant with the given name. If tenantId is specified, the tenant being deleted must also have the same +// ID. +ACTOR template +Future deleteTenant(Reference db, + TenantName name, + Optional tenantId = Optional(), + ClusterType clusterType = ClusterType::STANDALONE) { + state Reference tr = db->createTransaction(); + + state bool checkExistence = clusterType == ClusterType::STANDALONE; + loop { + try { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + + if (checkExistence) { + Optional actualId = wait(TenantMetadata::tenantNameIndex().get(tr, name)); + if (!actualId.present() || (tenantId.present() && tenantId != actualId)) { + throw tenant_not_found(); + } + + tenantId = actualId; + checkExistence = false; + } + + wait(deleteTenantTransaction(tr, tenantId.get(), clusterType)); + wait(buggifiedCommit(tr, BUGGIFY_WITH_PROB(0.1))); + + TraceEvent("DeletedTenant") + .detail("Tenant", name) + .detail("TenantId", tenantId) + .detail("Version", tr->getCommittedVersion()); + return Void(); + } catch (Error& e) { + wait(safeThreadFutureToFuture(tr->onError(e))); + } + } +} + +// This should only be called from a transaction that has already confirmed that the tenant entry +// is present. The tenantEntry should start with the existing entry and modify only those fields that need +// to be changed. This must only be called on a non-management cluster. +ACTOR template +Future configureTenantTransaction(Transaction tr, + TenantMapEntry originalEntry, + TenantMapEntry updatedTenantEntry) { + ASSERT(updatedTenantEntry.id == originalEntry.id); + + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + TenantMetadata::tenantMap().set(tr, updatedTenantEntry.id, updatedTenantEntry); + TenantMetadata::lastTenantModification().setVersionstamp(tr, Versionstamp(), 0); + + // If the tenant group was changed, we need to update the tenant group metadata structures + if (originalEntry.tenantGroup != updatedTenantEntry.tenantGroup) { + if (updatedTenantEntry.tenantGroup.present() && updatedTenantEntry.tenantGroup.get().startsWith("\xff"_sr)) { + throw invalid_tenant_group_name(); + } + if (originalEntry.tenantGroup.present()) { + // Remove this tenant from the original tenant group index + TenantMetadata::tenantGroupTenantIndex().erase( + tr, Tuple::makeTuple(originalEntry.tenantGroup.get(), updatedTenantEntry.id)); + + // Check if the original tenant group is now empty. If so, remove the tenant group. + KeyBackedSet::RangeResultType tenants = wait(TenantMetadata::tenantGroupTenantIndex().getRange( + tr, + Tuple::makeTuple(originalEntry.tenantGroup.get()), + Tuple::makeTuple(keyAfter(originalEntry.tenantGroup.get())), + 2)); + + if (tenants.results.empty() || + (tenants.results.size() == 1 && tenants.results[0].getInt(1) == updatedTenantEntry.id)) { + TenantMetadata::tenantGroupMap().erase(tr, originalEntry.tenantGroup.get()); + } + } + if (updatedTenantEntry.tenantGroup.present()) { + // If this is creating a new tenant group, add it to the tenant group map + Optional entry = + wait(TenantMetadata::tenantGroupMap().get(tr, updatedTenantEntry.tenantGroup.get())); + if (!entry.present()) { + TenantMetadata::tenantGroupMap().set(tr, updatedTenantEntry.tenantGroup.get(), TenantGroupEntry()); + } + + // Insert this tenant in the tenant group index + TenantMetadata::tenantGroupTenantIndex().insert( + tr, Tuple::makeTuple(updatedTenantEntry.tenantGroup.get(), updatedTenantEntry.id)); + } + } + + ASSERT_EQ(updatedTenantEntry.tenantLockId.present(), + updatedTenantEntry.tenantLockState != TenantLockState::UNLOCKED); + + return Void(); +} + +template +bool checkLockState(TenantMapEntryT entry, TenantLockState desiredLockState, UID lockId) { + if (entry.tenantLockId == lockId && entry.tenantLockState == desiredLockState) { + return true; + } + + if (entry.tenantLockId.present() && entry.tenantLockId.get() != lockId) { + throw tenant_locked(); + } + + return false; +} + +ACTOR template +Future changeLockState(Transaction tr, int64_t tenant, TenantLockState desiredLockState, UID lockId) { + state Future tenantModeCheck = TenantAPI::checkTenantMode(tr, ClusterType::STANDALONE); + state TenantMapEntry entry = wait(TenantAPI::getTenantTransaction(tr, tenant)); + + wait(tenantModeCheck); + + if (!checkLockState(entry, desiredLockState, lockId)) { + TenantMapEntry newState = entry; + newState.tenantLockState = desiredLockState; + newState.tenantLockId = (desiredLockState == TenantLockState::UNLOCKED) ? Optional() : lockId; + wait(configureTenantTransaction(tr, entry, newState)); + } + + return Void(); +} + +template +Future>> listTenantsTransaction(Transaction tr, + TenantName begin, + TenantName end, + int limit) { + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + auto future = TenantMetadata::tenantNameIndex().getRange(tr, begin, end, limit); + return fmap([](auto f) -> std::vector> { return f.results; }, future); +} + +template +Future>> listTenants(Reference db, + TenantName begin, + TenantName end, + int limit) { + return runTransaction(db, [=](Reference tr) { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + return listTenantsTransaction(tr, begin, end, limit); + }); +} + +ACTOR template +Future>> listTenantMetadataTransaction(Transaction tr, + TenantName begin, + TenantName end, + int limit) { + std::vector> matchingTenants = wait(listTenantsTransaction(tr, begin, end, limit)); + + state std::vector> tenantEntryFutures; + for (auto const& [name, id] : matchingTenants) { + tenantEntryFutures.push_back(getTenantTransaction(tr, id)); + } + + wait(waitForAll(tenantEntryFutures)); + + std::vector> results; + for (auto const& f : tenantEntryFutures) { + results.emplace_back(f.get().tenantName, f.get()); + } + + return results; +} + +template +Future>> listTenantMetadata(Reference db, + TenantName begin, + TenantName end, + int limit) { + return runTransaction(db, [=](Reference tr) { + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + return listTenantMetadataTransaction(tr, begin, end, limit); + }); +} + +ACTOR template +Future renameTenantTransaction(Transaction tr, + TenantName oldName, + TenantName newName, + Optional tenantId = Optional(), + ClusterType clusterType = ClusterType::STANDALONE, + Optional configureSequenceNum = Optional()) { + ASSERT(clusterType == ClusterType::STANDALONE || (tenantId.present() && configureSequenceNum.present())); + ASSERT(clusterType != ClusterType::METACLUSTER_MANAGEMENT); + + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + + state Future tenantModeCheck = checkTenantMode(tr, clusterType); + state Future> oldNameIdFuture = + tenantId.present() ? Future>() : TenantMetadata::tenantNameIndex().get(tr, oldName); + state Future> newNameIdFuture = TenantMetadata::tenantNameIndex().get(tr, newName); + + wait(tenantModeCheck); + + if (!tenantId.present()) { + wait(store(tenantId, oldNameIdFuture)); + if (!tenantId.present()) { + throw tenant_not_found(); + } + } + + state TenantMapEntry entry = wait(getTenantTransaction(tr, tenantId.get())); + Optional newNameId = wait(newNameIdFuture); + if (entry.tenantName != oldName) { + throw tenant_not_found(); + } + if (newNameId.present()) { + throw tenant_already_exists(); + } + + if (configureSequenceNum.present()) { + if (entry.configurationSequenceNum > configureSequenceNum.get()) { + return Void(); + } + entry.configurationSequenceNum = configureSequenceNum.get(); + } + + entry.tenantName = newName; + + TenantMetadata::tenantMap().set(tr, tenantId.get(), entry); + TenantMetadata::tenantNameIndex().set(tr, newName, tenantId.get()); + TenantMetadata::tenantNameIndex().erase(tr, oldName); + TenantMetadata::lastTenantModification().setVersionstamp(tr, Versionstamp(), 0); + + if (clusterType == ClusterType::METACLUSTER_DATA) { + wait(markTenantTombstones(tr, tenantId.get())); + } + + return Void(); +} + +ACTOR template +Future renameTenant(Reference db, + TenantName oldName, + TenantName newName, + Optional tenantId = Optional(), + ClusterType clusterType = ClusterType::STANDALONE) { + state Reference tr = db->createTransaction(); + ASSERT(clusterType == ClusterType::STANDALONE || tenantId.present()); + + state bool firstTry = true; + loop { + try { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + if (!tenantId.present()) { + wait(store(tenantId, TenantMetadata::tenantNameIndex().get(tr, oldName))); + if (!tenantId.present()) { + throw tenant_not_found(); + } + } + + state Future> newNameIdFuture = TenantMetadata::tenantNameIndex().get(tr, newName); + state TenantMapEntry entry = wait(getTenantTransaction(tr, tenantId.get())); + Optional newNameId = wait(newNameIdFuture); + + if (!firstTry && entry.tenantName == newName) { + // On a retry, the rename may have already occurred + return Void(); + } else if (entry.tenantName != oldName) { + throw tenant_not_found(); + } else if (newNameId.present() && newNameId.get() != tenantId.get()) { + throw tenant_already_exists(); + } + + firstTry = false; + + wait(renameTenantTransaction(tr, oldName, newName, tenantId, clusterType)); + wait(buggifiedCommit(tr, BUGGIFY_WITH_PROB(0.1))); + + TraceEvent("TenantRenamed") + .detail("OldName", oldName) + .detail("NewName", newName) + .detail("TenantId", tenantId.get()); + return Void(); + } catch (Error& e) { + wait(safeThreadFutureToFuture(tr->onError(e))); + } + } +} + +template +Future> tryGetTenantGroupTransaction(Transaction tr, TenantGroupName name) { + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + return TenantMetadata::tenantGroupMap().get(tr, name); +} + +ACTOR template +Future> tryGetTenantGroup(Reference db, TenantGroupName name) { + state Reference tr = db->createTransaction(); + + loop { + try { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + Optional entry = wait(tryGetTenantGroupTransaction(tr, name)); + return entry; + } catch (Error& e) { + wait(safeThreadFutureToFuture(tr->onError(e))); + } + } +} + +ACTOR template +Future>> listTenantGroupsTransaction(Transaction tr, + TenantGroupName begin, + TenantGroupName end, + int limit) { + tr->setOption(FDBTransactionOptions::RAW_ACCESS); + + KeyBackedRangeResult> results = + wait(TenantMetadata::tenantGroupMap().getRange(tr, begin, end, limit)); + + return results.results; +} + +ACTOR template +Future>> listTenantGroups(Reference db, + TenantGroupName begin, + TenantGroupName end, + int limit) { + state Reference tr = db->createTransaction(); + + loop { + try { + tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE); + std::vector> tenantGroups = + wait(listTenantGroupsTransaction(tr, begin, end, limit)); + return tenantGroups; + } catch (Error& e) { + wait(safeThreadFutureToFuture(tr->onError(e))); + } + } +} + +} // namespace TenantAPI + +#include "flow/unactorcompiler.h" +#endif \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h b/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h new file mode 100644 index 0000000..b3dd201 --- /dev/null +++ b/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h @@ -0,0 +1,3094 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +/* + * TenantSpecialKeys.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_TENANT_SPECIAL_KEYS_ACTOR_G_H) +#define FDBCLIENT_TENANT_SPECIAL_KEYS_ACTOR_G_H +#include "fdbclient/TenantSpecialKeys.actor.g.h" +#elif !defined(FDBCLIENT_TENANT_SPECIAL_KEYS_ACTOR_H) +#define FDBCLIENT_TENANT_SPECIAL_KEYS_ACTOR_H + +#include "fdbclient/ActorLineageProfiler.h" +#include "fdbclient/FDBOptions.g.h" +#include "fdbclient/Knobs.h" +#include "fdbclient/DatabaseContext.h" +#include "fdbclient/SpecialKeySpace.actor.h" +#include "fdbclient/TenantManagement.actor.h" +#include "fdbclient/Tuple.h" +#include "flow/Arena.h" +#include "flow/UnitTest.h" +#include "flow/actorcompiler.h" // This must be the last #include. + +class TenantRangeImpl : public SpecialKeyRangeRWImpl { +private: + static KeyRangeRef removePrefix(KeyRangeRef range, KeyRef prefix, KeyRef defaultEnd) { + KeyRef begin = range.begin.removePrefix(prefix); + KeyRef end; + if (range.end.startsWith(prefix)) { + end = range.end.removePrefix(prefix); + } else { + end = defaultEnd; + } + + return KeyRangeRef(begin, end); + } + + static KeyRef withTenantMapPrefix(KeyRef key, Arena& ar) { + int keySize = SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin.size() + + submoduleRange.begin.size() + mapSubRange.begin.size() + key.size(); + + KeyRef prefixedKey = makeString(keySize, ar); + uint8_t* mutableKey = mutateString(prefixedKey); + + mutableKey = SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin.copyTo(mutableKey); + mutableKey = submoduleRange.begin.copyTo(mutableKey); + mutableKey = mapSubRange.begin.copyTo(mutableKey); + + key.copyTo(mutableKey); + return prefixedKey; + } + + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +// This generated class is to be used only via getTenantList() + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +template + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class GetTenantListActorState { + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + GetTenantListActorState(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr,RangeResult* const& results,GetRangeLimits const& limitsHint) + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + : ryw(ryw), + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + kr(kr), + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + results(results), + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + limitsHint(limitsHint) + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + fdb_probe_actor_create("getTenantList", reinterpret_cast(this)); + + } + ~GetTenantListActorState() + { + fdb_probe_actor_destroy("getTenantList", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture>> __when_expr_0 = TenantAPI::listTenantMetadataTransaction(&ryw->getTransaction(), kr.begin, kr.end, limitsHint.rows); + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetTenantListActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(std::vector> const& tenants,int loopDepth) + { + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto tenant : tenants ) { + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::string jsonString = tenant.second.toJson(); + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ValueRef tenantEntryBytes(results->arena(), jsonString); + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + results->push_back(results->arena(), KeyValueRef(withTenantMapPrefix(tenant.first, results->arena()), tenantEntryBytes)); + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetTenantListActorState(); static_cast(this)->destroy(); return 0; } + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~GetTenantListActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(std::vector> && tenants,int loopDepth) + { + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto tenant : tenants ) { + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::string jsonString = tenant.second.toJson(); + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ValueRef tenantEntryBytes(results->arena(), jsonString); + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + results->push_back(results->arena(), KeyValueRef(withTenantMapPrefix(tenant.first, results->arena()), tenantEntryBytes)); + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~GetTenantListActorState(); static_cast(this)->destroy(); return 0; } + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~GetTenantListActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(std::vector> const& tenants,int loopDepth) + { + loopDepth = a_body1cont1(tenants, loopDepth); + + return loopDepth; + } + int a_body1when1(std::vector> && tenants,int loopDepth) + { + loopDepth = a_body1cont1(std::move(tenants), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetTenantListActor, 0, std::vector> >::remove(); + + } + void a_callback_fire(ActorCallback< GetTenantListActor, 0, std::vector> >*,std::vector> const& value) + { + fdb_probe_actor_enter("getTenantList", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenantList", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetTenantListActor, 0, std::vector> >*,std::vector> && value) + { + fdb_probe_actor_enter("getTenantList", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenantList", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetTenantListActor, 0, std::vector> >*,Error err) + { + fdb_probe_actor_enter("getTenantList", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenantList", reinterpret_cast(this), 0); + + } + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ReadYourWritesTransaction* ryw; + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + KeyRangeRef kr; + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + RangeResult* results; + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + GetRangeLimits limitsHint; + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +}; +// This generated class is to be used only via getTenantList() + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class GetTenantListActor final : public Actor, public ActorCallback< GetTenantListActor, 0, std::vector> >, public FastAllocated, public GetTenantListActorState { + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetTenantListActor, 0, std::vector> >; + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + GetTenantListActor(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr,RangeResult* const& results,GetRangeLimits const& limitsHint) + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + : Actor(), + GetTenantListActorState(ryw, kr, results, limitsHint) + { + fdb_probe_actor_enter("getTenantList", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getTenantList"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getTenantList", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetTenantListActor, 0, std::vector> >*)0, actor_cancelled()); break; + } + + } +}; + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +[[nodiscard]] static Future getTenantList( ReadYourWritesTransaction* const& ryw, KeyRangeRef const& kr, RangeResult* const& results, GetRangeLimits const& limitsHint ) { + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return Future(new GetTenantListActor(ryw, kr, results, limitsHint)); + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +} + +#line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +// This generated class is to be used only via getTenantRange() + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +template + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class GetTenantRangeActorState { + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + GetTenantRangeActorState(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr,GetRangeLimits const& limitsHint) + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + : ryw(ryw), + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + kr(kr), + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + limitsHint(limitsHint), + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + results() + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + fdb_probe_actor_create("getTenantRange", reinterpret_cast(this)); + + } + ~GetTenantRangeActorState() + { + fdb_probe_actor_destroy("getTenantRange", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + kr = kr.removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin) .removePrefix(TenantRangeImpl::submoduleRange.begin); + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (kr.intersects(TenantRangeImpl::mapSubRange)) + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + GetRangeLimits limits = limitsHint; + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + limits.decrement(results); + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture __when_expr_0 = getTenantList( ryw, removePrefix(kr & TenantRangeImpl::mapSubRange, TenantRangeImpl::mapSubRange.begin, "\xff"_sr), &results, limits); + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~GetTenantRangeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(results); this->~GetTenantRangeActorState(); static_cast(this)->destroy(); return 0; } + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< RangeResult >::value()) RangeResult(std::move(results)); // state_var_RVO + this->~GetTenantRangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< GetTenantRangeActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< GetTenantRangeActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("getTenantRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenantRange", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< GetTenantRangeActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("getTenantRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenantRange", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< GetTenantRangeActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("getTenantRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("getTenantRange", reinterpret_cast(this), 0); + + } + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ReadYourWritesTransaction* ryw; + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + KeyRangeRef kr; + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + GetRangeLimits limitsHint; + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + RangeResult results; + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +}; +// This generated class is to be used only via getTenantRange() + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class GetTenantRangeActor final : public Actor, public ActorCallback< GetTenantRangeActor, 0, Void >, public FastAllocated, public GetTenantRangeActorState { + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< GetTenantRangeActor, 0, Void >; + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + GetTenantRangeActor(ReadYourWritesTransaction* const& ryw,KeyRangeRef const& kr,GetRangeLimits const& limitsHint) + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + : Actor(), + GetTenantRangeActorState(ryw, kr, limitsHint) + { + fdb_probe_actor_enter("getTenantRange", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("getTenantRange"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("getTenantRange", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< GetTenantRangeActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +[[nodiscard]] static Future getTenantRange( ReadYourWritesTransaction* const& ryw, KeyRangeRef const& kr, GetRangeLimits const& limitsHint ) { + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return Future(new GetTenantRangeActor(ryw, kr, limitsHint)); + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +} + +#line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + + // Returns true if the tenant was created, false if it already existed + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +// This generated class is to be used only via createTenant() + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +template + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class CreateTenantActorState { + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + CreateTenantActorState(ReadYourWritesTransaction* const& ryw,TenantNameRef const& tenantName,std::vector, Optional>> const& configMutations,int64_t const& tenantId,std::map* const& tenantGroupNetTenantDelta) + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + : ryw(ryw), + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantName(tenantName), + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + configMutations(configMutations), + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantId(tenantId), + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantGroupNetTenantDelta(tenantGroupNetTenantDelta), + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantEntry(tenantId, tenantName) + #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + fdb_probe_actor_create("createTenant", reinterpret_cast(this)); + + } + ~CreateTenantActorState() + { + fdb_probe_actor_destroy("createTenant", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto const& [name, value] : configMutations ) { + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantEntry.configure(name, value); + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (tenantEntry.tenantGroup.present()) + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + (*tenantGroupNetTenantDelta)[tenantEntry.tenantGroup.get()]++; + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture, bool>> __when_expr_0 = TenantAPI::createTenantTransaction(&ryw->getTransaction(), tenantEntry); + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_0.addCallbackAndClear(static_cast, bool> >*>(static_cast(this))); + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CreateTenantActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(std::pair, bool> const& entry,int loopDepth) + { + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(entry.second); this->~CreateTenantActorState(); static_cast(this)->destroy(); return 0; } + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< bool >::value()) bool(entry.second); + this->~CreateTenantActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(std::pair, bool> && entry,int loopDepth) + { + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(entry.second); this->~CreateTenantActorState(); static_cast(this)->destroy(); return 0; } + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< bool >::value()) bool(entry.second); + this->~CreateTenantActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(std::pair, bool> const& entry,int loopDepth) + { + loopDepth = a_body1cont1(entry, loopDepth); + + return loopDepth; + } + int a_body1when1(std::pair, bool> && entry,int loopDepth) + { + loopDepth = a_body1cont1(std::move(entry), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantActor, 0, std::pair, bool> >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantActor, 0, std::pair, bool> >*,std::pair, bool> const& value) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CreateTenantActor, 0, std::pair, bool> >*,std::pair, bool> && value) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CreateTenantActor, 0, std::pair, bool> >*,Error err) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), 0); + + } + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ReadYourWritesTransaction* ryw; + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantNameRef tenantName; + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::vector, Optional>> configMutations; + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + int64_t tenantId; + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::map* tenantGroupNetTenantDelta; + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantMapEntry tenantEntry; + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +}; +// This generated class is to be used only via createTenant() + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class CreateTenantActor final : public Actor, public ActorCallback< CreateTenantActor, 0, std::pair, bool> >, public FastAllocated, public CreateTenantActorState { + #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CreateTenantActor, 0, std::pair, bool> >; + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + CreateTenantActor(ReadYourWritesTransaction* const& ryw,TenantNameRef const& tenantName,std::vector, Optional>> const& configMutations,int64_t const& tenantId,std::map* const& tenantGroupNetTenantDelta) + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + : Actor(), + CreateTenantActorState(ryw, tenantName, configMutations, tenantId, tenantGroupNetTenantDelta) + { + fdb_probe_actor_enter("createTenant", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("createTenant"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("createTenant", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CreateTenantActor, 0, std::pair, bool> >*)0, actor_cancelled()); break; + } + + } +}; + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +[[nodiscard]] static Future createTenant( ReadYourWritesTransaction* const& ryw, TenantNameRef const& tenantName, std::vector, Optional>> const& configMutations, int64_t const& tenantId, std::map* const& tenantGroupNetTenantDelta ) { + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return Future(new CreateTenantActor(ryw, tenantName, configMutations, tenantId, tenantGroupNetTenantDelta)); + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +} + +#line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + + #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +// This generated class is to be used only via createTenants() + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +template + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class CreateTenantsActorState { + #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + CreateTenantsActorState(ReadYourWritesTransaction* const& ryw,std::map, Optional>>> const& tenants,std::map* const& tenantGroupNetTenantDelta) + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + : ryw(ryw), + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenants(tenants), + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantGroupNetTenantDelta(tenantGroupNetTenantDelta), + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantCountFuture(TenantMetadata::tenantCount().getD(&ryw->getTransaction(), Snapshot::False, 0)) + #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + fdb_probe_actor_create("createTenants", reinterpret_cast(this)); + + } + ~CreateTenantsActorState() + { + fdb_probe_actor_destroy("createTenants", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture __when_expr_0 = TenantAPI::getNextTenantId(&ryw->getTransaction()); + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CreateTenantsActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int64_t const& _nextId,int loopDepth) + { + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + nextId = _nextId; + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ASSERT(nextId >= 0); + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + createFutures = std::vector>(); + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + int itrCount = 0; + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto const& [tenant, config] : tenants ) { + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + createFutures.push_back(createTenant(ryw, tenant, config, nextId, tenantGroupNetTenantDelta)); + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (++itrCount < tenants.size()) + #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + nextId = TenantAPI::computeNextTenantId(nextId, 1); + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + } + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantMetadata::lastTenantId().set(&ryw->getTransaction(), nextId); + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture __when_expr_1 = waitForAll(createFutures); + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int64_t && _nextId,int loopDepth) + { + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + nextId = _nextId; + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ASSERT(nextId >= 0); + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + createFutures = std::vector>(); + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + int itrCount = 0; + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto const& [tenant, config] : tenants ) { + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + createFutures.push_back(createTenant(ryw, tenant, config, nextId, tenantGroupNetTenantDelta)); + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (++itrCount < tenants.size()) + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + nextId = TenantAPI::computeNextTenantId(nextId, 1); + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + } + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantMetadata::lastTenantId().set(&ryw->getTransaction(), nextId); + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture __when_expr_1 = waitForAll(createFutures); + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(int64_t const& _nextId,int loopDepth) + { + loopDepth = a_body1cont1(_nextId, loopDepth); + + return loopDepth; + } + int a_body1when1(int64_t && _nextId,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_nextId), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantsActor, 0, int64_t >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantsActor, 0, int64_t >*,int64_t const& value) + { + fdb_probe_actor_enter("createTenants", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenants", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CreateTenantsActor, 0, int64_t >*,int64_t && value) + { + fdb_probe_actor_enter("createTenants", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenants", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CreateTenantsActor, 0, int64_t >*,Error err) + { + fdb_probe_actor_enter("createTenants", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenants", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + numCreatedTenants = 0; + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto f : createFutures ) { + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (f.get()) + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ++numCreatedTenants; + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + } + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture __when_expr_2 = tenantCountFuture; + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + numCreatedTenants = 0; + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto f : createFutures ) { + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (f.get()) + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ++numCreatedTenants; + #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + } + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture __when_expr_2 = tenantCountFuture; + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantsActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantsActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("createTenants", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenants", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< CreateTenantsActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("createTenants", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenants", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< CreateTenantsActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("createTenants", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenants", reinterpret_cast(this), 1); + + } + int a_body1cont5(int64_t const& tenantCount,int loopDepth) + { + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (tenantCount + numCreatedTenants > CLIENT_KNOBS->MAX_TENANTS_PER_CLUSTER) + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return a_body1Catch1(cluster_no_capacity(), loopDepth); + #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CreateTenantsActorState(); static_cast(this)->destroy(); return 0; } + #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CreateTenantsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont5(int64_t && tenantCount,int loopDepth) + { + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (tenantCount + numCreatedTenants > CLIENT_KNOBS->MAX_TENANTS_PER_CLUSTER) + #line 1083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return a_body1Catch1(cluster_no_capacity(), loopDepth); + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CreateTenantsActorState(); static_cast(this)->destroy(); return 0; } + #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CreateTenantsActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2when1(int64_t const& tenantCount,int loopDepth) + { + loopDepth = a_body1cont5(tenantCount, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(int64_t && tenantCount,int loopDepth) + { + loopDepth = a_body1cont5(std::move(tenantCount), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CreateTenantsActor, 2, int64_t >::remove(); + + } + void a_callback_fire(ActorCallback< CreateTenantsActor, 2, int64_t >*,int64_t const& value) + { + fdb_probe_actor_enter("createTenants", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenants", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< CreateTenantsActor, 2, int64_t >*,int64_t && value) + { + fdb_probe_actor_enter("createTenants", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenants", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< CreateTenantsActor, 2, int64_t >*,Error err) + { + fdb_probe_actor_enter("createTenants", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("createTenants", reinterpret_cast(this), 2); + + } + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ReadYourWritesTransaction* ryw; + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::map, Optional>>> tenants; + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::map* tenantGroupNetTenantDelta; + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + Future tenantCountFuture; + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + int64_t nextId; + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::vector> createFutures; + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + int numCreatedTenants; + #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +}; +// This generated class is to be used only via createTenants() + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class CreateTenantsActor final : public Actor, public ActorCallback< CreateTenantsActor, 0, int64_t >, public ActorCallback< CreateTenantsActor, 1, Void >, public ActorCallback< CreateTenantsActor, 2, int64_t >, public FastAllocated, public CreateTenantsActorState { + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CreateTenantsActor, 0, int64_t >; +friend struct ActorCallback< CreateTenantsActor, 1, Void >; +friend struct ActorCallback< CreateTenantsActor, 2, int64_t >; + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + CreateTenantsActor(ReadYourWritesTransaction* const& ryw,std::map, Optional>>> const& tenants,std::map* const& tenantGroupNetTenantDelta) + #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + : Actor(), + CreateTenantsActorState(ryw, tenants, tenantGroupNetTenantDelta) + { + fdb_probe_actor_enter("createTenants", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("createTenants"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("createTenants", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CreateTenantsActor, 0, int64_t >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CreateTenantsActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< CreateTenantsActor, 2, int64_t >*)0, actor_cancelled()); break; + } + + } +}; + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +[[nodiscard]] static Future createTenants( ReadYourWritesTransaction* const& ryw, std::map, Optional>>> const& tenants, std::map* const& tenantGroupNetTenantDelta ) { + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return Future(new CreateTenantsActor(ryw, tenants, tenantGroupNetTenantDelta)); + #line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +} + +#line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + + #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +// This generated class is to be used only via changeTenantConfig() + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +template + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class ChangeTenantConfigActorState { + #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ChangeTenantConfigActorState(ReadYourWritesTransaction* const& ryw,TenantName const& tenantName,std::vector, Optional>> const& configEntries,std::map* const& tenantGroupNetTenantDelta) + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + : ryw(ryw), + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantName(tenantName), + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + configEntries(configEntries), + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantGroupNetTenantDelta(tenantGroupNetTenantDelta) + #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + fdb_probe_actor_create("changeTenantConfig", reinterpret_cast(this)); + + } + ~ChangeTenantConfigActorState() + { + fdb_probe_actor_destroy("changeTenantConfig", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture __when_expr_0 = TenantAPI::getTenantTransaction(&ryw->getTransaction(), tenantName); + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ChangeTenantConfigActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(TenantMapEntry const& originalEntry,int loopDepth) + { + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantMapEntry updatedEntry = originalEntry; + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto const& [name, value] : configEntries ) { + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + updatedEntry.configure(name, value); + #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (originalEntry.tenantGroup != updatedEntry.tenantGroup) + #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (originalEntry.tenantGroup.present()) + #line 1304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + (*tenantGroupNetTenantDelta)[originalEntry.tenantGroup.get()]--; + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (updatedEntry.tenantGroup.present()) + #line 1312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + (*tenantGroupNetTenantDelta)[updatedEntry.tenantGroup.get()]++; + #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + } + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture __when_expr_1 = TenantAPI::configureTenantTransaction(&ryw->getTransaction(), originalEntry, updatedEntry); + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(TenantMapEntry && originalEntry,int loopDepth) + { + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantMapEntry updatedEntry = originalEntry; + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto const& [name, value] : configEntries ) { + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + updatedEntry.configure(name, value); + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (originalEntry.tenantGroup != updatedEntry.tenantGroup) + #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (originalEntry.tenantGroup.present()) + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + (*tenantGroupNetTenantDelta)[originalEntry.tenantGroup.get()]--; + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (updatedEntry.tenantGroup.present()) + #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + (*tenantGroupNetTenantDelta)[updatedEntry.tenantGroup.get()]++; + #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + } + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture __when_expr_1 = TenantAPI::configureTenantTransaction(&ryw->getTransaction(), originalEntry, updatedEntry); + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(TenantMapEntry const& originalEntry,int loopDepth) + { + loopDepth = a_body1cont1(originalEntry, loopDepth); + + return loopDepth; + } + int a_body1when1(TenantMapEntry && originalEntry,int loopDepth) + { + loopDepth = a_body1cont1(std::move(originalEntry), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeTenantConfigActor, 0, TenantMapEntry >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeTenantConfigActor, 0, TenantMapEntry >*,TenantMapEntry const& value) + { + fdb_probe_actor_enter("changeTenantConfig", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeTenantConfig", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ChangeTenantConfigActor, 0, TenantMapEntry >*,TenantMapEntry && value) + { + fdb_probe_actor_enter("changeTenantConfig", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeTenantConfig", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ChangeTenantConfigActor, 0, TenantMapEntry >*,Error err) + { + fdb_probe_actor_enter("changeTenantConfig", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeTenantConfig", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeTenantConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeTenantConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChangeTenantConfigActorState(); static_cast(this)->destroy(); return 0; } + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ChangeTenantConfigActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ChangeTenantConfigActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ChangeTenantConfigActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("changeTenantConfig", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeTenantConfig", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ChangeTenantConfigActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("changeTenantConfig", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeTenantConfig", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< ChangeTenantConfigActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("changeTenantConfig", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("changeTenantConfig", reinterpret_cast(this), 1); + + } + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ReadYourWritesTransaction* ryw; + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantName tenantName; + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::vector, Optional>> configEntries; + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::map* tenantGroupNetTenantDelta; + #line 1536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +}; +// This generated class is to be used only via changeTenantConfig() + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class ChangeTenantConfigActor final : public Actor, public ActorCallback< ChangeTenantConfigActor, 0, TenantMapEntry >, public ActorCallback< ChangeTenantConfigActor, 1, Void >, public FastAllocated, public ChangeTenantConfigActorState { + #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ChangeTenantConfigActor, 0, TenantMapEntry >; +friend struct ActorCallback< ChangeTenantConfigActor, 1, Void >; + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ChangeTenantConfigActor(ReadYourWritesTransaction* const& ryw,TenantName const& tenantName,std::vector, Optional>> const& configEntries,std::map* const& tenantGroupNetTenantDelta) + #line 1553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + : Actor(), + ChangeTenantConfigActorState(ryw, tenantName, configEntries, tenantGroupNetTenantDelta) + { + fdb_probe_actor_enter("changeTenantConfig", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("changeTenantConfig"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("changeTenantConfig", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ChangeTenantConfigActor, 0, TenantMapEntry >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ChangeTenantConfigActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +[[nodiscard]] static Future changeTenantConfig( ReadYourWritesTransaction* const& ryw, TenantName const& tenantName, std::vector, Optional>> const& configEntries, std::map* const& tenantGroupNetTenantDelta ) { + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return Future(new ChangeTenantConfigActor(ryw, tenantName, configEntries, tenantGroupNetTenantDelta)); + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +} + +#line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + + #line 1586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +// This generated class is to be used only via deleteSingleTenant() + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +template + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class DeleteSingleTenantActorState { + #line 1592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + DeleteSingleTenantActorState(ReadYourWritesTransaction* const& ryw,TenantName const& tenantName,std::map* const& tenantGroupNetTenantDelta) + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + : ryw(ryw), + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantName(tenantName), + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantGroupNetTenantDelta(tenantGroupNetTenantDelta) + #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + fdb_probe_actor_create("deleteSingleTenant", reinterpret_cast(this)); + + } + ~DeleteSingleTenantActorState() + { + fdb_probe_actor_destroy("deleteSingleTenant", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture> __when_expr_0 = TenantAPI::tryGetTenantTransaction(&ryw->getTransaction(), tenantName); + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 1625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~DeleteSingleTenantActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (tenantEntry.present()) + #line 1648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture __when_expr_1 = TenantAPI::deleteTenantTransaction(&ryw->getTransaction(), tenantEntry.get().id); + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont2(loopDepth); + } + + return loopDepth; + } + int a_body1when1(Optional const& __tenantEntry,int loopDepth) + { + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantEntry = __tenantEntry; + #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Optional && __tenantEntry,int loopDepth) + { + tenantEntry = std::move(__tenantEntry); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DeleteSingleTenantActor, 0, Optional >::remove(); + + } + void a_callback_fire(ActorCallback< DeleteSingleTenantActor, 0, Optional >*,Optional const& value) + { + fdb_probe_actor_enter("deleteSingleTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteSingleTenant", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< DeleteSingleTenantActor, 0, Optional >*,Optional && value) + { + fdb_probe_actor_enter("deleteSingleTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteSingleTenant", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< DeleteSingleTenantActor, 0, Optional >*,Error err) + { + fdb_probe_actor_enter("deleteSingleTenant", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteSingleTenant", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteSingleTenantActorState(); static_cast(this)->destroy(); return 0; } + #line 1740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DeleteSingleTenantActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (tenantEntry.get().tenantGroup.present()) + #line 1752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + (*tenantGroupNetTenantDelta)[tenantEntry.get().tenantGroup.get()]--; + #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (tenantEntry.get().tenantGroup.present()) + #line 1766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + (*tenantGroupNetTenantDelta)[tenantEntry.get().tenantGroup.get()]--; + #line 1770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + loopDepth = a_body1cont2(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DeleteSingleTenantActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DeleteSingleTenantActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("deleteSingleTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteSingleTenant", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< DeleteSingleTenantActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("deleteSingleTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteSingleTenant", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< DeleteSingleTenantActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("deleteSingleTenant", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteSingleTenant", reinterpret_cast(this), 1); + + } + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ReadYourWritesTransaction* ryw; + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantName tenantName; + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::map* tenantGroupNetTenantDelta; + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + Optional tenantEntry; + #line 1847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +}; +// This generated class is to be used only via deleteSingleTenant() + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class DeleteSingleTenantActor final : public Actor, public ActorCallback< DeleteSingleTenantActor, 0, Optional >, public ActorCallback< DeleteSingleTenantActor, 1, Void >, public FastAllocated, public DeleteSingleTenantActorState { + #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DeleteSingleTenantActor, 0, Optional >; +friend struct ActorCallback< DeleteSingleTenantActor, 1, Void >; + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + DeleteSingleTenantActor(ReadYourWritesTransaction* const& ryw,TenantName const& tenantName,std::map* const& tenantGroupNetTenantDelta) + #line 1864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + : Actor(), + DeleteSingleTenantActorState(ryw, tenantName, tenantGroupNetTenantDelta) + { + fdb_probe_actor_enter("deleteSingleTenant", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("deleteSingleTenant"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("deleteSingleTenant", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DeleteSingleTenantActor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DeleteSingleTenantActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +[[nodiscard]] static Future deleteSingleTenant( ReadYourWritesTransaction* const& ryw, TenantName const& tenantName, std::map* const& tenantGroupNetTenantDelta ) { + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return Future(new DeleteSingleTenantActor(ryw, tenantName, tenantGroupNetTenantDelta)); + #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +} + +#line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + + #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +// This generated class is to be used only via deleteTenantRange() + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +template + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class DeleteTenantRangeActorState { + #line 1903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + DeleteTenantRangeActorState(ReadYourWritesTransaction* const& ryw,TenantName const& beginTenant,TenantName const& endTenant,std::map* const& tenantGroupNetTenantDelta) + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + : ryw(ryw), + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + beginTenant(beginTenant), + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + endTenant(endTenant), + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantGroupNetTenantDelta(tenantGroupNetTenantDelta) + #line 1916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + fdb_probe_actor_create("deleteTenantRange", reinterpret_cast(this)); + + } + ~DeleteTenantRangeActorState() + { + fdb_probe_actor_destroy("deleteTenantRange", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture>> __when_expr_0 = TenantAPI::listTenantsTransaction(&ryw->getTransaction(), beginTenant, endTenant, CLIENT_KNOBS->TOO_MANY); + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_0.addCallbackAndClear(static_cast> >*>(static_cast(this))); + #line 1938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~DeleteTenantRangeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (tenants.size() == CLIENT_KNOBS->TOO_MANY) + #line 1961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TraceEvent(SevWarn, "DeleteTenantRangeTooLange") .detail("BeginTenant", beginTenant) .detail("EndTenant", endTenant); + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ryw->setSpecialKeySpaceErrorMsg( ManagementAPIError::toJsonString(false, "delete tenants", "too many tenants to range delete")); + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return a_body1Catch1(special_keys_api_failure(), loopDepth); + #line 1969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::vector> deleteFutures; + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto tenant : tenants ) { + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + deleteFutures.push_back(deleteSingleTenant(ryw, tenant.first, tenantGroupNetTenantDelta)); + #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture __when_expr_1 = waitForAll(deleteFutures); + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(std::vector> const& __tenants,int loopDepth) + { + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenants = __tenants; + #line 1997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(std::vector> && __tenants,int loopDepth) + { + tenants = std::move(__tenants); + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DeleteTenantRangeActor, 0, std::vector> >::remove(); + + } + void a_callback_fire(ActorCallback< DeleteTenantRangeActor, 0, std::vector> >*,std::vector> const& value) + { + fdb_probe_actor_enter("deleteTenantRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantRange", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< DeleteTenantRangeActor, 0, std::vector> >*,std::vector> && value) + { + fdb_probe_actor_enter("deleteTenantRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantRange", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< DeleteTenantRangeActor, 0, std::vector> >*,Error err) + { + fdb_probe_actor_enter("deleteTenantRange", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantRange", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteTenantRangeActorState(); static_cast(this)->destroy(); return 0; } + #line 2064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DeleteTenantRangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteTenantRangeActorState(); static_cast(this)->destroy(); return 0; } + #line 2076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~DeleteTenantRangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DeleteTenantRangeActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DeleteTenantRangeActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("deleteTenantRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantRange", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< DeleteTenantRangeActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("deleteTenantRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantRange", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< DeleteTenantRangeActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("deleteTenantRange", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("deleteTenantRange", reinterpret_cast(this), 1); + + } + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ReadYourWritesTransaction* ryw; + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantName beginTenant; + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantName endTenant; + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::map* tenantGroupNetTenantDelta; + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::vector> tenants; + #line 2157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +}; +// This generated class is to be used only via deleteTenantRange() + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class DeleteTenantRangeActor final : public Actor, public ActorCallback< DeleteTenantRangeActor, 0, std::vector> >, public ActorCallback< DeleteTenantRangeActor, 1, Void >, public FastAllocated, public DeleteTenantRangeActorState { + #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DeleteTenantRangeActor, 0, std::vector> >; +friend struct ActorCallback< DeleteTenantRangeActor, 1, Void >; + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + DeleteTenantRangeActor(ReadYourWritesTransaction* const& ryw,TenantName const& beginTenant,TenantName const& endTenant,std::map* const& tenantGroupNetTenantDelta) + #line 2174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + : Actor(), + DeleteTenantRangeActorState(ryw, beginTenant, endTenant, tenantGroupNetTenantDelta) + { + fdb_probe_actor_enter("deleteTenantRange", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("deleteTenantRange"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("deleteTenantRange", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DeleteTenantRangeActor, 0, std::vector> >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DeleteTenantRangeActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +[[nodiscard]] static Future deleteTenantRange( ReadYourWritesTransaction* const& ryw, TenantName const& beginTenant, TenantName const& endTenant, std::map* const& tenantGroupNetTenantDelta ) { + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return Future(new DeleteTenantRangeActor(ryw, beginTenant, endTenant, tenantGroupNetTenantDelta)); + #line 2202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +} + +#line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + + // Check if the number of tenants in the tenant group is equal to the net reduction in the number of tenants. + // If it is, then we can delete the tenant group. + #line 2209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +// This generated class is to be used only via checkAndRemoveTenantGroup() + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +template + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class CheckAndRemoveTenantGroupActorState { + #line 2215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + CheckAndRemoveTenantGroupActorState(ReadYourWritesTransaction* const& ryw,TenantGroupName const& tenantGroup,int const& tenantDelta) + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + : ryw(ryw), + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantGroup(tenantGroup), + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantDelta(tenantDelta) + #line 2226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + fdb_probe_actor_create("checkAndRemoveTenantGroup", reinterpret_cast(this)); + + } + ~CheckAndRemoveTenantGroupActorState() + { + fdb_probe_actor_destroy("checkAndRemoveTenantGroup", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ASSERT(tenantDelta < 0); + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + removedTenants = -tenantDelta; + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture::RangeResultType> __when_expr_0 = TenantMetadata::tenantGroupTenantIndex().getRange(&ryw->getTransaction(), Tuple::makeTuple(tenantGroup), Tuple::makeTuple(keyAfter(tenantGroup)), removedTenants + 1); + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_0.addCallbackAndClear(static_cast::RangeResultType >*>(static_cast(this))); + #line 2252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CheckAndRemoveTenantGroupActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(KeyBackedSet::RangeResultType const& tenantsInGroup,int loopDepth) + { + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ASSERT(tenantsInGroup.results.size() >= removedTenants); + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (tenantsInGroup.results.size() == removedTenants) + #line 2277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantMetadata::tenantGroupMap().erase(&ryw->getTransaction(), tenantGroup); + #line 2281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckAndRemoveTenantGroupActorState(); static_cast(this)->destroy(); return 0; } + #line 2285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CheckAndRemoveTenantGroupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(KeyBackedSet::RangeResultType && tenantsInGroup,int loopDepth) + { + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ASSERT(tenantsInGroup.results.size() >= removedTenants); + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (tenantsInGroup.results.size() == removedTenants) + #line 2299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantMetadata::tenantGroupMap().erase(&ryw->getTransaction(), tenantGroup); + #line 2303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckAndRemoveTenantGroupActorState(); static_cast(this)->destroy(); return 0; } + #line 2307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CheckAndRemoveTenantGroupActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(KeyBackedSet::RangeResultType const& tenantsInGroup,int loopDepth) + { + loopDepth = a_body1cont1(tenantsInGroup, loopDepth); + + return loopDepth; + } + int a_body1when1(KeyBackedSet::RangeResultType && tenantsInGroup,int loopDepth) + { + loopDepth = a_body1cont1(std::move(tenantsInGroup), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckAndRemoveTenantGroupActor, 0, KeyBackedSet::RangeResultType >::remove(); + + } + void a_callback_fire(ActorCallback< CheckAndRemoveTenantGroupActor, 0, KeyBackedSet::RangeResultType >*,KeyBackedSet::RangeResultType const& value) + { + fdb_probe_actor_enter("checkAndRemoveTenantGroup", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAndRemoveTenantGroup", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CheckAndRemoveTenantGroupActor, 0, KeyBackedSet::RangeResultType >*,KeyBackedSet::RangeResultType && value) + { + fdb_probe_actor_enter("checkAndRemoveTenantGroup", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAndRemoveTenantGroup", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CheckAndRemoveTenantGroupActor, 0, KeyBackedSet::RangeResultType >*,Error err) + { + fdb_probe_actor_enter("checkAndRemoveTenantGroup", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkAndRemoveTenantGroup", reinterpret_cast(this), 0); + + } + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ReadYourWritesTransaction* ryw; + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantGroupName tenantGroup; + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + int tenantDelta; + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + int removedTenants; + #line 2386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +}; +// This generated class is to be used only via checkAndRemoveTenantGroup() + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class CheckAndRemoveTenantGroupActor final : public Actor, public ActorCallback< CheckAndRemoveTenantGroupActor, 0, KeyBackedSet::RangeResultType >, public FastAllocated, public CheckAndRemoveTenantGroupActorState { + #line 2391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CheckAndRemoveTenantGroupActor, 0, KeyBackedSet::RangeResultType >; + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + CheckAndRemoveTenantGroupActor(ReadYourWritesTransaction* const& ryw,TenantGroupName const& tenantGroup,int const& tenantDelta) + #line 2402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + : Actor(), + CheckAndRemoveTenantGroupActorState(ryw, tenantGroup, tenantDelta) + { + fdb_probe_actor_enter("checkAndRemoveTenantGroup", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("checkAndRemoveTenantGroup"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("checkAndRemoveTenantGroup", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CheckAndRemoveTenantGroupActor, 0, KeyBackedSet::RangeResultType >*)0, actor_cancelled()); break; + } + + } +}; + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +[[nodiscard]] static Future checkAndRemoveTenantGroup( ReadYourWritesTransaction* const& ryw, TenantGroupName const& tenantGroup, int const& tenantDelta ) { + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return Future(new CheckAndRemoveTenantGroupActor(ryw, tenantGroup, tenantDelta)); + #line 2429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +} + +#line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + +public: + const inline static KeyRangeRef submoduleRange = KeyRangeRef("tenant/"_sr, "tenant0"_sr); + const inline static KeyRangeRef mapSubRange = KeyRangeRef("map/"_sr, "map0"_sr); + const inline static KeyRangeRef configureSubRange = KeyRangeRef("configure/"_sr, "configure0"_sr); + const inline static KeyRangeRef renameSubRange = KeyRangeRef("rename/"_sr, "rename0"_sr); + + explicit TenantRangeImpl(KeyRangeRef kr) : SpecialKeyRangeRWImpl(kr) {} + + Future getRange(ReadYourWritesTransaction* ryw, + KeyRangeRef kr, + GetRangeLimits limitsHint) const override { + return getTenantRange(ryw, kr, limitsHint); + } + + #line 2448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +// This generated class is to be used only via commitImpl() + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +template + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class CommitImplActorState { + #line 2454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + CommitImplActorState(TenantRangeImpl* const& self,ReadYourWritesTransaction* const& ryw) + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + : self(self), + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ryw(ryw), + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantManagementFutures(), + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantGroupNetTenantDelta(), + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ranges(ryw->getSpecialKeySpaceWriteMap().containedRanges(self->range)), + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + mapMutations(), + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + configMutations(), + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + renameSet(), + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + renameMutations() + #line 2477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + fdb_probe_actor_create("commitImpl", reinterpret_cast(this)); + + } + ~CommitImplActorState() + { + fdb_probe_actor_destroy("commitImpl", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantManagementFutures.push_back(TenantAPI::checkTenantMode(&ryw->getTransaction(), ClusterType::STANDALONE)); + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + RangeForbody1Iterator0 = std::begin(ranges); + #line 2494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CommitImplActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::map, Optional>>> tenantsToCreate; + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto mapMutation : mapMutations ) { + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantNameRef tenantName = mapMutation.first.begin; + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + auto set_iter = renameSet.lower_bound(tenantName); + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (set_iter != renameSet.end() && mapMutation.first.contains(*set_iter)) + #line 2525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ryw->setSpecialKeySpaceErrorMsg( ManagementAPIError::toJsonString(false, "rename tenant", "tenant rename conflict")); + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return a_body1Catch1(special_keys_api_failure(), loopDepth); + #line 2531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (mapMutation.second.present()) + #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::vector, Optional>> createMutations; + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + auto itr = configMutations.find(tenantName); + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (itr != configMutations.end()) + #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + createMutations = itr->second; + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + configMutations.erase(itr); + #line 2549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantsToCreate[tenantName] = createMutations; + #line 2553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + else + { + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (mapMutation.first.singleKeyRange()) + #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantManagementFutures.push_back(deleteSingleTenant(ryw, tenantName, &tenantGroupNetTenantDelta)); + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + configMutations.erase(tenantName); + #line 2565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + else + { + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantManagementFutures.push_back( deleteTenantRange(ryw, tenantName, mapMutation.first.end, &tenantGroupNetTenantDelta)); + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + configMutations.erase(configMutations.lower_bound(tenantName), configMutations.lower_bound(mapMutation.first.end)); + #line 2573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + } + } + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!tenantsToCreate.empty()) + #line 2579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantManagementFutures.push_back(createTenants(ryw, tenantsToCreate, &tenantGroupNetTenantDelta)); + #line 2583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto configMutation : configMutations ) { + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (renameSet.count(configMutation.first)) + #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ryw->setSpecialKeySpaceErrorMsg( ManagementAPIError::toJsonString(false, "rename tenant", "tenant rename conflict")); + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return a_body1Catch1(special_keys_api_failure(), loopDepth); + #line 2595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantManagementFutures.push_back( changeTenantConfig(ryw, configMutation.first, configMutation.second, &tenantGroupNetTenantDelta)); + #line 2599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto renameMutation : renameMutations ) { + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantManagementFutures.push_back(TenantAPI::renameTenantTransaction( &ryw->getTransaction(), renameMutation.first, renameMutation.second)); + #line 2605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture __when_expr_0 = waitForAll(tenantManagementFutures); + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1cont1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!(RangeForbody1Iterator0 != std::end(ranges))) + #line 2632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + auto range = *RangeForbody1Iterator0; + #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!range.value().first) + #line 2642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + return a_body1continue1(loopDepth); // continue + } + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + adjustedRange = range.range() .removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin) .removePrefix(submoduleRange.begin); + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (mapSubRange.intersects(adjustedRange)) + #line 2650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + adjustedRange = mapSubRange & adjustedRange; + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + adjustedRange = removePrefix(adjustedRange, mapSubRange.begin, "\xff"_sr); + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + mapMutations.push_back(std::make_pair(adjustedRange, range.value().second)); + #line 2658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = a_body1loopBody1cont3(loopDepth); + } + else + { + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (configureSubRange.intersects(adjustedRange) && adjustedRange.singleKeyRange()) + #line 2665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StringRef configTupleStr = adjustedRange.begin.removePrefix(configureSubRange.begin); + #line 2669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + try { + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + Tuple tuple = Tuple::unpack(configTupleStr); + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (tuple.size() != 2) + #line 2675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return a_body1loopBody1Catch1(invalid_tuple_index(), loopDepth); + #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + configMutations[tuple.getString(0)].push_back( std::make_pair(tuple.getString(1), range.value().second)); + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = a_body1loopBody1cont10(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + } + else + { + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (renameSubRange.intersects(adjustedRange)) + #line 2696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StringRef oldName = adjustedRange.begin.removePrefix(renameSubRange.begin); + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StringRef newName = range.value().second.get(); + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (renameSet.count(oldName) || renameSet.count(newName) || oldName == newName) + #line 2704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ryw->setSpecialKeySpaceErrorMsg( ManagementAPIError::toJsonString(false, "rename tenant", "tenant rename conflict")); + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return a_body1Catch1(special_keys_api_failure(), std::max(0, loopDepth - 1)); + #line 2710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + renameSet.insert(oldName); + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + renameSet.insert(newName); + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + renameMutations.push_back(std::make_pair(oldName, newName)); + #line 2718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + loopDepth = a_body1loopBody1cont6(loopDepth); + } + } + } + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1continue1(int loopDepth) + { + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ++RangeForbody1Iterator0; + #line 2744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ++RangeForbody1Iterator0; + #line 2753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont3(int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont6(int loopDepth) + { + loopDepth = a_body1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont7(int loopDepth) + { + loopDepth = a_body1loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TraceEvent(SevWarn, "InvalidTenantConfigurationKey").error(e).detail("Key", adjustedRange.begin); + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ryw->setSpecialKeySpaceErrorMsg(ManagementAPIError::toJsonString( false, "configure tenant", "invalid tenant configuration key")); + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return a_body1Catch1(special_keys_api_failure(), std::max(0, loopDepth - 1)); + #line 2785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont10(int loopDepth) + { + try { + loopDepth = a_body1loopBody1cont7(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantGroupUpdateFutures = std::vector>(); + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto [tenantGroup, count] : tenantGroupNetTenantDelta ) { + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (count < 0) + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantGroupUpdateFutures.push_back(checkAndRemoveTenantGroup(ryw, tenantGroup, count)); + #line 2820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + } + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture __when_expr_1 = waitForAll(tenantGroupUpdateFutures); + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantGroupUpdateFutures = std::vector>(); + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + for( auto [tenantGroup, count] : tenantGroupNetTenantDelta ) { + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (count < 0) + #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + { + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + tenantGroupUpdateFutures.push_back(checkAndRemoveTenantGroup(ryw, tenantGroup, count)); + #line 2849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + } + } + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + StrictFuture __when_expr_1 = waitForAll(tenantGroupUpdateFutures); + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CommitImplActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CommitImplActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("commitImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("commitImpl", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CommitImplActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("commitImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("commitImpl", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CommitImplActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("commitImpl", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("commitImpl", reinterpret_cast(this), 0); + + } + int a_body1cont14(Void const& _,int loopDepth) + { + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~CommitImplActorState(); static_cast(this)->destroy(); return 0; } + #line 2933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~CommitImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont14(Void && _,int loopDepth) + { + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~CommitImplActorState(); static_cast(this)->destroy(); return 0; } + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); + this->~CommitImplActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont14(_, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont14(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CommitImplActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CommitImplActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("commitImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("commitImpl", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< CommitImplActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("commitImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("commitImpl", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< CommitImplActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("commitImpl", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("commitImpl", reinterpret_cast(this), 1); + + } + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + TenantRangeImpl* self; + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + ReadYourWritesTransaction* ryw; + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::vector> tenantManagementFutures; + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::map tenantGroupNetTenantDelta; + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + KeyRangeMap>>::Ranges ranges; + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::vector>> mapMutations; + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::map, Optional>>> configMutations; + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::set renameSet; + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::vector> renameMutations; + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + decltype(std::begin(std::declval>>::Ranges>())) RangeForbody1Iterator0; + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + KeyRangeRef adjustedRange; + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + std::vector> tenantGroupUpdateFutures; + #line 3040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +}; +// This generated class is to be used only via commitImpl() + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +class CommitImplActor final : public Actor>, public ActorCallback< CommitImplActor, 0, Void >, public ActorCallback< CommitImplActor, 1, Void >, public FastAllocated, public CommitImplActorState { + #line 3045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CommitImplActor, 0, Void >; +friend struct ActorCallback< CommitImplActor, 1, Void >; + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + CommitImplActor(TenantRangeImpl* const& self,ReadYourWritesTransaction* const& ryw) + #line 3057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" + : Actor>(), + CommitImplActorState(self, ryw) + { + fdb_probe_actor_enter("commitImpl", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("commitImpl"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("commitImpl", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CommitImplActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CommitImplActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" +[[nodiscard]] static Future> commitImpl( TenantRangeImpl* const& self, ReadYourWritesTransaction* const& ryw ) { + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + return Future>(new CommitImplActor(self, ryw)); + #line 3085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.g.h" +} + +#line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h" + + Future> commit(ReadYourWritesTransaction* ryw) override { return commitImpl(this, ryw); } +}; + +#include "flow/unactorcompiler.h" +#endif \ No newline at end of file diff --git a/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h b/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h new file mode 100644 index 0000000..d74215a --- /dev/null +++ b/src/fdbclient/include/fdbclient/TenantSpecialKeys.actor.h @@ -0,0 +1,402 @@ +/* + * TenantSpecialKeys.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 +#if defined(NO_INTELLISENSE) && !defined(FDBCLIENT_TENANT_SPECIAL_KEYS_ACTOR_G_H) +#define FDBCLIENT_TENANT_SPECIAL_KEYS_ACTOR_G_H +#include "fdbclient/TenantSpecialKeys.actor.g.h" +#elif !defined(FDBCLIENT_TENANT_SPECIAL_KEYS_ACTOR_H) +#define FDBCLIENT_TENANT_SPECIAL_KEYS_ACTOR_H + +#include "fdbclient/ActorLineageProfiler.h" +#include "fdbclient/FDBOptions.g.h" +#include "fdbclient/Knobs.h" +#include "fdbclient/DatabaseContext.h" +#include "fdbclient/SpecialKeySpace.actor.h" +#include "fdbclient/TenantManagement.actor.h" +#include "fdbclient/Tuple.h" +#include "flow/Arena.h" +#include "flow/UnitTest.h" +#include "flow/actorcompiler.h" // This must be the last #include. + +class TenantRangeImpl : public SpecialKeyRangeRWImpl { +private: + static KeyRangeRef removePrefix(KeyRangeRef range, KeyRef prefix, KeyRef defaultEnd) { + KeyRef begin = range.begin.removePrefix(prefix); + KeyRef end; + if (range.end.startsWith(prefix)) { + end = range.end.removePrefix(prefix); + } else { + end = defaultEnd; + } + + return KeyRangeRef(begin, end); + } + + static KeyRef withTenantMapPrefix(KeyRef key, Arena& ar) { + int keySize = SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin.size() + + submoduleRange.begin.size() + mapSubRange.begin.size() + key.size(); + + KeyRef prefixedKey = makeString(keySize, ar); + uint8_t* mutableKey = mutateString(prefixedKey); + + mutableKey = SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin.copyTo(mutableKey); + mutableKey = submoduleRange.begin.copyTo(mutableKey); + mutableKey = mapSubRange.begin.copyTo(mutableKey); + + key.copyTo(mutableKey); + return prefixedKey; + } + + ACTOR static Future getTenantList(ReadYourWritesTransaction* ryw, + KeyRangeRef kr, + RangeResult* results, + GetRangeLimits limitsHint) { + std::vector> tenants = + wait(TenantAPI::listTenantMetadataTransaction(&ryw->getTransaction(), kr.begin, kr.end, limitsHint.rows)); + + for (auto tenant : tenants) { + std::string jsonString = tenant.second.toJson(); + ValueRef tenantEntryBytes(results->arena(), jsonString); + results->push_back(results->arena(), + KeyValueRef(withTenantMapPrefix(tenant.first, results->arena()), tenantEntryBytes)); + } + + return Void(); + } + + ACTOR static Future getTenantRange(ReadYourWritesTransaction* ryw, + KeyRangeRef kr, + GetRangeLimits limitsHint) { + state RangeResult results; + + kr = kr.removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin) + .removePrefix(TenantRangeImpl::submoduleRange.begin); + + if (kr.intersects(TenantRangeImpl::mapSubRange)) { + GetRangeLimits limits = limitsHint; + limits.decrement(results); + wait(getTenantList( + ryw, + removePrefix(kr & TenantRangeImpl::mapSubRange, TenantRangeImpl::mapSubRange.begin, "\xff"_sr), + &results, + limits)); + } + + return results; + } + + // Returns true if the tenant was created, false if it already existed + ACTOR static Future createTenant( + ReadYourWritesTransaction* ryw, + TenantNameRef tenantName, + std::vector, Optional>> configMutations, + int64_t tenantId, + std::map* tenantGroupNetTenantDelta) { + state TenantMapEntry tenantEntry(tenantId, tenantName); + + for (auto const& [name, value] : configMutations) { + tenantEntry.configure(name, value); + } + + if (tenantEntry.tenantGroup.present()) { + (*tenantGroupNetTenantDelta)[tenantEntry.tenantGroup.get()]++; + } + + std::pair, bool> entry = + wait(TenantAPI::createTenantTransaction(&ryw->getTransaction(), tenantEntry)); + + return entry.second; + } + + ACTOR static Future createTenants( + ReadYourWritesTransaction* ryw, + std::map, Optional>>> tenants, + std::map* tenantGroupNetTenantDelta) { + state Future tenantCountFuture = + TenantMetadata::tenantCount().getD(&ryw->getTransaction(), Snapshot::False, 0); + int64_t _nextId = wait(TenantAPI::getNextTenantId(&ryw->getTransaction())); + state int64_t nextId = _nextId; + ASSERT(nextId >= 0); + + state std::vector> createFutures; + int itrCount = 0; + for (auto const& [tenant, config] : tenants) { + createFutures.push_back(createTenant(ryw, tenant, config, nextId, tenantGroupNetTenantDelta)); + if (++itrCount < tenants.size()) { + nextId = TenantAPI::computeNextTenantId(nextId, 1); + } + } + + TenantMetadata::lastTenantId().set(&ryw->getTransaction(), nextId); + wait(waitForAll(createFutures)); + + state int numCreatedTenants = 0; + for (auto f : createFutures) { + if (f.get()) { + ++numCreatedTenants; + } + } + + // Check the tenant count here rather than rely on the createTenantTransaction check because we don't have RYW + int64_t tenantCount = wait(tenantCountFuture); + if (tenantCount + numCreatedTenants > CLIENT_KNOBS->MAX_TENANTS_PER_CLUSTER) { + throw cluster_no_capacity(); + } + + return Void(); + } + + ACTOR static Future changeTenantConfig( + ReadYourWritesTransaction* ryw, + TenantName tenantName, + std::vector, Optional>> configEntries, + std::map* tenantGroupNetTenantDelta) { + TenantMapEntry originalEntry = wait(TenantAPI::getTenantTransaction(&ryw->getTransaction(), tenantName)); + TenantMapEntry updatedEntry = originalEntry; + for (auto const& [name, value] : configEntries) { + updatedEntry.configure(name, value); + } + + if (originalEntry.tenantGroup != updatedEntry.tenantGroup) { + if (originalEntry.tenantGroup.present()) { + (*tenantGroupNetTenantDelta)[originalEntry.tenantGroup.get()]--; + } + if (updatedEntry.tenantGroup.present()) { + (*tenantGroupNetTenantDelta)[updatedEntry.tenantGroup.get()]++; + } + } + + wait(TenantAPI::configureTenantTransaction(&ryw->getTransaction(), originalEntry, updatedEntry)); + return Void(); + } + + ACTOR static Future deleteSingleTenant(ReadYourWritesTransaction* ryw, + TenantName tenantName, + std::map* tenantGroupNetTenantDelta) { + state Optional tenantEntry = + wait(TenantAPI::tryGetTenantTransaction(&ryw->getTransaction(), tenantName)); + if (tenantEntry.present()) { + wait(TenantAPI::deleteTenantTransaction(&ryw->getTransaction(), tenantEntry.get().id)); + if (tenantEntry.get().tenantGroup.present()) { + (*tenantGroupNetTenantDelta)[tenantEntry.get().tenantGroup.get()]--; + } + } + + return Void(); + } + + ACTOR static Future deleteTenantRange(ReadYourWritesTransaction* ryw, + TenantName beginTenant, + TenantName endTenant, + std::map* tenantGroupNetTenantDelta) { + state std::vector> tenants = wait( + TenantAPI::listTenantsTransaction(&ryw->getTransaction(), beginTenant, endTenant, CLIENT_KNOBS->TOO_MANY)); + + if (tenants.size() == CLIENT_KNOBS->TOO_MANY) { + TraceEvent(SevWarn, "DeleteTenantRangeTooLange") + .detail("BeginTenant", beginTenant) + .detail("EndTenant", endTenant); + ryw->setSpecialKeySpaceErrorMsg( + ManagementAPIError::toJsonString(false, "delete tenants", "too many tenants to range delete")); + throw special_keys_api_failure(); + } + + std::vector> deleteFutures; + for (auto tenant : tenants) { + deleteFutures.push_back(deleteSingleTenant(ryw, tenant.first, tenantGroupNetTenantDelta)); + } + + wait(waitForAll(deleteFutures)); + return Void(); + } + + // Check if the number of tenants in the tenant group is equal to the net reduction in the number of tenants. + // If it is, then we can delete the tenant group. + ACTOR static Future checkAndRemoveTenantGroup(ReadYourWritesTransaction* ryw, + TenantGroupName tenantGroup, + int tenantDelta) { + ASSERT(tenantDelta < 0); + state int removedTenants = -tenantDelta; + KeyBackedSet::RangeResultType tenantsInGroup = + wait(TenantMetadata::tenantGroupTenantIndex().getRange(&ryw->getTransaction(), + Tuple::makeTuple(tenantGroup), + Tuple::makeTuple(keyAfter(tenantGroup)), + removedTenants + 1)); + + ASSERT(tenantsInGroup.results.size() >= removedTenants); + if (tenantsInGroup.results.size() == removedTenants) { + TenantMetadata::tenantGroupMap().erase(&ryw->getTransaction(), tenantGroup); + } + + return Void(); + } + +public: + const inline static KeyRangeRef submoduleRange = KeyRangeRef("tenant/"_sr, "tenant0"_sr); + const inline static KeyRangeRef mapSubRange = KeyRangeRef("map/"_sr, "map0"_sr); + const inline static KeyRangeRef configureSubRange = KeyRangeRef("configure/"_sr, "configure0"_sr); + const inline static KeyRangeRef renameSubRange = KeyRangeRef("rename/"_sr, "rename0"_sr); + + explicit TenantRangeImpl(KeyRangeRef kr) : SpecialKeyRangeRWImpl(kr) {} + + Future getRange(ReadYourWritesTransaction* ryw, + KeyRangeRef kr, + GetRangeLimits limitsHint) const override { + return getTenantRange(ryw, kr, limitsHint); + } + + ACTOR static Future> commitImpl(TenantRangeImpl* self, ReadYourWritesTransaction* ryw) { + state std::vector> tenantManagementFutures; + + // This map is an ugly workaround to the fact that we cannot use RYW in these transactions. + // It tracks the net change to the number of tenants in a tenant group, and at the end we can compare + // that with how many tenants the tenant group started with. If we removed all of the tenants, then we + // delete the tenant group. + // + // SOMEDAY: enable RYW support in special keys and remove this complexity. + state std::map tenantGroupNetTenantDelta; + + state KeyRangeMap>>::Ranges ranges = + ryw->getSpecialKeySpaceWriteMap().containedRanges(self->range); + + state std::vector>> mapMutations; + state std::map, Optional>>> configMutations; + state std::set renameSet; + state std::vector> renameMutations; + + tenantManagementFutures.push_back(TenantAPI::checkTenantMode(&ryw->getTransaction(), ClusterType::STANDALONE)); + + for (auto range : ranges) { + if (!range.value().first) { + continue; + } + + state KeyRangeRef adjustedRange = + range.range() + .removePrefix(SpecialKeySpace::getModuleRange(SpecialKeySpace::MODULE::MANAGEMENT).begin) + .removePrefix(submoduleRange.begin); + + if (mapSubRange.intersects(adjustedRange)) { + adjustedRange = mapSubRange & adjustedRange; + adjustedRange = removePrefix(adjustedRange, mapSubRange.begin, "\xff"_sr); + mapMutations.push_back(std::make_pair(adjustedRange, range.value().second)); + } else if (configureSubRange.intersects(adjustedRange) && adjustedRange.singleKeyRange()) { + StringRef configTupleStr = adjustedRange.begin.removePrefix(configureSubRange.begin); + try { + Tuple tuple = Tuple::unpack(configTupleStr); + if (tuple.size() != 2) { + throw invalid_tuple_index(); + } + configMutations[tuple.getString(0)].push_back( + std::make_pair(tuple.getString(1), range.value().second)); + } catch (Error& e) { + TraceEvent(SevWarn, "InvalidTenantConfigurationKey").error(e).detail("Key", adjustedRange.begin); + ryw->setSpecialKeySpaceErrorMsg(ManagementAPIError::toJsonString( + false, "configure tenant", "invalid tenant configuration key")); + throw special_keys_api_failure(); + } + } else if (renameSubRange.intersects(adjustedRange)) { + StringRef oldName = adjustedRange.begin.removePrefix(renameSubRange.begin); + StringRef newName = range.value().second.get(); + // Do not allow overlapping renames in the same commit + // e.g. A->B + B->C, D->D + if (renameSet.count(oldName) || renameSet.count(newName) || oldName == newName) { + ryw->setSpecialKeySpaceErrorMsg( + ManagementAPIError::toJsonString(false, "rename tenant", "tenant rename conflict")); + throw special_keys_api_failure(); + } + renameSet.insert(oldName); + renameSet.insert(newName); + renameMutations.push_back(std::make_pair(oldName, newName)); + } + } + + std::map, Optional>>> tenantsToCreate; + for (auto mapMutation : mapMutations) { + TenantNameRef tenantName = mapMutation.first.begin; + auto set_iter = renameSet.lower_bound(tenantName); + if (set_iter != renameSet.end() && mapMutation.first.contains(*set_iter)) { + ryw->setSpecialKeySpaceErrorMsg( + ManagementAPIError::toJsonString(false, "rename tenant", "tenant rename conflict")); + throw special_keys_api_failure(); + } + if (mapMutation.second.present()) { + std::vector, Optional>> createMutations; + auto itr = configMutations.find(tenantName); + if (itr != configMutations.end()) { + createMutations = itr->second; + configMutations.erase(itr); + } + tenantsToCreate[tenantName] = createMutations; + } else { + // For a single key clear, just issue the delete + if (mapMutation.first.singleKeyRange()) { + tenantManagementFutures.push_back(deleteSingleTenant(ryw, tenantName, &tenantGroupNetTenantDelta)); + + // Configuration changes made to a deleted tenant are discarded + configMutations.erase(tenantName); + } else { + tenantManagementFutures.push_back( + deleteTenantRange(ryw, tenantName, mapMutation.first.end, &tenantGroupNetTenantDelta)); + + // Configuration changes made to a deleted tenant are discarded + configMutations.erase(configMutations.lower_bound(tenantName), + configMutations.lower_bound(mapMutation.first.end)); + } + } + } + + if (!tenantsToCreate.empty()) { + tenantManagementFutures.push_back(createTenants(ryw, tenantsToCreate, &tenantGroupNetTenantDelta)); + } + for (auto configMutation : configMutations) { + if (renameSet.count(configMutation.first)) { + ryw->setSpecialKeySpaceErrorMsg( + ManagementAPIError::toJsonString(false, "rename tenant", "tenant rename conflict")); + throw special_keys_api_failure(); + } + tenantManagementFutures.push_back( + changeTenantConfig(ryw, configMutation.first, configMutation.second, &tenantGroupNetTenantDelta)); + } + + for (auto renameMutation : renameMutations) { + tenantManagementFutures.push_back(TenantAPI::renameTenantTransaction( + &ryw->getTransaction(), renameMutation.first, renameMutation.second)); + } + + wait(waitForAll(tenantManagementFutures)); + + state std::vector> tenantGroupUpdateFutures; + for (auto [tenantGroup, count] : tenantGroupNetTenantDelta) { + if (count < 0) { + tenantGroupUpdateFutures.push_back(checkAndRemoveTenantGroup(ryw, tenantGroup, count)); + } + } + + wait(waitForAll(tenantGroupUpdateFutures)); + return Optional(); + } + + Future> commit(ReadYourWritesTransaction* ryw) override { return commitImpl(this, ryw); } +}; + +#include "flow/unactorcompiler.h" +#endif \ No newline at end of file diff --git a/src/fdbclient/TestKnobCollection.h b/src/fdbclient/include/fdbclient/TestKnobCollection.h similarity index 100% rename from src/fdbclient/TestKnobCollection.h rename to src/fdbclient/include/fdbclient/TestKnobCollection.h diff --git a/src/fdbclient/ThreadSafeTransaction.h b/src/fdbclient/include/fdbclient/ThreadSafeTransaction.h similarity index 72% rename from src/fdbclient/ThreadSafeTransaction.h rename to src/fdbclient/include/fdbclient/ThreadSafeTransaction.h index bdd9522..26497cb 100644 --- a/src/fdbclient/ThreadSafeTransaction.h +++ b/src/fdbclient/include/fdbclient/ThreadSafeTransaction.h @@ -20,6 +20,7 @@ #ifndef FDBCLIENT_THREADSAFETRANSACTION_H #define FDBCLIENT_THREADSAFETRANSACTION_H +#include "flow/ApiVersion.h" #include "flow/ProtocolVersion.h" #pragma once @@ -62,9 +63,21 @@ class ThreadSafeDatabase : public IDatabase, public ThreadSafeReferenceCounted purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) override; ThreadFuture waitPurgeGranulesComplete(const KeyRef& purgeKey) override; + ThreadFuture blobbifyRange(const KeyRangeRef& keyRange) override; + ThreadFuture blobbifyRangeBlocking(const KeyRangeRef& keyRange) override; + ThreadFuture unblobbifyRange(const KeyRangeRef& keyRange) override; + ThreadFuture>> listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) override; + + ThreadFuture verifyBlobRange(const KeyRangeRef& keyRange, Optional version) override; + ThreadFuture flushBlobRange(const KeyRangeRef& keyRange, bool compact, Optional version) override; + ThreadFuture createSharedState() override; void setSharedState(DatabaseSharedState* p) override; + // Return a JSON string containing database client-side status information + ThreadFuture> getClientStatus() override; + private: friend class ThreadSafeTenant; friend class ThreadSafeTransaction; @@ -72,24 +85,39 @@ class ThreadSafeDatabase : public IDatabase, public ThreadSafeReferenceCounted, NonCopyable { public: - ThreadSafeTenant(Reference db, StringRef name) : db(db), name(name) {} + ThreadSafeTenant(Reference db, TenantName name); ~ThreadSafeTenant() override; Reference createTransaction() override; + ThreadFuture getId() override; + ThreadFuture purgeBlobGranules(const KeyRangeRef& keyRange, Version purgeVersion, bool force) override; + ThreadFuture waitPurgeGranulesComplete(const KeyRef& purgeKey) override; + + ThreadFuture blobbifyRange(const KeyRangeRef& keyRange) override; + ThreadFuture blobbifyRangeBlocking(const KeyRangeRef& keyRange) override; + ThreadFuture unblobbifyRange(const KeyRangeRef& keyRange) override; + ThreadFuture>> listBlobbifiedRanges(const KeyRangeRef& keyRange, + int rangeLimit) override; + + ThreadFuture verifyBlobRange(const KeyRangeRef& keyRange, Optional version) override; + ThreadFuture flushBlobRange(const KeyRangeRef& keyRange, bool compact, Optional version) override; + void addref() override { ThreadSafeReferenceCounted::addref(); } void delref() override { ThreadSafeReferenceCounted::delref(); } private: Reference db; - Standalone name; + TenantName name; + Tenant* tenant; }; // An implementation of ITransaction that serializes operations onto the network thread and interacts with the @@ -98,7 +126,8 @@ class ThreadSafeTransaction : public ITransaction, ThreadSafeReferenceCounted tenant); + Optional tenantName, + Tenant* tenantPtr); ~ThreadSafeTransaction() override; // Note: used while refactoring fdbcli, need to be removed later @@ -144,13 +173,30 @@ class ThreadSafeTransaction : public ITransaction, ThreadSafeReferenceCounted>> getRangeSplitPoints(const KeyRangeRef& range, int64_t chunkSize) override; - ThreadFuture>> getBlobGranuleRanges(const KeyRangeRef& keyRange) override; + ThreadFuture>> getBlobGranuleRanges(const KeyRangeRef& keyRange, + int rangeLimit) override; ThreadResult readBlobGranules(const KeyRangeRef& keyRange, Version beginVersion, Optional readVersion, ReadBlobGranuleContext granuleContext) override; + ThreadFuture>> readBlobGranulesStart(const KeyRangeRef& keyRange, + Version beginVersion, + Optional readVersion, + Version* readVersionOut) override; + + ThreadResult readBlobGranulesFinish( + ThreadFuture>> startFuture, + const KeyRangeRef& keyRange, + Version beginVersion, + Version readVersion, + ReadBlobGranuleContext granuleContext) override; + + ThreadFuture>> summarizeBlobGranules(const KeyRangeRef& keyRange, + Optional summaryVersion, + int rangeLimit) override; + void addReadConflictRange(const KeyRangeRef& keys) override; void makeSelfConflicting(); @@ -167,7 +213,9 @@ class ThreadSafeTransaction : public ITransaction, ThreadSafeReferenceCounted commit() override; Version getCommittedVersion() override; ThreadFuture getVersionVector() override; - ThreadFuture getSpanID() override; + ThreadFuture getSpanContext() override; + ThreadFuture getTagThrottledDuration() override; + ThreadFuture getTotalCost() override; ThreadFuture getApproximateSize() override; ThreadFuture getProtocolVersion(); @@ -189,6 +237,9 @@ class ThreadSafeTransaction : public ITransaction, ThreadSafeReferenceCounted::addref(); } void delref() override { ThreadSafeReferenceCounted::delref(); } + void debugTrace(BaseTraceEvent&&) override; + void debugPrint(std::string const& message) override; + private: ISingleThreadTransaction* tr; const Optional tenantName; @@ -201,6 +252,7 @@ class ThreadSafeApi : public IClientApi, ThreadSafeReferenceCounted value = Optional()) override; void setupNetwork() override; @@ -208,6 +260,7 @@ class ThreadSafeApi : public IClientApi, ThreadSafeReferenceCounted createDatabase(const char* clusterFilePath) override; + Reference createDatabaseFromConnectionString(const char* connectionString) override; void addNetworkThreadCompletionHook(void (*hook)(void*), void* hookParameter) override; @@ -215,8 +268,8 @@ class ThreadSafeApi : public IClientApi, ThreadSafeReferenceCounted +#include + +struct Location { + StringRef name; +}; + +inline Location operator"" _loc(const char* str, size_t size) { + return Location{ StringRef(reinterpret_cast(str), size) }; +} + +enum class TraceFlags : uint8_t { unsampled = 0b00000000, sampled = 0b00000001 }; + +inline TraceFlags operator&(TraceFlags lhs, TraceFlags rhs) { + return static_cast(static_cast>(lhs) & + static_cast>(rhs)); +} + +struct SpanContext { + UID traceID; + uint64_t spanID; + TraceFlags m_Flags; + SpanContext() : traceID(UID()), spanID(0), m_Flags(TraceFlags::unsampled) {} + SpanContext(UID traceID, uint64_t spanID, TraceFlags flags) : traceID(traceID), spanID(spanID), m_Flags(flags) {} + SpanContext(UID traceID, uint64_t spanID) : traceID(traceID), spanID(spanID), m_Flags(TraceFlags::unsampled) {} + SpanContext(const SpanContext& span) = default; + bool isSampled() const { return (m_Flags & TraceFlags::sampled) == TraceFlags::sampled; } + std::string toString() const { return format("%016llx%016llx%016llx", traceID.first(), traceID.second(), spanID); }; + bool isValid() const { return traceID.first() != 0 && traceID.second() != 0 && spanID != 0; } + + template + void serialize(Ar& ar) { + serializer(ar, traceID, spanID, m_Flags); + } +}; + +template <> +struct flow_ref : std::false_type {}; + +// Span +// +// Span is a tracing implementation which, for the most part, complies with the W3C Trace Context specification +// https://www.w3.org/TR/trace-context/ and the OpenTelemetry API +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md. +// +// The major differences between Span and the 7.0 Span implementation, which is based off the OpenTracing.io +// specification https://opentracing.io/ are as follows. +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span +// +// OpenTelemetry Spans have... +// 1. A SpanContext which consists of 3 attributes. +// +// TraceId - A valid trace identifier is a 16-byte array with at least one non-zero byte. +// SpanId - A valid span identifier is an 8-byte array with at least one non-zero byte. +// TraceFlags - 1 byte, bit field for flags. +// +// TraceState is not implemented, specifically we do not provide some of the following APIs +// https://www.w3.org/TR/trace-context/#mutating-the-tracestate-field In particular APIs to delete/update a specific, +// arbitrary key/value pair, as this complies with the OTEL specification where SpanContexts are immutable. +// 2. A begin/end and those values are serialized, unlike the Span implementation which has an end but serializes with a +// begin and calculated duration field. +// 3. A SpanKind +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#spankind +// 4. A SpanStatus +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status +// 5. A singular parent SpanContext, which may optionally be null, as opposed to our Span implementation which allows +// for a list of parents. +// 6. An "attributes" rather than "tags", however the implementation is essentially the same, a set of key/value of +// strings, stored here as a SmallVectorRef rather than map as a convenience. +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/common.md#attributes +// 7. An optional list of linked SpanContexts. +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#specifying-links +// 8. An optional list of timestamped Events. +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#add-events + +enum class SpanKind : uint8_t { INTERNAL = 0, CLIENT = 1, SERVER = 2, PRODUCER = 3, CONSUMER = 4 }; + +enum class SpanStatus : uint8_t { UNSET = 0, OK = 1, ERR = 2 }; + +struct SpanEventRef { + SpanEventRef() {} + SpanEventRef(const StringRef& name, + const double& time, + const SmallVectorRef& attributes = SmallVectorRef()) + : name(name), time(time), attributes(attributes) {} + SpanEventRef(Arena& arena, const SpanEventRef& other) + : name(arena, other.name), time(other.time), attributes(arena, other.attributes) {} + StringRef name; + double time = 0.0; + SmallVectorRef attributes; +}; + +class Span { +public: + // Construct a Span with a given context, location, parentContext and optional links. + // + // N.B. While this constructor receives a parentContext it does not overwrite the traceId of the Span's context. + // Therefore it is the responsibility of the caller to ensure the traceID and m_Flags of both the context and + // parentContext are identical if the caller wishes to establish a parent/child relationship between these spans. We + // do this to avoid needless comparisons or copies as this constructor is only called once in NativeAPI.actor.cpp + // and from below in the by the Span(location, parent, links) constructor. The Span(location, parent, links) + // constructor is used broadly and performs the copy of the parent's traceID and m_Flags. + Span(const SpanContext& context, + const Location& location, + const SpanContext& parentContext, + const std::initializer_list& links = {}) + : context(context), location(location), parentContext(parentContext), links(arena, links.begin(), links.end()), + begin(g_network->now()) { + this->kind = SpanKind::SERVER; + this->status = SpanStatus::OK; + this->attributes.push_back( + // this->arena, KeyValueRef("address"_sr, StringRef(this->arena, "localhost:4000"))); + this->arena, + KeyValueRef("address"_sr, StringRef(this->arena, FlowTransport::transport().getLocalAddressAsString()))); + } + + // Construct Span with a location, parent, and optional links. + // This constructor copies the parent's traceID creating a parent->child relationship between Spans. + // Additionally we inherit the m_Flags of the parent, thus enabling or disabling sampling to match the parent. + Span(const Location& location, const SpanContext& parent, const std::initializer_list& links = {}) + : Span(SpanContext(parent.traceID, deterministicRandom()->randomUInt64(), parent.m_Flags), + location, + parent, + links) {} + + // Construct Span without parent. Used for creating a root span, or when the parent is not known at construction + // time. + Span(const SpanContext& context, const Location& location) : Span(context, location, SpanContext()) {} + + // We've determined for initial tracing release, spans with only a location will not be traced. + // Generally these are for background processes, some are called infrequently, while others may be high volume. + // TODO: review and address in subsequent PRs. + explicit Span(const Location& location) : Span(location, SpanContext()) {} + + Span(const Span&) = delete; + Span(Span&& o) { + arena = std::move(o.arena); + context = o.context; + location = o.location; + parentContext = std::move(o.parentContext); + kind = o.kind; + begin = o.begin; + end = o.end; + links = std::move(o.links); + events = std::move(o.events); + status = o.status; + o.context = SpanContext(); + o.parentContext = SpanContext(); + o.kind = SpanKind::INTERNAL; + o.begin = 0.0; + o.end = 0.0; + o.status = SpanStatus::UNSET; + } + Span() {} + ~Span(); + Span& operator=(Span&& o); + Span& operator=(const Span&) = delete; + void swap(Span& other) { + std::swap(arena, other.arena); + std::swap(context, other.context); + std::swap(location, other.location); + std::swap(parentContext, other.parentContext); + std::swap(kind, other.kind); + std::swap(status, other.status); + std::swap(begin, other.begin); + std::swap(end, other.end); + std::swap(links, other.links); + std::swap(events, other.events); + } + + Span& addLink(const SpanContext& linkContext) { + links.push_back(arena, linkContext); + // Check if link is sampled, if so sample this span. + if (!context.isSampled() && linkContext.isSampled()) { + context.m_Flags = TraceFlags::sampled; + // If for some reason this span isn't valid, we need to give it a + // traceID and spanID. This case is currently hit in CommitProxyServer + // CommitBatchContext::CommitBatchContext and CommitBatchContext::setupTraceBatch. + if (!context.isValid()) { + context.traceID = deterministicRandom()->randomUniqueID(); + context.spanID = deterministicRandom()->randomUInt64(); + } + } + return *this; + } + + Span& addLinks(const std::initializer_list& linkContexts = {}) { + for (auto const& sc : linkContexts) { + addLink(sc); + } + return *this; + } + + Span& addEvent(const SpanEventRef& event) { + events.push_back_deep(arena, event); + return *this; + } + + Span& addEvent(const StringRef& name, + const double& time, + const SmallVectorRef& attrs = SmallVectorRef()) { + return addEvent(SpanEventRef(name, time, attrs)); + } + + Span& addAttribute(const StringRef& key, const StringRef& value) { + attributes.push_back_deep(arena, KeyValueRef(key, value)); + return *this; + } + + Span& setParent(const SpanContext& parent) { + parentContext = parent; + context.traceID = parent.traceID; + context.spanID = deterministicRandom()->randomUInt64(); + context.m_Flags = parent.m_Flags; + return *this; + } + + Arena arena; + SpanContext context; + Location location; + SpanContext parentContext; + SpanKind kind; + SmallVectorRef links; + double begin = 0.0, end = 0.0; + SmallVectorRef attributes; // not necessarily sorted + SmallVectorRef events; + SpanStatus status; +}; + +// The user selects a tracer using a string passed to fdbserver on boot. +// Clients should not refer to TracerType directly, and mappings of names to +// values in this enum can change without notice. +enum class TracerType { + DISABLED = 0, + NETWORK_LOSSY = 1, + SIM_END = 2, // Any tracers that come after SIM_END will not be tested in simulation + LOG_FILE = 3 +}; + +struct ITracer { + virtual ~ITracer(); + virtual TracerType type() const = 0; + // passed ownership to the tracer + virtual void trace(Span const& span) = 0; +}; + +void openTracer(TracerType type); diff --git a/src/fdbclient/TransactionLineage.h b/src/fdbclient/include/fdbclient/TransactionLineage.h similarity index 95% rename from src/fdbclient/TransactionLineage.h rename to src/fdbclient/include/fdbclient/TransactionLineage.h index 6eed26b..04492db 100644 --- a/src/fdbclient/TransactionLineage.h +++ b/src/fdbclient/include/fdbclient/TransactionLineage.h @@ -34,10 +34,13 @@ struct TransactionLineage : LineageProperties { GetKeyServersLocations }; static constexpr std::string_view name = "Transaction"sv; - uint64_t txID; + UID txID; Operation operation = Operation::Unset; bool isSet(uint64_t TransactionLineage::*member) const { return this->*member > 0; } + bool isSet(UID TransactionLineage::*member) const { + return static_cast(this->*member).first() > 0 && static_cast(this->*member).second() > 0; + } bool isSet(Operation TransactionLineage::*member) const { return this->*member != Operation::Unset; } }; diff --git a/src/fdbclient/Tuple.h b/src/fdbclient/include/fdbclient/Tuple.h similarity index 66% rename from src/fdbclient/Tuple.h rename to src/fdbclient/include/fdbclient/Tuple.h index 53f4141..c8f3f3d 100644 --- a/src/fdbclient/Tuple.h +++ b/src/fdbclient/include/fdbclient/Tuple.h @@ -25,9 +25,22 @@ #include "flow/flow.h" #include "fdbclient/FDBTypes.h" -#include "fdbclient/Versionstamp.h" +#include "fdbclient/TupleVersionstamp.h" struct Tuple { + struct UnicodeStr { + StringRef str; + explicit UnicodeStr(StringRef str) : str(str) {} + }; + + struct UserTypeStr { + uint8_t code; + Standalone str; + UserTypeStr(uint8_t code, StringRef str) : code(code), str(str) {} + + bool operator==(const UserTypeStr& other) const { return (code == other.code && str == other.str); } + }; + Tuple() {} // Tuple parsing normally does not care of the final value is a numeric type and is incomplete. @@ -35,29 +48,37 @@ struct Tuple { // Note that strings can't be incomplete because they are parsed such that the end of the packed // byte string is considered the end of the string in lieu of a specific end. static Tuple unpack(StringRef const& str, bool exclude_incomplete = false); + static std::string tupleToString(Tuple const& tuple); + static Tuple unpackUserType(StringRef const& str, bool exclude_incomplete = false); Tuple& append(Tuple const& tuple); // the str needs to be a Tuple encoded string. Tuple& appendRaw(StringRef const& str); Tuple& append(StringRef const& str, bool utf8 = false); + Tuple& append(UnicodeStr const& str); + Tuple& append(int32_t); Tuple& append(int64_t); - // There are some ambiguous append calls in fdbclient, so to make it easier - // to add append for floats and doubles, name them differently for now. - Tuple& appendBool(bool); - Tuple& appendFloat(float); - Tuple& appendDouble(double); + Tuple& append(bool); + Tuple& append(float); + Tuple& append(double); + Tuple& append(std::nullptr_t); Tuple& appendNull(); - Tuple& appendVersionstamp(Versionstamp const&); + Tuple& append(TupleVersionstamp const&); + Tuple& append(UserTypeStr const&); - StringRef pack() const { return StringRef(data.begin(), data.size()); } + Standalone pack() const { + return Standalone(StringRef(data.begin(), data.size()), data.arena()); + } template Tuple& operator<<(T const& t) { return append(t); } - enum ElementType { NULL_TYPE, INT, BYTES, UTF8, BOOL, FLOAT, DOUBLE, VERSIONSTAMP }; + enum ElementType { NULL_TYPE, INT, BYTES, UTF8, BOOL, FLOAT, DOUBLE, VERSIONSTAMP, USER_TYPE }; + + bool isUserType(uint8_t code) const; // this is number of elements, not length of data size_t size() const { return offsets.size(); } @@ -72,11 +93,12 @@ struct Tuple { StringRef subTupleRawString(size_t index) const; ElementType getType(size_t index) const; Standalone getString(size_t index) const; - Versionstamp getVersionstamp(size_t index) const; + TupleVersionstamp getVersionstamp(size_t index) const; int64_t getInt(size_t index, bool allow_incomplete = false) const; bool getBool(size_t index) const; float getFloat(size_t index) const; double getDouble(size_t index) const; + Tuple::UserTypeStr getUserType(size_t index) const; KeyRange range(Tuple const& tuple = Tuple()) const; @@ -86,8 +108,20 @@ struct Tuple { Standalone> getData() { return data; } Standalone getDataAsStandalone() { return Standalone(pack(), data.arena()); } + // Create a tuple from a parameter pack + template + static Tuple makeTuple(Types&&... args) { + Tuple t; + + // Use a fold expression to append each argument using the << operator. + // https://en.cppreference.com/w/cpp/language/fold + (t << ... << std::forward(args)); + + return t; + } + private: - Tuple(const StringRef& data, bool exclude_incomplete = false); + Tuple(const StringRef& data, bool exclude_incomplete = false, bool exclude_user_type = false); Standalone> data; std::vector offsets; }; diff --git a/src/fdbclient/Versionstamp.h b/src/fdbclient/include/fdbclient/TupleVersionstamp.h similarity index 88% rename from src/fdbclient/Versionstamp.h rename to src/fdbclient/include/fdbclient/TupleVersionstamp.h index b3fd677..730e764 100644 --- a/src/fdbclient/Versionstamp.h +++ b/src/fdbclient/include/fdbclient/TupleVersionstamp.h @@ -1,5 +1,5 @@ /* - * Versionstamp.h + * TupleVersionstamp.h * * This source file is part of the FoundationDB open source project * @@ -27,15 +27,15 @@ const size_t VERSIONSTAMP_TUPLE_SIZE = 12; -struct Versionstamp { - Versionstamp(StringRef); +struct TupleVersionstamp { + TupleVersionstamp(StringRef); int64_t getVersion() const; int16_t getBatchNumber() const; int16_t getUserVersion() const; size_t size() const; const uint8_t* begin() const; - bool operator==(const Versionstamp&) const; + bool operator==(const TupleVersionstamp&) const; private: Standalone data; diff --git a/src/fdbclient/include/fdbclient/VersionVector.h b/src/fdbclient/include/fdbclient/VersionVector.h new file mode 100644 index 0000000..f147171 --- /dev/null +++ b/src/fdbclient/include/fdbclient/VersionVector.h @@ -0,0 +1,564 @@ +/* + * VersionVector.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2021 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. + */ + +#ifndef FDBCLIENT_VERSION_VECTOR_H +#define FDBCLIENT_VERSION_VECTOR_H + +#pragma once + +#include +#include + +#include "fdbclient/FDBTypes.h" +#include "fdbclient/Knobs.h" + +static const int InvalidEncodedSize = 0; + +struct VersionVector { + constexpr static FileIdentifier file_identifier = 5253554; + friend struct serializable_traits; + boost::container::flat_map versions; // An ordered map. (Note: + // changing this to an unordered + // map will break the + // serialization code below.) + Version maxVersion; // Specifies the max version in this version vector. (Note: + // there may or may not be a corresponding entry for this + // version in the "versions" map.) + + VersionVector() : maxVersion(invalidVersion), cachedEncodedSize(InvalidEncodedSize) {} + VersionVector(Version version) : maxVersion(version), cachedEncodedSize(InvalidEncodedSize) {} + +private: + // Only invoked by getDelta() and applyDelta(), where tag has been validated + // and version is guaranteed to be larger than the existing value. + inline void setVersionNoCheck(const Tag& tag, Version version) { + versions[tag] = version; + invalidateCachedEncodedSize(); + } + + inline void invalidateCachedEncodedSize() { cachedEncodedSize = InvalidEncodedSize; } + + // Encoded version vector size. Introduced to help speed up serialization. + // @note This encoded size is not meant to be kept in sync with the updates + // that happen to the version vector. + // @note A value of 0 (= InvalidEncodedSize) indicates that the encoded version + // vector size is not cached. + size_t cachedEncodedSize; + +public: + Version getMaxVersion() const { return maxVersion; } + + void setMaxVersion(Version version) { maxVersion = version; } + + int size() const { return versions.size(); } + + bool empty() const { return versions.empty(); } + + void setVersion(const Tag& tag, Version version) { + ASSERT(tag != invalidTag); + ASSERT(tag.locality > tagLocalityInvalid); + ASSERT(version > maxVersion); + versions[tag] = version; + maxVersion = version; + invalidateCachedEncodedSize(); + } + + void setVersion(const std::set& tags, Version version, int8_t localityFilter = tagLocalityInvalid) { + ASSERT(version > maxVersion); + for (auto& tag : tags) { + ASSERT(tag != invalidTag); + ASSERT(tag.locality > tagLocalityInvalid); + if (localityFilter == tagLocalityInvalid || tag.locality == localityFilter) { + versions[tag] = version; + } + } + maxVersion = version; + invalidateCachedEncodedSize(); + } + + bool hasVersion(const Tag& tag) const { + ASSERT(tag != invalidTag); + return versions.find(tag) != versions.end(); + } + + // @pre assumes that the given tag has an entry in the version vector. + Version getVersion(const Tag& tag) const { + ASSERT(tag != invalidTag); + auto iter = versions.find(tag); + ASSERT(iter != versions.end()); + return iter->second; + } + + void clear() { + versions.clear(); + maxVersion = invalidVersion; + invalidateCachedEncodedSize(); + } + + // @note this method, together with method applyDelta(), helps minimize + // the number of version vector entries that get sent from sequencer to + // grv proxy (and from grv proxy to client) on the read path. + void getDelta(Version refVersion, VersionVector& delta) const { + ASSERT(refVersion <= maxVersion); + + delta.clear(); + + if (refVersion == maxVersion) { + return; // rerurn an invalid version vector + } + + if (CLIENT_KNOBS->SEND_ENTIRE_VERSION_VECTOR) { + delta = *this; + } else { + for (const auto& [tag, version] : versions) { + if (version > refVersion) { + delta.setVersionNoCheck(tag, version); + } + } + delta.maxVersion = maxVersion; + } + } + + // @note this method, together with method getDelta(), helps minimize + // the number of version vector entries that get sent from sequencer to + // grv proxy (and from grv proxy to client) on the read path. + void applyDelta(const VersionVector& delta) { + if (delta.maxVersion == invalidVersion) { + return; + } + + if (maxVersion >= delta.maxVersion) { + return; + } + + if (CLIENT_KNOBS->SEND_ENTIRE_VERSION_VECTOR) { + *this = delta; + } else { + for (const auto& [tag, version] : delta.versions) { + if (version > maxVersion) { + setVersionNoCheck(tag, version); + } + } + maxVersion = delta.maxVersion; + } + } + + std::string toString() const { + std::stringstream vector; + vector << "["; + for (const auto& [tag, version] : versions) { + vector << '{' << tag.toString() << "," << version << '}'; + } + vector << " maxversion: " << maxVersion << "]"; + return vector.str(); + } + + bool operator==(const VersionVector& vv) const { return maxVersion == vv.maxVersion; } + bool operator!=(const VersionVector& vv) const { return maxVersion != vv.maxVersion; } + bool operator<(const VersionVector& vv) const { return maxVersion < vv.maxVersion; } + + bool compare(const VersionVector& vv) { + if (maxVersion != vv.maxVersion) { + return false; + } + + if (versions.size() != vv.versions.size()) { + return false; + } + + auto iterA = versions.begin(); + auto iterB = vv.versions.begin(); + for (; iterA != versions.end(); iterA++, iterB++) { + if (iterA->first != iterB->first || iterA->second != iterB->second) { + return false; + } + } + ASSERT(iterB == vv.versions.end()); + + return true; + } + + // + // Methods to set/get/check cached encoded version vector size. + // + void setCachedEncodedSize(size_t size) { cachedEncodedSize = size; } + + bool isEncodedSizeCached() const { return cachedEncodedSize != InvalidEncodedSize; } + + size_t getCachedEncodedSize() const { + ASSERT(isEncodedSizeCached()); + return cachedEncodedSize; + } + + // + // Methods to copy an encoded version vector into the serialization buffer. + // + // Encoding methods used: + // + // - Tag localities: Run-length encoding + // - Tag ids: Compact representation (depending on the max tag id value) + // - Commit versions: Delta encoding + // + + // Extracts information about tag ids, tag localities, and commit versions that are + // captured in the version vector. This will avoid the need to make multiple iterations + // over the contents of the version vector while (encoding and) serializing it. + void getTagAndCommitVersionInfo(size_t& utlCount, + uint16_t& maxTagId, + Version& minCommitVersion, + Version& maxCommitVersion) const { + // Initialization + utlCount = 0; // unique tag locality count + maxTagId = 0; // the highest tag id in the version vector + minCommitVersion = MAX_VERSION; // the lowest commit version in "VersionVector::versions" + maxCommitVersion = invalidVersion; // the highest commit version in "VersionVector::versions" + + // Population + int8_t locality = tagLocalityInvalid; + for (const auto& [tag, version] : versions) { + if (locality != tag.locality) { + locality = tag.locality; + utlCount++; + } + + maxTagId = std::max(maxTagId, tag.id); + minCommitVersion = std::min(minCommitVersion, version); + maxCommitVersion = std::max(maxCommitVersion, version); + } + } + + // Calculate size of the encoded version vector. + size_t getEncodedSize() const { + size_t utlCount; // unique tag locality count + uint16_t maxTagId; // the highest tag id in the version vector + Version minVersion; // the lowest commit version in the version vector + Version maxVersion; // the highest commit version in the version vector + getTagAndCommitVersionInfo(utlCount, maxTagId, minVersion, maxVersion); + + // Is the version vector empty? + if (utlCount == 0) { + return sizeof(size_t) + /* captures unique tag locality count (= 0, in this case) */ + sizeof(Version); /* captures VersionVector::maxVersion */ + } + + size_t tagIdSize = 0; // number of bytes needed to serialize an individual (potentially compacted) tag id + tagIdSize = (maxTagId <= UINT8_MAX) ? sizeof(uint8_t) : sizeof(uint16_t); + + size_t commitVersionSize = 0; // number of bytes needed to serialize an individual commit version + if ((maxVersion - minVersion) <= UINT8_MAX) { + commitVersionSize = sizeof(uint8_t); + } else if ((maxVersion - minVersion) <= UINT16_MAX) { + commitVersionSize = sizeof(uint16_t); + } else if ((maxVersion - minVersion) <= UINT32_MAX) { + commitVersionSize = sizeof(uint32_t); + } else { + commitVersionSize = sizeof(uint64_t); + } + + return sizeof(size_t) + /* unique tag locality count */ + utlCount * (sizeof(int8_t) + sizeof(uint16_t)) + // unique tag locality values and their run lengths + sizeof(uint8_t) + /* number of bytes needed to serialize an individual (potentially compacted) tag id */ + sizeof(uint8_t) + /* number of bytes needed to serialize an individual commit version */ + sizeof(Version) + /* the lowest commit version in the version vector */ + sizeof(size_t) + /* number of pairs */ + this->size() * (tagIdSize + commitVersionSize) + /* encoded pairs */ + sizeof(Version); /* VersionVector::maxVersion */ + } + + // Copy "value" into the serialization buffer. + template + void serialize(uint8_t*& out, T value) const { + memcpy(out, &value, sizeof(T)); + out += sizeof(T); + } + + // Copy RLE encoded tag locality values into the serialization buffer. + void serializeTagLocalities(size_t utlCount, uint8_t*& out) const { + serialize(out, utlCount); // unique tag locality count + + // Is the version vector empty? + if (utlCount == 0) { + return; + } + + int8_t locality = tagLocalityInvalid; + uint16_t localityCount = 0; + for (const auto& [tag, version] : versions) { + if (locality != tag.locality) { + if (locality != tagLocalityInvalid) { + serialize(out, locality); // tag locality value + serialize(out, localityCount); // run length of the locality value + } + locality = tag.locality; + localityCount = 1; + } else { + localityCount++; + } + } + + if (locality != tagLocalityInvalid) { + serialize(out, locality); // tag locality value + serialize(out, localityCount); // run length of the locality value + } + } + + // Copy encoded tag id and commit version values into the serialization buffer. + // T: Type to be used to serialize tag ids (uint8_t/uint16_t) + // V: Type to be used to serialize commit version deltas (uint8_t/uint16_t/uint32_t/uint64_t) + template + void serializeSizedTagIdsAndSizedCommitVersions(Version minCommitVersion, uint8_t*& out) const { + // Number of bytes that will be used to serialize an individual tag id. + serialize(out, (uint8_t)sizeof(T)); + // Number of bytes that will be used to serialize an individual commit version delta value. + serialize(out, (uint8_t)sizeof(V)); + // The lowest commit version in the version vector. + serialize(out, minCommitVersion); + // The number of pairs. + serialize(out, (this->size())); + + for (const auto& [tag, version] : versions) { + // Serialize tag id. + serialize(out, (T)tag.id); + + // Serialize commit version delta. + serialize(out, (V)(version - minCommitVersion)); + } + } + + // Figure out the type to be used to serialize delta encoded commit version values, + // and call the above method to do the serialization. + // T: Type to be used to serialize tag ids (uint8_t/uint16_t) + template + void serializeSizedTagIdsAndCommitVersions(Version minVersion, Version maxVersion, uint8_t*& out) const { + if ((maxVersion - minVersion) <= UINT8_MAX) { + serializeSizedTagIdsAndSizedCommitVersions(minVersion, out); + } else if ((maxVersion - minVersion) <= UINT16_MAX) { + serializeSizedTagIdsAndSizedCommitVersions(minVersion, out); + } else if ((maxVersion - minVersion) <= UINT32_MAX) { + serializeSizedTagIdsAndSizedCommitVersions(minVersion, out); + } else { + serializeSizedTagIdsAndSizedCommitVersions(minVersion, out); + } + } + + // Figure out the types to be used to serialize (potentially compacted) tag ids and delta + // encoded commit version values, and call the above methods to do the serialization. + void serializeTagIdsAndCommitVersions(uint16_t maxTagId, + Version minVersion, + Version maxVersion, + uint8_t*& out) const { + ASSERT(!this->empty()); + if (maxTagId <= UINT8_MAX) { + serializeSizedTagIdsAndCommitVersions(minVersion, maxVersion, out); + } else { + serializeSizedTagIdsAndCommitVersions(minVersion, maxVersion, out); + } + } + + // + // Methods to load (an encoded) version vector from the serialization buffer. + // + + // Extract "value" from the serialization buffer. + template + void deserialize(const uint8_t*& data, T& value) const { + memcpy(&value, data, sizeof(T)); + data += sizeof(T); + } + + // Deserialize RLE encoded tag locality values. + void deserializeLocalities(const uint8_t*& data, + size_t& utlCount, + std::vector& localities, + std::vector& localityCounts) { + // Initialization + localities.clear(); + localityCounts.clear(); + + // Extract unique tag locality count from the buffer. + deserialize(data, utlCount); + + if (utlCount == 0) { + return; + } + + int8_t locality; + uint16_t localityCount; + localities.reserve(utlCount); + localityCounts.reserve(utlCount); + for (size_t i = 0; i < utlCount; i++) { + deserialize(data, locality); + localities.push_back(locality); + + deserialize(data, localityCount); + localityCounts.push_back(localityCount); + } + } + + // Deserialize tag ids and commit version values. + // T: Type that was used to serialize tag ids (uint8_t/uint16_t) + // V: Type that was used to serialize commit version deltas (uint8_t/uint16_t/uint32_t/uint64_t) + template + void deserializeSizedTagIdsAndSizedCommitVersions(const uint8_t*& data, + std::vector& localities, + std::vector& localityCounts) { + Version minCommitVersion; + deserialize(data, minCommitVersion); + + size_t pairCount; // number of serialized pairs + deserialize(data, pairCount); + + T tagId; + V versionDelta; + for (size_t i = 0; i < localities.size(); i++) { + for (size_t j = 0; j < localityCounts[i]; j++) { + // Deserialize tag id. + deserialize(data, tagId); + + // Deserialize commit version delta. + deserialize(data, versionDelta); + + Tag tag(localities[i], tagId); + setVersionNoCheck(tag, minCommitVersion + versionDelta); + } + } + } + + // Figrue out the type that was used to serialize commit version deltas and call the above + // method to do the deserialization. + // T: Type that was used to serialize tag ids (uint8_t/uint16_t) + template + void deserializeSizedTagIdsAndCommitVersions(const uint8_t*& data, + std::vector& localities, + std::vector& localityCounts) { + uint8_t commitVersionDeltaSize; // number of bytes that were used to serialize an individual commit version + // delta value + deserialize(data, commitVersionDeltaSize); + + if (commitVersionDeltaSize == sizeof(uint8_t)) { + deserializeSizedTagIdsAndSizedCommitVersions(data, localities, localityCounts); + } else if (commitVersionDeltaSize == sizeof(uint16_t)) { + deserializeSizedTagIdsAndSizedCommitVersions(data, localities, localityCounts); + } else if (commitVersionDeltaSize == sizeof(uint32_t)) { + deserializeSizedTagIdsAndSizedCommitVersions(data, localities, localityCounts); + } else { + ASSERT(commitVersionDeltaSize == sizeof(uint64_t)); + deserializeSizedTagIdsAndSizedCommitVersions(data, localities, localityCounts); + } + } + + // Figure out the types that were used to serialize tag ids and commit version deltas, and + // call the above methods to do the deserialization. + void deserializeTagIdsAndCommitVersions(const uint8_t*& data, + std::vector& localities, + std::vector& localityCounts) { + uint8_t tagIdSize; // number of bytes that were used to serialize an individual tag id + deserialize(data, tagIdSize); + + if (tagIdSize == sizeof(uint8_t)) { + deserializeSizedTagIdsAndCommitVersions(data, localities, localityCounts); + } else { + ASSERT(tagIdSize == sizeof(uint16_t)); + deserializeSizedTagIdsAndCommitVersions(data, localities, localityCounts); + } + } +}; + +// @note Enabling/Disabling version vector encoding during serialization (and +// de-serialization): +// - To enable version vector encoding during serialization/de-serialization: +// derive "struct dynamic_size_traits" from "std::true_type" and +// derive "struct serializable_traits" from "std::false_type". +// +// - To disable version vector encoding during serialization/de-serialization:: +// derive "struct dynamic_size_traits" from "std::false_type" and +// derive "struct serializable_traits" from "std::true_type". +template <> +struct serializable_traits : std::false_type { + template + static void serialize(Archiver& ar, VersionVector& vv) { + serializer(ar, vv.versions, vv.maxVersion); + } +}; + +template <> +struct dynamic_size_traits : std::true_type { + template + static size_t size(const VersionVector& vv, Context&) { + size_t encodedSize; + if (vv.isEncodedSizeCached()) { + encodedSize = vv.getCachedEncodedSize(); + // @todo remove this assert before doing performance tests + ASSERT(encodedSize == vv.getEncodedSize()); + } else { + encodedSize = vv.getEncodedSize(); + const_cast(vv).setCachedEncodedSize(encodedSize); + } + return encodedSize; + } + + template + static void save(uint8_t* out, const VersionVector& vv, Context&) { + auto* begin = out; + + size_t utlCount; // unique tag locality count + uint16_t maxTagId; // the highest tag id in the version vector + Version minCommitVersion; // the lowest commit version in the version vector (in "VersionVector::versions") + Version maxCommitVersion; // the highest commit version in the version vector (in "VersionVector::versions") + vv.getTagAndCommitVersionInfo(utlCount, maxTagId, minCommitVersion, maxCommitVersion); + + vv.serializeTagLocalities(utlCount, out); + if (!vv.empty()) { + vv.serializeTagIdsAndCommitVersions(maxTagId, minCommitVersion, maxCommitVersion, out); + } + + // Serialize vv::maxVersion. + vv.serialize(out, (vv.getMaxVersion())); + + // @todo remove this assert before doing performance tests + ASSERT(out - begin == vv.getEncodedSize()); + } + + template + static void load(const uint8_t* data, size_t size, VersionVector& vv, Context& context) { + auto* p = data; + + size_t utlCount; + std::vector localities; + std::vector localityCounts; + vv.deserializeLocalities(data, utlCount, localities, localityCounts); + if (utlCount > 0) { + vv.deserializeTagIdsAndCommitVersions(data, localities, localityCounts); + } + + // Deserialize VersionVector::maxVersion. + Version maxVersion; + vv.deserialize(data, maxVersion); + vv.setMaxVersion(maxVersion); + + ASSERT(data - p == size); + } +}; + +static const VersionVector minVersionVector{ 0 }; +static const VersionVector maxVersionVector{ MAX_VERSION }; +static const VersionVector invalidVersionVector{ invalidVersion }; + +#endif /* FDBCLIENT_VERSION_VECTOR_H */ diff --git a/src/fdbclient/VersionedMap.actor.g.h b/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h similarity index 80% rename from src/fdbclient/VersionedMap.actor.g.h rename to src/fdbclient/include/fdbclient/VersionedMap.actor.g.h index 306ff7c..5d4f37d 100644 --- a/src/fdbclient/VersionedMap.actor.g.h +++ b/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" /* * VersionedMap.actor.h * @@ -33,25 +33,25 @@ #include "flow/flow.h" #include "flow/actorcompiler.h" // This must be the last #include. - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" namespace { // This generated class is to be used only via deferredCleanupActor() - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" template - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" class DeferredCleanupActorActorState { - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" public: - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" DeferredCleanupActorActorState(std::vector const& toFree,TaskPriority const& taskID = TaskPriority::DefaultYield) - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" : toFree(toFree), - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" taskID(taskID), - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" freeCount(0) - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" { fdb_probe_actor_create("deferredCleanupActor", reinterpret_cast(this)); @@ -64,9 +64,9 @@ class DeferredCleanupActorActorState { int a_body1(int loopDepth=0) { try { - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" ; - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -87,9 +87,9 @@ class DeferredCleanupActorActorState { } int a_body1cont1(int loopDepth) { - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeferredCleanupActorActorState(); static_cast(this)->destroy(); return 0; } - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DeferredCleanupActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -106,41 +106,41 @@ class DeferredCleanupActorActorState { } int a_body1loopBody1(int loopDepth) { - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" if (!(!toFree.empty())) - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" Tree a = std::move(toFree.back()); - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" toFree.pop_back(); - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" for(int c = 0;c < 3;c++) { - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" if (a->pointer[c] && a->pointer[c]->isSoleOwner()) - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" { - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" toFree.push_back(std::move(a->pointer[c])); - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" } } - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" if (++freeCount % 100 == 0) - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" { - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" StrictFuture __when_expr_0 = yield(taskID); - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" loopDepth = 0; } else @@ -244,20 +244,20 @@ class DeferredCleanupActorActorState { fdb_probe_actor_exit("deferredCleanupActor", reinterpret_cast(this), 0); } - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" std::vector toFree; - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" TaskPriority taskID; - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" int freeCount; - #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" }; // This generated class is to be used only via deferredCleanupActor() - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" template - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" class DeferredCleanupActorActor final : public Actor, public ActorCallback< DeferredCleanupActorActor, 0, Void >, public FastAllocated>, public DeferredCleanupActorActorState> { - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -266,9 +266,9 @@ class DeferredCleanupActorActor final : public Actor, public ActorCallback void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< DeferredCleanupActorActor, 0, Void >; - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" DeferredCleanupActorActor(std::vector const& toFree,TaskPriority const& taskID = TaskPriority::DefaultYield) - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" : Actor(), DeferredCleanupActorActorState>(toFree, taskID) { @@ -292,16 +292,16 @@ friend struct ActorCallback< DeferredCleanupActorActor, 0, Void >; } }; } - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" template - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" [[nodiscard]] Future deferredCleanupActor( std::vector const& toFree, TaskPriority const& taskID = TaskPriority::DefaultYield ) { - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" return Future(new DeferredCleanupActorActor(toFree, taskID)); - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.g.h" + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.g.h" } -#line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/VersionedMap.actor.h" +#line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbclient/include/fdbclient/VersionedMap.actor.h" #include "flow/unactorcompiler.h" #endif diff --git a/src/fdbclient/VersionedMap.actor.h b/src/fdbclient/include/fdbclient/VersionedMap.actor.h similarity index 100% rename from src/fdbclient/VersionedMap.actor.h rename to src/fdbclient/include/fdbclient/VersionedMap.actor.h diff --git a/src/fdbclient/VersionedMap.h b/src/fdbclient/include/fdbclient/VersionedMap.h similarity index 97% rename from src/fdbclient/VersionedMap.h rename to src/fdbclient/include/fdbclient/VersionedMap.h index 2b47c96..ff2a45d 100644 --- a/src/fdbclient/VersionedMap.h +++ b/src/fdbclient/include/fdbclient/VersionedMap.h @@ -51,14 +51,14 @@ struct PTree : public ReferenceCounted>, FastAllocated>, NonCo bool replacedPointer; T data; - Reference child(bool which, Version at) const { + const Reference& child(bool which, Version at) const { if (updated && lastUpdateVersion <= at && which == replacedPointer) return pointer[2]; else return pointer[which]; } - Reference left(Version at) const { return child(false, at); } - Reference right(Version at) const { return child(true, at); } + const Reference& left(Version at) const { return child(false, at); } + const Reference& right(Version at) const { return child(true, at); } PTree(const T& data, Version ver) : lastUpdateVersion(ver), updated(false), data(data) { priority = deterministicRandom()->randomUInt32(); @@ -77,6 +77,7 @@ template class PTreeFinger { using PTreeFingerEntry = PTree const*; // This finger size supports trees with up to exp(96/4.3) ~= 4,964,514,749 entries. + // The number 4.3 comes from here: https://en.wikipedia.org/wiki/Random_binary_tree#The_longest_path // see also: check(). static constexpr size_t N = 96; PTreeFingerEntry entries_[N]; @@ -532,17 +533,15 @@ void split(Reference> p, const X& x, Reference>& left, Referen } template -void rotate(Reference>& p, Version at, bool right) { - auto r = p->child(!right, at); - - auto n1 = r->child(!right, at); - auto n2 = r->child(right, at); - auto n3 = p->child(right, at); - - auto newC = update(p, !right, n2, at); - newC = update(newC, right, n3, at); - p = update(r, !right, n1, at); - p = update(p, right, newC, at); +void rotate(Reference>& n, Version at, bool right) { + auto l = n->child(!right, at); + n = update(l, right, update(n, !right, l->child(right, at), at), at); + // Diagram for right = true + // n l + // / \ + // l -> n + // \ / + // x x } template diff --git a/src/fdbclient/include/fdbclient/WriteMap.h b/src/fdbclient/include/fdbclient/WriteMap.h new file mode 100644 index 0000000..b027b51 --- /dev/null +++ b/src/fdbclient/include/fdbclient/WriteMap.h @@ -0,0 +1,248 @@ +/* + * WriteMap.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBCLIENT_WRITEMAP_H +#define FDBCLIENT_WRITEMAP_H +#pragma once + +#include "fdbclient/FDBTypes.h" +#include "fdbclient/VersionedMap.h" +#include "fdbclient/SnapshotCache.h" +#include "fdbclient/Atomic.h" + +struct RYWMutation { + Optional value; + enum MutationRef::Type type; + + RYWMutation(Optional const& entry, MutationRef::Type type) : value(entry), type(type) {} + RYWMutation() : value(), type(MutationRef::NoOp) {} + + bool operator==(const RYWMutation& r) const { return value == r.value && type == r.type; } + bool operator!=(const RYWMutation& r) const { return !(*this == r); } +}; + +class OperationStack { +private: + RYWMutation singletonOperation; + Optional> optionalOperations; + bool hasVector() const { return optionalOperations.present(); } + bool defaultConstructed; + +public: + OperationStack() { defaultConstructed = true; } // Don't use this! + explicit OperationStack(RYWMutation initialEntry) { + defaultConstructed = false; + singletonOperation = initialEntry; + } + void reset(RYWMutation initialEntry); + void poppush(RYWMutation entry); + void push(RYWMutation entry); + bool isDependent() const; + + const RYWMutation& top() const { return hasVector() ? optionalOperations.get().back() : singletonOperation; } + RYWMutation& operator[](int n) { return (n == 0) ? singletonOperation : optionalOperations.get()[n - 1]; } + + const RYWMutation& at(int n) const { return (n == 0) ? singletonOperation : optionalOperations.get()[n - 1]; } + + int size() const { return defaultConstructed ? 0 : hasVector() ? optionalOperations.get().size() + 1 : 1; } + + bool operator==(const OperationStack& r) const; +}; + +struct WriteMapEntry { + KeyRef key; + OperationStack stack; + bool following_keys_cleared; + bool following_keys_conflict; + bool is_conflict; + bool following_keys_unreadable; + bool is_unreadable; + + WriteMapEntry(KeyRef const& key, + OperationStack&& stack, + bool following_keys_cleared, + bool following_keys_conflict, + bool is_conflict, + bool following_keys_unreadable, + bool is_unreadable) + : key(key), stack(std::move(stack)), following_keys_cleared(following_keys_cleared), + following_keys_conflict(following_keys_conflict), is_conflict(is_conflict), + following_keys_unreadable(following_keys_unreadable), is_unreadable(is_unreadable) {} + + int compare(StringRef const& r) const { return key.compare(r); } + + int compare(ExtStringRef const& r) const { return -r.compare(key); } + + int compare(WriteMapEntry const& r) const { return key.compare(r.key); } + + std::string toString() const { return printable(key); } +}; + +inline int compare(StringRef const& l, WriteMapEntry const& r) { + return l.compare(r.key); +} + +inline int compare(ExtStringRef const& l, WriteMapEntry const& r) { + return l.compare(r.key); +} + +inline bool operator<(const WriteMapEntry& lhs, const WriteMapEntry& rhs) { + return lhs.key < rhs.key; +} +inline bool operator<(const WriteMapEntry& lhs, const StringRef& rhs) { + return lhs.key < rhs; +} +inline bool operator<(const StringRef& lhs, const WriteMapEntry& rhs) { + return lhs < rhs.key; +} +inline bool operator<(const WriteMapEntry& lhs, const ExtStringRef& rhs) { + return rhs.compare(lhs.key) > 0; +} +inline bool operator<(const ExtStringRef& lhs, const WriteMapEntry& rhs) { + return lhs.compare(rhs.key) < 0; +} + +class WriteMap { +private: + typedef PTreeImpl::PTree PTreeT; + typedef PTreeImpl::PTreeFinger PTreeFingerT; + typedef Reference Tree; + +public: + explicit WriteMap(Arena* arena) : arena(arena), writeMapEmpty(true), ver(-1), scratch_iterator(this) { + PTreeImpl::insert( + writes, ver, WriteMapEntry(allKeys.begin, OperationStack(), false, false, false, false, false)); + PTreeImpl::insert(writes, ver, WriteMapEntry(allKeys.end, OperationStack(), false, false, false, false, false)); + PTreeImpl::insert( + writes, ver, WriteMapEntry(afterAllKeys, OperationStack(), false, false, false, false, false)); + } + + WriteMap(WriteMap&& r) noexcept + : arena(r.arena), writeMapEmpty(r.writeMapEmpty), writes(std::move(r.writes)), ver(r.ver), + scratch_iterator(std::move(r.scratch_iterator)) {} + + WriteMap& operator=(WriteMap&& r) noexcept; + + // a write with addConflict false on top of an existing write with a conflict range will not remove the conflict + void mutate(KeyRef key, MutationRef::Type operation, ValueRef param, bool addConflict); + + void clear(KeyRangeRef keys, bool addConflict); + + void addUnmodifiedAndUnreadableRange(KeyRangeRef keys); + + void addConflictRange(KeyRangeRef keys); + + struct iterator { + // Iterates over three types of segments: unmodified ranges, cleared ranges, and modified keys. + // Modified keys may be dependent (need to be collapsed with a snapshot value) or independent (value is known + // regardless of the snapshot value) Every key will belong to exactly one segment. The first segment begins at + // "" and the last segment ends at \xff\xff. + + explicit iterator(WriteMap* map) : tree(map->writes), at(map->ver), offset(false) { ++map->ver; } + // Creates an iterator which is conceptually before the beginning of map (you may essentially only call skip() + // or ++ on it) This iterator also represents a snapshot (will be unaffected by future writes) + + enum SEGMENT_TYPE { UNMODIFIED_RANGE, CLEARED_RANGE, INDEPENDENT_WRITE, DEPENDENT_WRITE }; + + SEGMENT_TYPE type() const; + bool is_cleared_range() const { return offset && entry().following_keys_cleared; } + bool is_unmodified_range() const { return offset && !entry().following_keys_cleared; } + bool is_operation() const { return !offset; } + bool is_conflict_range() const { return offset ? entry().following_keys_conflict : entry().is_conflict; } + bool is_unreadable() const { return offset ? entry().following_keys_unreadable : entry().is_unreadable; } + + bool is_independent() const { + ASSERT(is_operation()); + return entry().following_keys_cleared || !entry().stack.isDependent(); + } + + ExtStringRef beginKey() const { return ExtStringRef(entry().key, offset && entry().stack.size()); } + ExtStringRef endKey() const { return offset ? nextEntry().key : ExtStringRef(entry().key, 1); } + + OperationStack const& op() const { + ASSERT(is_operation()); + return entry().stack; + } + + iterator& operator++(); + iterator& operator--(); + bool operator==(const iterator& r) const { + return offset == r.offset && beginLen == r.beginLen && finger[beginLen - 1] == r.finger[beginLen - 1]; + } + void skip(KeyRef key); + + private: + friend class WriteMap; + void reset(Tree const& tree, Version ver); + + WriteMapEntry const& entry() const { return finger[beginLen - 1]->data; } + WriteMapEntry const& nextEntry() const { return finger[endLen - 1]->data; } + + bool keyAtBegin() { return !offset || !entry().stack.size(); } + + Tree tree; + Version at; + int beginLen, endLen; + PTreeFingerT finger; + bool offset; // false-> the operation stack at entry(); true-> the following cleared or unmodified range + }; + + bool empty() const { return writeMapEmpty; } + + static RYWMutation coalesce(RYWMutation existingEntry, RYWMutation newEntry, Arena& arena); + static void coalesceOver(OperationStack& stack, RYWMutation newEntry, Arena& arena); + static RYWMutation coalesceUnder(OperationStack const& stack, Optional const& value, Arena& arena); + +private: + friend class ReadYourWritesTransaction; + Arena* arena; + bool writeMapEmpty; + Tree writes; + // an internal version number for the tree - no connection to database versions! Currently this is + // incremented after reads, so that consecutive writes have the same version and those separated by + // reads have different versions. + Version ver; + iterator scratch_iterator; // Avoid unnecessary memory allocation in write operations + + void dump(); + + // SOMEDAY: clearNoConflict replaces cleared sets with two map entries for everyone one item cleared + void clearNoConflict(KeyRangeRef keys); +}; + +/* + + for write in writes: # write.type in [ 'none', 'clear', 'independent', 'dependent' ] + for read in reads[ write.begin : write.end ]: # read.type in [ 'unknown', 'empty', 'value' ] + if write.type == "none": + yield read + elif write.type == "clear": + yield empty() + elif write.type == "independent": + yield value( write ) + else: # Dependent write + if read.type == "unknown": + yield read + else: + yield value( collapse( read, write ) ) + +*/ + +#endif diff --git a/src/fdbclient/include/fdbclient/fdb_c_options.g.h b/src/fdbclient/include/fdbclient/fdb_c_options.g.h new file mode 100644 index 0000000..93ea031 --- /dev/null +++ b/src/fdbclient/include/fdbclient/fdb_c_options.g.h @@ -0,0 +1,613 @@ +#ifndef FDB_C_OPTIONS_G_H +#define FDB_C_OPTIONS_G_H +#pragma once + +/* + * FoundationDB C API + * + * 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. + * Do not include this file directly. + */ + +typedef enum { + /* Deprecated */ + /* Parameter: (String) IP:PORT */ + FDB_NET_OPTION_LOCAL_ADDRESS=10, + + /* Deprecated */ + /* Parameter: (String) path to cluster file */ + FDB_NET_OPTION_CLUSTER_FILE=20, + + /* Enables trace output to a file in a directory of the clients choosing */ + /* Parameter: (String) path to output directory (or NULL for current working directory) */ + FDB_NET_OPTION_TRACE_ENABLE=30, + + /* Sets the maximum size in bytes of a single trace output file. This value should be in the range ``[0, INT64_MAX]``. If the value is set to 0, there is no limit on individual file size. The default is a maximum size of 10,485,760 bytes. */ + /* Parameter: (Int) max size of a single trace output file */ + FDB_NET_OPTION_TRACE_ROLL_SIZE=31, + + /* Sets the maximum size of all the trace output files put together. This value should be in the range ``[0, INT64_MAX]``. If the value is set to 0, there is no limit on the total size of the files. The default is a maximum size of 104,857,600 bytes. If the default roll size is used, this means that a maximum of 10 trace files will be written at a time. */ + /* Parameter: (Int) max total size of trace files */ + FDB_NET_OPTION_TRACE_MAX_LOGS_SIZE=32, + + /* Sets the 'LogGroup' attribute with the specified value for all events in the trace output files. The default log group is 'default'. */ + /* Parameter: (String) value of the LogGroup attribute */ + FDB_NET_OPTION_TRACE_LOG_GROUP=33, + + /* Select the format of the log files. xml (the default) and json are supported. */ + /* Parameter: (String) Format of trace files */ + FDB_NET_OPTION_TRACE_FORMAT=34, + + /* Select clock source for trace files. now (the default) or realtime are supported. */ + /* Parameter: (String) Trace clock source */ + FDB_NET_OPTION_TRACE_CLOCK_SOURCE=35, + + /* Once provided, this string will be used to replace the port/PID in the log file names. */ + /* Parameter: (String) The identifier that will be part of all trace file names */ + FDB_NET_OPTION_TRACE_FILE_IDENTIFIER=36, + + /* Use the same base trace file name for all client threads as it did before version 7.2. The current default behavior is to use distinct trace file names for client threads by including their version and thread index. */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_TRACE_SHARE_AMONG_CLIENT_THREADS=37, + + /* Initialize trace files on network setup, determine the local IP later. Otherwise tracing is initialized when opening the first database. */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_TRACE_INITIALIZE_ON_SETUP=38, + + /* Set file suffix for partially written log files. */ + /* Parameter: (String) Append this suffix to partially written log files. When a log file is complete, it is renamed to remove the suffix. No separator is added between the file and the suffix. If you want to add a file extension, you should include the separator - e.g. '.tmp' instead of 'tmp' to add the 'tmp' extension. */ + FDB_NET_OPTION_TRACE_PARTIAL_FILE_SUFFIX=39, + + /* Set internal tuning or debugging knobs */ + /* Parameter: (String) knob_name=knob_value */ + FDB_NET_OPTION_KNOB=40, + + /* Deprecated */ + /* Parameter: (String) file path or linker-resolved name */ + FDB_NET_OPTION_TLS_PLUGIN=41, + + /* Set the certificate chain */ + /* Parameter: (Bytes) certificates */ + FDB_NET_OPTION_TLS_CERT_BYTES=42, + + /* Set the file from which to load the certificate chain */ + /* Parameter: (String) file path */ + FDB_NET_OPTION_TLS_CERT_PATH=43, + + /* Set the private key corresponding to your own certificate */ + /* Parameter: (Bytes) key */ + FDB_NET_OPTION_TLS_KEY_BYTES=45, + + /* Set the file from which to load the private key corresponding to your own certificate */ + /* Parameter: (String) file path */ + FDB_NET_OPTION_TLS_KEY_PATH=46, + + /* Set the peer certificate field verification criteria */ + /* Parameter: (Bytes) verification pattern */ + FDB_NET_OPTION_TLS_VERIFY_PEERS=47, + + /* */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_BUGGIFY_ENABLE=48, + + /* */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_BUGGIFY_DISABLE=49, + + /* Set the probability of a BUGGIFY section being active for the current execution. Only applies to code paths first traversed AFTER this option is changed. */ + /* Parameter: (Int) probability expressed as a percentage between 0 and 100 */ + FDB_NET_OPTION_BUGGIFY_SECTION_ACTIVATED_PROBABILITY=50, + + /* Set the probability of an active BUGGIFY section being fired */ + /* Parameter: (Int) probability expressed as a percentage between 0 and 100 */ + FDB_NET_OPTION_BUGGIFY_SECTION_FIRED_PROBABILITY=51, + + /* Set the ca bundle */ + /* Parameter: (Bytes) ca bundle */ + FDB_NET_OPTION_TLS_CA_BYTES=52, + + /* Set the file from which to load the certificate authority bundle */ + /* Parameter: (String) file path */ + FDB_NET_OPTION_TLS_CA_PATH=53, + + /* Set the passphrase for encrypted private key. Password should be set before setting the key for the password to be used. */ + /* Parameter: (String) key passphrase */ + FDB_NET_OPTION_TLS_PASSWORD=54, + + /* Disables the multi-version client API and instead uses the local client directly. Must be set before setting up the network. */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_DISABLE_MULTI_VERSION_CLIENT_API=60, + + /* If set, callbacks from external client libraries can be called from threads created by the FoundationDB client library. Otherwise, callbacks will be called from either the thread used to add the callback or the network thread. Setting this option can improve performance when connected using an external client, but may not be safe to use in all environments. Must be set before setting up the network. WARNING: This feature is considered experimental at this time. */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_CALLBACKS_ON_EXTERNAL_THREADS=61, + + /* Adds an external client library for use by the multi-version client API. Must be set before setting up the network. */ + /* Parameter: (String) path to client library */ + FDB_NET_OPTION_EXTERNAL_CLIENT_LIBRARY=62, + + /* Searches the specified path for dynamic libraries and adds them to the list of client libraries for use by the multi-version client API. Must be set before setting up the network. */ + /* Parameter: (String) path to directory containing client libraries */ + FDB_NET_OPTION_EXTERNAL_CLIENT_DIRECTORY=63, + + /* Prevents connections through the local client, allowing only connections through externally loaded client libraries. */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_DISABLE_LOCAL_CLIENT=64, + + /* Spawns multiple worker threads for each version of the client that is loaded. Setting this to a number greater than one implies disable_local_client. */ + /* Parameter: (Int) Number of client threads to be spawned. Each cluster will be serviced by a single client thread. */ + FDB_NET_OPTION_CLIENT_THREADS_PER_VERSION=65, + + /* Adds an external client library to be used with a future version protocol. This option can be used testing purposes only! */ + /* Parameter: (String) path to client library */ + FDB_NET_OPTION_FUTURE_VERSION_CLIENT_LIBRARY=66, + + /* Retain temporary external client library copies that are created for enabling multi-threading. */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_RETAIN_CLIENT_LIBRARY_COPIES=67, + + /* Ignore the failure to initialize some of the external clients */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_IGNORE_EXTERNAL_CLIENT_FAILURES=68, + + /* Fail with an error if there is no client matching the server version the client is connecting to */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_FAIL_INCOMPATIBLE_CLIENT=69, + + /* Disables logging of client statistics, such as sampled transaction activity. */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_DISABLE_CLIENT_STATISTICS_LOGGING=70, + + /* Deprecated */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_ENABLE_SLOW_TASK_PROFILING=71, + + /* Enables debugging feature to perform run loop profiling. Requires trace logging to be enabled. WARNING: this feature is not recommended for use in production. */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_ENABLE_RUN_LOOP_PROFILING=71, + + /* Prevents the multi-version client API from being disabled, even if no external clients are configured. This option is required to use GRV caching. */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_DISABLE_CLIENT_BYPASS=72, + + /* Enable client buggify - will make requests randomly fail (intended for client testing) */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_CLIENT_BUGGIFY_ENABLE=80, + + /* Disable client buggify */ + /* Parameter: Option takes no parameter */ + FDB_NET_OPTION_CLIENT_BUGGIFY_DISABLE=81, + + /* Set the probability of a CLIENT_BUGGIFY section being active for the current execution. */ + /* Parameter: (Int) probability expressed as a percentage between 0 and 100 */ + FDB_NET_OPTION_CLIENT_BUGGIFY_SECTION_ACTIVATED_PROBABILITY=82, + + /* Set the probability of an active CLIENT_BUGGIFY section being fired. A section will only fire if it was activated */ + /* Parameter: (Int) probability expressed as a percentage between 0 and 100 */ + FDB_NET_OPTION_CLIENT_BUGGIFY_SECTION_FIRED_PROBABILITY=83, + + /* Set a tracer to run on the client. Should be set to the same value as the tracer set on the server. */ + /* Parameter: (String) Distributed tracer type. Choose from none, log_file, or network_lossy */ + FDB_NET_OPTION_DISTRIBUTED_CLIENT_TRACER=90, + + /* Sets the directory for storing temporary files created by FDB client, such as temporary copies of client libraries. Defaults to /tmp */ + /* Parameter: (String) Client directory for temporary files. */ + FDB_NET_OPTION_CLIENT_TMP_DIR=91, + + /* This option is set automatically to communicate the list of supported clients to the active client. */ + /* Parameter: (String) [release version],[source version],[protocol version];... This is a hidden parameter and should not be used directly by applications.*/ + FDB_NET_OPTION_SUPPORTED_CLIENT_VERSIONS=1000, + + /* This option is set automatically on all clients loaded externally using the multi-version API. */ + /* Parameter: Option takes no parameter This is a hidden parameter and should not be used directly by applications.*/ + FDB_NET_OPTION_EXTERNAL_CLIENT=1001, + + /* This option tells a child on a multiversion client what transport ID to use. */ + /* Parameter: (Int) Transport ID for the child connection This is a hidden parameter and should not be used directly by applications.*/ + FDB_NET_OPTION_EXTERNAL_CLIENT_TRANSPORT_ID=1002 +} FDBNetworkOption; + +typedef enum { + /* Set the size of the client location cache. Raising this value can boost performance in very large databases where clients access data in a near-random pattern. Defaults to 100000. */ + /* Parameter: (Int) Max location cache entries */ + FDB_DB_OPTION_LOCATION_CACHE_SIZE=10, + + /* Set the maximum number of watches allowed to be outstanding on a database connection. Increasing this number could result in increased resource usage. Reducing this number will not cancel any outstanding watches. Defaults to 10000 and cannot be larger than 1000000. */ + /* Parameter: (Int) Max outstanding watches */ + FDB_DB_OPTION_MAX_WATCHES=20, + + /* Specify the machine ID that was passed to fdbserver processes running on the same machine as this client, for better location-aware load balancing. */ + /* Parameter: (String) Hexadecimal ID */ + FDB_DB_OPTION_MACHINE_ID=21, + + /* Specify the datacenter ID that was passed to fdbserver processes running in the same datacenter as this client, for better location-aware load balancing. */ + /* Parameter: (String) Hexadecimal ID */ + FDB_DB_OPTION_DATACENTER_ID=22, + + /* Snapshot read operations will see the results of writes done in the same transaction. This is the default behavior. */ + /* Parameter: Option takes no parameter */ + FDB_DB_OPTION_SNAPSHOT_RYW_ENABLE=26, + + /* Snapshot read operations will not see the results of writes done in the same transaction. This was the default behavior prior to API version 300. */ + /* Parameter: Option takes no parameter */ + FDB_DB_OPTION_SNAPSHOT_RYW_DISABLE=27, + + /* Sets the maximum escaped length of key and value fields to be logged to the trace file via the LOG_TRANSACTION option. This sets the ``transaction_logging_max_field_length`` option of each transaction created by this database. See the transaction option description for more information. */ + /* Parameter: (Int) Maximum length of escaped key and value fields. */ + FDB_DB_OPTION_TRANSACTION_LOGGING_MAX_FIELD_LENGTH=405, + + /* Set a timeout in milliseconds which, when elapsed, will cause each transaction automatically to be cancelled. This sets the ``timeout`` option of each transaction created by this database. See the transaction option description for more information. Using this option requires that the API version is 610 or higher. */ + /* Parameter: (Int) value in milliseconds of timeout */ + FDB_DB_OPTION_TRANSACTION_TIMEOUT=500, + + /* Set a maximum number of retries after which additional calls to ``onError`` will throw the most recently seen error code. This sets the ``retry_limit`` option of each transaction created by this database. See the transaction option description for more information. */ + /* Parameter: (Int) number of times to retry */ + FDB_DB_OPTION_TRANSACTION_RETRY_LIMIT=501, + + /* Set the maximum amount of backoff delay incurred in the call to ``onError`` if the error is retryable. This sets the ``max_retry_delay`` option of each transaction created by this database. See the transaction option description for more information. */ + /* Parameter: (Int) value in milliseconds of maximum delay */ + FDB_DB_OPTION_TRANSACTION_MAX_RETRY_DELAY=502, + + /* Set the maximum transaction size in bytes. This sets the ``size_limit`` option on each transaction created by this database. See the transaction option description for more information. */ + /* Parameter: (Int) value in bytes */ + FDB_DB_OPTION_TRANSACTION_SIZE_LIMIT=503, + + /* The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock. */ + /* Parameter: Option takes no parameter */ + FDB_DB_OPTION_TRANSACTION_CAUSAL_READ_RISKY=504, + + /* Deprecated. Addresses returned by get_addresses_for_key include the port when enabled. As of api version 630, this option is enabled by default and setting this has no effect. */ + /* Parameter: Option takes no parameter */ + FDB_DB_OPTION_TRANSACTION_INCLUDE_PORT_IN_ADDRESS=505, + + /* Set a random idempotency id for all transactions. See the transaction option description for more information. This feature is in development and not ready for general use. */ + /* Parameter: Option takes no parameter */ + FDB_DB_OPTION_TRANSACTION_AUTOMATIC_IDEMPOTENCY=506, + + /* Allows ``get`` operations to read from sections of keyspace that have become unreadable because of versionstamp operations. This sets the ``bypass_unreadable`` option of each transaction created by this database. See the transaction option description for more information. */ + /* Parameter: Option takes no parameter */ + FDB_DB_OPTION_TRANSACTION_BYPASS_UNREADABLE=700, + + /* By default, operations that are performed on a transaction while it is being committed will not only fail themselves, but they will attempt to fail other in-flight operations (such as the commit) as well. This behavior is intended to help developers discover situations where operations could be unintentionally executed after the transaction has been reset. Setting this option removes that protection, causing only the offending operation to fail. */ + /* Parameter: Option takes no parameter */ + FDB_DB_OPTION_TRANSACTION_USED_DURING_COMMIT_PROTECTION_DISABLE=701, + + /* Enables conflicting key reporting on all transactions, allowing them to retrieve the keys that are conflicting with other transactions. */ + /* Parameter: Option takes no parameter */ + FDB_DB_OPTION_TRANSACTION_REPORT_CONFLICTING_KEYS=702, + + /* Use configuration database. */ + /* Parameter: Option takes no parameter */ + FDB_DB_OPTION_USE_CONFIG_DATABASE=800, + + /* Enables verification of causal read risky by checking whether clients are able to read stale data when they detect a recovery, and logging an error if so. */ + /* Parameter: (Int) integer between 0 and 100 expressing the probability a client will verify it can't read stale data */ + FDB_DB_OPTION_TEST_CAUSAL_READ_RISKY=900 +} FDBDatabaseOption; + +typedef enum { + /* The transaction, if not self-conflicting, may be committed a second time after commit succeeds, in the event of a fault */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_CAUSAL_WRITE_RISKY=10, + + /* The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_CAUSAL_READ_RISKY=20, + + /* */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_CAUSAL_READ_DISABLE=21, + + /* Addresses returned by get_addresses_for_key include the port when enabled. As of api version 630, this option is enabled by default and setting this has no effect. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_INCLUDE_PORT_IN_ADDRESS=23, + + /* The next write performed on this transaction will not generate a write conflict range. As a result, other transactions which read the key(s) being modified by the next write will not conflict with this transaction. Care needs to be taken when using this option on a transaction that is shared between multiple threads. When setting this option, write conflict ranges will be disabled on the next write operation, regardless of what thread it is on. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_NEXT_WRITE_NO_WRITE_CONFLICT_RANGE=30, + + /* Committing this transaction will bypass the normal load balancing across commit proxies and go directly to the specifically nominated 'first commit proxy'. */ + /* Parameter: Option takes no parameter This is a hidden parameter and should not be used directly by applications.*/ + FDB_TR_OPTION_COMMIT_ON_FIRST_PROXY=40, + + /* */ + /* Parameter: Option takes no parameter This is a hidden parameter and should not be used directly by applications.*/ + FDB_TR_OPTION_CHECK_WRITES_ENABLE=50, + + /* Reads performed by a transaction will not see any prior mutations that occured in that transaction, instead seeing the value which was in the database at the transaction's read version. This option may provide a small performance benefit for the client, but also disables a number of client-side optimizations which are beneficial for transactions which tend to read and write the same keys within a single transaction. It is an error to set this option after performing any reads or writes on the transaction. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_READ_YOUR_WRITES_DISABLE=51, + + /* Deprecated */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_READ_AHEAD_DISABLE=52, + + /* Storage server should cache disk blocks needed for subsequent read requests in this transaction. This is the default behavior. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_READ_SERVER_SIDE_CACHE_ENABLE=507, + + /* Storage server should not cache disk blocks needed for subsequent read requests in this transaction. This can be used to avoid cache pollution for reads not expected to be repeated. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_READ_SERVER_SIDE_CACHE_DISABLE=508, + + /* Use normal read priority for subsequent read requests in this transaction. This is the default read priority. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_READ_PRIORITY_NORMAL=509, + + /* Use low read priority for subsequent read requests in this transaction. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_READ_PRIORITY_LOW=510, + + /* Use high read priority for subsequent read requests in this transaction. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_READ_PRIORITY_HIGH=511, + + /* */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_DURABILITY_DATACENTER=110, + + /* */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_DURABILITY_RISKY=120, + + /* Deprecated */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_DURABILITY_DEV_NULL_IS_WEB_SCALE=130, + + /* Specifies that this transaction should be treated as highest priority and that lower priority transactions should block behind this one. Use is discouraged outside of low-level tools */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_PRIORITY_SYSTEM_IMMEDIATE=200, + + /* Specifies that this transaction should be treated as low priority and that default priority transactions will be processed first. Batch priority transactions will also be throttled at load levels smaller than for other types of transactions and may be fully cut off in the event of machine failures. Useful for doing batch work simultaneously with latency-sensitive work */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_PRIORITY_BATCH=201, + + /* This is a write-only transaction which sets the initial configuration. This option is designed for use by database system tools only. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_INITIALIZE_NEW_DATABASE=300, + + /* Allows this transaction to read and modify system keys (those that start with the byte 0xFF). Implies raw_access. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_ACCESS_SYSTEM_KEYS=301, + + /* Allows this transaction to read system keys (those that start with the byte 0xFF). Implies raw_access. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_READ_SYSTEM_KEYS=302, + + /* Allows this transaction to access the raw key-space when tenant mode is on. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_RAW_ACCESS=303, + + /* Allows this transaction to bypass storage quota enforcement. Should only be used for transactions that directly or indirectly decrease the size of the tenant group's data. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_BYPASS_STORAGE_QUOTA=304, + + /* */ + /* Parameter: Option takes no parameter This is a hidden parameter and should not be used directly by applications.*/ + FDB_TR_OPTION_DEBUG_DUMP=400, + + /* */ + /* Parameter: (String) Optional transaction name */ + FDB_TR_OPTION_DEBUG_RETRY_LOGGING=401, + + /* Deprecated */ + /* Parameter: (String) String identifier to be used in the logs when tracing this transaction. The identifier must not exceed 100 characters. */ + FDB_TR_OPTION_TRANSACTION_LOGGING_ENABLE=402, + + /* Sets a client provided identifier for the transaction that will be used in scenarios like tracing or profiling. Client trace logging or transaction profiling must be separately enabled. */ + /* Parameter: (String) String identifier to be used when tracing or profiling this transaction. The identifier must not exceed 100 characters. */ + FDB_TR_OPTION_DEBUG_TRANSACTION_IDENTIFIER=403, + + /* Enables tracing for this transaction and logs results to the client trace logs. The DEBUG_TRANSACTION_IDENTIFIER option must be set before using this option, and client trace logging must be enabled to get log output. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_LOG_TRANSACTION=404, + + /* Sets the maximum escaped length of key and value fields to be logged to the trace file via the LOG_TRANSACTION option, after which the field will be truncated. A negative value disables truncation. */ + /* Parameter: (Int) Maximum length of escaped key and value fields. */ + FDB_TR_OPTION_TRANSACTION_LOGGING_MAX_FIELD_LENGTH=405, + + /* Sets an identifier for server tracing of this transaction. When committed, this identifier triggers logging when each part of the transaction authority encounters it, which is helpful in diagnosing slowness in misbehaving clusters. The identifier is randomly generated. When there is also a debug_transaction_identifier, both IDs are logged together. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_SERVER_REQUEST_TRACING=406, + + /* Set a timeout in milliseconds which, when elapsed, will cause the transaction automatically to be cancelled. Valid parameter values are ``[0, INT_MAX]``. If set to 0, will disable all timeouts. All pending and any future uses of the transaction will throw an exception. The transaction can be used again after it is reset. Prior to API version 610, like all other transaction options, the timeout must be reset after a call to ``onError``. If the API version is 610 or greater, the timeout is not reset after an ``onError`` call. This allows the user to specify a longer timeout on specific transactions than the default timeout specified through the ``transaction_timeout`` database option without the shorter database timeout cancelling transactions that encounter a retryable error. Note that at all API versions, it is safe and legal to set the timeout each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option. */ + /* Parameter: (Int) value in milliseconds of timeout */ + FDB_TR_OPTION_TIMEOUT=500, + + /* Set a maximum number of retries after which additional calls to ``onError`` will throw the most recently seen error code. Valid parameter values are ``[-1, INT_MAX]``. If set to -1, will disable the retry limit. Prior to API version 610, like all other transaction options, the retry limit must be reset after a call to ``onError``. If the API version is 610 or greater, the retry limit is not reset after an ``onError`` call. Note that at all API versions, it is safe and legal to set the retry limit each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option. */ + /* Parameter: (Int) number of times to retry */ + FDB_TR_OPTION_RETRY_LIMIT=501, + + /* Set the maximum amount of backoff delay incurred in the call to ``onError`` if the error is retryable. Defaults to 1000 ms. Valid parameter values are ``[0, INT_MAX]``. If the maximum retry delay is less than the current retry delay of the transaction, then the current retry delay will be clamped to the maximum retry delay. Prior to API version 610, like all other transaction options, the maximum retry delay must be reset after a call to ``onError``. If the API version is 610 or greater, the retry limit is not reset after an ``onError`` call. Note that at all API versions, it is safe and legal to set the maximum retry delay each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option. */ + /* Parameter: (Int) value in milliseconds of maximum delay */ + FDB_TR_OPTION_MAX_RETRY_DELAY=502, + + /* Set the transaction size limit in bytes. The size is calculated by combining the sizes of all keys and values written or mutated, all key ranges cleared, and all read and write conflict ranges. (In other words, it includes the total size of all data included in the request to the cluster to commit the transaction.) Large transactions can cause performance problems on FoundationDB clusters, so setting this limit to a smaller value than the default can help prevent the client from accidentally degrading the cluster's performance. This value must be at least 32 and cannot be set to higher than 10,000,000, the default transaction size limit. */ + /* Parameter: (Int) value in bytes */ + FDB_TR_OPTION_SIZE_LIMIT=503, + + /* Associate this transaction with this ID for the purpose of checking whether or not this transaction has already committed. Must be at least 16 bytes and less than 256 bytes. This feature is in development and not ready for general use. Unless the automatic_idempotency option is set after this option, the client will not automatically attempt to remove this id from the cluster after a successful commit. */ + /* Parameter: (String) Unique ID This is a hidden parameter and should not be used directly by applications.*/ + FDB_TR_OPTION_IDEMPOTENCY_ID=504, + + /* Automatically assign a random 16 byte idempotency id for this transaction. Prevents commits from failing with ``commit_unknown_result``. WARNING: If you are also using the multiversion client or transaction timeouts, if either cluster_version_changed or transaction_timed_out was thrown during a commit, then that commit may have already succeeded or may succeed in the future. This feature is in development and not ready for general use. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_AUTOMATIC_IDEMPOTENCY=505, + + /* Snapshot read operations will see the results of writes done in the same transaction. This is the default behavior. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_SNAPSHOT_RYW_ENABLE=600, + + /* Snapshot read operations will not see the results of writes done in the same transaction. This was the default behavior prior to API version 300. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_SNAPSHOT_RYW_DISABLE=601, + + /* The transaction can read and write to locked databases, and is responsible for checking that it took the lock. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_LOCK_AWARE=700, + + /* By default, operations that are performed on a transaction while it is being committed will not only fail themselves, but they will attempt to fail other in-flight operations (such as the commit) as well. This behavior is intended to help developers discover situations where operations could be unintentionally executed after the transaction has been reset. Setting this option removes that protection, causing only the offending operation to fail. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_USED_DURING_COMMIT_PROTECTION_DISABLE=701, + + /* The transaction can read from locked databases. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_READ_LOCK_AWARE=702, + + /* No other transactions will be applied before this transaction within the same commit version. */ + /* Parameter: Option takes no parameter This is a hidden parameter and should not be used directly by applications.*/ + FDB_TR_OPTION_FIRST_IN_BATCH=710, + + /* This option should only be used by tools which change the database configuration. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_USE_PROVISIONAL_PROXIES=711, + + /* The transaction can retrieve keys that are conflicting with other transactions. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_REPORT_CONFLICTING_KEYS=712, + + /* By default, the special key space will only allow users to read from exactly one module (a subspace in the special key space). Use this option to allow reading from zero or more modules. Users who set this option should be prepared for new modules, which may have different behaviors than the modules they're currently reading. For example, a new module might block or return an error. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_SPECIAL_KEY_SPACE_RELAXED=713, + + /* By default, users are not allowed to write to special keys. Enable this option will implicitly enable all options required to achieve the configuration change. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_SPECIAL_KEY_SPACE_ENABLE_WRITES=714, + + /* Adds a tag to the transaction that can be used to apply manual targeted throttling. At most 5 tags can be set on a transaction. */ + /* Parameter: (String) String identifier used to associated this transaction with a throttling group. Must not exceed 16 characters. */ + FDB_TR_OPTION_TAG=800, + + /* Adds a tag to the transaction that can be used to apply manual or automatic targeted throttling. At most 5 tags can be set on a transaction. */ + /* Parameter: (String) String identifier used to associated this transaction with a throttling group. Must not exceed 16 characters. */ + FDB_TR_OPTION_AUTO_THROTTLE_TAG=801, + + /* Adds a parent to the Span of this transaction. Used for transaction tracing. A span can be identified with any 16 bytes */ + /* Parameter: (Bytes) A byte string of length 16 used to associate the span of this transaction with a parent */ + FDB_TR_OPTION_SPAN_PARENT=900, + + /* Asks storage servers for how many bytes a clear key range contains. Otherwise uses the location cache to roughly estimate this. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_EXPENSIVE_CLEAR_COST_ESTIMATION_ENABLE=1000, + + /* Allows ``get`` operations to read from sections of keyspace that have become unreadable because of versionstamp operations. These reads will view versionstamp operations as if they were set operations that did not fill in the versionstamp. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_BYPASS_UNREADABLE=1100, + + /* Allows this transaction to use cached GRV from the database context. Defaults to off. Upon first usage, starts a background updater to periodically update the cache to avoid stale read versions. The disable_client_bypass option must also be set. */ + /* Parameter: Option takes no parameter */ + FDB_TR_OPTION_USE_GRV_CACHE=1101, + + /* Specifically instruct this transaction to NOT use cached GRV. Primarily used for the read version cache's background updater to avoid attempting to read a cached entry in specific situations. */ + /* Parameter: Option takes no parameter This is a hidden parameter and should not be used directly by applications.*/ + FDB_TR_OPTION_SKIP_GRV_CACHE=1102, + + /* Attach given authorization token to the transaction such that subsequent tenant-aware requests are authorized */ + /* Parameter: (String) A JSON Web Token authorized to access data belonging to one or more tenants, indicated by 'tenants' claim of the token's payload. */ + FDB_TR_OPTION_AUTHORIZATION_TOKEN=2000 +} FDBTransactionOption; + +typedef enum { + /* Client intends to consume the entire range and would like it all transferred as early as possible. */ + FDB_STREAMING_MODE_WANT_ALL=-2, + + /* The default. The client doesn't know how much of the range it is likely to used and wants different performance concerns to be balanced. Only a small portion of data is transferred to the client initially (in order to minimize costs if the client doesn't read the entire range), and as the caller iterates over more items in the range larger batches will be transferred in order to minimize latency. After enough iterations, the iterator mode will eventually reach the same byte limit as ``WANT_ALL`` */ + FDB_STREAMING_MODE_ITERATOR=-1, + + /* Infrequently used. The client has passed a specific row limit and wants that many rows delivered in a single batch. Because of iterator operation in client drivers make request batches transparent to the user, consider ``WANT_ALL`` StreamingMode instead. A row limit must be specified if this mode is used. */ + FDB_STREAMING_MODE_EXACT=0, + + /* Infrequently used. Transfer data in batches small enough to not be much more expensive than reading individual rows, to minimize cost if iteration stops early. */ + FDB_STREAMING_MODE_SMALL=1, + + /* Infrequently used. Transfer data in batches sized in between small and large. */ + FDB_STREAMING_MODE_MEDIUM=2, + + /* Infrequently used. Transfer data in batches large enough to be, in a high-concurrency environment, nearly as efficient as possible. If the client stops iteration early, some disk and network bandwidth may be wasted. The batch size may still be too small to allow a single client to get high throughput from the database, so if that is what you need consider the SERIAL StreamingMode. */ + FDB_STREAMING_MODE_LARGE=3, + + /* Transfer data in batches large enough that an individual client can get reasonable read bandwidth from the database. If the client stops iteration early, considerable disk and network bandwidth may be wasted. */ + FDB_STREAMING_MODE_SERIAL=4 +} FDBStreamingMode; + +typedef enum { + /* Performs an addition of little-endian integers. If the existing value in the database is not present or shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``. The integers to be added must be stored in a little-endian representation. They can be signed in two's complement representation or unsigned. You can add to an integer at a known offset in the value by prepending the appropriate number of zero bytes to ``param`` and padding with zero bytes to match the length of the value. However, this offset technique requires that you know the addition will not cause the integer field within the value to overflow. */ + FDB_MUTATION_TYPE_ADD=2, + + /* Deprecated */ + FDB_MUTATION_TYPE_AND=6, + + /* Performs a bitwise ``and`` operation. If the existing value in the database is not present, then ``param`` is stored in the database. If the existing value in the database is shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``. */ + FDB_MUTATION_TYPE_BIT_AND=6, + + /* Deprecated */ + FDB_MUTATION_TYPE_OR=7, + + /* Performs a bitwise ``or`` operation. If the existing value in the database is not present or shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``. */ + FDB_MUTATION_TYPE_BIT_OR=7, + + /* Deprecated */ + FDB_MUTATION_TYPE_XOR=8, + + /* Performs a bitwise ``xor`` operation. If the existing value in the database is not present or shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``. */ + FDB_MUTATION_TYPE_BIT_XOR=8, + + /* Appends ``param`` to the end of the existing value already in the database at the given key (or creates the key and sets the value to ``param`` if the key is empty). This will only append the value if the final concatenated value size is less than or equal to the maximum value size (i.e., if it fits). WARNING: No error is surfaced back to the user if the final value is too large because the mutation will not be applied until after the transaction has been committed. Therefore, it is only safe to use this mutation type if one can guarantee that one will keep the total value size under the maximum size. */ + FDB_MUTATION_TYPE_APPEND_IF_FITS=9, + + /* Performs a little-endian comparison of byte strings. If the existing value in the database is not present or shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``. The larger of the two values is then stored in the database. */ + FDB_MUTATION_TYPE_MAX=12, + + /* Performs a little-endian comparison of byte strings. If the existing value in the database is not present, then ``param`` is stored in the database. If the existing value in the database is shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``. The smaller of the two values is then stored in the database. */ + FDB_MUTATION_TYPE_MIN=13, + + /* Transforms ``key`` using a versionstamp for the transaction. Sets the transformed key in the database to ``param``. The key is transformed by removing the final four bytes from the key and reading those as a little-Endian 32-bit integer to get a position ``pos``. The 10 bytes of the key from ``pos`` to ``pos + 10`` are replaced with the versionstamp of the transaction used. The first byte of the key is position 0. A versionstamp is a 10 byte, unique, monotonically (but not sequentially) increasing value for each committed transaction. The first 8 bytes are the committed version of the database (serialized in big-Endian order). The last 2 bytes are monotonic in the serialization order for transactions. WARNING: At this time, versionstamps are compatible with the Tuple layer only in the Java, Python, and Go bindings. Also, note that prior to API version 520, the offset was computed from only the final two bytes rather than the final four bytes. */ + FDB_MUTATION_TYPE_SET_VERSIONSTAMPED_KEY=14, + + /* Transforms ``param`` using a versionstamp for the transaction. Sets the ``key`` given to the transformed ``param``. The parameter is transformed by removing the final four bytes from ``param`` and reading those as a little-Endian 32-bit integer to get a position ``pos``. The 10 bytes of the parameter from ``pos`` to ``pos + 10`` are replaced with the versionstamp of the transaction used. The first byte of the parameter is position 0. A versionstamp is a 10 byte, unique, monotonically (but not sequentially) increasing value for each committed transaction. The first 8 bytes are the committed version of the database (serialized in big-Endian order). The last 2 bytes are monotonic in the serialization order for transactions. WARNING: At this time, versionstamps are compatible with the Tuple layer only in the Java, Python, and Go bindings. Also, note that prior to API version 520, the versionstamp was always placed at the beginning of the parameter rather than computing an offset. */ + FDB_MUTATION_TYPE_SET_VERSIONSTAMPED_VALUE=15, + + /* Performs lexicographic comparison of byte strings. If the existing value in the database is not present, then ``param`` is stored. Otherwise the smaller of the two values is then stored in the database. */ + FDB_MUTATION_TYPE_BYTE_MIN=16, + + /* Performs lexicographic comparison of byte strings. If the existing value in the database is not present, then ``param`` is stored. Otherwise the larger of the two values is then stored in the database. */ + FDB_MUTATION_TYPE_BYTE_MAX=17, + + /* Performs an atomic ``compare and clear`` operation. If the existing value in the database is equal to the given value, then given key is cleared. */ + FDB_MUTATION_TYPE_COMPARE_AND_CLEAR=20 +} FDBMutationType; + +typedef enum { + /* Used to add a read conflict range */ + FDB_CONFLICT_RANGE_TYPE_READ=0, + + /* Used to add a write conflict range */ + FDB_CONFLICT_RANGE_TYPE_WRITE=1 +} FDBConflictRangeType; + +typedef enum { + /* Returns ``true`` if the error indicates the operations in the transactions should be retried because of transient error. */ + FDB_ERROR_PREDICATE_RETRYABLE=50000, + + /* Returns ``true`` if the error indicates the transaction may have succeeded, though not in a way the system can verify. */ + FDB_ERROR_PREDICATE_MAYBE_COMMITTED=50001, + + /* Returns ``true`` if the error indicates the transaction has not committed, though in a way that can be retried. */ + FDB_ERROR_PREDICATE_RETRYABLE_NOT_COMMITTED=50002 +} FDBErrorPredicate; + +#endif diff --git a/src/fdbclient/json_spirit/json_spirit_error_position.h b/src/fdbclient/include/fdbclient/json_spirit/json_spirit_error_position.h similarity index 100% rename from src/fdbclient/json_spirit/json_spirit_error_position.h rename to src/fdbclient/include/fdbclient/json_spirit/json_spirit_error_position.h diff --git a/src/fdbclient/json_spirit/json_spirit_reader_template.h b/src/fdbclient/include/fdbclient/json_spirit/json_spirit_reader_template.h similarity index 100% rename from src/fdbclient/json_spirit/json_spirit_reader_template.h rename to src/fdbclient/include/fdbclient/json_spirit/json_spirit_reader_template.h diff --git a/src/fdbclient/json_spirit/json_spirit_value.h b/src/fdbclient/include/fdbclient/json_spirit/json_spirit_value.h similarity index 100% rename from src/fdbclient/json_spirit/json_spirit_value.h rename to src/fdbclient/include/fdbclient/json_spirit/json_spirit_value.h diff --git a/src/fdbclient/json_spirit/json_spirit_writer_options.h b/src/fdbclient/include/fdbclient/json_spirit/json_spirit_writer_options.h similarity index 100% rename from src/fdbclient/json_spirit/json_spirit_writer_options.h rename to src/fdbclient/include/fdbclient/json_spirit/json_spirit_writer_options.h diff --git a/src/fdbclient/json_spirit/json_spirit_writer_template.h b/src/fdbclient/include/fdbclient/json_spirit/json_spirit_writer_template.h similarity index 100% rename from src/fdbclient/json_spirit/json_spirit_writer_template.h rename to src/fdbclient/include/fdbclient/json_spirit/json_spirit_writer_template.h diff --git a/src/fdbclient/sha1/SHA1.h b/src/fdbclient/include/fdbclient/sha1/SHA1.h similarity index 100% rename from src/fdbclient/sha1/SHA1.h rename to src/fdbclient/include/fdbclient/sha1/SHA1.h diff --git a/src/fdbclient/include/fdbclient/versions.h b/src/fdbclient/include/fdbclient/versions.h new file mode 100644 index 0000000..c4423d1 --- /dev/null +++ b/src/fdbclient/include/fdbclient/versions.h @@ -0,0 +1,3 @@ +#pragma once +#define FDB_VT_VERSION "7.3.25" +#define FDB_VT_PACKAGE_NAME "7.3" diff --git a/src/fdbclient/zipf.h b/src/fdbclient/include/fdbclient/zipf.h similarity index 100% rename from src/fdbclient/zipf.h rename to src/fdbclient/include/fdbclient/zipf.h diff --git a/src/fdbclient/sha1/SHA1.cpp b/src/fdbclient/sha1/SHA1.cpp index 06e08fb..ba63a04 100644 --- a/src/fdbclient/sha1/SHA1.cpp +++ b/src/fdbclient/sha1/SHA1.cpp @@ -13,7 +13,7 @@ -- Volker Grabsch */ -#include "SHA1.h" +#include "fdbclient/sha1/SHA1.h" #include #include #include diff --git a/src/fdbclient/versions.h b/src/fdbclient/versions.h deleted file mode 100644 index 216c74a..0000000 --- a/src/fdbclient/versions.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once -#define FDB_VT_VERSION "7.1.41" -#define FDB_VT_PACKAGE_NAME "7.1" diff --git a/src/fdbclient/zipf.c b/src/fdbclient/zipf.c index 9100626..dfc183f 100644 --- a/src/fdbclient/zipf.c +++ b/src/fdbclient/zipf.c @@ -7,7 +7,7 @@ #include #include #include -#include "zipf.h" +#include "fdbclient/zipf.h" /* global static */ static int items; diff --git a/src/fdbrpc/AsyncFileCached.actor.cpp b/src/fdbrpc/AsyncFileCached.actor.cpp index 93bf9cf..340b925 100644 --- a/src/fdbrpc/AsyncFileCached.actor.cpp +++ b/src/fdbrpc/AsyncFileCached.actor.cpp @@ -193,14 +193,14 @@ Future AsyncFileCached::changeFileSize(int64_t size) { prevLength = size; if (offsetInPage) { - TEST(true); // Truncating to the middle of a page + CODE_PROBE(true, "Truncating to the middle of a page"); auto p = pages.find(pageOffset); if (p != pages.end()) { auto f = p->second->flush(); if (!f.isReady() || f.isError()) actors.push_back(f); } else { - TEST(true); // Truncating to the middle of a page that isn't in cache + CODE_PROBE(true, "Truncating to the middle of a page that isn't in cache"); } pageOffset += pageCache->pageSize; @@ -245,8 +245,7 @@ Future AsyncFileCached::changeFileSize(int64_t size) { // Wait for the page truncations to finish, then truncate the underlying file // Template types are being provided explicitly because they can't be automatically deduced for some reason. - return mapAsync(Void)>, Void>( - waitForAll(actors), [=](Void _) -> Future { return uncached->truncate(size); }); + return mapAsync(waitForAll(actors), [=](Void _) -> Future { return uncached->truncate(size); }); } Future AsyncFileCached::flush() { diff --git a/src/fdbrpc/AsyncFileCached.actor.g.cpp b/src/fdbrpc/AsyncFileCached.actor.g.cpp index 548bbf4..63def7b 100644 --- a/src/fdbrpc/AsyncFileCached.actor.g.cpp +++ b/src/fdbrpc/AsyncFileCached.actor.g.cpp @@ -195,14 +195,14 @@ Future AsyncFileCached::changeFileSize(int64_t size) { prevLength = size; if (offsetInPage) { - TEST(true); // Truncating to the middle of a page + CODE_PROBE(true, "Truncating to the middle of a page"); auto p = pages.find(pageOffset); if (p != pages.end()) { auto f = p->second->flush(); if (!f.isReady() || f.isError()) actors.push_back(f); } else { - TEST(true); // Truncating to the middle of a page that isn't in cache + CODE_PROBE(true, "Truncating to the middle of a page that isn't in cache"); } pageOffset += pageCache->pageSize; @@ -247,8 +247,7 @@ Future AsyncFileCached::changeFileSize(int64_t size) { // Wait for the page truncations to finish, then truncate the underlying file // Template types are being provided explicitly because they can't be automatically deduced for some reason. - return mapAsync(Void)>, Void>( - waitForAll(actors), [=](Void _) -> Future { return uncached->truncate(size); }); + return mapAsync(waitForAll(actors), [=](Void _) -> Future { return uncached->truncate(size); }); } Future AsyncFileCached::flush() { diff --git a/src/fdbrpc/AsyncFileChaos.actor.g.h b/src/fdbrpc/AsyncFileChaos.actor.g.h deleted file mode 100644 index bfbefd6..0000000 --- a/src/fdbrpc/AsyncFileChaos.actor.g.h +++ /dev/null @@ -1,163 +0,0 @@ -#define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileChaos.actor.h" -/* - * AsyncFileChaos.actor.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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. - */ - -#include "flow/flow.h" -#include "flow/serialize.h" -#include "flow/genericactors.actor.h" -#include "fdbrpc/IAsyncFile.h" -#include "flow/network.h" -#include "flow/ActorCollection.h" -#include "flow/actorcompiler.h" - -// template -class AsyncFileChaos final : public IAsyncFile, public ReferenceCounted { -private: - Reference file; - bool enabled; - -public: - explicit AsyncFileChaos(Reference file) : file(file) { - // We only allow chaos events on storage files - enabled = (file->getFilename().find("storage-") != std::string::npos); - } - - void addref() override { ReferenceCounted::addref(); } - void delref() override { ReferenceCounted::delref(); } - - double getDelay() const { - double delayFor = 0.0; - if (!enabled) - return delayFor; - - auto res = g_network->global(INetwork::enDiskFailureInjector); - if (res) { - DiskFailureInjector* delayInjector = static_cast(res); - delayFor = delayInjector->getDiskDelay(); - - // increment the metric for disk delays - if (delayFor > 0.0) { - auto res = g_network->global(INetwork::enChaosMetrics); - if (res) { - ChaosMetrics* chaosMetrics = static_cast(res); - chaosMetrics->diskDelays++; - } - } - } - return delayFor; - } - - Future read(void* data, int length, int64_t offset) override { - double diskDelay = getDelay(); - - if (diskDelay == 0.0) - return file->read(data, length, offset); - - // Wait for diskDelay before submitting the I/O - // Template types are being provided explicitly because they can't be automatically deduced for some reason. - // Capture file by value in case this is destroyed during the delay - return mapAsync(Void)>, int>( - delay(diskDelay), [=, file = file](Void _) -> Future { return file->read(data, length, offset); }); - } - - Future write(void const* data, int length, int64_t offset) override { - Arena arena; - char* pdata = nullptr; - - // Check if a bit flip event was injected, if so, copy the buffer contents - // with a random bit flipped in a new buffer and use that for the write - auto res = g_network->global(INetwork::enBitFlipper); - if (enabled && res) { - auto bitFlipPercentage = static_cast(res)->getBitFlipPercentage(); - if (bitFlipPercentage > 0.0) { - auto bitFlipProb = bitFlipPercentage / 100; - if (deterministicRandom()->random01() < bitFlipProb) { - pdata = (char*)arena.allocate4kAlignedBuffer(length); - memcpy(pdata, data, length); - // flip a random bit in the copied buffer - pdata[deterministicRandom()->randomInt(0, length)] ^= (1 << deterministicRandom()->randomInt(0, 8)); - - // increment the metric for bit flips - auto res = g_network->global(INetwork::enChaosMetrics); - if (res) { - ChaosMetrics* chaosMetrics = static_cast(res); - chaosMetrics->bitFlips++; - } - } - } - } - - double diskDelay = getDelay(); - if (diskDelay == 0.0) { - if (pdata) - return holdWhile(arena, file->write(pdata, length, offset)); - - return file->write(data, length, offset); - } - - // Wait for diskDelay before submitting the I/O - // Capture file by value in case this is destroyed during the delay - return mapAsync(Void)>, Void>( - delay(diskDelay), [=, file = file](Void _) -> Future { - if (pdata) - return holdWhile(arena, file->write(pdata, length, offset)); - - return file->write(data, length, offset); - }); - } - - Future truncate(int64_t size) override { - double diskDelay = getDelay(); - if (diskDelay == 0.0) - return file->truncate(size); - - // Wait for diskDelay before submitting the I/O - // Capture file by value in case this is destroyed during the delay - return mapAsync(Void)>, Void>( - delay(diskDelay), [=, file = file](Void _) -> Future { return file->truncate(size); }); - } - - Future sync() override { - double diskDelay = getDelay(); - if (diskDelay == 0.0) - return file->sync(); - - // Wait for diskDelay before submitting the I/O - // Capture file by value in case this is destroyed during the delay - return mapAsync(Void)>, Void>( - delay(diskDelay), [=, file = file](Void _) -> Future { return file->sync(); }); - } - - Future size() const override { - double diskDelay = getDelay(); - if (diskDelay == 0.0) - return file->size(); - - // Wait for diskDelay before submitting the I/O - // Capture file by value in case this is destroyed during the delay - return mapAsync(Void)>, int64_t>( - delay(diskDelay), [=, file = file](Void _) -> Future { return file->size(); }); - } - - int64_t debugFD() const override { return file->debugFD(); } - - std::string getFilename() const override { return file->getFilename(); } -}; diff --git a/src/fdbrpc/AsyncFileEncrypted.actor.cpp b/src/fdbrpc/AsyncFileEncrypted.actor.cpp index 4f3db0d..09edd14 100644 --- a/src/fdbrpc/AsyncFileEncrypted.actor.cpp +++ b/src/fdbrpc/AsyncFileEncrypted.actor.cpp @@ -264,7 +264,7 @@ Optional> AsyncFileEncrypted::RandomCache::get(uint32_t bl TEST_CASE("fdbrpc/AsyncFileEncrypted") { state const int bytes = FLOW_KNOBS->ENCRYPTION_BLOCK_SIZE * deterministicRandom()->randomInt(0, 1000); state std::vector writeBuffer(bytes, 0); - generateRandomData(&writeBuffer.front(), bytes); + deterministicRandom()->randomBytes(&writeBuffer.front(), bytes); state std::vector readBuffer(bytes, 0); ASSERT(g_network->isSimulated()); StreamCipherKey::initializeGlobalRandomTestKey(); diff --git a/src/fdbrpc/AsyncFileEncrypted.actor.g.cpp b/src/fdbrpc/AsyncFileEncrypted.actor.g.cpp index 77e26d3..1615369 100644 --- a/src/fdbrpc/AsyncFileEncrypted.actor.g.cpp +++ b/src/fdbrpc/AsyncFileEncrypted.actor.g.cpp @@ -1525,7 +1525,7 @@ class FlowTestCase264ActorState { { try { #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEncrypted.actor.cpp" - generateRandomData(&writeBuffer.front(), bytes); + deterministicRandom()->randomBytes(&writeBuffer.front(), bytes); #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEncrypted.actor.cpp" readBuffer = std::vector(bytes, 0); #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEncrypted.actor.cpp" diff --git a/src/fdbrpc/AsyncFileNonDurable.actor.cpp b/src/fdbrpc/AsyncFileNonDurable.actor.cpp index f7b41c5..ff42e0d 100644 --- a/src/fdbrpc/AsyncFileNonDurable.actor.cpp +++ b/src/fdbrpc/AsyncFileNonDurable.actor.cpp @@ -19,12 +19,20 @@ */ #include "fdbrpc/AsyncFileNonDurable.actor.h" + +#include "fdbrpc/SimulatorMachineInfo.h" +#include "fdbrpc/SimulatorProcessInfo.h" + #include "flow/actorcompiler.h" // has to be last include std::map> AsyncFileNonDurable::filesBeingDeleted; +Future waitShutdownSignal() { + return success(g_simulator->getCurrentProcess()->shutdownSignal.getFuture()); +} + ACTOR Future sendOnProcess(ISimulator::ProcessInfo* process, Promise promise, TaskPriority taskID) { - wait(g_simulator.onProcess(process, taskID)); + wait(g_simulator->onProcess(process, taskID)); promise.send(Void()); return Void(); } @@ -33,7 +41,187 @@ ACTOR Future sendErrorOnProcess(ISimulator::ProcessInfo* process, Promise promise, Error e, TaskPriority taskID) { - wait(g_simulator.onProcess(process, taskID)); + wait(g_simulator->onProcess(process, taskID)); promise.sendError(e); return Void(); } + +ACTOR Future AsyncFileDetachable::doShutdown(AsyncFileDetachable* self) { + wait(success(g_simulator->getCurrentProcess()->shutdownSignal.getFuture())); + self->file = Reference(); + return Void(); +} + +ACTOR Future> AsyncFileDetachable::open(Future> wrappedFile) { + choose { + when(wait(success(g_simulator->getCurrentProcess()->shutdownSignal.getFuture()))) { + throw io_error().asInjectedFault(); + } + when(Reference f = wait(wrappedFile)) { + return makeReference(f); + } + } +} + +Future AsyncFileDetachable::read(void* data, int length, int64_t offset) { + if (!file.getPtr() || g_simulator->getCurrentProcess()->shutdownSignal.getFuture().isReady()) + return io_error().asInjectedFault(); + return sendErrorOnShutdown(file->read(data, length, offset), assertOnReadWriteCancel); +} + +Future AsyncFileDetachable::write(void const* data, int length, int64_t offset) { + if (!file.getPtr() || g_simulator->getCurrentProcess()->shutdownSignal.getFuture().isReady()) + return io_error().asInjectedFault(); + return sendErrorOnShutdown(file->write(data, length, offset), assertOnReadWriteCancel); +} + +Future AsyncFileDetachable::truncate(int64_t size) { + if (!file.getPtr() || g_simulator->getCurrentProcess()->shutdownSignal.getFuture().isReady()) + return io_error().asInjectedFault(); + return sendErrorOnShutdown(file->truncate(size)); +} + +Future AsyncFileDetachable::sync() { + if (!file.getPtr() || g_simulator->getCurrentProcess()->shutdownSignal.getFuture().isReady()) + return io_error().asInjectedFault(); + return sendErrorOnShutdown(file->sync()); +} + +Future AsyncFileDetachable::size() const { + if (!file.getPtr() || g_simulator->getCurrentProcess()->shutdownSignal.getFuture().isReady()) + return io_error().asInjectedFault(); + return sendErrorOnShutdown(file->size()); +} + +ACTOR Future> AsyncFileNonDurable::open(std::string filename, + std::string actualFilename, + Future> wrappedFile, + Reference diskParameters, + bool aio) { + state ISimulator::ProcessInfo* currentProcess = g_simulator->getCurrentProcess(); + state TaskPriority currentTaskID = g_network->getCurrentTask(); + state Future shutdown = success(currentProcess->shutdownSignal.getFuture()); + + //TraceEvent("AsyncFileNonDurableOpenBegin").detail("Filename", filename).detail("Addr", g_simulator->getCurrentProcess()->address); + wait(g_simulator->onMachine(currentProcess)); + try { + wait(success(wrappedFile) || shutdown); + + if (shutdown.isReady()) + throw io_error().asInjectedFault(); + + state Reference file = wrappedFile.get(); + + // If we are in the process of deleting a file, we can't let someone else modify it at the same time. We + // therefore block the creation of new files until deletion is complete + state std::map>::iterator deletedFile = + AsyncFileNonDurable::filesBeingDeleted.find(filename); + if (deletedFile != AsyncFileNonDurable::filesBeingDeleted.end()) { + //TraceEvent("AsyncFileNonDurableOpenWaitOnDelete1").detail("Filename", filename); + wait(deletedFile->second || shutdown); + //TraceEvent("AsyncFileNonDurableOpenWaitOnDelete2").detail("Filename", filename); + if (shutdown.isReady()) + throw io_error().asInjectedFault(); + wait(g_simulator->onProcess(currentProcess, currentTaskID)); + } + + state Reference nonDurableFile( + new AsyncFileNonDurable(filename, actualFilename, file, diskParameters, currentProcess->address, aio)); + + // Causes the approximateSize member to be set + state Future sizeFuture = nonDurableFile->size(); + wait(success(sizeFuture) || shutdown); + + if (shutdown.isReady()) + throw io_error().asInjectedFault(); + + //TraceEvent("AsyncFileNonDurableOpenComplete").detail("Filename", filename); + + wait(g_simulator->onProcess(currentProcess, currentTaskID)); + + return nonDurableFile; + } catch (Error& e) { + state Error err = e; + std::string currentFilename = + (wrappedFile.isReady() && !wrappedFile.isError()) ? wrappedFile.get()->getFilename() : actualFilename; + currentProcess->machine->openFiles.erase(currentFilename); + //TraceEvent("AsyncFileNonDurableOpenError").errorUnsuppressed(e).detail("Filename", filename).detail("Address", currentProcess->address).detail("Addr", g_simulator->getCurrentProcess()->address); + wait(g_simulator->onProcess(currentProcess, currentTaskID)); + throw err; + } +} + +ACTOR Future AsyncFileNonDurable::read(AsyncFileNonDurable* self, void* data, int length, int64_t offset) { + state ISimulator::ProcessInfo* currentProcess = g_simulator->getCurrentProcess(); + state TaskPriority currentTaskID = g_network->getCurrentTask(); + wait(g_simulator->onMachine(currentProcess)); + + try { + state int rep = wait(self->onRead(self, data, length, offset)); + wait(g_simulator->onProcess(currentProcess, currentTaskID)); + return rep; + } catch (Error& e) { + state Error err = e; + wait(g_simulator->onProcess(currentProcess, currentTaskID)); + throw err; + } +} + +ACTOR Future AsyncFileNonDurable::closeFile(AsyncFileNonDurable* self) { + state ISimulator::ProcessInfo* currentProcess = g_simulator->getCurrentProcess(); + state TaskPriority currentTaskID = g_network->getCurrentTask(); + state std::string filename = self->filename; + + g_simulator->getMachineByNetworkAddress(self->openedAddress)->deletingOrClosingFiles.insert(self->getFilename()); + + wait(g_simulator->onMachine(currentProcess)); + try { + // Make sure all writes have gone through. + Promise startSyncPromise = self->startSyncPromise; + self->startSyncPromise = Promise(); + startSyncPromise.send(true); + + std::vector> outstandingModifications; + + for (auto itr = self->pendingModifications.ranges().begin(); itr != self->pendingModifications.ranges().end(); + ++itr) + if (itr->value().isValid() && !itr->value().isReady()) + outstandingModifications.push_back(itr->value()); + + // Ignore errors here so that all modifications can finish + wait(waitForAllReady(outstandingModifications)); + + // Make sure we aren't in the process of killing the file + if (self->killed.isSet()) + wait(self->killComplete.getFuture()); + + // Remove this file from the filesBeingDeleted map so that new files can be created with this filename + g_simulator->getMachineByNetworkAddress(self->openedAddress)->closingFiles.erase(self->getFilename()); + g_simulator->getMachineByNetworkAddress(self->openedAddress)->deletingOrClosingFiles.erase(self->getFilename()); + AsyncFileNonDurable::filesBeingDeleted.erase(self->filename); + //TraceEvent("AsyncFileNonDurable_FinishDelete", self->id).detail("Filename", self->filename); + + delete self; + return Void(); + } catch (Error& e) { + state Error err = e; + throw err; + } +} + +void AsyncFileNonDurable::removeOpenFile(std::string filename, AsyncFileNonDurable* file) { + auto& openFiles = g_simulator->getCurrentProcess()->machine->openFiles; + + auto iter = openFiles.find(filename); + + // Various actions (e.g. simulated delete) can remove a file from openFiles prematurely, so it may already + // be gone. Renamed files (from atomic write and create) will also be present under only one of the two + // names. + if (iter != openFiles.end()) { + // even if the filename exists, it doesn't mean that it references the same file. It could be that the + // file was renamed and later a file with the same name was opened. + if (iter->second.getPtrIfReady().orDefault(nullptr) == file) { + openFiles.erase(iter); + } + } +} diff --git a/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp b/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp index 035d2d7..5a42f19 100644 --- a/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp +++ b/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp @@ -21,29 +21,37 @@ */ #include "fdbrpc/AsyncFileNonDurable.actor.h" + +#include "fdbrpc/SimulatorMachineInfo.h" +#include "fdbrpc/SimulatorProcessInfo.h" + #include "flow/actorcompiler.h" // has to be last include std::map> AsyncFileNonDurable::filesBeingDeleted; - #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +Future waitShutdownSignal() { + return success(g_simulator->getCurrentProcess()->shutdownSignal.getFuture()); +} + + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" namespace { // This generated class is to be used only via sendOnProcess() - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" template - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" class SendOnProcessActorState { - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" public: - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" SendOnProcessActorState(ISimulator::ProcessInfo* const& process,Promise const& promise,TaskPriority const& taskID) - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" : process(process), - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" promise(promise), - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" taskID(taskID) - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" { fdb_probe_actor_create("sendOnProcess", reinterpret_cast(this)); @@ -56,16 +64,16 @@ class SendOnProcessActorState { int a_body1(int loopDepth=0) { try { - #line 27 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" - StrictFuture __when_expr_0 = g_simulator.onProcess(process, taskID); - #line 27 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_0 = g_simulator->onProcess(process, taskID); + #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 27 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -86,11 +94,11 @@ class SendOnProcessActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" promise.send(Void()); - #line 29 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SendOnProcessActorState(); static_cast(this)->destroy(); return 0; } - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SendOnProcessActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -100,11 +108,11 @@ class SendOnProcessActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" promise.send(Void()); - #line 29 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SendOnProcessActorState(); static_cast(this)->destroy(); return 0; } - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SendOnProcessActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -175,18 +183,18 @@ class SendOnProcessActorState { fdb_probe_actor_exit("sendOnProcess", reinterpret_cast(this), 0); } - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" ISimulator::ProcessInfo* process; - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" Promise promise; - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" TaskPriority taskID; - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" }; // This generated class is to be used only via sendOnProcess() - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" class SendOnProcessActor final : public Actor, public ActorCallback< SendOnProcessActor, 0, Void >, public FastAllocated, public SendOnProcessActorState { - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -195,9 +203,9 @@ class SendOnProcessActor final : public Actor, public ActorCallback< SendO void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< SendOnProcessActor, 0, Void >; - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" SendOnProcessActor(ISimulator::ProcessInfo* const& process,Promise const& promise,TaskPriority const& taskID) - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" : Actor(), SendOnProcessActorState(process, promise, taskID) { @@ -221,36 +229,36 @@ friend struct ActorCallback< SendOnProcessActor, 0, Void >; } }; } - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" [[nodiscard]] Future sendOnProcess( ISimulator::ProcessInfo* const& process, Promise const& promise, TaskPriority const& taskID ) { - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" return Future(new SendOnProcessActor(process, promise, taskID)); - #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" } -#line 31 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +#line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" - #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" namespace { // This generated class is to be used only via sendErrorOnProcess() - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" template - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" class SendErrorOnProcessActorState { - #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" public: - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" SendErrorOnProcessActorState(ISimulator::ProcessInfo* const& process,Promise const& promise,Error const& e,TaskPriority const& taskID) - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" : process(process), - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" promise(promise), - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" e(e), - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" taskID(taskID) - #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" { fdb_probe_actor_create("sendErrorOnProcess", reinterpret_cast(this)); @@ -263,16 +271,16 @@ class SendErrorOnProcessActorState { int a_body1(int loopDepth=0) { try { - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" - StrictFuture __when_expr_0 = g_simulator.onProcess(process, taskID); - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_0 = g_simulator->onProcess(process, taskID); + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -293,11 +301,11 @@ class SendErrorOnProcessActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" promise.sendError(e); - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SendErrorOnProcessActorState(); static_cast(this)->destroy(); return 0; } - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SendErrorOnProcessActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -307,11 +315,11 @@ class SendErrorOnProcessActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" promise.sendError(e); - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SendErrorOnProcessActorState(); static_cast(this)->destroy(); return 0; } - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SendErrorOnProcessActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -382,20 +390,20 @@ class SendErrorOnProcessActorState { fdb_probe_actor_exit("sendErrorOnProcess", reinterpret_cast(this), 0); } - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" ISimulator::ProcessInfo* process; - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" Promise promise; - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" Error e; - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" TaskPriority taskID; - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" }; // This generated class is to be used only via sendErrorOnProcess() - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" class SendErrorOnProcessActor final : public Actor, public ActorCallback< SendErrorOnProcessActor, 0, Void >, public FastAllocated, public SendErrorOnProcessActorState { - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -404,9 +412,9 @@ class SendErrorOnProcessActor final : public Actor, public ActorCallback< void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< SendErrorOnProcessActor, 0, Void >; - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" SendErrorOnProcessActor(ISimulator::ProcessInfo* const& process,Promise const& promise,Error const& e,TaskPriority const& taskID) - #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" : Actor(), SendErrorOnProcessActorState(process, promise, e, taskID) { @@ -430,11 +438,2426 @@ friend struct ActorCallback< SendErrorOnProcessActor, 0, Void >; } }; } - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" [[nodiscard]] Future sendErrorOnProcess( ISimulator::ProcessInfo* const& process, Promise const& promise, Error const& e, TaskPriority const& taskID ) { - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" return Future(new SendErrorOnProcessActor(process, promise, e, taskID)); - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +} + +#line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +// This generated class is to be used only via doShutdown() + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +template + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +class AsyncFileDetachable_DoShutdownActorState { + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +public: + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + AsyncFileDetachable_DoShutdownActorState(AsyncFileDetachable* const& self) + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + : self(self) + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + fdb_probe_actor_create("doShutdown", reinterpret_cast(this)); + + } + ~AsyncFileDetachable_DoShutdownActorState() + { + fdb_probe_actor_destroy("doShutdown", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_0 = success(g_simulator->getCurrentProcess()->shutdownSignal.getFuture()); + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~AsyncFileDetachable_DoShutdownActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + self->file = Reference(); + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AsyncFileDetachable_DoShutdownActorState(); static_cast(this)->destroy(); return 0; } + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~AsyncFileDetachable_DoShutdownActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + self->file = Reference(); + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AsyncFileDetachable_DoShutdownActorState(); static_cast(this)->destroy(); return 0; } + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~AsyncFileDetachable_DoShutdownActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileDetachable_DoShutdownActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileDetachable_DoShutdownActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("doShutdown", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doShutdown", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< AsyncFileDetachable_DoShutdownActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("doShutdown", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doShutdown", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< AsyncFileDetachable_DoShutdownActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("doShutdown", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doShutdown", reinterpret_cast(this), 0); + + } + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + AsyncFileDetachable* self; + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +}; +// This generated class is to be used only via doShutdown() + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +class AsyncFileDetachable_DoShutdownActor final : public Actor, public ActorCallback< AsyncFileDetachable_DoShutdownActor, 0, Void >, public FastAllocated, public AsyncFileDetachable_DoShutdownActorState { + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< AsyncFileDetachable_DoShutdownActor, 0, Void >; + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + AsyncFileDetachable_DoShutdownActor(AsyncFileDetachable* const& self) + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + : Actor(), + AsyncFileDetachable_DoShutdownActorState(self) + { + fdb_probe_actor_enter("doShutdown", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("doShutdown"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("doShutdown", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< AsyncFileDetachable_DoShutdownActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +[[nodiscard]] Future AsyncFileDetachable::doShutdown( AsyncFileDetachable* const& self ) { + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return Future(new AsyncFileDetachable_DoShutdownActor(self)); + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" } -#line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +#line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +// This generated class is to be used only via open() + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +template + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +class AsyncFileDetachable_OpenActorState { + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +public: + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + AsyncFileDetachable_OpenActorState(Future> const& wrappedFile) + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + : wrappedFile(wrappedFile) + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + fdb_probe_actor_create("open", reinterpret_cast(this)); + + } + ~AsyncFileDetachable_OpenActorState() + { + fdb_probe_actor_destroy("open", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_0 = success(g_simulator->getCurrentProcess()->shutdownSignal.getFuture()); + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture> __when_expr_1 = wrappedFile; + #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~AsyncFileDetachable_OpenActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return a_body1Catch1(io_error().asInjectedFault(), loopDepth); + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return a_body1Catch1(io_error().asInjectedFault(), loopDepth); + #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + + return loopDepth; + } + int a_body1when2(Reference const& f,int loopDepth) + { + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(makeReference(f)); this->~AsyncFileDetachable_OpenActorState(); static_cast(this)->destroy(); return 0; } + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(makeReference(f)); + this->~AsyncFileDetachable_OpenActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when2(Reference && f,int loopDepth) + { + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(makeReference(f)); this->~AsyncFileDetachable_OpenActorState(); static_cast(this)->destroy(); return 0; } + #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(makeReference(f)); + this->~AsyncFileDetachable_OpenActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileDetachable_OpenActor, 0, Void >::remove(); + static_cast(this)->ActorCallback< AsyncFileDetachable_OpenActor, 1, Reference >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileDetachable_OpenActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< AsyncFileDetachable_OpenActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< AsyncFileDetachable_OpenActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< AsyncFileDetachable_OpenActor, 1, Reference >*,Reference const& value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< AsyncFileDetachable_OpenActor, 1, Reference >*,Reference && value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< AsyncFileDetachable_OpenActor, 1, Reference >*,Error err) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 1); + + } + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + Future> wrappedFile; + #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +}; +// This generated class is to be used only via open() + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +class AsyncFileDetachable_OpenActor final : public Actor>, public ActorCallback< AsyncFileDetachable_OpenActor, 0, Void >, public ActorCallback< AsyncFileDetachable_OpenActor, 1, Reference >, public FastAllocated, public AsyncFileDetachable_OpenActorState { + #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< AsyncFileDetachable_OpenActor, 0, Void >; +friend struct ActorCallback< AsyncFileDetachable_OpenActor, 1, Reference >; + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + AsyncFileDetachable_OpenActor(Future> const& wrappedFile) + #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + : Actor>(), + AsyncFileDetachable_OpenActorState(wrappedFile) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("open"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("open", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< AsyncFileDetachable_OpenActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +[[nodiscard]] Future> AsyncFileDetachable::open( Future> const& wrappedFile ) { + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return Future>(new AsyncFileDetachable_OpenActor(wrappedFile)); + #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +} + +#line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + +Future AsyncFileDetachable::read(void* data, int length, int64_t offset) { + if (!file.getPtr() || g_simulator->getCurrentProcess()->shutdownSignal.getFuture().isReady()) + return io_error().asInjectedFault(); + return sendErrorOnShutdown(file->read(data, length, offset), assertOnReadWriteCancel); +} + +Future AsyncFileDetachable::write(void const* data, int length, int64_t offset) { + if (!file.getPtr() || g_simulator->getCurrentProcess()->shutdownSignal.getFuture().isReady()) + return io_error().asInjectedFault(); + return sendErrorOnShutdown(file->write(data, length, offset), assertOnReadWriteCancel); +} + +Future AsyncFileDetachable::truncate(int64_t size) { + if (!file.getPtr() || g_simulator->getCurrentProcess()->shutdownSignal.getFuture().isReady()) + return io_error().asInjectedFault(); + return sendErrorOnShutdown(file->truncate(size)); +} + +Future AsyncFileDetachable::sync() { + if (!file.getPtr() || g_simulator->getCurrentProcess()->shutdownSignal.getFuture().isReady()) + return io_error().asInjectedFault(); + return sendErrorOnShutdown(file->sync()); +} + +Future AsyncFileDetachable::size() const { + if (!file.getPtr() || g_simulator->getCurrentProcess()->shutdownSignal.getFuture().isReady()) + return io_error().asInjectedFault(); + return sendErrorOnShutdown(file->size()); +} + + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +// This generated class is to be used only via open() + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +template + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +class AsyncFileNonDurable_OpenActorState { + #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +public: + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + AsyncFileNonDurable_OpenActorState(std::string const& filename,std::string const& actualFilename,Future> const& wrappedFile,Reference const& diskParameters,bool const& aio) + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + : filename(filename), + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + actualFilename(actualFilename), + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + wrappedFile(wrappedFile), + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + diskParameters(diskParameters), + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + aio(aio), + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + currentProcess(g_simulator->getCurrentProcess()), + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + currentTaskID(g_network->getCurrentTask()), + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + shutdown(success(currentProcess->shutdownSignal.getFuture())) + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + fdb_probe_actor_create("open", reinterpret_cast(this)); + + } + ~AsyncFileNonDurable_OpenActorState() + { + fdb_probe_actor_destroy("open", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_0 = g_simulator->onMachine(currentProcess); + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~AsyncFileNonDurable_OpenActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + try { + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_1 = success(wrappedFile) || shutdown; + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + try { + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_1 = success(wrappedFile) || shutdown; + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileNonDurable_OpenActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_OpenActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_OpenActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< AsyncFileNonDurable_OpenActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 0); + + } + int a_body1cont1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + err = e; + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + std::string currentFilename = (wrappedFile.isReady() && !wrappedFile.isError()) ? wrappedFile.get()->getFilename() : actualFilename; + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + currentProcess->machine->openFiles.erase(currentFilename); + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_6 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont1Catch1when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (shutdown.isReady()) + #line 1133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return a_body1cont1Catch1(io_error().asInjectedFault(), loopDepth); + #line 1137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + } + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + file = wrappedFile.get(); + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + deletedFile = AsyncFileNonDurable::filesBeingDeleted.find(filename); + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (deletedFile != AsyncFileNonDurable::filesBeingDeleted.end()) + #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_2 = deletedFile->second || shutdown; + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont4(loopDepth); + } + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (shutdown.isReady()) + #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return a_body1cont1Catch1(io_error().asInjectedFault(), loopDepth); + #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + } + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + file = wrappedFile.get(); + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + deletedFile = AsyncFileNonDurable::filesBeingDeleted.find(filename); + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (deletedFile != AsyncFileNonDurable::filesBeingDeleted.end()) + #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_2 = deletedFile->second || shutdown; + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont4(loopDepth); + } + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileNonDurable_OpenActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_OpenActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_OpenActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< AsyncFileNonDurable_OpenActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 1); + + } + int a_body1cont4(int loopDepth) + { + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + nonDurableFile = Reference(new AsyncFileNonDurable(filename, actualFilename, file, diskParameters, currentProcess->address, aio)); + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + sizeFuture = nonDurableFile->size(); + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_4 = success(sizeFuture) || shutdown; + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont6(Void const& _,int loopDepth) + { + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (shutdown.isReady()) + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return a_body1cont1Catch1(io_error().asInjectedFault(), loopDepth); + #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + } + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_3 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont6(Void && _,int loopDepth) + { + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (shutdown.isReady()) + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return a_body1cont1Catch1(io_error().asInjectedFault(), loopDepth); + #line 1318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + } + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_3 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont6(_, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont6(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileNonDurable_OpenActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_OpenActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_OpenActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< AsyncFileNonDurable_OpenActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 2); + + } + int a_body1cont7(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont7(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont6when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont7(_, loopDepth); + + return loopDepth; + } + int a_body1cont6when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont7(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileNonDurable_OpenActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_OpenActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont6when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_OpenActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont6when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< AsyncFileNonDurable_OpenActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 3); + + } + int a_body1cont9(Void const& _,int loopDepth) + { + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (shutdown.isReady()) + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return a_body1cont1Catch1(io_error().asInjectedFault(), loopDepth); + #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + } + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_5 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont9when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont9(Void && _,int loopDepth) + { + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (shutdown.isReady()) + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return a_body1cont1Catch1(io_error().asInjectedFault(), loopDepth); + #line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + } + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_5 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont9when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont4when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont9(_, loopDepth); + + return loopDepth; + } + int a_body1cont4when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont9(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileNonDurable_OpenActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_OpenActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont4when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_OpenActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont4when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< AsyncFileNonDurable_OpenActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 4); + + } + int a_body1cont10(Void const& _,int loopDepth) + { + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(nonDurableFile); this->~AsyncFileNonDurable_OpenActorState(); static_cast(this)->destroy(); return 0; } + #line 1587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(nonDurableFile)); // state_var_RVO + this->~AsyncFileNonDurable_OpenActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont10(Void && _,int loopDepth) + { + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(nonDurableFile); this->~AsyncFileNonDurable_OpenActorState(); static_cast(this)->destroy(); return 0; } + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(nonDurableFile)); // state_var_RVO + this->~AsyncFileNonDurable_OpenActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont9when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont10(_, loopDepth); + + return loopDepth; + } + int a_body1cont9when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont10(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileNonDurable_OpenActor, 5, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_OpenActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont9when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_OpenActor, 5, Void >*,Void && value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont9when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< AsyncFileNonDurable_OpenActor, 5, Void >*,Error err) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 5); + + } + int a_body1cont1Catch1cont1(Void const& _,int loopDepth) + { + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return a_body1Catch1(err, loopDepth); + #line 1674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + + return loopDepth; + } + int a_body1cont1Catch1cont1(Void && _,int loopDepth) + { + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return a_body1Catch1(err, loopDepth); + #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + + return loopDepth; + } + int a_body1cont1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose7() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileNonDurable_OpenActor, 6, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_OpenActor, 6, Void >*,Void const& value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1cont1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 6); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_OpenActor, 6, Void >*,Void && value) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1cont1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 6); + + } + void a_callback_error(ActorCallback< AsyncFileNonDurable_OpenActor, 6, Void >*,Error err) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("open", reinterpret_cast(this), 6); + + } + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + std::string filename; + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + std::string actualFilename; + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + Future> wrappedFile; + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + Reference diskParameters; + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + bool aio; + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + ISimulator::ProcessInfo* currentProcess; + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + TaskPriority currentTaskID; + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + Future shutdown; + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + Reference file; + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + std::map>::iterator deletedFile; + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + Reference nonDurableFile; + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + Future sizeFuture; + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + Error err; + #line 1775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +}; +// This generated class is to be used only via open() + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +class AsyncFileNonDurable_OpenActor final : public Actor>, public ActorCallback< AsyncFileNonDurable_OpenActor, 0, Void >, public ActorCallback< AsyncFileNonDurable_OpenActor, 1, Void >, public ActorCallback< AsyncFileNonDurable_OpenActor, 2, Void >, public ActorCallback< AsyncFileNonDurable_OpenActor, 3, Void >, public ActorCallback< AsyncFileNonDurable_OpenActor, 4, Void >, public ActorCallback< AsyncFileNonDurable_OpenActor, 5, Void >, public ActorCallback< AsyncFileNonDurable_OpenActor, 6, Void >, public FastAllocated, public AsyncFileNonDurable_OpenActorState { + #line 1780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< AsyncFileNonDurable_OpenActor, 0, Void >; +friend struct ActorCallback< AsyncFileNonDurable_OpenActor, 1, Void >; +friend struct ActorCallback< AsyncFileNonDurable_OpenActor, 2, Void >; +friend struct ActorCallback< AsyncFileNonDurable_OpenActor, 3, Void >; +friend struct ActorCallback< AsyncFileNonDurable_OpenActor, 4, Void >; +friend struct ActorCallback< AsyncFileNonDurable_OpenActor, 5, Void >; +friend struct ActorCallback< AsyncFileNonDurable_OpenActor, 6, Void >; + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + AsyncFileNonDurable_OpenActor(std::string const& filename,std::string const& actualFilename,Future> const& wrappedFile,Reference const& diskParameters,bool const& aio) + #line 1797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + : Actor>(), + AsyncFileNonDurable_OpenActorState(filename, actualFilename, wrappedFile, diskParameters, aio) + { + fdb_probe_actor_enter("open", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("open"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("open", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< AsyncFileNonDurable_OpenActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< AsyncFileNonDurable_OpenActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< AsyncFileNonDurable_OpenActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< AsyncFileNonDurable_OpenActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< AsyncFileNonDurable_OpenActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< AsyncFileNonDurable_OpenActor, 5, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< AsyncFileNonDurable_OpenActor, 6, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +[[nodiscard]] Future> AsyncFileNonDurable::open( std::string const& filename, std::string const& actualFilename, Future> const& wrappedFile, Reference const& diskParameters, bool const& aio ) { + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return Future>(new AsyncFileNonDurable_OpenActor(filename, actualFilename, wrappedFile, diskParameters, aio)); + #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +} + +#line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + + #line 1835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +// This generated class is to be used only via read() + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +template + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +class AsyncFileNonDurable_ReadActorState { + #line 1841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +public: + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + AsyncFileNonDurable_ReadActorState(AsyncFileNonDurable* const& self,void* const& data,int const& length,int64_t const& offset) + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + : self(self), + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + data(data), + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + length(length), + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + offset(offset), + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + currentProcess(g_simulator->getCurrentProcess()), + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + currentTaskID(g_network->getCurrentTask()) + #line 1858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + fdb_probe_actor_create("read", reinterpret_cast(this)); + + } + ~AsyncFileNonDurable_ReadActorState() + { + fdb_probe_actor_destroy("read", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_0 = g_simulator->onMachine(currentProcess); + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~AsyncFileNonDurable_ReadActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + try { + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_1 = self->onRead(self, data, length, offset); + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + try { + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_1 = self->onRead(self, data, length, offset); + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileNonDurable_ReadActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_ReadActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("read", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_ReadActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("read", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< AsyncFileNonDurable_ReadActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("read", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read", reinterpret_cast(this), 0); + + } + int a_body1cont1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + err = e; + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_3 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3(int loopDepth) + { + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_2 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 2039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(int const& __rep,int loopDepth) + { + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + rep = __rep; + #line 2053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(int && __rep,int loopDepth) + { + rep = std::move(__rep); + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileNonDurable_ReadActor, 1, int >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_ReadActor, 1, int >*,int const& value) + { + fdb_probe_actor_enter("read", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_ReadActor, 1, int >*,int && value) + { + fdb_probe_actor_enter("read", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< AsyncFileNonDurable_ReadActor, 1, int >*,Error err) + { + fdb_probe_actor_enter("read", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read", reinterpret_cast(this), 1); + + } + int a_body1cont4(Void const& _,int loopDepth) + { + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(rep); this->~AsyncFileNonDurable_ReadActorState(); static_cast(this)->destroy(); return 0; } + #line 2120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + new (&static_cast(this)->SAV< int >::value()) int(std::move(rep)); // state_var_RVO + this->~AsyncFileNonDurable_ReadActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont4(Void && _,int loopDepth) + { + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(rep); this->~AsyncFileNonDurable_ReadActorState(); static_cast(this)->destroy(); return 0; } + #line 2132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + new (&static_cast(this)->SAV< int >::value()) int(std::move(rep)); // state_var_RVO + this->~AsyncFileNonDurable_ReadActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileNonDurable_ReadActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_ReadActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("read", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_ReadActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("read", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< AsyncFileNonDurable_ReadActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("read", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read", reinterpret_cast(this), 2); + + } + int a_body1cont1Catch1cont1(Void const& _,int loopDepth) + { + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return a_body1Catch1(err, loopDepth); + #line 2207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + + return loopDepth; + } + int a_body1cont1Catch1cont1(Void && _,int loopDepth) + { + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return a_body1Catch1(err, loopDepth); + #line 2215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + + return loopDepth; + } + int a_body1cont1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileNonDurable_ReadActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_ReadActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("read", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_ReadActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("read", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< AsyncFileNonDurable_ReadActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("read", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read", reinterpret_cast(this), 3); + + } + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + AsyncFileNonDurable* self; + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + void* data; + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + int length; + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + int64_t offset; + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + ISimulator::ProcessInfo* currentProcess; + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + TaskPriority currentTaskID; + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + int rep; + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + Error err; + #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +}; +// This generated class is to be used only via read() + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +class AsyncFileNonDurable_ReadActor final : public Actor, public ActorCallback< AsyncFileNonDurable_ReadActor, 0, Void >, public ActorCallback< AsyncFileNonDurable_ReadActor, 1, int >, public ActorCallback< AsyncFileNonDurable_ReadActor, 2, Void >, public ActorCallback< AsyncFileNonDurable_ReadActor, 3, Void >, public FastAllocated, public AsyncFileNonDurable_ReadActorState { + #line 2303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< AsyncFileNonDurable_ReadActor, 0, Void >; +friend struct ActorCallback< AsyncFileNonDurable_ReadActor, 1, int >; +friend struct ActorCallback< AsyncFileNonDurable_ReadActor, 2, Void >; +friend struct ActorCallback< AsyncFileNonDurable_ReadActor, 3, Void >; + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + AsyncFileNonDurable_ReadActor(AsyncFileNonDurable* const& self,void* const& data,int const& length,int64_t const& offset) + #line 2317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + : Actor(), + AsyncFileNonDurable_ReadActorState(self, data, length, offset) + { + fdb_probe_actor_enter("read", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("read"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("read", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< AsyncFileNonDurable_ReadActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< AsyncFileNonDurable_ReadActor, 1, int >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< AsyncFileNonDurable_ReadActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< AsyncFileNonDurable_ReadActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +[[nodiscard]] Future AsyncFileNonDurable::read( AsyncFileNonDurable* const& self, void* const& data, int const& length, int64_t const& offset ) { + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return Future(new AsyncFileNonDurable_ReadActor(self, data, length, offset)); + #line 2347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +} + +#line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + + #line 2352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +// This generated class is to be used only via closeFile() + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +template + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +class AsyncFileNonDurable_CloseFileActorState { + #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +public: + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + AsyncFileNonDurable_CloseFileActorState(AsyncFileNonDurable* const& self) + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + : self(self), + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + currentProcess(g_simulator->getCurrentProcess()), + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + currentTaskID(g_network->getCurrentTask()), + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + filename(self->filename) + #line 2371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + fdb_probe_actor_create("closeFile", reinterpret_cast(this)); + + } + ~AsyncFileNonDurable_CloseFileActorState() + { + fdb_probe_actor_destroy("closeFile", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + g_simulator->getMachineByNetworkAddress(self->openedAddress)->deletingOrClosingFiles.insert(self->getFilename()); + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_0 = g_simulator->onMachine(currentProcess); + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~AsyncFileNonDurable_CloseFileActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + try { + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + Promise startSyncPromise = self->startSyncPromise; + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + self->startSyncPromise = Promise(); + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + startSyncPromise.send(true); + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + std::vector> outstandingModifications; + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + for(auto itr = self->pendingModifications.ranges().begin();itr != self->pendingModifications.ranges().end();++itr) { + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (itr->value().isValid() && !itr->value().isReady()) + #line 2429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + outstandingModifications.push_back(itr->value()); + #line 2433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + } + } + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_1 = waitForAllReady(outstandingModifications); + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 2440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + try { + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + Promise startSyncPromise = self->startSyncPromise; + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + self->startSyncPromise = Promise(); + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + startSyncPromise.send(true); + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + std::vector> outstandingModifications; + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + for(auto itr = self->pendingModifications.ranges().begin();itr != self->pendingModifications.ranges().end();++itr) { + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (itr->value().isValid() && !itr->value().isReady()) + #line 2471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + outstandingModifications.push_back(itr->value()); + #line 2475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + } + } + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_1 = waitForAllReady(outstandingModifications); + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 2482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileNonDurable_CloseFileActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_CloseFileActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_CloseFileActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< AsyncFileNonDurable_CloseFileActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 0); + + } + int a_body1cont1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + err = e; + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return a_body1Catch1(err, loopDepth); + #line 2568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (self->killed.isSet()) + #line 2582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_2 = self->killComplete.getFuture(); + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont6(loopDepth); + } + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (self->killed.isSet()) + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + { + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + StrictFuture __when_expr_2 = self->killComplete.getFuture(); + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 2613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont6(loopDepth); + } + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileNonDurable_CloseFileActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_CloseFileActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_CloseFileActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< AsyncFileNonDurable_CloseFileActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 1); + + } + int a_body1cont6(int loopDepth) + { + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + g_simulator->getMachineByNetworkAddress(self->openedAddress)->closingFiles.erase(self->getFilename()); + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + g_simulator->getMachineByNetworkAddress(self->openedAddress)->deletingOrClosingFiles.erase(self->getFilename()); + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + AsyncFileNonDurable::filesBeingDeleted.erase(self->filename); + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + delete self; + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AsyncFileNonDurable_CloseFileActorState(); static_cast(this)->destroy(); return 0; } + #line 2703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~AsyncFileNonDurable_CloseFileActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont7(Void const& _,int loopDepth) + { + loopDepth = a_body1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont7(Void && _,int loopDepth) + { + loopDepth = a_body1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont7(_, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont7(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< AsyncFileNonDurable_CloseFileActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_CloseFileActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< AsyncFileNonDurable_CloseFileActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< AsyncFileNonDurable_CloseFileActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 2); + + } + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + AsyncFileNonDurable* self; + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + ISimulator::ProcessInfo* currentProcess; + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + TaskPriority currentTaskID; + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + std::string filename; + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + Error err; + #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +}; +// This generated class is to be used only via closeFile() + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +class AsyncFileNonDurable_CloseFileActor final : public Actor, public ActorCallback< AsyncFileNonDurable_CloseFileActor, 0, Void >, public ActorCallback< AsyncFileNonDurable_CloseFileActor, 1, Void >, public ActorCallback< AsyncFileNonDurable_CloseFileActor, 2, Void >, public FastAllocated, public AsyncFileNonDurable_CloseFileActorState { + #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< AsyncFileNonDurable_CloseFileActor, 0, Void >; +friend struct ActorCallback< AsyncFileNonDurable_CloseFileActor, 1, Void >; +friend struct ActorCallback< AsyncFileNonDurable_CloseFileActor, 2, Void >; + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + AsyncFileNonDurable_CloseFileActor(AsyncFileNonDurable* const& self) + #line 2814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" + : Actor(), + AsyncFileNonDurable_CloseFileActorState(self) + { + fdb_probe_actor_enter("closeFile", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("closeFile"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("closeFile", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< AsyncFileNonDurable_CloseFileActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< AsyncFileNonDurable_CloseFileActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< AsyncFileNonDurable_CloseFileActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" +[[nodiscard]] Future AsyncFileNonDurable::closeFile( AsyncFileNonDurable* const& self ) { + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + return Future(new AsyncFileNonDurable_CloseFileActor(self)); + #line 2843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.cpp" +} + +#line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.cpp" + +void AsyncFileNonDurable::removeOpenFile(std::string filename, AsyncFileNonDurable* file) { + auto& openFiles = g_simulator->getCurrentProcess()->machine->openFiles; + + auto iter = openFiles.find(filename); + + // Various actions (e.g. simulated delete) can remove a file from openFiles prematurely, so it may already + // be gone. Renamed files (from atomic write and create) will also be present under only one of the two + // names. + if (iter != openFiles.end()) { + // even if the filename exists, it doesn't mean that it references the same file. It could be that the + // file was renamed and later a file with the same name was opened. + if (iter->second.getPtrIfReady().orDefault(nullptr) == file) { + openFiles.erase(iter); + } + } +} diff --git a/src/fdbrpc/AsyncFileNonDurable.actor.g.h b/src/fdbrpc/AsyncFileNonDurable.actor.g.h deleted file mode 100644 index 6f3d62a..0000000 --- a/src/fdbrpc/AsyncFileNonDurable.actor.g.h +++ /dev/null @@ -1,8119 +0,0 @@ -#define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -/* - * AsyncFileNonDurable.actor.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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_ASYNCFILENONDURABLE_ACTOR_G_H) -#define FLOW_ASYNCFILENONDURABLE_ACTOR_G_H -#include "fdbrpc/AsyncFileNonDurable.actor.g.h" -#elif !defined(FLOW_ASYNCFILENONDURABLE_ACTOR_H) -#define FLOW_ASYNCFILENONDURABLE_ACTOR_H - -#include "flow/flow.h" -#include "fdbrpc/IAsyncFile.h" -#include "flow/ActorCollection.h" -#include "fdbrpc/simulator.h" -#include "fdbrpc/TraceFileIO.h" -#include "fdbrpc/RangeMap.h" -#include "flow/actorcompiler.h" // This must be the last #include. - -#undef max -#undef min - - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -[[nodiscard]] Future sendOnProcess( ISimulator::ProcessInfo* const& process, Promise const& promise, TaskPriority const& taskID ); - -#line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -[[nodiscard]] Future sendErrorOnProcess( ISimulator::ProcessInfo* const& process, Promise const& promise, Error const& e, TaskPriority const& taskID ); - -#line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -namespace { -// This generated class is to be used only via sendErrorOnShutdown() - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class SendErrorOnShutdownActorState { - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - SendErrorOnShutdownActorState(Future const& in,bool const& assertOnCancel = false) - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - : in(in), - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - assertOnCancel(assertOnCancel) - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - fdb_probe_actor_create("sendErrorOnShutdown", reinterpret_cast(this)); - - } - ~SendErrorOnShutdownActorState() - { - fdb_probe_actor_destroy("sendErrorOnShutdown", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - try { - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_0 = success(g_simulator.getCurrentProcess()->shutdownSignal.getFuture()); - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = in; - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch2(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch2(unknown_error(), loopDepth); - } - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~SendErrorOnShutdownActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1Catch2(const Error& e,int loopDepth=0) - { - try { - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ASSERT(e.code() != error_code_actor_cancelled || !assertOnCancel); - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(e, loopDepth); - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch2(io_error().asInjectedFault(), loopDepth); - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch2(io_error().asInjectedFault(), loopDepth); - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - - return loopDepth; - } - int a_body1when2(T const& rep,int loopDepth) - { - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(rep); this->~SendErrorOnShutdownActorState(); static_cast(this)->destroy(); return 0; } - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< T >::value()) T(rep); - this->~SendErrorOnShutdownActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1when2(T && rep,int loopDepth) - { - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(rep); this->~SendErrorOnShutdownActorState(); static_cast(this)->destroy(); return 0; } - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< T >::value()) T(rep); - this->~SendErrorOnShutdownActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SendErrorOnShutdownActor, 0, Void >::remove(); - static_cast(this)->ActorCallback< SendErrorOnShutdownActor, 1, T >::remove(); - - } - void a_callback_fire(ActorCallback< SendErrorOnShutdownActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("sendErrorOnShutdown", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("sendErrorOnShutdown", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< SendErrorOnShutdownActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("sendErrorOnShutdown", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("sendErrorOnShutdown", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< SendErrorOnShutdownActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("sendErrorOnShutdown", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch2(err, 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("sendErrorOnShutdown", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< SendErrorOnShutdownActor, 1, T >*,T const& value) - { - fdb_probe_actor_enter("sendErrorOnShutdown", reinterpret_cast(this), 1); - a_exitChoose1(); - try { - a_body1when2(value, 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("sendErrorOnShutdown", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< SendErrorOnShutdownActor, 1, T >*,T && value) - { - fdb_probe_actor_enter("sendErrorOnShutdown", reinterpret_cast(this), 1); - a_exitChoose1(); - try { - a_body1when2(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("sendErrorOnShutdown", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< SendErrorOnShutdownActor, 1, T >*,Error err) - { - fdb_probe_actor_enter("sendErrorOnShutdown", reinterpret_cast(this), 1); - a_exitChoose1(); - try { - a_body1Catch2(err, 0); - } - catch (Error& error) { - a_body1Catch2(error, 0); - } catch (...) { - a_body1Catch2(unknown_error(), 0); - } - fdb_probe_actor_exit("sendErrorOnShutdown", reinterpret_cast(this), 1); - - } - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Future in; - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - bool assertOnCancel; - #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -}; -// This generated class is to be used only via sendErrorOnShutdown() - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class SendErrorOnShutdownActor final : public Actor, public ActorCallback< SendErrorOnShutdownActor, 0, Void >, public ActorCallback< SendErrorOnShutdownActor, 1, T >, public FastAllocated>, public SendErrorOnShutdownActorState> { - #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< SendErrorOnShutdownActor, 0, Void >; -friend struct ActorCallback< SendErrorOnShutdownActor, 1, T >; - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - SendErrorOnShutdownActor(Future const& in,bool const& assertOnCancel = false) - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - : Actor(), - SendErrorOnShutdownActorState>(in, assertOnCancel) - { - fdb_probe_actor_enter("sendErrorOnShutdown", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("sendErrorOnShutdown"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("sendErrorOnShutdown", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< SendErrorOnShutdownActor, 0, Void >*)0, actor_cancelled()); break; - } - - } -}; -} - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -[[nodiscard]] Future sendErrorOnShutdown( Future const& in, bool const& assertOnCancel = false ) { - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return Future(new SendErrorOnShutdownActor(in, assertOnCancel)); - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -} - -#line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - -class AsyncFileDetachable final : public IAsyncFile, public ReferenceCounted { -private: - Reference file; - Future shutdown; - bool assertOnReadWriteCancel; - -public: - explicit AsyncFileDetachable(Reference file) : file(file), assertOnReadWriteCancel(true) { - shutdown = doShutdown(this); - } - - #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -// This generated class is to be used only via doShutdown() - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class DoShutdownActorState { - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - DoShutdownActorState(AsyncFileDetachable* const& self) - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - : self(self) - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - fdb_probe_actor_create("doShutdown", reinterpret_cast(this)); - - } - ~DoShutdownActorState() - { - fdb_probe_actor_destroy("doShutdown", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_0 = success(g_simulator.getCurrentProcess()->shutdownSignal.getFuture()); - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~DoShutdownActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) - { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->file = Reference(); - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DoShutdownActorState(); static_cast(this)->destroy(); return 0; } - #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~DoShutdownActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont1(Void && _,int loopDepth) - { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->file = Reference(); - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DoShutdownActorState(); static_cast(this)->destroy(); return 0; } - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~DoShutdownActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DoShutdownActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< DoShutdownActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("doShutdown", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("doShutdown", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< DoShutdownActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("doShutdown", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("doShutdown", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< DoShutdownActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("doShutdown", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("doShutdown", reinterpret_cast(this), 0); - - } - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - AsyncFileDetachable* self; - #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -}; -// This generated class is to be used only via doShutdown() - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class DoShutdownActor final : public Actor, public ActorCallback< DoShutdownActor, 0, Void >, public FastAllocated, public DoShutdownActorState { - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< DoShutdownActor, 0, Void >; - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - DoShutdownActor(AsyncFileDetachable* const& self) - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - : Actor(), - DoShutdownActorState(self) - { - fdb_probe_actor_enter("doShutdown", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("doShutdown"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("doShutdown", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< DoShutdownActor, 0, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -[[nodiscard]] Future doShutdown( AsyncFileDetachable* const& self ) { - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return Future(new DoShutdownActor(self)); - #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -} - -#line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - - #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -// This generated class is to be used only via open() - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class OpenActorState { - #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - OpenActorState(Future> const& wrappedFile) - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - : wrappedFile(wrappedFile) - #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - fdb_probe_actor_create("open", reinterpret_cast(this)); - - } - ~OpenActorState() - { - fdb_probe_actor_destroy("open", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_0 = success(g_simulator.getCurrentProcess()->shutdownSignal.getFuture()); - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture> __when_expr_1 = wrappedFile; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~OpenActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(io_error().asInjectedFault(), loopDepth); - #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(io_error().asInjectedFault(), loopDepth); - #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - - return loopDepth; - } - int a_body1when2(Reference const& f,int loopDepth) - { - #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(makeReference(f)); this->~OpenActorState(); static_cast(this)->destroy(); return 0; } - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< Reference >::value()) Reference(makeReference(f)); - this->~OpenActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1when2(Reference && f,int loopDepth) - { - #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(makeReference(f)); this->~OpenActorState(); static_cast(this)->destroy(); return 0; } - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< Reference >::value()) Reference(makeReference(f)); - this->~OpenActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OpenActor, 0, Void >::remove(); - static_cast(this)->ActorCallback< OpenActor, 1, Reference >::remove(); - - } - void a_callback_fire(ActorCallback< OpenActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< OpenActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< OpenActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< OpenActor, 1, Reference >*,Reference const& value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 1); - a_exitChoose1(); - try { - a_body1when2(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< OpenActor, 1, Reference >*,Reference && value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 1); - a_exitChoose1(); - try { - a_body1when2(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< OpenActor, 1, Reference >*,Error err) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 1); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 1); - - } - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Future> wrappedFile; - #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -}; -// This generated class is to be used only via open() - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class OpenActor final : public Actor>, public ActorCallback< OpenActor, 0, Void >, public ActorCallback< OpenActor, 1, Reference >, public FastAllocated, public OpenActorState { - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< OpenActor, 0, Void >; -friend struct ActorCallback< OpenActor, 1, Reference >; - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - OpenActor(Future> const& wrappedFile) - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - : Actor>(), - OpenActorState(wrappedFile) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("open"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("open", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< OpenActor, 0, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -[[nodiscard]] static Future> open( Future> const& wrappedFile ) { - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return Future>(new OpenActor(wrappedFile)); - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -} - -#line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - - void addref() override { ReferenceCounted::addref(); } - void delref() override { ReferenceCounted::delref(); } - - Future read(void* data, int length, int64_t offset) override { - if (!file.getPtr() || g_simulator.getCurrentProcess()->shutdownSignal.getFuture().isReady()) - return io_error().asInjectedFault(); - return sendErrorOnShutdown(file->read(data, length, offset), assertOnReadWriteCancel); - } - - Future write(void const* data, int length, int64_t offset) override { - if (!file.getPtr() || g_simulator.getCurrentProcess()->shutdownSignal.getFuture().isReady()) - return io_error().asInjectedFault(); - return sendErrorOnShutdown(file->write(data, length, offset), assertOnReadWriteCancel); - } - - Future truncate(int64_t size) override { - if (!file.getPtr() || g_simulator.getCurrentProcess()->shutdownSignal.getFuture().isReady()) - return io_error().asInjectedFault(); - return sendErrorOnShutdown(file->truncate(size)); - } - - Future sync() override { - if (!file.getPtr() || g_simulator.getCurrentProcess()->shutdownSignal.getFuture().isReady()) - return io_error().asInjectedFault(); - return sendErrorOnShutdown(file->sync()); - } - - Future size() const override { - if (!file.getPtr() || g_simulator.getCurrentProcess()->shutdownSignal.getFuture().isReady()) - return io_error().asInjectedFault(); - return sendErrorOnShutdown(file->size()); - } - - int64_t debugFD() const override { - if (!file.getPtr()) - throw io_error().asInjectedFault(); - return file->debugFD(); - } - std::string getFilename() const override { - if (!file.getPtr()) - throw io_error().asInjectedFault(); - return file->getFilename(); - } -}; - -// An async file implementation which wraps another async file and will randomly destroy sectors that it is writing when -// killed This is used to simulate a power failure which prevents all written data from being persisted to disk -class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCounted { -public: - UID id; - std::string filename; - - // For files that use atomic write and create, they are initially created with an extra suffix - std::string initialFilename; - - // An approximation of the size of the file; .size() should be used instead of this variable in most cases - mutable int64_t approximateSize; - - // The address of the machine that opened the file - NetworkAddress openedAddress; - - bool aio; - -private: - // The wrapped IAsyncFile - Reference file; - - // The maximum amount of time a write is delayed before being passed along to the underlying file - double maxWriteDelay; - - // Modifications which haven't been pushed to file, mapped by the location in the file that is being modified. - // Be sure to update minSizeAfterPendingModifications when modifying pendingModifications. - RangeMap> pendingModifications; - // The size of the file after the set of pendingModifications completes, - // (the set pending at the time of reading this member). Must be updated in - // lockstep with any inserts into the pendingModifications map. Tracking - // this variable is necessary so that we can know the range of the file a - // truncate is modifying, so we can insert it into the pendingModifications - // map. Until minSizeAfterPendingModificationsIsExact is true, this is only a lower bound. - mutable int64_t minSizeAfterPendingModifications = 0; - mutable bool minSizeAfterPendingModificationsIsExact = false; - - // Will be blocked whenever kill is running - Promise killed; - Promise killComplete; - - // Used by sync (and kill) to force writes which have not yet been passed along. - // If true is sent, then writes will be durable. If false, then they may not be durable. - Promise startSyncPromise; - - // The performance parameters of the simulated disk - Reference diskParameters; - - // Set to true the first time sync is called on the file - bool hasBeenSynced; - - // Used to describe what corruption is allowed by the file as well as the type of corruption being used on a - // particular page - enum KillMode { NO_CORRUPTION = 0, DROP_ONLY = 1, FULL_CORRUPTION = 2 }; - - // Limits what types of corruption are applied to writes from this file - KillMode killMode; - - ActorCollection - reponses; // cannot call getResult on this actor collection, since the actors will be on different processes - - AsyncFileNonDurable(const std::string& filename, - const std::string& initialFilename, - Reference file, - Reference diskParameters, - NetworkAddress openedAddress, - bool aio) - : filename(filename), initialFilename(initialFilename), approximateSize(0), openedAddress(openedAddress), - aio(aio), file(file), pendingModifications(uint64_t(-1)), diskParameters(diskParameters), reponses(false) { - - // This is only designed to work in simulation - ASSERT(g_network->isSimulated()); - this->id = deterministicRandom()->randomUniqueID(); - - //TraceEvent("AsyncFileNonDurable_Create", id).detail("Filename", filename); - maxWriteDelay = FLOW_KNOBS->NON_DURABLE_MAX_WRITE_DELAY; - hasBeenSynced = false; - - killMode = (KillMode)deterministicRandom()->randomInt(1, 3); - //TraceEvent("AsyncFileNonDurable_CreateEnd", id).detail("Filename", filename).backtrace(); - } - -public: - static std::map> filesBeingDeleted; - - // Creates a new AsyncFileNonDurable which wraps the provided IAsyncFile - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -// This generated class is to be used only via open() - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class OpenActor1State { - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - OpenActor1State(std::string const& filename,std::string const& actualFilename,Future> const& wrappedFile,Reference const& diskParameters,bool const& aio) - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - : filename(filename), - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - actualFilename(actualFilename), - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - wrappedFile(wrappedFile), - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - diskParameters(diskParameters), - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - aio(aio), - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentProcess(g_simulator.getCurrentProcess()), - #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentTaskID(g_network->getCurrentTask()), - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - shutdown(success(currentProcess->shutdownSignal.getFuture())) - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - fdb_probe_actor_create("open", reinterpret_cast(this)); - - } - ~OpenActor1State() - { - fdb_probe_actor_destroy("open", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_0 = g_simulator.onMachine(currentProcess); - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~OpenActor1State(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) - { - try { - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = success(wrappedFile) || shutdown; - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont1(Void && _,int loopDepth) - { - try { - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = success(wrappedFile) || shutdown; - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OpenActor1, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OpenActor1, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< OpenActor1, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< OpenActor1, 0, Void >*,Error err) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 0); - - } - int a_body1cont1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - err = e; - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::string currentFilename = (wrappedFile.isReady() && !wrappedFile.isError()) ? wrappedFile.get()->getFilename() : actualFilename; - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentProcess->machine->openFiles.erase(currentFilename); - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_6 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont1Catch1when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont3(Void const& _,int loopDepth) - { - #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (shutdown.isReady()) - #line 1130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1cont1Catch1(io_error().asInjectedFault(), loopDepth); - #line 1134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - file = wrappedFile.get(); - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - deletedFile = filesBeingDeleted.find(filename); - #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (deletedFile != filesBeingDeleted.end()) - #line 1142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_2 = deletedFile->second || shutdown; - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont4(loopDepth); - } - - return loopDepth; - } - int a_body1cont3(Void && _,int loopDepth) - { - #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (shutdown.isReady()) - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1cont1Catch1(io_error().asInjectedFault(), loopDepth); - #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - file = wrappedFile.get(); - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - deletedFile = filesBeingDeleted.find(filename); - #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (deletedFile != filesBeingDeleted.end()) - #line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_2 = deletedFile->second || shutdown; - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont4(loopDepth); - } - - return loopDepth; - } - int a_body1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OpenActor1, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OpenActor1, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< OpenActor1, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< OpenActor1, 1, Void >*,Error err) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 1); - - } - int a_body1cont4(int loopDepth) - { - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - nonDurableFile = Reference(new AsyncFileNonDurable(filename, actualFilename, file, diskParameters, currentProcess->address, aio)); - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - sizeFuture = nonDurableFile->size(); - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_4 = success(sizeFuture) || shutdown; - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont6(Void const& _,int loopDepth) - { - #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (shutdown.isReady()) - #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1cont1Catch1(io_error().asInjectedFault(), loopDepth); - #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_3 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont6(Void && _,int loopDepth) - { - #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (shutdown.isReady()) - #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1cont1Catch1(io_error().asInjectedFault(), loopDepth); - #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_3 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont3when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont6(_, loopDepth); - - return loopDepth; - } - int a_body1cont3when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont6(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OpenActor1, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OpenActor1, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< OpenActor1, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< OpenActor1, 2, Void >*,Error err) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 2); - - } - int a_body1cont7(Void const& _,int loopDepth) - { - loopDepth = a_body1cont4(loopDepth); - - return loopDepth; - } - int a_body1cont7(Void && _,int loopDepth) - { - loopDepth = a_body1cont4(loopDepth); - - return loopDepth; - } - int a_body1cont6when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont7(_, loopDepth); - - return loopDepth; - } - int a_body1cont6when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont7(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OpenActor1, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OpenActor1, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont6when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< OpenActor1, 3, Void >*,Void && value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont6when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< OpenActor1, 3, Void >*,Error err) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 3); - - } - int a_body1cont9(Void const& _,int loopDepth) - { - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (shutdown.isReady()) - #line 1473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1cont1Catch1(io_error().asInjectedFault(), loopDepth); - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_5 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont9when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont9(Void && _,int loopDepth) - { - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (shutdown.isReady()) - #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1cont1Catch1(io_error().asInjectedFault(), loopDepth); - #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_5 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1cont1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont9when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont4when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont9(_, loopDepth); - - return loopDepth; - } - int a_body1cont4when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont9(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose5() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OpenActor1, 4, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OpenActor1, 4, Void >*,Void const& value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont4when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 4); - - } - void a_callback_fire(ActorCallback< OpenActor1, 4, Void >*,Void && value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont4when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 4); - - } - void a_callback_error(ActorCallback< OpenActor1, 4, Void >*,Error err) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 4); - - } - int a_body1cont10(Void const& _,int loopDepth) - { - #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(nonDurableFile); this->~OpenActor1State(); static_cast(this)->destroy(); return 0; } - #line 1584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(nonDurableFile)); // state_var_RVO - this->~OpenActor1State(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont10(Void && _,int loopDepth) - { - #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(nonDurableFile); this->~OpenActor1State(); static_cast(this)->destroy(); return 0; } - #line 1596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(nonDurableFile)); // state_var_RVO - this->~OpenActor1State(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont9when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont10(_, loopDepth); - - return loopDepth; - } - int a_body1cont9when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont10(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose6() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OpenActor1, 5, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OpenActor1, 5, Void >*,Void const& value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1cont9when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 5); - - } - void a_callback_fire(ActorCallback< OpenActor1, 5, Void >*,Void && value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1cont9when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 5); - - } - void a_callback_error(ActorCallback< OpenActor1, 5, Void >*,Error err) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 5); - - } - int a_body1cont1Catch1cont1(Void const& _,int loopDepth) - { - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(err, loopDepth); - #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - - return loopDepth; - } - int a_body1cont1Catch1cont1(Void && _,int loopDepth) - { - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(err, loopDepth); - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - - return loopDepth; - } - int a_body1cont1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1cont1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose7() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OpenActor1, 6, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OpenActor1, 6, Void >*,Void const& value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1cont1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 6); - - } - void a_callback_fire(ActorCallback< OpenActor1, 6, Void >*,Void && value) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1cont1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 6); - - } - void a_callback_error(ActorCallback< OpenActor1, 6, Void >*,Error err) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("open", reinterpret_cast(this), 6); - - } - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::string filename; - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::string actualFilename; - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Future> wrappedFile; - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Reference diskParameters; - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - bool aio; - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ISimulator::ProcessInfo* currentProcess; - #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TaskPriority currentTaskID; - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Future shutdown; - #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Reference file; - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::map>::iterator deletedFile; - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Reference nonDurableFile; - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Future sizeFuture; - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Error err; - #line 1772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -}; -// This generated class is to be used only via open() - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class OpenActor1 final : public Actor>, public ActorCallback< OpenActor1, 0, Void >, public ActorCallback< OpenActor1, 1, Void >, public ActorCallback< OpenActor1, 2, Void >, public ActorCallback< OpenActor1, 3, Void >, public ActorCallback< OpenActor1, 4, Void >, public ActorCallback< OpenActor1, 5, Void >, public ActorCallback< OpenActor1, 6, Void >, public FastAllocated, public OpenActor1State { - #line 1777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< OpenActor1, 0, Void >; -friend struct ActorCallback< OpenActor1, 1, Void >; -friend struct ActorCallback< OpenActor1, 2, Void >; -friend struct ActorCallback< OpenActor1, 3, Void >; -friend struct ActorCallback< OpenActor1, 4, Void >; -friend struct ActorCallback< OpenActor1, 5, Void >; -friend struct ActorCallback< OpenActor1, 6, Void >; - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - OpenActor1(std::string const& filename,std::string const& actualFilename,Future> const& wrappedFile,Reference const& diskParameters,bool const& aio) - #line 1794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - : Actor>(), - OpenActor1State(filename, actualFilename, wrappedFile, diskParameters, aio) - { - fdb_probe_actor_enter("open", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("open"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("open", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< OpenActor1, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< OpenActor1, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< OpenActor1, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< OpenActor1, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< OpenActor1, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< OpenActor1, 5, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< OpenActor1, 6, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -[[nodiscard]] static Future> open( std::string const& filename, std::string const& actualFilename, Future> const& wrappedFile, Reference const& diskParameters, bool const& aio ) { - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return Future>(new OpenActor1(filename, actualFilename, wrappedFile, diskParameters, aio)); - #line 1827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -} - -#line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - - ~AsyncFileNonDurable() override { - //TraceEvent("AsyncFileNonDurable_Destroy", id).detail("Filename", filename); - } - - void addref() override { ReferenceCounted::addref(); } - - void delref() override { - if (delref_no_destroy()) { - if (filesBeingDeleted.count(filename) == 0) { - //TraceEvent("AsyncFileNonDurable_StartDelete", id).detail("Filename", filename); - Future deleteFuture = closeFile(this); - if (!deleteFuture.isReady()) - filesBeingDeleted[filename] = deleteFuture; - } - - removeOpenFile(filename, this); - if (initialFilename != filename) { - removeOpenFile(initialFilename, this); - } - } - } - - // Removes a file from the openFiles map - static void removeOpenFile(std::string filename, AsyncFileNonDurable* file) { - auto& openFiles = g_simulator.getCurrentProcess()->machine->openFiles; - - auto iter = openFiles.find(filename); - - // Various actions (e.g. simulated delete) can remove a file from openFiles prematurely, so it may already - // be gone. Renamed files (from atomic write and create) will also be present under only one of the two - // names. - if (iter != openFiles.end()) { - // even if the filename exists, it doesn't mean that it references the same file. It could be that the - // file was renamed and later a file with the same name was opened. - if (iter->second.getPtrIfReady().orDefault(nullptr) == file) { - openFiles.erase(iter); - } - } - } - - // Passes along reads straight to the underlying file, waiting for any outstanding changes that could affect the - // results - Future read(void* data, int length, int64_t offset) override { return read(this, data, length, offset); } - - // Writes data to the file. Writes are delayed a random amount of time before being - // passed to the underlying file - Future write(void const* data, int length, int64_t offset) override { - //TraceEvent("AsyncFileNonDurable_Write", id).detail("Filename", filename).detail("Offset", offset).detail("Length", length); - if (length == 0) { - TraceEvent(SevWarnAlways, "AsyncFileNonDurable_EmptyModification", id).detail("Filename", filename); - return Void(); - } - - debugFileSet("AsyncFileNonDurableWrite", filename, data, offset, length); - - Promise writeStarted; - Promise> writeEnded; - writeEnded.send(write(this, writeStarted, writeEnded.getFuture(), data, length, offset)); - return writeStarted.getFuture(); - } - - // Truncates the file. Truncates are delayed a random amount of time before being - // passed to the underlying file - Future truncate(int64_t size) override { - //TraceEvent("AsyncFileNonDurable_Truncate", id).detail("Filename", filename).detail("Offset", size); - debugFileTruncate("AsyncFileNonDurableTruncate", filename, size); - - Promise truncateStarted; - Promise> truncateEnded; - truncateEnded.send(truncate(this, truncateStarted, truncateEnded.getFuture(), size)); - return truncateStarted.getFuture(); - } - - // Fsyncs the file. This allows all delayed modifications to the file to complete before - // syncing the underlying file - Future sync() override { - //TraceEvent("AsyncFileNonDurable_Sync", id).detail("Filename", filename); - Future syncFuture = sync(this, true); - reponses.add(syncFuture); - return syncFuture; - } - - // Passes along size requests to the underlying file, augmenting with any writes past the end of the file - Future size() const override { return size(this); } - - int64_t debugFD() const override { return file->debugFD(); } - - std::string getFilename() const override { return file->getFilename(); } - - // Forces a non-durable sync (some writes are not made or made incorrectly) - // This is used when the file should 'die' without first completing its operations - //(e.g. to simulate power failure) - Future kill() { - TraceEvent("AsyncFileNonDurable_Kill", id).detail("Filename", filename); - TEST(true); // AsyncFileNonDurable was killed - return sync(this, false); - } - -private: - // Returns a future that is used to ensure the waiter ends up on the main thread - Future returnToMainThread() { - Promise p; - Future f = p.getFuture(); - g_network->onMainThread(std::move(p), g_network->getCurrentTask()); - return f; - } - - // Gets existing modifications that overlap the specified range. Optionally inserts a new modification into the map - std::vector> getModificationsAndInsert(int64_t offset, - int64_t length, - bool insertModification = false, - Future value = Void()) { - auto modification = RangeMapRange(offset, length >= 0 ? offset + length : uint64_t(-1)); - auto priorModifications = pendingModifications.intersectingRanges(modification); - - // Aggregate existing modifications in this range - std::vector> modificationFutures; - for (auto itr = priorModifications.begin(); itr != priorModifications.end(); ++itr) { - if (itr.value().isValid() && (!itr.value().isReady() || itr.value().isError())) { - modificationFutures.push_back(itr.value()); - } - } - - // Add the modification if we are doing a write or truncate - if (insertModification) - pendingModifications.insert(modification, value); - - return modificationFutures; - } - - // Checks if the file is killed. If so, then the current sync is completed if running and then an error is thrown - #line 1963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -// This generated class is to be used only via checkKilled() - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class CheckKilledActorState { - #line 1969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - CheckKilledActorState(AsyncFileNonDurable const* const& self,std::string const& context) - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - : self(self), - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - context(context) - #line 1978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - fdb_probe_actor_create("checkKilled", reinterpret_cast(this)); - - } - ~CheckKilledActorState() - { - fdb_probe_actor_destroy("checkKilled", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (self->killed.isSet()) - #line 1993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_0 = self->killComplete.getFuture(); - #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont1(loopDepth); - } - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~CheckKilledActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(int loopDepth) - { - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckKilledActorState(); static_cast(this)->destroy(); return 0; } - #line 2032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~CheckKilledActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont2(Void const& _,int loopDepth) - { - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TraceEvent("AsyncFileNonDurable_KilledFileOperation", self->id) .detail("In", context) .detail("Filename", self->filename); - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TEST(true); - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(io_error().asInjectedFault(), loopDepth); - #line 2048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - - return loopDepth; - } - int a_body1cont2(Void && _,int loopDepth) - { - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TraceEvent("AsyncFileNonDurable_KilledFileOperation", self->id) .detail("In", context) .detail("Filename", self->filename); - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TEST(true); - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(io_error().asInjectedFault(), loopDepth); - #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont2(_, loopDepth); - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont2(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CheckKilledActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< CheckKilledActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("checkKilled", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("checkKilled", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< CheckKilledActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("checkKilled", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("checkKilled", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< CheckKilledActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("checkKilled", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("checkKilled", reinterpret_cast(this), 0); - - } - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - AsyncFileNonDurable const* self; - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::string context; - #line 2131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -}; -// This generated class is to be used only via checkKilled() - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class CheckKilledActor final : public Actor, public ActorCallback< CheckKilledActor, 0, Void >, public FastAllocated, public CheckKilledActorState { - #line 2136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< CheckKilledActor, 0, Void >; - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - CheckKilledActor(AsyncFileNonDurable const* const& self,std::string const& context) - #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - : Actor(), - CheckKilledActorState(self, context) - { - fdb_probe_actor_enter("checkKilled", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("checkKilled"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("checkKilled", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< CheckKilledActor, 0, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -[[nodiscard]] static Future checkKilled( AsyncFileNonDurable const* const& self, std::string const& context ) { - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return Future(new CheckKilledActor(self, context)); - #line 2174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -} - -#line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - - // Passes along reads straight to the underlying file, waiting for any outstanding changes that could affect the - // results - #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -// This generated class is to be used only via onRead() - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class OnReadActorState { - #line 2187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - OnReadActorState(AsyncFileNonDurable* const& self,void* const& data,int const& length,int64_t const& offset) - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - : self(self), - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - data(data), - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - length(length), - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - offset(offset) - #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - fdb_probe_actor_create("onRead", reinterpret_cast(this)); - - } - ~OnReadActorState() - { - fdb_probe_actor_destroy("onRead", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_0 = checkKilled(self, "Read"); - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~OnReadActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) - { - #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::vector> priorModifications = self->getModificationsAndInsert(offset, length); - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = waitForAll(priorModifications); - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void && _,int loopDepth) - { - #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::vector> priorModifications = self->getModificationsAndInsert(offset, length); - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = waitForAll(priorModifications); - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OnReadActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OnReadActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("onRead", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onRead", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< OnReadActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("onRead", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onRead", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< OnReadActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("onRead", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onRead", reinterpret_cast(this), 0); - - } - int a_body1cont2(Void const& _,int loopDepth) - { - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - readFuture = self->file->read(data, length, offset); - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_2 = success(readFuture) || self->killed.getFuture(); - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont2(Void && _,int loopDepth) - { - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - readFuture = self->file->read(data, length, offset); - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_2 = success(readFuture) || self->killed.getFuture(); - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont2(_, loopDepth); - - return loopDepth; - } - int a_body1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont2(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OnReadActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OnReadActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("onRead", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onRead", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< OnReadActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("onRead", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onRead", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< OnReadActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("onRead", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onRead", reinterpret_cast(this), 1); - - } - int a_body1cont3(Void const& _,int loopDepth) - { - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_3 = checkKilled(self, "ReadEnd"); - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont3(Void && _,int loopDepth) - { - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_3 = checkKilled(self, "ReadEnd"); - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont2when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1cont2when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OnReadActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OnReadActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("onRead", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont2when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onRead", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< OnReadActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("onRead", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onRead", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< OnReadActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("onRead", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onRead", reinterpret_cast(this), 2); - - } - int a_body1cont4(Void const& _,int loopDepth) - { - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - debugFileCheck("AsyncFileNonDurableRead", self->filename, data, offset, length); - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(readFuture.get()); this->~OnReadActorState(); static_cast(this)->destroy(); return 0; } - #line 2540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< int >::value()) int(readFuture.get()); - this->~OnReadActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont4(Void && _,int loopDepth) - { - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - debugFileCheck("AsyncFileNonDurableRead", self->filename, data, offset, length); - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(readFuture.get()); this->~OnReadActorState(); static_cast(this)->destroy(); return 0; } - #line 2554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< int >::value()) int(readFuture.get()); - this->~OnReadActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont3when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont4(_, loopDepth); - - return loopDepth; - } - int a_body1cont3when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont4(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OnReadActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OnReadActor, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("onRead", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont3when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onRead", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< OnReadActor, 3, Void >*,Void && value) - { - fdb_probe_actor_enter("onRead", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont3when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onRead", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< OnReadActor, 3, Void >*,Error err) - { - fdb_probe_actor_enter("onRead", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onRead", reinterpret_cast(this), 3); - - } - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - AsyncFileNonDurable* self; - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - void* data; - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int length; - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int64_t offset; - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Future readFuture; - #line 2635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -}; -// This generated class is to be used only via onRead() - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class OnReadActor final : public Actor, public ActorCallback< OnReadActor, 0, Void >, public ActorCallback< OnReadActor, 1, Void >, public ActorCallback< OnReadActor, 2, Void >, public ActorCallback< OnReadActor, 3, Void >, public FastAllocated, public OnReadActorState { - #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< OnReadActor, 0, Void >; -friend struct ActorCallback< OnReadActor, 1, Void >; -friend struct ActorCallback< OnReadActor, 2, Void >; -friend struct ActorCallback< OnReadActor, 3, Void >; - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - OnReadActor(AsyncFileNonDurable* const& self,void* const& data,int const& length,int64_t const& offset) - #line 2654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - : Actor(), - OnReadActorState(self, data, length, offset) - { - fdb_probe_actor_enter("onRead", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("onRead"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("onRead", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< OnReadActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< OnReadActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< OnReadActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< OnReadActor, 3, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -[[nodiscard]] Future onRead( AsyncFileNonDurable* const& self, void* const& data, int const& length, int64_t const& offset ) { - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return Future(new OnReadActor(self, data, length, offset)); - #line 2684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -} - -#line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - - #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -// This generated class is to be used only via read() - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class ReadActorState { - #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ReadActorState(AsyncFileNonDurable* const& self,void* const& data,int const& length,int64_t const& offset) - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - : self(self), - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - data(data), - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - length(length), - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - offset(offset), - #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentProcess(g_simulator.getCurrentProcess()), - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentTaskID(g_network->getCurrentTask()) - #line 2712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - fdb_probe_actor_create("read", reinterpret_cast(this)); - - } - ~ReadActorState() - { - fdb_probe_actor_destroy("read", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_0 = g_simulator.onMachine(currentProcess); - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~ReadActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) - { - try { - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = self->onRead(self, data, length, offset); - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 2760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont1(Void && _,int loopDepth) - { - try { - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = self->onRead(self, data, length, offset); - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ReadActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ReadActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("read", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< ReadActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("read", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< ReadActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("read", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read", reinterpret_cast(this), 0); - - } - int a_body1cont1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - err = e; - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_3 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1Catch1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont3(int loopDepth) - { - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_2 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 2893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1when1(int const& __rep,int loopDepth) - { - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - rep = __rep; - #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = a_body1cont3(loopDepth); - - return loopDepth; - } - int a_body1cont1when1(int && __rep,int loopDepth) - { - rep = std::move(__rep); - loopDepth = a_body1cont3(loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ReadActor, 1, int >::remove(); - - } - void a_callback_fire(ActorCallback< ReadActor, 1, int >*,int const& value) - { - fdb_probe_actor_enter("read", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< ReadActor, 1, int >*,int && value) - { - fdb_probe_actor_enter("read", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< ReadActor, 1, int >*,Error err) - { - fdb_probe_actor_enter("read", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read", reinterpret_cast(this), 1); - - } - int a_body1cont4(Void const& _,int loopDepth) - { - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(rep); this->~ReadActorState(); static_cast(this)->destroy(); return 0; } - #line 2974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< int >::value()) int(std::move(rep)); // state_var_RVO - this->~ReadActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont4(Void && _,int loopDepth) - { - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(rep); this->~ReadActorState(); static_cast(this)->destroy(); return 0; } - #line 2986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< int >::value()) int(std::move(rep)); // state_var_RVO - this->~ReadActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont3when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont4(_, loopDepth); - - return loopDepth; - } - int a_body1cont3when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont4(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ReadActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ReadActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("read", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< ReadActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("read", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< ReadActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("read", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read", reinterpret_cast(this), 2); - - } - int a_body1cont1Catch1cont1(Void const& _,int loopDepth) - { - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(err, loopDepth); - #line 3061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - - return loopDepth; - } - int a_body1cont1Catch1cont1(Void && _,int loopDepth) - { - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(err, loopDepth); - #line 3069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - - return loopDepth; - } - int a_body1cont1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1cont1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ReadActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ReadActor, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("read", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< ReadActor, 3, Void >*,Void && value) - { - fdb_probe_actor_enter("read", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< ReadActor, 3, Void >*,Error err) - { - fdb_probe_actor_enter("read", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read", reinterpret_cast(this), 3); - - } - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - AsyncFileNonDurable* self; - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - void* data; - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int length; - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int64_t offset; - #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ISimulator::ProcessInfo* currentProcess; - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TaskPriority currentTaskID; - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int rep; - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Error err; - #line 3152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -}; -// This generated class is to be used only via read() - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class ReadActor final : public Actor, public ActorCallback< ReadActor, 0, Void >, public ActorCallback< ReadActor, 1, int >, public ActorCallback< ReadActor, 2, Void >, public ActorCallback< ReadActor, 3, Void >, public FastAllocated, public ReadActorState { - #line 3157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< ReadActor, 0, Void >; -friend struct ActorCallback< ReadActor, 1, int >; -friend struct ActorCallback< ReadActor, 2, Void >; -friend struct ActorCallback< ReadActor, 3, Void >; - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ReadActor(AsyncFileNonDurable* const& self,void* const& data,int const& length,int64_t const& offset) - #line 3171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - : Actor(), - ReadActorState(self, data, length, offset) - { - fdb_probe_actor_enter("read", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("read"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("read", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< ReadActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< ReadActor, 1, int >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< ReadActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< ReadActor, 3, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -[[nodiscard]] Future read( AsyncFileNonDurable* const& self, void* const& data, int const& length, int64_t const& offset ) { - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return Future(new ReadActor(self, data, length, offset)); - #line 3201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -} - -#line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - - // Delays writes a random amount of time before passing them through to the underlying file. - // If a kill interrupts the delay, then the output could be the correct write, part of the write, - // or none of the write. It may also corrupt parts of sectors which have not been written correctly - #line 3209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -// This generated class is to be used only via write() - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class WriteActorState { - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - WriteActorState(AsyncFileNonDurable* const& self,Promise const& writeStarted,Future> const& ownFuture,void const* const& data,int const& length,int64_t const& offset) - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - : self(self), - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - writeStarted(writeStarted), - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ownFuture(ownFuture), - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - data(data), - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - length(length), - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - offset(offset), - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - dataCopy(StringRef((uint8_t*)data, length)), - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentProcess(g_simulator.getCurrentProcess()), - #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentTaskID(g_network->getCurrentTask()) - #line 3238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - fdb_probe_actor_create("write", reinterpret_cast(this)); - - } - ~WriteActorState() - { - fdb_probe_actor_destroy("write", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_0 = g_simulator.onMachine(currentProcess); - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~WriteActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) - { - #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - delayDuration = g_simulator.speedUpSimulation ? 0.0001 : (deterministicRandom()->random01() * self->maxWriteDelay); - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - startSyncFuture = self->startSyncPromise.getFuture(); - #line 3285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - try { - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = checkKilled(self, "Write"); - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 3291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont1(Void && _,int loopDepth) - { - #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - delayDuration = g_simulator.speedUpSimulation ? 0.0001 : (deterministicRandom()->random01() * self->maxWriteDelay); - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - startSyncFuture = self->startSyncPromise.getFuture(); - #line 3313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - try { - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = checkKilled(self, "Write"); - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 3319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< WriteActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< WriteActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< WriteActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 0); - - } - int a_body1cont2(int loopDepth) - { - #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - saveDurable = true; - #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_4 = delay(delayDuration); - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont2when1(__when_expr_4.get(), loopDepth); }; - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_5 = startSyncFuture; - #line 3410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2when2(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->reponses.add(sendErrorOnProcess(currentProcess, writeStarted, e, currentTaskID)); - #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(e, loopDepth); - #line 3429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont3(Void const& _,int loopDepth) - { - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture> __when_expr_2 = ownFuture; - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 3445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont3(Void && _,int loopDepth) - { - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture> __when_expr_2 = ownFuture; - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< WriteActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< WriteActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< WriteActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 1); - - } - int a_body1cont4(Future const& writeEnded,int loopDepth) - { - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::vector> priorModifications = self->getModificationsAndInsert(offset, length, true, writeEnded); - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->minSizeAfterPendingModifications = std::max(self->minSizeAfterPendingModifications, offset + length); - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (BUGGIFY_WITH_PROB(0.001) && !g_simulator.speedUpSimulation) - #line 3542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - priorModifications.push_back( delay(deterministicRandom()->random01() * FLOW_KNOBS->MAX_PRIOR_MODIFICATION_DELAY) || self->killed.getFuture()); - #line 3546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - else - { - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - priorModifications.push_back(waitUntilDiskReady(self->diskParameters, length) || self->killed.getFuture()); - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_3 = waitForAll(priorModifications); - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 3558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont4(Future && writeEnded,int loopDepth) - { - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::vector> priorModifications = self->getModificationsAndInsert(offset, length, true, writeEnded); - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->minSizeAfterPendingModifications = std::max(self->minSizeAfterPendingModifications, offset + length); - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (BUGGIFY_WITH_PROB(0.001) && !g_simulator.speedUpSimulation) - #line 3576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - priorModifications.push_back( delay(deterministicRandom()->random01() * FLOW_KNOBS->MAX_PRIOR_MODIFICATION_DELAY) || self->killed.getFuture()); - #line 3580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - else - { - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - priorModifications.push_back(waitUntilDiskReady(self->diskParameters, length) || self->killed.getFuture()); - #line 3586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_3 = waitForAll(priorModifications); - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 3592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont3when1(Future const& writeEnded,int loopDepth) - { - loopDepth = a_body1cont4(writeEnded, loopDepth); - - return loopDepth; - } - int a_body1cont3when1(Future && writeEnded,int loopDepth) - { - loopDepth = a_body1cont4(std::move(writeEnded), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteActor, 2, Future >::remove(); - - } - void a_callback_fire(ActorCallback< WriteActor, 2, Future >*,Future const& value) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< WriteActor, 2, Future >*,Future && value) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< WriteActor, 2, Future >*,Error err) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 2); - - } - int a_body1cont5(Void const& _,int loopDepth) - { - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->approximateSize = std::max(self->approximateSize, length + offset); - #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->reponses.add(sendOnProcess(currentProcess, writeStarted, currentTaskID)); - #line 3671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = a_body1cont9(loopDepth); - - return loopDepth; - } - int a_body1cont5(Void && _,int loopDepth) - { - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->approximateSize = std::max(self->approximateSize, length + offset); - #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->reponses.add(sendOnProcess(currentProcess, writeStarted, currentTaskID)); - #line 3682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = a_body1cont9(loopDepth); - - return loopDepth; - } - int a_body1cont4when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont5(_, loopDepth); - - return loopDepth; - } - int a_body1cont4when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont5(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< WriteActor, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont4when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< WriteActor, 3, Void >*,Void && value) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont4when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< WriteActor, 3, Void >*,Error err) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 3); - - } - int a_body1cont9(int loopDepth) - { - try { - loopDepth = a_body1cont2(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont10(int loopDepth) - { - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - debugFileCheck("AsyncFileNonDurableWriteAfterWait", self->filename, dataCopy.begin(), offset, length); - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ASSERT(!self->aio || (offset % 4096 == 0 && length % 4096 == 0)); - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int diskPageLength = saveDurable ? length : 4096; - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int diskSectorLength = saveDurable ? length : 512; - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::vector> writeFutures; - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - for(int writeOffset = 0;writeOffset < length;) { - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int pageLength = diskPageLength; - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!self->aio && !saveDurable) - #line 3781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - pageLength = std::min((int64_t)length - writeOffset, diskPageLength - ((offset + writeOffset) % diskPageLength)); - #line 3785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - KillMode pageKillMode = (KillMode)deterministicRandom()->randomInt(0, self->killMode + 1); - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - for(int pageOffset = 0;pageOffset < pageLength;) { - #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int sectorLength = diskSectorLength; - #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!self->aio && !saveDurable) - #line 3795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - sectorLength = std::min((int64_t)length - (writeOffset + pageOffset), diskSectorLength - ((offset + writeOffset + pageOffset) % diskSectorLength)); - #line 3799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (saveDurable || pageKillMode == NO_CORRUPTION || (pageKillMode == FULL_CORRUPTION && deterministicRandom()->random01() < 0.25)) - #line 3803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - writeFutures.push_back(self->file->write( dataCopy.begin() + writeOffset + pageOffset, sectorLength, offset + writeOffset + pageOffset)); - #line 3807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - else - { - #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (pageKillMode == FULL_CORRUPTION && deterministicRandom()->random01() < 0.66667) - #line 3813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int side = deterministicRandom()->randomInt(0, 3); - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - bool garbage = side == 2 || deterministicRandom()->random01() < 0.5; - #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int64_t goodStart = 0; - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int64_t goodEnd = sectorLength; - #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int64_t badStart = 0; - #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int64_t badEnd = sectorLength; - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (side == 0) - #line 3829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - goodEnd = deterministicRandom()->randomInt(0, sectorLength); - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - badStart = goodEnd; - #line 3835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - else - { - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (side == 1) - #line 3841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - badEnd = deterministicRandom()->randomInt(0, sectorLength); - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - goodStart = badEnd; - #line 3847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - else - { - #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - goodEnd = 0; - #line 3853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - } - #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (garbage && badStart != badEnd) - #line 3858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - uint8_t* badData = const_cast(&dataCopy.begin()[badStart + writeOffset + pageOffset]); - #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - for(int i = 0;i < badEnd - badStart;i += sizeof(uint32_t)) { - #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - uint32_t val = deterministicRandom()->randomUInt32(); - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - memcpy(&badData[i], &val, std::min(badEnd - badStart - i, (int64_t)sizeof(uint32_t))); - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - writeFutures.push_back(self->file->write(dataCopy.begin() + writeOffset + pageOffset, sectorLength, offset + writeOffset + pageOffset)); - #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - debugFileSet("AsyncFileNonDurableBadWrite", self->filename, dataCopy.begin() + writeOffset + pageOffset, offset + writeOffset + pageOffset, sectorLength); - #line 3874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - else - { - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (goodStart != goodEnd) - #line 3880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - writeFutures.push_back( self->file->write(dataCopy.begin() + goodStart + writeOffset + pageOffset, goodEnd - goodStart, goodStart + offset + writeOffset + pageOffset)); - #line 3884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - } - #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TraceEvent("AsyncFileNonDurable_BadWrite", self->id) .detail("Offset", offset + writeOffset + pageOffset) .detail("Length", sectorLength) .detail("GoodStart", goodStart) .detail("GoodEnd", goodEnd) .detail("HasGarbage", garbage) .detail("Side", side) .detail("Filename", self->filename); - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TEST(true); - #line 3891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - else - { - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TraceEvent("AsyncFileNonDurable_DroppedWrite", self->id) .detail("Offset", offset + writeOffset + pageOffset) .detail("Length", sectorLength) .detail("Filename", self->filename); - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TEST(true); - #line 3899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - } - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - pageOffset += sectorLength; - #line 3904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - writeOffset += pageLength; - #line 3908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_6 = waitForAll(writeFutures); - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont10when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont2when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont10(loopDepth); - - return loopDepth; - } - int a_body1cont2when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont10(loopDepth); - - return loopDepth; - } - int a_body1cont2when2(bool const& durable,int loopDepth) - { - #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - saveDurable = durable; - #line 3940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = a_body1cont10(loopDepth); - - return loopDepth; - } - int a_body1cont2when2(bool && durable,int loopDepth) - { - #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - saveDurable = durable; - #line 3949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = a_body1cont10(loopDepth); - - return loopDepth; - } - void a_exitChoose5() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteActor, 4, Void >::remove(); - static_cast(this)->ActorCallback< WriteActor, 5, bool >::remove(); - - } - void a_callback_fire(ActorCallback< WriteActor, 4, Void >*,Void const& value) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont2when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 4); - - } - void a_callback_fire(ActorCallback< WriteActor, 4, Void >*,Void && value) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 4); - - } - void a_callback_error(ActorCallback< WriteActor, 4, Void >*,Error err) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 4); - - } - void a_callback_fire(ActorCallback< WriteActor, 5, bool >*,bool const& value) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 5); - a_exitChoose5(); - try { - a_body1cont2when2(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 5); - - } - void a_callback_fire(ActorCallback< WriteActor, 5, bool >*,bool && value) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 5); - a_exitChoose5(); - try { - a_body1cont2when2(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 5); - - } - void a_callback_error(ActorCallback< WriteActor, 5, bool >*,Error err) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 5); - a_exitChoose5(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 5); - - } - int a_body1cont10cont1(Void const& _,int loopDepth) - { - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteActorState(); static_cast(this)->destroy(); return 0; } - #line 4055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~WriteActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont10cont1(Void && _,int loopDepth) - { - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteActorState(); static_cast(this)->destroy(); return 0; } - #line 4067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~WriteActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont10when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont10cont1(_, loopDepth); - - return loopDepth; - } - int a_body1cont10when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont10cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose6() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WriteActor, 6, Void >::remove(); - - } - void a_callback_fire(ActorCallback< WriteActor, 6, Void >*,Void const& value) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 6); - a_exitChoose6(); - try { - a_body1cont10when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 6); - - } - void a_callback_fire(ActorCallback< WriteActor, 6, Void >*,Void && value) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 6); - a_exitChoose6(); - try { - a_body1cont10when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 6); - - } - void a_callback_error(ActorCallback< WriteActor, 6, Void >*,Error err) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), 6); - a_exitChoose6(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("write", reinterpret_cast(this), 6); - - } - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - AsyncFileNonDurable* self; - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Promise writeStarted; - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Future> ownFuture; - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - void const* data; - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int length; - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int64_t offset; - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Standalone dataCopy; - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ISimulator::ProcessInfo* currentProcess; - #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TaskPriority currentTaskID; - #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - double delayDuration; - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Future startSyncFuture; - #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - bool saveDurable; - #line 4162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -}; -// This generated class is to be used only via write() - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class WriteActor final : public Actor, public ActorCallback< WriteActor, 0, Void >, public ActorCallback< WriteActor, 1, Void >, public ActorCallback< WriteActor, 2, Future >, public ActorCallback< WriteActor, 3, Void >, public ActorCallback< WriteActor, 4, Void >, public ActorCallback< WriteActor, 5, bool >, public ActorCallback< WriteActor, 6, Void >, public FastAllocated, public WriteActorState { - #line 4167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< WriteActor, 0, Void >; -friend struct ActorCallback< WriteActor, 1, Void >; -friend struct ActorCallback< WriteActor, 2, Future >; -friend struct ActorCallback< WriteActor, 3, Void >; -friend struct ActorCallback< WriteActor, 4, Void >; -friend struct ActorCallback< WriteActor, 5, bool >; -friend struct ActorCallback< WriteActor, 6, Void >; - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - WriteActor(AsyncFileNonDurable* const& self,Promise const& writeStarted,Future> const& ownFuture,void const* const& data,int const& length,int64_t const& offset) - #line 4184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - : Actor(), - WriteActorState(self, writeStarted, ownFuture, data, length, offset) - { - fdb_probe_actor_enter("write", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("write"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("write", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< WriteActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< WriteActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< WriteActor, 2, Future >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< WriteActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< WriteActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< WriteActor, 6, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -[[nodiscard]] Future write( AsyncFileNonDurable* const& self, Promise const& writeStarted, Future> const& ownFuture, void const* const& data, int const& length, int64_t const& offset ) { - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return Future(new WriteActor(self, writeStarted, ownFuture, data, length, offset)); - #line 4216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -} - -#line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - - // Delays truncates a random amount of time before passing them through to the underlying file. - // If a kill interrupts the delay, then the truncate may or may not be performed - #line 4223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -// This generated class is to be used only via truncate() - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class TruncateActorState { - #line 4229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TruncateActorState(AsyncFileNonDurable* const& self,Promise const& truncateStarted,Future> const& ownFuture,int64_t const& size) - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - : self(self), - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - truncateStarted(truncateStarted), - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ownFuture(ownFuture), - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - size(size), - #line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentProcess(g_simulator.getCurrentProcess()), - #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentTaskID(g_network->getCurrentTask()) - #line 4246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - fdb_probe_actor_create("truncate", reinterpret_cast(this)); - - } - ~TruncateActorState() - { - fdb_probe_actor_destroy("truncate", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_0 = g_simulator.onMachine(currentProcess); - #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~TruncateActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) - { - #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - delayDuration = g_simulator.speedUpSimulation ? 0.0001 : (deterministicRandom()->random01() * self->maxWriteDelay); - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - startSyncFuture = self->startSyncPromise.getFuture(); - #line 4293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - try { - #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = checkKilled(self, "Truncate"); - #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 4299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont1(Void && _,int loopDepth) - { - #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - delayDuration = g_simulator.speedUpSimulation ? 0.0001 : (deterministicRandom()->random01() * self->maxWriteDelay); - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - startSyncFuture = self->startSyncPromise.getFuture(); - #line 4321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - try { - #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = checkKilled(self, "Truncate"); - #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 4327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TruncateActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< TruncateActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< TruncateActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< TruncateActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 0); - - } - int a_body1cont2(int loopDepth) - { - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - saveDurable = true; - #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_5 = delay(delayDuration); - #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2when1(__when_expr_5.get(), loopDepth); }; - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_6 = startSyncFuture; - #line 4418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont2when2(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->reponses.add(sendErrorOnProcess(currentProcess, truncateStarted, e, currentTaskID)); - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(e, loopDepth); - #line 4437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont3(Void const& _,int loopDepth) - { - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture> __when_expr_2 = ownFuture; - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 4453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont3(Void && _,int loopDepth) - { - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture> __when_expr_2 = ownFuture; - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 4469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TruncateActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< TruncateActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< TruncateActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< TruncateActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 1); - - } - int a_body1cont4(int loopDepth) - { - #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!self->minSizeAfterPendingModificationsIsExact) - #line 4546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_3 = success(self->size()); - #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 4552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont5(loopDepth); - } - - return loopDepth; - } - int a_body1cont3when1(Future const& __truncateEnded,int loopDepth) - { - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - truncateEnded = __truncateEnded; - #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = a_body1cont4(loopDepth); - - return loopDepth; - } - int a_body1cont3when1(Future && __truncateEnded,int loopDepth) - { - truncateEnded = std::move(__truncateEnded); - loopDepth = a_body1cont4(loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TruncateActor, 2, Future >::remove(); - - } - void a_callback_fire(ActorCallback< TruncateActor, 2, Future >*,Future const& value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< TruncateActor, 2, Future >*,Future && value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< TruncateActor, 2, Future >*,Error err) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 2); - - } - int a_body1cont5(int loopDepth) - { - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ASSERT(self->minSizeAfterPendingModificationsIsExact); - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int64_t beginModifiedRange = std::min(size, self->minSizeAfterPendingModifications); - #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->minSizeAfterPendingModifications = size; - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::vector> priorModifications = self->getModificationsAndInsert(beginModifiedRange, -1, true, truncateEnded); - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (BUGGIFY_WITH_PROB(0.001)) - #line 4646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - priorModifications.push_back( delay(deterministicRandom()->random01() * FLOW_KNOBS->MAX_PRIOR_MODIFICATION_DELAY) || self->killed.getFuture()); - #line 4650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - else - { - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - priorModifications.push_back(waitUntilDiskReady(self->diskParameters, 0) || self->killed.getFuture()); - #line 4656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_4 = waitForAll(priorModifications); - #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 4662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont6(Void const& _,int loopDepth) - { - loopDepth = a_body1cont5(loopDepth); - - return loopDepth; - } - int a_body1cont6(Void && _,int loopDepth) - { - loopDepth = a_body1cont5(loopDepth); - - return loopDepth; - } - int a_body1cont4when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont6(_, loopDepth); - - return loopDepth; - } - int a_body1cont4when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont6(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TruncateActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< TruncateActor, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont4when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< TruncateActor, 3, Void >*,Void && value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont4when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< TruncateActor, 3, Void >*,Error err) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 3); - - } - int a_body1cont7(Void const& _,int loopDepth) - { - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->approximateSize = size; - #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->reponses.add(sendOnProcess(currentProcess, truncateStarted, currentTaskID)); - #line 4753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = a_body1cont11(loopDepth); - - return loopDepth; - } - int a_body1cont7(Void && _,int loopDepth) - { - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->approximateSize = size; - #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->reponses.add(sendOnProcess(currentProcess, truncateStarted, currentTaskID)); - #line 4764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = a_body1cont11(loopDepth); - - return loopDepth; - } - int a_body1cont5when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont7(_, loopDepth); - - return loopDepth; - } - int a_body1cont5when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont7(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose5() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TruncateActor, 4, Void >::remove(); - - } - void a_callback_fire(ActorCallback< TruncateActor, 4, Void >*,Void const& value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont5when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 4); - - } - void a_callback_fire(ActorCallback< TruncateActor, 4, Void >*,Void && value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont5when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 4); - - } - void a_callback_error(ActorCallback< TruncateActor, 4, Void >*,Error err) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 4); - - } - int a_body1cont11(int loopDepth) - { - try { - loopDepth = a_body1cont2(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont12(int loopDepth) - { - #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (g_network->check_yield(TaskPriority::DefaultYield)) - #line 4849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_7 = delay(0, TaskPriority::DefaultYield); - #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont12when1(__when_expr_7.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont12cont1(loopDepth); - } - - return loopDepth; - } - int a_body1cont2when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont12(loopDepth); - - return loopDepth; - } - int a_body1cont2when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont12(loopDepth); - - return loopDepth; - } - int a_body1cont2when2(bool const& durable,int loopDepth) - { - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - saveDurable = durable; - #line 4886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = a_body1cont12(loopDepth); - - return loopDepth; - } - int a_body1cont2when2(bool && durable,int loopDepth) - { - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - saveDurable = durable; - #line 4895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = a_body1cont12(loopDepth); - - return loopDepth; - } - void a_exitChoose6() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TruncateActor, 5, Void >::remove(); - static_cast(this)->ActorCallback< TruncateActor, 6, bool >::remove(); - - } - void a_callback_fire(ActorCallback< TruncateActor, 5, Void >*,Void const& value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1cont2when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 5); - - } - void a_callback_fire(ActorCallback< TruncateActor, 5, Void >*,Void && value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 5); - - } - void a_callback_error(ActorCallback< TruncateActor, 5, Void >*,Error err) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 5); - - } - void a_callback_fire(ActorCallback< TruncateActor, 6, bool >*,bool const& value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 6); - a_exitChoose6(); - try { - a_body1cont2when2(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 6); - - } - void a_callback_fire(ActorCallback< TruncateActor, 6, bool >*,bool && value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 6); - a_exitChoose6(); - try { - a_body1cont2when2(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 6); - - } - void a_callback_error(ActorCallback< TruncateActor, 6, bool >*,Error err) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 6); - a_exitChoose6(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 6); - - } - int a_body1cont12cont1(int loopDepth) - { - #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (saveDurable || self->killMode == NO_CORRUPTION || deterministicRandom()->random01() < 0.5) - #line 5001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_8 = self->file->truncate(size); - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont12cont1when1(__when_expr_8.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 8; - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - else - { - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TraceEvent("AsyncFileNonDurable_DroppedTruncate", self->id).detail("Size", size); - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TEST(true); - #line 5021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = a_body1cont12cont3(loopDepth); - } - - return loopDepth; - } - int a_body1cont12cont2(Void const& _,int loopDepth) - { - loopDepth = a_body1cont12cont1(loopDepth); - - return loopDepth; - } - int a_body1cont12cont2(Void && _,int loopDepth) - { - loopDepth = a_body1cont12cont1(loopDepth); - - return loopDepth; - } - int a_body1cont12when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont12cont2(_, loopDepth); - - return loopDepth; - } - int a_body1cont12when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont12cont2(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose7() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TruncateActor, 7, Void >::remove(); - - } - void a_callback_fire(ActorCallback< TruncateActor, 7, Void >*,Void const& value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 7); - a_exitChoose7(); - try { - a_body1cont12when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 7); - - } - void a_callback_fire(ActorCallback< TruncateActor, 7, Void >*,Void && value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 7); - a_exitChoose7(); - try { - a_body1cont12when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 7); - - } - void a_callback_error(ActorCallback< TruncateActor, 7, Void >*,Error err) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 7); - a_exitChoose7(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 7); - - } - int a_body1cont12cont3(int loopDepth) - { - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TruncateActorState(); static_cast(this)->destroy(); return 0; } - #line 5106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~TruncateActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont12cont4(Void const& _,int loopDepth) - { - loopDepth = a_body1cont12cont3(loopDepth); - - return loopDepth; - } - int a_body1cont12cont4(Void && _,int loopDepth) - { - loopDepth = a_body1cont12cont3(loopDepth); - - return loopDepth; - } - int a_body1cont12cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont12cont4(_, loopDepth); - - return loopDepth; - } - int a_body1cont12cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont12cont4(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose8() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TruncateActor, 8, Void >::remove(); - - } - void a_callback_fire(ActorCallback< TruncateActor, 8, Void >*,Void const& value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 8); - a_exitChoose8(); - try { - a_body1cont12cont1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 8); - - } - void a_callback_fire(ActorCallback< TruncateActor, 8, Void >*,Void && value) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 8); - a_exitChoose8(); - try { - a_body1cont12cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 8); - - } - void a_callback_error(ActorCallback< TruncateActor, 8, Void >*,Error err) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), 8); - a_exitChoose8(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("truncate", reinterpret_cast(this), 8); - - } - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - AsyncFileNonDurable* self; - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Promise truncateStarted; - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Future> ownFuture; - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int64_t size; - #line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ISimulator::ProcessInfo* currentProcess; - #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TaskPriority currentTaskID; - #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - double delayDuration; - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Future startSyncFuture; - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Future truncateEnded; - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - bool saveDurable; - #line 5209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -}; -// This generated class is to be used only via truncate() - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class TruncateActor final : public Actor, public ActorCallback< TruncateActor, 0, Void >, public ActorCallback< TruncateActor, 1, Void >, public ActorCallback< TruncateActor, 2, Future >, public ActorCallback< TruncateActor, 3, Void >, public ActorCallback< TruncateActor, 4, Void >, public ActorCallback< TruncateActor, 5, Void >, public ActorCallback< TruncateActor, 6, bool >, public ActorCallback< TruncateActor, 7, Void >, public ActorCallback< TruncateActor, 8, Void >, public FastAllocated, public TruncateActorState { - #line 5214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< TruncateActor, 0, Void >; -friend struct ActorCallback< TruncateActor, 1, Void >; -friend struct ActorCallback< TruncateActor, 2, Future >; -friend struct ActorCallback< TruncateActor, 3, Void >; -friend struct ActorCallback< TruncateActor, 4, Void >; -friend struct ActorCallback< TruncateActor, 5, Void >; -friend struct ActorCallback< TruncateActor, 6, bool >; -friend struct ActorCallback< TruncateActor, 7, Void >; -friend struct ActorCallback< TruncateActor, 8, Void >; - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TruncateActor(AsyncFileNonDurable* const& self,Promise const& truncateStarted,Future> const& ownFuture,int64_t const& size) - #line 5233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - : Actor(), - TruncateActorState(self, truncateStarted, ownFuture, size) - { - fdb_probe_actor_enter("truncate", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("truncate"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("truncate", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< TruncateActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< TruncateActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< TruncateActor, 2, Future >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< TruncateActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< TruncateActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< TruncateActor, 5, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< TruncateActor, 7, Void >*)0, actor_cancelled()); break; - case 8: this->a_callback_error((ActorCallback< TruncateActor, 8, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -[[nodiscard]] Future truncate( AsyncFileNonDurable* const& self, Promise const& truncateStarted, Future> const& ownFuture, int64_t const& size ) { - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return Future(new TruncateActor(self, truncateStarted, ownFuture, size)); - #line 5267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -} - -#line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - - // Waits for delayed modifications to the file to complete and then syncs the underlying file - // If durable is false, then some of the delayed modifications will not be applied or will be - // applied incorrectly - #line 5275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -// This generated class is to be used only via onSync() - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class OnSyncActorState { - #line 5281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - OnSyncActorState(AsyncFileNonDurable* const& self,bool const& durable) - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - : self(self), - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - durable(durable) - #line 5290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - fdb_probe_actor_create("onSync", reinterpret_cast(this)); - - } - ~OnSyncActorState() - { - fdb_probe_actor_destroy("onSync", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ASSERT(durable || !self->killed.isSet()); - #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (durable) - #line 5307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->hasBeenSynced = true; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_0 = waitUntilDiskReady(self->diskParameters, 0, true) || self->killed.getFuture(); - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont1(loopDepth); - } - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~OnSyncActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(int loopDepth) - { - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = checkKilled(self, durable ? "Sync" : "Kill"); - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont2(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(loopDepth); - - return loopDepth; - } - int a_body1cont2(Void && _,int loopDepth) - { - loopDepth = a_body1cont1(loopDepth); - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont2(_, loopDepth); - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont2(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OnSyncActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OnSyncActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< OnSyncActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< OnSyncActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 0); - - } - int a_body1cont3(Void const& _,int loopDepth) - { - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!durable) - #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->killed.send(Void()); - #line 5443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::vector> outstandingModifications; - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::vector> stillPendingModifications; - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - auto rangeItr = self->pendingModifications.ranges(); - #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - for(auto itr = rangeItr.begin();itr != rangeItr.end();++itr) { - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (itr.value().isValid() && (!itr->value().isReady() || itr->value().isError())) - #line 5455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - outstandingModifications.push_back(itr->value()); - #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!itr.value().isReady()) - #line 5461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - stillPendingModifications.push_back(itr->range()); - #line 5465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - } - } - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Future allModifications = waitForAll(outstandingModifications); - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->pendingModifications.insert(RangeMapRange(0, -1), Void()); - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - for(auto itr = stillPendingModifications.begin();itr != stillPendingModifications.end();++itr) { - #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->pendingModifications.insert( *itr, success(allModifications)); - #line 5477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Promise startSyncPromise = self->startSyncPromise; - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->startSyncPromise = Promise(); - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - writeDurable = durable || deterministicRandom()->random01() < 0.1; - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - startSyncPromise.send(writeDurable); - #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (durable) - #line 5489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_2 = allModifications; - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - else - { - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_3 = success(errorOr(allModifications)); - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when2(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - - return loopDepth; - } - int a_body1cont3(Void && _,int loopDepth) - { - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!durable) - #line 5524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->killed.send(Void()); - #line 5528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::vector> outstandingModifications; - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::vector> stillPendingModifications; - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - auto rangeItr = self->pendingModifications.ranges(); - #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - for(auto itr = rangeItr.begin();itr != rangeItr.end();++itr) { - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (itr.value().isValid() && (!itr->value().isReady() || itr->value().isError())) - #line 5540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - outstandingModifications.push_back(itr->value()); - #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!itr.value().isReady()) - #line 5546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - stillPendingModifications.push_back(itr->range()); - #line 5550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - } - } - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Future allModifications = waitForAll(outstandingModifications); - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->pendingModifications.insert(RangeMapRange(0, -1), Void()); - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - for(auto itr = stillPendingModifications.begin();itr != stillPendingModifications.end();++itr) { - #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->pendingModifications.insert( *itr, success(allModifications)); - #line 5562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Promise startSyncPromise = self->startSyncPromise; - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->startSyncPromise = Promise(); - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - writeDurable = durable || deterministicRandom()->random01() < 0.1; - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - startSyncPromise.send(writeDurable); - #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (durable) - #line 5574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_2 = allModifications; - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - else - { - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_3 = success(errorOr(allModifications)); - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when2(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - - return loopDepth; - } - int a_body1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OnSyncActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OnSyncActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< OnSyncActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< OnSyncActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 1); - - } - int a_body1cont4(int loopDepth) - { - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!durable) - #line 5672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (self->hasBeenSynced && writeDurable && deterministicRandom()->random01() < 0.5) - #line 5676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TEST(true); - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_4 = success(errorOr(self->file->sync())); - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont13(loopDepth); - } - } - else - { - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_5 = checkKilled(self, "SyncEnd"); - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont4when2(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - - return loopDepth; - } - int a_body1cont10(Void const& _,int loopDepth) - { - loopDepth = a_body1cont4(loopDepth); - - return loopDepth; - } - int a_body1cont10(Void && _,int loopDepth) - { - loopDepth = a_body1cont4(loopDepth); - - return loopDepth; - } - int a_body1cont3when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont10(_, loopDepth); - - return loopDepth; - } - int a_body1cont3when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont10(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OnSyncActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OnSyncActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< OnSyncActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< OnSyncActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 2); - - } - int a_body1cont11(Void const& _,int loopDepth) - { - loopDepth = a_body1cont4(loopDepth); - - return loopDepth; - } - int a_body1cont11(Void && _,int loopDepth) - { - loopDepth = a_body1cont4(loopDepth); - - return loopDepth; - } - int a_body1cont3when2(Void const& _,int loopDepth) - { - loopDepth = a_body1cont11(_, loopDepth); - - return loopDepth; - } - int a_body1cont3when2(Void && _,int loopDepth) - { - loopDepth = a_body1cont11(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OnSyncActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OnSyncActor, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont3when2(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< OnSyncActor, 3, Void >*,Void && value) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont3when2(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< OnSyncActor, 3, Void >*,Error err) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 3); - - } - int a_body1cont12(int loopDepth) - { - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OnSyncActorState(); static_cast(this)->destroy(); return 0; } - #line 5868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~OnSyncActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont13(int loopDepth) - { - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->killComplete.send(Void()); - #line 5880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = a_body1cont12(loopDepth); - - return loopDepth; - } - int a_body1cont14(Void const& _,int loopDepth) - { - loopDepth = a_body1cont13(loopDepth); - - return loopDepth; - } - int a_body1cont14(Void && _,int loopDepth) - { - loopDepth = a_body1cont13(loopDepth); - - return loopDepth; - } - int a_body1cont4when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont14(_, loopDepth); - - return loopDepth; - } - int a_body1cont4when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont14(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose5() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OnSyncActor, 4, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OnSyncActor, 4, Void >*,Void const& value) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont4when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 4); - - } - void a_callback_fire(ActorCallback< OnSyncActor, 4, Void >*,Void && value) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1cont4when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 4); - - } - void a_callback_error(ActorCallback< OnSyncActor, 4, Void >*,Error err) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 4); - a_exitChoose5(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 4); - - } - int a_body1cont15(Void const& _,int loopDepth) - { - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_6 = self->file->sync(); - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont15when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont15(Void && _,int loopDepth) - { - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_6 = self->file->sync(); - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont15when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont4when2(Void const& _,int loopDepth) - { - loopDepth = a_body1cont15(_, loopDepth); - - return loopDepth; - } - int a_body1cont4when2(Void && _,int loopDepth) - { - loopDepth = a_body1cont15(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose6() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OnSyncActor, 5, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OnSyncActor, 5, Void >*,Void const& value) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1cont4when2(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 5); - - } - void a_callback_fire(ActorCallback< OnSyncActor, 5, Void >*,Void && value) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1cont4when2(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 5); - - } - void a_callback_error(ActorCallback< OnSyncActor, 5, Void >*,Error err) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 5); - a_exitChoose6(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 5); - - } - int a_body1cont15cont1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont12(loopDepth); - - return loopDepth; - } - int a_body1cont15cont1(Void && _,int loopDepth) - { - loopDepth = a_body1cont12(loopDepth); - - return loopDepth; - } - int a_body1cont15when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont15cont1(_, loopDepth); - - return loopDepth; - } - int a_body1cont15when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont15cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose7() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OnSyncActor, 6, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OnSyncActor, 6, Void >*,Void const& value) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1cont15when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 6); - - } - void a_callback_fire(ActorCallback< OnSyncActor, 6, Void >*,Void && value) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1cont15when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 6); - - } - void a_callback_error(ActorCallback< OnSyncActor, 6, Void >*,Error err) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), 6); - a_exitChoose7(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSync", reinterpret_cast(this), 6); - - } - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - AsyncFileNonDurable* self; - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - bool durable; - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - bool writeDurable; - #line 6136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -}; -// This generated class is to be used only via onSync() - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class OnSyncActor final : public Actor, public ActorCallback< OnSyncActor, 0, Void >, public ActorCallback< OnSyncActor, 1, Void >, public ActorCallback< OnSyncActor, 2, Void >, public ActorCallback< OnSyncActor, 3, Void >, public ActorCallback< OnSyncActor, 4, Void >, public ActorCallback< OnSyncActor, 5, Void >, public ActorCallback< OnSyncActor, 6, Void >, public FastAllocated, public OnSyncActorState { - #line 6141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< OnSyncActor, 0, Void >; -friend struct ActorCallback< OnSyncActor, 1, Void >; -friend struct ActorCallback< OnSyncActor, 2, Void >; -friend struct ActorCallback< OnSyncActor, 3, Void >; -friend struct ActorCallback< OnSyncActor, 4, Void >; -friend struct ActorCallback< OnSyncActor, 5, Void >; -friend struct ActorCallback< OnSyncActor, 6, Void >; - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - OnSyncActor(AsyncFileNonDurable* const& self,bool const& durable) - #line 6158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - : Actor(), - OnSyncActorState(self, durable) - { - fdb_probe_actor_enter("onSync", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("onSync"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("onSync", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< OnSyncActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< OnSyncActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< OnSyncActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< OnSyncActor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< OnSyncActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< OnSyncActor, 5, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< OnSyncActor, 6, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -[[nodiscard]] Future onSync( AsyncFileNonDurable* const& self, bool const& durable ) { - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return Future(new OnSyncActor(self, durable)); - #line 6191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -} - -#line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - - #line 6196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -// This generated class is to be used only via sync() - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class SyncActorState { - #line 6202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - SyncActorState(AsyncFileNonDurable* const& self,bool const& durable) - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - : self(self), - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - durable(durable), - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentProcess(g_simulator.getCurrentProcess()), - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentTaskID(g_network->getCurrentTask()) - #line 6215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - fdb_probe_actor_create("sync", reinterpret_cast(this)); - - } - ~SyncActorState() - { - fdb_probe_actor_destroy("sync", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_0 = g_simulator.onMachine(currentProcess); - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~SyncActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) - { - try { - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = self->onSync(self, durable); - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 6263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont1(Void && _,int loopDepth) - { - try { - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = self->onSync(self, durable); - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 6286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SyncActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< SyncActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("sync", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("sync", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< SyncActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("sync", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("sync", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< SyncActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("sync", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("sync", reinterpret_cast(this), 0); - - } - int a_body1cont1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - err = e; - #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_3 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1Catch1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont3(Void const& _,int loopDepth) - { - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_2 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 6396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont3(Void && _,int loopDepth) - { - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_2 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 6412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SyncActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< SyncActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("sync", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("sync", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< SyncActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("sync", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("sync", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< SyncActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("sync", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("sync", reinterpret_cast(this), 1); - - } - int a_body1cont4(Void const& _,int loopDepth) - { - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SyncActorState(); static_cast(this)->destroy(); return 0; } - #line 6489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~SyncActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont4(Void && _,int loopDepth) - { - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SyncActorState(); static_cast(this)->destroy(); return 0; } - #line 6501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~SyncActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont3when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont4(_, loopDepth); - - return loopDepth; - } - int a_body1cont3when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont4(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SyncActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< SyncActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("sync", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("sync", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< SyncActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("sync", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("sync", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< SyncActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("sync", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("sync", reinterpret_cast(this), 2); - - } - int a_body1cont1Catch1cont1(Void const& _,int loopDepth) - { - #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(err, loopDepth); - #line 6576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - - return loopDepth; - } - int a_body1cont1Catch1cont1(Void && _,int loopDepth) - { - #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(err, loopDepth); - #line 6584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - - return loopDepth; - } - int a_body1cont1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1cont1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SyncActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< SyncActor, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("sync", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("sync", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< SyncActor, 3, Void >*,Void && value) - { - fdb_probe_actor_enter("sync", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("sync", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< SyncActor, 3, Void >*,Error err) - { - fdb_probe_actor_enter("sync", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("sync", reinterpret_cast(this), 3); - - } - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - AsyncFileNonDurable* self; - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - bool durable; - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ISimulator::ProcessInfo* currentProcess; - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TaskPriority currentTaskID; - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Error err; - #line 6661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -}; -// This generated class is to be used only via sync() - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class SyncActor final : public Actor, public ActorCallback< SyncActor, 0, Void >, public ActorCallback< SyncActor, 1, Void >, public ActorCallback< SyncActor, 2, Void >, public ActorCallback< SyncActor, 3, Void >, public FastAllocated, public SyncActorState { - #line 6666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< SyncActor, 0, Void >; -friend struct ActorCallback< SyncActor, 1, Void >; -friend struct ActorCallback< SyncActor, 2, Void >; -friend struct ActorCallback< SyncActor, 3, Void >; - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - SyncActor(AsyncFileNonDurable* const& self,bool const& durable) - #line 6680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - : Actor(), - SyncActorState(self, durable) - { - fdb_probe_actor_enter("sync", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("sync"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("sync", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< SyncActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< SyncActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< SyncActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< SyncActor, 3, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -[[nodiscard]] Future sync( AsyncFileNonDurable* const& self, bool const& durable ) { - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return Future(new SyncActor(self, durable)); - #line 6710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -} - -#line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - - // Passes along size requests to the underlying file, augmenting with any writes past the end of the file - #line 6716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -// This generated class is to be used only via onSize() - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class OnSizeActorState { - #line 6722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - OnSizeActorState(AsyncFileNonDurable const* const& self) - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - : self(self) - #line 6729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - fdb_probe_actor_create("onSize", reinterpret_cast(this)); - - } - ~OnSizeActorState() - { - fdb_probe_actor_destroy("onSize", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_0 = checkKilled(self, "Size"); - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~OnSizeActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) - { - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - sizeFuture = self->file->size(); - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = success(sizeFuture) || self->killed.getFuture(); - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void && _,int loopDepth) - { - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - sizeFuture = self->file->size(); - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = success(sizeFuture) || self->killed.getFuture(); - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OnSizeActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OnSizeActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("onSize", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSize", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< OnSizeActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("onSize", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSize", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< OnSizeActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("onSize", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSize", reinterpret_cast(this), 0); - - } - int a_body1cont2(Void const& _,int loopDepth) - { - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_2 = checkKilled(self, "SizeEnd"); - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont2(Void && _,int loopDepth) - { - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_2 = checkKilled(self, "SizeEnd"); - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont2(_, loopDepth); - - return loopDepth; - } - int a_body1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont2(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OnSizeActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OnSizeActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("onSize", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSize", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< OnSizeActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("onSize", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSize", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< OnSizeActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("onSize", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSize", reinterpret_cast(this), 1); - - } - int a_body1cont3(Void const& _,int loopDepth) - { - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->approximateSize = self->minSizeAfterPendingModifications = std::max(sizeFuture.get(), self->minSizeAfterPendingModifications); - #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->minSizeAfterPendingModificationsIsExact = true; - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(self->approximateSize); this->~OnSizeActorState(); static_cast(this)->destroy(); return 0; } - #line 6972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< int64_t >::value()) int64_t(self->approximateSize); - this->~OnSizeActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont3(Void && _,int loopDepth) - { - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->approximateSize = self->minSizeAfterPendingModifications = std::max(sizeFuture.get(), self->minSizeAfterPendingModifications); - #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->minSizeAfterPendingModificationsIsExact = true; - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(self->approximateSize); this->~OnSizeActorState(); static_cast(this)->destroy(); return 0; } - #line 6988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< int64_t >::value()) int64_t(self->approximateSize); - this->~OnSizeActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont2when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1cont2when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< OnSizeActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< OnSizeActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("onSize", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont2when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSize", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< OnSizeActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("onSize", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont2when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSize", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< OnSizeActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("onSize", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("onSize", reinterpret_cast(this), 2); - - } - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - AsyncFileNonDurable const* self; - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Future sizeFuture; - #line 7063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -}; -// This generated class is to be used only via onSize() - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class OnSizeActor final : public Actor, public ActorCallback< OnSizeActor, 0, Void >, public ActorCallback< OnSizeActor, 1, Void >, public ActorCallback< OnSizeActor, 2, Void >, public FastAllocated, public OnSizeActorState { - #line 7068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< OnSizeActor, 0, Void >; -friend struct ActorCallback< OnSizeActor, 1, Void >; -friend struct ActorCallback< OnSizeActor, 2, Void >; - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - OnSizeActor(AsyncFileNonDurable const* const& self) - #line 7081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - : Actor(), - OnSizeActorState(self) - { - fdb_probe_actor_enter("onSize", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("onSize"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("onSize", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< OnSizeActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< OnSizeActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< OnSizeActor, 2, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -[[nodiscard]] static Future onSize( AsyncFileNonDurable const* const& self ) { - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return Future(new OnSizeActor(self)); - #line 7110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -} - -#line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - - #line 7115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -// This generated class is to be used only via size() - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class SizeActorState { - #line 7121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - SizeActorState(AsyncFileNonDurable const* const& self) - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - : self(self), - #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentProcess(g_simulator.getCurrentProcess()), - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentTaskID(g_network->getCurrentTask()) - #line 7132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - fdb_probe_actor_create("size", reinterpret_cast(this)); - - } - ~SizeActorState() - { - fdb_probe_actor_destroy("size", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_0 = g_simulator.onMachine(currentProcess); - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~SizeActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) - { - try { - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = onSize(self); - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 7180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont1(Void && _,int loopDepth) - { - try { - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = onSize(self); - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 7203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SizeActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< SizeActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("size", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("size", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< SizeActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("size", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("size", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< SizeActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("size", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("size", reinterpret_cast(this), 0); - - } - int a_body1cont1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - err = e; - #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_3 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1Catch1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont3(int loopDepth) - { - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_2 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 7313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1when1(int64_t const& __rep,int loopDepth) - { - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - rep = __rep; - #line 7327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = a_body1cont3(loopDepth); - - return loopDepth; - } - int a_body1cont1when1(int64_t && __rep,int loopDepth) - { - rep = std::move(__rep); - loopDepth = a_body1cont3(loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SizeActor, 1, int64_t >::remove(); - - } - void a_callback_fire(ActorCallback< SizeActor, 1, int64_t >*,int64_t const& value) - { - fdb_probe_actor_enter("size", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("size", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< SizeActor, 1, int64_t >*,int64_t && value) - { - fdb_probe_actor_enter("size", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("size", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< SizeActor, 1, int64_t >*,Error err) - { - fdb_probe_actor_enter("size", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("size", reinterpret_cast(this), 1); - - } - int a_body1cont4(Void const& _,int loopDepth) - { - #line 834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(rep); this->~SizeActorState(); static_cast(this)->destroy(); return 0; } - #line 7394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< int64_t >::value()) int64_t(std::move(rep)); // state_var_RVO - this->~SizeActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont4(Void && _,int loopDepth) - { - #line 834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(rep); this->~SizeActorState(); static_cast(this)->destroy(); return 0; } - #line 7406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< int64_t >::value()) int64_t(std::move(rep)); // state_var_RVO - this->~SizeActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont3when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont4(_, loopDepth); - - return loopDepth; - } - int a_body1cont3when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont4(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SizeActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< SizeActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("size", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("size", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< SizeActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("size", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("size", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< SizeActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("size", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("size", reinterpret_cast(this), 2); - - } - int a_body1cont1Catch1cont1(Void const& _,int loopDepth) - { - #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(err, loopDepth); - #line 7481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - - return loopDepth; - } - int a_body1cont1Catch1cont1(Void && _,int loopDepth) - { - #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(err, loopDepth); - #line 7489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - - return loopDepth; - } - int a_body1cont1Catch1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1Catch1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1cont1Catch1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1Catch1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose4() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SizeActor, 3, Void >::remove(); - - } - void a_callback_fire(ActorCallback< SizeActor, 3, Void >*,Void const& value) - { - fdb_probe_actor_enter("size", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont1Catch1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("size", reinterpret_cast(this), 3); - - } - void a_callback_fire(ActorCallback< SizeActor, 3, Void >*,Void && value) - { - fdb_probe_actor_enter("size", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1cont1Catch1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("size", reinterpret_cast(this), 3); - - } - void a_callback_error(ActorCallback< SizeActor, 3, Void >*,Error err) - { - fdb_probe_actor_enter("size", reinterpret_cast(this), 3); - a_exitChoose4(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("size", reinterpret_cast(this), 3); - - } - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - AsyncFileNonDurable const* self; - #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ISimulator::ProcessInfo* currentProcess; - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TaskPriority currentTaskID; - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - int64_t rep; - #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Error err; - #line 7566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -}; -// This generated class is to be used only via size() - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class SizeActor final : public Actor, public ActorCallback< SizeActor, 0, Void >, public ActorCallback< SizeActor, 1, int64_t >, public ActorCallback< SizeActor, 2, Void >, public ActorCallback< SizeActor, 3, Void >, public FastAllocated, public SizeActorState { - #line 7571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< SizeActor, 0, Void >; -friend struct ActorCallback< SizeActor, 1, int64_t >; -friend struct ActorCallback< SizeActor, 2, Void >; -friend struct ActorCallback< SizeActor, 3, Void >; - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - SizeActor(AsyncFileNonDurable const* const& self) - #line 7585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - : Actor(), - SizeActorState(self) - { - fdb_probe_actor_enter("size", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("size"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("size", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< SizeActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< SizeActor, 1, int64_t >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< SizeActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< SizeActor, 3, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -[[nodiscard]] static Future size( AsyncFileNonDurable const* const& self ) { - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return Future(new SizeActor(self)); - #line 7615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -} - -#line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - - // Finishes all outstanding actors on an AsyncFileNonDurable and then deletes it - #line 7621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -// This generated class is to be used only via closeFile() - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -template - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class CloseFileActorState { - #line 7627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - CloseFileActorState(AsyncFileNonDurable* const& self) - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - : self(self), - #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentProcess(g_simulator.getCurrentProcess()), - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - currentTaskID(g_network->getCurrentTask()), - #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - filename(self->filename) - #line 7640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - fdb_probe_actor_create("closeFile", reinterpret_cast(this)); - - } - ~CloseFileActorState() - { - fdb_probe_actor_destroy("closeFile", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - g_simulator.getMachineByNetworkAddress(self->openedAddress)->deletingOrClosingFiles.insert(self->getFilename()); - #line 850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_0 = g_simulator.onMachine(currentProcess); - #line 850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~CloseFileActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(Void const& _,int loopDepth) - { - try { - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Promise startSyncPromise = self->startSyncPromise; - #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->startSyncPromise = Promise(); - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - startSyncPromise.send(true); - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::vector> outstandingModifications; - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - for(auto itr = self->pendingModifications.ranges().begin();itr != self->pendingModifications.ranges().end();++itr) { - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (itr->value().isValid() && !itr->value().isReady()) - #line 7698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - outstandingModifications.push_back(itr->value()); - #line 7702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - } - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = waitForAllReady(outstandingModifications); - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 7709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont1(Void && _,int loopDepth) - { - try { - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Promise startSyncPromise = self->startSyncPromise; - #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - self->startSyncPromise = Promise(); - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - startSyncPromise.send(true); - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::vector> outstandingModifications; - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - for(auto itr = self->pendingModifications.ranges().begin();itr != self->pendingModifications.ranges().end();++itr) { - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (itr->value().isValid() && !itr->value().isReady()) - #line 7740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - outstandingModifications.push_back(itr->value()); - #line 7744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - } - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_1 = waitForAllReady(outstandingModifications); - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 7751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1cont1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CloseFileActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< CloseFileActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< CloseFileActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< CloseFileActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 0); - - } - int a_body1cont1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - err = e; - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return a_body1Catch1(err, loopDepth); - #line 7837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1cont3(Void const& _,int loopDepth) - { - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (self->killed.isSet()) - #line 7851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_2 = self->killComplete.getFuture(); - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 7857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont6(loopDepth); - } - - return loopDepth; - } - int a_body1cont3(Void && _,int loopDepth) - { - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (self->killed.isSet()) - #line 7876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - { - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - StrictFuture __when_expr_2 = self->killComplete.getFuture(); - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 7882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - loopDepth = 0; - } - else - { - loopDepth = a_body1cont6(loopDepth); - } - - return loopDepth; - } - int a_body1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont3(_, loopDepth); - - return loopDepth; - } - int a_body1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont3(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CloseFileActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< CloseFileActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< CloseFileActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< CloseFileActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 1); - - } - int a_body1cont6(int loopDepth) - { - #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - g_simulator.getMachineByNetworkAddress(self->openedAddress)->closingFiles.erase(self->getFilename()); - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - g_simulator.getMachineByNetworkAddress(self->openedAddress) ->deletingOrClosingFiles.erase(self->getFilename()); - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - AsyncFileNonDurable::filesBeingDeleted.erase(self->filename); - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - delete self; - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CloseFileActorState(); static_cast(this)->destroy(); return 0; } - #line 7972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~CloseFileActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - - return loopDepth; - } - int a_body1cont7(Void const& _,int loopDepth) - { - loopDepth = a_body1cont6(loopDepth); - - return loopDepth; - } - int a_body1cont7(Void && _,int loopDepth) - { - loopDepth = a_body1cont6(loopDepth); - - return loopDepth; - } - int a_body1cont3when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont7(_, loopDepth); - - return loopDepth; - } - int a_body1cont3when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont7(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< CloseFileActor, 2, Void >::remove(); - - } - void a_callback_fire(ActorCallback< CloseFileActor, 2, Void >*,Void const& value) - { - fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(value, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< CloseFileActor, 2, Void >*,Void && value) - { - fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont3when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< CloseFileActor, 2, Void >*,Error err) - { - fdb_probe_actor_enter("closeFile", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("closeFile", reinterpret_cast(this), 2); - - } - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - AsyncFileNonDurable* self; - #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - ISimulator::ProcessInfo* currentProcess; - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - TaskPriority currentTaskID; - #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - std::string filename; - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - Error err; - #line 8065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -}; -// This generated class is to be used only via closeFile() - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -class CloseFileActor final : public Actor, public ActorCallback< CloseFileActor, 0, Void >, public ActorCallback< CloseFileActor, 1, Void >, public ActorCallback< CloseFileActor, 2, Void >, public FastAllocated, public CloseFileActorState { - #line 8070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< CloseFileActor, 0, Void >; -friend struct ActorCallback< CloseFileActor, 1, Void >; -friend struct ActorCallback< CloseFileActor, 2, Void >; - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - CloseFileActor(AsyncFileNonDurable* const& self) - #line 8083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" - : Actor(), - CloseFileActorState(self) - { - fdb_probe_actor_enter("closeFile", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("closeFile"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("closeFile", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< CloseFileActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< CloseFileActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< CloseFileActor, 2, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -[[nodiscard]] Future closeFile( AsyncFileNonDurable* const& self ) { - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" - return Future(new CloseFileActor(self)); - #line 8112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.g.h" -} - -#line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileNonDurable.actor.h" -}; - -#include "flow/unactorcompiler.h" -#endif diff --git a/src/fdbrpc/Base64Decode.cpp b/src/fdbrpc/Base64Decode.cpp new file mode 100644 index 0000000..507798e --- /dev/null +++ b/src/fdbrpc/Base64Decode.cpp @@ -0,0 +1,424 @@ +/* + * Base64Decode.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include +#include +#include "fdbrpc/Base64Encode.h" +#include "fdbrpc/Base64Decode.h" +#include "flow/flow.h" +#include "flow/Arena.h" +#include "flow/Error.h" +#include "flow/UnitTest.h" + +namespace { + +constexpr uint8_t _X = 0xff; + +template +inline uint8_t decodeValue(uint8_t valueIn) noexcept { + if constexpr (UrlDecode) { + // clang-format off + // Decodes base64url-encoding's 64 legal ASCII character byte: i.e. alphanumeric, '-', and '_' + // into 6-bit fragment, a sequence containing four of which would form 3 original bytes. + constexpr const uint8_t decoding[] = { // 20x13 + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, 62, _X, _X, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, _X, _X, + _X, _X, _X, _X, _X, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, _X, _X, _X, _X, 63, _X, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X }; + // clang-format on + static_assert(sizeof(decoding) / sizeof(decoding[0]) == 256); + return decoding[valueIn]; + } else { + // clang-format off + // same as url-encoded base64, except that this encoding assumes '+' instead of '-', + // and '/' instead of '_'. + constexpr const uint8_t decoding[] = { // 20x13 + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, 62, _X, _X, _X, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, _X, _X, + _X, _X, _X, _X, _X, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, _X, _X, _X, _X, _X, _X, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, + _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X, _X }; + // clang-format on + static_assert(sizeof(decoding) / sizeof(decoding[0]) == 256); + return decoding[valueIn]; + } +} + +template +int doDecode(const uint8_t* __restrict codeIn, const int lengthIn, uint8_t* __restrict plaintextOut) noexcept { + const uint8_t* codechar = codeIn; + const uint8_t* const codeEnd = codeIn + lengthIn; + uint8_t* plainchar = plaintextOut; + uint8_t fragment = 0; + + while (1) { + // code 1 of 4 + if (codechar == codeEnd) { + return plainchar - plaintextOut; + } + fragment = decodeValue(*codechar++); + if (fragment == _X) + return -1; + *plainchar = (fragment & 0x03f) << 2; + if (codechar == codeEnd) { + return -1; // requires at least 2 chars to decode 1 plain byte + } + // code 2 of 4 + fragment = decodeValue(*codechar++); + if (fragment == _X) + return -1; + *plainchar++ |= (fragment & 0x030) >> 4; + if (codechar == codeEnd) { + return plainchar - plaintextOut; + } + *plainchar = (fragment & 0x00f) << 4; + // code 3 of 4 + fragment = decodeValue(*codechar++); + if (fragment == _X) + return -1; + *plainchar++ |= (fragment >> 2); + if (codechar == codeEnd) { + return plainchar - plaintextOut; + } + *plainchar = (fragment & 0x003) << 6; + // code 4 of 4 + fragment = decodeValue(*codechar++); + if (fragment == _X) + return -1; + *plainchar++ |= (fragment & 0x03f); + } + /* control should not reach here */ + return plainchar - plaintextOut; +} + +// assumes codeLength after padding stripped +int getDecodedLength(int codeLength) noexcept { + const auto r = (codeLength % 4); + if (r == 1) + return -1; + else if (r == 0) + return (codeLength / 4) * 3; + else + return (codeLength / 4) * 3 + (r - 1); +} + +template +Optional decodeStringRef(Arena& arena, StringRef codeText) { + if constexpr (!UrlDecode) { + // check length alignment and strip padding, if any + if (codeText.size() % 4) + return {}; + if (!codeText.empty() && codeText.back() == '=') + codeText.popBack(); + if (!codeText.empty() && codeText.back() == '=') + codeText.popBack(); + } + auto decodedLen = getDecodedLength(codeText.size()); + if (decodedLen <= 0) { + if (decodedLen == 0) + return StringRef{}; + return {}; + } + auto out = new (arena) uint8_t[decodedLen]; + auto actualLen = doDecode(codeText.begin(), codeText.size(), out); + if (actualLen == -1) { + return {}; + } + ASSERT_EQ(decodedLen, actualLen); + return StringRef(out, decodedLen); +} + +} // anonymous namespace + +namespace base64 { + +int decodedLength(int codeLength) noexcept { + // Non-urlencoded base64 cannot predict the decoded length on encoded length alone due to padding, + // which makes this a conservative estimate, not an exact one. + return (codeLength / 4) * 3; +} + +int decode(const uint8_t* __restrict codeIn, const int lengthIn, uint8_t* __restrict plaintextOut) noexcept { + if (lengthIn % 4) { + return -1; + } else { + int actualLen = lengthIn; + if (actualLen > 0 && codeIn[actualLen - 1] == '=') + actualLen--; + if (actualLen > 0 && codeIn[actualLen - 1] == '=') + actualLen--; + return doDecode(codeIn, actualLen, plaintextOut); + } +} + +Optional decode(Arena& arena, StringRef codeText) { + return decodeStringRef(arena, codeText); +} + +namespace url { + +int decodedLength(int codeLength) noexcept { + return getDecodedLength(codeLength); +} + +int decode(const uint8_t* __restrict codeIn, const int lengthIn, uint8_t* __restrict plaintextOut) noexcept { + return doDecode(codeIn, lengthIn, plaintextOut); +} + +Optional decode(Arena& arena, StringRef codeText) { + return decodeStringRef(arena, codeText); +} + +} // namespace url + +} // namespace base64 + +// transform the input on-the-fly to build testcase for non-urlencoded cases +StringRef urlEncodedTestData[][2] = { + { ""_sr, ""_sr }, + { "f"_sr, "Zg"_sr }, + { "fo"_sr, "Zm8"_sr }, + { "foo"_sr, "Zm9v"_sr }, + { "foob"_sr, "Zm9vYg"_sr }, + { "fooba"_sr, "Zm9vYmE"_sr }, + { "foobar"_sr, "Zm9vYmFy"_sr }, + { "Q\xc2\x93\x86\x04H\xfd\"r\x9c\xf7\xafW\xd1\x87^"_sr, "UcKThgRI_SJynPevV9GHXg"_sr }, + { "\x93"_sr, "kw"_sr }, + { "\xfcpF\xd2\x15\x03\x8a\xcb\\#!\xa1\x95\x18\x13\xfcpoN\rh=\xa5\x05\xe5\x00\xf8<\xc3\x8b'C\x90\xfc\xa0x\x13" + "8q\r\xd4\xca\xc9Yjv"_sr, + "_HBG0hUDistcIyGhlRgT_HBvTg1oPaUF5QD4PMOLJ0OQ_KB4EzhxDdTKyVlqdg"_sr }, + { "\xdd\xbb\x91>@\x9d\x88\x01Qb\x97[\xc3Q\xf6Q\\LF\xe2}\xfb\xf0\xe8\x98\xba\x8c\xc7\xc9\x0e$\xe4q\xcf;\xe4" + "e\x02" + "DA\xa9\x9a\xf0r\xc9\xf0\xd2-\x98"_sr, + "3buRPkCdiAFRYpdbw1H2UVxMRuJ9-_DomLqMx8kOJORxzzvkZQJEQama8HLJ8NItmA"_sr }, + { "2\x7f\x98\xfe\xb4\x05\x18.%.\xd0\x14\xea\x8e+\xa5\xc5\xbd" + "F-Lm\x04\x1aQ\xde\x1e\x9c\x12\xe6\x81{\x9dj\xe8\x9cP\xf4\xf7\x8a<\x12"_sr, + "Mn-Y_rQFGC4lLtAU6o4rpcW9Ri1MbQQaUd4enBLmgXudauicUPT3ijwS"_sr }, + { "\xa3" + "b\xc9\x13|\x94\xab)}\xf4N\xbc\xb2\xc5$\x15\xed\xb0\x98\xa4v\x8b\x91\xe4M\xb8\xde!\x94"_sr, + "o2LJE3yUqyl99E68ssUkFe2wmKR2i5HkTbjeIZQ"_sr }, + { "\xa0\xe9\xb4=4\xba\xbd\xbd\xaa\xfd\x96\xcb\x03\xd3\xb7\xc9\xb7i7\x18$^\xba\xe5\xb3\x8a\xf4O\xdb"_sr, + "oOm0PTS6vb2q_ZbLA9O3ybdpNxgkXrrls4r0T9s"_sr }, + { "\x10\xf4zscNoE\xfd\xc5\x8d\x16\x82t|y\n\xcf\xe8\x98\xf8)\xcd\xefm\xe2\xe1%\x17\x05T9;Zb\x05\x02\xc7" + "B\x8c\xc5\xc5\x95" + "8\xf2"_sr, + "EPR6c2NOb0X9xY0WgnR8eQrP6Jj4Kc3vbeLhJRcFVDk7WmIFAsdCjMXFlTjy"_sr }, + { "NG\"hA\xff\\\xf5lD\xf7\x08" + "7\xb9\t\x07\xa5\xb9\xac\x0b\x9fT+\xfa"_sr, + "TkciaEH_XPVsRPcIN7kJB6W5rAufVCv6"_sr }, + { "\xbd\xf5\xb0\x8eh1\x1b\xd1\x13q\x88z0*b\x9cNg\x88\x88MBD\x17\xec\xb0yc3\xbb"_sr, + "vfWwjmgxG9ETcYh6MCpinE5niIhNQkQX7LB5YzO7"_sr }, + { "&\xe0> \xfc\xea\x8e\xc1[I\xec\xe8\x03\x15\tc\x9b\x0f" + "d\x13" + "d\xab\xa5\x16\xa2p\x91\xd5\x11\xf5X\xa7\xbd\xe1\xa1" + "B\x8e\xe8\xddn2\xbf\x97"_sr, + "JuA-IPzqjsFbSezoAxUJY5sPZBNkq6UWonCR1RH1WKe94aFCjujdbjK_lw"_sr }, + { "|W,\xa5\xce\x83\xb0\xec\x87\x86\xd0\xd5w\xddQI\xc9\xba\x8f"_sr, + "wCvquQHy6I7yD3SLoKQMcT2mY_F2m4HHKtDoWgQiCeg-1XfdUUnJuo8"_sr }, + { "\xac" + "5\x8aH\xc9q\xad\xbe\x1f\x80\xed\xe1"_sr, + "rDWKSMlxrb4fgO3h"_sr }, + { "0}\x82\x95\xbb'\xf2\xdf" + "dR\x8f\xc2\xac\xb3\xc7\x9f\xc0\xf0" + "C3L\xbe" + "E\xe5\xf1\xc4% \xec\xe9"_sr, + "MH2Clbsn8t9kUo_CrLPHn8DwQzNMvkXl8cQlIOzp"_sr }, + { "\x8b\xab\xd7\xf9\xa5\xd8H\x1d"_sr, "i6vX-aXYSB0"_sr }, + { "i!\xdc\xb7~9\x7f\xad\xa0\x9d\x1e\xcc\xedTj\xe3\xe2\x88Q\x1e\xaa\xf9\xc3\xc5\xc5\xcdq\x9e\x07~\x9e\xcb\xf3\xd3\xb2\xec\xe0[m+\x0c\x9c"_sr, + "aSHct345f62gnR7M7VRq4-KIUR6q-cPFxc1xngd-nsvz07Ls4FttKwyc"_sr }, + { "\x01-{.s\xa5qF4\x1f" + "a\x11\xe4\x1eN"_sr, + "AS17LnOlcUY0H2ER5B5O"_sr }, + { "\x1c\xab\xce" + "e\xfc\xa7" + "are\x1f\x9a\xb4\xcdr\xe2v95\x88"_sr, + "HKvOZfynYXJlH5q0zXLidjk1iA"_sr }, + { "\xde\x0e\x16V\x12\x0f\xa4\xaf" + "2\xe7k3\xe8\"\x0b\xcb\x80\xa5\x96,\xba\xef\x1c\xe3\xd8\x16" + "C1\xccI\x8a]W\xf0\xbf\xaf\x19" + "4\xf9\r*<^?8C\x81\xd3(\xc6"_sr, + "3g4WVhIPpK8y52sz6CILy4Clliy67xzj2BZDMcxJil1X8L-vGTT5DSo8Xj84Q4HTKMY"_sr }, + { "\xe1\xe2\x8a" + "8v\x1f\xe0|\xccIJ\t"_sr, + "4eKKOHYf4HzMSUoJ"_sr }, +}; + +static Void runTest(std::function conversionFn, + StringRef (&stringEncodeFn)(Arena&, StringRef), + Optional (&stringDecodeFn)(Arena&, StringRef), + std::function encodeOutputCheckFn) { + const int testSetLen = sizeof(urlEncodedTestData) / sizeof(urlEncodedTestData[0]); + for (auto i = 0; i < testSetLen; i++) { + auto tmpArena = Arena(); + auto [decodeOutputExpected, encodeOutputExpected] = urlEncodedTestData[i]; + // optionally convert base64Url-encoded test input to regular base64 + encodeOutputExpected = conversionFn(tmpArena, encodeOutputExpected); + auto encodeOutput = stringEncodeFn(tmpArena, decodeOutputExpected); + if (encodeOutput != encodeOutputExpected) { + fmt::print("Test case {} (encode): expected '{}' got '{}'\n", + i + 1, + encodeOutputExpected.toHexString(), + encodeOutput.toHexString()); + ASSERT(false); + } + auto decodeOutput = stringDecodeFn(tmpArena, encodeOutputExpected); + ASSERT(decodeOutput.present()); + if (decodeOutput.get() != decodeOutputExpected) { + fmt::print("Test case {} (decode): expected '{}' got '{}'\n", + i + 1, + decodeOutputExpected.toHexString(), + decodeOutput.get().toHexString()); + ASSERT(false); + } + } + auto& rng = *deterministicRandom(); + for (auto i = 0; i < 100; i++) { + auto tmpArena = Arena(); + auto inputLen = rng.randomInt(1, 300); + auto inputBuf = new (tmpArena) uint8_t[inputLen]; + for (auto i = 0; i < inputLen; i++) + inputBuf[i] = rng.randomInt(0, 256); + auto input = StringRef(inputBuf, inputLen); + auto output = stringEncodeFn(tmpArena, input); + encodeOutputCheckFn(output, i); + auto decodeOutput = stringDecodeFn(tmpArena, output); + ASSERT(decodeOutput.present()); + if (input != decodeOutput.get()) { + fmt::print("Dynamic case {} (decode) failed, expected '{}', got '{}'\n", + i + 1, + input.toHexString(), + decodeOutput.get().toHexString()); + ASSERT(false); + } + } + return Void(); +} + +TEST_CASE("/fdbrpc/Base64UrlEncode") { + return runTest([](Arena&, StringRef input) { return input; }, // no op (input already url-encoded) + base64::url::encode, + base64::url::decode, + [](StringRef encodeOutput, int n) { + ASSERT_NE(encodeOutput.size() % 4, 1); + // verify that output contains only base64url-legal characters + for (auto i = 0; i < encodeOutput.size(); ++i) { + auto const value = decodeValue(encodeOutput[i]); + if (value == _X) { + fmt::print( + "Random-generated case {} has illegal encoded output char: {}th byte, value {}\n", + n + 1, + i + 1, + static_cast(value)); + ASSERT(false); + } + } + }); +} + +static StringRef transformBase64UrlToBase64(Arena& arena, StringRef input) { + if (input.empty()) + return StringRef(); + const int len = ((input.size() + 3) / 4) * 4; // ceil_align(input.size(), 4) + auto output = new (arena) uint8_t[len]; + for (auto i = 0; i < input.size(); i++) { + if (input[i] == '-') { + output[i] = '+'; + } else if (input[i] == '_') { + output[i] = '/'; + } else { + output[i] = input[i]; + } + } + for (auto i = input.size(); i < len; i++) + output[i] = '='; + return StringRef(output, len); +} + +TEST_CASE("/fdbrpc/Base64Encode") { + return runTest(transformBase64UrlToBase64, base64::encode, base64::decode, [](StringRef encodeOutput, int n) { + ASSERT_EQ(encodeOutput.size() % 4, 0); + if (!encodeOutput.empty() && encodeOutput.back() == '=') + encodeOutput.popBack(); + if (!encodeOutput.empty() && encodeOutput.back() == '=') + encodeOutput.popBack(); + for (auto i = 0; i < encodeOutput.size(); ++i) { + auto const value = decodeValue(encodeOutput[i]); + if (value == _X) { + fmt::print("Random-generated case {} has illegal encoded output char: {}th byte, value {}\n", + n + 1, + i + 1, + static_cast(value)); + ASSERT(false); + } + } + }); +} diff --git a/src/fdbrpc/Base64Encode.cpp b/src/fdbrpc/Base64Encode.cpp new file mode 100644 index 0000000..7370c86 --- /dev/null +++ b/src/fdbrpc/Base64Encode.cpp @@ -0,0 +1,143 @@ +/* + * Base64Encode.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbrpc/Base64Encode.h" + +namespace { + +// work around GCC bug 87476 (~9.0) +static const uint8_t urlEncodedTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; +static const uint8_t regularBase64Table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +template +uint8_t encodeValue(uint8_t valueIn) noexcept { + if constexpr (UrlEncode) { + return urlEncodedTable[valueIn]; + } else { + return regularBase64Table[valueIn]; + } +} + +template +int doEncode(const uint8_t* __restrict plaintextIn, int lengthIn, uint8_t* __restrict codeOut) noexcept { + const uint8_t* plainchar = plaintextIn; + const uint8_t* const plaintextEnd = plaintextIn + lengthIn; + uint8_t* codechar = codeOut; + uint8_t result = 0; + uint8_t fragment = 0; + + while (1) { + if (plainchar == plaintextEnd) { + return codechar - codeOut; + } + // byte 1 of 3 + fragment = *plainchar++; + result = (fragment & 0x0fc) >> 2; + *codechar++ = encodeValue(result); + result = (fragment & 0x003) << 4; + if (plainchar == plaintextEnd) { + *codechar++ = encodeValue(result); + if constexpr (!UrlEncode) { + *codechar++ = '='; + *codechar++ = '='; + } + return codechar - codeOut; + } + // byte 2 of 3 + fragment = *plainchar++; + result |= (fragment & 0x0f0) >> 4; + *codechar++ = encodeValue(result); + result = (fragment & 0x00f) << 2; + if (plainchar == plaintextEnd) { + *codechar++ = encodeValue(result); + if constexpr (!UrlEncode) { + *codechar++ = '='; + } + return codechar - codeOut; + } + // byte 3 of 3 + fragment = *plainchar++; + result |= (fragment & 0x0c0) >> 6; + *codechar++ = encodeValue(result); + result = (fragment & 0x03f) >> 0; + *codechar++ = encodeValue(result); + } + /* control should not reach here */ + return codechar - codeOut; +} + +template +int getEncodedLength(int dataLength) noexcept { + if constexpr (UrlEncode) { + auto r = dataLength % 3; + if (r == 0) + return (dataLength / 3) * 4; + else + return (dataLength / 3) * 4 + r + 1; + } else { + // any non-zero remainder after dividing the input length by 3 results in 4 extra output chars due to padding + return ((dataLength + 2) / 3) * 4; + } +} + +template +StringRef doEncodeWithArena(Arena& arena, StringRef plainText) { + auto encodedLen = getEncodedLength(plainText.size()); + if (encodedLen <= 0) + return StringRef(); + auto out = new (arena) uint8_t[encodedLen]; + auto actualLen = doEncode(plainText.begin(), plainText.size(), out); + ASSERT_EQ(encodedLen, actualLen); + return StringRef(out, encodedLen); +} + +} // anonymous namespace + +namespace base64 { + +int encode(const uint8_t* __restrict plaintextIn, int lengthIn, uint8_t* __restrict codeOut) noexcept { + return doEncode(plaintextIn, lengthIn, codeOut); +} + +int encodedLength(int dataLength) noexcept { + return getEncodedLength(dataLength); +} + +StringRef encode(Arena& arena, StringRef plainText) { + return doEncodeWithArena(arena, plainText); +} + +namespace url { + +int encode(const uint8_t* __restrict plaintextIn, int lengthIn, uint8_t* __restrict codeOut) noexcept { + return doEncode(plaintextIn, lengthIn, codeOut); +} + +int encodedLength(int dataLength) noexcept { + return getEncodedLength(dataLength); +} + +StringRef encode(Arena& arena, StringRef plainText) { + return doEncodeWithArena(arena, plainText); +} + +} // namespace url + +} // namespace base64 diff --git a/src/fdbrpc/CMakeLists.txt b/src/fdbrpc/CMakeLists.txt index 35c6c6d..6aac44d 100644 --- a/src/fdbrpc/CMakeLists.txt +++ b/src/fdbrpc/CMakeLists.txt @@ -4,12 +4,14 @@ add_library(fdbrpc STATIC ${FDBRPC_SRC}) target_link_libraries(fdbrpc PRIVATE flow + rapidjson + crc32 + libb64 ) - -add_library(fdbb64 STATIC libb64/cdecode.c libb64/cencode.c) -target_link_libraries(fdbrpc PRIVATE fdbb64) +target_include_directories(fdbrpc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) add_library(fdbeio STATIC libeio/eio.c) +target_include_directories(fdbeio PUBLIC libeio/) target_compile_definitions(fdbeio PRIVATE USE_UCONTEXT) target_compile_options(fdbeio BEFORE PRIVATE -w) # disable warnings for eio target_link_libraries(fdbrpc PRIVATE fdbeio) diff --git a/src/fdbrpc/DDSketchTest.actor.cpp b/src/fdbrpc/DDSketchTest.actor.cpp new file mode 100644 index 0000000..f2ecb48 --- /dev/null +++ b/src/fdbrpc/DDSketchTest.actor.cpp @@ -0,0 +1,62 @@ +#include "fdbrpc/DDSketch.h" +#include "flow/Error.h" +#include "flow/IRandom.h" +#include "flow/UnitTest.h" +#include +#include +#include "flow/actorcompiler.h" // has to be last include +void forceLinkDDSketchTests() {} + +TEST_CASE("/fdbrpc/ddsketch/accuracy") { + + int TRY = 100, SIZE = 1e6; + const int totalPercentiles = 7; + double targetPercentiles[totalPercentiles] = { .0001, .01, .1, .50, .90, .99, .9999 }; + double stat[totalPercentiles] = { 0 }; + for (int t = 0; t < TRY; t++) { + DDSketch dd; + std::vector nums; + for (int i = 0; i < SIZE; i++) { + static double a = 1, b = 1; // a skewed distribution + auto y = deterministicRandom()->random01(); + auto num = b / pow(1 - y, 1 / a); + nums.push_back(num); + dd.addSample(num); + } + std::sort(nums.begin(), nums.end()); + for (int percentID = 0; percentID < totalPercentiles; percentID++) { + double percentile = targetPercentiles[percentID]; + double ground = nums[percentile * (SIZE - 1)], ddvalue = dd.percentile(percentile); + double relativeError = fabs(ground - ddvalue) / ground; + stat[percentID] += relativeError; + } + } + + for (int percentID = 0; percentID < totalPercentiles; percentID++) { + printf("%.4lf per, relative error %.4lf\n", targetPercentiles[percentID], stat[percentID] / TRY); + } + + return Void(); +} + +TEST_CASE("/fdbrpc/ddsketch/correctness") { + DDSketch dd; + + for (int i = 0; i < 4000; i++) { + // This generates a uniform real disitribution between the range of + // [0.0004, 0.01] + double sample = (static_cast(deterministicRandom()->randomSkewedUInt32(40, 1000)) / 100000); + dd.addSample(sample); + } + double p50 = dd.percentile(0.5); + ASSERT(p50 > 0 && p50 != std::numeric_limits::infinity()); + double p90 = dd.percentile(0.9); + ASSERT(p90 > 0 && p90 != std::numeric_limits::infinity()); + double p95 = dd.percentile(0.95); + ASSERT(p95 > 0 && p95 != std::numeric_limits::infinity()); + double p99 = dd.percentile(0.99); + ASSERT(p99 > 0 && p99 != std::numeric_limits::infinity()); + double p999 = dd.percentile(0.999); + ASSERT(p999 > 0 && p999 != std::numeric_limits::infinity()); + return Void{}; +} diff --git a/src/fdbrpc/DDSketchTest.actor.g.cpp b/src/fdbrpc/DDSketchTest.actor.g.cpp new file mode 100644 index 0000000..692d28b --- /dev/null +++ b/src/fdbrpc/DDSketchTest.actor.g.cpp @@ -0,0 +1,291 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" +#include "fdbrpc/DDSketch.h" +#include "flow/Error.h" +#include "flow/IRandom.h" +#include "flow/UnitTest.h" +#include +#include +#include "flow/actorcompiler.h" // has to be last include +void forceLinkDDSketchTests() {} + + #line 12 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase10() + #line 10 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" +template + #line 10 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" +class FlowTestCase10ActorState { + #line 19 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" +public: + #line 10 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + FlowTestCase10ActorState(UnitTestParameters const& params) + #line 10 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + #line 10 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + : params(params) + #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase10", reinterpret_cast(this)); + + } + ~FlowTestCase10ActorState() + { + fdb_probe_actor_destroy("flowTestCase10", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 12 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + int TRY = 100, SIZE = 1e6; + #line 13 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + const int totalPercentiles = 7; + #line 14 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + double targetPercentiles[totalPercentiles] = { .0001, .01, .1, .50, .90, .99, .9999 }; + #line 15 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + double stat[totalPercentiles] = { 0 }; + #line 16 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + for(int t = 0;t < TRY;t++) { + #line 17 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + DDSketch dd; + #line 18 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + std::vector nums; + #line 19 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + for(int i = 0;i < SIZE;i++) { + #line 20 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + static double a = 1, b = 1; + #line 21 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + auto y = deterministicRandom()->random01(); + #line 22 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + auto num = b / pow(1 - y, 1 / a); + #line 23 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + nums.push_back(num); + #line 24 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + dd.addSample(num); + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" + } + #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + std::sort(nums.begin(), nums.end()); + #line 27 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + for(int percentID = 0;percentID < totalPercentiles;percentID++) { + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + double percentile = targetPercentiles[percentID]; + #line 29 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + double ground = nums[percentile * (SIZE - 1)], ddvalue = dd.percentile(percentile); + #line 30 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + double relativeError = fabs(ground - ddvalue) / ground; + #line 31 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + stat[percentID] += relativeError; + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" + } + } + #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + for(int percentID = 0;percentID < totalPercentiles;percentID++) { + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + printf("%.4lf per, relative error %.4lf\n", targetPercentiles[percentID], stat[percentID] / TRY); + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" + } + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase10ActorState(); static_cast(this)->destroy(); return 0; } + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase10ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase10ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 10 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + UnitTestParameters params; + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase10() + #line 10 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" +class FlowTestCase10Actor final : public Actor, public FastAllocated, public FlowTestCase10ActorState { + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 10 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + FlowTestCase10Actor(UnitTestParameters const& params) + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" + : Actor(), + FlowTestCase10ActorState(params) + { + fdb_probe_actor_enter("flowTestCase10", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase10"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase10", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 10 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" +static Future flowTestCase10( UnitTestParameters const& params ) { + #line 10 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + return Future(new FlowTestCase10Actor(params)); + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase10, "/fdbrpc/ddsketch/accuracy") + +#line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase42() + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" +template + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" +class FlowTestCase42ActorState { + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" +public: + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + FlowTestCase42ActorState(UnitTestParameters const& params) + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + : params(params) + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase42", reinterpret_cast(this)); + + } + ~FlowTestCase42ActorState() + { + fdb_probe_actor_destroy("flowTestCase42", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + DDSketch dd; + #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + for(int i = 0;i < 4000;i++) { + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + double sample = (static_cast(deterministicRandom()->randomSkewedUInt32(40, 1000)) / 100000); + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + dd.addSample(sample); + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" + } + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + double p50 = dd.percentile(0.5); + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + ASSERT(p50 > 0 && p50 != std::numeric_limits::infinity()); + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + double p90 = dd.percentile(0.9); + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + ASSERT(p90 > 0 && p90 != std::numeric_limits::infinity()); + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + double p95 = dd.percentile(0.95); + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + ASSERT(p95 > 0 && p95 != std::numeric_limits::infinity()); + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + double p99 = dd.percentile(0.99); + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + ASSERT(p99 > 0 && p99 != std::numeric_limits::infinity()); + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + double p999 = dd.percentile(0.999); + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + ASSERT(p999 > 0 && p999 != std::numeric_limits::infinity()); + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void{}); this->~FlowTestCase42ActorState(); static_cast(this)->destroy(); return 0; } + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void{}); + this->~FlowTestCase42ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase42ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + UnitTestParameters params; + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase42() + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" +class FlowTestCase42Actor final : public Actor, public FastAllocated, public FlowTestCase42ActorState { + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + FlowTestCase42Actor(UnitTestParameters const& params) + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" + : Actor(), + FlowTestCase42ActorState(params) + { + fdb_probe_actor_enter("flowTestCase42", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase42"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase42", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" +static Future flowTestCase42( UnitTestParameters const& params ) { + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" + return Future(new FlowTestCase42Actor(params)); + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase42, "/fdbrpc/ddsketch/correctness") + +#line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/DDSketchTest.actor.cpp" diff --git a/src/fdbrpc/FailureMonitor.actor.cpp b/src/fdbrpc/FailureMonitor.actor.cpp index 87a79f3..00c3edc 100644 --- a/src/fdbrpc/FailureMonitor.actor.cpp +++ b/src/fdbrpc/FailureMonitor.actor.cpp @@ -133,11 +133,20 @@ void SimpleFailureMonitor::endpointNotFound(Endpoint const& endpoint) { TraceEvent(SevWarnAlways, "TooManyFailedEndpoints").suppressFor(1.0); failedEndpoints.clear(); } - failedEndpoints.insert(endpoint); + failedEndpoints.emplace(endpoint, FailedReason::NOT_FOUND); } endpointKnownFailed.trigger(endpoint); } +void SimpleFailureMonitor::unauthorizedEndpoint(Endpoint const& endpoint) { + TraceEvent(g_network->isSimulated() ? SevWarnAlways : SevError, "TriedAccessPrivateEndpoint") + .suppressFor(1.0) + .detail("Address", endpoint.getPrimaryAddress()) + .detail("Token", endpoint.token); + failedEndpoints.emplace(endpoint, FailedReason::UNAUTHORIZED); + endpointKnownFailed.trigger(endpoint); +} + void SimpleFailureMonitor::notifyDisconnect(NetworkAddress const& address) { //TraceEvent("NotifyDisconnect").detail("Address", address); endpointKnownFailed.triggerRange(Endpoint({ address }, UID()), Endpoint({ address }, UID(-1, -1))); @@ -220,8 +229,13 @@ bool SimpleFailureMonitor::permanentlyFailed(Endpoint const& endpoint) const { return failedEndpoints.count(endpoint); } +bool SimpleFailureMonitor::knownUnauthorized(Endpoint const& endpoint) const { + auto iter = failedEndpoints.find(endpoint); + return iter != failedEndpoints.end() && iter->second == FailedReason::UNAUTHORIZED; +} + void SimpleFailureMonitor::reset() { addressStatus = std::unordered_map(); - failedEndpoints = std::unordered_set(); + failedEndpoints = std::unordered_map(); endpointKnownFailed.resetNoWaiting(); } diff --git a/src/fdbrpc/FailureMonitor.actor.g.cpp b/src/fdbrpc/FailureMonitor.actor.g.cpp index 8fdfdd4..f8cf847 100644 --- a/src/fdbrpc/FailureMonitor.actor.g.cpp +++ b/src/fdbrpc/FailureMonitor.actor.g.cpp @@ -746,11 +746,20 @@ void SimpleFailureMonitor::endpointNotFound(Endpoint const& endpoint) { TraceEvent(SevWarnAlways, "TooManyFailedEndpoints").suppressFor(1.0); failedEndpoints.clear(); } - failedEndpoints.insert(endpoint); + failedEndpoints.emplace(endpoint, FailedReason::NOT_FOUND); } endpointKnownFailed.trigger(endpoint); } +void SimpleFailureMonitor::unauthorizedEndpoint(Endpoint const& endpoint) { + TraceEvent(g_network->isSimulated() ? SevWarnAlways : SevError, "TriedAccessPrivateEndpoint") + .suppressFor(1.0) + .detail("Address", endpoint.getPrimaryAddress()) + .detail("Token", endpoint.token); + failedEndpoints.emplace(endpoint, FailedReason::UNAUTHORIZED); + endpointKnownFailed.trigger(endpoint); +} + void SimpleFailureMonitor::notifyDisconnect(NetworkAddress const& address) { //TraceEvent("NotifyDisconnect").detail("Address", address); endpointKnownFailed.triggerRange(Endpoint({ address }, UID()), Endpoint({ address }, UID(-1, -1))); @@ -833,8 +842,13 @@ bool SimpleFailureMonitor::permanentlyFailed(Endpoint const& endpoint) const { return failedEndpoints.count(endpoint); } +bool SimpleFailureMonitor::knownUnauthorized(Endpoint const& endpoint) const { + auto iter = failedEndpoints.find(endpoint); + return iter != failedEndpoints.end() && iter->second == FailedReason::UNAUTHORIZED; +} + void SimpleFailureMonitor::reset() { addressStatus = std::unordered_map(); - failedEndpoints = std::unordered_set(); + failedEndpoints = std::unordered_map(); endpointKnownFailed.resetNoWaiting(); } diff --git a/src/fdbrpc/FlowTests.actor.cpp b/src/fdbrpc/FlowTests.actor.cpp index 5c592ae..977870d 100644 --- a/src/fdbrpc/FlowTests.actor.cpp +++ b/src/fdbrpc/FlowTests.actor.cpp @@ -20,13 +20,14 @@ // Unit tests for the flow language and libraries +#include "flow/Arena.h" #include "flow/ProtocolVersion.h" #include "flow/UnitTest.h" #include "flow/DeterministicRandom.h" #include "flow/IThreadPool.h" #include "flow/WriteOnlySet.h" #include "fdbrpc/fdbrpc.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/TLSConfig.actor.h" #include "flow/actorcompiler.h" // This must be the last #include. @@ -47,7 +48,7 @@ TEST_CASE("/flow/actorcompiler/lineNumbers") { } break; } - ASSERT(LiteralStringRef(__FILE__).endsWith(LiteralStringRef("FlowTests.actor.cpp"))); + ASSERT(__FILE__sr.endsWith("FlowTests.actor.cpp"_sr)); return Void(); } @@ -68,7 +69,7 @@ TEST_CASE("/flow/buggifiedDelay") { }); wait(f1 && f2); if (last == 1) { - TEST(true); // Delays can become ready out of order + CODE_PROBE(true, "Delays can become ready out of order", probe::decoration::rare); return Void(); } } @@ -143,6 +144,14 @@ ACTOR static Future cheeseWaitActor() { return Void(); } +size_t cheeseWaitActorSize() { +#ifndef OPEN_FOR_IDE + return sizeof(CheeseWaitActorActor); +#else + return 0ul; +#endif +} + ACTOR static void trivialVoidActor(int* result) { *result = 1; } @@ -352,7 +361,7 @@ TEST_CASE("/flow/flow/cancel2") { return Void(); } -namespace { +namespace flow_tests_details { // Simple message for flatbuffers unittests struct Int { constexpr static FileIdentifier file_identifier = 12345; @@ -364,7 +373,7 @@ struct Int { serializer(ar, value); } }; -} // namespace +} // namespace flow_tests_details TEST_CASE("/flow/flow/nonserializable futures") { // Types no longer need to be statically serializable to make futures, promises, actors @@ -380,16 +389,16 @@ TEST_CASE("/flow/flow/nonserializable futures") { // ReplyPromise can be used like a normal promise { - ReplyPromise rpInt; - Future f = rpInt.getFuture(); + ReplyPromise rpInt; + Future f = rpInt.getFuture(); ASSERT(!f.isReady()); rpInt.send(123); ASSERT(f.get().value == 123); } { - RequestStream rsInt; - FutureStream f = rsInt.getFuture(); + RequestStream rsInt; + FutureStream f = rsInt.getFuture(); rsInt.send(1); rsInt.send(2); ASSERT(f.pop().value == 1); @@ -402,7 +411,7 @@ TEST_CASE("/flow/flow/nonserializable futures") { TEST_CASE("/flow/flow/networked futures") { // RequestStream can be serialized { - RequestStream locInt; + RequestStream locInt; BinaryWriter wr(IncludeVersion()); wr << locInt; @@ -410,7 +419,7 @@ TEST_CASE("/flow/flow/networked futures") { locInt.getEndpoint().getPrimaryAddress() == FlowTransport::transport().getLocalAddress()); BinaryReader rd(wr.toValue(), IncludeVersion()); - RequestStream remoteInt; + RequestStream remoteInt; rd >> remoteInt; ASSERT(remoteInt.getEndpoint() == locInt.getEndpoint()); @@ -419,14 +428,14 @@ TEST_CASE("/flow/flow/networked futures") { // ReplyPromise can be serialized // TODO: This needs to fiddle with g_currentDeliveryPeerAddress if (0) { - ReplyPromise locInt; + ReplyPromise locInt; BinaryWriter wr(IncludeVersion()); wr << locInt; ASSERT(locInt.getEndpoint().isValid() && locInt.getEndpoint().isLocal()); BinaryReader rd(wr.toValue(), IncludeVersion()); - ReplyPromise remoteInt; + ReplyPromise remoteInt; rd >> remoteInt; ASSERT(remoteInt.getEndpoint() == locInt.getEndpoint()); @@ -1083,7 +1092,7 @@ TEST_CASE("#flow/flow/perf/actor patterns") { ASSERT(out2[i].isReady()); } printf("2xcheeseActor(chooseTwoActor(cheeseActor(fifo), never)): %0.2f M/sec\n", N / 1e6 / (timer() - start)); - printf("sizeof(CheeseWaitActorActor) == %zu\n", sizeof(CheeseWaitActorActor)); + printf("sizeof(CheeseWaitActorActor) == %zu\n", cheeseWaitActorSize()); } { diff --git a/src/fdbrpc/FlowTests.actor.g.cpp b/src/fdbrpc/FlowTests.actor.g.cpp index bb1e49f..f87ef73 100644 --- a/src/fdbrpc/FlowTests.actor.g.cpp +++ b/src/fdbrpc/FlowTests.actor.g.cpp @@ -22,49 +22,50 @@ // Unit tests for the flow language and libraries +#include "flow/Arena.h" #include "flow/ProtocolVersion.h" #include "flow/UnitTest.h" #include "flow/DeterministicRandom.h" #include "flow/IThreadPool.h" #include "flow/WriteOnlySet.h" #include "fdbrpc/fdbrpc.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/TLSConfig.actor.h" #include "flow/actorcompiler.h" // This must be the last #include. void forceLinkFlowTests() {} constexpr int firstLine = __LINE__; - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase36() - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase36ActorState { - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase37() + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase37ActorState { + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase36ActorState(UnitTestParameters const& params) - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase37ActorState(UnitTestParameters const& params) + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase36", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase37", reinterpret_cast(this)); } - ~FlowTestCase36ActorState() + ~FlowTestCase37ActorState() { - fdb_probe_actor_destroy("flowTestCase36", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase37", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ; - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -77,22 +78,22 @@ class FlowTestCase36ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase36ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase37ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - ASSERT(LiteralStringRef(__FILE__).endsWith(LiteralStringRef("FlowTests.actor.cpp"))); #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase36ActorState(); static_cast(this)->destroy(); return 0; } - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase36ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + ASSERT(__FILE__sr.endsWith("FlowTests.actor.cpp"_sr)); + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase37ActorState(); static_cast(this)->destroy(); return 0; } + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase37ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -107,18 +108,18 @@ class FlowTestCase36ActorState { int a_body1loopBody1(int loopDepth) { try { - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - ASSERT(__LINE__ == firstLine + 4); #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + ASSERT(__LINE__ == firstLine + 4); + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = Future(Void()); - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -151,18 +152,18 @@ class FlowTestCase36ActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - ASSERT(__LINE__ == firstLine + 9); #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + ASSERT(__LINE__ == firstLine + 9); + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_1 = Future(Void()); - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -175,21 +176,21 @@ class FlowTestCase36ActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - ASSERT(__LINE__ == firstLine + 6); #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + ASSERT(__LINE__ == firstLine + 6); + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return a_body1loopBody1Catch1(success(), loopDepth); - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" return loopDepth; } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - ASSERT(__LINE__ == firstLine + 6); #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + ASSERT(__LINE__ == firstLine + 6); + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return a_body1loopBody1Catch1(success(), loopDepth); - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" return loopDepth; } @@ -207,13 +208,13 @@ class FlowTestCase36ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase36Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase37Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase36Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase37Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase36", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase37", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -223,12 +224,12 @@ class FlowTestCase36ActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase36", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase37", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase36Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase37Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase36", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase37", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -238,12 +239,12 @@ class FlowTestCase36ActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase36", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase37", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase36Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase37Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase36", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase37", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1Catch1(err, 0); @@ -253,23 +254,23 @@ class FlowTestCase36ActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase36", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase37", reinterpret_cast(this), 0); } int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(__LINE__ == firstLine + 11); - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(__LINE__ == firstLine + 11); - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -288,13 +289,13 @@ class FlowTestCase36ActorState { } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase36Actor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase37Actor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase36Actor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase37Actor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase36", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase37", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1Catch1when1(value, 0); @@ -304,12 +305,12 @@ class FlowTestCase36ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase36", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase37", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< FlowTestCase36Actor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase37Actor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase36", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase37", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1Catch1when1(std::move(value), 0); @@ -319,12 +320,12 @@ class FlowTestCase36ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase36", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase37", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< FlowTestCase36Actor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase37Actor, 1, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase36", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase37", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -334,39 +335,39 @@ class FlowTestCase36ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase36", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase37", reinterpret_cast(this), 1); } - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase36() - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase36Actor final : public Actor, public ActorCallback< FlowTestCase36Actor, 0, Void >, public ActorCallback< FlowTestCase36Actor, 1, Void >, public FastAllocated, public FlowTestCase36ActorState { - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase37() + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase37Actor final : public Actor, public ActorCallback< FlowTestCase37Actor, 0, Void >, public ActorCallback< FlowTestCase37Actor, 1, Void >, public FastAllocated, public FlowTestCase37ActorState { + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase36Actor, 0, Void >; -friend struct ActorCallback< FlowTestCase36Actor, 1, Void >; - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase36Actor(UnitTestParameters const& params) - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +friend struct ActorCallback< FlowTestCase37Actor, 0, Void >; +friend struct ActorCallback< FlowTestCase37Actor, 1, Void >; + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase37Actor(UnitTestParameters const& params) + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase36ActorState(params) + FlowTestCase37ActorState(params) { - fdb_probe_actor_enter("flowTestCase36", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase37", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase36"); + this->lineage.setActorName("flowTestCase37"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase36", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase37", reinterpret_cast(this), -1); } void cancel() override @@ -374,65 +375,65 @@ friend struct ActorCallback< FlowTestCase36Actor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase36Actor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< FlowTestCase36Actor, 1, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase37Actor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase37Actor, 1, Void >*)0, actor_cancelled()); break; } } }; } - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -static Future flowTestCase36( UnitTestParameters const& params ) { - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase36Actor(params)); - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase37( UnitTestParameters const& params ) { + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase37Actor(params)); + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase36, "/flow/actorcompiler/lineNumbers") +ACTOR_TEST_CASE(flowTestCase37, "/flow/actorcompiler/lineNumbers") -#line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase54() - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase54ActorState { - #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase55() + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase55ActorState { + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase54ActorState(UnitTestParameters const& params) - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase55ActorState(UnitTestParameters const& params) + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase54", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase55", reinterpret_cast(this)); } - ~FlowTestCase54ActorState() + ~FlowTestCase55ActorState() { - fdb_probe_actor_destroy("flowTestCase54", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase55", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (FLOW_KNOBS->MAX_BUGGIFIED_DELAY == 0) - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase54ActorState(); static_cast(this)->destroy(); return 0; } - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase54ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase55ActorState(); static_cast(this)->destroy(); return 0; } + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase55ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ; - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -445,8 +446,8 @@ class FlowTestCase54ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase54ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase55ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; @@ -460,42 +461,42 @@ class FlowTestCase54ActorState { } int a_body1loopBody1(int loopDepth) { - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - x = deterministicRandom()->random01(); #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - last = 0; + x = deterministicRandom()->random01(); #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + last = 0; + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f1 = map(delay(x), [last = &last](const Void&) { *last = 1; return Void(); }); - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f2 = map(delay(x), [last = &last](const Void&) { *last = 2; return Void(); }); - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = f1 && f2; - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (last == 1) - #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - TEST(true); #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase54ActorState(); static_cast(this)->destroy(); return 0; } - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase54ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + CODE_PROBE(true, "Delays can become ready out of order", probe::decoration::rare); + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase55ActorState(); static_cast(this)->destroy(); return 0; } + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase55ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } if (loopDepth == 0) return a_body1loopHead1(0); @@ -504,18 +505,18 @@ class FlowTestCase54ActorState { } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (last == 1) - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - TEST(true); #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase54ActorState(); static_cast(this)->destroy(); return 0; } - #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase54ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + CODE_PROBE(true, "Delays can become ready out of order", probe::decoration::rare); + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase55ActorState(); static_cast(this)->destroy(); return 0; } + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase55ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } if (loopDepth == 0) return a_body1loopHead1(0); @@ -536,13 +537,13 @@ class FlowTestCase54ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase54Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase55Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase54Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase55Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase54", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase55", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -552,12 +553,12 @@ class FlowTestCase54ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase54", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase55", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase54Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase55Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase54", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase55", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -567,12 +568,12 @@ class FlowTestCase54ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase54", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase55", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase54Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase55Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase54", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase55", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -582,46 +583,46 @@ class FlowTestCase54ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase54", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase55", reinterpret_cast(this), 0); } - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - double x; #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - int last; + double x; #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + int last; + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f1; - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f2; - #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase54() - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase54Actor final : public Actor, public ActorCallback< FlowTestCase54Actor, 0, Void >, public FastAllocated, public FlowTestCase54ActorState { - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase55() + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase55Actor final : public Actor, public ActorCallback< FlowTestCase55Actor, 0, Void >, public FastAllocated, public FlowTestCase55ActorState { + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase54Actor, 0, Void >; - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase54Actor(UnitTestParameters const& params) - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +friend struct ActorCallback< FlowTestCase55Actor, 0, Void >; + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase55Actor(UnitTestParameters const& params) + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase54ActorState(params) + FlowTestCase55ActorState(params) { - fdb_probe_actor_enter("flowTestCase54", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase55", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase54"); + this->lineage.setActorName("flowTestCase55"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase54", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase55", reinterpret_cast(this), -1); } void cancel() override @@ -629,21 +630,21 @@ friend struct ActorCallback< FlowTestCase54Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase54Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase55Actor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -static Future flowTestCase54( UnitTestParameters const& params ) { - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase54Actor(params)); - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase55( UnitTestParameters const& params ) { + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase55Actor(params)); + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase54, "/flow/buggifiedDelay") +ACTOR_TEST_CASE(flowTestCase55, "/flow/buggifiedDelay") -#line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template class LambdaCallback final : public CallbackType, public FastAllocated> { @@ -693,20 +694,20 @@ void onReady(FutureStream&& f, Func&& func, ErrFunc&& errFunc) { new LambdaCallback>(std::move(func), std::move(errFunc))); } - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via emptyVoidActor() - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class EmptyVoidActorActorState { - #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" EmptyVoidActorActorState() - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" { - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" fdb_probe_actor_create("emptyVoidActor", reinterpret_cast(this)); } @@ -737,18 +738,18 @@ class EmptyVoidActorActorState { } int a_body1cont1(int loopDepth) { - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" delete static_cast(this); - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" return 0; return loopDepth; } }; // This generated class is to be used only via emptyVoidActor() - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class EmptyVoidActorActor final : public Actor, public FastAllocated, public EmptyVoidActorActorState { - #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -756,9 +757,9 @@ class EmptyVoidActorActor final : public Actor, public FastAllocated*)this)->~Actor(); operator delete(this); }} #pragma clang diagnostic pop - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" EmptyVoidActorActor() - #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), EmptyVoidActorActorState() { @@ -773,29 +774,29 @@ class EmptyVoidActorActor final : public Actor, public FastAllocated - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class EmptyActorActorState { - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" EmptyActorActorState() - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" { - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" fdb_probe_actor_create("emptyActor", reinterpret_cast(this)); } @@ -807,9 +808,9 @@ class EmptyActorActorState { int a_body1(int loopDepth=0) { try { - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~EmptyActorActorState(); static_cast(this)->destroy(); return 0; } - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~EmptyActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -833,9 +834,9 @@ class EmptyActorActorState { } }; // This generated class is to be used only via emptyActor() - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class EmptyActorActor final : public Actor, public FastAllocated, public EmptyActorActorState { - #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -843,9 +844,9 @@ class EmptyActorActor final : public Actor, public FastAllocated*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" EmptyActorActor() - #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), EmptyActorActorState() { @@ -868,30 +869,30 @@ class EmptyActorActor final : public Actor, public FastAllocated emptyActor( ) { - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new EmptyActorActor()); - #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via oneWaitVoidActor() - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class OneWaitVoidActorActorState { - #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" OneWaitVoidActorActorState(Future const& f) - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : f(f) - #line 894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("oneWaitVoidActor", reinterpret_cast(this)); @@ -904,15 +905,15 @@ class OneWaitVoidActorActorState { int a_body1(int loopDepth=0) { try { - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = f; - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" static_cast(this)->actor_wait_state = 1; - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1007,21 +1008,21 @@ class OneWaitVoidActorActorState { } int a_body1cont2(int loopDepth) { - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" delete static_cast(this); - #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" return 0; return loopDepth; } - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f; - #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via oneWaitVoidActor() - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class OneWaitVoidActorActor final : public Actor, public ActorCallback< OneWaitVoidActorActor, 0, Void >, public FastAllocated, public OneWaitVoidActorActorState { - #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1030,9 +1031,9 @@ class OneWaitVoidActorActor final : public Actor, public ActorCallback< On void destroy() {{ ((Actor*)this)->~Actor(); operator delete(this); }} #pragma clang diagnostic pop friend struct ActorCallback< OneWaitVoidActorActor, 0, Void >; - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" OneWaitVoidActorActor(Future const& f) - #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), OneWaitVoidActorActorState(f) { @@ -1047,30 +1048,30 @@ friend struct ActorCallback< OneWaitVoidActorActor, 0, Void >; } }; } - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" static void oneWaitVoidActor( Future const& f ) { - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" new OneWaitVoidActorActor(f); - #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via oneWaitActor() - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class OneWaitActorActorState { - #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" OneWaitActorActorState(Future const& f) - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : f(f) - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("oneWaitActor", reinterpret_cast(this)); @@ -1083,16 +1084,16 @@ class OneWaitActorActorState { int a_body1(int loopDepth=0) { try { - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = f; - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1113,9 +1114,9 @@ class OneWaitActorActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OneWaitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~OneWaitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1125,9 +1126,9 @@ class OneWaitActorActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OneWaitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~OneWaitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1198,14 +1199,14 @@ class OneWaitActorActorState { fdb_probe_actor_exit("oneWaitActor", reinterpret_cast(this), 0); } - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f; - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via oneWaitActor() - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class OneWaitActorActor final : public Actor, public ActorCallback< OneWaitActorActor, 0, Void >, public FastAllocated, public OneWaitActorActorState { - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1214,9 +1215,9 @@ class OneWaitActorActor final : public Actor, public ActorCallback< OneWai void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< OneWaitActorActor, 0, Void >; - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" OneWaitActorActor(Future const& f) - #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), OneWaitActorActorState(f) { @@ -1240,30 +1241,30 @@ friend struct ActorCallback< OneWaitActorActor, 0, Void >; } }; } - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] static Future oneWaitActor( Future const& f ) { - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new OneWaitActorActor(f)); - #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future g_cheese; - #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via cheeseWaitActor() - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class CheeseWaitActorActorState { - #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" CheeseWaitActorActorState() - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" { - #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" fdb_probe_actor_create("cheeseWaitActor", reinterpret_cast(this)); } @@ -1275,16 +1276,16 @@ class CheeseWaitActorActorState { int a_body1(int loopDepth=0) { try { - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = g_cheese; - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1305,9 +1306,9 @@ class CheeseWaitActorActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheeseWaitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CheeseWaitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1317,9 +1318,9 @@ class CheeseWaitActorActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheeseWaitActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CheeseWaitActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1392,9 +1393,9 @@ class CheeseWaitActorActorState { } }; // This generated class is to be used only via cheeseWaitActor() - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class CheeseWaitActorActor final : public Actor, public ActorCallback< CheeseWaitActorActor, 0, Void >, public FastAllocated, public CheeseWaitActorActorState { - #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1403,9 +1404,9 @@ class CheeseWaitActorActor final : public Actor, public ActorCallback< Che void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< CheeseWaitActorActor, 0, Void >; - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" CheeseWaitActorActor() - #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), CheeseWaitActorActorState() { @@ -1429,30 +1430,38 @@ friend struct ActorCallback< CheeseWaitActorActor, 0, Void >; } }; } - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] static Future cheeseWaitActor( ) { - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new CheeseWaitActorActor()); - #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + +size_t cheeseWaitActorSize() { +#ifndef OPEN_FOR_IDE + return sizeof(CheeseWaitActorActor); +#else + return 0ul; +#endif +} - #line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via trivialVoidActor() - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class TrivialVoidActorActorState { - #line 1448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" TrivialVoidActorActorState(int* const& result) - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : result(result) - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("trivialVoidActor", reinterpret_cast(this)); @@ -1465,9 +1474,9 @@ class TrivialVoidActorActorState { int a_body1(int loopDepth=0) { try { - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" *result = 1; - #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); } catch (Error& error) { @@ -1487,21 +1496,21 @@ class TrivialVoidActorActorState { } int a_body1cont2(int loopDepth) { - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" delete static_cast(this); - #line 1492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" return 0; return loopDepth; } - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int* result; - #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via trivialVoidActor() - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class TrivialVoidActorActor final : public Actor, public FastAllocated, public TrivialVoidActorActorState { - #line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1509,9 +1518,9 @@ class TrivialVoidActorActor final : public Actor, public FastAllocated*)this)->~Actor(); operator delete(this); }} #pragma clang diagnostic pop - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" TrivialVoidActorActor(int* const& result) - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), TrivialVoidActorActorState(result) { @@ -1526,29 +1535,29 @@ class TrivialVoidActorActor final : public Actor, public FastAllocated - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class Return42ActorActorState { - #line 1545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Return42ActorActorState() - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" { - #line 1551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" fdb_probe_actor_create("return42Actor", reinterpret_cast(this)); } @@ -1560,9 +1569,9 @@ class Return42ActorActorState { int a_body1(int loopDepth=0) { try { - #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(42); this->~Return42ActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(42); this->~Return42ActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1586,9 +1595,9 @@ class Return42ActorActorState { } }; // This generated class is to be used only via return42Actor() - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class Return42ActorActor final : public Actor, public FastAllocated, public Return42ActorActorState { - #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1596,9 +1605,9 @@ class Return42ActorActor final : public Actor, public FastAllocated*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Return42ActorActor() - #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), Return42ActorActorState() { @@ -1621,32 +1630,32 @@ class Return42ActorActor final : public Actor, public FastAllocated return42Actor( ) { - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new Return42ActorActor()); - #line 1628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via voidWaitActor() - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class VoidWaitActorActorState { - #line 1640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" VoidWaitActorActorState(Future const& in,int* const& result) - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : in(in), - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" result(result) - #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("voidWaitActor", reinterpret_cast(this)); @@ -1659,15 +1668,15 @@ class VoidWaitActorActorState { int a_body1(int loopDepth=0) { try { - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = in; - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" static_cast(this)->actor_wait_state = 1; - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1687,18 +1696,18 @@ class VoidWaitActorActorState { } int a_body1cont1(int const& i,int loopDepth) { - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" *result = i; - #line 1692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; } int a_body1cont1(int && i,int loopDepth) { - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" *result = i; - #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; @@ -1768,23 +1777,23 @@ class VoidWaitActorActorState { } int a_body1cont3(int loopDepth) { - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" delete static_cast(this); - #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" return 0; return loopDepth; } - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future in; - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int* result; - #line 1782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via voidWaitActor() - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class VoidWaitActorActor final : public Actor, public ActorCallback< VoidWaitActorActor, 0, int >, public FastAllocated, public VoidWaitActorActorState { - #line 1787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1793,9 +1802,9 @@ class VoidWaitActorActor final : public Actor, public ActorCallback< VoidW void destroy() {{ ((Actor*)this)->~Actor(); operator delete(this); }} #pragma clang diagnostic pop friend struct ActorCallback< VoidWaitActorActor, 0, int >; - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" VoidWaitActorActor(Future const& in,int* const& result) - #line 1798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), VoidWaitActorActorState(in, result) { @@ -1810,30 +1819,30 @@ friend struct ActorCallback< VoidWaitActorActor, 0, int >; } }; } - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" static void voidWaitActor( Future const& in, int* const& result ) { - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" new VoidWaitActorActor(in, result); - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via addOneActor() - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class AddOneActorActorState { - #line 1829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" AddOneActorActorState(Future const& in) - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : in(in) - #line 1836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("addOneActor", reinterpret_cast(this)); @@ -1846,16 +1855,16 @@ class AddOneActorActorState { int a_body1(int loopDepth=0) { try { - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = in; - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1876,9 +1885,9 @@ class AddOneActorActorState { } int a_body1cont1(int const& i,int loopDepth) { - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(i + 1); this->~AddOneActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(i + 1); this->~AddOneActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1888,9 +1897,9 @@ class AddOneActorActorState { } int a_body1cont1(int && i,int loopDepth) { - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(i + 1); this->~AddOneActorActorState(); static_cast(this)->destroy(); return 0; } - #line 1893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(i + 1); this->~AddOneActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1961,14 +1970,14 @@ class AddOneActorActorState { fdb_probe_actor_exit("addOneActor", reinterpret_cast(this), 0); } - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future in; - #line 1966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via addOneActor() - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class AddOneActorActor final : public Actor, public ActorCallback< AddOneActorActor, 0, int >, public FastAllocated, public AddOneActorActorState { - #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1977,9 +1986,9 @@ class AddOneActorActor final : public Actor, public ActorCallback< AddOneAc void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< AddOneActorActor, 0, int >; - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" AddOneActorActor(Future const& in) - #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), AddOneActorActorState(in) { @@ -2003,32 +2012,32 @@ friend struct ActorCallback< AddOneActorActor, 0, int >; } }; } - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] static Future addOneActor( Future const& in ) { - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new AddOneActorActor(in)); - #line 2010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 2015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via chooseTwoActor() - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class ChooseTwoActorActorState { - #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ChooseTwoActorActorState(Future const& f,Future const& g) - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : f(f), - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" g(g) - #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("chooseTwoActor", reinterpret_cast(this)); @@ -2041,22 +2050,22 @@ class ChooseTwoActorActorState { int a_body1(int loopDepth=0) { try { - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = f; - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_1 = g; - #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2077,9 +2086,9 @@ class ChooseTwoActorActorState { } int a_body1cont1(int loopDepth) { - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ChooseTwoActorActorState(); static_cast(this)->destroy(); return 0; } - #line 2082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ChooseTwoActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2208,16 +2217,16 @@ class ChooseTwoActorActorState { fdb_probe_actor_exit("chooseTwoActor", reinterpret_cast(this), 1); } - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f; - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future g; - #line 2215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via chooseTwoActor() - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class ChooseTwoActorActor final : public Actor, public ActorCallback< ChooseTwoActorActor, 0, Void >, public ActorCallback< ChooseTwoActorActor, 1, Void >, public FastAllocated, public ChooseTwoActorActorState { - #line 2220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2227,9 +2236,9 @@ class ChooseTwoActorActor final : public Actor, public ActorCallback< Choo #pragma clang diagnostic pop friend struct ActorCallback< ChooseTwoActorActor, 0, Void >; friend struct ActorCallback< ChooseTwoActorActor, 1, Void >; - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ChooseTwoActorActor(Future const& f,Future const& g) - #line 2232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), ChooseTwoActorActorState(f, g) { @@ -2253,30 +2262,30 @@ friend struct ActorCallback< ChooseTwoActorActor, 1, Void >; } }; } - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] static Future chooseTwoActor( Future const& f, Future const& g ) { - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new ChooseTwoActorActor(f, g)); - #line 2260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via consumeOneActor() - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class ConsumeOneActorActorState { - #line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ConsumeOneActorActorState(FutureStream const& in) - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : in(in) - #line 2279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("consumeOneActor", reinterpret_cast(this)); @@ -2289,16 +2298,16 @@ class ConsumeOneActorActorState { int a_body1(int loopDepth=0) { try { - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FutureStream __when_expr_0 = in; - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2319,9 +2328,9 @@ class ConsumeOneActorActorState { } int a_body1cont1(int const& i,int loopDepth) { - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(i); this->~ConsumeOneActorActorState(); static_cast(this)->destroy(); return 0; } - #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(i); this->~ConsumeOneActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2331,9 +2340,9 @@ class ConsumeOneActorActorState { } int a_body1cont1(int && i,int loopDepth) { - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(i); this->~ConsumeOneActorActorState(); static_cast(this)->destroy(); return 0; } - #line 2336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(i); this->~ConsumeOneActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2404,14 +2413,14 @@ class ConsumeOneActorActorState { fdb_probe_actor_exit("consumeOneActor", reinterpret_cast(this), 0); } - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FutureStream in; - #line 2409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via consumeOneActor() - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class ConsumeOneActorActor final : public Actor, public ActorSingleCallback< ConsumeOneActorActor, 0, int >, public FastAllocated, public ConsumeOneActorActorState { - #line 2414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2420,9 +2429,9 @@ class ConsumeOneActorActor final : public Actor, public ActorSingleCallback void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorSingleCallback< ConsumeOneActorActor, 0, int >; - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ConsumeOneActorActor(FutureStream const& in) - #line 2425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), ConsumeOneActorActorState(in) { @@ -2446,32 +2455,32 @@ friend struct ActorSingleCallback< ConsumeOneActorActor, 0, int >; } }; } - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] static Future consumeOneActor( FutureStream const& in ) { - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new ConsumeOneActorActor(in)); - #line 2453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 2458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via sumActor() - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class SumActorActorState { - #line 2465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" SumActorActorState(FutureStream const& in) - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : in(in), - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" total(0) - #line 2474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("sumActor", reinterpret_cast(this)); @@ -2485,9 +2494,9 @@ class SumActorActorState { { try { try { - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ; - #line 2490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2514,9 +2523,9 @@ class SumActorActorState { } int a_body1cont1(int loopDepth) { - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(total); this->~SumActorActorState(); static_cast(this)->destroy(); return 0; } - #line 2519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(std::move(total)); // state_var_RVO this->~SumActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2527,13 +2536,13 @@ class SumActorActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (e.code() != error_code_end_of_stream) - #line 2532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } loopDepth = a_body1cont1(loopDepth); } @@ -2554,34 +2563,34 @@ class SumActorActorState { } int a_body1loopBody1(int loopDepth) { - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FutureStream __when_expr_0 = in; - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(int const& i,int loopDepth) { - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" total += i; - #line 2575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(int && i,int loopDepth) { - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" total += i; - #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -2649,16 +2658,16 @@ class SumActorActorState { fdb_probe_actor_exit("sumActor", reinterpret_cast(this), 0); } - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FutureStream in; - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int total; - #line 2656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via sumActor() - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class SumActorActor final : public Actor, public ActorSingleCallback< SumActorActor, 0, int >, public FastAllocated, public SumActorActorState { - #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2667,9 +2676,9 @@ class SumActorActor final : public Actor, public ActorSingleCallback< SumAc void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorSingleCallback< SumActorActor, 0, int >; - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" SumActorActor(FutureStream const& in) - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), SumActorActorState(in) { @@ -2693,30 +2702,30 @@ friend struct ActorSingleCallback< SumActorActor, 0, int >; } }; } - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] static Future sumActor( FutureStream const& in ) { - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new SumActorActor(in)); - #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via templateActor() - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class TemplateActorActorState { - #line 2712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" TemplateActorActorState(T const& t) - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : t(t) - #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("templateActor", reinterpret_cast(this)); @@ -2729,9 +2738,9 @@ class TemplateActorActorState { int a_body1(int loopDepth=0) { try { - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(t); this->~TemplateActorActorState(); static_cast(this)->destroy(); return 0; } - #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< T >::value()) T(std::move(t)); // state_var_RVO this->~TemplateActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2753,16 +2762,16 @@ class TemplateActorActorState { return loopDepth; } - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" T t; - #line 2758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via templateActor() - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class TemplateActorActor final : public Actor, public FastAllocated>, public TemplateActorActorState> { - #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -2770,9 +2779,9 @@ class TemplateActorActor final : public Actor, public FastAllocated*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" TemplateActorActor(T const& t) - #line 2775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), TemplateActorActorState>(t) { @@ -2795,34 +2804,34 @@ class TemplateActorActor final : public Actor, public FastAllocated - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] static Future templateActor( T const& t ) { - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new TemplateActorActor(t)); - #line 2804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" static int destroy() { return 666; } - #line 2812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via testHygeine() - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class TestHygeineActorState { - #line 2819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" TestHygeineActorState() - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" { - #line 2825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" fdb_probe_actor_create("testHygeine", reinterpret_cast(this)); } @@ -2834,11 +2843,11 @@ class TestHygeineActorState { int a_body1(int loopDepth=0) { try { - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(destroy() == 666); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TestHygeineActorState(); static_cast(this)->destroy(); return 0; } - #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TestHygeineActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2862,9 +2871,9 @@ class TestHygeineActorState { } }; // This generated class is to be used only via testHygeine() - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class TestHygeineActor final : public Actor, public FastAllocated, public TestHygeineActorState { - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2872,9 +2881,9 @@ class TestHygeineActor final : public Actor, public FastAllocated*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" TestHygeineActor() - #line 2877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), TestHygeineActorState() { @@ -2897,14 +2906,14 @@ class TestHygeineActor final : public Actor, public FastAllocated testHygeine( ) { - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new TestHygeineActor()); - #line 2904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 2913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" // bool expectActorCount(int x) { return actorCount == x; } bool expectActorCount(int) { @@ -2996,20 +3005,20 @@ struct YieldMockNetwork final : INetwork, ReferenceCounted { }; struct NonserializableThing {}; - #line 2999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via testNonserializableThing() - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class TestNonserializableThingActorState { - #line 3006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" TestNonserializableThingActorState() - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" { - #line 3012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" fdb_probe_actor_create("testNonserializableThing", reinterpret_cast(this)); } @@ -3021,9 +3030,9 @@ class TestNonserializableThingActorState { int a_body1(int loopDepth=0) { try { - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(NonserializableThing()); this->~TestNonserializableThingActorState(); static_cast(this)->destroy(); return 0; } - #line 3026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< NonserializableThing >::value()) NonserializableThing(NonserializableThing()); this->~TestNonserializableThingActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3047,9 +3056,9 @@ class TestNonserializableThingActorState { } }; // This generated class is to be used only via testNonserializableThing() - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class TestNonserializableThingActor final : public Actor, public FastAllocated, public TestNonserializableThingActorState { - #line 3052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3057,9 +3066,9 @@ class TestNonserializableThingActor final : public Actor, #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" TestNonserializableThingActor() - #line 3062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), TestNonserializableThingActorState() { @@ -3082,32 +3091,32 @@ class TestNonserializableThingActor final : public Actor, } }; } - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] static Future testNonserializableThing( ) { - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new TestNonserializableThingActor()); - #line 3089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 3094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via testCancelled() - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class TestCancelledActorState { - #line 3101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" TestCancelledActorState(bool* const& exits,Future const& f) - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : exits(exits), - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f(f) - #line 3110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("testCancelled", reinterpret_cast(this)); @@ -3121,16 +3130,16 @@ class TestCancelledActorState { { try { try { - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = Future(Never()); - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 3128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3157,9 +3166,9 @@ class TestCancelledActorState { } int a_body1cont1(int loopDepth) { - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TestCancelledActorState(); static_cast(this)->destroy(); return 0; } - #line 3162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TestCancelledActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3170,20 +3179,20 @@ class TestCancelledActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" err = e; - #line 3175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" try { - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_1 = Future(Never()); - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2Catch1(actor_cancelled(), loopDepth); - #line 3181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2Catch1(__when_expr_1.getError(), loopDepth); else return a_body1Catch2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3290,20 +3299,20 @@ class TestCancelledActorState { } int a_body1Catch2cont1(int loopDepth) { - #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return a_body1Catch1(err, loopDepth); - #line 3295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" return loopDepth; } int a_body1Catch2Catch1(const Error& e,int loopDepth=0) { try { - #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" *exits = true; - #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 3306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -3401,18 +3410,18 @@ class TestCancelledActorState { return loopDepth; } - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" bool* exits; - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f; - #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Error err; - #line 3410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via testCancelled() - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class TestCancelledActor final : public Actor, public ActorCallback< TestCancelledActor, 0, Void >, public ActorCallback< TestCancelledActor, 1, Void >, public FastAllocated, public TestCancelledActorState { - #line 3415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3422,9 +3431,9 @@ class TestCancelledActor final : public Actor, public ActorCallback< TestC #pragma clang diagnostic pop friend struct ActorCallback< TestCancelledActor, 0, Void >; friend struct ActorCallback< TestCancelledActor, 1, Void >; - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" TestCancelledActor(bool* const& exits,Future const& f) - #line 3427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), TestCancelledActorState(exits, f) { @@ -3449,64 +3458,64 @@ friend struct ActorCallback< TestCancelledActor, 1, Void >; } }; } - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] Future testCancelled( bool* const& exits, Future const& f ) { - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new TestCancelledActor(exits, f)); - #line 3456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 3461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase314() - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase314ActorState { - #line 3468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase323() + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase323ActorState { + #line 3477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase314ActorState(UnitTestParameters const& params) - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase323ActorState(UnitTestParameters const& params) + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 3475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase314", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase323", reinterpret_cast(this)); } - ~FlowTestCase314ActorState() + ~FlowTestCase323ActorState() { - fdb_probe_actor_destroy("flowTestCase314", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase323", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" bool exits = false; - #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p; - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future test = testCancelled(&exits, p.getFuture()); - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(p.getPromiseReferenceCount() == 1 && p.getFutureReferenceCount() == 1); - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" test.cancel(); - #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(exits); - #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(test.getPromiseReferenceCount() == 0 && test.getFutureReferenceCount() == 1 && test.isReady() && test.isError() && test.getError().code() == error_code_actor_cancelled); - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(p.getPromiseReferenceCount() == 1 && p.getFutureReferenceCount() == 0); - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase314ActorState(); static_cast(this)->destroy(); return 0; } - #line 3506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase314ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase323ActorState(); static_cast(this)->destroy(); return 0; } + #line 3515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase323ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -3519,40 +3528,40 @@ class FlowTestCase314ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase314ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase323ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 3530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase314() - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase314Actor final : public Actor, public FastAllocated, public FlowTestCase314ActorState { - #line 3535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase323() + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase323Actor final : public Actor, public FastAllocated, public FlowTestCase323ActorState { + #line 3544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase314Actor(UnitTestParameters const& params) - #line 3545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase323Actor(UnitTestParameters const& params) + #line 3554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase314ActorState(params) + FlowTestCase323ActorState(params) { - fdb_probe_actor_enter("flowTestCase314", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase323", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase314"); + this->lineage.setActorName("flowTestCase323"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase314", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase323", reinterpret_cast(this), -1); } void cancel() override @@ -3565,31 +3574,31 @@ class FlowTestCase314Actor final : public Actor, public FastAllocated flowTestCase314( UnitTestParameters const& params ) { - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase314Actor(params)); - #line 3572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase323( UnitTestParameters const& params ) { + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase323Actor(params)); + #line 3581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase314, "/flow/flow/cancel1") +ACTOR_TEST_CASE(flowTestCase323, "/flow/flow/cancel1") -#line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 3578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via noteCancel() - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class NoteCancelActorState { - #line 3585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" NoteCancelActorState(int* const& cancelled) - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : cancelled(cancelled) - #line 3592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("noteCancel", reinterpret_cast(this)); @@ -3602,20 +3611,20 @@ class NoteCancelActorState { int a_body1(int loopDepth=0) { try { - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" *cancelled = 0; - #line 3607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" try { - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = Future(Never()); - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 3613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3643,13 +3652,13 @@ class NoteCancelActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("Cancelled!\n"); - #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" *cancelled = 1; - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return a_body1Catch1(__current_error, loopDepth); - #line 3652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -3661,17 +3670,17 @@ class NoteCancelActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return a_body1Catch2(internal_error(), loopDepth); - #line 3666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return a_body1Catch2(internal_error(), loopDepth); - #line 3674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" return loopDepth; } @@ -3738,14 +3747,14 @@ class NoteCancelActorState { fdb_probe_actor_exit("noteCancel", reinterpret_cast(this), 0); } - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int* cancelled; - #line 3743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via noteCancel() - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class NoteCancelActor final : public Actor, public ActorCallback< NoteCancelActor, 0, Void >, public FastAllocated, public NoteCancelActorState { - #line 3748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3754,9 +3763,9 @@ class NoteCancelActor final : public Actor, public ActorCallback< NoteCanc void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< NoteCancelActor, 0, Void >; - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" NoteCancelActor(int* const& cancelled) - #line 3759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), NoteCancelActorState(cancelled) { @@ -3780,66 +3789,66 @@ friend struct ActorCallback< NoteCancelActor, 0, Void >; } }; } - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] static Future noteCancel( int* const& cancelled ) { - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new NoteCancelActor(cancelled)); - #line 3787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 3792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase340() - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase340ActorState { - #line 3799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase349() + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase349ActorState { + #line 3808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase340ActorState(UnitTestParameters const& params) - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase349ActorState(UnitTestParameters const& params) + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 3806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase340", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase349", reinterpret_cast(this)); } - ~FlowTestCase340ActorState() + ~FlowTestCase349ActorState() { - fdb_probe_actor_destroy("flowTestCase340", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase349", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int c1 = 0, c2 = 0, c3 = 0; - #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future cf = noteCancel(&c1); - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(c1 == 0); - #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" cf = Future(); - #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(c1 == 1); - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" cf = noteCancel(&c2) && noteCancel(&c3); - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(c2 == 0 && c3 == 0); - #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" cf = Future(); - #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(c2 == 1 && c3 == 1); - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase340ActorState(); static_cast(this)->destroy(); return 0; } - #line 3839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase340ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase349ActorState(); static_cast(this)->destroy(); return 0; } + #line 3848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase349ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -3852,40 +3861,40 @@ class FlowTestCase340ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase340ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase349ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 3863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase340() - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase340Actor final : public Actor, public FastAllocated, public FlowTestCase340ActorState { - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase349() + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase349Actor final : public Actor, public FastAllocated, public FlowTestCase349ActorState { + #line 3877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase340Actor(UnitTestParameters const& params) - #line 3878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase349Actor(UnitTestParameters const& params) + #line 3887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase340ActorState(params) + FlowTestCase349ActorState(params) { - fdb_probe_actor_enter("flowTestCase340", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase349", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase340"); + this->lineage.setActorName("flowTestCase349"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase340", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase349", reinterpret_cast(this), -1); } void cancel() override @@ -3898,17 +3907,17 @@ class FlowTestCase340Actor final : public Actor, public FastAllocated flowTestCase340( UnitTestParameters const& params ) { - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase340Actor(params)); - #line 3905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase349( UnitTestParameters const& params ) { + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase349Actor(params)); + #line 3914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase340, "/flow/flow/cancel2") +ACTOR_TEST_CASE(flowTestCase349, "/flow/flow/cancel2") -#line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -namespace { +namespace flow_tests_details { // Simple message for flatbuffers unittests struct Int { constexpr static FileIdentifier file_identifier = 12345; @@ -3920,80 +3929,80 @@ struct Int { serializer(ar, value); } }; -} // namespace +} // namespace flow_tests_details - #line 3925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase369() - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase369ActorState { - #line 3932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase378() + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase378ActorState { + #line 3941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase369ActorState(UnitTestParameters const& params) - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase378ActorState(UnitTestParameters const& params) + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 3939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase369", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase378", reinterpret_cast(this)); } - ~FlowTestCase369ActorState() + ~FlowTestCase378ActorState() { - fdb_probe_actor_destroy("flowTestCase369", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase378", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { { - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f = testNonserializableThing(); - #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p; - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(NonserializableThing()); - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = p.getFuture(); - #line 3961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - ReplyPromise rpInt; - #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - Future f = rpInt.getFuture(); - #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + ReplyPromise rpInt; + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + Future f = rpInt.getFuture(); + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!f.isReady()); - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" rpInt.send(123); - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.get().value == 123); - #line 3974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - RequestStream rsInt; - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FutureStream f = rsInt.getFuture(); - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + RequestStream rsInt; + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FutureStream f = rsInt.getFuture(); + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" rsInt.send(1); - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" rsInt.send(2); - #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.pop().value == 1); - #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.pop().value == 2); - #line 3989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase369ActorState(); static_cast(this)->destroy(); return 0; } - #line 3993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase369ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase378ActorState(); static_cast(this)->destroy(); return 0; } + #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase378ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -4006,40 +4015,40 @@ class FlowTestCase369ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase369ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase378ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 4017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase369() - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase369Actor final : public Actor, public FastAllocated, public FlowTestCase369ActorState { - #line 4022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase378() + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase378Actor final : public Actor, public FastAllocated, public FlowTestCase378ActorState { + #line 4031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase369Actor(UnitTestParameters const& params) - #line 4032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase378Actor(UnitTestParameters const& params) + #line 4041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase369ActorState(params) + FlowTestCase378ActorState(params) { - fdb_probe_actor_enter("flowTestCase369", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase378", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase369"); + this->lineage.setActorName("flowTestCase378"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase369", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase378", reinterpret_cast(this), -1); } void cancel() override @@ -4052,90 +4061,90 @@ class FlowTestCase369Actor final : public Actor, public FastAllocated flowTestCase369( UnitTestParameters const& params ) { - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase369Actor(params)); - #line 4059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase378( UnitTestParameters const& params ) { + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase378Actor(params)); + #line 4068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase369, "/flow/flow/nonserializable futures") +ACTOR_TEST_CASE(flowTestCase378, "/flow/flow/nonserializable futures") -#line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 4065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase402() - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase402ActorState { - #line 4072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase411() + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase411ActorState { + #line 4081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase402ActorState(UnitTestParameters const& params) - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase411ActorState(UnitTestParameters const& params) + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 4079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase402", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase411", reinterpret_cast(this)); } - ~FlowTestCase402ActorState() + ~FlowTestCase411ActorState() { - fdb_probe_actor_destroy("flowTestCase402", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase411", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { { - #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - RequestStream locInt; - #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + RequestStream locInt; + #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" BinaryWriter wr(IncludeVersion()); - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" wr << locInt; - #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(locInt.getEndpoint().isValid() && locInt.getEndpoint().isLocal() && locInt.getEndpoint().getPrimaryAddress() == FlowTransport::transport().getLocalAddress()); - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" BinaryReader rd(wr.toValue(), IncludeVersion()); - #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - RequestStream remoteInt; - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + RequestStream remoteInt; + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" rd >> remoteInt; - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(remoteInt.getEndpoint() == locInt.getEndpoint()); - #line 4109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (0) - #line 4113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - ReplyPromise locInt; - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + ReplyPromise locInt; + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" BinaryWriter wr(IncludeVersion()); - #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" wr << locInt; - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(locInt.getEndpoint().isValid() && locInt.getEndpoint().isLocal()); - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" BinaryReader rd(wr.toValue(), IncludeVersion()); - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - ReplyPromise remoteInt; - #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + ReplyPromise remoteInt; + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" rd >> remoteInt; - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(remoteInt.getEndpoint() == locInt.getEndpoint()); - #line 4131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase402ActorState(); static_cast(this)->destroy(); return 0; } - #line 4135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase402ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase411ActorState(); static_cast(this)->destroy(); return 0; } + #line 4144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase411ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -4148,40 +4157,40 @@ class FlowTestCase402ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase402ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase411ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 4159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase402() - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase402Actor final : public Actor, public FastAllocated, public FlowTestCase402ActorState { - #line 4164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase411() + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase411Actor final : public Actor, public FastAllocated, public FlowTestCase411ActorState { + #line 4173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase402Actor(UnitTestParameters const& params) - #line 4174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase411Actor(UnitTestParameters const& params) + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase402ActorState(params) + FlowTestCase411ActorState(params) { - fdb_probe_actor_enter("flowTestCase402", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase411", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase402"); + this->lineage.setActorName("flowTestCase411"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase402", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase411", reinterpret_cast(this), -1); } void cancel() override @@ -4194,79 +4203,79 @@ class FlowTestCase402Actor final : public Actor, public FastAllocated flowTestCase402( UnitTestParameters const& params ) { - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase402Actor(params)); - #line 4201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase411( UnitTestParameters const& params ) { + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase411Actor(params)); + #line 4210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase402, "/flow/flow/networked futures") +ACTOR_TEST_CASE(flowTestCase411, "/flow/flow/networked futures") -#line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 4207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase438() - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase438ActorState { - #line 4214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase447() + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase447ActorState { + #line 4223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase438ActorState(UnitTestParameters const& params) - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase447ActorState(UnitTestParameters const& params) + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 4221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase438", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase447", reinterpret_cast(this)); } - ~FlowTestCase438ActorState() + ~FlowTestCase447ActorState() { - fdb_probe_actor_destroy("flowTestCase438", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase447", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> ps(5); - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> fs; - #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> qs; - #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for( auto& p : ps ) { - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" fs.push_back(p.getFuture()); - #line 4244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i <= ps.size();i++) { - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" qs.push_back(quorum(fs, i)); - #line 4250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < ps.size();i++) { - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(qs[i].isReady()); - #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!qs[i + 1].isReady()); - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ps[i].send(i); - #line 4260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(qs[ps.size()].isReady()); - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase438ActorState(); static_cast(this)->destroy(); return 0; } - #line 4266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase438ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase447ActorState(); static_cast(this)->destroy(); return 0; } + #line 4275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase447ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -4279,40 +4288,40 @@ class FlowTestCase438ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase438ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase447ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 4290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase438() - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase438Actor final : public Actor, public FastAllocated, public FlowTestCase438ActorState { - #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase447() + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase447Actor final : public Actor, public FastAllocated, public FlowTestCase447ActorState { + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase438Actor(UnitTestParameters const& params) - #line 4305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase447Actor(UnitTestParameters const& params) + #line 4314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase438ActorState(params) + FlowTestCase447ActorState(params) { - fdb_probe_actor_enter("flowTestCase438", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase447", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase438"); + this->lineage.setActorName("flowTestCase447"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase438", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase447", reinterpret_cast(this), -1); } void cancel() override @@ -4325,65 +4334,65 @@ class FlowTestCase438Actor final : public Actor, public FastAllocated flowTestCase438( UnitTestParameters const& params ) { - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase438Actor(params)); - #line 4332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase447( UnitTestParameters const& params ) { + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase447Actor(params)); + #line 4341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase438, "/flow/flow/quorum") +ACTOR_TEST_CASE(flowTestCase447, "/flow/flow/quorum") -#line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 4338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase457() - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase457ActorState { - #line 4345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase466() + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase466ActorState { + #line 4354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase457ActorState(UnitTestParameters const& params) - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase466ActorState(UnitTestParameters const& params) + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 4352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase457", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase466", reinterpret_cast(this)); } - ~FlowTestCase457ActorState() + ~FlowTestCase466ActorState() { - fdb_probe_actor_destroy("flowTestCase457", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase466", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future invalid; - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!invalid.isValid()); - #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future never = Never(); - #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(never.isValid() && !never.isReady()); - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future one = 1; - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(one.isValid() && one.isReady() && !one.isError()); - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(one.get() == 1); - #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(one.getFutureReferenceCount() == 1); - #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase457ActorState(); static_cast(this)->destroy(); return 0; } - #line 4383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase457ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase466ActorState(); static_cast(this)->destroy(); return 0; } + #line 4392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase466ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -4396,40 +4405,40 @@ class FlowTestCase457ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase457ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase466ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 4407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase457() - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase457Actor final : public Actor, public FastAllocated, public FlowTestCase457ActorState { - #line 4412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase466() + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase466Actor final : public Actor, public FastAllocated, public FlowTestCase466ActorState { + #line 4421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase457Actor(UnitTestParameters const& params) - #line 4422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase466Actor(UnitTestParameters const& params) + #line 4431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase457ActorState(params) + FlowTestCase466ActorState(params) { - fdb_probe_actor_enter("flowTestCase457", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase466", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase457"); + this->lineage.setActorName("flowTestCase466"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase457", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase466", reinterpret_cast(this), -1); } void cancel() override @@ -4442,97 +4451,97 @@ class FlowTestCase457Actor final : public Actor, public FastAllocated flowTestCase457( UnitTestParameters const& params ) { - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase457Actor(params)); - #line 4449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase466( UnitTestParameters const& params ) { + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase466Actor(params)); + #line 4458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase457, "/flow/flow/trivial futures") +ACTOR_TEST_CASE(flowTestCase466, "/flow/flow/trivial futures") -#line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 4455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase471() - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase471ActorState { - #line 4462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase480() + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase480ActorState { + #line 4471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase471ActorState(UnitTestParameters const& params) - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase480ActorState(UnitTestParameters const& params) + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 4469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase471", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase480", reinterpret_cast(this)); } - ~FlowTestCase471ActorState() + ~FlowTestCase480ActorState() { - fdb_probe_actor_destroy("flowTestCase471", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase480", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f; - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p; - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(p.isValid()); - #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!p.isSet()); - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(1); - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(p.isSet()); - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(p.getFuture().get() == 1); - #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p2; - #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = p2.getFuture(); - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isValid() && !f.isReady()); - #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p2.send(2); - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isValid() && f.isReady() && !f.isError()); - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.get() == 2); - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p3; - #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = p3.getFuture(); - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p3.sendError(end_of_stream()); - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isValid() && f.isReady() && f.isError()); - #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.getError().code() == error_code_end_of_stream); - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p4; - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = p4.getFuture(); - #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p4 = Promise(); - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(p4.isValid() && !p4.isSet()); - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isValid() && f.isReady() && f.isError()); - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.getError().code() == error_code_broken_promise); - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase471ActorState(); static_cast(this)->destroy(); return 0; } - #line 4532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase471ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase480ActorState(); static_cast(this)->destroy(); return 0; } + #line 4541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase480ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -4545,40 +4554,40 @@ class FlowTestCase471ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase471ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase480ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 4556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase471() - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase471Actor final : public Actor, public FastAllocated, public FlowTestCase471ActorState { - #line 4561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase480() + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase480Actor final : public Actor, public FastAllocated, public FlowTestCase480ActorState { + #line 4570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase471Actor(UnitTestParameters const& params) - #line 4571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase480Actor(UnitTestParameters const& params) + #line 4580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase471ActorState(params) + FlowTestCase480ActorState(params) { - fdb_probe_actor_enter("flowTestCase471", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase480", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase471"); + this->lineage.setActorName("flowTestCase480"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase471", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase480", reinterpret_cast(this), -1); } void cancel() override @@ -4591,101 +4600,101 @@ class FlowTestCase471Actor final : public Actor, public FastAllocated flowTestCase471( UnitTestParameters const& params ) { - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase471Actor(params)); - #line 4598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase480( UnitTestParameters const& params ) { + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase480Actor(params)); + #line 4607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase471, "/flow/flow/trivial promises") +ACTOR_TEST_CASE(flowTestCase480, "/flow/flow/trivial promises") -#line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 4604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase503() - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase503ActorState { - #line 4611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase512() + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase512ActorState { + #line 4620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase503ActorState(UnitTestParameters const& params) - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase512ActorState(UnitTestParameters const& params) + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 4618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase503", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase512", reinterpret_cast(this)); } - ~FlowTestCase503ActorState() + ~FlowTestCase512ActorState() { - fdb_probe_actor_destroy("flowTestCase503", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase512", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FutureStream f; - #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" PromiseStream p; - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(1); - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(p.getFuture().isReady()); - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(p.getFuture().pop() == 1); - #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" PromiseStream p2; - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = p2.getFuture(); - #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isValid() && !f.isReady()); - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p2.send(2); - #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p2.send(3); - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isValid() && f.isReady() && !f.isError()); - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.pop() == 2); - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.pop() == 3); - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" PromiseStream p3; - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = p3.getFuture(); - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p3.send(4); - #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p3.sendError(end_of_stream()); - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isReady() && !f.isError()); - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.pop() == 4); - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isError()); - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.getError().code() == error_code_end_of_stream); - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" PromiseStream p4; - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = p4.getFuture(); - #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p4 = PromiseStream(); - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isValid() && f.isReady() && f.isError()); - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.getError().code() == error_code_broken_promise); - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase503ActorState(); static_cast(this)->destroy(); return 0; } - #line 4685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase503ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase512ActorState(); static_cast(this)->destroy(); return 0; } + #line 4694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase512ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -4698,40 +4707,40 @@ class FlowTestCase503ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase503ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase512ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 4709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase503() - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase503Actor final : public Actor, public FastAllocated, public FlowTestCase503ActorState { - #line 4714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase512() + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase512Actor final : public Actor, public FastAllocated, public FlowTestCase512ActorState { + #line 4723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase503Actor(UnitTestParameters const& params) - #line 4724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase512Actor(UnitTestParameters const& params) + #line 4733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase503ActorState(params) + FlowTestCase512ActorState(params) { - fdb_probe_actor_enter("flowTestCase503", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase512", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase503"); + this->lineage.setActorName("flowTestCase512"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase503", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase512", reinterpret_cast(this), -1); } void cancel() override @@ -4744,99 +4753,99 @@ class FlowTestCase503Actor final : public Actor, public FastAllocated flowTestCase503( UnitTestParameters const& params ) { - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase503Actor(params)); - #line 4751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase512( UnitTestParameters const& params ) { + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase512Actor(params)); + #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase503, "/flow/flow/trivial promisestreams") +ACTOR_TEST_CASE(flowTestCase512, "/flow/flow/trivial promisestreams") -#line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 4757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase537() - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase537ActorState { - #line 4764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase546() + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase546ActorState { + #line 4773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase537ActorState(UnitTestParameters const& params) - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase546ActorState(UnitTestParameters const& params) + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 4771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase537", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase546", reinterpret_cast(this)); } - ~FlowTestCase537ActorState() + ~FlowTestCase546ActorState() { - fdb_probe_actor_destroy("flowTestCase537", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase546", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p; - #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f = p.getFuture(); - #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int result = 0; - #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" bool happened = false; - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" onReady( std::move(f), [&result](int x) { result = x; }, [&result](Error e) { result = -1; }); - #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" onReady( p.getFuture(), [&happened](int) { happened = true; }, [&happened](Error) { happened = true; }); - #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!f.isValid()); - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(p.isValid() && !p.isSet() && p.getFutureReferenceCount() == 1); - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(result == 0 && !happened); - #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(123); - #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(result == 123 && happened); - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(p.isValid() && p.isSet() && p.getFutureReferenceCount() == 0 && p.getFuture().get() == 123); - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" result = 0; - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" onReady( p.getFuture(), [&result](int x) { result = x; }, [&result](Error e) { result = -1; }); - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(result == 123); - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(p.isValid() && p.isSet() && p.getFutureReferenceCount() == 0 && p.getFuture().get() == 123); - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p = Promise(); - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = p.getFuture(); - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" result = 0; - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" onReady( std::move(f), [&result](int x) { result = x; }, [&result](Error e) { result = -e.code(); }); - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!f.isValid()); - #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(p.isValid() && !p.isSet() && p.getFutureReferenceCount() == 1); - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(result == 0); - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p = Promise(); - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(result == -error_code_broken_promise); - #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase537ActorState(); static_cast(this)->destroy(); return 0; } - #line 4836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase537ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase546ActorState(); static_cast(this)->destroy(); return 0; } + #line 4845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase546ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -4849,40 +4858,40 @@ class FlowTestCase537ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase537ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase546ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 4860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase537() - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase537Actor final : public Actor, public FastAllocated, public FlowTestCase537ActorState { - #line 4865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase546() + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase546Actor final : public Actor, public FastAllocated, public FlowTestCase546ActorState { + #line 4874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase537Actor(UnitTestParameters const& params) - #line 4875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase546Actor(UnitTestParameters const& params) + #line 4884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase537ActorState(params) + FlowTestCase546ActorState(params) { - fdb_probe_actor_enter("flowTestCase537", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase546", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase537"); + this->lineage.setActorName("flowTestCase546"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase537", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase546", reinterpret_cast(this), -1); } void cancel() override @@ -4895,79 +4904,79 @@ class FlowTestCase537Actor final : public Actor, public FastAllocated flowTestCase537( UnitTestParameters const& params ) { - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase537Actor(params)); - #line 4902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase546( UnitTestParameters const& params ) { + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase546Actor(params)); + #line 4911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase537, "/flow/flow/callbacks") +ACTOR_TEST_CASE(flowTestCase546, "/flow/flow/callbacks") -#line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 4908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase575() - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase575ActorState { - #line 4915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase584() + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase584ActorState { + #line 4924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase575ActorState(UnitTestParameters const& params) - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase584ActorState(UnitTestParameters const& params) + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 4922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 4931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase575", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase584", reinterpret_cast(this)); } - ~FlowTestCase575ActorState() + ~FlowTestCase584ActorState() { - fdb_probe_actor_destroy("flowTestCase575", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase584", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" PromiseStream p; - #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int result = 0; - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" onReady( p.getFuture(), [&result](int x) { result = x; }, [&result](Error e) { result = -1; }); - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(result == 0); - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(123); - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(456); - #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(result == 123); - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" result = 0; - #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" onReady( p.getFuture(), [&result](int x) { result = x; }, [&result](Error e) { result = -1; }); - #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(result == 456); - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" result = 0; - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" onReady( p.getFuture(), [&result](int x) { result = x; }, [&result](Error e) { result = -1; }); - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(result == 0); - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p = PromiseStream(); - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(result == -1); - #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase575ActorState(); static_cast(this)->destroy(); return 0; } - #line 4967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase575ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase584ActorState(); static_cast(this)->destroy(); return 0; } + #line 4976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase584ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -4980,40 +4989,40 @@ class FlowTestCase575ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase575ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase584ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 4991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase575() - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase575Actor final : public Actor, public FastAllocated, public FlowTestCase575ActorState { - #line 4996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase584() + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase584Actor final : public Actor, public FastAllocated, public FlowTestCase584ActorState { + #line 5005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase575Actor(UnitTestParameters const& params) - #line 5006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase584Actor(UnitTestParameters const& params) + #line 5015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase575ActorState(params) + FlowTestCase584ActorState(params) { - fdb_probe_actor_enter("flowTestCase575", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase584", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase575"); + this->lineage.setActorName("flowTestCase584"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase575", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase584", reinterpret_cast(this), -1); } void cancel() override @@ -5026,15 +5035,15 @@ class FlowTestCase575Actor final : public Actor, public FastAllocated flowTestCase575( UnitTestParameters const& params ) { - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase575Actor(params)); - #line 5033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase584( UnitTestParameters const& params ) { + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase584Actor(params)); + #line 5042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase575, "/flow/flow/promisestream callbacks") +ACTOR_TEST_CASE(flowTestCase584, "/flow/flow/promisestream callbacks") -#line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" // Incompatible with --crash, so we are commenting it out for now /* @@ -5058,123 +5067,123 @@ TEST_CASE("/flow/flow/promisestream multiple wait error") } */ - #line 5061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase630() - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase630ActorState { - #line 5068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase639() + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase639ActorState { + #line 5077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase630ActorState(UnitTestParameters const& params) - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase639ActorState(UnitTestParameters const& params) + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 5075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase630", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase639", reinterpret_cast(this)); } - ~FlowTestCase630ActorState() + ~FlowTestCase639ActorState() { - fdb_probe_actor_destroy("flowTestCase630", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase639", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(expectActorCount(0)); - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int result = 0; - #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" trivialVoidActor(&result); - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(result == 1); - #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(expectActorCount(0)); - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f = return42Actor(); - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isReady() && !f.isError() && f.get() == 42 && f.getFutureReferenceCount() == 1 && f.getPromiseReferenceCount() == 0); - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(expectActorCount(1)); - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = Future(); - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(expectActorCount(0)); - #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = templateActor(24); - #line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isReady() && !f.isError() && f.get() == 24 && f.getFutureReferenceCount() == 1 && f.getPromiseReferenceCount() == 0); - #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(expectActorCount(1)); - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = Future(); - #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(expectActorCount(0)); - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" result = 0; - #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" voidWaitActor(2, &result); - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(result == 2 && expectActorCount(0)); - #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p; - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = addOneActor(p.getFuture()); - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!f.isReady() && expectActorCount(1)); - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(100); - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isReady() && f.get() == 101); - #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(expectActorCount(1)); - #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = Future(); - #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(expectActorCount(0)); - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" PromiseStream ps; - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = consumeOneActor(ps.getFuture()); - #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!f.isReady() && expectActorCount(1)); - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ps.send(101); - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.get() == 101 && ps.isEmpty()); - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ps.send(102); - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!ps.isEmpty()); - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = consumeOneActor(ps.getFuture()); - #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.get() == 102 && ps.isEmpty()); - #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = sumActor(ps.getFuture()); - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ps.send(1); - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ps.send(10); - #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ps.send(100); - #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ps.sendError(end_of_stream()); - #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.get() == 111); - #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(testHygeine().isReady()); - #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase630ActorState(); static_cast(this)->destroy(); return 0; } - #line 5174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase630ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase639ActorState(); static_cast(this)->destroy(); return 0; } + #line 5183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase639ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -5187,40 +5196,40 @@ class FlowTestCase630ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase630ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase639ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 5198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase630() - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase630Actor final : public Actor, public FastAllocated, public FlowTestCase630ActorState { - #line 5203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase639() + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase639Actor final : public Actor, public FastAllocated, public FlowTestCase639ActorState { + #line 5212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase630Actor(UnitTestParameters const& params) - #line 5213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase639Actor(UnitTestParameters const& params) + #line 5222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase630ActorState(params) + FlowTestCase639ActorState(params) { - fdb_probe_actor_enter("flowTestCase630", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase639", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase630"); + this->lineage.setActorName("flowTestCase639"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase630", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase639", reinterpret_cast(this), -1); } void cancel() override @@ -5233,89 +5242,89 @@ class FlowTestCase630Actor final : public Actor, public FastAllocated flowTestCase630( UnitTestParameters const& params ) { - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase630Actor(params)); - #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase639( UnitTestParameters const& params ) { + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase639Actor(params)); + #line 5249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase630, "/flow/flow/trivial actors") +ACTOR_TEST_CASE(flowTestCase639, "/flow/flow/trivial actors") -#line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 5246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase686() - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase686ActorState { - #line 5253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase695() + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase695ActorState { + #line 5262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase686ActorState(UnitTestParameters const& params) - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase695ActorState(UnitTestParameters const& params) + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 5260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase686", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase695", reinterpret_cast(this)); } - ~FlowTestCase686ActorState() + ~FlowTestCase695ActorState() { - fdb_probe_actor_destroy("flowTestCase686", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase695", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" auto yn = makeReference(); - #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yn->nextYield = 0; - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p; - #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future u = p.getFuture(); - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future i = success(u); - #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> v; - #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < 5;i++) { - #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" v.push_back(yieldedFuture(u)); - #line 5289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" auto numReady = [&v]() { return std::count_if(v.begin(), v.end(), [](Future v) { return v.isReady(); }); }; - #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(numReady() == 0); - #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(Void()); - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(u.isReady() && i.isReady() && numReady() == 0); - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < 5;i++) { - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yn->tick(); - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(numReady() == i + 1); - #line 5305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < 5;i++) { - #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(v[i].getPromiseReferenceCount() == 0 && v[i].getFutureReferenceCount() == 1); - #line 5311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase686ActorState(); static_cast(this)->destroy(); return 0; } - #line 5315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase686ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase695ActorState(); static_cast(this)->destroy(); return 0; } + #line 5324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase695ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -5328,40 +5337,40 @@ class FlowTestCase686ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase686ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase695ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 5339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase686() - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase686Actor final : public Actor, public FastAllocated, public FlowTestCase686ActorState { - #line 5344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase695() + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase695Actor final : public Actor, public FastAllocated, public FlowTestCase695ActorState { + #line 5353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase686Actor(UnitTestParameters const& params) - #line 5354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase695Actor(UnitTestParameters const& params) + #line 5363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase686ActorState(params) + FlowTestCase695ActorState(params) { - fdb_probe_actor_enter("flowTestCase686", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase695", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase686"); + this->lineage.setActorName("flowTestCase695"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase686", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase695", reinterpret_cast(this), -1); } void cancel() override @@ -5374,104 +5383,104 @@ class FlowTestCase686Actor final : public Actor, public FastAllocated flowTestCase686( UnitTestParameters const& params ) { - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase686Actor(params)); - #line 5381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase695( UnitTestParameters const& params ) { + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase695Actor(params)); + #line 5390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase686, "/flow/flow/yieldedFuture/progress") +ACTOR_TEST_CASE(flowTestCase695, "/flow/flow/yieldedFuture/progress") -#line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 5387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase719() - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase719ActorState { - #line 5394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase728() + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase728ActorState { + #line 5403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase719ActorState(UnitTestParameters const& params) - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase728ActorState(UnitTestParameters const& params) + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 5401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase719", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase728", reinterpret_cast(this)); } - ~FlowTestCase719ActorState() + ~FlowTestCase728ActorState() { - fdb_probe_actor_destroy("flowTestCase719", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase728", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" auto yn = makeReference(); - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int r = 0;r < 100;r++) { - #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p; - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future u = p.getFuture(); - #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future i = success(u); - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> v; - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < 25;i++) { - #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" v.push_back(yieldedFuture(u)); - #line 5430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" auto numReady = [&v]() { return std::count_if(v.begin(), v.end(), [](Future v) { return v.isReady(); }); }; - #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future j = success(u); - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(numReady() == 0); - #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int expectYield = deterministicRandom()->randomInt(0, 4); - #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int expectReady = expectYield; - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yn->nextYield = 1 + expectYield; - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(Void()); - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(u.isReady() && i.isReady() && j.isReady() && numReady() == expectReady); - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(;numReady() != v.size();) { - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" expectYield = deterministicRandom()->randomInt(0, 4); - #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yn->nextYield = 1 + expectYield; - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" expectReady += 1 + expectYield; - #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yn->tick(); - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(numReady() == std::min(expectReady, v.size())); - #line 5460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < v.size();i++) { - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(v[i].getPromiseReferenceCount() == 0 && v[i].getFutureReferenceCount() == 1); - #line 5466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } } - #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase719ActorState(); static_cast(this)->destroy(); return 0; } - #line 5471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase719ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase728ActorState(); static_cast(this)->destroy(); return 0; } + #line 5480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase728ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -5484,40 +5493,40 @@ class FlowTestCase719ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase719ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase728ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 5495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase719() - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase719Actor final : public Actor, public FastAllocated, public FlowTestCase719ActorState { - #line 5500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase728() + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase728Actor final : public Actor, public FastAllocated, public FlowTestCase728ActorState { + #line 5509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase719Actor(UnitTestParameters const& params) - #line 5510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase728Actor(UnitTestParameters const& params) + #line 5519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase719ActorState(params) + FlowTestCase728ActorState(params) { - fdb_probe_actor_enter("flowTestCase719", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase728", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase719"); + this->lineage.setActorName("flowTestCase728"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase719", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase728", reinterpret_cast(this), -1); } void cancel() override @@ -5530,97 +5539,97 @@ class FlowTestCase719Actor final : public Actor, public FastAllocated flowTestCase719( UnitTestParameters const& params ) { - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase719Actor(params)); - #line 5537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase728( UnitTestParameters const& params ) { + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase728Actor(params)); + #line 5546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase719, "/flow/flow/yieldedFuture/random") +ACTOR_TEST_CASE(flowTestCase728, "/flow/flow/yieldedFuture/random") -#line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 5543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase765() - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase765ActorState { - #line 5550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase774() + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase774ActorState { + #line 5559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase765ActorState(UnitTestParameters const& params) - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase774ActorState(UnitTestParameters const& params) + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 5557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase765", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase774", reinterpret_cast(this)); } - ~FlowTestCase765ActorState() + ~FlowTestCase774ActorState() { - fdb_probe_actor_destroy("flowTestCase765", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase774", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" double start; - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int N = 1000000; - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" auto yn = makeReference(); - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yn->nextYield = 2 * N + 100; - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p; - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f = p.getFuture(); - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> ys; - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ys.push_back(yieldedFuture(f)); - #line 5590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("yieldedFuture(f) create: %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(Void()); - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("yieldedFuture(f) total: %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for( auto& y : ys ) { - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(y.isReady()); - #line 5602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p = Promise(); - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f = p.getFuture(); - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yieldedFuture(f); - #line 5614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("yieldedFuture(f) cancel: %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase765ActorState(); static_cast(this)->destroy(); return 0; } - #line 5620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase765ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase774ActorState(); static_cast(this)->destroy(); return 0; } + #line 5629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase774ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -5633,40 +5642,40 @@ class FlowTestCase765ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase765ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase774ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 5644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase765() - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase765Actor final : public Actor, public FastAllocated, public FlowTestCase765ActorState { - #line 5649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase774() + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase774Actor final : public Actor, public FastAllocated, public FlowTestCase774ActorState { + #line 5658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase765Actor(UnitTestParameters const& params) - #line 5659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase774Actor(UnitTestParameters const& params) + #line 5668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase765ActorState(params) + FlowTestCase774ActorState(params) { - fdb_probe_actor_enter("flowTestCase765", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase774", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase765"); + this->lineage.setActorName("flowTestCase774"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase765", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase774", reinterpret_cast(this), -1); } void cancel() override @@ -5679,65 +5688,65 @@ class FlowTestCase765Actor final : public Actor, public FastAllocated flowTestCase765( UnitTestParameters const& params ) { - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase765Actor(params)); - #line 5686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase774( UnitTestParameters const& params ) { + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase774Actor(params)); + #line 5695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase765, "/flow/perf/yieldedFuture") +ACTOR_TEST_CASE(flowTestCase774, "/flow/perf/yieldedFuture") -#line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 5692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase798() - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase798ActorState { - #line 5699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase807() + #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase807ActorState { + #line 5708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase798ActorState(UnitTestParameters const& params) - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase807ActorState(UnitTestParameters const& params) + #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 5706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase798", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase807", reinterpret_cast(this)); } - ~FlowTestCase798ActorState() + ~FlowTestCase807ActorState() { - fdb_probe_actor_destroy("flowTestCase798", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase807", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(expectActorCount(0)); - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise a, b; - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future c = chooseTwoActor(a.getFuture(), b.getFuture()); - #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(a.getFutureReferenceCount() == 2 && b.getFutureReferenceCount() == 2 && !c.isReady()); - #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" b.send(Void()); - #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(a.getFutureReferenceCount() == 0 && b.getFutureReferenceCount() == 0 && c.isReady() && !c.isError() && expectActorCount(1)); - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" c = Future(); - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(a.getFutureReferenceCount() == 0 && b.getFutureReferenceCount() == 0 && expectActorCount(0)); - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase798ActorState(); static_cast(this)->destroy(); return 0; } - #line 5737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase798ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase807ActorState(); static_cast(this)->destroy(); return 0; } + #line 5746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase807ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -5750,40 +5759,40 @@ class FlowTestCase798ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase798ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase807ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 5761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase798() - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase798Actor final : public Actor, public FastAllocated, public FlowTestCase798ActorState { - #line 5766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase807() + #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase807Actor final : public Actor, public FastAllocated, public FlowTestCase807ActorState { + #line 5775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase798Actor(UnitTestParameters const& params) - #line 5776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase807Actor(UnitTestParameters const& params) + #line 5785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase798ActorState(params) + FlowTestCase807ActorState(params) { - fdb_probe_actor_enter("flowTestCase798", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase807", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase798"); + this->lineage.setActorName("flowTestCase807"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase798", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase807", reinterpret_cast(this), -1); } void cancel() override @@ -5796,207 +5805,192 @@ class FlowTestCase798Actor final : public Actor, public FastAllocated flowTestCase798( UnitTestParameters const& params ) { - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase798Actor(params)); - #line 5803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase807( UnitTestParameters const& params ) { + #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase807Actor(params)); + #line 5812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase798, "/flow/flow/chooseTwoActor") +ACTOR_TEST_CASE(flowTestCase807, "/flow/flow/chooseTwoActor") -#line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 5809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase812() - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase812ActorState { - #line 5816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase821() + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase821ActorState { + #line 5825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase812ActorState(UnitTestParameters const& params) - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase821ActorState(UnitTestParameters const& params) + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 5823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase812", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase821", reinterpret_cast(this)); } - ~FlowTestCase812ActorState() + ~FlowTestCase821ActorState() { - fdb_probe_actor_destroy("flowTestCase812", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase821", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" double start; - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int N = 1000000; - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(expectActorCount(0)); - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" emptyVoidActor(); - #line 5848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("emptyVoidActor(): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(expectActorCount(0)); - #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" emptyActor(); - #line 5860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("emptyActor(): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(expectActorCount(0)); - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise neverSet; - #line 834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future never = neverSet.getFuture(); - #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future already = Void(); - #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" oneWaitVoidActor(already); - #line 5878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("oneWaitVoidActor(already): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(expectActorCount(0)); - #line 5884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f = oneWaitActor(already); - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isReady()); - #line 5894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("oneWaitActor(already): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 5898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f = oneWaitActor(never); - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!f.isReady()); - #line 5909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("(cancelled) oneWaitActor(never): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(expectActorCount(0)); - #line 5915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p; - #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f = oneWaitActor(p.getFuture()); - #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(Void()); - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isReady()); - #line 5930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("oneWaitActor(after): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 5934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> pipe(N); - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> out(N); - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" out[i] = oneWaitActor(pipe[i].getFuture()); - #line 5947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" pipe[i].send(Void()); - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(out[i].isReady()); - #line 5955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("oneWaitActor(fifo): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 5959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> pipe(N); - #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> out(N); - #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" out[i] = oneWaitActor(pipe[i].getFuture()); - #line 5972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - } - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - for(int i = N - 1;i >= 0;i--) { - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - pipe[i].send(Void()); - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - ASSERT(out[i].isReady()); - #line 5980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 5981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - printf("oneWaitActor(lifo): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 5984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - } - { - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - start = timer(); #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - for(int i = 0;i < N;i++) { + for(int i = N - 1;i >= 0;i--) { #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - Future f = chooseTwoActor(already, already); + pipe[i].send(Void()); #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - ASSERT(f.isReady()); - #line 5995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + ASSERT(out[i].isReady()); + #line 5989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - printf("chooseTwoActor(already, already): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 5999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + printf("oneWaitActor(lifo): %0.1f M/sec\n", N / 1e6 / (timer() - start)); + #line 5993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" @@ -6004,14 +5998,14 @@ class FlowTestCase812ActorState { #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - Future f = chooseTwoActor(already, never); + Future f = chooseTwoActor(already, already); #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isReady()); - #line 6010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - printf("chooseTwoActor(already, never): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 6014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + printf("chooseTwoActor(already, already): %0.1f M/sec\n", N / 1e6 / (timer() - start)); + #line 6008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" @@ -6019,14 +6013,14 @@ class FlowTestCase812ActorState { #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - Future f = chooseTwoActor(never, already); + Future f = chooseTwoActor(already, never); #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isReady()); - #line 6025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - printf("chooseTwoActor(never, already): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 6029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + printf("chooseTwoActor(already, never): %0.1f M/sec\n", N / 1e6 / (timer() - start)); + #line 6023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" @@ -6034,334 +6028,349 @@ class FlowTestCase812ActorState { #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - Future f = chooseTwoActor(never, never); + Future f = chooseTwoActor(never, already); #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + ASSERT(f.isReady()); + #line 6034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + } + #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + printf("chooseTwoActor(never, already): %0.1f M/sec\n", N / 1e6 / (timer() - start)); + #line 6038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + } + { + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + start = timer(); + #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + for(int i = 0;i < N;i++) { + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + Future f = chooseTwoActor(never, never); + #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!f.isReady()); - #line 6040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("(cancelled) chooseTwoActor(never, never): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 6044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p; - #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f = chooseTwoActor(p.getFuture(), never); - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(Void()); - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isReady()); - #line 6059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("chooseTwoActor(after, never): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 6063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> pipe(N); - #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> out(N); - #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" out[i] = chooseTwoActor(pipe[i].getFuture(), never); - #line 6076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" pipe[i].send(Void()); - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(out[i].isReady()); - #line 6084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("chooseTwoActor(fifo, never): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 6088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> pipe(N); - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> out(N); - #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" out[i] = chooseTwoActor(pipe[i].getFuture(), pipe[i].getFuture()); - #line 6101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" pipe[i].send(Void()); - #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(out[i].isReady()); - #line 6109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("chooseTwoActor(fifo, fifo): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 6113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> pipe(N); - #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> out(N); - #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" out[i] = chooseTwoActor(chooseTwoActor(pipe[i].getFuture(), never), never); - #line 6126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" pipe[i].send(Void()); - #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(out[i].isReady()); - #line 6134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("chooseTwoActor^2((fifo, never), never): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 6138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p; - #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f = oneWaitActor(chooseTwoActor(p.getFuture(), never)); - #line 1002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(Void()); - #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isReady()); - #line 6153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("oneWaitActor(chooseTwoActor(after, never)): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 6157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> pipe(N); - #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> out(N); - #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" out[i] = oneWaitActor(chooseTwoActor(pipe[i].getFuture(), never)); - #line 6170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" pipe[i].send(Void()); - #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(out[i].isReady()); - #line 6178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("oneWaitActor(chooseTwoActor(fifo, never)): %0.1f M/sec\n", N / 1e6 / (timer() - start)); - #line 6182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Promise p; - #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f = chooseTwoActor(p.getFuture(), never); - #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future a = oneWaitActor(f); - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future b = oneWaitActor(f); - #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(Void()); - #line 1030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(f.isReady()); - #line 6201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("2xoneWaitActor(chooseTwoActor(after, never)): %0.2f M/sec\n", N / 1e6 / (timer() - start)); - #line 6205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> pipe(N); - #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> out1(N); - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> out2(N); - #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 1040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f = chooseTwoActor(pipe[i].getFuture(), never); - #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" out1[i] = oneWaitActor(f); - #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" out2[i] = oneWaitActor(f); - #line 6224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 1046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" pipe[i].send(Void()); - #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(out2[i].isReady()); - #line 6232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("2xoneWaitActor(chooseTwoActor(fifo, never)): %0.2f M/sec\n", N / 1e6 / (timer() - start)); - #line 6236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> pipe(N); - #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> out1(N); - #line 1055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> out2(N); - #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 1058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f = chooseTwoActor(oneWaitActor(pipe[i].getFuture()), never); - #line 1059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" out1[i] = oneWaitActor(f); - #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" out2[i] = oneWaitActor(f); - #line 6255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" pipe[i].send(Void()); - #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(out2[i].isReady()); - #line 6263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("2xoneWaitActor(chooseTwoActor(oneWaitActor(fifo), never)): %0.2f M/sec\n", N / 1e6 / (timer() - start)); - #line 6267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> pipe(N); - #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> out1(N); - #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> out2(N); - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" g_cheese = pipe[i].getFuture(); - #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f = chooseTwoActor(cheeseWaitActor(), never); - #line 1077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" g_cheese = f; - #line 1078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" out1[i] = cheeseWaitActor(); - #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" out2[i] = cheeseWaitActor(); - #line 6290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" pipe[i].send(Void()); - #line 1083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(out2[i].isReady()); - #line 6298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("2xcheeseActor(chooseTwoActor(cheeseActor(fifo), never)): %0.2f M/sec\n", N / 1e6 / (timer() - start)); - #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - printf("sizeof(CheeseWaitActorActor) == %zu\n", sizeof(CheeseWaitActorActor)); - #line 6304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + printf("sizeof(CheeseWaitActorActor) == %zu\n", cheeseWaitActorSize()); + #line 6313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" PromiseStream data; - #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future sum = sumActor(data.getFuture()); - #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" data.send(1); - #line 6317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" data.sendError(end_of_stream()); - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(sum.get() == N); - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("sumActor: %0.2f M/sec\n", N / 1e6 / (timer() - start)); - #line 6325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } { - #line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" start = timer(); - #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> ps(3); - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> fs(3); - #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < N;i++) { - #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ps.clear(); - #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ps.resize(3); - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int j = 0;j < ps.size();j++) { - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" fs[j] = ps[j].getFuture(); - #line 6344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future q = quorum(fs, 2); - #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for( auto& p : ps ) { - #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" p.send(Void()); - #line 6352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } } - #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("quorum(2/3): %0.2f M/sec\n", N / 1e6 / (timer() - start)); - #line 6357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase812ActorState(); static_cast(this)->destroy(); return 0; } - #line 6361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase812ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase821ActorState(); static_cast(this)->destroy(); return 0; } + #line 6370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase821ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -6374,40 +6383,40 @@ class FlowTestCase812ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase812ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase821ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 6385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase812() - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase812Actor final : public Actor, public FastAllocated, public FlowTestCase812ActorState { - #line 6390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase821() + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase821Actor final : public Actor, public FastAllocated, public FlowTestCase821ActorState { + #line 6399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase812Actor(UnitTestParameters const& params) - #line 6400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase821Actor(UnitTestParameters const& params) + #line 6409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase812ActorState(params) + FlowTestCase821ActorState(params) { - fdb_probe_actor_enter("flowTestCase812", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase821", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase812"); + this->lineage.setActorName("flowTestCase821"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase812", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase821", reinterpret_cast(this), -1); } void cancel() override @@ -6420,15 +6429,15 @@ class FlowTestCase812Actor final : public Actor, public FastAllocated flowTestCase812( UnitTestParameters const& params ) { - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase812Actor(params)); - #line 6427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase821( UnitTestParameters const& params ) { + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase821Actor(params)); + #line 6436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase812, "#flow/flow/perf/actor patterns") +ACTOR_TEST_CASE(flowTestCase821, "#flow/flow/perf/actor patterns") -#line 1120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template struct YAMRandom { @@ -6471,40 +6480,40 @@ struct YAMRandom { } }; - #line 6474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase1162() - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1162ActorState { - #line 6481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1171() + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1171ActorState { + #line 6490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1162ActorState(UnitTestParameters const& params) - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1171ActorState(UnitTestParameters const& params) + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params), - #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yamr(), - #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" it() - #line 6492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1162", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1171", reinterpret_cast(this)); } - ~FlowTestCase1162ActorState() + ~FlowTestCase1171ActorState() { - fdb_probe_actor_destroy("flowTestCase1162", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1171", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" it = 0; - #line 6507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -6517,20 +6526,20 @@ class FlowTestCase1162ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1162ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1171ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1162ActorState(); static_cast(this)->destroy(); return 0; } - #line 6530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1162ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1171ActorState(); static_cast(this)->destroy(); return 0; } + #line 6539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1171ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -6544,24 +6553,24 @@ class FlowTestCase1162ActorState { } int a_body1loopBody1(int loopDepth) { - #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!(it < 100000)) - #line 6549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yamr.randomOp(); - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = yield(); - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 6568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -6581,18 +6590,18 @@ class FlowTestCase1162ActorState { } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" it++; - #line 6586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" it++; - #line 6595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -6611,13 +6620,13 @@ class FlowTestCase1162ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1162Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1171Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1162Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1171Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1162", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1171", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -6627,12 +6636,12 @@ class FlowTestCase1162ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1162", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1171", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase1162Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1171Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1162", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1171", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -6642,12 +6651,12 @@ class FlowTestCase1162ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1162", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1171", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase1162Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1171Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1162", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1171", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -6657,42 +6666,42 @@ class FlowTestCase1162ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1162", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1171", reinterpret_cast(this), 0); } - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" YAMRandom> yamr; - #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int it; - #line 6669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1162() - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1162Actor final : public Actor, public ActorCallback< FlowTestCase1162Actor, 0, Void >, public FastAllocated, public FlowTestCase1162ActorState { - #line 6674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1171() + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1171Actor final : public Actor, public ActorCallback< FlowTestCase1171Actor, 0, Void >, public FastAllocated, public FlowTestCase1171ActorState { + #line 6683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase1162Actor, 0, Void >; - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1162Actor(UnitTestParameters const& params) - #line 6685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +friend struct ActorCallback< FlowTestCase1171Actor, 0, Void >; + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1171Actor(UnitTestParameters const& params) + #line 6694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase1162ActorState(params) + FlowTestCase1171ActorState(params) { - fdb_probe_actor_enter("flowTestCase1162", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1171", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1162"); + this->lineage.setActorName("flowTestCase1171"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1162", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1171", reinterpret_cast(this), -1); } void cancel() override @@ -6700,56 +6709,56 @@ friend struct ActorCallback< FlowTestCase1162Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase1162Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase1171Actor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -static Future flowTestCase1162( UnitTestParameters const& params ) { - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase1162Actor(params)); - #line 6713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase1171( UnitTestParameters const& params ) { + #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase1171Actor(params)); + #line 6722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1162, "/flow/flow/YieldedAsyncMap/randomized") +ACTOR_TEST_CASE(flowTestCase1171, "/flow/flow/YieldedAsyncMap/randomized") -#line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 6719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase1172() - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1172ActorState { - #line 6726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1181() + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1181ActorState { + #line 6735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1172ActorState(UnitTestParameters const& params) - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1181ActorState(UnitTestParameters const& params) + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params), - #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yamr(), - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" it() - #line 6737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1172", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1181", reinterpret_cast(this)); } - ~FlowTestCase1172ActorState() + ~FlowTestCase1181ActorState() { - fdb_probe_actor_destroy("flowTestCase1172", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1181", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" it = 0; - #line 6752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -6762,20 +6771,20 @@ class FlowTestCase1172ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1172ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1181ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1172ActorState(); static_cast(this)->destroy(); return 0; } - #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1172ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1181ActorState(); static_cast(this)->destroy(); return 0; } + #line 6784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1181ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -6789,24 +6798,24 @@ class FlowTestCase1172ActorState { } int a_body1loopBody1(int loopDepth) { - #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!(it < 100000)) - #line 6794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yamr.randomOp(); - #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = yield(); - #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 6813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -6826,18 +6835,18 @@ class FlowTestCase1172ActorState { } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" it++; - #line 6831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" it++; - #line 6840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -6856,13 +6865,13 @@ class FlowTestCase1172ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1172Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1181Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1172Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1181Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1172", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1181", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -6872,12 +6881,12 @@ class FlowTestCase1172ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1172", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1181", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase1172Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1181Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1172", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1181", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -6887,12 +6896,12 @@ class FlowTestCase1172ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1172", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1181", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase1172Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1181Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1172", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1181", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -6902,42 +6911,42 @@ class FlowTestCase1172ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1172", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1181", reinterpret_cast(this), 0); } - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" YAMRandom> yamr; - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int it; - #line 6914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1172() - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1172Actor final : public Actor, public ActorCallback< FlowTestCase1172Actor, 0, Void >, public FastAllocated, public FlowTestCase1172ActorState { - #line 6919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1181() + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1181Actor final : public Actor, public ActorCallback< FlowTestCase1181Actor, 0, Void >, public FastAllocated, public FlowTestCase1181ActorState { + #line 6928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase1172Actor, 0, Void >; - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1172Actor(UnitTestParameters const& params) - #line 6930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +friend struct ActorCallback< FlowTestCase1181Actor, 0, Void >; + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1181Actor(UnitTestParameters const& params) + #line 6939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase1172ActorState(params) + FlowTestCase1181ActorState(params) { - fdb_probe_actor_enter("flowTestCase1172", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1181", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1172"); + this->lineage.setActorName("flowTestCase1181"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1172", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1181", reinterpret_cast(this), -1); } void cancel() override @@ -6945,75 +6954,75 @@ friend struct ActorCallback< FlowTestCase1172Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase1172Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase1181Actor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -static Future flowTestCase1172( UnitTestParameters const& params ) { - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase1172Actor(params)); - #line 6958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase1181( UnitTestParameters const& params ) { + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase1181Actor(params)); + #line 6967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1172, "/flow/flow/AsyncMap/randomized") +ACTOR_TEST_CASE(flowTestCase1181, "/flow/flow/AsyncMap/randomized") -#line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 6964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase1182() - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1182ActorState { - #line 6971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1191() + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1191ActorState { + #line 6980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1182ActorState(UnitTestParameters const& params) - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1191ActorState(UnitTestParameters const& params) + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params), - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yam(), - #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y0(yam.onChange(1)) - #line 6982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 6991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1182", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1191", reinterpret_cast(this)); } - ~FlowTestCase1182ActorState() + ~FlowTestCase1191ActorState() { - fdb_probe_actor_destroy("flowTestCase1182", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1191", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yam.setUnconditional(1, 0); - #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y1 = yam.onChange(1); - #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y1a = yam.onChange(1); - #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y1b = yam.onChange(1); - #line 1189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yam.set(1, 1); - #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y2 = yam.onChange(1); - #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = reportErrors(y0, "Y0"); - #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7026,40 +7035,40 @@ class FlowTestCase1182ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1182ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1191ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(Void const& _,int loopDepth) { - #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_1 = reportErrors(y1, "Y1"); - #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_1 = reportErrors(y1, "Y1"); - #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -7078,13 +7087,13 @@ class FlowTestCase1182ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1182Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1191Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1182Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1191Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -7094,12 +7103,12 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase1182Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1191Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -7109,12 +7118,12 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase1182Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1191Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -7124,37 +7133,37 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 0); } int a_body1cont2(Void const& _,int loopDepth) { - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_2 = reportErrors(y1a, "Y1a"); - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 3; + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_2 = reportErrors(y1a, "Y1a"); - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 3; + #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -7173,13 +7182,13 @@ class FlowTestCase1182ActorState { } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1182Actor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1191Actor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1182Actor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1191Actor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -7189,12 +7198,12 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< FlowTestCase1182Actor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1191Actor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -7204,12 +7213,12 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< FlowTestCase1182Actor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1191Actor, 1, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -7219,37 +7228,37 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 1); } int a_body1cont3(Void const& _,int loopDepth) { - #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_3 = reportErrors(y1b, "Y1b"); - #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 4; + #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_3 = reportErrors(y1b, "Y1b"); - #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 4; + #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -7268,13 +7277,13 @@ class FlowTestCase1182ActorState { } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1182Actor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1191Actor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1182Actor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1191Actor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont2when1(value, 0); @@ -7284,12 +7293,12 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< FlowTestCase1182Actor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1191Actor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont2when1(std::move(value), 0); @@ -7299,12 +7308,12 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< FlowTestCase1182Actor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1191Actor, 2, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -7314,37 +7323,37 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 2); } int a_body1cont4(Void const& _,int loopDepth) { - #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_4 = reportErrors(timeout(y2, 5, Void()), "Y2"); - #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 5; + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4(Void && _,int loopDepth) { - #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_4 = reportErrors(timeout(y2, 5, Void()), "Y2"); - #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 5; + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -7363,13 +7372,13 @@ class FlowTestCase1182ActorState { } void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1182Actor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1191Actor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1182Actor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1191Actor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 3); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 3); a_exitChoose4(); try { a_body1cont3when1(value, 0); @@ -7379,12 +7388,12 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 3); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< FlowTestCase1182Actor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1191Actor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 3); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 3); a_exitChoose4(); try { a_body1cont3when1(std::move(value), 0); @@ -7394,12 +7403,12 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 3); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< FlowTestCase1182Actor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1191Actor, 3, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 3); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 3); a_exitChoose4(); try { a_body1Catch1(err, 0); @@ -7409,29 +7418,29 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 3); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 3); } int a_body1cont5(Void const& _,int loopDepth) { - #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1182ActorState(); static_cast(this)->destroy(); return 0; } - #line 7419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1182ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1191ActorState(); static_cast(this)->destroy(); return 0; } + #line 7428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1191ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont5(Void && _,int loopDepth) { - #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1182ActorState(); static_cast(this)->destroy(); return 0; } - #line 7431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1182ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1191ActorState(); static_cast(this)->destroy(); return 0; } + #line 7440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1191ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -7450,13 +7459,13 @@ class FlowTestCase1182ActorState { } void a_exitChoose5() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1182Actor, 4, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1191Actor, 4, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1182Actor, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1191Actor, 4, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 4); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 4); a_exitChoose5(); try { a_body1cont4when1(value, 0); @@ -7466,12 +7475,12 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 4); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< FlowTestCase1182Actor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1191Actor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 4); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 4); a_exitChoose5(); try { a_body1cont4when1(std::move(value), 0); @@ -7481,12 +7490,12 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 4); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< FlowTestCase1182Actor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1191Actor, 4, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), 4); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), 4); a_exitChoose5(); try { a_body1Catch1(err, 0); @@ -7496,54 +7505,54 @@ class FlowTestCase1182ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), 4); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), 4); } - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" YieldedAsyncMap yam; - #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future y0; - #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future y1; - #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future y1a; - #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future y1b; - #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future y2; - #line 7516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 7525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1182() - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1182Actor final : public Actor, public ActorCallback< FlowTestCase1182Actor, 0, Void >, public ActorCallback< FlowTestCase1182Actor, 1, Void >, public ActorCallback< FlowTestCase1182Actor, 2, Void >, public ActorCallback< FlowTestCase1182Actor, 3, Void >, public ActorCallback< FlowTestCase1182Actor, 4, Void >, public FastAllocated, public FlowTestCase1182ActorState { - #line 7521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1191() + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1191Actor final : public Actor, public ActorCallback< FlowTestCase1191Actor, 0, Void >, public ActorCallback< FlowTestCase1191Actor, 1, Void >, public ActorCallback< FlowTestCase1191Actor, 2, Void >, public ActorCallback< FlowTestCase1191Actor, 3, Void >, public ActorCallback< FlowTestCase1191Actor, 4, Void >, public FastAllocated, public FlowTestCase1191ActorState { + #line 7530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase1182Actor, 0, Void >; -friend struct ActorCallback< FlowTestCase1182Actor, 1, Void >; -friend struct ActorCallback< FlowTestCase1182Actor, 2, Void >; -friend struct ActorCallback< FlowTestCase1182Actor, 3, Void >; -friend struct ActorCallback< FlowTestCase1182Actor, 4, Void >; - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1182Actor(UnitTestParameters const& params) - #line 7536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +friend struct ActorCallback< FlowTestCase1191Actor, 0, Void >; +friend struct ActorCallback< FlowTestCase1191Actor, 1, Void >; +friend struct ActorCallback< FlowTestCase1191Actor, 2, Void >; +friend struct ActorCallback< FlowTestCase1191Actor, 3, Void >; +friend struct ActorCallback< FlowTestCase1191Actor, 4, Void >; + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1191Actor(UnitTestParameters const& params) + #line 7545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase1182ActorState(params) + FlowTestCase1191ActorState(params) { - fdb_probe_actor_enter("flowTestCase1182", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1191", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1182"); + this->lineage.setActorName("flowTestCase1191"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1182", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1191", reinterpret_cast(this), -1); } void cancel() override @@ -7551,87 +7560,87 @@ friend struct ActorCallback< FlowTestCase1182Actor, 4, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase1182Actor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< FlowTestCase1182Actor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< FlowTestCase1182Actor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< FlowTestCase1182Actor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< FlowTestCase1182Actor, 4, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase1191Actor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase1191Actor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< FlowTestCase1191Actor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< FlowTestCase1191Actor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< FlowTestCase1191Actor, 4, Void >*)0, actor_cancelled()); break; } } }; } - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -static Future flowTestCase1182( UnitTestParameters const& params ) { - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase1182Actor(params)); - #line 7568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase1191( UnitTestParameters const& params ) { + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase1191Actor(params)); + #line 7577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1182, "/flow/flow/YieldedAsyncMap/basic") +ACTOR_TEST_CASE(flowTestCase1191, "/flow/flow/YieldedAsyncMap/basic") -#line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 7574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 7583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase1203() - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1203ActorState { - #line 7581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1212() + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1212ActorState { + #line 7590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1203ActorState(UnitTestParameters const& params) - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1212ActorState(UnitTestParameters const& params) + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params), - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yam() - #line 7590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 7599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1203", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1212", reinterpret_cast(this)); } - ~FlowTestCase1203ActorState() + ~FlowTestCase1212ActorState() { - fdb_probe_actor_destroy("flowTestCase1203", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1212", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(yam.count(1) == 0); - #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y1 = yam.onChange(1); - #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y1a = yam.onChange(1); - #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y1b = yam.onChange(1); - #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(yam.count(1) == 1); - #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y1.cancel(); - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!y1a.isReady()); - #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y1a.cancel(); - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!y1b.isReady()); - #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(yam.count(1) == 1); - #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y1b.cancel(); - #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(y1b.getError().code() == error_code_actor_cancelled); - #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(yam.count(1) == 0); - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1203ActorState(); static_cast(this)->destroy(); return 0; } - #line 7631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1203ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1212ActorState(); static_cast(this)->destroy(); return 0; } + #line 7640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1212ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -7644,48 +7653,48 @@ class FlowTestCase1203ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1203ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1212ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" YieldedAsyncMap yam; - #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future y1; - #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future y1a; - #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future y1b; - #line 7663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 7672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1203() - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1203Actor final : public Actor, public FastAllocated, public FlowTestCase1203ActorState { - #line 7668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1212() + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1212Actor final : public Actor, public FastAllocated, public FlowTestCase1212ActorState { + #line 7677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1203Actor(UnitTestParameters const& params) - #line 7678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1212Actor(UnitTestParameters const& params) + #line 7687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase1203ActorState(params) + FlowTestCase1212ActorState(params) { - fdb_probe_actor_enter("flowTestCase1203", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1212", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1203"); + this->lineage.setActorName("flowTestCase1212"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1203", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1212", reinterpret_cast(this), -1); } void cancel() override @@ -7698,63 +7707,63 @@ class FlowTestCase1203Actor final : public Actor, public FastAllocated flowTestCase1203( UnitTestParameters const& params ) { - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase1203Actor(params)); - #line 7705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase1212( UnitTestParameters const& params ) { + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase1212Actor(params)); + #line 7714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1203, "/flow/flow/YieldedAsyncMap/cancel") +ACTOR_TEST_CASE(flowTestCase1212, "/flow/flow/YieldedAsyncMap/cancel") -#line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 7711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 7720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase1227() - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1227ActorState { - #line 7718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1236() + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1236ActorState { + #line 7727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1227ActorState(UnitTestParameters const& params) - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1236ActorState(UnitTestParameters const& params) + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params), - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" yam(), - #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y1(yam.onChange(1)), - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y2(yam.onChange(2)) - #line 7731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 7740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1227", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1236", reinterpret_cast(this)); } - ~FlowTestCase1227ActorState() + ~FlowTestCase1236ActorState() { - fdb_probe_actor_destroy("flowTestCase1227", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1236", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" auto* pyam = &yam; - #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" uncancellable(trigger( [pyam]() { printf("Triggered\n"); pyam->triggerAll(); }, delay(1))); - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = y1; - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 7752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 7761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 7757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -7767,40 +7776,40 @@ class FlowTestCase1227ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1227ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1236ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(Void const& _,int loopDepth) { - #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("Got y1\n"); - #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y2.cancel(); - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1227ActorState(); static_cast(this)->destroy(); return 0; } - #line 7784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1227ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1236ActorState(); static_cast(this)->destroy(); return 0; } + #line 7793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1236ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("Got y1\n"); - #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" y2.cancel(); - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1227ActorState(); static_cast(this)->destroy(); return 0; } - #line 7800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1227ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1236ActorState(); static_cast(this)->destroy(); return 0; } + #line 7809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1236ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -7819,13 +7828,13 @@ class FlowTestCase1227ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1227Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1236Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1227Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1236Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1227", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1236", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -7835,12 +7844,12 @@ class FlowTestCase1227ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1227", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1236", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase1227Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1236Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1227", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1236", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -7850,12 +7859,12 @@ class FlowTestCase1227ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1227", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1236", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase1227Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1236Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1227", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1236", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -7865,44 +7874,44 @@ class FlowTestCase1227ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1227", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1236", reinterpret_cast(this), 0); } - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" YieldedAsyncMap yam; - #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future y1; - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future y2; - #line 7879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 7888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1227() - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1227Actor final : public Actor, public ActorCallback< FlowTestCase1227Actor, 0, Void >, public FastAllocated, public FlowTestCase1227ActorState { - #line 7884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1236() + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1236Actor final : public Actor, public ActorCallback< FlowTestCase1236Actor, 0, Void >, public FastAllocated, public FlowTestCase1236ActorState { + #line 7893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase1227Actor, 0, Void >; - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1227Actor(UnitTestParameters const& params) - #line 7895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +friend struct ActorCallback< FlowTestCase1236Actor, 0, Void >; + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1236Actor(UnitTestParameters const& params) + #line 7904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase1227ActorState(params) + FlowTestCase1236ActorState(params) { - fdb_probe_actor_enter("flowTestCase1227", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1236", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1227"); + this->lineage.setActorName("flowTestCase1236"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1227", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1236", reinterpret_cast(this), -1); } void cancel() override @@ -7910,77 +7919,77 @@ friend struct ActorCallback< FlowTestCase1227Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase1227Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase1236Actor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -static Future flowTestCase1227( UnitTestParameters const& params ) { - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase1227Actor(params)); - #line 7923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase1236( UnitTestParameters const& params ) { + #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase1236Actor(params)); + #line 7932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1227, "/flow/flow/YieldedAsyncMap/cancel2") +ACTOR_TEST_CASE(flowTestCase1236, "/flow/flow/YieldedAsyncMap/cancel2") -#line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 7929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 7938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase1248() - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1248ActorState { - #line 7936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1257() + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1257ActorState { + #line 7945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1248ActorState(UnitTestParameters const& params) - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1257ActorState(UnitTestParameters const& params) + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 7943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 7952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1248", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1257", reinterpret_cast(this)); } - ~FlowTestCase1248ActorState() + ~FlowTestCase1257ActorState() { - fdb_probe_actor_destroy("flowTestCase1248", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1257", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" AsyncVar av; - #line 1250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future ch = av.onChange(); - #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!ch.isReady()); - #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" av.set(5); - #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(ch.isReady()); - #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(av.get() == 5); - #line 1256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ch = av.onChange(); - #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!ch.isReady()); - #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" av.set(6); - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(ch.isReady()); - #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(av.get() == 6); - #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1248ActorState(); static_cast(this)->destroy(); return 0; } - #line 7980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1248ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1257ActorState(); static_cast(this)->destroy(); return 0; } + #line 7989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1257ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -7993,40 +8002,40 @@ class FlowTestCase1248ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1248ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1257ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 8004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1248() - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1248Actor final : public Actor, public FastAllocated, public FlowTestCase1248ActorState { - #line 8009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1257() + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1257Actor final : public Actor, public FastAllocated, public FlowTestCase1257ActorState { + #line 8018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1248Actor(UnitTestParameters const& params) - #line 8019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1257Actor(UnitTestParameters const& params) + #line 8028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase1248ActorState(params) + FlowTestCase1257ActorState(params) { - fdb_probe_actor_enter("flowTestCase1248", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1257", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1248"); + this->lineage.setActorName("flowTestCase1257"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1248", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1257", reinterpret_cast(this), -1); } void cancel() override @@ -8039,31 +8048,31 @@ class FlowTestCase1248Actor final : public Actor, public FastAllocated flowTestCase1248( UnitTestParameters const& params ) { - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase1248Actor(params)); - #line 8046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase1257( UnitTestParameters const& params ) { + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase1257Actor(params)); + #line 8055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1248, "/flow/flow/AsyncVar/basic") +ACTOR_TEST_CASE(flowTestCase1257, "/flow/flow/AsyncVar/basic") -#line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 8052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via waitAfterCancel() - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class WaitAfterCancelActorState { - #line 8059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" WaitAfterCancelActorState(int* const& output) - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : output(output) - #line 8066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("waitAfterCancel", reinterpret_cast(this)); @@ -8076,20 +8085,20 @@ class WaitAfterCancelActorState { int a_body1(int loopDepth=0) { try { - #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" *output = 0; - #line 8081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" try { - #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = Never(); - #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 8087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8116,11 +8125,11 @@ class WaitAfterCancelActorState { } int a_body1cont1(int loopDepth) { - #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(false); - #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitAfterCancelActorState(); static_cast(this)->destroy(); return 0; } - #line 8123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitAfterCancelActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8131,16 +8140,16 @@ class WaitAfterCancelActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_1 = (*output = 1, Future(Void())); - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1Catch2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8314,14 +8323,14 @@ class WaitAfterCancelActorState { fdb_probe_actor_exit("waitAfterCancel", reinterpret_cast(this), 1); } - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int* output; - #line 8319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via waitAfterCancel() - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class WaitAfterCancelActor final : public Actor, public ActorCallback< WaitAfterCancelActor, 0, Void >, public ActorCallback< WaitAfterCancelActor, 1, Void >, public FastAllocated, public WaitAfterCancelActorState { - #line 8324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8331,9 +8340,9 @@ class WaitAfterCancelActor final : public Actor, public ActorCallback< Wai #pragma clang diagnostic pop friend struct ActorCallback< WaitAfterCancelActor, 0, Void >; friend struct ActorCallback< WaitAfterCancelActor, 1, Void >; - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" WaitAfterCancelActor(int* const& output) - #line 8336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), WaitAfterCancelActorState(output) { @@ -8358,58 +8367,58 @@ friend struct ActorCallback< WaitAfterCancelActor, 1, Void >; } }; } - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] static Future waitAfterCancel( int* const& output ) { - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new WaitAfterCancelActor(output)); - #line 8365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 8370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase1276() - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1276ActorState { - #line 8377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1285() + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1285ActorState { + #line 8386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1276ActorState(UnitTestParameters const& params) - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1285ActorState(UnitTestParameters const& params) + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 8384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1276", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1285", reinterpret_cast(this)); } - ~FlowTestCase1276ActorState() + ~FlowTestCase1285ActorState() { - fdb_probe_actor_destroy("flowTestCase1276", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1285", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int a = -1; - #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future f = waitAfterCancel(&a); - #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(a == 0); - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" f.cancel(); - #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(a == 1); - #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1276ActorState(); static_cast(this)->destroy(); return 0; } - #line 8409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1276ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1285ActorState(); static_cast(this)->destroy(); return 0; } + #line 8418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1285ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -8422,40 +8431,40 @@ class FlowTestCase1276ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1276ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1285ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 8433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1276() - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1276Actor final : public Actor, public FastAllocated, public FlowTestCase1276ActorState { - #line 8438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1285() + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1285Actor final : public Actor, public FastAllocated, public FlowTestCase1285ActorState { + #line 8447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1276Actor(UnitTestParameters const& params) - #line 8448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1285Actor(UnitTestParameters const& params) + #line 8457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase1276ActorState(params) + FlowTestCase1285ActorState(params) { - fdb_probe_actor_enter("flowTestCase1276", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1285", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1276"); + this->lineage.setActorName("flowTestCase1285"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1276", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1285", reinterpret_cast(this), -1); } void cancel() override @@ -8468,15 +8477,15 @@ class FlowTestCase1276Actor final : public Actor, public FastAllocated flowTestCase1276( UnitTestParameters const& params ) { - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase1276Actor(params)); - #line 8475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase1285( UnitTestParameters const& params ) { + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase1285Actor(params)); + #line 8484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1276, "/fdbrpc/flow/wait_expression_after_cancel") +ACTOR_TEST_CASE(flowTestCase1285, "/fdbrpc/flow/wait_expression_after_cancel") -#line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" // Tests for https://github.com/apple/foundationdb/issues/1226 @@ -8487,29 +8496,29 @@ class Foo1 { public: explicit Foo1(int x) : x(x) {} Future foo() { return fooActor(this); } - #line 8490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" [[nodiscard]] static Future fooActor( Foo1* const& self ); template friend class Foo1_FooActorActorState; -#line 1295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" private: int x; }; - #line 8499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" // This generated class is to be used only via fooActor() - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class Foo1_FooActorActorState { - #line 8505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Foo1_FooActorActorState(Foo1* const& self) - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : self(self) - #line 8512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("fooActor", reinterpret_cast(this)); @@ -8522,16 +8531,16 @@ class Foo1_FooActorActorState { int a_body1(int loopDepth=0) { try { - #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = Future(); - #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8552,9 +8561,9 @@ class Foo1_FooActorActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(self->x); this->~Foo1_FooActorActorState(); static_cast(this)->destroy(); return 0; } - #line 8557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(self->x); this->~Foo1_FooActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8564,9 +8573,9 @@ class Foo1_FooActorActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(self->x); this->~Foo1_FooActorActorState(); static_cast(this)->destroy(); return 0; } - #line 8569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(self->x); this->~Foo1_FooActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8637,14 +8646,14 @@ class Foo1_FooActorActorState { fdb_probe_actor_exit("fooActor", reinterpret_cast(this), 0); } - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Foo1* self; - #line 8642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via fooActor() - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class Foo1_FooActorActor final : public Actor, public ActorCallback< Foo1_FooActorActor, 0, Void >, public FastAllocated, public Foo1_FooActorActorState { - #line 8647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8653,9 +8662,9 @@ class Foo1_FooActorActor final : public Actor, public ActorCallback< Foo1_F void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Foo1_FooActorActor, 0, Void >; - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Foo1_FooActorActor(Foo1* const& self) - #line 8658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), Foo1_FooActorActorState(self) { @@ -8678,42 +8687,42 @@ friend struct ActorCallback< Foo1_FooActorActor, 0, Void >; } }; - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] Future Foo1::fooActor( Foo1* const& self ) { - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new Foo1_FooActorActor(self)); - #line 8685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class [[nodiscard]] Foo2 { public: explicit Foo2(int x) : x(x) {} Future foo() { return fooActor(this); } - #line 8694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" [[nodiscard]] static Future fooActor( Foo2* const& self ); template friend class Foo2_FooActorActorState; -#line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" private: int x; }; - #line 8703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" // This generated class is to be used only via fooActor() - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class Foo2_FooActorActorState { - #line 8709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Foo2_FooActorActorState(Foo2* const& self) - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : self(self) - #line 8716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("fooActor", reinterpret_cast(this)); @@ -8726,16 +8735,16 @@ class Foo2_FooActorActorState { int a_body1(int loopDepth=0) { try { - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = Future(); - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8756,9 +8765,9 @@ class Foo2_FooActorActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(self->x); this->~Foo2_FooActorActorState(); static_cast(this)->destroy(); return 0; } - #line 8761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(self->x); this->~Foo2_FooActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8768,9 +8777,9 @@ class Foo2_FooActorActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(self->x); this->~Foo2_FooActorActorState(); static_cast(this)->destroy(); return 0; } - #line 8773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(self->x); this->~Foo2_FooActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8841,14 +8850,14 @@ class Foo2_FooActorActorState { fdb_probe_actor_exit("fooActor", reinterpret_cast(this), 0); } - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Foo2* self; - #line 8846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via fooActor() - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class Foo2_FooActorActor final : public Actor, public ActorCallback< Foo2_FooActorActor, 0, Void >, public FastAllocated, public Foo2_FooActorActorState { - #line 8851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8857,9 +8866,9 @@ class Foo2_FooActorActor final : public Actor, public ActorCallback< Foo2_F void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Foo2_FooActorActor, 0, Void >; - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Foo2_FooActorActor(Foo2* const& self) - #line 8862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), Foo2_FooActorActorState(self) { @@ -8882,42 +8891,42 @@ friend struct ActorCallback< Foo2_FooActorActor, 0, Void >; } }; - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] Future Foo2::fooActor( Foo2* const& self ) { - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new Foo2_FooActorActor(self)); - #line 8889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class alignas(4) Foo3 { public: explicit Foo3(int x) : x(x) {} Future foo() { return fooActor(this); } - #line 8898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" [[nodiscard]] static Future fooActor( Foo3* const& self ); template friend class Foo3_FooActorActorState; -#line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" private: int x; }; - #line 8907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" // This generated class is to be used only via fooActor() - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class Foo3_FooActorActorState { - #line 8913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Foo3_FooActorActorState(Foo3* const& self) - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : self(self) - #line 8920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("fooActor", reinterpret_cast(this)); @@ -8930,16 +8939,16 @@ class Foo3_FooActorActorState { int a_body1(int loopDepth=0) { try { - #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = Future(); - #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8960,9 +8969,9 @@ class Foo3_FooActorActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(self->x); this->~Foo3_FooActorActorState(); static_cast(this)->destroy(); return 0; } - #line 8965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(self->x); this->~Foo3_FooActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8972,9 +8981,9 @@ class Foo3_FooActorActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(self->x); this->~Foo3_FooActorActorState(); static_cast(this)->destroy(); return 0; } - #line 8977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 8986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(self->x); this->~Foo3_FooActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9045,14 +9054,14 @@ class Foo3_FooActorActorState { fdb_probe_actor_exit("fooActor", reinterpret_cast(this), 0); } - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Foo3* self; - #line 9050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via fooActor() - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class Foo3_FooActorActor final : public Actor, public ActorCallback< Foo3_FooActorActor, 0, Void >, public FastAllocated, public Foo3_FooActorActorState { - #line 9055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9061,9 +9070,9 @@ class Foo3_FooActorActor final : public Actor, public ActorCallback< Foo3_F void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Foo3_FooActorActor, 0, Void >; - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Foo3_FooActorActor(Foo3* const& self) - #line 9066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), Foo3_FooActorActorState(self) { @@ -9086,14 +9095,14 @@ friend struct ActorCallback< Foo3_FooActorActor, 0, Void >; } }; - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] Future Foo3::fooActor( Foo3* const& self ) { - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new Foo3_FooActorActor(self)); - #line 9093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" struct Super {}; @@ -9101,29 +9110,29 @@ class Foo4 : Super { public: explicit Foo4(int x) : x(x) {} Future foo() { return fooActor(this); } - #line 9104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" [[nodiscard]] static Future fooActor( Foo4* const& self ); template friend class Foo4_FooActorActorState; -#line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" private: int x; }; - #line 9113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" // This generated class is to be used only via fooActor() - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class Foo4_FooActorActorState { - #line 9119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Foo4_FooActorActorState(Foo4* const& self) - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : self(self) - #line 9126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("fooActor", reinterpret_cast(this)); @@ -9136,16 +9145,16 @@ class Foo4_FooActorActorState { int a_body1(int loopDepth=0) { try { - #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = Future(); - #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9166,9 +9175,9 @@ class Foo4_FooActorActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(self->x); this->~Foo4_FooActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(self->x); this->~Foo4_FooActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9178,9 +9187,9 @@ class Foo4_FooActorActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(self->x); this->~Foo4_FooActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(self->x); this->~Foo4_FooActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9251,14 +9260,14 @@ class Foo4_FooActorActorState { fdb_probe_actor_exit("fooActor", reinterpret_cast(this), 0); } - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Foo4* self; - #line 9256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via fooActor() - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class Foo4_FooActorActor final : public Actor, public ActorCallback< Foo4_FooActorActor, 0, Void >, public FastAllocated, public Foo4_FooActorActorState { - #line 9261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9267,9 +9276,9 @@ class Foo4_FooActorActor final : public Actor, public ActorCallback< Foo4_F void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Foo4_FooActorActor, 0, Void >; - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Foo4_FooActorActor(Foo4* const& self) - #line 9272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), Foo4_FooActorActorState(self) { @@ -9292,44 +9301,44 @@ friend struct ActorCallback< Foo4_FooActorActor, 0, Void >; } }; - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] Future Foo4::fooActor( Foo4* const& self ) { - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new Foo4_FooActorActor(self)); - #line 9299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" struct Outer { class Foo5 : Super { public: explicit Foo5(int x) : x(x) {} Future foo() { return fooActor(this); } - #line 9309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" [[nodiscard]] static Future fooActor( Foo5* const& self ); template friend class Outer_Foo5_FooActorActorState; -#line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" private: int x; }; }; - #line 9319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" // This generated class is to be used only via fooActor() - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class Outer_Foo5_FooActorActorState { - #line 9325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Outer_Foo5_FooActorActorState(Outer::Foo5* const& self) - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : self(self) - #line 9332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("fooActor", reinterpret_cast(this)); @@ -9342,16 +9351,16 @@ class Outer_Foo5_FooActorActorState { int a_body1(int loopDepth=0) { try { - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = Future(); - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9372,9 +9381,9 @@ class Outer_Foo5_FooActorActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(self->x); this->~Outer_Foo5_FooActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(self->x); this->~Outer_Foo5_FooActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9384,9 +9393,9 @@ class Outer_Foo5_FooActorActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(self->x); this->~Outer_Foo5_FooActorActorState(); static_cast(this)->destroy(); return 0; } - #line 9389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(self->x); this->~Outer_Foo5_FooActorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9457,14 +9466,14 @@ class Outer_Foo5_FooActorActorState { fdb_probe_actor_exit("fooActor", reinterpret_cast(this), 0); } - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Outer::Foo5* self; - #line 9462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via fooActor() - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class Outer_Foo5_FooActorActor final : public Actor, public ActorCallback< Outer_Foo5_FooActorActor, 0, Void >, public FastAllocated, public Outer_Foo5_FooActorActorState { - #line 9467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9473,9 +9482,9 @@ class Outer_Foo5_FooActorActor final : public Actor, public ActorCallback< void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Outer_Foo5_FooActorActor, 0, Void >; - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Outer_Foo5_FooActorActor(Outer::Foo5* const& self) - #line 9478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), Outer_Foo5_FooActorActorState(self) { @@ -9498,69 +9507,69 @@ friend struct ActorCallback< Outer_Foo5_FooActorActor, 0, Void >; } }; - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] Future Outer::Foo5::fooActor( Outer::Foo5* const& self ) { - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new Outer_Foo5_FooActorActor(self)); - #line 9505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" // Meant to be run with -fsanitize=undefined - #line 9511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase1365() - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1365ActorState { - #line 9518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1374() + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1374ActorState { + #line 9527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1365ActorState(UnitTestParameters const& params) - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1374ActorState(UnitTestParameters const& params) + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 9525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1365", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1374", reinterpret_cast(this)); } - ~FlowTestCase1365ActorState() + ~FlowTestCase1374ActorState() { - fdb_probe_actor_destroy("flowTestCase1365", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1374", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" deterministicRandom()->randomInt(std::numeric_limits::min(), 0); - #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" deterministicRandom()->randomInt(0, std::numeric_limits::max()); - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" deterministicRandom()->randomInt(std::numeric_limits::min(), std::numeric_limits::max()); - #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(deterministicRandom()->randomInt(std::numeric_limits::min(), std::numeric_limits::min() + 1) == std::numeric_limits::min()); - #line 1371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(deterministicRandom()->randomInt(std::numeric_limits::max() - 1, std::numeric_limits::max()) == std::numeric_limits::max() - 1); - #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" deterministicRandom()->randomInt64(std::numeric_limits::min(), 0); - #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" deterministicRandom()->randomInt64(0, std::numeric_limits::max()); - #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" deterministicRandom()->randomInt64(std::numeric_limits::min(), std::numeric_limits::max()); - #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(deterministicRandom()->randomInt64(std::numeric_limits::min(), std::numeric_limits::min() + 1) == std::numeric_limits::min()); - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(deterministicRandom()->randomInt64(std::numeric_limits::max() - 1, std::numeric_limits::max()) == std::numeric_limits::max() - 1); - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1365ActorState(); static_cast(this)->destroy(); return 0; } - #line 9560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1365ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1374ActorState(); static_cast(this)->destroy(); return 0; } + #line 9569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1374ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -9573,40 +9582,40 @@ class FlowTestCase1365ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1365ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1374ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 9584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1365() - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1365Actor final : public Actor, public FastAllocated, public FlowTestCase1365ActorState { - #line 9589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1374() + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1374Actor final : public Actor, public FastAllocated, public FlowTestCase1374ActorState { + #line 9598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1365Actor(UnitTestParameters const& params) - #line 9599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1374Actor(UnitTestParameters const& params) + #line 9608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase1365ActorState(params) + FlowTestCase1374ActorState(params) { - fdb_probe_actor_enter("flowTestCase1365", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1374", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1365"); + this->lineage.setActorName("flowTestCase1374"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1365", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1374", reinterpret_cast(this), -1); } void cancel() override @@ -9619,15 +9628,15 @@ class FlowTestCase1365Actor final : public Actor, public FastAllocated flowTestCase1365( UnitTestParameters const& params ) { - #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase1365Actor(params)); - #line 9626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase1374( UnitTestParameters const& params ) { + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase1374Actor(params)); + #line 9635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1365, "/flow/DeterministicRandom/SignedOverflow") +ACTOR_TEST_CASE(flowTestCase1374, "/flow/DeterministicRandom/SignedOverflow") -#line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" struct Tracker { int copied; @@ -9653,20 +9662,20 @@ struct Tracker { } ~Tracker() = default; - #line 9656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" // This generated class is to be used only via listen() - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class ListenActorState { - #line 9662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ListenActorState(FutureStream const& stream) - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : stream(stream) - #line 9669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("listen", reinterpret_cast(this)); @@ -9679,16 +9688,16 @@ class ListenActorState { int a_body1(int loopDepth=0) { try { - #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FutureStream __when_expr_0 = stream; - #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9709,13 +9718,13 @@ class ListenActorState { } int a_body1cont1(Tracker const& movedTracker,int loopDepth) { - #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!movedTracker.moved); - #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(movedTracker.copied == 0); - #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ListenActorState(); static_cast(this)->destroy(); return 0; } - #line 9718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ListenActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9725,13 +9734,13 @@ class ListenActorState { } int a_body1cont1(Tracker && movedTracker,int loopDepth) { - #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!movedTracker.moved); - #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(movedTracker.copied == 0); - #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ListenActorState(); static_cast(this)->destroy(); return 0; } - #line 9734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ListenActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9802,14 +9811,14 @@ class ListenActorState { fdb_probe_actor_exit("listen", reinterpret_cast(this), 0); } - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FutureStream stream; - #line 9807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via listen() - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class ListenActor final : public Actor, public ActorSingleCallback< ListenActor, 0, Tracker >, public FastAllocated, public ListenActorState { - #line 9812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9818,9 +9827,9 @@ class ListenActor final : public Actor, public ActorSingleCallback< Listen void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorSingleCallback< ListenActor, 0, Tracker >; - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ListenActor(FutureStream const& stream) - #line 9823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), ListenActorState(stream) { @@ -9843,62 +9852,62 @@ friend struct ActorSingleCallback< ListenActor, 0, Tracker >; } }; - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] static Future listen( FutureStream const& stream ) { - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new ListenActor(stream)); - #line 9850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 1416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" }; - #line 9856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase1418() - #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1418ActorState { - #line 9863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1427() + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1427ActorState { + #line 9872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1418ActorState(UnitTestParameters const& params) - #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1427ActorState(UnitTestParameters const& params) + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params), - #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" stream(), - #line 1420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" listener() - #line 9874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 9883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1418", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1427", reinterpret_cast(this)); } - ~FlowTestCase1418ActorState() + ~FlowTestCase1427ActorState() { - fdb_probe_actor_destroy("flowTestCase1418", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1427", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { { - #line 1424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" listener = Tracker::listen(stream.getFuture()); - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" stream.send(Tracker{}); - #line 1426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = listener; - #line 1426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 9905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } } @@ -9912,8 +9921,8 @@ class FlowTestCase1418ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1418ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1427ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; @@ -9921,22 +9930,22 @@ class FlowTestCase1418ActorState { int a_body1cont1(int loopDepth) { { - #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" listener = Tracker::listen(stream.getFuture()); - #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Tracker namedTracker; - #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" stream.send(namedTracker); - #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_1 = listener; - #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 9943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 9948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } @@ -9968,13 +9977,13 @@ class FlowTestCase1418ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1418Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1427Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1418Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1427Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -9984,12 +9993,12 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase1418Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1427Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -9999,12 +10008,12 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase1418Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1427Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -10014,28 +10023,28 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 0); } int a_body1cont3(int loopDepth) { { - #line 1440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" stream.send(Tracker{}); - #line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" stream.send(Tracker{}); - #line 10027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FutureStream __when_expr_2 = stream.getFuture(); - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 10042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.pop(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 3; + #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 10047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } } @@ -10068,13 +10077,13 @@ class FlowTestCase1418ActorState { } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1418Actor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1427Actor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1418Actor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1427Actor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -10084,12 +10093,12 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< FlowTestCase1418Actor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1427Actor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -10099,12 +10108,12 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< FlowTestCase1418Actor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1427Actor, 1, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -10114,32 +10123,32 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 1); } int a_body1cont5(int loopDepth) { { - #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Tracker namedTracker1; - #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Tracker namedTracker2; - #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" stream.send(namedTracker1); - #line 1459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" stream.send(namedTracker2); - #line 10131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FutureStream __when_expr_4 = stream.getFuture(); - #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 10146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5when1(__when_expr_4.pop(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 5; + #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 10151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } } @@ -10149,16 +10158,16 @@ class FlowTestCase1418ActorState { int a_body1cont6(int loopDepth) { { - #line 1448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FutureStream __when_expr_3 = stream.getFuture(); - #line 1448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 10165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.pop(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 1448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 4; + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 10170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } @@ -10166,20 +10175,20 @@ class FlowTestCase1418ActorState { } int a_body1cont7(int loopDepth) { - #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!movedTracker.moved); - #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(movedTracker.copied == 0); - #line 10173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1cont6(loopDepth); return loopDepth; } int a_body1cont3when1(Tracker const& __movedTracker,int loopDepth) { - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" movedTracker = __movedTracker; - #line 10182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1cont7(loopDepth); return loopDepth; @@ -10193,13 +10202,13 @@ class FlowTestCase1418ActorState { } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorSingleCallback< FlowTestCase1418Actor, 2, Tracker >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorSingleCallback< FlowTestCase1427Actor, 2, Tracker >::remove(); } - void a_callback_fire(ActorSingleCallback< FlowTestCase1418Actor, 2, Tracker >*,Tracker const& value) + void a_callback_fire(ActorSingleCallback< FlowTestCase1427Actor, 2, Tracker >*,Tracker const& value) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont3when1(value, 0); @@ -10209,12 +10218,12 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 2); } - void a_callback_fire(ActorSingleCallback< FlowTestCase1418Actor, 2, Tracker >*,Tracker && value) + void a_callback_fire(ActorSingleCallback< FlowTestCase1427Actor, 2, Tracker >*,Tracker && value) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont3when1(std::move(value), 0); @@ -10224,12 +10233,12 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 2); } - void a_callback_error(ActorSingleCallback< FlowTestCase1418Actor, 2, Tracker >*,Error err) + void a_callback_error(ActorSingleCallback< FlowTestCase1427Actor, 2, Tracker >*,Error err) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -10239,7 +10248,7 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 2); } int a_body1cont9(int loopDepth) @@ -10250,22 +10259,22 @@ class FlowTestCase1418ActorState { } int a_body1cont10(Tracker const& movedTracker,int loopDepth) { - #line 1449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!movedTracker.moved); - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(movedTracker.copied == 0); - #line 10257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1cont9(loopDepth); return loopDepth; } int a_body1cont10(Tracker && movedTracker,int loopDepth) { - #line 1449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!movedTracker.moved); - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(movedTracker.copied == 0); - #line 10268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1cont9(loopDepth); return loopDepth; @@ -10284,13 +10293,13 @@ class FlowTestCase1418ActorState { } void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorSingleCallback< FlowTestCase1418Actor, 3, Tracker >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorSingleCallback< FlowTestCase1427Actor, 3, Tracker >::remove(); } - void a_callback_fire(ActorSingleCallback< FlowTestCase1418Actor, 3, Tracker >*,Tracker const& value) + void a_callback_fire(ActorSingleCallback< FlowTestCase1427Actor, 3, Tracker >*,Tracker const& value) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 3); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 3); a_exitChoose4(); try { a_body1cont6when1(value, 0); @@ -10300,12 +10309,12 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 3); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 3); } - void a_callback_fire(ActorSingleCallback< FlowTestCase1418Actor, 3, Tracker >*,Tracker && value) + void a_callback_fire(ActorSingleCallback< FlowTestCase1427Actor, 3, Tracker >*,Tracker && value) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 3); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 3); a_exitChoose4(); try { a_body1cont6when1(std::move(value), 0); @@ -10315,12 +10324,12 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 3); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 3); } - void a_callback_error(ActorSingleCallback< FlowTestCase1418Actor, 3, Tracker >*,Error err) + void a_callback_error(ActorSingleCallback< FlowTestCase1427Actor, 3, Tracker >*,Error err) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 3); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 3); a_exitChoose4(); try { a_body1Catch1(err, 0); @@ -10330,17 +10339,17 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 3); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 3); } int a_body1cont11(int loopDepth) { - #line 1474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1418ActorState(); static_cast(this)->destroy(); return 0; } - #line 10340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1418ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1427ActorState(); static_cast(this)->destroy(); return 0; } + #line 10349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1427ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -10348,16 +10357,16 @@ class FlowTestCase1418ActorState { int a_body1cont12(int loopDepth) { { - #line 1467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FutureStream __when_expr_5 = stream.getFuture(); - #line 1467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 10364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont12when1(__when_expr_5.pop(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 1467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 6; + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 10369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } @@ -10365,20 +10374,20 @@ class FlowTestCase1418ActorState { } int a_body1cont13(int loopDepth) { - #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!copiedTracker.moved); - #line 1464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(copiedTracker.copied == 1); - #line 10372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1cont12(loopDepth); return loopDepth; } int a_body1cont5when1(Tracker const& __copiedTracker,int loopDepth) { - #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" copiedTracker = __copiedTracker; - #line 10381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1cont13(loopDepth); return loopDepth; @@ -10392,13 +10401,13 @@ class FlowTestCase1418ActorState { } void a_exitChoose5() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorSingleCallback< FlowTestCase1418Actor, 4, Tracker >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorSingleCallback< FlowTestCase1427Actor, 4, Tracker >::remove(); } - void a_callback_fire(ActorSingleCallback< FlowTestCase1418Actor, 4, Tracker >*,Tracker const& value) + void a_callback_fire(ActorSingleCallback< FlowTestCase1427Actor, 4, Tracker >*,Tracker const& value) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 4); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 4); a_exitChoose5(); try { a_body1cont5when1(value, 0); @@ -10408,12 +10417,12 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 4); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 4); } - void a_callback_fire(ActorSingleCallback< FlowTestCase1418Actor, 4, Tracker >*,Tracker && value) + void a_callback_fire(ActorSingleCallback< FlowTestCase1427Actor, 4, Tracker >*,Tracker && value) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 4); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 4); a_exitChoose5(); try { a_body1cont5when1(std::move(value), 0); @@ -10423,12 +10432,12 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 4); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 4); } - void a_callback_error(ActorSingleCallback< FlowTestCase1418Actor, 4, Tracker >*,Error err) + void a_callback_error(ActorSingleCallback< FlowTestCase1427Actor, 4, Tracker >*,Error err) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 4); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 4); a_exitChoose5(); try { a_body1Catch1(err, 0); @@ -10438,7 +10447,7 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 4); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 4); } int a_body1cont12cont1(int loopDepth) @@ -10449,22 +10458,22 @@ class FlowTestCase1418ActorState { } int a_body1cont12cont2(Tracker const& copiedTracker,int loopDepth) { - #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!copiedTracker.moved); - #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(copiedTracker.copied == 1); - #line 10456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1cont12cont1(loopDepth); return loopDepth; } int a_body1cont12cont2(Tracker && copiedTracker,int loopDepth) { - #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!copiedTracker.moved); - #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(copiedTracker.copied == 1); - #line 10467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1cont12cont1(loopDepth); return loopDepth; @@ -10483,13 +10492,13 @@ class FlowTestCase1418ActorState { } void a_exitChoose6() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorSingleCallback< FlowTestCase1418Actor, 5, Tracker >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorSingleCallback< FlowTestCase1427Actor, 5, Tracker >::remove(); } - void a_callback_fire(ActorSingleCallback< FlowTestCase1418Actor, 5, Tracker >*,Tracker const& value) + void a_callback_fire(ActorSingleCallback< FlowTestCase1427Actor, 5, Tracker >*,Tracker const& value) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 5); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 5); a_exitChoose6(); try { a_body1cont12when1(value, 0); @@ -10499,12 +10508,12 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 5); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 5); } - void a_callback_fire(ActorSingleCallback< FlowTestCase1418Actor, 5, Tracker >*,Tracker && value) + void a_callback_fire(ActorSingleCallback< FlowTestCase1427Actor, 5, Tracker >*,Tracker && value) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 5); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 5); a_exitChoose6(); try { a_body1cont12when1(std::move(value), 0); @@ -10514,12 +10523,12 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 5); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 5); } - void a_callback_error(ActorSingleCallback< FlowTestCase1418Actor, 5, Tracker >*,Error err) + void a_callback_error(ActorSingleCallback< FlowTestCase1427Actor, 5, Tracker >*,Error err) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), 5); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), 5); a_exitChoose6(); try { a_body1Catch1(err, 0); @@ -10529,51 +10538,51 @@ class FlowTestCase1418ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), 5); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), 5); } - #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" PromiseStream stream; - #line 1420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Future listener; - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Tracker movedTracker; - #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Tracker copiedTracker; - #line 10545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1418() - #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1418Actor final : public Actor, public ActorCallback< FlowTestCase1418Actor, 0, Void >, public ActorCallback< FlowTestCase1418Actor, 1, Void >, public ActorSingleCallback< FlowTestCase1418Actor, 2, Tracker >, public ActorSingleCallback< FlowTestCase1418Actor, 3, Tracker >, public ActorSingleCallback< FlowTestCase1418Actor, 4, Tracker >, public ActorSingleCallback< FlowTestCase1418Actor, 5, Tracker >, public FastAllocated, public FlowTestCase1418ActorState { - #line 10550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1427() + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1427Actor final : public Actor, public ActorCallback< FlowTestCase1427Actor, 0, Void >, public ActorCallback< FlowTestCase1427Actor, 1, Void >, public ActorSingleCallback< FlowTestCase1427Actor, 2, Tracker >, public ActorSingleCallback< FlowTestCase1427Actor, 3, Tracker >, public ActorSingleCallback< FlowTestCase1427Actor, 4, Tracker >, public ActorSingleCallback< FlowTestCase1427Actor, 5, Tracker >, public FastAllocated, public FlowTestCase1427ActorState { + #line 10559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase1418Actor, 0, Void >; -friend struct ActorCallback< FlowTestCase1418Actor, 1, Void >; -friend struct ActorSingleCallback< FlowTestCase1418Actor, 2, Tracker >; -friend struct ActorSingleCallback< FlowTestCase1418Actor, 3, Tracker >; -friend struct ActorSingleCallback< FlowTestCase1418Actor, 4, Tracker >; -friend struct ActorSingleCallback< FlowTestCase1418Actor, 5, Tracker >; - #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1418Actor(UnitTestParameters const& params) - #line 10566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +friend struct ActorCallback< FlowTestCase1427Actor, 0, Void >; +friend struct ActorCallback< FlowTestCase1427Actor, 1, Void >; +friend struct ActorSingleCallback< FlowTestCase1427Actor, 2, Tracker >; +friend struct ActorSingleCallback< FlowTestCase1427Actor, 3, Tracker >; +friend struct ActorSingleCallback< FlowTestCase1427Actor, 4, Tracker >; +friend struct ActorSingleCallback< FlowTestCase1427Actor, 5, Tracker >; + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1427Actor(UnitTestParameters const& params) + #line 10575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase1418ActorState(params) + FlowTestCase1427ActorState(params) { - fdb_probe_actor_enter("flowTestCase1418", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1427", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1418"); + this->lineage.setActorName("flowTestCase1427"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1418", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1427", reinterpret_cast(this), -1); } void cancel() override @@ -10581,68 +10590,68 @@ friend struct ActorSingleCallback< FlowTestCase1418Actor, 5, Tracker >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase1418Actor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< FlowTestCase1418Actor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorSingleCallback< FlowTestCase1418Actor, 2, Tracker >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorSingleCallback< FlowTestCase1418Actor, 3, Tracker >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorSingleCallback< FlowTestCase1418Actor, 4, Tracker >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorSingleCallback< FlowTestCase1418Actor, 5, Tracker >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase1427Actor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase1427Actor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorSingleCallback< FlowTestCase1427Actor, 2, Tracker >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorSingleCallback< FlowTestCase1427Actor, 3, Tracker >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorSingleCallback< FlowTestCase1427Actor, 4, Tracker >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorSingleCallback< FlowTestCase1427Actor, 5, Tracker >*)0, actor_cancelled()); break; } } }; } - #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -static Future flowTestCase1418( UnitTestParameters const& params ) { - #line 1418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase1418Actor(params)); - #line 10599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase1427( UnitTestParameters const& params ) { + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase1427Actor(params)); + #line 10608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1418, "/flow/flow/PromiseStream/move") +ACTOR_TEST_CASE(flowTestCase1427, "/flow/flow/PromiseStream/move") -#line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 10605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase1477() - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1477ActorState { - #line 10612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1486() + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1486ActorState { + #line 10621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1477ActorState(UnitTestParameters const& params) - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1486ActorState(UnitTestParameters const& params) + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params) - #line 10619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1477", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1486", reinterpret_cast(this)); } - ~FlowTestCase1477ActorState() + ~FlowTestCase1486ActorState() { - fdb_probe_actor_destroy("flowTestCase1477", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1486", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" PromiseStream stream; - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" stream.send(Tracker{}); - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FutureStream __when_expr_0 = stream.getFuture(); - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 10640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 10649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.pop(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 10654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -10655,48 +10664,48 @@ class FlowTestCase1477ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1477ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1486ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(Tracker const& tracker,int loopDepth) { - #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Tracker movedTracker = std::move(tracker); - #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(tracker.moved); - #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!movedTracker.moved); - #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(movedTracker.copied == 0); - #line 1485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1477ActorState(); static_cast(this)->destroy(); return 0; } - #line 10676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1477ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1486ActorState(); static_cast(this)->destroy(); return 0; } + #line 10685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1486ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont1(Tracker && tracker,int loopDepth) { - #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Tracker movedTracker = std::move(tracker); - #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(tracker.moved); - #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(!movedTracker.moved); - #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(movedTracker.copied == 0); - #line 1485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1477ActorState(); static_cast(this)->destroy(); return 0; } - #line 10696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1477ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1486ActorState(); static_cast(this)->destroy(); return 0; } + #line 10705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1486ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -10715,13 +10724,13 @@ class FlowTestCase1477ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorSingleCallback< FlowTestCase1477Actor, 0, Tracker >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorSingleCallback< FlowTestCase1486Actor, 0, Tracker >::remove(); } - void a_callback_fire(ActorSingleCallback< FlowTestCase1477Actor, 0, Tracker >*,Tracker const& value) + void a_callback_fire(ActorSingleCallback< FlowTestCase1486Actor, 0, Tracker >*,Tracker const& value) { - fdb_probe_actor_enter("flowTestCase1477", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1486", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -10731,12 +10740,12 @@ class FlowTestCase1477ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1477", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1486", reinterpret_cast(this), 0); } - void a_callback_fire(ActorSingleCallback< FlowTestCase1477Actor, 0, Tracker >*,Tracker && value) + void a_callback_fire(ActorSingleCallback< FlowTestCase1486Actor, 0, Tracker >*,Tracker && value) { - fdb_probe_actor_enter("flowTestCase1477", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1486", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -10746,12 +10755,12 @@ class FlowTestCase1477ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1477", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1486", reinterpret_cast(this), 0); } - void a_callback_error(ActorSingleCallback< FlowTestCase1477Actor, 0, Tracker >*,Error err) + void a_callback_error(ActorSingleCallback< FlowTestCase1486Actor, 0, Tracker >*,Error err) { - fdb_probe_actor_enter("flowTestCase1477", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1486", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -10761,38 +10770,38 @@ class FlowTestCase1477ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1477", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1486", reinterpret_cast(this), 0); } - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 10769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1477() - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1477Actor final : public Actor, public ActorSingleCallback< FlowTestCase1477Actor, 0, Tracker >, public FastAllocated, public FlowTestCase1477ActorState { - #line 10774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1486() + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1486Actor final : public Actor, public ActorSingleCallback< FlowTestCase1486Actor, 0, Tracker >, public FastAllocated, public FlowTestCase1486ActorState { + #line 10783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorSingleCallback< FlowTestCase1477Actor, 0, Tracker >; - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1477Actor(UnitTestParameters const& params) - #line 10785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +friend struct ActorSingleCallback< FlowTestCase1486Actor, 0, Tracker >; + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1486Actor(UnitTestParameters const& params) + #line 10794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase1477ActorState(params) + FlowTestCase1486ActorState(params) { - fdb_probe_actor_enter("flowTestCase1477", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1486", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1477"); + this->lineage.setActorName("flowTestCase1486"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1477", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1486", reinterpret_cast(this), -1); } void cancel() override @@ -10800,47 +10809,47 @@ friend struct ActorSingleCallback< FlowTestCase1477Actor, 0, Tracker >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorSingleCallback< FlowTestCase1477Actor, 0, Tracker >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorSingleCallback< FlowTestCase1486Actor, 0, Tracker >*)0, actor_cancelled()); break; } } }; } - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -static Future flowTestCase1477( UnitTestParameters const& params ) { - #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase1477Actor(params)); - #line 10813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase1486( UnitTestParameters const& params ) { + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase1486Actor(params)); + #line 10822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1477, "/flow/flow/PromiseStream/move2") +ACTOR_TEST_CASE(flowTestCase1486, "/flow/flow/PromiseStream/move2") -#line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" constexpr double mutexTestDelay = 0.00001; - #line 10821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { // This generated class is to be used only via mutexTest() - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" template - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class MutexTestActorState { - #line 10828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" MutexTestActorState(int const& id,FlowMutex* const& mutex,int const& n,bool const& allowError,bool* const& verbose) - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : id(id), - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" mutex(mutex), - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" n(n), - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" allowError(allowError), - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" verbose(verbose) - #line 10843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { fdb_probe_actor_create("mutexTest", reinterpret_cast(this)); @@ -10853,9 +10862,9 @@ class MutexTestActorState { int a_body1(int loopDepth=0) { try { - #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ; - #line 10858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -10876,17 +10885,17 @@ class MutexTestActorState { } int a_body1cont1(int loopDepth) { - #line 1534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (*verbose) - #line 10881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("%d Returning\n", id); - #line 10885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~MutexTestActorState(); static_cast(this)->destroy(); return 0; } - #line 10889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~MutexTestActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -10903,32 +10912,32 @@ class MutexTestActorState { } int a_body1loopBody1(int loopDepth) { - #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!(n-- > 0)) - #line 10908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" d = deterministicRandom()->random01() * mutexTestDelay; - #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (*verbose) - #line 10916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("%d:%d wait %f while unlocked\n", id, n, d); - #line 10920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = delay(d); - #line 1496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 10926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -10948,48 +10957,48 @@ class MutexTestActorState { } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (*verbose) - #line 10953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("%d:%d locking\n", id, n); - #line 10957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_1 = mutex->take(); - #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 10963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 1498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (*verbose) - #line 10977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("%d:%d locking\n", id, n); - #line 10981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_1 = mutex->take(); - #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 10987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 10996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 10992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -11059,43 +11068,43 @@ class MutexTestActorState { } int a_body1loopBody1cont4(int loopDepth) { - #line 1502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (*verbose) - #line 11064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("%d:%d locked\n", id, n); - #line 11068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" d = deterministicRandom()->random01() * mutexTestDelay; - #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (*verbose) - #line 11074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("%d:%d wait %f while locked\n", id, n, d); - #line 11078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_2 = delay(d); - #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 11084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont4when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1when1(FlowMutex::Lock const& __lock,int loopDepth) { - #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" lock = __lock; - #line 11098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1loopBody1cont4(loopDepth); return loopDepth; @@ -11160,51 +11169,51 @@ class MutexTestActorState { } int a_body1loopBody1cont6(Void const& _,int loopDepth) { - #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (n == 0 && allowError) - #line 11165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (deterministicRandom()->coinflip()) - #line 11169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (*verbose) - #line 11173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("%d:%d sending error\n", id, n); - #line 11177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" lock.error(end_of_stream()); - #line 11181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } else { - #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (*verbose) - #line 11187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("%d:%d dropping promise, returning without unlock\n", id, n); - #line 11191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } } } else { - #line 1527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (*verbose) - #line 11199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("%d:%d unlocking\n", id, n); - #line 11203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" lock.release(); - #line 11207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } if (loopDepth == 0) return a_body1loopHead1(0); @@ -11212,51 +11221,51 @@ class MutexTestActorState { } int a_body1loopBody1cont6(Void && _,int loopDepth) { - #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (n == 0 && allowError) - #line 11217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (deterministicRandom()->coinflip()) - #line 11221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (*verbose) - #line 11225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("%d:%d sending error\n", id, n); - #line 11229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" lock.error(end_of_stream()); - #line 11233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } else { - #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (*verbose) - #line 11239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("%d:%d dropping promise, returning without unlock\n", id, n); - #line 11243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } } } else { - #line 1527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (*verbose) - #line 11251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("%d:%d unlocking\n", id, n); - #line 11255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" lock.release(); - #line 11259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } if (loopDepth == 0) return a_body1loopHead1(0); @@ -11325,26 +11334,26 @@ class MutexTestActorState { fdb_probe_actor_exit("mutexTest", reinterpret_cast(this), 2); } - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int id; - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FlowMutex* mutex; - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int n; - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" bool allowError; - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" bool* verbose; - #line 1492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - double d; #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + double d; + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FlowMutex::Lock lock; - #line 11342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; // This generated class is to be used only via mutexTest() - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" class MutexTestActor final : public Actor, public ActorCallback< MutexTestActor, 0, Void >, public ActorCallback< MutexTestActor, 1, FlowMutex::Lock >, public ActorCallback< MutexTestActor, 2, Void >, public FastAllocated, public MutexTestActorState { - #line 11347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -11355,9 +11364,9 @@ class MutexTestActor final : public Actor, public ActorCallback< MutexTest friend struct ActorCallback< MutexTestActor, 0, Void >; friend struct ActorCallback< MutexTestActor, 1, FlowMutex::Lock >; friend struct ActorCallback< MutexTestActor, 2, Void >; - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" MutexTestActor(int const& id,FlowMutex* const& mutex,int const& n,bool const& allowError,bool* const& verbose) - #line 11360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), MutexTestActorState(id, mutex, n, allowError, verbose) { @@ -11383,54 +11392,54 @@ friend struct ActorCallback< MutexTestActor, 2, Void >; } }; } - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" [[nodiscard]] Future mutexTest( int const& id, FlowMutex* const& mutex, int const& n, bool const& allowError, bool* const& verbose ) { - #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" return Future(new MutexTestActor(id, mutex, n, allowError, verbose)); - #line 11390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -#line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 11395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase1540() - #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -template - #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1540ActorState { - #line 11402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1549() + #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +template + #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1549ActorState { + #line 11411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1540ActorState(UnitTestParameters const& params) - #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1549ActorState(UnitTestParameters const& params) + #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" : params(params), - #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" count(100000), - #line 1544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" verboseSetting(false), - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" verboseTestIteration(-1) - #line 11415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase1540", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase1549", reinterpret_cast(this)); } - ~FlowTestCase1540ActorState() + ~FlowTestCase1549ActorState() { - fdb_probe_actor_destroy("flowTestCase1540", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase1549", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { try { - #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" verbose = verboseSetting || count == verboseTestIteration; - #line 1551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ; - #line 11433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -11449,20 +11458,20 @@ class FlowTestCase1540ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase1540ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase1549ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1540ActorState(); static_cast(this)->destroy(); return 0; } - #line 11462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase1540ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 1616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase1549ActorState(); static_cast(this)->destroy(); return 0; } + #line 11471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase1549ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -11470,11 +11479,11 @@ class FlowTestCase1540ActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 1603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("Error at count=%d\n", count + 1); - #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(false); - #line 11477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); } catch (Error& error) { @@ -11500,54 +11509,54 @@ class FlowTestCase1540ActorState { } int a_body1loopBody1(int loopDepth) { - #line 1551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!(--count > 0)) - #line 11505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (count % 1000 == 0) - #line 11511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("%d tests left\n", count); - #line 11515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" mutex = FlowMutex(); - #line 1557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" tests = std::vector>(); - #line 1559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" allowErrors = deterministicRandom()->coinflip(); - #line 1560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (verbose) - #line 11525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("\nTesting allowErrors=%d\n", allowErrors); - #line 11529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" error = Optional(); - #line 11533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" try { - #line 1567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" for(int i = 0;i < 10;++i) { - #line 1568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" tests.push_back(mutexTest(i, &mutex, 10, allowErrors, &verbose)); - #line 11539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_0 = waitForAll(tests); - #line 1570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 11554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 1579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 11559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -11573,9 +11582,9 @@ class FlowTestCase1540ActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ASSERT(error.present() == allowErrors); - #line 11578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -11583,29 +11592,29 @@ class FlowTestCase1540ActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 1579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (verbose) - #line 11588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("Caught error %s\n", e.what()); - #line 11592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" error = e; - #line 1586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" i = int(); - #line 1587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (verbose) - #line 11600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("Waiting for completions. Future end states:\n"); - #line 11604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" i = 0; - #line 11608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = a_body1loopBody1Catch1loopHead1(loopDepth); } catch (Error& error) { @@ -11618,28 +11627,28 @@ class FlowTestCase1540ActorState { } int a_body1loopBody1cont5(Void const& _,int loopDepth) { - #line 1572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (allowErrors) - #line 11623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (verbose) - #line 11627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("Final wait in case error was injected by the last actor to finish\n"); - #line 11631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_1 = success(mutex.take()); - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 11646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 11651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } else @@ -11651,28 +11660,28 @@ class FlowTestCase1540ActorState { } int a_body1loopBody1cont5(Void && _,int loopDepth) { - #line 1572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (allowErrors) - #line 11656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (verbose) - #line 11660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf("Final wait in case error was injected by the last actor to finish\n"); - #line 11664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture __when_expr_1 = success(mutex.take()); - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 11670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 11679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont5when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 11675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 11684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; } else @@ -11696,13 +11705,13 @@ class FlowTestCase1540ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1540Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1549Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1540Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1549Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1540", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1549", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -11712,12 +11721,12 @@ class FlowTestCase1540ActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1540", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1549", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase1540Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1549Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1540", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1549", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -11727,12 +11736,12 @@ class FlowTestCase1540ActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1540", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1549", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase1540Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1549Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1540", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase1549", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1Catch1(err, 0); @@ -11742,7 +11751,7 @@ class FlowTestCase1540ActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1540", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase1549", reinterpret_cast(this), 0); } int a_body1loopBody1cont7(int loopDepth) @@ -11777,13 +11786,13 @@ class FlowTestCase1540ActorState { } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1540Actor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1549Actor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1540Actor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase1549Actor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase1540", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase1549", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1cont5when1(value, 0); @@ -11793,12 +11802,12 @@ class FlowTestCase1540ActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1540", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase1549", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< FlowTestCase1540Actor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase1549Actor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase1540", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase1549", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1cont5when1(std::move(value), 0); @@ -11808,12 +11817,12 @@ class FlowTestCase1540ActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1540", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase1549", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< FlowTestCase1540Actor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1549Actor, 1, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase1540", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase1549", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1Catch1(err, 0); @@ -11823,7 +11832,7 @@ class FlowTestCase1540ActorState { } catch (...) { a_body1loopBody1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1540", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase1549", reinterpret_cast(this), 1); } int a_body1loopBody1cont10(int loopDepth) @@ -11854,22 +11863,22 @@ class FlowTestCase1540ActorState { } int a_body1loopBody1Catch1loopBody1(int loopDepth) { - #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (!(i < tests.size())) - #line 11859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { return a_body1loopBody1Catch1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" StrictFuture> __when_expr_2 = errorOr(tests[i]); - #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 11867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 2)); + #line 11876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1Catch1loopBody1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 11872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + static_cast(this)->actor_wait_state = 3; + #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 11881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -11889,34 +11898,34 @@ class FlowTestCase1540ActorState { } int a_body1loopBody1Catch1loopBody1cont1(ErrorOr const& f,int loopDepth) { - #line 1592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (verbose) - #line 11894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf(" %d: %s\n", i, f.isError() ? f.getError().what() : "done"); - #line 11898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ++i; - #line 11902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1Catch1loopHead1(0); return loopDepth; } int a_body1loopBody1Catch1loopBody1cont1(ErrorOr && f,int loopDepth) { - #line 1592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" if (verbose) - #line 11911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" { - #line 1593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" printf(" %d: %s\n", i, f.isError() ? f.getError().what() : "done"); - #line 11915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } - #line 1590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" ++i; - #line 11919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 11928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1Catch1loopHead1(0); return loopDepth; @@ -11935,13 +11944,13 @@ class FlowTestCase1540ActorState { } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase1540Actor, 2, ErrorOr >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase1549Actor, 2, ErrorOr >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase1540Actor, 2, ErrorOr >*,ErrorOr const& value) + void a_callback_fire(ActorCallback< FlowTestCase1549Actor, 2, ErrorOr >*,ErrorOr const& value) { - fdb_probe_actor_enter("flowTestCase1540", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase1549", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1loopBody1Catch1loopBody1when1(value, 0); @@ -11951,12 +11960,12 @@ class FlowTestCase1540ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1540", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase1549", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< FlowTestCase1540Actor, 2, ErrorOr >*,ErrorOr && value) + void a_callback_fire(ActorCallback< FlowTestCase1549Actor, 2, ErrorOr >*,ErrorOr && value) { - fdb_probe_actor_enter("flowTestCase1540", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase1549", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1loopBody1Catch1loopBody1when1(std::move(value), 0); @@ -11966,12 +11975,12 @@ class FlowTestCase1540ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1540", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase1549", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< FlowTestCase1540Actor, 2, ErrorOr >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase1549Actor, 2, ErrorOr >*,Error err) { - fdb_probe_actor_enter("flowTestCase1540", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase1549", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch2(err, 0); @@ -11981,7 +11990,7 @@ class FlowTestCase1540ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase1540", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase1549", reinterpret_cast(this), 2); } int a_body1cont3(int loopDepth) @@ -11997,55 +12006,55 @@ class FlowTestCase1540ActorState { return loopDepth; } - #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" UnitTestParameters params; - #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int count; - #line 1544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" bool verboseSetting; - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int verboseTestIteration; - #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" bool verbose; - #line 1556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" FlowMutex mutex; - #line 1557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" std::vector> tests; - #line 1559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" bool allowErrors; - #line 1564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" Optional error; - #line 1586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + #line 1595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" int i; - #line 12020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 12029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase1540() - #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -class FlowTestCase1540Actor final : public Actor, public ActorCallback< FlowTestCase1540Actor, 0, Void >, public ActorCallback< FlowTestCase1540Actor, 1, Void >, public ActorCallback< FlowTestCase1540Actor, 2, ErrorOr >, public FastAllocated, public FlowTestCase1540ActorState { - #line 12025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +// This generated class is to be used only via flowTestCase1549() + #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +class FlowTestCase1549Actor final : public Actor, public ActorCallback< FlowTestCase1549Actor, 0, Void >, public ActorCallback< FlowTestCase1549Actor, 1, Void >, public ActorCallback< FlowTestCase1549Actor, 2, ErrorOr >, public FastAllocated, public FlowTestCase1549ActorState { + #line 12034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase1540Actor, 0, Void >; -friend struct ActorCallback< FlowTestCase1540Actor, 1, Void >; -friend struct ActorCallback< FlowTestCase1540Actor, 2, ErrorOr >; - #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - FlowTestCase1540Actor(UnitTestParameters const& params) - #line 12038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" +friend struct ActorCallback< FlowTestCase1549Actor, 0, Void >; +friend struct ActorCallback< FlowTestCase1549Actor, 1, Void >; +friend struct ActorCallback< FlowTestCase1549Actor, 2, ErrorOr >; + #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + FlowTestCase1549Actor(UnitTestParameters const& params) + #line 12047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" : Actor(), - FlowTestCase1540ActorState(params) + FlowTestCase1549ActorState(params) { - fdb_probe_actor_enter("flowTestCase1540", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase1549", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase1540"); + this->lineage.setActorName("flowTestCase1549"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase1540", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase1549", reinterpret_cast(this), -1); } void cancel() override @@ -12053,20 +12062,20 @@ friend struct ActorCallback< FlowTestCase1540Actor, 2, ErrorOr >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase1540Actor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< FlowTestCase1540Actor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< FlowTestCase1540Actor, 2, ErrorOr >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase1549Actor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase1549Actor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< FlowTestCase1549Actor, 2, ErrorOr >*)0, actor_cancelled()); break; } } }; } - #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" -static Future flowTestCase1540( UnitTestParameters const& params ) { - #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" - return Future(new FlowTestCase1540Actor(params)); - #line 12068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" + #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +static Future flowTestCase1549( UnitTestParameters const& params ) { + #line 1549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" + return Future(new FlowTestCase1549Actor(params)); + #line 12077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase1540, "/flow/flow/FlowMutex") +ACTOR_TEST_CASE(flowTestCase1549, "/flow/flow/FlowMutex") -#line 1609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" +#line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTests.actor.cpp" diff --git a/src/fdbrpc/FlowTransport.actor.cpp b/src/fdbrpc/FlowTransport.actor.cpp index a3ef374..b0d0a1c 100644 --- a/src/fdbrpc/FlowTransport.actor.cpp +++ b/src/fdbrpc/FlowTransport.actor.cpp @@ -19,6 +19,7 @@ */ #include "fdbrpc/FlowTransport.h" +#include "flow/Arena.h" #include "flow/network.h" #include @@ -27,10 +28,16 @@ #include #endif +#include + +#include "fdbrpc/TokenSign.h" #include "fdbrpc/fdbrpc.h" #include "fdbrpc/FailureMonitor.h" #include "fdbrpc/HealthMonitor.h" +#include "fdbrpc/JsonWebKeySet.h" #include "fdbrpc/genericactors.actor.h" +#include "fdbrpc/IPAllowList.h" +#include "fdbrpc/TokenCache.h" #include "fdbrpc/simulator.h" #include "flow/ActorCollection.h" #include "flow/Error.h" @@ -38,18 +45,33 @@ #include "flow/Net2Packet.h" #include "flow/TDMetric.actor.h" #include "flow/ObjectSerializer.h" +#include "flow/Platform.h" #include "flow/ProtocolVersion.h" #include "flow/UnitTest.h" +#include "flow/WatchFile.actor.h" +#include "flow/IConnection.h" #define XXH_INLINE_ALL #include "flow/xxhash.h" #include "flow/actorcompiler.h" // This must be the last #include. -static NetworkAddressList g_currentDeliveryPeerAddress = NetworkAddressList(); -static Future g_currentDeliveryPeerDisconnect; +void removeCachedDNS(const std::string& host, const std::string& service) { + INetworkConnections::net()->removeCachedDNS(host, service); +} + +namespace { + +NetworkAddressList g_currentDeliveryPeerAddress = NetworkAddressList(); +bool g_currentDeliverPeerAddressTrusted = false; +Future g_currentDeliveryPeerDisconnect; + +} // namespace constexpr int PACKET_LEN_WIDTH = sizeof(uint32_t); const uint64_t TOKEN_STREAM_FLAG = 1; +FDB_BOOLEAN_PARAM(InReadSocket); +FDB_BOOLEAN_PARAM(IsStableConnection); + class EndpointMap : NonCopyable { public: // Reserve space for this many wellKnownEndpoints @@ -205,6 +227,7 @@ struct EndpointNotFoundReceiver final : NetworkMessageReceiver { Endpoint e = FlowTransport::transport().loadedEndpoint(token); IFailureMonitor::failureMonitor().endpointNotFound(e); } + bool isPublic() const override { return true; } }; struct PingRequest { @@ -229,21 +252,64 @@ struct PingReceiver final : NetworkMessageReceiver { PeerCompatibilityPolicy peerCompatibilityPolicy() const override { return PeerCompatibilityPolicy{ RequirePeer::AtLeast, ProtocolVersion::withStableInterfaces() }; } + bool isPublic() const override { return true; } +}; + +struct UnauthorizedEndpointReceiver final : NetworkMessageReceiver { + UnauthorizedEndpointReceiver(EndpointMap& endpoints) { + endpoints.insertWellKnown( + this, Endpoint::wellKnownToken(WLTOKEN_UNAUTHORIZED_ENDPOINT), TaskPriority::ReadSocket); + } + + void receive(ArenaObjectReader& reader) override { + UID token; + reader.deserialize(token); + Endpoint e = FlowTransport::transport().loadedEndpoint(token); + IFailureMonitor::failureMonitor().unauthorizedEndpoint(e); + } + bool isPublic() const override { return true; } +}; + +// NetworkAddressCachedString retains a cached Standalone of +// a NetworkAddressList.address.toString() value. This cached value is useful +// for features in the hot path (i.e. Tracing), which need the String formatted value +// frequently and do not wish to pay the formatting cost. If the underlying NetworkAddressList +// needs to change, do not attempt to update it directly, use the setNetworkAddress API as it +// will ensure the new toString() cached value is updated. +class NetworkAddressCachedString { +public: + NetworkAddressCachedString() { setAddressList(NetworkAddressList()); } + NetworkAddressCachedString(NetworkAddressList const& list) { setAddressList(list); } + NetworkAddressList const& getAddressList() const { return addressList; } + void setAddressList(NetworkAddressList const& list) { + cachedStr = Standalone(StringRef(list.address.toString())); + addressList = list; + } + void setNetworkAddress(NetworkAddress const& addr) { + addressList.address = addr; + setAddressList(addressList); // force the recaching of the string. + } + Standalone getLocalAddressAsString() const { return cachedStr; } + operator NetworkAddressList const&() { return addressList; } + +private: + NetworkAddressList addressList; + Standalone cachedStr; }; class TransportData { public: - TransportData(uint64_t transportId, int maxWellKnownEndpoints); + TransportData(uint64_t transportId, int maxWellKnownEndpoints, IPAllowList const* allowList); ~TransportData(); void initMetrics() { - bytesSent.init(LiteralStringRef("Net2.BytesSent")); - countPacketsReceived.init(LiteralStringRef("Net2.CountPacketsReceived")); - countPacketsGenerated.init(LiteralStringRef("Net2.CountPacketsGenerated")); - countConnEstablished.init(LiteralStringRef("Net2.CountConnEstablished")); - countConnClosedWithError.init(LiteralStringRef("Net2.CountConnClosedWithError")); - countConnClosedWithoutError.init(LiteralStringRef("Net2.CountConnClosedWithoutError")); + bytesSent.init("Net2.BytesSent"_sr); + countPacketsReceived.init("Net2.CountPacketsReceived"_sr); + countPacketsGenerated.init("Net2.CountPacketsGenerated"_sr); + countConnEstablished.init("Net2.CountConnEstablished"_sr); + countConnClosedWithError.init("Net2.CountConnClosedWithError"_sr); + countConnClosedWithoutError.init("Net2.CountConnClosedWithoutError"_sr); } Reference getPeer(NetworkAddress const& address); @@ -251,19 +317,20 @@ class TransportData { // Returns true if given network address 'address' is one of the address we are listening on. bool isLocalAddress(const NetworkAddress& address) const; + void applyPublicKeySet(StringRef jwkSetString); - NetworkAddressList localAddresses; + NetworkAddressCachedString localAddresses; std::vector> listeners; std::unordered_map> peers; std::unordered_map> closedPeers; HealthMonitor healthMonitor; std::set orderedAddresses; Reference> degraded; - bool warnAlwaysForLargePacket; EndpointMap endpoints; EndpointNotFoundReceiver endpointNotFoundReceiver{ endpoints }; PingReceiver pingReceiver{ endpoints }; + UnauthorizedEndpointReceiver unauthorizedEndpointReceiver{ endpoints }; Int64MetricHandle bytesSent; Int64MetricHandle countPacketsReceived; @@ -278,9 +345,13 @@ class TransportData { std::map multiVersionConnections; double lastIncompatibleMessage; uint64_t transportId; + IPAllowList allowList; Future multiVersionCleanup; Future pingLogger; + Future publicKeyFileWatch; + + std::unordered_map, PublicKey> publicKeys; }; ACTOR Future pingLatencyLogger(TransportData* self) { @@ -341,9 +412,10 @@ ACTOR Future pingLatencyLogger(TransportData* self) { } } -TransportData::TransportData(uint64_t transportId, int maxWellKnownEndpoints) - : warnAlwaysForLargePacket(true), endpoints(maxWellKnownEndpoints), endpointNotFoundReceiver(endpoints), - pingReceiver(endpoints), numIncompatibleConnections(0), lastIncompatibleMessage(0), transportId(transportId) { +TransportData::TransportData(uint64_t transportId, int maxWellKnownEndpoints, IPAllowList const* allowList) + : endpoints(maxWellKnownEndpoints), endpointNotFoundReceiver(endpoints), pingReceiver(endpoints), + numIncompatibleConnections(0), lastIncompatibleMessage(0), transportId(transportId), + allowList(allowList == nullptr ? IPAllowList() : *allowList) { degraded = makeReference>(false); pingLogger = pingLatencyLogger(this); } @@ -355,21 +427,21 @@ TransportData::TransportData(uint64_t transportId, int maxWellKnownEndpoints) struct ConnectPacket { // The value does not include the size of `connectPacketLength` itself, // but only the other fields of this structure. - uint32_t connectPacketLength; + uint32_t connectPacketLength = 0; ProtocolVersion protocolVersion; // Expect currentProtocolVersion - uint16_t canonicalRemotePort; // Port number to reconnect to the originating process - uint64_t connectionId; // Multi-version clients will use the same Id for both connections, other connections will - // set this to zero. Added at protocol Version 0x0FDB00A444020001. + uint16_t canonicalRemotePort = 0; // Port number to reconnect to the originating process + uint64_t connectionId = 0; // Multi-version clients will use the same Id for both connections, other connections + // will set this to zero. Added at protocol Version 0x0FDB00A444020001. // IP Address to reconnect to the originating process. Only one of these must be populated. - uint32_t canonicalRemoteIp4; + uint32_t canonicalRemoteIp4 = 0; enum ConnectPacketFlags { FLAG_IPV6 = 1 }; - uint16_t flags; - uint8_t canonicalRemoteIp6[16]; + uint16_t flags = 0; + uint8_t canonicalRemoteIp6[16] = { 0 }; - ConnectPacket() { memset((void*)this, 0, sizeof(*this)); } + ConnectPacket() = default; IPAddress canonicalRemoteIp() const { if (isIPv6()) { @@ -400,7 +472,7 @@ struct ConnectPacket { serializer(ar, connectPacketLength); if (connectPacketLength > sizeof(ConnectPacket) - sizeof(connectPacketLength)) { ASSERT(!g_network->isSimulated()); - TraceEvent("SerializationFailed").detail("PacketLength", connectPacketLength).backtrace(); + TraceEvent("SerializationFailed").backtrace(); throw serialization_failed(); } @@ -538,8 +610,8 @@ ACTOR Future connectionWriter(Reference self, Reference break; } - TEST(true); // We didn't write everything, so apparently the write buffer is full. Wait for it to be - // nonfull. + CODE_PROBE( + true, "We didn't write everything, so apparently the write buffer is full. Wait for it to be nonfull"); wait(conn->onWritable()); wait(yield(TaskPriority::WriteSocket)); } @@ -679,6 +751,7 @@ ACTOR Future connectionKeeper(Reference self, self->transport->countConnEstablished++; if (!delayedHealthUpdateF.isValid()) delayedHealthUpdateF = delayedHealthUpdate(self->destination, &tooManyConnectionsClosed); + self->connected = true; wait(connectionWriter(self, conn) || reader || connectionMonitor(self) || self->resetConnection.onTrigger()); TraceEvent("ConnectionReset", conn ? conn->getDebugID() : UID()) @@ -696,6 +769,7 @@ ACTOR Future connectionKeeper(Reference self, throw e; } } catch (Error& e) { + self->connected = false; delayedHealthUpdateF.cancel(); if (now() - self->lastConnectTime > FLOW_KNOBS->RECONNECTION_RESET_TIME) { self->reconnectionDelay = FLOW_KNOBS->INITIAL_RECONNECTION_TIME; @@ -746,7 +820,7 @@ ACTOR Future connectionKeeper(Reference self, .detail("PeerAddr", self->destination); // Since the connection has closed, we need to check the protocol version the next time we connect - self->incompatibleProtocolVersionNewer = false; + self->compatible = true; } if (self->destination.isPublic() && @@ -814,14 +888,14 @@ ACTOR Future connectionKeeper(Reference self, } Peer::Peer(TransportData* transport, NetworkAddress const& destination) - : transport(transport), destination(destination), compatible(true), outgoingConnectionIdle(true), + : transport(transport), destination(destination), compatible(true), connected(false), outgoingConnectionIdle(true), lastConnectTime(0.0), reconnectionDelay(FLOW_KNOBS->INITIAL_RECONNECTION_TIME), peerReferences(-1), - incompatibleProtocolVersionNewer(false), bytesReceived(0), bytesSent(0), lastDataPacketSentTime(now()), - outstandingReplies(0), pingLatencies(destination.isPublic() ? FLOW_KNOBS->PING_SAMPLE_AMOUNT : 1), - lastLoggedTime(0.0), lastLoggedBytesReceived(0), lastLoggedBytesSent(0), timeoutCount(0), + bytesReceived(0), bytesSent(0), lastDataPacketSentTime(now()), outstandingReplies(0), + pingLatencies(destination.isPublic() ? FLOW_KNOBS->PING_SKETCH_ACCURACY : 0.1), lastLoggedTime(0.0), + lastLoggedBytesReceived(0), lastLoggedBytesSent(0), timeoutCount(0), protocolVersion(Reference>>(new AsyncVar>())), connectOutgoingCount(0), connectIncomingCount(0), connectFailedCount(0), - connectLatencies(destination.isPublic() ? FLOW_KNOBS->NETWORK_CONNECT_SAMPLE_AMOUNT : 1) { + connectLatencies(destination.isPublic() ? FLOW_KNOBS->PING_SKETCH_ACCURACY : 0.1) { IFailureMonitor::failureMonitor().setStatus(destination, FailureStatus(false)); } @@ -836,12 +910,12 @@ void Peer::send(PacketBuffer* pb, ReliablePacket* rp, bool firstUnsent) { void Peer::prependConnectPacket() { // Send the ConnectPacket expected at the beginning of a new connection ConnectPacket pkt; - if (transport->localAddresses.address.isTLS() == destination.isTLS()) { - pkt.canonicalRemotePort = transport->localAddresses.address.port; - pkt.setCanonicalRemoteIp(transport->localAddresses.address.ip); - } else if (transport->localAddresses.secondaryAddress.present()) { - pkt.canonicalRemotePort = transport->localAddresses.secondaryAddress.get().port; - pkt.setCanonicalRemoteIp(transport->localAddresses.secondaryAddress.get().ip); + if (transport->localAddresses.getAddressList().address.isTLS() == destination.isTLS()) { + pkt.canonicalRemotePort = transport->localAddresses.getAddressList().address.port; + pkt.setCanonicalRemoteIp(transport->localAddresses.getAddressList().address.ip); + } else if (transport->localAddresses.getAddressList().secondaryAddress.present()) { + pkt.canonicalRemotePort = transport->localAddresses.getAddressList().secondaryAddress.get().port; + pkt.setCanonicalRemoteIp(transport->localAddresses.getAddressList().secondaryAddress.get().ip); } else { // a "mixed" TLS/non-TLS connection is like a client/server connection - there's no way to reverse it pkt.canonicalRemotePort = 0; @@ -853,10 +927,20 @@ void Peer::prependConnectPacket() { pkt.protocolVersion.addObjectSerializerFlag(); pkt.connectionId = transport->transportId; - PacketBuffer* pb_first = PacketBuffer::create(); + PacketBuffer *pb_first = PacketBuffer::create(), *pb_end = nullptr; PacketWriter wr(pb_first, nullptr, Unversioned()); pkt.serialize(wr); - unsent.prependWriteBuffer(pb_first, wr.finish()); + pb_end = wr.finish(); +#if VALGRIND + SendBuffer* checkbuf = pb_first; + while (checkbuf) { + int size = checkbuf->bytes_written; + const uint8_t* data = checkbuf->data(); + VALGRIND_CHECK_MEM_IS_DEFINED(data, size); + checkbuf = checkbuf->next; + } +#endif + unsent.prependWriteBuffer(pb_first, pb_end); } void Peer::discardUnreliablePackets() { @@ -878,20 +962,21 @@ void Peer::onIncomingConnection(Reference self, Reference con ++self->connectIncomingCount; if (!destination.isPublic() && !outgoingConnectionIdle) throw address_in_use(); - NetworkAddress compatibleAddr = transport->localAddresses.address; - if (transport->localAddresses.secondaryAddress.present() && - transport->localAddresses.secondaryAddress.get().isTLS() == destination.isTLS()) { - compatibleAddr = transport->localAddresses.secondaryAddress.get(); + NetworkAddress compatibleAddr = transport->localAddresses.getAddressList().address; + if (transport->localAddresses.getAddressList().secondaryAddress.present() && + transport->localAddresses.getAddressList().secondaryAddress.get().isTLS() == destination.isTLS()) { + compatibleAddr = transport->localAddresses.getAddressList().secondaryAddress.get(); } if (!destination.isPublic() || outgoingConnectionIdle || destination > compatibleAddr || (lastConnectTime > 1.0 && now() - lastConnectTime > FLOW_KNOBS->ALWAYS_ACCEPT_DELAY)) { // Keep the new connection - TraceEvent("IncomingConnection", conn->getDebugID()) + TraceEvent("IncomingConnection"_audit, conn->getDebugID()) .suppressFor(1.0) .detail("FromAddr", conn->getPeerAddress()) .detail("CanonicalAddr", destination) - .detail("IsPublic", destination.isPublic()); + .detail("IsPublic", destination.isPublic()) + .detail("Trusted", self->transport->allowList(conn->getPeerAddress().ip) && conn->hasTrustedPeer()); connect.cancel(); prependConnectPacket(); @@ -938,7 +1023,9 @@ ACTOR static void deliver(TransportData* self, Endpoint destination, TaskPriority priority, ArenaReader reader, - bool inReadSocket, + NetworkAddress peerAddress, + bool isTrustedPeer, + InReadSocket inReadSocket, Future disconnect) { // We want to run the task at the right priority. If the priority is higher than the current priority (which is // ReadSocket) we can just upgrade. Otherwise we'll context switch so that we don't block other tasks that might run @@ -952,21 +1039,26 @@ ACTOR static void deliver(TransportData* self, } auto receiver = self->endpoints.get(destination.token); - if (receiver) { + if (receiver && (isTrustedPeer || receiver->isPublic())) { if (!checkCompatible(receiver->peerCompatibilityPolicy(), reader.protocolVersion())) { return; } try { + ASSERT(g_currentDeliveryPeerAddress == NetworkAddressList()); + ASSERT(!g_currentDeliverPeerAddressTrusted); g_currentDeliveryPeerAddress = destination.addresses; + g_currentDeliverPeerAddressTrusted = isTrustedPeer; g_currentDeliveryPeerDisconnect = disconnect; StringRef data = reader.arenaReadAll(); ASSERT(data.size() > 8); ArenaObjectReader objReader(reader.arena(), reader.arenaReadAll(), AssumeVersion(reader.protocolVersion())); receiver->receive(objReader); - g_currentDeliveryPeerAddress = { NetworkAddress() }; + g_currentDeliveryPeerAddress = NetworkAddressList(); + g_currentDeliverPeerAddressTrusted = false; g_currentDeliveryPeerDisconnect = Future(); } catch (Error& e) { - g_currentDeliveryPeerAddress = { NetworkAddress() }; + g_currentDeliveryPeerAddress = NetworkAddressList(); + g_currentDeliverPeerAddressTrusted = false; g_currentDeliveryPeerDisconnect = Future(); TraceEvent(SevError, "ReceiverError") .error(e) @@ -979,18 +1071,32 @@ ACTOR static void deliver(TransportData* self, } } else if (destination.token.first() & TOKEN_STREAM_FLAG) { // We don't have the (stream) endpoint 'token', notify the remote machine - if (destination.token.first() != -1) { - if (self->isLocalAddress(destination.getPrimaryAddress())) { - sendLocal(self, - SerializeSource(destination.token), - Endpoint::wellKnown(destination.addresses, WLTOKEN_ENDPOINT_NOT_FOUND)); - } else { - Reference peer = self->getOrOpenPeer(destination.getPrimaryAddress()); - sendPacket(self, - peer, - SerializeSource(destination.token), - Endpoint::wellKnown(destination.addresses, WLTOKEN_ENDPOINT_NOT_FOUND), - false); + if (receiver) { + TraceEvent(SevWarnAlways, "AttemptedRPCToPrivatePrevented"_audit) + .detail("From", peerAddress) + .detail("Token", destination.token) + .detail("Receiver", typeid(*receiver).name()); + ASSERT(!self->isLocalAddress(destination.getPrimaryAddress())); + Reference peer = self->getOrOpenPeer(destination.getPrimaryAddress()); + sendPacket(self, + peer, + SerializeSource(destination.token), + Endpoint::wellKnown(destination.addresses, WLTOKEN_UNAUTHORIZED_ENDPOINT), + false); + } else { + if (destination.token.first() != -1) { + if (self->isLocalAddress(destination.getPrimaryAddress())) { + sendLocal(self, + SerializeSource(destination.token), + Endpoint::wellKnown(destination.addresses, WLTOKEN_ENDPOINT_NOT_FOUND)); + } else { + Reference peer = self->getOrOpenPeer(destination.getPrimaryAddress()); + sendPacket(self, + peer, + SerializeSource(destination.token), + Endpoint::wellKnown(destination.addresses, WLTOKEN_ENDPOINT_NOT_FOUND), + false); + } } } } @@ -1001,9 +1107,10 @@ static void scanPackets(TransportData* transport, const uint8_t* e, Arena& arena, NetworkAddress const& peerAddress, + bool isTrustedPeer, ProtocolVersion peerProtocolVersion, Future disconnect, - bool isStableConnection) { + IsStableConnection isStableConnection) { // Find each complete packet in the given byte range and queue a ready task to deliver it. // Remove the complete packets from the range by increasing unprocessed_begin. // There won't be more than 64K of data plus one packet, so this shouldn't take a long time. @@ -1038,14 +1145,26 @@ static void scanPackets(TransportData* transport, if (e - p < packetLen) break; - ASSERT(packetLen >= sizeof(UID)); + + if (packetLen < sizeof(UID)) { + if (g_network->isSimulated()) { + // Same as ASSERT(false), but prints packet length: + ASSERT_GE(packetLen, sizeof(UID)); + } else { + TraceEvent(SevError, "PacketTooSmall") + .detail("FromPeer", peerAddress.toString()) + .detail("Length", packetLen); + throw platform_error(); + } + } if (checksumEnabled) { bool isBuggifyEnabled = false; if (g_network->isSimulated() && !isStableConnection && - g_network->now() - g_simulator.lastConnectionFailure > g_simulator.connectionFailuresDisableDuration && + g_network->now() - g_simulator->lastConnectionFailure > + g_simulator->connectionFailuresDisableDuration && BUGGIFY_WITH_PROB(0.0001)) { - g_simulator.lastConnectionFailure = g_network->now(); + g_simulator->lastConnectionFailure = g_network->now(); isBuggifyEnabled = true; TraceEvent(SevInfo, "BitsFlip").log(); int flipBits = 32 - (int)floor(log2(deterministicRandom()->randomUInt32())); @@ -1098,14 +1217,11 @@ static void scanPackets(TransportData* transport, ++transport->countPacketsReceived; if (packetLen > FLOW_KNOBS->PACKET_WARNING) { - TraceEvent(transport->warnAlwaysForLargePacket ? SevWarnAlways : SevWarn, "LargePacketReceived") + TraceEvent(SevWarn, "LargePacketReceived") .suppressFor(1.0) .detail("FromPeer", peerAddress.toString()) .detail("Length", (int)packetLen) .detail("Token", token); - - if (g_network->isSimulated()) - transport->warnAlwaysForLargePacket = false; } ASSERT(!reader.empty()); @@ -1117,7 +1233,14 @@ static void scanPackets(TransportData* transport, // we have many messages to UnknownEndpoint we want to optimize earlier. As deliver is an actor it // will allocate some state on the heap and this prevents it from doing that. if (priority != TaskPriority::UnknownEndpoint || (token.first() & TOKEN_STREAM_FLAG) != 0) { - deliver(transport, Endpoint({ peerAddress }, token), priority, std::move(reader), true, disconnect); + deliver(transport, + Endpoint({ peerAddress }, token), + priority, + std::move(reader), + peerAddress, + isTrustedPeer, + InReadSocket::True, + disconnect); } unprocessed_begin = p = p + packetLen; @@ -1160,11 +1283,11 @@ ACTOR static Future connectionReader(TransportData* transport, state bool expectConnectPacket = true; state bool compatible = false; state bool incompatiblePeerCounted = false; - state bool incompatibleProtocolVersionNewer = false; state NetworkAddress peerAddress; state ProtocolVersion peerProtocolVersion; - + state bool trusted = transport->allowList(conn->getPeerAddress().ip) && conn->hasTrustedPeer(); peerAddress = conn->getPeerAddress(); + if (!peer) { ASSERT(!peerAddress.isPublic()); } @@ -1220,7 +1343,6 @@ ACTOR static Future connectionReader(TransportData* transport, uint64_t connectionId = pkt.connectionId; if (!pkt.protocolVersion.hasObjectSerializerFlag() || !pkt.protocolVersion.isCompatible(g_network->protocolVersion())) { - incompatibleProtocolVersionNewer = pkt.protocolVersion > g_network->protocolVersion(); NetworkAddress addr = pkt.canonicalRemotePort ? NetworkAddress(pkt.canonicalRemoteIp(), pkt.canonicalRemotePort) : conn->getPeerAddress(); @@ -1280,7 +1402,6 @@ ACTOR static Future connectionReader(TransportData* transport, .suppressFor(1.0) .detail("PeerAddr", NetworkAddress(pkt.canonicalRemoteIp(), pkt.canonicalRemotePort)); peer->compatible = compatible; - peer->incompatibleProtocolVersionNewer = incompatibleProtocolVersionNewer; if (!compatible) { peer->transport->numIncompatibleConnections++; incompatiblePeerCounted = true; @@ -1298,7 +1419,6 @@ ACTOR static Future connectionReader(TransportData* transport, } peer = transport->getOrOpenPeer(peerAddress, false); peer->compatible = compatible; - peer->incompatibleProtocolVersionNewer = incompatibleProtocolVersionNewer; if (!compatible) { peer->transport->numIncompatibleConnections++; incompatiblePeerCounted = true; @@ -1317,9 +1437,10 @@ ACTOR static Future connectionReader(TransportData* transport, unprocessed_end, arena, peerAddress, + trusted, peerProtocolVersion, peer->disconnect.getFuture(), - g_network->isSimulated() && conn->isStableConnection()); + IsStableConnection(g_network->isSimulated() && conn->isStableConnection())); } else { unprocessed_begin = unprocessed_end; peer->resetPing.trigger(); @@ -1359,7 +1480,7 @@ ACTOR static Future connectionIncoming(TransportData* self, ReferenceonIncomingConnection(p, conn, reader); } when(wait(delayJittered(FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT))) { - TEST(true); // Incoming connection timed out + CODE_PROBE(true, "Incoming connection timed out"); throw timed_out(); } } @@ -1380,10 +1501,11 @@ ACTOR static Future listen(TransportData* self, NetworkAddress listenAddr) state ActorCollectionNoErrors incoming; // Actors monitoring incoming connections that haven't yet been associated with a peer state Reference listener = INetworkConnections::net()->listen(listenAddr); - if (!g_network->isSimulated() && self->localAddresses.address.port == 0) { + if (!g_network->isSimulated() && self->localAddresses.getAddressList().address.port == 0) { TraceEvent(SevInfo, "UpdatingListenAddress") .detail("AssignedListenAddress", listener->getListenAddress().toString()); - self->localAddresses.address = listener->getListenAddress(); + self->localAddresses.setNetworkAddress(listener->getListenAddress()); + setTraceLocalAddress(listener->getListenAddress()); } state uint64_t connectionCount = 0; try { @@ -1432,8 +1554,30 @@ Reference TransportData::getOrOpenPeer(NetworkAddress const& address, bool } bool TransportData::isLocalAddress(const NetworkAddress& address) const { - return address == localAddresses.address || - (localAddresses.secondaryAddress.present() && address == localAddresses.secondaryAddress.get()); + return address == localAddresses.getAddressList().address || + (localAddresses.getAddressList().secondaryAddress.present() && + address == localAddresses.getAddressList().secondaryAddress.get()); +} + +void TransportData::applyPublicKeySet(StringRef jwkSetString) { + auto jwks = JsonWebKeySet::parse(jwkSetString, {}); + if (!jwks.present()) + throw pkey_decode_error(); + const auto& keySet = jwks.get().keys; + publicKeys.clear(); + int numPrivateKeys = 0; + for (auto [keyName, key] : keySet) { + // ignore private keys + if (key.isPublic()) { + publicKeys[keyName] = key.getPublic(); + } else { + numPrivateKeys++; + } + } + TraceEvent(SevInfo, "AuthzPublicKeySetApply"_audit).detail("NumPublicKeys", publicKeys.size()); + if (numPrivateKeys > 0) { + TraceEvent(SevWarnAlways, "AuthzPublicKeySetContainsPrivateKeys").detail("NumPrivateKeys", numPrivateKeys); + } } ACTOR static Future multiVersionCleanupWorker(TransportData* self) { @@ -1465,9 +1609,14 @@ ACTOR static Future multiVersionCleanupWorker(TransportData* self) { } } -FlowTransport::FlowTransport(uint64_t transportId, int maxWellKnownEndpoints) - : self(new TransportData(transportId, maxWellKnownEndpoints)) { +FlowTransport::FlowTransport(uint64_t transportId, int maxWellKnownEndpoints, IPAllowList const* allowList) + : self(new TransportData(transportId, maxWellKnownEndpoints, allowList)) { self->multiVersionCleanup = multiVersionCleanupWorker(self); + if (g_network->isSimulated()) { + for (auto const& p : g_simulator->authKeys) { + self->publicKeys.emplace(p.first, p.second.toPublic()); + } + } } FlowTransport::~FlowTransport() { @@ -1479,11 +1628,21 @@ void FlowTransport::initMetrics() { } NetworkAddressList FlowTransport::getLocalAddresses() const { - return self->localAddresses; + return self->localAddresses.getAddressList(); } NetworkAddress FlowTransport::getLocalAddress() const { - return self->localAddresses.address; + return self->localAddresses.getAddressList().address; +} + +Standalone FlowTransport::getLocalAddressAsString() const { + return self->localAddresses.getLocalAddressAsString(); +} + +void FlowTransport::setLocalAddress(NetworkAddress const& address) { + auto newAddress = self->localAddresses.getAddressList(); + newAddress.address = address; + self->localAddresses.setAddressList(newAddress); } const std::unordered_map>& FlowTransport::getAllPeers() const { @@ -1507,11 +1666,14 @@ Future FlowTransport::onIncompatibleChanged() { Future FlowTransport::bind(NetworkAddress publicAddress, NetworkAddress listenAddress) { ASSERT(publicAddress.isPublic()); - if (self->localAddresses.address == NetworkAddress()) { - self->localAddresses.address = publicAddress; + if (self->localAddresses.getAddressList().address == NetworkAddress()) { + self->localAddresses.setNetworkAddress(publicAddress); } else { - self->localAddresses.secondaryAddress = publicAddress; + auto addrList = self->localAddresses.getAddressList(); + addrList.secondaryAddress = publicAddress; + self->localAddresses.setAddressList(addrList); } + // reformatLocalAddress() TraceEvent("Binding").detail("PublicAddress", publicAddress).detail("ListenAddress", listenAddress); Future listenF = listen(self, listenAddress); @@ -1562,7 +1724,7 @@ void FlowTransport::removePeerReference(const Endpoint& endpoint, bool isStream) void FlowTransport::addEndpoint(Endpoint& endpoint, NetworkMessageReceiver* receiver, TaskPriority taskID) { endpoint.token = deterministicRandom()->randomUniqueID(); if (receiver->isStream()) { - endpoint.addresses = self->localAddresses; + endpoint.addresses = self->localAddresses.getAddressList(); endpoint.token = UID(endpoint.token.first() | TOKEN_STREAM_FLAG, endpoint.token.second()); } else { endpoint.addresses = NetworkAddressList(); @@ -1572,7 +1734,7 @@ void FlowTransport::addEndpoint(Endpoint& endpoint, NetworkMessageReceiver* rece } void FlowTransport::addEndpoints(std::vector> const& streams) { - self->endpoints.insert(self->localAddresses, streams); + self->endpoints.insert(self->localAddresses.getAddressList(), streams); } void FlowTransport::removeEndpoint(const Endpoint& endpoint, NetworkMessageReceiver* receiver) { @@ -1580,13 +1742,13 @@ void FlowTransport::removeEndpoint(const Endpoint& endpoint, NetworkMessageRecei } void FlowTransport::addWellKnownEndpoint(Endpoint& endpoint, NetworkMessageReceiver* receiver, TaskPriority taskID) { - endpoint.addresses = self->localAddresses; + endpoint.addresses = self->localAddresses.getAddressList(); ASSERT(receiver->isStream()); self->endpoints.insertWellKnown(receiver, endpoint.token, taskID); } static void sendLocal(TransportData* self, ISerializeSource const& what, const Endpoint& destination) { - TEST(true); // "Loopback" delivery + CODE_PROBE(true, "\"Loopback\" delivery"); // SOMEDAY: Would it be better to avoid (de)serialization by doing this check in flow? Standalone copy; @@ -1603,8 +1765,10 @@ static void sendLocal(TransportData* self, ISerializeSource const& what, const E deliver(self, destination, priority, - ArenaReader(copy.arena(), copy, AssumeVersion(currentProtocolVersion)), - false, + ArenaReader(copy.arena(), copy, AssumeVersion(currentProtocolVersion())), + NetworkAddress(), + true, + InReadSocket::False, Never()); } } @@ -1619,9 +1783,8 @@ static ReliablePacket* sendPacket(TransportData* self, // If there isn't an open connection, a public address, or the peer isn't compatible, we can't send if (!peer || (peer->outgoingConnectionIdle && !destination.getPrimaryAddress().isPublic()) || - (peer->incompatibleProtocolVersionNewer && - destination.token != Endpoint::wellKnownToken(WLTOKEN_PING_PACKET))) { - TEST(true); // Can't send to private address without a compatible open connection + (!peer->compatible && destination.token != Endpoint::wellKnownToken(WLTOKEN_PING_PACKET))) { + CODE_PROBE(true, "Can't send to private address without a compatible open connection"); return nullptr; } @@ -1718,15 +1881,12 @@ static ReliablePacket* sendPacket(TransportData* self, .detail("Length", (int)len); // throw platform_error(); // FIXME: How to recover from this situation? } else if (len > FLOW_KNOBS->PACKET_WARNING) { - TraceEvent(self->warnAlwaysForLargePacket ? SevWarnAlways : SevWarn, "LargePacketSent") + TraceEvent(SevWarn, "LargePacketSent") .suppressFor(1.0) .detail("ToPeer", destination.getPrimaryAddress()) .detail("Length", (int)len) .detail("Token", destination.token) .backtrace(); - - if (g_network->isSimulated()) - self->warnAlwaysForLargePacket = false; } #if VALGRIND @@ -1811,9 +1971,13 @@ bool FlowTransport::incompatibleOutgoingConnectionsPresent() { return self->numIncompatibleConnections > 0; } -void FlowTransport::createInstance(bool isClient, uint64_t transportId, int maxWellKnownEndpoints) { +void FlowTransport::createInstance(bool isClient, + uint64_t transportId, + int maxWellKnownEndpoints, + IPAllowList const* allowList) { + TokenCache::createInstance(); g_network->setGlobal(INetwork::enFlowTransport, - (flowGlobalType) new FlowTransport(transportId, maxWellKnownEndpoints)); + (flowGlobalType) new FlowTransport(transportId, maxWellKnownEndpoints, allowList)); g_network->setGlobal(INetwork::enNetworkAddressFunc, (flowGlobalType)&FlowTransport::getGlobalLocalAddress); g_network->setGlobal(INetwork::enNetworkAddressesFunc, (flowGlobalType)&FlowTransport::getGlobalLocalAddresses); g_network->setGlobal(INetwork::enFailureMonitor, (flowGlobalType) new SimpleFailureMonitor()); @@ -1823,3 +1987,90 @@ void FlowTransport::createInstance(bool isClient, uint64_t transportId, int maxW HealthMonitor* FlowTransport::healthMonitor() { return &self->healthMonitor; } + +Optional FlowTransport::getPublicKeyByName(StringRef name) const { + auto iter = self->publicKeys.find(name); + if (iter != self->publicKeys.end()) { + return iter->second; + } + return {}; +} + +NetworkAddress FlowTransport::currentDeliveryPeerAddress() const { + return g_currentDeliveryPeerAddress.address; +} + +bool FlowTransport::currentDeliveryPeerIsTrusted() const { + return g_currentDeliverPeerAddressTrusted; +} + +void FlowTransport::addPublicKey(StringRef name, PublicKey key) { + self->publicKeys[name] = key; +} + +void FlowTransport::removePublicKey(StringRef name) { + self->publicKeys.erase(name); +} + +void FlowTransport::removeAllPublicKeys() { + self->publicKeys.clear(); +} + +void FlowTransport::loadPublicKeyFile(const std::string& filePath) { + if (!fileExists(filePath)) { + throw file_not_found(); + } + int64_t const len = fileSize(filePath); + if (len <= 0) { + TraceEvent(SevWarn, "AuthzPublicKeySetEmpty").detail("Path", filePath); + } else if (len > FLOW_KNOBS->PUBLIC_KEY_FILE_MAX_SIZE) { + throw file_too_large(); + } else { + auto json = readFileBytes(filePath, len); + self->applyPublicKeySet(StringRef(json)); + } +} + +ACTOR static Future watchPublicKeyJwksFile(std::string filePath, TransportData* self) { + state AsyncTrigger fileChanged; + state Future fileWatch; + state unsigned errorCount = 0; // error since watch start or last successful refresh + + // Make sure this watch setup does not break due to async file system initialization not having been called + loop { + if (IAsyncFileSystem::filesystem()) + break; + wait(delay(1.0)); + } + const int& intervalSeconds = FLOW_KNOBS->PUBLIC_KEY_FILE_REFRESH_INTERVAL_SECONDS; + fileWatch = watchFileForChanges(filePath, &fileChanged, &intervalSeconds, "AuthzPublicKeySetRefreshStatError"); + loop { + try { + wait(fileChanged.onTrigger()); + state Reference file = wait(IAsyncFileSystem::filesystem()->open( + filePath, IAsyncFile::OPEN_READONLY | IAsyncFile::OPEN_UNCACHED, 0)); + state int64_t filesize = wait(file->size()); + state std::string json(filesize, '\0'); + if (filesize > FLOW_KNOBS->PUBLIC_KEY_FILE_MAX_SIZE) + throw file_too_large(); + if (filesize <= 0) { + TraceEvent(SevWarn, "AuthzPublicKeySetEmpty").suppressFor(60); + continue; + } + wait(success(file->read(&json[0], filesize, 0))); + self->applyPublicKeySet(StringRef(json)); + errorCount = 0; + } catch (Error& e) { + if (e.code() == error_code_actor_cancelled) { + throw; + } + // parse/read error + errorCount++; + TraceEvent(SevWarn, "AuthzPublicKeySetRefreshError"_audit).error(e).detail("ErrorCount", errorCount); + } + } +} + +void FlowTransport::watchPublicKeyFile(const std::string& publicKeyFilePath) { + self->publicKeyFileWatch = watchPublicKeyJwksFile(publicKeyFilePath, self); +} diff --git a/src/fdbrpc/FlowTransport.actor.g.cpp b/src/fdbrpc/FlowTransport.actor.g.cpp index 9fad170..2b8f320 100644 --- a/src/fdbrpc/FlowTransport.actor.g.cpp +++ b/src/fdbrpc/FlowTransport.actor.g.cpp @@ -21,6 +21,7 @@ */ #include "fdbrpc/FlowTransport.h" +#include "flow/Arena.h" #include "flow/network.h" #include @@ -29,10 +30,16 @@ #include #endif +#include + +#include "fdbrpc/TokenSign.h" #include "fdbrpc/fdbrpc.h" #include "fdbrpc/FailureMonitor.h" #include "fdbrpc/HealthMonitor.h" +#include "fdbrpc/JsonWebKeySet.h" #include "fdbrpc/genericactors.actor.h" +#include "fdbrpc/IPAllowList.h" +#include "fdbrpc/TokenCache.h" #include "fdbrpc/simulator.h" #include "flow/ActorCollection.h" #include "flow/Error.h" @@ -40,18 +47,33 @@ #include "flow/Net2Packet.h" #include "flow/TDMetric.actor.h" #include "flow/ObjectSerializer.h" +#include "flow/Platform.h" #include "flow/ProtocolVersion.h" #include "flow/UnitTest.h" +#include "flow/WatchFile.actor.h" +#include "flow/IConnection.h" #define XXH_INLINE_ALL #include "flow/xxhash.h" #include "flow/actorcompiler.h" // This must be the last #include. -static NetworkAddressList g_currentDeliveryPeerAddress = NetworkAddressList(); -static Future g_currentDeliveryPeerDisconnect; +void removeCachedDNS(const std::string& host, const std::string& service) { + INetworkConnections::net()->removeCachedDNS(host, service); +} + +namespace { + +NetworkAddressList g_currentDeliveryPeerAddress = NetworkAddressList(); +bool g_currentDeliverPeerAddressTrusted = false; +Future g_currentDeliveryPeerDisconnect; + +} // namespace constexpr int PACKET_LEN_WIDTH = sizeof(uint32_t); const uint64_t TOKEN_STREAM_FLAG = 1; +FDB_BOOLEAN_PARAM(InReadSocket); +FDB_BOOLEAN_PARAM(IsStableConnection); + class EndpointMap : NonCopyable { public: // Reserve space for this many wellKnownEndpoints @@ -207,6 +229,7 @@ struct EndpointNotFoundReceiver final : NetworkMessageReceiver { Endpoint e = FlowTransport::transport().loadedEndpoint(token); IFailureMonitor::failureMonitor().endpointNotFound(e); } + bool isPublic() const override { return true; } }; struct PingRequest { @@ -231,21 +254,64 @@ struct PingReceiver final : NetworkMessageReceiver { PeerCompatibilityPolicy peerCompatibilityPolicy() const override { return PeerCompatibilityPolicy{ RequirePeer::AtLeast, ProtocolVersion::withStableInterfaces() }; } + bool isPublic() const override { return true; } +}; + +struct UnauthorizedEndpointReceiver final : NetworkMessageReceiver { + UnauthorizedEndpointReceiver(EndpointMap& endpoints) { + endpoints.insertWellKnown( + this, Endpoint::wellKnownToken(WLTOKEN_UNAUTHORIZED_ENDPOINT), TaskPriority::ReadSocket); + } + + void receive(ArenaObjectReader& reader) override { + UID token; + reader.deserialize(token); + Endpoint e = FlowTransport::transport().loadedEndpoint(token); + IFailureMonitor::failureMonitor().unauthorizedEndpoint(e); + } + bool isPublic() const override { return true; } +}; + +// NetworkAddressCachedString retains a cached Standalone of +// a NetworkAddressList.address.toString() value. This cached value is useful +// for features in the hot path (i.e. Tracing), which need the String formatted value +// frequently and do not wish to pay the formatting cost. If the underlying NetworkAddressList +// needs to change, do not attempt to update it directly, use the setNetworkAddress API as it +// will ensure the new toString() cached value is updated. +class NetworkAddressCachedString { +public: + NetworkAddressCachedString() { setAddressList(NetworkAddressList()); } + NetworkAddressCachedString(NetworkAddressList const& list) { setAddressList(list); } + NetworkAddressList const& getAddressList() const { return addressList; } + void setAddressList(NetworkAddressList const& list) { + cachedStr = Standalone(StringRef(list.address.toString())); + addressList = list; + } + void setNetworkAddress(NetworkAddress const& addr) { + addressList.address = addr; + setAddressList(addressList); // force the recaching of the string. + } + Standalone getLocalAddressAsString() const { return cachedStr; } + operator NetworkAddressList const&() { return addressList; } + +private: + NetworkAddressList addressList; + Standalone cachedStr; }; class TransportData { public: - TransportData(uint64_t transportId, int maxWellKnownEndpoints); + TransportData(uint64_t transportId, int maxWellKnownEndpoints, IPAllowList const* allowList); ~TransportData(); void initMetrics() { - bytesSent.init(LiteralStringRef("Net2.BytesSent")); - countPacketsReceived.init(LiteralStringRef("Net2.CountPacketsReceived")); - countPacketsGenerated.init(LiteralStringRef("Net2.CountPacketsGenerated")); - countConnEstablished.init(LiteralStringRef("Net2.CountConnEstablished")); - countConnClosedWithError.init(LiteralStringRef("Net2.CountConnClosedWithError")); - countConnClosedWithoutError.init(LiteralStringRef("Net2.CountConnClosedWithoutError")); + bytesSent.init("Net2.BytesSent"_sr); + countPacketsReceived.init("Net2.CountPacketsReceived"_sr); + countPacketsGenerated.init("Net2.CountPacketsGenerated"_sr); + countConnEstablished.init("Net2.CountConnEstablished"_sr); + countConnClosedWithError.init("Net2.CountConnClosedWithError"_sr); + countConnClosedWithoutError.init("Net2.CountConnClosedWithoutError"_sr); } Reference getPeer(NetworkAddress const& address); @@ -253,19 +319,20 @@ class TransportData { // Returns true if given network address 'address' is one of the address we are listening on. bool isLocalAddress(const NetworkAddress& address) const; + void applyPublicKeySet(StringRef jwkSetString); - NetworkAddressList localAddresses; + NetworkAddressCachedString localAddresses; std::vector> listeners; std::unordered_map> peers; std::unordered_map> closedPeers; HealthMonitor healthMonitor; std::set orderedAddresses; Reference> degraded; - bool warnAlwaysForLargePacket; EndpointMap endpoints; EndpointNotFoundReceiver endpointNotFoundReceiver{ endpoints }; PingReceiver pingReceiver{ endpoints }; + UnauthorizedEndpointReceiver unauthorizedEndpointReceiver{ endpoints }; Int64MetricHandle bytesSent; Int64MetricHandle countPacketsReceived; @@ -280,28 +347,32 @@ class TransportData { std::map multiVersionConnections; double lastIncompatibleMessage; uint64_t transportId; + IPAllowList allowList; Future multiVersionCleanup; Future pingLogger; + Future publicKeyFileWatch; + + std::unordered_map, PublicKey> publicKeys; }; - #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" namespace { // This generated class is to be used only via pingLatencyLogger() - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" template - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class PingLatencyLoggerActorState { - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" PingLatencyLoggerActorState(TransportData* const& self) - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" : self(self), - #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" lastAddress(NetworkAddress()) - #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { fdb_probe_actor_create("pingLatencyLogger", reinterpret_cast(this)); @@ -314,9 +385,9 @@ class PingLatencyLoggerActorState { int a_body1(int loopDepth=0) { try { - #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -344,92 +415,92 @@ class PingLatencyLoggerActorState { } int a_body1loopBody1(int loopDepth) { - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (self->orderedAddresses.size()) - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" auto it = self->orderedAddresses.upper_bound(lastAddress); - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (it == self->orderedAddresses.end()) - #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" it = self->orderedAddresses.begin(); - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" lastAddress = *it; - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" auto peer = self->getPeer(lastAddress); - #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!peer) - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent(SevWarnAlways, "MissingNetworkAddress").suppressFor(10.0).detail("PeerAddr", lastAddress); - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (peer->lastLoggedTime <= 0.0) - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->lastLoggedTime = peer->lastConnectTime; - #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (peer && (peer->pingLatencies.getPopulationSize() >= 10 || peer->connectFailedCount > 0 || peer->timeoutCount > 0)) - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("PingLatency") .detail("Elapsed", now() - peer->lastLoggedTime) .detail("PeerAddr", lastAddress) .detail("MinLatency", peer->pingLatencies.min()) .detail("MaxLatency", peer->pingLatencies.max()) .detail("MeanLatency", peer->pingLatencies.mean()) .detail("MedianLatency", peer->pingLatencies.median()) .detail("P90Latency", peer->pingLatencies.percentile(0.90)) .detail("Count", peer->pingLatencies.getPopulationSize()) .detail("BytesReceived", peer->bytesReceived - peer->lastLoggedBytesReceived) .detail("BytesSent", peer->bytesSent - peer->lastLoggedBytesSent) .detail("TimeoutCount", peer->timeoutCount) .detail("ConnectOutgoingCount", peer->connectOutgoingCount) .detail("ConnectIncomingCount", peer->connectIncomingCount) .detail("ConnectFailedCount", peer->connectFailedCount) .detail("ConnectMinLatency", peer->connectLatencies.min()) .detail("ConnectMaxLatency", peer->connectLatencies.max()) .detail("ConnectMeanLatency", peer->connectLatencies.mean()) .detail("ConnectMedianLatency", peer->connectLatencies.median()) .detail("ConnectP90Latency", peer->connectLatencies.percentile(0.90)); - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->lastLoggedTime = now(); - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->connectOutgoingCount = 0; - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->connectIncomingCount = 0; - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->connectFailedCount = 0; - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->pingLatencies.clear(); - #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->connectLatencies.clear(); - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->lastLoggedBytesReceived = peer->bytesReceived; - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->lastLoggedBytesSent = peer->bytesSent; - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->timeoutCount = 0; - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_0 = delay(FLOW_KNOBS->PING_LOGGING_INTERVAL); - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; } else { - #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (it == self->orderedAddresses.begin()) - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_1 = delay(FLOW_KNOBS->PING_LOGGING_INTERVAL); - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; } else @@ -440,16 +511,16 @@ class PingLatencyLoggerActorState { } else { - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_2 = delay(FLOW_KNOBS->PING_LOGGING_INTERVAL); - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when3(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; } @@ -698,16 +769,16 @@ class PingLatencyLoggerActorState { fdb_probe_actor_exit("pingLatencyLogger", reinterpret_cast(this), 2); } - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TransportData* self; - #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" NetworkAddress lastAddress; - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" }; // This generated class is to be used only via pingLatencyLogger() - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class PingLatencyLoggerActor final : public Actor, public ActorCallback< PingLatencyLoggerActor, 0, Void >, public ActorCallback< PingLatencyLoggerActor, 1, Void >, public ActorCallback< PingLatencyLoggerActor, 2, Void >, public FastAllocated, public PingLatencyLoggerActorState { - #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -718,9 +789,9 @@ class PingLatencyLoggerActor final : public Actor, public ActorCallback< P friend struct ActorCallback< PingLatencyLoggerActor, 0, Void >; friend struct ActorCallback< PingLatencyLoggerActor, 1, Void >; friend struct ActorCallback< PingLatencyLoggerActor, 2, Void >; - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" PingLatencyLoggerActor(TransportData* const& self) - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" : Actor(), PingLatencyLoggerActorState(self) { @@ -746,18 +817,19 @@ friend struct ActorCallback< PingLatencyLoggerActor, 2, Void >; } }; } - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" [[nodiscard]] Future pingLatencyLogger( TransportData* const& self ) { - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return Future(new PingLatencyLoggerActor(self)); - #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } -#line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +#line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" -TransportData::TransportData(uint64_t transportId, int maxWellKnownEndpoints) - : warnAlwaysForLargePacket(true), endpoints(maxWellKnownEndpoints), endpointNotFoundReceiver(endpoints), - pingReceiver(endpoints), numIncompatibleConnections(0), lastIncompatibleMessage(0), transportId(transportId) { +TransportData::TransportData(uint64_t transportId, int maxWellKnownEndpoints, IPAllowList const* allowList) + : endpoints(maxWellKnownEndpoints), endpointNotFoundReceiver(endpoints), pingReceiver(endpoints), + numIncompatibleConnections(0), lastIncompatibleMessage(0), transportId(transportId), + allowList(allowList == nullptr ? IPAllowList() : *allowList) { degraded = makeReference>(false); pingLogger = pingLatencyLogger(this); } @@ -769,21 +841,21 @@ TransportData::TransportData(uint64_t transportId, int maxWellKnownEndpoints) struct ConnectPacket { // The value does not include the size of `connectPacketLength` itself, // but only the other fields of this structure. - uint32_t connectPacketLength; + uint32_t connectPacketLength = 0; ProtocolVersion protocolVersion; // Expect currentProtocolVersion - uint16_t canonicalRemotePort; // Port number to reconnect to the originating process - uint64_t connectionId; // Multi-version clients will use the same Id for both connections, other connections will - // set this to zero. Added at protocol Version 0x0FDB00A444020001. + uint16_t canonicalRemotePort = 0; // Port number to reconnect to the originating process + uint64_t connectionId = 0; // Multi-version clients will use the same Id for both connections, other connections + // will set this to zero. Added at protocol Version 0x0FDB00A444020001. // IP Address to reconnect to the originating process. Only one of these must be populated. - uint32_t canonicalRemoteIp4; + uint32_t canonicalRemoteIp4 = 0; enum ConnectPacketFlags { FLAG_IPV6 = 1 }; - uint16_t flags; - uint8_t canonicalRemoteIp6[16]; + uint16_t flags = 0; + uint8_t canonicalRemoteIp6[16] = { 0 }; - ConnectPacket() { memset((void*)this, 0, sizeof(*this)); } + ConnectPacket() = default; IPAddress canonicalRemoteIp() const { if (isIPv6()) { @@ -814,7 +886,7 @@ struct ConnectPacket { serializer(ar, connectPacketLength); if (connectPacketLength > sizeof(ConnectPacket) - sizeof(connectPacketLength)) { ASSERT(!g_network->isSimulated()); - TraceEvent("SerializationFailed").detail("PacketLength", connectPacketLength).backtrace(); + TraceEvent("SerializationFailed").backtrace(); throw serialization_failed(); } @@ -832,10 +904,10 @@ struct ConnectPacket { #pragma pack(pop) - #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" [[nodiscard]] static Future connectionReader( TransportData* const& transport, Reference const& conn, Reference const& peer, Promise> const& onConnected ); -#line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +#line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" static void sendLocal(TransportData* self, ISerializeSource const& what, const Endpoint& destination); static ReliablePacket* sendPacket(TransportData* self, @@ -844,23 +916,23 @@ static ReliablePacket* sendPacket(TransportData* self, const Endpoint& destination, bool reliable); - #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" namespace { // This generated class is to be used only via connectionMonitor() - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" template - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class ConnectionMonitorActorState { - #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ConnectionMonitorActorState(Reference const& peer) - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" : peer(peer), - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" remotePingEndpoint({ peer->destination }, Endpoint::wellKnownToken(WLTOKEN_PING_PACKET)) - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { fdb_probe_actor_create("connectionMonitor", reinterpret_cast(this)); @@ -873,9 +945,9 @@ class ConnectionMonitorActorState { int a_body1(int loopDepth=0) { try { - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -903,17 +975,17 @@ class ConnectionMonitorActorState { } int a_body1loopBody1(int loopDepth) { - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!FlowTransport::isClient() && !peer->destination.isPublic() && peer->compatible) - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" lastRefreshed = now(); - #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" lastBytesReceived = peer->bytesReceived; - #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1loopHead1(loopDepth); } else @@ -925,16 +997,16 @@ class ConnectionMonitorActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_1 = delay(0, TaskPriority::ReadSocket); - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -954,16 +1026,16 @@ class ConnectionMonitorActorState { } int a_body1loopBody1loopBody1(int loopDepth) { - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_0 = delay(FLOW_KNOBS->CONNECTION_MONITOR_LOOP_TIME, TaskPriority::ReadSocket); - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -983,21 +1055,21 @@ class ConnectionMonitorActorState { } int a_body1loopBody1loopBody1cont1(Void const& _,int loopDepth) { - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (lastBytesReceived < peer->bytesReceived) - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" lastRefreshed = now(); - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" lastBytesReceived = peer->bytesReceived; - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } else { - #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (lastRefreshed < now() - FLOW_KNOBS->CONNECTION_MONITOR_IDLE_TIMEOUT * FLOW_KNOBS->CONNECTION_MONITOR_INCOMING_IDLE_MULTIPLIER) - #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } @@ -1008,21 +1080,21 @@ class ConnectionMonitorActorState { } int a_body1loopBody1loopBody1cont1(Void && _,int loopDepth) { - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (lastBytesReceived < peer->bytesReceived) - #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" lastRefreshed = now(); - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" lastBytesReceived = peer->bytesReceived; - #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } else { - #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (lastRefreshed < now() - FLOW_KNOBS->CONNECTION_MONITOR_IDLE_TIMEOUT * FLOW_KNOBS->CONNECTION_MONITOR_INCOMING_IDLE_MULTIPLIER) - #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } @@ -1096,80 +1168,80 @@ class ConnectionMonitorActorState { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (peer->reliable.empty() && peer->unsent.empty() && peer->outstandingReplies == 0) - #line 1101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (peer->peerReferences == 0 && (peer->lastDataPacketSentTime < now() - FLOW_KNOBS->CONNECTION_MONITOR_UNREFERENCED_CLOSE_DELAY)) - #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1Catch1(connection_unreferenced(), std::max(0, loopDepth - 1)); - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } else { - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (FlowTransport::isClient() && peer->compatible && peer->destination.isPublic() && (peer->lastConnectTime < now() - FLOW_KNOBS->CONNECTION_MONITOR_IDLE_TIMEOUT) && (peer->lastDataPacketSentTime < now() - FLOW_KNOBS->CONNECTION_MONITOR_IDLE_TIMEOUT)) - #line 1115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1Catch1(connection_idle(), std::max(0, loopDepth - 1)); - #line 1119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } } - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_2 = delayJittered(FLOW_KNOBS->CONNECTION_MONITOR_LOOP_TIME, TaskPriority::ReadSocket); - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (peer->reliable.empty() && peer->unsent.empty() && peer->outstandingReplies == 0) - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (peer->peerReferences == 0 && (peer->lastDataPacketSentTime < now() - FLOW_KNOBS->CONNECTION_MONITOR_UNREFERENCED_CLOSE_DELAY)) - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1Catch1(connection_unreferenced(), std::max(0, loopDepth - 1)); - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } else { - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (FlowTransport::isClient() && peer->compatible && peer->destination.isPublic() && (peer->lastConnectTime < now() - FLOW_KNOBS->CONNECTION_MONITOR_IDLE_TIMEOUT) && (peer->lastDataPacketSentTime < now() - FLOW_KNOBS->CONNECTION_MONITOR_IDLE_TIMEOUT)) - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1Catch1(connection_idle(), std::max(0, loopDepth - 1)); - #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } } - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_2 = delayJittered(FLOW_KNOBS->CONNECTION_MONITOR_LOOP_TIME, TaskPriority::ReadSocket); - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1239,38 +1311,38 @@ class ConnectionMonitorActorState { } int a_body1loopBody1cont4(Void const& _,int loopDepth) { - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" pingRequest = PingRequest(); - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" FlowTransport::transport().sendUnreliable(SerializeSource(pingRequest), remotePingEndpoint, true); - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" startingBytes = peer->bytesReceived; - #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" timeouts = 0; - #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" startTime = now(); - #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1cont4loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1cont4(Void && _,int loopDepth) { - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" pingRequest = PingRequest(); - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" FlowTransport::transport().sendUnreliable(SerializeSource(pingRequest), remotePingEndpoint, true); - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" startingBytes = peer->bytesReceived; - #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" timeouts = 0; - #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" startTime = now(); - #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1cont4loopHead1(loopDepth); return loopDepth; @@ -1353,28 +1425,28 @@ class ConnectionMonitorActorState { } int a_body1loopBody1cont4loopBody1(int loopDepth) { - #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_3 = delay(FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT); - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont4loopBody1when1(__when_expr_3.get(), loopDepth); }; - #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_4 = pingRequest.reply.getFuture(); - #line 1364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont4loopBody1when2(__when_expr_4.get(), loopDepth); }; - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_5 = peer->resetPing.onTrigger(); - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont4loopBody1when3(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1400,91 +1472,91 @@ class ConnectionMonitorActorState { } int a_body1loopBody1cont4loopBody1when1(Void const& _,int loopDepth) { - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->timeoutCount++; - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (startingBytes == peer->bytesReceived) - #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (peer->destination.isPublic()) - #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->pingLatencies.addSample(now() - startTime); - #line 1415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("ConnectionTimeout").suppressFor(1.0).detail("WithAddr", peer->destination); - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1Catch1(connection_failed(), std::max(0, loopDepth - 2)); - #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (timeouts > 1) - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent(SevWarnAlways, "ConnectionSlowPing") .suppressFor(1.0) .detail("WithAddr", peer->destination) .detail("Timeouts", timeouts); - #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" startingBytes = peer->bytesReceived; - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" timeouts++; - #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1cont4loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1cont4loopBody1when1(Void && _,int loopDepth) { - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->timeoutCount++; - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (startingBytes == peer->bytesReceived) - #line 1446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (peer->destination.isPublic()) - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->pingLatencies.addSample(now() - startTime); - #line 1454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("ConnectionTimeout").suppressFor(1.0).detail("WithAddr", peer->destination); - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1Catch1(connection_failed(), std::max(0, loopDepth - 2)); - #line 1460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (timeouts > 1) - #line 1464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent(SevWarnAlways, "ConnectionSlowPing") .suppressFor(1.0) .detail("WithAddr", peer->destination) .detail("Timeouts", timeouts); - #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" startingBytes = peer->bytesReceived; - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" timeouts++; - #line 1474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1cont4loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1cont4loopBody1when2(Void const& _,int loopDepth) { - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (peer->destination.isPublic()) - #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->pingLatencies.addSample(now() - startTime); - #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } return a_body1loopBody1cont4break1(loopDepth==0?0:loopDepth-1); // break @@ -1492,13 +1564,13 @@ class ConnectionMonitorActorState { } int a_body1loopBody1cont4loopBody1when2(Void && _,int loopDepth) { - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (peer->destination.isPublic()) - #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->pingLatencies.addSample(now() - startTime); - #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } return a_body1loopBody1cont4break1(loopDepth==0?0:loopDepth-1); // break @@ -1659,28 +1731,28 @@ class ConnectionMonitorActorState { fdb_probe_actor_exit("connectionMonitor", reinterpret_cast(this), 5); } - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Reference peer; - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Endpoint remotePingEndpoint; - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" double lastRefreshed; - #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" int64_t lastBytesReceived; - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" PingRequest pingRequest; - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" int64_t startingBytes; - #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" int timeouts; - #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" double startTime; - #line 1678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" }; // This generated class is to be used only via connectionMonitor() - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class ConnectionMonitorActor final : public Actor, public ActorCallback< ConnectionMonitorActor, 0, Void >, public ActorCallback< ConnectionMonitorActor, 1, Void >, public ActorCallback< ConnectionMonitorActor, 2, Void >, public ActorCallback< ConnectionMonitorActor, 3, Void >, public ActorCallback< ConnectionMonitorActor, 4, Void >, public ActorCallback< ConnectionMonitorActor, 5, Void >, public FastAllocated, public ConnectionMonitorActorState { - #line 1683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1694,9 +1766,9 @@ friend struct ActorCallback< ConnectionMonitorActor, 2, Void >; friend struct ActorCallback< ConnectionMonitorActor, 3, Void >; friend struct ActorCallback< ConnectionMonitorActor, 4, Void >; friend struct ActorCallback< ConnectionMonitorActor, 5, Void >; - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ConnectionMonitorActor(Reference const& peer) - #line 1699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" : Actor(), ConnectionMonitorActorState(peer) { @@ -1723,34 +1795,34 @@ friend struct ActorCallback< ConnectionMonitorActor, 5, Void >; } }; } - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" [[nodiscard]] Future connectionMonitor( Reference const& peer ) { - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return Future(new ConnectionMonitorActor(peer)); - #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } -#line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +#line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 1735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" namespace { // This generated class is to be used only via connectionWriter() - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" template - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class ConnectionWriterActorState { - #line 1742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ConnectionWriterActorState(Reference const& self,Reference const& conn) - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" : self(self), - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" conn(conn), - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" lastWriteTime(now()) - #line 1753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { fdb_probe_actor_create("connectionWriter", reinterpret_cast(this)); @@ -1763,9 +1835,9 @@ class ConnectionWriterActorState { int a_body1(int loopDepth=0) { try { - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 1768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1793,34 +1865,34 @@ class ConnectionWriterActorState { } int a_body1loopBody1(int loopDepth) { - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_0 = delayJittered( std::max(FLOW_KNOBS->MIN_COALESCE_DELAY, FLOW_KNOBS->MAX_COALESCE_DELAY - (now() - lastWriteTime)), TaskPriority::WriteSocket); - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 1823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); return loopDepth; @@ -1890,9 +1962,9 @@ class ConnectionWriterActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1cont2loopHead1(loopDepth); return loopDepth; @@ -1906,40 +1978,40 @@ class ConnectionWriterActorState { } int a_body1loopBody1cont1loopBody1(int loopDepth) { - #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" lastWriteTime = now(); - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" int sent = conn->write(self->unsent.getUnsent(), FLOW_KNOBS->MAX_PACKET_SEND_BYTES); - #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (sent) - #line 1915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->bytesSent += sent; - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->transport->bytesSent += sent; - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->unsent.sent(sent); - #line 1923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (self->unsent.empty()) - #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - TEST(true); - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + CODE_PROBE( true, "We didn't write everything, so apparently the write buffer is full. Wait for it to be nonfull"); + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_1 = conn->onWritable(); - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 1937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1959,32 +2031,32 @@ class ConnectionWriterActorState { } int a_body1loopBody1cont1loopBody1cont1(Void const& _,int loopDepth) { - #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_2 = yield(TaskPriority::WriteSocket); - #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 1966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1loopBody1cont1(Void && _,int loopDepth) { - #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_2 = yield(TaskPriority::WriteSocket); - #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2142,22 +2214,22 @@ class ConnectionWriterActorState { } int a_body1loopBody1cont2loopBody1(int loopDepth) { - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!(self->unsent.empty())) - #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { return a_body1loopBody1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_3 = self->dataToSend.onTrigger(); - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 2155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont2loopBody1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2250,18 +2322,18 @@ class ConnectionWriterActorState { fdb_probe_actor_exit("connectionWriter", reinterpret_cast(this), 3); } - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Reference self; - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Reference conn; - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" double lastWriteTime; - #line 2259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" }; // This generated class is to be used only via connectionWriter() - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class ConnectionWriterActor final : public Actor, public ActorCallback< ConnectionWriterActor, 0, Void >, public ActorCallback< ConnectionWriterActor, 1, Void >, public ActorCallback< ConnectionWriterActor, 2, Void >, public ActorCallback< ConnectionWriterActor, 3, Void >, public FastAllocated, public ConnectionWriterActorState { - #line 2264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2273,9 +2345,9 @@ friend struct ActorCallback< ConnectionWriterActor, 0, Void >; friend struct ActorCallback< ConnectionWriterActor, 1, Void >; friend struct ActorCallback< ConnectionWriterActor, 2, Void >; friend struct ActorCallback< ConnectionWriterActor, 3, Void >; - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ConnectionWriterActor(Reference const& self,Reference const& conn) - #line 2278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" : Actor(), ConnectionWriterActorState(self, conn) { @@ -2302,34 +2374,34 @@ friend struct ActorCallback< ConnectionWriterActor, 3, Void >; } }; } - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" [[nodiscard]] Future connectionWriter( Reference const& self, Reference const& conn ) { - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return Future(new ConnectionWriterActor(self, conn)); - #line 2309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } -#line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +#line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 2314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" namespace { // This generated class is to be used only via delayedHealthUpdate() - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" template - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class DelayedHealthUpdateActorState { - #line 2321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" DelayedHealthUpdateActorState(NetworkAddress const& address,bool* const& tooManyConnectionsClosed) - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" : address(address), - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" tooManyConnectionsClosed(tooManyConnectionsClosed), - #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" start(now()) - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { fdb_probe_actor_create("delayedHealthUpdate", reinterpret_cast(this)); @@ -2342,9 +2414,9 @@ class DelayedHealthUpdateActorState { int a_body1(int loopDepth=0) { try { - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 2347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2365,9 +2437,9 @@ class DelayedHealthUpdateActorState { } int a_body1cont1(int loopDepth) { - #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DelayedHealthUpdateActorState(); static_cast(this)->destroy(); return 0; } - #line 2370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DelayedHealthUpdateActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2384,37 +2456,37 @@ class DelayedHealthUpdateActorState { } int a_body1loopBody1(int loopDepth) { - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (FLOW_KNOBS->HEALTH_MONITOR_MARK_FAILED_UNSTABLE_CONNECTIONS && FlowTransport::transport().healthMonitor()->tooManyConnectionsClosed(address) && address.isPublic()) - #line 2389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_0 = delayJittered(FLOW_KNOBS->MAX_RECONNECTION_TIME * 2.0); - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; } else { - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (*tooManyConnectionsClosed) - #line 2407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("TooManyConnectionsClosedMarkAvailable") .detail("Dest", address) .detail("StartTime", start) .detail("TimeElapsed", now() - start) .detail("ClosedCount", FlowTransport::transport().healthMonitor()->closedConnectionsCount(address)); - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" *tooManyConnectionsClosed = false; - #line 2413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" IFailureMonitor::failureMonitor().setStatus(address, FailureStatus(false)); - #line 2417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" return a_body1break1(loopDepth==0?0:loopDepth-1); // break } @@ -2514,18 +2586,18 @@ class DelayedHealthUpdateActorState { fdb_probe_actor_exit("delayedHealthUpdate", reinterpret_cast(this), 0); } - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" NetworkAddress address; - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" bool* tooManyConnectionsClosed; - #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" double start; - #line 2523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" }; // This generated class is to be used only via delayedHealthUpdate() - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class DelayedHealthUpdateActor final : public Actor, public ActorCallback< DelayedHealthUpdateActor, 0, Void >, public FastAllocated, public DelayedHealthUpdateActorState { - #line 2528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2534,9 +2606,9 @@ class DelayedHealthUpdateActor final : public Actor, public ActorCallback< void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< DelayedHealthUpdateActor, 0, Void >; - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" DelayedHealthUpdateActor(NetworkAddress const& address,bool* const& tooManyConnectionsClosed) - #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" : Actor(), DelayedHealthUpdateActorState(address, tooManyConnectionsClosed) { @@ -2560,34 +2632,34 @@ friend struct ActorCallback< DelayedHealthUpdateActor, 0, Void >; } }; } - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" [[nodiscard]] Future delayedHealthUpdate( NetworkAddress const& address, bool* const& tooManyConnectionsClosed ) { - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return Future(new DelayedHealthUpdateActor(address, tooManyConnectionsClosed)); - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } -#line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +#line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" namespace { // This generated class is to be used only via connectionKeeper() - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" template - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class ConnectionKeeperActorState { - #line 2579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ConnectionKeeperActorState(Reference const& self,Reference const& conn = Reference(),Future const& reader = Void()) - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" : self(self), - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" conn(conn), - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" reader(reader) - #line 2590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { fdb_probe_actor_create("connectionKeeper", reinterpret_cast(this)); @@ -2600,21 +2672,21 @@ class ConnectionKeeperActorState { int a_body1(int loopDepth=0) { try { - #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent(SevDebug, "ConnectionKeeper", conn ? conn->getDebugID() : UID()) .detail("PeerAddr", self->destination) .detail("ConnSet", (bool)conn); - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ASSERT_WE_THINK(FlowTransport::transport().getLocalAddress() != self->destination); - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" delayedHealthUpdateF = Future(); - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" firstConnFailedTime = Optional(); - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" retryConnect = false; - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" tooManyConnectionsClosed = false; - #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 2617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2643,26 +2715,26 @@ class ConnectionKeeperActorState { int a_body1loopBody1(int loopDepth) { try { - #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" delayedHealthUpdateF = Future(); - #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!conn) - #line 2650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->outgoingConnectionIdle = true; - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 2656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1loopHead1(loopDepth); } else { - #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->outgoingConnectionIdle = false; - #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->lastConnectTime = now(); - #line 2665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1cont2(loopDepth); } } @@ -2683,189 +2755,191 @@ class ConnectionKeeperActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + self->connected = false; + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" delayedHealthUpdateF.cancel(); - #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (now() - self->lastConnectTime > FLOW_KNOBS->RECONNECTION_RESET_TIME) - #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->reconnectionDelay = FLOW_KNOBS->INITIAL_RECONNECTION_TIME; - #line 2694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } else { - #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->reconnectionDelay = std::min(FLOW_KNOBS->MAX_RECONNECTION_TIME, self->reconnectionDelay * FLOW_KNOBS->RECONNECTION_TIME_GROWTH_RATE); - #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (firstConnFailedTime.present()) - #line 2704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (now() - firstConnFailedTime.get() > FLOW_KNOBS->PEER_UNAVAILABLE_FOR_LONG_TIME_TIMEOUT) - #line 2708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent(SevWarnAlways, "PeerUnavailableForLongTime", conn ? conn->getDebugID() : UID()) .suppressFor(1.0) .detail("PeerAddr", self->destination); - #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" firstConnFailedTime = now() - FLOW_KNOBS->PEER_UNAVAILABLE_FOR_LONG_TIME_TIMEOUT / 2.0; - #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } else { - #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" firstConnFailedTime = now(); - #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" retryConnect = true; - #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (e.code() == error_code_connection_failed) - #line 2727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!self->destination.isPublic()) - #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" IFailureMonitor::failureMonitor().setStatus(self->destination, FailureStatus(true)); - #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } else { - #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (now() - firstConnFailedTime.get() > FLOW_KNOBS->FAILURE_DETECTION_DELAY) - #line 2741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" IFailureMonitor::failureMonitor().setStatus(self->destination, FailureStatus(true)); - #line 2745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } } - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->discardUnreliablePackets(); - #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" reader = Future(); - #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" bool ok = e.code() == error_code_connection_failed || e.code() == error_code_actor_cancelled || e.code() == error_code_connection_unreferenced || e.code() == error_code_connection_idle || (g_network->isSimulated() && e.code() == error_code_checksum_failed); - #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (self->compatible) - #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent(ok ? SevInfo : SevWarnAlways, "ConnectionClosed", conn ? conn->getDebugID() : UID()) .errorUnsuppressed(e) .suppressFor(1.0) .detail("PeerAddr", self->destination); - #line 2761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } else { - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent( ok ? SevInfo : SevWarnAlways, "IncompatibleConnectionClosed", conn ? conn->getDebugID() : UID()) .errorUnsuppressed(e) .suppressFor(1.0) .detail("PeerAddr", self->destination); - #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - self->incompatibleProtocolVersionNewer = false; - #line 2769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + self->compatible = true; + #line 2843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (self->destination.isPublic() && IFailureMonitor::failureMonitor().getState(self->destination).isAvailable() && !FlowTransport::isClient()) - #line 2773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" auto& it = self->transport->closedPeers[self->destination]; - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (now() - it.second > FLOW_KNOBS->TOO_MANY_CONNECTIONS_CLOSED_RESET_DELAY) - #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" it.first = now(); - #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } else { - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (now() - it.first > FLOW_KNOBS->TOO_MANY_CONNECTIONS_CLOSED_TIMEOUT) - #line 2789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent(SevWarnAlways, "TooManyConnectionsClosed", conn ? conn->getDebugID() : UID()) .suppressFor(5.0) .detail("PeerAddr", self->destination); - #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->transport->degraded->set(true); - #line 2795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" it.second = now(); - #line 2800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (conn) - #line 2804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (self->destination.isPublic() && e.code() == error_code_connection_failed) - #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" FlowTransport::transport().healthMonitor()->reportPeerClosed(self->destination); - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (FLOW_KNOBS->HEALTH_MONITOR_MARK_FAILED_UNSTABLE_CONNECTIONS && FlowTransport::transport().healthMonitor()->tooManyConnectionsClosed(self->destination) && self->destination.isPublic()) - #line 2814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("TooManyConnectionsClosedMarkFailed") .detail("Dest", self->destination) .detail( "ClosedCount", FlowTransport::transport().healthMonitor()->closedConnectionsCount(self->destination)); - #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" tooManyConnectionsClosed = true; - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" IFailureMonitor::failureMonitor().setStatus(self->destination, FailureStatus(true)); - #line 2822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" conn->close(); - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" conn = Reference(); - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (e.code() != error_code_incompatible_protocol_version) - #line 2831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->protocolVersion->set(Optional()); - #line 2835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" IFailureMonitor::failureMonitor().notifyDisconnect(self->destination); - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Promise disconnect = self->disconnect; - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->disconnect = Promise(); - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" disconnect.send(Void()); - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (e.code() == error_code_actor_cancelled) - #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 2852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (self->peerReferences <= 0 && self->reliable.empty() && self->unsent.empty() && self->outstandingReplies == 0) - #line 2856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("PeerDestroy").errorUnsuppressed(e).suppressFor(1.0).detail("PeerAddr", self->destination); - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->connect.cancel(); - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->transport->peers.erase(self->destination); - #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->transport->orderedAddresses.erase(self->destination); - #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ConnectionKeeperActorState(); static_cast(this)->destroy(); return 0; } - #line 2868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ConnectionKeeperActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2883,30 +2957,32 @@ class ConnectionKeeperActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" firstConnFailedTime.reset(); - #line 2888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" try { - #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->transport->countConnEstablished++; - #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!delayedHealthUpdateF.isValid()) - #line 2894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" delayedHealthUpdateF = delayedHealthUpdate(self->destination, &tooManyConnectionsClosed); - #line 2898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + self->connected = true; + #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_8 = connectionWriter(self, conn) || reader || connectionMonitor(self) || self->resetConnection.onTrigger(); - #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont2Catch1(actor_cancelled(), loopDepth); - #line 2904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1loopBody1cont2Catch1(__when_expr_8.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_8.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 2985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2919,20 +2995,20 @@ class ConnectionKeeperActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ASSERT(self->destination.isPublic()); - #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->outgoingConnectionIdle = false; - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_2 = delayJittered(std::max(0.0, self->lastConnectTime + self->reconnectionDelay - now())); - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2946,38 +3022,38 @@ class ConnectionKeeperActorState { } int a_body1loopBody1loopBody1(int loopDepth) { - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!(self->unsent.empty())) - #line 2951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Future retryConnectF = Never(); - #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (retryConnect) - #line 2959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" retryConnectF = IFailureMonitor::failureMonitor().getState(self->destination).isAvailable() ? delay(FLOW_KNOBS->FAILURE_DETECTION_DELAY) : delay(FLOW_KNOBS->SERVER_REQUEST_INTERVAL); - #line 2963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_0 = self->dataToSend.onTrigger(); - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_1 = retryConnectF; - #line 2973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3124,30 +3200,30 @@ class ConnectionKeeperActorState { } int a_body1loopBody1cont4(Void const& _,int loopDepth) { - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->lastConnectTime = now(); - #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("ConnectingTo", conn ? conn->getDebugID() : UID()) .suppressFor(1.0) .detail("PeerAddr", self->destination) .detail("PeerReferences", self->peerReferences) .detail("FailureStatus", IFailureMonitor::failureMonitor().getState(self->destination).isAvailable() ? "OK" : "FAILED"); - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ++self->connectOutgoingCount; - #line 3133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" try { - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture> __when_expr_3 = INetworkConnections::net()->connect(self->destination); - #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont4Catch1(actor_cancelled(), loopDepth); - #line 3139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1cont4Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_4 = delay(FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT); - #line 3143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1cont4Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont4when2(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3160,30 +3236,30 @@ class ConnectionKeeperActorState { } int a_body1loopBody1cont4(Void && _,int loopDepth) { - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->lastConnectTime = now(); - #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("ConnectingTo", conn ? conn->getDebugID() : UID()) .suppressFor(1.0) .detail("PeerAddr", self->destination) .detail("PeerReferences", self->peerReferences) .detail("FailureStatus", IFailureMonitor::failureMonitor().getState(self->destination).isAvailable() ? "OK" : "FAILED"); - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ++self->connectOutgoingCount; - #line 3169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" try { - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture> __when_expr_3 = INetworkConnections::net()->connect(self->destination); - #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont4Catch1(actor_cancelled(), loopDepth); - #line 3175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1loopBody1cont4Catch1(__when_expr_3.getError(), loopDepth); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_4 = delay(FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT); - #line 3179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1loopBody1cont4Catch1(__when_expr_4.getError(), loopDepth); else return a_body1loopBody1cont4when2(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3266,21 +3342,21 @@ class ConnectionKeeperActorState { int a_body1loopBody1cont4Catch1(const Error& e,int loopDepth=0) { try { - #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ++self->connectFailedCount; - #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (e.code() != error_code_connection_failed) - #line 3273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1loopBody1Catch1(e, loopDepth); - #line 3277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("ConnectionTimedOut", conn ? conn->getDebugID() : UID()) .suppressFor(1.0) .detail("PeerAddr", self->destination); - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1loopBody1Catch1(e, loopDepth); - #line 3283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1loopBody1Catch1(error, loopDepth); @@ -3298,53 +3374,53 @@ class ConnectionKeeperActorState { } int a_body1loopBody1cont4when1(Reference const& _conn,int loopDepth) { - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" conn = _conn; - #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_5 = conn->connectHandshake(); - #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont4Catch1(actor_cancelled(), loopDepth); - #line 3307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1cont4Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont4when1when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont4when1(Reference && _conn,int loopDepth) { - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" conn = _conn; - #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_5 = conn->connectHandshake(); - #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont4Catch1(actor_cancelled(), loopDepth); - #line 3325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1loopBody1cont4Catch1(__when_expr_5.getError(), loopDepth); else return a_body1loopBody1cont4when1when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont4when2(Void const& _,int loopDepth) { - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1loopBody1cont4Catch1(connection_failed(), loopDepth); - #line 3339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" return loopDepth; } int a_body1loopBody1cont4when2(Void && _,int loopDepth) { - #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1loopBody1cont4Catch1(connection_failed(), loopDepth); - #line 3347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" return loopDepth; } @@ -3357,38 +3433,38 @@ class ConnectionKeeperActorState { } int a_body1loopBody1cont4when1cont1(Void const& _,int loopDepth) { - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->connectLatencies.addSample(now() - self->lastConnectTime); - #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (FlowTransport::isClient()) - #line 3364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" IFailureMonitor::failureMonitor().setStatus(self->destination, FailureStatus(false)); - #line 3368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (self->unsent.empty()) - #line 3372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" delayedHealthUpdateF = delayedHealthUpdate(self->destination, &tooManyConnectionsClosed); - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_6 = delayedHealthUpdateF; - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont4Catch1(actor_cancelled(), loopDepth); - #line 3380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1loopBody1cont4Catch1(__when_expr_6.getError(), loopDepth); else return a_body1loopBody1cont4when1cont1when1(__when_expr_6.get(), loopDepth); }; - #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_7 = self->dataToSend.onTrigger(); - #line 3384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1loopBody1cont4Catch1(__when_expr_7.getError(), loopDepth); else return a_body1loopBody1cont4when1cont1when2(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; } else @@ -3400,38 +3476,38 @@ class ConnectionKeeperActorState { } int a_body1loopBody1cont4when1cont1(Void && _,int loopDepth) { - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->connectLatencies.addSample(now() - self->lastConnectTime); - #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (FlowTransport::isClient()) - #line 3407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" IFailureMonitor::failureMonitor().setStatus(self->destination, FailureStatus(false)); - #line 3411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (self->unsent.empty()) - #line 3415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" delayedHealthUpdateF = delayedHealthUpdate(self->destination, &tooManyConnectionsClosed); - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_6 = delayedHealthUpdateF; - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont4Catch1(actor_cancelled(), loopDepth); - #line 3423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1loopBody1cont4Catch1(__when_expr_6.getError(), loopDepth); else return a_body1loopBody1cont4when1cont1when1(__when_expr_6.get(), loopDepth); }; - #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_7 = self->dataToSend.onTrigger(); - #line 3427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1loopBody1cont4Catch1(__when_expr_7.getError(), loopDepth); else return a_body1loopBody1cont4when1cont1when2(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; } else @@ -3506,13 +3582,13 @@ class ConnectionKeeperActorState { } int a_body1loopBody1cont4when1cont2(int loopDepth) { - #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("ConnectionExchangingConnectPacket", conn->getDebugID()) .suppressFor(1.0) .detail("PeerAddr", self->destination); - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->prependConnectPacket(); - #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" reader = connectionReader(self->transport, conn, self, Promise>()); - #line 3515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; @@ -3525,26 +3601,26 @@ class ConnectionKeeperActorState { } int a_body1loopBody1cont4when1cont1when1(Void const& _,int loopDepth) { - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" conn->close(); - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" conn = Reference(); - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" retryConnect = false; - #line 3534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" return a_body1loopHead1(loopDepth); // continue return loopDepth; } int a_body1loopBody1cont4when1cont1when1(Void && _,int loopDepth) { - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" conn->close(); - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" conn = Reference(); - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" retryConnect = false; - #line 3547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" return a_body1loopHead1(loopDepth); // continue return loopDepth; @@ -3764,23 +3840,23 @@ class ConnectionKeeperActorState { int a_body1loopBody1cont2Catch1(const Error& e,int loopDepth=0) { try { - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (e.code() == error_code_connection_failed || e.code() == error_code_actor_cancelled || e.code() == error_code_connection_unreferenced || (g_network->isSimulated() && e.code() == error_code_checksum_failed)) - #line 3769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->transport->countConnClosedWithoutError++; - #line 3773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } else { - #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->transport->countConnClosedWithError++; - #line 3779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1loopBody1Catch1(e, loopDepth); - #line 3783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1loopBody1Catch1(error, loopDepth); @@ -3792,21 +3868,21 @@ class ConnectionKeeperActorState { } int a_body1loopBody1cont10(Void const& _,int loopDepth) { - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("ConnectionReset", conn ? conn->getDebugID() : UID()) .suppressFor(1.0) .detail("PeerAddr", self->destination); - #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1loopBody1cont2Catch1(connection_failed(), loopDepth); - #line 3799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" return loopDepth; } int a_body1loopBody1cont10(Void && _,int loopDepth) { - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("ConnectionReset", conn ? conn->getDebugID() : UID()) .suppressFor(1.0) .detail("PeerAddr", self->destination); - #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1loopBody1cont2Catch1(connection_failed(), loopDepth); - #line 3809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" return loopDepth; } @@ -3873,26 +3949,26 @@ class ConnectionKeeperActorState { fdb_probe_actor_exit("connectionKeeper", reinterpret_cast(this), 8); } - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Reference self; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Reference conn; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Future reader; - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Future delayedHealthUpdateF; - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Optional firstConnFailedTime; - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" int retryConnect; - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" bool tooManyConnectionsClosed; - #line 3890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" }; // This generated class is to be used only via connectionKeeper() - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class ConnectionKeeperActor final : public Actor, public ActorCallback< ConnectionKeeperActor, 0, Void >, public ActorCallback< ConnectionKeeperActor, 1, Void >, public ActorCallback< ConnectionKeeperActor, 2, Void >, public ActorCallback< ConnectionKeeperActor, 3, Reference >, public ActorCallback< ConnectionKeeperActor, 5, Void >, public ActorCallback< ConnectionKeeperActor, 6, Void >, public ActorCallback< ConnectionKeeperActor, 7, Void >, public ActorCallback< ConnectionKeeperActor, 4, Void >, public ActorCallback< ConnectionKeeperActor, 8, Void >, public FastAllocated, public ConnectionKeeperActorState { - #line 3895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3909,9 +3985,9 @@ friend struct ActorCallback< ConnectionKeeperActor, 6, Void >; friend struct ActorCallback< ConnectionKeeperActor, 7, Void >; friend struct ActorCallback< ConnectionKeeperActor, 4, Void >; friend struct ActorCallback< ConnectionKeeperActor, 8, Void >; - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ConnectionKeeperActor(Reference const& self,Reference const& conn = Reference(),Future const& reader = Void()) - #line 3914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 3990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" : Actor(), ConnectionKeeperActorState(self, conn, reader) { @@ -3940,24 +4016,24 @@ friend struct ActorCallback< ConnectionKeeperActor, 8, Void >; } }; } - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" [[nodiscard]] Future connectionKeeper( Reference const& self, Reference const& conn = Reference(), Future const& reader = Void() ) { - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return Future(new ConnectionKeeperActor(self, conn, reader)); - #line 3947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } -#line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +#line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Peer::Peer(TransportData* transport, NetworkAddress const& destination) - : transport(transport), destination(destination), compatible(true), outgoingConnectionIdle(true), + : transport(transport), destination(destination), compatible(true), connected(false), outgoingConnectionIdle(true), lastConnectTime(0.0), reconnectionDelay(FLOW_KNOBS->INITIAL_RECONNECTION_TIME), peerReferences(-1), - incompatibleProtocolVersionNewer(false), bytesReceived(0), bytesSent(0), lastDataPacketSentTime(now()), - outstandingReplies(0), pingLatencies(destination.isPublic() ? FLOW_KNOBS->PING_SAMPLE_AMOUNT : 1), - lastLoggedTime(0.0), lastLoggedBytesReceived(0), lastLoggedBytesSent(0), timeoutCount(0), + bytesReceived(0), bytesSent(0), lastDataPacketSentTime(now()), outstandingReplies(0), + pingLatencies(destination.isPublic() ? FLOW_KNOBS->PING_SKETCH_ACCURACY : 0.1), lastLoggedTime(0.0), + lastLoggedBytesReceived(0), lastLoggedBytesSent(0), timeoutCount(0), protocolVersion(Reference>>(new AsyncVar>())), connectOutgoingCount(0), connectIncomingCount(0), connectFailedCount(0), - connectLatencies(destination.isPublic() ? FLOW_KNOBS->NETWORK_CONNECT_SAMPLE_AMOUNT : 1) { + connectLatencies(destination.isPublic() ? FLOW_KNOBS->PING_SKETCH_ACCURACY : 0.1) { IFailureMonitor::failureMonitor().setStatus(destination, FailureStatus(false)); } @@ -3972,12 +4048,12 @@ void Peer::send(PacketBuffer* pb, ReliablePacket* rp, bool firstUnsent) { void Peer::prependConnectPacket() { // Send the ConnectPacket expected at the beginning of a new connection ConnectPacket pkt; - if (transport->localAddresses.address.isTLS() == destination.isTLS()) { - pkt.canonicalRemotePort = transport->localAddresses.address.port; - pkt.setCanonicalRemoteIp(transport->localAddresses.address.ip); - } else if (transport->localAddresses.secondaryAddress.present()) { - pkt.canonicalRemotePort = transport->localAddresses.secondaryAddress.get().port; - pkt.setCanonicalRemoteIp(transport->localAddresses.secondaryAddress.get().ip); + if (transport->localAddresses.getAddressList().address.isTLS() == destination.isTLS()) { + pkt.canonicalRemotePort = transport->localAddresses.getAddressList().address.port; + pkt.setCanonicalRemoteIp(transport->localAddresses.getAddressList().address.ip); + } else if (transport->localAddresses.getAddressList().secondaryAddress.present()) { + pkt.canonicalRemotePort = transport->localAddresses.getAddressList().secondaryAddress.get().port; + pkt.setCanonicalRemoteIp(transport->localAddresses.getAddressList().secondaryAddress.get().ip); } else { // a "mixed" TLS/non-TLS connection is like a client/server connection - there's no way to reverse it pkt.canonicalRemotePort = 0; @@ -3989,10 +4065,20 @@ void Peer::prependConnectPacket() { pkt.protocolVersion.addObjectSerializerFlag(); pkt.connectionId = transport->transportId; - PacketBuffer* pb_first = PacketBuffer::create(); + PacketBuffer *pb_first = PacketBuffer::create(), *pb_end = nullptr; PacketWriter wr(pb_first, nullptr, Unversioned()); pkt.serialize(wr); - unsent.prependWriteBuffer(pb_first, wr.finish()); + pb_end = wr.finish(); +#if VALGRIND + SendBuffer* checkbuf = pb_first; + while (checkbuf) { + int size = checkbuf->bytes_written; + const uint8_t* data = checkbuf->data(); + VALGRIND_CHECK_MEM_IS_DEFINED(data, size); + checkbuf = checkbuf->next; + } +#endif + unsent.prependWriteBuffer(pb_first, pb_end); } void Peer::discardUnreliablePackets() { @@ -4014,20 +4100,21 @@ void Peer::onIncomingConnection(Reference self, Reference con ++self->connectIncomingCount; if (!destination.isPublic() && !outgoingConnectionIdle) throw address_in_use(); - NetworkAddress compatibleAddr = transport->localAddresses.address; - if (transport->localAddresses.secondaryAddress.present() && - transport->localAddresses.secondaryAddress.get().isTLS() == destination.isTLS()) { - compatibleAddr = transport->localAddresses.secondaryAddress.get(); + NetworkAddress compatibleAddr = transport->localAddresses.getAddressList().address; + if (transport->localAddresses.getAddressList().secondaryAddress.present() && + transport->localAddresses.getAddressList().secondaryAddress.get().isTLS() == destination.isTLS()) { + compatibleAddr = transport->localAddresses.getAddressList().secondaryAddress.get(); } if (!destination.isPublic() || outgoingConnectionIdle || destination > compatibleAddr || (lastConnectTime > 1.0 && now() - lastConnectTime > FLOW_KNOBS->ALWAYS_ACCEPT_DELAY)) { // Keep the new connection - TraceEvent("IncomingConnection", conn->getDebugID()) + TraceEvent("IncomingConnection"_audit, conn->getDebugID()) .suppressFor(1.0) .detail("FromAddr", conn->getPeerAddress()) .detail("CanonicalAddr", destination) - .detail("IsPublic", destination.isPublic()); + .detail("IsPublic", destination.isPublic()) + .detail("Trusted", self->transport->allowList(conn->getPeerAddress().ip) && conn->hasTrustedPeer()); connect.cancel(); prependConnectPacket(); @@ -4070,31 +4157,35 @@ static bool checkCompatible(const PeerCompatibilityPolicy& policy, ProtocolVersi // This actor looks up the task associated with an endpoint // and sends the message to it. The actual deserialization will // be done by that task (see NetworkMessageReceiver). - #line 4073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" namespace { // This generated class is to be used only via deliver() - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" template - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class DeliverActorState { - #line 4080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - DeliverActorState(TransportData* const& self,Endpoint const& destination,TaskPriority const& priority,ArenaReader const& reader,bool const& inReadSocket,Future const& disconnect) - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + DeliverActorState(TransportData* const& self,Endpoint const& destination,TaskPriority const& priority,ArenaReader const& reader,NetworkAddress const& peerAddress,bool const& isTrustedPeer,InReadSocket const& inReadSocket,Future const& disconnect) + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" : self(self), - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" destination(destination), - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" priority(priority), - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" reader(reader), - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + peerAddress(peerAddress), + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + isTrustedPeer(isTrustedPeer), + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" inReadSocket(inReadSocket), - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" disconnect(disconnect) - #line 4097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { fdb_probe_actor_create("deliver", reinterpret_cast(this)); @@ -4107,26 +4198,26 @@ class DeliverActorState { int a_body1(int loopDepth=0) { try { - #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (priority < TaskPriority::ReadSocket || !inReadSocket) - #line 4112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_0 = orderedDelay(0, priority); - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 4118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" static_cast(this)->actor_wait_state = 1; - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; } else { - #line 951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" g_network->setCurrentTask(priority); - #line 4129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); } } @@ -4147,39 +4238,47 @@ class DeliverActorState { } int a_body1cont1(int loopDepth) { - #line 954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" auto receiver = self->endpoints.get(destination.token); - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - if (receiver) - #line 4154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (receiver && (isTrustedPeer || receiver->isPublic())) + #line 4245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!checkCompatible(receiver->peerCompatibilityPolicy(), reader.protocolVersion())) - #line 4158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" delete static_cast(this); - #line 4162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" return 0; } try { - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + ASSERT(g_currentDeliveryPeerAddress == NetworkAddressList()); + #line 1048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + ASSERT(!g_currentDeliverPeerAddressTrusted); + #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" g_currentDeliveryPeerAddress = destination.addresses; - #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + g_currentDeliverPeerAddressTrusted = isTrustedPeer; + #line 1051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" g_currentDeliveryPeerDisconnect = disconnect; - #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StringRef data = reader.arenaReadAll(); - #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ASSERT(data.size() > 8); - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ArenaObjectReader objReader(reader.arena(), reader.arenaReadAll(), AssumeVersion(reader.protocolVersion())); - #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" receiver->receive(objReader); - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - g_currentDeliveryPeerAddress = { NetworkAddress() }; - #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + g_currentDeliveryPeerAddress = NetworkAddressList(); + #line 1057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + g_currentDeliverPeerAddressTrusted = false; + #line 1058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" g_currentDeliveryPeerDisconnect = Future(); - #line 4182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1cont8(loopDepth); } catch (Error& error) { @@ -4190,29 +4289,46 @@ class DeliverActorState { } else { - #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (destination.token.first() & TOKEN_STREAM_FLAG) - #line 4195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - if (destination.token.first() != -1) - #line 4199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (receiver) + #line 4298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - if (self->isLocalAddress(destination.getPrimaryAddress())) - #line 4203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" - { - #line 984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - sendLocal(self, SerializeSource(destination.token), Endpoint::wellKnown(destination.addresses, WLTOKEN_ENDPOINT_NOT_FOUND)); - #line 4207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" - } - else + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + TraceEvent(SevWarnAlways, "AttemptedRPCToPrivatePrevented"_audit) .detail("From", peerAddress) .detail("Token", destination.token) .detail("Receiver", typeid(*receiver).name()); + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + ASSERT(!self->isLocalAddress(destination.getPrimaryAddress())); + #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + Reference peer = self->getOrOpenPeer(destination.getPrimaryAddress()); + #line 1081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + sendPacket(self, peer, SerializeSource(destination.token), Endpoint::wellKnown(destination.addresses, WLTOKEN_UNAUTHORIZED_ENDPOINT), false); + #line 4308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + } + else + { + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (destination.token.first() != -1) + #line 4314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - Reference peer = self->getOrOpenPeer(destination.getPrimaryAddress()); - #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - sendPacket(self, peer, SerializeSource(destination.token), Endpoint::wellKnown(destination.addresses, WLTOKEN_ENDPOINT_NOT_FOUND), false); - #line 4215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (self->isLocalAddress(destination.getPrimaryAddress())) + #line 4318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + { + #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + sendLocal(self, SerializeSource(destination.token), Endpoint::wellKnown(destination.addresses, WLTOKEN_ENDPOINT_NOT_FOUND)); + #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + } + else + { + #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + Reference peer = self->getOrOpenPeer(destination.getPrimaryAddress()); + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + sendPacket(self, peer, SerializeSource(destination.token), Endpoint::wellKnown(destination.addresses, WLTOKEN_ENDPOINT_NOT_FOUND), false); + #line 4330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + } } } } @@ -4298,7 +4414,7 @@ class DeliverActorState { } int a_body1cont4(int loopDepth) { - loopDepth = a_body1cont14(loopDepth); + loopDepth = a_body1cont16(loopDepth); return loopDepth; } @@ -4311,23 +4427,25 @@ class DeliverActorState { int a_body1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - g_currentDeliveryPeerAddress = { NetworkAddress() }; - #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + g_currentDeliveryPeerAddress = NetworkAddressList(); + #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + g_currentDeliverPeerAddressTrusted = false; + #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" g_currentDeliveryPeerDisconnect = Future(); - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent(SevError, "ReceiverError") .error(e) .detail("Token", destination.token.toString()) .detail("Peer", destination.getPrimaryAddress()); - #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!FlowTransport::isClient()) - #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" flushAndExit(FDB_EXIT_ERROR); - #line 4326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 4330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -4350,33 +4468,37 @@ class DeliverActorState { return loopDepth; } - int a_body1cont14(int loopDepth) + int a_body1cont16(int loopDepth) { - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" delete static_cast(this); - #line 4357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" return 0; return loopDepth; } - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TransportData* self; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Endpoint destination; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TaskPriority priority; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ArenaReader reader; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - bool inReadSocket; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + NetworkAddress peerAddress; + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + bool isTrustedPeer; + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + InReadSocket inReadSocket; + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Future disconnect; - #line 4374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" }; // This generated class is to be used only via deliver() - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class DeliverActor final : public Actor, public ActorCallback< DeliverActor, 0, Void >, public FastAllocated, public DeliverActorState { - #line 4379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4385,11 +4507,11 @@ class DeliverActor final : public Actor, public ActorCallback< DeliverActo void destroy() {{ ((Actor*)this)->~Actor(); operator delete(this); }} #pragma clang diagnostic pop friend struct ActorCallback< DeliverActor, 0, Void >; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - DeliverActor(TransportData* const& self,Endpoint const& destination,TaskPriority const& priority,ArenaReader const& reader,bool const& inReadSocket,Future const& disconnect) - #line 4390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + DeliverActor(TransportData* const& self,Endpoint const& destination,TaskPriority const& priority,ArenaReader const& reader,NetworkAddress const& peerAddress,bool const& isTrustedPeer,InReadSocket const& inReadSocket,Future const& disconnect) + #line 4512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" : Actor(), - DeliverActorState(self, destination, priority, reader, inReadSocket, disconnect) + DeliverActorState(self, destination, priority, reader, peerAddress, isTrustedPeer, inReadSocket, disconnect) { fdb_probe_actor_enter("deliver", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -4402,23 +4524,24 @@ friend struct ActorCallback< DeliverActor, 0, Void >; } }; } - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" -static void deliver( TransportData* const& self, Endpoint const& destination, TaskPriority const& priority, ArenaReader const& reader, bool const& inReadSocket, Future const& disconnect ) { - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - new DeliverActor(self, destination, priority, reader, inReadSocket, disconnect); - #line 4409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +static void deliver( TransportData* const& self, Endpoint const& destination, TaskPriority const& priority, ArenaReader const& reader, NetworkAddress const& peerAddress, bool const& isTrustedPeer, InReadSocket const& inReadSocket, Future const& disconnect ) { + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + new DeliverActor(self, destination, priority, reader, peerAddress, isTrustedPeer, inReadSocket, disconnect); + #line 4531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } -#line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +#line 1104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" static void scanPackets(TransportData* transport, uint8_t*& unprocessed_begin, const uint8_t* e, Arena& arena, NetworkAddress const& peerAddress, + bool isTrustedPeer, ProtocolVersion peerProtocolVersion, Future disconnect, - bool isStableConnection) { + IsStableConnection isStableConnection) { // Find each complete packet in the given byte range and queue a ready task to deliver it. // Remove the complete packets from the range by increasing unprocessed_begin. // There won't be more than 64K of data plus one packet, so this shouldn't take a long time. @@ -4453,14 +4576,26 @@ static void scanPackets(TransportData* transport, if (e - p < packetLen) break; - ASSERT(packetLen >= sizeof(UID)); + + if (packetLen < sizeof(UID)) { + if (g_network->isSimulated()) { + // Same as ASSERT(false), but prints packet length: + ASSERT_GE(packetLen, sizeof(UID)); + } else { + TraceEvent(SevError, "PacketTooSmall") + .detail("FromPeer", peerAddress.toString()) + .detail("Length", packetLen); + throw platform_error(); + } + } if (checksumEnabled) { bool isBuggifyEnabled = false; if (g_network->isSimulated() && !isStableConnection && - g_network->now() - g_simulator.lastConnectionFailure > g_simulator.connectionFailuresDisableDuration && + g_network->now() - g_simulator->lastConnectionFailure > + g_simulator->connectionFailuresDisableDuration && BUGGIFY_WITH_PROB(0.0001)) { - g_simulator.lastConnectionFailure = g_network->now(); + g_simulator->lastConnectionFailure = g_network->now(); isBuggifyEnabled = true; TraceEvent(SevInfo, "BitsFlip").log(); int flipBits = 32 - (int)floor(log2(deterministicRandom()->randomUInt32())); @@ -4513,14 +4648,11 @@ static void scanPackets(TransportData* transport, ++transport->countPacketsReceived; if (packetLen > FLOW_KNOBS->PACKET_WARNING) { - TraceEvent(transport->warnAlwaysForLargePacket ? SevWarnAlways : SevWarn, "LargePacketReceived") + TraceEvent(SevWarn, "LargePacketReceived") .suppressFor(1.0) .detail("FromPeer", peerAddress.toString()) .detail("Length", (int)packetLen) .detail("Token", token); - - if (g_network->isSimulated()) - transport->warnAlwaysForLargePacket = false; } ASSERT(!reader.empty()); @@ -4532,7 +4664,14 @@ static void scanPackets(TransportData* transport, // we have many messages to UnknownEndpoint we want to optimize earlier. As deliver is an actor it // will allocate some state on the heap and this prevents it from doing that. if (priority != TaskPriority::UnknownEndpoint || (token.first() & TOKEN_STREAM_FLAG) != 0) { - deliver(transport, Endpoint({ peerAddress }, token), priority, std::move(reader), true, disconnect); + deliver(transport, + Endpoint({ peerAddress }, token), + priority, + std::move(reader), + peerAddress, + isTrustedPeer, + InReadSocket::True, + disconnect); } unprocessed_begin = p = p + packetLen; @@ -4563,47 +4702,47 @@ static int getNewBufferSize(const uint8_t* begin, // This actor exists whenever there is an open or opening connection, whether incoming or outgoing // For incoming connections conn is set and peer is initially nullptr; for outgoing connections it is the reverse - #line 4566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" namespace { // This generated class is to be used only via connectionReader() - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" template - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class ConnectionReaderActorState { - #line 4573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ConnectionReaderActorState(TransportData* const& transport,Reference const& conn,Reference const& peer,Promise> const& onConnected) - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" : transport(transport), - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" conn(conn), - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer(peer), - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" onConnected(onConnected), - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" arena(), - #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" unprocessed_begin(nullptr), - #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" unprocessed_end(nullptr), - #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" buffer_end(nullptr), - #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" expectConnectPacket(true), - #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" compatible(false), - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" incompatiblePeerCounted(false), - #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - incompatibleProtocolVersionNewer(false), - #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peerAddress(), - #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - peerProtocolVersion() - #line 4606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + peerProtocolVersion(), + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + trusted(transport->allowList(conn->getPeerAddress().ip) && conn->hasTrustedPeer()) + #line 4745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { fdb_probe_actor_create("connectionReader", reinterpret_cast(this)); @@ -4616,20 +4755,20 @@ class ConnectionReaderActorState { int a_body1(int loopDepth=0) { try { - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peerAddress = conn->getPeerAddress(); - #line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!peer) - #line 4623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ASSERT(!peerAddress.isPublic()); - #line 4627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } try { - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 4632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -4657,19 +4796,19 @@ class ConnectionReaderActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (incompatiblePeerCounted) - #line 4662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ASSERT(peer && peer->transport->numIncompatibleConnections > 0); - #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->transport->numIncompatibleConnections--; - #line 4668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 4672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -4688,25 +4827,25 @@ class ConnectionReaderActorState { } int a_body1loopBody1(int loopDepth) { - #line 1173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 4693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1loopHead1(loopDepth); return loopDepth; } int a_body1loopBody1cont1(int loopDepth) { - #line 1335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_3 = conn->onReadable(); - #line 1335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4720,45 +4859,45 @@ class ConnectionReaderActorState { } int a_body1loopBody1loopBody1(int loopDepth) { - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" readAllBytes = buffer_end - unprocessed_end; - #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (readAllBytes < FLOW_KNOBS->MIN_PACKET_BUFFER_FREE_BYTES) - #line 4727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Arena newArena; - #line 1177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" const int unproc_len = unprocessed_end - unprocessed_begin; - #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" const int len = getNewBufferSize(unprocessed_begin, unprocessed_end, peerAddress, peerProtocolVersion); - #line 1180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" uint8_t* const newBuffer = new (newArena) uint8_t[len]; - #line 1181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (unproc_len > 0) - #line 4739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" memcpy(newBuffer, unprocessed_begin, unproc_len); - #line 4743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" arena = newArena; - #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" unprocessed_begin = newBuffer; - #line 1186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" unprocessed_end = newBuffer + unproc_len; - #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" buffer_end = newBuffer + len; - #line 1188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" readAllBytes = buffer_end - unprocessed_end; - #line 4755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" totalReadBytes = 0; - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 4761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1loopBody1loopHead1(loopDepth); return loopDepth; @@ -4778,200 +4917,194 @@ class ConnectionReaderActorState { } int a_body1loopBody1loopBody1cont1(int loopDepth) { - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (peer) - #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->bytesReceived += totalReadBytes; - #line 4787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (totalReadBytes == 0) - #line 4791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" readWillBlock = totalReadBytes != readAllBytes; - #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (expectConnectPacket && unprocessed_end - unprocessed_begin >= CONNECT_PACKET_V0_SIZE) - #line 4799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" int32_t connectPacketSize = ((ConnectPacket*)unprocessed_begin)->totalPacketSize(); - #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (unprocessed_end - unprocessed_begin >= connectPacketSize) - #line 4805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" auto protocolVersion = ((ConnectPacket*)unprocessed_begin)->protocolVersion; - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" BinaryReader pktReader(unprocessed_begin, connectPacketSize, AssumeVersion(protocolVersion)); - #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ConnectPacket pkt; - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" serializer(pktReader, pkt); - #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" uint64_t connectionId = pkt.connectionId; - #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!pkt.protocolVersion.hasObjectSerializerFlag() || !pkt.protocolVersion.isCompatible(g_network->protocolVersion())) - #line 4819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - incompatibleProtocolVersionNewer = pkt.protocolVersion > g_network->protocolVersion(); - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" NetworkAddress addr = pkt.canonicalRemotePort ? NetworkAddress(pkt.canonicalRemoteIp(), pkt.canonicalRemotePort) : conn->getPeerAddress(); - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (connectionId != 1) - #line 4827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" addr.port = 0; - #line 4831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!transport->multiVersionConnections.count(connectionId)) - #line 4835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (now() - transport->lastIncompatibleMessage > FLOW_KNOBS->CONNECTION_REJECTED_MESSAGE_DELAY) - #line 4839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent(SevWarn, "ConnectionRejected", conn->getDebugID()) .detail("Reason", "IncompatibleProtocolVersion") .detail("LocalVersion", g_network->protocolVersion()) .detail("RejectedVersion", pkt.protocolVersion) .detail("Peer", pkt.canonicalRemotePort ? NetworkAddress(pkt.canonicalRemoteIp(), pkt.canonicalRemotePort) : conn->getPeerAddress()) .detail("ConnectionId", connectionId); - #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" transport->lastIncompatibleMessage = now(); - #line 4845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!transport->incompatiblePeers.count(addr)) - #line 4849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" transport->incompatiblePeers[addr] = std::make_pair(connectionId, now()); - #line 4853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } else { - #line 1247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (connectionId > 1) - #line 4860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 4997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" transport->multiVersionConnections[connectionId] = now() + FLOW_KNOBS->CONNECTION_ID_TIMEOUT; - #line 4864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } - #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" compatible = false; - #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!protocolVersion.hasInexpensiveMultiVersionClient()) - #line 4871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (peer) - #line 4875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->protocolVersion->set(protocolVersion); - #line 4879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1Catch2(incompatible_protocol_version(), std::max(0, loopDepth - 2)); - #line 4883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } else { - #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" compatible = true; - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("ConnectionEstablished", conn->getDebugID()) .suppressFor(1.0) .detail("Peer", conn->getPeerAddress()) .detail("ConnectionId", connectionId); - #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (connectionId > 1) - #line 4896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" transport->multiVersionConnections[connectionId] = now() + FLOW_KNOBS->CONNECTION_ID_TIMEOUT; - #line 4900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" unprocessed_begin += connectPacketSize; - #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" expectConnectPacket = false; - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (peer) - #line 4908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peerProtocolVersion = protocolVersion; - #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("ConnectedOutgoing") .suppressFor(1.0) .detail("PeerAddr", NetworkAddress(pkt.canonicalRemoteIp(), pkt.canonicalRemotePort)); - #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->compatible = compatible; - #line 1283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - peer->incompatibleProtocolVersionNewer = incompatibleProtocolVersionNewer; - #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!compatible) - #line 4920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->transport->numIncompatibleConnections++; - #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" incompatiblePeerCounted = true; - #line 4926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ASSERT(pkt.canonicalRemotePort == peerAddress.port); - #line 1289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" onConnected.send(peer); - #line 4932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1loopBody1cont8(loopDepth); } else { - #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peerProtocolVersion = protocolVersion; - #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (pkt.canonicalRemotePort) - #line 4941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peerAddress = NetworkAddress(pkt.canonicalRemoteIp(), pkt.canonicalRemotePort, true, peerAddress.isTLS(), NetworkAddressFromHostname(peerAddress.fromHostname)); - #line 4945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer = transport->getOrOpenPeer(peerAddress, false); - #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->compatible = compatible; - #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - peer->incompatibleProtocolVersionNewer = incompatibleProtocolVersionNewer; - #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!compatible) - #line 4955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->transport->numIncompatibleConnections++; - #line 1304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" incompatiblePeerCounted = true; - #line 4961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" onConnected.send(peer); - #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_1 = delay(0); - #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 4969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; } } @@ -4996,32 +5129,32 @@ class ConnectionReaderActorState { } int a_body1loopBody1loopBody1loopBody1(int loopDepth) { - #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" const int len = std::min(buffer_end - unprocessed_end, FLOW_KNOBS->MAX_PACKET_SEND_BYTES); - #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (len == 0) - #line 5003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { return a_body1loopBody1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" readBytes = conn->read(unprocessed_end, unprocessed_end + len); - #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (readBytes == 0) - #line 5011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { return a_body1loopBody1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_0 = yield(TaskPriority::ReadSocket); - #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 3)); - #line 5019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 3)); else return a_body1loopBody1loopBody1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -5041,22 +5174,22 @@ class ConnectionReaderActorState { } int a_body1loopBody1loopBody1loopBody1cont1(Void const& _,int loopDepth) { - #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" totalReadBytes += readBytes; - #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" unprocessed_end += readBytes; - #line 5048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1loopBody1loopHead1(0); return loopDepth; } int a_body1loopBody1loopBody1loopBody1cont1(Void && _,int loopDepth) { - #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" totalReadBytes += readBytes; - #line 1201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" unprocessed_end += readBytes; - #line 5059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (loopDepth == 0) return a_body1loopBody1loopBody1loopHead1(0); return loopDepth; @@ -5126,43 +5259,43 @@ class ConnectionReaderActorState { } int a_body1loopBody1loopBody1cont4(int loopDepth) { - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!expectConnectPacket) - #line 5131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (compatible || peerProtocolVersion.hasStableInterfaces()) - #line 5135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - scanPackets(transport, unprocessed_begin, unprocessed_end, arena, peerAddress, peerProtocolVersion, peer->disconnect.getFuture(), g_network->isSimulated() && conn->isStableConnection()); - #line 5139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + scanPackets(transport, unprocessed_begin, unprocessed_end, arena, peerAddress, trusted, peerProtocolVersion, peer->disconnect.getFuture(), IsStableConnection(g_network->isSimulated() && conn->isStableConnection())); + #line 5272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } else { - #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" unprocessed_begin = unprocessed_end; - #line 1325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->resetPing.trigger(); - #line 5147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } - #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (readWillBlock) - #line 5152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } - #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_2 = yield(TaskPriority::ReadSocket); - #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 5160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1loopBody1cont4when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -5175,9 +5308,9 @@ class ConnectionReaderActorState { } int a_body1loopBody1loopBody1cont8(int loopDepth) { - #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" peer->protocolVersion->set(peerProtocolVersion); - #line 5180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopBody1loopBody1cont7(loopDepth); return loopDepth; @@ -5334,32 +5467,32 @@ class ConnectionReaderActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_4 = delay(0, TaskPriority::ReadSocket); - #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch2(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_4 = delay(0, TaskPriority::ReadSocket); - #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch2(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -5502,48 +5635,48 @@ class ConnectionReaderActorState { fdb_probe_actor_exit("connectionReader", reinterpret_cast(this), 4); } - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TransportData* transport; - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Reference conn; - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Reference peer; - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Promise> onConnected; - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Arena arena; - #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" uint8_t* unprocessed_begin; - #line 1158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" uint8_t* unprocessed_end; - #line 1159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" uint8_t* buffer_end; - #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" bool expectConnectPacket; - #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" bool compatible; - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" bool incompatiblePeerCounted; - #line 1163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - bool incompatibleProtocolVersionNewer; - #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" NetworkAddress peerAddress; - #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ProtocolVersion peerProtocolVersion; - #line 1174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + bool trusted; + #line 1297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" int readAllBytes; - #line 1191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" int totalReadBytes; - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" int readBytes; - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" bool readWillBlock; - #line 5541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" }; // This generated class is to be used only via connectionReader() - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class ConnectionReaderActor final : public Actor, public ActorCallback< ConnectionReaderActor, 0, Void >, public ActorCallback< ConnectionReaderActor, 1, Void >, public ActorCallback< ConnectionReaderActor, 2, Void >, public ActorCallback< ConnectionReaderActor, 3, Void >, public ActorCallback< ConnectionReaderActor, 4, Void >, public FastAllocated, public ConnectionReaderActorState { - #line 5546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5556,9 +5689,9 @@ friend struct ActorCallback< ConnectionReaderActor, 1, Void >; friend struct ActorCallback< ConnectionReaderActor, 2, Void >; friend struct ActorCallback< ConnectionReaderActor, 3, Void >; friend struct ActorCallback< ConnectionReaderActor, 4, Void >; - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ConnectionReaderActor(TransportData* const& transport,Reference const& conn,Reference const& peer,Promise> const& onConnected) - #line 5561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" : Actor(), ConnectionReaderActorState(transport, conn, peer, onConnected) { @@ -5586,32 +5719,32 @@ friend struct ActorCallback< ConnectionReaderActor, 4, Void >; } }; } - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" [[nodiscard]] static Future connectionReader( TransportData* const& transport, Reference const& conn, Reference const& peer, Promise> const& onConnected ) { - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return Future(new ConnectionReaderActor(transport, conn, peer, onConnected)); - #line 5593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } -#line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +#line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 5598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" namespace { // This generated class is to be used only via connectionIncoming() - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" template - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class ConnectionIncomingActorState { - #line 5605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ConnectionIncomingActorState(TransportData* const& self,Reference const& conn) - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" : self(self), - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" conn(conn) - #line 5614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { fdb_probe_actor_create("connectionIncoming", reinterpret_cast(this)); @@ -5625,16 +5758,16 @@ class ConnectionIncomingActorState { { try { try { - #line 1350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_0 = conn->acceptHandshake(); - #line 1350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 5632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5662,19 +5795,19 @@ class ConnectionIncomingActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (e.code() != error_code_actor_cancelled) - #line 5667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("IncomingConnectionError", conn->getDebugID()) .errorUnsuppressed(e) .suppressFor(1.0) .detail("FromAddress", conn->getPeerAddress()); - #line 5671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" conn->close(); - #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ConnectionIncomingActorState(); static_cast(this)->destroy(); return 0; } - #line 5677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ConnectionIncomingActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5690,64 +5823,64 @@ class ConnectionIncomingActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" onConnected = Promise>(); - #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" reader = connectionReader(self, conn, Reference(), onConnected); - #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_1 = reader; - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 5701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; - #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture> __when_expr_2 = onConnected.getFuture(); - #line 5705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont2when2(__when_expr_2.get(), loopDepth); }; - #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_3 = delayJittered(FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT); - #line 5709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), loopDepth); else return a_body1cont2when3(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" onConnected = Promise>(); - #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" reader = connectionReader(self, conn, Reference(), onConnected); - #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_1 = reader; - #line 1353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 5733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; - #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture> __when_expr_2 = onConnected.getFuture(); - #line 5737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont2when2(__when_expr_2.get(), loopDepth); }; - #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_3 = delayJittered(FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT); - #line 5741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), loopDepth); else return a_body1cont2when3(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -5817,9 +5950,9 @@ class ConnectionIncomingActorState { } int a_body1cont3(int loopDepth) { - #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ConnectionIncomingActorState(); static_cast(this)->destroy(); return 0; } - #line 5822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ConnectionIncomingActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5829,11 +5962,11 @@ class ConnectionIncomingActorState { } int a_body1cont2when1(Void const& _,int loopDepth) { - #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ASSERT(false); - #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ConnectionIncomingActorState(); static_cast(this)->destroy(); return 0; } - #line 5836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ConnectionIncomingActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5843,11 +5976,11 @@ class ConnectionIncomingActorState { } int a_body1cont2when1(Void && _,int loopDepth) { - #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ASSERT(false); - #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ConnectionIncomingActorState(); static_cast(this)->destroy(); return 0; } - #line 5850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ConnectionIncomingActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5857,39 +5990,39 @@ class ConnectionIncomingActorState { } int a_body1cont2when2(Reference const& p,int loopDepth) { - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" p->onIncomingConnection(p, conn, reader); - #line 5862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 5995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; } int a_body1cont2when2(Reference && p,int loopDepth) { - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" p->onIncomingConnection(p, conn, reader); - #line 5871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1cont3(loopDepth); return loopDepth; } int a_body1cont2when3(Void const& _,int loopDepth) { - #line 1362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - TEST(true); - #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + CODE_PROBE(true, "Incoming connection timed out"); + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1Catch2(timed_out(), loopDepth); - #line 5882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" return loopDepth; } int a_body1cont2when3(Void && _,int loopDepth) { - #line 1362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - TEST(true); - #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + CODE_PROBE(true, "Incoming connection timed out"); + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1Catch2(timed_out(), loopDepth); - #line 5892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" return loopDepth; } @@ -6036,20 +6169,20 @@ class ConnectionIncomingActorState { fdb_probe_actor_exit("connectionIncoming", reinterpret_cast(this), 3); } - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TransportData* self; - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Reference conn; - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Promise> onConnected; - #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Future reader; - #line 6047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" }; // This generated class is to be used only via connectionIncoming() - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class ConnectionIncomingActor final : public Actor, public ActorCallback< ConnectionIncomingActor, 0, Void >, public ActorCallback< ConnectionIncomingActor, 1, Void >, public ActorCallback< ConnectionIncomingActor, 2, Reference >, public ActorCallback< ConnectionIncomingActor, 3, Void >, public FastAllocated, public ConnectionIncomingActorState { - #line 6052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6061,9 +6194,9 @@ friend struct ActorCallback< ConnectionIncomingActor, 0, Void >; friend struct ActorCallback< ConnectionIncomingActor, 1, Void >; friend struct ActorCallback< ConnectionIncomingActor, 2, Reference >; friend struct ActorCallback< ConnectionIncomingActor, 3, Void >; - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ConnectionIncomingActor(TransportData* const& self,Reference const& conn) - #line 6066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" : Actor(), ConnectionIncomingActorState(self, conn) { @@ -6088,36 +6221,36 @@ friend struct ActorCallback< ConnectionIncomingActor, 3, Void >; } }; } - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" [[nodiscard]] static Future connectionIncoming( TransportData* const& self, Reference const& conn ) { - #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return Future(new ConnectionIncomingActor(self, conn)); - #line 6095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } -#line 1378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +#line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 6100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" namespace { // This generated class is to be used only via listen() - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" template - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class ListenActorState { - #line 6107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ListenActorState(TransportData* const& self,NetworkAddress const& listenAddr) - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" : self(self), - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" listenAddr(listenAddr), - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" incoming(), - #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" listener(INetworkConnections::net()->listen(listenAddr)) - #line 6120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { fdb_probe_actor_create("listen", reinterpret_cast(this)); @@ -6130,23 +6263,25 @@ class ListenActorState { int a_body1(int loopDepth=0) { try { - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - if (!g_network->isSimulated() && self->localAddresses.address.port == 0) - #line 6135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (!g_network->isSimulated() && self->localAddresses.getAddressList().address.port == 0) + #line 6268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent(SevInfo, "UpdatingListenAddress") .detail("AssignedListenAddress", listener->getListenAddress().toString()); - #line 1386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - self->localAddresses.address = listener->getListenAddress(); - #line 6141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + self->localAddresses.setNetworkAddress(listener->getListenAddress()); + #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + setTraceLocalAddress(listener->getListenAddress()); + #line 6276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" connectionCount = 0; - #line 6145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" try { - #line 1390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 6149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -6174,11 +6309,11 @@ class ListenActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent(SevError, "ListenError").error(e); - #line 1406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 6181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -6197,48 +6332,48 @@ class ListenActorState { } int a_body1loopBody1(int loopDepth) { - #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture> __when_expr_0 = listener->accept(); - #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 6209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Reference const& conn,int loopDepth) { - #line 1392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (conn) - #line 6218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("ConnectionFrom", conn->getDebugID()) .suppressFor(1.0) .detail("FromAddress", conn->getPeerAddress()) .detail("ListenAddress", listenAddr.toString()); - #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" incoming.add(connectionIncoming(self, conn)); - #line 6224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" connectionCount++; - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (connectionCount % (FLOW_KNOBS->ACCEPT_BATCH_SIZE) == 0) - #line 6230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_1 = delay(0, TaskPriority::AcceptSocket); - #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; } else @@ -6250,32 +6385,32 @@ class ListenActorState { } int a_body1loopBody1cont1(Reference && conn,int loopDepth) { - #line 1392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (conn) - #line 6255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TraceEvent("ConnectionFrom", conn->getDebugID()) .suppressFor(1.0) .detail("FromAddress", conn->getPeerAddress()) .detail("ListenAddress", listenAddr.toString()); - #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" incoming.add(connectionIncoming(self, conn)); - #line 6261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" connectionCount++; - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (connectionCount % (FLOW_KNOBS->ACCEPT_BATCH_SIZE) == 0) - #line 6267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_1 = delay(0, TaskPriority::AcceptSocket); - #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; } else @@ -6429,22 +6564,22 @@ class ListenActorState { fdb_probe_actor_exit("listen", reinterpret_cast(this), 1); } - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TransportData* self; - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" NetworkAddress listenAddr; - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ActorCollectionNoErrors incoming; - #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Reference listener; - #line 1388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" uint64_t connectionCount; - #line 6442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" }; // This generated class is to be used only via listen() - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class ListenActor final : public Actor, public ActorCallback< ListenActor, 0, Reference >, public ActorCallback< ListenActor, 1, Void >, public FastAllocated, public ListenActorState { - #line 6447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6454,9 +6589,9 @@ class ListenActor final : public Actor, public ActorCallback< ListenActor, #pragma clang diagnostic pop friend struct ActorCallback< ListenActor, 0, Reference >; friend struct ActorCallback< ListenActor, 1, Void >; - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ListenActor(TransportData* const& self,NetworkAddress const& listenAddr) - #line 6459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" : Actor(), ListenActorState(self, listenAddr) { @@ -6481,14 +6616,14 @@ friend struct ActorCallback< ListenActor, 1, Void >; } }; } - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" [[nodiscard]] static Future listen( TransportData* const& self, NetworkAddress const& listenAddr ) { - #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return Future(new ListenActor(self, listenAddr)); - #line 6488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } -#line 1409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +#line 1531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" Reference TransportData::getPeer(NetworkAddress const& address) { auto peer = peers.find(address); @@ -6515,25 +6650,47 @@ Reference TransportData::getOrOpenPeer(NetworkAddress const& address, bool } bool TransportData::isLocalAddress(const NetworkAddress& address) const { - return address == localAddresses.address || - (localAddresses.secondaryAddress.present() && address == localAddresses.secondaryAddress.get()); + return address == localAddresses.getAddressList().address || + (localAddresses.getAddressList().secondaryAddress.present() && + address == localAddresses.getAddressList().secondaryAddress.get()); } - #line 6522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" +void TransportData::applyPublicKeySet(StringRef jwkSetString) { + auto jwks = JsonWebKeySet::parse(jwkSetString, {}); + if (!jwks.present()) + throw pkey_decode_error(); + const auto& keySet = jwks.get().keys; + publicKeys.clear(); + int numPrivateKeys = 0; + for (auto [keyName, key] : keySet) { + // ignore private keys + if (key.isPublic()) { + publicKeys[keyName] = key.getPublic(); + } else { + numPrivateKeys++; + } + } + TraceEvent(SevInfo, "AuthzPublicKeySetApply"_audit).detail("NumPublicKeys", publicKeys.size()); + if (numPrivateKeys > 0) { + TraceEvent(SevWarnAlways, "AuthzPublicKeySetContainsPrivateKeys").detail("NumPrivateKeys", numPrivateKeys); + } +} + + #line 6679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" namespace { // This generated class is to be used only via multiVersionCleanupWorker() - #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" template - #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class MultiVersionCleanupWorkerActorState { - #line 6529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: - #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" MultiVersionCleanupWorkerActorState(TransportData* const& self) - #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" - #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" : self(self) - #line 6536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { fdb_probe_actor_create("multiVersionCleanupWorker", reinterpret_cast(this)); @@ -6546,9 +6703,9 @@ class MultiVersionCleanupWorkerActorState { int a_body1(int loopDepth=0) { try { - #line 1440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" ; - #line 6551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -6576,73 +6733,73 @@ class MultiVersionCleanupWorkerActorState { } int a_body1loopBody1(int loopDepth) { - #line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" StrictFuture __when_expr_0 = delay(FLOW_KNOBS->CONNECTION_CLEANUP_DELAY); - #line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 6583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 1442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" bool foundIncompatible = false; - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" for(auto it = self->incompatiblePeers.begin();it != self->incompatiblePeers.end();) { - #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (self->multiVersionConnections.count(it->second.first)) - #line 6601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" it = self->incompatiblePeers.erase(it); - #line 6605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } else { - #line 1447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (now() - it->second.second > FLOW_KNOBS->INCOMPATIBLE_PEER_DELAY_BEFORE_LOGGING) - #line 6611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" foundIncompatible = true; - #line 6615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" it++; - #line 6619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } - #line 1454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" for(auto it = self->multiVersionConnections.begin();it != self->multiVersionConnections.end();) { - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (it->second < now()) - #line 6626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" it = self->multiVersionConnections.erase(it); - #line 6630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } else { - #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" it++; - #line 6636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } - #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (foundIncompatible) - #line 6641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->incompatiblePeersChanged.trigger(); - #line 6645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } if (loopDepth == 0) return a_body1loopHead1(0); @@ -6650,57 +6807,57 @@ class MultiVersionCleanupWorkerActorState { } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 1442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" bool foundIncompatible = false; - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" for(auto it = self->incompatiblePeers.begin();it != self->incompatiblePeers.end();) { - #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (self->multiVersionConnections.count(it->second.first)) - #line 6659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" it = self->incompatiblePeers.erase(it); - #line 6663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } else { - #line 1447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (now() - it->second.second > FLOW_KNOBS->INCOMPATIBLE_PEER_DELAY_BEFORE_LOGGING) - #line 6669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" foundIncompatible = true; - #line 6673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } - #line 1450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" it++; - #line 6677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } - #line 1454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" for(auto it = self->multiVersionConnections.begin();it != self->multiVersionConnections.end();) { - #line 1455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (it->second < now()) - #line 6684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" it = self->multiVersionConnections.erase(it); - #line 6688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } else { - #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" it++; - #line 6694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } } - #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" if (foundIncompatible) - #line 6699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" { - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" self->incompatiblePeersChanged.trigger(); - #line 6703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } if (loopDepth == 0) return a_body1loopHead1(0); @@ -6769,14 +6926,14 @@ class MultiVersionCleanupWorkerActorState { fdb_probe_actor_exit("multiVersionCleanupWorker", reinterpret_cast(this), 0); } - #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" TransportData* self; - #line 6774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" }; // This generated class is to be used only via multiVersionCleanupWorker() - #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" class MultiVersionCleanupWorkerActor final : public Actor, public ActorCallback< MultiVersionCleanupWorkerActor, 0, Void >, public FastAllocated, public MultiVersionCleanupWorkerActorState { - #line 6779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6785,9 +6942,9 @@ class MultiVersionCleanupWorkerActor final : public Actor, public ActorCal void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< MultiVersionCleanupWorkerActor, 0, Void >; - #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" MultiVersionCleanupWorkerActor(TransportData* const& self) - #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" : Actor(), MultiVersionCleanupWorkerActorState(self) { @@ -6811,18 +6968,23 @@ friend struct ActorCallback< MultiVersionCleanupWorkerActor, 0, Void >; } }; } - #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" [[nodiscard]] static Future multiVersionCleanupWorker( TransportData* const& self ) { - #line 1439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 1583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" return Future(new MultiVersionCleanupWorkerActor(self)); - #line 6818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + #line 6975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" } -#line 1467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +#line 1611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" -FlowTransport::FlowTransport(uint64_t transportId, int maxWellKnownEndpoints) - : self(new TransportData(transportId, maxWellKnownEndpoints)) { +FlowTransport::FlowTransport(uint64_t transportId, int maxWellKnownEndpoints, IPAllowList const* allowList) + : self(new TransportData(transportId, maxWellKnownEndpoints, allowList)) { self->multiVersionCleanup = multiVersionCleanupWorker(self); + if (g_network->isSimulated()) { + for (auto const& p : g_simulator->authKeys) { + self->publicKeys.emplace(p.first, p.second.toPublic()); + } + } } FlowTransport::~FlowTransport() { @@ -6834,11 +6996,21 @@ void FlowTransport::initMetrics() { } NetworkAddressList FlowTransport::getLocalAddresses() const { - return self->localAddresses; + return self->localAddresses.getAddressList(); } NetworkAddress FlowTransport::getLocalAddress() const { - return self->localAddresses.address; + return self->localAddresses.getAddressList().address; +} + +Standalone FlowTransport::getLocalAddressAsString() const { + return self->localAddresses.getLocalAddressAsString(); +} + +void FlowTransport::setLocalAddress(NetworkAddress const& address) { + auto newAddress = self->localAddresses.getAddressList(); + newAddress.address = address; + self->localAddresses.setAddressList(newAddress); } const std::unordered_map>& FlowTransport::getAllPeers() const { @@ -6862,11 +7034,14 @@ Future FlowTransport::onIncompatibleChanged() { Future FlowTransport::bind(NetworkAddress publicAddress, NetworkAddress listenAddress) { ASSERT(publicAddress.isPublic()); - if (self->localAddresses.address == NetworkAddress()) { - self->localAddresses.address = publicAddress; + if (self->localAddresses.getAddressList().address == NetworkAddress()) { + self->localAddresses.setNetworkAddress(publicAddress); } else { - self->localAddresses.secondaryAddress = publicAddress; + auto addrList = self->localAddresses.getAddressList(); + addrList.secondaryAddress = publicAddress; + self->localAddresses.setAddressList(addrList); } + // reformatLocalAddress() TraceEvent("Binding").detail("PublicAddress", publicAddress).detail("ListenAddress", listenAddress); Future listenF = listen(self, listenAddress); @@ -6917,7 +7092,7 @@ void FlowTransport::removePeerReference(const Endpoint& endpoint, bool isStream) void FlowTransport::addEndpoint(Endpoint& endpoint, NetworkMessageReceiver* receiver, TaskPriority taskID) { endpoint.token = deterministicRandom()->randomUniqueID(); if (receiver->isStream()) { - endpoint.addresses = self->localAddresses; + endpoint.addresses = self->localAddresses.getAddressList(); endpoint.token = UID(endpoint.token.first() | TOKEN_STREAM_FLAG, endpoint.token.second()); } else { endpoint.addresses = NetworkAddressList(); @@ -6927,7 +7102,7 @@ void FlowTransport::addEndpoint(Endpoint& endpoint, NetworkMessageReceiver* rece } void FlowTransport::addEndpoints(std::vector> const& streams) { - self->endpoints.insert(self->localAddresses, streams); + self->endpoints.insert(self->localAddresses.getAddressList(), streams); } void FlowTransport::removeEndpoint(const Endpoint& endpoint, NetworkMessageReceiver* receiver) { @@ -6935,13 +7110,13 @@ void FlowTransport::removeEndpoint(const Endpoint& endpoint, NetworkMessageRecei } void FlowTransport::addWellKnownEndpoint(Endpoint& endpoint, NetworkMessageReceiver* receiver, TaskPriority taskID) { - endpoint.addresses = self->localAddresses; + endpoint.addresses = self->localAddresses.getAddressList(); ASSERT(receiver->isStream()); self->endpoints.insertWellKnown(receiver, endpoint.token, taskID); } static void sendLocal(TransportData* self, ISerializeSource const& what, const Endpoint& destination) { - TEST(true); // "Loopback" delivery + CODE_PROBE(true, "\"Loopback\" delivery"); // SOMEDAY: Would it be better to avoid (de)serialization by doing this check in flow? Standalone copy; @@ -6958,8 +7133,10 @@ static void sendLocal(TransportData* self, ISerializeSource const& what, const E deliver(self, destination, priority, - ArenaReader(copy.arena(), copy, AssumeVersion(currentProtocolVersion)), - false, + ArenaReader(copy.arena(), copy, AssumeVersion(currentProtocolVersion())), + NetworkAddress(), + true, + InReadSocket::False, Never()); } } @@ -6974,9 +7151,8 @@ static ReliablePacket* sendPacket(TransportData* self, // If there isn't an open connection, a public address, or the peer isn't compatible, we can't send if (!peer || (peer->outgoingConnectionIdle && !destination.getPrimaryAddress().isPublic()) || - (peer->incompatibleProtocolVersionNewer && - destination.token != Endpoint::wellKnownToken(WLTOKEN_PING_PACKET))) { - TEST(true); // Can't send to private address without a compatible open connection + (!peer->compatible && destination.token != Endpoint::wellKnownToken(WLTOKEN_PING_PACKET))) { + CODE_PROBE(true, "Can't send to private address without a compatible open connection"); return nullptr; } @@ -7073,15 +7249,12 @@ static ReliablePacket* sendPacket(TransportData* self, .detail("Length", (int)len); // throw platform_error(); // FIXME: How to recover from this situation? } else if (len > FLOW_KNOBS->PACKET_WARNING) { - TraceEvent(self->warnAlwaysForLargePacket ? SevWarnAlways : SevWarn, "LargePacketSent") + TraceEvent(SevWarn, "LargePacketSent") .suppressFor(1.0) .detail("ToPeer", destination.getPrimaryAddress()) .detail("Length", (int)len) .detail("Token", destination.token) .backtrace(); - - if (g_network->isSimulated()) - self->warnAlwaysForLargePacket = false; } #if VALGRIND @@ -7166,9 +7339,13 @@ bool FlowTransport::incompatibleOutgoingConnectionsPresent() { return self->numIncompatibleConnections > 0; } -void FlowTransport::createInstance(bool isClient, uint64_t transportId, int maxWellKnownEndpoints) { +void FlowTransport::createInstance(bool isClient, + uint64_t transportId, + int maxWellKnownEndpoints, + IPAllowList const* allowList) { + TokenCache::createInstance(); g_network->setGlobal(INetwork::enFlowTransport, - (flowGlobalType) new FlowTransport(transportId, maxWellKnownEndpoints)); + (flowGlobalType) new FlowTransport(transportId, maxWellKnownEndpoints, allowList)); g_network->setGlobal(INetwork::enNetworkAddressFunc, (flowGlobalType)&FlowTransport::getGlobalLocalAddress); g_network->setGlobal(INetwork::enNetworkAddressesFunc, (flowGlobalType)&FlowTransport::getGlobalLocalAddresses); g_network->setGlobal(INetwork::enFailureMonitor, (flowGlobalType) new SimpleFailureMonitor()); @@ -7178,3 +7355,749 @@ void FlowTransport::createInstance(bool isClient, uint64_t transportId, int maxW HealthMonitor* FlowTransport::healthMonitor() { return &self->healthMonitor; } + +Optional FlowTransport::getPublicKeyByName(StringRef name) const { + auto iter = self->publicKeys.find(name); + if (iter != self->publicKeys.end()) { + return iter->second; + } + return {}; +} + +NetworkAddress FlowTransport::currentDeliveryPeerAddress() const { + return g_currentDeliveryPeerAddress.address; +} + +bool FlowTransport::currentDeliveryPeerIsTrusted() const { + return g_currentDeliverPeerAddressTrusted; +} + +void FlowTransport::addPublicKey(StringRef name, PublicKey key) { + self->publicKeys[name] = key; +} + +void FlowTransport::removePublicKey(StringRef name) { + self->publicKeys.erase(name); +} + +void FlowTransport::removeAllPublicKeys() { + self->publicKeys.clear(); +} + +void FlowTransport::loadPublicKeyFile(const std::string& filePath) { + if (!fileExists(filePath)) { + throw file_not_found(); + } + int64_t const len = fileSize(filePath); + if (len <= 0) { + TraceEvent(SevWarn, "AuthzPublicKeySetEmpty").detail("Path", filePath); + } else if (len > FLOW_KNOBS->PUBLIC_KEY_FILE_MAX_SIZE) { + throw file_too_large(); + } else { + auto json = readFileBytes(filePath, len); + self->applyPublicKeySet(StringRef(json)); + } +} + + #line 7402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" +namespace { +// This generated class is to be used only via watchPublicKeyJwksFile() + #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +template + #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +class WatchPublicKeyJwksFileActorState { + #line 7409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" +public: + #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + WatchPublicKeyJwksFileActorState(std::string const& filePath,TransportData* const& self) + #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + : filePath(filePath), + #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + self(self), + #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + fileChanged(), + #line 2036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + fileWatch(), + #line 2037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + errorCount(0) + #line 7424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + { + fdb_probe_actor_create("watchPublicKeyJwksFile", reinterpret_cast(this)); + + } + ~WatchPublicKeyJwksFileActorState() + { + fdb_probe_actor_destroy("watchPublicKeyJwksFile", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 2040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + ; + #line 7439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~WatchPublicKeyJwksFileActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 2045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + const int& intervalSeconds = FLOW_KNOBS->PUBLIC_KEY_FILE_REFRESH_INTERVAL_SECONDS; + #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + fileWatch = watchFileForChanges(filePath, &fileChanged, &intervalSeconds, "AuthzPublicKeySetRefreshStatError"); + #line 2047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + ; + #line 7466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 2041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (IAsyncFileSystem::filesystem()) + #line 7482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 2043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + StrictFuture __when_expr_0 = delay(1.0); + #line 2043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 7490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 2043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(Void const& _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1(Void && _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WatchPublicKeyJwksFileActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WatchPublicKeyJwksFileActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< WatchPublicKeyJwksFileActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< WatchPublicKeyJwksFileActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 0); + + } + int a_body1cont1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1(int loopDepth) + { + try { + #line 2049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + StrictFuture __when_expr_1 = fileChanged.onTrigger(); + #line 2049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 2064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (e.code() == error_code_actor_cancelled) + #line 7629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + { + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 7633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + } + #line 2068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + errorCount++; + #line 2069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + TraceEvent(SevWarn, "AuthzPublicKeySetRefreshError"_audit).error(e).detail("ErrorCount", errorCount); + #line 7639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1cont1loopBody1cont2(Void const& _,int loopDepth) + { + #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + StrictFuture> __when_expr_2 = IAsyncFileSystem::filesystem()->open( filePath, IAsyncFile::OPEN_READONLY | IAsyncFile::OPEN_UNCACHED, 0); + #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 7661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1loopBody1cont2(Void && _,int loopDepth) + { + #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + StrictFuture> __when_expr_2 = IAsyncFileSystem::filesystem()->open( filePath, IAsyncFile::OPEN_READONLY | IAsyncFile::OPEN_UNCACHED, 0); + #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 7677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WatchPublicKeyJwksFileActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WatchPublicKeyJwksFileActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< WatchPublicKeyJwksFileActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< WatchPublicKeyJwksFileActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 1); + + } + int a_body1cont1loopBody1cont3(int loopDepth) + { + #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + StrictFuture __when_expr_3 = file->size(); + #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1loopBody1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1loopBody1cont3when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1loopBody1cont2when1(Reference const& __file,int loopDepth) + { + #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + file = __file; + #line 7765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont3(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont2when1(Reference && __file,int loopDepth) + { + file = std::move(__file); + loopDepth = a_body1cont1loopBody1cont3(loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WatchPublicKeyJwksFileActor, 2, Reference >::remove(); + + } + void a_callback_fire(ActorCallback< WatchPublicKeyJwksFileActor, 2, Reference >*,Reference const& value) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< WatchPublicKeyJwksFileActor, 2, Reference >*,Reference && value) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< WatchPublicKeyJwksFileActor, 2, Reference >*,Error err) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 2); + + } + int a_body1cont1loopBody1cont4(int loopDepth) + { + #line 2053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + json = std::string(filesize, '\0'); + #line 2054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (filesize > FLOW_KNOBS->PUBLIC_KEY_FILE_MAX_SIZE) + #line 7834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + { + #line 2055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + return a_body1cont1loopBody1Catch1(file_too_large(), loopDepth); + #line 7838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + } + #line 2056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (filesize <= 0) + #line 7842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + { + #line 2057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + TraceEvent(SevWarn, "AuthzPublicKeySetEmpty").suppressFor(60); + #line 7846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + return a_body1cont1loopHead1(loopDepth); // continue + } + #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + StrictFuture __when_expr_4 = success(file->read(&json[0], filesize, 0)); + #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 7853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont1loopBody1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont1loopBody1cont4when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 2060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 7858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1loopBody1cont3when1(int64_t const& __filesize,int loopDepth) + { + #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + filesize = __filesize; + #line 7867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont3when1(int64_t && __filesize,int loopDepth) + { + filesize = std::move(__filesize); + loopDepth = a_body1cont1loopBody1cont4(loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WatchPublicKeyJwksFileActor, 3, int64_t >::remove(); + + } + void a_callback_fire(ActorCallback< WatchPublicKeyJwksFileActor, 3, int64_t >*,int64_t const& value) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< WatchPublicKeyJwksFileActor, 3, int64_t >*,int64_t && value) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< WatchPublicKeyJwksFileActor, 3, int64_t >*,Error err) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 3); + + } + int a_body1cont1loopBody1cont5(Void const& _,int loopDepth) + { + #line 2061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + self->applyPublicKeySet(StringRef(json)); + #line 2062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + errorCount = 0; + #line 7936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont9(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont5(Void && _,int loopDepth) + { + #line 2061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + self->applyPublicKeySet(StringRef(json)); + #line 2062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + errorCount = 0; + #line 7947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont9(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont4when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont5(_, loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont4when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont5(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WatchPublicKeyJwksFileActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WatchPublicKeyJwksFileActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont1loopBody1cont4when1(value, 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< WatchPublicKeyJwksFileActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont1loopBody1cont4when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< WatchPublicKeyJwksFileActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1loopBody1Catch1(error, 0); + } catch (...) { + a_body1cont1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), 4); + + } + int a_body1cont1loopBody1cont9(int loopDepth) + { + try { + loopDepth = a_body1cont1loopBody1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + std::string filePath; + #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + TransportData* self; + #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + AsyncTrigger fileChanged; + #line 2036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + Future fileWatch; + #line 2037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + unsigned errorCount; + #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + Reference file; + #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + int64_t filesize; + #line 2053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + std::string json; + #line 8044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" +}; +// This generated class is to be used only via watchPublicKeyJwksFile() + #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +class WatchPublicKeyJwksFileActor final : public Actor, public ActorCallback< WatchPublicKeyJwksFileActor, 0, Void >, public ActorCallback< WatchPublicKeyJwksFileActor, 1, Void >, public ActorCallback< WatchPublicKeyJwksFileActor, 2, Reference >, public ActorCallback< WatchPublicKeyJwksFileActor, 3, int64_t >, public ActorCallback< WatchPublicKeyJwksFileActor, 4, Void >, public FastAllocated, public WatchPublicKeyJwksFileActorState { + #line 8049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< WatchPublicKeyJwksFileActor, 0, Void >; +friend struct ActorCallback< WatchPublicKeyJwksFileActor, 1, Void >; +friend struct ActorCallback< WatchPublicKeyJwksFileActor, 2, Reference >; +friend struct ActorCallback< WatchPublicKeyJwksFileActor, 3, int64_t >; +friend struct ActorCallback< WatchPublicKeyJwksFileActor, 4, Void >; + #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + WatchPublicKeyJwksFileActor(std::string const& filePath,TransportData* const& self) + #line 8064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" + : Actor(), + WatchPublicKeyJwksFileActorState(filePath, self) + { + fdb_probe_actor_enter("watchPublicKeyJwksFile", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("watchPublicKeyJwksFile"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("watchPublicKeyJwksFile", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< WatchPublicKeyJwksFileActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WatchPublicKeyJwksFileActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< WatchPublicKeyJwksFileActor, 2, Reference >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< WatchPublicKeyJwksFileActor, 3, int64_t >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< WatchPublicKeyJwksFileActor, 4, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" +[[nodiscard]] static Future watchPublicKeyJwksFile( std::string const& filePath, TransportData* const& self ) { + #line 2034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + return Future(new WatchPublicKeyJwksFileActor(filePath, self)); + #line 8096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.g.cpp" +} + +#line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowTransport.actor.cpp" + +void FlowTransport::watchPublicKeyFile(const std::string& publicKeyFilePath) { + self->publicKeyFileWatch = watchPublicKeyJwksFile(publicKeyFilePath, self); +} diff --git a/src/fdbrpc/HTTP.actor.cpp b/src/fdbrpc/HTTP.actor.cpp index 7f8a3ec..9f3e4ba 100644 --- a/src/fdbrpc/HTTP.actor.cpp +++ b/src/fdbrpc/HTTP.actor.cpp @@ -19,14 +19,16 @@ */ #include "fdbrpc/HTTP.h" +#include "fdbrpc/simulator.h" -#include - -#include "fmt/format.h" -#include "fdbclient/Knobs.h" +#include "flow/IRandom.h" +#include "flow/Net2Packet.h" #include "openssl/md5.h" -#include "fdbrpc/libb64/encode.h" +#include "libb64/encode.h" #include "flow/Knobs.h" +#include +#include "flow/IConnection.h" +#include #include "flow/actorcompiler.h" // has to be last include @@ -64,56 +66,132 @@ std::string urlEncode(const std::string& s) { return o; } -bool Response::verifyMD5(bool fail_if_header_missing, Optional content_sum) { - auto i = headers.find("Content-MD5"); - if (i != headers.end()) { +template +std::string ResponseBase::getCodeDescription() { + if (code == HTTP_STATUS_CODE_OK) { + return "OK"; + } else if (code == HTTP_STATUS_CODE_CREATED) { + return "Created"; + } else if (code == HTTP_STATUS_CODE_ACCEPTED) { + return "Accepted"; + } else if (code == HTTP_STATUS_CODE_NO_CONTENT) { + return "No Content"; + } else if (code == HTTP_STATUS_CODE_UNAUTHORIZED) { + return "Unauthorized"; + } else if (code == HTTP_STATUS_CODE_NOT_ACCEPTABLE) { + return "Not Acceptable"; + } else if (code == HTTP_STATUS_CODE_TIMEOUT) { + return "Timeout"; + } else if (code == HTTP_STATUS_CODE_TOO_MANY_REQUESTS) { + return "Too Many Requests"; + } else if (code == HTTP_STATUS_CODE_INTERNAL_SERVER_ERROR) { + return "Internal Server Error"; + } else if (code == HTTP_STATUS_CODE_BAD_GATEWAY) { + return "Bad Gateway"; + } else if (code == HTTP_STATUS_CODE_SERVICE_UNAVAILABLE) { + return "Service Unavailable"; + } else if (code == HTTP_STATUS_CODE_GATEWAY_TIMEOUT) { + return "Gateway Timeout"; + } else { + throw internal_error(); + } +} + +std::string computeMD5Sum(std::string content) { + MD5_CTX sum; + ::MD5_Init(&sum); + ::MD5_Update(&sum, content.data(), content.size()); + std::string sumBytes; + sumBytes.resize(16); + ::MD5_Final((unsigned char*)sumBytes.data(), &sum); + std::string sumStr = base64::encoder::from_string(sumBytes); + sumStr.resize(sumStr.size() - 1); + return sumStr; +} + +bool verifyMD5(HTTPData* data, bool fail_if_header_missing, Optional content_sum) { + auto i = data->headers.find("Content-MD5"); + if (i != data->headers.end()) { // If a content sum is not provided, calculate one from the response content if (!content_sum.present()) { - MD5_CTX sum; - ::MD5_Init(&sum); - ::MD5_Update(&sum, content.data(), content.size()); - std::string sumBytes; - sumBytes.resize(16); - ::MD5_Final((unsigned char*)sumBytes.data(), &sum); - std::string sumStr = base64::encoder::from_string(sumBytes); - sumStr.resize(sumStr.size() - 1); - content_sum = sumStr; + content_sum = computeMD5Sum(data->content); } return i->second == content_sum.get(); } return !fail_if_header_missing; } -std::string Response::toString() { - std::string r = format("Response Code: %d\n", code); - r += format("Response ContentLen: %lld\n", contentLen); - for (auto h : headers) - r += format("Reponse Header: %s: %s\n", h.first.c_str(), h.second.c_str()); +std::string IncomingResponse::toString() const { + std::string r = fmt::format("Response Code: {0}\n", code); + r += fmt::format("Response ContentLen: {0}\n", data.contentLen); + for (auto h : data.headers) + r += fmt::format("Reponse Header: {0}: {1}\n", h.first, h.second); r.append("-- RESPONSE CONTENT--\n"); - r.append(content); + r.append(data.content); r.append("\n--------\n"); return r; } -PacketBuffer* writeRequestHeader(std::string const& verb, - std::string const& resource, - HTTP::Headers const& headers, - PacketBuffer* dest) { - PacketWriter writer(dest, nullptr, Unversioned()); - writer.serializeBytes(verb); - writer.serializeBytes(" ", 1); - writer.serializeBytes(resource); - writer.serializeBytes(LiteralStringRef(" HTTP/1.1\r\n")); +void writeHeaders(HTTP::Headers const& headers, PacketWriter& writer) { for (auto h : headers) { writer.serializeBytes(h.first); - writer.serializeBytes(LiteralStringRef(": ")); + writer.serializeBytes(": "_sr); writer.serializeBytes(h.second); - writer.serializeBytes(LiteralStringRef("\r\n")); + writer.serializeBytes("\r\n"_sr); } - writer.serializeBytes(LiteralStringRef("\r\n")); + writer.serializeBytes("\r\n"_sr); +} + +PacketBuffer* writeRequestHeader(Reference req, PacketBuffer* dest) { + PacketWriter writer(dest, nullptr, Unversioned()); + writer.serializeBytes(req->verb); + writer.serializeBytes(" ", 1); + writer.serializeBytes(req->resource); + writer.serializeBytes(" HTTP/1.1\r\n"_sr); + + writeHeaders(req->data.headers, writer); + + return writer.finish(); +} + +PacketBuffer* writeResponseHeader(Reference response, PacketBuffer* dest) { + PacketWriter writer(dest, nullptr, Unversioned()); + writer.serializeBytes("HTTP/1.1 "_sr); + writer.serializeBytes(std::to_string(response->code)); + writer.serializeBytes(" ", 1); + writer.serializeBytes(response->getCodeDescription()); + writer.serializeBytes("\r\n"_sr); + + writeHeaders(response->data.headers, writer); + return writer.finish(); } +ACTOR Future writeResponse(Reference conn, Reference response) { + + // Write headers to a packet buffer chain + ASSERT(response.isValid()); + response->data.headers["Content-Length"] = std::to_string(response->data.contentLen); + PacketBuffer* pFirst = PacketBuffer::create(); + PacketBuffer* pLast = writeResponseHeader(response, pFirst); + // Prepend headers to content packer buffer chain + response->data.content->prependWriteBuffer(pFirst, pLast); + loop { + int trySend = FLOW_KNOBS->HTTP_SEND_SIZE; + if ((!g_network->isSimulated() || !g_simulator->speedUpSimulation) && BUGGIFY_WITH_PROB(0.01)) { + trySend = deterministicRandom()->randomInt(1, 10); + } + int len = conn->write(response->data.content->getUnsent(), trySend); + response->data.content->sent(len); + if (response->data.content->empty()) { + return Void(); + } + + wait(conn->onWritable()); + wait(yield(TaskPriority::WriteSocket)); + } +} + // Read at least 1 bytes from conn and up to maxlen in a single read, append read data into *buf // Returns the number of bytes read. ACTOR Future read_into_string(Reference conn, std::string* buf, int maxlen) { @@ -122,6 +200,7 @@ ACTOR Future read_into_string(Reference conn, std::string* buf int originalSize = buf->size(); // TODO: resize is zero-initializing the space we're about to overwrite, so do something else, which probably // means not using a string for this buffer + // FIXME: buggify read size as well buf->resize(originalSize + maxlen); uint8_t* wptr = (uint8_t*)buf->data() + originalSize; int len = conn->read(wptr, wptr + maxlen); @@ -150,11 +229,13 @@ ACTOR Future read_delimited_into_string(Reference conn, loop { size_t endPos = buf->find(delim, sPos); - if (endPos != std::string::npos) + if (endPos != std::string::npos) { return endPos - pos; + } // Next search will start at the current end of the buffer - delim size + 1 - if (sPos >= lookBack) - sPos -= lookBack; + if (buf->size() >= lookBack) { + sPos = buf->size() - lookBack; + } wait(success(read_into_string(conn, buf, FLOW_KNOBS->HTTP_READ_SIZE))); } } @@ -221,28 +302,18 @@ ACTOR Future read_http_response_headers(Reference conn, } } -// Reads an HTTP response from a network connection -// If the connection fails while being read the exception will emitted -// If the response is not parsable or complete in some way, http_bad_response will be thrown -ACTOR Future read_http_response(Reference r, Reference conn, bool header_only) { - state std::string buf; - state size_t pos = 0; - - // Read HTTP response code and version line - size_t lineLen = wait(read_delimited_into_string(conn, "\r\n", &buf, pos)); - - int reachedEnd = -1; - sscanf(buf.c_str() + pos, "HTTP/%f %d%n", &r->version, &r->code, &reachedEnd); - if (reachedEnd < 0) - throw http_bad_response(); - - // Move position past the line found and the delimiter length - pos += lineLen + 2; - +// FIXME: should this throw a different error for http requests? Or should we rename http_bad_response to +// http_bad_? +ACTOR Future readHTTPData(HTTPData* r, + Reference conn, + std::string* buf, + size_t* pos, + bool content_optional, + bool skipCheckMD5) { // Read headers r->headers.clear(); - wait(read_http_response_headers(conn, &r->headers, &buf, &pos)); + wait(read_http_response_headers(conn, &r->headers, buf, pos)); auto i = r->headers.find("Content-Length"); if (i != r->headers.end()) @@ -257,20 +328,21 @@ ACTOR Future read_http_response(Reference r, Referencecontent.clear(); - // If this is supposed to be a header-only response and the buffer has been fully processed then stop. Otherwise, + // If this is allowed to be a header-only response and the buffer has been fully processed then stop. Otherwise, // there must be response content. - if (header_only && pos == buf.size()) + if (content_optional && *pos == buf->size()) { return Void(); + } // There should be content (or at least metadata describing that there is no content. // Chunked transfer and 'normal' mode (content length given, data in one segment after headers) are supported. if (r->contentLen >= 0) { // Use response content as the buffer so there's no need to copy it later. - r->content = buf.substr(pos); - pos = 0; + r->content = buf->substr(*pos); + *pos = 0; // Read until there are at least contentLen bytes available at pos - wait(read_fixed_into_string(conn, r->contentLen, &r->content, pos)); + wait(read_fixed_into_string(conn, r->contentLen, &r->content, *pos)); // There shouldn't be any bytes after content. if (r->content.size() != r->contentLen) @@ -279,47 +351,47 @@ ACTOR Future read_http_response(Reference r, Referencecontent = buf.substr(pos); - pos = 0; + r->content = buf->substr(*pos); + *pos = 0; loop { { // Read the line that contains the chunk length as text in hex - size_t lineLen = wait(read_delimited_into_string(conn, "\r\n", &r->content, pos)); - state int chunkLen = strtol(r->content.substr(pos, lineLen).c_str(), nullptr, 16); + size_t lineLen = wait(read_delimited_into_string(conn, "\r\n", &r->content, *pos)); + state int chunkLen = strtol(r->content.substr(*pos, lineLen).c_str(), nullptr, 16); // Instead of advancing pos, erase the chunk length header line (line length + delimiter size) from the // content buffer - r->content.erase(pos, lineLen + 2); + r->content.erase(*pos, lineLen + 2); // If chunkLen is 0 then this marks the end of the content chunks. if (chunkLen == 0) break; // Read (if needed) until chunkLen bytes are available at pos, then advance pos by chunkLen - wait(read_fixed_into_string(conn, chunkLen, &r->content, pos)); - pos += chunkLen; + wait(read_fixed_into_string(conn, chunkLen, &r->content, *pos)); + *pos += chunkLen; } { // Read the final empty line at the end of the chunk (the required "\r\n" after the chunk bytes) - size_t lineLen = wait(read_delimited_into_string(conn, "\r\n", &r->content, pos)); + size_t lineLen = wait(read_delimited_into_string(conn, "\r\n", &r->content, *pos)); if (lineLen != 0) throw http_bad_response(); // Instead of advancing pos, erase the empty line from the content buffer - r->content.erase(pos, 2); + r->content.erase(*pos, 2); } } // The content buffer now contains the de-chunked, contiguous content at position 0 to pos. Save this length. - r->contentLen = pos; + r->contentLen = *pos; // Next is the post-chunk header block, so read that. - wait(read_http_response_headers(conn, &r->headers, &r->content, &pos)); + wait(read_http_response_headers(conn, &r->headers, &r->content, pos)); // If the header parsing did not consume all of the buffer then something is wrong - if (pos != r->content.size()) + if (*pos != r->content.size()) throw http_bad_response(); // Now truncate the buffer to just the dechunked contiguous content. @@ -331,11 +403,11 @@ ACTOR Future read_http_response(Reference r, Referencecontent.size() > 0) { - if (r->code == 206 && CLIENT_KNOBS->HTTP_RESPONSE_SKIP_VERIFY_CHECKSUM_FOR_PARTIAL_CONTENT) { + if (skipCheckMD5) { return Void(); } - if (!r->verifyMD5(false)) { // false arg means do not fail if the Content-MD5 header is missing. + if (!HTTP::verifyMD5(r, false)) { // false arg means do not fail if the Content-MD5 header is missing. throw http_bad_response(); } } @@ -343,35 +415,116 @@ ACTOR Future read_http_response(Reference r, Reference HTTP::Response::read(Reference conn, bool header_only) { - return read_http_response(Reference::addRef(this), conn, header_only); +// Reads an HTTP request from a network connection +// If the connection fails while being read the exception will emitted +// If the response is not parsable or complete in some way, http_bad_response will be thrown +ACTOR Future read_http_request(Reference r, Reference conn) { + state std::string buf; + state size_t pos = 0; + + // Read HTTP response code and version line + size_t lineLen = wait(read_delimited_into_string(conn, "\r\n", &buf, pos)); + + // FIXME: this is pretty inefficient with 2 copies, but sscanf isn't the best with strings + std::string requestLine = buf.substr(0, lineLen); + std::stringstream ss(requestLine); + + // read verb + ss >> r->verb; + if (ss.fail()) { + throw http_bad_response(); + } + + // read resource + ss >> r->resource; + if (ss.fail()) { + throw http_bad_response(); + } + + // read http version + std::string httpVersion; + ss >> httpVersion; + if (ss.fail()) { + throw http_bad_response(); + } + + if (ss && !ss.eof()) { + throw http_bad_response(); + } + + float version; + sscanf(httpVersion.c_str(), "HTTP/%f", &version); + if (version < 1.1) { + throw http_bad_response(); + } + + // Move position past the line found and the delimiter length + pos += lineLen + 2; + + wait(readHTTPData(&r->data, conn, &buf, &pos, false, false)); + + return Void(); +} + +Future HTTP::IncomingRequest::read(Reference conn, bool header_only) { + return read_http_request(Reference::addRef(this), conn); +} + +Future HTTP::OutgoingResponse::write(Reference conn) { + return writeResponse(conn, Reference::addRef(this)); +} + +void HTTP::OutgoingResponse::reset() { + data.headers = HTTP::Headers(); + data.content->discardAll(); + data.contentLen = 0; +} + +// Reads an HTTP response from a network connection +// If the connection fails while being read the exception will emitted +// If the response is not parsable or complete in some way, http_bad_response will be thrown +ACTOR Future read_http_response(Reference r, + Reference conn, + bool header_only) { + state std::string buf; + state size_t pos = 0; + + // Read HTTP request line + size_t lineLen = wait(read_delimited_into_string(conn, "\r\n", &buf, pos)); + + int reachedEnd = -1; + sscanf(buf.c_str() + pos, "HTTP/%f %d%n", &r->version, &r->code, &reachedEnd); + if (reachedEnd < 0) + throw http_bad_response(); + + // Move position past the line found and the delimiter length + pos += lineLen + 2; + + bool skipCheckMD5 = r->code == 206 && FLOW_KNOBS->HTTP_RESPONSE_SKIP_VERIFY_CHECKSUM_FOR_PARTIAL_CONTENT; + + wait(readHTTPData(&r->data, conn, &buf, &pos, header_only, skipCheckMD5)); + + return Void(); +} + +Future HTTP::IncomingResponse::read(Reference conn, bool header_only) { + return read_http_response(Reference::addRef(this), conn, header_only); } // Do a request, get a Response. -// Request content is provided as UnsentPacketQueue *pContent which will be depleted as bytes are sent but the queue +// Request content is provided as UnsentPacketQueue in req, which will be depleted as bytes are sent but the queue // itself must live for the life of this actor and be destroyed by the caller // TODO: pSent is very hackish, do something better. -ACTOR Future> doRequest(Reference conn, - std::string verb, - std::string resource, - HTTP::Headers headers, - UnsentPacketQueue* pContent, - int contentLen, - Reference sendRate, - int64_t* pSent, - Reference recvRate, - std::string requestIDHeader) { +ACTOR Future> doRequestActor(Reference conn, + Reference request, + Reference sendRate, + int64_t* pSent, + Reference recvRate) { state TraceEvent event(SevDebug, "HTTPRequest"); - state UnsentPacketQueue empty; - if (pContent == nullptr) - pContent = ∅ - // There is no standard http request id header field, so either a global default can be set via a knob // or it can be set per-request with the requestIDHeader argument (which overrides the default) - if (requestIDHeader.empty()) { - requestIDHeader = FLOW_KNOBS->HTTP_REQUEST_ID_HEADER; - } + state std::string requestIDHeader = FLOW_KNOBS->HTTP_REQUEST_ID_HEADER; state bool earlyResponse = false; state int total_sent = 0; @@ -379,9 +532,9 @@ ACTOR Future> doRequest(Reference conn, event.detail("DebugID", conn->getDebugID()); event.detail("RemoteAddress", conn->getPeerAddress()); - event.detail("Verb", verb); - event.detail("Resource", resource); - event.detail("RequestContentLen", contentLen); + event.detail("Verb", request->verb); + event.detail("Resource", request->resource); + event.detail("RequestContentLen", request->data.contentLen); try { state std::string requestID; @@ -392,52 +545,57 @@ ACTOR Future> doRequest(Reference conn, requestID = requestID.insert(12, "-"); requestID = requestID.insert(8, "-"); - headers[requestIDHeader] = requestID; + request->data.headers[requestIDHeader] = requestID; event.detail("RequestIDSent", requestID); } + request->data.headers["Content-Length"] = std::to_string(request->data.contentLen); // Write headers to a packet buffer chain PacketBuffer* pFirst = PacketBuffer::create(); - PacketBuffer* pLast = writeRequestHeader(verb, resource, headers, pFirst); + PacketBuffer* pLast = writeRequestHeader(request, pFirst); // Prepend headers to content packer buffer chain - pContent->prependWriteBuffer(pFirst, pLast); + request->data.content->prependWriteBuffer(pFirst, pLast); if (FLOW_KNOBS->HTTP_VERBOSE_LEVEL > 1) - printf("[%s] HTTP starting %s %s ContentLen:%d\n", - conn->getDebugID().toString().c_str(), - verb.c_str(), - resource.c_str(), - contentLen); + fmt::print("[{}] HTTP starting {} {} ContentLen:{}\n", + conn->getDebugID().toString(), + request->verb, + request->resource, + request->data.contentLen); if (FLOW_KNOBS->HTTP_VERBOSE_LEVEL > 2) { - for (auto h : headers) - printf("Request Header: %s: %s\n", h.first.c_str(), h.second.c_str()); + for (auto h : request->data.headers) + fmt::print("Request Header: {}: {}\n", h.first, h.second); } - state Reference r(new HTTP::Response()); - state Future responseReading = r->read(conn, verb == "HEAD" || verb == "DELETE" || verb == "CONNECT"); + state Reference r(new HTTP::IncomingResponse()); + state Future responseReading = r->read(conn, request->isHeaderOnlyResponse()); send_start = timer(); + // too many state things here to refactor this with writing the response loop { // If we already got a response, before finishing sending the request, then close the connection, // set the Connection header to "close" as a hint to the caller that this connection can't be used // again, and break out of the send loop. if (responseReading.isReady()) { conn->close(); - r->headers["Connection"] = "close"; + r->data.headers["Connection"] = "close"; earlyResponse = true; break; } state int trySend = FLOW_KNOBS->HTTP_SEND_SIZE; + if ((!g_network->isSimulated() || !g_simulator->speedUpSimulation) && BUGGIFY_WITH_PROB(0.01)) { + trySend = deterministicRandom()->randomInt(1, 10); + } wait(sendRate->getAllowance(trySend)); - int len = conn->write(pContent->getUnsent(), trySend); + int len = conn->write(request->data.content->getUnsent(), trySend); if (pSent != nullptr) *pSent += len; sendRate->returnUnused(trySend - len); total_sent += len; - pContent->sent(len); - if (pContent->empty()) + request->data.content->sent(len); + if (request->data.content->empty()) break; wait(conn->onWritable()); @@ -448,14 +606,14 @@ ACTOR Future> doRequest(Reference conn, double elapsed = timer() - send_start; event.detail("ResponseCode", r->code); - event.detail("ResponseContentLen", r->contentLen); + event.detail("ResponseContentLen", r->data.contentLen); event.detail("Elapsed", elapsed); Optional err; if (!requestIDHeader.empty()) { std::string responseID; - auto iid = r->headers.find(requestIDHeader); - if (iid != r->headers.end()) { + auto iid = r->data.headers.find(requestIDHeader); + if (iid != r->data.headers.end()) { responseID = iid->second; } event.detail("RequestIDReceived", responseID); @@ -473,11 +631,11 @@ ACTOR Future> doRequest(Reference conn, .error(err.get()) .detail("DebugID", conn->getDebugID()) .detail("RemoteAddress", conn->getPeerAddress()) - .detail("Verb", verb) - .detail("Resource", resource) - .detail("RequestContentLen", contentLen) + .detail("Verb", request->verb) + .detail("Resource", request->resource) + .detail("RequestContentLen", request->data.contentLen) .detail("ResponseCode", r->code) - .detail("ResponseContentLen", r->contentLen) + .detail("ResponseContentLen", r->data.contentLen) .detail("RequestIDSent", requestID) .detail("RequestIDReceived", responseID); } @@ -491,18 +649,18 @@ ACTOR Future> doRequest(Reference conn, r->code, earlyResponse, elapsed, - verb, - resource, - contentLen, + request->verb, + request->resource, + request->data.contentLen, total_sent, - r->contentLen); + r->data.contentLen); } if (FLOW_KNOBS->HTTP_VERBOSE_LEVEL > 2) { - printf("[%s] HTTP RESPONSE: %s %s\n%s\n", - conn->getDebugID().toString().c_str(), - verb.c_str(), - resource.c_str(), - r->toString().c_str()); + fmt::print("[{}] HTTP RESPONSE: {} {}\n{}\n", + conn->getDebugID().toString(), + request->verb, + request->resource, + r->toString()); } if (err.present()) { @@ -514,50 +672,57 @@ ACTOR Future> doRequest(Reference conn, double elapsed = timer() - send_start; // A bad_request_id error would have already been logged in verbose mode before err is thrown above. if (FLOW_KNOBS->HTTP_VERBOSE_LEVEL > 0 && e.code() != error_code_http_bad_request_id) { - printf("[%s] HTTP *ERROR*=%s early=%d, time=%fs %s %s contentLen=%d [%d out]\n", - conn->getDebugID().toString().c_str(), - e.name(), - earlyResponse, - elapsed, - verb.c_str(), - resource.c_str(), - contentLen, - total_sent); + fmt::print("[{}] HTTP *ERROR*={} early={}, time={}s {} {} contentLen={} [{} out]\n", + conn->getDebugID().toString(), + e.name(), + earlyResponse, + elapsed, + request->verb, + request->resource, + request->data.contentLen, + total_sent); } event.errorUnsuppressed(e); throw; } } +// IDE build didn't like the actor conversion i guess +Future> doRequest(Reference conn, + Reference request, + Reference sendRate, + int64_t* pSent, + Reference recvRate) { + return doRequestActor(conn, request, sendRate, pSent, recvRate); +} + ACTOR Future sendProxyConnectRequest(Reference conn, std::string remoteHost, std::string remoteService) { - state Headers headers; - headers["Host"] = remoteHost + ":" + remoteService; - headers["Accept"] = "application/xml"; - headers["Proxy-Connection"] = "Keep-Alive"; state int requestTimeout = 60; - state int maxTries = FLOW_KNOBS->HTTP_CONNECT_TRIES; + state int maxTries = FLOW_KNOBS->RESTCLIENT_CONNECT_TRIES; state int thisTry = 1; state double nextRetryDelay = 2.0; state Reference sendReceiveRate = makeReference(); state int64_t bytes_sent = 0; + state Reference req = makeReference(); + req->verb = HTTP_VERB_CONNECT; + req->resource = remoteHost + ":" + remoteService; + req->data.content = nullptr; + req->data.contentLen = 0; + req->data.headers["Host"] = req->resource; + req->data.headers["Accept"] = "application/xml"; + req->data.headers["Proxy-Connection"] = "Keep-Alive"; loop { state Optional err; - state Reference r; + + state Reference r; try { - Reference _r = wait(timeoutError(doRequest(conn, - "CONNECT", - remoteHost + ":" + remoteService, - headers, - nullptr, - 0, - sendReceiveRate, - &bytes_sent, - sendReceiveRate), - requestTimeout)); + Future> f = + HTTP::doRequest(conn, req, sendReceiveRate, &bytes_sent, sendReceiveRate); + Reference _r = wait(timeoutError(f, requestTimeout)); r = _r; } catch (Error& e) { if (e.code() == error_code_actor_cancelled) @@ -603,8 +768,8 @@ ACTOR Future sendProxyConnectRequest(Reference conn, if (retryable) { // If r is valid then obey the Retry-After response header if present. if (r) { - auto iRetryAfter = r->headers.find("Retry-After"); - if (iRetryAfter != r->headers.end()) { + auto iRetryAfter = r->data.headers.find("Retry-After"); + if (iRetryAfter != r->data.headers.end()) { event.detail("RetryAfterHeader", iRetryAfter->second); char* pEnd; double retryAfter = strtod(iRetryAfter->second.c_str(), &pEnd); diff --git a/src/fdbrpc/HTTP.actor.g.cpp b/src/fdbrpc/HTTP.actor.g.cpp index f608511..f5fdccb 100644 --- a/src/fdbrpc/HTTP.actor.g.cpp +++ b/src/fdbrpc/HTTP.actor.g.cpp @@ -21,14 +21,16 @@ */ #include "fdbrpc/HTTP.h" +#include "fdbrpc/simulator.h" -#include - -#include "fmt/format.h" -#include "fdbclient/Knobs.h" +#include "flow/IRandom.h" +#include "flow/Net2Packet.h" #include "openssl/md5.h" -#include "fdbrpc/libb64/encode.h" +#include "libb64/encode.h" #include "flow/Knobs.h" +#include +#include "flow/IConnection.h" +#include #include "flow/actorcompiler.h" // has to be last include @@ -66,76 +68,459 @@ std::string urlEncode(const std::string& s) { return o; } -bool Response::verifyMD5(bool fail_if_header_missing, Optional content_sum) { - auto i = headers.find("Content-MD5"); - if (i != headers.end()) { +template +std::string ResponseBase::getCodeDescription() { + if (code == HTTP_STATUS_CODE_OK) { + return "OK"; + } else if (code == HTTP_STATUS_CODE_CREATED) { + return "Created"; + } else if (code == HTTP_STATUS_CODE_ACCEPTED) { + return "Accepted"; + } else if (code == HTTP_STATUS_CODE_NO_CONTENT) { + return "No Content"; + } else if (code == HTTP_STATUS_CODE_UNAUTHORIZED) { + return "Unauthorized"; + } else if (code == HTTP_STATUS_CODE_NOT_ACCEPTABLE) { + return "Not Acceptable"; + } else if (code == HTTP_STATUS_CODE_TIMEOUT) { + return "Timeout"; + } else if (code == HTTP_STATUS_CODE_TOO_MANY_REQUESTS) { + return "Too Many Requests"; + } else if (code == HTTP_STATUS_CODE_INTERNAL_SERVER_ERROR) { + return "Internal Server Error"; + } else if (code == HTTP_STATUS_CODE_BAD_GATEWAY) { + return "Bad Gateway"; + } else if (code == HTTP_STATUS_CODE_SERVICE_UNAVAILABLE) { + return "Service Unavailable"; + } else if (code == HTTP_STATUS_CODE_GATEWAY_TIMEOUT) { + return "Gateway Timeout"; + } else { + throw internal_error(); + } +} + +std::string computeMD5Sum(std::string content) { + MD5_CTX sum; + ::MD5_Init(&sum); + ::MD5_Update(&sum, content.data(), content.size()); + std::string sumBytes; + sumBytes.resize(16); + ::MD5_Final((unsigned char*)sumBytes.data(), &sum); + std::string sumStr = base64::encoder::from_string(sumBytes); + sumStr.resize(sumStr.size() - 1); + return sumStr; +} + +bool verifyMD5(HTTPData* data, bool fail_if_header_missing, Optional content_sum) { + auto i = data->headers.find("Content-MD5"); + if (i != data->headers.end()) { // If a content sum is not provided, calculate one from the response content if (!content_sum.present()) { - MD5_CTX sum; - ::MD5_Init(&sum); - ::MD5_Update(&sum, content.data(), content.size()); - std::string sumBytes; - sumBytes.resize(16); - ::MD5_Final((unsigned char*)sumBytes.data(), &sum); - std::string sumStr = base64::encoder::from_string(sumBytes); - sumStr.resize(sumStr.size() - 1); - content_sum = sumStr; + content_sum = computeMD5Sum(data->content); } return i->second == content_sum.get(); } return !fail_if_header_missing; } -std::string Response::toString() { - std::string r = format("Response Code: %d\n", code); - r += format("Response ContentLen: %lld\n", contentLen); - for (auto h : headers) - r += format("Reponse Header: %s: %s\n", h.first.c_str(), h.second.c_str()); +std::string IncomingResponse::toString() const { + std::string r = fmt::format("Response Code: {0}\n", code); + r += fmt::format("Response ContentLen: {0}\n", data.contentLen); + for (auto h : data.headers) + r += fmt::format("Reponse Header: {0}: {1}\n", h.first, h.second); r.append("-- RESPONSE CONTENT--\n"); - r.append(content); + r.append(data.content); r.append("\n--------\n"); return r; } -PacketBuffer* writeRequestHeader(std::string const& verb, - std::string const& resource, - HTTP::Headers const& headers, - PacketBuffer* dest) { - PacketWriter writer(dest, nullptr, Unversioned()); - writer.serializeBytes(verb); - writer.serializeBytes(" ", 1); - writer.serializeBytes(resource); - writer.serializeBytes(LiteralStringRef(" HTTP/1.1\r\n")); +void writeHeaders(HTTP::Headers const& headers, PacketWriter& writer) { for (auto h : headers) { writer.serializeBytes(h.first); - writer.serializeBytes(LiteralStringRef(": ")); + writer.serializeBytes(": "_sr); writer.serializeBytes(h.second); - writer.serializeBytes(LiteralStringRef("\r\n")); + writer.serializeBytes("\r\n"_sr); } - writer.serializeBytes(LiteralStringRef("\r\n")); + writer.serializeBytes("\r\n"_sr); +} + +PacketBuffer* writeRequestHeader(Reference req, PacketBuffer* dest) { + PacketWriter writer(dest, nullptr, Unversioned()); + writer.serializeBytes(req->verb); + writer.serializeBytes(" ", 1); + writer.serializeBytes(req->resource); + writer.serializeBytes(" HTTP/1.1\r\n"_sr); + + writeHeaders(req->data.headers, writer); + return writer.finish(); } +PacketBuffer* writeResponseHeader(Reference response, PacketBuffer* dest) { + PacketWriter writer(dest, nullptr, Unversioned()); + writer.serializeBytes("HTTP/1.1 "_sr); + writer.serializeBytes(std::to_string(response->code)); + writer.serializeBytes(" ", 1); + writer.serializeBytes(response->getCodeDescription()); + writer.serializeBytes("\r\n"_sr); + + writeHeaders(response->data.headers, writer); + + return writer.finish(); +} + + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +// This generated class is to be used only via writeResponse() + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +template + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +class WriteResponseActorState { + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +public: + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + WriteResponseActorState(Reference const& conn,Reference const& response) + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + : conn(conn), + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + response(response) + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + fdb_probe_actor_create("writeResponse", reinterpret_cast(this)); + + } + ~WriteResponseActorState() + { + fdb_probe_actor_destroy("writeResponse", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + ASSERT(response.isValid()); + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + response->data.headers["Content-Length"] = std::to_string(response->data.contentLen); + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + PacketBuffer* pFirst = PacketBuffer::create(); + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + PacketBuffer* pLast = writeResponseHeader(response, pFirst); + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + response->data.content->prependWriteBuffer(pFirst, pLast); + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + ; + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~WriteResponseActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + int trySend = FLOW_KNOBS->HTTP_SEND_SIZE; + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if ((!g_network->isSimulated() || !g_simulator->speedUpSimulation) && BUGGIFY_WITH_PROB(0.01)) + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + trySend = deterministicRandom()->randomInt(1, 10); + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + int len = conn->write(response->data.content->getUnsent(), trySend); + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + response->data.content->sent(len); + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (response->data.content->empty()) + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteResponseActorState(); static_cast(this)->destroy(); return 0; } + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteResponseActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_0 = conn->onWritable(); + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1(Void const& _,int loopDepth) + { + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_1 = yield(TaskPriority::WriteSocket); + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1(Void && _,int loopDepth) + { + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_1 = yield(TaskPriority::WriteSocket); + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteResponseActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WriteResponseActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("writeResponse", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeResponse", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< WriteResponseActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("writeResponse", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeResponse", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< WriteResponseActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("writeResponse", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeResponse", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont4(Void const& _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteResponseActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WriteResponseActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("writeResponse", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeResponse", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< WriteResponseActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("writeResponse", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeResponse", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< WriteResponseActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("writeResponse", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("writeResponse", reinterpret_cast(this), 1); + + } + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Reference conn; + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Reference response; + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +}; +// This generated class is to be used only via writeResponse() + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +class WriteResponseActor final : public Actor, public ActorCallback< WriteResponseActor, 0, Void >, public ActorCallback< WriteResponseActor, 1, Void >, public FastAllocated, public WriteResponseActorState { + #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< WriteResponseActor, 0, Void >; +friend struct ActorCallback< WriteResponseActor, 1, Void >; + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + WriteResponseActor(Reference const& conn,Reference const& response) + #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + : Actor(), + WriteResponseActorState(conn, response) + { + fdb_probe_actor_enter("writeResponse", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("writeResponse"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("writeResponse", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< WriteResponseActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WriteResponseActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +[[nodiscard]] Future writeResponse( Reference const& conn, Reference const& response ) { + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return Future(new WriteResponseActor(conn, response)); + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +} + +#line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + // Read at least 1 bytes from conn and up to maxlen in a single read, append read data into *buf // Returns the number of bytes read. - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" // This generated class is to be used only via read_into_string() - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" template - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" class Read_into_stringActorState { - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Read_into_stringActorState(Reference const& conn,std::string* const& buf,int const& maxlen) - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" : conn(conn), - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" buf(buf), - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" maxlen(maxlen) - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { fdb_probe_actor_create("read_into_string", reinterpret_cast(this)); @@ -148,9 +533,9 @@ class Read_into_stringActorState { int a_body1(int loopDepth=0) { try { - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" ; - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -178,70 +563,70 @@ class Read_into_stringActorState { } int a_body1loopBody1(int loopDepth) { - #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int originalSize = buf->size(); - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" buf->resize(originalSize + maxlen); - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" uint8_t* wptr = (uint8_t*)buf->data() + originalSize; - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int len = conn->read(wptr, wptr + maxlen); - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" buf->resize(originalSize + len); - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (len > 0) - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(len); this->~Read_into_stringActorState(); static_cast(this)->destroy(); return 0; } - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(len); this->~Read_into_stringActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_0 = conn->onReadable(); - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_1 = delay(0, TaskPriority::ReadSocket); - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_1 = delay(0, TaskPriority::ReadSocket); - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -384,18 +769,18 @@ class Read_into_stringActorState { fdb_probe_actor_exit("read_into_string", reinterpret_cast(this), 1); } - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Reference conn; - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string* buf; - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int maxlen; - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" }; // This generated class is to be used only via read_into_string() - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" class Read_into_stringActor final : public Actor, public ActorCallback< Read_into_stringActor, 0, Void >, public ActorCallback< Read_into_stringActor, 1, Void >, public FastAllocated, public Read_into_stringActorState { - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -405,9 +790,9 @@ class Read_into_stringActor final : public Actor, public ActorCallback< Rea #pragma clang diagnostic pop friend struct ActorCallback< Read_into_stringActor, 0, Void >; friend struct ActorCallback< Read_into_stringActor, 1, Void >; - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Read_into_stringActor(Reference const& conn,std::string* const& buf,int const& maxlen) - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" : Actor(), Read_into_stringActorState(conn, buf, maxlen) { @@ -431,42 +816,42 @@ friend struct ActorCallback< Read_into_stringActor, 1, Void >; } }; - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" [[nodiscard]] Future read_into_string( Reference const& conn, std::string* const& buf, int const& maxlen ) { - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return Future(new Read_into_stringActor(conn, buf, maxlen)); - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } -#line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +#line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" // Returns the position of delim within buf, relative to pos. If delim is not found, continues to read from conn until // either it is found or the connection ends, at which point connection_failed is thrown and buf contains // everything that was read up to that point. - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" // This generated class is to be used only via read_delimited_into_string() - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" template - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" class Read_delimited_into_stringActorState { - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Read_delimited_into_stringActorState(Reference const& conn,const char* const& delim,std::string* const& buf,size_t const& pos) - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" : conn(conn), - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" delim(delim), - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" buf(buf), - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" pos(pos), - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" sPos(pos), - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" lookBack(strlen(delim) - 1) - #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { fdb_probe_actor_create("read_delimited_into_string", reinterpret_cast(this)); @@ -479,11 +864,11 @@ class Read_delimited_into_stringActorState { int a_body1(int loopDepth=0) { try { - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" ASSERT(lookBack >= 0); - #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" ; - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -511,38 +896,38 @@ class Read_delimited_into_stringActorState { } int a_body1loopBody1(int loopDepth) { - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" size_t endPos = buf->find(delim, sPos); - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (endPos != std::string::npos) - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(endPos - pos); this->~Read_delimited_into_stringActorState(); static_cast(this)->destroy(); return 0; } - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" new (&static_cast(this)->SAV< size_t >::value()) size_t(endPos - pos); this->~Read_delimited_into_stringActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (sPos >= lookBack) - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (buf->size() >= lookBack) + #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - sPos -= lookBack; - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + sPos = buf->size() - lookBack; + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_0 = success(read_into_string(conn, buf, FLOW_KNOBS->HTTP_READ_SIZE)); - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -622,24 +1007,24 @@ class Read_delimited_into_stringActorState { fdb_probe_actor_exit("read_delimited_into_string", reinterpret_cast(this), 0); } - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Reference conn; - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" const char* delim; - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string* buf; - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" size_t pos; - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" size_t sPos; - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int lookBack; - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" }; // This generated class is to be used only via read_delimited_into_string() - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" class Read_delimited_into_stringActor final : public Actor, public ActorCallback< Read_delimited_into_stringActor, 0, Void >, public FastAllocated, public Read_delimited_into_stringActorState { - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -648,9 +1033,9 @@ class Read_delimited_into_stringActor final : public Actor, public Actor void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Read_delimited_into_stringActor, 0, Void >; - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Read_delimited_into_stringActor(Reference const& conn,const char* const& delim,std::string* const& buf,size_t const& pos) - #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" : Actor(), Read_delimited_into_stringActorState(conn, delim, buf, pos) { @@ -673,38 +1058,38 @@ friend struct ActorCallback< Read_delimited_into_stringActor, 0, Void >; } }; - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" [[nodiscard]] Future read_delimited_into_string( Reference const& conn, const char* const& delim, std::string* const& buf, size_t const& pos ) { - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return Future(new Read_delimited_into_stringActor(conn, delim, buf, pos)); - #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } -#line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +#line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" // Reads from conn (as needed) until there are at least len bytes starting at pos in buf - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" // This generated class is to be used only via read_fixed_into_string() - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" template - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" class Read_fixed_into_stringActorState { - #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Read_fixed_into_stringActorState(Reference const& conn,int const& len,std::string* const& buf,size_t const& pos) - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" : conn(conn), - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" len(len), - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" buf(buf), - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" pos(pos), - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" stop_size(pos + len) - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { fdb_probe_actor_create("read_fixed_into_string", reinterpret_cast(this)); @@ -717,9 +1102,9 @@ class Read_fixed_into_stringActorState { int a_body1(int loopDepth=0) { try { - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" ; - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -740,9 +1125,9 @@ class Read_fixed_into_stringActorState { } int a_body1cont1(int loopDepth) { - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Read_fixed_into_stringActorState(); static_cast(this)->destroy(); return 0; } - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Read_fixed_into_stringActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -759,22 +1144,22 @@ class Read_fixed_into_stringActorState { } int a_body1loopBody1(int loopDepth) { - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!(buf->size() < stop_size)) - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_0 = success(read_into_string(conn, buf, FLOW_KNOBS->HTTP_READ_SIZE)); - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -867,22 +1252,22 @@ class Read_fixed_into_stringActorState { fdb_probe_actor_exit("read_fixed_into_string", reinterpret_cast(this), 0); } - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Reference conn; - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int len; - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string* buf; - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" size_t pos; - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int stop_size; - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" }; // This generated class is to be used only via read_fixed_into_string() - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" class Read_fixed_into_stringActor final : public Actor, public ActorCallback< Read_fixed_into_stringActor, 0, Void >, public FastAllocated, public Read_fixed_into_stringActorState { - #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -891,9 +1276,9 @@ class Read_fixed_into_stringActor final : public Actor, public ActorCallba void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Read_fixed_into_stringActor, 0, Void >; - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Read_fixed_into_stringActor(Reference const& conn,int const& len,std::string* const& buf,size_t const& pos) - #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" : Actor(), Read_fixed_into_stringActorState(conn, len, buf, pos) { @@ -916,35 +1301,35 @@ friend struct ActorCallback< Read_fixed_into_stringActor, 0, Void >; } }; - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" [[nodiscard]] Future read_fixed_into_string( Reference const& conn, int const& len, std::string* const& buf, size_t const& pos ) { - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return Future(new Read_fixed_into_stringActor(conn, len, buf, pos)); - #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } -#line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +#line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" // This generated class is to be used only via read_http_response_headers() - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" template - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" class Read_http_response_headersActorState { - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Read_http_response_headersActorState(Reference const& conn,Headers* const& headers,std::string* const& buf,size_t* const& pos) - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" : conn(conn), - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" headers(headers), - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" buf(buf), - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" pos(pos) - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { fdb_probe_actor_create("read_http_response_headers", reinterpret_cast(this)); @@ -957,9 +1342,9 @@ class Read_http_response_headersActorState { int a_body1(int loopDepth=0) { try { - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" ; - #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -987,160 +1372,160 @@ class Read_http_response_headersActorState { } int a_body1loopBody1(int loopDepth) { - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_0 = read_delimited_into_string(conn, "\r\n", buf, *pos); - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(size_t const& lineLen,int loopDepth) { - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (lineLen == 0) - #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" *pos += 2; - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Read_http_response_headersActorState(); static_cast(this)->destroy(); return 0; } - #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Read_http_response_headersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int nameEnd = -1, valueStart = -1, valueEnd = -1; - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int len = -1; - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string name, value; - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (sscanf(buf->c_str() + *pos, "%*[^:]%n:%*[ \t]%n", &nameEnd, &valueStart) >= 0 && valueStart > 0) - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" name = std::string(buf->substr(*pos, nameEnd)); - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" *pos += valueStart; - #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } else { - #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(http_bad_response(), std::max(0, loopDepth - 1)); - #line 1040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (sscanf(buf->c_str() + *pos, "%*[^\r]%n%*1[\r]%*1[\n]%n", &valueEnd, &len) >= 0 && len > 0) - #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" value = std::string(buf->substr(*pos, valueEnd)); - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" *pos += len; - #line 1050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } else { - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (sscanf(buf->c_str() + *pos, "%*1[\r]%*1[\n]%n", &len) >= 0 && len > 0) - #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" *pos += len; - #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } else { - #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(http_bad_response(), std::max(0, loopDepth - 1)); - #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } } - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" (*headers)[name] = value; - #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(size_t && lineLen,int loopDepth) { - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (lineLen == 0) - #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" *pos += 2; - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Read_http_response_headersActorState(); static_cast(this)->destroy(); return 0; } - #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Read_http_response_headersActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int nameEnd = -1, valueStart = -1, valueEnd = -1; - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int len = -1; - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string name, value; - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (sscanf(buf->c_str() + *pos, "%*[^:]%n:%*[ \t]%n", &nameEnd, &valueStart) >= 0 && valueStart > 0) - #line 1100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" name = std::string(buf->substr(*pos, nameEnd)); - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" *pos += valueStart; - #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } else { - #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(http_bad_response(), std::max(0, loopDepth - 1)); - #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (sscanf(buf->c_str() + *pos, "%*[^\r]%n%*1[\r]%*1[\n]%n", &valueEnd, &len) >= 0 && len > 0) - #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" value = std::string(buf->substr(*pos, valueEnd)); - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" *pos += len; - #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } else { - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (sscanf(buf->c_str() + *pos, "%*1[\r]%*1[\n]%n", &len) >= 0 && len > 0) - #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" *pos += len; - #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } else { - #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(http_bad_response(), std::max(0, loopDepth - 1)); - #line 1138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } } - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" (*headers)[name] = value; - #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -1208,20 +1593,20 @@ class Read_http_response_headersActorState { fdb_probe_actor_exit("read_http_response_headers", reinterpret_cast(this), 0); } - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Reference conn; - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Headers* headers; - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string* buf; - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" size_t* pos; - #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" }; // This generated class is to be used only via read_http_response_headers() - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" class Read_http_response_headersActor final : public Actor, public ActorCallback< Read_http_response_headersActor, 0, size_t >, public FastAllocated, public Read_http_response_headersActorState { - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1230,9 +1615,9 @@ class Read_http_response_headersActor final : public Actor, public ActorCa void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Read_http_response_headersActor, 0, size_t >; - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Read_http_response_headersActor(Reference const& conn,Headers* const& headers,std::string* const& buf,size_t* const& pos) - #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" : Actor(), Read_http_response_headersActorState(conn, headers, buf, pos) { @@ -1255,62 +1640,65 @@ friend struct ActorCallback< Read_http_response_headersActor, 0, size_t >; } }; - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" [[nodiscard]] Future read_http_response_headers( Reference const& conn, Headers* const& headers, std::string* const& buf, size_t* const& pos ) { - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return Future(new Read_http_response_headersActor(conn, headers, buf, pos)); - #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } -#line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +#line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" -// Reads an HTTP response from a network connection -// If the connection fails while being read the exception will emitted -// If the response is not parsable or complete in some way, http_bad_response will be thrown - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" -// This generated class is to be used only via read_http_response() - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" -template - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" -class Read_http_responseActorState { - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +// FIXME: should this throw a different error for http requests? Or should we rename http_bad_response to +// http_bad_? + #line 1654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +// This generated class is to be used only via readHTTPData() + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +template + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +class ReadHTTPDataActorState { + #line 1660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - Read_http_responseActorState(Reference const& r,Reference const& conn,bool const& header_only) - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + ReadHTTPDataActorState(HTTPData* const& r,Reference const& conn,std::string* const& buf,size_t* const& pos,bool const& content_optional,bool const& skipCheckMD5) + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" : r(r), - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" conn(conn), - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - header_only(header_only), - #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - buf(), - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - pos(0) - #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + buf(buf), + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + pos(pos), + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + content_optional(content_optional), + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + skipCheckMD5(skipCheckMD5) + #line 1677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - fdb_probe_actor_create("read_http_response", reinterpret_cast(this)); + fdb_probe_actor_create("readHTTPData", reinterpret_cast(this)); } - ~Read_http_responseActorState() + ~ReadHTTPDataActorState() { - fdb_probe_actor_destroy("read_http_response", reinterpret_cast(this)); + fdb_probe_actor_destroy("readHTTPData", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - StrictFuture __when_expr_0 = read_delimited_into_string(conn, "\r\n", &buf, pos); - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->headers.clear(); + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_0 = read_http_response_headers(conn, &r->headers, buf, pos); + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1323,97 +1711,211 @@ class Read_http_responseActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~Read_http_responseActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~ReadHTTPDataActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - int a_body1cont1(size_t const& lineLen,int loopDepth) + int a_body1cont1(Void const& _,int loopDepth) { - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - int reachedEnd = -1; - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - sscanf(buf.c_str() + pos, "HTTP/%f %d%n", &r->version, &r->code, &reachedEnd); - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (reachedEnd < 0) - #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + auto i = r->headers.find("Content-Length"); + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (i != r->headers.end()) + #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - return a_body1Catch1(http_bad_response(), loopDepth); - #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->contentLen = strtoll(i->second.c_str(), NULL, 10); + #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + else + { + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->contentLen = -1; + #line 1736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + transferEncoding = std::string(); + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + i = r->headers.find("Transfer-Encoding"); + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (i != r->headers.end()) + #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + transferEncoding = i->second; + #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->content.clear(); + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (content_optional && *pos == buf->size()) + #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReadHTTPDataActorState(); static_cast(this)->destroy(); return 0; } + #line 1758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ReadHTTPDataActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (r->contentLen >= 0) + #line 1766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->content = buf->substr(*pos); + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + *pos = 0; + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_1 = read_fixed_into_string(conn, r->contentLen, &r->content, *pos); + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (transferEncoding == "chunked") + #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->content = buf->substr(*pos); + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + *pos = 0; + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + ; + #line 1796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); + } + else + { + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 1803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } } - #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - pos += lineLen + 2; - #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->headers.clear(); - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - StrictFuture __when_expr_1 = read_http_response_headers(conn, &r->headers, &buf, &pos); - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - loopDepth = 0; return loopDepth; } - int a_body1cont1(size_t && lineLen,int loopDepth) + int a_body1cont1(Void && _,int loopDepth) { - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - int reachedEnd = -1; - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - sscanf(buf.c_str() + pos, "HTTP/%f %d%n", &r->version, &r->code, &reachedEnd); - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (reachedEnd < 0) - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + auto i = r->headers.find("Content-Length"); + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (i != r->headers.end()) + #line 1815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - return a_body1Catch1(http_bad_response(), loopDepth); - #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->contentLen = strtoll(i->second.c_str(), NULL, 10); + #line 1819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + else + { + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->contentLen = -1; + #line 1825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + transferEncoding = std::string(); + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + i = r->headers.find("Transfer-Encoding"); + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (i != r->headers.end()) + #line 1833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + transferEncoding = i->second; + #line 1837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->content.clear(); + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (content_optional && *pos == buf->size()) + #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReadHTTPDataActorState(); static_cast(this)->destroy(); return 0; } + #line 1847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ReadHTTPDataActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (r->contentLen >= 0) + #line 1855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->content = buf->substr(*pos); + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + *pos = 0; + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_1 = read_fixed_into_string(conn, r->contentLen, &r->content, *pos); + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = 0; + } + else + { + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (transferEncoding == "chunked") + #line 1877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->content = buf->substr(*pos); + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + *pos = 0; + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + ; + #line 1885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); + } + else + { + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } } - #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - pos += lineLen + 2; - #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->headers.clear(); - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - StrictFuture __when_expr_1 = read_http_response_headers(conn, &r->headers, &buf, &pos); - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - loopDepth = 0; return loopDepth; } - int a_body1when1(size_t const& lineLen,int loopDepth) + int a_body1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont1(lineLen, loopDepth); + loopDepth = a_body1cont1(_, loopDepth); return loopDepth; } - int a_body1when1(size_t && lineLen,int loopDepth) + int a_body1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont1(std::move(lineLen), loopDepth); + loopDepth = a_body1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< Read_http_responseActor, 0, size_t >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ReadHTTPDataActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< Read_http_responseActor, 0, size_t >*,size_t const& value) + void a_callback_fire(ActorCallback< ReadHTTPDataActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 0); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -1423,12 +1925,12 @@ class Read_http_responseActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 0); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< Read_http_responseActor, 0, size_t >*,size_t && value) + void a_callback_fire(ActorCallback< ReadHTTPDataActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 0); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -1438,12 +1940,12 @@ class Read_http_responseActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 0); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< Read_http_responseActor, 0, size_t >*,Error err) + void a_callback_error(ActorCallback< ReadHTTPDataActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 0); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -1453,367 +1955,126 @@ class Read_http_responseActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 0); - - } - int a_body1cont2(Void const& _,int loopDepth) - { - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - auto i = r->headers.find("Content-Length"); - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (i != r->headers.end()) - #line 1465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - { - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->contentLen = strtoll(i->second.c_str(), NULL, 10); - #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - } - else - { - #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->contentLen = -1; - #line 1475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - } - #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - transferEncoding = std::string(); - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - i = r->headers.find("Transfer-Encoding"); - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (i != r->headers.end()) - #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - { - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - transferEncoding = i->second; - #line 1487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - } - #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->content.clear(); - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (header_only && pos == buf.size()) - #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - { - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Read_http_responseActorState(); static_cast(this)->destroy(); return 0; } - #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~Read_http_responseActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (r->contentLen >= 0) - #line 1505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - { - #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->content = buf.substr(pos); - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - pos = 0; - #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - StrictFuture __when_expr_2 = read_fixed_into_string(conn, r->contentLen, &r->content, pos); - #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (transferEncoding == "chunked") - #line 1527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - { - #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->content = buf.substr(pos); - #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - pos = 0; - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - ; - #line 1535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - loopDepth = a_body1cont2loopHead1(loopDepth); - } - else - { - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - return a_body1Catch1(http_bad_response(), loopDepth); - #line 1542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - } - } - - return loopDepth; - } - int a_body1cont2(Void && _,int loopDepth) - { - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - auto i = r->headers.find("Content-Length"); - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (i != r->headers.end()) - #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - { - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->contentLen = strtoll(i->second.c_str(), NULL, 10); - #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - } - else - { - #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->contentLen = -1; - #line 1564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - } - #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - transferEncoding = std::string(); - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - i = r->headers.find("Transfer-Encoding"); - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (i != r->headers.end()) - #line 1572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - { - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - transferEncoding = i->second; - #line 1576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - } - #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->content.clear(); - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (header_only && pos == buf.size()) - #line 1582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - { - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Read_http_responseActorState(); static_cast(this)->destroy(); return 0; } - #line 1586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~Read_http_responseActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (r->contentLen >= 0) - #line 1594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - { - #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->content = buf.substr(pos); - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - pos = 0; - #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - StrictFuture __when_expr_2 = read_fixed_into_string(conn, r->contentLen, &r->content, pos); - #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - loopDepth = 0; - } - else - { - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (transferEncoding == "chunked") - #line 1616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - { - #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->content = buf.substr(pos); - #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - pos = 0; - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - ; - #line 1624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - loopDepth = a_body1cont2loopHead1(loopDepth); - } - else - { - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - return a_body1Catch1(http_bad_response(), loopDepth); - #line 1631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - } - } - - return loopDepth; - } - int a_body1cont1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont2(_, loopDepth); - - return loopDepth; - } - int a_body1cont1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont2(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< Read_http_responseActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< Read_http_responseActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< Read_http_responseActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< Read_http_responseActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 1); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 0); } - int a_body1cont4(int loopDepth) + int a_body1cont2(int loopDepth) { - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (r->content.size() > 0) - #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (r->code == 206 && CLIENT_KNOBS->HTTP_RESPONSE_SKIP_VERIFY_CHECKSUM_FOR_PARTIAL_CONTENT) - #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (skipCheckMD5) + #line 1969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Read_http_responseActorState(); static_cast(this)->destroy(); return 0; } - #line 1712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~Read_http_responseActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReadHTTPDataActorState(); static_cast(this)->destroy(); return 0; } + #line 1973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ReadHTTPDataActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (!r->verifyMD5(false)) - #line 1720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (!HTTP::verifyMD5(r, false)) + #line 1981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(http_bad_response(), loopDepth); - #line 1724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 1985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } } - #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Read_http_responseActorState(); static_cast(this)->destroy(); return 0; } - #line 1729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~Read_http_responseActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReadHTTPDataActorState(); static_cast(this)->destroy(); return 0; } + #line 1990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ReadHTTPDataActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1cont9(Void const& _,int loopDepth) + int a_body1cont7(Void const& _,int loopDepth) { - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (r->content.size() != r->contentLen) - #line 1741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 2002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(http_bad_response(), loopDepth); - #line 1745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 2006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - loopDepth = a_body1cont4(loopDepth); + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont9(Void && _,int loopDepth) + int a_body1cont7(Void && _,int loopDepth) { - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (r->content.size() != r->contentLen) - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 2016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(http_bad_response(), loopDepth); - #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 2020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - loopDepth = a_body1cont4(loopDepth); + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont2when1(Void const& _,int loopDepth) + int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont9(_, loopDepth); + loopDepth = a_body1cont7(_, loopDepth); return loopDepth; } - int a_body1cont2when1(Void && _,int loopDepth) + int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont9(std::move(_), loopDepth); + loopDepth = a_body1cont7(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose3() + void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< Read_http_responseActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ReadHTTPDataActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< Read_http_responseActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< ReadHTTPDataActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont2when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 2); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< Read_http_responseActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< ReadHTTPDataActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont2when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 2); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< Read_http_responseActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< ReadHTTPDataActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 2); - a_exitChoose3(); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -1822,62 +2083,62 @@ class Read_http_responseActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 2); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 1); } - int a_body1cont12(int loopDepth) + int a_body1cont10(int loopDepth) { - loopDepth = a_body1cont4(loopDepth); + loopDepth = a_body1cont2(loopDepth); return loopDepth; } - int a_body1cont13(int loopDepth) + int a_body1cont11(int loopDepth) { - #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->contentLen = pos; - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - StrictFuture __when_expr_6 = read_http_response_headers(conn, &r->headers, &r->content, &pos); - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont13when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->contentLen = *pos; + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_5 = read_http_response_headers(conn, &r->headers, &r->content, pos); + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont11when1(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont2loopHead1(int loopDepth) + int a_body1cont1loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont2loopBody1(loopDepth); + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); return loopDepth; } - int a_body1cont2loopBody1(int loopDepth) + int a_body1cont1loopBody1(int loopDepth) { { - #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - StrictFuture __when_expr_3 = read_delimited_into_string(conn, "\r\n", &r->content, pos); - #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_2 = read_delimited_into_string(conn, "\r\n", &r->content, *pos); + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; } return loopDepth; } - int a_body1cont2break1(int loopDepth) + int a_body1cont1break1(int loopDepth) { try { - return a_body1cont13(loopDepth); + return a_body1cont11(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -1887,128 +2148,128 @@ class Read_http_responseActorState { return loopDepth; } - int a_body1cont2loopBody1cont1(int loopDepth) + int a_body1cont1loopBody1cont1(int loopDepth) { { - #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - StrictFuture __when_expr_5 = read_delimited_into_string(conn, "\r\n", &r->content, pos); - #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1cont1when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_4 = read_delimited_into_string(conn, "\r\n", &r->content, *pos); + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont1when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; } return loopDepth; } - int a_body1cont2loopBody1cont2(size_t const& lineLen,int loopDepth) + int a_body1cont1loopBody1cont2(size_t const& lineLen,int loopDepth) { - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - chunkLen = strtol(r->content.substr(pos, lineLen).c_str(), nullptr, 16); - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->content.erase(pos, lineLen + 2); - #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + chunkLen = strtol(r->content.substr(*pos, lineLen).c_str(), nullptr, 16); + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->content.erase(*pos, lineLen + 2); + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (chunkLen == 0) - #line 1916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 2177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break - } - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - StrictFuture __when_expr_4 = read_fixed_into_string(conn, chunkLen, &r->content, pos); - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_3 = read_fixed_into_string(conn, chunkLen, &r->content, *pos); + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont2when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont2loopBody1cont2(size_t && lineLen,int loopDepth) + int a_body1cont1loopBody1cont2(size_t && lineLen,int loopDepth) { - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - chunkLen = strtol(r->content.substr(pos, lineLen).c_str(), nullptr, 16); - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->content.erase(pos, lineLen + 2); - #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + chunkLen = strtol(r->content.substr(*pos, lineLen).c_str(), nullptr, 16); + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->content.erase(*pos, lineLen + 2); + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (chunkLen == 0) - #line 1942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break - } - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - StrictFuture __when_expr_4 = read_fixed_into_string(conn, chunkLen, &r->content, pos); - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1cont2when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_3 = read_fixed_into_string(conn, chunkLen, &r->content, *pos); + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1cont2when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1cont2loopBody1when1(size_t const& lineLen,int loopDepth) + int a_body1cont1loopBody1when1(size_t const& lineLen,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont2(lineLen, loopDepth); + loopDepth = a_body1cont1loopBody1cont2(lineLen, loopDepth); return loopDepth; } - int a_body1cont2loopBody1when1(size_t && lineLen,int loopDepth) + int a_body1cont1loopBody1when1(size_t && lineLen,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont2(std::move(lineLen), loopDepth); + loopDepth = a_body1cont1loopBody1cont2(std::move(lineLen), loopDepth); return loopDepth; } - void a_exitChoose4() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< Read_http_responseActor, 3, size_t >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ReadHTTPDataActor, 2, size_t >::remove(); } - void a_callback_fire(ActorCallback< Read_http_responseActor, 3, size_t >*,size_t const& value) + void a_callback_fire(ActorCallback< ReadHTTPDataActor, 2, size_t >*,size_t const& value) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont2loopBody1when1(value, 0); + a_body1cont1loopBody1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 3); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< Read_http_responseActor, 3, size_t >*,size_t && value) + void a_callback_fire(ActorCallback< ReadHTTPDataActor, 2, size_t >*,size_t && value) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1cont2loopBody1when1(std::move(value), 0); + a_body1cont1loopBody1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 3); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< Read_http_responseActor, 3, size_t >*,Error err) + void a_callback_error(ActorCallback< ReadHTTPDataActor, 2, size_t >*,Error err) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 3); - a_exitChoose4(); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -2017,79 +2278,79 @@ class Read_http_responseActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 3); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 2); } - int a_body1cont2loopBody1cont3(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont3(Void const& _,int loopDepth) { - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - pos += chunkLen; - #line 2027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - loopDepth = a_body1cont2loopBody1cont1(loopDepth); + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + *pos += chunkLen; + #line 2288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont3(Void && _,int loopDepth) + int a_body1cont1loopBody1cont3(Void && _,int loopDepth) { - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - pos += chunkLen; - #line 2036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - loopDepth = a_body1cont2loopBody1cont1(loopDepth); + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + *pos += chunkLen; + #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont2when1(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont3(_, loopDepth); + loopDepth = a_body1cont1loopBody1cont3(_, loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont2when1(Void && _,int loopDepth) + int a_body1cont1loopBody1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont3(std::move(_), loopDepth); + loopDepth = a_body1cont1loopBody1cont3(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose5() + void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< Read_http_responseActor, 4, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ReadHTTPDataActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< Read_http_responseActor, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< ReadHTTPDataActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont2loopBody1cont2when1(value, 0); + a_body1cont1loopBody1cont2when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 4); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< Read_http_responseActor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< ReadHTTPDataActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 3); + a_exitChoose4(); try { - a_body1cont2loopBody1cont2when1(std::move(value), 0); + a_body1cont1loopBody1cont2when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 4); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< Read_http_responseActor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< ReadHTTPDataActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 4); - a_exitChoose5(); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 3); + a_exitChoose4(); try { a_body1Catch1(err, 0); } @@ -2098,100 +2359,197 @@ class Read_http_responseActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 4); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 3); } - int a_body1cont2loopBody1cont6(int loopDepth) + int a_body1cont1loopBody1cont6(int loopDepth) { - if (loopDepth == 0) return a_body1cont2loopHead1(0); + if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; } - int a_body1cont2loopBody1cont7(size_t const& lineLen,int loopDepth) + int a_body1cont1loopBody1cont7(size_t const& lineLen,int loopDepth) { - #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (lineLen != 0) - #line 2114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 2375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(http_bad_response(), std::max(0, loopDepth - 1)); - #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 2379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->content.erase(pos, 2); - #line 2122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - loopDepth = a_body1cont2loopBody1cont6(loopDepth); + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->content.erase(*pos, 2); + #line 2383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont6(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont7(size_t && lineLen,int loopDepth) + int a_body1cont1loopBody1cont7(size_t && lineLen,int loopDepth) { - #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (lineLen != 0) - #line 2131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 2392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(http_bad_response(), std::max(0, loopDepth - 1)); - #line 2135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 2396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->content.erase(*pos, 2); + #line 2400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont6(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont1when1(size_t const& lineLen,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont7(lineLen, loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1cont1when1(size_t && lineLen,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont7(std::move(lineLen), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ReadHTTPDataActor, 4, size_t >::remove(); + + } + void a_callback_fire(ActorCallback< ReadHTTPDataActor, 4, size_t >*,size_t const& value) + { + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont1loopBody1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< ReadHTTPDataActor, 4, size_t >*,size_t && value) + { + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont1loopBody1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< ReadHTTPDataActor, 4, size_t >*,Error err) + { + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 4); + + } + int a_body1cont11cont1(Void const& _,int loopDepth) + { + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (*pos != r->content.size()) + #line 2472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 2476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->content.erase(r->contentLen); + #line 2480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = a_body1cont10(loopDepth); + + return loopDepth; + } + int a_body1cont11cont1(Void && _,int loopDepth) + { + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (*pos != r->content.size()) + #line 2489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->content.erase(pos, 2); - #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - loopDepth = a_body1cont2loopBody1cont6(loopDepth); + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->content.erase(r->contentLen); + #line 2497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = a_body1cont10(loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont1when1(size_t const& lineLen,int loopDepth) + int a_body1cont11when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont7(lineLen, loopDepth); + loopDepth = a_body1cont11cont1(_, loopDepth); return loopDepth; } - int a_body1cont2loopBody1cont1when1(size_t && lineLen,int loopDepth) + int a_body1cont11when1(Void && _,int loopDepth) { - loopDepth = a_body1cont2loopBody1cont7(std::move(lineLen), loopDepth); + loopDepth = a_body1cont11cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose6() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< Read_http_responseActor, 5, size_t >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ReadHTTPDataActor, 5, Void >::remove(); } - void a_callback_fire(ActorCallback< Read_http_responseActor, 5, size_t >*,size_t const& value) + void a_callback_fire(ActorCallback< ReadHTTPDataActor, 5, Void >*,Void const& value) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 5); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 5); a_exitChoose6(); try { - a_body1cont2loopBody1cont1when1(value, 0); + a_body1cont11when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 5); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 5); } - void a_callback_fire(ActorCallback< Read_http_responseActor, 5, size_t >*,size_t && value) + void a_callback_fire(ActorCallback< ReadHTTPDataActor, 5, Void >*,Void && value) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 5); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 5); a_exitChoose6(); try { - a_body1cont2loopBody1cont1when1(std::move(value), 0); + a_body1cont11when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 5); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 5); } - void a_callback_error(ActorCallback< Read_http_responseActor, 5, size_t >*,Error err) + void a_callback_error(ActorCallback< ReadHTTPDataActor, 5, Void >*,Error err) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 5); + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), 5); a_exitChoose6(); try { a_body1Catch1(err, 0); @@ -2201,95 +2559,784 @@ class Read_http_responseActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 5); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), 5); + + } + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + HTTPData* r; + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Reference conn; + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + std::string* buf; + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + size_t* pos; + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + bool content_optional; + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + bool skipCheckMD5; + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + std::string transferEncoding; + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + int chunkLen; + #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +}; +// This generated class is to be used only via readHTTPData() + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +class ReadHTTPDataActor final : public Actor, public ActorCallback< ReadHTTPDataActor, 0, Void >, public ActorCallback< ReadHTTPDataActor, 1, Void >, public ActorCallback< ReadHTTPDataActor, 2, size_t >, public ActorCallback< ReadHTTPDataActor, 3, Void >, public ActorCallback< ReadHTTPDataActor, 4, size_t >, public ActorCallback< ReadHTTPDataActor, 5, Void >, public FastAllocated, public ReadHTTPDataActorState { + #line 2586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ReadHTTPDataActor, 0, Void >; +friend struct ActorCallback< ReadHTTPDataActor, 1, Void >; +friend struct ActorCallback< ReadHTTPDataActor, 2, size_t >; +friend struct ActorCallback< ReadHTTPDataActor, 3, Void >; +friend struct ActorCallback< ReadHTTPDataActor, 4, size_t >; +friend struct ActorCallback< ReadHTTPDataActor, 5, Void >; + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + ReadHTTPDataActor(HTTPData* const& r,Reference const& conn,std::string* const& buf,size_t* const& pos,bool const& content_optional,bool const& skipCheckMD5) + #line 2602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + : Actor(), + ReadHTTPDataActorState(r, conn, buf, pos, content_optional, skipCheckMD5) + { + fdb_probe_actor_enter("readHTTPData", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("readHTTPData"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("readHTTPData", reinterpret_cast(this), -1); } - int a_body1cont13cont1(Void const& _,int loopDepth) + void cancel() override { - #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (pos != r->content.size()) - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ReadHTTPDataActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ReadHTTPDataActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ReadHTTPDataActor, 2, size_t >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< ReadHTTPDataActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< ReadHTTPDataActor, 4, size_t >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< ReadHTTPDataActor, 5, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +[[nodiscard]] Future readHTTPData( HTTPData* const& r, Reference const& conn, std::string* const& buf, size_t* const& pos, bool const& content_optional, bool const& skipCheckMD5 ) { + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return Future(new ReadHTTPDataActor(r, conn, buf, pos, content_optional, skipCheckMD5)); + #line 2634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +} + +#line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + +// Reads an HTTP request from a network connection +// If the connection fails while being read the exception will emitted +// If the response is not parsable or complete in some way, http_bad_response will be thrown + #line 2642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +// This generated class is to be used only via read_http_request() + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +template + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +class Read_http_requestActorState { + #line 2648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +public: + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Read_http_requestActorState(Reference const& r,Reference const& conn) + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + : r(r), + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + conn(conn), + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + buf(), + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + pos(0) + #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + fdb_probe_actor_create("read_http_request", reinterpret_cast(this)); + + } + ~Read_http_requestActorState() + { + fdb_probe_actor_destroy("read_http_request", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_0 = read_delimited_into_string(conn, "\r\n", &buf, pos); + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~Read_http_requestActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(size_t const& lineLen,int loopDepth) + { + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + std::string requestLine = buf.substr(0, lineLen); + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + std::stringstream ss(requestLine); + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + ss >> r->verb; + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (ss.fail()) + #line 2712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(http_bad_response(), loopDepth); - #line 2215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->content.erase(r->contentLen); - #line 2219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - loopDepth = a_body1cont12(loopDepth); + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + ss >> r->resource; + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (ss.fail()) + #line 2722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 2726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + std::string httpVersion; + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + ss >> httpVersion; + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (ss.fail()) + #line 2734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 2738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (ss && !ss.eof()) + #line 2742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 2746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + float version; + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + sscanf(httpVersion.c_str(), "HTTP/%f", &version); + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (version < 1.1) + #line 2754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 2758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + pos += lineLen + 2; + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_1 = readHTTPData(&r->data, conn, &buf, &pos, false, false); + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = 0; return loopDepth; } - int a_body1cont13cont1(Void && _,int loopDepth) + int a_body1cont1(size_t && lineLen,int loopDepth) { - #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (pos != r->content.size()) - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + std::string requestLine = buf.substr(0, lineLen); + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + std::stringstream ss(requestLine); + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + ss >> r->verb; + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (ss.fail()) + #line 2786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(http_bad_response(), loopDepth); - #line 2232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 2790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->content.erase(r->contentLen); - #line 2236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - loopDepth = a_body1cont12(loopDepth); + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + ss >> r->resource; + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (ss.fail()) + #line 2796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 2800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + std::string httpVersion; + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + ss >> httpVersion; + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (ss.fail()) + #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 2812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (ss && !ss.eof()) + #line 2816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 2820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + float version; + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + sscanf(httpVersion.c_str(), "HTTP/%f", &version); + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (version < 1.1) + #line 2828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 2832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + pos += lineLen + 2; + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_1 = readHTTPData(&r->data, conn, &buf, &pos, false, false); + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(size_t const& lineLen,int loopDepth) + { + loopDepth = a_body1cont1(lineLen, loopDepth); + + return loopDepth; + } + int a_body1when1(size_t && lineLen,int loopDepth) + { + loopDepth = a_body1cont1(std::move(lineLen), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< Read_http_requestActor, 0, size_t >::remove(); + + } + void a_callback_fire(ActorCallback< Read_http_requestActor, 0, size_t >*,size_t const& value) + { + fdb_probe_actor_enter("read_http_request", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read_http_request", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< Read_http_requestActor, 0, size_t >*,size_t && value) + { + fdb_probe_actor_enter("read_http_request", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read_http_request", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< Read_http_requestActor, 0, size_t >*,Error err) + { + fdb_probe_actor_enter("read_http_request", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read_http_request", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Read_http_requestActorState(); static_cast(this)->destroy(); return 0; } + #line 2917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~Read_http_requestActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Read_http_requestActorState(); static_cast(this)->destroy(); return 0; } + #line 2929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~Read_http_requestActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< Read_http_requestActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< Read_http_requestActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("read_http_request", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read_http_request", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< Read_http_requestActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("read_http_request", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read_http_request", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< Read_http_requestActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("read_http_request", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read_http_request", reinterpret_cast(this), 1); + + } + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Reference r; + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Reference conn; + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + std::string buf; + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + size_t pos; + #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +}; +// This generated class is to be used only via read_http_request() + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +class Read_http_requestActor final : public Actor, public ActorCallback< Read_http_requestActor, 0, size_t >, public ActorCallback< Read_http_requestActor, 1, Void >, public FastAllocated, public Read_http_requestActorState { + #line 3013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< Read_http_requestActor, 0, size_t >; +friend struct ActorCallback< Read_http_requestActor, 1, Void >; + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Read_http_requestActor(Reference const& r,Reference const& conn) + #line 3025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + : Actor(), + Read_http_requestActorState(r, conn) + { + fdb_probe_actor_enter("read_http_request", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("read_http_request"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("read_http_request", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< Read_http_requestActor, 0, size_t >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< Read_http_requestActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +[[nodiscard]] Future read_http_request( Reference const& r, Reference const& conn ) { + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return Future(new Read_http_requestActor(r, conn)); + #line 3053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +} + +#line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + +Future HTTP::IncomingRequest::read(Reference conn, bool header_only) { + return read_http_request(Reference::addRef(this), conn); +} + +Future HTTP::OutgoingResponse::write(Reference conn) { + return writeResponse(conn, Reference::addRef(this)); +} + +void HTTP::OutgoingResponse::reset() { + data.headers = HTTP::Headers(); + data.content->discardAll(); + data.contentLen = 0; +} + +// Reads an HTTP response from a network connection +// If the connection fails while being read the exception will emitted +// If the response is not parsable or complete in some way, http_bad_response will be thrown + #line 3075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +// This generated class is to be used only via read_http_response() + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +template + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +class Read_http_responseActorState { + #line 3081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +public: + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Read_http_responseActorState(Reference const& r,Reference const& conn,bool const& header_only) + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + : r(r), + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + conn(conn), + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + header_only(header_only), + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + buf(), + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + pos(0) + #line 3096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + fdb_probe_actor_create("read_http_response", reinterpret_cast(this)); + + } + ~Read_http_responseActorState() + { + fdb_probe_actor_destroy("read_http_response", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_0 = read_delimited_into_string(conn, "\r\n", &buf, pos); + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~Read_http_responseActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(size_t const& lineLen,int loopDepth) + { + #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + int reachedEnd = -1; + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + sscanf(buf.c_str() + pos, "HTTP/%f %d%n", &r->version, &r->code, &reachedEnd); + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (reachedEnd < 0) + #line 3145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 3149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + pos += lineLen + 2; + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + bool skipCheckMD5 = r->code == 206 && FLOW_KNOBS->HTTP_RESPONSE_SKIP_VERIFY_CHECKSUM_FOR_PARTIAL_CONTENT; + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_1 = readHTTPData(&r->data, conn, &buf, &pos, header_only, skipCheckMD5); + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(size_t && lineLen,int loopDepth) + { + #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + int reachedEnd = -1; + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + sscanf(buf.c_str() + pos, "HTTP/%f %d%n", &r->version, &r->code, &reachedEnd); + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (reachedEnd < 0) + #line 3177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 3181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + pos += lineLen + 2; + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + bool skipCheckMD5 = r->code == 206 && FLOW_KNOBS->HTTP_RESPONSE_SKIP_VERIFY_CHECKSUM_FOR_PARTIAL_CONTENT; + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture __when_expr_1 = readHTTPData(&r->data, conn, &buf, &pos, header_only, skipCheckMD5); + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(size_t const& lineLen,int loopDepth) + { + loopDepth = a_body1cont1(lineLen, loopDepth); + + return loopDepth; + } + int a_body1when1(size_t && lineLen,int loopDepth) + { + loopDepth = a_body1cont1(std::move(lineLen), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< Read_http_responseActor, 0, size_t >::remove(); + + } + void a_callback_fire(ActorCallback< Read_http_responseActor, 0, size_t >*,size_t const& value) + { + fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< Read_http_responseActor, 0, size_t >*,size_t && value) + { + fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< Read_http_responseActor, 0, size_t >*,Error err) + { + fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Read_http_responseActorState(); static_cast(this)->destroy(); return 0; } + #line 3268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~Read_http_responseActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Read_http_responseActorState(); static_cast(this)->destroy(); return 0; } + #line 3280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~Read_http_responseActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1cont13when1(Void const& _,int loopDepth) + int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont13cont1(_, loopDepth); + loopDepth = a_body1cont2(_, loopDepth); return loopDepth; } - int a_body1cont13when1(Void && _,int loopDepth) + int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont13cont1(std::move(_), loopDepth); + loopDepth = a_body1cont2(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose7() + void a_exitChoose2() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< Read_http_responseActor, 6, Void >::remove(); + static_cast(this)->ActorCallback< Read_http_responseActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< Read_http_responseActor, 6, Void >*,Void const& value) + void a_callback_fire(ActorCallback< Read_http_responseActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont13when1(value, 0); + a_body1cont1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 6); + fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< Read_http_responseActor, 6, Void >*,Void && value) + void a_callback_fire(ActorCallback< Read_http_responseActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1cont13when1(std::move(value), 0); + a_body1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 6); + fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< Read_http_responseActor, 6, Void >*,Error err) + void a_callback_error(ActorCallback< Read_http_responseActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 6); - a_exitChoose7(); + fdb_probe_actor_enter("read_http_response", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch1(err, 0); } @@ -2298,29 +3345,25 @@ class Read_http_responseActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 6); + fdb_probe_actor_exit("read_http_response", reinterpret_cast(this), 1); } - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - Reference r; - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Reference r; + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Reference conn; - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" bool header_only; - #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string buf; - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" size_t pos; - #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - std::string transferEncoding; - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - int chunkLen; - #line 2318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" }; // This generated class is to be used only via read_http_response() - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" -class Read_http_responseActor final : public Actor, public ActorCallback< Read_http_responseActor, 0, size_t >, public ActorCallback< Read_http_responseActor, 1, Void >, public ActorCallback< Read_http_responseActor, 2, Void >, public ActorCallback< Read_http_responseActor, 3, size_t >, public ActorCallback< Read_http_responseActor, 4, Void >, public ActorCallback< Read_http_responseActor, 5, size_t >, public ActorCallback< Read_http_responseActor, 6, Void >, public FastAllocated, public Read_http_responseActorState { - #line 2323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +class Read_http_responseActor final : public Actor, public ActorCallback< Read_http_responseActor, 0, size_t >, public ActorCallback< Read_http_responseActor, 1, Void >, public FastAllocated, public Read_http_responseActorState { + #line 3366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2330,14 +3373,9 @@ class Read_http_responseActor final : public Actor, public ActorCallback< #pragma clang diagnostic pop friend struct ActorCallback< Read_http_responseActor, 0, size_t >; friend struct ActorCallback< Read_http_responseActor, 1, Void >; -friend struct ActorCallback< Read_http_responseActor, 2, Void >; -friend struct ActorCallback< Read_http_responseActor, 3, size_t >; -friend struct ActorCallback< Read_http_responseActor, 4, Void >; -friend struct ActorCallback< Read_http_responseActor, 5, size_t >; -friend struct ActorCallback< Read_http_responseActor, 6, Void >; - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - Read_http_responseActor(Reference const& r,Reference const& conn,bool const& header_only) - #line 2340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Read_http_responseActor(Reference const& r,Reference const& conn,bool const& header_only) + #line 3378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" : Actor(), Read_http_responseActorState(r, conn, header_only) { @@ -2357,170 +3395,141 @@ friend struct ActorCallback< Read_http_responseActor, 6, Void >; switch (wait_state) { case 1: this->a_callback_error((ActorCallback< Read_http_responseActor, 0, size_t >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< Read_http_responseActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< Read_http_responseActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< Read_http_responseActor, 3, size_t >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< Read_http_responseActor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< Read_http_responseActor, 5, size_t >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< Read_http_responseActor, 6, Void >*)0, actor_cancelled()); break; } } }; - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" -[[nodiscard]] Future read_http_response( Reference const& r, Reference const& conn, bool const& header_only ) { - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +[[nodiscard]] Future read_http_response( Reference const& r, Reference const& conn, bool const& header_only ) { + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return Future(new Read_http_responseActor(r, conn, header_only)); - #line 2373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } -#line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +#line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" -Future HTTP::Response::read(Reference conn, bool header_only) { - return read_http_response(Reference::addRef(this), conn, header_only); +Future HTTP::IncomingResponse::read(Reference conn, bool header_only) { + return read_http_response(Reference::addRef(this), conn, header_only); } // Do a request, get a Response. -// Request content is provided as UnsentPacketQueue *pContent which will be depleted as bytes are sent but the queue +// Request content is provided as UnsentPacketQueue in req, which will be depleted as bytes are sent but the queue // itself must live for the life of this actor and be destroyed by the caller // TODO: pSent is very hackish, do something better. - #line 2386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" -// This generated class is to be used only via doRequest() - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" -template - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" -class DoRequestActorState { - #line 2392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +// This generated class is to be used only via doRequestActor() + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +template + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +class DoRequestActorActorState { + #line 3425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - DoRequestActorState(Reference const& conn,std::string const& verb,std::string const& resource,HTTP::Headers const& headers,UnsentPacketQueue* const& pContent,int const& contentLen,Reference const& sendRate,int64_t* const& pSent,Reference const& recvRate,std::string const& requestIDHeader) - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + DoRequestActorActorState(Reference const& conn,Reference const& request,Reference const& sendRate,int64_t* const& pSent,Reference const& recvRate) + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" : conn(conn), - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - verb(verb), - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - resource(resource), - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - headers(headers), - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - pContent(pContent), - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - contentLen(contentLen), - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + request(request), + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" sendRate(sendRate), - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" pSent(pSent), - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" recvRate(recvRate), - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - requestIDHeader(requestIDHeader), - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event(SevDebug, "HTTPRequest"), - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - empty() - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + requestIDHeader(FLOW_KNOBS->HTTP_REQUEST_ID_HEADER), + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + earlyResponse(false), + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + total_sent(0), + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + send_start() + #line 3450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - fdb_probe_actor_create("doRequest", reinterpret_cast(this)); + fdb_probe_actor_create("doRequestActor", reinterpret_cast(this)); } - ~DoRequestActorState() + ~DoRequestActorActorState() { - fdb_probe_actor_destroy("doRequest", reinterpret_cast(this)); + fdb_probe_actor_destroy("doRequestActor", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (pContent == nullptr) - #line 2436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - { - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - pContent = ∅ - #line 2440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - } - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (requestIDHeader.empty()) - #line 2444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - { - #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - requestIDHeader = FLOW_KNOBS->HTTP_REQUEST_ID_HEADER; - #line 2448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - } - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - earlyResponse = false; - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - total_sent = 0; - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - send_start = double(); - #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.detail("DebugID", conn->getDebugID()); - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.detail("RemoteAddress", conn->getPeerAddress()); - #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - event.detail("Verb", verb); - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - event.detail("Resource", resource); - #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - event.detail("RequestContentLen", contentLen); - #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + event.detail("Verb", request->verb); + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + event.detail("Resource", request->resource); + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + event.detail("RequestContentLen", request->data.contentLen); + #line 3473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" try { - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" requestID = std::string(); - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!requestIDHeader.empty()) - #line 2472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" requestID = deterministicRandom()->randomUniqueID().toString(); - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" requestID = requestID.insert(20, "-"); - #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" requestID = requestID.insert(16, "-"); - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" requestID = requestID.insert(12, "-"); - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" requestID = requestID.insert(8, "-"); - #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - headers[requestIDHeader] = requestID; - #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + request->data.headers[requestIDHeader] = requestID; + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.detail("RequestIDSent", requestID); - #line 2488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + request->data.headers["Content-Length"] = std::to_string(request->data.contentLen); + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" PacketBuffer* pFirst = PacketBuffer::create(); - #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - PacketBuffer* pLast = writeRequestHeader(verb, resource, headers, pFirst); - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - pContent->prependWriteBuffer(pFirst, pLast); - #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + PacketBuffer* pLast = writeRequestHeader(request, pFirst); + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + request->data.content->prependWriteBuffer(pFirst, pLast); + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (FLOW_KNOBS->HTTP_VERBOSE_LEVEL > 1) - #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - printf("[%s] HTTP starting %s %s ContentLen:%d\n", conn->getDebugID().toString().c_str(), verb.c_str(), resource.c_str(), contentLen); - #line 2502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + fmt::print("[{}] HTTP starting {} {} ContentLen:{}\n", conn->getDebugID().toString(), request->verb, request->resource, request->data.contentLen); + #line 3511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (FLOW_KNOBS->HTTP_VERBOSE_LEVEL > 2) - #line 2506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - for( auto h : headers ) { - #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - printf("Request Header: %s: %s\n", h.first.c_str(), h.second.c_str()); - #line 2512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + for( auto h : request->data.headers ) { + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + fmt::print("Request Header: {}: {}\n", h.first, h.second); + #line 3521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } } - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r = Reference(new HTTP::Response()); - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - responseReading = r->read(conn, verb == "HEAD" || verb == "DELETE" || verb == "CONNECT"); - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r = Reference(new HTTP::IncomingResponse()); + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + responseReading = r->read(conn, request->isHeaderOnlyResponse()); + #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" send_start = timer(); - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" ; - #line 2523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2539,8 +3548,8 @@ class DoRequestActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~DoRequestActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~DoRequestActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; @@ -2548,21 +3557,21 @@ class DoRequestActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" double elapsed = timer() - send_start; - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (FLOW_KNOBS->HTTP_VERBOSE_LEVEL > 0 && e.code() != error_code_http_bad_request_id) - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - printf("[%s] HTTP *ERROR*=%s early=%d, time=%fs %s %s contentLen=%d [%d out]\n", conn->getDebugID().toString().c_str(), e.name(), earlyResponse, elapsed, verb.c_str(), resource.c_str(), contentLen, total_sent); - #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + fmt::print("[{}] HTTP *ERROR*={} early={}, time={}s {} {} contentLen={} [{} out]\n", conn->getDebugID().toString(), e.name(), earlyResponse, elapsed, request->verb, request->resource, request->data.contentLen, total_sent); + #line 3568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.errorUnsuppressed(e); - #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 2565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -2572,18 +3581,18 @@ class DoRequestActorState { return loopDepth; } - int a_body1cont4(int loopDepth) + int a_body1cont2(int loopDepth) { - #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_3 = responseReading; - #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 3590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), loopDepth); else return a_body1cont2when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2597,31 +3606,39 @@ class DoRequestActorState { } int a_body1loopBody1(int loopDepth) { - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (responseReading.isReady()) - #line 2602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" conn->close(); - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r->headers["Connection"] = "close"; - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r->data.headers["Connection"] = "close"; + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" earlyResponse = true; - #line 2610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" trySend = FLOW_KNOBS->HTTP_SEND_SIZE; - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if ((!g_network->isSimulated() || !g_simulator->speedUpSimulation) && BUGGIFY_WITH_PROB(0.01)) + #line 3626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + { + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + trySend = deterministicRandom()->randomInt(1, 10); + #line 3630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_0 = sendRate->getAllowance(trySend); - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2629,7 +3646,7 @@ class DoRequestActorState { int a_body1break1(int loopDepth) { try { - return a_body1cont4(loopDepth); + return a_body1cont2(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch2(error, loopDepth); @@ -2641,76 +3658,76 @@ class DoRequestActorState { } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - int len = conn->write(pContent->getUnsent(), trySend); - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + int len = conn->write(request->data.content->getUnsent(), trySend); + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (pSent != nullptr) - #line 2648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" *pSent += len; - #line 2652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" sendRate->returnUnused(trySend - len); - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" total_sent += len; - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - pContent->sent(len); - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (pContent->empty()) - #line 2662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + request->data.content->sent(len); + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (request->data.content->empty()) + #line 3679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_1 = conn->onWritable(); - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - int len = conn->write(pContent->getUnsent(), trySend); - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + int len = conn->write(request->data.content->getUnsent(), trySend); + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (pSent != nullptr) - #line 2686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" *pSent += len; - #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" sendRate->returnUnused(trySend - len); - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" total_sent += len; - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - pContent->sent(len); - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (pContent->empty()) - #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + request->data.content->sent(len); + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (request->data.content->empty()) + #line 3717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_1 = conn->onWritable(); - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2729,13 +3746,13 @@ class DoRequestActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DoRequestActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoRequestActorActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< DoRequestActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< DoRequestActorActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("doRequest", reinterpret_cast(this), 0); + fdb_probe_actor_enter("doRequestActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -2745,12 +3762,12 @@ class DoRequestActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("doRequest", reinterpret_cast(this), 0); + fdb_probe_actor_exit("doRequestActor", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< DoRequestActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< DoRequestActorActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("doRequest", reinterpret_cast(this), 0); + fdb_probe_actor_enter("doRequestActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -2760,12 +3777,12 @@ class DoRequestActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("doRequest", reinterpret_cast(this), 0); + fdb_probe_actor_exit("doRequestActor", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< DoRequestActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< DoRequestActorActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("doRequest", reinterpret_cast(this), 0); + fdb_probe_actor_enter("doRequestActor", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch2(err, 0); @@ -2775,62 +3792,62 @@ class DoRequestActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("doRequest", reinterpret_cast(this), 0); + fdb_probe_actor_exit("doRequestActor", reinterpret_cast(this), 0); } - int a_body1loopBody1cont3(Void const& _,int loopDepth) + int a_body1loopBody1cont4(Void const& _,int loopDepth) { - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_2 = yield(TaskPriority::WriteSocket); - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont4when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont3(Void && _,int loopDepth) + int a_body1loopBody1cont4(Void && _,int loopDepth) { - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_2 = yield(TaskPriority::WriteSocket); - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 3820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont4when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont3(_, loopDepth); + loopDepth = a_body1loopBody1cont4(_, loopDepth); return loopDepth; } int a_body1loopBody1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DoRequestActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoRequestActorActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< DoRequestActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< DoRequestActorActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("doRequest", reinterpret_cast(this), 1); + fdb_probe_actor_enter("doRequestActor", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1cont1when1(value, 0); @@ -2840,12 +3857,12 @@ class DoRequestActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("doRequest", reinterpret_cast(this), 1); + fdb_probe_actor_exit("doRequestActor", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< DoRequestActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< DoRequestActorActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("doRequest", reinterpret_cast(this), 1); + fdb_probe_actor_enter("doRequestActor", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1loopBody1cont1when1(std::move(value), 0); @@ -2855,12 +3872,12 @@ class DoRequestActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("doRequest", reinterpret_cast(this), 1); + fdb_probe_actor_exit("doRequestActor", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< DoRequestActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< DoRequestActorActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("doRequest", reinterpret_cast(this), 1); + fdb_probe_actor_enter("doRequestActor", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch2(err, 0); @@ -2870,72 +3887,72 @@ class DoRequestActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("doRequest", reinterpret_cast(this), 1); + fdb_probe_actor_exit("doRequestActor", reinterpret_cast(this), 1); } - int a_body1loopBody1cont6(Void const& _,int loopDepth) + int a_body1loopBody1cont7(Void const& _,int loopDepth) { if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1loopBody1cont6(Void && _,int loopDepth) + int a_body1loopBody1cont7(Void && _,int loopDepth) { if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + int a_body1loopBody1cont4when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont6(_, loopDepth); + loopDepth = a_body1loopBody1cont7(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont3when1(Void && _,int loopDepth) + int a_body1loopBody1cont4when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont6(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont7(std::move(_), loopDepth); return loopDepth; } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DoRequestActor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoRequestActorActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< DoRequestActor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< DoRequestActorActor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("doRequest", reinterpret_cast(this), 2); + fdb_probe_actor_enter("doRequestActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont3when1(value, 0); + a_body1loopBody1cont4when1(value, 0); } catch (Error& error) { a_body1Catch2(error, 0); } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("doRequest", reinterpret_cast(this), 2); + fdb_probe_actor_exit("doRequestActor", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< DoRequestActor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< DoRequestActorActor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("doRequest", reinterpret_cast(this), 2); + fdb_probe_actor_enter("doRequestActor", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont3when1(std::move(value), 0); + a_body1loopBody1cont4when1(std::move(value), 0); } catch (Error& error) { a_body1Catch2(error, 0); } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("doRequest", reinterpret_cast(this), 2); + fdb_probe_actor_exit("doRequestActor", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< DoRequestActor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< DoRequestActorActor, 2, Void >*,Error err) { - fdb_probe_actor_enter("doRequest", reinterpret_cast(this), 2); + fdb_probe_actor_enter("doRequestActor", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch2(err, 0); @@ -2945,214 +3962,214 @@ class DoRequestActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("doRequest", reinterpret_cast(this), 2); + fdb_probe_actor_exit("doRequestActor", reinterpret_cast(this), 2); } - int a_body1cont9(Void const& _,int loopDepth) + int a_body1cont7(Void const& _,int loopDepth) { - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" double elapsed = timer() - send_start; - #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.detail("ResponseCode", r->code); - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - event.detail("ResponseContentLen", r->contentLen); - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + event.detail("ResponseContentLen", r->data.contentLen); + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.detail("Elapsed", elapsed); - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Optional err; - #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!requestIDHeader.empty()) - #line 2965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string responseID; - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - auto iid = r->headers.find(requestIDHeader); - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (iid != r->headers.end()) - #line 2973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + auto iid = r->data.headers.find(requestIDHeader); + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (iid != r->data.headers.end()) + #line 3990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" responseID = iid->second; - #line 2977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 3994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.detail("RequestIDReceived", responseID); - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" bool serverError = r->code >= 500 && r->code < 600; - #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (requestID != responseID && (!serverError || !responseID.empty())) - #line 2985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" err = http_bad_request_id(); - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - TraceEvent(SevError, "HTTPRequestFailedIDMismatch") .error(err.get()) .detail("DebugID", conn->getDebugID()) .detail("RemoteAddress", conn->getPeerAddress()) .detail("Verb", verb) .detail("Resource", resource) .detail("RequestContentLen", contentLen) .detail("ResponseCode", r->code) .detail("ResponseContentLen", r->contentLen) .detail("RequestIDSent", requestID) .detail("RequestIDReceived", responseID); - #line 2991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + TraceEvent(SevError, "HTTPRequestFailedIDMismatch") .error(err.get()) .detail("DebugID", conn->getDebugID()) .detail("RemoteAddress", conn->getPeerAddress()) .detail("Verb", request->verb) .detail("Resource", request->resource) .detail("RequestContentLen", request->data.contentLen) .detail("ResponseCode", r->code) .detail("ResponseContentLen", r->data.contentLen) .detail("RequestIDSent", requestID) .detail("RequestIDReceived", responseID); + #line 4008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } } - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (FLOW_KNOBS->HTTP_VERBOSE_LEVEL > 0) - #line 2996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - fmt::print("[{0}] HTTP {1}code={2} early={3}, time={4} {5} {6} contentLen={7} [{8} out, response content " "len {9}]\n", conn->getDebugID().toString(), (err.present() ? format("*ERROR*=%s ", err.get().name()).c_str() : ""), r->code, earlyResponse, elapsed, verb, resource, contentLen, total_sent, r->contentLen); - #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + fmt::print("[{0}] HTTP {1}code={2} early={3}, time={4} {5} {6} contentLen={7} [{8} out, response content " "len {9}]\n", conn->getDebugID().toString(), (err.present() ? format("*ERROR*=%s ", err.get().name()).c_str() : ""), r->code, earlyResponse, elapsed, request->verb, request->resource, request->data.contentLen, total_sent, r->data.contentLen); + #line 4017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (FLOW_KNOBS->HTTP_VERBOSE_LEVEL > 2) - #line 3004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - printf("[%s] HTTP RESPONSE: %s %s\n%s\n", conn->getDebugID().toString().c_str(), verb.c_str(), resource.c_str(), r->toString().c_str()); - #line 3008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + fmt::print("[{}] HTTP RESPONSE: {} {}\n{}\n", conn->getDebugID().toString(), request->verb, request->resource, r->toString()); + #line 4025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (err.present()) - #line 3012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch2(err.get(), loopDepth); - #line 3016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - } - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(r); this->~DoRequestActorState(); static_cast(this)->destroy(); return 0; } - #line 3020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(r)); // state_var_RVO - this->~DoRequestActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 4033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(r); this->~DoRequestActorActorState(); static_cast(this)->destroy(); return 0; } + #line 4037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(r)); // state_var_RVO + this->~DoRequestActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1cont9(Void && _,int loopDepth) + int a_body1cont7(Void && _,int loopDepth) { - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" double elapsed = timer() - send_start; - #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.detail("ResponseCode", r->code); - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - event.detail("ResponseContentLen", r->contentLen); - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + event.detail("ResponseContentLen", r->data.contentLen); + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.detail("Elapsed", elapsed); - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Optional err; - #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!requestIDHeader.empty()) - #line 3042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string responseID; - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - auto iid = r->headers.find(requestIDHeader); - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (iid != r->headers.end()) - #line 3050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + auto iid = r->data.headers.find(requestIDHeader); + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (iid != r->data.headers.end()) + #line 4067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" responseID = iid->second; - #line 3054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.detail("RequestIDReceived", responseID); - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" bool serverError = r->code >= 500 && r->code < 600; - #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (requestID != responseID && (!serverError || !responseID.empty())) - #line 3062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" err = http_bad_request_id(); - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - TraceEvent(SevError, "HTTPRequestFailedIDMismatch") .error(err.get()) .detail("DebugID", conn->getDebugID()) .detail("RemoteAddress", conn->getPeerAddress()) .detail("Verb", verb) .detail("Resource", resource) .detail("RequestContentLen", contentLen) .detail("ResponseCode", r->code) .detail("ResponseContentLen", r->contentLen) .detail("RequestIDSent", requestID) .detail("RequestIDReceived", responseID); - #line 3068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + TraceEvent(SevError, "HTTPRequestFailedIDMismatch") .error(err.get()) .detail("DebugID", conn->getDebugID()) .detail("RemoteAddress", conn->getPeerAddress()) .detail("Verb", request->verb) .detail("Resource", request->resource) .detail("RequestContentLen", request->data.contentLen) .detail("ResponseCode", r->code) .detail("ResponseContentLen", r->data.contentLen) .detail("RequestIDSent", requestID) .detail("RequestIDReceived", responseID); + #line 4085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } } - #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (FLOW_KNOBS->HTTP_VERBOSE_LEVEL > 0) - #line 3073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - fmt::print("[{0}] HTTP {1}code={2} early={3}, time={4} {5} {6} contentLen={7} [{8} out, response content " "len {9}]\n", conn->getDebugID().toString(), (err.present() ? format("*ERROR*=%s ", err.get().name()).c_str() : ""), r->code, earlyResponse, elapsed, verb, resource, contentLen, total_sent, r->contentLen); - #line 3077 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + fmt::print("[{0}] HTTP {1}code={2} early={3}, time={4} {5} {6} contentLen={7} [{8} out, response content " "len {9}]\n", conn->getDebugID().toString(), (err.present() ? format("*ERROR*=%s ", err.get().name()).c_str() : ""), r->code, earlyResponse, elapsed, request->verb, request->resource, request->data.contentLen, total_sent, r->data.contentLen); + #line 4094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (FLOW_KNOBS->HTTP_VERBOSE_LEVEL > 2) - #line 3081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - printf("[%s] HTTP RESPONSE: %s %s\n%s\n", conn->getDebugID().toString().c_str(), verb.c_str(), resource.c_str(), r->toString().c_str()); - #line 3085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + fmt::print("[{}] HTTP RESPONSE: {} {}\n{}\n", conn->getDebugID().toString(), request->verb, request->resource, r->toString()); + #line 4102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (err.present()) - #line 3089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch2(err.get(), loopDepth); - #line 3093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - } - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (!static_cast(this)->SAV>::futures) { (void)(r); this->~DoRequestActorState(); static_cast(this)->destroy(); return 0; } - #line 3097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(r)); // state_var_RVO - this->~DoRequestActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 4110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + } + #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(r); this->~DoRequestActorActorState(); static_cast(this)->destroy(); return 0; } + #line 4114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(r)); // state_var_RVO + this->~DoRequestActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } - int a_body1cont4when1(Void const& _,int loopDepth) + int a_body1cont2when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont9(_, loopDepth); + loopDepth = a_body1cont7(_, loopDepth); return loopDepth; } - int a_body1cont4when1(Void && _,int loopDepth) + int a_body1cont2when1(Void && _,int loopDepth) { - loopDepth = a_body1cont9(std::move(_), loopDepth); + loopDepth = a_body1cont7(std::move(_), loopDepth); return loopDepth; } void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< DoRequestActor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoRequestActorActor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< DoRequestActor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< DoRequestActorActor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("doRequest", reinterpret_cast(this), 3); + fdb_probe_actor_enter("doRequestActor", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont4when1(value, 0); + a_body1cont2when1(value, 0); } catch (Error& error) { a_body1Catch2(error, 0); } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("doRequest", reinterpret_cast(this), 3); + fdb_probe_actor_exit("doRequestActor", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< DoRequestActor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< DoRequestActorActor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("doRequest", reinterpret_cast(this), 3); + fdb_probe_actor_enter("doRequestActor", reinterpret_cast(this), 3); a_exitChoose4(); try { - a_body1cont4when1(std::move(value), 0); + a_body1cont2when1(std::move(value), 0); } catch (Error& error) { a_body1Catch2(error, 0); } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("doRequest", reinterpret_cast(this), 3); + fdb_probe_actor_exit("doRequestActor", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< DoRequestActor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< DoRequestActorActor, 3, Void >*,Error err) { - fdb_probe_actor_enter("doRequest", reinterpret_cast(this), 3); + fdb_probe_actor_enter("doRequestActor", reinterpret_cast(this), 3); a_exitChoose4(); try { a_body1Catch2(err, 0); @@ -3162,77 +4179,67 @@ class DoRequestActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("doRequest", reinterpret_cast(this), 3); + fdb_probe_actor_exit("doRequestActor", reinterpret_cast(this), 3); } - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Reference conn; - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - std::string verb; - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - std::string resource; - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - HTTP::Headers headers; - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - UnsentPacketQueue* pContent; - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - int contentLen; - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Reference request; + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Reference sendRate; - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int64_t* pSent; - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Reference recvRate; - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - std::string requestIDHeader; - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" TraceEvent event; - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - UnsentPacketQueue empty; - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + std::string requestIDHeader; + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" bool earlyResponse; - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int total_sent; - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" double send_start; - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string requestID; - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - Reference r; - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Reference r; + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Future responseReading; - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int trySend; - #line 3206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" }; -// This generated class is to be used only via doRequest() - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" -class DoRequestActor final : public Actor>, public ActorCallback< DoRequestActor, 0, Void >, public ActorCallback< DoRequestActor, 1, Void >, public ActorCallback< DoRequestActor, 2, Void >, public ActorCallback< DoRequestActor, 3, Void >, public FastAllocated, public DoRequestActorState { - #line 3211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" +// This generated class is to be used only via doRequestActor() + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +class DoRequestActorActor final : public Actor>, public ActorCallback< DoRequestActorActor, 0, Void >, public ActorCallback< DoRequestActorActor, 1, Void >, public ActorCallback< DoRequestActorActor, 2, Void >, public ActorCallback< DoRequestActorActor, 3, Void >, public FastAllocated, public DoRequestActorActorState { + #line 4218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< DoRequestActor, 0, Void >; -friend struct ActorCallback< DoRequestActor, 1, Void >; -friend struct ActorCallback< DoRequestActor, 2, Void >; -friend struct ActorCallback< DoRequestActor, 3, Void >; - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - DoRequestActor(Reference const& conn,std::string const& verb,std::string const& resource,HTTP::Headers const& headers,UnsentPacketQueue* const& pContent,int const& contentLen,Reference const& sendRate,int64_t* const& pSent,Reference const& recvRate,std::string const& requestIDHeader) - #line 3225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" - : Actor>(), - DoRequestActorState(conn, verb, resource, headers, pContent, contentLen, sendRate, pSent, recvRate, requestIDHeader) - { - fdb_probe_actor_enter("doRequest", reinterpret_cast(this), -1); +friend struct ActorCallback< DoRequestActorActor, 0, Void >; +friend struct ActorCallback< DoRequestActorActor, 1, Void >; +friend struct ActorCallback< DoRequestActorActor, 2, Void >; +friend struct ActorCallback< DoRequestActorActor, 3, Void >; + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + DoRequestActorActor(Reference const& conn,Reference const& request,Reference const& sendRate,int64_t* const& pSent,Reference const& recvRate) + #line 4232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + : Actor>(), + DoRequestActorActorState(conn, request, sendRate, pSent, recvRate) + { + fdb_probe_actor_enter("doRequestActor", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("doRequest"); + this->lineage.setActorName("doRequestActor"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("doRequest", reinterpret_cast(this), -1); + fdb_probe_actor_exit("doRequestActor", reinterpret_cast(this), -1); } void cancel() override @@ -3240,43 +4247,64 @@ friend struct ActorCallback< DoRequestActor, 3, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< DoRequestActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< DoRequestActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< DoRequestActor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< DoRequestActor, 3, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< DoRequestActorActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DoRequestActorActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< DoRequestActorActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< DoRequestActorActor, 3, Void >*)0, actor_cancelled()); break; } } }; - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" -[[nodiscard]] Future> doRequest( Reference const& conn, std::string const& verb, std::string const& resource, HTTP::Headers const& headers, UnsentPacketQueue* const& pContent, int const& contentLen, Reference const& sendRate, int64_t* const& pSent, Reference const& recvRate, std::string const& requestIDHeader ) { - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - return Future>(new DoRequestActor(conn, verb, resource, headers, pContent, contentLen, sendRate, pSent, recvRate, requestIDHeader)); - #line 3255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +[[nodiscard]] Future> doRequestActor( Reference const& conn, Reference const& request, Reference const& sendRate, int64_t* const& pSent, Reference const& recvRate ) { + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + return Future>(new DoRequestActorActor(conn, request, sendRate, pSent, recvRate)); + #line 4262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } -#line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +#line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + +// IDE build didn't like the actor conversion i guess +Future> doRequest(Reference conn, + Reference request, + Reference sendRate, + int64_t* pSent, + Reference recvRate) { + return doRequestActor(conn, request, sendRate, pSent, recvRate); +} - #line 3260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" // This generated class is to be used only via sendProxyConnectRequest() - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" template - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" class SendProxyConnectRequestActorState { - #line 3266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" SendProxyConnectRequestActorState(Reference const& conn,std::string const& remoteHost,std::string const& remoteService) - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" : conn(conn), - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" remoteHost(remoteHost), - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" remoteService(remoteService), - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - headers() - #line 3279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + requestTimeout(60), + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + maxTries(FLOW_KNOBS->RESTCLIENT_CONNECT_TRIES), + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + thisTry(1), + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + nextRetryDelay(2.0), + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + sendReceiveRate(makeReference()), + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + bytes_sent(0), + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + req(makeReference()) + #line 4307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { fdb_probe_actor_create("sendProxyConnectRequest", reinterpret_cast(this)); @@ -3289,27 +4317,23 @@ class SendProxyConnectRequestActorState { int a_body1(int loopDepth=0) { try { - #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - headers["Host"] = remoteHost + ":" + remoteService; - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - headers["Accept"] = "application/xml"; - #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - headers["Proxy-Connection"] = "Keep-Alive"; - #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - requestTimeout = 60; - #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - maxTries = FLOW_KNOBS->HTTP_CONNECT_TRIES; - #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - thisTry = 1; - #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - nextRetryDelay = 2.0; - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - sendReceiveRate = makeReference(); - #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - bytes_sent = 0; - #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + req->verb = HTTP_VERB_CONNECT; + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + req->resource = remoteHost + ":" + remoteService; + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + req->data.content = nullptr; + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + req->data.contentLen = 0; + #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + req->data.headers["Host"] = req->resource; + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + req->data.headers["Accept"] = "application/xml"; + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + req->data.headers["Proxy-Connection"] = "Keep-Alive"; + #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" ; - #line 3312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -3337,22 +4361,24 @@ class SendProxyConnectRequestActorState { } int a_body1loopBody1(int loopDepth) { - #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" err = Optional(); - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - r = Reference(); - #line 3344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + r = Reference(); + #line 4368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" try { - #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - StrictFuture> __when_expr_0 = timeoutError(doRequest(conn, "CONNECT", remoteHost + ":" + remoteService, headers, nullptr, 0, sendReceiveRate, &bytes_sent, sendReceiveRate), requestTimeout); - #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Future> f = HTTP::doRequest(conn, req, sendReceiveRate, &bytes_sent, sendReceiveRate); + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + StrictFuture> __when_expr_0 = timeoutError(f, requestTimeout); + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 3350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 4381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3365,124 +4391,124 @@ class SendProxyConnectRequestActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!err.present() && r->code == 200) - #line 3370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SendProxyConnectRequestActorState(); static_cast(this)->destroy(); return 0; } - #line 3374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SendProxyConnectRequestActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" bool retryable = err.present() || r->code == 500 || r->code == 502 || r->code == 503 || r->code == 429; - #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" retryable = retryable && (thisTry < maxTries); - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" TraceEvent event(SevWarn, retryable ? "ProxyConnectCommandFailedRetryable" : "ProxyConnectCommandFailed"); - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (err.present()) - #line 3388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.errorUnsuppressed(err.get()); - #line 3392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.suppressFor(60); - #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!err.present()) - #line 3398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.detail("ResponseCode", r->code); - #line 3402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.detail("ThisTry", thisTry); - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!r || r->code != 429) - #line 3408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" ++thisTry; - #line 3412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" double delay = nextRetryDelay; - #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" nextRetryDelay = std::min(nextRetryDelay * 2, 60.0); - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (retryable) - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (r) - #line 3424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - auto iRetryAfter = r->headers.find("Retry-After"); - #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - if (iRetryAfter != r->headers.end()) - #line 3430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + auto iRetryAfter = r->data.headers.find("Retry-After"); + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + if (iRetryAfter != r->data.headers.end()) + #line 4456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.detail("RetryAfterHeader", iRetryAfter->second); - #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" char* pEnd; - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" double retryAfter = strtod(iRetryAfter->second.c_str(), &pEnd); - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (*pEnd) - #line 3440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" retryAfter = 300; - #line 3444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" delay = std::max(delay, retryAfter); - #line 3448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } } - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" event.detail("RetryDelay", delay); - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_1 = ::delay(delay); - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; } else { - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (r && r->code == 406) - #line 3469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(http_not_accepted(), std::max(0, loopDepth - 1)); - #line 3473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (r && r->code == 401) - #line 3477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(http_auth_failed(), std::max(0, loopDepth - 1)); - #line 3481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(connection_failed(), std::max(0, loopDepth - 1)); - #line 3485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } return loopDepth; @@ -3490,17 +4516,17 @@ class SendProxyConnectRequestActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (e.code() == error_code_actor_cancelled) - #line 3495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 3499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" err = e; - #line 3503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); } catch (Error& error) { @@ -3511,31 +4537,31 @@ class SendProxyConnectRequestActorState { return loopDepth; } - int a_body1loopBody1cont2(Reference const& _r,int loopDepth) + int a_body1loopBody1cont2(Reference const& _r,int loopDepth) { - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" r = _r; - #line 3518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = a_body1loopBody1cont4(loopDepth); return loopDepth; } - int a_body1loopBody1cont2(Reference && _r,int loopDepth) + int a_body1loopBody1cont2(Reference && _r,int loopDepth) { - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" r = _r; - #line 3527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = a_body1loopBody1cont4(loopDepth); return loopDepth; } - int a_body1loopBody1when1(Reference const& _r,int loopDepth) + int a_body1loopBody1when1(Reference const& _r,int loopDepth) { loopDepth = a_body1loopBody1cont2(_r, loopDepth); return loopDepth; } - int a_body1loopBody1when1(Reference && _r,int loopDepth) + int a_body1loopBody1when1(Reference && _r,int loopDepth) { loopDepth = a_body1loopBody1cont2(std::move(_r), loopDepth); @@ -3544,10 +4570,10 @@ class SendProxyConnectRequestActorState { void a_exitChoose1() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SendProxyConnectRequestActor, 0, Reference >::remove(); + static_cast(this)->ActorCallback< SendProxyConnectRequestActor, 0, Reference >::remove(); } - void a_callback_fire(ActorCallback< SendProxyConnectRequestActor, 0, Reference >*,Reference const& value) + void a_callback_fire(ActorCallback< SendProxyConnectRequestActor, 0, Reference >*,Reference const& value) { fdb_probe_actor_enter("sendProxyConnectRequest", reinterpret_cast(this), 0); a_exitChoose1(); @@ -3562,7 +4588,7 @@ class SendProxyConnectRequestActorState { fdb_probe_actor_exit("sendProxyConnectRequest", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< SendProxyConnectRequestActor, 0, Reference >*,Reference && value) + void a_callback_fire(ActorCallback< SendProxyConnectRequestActor, 0, Reference >*,Reference && value) { fdb_probe_actor_enter("sendProxyConnectRequest", reinterpret_cast(this), 0); a_exitChoose1(); @@ -3577,7 +4603,7 @@ class SendProxyConnectRequestActorState { fdb_probe_actor_exit("sendProxyConnectRequest", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< SendProxyConnectRequestActor, 0, Reference >*,Error err) + void a_callback_error(ActorCallback< SendProxyConnectRequestActor, 0, Reference >*,Error err) { fdb_probe_actor_enter("sendProxyConnectRequest", reinterpret_cast(this), 0); a_exitChoose1(); @@ -3686,36 +4712,36 @@ class SendProxyConnectRequestActorState { fdb_probe_actor_exit("sendProxyConnectRequest", reinterpret_cast(this), 1); } - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Reference conn; - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string remoteHost; - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string remoteService; - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - Headers headers; - #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int requestTimeout; - #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int maxTries; - #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int thisTry; - #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" double nextRetryDelay; - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Reference sendReceiveRate; - #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" int64_t bytes_sent; - #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Reference req; + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Optional err; - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - Reference r; - #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + Reference r; + #line 4739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" }; // This generated class is to be used only via sendProxyConnectRequest() - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" -class SendProxyConnectRequestActor final : public Actor, public ActorCallback< SendProxyConnectRequestActor, 0, Reference >, public ActorCallback< SendProxyConnectRequestActor, 1, Void >, public FastAllocated, public SendProxyConnectRequestActorState { - #line 3718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +class SendProxyConnectRequestActor final : public Actor, public ActorCallback< SendProxyConnectRequestActor, 0, Reference >, public ActorCallback< SendProxyConnectRequestActor, 1, Void >, public FastAllocated, public SendProxyConnectRequestActorState { + #line 4744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3723,11 +4749,11 @@ class SendProxyConnectRequestActor final : public Actor, public ActorCallb #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< SendProxyConnectRequestActor, 0, Reference >; +friend struct ActorCallback< SendProxyConnectRequestActor, 0, Reference >; friend struct ActorCallback< SendProxyConnectRequestActor, 1, Void >; - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" SendProxyConnectRequestActor(Reference const& conn,std::string const& remoteHost,std::string const& remoteService) - #line 3730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" : Actor(), SendProxyConnectRequestActorState(conn, remoteHost, remoteService) { @@ -3745,41 +4771,41 @@ friend struct ActorCallback< SendProxyConnectRequestActor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< SendProxyConnectRequestActor, 0, Reference >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< SendProxyConnectRequestActor, 0, Reference >*)0, actor_cancelled()); break; case 2: this->a_callback_error((ActorCallback< SendProxyConnectRequestActor, 1, Void >*)0, actor_cancelled()); break; } } }; - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" [[nodiscard]] Future sendProxyConnectRequest( Reference const& conn, std::string const& remoteHost, std::string const& remoteService ) { - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return Future(new SendProxyConnectRequestActor(conn, remoteHost, remoteService)); - #line 3758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } -#line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +#line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - #line 3763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" // This generated class is to be used only via proxyConnectImpl() - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" template - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" class ProxyConnectImplActorState { - #line 3769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" ProxyConnectImplActorState(std::string const& remoteHost,std::string const& remoteService,std::string const& proxyHost,std::string const& proxyService) - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" : remoteHost(remoteHost), - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" remoteService(remoteService), - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" proxyHost(proxyHost), - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" proxyService(proxyService) - #line 3782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" { fdb_probe_actor_create("proxyConnectImpl", reinterpret_cast(this)); @@ -3792,16 +4818,16 @@ class ProxyConnectImplActorState { int a_body1(int loopDepth=0) { try { - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_0 = map(INetworkConnections::net()->resolveTCPEndpoint(remoteHost, remoteService), [=](std::vector const& addresses) -> NetworkAddress { NetworkAddress addr = addresses[deterministicRandom()->randomInt(0, addresses.size())]; addr.fromHostname = true; addr.flags = NetworkAddress::FLAG_TLS; return addr; }); - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3822,25 +4848,25 @@ class ProxyConnectImplActorState { } int a_body1cont1(int loopDepth) { - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture> __when_expr_1 = INetworkConnections::net()->connect(proxyHost, proxyService); - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(NetworkAddress const& __remoteEndpoint,int loopDepth) { - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" remoteEndpoint = __remoteEndpoint; - #line 3843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -3905,25 +4931,25 @@ class ProxyConnectImplActorState { } int a_body1cont2(int loopDepth) { - #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture __when_expr_2 = sendProxyConnectRequest(connection, remoteHost, remoteService); - #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1when1(Reference const& __connection,int loopDepth) { - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" connection = __connection; - #line 3926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 4952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -3988,36 +5014,36 @@ class ProxyConnectImplActorState { } int a_body1cont3(Void const& _,int loopDepth) { - #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" boost::asio::ip::tcp::socket socket = std::move(connection->getSocket()); - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture> __when_expr_3 = INetworkConnections::net()->connect(remoteEndpoint, &socket); - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 5023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 5028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" boost::asio::ip::tcp::socket socket = std::move(connection->getSocket()); - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" StrictFuture> __when_expr_3 = INetworkConnections::net()->connect(remoteEndpoint, &socket); - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 5041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 5046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4087,9 +5113,9 @@ class ProxyConnectImplActorState { } int a_body1cont4(Reference const& remoteConnection,int loopDepth) { - #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(remoteConnection); this->~ProxyConnectImplActorState(); static_cast(this)->destroy(); return 0; } - #line 4092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 5118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(remoteConnection); this->~ProxyConnectImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4099,9 +5125,9 @@ class ProxyConnectImplActorState { } int a_body1cont4(Reference && remoteConnection,int loopDepth) { - #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(remoteConnection); this->~ProxyConnectImplActorState(); static_cast(this)->destroy(); return 0; } - #line 4104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 5130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(remoteConnection); this->~ProxyConnectImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4172,24 +5198,24 @@ class ProxyConnectImplActorState { fdb_probe_actor_exit("proxyConnectImpl", reinterpret_cast(this), 3); } - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string remoteHost; - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string remoteService; - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string proxyHost; - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" std::string proxyService; - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" NetworkAddress remoteEndpoint; - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Reference connection; - #line 4187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 5213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" }; // This generated class is to be used only via proxyConnectImpl() - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" class ProxyConnectImplActor final : public Actor>, public ActorCallback< ProxyConnectImplActor, 0, NetworkAddress >, public ActorCallback< ProxyConnectImplActor, 1, Reference >, public ActorCallback< ProxyConnectImplActor, 2, Void >, public ActorCallback< ProxyConnectImplActor, 3, Reference >, public FastAllocated, public ProxyConnectImplActorState { - #line 4192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 5218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4201,9 +5227,9 @@ friend struct ActorCallback< ProxyConnectImplActor, 0, NetworkAddress >; friend struct ActorCallback< ProxyConnectImplActor, 1, Reference >; friend struct ActorCallback< ProxyConnectImplActor, 2, Void >; friend struct ActorCallback< ProxyConnectImplActor, 3, Reference >; - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" ProxyConnectImplActor(std::string const& remoteHost,std::string const& remoteService,std::string const& proxyHost,std::string const& proxyService) - #line 4206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 5232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" : Actor>(), ProxyConnectImplActorState(remoteHost, remoteService, proxyHost, proxyService) { @@ -4229,14 +5255,14 @@ friend struct ActorCallback< ProxyConnectImplActor, 3, Reference >; } }; - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" [[nodiscard]] Future> proxyConnectImpl( std::string const& remoteHost, std::string const& remoteService, std::string const& proxyHost, std::string const& proxyService ) { - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" return Future>(new ProxyConnectImplActor(remoteHost, remoteService, proxyHost, proxyService)); - #line 4236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" + #line 5262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.g.cpp" } -#line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" +#line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTP.actor.cpp" Future> proxyConnect(const std::string& remoteHost, const std::string& remoteService, diff --git a/src/fdbrpc/HTTP.h b/src/fdbrpc/HTTP.h deleted file mode 100644 index cf1a063..0000000 --- a/src/fdbrpc/HTTP.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * HTTP.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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. - */ - -#include "flow/flow.h" -#include "flow/Net2Packet.h" -#include "fdbrpc/IRateControl.h" - -namespace HTTP { -struct is_iless { - bool operator()(const std::string& a, const std::string& b) const { return strcasecmp(a.c_str(), b.c_str()) < 0; } -}; - -typedef std::map Headers; - -std::string urlEncode(const std::string& s); -std::string awsV4URIEncode(const std::string& s, bool encodeSlash); - -struct Response : ReferenceCounted { - Response() {} - Future read(Reference conn, bool header_only); - std::string toString(); - float version; - int code; - Headers headers; - std::string content; - int64_t contentLen; - - bool verifyMD5(bool fail_if_header_missing, Optional content_sum = Optional()); -}; - -// Prepend the HTTP request header to the given PacketBuffer, returning the new head of the buffer chain -PacketBuffer* writeRequestHeader(std::string const& verb, - std::string const& resource, - HTTP::Headers const& headers, - PacketBuffer* dest); - -// Do an HTTP request to the blob store, parse the response. -Future> doRequest(Reference const& conn, - std::string const& verb, - std::string const& resource, - HTTP::Headers const& headers, - UnsentPacketQueue* const& pContent, - int const& contentLen, - Reference const& sendRate, - int64_t* const& pSent, - Reference const& recvRate, - const std::string& requestHeader = std::string()); - -// Connect to proxy, send CONNECT command, and connect to the remote host. -Future> proxyConnect(const std::string& remoteHost, - const std::string& remoteService, - const std::string& proxyHost, - const std::string& proxyService); - -} // namespace HTTP diff --git a/src/fdbrpc/HTTPServer.actor.cpp b/src/fdbrpc/HTTPServer.actor.cpp new file mode 100644 index 0000000..536956e --- /dev/null +++ b/src/fdbrpc/HTTPServer.actor.cpp @@ -0,0 +1,439 @@ +/* + * HTTPServer.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbrpc/HTTP.h" +#include "flow/IRandom.h" +#include "flow/Trace.h" +#include "fdbrpc/simulator.h" +#include "fdbrpc/SimulatorProcessInfo.h" +#include "flow/actorcompiler.h" // This must be the last #include. + +ACTOR Future callbackHandler(Reference conn, + Future readRequestDone, + Reference requestHandler, + Reference req, + FlowMutex* mutex) { + state Reference response = makeReference(); + state UnsentPacketQueue content; + response->data.content = &content; + response->data.contentLen = 0; + + try { + wait(readRequestDone); + wait(requestHandler->handleRequest(req, response)); + } catch (Error& e) { + if (e.code() == error_code_operation_cancelled) { + throw e; + } + // FIXME: other errors? + if (e.code() == error_code_connection_failed) { + TraceEvent(SevWarn, "HTTPServerConnHandlerFailed").error(e); + // return, client will retry + return Void(); + } + if (e.code() == error_code_http_request_failed || e.code() == error_code_http_bad_response) { + TraceEvent(SevWarn, "HTTPServerConnHandlerInternalError").errorUnsuppressed(e); + // reset to empty error response + response->reset(); + response->code = 500; + } else { + TraceEvent(SevWarn, "HTTPServerConnHandlerUnexpectedError").errorUnsuppressed(e); + throw e; + } + } + // take out response mutex to ensure no parallel writers to response connection + // FIXME: is this necessary? I think it is + state FlowMutex::Lock lock = wait(mutex->take()); + try { + wait(response->write(conn)); + } catch (Error& e) { + lock.release(); + if (e.code() == error_code_connection_failed) { + // connection back to client failed, end. They will retry if they still need the response. + TraceEvent("HTTPServerConnHandlerResponseError").errorUnsuppressed(e); + return Void(); + } + TraceEvent("HTTPServerConnHandlerResponseUnexpectedError").errorUnsuppressed(e); + throw e; + } + lock.release(); + return Void(); +} + +ACTOR Future connectionHandler(Reference server, + Reference conn, + Reference requestHandler) { + try { + // TODO do we actually have multiple requests on a connection? how does this work + state FlowMutex responseMutex; + state Future readPrevRequest = Future(Void()); + wait(conn->acceptHandshake()); + loop { + wait(readPrevRequest); + wait(delay(0)); + wait(conn->onReadable()); + state Reference req = makeReference(); + readPrevRequest = req->read(conn, false); + server->actors.add(callbackHandler(conn, readPrevRequest, requestHandler, req, &responseMutex)); + } + } catch (Error& e) { + if (e.code() != error_code_actor_cancelled) { + TraceEvent("HTTPConnectionError", server->dbgid) + .errorUnsuppressed(e) + .suppressFor(1.0) + .detail("ConnID", conn->getDebugID()) + .detail("FromAddress", conn->getPeerAddress()); + } + conn->close(); + } + return Void(); +} + +ACTOR Future listenActor(Reference server, + Reference requestHandler, + NetworkAddress addr, + Reference listener) { + TraceEvent(SevDebug, "HTTPServerListenStart", server->dbgid).detail("ListenAddress", addr.toString()); + + wait(requestHandler->init()); + + TraceEvent(SevDebug, "HTTPServerListenInitialized", server->dbgid).detail("ListenAddress", addr.toString()); + + try { + loop { + Reference conn = wait(listener->accept()); + if (!server->running) { + TraceEvent("HTTPServerExitedAfterAccept", server->dbgid); + break; + } + if (conn) { + server->actors.add(connectionHandler(server, conn, requestHandler)); + } + } + } catch (Error& e) { + TraceEvent(SevError, "HTTPListenError", server->dbgid).error(e); + throw; + } + + return Void(); +} + +NetworkAddress HTTP::SimServerContext::newAddress() { + // allocate new addr, assert we have enough addr space + ASSERT(listenAddresses.size() < 1000); + return NetworkAddress( + g_simulator->getCurrentProcess()->address.ip, nextPort++, true /* isPublic*/, false /*isTLS*/); +} + +void HTTP::SimServerContext::registerNewServer(NetworkAddress addr, Reference requestHandler) { + listenAddresses.push_back(addr); + listeners.push_back(INetworkConnections::net()->listen(addr)); + actors.add(listenActor(Reference::addRef(this), requestHandler, addr, listeners.back())); +} + +void HTTP::SimRegisteredHandlerContext::updateDNS() { + // if addresses is empty, that violates the assumption that there is at least one address when doing resolution. + // Only update dns if we have at least one address + if (!addresses.empty()) { + INetworkConnections::net()->addMockTCPEndpoint(hostname, service, addresses); + } +} + +void HTTP::SimRegisteredHandlerContext::addAddress(NetworkAddress addr) { + addresses.push_back(addr); + fmt::print("HTTP: adding address {0} for {1}:{2}\n", addr.toString(), hostname, service); + updateDNS(); +} + +void HTTP::SimRegisteredHandlerContext::removeIp(IPAddress ip) { + fmt::print("HTTP: removing ip {0} for {1}:{2}\n", ip.toString(), hostname, service); + for (int i = 0; i < addresses.size(); i++) { + if (addresses[i].ip == ip) { + swapAndPop(&addresses, i); + i--; + } + } + updateDNS(); +} + +// unit test stuff + +ACTOR Future helloWorldServerCallback(Reference req, + Reference response) { + wait(delay(0)); + ASSERT_EQ(req->verb, HTTP::HTTP_VERB_POST); + ASSERT_EQ(req->resource, "/hello-world"); + ASSERT_EQ(req->data.headers.size(), 2); + ASSERT(req->data.headers.count("Hello")); + + ASSERT_EQ(req->data.headers["Hello"], "World"); + ASSERT(req->data.headers.count("Content-Length")); + ASSERT_EQ(req->data.headers["Content-Length"], std::to_string(req->data.content.size())); + ASSERT_EQ(req->data.contentLen, req->data.content.size()); + ASSERT_EQ(req->data.content, "Hello World Request!"); + + response->code = 200; + response->data.headers["Hello"] = "World"; + + std::string hello = "Hello World Response!"; + response->data.headers["Content-MD5"] = HTTP::computeMD5Sum(hello); + + PacketWriter pw(response->data.content->getWriteBuffer(hello.size()), nullptr, Unversioned()); + pw.serializeBytes(hello); + response->data.contentLen = hello.size(); + + return Void(); +} + +struct HelloWorldRequestHandler : HTTP::IRequestHandler, ReferenceCounted { + Future handleRequest(Reference req, + Reference response) override { + return helloWorldServerCallback(req, response); + } + Reference clone() override { return makeReference(); } + + void addref() override { ReferenceCounted::addref(); } + void delref() override { ReferenceCounted::delref(); } +}; + +ACTOR Future helloErrorServerCallback(Reference req, + Reference response) { + wait(delay(0)); + if (deterministicRandom()->coinflip()) { + throw http_bad_response(); + } else { + throw http_request_failed(); + } +} + +struct HelloErrorRequestHandler : HTTP::IRequestHandler, ReferenceCounted { + Future handleRequest(Reference req, + Reference response) override { + return helloErrorServerCallback(req, response); + } + Reference clone() override { return makeReference(); } + + void addref() override { ReferenceCounted::addref(); } + void delref() override { ReferenceCounted::delref(); } +}; + +ACTOR Future helloBadMD5ServerCallback(Reference req, + Reference response) { + wait(delay(0)); + ASSERT_EQ(req->verb, HTTP::HTTP_VERB_GET); + ASSERT_EQ(req->resource, "/hello-world"); + ASSERT_EQ(req->data.headers.size(), 1); + ASSERT(req->data.headers.count("Content-Length")); + ASSERT_EQ(req->data.headers["Content-Length"], std::to_string(req->data.content.size())); + ASSERT_EQ(req->data.contentLen, req->data.content.size()); + ASSERT_EQ(req->data.content, "Hello Bad MD5 Request!"); + + response->code = 200; + response->data.headers["Hello"] = "World"; + + std::string hello = "Hello World Response!"; + response->data.headers["Content-MD5"] = HTTP::computeMD5Sum(hello); + + // change content to not match md5 sum! + hello = "Hello Bad MD5 Response"; + + PacketWriter pw(response->data.content->getWriteBuffer(hello.size()), nullptr, Unversioned()); + pw.serializeBytes(hello); + response->data.contentLen = hello.size(); + + return Void(); +} + +struct HelloBadMD5RequestHandler : HTTP::IRequestHandler, ReferenceCounted { + Future handleRequest(Reference req, + Reference response) override { + return helloBadMD5ServerCallback(req, response); + } + Reference clone() override { return makeReference(); } + + void addref() override { ReferenceCounted::addref(); } + void delref() override { ReferenceCounted::delref(); } +}; + +typedef std::function>(Reference conn)> DoRequestFunction; + +// handles retrying on timeout and reinitializing connection like other users of HTTP (S3BlobStore, RestClient) +ACTOR Future> doRequestTest(std::string hostname, + std::string service, + DoRequestFunction reqFunction) { + state Reference conn; + loop { + try { + if (!conn) { + wait(store(conn, INetworkConnections::net()->connect(hostname, service, false))); + ASSERT(conn.isValid()); + wait(conn->connectHandshake()); + } + + Future> f = reqFunction(conn); + Reference response = wait(f); + conn->close(); + return response; + } catch (Error& e) { + if (conn) { + conn->close(); + } + if (e.code() != error_code_timed_out && e.code() != error_code_connection_failed && + e.code() != error_code_lookup_failed) { + throw e; + } + // request got timed out or connection could not be established, close conn and try again + conn.clear(); + wait(delay(0.1)); + } + } +} + +ACTOR Future> doHelloWorldReq(Reference conn) { + state UnsentPacketQueue content; + state Reference req = makeReference(); + + state Reference sendReceiveRate = makeReference(); + state int64_t bytes_sent = 0; + + req->verb = HTTP::HTTP_VERB_POST; + req->resource = "/hello-world"; + req->data.headers["Hello"] = "World"; + + std::string hello = "Hello World Request!"; + + req->data.content = &content; + req->data.contentLen = hello.size(); + + PacketWriter pw(req->data.content->getWriteBuffer(hello.size()), nullptr, Unversioned()); + pw.serializeBytes(hello); + + Reference response = + wait(timeoutError(HTTP::doRequest(conn, req, sendReceiveRate, &bytes_sent, sendReceiveRate), 30.0)); + + std::string expectedContent = "Hello World Response!"; + + ASSERT_EQ(response->code, 200); + ASSERT_EQ(response->data.headers.size(), 3); + ASSERT(response->data.headers.count("Hello")); + ASSERT_EQ(response->data.headers["Hello"], "World"); + ASSERT(response->data.headers.count("Content-Length")); + ASSERT_EQ(response->data.headers["Content-Length"], std::to_string(response->data.content.size())); + ASSERT(response->data.headers.count("Content-MD5")); + ASSERT_EQ(response->data.headers["Content-MD5"], HTTP::computeMD5Sum(expectedContent)); + ASSERT_EQ(response->data.contentLen, response->data.content.size()); + ASSERT_EQ(response->data.content, expectedContent); + + return response; +} + +ACTOR Future> doHelloWorldErrorReq(Reference conn) { + state UnsentPacketQueue content; + state Reference req = makeReference(); + + state Reference sendReceiveRate = makeReference(); + state int64_t bytes_sent = 0; + + req->verb = HTTP::HTTP_VERB_GET; + req->resource = "/hello-error"; + + req->data.content = &content; + req->data.contentLen = 0; + + Reference response = + wait(timeoutError(HTTP::doRequest(conn, req, sendReceiveRate, &bytes_sent, sendReceiveRate), 30.0)); + + ASSERT(response->code == 500); + + return response; +} + +ACTOR Future> doHelloBadMD5Req(Reference conn) { + state UnsentPacketQueue content; + state Reference req = makeReference(); + + state Reference sendReceiveRate = makeReference(); + state int64_t bytes_sent = 0; + + req->verb = HTTP::HTTP_VERB_GET; + req->resource = "/hello-world"; + + std::string hello = "Hello Bad MD5 Request!"; + + req->data.content = &content; + req->data.contentLen = hello.size(); + + PacketWriter pw(req->data.content->getWriteBuffer(hello.size()), nullptr, Unversioned()); + pw.serializeBytes(hello); + + Reference response = + wait(timeoutError(HTTP::doRequest(conn, req, sendReceiveRate, &bytes_sent, sendReceiveRate), 30.0)); + + // should have gotten error + ASSERT(false); + + return response; +} + +// can't run as regular unit test right now because it needs special setup +TEST_CASE("/HTTP/Server/HelloWorld") { + ASSERT(g_network->isSimulated()); + fmt::print("Registering sim server\n"); + state std::string hostname = "helloworld-" + deterministicRandom()->randomUniqueID().toString(); + wait(g_simulator->registerSimHTTPServer(hostname, "80", makeReference())); + fmt::print("Registered sim server\n"); + + wait(success(doRequestTest(hostname, "80", doHelloWorldReq))); + + fmt::print("Done Hello\n"); + return Void(); +} + +TEST_CASE("/HTTP/Server/HelloError") { + ASSERT(g_network->isSimulated()); + fmt::print("Registering sim server\n"); + state std::string hostname = "helloerror-" + deterministicRandom()->randomUniqueID().toString(); + wait(g_simulator->registerSimHTTPServer(hostname, "80", makeReference())); + fmt::print("Registered sim server\n"); + + wait(success(doRequestTest(hostname, "80", doHelloWorldErrorReq))); + + fmt::print("Done Error\n"); + return Void(); +} + +TEST_CASE("/HTTP/Server/HelloBadMD5") { + ASSERT(g_network->isSimulated()); + fmt::print("Registering sim server\n"); + state std::string hostname = "hellobadmd5-" + deterministicRandom()->randomUniqueID().toString(); + wait(g_simulator->registerSimHTTPServer(hostname, "80", makeReference())); + fmt::print("Registered sim server\n"); + + // TODO refactor this into ASSERT_ERROR()? + try { + wait(success(doRequestTest(hostname, "80", doHelloBadMD5Req))); + ASSERT(false); + } catch (Error& e) { + ASSERT(e.code() == error_code_http_bad_response); + } + + fmt::print("Done Bad MD5\n"); + return Void(); +} \ No newline at end of file diff --git a/src/fdbrpc/HTTPServer.actor.g.cpp b/src/fdbrpc/HTTPServer.actor.g.cpp new file mode 100644 index 0000000..ac41bb1 --- /dev/null +++ b/src/fdbrpc/HTTPServer.actor.g.cpp @@ -0,0 +1,4682 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +/* + * HTTPServer.actor.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbrpc/HTTP.h" +#include "flow/IRandom.h" +#include "flow/Trace.h" +#include "fdbrpc/simulator.h" +#include "fdbrpc/SimulatorProcessInfo.h" +#include "flow/actorcompiler.h" // This must be the last #include. + + #line 30 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +namespace { +// This generated class is to be used only via callbackHandler() + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +template + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class CallbackHandlerActorState { + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + CallbackHandlerActorState(Reference const& conn,Future const& readRequestDone,Reference const& requestHandler,Reference const& req,FlowMutex* const& mutex) + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + : conn(conn), + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + readRequestDone(readRequestDone), + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + requestHandler(requestHandler), + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req(req), + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + mutex(mutex), + #line 33 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response(makeReference()), + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + content() + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + fdb_probe_actor_create("callbackHandler", reinterpret_cast(this)); + + } + ~CallbackHandlerActorState() + { + fdb_probe_actor_destroy("callbackHandler", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->data.content = &content; + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->data.contentLen = 0; + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + try { + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_0 = readRequestDone; + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CallbackHandlerActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_2 = mutex->take(); + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (e.code() == error_code_operation_cancelled) + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + } + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (e.code() == error_code_connection_failed) + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + TraceEvent(SevWarn, "HTTPServerConnHandlerFailed").error(e); + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CallbackHandlerActorState(); static_cast(this)->destroy(); return 0; } + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CallbackHandlerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (e.code() == error_code_http_request_failed || e.code() == error_code_http_bad_response) + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + TraceEvent(SevWarn, "HTTPServerConnHandlerInternalError").errorUnsuppressed(e); + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->reset(); + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->code = 500; + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + } + else + { + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + TraceEvent(SevWarn, "HTTPServerConnHandlerUnexpectedError").errorUnsuppressed(e); + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + } + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_1 = requestHandler->handleRequest(req, response); + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_1 = requestHandler->handleRequest(req, response); + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CallbackHandlerActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CallbackHandlerActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("callbackHandler", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("callbackHandler", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CallbackHandlerActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("callbackHandler", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("callbackHandler", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CallbackHandlerActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("callbackHandler", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("callbackHandler", reinterpret_cast(this), 0); + + } + int a_body1cont3(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CallbackHandlerActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CallbackHandlerActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("callbackHandler", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("callbackHandler", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< CallbackHandlerActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("callbackHandler", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("callbackHandler", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< CallbackHandlerActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("callbackHandler", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("callbackHandler", reinterpret_cast(this), 1); + + } + int a_body1cont4(int loopDepth) + { + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont5(int loopDepth) + { + try { + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_3 = response->write(conn); + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont5Catch1(actor_cancelled(), loopDepth); + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont5Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont5Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont5Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1when1(FlowMutex::Lock const& __lock,int loopDepth) + { + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + lock = __lock; + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(FlowMutex::Lock && __lock,int loopDepth) + { + lock = std::move(__lock); + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CallbackHandlerActor, 2, FlowMutex::Lock >::remove(); + + } + void a_callback_fire(ActorCallback< CallbackHandlerActor, 2, FlowMutex::Lock >*,FlowMutex::Lock const& value) + { + fdb_probe_actor_enter("callbackHandler", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("callbackHandler", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< CallbackHandlerActor, 2, FlowMutex::Lock >*,FlowMutex::Lock && value) + { + fdb_probe_actor_enter("callbackHandler", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("callbackHandler", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< CallbackHandlerActor, 2, FlowMutex::Lock >*,Error err) + { + fdb_probe_actor_enter("callbackHandler", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("callbackHandler", reinterpret_cast(this), 2); + + } + int a_body1cont6(int loopDepth) + { + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + lock.release(); + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CallbackHandlerActorState(); static_cast(this)->destroy(); return 0; } + #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CallbackHandlerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont5Catch1(const Error& e,int loopDepth=0) + { + try { + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + lock.release(); + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (e.code() == error_code_connection_failed) + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + TraceEvent("HTTPServerConnHandlerResponseError").errorUnsuppressed(e); + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CallbackHandlerActorState(); static_cast(this)->destroy(); return 0; } + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CallbackHandlerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + TraceEvent("HTTPServerConnHandlerResponseUnexpectedError").errorUnsuppressed(e); + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont7(Void const& _,int loopDepth) + { + loopDepth = a_body1cont8(loopDepth); + + return loopDepth; + } + int a_body1cont7(Void && _,int loopDepth) + { + loopDepth = a_body1cont8(loopDepth); + + return loopDepth; + } + int a_body1cont5when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont7(_, loopDepth); + + return loopDepth; + } + int a_body1cont5when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont7(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CallbackHandlerActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CallbackHandlerActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("callbackHandler", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont5when1(value, 0); + } + catch (Error& error) { + a_body1cont5Catch1(error, 0); + } catch (...) { + a_body1cont5Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("callbackHandler", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< CallbackHandlerActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("callbackHandler", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont5when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont5Catch1(error, 0); + } catch (...) { + a_body1cont5Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("callbackHandler", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< CallbackHandlerActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("callbackHandler", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont5Catch1(err, 0); + } + catch (Error& error) { + a_body1cont5Catch1(error, 0); + } catch (...) { + a_body1cont5Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("callbackHandler", reinterpret_cast(this), 3); + + } + int a_body1cont8(int loopDepth) + { + try { + loopDepth = a_body1cont6(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference conn; + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Future readRequestDone; + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference requestHandler; + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference req; + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + FlowMutex* mutex; + #line 33 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference response; + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + UnsentPacketQueue content; + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + FlowMutex::Lock lock; + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +}; +// This generated class is to be used only via callbackHandler() + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class CallbackHandlerActor final : public Actor, public ActorCallback< CallbackHandlerActor, 0, Void >, public ActorCallback< CallbackHandlerActor, 1, Void >, public ActorCallback< CallbackHandlerActor, 2, FlowMutex::Lock >, public ActorCallback< CallbackHandlerActor, 3, Void >, public FastAllocated, public CallbackHandlerActorState { + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CallbackHandlerActor, 0, Void >; +friend struct ActorCallback< CallbackHandlerActor, 1, Void >; +friend struct ActorCallback< CallbackHandlerActor, 2, FlowMutex::Lock >; +friend struct ActorCallback< CallbackHandlerActor, 3, Void >; + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + CallbackHandlerActor(Reference const& conn,Future const& readRequestDone,Reference const& requestHandler,Reference const& req,FlowMutex* const& mutex) + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + : Actor(), + CallbackHandlerActorState(conn, readRequestDone, requestHandler, req, mutex) + { + fdb_probe_actor_enter("callbackHandler", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("callbackHandler"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("callbackHandler", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CallbackHandlerActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< CallbackHandlerActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< CallbackHandlerActor, 2, FlowMutex::Lock >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< CallbackHandlerActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +[[nodiscard]] Future callbackHandler( Reference const& conn, Future const& readRequestDone, Reference const& requestHandler, Reference const& req, FlowMutex* const& mutex ) { + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return Future(new CallbackHandlerActor(conn, readRequestDone, requestHandler, req, mutex)); + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +} + +#line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +namespace { +// This generated class is to be used only via connectionHandler() + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +template + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class ConnectionHandlerActorState { + #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ConnectionHandlerActorState(Reference const& server,Reference const& conn,Reference const& requestHandler) + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + : server(server), + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + conn(conn), + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + requestHandler(requestHandler) + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + fdb_probe_actor_create("connectionHandler", reinterpret_cast(this)); + + } + ~ConnectionHandlerActorState() + { + fdb_probe_actor_destroy("connectionHandler", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + try { + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + responseMutex = FlowMutex(); + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + readPrevRequest = Future(Void()); + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_0 = conn->acceptHandshake(); + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ConnectionHandlerActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ConnectionHandlerActorState(); static_cast(this)->destroy(); return 0; } + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ConnectionHandlerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (e.code() != error_code_actor_cancelled) + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + TraceEvent("HTTPConnectionError", server->dbgid) .errorUnsuppressed(e) .suppressFor(1.0) .detail("ConnID", conn->getDebugID()) .detail("FromAddress", conn->getPeerAddress()); + #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + } + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + conn->close(); + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ; + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = a_body1cont2loopHead1(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ; + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = a_body1cont2loopHead1(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ConnectionHandlerActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ConnectionHandlerActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("connectionHandler", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("connectionHandler", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ConnectionHandlerActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("connectionHandler", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("connectionHandler", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ConnectionHandlerActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("connectionHandler", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("connectionHandler", reinterpret_cast(this), 0); + + } + int a_body1cont2loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont2loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1(int loopDepth) + { + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_1 = readPrevRequest; + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2loopBody1cont1(Void const& _,int loopDepth) + { + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_2 = delay(0); + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2loopBody1cont1(Void && _,int loopDepth) + { + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_2 = delay(0); + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ConnectionHandlerActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ConnectionHandlerActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("connectionHandler", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont2loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("connectionHandler", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ConnectionHandlerActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("connectionHandler", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont2loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("connectionHandler", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< ConnectionHandlerActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("connectionHandler", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("connectionHandler", reinterpret_cast(this), 1); + + } + int a_body1cont2loopBody1cont2(Void const& _,int loopDepth) + { + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_3 = conn->onReadable(); + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1cont2when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2loopBody1cont2(Void && _,int loopDepth) + { + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_3 = conn->onReadable(); + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1cont2when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2loopBody1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ConnectionHandlerActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ConnectionHandlerActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("connectionHandler", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2loopBody1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("connectionHandler", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< ConnectionHandlerActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("connectionHandler", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2loopBody1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("connectionHandler", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< ConnectionHandlerActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("connectionHandler", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("connectionHandler", reinterpret_cast(this), 2); + + } + int a_body1cont2loopBody1cont3(Void const& _,int loopDepth) + { + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req = makeReference(); + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + readPrevRequest = req->read(conn, false); + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + server->actors.add(callbackHandler(conn, readPrevRequest, requestHandler, req, &responseMutex)); + #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (loopDepth == 0) return a_body1cont2loopHead1(0); + + return loopDepth; + } + int a_body1cont2loopBody1cont3(Void && _,int loopDepth) + { + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req = makeReference(); + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + readPrevRequest = req->read(conn, false); + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + server->actors.add(callbackHandler(conn, readPrevRequest, requestHandler, req, &responseMutex)); + #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (loopDepth == 0) return a_body1cont2loopHead1(0); + + return loopDepth; + } + int a_body1cont2loopBody1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont2loopBody1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ConnectionHandlerActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ConnectionHandlerActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("connectionHandler", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont2loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("connectionHandler", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< ConnectionHandlerActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("connectionHandler", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont2loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("connectionHandler", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< ConnectionHandlerActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("connectionHandler", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("connectionHandler", reinterpret_cast(this), 3); + + } + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference server; + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference conn; + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference requestHandler; + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + FlowMutex responseMutex; + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Future readPrevRequest; + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference req; + #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +}; +// This generated class is to be used only via connectionHandler() + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class ConnectionHandlerActor final : public Actor, public ActorCallback< ConnectionHandlerActor, 0, Void >, public ActorCallback< ConnectionHandlerActor, 1, Void >, public ActorCallback< ConnectionHandlerActor, 2, Void >, public ActorCallback< ConnectionHandlerActor, 3, Void >, public FastAllocated, public ConnectionHandlerActorState { + #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ConnectionHandlerActor, 0, Void >; +friend struct ActorCallback< ConnectionHandlerActor, 1, Void >; +friend struct ActorCallback< ConnectionHandlerActor, 2, Void >; +friend struct ActorCallback< ConnectionHandlerActor, 3, Void >; + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ConnectionHandlerActor(Reference const& server,Reference const& conn,Reference const& requestHandler) + #line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + : Actor(), + ConnectionHandlerActorState(server, conn, requestHandler) + { + fdb_probe_actor_enter("connectionHandler", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("connectionHandler"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("connectionHandler", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ConnectionHandlerActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ConnectionHandlerActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< ConnectionHandlerActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< ConnectionHandlerActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +[[nodiscard]] Future connectionHandler( Reference const& server, Reference const& conn, Reference const& requestHandler ) { + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return Future(new ConnectionHandlerActor(server, conn, requestHandler)); + #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +} + +#line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + + #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +namespace { +// This generated class is to be used only via listenActor() + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +template + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class ListenActorActorState { + #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ListenActorActorState(Reference const& server,Reference const& requestHandler,NetworkAddress const& addr,Reference const& listener) + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + : server(server), + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + requestHandler(requestHandler), + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + addr(addr), + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + listener(listener) + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + fdb_probe_actor_create("listenActor", reinterpret_cast(this)); + + } + ~ListenActorActorState() + { + fdb_probe_actor_destroy("listenActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + TraceEvent(SevDebug, "HTTPServerListenStart", server->dbgid).detail("ListenAddress", addr.toString()); + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_0 = requestHandler->init(); + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~ListenActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + TraceEvent(SevDebug, "HTTPServerListenInitialized", server->dbgid).detail("ListenAddress", addr.toString()); + #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + try { + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ; + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + TraceEvent(SevDebug, "HTTPServerListenInitialized", server->dbgid).detail("ListenAddress", addr.toString()); + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + try { + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ; + #line 1305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ListenActorActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< ListenActorActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("listenActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listenActor", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< ListenActorActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("listenActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listenActor", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< ListenActorActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("listenActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listenActor", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ListenActorActorState(); static_cast(this)->destroy(); return 0; } + #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ListenActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + TraceEvent(SevError, "HTTPListenError", server->dbgid).error(e); + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3(int loopDepth) + { + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1(int loopDepth) + { + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture> __when_expr_1 = listener->accept(); + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1break1(int loopDepth) + { + try { + return a_body1cont3(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1loopBody1cont1(Reference const& conn,int loopDepth) + { + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!server->running) + #line 1454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + TraceEvent("HTTPServerExitedAfterAccept", server->dbgid); + #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (conn) + #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + server->actors.add(connectionHandler(server, conn, requestHandler)); + #line 1467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + } + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1cont1(Reference && conn,int loopDepth) + { + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!server->running) + #line 1477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + TraceEvent("HTTPServerExitedAfterAccept", server->dbgid); + #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (conn) + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + server->actors.add(connectionHandler(server, conn, requestHandler)); + #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + } + if (loopDepth == 0) return a_body1cont1loopHead1(0); + + return loopDepth; + } + int a_body1cont1loopBody1when1(Reference const& conn,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont1(conn, loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1when1(Reference && conn,int loopDepth) + { + loopDepth = a_body1cont1loopBody1cont1(std::move(conn), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ListenActorActor, 1, Reference >::remove(); + + } + void a_callback_fire(ActorCallback< ListenActorActor, 1, Reference >*,Reference const& value) + { + fdb_probe_actor_enter("listenActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listenActor", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< ListenActorActor, 1, Reference >*,Reference && value) + { + fdb_probe_actor_enter("listenActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listenActor", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< ListenActorActor, 1, Reference >*,Error err) + { + fdb_probe_actor_enter("listenActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("listenActor", reinterpret_cast(this), 1); + + } + int a_body1cont4(int loopDepth) + { + try { + loopDepth = a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference server; + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference requestHandler; + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + NetworkAddress addr; + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference listener; + #line 1580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +}; +// This generated class is to be used only via listenActor() + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class ListenActorActor final : public Actor, public ActorCallback< ListenActorActor, 0, Void >, public ActorCallback< ListenActorActor, 1, Reference >, public FastAllocated, public ListenActorActorState { + #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< ListenActorActor, 0, Void >; +friend struct ActorCallback< ListenActorActor, 1, Reference >; + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ListenActorActor(Reference const& server,Reference const& requestHandler,NetworkAddress const& addr,Reference const& listener) + #line 1597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + : Actor(), + ListenActorActorState(server, requestHandler, addr, listener) + { + fdb_probe_actor_enter("listenActor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("listenActor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("listenActor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< ListenActorActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< ListenActorActor, 1, Reference >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +[[nodiscard]] Future listenActor( Reference const& server, Reference const& requestHandler, NetworkAddress const& addr, Reference const& listener ) { + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return Future(new ListenActorActor(server, requestHandler, addr, listener)); + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +} + +#line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + +NetworkAddress HTTP::SimServerContext::newAddress() { + // allocate new addr, assert we have enough addr space + ASSERT(listenAddresses.size() < 1000); + return NetworkAddress( + g_simulator->getCurrentProcess()->address.ip, nextPort++, true /* isPublic*/, false /*isTLS*/); +} + +void HTTP::SimServerContext::registerNewServer(NetworkAddress addr, Reference requestHandler) { + listenAddresses.push_back(addr); + listeners.push_back(INetworkConnections::net()->listen(addr)); + actors.add(listenActor(Reference::addRef(this), requestHandler, addr, listeners.back())); +} + +void HTTP::SimRegisteredHandlerContext::updateDNS() { + // if addresses is empty, that violates the assumption that there is at least one address when doing resolution. + // Only update dns if we have at least one address + if (!addresses.empty()) { + INetworkConnections::net()->addMockTCPEndpoint(hostname, service, addresses); + } +} + +void HTTP::SimRegisteredHandlerContext::addAddress(NetworkAddress addr) { + addresses.push_back(addr); + fmt::print("HTTP: adding address {0} for {1}:{2}\n", addr.toString(), hostname, service); + updateDNS(); +} + +void HTTP::SimRegisteredHandlerContext::removeIp(IPAddress ip) { + fmt::print("HTTP: removing ip {0} for {1}:{2}\n", ip.toString(), hostname, service); + for (int i = 0; i < addresses.size(); i++) { + if (addresses[i].ip == ip) { + swapAndPop(&addresses, i); + i--; + } + } + updateDNS(); +} + +// unit test stuff + + #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +namespace { +// This generated class is to be used only via helloWorldServerCallback() + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +template + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class HelloWorldServerCallbackActorState { + #line 1678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + HelloWorldServerCallbackActorState(Reference const& req,Reference const& response) + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + : req(req), + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response(response) + #line 1687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + fdb_probe_actor_create("helloWorldServerCallback", reinterpret_cast(this)); + + } + ~HelloWorldServerCallbackActorState() + { + fdb_probe_actor_destroy("helloWorldServerCallback", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_0 = delay(0); + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~HelloWorldServerCallbackActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->verb, HTTP::HTTP_VERB_POST); + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->resource, "/hello-world"); + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.headers.size(), 2); + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(req->data.headers.count("Hello")); + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.headers["Hello"], "World"); + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(req->data.headers.count("Content-Length")); + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.headers["Content-Length"], std::to_string(req->data.content.size())); + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.contentLen, req->data.content.size()); + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.content, "Hello World Request!"); + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->code = 200; + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->data.headers["Hello"] = "World"; + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + std::string hello = "Hello World Response!"; + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->data.headers["Content-MD5"] = HTTP::computeMD5Sum(hello); + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + PacketWriter pw(response->data.content->getWriteBuffer(hello.size()), nullptr, Unversioned()); + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + pw.serializeBytes(hello); + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->data.contentLen = hello.size(); + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~HelloWorldServerCallbackActorState(); static_cast(this)->destroy(); return 0; } + #line 1764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~HelloWorldServerCallbackActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->verb, HTTP::HTTP_VERB_POST); + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->resource, "/hello-world"); + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.headers.size(), 2); + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(req->data.headers.count("Hello")); + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.headers["Hello"], "World"); + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(req->data.headers.count("Content-Length")); + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.headers["Content-Length"], std::to_string(req->data.content.size())); + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.contentLen, req->data.content.size()); + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.content, "Hello World Request!"); + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->code = 200; + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->data.headers["Hello"] = "World"; + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + std::string hello = "Hello World Response!"; + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->data.headers["Content-MD5"] = HTTP::computeMD5Sum(hello); + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + PacketWriter pw(response->data.content->getWriteBuffer(hello.size()), nullptr, Unversioned()); + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + pw.serializeBytes(hello); + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->data.contentLen = hello.size(); + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~HelloWorldServerCallbackActorState(); static_cast(this)->destroy(); return 0; } + #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~HelloWorldServerCallbackActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< HelloWorldServerCallbackActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< HelloWorldServerCallbackActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("helloWorldServerCallback", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("helloWorldServerCallback", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< HelloWorldServerCallbackActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("helloWorldServerCallback", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("helloWorldServerCallback", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< HelloWorldServerCallbackActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("helloWorldServerCallback", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("helloWorldServerCallback", reinterpret_cast(this), 0); + + } + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference req; + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference response; + #line 1883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +}; +// This generated class is to be used only via helloWorldServerCallback() + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class HelloWorldServerCallbackActor final : public Actor, public ActorCallback< HelloWorldServerCallbackActor, 0, Void >, public FastAllocated, public HelloWorldServerCallbackActorState { + #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< HelloWorldServerCallbackActor, 0, Void >; + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + HelloWorldServerCallbackActor(Reference const& req,Reference const& response) + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + : Actor(), + HelloWorldServerCallbackActorState(req, response) + { + fdb_probe_actor_enter("helloWorldServerCallback", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("helloWorldServerCallback"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("helloWorldServerCallback", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< HelloWorldServerCallbackActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +[[nodiscard]] Future helloWorldServerCallback( Reference const& req, Reference const& response ) { + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return Future(new HelloWorldServerCallbackActor(req, response)); + #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +} + +#line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + +struct HelloWorldRequestHandler : HTTP::IRequestHandler, ReferenceCounted { + Future handleRequest(Reference req, + Reference response) override { + return helloWorldServerCallback(req, response); + } + Reference clone() override { return makeReference(); } + + void addref() override { ReferenceCounted::addref(); } + void delref() override { ReferenceCounted::delref(); } +}; + + #line 1943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +namespace { +// This generated class is to be used only via helloErrorServerCallback() + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +template + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class HelloErrorServerCallbackActorState { + #line 1950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + HelloErrorServerCallbackActorState(Reference const& req,Reference const& response) + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + : req(req), + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response(response) + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + fdb_probe_actor_create("helloErrorServerCallback", reinterpret_cast(this)); + + } + ~HelloErrorServerCallbackActorState() + { + fdb_probe_actor_destroy("helloErrorServerCallback", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_0 = delay(0); + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~HelloErrorServerCallbackActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (deterministicRandom()->coinflip()) + #line 2004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + } + else + { + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return a_body1Catch1(http_request_failed(), loopDepth); + #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + } + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (deterministicRandom()->coinflip()) + #line 2023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return a_body1Catch1(http_bad_response(), loopDepth); + #line 2027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + } + else + { + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return a_body1Catch1(http_request_failed(), loopDepth); + #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + } + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< HelloErrorServerCallbackActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< HelloErrorServerCallbackActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("helloErrorServerCallback", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("helloErrorServerCallback", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< HelloErrorServerCallbackActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("helloErrorServerCallback", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("helloErrorServerCallback", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< HelloErrorServerCallbackActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("helloErrorServerCallback", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("helloErrorServerCallback", reinterpret_cast(this), 0); + + } + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference req; + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference response; + #line 2105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +}; +// This generated class is to be used only via helloErrorServerCallback() + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class HelloErrorServerCallbackActor final : public Actor, public ActorCallback< HelloErrorServerCallbackActor, 0, Void >, public FastAllocated, public HelloErrorServerCallbackActorState { + #line 2110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< HelloErrorServerCallbackActor, 0, Void >; + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + HelloErrorServerCallbackActor(Reference const& req,Reference const& response) + #line 2121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + : Actor(), + HelloErrorServerCallbackActorState(req, response) + { + fdb_probe_actor_enter("helloErrorServerCallback", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("helloErrorServerCallback"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("helloErrorServerCallback", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< HelloErrorServerCallbackActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +[[nodiscard]] Future helloErrorServerCallback( Reference const& req, Reference const& response ) { + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return Future(new HelloErrorServerCallbackActor(req, response)); + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +} + +#line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + +struct HelloErrorRequestHandler : HTTP::IRequestHandler, ReferenceCounted { + Future handleRequest(Reference req, + Reference response) override { + return helloErrorServerCallback(req, response); + } + Reference clone() override { return makeReference(); } + + void addref() override { ReferenceCounted::addref(); } + void delref() override { ReferenceCounted::delref(); } +}; + + #line 2165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +namespace { +// This generated class is to be used only via helloBadMD5ServerCallback() + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +template + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class HelloBadMD5ServerCallbackActorState { + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + HelloBadMD5ServerCallbackActorState(Reference const& req,Reference const& response) + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + : req(req), + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response(response) + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + fdb_probe_actor_create("helloBadMD5ServerCallback", reinterpret_cast(this)); + + } + ~HelloBadMD5ServerCallbackActorState() + { + fdb_probe_actor_destroy("helloBadMD5ServerCallback", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_0 = delay(0); + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~HelloBadMD5ServerCallbackActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->verb, HTTP::HTTP_VERB_GET); + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->resource, "/hello-world"); + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.headers.size(), 1); + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(req->data.headers.count("Content-Length")); + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.headers["Content-Length"], std::to_string(req->data.content.size())); + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.contentLen, req->data.content.size()); + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.content, "Hello Bad MD5 Request!"); + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->code = 200; + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->data.headers["Hello"] = "World"; + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + std::string hello = "Hello World Response!"; + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->data.headers["Content-MD5"] = HTTP::computeMD5Sum(hello); + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + hello = "Hello Bad MD5 Response"; + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + PacketWriter pw(response->data.content->getWriteBuffer(hello.size()), nullptr, Unversioned()); + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + pw.serializeBytes(hello); + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->data.contentLen = hello.size(); + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~HelloBadMD5ServerCallbackActorState(); static_cast(this)->destroy(); return 0; } + #line 2256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~HelloBadMD5ServerCallbackActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->verb, HTTP::HTTP_VERB_GET); + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->resource, "/hello-world"); + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.headers.size(), 1); + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(req->data.headers.count("Content-Length")); + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.headers["Content-Length"], std::to_string(req->data.content.size())); + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.contentLen, req->data.content.size()); + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(req->data.content, "Hello Bad MD5 Request!"); + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->code = 200; + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->data.headers["Hello"] = "World"; + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + std::string hello = "Hello World Response!"; + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->data.headers["Content-MD5"] = HTTP::computeMD5Sum(hello); + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + hello = "Hello Bad MD5 Response"; + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + PacketWriter pw(response->data.content->getWriteBuffer(hello.size()), nullptr, Unversioned()); + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + pw.serializeBytes(hello); + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + response->data.contentLen = hello.size(); + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~HelloBadMD5ServerCallbackActorState(); static_cast(this)->destroy(); return 0; } + #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~HelloBadMD5ServerCallbackActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< HelloBadMD5ServerCallbackActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< HelloBadMD5ServerCallbackActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("helloBadMD5ServerCallback", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("helloBadMD5ServerCallback", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< HelloBadMD5ServerCallbackActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("helloBadMD5ServerCallback", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("helloBadMD5ServerCallback", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< HelloBadMD5ServerCallbackActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("helloBadMD5ServerCallback", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("helloBadMD5ServerCallback", reinterpret_cast(this), 0); + + } + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference req; + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference response; + #line 2373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +}; +// This generated class is to be used only via helloBadMD5ServerCallback() + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class HelloBadMD5ServerCallbackActor final : public Actor, public ActorCallback< HelloBadMD5ServerCallbackActor, 0, Void >, public FastAllocated, public HelloBadMD5ServerCallbackActorState { + #line 2378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< HelloBadMD5ServerCallbackActor, 0, Void >; + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + HelloBadMD5ServerCallbackActor(Reference const& req,Reference const& response) + #line 2389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + : Actor(), + HelloBadMD5ServerCallbackActorState(req, response) + { + fdb_probe_actor_enter("helloBadMD5ServerCallback", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("helloBadMD5ServerCallback"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("helloBadMD5ServerCallback", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< HelloBadMD5ServerCallbackActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +[[nodiscard]] Future helloBadMD5ServerCallback( Reference const& req, Reference const& response ) { + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return Future(new HelloBadMD5ServerCallbackActor(req, response)); + #line 2417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +} + +#line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + +struct HelloBadMD5RequestHandler : HTTP::IRequestHandler, ReferenceCounted { + Future handleRequest(Reference req, + Reference response) override { + return helloBadMD5ServerCallback(req, response); + } + Reference clone() override { return makeReference(); } + + void addref() override { ReferenceCounted::addref(); } + void delref() override { ReferenceCounted::delref(); } +}; + +typedef std::function>(Reference conn)> DoRequestFunction; + +// handles retrying on timeout and reinitializing connection like other users of HTTP (S3BlobStore, RestClient) + #line 2436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +namespace { +// This generated class is to be used only via doRequestTest() + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +template + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class DoRequestTestActorState { + #line 2443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + DoRequestTestActorState(std::string const& hostname,std::string const& service,DoRequestFunction const& reqFunction) + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + : hostname(hostname), + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + service(service), + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + reqFunction(reqFunction), + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + conn() + #line 2456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + fdb_probe_actor_create("doRequestTest", reinterpret_cast(this)); + + } + ~DoRequestTestActorState() + { + fdb_probe_actor_destroy("doRequestTest", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ; + #line 2471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~DoRequestTestActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + try { + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!conn) + #line 2502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_0 = store(conn, INetworkConnections::net()->connect(hostname, service, false)); + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + else + { + loopDepth = a_body1loopBody1cont2(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1loopBody1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (conn) + #line 2540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + conn->close(); + #line 2544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + } + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (e.code() != error_code_timed_out && e.code() != error_code_connection_failed && e.code() != error_code_lookup_failed) + #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 2552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + } + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + conn.clear(); + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_3 = delay(0.1); + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + } + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Future> f = reqFunction(conn); + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture> __when_expr_2 = f; + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1loopBody1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Void const& _,int loopDepth) + { + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(conn.isValid()); + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_1 = conn->connectHandshake(); + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont3(Void && _,int loopDepth) + { + #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(conn.isValid()); + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_1 = conn->connectHandshake(); + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont3when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoRequestTestActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DoRequestTestActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("doRequestTest", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequestTest", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< DoRequestTestActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("doRequestTest", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequestTest", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< DoRequestTestActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("doRequestTest", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequestTest", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont4(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoRequestTestActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DoRequestTestActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("doRequestTest", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont3when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequestTest", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< DoRequestTestActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("doRequestTest", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequestTest", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< DoRequestTestActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("doRequestTest", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequestTest", reinterpret_cast(this), 1); + + } + int a_body1loopBody1cont5(Reference const& response,int loopDepth) + { + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + conn->close(); + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(response); this->~DoRequestTestActorState(); static_cast(this)->destroy(); return 0; } + #line 2774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(response); + this->~DoRequestTestActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont5(Reference && response,int loopDepth) + { + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + conn->close(); + #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(response); this->~DoRequestTestActorState(); static_cast(this)->destroy(); return 0; } + #line 2788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(response); + this->~DoRequestTestActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1loopBody1cont2when1(Reference const& response,int loopDepth) + { + loopDepth = a_body1loopBody1cont5(response, loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont2when1(Reference && response,int loopDepth) + { + loopDepth = a_body1loopBody1cont5(std::move(response), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoRequestTestActor, 2, Reference >::remove(); + + } + void a_callback_fire(ActorCallback< DoRequestTestActor, 2, Reference >*,Reference const& value) + { + fdb_probe_actor_enter("doRequestTest", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont2when1(value, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequestTest", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< DoRequestTestActor, 2, Reference >*,Reference && value) + { + fdb_probe_actor_enter("doRequestTest", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequestTest", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< DoRequestTestActor, 2, Reference >*,Error err) + { + fdb_probe_actor_enter("doRequestTest", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1loopBody1Catch1(err, 0); + } + catch (Error& error) { + a_body1loopBody1Catch1(error, 0); + } catch (...) { + a_body1loopBody1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequestTest", reinterpret_cast(this), 2); + + } + int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoRequestTestActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< DoRequestTestActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("doRequestTest", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequestTest", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< DoRequestTestActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("doRequestTest", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1loopBody1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequestTest", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< DoRequestTestActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("doRequestTest", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doRequestTest", reinterpret_cast(this), 3); + + } + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + std::string hostname; + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + std::string service; + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + DoRequestFunction reqFunction; + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference conn; + #line 2942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +}; +// This generated class is to be used only via doRequestTest() + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class DoRequestTestActor final : public Actor>, public ActorCallback< DoRequestTestActor, 0, Void >, public ActorCallback< DoRequestTestActor, 1, Void >, public ActorCallback< DoRequestTestActor, 2, Reference >, public ActorCallback< DoRequestTestActor, 3, Void >, public FastAllocated, public DoRequestTestActorState { + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DoRequestTestActor, 0, Void >; +friend struct ActorCallback< DoRequestTestActor, 1, Void >; +friend struct ActorCallback< DoRequestTestActor, 2, Reference >; +friend struct ActorCallback< DoRequestTestActor, 3, Void >; + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + DoRequestTestActor(std::string const& hostname,std::string const& service,DoRequestFunction const& reqFunction) + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + : Actor>(), + DoRequestTestActorState(hostname, service, reqFunction) + { + fdb_probe_actor_enter("doRequestTest", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("doRequestTest"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("doRequestTest", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DoRequestTestActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< DoRequestTestActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< DoRequestTestActor, 2, Reference >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< DoRequestTestActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +[[nodiscard]] Future> doRequestTest( std::string const& hostname, std::string const& service, DoRequestFunction const& reqFunction ) { + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return Future>(new DoRequestTestActor(hostname, service, reqFunction)); + #line 2992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +} + +#line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + + #line 2997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +namespace { +// This generated class is to be used only via doHelloWorldReq() + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +template + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class DoHelloWorldReqActorState { + #line 3004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + DoHelloWorldReqActorState(Reference const& conn) + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + : conn(conn), + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + content(), + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req(makeReference()), + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + sendReceiveRate(makeReference()), + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + bytes_sent(0) + #line 3019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + fdb_probe_actor_create("doHelloWorldReq", reinterpret_cast(this)); + + } + ~DoHelloWorldReqActorState() + { + fdb_probe_actor_destroy("doHelloWorldReq", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req->verb = HTTP::HTTP_VERB_POST; + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req->resource = "/hello-world"; + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req->data.headers["Hello"] = "World"; + #line 320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + std::string hello = "Hello World Request!"; + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req->data.content = &content; + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req->data.contentLen = hello.size(); + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + PacketWriter pw(req->data.content->getWriteBuffer(hello.size()), nullptr, Unversioned()); + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + pw.serializeBytes(hello); + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture> __when_expr_0 = timeoutError(HTTP::doRequest(conn, req, sendReceiveRate, &bytes_sent, sendReceiveRate), 30.0); + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 3057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~DoHelloWorldReqActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Reference const& response,int loopDepth) + { + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + std::string expectedContent = "Hello World Response!"; + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(response->code, 200); + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(response->data.headers.size(), 3); + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(response->data.headers.count("Hello")); + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(response->data.headers["Hello"], "World"); + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(response->data.headers.count("Content-Length")); + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(response->data.headers["Content-Length"], std::to_string(response->data.content.size())); + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(response->data.headers.count("Content-MD5")); + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(response->data.headers["Content-MD5"], HTTP::computeMD5Sum(expectedContent)); + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(response->data.contentLen, response->data.content.size()); + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(response->data.content, expectedContent); + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(response); this->~DoHelloWorldReqActorState(); static_cast(this)->destroy(); return 0; } + #line 3102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(response); + this->~DoHelloWorldReqActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Reference && response,int loopDepth) + { + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + std::string expectedContent = "Hello World Response!"; + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(response->code, 200); + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(response->data.headers.size(), 3); + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(response->data.headers.count("Hello")); + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(response->data.headers["Hello"], "World"); + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(response->data.headers.count("Content-Length")); + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(response->data.headers["Content-Length"], std::to_string(response->data.content.size())); + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(response->data.headers.count("Content-MD5")); + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(response->data.headers["Content-MD5"], HTTP::computeMD5Sum(expectedContent)); + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(response->data.contentLen, response->data.content.size()); + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT_EQ(response->data.content, expectedContent); + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(response); this->~DoHelloWorldReqActorState(); static_cast(this)->destroy(); return 0; } + #line 3136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(response); + this->~DoHelloWorldReqActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Reference const& response,int loopDepth) + { + loopDepth = a_body1cont1(response, loopDepth); + + return loopDepth; + } + int a_body1when1(Reference && response,int loopDepth) + { + loopDepth = a_body1cont1(std::move(response), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoHelloWorldReqActor, 0, Reference >::remove(); + + } + void a_callback_fire(ActorCallback< DoHelloWorldReqActor, 0, Reference >*,Reference const& value) + { + fdb_probe_actor_enter("doHelloWorldReq", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doHelloWorldReq", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< DoHelloWorldReqActor, 0, Reference >*,Reference && value) + { + fdb_probe_actor_enter("doHelloWorldReq", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doHelloWorldReq", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< DoHelloWorldReqActor, 0, Reference >*,Error err) + { + fdb_probe_actor_enter("doHelloWorldReq", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doHelloWorldReq", reinterpret_cast(this), 0); + + } + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference conn; + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + UnsentPacketQueue content; + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference req; + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference sendReceiveRate; + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + int64_t bytes_sent; + #line 3217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +}; +// This generated class is to be used only via doHelloWorldReq() + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class DoHelloWorldReqActor final : public Actor>, public ActorCallback< DoHelloWorldReqActor, 0, Reference >, public FastAllocated, public DoHelloWorldReqActorState { + #line 3222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DoHelloWorldReqActor, 0, Reference >; + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + DoHelloWorldReqActor(Reference const& conn) + #line 3233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + : Actor>(), + DoHelloWorldReqActorState(conn) + { + fdb_probe_actor_enter("doHelloWorldReq", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("doHelloWorldReq"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("doHelloWorldReq", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DoHelloWorldReqActor, 0, Reference >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +[[nodiscard]] Future> doHelloWorldReq( Reference const& conn ) { + #line 309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return Future>(new DoHelloWorldReqActor(conn)); + #line 3261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +} + +#line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + + #line 3266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +namespace { +// This generated class is to be used only via doHelloWorldErrorReq() + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +template + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class DoHelloWorldErrorReqActorState { + #line 3273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + DoHelloWorldErrorReqActorState(Reference const& conn) + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + : conn(conn), + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + content(), + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req(makeReference()), + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + sendReceiveRate(makeReference()), + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + bytes_sent(0) + #line 3288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + fdb_probe_actor_create("doHelloWorldErrorReq", reinterpret_cast(this)); + + } + ~DoHelloWorldErrorReqActorState() + { + fdb_probe_actor_destroy("doHelloWorldErrorReq", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req->verb = HTTP::HTTP_VERB_GET; + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req->resource = "/hello-error"; + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req->data.content = &content; + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req->data.contentLen = 0; + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture> __when_expr_0 = timeoutError(HTTP::doRequest(conn, req, sendReceiveRate, &bytes_sent, sendReceiveRate), 30.0); + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 3318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~DoHelloWorldErrorReqActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Reference const& response,int loopDepth) + { + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(response->code == 500); + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(response); this->~DoHelloWorldErrorReqActorState(); static_cast(this)->destroy(); return 0; } + #line 3343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(response); + this->~DoHelloWorldErrorReqActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Reference && response,int loopDepth) + { + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(response->code == 500); + #line 365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(response); this->~DoHelloWorldErrorReqActorState(); static_cast(this)->destroy(); return 0; } + #line 3357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(response); + this->~DoHelloWorldErrorReqActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Reference const& response,int loopDepth) + { + loopDepth = a_body1cont1(response, loopDepth); + + return loopDepth; + } + int a_body1when1(Reference && response,int loopDepth) + { + loopDepth = a_body1cont1(std::move(response), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoHelloWorldErrorReqActor, 0, Reference >::remove(); + + } + void a_callback_fire(ActorCallback< DoHelloWorldErrorReqActor, 0, Reference >*,Reference const& value) + { + fdb_probe_actor_enter("doHelloWorldErrorReq", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doHelloWorldErrorReq", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< DoHelloWorldErrorReqActor, 0, Reference >*,Reference && value) + { + fdb_probe_actor_enter("doHelloWorldErrorReq", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doHelloWorldErrorReq", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< DoHelloWorldErrorReqActor, 0, Reference >*,Error err) + { + fdb_probe_actor_enter("doHelloWorldErrorReq", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doHelloWorldErrorReq", reinterpret_cast(this), 0); + + } + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference conn; + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + UnsentPacketQueue content; + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference req; + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference sendReceiveRate; + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + int64_t bytes_sent; + #line 3438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +}; +// This generated class is to be used only via doHelloWorldErrorReq() + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class DoHelloWorldErrorReqActor final : public Actor>, public ActorCallback< DoHelloWorldErrorReqActor, 0, Reference >, public FastAllocated, public DoHelloWorldErrorReqActorState { + #line 3443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DoHelloWorldErrorReqActor, 0, Reference >; + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + DoHelloWorldErrorReqActor(Reference const& conn) + #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + : Actor>(), + DoHelloWorldErrorReqActorState(conn) + { + fdb_probe_actor_enter("doHelloWorldErrorReq", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("doHelloWorldErrorReq"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("doHelloWorldErrorReq", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DoHelloWorldErrorReqActor, 0, Reference >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +[[nodiscard]] Future> doHelloWorldErrorReq( Reference const& conn ) { + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return Future>(new DoHelloWorldErrorReqActor(conn)); + #line 3482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +} + +#line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + + #line 3487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +namespace { +// This generated class is to be used only via doHelloBadMD5Req() + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +template + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class DoHelloBadMD5ReqActorState { + #line 3494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + DoHelloBadMD5ReqActorState(Reference const& conn) + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + : conn(conn), + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + content(), + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req(makeReference()), + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + sendReceiveRate(makeReference()), + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + bytes_sent(0) + #line 3509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + fdb_probe_actor_create("doHelloBadMD5Req", reinterpret_cast(this)); + + } + ~DoHelloBadMD5ReqActorState() + { + fdb_probe_actor_destroy("doHelloBadMD5Req", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req->verb = HTTP::HTTP_VERB_GET; + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req->resource = "/hello-world"; + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + std::string hello = "Hello Bad MD5 Request!"; + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req->data.content = &content; + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + req->data.contentLen = hello.size(); + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + PacketWriter pw(req->data.content->getWriteBuffer(hello.size()), nullptr, Unversioned()); + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + pw.serializeBytes(hello); + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture> __when_expr_0 = timeoutError(HTTP::doRequest(conn, req, sendReceiveRate, &bytes_sent, sendReceiveRate), 30.0); + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 3545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~DoHelloBadMD5ReqActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Reference const& response,int loopDepth) + { + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(false); + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(response); this->~DoHelloBadMD5ReqActorState(); static_cast(this)->destroy(); return 0; } + #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(response); + this->~DoHelloBadMD5ReqActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Reference && response,int loopDepth) + { + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(false); + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV>::futures) { (void)(response); this->~DoHelloBadMD5ReqActorState(); static_cast(this)->destroy(); return 0; } + #line 3584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Reference >::value()) Reference(response); + this->~DoHelloBadMD5ReqActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Reference const& response,int loopDepth) + { + loopDepth = a_body1cont1(response, loopDepth); + + return loopDepth; + } + int a_body1when1(Reference && response,int loopDepth) + { + loopDepth = a_body1cont1(std::move(response), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< DoHelloBadMD5ReqActor, 0, Reference >::remove(); + + } + void a_callback_fire(ActorCallback< DoHelloBadMD5ReqActor, 0, Reference >*,Reference const& value) + { + fdb_probe_actor_enter("doHelloBadMD5Req", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doHelloBadMD5Req", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< DoHelloBadMD5ReqActor, 0, Reference >*,Reference && value) + { + fdb_probe_actor_enter("doHelloBadMD5Req", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doHelloBadMD5Req", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< DoHelloBadMD5ReqActor, 0, Reference >*,Error err) + { + fdb_probe_actor_enter("doHelloBadMD5Req", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("doHelloBadMD5Req", reinterpret_cast(this), 0); + + } + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference conn; + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + UnsentPacketQueue content; + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference req; + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + Reference sendReceiveRate; + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + int64_t bytes_sent; + #line 3665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +}; +// This generated class is to be used only via doHelloBadMD5Req() + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class DoHelloBadMD5ReqActor final : public Actor>, public ActorCallback< DoHelloBadMD5ReqActor, 0, Reference >, public FastAllocated, public DoHelloBadMD5ReqActorState { + #line 3670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< DoHelloBadMD5ReqActor, 0, Reference >; + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + DoHelloBadMD5ReqActor(Reference const& conn) + #line 3681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + : Actor>(), + DoHelloBadMD5ReqActorState(conn) + { + fdb_probe_actor_enter("doHelloBadMD5Req", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("doHelloBadMD5Req"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("doHelloBadMD5Req", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< DoHelloBadMD5ReqActor, 0, Reference >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +[[nodiscard]] Future> doHelloBadMD5Req( Reference const& conn ) { + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return Future>(new DoHelloBadMD5ReqActor(conn)); + #line 3709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +} + +#line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + +// can't run as regular unit test right now because it needs special setup + #line 3715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase396() + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +template + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class FlowTestCase396ActorState { + #line 3722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + FlowTestCase396ActorState(UnitTestParameters const& params) + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + : params(params) + #line 3729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase396", reinterpret_cast(this)); + + } + ~FlowTestCase396ActorState() + { + fdb_probe_actor_destroy("flowTestCase396", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(g_network->isSimulated()); + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + fmt::print("Registering sim server\n"); + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + hostname = "helloworld-" + deterministicRandom()->randomUniqueID().toString(); + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_0 = g_simulator->registerSimHTTPServer(hostname, "80", makeReference()); + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase396ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + fmt::print("Registered sim server\n"); + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_1 = success(doRequestTest(hostname, "80", doHelloWorldReq)); + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + fmt::print("Registered sim server\n"); + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_1 = success(doRequestTest(hostname, "80", doHelloWorldReq)); + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase396Actor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase396Actor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase396", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase396", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FlowTestCase396Actor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase396", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase396", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< FlowTestCase396Actor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase396", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase396", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + fmt::print("Done Hello\n"); + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase396ActorState(); static_cast(this)->destroy(); return 0; } + #line 3881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase396ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + fmt::print("Done Hello\n"); + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase396ActorState(); static_cast(this)->destroy(); return 0; } + #line 3895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase396ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase396Actor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase396Actor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase396", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase396", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< FlowTestCase396Actor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase396", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase396", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< FlowTestCase396Actor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase396", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase396", reinterpret_cast(this), 1); + + } + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + UnitTestParameters params; + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + std::string hostname; + #line 3970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase396() + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class FlowTestCase396Actor final : public Actor, public ActorCallback< FlowTestCase396Actor, 0, Void >, public ActorCallback< FlowTestCase396Actor, 1, Void >, public FastAllocated, public FlowTestCase396ActorState { + #line 3975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< FlowTestCase396Actor, 0, Void >; +friend struct ActorCallback< FlowTestCase396Actor, 1, Void >; + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + FlowTestCase396Actor(UnitTestParameters const& params) + #line 3987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + : Actor(), + FlowTestCase396ActorState(params) + { + fdb_probe_actor_enter("flowTestCase396", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase396"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase396", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< FlowTestCase396Actor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase396Actor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +static Future flowTestCase396( UnitTestParameters const& params ) { + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return Future(new FlowTestCase396Actor(params)); + #line 4016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase396, "/HTTP/Server/HelloWorld") + +#line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + + #line 4022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase409() + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +template + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class FlowTestCase409ActorState { + #line 4029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + FlowTestCase409ActorState(UnitTestParameters const& params) + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + : params(params) + #line 4036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase409", reinterpret_cast(this)); + + } + ~FlowTestCase409ActorState() + { + fdb_probe_actor_destroy("flowTestCase409", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(g_network->isSimulated()); + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + fmt::print("Registering sim server\n"); + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + hostname = "helloerror-" + deterministicRandom()->randomUniqueID().toString(); + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_0 = g_simulator->registerSimHTTPServer(hostname, "80", makeReference()); + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase409ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + fmt::print("Registered sim server\n"); + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_1 = success(doRequestTest(hostname, "80", doHelloWorldErrorReq)); + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + fmt::print("Registered sim server\n"); + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_1 = success(doRequestTest(hostname, "80", doHelloWorldErrorReq)); + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase409Actor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase409Actor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase409", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase409", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FlowTestCase409Actor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase409", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase409", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< FlowTestCase409Actor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase409", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase409", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + fmt::print("Done Error\n"); + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase409ActorState(); static_cast(this)->destroy(); return 0; } + #line 4188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase409ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + fmt::print("Done Error\n"); + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase409ActorState(); static_cast(this)->destroy(); return 0; } + #line 4202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase409ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase409Actor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase409Actor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase409", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase409", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< FlowTestCase409Actor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase409", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase409", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< FlowTestCase409Actor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase409", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase409", reinterpret_cast(this), 1); + + } + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + UnitTestParameters params; + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + std::string hostname; + #line 4277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase409() + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class FlowTestCase409Actor final : public Actor, public ActorCallback< FlowTestCase409Actor, 0, Void >, public ActorCallback< FlowTestCase409Actor, 1, Void >, public FastAllocated, public FlowTestCase409ActorState { + #line 4282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< FlowTestCase409Actor, 0, Void >; +friend struct ActorCallback< FlowTestCase409Actor, 1, Void >; + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + FlowTestCase409Actor(UnitTestParameters const& params) + #line 4294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + : Actor(), + FlowTestCase409ActorState(params) + { + fdb_probe_actor_enter("flowTestCase409", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase409"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase409", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< FlowTestCase409Actor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase409Actor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +static Future flowTestCase409( UnitTestParameters const& params ) { + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return Future(new FlowTestCase409Actor(params)); + #line 4323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase409, "/HTTP/Server/HelloError") + +#line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + + #line 4329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase422() + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +template + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class FlowTestCase422ActorState { + #line 4336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + FlowTestCase422ActorState(UnitTestParameters const& params) + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + : params(params) + #line 4343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase422", reinterpret_cast(this)); + + } + ~FlowTestCase422ActorState() + { + fdb_probe_actor_destroy("flowTestCase422", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(g_network->isSimulated()); + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + fmt::print("Registering sim server\n"); + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + hostname = "hellobadmd5-" + deterministicRandom()->randomUniqueID().toString(); + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_0 = g_simulator->registerSimHTTPServer(hostname, "80", makeReference()); + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase422ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + fmt::print("Registered sim server\n"); + #line 4394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + try { + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_1 = success(doRequestTest(hostname, "80", doHelloBadMD5Req)); + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 4400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + fmt::print("Registered sim server\n"); + #line 4420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + try { + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + StrictFuture __when_expr_1 = success(doRequestTest(hostname, "80", doHelloBadMD5Req)); + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 4426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase422Actor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase422Actor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase422", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase422", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FlowTestCase422Actor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase422", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase422", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< FlowTestCase422Actor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase422", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase422", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + fmt::print("Done Bad MD5\n"); + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase422ActorState(); static_cast(this)->destroy(); return 0; } + #line 4511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase422ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(e.code() == error_code_http_bad_response); + #line 4524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(false); + #line 4539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + ASSERT(false); + #line 4548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase422Actor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase422Actor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase422", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase422", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< FlowTestCase422Actor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase422", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase422", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< FlowTestCase422Actor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase422", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase422", reinterpret_cast(this), 1); + + } + int a_body1cont5(int loopDepth) + { + try { + loopDepth = a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + UnitTestParameters params; + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + std::string hostname; + #line 4633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase422() + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +class FlowTestCase422Actor final : public Actor, public ActorCallback< FlowTestCase422Actor, 0, Void >, public ActorCallback< FlowTestCase422Actor, 1, Void >, public FastAllocated, public FlowTestCase422ActorState { + #line 4638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< FlowTestCase422Actor, 0, Void >; +friend struct ActorCallback< FlowTestCase422Actor, 1, Void >; + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + FlowTestCase422Actor(UnitTestParameters const& params) + #line 4650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" + : Actor(), + FlowTestCase422ActorState(params) + { + fdb_probe_actor_enter("flowTestCase422", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase422"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase422", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< FlowTestCase422Actor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase422Actor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" +static Future flowTestCase422( UnitTestParameters const& params ) { + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.cpp" + return Future(new FlowTestCase422Actor(params)); + #line 4679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/HTTPServer.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase422, "/HTTP/Server/HelloBadMD5") + diff --git a/src/fdbrpc/IPAllowList.cpp b/src/fdbrpc/IPAllowList.cpp new file mode 100644 index 0000000..afd1208 --- /dev/null +++ b/src/fdbrpc/IPAllowList.cpp @@ -0,0 +1,388 @@ +/* + * IPAllowList.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include + +#include "flow/UnitTest.h" +#include "flow/Error.h" +#include "fdbrpc/IPAllowList.h" + +#include +#include +#include + +namespace { + +template +std::string binRep(std::array const& addr) { + return fmt::format("{:02x}", fmt::join(addr, ":")); +} + +template +void printIP(std::array const& addr) { + fmt::print(" {}", binRep(addr)); +} + +template +int netmaskWeightImpl(std::array const& addr) { + int count = 0; + for (int i = 0; i < addr.size() && addr[i] != 0xff; ++i) { + std::bitset<8> b(addr[i]); + count += 8 - b.count(); + } + return count; +} + +} // namespace + +AuthAllowedSubnet::AuthAllowedSubnet(IPAddress const& baseAddress, IPAddress const& addressMask) + : baseAddress(baseAddress), addressMask(addressMask) { + ASSERT(baseAddress.isV4() == addressMask.isV4()); +} + +IPAddress AuthAllowedSubnet::netmask() const { + if (addressMask.isV4()) { + uint32_t res = 0xffffffff ^ addressMask.toV4(); + return IPAddress(res); + } else { + std::array res; + res.fill(0xff); + auto mask = addressMask.toV6(); + for (int i = 0; i < mask.size(); ++i) { + res[i] ^= mask[i]; + } + return IPAddress(res); + } +} + +int AuthAllowedSubnet::netmaskWeight() const { + if (addressMask.isV4()) { + boost::asio::ip::address_v4 addr(netmask().toV4()); + return netmaskWeightImpl(addr.to_bytes()); + } else { + return netmaskWeightImpl(netmask().toV6()); + } +} + +AuthAllowedSubnet AuthAllowedSubnet::fromString(std::string_view addressString) { + auto pos = addressString.find('/'); + if (pos == std::string_view::npos) { + fmt::print("ERROR: {} is not a valid (use Network-Prefix/netmaskWeight syntax)\n", addressString); + throw invalid_option(); + } + auto address = addressString.substr(0, pos); + auto netmaskWeight = std::stoi(std::string(addressString.substr(pos + 1))); + auto addr = boost::asio::ip::make_address(address); + if (addr.is_v4()) { + auto bM = createBitMask(addr.to_v4().to_bytes(), netmaskWeight); + // we typically would expect a base address has been passed, but to be safe we still + // will make the last bits 0 + auto mask = boost::asio::ip::address_v4(bM).to_uint(); + auto baseAddress = addr.to_v4().to_uint() & mask; + return AuthAllowedSubnet(IPAddress(baseAddress), IPAddress(mask)); + } else { + auto mask = createBitMask(addr.to_v6().to_bytes(), netmaskWeight); + auto baseAddress = addr.to_v6().to_bytes(); + for (int i = 0; i < mask.size(); ++i) { + baseAddress[i] &= mask[i]; + } + return AuthAllowedSubnet(IPAddress(baseAddress), IPAddress(mask)); + } +} + +void AuthAllowedSubnet::printIP(std::string_view txt, IPAddress const& address) { + fmt::print("{}:", txt); + if (address.isV4()) { + ::printIP(boost::asio::ip::address_v4(address.toV4()).to_bytes()); + } else { + ::printIP(address.toV6()); + } + fmt::print("\n"); +} + +template +std::array AuthAllowedSubnet::createBitMask(std::array const& addr, + int netmaskWeight) { + std::array res; + res.fill((unsigned char)0xff); + int idx = netmaskWeight / 8; + if (netmaskWeight % 8 > 0) { + // 2^(netmaskWeight % 8) - 1 sets the last (netmaskWeight % 8) number of bits to 1 + // everything else will be zero. For example: 2^3 - 1 == 7 == 0b111 + unsigned char bitmask = (1 << (8 - (netmaskWeight % 8))) - ((unsigned char)1); + res[idx] ^= bitmask; + ++idx; + } + for (; idx < res.size(); ++idx) { + res[idx] = (unsigned char)0; + } + return res; +} + +template std::array AuthAllowedSubnet::createBitMask<4>(const std::array& addr, + int netmaskWeight); +template std::array AuthAllowedSubnet::createBitMask<16>(const std::array& addr, + int netmaskWeight); + +// helpers for testing +namespace { +using boost::asio::ip::address_v4; +using boost::asio::ip::address_v6; + +void traceAddress(TraceEvent& evt, const char* name, IPAddress address) { + evt.detail(name, address); + std::string bin; + if (address.isV4()) { + boost::asio::ip::address_v4 a(address.toV4()); + bin = binRep(a.to_bytes()); + } else { + bin = binRep(address.toV6()); + } + evt.detail(fmt::format("{}Binary", name).c_str(), bin); +} + +void subnetAssert(IPAllowList const& allowList, IPAddress addr, bool expectAllowed) { + if (allowList(addr) == expectAllowed) { + return; + } + TraceEvent evt(SevError, expectAllowed ? "ExpectedAddressToBeTrusted" : "ExpectedAddressToBeUntrusted"); + traceAddress(evt, "Address", addr); + auto const& subnets = allowList.subnets(); + for (int i = 0; i < subnets.size(); ++i) { + traceAddress(evt, fmt::format("SubnetBase{}", i).c_str(), subnets[i].baseAddress); + traceAddress(evt, fmt::format("SubnetMask{}", i).c_str(), subnets[i].addressMask); + } +} + +IPAddress parseAddr(std::string const& str) { + auto res = IPAddress::parse(str); + ASSERT(res.present()); + return res.get(); +} + +struct SubNetTest { + AuthAllowedSubnet subnet; + SubNetTest(AuthAllowedSubnet&& subnet) : subnet(std::move(subnet)) {} + SubNetTest(AuthAllowedSubnet const& subnet) : subnet(subnet) {} + template + static SubNetTest randomSubNetImpl() { + constexpr int width = V4 ? 4 : 16; + std::array binAddr; + unsigned char rnd[4]; + for (int i = 0; i < binAddr.size(); ++i) { + if (i % 4 == 0) { + auto tmp = deterministicRandom()->randomUInt32(); + ::memcpy(rnd, &tmp, 4); + } + binAddr[i] = rnd[i % 4]; + } + auto netmaskWeight = deterministicRandom()->randomInt(1, width); + std::string address; + if constexpr (V4) { + address_v4 a(binAddr); + address = a.to_string(); + } else { + address_v6 a(binAddr); + address = a.to_string(); + } + return SubNetTest(AuthAllowedSubnet::fromString(fmt::format("{}/{}", address, netmaskWeight))); + } + static SubNetTest randomSubNet() { + if (deterministicRandom()->coinflip()) { + return randomSubNetImpl(); + } else { + return randomSubNetImpl(); + } + } + + template + static IPAddress intArrayToAddress(uint32_t* arr) { + if constexpr (V4) { + return IPAddress(arr[0]); + } else { + std::array res; + memcpy(res.data(), arr, 16); + return IPAddress(res); + } + } + + template + I transformIntToSubnet(I val, I subnetMask, I baseAddress) { + return (val & subnetMask) ^ baseAddress; + } + + template + static IPAddress randomAddress() { + constexpr int width = V4 ? 4 : 16; + uint32_t rnd[width / 4]; + for (int i = 0; i < width / 4; ++i) { + rnd[i] = deterministicRandom()->randomUInt32(); + } + return intArrayToAddress(rnd); + } + + template + IPAddress randomAddress(bool inSubnet) { + ASSERT(V4 == subnet.baseAddress.isV4() || !inSubnet); + for (;;) { + auto res = randomAddress(); + if (V4 != subnet.baseAddress.isV4()) { + return res; + } + if (!inSubnet) { + if (!subnet(res)) { + return res; + } else { + continue; + } + } + // first we make sure the address is in the subnet + if constexpr (V4) { + auto a = res.toV4(); + auto base = subnet.baseAddress.toV4(); + auto netmask = subnet.netmask().toV4(); + auto validAddress = transformIntToSubnet(a, netmask, base); + res = IPAddress(validAddress); + } else { + auto a = res.toV6(); + auto base = subnet.baseAddress.toV6(); + auto netmask = subnet.netmask().toV6(); + for (int i = 0; i < a.size(); ++i) { + a[i] = transformIntToSubnet(a[i], netmask[i], base[i]); + } + res = IPAddress(a); + } + return res; + } + } + + IPAddress randomAddress(bool inSubnet) { + if (!inSubnet && deterministicRandom()->random01() < 0.1) { + // return an address of a different type + if (subnet.baseAddress.isV4()) { + return randomAddress(false); + } else { + return randomAddress(false); + } + } + if (subnet.addressMask.isV4()) { + return randomAddress(inSubnet); + } else { + return randomAddress(inSubnet); + } + } +}; + +} // namespace + +TEST_CASE("/fdbrpc/allow_list") { + // test correct weight calculation + // IPv4 + for (int i = 0; i < 33; ++i) { + auto str = fmt::format("0.0.0.0/{}", i); + auto subnet = AuthAllowedSubnet::fromString(str); + if (i != subnet.netmaskWeight()) { + fmt::print("Wrong calculated weight {} for {}\n", subnet.netmaskWeight(), str); + fmt::print("\tBase address: {}\n", subnet.baseAddress.toString()); + fmt::print("\tAddress Mask: {}\n", subnet.addressMask.toString()); + fmt::print("\tNetmask: {}\n", subnet.netmask().toString()); + ASSERT_EQ(i, subnet.netmaskWeight()); + } + } + // IPv6 + for (int i = 0; i < 129; ++i) { + auto subnet = AuthAllowedSubnet::fromString(fmt::format("0::/{}", i)); + ASSERT_EQ(i, subnet.netmaskWeight()); + } + IPAllowList allowList; + // Simulated v4 addresses + allowList.addTrustedSubnet("1.0.0.0/8"); + allowList.addTrustedSubnet("2.0.0.0/4"); + ::subnetAssert(allowList, parseAddr("1.0.1.1"), true); + ::subnetAssert(allowList, parseAddr("1.1.2.2"), true); + ::subnetAssert(allowList, parseAddr("2.2.1.1"), true); + ::subnetAssert(allowList, parseAddr("128.0.1.1"), false); + allowList = IPAllowList(); + allowList.addTrustedSubnet("0.0.0.0/2"); + allowList.addTrustedSubnet("abcd::/16"); + ::subnetAssert(allowList, parseAddr("1.0.1.1"), true); + ::subnetAssert(allowList, parseAddr("1.1.2.2"), true); + ::subnetAssert(allowList, parseAddr("2.2.1.1"), true); + ::subnetAssert(allowList, parseAddr("4.0.1.2"), true); + ::subnetAssert(allowList, parseAddr("5.2.1.1"), true); + ::subnetAssert(allowList, parseAddr("128.0.1.1"), false); + ::subnetAssert(allowList, parseAddr("192.168.3.1"), false); + // Simulated v6 addresses + ::subnetAssert(allowList, parseAddr("abcd::1:2:3:4"), true); + ::subnetAssert(allowList, parseAddr("abcd::2:3:3:4"), true); + ::subnetAssert(allowList, parseAddr("abcd:ab:ab:fdb:2:3:3:4"), true); + ::subnetAssert(allowList, parseAddr("2001:fdb1:fdb2:fdb3:fdb4:fdb5:fdb6:12"), false); + ::subnetAssert(allowList, parseAddr("2001:fdb1:fdb2:fdb3:fdb4:fdb5:fdb6:1"), false); + ::subnetAssert(allowList, parseAddr("2001:fdb1:fdb2:fdb3:fdb4:fdb5:fdb6:fdb"), false); + // Corner Cases + allowList = IPAllowList(); + allowList.addTrustedSubnet("0.0.0.0/0"); + // Random address tests + SubNetTest subnetTest(allowList.subnets()[0]); + for (int i = 0; i < 10; ++i) { + // All IPv4 addresses are in the allow list + ::subnetAssert(allowList, subnetTest.randomAddress(), true); + // No IPv6 addresses are in the allow list + ::subnetAssert(allowList, subnetTest.randomAddress(), false); + } + allowList = IPAllowList(); + allowList.addTrustedSubnet("::/0"); + subnetTest = SubNetTest(allowList.subnets()[0]); + for (int i = 0; i < 10; ++i) { + // All IPv6 addresses are in the allow list + ::subnetAssert(allowList, subnetTest.randomAddress(), true); + // No IPv4 addresses are ub the allow list + ::subnetAssert(allowList, subnetTest.randomAddress(), false); + } + allowList = IPAllowList(); + IPAddress baseAddress = SubNetTest::randomAddress(); + allowList.addTrustedSubnet(fmt::format("{}/32", baseAddress.toString())); + for (int i = 0; i < 10; ++i) { + auto rnd = SubNetTest::randomAddress(); + ::subnetAssert(allowList, rnd, rnd == baseAddress); + rnd = SubNetTest::randomAddress(); + ::subnetAssert(allowList, rnd, false); + } + allowList = IPAllowList(); + baseAddress = SubNetTest::randomAddress(); + allowList.addTrustedSubnet(fmt::format("{}/128", baseAddress.toString())); + for (int i = 0; i < 10; ++i) { + auto rnd = SubNetTest::randomAddress(); + ::subnetAssert(allowList, rnd, rnd == baseAddress); + rnd = SubNetTest::randomAddress(); + ::subnetAssert(allowList, rnd, false); + } + for (int i = 0; i < 100; ++i) { + SubNetTest subnetTest(SubNetTest::randomSubNet()); + allowList = IPAllowList(); + allowList.addTrustedSubnet(subnetTest.subnet); + for (int j = 0; j < 10; ++j) { + bool inSubnet = deterministicRandom()->random01() < 0.7; + auto addr = subnetTest.randomAddress(inSubnet); + ::subnetAssert(allowList, addr, inSubnet); + } + } + return Void(); +} diff --git a/src/fdbrpc/JsonWebKeySet.cpp b/src/fdbrpc/JsonWebKeySet.cpp new file mode 100644 index 0000000..570e515 --- /dev/null +++ b/src/fdbrpc/JsonWebKeySet.cpp @@ -0,0 +1,844 @@ +/* + * JsonWebKeySet.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "flow/Arena.h" +#include "flow/AutoCPointer.h" +#include "flow/Error.h" +#include "flow/IRandom.h" +#include "flow/MkCert.h" +#include "flow/PKey.h" +#include "flow/UnitTest.h" +#include "fdbrpc/Base64Encode.h" +#include "fdbrpc/Base64Decode.h" +#include "fdbrpc/JsonWebKeySet.h" +#include +#include +#include +#include +#include +#include +#include +#if OPENSSL_VERSION_NUMBER >= 0x30000000L && !defined(_WIN32) +#define USE_V3_API 1 +#else +#define USE_V3_API 0 +#endif + +#if USE_V3_API +#include +#include +#endif +#include +#include +#include +#include +#include +#include +#include + +#define JWKS_ERROR(issue, op) \ + TraceEvent(SevWarnAlways, "JsonWebKeySet" #op "Error").suppressFor(10).detail("Issue", issue) +#define JWKS_PARSE_ERROR(issue) JWKS_ERROR(issue, Parse) +#define JWKS_WRITE_ERROR(issue) JWKS_ERROR(issue, Write) + +#define JWK_PARSE_ERROR(issue) \ + TraceEvent(SevWarnAlways, "JsonWebKeyParseError") \ + .suppressFor(10) \ + .detail("Issue", issue) \ + .detail("KeyIndexBase0", keyIndex) +#define JWK_WRITE_ERROR(issue) \ + TraceEvent(SevWarnAlways, "JsonWebKeyWriteError") \ + .suppressFor(10) \ + .detail("Issue", issue) \ + .detail("KeyName", keyName.toString()) +#define JWK_ERROR_OSSL(issue, op) \ + do { \ + char buf[256]{ \ + 0, \ + }; \ + if (auto err = ::ERR_get_error()) { \ + ::ERR_error_string_n(err, buf, sizeof(buf)); \ + } \ + JWK_##op##_ERROR(issue).detail("OpenSSLError", static_cast(buf)); \ + } while (0) +#define JWK_PARSE_ERROR_OSSL(issue) JWK_ERROR_OSSL(issue, PARSE) +#define JWK_WRITE_ERROR_OSSL(issue) JWK_ERROR_OSSL(issue, WRITE) + +namespace { + +template +bool getJwkStringMember(JsonValue const& value, + char const* memberName, + std::conditional_t>& out, + int keyIndex) { + auto itr = value.FindMember(memberName); + if (itr == value.MemberEnd()) { + if constexpr (Required) { + JWK_PARSE_ERROR("Missing required member").detail("Member", memberName); + return false; + } else { + return true; + } + } + auto const& member = itr->value; + if (!member.IsString()) { + JWK_PARSE_ERROR("Expected member is not a string").detail("MemberName", memberName); + return false; + } + out = StringRef(reinterpret_cast(member.GetString()), member.GetStringLength()); + return true; +} + +#define DECLARE_JWK_REQUIRED_STRING_MEMBER(value, member) \ + auto member = StringRef(); \ + if (!getJwkStringMember(value, #member, member, keyIndex)) \ + return {} +#define DECLARE_JWK_OPTIONAL_STRING_MEMBER(value, member) \ + auto member = Optional(); \ + if (!getJwkStringMember(value, #member, member, keyIndex)) \ + return {} + +template +bool getJwkBigNumMember(Arena& arena, + std::conditional_t> const& b64Member, + AutoPtr& ptr, + char const* memberName, + char const* algorithm, + int keyIndex) { + if constexpr (!Required) { + if (!b64Member.present()) + return true; + } + auto data = StringRef(); + if constexpr (Required) { + data = b64Member; + } else { + data = b64Member.get(); + } + auto decoded = base64::url::decode(arena, data); + if (!decoded.present()) { + JWK_PARSE_ERROR("Base64URL decoding for parameter failed") + .detail("Algorithm", algorithm) + .detail("Parameter", memberName); + return false; + } + data = decoded.get(); + auto bn = ::BN_bin2bn(data.begin(), data.size(), nullptr); + if (!bn) { + JWK_PARSE_ERROR_OSSL("BN_bin2bn"); + return false; + } + ptr.reset(bn); + return true; +} + +#define DECL_DECODED_BN_MEMBER_REQUIRED(member, algo) \ + auto member = AutoCPointer(nullptr, &::BN_free); \ + if (!getJwkBigNumMember(arena, b64##member, member, #member, algo, keyIndex)) \ + return {} +#define DECL_DECODED_BN_MEMBER_OPTIONAL(member, algo) \ + auto member = AutoCPointer(nullptr, &::BN_clear_free); \ + if (!getJwkBigNumMember(arena, b64##member, member, #member, algo, keyIndex)) \ + return {} + +#define EC_DECLARE_DECODED_REQUIRED_BN_MEMBER(member) DECL_DECODED_BN_MEMBER_REQUIRED(member, "EC") +#define EC_DECLARE_DECODED_OPTIONAL_BN_MEMBER(member) DECL_DECODED_BN_MEMBER_OPTIONAL(member, "EC") +#define RSA_DECLARE_DECODED_REQUIRED_BN_MEMBER(member) DECL_DECODED_BN_MEMBER_REQUIRED(member, "RSA") +#define RSA_DECLARE_DECODED_OPTIONAL_BN_MEMBER(member) DECL_DECODED_BN_MEMBER_OPTIONAL(member, "RSA") + +StringRef bigNumToBase64Url(Arena& arena, const BIGNUM* bn) { + auto len = BN_num_bytes(bn); + auto buf = new (arena) uint8_t[len]; + ::BN_bn2bin(bn, buf); + return base64::url::encode(arena, StringRef(buf, len)); +} + +Optional parseEcP256Key(StringRef b64x, StringRef b64y, Optional b64d, int keyIndex) { + auto arena = Arena(); + EC_DECLARE_DECODED_REQUIRED_BN_MEMBER(x); + EC_DECLARE_DECODED_REQUIRED_BN_MEMBER(y); + EC_DECLARE_DECODED_OPTIONAL_BN_MEMBER(d); +#if USE_V3_API + // avoid deprecated API + auto bld = AutoCPointer(::OSSL_PARAM_BLD_new(), &::OSSL_PARAM_BLD_free); + if (!bld) { + JWK_PARSE_ERROR_OSSL("OSSL_PARAM_BLD_new() for EC"); + return {}; + } + // since OSSL_PKEY_PARAM_EC_PUB_{X|Y} are not settable params, we'll need to build a EC_GROUP and serialize it + auto group = AutoCPointer(::EC_GROUP_new_by_curve_name(NID_X9_62_prime256v1), &::EC_GROUP_free); + if (!group) { + JWK_PARSE_ERROR_OSSL("EC_GROUP_new_by_curve_name()"); + return {}; + } + auto point = AutoCPointer(::EC_POINT_new(group), &::EC_POINT_free); + if (!point) { + JWK_PARSE_ERROR_OSSL("EC_POINT_new()"); + return {}; + } + if (1 != ::EC_POINT_set_affine_coordinates(group, point, x, y, nullptr)) { + JWK_PARSE_ERROR_OSSL("EC_POINT_set_affine_coordinates()"); + return {}; + } + auto pointBufLen = ::EC_POINT_point2oct(group, point, POINT_CONVERSION_UNCOMPRESSED, nullptr, 0, nullptr); + if (!pointBufLen) { + JWK_PARSE_ERROR_OSSL("EC_POINT_point2oct() for length"); + return {}; + } + auto pointBuf = new (arena) uint8_t[pointBufLen]; + ::EC_POINT_point2oct(group, point, POINT_CONVERSION_UNCOMPRESSED, pointBuf, pointBufLen, nullptr); + if (!::OSSL_PARAM_BLD_push_utf8_string(bld, OSSL_PKEY_PARAM_GROUP_NAME, "prime256v1", sizeof("prime256v1") - 1) || + !::OSSL_PARAM_BLD_push_octet_string(bld, OSSL_PKEY_PARAM_PUB_KEY, pointBuf, pointBufLen)) { + JWK_PARSE_ERROR_OSSL("OSSL_PARAM_BLD_push_*() for EC (group, point)"); + return {}; + } + if (d && !::OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_PRIV_KEY, d)) { + JWK_PARSE_ERROR_OSSL("OSSL_PARAM_BLD_push_BN() for EC (d)"); + return {}; + } + auto params = AutoCPointer(::OSSL_PARAM_BLD_to_param(bld), &OSSL_PARAM_free); + if (!params) { + JWK_PARSE_ERROR_OSSL("OSSL_PARAM_BLD_to_param() for EC"); + return {}; + } + auto pctx = AutoCPointer(::EVP_PKEY_CTX_new_from_name(nullptr, "EC", nullptr), &::EVP_PKEY_CTX_free); + if (!pctx) { + JWK_PARSE_ERROR_OSSL("EVP_PKEY_CTX_new_from_name(EC)"); + return {}; + } + if (1 != ::EVP_PKEY_fromdata_init(pctx)) { + JWK_PARSE_ERROR_OSSL("EVP_PKEY_fromdata_init() for EC"); + return {}; + } + auto pkey = std::add_pointer_t(); + if (1 != ::EVP_PKEY_fromdata(pctx, &pkey, (d ? EVP_PKEY_KEYPAIR : EVP_PKEY_PUBLIC_KEY), params) || !pkey) { + JWK_PARSE_ERROR_OSSL("EVP_PKEY_fromdata() for EC"); + return {}; + } + auto pkeyAutoPtr = AutoCPointer(pkey, &::EVP_PKEY_free); +#else // USE_V3_API + auto key = AutoCPointer(::EC_KEY_new_by_curve_name(NID_X9_62_prime256v1), &::EC_KEY_free); + if (!key) { + JWK_PARSE_ERROR_OSSL("EC_KEY_new()"); + return {}; + } + if (d) { + if (1 != ::EC_KEY_set_private_key(key, d)) { + JWK_PARSE_ERROR_OSSL("EC_KEY_set_private_key()"); + return {}; + } + } + if (1 != ::EC_KEY_set_public_key_affine_coordinates(key, x, y)) { + JWK_PARSE_ERROR_OSSL("EC_KEY_set_public_key_affine_coordinates(key, x, y)"); + return {}; + } + auto pkey = AutoCPointer(::EVP_PKEY_new(), &::EVP_PKEY_free); + if (!pkey) { + JWK_PARSE_ERROR_OSSL("EVP_PKEY_new() for EC"); + return {}; + } + if (1 != EVP_PKEY_set1_EC_KEY(pkey, key)) { + JWK_PARSE_ERROR_OSSL("EVP_PKEY_set1_EC_KEY()"); + return {}; + } +#endif // USE_V3_API + if (d) { + auto len = ::i2d_PrivateKey(pkey, nullptr); + if (len <= 0) { + JWK_PARSE_ERROR_OSSL("i2d_PrivateKey() for EC"); + return {}; + } + auto buf = new (arena) uint8_t[len]; + auto out = std::add_pointer_t(buf); + len = ::i2d_PrivateKey(pkey, &out); + // assign through public API, even if it means some parsing overhead + return PrivateKey(DerEncoded{}, StringRef(buf, len)); + } else { + auto len = ::i2d_PUBKEY(pkey, nullptr); + if (len <= 0) { + JWK_PARSE_ERROR_OSSL("i2d_PUBKEY() for EC"); + return {}; + } + auto buf = new (arena) uint8_t[len]; + auto out = std::add_pointer_t(buf); + len = ::i2d_PUBKEY(pkey, &out); + // assign through public API, even if it means some parsing overhead + return PublicKey(DerEncoded{}, StringRef(buf, len)); + } +} + +Optional parseRsaKey(StringRef b64n, + StringRef b64e, + Optional b64d, + Optional b64p, + Optional b64q, + Optional b64dp, + Optional b64dq, + Optional b64qi, + int keyIndex) { + auto arena = Arena(); + RSA_DECLARE_DECODED_REQUIRED_BN_MEMBER(n); + RSA_DECLARE_DECODED_REQUIRED_BN_MEMBER(e); + RSA_DECLARE_DECODED_OPTIONAL_BN_MEMBER(d); + RSA_DECLARE_DECODED_OPTIONAL_BN_MEMBER(p); + RSA_DECLARE_DECODED_OPTIONAL_BN_MEMBER(q); + RSA_DECLARE_DECODED_OPTIONAL_BN_MEMBER(dp); + RSA_DECLARE_DECODED_OPTIONAL_BN_MEMBER(dq); + RSA_DECLARE_DECODED_OPTIONAL_BN_MEMBER(qi); + auto const isPublic = !d || !p || !q || !dp || !dq || !qi; +#if USE_V3_API + // avoid deprecated, algo-specific API + auto bld = AutoCPointer(::OSSL_PARAM_BLD_new(), &::OSSL_PARAM_BLD_free); + if (!bld) { + JWK_PARSE_ERROR_OSSL("OSSL_PARAM_BLD_new() for EC"); + return {}; + } + if (!::OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_RSA_N, n) || + !::OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_RSA_E, e)) { + JWK_PARSE_ERROR_OSSL("OSSL_PARAM_BLD_push_BN() for RSA (n, e)"); + return {}; + } + if (!isPublic) { + if (!::OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_RSA_D, d) || + !::OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_RSA_FACTOR1, p) || + !::OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_RSA_FACTOR2, q) || + !::OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_RSA_EXPONENT1, dp) || + !::OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_RSA_EXPONENT2, dq) || + !::OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_RSA_COEFFICIENT1, qi)) { + JWK_PARSE_ERROR_OSSL("OSSL_PARAM_BLD_push_BN() for RSA (d, p, q, dp, dq, qi)"); + return {}; + } + } + auto params = AutoCPointer(::OSSL_PARAM_BLD_to_param(bld), &::OSSL_PARAM_free); + if (!params) { + JWK_PARSE_ERROR_OSSL("OSSL_PARAM_BLD_to_param() for RSA"); + return {}; + } + auto pctx = AutoCPointer(::EVP_PKEY_CTX_new_from_name(nullptr, "RSA", nullptr), &::EVP_PKEY_CTX_free); + if (!pctx) { + JWK_PARSE_ERROR_OSSL("EVP_PKEY_CTX_new_from_name(RSA)"); + return {}; + } + if (1 != ::EVP_PKEY_fromdata_init(pctx)) { + JWK_PARSE_ERROR_OSSL("EVP_PKEY_fromdata_init() for RSA"); + return {}; + } + auto pkey = std::add_pointer_t(); + if (1 != ::EVP_PKEY_fromdata(pctx, &pkey, (!isPublic ? EVP_PKEY_KEYPAIR : EVP_PKEY_PUBLIC_KEY), params)) { + JWK_PARSE_ERROR_OSSL("EVP_PKEY_fromdata() for EC"); + return {}; + } + auto pkeyAutoPtr = AutoCPointer(pkey, &::EVP_PKEY_free); +#else // USE_V3_API + auto rsa = AutoCPointer(RSA_new(), &::RSA_free); + if (!rsa) { + JWK_PARSE_ERROR_OSSL("RSA_new()"); + return {}; + } + if (1 != ::RSA_set0_key(rsa, n, e, d)) { + JWK_PARSE_ERROR_OSSL("RSA_set0_key()"); + return {}; + } + // set0 == ownership taken by rsa, no need to free + n.release(); + e.release(); + d.release(); + if (!isPublic) { + if (1 != ::RSA_set0_factors(rsa, p, q)) { + JWK_PARSE_ERROR_OSSL("RSA_set0_factors()"); + return {}; + } + p.release(); + q.release(); + if (1 != ::RSA_set0_crt_params(rsa, dp, dq, qi)) { + JWK_PARSE_ERROR_OSSL("RSA_set0_crt_params()"); + return {}; + } + dp.release(); + dq.release(); + qi.release(); + } + auto pkey = AutoCPointer(::EVP_PKEY_new(), &::EVP_PKEY_free); + if (!pkey) { + JWK_PARSE_ERROR_OSSL("EVP_PKEY_new() for RSA"); + return {}; + } + if (1 != ::EVP_PKEY_set1_RSA(pkey, rsa)) { + JWK_PARSE_ERROR_OSSL("EVP_PKEY_set1_RSA()"); + return {}; + } +#endif // USE_V3_API + if (!isPublic) { + auto len = ::i2d_PrivateKey(pkey, nullptr); + if (len <= 0) { + JWK_PARSE_ERROR_OSSL("i2d_PrivateKey() for RSA"); + return {}; + } + auto buf = new (arena) uint8_t[len]; + auto out = std::add_pointer_t(buf); + len = ::i2d_PrivateKey(pkey, &out); + // assign through public API, even if it means some parsing overhead + return PrivateKey(DerEncoded{}, StringRef(buf, len)); + } else { + auto len = ::i2d_PUBKEY(pkey, nullptr); + if (len <= 0) { + JWK_PARSE_ERROR_OSSL("i2d_PUBKEY() for RSA"); + return {}; + } + auto buf = new (arena) uint8_t[len]; + auto out = std::add_pointer_t(buf); + len = ::i2d_PUBKEY(pkey, &out); + // assign through public API, even if it means some parsing overhead + return PublicKey(DerEncoded{}, StringRef(buf, len)); + } +} + +template +Optional parseKey(const Value& key, StringRef kty, int keyIndex) { + if (kty == "EC"_sr) { + DECLARE_JWK_REQUIRED_STRING_MEMBER(key, alg); + if (alg != "ES256"_sr) { + JWK_PARSE_ERROR("Unsupported EC algorithm").detail("Algorithm", alg.toString()); + return {}; + } + DECLARE_JWK_REQUIRED_STRING_MEMBER(key, crv); + if (crv != "P-256"_sr) { + JWK_PARSE_ERROR("Unsupported EC curve").detail("Curve", crv.toString()); + return {}; + } + DECLARE_JWK_REQUIRED_STRING_MEMBER(key, x); + DECLARE_JWK_REQUIRED_STRING_MEMBER(key, y); + DECLARE_JWK_OPTIONAL_STRING_MEMBER(key, d); + return parseEcP256Key(x, y, d, keyIndex); + } else if (kty == "RSA"_sr) { + DECLARE_JWK_REQUIRED_STRING_MEMBER(key, alg); + if (alg != "RS256"_sr) { + JWK_PARSE_ERROR("Unsupported RSA algorithm").detail("Algorithm", alg.toString()); + return {}; + } + DECLARE_JWK_REQUIRED_STRING_MEMBER(key, n); + DECLARE_JWK_REQUIRED_STRING_MEMBER(key, e); + DECLARE_JWK_OPTIONAL_STRING_MEMBER(key, d); + DECLARE_JWK_OPTIONAL_STRING_MEMBER(key, p); + DECLARE_JWK_OPTIONAL_STRING_MEMBER(key, q); + DECLARE_JWK_OPTIONAL_STRING_MEMBER(key, dp); + DECLARE_JWK_OPTIONAL_STRING_MEMBER(key, dq); + DECLARE_JWK_OPTIONAL_STRING_MEMBER(key, qi); + auto privKeyArgs = 0; + privKeyArgs += d.present(); + privKeyArgs += p.present(); + privKeyArgs += q.present(); + privKeyArgs += dp.present(); + privKeyArgs += dq.present(); + privKeyArgs += qi.present(); + if (privKeyArgs == 0 || privKeyArgs == 6) { + return parseRsaKey(n, e, d, p, q, dp, dq, qi, keyIndex); + } else { + JWK_PARSE_ERROR("Private key arguments partially exist").detail("NumMissingArgs", 6 - privKeyArgs); + return {}; + } + } else { + JWK_PARSE_ERROR("Unsupported key type").detail("KeyType", kty.toString()); + return {}; + } +} + +bool encodeEcKey(rapidjson::Writer& writer, + StringRef keyName, + EVP_PKEY* pKey, + const bool isPublic) { + auto arena = Arena(); + writer.StartObject(); + writer.Key("kty"); + writer.String("EC"); + writer.Key("alg"); + writer.String("ES256"); + writer.Key("kid"); + writer.String(reinterpret_cast(keyName.begin()), keyName.size()); +#if USE_V3_API + auto curveNameBuf = std::array{}; + auto curveNameLen = 0ul; + if (1 != EVP_PKEY_get_utf8_string_param( + pKey, OSSL_PKEY_PARAM_GROUP_NAME, curveNameBuf.begin(), sizeof(curveNameBuf), &curveNameLen)) { + JWK_WRITE_ERROR_OSSL("Get group name from EC PKey"); + return false; + } + auto curveName = std::string_view(curveNameBuf.cbegin(), curveNameLen); + if (curveName != std::string_view("prime256v1")) { + JWK_WRITE_ERROR("Unsupported EC curve").detail("CurveName", curveName); + return false; + } + writer.Key("crv"); + writer.String("P-256"); +#define JWK_WRITE_BN_EC_PARAM(x, param) \ + do { \ + auto x = AutoCPointer(nullptr, &::BN_clear_free); \ + auto rawX = std::add_pointer_t(); \ + if (1 != ::EVP_PKEY_get_bn_param(pKey, param, &rawX)) { \ + JWK_WRITE_ERROR_OSSL("EVP_PKEY_get_bn_param(" #param ")"); \ + return false; \ + } \ + x.reset(rawX); \ + auto b64##x = bigNumToBase64Url(arena, x); \ + writer.Key(#x); \ + writer.String(reinterpret_cast(b64##x.begin()), b64##x.size()); \ + } while (0) + // Get and write affine coordinates, X and Y + JWK_WRITE_BN_EC_PARAM(x, OSSL_PKEY_PARAM_EC_PUB_X); + JWK_WRITE_BN_EC_PARAM(y, OSSL_PKEY_PARAM_EC_PUB_Y); + if (!isPublic) { + JWK_WRITE_BN_EC_PARAM(d, OSSL_PKEY_PARAM_PRIV_KEY); + } +#undef JWK_WRITE_BN_EC_PARAM +#else // USE_V3_API + auto ecKey = ::EVP_PKEY_get0_EC_KEY(pKey); // get0 == no refcount, no need to free + if (!ecKey) { + JWK_WRITE_ERROR_OSSL("Could not extract EC_KEY from EVP_PKEY"); + return false; + } + auto group = ::EC_KEY_get0_group(ecKey); + if (!group) { + JWK_WRITE_ERROR("Could not get EC_GROUP from EVP_PKEY"); + return false; + } + auto curveName = ::EC_GROUP_get_curve_name(group); + if (curveName == NID_undef) { + JWK_WRITE_ERROR("Could not match EC_GROUP to known curve"); + return false; + } + if (curveName != NID_X9_62_prime256v1) { + JWK_WRITE_ERROR("Unsupported curve, expected P-256 (prime256v1)").detail("curveName", ::OBJ_nid2sn(curveName)); + return false; + } + writer.Key("crv"); + writer.String("P-256"); + auto point = ::EC_KEY_get0_public_key(ecKey); + if (!point) { + JWK_WRITE_ERROR_OSSL("EC_KEY_get0_public_key() returned null"); + return false; + } + auto x = AutoCPointer(::BN_new(), &::BN_free); + if (!x) { + JWK_WRITE_ERROR_OSSL("x = BN_new()"); + return false; + } + auto y = AutoCPointer(::BN_new(), &::BN_free); + if (!y) { + JWK_WRITE_ERROR_OSSL("y = BN_new()"); + return false; + } + if (1 != +#ifdef OPENSSL_IS_BORINGSSL + ::EC_POINT_get_affine_coordinates_GFp(group, point, x, y, nullptr) +#else + ::EC_POINT_get_affine_coordinates(group, point, x, y, nullptr) +#endif + ) { + JWK_WRITE_ERROR_OSSL("EC_POINT_get_affine_coordinates()"); + return false; + } + auto b64X = bigNumToBase64Url(arena, x); + auto b64Y = bigNumToBase64Url(arena, y); + writer.Key("x"); + writer.String(reinterpret_cast(b64X.begin()), b64X.size()); + writer.Key("y"); + writer.String(reinterpret_cast(b64Y.begin()), b64Y.size()); + if (!isPublic) { + auto d = ::EC_KEY_get0_private_key(ecKey); + if (!d) { + JWK_WRITE_ERROR("EC_KEY_get0_private_key()"); + return false; + } + auto b64D = bigNumToBase64Url(arena, d); + writer.Key("d"); + writer.String(reinterpret_cast(b64D.begin()), b64D.size()); + } +#endif // USE_V3_API + writer.EndObject(); + return true; +} + +bool encodeRsaKey(rapidjson::Writer& writer, + StringRef keyName, + EVP_PKEY* pKey, + const bool isPublic) { + auto arena = Arena(); + writer.StartObject(); + writer.Key("kty"); + writer.String("RSA"); + writer.Key("alg"); + writer.String("RS256"); + writer.Key("kid"); + writer.String(reinterpret_cast(keyName.begin()), keyName.size()); +#if USE_V3_API +#define JWK_WRITE_BN_RSA_PARAM_V3(x, param) \ + do { \ + auto x = AutoCPointer(nullptr, &::BN_clear_free); \ + auto rawX = std::add_pointer_t(); \ + if (1 != ::EVP_PKEY_get_bn_param(pKey, param, &rawX)) { \ + JWK_WRITE_ERROR_OSSL("EVP_PKEY_get_bn_param(" #x ")"); \ + return false; \ + } \ + x.reset(rawX); \ + auto b64##x = bigNumToBase64Url(arena, x); \ + writer.Key(#x); \ + writer.String(reinterpret_cast(b64##x.begin()), b64##x.size()); \ + } while (0) + JWK_WRITE_BN_RSA_PARAM_V3(n, OSSL_PKEY_PARAM_RSA_N); + JWK_WRITE_BN_RSA_PARAM_V3(e, OSSL_PKEY_PARAM_RSA_E); + if (!isPublic) { + JWK_WRITE_BN_RSA_PARAM_V3(d, OSSL_PKEY_PARAM_RSA_D); + JWK_WRITE_BN_RSA_PARAM_V3(p, OSSL_PKEY_PARAM_RSA_FACTOR1); + JWK_WRITE_BN_RSA_PARAM_V3(q, OSSL_PKEY_PARAM_RSA_FACTOR2); + JWK_WRITE_BN_RSA_PARAM_V3(dp, OSSL_PKEY_PARAM_RSA_EXPONENT1); + JWK_WRITE_BN_RSA_PARAM_V3(dq, OSSL_PKEY_PARAM_RSA_EXPONENT2); + JWK_WRITE_BN_RSA_PARAM_V3(qi, OSSL_PKEY_PARAM_RSA_COEFFICIENT1); + } +#undef JWK_WRITE_BN_RSA_PARAM_V3 +#else // USE_V3_API +#define JWK_WRITE_BN_RSA_PARAM_V1(x) \ + do { \ + if (!x) { \ + JWK_WRITE_ERROR_OSSL("RSA_get0_* returned null " #x); \ + return false; \ + } \ + auto b64##x = bigNumToBase64Url(arena, x); \ + writer.Key(#x); \ + writer.String(reinterpret_cast(b64##x.begin()), b64##x.size()); \ + } while (0) + auto rsaKey = ::EVP_PKEY_get0_RSA(pKey); // get0 == no refcount, no need to free + if (!rsaKey) { + JWK_WRITE_ERROR_OSSL("Could not extract RSA key from EVP_PKEY"); + return false; + } + auto n = std::add_pointer_t(); + auto e = std::add_pointer_t(); + auto d = std::add_pointer_t(); + auto p = std::add_pointer_t(); + auto q = std::add_pointer_t(); + auto dp = std::add_pointer_t(); + auto dq = std::add_pointer_t(); + auto qi = std::add_pointer_t(); + ::RSA_get0_key(rsaKey, &n, &e, &d); + JWK_WRITE_BN_RSA_PARAM_V1(n); + JWK_WRITE_BN_RSA_PARAM_V1(e); + if (!isPublic) { + ::RSA_get0_factors(rsaKey, &p, &q); + ::RSA_get0_crt_params(rsaKey, &dp, &dq, &qi); + JWK_WRITE_BN_RSA_PARAM_V1(d); + JWK_WRITE_BN_RSA_PARAM_V1(p); + JWK_WRITE_BN_RSA_PARAM_V1(q); + JWK_WRITE_BN_RSA_PARAM_V1(dp); + JWK_WRITE_BN_RSA_PARAM_V1(dq); + JWK_WRITE_BN_RSA_PARAM_V1(qi); + } +#undef JWK_WRITE_BN_RSA_PARAM_V1 +#endif // USE_V3_API + writer.EndObject(); + return true; +} + +// Add exactly one object to context of writer. Object shall contain JWK-encoded public or private key +bool encodeKey(rapidjson::Writer& writer, StringRef keyName, const PublicOrPrivateKey& key) { + auto const isPublic = key.isPublic(); + auto pKey = std::add_pointer_t(); + auto alg = PKeyAlgorithm{}; + if (isPublic) { + auto const& keyObj = key.getPublic(); + pKey = keyObj.nativeHandle(); + alg = keyObj.algorithm(); + } else { + auto const& keyObj = key.getPrivate(); + pKey = key.getPrivate().nativeHandle(); + alg = keyObj.algorithm(); + } + if (!pKey) { + JWK_WRITE_ERROR("PKey object to encode is null"); + return false; + } + if (alg == PKeyAlgorithm::EC) { + return encodeEcKey(writer, keyName, pKey, isPublic); + } else if (alg == PKeyAlgorithm::RSA) { + return encodeRsaKey(writer, keyName, pKey, isPublic); + } else { + JWK_WRITE_ERROR("Attempted to encode PKey with unsupported algorithm"); + return false; + } + return true; +} + +void testPublicKey(PrivateKey (*factory)()) { + // stringify-deserialize public key. + // sign some data using private key to see whether deserialized public key can verify it. + auto& rng = *deterministicRandom(); + auto pubKeyName = Standalone("somePublicKey"_sr); + auto privKey = factory(); + auto pubKey = privKey.toPublic(); + auto jwks = JsonWebKeySet{}; + jwks.keys.emplace(pubKeyName, pubKey); + auto arena = Arena(); + auto jwksStr = jwks.toStringRef(arena).get(); + fmt::print("Test JWKS: {}\n", jwksStr.toString()); + auto jwksClone = JsonWebKeySet::parse(jwksStr, {}); + ASSERT(jwksClone.present()); + auto pubKeyClone = jwksClone.get().keys[pubKeyName].getPublic(); + auto randByteStr = [&rng, &arena](int len) { + auto buf = new (arena) uint8_t[len]; + for (auto i = 0; i < len; i++) + buf[i] = rng.randomUInt32() % 255u; + return StringRef(buf, len); + }; + auto randData = randByteStr(rng.randomUInt32() % 128 + 16); + auto signature = privKey.sign(arena, randData, *::EVP_sha256()); + ASSERT(pubKeyClone.verify(randData, signature, *::EVP_sha256())); + const_cast(*randData.begin())++; + ASSERT(!pubKeyClone.verify(randData, signature, *::EVP_sha256())); + fmt::print("TESTED OK FOR OPENSSL V{} API\n", (OPENSSL_VERSION_NUMBER >> 28)); +} + +void testPrivateKey(PrivateKey (*factory)()) { + // stringify-deserialize private key. + // sign some data using deserialized private key to see whether public key can verify it. + auto& rng = *deterministicRandom(); + auto privKeyName = Standalone("somePrivateKey"_sr); + auto privKey = factory(); + auto pubKey = privKey.toPublic(); + auto jwks = JsonWebKeySet{}; + jwks.keys.emplace(privKeyName, privKey); + auto arena = Arena(); + auto jwksStr = jwks.toStringRef(arena).get(); + fmt::print("Test JWKS: {}\n", jwksStr.toString()); + auto jwksClone = JsonWebKeySet::parse(jwksStr, {}); + ASSERT(jwksClone.present()); + auto privKeyClone = jwksClone.get().keys[privKeyName].getPrivate(); + auto randByteStr = [&rng, &arena](int len) { + auto buf = new (arena) uint8_t[len]; + for (auto i = 0; i < len; i++) + buf[i] = rng.randomUInt32() % 255u; + return StringRef(buf, len); + }; + auto randData = randByteStr(rng.randomUInt32() % 128 + 16); + auto signature = privKeyClone.sign(arena, randData, *::EVP_sha256()); + ASSERT(pubKey.verify(randData, signature, *::EVP_sha256())); + const_cast(*randData.begin())++; + ASSERT(!pubKey.verify(randData, signature, *::EVP_sha256())); + fmt::print("TESTED OK FOR OPENSSL V{} API\n", (OPENSSL_VERSION_NUMBER >> 28)); +} + +} // anonymous namespace + +Optional JsonWebKeySet::parse(StringRef jwksString, VectorRef allowedUses) { + auto d = rapidjson::Document(); + d.Parse(reinterpret_cast(jwksString.begin()), jwksString.size()); + if (d.HasParseError()) { + JWKS_PARSE_ERROR("ParseError") + .detail("Message", GetParseError_En(d.GetParseError())) + .detail("Offset", d.GetErrorOffset()); + return {}; + } + auto keysItr = d.FindMember("keys"); + if (!d.IsObject() || keysItr == d.MemberEnd() || !keysItr->value.IsArray()) { + JWKS_PARSE_ERROR("JWKS must be an object and have 'keys' array member"); + return {}; + } + auto const& keys = keysItr->value; + auto ret = JsonWebKeySet{}; + for (auto keyIndex = 0; keyIndex < keys.Size(); keyIndex++) { + if (!keys[keyIndex].IsObject()) { + JWKS_PARSE_ERROR("element of 'keys' array must be an object"); + return {}; + } + auto const& key = keys[keyIndex]; + DECLARE_JWK_REQUIRED_STRING_MEMBER(key, kty); + DECLARE_JWK_REQUIRED_STRING_MEMBER(key, kid); + DECLARE_JWK_OPTIONAL_STRING_MEMBER(key, use); + if (use.present() && !allowedUses.empty()) { + auto allowed = false; + for (auto allowedUse : allowedUses) { + if (allowedUse == use.get()) { + allowed = true; + break; + } + } + if (!allowed) { + JWK_PARSE_ERROR("Illegal optional 'use' member found").detail("Use", use.get().toString()); + return {}; + } + } + auto parsedKey = parseKey(key, kty, keyIndex); + if (!parsedKey.present()) + return {}; + auto [iter, inserted] = ret.keys.insert({ Standalone(kid), parsedKey.get() }); + if (!inserted) { + JWK_PARSE_ERROR("Duplicate key name").detail("KeyName", kid.toString()); + return {}; + } + } + return ret; +} + +Optional JsonWebKeySet::toStringRef(Arena& arena) { + using Buffer = rapidjson::StringBuffer; + using Writer = rapidjson::Writer; + auto buffer = Buffer(); + auto writer = Writer(buffer); + writer.StartObject(); + writer.Key("keys"); + writer.StartArray(); + for (const auto& [keyName, key] : keys) { + if (!encodeKey(writer, keyName, key)) { + return {}; + } + } + writer.EndArray(); + writer.EndObject(); + auto buf = new (arena) uint8_t[buffer.GetSize()]; + ::memcpy(buf, buffer.GetString(), buffer.GetSize()); + return StringRef(buf, buffer.GetSize()); +} + +void forceLinkJsonWebKeySetTests() {} + +TEST_CASE("/fdbrpc/JsonWebKeySet/EC/PublicKey") { + testPublicKey(&mkcert::makeEcP256); + return Void(); +} + +TEST_CASE("/fdbrpc/JsonWebKeySet/EC/PrivateKey") { + testPrivateKey(&mkcert::makeEcP256); + return Void(); +} + +TEST_CASE("/fdbrpc/JsonWebKeySet/RSA/PublicKey") { + testPublicKey(&mkcert::makeRsa4096Bit); + return Void(); +} + +TEST_CASE("/fdbrpc/JsonWebKeySet/RSA/PrivateKey") { + testPrivateKey(&mkcert::makeRsa4096Bit); + return Void(); +} + +TEST_CASE("/fdbrpc/JsonWebKeySet/Empty") { + auto keyset = JsonWebKeySet::parse("{\"keys\":[]}"_sr, {}); + ASSERT(keyset.present()); + ASSERT(keyset.get().keys.empty()); + return Void(); +} diff --git a/src/fdbrpc/LinkTest.cpp b/src/fdbrpc/LinkTest.cpp new file mode 100644 index 0000000..73dcd81 --- /dev/null +++ b/src/fdbrpc/LinkTest.cpp @@ -0,0 +1,8 @@ +// When creating a static or shared library, undefined symbols will be ignored. +// Since we want to ensure no symbols from other modules are used, each module +// will create an executable so the linker will throw errors if it can't find +// the declaration of a symbol. This class defines a dummy main function so the +// executable can be built. +int main() { + return 0; +} diff --git a/src/fdbrpc/LoadBalance.actor.cpp b/src/fdbrpc/LoadBalance.actor.cpp index b668deb..6a48823 100644 --- a/src/fdbrpc/LoadBalance.actor.cpp +++ b/src/fdbrpc/LoadBalance.actor.cpp @@ -22,9 +22,6 @@ #include "flow/flow.h" #include "flow/actorcompiler.h" // This must be the last #include. -FDB_DEFINE_BOOLEAN_PARAM(AtMostOnce); -FDB_DEFINE_BOOLEAN_PARAM(TriedAllOptions); - // Throwing all_alternatives_failed will cause the client to issue a GetKeyLocationRequest to the proxy, so this actor // attempts to limit the number of these errors thrown by a single client to prevent it from saturating the proxies with // these requests diff --git a/src/fdbrpc/LoadBalance.actor.g.cpp b/src/fdbrpc/LoadBalance.actor.g.cpp index 3645bbe..647cad4 100644 --- a/src/fdbrpc/LoadBalance.actor.g.cpp +++ b/src/fdbrpc/LoadBalance.actor.g.cpp @@ -24,27 +24,24 @@ #include "flow/flow.h" #include "flow/actorcompiler.h" // This must be the last #include. -FDB_DEFINE_BOOLEAN_PARAM(AtMostOnce); -FDB_DEFINE_BOOLEAN_PARAM(TriedAllOptions); - // Throwing all_alternatives_failed will cause the client to issue a GetKeyLocationRequest to the proxy, so this actor // attempts to limit the number of these errors thrown by a single client to prevent it from saturating the proxies with // these requests - #line 33 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 30 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" namespace { // This generated class is to be used only via allAlternativesFailedDelay() - #line 31 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" template - #line 31 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" class AllAlternativesFailedDelayActorState { - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" public: - #line 31 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" AllAlternativesFailedDelayActorState(Future const& okFuture) - #line 31 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" - #line 31 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" : okFuture(okFuture) - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" { fdb_probe_actor_create("allAlternativesFailedDelay", reinterpret_cast(this)); @@ -57,52 +54,52 @@ class AllAlternativesFailedDelayActorState { int a_body1(int loopDepth=0) { try { - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 29 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" if (now() - g_network->networkInfo.newestAlternativesFailure > FLOW_KNOBS->ALTERNATIVES_FAILURE_RESET_TIME) - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" { - #line 33 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 30 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" g_network->networkInfo.oldestAlternativesFailure = now(); - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" } - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 33 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" double delay = FLOW_KNOBS->ALTERNATIVES_FAILURE_MIN_DELAY; - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" if (now() - g_network->networkInfo.lastAlternativesFailureSkipDelay > FLOW_KNOBS->ALTERNATIVES_FAILURE_SKIP_DELAY) - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" { - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" g_network->networkInfo.lastAlternativesFailureSkipDelay = now(); - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" } else { - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" double elapsed = now() - g_network->networkInfo.oldestAlternativesFailure; - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" delay = std::max(delay, std::min(elapsed * FLOW_KNOBS->ALTERNATIVES_FAILURE_DELAY_RATIO, FLOW_KNOBS->ALTERNATIVES_FAILURE_MAX_DELAY)); - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" delay = std::max(delay, std::min(elapsed * FLOW_KNOBS->ALTERNATIVES_FAILURE_SLOW_DELAY_RATIO, FLOW_KNOBS->ALTERNATIVES_FAILURE_SLOW_MAX_DELAY)); - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" } - #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" g_network->networkInfo.newestAlternativesFailure = now(); - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" StrictFuture __when_expr_0 = okFuture; - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" StrictFuture __when_expr_1 = ::delayJittered(delay); - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -123,9 +120,9 @@ class AllAlternativesFailedDelayActorState { } int a_body1cont1(int loopDepth) { - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AllAlternativesFailedDelayActorState(); static_cast(this)->destroy(); return 0; } - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AllAlternativesFailedDelayActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -147,17 +144,17 @@ class AllAlternativesFailedDelayActorState { } int a_body1when2(Void const& _,int loopDepth) { - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" return a_body1Catch1(all_alternatives_failed(), loopDepth); - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" return loopDepth; } int a_body1when2(Void && _,int loopDepth) { - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" return a_body1Catch1(all_alternatives_failed(), loopDepth); - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" return loopDepth; } @@ -258,14 +255,14 @@ class AllAlternativesFailedDelayActorState { fdb_probe_actor_exit("allAlternativesFailedDelay", reinterpret_cast(this), 1); } - #line 31 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" Future okFuture; - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" }; // This generated class is to be used only via allAlternativesFailedDelay() - #line 31 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" class AllAlternativesFailedDelayActor final : public Actor, public ActorCallback< AllAlternativesFailedDelayActor, 0, Void >, public ActorCallback< AllAlternativesFailedDelayActor, 1, Void >, public FastAllocated, public AllAlternativesFailedDelayActorState { - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -275,9 +272,9 @@ class AllAlternativesFailedDelayActor final : public Actor, public ActorCa #pragma clang diagnostic pop friend struct ActorCallback< AllAlternativesFailedDelayActor, 0, Void >; friend struct ActorCallback< AllAlternativesFailedDelayActor, 1, Void >; - #line 31 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" AllAlternativesFailedDelayActor(Future const& okFuture) - #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" : Actor(), AllAlternativesFailedDelayActorState(okFuture) { @@ -301,11 +298,11 @@ friend struct ActorCallback< AllAlternativesFailedDelayActor, 1, Void >; } }; } - #line 31 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" [[nodiscard]] Future allAlternativesFailedDelay( Future const& okFuture ) { - #line 31 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" + #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" return Future(new AllAlternativesFailedDelayActor(okFuture)); - #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.cpp" } -#line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" +#line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.cpp" diff --git a/src/fdbrpc/Locality.cpp b/src/fdbrpc/Locality.cpp index bd4c3a9..c59cf9a 100644 --- a/src/fdbrpc/Locality.cpp +++ b/src/fdbrpc/Locality.cpp @@ -21,13 +21,13 @@ #include "fdbrpc/Locality.h" const UID LocalityData::UNSET_ID = UID(0x0ccb4e0feddb5583, 0x010f6b77d9d10ece); -const StringRef LocalityData::keyProcessId = LiteralStringRef("processid"); -const StringRef LocalityData::keyZoneId = LiteralStringRef("zoneid"); -const StringRef LocalityData::keyDcId = LiteralStringRef("dcid"); -const StringRef LocalityData::keyMachineId = LiteralStringRef("machineid"); -const StringRef LocalityData::keyDataHallId = LiteralStringRef("data_hall"); -const StringRef LocalityData::ExcludeLocalityKeyMachineIdPrefix = LiteralStringRef("locality_machineid:"); -const StringRef LocalityData::ExcludeLocalityPrefix = LiteralStringRef("locality_"); +const StringRef LocalityData::keyProcessId = "processid"_sr; +const StringRef LocalityData::keyZoneId = "zoneid"_sr; +const StringRef LocalityData::keyDcId = "dcid"_sr; +const StringRef LocalityData::keyMachineId = "machineid"_sr; +const StringRef LocalityData::keyDataHallId = "data_hall"_sr; +const StringRef LocalityData::ExcludeLocalityKeyMachineIdPrefix = "locality_machineid:"_sr; +const StringRef LocalityData::ExcludeLocalityPrefix = "locality_"_sr; ProcessClass::Fitness ProcessClass::machineClassFitness(ClusterRole role) const { switch (role) { @@ -240,6 +240,24 @@ ProcessClass::Fitness ProcessClass::machineClassFitness(ClusterRole role) const default: return ProcessClass::WorstFit; } + case ProcessClass::ConsistencyScan: + switch (_class) { + case ProcessClass::ConsistencyScanClass: + return ProcessClass::BestFit; + case ProcessClass::StatelessClass: + return ProcessClass::GoodFit; + case ProcessClass::UnsetClass: + return ProcessClass::UnsetFit; + case ProcessClass::MasterClass: + return ProcessClass::OkayFit; + case ProcessClass::CoordinatorClass: + case ProcessClass::TesterClass: + case ProcessClass::StorageCacheClass: + case ProcessClass::BlobWorkerClass: + return ProcessClass::NeverAssign; + default: + return ProcessClass::WorstFit; + } case ProcessClass::BlobManager: switch (_class) { case ProcessClass::BlobManagerClass: @@ -265,6 +283,17 @@ ProcessClass::Fitness ProcessClass::machineClassFitness(ClusterRole role) const default: return ProcessClass::NeverAssign; } + case ProcessClass::BlobMigrator: + switch (_class) { + case ProcessClass::StatelessClass: + return ProcessClass::GoodFit; + case ProcessClass::MasterClass: + return ProcessClass::OkayFit; + case ProcessClass::BlobWorkerClass: + return ProcessClass::OkayFit; + default: + return ProcessClass::NeverAssign; + } case ProcessClass::StorageCache: switch (_class) { case ProcessClass::StorageCacheClass: diff --git a/src/fdbrpc/Net2FileSystem.cpp b/src/fdbrpc/Net2FileSystem.cpp index b6460b1..211c056 100644 --- a/src/fdbrpc/Net2FileSystem.cpp +++ b/src/fdbrpc/Net2FileSystem.cpp @@ -22,15 +22,21 @@ // Define boost::asio::io_service #include +#ifndef BOOST_SYSTEM_NO_LIB #define BOOST_SYSTEM_NO_LIB +#endif +#ifndef BOOST_DATE_TIME_NO_LIB #define BOOST_DATE_TIME_NO_LIB +#endif +#ifndef BOOST_REGEX_NO_LIB #define BOOST_REGEX_NO_LIB +#endif #include #define FILESYSTEM_IMPL 1 #include "fdbrpc/AsyncFileCached.actor.h" -#include "fdbrpc/AsyncFileChaos.actor.h" +#include "fdbrpc/AsyncFileChaos.h" #include "fdbrpc/AsyncFileEIO.actor.h" #include "fdbrpc/AsyncFileEncrypted.h" #include "fdbrpc/AsyncFileWinASIO.actor.h" @@ -79,14 +85,12 @@ Future> Net2FileSystem::open(const std::string& file f = map(f, [=](Reference r) { return Reference(new AsyncFileWriteChecker(r)); }); if (FLOW_KNOBS->ENABLE_CHAOS_FEATURES) f = map(f, [=](Reference r) { return Reference(new AsyncFileChaos(r)); }); -#if ENCRYPTION_ENABLED if (flags & IAsyncFile::OPEN_ENCRYPTED) f = map(f, [flags](Reference r) { auto mode = flags & IAsyncFile::OPEN_READWRITE ? AsyncFileEncrypted::Mode::APPEND_ONLY : AsyncFileEncrypted::Mode::READ_ONLY; return Reference(new AsyncFileEncrypted(r, mode)); }); -#endif // ENCRYPTION_ENABLED return f; } diff --git a/src/fdbrpc/ReplicationUtils.cpp b/src/fdbrpc/ReplicationUtils.cpp index cd84eea..bd55708 100644 --- a/src/fdbrpc/ReplicationUtils.cpp +++ b/src/fdbrpc/ReplicationUtils.cpp @@ -493,10 +493,10 @@ Reference createTestLocalityMap(std::vector& indexes, serverValue = dcLoop + szLoop * 10 + rackLoop * 100 + slotLoop * 1000; slotText = format(".%d", slotLoop); LocalityData data; - data.set(LiteralStringRef("dc"), StringRef(dcText)); - data.set(LiteralStringRef("sz"), StringRef(dcText + szText)); - data.set(LiteralStringRef("rack"), StringRef(dcText + szText + rackText)); - data.set(LiteralStringRef("zoneid"), StringRef(dcText + szText + rackText + slotText)); + data.set("dc"_sr, StringRef(dcText)); + data.set("sz"_sr, StringRef(dcText + szText)); + data.set("rack"_sr, StringRef(dcText + szText + rackText)); + data.set("zoneid"_sr, StringRef(dcText + szText + rackText + slotText)); for (int independentLoop = 0; independentLoop < independentItems; independentLoop++) { independentName = format("indiv%02d", independentLoop + 1); for (int totalLoop = 0; totalLoop < independentTotal; totalLoop++) { @@ -520,10 +520,10 @@ Reference createTestLocalityMap(std::vector& indexes, serverValue = (dcLoop + 2) + szLoop * 10 + rackLoop * 100 + slotLoop * 1000; slotText = format(".%d", slotLoop); LocalityData data; - data.set(LiteralStringRef("dc"), StringRef(dcText)); - data.set(LiteralStringRef("az"), StringRef(dcText + szText)); - data.set(LiteralStringRef("rack"), StringRef(dcText + szText + rackText)); - data.set(LiteralStringRef("zoneid"), StringRef(dcText + szText + rackText + slotText)); + data.set("dc"_sr, StringRef(dcText)); + data.set("az"_sr, StringRef(dcText + szText)); + data.set("rack"_sr, StringRef(dcText + szText + rackText)); + data.set("zoneid"_sr, StringRef(dcText + szText + rackText + slotText)); for (int independentLoop = 0; independentLoop < independentItems; independentLoop++) { independentName = format("indiv%02d", independentLoop); for (int totalLoop = 0; totalLoop < independentTotal; totalLoop++) { diff --git a/src/fdbrpc/SimExternalConnection.actor.cpp b/src/fdbrpc/SimExternalConnection.actor.cpp index c80285a..9efd569 100644 --- a/src/fdbrpc/SimExternalConnection.actor.cpp +++ b/src/fdbrpc/SimExternalConnection.actor.cpp @@ -18,19 +18,25 @@ * limitations under the License. */ +#ifndef BOOST_SYSTEM_NO_LIB #define BOOST_SYSTEM_NO_LIB +#endif +#ifndef BOOST_DATE_TIME_NO_LIB #define BOOST_DATE_TIME_NO_LIB +#endif +#ifndef BOOST_REGEX_NO_LIB #define BOOST_REGEX_NO_LIB +#endif #include #include #include -#include "fdbclient/FDBTypes.h" #include "fdbrpc/SimExternalConnection.h" #include "flow/Net2Packet.h" #include "flow/Platform.h" #include "flow/SendBufferIterator.h" #include "flow/UnitTest.h" +#include "flow/IConnection.h" #include "flow/actorcompiler.h" // This must be the last #include. using namespace boost::asio; @@ -126,6 +132,10 @@ NetworkAddress SimExternalConnection::getPeerAddress() const { } } +bool SimExternalConnection::hasTrustedPeer() const { + return true; +} + UID SimExternalConnection::getDebugID() const { return dbgid; } @@ -141,10 +151,12 @@ std::vector SimExternalConnection::resolveTCPEndpointBlocking(co while (iter != end) { auto endpoint = iter->endpoint(); auto addr = endpoint.address(); + // register the endpoint as public so that if it does happen to be an fdb process, we can connect to it + // successfully if (addr.is_v6()) { - addrs.emplace_back(IPAddress(addr.to_v6().to_bytes()), endpoint.port()); + addrs.emplace_back(IPAddress(addr.to_v6().to_bytes()), endpoint.port(), true, false); } else { - addrs.emplace_back(addr.to_v4().to_ulong(), endpoint.port()); + addrs.emplace_back(addr.to_v4().to_ulong(), endpoint.port(), true, false); } ++iter; } @@ -214,7 +226,8 @@ TEST_CASE("fdbrpc/SimExternalClient") { // Wait until server is ready threadSleep(0.01); } - state Key data = deterministicRandom()->randomAlphaNumeric(deterministicRandom()->randomInt(0, maxDataLength + 1)); + state Standalone data( + deterministicRandom()->randomAlphaNumeric(deterministicRandom()->randomInt(0, maxDataLength + 1))); PacketWriter packetWriter(packetQueue.getWriteBuffer(data.size()), nullptr, Unversioned()); packetWriter.serializeBytes(data); wait(externalConn->onWritable()); diff --git a/src/fdbrpc/SimExternalConnection.actor.g.cpp b/src/fdbrpc/SimExternalConnection.actor.g.cpp index 33560b2..6c05db3 100644 --- a/src/fdbrpc/SimExternalConnection.actor.g.cpp +++ b/src/fdbrpc/SimExternalConnection.actor.g.cpp @@ -20,19 +20,25 @@ * limitations under the License. */ +#ifndef BOOST_SYSTEM_NO_LIB #define BOOST_SYSTEM_NO_LIB +#endif +#ifndef BOOST_DATE_TIME_NO_LIB #define BOOST_DATE_TIME_NO_LIB +#endif +#ifndef BOOST_REGEX_NO_LIB #define BOOST_REGEX_NO_LIB +#endif #include #include #include -#include "fdbclient/FDBTypes.h" #include "fdbrpc/SimExternalConnection.h" #include "flow/Net2Packet.h" #include "flow/Platform.h" #include "flow/SendBufferIterator.h" #include "flow/UnitTest.h" +#include "flow/IConnection.h" #include "flow/actorcompiler.h" // This must be the last #include. using namespace boost::asio; @@ -41,20 +47,20 @@ static io_service ios; class SimExternalConnectionImpl { public: - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" // This generated class is to be used only via onReadable() - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" template - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" class OnReadableActorState { - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" public: - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" OnReadableActorState(SimExternalConnection* const& self) - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" : self(self) - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" { fdb_probe_actor_create("onReadable", reinterpret_cast(this)); @@ -67,16 +73,16 @@ class OnReadableActorState { int a_body1(int loopDepth=0) { try { - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" StrictFuture __when_expr_0 = delayJittered(0.1); - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -97,20 +103,20 @@ class OnReadableActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (self->readBuffer.empty()) - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" { - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" StrictFuture __when_expr_1 = self->onReadableTrigger.onTrigger(); - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" loopDepth = 0; } else @@ -122,20 +128,20 @@ class OnReadableActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (self->readBuffer.empty()) - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" { - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" StrictFuture __when_expr_1 = self->onReadableTrigger.onTrigger(); - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" loopDepth = 0; } else @@ -210,9 +216,9 @@ class OnReadableActorState { } int a_body1cont2(int loopDepth) { - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OnReadableActorState(); static_cast(this)->destroy(); return 0; } - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~OnReadableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -295,14 +301,14 @@ class OnReadableActorState { fdb_probe_actor_exit("onReadable", reinterpret_cast(this), 1); } - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" SimExternalConnection* self; - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" }; // This generated class is to be used only via onReadable() - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" class OnReadableActor final : public Actor, public ActorCallback< OnReadableActor, 0, Void >, public ActorCallback< OnReadableActor, 1, Void >, public FastAllocated, public OnReadableActorState { - #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -312,9 +318,9 @@ class OnReadableActor final : public Actor, public ActorCallback< OnReadab #pragma clang diagnostic pop friend struct ActorCallback< OnReadableActor, 0, Void >; friend struct ActorCallback< OnReadableActor, 1, Void >; - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" OnReadableActor(SimExternalConnection* const& self) - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" : Actor(), OnReadableActorState(self) { @@ -338,29 +344,29 @@ friend struct ActorCallback< OnReadableActor, 1, Void >; } }; - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" [[nodiscard]] static Future onReadable( SimExternalConnection* const& self ) { - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" return Future(new OnReadableActor(self)); - #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" } -#line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" +#line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" // This generated class is to be used only via connect() - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" template - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" class ConnectActorState { - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" public: - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ConnectActorState(NetworkAddress const& toAddr) - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" : toAddr(toAddr) - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" { fdb_probe_actor_create("connect", reinterpret_cast(this)); @@ -373,16 +379,16 @@ class ConnectActorState { int a_body1(int loopDepth=0) { try { - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" StrictFuture __when_expr_0 = delayJittered(0.1); - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -403,37 +409,37 @@ class ConnectActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ip::tcp::socket socket(ios); - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" auto ip = toAddr.ip; - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ip::address address; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (ip.isV6()) - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" { - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" address = boost::asio::ip::address_v6(ip.toV6()); - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" } else { - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" address = boost::asio::ip::address_v4(ip.toV4()); - #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" } - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" boost::system::error_code err; - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" socket.connect(ip::tcp::endpoint(address, toAddr.port), err); - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (err) - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" { - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Reference()); this->~ConnectActorState(); static_cast(this)->destroy(); return 0; } - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(Reference()); this->~ConnectActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -441,9 +447,9 @@ class ConnectActorState { } else { - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Reference(new SimExternalConnection(std::move(socket)))); this->~ConnectActorState(); static_cast(this)->destroy(); return 0; } - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(Reference(new SimExternalConnection(std::move(socket)))); this->~ConnectActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -454,37 +460,37 @@ class ConnectActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ip::tcp::socket socket(ios); - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" auto ip = toAddr.ip; - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ip::address address; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (ip.isV6()) - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" { - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" address = boost::asio::ip::address_v6(ip.toV6()); - #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" } else { - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" address = boost::asio::ip::address_v4(ip.toV4()); - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" } - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" boost::system::error_code err; - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" socket.connect(ip::tcp::endpoint(address, toAddr.port), err); - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (err) - #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" { - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Reference()); this->~ConnectActorState(); static_cast(this)->destroy(); return 0; } - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(Reference()); this->~ConnectActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -492,9 +498,9 @@ class ConnectActorState { } else { - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Reference(new SimExternalConnection(std::move(socket)))); this->~ConnectActorState(); static_cast(this)->destroy(); return 0; } - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(Reference(new SimExternalConnection(std::move(socket)))); this->~ConnectActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -566,14 +572,14 @@ class ConnectActorState { fdb_probe_actor_exit("connect", reinterpret_cast(this), 0); } - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" NetworkAddress toAddr; - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" }; // This generated class is to be used only via connect() - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" class ConnectActor final : public Actor>, public ActorCallback< ConnectActor, 0, Void >, public FastAllocated, public ConnectActorState { - #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -582,9 +588,9 @@ class ConnectActor final : public Actor>, public ActorCal void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ConnectActor, 0, Void >; - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ConnectActor(NetworkAddress const& toAddr) - #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" : Actor>(), ConnectActorState(toAddr) { @@ -607,14 +613,14 @@ friend struct ActorCallback< ConnectActor, 0, Void >; } }; - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" [[nodiscard]] static Future> connect( NetworkAddress const& toAddr ) { - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" return Future>(new ConnectActor(toAddr)); - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" } -#line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" +#line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" }; void SimExternalConnection::close() { @@ -676,6 +682,10 @@ NetworkAddress SimExternalConnection::getPeerAddress() const { } } +bool SimExternalConnection::hasTrustedPeer() const { + return true; +} + UID SimExternalConnection::getDebugID() const { return dbgid; } @@ -691,10 +701,12 @@ std::vector SimExternalConnection::resolveTCPEndpointBlocking(co while (iter != end) { auto endpoint = iter->endpoint(); auto addr = endpoint.address(); + // register the endpoint as public so that if it does happen to be an fdb process, we can connect to it + // successfully if (addr.is_v6()) { - addrs.emplace_back(IPAddress(addr.to_v6().to_bytes()), endpoint.port()); + addrs.emplace_back(IPAddress(addr.to_v6().to_bytes()), endpoint.port(), true, false); } else { - addrs.emplace_back(addr.to_v4().to_ulong(), endpoint.port()); + addrs.emplace_back(addr.to_v4().to_ulong(), endpoint.port(), true, false); } ++iter; } @@ -709,25 +721,25 @@ std::vector SimExternalConnection::resolveTCPEndpointBlocking(co } } - #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" namespace { // This generated class is to be used only via resolveTCPEndpointImpl() - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" template - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" class ResolveTCPEndpointImplActorState { - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" public: - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ResolveTCPEndpointImplActorState(std::string const& host,std::string const& service,DNSCache* const& dnsCache) - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" : host(host), - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" service(service), - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" dnsCache(dnsCache) - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" { fdb_probe_actor_create("resolveTCPEndpointImpl", reinterpret_cast(this)); @@ -740,16 +752,16 @@ class ResolveTCPEndpointImplActorState { int a_body1(int loopDepth=0) { try { - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" StrictFuture __when_expr_0 = delayJittered(0.1); - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -770,9 +782,9 @@ class ResolveTCPEndpointImplActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(SimExternalConnection::resolveTCPEndpointBlocking(host, service, dnsCache)); this->~ResolveTCPEndpointImplActorState(); static_cast(this)->destroy(); return 0; } - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(SimExternalConnection::resolveTCPEndpointBlocking(host, service, dnsCache)); this->~ResolveTCPEndpointImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -782,9 +794,9 @@ class ResolveTCPEndpointImplActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(SimExternalConnection::resolveTCPEndpointBlocking(host, service, dnsCache)); this->~ResolveTCPEndpointImplActorState(); static_cast(this)->destroy(); return 0; } - #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(SimExternalConnection::resolveTCPEndpointBlocking(host, service, dnsCache)); this->~ResolveTCPEndpointImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -855,18 +867,18 @@ class ResolveTCPEndpointImplActorState { fdb_probe_actor_exit("resolveTCPEndpointImpl", reinterpret_cast(this), 0); } - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" std::string host; - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" std::string service; - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" DNSCache* dnsCache; - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" }; // This generated class is to be used only via resolveTCPEndpointImpl() - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" class ResolveTCPEndpointImplActor final : public Actor>, public ActorCallback< ResolveTCPEndpointImplActor, 0, Void >, public FastAllocated, public ResolveTCPEndpointImplActorState { - #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -875,9 +887,9 @@ class ResolveTCPEndpointImplActor final : public Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ResolveTCPEndpointImplActor, 0, Void >; - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ResolveTCPEndpointImplActor(std::string const& host,std::string const& service,DNSCache* const& dnsCache) - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" : Actor>(), ResolveTCPEndpointImplActorState(host, service, dnsCache) { @@ -901,14 +913,14 @@ friend struct ActorCallback< ResolveTCPEndpointImplActor, 0, Void >; } }; } - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" [[nodiscard]] static Future> resolveTCPEndpointImpl( std::string const& host, std::string const& service, DNSCache* const& dnsCache ) { - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" return Future>(new ResolveTCPEndpointImplActor(host, service, dnsCache)); - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" } -#line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" +#line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" Future> SimExternalConnection::resolveTCPEndpoint(const std::string& host, const std::string& service, @@ -943,44 +955,44 @@ static void testEchoServer() { } } - #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase202() - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" -template - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" -class FlowTestCase202ActorState { - #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" +// This generated class is to be used only via flowTestCase214() + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" +template + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" +class FlowTestCase214ActorState { + #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" public: - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - FlowTestCase202ActorState(UnitTestParameters const& params) - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + FlowTestCase214ActorState(UnitTestParameters const& params) + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" : params(params), - #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" maxDataLength(10000), - #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" serverThread([] { return testEchoServer(); }), - #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" packetQueue(), - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" externalConn() - #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase202", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase214", reinterpret_cast(this)); } - ~FlowTestCase202ActorState() + ~FlowTestCase214ActorState() { - fdb_probe_actor_destroy("flowTestCase202", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase214", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ; - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -993,30 +1005,30 @@ class FlowTestCase202ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase202ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase214ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - data = deterministicRandom()->randomAlphaNumeric(deterministicRandom()->randomInt(0, maxDataLength + 1)); - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + data = Standalone(deterministicRandom()->randomAlphaNumeric(deterministicRandom()->randomInt(0, maxDataLength + 1))); + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" PacketWriter packetWriter(packetQueue.getWriteBuffer(data.size()), nullptr, Unversioned()); - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" packetWriter.serializeBytes(data); - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" StrictFuture __when_expr_1 = externalConn->onWritable(); - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1030,16 +1042,16 @@ class FlowTestCase202ActorState { } int a_body1loopBody1(int loopDepth) { - #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" StrictFuture> __when_expr_0 = INetworkConnections::net()->connect("localhost", std::to_string(testEchoServerPort)); - #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1059,36 +1071,36 @@ class FlowTestCase202ActorState { } int a_body1loopBody1cont1(Reference const& _externalConn,int loopDepth) { - #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (_externalConn.isValid()) - #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 1076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" { - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" externalConn = std::move(_externalConn); - #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 1080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" threadSleep(0.01); - #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(Reference && _externalConn,int loopDepth) { - #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" if (_externalConn.isValid()) - #line 1082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" { - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" externalConn = std::move(_externalConn); - #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" threadSleep(0.01); - #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -1107,13 +1119,13 @@ class FlowTestCase202ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase202Actor, 0, Reference >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase214Actor, 0, Reference >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase202Actor, 0, Reference >*,Reference const& value) + void a_callback_fire(ActorCallback< FlowTestCase214Actor, 0, Reference >*,Reference const& value) { - fdb_probe_actor_enter("flowTestCase202", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase214", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); @@ -1123,12 +1135,12 @@ class FlowTestCase202ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase202", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase214", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase202Actor, 0, Reference >*,Reference && value) + void a_callback_fire(ActorCallback< FlowTestCase214Actor, 0, Reference >*,Reference && value) { - fdb_probe_actor_enter("flowTestCase202", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase214", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); @@ -1138,12 +1150,12 @@ class FlowTestCase202ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase202", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase214", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase202Actor, 0, Reference >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase214Actor, 0, Reference >*,Error err) { - fdb_probe_actor_enter("flowTestCase202", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase214", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -1153,41 +1165,41 @@ class FlowTestCase202ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase202", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase214", reinterpret_cast(this), 0); } int a_body1cont2(Void const& _,int loopDepth) { - #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" externalConn->write(packetQueue.getUnsent()); - #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" StrictFuture __when_expr_2 = externalConn->onReadable(); - #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + static_cast(this)->actor_wait_state = 3; + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" externalConn->write(packetQueue.getUnsent()); - #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" StrictFuture __when_expr_2 = externalConn->onReadable(); - #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + static_cast(this)->actor_wait_state = 3; + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1206,13 +1218,13 @@ class FlowTestCase202ActorState { } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase202Actor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase214Actor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase202Actor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase214Actor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase202", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase214", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -1222,12 +1234,12 @@ class FlowTestCase202ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase202", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase214", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< FlowTestCase202Actor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase214Actor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase202", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase214", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -1237,12 +1249,12 @@ class FlowTestCase202ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase202", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase214", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< FlowTestCase202Actor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase214Actor, 1, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase202", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase214", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -1252,53 +1264,53 @@ class FlowTestCase202ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase202", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase214", reinterpret_cast(this), 1); } int a_body1cont3(Void const& _,int loopDepth) { - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" std::vector vec(data.size()); - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" externalConn->read(&vec[0], &vec[0] + vec.size()); - #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" externalConn->close(); - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" StringRef echo(&vec[0], vec.size()); - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ASSERT(echo.toString() == data.toString()); - #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" serverThread.join(); - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase202ActorState(); static_cast(this)->destroy(); return 0; } - #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase202ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase214ActorState(); static_cast(this)->destroy(); return 0; } + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase214ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" std::vector vec(data.size()); - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" externalConn->read(&vec[0], &vec[0] + vec.size()); - #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" externalConn->close(); - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" StringRef echo(&vec[0], vec.size()); - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ASSERT(echo.toString() == data.toString()); - #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" serverThread.join(); - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase202ActorState(); static_cast(this)->destroy(); return 0; } - #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase202ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase214ActorState(); static_cast(this)->destroy(); return 0; } + #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase214ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -1317,13 +1329,13 @@ class FlowTestCase202ActorState { } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase202Actor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase214Actor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase202Actor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase214Actor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase202", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase214", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont2when1(value, 0); @@ -1333,12 +1345,12 @@ class FlowTestCase202ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase202", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase214", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< FlowTestCase202Actor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase214Actor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase202", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase214", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont2when1(std::move(value), 0); @@ -1348,12 +1360,12 @@ class FlowTestCase202ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase202", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase214", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< FlowTestCase202Actor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase214Actor, 2, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase202", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase214", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -1363,50 +1375,50 @@ class FlowTestCase202ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase202", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase214", reinterpret_cast(this), 2); } - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" UnitTestParameters params; - #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" const size_t maxDataLength; - #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" std::thread serverThread; - #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" UnsentPacketQueue packetQueue; - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" Reference externalConn; - #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - Key data; - #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + Standalone data; + #line 1393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase202() - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" -class FlowTestCase202Actor final : public Actor, public ActorCallback< FlowTestCase202Actor, 0, Reference >, public ActorCallback< FlowTestCase202Actor, 1, Void >, public ActorCallback< FlowTestCase202Actor, 2, Void >, public FastAllocated, public FlowTestCase202ActorState { - #line 1386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" +// This generated class is to be used only via flowTestCase214() + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" +class FlowTestCase214Actor final : public Actor, public ActorCallback< FlowTestCase214Actor, 0, Reference >, public ActorCallback< FlowTestCase214Actor, 1, Void >, public ActorCallback< FlowTestCase214Actor, 2, Void >, public FastAllocated, public FlowTestCase214ActorState { + #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase202Actor, 0, Reference >; -friend struct ActorCallback< FlowTestCase202Actor, 1, Void >; -friend struct ActorCallback< FlowTestCase202Actor, 2, Void >; - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - FlowTestCase202Actor(UnitTestParameters const& params) - #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" +friend struct ActorCallback< FlowTestCase214Actor, 0, Reference >; +friend struct ActorCallback< FlowTestCase214Actor, 1, Void >; +friend struct ActorCallback< FlowTestCase214Actor, 2, Void >; + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + FlowTestCase214Actor(UnitTestParameters const& params) + #line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" : Actor(), - FlowTestCase202ActorState(params) + FlowTestCase214ActorState(params) { - fdb_probe_actor_enter("flowTestCase202", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase214", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase202"); + this->lineage.setActorName("flowTestCase214"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase202", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase214", reinterpret_cast(this), -1); } void cancel() override @@ -1414,69 +1426,69 @@ friend struct ActorCallback< FlowTestCase202Actor, 2, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase202Actor, 0, Reference >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< FlowTestCase202Actor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< FlowTestCase202Actor, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase214Actor, 0, Reference >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase214Actor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< FlowTestCase214Actor, 2, Void >*)0, actor_cancelled()); break; } } }; } - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" -static Future flowTestCase202( UnitTestParameters const& params ) { - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - return Future(new FlowTestCase202Actor(params)); - #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" +static Future flowTestCase214( UnitTestParameters const& params ) { + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + return Future(new FlowTestCase214Actor(params)); + #line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase202, "fdbrpc/SimExternalClient") +ACTOR_TEST_CASE(flowTestCase214, "fdbrpc/SimExternalClient") -#line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" +#line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 1447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase232() - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" -template - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" -class FlowTestCase232ActorState { - #line 1442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" +// This generated class is to be used only via flowTestCase245() + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" +template + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" +class FlowTestCase245ActorState { + #line 1454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" public: - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - FlowTestCase232ActorState(UnitTestParameters const& params) - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + FlowTestCase245ActorState(UnitTestParameters const& params) + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" : params(params), - #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" networkAddresses(), - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" address1(IPAddress(0x13131313), 1) - #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 1465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase232", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase245", reinterpret_cast(this)); } - ~FlowTestCase232ActorState() + ~FlowTestCase245ActorState() { - fdb_probe_actor_destroy("flowTestCase232", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase245", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" networkAddresses.push_back(address1); - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" INetworkConnections::net()->addMockTCPEndpoint("testhost1", "port1", networkAddresses); - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" StrictFuture> __when_expr_0 = INetworkConnections::net()->resolveTCPEndpoint("testhost1", "port1"); - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1489,45 +1501,45 @@ class FlowTestCase232ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase232ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase245ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ASSERT(resolvedNetworkAddresses.size() == 1); - #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ASSERT(std::find(resolvedNetworkAddresses.begin(), resolvedNetworkAddresses.end(), address1) != resolvedNetworkAddresses.end()); - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" INetworkConnections::net()->removeMockTCPEndpoint("testhost1", "port1"); - #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" address2 = NetworkAddress(IPAddress(0x14141414), 2); - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" networkAddresses.push_back(address2); - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" INetworkConnections::net()->addMockTCPEndpoint("testhost1", "port1", networkAddresses); - #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" StrictFuture __when_expr_1 = store(resolvedNetworkAddresses, INetworkConnections::net()->resolveTCPEndpoint("testhost1", "port1")); - #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(std::vector const& __resolvedNetworkAddresses,int loopDepth) { - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" resolvedNetworkAddresses = __resolvedNetworkAddresses; - #line 1530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 1542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -1541,13 +1553,13 @@ class FlowTestCase232ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase232Actor, 0, std::vector >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase245Actor, 0, std::vector >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase232Actor, 0, std::vector >*,std::vector const& value) + void a_callback_fire(ActorCallback< FlowTestCase245Actor, 0, std::vector >*,std::vector const& value) { - fdb_probe_actor_enter("flowTestCase232", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase245", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -1557,12 +1569,12 @@ class FlowTestCase232ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase232", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase245", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase232Actor, 0, std::vector >*,std::vector && value) + void a_callback_fire(ActorCallback< FlowTestCase245Actor, 0, std::vector >*,std::vector && value) { - fdb_probe_actor_enter("flowTestCase232", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase245", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -1572,12 +1584,12 @@ class FlowTestCase232ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase232", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase245", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase232Actor, 0, std::vector >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase245Actor, 0, std::vector >*,Error err) { - fdb_probe_actor_enter("flowTestCase232", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase245", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -1587,37 +1599,37 @@ class FlowTestCase232ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase232", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase245", reinterpret_cast(this), 0); } int a_body1cont2(Void const& _,int loopDepth) { - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ASSERT(resolvedNetworkAddresses.size() == 2); - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ASSERT(std::find(resolvedNetworkAddresses.begin(), resolvedNetworkAddresses.end(), address2) != resolvedNetworkAddresses.end()); - #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase232ActorState(); static_cast(this)->destroy(); return 0; } - #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase232ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase245ActorState(); static_cast(this)->destroy(); return 0; } + #line 1613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase245ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ASSERT(resolvedNetworkAddresses.size() == 2); - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" ASSERT(std::find(resolvedNetworkAddresses.begin(), resolvedNetworkAddresses.end(), address2) != resolvedNetworkAddresses.end()); - #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase232ActorState(); static_cast(this)->destroy(); return 0; } - #line 1617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase232ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase245ActorState(); static_cast(this)->destroy(); return 0; } + #line 1629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase245ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -1636,13 +1648,13 @@ class FlowTestCase232ActorState { } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase232Actor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase245Actor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase232Actor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase245Actor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase232", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase245", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -1652,12 +1664,12 @@ class FlowTestCase232ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase232", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase245", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< FlowTestCase232Actor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase245Actor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase232", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase245", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -1667,12 +1679,12 @@ class FlowTestCase232ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase232", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase245", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< FlowTestCase232Actor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase245Actor, 1, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase232", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase245", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -1682,47 +1694,47 @@ class FlowTestCase232ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase232", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase245", reinterpret_cast(this), 1); } - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" UnitTestParameters params; - #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" std::vector networkAddresses; - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" NetworkAddress address1; - #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" std::vector resolvedNetworkAddresses; - #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" NetworkAddress address2; - #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 1710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase232() - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" -class FlowTestCase232Actor final : public Actor, public ActorCallback< FlowTestCase232Actor, 0, std::vector >, public ActorCallback< FlowTestCase232Actor, 1, Void >, public FastAllocated, public FlowTestCase232ActorState { - #line 1703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" +// This generated class is to be used only via flowTestCase245() + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" +class FlowTestCase245Actor final : public Actor, public ActorCallback< FlowTestCase245Actor, 0, std::vector >, public ActorCallback< FlowTestCase245Actor, 1, Void >, public FastAllocated, public FlowTestCase245ActorState { + #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase232Actor, 0, std::vector >; -friend struct ActorCallback< FlowTestCase232Actor, 1, Void >; - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - FlowTestCase232Actor(UnitTestParameters const& params) - #line 1715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" +friend struct ActorCallback< FlowTestCase245Actor, 0, std::vector >; +friend struct ActorCallback< FlowTestCase245Actor, 1, Void >; + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + FlowTestCase245Actor(UnitTestParameters const& params) + #line 1727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" : Actor(), - FlowTestCase232ActorState(params) + FlowTestCase245ActorState(params) { - fdb_probe_actor_enter("flowTestCase232", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase245", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase232"); + this->lineage.setActorName("flowTestCase245"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase232", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase245", reinterpret_cast(this), -1); } void cancel() override @@ -1730,21 +1742,21 @@ friend struct ActorCallback< FlowTestCase232Actor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase232Actor, 0, std::vector >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< FlowTestCase232Actor, 1, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase245Actor, 0, std::vector >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase245Actor, 1, Void >*)0, actor_cancelled()); break; } } }; } - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" -static Future flowTestCase232( UnitTestParameters const& params ) { - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" - return Future(new FlowTestCase232Actor(params)); - #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" +static Future flowTestCase245( UnitTestParameters const& params ) { + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" + return Future(new FlowTestCase245Actor(params)); + #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase232, "fdbrpc/MockDNS") +ACTOR_TEST_CASE(flowTestCase245, "fdbrpc/MockDNS") -#line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" +#line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/SimExternalConnection.actor.cpp" void forceLinkSimExternalConnectionTests() {} diff --git a/src/fdbrpc/Smoother.h b/src/fdbrpc/Smoother.h deleted file mode 100644 index d806a3d..0000000 --- a/src/fdbrpc/Smoother.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Smoother.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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 - -#include "flow/flow.h" -#include - -template -class SmootherImpl { - // Times (t) are expected to be nondecreasing - - double eFoldingTime; - double total; - mutable double time, estimate; - - void update(double t) const { - double elapsed = t - time; - if (elapsed) { - time = t; - estimate += (total - estimate) * (1 - exp(-elapsed / eFoldingTime)); - } - } - -protected: - explicit SmootherImpl(double eFoldingTime) : eFoldingTime(eFoldingTime) { reset(0); } - -public: - void reset(double value) { - time = 0; - total = value; - estimate = value; - } - void setTotal(double total, double t = T::now()) { addDelta(total - this->total, t); } - void addDelta(double delta, double t = T::now()) { - update(t); - total += delta; - } - // smoothTotal() is a continuous (under)estimate of the sum of all addDeltas() - double smoothTotal(double t = T::now()) const { - update(t); - return estimate; - } - // smoothRate() is d/dt[smoothTotal], and is NOT continuous - double smoothRate(double t = T::now()) const { - update(t); - return (total - estimate) / eFoldingTime; - } - - double getTotal() const { return total; } -}; - -class Smoother : public SmootherImpl { -public: - static double now() { return ::now(); } - explicit Smoother(double eFoldingTime) : SmootherImpl(eFoldingTime) {} -}; -class TimerSmoother : public SmootherImpl { -public: - static double now() { return timer(); } - explicit TimerSmoother(double eFoldingTime) : SmootherImpl(eFoldingTime) {} -}; diff --git a/src/fdbrpc/Stats.actor.cpp b/src/fdbrpc/Stats.actor.cpp index 274a4ec..86f430c 100644 --- a/src/fdbrpc/Stats.actor.cpp +++ b/src/fdbrpc/Stats.actor.cpp @@ -19,13 +19,21 @@ */ #include "fdbrpc/Stats.h" +#include "flow/IRandom.h" +#include "flow/Knobs.h" +#include "flow/OTELMetrics.h" +#include "flow/TDMetric.actor.h" +#include "flow/Trace.h" +#include "flow/flow.h" +#include "flow/network.h" +#include #include "flow/actorcompiler.h" // has to be last include Counter::Counter(std::string const& name, CounterCollection& collection) : name(name), interval_start(0), last_event(0), interval_sq_time(0), roughness_interval_start(0), interval_delta(0), interval_start_value(0) { - metric.init(collection.name + "." + (char)toupper(name.at(0)) + name.substr(1), collection.id); - collection.counters.push_back(this); + metric.init(collection.getName() + "." + (char)toupper(name.at(0)) + name.substr(1), collection.getId()); + collection.addCounter(this); } void Counter::operator+=(Value delta) { @@ -81,43 +89,216 @@ void Counter::clear() { metric = 0; } -void CounterCollection::logToTraceEvent(TraceEvent& te) const { +void CounterCollection::logToTraceEvent(TraceEvent& te) { + NetworkAddress addr = g_network->getLocalAddress(); for (ICounter* c : counters) { + MetricCollection* metrics = MetricCollection::getMetricCollection(); + if (metrics != nullptr) { + std::string ip_str = addr.ip.toString(); + std::string port_str = std::to_string(addr.port); + uint64_t val = c->getValue(); + switch (c->model) { + case MetricsDataModel::OTLP: { + if (metrics->sumMap.find(c->id) != metrics->sumMap.end()) { + metrics->sumMap[c->id].points.emplace_back(static_cast(val)); + } else { + metrics->sumMap[c->id] = OTEL::OTELSum(name + "." + c->getName(), val); + } + metrics->sumMap[c->id].points.back().addAttribute("ip", ip_str); + metrics->sumMap[c->id].points.back().addAttribute("port", port_str); + metrics->sumMap[c->id].points.back().startTime = logTime; + } + case MetricsDataModel::STATSD: { + std::vector> statsd_attributes{ { "ip", ip_str }, + { "port", port_str } }; + metrics->statsd_message.push_back(createStatsdMessage( + c->getName(), StatsDMetric::COUNTER, std::to_string(val) /*, statsd_attributes*/)); + } + case MetricsDataModel::NONE: + default: { + } + } + } te.detail(c->getName().c_str(), c); c->resetInterval(); } } -ACTOR Future traceCounters(std::string traceEventName, - UID traceEventID, - double interval, - CounterCollection* counters, - std::string trackLatestName, - std::function decorator) { - wait(delay(0)); // Give an opportunity for all members used in special counters to be initialized +class CounterCollectionImpl { +public: + ACTOR static Future traceCounters(CounterCollection* counters, + std::string traceEventName, + UID traceEventID, + double interval, + std::string trackLatestName, + std::function decorator) { + wait(delay(0)); // Give an opportunity for all members used in special counters to be initialized - for (ICounter* c : counters->counters) - c->resetInterval(); + for (ICounter* c : counters->counters) + c->resetInterval(); + + state Reference traceEventHolder; + if (!trackLatestName.empty()) { + traceEventHolder = makeReference(trackLatestName); + } + + state double last_interval = now(); + + loop { + TraceEvent te(traceEventName.c_str(), traceEventID); + te.detail("Elapsed", now() - last_interval); + + counters->logToTraceEvent(te); + decorator(te); - state Reference traceEventHolder; - if (!trackLatestName.empty()) { - traceEventHolder = makeReference(trackLatestName); + if (!trackLatestName.empty()) { + te.trackLatest(traceEventHolder->trackingKey); + } + + last_interval = now(); + wait(delay(interval, TaskPriority::FlushTrace)); + } } +}; - state double last_interval = now(); +Future CounterCollection::traceCounters(std::string const& traceEventName, + UID traceEventID, + double interval, + std::string const& trackLatestName, + std::function const& decorator) { + return CounterCollectionImpl::traceCounters( + this, traceEventName, traceEventID, interval, trackLatestName, decorator); +} - loop { - TraceEvent te(traceEventName.c_str(), traceEventID); - te.detail("Elapsed", now() - last_interval); +void LatencyBands::insertBand(double value) { + bands.emplace(std::make_pair(value, std::make_unique(format("Band%f", value), *cc))); +} - counters->logToTraceEvent(te); - decorator(te); +LatencyBands::LatencyBands(std::string const& name, + UID id, + double loggingInterval, + std::function const& decorator) + : name(name), id(id), loggingInterval(loggingInterval), decorator(decorator) {} - if (!trackLatestName.empty()) { - te.trackLatest(traceEventHolder->trackingKey); +void LatencyBands::addThreshold(double value) { + if (value > 0 && bands.count(value) == 0) { + if (bands.size() == 0) { + ASSERT(!cc && !filteredCount); + cc = std::make_unique(name, id.toString()); + logger = cc->traceCounters(name, id, loggingInterval, id.toString() + "/" + name, decorator); + filteredCount = std::make_unique("Filtered", *cc); + insertBand(std::numeric_limits::infinity()); } - last_interval = now(); - wait(delay(interval, TaskPriority::FlushTrace)); + insertBand(value); + } +} + +void LatencyBands::addMeasurement(double measurement, int count, Filtered filtered) { + if (filtered && filteredCount) { + (*filteredCount) += count; + } else if (bands.size() > 0) { + auto itr = bands.upper_bound(measurement); + ASSERT(itr != bands.end()); + (*itr->second) += count; + } +} + +void LatencyBands::clearBands() { + logger = Void(); + bands.clear(); + filteredCount.reset(); + cc.reset(); +} + +LatencyBands::~LatencyBands() { + clearBands(); +} + +LatencySample::LatencySample(std::string name, UID id, double loggingInterval, double accuracy) + : name(name), IMetric(knobToMetricModel(FLOW_KNOBS->METRICS_DATA_MODEL)), id(id), sampleEmit(now()), sketch(accuracy), + latencySampleEventHolder(makeReference(id.toString() + "/" + name)) { + logger = recurring([this]() { logSample(); }, loggingInterval); + p50id = deterministicRandom()->randomUniqueID(); + p90id = deterministicRandom()->randomUniqueID(); + p95id = deterministicRandom()->randomUniqueID(); + p99id = deterministicRandom()->randomUniqueID(); + p999id = deterministicRandom()->randomUniqueID(); +} + +void LatencySample::addMeasurement(double measurement) { + sketch.addSample(measurement); +} + +void LatencySample::logSample() { + double p25 = sketch.percentile(0.25); + double p50 = sketch.mean(); + double p90 = sketch.percentile(0.9); + double p95 = sketch.percentile(0.95); + double p99 = sketch.percentile(0.99); + double p99_9 = sketch.percentile(0.999); + TraceEvent(name.c_str(), id) + .detail("Count", sketch.getPopulationSize()) + .detail("Elapsed", now() - sampleEmit) + .detail("Min", sketch.min()) + .detail("Max", sketch.max()) + .detail("Mean", sketch.mean()) + .detail("Median", p50) + .detail("P25", p25) + .detail("P90", p90) + .detail("P95", p95) + .detail("P99", p99) + .detail("P99.9", p99_9) + .trackLatest(latencySampleEventHolder->trackingKey); + MetricCollection* metrics = MetricCollection::getMetricCollection(); + if (metrics != nullptr) { + NetworkAddress addr = g_network->getLocalAddress(); + std::string ip_str = addr.ip.toString(); + std::string port_str = std::to_string(addr.port); + switch (model) { + case MetricsDataModel::OTLP: { + // We only want to emit the entire DDSketch if the knob is set + if (FLOW_KNOBS->METRICS_EMIT_DDSKETCH) { + if (metrics->histMap.find(IMetric::id) != metrics->histMap.end()) { + metrics->histMap[IMetric::id].points.emplace_back( + sketch.getErrorGuarantee(), sketch.getSamples(), sketch.min(), sketch.max(), sketch.getSum()); + } else { + metrics->histMap[IMetric::id] = OTEL::OTELHistogram(name, + sketch.getErrorGuarantee(), + sketch.getSamples(), + sketch.min(), + sketch.max(), + sketch.getSum()); + } + metrics->histMap[IMetric::id].points.back().addAttribute("ip", ip_str); + metrics->histMap[IMetric::id].points.back().addAttribute("port", port_str); + metrics->histMap[IMetric::id].points.back().startTime = sampleEmit; + } + createOtelGauge(p50id, name + "p50", p50); + createOtelGauge(p90id, name + "p90", p90); + createOtelGauge(p95id, name + "p95", p95); + createOtelGauge(p99id, name + "p99", p99); + createOtelGauge(p999id, name + "p99_9", p99_9); + } + case MetricsDataModel::STATSD: { + std::vector> statsd_attributes{ { "ip", ip_str }, + { "port", port_str } }; + auto median_gauge = + createStatsdMessage(name + "p50", StatsDMetric::GAUGE, std::to_string(p50) /*, statsd_attributes*/); + auto p90_gauge = + createStatsdMessage(name + "p90", StatsDMetric::GAUGE, std::to_string(p90) /*, statsd_attributes*/); + auto p95_gauge = + createStatsdMessage(name + "p95", StatsDMetric::GAUGE, std::to_string(p95) /*, statsd_attributes*/); + auto p99_gauge = + createStatsdMessage(name + "p99", StatsDMetric::GAUGE, std::to_string(p99) /*, statsd_attributes*/); + auto p999_gauge = + createStatsdMessage(name + "p99.9", StatsDMetric::GAUGE, std::to_string(p99_9) /*, statsd_attributes*/); + } + case MetricsDataModel::NONE: + default: { + } + } } + sketch.clear(); + sampleEmit = now(); } diff --git a/src/fdbrpc/Stats.actor.g.cpp b/src/fdbrpc/Stats.actor.g.cpp index cf648bf..bcf84ff 100644 --- a/src/fdbrpc/Stats.actor.g.cpp +++ b/src/fdbrpc/Stats.actor.g.cpp @@ -21,13 +21,21 @@ */ #include "fdbrpc/Stats.h" +#include "flow/IRandom.h" +#include "flow/Knobs.h" +#include "flow/OTELMetrics.h" +#include "flow/TDMetric.actor.h" +#include "flow/Trace.h" +#include "flow/flow.h" +#include "flow/network.h" +#include #include "flow/actorcompiler.h" // has to be last include Counter::Counter(std::string const& name, CounterCollection& collection) : name(name), interval_start(0), last_event(0), interval_sq_time(0), roughness_interval_start(0), interval_delta(0), interval_start_value(0) { - metric.init(collection.name + "." + (char)toupper(name.at(0)) + name.substr(1), collection.id); - collection.counters.push_back(this); + metric.init(collection.getName() + "." + (char)toupper(name.at(0)) + name.substr(1), collection.getId()); + collection.addCounter(this); } void Counter::operator+=(Value delta) { @@ -83,38 +91,67 @@ void Counter::clear() { metric = 0; } -void CounterCollection::logToTraceEvent(TraceEvent& te) const { +void CounterCollection::logToTraceEvent(TraceEvent& te) { + NetworkAddress addr = g_network->getLocalAddress(); for (ICounter* c : counters) { + MetricCollection* metrics = MetricCollection::getMetricCollection(); + if (metrics != nullptr) { + std::string ip_str = addr.ip.toString(); + std::string port_str = std::to_string(addr.port); + uint64_t val = c->getValue(); + switch (c->model) { + case MetricsDataModel::OTLP: { + if (metrics->sumMap.find(c->id) != metrics->sumMap.end()) { + metrics->sumMap[c->id].points.emplace_back(static_cast(val)); + } else { + metrics->sumMap[c->id] = OTEL::OTELSum(name + "." + c->getName(), val); + } + metrics->sumMap[c->id].points.back().addAttribute("ip", ip_str); + metrics->sumMap[c->id].points.back().addAttribute("port", port_str); + metrics->sumMap[c->id].points.back().startTime = logTime; + } + case MetricsDataModel::STATSD: { + std::vector> statsd_attributes{ { "ip", ip_str }, + { "port", port_str } }; + metrics->statsd_message.push_back(createStatsdMessage( + c->getName(), StatsDMetric::COUNTER, std::to_string(val) /*, statsd_attributes*/)); + } + case MetricsDataModel::NONE: + default: { + } + } + } te.detail(c->getName().c_str(), c); c->resetInterval(); } } - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" -namespace { +class CounterCollectionImpl { +public: + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" // This generated class is to be used only via traceCounters() - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" template - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" class TraceCountersActorState { - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" public: - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" - TraceCountersActorState(std::string const& traceEventName,UID const& traceEventID,double const& interval,CounterCollection* const& counters,std::string const& trackLatestName,std::function const& decorator) - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" - : traceEventName(traceEventName), - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + TraceCountersActorState(CounterCollection* const& counters,std::string const& traceEventName,UID const& traceEventID,double const& interval,std::string const& trackLatestName,std::function const& decorator) + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + : counters(counters), + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + traceEventName(traceEventName), + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" traceEventID(traceEventID), - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" interval(interval), - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" - counters(counters), - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" trackLatestName(trackLatestName), - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" decorator(decorator) - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" { fdb_probe_actor_create("traceCounters", reinterpret_cast(this)); @@ -127,16 +164,16 @@ class TraceCountersActorState { int a_body1(int loopDepth=0) { try { - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" StrictFuture __when_expr_0 = delay(0); - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -157,54 +194,54 @@ class TraceCountersActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" for( ICounter* c : counters->counters ) { - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" c->resetInterval(); - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" } - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" traceEventHolder = Reference(); - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" if (!trackLatestName.empty()) - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" { - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" traceEventHolder = makeReference(trackLatestName); - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" } - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" last_interval = now(); - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" ; - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" for( ICounter* c : counters->counters ) { - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" c->resetInterval(); - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" } - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" traceEventHolder = Reference(); - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" if (!trackLatestName.empty()) - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" { - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" traceEventHolder = makeReference(trackLatestName); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" } - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" last_interval = now(); - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" ; - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -281,34 +318,34 @@ class TraceCountersActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" TraceEvent te(traceEventName.c_str(), traceEventID); - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" te.detail("Elapsed", now() - last_interval); - #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" counters->logToTraceEvent(te); - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" decorator(te); - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" if (!trackLatestName.empty()) - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" { - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" te.trackLatest(traceEventHolder->trackingKey); - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" } - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" last_interval = now(); - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" StrictFuture __when_expr_1 = delay(interval, TaskPriority::FlushTrace); - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -388,28 +425,28 @@ class TraceCountersActorState { fdb_probe_actor_exit("traceCounters", reinterpret_cast(this), 1); } - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + CounterCollection* counters; + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" std::string traceEventName; - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" UID traceEventID; - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" double interval; - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" - CounterCollection* counters; - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" std::string trackLatestName; - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" std::function decorator; - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" Reference traceEventHolder; - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" double last_interval; - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" }; // This generated class is to be used only via traceCounters() - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" class TraceCountersActor final : public Actor, public ActorCallback< TraceCountersActor, 0, Void >, public ActorCallback< TraceCountersActor, 1, Void >, public FastAllocated, public TraceCountersActorState { - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -419,11 +456,11 @@ class TraceCountersActor final : public Actor, public ActorCallback< Trace #pragma clang diagnostic pop friend struct ActorCallback< TraceCountersActor, 0, Void >; friend struct ActorCallback< TraceCountersActor, 1, Void >; - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" - TraceCountersActor(std::string const& traceEventName,UID const& traceEventID,double const& interval,CounterCollection* const& counters,std::string const& trackLatestName,std::function const& decorator) - #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + TraceCountersActor(CounterCollection* const& counters,std::string const& traceEventName,UID const& traceEventID,double const& interval,std::string const& trackLatestName,std::function const& decorator) + #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" : Actor(), - TraceCountersActorState(traceEventName, traceEventID, interval, counters, trackLatestName, decorator) + TraceCountersActorState(counters, traceEventName, traceEventID, interval, trackLatestName, decorator) { fdb_probe_actor_enter("traceCounters", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -445,12 +482,154 @@ friend struct ActorCallback< TraceCountersActor, 1, Void >; } }; + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" +[[nodiscard]] static Future traceCounters( CounterCollection* const& counters, std::string const& traceEventName, UID const& traceEventID, double const& interval, std::string const& trackLatestName, std::function const& decorator ) { + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" + return Future(new TraceCountersActor(counters, traceEventName, traceEventID, interval, trackLatestName, decorator)); + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" +} + +#line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" +}; + +Future CounterCollection::traceCounters(std::string const& traceEventName, + UID traceEventID, + double interval, + std::string const& trackLatestName, + std::function const& decorator) { + return CounterCollectionImpl::traceCounters( + this, traceEventName, traceEventID, interval, trackLatestName, decorator); +} + +void LatencyBands::insertBand(double value) { + bands.emplace(std::make_pair(value, std::make_unique(format("Band%f", value), *cc))); } - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" -[[nodiscard]] Future traceCounters( std::string const& traceEventName, UID const& traceEventID, double const& interval, CounterCollection* const& counters, std::string const& trackLatestName, std::function const& decorator ) { - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" - return Future(new TraceCountersActor(traceEventName, traceEventID, interval, counters, trackLatestName, decorator)); - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.g.cpp" + +LatencyBands::LatencyBands(std::string const& name, + UID id, + double loggingInterval, + std::function const& decorator) + : name(name), id(id), loggingInterval(loggingInterval), decorator(decorator) {} + +void LatencyBands::addThreshold(double value) { + if (value > 0 && bands.count(value) == 0) { + if (bands.size() == 0) { + ASSERT(!cc && !filteredCount); + cc = std::make_unique(name, id.toString()); + logger = cc->traceCounters(name, id, loggingInterval, id.toString() + "/" + name, decorator); + filteredCount = std::make_unique("Filtered", *cc); + insertBand(std::numeric_limits::infinity()); + } + + insertBand(value); + } } -#line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/Stats.actor.cpp" +void LatencyBands::addMeasurement(double measurement, int count, Filtered filtered) { + if (filtered && filteredCount) { + (*filteredCount) += count; + } else if (bands.size() > 0) { + auto itr = bands.upper_bound(measurement); + ASSERT(itr != bands.end()); + (*itr->second) += count; + } +} + +void LatencyBands::clearBands() { + logger = Void(); + bands.clear(); + filteredCount.reset(); + cc.reset(); +} + +LatencyBands::~LatencyBands() { + clearBands(); +} + +LatencySample::LatencySample(std::string name, UID id, double loggingInterval, double accuracy) + : name(name), IMetric(knobToMetricModel(FLOW_KNOBS->METRICS_DATA_MODEL)), id(id), sampleEmit(now()), sketch(accuracy), + latencySampleEventHolder(makeReference(id.toString() + "/" + name)) { + logger = recurring([this]() { logSample(); }, loggingInterval); + p50id = deterministicRandom()->randomUniqueID(); + p90id = deterministicRandom()->randomUniqueID(); + p95id = deterministicRandom()->randomUniqueID(); + p99id = deterministicRandom()->randomUniqueID(); + p999id = deterministicRandom()->randomUniqueID(); +} + +void LatencySample::addMeasurement(double measurement) { + sketch.addSample(measurement); +} + +void LatencySample::logSample() { + double p25 = sketch.percentile(0.25); + double p50 = sketch.mean(); + double p90 = sketch.percentile(0.9); + double p95 = sketch.percentile(0.95); + double p99 = sketch.percentile(0.99); + double p99_9 = sketch.percentile(0.999); + TraceEvent(name.c_str(), id) + .detail("Count", sketch.getPopulationSize()) + .detail("Elapsed", now() - sampleEmit) + .detail("Min", sketch.min()) + .detail("Max", sketch.max()) + .detail("Mean", sketch.mean()) + .detail("Median", p50) + .detail("P25", p25) + .detail("P90", p90) + .detail("P95", p95) + .detail("P99", p99) + .detail("P99.9", p99_9) + .trackLatest(latencySampleEventHolder->trackingKey); + MetricCollection* metrics = MetricCollection::getMetricCollection(); + if (metrics != nullptr) { + NetworkAddress addr = g_network->getLocalAddress(); + std::string ip_str = addr.ip.toString(); + std::string port_str = std::to_string(addr.port); + switch (model) { + case MetricsDataModel::OTLP: { + // We only want to emit the entire DDSketch if the knob is set + if (FLOW_KNOBS->METRICS_EMIT_DDSKETCH) { + if (metrics->histMap.find(IMetric::id) != metrics->histMap.end()) { + metrics->histMap[IMetric::id].points.emplace_back( + sketch.getErrorGuarantee(), sketch.getSamples(), sketch.min(), sketch.max(), sketch.getSum()); + } else { + metrics->histMap[IMetric::id] = OTEL::OTELHistogram(name, + sketch.getErrorGuarantee(), + sketch.getSamples(), + sketch.min(), + sketch.max(), + sketch.getSum()); + } + metrics->histMap[IMetric::id].points.back().addAttribute("ip", ip_str); + metrics->histMap[IMetric::id].points.back().addAttribute("port", port_str); + metrics->histMap[IMetric::id].points.back().startTime = sampleEmit; + } + createOtelGauge(p50id, name + "p50", p50); + createOtelGauge(p90id, name + "p90", p90); + createOtelGauge(p95id, name + "p95", p95); + createOtelGauge(p99id, name + "p99", p99); + createOtelGauge(p999id, name + "p99_9", p99_9); + } + case MetricsDataModel::STATSD: { + std::vector> statsd_attributes{ { "ip", ip_str }, + { "port", port_str } }; + auto median_gauge = + createStatsdMessage(name + "p50", StatsDMetric::GAUGE, std::to_string(p50) /*, statsd_attributes*/); + auto p90_gauge = + createStatsdMessage(name + "p90", StatsDMetric::GAUGE, std::to_string(p90) /*, statsd_attributes*/); + auto p95_gauge = + createStatsdMessage(name + "p95", StatsDMetric::GAUGE, std::to_string(p95) /*, statsd_attributes*/); + auto p99_gauge = + createStatsdMessage(name + "p99", StatsDMetric::GAUGE, std::to_string(p99) /*, statsd_attributes*/); + auto p999_gauge = + createStatsdMessage(name + "p99.9", StatsDMetric::GAUGE, std::to_string(p99_9) /*, statsd_attributes*/); + } + case MetricsDataModel::NONE: + default: { + } + } + } + sketch.clear(); + sampleEmit = now(); +} diff --git a/src/fdbrpc/TokenCache.actor.cpp b/src/fdbrpc/TokenCache.actor.cpp new file mode 100644 index 0000000..085949e --- /dev/null +++ b/src/fdbrpc/TokenCache.actor.cpp @@ -0,0 +1,495 @@ +#include "fdbrpc/Base64Encode.h" +#include "fdbrpc/Base64Decode.h" +#include "fdbrpc/FlowTransport.h" +#include "fdbrpc/TokenCache.h" +#include "fdbrpc/TokenSign.h" +#include "fdbrpc/TenantInfo.h" +#include "flow/MkCert.h" +#include "flow/ScopeExit.h" +#include "flow/UnitTest.h" +#include "flow/network.h" + +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "flow/actorcompiler.h" // has to be last include + +using authz::TenantId; + +template +class LRUCache { +public: + using key_type = Key; + using list_type = std::list; + using mapped_type = Value; + using map_type = boost::unordered_map>; + using size_type = unsigned; + + explicit LRUCache(size_type capacity) : _capacity(capacity) { _map.reserve(capacity); } + + size_type size() const { return _map.size(); } + size_type capacity() const { return _capacity; } + bool empty() const { return _map.empty(); } + + Optional get(key_type const& key) { + auto i = _map.find(key); + if (i == _map.end()) { + return Optional(); + } + auto j = i->second.second; + if (j != _list.begin()) { + _list.erase(j); + _list.push_front(i->first); + i->second.second = _list.begin(); + } + return &i->second.first; + } + + template + mapped_type* insert(K&& key, V&& value) { + auto iter = _map.find(key); + if (iter != _map.end()) { + return &iter->second.first; + } + if (size() == capacity()) { + auto i = --_list.end(); + _map.erase(*i); + _list.erase(i); + } + _list.push_front(std::forward(key)); + std::tie(iter, std::ignore) = + _map.insert(std::make_pair(*_list.begin(), std::make_pair(std::forward(value), _list.begin()))); + return &iter->second.first; + } + +private: + const size_type _capacity; + map_type _map; + list_type _list; +}; + +TEST_CASE("/fdbrpc/authz/LRUCache") { + auto& rng = *deterministicRandom(); + { + // test very small LRU cache + LRUCache cache(rng.randomInt(2, 10)); + for (int i = 0; i < 200; ++i) { + cache.insert(i, "val"_sr); + if (i >= cache.capacity()) { + for (auto j = 0; j <= i - cache.capacity(); j++) + ASSERT(!cache.get(j).present()); + // ordering is important so as not to disrupt the LRU order + for (auto j = i - cache.capacity() + 1; j <= i; j++) + ASSERT(cache.get(j).present()); + } + } + } + { + // Test larger cache + LRUCache cache(1000); + for (auto i = 0; i < 1000; ++i) { + cache.insert(i, "value"_sr); + } + cache.insert(1000, "value"_sr); // should evict 0 + ASSERT(!cache.get(0).present()); + } + { + // memory test -- this is what the boost implementation didn't do correctly + LRUCache> cache(10); + std::deque cachedStrings; + std::deque evictedStrings; + for (int i = 0; i < 10; ++i) { + auto str = rng.randomAlphaNumeric(rng.randomInt(100, 1024)); + Standalone sref(str); + cache.insert(sref, sref); + cachedStrings.push_back(str); + } + for (int i = 0; i < 10; ++i) { + Standalone existingStr(cachedStrings.back()); + auto cachedStr = cache.get(existingStr); + ASSERT(cachedStr.present()); + ASSERT(*cachedStr.get() == existingStr); + if (!evictedStrings.empty()) { + Standalone nonexisting(evictedStrings.at(rng.randomInt(0, evictedStrings.size()))); + ASSERT(!cache.get(nonexisting).present()); + } + auto str = rng.randomAlphaNumeric(rng.randomInt(100, 1024)); + Standalone sref(str); + evictedStrings.push_back(cachedStrings.front()); + cachedStrings.pop_front(); + cachedStrings.push_back(str); + cache.insert(sref, sref); + } + } + return Void(); +} + +struct CacheEntry { + Arena arena; + VectorRef tenants; + Optional tokenId; + double expirationTime = 0.0; +}; + +struct AuditEntry { + NetworkAddress address; + TenantId tenantId; + Optional> tokenId; + bool operator==(const AuditEntry& other) const noexcept = default; + explicit AuditEntry(NetworkAddress const& address, TenantId tenantId, CacheEntry const& cacheEntry) + : address(address), tenantId(tenantId), + tokenId(cacheEntry.tokenId.present() ? Standalone(cacheEntry.tokenId.get(), cacheEntry.arena) + : Optional>()) {} +}; + +std::size_t hash_value(AuditEntry const& value) { + std::size_t seed = 0; + boost::hash_combine(seed, value.address); + boost::hash_combine(seed, value.tenantId); + if (value.tokenId.present()) { + boost::hash_combine(seed, value.tokenId.get()); + } + return seed; +} + +struct TokenCacheImpl { + TokenCacheImpl(); + LRUCache cache; + boost::unordered_set usedTokens; + double lastResetTime; + + bool validate(TenantId tenantId, StringRef token); + bool validateAndAdd(double currentTime, StringRef token, NetworkAddress const& peer); + void logTokenUsage(double currentTime, AuditEntry&& entry); +}; + +TokenCacheImpl::TokenCacheImpl() : cache(FLOW_KNOBS->TOKEN_CACHE_SIZE), usedTokens(), lastResetTime(0) {} + +TokenCache::TokenCache() : impl(new TokenCacheImpl()) {} +TokenCache::~TokenCache() { + delete impl; +} + +void TokenCache::createInstance() { + g_network->setGlobal(INetwork::enTokenCache, new TokenCache()); +} + +TokenCache& TokenCache::instance() { + return *reinterpret_cast(g_network->global(INetwork::enTokenCache)); +} + +bool TokenCache::validate(TenantId tenantId, StringRef token) { + return impl->validate(tenantId, token); +} + +#define TRACE_INVALID_PARSED_TOKEN(reason, token) \ + TraceEvent(SevWarn, "InvalidToken"_audit) \ + .detail("From", peer) \ + .detail("Reason", reason) \ + .detail("CurrentTime", currentTime) \ + .detail("Token", toStringRef(arena, token).toStringView()) + +bool TokenCacheImpl::validateAndAdd(double currentTime, StringRef token, NetworkAddress const& peer) { + Arena arena; + authz::jwt::TokenRef t; + StringRef signInput; + Optional err; + bool verifyOutcome; + if ((err = authz::jwt::parseToken(arena, token, t, signInput)).present()) { + CODE_PROBE(true, "Token can't be parsed"); + TraceEvent te(SevWarn, "InvalidToken"); + te.detail("From", peer); + te.detail("Reason", "ParseError"); + te.detail("ErrorDetail", err.get()); + if (signInput.empty()) { // unrecognizable token structure + te.detail("Token", token.toString()); + } else { // trace with signature part taken out + te.detail("SignInput", signInput.toString()); + } + return false; + } + auto key = FlowTransport::transport().getPublicKeyByName(t.keyId); + if (!key.present()) { + CODE_PROBE(true, "Token referencing non-existing key"); + TRACE_INVALID_PARSED_TOKEN("UnknownKey", t); + return false; + } else if (!t.issuedAtUnixTime.present()) { + CODE_PROBE(true, "Token has no issued-at field"); + TRACE_INVALID_PARSED_TOKEN("NoIssuedAt", t); + return false; + } else if (!t.expiresAtUnixTime.present()) { + CODE_PROBE(true, "Token has no expiration time"); + TRACE_INVALID_PARSED_TOKEN("NoExpirationTime", t); + return false; + } else if (double(t.expiresAtUnixTime.get()) <= currentTime) { + CODE_PROBE(true, "Expired token"); + TRACE_INVALID_PARSED_TOKEN("Expired", t); + return false; + } else if (!t.notBeforeUnixTime.present()) { + CODE_PROBE(true, "Token has no not-before field"); + TRACE_INVALID_PARSED_TOKEN("NoNotBefore", t); + return false; + } else if (double(t.notBeforeUnixTime.get()) > currentTime) { + CODE_PROBE(true, "Token's not-before is in the future"); + TRACE_INVALID_PARSED_TOKEN("TokenNotYetValid", t); + return false; + } else if (!t.tenants.present()) { + CODE_PROBE(true, "Token with no tenants"); + TRACE_INVALID_PARSED_TOKEN("NoTenants", t); + return false; + } + std::tie(verifyOutcome, err) = authz::jwt::verifyToken(signInput, t, key.get()); + if (err.present()) { + CODE_PROBE(true, "Error while verifying token"); + TRACE_INVALID_PARSED_TOKEN("ErrorWhileVerifyingToken", t).detail("ErrorDetail", err.get()); + return false; + } else if (!verifyOutcome) { + CODE_PROBE(true, "Token with invalid signature"); + TRACE_INVALID_PARSED_TOKEN("InvalidSignature", t); + return false; + } else { + CacheEntry c; + c.expirationTime = t.expiresAtUnixTime.get(); + c.tenants.reserve(c.arena, t.tenants.get().size()); + for (auto tenantId : t.tenants.get()) { + c.tenants.push_back(c.arena, tenantId); + } + if (t.tokenId.present()) { + c.tokenId = StringRef(c.arena, t.tokenId.get()); + } + cache.insert(StringRef(c.arena, token), c); + return true; + } +} + +bool TokenCacheImpl::validate(TenantId tenantId, StringRef token) { + NetworkAddress peer = FlowTransport::transport().currentDeliveryPeerAddress(); + auto cachedEntry = cache.get(token); + double currentTime = g_network->timer(); + + if (!cachedEntry.present()) { + if (validateAndAdd(currentTime, token, peer)) { + cachedEntry = cache.get(token); + } else { + return false; + } + } + + ASSERT(cachedEntry.present()); + + auto& entry = cachedEntry.get(); + if (entry->expirationTime < currentTime) { + CODE_PROBE(true, "Found expired token in cache"); + TraceEvent(SevWarn, "InvalidToken"_audit).detail("From", peer).detail("Reason", "ExpiredInCache"); + return false; + } + bool tenantFound = false; + for (auto const& t : entry->tenants) { + if (t == tenantId) { + tenantFound = true; + break; + } + } + if (!tenantFound) { + CODE_PROBE(true, "Valid token doesn't reference tenant"); + TraceEvent(SevWarn, "InvalidToken"_audit) + .detail("From", peer) + .detail("Reason", "TenantTokenMismatch") + .detail("RequestedTenant", fmt::format("{:#x}", tenantId)) + .detail("TenantsInToken", fmt::format("{:#x}", fmt::join(entry->tenants, " "))); + return false; + } + // audit logging + if (FLOW_KNOBS->AUDIT_LOGGING_ENABLED) + logTokenUsage(currentTime, AuditEntry(peer, tenantId, *cachedEntry.get())); + return true; +} + +void TokenCacheImpl::logTokenUsage(double currentTime, AuditEntry&& entry) { + if (currentTime > lastResetTime + FLOW_KNOBS->AUDIT_TIME_WINDOW) { + // clear usage cache every AUDIT_TIME_WINDOW seconds + usedTokens.clear(); + lastResetTime = currentTime; + } + auto [iter, inserted] = usedTokens.insert(std::move(entry)); + if (inserted) { + // access in the context of this (client_ip, tenant, token_id) tuple hasn't been logged in current window. log + // usage. + CODE_PROBE(true, "Audit Logging Running"); + TraceEvent("AuditTokenUsed"_audit) + .detail("Client", iter->address) + .detail("TenantId", fmt::format("{:#x}", iter->tenantId)) + .detail("TokenId", iter->tokenId) + .log(); + } +} + +namespace authz::jwt { +extern TokenRef makeRandomTokenSpec(Arena&, IRandom&, authz::Algorithm); +} + +TEST_CASE("/fdbrpc/authz/TokenCache/BadTokens") { + auto const pubKeyName = "someEcPublicKey"_sr; + auto const rsaPubKeyName = "someRsaPublicKey"_sr; + auto privateKey = mkcert::makeEcP256(); + auto publicKey = privateKey.toPublic(); + auto rsaPrivateKey = mkcert::makeRsa4096Bit(); // to trigger unmatched sign algorithm + auto rsaPublicKey = rsaPrivateKey.toPublic(); + std::pair, char const*> badMutations[]{ + { + [](Arena&, IRandom&, authz::jwt::TokenRef&) { FlowTransport::transport().removeAllPublicKeys(); }, + "NoKeyWithSuchName", + }, + { + [](Arena&, IRandom&, authz::jwt::TokenRef& token) { token.expiresAtUnixTime.reset(); }, + "NoExpirationTime", + }, + { + [](Arena&, IRandom& rng, authz::jwt::TokenRef& token) { + token.expiresAtUnixTime = std::max(g_network->timer() - 10 - rng.random01() * 50, 0); + }, + "ExpiredToken", + }, + { + [](Arena&, IRandom&, authz::jwt::TokenRef& token) { token.notBeforeUnixTime.reset(); }, + "NoNotBefore", + }, + { + [](Arena&, IRandom& rng, authz::jwt::TokenRef& token) { + token.notBeforeUnixTime = g_network->timer() + 10 + rng.random01() * 50; + }, + "TokenNotYetValid", + }, + { + [](Arena&, IRandom&, authz::jwt::TokenRef& token) { token.issuedAtUnixTime.reset(); }, + "NoIssuedAt", + }, + { + [](Arena& arena, IRandom&, authz::jwt::TokenRef& token) { token.tenants.reset(); }, + "NoTenants", + }, + { + [](Arena& arena, IRandom&, authz::jwt::TokenRef& token) { + TenantId* newTenants = new (arena) TenantId[1]; + *newTenants = token.tenants.get()[0] + 1; + token.tenants = VectorRef(newTenants, 1); + }, + "UnmatchedTenant", + }, + { + [rsaPubKeyName](Arena& arena, IRandom&, authz::jwt::TokenRef& token) { token.keyId = rsaPubKeyName; }, + "UnmatchedSignAlgorithm", + }, + }; + auto const numBadMutations = sizeof(badMutations) / sizeof(badMutations[0]); + for (auto repeat = 0; repeat < 50; repeat++) { + auto arena = Arena(); + auto& rng = *deterministicRandom(); + auto validTokenSpec = authz::jwt::makeRandomTokenSpec(arena, rng, authz::Algorithm::ES256); + validTokenSpec.keyId = pubKeyName; + for (auto i = 0; i <= numBadMutations + 1; i++) { + FlowTransport::transport().addPublicKey(pubKeyName, publicKey); + FlowTransport::transport().addPublicKey(rsaPubKeyName, rsaPublicKey); + auto publicKeyClearGuard = ScopeExit([]() { FlowTransport::transport().removeAllPublicKeys(); }); + auto signedToken = StringRef(); + auto tmpArena = Arena(); + if (i < numBadMutations) { + auto [mutationFn, mutationDesc] = badMutations[i]; + auto mutatedTokenSpec = validTokenSpec; + mutationFn(tmpArena, rng, mutatedTokenSpec); + signedToken = authz::jwt::signToken(tmpArena, mutatedTokenSpec, privateKey); + if (TokenCache::instance().validate(validTokenSpec.tenants.get()[0], signedToken)) { + fmt::print("Unexpected successful validation at mutation {}, token spec: {}\n", + mutationDesc, + toStringRef(tmpArena, mutatedTokenSpec).toStringView()); + ASSERT(false); + } + } else if (i == numBadMutations) { + // squeeze in a bad signature case that does not fit into mutation interface + signedToken = authz::jwt::signToken(tmpArena, validTokenSpec, privateKey); + signedToken.popBack(); + if (TokenCache::instance().validate(validTokenSpec.tenants.get()[0], signedToken)) { + fmt::print("Unexpected successful validation with a token with truncated signature part\n"); + ASSERT(false); + } + } else { + // test if badly base64-encoded tenant name causes validation to fail as expected + auto signInput = authz::jwt::makeSignInput(tmpArena, validTokenSpec); + auto b64Header = signInput.eat("."_sr); + auto payload = base64::url::decode(tmpArena, signInput).get(); + rapidjson::Document d; + d.Parse(reinterpret_cast(payload.begin()), payload.size()); + ASSERT(!d.HasParseError()); + rapidjson::StringBuffer wrBuf; + rapidjson::Writer wr(wrBuf); + auto tenantsField = d.FindMember("tenants"); + ASSERT(tenantsField != d.MemberEnd()); + tenantsField->value.PushBack("ABC#", d.GetAllocator()); // inject base64-illegal character + d.Accept(wr); + auto b64ModifiedPayload = base64::url::encode( + tmpArena, StringRef(reinterpret_cast(wrBuf.GetString()), wrBuf.GetSize())); + signInput = b64Header.withSuffix("."_sr, tmpArena).withSuffix(b64ModifiedPayload, tmpArena); + signedToken = authz::jwt::signToken(tmpArena, signInput, validTokenSpec.algorithm, privateKey); + if (TokenCache::instance().validate(validTokenSpec.tenants.get()[0], signedToken)) { + fmt::print( + "Unexpected successful validation of a token with tenant name containing non-base64 chars)\n"); + ASSERT(false); + } + } + } + } + if (TokenCache::instance().validate(TenantInfo::INVALID_TENANT, StringRef())) { + fmt::print("Unexpected successful validation of ill-formed token (no signature part)\n"); + ASSERT(false); + } + if (TokenCache::instance().validate(TenantInfo::INVALID_TENANT, "1111.22"_sr)) { + fmt::print("Unexpected successful validation of ill-formed token (no signature part)\n"); + ASSERT(false); + } + if (TokenCache::instance().validate(TenantInfo::INVALID_TENANT, "////.////.////"_sr)) { + fmt::print("Unexpected successful validation of unparseable token\n"); + ASSERT(false); + } + fmt::print("TEST OK\n"); + return Void(); +} + +TEST_CASE("/fdbrpc/authz/TokenCache/GoodTokens") { + // Don't repeat because token expiry is at seconds granularity and sleeps are costly in unit tests + state Arena arena; + state PrivateKey privateKey = mkcert::makeEcP256(); + state StringRef pubKeyName = "somePublicKey"_sr; + state ScopeExit> publicKeyClearGuard( + [pubKeyName = pubKeyName]() { FlowTransport::transport().removePublicKey(pubKeyName); }); + state authz::jwt::TokenRef tokenSpec = + authz::jwt::makeRandomTokenSpec(arena, *deterministicRandom(), authz::Algorithm::ES256); + state StringRef signedToken; + FlowTransport::transport().addPublicKey(pubKeyName, privateKey.toPublic()); + tokenSpec.expiresAtUnixTime = g_network->timer() + 2.0; + tokenSpec.keyId = pubKeyName; + signedToken = authz::jwt::signToken(arena, tokenSpec, privateKey); + if (!TokenCache::instance().validate(tokenSpec.tenants.get()[0], signedToken)) { + fmt::print("Unexpected failed token validation, token spec: {}, now: {}\n", + toStringRef(arena, tokenSpec).toStringView(), + g_network->timer()); + ASSERT(false); + } + wait(delay(3.5)); + if (TokenCache::instance().validate(tokenSpec.tenants.get()[0], signedToken)) { + fmt::print( + "Unexpected successful token validation after supposedly expiring in cache, token spec: {}, now: {}\n", + toStringRef(arena, tokenSpec).toStringView(), + g_network->timer()); + ASSERT(false); + } + fmt::print("TEST OK\n"); + return Void(); +} diff --git a/src/fdbrpc/TokenCache.actor.g.cpp b/src/fdbrpc/TokenCache.actor.g.cpp new file mode 100644 index 0000000..2ae10b5 --- /dev/null +++ b/src/fdbrpc/TokenCache.actor.g.cpp @@ -0,0 +1,1003 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" +#include "fdbrpc/Base64Encode.h" +#include "fdbrpc/Base64Decode.h" +#include "fdbrpc/FlowTransport.h" +#include "fdbrpc/TokenCache.h" +#include "fdbrpc/TokenSign.h" +#include "fdbrpc/TenantInfo.h" +#include "flow/MkCert.h" +#include "flow/ScopeExit.h" +#include "flow/UnitTest.h" +#include "flow/network.h" + +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "flow/actorcompiler.h" // has to be last include + +using authz::TenantId; + +template +class LRUCache { +public: + using key_type = Key; + using list_type = std::list; + using mapped_type = Value; + using map_type = boost::unordered_map>; + using size_type = unsigned; + + explicit LRUCache(size_type capacity) : _capacity(capacity) { _map.reserve(capacity); } + + size_type size() const { return _map.size(); } + size_type capacity() const { return _capacity; } + bool empty() const { return _map.empty(); } + + Optional get(key_type const& key) { + auto i = _map.find(key); + if (i == _map.end()) { + return Optional(); + } + auto j = i->second.second; + if (j != _list.begin()) { + _list.erase(j); + _list.push_front(i->first); + i->second.second = _list.begin(); + } + return &i->second.first; + } + + template + mapped_type* insert(K&& key, V&& value) { + auto iter = _map.find(key); + if (iter != _map.end()) { + return &iter->second.first; + } + if (size() == capacity()) { + auto i = --_list.end(); + _map.erase(*i); + _list.erase(i); + } + _list.push_front(std::forward(key)); + std::tie(iter, std::ignore) = + _map.insert(std::make_pair(*_list.begin(), std::make_pair(std::forward(value), _list.begin()))); + return &iter->second.first; + } + +private: + const size_type _capacity; + map_type _map; + list_type _list; +}; + + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase79() + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" +template + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" +class FlowTestCase79ActorState { + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +public: + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + FlowTestCase79ActorState(UnitTestParameters const& params) + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + : params(params) + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase79", reinterpret_cast(this)); + + } + ~FlowTestCase79ActorState() + { + fdb_probe_actor_destroy("flowTestCase79", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto& rng = *deterministicRandom(); + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + LRUCache cache(rng.randomInt(2, 10)); + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + for(int i = 0;i < 200;++i) { + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + cache.insert(i, "val"_sr); + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (i >= cache.capacity()) + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + for(auto j = 0;j <= i - cache.capacity();j++) { + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(!cache.get(j).present()); + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + for(auto j = i - cache.capacity() + 1;j <= i;j++) { + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(cache.get(j).present()); + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + } + } + } + { + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + LRUCache cache(1000); + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + for(auto i = 0;i < 1000;++i) { + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + cache.insert(i, "value"_sr); + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + cache.insert(1000, "value"_sr); + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(!cache.get(0).present()); + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + { + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + LRUCache> cache(10); + #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + std::deque cachedStrings; + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + std::deque evictedStrings; + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + for(int i = 0;i < 10;++i) { + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto str = rng.randomAlphaNumeric(rng.randomInt(100, 1024)); + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + Standalone sref(str); + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + cache.insert(sref, sref); + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + cachedStrings.push_back(str); + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + for(int i = 0;i < 10;++i) { + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + Standalone existingStr(cachedStrings.back()); + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto cachedStr = cache.get(existingStr); + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(cachedStr.present()); + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(*cachedStr.get() == existingStr); + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (!evictedStrings.empty()) + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + Standalone nonexisting(evictedStrings.at(rng.randomInt(0, evictedStrings.size()))); + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(!cache.get(nonexisting).present()); + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto str = rng.randomAlphaNumeric(rng.randomInt(100, 1024)); + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + Standalone sref(str); + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + evictedStrings.push_back(cachedStrings.front()); + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + cachedStrings.pop_front(); + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + cachedStrings.push_back(str); + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + cache.insert(sref, sref); + #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + } + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase79ActorState(); static_cast(this)->destroy(); return 0; } + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase79ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase79ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + UnitTestParameters params; + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase79() + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" +class FlowTestCase79Actor final : public Actor, public FastAllocated, public FlowTestCase79ActorState { + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + FlowTestCase79Actor(UnitTestParameters const& params) + #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + : Actor(), + FlowTestCase79ActorState(params) + { + fdb_probe_actor_enter("flowTestCase79", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase79"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase79", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" +static Future flowTestCase79( UnitTestParameters const& params ) { + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + return Future(new FlowTestCase79Actor(params)); + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase79, "/fdbrpc/authz/LRUCache") + +#line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + +struct CacheEntry { + Arena arena; + VectorRef tenants; + Optional tokenId; + double expirationTime = 0.0; +}; + +struct AuditEntry { + NetworkAddress address; + TenantId tenantId; + Optional> tokenId; + bool operator==(const AuditEntry& other) const noexcept = default; + explicit AuditEntry(NetworkAddress const& address, TenantId tenantId, CacheEntry const& cacheEntry) + : address(address), tenantId(tenantId), + tokenId(cacheEntry.tokenId.present() ? Standalone(cacheEntry.tokenId.get(), cacheEntry.arena) + : Optional>()) {} +}; + +std::size_t hash_value(AuditEntry const& value) { + std::size_t seed = 0; + boost::hash_combine(seed, value.address); + boost::hash_combine(seed, value.tenantId); + if (value.tokenId.present()) { + boost::hash_combine(seed, value.tokenId.get()); + } + return seed; +} + +struct TokenCacheImpl { + TokenCacheImpl(); + LRUCache cache; + boost::unordered_set usedTokens; + double lastResetTime; + + bool validate(TenantId tenantId, StringRef token); + bool validateAndAdd(double currentTime, StringRef token, NetworkAddress const& peer); + void logTokenUsage(double currentTime, AuditEntry&& entry); +}; + +TokenCacheImpl::TokenCacheImpl() : cache(FLOW_KNOBS->TOKEN_CACHE_SIZE), usedTokens(), lastResetTime(0) {} + +TokenCache::TokenCache() : impl(new TokenCacheImpl()) {} +TokenCache::~TokenCache() { + delete impl; +} + +void TokenCache::createInstance() { + g_network->setGlobal(INetwork::enTokenCache, new TokenCache()); +} + +TokenCache& TokenCache::instance() { + return *reinterpret_cast(g_network->global(INetwork::enTokenCache)); +} + +bool TokenCache::validate(TenantId tenantId, StringRef token) { + return impl->validate(tenantId, token); +} + +#define TRACE_INVALID_PARSED_TOKEN(reason, token) \ + TraceEvent(SevWarn, "InvalidToken"_audit) \ + .detail("From", peer) \ + .detail("Reason", reason) \ + .detail("CurrentTime", currentTime) \ + .detail("Token", toStringRef(arena, token).toStringView()) + +bool TokenCacheImpl::validateAndAdd(double currentTime, StringRef token, NetworkAddress const& peer) { + Arena arena; + authz::jwt::TokenRef t; + StringRef signInput; + Optional err; + bool verifyOutcome; + if ((err = authz::jwt::parseToken(arena, token, t, signInput)).present()) { + CODE_PROBE(true, "Token can't be parsed"); + TraceEvent te(SevWarn, "InvalidToken"); + te.detail("From", peer); + te.detail("Reason", "ParseError"); + te.detail("ErrorDetail", err.get()); + if (signInput.empty()) { // unrecognizable token structure + te.detail("Token", token.toString()); + } else { // trace with signature part taken out + te.detail("SignInput", signInput.toString()); + } + return false; + } + auto key = FlowTransport::transport().getPublicKeyByName(t.keyId); + if (!key.present()) { + CODE_PROBE(true, "Token referencing non-existing key"); + TRACE_INVALID_PARSED_TOKEN("UnknownKey", t); + return false; + } else if (!t.issuedAtUnixTime.present()) { + CODE_PROBE(true, "Token has no issued-at field"); + TRACE_INVALID_PARSED_TOKEN("NoIssuedAt", t); + return false; + } else if (!t.expiresAtUnixTime.present()) { + CODE_PROBE(true, "Token has no expiration time"); + TRACE_INVALID_PARSED_TOKEN("NoExpirationTime", t); + return false; + } else if (double(t.expiresAtUnixTime.get()) <= currentTime) { + CODE_PROBE(true, "Expired token"); + TRACE_INVALID_PARSED_TOKEN("Expired", t); + return false; + } else if (!t.notBeforeUnixTime.present()) { + CODE_PROBE(true, "Token has no not-before field"); + TRACE_INVALID_PARSED_TOKEN("NoNotBefore", t); + return false; + } else if (double(t.notBeforeUnixTime.get()) > currentTime) { + CODE_PROBE(true, "Token's not-before is in the future"); + TRACE_INVALID_PARSED_TOKEN("TokenNotYetValid", t); + return false; + } else if (!t.tenants.present()) { + CODE_PROBE(true, "Token with no tenants"); + TRACE_INVALID_PARSED_TOKEN("NoTenants", t); + return false; + } + std::tie(verifyOutcome, err) = authz::jwt::verifyToken(signInput, t, key.get()); + if (err.present()) { + CODE_PROBE(true, "Error while verifying token"); + TRACE_INVALID_PARSED_TOKEN("ErrorWhileVerifyingToken", t).detail("ErrorDetail", err.get()); + return false; + } else if (!verifyOutcome) { + CODE_PROBE(true, "Token with invalid signature"); + TRACE_INVALID_PARSED_TOKEN("InvalidSignature", t); + return false; + } else { + CacheEntry c; + c.expirationTime = t.expiresAtUnixTime.get(); + c.tenants.reserve(c.arena, t.tenants.get().size()); + for (auto tenantId : t.tenants.get()) { + c.tenants.push_back(c.arena, tenantId); + } + if (t.tokenId.present()) { + c.tokenId = StringRef(c.arena, t.tokenId.get()); + } + cache.insert(StringRef(c.arena, token), c); + return true; + } +} + +bool TokenCacheImpl::validate(TenantId tenantId, StringRef token) { + NetworkAddress peer = FlowTransport::transport().currentDeliveryPeerAddress(); + auto cachedEntry = cache.get(token); + double currentTime = g_network->timer(); + + if (!cachedEntry.present()) { + if (validateAndAdd(currentTime, token, peer)) { + cachedEntry = cache.get(token); + } else { + return false; + } + } + + ASSERT(cachedEntry.present()); + + auto& entry = cachedEntry.get(); + if (entry->expirationTime < currentTime) { + CODE_PROBE(true, "Found expired token in cache"); + TraceEvent(SevWarn, "InvalidToken"_audit).detail("From", peer).detail("Reason", "ExpiredInCache"); + return false; + } + bool tenantFound = false; + for (auto const& t : entry->tenants) { + if (t == tenantId) { + tenantFound = true; + break; + } + } + if (!tenantFound) { + CODE_PROBE(true, "Valid token doesn't reference tenant"); + TraceEvent(SevWarn, "InvalidToken"_audit) + .detail("From", peer) + .detail("Reason", "TenantTokenMismatch") + .detail("RequestedTenant", fmt::format("{:#x}", tenantId)) + .detail("TenantsInToken", fmt::format("{:#x}", fmt::join(entry->tenants, " "))); + return false; + } + // audit logging + if (FLOW_KNOBS->AUDIT_LOGGING_ENABLED) + logTokenUsage(currentTime, AuditEntry(peer, tenantId, *cachedEntry.get())); + return true; +} + +void TokenCacheImpl::logTokenUsage(double currentTime, AuditEntry&& entry) { + if (currentTime > lastResetTime + FLOW_KNOBS->AUDIT_TIME_WINDOW) { + // clear usage cache every AUDIT_TIME_WINDOW seconds + usedTokens.clear(); + lastResetTime = currentTime; + } + auto [iter, inserted] = usedTokens.insert(std::move(entry)); + if (inserted) { + // access in the context of this (client_ip, tenant, token_id) tuple hasn't been logged in current window. log + // usage. + CODE_PROBE(true, "Audit Logging Running"); + TraceEvent("AuditTokenUsed"_audit) + .detail("Client", iter->address) + .detail("TenantId", fmt::format("{:#x}", iter->tenantId)) + .detail("TokenId", iter->tokenId) + .log(); + } +} + +namespace authz::jwt { +extern TokenRef makeRandomTokenSpec(Arena&, IRandom&, authz::Algorithm); +} + + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase339() + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" +template + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" +class FlowTestCase339ActorState { + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +public: + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + FlowTestCase339ActorState(UnitTestParameters const& params) + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + : params(params) + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase339", reinterpret_cast(this)); + + } + ~FlowTestCase339ActorState() + { + fdb_probe_actor_destroy("flowTestCase339", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto const pubKeyName = "someEcPublicKey"_sr; + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto const rsaPubKeyName = "someRsaPublicKey"_sr; + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto privateKey = mkcert::makeEcP256(); + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto publicKey = privateKey.toPublic(); + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto rsaPrivateKey = mkcert::makeRsa4096Bit(); + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto rsaPublicKey = rsaPrivateKey.toPublic(); + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + std::pair, char const*> badMutations[]{ { [](Arena&, IRandom&, authz::jwt::TokenRef&) { FlowTransport::transport().removeAllPublicKeys(); }, "NoKeyWithSuchName", }, { [](Arena&, IRandom&, authz::jwt::TokenRef& token) { token.expiresAtUnixTime.reset(); }, "NoExpirationTime", }, { [](Arena&, IRandom& rng, authz::jwt::TokenRef& token) { token.expiresAtUnixTime = std::max(g_network->timer() - 10 - rng.random01() * 50, 0); }, "ExpiredToken", }, { [](Arena&, IRandom&, authz::jwt::TokenRef& token) { token.notBeforeUnixTime.reset(); }, "NoNotBefore", }, { [](Arena&, IRandom& rng, authz::jwt::TokenRef& token) { token.notBeforeUnixTime = g_network->timer() + 10 + rng.random01() * 50; }, "TokenNotYetValid", }, { [](Arena&, IRandom&, authz::jwt::TokenRef& token) { token.issuedAtUnixTime.reset(); }, "NoIssuedAt", }, { [](Arena& arena, IRandom&, authz::jwt::TokenRef& token) { token.tenants.reset(); }, "NoTenants", }, { [](Arena& arena, IRandom&, authz::jwt::TokenRef& token) { TenantId* newTenants = new (arena) TenantId[1]; *newTenants = token.tenants.get()[0] + 1; token.tenants = VectorRef(newTenants, 1); }, "UnmatchedTenant", }, { [rsaPubKeyName](Arena& arena, IRandom&, authz::jwt::TokenRef& token) { token.keyId = rsaPubKeyName; }, "UnmatchedSignAlgorithm", }, }; + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto const numBadMutations = sizeof(badMutations) / sizeof(badMutations[0]); + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + for(auto repeat = 0;repeat < 50;repeat++) { + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto arena = Arena(); + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto& rng = *deterministicRandom(); + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto validTokenSpec = authz::jwt::makeRandomTokenSpec(arena, rng, authz::Algorithm::ES256); + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + validTokenSpec.keyId = pubKeyName; + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + for(auto i = 0;i <= numBadMutations + 1;i++) { + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + FlowTransport::transport().addPublicKey(pubKeyName, publicKey); + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + FlowTransport::transport().addPublicKey(rsaPubKeyName, rsaPublicKey); + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto publicKeyClearGuard = ScopeExit([]() { FlowTransport::transport().removeAllPublicKeys(); }); + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto signedToken = StringRef(); + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto tmpArena = Arena(); + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (i < numBadMutations) + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto [mutationFn, mutationDesc] = badMutations[i]; + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto mutatedTokenSpec = validTokenSpec; + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + mutationFn(tmpArena, rng, mutatedTokenSpec); + #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + signedToken = authz::jwt::signToken(tmpArena, mutatedTokenSpec, privateKey); + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (TokenCache::instance().validate(validTokenSpec.tenants.get()[0], signedToken)) + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + fmt::print("Unexpected successful validation at mutation {}, token spec: {}\n", mutationDesc, toStringRef(tmpArena, mutatedTokenSpec).toStringView()); + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(false); + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + } + else + { + #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (i == numBadMutations) + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + signedToken = authz::jwt::signToken(tmpArena, validTokenSpec, privateKey); + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + signedToken.popBack(); + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (TokenCache::instance().validate(validTokenSpec.tenants.get()[0], signedToken)) + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + fmt::print("Unexpected successful validation with a token with truncated signature part\n"); + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(false); + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + } + else + { + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto signInput = authz::jwt::makeSignInput(tmpArena, validTokenSpec); + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto b64Header = signInput.eat("."_sr); + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto payload = base64::url::decode(tmpArena, signInput).get(); + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + rapidjson::Document d; + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + d.Parse(reinterpret_cast(payload.begin()), payload.size()); + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(!d.HasParseError()); + #line 431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + rapidjson::StringBuffer wrBuf; + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + rapidjson::Writer wr(wrBuf); + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto tenantsField = d.FindMember("tenants"); + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(tenantsField != d.MemberEnd()); + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + tenantsField->value.PushBack("ABC#", d.GetAllocator()); + #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + d.Accept(wr); + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + auto b64ModifiedPayload = base64::url::encode( tmpArena, StringRef(reinterpret_cast(wrBuf.GetString()), wrBuf.GetSize())); + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + signInput = b64Header.withSuffix("."_sr, tmpArena).withSuffix(b64ModifiedPayload, tmpArena); + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + signedToken = authz::jwt::signToken(tmpArena, signInput, validTokenSpec.algorithm, privateKey); + #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (TokenCache::instance().validate(validTokenSpec.tenants.get()[0], signedToken)) + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + fmt::print( "Unexpected successful validation of a token with tenant name containing non-base64 chars)\n"); + #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(false); + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + } + } + } + } + #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (TokenCache::instance().validate(TenantInfo::INVALID_TENANT, StringRef())) + #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + fmt::print("Unexpected successful validation of ill-formed token (no signature part)\n"); + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(false); + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (TokenCache::instance().validate(TenantInfo::INVALID_TENANT, "1111.22"_sr)) + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + fmt::print("Unexpected successful validation of ill-formed token (no signature part)\n"); + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(false); + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (TokenCache::instance().validate(TenantInfo::INVALID_TENANT, "////.////.////"_sr)) + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + fmt::print("Unexpected successful validation of unparseable token\n"); + #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(false); + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + fmt::print("TEST OK\n"); + #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase339ActorState(); static_cast(this)->destroy(); return 0; } + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase339ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase339ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + UnitTestParameters params; + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase339() + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" +class FlowTestCase339Actor final : public Actor, public FastAllocated, public FlowTestCase339ActorState { + #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + FlowTestCase339Actor(UnitTestParameters const& params) + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + : Actor(), + FlowTestCase339ActorState(params) + { + fdb_probe_actor_enter("flowTestCase339", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase339"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase339", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" +static Future flowTestCase339( UnitTestParameters const& params ) { + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + return Future(new FlowTestCase339Actor(params)); + #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase339, "/fdbrpc/authz/TokenCache/BadTokens") + +#line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase465() + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" +template + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" +class FlowTestCase465ActorState { + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +public: + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + FlowTestCase465ActorState(UnitTestParameters const& params) + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + : params(params), + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + arena(), + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + privateKey(mkcert::makeEcP256()), + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + pubKeyName("somePublicKey"_sr), + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + publicKeyClearGuard([pubKeyName = pubKeyName]() { FlowTransport::transport().removePublicKey(pubKeyName); }), + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + tokenSpec(authz::jwt::makeRandomTokenSpec(arena, *deterministicRandom(), authz::Algorithm::ES256)), + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + signedToken() + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase465", reinterpret_cast(this)); + + } + ~FlowTestCase465ActorState() + { + fdb_probe_actor_destroy("flowTestCase465", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + FlowTransport::transport().addPublicKey(pubKeyName, privateKey.toPublic()); + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + tokenSpec.expiresAtUnixTime = g_network->timer() + 2.0; + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + tokenSpec.keyId = pubKeyName; + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + signedToken = authz::jwt::signToken(arena, tokenSpec, privateKey); + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (!TokenCache::instance().validate(tokenSpec.tenants.get()[0], signedToken)) + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + fmt::print("Unexpected failed token validation, token spec: {}, now: {}\n", toStringRef(arena, tokenSpec).toStringView(), g_network->timer()); + #line 483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(false); + #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + StrictFuture __when_expr_0 = delay(3.5); + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase465ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (TokenCache::instance().validate(tokenSpec.tenants.get()[0], signedToken)) + #line 834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + fmt::print( "Unexpected successful token validation after supposedly expiring in cache, token spec: {}, now: {}\n", toStringRef(arena, tokenSpec).toStringView(), g_network->timer()); + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(false); + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + fmt::print("TEST OK\n"); + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase465ActorState(); static_cast(this)->destroy(); return 0; } + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase465ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (TokenCache::instance().validate(tokenSpec.tenants.get()[0], signedToken)) + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + { + #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + fmt::print( "Unexpected successful token validation after supposedly expiring in cache, token spec: {}, now: {}\n", toStringRef(arena, tokenSpec).toStringView(), g_network->timer()); + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ASSERT(false); + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + } + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + fmt::print("TEST OK\n"); + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase465ActorState(); static_cast(this)->destroy(); return 0; } + #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase465ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase465Actor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase465Actor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase465", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase465", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FlowTestCase465Actor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase465", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase465", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< FlowTestCase465Actor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase465", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase465", reinterpret_cast(this), 0); + + } + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + UnitTestParameters params; + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + Arena arena; + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + PrivateKey privateKey; + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + StringRef pubKeyName; + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + ScopeExit> publicKeyClearGuard; + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + authz::jwt::TokenRef tokenSpec; + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + StringRef signedToken; + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase465() + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" +class FlowTestCase465Actor final : public Actor, public ActorCallback< FlowTestCase465Actor, 0, Void >, public FastAllocated, public FlowTestCase465ActorState { + #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< FlowTestCase465Actor, 0, Void >; + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + FlowTestCase465Actor(UnitTestParameters const& params) + #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" + : Actor(), + FlowTestCase465ActorState(params) + { + fdb_probe_actor_enter("flowTestCase465", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase465"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase465", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< FlowTestCase465Actor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" +static Future flowTestCase465( UnitTestParameters const& params ) { + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" + return Future(new FlowTestCase465Actor(params)); + #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase465, "/fdbrpc/authz/TokenCache/GoodTokens") + +#line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/TokenCache.actor.cpp" diff --git a/src/fdbrpc/TokenSign.cpp b/src/fdbrpc/TokenSign.cpp new file mode 100644 index 0000000..e5dfbbf --- /dev/null +++ b/src/fdbrpc/TokenSign.cpp @@ -0,0 +1,714 @@ +/* + * TokenSign.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "fdbrpc/TokenSign.h" +#include "flow/network.h" +#include "flow/serialize.h" +#include "flow/Arena.h" +#include "flow/AutoCPointer.h" +#include "flow/Error.h" +#include "flow/IRandom.h" +#include "flow/MkCert.h" +#include "flow/Platform.h" +#include "flow/ScopeExit.h" +#include "flow/Trace.h" +#include "flow/UnitTest.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "fdbrpc/Base64Encode.h" +#include "fdbrpc/Base64Decode.h" + +namespace { + +// test-only constants for generating random tenant ID and key names +constexpr int MinIssuerNameLen = 16; +constexpr int MaxIssuerNameLenPlus1 = 25; +constexpr authz::TenantId MinTenantId = 1; +constexpr authz::TenantId MaxTenantIdPlus1 = 0xffffffffll; +constexpr int MinKeyNameLen = 10; +constexpr int MaxKeyNameLenPlus1 = 21; + +StringRef genRandomAlphanumStringRef(Arena& arena, IRandom& rng, int minLen, int maxLenPlusOne) { + const auto len = rng.randomInt(minLen, maxLenPlusOne); + auto strRaw = new (arena) uint8_t[len]; + for (auto i = 0; i < len; i++) + strRaw[i] = (uint8_t)rng.randomAlphaNumeric(); + return StringRef(strRaw, len); +} + +Optional checkVerifyAlgorithm(PKeyAlgorithm algo, PublicKey key) { + if (algo != key.algorithm()) { + return "Token algorithm does not match key's"_sr; + } else { + return {}; + } +} + +bool checkSignAlgorithm(PKeyAlgorithm algo, PrivateKey key) { + if (algo != key.algorithm()) { + TraceEvent(SevWarnAlways, "TokenSignAlgoMismatch") + .suppressFor(10) + .detail("Expected", pkeyAlgorithmName(algo)) + .detail("PublicKeyAlgorithm", key.algorithmName()); + return false; + } else { + return true; + } +} + +Optional convertEs256P1363ToDer(Arena& arena, StringRef p1363) { + const int SIGLEN = p1363.size(); + const int HALF_SIGLEN = SIGLEN / 2; + auto r = AutoCPointer(BN_bin2bn(p1363.begin(), HALF_SIGLEN, nullptr), &::BN_free); + auto s = AutoCPointer(BN_bin2bn(p1363.begin() + HALF_SIGLEN, HALF_SIGLEN, nullptr), &::BN_free); + if (!r || !s) + return {}; + auto sig = AutoCPointer(::ECDSA_SIG_new(), &ECDSA_SIG_free); + if (!sig) + return {}; + ::ECDSA_SIG_set0(sig, r.release(), s.release()); + auto const derLen = ::i2d_ECDSA_SIG(sig, nullptr); + if (derLen < 0) + return {}; + auto buf = new (arena) uint8_t[derLen]; + auto bufPtr = buf; + ::i2d_ECDSA_SIG(sig, &bufPtr); + return StringRef(buf, derLen); +} + +Optional convertEs256DerToP1363(Arena& arena, StringRef der) { + uint8_t const* derPtr = der.begin(); + auto sig = AutoCPointer(::d2i_ECDSA_SIG(nullptr, &derPtr, der.size()), &::ECDSA_SIG_free); + if (!sig) { + return {}; + } + // ES256-specific constant. Adapt as needed + constexpr const int SIGLEN = 64; + constexpr const int HALF_SIGLEN = SIGLEN / 2; + auto buf = new (arena) uint8_t[SIGLEN]; + ::memset(buf, 0, SIGLEN); + auto bufr = buf; + auto bufs = bufr + HALF_SIGLEN; + auto r = std::add_pointer_t(); + auto s = std::add_pointer_t(); + ECDSA_SIG_get0(sig, &r, &s); + auto const lenr = BN_num_bytes(r); + auto const lens = BN_num_bytes(s); + if (lenr > HALF_SIGLEN || lens > HALF_SIGLEN) + return {}; + BN_bn2bin(r, bufr + (HALF_SIGLEN - lenr)); + BN_bn2bin(s, bufs + (HALF_SIGLEN - lens)); + return StringRef(buf, SIGLEN); +} + +} // namespace + +namespace authz { + +using MessageDigestMethod = const EVP_MD*; + +std::pair getMethod(Algorithm alg) { + if (alg == Algorithm::RS256) { + return { PKeyAlgorithm::RSA, ::EVP_sha256() }; + } else if (alg == Algorithm::ES256) { + return { PKeyAlgorithm::EC, ::EVP_sha256() }; + } else { + return { PKeyAlgorithm::UNSUPPORTED, nullptr }; + } +} + +std::string_view getAlgorithmName(Algorithm alg) { + if (alg == Algorithm::RS256) + return { "RS256" }; + else if (alg == Algorithm::ES256) + return { "ES256" }; + else + UNREACHABLE(); +} + +} // namespace authz + +namespace authz::jwt { + +template +void appendField(fmt::memory_buffer& b, char const (&name)[NameLen], Optional const& field) { + if (!field.present()) + return; + auto const& f = field.get(); + auto bi = std::back_inserter(b); + if constexpr (std::is_same_v>) { + fmt::format_to(bi, " {}=[", name); + for (auto i = 0; i < f.size(); i++) { + if (i) + fmt::format_to(bi, ","); + fmt::format_to(bi, fmt::runtime(f[i].toStringView())); + } + fmt::format_to(bi, "]"); + } else if constexpr (std::is_same_v>) { + fmt::format_to(bi, " {}=[", name); + for (auto i = 0; i < f.size(); i++) { + if (i) + fmt::format_to(bi, ","); + fmt::format_to(bi, "{:#x}", f[i]); + } + fmt::format_to(bi, "]"); + } else if constexpr (std::is_same_v) { + fmt::format_to(bi, " {}={}", name, f.toStringView()); + } else { + fmt::format_to(bi, " {}={}", name, f); + } +} + +StringRef toStringRef(Arena& arena, const TokenRef& tokenSpec) { + auto buf = fmt::memory_buffer(); + fmt::format_to(std::back_inserter(buf), + "alg={} kid={}", + getAlgorithmName(tokenSpec.algorithm), + tokenSpec.keyId.toStringView()); + appendField(buf, "iss", tokenSpec.issuer); + appendField(buf, "sub", tokenSpec.subject); + appendField(buf, "aud", tokenSpec.audience); + appendField(buf, "iat", tokenSpec.issuedAtUnixTime); + appendField(buf, "exp", tokenSpec.expiresAtUnixTime); + appendField(buf, "nbf", tokenSpec.notBeforeUnixTime); + appendField(buf, "jti", tokenSpec.tokenId); + appendField(buf, "tenants", tokenSpec.tenants); + auto str = new (arena) uint8_t[buf.size()]; + memcpy(str, buf.data(), buf.size()); + return StringRef(str, buf.size()); +} + +template +void putField(Optional const& field, + Writer& wr, + const char* fieldName, + std::bool_constant _ = std::bool_constant{}) { + if (!field.present()) + return; + wr.Key(fieldName); + auto const& value = field.get(); + static_assert(std::is_same_v || std::is_same_v || + std::is_same_v> || std::is_same_v>); + if constexpr (std::is_same_v) { + wr.String(reinterpret_cast(value.begin()), value.size()); + } else if constexpr (std::is_same_v) { + wr.Uint64(value); + } else if constexpr (std::is_same_v>) { + // "tenants" array = array of base64-encoded tenant key prefix + // key prefix = bytestring representation of big-endian tenant ID (int64_t) + Arena arena; + wr.StartArray(); + for (auto elem : value) { + auto const bigEndianId = bigEndian64(elem); + auto encodedElem = + base64::encode(arena, StringRef(reinterpret_cast(&bigEndianId), sizeof(bigEndianId))); + wr.String(reinterpret_cast(encodedElem.begin()), encodedElem.size()); + } + wr.EndArray(); + } else { + // VectorRef case + if constexpr (AllowSingletonArrayAsString) { + if (value.size() == 1 && deterministicRandom()->coinflip()) { + // randomly make the field string, not array, to test parsing behavior + wr.String(reinterpret_cast(value[0].begin()), value[0].size()); + return; + } + } + wr.StartArray(); + for (auto elem : value) { + wr.String(reinterpret_cast(elem.begin()), elem.size()); + } + wr.EndArray(); + } +} + +StringRef makeSignInput(Arena& arena, const TokenRef& tokenSpec) { + using Buffer = rapidjson::StringBuffer; + using Writer = rapidjson::Writer; + auto headerBuffer = Buffer(); + auto payloadBuffer = Buffer(); + auto header = Writer(headerBuffer); + auto payload = Writer(payloadBuffer); + header.StartObject(); + header.Key("typ"); + header.String("JWT"); + auto algo = getAlgorithmName(tokenSpec.algorithm); + header.Key("alg"); + header.String(algo.data(), algo.size()); + auto kid = tokenSpec.keyId.toStringView(); + header.Key("kid"); + header.String(kid.data(), kid.size()); + header.EndObject(); + payload.StartObject(); + putField(tokenSpec.issuer, payload, "iss"); + putField(tokenSpec.subject, payload, "sub"); + putField(tokenSpec.audience, payload, "aud", std::bool_constant{}); + putField(tokenSpec.issuedAtUnixTime, payload, "iat"); + putField(tokenSpec.expiresAtUnixTime, payload, "exp"); + putField(tokenSpec.notBeforeUnixTime, payload, "nbf"); + putField(tokenSpec.tokenId, payload, "jti"); + putField(tokenSpec.tenants, payload, "tenants"); + payload.EndObject(); + auto const headerPartLen = base64::url::encodedLength(headerBuffer.GetSize()); + auto const payloadPartLen = base64::url::encodedLength(payloadBuffer.GetSize()); + auto const totalLen = headerPartLen + 1 + payloadPartLen; + auto out = new (arena) uint8_t[totalLen]; + auto cur = out; + cur += base64::url::encode(reinterpret_cast(headerBuffer.GetString()), headerBuffer.GetSize(), cur); + ASSERT_EQ(cur - out, headerPartLen); + *cur++ = '.'; + cur += + base64::url::encode(reinterpret_cast(payloadBuffer.GetString()), payloadBuffer.GetSize(), cur); + ASSERT_EQ(cur - out, totalLen); + return StringRef(out, totalLen); +} + +StringRef signToken(Arena& arena, StringRef signInput, Algorithm algorithm, PrivateKey privateKey) { + auto tmpArena = Arena(); + auto [signAlgo, digest] = getMethod(algorithm); + if (!checkSignAlgorithm(signAlgo, privateKey)) { + throw digital_signature_ops_error(); + } + auto plainSig = privateKey.sign(tmpArena, signInput, *digest); + if (algorithm == Algorithm::ES256) { + // Need to convert ASN.1/DER signature to IEEE-P1363 + auto convertedSig = convertEs256DerToP1363(tmpArena, plainSig); + if (!convertedSig.present()) { + auto tmpArena = Arena(); + TraceEvent(SevWarn, "TokenSigConversionFailure").log(); + throw digital_signature_ops_error(); + } + plainSig = convertedSig.get(); + } + auto const sigPartLen = base64::url::encodedLength(plainSig.size()); + auto const totalLen = signInput.size() + 1 + sigPartLen; + auto out = new (arena) uint8_t[totalLen]; + auto cur = out; + ::memcpy(cur, signInput.begin(), signInput.size()); + cur += signInput.size(); + *cur++ = '.'; + cur += base64::url::encode(plainSig.begin(), plainSig.size(), cur); + ASSERT_EQ(cur - out, totalLen); + return StringRef(out, totalLen); +} + +StringRef signToken(Arena& arena, const TokenRef& tokenSpec, PrivateKey privateKey) { + auto tmpArena = Arena(); + auto signInput = makeSignInput(tmpArena, tokenSpec); + return signToken(arena, signInput, tokenSpec.algorithm, privateKey); +} + +Optional parseHeaderPart(Arena& arena, TokenRef& token, StringRef b64urlHeader) { + auto tmpArena = Arena(); + auto optHeader = base64::url::decode(tmpArena, b64urlHeader); + if (!optHeader.present()) + return "Failed to decode base64 header"_sr; + auto header = optHeader.get(); + auto d = rapidjson::Document(); + d.Parse(reinterpret_cast(header.begin()), header.size()); + if (d.HasParseError()) { + return "Failed to parse header as JSON"_sr; + } + if (!d.IsObject()) + return "Header is not a JSON object"_sr; + auto typItr = d.FindMember("typ"); + if (typItr == d.MemberEnd() || !typItr->value.IsString()) + return "No 'typ' field"_sr; + auto algItr = d.FindMember("alg"); + if (algItr == d.MemberEnd() || !algItr->value.IsString()) + return "No 'alg' field"_sr; + auto kidItr = d.FindMember("kid"); + if (kidItr == d.MemberEnd() || !kidItr->value.IsString()) + return "No 'kid' field"_sr; + auto const& typ = typItr->value; + auto const& alg = algItr->value; + auto const& kid = kidItr->value; + auto typValue = StringRef(reinterpret_cast(typ.GetString()), typ.GetStringLength()); + if (typValue != "JWT"_sr) + return "'typ' is not 'JWT'"_sr; + auto algValue = StringRef(reinterpret_cast(alg.GetString()), alg.GetStringLength()); + auto algType = algorithmFromString(algValue.toStringView()); + if (algType == Algorithm::UNKNOWN) + return "Unsupported algorithm"_sr; + token.algorithm = algType; + token.keyId = StringRef(arena, reinterpret_cast(kid.GetString()), kid.GetStringLength()); + return {}; +} + +template +Optional parseField(Arena& arena, + Optional& out, + const rapidjson::Document& d, + const char* fieldName, + std::bool_constant _ = std::bool_constant{}) { + auto fieldItr = d.FindMember(fieldName); + if (fieldItr == d.MemberEnd()) + return {}; + auto const& field = fieldItr->value; + static_assert(std::is_same_v || std::is_same_v || + std::is_same_v> || std::is_same_v>); + if constexpr (std::is_same_v) { + if (!field.IsString()) { + return StringRef(arena, fmt::format("'{}' is not a string", fieldName)); + } + out = StringRef(arena, reinterpret_cast(field.GetString()), field.GetStringLength()); + } else if constexpr (std::is_same_v) { + if (!field.IsNumber()) { + return StringRef(arena, fmt::format("'{}' is not a number", fieldName)); + } + auto const number = field.GetDouble(); + if (number < 0) { + return StringRef(arena, fmt::format("negative '{}' value is not allowed", fieldName)); + } + out = static_cast(number); + } else if constexpr (std::is_same_v>) { + if constexpr (AllowStringAsSingletonArray) { + if (field.IsString()) { + auto vector = new (arena) StringRef[1]; + vector[0] = + StringRef(arena, reinterpret_cast(field.GetString()), field.GetStringLength()); + out = VectorRef(vector, 1); + CODE_PROBE(true, "Interpret authorization token's claim value string as a singleton array"); + return {}; + } else if (!field.IsArray()) { + return StringRef(arena, fmt::format("'{}' is not an array or a string", fieldName)); + } + } else if (!field.IsArray()) { + return StringRef(arena, fmt::format("'{}' is not an array", fieldName)); + } + if (field.Size() > 0) { + auto vector = new (arena) StringRef[field.Size()]; + for (auto i = 0; i < field.Size(); i++) { + if (!field[i].IsString()) { + return StringRef(arena, fmt::format("{}th element of '{}' is not a string", i + 1, fieldName)); + } + vector[i] = StringRef( + arena, reinterpret_cast(field[i].GetString()), field[i].GetStringLength()); + } + out = VectorRef(vector, field.Size()); + } else { + out = VectorRef(); + } + } else { + // tenant ids case: convert array of base64-encoded length-8 bytestring containing big-endian int64_t to + // local-endian int64_t + if (!field.IsArray()) { + return StringRef(arena, fmt::format("'{}' is not an array", fieldName)); + } + if (field.Size() > 0) { + auto vector = new (arena) TenantId[field.Size()]; + for (auto i = 0; i < field.Size(); i++) { + if (!field[i].IsString()) { + return StringRef(arena, fmt::format("{}th element of '{}' is not a string", i + 1, fieldName)); + } + Optional decodedString = base64::decode( + arena, + StringRef(reinterpret_cast(field[i].GetString()), field[i].GetStringLength())); + if (decodedString.present()) { + auto const tenantPrefix = decodedString.get(); + if (tenantPrefix.size() != sizeof(TenantId)) { + CODE_PROBE(true, "Tenant prefix has an invalid length"); + return StringRef(arena, + fmt::format("{}th element of '{}' has an invalid bytewise length of {}", + i + 1, + fieldName, + tenantPrefix.size())); + } + TenantId tenantId = *reinterpret_cast(tenantPrefix.begin()); + vector[i] = fromBigEndian64(tenantId); + } else { + CODE_PROBE(true, "Tenant field has failed to be parsed"); + return StringRef(arena, + fmt::format("Failed to base64-decode {}th element of '{}'", i + 1, fieldName)); + } + } + out = VectorRef(vector, field.Size()); + } else { + out = VectorRef(); + } + } + return {}; +} + +Optional parsePayloadPart(Arena& arena, TokenRef& token, StringRef b64urlPayload) { + auto tmpArena = Arena(); + auto optPayload = base64::url::decode(tmpArena, b64urlPayload); + if (!optPayload.present()) + return "Failed to base64-decode payload part"_sr; + auto payload = optPayload.get(); + auto d = rapidjson::Document(); + d.Parse(reinterpret_cast(payload.begin()), payload.size()); + if (d.HasParseError()) { + return "Token payload part is not valid JSON"_sr; + } + if (!d.IsObject()) + return "Token payload is not a JSON object"_sr; + Optional err; + if ((err = parseField(arena, token.issuer, d, "iss")).present()) + return err; + if ((err = parseField(arena, token.subject, d, "sub")).present()) + return err; + if ((err = parseField(arena, token.audience, d, "aud", std::bool_constant{})).present()) + return err; + if ((err = parseField(arena, token.tokenId, d, "jti")).present()) + return err; + if ((err = parseField(arena, token.issuedAtUnixTime, d, "iat")).present()) + return err; + if ((err = parseField(arena, token.expiresAtUnixTime, d, "exp")).present()) + return err; + if ((err = parseField(arena, token.notBeforeUnixTime, d, "nbf")).present()) + return err; + if ((err = parseField(arena, token.tenants, d, "tenants")).present()) + return err; + return {}; +} + +Optional parseSignaturePart(Arena& arena, TokenRef& token, StringRef b64urlSignature) { + auto optSig = base64::url::decode(arena, b64urlSignature); + if (!optSig.present()) + return "Failed to base64url-decode signature part"_sr; + token.signature = optSig.get(); + return {}; +} + +Optional parseToken(Arena& arena, + StringRef signedTokenIn, + TokenRef& parsedTokenOut, + StringRef& signInputOut) { + signInputOut = StringRef(); + auto fullToken = signedTokenIn; + auto b64urlHeader = signedTokenIn.eat("."_sr); + auto b64urlPayload = signedTokenIn.eat("."_sr); + auto b64urlSignature = signedTokenIn; + if (b64urlHeader.empty() || b64urlPayload.empty() || b64urlSignature.empty()) + return "Token does not follow header.payload.signature structure"_sr; + signInputOut = fullToken.substr(0, b64urlHeader.size() + 1 + b64urlPayload.size()); + auto err = Optional(); + if ((err = parseHeaderPart(arena, parsedTokenOut, b64urlHeader)).present()) + return err; + if ((err = parsePayloadPart(arena, parsedTokenOut, b64urlPayload)).present()) + return err; + if ((err = parseSignaturePart(arena, parsedTokenOut, b64urlSignature)).present()) + return err; + return err; +} + +std::pair> verifyToken(StringRef signInput, + const TokenRef& parsedToken, + PublicKey publicKey) { + Arena tmpArena; + Optional err; + auto [verifyAlgo, digest] = getMethod(parsedToken.algorithm); + if ((err = checkVerifyAlgorithm(verifyAlgo, publicKey)).present()) + return { false, err }; + auto sig = parsedToken.signature; + if (parsedToken.algorithm == Algorithm::ES256) { + // Need to convert IEEE-P1363 signature to ASN.1/DER + auto convertedSig = convertEs256P1363ToDer(tmpArena, sig); + if (!convertedSig.present() || convertedSig.get().empty()) { + err = "Failed to convert signature for verification"_sr; + return { false, err }; + } + sig = convertedSig.get(); + } + return { publicKey.verify(signInput, sig, *digest), err }; +} + +std::pair> verifyToken(StringRef signedToken, PublicKey publicKey) { + auto arena = Arena(); + auto fullToken = signedToken; + auto b64urlHeader = signedToken.eat("."_sr); + auto b64urlPayload = signedToken.eat("."_sr); + auto b64urlSignature = signedToken; + auto err = Optional(); + if (b64urlHeader.empty() || b64urlPayload.empty() || b64urlSignature.empty()) { + err = "Token does not follow header.payload.signature structure"_sr; + return { false, err }; + } + auto signInput = fullToken.substr(0, b64urlHeader.size() + 1 + b64urlPayload.size()); + auto parsedToken = TokenRef(); + if ((err = parseHeaderPart(arena, parsedToken, b64urlHeader)).present()) + return { false, err }; + auto optSig = base64::url::decode(arena, b64urlSignature); + if (!optSig.present()) { + err = "Failed to base64url-decode signature part"_sr; + return { false, err }; + } + parsedToken.signature = optSig.get(); + return verifyToken(signInput, parsedToken, publicKey); +} + +TokenRef makeRandomTokenSpec(Arena& arena, IRandom& rng, Algorithm alg) { + auto ret = TokenRef{}; + ret.algorithm = alg; + ret.keyId = genRandomAlphanumStringRef(arena, rng, MinKeyNameLen, MaxKeyNameLenPlus1); + ret.issuer = genRandomAlphanumStringRef(arena, rng, MinIssuerNameLen, MaxIssuerNameLenPlus1); + ret.subject = genRandomAlphanumStringRef(arena, rng, MinIssuerNameLen, MaxIssuerNameLenPlus1); + ret.tokenId = genRandomAlphanumStringRef(arena, rng, 16, 31); + auto numAudience = rng.randomInt(1, 5); + auto aud = new (arena) StringRef[numAudience]; + for (auto i = 0; i < numAudience; i++) + aud[i] = genRandomAlphanumStringRef(arena, rng, MinIssuerNameLen, MaxIssuerNameLenPlus1); + ret.audience = VectorRef(aud, numAudience); + ret.issuedAtUnixTime = g_network->timer(); + ret.notBeforeUnixTime = ret.issuedAtUnixTime.get(); + ret.expiresAtUnixTime = ret.issuedAtUnixTime.get() + rng.randomInt(360, 1080 + 1); + auto numTenants = rng.randomInt(1, 3); + auto tenants = new (arena) TenantId[numTenants]; + for (auto i = 0; i < numTenants; i++) + tenants[i] = rng.randomInt64(MinTenantId, MaxTenantIdPlus1); + ret.tenants = VectorRef(tenants, numTenants); + return ret; +} + +} // namespace authz::jwt + +void forceLinkTokenSignTests() {} + +TEST_CASE("/fdbrpc/TokenSign/JWT") { + const auto numIters = 100; + for (auto i = 0; i < numIters; i++) { + auto arena = Arena(); + auto privateKey = mkcert::makeEcP256(); + auto publicKey = privateKey.toPublic(); + auto& rng = *deterministicRandom(); + auto tokenSpec = authz::jwt::makeRandomTokenSpec(arena, rng, authz::Algorithm::ES256); + auto signedToken = authz::jwt::signToken(arena, tokenSpec, privateKey); + auto verifyOk = false; + auto verifyErr = Optional(); + std::tie(verifyOk, verifyErr) = authz::jwt::verifyToken(signedToken, publicKey); + ASSERT(!verifyErr.present()); + ASSERT(verifyOk); + auto signaturePart = signedToken; + signaturePart.eat("."_sr); + signaturePart.eat("."_sr); + { + auto tmpArena = Arena(); + auto parsedToken = authz::jwt::TokenRef{}; + auto signInput = StringRef(); + auto parseError = parseToken(tmpArena, signedToken, parsedToken, signInput); + ASSERT(!parseError.present()); + ASSERT_EQ(tokenSpec.algorithm, parsedToken.algorithm); + ASSERT_EQ(tokenSpec.issuer, parsedToken.issuer); + ASSERT_EQ(tokenSpec.subject, parsedToken.subject); + ASSERT_EQ(tokenSpec.tokenId, parsedToken.tokenId); + ASSERT_EQ(tokenSpec.audience, parsedToken.audience); + ASSERT_EQ(tokenSpec.keyId, parsedToken.keyId); + ASSERT_EQ(tokenSpec.issuedAtUnixTime.get(), parsedToken.issuedAtUnixTime.get()); + ASSERT_EQ(tokenSpec.expiresAtUnixTime.get(), parsedToken.expiresAtUnixTime.get()); + ASSERT_EQ(tokenSpec.notBeforeUnixTime.get(), parsedToken.notBeforeUnixTime.get()); + ASSERT_EQ(tokenSpec.tenants, parsedToken.tenants); + auto optSig = base64::url::decode(tmpArena, signaturePart); + ASSERT(optSig.present()); + ASSERT_EQ(optSig.get(), parsedToken.signature); + std::tie(verifyOk, verifyErr) = authz::jwt::verifyToken(signInput, parsedToken, publicKey); + ASSERT(!verifyErr.present()); + ASSERT(verifyOk); + } + // try tampering with signed token by adding one more tenant + tokenSpec.tenants.get().push_back(arena, rng.randomInt64(MinTenantId, MaxTenantIdPlus1)); + auto tamperedTokenPart = makeSignInput(arena, tokenSpec); + auto tamperedTokenString = fmt::format("{}.{}", tamperedTokenPart.toString(), signaturePart.toString()); + std::tie(verifyOk, verifyErr) = authz::jwt::verifyToken(StringRef(tamperedTokenString), publicKey); + ASSERT(!verifyErr.present()); + ASSERT(!verifyOk); + } + printf("%d runs OK\n", numIters); + return Void(); +} + +TEST_CASE("/fdbrpc/TokenSign/JWT/ToStringRef") { + auto t = authz::jwt::TokenRef(); + t.algorithm = authz::Algorithm::ES256; + t.issuer = "issuer"_sr; + t.subject = "subject"_sr; + StringRef aud[3]{ "aud1"_sr, "aud2"_sr, "aud3"_sr }; + t.audience = VectorRef(aud, 3); + t.issuedAtUnixTime = 123ul; + t.expiresAtUnixTime = 456ul; + t.notBeforeUnixTime = 789ul; + t.keyId = "keyId"_sr; + t.tokenId = "tokenId"_sr; + authz::TenantId tenants[2]{ 0x1ll, 0xabcdefabcdefll }; + t.tenants = VectorRef(tenants, 2); + auto arena = Arena(); + auto tokenStr = toStringRef(arena, t); + auto tokenStrExpected = + "alg=ES256 kid=keyId iss=issuer sub=subject aud=[aud1,aud2,aud3] iat=123 exp=456 nbf=789 jti=tokenId tenants=[0x1,0xabcdefabcdef]"_sr; + if (tokenStr != tokenStrExpected) { + fmt::print("Expected: {}\nGot : {}\n", tokenStrExpected.toStringView(), tokenStr.toStringView()); + ASSERT(false); + } else { + fmt::print("TEST OK\n"); + } + return Void(); +} + +TEST_CASE("/fdbrpc/TokenSign/bench") { + auto keyTypes = std::array{ "EC"_sr }; + for (auto kty : keyTypes) { + constexpr auto repeat = 5; + constexpr auto numSamples = 10000; + fmt::print("=== {} keys case\n", kty.toString()); + auto key = kty == "EC"_sr ? mkcert::makeEcP256() : mkcert::makeRsa4096Bit(); + auto pubKey = key.toPublic(); + auto& rng = *deterministicRandom(); + auto arena = Arena(); + auto jwtSpecs = new (arena) authz::jwt::TokenRef[numSamples]; + auto jwts = new (arena) StringRef[numSamples]; + for (auto i = 0; i < numSamples; i++) { + jwtSpecs[i] = authz::jwt::makeRandomTokenSpec( + arena, rng, kty == "EC"_sr ? authz::Algorithm::ES256 : authz::Algorithm::RS256); + } + { + auto const jwtSignBegin = timer_monotonic(); + for (auto i = 0; i < numSamples; i++) { + jwts[i] = authz::jwt::signToken(arena, jwtSpecs[i], key); + } + auto const jwtSignEnd = timer_monotonic(); + fmt::print("JWT Sign : {:.2f} OPS\n", numSamples / (jwtSignEnd - jwtSignBegin)); + } + { + auto const jwtVerifyBegin = timer_monotonic(); + for (auto rep = 0; rep < repeat; rep++) { + for (auto i = 0; i < numSamples; i++) { + auto [verifyOk, errorMsg] = authz::jwt::verifyToken(jwts[i], pubKey); + ASSERT(!errorMsg.present()); + ASSERT(verifyOk); + } + } + auto const jwtVerifyEnd = timer_monotonic(); + fmt::print("JWT Verify : {:.2f} OPS\n", repeat * numSamples / (jwtVerifyEnd - jwtVerifyBegin)); + } + } + return Void(); +} diff --git a/src/fdbrpc/dsltest.actor.cpp b/src/fdbrpc/dsltest.actor.cpp index 34c06ba..8857f89 100644 --- a/src/fdbrpc/dsltest.actor.cpp +++ b/src/fdbrpc/dsltest.actor.cpp @@ -649,9 +649,9 @@ void arenaTest() { { Arena arena; VectorRef test; - test.push_back(arena, StringRef(arena, LiteralStringRef("Hello"))); - test.push_back(arena, StringRef(arena, LiteralStringRef(", "))); - test.push_back(arena, StringRef(arena, LiteralStringRef("World!"))); + test.push_back(arena, StringRef(arena, "Hello"_sr)); + test.push_back(arena, StringRef(arena, ", "_sr)); + test.push_back(arena, StringRef(arena, "World!"_sr)); for (auto i = test.begin(); i != test.end(); ++i) for (auto j = i->begin(); j != i->end(); ++j) @@ -1210,8 +1210,8 @@ void dsltest() { actorTest1(true); actorTest2(true); actorTest3(true); - // if (g_network == &g_simulator) - // g_simulator.run( actorTest4(true) ); + // if (g_network == g_simulator) + // g_simulator->run( actorTest4(true) ); actorTest5(); actorTest6(); actorTest7(); diff --git a/src/fdbrpc/dsltest.actor.g.cpp b/src/fdbrpc/dsltest.actor.g.cpp index 5561264..c31e4ea 100644 --- a/src/fdbrpc/dsltest.actor.g.cpp +++ b/src/fdbrpc/dsltest.actor.g.cpp @@ -2014,9 +2014,9 @@ void arenaTest() { { Arena arena; VectorRef test; - test.push_back(arena, StringRef(arena, LiteralStringRef("Hello"))); - test.push_back(arena, StringRef(arena, LiteralStringRef(", "))); - test.push_back(arena, StringRef(arena, LiteralStringRef("World!"))); + test.push_back(arena, StringRef(arena, "Hello"_sr)); + test.push_back(arena, StringRef(arena, ", "_sr)); + test.push_back(arena, StringRef(arena, "World!"_sr)); for (auto i = test.begin(); i != test.end(); ++i) for (auto j = i->begin(); j != i->end(); ++j) @@ -7529,8 +7529,8 @@ void dsltest() { actorTest1(true); actorTest2(true); actorTest3(true); - // if (g_network == &g_simulator) - // g_simulator.run( actorTest4(true) ); + // if (g_network == g_simulator) + // g_simulator->run( actorTest4(true) ); actorTest5(); actorTest6(); actorTest7(); diff --git a/src/fdbrpc/ActorFuzz.h b/src/fdbrpc/include/fdbrpc/ActorFuzz.h similarity index 85% rename from src/fdbrpc/ActorFuzz.h rename to src/fdbrpc/include/fdbrpc/ActorFuzz.h index 996f515..3974e4b 100644 --- a/src/fdbrpc/ActorFuzz.h +++ b/src/fdbrpc/include/fdbrpc/ActorFuzz.h @@ -25,11 +25,16 @@ inline void throw_operation_failed() { throw operation_failed(); } - +#ifdef OPEN_FOR_IDE +bool testFuzzActor(Future (*actor)(FutureStream, PromiseStream, Future), + const char* desc, + std::vector const& expectedOutput); +#else // This is in dsltest.actor.cpp: bool testFuzzActor(Future (*actor)(FutureStream const&, PromiseStream const&, Future const&), const char* desc, std::vector const& expectedOutput); +#endif // This is defined by ActorFuzz.actor.cpp (generated by actorFuzz.py) // Returns (tests passed, tests total) diff --git a/src/fdbrpc/AsyncFileCached.actor.g.h b/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h similarity index 81% rename from src/fdbrpc/AsyncFileCached.actor.g.h rename to src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h index 8cc55b9..4ca15e9 100644 --- a/src/fdbrpc/AsyncFileCached.actor.g.h +++ b/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" /* * AsyncFileCached.actor.h * @@ -34,7 +34,7 @@ #include #include "flow/flow.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/Knobs.h" #include "flow/TDMetric.actor.h" #include "flow/network.h" @@ -75,7 +75,7 @@ struct EvictablePageCache : ReferenceCounted { explicit EvictablePageCache(int pageSize, int64_t maxSize) : pageSize(pageSize), maxPages(maxSize / pageSize), cacheEvictionType(evictionPolicyStringToEnum(FLOW_KNOBS->CACHE_EVICTION_POLICY)) { - cacheEvictions.init(LiteralStringRef("EvictablePageCache.CacheEvictions")); + cacheEvictions.init("EvictablePageCache.CacheEvictions"_sr); } void allocate(EvictablePage* page) { @@ -179,26 +179,26 @@ class AsyncFileCached final : public IAsyncFile, public ReferenceCounted - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class Write_implActorState { - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Write_implActorState(AsyncFileCached* const& self,void const* const& data,int const& length,int64_t const& offset) - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" : self(self), - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" data(data), - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" length(length), - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" offset(offset) - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { fdb_probe_actor_create("write_impl", reinterpret_cast(this)); @@ -211,20 +211,20 @@ class Write_implActorState { int a_body1(int loopDepth=0) { try { - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (length + offset > self->currentTruncateSize) - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_0 = self->currentTruncate; - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; } else @@ -250,32 +250,32 @@ class Write_implActorState { } int a_body1cont1(int loopDepth) { - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" ++self->countFileCacheWrites; - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" ++self->countCacheWrites; - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Future f = read_write_impl(self, static_cast(data), length, offset); - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!f.isReady()) - #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" ++self->countFileCacheWritesBlocked; - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" ++self->countCacheWritesBlocked; - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_1 = f; - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; return loopDepth; @@ -357,9 +357,9 @@ class Write_implActorState { } int a_body1cont3(Void const& _,int loopDepth) { - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Write_implActorState(); static_cast(this)->destroy(); return 0; } - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Write_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -369,9 +369,9 @@ class Write_implActorState { } int a_body1cont3(Void && _,int loopDepth) { - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Write_implActorState(); static_cast(this)->destroy(); return 0; } - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Write_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -442,20 +442,20 @@ class Write_implActorState { fdb_probe_actor_exit("write_impl", reinterpret_cast(this), 1); } - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" AsyncFileCached* self; - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" void const* data; - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" int length; - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" int64_t offset; - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" }; // This generated class is to be used only via write_impl() - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class Write_implActor final : public Actor, public ActorCallback< Write_implActor, 0, Void >, public ActorCallback< Write_implActor, 1, Void >, public FastAllocated, public Write_implActorState { - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -465,9 +465,9 @@ class Write_implActor final : public Actor, public ActorCallback< Write_im #pragma clang diagnostic pop friend struct ActorCallback< Write_implActor, 0, Void >; friend struct ActorCallback< Write_implActor, 1, Void >; - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Write_implActor(AsyncFileCached* const& self,void const* const& data,int const& length,int64_t const& offset) - #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" : Actor(), Write_implActorState(self, data, length, offset) { @@ -491,14 +491,14 @@ friend struct ActorCallback< Write_implActor, 1, Void >; } }; - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" [[nodiscard]] static Future write_impl( AsyncFileCached* const& self, void const* const& data, int const& length, int64_t const& offset ) { - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" return Future(new Write_implActor(self, data, length, offset)); - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } -#line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" +#line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Future write(void const* data, int length, int64_t offset) override { return write_impl(this, data, length, offset); @@ -515,22 +515,22 @@ friend struct ActorCallback< Write_implActor, 1, Void >; // This wrapper for the actual truncation operation enforces ordering of truncates. // It maintains currentTruncate and currentTruncateSize so writers can wait behind truncates that would affect them. - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" // This generated class is to be used only via truncate_impl() - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" template - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class Truncate_implActorState { - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Truncate_implActorState(AsyncFileCached* const& self,int64_t const& size) - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" : self(self), - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" size(size) - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { fdb_probe_actor_create("truncate_impl", reinterpret_cast(this)); @@ -543,16 +543,16 @@ class Truncate_implActorState { int a_body1(int loopDepth=0) { try { - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_0 = self->currentTruncate; - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -573,40 +573,40 @@ class Truncate_implActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" self->currentTruncateSize = size; - #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" self->currentTruncate = self->changeFileSize(size); - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_1 = self->currentTruncate; - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" self->currentTruncateSize = size; - #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" self->currentTruncate = self->changeFileSize(size); - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_1 = self->currentTruncate; - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; return loopDepth; @@ -676,9 +676,9 @@ class Truncate_implActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Truncate_implActorState(); static_cast(this)->destroy(); return 0; } - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Truncate_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -688,9 +688,9 @@ class Truncate_implActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Truncate_implActorState(); static_cast(this)->destroy(); return 0; } - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Truncate_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -761,16 +761,16 @@ class Truncate_implActorState { fdb_probe_actor_exit("truncate_impl", reinterpret_cast(this), 1); } - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" AsyncFileCached* self; - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" int64_t size; - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" }; // This generated class is to be used only via truncate_impl() - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class Truncate_implActor final : public Actor, public ActorCallback< Truncate_implActor, 0, Void >, public ActorCallback< Truncate_implActor, 1, Void >, public FastAllocated, public Truncate_implActorState { - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -780,9 +780,9 @@ class Truncate_implActor final : public Actor, public ActorCallback< Trunc #pragma clang diagnostic pop friend struct ActorCallback< Truncate_implActor, 0, Void >; friend struct ActorCallback< Truncate_implActor, 1, Void >; - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Truncate_implActor(AsyncFileCached* const& self,int64_t const& size) - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" : Actor(), Truncate_implActorState(self, size) { @@ -806,14 +806,14 @@ friend struct ActorCallback< Truncate_implActor, 1, Void >; } }; - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" [[nodiscard]] static Future truncate_impl( AsyncFileCached* const& self, int64_t const& size ) { - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" return Future(new Truncate_implActor(self, size)); - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } -#line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" +#line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Future sync() override { return waitAndSync(this, flush()); } @@ -902,51 +902,51 @@ friend struct ActorCallback< Truncate_implActor, 1, Void >; : filename(filename), uncached(uncached), length(length), prevLength(length), pageCache(pageCache), currentTruncate(Void()), currentTruncateSize(0), rateControl(nullptr) { if (!g_network->isSimulated()) { - countFileCacheWrites.init(LiteralStringRef("AsyncFile.CountFileCacheWrites"), filename); - countFileCacheReads.init(LiteralStringRef("AsyncFile.CountFileCacheReads"), filename); - countFileCacheWritesBlocked.init(LiteralStringRef("AsyncFile.CountFileCacheWritesBlocked"), filename); - countFileCacheReadsBlocked.init(LiteralStringRef("AsyncFile.CountFileCacheReadsBlocked"), filename); - countFileCachePageReadsHit.init(LiteralStringRef("AsyncFile.CountFileCachePageReadsHit"), filename); - countFileCachePageReadsMissed.init(LiteralStringRef("AsyncFile.CountFileCachePageReadsMissed"), filename); - countFileCachePageReadsMerged.init(LiteralStringRef("AsyncFile.CountFileCachePageReadsMerged"), filename); - countFileCacheFinds.init(LiteralStringRef("AsyncFile.CountFileCacheFinds"), filename); - countFileCacheReadBytes.init(LiteralStringRef("AsyncFile.CountFileCacheReadBytes"), filename); - - countCacheWrites.init(LiteralStringRef("AsyncFile.CountCacheWrites")); - countCacheReads.init(LiteralStringRef("AsyncFile.CountCacheReads")); - countCacheWritesBlocked.init(LiteralStringRef("AsyncFile.CountCacheWritesBlocked")); - countCacheReadsBlocked.init(LiteralStringRef("AsyncFile.CountCacheReadsBlocked")); - countCachePageReadsHit.init(LiteralStringRef("AsyncFile.CountCachePageReadsHit")); - countCachePageReadsMissed.init(LiteralStringRef("AsyncFile.CountCachePageReadsMissed")); - countCachePageReadsMerged.init(LiteralStringRef("AsyncFile.CountCachePageReadsMerged")); - countCacheFinds.init(LiteralStringRef("AsyncFile.CountCacheFinds")); - countCacheReadBytes.init(LiteralStringRef("AsyncFile.CountCacheReadBytes")); + countFileCacheWrites.init("AsyncFile.CountFileCacheWrites"_sr, filename); + countFileCacheReads.init("AsyncFile.CountFileCacheReads"_sr, filename); + countFileCacheWritesBlocked.init("AsyncFile.CountFileCacheWritesBlocked"_sr, filename); + countFileCacheReadsBlocked.init("AsyncFile.CountFileCacheReadsBlocked"_sr, filename); + countFileCachePageReadsHit.init("AsyncFile.CountFileCachePageReadsHit"_sr, filename); + countFileCachePageReadsMissed.init("AsyncFile.CountFileCachePageReadsMissed"_sr, filename); + countFileCachePageReadsMerged.init("AsyncFile.CountFileCachePageReadsMerged"_sr, filename); + countFileCacheFinds.init("AsyncFile.CountFileCacheFinds"_sr, filename); + countFileCacheReadBytes.init("AsyncFile.CountFileCacheReadBytes"_sr, filename); + + countCacheWrites.init("AsyncFile.CountCacheWrites"_sr); + countCacheReads.init("AsyncFile.CountCacheReads"_sr); + countCacheWritesBlocked.init("AsyncFile.CountCacheWritesBlocked"_sr); + countCacheReadsBlocked.init("AsyncFile.CountCacheReadsBlocked"_sr); + countCachePageReadsHit.init("AsyncFile.CountCachePageReadsHit"_sr); + countCachePageReadsMissed.init("AsyncFile.CountCachePageReadsMissed"_sr); + countCachePageReadsMerged.init("AsyncFile.CountCachePageReadsMerged"_sr); + countCacheFinds.init("AsyncFile.CountCacheFinds"_sr); + countCacheReadBytes.init("AsyncFile.CountCacheReadBytes"_sr); } } static Future> open_impl(std::string filename, int flags, int mode); // Opens a file that uses the FDB in-memory page cache - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" // This generated class is to be used only via open_impl() - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" template - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class Open_implActorState { - #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Open_implActorState(std::string const& filename,int const& flags,int const& mode,Reference const& pageCache) - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" : filename(filename), - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" flags(flags), - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" mode(mode), - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" pageCache(pageCache) - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { fdb_probe_actor_create("open_impl", reinterpret_cast(this)); @@ -960,32 +960,32 @@ class Open_implActorState { { try { try { - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" TraceEvent("AFCUnderlyingOpenBegin").detail("Filename", filename); - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (flags & IAsyncFile::OPEN_CACHED_READ_ONLY) - #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" flags = (flags & ~IAsyncFile::OPEN_READWRITE) | IAsyncFile::OPEN_READONLY; - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } else { - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" flags = (flags & ~IAsyncFile::OPEN_READONLY) | IAsyncFile::OPEN_READWRITE; - #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture> __when_expr_0 = IAsyncFileSystem::filesystem()->open( filename, flags | IAsyncFile::OPEN_UNCACHED | IAsyncFile::OPEN_UNBUFFERED, mode); - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -1013,17 +1013,17 @@ class Open_implActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (e.code() != error_code_actor_cancelled) - #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" openFiles.erase(filename); - #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } - #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" return a_body1Catch1(e, loopDepth); - #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -1035,27 +1035,27 @@ class Open_implActorState { } int a_body1cont2(int loopDepth) { - #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" TraceEvent("AFCUnderlyingOpenEnd").detail("Filename", filename); - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_1 = f->size(); - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1when1(Reference const& __f,int loopDepth) { - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" f = __f; - #line 1058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -1120,12 +1120,12 @@ class Open_implActorState { } int a_body1cont5(int64_t const& l,int loopDepth) { - #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" TraceEvent("AFCUnderlyingSize").detail("Filename", filename).detail("Size", l); - #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(new AsyncFileCached(f, filename, l, pageCache)); this->~Open_implActorState(); static_cast(this)->destroy(); return 0; } - #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" - new (&static_cast(this)->SAV< Reference >::value()) Reference(new AsyncFileCached(f, filename, l, pageCache)); + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(Reference(new AsyncFileCached(f, filename, l, pageCache)).castTo()); this->~Open_implActorState(); static_cast(this)->destroy(); return 0; } + #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" + new (&static_cast(this)->SAV< Reference >::value()) Reference(Reference(new AsyncFileCached(f, filename, l, pageCache)).castTo()); this->~Open_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -1134,12 +1134,12 @@ class Open_implActorState { } int a_body1cont5(int64_t && l,int loopDepth) { - #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" TraceEvent("AFCUnderlyingSize").detail("Filename", filename).detail("Size", l); - #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(new AsyncFileCached(f, filename, l, pageCache)); this->~Open_implActorState(); static_cast(this)->destroy(); return 0; } - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" - new (&static_cast(this)->SAV< Reference >::value()) Reference(new AsyncFileCached(f, filename, l, pageCache)); + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(Reference(new AsyncFileCached(f, filename, l, pageCache)).castTo()); this->~Open_implActorState(); static_cast(this)->destroy(); return 0; } + #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" + new (&static_cast(this)->SAV< Reference >::value()) Reference(Reference(new AsyncFileCached(f, filename, l, pageCache)).castTo()); this->~Open_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -1209,22 +1209,22 @@ class Open_implActorState { fdb_probe_actor_exit("open_impl", reinterpret_cast(this), 1); } - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" std::string filename; - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" int flags; - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" int mode; - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Reference pageCache; - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Reference f; - #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" }; // This generated class is to be used only via open_impl() - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class Open_implActor final : public Actor>, public ActorCallback< Open_implActor, 0, Reference >, public ActorCallback< Open_implActor, 1, int64_t >, public FastAllocated, public Open_implActorState { - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1234,9 +1234,9 @@ class Open_implActor final : public Actor>, public ActorCa #pragma clang diagnostic pop friend struct ActorCallback< Open_implActor, 0, Reference >; friend struct ActorCallback< Open_implActor, 1, int64_t >; - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Open_implActor(std::string const& filename,int const& flags,int const& mode,Reference const& pageCache) - #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" : Actor>(), Open_implActorState(filename, flags, mode, pageCache) { @@ -1260,35 +1260,35 @@ friend struct ActorCallback< Open_implActor, 1, int64_t >; } }; - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" [[nodiscard]] static Future> open_impl( std::string const& filename, int const& flags, int const& mode, Reference const& pageCache ) { - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" return Future>(new Open_implActor(filename, flags, mode, pageCache)); - #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } -#line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" +#line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Future flush() override; Future quiesce(); - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" // This generated class is to be used only via waitAndSync() - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" template - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class WaitAndSyncActorState { - #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" WaitAndSyncActorState(AsyncFileCached* const& self,Future const& flush) - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" : self(self), - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" flush(flush) - #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { fdb_probe_actor_create("waitAndSync", reinterpret_cast(this)); @@ -1301,16 +1301,16 @@ class WaitAndSyncActorState { int a_body1(int loopDepth=0) { try { - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_0 = flush; - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -1331,32 +1331,32 @@ class WaitAndSyncActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_1 = self->uncached->sync(); - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_1 = self->uncached->sync(); - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; return loopDepth; @@ -1426,9 +1426,9 @@ class WaitAndSyncActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitAndSyncActorState(); static_cast(this)->destroy(); return 0; } - #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitAndSyncActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1438,9 +1438,9 @@ class WaitAndSyncActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitAndSyncActorState(); static_cast(this)->destroy(); return 0; } - #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitAndSyncActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1511,16 +1511,16 @@ class WaitAndSyncActorState { fdb_probe_actor_exit("waitAndSync", reinterpret_cast(this), 1); } - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" AsyncFileCached* self; - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Future flush; - #line 1518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" }; // This generated class is to be used only via waitAndSync() - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class WaitAndSyncActor final : public Actor, public ActorCallback< WaitAndSyncActor, 0, Void >, public ActorCallback< WaitAndSyncActor, 1, Void >, public FastAllocated, public WaitAndSyncActorState { - #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1530,9 +1530,9 @@ class WaitAndSyncActor final : public Actor, public ActorCallback< WaitAnd #pragma clang diagnostic pop friend struct ActorCallback< WaitAndSyncActor, 0, Void >; friend struct ActorCallback< WaitAndSyncActor, 1, Void >; - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" WaitAndSyncActor(AsyncFileCached* const& self,Future const& flush) - #line 1535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" : Actor(), WaitAndSyncActorState(self, flush) { @@ -1556,14 +1556,14 @@ friend struct ActorCallback< WaitAndSyncActor, 1, Void >; } }; - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" [[nodiscard]] static Future waitAndSync( AsyncFileCached* const& self, Future const& flush ) { - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" return Future(new WaitAndSyncActor(self, flush)); - #line 1563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } -#line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" +#line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" template static Future read_write_impl(AsyncFileCached* self, @@ -1633,26 +1633,26 @@ struct AFCPage : public EvictablePage, public FastAllocated { return notReading; } - #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" // This generated class is to be used only via waitAndWrite() - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" template - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class WaitAndWriteActorState { - #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" WaitAndWriteActorState(AFCPage* const& self,void const* const& data,int const& length,int const& offset) - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" : self(self), - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" data(data), - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" length(length), - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" offset(offset) - #line 1655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { fdb_probe_actor_create("waitAndWrite", reinterpret_cast(this)); @@ -1665,16 +1665,16 @@ class WaitAndWriteActorState { int a_body1(int loopDepth=0) { try { - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_0 = self->notReading; - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -1695,11 +1695,11 @@ class WaitAndWriteActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" memcpy(static_cast(self->data) + offset, data, length); - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitAndWriteActorState(); static_cast(this)->destroy(); return 0; } - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitAndWriteActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1709,11 +1709,11 @@ class WaitAndWriteActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" memcpy(static_cast(self->data) + offset, data, length); - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitAndWriteActorState(); static_cast(this)->destroy(); return 0; } - #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitAndWriteActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1784,20 +1784,20 @@ class WaitAndWriteActorState { fdb_probe_actor_exit("waitAndWrite", reinterpret_cast(this), 0); } - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" AFCPage* self; - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" void const* data; - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" int length; - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" int offset; - #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" }; // This generated class is to be used only via waitAndWrite() - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class WaitAndWriteActor final : public Actor, public ActorCallback< WaitAndWriteActor, 0, Void >, public FastAllocated, public WaitAndWriteActorState { - #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1806,9 +1806,9 @@ class WaitAndWriteActor final : public Actor, public ActorCallback< WaitAn void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< WaitAndWriteActor, 0, Void >; - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" WaitAndWriteActor(AFCPage* const& self,void const* const& data,int const& length,int const& offset) - #line 1811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" : Actor(), WaitAndWriteActorState(self, data, length, offset) { @@ -1831,14 +1831,14 @@ friend struct ActorCallback< WaitAndWriteActor, 0, Void >; } }; - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" [[nodiscard]] static Future waitAndWrite( AFCPage* const& self, void const* const& data, int const& length, int const& offset ) { - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" return Future(new WaitAndWriteActor(self, data, length, offset)); - #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } -#line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" +#line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Future readZeroCopy() { ++zeroCopyRefCount; @@ -1890,26 +1890,26 @@ friend struct ActorCallback< WaitAndWriteActor, 0, Void >; return notReading; } - #line 1893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" // This generated class is to be used only via waitAndRead() - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" template - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class WaitAndReadActorState { - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" WaitAndReadActorState(AFCPage* const& self,void* const& data,int const& length,int const& offset) - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" : self(self), - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" data(data), - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" length(length), - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" offset(offset) - #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { fdb_probe_actor_create("waitAndRead", reinterpret_cast(this)); @@ -1922,16 +1922,16 @@ class WaitAndReadActorState { int a_body1(int loopDepth=0) { try { - #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_0 = self->notReading; - #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -1952,11 +1952,11 @@ class WaitAndReadActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" memcpy(data, static_cast(self->data) + offset, length); - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitAndReadActorState(); static_cast(this)->destroy(); return 0; } - #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitAndReadActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1966,11 +1966,11 @@ class WaitAndReadActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" memcpy(data, static_cast(self->data) + offset, length); - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitAndReadActorState(); static_cast(this)->destroy(); return 0; } - #line 1973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 1973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitAndReadActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2041,20 +2041,20 @@ class WaitAndReadActorState { fdb_probe_actor_exit("waitAndRead", reinterpret_cast(this), 0); } - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" AFCPage* self; - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" void* data; - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" int length; - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" int offset; - #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" }; // This generated class is to be used only via waitAndRead() - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class WaitAndReadActor final : public Actor, public ActorCallback< WaitAndReadActor, 0, Void >, public FastAllocated, public WaitAndReadActorState { - #line 2057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2063,9 +2063,9 @@ class WaitAndReadActor final : public Actor, public ActorCallback< WaitAnd void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< WaitAndReadActor, 0, Void >; - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" WaitAndReadActor(AFCPage* const& self,void* const& data,int const& length,int const& offset) - #line 2068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" : Actor(), WaitAndReadActorState(self, data, length, offset) { @@ -2088,29 +2088,29 @@ friend struct ActorCallback< WaitAndReadActor, 0, Void >; } }; - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" [[nodiscard]] static Future waitAndRead( AFCPage* const& self, void* const& data, int const& length, int const& offset ) { - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" return Future(new WaitAndReadActor(self, data, length, offset)); - #line 2095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } -#line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" +#line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" - #line 2100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" // This generated class is to be used only via readThrough() - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" template - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class ReadThroughActorState { - #line 2106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" ReadThroughActorState(AFCPage* const& self) - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" : self(self) - #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { fdb_probe_actor_create("readThrough", reinterpret_cast(this)); @@ -2123,25 +2123,25 @@ class ReadThroughActorState { int a_body1(int loopDepth=0) { try { - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" ASSERT(!self->valid); - #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" dst = self->data; - #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (self->pageOffset < self->owner->prevLength) - #line 2132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { try { - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_0 = self->owner->uncached->read(dst, self->pageCache->pageSize, self->pageOffset); - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2173,17 +2173,17 @@ class ReadThroughActorState { } int a_body1cont1(int loopDepth) { - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (dst == self->data) - #line 2178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { - #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" self->valid = true; - #line 2182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReadThroughActorState(); static_cast(this)->destroy(); return 0; } - #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ReadThroughActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2200,13 +2200,13 @@ class ReadThroughActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" self->zeroCopyRefCount = 0; - #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" TraceEvent("ReadThroughFailed").error(e); - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" return a_body1Catch1(e, loopDepth); - #line 2209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -2218,13 +2218,13 @@ class ReadThroughActorState { } int a_body1cont3(int const& _,int loopDepth) { - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (_ != self->pageCache->pageSize) - #line 2223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" TraceEvent("ReadThroughShortRead") .detail("ReadAmount", _) .detail("PageSize", self->pageCache->pageSize) .detail("PageOffset", self->pageOffset); - #line 2227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } loopDepth = a_body1cont6(loopDepth); @@ -2232,13 +2232,13 @@ class ReadThroughActorState { } int a_body1cont3(int && _,int loopDepth) { - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (_ != self->pageCache->pageSize) - #line 2237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" TraceEvent("ReadThroughShortRead") .detail("ReadAmount", _) .detail("PageSize", self->pageCache->pageSize) .detail("PageOffset", self->pageOffset); - #line 2241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } loopDepth = a_body1cont6(loopDepth); @@ -2320,16 +2320,16 @@ class ReadThroughActorState { return loopDepth; } - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" AFCPage* self; - #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" void* dst; - #line 2327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" }; // This generated class is to be used only via readThrough() - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class ReadThroughActor final : public Actor, public ActorCallback< ReadThroughActor, 0, int >, public FastAllocated, public ReadThroughActorState { - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2338,9 +2338,9 @@ class ReadThroughActor final : public Actor, public ActorCallback< ReadThr void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ReadThroughActor, 0, int >; - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" ReadThroughActor(AFCPage* const& self) - #line 2343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" : Actor(), ReadThroughActorState(self) { @@ -2363,31 +2363,31 @@ friend struct ActorCallback< ReadThroughActor, 0, int >; } }; - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" [[nodiscard]] static Future readThrough( AFCPage* const& self ) { - #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" return Future(new ReadThroughActor(self)); - #line 2370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } -#line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" +#line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" - #line 2375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" // This generated class is to be used only via writeThrough() - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" template - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class WriteThroughActorState { - #line 2381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" WriteThroughActorState(AFCPage* const& self,Promise const& writing) - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" : self(self), - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" writing(writing) - #line 2390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { fdb_probe_actor_create("writeThrough", reinterpret_cast(this)); @@ -2401,22 +2401,22 @@ class WriteThroughActorState { { try { try { - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" dirty = self->dirty; - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" ++self->writeThroughCount; - #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" self->updateFlushableIndex(); - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_0 = self->notReading && self->notFlushing; - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2443,17 +2443,17 @@ class WriteThroughActorState { } int a_body1cont1(int loopDepth) { - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" --self->writeThroughCount; - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" self->updateFlushableIndex(); - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" writing.send(Void()); - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" self->pageCache->try_evict(); - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteThroughActorState(); static_cast(this)->destroy(); return 0; } - #line 2456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WriteThroughActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2464,15 +2464,15 @@ class WriteThroughActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" --self->writeThroughCount; - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" self->setDirty(); - #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" writing.sendError(e); - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" return a_body1Catch1(e, loopDepth); - #line 2475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -2484,36 +2484,36 @@ class WriteThroughActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (dirty) - #line 2489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (self->owner->getRateControl()) - #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" int allowance = 1; - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (FLOW_KNOBS->FLOW_CACHEDFILE_WRITE_IO_SIZE > 0) - #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" allowance = (self->pageCache->pageSize + FLOW_KNOBS->FLOW_CACHEDFILE_WRITE_IO_SIZE - 1) / FLOW_KNOBS->FLOW_CACHEDFILE_WRITE_IO_SIZE; - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" ASSERT(allowance > 0); - #line 2505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_1 = self->owner->getRateControl()->getAllowance(allowance); - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; } else @@ -2530,36 +2530,36 @@ class WriteThroughActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (dirty) - #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { - #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (self->owner->getRateControl()) - #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" int allowance = 1; - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (FLOW_KNOBS->FLOW_CACHEDFILE_WRITE_IO_SIZE > 0) - #line 2545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" allowance = (self->pageCache->pageSize + FLOW_KNOBS->FLOW_CACHEDFILE_WRITE_IO_SIZE - 1) / FLOW_KNOBS->FLOW_CACHEDFILE_WRITE_IO_SIZE; - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" ASSERT(allowance > 0); - #line 2551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_1 = self->owner->getRateControl()->getAllowance(allowance); - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; } else @@ -2645,28 +2645,28 @@ class WriteThroughActorState { } int a_body1cont4(int loopDepth) { - #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (self->pageOffset + self->pageCache->pageSize > self->owner->length) - #line 2650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { - #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" ASSERT(self->pageOffset < self->owner->length); - #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" memset(static_cast(self->data) + self->owner->length - self->pageOffset, 0, self->pageCache->pageSize - (self->owner->length - self->pageOffset)); - #line 2656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } - #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" auto f = self->owner->uncached->write(self->data, self->pageCache->pageSize, self->pageOffset); - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_2 = f; - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont4when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; return loopDepth; @@ -2834,18 +2834,18 @@ class WriteThroughActorState { return loopDepth; } - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" AFCPage* self; - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Promise writing; - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" bool dirty; - #line 2843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" }; // This generated class is to be used only via writeThrough() - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class WriteThroughActor final : public Actor, public ActorCallback< WriteThroughActor, 0, Void >, public ActorCallback< WriteThroughActor, 1, Void >, public ActorCallback< WriteThroughActor, 2, Void >, public FastAllocated, public WriteThroughActorState { - #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2856,9 +2856,9 @@ class WriteThroughActor final : public Actor, public ActorCallback< WriteT friend struct ActorCallback< WriteThroughActor, 0, Void >; friend struct ActorCallback< WriteThroughActor, 1, Void >; friend struct ActorCallback< WriteThroughActor, 2, Void >; - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" WriteThroughActor(AFCPage* const& self,Promise const& writing) - #line 2861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" : Actor(), WriteThroughActorState(self, writing) { @@ -2883,14 +2883,14 @@ friend struct ActorCallback< WriteThroughActor, 2, Void >; } }; - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" [[nodiscard]] static Future writeThrough( AFCPage* const& self, Promise const& writing ) { - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" return Future(new WriteThroughActor(self, writing)); - #line 2890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } -#line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" +#line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Future flush() { if (!dirty && notFlushing.isReady()) @@ -2932,20 +2932,20 @@ friend struct ActorCallback< WriteThroughActor, 2, Void >; return truncate_impl(this); } - #line 2935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" // This generated class is to be used only via truncate_impl() - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" template - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class Truncate_implActor1State { - #line 2941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Truncate_implActor1State(AFCPage* const& self) - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" : self(self) - #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" { fdb_probe_actor_create("truncate_impl", reinterpret_cast(this)); @@ -2958,16 +2958,16 @@ class Truncate_implActor1State { int a_body1(int loopDepth=0) { try { - #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" StrictFuture __when_expr_0 = self->notReading && self->notFlushing && yield(); - #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2988,11 +2988,11 @@ class Truncate_implActor1State { } int a_body1cont1(Void const& _,int loopDepth) { - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" delete self; - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Truncate_implActor1State(); static_cast(this)->destroy(); return 0; } - #line 2995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 2995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Truncate_implActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3002,11 +3002,11 @@ class Truncate_implActor1State { } int a_body1cont1(Void && _,int loopDepth) { - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" delete self; - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Truncate_implActor1State(); static_cast(this)->destroy(); return 0; } - #line 3009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 3009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Truncate_implActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3077,14 +3077,14 @@ class Truncate_implActor1State { fdb_probe_actor_exit("truncate_impl", reinterpret_cast(this), 0); } - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" AFCPage* self; - #line 3082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 3082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" }; // This generated class is to be used only via truncate_impl() - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" class Truncate_implActor1 final : public Actor, public ActorCallback< Truncate_implActor1, 0, Void >, public FastAllocated, public Truncate_implActor1State { - #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3093,9 +3093,9 @@ class Truncate_implActor1 final : public Actor, public ActorCallback< Trun void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Truncate_implActor1, 0, Void >; - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" Truncate_implActor1(AFCPage* const& self) - #line 3098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 3098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" : Actor(), Truncate_implActor1State(self) { @@ -3118,14 +3118,14 @@ friend struct ActorCallback< Truncate_implActor1, 0, Void >; } }; - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" [[nodiscard]] static Future truncate_impl( AFCPage* const& self ) { - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" return Future(new Truncate_implActor1(self)); - #line 3125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.g.h" + #line 3125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.g.h" } -#line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileCached.actor.h" +#line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h" AFCPage(AsyncFileCached* owner, int64_t offset) : EvictablePage(owner->pageCache), owner(owner), pageOffset(offset), notReading(Void()), notFlushing(Void()), diff --git a/src/fdbrpc/AsyncFileCached.actor.h b/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h similarity index 92% rename from src/fdbrpc/AsyncFileCached.actor.h rename to src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h index 3823661..72866f0 100644 --- a/src/fdbrpc/AsyncFileCached.actor.h +++ b/src/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h @@ -32,7 +32,7 @@ #include #include "flow/flow.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/Knobs.h" #include "flow/TDMetric.actor.h" #include "flow/network.h" @@ -73,7 +73,7 @@ struct EvictablePageCache : ReferenceCounted { explicit EvictablePageCache(int pageSize, int64_t maxSize) : pageSize(pageSize), maxPages(maxSize / pageSize), cacheEvictionType(evictionPolicyStringToEnum(FLOW_KNOBS->CACHE_EVICTION_POLICY)) { - cacheEvictions.init(LiteralStringRef("EvictablePageCache.CacheEvictions")); + cacheEvictions.init("EvictablePageCache.CacheEvictions"_sr); } void allocate(EvictablePage* page) { @@ -303,25 +303,25 @@ class AsyncFileCached final : public IAsyncFile, public ReferenceCountedisSimulated()) { - countFileCacheWrites.init(LiteralStringRef("AsyncFile.CountFileCacheWrites"), filename); - countFileCacheReads.init(LiteralStringRef("AsyncFile.CountFileCacheReads"), filename); - countFileCacheWritesBlocked.init(LiteralStringRef("AsyncFile.CountFileCacheWritesBlocked"), filename); - countFileCacheReadsBlocked.init(LiteralStringRef("AsyncFile.CountFileCacheReadsBlocked"), filename); - countFileCachePageReadsHit.init(LiteralStringRef("AsyncFile.CountFileCachePageReadsHit"), filename); - countFileCachePageReadsMissed.init(LiteralStringRef("AsyncFile.CountFileCachePageReadsMissed"), filename); - countFileCachePageReadsMerged.init(LiteralStringRef("AsyncFile.CountFileCachePageReadsMerged"), filename); - countFileCacheFinds.init(LiteralStringRef("AsyncFile.CountFileCacheFinds"), filename); - countFileCacheReadBytes.init(LiteralStringRef("AsyncFile.CountFileCacheReadBytes"), filename); - - countCacheWrites.init(LiteralStringRef("AsyncFile.CountCacheWrites")); - countCacheReads.init(LiteralStringRef("AsyncFile.CountCacheReads")); - countCacheWritesBlocked.init(LiteralStringRef("AsyncFile.CountCacheWritesBlocked")); - countCacheReadsBlocked.init(LiteralStringRef("AsyncFile.CountCacheReadsBlocked")); - countCachePageReadsHit.init(LiteralStringRef("AsyncFile.CountCachePageReadsHit")); - countCachePageReadsMissed.init(LiteralStringRef("AsyncFile.CountCachePageReadsMissed")); - countCachePageReadsMerged.init(LiteralStringRef("AsyncFile.CountCachePageReadsMerged")); - countCacheFinds.init(LiteralStringRef("AsyncFile.CountCacheFinds")); - countCacheReadBytes.init(LiteralStringRef("AsyncFile.CountCacheReadBytes")); + countFileCacheWrites.init("AsyncFile.CountFileCacheWrites"_sr, filename); + countFileCacheReads.init("AsyncFile.CountFileCacheReads"_sr, filename); + countFileCacheWritesBlocked.init("AsyncFile.CountFileCacheWritesBlocked"_sr, filename); + countFileCacheReadsBlocked.init("AsyncFile.CountFileCacheReadsBlocked"_sr, filename); + countFileCachePageReadsHit.init("AsyncFile.CountFileCachePageReadsHit"_sr, filename); + countFileCachePageReadsMissed.init("AsyncFile.CountFileCachePageReadsMissed"_sr, filename); + countFileCachePageReadsMerged.init("AsyncFile.CountFileCachePageReadsMerged"_sr, filename); + countFileCacheFinds.init("AsyncFile.CountFileCacheFinds"_sr, filename); + countFileCacheReadBytes.init("AsyncFile.CountFileCacheReadBytes"_sr, filename); + + countCacheWrites.init("AsyncFile.CountCacheWrites"_sr); + countCacheReads.init("AsyncFile.CountCacheReads"_sr); + countCacheWritesBlocked.init("AsyncFile.CountCacheWritesBlocked"_sr); + countCacheReadsBlocked.init("AsyncFile.CountCacheReadsBlocked"_sr); + countCachePageReadsHit.init("AsyncFile.CountCachePageReadsHit"_sr); + countCachePageReadsMissed.init("AsyncFile.CountCachePageReadsMissed"_sr); + countCachePageReadsMerged.init("AsyncFile.CountCachePageReadsMerged"_sr); + countCacheFinds.init("AsyncFile.CountCacheFinds"_sr); + countCacheReadBytes.init("AsyncFile.CountCacheReadBytes"_sr); } } @@ -343,7 +343,7 @@ class AsyncFileCached final : public IAsyncFile, public ReferenceCountedsize()); TraceEvent("AFCUnderlyingSize").detail("Filename", filename).detail("Size", l); - return new AsyncFileCached(f, filename, l, pageCache); + return Reference(new AsyncFileCached(f, filename, l, pageCache)).castTo(); } catch (Error& e) { if (e.code() != error_code_actor_cancelled) openFiles.erase(filename); diff --git a/src/fdbrpc/AsyncFileChaos.actor.h b/src/fdbrpc/include/fdbrpc/AsyncFileChaos.h similarity index 64% rename from src/fdbrpc/AsyncFileChaos.actor.h rename to src/fdbrpc/include/fdbrpc/AsyncFileChaos.h index 2a20019..825f9e0 100644 --- a/src/fdbrpc/AsyncFileChaos.actor.h +++ b/src/fdbrpc/include/fdbrpc/AsyncFileChaos.h @@ -1,5 +1,5 @@ /* - * AsyncFileChaos.actor.h + * AsyncFileChaos.h * * This source file is part of the FoundationDB open source project * @@ -18,13 +18,15 @@ * limitations under the License. */ +#pragma once + #include "flow/flow.h" #include "flow/serialize.h" -#include "flow/genericactors.actor.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/network.h" #include "flow/ActorCollection.h" -#include "flow/actorcompiler.h" +#include "flow/ChaosMetrics.h" +#include "fdbrpc/simulator.h" // template class AsyncFileChaos final : public IAsyncFile, public ReferenceCounted { @@ -35,7 +37,8 @@ class AsyncFileChaos final : public IAsyncFile, public ReferenceCounted file) : file(file) { // We only allow chaos events on storage files - enabled = (file->getFilename().find("storage-") != std::string::npos); + enabled = file->getFilename().find("storage-") != std::string::npos && + file->getFilename().find("sqlite-wal") == std::string::npos; } void addref() override { ReferenceCounted::addref(); } @@ -72,13 +75,14 @@ class AsyncFileChaos final : public IAsyncFile, public ReferenceCounted(Void)>, int>( - delay(diskDelay), [=, file = file](Void _) -> Future { return file->read(data, length, offset); }); + return mapAsync(delay(diskDelay), + [=, file = file](Void _) -> Future { return file->read(data, length, offset); }); } Future write(void const* data, int length, int64_t offset) override { Arena arena; char* pdata = nullptr; + unsigned corruptedBlock = 0; // Check if a bit flip event was injected, if so, copy the buffer contents // with a random bit flipped in a new buffer and use that for the write @@ -91,35 +95,40 @@ class AsyncFileChaos final : public IAsyncFile, public ReferenceCountedrandomInt(0, length)] ^= (1 << deterministicRandom()->randomInt(0, 8)); + auto corruptedPos = deterministicRandom()->randomInt(0, length); + pdata[corruptedPos] ^= (1 << deterministicRandom()->randomInt(0, 8)); + // mark the block as corrupted + corruptedBlock = (offset + corruptedPos) / 4096; + TraceEvent("CorruptedBlock") + .detail("Filename", file->getFilename()) + .detail("Block", corruptedBlock) + .log(); // increment the metric for bit flips - auto res = g_network->global(INetwork::enChaosMetrics); - if (res) { - ChaosMetrics* chaosMetrics = static_cast(res); + auto chaosMetricsPointer = g_network->global(INetwork::enChaosMetrics); + if (chaosMetricsPointer) { + ChaosMetrics* chaosMetrics = static_cast(chaosMetricsPointer); chaosMetrics->bitFlips++; } } } } - double diskDelay = getDelay(); - if (diskDelay == 0.0) { - if (pdata) - return holdWhile(arena, file->write(pdata, length, offset)); - - return file->write(data, length, offset); - } - // Wait for diskDelay before submitting the I/O // Capture file by value in case this is destroyed during the delay - return mapAsync(Void)>, Void>( - delay(diskDelay), [=, file = file](Void _) -> Future { - if (pdata) - return holdWhile(arena, file->write(pdata, length, offset)); + return mapAsync(delay(getDelay()), [=, file = file](Void _) -> Future { + if (pdata) { + return map(holdWhile(arena, file->write(pdata, length, offset)), + [corruptedBlock, file = file](auto res) { + if (g_network->isSimulated()) { + g_simulator->corruptedBlocks.emplace(file->getFilename(), corruptedBlock); + } + return res; + }); + } - return file->write(data, length, offset); - }); + return file->write(data, length, offset); + }); } Future truncate(int64_t size) override { @@ -129,8 +138,16 @@ class AsyncFileChaos final : public IAsyncFile, public ReferenceCounted(Void)>, Void>( - delay(diskDelay), [=, file = file](Void _) -> Future { return file->truncate(size); }); + return mapAsync(delay(diskDelay), [size, file = file](Void _) -> Future { + constexpr auto maxBlockValue = + std::numeric_limitscorruptedBlocks)::key_type::second_type>::max(); + auto firstDeletedBlock = + g_simulator->corruptedBlocks.lower_bound(std::make_pair(file->getFilename(), size / 4096)); + auto lastFileBlock = + g_simulator->corruptedBlocks.upper_bound(std::make_pair(file->getFilename(), maxBlockValue)); + g_simulator->corruptedBlocks.erase(firstDeletedBlock, lastFileBlock); + return file->truncate(size); + }); } Future sync() override { @@ -140,8 +157,7 @@ class AsyncFileChaos final : public IAsyncFile, public ReferenceCounted(Void)>, Void>( - delay(diskDelay), [=, file = file](Void _) -> Future { return file->sync(); }); + return mapAsync(delay(diskDelay), [=, file = file](Void _) -> Future { return file->sync(); }); } Future size() const override { @@ -151,8 +167,7 @@ class AsyncFileChaos final : public IAsyncFile, public ReferenceCounted(Void)>, int64_t>( - delay(diskDelay), [=, file = file](Void _) -> Future { return file->size(); }); + return mapAsync(delay(diskDelay), [=, file = file](Void _) -> Future { return file->size(); }); } int64_t debugFD() const override { return file->debugFD(); } diff --git a/src/fdbrpc/AsyncFileEIO.actor.g.h b/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h similarity index 81% rename from src/fdbrpc/AsyncFileEIO.actor.g.h rename to src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h index 4384672..326b044 100644 --- a/src/fdbrpc/AsyncFileEIO.actor.g.h +++ b/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" /* * AsyncFileEIO.actor.h * @@ -37,10 +37,10 @@ #include #include -#include "fdbrpc/libeio/eio.h" +#include "eio.h" #include "flow/flow.h" #include "flow/ThreadHelper.actor.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/TDMetric.actor.h" #include "flow/actorcompiler.h" // This must be the last #include. @@ -75,26 +75,26 @@ class AsyncFileEIO : public IAsyncFile, public ReferenceCounted { return true; } - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" // This generated class is to be used only via open() - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class OpenActorState { - #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" OpenActorState(std::string const& filename,int const& flags,int const& mode,void* const& ignore) - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" : filename(filename), - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" flags(flags), - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" mode(mode), - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" ignore(ignore) - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { fdb_probe_actor_create("open", reinterpret_cast(this)); @@ -107,34 +107,34 @@ class OpenActorState { int a_body1(int loopDepth=0) { try { - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" std::string open_filename = filename; - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (flags & OPEN_ATOMIC_WRITE_AND_CREATE) - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" ASSERT((flags & OPEN_CREATE) && (flags & OPEN_READWRITE) && !(flags & OPEN_EXCLUSIVE)); - #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" open_filename = filename + ".part"; - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" p = Promise(); - #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" r = eio_open(open_filename.c_str(), openFlags(flags), mode, 0, eio_callback, &p); - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" try { - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_0 = p.getFuture(); - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -161,37 +161,37 @@ class OpenActorState { } int a_body1cont1(int loopDepth) { - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (r->result < 0) - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" errno = r->errorno; - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" bool notFound = errno == ENOENT; - #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Error e = notFound ? file_not_found() : io_error(); - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TraceEvent(notFound ? SevWarn : SevWarnAlways, "FileOpenError") .error(e) .GetLastError() .detail("File", filename) .detail("Flags", flags) .detail("Mode", mode); - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(e, loopDepth); - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TraceEvent("AsyncFileOpened") .suppressFor(1.0) .detail("Filename", filename) .detail("Fd", r->result) .detail("Flags", flags); - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if ((flags & OPEN_LOCK) && !lock_fd(r->result)) - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - TraceEvent(SevError, "UnableToLockFile").detail("Filename", filename).GetLastError(); - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - return a_body1Catch1(io_error(), loopDepth); - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + TraceEvent(SevWarn, "UnableToLockFile").detail("Filename", filename).GetLastError(); + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + return a_body1Catch1(lock_file_failure(), loopDepth); + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(Reference(new AsyncFileEIO(r->result, flags, filename))); this->~OpenActorState(); static_cast(this)->destroy(); return 0; } - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< Reference >::value()) Reference(Reference(new AsyncFileEIO(r->result, flags, filename))); this->~OpenActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -202,11 +202,11 @@ class OpenActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_cancel(r); - #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(__current_error, loopDepth); - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -304,24 +304,24 @@ class OpenActorState { return loopDepth; } - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" std::string filename; - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int flags; - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int mode; - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" void* ignore; - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Promise p; - #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_req* r; - #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" }; // This generated class is to be used only via open() - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class OpenActor final : public Actor>, public ActorCallback< OpenActor, 0, Void >, public FastAllocated, public OpenActorState { - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -330,9 +330,9 @@ class OpenActor final : public Actor>, public ActorCallbac void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< OpenActor, 0, Void >; - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" OpenActor(std::string const& filename,int const& flags,int const& mode,void* const& ignore) - #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" : Actor>(), OpenActorState(filename, flags, mode, ignore) { @@ -355,45 +355,45 @@ friend struct ActorCallback< OpenActor, 0, Void >; } }; - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" [[nodiscard]] static Future> open( std::string const& filename, int const& flags, int const& mode, void* const& ignore ) { - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return Future>(new OpenActor(filename, flags, mode, ignore)); - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } -#line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" static Future deleteFile(std::string filename, bool mustBeDurable) { ::deleteFile(filename); if (mustBeDurable) { - TEST(true); // deleteFile and fsync parent dir + CODE_PROBE(true, "deleteFile and fsync parent dir", probe::decoration::rare); return async_fsync_parent(filename); } else return Void(); } - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" // This generated class is to be used only via renameFile() - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class RenameFileActorState { - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" RenameFileActorState(std::string const& from,std::string const& to) - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" : from(from), - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" to(to), - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" taskID(g_network->getCurrentTask()), - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" p(), - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" r(eio_rename(from.c_str(), to.c_str(), 0, eio_callback, &p)) - #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { fdb_probe_actor_create("renameFile", reinterpret_cast(this)); @@ -407,16 +407,16 @@ class RenameFileActorState { { try { try { - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_0 = p.getFuture(); - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -444,30 +444,30 @@ class RenameFileActorState { int a_body1cont1(int loopDepth) { try { - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" result = r->result; - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (result == -1) - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TraceEvent(SevError, "FileRenameError").detail("Errno", r->errorno); - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1cont1Catch1(internal_error(), loopDepth); - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } else { - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_1 = delay(0, taskID); - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } } @@ -482,13 +482,13 @@ class RenameFileActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" g_network->setCurrentTask(taskID); - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_cancel(r); - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(__current_error, loopDepth); - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -589,18 +589,18 @@ class RenameFileActorState { int a_body1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" _e = e; - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_2 = delay(0, taskID); - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -613,9 +613,9 @@ class RenameFileActorState { } int a_body1cont7(Void const& _,int loopDepth) { - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RenameFileActorState(); static_cast(this)->destroy(); return 0; } - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~RenameFileActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -625,9 +625,9 @@ class RenameFileActorState { } int a_body1cont7(Void && _,int loopDepth) { - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RenameFileActorState(); static_cast(this)->destroy(); return 0; } - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~RenameFileActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -700,17 +700,17 @@ class RenameFileActorState { } int a_body1cont1Catch1cont1(Void const& _,int loopDepth) { - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(_e, loopDepth); - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" return loopDepth; } int a_body1cont1Catch1cont1(Void && _,int loopDepth) { - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(_e, loopDepth); - #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" return loopDepth; } @@ -777,26 +777,26 @@ class RenameFileActorState { fdb_probe_actor_exit("renameFile", reinterpret_cast(this), 2); } - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" std::string from; - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" std::string to; - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TaskPriority taskID; - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Promise p; - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_req* r; - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int result; - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Error _e; - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" }; // This generated class is to be used only via renameFile() - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class RenameFileActor final : public Actor, public ActorCallback< RenameFileActor, 0, Void >, public ActorCallback< RenameFileActor, 1, Void >, public ActorCallback< RenameFileActor, 2, Void >, public FastAllocated, public RenameFileActorState { - #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -807,9 +807,9 @@ class RenameFileActor final : public Actor, public ActorCallback< RenameFi friend struct ActorCallback< RenameFileActor, 0, Void >; friend struct ActorCallback< RenameFileActor, 1, Void >; friend struct ActorCallback< RenameFileActor, 2, Void >; - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" RenameFileActor(std::string const& from,std::string const& to) - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" : Actor(), RenameFileActorState(from, to) { @@ -834,29 +834,29 @@ friend struct ActorCallback< RenameFileActor, 2, Void >; } }; - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" [[nodiscard]] static Future renameFile( std::string const& from, std::string const& to ) { - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return Future(new RenameFileActor(from, to)); - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } -#line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" - #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" // This generated class is to be used only via lastWriteTime() - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class LastWriteTimeActorState { - #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" LastWriteTimeActorState(std::string const& filename) - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" : filename(filename) - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { fdb_probe_actor_create("lastWriteTime", reinterpret_cast(this)); @@ -869,16 +869,16 @@ class LastWriteTimeActorState { int a_body1(int loopDepth=0) { try { - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_0 = stat_impl(filename); - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -899,9 +899,9 @@ class LastWriteTimeActorState { } int a_body1cont1(EIO_STRUCT_STAT const& statdata,int loopDepth) { - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(statdata.st_mtime); this->~LastWriteTimeActorState(); static_cast(this)->destroy(); return 0; } - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< std::time_t >::value()) std::time_t(statdata.st_mtime); this->~LastWriteTimeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -911,9 +911,9 @@ class LastWriteTimeActorState { } int a_body1cont1(EIO_STRUCT_STAT && statdata,int loopDepth) { - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(statdata.st_mtime); this->~LastWriteTimeActorState(); static_cast(this)->destroy(); return 0; } - #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< std::time_t >::value()) std::time_t(statdata.st_mtime); this->~LastWriteTimeActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -984,14 +984,14 @@ class LastWriteTimeActorState { fdb_probe_actor_exit("lastWriteTime", reinterpret_cast(this), 0); } - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" std::string filename; - #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" }; // This generated class is to be used only via lastWriteTime() - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class LastWriteTimeActor final : public Actor, public ActorCallback< LastWriteTimeActor, 0, EIO_STRUCT_STAT >, public FastAllocated, public LastWriteTimeActorState { - #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1000,9 +1000,9 @@ class LastWriteTimeActor final : public Actor, public ActorCallback void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< LastWriteTimeActor, 0, EIO_STRUCT_STAT >; - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" LastWriteTimeActor(std::string const& filename) - #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" : Actor(), LastWriteTimeActorState(filename) { @@ -1025,14 +1025,14 @@ friend struct ActorCallback< LastWriteTimeActor, 0, EIO_STRUCT_STAT >; } }; - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" [[nodiscard]] static Future lastWriteTime( std::string const& filename ) { - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return Future(new LastWriteTimeActor(filename)); - #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } -#line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" void addref() override { ReferenceCounted::addref(); } void delref() override { ReferenceCounted::delref(); } @@ -1076,20 +1076,20 @@ friend struct ActorCallback< LastWriteTimeActor, 0, EIO_STRUCT_STAT >; } std::string getFilename() const override { return filename; } - #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" // This generated class is to be used only via async_fsync_parent() - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Async_fsync_parentActorState { - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Async_fsync_parentActorState(std::string const& filename) - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" : filename(filename) - #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { fdb_probe_actor_create("async_fsync_parent", reinterpret_cast(this)); @@ -1102,31 +1102,31 @@ class Async_fsync_parentActorState { int a_body1(int loopDepth=0) { try { - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" std::string folder = parentDirectory(filename); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TraceEvent("FSyncParentDir").detail("Folder", folder).detail("File", filename); - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" folderFD = ::open(folder.c_str(), O_DIRECTORY | O_CLOEXEC, 0); - #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (folderFD < 0) - #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(io_error(), loopDepth); - #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } try { - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_0 = async_fsync(folderFD); - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -1153,11 +1153,11 @@ class Async_fsync_parentActorState { } int a_body1cont1(int loopDepth) { - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" close(folderFD); - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Async_fsync_parentActorState(); static_cast(this)->destroy(); return 0; } - #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Async_fsync_parentActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1168,11 +1168,11 @@ class Async_fsync_parentActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" close(folderFD); - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(__current_error, loopDepth); - #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -1270,16 +1270,16 @@ class Async_fsync_parentActorState { return loopDepth; } - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" std::string filename; - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int folderFD; - #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" }; // This generated class is to be used only via async_fsync_parent() - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Async_fsync_parentActor final : public Actor, public ActorCallback< Async_fsync_parentActor, 0, Void >, public FastAllocated, public Async_fsync_parentActorState { - #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1288,9 +1288,9 @@ class Async_fsync_parentActor final : public Actor, public ActorCallback< void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Async_fsync_parentActor, 0, Void >; - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Async_fsync_parentActor(std::string const& filename) - #line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" : Actor(), Async_fsync_parentActorState(filename) { @@ -1313,14 +1313,14 @@ friend struct ActorCallback< Async_fsync_parentActor, 0, Void >; } }; - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" [[nodiscard]] static Future async_fsync_parent( std::string const& filename ) { - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return Future(new Async_fsync_parentActor(filename)); - #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } -#line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" static Future async_fdatasync(int fd) { // Used by AsyncFileKAIO, since kernel AIO doesn't really implement fdatasync yet @@ -1330,24 +1330,24 @@ friend struct ActorCallback< Async_fsync_parentActor, 0, Void >; // Used by AsyncFileKAIO, since kernel AIO doesn't really implement fsync yet return sync_impl(fd, makeReference(), true); } - #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" // This generated class is to be used only via waitAndAtomicRename() - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class WaitAndAtomicRenameActorState { - #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" WaitAndAtomicRenameActorState(Future const& fsync,std::string const& part_filename,std::string const& final_filename) - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" : fsync(fsync), - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" part_filename(part_filename), - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" final_filename(final_filename) - #line 1350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { fdb_probe_actor_create("waitAndAtomicRename", reinterpret_cast(this)); @@ -1360,16 +1360,16 @@ class WaitAndAtomicRenameActorState { int a_body1(int loopDepth=0) { try { - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_0 = fsync; - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -1390,52 +1390,52 @@ class WaitAndAtomicRenameActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (rename(part_filename.c_str(), final_filename.c_str())) - #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TraceEvent("AsyncFileEIORenameError").detail("Filename", final_filename).GetLastError(); - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(io_error(), loopDepth); - #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_1 = async_fsync_parent(final_filename); - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (rename(part_filename.c_str(), final_filename.c_str())) - #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TraceEvent("AsyncFileEIORenameError").detail("Filename", final_filename).GetLastError(); - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(io_error(), loopDepth); - #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_1 = async_fsync_parent(final_filename); - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; return loopDepth; @@ -1505,9 +1505,9 @@ class WaitAndAtomicRenameActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitAndAtomicRenameActorState(); static_cast(this)->destroy(); return 0; } - #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitAndAtomicRenameActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1517,9 +1517,9 @@ class WaitAndAtomicRenameActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitAndAtomicRenameActorState(); static_cast(this)->destroy(); return 0; } - #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WaitAndAtomicRenameActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1590,18 +1590,18 @@ class WaitAndAtomicRenameActorState { fdb_probe_actor_exit("waitAndAtomicRename", reinterpret_cast(this), 1); } - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Future fsync; - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" std::string part_filename; - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" std::string final_filename; - #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" }; // This generated class is to be used only via waitAndAtomicRename() - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class WaitAndAtomicRenameActor final : public Actor, public ActorCallback< WaitAndAtomicRenameActor, 0, Void >, public ActorCallback< WaitAndAtomicRenameActor, 1, Void >, public FastAllocated, public WaitAndAtomicRenameActorState { - #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1611,9 +1611,9 @@ class WaitAndAtomicRenameActor final : public Actor, public ActorCallback< #pragma clang diagnostic pop friend struct ActorCallback< WaitAndAtomicRenameActor, 0, Void >; friend struct ActorCallback< WaitAndAtomicRenameActor, 1, Void >; - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" WaitAndAtomicRenameActor(Future const& fsync,std::string const& part_filename,std::string const& final_filename) - #line 1616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" : Actor(), WaitAndAtomicRenameActorState(fsync, part_filename, final_filename) { @@ -1637,14 +1637,14 @@ friend struct ActorCallback< WaitAndAtomicRenameActor, 1, Void >; } }; - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" [[nodiscard]] static Future waitAndAtomicRename( Future const& fsync, std::string const& part_filename, std::string const& final_filename ) { - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return Future(new WaitAndAtomicRenameActor(fsync, part_filename, final_filename)); - #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } -#line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" // Run the given function on the EIO thread pool and return its result template @@ -1687,11 +1687,11 @@ friend struct ActorCallback< WaitAndAtomicRenameActor, 1, Void >; AsyncFileEIO(int fd, int flags, std::string const& filename) : fd(fd), flags(flags), err(new ErrorInfo), filename(filename) { if (!g_network->isSimulated()) { - countFileLogicalWrites.init(LiteralStringRef("AsyncFile.CountFileLogicalWrites"), filename); - countFileLogicalReads.init(LiteralStringRef("AsyncFile.CountFileLogicalReads"), filename); + countFileLogicalWrites.init("AsyncFile.CountFileLogicalWrites"_sr, filename); + countFileLogicalReads.init("AsyncFile.CountFileLogicalReads"_sr, filename); - countLogicalWrites.init(LiteralStringRef("AsyncFile.CountLogicalWrites")); - countLogicalReads.init(LiteralStringRef("AsyncFile.CountLogicalReads")); + countLogicalWrites.init("AsyncFile.CountLogicalWrites"_sr); + countLogicalReads.init("AsyncFile.CountLogicalReads"_sr); } } @@ -1728,24 +1728,24 @@ friend struct ActorCallback< WaitAndAtomicRenameActor, 1, Void >; throw e; } - #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" // This generated class is to be used only via close_impl() - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Close_implActorState { - #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Close_implActorState(int const& fd) - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" : fd(fd), - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" p(), - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" r(eio_close(fd, 0, eio_callback, &p)) - #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { fdb_probe_actor_create("close_impl", reinterpret_cast(this)); @@ -1758,15 +1758,15 @@ class Close_implActorState { int a_body1(int loopDepth=0) { try { - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_0 = p.getFuture(); - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" static_cast(this)->actor_wait_state = 1; - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -1786,34 +1786,34 @@ class Close_implActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (r->result) - #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" error("CloseError", fd, r); - #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TraceEvent("AsyncFileClosed").suppressFor(1.0).detail("Fd", fd); - #line 1799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = a_body1cont4(loopDepth); return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (r->result) - #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" error("CloseError", fd, r); - #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TraceEvent("AsyncFileClosed").suppressFor(1.0).detail("Fd", fd); - #line 1816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = a_body1cont4(loopDepth); return loopDepth; @@ -1883,25 +1883,25 @@ class Close_implActorState { } int a_body1cont4(int loopDepth) { - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" delete static_cast(this); - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" return 0; return loopDepth; } - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int fd; - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Promise p; - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_req* r; - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" }; // This generated class is to be used only via close_impl() - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Close_implActor final : public Actor, public ActorCallback< Close_implActor, 0, Void >, public FastAllocated, public Close_implActorState { - #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1910,9 +1910,9 @@ class Close_implActor final : public Actor, public ActorCallback< Close_im void destroy() {{ ((Actor*)this)->~Actor(); operator delete(this); }} #pragma clang diagnostic pop friend struct ActorCallback< Close_implActor, 0, Void >; - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Close_implActor(int const& fd) - #line 1915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" : Actor(), Close_implActorState(fd) { @@ -1926,41 +1926,41 @@ friend struct ActorCallback< Close_implActor, 0, Void >; } }; - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" static void close_impl( int const& fd ) { - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" new Close_implActor(fd); - #line 1933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } -#line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" - #line 1938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" // This generated class is to be used only via read_impl() - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Read_implActorState { - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Read_implActorState(int const& fd,void* const& data,int const& length,int64_t const& offset) - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" : fd(fd), - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" data(data), - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" length(length), - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" offset(offset), - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" taskID(g_network->getCurrentTask()), - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" p(), - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" r(eio_read(fd, data, length, offset, 0, eio_callback, &p)) - #line 1963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { fdb_probe_actor_create("read_impl", reinterpret_cast(this)); @@ -1974,16 +1974,16 @@ class Read_implActorState { { try { try { - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_0 = p.getFuture(); - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 1981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2011,30 +2011,30 @@ class Read_implActorState { int a_body1cont1(int loopDepth) { try { - #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" result = r->result; - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (result == -1) - #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" error("ReadError", fd, r); - #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1cont1Catch1(internal_error(), loopDepth); - #line 2024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } else { - #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_1 = delay(0, taskID); - #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 2032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } } @@ -2049,13 +2049,13 @@ class Read_implActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" g_network->setCurrentTask(taskID); - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_cancel(r); - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(__current_error, loopDepth); - #line 2058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -2156,18 +2156,18 @@ class Read_implActorState { int a_body1cont1Catch1(const Error& _e,int loopDepth=0) { try { - #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" e = _e; - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_2 = delay(0, taskID); - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2180,9 +2180,9 @@ class Read_implActorState { } int a_body1cont7(Void const& _,int loopDepth) { - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(result); this->~Read_implActorState(); static_cast(this)->destroy(); return 0; } - #line 2185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< int >::value()) int(std::move(result)); // state_var_RVO this->~Read_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2192,9 +2192,9 @@ class Read_implActorState { } int a_body1cont7(Void && _,int loopDepth) { - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(result); this->~Read_implActorState(); static_cast(this)->destroy(); return 0; } - #line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< int >::value()) int(std::move(result)); // state_var_RVO this->~Read_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2267,17 +2267,17 @@ class Read_implActorState { } int a_body1cont1Catch1cont1(Void const& _,int loopDepth) { - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(e, loopDepth); - #line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" return loopDepth; } int a_body1cont1Catch1cont1(Void && _,int loopDepth) { - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(e, loopDepth); - #line 2280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" return loopDepth; } @@ -2344,30 +2344,30 @@ class Read_implActorState { fdb_probe_actor_exit("read_impl", reinterpret_cast(this), 2); } - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int fd; - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" void* data; - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int length; - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int64_t offset; - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TaskPriority taskID; - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Promise p; - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_req* r; - #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int result; - #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Error e; - #line 2365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" }; // This generated class is to be used only via read_impl() - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Read_implActor final : public Actor, public ActorCallback< Read_implActor, 0, Void >, public ActorCallback< Read_implActor, 1, Void >, public ActorCallback< Read_implActor, 2, Void >, public FastAllocated, public Read_implActorState { - #line 2370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2378,9 +2378,9 @@ class Read_implActor final : public Actor, public ActorCallback< Read_implA friend struct ActorCallback< Read_implActor, 0, Void >; friend struct ActorCallback< Read_implActor, 1, Void >; friend struct ActorCallback< Read_implActor, 2, Void >; - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Read_implActor(int const& fd,void* const& data,int const& length,int64_t const& offset) - #line 2383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" : Actor(), Read_implActorState(fd, data, length, offset) { @@ -2405,41 +2405,41 @@ friend struct ActorCallback< Read_implActor, 2, Void >; } }; - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" [[nodiscard]] static Future read_impl( int const& fd, void* const& data, int const& length, int64_t const& offset ) { - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return Future(new Read_implActor(fd, data, length, offset)); - #line 2412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } -#line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" - #line 2417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" // This generated class is to be used only via write_impl() - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Write_implActorState { - #line 2423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Write_implActorState(int const& fd,Reference const& err,StringRef const& data,int64_t const& offset) - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" : fd(fd), - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" err(err), - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" data(data), - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" offset(offset), - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" taskID(g_network->getCurrentTask()), - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" p(), - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" r(eio_write(fd, (void*)data.begin(), data.size(), offset, 0, eio_callback, &p)) - #line 2442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { fdb_probe_actor_create("write_impl", reinterpret_cast(this)); @@ -2453,16 +2453,16 @@ class Write_implActorState { { try { try { - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_0 = p.getFuture(); - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2489,24 +2489,24 @@ class Write_implActorState { } int a_body1cont1(int loopDepth) { - #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (r->result != data.size()) - #line 2494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" error("WriteError", fd, r, err); - #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_1 = delay(0, taskID); - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; return loopDepth; @@ -2514,13 +2514,13 @@ class Write_implActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" g_network->setCurrentTask(taskID); - #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_cancel(r); - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(__current_error, loopDepth); - #line 2523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -2620,9 +2620,9 @@ class Write_implActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Write_implActorState(); static_cast(this)->destroy(); return 0; } - #line 2625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Write_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2632,9 +2632,9 @@ class Write_implActorState { } int a_body1cont4(Void && _,int loopDepth) { - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Write_implActorState(); static_cast(this)->destroy(); return 0; } - #line 2637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Write_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2705,26 +2705,26 @@ class Write_implActorState { fdb_probe_actor_exit("write_impl", reinterpret_cast(this), 1); } - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int fd; - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Reference err; - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StringRef data; - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int64_t offset; - #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TaskPriority taskID; - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Promise p; - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_req* r; - #line 2722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" }; // This generated class is to be used only via write_impl() - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Write_implActor final : public Actor, public ActorCallback< Write_implActor, 0, Void >, public ActorCallback< Write_implActor, 1, Void >, public FastAllocated, public Write_implActorState { - #line 2727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2734,9 +2734,9 @@ class Write_implActor final : public Actor, public ActorCallback< Write_im #pragma clang diagnostic pop friend struct ActorCallback< Write_implActor, 0, Void >; friend struct ActorCallback< Write_implActor, 1, Void >; - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Write_implActor(int const& fd,Reference const& err,StringRef const& data,int64_t const& offset) - #line 2739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" : Actor(), Write_implActorState(fd, err, data, offset) { @@ -2760,39 +2760,39 @@ friend struct ActorCallback< Write_implActor, 1, Void >; } }; - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" [[nodiscard]] static Future write_impl( int const& fd, Reference const& err, StringRef const& data, int64_t const& offset ) { - #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return Future(new Write_implActor(fd, err, data, offset)); - #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } -#line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" - #line 2772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" // This generated class is to be used only via truncate_impl() - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Truncate_implActorState { - #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Truncate_implActorState(int const& fd,Reference const& err,int64_t const& size) - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" : fd(fd), - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" err(err), - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" size(size), - #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" taskID(g_network->getCurrentTask()), - #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" p(), - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" r(eio_ftruncate(fd, size, 0, eio_callback, &p)) - #line 2795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { fdb_probe_actor_create("truncate_impl", reinterpret_cast(this)); @@ -2806,16 +2806,16 @@ class Truncate_implActorState { { try { try { - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_0 = p.getFuture(); - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2842,24 +2842,24 @@ class Truncate_implActorState { } int a_body1cont1(int loopDepth) { - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (r->result) - #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" error("TruncateError", fd, r, err); - #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_1 = delay(0, taskID); - #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; return loopDepth; @@ -2867,13 +2867,13 @@ class Truncate_implActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" g_network->setCurrentTask(taskID); - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_cancel(r); - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(__current_error, loopDepth); - #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -2973,9 +2973,9 @@ class Truncate_implActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Truncate_implActorState(); static_cast(this)->destroy(); return 0; } - #line 2978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Truncate_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2985,9 +2985,9 @@ class Truncate_implActorState { } int a_body1cont4(Void && _,int loopDepth) { - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Truncate_implActorState(); static_cast(this)->destroy(); return 0; } - #line 2990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 2990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Truncate_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3058,24 +3058,24 @@ class Truncate_implActorState { fdb_probe_actor_exit("truncate_impl", reinterpret_cast(this), 1); } - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int fd; - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Reference err; - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int64_t size; - #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TaskPriority taskID; - #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Promise p; - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_req* r; - #line 3073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" }; // This generated class is to be used only via truncate_impl() - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Truncate_implActor final : public Actor, public ActorCallback< Truncate_implActor, 0, Void >, public ActorCallback< Truncate_implActor, 1, Void >, public FastAllocated, public Truncate_implActorState { - #line 3078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3085,9 +3085,9 @@ class Truncate_implActor final : public Actor, public ActorCallback< Trunc #pragma clang diagnostic pop friend struct ActorCallback< Truncate_implActor, 0, Void >; friend struct ActorCallback< Truncate_implActor, 1, Void >; - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Truncate_implActor(int const& fd,Reference const& err,int64_t const& size) - #line 3090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" : Actor(), Truncate_implActorState(fd, err, size) { @@ -3111,14 +3111,14 @@ friend struct ActorCallback< Truncate_implActor, 1, Void >; } }; - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" [[nodiscard]] static Future truncate_impl( int const& fd, Reference const& err, int64_t const& size ) { - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return Future(new Truncate_implActor(fd, err, size)); - #line 3118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } -#line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" static eio_req* start_fsync(int fd, Promise& p, bool sync_metadata) { #ifdef __APPLE__ @@ -3141,30 +3141,30 @@ friend struct ActorCallback< Truncate_implActor, 1, Void >; #endif } - #line 3144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" // This generated class is to be used only via sync_impl() - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Sync_implActorState { - #line 3150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Sync_implActorState(int const& fd,Reference const& err,bool const& sync_metadata = false) - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" : fd(fd), - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" err(err), - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" sync_metadata(sync_metadata), - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" taskID(g_network->getCurrentTask()), - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" p(), - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" r(start_fsync(fd, p, sync_metadata)) - #line 3167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { fdb_probe_actor_create("sync_impl", reinterpret_cast(this)); @@ -3178,16 +3178,16 @@ class Sync_implActorState { { try { try { - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_0 = p.getFuture(); - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 3185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -3215,26 +3215,26 @@ class Sync_implActorState { int a_body1cont1(int loopDepth) { try { - #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" err->report(); - #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (r->result) - #line 3222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" error("SyncError", fd, r); - #line 3226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_1 = delay(0, taskID); - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 3232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -3248,13 +3248,13 @@ class Sync_implActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" g_network->setCurrentTask(taskID); - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_cancel(r); - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(__current_error, loopDepth); - #line 3257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -3355,18 +3355,18 @@ class Sync_implActorState { int a_body1cont1Catch1(const Error& _e,int loopDepth=0) { try { - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" e = _e; - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_2 = delay(0, taskID); - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1Catch1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -3379,9 +3379,9 @@ class Sync_implActorState { } int a_body1cont5(Void const& _,int loopDepth) { - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Sync_implActorState(); static_cast(this)->destroy(); return 0; } - #line 3384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Sync_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3391,9 +3391,9 @@ class Sync_implActorState { } int a_body1cont5(Void && _,int loopDepth) { - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Sync_implActorState(); static_cast(this)->destroy(); return 0; } - #line 3396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Sync_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3466,17 +3466,17 @@ class Sync_implActorState { } int a_body1cont1Catch1cont1(Void const& _,int loopDepth) { - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(e, loopDepth); - #line 3471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" return loopDepth; } int a_body1cont1Catch1cont1(Void && _,int loopDepth) { - #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(e, loopDepth); - #line 3479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" return loopDepth; } @@ -3543,26 +3543,26 @@ class Sync_implActorState { fdb_probe_actor_exit("sync_impl", reinterpret_cast(this), 2); } - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int fd; - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Reference err; - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" bool sync_metadata; - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TaskPriority taskID; - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Promise p; - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_req* r; - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Error e; - #line 3560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" }; // This generated class is to be used only via sync_impl() - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Sync_implActor final : public Actor, public ActorCallback< Sync_implActor, 0, Void >, public ActorCallback< Sync_implActor, 1, Void >, public ActorCallback< Sync_implActor, 2, Void >, public FastAllocated, public Sync_implActorState { - #line 3565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3573,9 +3573,9 @@ class Sync_implActor final : public Actor, public ActorCallback< Sync_impl friend struct ActorCallback< Sync_implActor, 0, Void >; friend struct ActorCallback< Sync_implActor, 1, Void >; friend struct ActorCallback< Sync_implActor, 2, Void >; - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Sync_implActor(int const& fd,Reference const& err,bool const& sync_metadata = false) - #line 3578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" : Actor(), Sync_implActorState(fd, err, sync_metadata) { @@ -3600,35 +3600,35 @@ friend struct ActorCallback< Sync_implActor, 2, Void >; } }; - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" [[nodiscard]] static Future sync_impl( int const& fd, Reference const& err, bool const& sync_metadata = false ) { - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return Future(new Sync_implActor(fd, err, sync_metadata)); - #line 3607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } -#line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" - #line 3612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" // This generated class is to be used only via size_impl() - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Size_implActorState { - #line 3618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Size_implActorState(int const& fd) - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" : fd(fd), - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" taskID(g_network->getCurrentTask()), - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" p(), - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" r(eio_fstat(fd, 0, eio_callback, &p)) - #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { fdb_probe_actor_create("size_impl", reinterpret_cast(this)); @@ -3642,16 +3642,16 @@ class Size_implActorState { { try { try { - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_0 = p.getFuture(); - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -3678,36 +3678,36 @@ class Size_implActorState { } int a_body1cont1(int loopDepth) { - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (r->result) - #line 3683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" error("FStatError", fd, r); - #line 3687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" EIO_STRUCT_STAT* statdata = (EIO_STRUCT_STAT*)r->ptr2; - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!statdata) - #line 3693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" error("FStatBufferError", fd, r); - #line 3697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" size = statdata->st_size; - #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_1 = delay(0, taskID); - #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; return loopDepth; @@ -3715,13 +3715,13 @@ class Size_implActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" g_network->setCurrentTask(taskID); - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_cancel(r); - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(__current_error, loopDepth); - #line 3724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -3821,9 +3821,9 @@ class Size_implActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(size); this->~Size_implActorState(); static_cast(this)->destroy(); return 0; } - #line 3826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< int64_t >::value()) int64_t(std::move(size)); // state_var_RVO this->~Size_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3833,9 +3833,9 @@ class Size_implActorState { } int a_body1cont4(Void && _,int loopDepth) { - #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(size); this->~Size_implActorState(); static_cast(this)->destroy(); return 0; } - #line 3838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< int64_t >::value()) int64_t(std::move(size)); // state_var_RVO this->~Size_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3906,22 +3906,22 @@ class Size_implActorState { fdb_probe_actor_exit("size_impl", reinterpret_cast(this), 1); } - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int fd; - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TaskPriority taskID; - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Promise p; - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_req* r; - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" int64_t size; - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" }; // This generated class is to be used only via size_impl() - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Size_implActor final : public Actor, public ActorCallback< Size_implActor, 0, Void >, public ActorCallback< Size_implActor, 1, Void >, public FastAllocated, public Size_implActorState { - #line 3924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3931,9 +3931,9 @@ class Size_implActor final : public Actor, public ActorCallback< Size_i #pragma clang diagnostic pop friend struct ActorCallback< Size_implActor, 0, Void >; friend struct ActorCallback< Size_implActor, 1, Void >; - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Size_implActor(int const& fd) - #line 3936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" : Actor(), Size_implActorState(fd) { @@ -3957,37 +3957,37 @@ friend struct ActorCallback< Size_implActor, 1, Void >; } }; - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" [[nodiscard]] static Future size_impl( int const& fd ) { - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return Future(new Size_implActor(fd)); - #line 3964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } -#line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" - #line 3969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" // This generated class is to be used only via stat_impl() - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Stat_implActorState { - #line 3975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Stat_implActorState(std::string const& filename) - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" : filename(filename), - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" taskID(g_network->getCurrentTask()), - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" p(), - #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" statdata(), - #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" r(eio_stat(filename.c_str(), 0, eio_callback, &p)) - #line 3990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 3990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { fdb_probe_actor_create("stat_impl", reinterpret_cast(this)); @@ -4001,16 +4001,16 @@ class Stat_implActorState { { try { try { - #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_0 = p.getFuture(); - #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 4008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -4037,34 +4037,34 @@ class Stat_implActorState { } int a_body1cont1(int loopDepth) { - #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (r->result) - #line 4042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" error("StatError", 0, r); - #line 4046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!r->ptr2) - #line 4050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" error("StatBufferError", 0, r); - #line 4054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" statdata = *EIO_STAT_BUF(r); - #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_1 = delay(0, taskID); - #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; return loopDepth; @@ -4072,13 +4072,13 @@ class Stat_implActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" g_network->setCurrentTask(taskID); - #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_cancel(r); - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(__current_error, loopDepth); - #line 4081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -4178,9 +4178,9 @@ class Stat_implActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(statdata); this->~Stat_implActorState(); static_cast(this)->destroy(); return 0; } - #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< EIO_STRUCT_STAT >::value()) EIO_STRUCT_STAT(std::move(statdata)); // state_var_RVO this->~Stat_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4190,9 +4190,9 @@ class Stat_implActorState { } int a_body1cont4(Void && _,int loopDepth) { - #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(statdata); this->~Stat_implActorState(); static_cast(this)->destroy(); return 0; } - #line 4195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< EIO_STRUCT_STAT >::value()) EIO_STRUCT_STAT(std::move(statdata)); // state_var_RVO this->~Stat_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4263,22 +4263,22 @@ class Stat_implActorState { fdb_probe_actor_exit("stat_impl", reinterpret_cast(this), 1); } - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" std::string filename; - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TaskPriority taskID; - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Promise p; - #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" EIO_STRUCT_STAT statdata; - #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_req* r; - #line 4276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" }; // This generated class is to be used only via stat_impl() - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Stat_implActor final : public Actor, public ActorCallback< Stat_implActor, 0, Void >, public ActorCallback< Stat_implActor, 1, Void >, public FastAllocated, public Stat_implActorState { - #line 4281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4288,9 +4288,9 @@ class Stat_implActor final : public Actor, public ActorCallback #pragma clang diagnostic pop friend struct ActorCallback< Stat_implActor, 0, Void >; friend struct ActorCallback< Stat_implActor, 1, Void >; - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Stat_implActor(std::string const& filename) - #line 4293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" : Actor(), Stat_implActorState(filename) { @@ -4314,35 +4314,35 @@ friend struct ActorCallback< Stat_implActor, 1, Void >; } }; - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" [[nodiscard]] static Future stat_impl( std::string const& filename ) { - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return Future(new Stat_implActor(filename)); - #line 4321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } -#line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" - #line 4326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" // This generated class is to be used only via dispatch_impl() - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Dispatch_implActorState { - #line 4332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Dispatch_implActorState(std::function const& func) - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" : func(func), - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" data(func), - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" taskID(g_network->getCurrentTask()), - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" r(eio_custom( [](eio_req* req) { auto data = reinterpret_cast*>(req->data); try { data->result = data->func(); req->result = 0; } catch (Error& e) { data->result = e; req->result = -1; } catch (...) { data->result = unknown_error(); req->result = -1; } }, 0, [](eio_req* req) { if (EIO_CANCELLED(req)) return 0; auto data = reinterpret_cast*>(req->data); Promise p = std::move(data->done); p.send(Void()); return 0; }, &data)) - #line 4345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { fdb_probe_actor_create("dispatch_impl", reinterpret_cast(this)); @@ -4356,16 +4356,16 @@ class Dispatch_implActorState { { try { try { - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_0 = data.done.getFuture(); - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 4363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -4392,16 +4392,16 @@ class Dispatch_implActorState { } int a_body1cont1(int loopDepth) { - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_1 = delay(0, taskID); - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; return loopDepth; @@ -4409,13 +4409,13 @@ class Dispatch_implActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" g_network->setCurrentTask(taskID); - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_cancel(r); - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(__current_error, loopDepth); - #line 4418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -4515,17 +4515,17 @@ class Dispatch_implActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (data.result.isError()) - #line 4520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(data.result.getError(), loopDepth); - #line 4524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(data.result.get()); this->~Dispatch_implActorState(); static_cast(this)->destroy(); return 0; } - #line 4528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< R >::value()) R(data.result.get()); this->~Dispatch_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4535,17 +4535,17 @@ class Dispatch_implActorState { } int a_body1cont4(Void && _,int loopDepth) { - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (data.result.isError()) - #line 4540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return a_body1Catch1(data.result.getError(), loopDepth); - #line 4544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(data.result.get()); this->~Dispatch_implActorState(); static_cast(this)->destroy(); return 0; } - #line 4548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" new (&static_cast(this)->SAV< R >::value()) R(data.result.get()); this->~Dispatch_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4616,22 +4616,22 @@ class Dispatch_implActorState { fdb_probe_actor_exit("dispatch_impl", reinterpret_cast(this), 1); } - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" std::function func; - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Dispatch data; - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" TaskPriority taskID; - #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" eio_req* r; - #line 4627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" }; // This generated class is to be used only via dispatch_impl() - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Dispatch_implActor final : public Actor, public ActorCallback< Dispatch_implActor, 0, Void >, public ActorCallback< Dispatch_implActor, 1, Void >, public FastAllocated>, public Dispatch_implActorState> { - #line 4634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -4641,9 +4641,9 @@ class Dispatch_implActor final : public Actor, public ActorCallback< Dispatch #pragma clang diagnostic pop friend struct ActorCallback< Dispatch_implActor, 0, Void >; friend struct ActorCallback< Dispatch_implActor, 1, Void >; - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Dispatch_implActor(std::function const& func) - #line 4646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" : Actor(), Dispatch_implActorState>(func) { @@ -4667,32 +4667,32 @@ friend struct ActorCallback< Dispatch_implActor, 1, Void >; } }; - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" [[nodiscard]] static Future dispatch_impl( std::function const& func ) { - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" return Future(new Dispatch_implActor(func)); - #line 4676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } -#line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" static std::atomic want_poll; - #line 4683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" // This generated class is to be used only via poll_eio() - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" template - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Poll_eioActorState { - #line 4689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Poll_eioActorState() - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" { - #line 4695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" fdb_probe_actor_create("poll_eio", reinterpret_cast(this)); } @@ -4704,9 +4704,9 @@ class Poll_eioActorState { int a_body1(int loopDepth=0) { try { - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" ; - #line 4709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -4726,9 +4726,9 @@ class Poll_eioActorState { } int a_body1cont1(int loopDepth) { - #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" want_poll = 0; - #line 4731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = a_body1cont3(loopDepth); return loopDepth; @@ -4742,21 +4742,21 @@ class Poll_eioActorState { } int a_body1loopBody1(int loopDepth) { - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (!(eio_poll() == -1)) - #line 4747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" StrictFuture __when_expr_0 = yield(); - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 4755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" static_cast(this)->actor_wait_state = 1; - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" loopDepth = 0; return loopDepth; @@ -4851,18 +4851,18 @@ class Poll_eioActorState { } int a_body1cont3(int loopDepth) { - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" delete static_cast(this); - #line 4856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" return 0; return loopDepth; } }; // This generated class is to be used only via poll_eio() - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" class Poll_eioActor final : public Actor, public ActorCallback< Poll_eioActor, 0, Void >, public FastAllocated, public Poll_eioActorState { - #line 4865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4871,9 +4871,9 @@ class Poll_eioActor final : public Actor, public ActorCallback< Poll_eioAc void destroy() {{ ((Actor*)this)->~Actor(); operator delete(this); }} #pragma clang diagnostic pop friend struct ActorCallback< Poll_eioActor, 0, Void >; - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" Poll_eioActor() - #line 4876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" : Actor(), Poll_eioActorState() { @@ -4887,14 +4887,14 @@ friend struct ActorCallback< Poll_eioActor, 0, Void >; } }; - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" static void poll_eio( ) { - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" new Poll_eioActor(); - #line 4894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.g.h" + #line 4894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.g.h" } -#line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileEIO.actor.h" +#line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h" static void eio_want_poll() { want_poll = 1; diff --git a/src/fdbrpc/AsyncFileEIO.actor.h b/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h similarity index 96% rename from src/fdbrpc/AsyncFileEIO.actor.h rename to src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h index 687ecea..a05e50a 100644 --- a/src/fdbrpc/AsyncFileEIO.actor.h +++ b/src/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h @@ -35,10 +35,10 @@ #include #include -#include "fdbrpc/libeio/eio.h" +#include "eio.h" #include "flow/flow.h" #include "flow/ThreadHelper.actor.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/TDMetric.actor.h" #include "flow/actorcompiler.h" // This must be the last #include. @@ -107,8 +107,8 @@ class AsyncFileEIO : public IAsyncFile, public ReferenceCounted { .detail("Flags", flags); if ((flags & OPEN_LOCK) && !lock_fd(r->result)) { - TraceEvent(SevError, "UnableToLockFile").detail("Filename", filename).GetLastError(); - throw io_error(); + TraceEvent(SevWarn, "UnableToLockFile").detail("Filename", filename).GetLastError(); + throw lock_file_failure(); } return Reference(new AsyncFileEIO(r->result, flags, filename)); @@ -116,7 +116,7 @@ class AsyncFileEIO : public IAsyncFile, public ReferenceCounted { static Future deleteFile(std::string filename, bool mustBeDurable) { ::deleteFile(filename); if (mustBeDurable) { - TEST(true); // deleteFile and fsync parent dir + CODE_PROBE(true, "deleteFile and fsync parent dir", probe::decoration::rare); return async_fsync_parent(filename); } else return Void(); @@ -279,11 +279,11 @@ class AsyncFileEIO : public IAsyncFile, public ReferenceCounted { AsyncFileEIO(int fd, int flags, std::string const& filename) : fd(fd), flags(flags), err(new ErrorInfo), filename(filename) { if (!g_network->isSimulated()) { - countFileLogicalWrites.init(LiteralStringRef("AsyncFile.CountFileLogicalWrites"), filename); - countFileLogicalReads.init(LiteralStringRef("AsyncFile.CountFileLogicalReads"), filename); + countFileLogicalWrites.init("AsyncFile.CountFileLogicalWrites"_sr, filename); + countFileLogicalReads.init("AsyncFile.CountFileLogicalReads"_sr, filename); - countLogicalWrites.init(LiteralStringRef("AsyncFile.CountLogicalWrites")); - countLogicalReads.init(LiteralStringRef("AsyncFile.CountLogicalReads")); + countLogicalWrites.init("AsyncFile.CountLogicalWrites"_sr); + countLogicalReads.init("AsyncFile.CountLogicalReads"_sr); } } diff --git a/src/fdbrpc/AsyncFileEncrypted.h b/src/fdbrpc/include/fdbrpc/AsyncFileEncrypted.h similarity index 96% rename from src/fdbrpc/AsyncFileEncrypted.h rename to src/fdbrpc/include/fdbrpc/AsyncFileEncrypted.h index a01c32f..78c348d 100644 --- a/src/fdbrpc/AsyncFileEncrypted.h +++ b/src/fdbrpc/include/fdbrpc/AsyncFileEncrypted.h @@ -20,14 +20,12 @@ #pragma once -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/FastRef.h" #include "flow/flow.h" #include "flow/IRandom.h" #include "flow/StreamCipher.h" -#if ENCRYPTION_ENABLED - #include /* @@ -81,5 +79,3 @@ class AsyncFileEncrypted : public IAsyncFile, public ReferenceCounted #include @@ -39,11 +39,10 @@ #include #include #include "fdbrpc/linux_kaio.h" -#include "fdbserver/Knobs.h" #include "flow/Knobs.h" -#include "flow/Histogram.h" +#include "fdbrpc/Stats.h" #include "flow/UnitTest.h" -#include "flow/crc32c.h" +#include "crc32/crc32c.h" #include "flow/genericactors.actor.h" #include "flow/actorcompiler.h" // This must be the last #include. @@ -51,49 +50,41 @@ // /data/v7/fdb/ #define KAIO_LOGGING 0 -struct AsyncFileKAIOMetrics { - Reference readLatencyDist; - Reference writeLatencyDist; - Reference syncLatencyDist; -} g_asyncFileKAIOMetrics; - -Future g_asyncFileKAIOHistogramLogger; - template<> struct Descriptor { - static StringRef typeName() { return LiteralStringRef("SlowAioSubmit"); } + static StringRef typeName() { return "SlowAioSubmit"_sr; } typedef SlowAioSubmit type; struct submitDurationDescriptor { - static StringRef name() { return LiteralStringRef("submitDuration"); } - static StringRef typeName() { return LiteralStringRef("int64_t"); } - static StringRef comment() { return LiteralStringRef(" ns"); } + static StringRef name() { return "submitDuration"_sr; } + static StringRef typeName() { return "int64_t"_sr; } + static StringRef comment() { return " ns"_sr; } typedef int64_t type; static inline type get(SlowAioSubmit& from); }; struct truncateDurationDescriptor { - static StringRef name() { return LiteralStringRef("truncateDuration"); } - static StringRef typeName() { return LiteralStringRef("int64_t"); } - static StringRef comment() { return LiteralStringRef(" ns"); } + static StringRef name() { return "truncateDuration"_sr; } + static StringRef typeName() { return "int64_t"_sr; } + static StringRef comment() { return " ns"_sr; } typedef int64_t type; static inline type get(SlowAioSubmit& from); }; struct numTruncatesDescriptor { - static StringRef name() { return LiteralStringRef("numTruncates"); } - static StringRef typeName() { return LiteralStringRef("int64_t"); } - static StringRef comment() { return LiteralStringRef(""); } + static StringRef name() { return "numTruncates"_sr; } + static StringRef typeName() { return "int64_t"_sr; } + static StringRef comment() { return ""_sr; } typedef int64_t type; static inline type get(SlowAioSubmit& from); }; struct truncateBytesDescriptor { - static StringRef name() { return LiteralStringRef("truncateBytes"); } - static StringRef typeName() { return LiteralStringRef("int64_t"); } - static StringRef comment() { return LiteralStringRef(""); } + static StringRef name() { return "truncateBytes"_sr; } + static StringRef typeName() { return "int64_t"_sr; } + static StringRef comment() { return ""_sr; } typedef int64_t type; static inline type get(SlowAioSubmit& from); }; struct largestTruncateDescriptor { - static StringRef name() { return LiteralStringRef("largestTruncate"); } - static StringRef typeName() { return LiteralStringRef("int64_t"); } - static StringRef comment() { return LiteralStringRef(""); } + static StringRef name() { return "largestTruncate"_sr; } + static StringRef typeName() { return "int64_t"_sr; } + static StringRef comment() { return ""_sr; } typedef int64_t type; static inline type get(SlowAioSubmit& from); }; @@ -112,11 +103,30 @@ int64_t Descriptor::truncateDurationDescriptor::get(SlowAioSubmit int64_t Descriptor::numTruncatesDescriptor::get(SlowAioSubmit& from) { return from.numTruncates; } int64_t Descriptor::truncateBytesDescriptor::get(SlowAioSubmit& from) { return from.truncateBytes; } int64_t Descriptor::largestTruncateDescriptor::get(SlowAioSubmit& from) { return from.largestTruncate; } -#line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" +#line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" class AsyncFileKAIO final : public IAsyncFile, public ReferenceCounted { public: + struct AsyncFileKAIOMetrics { + LatencySample readLatencySample = { "AsyncFileKAIOReadLatency", + UID(), + FLOW_KNOBS->KAIO_LATENCY_LOGGING_INTERVAL, + FLOW_KNOBS->KAIO_LATENCY_SKETCH_ACCURACY }; + LatencySample writeLatencySample = { "AsyncFileKAIOWriteLatency", + UID(), + FLOW_KNOBS->KAIO_LATENCY_LOGGING_INTERVAL, + FLOW_KNOBS->KAIO_LATENCY_SKETCH_ACCURACY }; + LatencySample syncLatencySample = { "AsyncFileKAIOSyncLatency", + UID(), + FLOW_KNOBS->KAIO_LATENCY_LOGGING_INTERVAL, + FLOW_KNOBS->KAIO_LATENCY_SKETCH_ACCURACY }; + }; + + static AsyncFileKAIOMetrics& getMetrics() { + static AsyncFileKAIOMetrics metrics; + return metrics; + } #if KAIO_LOGGING private: @@ -213,8 +223,8 @@ class AsyncFileKAIO final : public IAsyncFile, public ReferenceCounted ev, double ioTimeout) { ASSERT(!FLOW_KNOBS->DISABLE_POSIX_KERNEL_AIO); if (!g_network->isSimulated()) { - ctx.countAIOSubmit.init(LiteralStringRef("AsyncFile.CountAIOSubmit")); - ctx.countAIOCollect.init(LiteralStringRef("AsyncFile.CountAIOCollect")); - ctx.submitMetric.init(LiteralStringRef("AsyncFile.Submit")); - ctx.countPreSubmitTruncate.init(LiteralStringRef("AsyncFile.CountPreAIOSubmitTruncate")); - ctx.preSubmitTruncateBytes.init(LiteralStringRef("AsyncFile.PreAIOSubmitTruncateBytes")); - ctx.slowAioSubmitMetric.init(LiteralStringRef("AsyncFile.SlowAIOSubmit")); + ctx.countAIOSubmit.init("AsyncFile.CountAIOSubmit"_sr); + ctx.countAIOCollect.init("AsyncFile.CountAIOCollect"_sr); + ctx.submitMetric.init("AsyncFile.Submit"_sr); + ctx.countPreSubmitTruncate.init("AsyncFile.CountPreAIOSubmitTruncate"_sr); + ctx.preSubmitTruncateBytes.init("AsyncFile.PreAIOSubmitTruncateBytes"_sr); + ctx.slowAioSubmitMetric.init("AsyncFile.SlowAIOSubmit"_sr); } int rc = io_setup(FLOW_KNOBS->MAX_OUTSTANDING, &ctx.iocx); @@ -383,22 +393,22 @@ class AsyncFileKAIO final : public IAsyncFile, public ReferenceCounted - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" class ThrowErrorIfFailedActorState { - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" public: - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ThrowErrorIfFailedActorState(Reference const& self,Future const& sync) - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" : self(self), - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" sync(sync) - #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { fdb_probe_actor_create("throwErrorIfFailed", reinterpret_cast(this)); @@ -411,16 +421,16 @@ class ThrowErrorIfFailedActorState { int a_body1(int loopDepth=0) { try { - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_0 = sync; - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -441,17 +451,17 @@ class ThrowErrorIfFailedActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (self->failed) - #line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" return a_body1Catch1(io_timeout(), loopDepth); - #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ThrowErrorIfFailedActorState(); static_cast(this)->destroy(); return 0; } - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ThrowErrorIfFailedActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -461,17 +471,17 @@ class ThrowErrorIfFailedActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (self->failed) - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" return a_body1Catch1(io_timeout(), loopDepth); - #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ThrowErrorIfFailedActorState(); static_cast(this)->destroy(); return 0; } - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ThrowErrorIfFailedActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -542,16 +552,16 @@ class ThrowErrorIfFailedActorState { fdb_probe_actor_exit("throwErrorIfFailed", reinterpret_cast(this), 0); } - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" Reference self; - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" Future sync; - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" }; // This generated class is to be used only via throwErrorIfFailed() - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" class ThrowErrorIfFailedActor final : public Actor, public ActorCallback< ThrowErrorIfFailedActor, 0, Void >, public FastAllocated, public ThrowErrorIfFailedActorState { - #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -560,9 +570,9 @@ class ThrowErrorIfFailedActor final : public Actor, public ActorCallback< void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ThrowErrorIfFailedActor, 0, Void >; - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ThrowErrorIfFailedActor(Reference const& self,Future const& sync) - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" : Actor(), ThrowErrorIfFailedActorState(self, sync) { @@ -585,14 +595,14 @@ friend struct ActorCallback< ThrowErrorIfFailedActor, 0, Void >; } }; - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" [[nodiscard]] static Future throwErrorIfFailed( Reference const& self, Future const& sync ) { - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" return Future(new ThrowErrorIfFailedActor(self, sync)); - #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } -#line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" +#line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" Future sync() override { ++countFileLogicalWrites; @@ -607,7 +617,7 @@ friend struct ActorCallback< ThrowErrorIfFailedActor, 0, Void >; #endif KAIOLogEvent(logFile, id, OpLogEntry::SYNC, OpLogEntry::START); - double start_time = now(); + double start_time = timer(); Future fsync = throwErrorIfFailed( Reference::addRef(this), @@ -619,7 +629,7 @@ friend struct ActorCallback< ThrowErrorIfFailedActor, 0, Void >; fsync = map(fsync, [=](Void r) mutable { KAIOLogEvent(logFile, id, OpLogEntry::SYNC, OpLogEntry::COMPLETE); - g_asyncFileKAIOMetrics.syncLatencyDist->sampleSeconds(now() - start_time); + getMetrics().syncLatencySample.addMeasurement(timer() - start_time); return r; }); @@ -658,6 +668,7 @@ friend struct ActorCallback< ThrowErrorIfFailedActor, 0, Void >; int64_t previousTruncateBytes = ctx.preSubmitTruncateBytes; int64_t largestTruncate = 0; + double start = timer(); for (int i = 0; i < n; i++) { auto io = ctx.queue.top(); @@ -665,7 +676,7 @@ friend struct ActorCallback< ThrowErrorIfFailedActor, 0, Void >; ctx.queue.pop(); toStart[i] = io; - io->startTime = now(); + io->startTime = start; if (ctx.ioTimeout > 0) { ctx.appendToRequestList(io); @@ -768,26 +779,26 @@ friend struct ActorCallback< ThrowErrorIfFailedActor, 0, Void >; TaskPriority getTask() const { return static_cast((prio >> 32) + 1); } - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" // This generated class is to be used only via deliver() - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" template - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" class DeliverActorState { - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" public: - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" DeliverActorState(Promise const& result,bool const& failed,int const& r,TaskPriority const& task) - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" : result(result), - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" failed(failed), - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" r(r), - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" task(task) - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { fdb_probe_actor_create("deliver", reinterpret_cast(this)); @@ -800,15 +811,15 @@ class DeliverActorState { int a_body1(int loopDepth=0) { try { - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_0 = delay(0, task); - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" static_cast(this)->actor_wait_state = 1; - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -828,29 +839,29 @@ class DeliverActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (failed) - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" result.sendError(io_timeout()); - #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } else { - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (r < 0) - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" result.sendError(io_error()); - #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } else { - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" result.send(r); - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } } loopDepth = a_body1cont7(loopDepth); @@ -859,29 +870,29 @@ class DeliverActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (failed) - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" result.sendError(io_timeout()); - #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } else { - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (r < 0) - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" result.sendError(io_error()); - #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } else { - #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" result.send(r); - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } } loopDepth = a_body1cont7(loopDepth); @@ -953,27 +964,27 @@ class DeliverActorState { } int a_body1cont7(int loopDepth) { - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" delete static_cast(this); - #line 958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" return 0; return loopDepth; } - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" Promise result; - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" bool failed; - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" int r; - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" TaskPriority task; - #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" }; // This generated class is to be used only via deliver() - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" class DeliverActor final : public Actor, public ActorCallback< DeliverActor, 0, Void >, public FastAllocated, public DeliverActorState { - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -982,9 +993,9 @@ class DeliverActor final : public Actor, public ActorCallback< DeliverActo void destroy() {{ ((Actor*)this)->~Actor(); operator delete(this); }} #pragma clang diagnostic pop friend struct ActorCallback< DeliverActor, 0, Void >; - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" DeliverActor(Promise const& result,bool const& failed,int const& r,TaskPriority const& task) - #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" : Actor(), DeliverActorState(result, failed, r, task) { @@ -998,14 +1009,14 @@ friend struct ActorCallback< DeliverActor, 0, Void >; } }; - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" static void deliver( Promise const& result, bool const& failed, int const& r, TaskPriority const& task ) { - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" new DeliverActor(result, failed, r, task); - #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } -#line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" +#line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" void setResult(int r) { if (r < 0) { @@ -1119,27 +1130,17 @@ static void deliver( Promise const& result, bool const& failed, int const& : failed(false), fd(fd), flags(flags), filename(filename) { ASSERT(!FLOW_KNOBS->DISABLE_POSIX_KERNEL_AIO); if (!g_network->isSimulated()) { - countFileLogicalWrites.init(LiteralStringRef("AsyncFile.CountFileLogicalWrites"), filename); - countFileLogicalReads.init(LiteralStringRef("AsyncFile.CountFileLogicalReads"), filename); - countLogicalWrites.init(LiteralStringRef("AsyncFile.CountLogicalWrites")); - countLogicalReads.init(LiteralStringRef("AsyncFile.CountLogicalReads")); - if (!g_asyncFileKAIOHistogramLogger.isValid()) { - auto& metrics = g_asyncFileKAIOMetrics; - metrics.readLatencyDist = Reference(new Histogram( - Reference(), "AsyncFileKAIO", "ReadLatency", Histogram::Unit::microseconds)); - metrics.writeLatencyDist = Reference(new Histogram( - Reference(), "AsyncFileKAIO", "WriteLatency", Histogram::Unit::microseconds)); - metrics.syncLatencyDist = Reference(new Histogram( - Reference(), "AsyncFileKAIO", "SyncLatency", Histogram::Unit::microseconds)); - g_asyncFileKAIOHistogramLogger = histogramLogger(SERVER_KNOBS->DISK_METRIC_LOGGING_INTERVAL); - } + countFileLogicalWrites.init("AsyncFile.CountFileLogicalWrites"_sr, filename); + countFileLogicalReads.init("AsyncFile.CountFileLogicalReads"_sr, filename); + countLogicalWrites.init("AsyncFile.CountLogicalWrites"_sr); + countLogicalReads.init("AsyncFile.CountLogicalReads"_sr); } #if KAIO_LOGGING logFile = nullptr; // TODO: Don't do this hacky investigation-specific thing StringRef fname(filename); - if (fname.endsWith(LiteralStringRef(".sqlite")) || fname.endsWith(LiteralStringRef(".sqlite-wal"))) { + if (fname.endsWith(".sqlite"_sr) || fname.endsWith(".sqlite-wal"_sr)) { std::string logFileName = basename(filename); while (logFileName.find("/") != std::string::npos) logFileName = logFileName.substr(logFileName.find("/") + 1); @@ -1199,20 +1200,20 @@ static void deliver( Promise const& result, bool const& failed, int const& return oflags; } - #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" // This generated class is to be used only via poll() - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" template - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" class PollActorState { - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" public: - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" PollActorState(Reference const& ev) - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" : ev(ev) - #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { fdb_probe_actor_create("poll", reinterpret_cast(this)); @@ -1225,9 +1226,9 @@ class PollActorState { int a_body1(int loopDepth=0) { try { - #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ; - #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1254,45 +1255,45 @@ class PollActorState { } int a_body1loopBody1(int loopDepth) { - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_0 = success(ev->read()); - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" static_cast(this)->actor_wait_state = 1; - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_1 = delay(0, TaskPriority::DiskIOComplete); - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" static_cast(this)->actor_wait_state = 2; - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_1 = delay(0, TaskPriority::DiskIOComplete); - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; - #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" static_cast(this)->actor_wait_state = 2; - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; return loopDepth; @@ -1362,91 +1363,89 @@ class PollActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" linux_ioresult ev[FLOW_KNOBS->MAX_OUTSTANDING]; - #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" timespec tm; - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" tm.tv_sec = 0; - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" tm.tv_nsec = 0; - #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" int n; - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" for(;;) { - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" n = io_getevents(ctx.iocx, 0, FLOW_KNOBS->MAX_OUTSTANDING, ev, &tm); - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (n >= 0 || errno != EINTR) - #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { break; } } - #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + double currentTime = timer(); + #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ++ctx.countAIOCollect; - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (n < 0) - #line 1390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" TraceEvent("IOGetEventsError").GetLastError(); - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" return a_body1Catch1(io_error(), std::max(0, loopDepth - 1)); - #line 1396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (n) - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" double t = timer_monotonic(); - #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" double elapsed = t - ctx.ioStallBegin; - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ctx.ioStallBegin = t; - #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" g_network->networkInfo.metrics.secSquaredDiskStall += elapsed * elapsed / 2; - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ctx.outstanding -= n; - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (ctx.ioTimeout > 0) - #line 1416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - double currentTime = now(); - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" for(;ctx.submittedRequestList && currentTime - ctx.submittedRequestList->startTime > ctx.ioTimeout;) { - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ctx.submittedRequestList->timeout(ctx.timeoutWarnOnly); - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ctx.removeFromRequestList(ctx.submittedRequestList); - #line 1426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } } - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" for(int i = 0;i < n;i++) { - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" IOBlock* iob = static_cast(ev[i].iocb); - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" KAIOLogBlockEvent(iob, OpLogEntry::COMPLETE, ev[i].result); - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (ctx.ioTimeout > 0) - #line 1437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ctx.removeFromRequestList(iob); - #line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - auto& metrics = g_asyncFileKAIOMetrics; - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - switch (iob->aio_lio_opcode) { case IO_CMD_PREAD: metrics.readLatencyDist->sampleSeconds(now() - iob->startTime); break; case IO_CMD_PWRITE: metrics.writeLatencyDist->sampleSeconds(now() - iob->startTime); break; }; - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + switch (iob->aio_lio_opcode) { case IO_CMD_PREAD: getMetrics().readLatencySample.addMeasurement(currentTime - iob->startTime); break; case IO_CMD_PWRITE: getMetrics().writeLatencySample.addMeasurement(currentTime - iob->startTime); break; }; + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" iob->setResult(ev[i].result); - #line 1449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } if (loopDepth == 0) return a_body1loopHead1(0); @@ -1454,91 +1453,89 @@ class PollActorState { } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" linux_ioresult ev[FLOW_KNOBS->MAX_OUTSTANDING]; - #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" timespec tm; - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" tm.tv_sec = 0; - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" tm.tv_nsec = 0; - #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" int n; - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" for(;;) { - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" n = io_getevents(ctx.iocx, 0, FLOW_KNOBS->MAX_OUTSTANDING, ev, &tm); - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (n >= 0 || errno != EINTR) - #line 1473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { break; } } - #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + double currentTime = timer(); + #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ++ctx.countAIOCollect; - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (n < 0) - #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1483 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" TraceEvent("IOGetEventsError").GetLastError(); - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" return a_body1Catch1(io_error(), std::max(0, loopDepth - 1)); - #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (n) - #line 1492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" double t = timer_monotonic(); - #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" double elapsed = t - ctx.ioStallBegin; - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ctx.ioStallBegin = t; - #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" g_network->networkInfo.metrics.secSquaredDiskStall += elapsed * elapsed / 2; - #line 1502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } - #line 754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ctx.outstanding -= n; - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (ctx.ioTimeout > 0) - #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - double currentTime = now(); - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" for(;ctx.submittedRequestList && currentTime - ctx.submittedRequestList->startTime > ctx.ioTimeout;) { - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ctx.submittedRequestList->timeout(ctx.timeoutWarnOnly); - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ctx.removeFromRequestList(ctx.submittedRequestList); - #line 1518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } } - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" for(int i = 0;i < n;i++) { - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" IOBlock* iob = static_cast(ev[i].iocb); - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" KAIOLogBlockEvent(iob, OpLogEntry::COMPLETE, ev[i].result); - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (ctx.ioTimeout > 0) - #line 1529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ctx.removeFromRequestList(iob); - #line 1533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - auto& metrics = g_asyncFileKAIOMetrics; - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - switch (iob->aio_lio_opcode) { case IO_CMD_PREAD: metrics.readLatencyDist->sampleSeconds(now() - iob->startTime); break; case IO_CMD_PWRITE: metrics.writeLatencyDist->sampleSeconds(now() - iob->startTime); break; }; - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + switch (iob->aio_lio_opcode) { case IO_CMD_PREAD: getMetrics().readLatencySample.addMeasurement(currentTime - iob->startTime); break; case IO_CMD_PWRITE: getMetrics().writeLatencySample.addMeasurement(currentTime - iob->startTime); break; }; + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" iob->setResult(ev[i].result); - #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } if (loopDepth == 0) return a_body1loopHead1(0); @@ -1607,14 +1604,14 @@ class PollActorState { fdb_probe_actor_exit("poll", reinterpret_cast(this), 1); } - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" Reference ev; - #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" }; // This generated class is to be used only via poll() - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" class PollActor final : public Actor, public ActorCallback< PollActor, 0, Void >, public ActorCallback< PollActor, 1, Void >, public FastAllocated, public PollActorState { - #line 1617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1624,9 +1621,9 @@ class PollActor final : public Actor, public ActorCallback< PollActor, 0, #pragma clang diagnostic pop friend struct ActorCallback< PollActor, 0, Void >; friend struct ActorCallback< PollActor, 1, Void >; - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" PollActor(Reference const& ev) - #line 1629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" : Actor(), PollActorState(ev) { @@ -1640,237 +1637,14 @@ friend struct ActorCallback< PollActor, 1, Void >; } }; - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" static void poll( Reference const& ev ) { - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" new PollActor(ev); - #line 1647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" -} - -#line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - - #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" -// This generated class is to be used only via histogramLogger() - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" -template - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" -class HistogramLoggerActorState { - #line 1658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" -public: - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - HistogramLoggerActorState(double const& interval) - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - : interval(interval), - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - currentTime() - #line 1667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" - { - fdb_probe_actor_create("histogramLogger", reinterpret_cast(this)); - - } - ~HistogramLoggerActorState() - { - fdb_probe_actor_destroy("histogramLogger", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - ; - #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~HistogramLoggerActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) - { - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - currentTime = now(); - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - StrictFuture __when_expr_0 = delay(interval); - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont1(Void const& _,int loopDepth) - { - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - double elapsed = now() - currentTime; - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - auto& metrics = g_asyncFileKAIOMetrics; - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - metrics.readLatencyDist->writeToLog(elapsed); - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - metrics.writeLatencyDist->writeToLog(elapsed); - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - metrics.syncLatencyDist->writeToLog(elapsed); - #line 1738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1cont1(Void && _,int loopDepth) - { - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - double elapsed = now() - currentTime; - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - auto& metrics = g_asyncFileKAIOMetrics; - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - metrics.readLatencyDist->writeToLog(elapsed); - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - metrics.writeLatencyDist->writeToLog(elapsed); - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - metrics.syncLatencyDist->writeToLog(elapsed); - #line 1755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< HistogramLoggerActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< HistogramLoggerActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("histogramLogger", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("histogramLogger", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< HistogramLoggerActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("histogramLogger", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("histogramLogger", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< HistogramLoggerActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("histogramLogger", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("histogramLogger", reinterpret_cast(this), 0); - - } - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - double interval; - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - double currentTime; - #line 1827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" -}; -// This generated class is to be used only via histogramLogger() - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" -class HistogramLoggerActor final : public Actor, public ActorCallback< HistogramLoggerActor, 0, Void >, public FastAllocated, public HistogramLoggerActorState { - #line 1832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< HistogramLoggerActor, 0, Void >; - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - HistogramLoggerActor(double const& interval) - #line 1843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" - : Actor(), - HistogramLoggerActorState(interval) - { - fdb_probe_actor_enter("histogramLogger", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("histogramLogger"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("histogramLogger", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< HistogramLoggerActor, 0, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" -[[nodiscard]] static Future histogramLogger( double const& interval ) { - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - return Future(new HistogramLoggerActor(interval)); - #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } -#line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" +#line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" }; #if KAIO_LOGGING @@ -1936,33 +1710,33 @@ void AsyncFileKAIO::KAIOLogEvent(FILE* logFile, } #endif - #line 1939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" namespace { // This generated class is to be used only via runTestOps() - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" template - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" class RunTestOpsActorState { - #line 1946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" public: - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" RunTestOpsActorState(Reference const& f,int const& numIterations,int const& fileSize,bool const& expectedToSucceed) - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" : f(f), - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" numIterations(numIterations), - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" fileSize(fileSize), - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" expectedToSucceed(expectedToSucceed), - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" buf(FastAllocator<4096>::allocate()), - #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" iteration(0), - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" opTimedOut(false) - #line 1965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { fdb_probe_actor_create("runTestOps", reinterpret_cast(this)); @@ -1975,9 +1749,9 @@ class RunTestOpsActorState { int a_body1(int loopDepth=0) { try { - #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ; - #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1998,13 +1772,13 @@ class RunTestOpsActorState { } int a_body1cont1(int loopDepth) { - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" FastAllocator<4096>::release(buf); - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ASSERT(expectedToSucceed || opTimedOut); - #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RunTestOpsActorState(); static_cast(this)->destroy(); return 0; } - #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~RunTestOpsActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2021,38 +1795,38 @@ class RunTestOpsActorState { } int a_body1loopBody1(int loopDepth) { - #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (!(iteration < numIterations)) - #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" futures = std::vector>(); - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" numOps = deterministicRandom()->randomInt(1, 20); - #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" for(;numOps > 0;--numOps) { - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (deterministicRandom()->coinflip()) - #line 2038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" futures.push_back( success(f->read(buf, 4096, deterministicRandom()->randomInt(0, fileSize) / 4096 * 4096))); - #line 2042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } else { - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" futures.push_back(f->write(buf, 4096, deterministicRandom()->randomInt(0, fileSize) / 4096 * 4096)); - #line 2048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } } - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" fIndex = 0; - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ; - #line 2055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = a_body1loopBody1loopHead1(loopDepth); return loopDepth; @@ -2073,16 +1847,16 @@ class RunTestOpsActorState { int a_body1loopBody1cont1(int loopDepth) { try { - #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_1 = f->sync() && delay(0.1); - #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 2080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2102,23 +1876,23 @@ class RunTestOpsActorState { } int a_body1loopBody1loopBody1(int loopDepth) { - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (!(fIndex < futures.size())) - #line 2107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { return a_body1loopBody1break1(loopDepth==0?0:loopDepth-1); // break } try { - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_0 = futures[fIndex]; - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2144,9 +1918,9 @@ class RunTestOpsActorState { } int a_body1loopBody1loopBody1cont1(int loopDepth) { - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ++fIndex; - #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (loopDepth == 0) return a_body1loopBody1loopHead1(0); return loopDepth; @@ -2154,13 +1928,13 @@ class RunTestOpsActorState { int a_body1loopBody1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ASSERT(!expectedToSucceed); - #line 889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ASSERT(e.code() == error_code_io_timeout); - #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" opTimedOut = true; - #line 2163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 1937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = a_body1loopBody1loopBody1cont1(loopDepth); } catch (Error& error) { @@ -2261,9 +2035,9 @@ class RunTestOpsActorState { } int a_body1loopBody1cont6(int loopDepth) { - #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ++iteration; - #line 2266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -2271,9 +2045,9 @@ class RunTestOpsActorState { int a_body1loopBody1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ASSERT(!expectedToSucceed && e.code() == error_code_io_timeout); - #line 2276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = a_body1loopBody1cont6(loopDepth); } catch (Error& error) { @@ -2286,18 +2060,18 @@ class RunTestOpsActorState { } int a_body1loopBody1cont7(Void const& _,int loopDepth) { - #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ASSERT(expectedToSucceed); - #line 2291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = a_body1loopBody1cont9(loopDepth); return loopDepth; } int a_body1loopBody1cont7(Void && _,int loopDepth) { - #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ASSERT(expectedToSucceed); - #line 2300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = a_body1loopBody1cont9(loopDepth); return loopDepth; @@ -2378,32 +2152,32 @@ class RunTestOpsActorState { return loopDepth; } - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" Reference f; - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" int numIterations; - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" int fileSize; - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" bool expectedToSucceed; - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" void* buf; - #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" int iteration; - #line 870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" bool opTimedOut; - #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" std::vector> futures; - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" int numOps; - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" int fIndex; - #line 2401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" }; // This generated class is to be used only via runTestOps() - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" class RunTestOpsActor final : public Actor, public ActorCallback< RunTestOpsActor, 0, Void >, public ActorCallback< RunTestOpsActor, 1, Void >, public FastAllocated, public RunTestOpsActorState { - #line 2406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2413,9 +2187,9 @@ class RunTestOpsActor final : public Actor, public ActorCallback< RunTestO #pragma clang diagnostic pop friend struct ActorCallback< RunTestOpsActor, 0, Void >; friend struct ActorCallback< RunTestOpsActor, 1, Void >; - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" RunTestOpsActor(Reference const& f,int const& numIterations,int const& fileSize,bool const& expectedToSucceed) - #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" : Actor(), RunTestOpsActorState(f, numIterations, fileSize, expectedToSucceed) { @@ -2440,60 +2214,60 @@ friend struct ActorCallback< RunTestOpsActor, 1, Void >; } }; } - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" [[nodiscard]] Future runTestOps( Reference const& f, int const& numIterations, int const& fileSize, bool const& expectedToSucceed ) { - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" return Future(new RunTestOpsActor(f, numIterations, fileSize, expectedToSucceed)); - #line 2447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } -#line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" +#line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" - #line 2452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" namespace { -// This generated class is to be used only via flowTestCase908() - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" -template - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" -class FlowTestCase908ActorState { - #line 2459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" +// This generated class is to be used only via flowTestCase896() + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" +template + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" +class FlowTestCase896ActorState { + #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" public: - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - FlowTestCase908ActorState(UnitTestParameters const& params) - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + FlowTestCase896ActorState(UnitTestParameters const& params) + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" : params(params) - #line 2466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - fdb_probe_actor_create("flowTestCase908", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase896", reinterpret_cast(this)); } - ~FlowTestCase908ActorState() + ~FlowTestCase896ActorState() { - fdb_probe_actor_destroy("flowTestCase908", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase896", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (!g_network->isSimulated()) - #line 2481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" f = Reference(); - #line 2485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" try { - #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture> __when_expr_0 = AsyncFileKAIO::open("/tmp/__KAIO_TEST_FILE__", IAsyncFile::OPEN_UNBUFFERED | IAsyncFile::OPEN_READWRITE | IAsyncFile::OPEN_CREATE, 0666, nullptr); - #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 2265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + static_cast(this)->actor_wait_state = 1; + #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2517,36 +2291,36 @@ class FlowTestCase908ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase908ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase896ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase908ActorState(); static_cast(this)->destroy(); return 0; } - #line 2530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase908ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase896ActorState(); static_cast(this)->destroy(); return 0; } + #line 2304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase896ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont2(int loopDepth) { - #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_6 = AsyncFileEIO::deleteFile(f->getFilename(), true); - #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont2when1(__when_expr_6.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 7; - #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + static_cast(this)->actor_wait_state = 7; + #line 932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; return loopDepth; @@ -2554,22 +2328,22 @@ class FlowTestCase908ActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" err = e; - #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" if (f) - #line 2561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" { - #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_5 = AsyncFileEIO::deleteFile(f->getFilename(), true); - #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1Catch2when1(__when_expr_5.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 6; - #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + static_cast(this)->actor_wait_state = 6; + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; } else @@ -2587,40 +2361,40 @@ class FlowTestCase908ActorState { } int a_body1cont3(Reference const& f_,int loopDepth) { - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" f = f_; - #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" fileSize = 2 << 27; - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_1 = f->truncate(fileSize); - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 2372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont3when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + static_cast(this)->actor_wait_state = 2; + #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1cont3(Reference && f_,int loopDepth) { - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" f = f_; - #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" fileSize = 2 << 27; - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_1 = f->truncate(fileSize); - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 2392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont3when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + static_cast(this)->actor_wait_state = 2; + #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; return loopDepth; @@ -2639,13 +2413,13 @@ class FlowTestCase908ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase908Actor, 0, Reference >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase896Actor, 0, Reference >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase908Actor, 0, Reference >*,Reference const& value) + void a_callback_fire(ActorCallback< FlowTestCase896Actor, 0, Reference >*,Reference const& value) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -2655,12 +2429,12 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase908Actor, 0, Reference >*,Reference && value) + void a_callback_fire(ActorCallback< FlowTestCase896Actor, 0, Reference >*,Reference && value) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -2670,12 +2444,12 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase908Actor, 0, Reference >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase896Actor, 0, Reference >*,Error err) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch2(err, 0); @@ -2685,41 +2459,41 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 0); } int a_body1cont4(Void const& _,int loopDepth) { - #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" AsyncFileKAIO::setTimeout(0.0); - #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_2 = runTestOps(f, 100, fileSize, true); - #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont4when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + static_cast(this)->actor_wait_state = 3; + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1cont4(Void && _,int loopDepth) { - #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" AsyncFileKAIO::setTimeout(0.0); - #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_2 = runTestOps(f, 100, fileSize, true); - #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 2491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1cont4when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + static_cast(this)->actor_wait_state = 3; + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; return loopDepth; @@ -2738,13 +2512,13 @@ class FlowTestCase908ActorState { } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase908Actor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase896Actor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase908Actor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase896Actor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont3when1(value, 0); @@ -2754,12 +2528,12 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< FlowTestCase908Actor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase896Actor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont3when1(std::move(value), 0); @@ -2769,12 +2543,12 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< FlowTestCase908Actor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase896Actor, 1, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch2(err, 0); @@ -2784,45 +2558,45 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 1); } int a_body1cont5(Void const& _,int loopDepth) { - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ASSERT(!((AsyncFileKAIO*)f.getPtr())->failed); - #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" AsyncFileKAIO::setTimeout(20.0); - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_3 = runTestOps(f, 100, fileSize, true); - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 2574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + static_cast(this)->actor_wait_state = 4; + #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1cont5(Void && _,int loopDepth) { - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ASSERT(!((AsyncFileKAIO*)f.getPtr())->failed); - #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" AsyncFileKAIO::setTimeout(20.0); - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_3 = runTestOps(f, 100, fileSize, true); - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 2594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch2(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + static_cast(this)->actor_wait_state = 4; + #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; return loopDepth; @@ -2841,13 +2615,13 @@ class FlowTestCase908ActorState { } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase908Actor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase896Actor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase908Actor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase896Actor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont4when1(value, 0); @@ -2857,12 +2631,12 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< FlowTestCase908Actor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase896Actor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont4when1(std::move(value), 0); @@ -2872,12 +2646,12 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< FlowTestCase908Actor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase896Actor, 2, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch2(err, 0); @@ -2887,45 +2661,45 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 2); } int a_body1cont6(Void const& _,int loopDepth) { - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ASSERT(!((AsyncFileKAIO*)f.getPtr())->failed); - #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" AsyncFileKAIO::setTimeout(0.0001); - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_4 = runTestOps(f, 10, fileSize, false); - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 2677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch2(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + static_cast(this)->actor_wait_state = 5; + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1cont6(Void && _,int loopDepth) { - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ASSERT(!((AsyncFileKAIO*)f.getPtr())->failed); - #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" AsyncFileKAIO::setTimeout(0.0001); - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" StrictFuture __when_expr_4 = runTestOps(f, 10, fileSize, false); - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 2923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 2697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch2(__when_expr_4.getError(), loopDepth); else return a_body1cont6when1(__when_expr_4.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 5; - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + static_cast(this)->actor_wait_state = 5; + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = 0; return loopDepth; @@ -2944,13 +2718,13 @@ class FlowTestCase908ActorState { } void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase908Actor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase896Actor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase908Actor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase896Actor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 3); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 3); a_exitChoose4(); try { a_body1cont5when1(value, 0); @@ -2960,12 +2734,12 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 3); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< FlowTestCase908Actor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase896Actor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 3); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 3); a_exitChoose4(); try { a_body1cont5when1(std::move(value), 0); @@ -2975,12 +2749,12 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 3); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< FlowTestCase908Actor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase896Actor, 3, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 3); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 3); a_exitChoose4(); try { a_body1Catch2(err, 0); @@ -2990,23 +2764,23 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 3); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 3); } int a_body1cont7(Void const& _,int loopDepth) { - #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ASSERT(((AsyncFileKAIO*)f.getPtr())->failed); - #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = a_body1cont9(loopDepth); return loopDepth; } int a_body1cont7(Void && _,int loopDepth) { - #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" ASSERT(((AsyncFileKAIO*)f.getPtr())->failed); - #line 3009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" loopDepth = a_body1cont9(loopDepth); return loopDepth; @@ -3025,13 +2799,13 @@ class FlowTestCase908ActorState { } void a_exitChoose5() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase908Actor, 4, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase896Actor, 4, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase908Actor, 4, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase896Actor, 4, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 4); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 4); a_exitChoose5(); try { a_body1cont6when1(value, 0); @@ -3041,12 +2815,12 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 4); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< FlowTestCase908Actor, 4, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase896Actor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 4); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 4); a_exitChoose5(); try { a_body1cont6when1(std::move(value), 0); @@ -3056,12 +2830,12 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 4); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< FlowTestCase908Actor, 4, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase896Actor, 4, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 4); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 4); a_exitChoose5(); try { a_body1Catch2(err, 0); @@ -3071,7 +2845,7 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 4); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 4); } int a_body1cont9(int loopDepth) @@ -3089,9 +2863,9 @@ class FlowTestCase908ActorState { } int a_body1Catch2cont1(int loopDepth) { - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" return a_body1Catch1(err, loopDepth); - #line 3094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 2868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" return loopDepth; } @@ -3121,13 +2895,13 @@ class FlowTestCase908ActorState { } void a_exitChoose6() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase908Actor, 5, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase896Actor, 5, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase908Actor, 5, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase896Actor, 5, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 5); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 5); a_exitChoose6(); try { a_body1Catch2when1(value, 0); @@ -3137,12 +2911,12 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 5); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 5); } - void a_callback_fire(ActorCallback< FlowTestCase908Actor, 5, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase896Actor, 5, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 5); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 5); a_exitChoose6(); try { a_body1Catch2when1(std::move(value), 0); @@ -3152,12 +2926,12 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 5); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 5); } - void a_callback_error(ActorCallback< FlowTestCase908Actor, 5, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase896Actor, 5, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 5); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 5); a_exitChoose6(); try { a_body1Catch1(err, 0); @@ -3167,7 +2941,7 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 5); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 5); } int a_body1cont10(Void const& _,int loopDepth) @@ -3196,13 +2970,13 @@ class FlowTestCase908ActorState { } void a_exitChoose7() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase908Actor, 6, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase896Actor, 6, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase908Actor, 6, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase896Actor, 6, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 6); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 6); a_exitChoose7(); try { a_body1cont2when1(value, 0); @@ -3212,12 +2986,12 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 6); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 6); } - void a_callback_fire(ActorCallback< FlowTestCase908Actor, 6, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase896Actor, 6, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 6); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 6); a_exitChoose7(); try { a_body1cont2when1(std::move(value), 0); @@ -3227,12 +3001,12 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 6); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 6); } - void a_callback_error(ActorCallback< FlowTestCase908Actor, 6, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase896Actor, 6, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), 6); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), 6); a_exitChoose7(); try { a_body1Catch1(err, 0); @@ -3242,50 +3016,50 @@ class FlowTestCase908ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), 6); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), 6); } - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" UnitTestParameters params; - #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" Reference f; - #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" int fileSize; - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" Error err; - #line 3256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 3030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" }; -// This generated class is to be used only via flowTestCase908() - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" -class FlowTestCase908Actor final : public Actor, public ActorCallback< FlowTestCase908Actor, 0, Reference >, public ActorCallback< FlowTestCase908Actor, 1, Void >, public ActorCallback< FlowTestCase908Actor, 2, Void >, public ActorCallback< FlowTestCase908Actor, 3, Void >, public ActorCallback< FlowTestCase908Actor, 4, Void >, public ActorCallback< FlowTestCase908Actor, 5, Void >, public ActorCallback< FlowTestCase908Actor, 6, Void >, public FastAllocated, public FlowTestCase908ActorState { - #line 3261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" +// This generated class is to be used only via flowTestCase896() + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" +class FlowTestCase896Actor final : public Actor, public ActorCallback< FlowTestCase896Actor, 0, Reference >, public ActorCallback< FlowTestCase896Actor, 1, Void >, public ActorCallback< FlowTestCase896Actor, 2, Void >, public ActorCallback< FlowTestCase896Actor, 3, Void >, public ActorCallback< FlowTestCase896Actor, 4, Void >, public ActorCallback< FlowTestCase896Actor, 5, Void >, public ActorCallback< FlowTestCase896Actor, 6, Void >, public FastAllocated, public FlowTestCase896ActorState { + #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase908Actor, 0, Reference >; -friend struct ActorCallback< FlowTestCase908Actor, 1, Void >; -friend struct ActorCallback< FlowTestCase908Actor, 2, Void >; -friend struct ActorCallback< FlowTestCase908Actor, 3, Void >; -friend struct ActorCallback< FlowTestCase908Actor, 4, Void >; -friend struct ActorCallback< FlowTestCase908Actor, 5, Void >; -friend struct ActorCallback< FlowTestCase908Actor, 6, Void >; - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - FlowTestCase908Actor(UnitTestParameters const& params) - #line 3278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" +friend struct ActorCallback< FlowTestCase896Actor, 0, Reference >; +friend struct ActorCallback< FlowTestCase896Actor, 1, Void >; +friend struct ActorCallback< FlowTestCase896Actor, 2, Void >; +friend struct ActorCallback< FlowTestCase896Actor, 3, Void >; +friend struct ActorCallback< FlowTestCase896Actor, 4, Void >; +friend struct ActorCallback< FlowTestCase896Actor, 5, Void >; +friend struct ActorCallback< FlowTestCase896Actor, 6, Void >; + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + FlowTestCase896Actor(UnitTestParameters const& params) + #line 3052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" : Actor(), - FlowTestCase908ActorState(params) + FlowTestCase896ActorState(params) { - fdb_probe_actor_enter("flowTestCase908", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase896", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase908"); + this->lineage.setActorName("flowTestCase896"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase908", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase896", reinterpret_cast(this), -1); } void cancel() override @@ -3293,27 +3067,27 @@ friend struct ActorCallback< FlowTestCase908Actor, 6, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase908Actor, 0, Reference >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< FlowTestCase908Actor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< FlowTestCase908Actor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< FlowTestCase908Actor, 3, Void >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< FlowTestCase908Actor, 4, Void >*)0, actor_cancelled()); break; - case 6: this->a_callback_error((ActorCallback< FlowTestCase908Actor, 5, Void >*)0, actor_cancelled()); break; - case 7: this->a_callback_error((ActorCallback< FlowTestCase908Actor, 6, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase896Actor, 0, Reference >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase896Actor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< FlowTestCase896Actor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< FlowTestCase896Actor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< FlowTestCase896Actor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< FlowTestCase896Actor, 5, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< FlowTestCase896Actor, 6, Void >*)0, actor_cancelled()); break; } } }; } - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" -static Future flowTestCase908( UnitTestParameters const& params ) { - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" - return Future(new FlowTestCase908Actor(params)); - #line 3312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.g.h" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" +static Future flowTestCase896( UnitTestParameters const& params ) { + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" + return Future(new FlowTestCase896Actor(params)); + #line 3086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.g.h" } -ACTOR_TEST_CASE(flowTestCase908, "/fdbrpc/AsyncFileKAIO/RequestList") +ACTOR_TEST_CASE(flowTestCase896, "/fdbrpc/AsyncFileKAIO/RequestList") -#line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileKAIO.actor.h" +#line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h" AsyncFileKAIO::Context AsyncFileKAIO::ctx; diff --git a/src/fdbrpc/AsyncFileKAIO.actor.h b/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h similarity index 90% rename from src/fdbrpc/AsyncFileKAIO.actor.h rename to src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h index 7701097..4925990 100644 --- a/src/fdbrpc/AsyncFileKAIO.actor.h +++ b/src/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h @@ -29,7 +29,7 @@ #elif !defined(FLOW_ASYNCFILEKAIO_ACTOR_H) #define FLOW_ASYNCFILEKAIO_ACTOR_H -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include #include @@ -37,11 +37,10 @@ #include #include #include "fdbrpc/linux_kaio.h" -#include "fdbserver/Knobs.h" #include "flow/Knobs.h" -#include "flow/Histogram.h" +#include "fdbrpc/Stats.h" #include "flow/UnitTest.h" -#include "flow/crc32c.h" +#include "crc32/crc32c.h" #include "flow/genericactors.actor.h" #include "flow/actorcompiler.h" // This must be the last #include. @@ -49,14 +48,6 @@ // /data/v7/fdb/ #define KAIO_LOGGING 0 -struct AsyncFileKAIOMetrics { - Reference readLatencyDist; - Reference writeLatencyDist; - Reference syncLatencyDist; -} g_asyncFileKAIOMetrics; - -Future g_asyncFileKAIOHistogramLogger; - DESCR struct SlowAioSubmit { int64_t submitDuration; // ns int64_t truncateDuration; // ns @@ -67,6 +58,25 @@ DESCR struct SlowAioSubmit { class AsyncFileKAIO final : public IAsyncFile, public ReferenceCounted { public: + struct AsyncFileKAIOMetrics { + LatencySample readLatencySample = { "AsyncFileKAIOReadLatency", + UID(), + FLOW_KNOBS->KAIO_LATENCY_LOGGING_INTERVAL, + FLOW_KNOBS->KAIO_LATENCY_SKETCH_ACCURACY }; + LatencySample writeLatencySample = { "AsyncFileKAIOWriteLatency", + UID(), + FLOW_KNOBS->KAIO_LATENCY_LOGGING_INTERVAL, + FLOW_KNOBS->KAIO_LATENCY_SKETCH_ACCURACY }; + LatencySample syncLatencySample = { "AsyncFileKAIOSyncLatency", + UID(), + FLOW_KNOBS->KAIO_LATENCY_LOGGING_INTERVAL, + FLOW_KNOBS->KAIO_LATENCY_SKETCH_ACCURACY }; + }; + + static AsyncFileKAIOMetrics& getMetrics() { + static AsyncFileKAIOMetrics metrics; + return metrics; + } #if KAIO_LOGGING private: @@ -163,8 +173,8 @@ class AsyncFileKAIO final : public IAsyncFile, public ReferenceCounted ev, double ioTimeout) { ASSERT(!FLOW_KNOBS->DISABLE_POSIX_KERNEL_AIO); if (!g_network->isSimulated()) { - ctx.countAIOSubmit.init(LiteralStringRef("AsyncFile.CountAIOSubmit")); - ctx.countAIOCollect.init(LiteralStringRef("AsyncFile.CountAIOCollect")); - ctx.submitMetric.init(LiteralStringRef("AsyncFile.Submit")); - ctx.countPreSubmitTruncate.init(LiteralStringRef("AsyncFile.CountPreAIOSubmitTruncate")); - ctx.preSubmitTruncateBytes.init(LiteralStringRef("AsyncFile.PreAIOSubmitTruncateBytes")); - ctx.slowAioSubmitMetric.init(LiteralStringRef("AsyncFile.SlowAIOSubmit")); + ctx.countAIOSubmit.init("AsyncFile.CountAIOSubmit"_sr); + ctx.countAIOCollect.init("AsyncFile.CountAIOCollect"_sr); + ctx.submitMetric.init("AsyncFile.Submit"_sr); + ctx.countPreSubmitTruncate.init("AsyncFile.CountPreAIOSubmitTruncate"_sr); + ctx.preSubmitTruncateBytes.init("AsyncFile.PreAIOSubmitTruncateBytes"_sr); + ctx.slowAioSubmitMetric.init("AsyncFile.SlowAIOSubmit"_sr); } int rc = io_setup(FLOW_KNOBS->MAX_OUTSTANDING, &ctx.iocx); @@ -354,7 +364,7 @@ class AsyncFileKAIO final : public IAsyncFile, public ReferenceCounted fsync = throwErrorIfFailed( Reference::addRef(this), @@ -366,7 +376,7 @@ class AsyncFileKAIO final : public IAsyncFile, public ReferenceCountedsampleSeconds(now() - start_time); + getMetrics().syncLatencySample.addMeasurement(timer() - start_time); return r; }); @@ -405,6 +415,7 @@ class AsyncFileKAIO final : public IAsyncFile, public ReferenceCountedstartTime = now(); + io->startTime = start; if (ctx.ioTimeout > 0) { ctx.appendToRequestList(io); @@ -637,27 +648,17 @@ class AsyncFileKAIO final : public IAsyncFile, public ReferenceCountedDISABLE_POSIX_KERNEL_AIO); if (!g_network->isSimulated()) { - countFileLogicalWrites.init(LiteralStringRef("AsyncFile.CountFileLogicalWrites"), filename); - countFileLogicalReads.init(LiteralStringRef("AsyncFile.CountFileLogicalReads"), filename); - countLogicalWrites.init(LiteralStringRef("AsyncFile.CountLogicalWrites")); - countLogicalReads.init(LiteralStringRef("AsyncFile.CountLogicalReads")); - if (!g_asyncFileKAIOHistogramLogger.isValid()) { - auto& metrics = g_asyncFileKAIOMetrics; - metrics.readLatencyDist = Reference(new Histogram( - Reference(), "AsyncFileKAIO", "ReadLatency", Histogram::Unit::microseconds)); - metrics.writeLatencyDist = Reference(new Histogram( - Reference(), "AsyncFileKAIO", "WriteLatency", Histogram::Unit::microseconds)); - metrics.syncLatencyDist = Reference(new Histogram( - Reference(), "AsyncFileKAIO", "SyncLatency", Histogram::Unit::microseconds)); - g_asyncFileKAIOHistogramLogger = histogramLogger(SERVER_KNOBS->DISK_METRIC_LOGGING_INTERVAL); - } + countFileLogicalWrites.init("AsyncFile.CountFileLogicalWrites"_sr, filename); + countFileLogicalReads.init("AsyncFile.CountFileLogicalReads"_sr, filename); + countLogicalWrites.init("AsyncFile.CountLogicalWrites"_sr); + countLogicalReads.init("AsyncFile.CountLogicalReads"_sr); } #if KAIO_LOGGING logFile = nullptr; // TODO: Don't do this hacky investigation-specific thing StringRef fname(filename); - if (fname.endsWith(LiteralStringRef(".sqlite")) || fname.endsWith(LiteralStringRef(".sqlite-wal"))) { + if (fname.endsWith(".sqlite"_sr) || fname.endsWith(".sqlite-wal"_sr)) { std::string logFileName = basename(filename); while (logFileName.find("/") != std::string::npos) logFileName = logFileName.substr(logFileName.find("/") + 1); @@ -736,6 +737,8 @@ class AsyncFileKAIO final : public IAsyncFile, public ReferenceCounted 0) { - double currentTime = now(); while (ctx.submittedRequestList && currentTime - ctx.submittedRequestList->startTime > ctx.ioTimeout) { ctx.submittedRequestList->timeout(ctx.timeoutWarnOnly); ctx.removeFromRequestList(ctx.submittedRequestList); @@ -770,13 +772,12 @@ class AsyncFileKAIO final : public IAsyncFile, public ReferenceCountedaio_lio_opcode) { case IO_CMD_PREAD: - metrics.readLatencyDist->sampleSeconds(now() - iob->startTime); + getMetrics().readLatencySample.addMeasurement(currentTime - iob->startTime); break; case IO_CMD_PWRITE: - metrics.writeLatencyDist->sampleSeconds(now() - iob->startTime); + getMetrics().writeLatencySample.addMeasurement(currentTime - iob->startTime); break; } @@ -784,19 +785,6 @@ class AsyncFileKAIO final : public IAsyncFile, public ReferenceCounted histogramLogger(double interval) { - state double currentTime; - loop { - currentTime = now(); - wait(delay(interval)); - double elapsed = now() - currentTime; - auto& metrics = g_asyncFileKAIOMetrics; - metrics.readLatencyDist->writeToLog(elapsed); - metrics.writeLatencyDist->writeToLog(elapsed); - metrics.syncLatencyDist->writeToLog(elapsed); - } - } }; #if KAIO_LOGGING diff --git a/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h b/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h new file mode 100644 index 0000000..ebe6794 --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h @@ -0,0 +1,5743 @@ +#define POST_ACTOR_COMPILER 1 +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +/* + * AsyncFileNonDurable.actor.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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_ASYNCFILENONDURABLE_ACTOR_G_H) +#define FLOW_ASYNCFILENONDURABLE_ACTOR_G_H +#include "fdbrpc/AsyncFileNonDurable.actor.g.h" +#elif !defined(FLOW_ASYNCFILENONDURABLE_ACTOR_H) +#define FLOW_ASYNCFILENONDURABLE_ACTOR_H + +#include "flow/flow.h" +#include "flow/IAsyncFile.h" +#include "flow/ActorCollection.h" +#include "fdbrpc/simulator.h" +#include "fdbrpc/TraceFileIO.h" +#include "fdbrpc/RangeMap.h" +#include "flow/actorcompiler.h" // This must be the last #include. + +#undef max +#undef min + + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +[[nodiscard]] Future sendOnProcess( ISimulator::ProcessInfo* const& process, Promise const& promise, TaskPriority const& taskID ); + +#line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +[[nodiscard]] Future sendErrorOnProcess( ISimulator::ProcessInfo* const& process, Promise const& promise, Error const& e, TaskPriority const& taskID ); + +#line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + +extern Future waitShutdownSignal(); + + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +namespace { +// This generated class is to be used only via sendErrorOnShutdown() + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +template + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class SendErrorOnShutdownActorState { + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + SendErrorOnShutdownActorState(Future const& in,bool const& assertOnCancel = false) + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + : in(in), + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + assertOnCancel(assertOnCancel) + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + fdb_probe_actor_create("sendErrorOnShutdown", reinterpret_cast(this)); + + } + ~SendErrorOnShutdownActorState() + { + fdb_probe_actor_destroy("sendErrorOnShutdown", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + try { + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_0 = waitShutdownSignal(); + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_1 = in; + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~SendErrorOnShutdownActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + ASSERT(e.code() != error_code_actor_cancelled || !assertOnCancel); + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return a_body1Catch1(e, loopDepth); + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return a_body1Catch2(io_error().asInjectedFault(), loopDepth); + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return a_body1Catch2(io_error().asInjectedFault(), loopDepth); + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + + return loopDepth; + } + int a_body1when2(T const& rep,int loopDepth) + { + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(rep); this->~SendErrorOnShutdownActorState(); static_cast(this)->destroy(); return 0; } + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< T >::value()) T(rep); + this->~SendErrorOnShutdownActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when2(T && rep,int loopDepth) + { + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(rep); this->~SendErrorOnShutdownActorState(); static_cast(this)->destroy(); return 0; } + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< T >::value()) T(rep); + this->~SendErrorOnShutdownActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SendErrorOnShutdownActor, 0, Void >::remove(); + static_cast(this)->ActorCallback< SendErrorOnShutdownActor, 1, T >::remove(); + + } + void a_callback_fire(ActorCallback< SendErrorOnShutdownActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("sendErrorOnShutdown", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("sendErrorOnShutdown", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< SendErrorOnShutdownActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("sendErrorOnShutdown", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("sendErrorOnShutdown", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< SendErrorOnShutdownActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("sendErrorOnShutdown", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("sendErrorOnShutdown", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< SendErrorOnShutdownActor, 1, T >*,T const& value) + { + fdb_probe_actor_enter("sendErrorOnShutdown", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1when2(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("sendErrorOnShutdown", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< SendErrorOnShutdownActor, 1, T >*,T && value) + { + fdb_probe_actor_enter("sendErrorOnShutdown", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("sendErrorOnShutdown", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< SendErrorOnShutdownActor, 1, T >*,Error err) + { + fdb_probe_actor_enter("sendErrorOnShutdown", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("sendErrorOnShutdown", reinterpret_cast(this), 1); + + } + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Future in; + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + bool assertOnCancel; + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +}; +// This generated class is to be used only via sendErrorOnShutdown() + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +template + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class SendErrorOnShutdownActor final : public Actor, public ActorCallback< SendErrorOnShutdownActor, 0, Void >, public ActorCallback< SendErrorOnShutdownActor, 1, T >, public FastAllocated>, public SendErrorOnShutdownActorState> { + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + using FastAllocated>::operator new; + using FastAllocated>::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< SendErrorOnShutdownActor, 0, Void >; +friend struct ActorCallback< SendErrorOnShutdownActor, 1, T >; + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + SendErrorOnShutdownActor(Future const& in,bool const& assertOnCancel = false) + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + : Actor(), + SendErrorOnShutdownActorState>(in, assertOnCancel) + { + fdb_probe_actor_enter("sendErrorOnShutdown", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("sendErrorOnShutdown"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("sendErrorOnShutdown", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< SendErrorOnShutdownActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +template + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +[[nodiscard]] Future sendErrorOnShutdown( Future const& in, bool const& assertOnCancel = false ) { + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return Future(new SendErrorOnShutdownActor(in, assertOnCancel)); + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +} + +#line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + +class AsyncFileDetachable final : public IAsyncFile, public ReferenceCounted { +private: + Reference file; + Future shutdown; + bool assertOnReadWriteCancel; + +public: + explicit AsyncFileDetachable(Reference file) : file(file), assertOnReadWriteCancel(true) { + shutdown = doShutdown(this); + } + + #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +[[nodiscard]] Future doShutdown( AsyncFileDetachable* const& self ); +template friend class AsyncFileDetachable_DoShutdownActorState; + +#line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +[[nodiscard]] static Future> open( Future> const& wrappedFile ); +template friend class AsyncFileDetachable_OpenActorState; + +#line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + + void addref() override { ReferenceCounted::addref(); } + void delref() override { ReferenceCounted::delref(); } + + Future read(void* data, int length, int64_t offset) override; + Future write(void const* data, int length, int64_t offset) override; + Future truncate(int64_t size) override; + Future sync() override; + Future size() const override; + + int64_t debugFD() const override { + if (!file.getPtr()) + throw io_error().asInjectedFault(); + return file->debugFD(); + } + std::string getFilename() const override { + if (!file.getPtr()) + throw io_error().asInjectedFault(); + return file->getFilename(); + } +}; + +// An async file implementation which wraps another async file and will randomly destroy sectors that it is writing when +// killed This is used to simulate a power failure which prevents all written data from being persisted to disk +class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCounted { +public: + UID id; + std::string filename; + + // For files that use atomic write and create, they are initially created with an extra suffix + std::string initialFilename; + + // An approximation of the size of the file; .size() should be used instead of this variable in most cases + mutable int64_t approximateSize; + + // The address of the machine that opened the file + NetworkAddress openedAddress; + + bool aio; + +private: + // The wrapped IAsyncFile + Reference file; + + // The maximum amount of time a write is delayed before being passed along to the underlying file + double maxWriteDelay; + + // Modifications which haven't been pushed to file, mapped by the location in the file that is being modified. + // Be sure to update minSizeAfterPendingModifications when modifying pendingModifications. + RangeMap> pendingModifications; + // The size of the file after the set of pendingModifications completes, + // (the set pending at the time of reading this member). Must be updated in + // lockstep with any inserts into the pendingModifications map. Tracking + // this variable is necessary so that we can know the range of the file a + // truncate is modifying, so we can insert it into the pendingModifications + // map. Until minSizeAfterPendingModificationsIsExact is true, this is only a lower bound. + mutable int64_t minSizeAfterPendingModifications = 0; + mutable bool minSizeAfterPendingModificationsIsExact = false; + + // Will be blocked whenever kill is running + Promise killed; + Promise killComplete; + + // Used by sync (and kill) to force writes which have not yet been passed along. + // If true is sent, then writes will be durable. If false, then they may not be durable. + Promise startSyncPromise; + + // The performance parameters of the simulated disk + Reference diskParameters; + + // Set to true the first time sync is called on the file + bool hasBeenSynced; + + // Used to describe what corruption is allowed by the file as well as the type of corruption being used on a + // particular page + enum KillMode { NO_CORRUPTION = 0, DROP_ONLY = 1, FULL_CORRUPTION = 2 }; + + // Limits what types of corruption are applied to writes from this file + KillMode killMode; + + ActorCollection + reponses; // cannot call getResult on this actor collection, since the actors will be on different processes + + AsyncFileNonDurable(const std::string& filename, + const std::string& initialFilename, + Reference file, + Reference diskParameters, + NetworkAddress openedAddress, + bool aio) + : filename(filename), initialFilename(initialFilename), approximateSize(0), openedAddress(openedAddress), + aio(aio), file(file), pendingModifications(uint64_t(-1)), diskParameters(diskParameters), reponses(false) { + + // This is only designed to work in simulation + ASSERT(g_network->isSimulated()); + this->id = deterministicRandom()->randomUniqueID(); + + //TraceEvent("AsyncFileNonDurable_Create", id).detail("Filename", filename); + maxWriteDelay = FLOW_KNOBS->NON_DURABLE_MAX_WRITE_DELAY; + hasBeenSynced = false; + + killMode = (KillMode)deterministicRandom()->randomInt(1, 3); + //TraceEvent("AsyncFileNonDurable_CreateEnd", id).detail("Filename", filename).backtrace(); + } + +public: + static std::map> filesBeingDeleted; + + // Creates a new AsyncFileNonDurable which wraps the provided IAsyncFile + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +[[nodiscard]] static Future> open( std::string const& filename, std::string const& actualFilename, Future> const& wrappedFile, Reference const& diskParameters, bool const& aio ); +template friend class AsyncFileNonDurable_OpenActorState; + +#line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + + ~AsyncFileNonDurable() override { + //TraceEvent("AsyncFileNonDurable_Destroy", id).detail("Filename", filename); + } + + void addref() override { ReferenceCounted::addref(); } + + void delref() override { + if (delref_no_destroy()) { + if (filesBeingDeleted.count(filename) == 0) { + //TraceEvent("AsyncFileNonDurable_StartDelete", id).detail("Filename", filename); + Future deleteFuture = closeFile(this); + if (!deleteFuture.isReady()) + filesBeingDeleted[filename] = deleteFuture; + } + + removeOpenFile(filename, this); + if (initialFilename != filename) { + removeOpenFile(initialFilename, this); + } + } + } + + // Removes a file from the openFiles map + static void removeOpenFile(std::string filename, AsyncFileNonDurable* file); + + // Passes along reads straight to the underlying file, waiting for any outstanding changes that could affect the + // results + Future read(void* data, int length, int64_t offset) override { return read(this, data, length, offset); } + + // Writes data to the file. Writes are delayed a random amount of time before being + // passed to the underlying file + Future write(void const* data, int length, int64_t offset) override { + //TraceEvent("AsyncFileNonDurable_Write", id).detail("Filename", filename).detail("Offset", offset).detail("Length", length); + if (length == 0) { + TraceEvent(SevWarnAlways, "AsyncFileNonDurable_EmptyModification", id).detail("Filename", filename); + return Void(); + } + + debugFileSet("AsyncFileNonDurableWrite", filename, data, offset, length); + + Promise writeStarted; + Promise> writeEnded; + writeEnded.send(write(this, writeStarted, writeEnded.getFuture(), data, length, offset)); + return writeStarted.getFuture(); + } + + // Truncates the file. Truncates are delayed a random amount of time before being + // passed to the underlying file + Future truncate(int64_t size) override { + //TraceEvent("AsyncFileNonDurable_Truncate", id).detail("Filename", filename).detail("Offset", size); + debugFileTruncate("AsyncFileNonDurableTruncate", filename, size); + + Promise truncateStarted; + Promise> truncateEnded; + truncateEnded.send(truncate(this, truncateStarted, truncateEnded.getFuture(), size)); + return truncateStarted.getFuture(); + } + + // Fsyncs the file. This allows all delayed modifications to the file to complete before + // syncing the underlying file + Future sync() override { + //TraceEvent("AsyncFileNonDurable_Sync", id).detail("Filename", filename); + Future syncFuture = sync(this, true); + reponses.add(syncFuture); + return syncFuture; + } + + // Passes along size requests to the underlying file, augmenting with any writes past the end of the file + Future size() const override { return size(this); } + + int64_t debugFD() const override { return file->debugFD(); } + + std::string getFilename() const override { return file->getFilename(); } + + // Forces a non-durable sync (some writes are not made or made incorrectly) + // This is used when the file should 'die' without first completing its operations + //(e.g. to simulate power failure) + Future kill() { + TraceEvent("AsyncFileNonDurable_Kill", id).detail("Filename", filename); + CODE_PROBE(true, "AsyncFileNonDurable was killed", probe::decoration::rare); + return sync(this, false); + } + +private: + // Returns a future that is used to ensure the waiter ends up on the main thread + Future returnToMainThread() { + Promise p; + Future f = p.getFuture(); + g_network->onMainThread(std::move(p), g_network->getCurrentTask()); + return f; + } + + // Gets existing modifications that overlap the specified range. Optionally inserts a new modification into the map + std::vector> getModificationsAndInsert(int64_t offset, + int64_t length, + bool insertModification = false, + Future value = Void()) { + auto modification = RangeMapRange(offset, length >= 0 ? offset + length : uint64_t(-1)); + auto priorModifications = pendingModifications.intersectingRanges(modification); + + // Aggregate existing modifications in this range + std::vector> modificationFutures; + for (auto itr = priorModifications.begin(); itr != priorModifications.end(); ++itr) { + if (itr.value().isValid() && (!itr.value().isReady() || itr.value().isError())) { + modificationFutures.push_back(itr.value()); + } + } + + // Add the modification if we are doing a write or truncate + if (insertModification) + pendingModifications.insert(modification, value); + + return modificationFutures; + } + + // Checks if the file is killed. If so, then the current sync is completed if running and then an error is thrown + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +// This generated class is to be used only via checkKilled() + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +template + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class CheckKilledActorState { + #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + CheckKilledActorState(AsyncFileNonDurable const* const& self,std::string const& context) + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + : self(self), + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + context(context) + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + fdb_probe_actor_create("checkKilled", reinterpret_cast(this)); + + } + ~CheckKilledActorState() + { + fdb_probe_actor_destroy("checkKilled", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (self->killed.isSet()) + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_0 = self->killComplete.getFuture(); + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~CheckKilledActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckKilledActorState(); static_cast(this)->destroy(); return 0; } + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~CheckKilledActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + TraceEvent("AsyncFileNonDurable_KilledFileOperation", self->id) .detail("In", context) .detail("Filename", self->filename); + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + CODE_PROBE(true, "AsyncFileNonDurable operation killed", probe::decoration::rare); + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return a_body1Catch1(io_error().asInjectedFault(), loopDepth); + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + TraceEvent("AsyncFileNonDurable_KilledFileOperation", self->id) .detail("In", context) .detail("Filename", self->filename); + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + CODE_PROBE(true, "AsyncFileNonDurable operation killed", probe::decoration::rare); + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return a_body1Catch1(io_error().asInjectedFault(), loopDepth); + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< CheckKilledActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< CheckKilledActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("checkKilled", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkKilled", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< CheckKilledActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("checkKilled", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkKilled", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< CheckKilledActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("checkKilled", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("checkKilled", reinterpret_cast(this), 0); + + } + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + AsyncFileNonDurable const* self; + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + std::string context; + #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +}; +// This generated class is to be used only via checkKilled() + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class CheckKilledActor final : public Actor, public ActorCallback< CheckKilledActor, 0, Void >, public FastAllocated, public CheckKilledActorState { + #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< CheckKilledActor, 0, Void >; + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + CheckKilledActor(AsyncFileNonDurable const* const& self,std::string const& context) + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + : Actor(), + CheckKilledActorState(self, context) + { + fdb_probe_actor_enter("checkKilled", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("checkKilled"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("checkKilled", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< CheckKilledActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +[[nodiscard]] static Future checkKilled( AsyncFileNonDurable const* const& self, std::string const& context ) { + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return Future(new CheckKilledActor(self, context)); + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +} + +#line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + + // Passes along reads straight to the underlying file, waiting for any outstanding changes that could affect the + // results + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +// This generated class is to be used only via onRead() + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +template + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class OnReadActorState { + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + OnReadActorState(AsyncFileNonDurable* const& self,void* const& data,int const& length,int64_t const& offset) + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + : self(self), + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + data(data), + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + length(length), + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + offset(offset) + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + fdb_probe_actor_create("onRead", reinterpret_cast(this)); + + } + ~OnReadActorState() + { + fdb_probe_actor_destroy("onRead", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_0 = checkKilled(self, "Read"); + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~OnReadActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + std::vector> priorModifications = self->getModificationsAndInsert(offset, length); + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_1 = waitForAll(priorModifications); + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + std::vector> priorModifications = self->getModificationsAndInsert(offset, length); + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_1 = waitForAll(priorModifications); + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< OnReadActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< OnReadActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("onRead", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onRead", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< OnReadActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("onRead", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onRead", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< OnReadActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("onRead", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onRead", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + readFuture = self->file->read(data, length, offset); + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_2 = success(readFuture) || self->killed.getFuture(); + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + readFuture = self->file->read(data, length, offset); + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_2 = success(readFuture) || self->killed.getFuture(); + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< OnReadActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< OnReadActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("onRead", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onRead", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< OnReadActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("onRead", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onRead", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< OnReadActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("onRead", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onRead", reinterpret_cast(this), 1); + + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_3 = checkKilled(self, "ReadEnd"); + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_3 = checkKilled(self, "ReadEnd"); + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< OnReadActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< OnReadActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("onRead", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onRead", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< OnReadActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("onRead", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onRead", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< OnReadActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("onRead", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onRead", reinterpret_cast(this), 2); + + } + int a_body1cont4(Void const& _,int loopDepth) + { + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + debugFileCheck("AsyncFileNonDurableRead", self->filename, data, offset, length); + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(readFuture.get()); this->~OnReadActorState(); static_cast(this)->destroy(); return 0; } + #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< int >::value()) int(readFuture.get()); + this->~OnReadActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont4(Void && _,int loopDepth) + { + #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + debugFileCheck("AsyncFileNonDurableRead", self->filename, data, offset, length); + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(readFuture.get()); this->~OnReadActorState(); static_cast(this)->destroy(); return 0; } + #line 1179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< int >::value()) int(readFuture.get()); + this->~OnReadActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< OnReadActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< OnReadActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("onRead", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onRead", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< OnReadActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("onRead", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onRead", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< OnReadActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("onRead", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onRead", reinterpret_cast(this), 3); + + } + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + AsyncFileNonDurable* self; + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + void* data; + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int length; + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int64_t offset; + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Future readFuture; + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +}; +// This generated class is to be used only via onRead() + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class OnReadActor final : public Actor, public ActorCallback< OnReadActor, 0, Void >, public ActorCallback< OnReadActor, 1, Void >, public ActorCallback< OnReadActor, 2, Void >, public ActorCallback< OnReadActor, 3, Void >, public FastAllocated, public OnReadActorState { + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< OnReadActor, 0, Void >; +friend struct ActorCallback< OnReadActor, 1, Void >; +friend struct ActorCallback< OnReadActor, 2, Void >; +friend struct ActorCallback< OnReadActor, 3, Void >; + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + OnReadActor(AsyncFileNonDurable* const& self,void* const& data,int const& length,int64_t const& offset) + #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + : Actor(), + OnReadActorState(self, data, length, offset) + { + fdb_probe_actor_enter("onRead", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("onRead"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("onRead", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< OnReadActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< OnReadActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< OnReadActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< OnReadActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +[[nodiscard]] Future onRead( AsyncFileNonDurable* const& self, void* const& data, int const& length, int64_t const& offset ) { + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return Future(new OnReadActor(self, data, length, offset)); + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +} + +#line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + + #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +[[nodiscard]] Future read( AsyncFileNonDurable* const& self, void* const& data, int const& length, int64_t const& offset ); +template friend class AsyncFileNonDurable_ReadActorState; + +#line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + + // Delays writes a random amount of time before passing them through to the underlying file. + // If a kill interrupts the delay, then the output could be the correct write, part of the write, + // or none of the write. It may also corrupt parts of sectors which have not been written correctly + #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +// This generated class is to be used only via write() + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +template + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class WriteActorState { + #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + WriteActorState(AsyncFileNonDurable* const& self,Promise const& writeStarted,Future> const& ownFuture,void const* const& data,int const& length,int64_t const& offset) + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + : self(self), + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + writeStarted(writeStarted), + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + ownFuture(ownFuture), + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + data(data), + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + length(length), + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + offset(offset), + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + dataCopy(StringRef((uint8_t*)data, length)), + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + currentProcess(g_simulator->getCurrentProcess()), + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + currentTaskID(g_network->getCurrentTask()) + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + fdb_probe_actor_create("write", reinterpret_cast(this)); + + } + ~WriteActorState() + { + fdb_probe_actor_destroy("write", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_0 = g_simulator->onMachine(currentProcess); + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~WriteActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + delayDuration = g_simulator->speedUpSimulation ? 0.0001 : (deterministicRandom()->random01() * self->maxWriteDelay); + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + startSyncFuture = self->startSyncPromise.getFuture(); + #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + try { + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_1 = checkKilled(self, "Write"); + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + delayDuration = g_simulator->speedUpSimulation ? 0.0001 : (deterministicRandom()->random01() * self->maxWriteDelay); + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + startSyncFuture = self->startSyncPromise.getFuture(); + #line 1427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + try { + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_1 = checkKilled(self, "Write"); + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WriteActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< WriteActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< WriteActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + saveDurable = true; + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_4 = delay(delayDuration); + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont2when1(__when_expr_4.get(), loopDepth); }; + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_5 = startSyncFuture; + #line 1524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2when2(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->reponses.add(sendErrorOnProcess(currentProcess, writeStarted, e, currentTaskID)); + #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return a_body1Catch1(e, loopDepth); + #line 1543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture> __when_expr_2 = ownFuture; + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 1564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture> __when_expr_2 = ownFuture; + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 1580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WriteActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< WriteActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< WriteActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 1); + + } + int a_body1cont4(Future const& writeEnded,int loopDepth) + { + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + std::vector> priorModifications = self->getModificationsAndInsert(offset, length, true, writeEnded); + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->minSizeAfterPendingModifications = std::max(self->minSizeAfterPendingModifications, offset + length); + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (BUGGIFY_WITH_PROB(0.001) && !g_simulator->speedUpSimulation) + #line 1656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + priorModifications.push_back( delay(deterministicRandom()->random01() * FLOW_KNOBS->MAX_PRIOR_MODIFICATION_DELAY) || self->killed.getFuture()); + #line 1660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + else + { + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + priorModifications.push_back(waitUntilDiskReady(self->diskParameters, length) || self->killed.getFuture()); + #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_3 = waitForAll(priorModifications); + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont4(Future && writeEnded,int loopDepth) + { + #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + std::vector> priorModifications = self->getModificationsAndInsert(offset, length, true, writeEnded); + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->minSizeAfterPendingModifications = std::max(self->minSizeAfterPendingModifications, offset + length); + #line 374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (BUGGIFY_WITH_PROB(0.001) && !g_simulator->speedUpSimulation) + #line 1690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + priorModifications.push_back( delay(deterministicRandom()->random01() * FLOW_KNOBS->MAX_PRIOR_MODIFICATION_DELAY) || self->killed.getFuture()); + #line 1694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + else + { + #line 379 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + priorModifications.push_back(waitUntilDiskReady(self->diskParameters, length) || self->killed.getFuture()); + #line 1700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_3 = waitForAll(priorModifications); + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 1706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3when1(Future const& writeEnded,int loopDepth) + { + loopDepth = a_body1cont4(writeEnded, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Future && writeEnded,int loopDepth) + { + loopDepth = a_body1cont4(std::move(writeEnded), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteActor, 2, Future >::remove(); + + } + void a_callback_fire(ActorCallback< WriteActor, 2, Future >*,Future const& value) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< WriteActor, 2, Future >*,Future && value) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< WriteActor, 2, Future >*,Error err) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 2); + + } + int a_body1cont5(Void const& _,int loopDepth) + { + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->approximateSize = std::max(self->approximateSize, length + offset); + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->reponses.add(sendOnProcess(currentProcess, writeStarted, currentTaskID)); + #line 1785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = a_body1cont9(loopDepth); + + return loopDepth; + } + int a_body1cont5(Void && _,int loopDepth) + { + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->approximateSize = std::max(self->approximateSize, length + offset); + #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->reponses.add(sendOnProcess(currentProcess, writeStarted, currentTaskID)); + #line 1796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = a_body1cont9(loopDepth); + + return loopDepth; + } + int a_body1cont4when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont5(_, loopDepth); + + return loopDepth; + } + int a_body1cont4when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont5(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WriteActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont4when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< WriteActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont4when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< WriteActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 3); + + } + int a_body1cont9(int loopDepth) + { + try { + loopDepth = a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont10(int loopDepth) + { + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + debugFileCheck("AsyncFileNonDurableWriteAfterWait", self->filename, dataCopy.begin(), offset, length); + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + ASSERT(!self->aio || (offset % 4096 == 0 && length % 4096 == 0)); + #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int diskPageLength = saveDurable ? length : 4096; + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int diskSectorLength = saveDurable ? length : 512; + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + std::vector> writeFutures; + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + for(int writeOffset = 0;writeOffset < length;) { + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int pageLength = diskPageLength; + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!self->aio && !saveDurable) + #line 1895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + pageLength = std::min((int64_t)length - writeOffset, diskPageLength - ((offset + writeOffset) % diskPageLength)); + #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + KillMode pageKillMode = (KillMode)deterministicRandom()->randomInt(0, self->killMode + 1); + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + for(int pageOffset = 0;pageOffset < pageLength;) { + #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int sectorLength = diskSectorLength; + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!self->aio && !saveDurable) + #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + sectorLength = std::min((int64_t)length - (writeOffset + pageOffset), diskSectorLength - ((offset + writeOffset + pageOffset) % diskSectorLength)); + #line 1913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (saveDurable || pageKillMode == NO_CORRUPTION || (pageKillMode == FULL_CORRUPTION && deterministicRandom()->random01() < 0.25)) + #line 1917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + writeFutures.push_back(self->file->write( dataCopy.begin() + writeOffset + pageOffset, sectorLength, offset + writeOffset + pageOffset)); + #line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + else + { + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (pageKillMode == FULL_CORRUPTION && deterministicRandom()->random01() < 0.66667) + #line 1927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int side = deterministicRandom()->randomInt(0, 3); + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + bool garbage = side == 2 || deterministicRandom()->random01() < 0.5; + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int64_t goodStart = 0; + #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int64_t goodEnd = sectorLength; + #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int64_t badStart = 0; + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int64_t badEnd = sectorLength; + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (side == 0) + #line 1943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + goodEnd = deterministicRandom()->randomInt(0, sectorLength); + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + badStart = goodEnd; + #line 1949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + else + { + #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (side == 1) + #line 1955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + badEnd = deterministicRandom()->randomInt(0, sectorLength); + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + goodStart = badEnd; + #line 1961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + else + { + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + goodEnd = 0; + #line 1967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + } + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (garbage && badStart != badEnd) + #line 1972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + uint8_t* badData = const_cast(&dataCopy.begin()[badStart + writeOffset + pageOffset]); + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + for(int i = 0;i < badEnd - badStart;i += sizeof(uint32_t)) { + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + uint32_t val = deterministicRandom()->randomUInt32(); + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + memcpy(&badData[i], &val, std::min(badEnd - badStart - i, (int64_t)sizeof(uint32_t))); + #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + writeFutures.push_back(self->file->write(dataCopy.begin() + writeOffset + pageOffset, sectorLength, offset + writeOffset + pageOffset)); + #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + debugFileSet("AsyncFileNonDurableBadWrite", self->filename, dataCopy.begin() + writeOffset + pageOffset, offset + writeOffset + pageOffset, sectorLength); + #line 1988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + else + { + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (goodStart != goodEnd) + #line 1994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + writeFutures.push_back( self->file->write(dataCopy.begin() + goodStart + writeOffset + pageOffset, goodEnd - goodStart, goodStart + offset + writeOffset + pageOffset)); + #line 1998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + } + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + TraceEvent("AsyncFileNonDurable_BadWrite", self->id) .detail("Offset", offset + writeOffset + pageOffset) .detail("Length", sectorLength) .detail("GoodStart", goodStart) .detail("GoodEnd", goodEnd) .detail("HasGarbage", garbage) .detail("Side", side) .detail("Filename", self->filename); + #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + CODE_PROBE(true, "AsyncFileNonDurable bad write", probe::decoration::rare); + #line 2005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + else + { + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + TraceEvent("AsyncFileNonDurable_DroppedWrite", self->id) .detail("Offset", offset + writeOffset + pageOffset) .detail("Length", sectorLength) .detail("Filename", self->filename); + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + CODE_PROBE(true, "AsyncFileNonDurable dropped write", probe::decoration::rare); + #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + } + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + pageOffset += sectorLength; + #line 2018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + writeOffset += pageLength; + #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_6 = waitForAll(writeFutures); + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont10when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont10(loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont10(loopDepth); + + return loopDepth; + } + int a_body1cont2when2(bool const& durable,int loopDepth) + { + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + saveDurable = durable; + #line 2054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = a_body1cont10(loopDepth); + + return loopDepth; + } + int a_body1cont2when2(bool && durable,int loopDepth) + { + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + saveDurable = durable; + #line 2063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = a_body1cont10(loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteActor, 4, Void >::remove(); + static_cast(this)->ActorCallback< WriteActor, 5, bool >::remove(); + + } + void a_callback_fire(ActorCallback< WriteActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< WriteActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< WriteActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< WriteActor, 5, bool >*,bool const& value) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 5); + a_exitChoose5(); + try { + a_body1cont2when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< WriteActor, 5, bool >*,bool && value) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 5); + a_exitChoose5(); + try { + a_body1cont2when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< WriteActor, 5, bool >*,Error err) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 5); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 5); + + } + int a_body1cont10cont1(Void const& _,int loopDepth) + { + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteActorState(); static_cast(this)->destroy(); return 0; } + #line 2169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont10cont1(Void && _,int loopDepth) + { + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WriteActorState(); static_cast(this)->destroy(); return 0; } + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WriteActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont10when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont10cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont10when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont10cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WriteActor, 6, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WriteActor, 6, Void >*,Void const& value) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1cont10when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 6); + + } + void a_callback_fire(ActorCallback< WriteActor, 6, Void >*,Void && value) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1cont10when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 6); + + } + void a_callback_error(ActorCallback< WriteActor, 6, Void >*,Error err) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("write", reinterpret_cast(this), 6); + + } + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + AsyncFileNonDurable* self; + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Promise writeStarted; + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Future> ownFuture; + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + void const* data; + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int length; + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int64_t offset; + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Standalone dataCopy; + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + ISimulator::ProcessInfo* currentProcess; + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + TaskPriority currentTaskID; + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + double delayDuration; + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Future startSyncFuture; + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + bool saveDurable; + #line 2276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +}; +// This generated class is to be used only via write() + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class WriteActor final : public Actor, public ActorCallback< WriteActor, 0, Void >, public ActorCallback< WriteActor, 1, Void >, public ActorCallback< WriteActor, 2, Future >, public ActorCallback< WriteActor, 3, Void >, public ActorCallback< WriteActor, 4, Void >, public ActorCallback< WriteActor, 5, bool >, public ActorCallback< WriteActor, 6, Void >, public FastAllocated, public WriteActorState { + #line 2281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< WriteActor, 0, Void >; +friend struct ActorCallback< WriteActor, 1, Void >; +friend struct ActorCallback< WriteActor, 2, Future >; +friend struct ActorCallback< WriteActor, 3, Void >; +friend struct ActorCallback< WriteActor, 4, Void >; +friend struct ActorCallback< WriteActor, 5, bool >; +friend struct ActorCallback< WriteActor, 6, Void >; + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + WriteActor(AsyncFileNonDurable* const& self,Promise const& writeStarted,Future> const& ownFuture,void const* const& data,int const& length,int64_t const& offset) + #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + : Actor(), + WriteActorState(self, writeStarted, ownFuture, data, length, offset) + { + fdb_probe_actor_enter("write", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("write"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("write", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< WriteActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WriteActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< WriteActor, 2, Future >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< WriteActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< WriteActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< WriteActor, 6, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +[[nodiscard]] Future write( AsyncFileNonDurable* const& self, Promise const& writeStarted, Future> const& ownFuture, void const* const& data, int const& length, int64_t const& offset ) { + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return Future(new WriteActor(self, writeStarted, ownFuture, data, length, offset)); + #line 2330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +} + +#line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + + // Delays truncates a random amount of time before passing them through to the underlying file. + // If a kill interrupts the delay, then the truncate may or may not be performed + #line 2337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +// This generated class is to be used only via truncate() + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +template + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class TruncateActorState { + #line 2343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + TruncateActorState(AsyncFileNonDurable* const& self,Promise const& truncateStarted,Future> const& ownFuture,int64_t const& size) + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + : self(self), + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + truncateStarted(truncateStarted), + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + ownFuture(ownFuture), + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + size(size), + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + currentProcess(g_simulator->getCurrentProcess()), + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + currentTaskID(g_network->getCurrentTask()) + #line 2360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + fdb_probe_actor_create("truncate", reinterpret_cast(this)); + + } + ~TruncateActorState() + { + fdb_probe_actor_destroy("truncate", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_0 = g_simulator->onMachine(currentProcess); + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~TruncateActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + delayDuration = g_simulator->speedUpSimulation ? 0.0001 : (deterministicRandom()->random01() * self->maxWriteDelay); + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + startSyncFuture = self->startSyncPromise.getFuture(); + #line 2407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + try { + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_1 = checkKilled(self, "Truncate"); + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 2413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + delayDuration = g_simulator->speedUpSimulation ? 0.0001 : (deterministicRandom()->random01() * self->maxWriteDelay); + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + startSyncFuture = self->startSyncPromise.getFuture(); + #line 2435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + try { + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_1 = checkKilled(self, "Truncate"); + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 2441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TruncateActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< TruncateActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< TruncateActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< TruncateActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 0); + + } + int a_body1cont2(int loopDepth) + { + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + saveDurable = true; + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_5 = delay(delayDuration); + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont2when1(__when_expr_5.get(), loopDepth); }; + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_6 = startSyncFuture; + #line 2532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont2when2(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->reponses.add(sendErrorOnProcess(currentProcess, truncateStarted, e, currentTaskID)); + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return a_body1Catch1(e, loopDepth); + #line 2551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture> __when_expr_2 = ownFuture; + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture> __when_expr_2 = ownFuture; + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 2583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TruncateActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< TruncateActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< TruncateActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< TruncateActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 1); + + } + int a_body1cont4(int loopDepth) + { + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!self->minSizeAfterPendingModificationsIsExact) + #line 2660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_3 = success(self->size()); + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 2666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont4when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont5(loopDepth); + } + + return loopDepth; + } + int a_body1cont3when1(Future const& __truncateEnded,int loopDepth) + { + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + truncateEnded = __truncateEnded; + #line 2685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Future && __truncateEnded,int loopDepth) + { + truncateEnded = std::move(__truncateEnded); + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TruncateActor, 2, Future >::remove(); + + } + void a_callback_fire(ActorCallback< TruncateActor, 2, Future >*,Future const& value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< TruncateActor, 2, Future >*,Future && value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< TruncateActor, 2, Future >*,Error err) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 2); + + } + int a_body1cont5(int loopDepth) + { + #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + ASSERT(self->minSizeAfterPendingModificationsIsExact); + #line 550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int64_t beginModifiedRange = std::min(size, self->minSizeAfterPendingModifications); + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->minSizeAfterPendingModifications = size; + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + std::vector> priorModifications = self->getModificationsAndInsert(beginModifiedRange, -1, true, truncateEnded); + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (BUGGIFY_WITH_PROB(0.001)) + #line 2760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + priorModifications.push_back( delay(deterministicRandom()->random01() * FLOW_KNOBS->MAX_PRIOR_MODIFICATION_DELAY) || self->killed.getFuture()); + #line 2764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + else + { + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + priorModifications.push_back(waitUntilDiskReady(self->diskParameters, 0) || self->killed.getFuture()); + #line 2770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_4 = waitForAll(priorModifications); + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont5when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont6(Void const& _,int loopDepth) + { + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont6(Void && _,int loopDepth) + { + loopDepth = a_body1cont5(loopDepth); + + return loopDepth; + } + int a_body1cont4when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont6(_, loopDepth); + + return loopDepth; + } + int a_body1cont4when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont6(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TruncateActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< TruncateActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont4when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< TruncateActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont4when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< TruncateActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 3); + + } + int a_body1cont7(Void const& _,int loopDepth) + { + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->approximateSize = size; + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->reponses.add(sendOnProcess(currentProcess, truncateStarted, currentTaskID)); + #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = a_body1cont11(loopDepth); + + return loopDepth; + } + int a_body1cont7(Void && _,int loopDepth) + { + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->approximateSize = size; + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->reponses.add(sendOnProcess(currentProcess, truncateStarted, currentTaskID)); + #line 2878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = a_body1cont11(loopDepth); + + return loopDepth; + } + int a_body1cont5when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont7(_, loopDepth); + + return loopDepth; + } + int a_body1cont5when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont7(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TruncateActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< TruncateActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont5when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< TruncateActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont5when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< TruncateActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 4); + + } + int a_body1cont11(int loopDepth) + { + try { + loopDepth = a_body1cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont12(int loopDepth) + { + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (g_network->check_yield(TaskPriority::DefaultYield)) + #line 2963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_7 = delay(0, TaskPriority::DefaultYield); + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 2969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont12when1(__when_expr_7.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont12cont1(loopDepth); + } + + return loopDepth; + } + int a_body1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont12(loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont12(loopDepth); + + return loopDepth; + } + int a_body1cont2when2(bool const& durable,int loopDepth) + { + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + saveDurable = durable; + #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = a_body1cont12(loopDepth); + + return loopDepth; + } + int a_body1cont2when2(bool && durable,int loopDepth) + { + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + saveDurable = durable; + #line 3009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = a_body1cont12(loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TruncateActor, 5, Void >::remove(); + static_cast(this)->ActorCallback< TruncateActor, 6, bool >::remove(); + + } + void a_callback_fire(ActorCallback< TruncateActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< TruncateActor, 5, Void >*,Void && value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< TruncateActor, 5, Void >*,Error err) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< TruncateActor, 6, bool >*,bool const& value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1cont2when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 6); + + } + void a_callback_fire(ActorCallback< TruncateActor, 6, bool >*,bool && value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1cont2when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 6); + + } + void a_callback_error(ActorCallback< TruncateActor, 6, bool >*,Error err) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 6); + a_exitChoose6(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 6); + + } + int a_body1cont12cont1(int loopDepth) + { + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (saveDurable || self->killMode == NO_CORRUPTION || deterministicRandom()->random01() < 0.5) + #line 3115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_8 = self->file->truncate(size); + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont12cont1when1(__when_expr_8.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 8; + #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + else + { + #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + TraceEvent("AsyncFileNonDurable_DroppedTruncate", self->id).detail("Size", size); + #line 592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + CODE_PROBE(true, "AsyncFileNonDurable dropped truncate", probe::decoration::rare); + #line 3135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = a_body1cont12cont3(loopDepth); + } + + return loopDepth; + } + int a_body1cont12cont2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont12cont1(loopDepth); + + return loopDepth; + } + int a_body1cont12cont2(Void && _,int loopDepth) + { + loopDepth = a_body1cont12cont1(loopDepth); + + return loopDepth; + } + int a_body1cont12when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont12cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont12when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont12cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose7() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TruncateActor, 7, Void >::remove(); + + } + void a_callback_fire(ActorCallback< TruncateActor, 7, Void >*,Void const& value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 7); + a_exitChoose7(); + try { + a_body1cont12when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 7); + + } + void a_callback_fire(ActorCallback< TruncateActor, 7, Void >*,Void && value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 7); + a_exitChoose7(); + try { + a_body1cont12when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 7); + + } + void a_callback_error(ActorCallback< TruncateActor, 7, Void >*,Error err) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 7); + a_exitChoose7(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 7); + + } + int a_body1cont12cont3(int loopDepth) + { + #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TruncateActorState(); static_cast(this)->destroy(); return 0; } + #line 3220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~TruncateActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont12cont4(Void const& _,int loopDepth) + { + loopDepth = a_body1cont12cont3(loopDepth); + + return loopDepth; + } + int a_body1cont12cont4(Void && _,int loopDepth) + { + loopDepth = a_body1cont12cont3(loopDepth); + + return loopDepth; + } + int a_body1cont12cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont12cont4(_, loopDepth); + + return loopDepth; + } + int a_body1cont12cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont12cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose8() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TruncateActor, 8, Void >::remove(); + + } + void a_callback_fire(ActorCallback< TruncateActor, 8, Void >*,Void const& value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 8); + a_exitChoose8(); + try { + a_body1cont12cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 8); + + } + void a_callback_fire(ActorCallback< TruncateActor, 8, Void >*,Void && value) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 8); + a_exitChoose8(); + try { + a_body1cont12cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 8); + + } + void a_callback_error(ActorCallback< TruncateActor, 8, Void >*,Error err) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), 8); + a_exitChoose8(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("truncate", reinterpret_cast(this), 8); + + } + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + AsyncFileNonDurable* self; + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Promise truncateStarted; + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Future> ownFuture; + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int64_t size; + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + ISimulator::ProcessInfo* currentProcess; + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + TaskPriority currentTaskID; + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + double delayDuration; + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Future startSyncFuture; + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Future truncateEnded; + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + bool saveDurable; + #line 3323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +}; +// This generated class is to be used only via truncate() + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class TruncateActor final : public Actor, public ActorCallback< TruncateActor, 0, Void >, public ActorCallback< TruncateActor, 1, Void >, public ActorCallback< TruncateActor, 2, Future >, public ActorCallback< TruncateActor, 3, Void >, public ActorCallback< TruncateActor, 4, Void >, public ActorCallback< TruncateActor, 5, Void >, public ActorCallback< TruncateActor, 6, bool >, public ActorCallback< TruncateActor, 7, Void >, public ActorCallback< TruncateActor, 8, Void >, public FastAllocated, public TruncateActorState { + #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< TruncateActor, 0, Void >; +friend struct ActorCallback< TruncateActor, 1, Void >; +friend struct ActorCallback< TruncateActor, 2, Future >; +friend struct ActorCallback< TruncateActor, 3, Void >; +friend struct ActorCallback< TruncateActor, 4, Void >; +friend struct ActorCallback< TruncateActor, 5, Void >; +friend struct ActorCallback< TruncateActor, 6, bool >; +friend struct ActorCallback< TruncateActor, 7, Void >; +friend struct ActorCallback< TruncateActor, 8, Void >; + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + TruncateActor(AsyncFileNonDurable* const& self,Promise const& truncateStarted,Future> const& ownFuture,int64_t const& size) + #line 3347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + : Actor(), + TruncateActorState(self, truncateStarted, ownFuture, size) + { + fdb_probe_actor_enter("truncate", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("truncate"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("truncate", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< TruncateActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< TruncateActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< TruncateActor, 2, Future >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< TruncateActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< TruncateActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< TruncateActor, 5, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< TruncateActor, 7, Void >*)0, actor_cancelled()); break; + case 8: this->a_callback_error((ActorCallback< TruncateActor, 8, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +[[nodiscard]] Future truncate( AsyncFileNonDurable* const& self, Promise const& truncateStarted, Future> const& ownFuture, int64_t const& size ) { + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return Future(new TruncateActor(self, truncateStarted, ownFuture, size)); + #line 3381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +} + +#line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + + // Waits for delayed modifications to the file to complete and then syncs the underlying file + // If durable is false, then some of the delayed modifications will not be applied or will be + // applied incorrectly + #line 3389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +// This generated class is to be used only via onSync() + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +template + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class OnSyncActorState { + #line 3395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + OnSyncActorState(AsyncFileNonDurable* const& self,bool const& durable) + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + : self(self), + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + durable(durable) + #line 3404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + fdb_probe_actor_create("onSync", reinterpret_cast(this)); + + } + ~OnSyncActorState() + { + fdb_probe_actor_destroy("onSync", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + ASSERT(durable || !self->killed.isSet()); + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (durable) + #line 3421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->hasBeenSynced = true; + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_0 = waitUntilDiskReady(self->diskParameters, 0, true) || self->killed.getFuture(); + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont1(loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~OnSyncActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_1 = checkKilled(self, durable ? "Sync" : "Kill"); + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< OnSyncActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< OnSyncActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< OnSyncActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< OnSyncActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 0); + + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!durable) + #line 3553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->killed.send(Void()); + #line 3557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + std::vector> outstandingModifications; + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + std::vector> stillPendingModifications; + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + auto rangeItr = self->pendingModifications.ranges(); + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + for(auto itr = rangeItr.begin();itr != rangeItr.end();++itr) { + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (itr.value().isValid() && (!itr->value().isReady() || itr->value().isError())) + #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + outstandingModifications.push_back(itr->value()); + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!itr.value().isReady()) + #line 3575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + stillPendingModifications.push_back(itr->range()); + #line 3579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + } + } + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Future allModifications = waitForAll(outstandingModifications); + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->pendingModifications.insert(RangeMapRange(0, -1), Void()); + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + for(auto itr = stillPendingModifications.begin();itr != stillPendingModifications.end();++itr) { + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->pendingModifications.insert( *itr, success(allModifications)); + #line 3591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Promise startSyncPromise = self->startSyncPromise; + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->startSyncPromise = Promise(); + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + writeDurable = durable || deterministicRandom()->random01() < 0.1; + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + startSyncPromise.send(writeDurable); + #line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (durable) + #line 3603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_2 = allModifications; + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + else + { + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_3 = success(errorOr(allModifications)); + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when2(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!durable) + #line 3638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->killed.send(Void()); + #line 3642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + std::vector> outstandingModifications; + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + std::vector> stillPendingModifications; + #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + auto rangeItr = self->pendingModifications.ranges(); + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + for(auto itr = rangeItr.begin();itr != rangeItr.end();++itr) { + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (itr.value().isValid() && (!itr->value().isReady() || itr->value().isError())) + #line 3654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + outstandingModifications.push_back(itr->value()); + #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!itr.value().isReady()) + #line 3660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + stillPendingModifications.push_back(itr->range()); + #line 3664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + } + } + #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Future allModifications = waitForAll(outstandingModifications); + #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->pendingModifications.insert(RangeMapRange(0, -1), Void()); + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + for(auto itr = stillPendingModifications.begin();itr != stillPendingModifications.end();++itr) { + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->pendingModifications.insert( *itr, success(allModifications)); + #line 3676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + } + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Promise startSyncPromise = self->startSyncPromise; + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->startSyncPromise = Promise(); + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + writeDurable = durable || deterministicRandom()->random01() < 0.1; + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + startSyncPromise.send(writeDurable); + #line 646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (durable) + #line 3688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_2 = allModifications; + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + else + { + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_3 = success(errorOr(allModifications)); + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when2(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< OnSyncActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< OnSyncActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< OnSyncActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< OnSyncActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 1); + + } + int a_body1cont4(int loopDepth) + { + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!durable) + #line 3786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (self->hasBeenSynced && writeDurable && deterministicRandom()->random01() < 0.5) + #line 3790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + CODE_PROBE(true, "AsyncFileNonDurable kill was durable and synced", probe::decoration::rare); + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_4 = success(errorOr(self->file->sync())); + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + else + { + loopDepth = a_body1cont13(loopDepth); + } + } + else + { + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_5 = checkKilled(self, "SyncEnd"); + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont4when2(__when_expr_5.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 6; + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + + return loopDepth; + } + int a_body1cont10(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont10(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont10(_, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont10(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< OnSyncActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< OnSyncActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< OnSyncActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< OnSyncActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 2); + + } + int a_body1cont11(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont11(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont3when2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont11(_, loopDepth); + + return loopDepth; + } + int a_body1cont3when2(Void && _,int loopDepth) + { + loopDepth = a_body1cont11(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< OnSyncActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< OnSyncActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont3when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< OnSyncActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont3when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< OnSyncActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 3); + + } + int a_body1cont12(int loopDepth) + { + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~OnSyncActorState(); static_cast(this)->destroy(); return 0; } + #line 3982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~OnSyncActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont13(int loopDepth) + { + #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->killComplete.send(Void()); + #line 3994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = a_body1cont12(loopDepth); + + return loopDepth; + } + int a_body1cont14(Void const& _,int loopDepth) + { + loopDepth = a_body1cont13(loopDepth); + + return loopDepth; + } + int a_body1cont14(Void && _,int loopDepth) + { + loopDepth = a_body1cont13(loopDepth); + + return loopDepth; + } + int a_body1cont4when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont14(_, loopDepth); + + return loopDepth; + } + int a_body1cont4when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont14(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose5() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< OnSyncActor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< OnSyncActor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont4when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 4); + + } + void a_callback_fire(ActorCallback< OnSyncActor, 4, Void >*,Void && value) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1cont4when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 4); + + } + void a_callback_error(ActorCallback< OnSyncActor, 4, Void >*,Error err) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 4); + a_exitChoose5(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 4); + + } + int a_body1cont15(Void const& _,int loopDepth) + { + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_6 = self->file->sync(); + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont15when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont15(Void && _,int loopDepth) + { + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_6 = self->file->sync(); + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont15when1(__when_expr_6.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 7; + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont4when2(Void const& _,int loopDepth) + { + loopDepth = a_body1cont15(_, loopDepth); + + return loopDepth; + } + int a_body1cont4when2(Void && _,int loopDepth) + { + loopDepth = a_body1cont15(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose6() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< OnSyncActor, 5, Void >::remove(); + + } + void a_callback_fire(ActorCallback< OnSyncActor, 5, Void >*,Void const& value) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont4when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 5); + + } + void a_callback_fire(ActorCallback< OnSyncActor, 5, Void >*,Void && value) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1cont4when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 5); + + } + void a_callback_error(ActorCallback< OnSyncActor, 5, Void >*,Error err) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 5); + a_exitChoose6(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 5); + + } + int a_body1cont15cont1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont12(loopDepth); + + return loopDepth; + } + int a_body1cont15cont1(Void && _,int loopDepth) + { + loopDepth = a_body1cont12(loopDepth); + + return loopDepth; + } + int a_body1cont15when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont15cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont15when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont15cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose7() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< OnSyncActor, 6, Void >::remove(); + + } + void a_callback_fire(ActorCallback< OnSyncActor, 6, Void >*,Void const& value) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1cont15when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 6); + + } + void a_callback_fire(ActorCallback< OnSyncActor, 6, Void >*,Void && value) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1cont15when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 6); + + } + void a_callback_error(ActorCallback< OnSyncActor, 6, Void >*,Error err) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), 6); + a_exitChoose7(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSync", reinterpret_cast(this), 6); + + } + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + AsyncFileNonDurable* self; + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + bool durable; + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + bool writeDurable; + #line 4250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +}; +// This generated class is to be used only via onSync() + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class OnSyncActor final : public Actor, public ActorCallback< OnSyncActor, 0, Void >, public ActorCallback< OnSyncActor, 1, Void >, public ActorCallback< OnSyncActor, 2, Void >, public ActorCallback< OnSyncActor, 3, Void >, public ActorCallback< OnSyncActor, 4, Void >, public ActorCallback< OnSyncActor, 5, Void >, public ActorCallback< OnSyncActor, 6, Void >, public FastAllocated, public OnSyncActorState { + #line 4255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< OnSyncActor, 0, Void >; +friend struct ActorCallback< OnSyncActor, 1, Void >; +friend struct ActorCallback< OnSyncActor, 2, Void >; +friend struct ActorCallback< OnSyncActor, 3, Void >; +friend struct ActorCallback< OnSyncActor, 4, Void >; +friend struct ActorCallback< OnSyncActor, 5, Void >; +friend struct ActorCallback< OnSyncActor, 6, Void >; + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + OnSyncActor(AsyncFileNonDurable* const& self,bool const& durable) + #line 4272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + : Actor(), + OnSyncActorState(self, durable) + { + fdb_probe_actor_enter("onSync", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("onSync"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("onSync", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< OnSyncActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< OnSyncActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< OnSyncActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< OnSyncActor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< OnSyncActor, 4, Void >*)0, actor_cancelled()); break; + case 6: this->a_callback_error((ActorCallback< OnSyncActor, 5, Void >*)0, actor_cancelled()); break; + case 7: this->a_callback_error((ActorCallback< OnSyncActor, 6, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +[[nodiscard]] Future onSync( AsyncFileNonDurable* const& self, bool const& durable ) { + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return Future(new OnSyncActor(self, durable)); + #line 4305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +} + +#line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + + #line 4310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +// This generated class is to be used only via sync() + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +template + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class SyncActorState { + #line 4316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + SyncActorState(AsyncFileNonDurable* const& self,bool const& durable) + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + : self(self), + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + durable(durable), + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + currentProcess(g_simulator->getCurrentProcess()), + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + currentTaskID(g_network->getCurrentTask()) + #line 4329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + fdb_probe_actor_create("sync", reinterpret_cast(this)); + + } + ~SyncActorState() + { + fdb_probe_actor_destroy("sync", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_0 = g_simulator->onMachine(currentProcess); + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~SyncActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + try { + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_1 = self->onSync(self, durable); + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 4377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + try { + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_1 = self->onSync(self, durable); + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 4400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SyncActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SyncActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("sync", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sync", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< SyncActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("sync", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sync", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< SyncActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("sync", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sync", reinterpret_cast(this), 0); + + } + int a_body1cont1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + err = e; + #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_3 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_2 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 4510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_2 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 4526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SyncActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SyncActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("sync", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sync", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< SyncActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("sync", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sync", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< SyncActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("sync", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sync", reinterpret_cast(this), 1); + + } + int a_body1cont4(Void const& _,int loopDepth) + { + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SyncActorState(); static_cast(this)->destroy(); return 0; } + #line 4603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~SyncActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont4(Void && _,int loopDepth) + { + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SyncActorState(); static_cast(this)->destroy(); return 0; } + #line 4615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~SyncActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SyncActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SyncActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("sync", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sync", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< SyncActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("sync", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sync", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< SyncActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("sync", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sync", reinterpret_cast(this), 2); + + } + int a_body1cont1Catch1cont1(Void const& _,int loopDepth) + { + #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return a_body1Catch1(err, loopDepth); + #line 4690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + + return loopDepth; + } + int a_body1cont1Catch1cont1(Void && _,int loopDepth) + { + #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return a_body1Catch1(err, loopDepth); + #line 4698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + + return loopDepth; + } + int a_body1cont1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SyncActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SyncActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("sync", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sync", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< SyncActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("sync", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sync", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< SyncActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("sync", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("sync", reinterpret_cast(this), 3); + + } + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + AsyncFileNonDurable* self; + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + bool durable; + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + ISimulator::ProcessInfo* currentProcess; + #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + TaskPriority currentTaskID; + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Error err; + #line 4775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +}; +// This generated class is to be used only via sync() + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class SyncActor final : public Actor, public ActorCallback< SyncActor, 0, Void >, public ActorCallback< SyncActor, 1, Void >, public ActorCallback< SyncActor, 2, Void >, public ActorCallback< SyncActor, 3, Void >, public FastAllocated, public SyncActorState { + #line 4780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< SyncActor, 0, Void >; +friend struct ActorCallback< SyncActor, 1, Void >; +friend struct ActorCallback< SyncActor, 2, Void >; +friend struct ActorCallback< SyncActor, 3, Void >; + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + SyncActor(AsyncFileNonDurable* const& self,bool const& durable) + #line 4794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + : Actor(), + SyncActorState(self, durable) + { + fdb_probe_actor_enter("sync", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("sync"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("sync", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< SyncActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< SyncActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< SyncActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< SyncActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +[[nodiscard]] Future sync( AsyncFileNonDurable* const& self, bool const& durable ) { + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return Future(new SyncActor(self, durable)); + #line 4824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +} + +#line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + + // Passes along size requests to the underlying file, augmenting with any writes past the end of the file + #line 4830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +// This generated class is to be used only via onSize() + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +template + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class OnSizeActorState { + #line 4836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + OnSizeActorState(AsyncFileNonDurable const* const& self) + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + : self(self) + #line 4843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + fdb_probe_actor_create("onSize", reinterpret_cast(this)); + + } + ~OnSizeActorState() + { + fdb_probe_actor_destroy("onSize", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_0 = checkKilled(self, "Size"); + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~OnSizeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + sizeFuture = self->file->size(); + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_1 = success(sizeFuture) || self->killed.getFuture(); + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + sizeFuture = self->file->size(); + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_1 = success(sizeFuture) || self->killed.getFuture(); + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< OnSizeActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< OnSizeActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("onSize", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSize", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< OnSizeActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("onSize", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSize", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< OnSizeActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("onSize", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSize", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_2 = checkKilled(self, "SizeEnd"); + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 4989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_2 = checkKilled(self, "SizeEnd"); + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< OnSizeActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< OnSizeActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("onSize", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSize", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< OnSizeActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("onSize", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSize", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< OnSizeActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("onSize", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSize", reinterpret_cast(this), 1); + + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->approximateSize = self->minSizeAfterPendingModifications = std::max(sizeFuture.get(), self->minSizeAfterPendingModifications); + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->minSizeAfterPendingModificationsIsExact = true; + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(self->approximateSize); this->~OnSizeActorState(); static_cast(this)->destroy(); return 0; } + #line 5086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< int64_t >::value()) int64_t(self->approximateSize); + this->~OnSizeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->approximateSize = self->minSizeAfterPendingModifications = std::max(sizeFuture.get(), self->minSizeAfterPendingModifications); + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + self->minSizeAfterPendingModificationsIsExact = true; + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(self->approximateSize); this->~OnSizeActorState(); static_cast(this)->destroy(); return 0; } + #line 5102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< int64_t >::value()) int64_t(self->approximateSize); + this->~OnSizeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont2when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< OnSizeActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< OnSizeActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("onSize", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSize", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< OnSizeActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("onSize", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont2when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSize", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< OnSizeActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("onSize", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("onSize", reinterpret_cast(this), 2); + + } + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + AsyncFileNonDurable const* self; + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Future sizeFuture; + #line 5177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +}; +// This generated class is to be used only via onSize() + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class OnSizeActor final : public Actor, public ActorCallback< OnSizeActor, 0, Void >, public ActorCallback< OnSizeActor, 1, Void >, public ActorCallback< OnSizeActor, 2, Void >, public FastAllocated, public OnSizeActorState { + #line 5182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< OnSizeActor, 0, Void >; +friend struct ActorCallback< OnSizeActor, 1, Void >; +friend struct ActorCallback< OnSizeActor, 2, Void >; + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + OnSizeActor(AsyncFileNonDurable const* const& self) + #line 5195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + : Actor(), + OnSizeActorState(self) + { + fdb_probe_actor_enter("onSize", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("onSize"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("onSize", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< OnSizeActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< OnSizeActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< OnSizeActor, 2, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +[[nodiscard]] static Future onSize( AsyncFileNonDurable const* const& self ) { + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return Future(new OnSizeActor(self)); + #line 5224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +} + +#line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + + #line 5229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +// This generated class is to be used only via size() + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +template + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class SizeActorState { + #line 5235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + SizeActorState(AsyncFileNonDurable const* const& self) + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + : self(self), + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + currentProcess(g_simulator->getCurrentProcess()), + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + currentTaskID(g_network->getCurrentTask()) + #line 5246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + { + fdb_probe_actor_create("size", reinterpret_cast(this)); + + } + ~SizeActorState() + { + fdb_probe_actor_destroy("size", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_0 = g_simulator->onMachine(currentProcess); + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~SizeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + try { + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_1 = onSize(self); + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 5294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + try { + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_1 = onSize(self); + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 5317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SizeActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SizeActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("size", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("size", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< SizeActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("size", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("size", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< SizeActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("size", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("size", reinterpret_cast(this), 0); + + } + int a_body1cont1Catch1(const Error& e,int loopDepth=0) + { + try { + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + err = e; + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_3 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 5405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1Catch1when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont3(int loopDepth) + { + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + StrictFuture __when_expr_2 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 5427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont3when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1when1(int64_t const& __rep,int loopDepth) + { + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + rep = __rep; + #line 5441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(int64_t && __rep,int loopDepth) + { + rep = std::move(__rep); + loopDepth = a_body1cont3(loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SizeActor, 1, int64_t >::remove(); + + } + void a_callback_fire(ActorCallback< SizeActor, 1, int64_t >*,int64_t const& value) + { + fdb_probe_actor_enter("size", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("size", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< SizeActor, 1, int64_t >*,int64_t && value) + { + fdb_probe_actor_enter("size", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("size", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< SizeActor, 1, int64_t >*,Error err) + { + fdb_probe_actor_enter("size", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("size", reinterpret_cast(this), 1); + + } + int a_body1cont4(Void const& _,int loopDepth) + { + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(rep); this->~SizeActorState(); static_cast(this)->destroy(); return 0; } + #line 5508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< int64_t >::value()) int64_t(std::move(rep)); // state_var_RVO + this->~SizeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont4(Void && _,int loopDepth) + { + #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + if (!static_cast(this)->SAV::futures) { (void)(rep); this->~SizeActorState(); static_cast(this)->destroy(); return 0; } + #line 5520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + new (&static_cast(this)->SAV< int64_t >::value()) int64_t(std::move(rep)); // state_var_RVO + this->~SizeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1cont3when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose3() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SizeActor, 2, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SizeActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("size", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(value, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("size", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< SizeActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("size", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont3when1(std::move(value), 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("size", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< SizeActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("size", reinterpret_cast(this), 2); + a_exitChoose3(); + try { + a_body1cont1Catch1(err, 0); + } + catch (Error& error) { + a_body1cont1Catch1(error, 0); + } catch (...) { + a_body1cont1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("size", reinterpret_cast(this), 2); + + } + int a_body1cont1Catch1cont1(Void const& _,int loopDepth) + { + #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return a_body1Catch1(err, loopDepth); + #line 5595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + + return loopDepth; + } + int a_body1cont1Catch1cont1(Void && _,int loopDepth) + { + #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return a_body1Catch1(err, loopDepth); + #line 5603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + + return loopDepth; + } + int a_body1cont1Catch1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1Catch1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1cont1Catch1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1Catch1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose4() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SizeActor, 3, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SizeActor, 3, Void >*,Void const& value) + { + fdb_probe_actor_enter("size", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1Catch1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("size", reinterpret_cast(this), 3); + + } + void a_callback_fire(ActorCallback< SizeActor, 3, Void >*,Void && value) + { + fdb_probe_actor_enter("size", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont1Catch1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("size", reinterpret_cast(this), 3); + + } + void a_callback_error(ActorCallback< SizeActor, 3, Void >*,Error err) + { + fdb_probe_actor_enter("size", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("size", reinterpret_cast(this), 3); + + } + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + AsyncFileNonDurable const* self; + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + ISimulator::ProcessInfo* currentProcess; + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + TaskPriority currentTaskID; + #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + int64_t rep; + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + Error err; + #line 5680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +}; +// This generated class is to be used only via size() + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +class SizeActor final : public Actor, public ActorCallback< SizeActor, 0, Void >, public ActorCallback< SizeActor, 1, int64_t >, public ActorCallback< SizeActor, 2, Void >, public ActorCallback< SizeActor, 3, Void >, public FastAllocated, public SizeActorState { + #line 5685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< SizeActor, 0, Void >; +friend struct ActorCallback< SizeActor, 1, int64_t >; +friend struct ActorCallback< SizeActor, 2, Void >; +friend struct ActorCallback< SizeActor, 3, Void >; + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + SizeActor(AsyncFileNonDurable const* const& self) + #line 5699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" + : Actor(), + SizeActorState(self) + { + fdb_probe_actor_enter("size", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("size"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("size", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< SizeActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< SizeActor, 1, int64_t >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< SizeActor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< SizeActor, 3, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +[[nodiscard]] static Future size( AsyncFileNonDurable const* const& self ) { + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + return Future(new SizeActor(self)); + #line 5729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +} + +#line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" + + // Finishes all outstanding actors on an AsyncFileNonDurable and then deletes it + #line 5735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.g.h" +[[nodiscard]] Future closeFile( AsyncFileNonDurable* const& self ); +template friend class AsyncFileNonDurable_CloseFileActorState; + +#line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" +}; + +#include "flow/unactorcompiler.h" +#endif diff --git a/src/fdbrpc/AsyncFileNonDurable.actor.h b/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h similarity index 77% rename from src/fdbrpc/AsyncFileNonDurable.actor.h rename to src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h index 9cd2648..32eecb8 100644 --- a/src/fdbrpc/AsyncFileNonDurable.actor.h +++ b/src/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h @@ -29,7 +29,7 @@ #define FLOW_ASYNCFILENONDURABLE_ACTOR_H #include "flow/flow.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/ActorCollection.h" #include "fdbrpc/simulator.h" #include "fdbrpc/TraceFileIO.h" @@ -45,11 +45,13 @@ ACTOR Future sendErrorOnProcess(ISimulator::ProcessInfo* process, Error e, TaskPriority taskID); +extern Future waitShutdownSignal(); + ACTOR template Future sendErrorOnShutdown(Future in, bool assertOnCancel = false) { try { choose { - when(wait(success(g_simulator.getCurrentProcess()->shutdownSignal.getFuture()))) { + when(wait(waitShutdownSignal())) { throw io_error().asInjectedFault(); } when(T rep = wait(in)) { @@ -73,55 +75,17 @@ class AsyncFileDetachable final : public IAsyncFile, public ReferenceCounted doShutdown(AsyncFileDetachable* self) { - wait(success(g_simulator.getCurrentProcess()->shutdownSignal.getFuture())); - self->file = Reference(); - return Void(); - } - - ACTOR static Future> open(Future> wrappedFile) { - choose { - when(wait(success(g_simulator.getCurrentProcess()->shutdownSignal.getFuture()))) { - throw io_error().asInjectedFault(); - } - when(Reference f = wait(wrappedFile)) { - return makeReference(f); - } - } - } + ACTOR Future doShutdown(AsyncFileDetachable* self); + ACTOR static Future> open(Future> wrappedFile); void addref() override { ReferenceCounted::addref(); } void delref() override { ReferenceCounted::delref(); } - Future read(void* data, int length, int64_t offset) override { - if (!file.getPtr() || g_simulator.getCurrentProcess()->shutdownSignal.getFuture().isReady()) - return io_error().asInjectedFault(); - return sendErrorOnShutdown(file->read(data, length, offset), assertOnReadWriteCancel); - } - - Future write(void const* data, int length, int64_t offset) override { - if (!file.getPtr() || g_simulator.getCurrentProcess()->shutdownSignal.getFuture().isReady()) - return io_error().asInjectedFault(); - return sendErrorOnShutdown(file->write(data, length, offset), assertOnReadWriteCancel); - } - - Future truncate(int64_t size) override { - if (!file.getPtr() || g_simulator.getCurrentProcess()->shutdownSignal.getFuture().isReady()) - return io_error().asInjectedFault(); - return sendErrorOnShutdown(file->truncate(size)); - } - - Future sync() override { - if (!file.getPtr() || g_simulator.getCurrentProcess()->shutdownSignal.getFuture().isReady()) - return io_error().asInjectedFault(); - return sendErrorOnShutdown(file->sync()); - } - - Future size() const override { - if (!file.getPtr() || g_simulator.getCurrentProcess()->shutdownSignal.getFuture().isReady()) - return io_error().asInjectedFault(); - return sendErrorOnShutdown(file->size()); - } + Future read(void* data, int length, int64_t offset) override; + Future write(void const* data, int length, int64_t offset) override; + Future truncate(int64_t size) override; + Future sync() override; + Future size() const override; int64_t debugFD() const override { if (!file.getPtr()) @@ -225,58 +189,7 @@ class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCounted> wrappedFile, Reference diskParameters, - bool aio) { - state ISimulator::ProcessInfo* currentProcess = g_simulator.getCurrentProcess(); - state TaskPriority currentTaskID = g_network->getCurrentTask(); - state Future shutdown = success(currentProcess->shutdownSignal.getFuture()); - - //TraceEvent("AsyncFileNonDurableOpenBegin").detail("Filename", filename).detail("Addr", g_simulator.getCurrentProcess()->address); - wait(g_simulator.onMachine(currentProcess)); - try { - wait(success(wrappedFile) || shutdown); - - if (shutdown.isReady()) - throw io_error().asInjectedFault(); - - state Reference file = wrappedFile.get(); - - // If we are in the process of deleting a file, we can't let someone else modify it at the same time. We - // therefore block the creation of new files until deletion is complete - state std::map>::iterator deletedFile = filesBeingDeleted.find(filename); - if (deletedFile != filesBeingDeleted.end()) { - //TraceEvent("AsyncFileNonDurableOpenWaitOnDelete1").detail("Filename", filename); - wait(deletedFile->second || shutdown); - //TraceEvent("AsyncFileNonDurableOpenWaitOnDelete2").detail("Filename", filename); - if (shutdown.isReady()) - throw io_error().asInjectedFault(); - wait(g_simulator.onProcess(currentProcess, currentTaskID)); - } - - state Reference nonDurableFile( - new AsyncFileNonDurable(filename, actualFilename, file, diskParameters, currentProcess->address, aio)); - - // Causes the approximateSize member to be set - state Future sizeFuture = nonDurableFile->size(); - wait(success(sizeFuture) || shutdown); - - if (shutdown.isReady()) - throw io_error().asInjectedFault(); - - //TraceEvent("AsyncFileNonDurableOpenComplete").detail("Filename", filename); - - wait(g_simulator.onProcess(currentProcess, currentTaskID)); - - return nonDurableFile; - } catch (Error& e) { - state Error err = e; - std::string currentFilename = - (wrappedFile.isReady() && !wrappedFile.isError()) ? wrappedFile.get()->getFilename() : actualFilename; - currentProcess->machine->openFiles.erase(currentFilename); - //TraceEvent("AsyncFileNonDurableOpenError").errorUnsuppressed(e).detail("Filename", filename).detail("Address", currentProcess->address).detail("Addr", g_simulator.getCurrentProcess()->address); - wait(g_simulator.onProcess(currentProcess, currentTaskID)); - throw err; - } - } + bool aio); ~AsyncFileNonDurable() override { //TraceEvent("AsyncFileNonDurable_Destroy", id).detail("Filename", filename); @@ -301,22 +214,7 @@ class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCountedmachine->openFiles; - - auto iter = openFiles.find(filename); - - // Various actions (e.g. simulated delete) can remove a file from openFiles prematurely, so it may already - // be gone. Renamed files (from atomic write and create) will also be present under only one of the two - // names. - if (iter != openFiles.end()) { - // even if the filename exists, it doesn't mean that it references the same file. It could be that the - // file was renamed and later a file with the same name was opened. - if (iter->second.getPtrIfReady().orDefault(nullptr) == file) { - openFiles.erase(iter); - } - } - } + static void removeOpenFile(std::string filename, AsyncFileNonDurable* file); // Passes along reads straight to the underlying file, waiting for any outstanding changes that could affect the // results @@ -372,7 +270,7 @@ class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCounted kill() { TraceEvent("AsyncFileNonDurable_Kill", id).detail("Filename", filename); - TEST(true); // AsyncFileNonDurable was killed + CODE_PROBE(true, "AsyncFileNonDurable was killed", probe::decoration::rare); return sync(this, false); } @@ -416,7 +314,7 @@ class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCountedid) .detail("In", context) .detail("Filename", self->filename); - TEST(true); // AsyncFileNonDurable operation killed + CODE_PROBE(true, "AsyncFileNonDurable operation killed", probe::decoration::rare); throw io_error().asInjectedFault(); } @@ -437,27 +335,13 @@ class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCountedfilename, data, offset, length); - // if(g_simulator.getCurrentProcess()->rebooting) + // if(g_simulator->getCurrentProcess()->rebooting) //TraceEvent("AsyncFileNonDurable_ReadEnd", self->id).detail("Filename", self->filename); return readFuture.get(); } - ACTOR Future read(AsyncFileNonDurable* self, void* data, int length, int64_t offset) { - state ISimulator::ProcessInfo* currentProcess = g_simulator.getCurrentProcess(); - state TaskPriority currentTaskID = g_network->getCurrentTask(); - wait(g_simulator.onMachine(currentProcess)); - - try { - state int rep = wait(self->onRead(self, data, length, offset)); - wait(g_simulator.onProcess(currentProcess, currentTaskID)); - return rep; - } catch (Error& e) { - state Error err = e; - wait(g_simulator.onProcess(currentProcess, currentTaskID)); - throw err; - } - } + ACTOR Future read(AsyncFileNonDurable* self, void* data, int length, int64_t offset); // Delays writes a random amount of time before passing them through to the underlying file. // If a kill interrupts the delay, then the output could be the correct write, part of the write, @@ -469,12 +353,12 @@ class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCounted dataCopy(StringRef((uint8_t*)data, length)); - state ISimulator::ProcessInfo* currentProcess = g_simulator.getCurrentProcess(); + state ISimulator::ProcessInfo* currentProcess = g_simulator->getCurrentProcess(); state TaskPriority currentTaskID = g_network->getCurrentTask(); - wait(g_simulator.onMachine(currentProcess)); + wait(g_simulator->onMachine(currentProcess)); state double delayDuration = - g_simulator.speedUpSimulation ? 0.0001 : (deterministicRandom()->random01() * self->maxWriteDelay); + g_simulator->speedUpSimulation ? 0.0001 : (deterministicRandom()->random01() * self->maxWriteDelay); state Future startSyncFuture = self->startSyncPromise.getFuture(); @@ -487,7 +371,7 @@ class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCountedgetModificationsAndInsert(offset, length, true, writeEnded); self->minSizeAfterPendingModifications = std::max(self->minSizeAfterPendingModifications, offset + length); - if (BUGGIFY_WITH_PROB(0.001) && !g_simulator.speedUpSimulation) + if (BUGGIFY_WITH_PROB(0.001) && !g_simulator->speedUpSimulation) priorModifications.push_back( delay(deterministicRandom()->random01() * FLOW_KNOBS->MAX_PRIOR_MODIFICATION_DELAY) || self->killed.getFuture()); @@ -617,13 +501,13 @@ class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCountedfilename); - TEST(true); // AsyncFileNonDurable bad write + CODE_PROBE(true, "AsyncFileNonDurable bad write", probe::decoration::rare); } else { TraceEvent("AsyncFileNonDurable_DroppedWrite", self->id) .detail("Offset", offset + writeOffset + pageOffset) .detail("Length", sectorLength) .detail("Filename", self->filename); - TEST(true); // AsyncFileNonDurable dropped write + CODE_PROBE(true, "AsyncFileNonDurable dropped write", probe::decoration::rare); } pageOffset += sectorLength; @@ -643,12 +527,12 @@ class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCounted truncateStarted, Future> ownFuture, int64_t size) { - state ISimulator::ProcessInfo* currentProcess = g_simulator.getCurrentProcess(); + state ISimulator::ProcessInfo* currentProcess = g_simulator->getCurrentProcess(); state TaskPriority currentTaskID = g_network->getCurrentTask(); - wait(g_simulator.onMachine(currentProcess)); + wait(g_simulator->onMachine(currentProcess)); state double delayDuration = - g_simulator.speedUpSimulation ? 0.0001 : (deterministicRandom()->random01() * self->maxWriteDelay); + g_simulator->speedUpSimulation ? 0.0001 : (deterministicRandom()->random01() * self->maxWriteDelay); state Future startSyncFuture = self->startSyncPromise.getFuture(); try { @@ -705,7 +589,7 @@ class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCountedfile->truncate(size)); else { TraceEvent("AsyncFileNonDurable_DroppedTruncate", self->id).detail("Size", size); - TEST(true); // AsyncFileNonDurable dropped truncate + CODE_PROBE(true, "AsyncFileNonDurable dropped truncate", probe::decoration::rare); } return Void(); @@ -769,7 +653,7 @@ class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCountedhasBeenSynced && writeDurable && deterministicRandom()->random01() < 0.5) { - TEST(true); // AsyncFileNonDurable kill was durable and synced + CODE_PROBE(true, "AsyncFileNonDurable kill was durable and synced", probe::decoration::rare); wait(success(errorOr(self->file->sync()))); } @@ -789,18 +673,18 @@ class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCounted sync(AsyncFileNonDurable* self, bool durable) { - state ISimulator::ProcessInfo* currentProcess = g_simulator.getCurrentProcess(); + state ISimulator::ProcessInfo* currentProcess = g_simulator->getCurrentProcess(); state TaskPriority currentTaskID = g_network->getCurrentTask(); - wait(g_simulator.onMachine(currentProcess)); + wait(g_simulator->onMachine(currentProcess)); try { wait(self->onSync(self, durable)); - wait(g_simulator.onProcess(currentProcess, currentTaskID)); + wait(g_simulator->onProcess(currentProcess, currentTaskID)); return Void(); } catch (Error& e) { state Error err = e; - wait(g_simulator.onProcess(currentProcess, currentTaskID)); + wait(g_simulator->onProcess(currentProcess, currentTaskID)); throw err; } } @@ -822,67 +706,25 @@ class AsyncFileNonDurable final : public IAsyncFile, public ReferenceCounted size(AsyncFileNonDurable const* self) { - state ISimulator::ProcessInfo* currentProcess = g_simulator.getCurrentProcess(); + state ISimulator::ProcessInfo* currentProcess = g_simulator->getCurrentProcess(); state TaskPriority currentTaskID = g_network->getCurrentTask(); - wait(g_simulator.onMachine(currentProcess)); + wait(g_simulator->onMachine(currentProcess)); try { state int64_t rep = wait(onSize(self)); - wait(g_simulator.onProcess(currentProcess, currentTaskID)); + wait(g_simulator->onProcess(currentProcess, currentTaskID)); return rep; } catch (Error& e) { state Error err = e; - wait(g_simulator.onProcess(currentProcess, currentTaskID)); + wait(g_simulator->onProcess(currentProcess, currentTaskID)); throw err; } } // Finishes all outstanding actors on an AsyncFileNonDurable and then deletes it - ACTOR Future closeFile(AsyncFileNonDurable* self) { - state ISimulator::ProcessInfo* currentProcess = g_simulator.getCurrentProcess(); - state TaskPriority currentTaskID = g_network->getCurrentTask(); - state std::string filename = self->filename; - - g_simulator.getMachineByNetworkAddress(self->openedAddress)->deletingOrClosingFiles.insert(self->getFilename()); - - wait(g_simulator.onMachine(currentProcess)); - try { - // Make sure all writes have gone through. - Promise startSyncPromise = self->startSyncPromise; - self->startSyncPromise = Promise(); - startSyncPromise.send(true); - - std::vector> outstandingModifications; - - for (auto itr = self->pendingModifications.ranges().begin(); - itr != self->pendingModifications.ranges().end(); - ++itr) - if (itr->value().isValid() && !itr->value().isReady()) - outstandingModifications.push_back(itr->value()); - - // Ignore errors here so that all modifications can finish - wait(waitForAllReady(outstandingModifications)); - - // Make sure we aren't in the process of killing the file - if (self->killed.isSet()) - wait(self->killComplete.getFuture()); - - // Remove this file from the filesBeingDeleted map so that new files can be created with this filename - g_simulator.getMachineByNetworkAddress(self->openedAddress)->closingFiles.erase(self->getFilename()); - g_simulator.getMachineByNetworkAddress(self->openedAddress) - ->deletingOrClosingFiles.erase(self->getFilename()); - AsyncFileNonDurable::filesBeingDeleted.erase(self->filename); - //TraceEvent("AsyncFileNonDurable_FinishDelete", self->id).detail("Filename", self->filename); - - delete self; - return Void(); - } catch (Error& e) { - state Error err = e; - throw err; - } - } + ACTOR Future closeFile(AsyncFileNonDurable* self); }; #include "flow/unactorcompiler.h" diff --git a/src/fdbrpc/AsyncFileReadAhead.actor.g.h b/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h similarity index 70% rename from src/fdbrpc/AsyncFileReadAhead.actor.g.h rename to src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h index 104810c..067d55a 100644 --- a/src/fdbrpc/AsyncFileReadAhead.actor.g.h +++ b/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" /* * AsyncFileReadAhead.actor.h * @@ -31,7 +31,7 @@ #define FDBRPC_ASYNCFILEREADAHEAD_ACTOR_H #include "flow/flow.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/actorcompiler.h" // This must be the last #include. // Read-only file type that wraps another file instance, reads in large blocks, and reads ahead of the actual range @@ -49,24 +49,24 @@ class AsyncFileReadAheadCache final : public IAsyncFile, public ReferenceCounted }; // Read from the underlying file to a CacheBlock - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" // This generated class is to be used only via readBlock() - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" template - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" class ReadBlockActorState { - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" public: - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" ReadBlockActorState(AsyncFileReadAheadCache* const& f,int const& length,int64_t const& offset) - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" : f(f), - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" length(length), - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" offset(offset) - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { fdb_probe_actor_create("readBlock", reinterpret_cast(this)); @@ -79,16 +79,16 @@ class ReadBlockActorState { int a_body1(int loopDepth=0) { try { - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" StrictFuture __when_expr_0 = f->m_max_concurrent_reads.take(); - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -109,20 +109,20 @@ class ReadBlockActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" block = Reference(new CacheBlock(length)); - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" try { - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" StrictFuture __when_expr_1 = uncancellable(holdWhile(block, f->m_f->read(block->data, length, offset))); - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -135,20 +135,20 @@ class ReadBlockActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" block = Reference(new CacheBlock(length)); - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" try { - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" StrictFuture __when_expr_1 = uncancellable(holdWhile(block, f->m_f->read(block->data, length, offset))); - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -224,11 +224,11 @@ class ReadBlockActorState { } int a_body1cont2(int loopDepth) { - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" f->m_max_concurrent_reads.release(1); - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(block); this->~ReadBlockActorState(); static_cast(this)->destroy(); return 0; } - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(block)); // state_var_RVO this->~ReadBlockActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -239,11 +239,11 @@ class ReadBlockActorState { int a_body1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" f->m_max_concurrent_reads.release(1); - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" return a_body1Catch1(e, loopDepth); - #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -255,18 +255,18 @@ class ReadBlockActorState { } int a_body1cont3(int const& len,int loopDepth) { - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" block->len = len; - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" loopDepth = a_body1cont5(loopDepth); return loopDepth; } int a_body1cont3(int && len,int loopDepth) { - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" block->len = len; - #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" loopDepth = a_body1cont5(loopDepth); return loopDepth; @@ -347,20 +347,20 @@ class ReadBlockActorState { return loopDepth; } - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" AsyncFileReadAheadCache* f; - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int length; - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int64_t offset; - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" Reference block; - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" }; // This generated class is to be used only via readBlock() - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" class ReadBlockActor final : public Actor>, public ActorCallback< ReadBlockActor, 0, Void >, public ActorCallback< ReadBlockActor, 1, int >, public FastAllocated, public ReadBlockActorState { - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -370,9 +370,9 @@ class ReadBlockActor final : public Actor>, public ActorCa #pragma clang diagnostic pop friend struct ActorCallback< ReadBlockActor, 0, Void >; friend struct ActorCallback< ReadBlockActor, 1, int >; - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" ReadBlockActor(AsyncFileReadAheadCache* const& f,int const& length,int64_t const& offset) - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" : Actor>(), ReadBlockActorState(f, length, offset) { @@ -396,35 +396,35 @@ friend struct ActorCallback< ReadBlockActor, 1, int >; } }; - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" [[nodiscard]] static Future> readBlock( AsyncFileReadAheadCache* const& f, int const& length, int64_t const& offset ) { - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" return Future>(new ReadBlockActor(f, length, offset)); - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" } -#line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" +#line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" // This generated class is to be used only via read_impl() - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" template - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" class Read_implActorState { - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" public: - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" Read_implActorState(Reference const& f,void* const& data,int const& length,int64_t const& offset) - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" : f(f), - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" data(data), - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" length(length), - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" offset(offset) - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { fdb_probe_actor_create("read_impl", reinterpret_cast(this)); @@ -437,16 +437,16 @@ class Read_implActorState { int a_body1(int loopDepth=0) { try { - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" StrictFuture __when_expr_0 = f->size(); - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -467,180 +467,180 @@ class Read_implActorState { } int a_body1cont1(int64_t const& fileSize,int loopDepth) { - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (offset >= fileSize) - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (!static_cast(this)->SAV::futures) { (void)(0); this->~Read_implActorState(); static_cast(this)->destroy(); return 0; } - #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" new (&static_cast(this)->SAV< int >::value()) int(0); this->~Read_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (length == 0) - #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (!static_cast(this)->SAV::futures) { (void)(0); this->~Read_implActorState(); static_cast(this)->destroy(); return 0; } - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" new (&static_cast(this)->SAV< int >::value()) int(0); this->~Read_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (offset + length > fileSize) - #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" length = fileSize - offset; - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" } - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" firstBlockNum = offset / f->m_block_size; - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" ASSERT(f->m_block_size > 0); - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" lastBlockNum = (offset + length - 1) / f->m_block_size; - #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" localCache = std::map>>(); - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" lastBlockNumInFile = ((fileSize + f->m_block_size - 1) / f->m_block_size) - 1; - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" ASSERT(lastBlockNum <= lastBlockNumInFile); - #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int lastBlockToStart = std::min(lastBlockNum + f->m_read_ahead_blocks, lastBlockNumInFile); - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" blockNum = int(); - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" for(blockNum = firstBlockNum;blockNum <= lastBlockToStart;++blockNum) { - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" Future> fblock; - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" auto i = f->m_blocks.find(blockNum); - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (i == f->m_blocks.end() || (i->second.isValid() && i->second.isError())) - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" fblock = readBlock(f.getPtr(), f->m_block_size, (int64_t)f->m_block_size * blockNum); - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" f->m_blocks[blockNum] = fblock; - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" } else { - #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" fblock = i->second; - #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" } - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (blockNum <= lastBlockNum) - #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" localCache[blockNum] = fblock; - #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" } } - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" wpos = 0; - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" blockNum = firstBlockNum; - #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1cont1(int64_t && fileSize,int loopDepth) { - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (offset >= fileSize) - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (!static_cast(this)->SAV::futures) { (void)(0); this->~Read_implActorState(); static_cast(this)->destroy(); return 0; } - #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" new (&static_cast(this)->SAV< int >::value()) int(0); this->~Read_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (length == 0) - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (!static_cast(this)->SAV::futures) { (void)(0); this->~Read_implActorState(); static_cast(this)->destroy(); return 0; } - #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" new (&static_cast(this)->SAV< int >::value()) int(0); this->~Read_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (offset + length > fileSize) - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" length = fileSize - offset; - #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" } - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" firstBlockNum = offset / f->m_block_size; - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" ASSERT(f->m_block_size > 0); - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" lastBlockNum = (offset + length - 1) / f->m_block_size; - #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" localCache = std::map>>(); - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" lastBlockNumInFile = ((fileSize + f->m_block_size - 1) / f->m_block_size) - 1; - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" ASSERT(lastBlockNum <= lastBlockNumInFile); - #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int lastBlockToStart = std::min(lastBlockNum + f->m_read_ahead_blocks, lastBlockNumInFile); - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" blockNum = int(); - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" for(blockNum = firstBlockNum;blockNum <= lastBlockToStart;++blockNum) { - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" Future> fblock; - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" auto i = f->m_blocks.find(blockNum); - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (i == f->m_blocks.end() || (i->second.isValid() && i->second.isError())) - #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" fblock = readBlock(f.getPtr(), f->m_block_size, (int64_t)f->m_block_size * blockNum); - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" f->m_blocks[blockNum] = fblock; - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" } else { - #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" fblock = i->second; - #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" } - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (blockNum <= lastBlockNum) - #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" localCache[blockNum] = fblock; - #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" } } - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" wpos = 0; - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" blockNum = firstBlockNum; - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; @@ -710,42 +710,42 @@ class Read_implActorState { } int a_body1cont2(int loopDepth) { - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" ASSERT(wpos == length); - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" - localCache.clear(); - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + ASSERT(localCache.empty()); + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (f->m_blocks.size() > f->m_cache_block_limit) - #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" auto i = f->m_blocks.begin(); - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" for(;i != f->m_blocks.end();) { - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (i->second.getFutureReferenceCount() == 1) - #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" i = f->m_blocks.erase(i); - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (f->m_blocks.size() <= f->m_cache_block_limit) - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { break; } } else { - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" ++i; - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" } } } - #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (!static_cast(this)->SAV::futures) { (void)(wpos); this->~Read_implActorState(); static_cast(this)->destroy(); return 0; } - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" new (&static_cast(this)->SAV< int >::value()) int(std::move(wpos)); // state_var_RVO this->~Read_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -762,22 +762,22 @@ class Read_implActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (!(blockNum <= lastBlockNum)) - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" StrictFuture> __when_expr_1 = localCache[blockNum]; - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" loopDepth = 0; return loopDepth; @@ -797,42 +797,80 @@ class Read_implActorState { } int a_body1cont1loopBody1cont1(Reference const& block,int loopDepth) { - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int64_t blockStart = (int64_t)blockNum * f->m_block_size; - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int64_t readStart = std::max(0, offset - blockStart); - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int64_t readEnd = std::min(f->m_block_size, offset + length - blockStart); - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int rlen = readEnd - readStart; - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" memcpy((uint8_t*)data + wpos, block->data + readStart, rlen); - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" wpos += rlen; - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + localCache.erase(blockNum); + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + if (f->m_blocks.size() > f->m_cache_block_limit) + #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" + { + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + auto i = f->m_blocks.find(blockNum); + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + ASSERT(i != f->m_blocks.end() && i->first == blockNum); + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + if (i->second.getFutureReferenceCount() == 1) + #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" + { + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + i = f->m_blocks.erase(i); + #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" + } + } + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" ++blockNum; - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; } int a_body1cont1loopBody1cont1(Reference && block,int loopDepth) { - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int64_t blockStart = (int64_t)blockNum * f->m_block_size; - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int64_t readStart = std::max(0, offset - blockStart); - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int64_t readEnd = std::min(f->m_block_size, offset + length - blockStart); - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int rlen = readEnd - readStart; - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" memcpy((uint8_t*)data + wpos, block->data + readStart, rlen); - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" wpos += rlen; - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + localCache.erase(blockNum); + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + if (f->m_blocks.size() > f->m_cache_block_limit) + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" + { + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + auto i = f->m_blocks.find(blockNum); + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + ASSERT(i != f->m_blocks.end() && i->first == blockNum); + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + if (i->second.getFutureReferenceCount() == 1) + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" + { + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" + i = f->m_blocks.erase(i); + #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" + } + } + #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" ++blockNum; - #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; @@ -900,32 +938,32 @@ class Read_implActorState { fdb_probe_actor_exit("read_impl", reinterpret_cast(this), 1); } - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" Reference f; - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" void* data; - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int length; - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int64_t offset; - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int firstBlockNum; - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int lastBlockNum; - #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" std::map>> localCache; - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int lastBlockNumInFile; - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int blockNum; - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" int wpos; - #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" }; // This generated class is to be used only via read_impl() - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" class Read_implActor final : public Actor, public ActorCallback< Read_implActor, 0, int64_t >, public ActorCallback< Read_implActor, 1, Reference >, public FastAllocated, public Read_implActorState { - #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -935,9 +973,9 @@ class Read_implActor final : public Actor, public ActorCallback< Read_implA #pragma clang diagnostic pop friend struct ActorCallback< Read_implActor, 0, int64_t >; friend struct ActorCallback< Read_implActor, 1, Reference >; - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" Read_implActor(Reference const& f,void* const& data,int const& length,int64_t const& offset) - #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" : Actor(), Read_implActorState(f, data, length, offset) { @@ -961,14 +999,14 @@ friend struct ActorCallback< Read_implActor, 1, Reference >; } }; - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" [[nodiscard]] static Future read_impl( Reference const& f, void* const& data, int const& length, int64_t const& offset ) { - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" return Future(new Read_implActor(f, data, length, offset)); - #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.g.h" + #line 1006 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.g.h" } -#line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileReadAhead.actor.h" +#line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h" Future read(void* data, int length, int64_t offset) override { return read_impl(Reference::addRef(this), data, length, offset); diff --git a/src/fdbrpc/AsyncFileReadAhead.actor.h b/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h similarity index 93% rename from src/fdbrpc/AsyncFileReadAhead.actor.h rename to src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h index 0b120c0..28819ab 100644 --- a/src/fdbrpc/AsyncFileReadAhead.actor.h +++ b/src/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h @@ -29,7 +29,7 @@ #define FDBRPC_ASYNCFILEREADAHEAD_ACTOR_H #include "flow/flow.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/actorcompiler.h" // This must be the last #include. // Read-only file type that wraps another file instance, reads in large blocks, and reads ahead of the actual range @@ -127,10 +127,23 @@ class AsyncFileReadAheadCache final : public IAsyncFile, public ReferenceCounted int rlen = readEnd - readStart; memcpy((uint8_t*)data + wpos, block->data + readStart, rlen); wpos += rlen; + + // unpin this block + localCache.erase(blockNum); + if (f->m_blocks.size() > f->m_cache_block_limit) { + // make an attempt to free no-longer needed blocks as we go + // FIXME: could also expire previous blocks if above limit and they're also free + auto i = f->m_blocks.find(blockNum); + ASSERT(i != f->m_blocks.end() && i->first == blockNum); + if (i->second.getFutureReferenceCount() == 1) { + // printf("evicting block %d\n", i->first); + i = f->m_blocks.erase(i); + } + } } ASSERT(wpos == length); - localCache.clear(); + ASSERT(localCache.empty()); // If the cache is too large then go through the cache in block number order and remove any entries whose future // has a reference count of 1, stopping once the cache is no longer too big. There is no point in removing diff --git a/src/fdbrpc/AsyncFileWinASIO.actor.g.h b/src/fdbrpc/include/fdbrpc/AsyncFileWinASIO.actor.g.h similarity index 99% rename from src/fdbrpc/AsyncFileWinASIO.actor.g.h rename to src/fdbrpc/include/fdbrpc/AsyncFileWinASIO.actor.g.h index 94f3898..5099c97 100644 --- a/src/fdbrpc/AsyncFileWinASIO.actor.g.h +++ b/src/fdbrpc/include/fdbrpc/AsyncFileWinASIO.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/AsyncFileWinASIO.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/AsyncFileWinASIO.actor.h" /* * AsyncFileWinASIO.actor.h * diff --git a/src/fdbrpc/AsyncFileWinASIO.actor.h b/src/fdbrpc/include/fdbrpc/AsyncFileWinASIO.actor.h similarity index 100% rename from src/fdbrpc/AsyncFileWinASIO.actor.h rename to src/fdbrpc/include/fdbrpc/AsyncFileWinASIO.actor.h diff --git a/src/fdbrpc/AsyncFileWriteChecker.h b/src/fdbrpc/include/fdbrpc/AsyncFileWriteChecker.h similarity index 99% rename from src/fdbrpc/AsyncFileWriteChecker.h rename to src/fdbrpc/include/fdbrpc/AsyncFileWriteChecker.h index fa082bc..b725159 100644 --- a/src/fdbrpc/AsyncFileWriteChecker.h +++ b/src/fdbrpc/include/fdbrpc/AsyncFileWriteChecker.h @@ -18,8 +18,8 @@ * limitations under the License. */ -#include "fdbrpc/IAsyncFile.h" -#include "flow/crc32c.h" +#include "flow/IAsyncFile.h" +#include "crc32/crc32c.h" #if VALGRIND #include diff --git a/src/fdbrpc/include/fdbrpc/Base64Decode.h b/src/fdbrpc/include/fdbrpc/Base64Decode.h new file mode 100644 index 0000000..6feb43c --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/Base64Decode.h @@ -0,0 +1,64 @@ +/* + * Base64Decode.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef BASE64_DECODE_H +#define BASE64_DECODE_H + +#include +#include +#include "flow/Arena.h" + +namespace base64 { + +// libb64 (https://github.com/libb64/libb64) adapted to support both base64 and URL-encoded base64 +// URL-encoded base64 differs from the regular base64 in following aspects: +// - Replaces '+' with '-' and '/' with '_' +// - No '=' padding at the end +// NOTE: Unlike libb64, this implementation does NOT line wrap base64-encoded output every 72 chars, +// URL-encoded or otherwise. Also, every encoding/decoding is one-off: i.e. no streaming. + +// Decodes base64-encoded input and returns the length of produced plaintext data if input is valid, -1 otherwise. +int decode(const uint8_t* __restrict codeIn, const int lengthIn, uint8_t* __restrict plaintextOut) noexcept; + +// Assuming correctly encoded base64 code length, get the decoded length +int decodedLength(int codeLength) noexcept; + +// Assuming a correct base64 string input, return the decoded plaintext. Returns an empty Optional if invalid. +// Note: even if decoding fails by bad encoding, StringRef memory still stays allocated from arena +Optional decode(Arena& arena, StringRef input); + +namespace url { + +// Decodes URL-encoded base64 input and returns the length of produced plaintext data if input is valid, -1 otherwise. +int decode(const uint8_t* __restrict codeIn, const int lengthIn, uint8_t* __restrict plaintextOut) noexcept; + +// Assuming correctly URL-encoded base64 code length, get the decoded length +// Returns -1 for invalid length (4n-3) +int decodedLength(int codeLength) noexcept; + +// Assuming a correct URL-encoded base64 string input, return the decoded plaintext. Returns an empty Optional if +// invalid. Note: even if decoding fails by bad encoding, StringRef memory still stays allocated from arena +Optional decode(Arena& arena, StringRef input); + +} // namespace url + +} // namespace base64 + +#endif /* BASE64_DECODE_H */ diff --git a/src/fdbrpc/include/fdbrpc/Base64Encode.h b/src/fdbrpc/include/fdbrpc/Base64Encode.h new file mode 100644 index 0000000..92ed6de --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/Base64Encode.h @@ -0,0 +1,60 @@ +/* + * Base64Encode.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef BASE64_ENCODE_H +#define BASE64_ENCODE_H + +#include +#include "flow/Arena.h" + +namespace base64 { + +// libb64 (https://github.com/libb64/libb64) adapted to support both base64 and URL-encoded base64 +// URL-encoded base64 differs from the regular base64 in following aspects: +// - Replaces '+' with '-' and '/' with '_' +// - No '=' padding at the end +// NOTE: Unlike libb64, this implementation does NOT line wrap base64-encoded output every 72 chars, +// URL-encoded or otherwise. Also, every encoding/decoding is one-off: i.e. no streaming. + +// Encodes plaintext into base64 string and returns the length of encoded output in bytes +int encode(const uint8_t* __restrict plaintextIn, int lengthIn, uint8_t* __restrict codeOut) noexcept; + +// Returns the number of bytes required to store the data of given length in base64 encoding. +int encodedLength(int dataLength) noexcept; + +// Encodes passed plaintext into memory allocated from arena +StringRef encode(Arena& arena, StringRef plainText); + +namespace url { + +// Encodes plaintext into URL-encoded base64 string and returns the length of encoded output in bytes +int encode(const uint8_t* __restrict plaintextIn, int lengthIn, uint8_t* __restrict codeOut) noexcept; + +// Returns the number of bytes required to store the data of given length in URL-encoded base64 +int encodedLength(int dataLength) noexcept; + +// encode passed string into memory allocated from arena +StringRef encode(Arena& arena, StringRef plainText); + +} // namespace url + +} // namespace base64 + +#endif /* BASE64_ENCODE_H */ diff --git a/src/fdbrpc/ContinuousSample.h b/src/fdbrpc/include/fdbrpc/ContinuousSample.h similarity index 81% rename from src/fdbrpc/ContinuousSample.h rename to src/fdbrpc/include/fdbrpc/ContinuousSample.h index 11a9d35..f6cf80c 100644 --- a/src/fdbrpc/ContinuousSample.h +++ b/src/fdbrpc/include/fdbrpc/ContinuousSample.h @@ -32,11 +32,24 @@ template class ContinuousSample { public: explicit ContinuousSample(int sampleSize) - : sampleSize(sampleSize), populationSize(0), sorted(true), _min(T()), _max(T()) {} + : sampleSize(sampleSize), populationSize(0), sorted(true), _min(T()), _max(T()), _sum(T()) {} + + void swap(ContinuousSample& other) { + std::swap(samples, other.samples); + std::swap(_min, other._min); + std::swap(_max, other._max); + std::swap(_sum, other._sum); + std::swap(populationSize, other.populationSize); + std::swap(sorted, other.sorted); + std::swap(sampleSize, other.sampleSize); + } ContinuousSample& addSample(T sample) { if (!populationSize) - _min = _max = sample; + _sum = _min = _max = sample; + else { + _sum += sample; + } populationSize++; sorted = false; @@ -51,6 +64,10 @@ class ContinuousSample { return *this; } + std::vector getSamples() const { return samples; } + + double sum() const { return _sum; } + double mean() const { if (!samples.size()) return 0; @@ -78,7 +95,7 @@ class ContinuousSample { samples.clear(); populationSize = 0; sorted = true; - _min = _max = 0; // Doesn't work for all T + _min = _max = _sum = 0; // Doesn't work for all T } uint64_t getPopulationSize() const { return populationSize; } @@ -88,7 +105,7 @@ class ContinuousSample { uint64_t populationSize; bool sorted; std::vector samples; - T _min, _max; + T _min, _max, _sum; void sort() { if (!sorted && samples.size() > 1) diff --git a/src/fdbrpc/include/fdbrpc/DDSketch.h b/src/fdbrpc/include/fdbrpc/DDSketch.h new file mode 100644 index 0000000..663669b --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/DDSketch.h @@ -0,0 +1,302 @@ +/* + * DDSketch.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2020 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. + */ + +#ifndef DDSKETCH_H +#define DDSKETCH_H +#include +#include +#include +#pragma once + +#include +#include +#include +#include +#include "flow/Error.h" +#include "flow/UnitTest.h" + +// A namespace for fast log() computation. +namespace fastLogger { +// Basically, the goal is to compute log(x)/log(r). +// For double, it is represented as 2^e*(1+s) (0<=s<1), so our goal becomes +// e*log(2)/log(r)*log(1+s), and we approximate log(1+s) with a cubic function. +// See more details on Datadog's paper, or CubicallyInterpolatedMapping.java in +// https://github.com/DataDog/sketches-java/ +inline const double correctingFactor = 1.00988652862227438516; // = 7 / (10 * log(2)); +constexpr inline const double A = 6.0 / 35.0, B = -3.0 / 5.0, C = 10.0 / 7.0; + +inline double fastlog(double value) { + int e; + double s = frexp(value, &e); + s = s * 2 - 1; + return ((A * s + B) * s + C) * s + e - 1; +} + +inline double reverseLog(double index) { + long exponent = floor(index); + // Derived from Cardano's formula + double d0 = B * B - 3 * A * C; + double d1 = 2 * B * B * B - 9 * A * B * C - 27 * A * A * (index - exponent); + double p = cbrt((d1 - sqrt(d1 * d1 - 4 * d0 * d0 * d0)) / 2); + double significandPlusOne = -(B + p + d0 / p) / (3 * A) + 1; + return ldexp(significandPlusOne / 2, exponent + 1); +} +}; // namespace fastLogger + +// DDSketch for non-negative numbers (those < EPS = 10^-18 are +// treated as 0, and huge numbers (>1/EPS) fail ASSERT). This is the base +// class without a concrete log() implementation. +template +class DDSketchBase { + + static constexpr T defaultMin() { return std::numeric_limits::max(); } + + static constexpr T defaultMax() { + if constexpr (std::is_floating_point_v) { + return -std::numeric_limits::max(); + } else { + return std::numeric_limits::min(); + } + } + +public: + explicit DDSketchBase(double errorGuarantee) + : errorGuarantee(errorGuarantee), populationSize(0), zeroPopulationSize(0), minValue(defaultMin()), + maxValue(defaultMax()), sum(T()) { + ASSERT(errorGuarantee > 0 && errorGuarantee < 1); + } + + DDSketchBase& addSample(T sample) { + // Call it addSample for now, while it is not a sample anymore + if (!populationSize) + minValue = maxValue = sample; + + if (sample <= EPS) { + zeroPopulationSize++; + } else { + size_t index = static_cast(this)->getIndex(sample); + ASSERT(index >= 0 && index < buckets.size()); + try { + buckets.at(index)++; + } catch (std::out_of_range const& e) { + fmt::print(stderr, + "ERROR: Invalid DDSketch bucket index ({}) at {}/{} for sample: {}\n", + e.what(), + index, + buckets.size(), + sample); + } + } + + populationSize++; + sum += sample; + maxValue = std::max(maxValue, sample); + minValue = std::min(minValue, sample); + return *this; + } + + double mean() const { + if (populationSize == 0) + return 0; + return (double)sum / populationSize; + } + + T median() { return percentile(0.5); } + + T percentile(double percentile) { + ASSERT(percentile >= 0 && percentile <= 1); + + if (populationSize == 0) + return T(); + uint64_t targetPercentilePopulation = percentile * (populationSize - 1); + // Now find the tPP-th (0-indexed) element + if (targetPercentilePopulation < zeroPopulationSize) + return T(0); + + size_t index = 0; + [[maybe_unused]] bool found = false; + if (percentile <= 0.5) { // count up + uint64_t count = zeroPopulationSize; + for (size_t i = 0; i < buckets.size(); i++) { + if (targetPercentilePopulation < count + buckets[i]) { + // count + buckets[i] = # of numbers so far (from the rightmost to + // this bucket, inclusive), so if target is in this bucket, it should + // means tPP < cnt + bck[i] + found = true; + index = i; + break; + } + count += buckets[i]; + } + } else { // and count down + uint64_t count = 0; + for (auto rit = buckets.rbegin(); rit != buckets.rend(); rit++) { + if (targetPercentilePopulation + count + *rit >= populationSize) { + // cnt + bkt[i] is # of numbers to the right of this bucket (incl.), + // so if target is not in this bucket (i.e., to the left of this + // bucket), it would be as right as the left bucket's rightmost + // number, so we would have tPP + cnt + bkt[i] < total population (tPP + // is 0-indexed), that means target is in this bucket if this + // condition is not satisfied. + found = true; + index = std::distance(rit, buckets.rend()) - 1; + break; + } + count += *rit; + } + } + ASSERT(found); + if (!found) + return -1; + return static_cast(this)->getValue(index); + } + + T min() const { return minValue; } + T max() const { return maxValue; } + T getSum() const { return sum; } + + void clear() { + std::fill(buckets.begin(), buckets.end(), 0); + populationSize = zeroPopulationSize = 0; + sum = 0; + minValue = defaultMin(); + maxValue = defaultMax(); + } + + uint64_t getPopulationSize() const { return populationSize; } + + double getErrorGuarantee() const { return errorGuarantee; } + + size_t getBucketSize() const { return buckets.size(); } + + std::vector getSamples() const { return buckets; } + + DDSketchBase& mergeWith(const DDSketchBase& anotherSketch) { + // Must have the same guarantee + ASSERT(fabs(errorGuarantee - anotherSketch.errorGuarantee) < EPS && + anotherSketch.buckets.size() == buckets.size()); + for (size_t i = 0; i < anotherSketch.buckets.size(); i++) { + buckets[i] += anotherSketch.buckets[i]; + } + populationSize += anotherSketch.populationSize; + zeroPopulationSize += anotherSketch.zeroPopulationSize; + minValue = std::min(minValue, anotherSketch.minValue); + maxValue = std::max(maxValue, anotherSketch.maxValue); + sum += anotherSketch.sum; + return *this; + } + + constexpr static double EPS = 1e-18; // smaller numbers are considered as 0 +protected: + double errorGuarantee; // As defined in the paper + + uint64_t populationSize, zeroPopulationSize; // we need to separately count 0s + std::vector buckets; + T minValue, maxValue, sum; + void setBucketSize(size_t capacity) { buckets.resize(capacity, 0); } +}; + +// DDSketch with fast log implementation for float numbers +template +class DDSketch : public DDSketchBase, T> { +public: + explicit DDSketch(double errorGuarantee = 0.005) + : DDSketchBase, T>(errorGuarantee), gamma((1.0 + errorGuarantee) / (1.0 - errorGuarantee)), + multiplier(fastLogger::correctingFactor * log(2) / log(gamma)) { + ASSERT(errorGuarantee > 0); + offset = getIndex(1.0 / DDSketchBase, T>::EPS); + ASSERT(offset > 0); + this->setBucketSize(2 * offset); + } + + size_t getIndex(T sample) { + static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__, "Do not support non-little-endian systems"); + return ceil(fastLogger::fastlog(sample) * multiplier) + offset; + } + + T getValue(size_t index) { + return fastLogger::reverseLog((static_cast(index) - static_cast(offset)) / multiplier) * 2.0 / + (1 + gamma); + } + +private: + double gamma, multiplier; + size_t offset = 0; +}; + +// DDSketch with log. Slow and only use this when others doesn't work. +template +class DDSketchSlow : public DDSketchBase, T> { +public: + DDSketchSlow(double errorGuarantee = 0.1) + : DDSketchBase, T>(errorGuarantee), gamma((1.0 + errorGuarantee) / (1.0 - errorGuarantee)), + logGamma(log(gamma)) { + offset = getIndex(1.0 / DDSketchBase, T>::EPS) + 5; + this->setBucketSize(2 * offset); + } + + size_t getIndex(T sample) { return ceil(log(sample) / logGamma) + offset; } + + T getValue(size_t index) { + return (T)(2.0 * pow(gamma, (static_cast(index) - static_cast(offset))) / (1 + gamma)); + } + +private: + double gamma, logGamma; + size_t offset = 0; +}; + +// DDSketch for unsigned int. Faster than the float version. Fixed accuracy. +class DDSketchFastUnsigned : public DDSketchBase { +public: + DDSketchFastUnsigned() : DDSketchBase(errorGuarantee) { this->setBucketSize(129); } + + size_t getIndex(unsigned sample) { + __uint128_t v = sample; + v *= v; + v *= v; // sample^4 + uint64_t low = (uint64_t)v, high = (uint64_t)(v >> 64); + + return 128 - (high == 0 ? ((low == 0 ? 64 : __builtin_clzll(low)) + 64) : __builtin_clzll(high)); + } + + unsigned getValue(size_t index) { + double r = 1, g = gamma; + while (index) { // quick power method for power(gamma, index) + if (index & 1) + r *= g; + g *= g; + index >>= 1; + } + // 2.0 * pow(gamma, index) / (1 + gamma) is what we need + return (unsigned)(2.0 * r / (1 + gamma) + 0.5); // round to nearest int + } + +private: + constexpr static double errorGuarantee = 0.08642723372; + // getIndex basically calc floor(log_2(x^4)) + 1, + // which is almost ceil(log_2(x^4)) as it only matters when x is a power of 2, + // and it does not change the error bound. Original sketch asks for + // ceil(log_r(x)), so we know r = pow(2, 1/4) = 1.189207115. And r = (1 + eG) + // / (1 - eG) so eG = 0.08642723372. + constexpr static double gamma = 1.189207115; +}; + +#endif diff --git a/src/fdbrpc/FailureMonitor.h b/src/fdbrpc/include/fdbrpc/FailureMonitor.h similarity index 93% rename from src/fdbrpc/FailureMonitor.h rename to src/fdbrpc/include/fdbrpc/FailureMonitor.h index 280f74d..d32d141 100644 --- a/src/fdbrpc/FailureMonitor.h +++ b/src/fdbrpc/include/fdbrpc/FailureMonitor.h @@ -93,6 +93,9 @@ class IFailureMonitor { // Only use this function when the endpoint is known to be failed virtual void endpointNotFound(Endpoint const&) = 0; + // Inform client that it was trying to send a message to a private endpoint + virtual void unauthorizedEndpoint(Endpoint const&) = 0; + // The next time the known status for the endpoint changes, returns the new status. virtual Future onStateChanged(Endpoint const& endpoint) = 0; @@ -108,6 +111,9 @@ class IFailureMonitor { // Returns true if the endpoint will never become available. virtual bool permanentlyFailed(Endpoint const& endpoint) const = 0; + // Returns true if we known we're not allowed to send messages to the remote endpoint + virtual bool knownUnauthorized(Endpoint const&) const = 0; + // Called by FlowTransport when a connection closes and a prior request or reply might be lost virtual void notifyDisconnect(NetworkAddress const&) = 0; @@ -139,9 +145,11 @@ class IFailureMonitor { class SimpleFailureMonitor : public IFailureMonitor { public: + enum class FailedReason { NOT_FOUND, UNAUTHORIZED }; SimpleFailureMonitor(); void setStatus(NetworkAddress const& address, FailureStatus const& status) override; void endpointNotFound(Endpoint const&) override; + void unauthorizedEndpoint(Endpoint const&) override; void notifyDisconnect(NetworkAddress const&) override; Future onStateChanged(Endpoint const& endpoint) override; @@ -151,6 +159,7 @@ class SimpleFailureMonitor : public IFailureMonitor { Future onDisconnect(NetworkAddress const& address) override; bool onlyEndpointFailed(Endpoint const& endpoint) const override; bool permanentlyFailed(Endpoint const& endpoint) const override; + bool knownUnauthorized(Endpoint const&) const override; void reset(); @@ -158,7 +167,7 @@ class SimpleFailureMonitor : public IFailureMonitor { std::unordered_map addressStatus; YieldedAsyncMap endpointKnownFailed; AsyncMap disconnectTriggers; - std::unordered_set failedEndpoints; + std::unordered_map failedEndpoints; friend class OnStateChangedActorActor; }; diff --git a/src/fdbrpc/FlowProcess.actor.g.h b/src/fdbrpc/include/fdbrpc/FlowProcess.actor.g.h similarity index 98% rename from src/fdbrpc/FlowProcess.actor.g.h rename to src/fdbrpc/include/fdbrpc/FlowProcess.actor.g.h index becff60..767fe42 100644 --- a/src/fdbrpc/FlowProcess.actor.g.h +++ b/src/fdbrpc/include/fdbrpc/FlowProcess.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/FlowProcess.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/FlowProcess.actor.h" /* * FlowProcess.actor.h * diff --git a/src/fdbrpc/FlowProcess.actor.h b/src/fdbrpc/include/fdbrpc/FlowProcess.actor.h similarity index 100% rename from src/fdbrpc/FlowProcess.actor.h rename to src/fdbrpc/include/fdbrpc/FlowProcess.actor.h diff --git a/src/fdbrpc/FlowTransport.h b/src/fdbrpc/include/fdbrpc/FlowTransport.h similarity index 85% rename from src/fdbrpc/FlowTransport.h rename to src/fdbrpc/include/fdbrpc/FlowTransport.h index 1f283a1..f7e89b5 100644 --- a/src/fdbrpc/FlowTransport.h +++ b/src/fdbrpc/include/fdbrpc/FlowTransport.h @@ -23,15 +23,20 @@ #pragma once #include + +#include "fdbrpc/DDSketch.h" #include "fdbrpc/HealthMonitor.h" #include "flow/genericactors.actor.h" #include "flow/network.h" #include "flow/FileIdentifier.h" #include "flow/ProtocolVersion.h" #include "flow/Net2Packet.h" -#include "fdbrpc/ContinuousSample.h" +#include "flow/Arena.h" +#include "flow/PKey.h" + +class IConnection; -enum { WLTOKEN_ENDPOINT_NOT_FOUND = 0, WLTOKEN_PING_PACKET, WLTOKEN_FIRST_AVAILABLE }; +enum { WLTOKEN_ENDPOINT_NOT_FOUND = 0, WLTOKEN_PING_PACKET, WLTOKEN_UNAUTHORIZED_ENDPOINT, WLTOKEN_FIRST_AVAILABLE }; #pragma pack(push, 4) class Endpoint { @@ -87,6 +92,7 @@ class Endpoint { bool operator<(Endpoint const& r) const { return addresses.address < r.addresses.address || (addresses.address == r.addresses.address && token < r.token); } + bool operator>=(Endpoint const& r) const { return !(*this < r); } template void serialize(Ar& ar) { @@ -129,6 +135,7 @@ class NetworkMessageReceiver { public: virtual void receive(ArenaObjectReader&) = 0; virtual bool isStream() const { return false; } + virtual bool isPublic() const = 0; virtual PeerCompatibilityPolicy peerCompatibilityPolicy() const { return { RequirePeer::Exactly, g_network->protocolVersion() }; } @@ -146,17 +153,17 @@ struct Peer : public ReferenceCounted { AsyncTrigger resetPing; AsyncTrigger resetConnection; bool compatible; + bool connected; bool outgoingConnectionIdle; // We don't actually have a connection open and aren't trying to open one because we // don't have anything to send double lastConnectTime; double reconnectionDelay; int peerReferences; - bool incompatibleProtocolVersionNewer; int64_t bytesReceived; int64_t bytesSent; double lastDataPacketSentTime; int outstandingReplies; - ContinuousSample pingLatencies; + DDSketch pingLatencies; double lastLoggedTime; int64_t lastLoggedBytesReceived; int64_t lastLoggedBytesSent; @@ -168,7 +175,7 @@ struct Peer : public ReferenceCounted { int connectOutgoingCount; int connectIncomingCount; int connectFailedCount; - ContinuousSample connectLatencies; + DDSketch connectLatencies; Promise disconnect; explicit Peer(TransportData* transport, NetworkAddress const& destination); @@ -182,14 +189,19 @@ struct Peer : public ReferenceCounted { void onIncomingConnection(Reference self, Reference conn, Future reader); }; -class FlowTransport { +class IPAllowList; + +class FlowTransport : NonCopyable { public: - FlowTransport(uint64_t transportId, int maxWellKnownEndpoints); + FlowTransport(uint64_t transportId, int maxWellKnownEndpoints, IPAllowList const* allowList); ~FlowTransport(); // Creates a new FlowTransport and makes FlowTransport::transport() return it. This uses g_network->global() // variables, so it will be private to a simulation. - static void createInstance(bool isClient, uint64_t transportId, int maxWellKnownEndpoints); + static void createInstance(bool isClient, + uint64_t transportId, + int maxWellKnownEndpoints, + IPAllowList const* allowList = nullptr); static bool isClient() { return g_network->global(INetwork::enClientFailureMonitor) != nullptr; } @@ -203,6 +215,13 @@ class FlowTransport { // Returns first local NetworkAddress. NetworkAddress getLocalAddress() const; + // Returns first local NetworkAddress as std::string. Caches value + // to avoid unnecessary calls to toString() and fmt overhead. + Standalone getLocalAddressAsString() const; + + // Returns first local NetworkAddress. + void setLocalAddress(NetworkAddress const&); + // Returns all local NetworkAddress. NetworkAddressList getLocalAddresses() const; @@ -224,7 +243,7 @@ class FlowTransport { // Sets endpoint to be a new local endpoint which delivers messages to the given receiver void addEndpoint(Endpoint& endpoint, NetworkMessageReceiver*, TaskPriority taskID); - void addEndpoints(std::vector> const& streams); + void addEndpoints(std::vector> const& streams); // The given local endpoint no longer delivers messages to the given receiver or uses resources void removeEndpoint(const Endpoint&, NetworkMessageReceiver*); @@ -274,6 +293,21 @@ class FlowTransport { HealthMonitor* healthMonitor(); + bool currentDeliveryPeerIsTrusted() const; + NetworkAddress currentDeliveryPeerAddress() const; + + Optional getPublicKeyByName(StringRef name) const; + // Adds or replaces a public key + void addPublicKey(StringRef name, PublicKey key); + void removePublicKey(StringRef name); + void removeAllPublicKeys(); + + // Synchronously load and apply JWKS (RFC 7517) public key file with which to verify authorization tokens. + void loadPublicKeyFile(const std::string& publicKeyFilePath); + + // Periodically read JWKS (RFC 7517) public key file to refresh public key set. + void watchPublicKeyFile(const std::string& publicKeyFilePath); + private: class TransportData* self; }; diff --git a/src/fdbrpc/include/fdbrpc/HTTP.h b/src/fdbrpc/include/fdbrpc/HTTP.h new file mode 100644 index 0000000..843ca40 --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/HTTP.h @@ -0,0 +1,196 @@ +/* + * HTTP.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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. + */ + +#ifndef FDBRPC_HTTP_H +#define FDBRPC_HTTP_H + +#include "flow/NetworkAddress.h" +#pragma once + +#include "flow/flow.h" +#include "flow/ActorCollection.h" +#include "flow/IConnection.h" +#include "flow/IRateControl.h" +#include "flow/Net2Packet.h" + +namespace HTTP { +struct is_iless { + bool operator()(const std::string& a, const std::string& b) const { return strcasecmp(a.c_str(), b.c_str()) < 0; } +}; + +constexpr int HTTP_STATUS_CODE_OK = 200; +constexpr int HTTP_STATUS_CODE_CREATED = 201; +constexpr int HTTP_STATUS_CODE_ACCEPTED = 202; +constexpr int HTTP_STATUS_CODE_NO_CONTENT = 204; +constexpr int HTTP_STATUS_CODE_UNAUTHORIZED = 401; +constexpr int HTTP_STATUS_CODE_NOT_ACCEPTABLE = 406; +constexpr int HTTP_STATUS_CODE_TIMEOUT = 408; +constexpr int HTTP_STATUS_CODE_TOO_MANY_REQUESTS = 429; +constexpr int HTTP_STATUS_CODE_INTERNAL_SERVER_ERROR = 500; +constexpr int HTTP_STATUS_CODE_BAD_GATEWAY = 502; +constexpr int HTTP_STATUS_CODE_SERVICE_UNAVAILABLE = 503; +constexpr int HTTP_STATUS_CODE_GATEWAY_TIMEOUT = 504; + +constexpr int HTTP_RETRYAFTER_DELAY_SECS = 300; + +const std::string HTTP_VERB_GET = "GET"; +const std::string HTTP_VERB_HEAD = "HEAD"; +const std::string HTTP_VERB_DELETE = "DELETE"; +const std::string HTTP_VERB_TRACE = "TRACE"; +const std::string HTTP_VERB_PUT = "PUT"; +const std::string HTTP_VERB_POST = "POST"; +const std::string HTTP_VERB_CONNECT = "CONNECT"; + +typedef std::map Headers; + +std::string urlEncode(const std::string& s); +std::string awsV4URIEncode(const std::string& s, bool encodeSlash); + +template +struct HTTPData { + Headers headers; + int64_t contentLen; + T content; +}; + +// computes the sum in base-64 for http +std::string computeMD5Sum(std::string content); + +// class methods on template type classes are weird +bool verifyMD5(HTTPData* data, + bool fail_if_header_missing, + Optional content_sum = Optional()); + +template +struct RequestBase : ReferenceCounted> { + RequestBase() {} + std::string verb; + std::string resource; + HTTPData data; + + bool isHeaderOnlyResponse() { + return verb == HTTP_VERB_HEAD || verb == HTTP_VERB_DELETE || verb == HTTP_VERB_CONNECT; + } +}; + +// TODO: utility for constructing packet buffer from string OutgoingRequest +struct IncomingRequest : RequestBase { + Future read(Reference conn, bool header_only = false); +}; +struct OutgoingRequest : RequestBase {}; + +template +struct ResponseBase : ReferenceCounted> { + ResponseBase() {} + float version; + int code; + HTTPData data; + + std::string getCodeDescription(); +}; + +struct IncomingResponse : ResponseBase { + std::string toString() const; // for debugging + Future read(Reference conn, bool header_only = false); +}; +struct OutgoingResponse : ResponseBase { + Future write(Reference conn); + void reset(); +}; + +// Do an HTTP request to the blob store, parse the response. +Future> doRequest(Reference conn, + Reference request, + Reference sendRate, + int64_t* pSent, + Reference recvRate); + +// Connect to proxy, send CONNECT command, and connect to the remote host. +Future> proxyConnect(const std::string& remoteHost, + const std::string& remoteService, + const std::string& proxyHost, + const std::string& proxyService); + +// HTTP server stuff + +// Implementation of http server that handles http requests +// TODO: could change to factory pattern instead of clone pattern +struct IRequestHandler { + // Sets up state for each instance of the handler. Provides default stateless implementation, but a stateful handler + // must override this. + virtual Future init() { return Future(Void()); }; + + // Actual callback implementation. Fills out the response object based on the request. + virtual Future handleRequest(Reference, Reference) = 0; + + // If each instance has a mix of global state provided in the type-specific construtor, but then also local state + // instantiated in init, the default instance passed to registerSimHTTPServer is cloned for each process to copy the + // global state, but before init is called. You may optionally clone after init, but the contract is that clone must + // not copy or share the non-global state between instances. + virtual Reference clone() = 0; + + // for reference counting an interface - don't implement ReferenceCounted + virtual void addref() = 0; + virtual void delref() = 0; +}; + +struct SimRegisteredHandlerContext : ReferenceCounted, NonCopyable { +public: + std::string hostname; + std::string service; + Reference requestHandler; + + SimRegisteredHandlerContext(std::string hostname, std::string service, Reference requestHandler) + : hostname(hostname), service(service), requestHandler(requestHandler) {} + + void addAddress(NetworkAddress addr); + void removeIp(IPAddress addr); + +private: + std::vector addresses; + void updateDNS(); +}; + +struct SimServerContext : ReferenceCounted, NonCopyable { + UID dbgid; + bool running; + int nextPort; + ActorCollection actors; + std::vector listenAddresses; + std::vector> listenBinds; + std::vector> listeners; + + SimServerContext() : dbgid(deterministicRandom()->randomUniqueID()), running(true), actors(false), nextPort(5000) {} + + NetworkAddress newAddress(); + void registerNewServer(NetworkAddress addr, Reference server); + + void stop() { + running = false; + actors = ActorCollection(false); + listenAddresses.clear(); + listenBinds.clear(); + listeners.clear(); + } +}; + +} // namespace HTTP + +#endif diff --git a/src/fdbrpc/HealthMonitor.h b/src/fdbrpc/include/fdbrpc/HealthMonitor.h similarity index 100% rename from src/fdbrpc/HealthMonitor.h rename to src/fdbrpc/include/fdbrpc/HealthMonitor.h diff --git a/src/fdbrpc/include/fdbrpc/IPAllowList.h b/src/fdbrpc/include/fdbrpc/IPAllowList.h new file mode 100644 index 0000000..4be11a7 --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/IPAllowList.h @@ -0,0 +1,86 @@ +/* + * IPAllowList.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 +#ifndef FDBRPC_IP_ALLOW_LIST_H +#define FDBRPC_IP_ALLOW_LIST_H + +#include "flow/network.h" +#include "flow/Arena.h" + +struct AuthAllowedSubnet { + IPAddress baseAddress; + IPAddress addressMask; + + AuthAllowedSubnet(IPAddress const& baseAddress, IPAddress const& addressMask); + + static AuthAllowedSubnet fromString(std::string_view addressString); + + template + static std::array createBitMask(std::array const& addr, int netmaskWeight); + + bool operator()(IPAddress const& address) const { + if (addressMask.isV4() != address.isV4()) { + return false; + } + if (addressMask.isV4()) { + return (addressMask.toV4() & address.toV4()) == baseAddress.toV4(); + } else { + auto res = address.toV6(); + auto const& mask = addressMask.toV6(); + for (int i = 0; i < res.size(); ++i) { + res[i] &= mask[i]; + } + return res == baseAddress.toV6(); + } + } + + IPAddress netmask() const; + + int netmaskWeight() const; + + // some useful helper functions if we need to debug ip masks etc + static void printIP(std::string_view txt, IPAddress const& address); +}; + +class IPAllowList { + std::vector subnetList; + +public: + void addTrustedSubnet(std::string_view str) { subnetList.push_back(AuthAllowedSubnet::fromString(str)); } + + void addTrustedSubnet(AuthAllowedSubnet const& subnet) { subnetList.push_back(subnet); } + + std::vector const& subnets() const { return subnetList; } + + bool operator()(IPAddress address) const { + if (subnetList.empty()) { + return true; + } + for (auto const& subnet : subnetList) { + if (subnet(address)) { + return true; + } + } + return false; + } +}; + +#endif // FDBRPC_IP_ALLOW_LIST_H diff --git a/src/fdbrpc/include/fdbrpc/JsonWebKeySet.h b/src/fdbrpc/include/fdbrpc/JsonWebKeySet.h new file mode 100644 index 0000000..6c28541 --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/JsonWebKeySet.h @@ -0,0 +1,67 @@ +/* + * JsonWebKeySet.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBRPC_JSON_WEB_KEY_SET_H +#define FDBRPC_JSON_WEB_KEY_SET_H +#include "flow/Arena.h" +#include "flow/PKey.h" +#include +#include + +struct PublicOrPrivateKey { + std::variant key; + + PublicOrPrivateKey() noexcept = default; + + PublicOrPrivateKey(PublicKey key) noexcept : key(std::in_place_type, key) {} + + PublicOrPrivateKey(PrivateKey key) noexcept : key(std::in_place_type, key) {} + + bool isPublic() const noexcept { return std::holds_alternative(key); } + + bool isPrivate() const noexcept { return std::holds_alternative(key); } + + PublicKey getPublic() const { return std::get(key); } + + PrivateKey getPrivate() const { return std::get(key); } +}; + +// Implements JWKS standard in restricted scope: +// - Parses and stores public/private keys (but not shared keys) as OpenSSL internal types +// - Accept only a) EC algorithm with P-256 curve or b) RSA algorithm. +// - Each key object must meet following requirements: +// - "alg" field is set to either "ES256" or "RS256" +// - "kty" field is set to "EC" or "RSA" +// - "kty" field matches the "alg" field: i.e. EC for "alg":"ES256" and RSA for "alg":"RS256" +struct JsonWebKeySet { + using KeyMap = std::map, PublicOrPrivateKey>; + KeyMap keys; + + // Parse JWKS string to map of KeyName-PKey + // If allowedUses is not empty, JWK's optional "use" member is verified against it. + // Otherwise, uses are all-inclusive. + static Optional parse(StringRef jwksString, VectorRef allowedUses); + + // Returns JSON string representing the JSON Web Key Set. + // Inverse operation of parse(). Only allows keys expected/accepted by parse(). + Optional toStringRef(Arena& arena); +}; + +#endif // FDBRPC_JSON_WEB_KEY_SET_H diff --git a/src/fdbrpc/LoadBalance.actor.g.h b/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h similarity index 58% rename from src/fdbrpc/LoadBalance.actor.g.h rename to src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h index dcfce2b..02d45ec 100644 --- a/src/fdbrpc/LoadBalance.actor.g.h +++ b/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" /* * LoadBalance.actor.h * @@ -43,10 +43,10 @@ #include "fdbrpc/TSSComparison.h" #include "flow/actorcompiler.h" // This must be the last #include. - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" [[nodiscard]] Future allAlternativesFailedDelay( Future const& okFuture ); -#line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" +#line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" struct ModelHolder : NonCopyable, public ReferenceCounted { QueueModel* model; @@ -83,51 +83,51 @@ struct LoadBalancedReply { Optional getLoadBalancedReply(const LoadBalancedReply* reply); Optional getLoadBalancedReply(const void*); - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" namespace { // This generated class is to be used only via tssComparison() - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -template - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +template + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" class TssComparisonActorState { - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" public: - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - TssComparisonActorState(Req const& req,Future> const& fSource,Future> const& fTss,TSSEndpointData const& tssData,uint64_t const& srcEndpointId,Reference> const& ssTeam,RequestStream Interface::* const& channel) - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + TssComparisonActorState(Req const& req,Future> const& fSource,Future> const& fTss,TSSEndpointData const& tssData,uint64_t const& srcEndpointId,Reference> const& ssTeam,RequestStream Interface::* const& channel) + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" : req(req), - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" fSource(fSource), - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" fTss(fTss), - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" tssData(tssData), - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" srcEndpointId(srcEndpointId), - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ssTeam(ssTeam), - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" channel(channel), - #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" startTime(now()), - #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" fTssWithTimeout(timeout(fTss, FLOW_KNOBS->LOAD_BALANCE_TSS_TIMEOUT)), - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" finished(0), - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" srcEndTime(), - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" tssEndTime(), - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" srcErrorCode(error_code_success), - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" tssErrorCode(error_code_success), - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" src(), - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" tss() - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { fdb_probe_actor_create("tssComparison", reinterpret_cast(this)); @@ -140,9 +140,9 @@ class TssComparisonActorState { int a_body1(int loopDepth=0) { try { - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ; - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -163,102 +163,102 @@ class TssComparisonActorState { } int a_body1cont1(int loopDepth) { - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ++tssData.metrics->requests; - #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (src.isError()) - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" srcErrorCode = src.getError().code(); - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" tssData.metrics->ssError(srcErrorCode); - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!tss.present()) - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ++tssData.metrics->tssTimeouts; - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } else { - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (tss.get().isError()) - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" tssErrorCode = tss.get().getError().code(); - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" tssData.metrics->tssError(tssErrorCode); - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!src.isError() && tss.present() && !tss.get().isError()) - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Optional srcLB = getLoadBalancedReply(&src.get()); - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Optional tssLB = getLoadBalancedReply(&tss.get().get()); - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ASSERT(srcLB.present() == tssLB.present()); - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!srcLB.present() || (!srcLB.get().error.present() && !tssLB.get().error.present())) - #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" tssData.metrics->recordLatency(req, srcEndTime - startTime, tssEndTime - startTime); - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!TSS_doCompare(src.get(), tss.get().get())) - #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - TEST(true); - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - mismatchEvent = TraceEvent((g_network->isSimulated() && g_simulator.tssMode == ISimulator::TSSMode::EnabledDropMutations) ? SevWarnAlways : SevError, TSS_mismatchTraceName(req)); - #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + CODE_PROBE(true, "TSS Mismatch"); + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + mismatchEvent = TraceEvent((g_network->isSimulated() && g_simulator->tssMode == ISimulator::TSSMode::EnabledDropMutations) ? SevWarnAlways : SevError, TSS_mismatchTraceName(req)); + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" mismatchEvent.setMaxEventLength(FLOW_KNOBS->TSS_LARGE_TRACE_SIZE); - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" mismatchEvent.detail("TSSID", tssData.tssId); - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_VERIFY_SS && ssTeam->size() > 1) - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - TEST(true); - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + CODE_PROBE(true, "checking TSS mismatch against rest of storage team"); + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" restOfTeamFutures = std::vector>>(); - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" restOfTeamFutures.reserve(ssTeam->size() - 1); - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" for(int i = 0;i < ssTeam->size();i++) { - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - RequestStream const* si = &ssTeam->get(i, channel); - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + RequestStream const* si = &ssTeam->get(i, channel); + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (si->getEndpoint().token.first() != srcEndpointId) - #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" resetReply(req); - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" restOfTeamFutures.push_back(si->tryGetReply(req)); - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" StrictFuture __when_expr_2 = waitForAllReady(restOfTeamFutures); - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = 0; } else @@ -273,27 +273,27 @@ class TssComparisonActorState { } else { - #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (tssLB.present() && tssLB.get().error.present()) - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" tssErrorCode = tssLB.get().error.get().code(); - #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" tssData.metrics->tssError(tssErrorCode); - #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } else { - #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (srcLB.present() && srcLB.get().error.present()) - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" srcErrorCode = srcLB.get().error.get().code(); - #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" tssData.metrics->ssError(srcErrorCode); - #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } loopDepth = a_body1cont7(loopDepth); @@ -315,22 +315,22 @@ class TssComparisonActorState { } int a_body1loopBody1(int loopDepth) { - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" StrictFuture __when_expr_0 = store(src, fSource); - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" StrictFuture __when_expr_1 = store(tss, fTssWithTimeout); - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = 0; return loopDepth; @@ -356,15 +356,15 @@ class TssComparisonActorState { } int a_body1loopBody1when1(Void const& _,int loopDepth) { - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" srcEndTime = now(); - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" fSource = Never(); - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" finished++; - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (finished == 2) - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } @@ -374,15 +374,15 @@ class TssComparisonActorState { } int a_body1loopBody1when1(Void && _,int loopDepth) { - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" srcEndTime = now(); - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" fSource = Never(); - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" finished++; - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (finished == 2) - #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } @@ -392,15 +392,15 @@ class TssComparisonActorState { } int a_body1loopBody1when2(Void const& _,int loopDepth) { - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" tssEndTime = now(); - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" fTssWithTimeout = Never(); - #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" finished++; - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (finished == 2) - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } @@ -410,15 +410,15 @@ class TssComparisonActorState { } int a_body1loopBody1when2(Void && _,int loopDepth) { - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" tssEndTime = now(); - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" fTssWithTimeout = Never(); - #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" finished++; - #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (finished == 2) - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } @@ -525,17 +525,17 @@ class TssComparisonActorState { } int a_body1cont2(int loopDepth) { - #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (srcErrorCode != error_code_success && tssErrorCode != error_code_success && srcErrorCode != tssErrorCode) - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" TraceEvent("TSSErrorMismatch") .suppressFor(1.0) .detail("TSSID", tssData.tssId) .detail("SSError", srcErrorCode) .detail("TSSError", tssErrorCode); - #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TssComparisonActorState(); static_cast(this)->destroy(); return 0; } - #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TssComparisonActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -557,38 +557,38 @@ class TssComparisonActorState { } int a_body1cont9(int loopDepth) { - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (tssData.metrics->shouldRecordDetailedMismatch()) - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" TSS_traceMismatch(mismatchEvent, req, src.get(), tss.get().get()); - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - TEST(FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - TEST(!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL); - #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + CODE_PROBE(FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL, "Tracing Full TSS Mismatch"); + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + CODE_PROBE(!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL, "Tracing Partial TSS Mismatch and storing the rest in FDB"); + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL) - #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" mismatchEvent.disable(); - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" UID mismatchUID = deterministicRandom()->randomUniqueID(); - #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" tssData.metrics->recordDetailedMismatchData(mismatchUID, mismatchEvent.getFields().toString()); - #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - TraceEvent summaryEvent((g_network->isSimulated() && g_simulator.tssMode == ISimulator::TSSMode::EnabledDropMutations) ? SevWarnAlways : SevError, TSS_mismatchTraceName(req)); - #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + TraceEvent summaryEvent((g_network->isSimulated() && g_simulator->tssMode == ISimulator::TSSMode::EnabledDropMutations) ? SevWarnAlways : SevError, TSS_mismatchTraceName(req)); + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" summaryEvent.detail("TSSID", tssData.tssId).detail("MismatchId", mismatchUID); - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } else { - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" mismatchEvent.disable(); - #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } loopDepth = a_body1cont8(loopDepth); @@ -596,138 +596,138 @@ class TssComparisonActorState { } int a_body1cont10(Void const& _,int loopDepth) { - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int numError = 0; - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int numMatchSS = 0; - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int numMatchTSS = 0; - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int numMatchNeither = 0; - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" for( Future> f : restOfTeamFutures ) { - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!f.canGet() || f.get().isError()) - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numError++; - #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } else { - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Optional fLB = getLoadBalancedReply(&f.get().get()); - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (fLB.present() && fLB.get().error.present()) - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numError++; - #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } else { - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (TSS_doCompare(src.get(), f.get().get())) - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numMatchSS++; - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } else { - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (TSS_doCompare(tss.get().get(), f.get().get())) - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numMatchTSS++; - #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } else { - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numMatchNeither++; - #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } } } } - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" mismatchEvent.detail("TeamCheckErrors", numError) .detail("TeamCheckMatchSS", numMatchSS) .detail("TeamCheckMatchTSS", numMatchTSS) .detail("TeamCheckMatchNeither", numMatchNeither); - #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = a_body1cont9(loopDepth); return loopDepth; } int a_body1cont10(Void && _,int loopDepth) { - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int numError = 0; - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int numMatchSS = 0; - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int numMatchTSS = 0; - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int numMatchNeither = 0; - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" for( Future> f : restOfTeamFutures ) { - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!f.canGet() || f.get().isError()) - #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numError++; - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } else { - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Optional fLB = getLoadBalancedReply(&f.get().get()); - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (fLB.present() && fLB.get().error.present()) - #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numError++; - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } else { - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (TSS_doCompare(src.get(), f.get().get())) - #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numMatchSS++; - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } else { - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (TSS_doCompare(tss.get().get(), f.get().get())) - #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numMatchTSS++; - #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } else { - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numMatchNeither++; - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } } } } - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" mismatchEvent.detail("TeamCheckErrors", numError) .detail("TeamCheckMatchSS", numMatchSS) .detail("TeamCheckMatchTSS", numMatchTSS) .detail("TeamCheckMatchNeither", numMatchNeither); - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = a_body1cont9(loopDepth); return loopDepth; @@ -795,65 +795,65 @@ class TssComparisonActorState { fdb_probe_actor_exit("tssComparison", reinterpret_cast(this), 2); } - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Req req; - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Future> fSource; - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Future> fTss; - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" TSSEndpointData tssData; - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" uint64_t srcEndpointId; - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Reference> ssTeam; - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - RequestStream Interface::* channel; - #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + RequestStream Interface::* channel; + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" double startTime; - #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Future>> fTssWithTimeout; - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int finished; - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" double srcEndTime; - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" double tssEndTime; - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int srcErrorCode; - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int tssErrorCode; - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ErrorOr src; - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Optional> tss; - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" TraceEvent mismatchEvent; - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" std::vector>> restOfTeamFutures; - #line 834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" }; // This generated class is to be used only via tssComparison() - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -template - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -class TssComparisonActor final : public Actor, public ActorCallback< TssComparisonActor, 0, Void >, public ActorCallback< TssComparisonActor, 1, Void >, public ActorCallback< TssComparisonActor, 2, Void >, public FastAllocated>, public TssComparisonActorState> { - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +template + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +class TssComparisonActor final : public Actor, public ActorCallback< TssComparisonActor, 0, Void >, public ActorCallback< TssComparisonActor, 1, Void >, public ActorCallback< TssComparisonActor, 2, Void >, public FastAllocated>, public TssComparisonActorState> { + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; + using FastAllocated>::operator new; + using FastAllocated>::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< TssComparisonActor, 0, Void >; -friend struct ActorCallback< TssComparisonActor, 1, Void >; -friend struct ActorCallback< TssComparisonActor, 2, Void >; - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - TssComparisonActor(Req const& req,Future> const& fSource,Future> const& fTss,TSSEndpointData const& tssData,uint64_t const& srcEndpointId,Reference> const& ssTeam,RequestStream Interface::* const& channel) - #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" +friend struct ActorCallback< TssComparisonActor, 0, Void >; +friend struct ActorCallback< TssComparisonActor, 1, Void >; +friend struct ActorCallback< TssComparisonActor, 2, Void >; + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + TssComparisonActor(Req const& req,Future> const& fSource,Future> const& fTss,TSSEndpointData const& tssData,uint64_t const& srcEndpointId,Reference> const& ssTeam,RequestStream Interface::* const& channel) + #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" : Actor(), - TssComparisonActorState>(req, fSource, fTss, tssData, srcEndpointId, ssTeam, channel) + TssComparisonActorState>(req, fSource, fTss, tssData, srcEndpointId, ssTeam, channel) { fdb_probe_actor_enter("tssComparison", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -869,29 +869,29 @@ friend struct ActorCallback< TssComparisonActor, 2, auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< TssComparisonActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< TssComparisonActor, 2, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< TssComparisonActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< TssComparisonActor, 2, Void >*)0, actor_cancelled()); break; } } }; } - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -template - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -[[nodiscard]] Future tssComparison( Req const& req, Future> const& fSource, Future> const& fTss, TSSEndpointData const& tssData, uint64_t const& srcEndpointId, Reference> const& ssTeam, RequestStream Interface::* const& channel ) { - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - return Future(new TssComparisonActor(req, fSource, fTss, tssData, srcEndpointId, ssTeam, channel)); - #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +template + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +[[nodiscard]] Future tssComparison( Req const& req, Future> const& fSource, Future> const& fTss, TSSEndpointData const& tssData, uint64_t const& srcEndpointId, Reference> const& ssTeam, RequestStream Interface::* const& channel ) { + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + return Future(new TssComparisonActor(req, fSource, fTss, tssData, srcEndpointId, ssTeam, channel)); + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } -#line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" +#line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" -FDB_DECLARE_BOOLEAN_PARAM(AtMostOnce); -FDB_DECLARE_BOOLEAN_PARAM(TriedAllOptions); +FDB_BOOLEAN_PARAM(AtMostOnce); +FDB_BOOLEAN_PARAM(TriedAllOptions); // Stores state for a request made by the load balancer -template +template struct RequestData : NonCopyable { typedef ErrorOr Reply; @@ -906,21 +906,21 @@ struct RequestData : NonCopyable { // This is true once setupRequest is called, even though at that point the response is Never(). bool isValid() { return response.isValid(); } - static void maybeDuplicateTSSRequest(RequestStream const* stream, + static void maybeDuplicateTSSRequest(RequestStream const* stream, Request& request, QueueModel* model, Future ssResponse, Reference> alternatives, - RequestStream Interface::*channel) { + RequestStream Interface::*channel) { if (model) { // Send parallel request to TSS pair, if it exists Optional tssData = model->getTssData(stream->getEndpoint().token.first()); if (tssData.present()) { - TEST(true); // duplicating request to TSS + CODE_PROBE(true, "duplicating request to TSS"); resetReply(request); // FIXME: optimize to avoid creating new netNotifiedQueue for each message - RequestStream tssRequestStream(tssData.get().endpoint); + RequestStream tssRequestStream(tssData.get().endpoint); Future> fTssResult = tssRequestStream.tryGetReply(request); model->addActor.send(tssComparison(request, ssResponse, @@ -937,23 +937,22 @@ struct RequestData : NonCopyable { void startRequest( double backoff, TriedAllOptions triedAllOptions, - RequestStream const* stream, + RequestStream const* stream, Request& request, QueueModel* model, Reference> alternatives, // alternatives and channel passed through for TSS check - RequestStream Interface::*channel) { + RequestStream Interface::*channel) { modelHolder = Reference(); requestStarted = false; if (backoff > 0) { - response = mapAsync(Void)>, Reply>( - delay(backoff), [this, stream, &request, model, alternatives, channel](Void _) { - requestStarted = true; - modelHolder = Reference(new ModelHolder(model, stream->getEndpoint().token.first())); - Future resp = stream->tryGetReply(request); - maybeDuplicateTSSRequest(stream, request, model, resp, alternatives, channel); - return resp; - }); + response = mapAsync(delay(backoff), [this, stream, &request, model, alternatives, channel](Void _) { + requestStarted = true; + modelHolder = Reference(new ModelHolder(model, stream->getEndpoint().token.first())); + Future resp = stream->tryGetReply(request); + maybeDuplicateTSSRequest(stream, request, model, resp, alternatives, channel); + return resp; + }); } else { requestStarted = true; modelHolder = Reference(new ModelHolder(model, stream->getEndpoint().token.first())); @@ -1087,45 +1086,45 @@ struct RequestData : NonCopyable { // list of servers. // When model is set, load balance among alternatives in the same DC aims to balance request queue length on these // interfaces. If too many interfaces in the same DC are bad, try remote interfaces. - #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" namespace { // This generated class is to be used only via loadBalance() - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -template - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +template + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" class LoadBalanceActorState { - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" public: - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - LoadBalanceActorState(Reference> const& alternatives,RequestStream Interface::* const& channel,Request const& request = Request(),TaskPriority const& taskID = TaskPriority::DefaultPromiseEndpoint,AtMostOnce const& atMostOnce = AtMostOnce::False,QueueModel* const& model = nullptr) - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + LoadBalanceActorState(Reference> const& alternatives,RequestStream Interface::* const& channel,Request const& request = Request(),TaskPriority const& taskID = TaskPriority::DefaultPromiseEndpoint,AtMostOnce const& atMostOnce = AtMostOnce::False,QueueModel* const& model = nullptr) + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" : alternatives(alternatives), - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" channel(channel), - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" request(request), - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" taskID(taskID), - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" atMostOnce(atMostOnce), - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" model(model), - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" firstRequestData(), - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" secondRequestData(), - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" firstRequestEndpoint(), - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" secondDelay(Never()), - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" requestFinished(), - #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" startTime(now()), - #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" triedAllOptions(TriedAllOptions::False) - #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { fdb_probe_actor_create("loadBalance", reinterpret_cast(this)); @@ -1138,218 +1137,218 @@ class LoadBalanceActorState { int a_body1(int loopDepth=0) { try { - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" setReplyPriority(request, taskID); - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!alternatives) - #line 1145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" this->~LoadBalanceActorState(); - #line 1149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" static_cast(this)->sendAndDelPromiseRef(Never()); return 0; } - #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ASSERT(alternatives->size()); - #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" bestAlt = deterministicRandom()->randomInt(0, alternatives->countBest()); - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextAlt = deterministicRandom()->randomInt(0, std::max(alternatives->size() - 1, 1)); - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (nextAlt >= bestAlt) - #line 1161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextAlt++; - #line 1165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (model) - #line 1169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" double bestMetric = 1e9; - #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" double nextMetric = 1e9; - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" double bestTime = 1e9; - #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" double nextTime = 1e9; - #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int badServers = 0; - #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" for(int i = 0;i < alternatives->size();i++) { - #line 485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (badServers < std::min(i, FLOW_KNOBS->LOAD_BALANCE_MAX_BAD_OPTIONS + 1) && i == alternatives->countBest()) - #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { break; } else { - #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (badServers == alternatives->countBest() && i == badServers) - #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" TraceEvent("AllLocalAlternativesFailed") .suppressFor(1.0) .detail("Alternatives", alternatives->description()) .detail("Total", alternatives->size()) .detail("Best", alternatives->countBest()); - #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - RequestStream const* thisStream = &alternatives->get(i, channel); - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + RequestStream const* thisStream = &alternatives->get(i, channel); + #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!IFailureMonitor::failureMonitor().getState(thisStream->getEndpoint()).failed) - #line 1204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" auto const& qd = model->getMeasurement(thisStream->getEndpoint().token.first()); - #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (now() > qd.failedUntil) - #line 1210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" double thisMetric = qd.smoothOutstanding.smoothTotal(); - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" double thisTime = qd.latency; - #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (FLOW_KNOBS->LOAD_BALANCE_PENALTY_IS_BAD && qd.penalty > 1.001) - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ++badServers; - #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (thisMetric < bestMetric) - #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (i != bestAlt) - #line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextAlt = bestAlt; - #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextMetric = bestMetric; - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 515 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextTime = bestTime; - #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" bestAlt = i; - #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" bestMetric = thisMetric; - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" bestTime = thisTime; - #line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } else { - #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (thisMetric < nextMetric) - #line 1252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextAlt = i; - #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextMetric = thisMetric; - #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextTime = thisTime; - #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } } else { - #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ++badServers; - #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } else { - #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ++badServers; - #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (nextMetric > 1e8) - #line 1280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" for(int i = alternatives->countBest();i < alternatives->size();i++) { - #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - RequestStream const* thisStream = &alternatives->get(i, channel); - #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + RequestStream const* thisStream = &alternatives->get(i, channel); + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!IFailureMonitor::failureMonitor().getState(thisStream->getEndpoint()).failed) - #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" auto const& qd = model->getMeasurement(thisStream->getEndpoint().token.first()); - #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (now() > qd.failedUntil) - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" double thisMetric = qd.smoothOutstanding.smoothTotal(); - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" double thisTime = qd.latency; - #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (thisMetric < nextMetric) - #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextAlt = i; - #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextMetric = thisMetric; - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextTime = thisTime; - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } } } } - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (nextTime < 1e9) - #line 1318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (bestTime > FLOW_KNOBS->INSTANT_SECOND_REQUEST_MULTIPLIER * (model->secondMultiplier * (nextTime) + FLOW_KNOBS->BASE_SECOND_REQUEST_TIME)) - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" secondDelay = Void(); - #line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } else { - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" secondDelay = delay(model->secondMultiplier * nextTime + FLOW_KNOBS->BASE_SECOND_REQUEST_TIME); - #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } else { - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" secondDelay = Never(); - #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" startAlt = nextAlt; - #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" startDistance = (bestAlt + alternatives->size() - startAlt) % alternatives->size(); - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numAttempts = 0; - #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" backoff = 0; - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ; - #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1377,200 +1376,192 @@ class LoadBalanceActorState { } int a_body1loopBody1(int loopDepth) { - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (now() - startTime > (g_network->isSimulated() ? 30.0 : 600.0)) - #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" TraceEvent ev(g_network->isSimulated() ? SevWarn : SevWarnAlways, "LoadBalanceTooLong"); - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ev.suppressFor(1.0); - #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ev.detail("Duration", now() - startTime); - #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ev.detail("NumAttempts", numAttempts); - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ev.detail("Backoff", backoff); - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ev.detail("TriedAllOptions", triedAllOptions); - #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (ev.isEnabled()) - #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ev.log(); - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" for(int alternativeNum = 0;alternativeNum < alternatives->size();alternativeNum++) { - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - RequestStream const* thisStream = &alternatives->get(alternativeNum, channel); - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + RequestStream const* thisStream = &alternatives->get(alternativeNum, channel); + #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" TraceEvent(SevWarn, "LoadBalanceTooLongEndpoint") .detail("Addr", thisStream->getEndpoint().getPrimaryAddress()) .detail("Token", thisStream->getEndpoint().token) .detail("Failed", IFailureMonitor::failureMonitor().getState(thisStream->getEndpoint()).failed); - #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } } - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" stream = nullptr; - #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" distance = LBDistance::Type(); - #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" for(int alternativeNum = 0;alternativeNum < alternatives->size();alternativeNum++) { - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int useAlt = nextAlt; - #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (nextAlt == startAlt) - #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" useAlt = bestAlt; - #line 1426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } else { - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if ((nextAlt + alternatives->size() - startAlt) % alternatives->size() <= startDistance) - #line 1432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" useAlt = (nextAlt + alternatives->size() - 1) % alternatives->size(); - #line 1436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" stream = &alternatives->get(useAlt, channel); - #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" distance = alternatives->getDistance(useAlt); - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!IFailureMonitor::failureMonitor().getState(stream->getEndpoint()).failed && (!firstRequestEndpoint.present() || stream->getEndpoint().token.first() != firstRequestEndpoint.get())) - #line 1445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { break; } - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextAlt = (nextAlt + 1) % alternatives->size(); - #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (nextAlt == startAlt) - #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" triedAllOptions = TriedAllOptions::True; - #line 1457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" stream = nullptr; - #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" distance = LBDistance::DISTANT; - #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!stream && !firstRequestData.isValid()) - #line 1467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" std::vector> ok(alternatives->size()); - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" for(int i = 0;i < ok.size();i++) { - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ok[i] = IFailureMonitor::failureMonitor().onStateEqual(alternatives->get(i, channel).getEndpoint(), FailureStatus(false)); - #line 1475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Future okFuture = quorum(ok, 1); - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!alternatives->alwaysFresh()) - #line 1481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (now() - g_network->networkInfo.newestAlternativesFailure > 1 || deterministicRandom()->random01() < 0.01) - #line 1485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" TraceEvent("AllAlternativesFailed").detail("Alternatives", alternatives->description()); - #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" StrictFuture __when_expr_0 = allAlternativesFailedDelay(okFuture); - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = 0; } else { - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" StrictFuture __when_expr_1 = okFuture; - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = 0; } } else { - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!stream) - #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" StrictFuture> __when_expr_2 = firstRequestData.response; - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when3(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = 0; } else { - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (firstRequestData.isValid()) - #line 1540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (distance == LBDistance::DISTANT) - #line 1544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" TraceEvent("LBDistant2nd") .suppressFor(0.1) .detail("Distance", (int)distance) .detail("BackOff", backoff) .detail("TriedAllOptions", triedAllOptions) .detail("Alternatives", alternatives->description()) .detail("Token", stream->getEndpoint().token) .detail("Total", alternatives->size()) .detail("Best", alternatives->countBest()) .detail("Attempts", numAttempts); - #line 1548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" secondRequestData.startRequest(backoff, triedAllOptions, stream, request, model, alternatives, channel); - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ; - #line 1554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = a_body1loopBody1loopHead1(loopDepth); } else { - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - if (distance == LBDistance::DISTANT) - #line 1561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" - { - #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - TraceEvent("LBDistant") .suppressFor(0.1) .detail("Distance", (int)distance) .detail("BackOff", backoff) .detail("TriedAllOptions", triedAllOptions) .detail("Alternatives", alternatives->description()) .detail("Token", stream->getEndpoint().token) .detail("Total", alternatives->size()) .detail("Best", alternatives->countBest()) .detail("Attempts", numAttempts); - #line 1565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" - } - #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" firstRequestData.startRequest(backoff, triedAllOptions, stream, request, model, alternatives, channel); - #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" firstRequestEndpoint = stream->getEndpoint().token.first(); - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ; - #line 1573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = a_body1loopBody1loopHead2(loopDepth); } } @@ -1580,30 +1571,30 @@ class LoadBalanceActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextAlt = (nextAlt + 1) % alternatives->size(); - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (nextAlt == startAlt) - #line 1587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" triedAllOptions = TriedAllOptions::True; - #line 1591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" resetReply(request, taskID); - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" secondDelay = Never(); - #line 1597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont11(int loopDepth) { - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numAttempts = 0; - #line 1606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -1766,42 +1757,42 @@ class LoadBalanceActorState { } int a_body1loopBody1cont17(ErrorOr const& result,int loopDepth) { - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (firstRequestData.checkAndProcessResult(atMostOnce)) - #line 1771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!static_cast(this)->SAV::futures) { (void)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->destroy(); return 0; } - #line 1775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Request) >::value()) REPLY_TYPE(Request)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" firstRequestEndpoint = Optional(); - #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = a_body1loopBody1cont16(loopDepth); return loopDepth; } int a_body1loopBody1cont17(ErrorOr && result,int loopDepth) { - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (firstRequestData.checkAndProcessResult(atMostOnce)) - #line 1792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!static_cast(this)->SAV::futures) { (void)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->destroy(); return 0; } - #line 1796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Request) >::value()) REPLY_TYPE(Request)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" firstRequestEndpoint = Optional(); - #line 1804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = a_body1loopBody1cont16(loopDepth); return loopDepth; @@ -1877,13 +1868,13 @@ class LoadBalanceActorState { } int a_body1loopBody1cont19(int loopDepth) { - #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (++numAttempts >= alternatives->size()) - #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" backoff = std::min( FLOW_KNOBS->LOAD_BALANCE_MAX_BACKOFF, std::max(FLOW_KNOBS->LOAD_BALANCE_START_BACKOFF, backoff * FLOW_KNOBS->LOAD_BALANCE_BACKOFF_RATE)); - #line 1886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } loopDepth = a_body1loopBody1cont18(loopDepth); @@ -1898,22 +1889,22 @@ class LoadBalanceActorState { } int a_body1loopBody1loopBody1(int loopDepth) { - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" StrictFuture> __when_expr_3 = firstRequestData.response.isValid() ? firstRequestData.response : Never(); - #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 1905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1loopBody1when1(__when_expr_3.get(), loopDepth); }; - #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" StrictFuture> __when_expr_4 = secondRequestData.response; - #line 1909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1loopBody1when2(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" __when_expr_3.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" __when_expr_4.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = 0; return loopDepth; @@ -1939,55 +1930,55 @@ class LoadBalanceActorState { } int a_body1loopBody1loopBody1when1(ErrorOr const& result,int loopDepth) { - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (firstRequestData.checkAndProcessResult(atMostOnce)) - #line 1944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!static_cast(this)->SAV::futures) { (void)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->destroy(); return 0; } - #line 1948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Request) >::value()) REPLY_TYPE(Request)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" firstRequestEndpoint = Optional(); - #line 1956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = a_body1loopBody1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1loopBody1when1(ErrorOr && result,int loopDepth) { - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (firstRequestData.checkAndProcessResult(atMostOnce)) - #line 1965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!static_cast(this)->SAV::futures) { (void)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->destroy(); return 0; } - #line 1969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Request) >::value()) REPLY_TYPE(Request)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" firstRequestEndpoint = Optional(); - #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = a_body1loopBody1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1loopBody1when2(ErrorOr const& result,int loopDepth) { - #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (secondRequestData.checkAndProcessResult(atMostOnce)) - #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!static_cast(this)->SAV::futures) { (void)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->destroy(); return 0; } - #line 1990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Request) >::value()) REPLY_TYPE(Request)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1999,13 +1990,13 @@ class LoadBalanceActorState { } int a_body1loopBody1loopBody1when2(ErrorOr && result,int loopDepth) { - #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (secondRequestData.checkAndProcessResult(atMostOnce)) - #line 2004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!static_cast(this)->SAV::futures) { (void)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->destroy(); return 0; } - #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 1999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Request) >::value()) REPLY_TYPE(Request)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2114,13 +2105,13 @@ class LoadBalanceActorState { } int a_body1loopBody1cont21(int loopDepth) { - #line 734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (++numAttempts >= alternatives->size()) - #line 2119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" backoff = std::min( FLOW_KNOBS->LOAD_BALANCE_MAX_BACKOFF, std::max(FLOW_KNOBS->LOAD_BALANCE_START_BACKOFF, backoff * FLOW_KNOBS->LOAD_BALANCE_BACKOFF_RATE)); - #line 2123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } loopDepth = a_body1loopBody1cont18(loopDepth); @@ -2135,22 +2126,22 @@ class LoadBalanceActorState { } int a_body1loopBody1loopBody2(int loopDepth) { - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" StrictFuture> __when_expr_5 = firstRequestData.response; - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 2142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1loopBody2when1(__when_expr_5.get(), loopDepth); }; - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" StrictFuture __when_expr_6 = secondDelay; - #line 2146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1loopBody2when2(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" __when_expr_5.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = 0; return loopDepth; @@ -2176,79 +2167,79 @@ class LoadBalanceActorState { } int a_body1loopBody1loopBody2when1(ErrorOr const& result,int loopDepth) { - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (model) - #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" model->secondMultiplier = std::max(model->secondMultiplier - FLOW_KNOBS->SECOND_REQUEST_MULTIPLIER_DECAY, 1.0); - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" model->secondBudget = std::min(model->secondBudget + FLOW_KNOBS->SECOND_REQUEST_BUDGET_GROWTH, FLOW_KNOBS->SECOND_REQUEST_MAX_BUDGET); - #line 2187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (firstRequestData.checkAndProcessResult(atMostOnce)) - #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!static_cast(this)->SAV::futures) { (void)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->destroy(); return 0; } - #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Request) >::value()) REPLY_TYPE(Request)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" firstRequestEndpoint = Optional(); - #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" return a_body1loopBody1break2(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1loopBody1loopBody2when1(ErrorOr && result,int loopDepth) { - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (model) - #line 2212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" model->secondMultiplier = std::max(model->secondMultiplier - FLOW_KNOBS->SECOND_REQUEST_MULTIPLIER_DECAY, 1.0); - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" model->secondBudget = std::min(model->secondBudget + FLOW_KNOBS->SECOND_REQUEST_BUDGET_GROWTH, FLOW_KNOBS->SECOND_REQUEST_MAX_BUDGET); - #line 2218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (firstRequestData.checkAndProcessResult(atMostOnce)) - #line 2222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!static_cast(this)->SAV::futures) { (void)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->destroy(); return 0; } - #line 2226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Request) >::value()) REPLY_TYPE(Request)(result.get()); this->~LoadBalanceActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" firstRequestEndpoint = Optional(); - #line 2234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" return a_body1loopBody1break2(loopDepth==0?0:loopDepth-1); // break return loopDepth; } int a_body1loopBody1loopBody2when2(Void const& _,int loopDepth) { - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" secondDelay = Never(); - #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (model && model->secondBudget >= 1.0) - #line 2245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" model->secondMultiplier += FLOW_KNOBS->SECOND_REQUEST_MULTIPLIER_GROWTH; - #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" model->secondBudget -= 1.0; - #line 2251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" return a_body1loopBody1break2(loopDepth==0?0:loopDepth-1); // break } loopDepth = a_body1loopBody1loopBody2cont1(loopDepth); @@ -2257,17 +2248,17 @@ class LoadBalanceActorState { } int a_body1loopBody1loopBody2when2(Void && _,int loopDepth) { - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" secondDelay = Never(); - #line 725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (model && model->secondBudget >= 1.0) - #line 2264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" model->secondMultiplier += FLOW_KNOBS->SECOND_REQUEST_MULTIPLIER_GROWTH; - #line 727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" model->secondBudget -= 1.0; - #line 2270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" return a_body1loopBody1break2(loopDepth==0?0:loopDepth-1); // break } loopDepth = a_body1loopBody1loopBody2cont1(loopDepth); @@ -2371,75 +2362,75 @@ class LoadBalanceActorState { fdb_probe_actor_exit("loadBalance", reinterpret_cast(this), 6); } - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Reference> alternatives; - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - RequestStream Interface::* channel; - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + RequestStream Interface::* channel; + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Request request; - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" TaskPriority taskID; - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" AtMostOnce atMostOnce; - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" QueueModel* model; - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - RequestData firstRequestData; - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - RequestData secondRequestData; - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + RequestData firstRequestData; + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + RequestData secondRequestData; + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Optional firstRequestEndpoint; - #line 457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Future secondDelay; - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Promise requestFinished; - #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" double startTime; - #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" TriedAllOptions triedAllOptions; - #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int bestAlt; - #line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int nextAlt; - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int startAlt; - #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int startDistance; - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int numAttempts; - #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" double backoff; - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - RequestStream const* stream; - #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + RequestStream const* stream; + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" LBDistance::Type distance; - #line 2416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" }; // This generated class is to be used only via loadBalance() - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -template - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -class LoadBalanceActor final : public Actor, public ActorCallback< LoadBalanceActor, 0, Void >, public ActorCallback< LoadBalanceActor, 1, Void >, public ActorCallback< LoadBalanceActor, 2, ErrorOr >, public ActorCallback< LoadBalanceActor, 3, ErrorOr >, public ActorCallback< LoadBalanceActor, 4, ErrorOr >, public ActorCallback< LoadBalanceActor, 5, ErrorOr >, public ActorCallback< LoadBalanceActor, 6, Void >, public FastAllocated>, public LoadBalanceActorState> { - #line 2423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +template + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +class LoadBalanceActor final : public Actor, public ActorCallback< LoadBalanceActor, 0, Void >, public ActorCallback< LoadBalanceActor, 1, Void >, public ActorCallback< LoadBalanceActor, 2, ErrorOr >, public ActorCallback< LoadBalanceActor, 3, ErrorOr >, public ActorCallback< LoadBalanceActor, 4, ErrorOr >, public ActorCallback< LoadBalanceActor, 5, ErrorOr >, public ActorCallback< LoadBalanceActor, 6, Void >, public FastAllocated>, public LoadBalanceActorState> { + #line 2414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; + using FastAllocated>::operator new; + using FastAllocated>::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< LoadBalanceActor, 0, Void >; -friend struct ActorCallback< LoadBalanceActor, 1, Void >; -friend struct ActorCallback< LoadBalanceActor, 2, ErrorOr >; -friend struct ActorCallback< LoadBalanceActor, 3, ErrorOr >; -friend struct ActorCallback< LoadBalanceActor, 4, ErrorOr >; -friend struct ActorCallback< LoadBalanceActor, 5, ErrorOr >; -friend struct ActorCallback< LoadBalanceActor, 6, Void >; - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - LoadBalanceActor(Reference> const& alternatives,RequestStream Interface::* const& channel,Request const& request = Request(),TaskPriority const& taskID = TaskPriority::DefaultPromiseEndpoint,AtMostOnce const& atMostOnce = AtMostOnce::False,QueueModel* const& model = nullptr) - #line 2440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" +friend struct ActorCallback< LoadBalanceActor, 0, Void >; +friend struct ActorCallback< LoadBalanceActor, 1, Void >; +friend struct ActorCallback< LoadBalanceActor, 2, ErrorOr >; +friend struct ActorCallback< LoadBalanceActor, 3, ErrorOr >; +friend struct ActorCallback< LoadBalanceActor, 4, ErrorOr >; +friend struct ActorCallback< LoadBalanceActor, 5, ErrorOr >; +friend struct ActorCallback< LoadBalanceActor, 6, Void >; + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + LoadBalanceActor(Reference> const& alternatives,RequestStream Interface::* const& channel,Request const& request = Request(),TaskPriority const& taskID = TaskPriority::DefaultPromiseEndpoint,AtMostOnce const& atMostOnce = AtMostOnce::False,QueueModel* const& model = nullptr) + #line 2431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" : Actor(), - LoadBalanceActorState>(alternatives, channel, request, taskID, atMostOnce, model) + LoadBalanceActorState>(alternatives, channel, request, taskID, atMostOnce, model) { fdb_probe_actor_enter("loadBalance", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -2455,26 +2446,26 @@ friend struct ActorCallback< LoadBalanceActor, 6, Voi auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< LoadBalanceActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< LoadBalanceActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< LoadBalanceActor, 2, ErrorOr >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< LoadBalanceActor, 3, ErrorOr >*)0, actor_cancelled()); break; - case 5: this->a_callback_error((ActorCallback< LoadBalanceActor, 5, ErrorOr >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< LoadBalanceActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< LoadBalanceActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< LoadBalanceActor, 2, ErrorOr >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< LoadBalanceActor, 3, ErrorOr >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< LoadBalanceActor, 5, ErrorOr >*)0, actor_cancelled()); break; } } }; } - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -template - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -[[nodiscard]] Future loadBalance( Reference> const& alternatives, RequestStream Interface::* const& channel, Request const& request = Request(), TaskPriority const& taskID = TaskPriority::DefaultPromiseEndpoint, AtMostOnce const& atMostOnce = AtMostOnce::False, QueueModel* const& model = nullptr ) { - #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - return Future(new LoadBalanceActor(alternatives, channel, request, taskID, atMostOnce, model)); - #line 2474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +template + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +[[nodiscard]] Future loadBalance( Reference> const& alternatives, RequestStream Interface::* const& channel, Request const& request = Request(), TaskPriority const& taskID = TaskPriority::DefaultPromiseEndpoint, AtMostOnce const& atMostOnce = AtMostOnce::False, QueueModel* const& model = nullptr ) { + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + return Future(new LoadBalanceActor(alternatives, channel, request, taskID, atMostOnce, model)); + #line 2465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } -#line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" +#line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" // Subclasses must initialize all members in their default constructors // Subclasses must serialize all members @@ -2487,29 +2478,35 @@ Optional getBasicLoadBalancedReply(const BasicLoadBalanc Optional getBasicLoadBalancedReply(const void*); // A simpler version of LoadBalance that does not send second requests where the list of servers are always fresh - #line 2490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" +// +// If |alternativeChosen| is not null, then atMostOnce must be True, and if the returned future completes successfully +// then *alternativeChosen will be the alternative to which the message was sent. *alternativeChosen must outlive the +// returned future. + #line 2485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" namespace { // This generated class is to be used only via basicLoadBalance() - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -template - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +template + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" class BasicLoadBalanceActorState { - #line 2497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" public: - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - BasicLoadBalanceActorState(Reference> const& alternatives,RequestStream Interface::* const& channel,Request const& request = Request(),TaskPriority const& taskID = TaskPriority::DefaultPromiseEndpoint,AtMostOnce const& atMostOnce = AtMostOnce::False) - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + BasicLoadBalanceActorState(Reference> const& alternatives,RequestStream Interface::* const& channel,Request const& request = Request(),TaskPriority const& taskID = TaskPriority::DefaultPromiseEndpoint,AtMostOnce const& atMostOnce = AtMostOnce::False,int* const& alternativeChosen = nullptr) + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" : alternatives(alternatives), - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" channel(channel), - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" request(request), - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" taskID(taskID), - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - atMostOnce(atMostOnce) - #line 2512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + atMostOnce(atMostOnce), + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + alternativeChosen(alternativeChosen) + #line 2509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { fdb_probe_actor_create("basicLoadBalance", reinterpret_cast(this)); @@ -2522,45 +2519,47 @@ class BasicLoadBalanceActorState { int a_body1(int loopDepth=0) { try { - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + ASSERT(alternativeChosen == nullptr || atMostOnce == AtMostOnce::True); + #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" setReplyPriority(request, taskID); - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!alternatives) - #line 2529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" this->~BasicLoadBalanceActorState(); - #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" static_cast(this)->sendAndDelPromiseRef(Never()); return 0; } - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ASSERT(alternatives->size() && alternatives->alwaysFresh()); - #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" bestAlt = alternatives->getBest(); - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextAlt = deterministicRandom()->randomInt(0, std::max(alternatives->size() - 1, 1)); - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (nextAlt >= bestAlt) - #line 2545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextAlt++; - #line 2549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" startAlt = nextAlt; - #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" startDistance = (bestAlt + alternatives->size() - startAlt) % alternatives->size(); - #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numAttempts = 0; - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" backoff = 0; - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" useAlt = int(); - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ; - #line 2563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2588,90 +2587,98 @@ class BasicLoadBalanceActorState { } int a_body1loopBody1(int loopDepth) { - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" stream = nullptr; - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" for(int alternativeNum = 0;alternativeNum < alternatives->size();alternativeNum++) { - #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" useAlt = nextAlt; - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (nextAlt == startAlt) - #line 2599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" useAlt = bestAlt; - #line 2603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } else { - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if ((nextAlt + alternatives->size() - startAlt) % alternatives->size() <= startDistance) - #line 2609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" useAlt = (nextAlt + alternatives->size() - 1) % alternatives->size(); - #line 2613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } } - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" stream = &alternatives->get(useAlt, channel); - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + if (alternativeChosen != nullptr) + #line 2619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" + { + #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + *alternativeChosen = useAlt; + #line 2623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" + } + #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!IFailureMonitor::failureMonitor().getState(stream->getEndpoint()).failed) - #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { break; } - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextAlt = (nextAlt + 1) % alternatives->size(); - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" stream = nullptr; - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!stream) - #line 2632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" std::vector> ok(alternatives->size()); - #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" for(int i = 0;i < ok.size();i++) { - #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" ok[i] = IFailureMonitor::failureMonitor().onStateEqual(alternatives->get(i, channel).getEndpoint(), FailureStatus(false)); - #line 2640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" StrictFuture __when_expr_0 = quorum(ok, 1); - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2646 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = 0; } else { - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (backoff > 0.0) - #line 2658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" StrictFuture __when_expr_1 = delay(backoff); - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = 0; } else { - loopDepth = a_body1loopBody1cont10(loopDepth); + loopDepth = a_body1loopBody1cont11(loopDepth); } } @@ -2679,42 +2686,42 @@ class BasicLoadBalanceActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" nextAlt = (nextAlt + 1) % alternatives->size(); - #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" resetReply(request, taskID); - #line 2686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1loopBody1cont7(Void const& _,int loopDepth) + int a_body1loopBody1cont8(Void const& _,int loopDepth) { - #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numAttempts = 0; - #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont7(Void && _,int loopDepth) + int a_body1loopBody1cont8(Void && _,int loopDepth) { - #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" numAttempts = 0; - #line 2704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont7(_, loopDepth); + loopDepth = a_body1loopBody1cont8(_, loopDepth); return loopDepth; } int a_body1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont7(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont8(std::move(_), loopDepth); return loopDepth; } @@ -2769,43 +2776,43 @@ class BasicLoadBalanceActorState { fdb_probe_actor_exit("basicLoadBalance", reinterpret_cast(this), 0); } - int a_body1loopBody1cont10(int loopDepth) + int a_body1loopBody1cont11(int loopDepth) { - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" StrictFuture> __when_expr_2 = stream->tryGetReply(request); - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont10when1(__when_expr_2.get(), loopDepth); }; + #line 2785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont11when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" __when_expr_2.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" loopDepth = 0; return loopDepth; } - int a_body1loopBody1cont11(Void const& _,int loopDepth) + int a_body1loopBody1cont12(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont10(loopDepth); + loopDepth = a_body1loopBody1cont11(loopDepth); return loopDepth; } - int a_body1loopBody1cont11(Void && _,int loopDepth) + int a_body1loopBody1cont12(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont10(loopDepth); + loopDepth = a_body1loopBody1cont11(loopDepth); return loopDepth; } int a_body1loopBody1when2(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont11(_, loopDepth); + loopDepth = a_body1loopBody1cont12(_, loopDepth); return loopDepth; } int a_body1loopBody1when2(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont11(std::move(_), loopDepth); + loopDepth = a_body1loopBody1cont12(std::move(_), loopDepth); return loopDepth; } @@ -2860,119 +2867,119 @@ class BasicLoadBalanceActorState { fdb_probe_actor_exit("basicLoadBalance", reinterpret_cast(this), 1); } - int a_body1loopBody1cont10cont1(ErrorOr const& result,int loopDepth) + int a_body1loopBody1cont11cont1(ErrorOr const& result,int loopDepth) { - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (result.present()) - #line 2867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Optional loadBalancedReply = getBasicLoadBalancedReply(&result.get()); - #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (loadBalancedReply.present()) - #line 2873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" alternatives->updateRecent(useAlt, loadBalancedReply.get().processBusyTime); - #line 2877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!static_cast(this)->SAV::futures) { (void)(result.get()); this->~BasicLoadBalanceActorState(); static_cast(this)->destroy(); return 0; } - #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Request) >::value()) REPLY_TYPE(Request)(result.get()); this->~BasicLoadBalanceActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (result.getError().code() != error_code_broken_promise && result.getError().code() != error_code_request_maybe_delivered) - #line 2889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" return a_body1Catch1(result.getError(), std::max(0, loopDepth - 1)); - #line 2893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (atMostOnce) - #line 2897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" return a_body1Catch1(request_maybe_delivered(), std::max(0, loopDepth - 1)); - #line 2901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (++numAttempts >= alternatives->size()) - #line 2905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" backoff = std::min( FLOW_KNOBS->LOAD_BALANCE_MAX_BACKOFF, std::max(FLOW_KNOBS->LOAD_BALANCE_START_BACKOFF, backoff * FLOW_KNOBS->LOAD_BALANCE_BACKOFF_RATE)); - #line 2909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont10cont1(ErrorOr && result,int loopDepth) + int a_body1loopBody1cont11cont1(ErrorOr && result,int loopDepth) { - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (result.present()) - #line 2919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Optional loadBalancedReply = getBasicLoadBalancedReply(&result.get()); - #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (loadBalancedReply.present()) - #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" alternatives->updateRecent(useAlt, loadBalancedReply.get().processBusyTime); - #line 2929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (!static_cast(this)->SAV::futures) { (void)(result.get()); this->~BasicLoadBalanceActorState(); static_cast(this)->destroy(); return 0; } - #line 2933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Request) >::value()) REPLY_TYPE(Request)(result.get()); this->~BasicLoadBalanceActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (result.getError().code() != error_code_broken_promise && result.getError().code() != error_code_request_maybe_delivered) - #line 2941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" return a_body1Catch1(result.getError(), std::max(0, loopDepth - 1)); - #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (atMostOnce) - #line 2949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" return a_body1Catch1(request_maybe_delivered(), std::max(0, loopDepth - 1)); - #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } - #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" if (++numAttempts >= alternatives->size()) - #line 2957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" { - #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" backoff = std::min( FLOW_KNOBS->LOAD_BALANCE_MAX_BACKOFF, std::max(FLOW_KNOBS->LOAD_BALANCE_START_BACKOFF, backoff * FLOW_KNOBS->LOAD_BALANCE_BACKOFF_RATE)); - #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 2968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont10when1(ErrorOr const& result,int loopDepth) + int a_body1loopBody1cont11when1(ErrorOr const& result,int loopDepth) { - loopDepth = a_body1loopBody1cont10cont1(result, loopDepth); + loopDepth = a_body1loopBody1cont11cont1(result, loopDepth); return loopDepth; } - int a_body1loopBody1cont10when1(ErrorOr && result,int loopDepth) + int a_body1loopBody1cont11when1(ErrorOr && result,int loopDepth) { - loopDepth = a_body1loopBody1cont10cont1(std::move(result), loopDepth); + loopDepth = a_body1loopBody1cont11cont1(std::move(result), loopDepth); return loopDepth; } @@ -2987,7 +2994,7 @@ class BasicLoadBalanceActorState { fdb_probe_actor_enter("basicLoadBalance", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont10when1(value, 0); + a_body1loopBody1cont11when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -3002,7 +3009,7 @@ class BasicLoadBalanceActorState { fdb_probe_actor_enter("basicLoadBalance", reinterpret_cast(this), 2); a_exitChoose3(); try { - a_body1loopBody1cont10when1(std::move(value), 0); + a_body1loopBody1cont11when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); @@ -3027,55 +3034,57 @@ class BasicLoadBalanceActorState { fdb_probe_actor_exit("basicLoadBalance", reinterpret_cast(this), 2); } - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Reference> alternatives; - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - RequestStream Interface::* channel; - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + RequestStream Interface::* channel; + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" Request request; - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" TaskPriority taskID; - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" AtMostOnce atMostOnce; - #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + int* alternativeChosen; + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int bestAlt; - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int nextAlt; - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int startAlt; - #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int startDistance; - #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int numAttempts; - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" double backoff; - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" + #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" int useAlt; - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - RequestStream const* stream; - #line 3056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + RequestStream const* stream; + #line 3065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" }; // This generated class is to be used only via basicLoadBalance() - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -template - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -class BasicLoadBalanceActor final : public Actor, public ActorCallback< BasicLoadBalanceActor, 0, Void >, public ActorCallback< BasicLoadBalanceActor, 1, Void >, public ActorCallback< BasicLoadBalanceActor, 2, ErrorOr >, public FastAllocated>, public BasicLoadBalanceActorState> { - #line 3063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +template + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +class BasicLoadBalanceActor final : public Actor, public ActorCallback< BasicLoadBalanceActor, 0, Void >, public ActorCallback< BasicLoadBalanceActor, 1, Void >, public ActorCallback< BasicLoadBalanceActor, 2, ErrorOr >, public FastAllocated>, public BasicLoadBalanceActorState> { + #line 3072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; + using FastAllocated>::operator new; + using FastAllocated>::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< BasicLoadBalanceActor, 0, Void >; -friend struct ActorCallback< BasicLoadBalanceActor, 1, Void >; -friend struct ActorCallback< BasicLoadBalanceActor, 2, ErrorOr >; - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - BasicLoadBalanceActor(Reference> const& alternatives,RequestStream Interface::* const& channel,Request const& request = Request(),TaskPriority const& taskID = TaskPriority::DefaultPromiseEndpoint,AtMostOnce const& atMostOnce = AtMostOnce::False) - #line 3076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" +friend struct ActorCallback< BasicLoadBalanceActor, 0, Void >; +friend struct ActorCallback< BasicLoadBalanceActor, 1, Void >; +friend struct ActorCallback< BasicLoadBalanceActor, 2, ErrorOr >; + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + BasicLoadBalanceActor(Reference> const& alternatives,RequestStream Interface::* const& channel,Request const& request = Request(),TaskPriority const& taskID = TaskPriority::DefaultPromiseEndpoint,AtMostOnce const& atMostOnce = AtMostOnce::False,int* const& alternativeChosen = nullptr) + #line 3085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" : Actor(), - BasicLoadBalanceActorState>(alternatives, channel, request, taskID, atMostOnce) + BasicLoadBalanceActorState>(alternatives, channel, request, taskID, atMostOnce, alternativeChosen) { fdb_probe_actor_enter("basicLoadBalance", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -3091,24 +3100,24 @@ friend struct ActorCallback< BasicLoadBalanceActor, 2 auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< BasicLoadBalanceActor, 0, Void >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< BasicLoadBalanceActor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< BasicLoadBalanceActor, 2, ErrorOr >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< BasicLoadBalanceActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< BasicLoadBalanceActor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< BasicLoadBalanceActor, 2, ErrorOr >*)0, actor_cancelled()); break; } } }; } - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -template - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" -[[nodiscard]] Future basicLoadBalance( Reference> const& alternatives, RequestStream Interface::* const& channel, Request const& request = Request(), TaskPriority const& taskID = TaskPriority::DefaultPromiseEndpoint, AtMostOnce const& atMostOnce = AtMostOnce::False ) { - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" - return Future(new BasicLoadBalanceActor(alternatives, channel, request, taskID, atMostOnce)); - #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.g.h" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +template + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" +[[nodiscard]] Future basicLoadBalance( Reference> const& alternatives, RequestStream Interface::* const& channel, Request const& request = Request(), TaskPriority const& taskID = TaskPriority::DefaultPromiseEndpoint, AtMostOnce const& atMostOnce = AtMostOnce::False, int* const& alternativeChosen = nullptr ) { + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" + return Future(new BasicLoadBalanceActor(alternatives, channel, request, taskID, atMostOnce, alternativeChosen)); + #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.g.h" } -#line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/LoadBalance.actor.h" +#line 843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h" #include "flow/unactorcompiler.h" diff --git a/src/fdbrpc/LoadBalance.actor.h b/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h similarity index 91% rename from src/fdbrpc/LoadBalance.actor.h rename to src/fdbrpc/include/fdbrpc/LoadBalance.actor.h index 4d0aad7..2ee3d2e 100644 --- a/src/fdbrpc/LoadBalance.actor.h +++ b/src/fdbrpc/include/fdbrpc/LoadBalance.actor.h @@ -78,14 +78,14 @@ struct LoadBalancedReply { Optional getLoadBalancedReply(const LoadBalancedReply* reply); Optional getLoadBalancedReply(const void*); -ACTOR template +ACTOR template Future tssComparison(Req req, Future> fSource, Future> fTss, TSSEndpointData tssData, uint64_t srcEndpointId, Reference> ssTeam, - RequestStream Interface::*channel) { + RequestStream Interface::*channel) { state double startTime = now(); state Future>> fTssWithTimeout = timeout(fTss, FLOW_KNOBS->LOAD_BALANCE_TSS_TIMEOUT); state int finished = 0; @@ -142,9 +142,9 @@ Future tssComparison(Req req, tssData.metrics->recordLatency(req, srcEndTime - startTime, tssEndTime - startTime); if (!TSS_doCompare(src.get(), tss.get().get())) { - TEST(true); // TSS Mismatch + CODE_PROBE(true, "TSS Mismatch"); state TraceEvent mismatchEvent( - (g_network->isSimulated() && g_simulator.tssMode == ISimulator::TSSMode::EnabledDropMutations) + (g_network->isSimulated() && g_simulator->tssMode == ISimulator::TSSMode::EnabledDropMutations) ? SevWarnAlways : SevError, TSS_mismatchTraceName(req)); @@ -152,14 +152,14 @@ Future tssComparison(Req req, mismatchEvent.detail("TSSID", tssData.tssId); if (FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_VERIFY_SS && ssTeam->size() > 1) { - TEST(true); // checking TSS mismatch against rest of storage team + CODE_PROBE(true, "checking TSS mismatch against rest of storage team"); // if there is more than 1 SS in the team, attempt to verify that the other SS servers have the same // data state std::vector>> restOfTeamFutures; restOfTeamFutures.reserve(ssTeam->size() - 1); for (int i = 0; i < ssTeam->size(); i++) { - RequestStream const* si = &ssTeam->get(i, channel); + RequestStream const* si = &ssTeam->get(i, channel); if (si->getEndpoint().token.first() != srcEndpointId) { // don't re-request to SS we already have a response from resetReply(req); @@ -197,9 +197,9 @@ Future tssComparison(Req req, if (tssData.metrics->shouldRecordDetailedMismatch()) { TSS_traceMismatch(mismatchEvent, req, src.get(), tss.get().get()); - TEST(FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL); // Tracing Full TSS Mismatch - TEST(!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL); // Tracing Partial TSS Mismatch and storing - // the rest in FDB + CODE_PROBE(FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL, "Tracing Full TSS Mismatch"); + CODE_PROBE(!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL, + "Tracing Partial TSS Mismatch and storing the rest in FDB"); if (!FLOW_KNOBS->LOAD_BALANCE_TSS_MISMATCH_TRACE_FULL) { mismatchEvent.disable(); @@ -208,7 +208,7 @@ Future tssComparison(Req req, // record a summarized trace event instead TraceEvent summaryEvent((g_network->isSimulated() && - g_simulator.tssMode == ISimulator::TSSMode::EnabledDropMutations) + g_simulator->tssMode == ISimulator::TSSMode::EnabledDropMutations) ? SevWarnAlways : SevError, TSS_mismatchTraceName(req)); @@ -240,11 +240,11 @@ Future tssComparison(Req req, return Void(); } -FDB_DECLARE_BOOLEAN_PARAM(AtMostOnce); -FDB_DECLARE_BOOLEAN_PARAM(TriedAllOptions); +FDB_BOOLEAN_PARAM(AtMostOnce); +FDB_BOOLEAN_PARAM(TriedAllOptions); // Stores state for a request made by the load balancer -template +template struct RequestData : NonCopyable { typedef ErrorOr Reply; @@ -259,21 +259,21 @@ struct RequestData : NonCopyable { // This is true once setupRequest is called, even though at that point the response is Never(). bool isValid() { return response.isValid(); } - static void maybeDuplicateTSSRequest(RequestStream const* stream, + static void maybeDuplicateTSSRequest(RequestStream const* stream, Request& request, QueueModel* model, Future ssResponse, Reference> alternatives, - RequestStream Interface::*channel) { + RequestStream Interface::*channel) { if (model) { // Send parallel request to TSS pair, if it exists Optional tssData = model->getTssData(stream->getEndpoint().token.first()); if (tssData.present()) { - TEST(true); // duplicating request to TSS + CODE_PROBE(true, "duplicating request to TSS"); resetReply(request); // FIXME: optimize to avoid creating new netNotifiedQueue for each message - RequestStream tssRequestStream(tssData.get().endpoint); + RequestStream tssRequestStream(tssData.get().endpoint); Future> fTssResult = tssRequestStream.tryGetReply(request); model->addActor.send(tssComparison(request, ssResponse, @@ -290,23 +290,22 @@ struct RequestData : NonCopyable { void startRequest( double backoff, TriedAllOptions triedAllOptions, - RequestStream const* stream, + RequestStream const* stream, Request& request, QueueModel* model, Reference> alternatives, // alternatives and channel passed through for TSS check - RequestStream Interface::*channel) { + RequestStream Interface::*channel) { modelHolder = Reference(); requestStarted = false; if (backoff > 0) { - response = mapAsync(Void)>, Reply>( - delay(backoff), [this, stream, &request, model, alternatives, channel](Void _) { - requestStarted = true; - modelHolder = Reference(new ModelHolder(model, stream->getEndpoint().token.first())); - Future resp = stream->tryGetReply(request); - maybeDuplicateTSSRequest(stream, request, model, resp, alternatives, channel); - return resp; - }); + response = mapAsync(delay(backoff), [this, stream, &request, model, alternatives, channel](Void _) { + requestStarted = true; + modelHolder = Reference(new ModelHolder(model, stream->getEndpoint().token.first())); + Future resp = stream->tryGetReply(request); + maybeDuplicateTSSRequest(stream, request, model, resp, alternatives, channel); + return resp; + }); } else { requestStarted = true; modelHolder = Reference(new ModelHolder(model, stream->getEndpoint().token.first())); @@ -440,18 +439,18 @@ struct RequestData : NonCopyable { // list of servers. // When model is set, load balance among alternatives in the same DC aims to balance request queue length on these // interfaces. If too many interfaces in the same DC are bad, try remote interfaces. -ACTOR template +ACTOR template Future loadBalance( Reference> alternatives, - RequestStream Interface::*channel, + RequestStream Interface::*channel, Request request = Request(), TaskPriority taskID = TaskPriority::DefaultPromiseEndpoint, AtMostOnce atMostOnce = AtMostOnce::False, // if true, throws request_maybe_delivered() instead of retrying automatically QueueModel* model = nullptr) { - state RequestData firstRequestData; - state RequestData secondRequestData; + state RequestData firstRequestData; + state RequestData secondRequestData; state Optional firstRequestEndpoint; state Future secondDelay = Never(); @@ -496,7 +495,7 @@ Future loadBalance( .detail("Best", alternatives->countBest()); } - RequestStream const* thisStream = &alternatives->get(i, channel); + RequestStream const* thisStream = &alternatives->get(i, channel); if (!IFailureMonitor::failureMonitor().getState(thisStream->getEndpoint()).failed) { auto const& qd = model->getMeasurement(thisStream->getEndpoint().token.first()); if (now() > qd.failedUntil) { @@ -535,7 +534,7 @@ Future loadBalance( // go through all the remote servers again, since we may have // skipped it. for (int i = alternatives->countBest(); i < alternatives->size(); i++) { - RequestStream const* thisStream = &alternatives->get(i, channel); + RequestStream const* thisStream = &alternatives->get(i, channel); if (!IFailureMonitor::failureMonitor().getState(thisStream->getEndpoint()).failed) { auto const& qd = model->getMeasurement(thisStream->getEndpoint().token.first()); if (now() > qd.failedUntil) { @@ -582,7 +581,7 @@ Future loadBalance( if (ev.isEnabled()) { ev.log(); for (int alternativeNum = 0; alternativeNum < alternatives->size(); alternativeNum++) { - RequestStream const* thisStream = &alternatives->get(alternativeNum, channel); + RequestStream const* thisStream = &alternatives->get(alternativeNum, channel); TraceEvent(SevWarn, "LoadBalanceTooLongEndpoint") .detail("Addr", thisStream->getEndpoint().getPrimaryAddress()) .detail("Token", thisStream->getEndpoint().token) @@ -594,7 +593,7 @@ Future loadBalance( // Find an alternative, if any, that is not failed, starting with // nextAlt. This logic matters only if model == nullptr. Otherwise, the // bestAlt and nextAlt have been decided. - state RequestStream const* stream = nullptr; + state RequestStream const* stream = nullptr; state LBDistance::Type distance; for (int alternativeNum = 0; alternativeNum < alternatives->size(); alternativeNum++) { int useAlt = nextAlt; @@ -687,18 +686,6 @@ Future loadBalance( } } else { // Issue a request, if it takes too long to get a reply, go around the loop - if (distance == LBDistance::DISTANT) { - TraceEvent("LBDistant") - .suppressFor(0.1) - .detail("Distance", (int)distance) - .detail("BackOff", backoff) - .detail("TriedAllOptions", triedAllOptions) - .detail("Alternatives", alternatives->description()) - .detail("Token", stream->getEndpoint().token) - .detail("Total", alternatives->size()) - .detail("Best", alternatives->countBest()) - .detail("Attempts", numAttempts); - } firstRequestData.startRequest(backoff, triedAllOptions, stream, request, model, alternatives, channel); firstRequestEndpoint = stream->getEndpoint().token.first(); @@ -757,12 +744,18 @@ Optional getBasicLoadBalancedReply(const BasicLoadBalanc Optional getBasicLoadBalancedReply(const void*); // A simpler version of LoadBalance that does not send second requests where the list of servers are always fresh -ACTOR template +// +// If |alternativeChosen| is not null, then atMostOnce must be True, and if the returned future completes successfully +// then *alternativeChosen will be the alternative to which the message was sent. *alternativeChosen must outlive the +// returned future. +ACTOR template Future basicLoadBalance(Reference> alternatives, - RequestStream Interface::*channel, + RequestStream Interface::*channel, Request request = Request(), TaskPriority taskID = TaskPriority::DefaultPromiseEndpoint, - AtMostOnce atMostOnce = AtMostOnce::False) { + AtMostOnce atMostOnce = AtMostOnce::False, + int* alternativeChosen = nullptr) { + ASSERT(alternativeChosen == nullptr || atMostOnce == AtMostOnce::True); setReplyPriority(request, taskID); if (!alternatives) return Never(); @@ -782,7 +775,7 @@ Future basicLoadBalance(Reference> al state int useAlt; loop { // Find an alternative, if any, that is not failed, starting with nextAlt - state RequestStream const* stream = nullptr; + state RequestStream const* stream = nullptr; for (int alternativeNum = 0; alternativeNum < alternatives->size(); alternativeNum++) { useAlt = nextAlt; if (nextAlt == startAlt) @@ -791,6 +784,9 @@ Future basicLoadBalance(Reference> al useAlt = (nextAlt + alternatives->size() - 1) % alternatives->size(); stream = &alternatives->get(useAlt, channel); + if (alternativeChosen != nullptr) { + *alternativeChosen = useAlt; + } if (!IFailureMonitor::failureMonitor().getState(stream->getEndpoint()).failed) break; nextAlt = (nextAlt + 1) % alternatives->size(); diff --git a/src/fdbrpc/LoadBalance.h b/src/fdbrpc/include/fdbrpc/LoadBalance.h similarity index 100% rename from src/fdbrpc/LoadBalance.h rename to src/fdbrpc/include/fdbrpc/LoadBalance.h diff --git a/src/fdbrpc/LoadPlugin.h b/src/fdbrpc/include/fdbrpc/LoadPlugin.h similarity index 100% rename from src/fdbrpc/LoadPlugin.h rename to src/fdbrpc/include/fdbrpc/LoadPlugin.h diff --git a/src/fdbrpc/Locality.h b/src/fdbrpc/include/fdbrpc/Locality.h similarity index 83% rename from src/fdbrpc/Locality.h rename to src/fdbrpc/include/fdbrpc/Locality.h index 3e8d07f..eafac29 100644 --- a/src/fdbrpc/Locality.h +++ b/src/fdbrpc/include/fdbrpc/Locality.h @@ -49,9 +49,40 @@ struct ProcessClass { BlobManagerClass, BlobWorkerClass, EncryptKeyProxyClass, + ConsistencyScanClass, + BlobMigratorClass, + SimHTTPServerClass, InvalidClass = -1 }; + // class is serialized by enum value, so it's important not to change the + // enum value of a class. New classes should only be added to the end. + static_assert(ProcessClass::UnsetClass == 0); + static_assert(ProcessClass::StorageClass == 1); + static_assert(ProcessClass::TransactionClass == 2); + static_assert(ProcessClass::ResolutionClass == 3); + static_assert(ProcessClass::TesterClass == 4); + static_assert(ProcessClass::CommitProxyClass == 5); + static_assert(ProcessClass::MasterClass == 6); + static_assert(ProcessClass::StatelessClass == 7); + static_assert(ProcessClass::LogClass == 8); + static_assert(ProcessClass::ClusterControllerClass == 9); + static_assert(ProcessClass::LogRouterClass == 10); + static_assert(ProcessClass::FastRestoreClass == 11); + static_assert(ProcessClass::DataDistributorClass == 12); + static_assert(ProcessClass::CoordinatorClass == 13); + static_assert(ProcessClass::RatekeeperClass == 14); + static_assert(ProcessClass::StorageCacheClass == 15); + static_assert(ProcessClass::BackupClass == 16); + static_assert(ProcessClass::GrvProxyClass == 17); + static_assert(ProcessClass::BlobManagerClass == 18); + static_assert(ProcessClass::BlobWorkerClass == 19); + static_assert(ProcessClass::EncryptKeyProxyClass == 20); + static_assert(ProcessClass::ConsistencyScanClass == 21); + static_assert(ProcessClass::BlobMigratorClass == 22); + static_assert(ProcessClass::SimHTTPServerClass == 23); + static_assert(ProcessClass::InvalidClass == -1); + enum Fitness { BestFit, GoodFit, @@ -72,8 +103,10 @@ struct ProcessClass { ClusterController, DataDistributor, Ratekeeper, + ConsistencyScan, BlobManager, BlobWorker, + BlobMigrator, StorageCache, Backup, EncryptKeyProxy, @@ -84,6 +117,12 @@ struct ProcessClass { int16_t _class; int16_t _source; + // source is serialized by enum value, so it's important not to change the + // enum value of a source. New sources should only be added to the end. + static_assert(ProcessClass::CommandLineSource == 0); + static_assert(ProcessClass::AutoSource == 1); + static_assert(ProcessClass::DBSource == 2); + public: ProcessClass() : _class(UnsetClass), _source(CommandLineSource) {} ProcessClass(ClassType type, ClassSource source) : _class(type), _source(source) {} @@ -110,11 +149,13 @@ struct ProcessClass { else if (s=="data_distributor") _class = DataDistributorClass; else if (s=="coordinator") _class = CoordinatorClass; else if (s=="ratekeeper") _class = RatekeeperClass; + else if (s=="consistency_scan") _class = ConsistencyScanClass; else if (s=="blob_manager") _class = BlobManagerClass; else if (s=="blob_worker") _class = BlobWorkerClass; else if (s=="storage_cache") _class = StorageCacheClass; else if (s=="backup") _class = BackupClass; else if (s=="encrypt_key_proxy") _class = EncryptKeyProxyClass; + else if (s=="sim_http_server") _class = SimHTTPServerClass; else _class = InvalidClass; } @@ -140,11 +181,13 @@ struct ProcessClass { else if (classStr=="data_distributor") _class = DataDistributorClass; else if (classStr=="coordinator") _class = CoordinatorClass; else if (classStr=="ratekeeper") _class = RatekeeperClass; + else if (classStr=="consistency_scan") _class = ConsistencyScanClass; else if (classStr=="blob_manager") _class = BlobManagerClass; else if (classStr=="blob_worker") _class = BlobWorkerClass; else if (classStr=="storage_cache") _class = StorageCacheClass; else if (classStr=="backup") _class = BackupClass; else if (classStr=="encrypt_key_proxy") _class = EncryptKeyProxyClass; + else if (classStr=="sim_http_server") _class = SimHTTPServerClass; else _class = InvalidClass; if (sourceStr=="command_line") _source = CommandLineSource; @@ -180,11 +223,13 @@ struct ProcessClass { case DataDistributorClass: return "data_distributor"; case CoordinatorClass: return "coordinator"; case RatekeeperClass: return "ratekeeper"; + case ConsistencyScanClass: return "consistency_scan"; case BlobManagerClass: return "blob_manager"; case BlobWorkerClass: return "blob_worker"; case StorageCacheClass: return "storage_cache"; case BackupClass: return "backup"; case EncryptKeyProxyClass: return "encrypt_key_proxy"; + case SimHTTPServerClass: return "sim_http_server"; default: return "invalid"; } } @@ -282,6 +327,23 @@ struct LocalityData { return infoString; } + // Convert locality fields to a JSON object. This is a template because it works with JSONBuilder, StatusObject, + // and json_spirit::mObject, and none of these types are in the fdbrpc/ project. + template + JSONType toJSON() const { + JSONType obj; + + for (auto it = _data.begin(); it != _data.end(); it++) { + if (it->second.present()) { + obj[it->first.toString()] = it->second.get().toString(); + } else { + obj[it->first.toString()] = nullptr; + } + } + + return obj; + } + template void serialize(Ar& ar) { // Locality is persisted in the database inside StorageServerInterface, so changes here have to be diff --git a/src/fdbrpc/MultiInterface.h b/src/fdbrpc/include/fdbrpc/MultiInterface.h similarity index 99% rename from src/fdbrpc/MultiInterface.h rename to src/fdbrpc/include/fdbrpc/MultiInterface.h index 85fa195..be7443c 100644 --- a/src/fdbrpc/MultiInterface.h +++ b/src/fdbrpc/include/fdbrpc/MultiInterface.h @@ -91,7 +91,7 @@ struct AlternativeInfo { bool operator==(double const& r) const { return cumulativeProbability == r; } }; -FDB_DECLARE_BOOLEAN_PARAM(BalanceOnRequests); +FDB_BOOLEAN_PARAM(BalanceOnRequests); template class ModelInterface : public ReferenceCounted> { diff --git a/src/fdbrpc/Net2FileSystem.h b/src/fdbrpc/include/fdbrpc/Net2FileSystem.h similarity index 98% rename from src/fdbrpc/Net2FileSystem.h rename to src/fdbrpc/include/fdbrpc/Net2FileSystem.h index 09a9a1a..8fb5544 100644 --- a/src/fdbrpc/Net2FileSystem.h +++ b/src/fdbrpc/include/fdbrpc/Net2FileSystem.h @@ -23,7 +23,7 @@ #include #pragma once -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" class Net2FileSystem final : public IAsyncFileSystem { public: diff --git a/src/fdbrpc/PerfMetric.h b/src/fdbrpc/include/fdbrpc/PerfMetric.h similarity index 97% rename from src/fdbrpc/PerfMetric.h rename to src/fdbrpc/include/fdbrpc/PerfMetric.h index 256dbf5..b81f6ce 100644 --- a/src/fdbrpc/PerfMetric.h +++ b/src/fdbrpc/include/fdbrpc/PerfMetric.h @@ -27,7 +27,7 @@ #include "flow/BooleanParam.h" #include "flow/flow.h" -FDB_DECLARE_BOOLEAN_PARAM(Averaged); +FDB_BOOLEAN_PARAM(Averaged); struct PerfMetric { constexpr static FileIdentifier file_identifier = 5980618; @@ -43,7 +43,7 @@ struct PerfMetric { std::string format_code() const { return m_format_code; } bool averaged() const { return m_averaged; } - PerfMetric withPrefix(const std::string& pre) { + PerfMetric withPrefix(const std::string& pre) const { return PerfMetric(pre + name(), value(), Averaged{ averaged() }, format_code()); } diff --git a/src/fdbrpc/QueueModel.h b/src/fdbrpc/include/fdbrpc/QueueModel.h similarity index 100% rename from src/fdbrpc/QueueModel.h rename to src/fdbrpc/include/fdbrpc/QueueModel.h diff --git a/src/fdbrpc/RangeMap.h b/src/fdbrpc/include/fdbrpc/RangeMap.h similarity index 91% rename from src/fdbrpc/RangeMap.h rename to src/fdbrpc/include/fdbrpc/RangeMap.h index 09f5163..417b831 100644 --- a/src/fdbrpc/RangeMap.h +++ b/src/fdbrpc/include/fdbrpc/RangeMap.h @@ -139,7 +139,8 @@ class RangeMap { pair_type endPair(endKey, Val()); map.insert(endPair, true, mf(endPair)); } - Val const& operator[](const Key& k) { return rangeContaining(k).value(); } + Val const& operator[](const Key& k) const { return rangeContaining(k).value(); } + Val& operator[](const Key& k) { return rangeContaining(k).value(); } Ranges ranges() { return Ranges(iterator(map.begin()), iterator(map.lastItem())); } ConstRanges ranges() const { return ConstRanges(const_iterator(map.begin()), const_iterator(map.lastItem())); } @@ -209,6 +210,8 @@ class RangeMap { void validateCoalesced(); void operator=(RangeMap&& r) noexcept { map = std::move(r.map); } + + RangeMap(RangeMap&& source) = default; // void clear( const Val& value ) { ranges.clear(); ranges.insert(std::make_pair(Key(),value)); } void clear() { map.clear(); } @@ -216,6 +219,19 @@ class RangeMap { Future clearAsync() { return map.clearAsync(); } + Metric getMetric(const_iterator x) const { return map.getMetric(x); } + Metric getMetric(iterator x) const { return getMetric(const_iterator{ x }); } + + Metric sumTo(const_iterator to) const { return map.sumTo(to); } + Metric sumTo(iterator to) const { return sumTo(const_iterator{ to }); } + + Metric sumRange(const_iterator begin, const_iterator end) const { return map.sumRange(begin, end); } + Metric sumRange(iterator begin, iterator end) const { return map.sumRange(begin, end); } + template + Metric sumRange(const KeyCompatible& begin, const KeyCompatible& end) const { + return map.sumRange(begin, end); + } + protected: Map map; const MetricFunc mf; diff --git a/src/fdbrpc/Replication.h b/src/fdbrpc/include/fdbrpc/Replication.h similarity index 100% rename from src/fdbrpc/Replication.h rename to src/fdbrpc/include/fdbrpc/Replication.h diff --git a/src/fdbrpc/ReplicationPolicy.h b/src/fdbrpc/include/fdbrpc/ReplicationPolicy.h similarity index 96% rename from src/fdbrpc/ReplicationPolicy.h rename to src/fdbrpc/include/fdbrpc/ReplicationPolicy.h index 6de8d70..20e1638 100644 --- a/src/fdbrpc/ReplicationPolicy.h +++ b/src/fdbrpc/include/fdbrpc/ReplicationPolicy.h @@ -95,7 +95,7 @@ inline void save(Archive& ar, const Reference& value) { } } -struct PolicyOne final : IReplicationPolicy, public ReferenceCounted { +struct PolicyOne final : IReplicationPolicy { PolicyOne(){}; explicit PolicyOne(const PolicyOne& o) {} std::string name() const override { return "One"; } @@ -115,7 +115,7 @@ struct PolicyOne final : IReplicationPolicy, public ReferenceCounted void attributeKeys(std::set* set) const override { return; } }; -struct PolicyAcross final : IReplicationPolicy, public ReferenceCounted { +struct PolicyAcross final : IReplicationPolicy { friend struct serializable_traits; PolicyAcross(int count, std::string const& attribKey, Reference const policy); explicit PolicyAcross(); @@ -168,7 +168,7 @@ struct PolicyAcross final : IReplicationPolicy, public ReferenceCounted { +struct PolicyAnd final : IReplicationPolicy { friend struct serializable_traits; PolicyAnd(std::vector> policies) : _policies(policies), _sortedPolicies(policies) { // Sort the policy array @@ -254,19 +254,19 @@ void serializeReplicationPolicy(Ar& ar, Reference& policy) { StringRef name; serializer(ar, name); - if (name == LiteralStringRef("One")) { + if (name == "One"_sr) { PolicyOne* pointer = new PolicyOne(); pointer->serialize(ar); policy = Reference(pointer); - } else if (name == LiteralStringRef("Across")) { + } else if (name == "Across"_sr) { PolicyAcross* pointer = new PolicyAcross(0, "", Reference()); pointer->serialize(ar); policy = Reference(pointer); - } else if (name == LiteralStringRef("And")) { + } else if (name == "And"_sr) { PolicyAnd* pointer = new PolicyAnd{}; pointer->serialize(ar); policy = Reference(pointer); - } else if (name == LiteralStringRef("None")) { + } else if (name == "None"_sr) { policy = Reference(); } else { TraceEvent(SevError, "SerializingInvalidPolicyType").detail("PolicyName", name); diff --git a/src/fdbrpc/ReplicationTypes.h b/src/fdbrpc/include/fdbrpc/ReplicationTypes.h similarity index 100% rename from src/fdbrpc/ReplicationTypes.h rename to src/fdbrpc/include/fdbrpc/ReplicationTypes.h diff --git a/src/fdbrpc/ReplicationUtils.h b/src/fdbrpc/include/fdbrpc/ReplicationUtils.h similarity index 100% rename from src/fdbrpc/ReplicationUtils.h rename to src/fdbrpc/include/fdbrpc/ReplicationUtils.h diff --git a/src/fdbrpc/SimExternalConnection.h b/src/fdbrpc/include/fdbrpc/SimExternalConnection.h similarity index 97% rename from src/fdbrpc/SimExternalConnection.h rename to src/fdbrpc/include/fdbrpc/SimExternalConnection.h index 00f55b6..5fe99fb 100644 --- a/src/fdbrpc/SimExternalConnection.h +++ b/src/fdbrpc/include/fdbrpc/SimExternalConnection.h @@ -25,6 +25,7 @@ #include "flow/FastRef.h" #include "flow/network.h" #include "flow/flow.h" +#include "flow/IConnection.h" #include @@ -47,6 +48,7 @@ class SimExternalConnection final : public IConnection, public ReferenceCounted< int read(uint8_t* begin, uint8_t* end) override; int write(SendBuffer const* buffer, int limit) override; NetworkAddress getPeerAddress() const override; + bool hasTrustedPeer() const override; UID getDebugID() const override; boost::asio::ip::tcp::socket& getSocket() override { return socket; } static Future> resolveTCPEndpoint(const std::string& host, diff --git a/src/fdbrpc/include/fdbrpc/SimulatorKillType.h b/src/fdbrpc/include/fdbrpc/SimulatorKillType.h new file mode 100644 index 0000000..013a576 --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/SimulatorKillType.h @@ -0,0 +1,41 @@ +/* + * SimulatorKillType.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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. + */ + +#ifndef FDBRPC_SIMULATOR_KILLTYPE_H +#define FDBRPC_SIMULATOR_KILLTYPE_H + +namespace simulator { + +// Order matters! +enum KillType { + KillInstantly, + InjectFaults, + FailDisk, + RebootAndDelete, + RebootProcessAndDelete, + RebootProcessAndSwitch, // Reboot and switch cluster file + Reboot, + RebootProcess, + None +}; + +} // namespace simulator + +#endif // FDBRPC_SIMULATOR_KILLTYPE_H diff --git a/src/fdbrpc/include/fdbrpc/SimulatorMachineInfo.h b/src/fdbrpc/include/fdbrpc/SimulatorMachineInfo.h new file mode 100644 index 0000000..302cfee --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/SimulatorMachineInfo.h @@ -0,0 +1,76 @@ +/* + * SimulatorMachineInfo.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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. + */ + +#ifndef FDBRPC_SIMULATORMACHINEINFO_H +#define FDBRPC_SIMULATORMACHINEINFO_H + +#include +#include +#include +#include + +#include "flow/Optional.h" +#include "flow/IAsyncFile.h" + +namespace simulator { + +struct ProcessInfo; + +// A set of data associated with a simulated machine +struct MachineInfo { + ProcessInfo* machineProcess; + std::vector processes; + + // A map from filename to file handle for all open files on a machine + std::map> openFiles; + + std::set deletingOrClosingFiles; + std::set closingFiles; + Optional> machineId; + + const uint16_t remotePortStart; + std::vector usedRemotePorts; + + MachineInfo() : machineProcess(nullptr), remotePortStart(1000) {} + + short getRandomPort() { + for (uint16_t i = remotePortStart; i < 60000; i++) { + if (std::find(usedRemotePorts.begin(), usedRemotePorts.end(), i) == usedRemotePorts.end()) { + TraceEvent(SevDebug, "RandomPortOpened").detail("PortNum", i); + usedRemotePorts.push_back(i); + return i; + } + } + UNREACHABLE(); + } + + void removeRemotePort(uint16_t port) { + if (port < remotePortStart) + return; + auto pos = std::find(usedRemotePorts.begin(), usedRemotePorts.end(), port); + if (pos != usedRemotePorts.end()) { + usedRemotePorts.erase(pos); + } + } +}; + +} // namespace simulator + +#endif // FDBRPC_SIMULATORMACHINEINFO_H diff --git a/src/fdbrpc/include/fdbrpc/SimulatorProcessInfo.h b/src/fdbrpc/include/fdbrpc/SimulatorProcessInfo.h new file mode 100644 index 0000000..48654cb --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/SimulatorProcessInfo.h @@ -0,0 +1,187 @@ +/* + * SimulatorProcessInfo.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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. + */ + +#ifndef FDBRPC_SIMULATOR_PROCESSINFO_H +#define FDBRPC_SIMULATOR_PROCESSINFO_H + +#include +#include + +#include "flow/NetworkAddress.h" +#include "flow/IConnection.h" +#include "flow/IUDPSocket.h" +#include "flow/TDMetric.actor.h" +#include "flow/ChaosMetrics.h" + +#include "fdbrpc/SimulatorMachineInfo.h" +#include "fdbrpc/SimulatorKillType.h" + +struct MachineInfo; + +namespace simulator { + +struct ProcessInfo : NonCopyable { + std::string name; + std::string coordinationFolder; + std::string dataFolder; + MachineInfo* machine; + NetworkAddressList addresses; + NetworkAddress address; + LocalityData locality; + ProcessClass startingClass; + TDMetricCollection tdmetrics; + MetricCollection metrics; + ChaosMetrics chaosMetrics; + HistogramRegistry histograms; + std::map> listenerMap; + std::map> boundUDPSockets; + bool failed; + bool excluded; + bool cleared; + bool rebooting; + bool drProcess; + std::vector globals; + + INetworkConnections* network; + + uint64_t fault_injection_r; + double fault_injection_p1, fault_injection_p2, blob_inject_failure_rate; + bool failedDisk; + + UID uid; + + ProtocolVersion protocolVersion; + bool excludeFromRestarts = false; + + std::vector childs; + + ProcessInfo(const char* name, + LocalityData locality, + ProcessClass startingClass, + NetworkAddressList addresses, + INetworkConnections* net, + const char* dataFolder, + const char* coordinationFolder) + : name(name), coordinationFolder(coordinationFolder), dataFolder(dataFolder), machine(nullptr), + addresses(addresses), address(addresses.address), locality(locality), startingClass(startingClass), + failed(false), excluded(false), cleared(false), rebooting(false), drProcess(false), network(net), + fault_injection_r(0), fault_injection_p1(0), fault_injection_p2(0), blob_inject_failure_rate(0), + failedDisk(false) { + uid = deterministicRandom()->randomUniqueID(); + } + + Future onShutdown() { return shutdownSignal.getFuture(); } + + bool isSpawnedKVProcess() const { + // SOMEDAY: use a separate bool may be better? + return name == "remote flow process"; + } + bool isReliable() const { + return !failed && fault_injection_p1 == 0 && fault_injection_p2 == 0 && !failedDisk && + (!machine || + (machine->machineProcess->fault_injection_p1 == 0 && machine->machineProcess->fault_injection_p2 == 0)); + } + bool isAvailable() const { return !isExcluded() && isReliable(); } + bool isExcluded() const { return excluded; } + bool isCleared() const { return cleared; } + std::string getReliableInfo() const { + std::stringstream ss; + ss << "failed:" << failed << " fault_injection_p1:" << fault_injection_p1 + << " fault_injection_p2:" << fault_injection_p2; + return ss.str(); + } + std::vector const& getChilds() const { return childs; } + + // Return true if the class type is suitable for stateful roles, such as tLog and StorageServer. + bool isAvailableClass() const { + switch (startingClass._class) { + case ProcessClass::UnsetClass: + return true; + case ProcessClass::StorageClass: + return true; + case ProcessClass::TransactionClass: + return true; + case ProcessClass::ResolutionClass: + return false; + case ProcessClass::CommitProxyClass: + return false; + case ProcessClass::GrvProxyClass: + return false; + case ProcessClass::MasterClass: + return false; + case ProcessClass::TesterClass: + return false; + case ProcessClass::StatelessClass: + return false; + case ProcessClass::LogClass: + return true; + case ProcessClass::LogRouterClass: + return false; + case ProcessClass::ClusterControllerClass: + return false; + case ProcessClass::DataDistributorClass: + return false; + case ProcessClass::RatekeeperClass: + return false; + case ProcessClass::ConsistencyScanClass: + return false; + case ProcessClass::BlobManagerClass: + return false; + case ProcessClass::StorageCacheClass: + return false; + case ProcessClass::BackupClass: + return false; + case ProcessClass::EncryptKeyProxyClass: + return false; + default: + return false; + } + } + + Reference getListener(const NetworkAddress& addr) const { + auto listener = listenerMap.find(addr); + ASSERT(listener != listenerMap.end()); + return listener->second; + } + + inline flowGlobalType global(int id) const { return (globals.size() > id) ? globals[id] : nullptr; }; + inline void setGlobal(size_t id, flowGlobalType v) { + globals.resize(std::max(globals.size(), id + 1)); + globals[id] = v; + }; + + std::string toString() const { + return format("name: %s address: %s zone: %s datahall: %s class: %s excluded: %d cleared: %d", + name.c_str(), + formatIpPort(addresses.address.ip, addresses.address.port).c_str(), + (locality.zoneId().present() ? locality.zoneId().get().printable().c_str() : "[unset]"), + (locality.dataHallId().present() ? locality.dataHallId().get().printable().c_str() : "[unset]"), + startingClass.toString().c_str(), + excluded, + cleared); + } + + // Members not for external use + Promise shutdownSignal; +}; + +} // namespace simulator + +#endif // FDBRPC_SIMULATOR_PROCESSINFO_H diff --git a/src/fdbrpc/include/fdbrpc/Smoother.h b/src/fdbrpc/include/fdbrpc/Smoother.h new file mode 100644 index 0000000..e79ecbd --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/Smoother.h @@ -0,0 +1,149 @@ +/* + * Smoother.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 + +#include "flow/flow.h" +#include + +// Implements a basic exponential smoothing algorithm +// (see https://en.wikipedia.org/wiki/Exponential_smoothing#Basic_(simple)_exponential_smoothing) +template +class SmootherImpl { + // Times (t) are expected to be nondecreasing + + double eFoldingTime; + double total; + mutable double time, estimate; + + void update(double t) const { + double elapsed = t - time; + if (elapsed) { + time = t; + estimate += (total - estimate) * (1 - exp(-elapsed / eFoldingTime)); + } + } + +protected: + explicit SmootherImpl(double eFoldingTime) : eFoldingTime(eFoldingTime) { reset(0); } + +public: + void reset(double value) { + time = 0; + total = value; + estimate = value; + } + void setTotal(double total, double t = T::now()) { addDelta(total - this->total, t); } + void addDelta(double delta, double t = T::now()) { + update(t); + total += delta; + } + // smoothTotal() is a continuous (under)estimate of the sum of all addDeltas() + double smoothTotal(double t = T::now()) const { + update(t); + return estimate; + } + // smoothRate() is d/dt[smoothTotal], and is NOT continuous + double smoothRate(double t = T::now()) const { + update(t); + return (total - estimate) / eFoldingTime; + } + + double getTotal() const { return total; } +}; + +class Smoother : public SmootherImpl { +public: + static double now() { return ::now(); } + explicit Smoother(double eFoldingTime) : SmootherImpl(eFoldingTime) {} +}; +class TimerSmoother : public SmootherImpl { +public: + static double now() { return timer(); } + explicit TimerSmoother(double eFoldingTime) : SmootherImpl(eFoldingTime) {} +}; + +// Implements a Holt linear smoothing algorithm +// (see https://en.wikipedia.org/wiki/Exponential_smoothing#Double_exponential_smoothing_(Holt_linear)) +// This is more accurate than Smoother for metrics that have a trend. +template +class HoltLinearSmootherImpl { + // Times (t) are expected to be nondecreasing + double eDataFoldingTime, eTrendFoldingTime; + double total, lastEstimate, lastRateEstimate, lastTime; + +protected: + explicit HoltLinearSmootherImpl(double eDataFoldingTime, double eTrendFoldingTime) + : eDataFoldingTime(eDataFoldingTime), eTrendFoldingTime(eTrendFoldingTime) { + reset(0); + } + +public: + void reset(double value) { + total = value; + lastEstimate = value; + lastRateEstimate = 0; + lastTime = 0; + } + + void setTotal(double total, double t = T::now()) { addDelta(total - this->total, t); } + + void addDelta(double delta, double t = T::now()) { + double const elapsed = t - lastTime; + if (elapsed) { + double const rateEstimate = smoothRate(); + lastEstimate = smoothTotal(); + lastRateEstimate = rateEstimate; + lastTime = t; + } + this->total += delta; + } + + double smoothTotal(double t = T::now()) const { + double const elapsed = t - lastTime; + double const alpha = 1 - exp(-elapsed / eDataFoldingTime); + return alpha * total + (1 - alpha) * (lastEstimate + elapsed * lastRateEstimate); + } + + double smoothRate(double t = T::now()) const { + double const elapsed = t - lastTime; + if (elapsed) { + double const recentRate = (smoothTotal() - lastEstimate) / elapsed; + double const beta = 1 - exp(-elapsed / eTrendFoldingTime); + return beta * recentRate + (1 - beta) * lastRateEstimate; + } else { + return lastRateEstimate; + } + } + + double getTotal() const { return total; } +}; + +class HoltLinearSmoother : public HoltLinearSmootherImpl { +public: + static double now() { return ::now(); } + explicit HoltLinearSmoother(double eDataFoldingTime, double eTrendFoldingTime) + : HoltLinearSmootherImpl(eDataFoldingTime, eTrendFoldingTime) {} +}; +class HoltLinearTimerSmoother : public HoltLinearSmootherImpl { + static double now() { return timer(); } + explicit HoltLinearTimerSmoother(double eDataFoldingTime, double eTrendFoldingTime) + : HoltLinearSmootherImpl(eDataFoldingTime, eTrendFoldingTime) {} +}; diff --git a/src/fdbrpc/Stats.h b/src/fdbrpc/include/fdbrpc/Stats.h similarity index 64% rename from src/fdbrpc/Stats.h rename to src/fdbrpc/include/fdbrpc/Stats.h index f8a15e7..ef0e3b0 100644 --- a/src/fdbrpc/Stats.h +++ b/src/fdbrpc/include/fdbrpc/Stats.h @@ -20,6 +20,12 @@ #ifndef FDBRPC_STATS_H #define FDBRPC_STATS_H +#include "flow/Error.h" +#include "flow/IRandom.h" +#include "flow/Knobs.h" +#include "flow/OTELMetrics.h" +#include "flow/serialize.h" +#include #include #pragma once @@ -38,10 +44,11 @@ MyCounters() : foo("foo", cc), bar("bar", cc), baz("baz", cc) {} #include #include "flow/flow.h" #include "flow/TDMetric.actor.h" -#include "fdbrpc/ContinuousSample.h" +#include "fdbrpc/DDSketch.h" -struct ICounter { +struct ICounter : public IMetric { // All counters have a name and value + ICounter() : IMetric(knobToMetricModel(FLOW_KNOBS->METRICS_DATA_MODEL)) {} virtual std::string const& getName() const = 0; virtual int64_t getValue() const = 0; @@ -67,20 +74,43 @@ struct Traceable : std::true_type { } }; -struct CounterCollection { - CounterCollection(std::string name, std::string id = std::string()) : name(name), id(id) {} - std::vector counters, counters_to_remove; +class CounterCollection { + friend class CounterCollectionImpl; + + std::string name; + std::string id; + std::vector counters, countersToRemove; + + double logTime; + +public: + CounterCollection(std::string const& name, std::string const& id = std::string()) + : name(name), id(id), logTime(0) {} ~CounterCollection() { - for (auto c : counters_to_remove) + for (auto c : countersToRemove) c->remove(); } - std::string name; - std::string id; - void logToTraceEvent(TraceEvent& te) const; + void addCounter(ICounter* counter) { counters.push_back(counter); } + + // Call remove method on this counter in ~CounterCollection + void markForRemoval(ICounter* counter) { countersToRemove.push_back(counter); } + + std::string const& getName() const { return name; } + + std::string const& getId() const { return id; } + + void logToTraceEvent(TraceEvent& te); + + Future traceCounters( + std::string const& traceEventName, + UID traceEventID, + double interval, + std::string const& trackLatestName = std::string(), + std::function const& decorator = [](auto& te) {}); }; -struct Counter final : ICounter, NonCopyable { +struct Counter final : public ICounter, NonCopyable { public: typedef int64_t Value; @@ -131,8 +161,8 @@ struct Traceable : std::true_type { template struct SpecialCounter final : ICounter, FastAllocated>, NonCopyable { SpecialCounter(CounterCollection& collection, std::string const& name, F&& f) : name(name), f(f) { - collection.counters.push_back(this); - collection.counters_to_remove.push_back(this); + collection.addCounter(this); + collection.markForRemoval(this); } void remove() override { delete this; } @@ -162,55 +192,12 @@ static void specialCounter(CounterCollection& collection, std::string const& nam new SpecialCounter(collection, name, std::move(f)); } -Future traceCounters( - std::string const& traceEventName, - UID const& traceEventID, - double const& interval, - CounterCollection* const& counters, - std::string const& trackLatestName = std::string(), - std::function const& decorator = [](TraceEvent& te) {}); +FDB_BOOLEAN_PARAM(Filtered); class LatencyBands { -public: - LatencyBands(std::string name, UID id, double loggingInterval) - : name(name), id(id), loggingInterval(loggingInterval) {} - - void addThreshold(double value) { - if (value > 0 && bands.count(value) == 0) { - if (bands.size() == 0) { - ASSERT(!cc && !filteredCount); - cc = std::make_unique(name, id.toString()); - logger = traceCounters(name, id, loggingInterval, cc.get(), id.toString() + "/" + name); - filteredCount = std::make_unique("Filtered", *cc); - insertBand(std::numeric_limits::infinity()); - } - - insertBand(value); - } - } - - void addMeasurement(double measurement, bool filtered = false) { - if (filtered && filteredCount) { - ++(*filteredCount); - } else if (bands.size() > 0) { - auto itr = bands.upper_bound(measurement); - ASSERT(itr != bands.end()); - ++(*itr->second); - } - } - - void clearBands() { - logger = Void(); - bands.clear(); - filteredCount.reset(); - cc.reset(); - } - - ~LatencyBands() { clearBands(); } - -private: std::map> bands; std::unique_ptr filteredCount; + std::function decorator; std::string name; UID id; @@ -219,49 +206,51 @@ class LatencyBands { std::unique_ptr cc; Future logger; - void insertBand(double value) { - bands.emplace(std::make_pair(value, std::make_unique(format("Band%f", value), *cc))); - } -}; + void insertBand(double value); -class LatencySample { public: - LatencySample(std::string name, UID id, double loggingInterval, int sampleSize) - : name(name), id(id), sampleStart(now()), sample(sampleSize), - latencySampleEventHolder(makeReference(id.toString() + "/" + name)) { - logger = recurring([this]() { logSample(); }, loggingInterval); - } + LatencyBands( + std::string const& name, + UID id, + double loggingInterval, + std::function const& decorator = [](auto&) {}); + + LatencyBands(LatencyBands&&) = default; + LatencyBands& operator=(LatencyBands&&) = default; + + void addThreshold(double value); + void addMeasurement(double measurement, int count = 1, Filtered = Filtered::False); + void clearBands(); + ~LatencyBands(); +}; - void addMeasurement(double measurement) { sample.addSample(measurement); } +class LatencySample : public IMetric { +public: + LatencySample(std::string name, UID id, double loggingInterval, double accuracy); + void addMeasurement(double measurement); private: std::string name; UID id; - double sampleStart; - - ContinuousSample sample; + // These UIDs below are needed to emit the tail latencies as gauges + // + // If an OTEL aggregator is able to directly accept and process histograms + // the tail latency gauges won't necessarily be needed anymore since they can be + // calculated directly from the emitted buckets. To support users who have an aggregator + // who cannot accept histograms, the tails latencies are still directly emitted. + UID p50id; + UID p90id; + UID p95id; + UID p99id; + UID p999id; + double sampleEmit; + + DDSketch sketch; Future logger; Reference latencySampleEventHolder; - void logSample() { - TraceEvent(name.c_str(), id) - .detail("Count", sample.getPopulationSize()) - .detail("Elapsed", now() - sampleStart) - .detail("Min", sample.min()) - .detail("Max", sample.max()) - .detail("Mean", sample.mean()) - .detail("Median", sample.median()) - .detail("P25", sample.percentile(0.25)) - .detail("P90", sample.percentile(0.9)) - .detail("P95", sample.percentile(0.95)) - .detail("P99", sample.percentile(0.99)) - .detail("P99.9", sample.percentile(0.999)) - .trackLatest(latencySampleEventHolder->trackingKey); - - sample.clear(); - sampleStart = now(); - } + void logSample(); }; #endif diff --git a/src/fdbrpc/TSSComparison.h b/src/fdbrpc/include/fdbrpc/TSSComparison.h similarity index 82% rename from src/fdbrpc/TSSComparison.h rename to src/fdbrpc/include/fdbrpc/TSSComparison.h index 3c0765c..e3b20cb 100644 --- a/src/fdbrpc/TSSComparison.h +++ b/src/fdbrpc/include/fdbrpc/TSSComparison.h @@ -25,7 +25,6 @@ #ifndef FDBRPC_TSS_COMPARISON_H #define FDBRPC_TSS_COMPARISON_H -#include "fdbrpc/ContinuousSample.h" #include "fdbrpc/Stats.h" // refcounted + noncopyable because both DatabaseContext and individual endpoints share ownership @@ -48,15 +47,15 @@ struct TSSMetrics : ReferenceCounted, NonCopyable { Counter mismatches; // We could probably just ignore getKey as it's seldom used? - ContinuousSample SSgetValueLatency; - ContinuousSample SSgetKeyLatency; - ContinuousSample SSgetKeyValuesLatency; - ContinuousSample SSgetMappedKeyValuesLatency; + DDSketch SSgetValueLatency; + DDSketch SSgetKeyLatency; + DDSketch SSgetKeyValuesLatency; + DDSketch SSgetMappedKeyValuesLatency; - ContinuousSample TSSgetValueLatency; - ContinuousSample TSSgetKeyLatency; - ContinuousSample TSSgetKeyValuesLatency; - ContinuousSample TSSgetMappedKeyValuesLatency; + DDSketch TSSgetValueLatency; + DDSketch TSSgetKeyLatency; + DDSketch TSSgetKeyValuesLatency; + DDSketch TSSgetMappedKeyValuesLatency; std::unordered_map ssErrorsByCode; std::unordered_map tssErrorsByCode; @@ -106,9 +105,9 @@ struct TSSMetrics : ReferenceCounted, NonCopyable { TSSMetrics() : cc("TSSClientMetrics"), requests("Requests", cc), streamComparisons("StreamComparisons", cc), ssErrors("SSErrors", cc), tssErrors("TSSErrors", cc), tssTimeouts("TSSTimeouts", cc), - mismatches("Mismatches", cc), SSgetValueLatency(1000), SSgetKeyLatency(1000), SSgetKeyValuesLatency(1000), - SSgetMappedKeyValuesLatency(1000), TSSgetValueLatency(1000), TSSgetKeyLatency(1000), - TSSgetKeyValuesLatency(1000), TSSgetMappedKeyValuesLatency(1000) {} + mismatches("Mismatches", cc), SSgetValueLatency(), SSgetKeyLatency(), SSgetKeyValuesLatency(), + SSgetMappedKeyValuesLatency(), TSSgetValueLatency(), TSSgetKeyLatency(), TSSgetKeyValuesLatency(), + TSSgetMappedKeyValuesLatency() {} }; template diff --git a/src/fdbrpc/include/fdbrpc/TenantInfo.h b/src/fdbrpc/include/fdbrpc/TenantInfo.h new file mode 100644 index 0000000..e91db19 --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/TenantInfo.h @@ -0,0 +1,87 @@ +/* + * TenantInfo.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 +#ifndef FDBRPC_TENANTINFO_H_ +#define FDBRPC_TENANTINFO_H_ +#include "fdbrpc/TenantName.h" +#include "fdbrpc/TokenSign.h" +#include "fdbrpc/TokenCache.h" +#include "fdbrpc/FlowTransport.h" +#include "flow/Arena.h" +#include "flow/Knobs.h" +#include "flow/WipedString.h" + +struct TenantInfo { + static constexpr const int64_t INVALID_TENANT = -1; + + Arena arena; + int64_t tenantId; + Optional prefix; + Optional token; + // this field is not serialized and instead set by FlowTransport during + // deserialization. This field indicates whether the client is trusted. + // Untrusted clients are generally expected to set a tenant ID + bool trusted = false; + // Is set during deserialization. It will be set to true if the tenant + // is set and the client is authorized to use this tenant. + bool tenantAuthorized = false; + + // Helper function for most endpoints that read/write data. This returns true iff + // the client is either a) a trusted peer or b) is accessing keyspace belonging to a tenant, + // for which it has a valid authorization token. + // NOTE: In a cluster where TenantMode is OPTIONAL or DISABLED, tenant ID may be invalid. + // In such case, the request containing such TenantInfo is valid iff the requesting peer is trusted. + bool isAuthorized() const { return trusted || tenantAuthorized; } + bool hasTenant() const { return tenantId != INVALID_TENANT; } + + TenantInfo() : tenantId(INVALID_TENANT) {} + TenantInfo(int64_t tenantId, Optional const& token) : tenantId(tenantId), token(token) { + if (tenantId != INVALID_TENANT) { + prefix = idToPrefix(tenantId, arena); + } + } + + static StringRef idToPrefix(int64_t id, Arena& arena) { + int64_t swapped = bigEndian64(id); + return StringRef(arena, reinterpret_cast(&swapped), sizeof(id)); + } +}; + +template <> +struct serializable_traits : std::true_type { + template + static void serialize(Archiver& ar, TenantInfo& v) { + serializer(ar, v.tenantId, v.token, v.arena); + if constexpr (Archiver::isDeserializing) { + bool tenantAuthorized = FLOW_KNOBS->ALLOW_TOKENLESS_TENANT_ACCESS; + if (!tenantAuthorized && v.tenantId != TenantInfo::INVALID_TENANT && v.token.present()) { + tenantAuthorized = TokenCache::instance().validate(v.tenantId, v.token.get()); + } + v.trusted = FlowTransport::transport().currentDeliveryPeerIsTrusted(); + v.tenantAuthorized = tenantAuthorized; + if (v.hasTenant()) { + v.prefix = TenantInfo::idToPrefix(v.tenantId, v.arena); + } + } + } +}; + +#endif // FDBRPC_TENANTINFO_H_ diff --git a/src/fdbrpc/include/fdbrpc/TenantName.h b/src/fdbrpc/include/fdbrpc/TenantName.h new file mode 100644 index 0000000..66de3d0 --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/TenantName.h @@ -0,0 +1,29 @@ +/* + * TenantName.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 +#ifndef FDBRPC_TENANTNAME_H +#define FDBRPC_TENANTNAME_H +#include "flow/Arena.h" +typedef StringRef TenantNameRef; +typedef Standalone TenantName; +typedef StringRef TenantGroupNameRef; +typedef Standalone TenantGroupName; +#endif // FDBRPC_TENANTNAME_H diff --git a/src/fdbrpc/TimedRequest.h b/src/fdbrpc/include/fdbrpc/TimedRequest.h similarity index 94% rename from src/fdbrpc/TimedRequest.h rename to src/fdbrpc/include/fdbrpc/TimedRequest.h index 07a8c0b..e6dfc4d 100644 --- a/src/fdbrpc/TimedRequest.h +++ b/src/fdbrpc/include/fdbrpc/TimedRequest.h @@ -20,6 +20,7 @@ #ifndef FDBRPC_TIMED_REQUEST_H #define FDBRPC_TIMED_REQUEST_H +#include "flow/network.h" #pragma once #include @@ -35,7 +36,7 @@ class TimedRequest { TimedRequest() { if (!FlowTransport::isClient()) { - _requestTime = timer(); + _requestTime = g_network->timer(); } else { _requestTime = 0.0; } diff --git a/src/fdbrpc/include/fdbrpc/TokenCache.h b/src/fdbrpc/include/fdbrpc/TokenCache.h new file mode 100644 index 0000000..b25eaeb --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/TokenCache.h @@ -0,0 +1,38 @@ +/* + * TokenCache.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef TOKENCACHE_H_ +#define TOKENCACHE_H_ +#include "fdbrpc/TenantName.h" +#include "fdbrpc/TokenSpec.h" +#include "flow/Arena.h" + +class TokenCache : NonCopyable { + struct TokenCacheImpl* impl; + TokenCache(); + +public: + ~TokenCache(); + static void createInstance(); + static TokenCache& instance(); + bool validate(authz::TenantId tenant, StringRef token); +}; + +#endif // TOKENCACHE_H_ diff --git a/src/fdbrpc/include/fdbrpc/TokenSign.h b/src/fdbrpc/include/fdbrpc/TokenSign.h new file mode 100644 index 0000000..9cf16a6 --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/TokenSign.h @@ -0,0 +1,96 @@ +/* + * TokenSign.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBRPC_TOKEN_SIGN_H +#define FDBRPC_TOKEN_SIGN_H +#pragma once + +#include "flow/network.h" +#include "flow/Arena.h" +#include "flow/FileIdentifier.h" +#include "flow/PKey.h" +#include "fdbrpc/TokenSpec.h" +#include +#include + +namespace authz::jwt { + +namespace detail { + +// work around the fact that VectorRef takes more than one template parameter +template +using VectorRefAlias = VectorRef; + +} // namespace detail + +using TokenRef = BasicTokenSpec; + +// print each non-signature field in non-JSON, human-readable format e.g. for trace +StringRef toStringRef(Arena& arena, const TokenRef& tokenSpec); + +StringRef makeSignInput(Arena& arena, const TokenRef& tokenSpec); + +// Sign the passed sign input +StringRef signToken(Arena& arena, StringRef signInput, Algorithm algorithm, PrivateKey privateKey); + +// One-stop function to make JWT from spec +StringRef signToken(Arena& arena, const TokenRef& tokenSpec, PrivateKey privateKey); + +// Parse passed b64url-encoded header part and materialize its contents into tokenOut, +// using memory allocated from arena +// Returns a non-empty optional containing an error message if parsing failed +Optional parseHeaderPart(Arena& arena, TokenRef& tokenOut, StringRef b64urlHeaderIn); + +// Parse passed b64url-encoded payload part and materialize its contents into tokenOut, +// using memory allocated from arena +// Returns a non-empty optional containing an error message if parsing failed +Optional parsePayloadPart(Arena& arena, TokenRef& tokenOut, StringRef b64urlPayloadIn); + +// Parse passed b64url-encoded signature part and materialize its contents into tokenOut, +// using memory allocated from arena +// Returns a non-empty optional containing an error message if parsing failed +Optional parseSignaturePart(Arena& arena, TokenRef& tokenOut, StringRef b64urlSignatureIn); + +// Parses passed token string and materialize its contents into tokenOut, +// using memory allocated from arena +// Returns a non-empty optional containing an error message if parsing failed +Optional parseToken(Arena& arena, + StringRef signedTokenIn, + TokenRef& parsedTokenOut, + StringRef& signInputOut); + +// Using the parsed token metadata and sign input, verify that the signature from parsedToken +// is a result of signing sign input with a private key that matches the provided public key +// Returns a tuple containing signature verification result, +// and an optional containing verification error message if any occurred. +// If the latter value is non-empty, the former value should not be used. +// NOTE: This is more efficient than the other overload, as it re-uses +// the parsed and base64url-decoded token metadata and signature from parseToken() step +std::pair> verifyToken(StringRef signInput, const TokenRef& parsedToken, PublicKey publicKey); + +// Verifies only the signature part of signed token string against its token part, not its content +// Returns a tuple containing signature verification result, +// and an optional containing verification error message if any occurred. +// If the latter value is non-empty, the former value should not be used. +std::pair> verifyToken(StringRef signedToken, PublicKey publicKey); + +} // namespace authz::jwt + +#endif // FDBRPC_TOKEN_SIGN_H diff --git a/src/fdbrpc/include/fdbrpc/TokenSignStdTypes.h b/src/fdbrpc/include/fdbrpc/TokenSignStdTypes.h new file mode 100644 index 0000000..1ed5c5c --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/TokenSignStdTypes.h @@ -0,0 +1,54 @@ +/* + * TokenSignStlTypes.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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 +#ifndef FDBRPC_TOKEN_SIGN_STD_TYPES_H +#define FDBRPC_TOKEN_SIGN_STD_TYPES_H +#include "fdbrpc/TokenSpec.h" +#include +#include + +// Below functions build as a library separate from fdbrpc +// The intent is to re-use the key/token generation part in a way that the input, the output, +// and possible exceptions are all standard types, such that it can be used outside the FDB/Flow world, +// especially for testing and benchmarking purposes + +namespace authz::jwt::stdtypes { + +namespace detail { + +// work around the fact that std::vector takes more than one template parameter +template +using VectorAlias = std::vector; + +} // namespace detail + +using TokenSpec = BasicTokenSpec; + +// Generate an elliptic curve private key on a P-256 curve, and serialize it as PEM. +std::string makeEcP256PrivateKeyPem(); + +// If this function was to take PrivateKey class as parameter, +// users of this library would need to link to flow in order to use it. +// To avoid that, keep the key input as PEM and suffer the parsing overhead. +std::string signToken(const TokenSpec& tokenSpec, const std::string& privateKeyPem); + +} // namespace authz::jwt::stdtypes + +#endif // FDBRPC_TOKEN_SIGN_STD_TYPES_H diff --git a/src/fdbrpc/include/fdbrpc/TokenSpec.h b/src/fdbrpc/include/fdbrpc/TokenSpec.h new file mode 100644 index 0000000..6b1c3f8 --- /dev/null +++ b/src/fdbrpc/include/fdbrpc/TokenSpec.h @@ -0,0 +1,79 @@ +/* + * TokenSpec.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FDBRPC_TOKEN_SPEC_H +#define FDBRPC_TOKEN_SPEC_H +#pragma once + +#include +#include +#include + +namespace authz { + +using TenantId = int64_t; + +enum class Algorithm : int { + RS256, + ES256, + UNKNOWN, +}; + +inline Algorithm algorithmFromString(std::string_view s) noexcept { + if (s == "RS256") + return Algorithm::RS256; + else if (s == "ES256") + return Algorithm::ES256; + else + return Algorithm::UNKNOWN; +} + +} // namespace authz + +namespace authz::jwt { + +// Given S = concat(B64UrlEnc(headerJson), ".", B64UrlEnc(payloadJson)), +// JWT is concat(S, ".", B64UrlEnc(sign(S, PrivateKey))). +// Below we refer to S as "sign input" + +// This struct is not meant to be flatbuffer-serialized +// This is a parsed, flattened view of S and signature + +template class VectorType, template class OptionalType = std::optional> +struct BasicTokenSpec { + // header part ("typ": "JWT" implicitly enforced) + Algorithm algorithm; // alg + StringType keyId; // kid + // payload part + OptionalType issuer; // iss + OptionalType subject; // sub + OptionalType> audience; // aud + OptionalType issuedAtUnixTime; // iat + OptionalType expiresAtUnixTime; // exp + OptionalType notBeforeUnixTime; // nbf + OptionalType tokenId; // jti + OptionalType> tenants; // tenants + // signature part + StringType signature; +}; + +} // namespace authz::jwt + +#endif /*FDBRPC_TOKEN_SPEC_H*/ diff --git a/src/fdbrpc/TraceFileIO.h b/src/fdbrpc/include/fdbrpc/TraceFileIO.h similarity index 100% rename from src/fdbrpc/TraceFileIO.h rename to src/fdbrpc/include/fdbrpc/TraceFileIO.h diff --git a/src/fdbclient/WellKnownEndpoints.h b/src/fdbrpc/include/fdbrpc/WellKnownEndpoints.h similarity index 60% rename from src/fdbclient/WellKnownEndpoints.h rename to src/fdbrpc/include/fdbrpc/WellKnownEndpoints.h index bed5c34..b5d4beb 100644 --- a/src/fdbclient/WellKnownEndpoints.h +++ b/src/fdbrpc/include/fdbrpc/WellKnownEndpoints.h @@ -28,28 +28,29 @@ * All well-known endpoints of FDB must be listed here to guarantee their uniqueness */ enum WellKnownEndpoints { - WLTOKEN_CLIENTLEADERREG_GETLEADER = WLTOKEN_FIRST_AVAILABLE, // 2 - WLTOKEN_CLIENTLEADERREG_OPENDATABASE, // 3 - WLTOKEN_LEADERELECTIONREG_CANDIDACY, // 4 - WLTOKEN_LEADERELECTIONREG_ELECTIONRESULT, // 5 - WLTOKEN_LEADERELECTIONREG_LEADERHEARTBEAT, // 6 - WLTOKEN_LEADERELECTIONREG_FORWARD, // 7 - WLTOKEN_GENERATIONREG_READ, // 8 - WLTOKEN_GENERATIONREG_WRITE, // 9 + WLTOKEN_CLIENTLEADERREG_GETLEADER = WLTOKEN_FIRST_AVAILABLE, // 3 + WLTOKEN_CLIENTLEADERREG_OPENDATABASE, // 4 + WLTOKEN_LEADERELECTIONREG_CANDIDACY, // 5 + WLTOKEN_LEADERELECTIONREG_ELECTIONRESULT, // 6 + WLTOKEN_LEADERELECTIONREG_LEADERHEARTBEAT, // 7 + WLTOKEN_LEADERELECTIONREG_FORWARD, // 8 + WLTOKEN_GENERATIONREG_READ, // 9 WLTOKEN_PROTOCOL_INFO, // 10 : the value of this endpoint should be stable and not change. - WLTOKEN_CLIENTLEADERREG_DESCRIPTOR_MUTABLE, // 11 - WLTOKEN_CONFIGTXN_GETGENERATION, // 12 - WLTOKEN_CONFIGTXN_GET, // 13 - WLTOKEN_CONFIGTXN_GETCLASSES, // 14 - WLTOKEN_CONFIGTXN_GETKNOBS, // 15 - WLTOKEN_CONFIGTXN_COMMIT, // 16 - WLTOKEN_CONFIGFOLLOWER_GETSNAPSHOTANDCHANGES, // 17 - WLTOKEN_CONFIGFOLLOWER_GETCHANGES, // 18 - WLTOKEN_CONFIGFOLLOWER_COMPACT, // 19 - WLTOKEN_CONFIGFOLLOWER_ROLLFORWARD, // 20 - WLTOKEN_CONFIGFOLLOWER_GETCOMMITTEDVERSION, // 21 - WLTOKEN_PROCESS, // 22 - WLTOKEN_RESERVED_COUNT // 23 + WLTOKEN_GENERATIONREG_WRITE, // 11 + WLTOKEN_CLIENTLEADERREG_DESCRIPTOR_MUTABLE, // 12 + WLTOKEN_CONFIGTXN_GETGENERATION, // 13 + WLTOKEN_CONFIGTXN_GET, // 14 + WLTOKEN_CONFIGTXN_GETCLASSES, // 15 + WLTOKEN_CONFIGTXN_GETKNOBS, // 16 + WLTOKEN_CONFIGTXN_COMMIT, // 17 + WLTOKEN_CONFIGFOLLOWER_GETSNAPSHOTANDCHANGES, // 18 + WLTOKEN_CONFIGFOLLOWER_GETCHANGES, // 19 + WLTOKEN_CONFIGFOLLOWER_COMPACT, // 20 + WLTOKEN_CONFIGFOLLOWER_ROLLFORWARD, // 21 + WLTOKEN_CONFIGFOLLOWER_GETCOMMITTEDVERSION, // 22 + WLTOKEN_PROCESS, // 23 + WLTOKEN_CONFIGFOLLOWER_LOCK, // 24 + WLTOKEN_RESERVED_COUNT // 25 }; static_assert(WLTOKEN_PROTOCOL_INFO == diff --git a/src/fdbrpc/fdbrpc.h b/src/fdbrpc/include/fdbrpc/fdbrpc.h similarity index 88% rename from src/fdbrpc/fdbrpc.h rename to src/fdbrpc/include/fdbrpc/fdbrpc.h index b12c41b..13d7a62 100644 --- a/src/fdbrpc/fdbrpc.h +++ b/src/fdbrpc/include/fdbrpc/fdbrpc.h @@ -23,14 +23,21 @@ #pragma once #include "flow/flow.h" +#include "flow/TaskPriority.h" #include "flow/serialize.h" #include "fdbrpc/FlowTransport.h" // NetworkMessageReceiver Endpoint #include "fdbrpc/FailureMonitor.h" #include "fdbrpc/networksender.actor.h" +#include "fdbrpc/simulator.h" -struct FlowReceiver : public NetworkMessageReceiver { - // Common endpoint code for NetSAV<> and NetNotifiedQueue<> +// Common endpoint code for NetSAV<> and NetNotifiedQueue<> +class FlowReceiver : public NetworkMessageReceiver, public NonCopyable { + Optional peerCompatibilityPolicy_; + Endpoint endpoint; + bool m_isLocalEndpoint; + bool m_stream; +protected: FlowReceiver() : m_isLocalEndpoint(false), m_stream(false) {} FlowReceiver(Endpoint const& remoteEndpoint, bool stream) @@ -46,8 +53,17 @@ struct FlowReceiver : public NetworkMessageReceiver { } } - bool isLocalEndpoint() { return m_isLocalEndpoint; } - bool isRemoteEndpoint() { return endpoint.isValid() && !m_isLocalEndpoint; } +public: + bool isLocalEndpoint() const { return m_isLocalEndpoint; } + bool isRemoteEndpoint() const { return endpoint.isValid() && !m_isLocalEndpoint; } + + void setRemoteEndpoint(Endpoint const& remoteEndpoint, bool stream) { + ASSERT(!m_isLocalEndpoint); + ASSERT(!endpoint.isValid()); + endpoint = remoteEndpoint; + m_stream = stream; + FlowTransport::transport().addPeerReference(endpoint, m_stream); + } // If already a remote endpoint, returns that. Otherwise makes this // a local endpoint and returns that. @@ -80,12 +96,6 @@ struct FlowReceiver : public NetworkMessageReceiver { } const Endpoint& getRawEndpoint() { return endpoint; } - -private: - Optional peerCompatibilityPolicy_; - Endpoint endpoint; - bool m_isLocalEndpoint; - bool m_stream; }; template @@ -110,6 +120,8 @@ struct NetSAV final : SAV, FlowReceiver, FastAllocated> { SAV::sendAndDelPromiseRef(message.get().asUnderlyingType()); } } + + bool isPublic() const override { return true; } }; template @@ -130,7 +142,7 @@ class ReplyPromise final : public ComposedIdentifier { sav->addFutureRef(); return Future(sav); } - bool isSet() { return sav->isSet(); } + bool isSet() const { return sav->isSet(); } bool isValid() const { return sav != nullptr; } ReplyPromise() : sav(new NetSAV(0, 1)) {} explicit ReplyPromise(const PeerCompatibilityPolicy& policy) : ReplyPromise() { @@ -172,7 +184,7 @@ class ReplyPromise final : public ComposedIdentifier { sav = nullptr; return ptr; } - explicit ReplyPromise(SAV* ptr) : sav(ptr) {} + explicit ReplyPromise(SAV* ptr) : sav(static_cast*>(ptr)) {} int getFutureReferenceCount() const { return sav->getFutureReferenceCount(); } int getPromiseReferenceCount() const { return sav->getPromiseReferenceCount(); } @@ -290,6 +302,8 @@ struct AcknowledgementReceiver final : FlowReceiver, FastAllocated message; reader.deserialize(message); @@ -337,6 +351,8 @@ struct NetNotifiedQueueWithAcknowledgements final : NotifiedQueue, acknowledgements.failures = tagError(FlowTransport::transport().loadedDisconnect(), operation_obsolete()); } + bool isPublic() const override { return true; } + void destroy() override { delete this; } void receive(ArenaObjectReader& reader) override { this->addPromiseRef(); @@ -357,8 +373,9 @@ struct NetNotifiedQueueWithAcknowledgements final : NotifiedQueue, this->sendError(message.getError()); } else { if (message.get().asUnderlyingType().acknowledgeToken.present()) { - acknowledgements = AcknowledgementReceiver( - FlowTransport::transport().loadedEndpoint(message.get().asUnderlyingType().acknowledgeToken.get())); + acknowledgements.setRemoteEndpoint( + FlowTransport::transport().loadedEndpoint(message.get().asUnderlyingType().acknowledgeToken.get()), + false); if (onConnect.isValid() && onConnect.canBeSet()) { onConnect.send(Void()); } @@ -500,7 +517,7 @@ class ReplyPromiseStream { void setRequestStreamEndpoint(const Endpoint& endpoint) { queue->requestStreamEndpoint = endpoint; } - bool connected() { return queue->acknowledgements.getRawEndpoint().isValid() || queue->error.isValid(); } + bool connected() const { return queue->acknowledgements.getRawEndpoint().isValid() || queue->error.isValid(); } Future onConnected() { if (connected()) { @@ -642,10 +659,29 @@ struct serializable_traits> : std::true_type { } }; +template +struct HasReply_t : std::false_type {}; + template -struct NetNotifiedQueue final : NotifiedQueue, FlowReceiver, FastAllocated> { - using FastAllocated>::operator new; - using FastAllocated>::operator delete; +struct HasReply_t : std::true_type {}; + +template +constexpr bool HasReply = HasReply_t::value; + +template +struct HasVerify_t : std::false_type {}; + +template +struct HasVerify_t().verify()), 0)> : std::true_type {}; + +template +constexpr bool HasVerify = HasVerify_t::value; + +template +struct NetNotifiedQueue final : NotifiedQueue, FlowReceiver, FastAllocated> { + using FastAllocated>::operator new; + using FastAllocated>::operator delete; + static_assert(!IsPublic || HasVerify, "Public request stream objects need to implement bool T::verify()"); NetNotifiedQueue(int futures, int promises) : NotifiedQueue(futures, promises) {} NetNotifiedQueue(int futures, int promises, const Endpoint& remoteEndpoint) @@ -656,13 +692,28 @@ struct NetNotifiedQueue final : NotifiedQueue, FlowReceiver, FastAllocatedaddPromiseRef(); T message; reader.deserialize(message); - this->send(std::move(message)); + if constexpr (IsPublic) { + if (!message.verify()) { + if constexpr (HasReply) { + TraceEvent(SevWarnAlways, "UnauthorizedAccessPrevented"_audit) + .detail("RequestType", typeid(T).name()) + .detail("ClientIP", FlowTransport::transport().currentDeliveryPeerAddress()) + .log(); + message.reply.sendError(permission_denied()); + } + } else { + this->send(std::move(message)); + } + } else { + this->send(std::move(message)); + } this->delPromiseRef(); } bool isStream() const override { return true; } + bool isPublic() const override { return IsPublic; } }; -template +template class RequestStream { public: // stream.send( request ) @@ -689,6 +740,7 @@ class RequestStream { // If cancelled, request was or will be delivered zero or more times. template Future getReply(const X& value) const { + // Ensure the same request isn't used multiple times ASSERT(!getReplyPromise(value).getFuture().isReady()); if (queue->isRemoteEndpoint()) { return sendCanceler(getReplyPromise(value), @@ -726,6 +778,9 @@ class RequestStream { Future disc = makeDependent(IFailureMonitor::failureMonitor()).onDisconnectOrFailure(getEndpoint(taskID)); if (disc.isReady()) { + if (IFailureMonitor::failureMonitor().knownUnauthorized(getEndpoint(taskID))) { + return ErrorOr(unauthorized_attempt()); + } return ErrorOr(request_maybe_delivered()); } Reference peer = @@ -744,6 +799,9 @@ class RequestStream { Future disc = makeDependent(IFailureMonitor::failureMonitor()).onDisconnectOrFailure(getEndpoint()); if (disc.isReady()) { + if (IFailureMonitor::failureMonitor().knownUnauthorized(getEndpoint())) { + return ErrorOr(unauthorized_attempt()); + } return ErrorOr(request_maybe_delivered()); } Reference peer = @@ -769,8 +827,13 @@ class RequestStream { Future disc = makeDependent(IFailureMonitor::failureMonitor()).onDisconnectOrFailure(getEndpoint()); auto& p = getReplyPromiseStream(value); - if (disc.isReady()) { - p.sendError(request_maybe_delivered()); + if (disc.isReady() || + (g_network->isSimulated() && !g_simulator->speedUpSimulation && BUGGIFY_WITH_PROB(0.01))) { + if (disc.isReady() && IFailureMonitor::failureMonitor().knownUnauthorized(getEndpoint())) { + p.sendError(unauthorized_attempt()); + } else { + p.sendError(request_maybe_delivered()); + } } else { Reference peer = FlowTransport::transport().sendUnreliable(SerializeSource(value), getEndpoint(), true); @@ -821,13 +884,13 @@ class RequestStream { return getReplyUnlessFailedFor(ReplyPromise(), sustainedFailureDuration, sustainedFailureSlope); } - explicit RequestStream(const Endpoint& endpoint) : queue(new NetNotifiedQueue(0, 1, endpoint)) {} + explicit RequestStream(const Endpoint& endpoint) : queue(new NetNotifiedQueue(0, 1, endpoint)) {} FutureStream getFuture() const { queue->addFutureRef(); return FutureStream(queue); } - RequestStream() : queue(new NetNotifiedQueue(0, 1)) {} + RequestStream() : queue(new NetNotifiedQueue(0, 1)) {} explicit RequestStream(PeerCompatibilityPolicy policy) : RequestStream() { queue->setPeerCompatibilityPolicy(policy); } @@ -861,8 +924,8 @@ class RequestStream { queue->makeWellKnownEndpoint(Endpoint::Token(-1, wlTokenID), taskID); } - bool operator==(const RequestStream& rhs) const { return queue == rhs.queue; } - bool operator!=(const RequestStream& rhs) const { return !(*this == rhs); } + bool operator==(const RequestStream& rhs) const { return queue == rhs.queue; } + bool operator!=(const RequestStream& rhs) const { return !(*this == rhs); } bool isEmpty() const { return !queue->isReady(); } uint32_t size() const { return queue->size(); } @@ -871,32 +934,37 @@ class RequestStream { } private: - NetNotifiedQueue* queue; + NetNotifiedQueue* queue; }; -template -void save(Ar& ar, const RequestStream& value) { +template +using PrivateRequestStream = RequestStream; +template +using PublicRequestStream = RequestStream; + +template +void save(Ar& ar, const RequestStream& value) { auto const& ep = value.getEndpoint(); ar << ep; UNSTOPPABLE_ASSERT( ep.getPrimaryAddress().isValid()); // No serializing PromiseStreams on a client with no public address } -template -void load(Ar& ar, RequestStream& value) { +template +void load(Ar& ar, RequestStream& value) { Endpoint endpoint; ar >> endpoint; - value = RequestStream(endpoint); + value = RequestStream(endpoint); } -template -struct serializable_traits> : std::true_type { +template +struct serializable_traits> : std::true_type { template - static void serialize(Archiver& ar, RequestStream& stream) { + static void serialize(Archiver& ar, RequestStream& stream) { if constexpr (Archiver::isDeserializing) { Endpoint endpoint; serializer(ar, endpoint); - stream = RequestStream(endpoint); + stream = RequestStream(endpoint); } else { const auto& ep = stream.getEndpoint(); serializer(ar, ep); diff --git a/src/fdbrpc/genericactors.actor.g.h b/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h similarity index 61% rename from src/fdbrpc/genericactors.actor.g.h rename to src/fdbrpc/include/fdbrpc/genericactors.actor.g.h index 97e0cc4..aa1bb5e 100644 --- a/src/fdbrpc/genericactors.actor.g.h +++ b/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" /* * genericactors.actor.h * @@ -30,27 +30,31 @@ #include "flow/genericactors.actor.h" #include "fdbrpc/fdbrpc.h" -#include "fdbclient/WellKnownEndpoints.h" +#include "fdbrpc/WellKnownEndpoints.h" #include "flow/Hostname.h" #include "flow/actorcompiler.h" // This must be the last #include. - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" +// To avoid diretly access INetworkConnection::net()->removeCachedDNS(), which will require heavy include budget, put +// the call to FlowTransport.actor.cpp as a external function. +extern void removeCachedDNS(const std::string& host, const std::string& service); + + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via retryBrokenPromise() - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" -template - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" +template + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class RetryBrokenPromiseActorState { - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - RetryBrokenPromiseActorState(RequestStream const& to,Req const& request) - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + RetryBrokenPromiseActorState(RequestStream const& to,Req const& request) + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : to(to), - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" request(request) - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("retryBrokenPromise", reinterpret_cast(this)); @@ -63,9 +67,9 @@ class RetryBrokenPromiseActorState { int a_body1(int loopDepth=0) { try { - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ; - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -94,16 +98,16 @@ class RetryBrokenPromiseActorState { int a_body1loopBody1(int loopDepth) { try { - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = to.getReply(request); - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -123,26 +127,26 @@ class RetryBrokenPromiseActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (e.code() != error_code_broken_promise) - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" resetReply(request); - #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_1 = delayJittered(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY); - #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -155,9 +159,9 @@ class RetryBrokenPromiseActorState { } int a_body1loopBody1cont2(REPLY_TYPE(Req) const& reply,int loopDepth) { - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(reply); this->~RetryBrokenPromiseActorState(); static_cast(this)->destroy(); return 0; } - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Req) >::value()) REPLY_TYPE(Req)(reply); this->~RetryBrokenPromiseActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -167,9 +171,9 @@ class RetryBrokenPromiseActorState { } int a_body1loopBody1cont2(REPLY_TYPE(Req) && reply,int loopDepth) { - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(reply); this->~RetryBrokenPromiseActorState(); static_cast(this)->destroy(); return 0; } - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Req) >::value()) REPLY_TYPE(Req)(reply); this->~RetryBrokenPromiseActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -242,18 +246,18 @@ class RetryBrokenPromiseActorState { } int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - TEST(true); - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + CODE_PROBE(true, "retryBrokenPromise"); + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - TEST(true); - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + CODE_PROBE(true, "retryBrokenPromise"); + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -321,32 +325,32 @@ class RetryBrokenPromiseActorState { fdb_probe_actor_exit("retryBrokenPromise", reinterpret_cast(this), 1); } - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - RequestStream to; - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + RequestStream to; + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Req request; - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via retryBrokenPromise() - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" -template - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" -class RetryBrokenPromiseActor final : public Actor, public ActorCallback< RetryBrokenPromiseActor, 0, REPLY_TYPE(Req) >, public ActorCallback< RetryBrokenPromiseActor, 1, Void >, public FastAllocated>, public RetryBrokenPromiseActorState> { - #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" +template + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" +class RetryBrokenPromiseActor final : public Actor, public ActorCallback< RetryBrokenPromiseActor, 0, REPLY_TYPE(Req) >, public ActorCallback< RetryBrokenPromiseActor, 1, Void >, public FastAllocated>, public RetryBrokenPromiseActorState> { + #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; + using FastAllocated>::operator new; + using FastAllocated>::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< RetryBrokenPromiseActor, 0, REPLY_TYPE(Req) >; -friend struct ActorCallback< RetryBrokenPromiseActor, 1, Void >; - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - RetryBrokenPromiseActor(RequestStream const& to,Req const& request) - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" +friend struct ActorCallback< RetryBrokenPromiseActor, 0, REPLY_TYPE(Req) >; +friend struct ActorCallback< RetryBrokenPromiseActor, 1, Void >; + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + RetryBrokenPromiseActor(RequestStream const& to,Req const& request) + #line 351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), - RetryBrokenPromiseActorState>(to, request) + RetryBrokenPromiseActorState>(to, request) { fdb_probe_actor_enter("retryBrokenPromise", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -362,43 +366,43 @@ friend struct ActorCallback< RetryBrokenPromiseActor, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< RetryBrokenPromiseActor, 0, REPLY_TYPE(Req) >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< RetryBrokenPromiseActor, 1, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< RetryBrokenPromiseActor, 0, REPLY_TYPE(Req) >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< RetryBrokenPromiseActor, 1, Void >*)0, actor_cancelled()); break; } } }; } - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" -template - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" -[[nodiscard]] Future retryBrokenPromise( RequestStream const& to, Req const& request ) { - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - return Future(new RetryBrokenPromiseActor(to, request)); - #line 378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" +template + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" +[[nodiscard]] Future retryBrokenPromise( RequestStream const& to, Req const& request ) { + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + return Future(new RetryBrokenPromiseActor(to, request)); + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via retryBrokenPromise() - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" -template - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" +template + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class RetryBrokenPromiseActor1State { - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - RetryBrokenPromiseActor1State(RequestStream const& to,Req const& request,TaskPriority const& taskID) - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + RetryBrokenPromiseActor1State(RequestStream const& to,Req const& request,TaskPriority const& taskID) + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : to(to), - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" request(request), - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" taskID(taskID) - #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("retryBrokenPromise", reinterpret_cast(this)); @@ -411,9 +415,9 @@ class RetryBrokenPromiseActor1State { int a_body1(int loopDepth=0) { try { - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ; - #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -442,16 +446,16 @@ class RetryBrokenPromiseActor1State { int a_body1loopBody1(int loopDepth) { try { - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = to.getReply(request, taskID); - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -471,26 +475,26 @@ class RetryBrokenPromiseActor1State { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (e.code() != error_code_broken_promise) - #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" resetReply(request); - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_1 = delayJittered(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY, taskID); - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1Catch1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -503,9 +507,9 @@ class RetryBrokenPromiseActor1State { } int a_body1loopBody1cont2(REPLY_TYPE(Req) const& reply,int loopDepth) { - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(reply); this->~RetryBrokenPromiseActor1State(); static_cast(this)->destroy(); return 0; } - #line 508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Req) >::value()) REPLY_TYPE(Req)(reply); this->~RetryBrokenPromiseActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -515,9 +519,9 @@ class RetryBrokenPromiseActor1State { } int a_body1loopBody1cont2(REPLY_TYPE(Req) && reply,int loopDepth) { - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(reply); this->~RetryBrokenPromiseActor1State(); static_cast(this)->destroy(); return 0; } - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Req) >::value()) REPLY_TYPE(Req)(reply); this->~RetryBrokenPromiseActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -590,18 +594,18 @@ class RetryBrokenPromiseActor1State { } int a_body1loopBody1Catch1cont1(Void const& _,int loopDepth) { - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - TEST(true); - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + CODE_PROBE(true, "retryBrokenPromise with taskID"); + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1Catch1cont1(Void && _,int loopDepth) { - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - TEST(true); - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + CODE_PROBE(true, "retryBrokenPromise with taskID"); + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -669,34 +673,34 @@ class RetryBrokenPromiseActor1State { fdb_probe_actor_exit("retryBrokenPromise", reinterpret_cast(this), 1); } - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - RequestStream to; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + RequestStream to; + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Req request; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" TaskPriority taskID; - #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via retryBrokenPromise() - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" -template - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" -class RetryBrokenPromiseActor1 final : public Actor, public ActorCallback< RetryBrokenPromiseActor1, 0, REPLY_TYPE(Req) >, public ActorCallback< RetryBrokenPromiseActor1, 1, Void >, public FastAllocated>, public RetryBrokenPromiseActor1State> { - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" +template + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" +class RetryBrokenPromiseActor1 final : public Actor, public ActorCallback< RetryBrokenPromiseActor1, 0, REPLY_TYPE(Req) >, public ActorCallback< RetryBrokenPromiseActor1, 1, Void >, public FastAllocated>, public RetryBrokenPromiseActor1State> { + #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - using FastAllocated>::operator new; - using FastAllocated>::operator delete; + using FastAllocated>::operator new; + using FastAllocated>::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< RetryBrokenPromiseActor1, 0, REPLY_TYPE(Req) >; -friend struct ActorCallback< RetryBrokenPromiseActor1, 1, Void >; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - RetryBrokenPromiseActor1(RequestStream const& to,Req const& request,TaskPriority const& taskID) - #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" +friend struct ActorCallback< RetryBrokenPromiseActor1, 0, REPLY_TYPE(Req) >; +friend struct ActorCallback< RetryBrokenPromiseActor1, 1, Void >; + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + RetryBrokenPromiseActor1(RequestStream const& to,Req const& request,TaskPriority const& taskID) + #line 701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), - RetryBrokenPromiseActor1State>(to, request, taskID) + RetryBrokenPromiseActor1State>(to, request, taskID) { fdb_probe_actor_enter("retryBrokenPromise", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -712,43 +716,43 @@ friend struct ActorCallback< RetryBrokenPromiseActor1, 1, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< RetryBrokenPromiseActor1, 0, REPLY_TYPE(Req) >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< RetryBrokenPromiseActor1, 1, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< RetryBrokenPromiseActor1, 0, REPLY_TYPE(Req) >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< RetryBrokenPromiseActor1, 1, Void >*)0, actor_cancelled()); break; } } }; } - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" -template - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" -[[nodiscard]] Future retryBrokenPromise( RequestStream const& to, Req const& request, TaskPriority const& taskID ) { - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - return Future(new RetryBrokenPromiseActor1(to, request, taskID)); - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" +template + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" +[[nodiscard]] Future retryBrokenPromise( RequestStream const& to, Req const& request, TaskPriority const& taskID ) { + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + return Future(new RetryBrokenPromiseActor1(to, request, taskID)); + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via tryInitializeRequestStream() - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class TryInitializeRequestStreamActorState { - #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" TryInitializeRequestStreamActorState(RequestStream* const& stream,Hostname const& hostname,WellKnownEndpoints const& token) - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : stream(stream), - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" hostname(hostname), - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" token(token) - #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("tryInitializeRequestStream", reinterpret_cast(this)); @@ -761,16 +765,16 @@ class TryInitializeRequestStreamActorState { int a_body1(int loopDepth=0) { try { - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture> __when_expr_0 = hostname.resolve(); - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -791,25 +795,25 @@ class TryInitializeRequestStreamActorState { } int a_body1cont1(Optional const& address,int loopDepth) { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!address.present()) - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TryInitializeRequestStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TryInitializeRequestStreamActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ASSERT(stream != nullptr); - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" *stream = RequestStream(Endpoint::wellKnown({ address.get() }, token)); - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TryInitializeRequestStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TryInitializeRequestStreamActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -819,25 +823,25 @@ class TryInitializeRequestStreamActorState { } int a_body1cont1(Optional && address,int loopDepth) { - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!address.present()) - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TryInitializeRequestStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TryInitializeRequestStreamActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ASSERT(stream != nullptr); - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" *stream = RequestStream(Endpoint::wellKnown({ address.get() }, token)); - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TryInitializeRequestStreamActorState(); static_cast(this)->destroy(); return 0; } - #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TryInitializeRequestStreamActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -908,20 +912,20 @@ class TryInitializeRequestStreamActorState { fdb_probe_actor_exit("tryInitializeRequestStream", reinterpret_cast(this), 0); } - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" RequestStream* stream; - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Hostname hostname; - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" WellKnownEndpoints token; - #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via tryInitializeRequestStream() - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class TryInitializeRequestStreamActor final : public Actor, public ActorCallback< TryInitializeRequestStreamActor, 0, Optional >, public FastAllocated>, public TryInitializeRequestStreamActorState> { - #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -930,9 +934,9 @@ class TryInitializeRequestStreamActor final : public Actor, public ActorCa void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< TryInitializeRequestStreamActor, 0, Optional >; - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" TryInitializeRequestStreamActor(RequestStream* const& stream,Hostname const& hostname,WellKnownEndpoints const& token) - #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), TryInitializeRequestStreamActorState>(stream, hostname, token) { @@ -956,36 +960,36 @@ friend struct ActorCallback< TryInitializeRequestStreamActor, 0, Optional - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" [[nodiscard]] Future tryInitializeRequestStream( RequestStream* const& stream, Hostname const& hostname, WellKnownEndpoints const& token ) { - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return Future(new TryInitializeRequestStreamActor(stream, hostname, token)); - #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via tryGetReplyFromHostname() - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class TryGetReplyFromHostnameActorState { - #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" TryGetReplyFromHostnameActorState(Req const& request,Hostname const& hostname,WellKnownEndpoints const& token) - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : request(request), - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" hostname(hostname), - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" token(token) - #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("tryGetReplyFromHostname", reinterpret_cast(this)); @@ -998,16 +1002,16 @@ class TryGetReplyFromHostnameActorState { int a_body1(int loopDepth=0) { try { - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture> __when_expr_0 = hostname.resolve(); - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1005 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -1028,60 +1032,60 @@ class TryGetReplyFromHostnameActorState { } int a_body1cont1(Optional const& address,int loopDepth) { - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!address.present()) - #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(ErrorOr(lookup_failed())); this->~TryGetReplyFromHostnameActorState(); static_cast(this)->destroy(); return 0; } - #line 1037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< ErrorOr >::value()) ErrorOr(ErrorOr(lookup_failed())); this->~TryGetReplyFromHostnameActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" RequestStream to(Endpoint::wellKnown({ address.get() }, token)); - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture> __when_expr_1 = to.tryGetReply(request); - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1cont1(Optional && address,int loopDepth) { - #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!address.present()) - #line 1063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(ErrorOr(lookup_failed())); this->~TryGetReplyFromHostnameActorState(); static_cast(this)->destroy(); return 0; } - #line 1067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< ErrorOr >::value()) ErrorOr(ErrorOr(lookup_failed())); this->~TryGetReplyFromHostnameActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" RequestStream to(Endpoint::wellKnown({ address.get() }, token)); - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture> __when_expr_1 = to.tryGetReply(request); - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; return loopDepth; @@ -1151,24 +1155,24 @@ class TryGetReplyFromHostnameActorState { } int a_body1cont2(int loopDepth) { - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (reply.isError()) - #line 1156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" resetReply(request); - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (reply.getError().code() == error_code_request_maybe_delivered) - #line 1162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - INetworkConnections::net()->removeCachedDNS(hostname.host, hostname.service); - #line 1166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + removeCachedDNS(hostname.host, hostname.service); + #line 1170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } } - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(reply); this->~TryGetReplyFromHostnameActorState(); static_cast(this)->destroy(); return 0; } - #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< ErrorOr >::value()) ErrorOr(std::move(reply)); // state_var_RVO this->~TryGetReplyFromHostnameActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1178,9 +1182,9 @@ class TryGetReplyFromHostnameActorState { } int a_body1cont1when1(ErrorOr const& __reply,int loopDepth) { - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" reply = __reply; - #line 1183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -1243,22 +1247,22 @@ class TryGetReplyFromHostnameActorState { fdb_probe_actor_exit("tryGetReplyFromHostname", reinterpret_cast(this), 1); } - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Req request; - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Hostname hostname; - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" WellKnownEndpoints token; - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ErrorOr reply; - #line 1254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via tryGetReplyFromHostname() - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class TryGetReplyFromHostnameActor final : public Actor>, public ActorCallback< TryGetReplyFromHostnameActor, 0, Optional >, public ActorCallback< TryGetReplyFromHostnameActor, 1, ErrorOr >, public FastAllocated>, public TryGetReplyFromHostnameActorState> { - #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -1268,9 +1272,9 @@ class TryGetReplyFromHostnameActor final : public Actor #pragma clang diagnostic pop friend struct ActorCallback< TryGetReplyFromHostnameActor, 0, Optional >; friend struct ActorCallback< TryGetReplyFromHostnameActor, 1, ErrorOr >; - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" TryGetReplyFromHostnameActor(Req const& request,Hostname const& hostname,WellKnownEndpoints const& token) - #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor>(), TryGetReplyFromHostnameActorState>(request, hostname, token) { @@ -1295,38 +1299,38 @@ friend struct ActorCallback< TryGetReplyFromHostnameActor, 1, ErrorOr - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" [[nodiscard]] Future> tryGetReplyFromHostname( Req const& request, Hostname const& hostname, WellKnownEndpoints const& token ) { - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return Future>(new TryGetReplyFromHostnameActor(request, hostname, token)); - #line 1304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via tryGetReplyFromHostname() - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class TryGetReplyFromHostnameActor1State { - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" TryGetReplyFromHostnameActor1State(Req const& request,Hostname const& hostname,WellKnownEndpoints const& token,TaskPriority const& taskID) - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : request(request), - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" hostname(hostname), - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" token(token), - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" taskID(taskID) - #line 1329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("tryGetReplyFromHostname", reinterpret_cast(this)); @@ -1339,16 +1343,16 @@ class TryGetReplyFromHostnameActor1State { int a_body1(int loopDepth=0) { try { - #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture> __when_expr_0 = hostname.resolve(); - #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -1369,60 +1373,60 @@ class TryGetReplyFromHostnameActor1State { } int a_body1cont1(Optional const& address,int loopDepth) { - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!address.present()) - #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(ErrorOr(lookup_failed())); this->~TryGetReplyFromHostnameActor1State(); static_cast(this)->destroy(); return 0; } - #line 1378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< ErrorOr >::value()) ErrorOr(ErrorOr(lookup_failed())); this->~TryGetReplyFromHostnameActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" RequestStream to(Endpoint::wellKnown({ address.get() }, token)); - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture> __when_expr_1 = to.tryGetReply(request, taskID); - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1cont1(Optional && address,int loopDepth) { - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!address.present()) - #line 1404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(ErrorOr(lookup_failed())); this->~TryGetReplyFromHostnameActor1State(); static_cast(this)->destroy(); return 0; } - #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< ErrorOr >::value()) ErrorOr(ErrorOr(lookup_failed())); this->~TryGetReplyFromHostnameActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" RequestStream to(Endpoint::wellKnown({ address.get() }, token)); - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture> __when_expr_1 = to.tryGetReply(request, taskID); - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; return loopDepth; @@ -1492,24 +1496,24 @@ class TryGetReplyFromHostnameActor1State { } int a_body1cont2(int loopDepth) { - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (reply.isError()) - #line 1497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" resetReply(request); - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (reply.getError().code() == error_code_request_maybe_delivered) - #line 1503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - INetworkConnections::net()->removeCachedDNS(hostname.host, hostname.service); - #line 1507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + removeCachedDNS(hostname.host, hostname.service); + #line 1511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } } - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(reply); this->~TryGetReplyFromHostnameActor1State(); static_cast(this)->destroy(); return 0; } - #line 1512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< ErrorOr >::value()) ErrorOr(std::move(reply)); // state_var_RVO this->~TryGetReplyFromHostnameActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1519,9 +1523,9 @@ class TryGetReplyFromHostnameActor1State { } int a_body1cont1when1(ErrorOr const& __reply,int loopDepth) { - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" reply = __reply; - #line 1524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -1584,24 +1588,24 @@ class TryGetReplyFromHostnameActor1State { fdb_probe_actor_exit("tryGetReplyFromHostname", reinterpret_cast(this), 1); } - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Req request; - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Hostname hostname; - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" WellKnownEndpoints token; - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" TaskPriority taskID; - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ErrorOr reply; - #line 1597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via tryGetReplyFromHostname() - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class TryGetReplyFromHostnameActor1 final : public Actor>, public ActorCallback< TryGetReplyFromHostnameActor1, 0, Optional >, public ActorCallback< TryGetReplyFromHostnameActor1, 1, ErrorOr >, public FastAllocated>, public TryGetReplyFromHostnameActor1State> { - #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -1611,9 +1615,9 @@ class TryGetReplyFromHostnameActor1 final : public Actor, 0, Optional >; friend struct ActorCallback< TryGetReplyFromHostnameActor1, 1, ErrorOr >; - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" TryGetReplyFromHostnameActor1(Req const& request,Hostname const& hostname,WellKnownEndpoints const& token,TaskPriority const& taskID) - #line 1616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor>(), TryGetReplyFromHostnameActor1State>(request, hostname, token, taskID) { @@ -1638,40 +1642,40 @@ friend struct ActorCallback< TryGetReplyFromHostnameActor1, 1, ErrorOr - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" [[nodiscard]] Future> tryGetReplyFromHostname( Req const& request, Hostname const& hostname, WellKnownEndpoints const& token, TaskPriority const& taskID ) { - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return Future>(new TryGetReplyFromHostnameActor1(request, hostname, token, taskID)); - #line 1647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 1652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via retryGetReplyFromHostname() - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class RetryGetReplyFromHostnameActorState { - #line 1659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" RetryGetReplyFromHostnameActorState(Req const& request,Hostname const& hostname,WellKnownEndpoints const& token) - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : request(request), - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" hostname(hostname), - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" token(token), - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - reconnetInterval(FLOW_KNOBS->HOSTNAME_RECONNECT_INIT_INTERVAL), - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + reconnectInterval(FLOW_KNOBS->HOSTNAME_RECONNECT_INIT_INTERVAL), + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" to() - #line 1674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("retryGetReplyFromHostname", reinterpret_cast(this)); @@ -1684,9 +1688,9 @@ class RetryGetReplyFromHostnameActorState { int a_body1(int loopDepth=0) { try { - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ; - #line 1689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1714,64 +1718,64 @@ class RetryGetReplyFromHostnameActorState { } int a_body1loopBody1(int loopDepth) { - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = hostname.resolveWithRetry(); - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(NetworkAddress const& address,int loopDepth) { - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (to == nullptr || to->getEndpoint().getPrimaryAddress() != address) - #line 1735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" to = std::make_unique>(Endpoint::wellKnown({ address }, token)); - #line 1739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture> __when_expr_1 = to->tryGetReply(request); - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(NetworkAddress && address,int loopDepth) { - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (to == nullptr || to->getEndpoint().getPrimaryAddress() != address) - #line 1759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" to = std::make_unique>(Endpoint::wellKnown({ address }, token)); - #line 1763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture> __when_expr_1 = to->tryGetReply(request); - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; return loopDepth; @@ -1841,40 +1845,40 @@ class RetryGetReplyFromHostnameActorState { } int a_body1loopBody1cont2(int loopDepth) { - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (reply.isError()) - #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" resetReply(request); - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (reply.getError().code() == error_code_request_maybe_delivered) - #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - StrictFuture __when_expr_2 = delay(reconnetInterval); - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + StrictFuture __when_expr_2 = delay(reconnectInterval); + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } else { - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return a_body1Catch1(reply.getError(), std::max(0, loopDepth - 1)); - #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } } else { - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(reply.get()); this->~RetryGetReplyFromHostnameActorState(); static_cast(this)->destroy(); return 0; } - #line 1877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Req) >::value()) REPLY_TYPE(Req)(reply.get()); this->~RetryGetReplyFromHostnameActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1885,9 +1889,9 @@ class RetryGetReplyFromHostnameActorState { } int a_body1loopBody1cont1when1(ErrorOr const& __reply,int loopDepth) { - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" reply = __reply; - #line 1890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 1894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; @@ -1964,22 +1968,22 @@ class RetryGetReplyFromHostnameActorState { } int a_body1loopBody1cont6(Void const& _,int loopDepth) { - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - reconnetInterval = std::min(2 * reconnetInterval, FLOW_KNOBS->HOSTNAME_RECONNECT_MAX_INTERVAL); - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - INetworkConnections::net()->removeCachedDNS(hostname.host, hostname.service); - #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + reconnectInterval = std::min(2 * reconnectInterval, FLOW_KNOBS->HOSTNAME_RECONNECT_MAX_INTERVAL); + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + removeCachedDNS(hostname.host, hostname.service); + #line 1975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; } int a_body1loopBody1cont6(Void && _,int loopDepth) { - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - reconnetInterval = std::min(2 * reconnetInterval, FLOW_KNOBS->HOSTNAME_RECONNECT_MAX_INTERVAL); - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - INetworkConnections::net()->removeCachedDNS(hostname.host, hostname.service); - #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + reconnectInterval = std::min(2 * reconnectInterval, FLOW_KNOBS->HOSTNAME_RECONNECT_MAX_INTERVAL); + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + removeCachedDNS(hostname.host, hostname.service); + #line 1986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; @@ -2047,26 +2051,26 @@ class RetryGetReplyFromHostnameActorState { fdb_probe_actor_exit("retryGetReplyFromHostname", reinterpret_cast(this), 2); } - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Req request; - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Hostname hostname; - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" WellKnownEndpoints token; - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - double reconnetInterval; - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + double reconnectInterval; + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" std::unique_ptr> to; - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ErrorOr reply; - #line 2062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via retryGetReplyFromHostname() - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class RetryGetReplyFromHostnameActor final : public Actor, public ActorCallback< RetryGetReplyFromHostnameActor, 0, NetworkAddress >, public ActorCallback< RetryGetReplyFromHostnameActor, 1, ErrorOr >, public ActorCallback< RetryGetReplyFromHostnameActor, 2, Void >, public FastAllocated>, public RetryGetReplyFromHostnameActorState> { - #line 2069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -2077,9 +2081,9 @@ class RetryGetReplyFromHostnameActor final : public Actor, publ friend struct ActorCallback< RetryGetReplyFromHostnameActor, 0, NetworkAddress >; friend struct ActorCallback< RetryGetReplyFromHostnameActor, 1, ErrorOr >; friend struct ActorCallback< RetryGetReplyFromHostnameActor, 2, Void >; - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" RetryGetReplyFromHostnameActor(Req const& request,Hostname const& hostname,WellKnownEndpoints const& token) - #line 2082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), RetryGetReplyFromHostnameActorState>(request, hostname, token) { @@ -2105,42 +2109,42 @@ friend struct ActorCallback< RetryGetReplyFromHostnameActor, 2, Void >; } }; } - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" [[nodiscard]] Future retryGetReplyFromHostname( Req const& request, Hostname const& hostname, WellKnownEndpoints const& token ) { - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return Future(new RetryGetReplyFromHostnameActor(request, hostname, token)); - #line 2114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 2119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via retryGetReplyFromHostname() - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class RetryGetReplyFromHostnameActor1State { - #line 2126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" RetryGetReplyFromHostnameActor1State(Req const& request,Hostname const& hostname,WellKnownEndpoints const& token,TaskPriority const& taskID) - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : request(request), - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" hostname(hostname), - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" token(token), - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" taskID(taskID), - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - reconnetInterval(FLOW_KNOBS->HOSTNAME_RECONNECT_INIT_INTERVAL), - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + reconnectInitInterval(FLOW_KNOBS->HOSTNAME_RECONNECT_INIT_INTERVAL), + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" to() - #line 2143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("retryGetReplyFromHostname", reinterpret_cast(this)); @@ -2153,9 +2157,9 @@ class RetryGetReplyFromHostnameActor1State { int a_body1(int loopDepth=0) { try { - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ; - #line 2158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2183,64 +2187,64 @@ class RetryGetReplyFromHostnameActor1State { } int a_body1loopBody1(int loopDepth) { - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = hostname.resolveWithRetry(); - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(NetworkAddress const& address,int loopDepth) { - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (to == nullptr || to->getEndpoint().getPrimaryAddress() != address) - #line 2204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" to = std::make_unique>(Endpoint::wellKnown({ address }, token)); - #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture> __when_expr_1 = to->tryGetReply(request, taskID); - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(NetworkAddress && address,int loopDepth) { - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (to == nullptr || to->getEndpoint().getPrimaryAddress() != address) - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" to = std::make_unique>(Endpoint::wellKnown({ address }, token)); - #line 2232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture> __when_expr_1 = to->tryGetReply(request, taskID); - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; return loopDepth; @@ -2310,40 +2314,40 @@ class RetryGetReplyFromHostnameActor1State { } int a_body1loopBody1cont2(int loopDepth) { - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (reply.isError()) - #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" resetReply(request); - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (reply.getError().code() == error_code_request_maybe_delivered) - #line 2321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - StrictFuture __when_expr_2 = delay(reconnetInterval); - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + StrictFuture __when_expr_2 = delay(reconnectInitInterval); + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } else { - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return a_body1Catch1(reply.getError(), std::max(0, loopDepth - 1)); - #line 2339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } } else { - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(reply.get()); this->~RetryGetReplyFromHostnameActor1State(); static_cast(this)->destroy(); return 0; } - #line 2346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< REPLY_TYPE(Req) >::value()) REPLY_TYPE(Req)(reply.get()); this->~RetryGetReplyFromHostnameActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2354,9 +2358,9 @@ class RetryGetReplyFromHostnameActor1State { } int a_body1loopBody1cont1when1(ErrorOr const& __reply,int loopDepth) { - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" reply = __reply; - #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopBody1cont2(loopDepth); return loopDepth; @@ -2433,22 +2437,22 @@ class RetryGetReplyFromHostnameActor1State { } int a_body1loopBody1cont6(Void const& _,int loopDepth) { - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - reconnetInterval = std::min(2 * reconnetInterval, FLOW_KNOBS->HOSTNAME_RECONNECT_MAX_INTERVAL); - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - INetworkConnections::net()->removeCachedDNS(hostname.host, hostname.service); - #line 2440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + reconnectInitInterval = std::min(2 * reconnectInitInterval, FLOW_KNOBS->HOSTNAME_RECONNECT_MAX_INTERVAL); + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + removeCachedDNS(hostname.host, hostname.service); + #line 2444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; } int a_body1loopBody1cont6(Void && _,int loopDepth) { - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - reconnetInterval = std::min(2 * reconnetInterval, FLOW_KNOBS->HOSTNAME_RECONNECT_MAX_INTERVAL); - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - INetworkConnections::net()->removeCachedDNS(hostname.host, hostname.service); - #line 2451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + reconnectInitInterval = std::min(2 * reconnectInitInterval, FLOW_KNOBS->HOSTNAME_RECONNECT_MAX_INTERVAL); + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + removeCachedDNS(hostname.host, hostname.service); + #line 2455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; @@ -2516,28 +2520,28 @@ class RetryGetReplyFromHostnameActor1State { fdb_probe_actor_exit("retryGetReplyFromHostname", reinterpret_cast(this), 2); } - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Req request; - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Hostname hostname; - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" WellKnownEndpoints token; - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" TaskPriority taskID; - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - double reconnetInterval; - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + double reconnectInitInterval; + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" std::unique_ptr> to; - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ErrorOr reply; - #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via retryGetReplyFromHostname() - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class RetryGetReplyFromHostnameActor1 final : public Actor, public ActorCallback< RetryGetReplyFromHostnameActor1, 0, NetworkAddress >, public ActorCallback< RetryGetReplyFromHostnameActor1, 1, ErrorOr >, public ActorCallback< RetryGetReplyFromHostnameActor1, 2, Void >, public FastAllocated>, public RetryGetReplyFromHostnameActor1State> { - #line 2540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -2548,9 +2552,9 @@ class RetryGetReplyFromHostnameActor1 final : public Actor, pub friend struct ActorCallback< RetryGetReplyFromHostnameActor1, 0, NetworkAddress >; friend struct ActorCallback< RetryGetReplyFromHostnameActor1, 1, ErrorOr >; friend struct ActorCallback< RetryGetReplyFromHostnameActor1, 2, Void >; - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" RetryGetReplyFromHostnameActor1(Req const& request,Hostname const& hostname,WellKnownEndpoints const& token,TaskPriority const& taskID) - #line 2553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), RetryGetReplyFromHostnameActor1State>(request, hostname, token, taskID) { @@ -2576,38 +2580,38 @@ friend struct ActorCallback< RetryGetReplyFromHostnameActor1, 2, Void >; } }; } - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" [[nodiscard]] Future retryGetReplyFromHostname( Req const& request, Hostname const& hostname, WellKnownEndpoints const& token, TaskPriority const& taskID ) { - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return Future(new RetryGetReplyFromHostnameActor1(request, hostname, token, taskID)); - #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 2590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via timeoutWarning() - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class TimeoutWarningActorState { - #line 2597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" TimeoutWarningActorState(Future const& what,double const& time,PromiseStream const& output) - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : what(what), - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" time(time), - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output(output), - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" end(delay(time)) - #line 2610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("timeoutWarning", reinterpret_cast(this)); @@ -2620,9 +2624,9 @@ class TimeoutWarningActorState { int a_body1(int loopDepth=0) { try { - #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ; - #line 2625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2650,22 +2654,22 @@ class TimeoutWarningActorState { } int a_body1loopBody1(int loopDepth) { - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = what; - #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_1 = end; - #line 2661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; return loopDepth; @@ -2678,9 +2682,9 @@ class TimeoutWarningActorState { } int a_body1loopBody1when1(T const& t,int loopDepth) { - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(t); this->~TimeoutWarningActorState(); static_cast(this)->destroy(); return 0; } - #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< T >::value()) T(t); this->~TimeoutWarningActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2690,9 +2694,9 @@ class TimeoutWarningActorState { } int a_body1loopBody1when1(T && t,int loopDepth) { - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(t); this->~TimeoutWarningActorState(); static_cast(this)->destroy(); return 0; } - #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< T >::value()) T(t); this->~TimeoutWarningActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2702,22 +2706,22 @@ class TimeoutWarningActorState { } int a_body1loopBody1when2(Void const& _,int loopDepth) { - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output.send(Void()); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" end = delay(time); - #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1when2(Void && _,int loopDepth) { - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output.send(Void()); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" end = delay(time); - #line 2720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -2819,22 +2823,22 @@ class TimeoutWarningActorState { fdb_probe_actor_exit("timeoutWarning", reinterpret_cast(this), 1); } - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Future what; - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" double time; - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" PromiseStream output; - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Future end; - #line 2830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via timeoutWarning() - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class TimeoutWarningActor final : public Actor, public ActorCallback< TimeoutWarningActor, 0, T >, public ActorCallback< TimeoutWarningActor, 1, Void >, public FastAllocated>, public TimeoutWarningActorState> { - #line 2837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -2844,9 +2848,9 @@ class TimeoutWarningActor final : public Actor, public ActorCallback< Timeout #pragma clang diagnostic pop friend struct ActorCallback< TimeoutWarningActor, 0, T >; friend struct ActorCallback< TimeoutWarningActor, 1, Void >; - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" TimeoutWarningActor(Future const& what,double const& time,PromiseStream const& output) - #line 2849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), TimeoutWarningActorState>(what, time, output) { @@ -2870,34 +2874,34 @@ friend struct ActorCallback< TimeoutWarningActor, 1, Void >; } }; } - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" [[nodiscard]] Future timeoutWarning( Future const& what, double const& time, PromiseStream const& output ) { - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return Future(new TimeoutWarningActor(what, time, output)); - #line 2879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 2884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via forwardPromise() - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class ForwardPromiseActorState { - #line 2891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ForwardPromiseActorState(Promise const& output,Future const& input) - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : output(output), - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" input(input) - #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("forwardPromise", reinterpret_cast(this)); @@ -2911,15 +2915,15 @@ class ForwardPromiseActorState { { try { try { - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = input; - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 2918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" static_cast(this)->actor_wait_state = 1; - #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -2952,9 +2956,9 @@ class ForwardPromiseActorState { int a_body1Catch2(const Error& err,int loopDepth=0) { try { - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output.sendError(err); - #line 2957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont1(loopDepth); } catch (Error& error) { @@ -2967,18 +2971,18 @@ class ForwardPromiseActorState { } int a_body1cont2(T const& value,int loopDepth) { - #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output.send(value); - #line 2972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont4(loopDepth); return loopDepth; } int a_body1cont2(T && value,int loopDepth) { - #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output.send(value); - #line 2981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 2985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont4(loopDepth); return loopDepth; @@ -3061,25 +3065,25 @@ class ForwardPromiseActorState { } int a_body1cont5(int loopDepth) { - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" delete static_cast(this); - #line 3066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" return 0; return loopDepth; } - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Promise output; - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Future input; - #line 3075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via forwardPromise() - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class ForwardPromiseActor final : public Actor, public ActorCallback< ForwardPromiseActor, 0, T >, public FastAllocated>, public ForwardPromiseActorState> { - #line 3082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -3088,9 +3092,9 @@ class ForwardPromiseActor final : public Actor, public ActorCallback< Forw void destroy() {{ ((Actor*)this)->~Actor(); operator delete(this); }} #pragma clang diagnostic pop friend struct ActorCallback< ForwardPromiseActor, 0, T >; - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ForwardPromiseActor(Promise const& output,Future const& input) - #line 3093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), ForwardPromiseActorState>(output, input) { @@ -3105,34 +3109,34 @@ friend struct ActorCallback< ForwardPromiseActor, 0, T >; } }; } - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" void forwardPromise( Promise const& output, Future const& input ) { - #line 206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" new ForwardPromiseActor(output, input); - #line 3114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 3119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via forwardPromise() - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class ForwardPromiseActor1State { - #line 3126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ForwardPromiseActor1State(ReplyPromise const& output,Future const& input) - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : output(output), - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" input(input) - #line 3135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("forwardPromise", reinterpret_cast(this)); @@ -3146,15 +3150,15 @@ class ForwardPromiseActor1State { { try { try { - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = input; - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 3153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" static_cast(this)->actor_wait_state = 1; - #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -3187,9 +3191,9 @@ class ForwardPromiseActor1State { int a_body1Catch2(const Error& err,int loopDepth=0) { try { - #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output.sendError(err); - #line 3192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont1(loopDepth); } catch (Error& error) { @@ -3202,18 +3206,18 @@ class ForwardPromiseActor1State { } int a_body1cont2(T const& value,int loopDepth) { - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output.send(value); - #line 3207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont4(loopDepth); return loopDepth; } int a_body1cont2(T && value,int loopDepth) { - #line 220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output.send(value); - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont4(loopDepth); return loopDepth; @@ -3296,25 +3300,25 @@ class ForwardPromiseActor1State { } int a_body1cont5(int loopDepth) { - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" delete static_cast(this); - #line 3301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" return 0; return loopDepth; } - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ReplyPromise output; - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Future input; - #line 3310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via forwardPromise() - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class ForwardPromiseActor1 final : public Actor, public ActorCallback< ForwardPromiseActor1, 0, T >, public FastAllocated>, public ForwardPromiseActor1State> { - #line 3317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -3323,9 +3327,9 @@ class ForwardPromiseActor1 final : public Actor, public ActorCallback< For void destroy() {{ ((Actor*)this)->~Actor(); operator delete(this); }} #pragma clang diagnostic pop friend struct ActorCallback< ForwardPromiseActor1, 0, T >; - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ForwardPromiseActor1(ReplyPromise const& output,Future const& input) - #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), ForwardPromiseActor1State>(output, input) { @@ -3340,34 +3344,34 @@ friend struct ActorCallback< ForwardPromiseActor1, 0, T >; } }; } - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" void forwardPromise( ReplyPromise const& output, Future const& input ) { - #line 216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" new ForwardPromiseActor1(output, input); - #line 3349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 3354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via forwardPromise() - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class ForwardPromiseActor2State { - #line 3361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ForwardPromiseActor2State(PromiseStream const& output,Future const& input) - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : output(output), - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" input(input) - #line 3370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("forwardPromise", reinterpret_cast(this)); @@ -3381,15 +3385,15 @@ class ForwardPromiseActor2State { { try { try { - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = input; - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 3388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" static_cast(this)->actor_wait_state = 1; - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -3422,9 +3426,9 @@ class ForwardPromiseActor2State { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output.sendError(e); - #line 3427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont1(loopDepth); } catch (Error& error) { @@ -3437,18 +3441,18 @@ class ForwardPromiseActor2State { } int a_body1cont2(T const& value,int loopDepth) { - #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output.send(value); - #line 3442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont4(loopDepth); return loopDepth; } int a_body1cont2(T && value,int loopDepth) { - #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output.send(value); - #line 3451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont4(loopDepth); return loopDepth; @@ -3531,25 +3535,25 @@ class ForwardPromiseActor2State { } int a_body1cont5(int loopDepth) { - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" delete static_cast(this); - #line 3536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" return 0; return loopDepth; } - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" PromiseStream output; - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Future input; - #line 3545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via forwardPromise() - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class ForwardPromiseActor2 final : public Actor, public ActorCallback< ForwardPromiseActor2, 0, T >, public FastAllocated>, public ForwardPromiseActor2State> { - #line 3552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -3558,9 +3562,9 @@ class ForwardPromiseActor2 final : public Actor, public ActorCallback< For void destroy() {{ ((Actor*)this)->~Actor(); operator delete(this); }} #pragma clang diagnostic pop friend struct ActorCallback< ForwardPromiseActor2, 0, T >; - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ForwardPromiseActor2(PromiseStream const& output,Future const& input) - #line 3563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), ForwardPromiseActor2State>(output, input) { @@ -3575,34 +3579,34 @@ friend struct ActorCallback< ForwardPromiseActor2, 0, T >; } }; } - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" void forwardPromise( PromiseStream const& output, Future const& input ) { - #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" new ForwardPromiseActor2(output, input); - #line 3584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 3589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via broadcast() - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class BroadcastActorState { - #line 3596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" BroadcastActorState(Future const& input,std::vector> const& output) - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : input(input), - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output(output) - #line 3605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("broadcast", reinterpret_cast(this)); @@ -3615,16 +3619,16 @@ class BroadcastActorState { int a_body1(int loopDepth=0) { try { - #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = input; - #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -3645,15 +3649,15 @@ class BroadcastActorState { } int a_body1cont1(T const& value,int loopDepth) { - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" for(int i = 0;i < output.size();i++) { - #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output[i].send(value); - #line 3652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } - #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~BroadcastActorState(); static_cast(this)->destroy(); return 0; } - #line 3656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~BroadcastActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3663,15 +3667,15 @@ class BroadcastActorState { } int a_body1cont1(T && value,int loopDepth) { - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" for(int i = 0;i < output.size();i++) { - #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output[i].send(value); - #line 3670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } - #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~BroadcastActorState(); static_cast(this)->destroy(); return 0; } - #line 3674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~BroadcastActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3742,18 +3746,18 @@ class BroadcastActorState { fdb_probe_actor_exit("broadcast", reinterpret_cast(this), 0); } - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Future input; - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" std::vector> output; - #line 3749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via broadcast() - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class BroadcastActor final : public Actor, public ActorCallback< BroadcastActor, 0, T >, public FastAllocated>, public BroadcastActorState> { - #line 3756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -3762,9 +3766,9 @@ class BroadcastActor final : public Actor, public ActorCallback< Broadcast void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< BroadcastActor, 0, T >; - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" BroadcastActor(Future const& input,std::vector> const& output) - #line 3767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), BroadcastActorState>(input, output) { @@ -3788,34 +3792,34 @@ friend struct ActorCallback< BroadcastActor, 0, T >; } }; } - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" [[nodiscard]] Future broadcast( Future const& input, std::vector> const& output ) { - #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return Future(new BroadcastActor(input, output)); - #line 3797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 3802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via broadcast() - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class BroadcastActor1State { - #line 3809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" BroadcastActor1State(Future const& input,std::vector> const& output) - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : input(input), - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output(output) - #line 3818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("broadcast", reinterpret_cast(this)); @@ -3828,16 +3832,16 @@ class BroadcastActor1State { int a_body1(int loopDepth=0) { try { - #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = input; - #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -3858,15 +3862,15 @@ class BroadcastActor1State { } int a_body1cont1(T const& value,int loopDepth) { - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" for(int i = 0;i < output.size();i++) { - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output[i].send(value); - #line 3865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~BroadcastActor1State(); static_cast(this)->destroy(); return 0; } - #line 3869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~BroadcastActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3876,15 +3880,15 @@ class BroadcastActor1State { } int a_body1cont1(T && value,int loopDepth) { - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" for(int i = 0;i < output.size();i++) { - #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output[i].send(value); - #line 3883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~BroadcastActor1State(); static_cast(this)->destroy(); return 0; } - #line 3887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~BroadcastActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3955,18 +3959,18 @@ class BroadcastActor1State { fdb_probe_actor_exit("broadcast", reinterpret_cast(this), 0); } - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Future input; - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" std::vector> output; - #line 3962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via broadcast() - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class BroadcastActor1 final : public Actor, public ActorCallback< BroadcastActor1, 0, T >, public FastAllocated>, public BroadcastActor1State> { - #line 3969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -3975,9 +3979,9 @@ class BroadcastActor1 final : public Actor, public ActorCallback< Broadcas void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< BroadcastActor1, 0, T >; - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" BroadcastActor1(Future const& input,std::vector> const& output) - #line 3980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), BroadcastActor1State>(input, output) { @@ -4001,36 +4005,36 @@ friend struct ActorCallback< BroadcastActor1, 0, T >; } }; } - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" [[nodiscard]] Future broadcast( Future const& input, std::vector> const& output ) { - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return Future(new BroadcastActor1(input, output)); - #line 4010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 4015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via incrementalBroadcast() - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class IncrementalBroadcastActorState { - #line 4022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" IncrementalBroadcastActorState(Future const& input,std::vector> const& output,int const& batchSize) - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : input(input), - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output(output), - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" batchSize(batchSize) - #line 4033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("incrementalBroadcast", reinterpret_cast(this)); @@ -4043,16 +4047,16 @@ class IncrementalBroadcastActorState { int a_body1(int loopDepth=0) { try { - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = input; - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -4073,20 +4077,20 @@ class IncrementalBroadcastActorState { } int a_body1cont1(int loopDepth) { - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" i = 0; - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ; - #line 4080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1when1(T const& __value,int loopDepth) { - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" value = __value; - #line 4089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -4151,9 +4155,9 @@ class IncrementalBroadcastActorState { } int a_body1cont2(int loopDepth) { - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~IncrementalBroadcastActorState(); static_cast(this)->destroy(); return 0; } - #line 4156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~IncrementalBroadcastActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4170,28 +4174,28 @@ class IncrementalBroadcastActorState { } int a_body1cont1loopBody1(int loopDepth) { - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!(i < output.size())) - #line 4175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output[i].send(value); - #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if ((i + 1) % batchSize == 0) - #line 4183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_1 = delay(0); - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } else @@ -4216,9 +4220,9 @@ class IncrementalBroadcastActorState { } int a_body1cont1loopBody1cont1(int loopDepth) { - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" i++; - #line 4221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; @@ -4298,24 +4302,24 @@ class IncrementalBroadcastActorState { fdb_probe_actor_exit("incrementalBroadcast", reinterpret_cast(this), 1); } - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Future input; - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" std::vector> output; - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" int batchSize; - #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" T value; - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" int i; - #line 4311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via incrementalBroadcast() - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class IncrementalBroadcastActor final : public Actor, public ActorCallback< IncrementalBroadcastActor, 0, T >, public ActorCallback< IncrementalBroadcastActor, 1, Void >, public FastAllocated>, public IncrementalBroadcastActorState> { - #line 4318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -4325,9 +4329,9 @@ class IncrementalBroadcastActor final : public Actor, public ActorCallback #pragma clang diagnostic pop friend struct ActorCallback< IncrementalBroadcastActor, 0, T >; friend struct ActorCallback< IncrementalBroadcastActor, 1, Void >; - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" IncrementalBroadcastActor(Future const& input,std::vector> const& output,int const& batchSize) - #line 4330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), IncrementalBroadcastActorState>(input, output, batchSize) { @@ -4352,36 +4356,36 @@ friend struct ActorCallback< IncrementalBroadcastActor, 1, Void >; } }; } - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" [[nodiscard]] Future incrementalBroadcast( Future const& input, std::vector> const& output, int const& batchSize ) { - #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return Future(new IncrementalBroadcastActor(input, output, batchSize)); - #line 4361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 4366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via incrementalBroadcast() - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class IncrementalBroadcastActor1State { - #line 4373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" IncrementalBroadcastActor1State(Future const& input,std::vector> const& output,int const& batchSize) - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : input(input), - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output(output), - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" batchSize(batchSize) - #line 4384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("incrementalBroadcast", reinterpret_cast(this)); @@ -4394,16 +4398,16 @@ class IncrementalBroadcastActor1State { int a_body1(int loopDepth=0) { try { - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = input; - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -4424,20 +4428,20 @@ class IncrementalBroadcastActor1State { } int a_body1cont1(int loopDepth) { - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" i = 0; - #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ; - #line 4431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont1loopHead1(loopDepth); return loopDepth; } int a_body1when1(T const& __value,int loopDepth) { - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" value = __value; - #line 4440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -4502,9 +4506,9 @@ class IncrementalBroadcastActor1State { } int a_body1cont2(int loopDepth) { - #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~IncrementalBroadcastActor1State(); static_cast(this)->destroy(); return 0; } - #line 4507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~IncrementalBroadcastActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4521,28 +4525,28 @@ class IncrementalBroadcastActor1State { } int a_body1cont1loopBody1(int loopDepth) { - #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!(i < output.size())) - #line 4526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { return a_body1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output[i].send(value); - #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if ((i + 1) % batchSize == 0) - #line 4534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_1 = delay(0); - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } else @@ -4567,9 +4571,9 @@ class IncrementalBroadcastActor1State { } int a_body1cont1loopBody1cont1(int loopDepth) { - #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" i++; - #line 4572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (loopDepth == 0) return a_body1cont1loopHead1(0); return loopDepth; @@ -4649,24 +4653,24 @@ class IncrementalBroadcastActor1State { fdb_probe_actor_exit("incrementalBroadcast", reinterpret_cast(this), 1); } - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Future input; - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" std::vector> output; - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" int batchSize; - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" T value; - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" int i; - #line 4662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via incrementalBroadcast() - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class IncrementalBroadcastActor1 final : public Actor, public ActorCallback< IncrementalBroadcastActor1, 0, T >, public ActorCallback< IncrementalBroadcastActor1, 1, Void >, public FastAllocated>, public IncrementalBroadcastActor1State> { - #line 4669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -4676,9 +4680,9 @@ class IncrementalBroadcastActor1 final : public Actor, public ActorCallbac #pragma clang diagnostic pop friend struct ActorCallback< IncrementalBroadcastActor1, 0, T >; friend struct ActorCallback< IncrementalBroadcastActor1, 1, Void >; - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" IncrementalBroadcastActor1(Future const& input,std::vector> const& output,int const& batchSize) - #line 4681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), IncrementalBroadcastActor1State>(input, output, batchSize) { @@ -4703,38 +4707,38 @@ friend struct ActorCallback< IncrementalBroadcastActor1, 1, Void >; } }; } - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" [[nodiscard]] Future incrementalBroadcast( Future const& input, std::vector> const& output, int const& batchSize ) { - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return Future(new IncrementalBroadcastActor1(input, output, batchSize)); - #line 4712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 4717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via incrementalBroadcastWithError() - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class IncrementalBroadcastWithErrorActorState { - #line 4724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" IncrementalBroadcastWithErrorActorState(Future const& input,std::vector> const& output,int const& batchSize) - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : input(input), - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output(output), - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" batchSize(batchSize), - #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" i(0) - #line 4737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("incrementalBroadcastWithError", reinterpret_cast(this)); @@ -4748,16 +4752,16 @@ class IncrementalBroadcastWithErrorActorState { { try { try { - #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = input; - #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 4755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -4784,9 +4788,9 @@ class IncrementalBroadcastWithErrorActorState { } int a_body1cont1(int loopDepth) { - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~IncrementalBroadcastWithErrorActorState(); static_cast(this)->destroy(); return 0; } - #line 4789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~IncrementalBroadcastWithErrorActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4797,19 +4801,19 @@ class IncrementalBroadcastWithErrorActorState { int a_body1Catch2(const Error& _e,int loopDepth=0) { try { - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (_e.code() == error_code_operation_cancelled) - #line 4802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return a_body1Catch1(_e, loopDepth); - #line 4806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" e = _e; - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ; - #line 4812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1Catch2loopHead1(loopDepth); } catch (Error& error) { @@ -4822,18 +4826,18 @@ class IncrementalBroadcastWithErrorActorState { } int a_body1cont2(int loopDepth) { - #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ; - #line 4827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont2loopHead1(loopDepth); return loopDepth; } int a_body1when1(T const& __value,int loopDepth) { - #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" value = __value; - #line 4836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -4911,28 +4915,28 @@ class IncrementalBroadcastWithErrorActorState { } int a_body1cont2loopBody1(int loopDepth) { - #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!(i < output.size())) - #line 4916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output[i].send(value); - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if ((i + 1) % batchSize == 0) - #line 4924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_1 = delay(0); - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } else @@ -4957,9 +4961,9 @@ class IncrementalBroadcastWithErrorActorState { } int a_body1cont2loopBody1cont1(int loopDepth) { - #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" i++; - #line 4962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 4966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (loopDepth == 0) return a_body1cont2loopHead1(0); return loopDepth; @@ -5067,28 +5071,28 @@ class IncrementalBroadcastWithErrorActorState { } int a_body1Catch2loopBody1(int loopDepth) { - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!(i < output.size())) - #line 5072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { return a_body1Catch2break1(loopDepth==0?0:loopDepth-1); // break } - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" output[i].sendError(e); - #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if ((i + 1) % batchSize == 0) - #line 5080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_2 = delay(0); - #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1Catch2loopBody1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } else @@ -5113,9 +5117,9 @@ class IncrementalBroadcastWithErrorActorState { } int a_body1Catch2loopBody1cont1(int loopDepth) { - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" i++; - #line 5118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (loopDepth == 0) return a_body1Catch2loopHead1(0); return loopDepth; @@ -5195,26 +5199,26 @@ class IncrementalBroadcastWithErrorActorState { fdb_probe_actor_exit("incrementalBroadcastWithError", reinterpret_cast(this), 2); } - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Future input; - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" std::vector> output; - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" int batchSize; - #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" int i; - #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" T value; - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Error e; - #line 5210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via incrementalBroadcastWithError() - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class IncrementalBroadcastWithErrorActor final : public Actor, public ActorCallback< IncrementalBroadcastWithErrorActor, 0, T >, public ActorCallback< IncrementalBroadcastWithErrorActor, 1, Void >, public ActorCallback< IncrementalBroadcastWithErrorActor, 2, Void >, public FastAllocated>, public IncrementalBroadcastWithErrorActorState> { - #line 5217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -5225,9 +5229,9 @@ class IncrementalBroadcastWithErrorActor final : public Actor, public Acto friend struct ActorCallback< IncrementalBroadcastWithErrorActor, 0, T >; friend struct ActorCallback< IncrementalBroadcastWithErrorActor, 1, Void >; friend struct ActorCallback< IncrementalBroadcastWithErrorActor, 2, Void >; - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" IncrementalBroadcastWithErrorActor(Future const& input,std::vector> const& output,int const& batchSize) - #line 5230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), IncrementalBroadcastWithErrorActorState>(input, output, batchSize) { @@ -5253,16 +5257,16 @@ friend struct ActorCallback< IncrementalBroadcastWithErrorActor, 2, Void >; } }; } - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" [[nodiscard]] Future incrementalBroadcastWithError( Future const& input, std::vector> const& output, int const& batchSize ) { - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return Future(new IncrementalBroadcastWithErrorActor(input, output, batchSize)); - #line 5262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" // Needed for the call to endpointNotFound() #include "fdbrpc/FailureMonitor.h" @@ -5287,29 +5291,29 @@ struct PeerHolder { // (caused by getErrorFutureAndDelPromiseRef()). When that SAV gets a broken promise because no one besides this void // actor is referencing it, this void actor will get a broken_promise dropping the final reference to the full // ReplyPromiseStream - #line 5290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via endStreamOnDisconnect() - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class EndStreamOnDisconnectActorState { - #line 5297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" EndStreamOnDisconnectActorState(Future const& signal,ReplyPromiseStream const& stream,Endpoint const& endpoint,Reference const& peer = Reference()) - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : signal(signal), - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" stream(stream), - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" endpoint(endpoint), - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" peer(peer), - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" holder(PeerHolder(peer)) - #line 5312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("endStreamOnDisconnect", reinterpret_cast(this)); @@ -5322,30 +5326,30 @@ class EndStreamOnDisconnectActorState { int a_body1(int loopDepth=0) { try { - #line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" stream.setRequestStreamEndpoint(endpoint); - #line 5327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" try { - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = signal; - #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_1 = peer.isValid() ? peer->disconnect.getFuture() : Never(); - #line 5335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_2 = stream.getErrorFutureAndDelPromiseRef(); - #line 5339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), loopDepth); else return a_body1when3(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -5378,23 +5382,23 @@ class EndStreamOnDisconnectActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (e.code() == error_code_broken_promise) - #line 5383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!stream.connected()) - #line 5387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_3 = signal || stream.onConnected(); - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1Catch2when1(__when_expr_3.get(), loopDepth); }; - #line 5393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" static_cast(this)->actor_wait_state = 2; - #line 348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } else @@ -5423,36 +5427,36 @@ class EndStreamOnDisconnectActorState { } int a_body1when1(Void const& _,int loopDepth) { - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" stream.sendError(connection_failed()); - #line 5428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont2(loopDepth); return loopDepth; } int a_body1when1(Void && _,int loopDepth) { - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" stream.sendError(connection_failed()); - #line 5437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont2(loopDepth); return loopDepth; } int a_body1when2(Void const& _,int loopDepth) { - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" stream.sendError(connection_failed()); - #line 5446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont2(loopDepth); return loopDepth; } int a_body1when2(Void && _,int loopDepth) { - #line 340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" stream.sendError(connection_failed()); - #line 5455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -5627,9 +5631,9 @@ class EndStreamOnDisconnectActorState { } int a_body1Catch2cont1(int loopDepth) { - #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" stream.notifyFailed(); - #line 5632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -5717,31 +5721,31 @@ class EndStreamOnDisconnectActorState { } int a_body1cont4(int loopDepth) { - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" delete static_cast(this); - #line 5722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" return 0; return loopDepth; } - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Future signal; - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ReplyPromiseStream stream; - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Endpoint endpoint; - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Reference peer; - #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" PeerHolder holder; - #line 5737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via endStreamOnDisconnect() - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class EndStreamOnDisconnectActor final : public Actor, public ActorCallback< EndStreamOnDisconnectActor, 0, Void >, public ActorCallback< EndStreamOnDisconnectActor, 1, Void >, public ActorCallback< EndStreamOnDisconnectActor, 2, Void >, public ActorCallback< EndStreamOnDisconnectActor, 3, Void >, public FastAllocated>, public EndStreamOnDisconnectActorState> { - #line 5744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -5753,9 +5757,9 @@ friend struct ActorCallback< EndStreamOnDisconnectActor, 0, Void >; friend struct ActorCallback< EndStreamOnDisconnectActor, 1, Void >; friend struct ActorCallback< EndStreamOnDisconnectActor, 2, Void >; friend struct ActorCallback< EndStreamOnDisconnectActor, 3, Void >; - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" EndStreamOnDisconnectActor(Future const& signal,ReplyPromiseStream const& stream,Endpoint const& endpoint,Reference const& peer = Reference()) - #line 5758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), EndStreamOnDisconnectActorState>(signal, stream, endpoint, peer) { @@ -5770,43 +5774,43 @@ friend struct ActorCallback< EndStreamOnDisconnectActor, 3, Void >; } }; } - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" void endStreamOnDisconnect( Future const& signal, ReplyPromiseStream const& stream, Endpoint const& endpoint, Reference const& peer = Reference() ) { - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" new EndStreamOnDisconnectActor(signal, stream, endpoint, peer); - #line 5779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" // Implements tryGetReply, getReplyUnlessFailedFor - #line 5785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via waitValueOrSignal() - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class WaitValueOrSignalActorState { - #line 5792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" WaitValueOrSignalActorState(Future const& value,Future const& signal,Endpoint const& endpoint,ReplyPromise const& holdme = ReplyPromise(),Reference const& peer = Reference()) - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : value(value), - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" signal(signal), - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" endpoint(endpoint), - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" holdme(holdme), - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" peer(peer), - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" holder(PeerHolder(peer)) - #line 5809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("waitValueOrSignal", reinterpret_cast(this)); @@ -5819,9 +5823,9 @@ class WaitValueOrSignalActorState { int a_body1(int loopDepth=0) { try { - #line 364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ; - #line 5824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -5850,22 +5854,22 @@ class WaitValueOrSignalActorState { int a_body1loopBody1(int loopDepth) { try { - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = value; - #line 366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 5857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_1 = signal; - #line 5861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -5885,45 +5889,45 @@ class WaitValueOrSignalActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (signal.isError()) - #line 5890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" TraceEvent(SevError, "WaitValueOrSignalError").error(signal.getError()); - #line 377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(ErrorOr(internal_error())); this->~WaitValueOrSignalActorState(); static_cast(this)->destroy(); return 0; } - #line 5896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< ErrorOr >::value()) ErrorOr(ErrorOr(internal_error())); this->~WaitValueOrSignalActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (e.code() == error_code_actor_cancelled) - #line 5904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 5908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } - #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (e.code() != error_code_broken_promise || signal.isError()) - #line 5912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(ErrorOr(e)); this->~WaitValueOrSignalActorState(); static_cast(this)->destroy(); return 0; } - #line 5916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< ErrorOr >::value()) ErrorOr(ErrorOr(e)); this->~WaitValueOrSignalActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" IFailureMonitor::failureMonitor().endpointNotFound(endpoint); - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" value = Never(); - #line 5926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = a_body1loopBody1cont1(loopDepth); } catch (Error& error) { @@ -5936,9 +5940,9 @@ class WaitValueOrSignalActorState { } int a_body1loopBody1when1(X const& x,int loopDepth) { - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(x); this->~WaitValueOrSignalActorState(); static_cast(this)->destroy(); return 0; } - #line 5941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< ErrorOr >::value()) ErrorOr(x); this->~WaitValueOrSignalActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5948,9 +5952,9 @@ class WaitValueOrSignalActorState { } int a_body1loopBody1when1(X && x,int loopDepth) { - #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV>::futures) { (void)(x); this->~WaitValueOrSignalActorState(); static_cast(this)->destroy(); return 0; } - #line 5953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 5957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< ErrorOr >::value()) ErrorOr(x); this->~WaitValueOrSignalActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5960,10 +5964,10 @@ class WaitValueOrSignalActorState { } int a_body1loopBody1when2(Void const& _,int loopDepth) { - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(ErrorOr(request_maybe_delivered())); this->~WaitValueOrSignalActorState(); static_cast(this)->destroy(); return 0; } - #line 5965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" - new (&static_cast(this)->SAV< ErrorOr >::value()) ErrorOr(ErrorOr(request_maybe_delivered())); + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(ErrorOr(IFailureMonitor::failureMonitor().knownUnauthorized(endpoint) ? unauthorized_attempt() : request_maybe_delivered())); this->~WaitValueOrSignalActorState(); static_cast(this)->destroy(); return 0; } + #line 5969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" + new (&static_cast(this)->SAV< ErrorOr >::value()) ErrorOr(ErrorOr(IFailureMonitor::failureMonitor().knownUnauthorized(endpoint) ? unauthorized_attempt() : request_maybe_delivered())); this->~WaitValueOrSignalActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -5972,10 +5976,10 @@ class WaitValueOrSignalActorState { } int a_body1loopBody1when2(Void && _,int loopDepth) { - #line 371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - if (!static_cast(this)->SAV>::futures) { (void)(ErrorOr(request_maybe_delivered())); this->~WaitValueOrSignalActorState(); static_cast(this)->destroy(); return 0; } - #line 5977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" - new (&static_cast(this)->SAV< ErrorOr >::value()) ErrorOr(ErrorOr(request_maybe_delivered())); + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + if (!static_cast(this)->SAV>::futures) { (void)(ErrorOr(IFailureMonitor::failureMonitor().knownUnauthorized(endpoint) ? unauthorized_attempt() : request_maybe_delivered())); this->~WaitValueOrSignalActorState(); static_cast(this)->destroy(); return 0; } + #line 5981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" + new (&static_cast(this)->SAV< ErrorOr >::value()) ErrorOr(ErrorOr(IFailureMonitor::failureMonitor().knownUnauthorized(endpoint) ? unauthorized_attempt() : request_maybe_delivered())); this->~WaitValueOrSignalActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; @@ -6079,26 +6083,26 @@ class WaitValueOrSignalActorState { fdb_probe_actor_exit("waitValueOrSignal", reinterpret_cast(this), 1); } - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Future value; - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Future signal; - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Endpoint endpoint; - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ReplyPromise holdme; - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Reference peer; - #line 363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" PeerHolder holder; - #line 6094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via waitValueOrSignal() - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class WaitValueOrSignalActor final : public Actor>, public ActorCallback< WaitValueOrSignalActor, 0, X >, public ActorCallback< WaitValueOrSignalActor, 1, Void >, public FastAllocated>, public WaitValueOrSignalActorState> { - #line 6101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -6108,9 +6112,9 @@ class WaitValueOrSignalActor final : public Actor>, public ActorCallb #pragma clang diagnostic pop friend struct ActorCallback< WaitValueOrSignalActor, 0, X >; friend struct ActorCallback< WaitValueOrSignalActor, 1, Void >; - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" WaitValueOrSignalActor(Future const& value,Future const& signal,Endpoint const& endpoint,ReplyPromise const& holdme = ReplyPromise(),Reference const& peer = Reference()) - #line 6113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor>(), WaitValueOrSignalActorState>(value, signal, endpoint, holdme, peer) { @@ -6134,36 +6138,38 @@ friend struct ActorCallback< WaitValueOrSignalActor, 1, Void >; } }; } - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" [[nodiscard]] Future> waitValueOrSignal( Future const& value, Future const& signal, Endpoint const& endpoint, ReplyPromise const& holdme = ReplyPromise(), Reference const& peer = Reference() ) { - #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return Future>(new WaitValueOrSignalActor(value, signal, endpoint, holdme, peer)); - #line 6143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 6148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via sendCanceler() - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class SendCancelerActorState { - #line 6155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" SendCancelerActorState(ReplyPromise const& reply,ReliablePacket* const& send,Endpoint const& endpoint) - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : reply(reply), - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" send(send), - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - endpoint(endpoint) - #line 6166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + endpoint(endpoint), + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + didCancelReliable(false) + #line 6172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("sendCanceler", reinterpret_cast(this)); @@ -6177,17 +6183,10 @@ class SendCancelerActorState { { try { try { - #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - StrictFuture __when_expr_0 = reply.getFuture(); - #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 6184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" - loopDepth = 0; + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + ; + #line 6188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" + loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch2(error, loopDepth); @@ -6214,19 +6213,25 @@ class SendCancelerActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - FlowTransport::transport().cancelReliable(send); - #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + if (!didCancelReliable) + #line 6218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" + { + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + FlowTransport::transport().cancelReliable(send); + #line 6222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" + } + #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (e.code() == error_code_broken_promise) - #line 6221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" IFailureMonitor::failureMonitor().endpointNotFound(endpoint); - #line 6225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } - #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return a_body1Catch1(e, loopDepth); - #line 6229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -6236,13 +6241,171 @@ class SendCancelerActorState { return loopDepth; } - int a_body1cont2(T const& t,int loopDepth) + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + if (IFailureMonitor::failureMonitor().permanentlyFailed(endpoint)) + #line 6255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" + { + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + FlowTransport::transport().cancelReliable(send); + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + didCancelReliable = true; + #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + if (IFailureMonitor::failureMonitor().knownUnauthorized(endpoint)) + #line 6263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" + { + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + return a_body1Catch2(unauthorized_attempt(), std::max(0, loopDepth - 1)); + #line 6267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" + } + else + { + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + StrictFuture __when_expr_0 = Never(); + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 6275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" + loopDepth = 0; + } + } + else + { + loopDepth = a_body1loopBody1cont1(loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(int loopDepth) + { + #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + StrictFuture __when_expr_1 = reply.getFuture(); + #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 6297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; + #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + StrictFuture __when_expr_2 = IFailureMonitor::failureMonitor().onStateChanged(endpoint); + #line 6301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch2(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when2(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont2(int loopDepth) + { + loopDepth = a_body1loopBody1cont1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1cont4(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont2(loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont4(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< SendCancelerActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< SendCancelerActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("sendCanceler", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("sendCanceler", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< SendCancelerActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("sendCanceler", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("sendCanceler", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< SendCancelerActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("sendCanceler", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("sendCanceler", reinterpret_cast(this), 0); + + } + int a_body1loopBody1cont5(int loopDepth) + { + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1when1(T const& t,int loopDepth) { - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" FlowTransport::transport().cancelReliable(send); - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + didCancelReliable = true; + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(t); this->~SendCancelerActorState(); static_cast(this)->destroy(); return 0; } - #line 6245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< T >::value()) T(t); this->~SendCancelerActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6250,13 +6413,15 @@ class SendCancelerActorState { return loopDepth; } - int a_body1cont2(T && t,int loopDepth) + int a_body1loopBody1cont1when1(T && t,int loopDepth) { - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" FlowTransport::transport().cancelReliable(send); - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + didCancelReliable = true; + #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(t); this->~SendCancelerActorState(); static_cast(this)->destroy(); return 0; } - #line 6259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< T >::value()) T(t); this->~SendCancelerActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6264,58 +6429,59 @@ class SendCancelerActorState { return loopDepth; } - int a_body1when1(T const& t,int loopDepth) + int a_body1loopBody1cont1when2(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(t, loopDepth); + loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; } - int a_body1when1(T && t,int loopDepth) + int a_body1loopBody1cont1when2(Void && _,int loopDepth) { - loopDepth = a_body1cont2(std::move(t), loopDepth); + loopDepth = a_body1loopBody1cont5(loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose2() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SendCancelerActor, 0, T >::remove(); + static_cast(this)->ActorCallback< SendCancelerActor, 1, T >::remove(); + static_cast(this)->ActorCallback< SendCancelerActor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< SendCancelerActor, 0, T >*,T const& value) + void a_callback_fire(ActorCallback< SendCancelerActor, 1, T >*,T const& value) { - fdb_probe_actor_enter("sendCanceler", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("sendCanceler", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1when1(value, 0); + a_body1loopBody1cont1when1(value, 0); } catch (Error& error) { a_body1Catch2(error, 0); } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("sendCanceler", reinterpret_cast(this), 0); + fdb_probe_actor_exit("sendCanceler", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< SendCancelerActor, 0, T >*,T && value) + void a_callback_fire(ActorCallback< SendCancelerActor, 1, T >*,T && value) { - fdb_probe_actor_enter("sendCanceler", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("sendCanceler", reinterpret_cast(this), 1); + a_exitChoose2(); try { - a_body1when1(std::move(value), 0); + a_body1loopBody1cont1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch2(error, 0); } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("sendCanceler", reinterpret_cast(this), 0); + fdb_probe_actor_exit("sendCanceler", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< SendCancelerActor, 0, T >*,Error err) + void a_callback_error(ActorCallback< SendCancelerActor, 1, T >*,Error err) { - fdb_probe_actor_enter("sendCanceler", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("sendCanceler", reinterpret_cast(this), 1); + a_exitChoose2(); try { a_body1Catch2(err, 0); } @@ -6324,23 +6490,70 @@ class SendCancelerActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("sendCanceler", reinterpret_cast(this), 0); + fdb_probe_actor_exit("sendCanceler", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< SendCancelerActor, 2, Void >*,Void const& value) + { + fdb_probe_actor_enter("sendCanceler", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1loopBody1cont1when2(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("sendCanceler", reinterpret_cast(this), 2); + + } + void a_callback_fire(ActorCallback< SendCancelerActor, 2, Void >*,Void && value) + { + fdb_probe_actor_enter("sendCanceler", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1loopBody1cont1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("sendCanceler", reinterpret_cast(this), 2); + + } + void a_callback_error(ActorCallback< SendCancelerActor, 2, Void >*,Error err) + { + fdb_probe_actor_enter("sendCanceler", reinterpret_cast(this), 2); + a_exitChoose2(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("sendCanceler", reinterpret_cast(this), 2); } - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ReplyPromise reply; - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ReliablePacket* send; - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Endpoint endpoint; - #line 6336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + bool didCancelReliable; + #line 6549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via sendCanceler() - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" -class SendCancelerActor final : public Actor, public ActorCallback< SendCancelerActor, 0, T >, public FastAllocated>, public SendCancelerActorState> { - #line 6343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" +class SendCancelerActor final : public Actor, public ActorCallback< SendCancelerActor, 0, Void >, public ActorCallback< SendCancelerActor, 1, T >, public ActorCallback< SendCancelerActor, 2, Void >, public FastAllocated>, public SendCancelerActorState> { + #line 6556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -6348,10 +6561,12 @@ class SendCancelerActor final : public Actor, public ActorCallback< SendCance #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< SendCancelerActor, 0, T >; - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +friend struct ActorCallback< SendCancelerActor, 0, Void >; +friend struct ActorCallback< SendCancelerActor, 1, T >; +friend struct ActorCallback< SendCancelerActor, 2, Void >; + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" SendCancelerActor(ReplyPromise const& reply,ReliablePacket* const& send,Endpoint const& endpoint) - #line 6354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), SendCancelerActorState>(reply, send, endpoint) { @@ -6369,40 +6584,41 @@ friend struct ActorCallback< SendCancelerActor, 0, T >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< SendCancelerActor, 0, T >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< SendCancelerActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< SendCancelerActor, 1, T >*)0, actor_cancelled()); break; } } }; } - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" [[nodiscard]] Future sendCanceler( ReplyPromise const& reply, ReliablePacket* const& send, Endpoint const& endpoint ) { - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return Future(new SendCancelerActor(reply, send, endpoint)); - #line 6384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" - #line 6389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" namespace { // This generated class is to be used only via reportEndpointFailure() - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class ReportEndpointFailureActorState { - #line 6396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ReportEndpointFailureActorState(Future const& value,Endpoint const& endpoint) - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" : value(value), - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" endpoint(endpoint) - #line 6405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { fdb_probe_actor_create("reportEndpointFailure", reinterpret_cast(this)); @@ -6416,16 +6632,16 @@ class ReportEndpointFailureActorState { { try { try { - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" StrictFuture __when_expr_0 = value; - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 6423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -6453,17 +6669,17 @@ class ReportEndpointFailureActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (e.code() == error_code_broken_promise) - #line 6458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" { - #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" IFailureMonitor::failureMonitor().endpointNotFound(endpoint); - #line 6462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return a_body1Catch1(e, loopDepth); - #line 6466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -6475,9 +6691,9 @@ class ReportEndpointFailureActorState { } int a_body1cont2(X const& x,int loopDepth) { - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(x); this->~ReportEndpointFailureActorState(); static_cast(this)->destroy(); return 0; } - #line 6480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< X >::value()) X(x); this->~ReportEndpointFailureActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6487,9 +6703,9 @@ class ReportEndpointFailureActorState { } int a_body1cont2(X && x,int loopDepth) { - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" if (!static_cast(this)->SAV::futures) { (void)(x); this->~ReportEndpointFailureActorState(); static_cast(this)->destroy(); return 0; } - #line 6492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" new (&static_cast(this)->SAV< X >::value()) X(x); this->~ReportEndpointFailureActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6560,18 +6776,18 @@ class ReportEndpointFailureActorState { fdb_probe_actor_exit("reportEndpointFailure", reinterpret_cast(this), 0); } - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Future value; - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" Endpoint endpoint; - #line 6567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" }; // This generated class is to be used only via reportEndpointFailure() - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" class ReportEndpointFailureActor final : public Actor, public ActorCallback< ReportEndpointFailureActor, 0, X >, public FastAllocated>, public ReportEndpointFailureActorState> { - #line 6574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -6580,9 +6796,9 @@ class ReportEndpointFailureActor final : public Actor, public ActorCallback< void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ReportEndpointFailureActor, 0, X >; - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" ReportEndpointFailureActor(Future const& value,Endpoint const& endpoint) - #line 6585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" : Actor(), ReportEndpointFailureActorState>(value, endpoint) { @@ -6606,16 +6822,16 @@ friend struct ActorCallback< ReportEndpointFailureActor, 0, X >; } }; } - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" template - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" [[nodiscard]] Future reportEndpointFailure( Future const& value, Endpoint const& endpoint ) { - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" return Future(new ReportEndpointFailureActor(value, endpoint)); - #line 6615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.g.h" + #line 6831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.g.h" } -#line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/genericactors.actor.h" +#line 446 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/genericactors.actor.h" #include "flow/unactorcompiler.h" diff --git a/src/fdbrpc/genericactors.actor.h b/src/fdbrpc/include/fdbrpc/genericactors.actor.h similarity index 85% rename from src/fdbrpc/genericactors.actor.h rename to src/fdbrpc/include/fdbrpc/genericactors.actor.h index 0b6848e..4612ac9 100644 --- a/src/fdbrpc/genericactors.actor.h +++ b/src/fdbrpc/include/fdbrpc/genericactors.actor.h @@ -28,12 +28,16 @@ #include "flow/genericactors.actor.h" #include "fdbrpc/fdbrpc.h" -#include "fdbclient/WellKnownEndpoints.h" +#include "fdbrpc/WellKnownEndpoints.h" #include "flow/Hostname.h" #include "flow/actorcompiler.h" // This must be the last #include. -ACTOR template -Future retryBrokenPromise(RequestStream to, Req request) { +// To avoid diretly access INetworkConnection::net()->removeCachedDNS(), which will require heavy include budget, put +// the call to FlowTransport.actor.cpp as a external function. +extern void removeCachedDNS(const std::string& host, const std::string& service); + +ACTOR template +Future retryBrokenPromise(RequestStream to, Req request) { // Like to.getReply(request), except that a broken_promise exception results in retrying request immediately. // Suitable for use with well known endpoints, which are likely to return to existence after the other process // restarts. Not normally useful for ordinary endpoints, which conventionally are permanently destroyed after @@ -47,13 +51,13 @@ Future retryBrokenPromise(RequestStream to, Req request) { throw; resetReply(request); wait(delayJittered(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY)); - TEST(true); // retryBrokenPromise + CODE_PROBE(true, "retryBrokenPromise"); } } } -ACTOR template -Future retryBrokenPromise(RequestStream to, Req request, TaskPriority taskID) { +ACTOR template +Future retryBrokenPromise(RequestStream to, Req request, TaskPriority taskID) { // Like to.getReply(request), except that a broken_promise exception results in retrying request immediately. // Suitable for use with well known endpoints, which are likely to return to existence after the other process // restarts. Not normally useful for ordinary endpoints, which conventionally are permanently destroyed after @@ -67,7 +71,7 @@ Future retryBrokenPromise(RequestStream to, Req request, T throw; resetReply(request); wait(delayJittered(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY, taskID)); - TEST(true); // retryBrokenPromise with taskID + CODE_PROBE(true, "retryBrokenPromise with taskID"); } } } @@ -98,7 +102,7 @@ Future> tryGetReplyFromHostname(Req request, Hostname h resetReply(request); if (reply.getError().code() == error_code_request_maybe_delivered) { // Connection failure. - INetworkConnections::net()->removeCachedDNS(hostname.host, hostname.service); + removeCachedDNS(hostname.host, hostname.service); } } return reply; @@ -122,7 +126,7 @@ Future> tryGetReplyFromHostname(Req request, resetReply(request); if (reply.getError().code() == error_code_request_maybe_delivered) { // Connection failure. - INetworkConnections::net()->removeCachedDNS(hostname.host, hostname.service); + removeCachedDNS(hostname.host, hostname.service); } } return reply; @@ -133,7 +137,7 @@ Future retryGetReplyFromHostname(Req request, Hostname hostname // Like tryGetReplyFromHostname, except that request_maybe_delivered results in re-resolving the hostname. // Suitable for use with hostname, where RequestStream is NOT initialized yet. // Not normally useful for endpoints initialized with NetworkAddress. - state double reconnetInterval = FLOW_KNOBS->HOSTNAME_RECONNECT_INIT_INTERVAL; + state double reconnectInterval = FLOW_KNOBS->HOSTNAME_RECONNECT_INIT_INTERVAL; state std::unique_ptr> to; loop { NetworkAddress address = wait(hostname.resolveWithRetry()); @@ -145,9 +149,9 @@ Future retryGetReplyFromHostname(Req request, Hostname hostname resetReply(request); if (reply.getError().code() == error_code_request_maybe_delivered) { // Connection failure. - wait(delay(reconnetInterval)); - reconnetInterval = std::min(2 * reconnetInterval, FLOW_KNOBS->HOSTNAME_RECONNECT_MAX_INTERVAL); - INetworkConnections::net()->removeCachedDNS(hostname.host, hostname.service); + wait(delay(reconnectInterval)); + reconnectInterval = std::min(2 * reconnectInterval, FLOW_KNOBS->HOSTNAME_RECONNECT_MAX_INTERVAL); + removeCachedDNS(hostname.host, hostname.service); } else { throw reply.getError(); } @@ -165,7 +169,7 @@ Future retryGetReplyFromHostname(Req request, // Like tryGetReplyFromHostname, except that request_maybe_delivered results in re-resolving the hostname. // Suitable for use with hostname, where RequestStream is NOT initialized yet. // Not normally useful for endpoints initialized with NetworkAddress. - state double reconnetInterval = FLOW_KNOBS->HOSTNAME_RECONNECT_INIT_INTERVAL; + state double reconnectInitInterval = FLOW_KNOBS->HOSTNAME_RECONNECT_INIT_INTERVAL; state std::unique_ptr> to; loop { NetworkAddress address = wait(hostname.resolveWithRetry()); @@ -177,9 +181,10 @@ Future retryGetReplyFromHostname(Req request, resetReply(request); if (reply.getError().code() == error_code_request_maybe_delivered) { // Connection failure. - wait(delay(reconnetInterval)); - reconnetInterval = std::min(2 * reconnetInterval, FLOW_KNOBS->HOSTNAME_RECONNECT_MAX_INTERVAL); - INetworkConnections::net()->removeCachedDNS(hostname.host, hostname.service); + wait(delay(reconnectInitInterval)); + reconnectInitInterval = + std::min(2 * reconnectInitInterval, FLOW_KNOBS->HOSTNAME_RECONNECT_MAX_INTERVAL); + removeCachedDNS(hostname.host, hostname.service); } else { throw reply.getError(); } @@ -368,7 +373,9 @@ Future> waitValueOrSignal(Future value, return x; } when(wait(signal)) { - return ErrorOr(request_maybe_delivered()); + return ErrorOr(IFailureMonitor::failureMonitor().knownUnauthorized(endpoint) + ? unauthorized_attempt() + : request_maybe_delivered()); } } } catch (Error& e) { @@ -392,12 +399,31 @@ Future> waitValueOrSignal(Future value, ACTOR template Future sendCanceler(ReplyPromise reply, ReliablePacket* send, Endpoint endpoint) { + state bool didCancelReliable = false; try { - T t = wait(reply.getFuture()); - FlowTransport::transport().cancelReliable(send); - return t; + loop { + if (IFailureMonitor::failureMonitor().permanentlyFailed(endpoint)) { + FlowTransport::transport().cancelReliable(send); + didCancelReliable = true; + if (IFailureMonitor::failureMonitor().knownUnauthorized(endpoint)) { + throw unauthorized_attempt(); + } else { + wait(Never()); + } + } + choose { + when(T t = wait(reply.getFuture())) { + FlowTransport::transport().cancelReliable(send); + didCancelReliable = true; + return t; + } + when(wait(IFailureMonitor::failureMonitor().onStateChanged(endpoint))) {} + } + } } catch (Error& e) { - FlowTransport::transport().cancelReliable(send); + if (!didCancelReliable) { + FlowTransport::transport().cancelReliable(send); + } if (e.code() == error_code_broken_promise) { IFailureMonitor::failureMonitor().endpointNotFound(endpoint); } diff --git a/src/fdbrpc/linux_kaio.h b/src/fdbrpc/include/fdbrpc/linux_kaio.h similarity index 100% rename from src/fdbrpc/linux_kaio.h rename to src/fdbrpc/include/fdbrpc/linux_kaio.h diff --git a/src/fdbrpc/networksender.actor.g.h b/src/fdbrpc/include/fdbrpc/networksender.actor.g.h similarity index 80% rename from src/fdbrpc/networksender.actor.g.h rename to src/fdbrpc/include/fdbrpc/networksender.actor.g.h index d2ff412..3060761 100644 --- a/src/fdbrpc/networksender.actor.g.h +++ b/src/fdbrpc/include/fdbrpc/networksender.actor.g.h @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" /* * networksender.actor.h * @@ -33,23 +33,23 @@ #include "flow/actorcompiler.h" // This must be the last #include. // This actor is used by FlowTransport to serialize the response to a ReplyPromise across the network - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" namespace { // This generated class is to be used only via networkSender() - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" template - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" class NetworkSenderActorState { - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" public: - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" NetworkSenderActorState(Future const& input,Endpoint const& endpoint) - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" : input(input), - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" endpoint(endpoint) - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" { fdb_probe_actor_create("networkSender", reinterpret_cast(this)); @@ -63,15 +63,15 @@ class NetworkSenderActorState { { try { try { - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" StrictFuture __when_expr_0 = input; - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" static_cast(this)->actor_wait_state = 1; - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" loopDepth = 0; } catch (Error& error) { @@ -104,20 +104,20 @@ class NetworkSenderActorState { int a_body1Catch2(const Error& err,int loopDepth=0) { try { - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" if (err.code() == error_code_never_reply) - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" { - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" delete static_cast(this); - #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" return 0; } - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" ASSERT(err.code() != error_code_actor_cancelled); - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" FlowTransport::transport().sendUnreliable(SerializeSource>>(err), endpoint, false); - #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" loopDepth = a_body1cont1(loopDepth); } catch (Error& error) { @@ -130,18 +130,18 @@ class NetworkSenderActorState { } int a_body1cont2(T const& value,int loopDepth) { - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" FlowTransport::transport().sendUnreliable(SerializeSource>>(value), endpoint, false); - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" loopDepth = a_body1cont4(loopDepth); return loopDepth; } int a_body1cont2(T && value,int loopDepth) { - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" FlowTransport::transport().sendUnreliable(SerializeSource>>(value), endpoint, false); - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" loopDepth = a_body1cont4(loopDepth); return loopDepth; @@ -224,25 +224,25 @@ class NetworkSenderActorState { } int a_body1cont5(int loopDepth) { - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" delete static_cast(this); - #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" return 0; return loopDepth; } - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" Future input; - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" Endpoint endpoint; - #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" }; // This generated class is to be used only via networkSender() - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" template - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" class NetworkSenderActor final : public Actor, public ActorCallback< NetworkSenderActor, 0, T >, public FastAllocated>, public NetworkSenderActorState> { - #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" public: using FastAllocated>::operator new; using FastAllocated>::operator delete; @@ -251,9 +251,9 @@ class NetworkSenderActor final : public Actor, public ActorCallback< Netwo void destroy() {{ ((Actor*)this)->~Actor(); operator delete(this); }} #pragma clang diagnostic pop friend struct ActorCallback< NetworkSenderActor, 0, T >; - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" NetworkSenderActor(Future const& input,Endpoint const& endpoint) - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" : Actor(), NetworkSenderActorState>(input, endpoint) { @@ -268,16 +268,16 @@ friend struct ActorCallback< NetworkSenderActor, 0, T >; } }; } - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" template - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" void networkSender( Future const& input, Endpoint const& endpoint ) { - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" new NetworkSenderActor(input, endpoint); - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.g.h" + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.g.h" } -#line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/networksender.actor.h" +#line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/include/fdbrpc/networksender.actor.h" #include "flow/unactorcompiler.h" #endif diff --git a/src/fdbrpc/networksender.actor.h b/src/fdbrpc/include/fdbrpc/networksender.actor.h similarity index 100% rename from src/fdbrpc/networksender.actor.h rename to src/fdbrpc/include/fdbrpc/networksender.actor.h diff --git a/src/fdbrpc/sim_validation.h b/src/fdbrpc/include/fdbrpc/sim_validation.h similarity index 100% rename from src/fdbrpc/sim_validation.h rename to src/fdbrpc/include/fdbrpc/sim_validation.h diff --git a/src/fdbrpc/simulator.h b/src/fdbrpc/include/fdbrpc/simulator.h similarity index 65% rename from src/fdbrpc/simulator.h rename to src/fdbrpc/include/fdbrpc/simulator.h index 19ad57d..7d6e99e 100644 --- a/src/fdbrpc/simulator.h +++ b/src/fdbrpc/include/fdbrpc/simulator.h @@ -20,217 +20,72 @@ #ifndef FLOW_SIMULATOR_H #define FLOW_SIMULATOR_H -#include "flow/ProtocolVersion.h" +#pragma once #include #include -#pragma once +#include +#include + +#include #include "flow/flow.h" #include "flow/Histogram.h" +#include "flow/ChaosMetrics.h" +#include "flow/ProtocolVersion.h" +#include "flow/WipedString.h" #include "fdbrpc/FailureMonitor.h" #include "fdbrpc/Locality.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/TDMetric.actor.h" -#include +#include "fdbrpc/HTTP.h" +#include "fdbrpc/FailureMonitor.h" +#include "fdbrpc/Locality.h" #include "fdbrpc/ReplicationPolicy.h" +#include "fdbrpc/TokenSign.h" +#include "fdbrpc/SimulatorKillType.h" enum ClogMode { ClogDefault, ClogAll, ClogSend, ClogReceive }; +struct ValidationData { + // global validation that missing refreshed feeds were previously destroyed + std::unordered_set allDestroyedChangeFeedIDs; +}; + +namespace simulator { +struct ProcessInfo; +struct MachineInfo; +} // namespace simulator + constexpr double DISABLE_CONNECTION_FAILURE_FOREVER = 1e6; class ISimulator : public INetwork { + public: - // Order matters! - enum KillType { - KillInstantly, - InjectFaults, - FailDisk, - RebootAndDelete, - RebootProcessAndDelete, - Reboot, - RebootProcess, - None - }; + using KillType = simulator::KillType; + using ProcessInfo = simulator::ProcessInfo; + using MachineInfo = simulator::MachineInfo; // Order matters! all modes >= 2 are fault injection modes enum TSSMode { Disabled, EnabledNormal, EnabledAddDelay, EnabledDropMutations }; enum class BackupAgentType { NoBackupAgents, WaitForType, BackupToFile, BackupToDB }; - - // Subclasses may subclass ProcessInfo as well - struct MachineInfo; - - struct ProcessInfo : NonCopyable { - const char* name; - const char* coordinationFolder; - const char* dataFolder; - MachineInfo* machine; - NetworkAddressList addresses; - NetworkAddress address; - LocalityData locality; - ProcessClass startingClass; - TDMetricCollection tdmetrics; - ChaosMetrics chaosMetrics; - HistogramRegistry histograms; - std::map> listenerMap; - std::map> boundUDPSockets; - bool failed; - bool excluded; - bool cleared; - bool rebooting; - std::vector globals; - - INetworkConnections* network; - - uint64_t fault_injection_r; - double fault_injection_p1, fault_injection_p2; - bool failedDisk; - - UID uid; - - ProtocolVersion protocolVersion; - - std::vector childs; - - ProcessInfo(const char* name, - LocalityData locality, - ProcessClass startingClass, - NetworkAddressList addresses, - INetworkConnections* net, - const char* dataFolder, - const char* coordinationFolder) - : name(name), coordinationFolder(coordinationFolder), dataFolder(dataFolder), machine(nullptr), - addresses(addresses), address(addresses.address), locality(locality), startingClass(startingClass), - failed(false), excluded(false), cleared(false), rebooting(false), network(net), fault_injection_r(0), - fault_injection_p1(0), fault_injection_p2(0), failedDisk(false) { - uid = deterministicRandom()->randomUniqueID(); - } - - Future onShutdown() { return shutdownSignal.getFuture(); } - - bool isReliable() const { - return !failed && fault_injection_p1 == 0 && fault_injection_p2 == 0 && !failedDisk && - (!machine || (machine->machineProcess->fault_injection_p1 == 0 && - machine->machineProcess->fault_injection_p2 == 0)); - } - bool isAvailable() const { return !isExcluded() && isReliable(); } - bool isExcluded() const { return excluded; } - bool isCleared() const { return cleared; } - std::string getReliableInfo() const { - std::stringstream ss; - ss << "failed:" << failed << " fault_injection_p1:" << fault_injection_p1 - << " fault_injection_p2:" << fault_injection_p2; - return ss.str(); - } - std::vector const& getChilds() const { return childs; } - - // Return true if the class type is suitable for stateful roles, such as tLog and StorageServer. - bool isAvailableClass() const { - switch (startingClass._class) { - case ProcessClass::UnsetClass: - return true; - case ProcessClass::StorageClass: - return true; - case ProcessClass::TransactionClass: - return true; - case ProcessClass::ResolutionClass: - return false; - case ProcessClass::CommitProxyClass: - return false; - case ProcessClass::GrvProxyClass: - return false; - case ProcessClass::MasterClass: - return false; - case ProcessClass::TesterClass: - return false; - case ProcessClass::StatelessClass: - return false; - case ProcessClass::LogClass: - return true; - case ProcessClass::LogRouterClass: - return false; - case ProcessClass::ClusterControllerClass: - return false; - case ProcessClass::DataDistributorClass: - return false; - case ProcessClass::RatekeeperClass: - return false; - case ProcessClass::BlobManagerClass: - return false; - case ProcessClass::StorageCacheClass: - return false; - case ProcessClass::BackupClass: - return false; - case ProcessClass::EncryptKeyProxyClass: - return false; - default: - return false; - } - } - - Reference getListener(const NetworkAddress& addr) const { - auto listener = listenerMap.find(addr); - ASSERT(listener != listenerMap.end()); - return listener->second; - } - - inline flowGlobalType global(int id) const { return (globals.size() > id) ? globals[id] : nullptr; }; - inline void setGlobal(size_t id, flowGlobalType v) { - globals.resize(std::max(globals.size(), id + 1)); - globals[id] = v; - }; - - std::string toString() const { - return format( - "name: %s address: %s zone: %s datahall: %s class: %s excluded: %d cleared: %d", - name, - formatIpPort(addresses.address.ip, addresses.address.port).c_str(), - (locality.zoneId().present() ? locality.zoneId().get().printable().c_str() : "[unset]"), - (locality.dataHallId().present() ? locality.dataHallId().get().printable().c_str() : "[unset]"), - startingClass.toString().c_str(), - excluded, - cleared); - } - - // Members not for external use - Promise shutdownSignal; - }; - - // A set of data associated with a simulated machine - struct MachineInfo { - ProcessInfo* machineProcess; - std::vector processes; - - // A map from filename to file handle for all open files on a machine - std::map> openFiles; - - std::set deletingOrClosingFiles; - std::set closingFiles; - Optional> machineId; - - const uint16_t remotePortStart; - std::vector usedRemotePorts; - - MachineInfo() : machineProcess(nullptr), remotePortStart(1000) {} - - short getRandomPort() { - for (uint16_t i = remotePortStart; i < 60000; i++) { - if (std::find(usedRemotePorts.begin(), usedRemotePorts.end(), i) == usedRemotePorts.end()) { - TraceEvent(SevDebug, "RandomPortOpened").detail("PortNum", i); - usedRemotePorts.push_back(i); - return i; - } - } - UNREACHABLE(); - } - - void removeRemotePort(uint16_t port) { - if (port < remotePortStart) - return; - auto pos = std::find(usedRemotePorts.begin(), usedRemotePorts.end(), port); - if (pos != usedRemotePorts.end()) { - usedRemotePorts.erase(pos); - } + enum class ExtraDatabaseMode { Disabled, LocalOrSingle, Single, Local, Multiple }; + + static ExtraDatabaseMode stringToExtraDatabaseMode(std::string databaseMode) { + if (databaseMode == "Disabled") { + return ExtraDatabaseMode::Disabled; + } else if (databaseMode == "LocalOrSingle") { + return ExtraDatabaseMode::LocalOrSingle; + } else if (databaseMode == "Single") { + return ExtraDatabaseMode::Single; + } else if (databaseMode == "Local") { + return ExtraDatabaseMode::Local; + } else if (databaseMode == "Multiple") { + return ExtraDatabaseMode::Multiple; + } else { + TraceEvent(SevError, "UnknownExtraDatabaseMode").detail("DatabaseMode", databaseMode); + ASSERT(false); + throw internal_error(); } }; @@ -250,7 +105,8 @@ class ISimulator : public INetwork { ProcessClass startingClass, const char* dataFolder, const char* coordinationFolder, - ProtocolVersion protocol) = 0; + ProtocolVersion protocol, + bool drProcess) = 0; virtual void killProcess(ProcessInfo* machine, KillType) = 0; virtual void rebootProcess(Optional> zoneId, bool allProcesses) = 0; virtual void rebootProcess(ProcessInfo* process, KillType kt) = 0; @@ -267,12 +123,20 @@ class ISimulator : public INetwork { KillType kt, bool forceKill = false, KillType* ktFinal = nullptr) = 0; + virtual bool killDataHall(Optional> dcId, + KillType kt, + bool forceKill = false, + KillType* ktFinal = nullptr) = 0; + virtual bool killAll(KillType kt, bool forceKill = false, KillType* ktFinal = nullptr) = 0; // virtual KillType getMachineKillState( UID zoneID ) = 0; + virtual void processInjectBlobFault(ProcessInfo* machine, double failureRate) = 0; + virtual void processStopInjectBlobFault(ProcessInfo* machine) = 0; virtual bool canKillProcesses(std::vector const& availableProcesses, std::vector const& deadProcesses, KillType kt, KillType* newKillType) const = 0; virtual bool isAvailable() const = 0; + virtual std::vector getAllAddressesInDCToExclude(Optional> dcId) const = 0; virtual bool datacenterDead(Optional> dcId) const = 0; virtual void displayWorkers() const; ProtocolVersion protocolVersion() const override = 0; @@ -353,6 +217,13 @@ class ISimulator : public INetwork { return clearedAddresses.find(address) != clearedAddresses.end(); } + void switchCluster(NetworkAddress const& address) { switchedCluster[address] = !switchedCluster[address]; } + bool hasSwitchedCluster(NetworkAddress const& address) const { + return switchedCluster.find(address) != switchedCluster.end() ? switchedCluster.at(address) : false; + } + void toggleGlobalSwitchCluster() { globalSwitchedCluster = !globalSwitchedCluster; } + bool globalHasSwitchedCluster() const { return globalSwitchedCluster; } + void excludeAddress(NetworkAddress const& address) { excludedAddresses[address]++; TraceEvent("ExcludeAddress").detail("Address", address).detail("Value", excludedAddresses[address]); @@ -389,7 +260,7 @@ class ISimulator : public INetwork { allSwapsDisabled = false; } bool canSwapToMachine(Optional> zoneId) const { - return swapsDisabled.count(zoneId) == 0 && !allSwapsDisabled && !extraDB; + return swapsDisabled.count(zoneId) == 0 && !allSwapsDisabled && extraDatabases.empty(); } void enableSwapsToAll() { swapsDisabled.clear(); @@ -413,19 +284,32 @@ class ISimulator : public INetwork { virtual void destroyProcess(ProcessInfo* p) = 0; virtual void destroyMachine(Optional> const& machineId) = 0; + virtual void addSimHTTPProcess(Reference serverContext) = 0; + virtual void removeSimHTTPProcess() = 0; + virtual Future registerSimHTTPServer(std::string hostname, + std::string service, + Reference requestHandler) = 0; + int desiredCoordinators; int physicalDatacenters; int processesPerMachine; int listenersPerProcess; + + // We won't kill machines in this set, but we might reboot + // them. This is a conservative mechanism to prevent the + // simulator from killing off important processes and rendering + // the cluster unrecoverable, e.g. a quorum of coordinators. std::set protectedAddresses; + std::map currentlyRebootingProcesses; - std::unique_ptr extraDB; + std::vector extraDatabases; Reference storagePolicy; Reference tLogPolicy; int32_t tLogWriteAntiQuorum; Optional> primaryDcId; Reference remoteTLogPolicy; int32_t usableRegions; + bool quiesced = false; std::string disablePrimary; std::string disableRemote; std::string originalRegions; @@ -442,6 +326,7 @@ class ISimulator : public INetwork { TSSMode tssMode; std::map corruptWorkerMap; ConfigDBType configDBType; + bool blobGranulesEnabled; // Used by workloads that perform reconfigurations int testerCount; @@ -451,36 +336,51 @@ class ISimulator : public INetwork { double lastConnectionFailure; double connectionFailuresDisableDuration; bool speedUpSimulation; + double connectionFailureEnableTime; // Last time connection failure is enabled. + bool disableTLogRecoveryFinish; BackupAgentType backupAgents; BackupAgentType drAgents; + bool willRestart = false; bool restarted = false; + bool isConsistencyChecked = false; + ValidationData validationData; bool hasDiffProtocolProcess; // true if simulator is testing a process with a different version bool setDiffProtocol; // true if a process with a different protocol version has been started bool allowStorageMigrationTypeChange = false; + double injectTargetedSSRestartTime = std::numeric_limits::max(); + double injectSSDelayTime = std::numeric_limits::max(); + double injectTargetedBMRestartTime = std::numeric_limits::max(); + double injectTargetedBWRestartTime = std::numeric_limits::max(); - flowGlobalType global(int id) const final { return getCurrentProcess()->global(id); }; - void setGlobal(size_t id, flowGlobalType v) final { getCurrentProcess()->setGlobal(id, v); }; + std::unordered_map, PrivateKey> authKeys; - void disableFor(const std::string& desc, double time) { disabledMap[desc] = time; } + std::set> corruptedBlocks; - double checkDisabled(const std::string& desc) const { - auto iter = disabledMap.find(desc); - if (iter != disabledMap.end()) { - return iter->second; - } - return 0; - } + // Valdiate at-rest encryption guarantees. If enabled, tests should inject a known 'marker' in Key and/or Values + // inserted into FDB by the workload. On shutdown, all test generated files (under simfdb/) are scanned to find if + // 'plaintext marker' is present. + Optional dataAtRestPlaintextMarker; + + std::unordered_map> httpHandlers; + std::vector>> httpServerProcesses; + std::set httpServerIps; + bool httpProtected = false; + + flowGlobalType global(int id) const final; + void setGlobal(size_t id, flowGlobalType v) final; + + void disableFor(const std::string& desc, double time); + + double checkDisabled(const std::string& desc) const; + + // generate authz token for use in simulation environment + WipedString makeToken(int64_t tenantId, uint64_t ttlSecondsFromNow); static thread_local ProcessInfo* currentProcess; - bool checkInjectedCorruption() { - auto iter = corruptWorkerMap.find(currentProcess->address); - if (iter != corruptWorkerMap.end()) - return iter->second; - return false; - } + bool checkInjectedCorruption(); ISimulator(); virtual ~ISimulator(); @@ -492,14 +392,14 @@ class ISimulator : public INetwork { std::set>> swapsDisabled; std::map excludedAddresses; std::map clearedAddresses; + std::map switchedCluster; + bool globalSwitchedCluster = false; std::map> roleAddresses; std::map disabledMap; bool allSwapsDisabled; }; -// Quickly make existing code work that expects g_simulator to be of class type (not a pointer) -extern ISimulator* g_pSimulator; -#define g_simulator (*g_pSimulator) +extern ISimulator* g_simulator; void startNewSimulator(bool printSimTime); diff --git a/src/fdbrpc/sim2.actor.cpp b/src/fdbrpc/sim2.actor.cpp index 42bbe36..0576c9f 100644 --- a/src/fdbrpc/sim2.actor.cpp +++ b/src/fdbrpc/sim2.actor.cpp @@ -23,11 +23,19 @@ #include #include +#include "flow/MkCert.h" #include "fmt/format.h" #include "fdbrpc/simulator.h" +#include "flow/Arena.h" +#ifndef BOOST_SYSTEM_NO_LIB #define BOOST_SYSTEM_NO_LIB +#endif +#ifndef BOOST_DATE_TIME_NO_LIB #define BOOST_DATE_TIME_NO_LIB +#endif +#ifndef BOOST_REGEX_NO_LIB #define BOOST_REGEX_NO_LIB +#endif #include "fdbrpc/SimExternalConnection.h" #include "flow/ActorCollection.h" #include "flow/IRandom.h" @@ -35,12 +43,13 @@ #include "flow/ProtocolVersion.h" #include "flow/Util.h" #include "flow/WriteOnlySet.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "fdbrpc/AsyncFileCached.actor.h" #include "fdbrpc/AsyncFileEncrypted.h" +#include "fdbrpc/SimulatorProcessInfo.h" #include "fdbrpc/AsyncFileNonDurable.actor.h" -#include "fdbrpc/AsyncFileChaos.actor.h" -#include "flow/crc32c.h" +#include "fdbrpc/AsyncFileChaos.h" +#include "crc32/crc32c.h" #include "fdbrpc/TraceFileIO.h" #include "flow/flow.h" #include "flow/genericactors.actor.h" @@ -52,23 +61,46 @@ #include "fdbrpc/AsyncFileWriteChecker.h" #include "fdbrpc/genericactors.actor.h" #include "flow/FaultInjection.h" +#include "flow/TaskQueue.h" +#include "flow/IUDPSocket.h" +#include "flow/IConnection.h" #include "flow/actorcompiler.h" // This must be the last #include. +ISimulator* g_simulator = nullptr; +thread_local ISimulator::ProcessInfo* ISimulator::currentProcess = nullptr; + +ISimulator::ISimulator() + : desiredCoordinators(1), physicalDatacenters(1), processesPerMachine(0), listenersPerProcess(1), usableRegions(1), + allowLogSetKills(true), tssMode(TSSMode::Disabled), configDBType(ConfigDBType::DISABLED), isStopped(false), + lastConnectionFailure(0), connectionFailuresDisableDuration(0), speedUpSimulation(false), + connectionFailureEnableTime(0), disableTLogRecoveryFinish(false), backupAgents(BackupAgentType::WaitForType), + drAgents(BackupAgentType::WaitForType), allSwapsDisabled(false), blobGranulesEnabled(false) {} +ISimulator::~ISimulator() = default; + bool simulator_should_inject_fault(const char* context, const char* file, int line, int error_code) { if (!g_network->isSimulated() || !faultInjectionActivated) return false; - auto p = g_simulator.getCurrentProcess(); + auto p = g_simulator->getCurrentProcess(); if (p->fault_injection_p2 && deterministicRandom()->random01() < p->fault_injection_p2 && - !g_simulator.speedUpSimulation) { + !g_simulator->speedUpSimulation) { uint32_t h1 = line + (p->fault_injection_r >> 32); if (h1 < p->fault_injection_p1 * std::numeric_limits::max()) { - TEST(true); // A fault was injected - TEST(error_code == error_code_io_timeout); // An io timeout was injected - TEST(error_code == error_code_io_error); // An io error was injected - TEST(error_code == error_code_platform_error); // A platform error was injected. + CODE_PROBE(true, "A fault was injected", probe::assert::simOnly, probe::context::sim2); + CODE_PROBE(error_code == error_code_io_timeout, + "An io timeout was injected", + probe::assert::simOnly, + probe::context::sim2); + CODE_PROBE(error_code == error_code_io_error, + "An io error was injected", + probe::assert::simOnly, + probe::context::sim2); + CODE_PROBE(error_code == error_code_platform_error, + "A platform error was injected.", + probe::assert::simOnly, + probe::context::sim2); TraceEvent(SevWarn, "FaultInjected") .detail("Context", context) .detail("File", file) @@ -84,6 +116,56 @@ bool simulator_should_inject_fault(const char* context, const char* file, int li return false; } +bool simulator_should_inject_blob_fault(const char* context, const char* file, int line, int error_code) { + if (!g_network->isSimulated() || !faultInjectionActivated) + return false; + + auto p = g_simulator->getCurrentProcess(); + + if (!g_simulator->speedUpSimulation && deterministicRandom()->random01() < p->blob_inject_failure_rate) { + CODE_PROBE(true, "A blob fault was injected", probe::assert::simOnly, probe::context::sim2); + CODE_PROBE(error_code == error_code_http_request_failed, + "A failed http request was injected", + probe::assert::simOnly, + probe::context::sim2); + TraceEvent("BlobFaultInjected") + .detail("Context", context) + .detail("File", file) + .detail("Line", line) + .detail("ErrorCode", error_code); + return true; + } + + return false; +} + +void ISimulator::disableFor(const std::string& desc, double time) { + disabledMap[desc] = time; +} + +double ISimulator::checkDisabled(const std::string& desc) const { + auto iter = disabledMap.find(desc); + if (iter != disabledMap.end()) { + return iter->second; + } + return 0; +} + +bool ISimulator::checkInjectedCorruption() { + auto iter = corruptWorkerMap.find(currentProcess->address); + if (iter != corruptWorkerMap.end()) + return iter->second; + return false; +} + +flowGlobalType ISimulator::global(int id) const { + return getCurrentProcess()->global(id); +}; + +void ISimulator::setGlobal(size_t id, flowGlobalType v) { + getCurrentProcess()->setGlobal(id, v); +}; + void ISimulator::displayWorkers() const { std::map> machineMap; @@ -106,20 +188,39 @@ void ISimulator::displayWorkers() const { for (auto& processInfo : machineRecord.second) { printf(" %9s %-10s%-13s%-8s %-6s %-9s %-8s %-48s %-40s\n", processInfo->address.toString().c_str(), - processInfo->name, + processInfo->name.c_str(), processInfo->startingClass.toString().c_str(), (processInfo->isExcluded() ? "True" : "False"), (processInfo->failed ? "True" : "False"), (processInfo->rebooting ? "True" : "False"), (processInfo->isCleared() ? "True" : "False"), getRoles(processInfo->address).c_str(), - processInfo->dataFolder); + processInfo->dataFolder.c_str()); } } return; } +WipedString ISimulator::makeToken(int64_t tenantId, uint64_t ttlSecondsFromNow) { + ASSERT_GT(authKeys.size(), 0); + auto tokenSpec = authz::jwt::TokenRef{}; + auto [keyName, key] = *authKeys.begin(); + tokenSpec.algorithm = key.algorithm() == PKeyAlgorithm::EC ? authz::Algorithm::ES256 : authz::Algorithm::RS256; + tokenSpec.keyId = keyName; + tokenSpec.issuer = "sim2_issuer"_sr; + tokenSpec.subject = "sim2_testing"_sr; + auto const now = static_cast(g_network->timer()); + tokenSpec.notBeforeUnixTime = now - 1; + tokenSpec.issuedAtUnixTime = now; + tokenSpec.expiresAtUnixTime = now + ttlSecondsFromNow; + auto const tokenId = deterministicRandom()->randomAlphaNumeric(10); + tokenSpec.tokenId = StringRef(tokenId); + tokenSpec.tenants = VectorRef(&tenantId, 1); + Arena arena; + return WipedString(authz::jwt::signToken(arena, tokenSpec, key)); +} + int openCount = 0; struct SimClogging { @@ -134,17 +235,17 @@ struct SimClogging { double tnow = now(); double t = tnow + (stableConnection ? 0.1 : 1.0) * halfLatency(); - if (!g_simulator.speedUpSimulation && !stableConnection) + if (!g_simulator->speedUpSimulation && !stableConnection) t += clogPairLatency[pair]; - if (!g_simulator.speedUpSimulation && !stableConnection && clogPairUntil.count(pair)) + if (!g_simulator->speedUpSimulation && !stableConnection && clogPairUntil.count(pair)) t = std::max(t, clogPairUntil[pair]); auto p = std::make_pair(from, to); - if (!g_simulator.speedUpSimulation && !stableConnection && clogProcessPairUntil.count(p)) + if (!g_simulator->speedUpSimulation && !stableConnection && clogProcessPairUntil.count(p)) t = std::max(t, clogProcessPairUntil[p]); - if (!g_simulator.speedUpSimulation && !stableConnection && clogRecvUntil.count(to.ip)) + if (!g_simulator->speedUpSimulation && !stableConnection && clogRecvUntil.count(to.ip)) t = std::max(t, clogRecvUntil[to.ip]); return t - tnow; @@ -152,7 +253,7 @@ struct SimClogging { bool disconnected(const IPAddress& from, const IPAddress& to) { auto pair = std::make_pair(from, to); - if (g_simulator.speedUpSimulation || disconnectPairUntil.find(pair) == disconnectPairUntil.end()) { + if (g_simulator->speedUpSimulation || disconnectPairUntil.find(pair) == disconnectPairUntil.end()) { return false; } @@ -212,7 +313,7 @@ struct SimClogging { double halfLatency() const { double a = deterministicRandom()->random01(); const double pFast = 0.999; - if (a <= pFast || g_simulator.speedUpSimulation) { + if (a <= pFast || g_simulator->speedUpSimulation) { a = a / pFast; return 0.5 * (FLOW_KNOBS->MIN_NETWORK_LATENCY * (1 - a) + FLOW_KNOBS->FAST_NETWORK_LATENCY / pFast * a); // 0.5ms average @@ -228,7 +329,7 @@ SimClogging g_clogging; struct Sim2Conn final : IConnection, ReferenceCounted { Sim2Conn(ISimulator::ProcessInfo* process) - : opened(false), closedByCaller(false), stableConnection(false), process(process), + : opened(false), closedByCaller(false), stableConnection(false), trustedPeer(true), process(process), dbgid(deterministicRandom()->randomUniqueID()), stopReceive(Never()) { pipes = sender(this) && receiver(this); } @@ -287,6 +388,8 @@ struct Sim2Conn final : IConnection, ReferenceCounted { bool isPeerGone() const { return !peer || peerProcess->failed; } + bool hasTrustedPeer() const override { return trustedPeer; } + bool isStableConnection() const override { return stableConnection; } void peerClosed() { @@ -355,7 +458,7 @@ struct Sim2Conn final : IConnection, ReferenceCounted { boost::asio::ip::tcp::socket& getSocket() override { throw operation_failed(); } - bool opened, closedByCaller, stableConnection; + bool opened, closedByCaller, stableConnection, trustedPeer; private: ISimulator::ProcessInfo *process, *peerProcess; @@ -389,7 +492,7 @@ struct Sim2Conn final : IConnection, ReferenceCounted { ACTOR static Future sender(Sim2Conn* self) { loop { wait(self->writtenBytes.onChange()); // takes place on peer! - ASSERT(g_simulator.getCurrentProcess() == self->peerProcess); + ASSERT(g_simulator->getCurrentProcess() == self->peerProcess); wait(delay(.002 * deterministicRandom()->random01())); self->sentBytes.set(self->writtenBytes.get()); // or possibly just some sometimes... } @@ -397,10 +500,10 @@ struct Sim2Conn final : IConnection, ReferenceCounted { ACTOR static Future receiver(Sim2Conn* self) { loop { if (self->sentBytes.get() != self->receivedBytes.get()) - wait(g_simulator.onProcess(self->peerProcess)); + wait(g_simulator->onProcess(self->peerProcess)); while (self->sentBytes.get() == self->receivedBytes.get()) wait(self->sentBytes.onChange()); - ASSERT(g_simulator.getCurrentProcess() == self->peerProcess); + ASSERT(g_simulator->getCurrentProcess() == self->peerProcess); // Simulated network disconnection. Make sure to only throw connection_failed() on the sender process. if (g_clogging.disconnected(self->peerProcess->address.ip, self->process->address.ip)) { @@ -417,31 +520,31 @@ struct Sim2Conn final : IConnection, ReferenceCounted { : deterministicRandom()->randomInt64(self->receivedBytes.get(), self->sentBytes.get() + 1); wait(delay(g_clogging.getSendDelay( self->peerProcess->address, self->process->address, self->isStableConnection()))); - wait(g_simulator.onProcess(self->process)); - ASSERT(g_simulator.getCurrentProcess() == self->process); + wait(g_simulator->onProcess(self->process)); + ASSERT(g_simulator->getCurrentProcess() == self->process); wait(delay(g_clogging.getRecvDelay( self->peerProcess->address, self->process->address, self->isStableConnection()))); - ASSERT(g_simulator.getCurrentProcess() == self->process); + ASSERT(g_simulator->getCurrentProcess() == self->process); if (self->stopReceive.isReady()) { wait(Future(Never())); } self->receivedBytes.set(pos); wait(Future(Void())); // Prior notification can delete self and cancel this actor - ASSERT(g_simulator.getCurrentProcess() == self->process); + ASSERT(g_simulator->getCurrentProcess() == self->process); } } ACTOR static Future whenReadable(Sim2Conn* self) { try { loop { if (self->readBytes.get() != self->receivedBytes.get()) { - ASSERT(g_simulator.getCurrentProcess() == self->process); + ASSERT(g_simulator->getCurrentProcess() == self->process); return Void(); } wait(self->receivedBytes.onChange()); self->rollRandomClose(); } } catch (Error& e) { - ASSERT(g_simulator.getCurrentProcess() == self->process); + ASSERT(g_simulator->getCurrentProcess() == self->process); throw; } } @@ -451,20 +554,20 @@ struct Sim2Conn final : IConnection, ReferenceCounted { if (!self->peer) return Void(); if (self->peer->availableSendBufferForPeer() > 0) { - ASSERT(g_simulator.getCurrentProcess() == self->process); + ASSERT(g_simulator->getCurrentProcess() == self->process); return Void(); } try { wait(self->peer->receivedBytes.onChange()); - ASSERT(g_simulator.getCurrentProcess() == self->peerProcess); + ASSERT(g_simulator->getCurrentProcess() == self->peerProcess); } catch (Error& e) { if (e.code() != error_code_broken_promise) throw; } - wait(g_simulator.onProcess(self->process)); + wait(g_simulator->onProcess(self->process)); } } catch (Error& e) { - ASSERT(g_simulator.getCurrentProcess() == self->process); + ASSERT(g_simulator->getCurrentProcess() == self->process); throw; } } @@ -472,11 +575,11 @@ struct Sim2Conn final : IConnection, ReferenceCounted { void rollRandomClose() { // make sure connections between parenta and their childs are not closed if (!stableConnection && - now() - g_simulator.lastConnectionFailure > g_simulator.connectionFailuresDisableDuration && + now() - g_simulator->lastConnectionFailure > g_simulator->connectionFailuresDisableDuration && deterministicRandom()->random01() < .00001) { - g_simulator.lastConnectionFailure = now(); + g_simulator->lastConnectionFailure = now(); double a = deterministicRandom()->random01(), b = deterministicRandom()->random01(); - TEST(true); // Simulated connection failure + CODE_PROBE(true, "Simulated connection failure", probe::context::sim2, probe::assert::simOnly); TraceEvent("ConnectionFailure", dbgid) .detail("MyAddr", process->address) .detail("PeerAddr", peerProcess->address) @@ -496,7 +599,12 @@ struct Sim2Conn final : IConnection, ReferenceCounted { } ACTOR static Future trackLeakedConnection(Sim2Conn* self) { - wait(g_simulator.onProcess(self->process)); + // FIXME: we could also just implement connection idle closing for sim http server instead + if (g_simulator->httpServerIps.count(self->process->address.ip)) { + return Void(); + } + wait(g_simulator->onProcess(self->process)); + if (self->process->address.isPublic()) { wait(delay(FLOW_KNOBS->CONNECTION_MONITOR_IDLE_TIMEOUT * FLOW_KNOBS->CONNECTION_MONITOR_IDLE_TIMEOUT * 1.5 + FLOW_KNOBS->CONNECTION_MONITOR_LOOP_TIME * 2.1 + FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT)); @@ -506,6 +614,7 @@ struct Sim2Conn final : IConnection, ReferenceCounted { TraceEvent(SevError, "LeakedConnection", self->dbgid) .error(connection_leaked()) .detail("MyAddr", self->process->address) + .detail("IsPublic", self->process->address.isPublic()) .detail("PeerAddr", self->peerEndpoint) .detail("PeerId", self->peerId) .detail("Opened", self->opened); @@ -552,15 +661,15 @@ class SimpleFile : public IAsyncFile, public ReferenceCounted { int mode, Reference diskParameters = makeReference(25000, 150000000), bool delayOnWrite = true) { - state ISimulator::ProcessInfo* currentProcess = g_simulator.getCurrentProcess(); + state ISimulator::ProcessInfo* currentProcess = g_simulator->getCurrentProcess(); state TaskPriority currentTaskID = g_network->getCurrentTask(); - if (++openCount >= 3000) { + if (++openCount >= 6000) { TraceEvent(SevError, "TooManyFiles").log(); ASSERT(false); } - if (openCount == 2000) { + if (openCount == 4000) { disableConnectionFailures("TooManyFiles"); } @@ -568,7 +677,7 @@ class SimpleFile : public IAsyncFile, public ReferenceCounted { // filename. We add ".part" below, so we need to stay under 250. ASSERT(basename(filename).size() < 250); - wait(g_simulator.onMachine(currentProcess)); + wait(g_simulator->onMachine(currentProcess)); try { wait(delay(FLOW_KNOBS->MIN_OPEN_TIME + deterministicRandom()->random01() * (FLOW_KNOBS->MAX_OPEN_TIME - FLOW_KNOBS->MIN_OPEN_TIME))); @@ -594,11 +703,11 @@ class SimpleFile : public IAsyncFile, public ReferenceCounted { platform::makeTemporary(open_filename.c_str()); SimpleFile* simpleFile = new SimpleFile(h, diskParameters, delayOnWrite, filename, open_filename, flags); state Reference file = Reference(simpleFile); - wait(g_simulator.onProcess(currentProcess, currentTaskID)); + wait(g_simulator->onProcess(currentProcess, currentTaskID)); return file; } catch (Error& e) { state Error err = e; - wait(g_simulator.onProcess(currentProcess, currentTaskID)); + wait(g_simulator->onProcess(currentProcess, currentTaskID)); throw err; } } @@ -812,15 +921,29 @@ class SimpleFile : public IAsyncFile, public ReferenceCounted { if (self->flags & OPEN_ATOMIC_WRITE_AND_CREATE) { self->flags &= ~OPEN_ATOMIC_WRITE_AND_CREATE; - auto& machineCache = g_simulator.getCurrentProcess()->machine->openFiles; + auto& machineCache = g_simulator->getCurrentProcess()->machine->openFiles; std::string sourceFilename = self->filename + ".part"; if (machineCache.count(sourceFilename)) { + // it seems gcc has some trouble with these types. Aliasing with typename is ugly, but seems to work. + using block_value_type = typename decltype(g_simulator->corruptedBlocks)::key_type::second_type; TraceEvent("SimpleFileRename") .detail("From", sourceFilename) .detail("To", self->filename) .detail("SourceCount", machineCache.count(sourceFilename)) .detail("FileCount", machineCache.count(self->filename)); + auto maxBlockValue = std::numeric_limits::max(); + g_simulator->corruptedBlocks.erase( + g_simulator->corruptedBlocks.lower_bound(std::make_pair(sourceFilename, 0u)), + g_simulator->corruptedBlocks.upper_bound(std::make_pair(self->filename, maxBlockValue))); + // next we need to rename all files. In practice, the number of corruptions for a given file should be + // very small + auto begin = g_simulator->corruptedBlocks.lower_bound(std::make_pair(sourceFilename, 0u)), + end = g_simulator->corruptedBlocks.upper_bound(std::make_pair(sourceFilename, maxBlockValue)); + for (auto iter = begin; iter != end; ++iter) { + g_simulator->corruptedBlocks.emplace(self->filename, iter->second); + } + g_simulator->corruptedBlocks.erase(begin, end); renameFile(sourceFilename.c_str(), self->filename.c_str()); machineCache[self->filename] = machineCache[sourceFilename]; @@ -896,7 +1019,7 @@ struct Sim2Listener final : IListener, ReferenceCounted { PromiseStream> nextConnection; ACTOR static void incoming(Reference self, double seconds, Reference conn) { - wait(g_simulator.onProcess(self->process)); + wait(g_simulator->onProcess(self->process)); wait(delay(seconds)); if (((Sim2Conn*)conn.getPtr())->isPeerGone() && deterministicRandom()->random01() < 0.5) return; @@ -914,7 +1037,7 @@ struct Sim2Listener final : IListener, ReferenceCounted { NetworkAddress address; }; -#define g_sim2 ((Sim2&)g_simulator) +#define g_sim2 ((Sim2&)(*g_simulator)) class Sim2 final : public ISimulator, public INetworkConnections { public: @@ -941,20 +1064,25 @@ class Sim2 final : public ISimulator, public INetworkConnections { } Future delay(double seconds, TaskPriority taskID, ProcessInfo* machine, bool ordered = false) { ASSERT(seconds >= -0.0001); - seconds = std::max(0.0, seconds); - Future f; - if (!ordered && !currentProcess->rebooting && machine == currentProcess && - !currentProcess->shutdownSignal.isSet() && FLOW_KNOBS->MAX_BUGGIFIED_DELAY > 0 && - deterministicRandom()->random01() < 0.25) { // FIXME: why doesn't this work when we are changing machines? - seconds += FLOW_KNOBS->MAX_BUGGIFIED_DELAY * pow(deterministicRandom()->random01(), 1000.0); - } + if (seconds >= 4e12) // Intervals that overflow an int64_t in microseconds (more than 100,000 years) are treated + // as infinite + return Never(); - mutex.enter(); - tasks.push(Task(time + seconds, taskID, taskCount++, machine, f)); - mutex.leave(); - - return f; + PromiseTask* t = new PromiseTask(machine); + if (seconds <= TIME_EPS) { + taskQueue.addReady(taskID, t); + } else { + if (!ordered && !currentProcess->rebooting && machine == currentProcess && + !currentProcess->shutdownSignal.isSet() && FLOW_KNOBS->MAX_BUGGIFIED_DELAY > 0 && + deterministicRandom()->random01() < 0.25) { + // FIXME: why doesn't this work when we are changing machines? + seconds += FLOW_KNOBS->MAX_BUGGIFIED_DELAY * pow(deterministicRandom()->random01(), 1000.0); + } + double at = now() + seconds; + taskQueue.addTimer(at, taskID, t); + } + return t->promise.getFuture(); } ACTOR static Future checkShutdown(Sim2* self, TaskPriority taskID) { wait(success(self->getCurrentProcess()->shutdownSignal.getFuture())); @@ -1015,6 +1143,10 @@ class Sim2 final : public ISimulator, public INetworkConnections { } Future> connectExternal(NetworkAddress toAddr) override { + // If sim http connection, do connect instead of external connect + if (httpServerIps.count(toAddr.ip)) { + return connect(toAddr); + } return SimExternalConnection::connect(toAddr); } @@ -1134,7 +1266,7 @@ class Sim2 final : public ISimulator, public INetworkConnections { SimThreadArgs(THREAD_FUNC_RETURN (*func)(void*), void* arg) : func(func), arg(arg) { ASSERT(g_network->isSimulated()); - currentProcess = g_simulator.getCurrentProcess(); + currentProcess = g_simulator->getCurrentProcess(); } }; @@ -1208,59 +1340,70 @@ class Sim2 final : public ISimulator, public INetworkConnections { // This is a _rudimentary_ simulation of the untrustworthiness of non-durable deletes and the possibility of // rebooting during a durable one. It isn't perfect: for example, on real filesystems testing // for the existence of a non-durably deleted file BEFORE a reboot will show that it apparently doesn't exist. - if (g_simulator.getCurrentProcess()->machine->openFiles.count(filename)) { - g_simulator.getCurrentProcess()->machine->openFiles.erase(filename); - g_simulator.getCurrentProcess()->machine->deletingOrClosingFiles.insert(filename); + if (g_simulator->getCurrentProcess()->machine->openFiles.count(filename)) { + g_simulator->getCurrentProcess()->machine->openFiles.erase(filename); + g_simulator->getCurrentProcess()->machine->deletingOrClosingFiles.insert(filename); } if (mustBeDurable || deterministicRandom()->random01() < 0.5) { - state ISimulator::ProcessInfo* currentProcess = g_simulator.getCurrentProcess(); + state ISimulator::ProcessInfo* currentProcess = g_simulator->getCurrentProcess(); state TaskPriority currentTaskID = g_network->getCurrentTask(); TraceEvent(SevDebug, "Sim2DeleteFileImpl") .detail("CurrentProcess", currentProcess->toString()) .detail("Filename", filename) .detail("Durable", mustBeDurable); - wait(g_simulator.onMachine(currentProcess)); + wait(g_simulator->onMachine(currentProcess)); try { wait(::delay(0.05 * deterministicRandom()->random01())); if (!currentProcess->rebooting) { auto f = IAsyncFileSystem::filesystem(self->net2)->deleteFile(filename, false); ASSERT(f.isReady()); wait(::delay(0.05 * deterministicRandom()->random01())); - TEST(true); // Simulated durable delete + CODE_PROBE(true, "Simulated durable delete", probe::context::sim2, probe::assert::simOnly); } - wait(g_simulator.onProcess(currentProcess, currentTaskID)); + wait(g_simulator->onProcess(currentProcess, currentTaskID)); return Void(); } catch (Error& e) { state Error err = e; - wait(g_simulator.onProcess(currentProcess, currentTaskID)); + wait(g_simulator->onProcess(currentProcess, currentTaskID)); throw err; } } else { TraceEvent(SevDebug, "Sim2DeleteFileImplNonDurable") .detail("Filename", filename) .detail("Durable", mustBeDurable); - TEST(true); // Simulated non-durable delete + CODE_PROBE(true, "Simulated non-durable delete", probe::context::sim2, probe::assert::simOnly); return Void(); } } static void runLoop(Sim2* self) { ISimulator::ProcessInfo* callingMachine = self->currentProcess; + int lastPrintTime = 0; while (!self->isStopped) { - self->mutex.enter(); - if (self->tasks.size() == 0) { - self->mutex.leave(); - ASSERT(false); + if (self->taskQueue.canSleep()) { + double sleepTime = self->taskQueue.getSleepTime(self->time); + self->time += + sleepTime + FLOW_KNOBS->MAX_RUNLOOP_SLEEP_DELAY * pow(deterministicRandom()->random01(), 1000.0); + if (self->printSimTime && (int)self->time > lastPrintTime) { + printf("Time: %d\n", (int)self->time); + lastPrintTime = (int)self->time; + } + self->timerTime = std::max(self->timerTime, self->time); } // if (!randLog/* && now() >= 32.0*/) // randLog = fopen("randLog.txt", "wt"); - Task t = std::move(self->tasks.top()); // Unfortunately still a copy under gcc where .top() returns const& - self->currentTaskID = t.taskID; - self->tasks.pop(); - self->mutex.leave(); - self->execTask(t); - self->yielded = false; + self->taskQueue.processReadyTimers(self->time); + self->taskQueue.processThreadReady(); + + while (self->taskQueue.hasReadyTask()) { + self->currentTaskID = self->taskQueue.getReadyTaskID(); + PromiseTask* task = self->taskQueue.getReadyTask(); + self->taskQueue.popReadyTask(); + self->execTask(*task); + delete task; + self->yielded = false; + } } self->currentProcess = callingMachine; for (auto& fn : self->stopCallbacks) { @@ -1279,7 +1422,8 @@ class Sim2 final : public ISimulator, public INetworkConnections { ProcessClass startingClass, const char* dataFolder, const char* coordinationFolder, - ProtocolVersion protocol) override { + ProtocolVersion protocol, + bool drProcess) override { ASSERT(locality.machineId().present()); MachineInfo& machine = machines[locality.machineId().get()]; if (!machine.machineId.present()) @@ -1326,9 +1470,10 @@ class Sim2 final : public ISimulator, public INetworkConnections { m->machine = &machine; machine.processes.push_back(m); currentlyRebootingProcesses.erase(addresses.address); - m->excluded = g_simulator.isExcluded(NetworkAddress(ip, port, true, false)); - m->cleared = g_simulator.isCleared(addresses.address); + m->excluded = g_simulator->isExcluded(NetworkAddress(ip, port, true, false)); + m->cleared = g_simulator->isCleared(addresses.address); m->protocolVersion = protocol; + m->drProcess = drProcess; m->setGlobal(enTDMetrics, (flowGlobalType)&m->tdmetrics); if (FLOW_KNOBS->ENABLE_CHAOS_FEATURES) { @@ -1336,13 +1481,15 @@ class Sim2 final : public ISimulator, public INetworkConnections { } m->setGlobal(enNetworkConnections, (flowGlobalType)m->network); m->setGlobal(enASIOTimedOut, (flowGlobalType) false); + m->setGlobal(INetwork::enMetrics, (flowGlobalType)&m->metrics); TraceEvent("NewMachine") .detail("Name", name) .detail("Address", m->address) .detail("MachineId", m->locality.machineId()) .detail("Excluded", m->excluded) - .detail("Cleared", m->cleared); + .detail("Cleared", m->cleared) + .detail("DrProcess", m->drProcess); if (std::string(name) == "remote flow process") { protectedAddresses.insert(m->address); @@ -1364,7 +1511,20 @@ class Sim2 final : public ISimulator, public INetworkConnections { } } } - return canKillProcesses(processesLeft, processesDead, KillInstantly, nullptr); + return canKillProcesses(processesLeft, processesDead, KillType::KillInstantly, nullptr); + } + + std::vector getAllAddressesInDCToExclude(Optional> dcId) const override { + std::vector addresses; + if (!dcId.present()) { + return addresses; + } + for (const auto& processInfo : getAllProcesses()) { + if (processInfo->locality.dcId() == dcId) { + addresses.emplace_back(processInfo->address.ip, processInfo->address.port); + } + } + return addresses; } bool datacenterDead(Optional> dcId) const override { @@ -1376,7 +1536,8 @@ class Sim2 final : public ISimulator, public INetworkConnections { std::vector primaryLocalitiesDead, primaryLocalitiesLeft; for (auto processInfo : getAllProcesses()) { - if (processInfo->isAvailableClass() && processInfo->locality.dcId() == dcId) { + if (!processInfo->isSpawnedKVProcess() && processInfo->isAvailableClass() && + processInfo->locality.dcId() == dcId) { if (processInfo->isExcluded() || processInfo->isCleared() || !processInfo->isAvailable()) { primaryProcessesDead.add(processInfo->locality); primaryLocalitiesDead.push_back(processInfo->locality); @@ -1396,10 +1557,50 @@ class Sim2 final : public ISimulator, public INetworkConnections { if (usableRegions > 1 && remoteTLogPolicy && !primaryTLogsDead) { primaryTLogsDead = primaryProcessesDead.validate(remoteTLogPolicy); } - return primaryTLogsDead || primaryProcessesDead.validate(storagePolicy); } + // The following function will determine if a machine can be remove in case when it has a blob worker + bool canKillMachineWithBlobWorkers(Optional> machineId, KillType kt, KillType* ktFinal) { + // Allow if no blob workers, or it's a reboot(without removing the machine) + // FIXME: this should be || + if (!blobGranulesEnabled && kt >= KillType::RebootAndDelete) { + return true; + } + + // Allow if the machine doesn't support blob worker + MachineInfo& currentMachine = machines[machineId]; + bool hasBlobWorker = false; + for (auto processInfo : currentMachine.processes) { + if (processInfo->startingClass == ProcessClass::BlobWorkerClass) { + hasBlobWorker = true; + break; + } + } + if (!hasBlobWorker) + return true; + + // Count # remaining support blob workers in current dc + auto currentDcId = currentMachine.machineProcess->locality.dcId(); + int nLeft = 0; + for (auto processInfo : getAllProcesses()) { + if (currentDcId != processInfo->locality.dcId() || // skip other dc + processInfo->startingClass != ProcessClass::BlobWorkerClass || // skip non blob workers + processInfo->failed || // if process was killed but has not yet been removed from the process list + processInfo->locality.machineId() == machineId) { // skip current machine + continue; + } + nLeft++; // alive blob workers after killing machineId + } + + // Ensure there is at least 1 remaining blob workers after removing current machine + if (nLeft <= 1) { + *ktFinal = KillType::RebootAndDelete; // reboot and delete data, but keep this machine + return false; + } + return true; + } + // The following function will determine if the specified configuration of available and dead processes can allow // the cluster to survive bool canKillProcesses(std::vector const& availableProcesses, @@ -1410,8 +1611,8 @@ class Sim2 final : public ISimulator, public INetworkConnections { int nQuorum = ((desiredCoordinators + 1) / 2) * 2 - 1; KillType newKt = kt; - if ((kt == KillInstantly) || (kt == InjectFaults) || (kt == FailDisk) || (kt == RebootAndDelete) || - (kt == RebootProcessAndDelete)) { + if ((kt == KillType::KillInstantly) || (kt == KillType::InjectFaults) || (kt == KillType::FailDisk) || + (kt == KillType::RebootAndDelete) || (kt == KillType::RebootProcessAndDelete)) { LocalityGroup primaryProcessesLeft, primaryProcessesDead; LocalityGroup primarySatelliteProcessesLeft, primarySatelliteProcessesDead; LocalityGroup remoteProcessesLeft, remoteProcessesDead; @@ -1425,7 +1626,7 @@ class Sim2 final : public ISimulator, public INetworkConnections { std::vector badCombo; std::set>> uniqueMachines; - if (!primaryDcId.present()) { + if (!primaryDcId.present() || usableRegions == 1) { for (auto processInfo : availableProcesses) { primaryProcessesLeft.add(processInfo->locality); primaryLocalitiesLeft.push_back(processInfo->locality); @@ -1441,17 +1642,20 @@ class Sim2 final : public ISimulator, public INetworkConnections { if (processInfo->locality.dcId() == primaryDcId) { primaryProcessesLeft.add(processInfo->locality); primaryLocalitiesLeft.push_back(processInfo->locality); - } else if (processInfo->locality.dcId() == remoteDcId) { + } + if (processInfo->locality.dcId() == remoteDcId) { remoteProcessesLeft.add(processInfo->locality); remoteLocalitiesLeft.push_back(processInfo->locality); - } else if (std::find(primarySatelliteDcIds.begin(), - primarySatelliteDcIds.end(), - processInfo->locality.dcId()) != primarySatelliteDcIds.end()) { + } + if (std::find(primarySatelliteDcIds.begin(), + primarySatelliteDcIds.end(), + processInfo->locality.dcId()) != primarySatelliteDcIds.end()) { primarySatelliteProcessesLeft.add(processInfo->locality); primarySatelliteLocalitiesLeft.push_back(processInfo->locality); - } else if (std::find(remoteSatelliteDcIds.begin(), - remoteSatelliteDcIds.end(), - processInfo->locality.dcId()) != remoteSatelliteDcIds.end()) { + } + if (std::find(remoteSatelliteDcIds.begin(), + remoteSatelliteDcIds.end(), + processInfo->locality.dcId()) != remoteSatelliteDcIds.end()) { remoteSatelliteProcessesLeft.add(processInfo->locality); remoteSatelliteLocalitiesLeft.push_back(processInfo->locality); } @@ -1460,17 +1664,20 @@ class Sim2 final : public ISimulator, public INetworkConnections { if (processInfo->locality.dcId() == primaryDcId) { primaryProcessesDead.add(processInfo->locality); primaryLocalitiesDead.push_back(processInfo->locality); - } else if (processInfo->locality.dcId() == remoteDcId) { + } + if (processInfo->locality.dcId() == remoteDcId) { remoteProcessesDead.add(processInfo->locality); remoteLocalitiesDead.push_back(processInfo->locality); - } else if (std::find(primarySatelliteDcIds.begin(), - primarySatelliteDcIds.end(), - processInfo->locality.dcId()) != primarySatelliteDcIds.end()) { + } + if (std::find(primarySatelliteDcIds.begin(), + primarySatelliteDcIds.end(), + processInfo->locality.dcId()) != primarySatelliteDcIds.end()) { primarySatelliteProcessesDead.add(processInfo->locality); primarySatelliteLocalitiesDead.push_back(processInfo->locality); - } else if (std::find(remoteSatelliteDcIds.begin(), - remoteSatelliteDcIds.end(), - processInfo->locality.dcId()) != remoteSatelliteDcIds.end()) { + } + if (std::find(remoteSatelliteDcIds.begin(), + remoteSatelliteDcIds.end(), + processInfo->locality.dcId()) != remoteSatelliteDcIds.end()) { remoteSatelliteProcessesDead.add(processInfo->locality); remoteSatelliteLocalitiesDead.push_back(processInfo->locality); } @@ -1577,8 +1784,8 @@ class Sim2 final : public ISimulator, public INetworkConnections { } // Reboot if dead machines do fulfill policies - if (tooManyDead) { - newKt = Reboot; + if (tooManyDead || (usableRegions > 1 && notEnoughLeft)) { + newKt = KillType::Reboot; canSurvive = false; TraceEvent("KillChanged") .detail("KillType", kt) @@ -1587,16 +1794,16 @@ class Sim2 final : public ISimulator, public INetworkConnections { .detail("Reason", "Too many dead processes that cannot satisfy tLogPolicy."); } // Reboot and Delete if remaining machines do NOT fulfill policies - else if ((kt < RebootAndDelete) && notEnoughLeft) { - newKt = RebootAndDelete; + else if ((kt < KillType::RebootAndDelete) && notEnoughLeft) { + newKt = KillType::RebootAndDelete; canSurvive = false; TraceEvent("KillChanged") .detail("KillType", kt) .detail("NewKillType", newKt) .detail("TLogPolicy", tLogPolicy->info()) .detail("Reason", "Not enough tLog left to satisfy tLogPolicy."); - } else if ((kt < RebootAndDelete) && (nQuorum > uniqueMachines.size())) { - newKt = RebootAndDelete; + } else if ((kt < KillType::RebootAndDelete) && (nQuorum > uniqueMachines.size())) { + newKt = KillType::RebootAndDelete; canSurvive = false; TraceEvent("KillChanged") .detail("KillType", kt) @@ -1632,15 +1839,26 @@ class Sim2 final : public ISimulator, public INetworkConnections { std::swap(*it, processes.back()); } processes.pop_back(); - killProcess_internal(p, KillInstantly); + killProcess_internal(p, KillType::KillInstantly); } void killProcess_internal(ProcessInfo* machine, KillType kt) { - TEST(true); // Simulated machine was killed with any kill type - TEST(kt == KillInstantly); // Simulated machine was killed instantly - TEST(kt == InjectFaults); // Simulated machine was killed with faults - TEST(kt == FailDisk); // Simulated machine was killed with a failed disk - - if (kt == KillInstantly) { + CODE_PROBE( + true, "Simulated machine was killed with any kill type", probe::context::sim2, probe::assert::simOnly); + CODE_PROBE(kt == KillType::KillInstantly, + "Simulated machine was killed instantly", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE(kt == KillType::InjectFaults, + "Simulated machine was killed with faults", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE(kt == KillType::FailDisk, + "Simulated machine was killed with a failed disk", + probe::context::sim2, + probe::assert::simOnly, + probe::decoration::rare); + + if (kt == KillType::KillInstantly) { TraceEvent(SevWarn, "FailMachine") .detail("Name", machine->name) .detail("Address", machine->address) @@ -1650,10 +1868,10 @@ class Sim2 final : public ISimulator, public INetworkConnections { .detail("Protected", protectedAddresses.count(machine->address)) .backtrace(); // This will remove all the "tracked" messages that came from the machine being killed - if (std::string(machine->name) != "remote flow process") + if (!machine->isSpawnedKVProcess()) latestEventCache.clear(); machine->failed = true; - } else if (kt == InjectFaults) { + } else if (kt == KillType::InjectFaults) { TraceEvent(SevWarn, "FaultMachine") .detail("Name", machine->name) .detail("Address", machine->address) @@ -1666,8 +1884,8 @@ class Sim2 final : public ISimulator, public INetworkConnections { machine->fault_injection_r = deterministicRandom()->randomUniqueID().first(); machine->fault_injection_p1 = 0.1; machine->fault_injection_p2 = deterministicRandom()->random01(); - } else if (kt == FailDisk) { - TraceEvent(SevWarn, "FailDiskMachine") + } else if (kt == KillType::FailDisk) { + TraceEvent(SevWarn, "KillType::FailDiskMachine") .detail("Name", machine->name) .detail("Address", machine->address) .detail("ZoneId", machine->locality.zoneId()) @@ -1679,17 +1897,16 @@ class Sim2 final : public ISimulator, public INetworkConnections { } else { ASSERT(false); } - ASSERT(!protectedAddresses.count(machine->address) || machine->rebooting || - std::string(machine->name) == "remote flow process"); + ASSERT(!protectedAddresses.count(machine->address) || machine->rebooting || machine->isSpawnedKVProcess()); } void rebootProcess(ProcessInfo* process, KillType kt) override { - if (kt == RebootProcessAndDelete && protectedAddresses.count(process->address)) { + if (kt == KillType::RebootProcessAndDelete && protectedAddresses.count(process->address)) { TraceEvent("RebootChanged") .detail("ZoneId", process->locality.describeZone()) - .detail("KillType", RebootProcess) + .detail("KillType", KillType::RebootProcess) .detail("OrigKillType", kt) .detail("Reason", "Protected process"); - kt = RebootProcess; + kt = KillType::RebootProcess; } doReboot(process, kt); } @@ -1698,7 +1915,7 @@ class Sim2 final : public ISimulator, public INetworkConnections { auto processes = getAllProcesses(); for (int i = 0; i < processes.size(); i++) if (processes[i]->locality.zoneId() == zoneId && !processes[i]->rebooting) - doReboot(processes[i], RebootProcess); + doReboot(processes[i], KillType::RebootProcess); } else { auto processes = getAllProcesses(); for (int i = 0; i < processes.size(); i++) { @@ -1707,20 +1924,25 @@ class Sim2 final : public ISimulator, public INetworkConnections { } } if (processes.size()) - doReboot(deterministicRandom()->randomChoice(processes), RebootProcess); + doReboot(deterministicRandom()->randomChoice(processes), KillType::RebootProcess); } } void killProcess(ProcessInfo* machine, KillType kt) override { TraceEvent("AttemptingKillProcess").detail("ProcessInfo", machine->toString()); - if (kt < RebootAndDelete) { + // Refuse to kill a protected process. + if (kt < KillType::RebootAndDelete && protectedAddresses.count(machine->address) == 0) { killProcess_internal(machine, kt); } } void killInterface(NetworkAddress address, KillType kt) override { - if (kt < RebootAndDelete) { + if (kt < KillType::RebootAndDelete) { std::vector& processes = machines[addressMap[address]->locality.machineId()].processes; - for (int i = 0; i < processes.size(); i++) - killProcess_internal(processes[i], kt); + for (auto& process : processes) { + // Refuse to kill a protected process. + if (protectedAddresses.count(process->address) == 0) { + killProcess_internal(process, kt); + } + } } } bool killZone(Optional> zoneId, KillType kt, bool forceKill, KillType* ktFinal) override { @@ -1739,15 +1961,47 @@ class Sim2 final : public ISimulator, public INetworkConnections { } return result; } + bool killDataHall(Optional> dataHallId, + KillType kt, + bool forceKill, + KillType* ktFinal) override { + auto processes = getAllProcesses(); + std::set>> dataHallMachines; + for (auto& process : processes) { + if (process->locality.dataHallId() == dataHallId) { + dataHallMachines.insert(process->locality.machineId()); + } + } + bool result = false; + for (auto& machineId : dataHallMachines) { + if (killMachine(machineId, kt, forceKill, ktFinal)) { + result = true; + } + } + return result; + } + bool killAll(KillType kt, bool forceKill, KillType* ktFinal) override { + bool result = false; + for (auto& machine : machines) { + if (killMachine(machine.second.machineId, kt, forceKill, ktFinal)) { + result = true; + } + } + return result; + } bool killMachine(Optional> machineId, KillType kt, bool forceKill, KillType* ktFinal) override { auto ktOrig = kt; - TEST(true); // Trying to killing a machine - TEST(kt == KillInstantly); // Trying to kill instantly - TEST(kt == InjectFaults); // Trying to kill by injecting faults + CODE_PROBE(true, "Trying to killing a machine", probe::context::sim2, probe::assert::simOnly); + CODE_PROBE( + kt == KillType::KillInstantly, "Trying to kill instantly", probe::context::sim2, probe::assert::simOnly); + CODE_PROBE(kt == KillType::InjectFaults, + "Trying to kill by injecting faults", + probe::context::sim2, + probe::assert::simOnly); if (speedUpSimulation && !forceKill) { TraceEvent(SevWarn, "AbortedKill") @@ -1755,19 +2009,25 @@ class Sim2 final : public ISimulator, public INetworkConnections { .detail("Reason", "Unforced kill within speedy simulation.") .backtrace(); if (ktFinal) - *ktFinal = None; + *ktFinal = KillType::None; return false; } int processesOnMachine = 0; + bool isMainCluster = true; // false for machines running DR processes KillType originalKt = kt; // Reboot if any of the processes are protected and count the number of processes not rebooting for (auto& process : machines[machineId].processes) { - if (protectedAddresses.count(process->address)) - kt = Reboot; + if (protectedAddresses.count(process->address) && kt != KillType::RebootProcessAndSwitch) { + kt = KillType::Reboot; + } + if (!process->rebooting) processesOnMachine++; + if (process->drProcess) { + isMainCluster = false; + } } // Do nothing, if no processes to kill @@ -1779,13 +2039,22 @@ class Sim2 final : public ISimulator, public INetworkConnections { .detail("ProcessesPerMachine", processesPerMachine) .backtrace(); if (ktFinal) - *ktFinal = None; + *ktFinal = KillType::None; return false; } // Check if machine can be removed, if requested - if (!forceKill && ((kt == KillInstantly) || (kt == InjectFaults) || (kt == FailDisk) || - (kt == RebootAndDelete) || (kt == RebootProcessAndDelete))) { + if (!forceKill && + ((kt == KillType::KillInstantly) || (kt == KillType::InjectFaults) || (kt == KillType::FailDisk) || + (kt == KillType::RebootAndDelete) || (kt == KillType::RebootProcessAndDelete))) { + + if (!canKillMachineWithBlobWorkers(machineId, kt, &kt)) { + TraceEvent("CanKillMachineWithBlobWorkers") + .detail("MachineId", machineId) + .detail("KillType", kt) + .detail("OrigKillType", ktOrig); + } + std::vector processesLeft, processesDead; int protectedWorker = 0, unavailable = 0, excluded = 0, cleared = 0; @@ -1826,7 +2095,8 @@ class Sim2 final : public ISimulator, public INetworkConnections { .detail("ProtectedTotal", protectedAddresses.size()) .detail("TLogPolicy", tLogPolicy->info()) .detail("StoragePolicy", storagePolicy->info()); - } else if ((kt == KillInstantly) || (kt == InjectFaults) || (kt == FailDisk)) { + } else if ((kt == KillType::KillInstantly) || (kt == KillType::InjectFaults) || + (kt == KillType::FailDisk)) { TraceEvent("DeadMachine") .detail("MachineId", machineId) .detail("KillType", kt) @@ -1881,26 +2151,22 @@ class Sim2 final : public ISimulator, public INetworkConnections { } } - TEST(originalKt != kt); // Kill type was changed from requested to reboot. - - // Check if any processes on machine are rebooting - if (processesOnMachine != processesPerMachine && kt >= RebootAndDelete) { - TEST(true); // Attempted reboot, but the target did not have all of its processes running - TraceEvent(SevWarn, "AbortedKill") - .detail("KillType", kt) - .detail("MachineId", machineId) - .detail("Reason", "Machine processes does not match number of processes per machine") - .detail("Processes", processesOnMachine) - .detail("ProcessesPerMachine", processesPerMachine) - .backtrace(); - if (ktFinal) - *ktFinal = None; - return false; - } - - // Check if any processes on machine are rebooting - if (processesOnMachine != processesPerMachine) { - TEST(true); // Attempted reboot and kill, but the target did not have all of its processes running + CODE_PROBE(originalKt != kt, + "Kill type was changed from requested to reboot.", + probe::context::sim2, + probe::assert::simOnly); + + if (isMainCluster && originalKt == KillType::RebootProcessAndSwitch) { + // When killing processes with the RebootProcessAndSwitch kill + // type, processes in the original cluster should be rebooted in + // order to kill any zombie processes. + kt = KillType::Reboot; + } else if (processesOnMachine != processesPerMachine && kt != KillType::RebootProcessAndSwitch) { + // Check if any processes on machine are rebooting + CODE_PROBE(true, + "Attempted reboot, but the target did not have all of its processes running", + probe::context::sim2, + probe::assert::simOnly); TraceEvent(SevWarn, "AbortedKill") .detail("KillType", kt) .detail("MachineId", machineId) @@ -1909,7 +2175,7 @@ class Sim2 final : public ISimulator, public INetworkConnections { .detail("ProcessesPerMachine", processesPerMachine) .backtrace(); if (ktFinal) - *ktFinal = None; + *ktFinal = KillType::None; return false; } @@ -1920,8 +2186,9 @@ class Sim2 final : public ISimulator, public INetworkConnections { .detail("KillableMachines", processesOnMachine) .detail("ProcessPerMachine", processesPerMachine) .detail("KillChanged", kt != ktOrig); - if (kt < RebootAndDelete) { - if ((kt == InjectFaults || kt == FailDisk) && machines[machineId].machineProcess != nullptr) + if (kt < KillType::RebootAndDelete) { + if ((kt == KillType::InjectFaults || kt == KillType::FailDisk) && + machines[machineId].machineProcess != nullptr) killProcess_internal(machines[machineId].machineProcess, kt); for (auto& process : machines[machineId].processes) { TraceEvent("KillMachineProcess") @@ -1935,7 +2202,8 @@ class Sim2 final : public ISimulator, public INetworkConnections { if (process->startingClass != ProcessClass::TesterClass) killProcess_internal(process, kt); } - } else if (kt == Reboot || kt == RebootAndDelete) { + } else if (kt == KillType::Reboot || kt == KillType::RebootAndDelete || + kt == KillType::RebootProcessAndSwitch) { for (auto& process : machines[machineId].processes) { TraceEvent("KillMachineProcess") .detail("KillType", kt) @@ -1950,10 +2218,17 @@ class Sim2 final : public ISimulator, public INetworkConnections { } } - TEST(kt == RebootAndDelete); // Resulted in a reboot and delete - TEST(kt == Reboot); // Resulted in a reboot - TEST(kt == KillInstantly); // Resulted in an instant kill - TEST(kt == InjectFaults); // Resulted in a kill by injecting faults + CODE_PROBE(kt == KillType::RebootAndDelete, + "Resulted in a reboot and delete", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE(kt == KillType::Reboot, "Resulted in a reboot", probe::context::sim2, probe::assert::simOnly); + CODE_PROBE( + kt == KillType::KillInstantly, "Resulted in an instant kill", probe::context::sim2, probe::assert::simOnly); + CODE_PROBE(kt == KillType::InjectFaults, + "Resulted in a kill by injecting faults", + probe::context::sim2, + probe::assert::simOnly); if (ktFinal) *ktFinal = kt; @@ -1972,8 +2247,8 @@ class Sim2 final : public ISimulator, public INetworkConnections { auto processMachineId = procRecord->locality.machineId(); ASSERT(processMachineId.present()); if (processDcId.present() && (processDcId == dcId)) { - if ((kt != Reboot) && (protectedAddresses.count(procRecord->address))) { - kt = Reboot; + if ((kt != KillType::Reboot) && (protectedAddresses.count(procRecord->address))) { + kt = KillType::Reboot; TraceEvent(SevWarn, "DcKillChanged") .detail("DataCenter", dcId) .detail("KillType", kt) @@ -1992,8 +2267,9 @@ class Sim2 final : public ISimulator, public INetworkConnections { } // Check if machine can be removed, if requested - if (!forceKill && ((kt == KillInstantly) || (kt == InjectFaults) || (kt == FailDisk) || - (kt == RebootAndDelete) || (kt == RebootProcessAndDelete))) { + if (!forceKill && + ((kt == KillType::KillInstantly) || (kt == KillType::InjectFaults) || (kt == KillType::FailDisk) || + (kt == KillType::RebootAndDelete) || (kt == KillType::RebootProcessAndDelete))) { std::vector processesLeft, processesDead; for (auto processInfo : getAllProcesses()) { if (processInfo->isAvailableClass()) { @@ -2052,7 +2328,7 @@ class Sim2 final : public ISimulator, public INetworkConnections { .detail("KillType", kt) .detail("KillTypeResult", ktResult) .detail("KillTypeOrig", ktOrig); - ASSERT(ktResult == None); + ASSERT(ktResult == KillType::None); } ktMin = std::min(ktResult, ktMin); } @@ -2067,13 +2343,35 @@ class Sim2 final : public ISimulator, public INetworkConnections { .detail("KillTypeMin", ktMin) .detail("KilledDC", kt == ktMin); - TEST(kt != ktMin); // DataCenter kill was rejected by killMachine - TEST((kt == ktMin) && (kt == RebootAndDelete)); // Datacenter kill Resulted in a reboot and delete - TEST((kt == ktMin) && (kt == Reboot)); // Datacenter kill Resulted in a reboot - TEST((kt == ktMin) && (kt == KillInstantly)); // Datacenter kill Resulted in an instant kill - TEST((kt == ktMin) && (kt == InjectFaults)); // Datacenter kill Resulted in a kill by injecting faults - TEST((kt == ktMin) && (kt != ktOrig)); // Datacenter Kill request was downgraded - TEST((kt == ktMin) && (kt == ktOrig)); // Datacenter kill - Requested kill was done + CODE_PROBE(kt != ktMin, + "DataCenter kill was rejected by killMachine", + probe::context::sim2, + probe::assert::simOnly, + probe::decoration::rare); + CODE_PROBE((kt == ktMin) && (kt == KillType::RebootAndDelete), + "Datacenter kill Resulted in a reboot and delete", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE((kt == ktMin) && (kt == KillType::Reboot), + "Datacenter kill Resulted in a reboot", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE((kt == ktMin) && (kt == KillType::KillInstantly), + "Datacenter kill Resulted in an instant kill", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE((kt == ktMin) && (kt == KillType::InjectFaults), + "Datacenter kill Resulted in a kill by injecting faults", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE((kt == ktMin) && (kt != ktOrig), + "Datacenter Kill request was downgraded", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE((kt == ktMin) && (kt == ktOrig), + "Datacenter kill - Requested kill was done", + probe::context::sim2, + probe::assert::simOnly); if (ktFinal) *ktFinal = ktMin; @@ -2123,6 +2421,18 @@ class Sim2 final : public ISimulator, public INetworkConnections { g_clogging.reconnectPair(from, to); } + void processInjectBlobFault(ProcessInfo* machine, double failureRate) override { + CODE_PROBE(true, "Simulated process beginning blob fault", probe::context::sim2, probe::assert::simOnly); + should_inject_blob_fault = simulator_should_inject_blob_fault; + ASSERT(machine->blob_inject_failure_rate == 0.0); + machine->blob_inject_failure_rate = failureRate; + } + + void processStopInjectBlobFault(ProcessInfo* machine) override { + CODE_PROBE(true, "Simulated process stopping blob fault", probe::context::sim2, probe::assert::simOnly); + machine->blob_inject_failure_rate = 0.0; + } + std::vector getAllProcesses() const override { std::vector processes; for (auto& c : machines) { @@ -2154,13 +2464,112 @@ class Sim2 final : public ISimulator, public INetworkConnections { ASSERT(process->failed); } if (machine.machineProcess) { - killProcess_internal(machine.machineProcess, KillInstantly); + killProcess_internal(machine.machineProcess, KillType::KillInstantly); } machines.erase(machineId); } + // Assumes the simulator is already onProcess for proc + void startRequestHandlerOnProcess(ProcessInfo* process, + Reference serverContext, + Reference handlerContext) { + try { + NetworkAddress addr = serverContext->newAddress(); + process->listenerMap[addr] = Reference(new Sim2Listener(process, addr)); + addressMap[addr] = process; + handlerContext->addAddress(addr); + serverContext->registerNewServer(addr, handlerContext->requestHandler->clone()); + } catch (Error& e) { + // this should never happen, but would cause weird behavior if it did like unintentionally switching + // processes, so just fail + TraceEvent(SevError, "UnexpectedErrorRegisteringHTTPServer").errorUnsuppressed(e); + ASSERT(false); + } + } + + // add a simulated http server process. New http servers called by registerHTTPServer will run on this process + void addSimHTTPProcess(Reference context) override { + ProcessInfo* p = getCurrentProcess(); + + if (!g_simulator->httpProtected) { + // always protect one http server process so that if others are killed permanently, one will always be + // rebooted + fmt::print("SimHTTPServer protecting {0}\n", p->address.toString()); + TraceEvent(SevDebug, "HTTPProcessProtected").detail("Address", p->address); + g_simulator->httpProtected = true; + protectedAddresses.insert(p->address); + } + // make sure this process isn't already added + for (int i = 0; i < httpServerProcesses.size(); i++) { + ASSERT(p != httpServerProcesses[i].first); + } + httpServerProcesses.push_back({ p, context }); + httpServerIps.insert(p->address.ip); + + for (auto& it : httpHandlers) { + startRequestHandlerOnProcess(p, context, it.second); + } + } + + void removeSimHTTPProcess() override { + ProcessInfo* p = getCurrentProcess(); + + bool found = false; + for (int i = 0; i < httpServerProcesses.size(); i++) { + if (p == httpServerProcesses[i].first) { + swapAndPop(&httpServerProcesses, i); + found = true; + break; + } + } + ASSERT(found); + + // FIXME: potentially instead delay removing from DNS for a bit so we still briefly try to talk to dead server + for (auto& it : httpHandlers) { + it.second->removeIp(p->address.ip); + } + } + + ACTOR static Future registerSimHTTPServerActor(Sim2* self, + std::string hostname, + std::string service, + Reference requestHandler) { + // handle race where test client tries to register server before all processes are up, but time out eventually + // FIXME: make this so a server that starts after this or a server that restarts will automatically re-add + // itself, register the handler, and register with dns + std::string id = hostname + ":" + service; + ASSERT(!self->httpHandlers.count(id)); + + state Reference handlerContext = + makeReference(hostname, service, requestHandler); + self->httpHandlers.insert({ id, handlerContext }); + + // start process on all running HTTP servers + state ProcessInfo* callingProcess = self->getCurrentProcess(); + state int i = 0; + // copy the processes before waits just to ensure no races with addSimHTTPProcess + state std::vector>> procsCopy = + self->httpServerProcesses; + for (; i < procsCopy.size(); i++) { + state ProcessInfo* serverProcess = procsCopy[i].first; + wait(self->onProcess(serverProcess, TaskPriority::DefaultYield)); + self->startRequestHandlerOnProcess(serverProcess, procsCopy[i].second, handlerContext); + } + + wait(self->onProcess(callingProcess, TaskPriority::DefaultYield)); + + return Void(); + } + + // starts a numAddresses http servers with the dns alias hostname:service with the provided server callback + Future registerSimHTTPServer(std::string hostname, + std::string service, + Reference requestHandler) override { + return registerSimHTTPServerActor(this, hostname, service, requestHandler); + } + Sim2(bool printSimTime) - : time(0.0), timerTime(0.0), currentTaskID(TaskPriority::Zero), taskCount(0), yielded(false), yield_limit(0), + : time(0.0), timerTime(0.0), currentTaskID(TaskPriority::Zero), yielded(false), yield_limit(0), printSimTime(printSimTime) { // Not letting currentProcess be nullptr eliminates some annoying special cases currentProcess = @@ -2171,6 +2580,9 @@ class Sim2 final : public ISimulator, public INetworkConnections { this, "", ""); + // create a key pair for AuthZ testing + auto key = mkcert::makeEcP256(); + authKeys.insert(std::make_pair(Standalone("DefaultKey"_sr), key)); g_network = net2 = newNet2(TLSConfig(), false, true); g_network->addStopCallback(Net2FileSystem::stop); Net2FileSystem::newFileSystem(); @@ -2178,74 +2590,32 @@ class Sim2 final : public ISimulator, public INetworkConnections { } // Implementation - struct Task { - TaskPriority taskID; - double time; - uint64_t stable; + struct PromiseTask final : public FastAllocated { + Promise promise; ProcessInfo* machine; - Promise action; - Task(double time, TaskPriority taskID, uint64_t stable, ProcessInfo* machine, Promise&& action) - : taskID(taskID), time(time), stable(stable), machine(machine), action(std::move(action)) {} - Task(double time, TaskPriority taskID, uint64_t stable, ProcessInfo* machine, Future& future) - : taskID(taskID), time(time), stable(stable), machine(machine) { - future = action.getFuture(); - } - Task(Task&& rhs) noexcept - : taskID(rhs.taskID), time(rhs.time), stable(rhs.stable), machine(rhs.machine), - action(std::move(rhs.action)) {} - void operator=(Task const& rhs) { - taskID = rhs.taskID; - time = rhs.time; - stable = rhs.stable; - machine = rhs.machine; - action = rhs.action; - } - Task(Task const& rhs) - : taskID(rhs.taskID), time(rhs.time), stable(rhs.stable), machine(rhs.machine), action(rhs.action) {} - void operator=(Task&& rhs) noexcept { - time = rhs.time; - taskID = rhs.taskID; - stable = rhs.stable; - machine = rhs.machine; - action = std::move(rhs.action); - } - - bool operator<(Task const& rhs) const { - // Ordering is reversed for priority_queue - if (time != rhs.time) - return time > rhs.time; - return stable > rhs.stable; - } + explicit PromiseTask(ProcessInfo* machine) : machine(machine) {} + PromiseTask(ProcessInfo* machine, Promise&& promise) : machine(machine), promise(std::move(promise)) {} }; - void execTask(struct Task& t) { + void execTask(struct PromiseTask& t) { if (t.machine->failed) { - t.action.send(Never()); + t.promise.send(Never()); } else { - mutex.enter(); - if (printSimTime && (int)this->time < (int)t.time) { - printf("Time: %d\n", (int)t.time); - } - this->time = t.time; - this->timerTime = std::max(this->timerTime, this->time); - mutex.leave(); - this->currentProcess = t.machine; try { - t.action.send(Void()); + t.promise.send(Void()); ASSERT(this->currentProcess == t.machine); } catch (Error& e) { TraceEvent(SevError, "UnhandledSimulationEventError").errorUnsuppressed(e); - killProcess(t.machine, KillInstantly); + killProcess(t.machine, KillType::KillInstantly); } if (randLog) fmt::print(randLog, - "T {0} {1} {2} {3}\n", + "T {0} {1} {2}\n", this->time, int(deterministicRandom()->peek() % 10000), - t.machine ? t.machine->name : "none", - t.stable); + t.machine ? t.machine->name : "none"); } } @@ -2253,11 +2623,10 @@ class Sim2 final : public ISimulator, public INetworkConnections { // This is presumably coming from either a "fake" thread pool thread, i.e. it is actually on this thread // or a thread created with g_network->startThread ASSERT(getCurrentProcess()); - - mutex.enter(); ASSERT(taskID >= TaskPriority::Min && taskID <= TaskPriority::Max); - tasks.push(Task(time, taskID, taskCount++, getCurrentProcess(), std::move(signal))); - mutex.leave(); + + PromiseTask* p = new PromiseTask(getCurrentProcess(), std::move(signal)); + taskQueue.addReadyThreadSafe(isOnMainThread(), taskID, p); } bool isOnMainThread() const override { return net2->isOnMainThread(); } Future onProcess(ISimulator::ProcessInfo* process, TaskPriority taskID) override { @@ -2271,21 +2640,15 @@ class Sim2 final : public ISimulator, public INetworkConnections { ProtocolVersion protocolVersion() const override { return getCurrentProcess()->protocolVersion; } - // time is guarded by ISimulator::mutex. It is not necessary to guard reads on the main thread because - // time should only be modified from the main thread. double time; double timerTime; TaskPriority currentTaskID; - // taskCount is guarded by ISimulator::mutex - uint64_t taskCount; - std::map>, MachineInfo> machines; std::map addressMap; std::map> filesDeadMap; - // tasks is guarded by ISimulator::mutex - std::priority_queue> tasks; + TaskQueue taskQueue; std::vector> stopCallbacks; @@ -2320,9 +2683,9 @@ class UDPSimSocket : public IUDPSocket, ReferenceCounted { std::deque> recvBuffer; AsyncVar writtenPackets; NetworkAddress _localAddress; - bool randomDropPacket() { - auto res = deterministicRandom()->random01() < .000001; - TEST(res); // UDP packet drop + static bool randomDropPacket() { + auto res = deterministicRandom()->random01() < .000005; + CODE_PROBE(res, "UDP packet drop", probe::context::sim2, probe::assert::simOnly); return res; } @@ -2365,8 +2728,8 @@ class UDPSimSocket : public IUDPSocket, ReferenceCounted { public: UDPSimSocket(NetworkAddress const& localAddress, Optional const& peerAddress) - : id(deterministicRandom()->randomUniqueID()), process(g_simulator.getCurrentProcess()), peerAddress(peerAddress), - actors(false), _localAddress(localAddress) { + : id(deterministicRandom()->randomUniqueID()), process(g_simulator->getCurrentProcess()), + peerAddress(peerAddress), actors(false), _localAddress(localAddress) { g_sim2.addressMap.emplace(_localAddress, process); ASSERT(process->boundUDPSockets.find(localAddress) == process->boundUDPSockets.end()); process->boundUDPSockets.emplace(localAddress, this); @@ -2469,7 +2832,7 @@ class UDPSimSocket : public IUDPSocket, ReferenceCounted { Future> Sim2::createUDPSocket(NetworkAddress toAddr) { NetworkAddress localAddress; - auto process = g_simulator.getCurrentProcess(); + auto process = g_simulator->getCurrentProcess(); if (process->address.ip.isV6()) { IPAddress::IPAddressStore store = process->address.ip.toV6(); uint16_t* ipParts = (uint16_t*)store.data(); @@ -2487,7 +2850,7 @@ Future> Sim2::createUDPSocket(NetworkAddress toAddr) { Future> Sim2::createUDPSocket(bool isV6) { NetworkAddress localAddress; - auto process = g_simulator.getCurrentProcess(); + auto process = g_simulator->getCurrentProcess(); if (process->address.ip.isV6() == isV6) { localAddress = process->address; } else { @@ -2509,8 +2872,8 @@ Future> Sim2::createUDPSocket(bool isV6) { void startNewSimulator(bool printSimTime) { ASSERT(!g_network); - g_network = g_pSimulator = new Sim2(printSimTime); - g_simulator.connectionFailuresDisableDuration = + g_network = g_simulator = new Sim2(printSimTime); + g_simulator->connectionFailuresDisableDuration = deterministicRandom()->coinflip() ? 0 : DISABLE_CONNECTION_FAILURE_FOREVER; } @@ -2529,22 +2892,37 @@ ACTOR void doReboot(ISimulator::ProcessInfo* p, ISimulator::KillType kt) { wait(g_sim2.delay(0, TaskPriority::DefaultDelay, p)); // Switch to the machine in question try { - ASSERT(kt == ISimulator::RebootProcess || kt == ISimulator::Reboot || kt == ISimulator::RebootAndDelete || - kt == ISimulator::RebootProcessAndDelete); - - TEST(kt == ISimulator::RebootProcess); // Simulated process rebooted - TEST(kt == ISimulator::Reboot); // Simulated machine rebooted - TEST(kt == ISimulator::RebootAndDelete); // Simulated machine rebooted with data and coordination state deletion - TEST( - kt == - ISimulator::RebootProcessAndDelete); // Simulated process rebooted with data and coordination state deletion + ASSERT(kt == ISimulator::KillType::RebootProcess || kt == ISimulator::KillType::Reboot || + kt == ISimulator::KillType::RebootAndDelete || kt == ISimulator::KillType::RebootProcessAndDelete || + kt == ISimulator::KillType::RebootProcessAndSwitch); + + CODE_PROBE(kt == ISimulator::KillType::RebootProcess, + "Simulated process rebooted", + probe::assert::simOnly, + probe::context::sim2); + CODE_PROBE(kt == ISimulator::KillType::Reboot, + "Simulated machine rebooted", + probe::assert::simOnly, + probe::context::sim2); + CODE_PROBE(kt == ISimulator::KillType::RebootAndDelete, + "Simulated machine rebooted with data and coordination state deletion", + probe::assert::simOnly, + probe::context::sim2); + CODE_PROBE(kt == ISimulator::KillType::RebootProcessAndDelete, + "Simulated process rebooted with data and coordination state deletion", + probe::assert::simOnly, + probe::context::sim2); + CODE_PROBE(kt == ISimulator::KillType::RebootProcessAndSwitch, + "Simulated process rebooted with different cluster file", + probe::assert::simOnly, + probe::context::sim2); if (p->rebooting || !p->isReliable()) { TraceEvent(SevDebug, "DoRebootFailed") .detail("Rebooting", p->rebooting) .detail("Reliable", p->isReliable()); return; - } else if (std::string(p->name) == "remote flow process") { + } else if (p->isSpawnedKVProcess()) { TraceEvent(SevDebug, "DoRebootFailed").detail("Name", p->name).detail("Address", p->address); return; } else if (p->getChilds().size()) { @@ -2563,9 +2941,11 @@ ACTOR void doReboot(ISimulator::ProcessInfo* p, ISimulator::KillType kt) { .detail("Cleared", p->cleared) .backtrace(); p->rebooting = true; - if ((kt == ISimulator::RebootAndDelete) || (kt == ISimulator::RebootProcessAndDelete)) { + if ((kt == ISimulator::KillType::RebootAndDelete) || (kt == ISimulator::KillType::RebootProcessAndDelete)) { p->cleared = true; - g_simulator.clearAddress(p->address); + g_simulator->clearAddress(p->address); + } else if (kt == ISimulator::KillType::RebootProcessAndSwitch) { + g_simulator->switchCluster(p->address); } p->shutdownSignal.send(kt); } catch (Error& e) { @@ -2577,15 +2957,15 @@ ACTOR void doReboot(ISimulator::ProcessInfo* p, ISimulator::KillType kt) { // Simulates delays for performing operations on disk Future waitUntilDiskReady(Reference diskParameters, int64_t size, bool sync) { - if (g_simulator.getCurrentProcess()->failedDisk) { + if (g_simulator->getCurrentProcess()->failedDisk) { return Never(); } - if (g_simulator.connectionFailuresDisableDuration > 1e4) + if (g_simulator->connectionFailuresDisableDuration > 1e4) return delay(0.0001); if (diskParameters->nextOperation < now()) diskParameters->nextOperation = now(); - diskParameters->nextOperation += (1.0 / diskParameters->iops) + (1.0 * size / diskParameters->bandwidth); + diskParameters->nextOperation += (1.0 / diskParameters->iops) + (size / diskParameters->bandwidth); double randomLatency; if (sync) { @@ -2598,16 +2978,17 @@ Future waitUntilDiskReady(Reference diskParameters, int64_ void enableConnectionFailures(std::string const& context) { if (g_network->isSimulated()) { - g_simulator.connectionFailuresDisableDuration = 0; - g_simulator.speedUpSimulation = false; + g_simulator->connectionFailuresDisableDuration = 0; + g_simulator->speedUpSimulation = false; + g_simulator->connectionFailureEnableTime = now(); TraceEvent(SevWarnAlways, ("EnableConnectionFailures_" + context).c_str()); } } void disableConnectionFailures(std::string const& context) { if (g_network->isSimulated()) { - g_simulator.connectionFailuresDisableDuration = DISABLE_CONNECTION_FAILURE_FOREVER; - g_simulator.speedUpSimulation = true; + g_simulator->connectionFailuresDisableDuration = DISABLE_CONNECTION_FAILURE_FOREVER; + g_simulator->speedUpSimulation = true; TraceEvent(SevWarnAlways, ("DisableConnectionFailures_" + context).c_str()); } } @@ -2644,24 +3025,20 @@ int sf_open(const char* filename, int flags, int convFlags, int mode) { Future> Sim2FileSystem::open(const std::string& filename, int64_t flags, int64_t mode) { ASSERT((flags & IAsyncFile::OPEN_ATOMIC_WRITE_AND_CREATE) || !(flags & IAsyncFile::OPEN_CREATE) || StringRef(filename).endsWith( - LiteralStringRef(".fdb-lock"))); // We don't use "ordinary" non-atomic file creation right now except for - // folder locking, and we don't have code to simulate its unsafeness. + ".fdb-lock"_sr)); // We don't use "ordinary" non-atomic file creation right now except for + // folder locking, and we don't have code to simulate its unsafeness. if ((flags & IAsyncFile::OPEN_EXCLUSIVE)) ASSERT(flags & IAsyncFile::OPEN_CREATE); if (flags & IAsyncFile::OPEN_UNCACHED) { - auto& machineCache = g_simulator.getCurrentProcess()->machine->openFiles; + auto& machineCache = g_simulator->getCurrentProcess()->machine->openFiles; std::string actualFilename = filename; if (flags & IAsyncFile::OPEN_ATOMIC_WRITE_AND_CREATE) { actualFilename = filename + ".part"; auto partFile = machineCache.find(actualFilename); if (partFile != machineCache.end()) { Future> f = AsyncFileDetachable::open(partFile->second.get()); - if (FLOW_KNOBS->PAGE_WRITE_CHECKSUM_HISTORY > 0) - f = map(f, [=](Reference r) { - return Reference(new AsyncFileWriteChecker(r)); - }); return f; } } @@ -2673,11 +3050,15 @@ Future> Sim2FileSystem::open(const std::string& file // This way, they can both keep up with the time to start the next operation auto diskParameters = makeReference(FLOW_KNOBS->SIM_DISK_IOPS, FLOW_KNOBS->SIM_DISK_BANDWIDTH); - f = AsyncFileNonDurable::open(filename, - actualFilename, - SimpleFile::open(filename, flags, mode, diskParameters, false), - diskParameters, - (flags & IAsyncFile::OPEN_NO_AIO) == 0); + + f = SimpleFile::open(filename, flags, mode, diskParameters, false); + if (FLOW_KNOBS->PAGE_WRITE_CHECKSUM_HISTORY > 0) { + f = map(f, + [=](Reference r) { return Reference(new AsyncFileWriteChecker(r)); }); + } + + f = AsyncFileNonDurable::open( + filename, actualFilename, f, diskParameters, (flags & IAsyncFile::OPEN_NO_AIO) == 0); machineCache[actualFilename] = UnsafeWeakFutureReference(f); } else { @@ -2685,18 +3066,14 @@ Future> Sim2FileSystem::open(const std::string& file } f = AsyncFileDetachable::open(f); - if (FLOW_KNOBS->PAGE_WRITE_CHECKSUM_HISTORY > 0) - f = map(f, [=](Reference r) { return Reference(new AsyncFileWriteChecker(r)); }); if (FLOW_KNOBS->ENABLE_CHAOS_FEATURES) f = map(f, [=](Reference r) { return Reference(new AsyncFileChaos(r)); }); -#if ENCRYPTION_ENABLED if (flags & IAsyncFile::OPEN_ENCRYPTED) f = map(f, [flags](Reference r) { auto mode = flags & IAsyncFile::OPEN_READWRITE ? AsyncFileEncrypted::Mode::APPEND_ONLY : AsyncFileEncrypted::Mode::READ_ONLY; return Reference(new AsyncFileEncrypted(r, mode)); }); -#endif // ENCRYPTION_ENABLED return f; } else return AsyncFileCached::open(filename, flags, mode); @@ -2710,6 +3087,22 @@ Future Sim2FileSystem::deleteFile(const std::string& filename, bool mustBe ACTOR Future renameFileImpl(std::string from, std::string to) { wait(delay(0.5 * deterministicRandom()->random01())); + // rename all keys in the corrupted list + // first we have to delete all corruption of the destination, since this file will be unlinked if it exists + TraceEvent("RenamingFile").detail("From", from).detail("To", to).log(); + // it seems gcc has some trouble with these types. Aliasing with typename is ugly, but seems to work. + using block_value_type = typename decltype(g_simulator->corruptedBlocks)::key_type::second_type; + auto maxBlockValue = std::numeric_limits::max(); + g_simulator->corruptedBlocks.erase(g_simulator->corruptedBlocks.lower_bound(std::make_pair(to, 0u)), + g_simulator->corruptedBlocks.upper_bound(std::make_pair(to, maxBlockValue))); + // next we need to rename all files. In practice, the number of corruptions for a given file should be very small + auto begin = g_simulator->corruptedBlocks.lower_bound(std::make_pair(from, 0u)), + end = g_simulator->corruptedBlocks.upper_bound(std::make_pair(from, maxBlockValue)); + for (auto iter = begin; iter != end; ++iter) { + g_simulator->corruptedBlocks.emplace(to, iter->second); + } + g_simulator->corruptedBlocks.erase(begin, end); + // do the rename ::renameFile(from, to); wait(delay(0.5 * deterministicRandom()->random01())); return Void(); diff --git a/src/fdbrpc/sim2.actor.g.cpp b/src/fdbrpc/sim2.actor.g.cpp index 9c944a3..aae56d4 100644 --- a/src/fdbrpc/sim2.actor.g.cpp +++ b/src/fdbrpc/sim2.actor.g.cpp @@ -25,11 +25,19 @@ #include #include +#include "flow/MkCert.h" #include "fmt/format.h" #include "fdbrpc/simulator.h" +#include "flow/Arena.h" +#ifndef BOOST_SYSTEM_NO_LIB #define BOOST_SYSTEM_NO_LIB +#endif +#ifndef BOOST_DATE_TIME_NO_LIB #define BOOST_DATE_TIME_NO_LIB +#endif +#ifndef BOOST_REGEX_NO_LIB #define BOOST_REGEX_NO_LIB +#endif #include "fdbrpc/SimExternalConnection.h" #include "flow/ActorCollection.h" #include "flow/IRandom.h" @@ -37,12 +45,13 @@ #include "flow/ProtocolVersion.h" #include "flow/Util.h" #include "flow/WriteOnlySet.h" -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "fdbrpc/AsyncFileCached.actor.h" #include "fdbrpc/AsyncFileEncrypted.h" +#include "fdbrpc/SimulatorProcessInfo.h" #include "fdbrpc/AsyncFileNonDurable.actor.h" -#include "fdbrpc/AsyncFileChaos.actor.h" -#include "flow/crc32c.h" +#include "fdbrpc/AsyncFileChaos.h" +#include "crc32/crc32c.h" #include "fdbrpc/TraceFileIO.h" #include "flow/flow.h" #include "flow/genericactors.actor.h" @@ -54,23 +63,46 @@ #include "fdbrpc/AsyncFileWriteChecker.h" #include "fdbrpc/genericactors.actor.h" #include "flow/FaultInjection.h" +#include "flow/TaskQueue.h" +#include "flow/IUDPSocket.h" +#include "flow/IConnection.h" #include "flow/actorcompiler.h" // This must be the last #include. +ISimulator* g_simulator = nullptr; +thread_local ISimulator::ProcessInfo* ISimulator::currentProcess = nullptr; + +ISimulator::ISimulator() + : desiredCoordinators(1), physicalDatacenters(1), processesPerMachine(0), listenersPerProcess(1), usableRegions(1), + allowLogSetKills(true), tssMode(TSSMode::Disabled), configDBType(ConfigDBType::DISABLED), isStopped(false), + lastConnectionFailure(0), connectionFailuresDisableDuration(0), speedUpSimulation(false), + connectionFailureEnableTime(0), disableTLogRecoveryFinish(false), backupAgents(BackupAgentType::WaitForType), + drAgents(BackupAgentType::WaitForType), allSwapsDisabled(false), blobGranulesEnabled(false) {} +ISimulator::~ISimulator() = default; + bool simulator_should_inject_fault(const char* context, const char* file, int line, int error_code) { if (!g_network->isSimulated() || !faultInjectionActivated) return false; - auto p = g_simulator.getCurrentProcess(); + auto p = g_simulator->getCurrentProcess(); if (p->fault_injection_p2 && deterministicRandom()->random01() < p->fault_injection_p2 && - !g_simulator.speedUpSimulation) { + !g_simulator->speedUpSimulation) { uint32_t h1 = line + (p->fault_injection_r >> 32); if (h1 < p->fault_injection_p1 * std::numeric_limits::max()) { - TEST(true); // A fault was injected - TEST(error_code == error_code_io_timeout); // An io timeout was injected - TEST(error_code == error_code_io_error); // An io error was injected - TEST(error_code == error_code_platform_error); // A platform error was injected. + CODE_PROBE(true, "A fault was injected", probe::assert::simOnly, probe::context::sim2); + CODE_PROBE(error_code == error_code_io_timeout, + "An io timeout was injected", + probe::assert::simOnly, + probe::context::sim2); + CODE_PROBE(error_code == error_code_io_error, + "An io error was injected", + probe::assert::simOnly, + probe::context::sim2); + CODE_PROBE(error_code == error_code_platform_error, + "A platform error was injected.", + probe::assert::simOnly, + probe::context::sim2); TraceEvent(SevWarn, "FaultInjected") .detail("Context", context) .detail("File", file) @@ -86,6 +118,56 @@ bool simulator_should_inject_fault(const char* context, const char* file, int li return false; } +bool simulator_should_inject_blob_fault(const char* context, const char* file, int line, int error_code) { + if (!g_network->isSimulated() || !faultInjectionActivated) + return false; + + auto p = g_simulator->getCurrentProcess(); + + if (!g_simulator->speedUpSimulation && deterministicRandom()->random01() < p->blob_inject_failure_rate) { + CODE_PROBE(true, "A blob fault was injected", probe::assert::simOnly, probe::context::sim2); + CODE_PROBE(error_code == error_code_http_request_failed, + "A failed http request was injected", + probe::assert::simOnly, + probe::context::sim2); + TraceEvent("BlobFaultInjected") + .detail("Context", context) + .detail("File", file) + .detail("Line", line) + .detail("ErrorCode", error_code); + return true; + } + + return false; +} + +void ISimulator::disableFor(const std::string& desc, double time) { + disabledMap[desc] = time; +} + +double ISimulator::checkDisabled(const std::string& desc) const { + auto iter = disabledMap.find(desc); + if (iter != disabledMap.end()) { + return iter->second; + } + return 0; +} + +bool ISimulator::checkInjectedCorruption() { + auto iter = corruptWorkerMap.find(currentProcess->address); + if (iter != corruptWorkerMap.end()) + return iter->second; + return false; +} + +flowGlobalType ISimulator::global(int id) const { + return getCurrentProcess()->global(id); +}; + +void ISimulator::setGlobal(size_t id, flowGlobalType v) { + getCurrentProcess()->setGlobal(id, v); +}; + void ISimulator::displayWorkers() const { std::map> machineMap; @@ -108,20 +190,39 @@ void ISimulator::displayWorkers() const { for (auto& processInfo : machineRecord.second) { printf(" %9s %-10s%-13s%-8s %-6s %-9s %-8s %-48s %-40s\n", processInfo->address.toString().c_str(), - processInfo->name, + processInfo->name.c_str(), processInfo->startingClass.toString().c_str(), (processInfo->isExcluded() ? "True" : "False"), (processInfo->failed ? "True" : "False"), (processInfo->rebooting ? "True" : "False"), (processInfo->isCleared() ? "True" : "False"), getRoles(processInfo->address).c_str(), - processInfo->dataFolder); + processInfo->dataFolder.c_str()); } } return; } +WipedString ISimulator::makeToken(int64_t tenantId, uint64_t ttlSecondsFromNow) { + ASSERT_GT(authKeys.size(), 0); + auto tokenSpec = authz::jwt::TokenRef{}; + auto [keyName, key] = *authKeys.begin(); + tokenSpec.algorithm = key.algorithm() == PKeyAlgorithm::EC ? authz::Algorithm::ES256 : authz::Algorithm::RS256; + tokenSpec.keyId = keyName; + tokenSpec.issuer = "sim2_issuer"_sr; + tokenSpec.subject = "sim2_testing"_sr; + auto const now = static_cast(g_network->timer()); + tokenSpec.notBeforeUnixTime = now - 1; + tokenSpec.issuedAtUnixTime = now; + tokenSpec.expiresAtUnixTime = now + ttlSecondsFromNow; + auto const tokenId = deterministicRandom()->randomAlphaNumeric(10); + tokenSpec.tokenId = StringRef(tokenId); + tokenSpec.tenants = VectorRef(&tenantId, 1); + Arena arena; + return WipedString(authz::jwt::signToken(arena, tokenSpec, key)); +} + int openCount = 0; struct SimClogging { @@ -136,17 +237,17 @@ struct SimClogging { double tnow = now(); double t = tnow + (stableConnection ? 0.1 : 1.0) * halfLatency(); - if (!g_simulator.speedUpSimulation && !stableConnection) + if (!g_simulator->speedUpSimulation && !stableConnection) t += clogPairLatency[pair]; - if (!g_simulator.speedUpSimulation && !stableConnection && clogPairUntil.count(pair)) + if (!g_simulator->speedUpSimulation && !stableConnection && clogPairUntil.count(pair)) t = std::max(t, clogPairUntil[pair]); auto p = std::make_pair(from, to); - if (!g_simulator.speedUpSimulation && !stableConnection && clogProcessPairUntil.count(p)) + if (!g_simulator->speedUpSimulation && !stableConnection && clogProcessPairUntil.count(p)) t = std::max(t, clogProcessPairUntil[p]); - if (!g_simulator.speedUpSimulation && !stableConnection && clogRecvUntil.count(to.ip)) + if (!g_simulator->speedUpSimulation && !stableConnection && clogRecvUntil.count(to.ip)) t = std::max(t, clogRecvUntil[to.ip]); return t - tnow; @@ -154,7 +255,7 @@ struct SimClogging { bool disconnected(const IPAddress& from, const IPAddress& to) { auto pair = std::make_pair(from, to); - if (g_simulator.speedUpSimulation || disconnectPairUntil.find(pair) == disconnectPairUntil.end()) { + if (g_simulator->speedUpSimulation || disconnectPairUntil.find(pair) == disconnectPairUntil.end()) { return false; } @@ -214,7 +315,7 @@ struct SimClogging { double halfLatency() const { double a = deterministicRandom()->random01(); const double pFast = 0.999; - if (a <= pFast || g_simulator.speedUpSimulation) { + if (a <= pFast || g_simulator->speedUpSimulation) { a = a / pFast; return 0.5 * (FLOW_KNOBS->MIN_NETWORK_LATENCY * (1 - a) + FLOW_KNOBS->FAST_NETWORK_LATENCY / pFast * a); // 0.5ms average @@ -230,7 +331,7 @@ SimClogging g_clogging; struct Sim2Conn final : IConnection, ReferenceCounted { Sim2Conn(ISimulator::ProcessInfo* process) - : opened(false), closedByCaller(false), stableConnection(false), process(process), + : opened(false), closedByCaller(false), stableConnection(false), trustedPeer(true), process(process), dbgid(deterministicRandom()->randomUniqueID()), stopReceive(Never()) { pipes = sender(this) && receiver(this); } @@ -289,6 +390,8 @@ struct Sim2Conn final : IConnection, ReferenceCounted { bool isPeerGone() const { return !peer || peerProcess->failed; } + bool hasTrustedPeer() const override { return trustedPeer; } + bool isStableConnection() const override { return stableConnection; } void peerClosed() { @@ -357,7 +460,7 @@ struct Sim2Conn final : IConnection, ReferenceCounted { boost::asio::ip::tcp::socket& getSocket() override { throw operation_failed(); } - bool opened, closedByCaller, stableConnection; + bool opened, closedByCaller, stableConnection, trustedPeer; private: ISimulator::ProcessInfo *process, *peerProcess; @@ -388,20 +491,20 @@ struct Sim2Conn final : IConnection, ReferenceCounted { peer.clear(); } - #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via sender() - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class SenderActorState { - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" SenderActorState(Sim2Conn* const& self) - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self) - #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("sender", reinterpret_cast(this)); @@ -414,9 +517,9 @@ class SenderActorState { int a_body1(int loopDepth=0) { try { - #line 390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ; - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -444,52 +547,52 @@ class SenderActorState { } int a_body1loopBody1(int loopDepth) { - #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = self->writtenBytes.onChange(); - #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->peerProcess); - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->peerProcess); + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = delay(.002 * deterministicRandom()->random01()); - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->peerProcess); - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->peerProcess); + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = delay(.002 * deterministicRandom()->random01()); - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -559,18 +662,18 @@ class SenderActorState { } int a_body1loopBody1cont2(Void const& _,int loopDepth) { - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->sentBytes.set(self->writtenBytes.get()); - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont2(Void && _,int loopDepth) { - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->sentBytes.set(self->writtenBytes.get()); - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -638,14 +741,14 @@ class SenderActorState { fdb_probe_actor_exit("sender", reinterpret_cast(this), 1); } - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Sim2Conn* self; - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via sender() - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class SenderActor final : public Actor, public ActorCallback< SenderActor, 0, Void >, public ActorCallback< SenderActor, 1, Void >, public FastAllocated, public SenderActorState { - #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -655,9 +758,9 @@ class SenderActor final : public Actor, public ActorCallback< SenderActor, #pragma clang diagnostic pop friend struct ActorCallback< SenderActor, 0, Void >; friend struct ActorCallback< SenderActor, 1, Void >; - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" SenderActor(Sim2Conn* const& self) - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), SenderActorState(self) { @@ -681,28 +784,28 @@ friend struct ActorCallback< SenderActor, 1, Void >; } }; - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future sender( Sim2Conn* const& self ) { - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new SenderActor(self)); - #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" +#line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via receiver() - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class ReceiverActorState { - #line 698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ReceiverActorState(Sim2Conn* const& self) - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self) - #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("receiver", reinterpret_cast(this)); @@ -715,9 +818,9 @@ class ReceiverActorState { int a_body1(int loopDepth=0) { try { - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ; - #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -745,20 +848,20 @@ class ReceiverActorState { } int a_body1loopBody1(int loopDepth) { - #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (self->sentBytes.get() != self->receivedBytes.get()) - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - StrictFuture __when_expr_0 = g_simulator.onProcess(self->peerProcess); - #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_0 = g_simulator->onProcess(self->peerProcess); + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 503 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else @@ -770,9 +873,9 @@ class ReceiverActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ; - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = a_body1loopBody1cont1loopHead1(loopDepth); return loopDepth; @@ -854,30 +957,30 @@ class ReceiverActorState { } int a_body1loopBody1cont3(int loopDepth) { - #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->peerProcess); - #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->peerProcess); + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (g_clogging.disconnected(self->peerProcess->address.ip, self->process->address.ip)) - #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent("SimulatedDisconnection") .detail("Phase", "DataTransfer") .detail("Sender", self->peerProcess->address) .detail("Receiver", self->process->address); - #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(connection_failed(), std::max(0, loopDepth - 1)); - #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" pos = deterministicRandom()->random01() < .5 ? self->sentBytes.get() : deterministicRandom()->randomInt64(self->receivedBytes.get(), self->sentBytes.get() + 1); - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_2 = delay(g_clogging.getSendDelay( self->peerProcess->address, self->process->address, self->isStableConnection())); - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont3when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -891,22 +994,22 @@ class ReceiverActorState { } int a_body1loopBody1cont1loopBody1(int loopDepth) { - #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!(self->sentBytes.get() == self->receivedBytes.get())) - #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { return a_body1loopBody1cont1break1(loopDepth==0?0:loopDepth-1); // break } - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = self->sentBytes.onChange(); - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 2)); - #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 2)); else return a_body1loopBody1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1001,32 +1104,32 @@ class ReceiverActorState { } int a_body1loopBody1cont4(Void const& _,int loopDepth) { - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - StrictFuture __when_expr_3 = g_simulator.onProcess(self->process); - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_3 = g_simulator->onProcess(self->process); + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont4(Void && _,int loopDepth) { - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - StrictFuture __when_expr_3 = g_simulator.onProcess(self->process); - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_3 = g_simulator->onProcess(self->process); + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont4when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 523 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1096,36 +1199,36 @@ class ReceiverActorState { } int a_body1loopBody1cont6(Void const& _,int loopDepth) { - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->process); - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->process); + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_4 = delay(g_clogging.getRecvDelay( self->peerProcess->address, self->process->address, self->isStableConnection())); - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont6when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont6(Void && _,int loopDepth) { - #line 421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->process); - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->process); + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_4 = delay(g_clogging.getRecvDelay( self->peerProcess->address, self->process->address, self->isStableConnection())); - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont6when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1195,22 +1298,22 @@ class ReceiverActorState { } int a_body1loopBody1cont7(Void const& _,int loopDepth) { - #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->process); - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->process); + #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (self->stopReceive.isReady()) - #line 1202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_5 = Future(Never()); - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont7when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else @@ -1222,22 +1325,22 @@ class ReceiverActorState { } int a_body1loopBody1cont7(Void && _,int loopDepth) { - #line 424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->process); - #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->process); + #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (self->stopReceive.isReady()) - #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_5 = Future(Never()); - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont7when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else @@ -1312,18 +1415,18 @@ class ReceiverActorState { } int a_body1loopBody1cont8(int loopDepth) { - #line 428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->receivedBytes.set(pos); - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_6 = Future(Void()); - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont8when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1405,18 +1508,18 @@ class ReceiverActorState { } int a_body1loopBody1cont10(Void const& _,int loopDepth) { - #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->process); - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->process); + #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont10(Void && _,int loopDepth) { - #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->process); - #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->process); + #line 1522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -1484,16 +1587,16 @@ class ReceiverActorState { fdb_probe_actor_exit("receiver", reinterpret_cast(this), 6); } - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Sim2Conn* self; - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" int64_t pos; - #line 1491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via receiver() - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class ReceiverActor final : public Actor, public ActorCallback< ReceiverActor, 0, Void >, public ActorCallback< ReceiverActor, 1, Void >, public ActorCallback< ReceiverActor, 2, Void >, public ActorCallback< ReceiverActor, 3, Void >, public ActorCallback< ReceiverActor, 4, Void >, public ActorCallback< ReceiverActor, 5, Void >, public ActorCallback< ReceiverActor, 6, Void >, public FastAllocated, public ReceiverActorState { - #line 1496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1508,9 +1611,9 @@ friend struct ActorCallback< ReceiverActor, 3, Void >; friend struct ActorCallback< ReceiverActor, 4, Void >; friend struct ActorCallback< ReceiverActor, 5, Void >; friend struct ActorCallback< ReceiverActor, 6, Void >; - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ReceiverActor(Sim2Conn* const& self) - #line 1513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), ReceiverActorState(self) { @@ -1539,28 +1642,28 @@ friend struct ActorCallback< ReceiverActor, 6, Void >; } }; - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future receiver( Sim2Conn* const& self ) { - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new ReceiverActor(self)); - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 1550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" +#line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via whenReadable() - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class WhenReadableActorState { - #line 1556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" WhenReadableActorState(Sim2Conn* const& self) - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self) - #line 1563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("whenReadable", reinterpret_cast(this)); @@ -1574,9 +1677,9 @@ class WhenReadableActorState { { try { try { - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ; - #line 1579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1604,11 +1707,11 @@ class WhenReadableActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->process); - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->process); + #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 1611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -1627,48 +1730,48 @@ class WhenReadableActorState { } int a_body1loopBody1(int loopDepth) { - #line 436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (self->readBytes.get() != self->receivedBytes.get()) - #line 1632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->process); - #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->process); + #line 541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WhenReadableActorState(); static_cast(this)->destroy(); return 0; } - #line 1638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WhenReadableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = self->receivedBytes.onChange(); - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->rollRandomClose(); - #line 1662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->rollRandomClose(); - #line 1671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -1736,14 +1839,14 @@ class WhenReadableActorState { fdb_probe_actor_exit("whenReadable", reinterpret_cast(this), 0); } - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Sim2Conn* self; - #line 1741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via whenReadable() - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class WhenReadableActor final : public Actor, public ActorCallback< WhenReadableActor, 0, Void >, public FastAllocated, public WhenReadableActorState { - #line 1746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1752,9 +1855,9 @@ class WhenReadableActor final : public Actor, public ActorCallback< WhenRe void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< WhenReadableActor, 0, Void >; - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" WhenReadableActor(Sim2Conn* const& self) - #line 1757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), WhenReadableActorState(self) { @@ -1777,28 +1880,28 @@ friend struct ActorCallback< WhenReadableActor, 0, Void >; } }; - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future whenReadable( Sim2Conn* const& self ) { - #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new WhenReadableActor(self)); - #line 1784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 1788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" +#line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via whenWritable() - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class WhenWritableActorState { - #line 1794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" WhenWritableActorState(Sim2Conn* const& self) - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self) - #line 1801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("whenWritable", reinterpret_cast(this)); @@ -1812,9 +1915,9 @@ class WhenWritableActorState { { try { try { - #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ; - #line 1817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1842,11 +1945,11 @@ class WhenWritableActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->process); - #line 468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->process); + #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -1865,43 +1968,43 @@ class WhenWritableActorState { } int a_body1loopBody1(int loopDepth) { - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!self->peer) - #line 1870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WhenWritableActorState(); static_cast(this)->destroy(); return 0; } - #line 1874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WhenWritableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (self->peer->availableSendBufferForPeer() > 0) - #line 1882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->process); - #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->process); + #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WhenWritableActorState(); static_cast(this)->destroy(); return 0; } - #line 1888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~WhenWritableActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } try { - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = self->peer->receivedBytes.onChange(); - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 1899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2002 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1914,16 +2017,16 @@ class WhenWritableActorState { } int a_body1loopBody1cont1(int loopDepth) { - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - StrictFuture __when_expr_1 = g_simulator.onProcess(self->process); - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_1 = g_simulator->onProcess(self->process); + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1931,13 +2034,13 @@ class WhenWritableActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (e.code() != error_code_broken_promise) - #line 1936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch2(e, std::max(0, loopDepth - 1)); - #line 1940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } loopDepth = a_body1loopBody1cont1(loopDepth); } @@ -1951,18 +2054,18 @@ class WhenWritableActorState { } int a_body1loopBody1cont4(Void const& _,int loopDepth) { - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->peerProcess); - #line 1956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->peerProcess); + #line 2059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; } int a_body1loopBody1cont4(Void && _,int loopDepth) { - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(g_simulator.getCurrentProcess() == self->peerProcess); - #line 1965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(g_simulator->getCurrentProcess() == self->peerProcess); + #line 2068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; @@ -2118,14 +2221,14 @@ class WhenWritableActorState { fdb_probe_actor_exit("whenWritable", reinterpret_cast(this), 1); } - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Sim2Conn* self; - #line 2123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via whenWritable() - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class WhenWritableActor final : public Actor, public ActorCallback< WhenWritableActor, 0, Void >, public ActorCallback< WhenWritableActor, 1, Void >, public FastAllocated, public WhenWritableActorState { - #line 2128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2135,9 +2238,9 @@ class WhenWritableActor final : public Actor, public ActorCallback< WhenWr #pragma clang diagnostic pop friend struct ActorCallback< WhenWritableActor, 0, Void >; friend struct ActorCallback< WhenWritableActor, 1, Void >; - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" WhenWritableActor(Sim2Conn* const& self) - #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), WhenWritableActorState(self) { @@ -2161,23 +2264,23 @@ friend struct ActorCallback< WhenWritableActor, 1, Void >; } }; - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future whenWritable( Sim2Conn* const& self ) { - #line 448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new WhenWritableActor(self)); - #line 2168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" void rollRandomClose() { // make sure connections between parenta and their childs are not closed if (!stableConnection && - now() - g_simulator.lastConnectionFailure > g_simulator.connectionFailuresDisableDuration && + now() - g_simulator->lastConnectionFailure > g_simulator->connectionFailuresDisableDuration && deterministicRandom()->random01() < .00001) { - g_simulator.lastConnectionFailure = now(); + g_simulator->lastConnectionFailure = now(); double a = deterministicRandom()->random01(), b = deterministicRandom()->random01(); - TEST(true); // Simulated connection failure + CODE_PROBE(true, "Simulated connection failure", probe::context::sim2, probe::assert::simOnly); TraceEvent("ConnectionFailure", dbgid) .detail("MyAddr", process->address) .detail("PeerAddr", peerProcess->address) @@ -2196,20 +2299,20 @@ friend struct ActorCallback< WhenWritableActor, 1, Void >; } } - #line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via trackLeakedConnection() - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class TrackLeakedConnectionActorState { - #line 2205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TrackLeakedConnectionActorState(Sim2Conn* const& self) - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self) - #line 2212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("trackLeakedConnection", reinterpret_cast(this)); @@ -2222,16 +2325,28 @@ class TrackLeakedConnectionActorState { int a_body1(int loopDepth=0) { try { - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - StrictFuture __when_expr_0 = g_simulator.onProcess(self->process); - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if (g_simulator->httpServerIps.count(self->process->address.ip)) + #line 2330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + { + #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TrackLeakedConnectionActorState(); static_cast(this)->destroy(); return 0; } + #line 2334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~TrackLeakedConnectionActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_0 = g_simulator->onProcess(self->process); + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2252,34 +2367,34 @@ class TrackLeakedConnectionActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (self->process->address.isPublic()) - #line 2257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = delay(FLOW_KNOBS->CONNECTION_MONITOR_IDLE_TIMEOUT * FLOW_KNOBS->CONNECTION_MONITOR_IDLE_TIMEOUT * 1.5 + FLOW_KNOBS->CONNECTION_MONITOR_LOOP_TIME * 2.1 + FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT); - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else { - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_2 = delay(FLOW_KNOBS->CONNECTION_MONITOR_IDLE_TIMEOUT * 1.5); - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } @@ -2287,34 +2402,34 @@ class TrackLeakedConnectionActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (self->process->address.isPublic()) - #line 2292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = delay(FLOW_KNOBS->CONNECTION_MONITOR_IDLE_TIMEOUT * FLOW_KNOBS->CONNECTION_MONITOR_IDLE_TIMEOUT * 1.5 + FLOW_KNOBS->CONNECTION_MONITOR_LOOP_TIME * 2.1 + FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT); - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else { - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_2 = delay(FLOW_KNOBS->CONNECTION_MONITOR_IDLE_TIMEOUT * 1.5); - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } @@ -2383,13 +2498,13 @@ class TrackLeakedConnectionActorState { fdb_probe_actor_exit("trackLeakedConnection", reinterpret_cast(this), 0); } - int a_body1cont2(int loopDepth) + int a_body1cont3(int loopDepth) { - #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - TraceEvent(SevError, "LeakedConnection", self->dbgid) .error(connection_leaked()) .detail("MyAddr", self->process->address) .detail("PeerAddr", self->peerEndpoint) .detail("PeerId", self->peerId) .detail("Opened", self->opened); - #line 512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + TraceEvent(SevError, "LeakedConnection", self->dbgid) .error(connection_leaked()) .detail("MyAddr", self->process->address) .detail("IsPublic", self->process->address.isPublic()) .detail("PeerAddr", self->peerEndpoint) .detail("PeerId", self->peerId) .detail("Opened", self->opened); + #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TrackLeakedConnectionActorState(); static_cast(this)->destroy(); return 0; } - #line 2392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TrackLeakedConnectionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2397,27 +2512,27 @@ class TrackLeakedConnectionActorState { return loopDepth; } - int a_body1cont3(Void const& _,int loopDepth) + int a_body1cont4(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1cont3(loopDepth); return loopDepth; } - int a_body1cont3(Void && _,int loopDepth) + int a_body1cont4(Void && _,int loopDepth) { - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1cont3(loopDepth); return loopDepth; } int a_body1cont1when1(Void const& _,int loopDepth) { - loopDepth = a_body1cont3(_, loopDepth); + loopDepth = a_body1cont4(_, loopDepth); return loopDepth; } int a_body1cont1when1(Void && _,int loopDepth) { - loopDepth = a_body1cont3(std::move(_), loopDepth); + loopDepth = a_body1cont4(std::move(_), loopDepth); return loopDepth; } @@ -2472,27 +2587,27 @@ class TrackLeakedConnectionActorState { fdb_probe_actor_exit("trackLeakedConnection", reinterpret_cast(this), 1); } - int a_body1cont4(Void const& _,int loopDepth) + int a_body1cont5(Void const& _,int loopDepth) { - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1cont3(loopDepth); return loopDepth; } - int a_body1cont4(Void && _,int loopDepth) + int a_body1cont5(Void && _,int loopDepth) { - loopDepth = a_body1cont2(loopDepth); + loopDepth = a_body1cont3(loopDepth); return loopDepth; } int a_body1cont1when2(Void const& _,int loopDepth) { - loopDepth = a_body1cont4(_, loopDepth); + loopDepth = a_body1cont5(_, loopDepth); return loopDepth; } int a_body1cont1when2(Void && _,int loopDepth) { - loopDepth = a_body1cont4(std::move(_), loopDepth); + loopDepth = a_body1cont5(std::move(_), loopDepth); return loopDepth; } @@ -2547,14 +2662,14 @@ class TrackLeakedConnectionActorState { fdb_probe_actor_exit("trackLeakedConnection", reinterpret_cast(this), 2); } - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Sim2Conn* self; - #line 2552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via trackLeakedConnection() - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class TrackLeakedConnectionActor final : public Actor, public ActorCallback< TrackLeakedConnectionActor, 0, Void >, public ActorCallback< TrackLeakedConnectionActor, 1, Void >, public ActorCallback< TrackLeakedConnectionActor, 2, Void >, public FastAllocated, public TrackLeakedConnectionActorState { - #line 2557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2565,9 +2680,9 @@ class TrackLeakedConnectionActor final : public Actor, public ActorCallbac friend struct ActorCallback< TrackLeakedConnectionActor, 0, Void >; friend struct ActorCallback< TrackLeakedConnectionActor, 1, Void >; friend struct ActorCallback< TrackLeakedConnectionActor, 2, Void >; - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TrackLeakedConnectionActor(Sim2Conn* const& self) - #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), TrackLeakedConnectionActorState(self) { @@ -2592,14 +2707,14 @@ friend struct ActorCallback< TrackLeakedConnectionActor, 2, Void >; } }; - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future trackLeakedConnection( Sim2Conn* const& self ) { - #line 498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new TrackLeakedConnectionActor(self)); - #line 2599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 514 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" }; #include @@ -2635,32 +2750,32 @@ class SimpleFile : public IAsyncFile, public ReferenceCounted { static bool should_poll() { return false; } - #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via open() - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class OpenActorState { - #line 2644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" OpenActorState(std::string const& filename,int const& flags,int const& mode,Reference const& diskParameters = makeReference(25000, 150000000),bool const& delayOnWrite = true) - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : filename(filename), - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" flags(flags), - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" mode(mode), - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" diskParameters(diskParameters), - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" delayOnWrite(delayOnWrite), - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - currentProcess(g_simulator.getCurrentProcess()), - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + currentProcess(g_simulator->getCurrentProcess()), + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" currentTaskID(g_network->getCurrentTask()) - #line 2663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("open", reinterpret_cast(this)); @@ -2673,36 +2788,36 @@ class OpenActorState { int a_body1(int loopDepth=0) { try { - #line 558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - if (++openCount >= 3000) - #line 2678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if (++openCount >= 6000) + #line 2793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevError, "TooManyFiles").log(); - #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ASSERT(false); - #line 2684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - if (openCount == 2000) - #line 2688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if (openCount == 4000) + #line 2803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" disableConnectionFailures("TooManyFiles"); - #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ASSERT(basename(filename).size() < 250); - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - StrictFuture __when_expr_0 = g_simulator.onMachine(currentProcess); - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_0 = g_simulator->onMachine(currentProcess); + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2724,16 +2839,16 @@ class OpenActorState { int a_body1cont1(Void const& _,int loopDepth) { try { - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = delay(FLOW_KNOBS->MIN_OPEN_TIME + deterministicRandom()->random01() * (FLOW_KNOBS->MAX_OPEN_TIME - FLOW_KNOBS->MIN_OPEN_TIME)); - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2747,16 +2862,16 @@ class OpenActorState { int a_body1cont1(Void && _,int loopDepth) { try { - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = delay(FLOW_KNOBS->MIN_OPEN_TIME + deterministicRandom()->random01() * (FLOW_KNOBS->MAX_OPEN_TIME - FLOW_KNOBS->MIN_OPEN_TIME)); - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 2754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2833,18 +2948,18 @@ class OpenActorState { int a_body1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" err = e; - #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - StrictFuture __when_expr_3 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_3 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont1Catch1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2857,100 +2972,100 @@ class OpenActorState { } int a_body1cont5(Void const& _,int loopDepth) { - #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" std::string open_filename = filename; - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (flags & OPEN_ATOMIC_WRITE_AND_CREATE) - #line 2864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ASSERT((flags & OPEN_CREATE) && (flags & OPEN_READWRITE) && !(flags & OPEN_EXCLUSIVE)); - #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" open_filename = filename + ".part"; - #line 2870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" int h = sf_open(open_filename.c_str(), flags, flagConversion(flags), mode); - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (h == -1) - #line 2876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" bool notFound = errno == ENOENT; - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Error e = notFound ? file_not_found() : io_error(); - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(notFound ? SevWarn : SevWarnAlways, "FileOpenError") .error(e) .GetLastError() .detail("File", filename) .detail("Flags", flags); - #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1cont1Catch1(e, loopDepth); - #line 2886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" platform::makeTemporary(open_filename.c_str()); - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" SimpleFile* simpleFile = new SimpleFile(h, diskParameters, delayOnWrite, filename, open_filename, flags); - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" file = Reference(simpleFile); - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - StrictFuture __when_expr_2 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_2 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 2898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont5when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont5(Void && _,int loopDepth) { - #line 576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" std::string open_filename = filename; - #line 577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (flags & OPEN_ATOMIC_WRITE_AND_CREATE) - #line 2914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ASSERT((flags & OPEN_CREATE) && (flags & OPEN_READWRITE) && !(flags & OPEN_EXCLUSIVE)); - #line 579 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" open_filename = filename + ".part"; - #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" int h = sf_open(open_filename.c_str(), flags, flagConversion(flags), mode); - #line 583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (h == -1) - #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" bool notFound = errno == ENOENT; - #line 585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Error e = notFound ? file_not_found() : io_error(); - #line 586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(notFound ? SevWarn : SevWarnAlways, "FileOpenError") .error(e) .GetLastError() .detail("File", filename) .detail("Flags", flags); - #line 591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1cont1Catch1(e, loopDepth); - #line 2936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" platform::makeTemporary(open_filename.c_str()); - #line 595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" SimpleFile* simpleFile = new SimpleFile(h, diskParameters, delayOnWrite, filename, open_filename, flags); - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" file = Reference(simpleFile); - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - StrictFuture __when_expr_2 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_2 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont5when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3020,9 +3135,9 @@ class OpenActorState { } int a_body1cont6(Void const& _,int loopDepth) { - #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(file); this->~OpenActorState(); static_cast(this)->destroy(); return 0; } - #line 3025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(file)); // state_var_RVO this->~OpenActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3032,9 +3147,9 @@ class OpenActorState { } int a_body1cont6(Void && _,int loopDepth) { - #line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(file); this->~OpenActorState(); static_cast(this)->destroy(); return 0; } - #line 3037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(file)); // state_var_RVO this->~OpenActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3107,17 +3222,17 @@ class OpenActorState { } int a_body1cont1Catch1cont1(Void const& _,int loopDepth) { - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(err, loopDepth); - #line 3112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" return loopDepth; } int a_body1cont1Catch1cont1(Void && _,int loopDepth) { - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(err, loopDepth); - #line 3120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" return loopDepth; } @@ -3184,30 +3299,30 @@ class OpenActorState { fdb_probe_actor_exit("open", reinterpret_cast(this), 3); } - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" std::string filename; - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" int flags; - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" int mode; - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Reference diskParameters; - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" bool delayOnWrite; - #line 555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ISimulator::ProcessInfo* currentProcess; - #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TaskPriority currentTaskID; - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Reference file; - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Error err; - #line 3205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via open() - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class OpenActor final : public Actor>, public ActorCallback< OpenActor, 0, Void >, public ActorCallback< OpenActor, 1, Void >, public ActorCallback< OpenActor, 2, Void >, public ActorCallback< OpenActor, 3, Void >, public FastAllocated, public OpenActorState { - #line 3210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3219,9 +3334,9 @@ friend struct ActorCallback< OpenActor, 0, Void >; friend struct ActorCallback< OpenActor, 1, Void >; friend struct ActorCallback< OpenActor, 2, Void >; friend struct ActorCallback< OpenActor, 3, Void >; - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" OpenActor(std::string const& filename,int const& flags,int const& mode,Reference const& diskParameters = makeReference(25000, 150000000),bool const& delayOnWrite = true) - #line 3224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor>(), OpenActorState(filename, flags, mode, diskParameters, delayOnWrite) { @@ -3247,14 +3362,14 @@ friend struct ActorCallback< OpenActor, 3, Void >; } }; - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future> open( std::string const& filename, int const& flags, int const& mode, Reference const& diskParameters = makeReference(25000, 150000000), bool const& delayOnWrite = true ) { - #line 549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future>(new OpenActor(filename, flags, mode, diskParameters, delayOnWrite)); - #line 3254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" void addref() override { ReferenceCounted::addref(); } void delref() override { ReferenceCounted::delref(); } @@ -3319,26 +3434,26 @@ friend struct ActorCallback< OpenActor, 3, Void >; return outFlags; } - #line 3322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3437 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via read_impl() - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class Read_implActorState { - #line 3328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Read_implActorState(SimpleFile* const& self,void* const& data,int const& length,int64_t const& offset) - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self), - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" data(data), - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" length(length), - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" offset(offset) - #line 3341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("read_impl", reinterpret_cast(this)); @@ -3351,28 +3466,28 @@ class Read_implActorState { int a_body1(int loopDepth=0) { try { - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ASSERT((self->flags & IAsyncFile::OPEN_NO_AIO) != 0 || ((uintptr_t)data % 4096 == 0 && length % 4096 == 0 && offset % 4096 == 0)); - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" opId = deterministicRandom()->randomUniqueID(); - #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (randLog) - #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" fmt::print(randLog, "SFR1 {0} {1} {2} {3} {4}\n", self->dbgId.shortString(), self->filename, opId.shortString(), length, offset); - #line 3364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = waitUntilDiskReady(self->diskParameters, length); - #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3393,47 +3508,47 @@ class Read_implActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (_lseeki64(self->h, offset, SEEK_SET) == -1) - #line 3398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3513 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevWarn, "SimpleFileIOError").detail("Location", 1); - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(io_error(), loopDepth); - #line 3404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" unsigned int read_bytes = 0; - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if ((read_bytes = _read(self->h, data, (unsigned int)length)) == -1) - #line 3410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevWarn, "SimpleFileIOError").detail("Location", 2); - #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(io_error(), loopDepth); - #line 3416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3531 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (randLog) - #line 3420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" uint32_t a = crc32c_append(0, (const uint8_t*)data, read_bytes); - #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" fprintf(randLog, "SFR2 %s %s %s %d %d\n", self->dbgId.shortString().c_str(), self->filename.c_str(), opId.shortString().c_str(), read_bytes, a); - #line 3426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" debugFileCheck("SimpleFileRead", self->filename, data, offset, length); - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" INJECT_FAULT(io_timeout, "SimpleFile::read"); - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" INJECT_FAULT(io_error, "SimpleFile::read"); - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(read_bytes); this->~Read_implActorState(); static_cast(this)->destroy(); return 0; } - #line 3436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(read_bytes); this->~Read_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3443,47 +3558,47 @@ class Read_implActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (_lseeki64(self->h, offset, SEEK_SET) == -1) - #line 3448 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevWarn, "SimpleFileIOError").detail("Location", 1); - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(io_error(), loopDepth); - #line 3454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" unsigned int read_bytes = 0; - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if ((read_bytes = _read(self->h, data, (unsigned int)length)) == -1) - #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 800 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevWarn, "SimpleFileIOError").detail("Location", 2); - #line 692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(io_error(), loopDepth); - #line 3466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (randLog) - #line 3470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" uint32_t a = crc32c_append(0, (const uint8_t*)data, read_bytes); - #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" fprintf(randLog, "SFR2 %s %s %s %d %d\n", self->dbgId.shortString().c_str(), self->filename.c_str(), opId.shortString().c_str(), read_bytes, a); - #line 3476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" debugFileCheck("SimpleFileRead", self->filename, data, offset, length); - #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" INJECT_FAULT(io_timeout, "SimpleFile::read"); - #line 709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" INJECT_FAULT(io_error, "SimpleFile::read"); - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(read_bytes); this->~Read_implActorState(); static_cast(this)->destroy(); return 0; } - #line 3486 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(read_bytes); this->~Read_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3554,22 +3669,22 @@ class Read_implActorState { fdb_probe_actor_exit("read_impl", reinterpret_cast(this), 0); } - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" SimpleFile* self; - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" void* data; - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" int length; - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" int64_t offset; - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" UID opId; - #line 3567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via read_impl() - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class Read_implActor final : public Actor, public ActorCallback< Read_implActor, 0, Void >, public FastAllocated, public Read_implActorState { - #line 3572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3578,9 +3693,9 @@ class Read_implActor final : public Actor, public ActorCallback< Read_implA void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Read_implActor, 0, Void >; - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Read_implActor(SimpleFile* const& self,void* const& data,int const& length,int64_t const& offset) - #line 3583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), Read_implActorState(self, data, length, offset) { @@ -3603,35 +3718,35 @@ friend struct ActorCallback< Read_implActor, 0, Void >; } }; - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future read_impl( SimpleFile* const& self, void* const& data, int const& length, int64_t const& offset ) { - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new Read_implActor(self, data, length, offset)); - #line 3610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 3615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via write_impl() - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class Write_implActorState { - #line 3621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Write_implActorState(SimpleFile* const& self,StringRef const& data,int64_t const& offset) - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self), - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" data(data), - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" offset(offset), - #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" opId(deterministicRandom()->randomUniqueID()) - #line 3634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("write_impl", reinterpret_cast(this)); @@ -3644,30 +3759,30 @@ class Write_implActorState { int a_body1(int loopDepth=0) { try { - #line 716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (randLog) - #line 3649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" uint32_t a = crc32c_append(0, data.begin(), data.size()); - #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" fmt::print(randLog, "SFW1 {0} {1} {2} {3} {4} {5}\n", self->dbgId.shortString(), self->filename, opId.shortString(), a, data.size(), offset); - #line 3655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (self->delayOnWrite) - #line 3659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = waitUntilDiskReady(self->diskParameters, data.size()); - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else @@ -3693,55 +3808,55 @@ class Write_implActorState { } int a_body1cont1(int loopDepth) { - #line 731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (_lseeki64(self->h, offset, SEEK_SET) == -1) - #line 3698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevWarn, "SimpleFileIOError").detail("Location", 3); - #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(io_error(), loopDepth); - #line 3704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" unsigned int write_bytes = 0; - #line 737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if ((write_bytes = _write(self->h, (void*)data.begin(), data.size())) == -1) - #line 3710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevWarn, "SimpleFileIOError").detail("Location", 4); - #line 739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(io_error(), loopDepth); - #line 3716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (write_bytes != data.size()) - #line 3720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevWarn, "SimpleFileIOError").detail("Location", 5); - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(io_error(), loopDepth); - #line 3726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (randLog) - #line 3730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" fprintf(randLog, "SFW2 %s %s %s\n", self->dbgId.shortString().c_str(), self->filename.c_str(), opId.shortString().c_str()); - #line 3734 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" debugFileCheck("SimpleFileWrite", self->filename, (void*)data.begin(), offset, data.size()); - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" INJECT_FAULT(io_timeout, "SimpleFile::write"); - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" INJECT_FAULT(io_error, "SimpleFile::write"); - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Write_implActorState(); static_cast(this)->destroy(); return 0; } - #line 3744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Write_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3824,20 +3939,20 @@ class Write_implActorState { fdb_probe_actor_exit("write_impl", reinterpret_cast(this), 0); } - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" SimpleFile* self; - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StringRef data; - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" int64_t offset; - #line 715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" UID opId; - #line 3835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via write_impl() - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class Write_implActor final : public Actor, public ActorCallback< Write_implActor, 0, Void >, public FastAllocated, public Write_implActorState { - #line 3840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3846,9 +3961,9 @@ class Write_implActor final : public Actor, public ActorCallback< Write_im void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Write_implActor, 0, Void >; - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Write_implActor(SimpleFile* const& self,StringRef const& data,int64_t const& offset) - #line 3851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), Write_implActorState(self, data, offset) { @@ -3871,33 +3986,33 @@ friend struct ActorCallback< Write_implActor, 0, Void >; } }; - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future write_impl( SimpleFile* const& self, StringRef const& data, int64_t const& offset ) { - #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new Write_implActor(self, data, offset)); - #line 3878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 3883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 3998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via truncate_impl() - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class Truncate_implActorState { - #line 3889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Truncate_implActorState(SimpleFile* const& self,int64_t const& size) - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self), - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" size(size), - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" opId(deterministicRandom()->randomUniqueID()) - #line 3900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("truncate_impl", reinterpret_cast(this)); @@ -3910,36 +4025,36 @@ class Truncate_implActorState { int a_body1(int loopDepth=0) { try { - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (randLog) - #line 3915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" fmt::print( randLog, "SFT1 {0} {1} {2} {3}\n", self->dbgId.shortString(), self->filename, opId.shortString(), size); - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if ((self->flags & IAsyncFile::OPEN_NO_AIO) == 0 && size == 0) - #line 3923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(io_error(), loopDepth); - #line 3927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (self->delayOnWrite) - #line 3931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = waitUntilDiskReady(self->diskParameters, 0); - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else @@ -3965,31 +4080,31 @@ class Truncate_implActorState { } int a_body1cont1(int loopDepth) { - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (_chsize(self->h, (long)size) == -1) - #line 3970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevWarn, "SimpleFileIOError") .detail("Location", 6) .detail("Filename", self->filename) .detail("Size", size) .detail("Fd", self->h) .GetLastError(); - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(io_error(), loopDepth); - #line 3976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (randLog) - #line 3980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 897 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" fprintf(randLog, "SFT2 %s %s %s\n", self->dbgId.shortString().c_str(), self->filename.c_str(), opId.shortString().c_str()); - #line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" INJECT_FAULT(io_timeout, "SimpleFile::truncate"); - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" INJECT_FAULT(io_error, "SimpleFile::truncate"); - #line 797 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Truncate_implActorState(); static_cast(this)->destroy(); return 0; } - #line 3992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Truncate_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4072,18 +4187,18 @@ class Truncate_implActorState { fdb_probe_actor_exit("truncate_impl", reinterpret_cast(this), 0); } - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" SimpleFile* self; - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" int64_t size; - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" UID opId; - #line 4081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via truncate_impl() - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class Truncate_implActor final : public Actor, public ActorCallback< Truncate_implActor, 0, Void >, public FastAllocated, public Truncate_implActorState { - #line 4086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4092,9 +4207,9 @@ class Truncate_implActor final : public Actor, public ActorCallback< Trunc void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Truncate_implActor, 0, Void >; - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Truncate_implActor(SimpleFile* const& self,int64_t const& size) - #line 4097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), Truncate_implActorState(self, size) { @@ -4117,32 +4232,32 @@ friend struct ActorCallback< Truncate_implActor, 0, Void >; } }; - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future truncate_impl( SimpleFile* const& self, int64_t const& size ) { - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new Truncate_implActor(self, size)); - #line 4124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" // Simulated sync does not actually do anything besides wait a random amount of time - #line 4130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via sync_impl() - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class Sync_implActorState { - #line 4136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Sync_implActorState(SimpleFile* const& self) - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self), - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" opId(deterministicRandom()->randomUniqueID()) - #line 4145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("sync_impl", reinterpret_cast(this)); @@ -4155,28 +4270,28 @@ class Sync_implActorState { int a_body1(int loopDepth=0) { try { - #line 803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (randLog) - #line 4160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" fprintf(randLog, "SFC1 %s %s %s\n", self->dbgId.shortString().c_str(), self->filename.c_str(), opId.shortString().c_str()); - #line 4164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (self->delayOnWrite) - #line 4168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = waitUntilDiskReady(self->diskParameters, 0, true); - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else @@ -4202,48 +4317,64 @@ class Sync_implActorState { } int a_body1cont1(int loopDepth) { - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (self->flags & OPEN_ATOMIC_WRITE_AND_CREATE) - #line 4207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->flags &= ~OPEN_ATOMIC_WRITE_AND_CREATE; - #line 815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - auto& machineCache = g_simulator.getCurrentProcess()->machine->openFiles; - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + auto& machineCache = g_simulator->getCurrentProcess()->machine->openFiles; + #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" std::string sourceFilename = self->filename + ".part"; - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (machineCache.count(sourceFilename)) - #line 4217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + using block_value_type = typename decltype(g_simulator->corruptedBlocks)::key_type::second_type; + #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent("SimpleFileRename") .detail("From", sourceFilename) .detail("To", self->filename) .detail("SourceCount", machineCache.count(sourceFilename)) .detail("FileCount", machineCache.count(self->filename)); - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + auto maxBlockValue = std::numeric_limits::max(); + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->corruptedBlocks.erase( g_simulator->corruptedBlocks.lower_bound(std::make_pair(sourceFilename, 0u)), g_simulator->corruptedBlocks.upper_bound(std::make_pair(self->filename, maxBlockValue))); + #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + auto begin = g_simulator->corruptedBlocks.lower_bound(std::make_pair(sourceFilename, 0u)), end = g_simulator->corruptedBlocks.upper_bound(std::make_pair(sourceFilename, maxBlockValue)); + #line 943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + for(auto iter = begin;iter != end;++iter) { + #line 944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->corruptedBlocks.emplace(self->filename, iter->second); + #line 4348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + } + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->corruptedBlocks.erase(begin, end); + #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" renameFile(sourceFilename.c_str(), self->filename.c_str()); - #line 826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" machineCache[self->filename] = machineCache[sourceFilename]; - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" machineCache.erase(sourceFilename); - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->actualFilename = self->filename; - #line 4229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } } - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (randLog) - #line 4234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" fprintf(randLog, "SFC2 %s %s %s\n", self->dbgId.shortString().c_str(), self->filename.c_str(), opId.shortString().c_str()); - #line 4238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 839 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" INJECT_FAULT(io_timeout, "SimpleFile::sync"); - #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" INJECT_FAULT(io_error, "SimpleFile::sync"); - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~Sync_implActorState(); static_cast(this)->destroy(); return 0; } - #line 4246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~Sync_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4326,16 +4457,16 @@ class Sync_implActorState { fdb_probe_actor_exit("sync_impl", reinterpret_cast(this), 0); } - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" SimpleFile* self; - #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" UID opId; - #line 4333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via sync_impl() - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class Sync_implActor final : public Actor, public ActorCallback< Sync_implActor, 0, Void >, public FastAllocated, public Sync_implActorState { - #line 4338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4344,9 +4475,9 @@ class Sync_implActor final : public Actor, public ActorCallback< Sync_impl void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Sync_implActor, 0, Void >; - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Sync_implActor(SimpleFile* const& self) - #line 4349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), Sync_implActorState(self) { @@ -4369,31 +4500,31 @@ friend struct ActorCallback< Sync_implActor, 0, Void >; } }; - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future sync_impl( SimpleFile* const& self ) { - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new Sync_implActor(self)); - #line 4376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 4381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via size_impl() - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class Size_implActorState { - #line 4387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Size_implActorState(SimpleFile const* const& self) - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self), - #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" opId(deterministicRandom()->randomUniqueID()) - #line 4396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("size_impl", reinterpret_cast(this)); @@ -4406,24 +4537,24 @@ class Size_implActorState { int a_body1(int loopDepth=0) { try { - #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (randLog) - #line 4411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" fprintf(randLog, "SFS1 %s %s %s\n", self->dbgId.shortString().c_str(), self->filename.c_str(), opId.shortString().c_str()); - #line 4415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = waitUntilDiskReady(self->diskParameters, 0); - #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4444,31 +4575,31 @@ class Size_implActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" int64_t pos = _lseeki64(self->h, 0L, SEEK_END); - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (pos == -1) - #line 4451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevWarn, "SimpleFileIOError").detail("Location", 8); - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(io_error(), loopDepth); - #line 4457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (randLog) - #line 4461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" fmt::print( randLog, "SFS2 {0} {1} {2} {3}\n", self->dbgId.shortString(), self->filename, opId.shortString(), pos); - #line 4465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" INJECT_FAULT(io_error, "SimpleFile::size"); - #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(pos); this->~Size_implActorState(); static_cast(this)->destroy(); return 0; } - #line 4471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< int64_t >::value()) int64_t(pos); this->~Size_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4478,31 +4609,31 @@ class Size_implActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" int64_t pos = _lseeki64(self->h, 0L, SEEK_END); - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (pos == -1) - #line 4485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevWarn, "SimpleFileIOError").detail("Location", 8); - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(io_error(), loopDepth); - #line 4491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (randLog) - #line 4495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 986 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" fmt::print( randLog, "SFS2 {0} {1} {2} {3}\n", self->dbgId.shortString(), self->filename, opId.shortString(), pos); - #line 4499 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" INJECT_FAULT(io_error, "SimpleFile::size"); - #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(pos); this->~Size_implActorState(); static_cast(this)->destroy(); return 0; } - #line 4505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< int64_t >::value()) int64_t(pos); this->~Size_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4573,16 +4704,16 @@ class Size_implActorState { fdb_probe_actor_exit("size_impl", reinterpret_cast(this), 0); } - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" SimpleFile const* self; - #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" UID opId; - #line 4580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via size_impl() - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class Size_implActor final : public Actor, public ActorCallback< Size_implActor, 0, Void >, public FastAllocated, public Size_implActorState { - #line 4585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4591,9 +4722,9 @@ class Size_implActor final : public Actor, public ActorCallback< Size_i void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Size_implActor, 0, Void >; - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Size_implActor(SimpleFile const* const& self) - #line 4596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), Size_implActorState(self) { @@ -4616,14 +4747,14 @@ friend struct ActorCallback< Size_implActor, 0, Void >; } }; - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future size_impl( SimpleFile const* const& self ) { - #line 845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new Size_implActor(self)); - #line 4623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" }; struct SimDiskSpace { @@ -4653,24 +4784,24 @@ struct Sim2Listener final : IListener, ReferenceCounted { ISimulator::ProcessInfo* process; PromiseStream> nextConnection; - #line 4656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via incoming() - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class IncomingActorState { - #line 4662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" IncomingActorState(Reference const& self,double const& seconds,Reference const& conn) - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self), - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" seconds(seconds), - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" conn(conn) - #line 4673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("incoming", reinterpret_cast(this)); @@ -4683,15 +4814,15 @@ class IncomingActorState { int a_body1(int loopDepth=0) { try { - #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - StrictFuture __when_expr_0 = g_simulator.onProcess(self->process); - #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_0 = g_simulator->onProcess(self->process); + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 4690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" static_cast(this)->actor_wait_state = 1; - #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -4711,30 +4842,30 @@ class IncomingActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = delay(seconds); - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - #line 4718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" static_cast(this)->actor_wait_state = 2; - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = delay(seconds); - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - #line 4733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" static_cast(this)->actor_wait_state = 2; - #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4804,40 +4935,40 @@ class IncomingActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (((Sim2Conn*)conn.getPtr())->isPeerGone() && deterministicRandom()->random01() < 0.5) - #line 4809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" delete static_cast(this); - #line 4813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" return 0; } - #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent("Sim2IncomingConn", conn->getDebugID()) .detail("ListenAddress", self->getListenAddress()) .detail("PeerAddress", conn->getPeerAddress()); - #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->nextConnection.send(conn); - #line 4820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = a_body1cont5(loopDepth); return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 901 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (((Sim2Conn*)conn.getPtr())->isPeerGone() && deterministicRandom()->random01() < 0.5) - #line 4829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" delete static_cast(this); - #line 4833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" return 0; } - #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent("Sim2IncomingConn", conn->getDebugID()) .detail("ListenAddress", self->getListenAddress()) .detail("PeerAddress", conn->getPeerAddress()); - #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->nextConnection.send(conn); - #line 4840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 4971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = a_body1cont5(loopDepth); return loopDepth; @@ -4907,25 +5038,25 @@ class IncomingActorState { } int a_body1cont5(int loopDepth) { - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" delete static_cast(this); - #line 4912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" return 0; return loopDepth; } - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Reference self; - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" double seconds; - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Reference conn; - #line 4923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via incoming() - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class IncomingActor final : public Actor, public ActorCallback< IncomingActor, 0, Void >, public ActorCallback< IncomingActor, 1, Void >, public FastAllocated, public IncomingActorState { - #line 4928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4935,9 +5066,9 @@ class IncomingActor final : public Actor, public ActorCallback< IncomingAc #pragma clang diagnostic pop friend struct ActorCallback< IncomingActor, 0, Void >; friend struct ActorCallback< IncomingActor, 1, Void >; - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" IncomingActor(Reference const& self,double const& seconds,Reference const& conn) - #line 4940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), IncomingActorState(self, seconds, conn) { @@ -4951,28 +5082,28 @@ friend struct ActorCallback< IncomingActor, 1, Void >; } }; - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" static void incoming( Reference const& self, double const& seconds, Reference const& conn ) { - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" new IncomingActor(self, seconds, conn); - #line 4958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 4962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" +#line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 5093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via popOne() - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class PopOneActorState { - #line 4968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" PopOneActorState(FutureStream> const& conns) - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : conns(conns) - #line 4975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("popOne", reinterpret_cast(this)); @@ -4985,16 +5116,16 @@ class PopOneActorState { int a_body1(int loopDepth=0) { try { - #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" FutureStream> __when_expr_0 = conns; - #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 4997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5015,11 +5146,11 @@ class PopOneActorState { } int a_body1cont1(Reference const& c,int loopDepth) { - #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ((Sim2Conn*)c.getPtr())->opened = true; - #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(c); this->~PopOneActorState(); static_cast(this)->destroy(); return 0; } - #line 5022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(c); this->~PopOneActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5029,11 +5160,11 @@ class PopOneActorState { } int a_body1cont1(Reference && c,int loopDepth) { - #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ((Sim2Conn*)c.getPtr())->opened = true; - #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(c); this->~PopOneActorState(); static_cast(this)->destroy(); return 0; } - #line 5036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(c); this->~PopOneActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5104,14 +5235,14 @@ class PopOneActorState { fdb_probe_actor_exit("popOne", reinterpret_cast(this), 0); } - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" FutureStream> conns; - #line 5109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via popOne() - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class PopOneActor final : public Actor>, public ActorSingleCallback< PopOneActor, 0, Reference >, public FastAllocated, public PopOneActorState { - #line 5114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5120,9 +5251,9 @@ class PopOneActor final : public Actor>, public ActorSing void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorSingleCallback< PopOneActor, 0, Reference >; - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" PopOneActor(FutureStream> const& conns) - #line 5125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor>(), PopOneActorState(conns) { @@ -5145,19 +5276,19 @@ friend struct ActorSingleCallback< PopOneActor, 0, Reference >; } }; - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future> popOne( FutureStream> const& conns ) { - #line 908 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future>(new PopOneActor(conns)); - #line 5152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" NetworkAddress address; }; -#define g_sim2 ((Sim2&)g_simulator) +#define g_sim2 ((Sim2&)(*g_simulator)) class Sim2 final : public ISimulator, public INetworkConnections { public: @@ -5184,37 +5315,42 @@ class Sim2 final : public ISimulator, public INetworkConnections { } Future delay(double seconds, TaskPriority taskID, ProcessInfo* machine, bool ordered = false) { ASSERT(seconds >= -0.0001); - seconds = std::max(0.0, seconds); - Future f; - if (!ordered && !currentProcess->rebooting && machine == currentProcess && - !currentProcess->shutdownSignal.isSet() && FLOW_KNOBS->MAX_BUGGIFIED_DELAY > 0 && - deterministicRandom()->random01() < 0.25) { // FIXME: why doesn't this work when we are changing machines? - seconds += FLOW_KNOBS->MAX_BUGGIFIED_DELAY * pow(deterministicRandom()->random01(), 1000.0); - } - - mutex.enter(); - tasks.push(Task(time + seconds, taskID, taskCount++, machine, f)); - mutex.leave(); + if (seconds >= 4e12) // Intervals that overflow an int64_t in microseconds (more than 100,000 years) are treated + // as infinite + return Never(); - return f; + PromiseTask* t = new PromiseTask(machine); + if (seconds <= TIME_EPS) { + taskQueue.addReady(taskID, t); + } else { + if (!ordered && !currentProcess->rebooting && machine == currentProcess && + !currentProcess->shutdownSignal.isSet() && FLOW_KNOBS->MAX_BUGGIFIED_DELAY > 0 && + deterministicRandom()->random01() < 0.25) { + // FIXME: why doesn't this work when we are changing machines? + seconds += FLOW_KNOBS->MAX_BUGGIFIED_DELAY * pow(deterministicRandom()->random01(), 1000.0); + } + double at = now() + seconds; + taskQueue.addTimer(at, taskID, t); + } + return t->promise.getFuture(); } - #line 5202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via checkShutdown() - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class CheckShutdownActorState { - #line 5208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" CheckShutdownActorState(Sim2* const& self,TaskPriority const& taskID) - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self), - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" taskID(taskID) - #line 5217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("checkShutdown", reinterpret_cast(this)); @@ -5227,16 +5363,16 @@ class CheckShutdownActorState { int a_body1(int loopDepth=0) { try { - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = success(self->getCurrentProcess()->shutdownSignal.getFuture()); - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5257,11 +5393,11 @@ class CheckShutdownActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->setCurrentTask(taskID); - #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckShutdownActorState(); static_cast(this)->destroy(); return 0; } - #line 5264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CheckShutdownActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5271,11 +5407,11 @@ class CheckShutdownActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->setCurrentTask(taskID); - #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CheckShutdownActorState(); static_cast(this)->destroy(); return 0; } - #line 5278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CheckShutdownActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5346,16 +5482,16 @@ class CheckShutdownActorState { fdb_probe_actor_exit("checkShutdown", reinterpret_cast(this), 0); } - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Sim2* self; - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TaskPriority taskID; - #line 5353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via checkShutdown() - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class CheckShutdownActor final : public Actor, public ActorCallback< CheckShutdownActor, 0, Void >, public FastAllocated, public CheckShutdownActorState { - #line 5358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5364,9 +5500,9 @@ class CheckShutdownActor final : public Actor, public ActorCallback< Check void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< CheckShutdownActor, 0, Void >; - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" CheckShutdownActor(Sim2* const& self,TaskPriority const& taskID) - #line 5369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5505 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), CheckShutdownActorState(self, taskID) { @@ -5389,14 +5525,14 @@ friend struct ActorCallback< CheckShutdownActor, 0, Void >; } }; - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future checkShutdown( Sim2* const& self, TaskPriority const& taskID ) { - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new CheckShutdownActor(self, taskID)); - #line 5396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Future yield(TaskPriority taskID) override { if (taskID == TaskPriority::DefaultYield) taskID = currentTaskID; @@ -5451,6 +5587,10 @@ friend struct ActorCallback< CheckShutdownActor, 0, Void >; } Future> connectExternal(NetworkAddress toAddr) override { + // If sim http connection, do connect instead of external connect + if (httpServerIps.count(toAddr.ip)) { + return connect(toAddr); + } return SimExternalConnection::connect(toAddr); } @@ -5518,22 +5658,22 @@ friend struct ActorCallback< CheckShutdownActor, 0, Void >; } return SimExternalConnection::resolveTCPEndpointBlocking(host, service, &dnsCache); } - #line 5521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via onConnect() - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class OnConnectActorState { - #line 5527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" OnConnectActorState(Future const& ready,Reference const& conn) - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : ready(ready), - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" conn(conn) - #line 5536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("onConnect", reinterpret_cast(this)); @@ -5546,16 +5686,16 @@ class OnConnectActorState { int a_body1(int loopDepth=0) { try { - #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = ready; - #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5576,30 +5716,30 @@ class OnConnectActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (conn->isPeerGone()) - #line 5581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" conn.clear(); - #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (FLOW_KNOBS->SIM_CONNECT_ERROR_MODE == 1 || (FLOW_KNOBS->SIM_CONNECT_ERROR_MODE == 2 && deterministicRandom()->random01() > 0.5)) - #line 5587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(connection_failed(), loopDepth); - #line 5591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = Never(); - #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else @@ -5611,30 +5751,30 @@ class OnConnectActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (conn->isPeerGone()) - #line 5616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" conn.clear(); - #line 1089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (FLOW_KNOBS->SIM_CONNECT_ERROR_MODE == 1 || (FLOW_KNOBS->SIM_CONNECT_ERROR_MODE == 2 && deterministicRandom()->random01() > 0.5)) - #line 5622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 1091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(connection_failed(), loopDepth); - #line 5626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = Never(); - #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 5632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else @@ -5709,11 +5849,11 @@ class OnConnectActorState { } int a_body1cont2(int loopDepth) { - #line 1095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" conn->opened = true; - #line 1096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(conn); this->~OnConnectActorState(); static_cast(this)->destroy(); return 0; } - #line 5716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(conn)); // state_var_RVO this->~OnConnectActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5796,16 +5936,16 @@ class OnConnectActorState { fdb_probe_actor_exit("onConnect", reinterpret_cast(this), 1); } - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Future ready; - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Reference conn; - #line 5803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via onConnect() - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class OnConnectActor final : public Actor>, public ActorCallback< OnConnectActor, 0, Void >, public ActorCallback< OnConnectActor, 1, Void >, public FastAllocated, public OnConnectActorState { - #line 5808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5815,9 +5955,9 @@ class OnConnectActor final : public Actor>, public ActorC #pragma clang diagnostic pop friend struct ActorCallback< OnConnectActor, 0, Void >; friend struct ActorCallback< OnConnectActor, 1, Void >; - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" OnConnectActor(Future const& ready,Reference const& conn) - #line 5820 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor>(), OnConnectActorState(ready, conn) { @@ -5841,35 +5981,35 @@ friend struct ActorCallback< OnConnectActor, 1, Void >; } }; - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future> onConnect( Future const& ready, Reference const& conn ) { - #line 1085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future>(new OnConnectActor(ready, conn)); - #line 5848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 1230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Reference listen(NetworkAddress localAddr) override { Reference listener(getCurrentProcess()->getListener(localAddr)); ASSERT(listener); return listener; } - #line 5857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 5997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via waitForProcessAndConnect() - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class WaitForProcessAndConnectActorState { - #line 5863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" WaitForProcessAndConnectActorState(NetworkAddress const& toAddr,INetworkConnections* const& self) - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : toAddr(toAddr), - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self(self) - #line 5872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("waitForProcessAndConnect", reinterpret_cast(this)); @@ -5882,9 +6022,9 @@ class WaitForProcessAndConnectActorState { int a_body1(int loopDepth=0) { try { - #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ; - #line 5887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -5912,36 +6052,36 @@ class WaitForProcessAndConnectActorState { } int a_body1loopBody1(int loopDepth) { - #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = ::delay(0.1 * deterministicRandom()->random01()); - #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (g_sim2.addressMap.count(toAddr)) - #line 5933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture> __when_expr_1 = self->connect(toAddr); - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else @@ -5953,20 +6093,20 @@ class WaitForProcessAndConnectActorState { } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 1108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (g_sim2.addressMap.count(toAddr)) - #line 5958 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture> __when_expr_1 = self->connect(toAddr); - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 5969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else @@ -6047,9 +6187,9 @@ class WaitForProcessAndConnectActorState { } int a_body1loopBody1cont3(Reference const& c,int loopDepth) { - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(c); this->~WaitForProcessAndConnectActorState(); static_cast(this)->destroy(); return 0; } - #line 6052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(c); this->~WaitForProcessAndConnectActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6059,9 +6199,9 @@ class WaitForProcessAndConnectActorState { } int a_body1loopBody1cont3(Reference && c,int loopDepth) { - #line 1110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(c); this->~WaitForProcessAndConnectActorState(); static_cast(this)->destroy(); return 0; } - #line 6064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(c); this->~WaitForProcessAndConnectActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6132,16 +6272,16 @@ class WaitForProcessAndConnectActorState { fdb_probe_actor_exit("waitForProcessAndConnect", reinterpret_cast(this), 1); } - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" NetworkAddress toAddr; - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" INetworkConnections* self; - #line 6139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via waitForProcessAndConnect() - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class WaitForProcessAndConnectActor final : public Actor>, public ActorCallback< WaitForProcessAndConnectActor, 0, Void >, public ActorCallback< WaitForProcessAndConnectActor, 1, Reference >, public FastAllocated, public WaitForProcessAndConnectActorState { - #line 6144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6151,9 +6291,9 @@ class WaitForProcessAndConnectActor final : public Actor> #pragma clang diagnostic pop friend struct ActorCallback< WaitForProcessAndConnectActor, 0, Void >; friend struct ActorCallback< WaitForProcessAndConnectActor, 1, Reference >; - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" WaitForProcessAndConnectActor(NetworkAddress const& toAddr,INetworkConnections* const& self) - #line 6156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor>(), WaitForProcessAndConnectActorState(toAddr, self) { @@ -6177,14 +6317,14 @@ friend struct ActorCallback< WaitForProcessAndConnectActor, 1, Reference> waitForProcessAndConnect( NetworkAddress const& toAddr, INetworkConnections* const& self ) { - #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future>(new WaitForProcessAndConnectActor(toAddr, self)); - #line 6184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 1114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" const TLSConfig& getTLSConfig() const override { static TLSConfig emptyConfig; return emptyConfig; @@ -6208,7 +6348,7 @@ friend struct ActorCallback< WaitForProcessAndConnectActor, 1, ReferenceisSimulated()); - currentProcess = g_simulator.getCurrentProcess(); + currentProcess = g_simulator->getCurrentProcess(); } }; @@ -6278,24 +6418,24 @@ friend struct ActorCallback< WaitForProcessAndConnectActor, 1, Referenceaddress.ip; } - #line 6281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via deleteFileImpl() - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class DeleteFileImplActorState { - #line 6287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" DeleteFileImplActorState(Sim2* const& self,std::string const& filename,bool const& mustBeDurable) - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self), - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" filename(filename), - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" mustBeDurable(mustBeDurable) - #line 6298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("deleteFileImpl", reinterpret_cast(this)); @@ -6308,47 +6448,47 @@ class DeleteFileImplActorState { int a_body1(int loopDepth=0) { try { - #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - if (g_simulator.getCurrentProcess()->machine->openFiles.count(filename)) - #line 6313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if (g_simulator->getCurrentProcess()->machine->openFiles.count(filename)) + #line 6453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - g_simulator.getCurrentProcess()->machine->openFiles.erase(filename); - #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - g_simulator.getCurrentProcess()->machine->deletingOrClosingFiles.insert(filename); - #line 6319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->getCurrentProcess()->machine->openFiles.erase(filename); + #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->getCurrentProcess()->machine->deletingOrClosingFiles.insert(filename); + #line 6459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (mustBeDurable || deterministicRandom()->random01() < 0.5) - #line 6323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - currentProcess = g_simulator.getCurrentProcess(); - #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + currentProcess = g_simulator->getCurrentProcess(); + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" currentTaskID = g_network->getCurrentTask(); - #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevDebug, "Sim2DeleteFileImpl") .detail("CurrentProcess", currentProcess->toString()) .detail("Filename", filename) .detail("Durable", mustBeDurable); - #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - StrictFuture __when_expr_0 = g_simulator.onMachine(currentProcess); - #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_0 = g_simulator->onMachine(currentProcess); + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else { - #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevDebug, "Sim2DeleteFileImplNonDurable") .detail("Filename", filename) .detail("Durable", mustBeDurable); - #line 1242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - TEST(true); - #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + CODE_PROBE(true, "Simulated non-durable delete", probe::context::sim2, probe::assert::simOnly); + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteFileImplActorState(); static_cast(this)->destroy(); return 0; } - #line 6351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6491 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DeleteFileImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6374,16 +6514,16 @@ class DeleteFileImplActorState { int a_body1cont3(Void const& _,int loopDepth) { try { - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = ::delay(0.05 * deterministicRandom()->random01()); - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont3Catch1(actor_cancelled(), loopDepth); - #line 6381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont3Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont3when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6397,16 +6537,16 @@ class DeleteFileImplActorState { int a_body1cont3(Void && _,int loopDepth) { try { - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = ::delay(0.05 * deterministicRandom()->random01()); - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont3Catch1(actor_cancelled(), loopDepth); - #line 6404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont3Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont3when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 1224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6483,18 +6623,18 @@ class DeleteFileImplActorState { int a_body1cont3Catch1(const Error& e,int loopDepth=0) { try { - #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" err = e; - #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - StrictFuture __when_expr_4 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_4 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 6492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont3Catch1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 1235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -6507,24 +6647,24 @@ class DeleteFileImplActorState { } int a_body1cont5(Void const& _,int loopDepth) { - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!currentProcess->rebooting) - #line 6512 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" auto f = IAsyncFileSystem::filesystem(self->net2)->deleteFile(filename, false); - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ASSERT(f.isReady()); - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_2 = ::delay(0.05 * deterministicRandom()->random01()); - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont3Catch1(actor_cancelled(), loopDepth); - #line 6522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont3Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont5when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else @@ -6536,24 +6676,24 @@ class DeleteFileImplActorState { } int a_body1cont5(Void && _,int loopDepth) { - #line 1225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!currentProcess->rebooting) - #line 6541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" auto f = IAsyncFileSystem::filesystem(self->net2)->deleteFile(filename, false); - #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ASSERT(f.isReady()); - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_2 = ::delay(0.05 * deterministicRandom()->random01()); - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont3Catch1(actor_cancelled(), loopDepth); - #line 6551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont3Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont5when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 1228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } else @@ -6628,34 +6768,34 @@ class DeleteFileImplActorState { } int a_body1cont6(int loopDepth) { - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - StrictFuture __when_expr_3 = g_simulator.onProcess(currentProcess, currentTaskID); - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_3 = g_simulator->onProcess(currentProcess, currentTaskID); + #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont3Catch1(actor_cancelled(), loopDepth); - #line 6635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont3Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont6when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 1231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 6640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont7(Void const& _,int loopDepth) { - #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - TEST(true); - #line 6649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + CODE_PROBE(true, "Simulated durable delete", probe::context::sim2, probe::assert::simOnly); + #line 6789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = a_body1cont6(loopDepth); return loopDepth; } int a_body1cont7(Void && _,int loopDepth) { - #line 1229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - TEST(true); - #line 6658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 1361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + CODE_PROBE(true, "Simulated durable delete", probe::context::sim2, probe::assert::simOnly); + #line 6798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = a_body1cont6(loopDepth); return loopDepth; @@ -6725,9 +6865,9 @@ class DeleteFileImplActorState { } int a_body1cont9(Void const& _,int loopDepth) { - #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteFileImplActorState(); static_cast(this)->destroy(); return 0; } - #line 6730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DeleteFileImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6737,9 +6877,9 @@ class DeleteFileImplActorState { } int a_body1cont9(Void && _,int loopDepth) { - #line 1232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1364 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~DeleteFileImplActorState(); static_cast(this)->destroy(); return 0; } - #line 6742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~DeleteFileImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -6812,17 +6952,17 @@ class DeleteFileImplActorState { } int a_body1cont3Catch1cont1(Void const& _,int loopDepth) { - #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(err, loopDepth); - #line 6817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" return loopDepth; } int a_body1cont3Catch1cont1(Void && _,int loopDepth) { - #line 1236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(err, loopDepth); - #line 6825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 6965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" return loopDepth; } @@ -6889,24 +7029,24 @@ class DeleteFileImplActorState { fdb_probe_actor_exit("deleteFileImpl", reinterpret_cast(this), 4); } - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Sim2* self; - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" std::string filename; - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" bool mustBeDurable; - #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ISimulator::ProcessInfo* currentProcess; - #line 1217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TaskPriority currentTaskID; - #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Error err; - #line 6904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 7044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via deleteFileImpl() - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class DeleteFileImplActor final : public Actor, public ActorCallback< DeleteFileImplActor, 0, Void >, public ActorCallback< DeleteFileImplActor, 1, Void >, public ActorCallback< DeleteFileImplActor, 2, Void >, public ActorCallback< DeleteFileImplActor, 3, Void >, public ActorCallback< DeleteFileImplActor, 4, Void >, public FastAllocated, public DeleteFileImplActorState { - #line 6909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 7049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6919,9 +7059,9 @@ friend struct ActorCallback< DeleteFileImplActor, 1, Void >; friend struct ActorCallback< DeleteFileImplActor, 2, Void >; friend struct ActorCallback< DeleteFileImplActor, 3, Void >; friend struct ActorCallback< DeleteFileImplActor, 4, Void >; - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" DeleteFileImplActor(Sim2* const& self,std::string const& filename,bool const& mustBeDurable) - #line 6924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 7064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), DeleteFileImplActorState(self, filename, mustBeDurable) { @@ -6948,32 +7088,43 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; } }; - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future deleteFileImpl( Sim2* const& self, std::string const& filename, bool const& mustBeDurable ) { - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new DeleteFileImplActor(self, filename, mustBeDurable)); - #line 6955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 7095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 1246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 1378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" static void runLoop(Sim2* self) { ISimulator::ProcessInfo* callingMachine = self->currentProcess; + int lastPrintTime = 0; while (!self->isStopped) { - self->mutex.enter(); - if (self->tasks.size() == 0) { - self->mutex.leave(); - ASSERT(false); + if (self->taskQueue.canSleep()) { + double sleepTime = self->taskQueue.getSleepTime(self->time); + self->time += + sleepTime + FLOW_KNOBS->MAX_RUNLOOP_SLEEP_DELAY * pow(deterministicRandom()->random01(), 1000.0); + if (self->printSimTime && (int)self->time > lastPrintTime) { + printf("Time: %d\n", (int)self->time); + lastPrintTime = (int)self->time; + } + self->timerTime = std::max(self->timerTime, self->time); } // if (!randLog/* && now() >= 32.0*/) // randLog = fopen("randLog.txt", "wt"); - Task t = std::move(self->tasks.top()); // Unfortunately still a copy under gcc where .top() returns const& - self->currentTaskID = t.taskID; - self->tasks.pop(); - self->mutex.leave(); - self->execTask(t); - self->yielded = false; + self->taskQueue.processReadyTimers(self->time); + self->taskQueue.processThreadReady(); + + while (self->taskQueue.hasReadyTask()) { + self->currentTaskID = self->taskQueue.getReadyTaskID(); + PromiseTask* task = self->taskQueue.getReadyTask(); + self->taskQueue.popReadyTask(); + self->execTask(*task); + delete task; + self->yielded = false; + } } self->currentProcess = callingMachine; for (auto& fn : self->stopCallbacks) { @@ -6992,7 +7143,8 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; ProcessClass startingClass, const char* dataFolder, const char* coordinationFolder, - ProtocolVersion protocol) override { + ProtocolVersion protocol, + bool drProcess) override { ASSERT(locality.machineId().present()); MachineInfo& machine = machines[locality.machineId().get()]; if (!machine.machineId.present()) @@ -7039,9 +7191,10 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; m->machine = &machine; machine.processes.push_back(m); currentlyRebootingProcesses.erase(addresses.address); - m->excluded = g_simulator.isExcluded(NetworkAddress(ip, port, true, false)); - m->cleared = g_simulator.isCleared(addresses.address); + m->excluded = g_simulator->isExcluded(NetworkAddress(ip, port, true, false)); + m->cleared = g_simulator->isCleared(addresses.address); m->protocolVersion = protocol; + m->drProcess = drProcess; m->setGlobal(enTDMetrics, (flowGlobalType)&m->tdmetrics); if (FLOW_KNOBS->ENABLE_CHAOS_FEATURES) { @@ -7049,13 +7202,15 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; } m->setGlobal(enNetworkConnections, (flowGlobalType)m->network); m->setGlobal(enASIOTimedOut, (flowGlobalType) false); + m->setGlobal(INetwork::enMetrics, (flowGlobalType)&m->metrics); TraceEvent("NewMachine") .detail("Name", name) .detail("Address", m->address) .detail("MachineId", m->locality.machineId()) .detail("Excluded", m->excluded) - .detail("Cleared", m->cleared); + .detail("Cleared", m->cleared) + .detail("DrProcess", m->drProcess); if (std::string(name) == "remote flow process") { protectedAddresses.insert(m->address); @@ -7077,7 +7232,20 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; } } } - return canKillProcesses(processesLeft, processesDead, KillInstantly, nullptr); + return canKillProcesses(processesLeft, processesDead, KillType::KillInstantly, nullptr); + } + + std::vector getAllAddressesInDCToExclude(Optional> dcId) const override { + std::vector addresses; + if (!dcId.present()) { + return addresses; + } + for (const auto& processInfo : getAllProcesses()) { + if (processInfo->locality.dcId() == dcId) { + addresses.emplace_back(processInfo->address.ip, processInfo->address.port); + } + } + return addresses; } bool datacenterDead(Optional> dcId) const override { @@ -7089,7 +7257,8 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; std::vector primaryLocalitiesDead, primaryLocalitiesLeft; for (auto processInfo : getAllProcesses()) { - if (processInfo->isAvailableClass() && processInfo->locality.dcId() == dcId) { + if (!processInfo->isSpawnedKVProcess() && processInfo->isAvailableClass() && + processInfo->locality.dcId() == dcId) { if (processInfo->isExcluded() || processInfo->isCleared() || !processInfo->isAvailable()) { primaryProcessesDead.add(processInfo->locality); primaryLocalitiesDead.push_back(processInfo->locality); @@ -7109,10 +7278,50 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; if (usableRegions > 1 && remoteTLogPolicy && !primaryTLogsDead) { primaryTLogsDead = primaryProcessesDead.validate(remoteTLogPolicy); } - return primaryTLogsDead || primaryProcessesDead.validate(storagePolicy); } + // The following function will determine if a machine can be remove in case when it has a blob worker + bool canKillMachineWithBlobWorkers(Optional> machineId, KillType kt, KillType* ktFinal) { + // Allow if no blob workers, or it's a reboot(without removing the machine) + // FIXME: this should be || + if (!blobGranulesEnabled && kt >= KillType::RebootAndDelete) { + return true; + } + + // Allow if the machine doesn't support blob worker + MachineInfo& currentMachine = machines[machineId]; + bool hasBlobWorker = false; + for (auto processInfo : currentMachine.processes) { + if (processInfo->startingClass == ProcessClass::BlobWorkerClass) { + hasBlobWorker = true; + break; + } + } + if (!hasBlobWorker) + return true; + + // Count # remaining support blob workers in current dc + auto currentDcId = currentMachine.machineProcess->locality.dcId(); + int nLeft = 0; + for (auto processInfo : getAllProcesses()) { + if (currentDcId != processInfo->locality.dcId() || // skip other dc + processInfo->startingClass != ProcessClass::BlobWorkerClass || // skip non blob workers + processInfo->failed || // if process was killed but has not yet been removed from the process list + processInfo->locality.machineId() == machineId) { // skip current machine + continue; + } + nLeft++; // alive blob workers after killing machineId + } + + // Ensure there is at least 1 remaining blob workers after removing current machine + if (nLeft <= 1) { + *ktFinal = KillType::RebootAndDelete; // reboot and delete data, but keep this machine + return false; + } + return true; + } + // The following function will determine if the specified configuration of available and dead processes can allow // the cluster to survive bool canKillProcesses(std::vector const& availableProcesses, @@ -7123,8 +7332,8 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; int nQuorum = ((desiredCoordinators + 1) / 2) * 2 - 1; KillType newKt = kt; - if ((kt == KillInstantly) || (kt == InjectFaults) || (kt == FailDisk) || (kt == RebootAndDelete) || - (kt == RebootProcessAndDelete)) { + if ((kt == KillType::KillInstantly) || (kt == KillType::InjectFaults) || (kt == KillType::FailDisk) || + (kt == KillType::RebootAndDelete) || (kt == KillType::RebootProcessAndDelete)) { LocalityGroup primaryProcessesLeft, primaryProcessesDead; LocalityGroup primarySatelliteProcessesLeft, primarySatelliteProcessesDead; LocalityGroup remoteProcessesLeft, remoteProcessesDead; @@ -7138,7 +7347,7 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; std::vector badCombo; std::set>> uniqueMachines; - if (!primaryDcId.present()) { + if (!primaryDcId.present() || usableRegions == 1) { for (auto processInfo : availableProcesses) { primaryProcessesLeft.add(processInfo->locality); primaryLocalitiesLeft.push_back(processInfo->locality); @@ -7154,17 +7363,20 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; if (processInfo->locality.dcId() == primaryDcId) { primaryProcessesLeft.add(processInfo->locality); primaryLocalitiesLeft.push_back(processInfo->locality); - } else if (processInfo->locality.dcId() == remoteDcId) { + } + if (processInfo->locality.dcId() == remoteDcId) { remoteProcessesLeft.add(processInfo->locality); remoteLocalitiesLeft.push_back(processInfo->locality); - } else if (std::find(primarySatelliteDcIds.begin(), - primarySatelliteDcIds.end(), - processInfo->locality.dcId()) != primarySatelliteDcIds.end()) { + } + if (std::find(primarySatelliteDcIds.begin(), + primarySatelliteDcIds.end(), + processInfo->locality.dcId()) != primarySatelliteDcIds.end()) { primarySatelliteProcessesLeft.add(processInfo->locality); primarySatelliteLocalitiesLeft.push_back(processInfo->locality); - } else if (std::find(remoteSatelliteDcIds.begin(), - remoteSatelliteDcIds.end(), - processInfo->locality.dcId()) != remoteSatelliteDcIds.end()) { + } + if (std::find(remoteSatelliteDcIds.begin(), + remoteSatelliteDcIds.end(), + processInfo->locality.dcId()) != remoteSatelliteDcIds.end()) { remoteSatelliteProcessesLeft.add(processInfo->locality); remoteSatelliteLocalitiesLeft.push_back(processInfo->locality); } @@ -7173,17 +7385,20 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; if (processInfo->locality.dcId() == primaryDcId) { primaryProcessesDead.add(processInfo->locality); primaryLocalitiesDead.push_back(processInfo->locality); - } else if (processInfo->locality.dcId() == remoteDcId) { + } + if (processInfo->locality.dcId() == remoteDcId) { remoteProcessesDead.add(processInfo->locality); remoteLocalitiesDead.push_back(processInfo->locality); - } else if (std::find(primarySatelliteDcIds.begin(), - primarySatelliteDcIds.end(), - processInfo->locality.dcId()) != primarySatelliteDcIds.end()) { + } + if (std::find(primarySatelliteDcIds.begin(), + primarySatelliteDcIds.end(), + processInfo->locality.dcId()) != primarySatelliteDcIds.end()) { primarySatelliteProcessesDead.add(processInfo->locality); primarySatelliteLocalitiesDead.push_back(processInfo->locality); - } else if (std::find(remoteSatelliteDcIds.begin(), - remoteSatelliteDcIds.end(), - processInfo->locality.dcId()) != remoteSatelliteDcIds.end()) { + } + if (std::find(remoteSatelliteDcIds.begin(), + remoteSatelliteDcIds.end(), + processInfo->locality.dcId()) != remoteSatelliteDcIds.end()) { remoteSatelliteProcessesDead.add(processInfo->locality); remoteSatelliteLocalitiesDead.push_back(processInfo->locality); } @@ -7290,8 +7505,8 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; } // Reboot if dead machines do fulfill policies - if (tooManyDead) { - newKt = Reboot; + if (tooManyDead || (usableRegions > 1 && notEnoughLeft)) { + newKt = KillType::Reboot; canSurvive = false; TraceEvent("KillChanged") .detail("KillType", kt) @@ -7300,16 +7515,16 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; .detail("Reason", "Too many dead processes that cannot satisfy tLogPolicy."); } // Reboot and Delete if remaining machines do NOT fulfill policies - else if ((kt < RebootAndDelete) && notEnoughLeft) { - newKt = RebootAndDelete; + else if ((kt < KillType::RebootAndDelete) && notEnoughLeft) { + newKt = KillType::RebootAndDelete; canSurvive = false; TraceEvent("KillChanged") .detail("KillType", kt) .detail("NewKillType", newKt) .detail("TLogPolicy", tLogPolicy->info()) .detail("Reason", "Not enough tLog left to satisfy tLogPolicy."); - } else if ((kt < RebootAndDelete) && (nQuorum > uniqueMachines.size())) { - newKt = RebootAndDelete; + } else if ((kt < KillType::RebootAndDelete) && (nQuorum > uniqueMachines.size())) { + newKt = KillType::RebootAndDelete; canSurvive = false; TraceEvent("KillChanged") .detail("KillType", kt) @@ -7345,15 +7560,26 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; std::swap(*it, processes.back()); } processes.pop_back(); - killProcess_internal(p, KillInstantly); + killProcess_internal(p, KillType::KillInstantly); } void killProcess_internal(ProcessInfo* machine, KillType kt) { - TEST(true); // Simulated machine was killed with any kill type - TEST(kt == KillInstantly); // Simulated machine was killed instantly - TEST(kt == InjectFaults); // Simulated machine was killed with faults - TEST(kt == FailDisk); // Simulated machine was killed with a failed disk - - if (kt == KillInstantly) { + CODE_PROBE( + true, "Simulated machine was killed with any kill type", probe::context::sim2, probe::assert::simOnly); + CODE_PROBE(kt == KillType::KillInstantly, + "Simulated machine was killed instantly", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE(kt == KillType::InjectFaults, + "Simulated machine was killed with faults", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE(kt == KillType::FailDisk, + "Simulated machine was killed with a failed disk", + probe::context::sim2, + probe::assert::simOnly, + probe::decoration::rare); + + if (kt == KillType::KillInstantly) { TraceEvent(SevWarn, "FailMachine") .detail("Name", machine->name) .detail("Address", machine->address) @@ -7363,10 +7589,10 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; .detail("Protected", protectedAddresses.count(machine->address)) .backtrace(); // This will remove all the "tracked" messages that came from the machine being killed - if (std::string(machine->name) != "remote flow process") + if (!machine->isSpawnedKVProcess()) latestEventCache.clear(); machine->failed = true; - } else if (kt == InjectFaults) { + } else if (kt == KillType::InjectFaults) { TraceEvent(SevWarn, "FaultMachine") .detail("Name", machine->name) .detail("Address", machine->address) @@ -7379,8 +7605,8 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; machine->fault_injection_r = deterministicRandom()->randomUniqueID().first(); machine->fault_injection_p1 = 0.1; machine->fault_injection_p2 = deterministicRandom()->random01(); - } else if (kt == FailDisk) { - TraceEvent(SevWarn, "FailDiskMachine") + } else if (kt == KillType::FailDisk) { + TraceEvent(SevWarn, "KillType::FailDiskMachine") .detail("Name", machine->name) .detail("Address", machine->address) .detail("ZoneId", machine->locality.zoneId()) @@ -7392,17 +7618,16 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; } else { ASSERT(false); } - ASSERT(!protectedAddresses.count(machine->address) || machine->rebooting || - std::string(machine->name) == "remote flow process"); + ASSERT(!protectedAddresses.count(machine->address) || machine->rebooting || machine->isSpawnedKVProcess()); } void rebootProcess(ProcessInfo* process, KillType kt) override { - if (kt == RebootProcessAndDelete && protectedAddresses.count(process->address)) { + if (kt == KillType::RebootProcessAndDelete && protectedAddresses.count(process->address)) { TraceEvent("RebootChanged") .detail("ZoneId", process->locality.describeZone()) - .detail("KillType", RebootProcess) + .detail("KillType", KillType::RebootProcess) .detail("OrigKillType", kt) .detail("Reason", "Protected process"); - kt = RebootProcess; + kt = KillType::RebootProcess; } doReboot(process, kt); } @@ -7411,7 +7636,7 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; auto processes = getAllProcesses(); for (int i = 0; i < processes.size(); i++) if (processes[i]->locality.zoneId() == zoneId && !processes[i]->rebooting) - doReboot(processes[i], RebootProcess); + doReboot(processes[i], KillType::RebootProcess); } else { auto processes = getAllProcesses(); for (int i = 0; i < processes.size(); i++) { @@ -7420,20 +7645,25 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; } } if (processes.size()) - doReboot(deterministicRandom()->randomChoice(processes), RebootProcess); + doReboot(deterministicRandom()->randomChoice(processes), KillType::RebootProcess); } } void killProcess(ProcessInfo* machine, KillType kt) override { TraceEvent("AttemptingKillProcess").detail("ProcessInfo", machine->toString()); - if (kt < RebootAndDelete) { + // Refuse to kill a protected process. + if (kt < KillType::RebootAndDelete && protectedAddresses.count(machine->address) == 0) { killProcess_internal(machine, kt); } } void killInterface(NetworkAddress address, KillType kt) override { - if (kt < RebootAndDelete) { + if (kt < KillType::RebootAndDelete) { std::vector& processes = machines[addressMap[address]->locality.machineId()].processes; - for (int i = 0; i < processes.size(); i++) - killProcess_internal(processes[i], kt); + for (auto& process : processes) { + // Refuse to kill a protected process. + if (protectedAddresses.count(process->address) == 0) { + killProcess_internal(process, kt); + } + } } } bool killZone(Optional> zoneId, KillType kt, bool forceKill, KillType* ktFinal) override { @@ -7452,15 +7682,47 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; } return result; } + bool killDataHall(Optional> dataHallId, + KillType kt, + bool forceKill, + KillType* ktFinal) override { + auto processes = getAllProcesses(); + std::set>> dataHallMachines; + for (auto& process : processes) { + if (process->locality.dataHallId() == dataHallId) { + dataHallMachines.insert(process->locality.machineId()); + } + } + bool result = false; + for (auto& machineId : dataHallMachines) { + if (killMachine(machineId, kt, forceKill, ktFinal)) { + result = true; + } + } + return result; + } + bool killAll(KillType kt, bool forceKill, KillType* ktFinal) override { + bool result = false; + for (auto& machine : machines) { + if (killMachine(machine.second.machineId, kt, forceKill, ktFinal)) { + result = true; + } + } + return result; + } bool killMachine(Optional> machineId, KillType kt, bool forceKill, KillType* ktFinal) override { auto ktOrig = kt; - TEST(true); // Trying to killing a machine - TEST(kt == KillInstantly); // Trying to kill instantly - TEST(kt == InjectFaults); // Trying to kill by injecting faults + CODE_PROBE(true, "Trying to killing a machine", probe::context::sim2, probe::assert::simOnly); + CODE_PROBE( + kt == KillType::KillInstantly, "Trying to kill instantly", probe::context::sim2, probe::assert::simOnly); + CODE_PROBE(kt == KillType::InjectFaults, + "Trying to kill by injecting faults", + probe::context::sim2, + probe::assert::simOnly); if (speedUpSimulation && !forceKill) { TraceEvent(SevWarn, "AbortedKill") @@ -7468,19 +7730,25 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; .detail("Reason", "Unforced kill within speedy simulation.") .backtrace(); if (ktFinal) - *ktFinal = None; + *ktFinal = KillType::None; return false; } int processesOnMachine = 0; + bool isMainCluster = true; // false for machines running DR processes KillType originalKt = kt; // Reboot if any of the processes are protected and count the number of processes not rebooting for (auto& process : machines[machineId].processes) { - if (protectedAddresses.count(process->address)) - kt = Reboot; + if (protectedAddresses.count(process->address) && kt != KillType::RebootProcessAndSwitch) { + kt = KillType::Reboot; + } + if (!process->rebooting) processesOnMachine++; + if (process->drProcess) { + isMainCluster = false; + } } // Do nothing, if no processes to kill @@ -7492,13 +7760,22 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; .detail("ProcessesPerMachine", processesPerMachine) .backtrace(); if (ktFinal) - *ktFinal = None; + *ktFinal = KillType::None; return false; } // Check if machine can be removed, if requested - if (!forceKill && ((kt == KillInstantly) || (kt == InjectFaults) || (kt == FailDisk) || - (kt == RebootAndDelete) || (kt == RebootProcessAndDelete))) { + if (!forceKill && + ((kt == KillType::KillInstantly) || (kt == KillType::InjectFaults) || (kt == KillType::FailDisk) || + (kt == KillType::RebootAndDelete) || (kt == KillType::RebootProcessAndDelete))) { + + if (!canKillMachineWithBlobWorkers(machineId, kt, &kt)) { + TraceEvent("CanKillMachineWithBlobWorkers") + .detail("MachineId", machineId) + .detail("KillType", kt) + .detail("OrigKillType", ktOrig); + } + std::vector processesLeft, processesDead; int protectedWorker = 0, unavailable = 0, excluded = 0, cleared = 0; @@ -7539,7 +7816,8 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; .detail("ProtectedTotal", protectedAddresses.size()) .detail("TLogPolicy", tLogPolicy->info()) .detail("StoragePolicy", storagePolicy->info()); - } else if ((kt == KillInstantly) || (kt == InjectFaults) || (kt == FailDisk)) { + } else if ((kt == KillType::KillInstantly) || (kt == KillType::InjectFaults) || + (kt == KillType::FailDisk)) { TraceEvent("DeadMachine") .detail("MachineId", machineId) .detail("KillType", kt) @@ -7594,26 +7872,22 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; } } - TEST(originalKt != kt); // Kill type was changed from requested to reboot. - - // Check if any processes on machine are rebooting - if (processesOnMachine != processesPerMachine && kt >= RebootAndDelete) { - TEST(true); // Attempted reboot, but the target did not have all of its processes running - TraceEvent(SevWarn, "AbortedKill") - .detail("KillType", kt) - .detail("MachineId", machineId) - .detail("Reason", "Machine processes does not match number of processes per machine") - .detail("Processes", processesOnMachine) - .detail("ProcessesPerMachine", processesPerMachine) - .backtrace(); - if (ktFinal) - *ktFinal = None; - return false; - } - - // Check if any processes on machine are rebooting - if (processesOnMachine != processesPerMachine) { - TEST(true); // Attempted reboot and kill, but the target did not have all of its processes running + CODE_PROBE(originalKt != kt, + "Kill type was changed from requested to reboot.", + probe::context::sim2, + probe::assert::simOnly); + + if (isMainCluster && originalKt == KillType::RebootProcessAndSwitch) { + // When killing processes with the RebootProcessAndSwitch kill + // type, processes in the original cluster should be rebooted in + // order to kill any zombie processes. + kt = KillType::Reboot; + } else if (processesOnMachine != processesPerMachine && kt != KillType::RebootProcessAndSwitch) { + // Check if any processes on machine are rebooting + CODE_PROBE(true, + "Attempted reboot, but the target did not have all of its processes running", + probe::context::sim2, + probe::assert::simOnly); TraceEvent(SevWarn, "AbortedKill") .detail("KillType", kt) .detail("MachineId", machineId) @@ -7622,7 +7896,7 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; .detail("ProcessesPerMachine", processesPerMachine) .backtrace(); if (ktFinal) - *ktFinal = None; + *ktFinal = KillType::None; return false; } @@ -7633,8 +7907,9 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; .detail("KillableMachines", processesOnMachine) .detail("ProcessPerMachine", processesPerMachine) .detail("KillChanged", kt != ktOrig); - if (kt < RebootAndDelete) { - if ((kt == InjectFaults || kt == FailDisk) && machines[machineId].machineProcess != nullptr) + if (kt < KillType::RebootAndDelete) { + if ((kt == KillType::InjectFaults || kt == KillType::FailDisk) && + machines[machineId].machineProcess != nullptr) killProcess_internal(machines[machineId].machineProcess, kt); for (auto& process : machines[machineId].processes) { TraceEvent("KillMachineProcess") @@ -7648,7 +7923,8 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; if (process->startingClass != ProcessClass::TesterClass) killProcess_internal(process, kt); } - } else if (kt == Reboot || kt == RebootAndDelete) { + } else if (kt == KillType::Reboot || kt == KillType::RebootAndDelete || + kt == KillType::RebootProcessAndSwitch) { for (auto& process : machines[machineId].processes) { TraceEvent("KillMachineProcess") .detail("KillType", kt) @@ -7663,10 +7939,17 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; } } - TEST(kt == RebootAndDelete); // Resulted in a reboot and delete - TEST(kt == Reboot); // Resulted in a reboot - TEST(kt == KillInstantly); // Resulted in an instant kill - TEST(kt == InjectFaults); // Resulted in a kill by injecting faults + CODE_PROBE(kt == KillType::RebootAndDelete, + "Resulted in a reboot and delete", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE(kt == KillType::Reboot, "Resulted in a reboot", probe::context::sim2, probe::assert::simOnly); + CODE_PROBE( + kt == KillType::KillInstantly, "Resulted in an instant kill", probe::context::sim2, probe::assert::simOnly); + CODE_PROBE(kt == KillType::InjectFaults, + "Resulted in a kill by injecting faults", + probe::context::sim2, + probe::assert::simOnly); if (ktFinal) *ktFinal = kt; @@ -7685,8 +7968,8 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; auto processMachineId = procRecord->locality.machineId(); ASSERT(processMachineId.present()); if (processDcId.present() && (processDcId == dcId)) { - if ((kt != Reboot) && (protectedAddresses.count(procRecord->address))) { - kt = Reboot; + if ((kt != KillType::Reboot) && (protectedAddresses.count(procRecord->address))) { + kt = KillType::Reboot; TraceEvent(SevWarn, "DcKillChanged") .detail("DataCenter", dcId) .detail("KillType", kt) @@ -7705,8 +7988,9 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; } // Check if machine can be removed, if requested - if (!forceKill && ((kt == KillInstantly) || (kt == InjectFaults) || (kt == FailDisk) || - (kt == RebootAndDelete) || (kt == RebootProcessAndDelete))) { + if (!forceKill && + ((kt == KillType::KillInstantly) || (kt == KillType::InjectFaults) || (kt == KillType::FailDisk) || + (kt == KillType::RebootAndDelete) || (kt == KillType::RebootProcessAndDelete))) { std::vector processesLeft, processesDead; for (auto processInfo : getAllProcesses()) { if (processInfo->isAvailableClass()) { @@ -7765,7 +8049,7 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; .detail("KillType", kt) .detail("KillTypeResult", ktResult) .detail("KillTypeOrig", ktOrig); - ASSERT(ktResult == None); + ASSERT(ktResult == KillType::None); } ktMin = std::min(ktResult, ktMin); } @@ -7780,13 +8064,35 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; .detail("KillTypeMin", ktMin) .detail("KilledDC", kt == ktMin); - TEST(kt != ktMin); // DataCenter kill was rejected by killMachine - TEST((kt == ktMin) && (kt == RebootAndDelete)); // Datacenter kill Resulted in a reboot and delete - TEST((kt == ktMin) && (kt == Reboot)); // Datacenter kill Resulted in a reboot - TEST((kt == ktMin) && (kt == KillInstantly)); // Datacenter kill Resulted in an instant kill - TEST((kt == ktMin) && (kt == InjectFaults)); // Datacenter kill Resulted in a kill by injecting faults - TEST((kt == ktMin) && (kt != ktOrig)); // Datacenter Kill request was downgraded - TEST((kt == ktMin) && (kt == ktOrig)); // Datacenter kill - Requested kill was done + CODE_PROBE(kt != ktMin, + "DataCenter kill was rejected by killMachine", + probe::context::sim2, + probe::assert::simOnly, + probe::decoration::rare); + CODE_PROBE((kt == ktMin) && (kt == KillType::RebootAndDelete), + "Datacenter kill Resulted in a reboot and delete", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE((kt == ktMin) && (kt == KillType::Reboot), + "Datacenter kill Resulted in a reboot", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE((kt == ktMin) && (kt == KillType::KillInstantly), + "Datacenter kill Resulted in an instant kill", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE((kt == ktMin) && (kt == KillType::InjectFaults), + "Datacenter kill Resulted in a kill by injecting faults", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE((kt == ktMin) && (kt != ktOrig), + "Datacenter Kill request was downgraded", + probe::context::sim2, + probe::assert::simOnly); + CODE_PROBE((kt == ktMin) && (kt == ktOrig), + "Datacenter kill - Requested kill was done", + probe::context::sim2, + probe::assert::simOnly); if (ktFinal) *ktFinal = ktMin; @@ -7836,6 +8142,18 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; g_clogging.reconnectPair(from, to); } + void processInjectBlobFault(ProcessInfo* machine, double failureRate) override { + CODE_PROBE(true, "Simulated process beginning blob fault", probe::context::sim2, probe::assert::simOnly); + should_inject_blob_fault = simulator_should_inject_blob_fault; + ASSERT(machine->blob_inject_failure_rate == 0.0); + machine->blob_inject_failure_rate = failureRate; + } + + void processStopInjectBlobFault(ProcessInfo* machine) override { + CODE_PROBE(true, "Simulated process stopping blob fault", probe::context::sim2, probe::assert::simOnly); + machine->blob_inject_failure_rate = 0.0; + } + std::vector getAllProcesses() const override { std::vector processes; for (auto& c : machines) { @@ -7867,98 +8185,494 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; ASSERT(process->failed); } if (machine.machineProcess) { - killProcess_internal(machine.machineProcess, KillInstantly); + killProcess_internal(machine.machineProcess, KillType::KillInstantly); } machines.erase(machineId); } - Sim2(bool printSimTime) - : time(0.0), timerTime(0.0), currentTaskID(TaskPriority::Zero), taskCount(0), yielded(false), yield_limit(0), - printSimTime(printSimTime) { - // Not letting currentProcess be nullptr eliminates some annoying special cases - currentProcess = - new ProcessInfo("NoMachine", - LocalityData(Optional>(), StringRef(), StringRef(), StringRef()), - ProcessClass(), - { NetworkAddress() }, - this, - "", - ""); - g_network = net2 = newNet2(TLSConfig(), false, true); - g_network->addStopCallback(Net2FileSystem::stop); - Net2FileSystem::newFileSystem(); - check_yield(TaskPriority::Zero); + // Assumes the simulator is already onProcess for proc + void startRequestHandlerOnProcess(ProcessInfo* process, + Reference serverContext, + Reference handlerContext) { + try { + NetworkAddress addr = serverContext->newAddress(); + process->listenerMap[addr] = Reference(new Sim2Listener(process, addr)); + addressMap[addr] = process; + handlerContext->addAddress(addr); + serverContext->registerNewServer(addr, handlerContext->requestHandler->clone()); + } catch (Error& e) { + // this should never happen, but would cause weird behavior if it did like unintentionally switching + // processes, so just fail + TraceEvent(SevError, "UnexpectedErrorRegisteringHTTPServer").errorUnsuppressed(e); + ASSERT(false); + } } - // Implementation - struct Task { - TaskPriority taskID; - double time; - uint64_t stable; - ProcessInfo* machine; - Promise action; - Task(double time, TaskPriority taskID, uint64_t stable, ProcessInfo* machine, Promise&& action) - : taskID(taskID), time(time), stable(stable), machine(machine), action(std::move(action)) {} - Task(double time, TaskPriority taskID, uint64_t stable, ProcessInfo* machine, Future& future) - : taskID(taskID), time(time), stable(stable), machine(machine) { - future = action.getFuture(); - } - Task(Task&& rhs) noexcept - : taskID(rhs.taskID), time(rhs.time), stable(rhs.stable), machine(rhs.machine), - action(std::move(rhs.action)) {} - void operator=(Task const& rhs) { - taskID = rhs.taskID; - time = rhs.time; - stable = rhs.stable; - machine = rhs.machine; - action = rhs.action; - } - Task(Task const& rhs) - : taskID(rhs.taskID), time(rhs.time), stable(rhs.stable), machine(rhs.machine), action(rhs.action) {} - void operator=(Task&& rhs) noexcept { - time = rhs.time; - taskID = rhs.taskID; - stable = rhs.stable; - machine = rhs.machine; - action = std::move(rhs.action); - } - - bool operator<(Task const& rhs) const { - // Ordering is reversed for priority_queue - if (time != rhs.time) - return time > rhs.time; - return stable > rhs.stable; + // add a simulated http server process. New http servers called by registerHTTPServer will run on this process + void addSimHTTPProcess(Reference context) override { + ProcessInfo* p = getCurrentProcess(); + + if (!g_simulator->httpProtected) { + // always protect one http server process so that if others are killed permanently, one will always be + // rebooted + fmt::print("SimHTTPServer protecting {0}\n", p->address.toString()); + TraceEvent(SevDebug, "HTTPProcessProtected").detail("Address", p->address); + g_simulator->httpProtected = true; + protectedAddresses.insert(p->address); } - }; + // make sure this process isn't already added + for (int i = 0; i < httpServerProcesses.size(); i++) { + ASSERT(p != httpServerProcesses[i].first); + } + httpServerProcesses.push_back({ p, context }); + httpServerIps.insert(p->address.ip); - void execTask(struct Task& t) { - if (t.machine->failed) { - t.action.send(Never()); - } else { - mutex.enter(); - if (printSimTime && (int)this->time < (int)t.time) { - printf("Time: %d\n", (int)t.time); - } - this->time = t.time; - this->timerTime = std::max(this->timerTime, this->time); - mutex.leave(); + for (auto& it : httpHandlers) { + startRequestHandlerOnProcess(p, context, it.second); + } + } + void removeSimHTTPProcess() override { + ProcessInfo* p = getCurrentProcess(); + + bool found = false; + for (int i = 0; i < httpServerProcesses.size(); i++) { + if (p == httpServerProcesses[i].first) { + swapAndPop(&httpServerProcesses, i); + found = true; + break; + } + } + ASSERT(found); + + // FIXME: potentially instead delay removing from DNS for a bit so we still briefly try to talk to dead server + for (auto& it : httpHandlers) { + it.second->removeIp(p->address.ip); + } + } + + #line 8254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" +// This generated class is to be used only via registerSimHTTPServerActor() + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +template + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +class RegisterSimHTTPServerActorActorState { + #line 8260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" +public: + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + RegisterSimHTTPServerActorActorState(Sim2* const& self,std::string const& hostname,std::string const& service,Reference const& requestHandler) + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + : self(self), + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + hostname(hostname), + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + service(service), + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + requestHandler(requestHandler) + #line 8273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + { + fdb_probe_actor_create("registerSimHTTPServerActor", reinterpret_cast(this)); + + } + ~RegisterSimHTTPServerActorActorState() + { + fdb_probe_actor_destroy("registerSimHTTPServerActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 2540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + std::string id = hostname + ":" + service; + #line 2541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(!self->httpHandlers.count(id)); + #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + handlerContext = makeReference(hostname, service, requestHandler); + #line 2545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + self->httpHandlers.insert({ id, handlerContext }); + #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + callingProcess = self->getCurrentProcess(); + #line 2549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + i = 0; + #line 2551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + procsCopy = self->httpServerProcesses; + #line 2553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ; + #line 8302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~RegisterSimHTTPServerActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_1 = self->onProcess(callingProcess, TaskPriority::DefaultYield); + #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 8327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 8332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 2553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if (!(i < procsCopy.size())) + #line 8348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break + } + #line 2554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + serverProcess = procsCopy[i].first; + #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + StrictFuture __when_expr_0 = self->onProcess(serverProcess, TaskPriority::DefaultYield); + #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 8358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 8363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1break1(int loopDepth) + { + try { + return a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1loopBody1cont1(Void const& _,int loopDepth) + { + #line 2556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + self->startRequestHandlerOnProcess(serverProcess, procsCopy[i].second, handlerContext); + #line 2553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + i++; + #line 8387 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1(Void && _,int loopDepth) + { + #line 2556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + self->startRequestHandlerOnProcess(serverProcess, procsCopy[i].second, handlerContext); + #line 2553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + i++; + #line 8398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RegisterSimHTTPServerActorActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RegisterSimHTTPServerActorActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("registerSimHTTPServerActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("registerSimHTTPServerActor", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< RegisterSimHTTPServerActorActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("registerSimHTTPServerActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("registerSimHTTPServerActor", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< RegisterSimHTTPServerActorActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("registerSimHTTPServerActor", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("registerSimHTTPServerActor", reinterpret_cast(this), 0); + + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 2561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RegisterSimHTTPServerActorActorState(); static_cast(this)->destroy(); return 0; } + #line 8470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RegisterSimHTTPServerActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 2561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RegisterSimHTTPServerActorActorState(); static_cast(this)->destroy(); return 0; } + #line 8482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RegisterSimHTTPServerActorActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RegisterSimHTTPServerActorActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RegisterSimHTTPServerActorActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("registerSimHTTPServerActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("registerSimHTTPServerActor", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< RegisterSimHTTPServerActorActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("registerSimHTTPServerActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("registerSimHTTPServerActor", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< RegisterSimHTTPServerActorActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("registerSimHTTPServerActor", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("registerSimHTTPServerActor", reinterpret_cast(this), 1); + + } + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + Sim2* self; + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + std::string hostname; + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + std::string service; + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + Reference requestHandler; + #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + Reference handlerContext; + #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ProcessInfo* callingProcess; + #line 2549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + int i; + #line 2551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + std::vector>> procsCopy; + #line 2554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ProcessInfo* serverProcess; + #line 8571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" +}; +// This generated class is to be used only via registerSimHTTPServerActor() + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +class RegisterSimHTTPServerActorActor final : public Actor, public ActorCallback< RegisterSimHTTPServerActorActor, 0, Void >, public ActorCallback< RegisterSimHTTPServerActorActor, 1, Void >, public FastAllocated, public RegisterSimHTTPServerActorActorState { + #line 8576 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< RegisterSimHTTPServerActorActor, 0, Void >; +friend struct ActorCallback< RegisterSimHTTPServerActorActor, 1, Void >; + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + RegisterSimHTTPServerActorActor(Sim2* const& self,std::string const& hostname,std::string const& service,Reference const& requestHandler) + #line 8588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + : Actor(), + RegisterSimHTTPServerActorActorState(self, hostname, service, requestHandler) + { + fdb_probe_actor_enter("registerSimHTTPServerActor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("registerSimHTTPServerActor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("registerSimHTTPServerActor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< RegisterSimHTTPServerActorActor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< RegisterSimHTTPServerActorActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +[[nodiscard]] static Future registerSimHTTPServerActor( Sim2* const& self, std::string const& hostname, std::string const& service, Reference const& requestHandler ) { + #line 2533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + return Future(new RegisterSimHTTPServerActorActor(self, hostname, service, requestHandler)); + #line 8616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" +} + +#line 2563 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + + // starts a numAddresses http servers with the dns alias hostname:service with the provided server callback + Future registerSimHTTPServer(std::string hostname, + std::string service, + Reference requestHandler) override { + return registerSimHTTPServerActor(this, hostname, service, requestHandler); + } + + Sim2(bool printSimTime) + : time(0.0), timerTime(0.0), currentTaskID(TaskPriority::Zero), yielded(false), yield_limit(0), + printSimTime(printSimTime) { + // Not letting currentProcess be nullptr eliminates some annoying special cases + currentProcess = + new ProcessInfo("NoMachine", + LocalityData(Optional>(), StringRef(), StringRef(), StringRef()), + ProcessClass(), + { NetworkAddress() }, + this, + "", + ""); + // create a key pair for AuthZ testing + auto key = mkcert::makeEcP256(); + authKeys.insert(std::make_pair(Standalone("DefaultKey"_sr), key)); + g_network = net2 = newNet2(TLSConfig(), false, true); + g_network->addStopCallback(Net2FileSystem::stop); + Net2FileSystem::newFileSystem(); + check_yield(TaskPriority::Zero); + } + + // Implementation + struct PromiseTask final : public FastAllocated { + Promise promise; + ProcessInfo* machine; + explicit PromiseTask(ProcessInfo* machine) : machine(machine) {} + PromiseTask(ProcessInfo* machine, Promise&& promise) : machine(machine), promise(std::move(promise)) {} + }; + + void execTask(struct PromiseTask& t) { + if (t.machine->failed) { + t.promise.send(Never()); + } else { this->currentProcess = t.machine; try { - t.action.send(Void()); + t.promise.send(Void()); ASSERT(this->currentProcess == t.machine); } catch (Error& e) { TraceEvent(SevError, "UnhandledSimulationEventError").errorUnsuppressed(e); - killProcess(t.machine, KillInstantly); + killProcess(t.machine, KillType::KillInstantly); } if (randLog) fmt::print(randLog, - "T {0} {1} {2} {3}\n", + "T {0} {1} {2}\n", this->time, int(deterministicRandom()->peek() % 10000), - t.machine ? t.machine->name : "none", - t.stable); + t.machine ? t.machine->name : "none"); } } @@ -7966,11 +8680,10 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; // This is presumably coming from either a "fake" thread pool thread, i.e. it is actually on this thread // or a thread created with g_network->startThread ASSERT(getCurrentProcess()); - - mutex.enter(); ASSERT(taskID >= TaskPriority::Min && taskID <= TaskPriority::Max); - tasks.push(Task(time, taskID, taskCount++, getCurrentProcess(), std::move(signal))); - mutex.leave(); + + PromiseTask* p = new PromiseTask(getCurrentProcess(), std::move(signal)); + taskQueue.addReadyThreadSafe(isOnMainThread(), taskID, p); } bool isOnMainThread() const override { return net2->isOnMainThread(); } Future onProcess(ISimulator::ProcessInfo* process, TaskPriority taskID) override { @@ -7984,21 +8697,15 @@ friend struct ActorCallback< DeleteFileImplActor, 4, Void >; ProtocolVersion protocolVersion() const override { return getCurrentProcess()->protocolVersion; } - // time is guarded by ISimulator::mutex. It is not necessary to guard reads on the main thread because - // time should only be modified from the main thread. double time; double timerTime; TaskPriority currentTaskID; - // taskCount is guarded by ISimulator::mutex - uint64_t taskCount; - std::map>, MachineInfo> machines; std::map addressMap; std::map> filesDeadMap; - // tasks is guarded by ISimulator::mutex - std::priority_queue> tasks; + TaskQueue taskQueue; std::vector> stopCallbacks; @@ -8033,29 +8740,29 @@ class UDPSimSocket : public IUDPSocket, ReferenceCounted { std::deque> recvBuffer; AsyncVar writtenPackets; NetworkAddress _localAddress; - bool randomDropPacket() { - auto res = deterministicRandom()->random01() < .000001; - TEST(res); // UDP packet drop + static bool randomDropPacket() { + auto res = deterministicRandom()->random01() < .000005; + CODE_PROBE(res, "UDP packet drop", probe::context::sim2, probe::assert::simOnly); return res; } bool isClosed() const { return closed.getFuture().isReady(); } Future onClosed() const { return closed.getFuture(); } - #line 8045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via cleanupPeerSocket() - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class CleanupPeerSocketActorState { - #line 8051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" CleanupPeerSocketActorState(UDPSimSocket* const& self) - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self) - #line 8058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("cleanupPeerSocket", reinterpret_cast(this)); @@ -8068,16 +8775,16 @@ class CleanupPeerSocketActorState { int a_body1(int loopDepth=0) { try { - #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = self->peerSocket.get()->onClosed(); - #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8098,11 +8805,11 @@ class CleanupPeerSocketActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 2334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->peerSocket.reset(); - #line 2335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CleanupPeerSocketActorState(); static_cast(this)->destroy(); return 0; } - #line 8105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CleanupPeerSocketActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8112,11 +8819,11 @@ class CleanupPeerSocketActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 2334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->peerSocket.reset(); - #line 2335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~CleanupPeerSocketActorState(); static_cast(this)->destroy(); return 0; } - #line 8119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8826 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~CleanupPeerSocketActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8187,14 +8894,14 @@ class CleanupPeerSocketActorState { fdb_probe_actor_exit("cleanupPeerSocket", reinterpret_cast(this), 0); } - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" UDPSimSocket* self; - #line 8192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via cleanupPeerSocket() - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class CleanupPeerSocketActor final : public Actor, public ActorCallback< CleanupPeerSocketActor, 0, Void >, public FastAllocated, public CleanupPeerSocketActorState { - #line 8197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8904 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8203,9 +8910,9 @@ class CleanupPeerSocketActor final : public Actor, public ActorCallback< C void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< CleanupPeerSocketActor, 0, Void >; - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" CleanupPeerSocketActor(UDPSimSocket* const& self) - #line 8208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), CleanupPeerSocketActorState(self) { @@ -8228,37 +8935,37 @@ friend struct ActorCallback< CleanupPeerSocketActor, 0, Void >; } }; - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future cleanupPeerSocket( UDPSimSocket* const& self ) { - #line 2332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new CleanupPeerSocketActor(self)); - #line 8235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 2337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 8240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via send() - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class SendActorState { - #line 8246 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" SendActorState(UDPSimSocket* const& self,Reference const& peerSocket,uint8_t const* const& begin,uint8_t const* const& end) - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self), - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" peerSocket(peerSocket), - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" begin(begin), - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" end(end), - #line 2342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" packet(std::make_shared>()) - #line 8261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("send", reinterpret_cast(this)); @@ -8271,20 +8978,20 @@ class SendActorState { int a_body1(int loopDepth=0) { try { - #line 2343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" packet->resize(end - begin); - #line 2344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" std::copy(begin, end, packet->begin()); - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = delay(.002 * deterministicRandom()->random01()); - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 8994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8305,13 +9012,13 @@ class SendActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 2346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" peerSocket->recvBuffer.emplace_back(self->_localAddress, std::move(packet)); - #line 2347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" peerSocket->writtenPackets.set(peerSocket->writtenPackets.get() + 1); - #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SendActorState(); static_cast(this)->destroy(); return 0; } - #line 8314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SendActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8321,13 +9028,13 @@ class SendActorState { } int a_body1cont1(Void && _,int loopDepth) { - #line 2346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" peerSocket->recvBuffer.emplace_back(self->_localAddress, std::move(packet)); - #line 2347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" peerSocket->writtenPackets.set(peerSocket->writtenPackets.get() + 1); - #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~SendActorState(); static_cast(this)->destroy(); return 0; } - #line 8330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~SendActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8398,22 +9105,22 @@ class SendActorState { fdb_probe_actor_exit("send", reinterpret_cast(this), 0); } - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" UDPSimSocket* self; - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Reference peerSocket; - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" uint8_t const* begin; - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" uint8_t const* end; - #line 2342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Packet packet; - #line 8411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via send() - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class SendActor final : public Actor, public ActorCallback< SendActor, 0, Void >, public FastAllocated, public SendActorState { - #line 8416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8422,9 +9129,9 @@ class SendActor final : public Actor, public ActorCallback< SendActor, 0, void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< SendActor, 0, Void >; - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" SendActor(UDPSimSocket* const& self,Reference const& peerSocket,uint8_t const* const& begin,uint8_t const* const& end) - #line 8427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), SendActorState(self, peerSocket, begin, end) { @@ -8447,37 +9154,37 @@ friend struct ActorCallback< SendActor, 0, Void >; } }; - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future send( UDPSimSocket* const& self, Reference const& peerSocket, uint8_t const* const& begin, uint8_t const* const& end ) { - #line 2338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2701 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new SendActor(self, peerSocket, begin, end)); - #line 8454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 2350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 2713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 8459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" // This generated class is to be used only via receiveFrom() - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class ReceiveFromActorState { - #line 8465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ReceiveFromActorState(UDPSimSocket* const& self,uint8_t* const& begin,uint8_t* const& end,NetworkAddress* const& sender) - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : self(self), - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" begin(begin), - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" end(end), - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" sender(sender), - #line 2352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" currentTaskID(g_sim2.getCurrentTask()) - #line 8480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("receiveFrom", reinterpret_cast(this)); @@ -8490,16 +9197,16 @@ class ReceiveFromActorState { int a_body1(int loopDepth=0) { try { - #line 2353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = self->writtenPackets.onChange(); - #line 2353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8497 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -8520,32 +9227,32 @@ class ReceiveFromActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = g_sim2.onProcess(self->process, currentTaskID); - #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = g_sim2.onProcess(self->process, currentTaskID); - #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 8543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -8615,27 +9322,27 @@ class ReceiveFromActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 2355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" auto packet = self->recvBuffer.front().second; - #line 2356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" int sz = packet->size(); - #line 2357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ASSERT(sz <= end - begin); - #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (sender) - #line 8626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" *sender = self->recvBuffer.front().first; - #line 8630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" std::copy(packet->begin(), packet->end(), begin); - #line 2362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->recvBuffer.pop_front(); - #line 2363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(sz); this->~ReceiveFromActorState(); static_cast(this)->destroy(); return 0; } - #line 8638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(sz); this->~ReceiveFromActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8645,27 +9352,27 @@ class ReceiveFromActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 2355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" auto packet = self->recvBuffer.front().second; - #line 2356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" int sz = packet->size(); - #line 2357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ASSERT(sz <= end - begin); - #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (sender) - #line 8656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 2359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" *sender = self->recvBuffer.front().first; - #line 8660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 2361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" std::copy(packet->begin(), packet->end(), begin); - #line 2362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" self->recvBuffer.pop_front(); - #line 2363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(sz); this->~ReceiveFromActorState(); static_cast(this)->destroy(); return 0; } - #line 8668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< int >::value()) int(sz); this->~ReceiveFromActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -8736,22 +9443,22 @@ class ReceiveFromActorState { fdb_probe_actor_exit("receiveFrom", reinterpret_cast(this), 1); } - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" UDPSimSocket* self; - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" uint8_t* begin; - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" uint8_t* end; - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" NetworkAddress* sender; - #line 2352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TaskPriority currentTaskID; - #line 8749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via receiveFrom() - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class ReceiveFromActor final : public Actor, public ActorCallback< ReceiveFromActor, 0, Void >, public ActorCallback< ReceiveFromActor, 1, Void >, public FastAllocated, public ReceiveFromActorState { - #line 8754 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -8761,9 +9468,9 @@ class ReceiveFromActor final : public Actor, public ActorCallback< ReceiveF #pragma clang diagnostic pop friend struct ActorCallback< ReceiveFromActor, 0, Void >; friend struct ActorCallback< ReceiveFromActor, 1, Void >; - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ReceiveFromActor(UDPSimSocket* const& self,uint8_t* const& begin,uint8_t* const& end,NetworkAddress* const& sender) - #line 8766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), ReceiveFromActorState(self, begin, end, sender) { @@ -8787,19 +9494,19 @@ friend struct ActorCallback< ReceiveFromActor, 1, Void >; } }; - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] static Future receiveFrom( UDPSimSocket* const& self, uint8_t* const& begin, uint8_t* const& end, NetworkAddress* const& sender ) { - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new ReceiveFromActor(self, begin, end, sender)); - #line 8794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 2365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 2728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" public: UDPSimSocket(NetworkAddress const& localAddress, Optional const& peerAddress) - : id(deterministicRandom()->randomUniqueID()), process(g_simulator.getCurrentProcess()), peerAddress(peerAddress), - actors(false), _localAddress(localAddress) { + : id(deterministicRandom()->randomUniqueID()), process(g_simulator->getCurrentProcess()), + peerAddress(peerAddress), actors(false), _localAddress(localAddress) { g_sim2.addressMap.emplace(_localAddress, process); ASSERT(process->boundUDPSockets.find(localAddress) == process->boundUDPSockets.end()); process->boundUDPSockets.emplace(localAddress, this); @@ -8902,7 +9609,7 @@ friend struct ActorCallback< ReceiveFromActor, 1, Void >; Future> Sim2::createUDPSocket(NetworkAddress toAddr) { NetworkAddress localAddress; - auto process = g_simulator.getCurrentProcess(); + auto process = g_simulator->getCurrentProcess(); if (process->address.ip.isV6()) { IPAddress::IPAddressStore store = process->address.ip.toV6(); uint16_t* ipParts = (uint16_t*)store.data(); @@ -8920,7 +9627,7 @@ Future> Sim2::createUDPSocket(NetworkAddress toAddr) { Future> Sim2::createUDPSocket(bool isV6) { NetworkAddress localAddress; - auto process = g_simulator.getCurrentProcess(); + auto process = g_simulator->getCurrentProcess(); if (process->address.ip.isV6() == isV6) { localAddress = process->address; } else { @@ -8942,28 +9649,28 @@ Future> Sim2::createUDPSocket(bool isV6) { void startNewSimulator(bool printSimTime) { ASSERT(!g_network); - g_network = g_pSimulator = new Sim2(printSimTime); - g_simulator.connectionFailuresDisableDuration = + g_network = g_simulator = new Sim2(printSimTime); + g_simulator->connectionFailuresDisableDuration = deterministicRandom()->coinflip() ? 0 : DISABLE_CONNECTION_FAILURE_FOREVER; } - #line 8950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" namespace { // This generated class is to be used only via doReboot() - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class DoRebootActorState { - #line 8957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" DoRebootActorState(ISimulator::ProcessInfo* const& p,ISimulator::KillType const& kt) - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : p(p), - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" kt(kt) - #line 8966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("doReboot", reinterpret_cast(this)); @@ -8976,17 +9683,17 @@ class DoRebootActorState { int a_body1(int loopDepth=0) { try { - #line 2518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent("RebootingProcessAttempt") .detail("ZoneId", p->locality.zoneId()) .detail("KillType", kt) .detail("Process", p->toString()) .detail("StartingClass", p->startingClass.toString()) .detail("Failed", p->failed) .detail("Excluded", p->excluded) .detail("Cleared", p->cleared) .detail("Rebooting", p->rebooting) .detail("TaskPriorityDefaultDelay", TaskPriority::DefaultDelay); - #line 2529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = g_sim2.delay(0, TaskPriority::DefaultDelay, p); - #line 2529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 8985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" static_cast(this)->actor_wait_state = 1; - #line 2529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 8989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9007,73 +9714,86 @@ class DoRebootActorState { int a_body1cont1(Void const& _,int loopDepth) { try { - #line 2532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(kt == ISimulator::RebootProcess || kt == ISimulator::Reboot || kt == ISimulator::RebootAndDelete || kt == ISimulator::RebootProcessAndDelete); - #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - TEST(kt == ISimulator::RebootProcess); - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - TEST(kt == ISimulator::Reboot); - #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - TEST(kt == ISimulator::RebootAndDelete); - #line 2538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - TEST( kt == ISimulator::RebootProcessAndDelete); - #line 2542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(kt == ISimulator::KillType::RebootProcess || kt == ISimulator::KillType::Reboot || kt == ISimulator::KillType::RebootAndDelete || kt == ISimulator::KillType::RebootProcessAndDelete || kt == ISimulator::KillType::RebootProcessAndSwitch); + #line 2899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + CODE_PROBE(kt == ISimulator::KillType::RebootProcess, "Simulated process rebooted", probe::assert::simOnly, probe::context::sim2); + #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + CODE_PROBE(kt == ISimulator::KillType::Reboot, "Simulated machine rebooted", probe::assert::simOnly, probe::context::sim2); + #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + CODE_PROBE(kt == ISimulator::KillType::RebootAndDelete, "Simulated machine rebooted with data and coordination state deletion", probe::assert::simOnly, probe::context::sim2); + #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + CODE_PROBE(kt == ISimulator::KillType::RebootProcessAndDelete, "Simulated process rebooted with data and coordination state deletion", probe::assert::simOnly, probe::context::sim2); + #line 2915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + CODE_PROBE(kt == ISimulator::KillType::RebootProcessAndSwitch, "Simulated process rebooted with different cluster file", probe::assert::simOnly, probe::context::sim2); + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (p->rebooting || !p->isReliable()) - #line 9022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevDebug, "DoRebootFailed") .detail("Rebooting", p->rebooting) .detail("Reliable", p->isReliable()); - #line 2546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" delete static_cast(this); - #line 9028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" return 0; } else { - #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - if (std::string(p->name) == "remote flow process") - #line 9035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if (p->isSpawnedKVProcess()) + #line 9744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevDebug, "DoRebootFailed").detail("Name", p->name).detail("Address", p->address); - #line 2549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" delete static_cast(this); - #line 9041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" return 0; } else { - #line 2550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (p->getChilds().size()) - #line 9048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 2551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevDebug, "DoRebootFailedOnParentProcess").detail("Address", p->address); - #line 2552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" delete static_cast(this); - #line 9054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" return 0; } } } - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent("RebootingProcess") .detail("KillType", kt) .detail("Address", p->address) .detail("ZoneId", p->locality.zoneId()) .detail("DataHall", p->locality.dataHallId()) .detail("Locality", p->locality.toString()) .detail("Failed", p->failed) .detail("Excluded", p->excluded) .detail("Cleared", p->cleared) .backtrace(); - #line 2565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" p->rebooting = true; - #line 2566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - if ((kt == ISimulator::RebootAndDelete) || (kt == ISimulator::RebootProcessAndDelete)) - #line 9065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if ((kt == ISimulator::KillType::RebootAndDelete) || (kt == ISimulator::KillType::RebootProcessAndDelete)) + #line 9774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" p->cleared = true; - #line 2568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - g_simulator.clearAddress(p->address); - #line 9071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->clearAddress(p->address); + #line 9780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } - #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + else + { + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if (kt == ISimulator::KillType::RebootProcessAndSwitch) + #line 9786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + { + #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->switchCluster(p->address); + #line 9790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + } + } + #line 2950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" p->shutdownSignal.send(kt); - #line 9075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" - loopDepth = a_body1cont10(loopDepth); + #line 9795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + loopDepth = a_body1cont12(loopDepth); } catch (Error& error) { loopDepth = a_body1cont1Catch1(error, loopDepth); @@ -9086,73 +9806,86 @@ class DoRebootActorState { int a_body1cont1(Void && _,int loopDepth) { try { - #line 2532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - ASSERT(kt == ISimulator::RebootProcess || kt == ISimulator::Reboot || kt == ISimulator::RebootAndDelete || kt == ISimulator::RebootProcessAndDelete); - #line 2535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - TEST(kt == ISimulator::RebootProcess); - #line 2536 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - TEST(kt == ISimulator::Reboot); - #line 2537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - TEST(kt == ISimulator::RebootAndDelete); - #line 2538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - TEST( kt == ISimulator::RebootProcessAndDelete); - #line 2542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + ASSERT(kt == ISimulator::KillType::RebootProcess || kt == ISimulator::KillType::Reboot || kt == ISimulator::KillType::RebootAndDelete || kt == ISimulator::KillType::RebootProcessAndDelete || kt == ISimulator::KillType::RebootProcessAndSwitch); + #line 2899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + CODE_PROBE(kt == ISimulator::KillType::RebootProcess, "Simulated process rebooted", probe::assert::simOnly, probe::context::sim2); + #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + CODE_PROBE(kt == ISimulator::KillType::Reboot, "Simulated machine rebooted", probe::assert::simOnly, probe::context::sim2); + #line 2907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + CODE_PROBE(kt == ISimulator::KillType::RebootAndDelete, "Simulated machine rebooted with data and coordination state deletion", probe::assert::simOnly, probe::context::sim2); + #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + CODE_PROBE(kt == ISimulator::KillType::RebootProcessAndDelete, "Simulated process rebooted with data and coordination state deletion", probe::assert::simOnly, probe::context::sim2); + #line 2915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + CODE_PROBE(kt == ISimulator::KillType::RebootProcessAndSwitch, "Simulated process rebooted with different cluster file", probe::assert::simOnly, probe::context::sim2); + #line 2920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (p->rebooting || !p->isReliable()) - #line 9101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 2543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevDebug, "DoRebootFailed") .detail("Rebooting", p->rebooting) .detail("Reliable", p->isReliable()); - #line 2546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" delete static_cast(this); - #line 9107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" return 0; } else { - #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - if (std::string(p->name) == "remote flow process") - #line 9114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if (p->isSpawnedKVProcess()) + #line 9836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevDebug, "DoRebootFailed").detail("Name", p->name).detail("Address", p->address); - #line 2549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" delete static_cast(this); - #line 9120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" return 0; } else { - #line 2550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (p->getChilds().size()) - #line 9127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 2551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevDebug, "DoRebootFailedOnParentProcess").detail("Address", p->address); - #line 2552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" delete static_cast(this); - #line 9133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" return 0; } } } - #line 2555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent("RebootingProcess") .detail("KillType", kt) .detail("Address", p->address) .detail("ZoneId", p->locality.zoneId()) .detail("DataHall", p->locality.dataHallId()) .detail("Locality", p->locality.toString()) .detail("Failed", p->failed) .detail("Excluded", p->excluded) .detail("Cleared", p->cleared) .backtrace(); - #line 2565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" p->rebooting = true; - #line 2566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - if ((kt == ISimulator::RebootAndDelete) || (kt == ISimulator::RebootProcessAndDelete)) - #line 9144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2944 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if ((kt == ISimulator::KillType::RebootAndDelete) || (kt == ISimulator::KillType::RebootProcessAndDelete)) + #line 9866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" p->cleared = true; - #line 2568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - g_simulator.clearAddress(p->address); - #line 9150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 2946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->clearAddress(p->address); + #line 9872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + } + else + { + #line 2947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + if (kt == ISimulator::KillType::RebootProcessAndSwitch) + #line 9878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + { + #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->switchCluster(p->address); + #line 9882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + } } - #line 2570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" p->shutdownSignal.send(kt); - #line 9154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" - loopDepth = a_body1cont10(loopDepth); + #line 9887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + loopDepth = a_body1cont12(loopDepth); } catch (Error& error) { loopDepth = a_body1cont1Catch1(error, loopDepth); @@ -9227,20 +9960,20 @@ class DoRebootActorState { } int a_body1cont2(int loopDepth) { - loopDepth = a_body1cont11(loopDepth); + loopDepth = a_body1cont13(loopDepth); return loopDepth; } int a_body1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" TraceEvent(SevError, "RebootError").error(e); - #line 2573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" p->shutdownSignal.sendError(e); - #line 2574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2954 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 9243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 9976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -9250,7 +9983,7 @@ class DoRebootActorState { return loopDepth; } - int a_body1cont10(int loopDepth) + int a_body1cont12(int loopDepth) { try { loopDepth = a_body1cont2(loopDepth); @@ -9263,25 +9996,25 @@ class DoRebootActorState { return loopDepth; } - int a_body1cont11(int loopDepth) + int a_body1cont13(int loopDepth) { - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" delete static_cast(this); - #line 9270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" return 0; return loopDepth; } - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ISimulator::ProcessInfo* p; - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ISimulator::KillType kt; - #line 9279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via doReboot() - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class DoRebootActor final : public Actor, public ActorCallback< DoRebootActor, 0, Void >, public FastAllocated, public DoRebootActorState { - #line 9284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9290,9 +10023,9 @@ class DoRebootActor final : public Actor, public ActorCallback< DoRebootAc void destroy() {{ ((Actor*)this)->~Actor(); operator delete(this); }} #pragma clang diagnostic pop friend struct ActorCallback< DoRebootActor, 0, Void >; - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" DoRebootActor(ISimulator::ProcessInfo* const& p,ISimulator::KillType const& kt) - #line 9295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), DoRebootActorState(p, kt) { @@ -9307,26 +10040,26 @@ friend struct ActorCallback< DoRebootActor, 0, Void >; } }; } - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" void doReboot( ISimulator::ProcessInfo* const& p, ISimulator::KillType const& kt ) { - #line 2517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 2880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" new DoRebootActor(p, kt); - #line 9314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10047 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 2577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 2957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" // Simulates delays for performing operations on disk Future waitUntilDiskReady(Reference diskParameters, int64_t size, bool sync) { - if (g_simulator.getCurrentProcess()->failedDisk) { + if (g_simulator->getCurrentProcess()->failedDisk) { return Never(); } - if (g_simulator.connectionFailuresDisableDuration > 1e4) + if (g_simulator->connectionFailuresDisableDuration > 1e4) return delay(0.0001); if (diskParameters->nextOperation < now()) diskParameters->nextOperation = now(); - diskParameters->nextOperation += (1.0 / diskParameters->iops) + (1.0 * size / diskParameters->bandwidth); + diskParameters->nextOperation += (1.0 / diskParameters->iops) + (size / diskParameters->bandwidth); double randomLatency; if (sync) { @@ -9339,16 +10072,17 @@ Future waitUntilDiskReady(Reference diskParameters, int64_ void enableConnectionFailures(std::string const& context) { if (g_network->isSimulated()) { - g_simulator.connectionFailuresDisableDuration = 0; - g_simulator.speedUpSimulation = false; + g_simulator->connectionFailuresDisableDuration = 0; + g_simulator->speedUpSimulation = false; + g_simulator->connectionFailureEnableTime = now(); TraceEvent(SevWarnAlways, ("EnableConnectionFailures_" + context).c_str()); } } void disableConnectionFailures(std::string const& context) { if (g_network->isSimulated()) { - g_simulator.connectionFailuresDisableDuration = DISABLE_CONNECTION_FAILURE_FOREVER; - g_simulator.speedUpSimulation = true; + g_simulator->connectionFailuresDisableDuration = DISABLE_CONNECTION_FAILURE_FOREVER; + g_simulator->speedUpSimulation = true; TraceEvent(SevWarnAlways, ("DisableConnectionFailures_" + context).c_str()); } } @@ -9385,24 +10119,20 @@ int sf_open(const char* filename, int flags, int convFlags, int mode) { Future> Sim2FileSystem::open(const std::string& filename, int64_t flags, int64_t mode) { ASSERT((flags & IAsyncFile::OPEN_ATOMIC_WRITE_AND_CREATE) || !(flags & IAsyncFile::OPEN_CREATE) || StringRef(filename).endsWith( - LiteralStringRef(".fdb-lock"))); // We don't use "ordinary" non-atomic file creation right now except for - // folder locking, and we don't have code to simulate its unsafeness. + ".fdb-lock"_sr)); // We don't use "ordinary" non-atomic file creation right now except for + // folder locking, and we don't have code to simulate its unsafeness. if ((flags & IAsyncFile::OPEN_EXCLUSIVE)) ASSERT(flags & IAsyncFile::OPEN_CREATE); if (flags & IAsyncFile::OPEN_UNCACHED) { - auto& machineCache = g_simulator.getCurrentProcess()->machine->openFiles; + auto& machineCache = g_simulator->getCurrentProcess()->machine->openFiles; std::string actualFilename = filename; if (flags & IAsyncFile::OPEN_ATOMIC_WRITE_AND_CREATE) { actualFilename = filename + ".part"; auto partFile = machineCache.find(actualFilename); if (partFile != machineCache.end()) { Future> f = AsyncFileDetachable::open(partFile->second.get()); - if (FLOW_KNOBS->PAGE_WRITE_CHECKSUM_HISTORY > 0) - f = map(f, [=](Reference r) { - return Reference(new AsyncFileWriteChecker(r)); - }); return f; } } @@ -9414,11 +10144,15 @@ Future> Sim2FileSystem::open(const std::string& file // This way, they can both keep up with the time to start the next operation auto diskParameters = makeReference(FLOW_KNOBS->SIM_DISK_IOPS, FLOW_KNOBS->SIM_DISK_BANDWIDTH); - f = AsyncFileNonDurable::open(filename, - actualFilename, - SimpleFile::open(filename, flags, mode, diskParameters, false), - diskParameters, - (flags & IAsyncFile::OPEN_NO_AIO) == 0); + + f = SimpleFile::open(filename, flags, mode, diskParameters, false); + if (FLOW_KNOBS->PAGE_WRITE_CHECKSUM_HISTORY > 0) { + f = map(f, + [=](Reference r) { return Reference(new AsyncFileWriteChecker(r)); }); + } + + f = AsyncFileNonDurable::open( + filename, actualFilename, f, diskParameters, (flags & IAsyncFile::OPEN_NO_AIO) == 0); machineCache[actualFilename] = UnsafeWeakFutureReference(f); } else { @@ -9426,18 +10160,14 @@ Future> Sim2FileSystem::open(const std::string& file } f = AsyncFileDetachable::open(f); - if (FLOW_KNOBS->PAGE_WRITE_CHECKSUM_HISTORY > 0) - f = map(f, [=](Reference r) { return Reference(new AsyncFileWriteChecker(r)); }); if (FLOW_KNOBS->ENABLE_CHAOS_FEATURES) f = map(f, [=](Reference r) { return Reference(new AsyncFileChaos(r)); }); -#if ENCRYPTION_ENABLED if (flags & IAsyncFile::OPEN_ENCRYPTED) f = map(f, [flags](Reference r) { auto mode = flags & IAsyncFile::OPEN_READWRITE ? AsyncFileEncrypted::Mode::APPEND_ONLY : AsyncFileEncrypted::Mode::READ_ONLY; return Reference(new AsyncFileEncrypted(r, mode)); }); -#endif // ENCRYPTION_ENABLED return f; } else return AsyncFileCached::open(filename, flags, mode); @@ -9449,23 +10179,23 @@ Future Sim2FileSystem::deleteFile(const std::string& filename, bool mustBe return Sim2::deleteFileImpl(&g_sim2, filename, mustBeDurable); } - #line 9452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" namespace { // This generated class is to be used only via renameFileImpl() - #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" template - #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class RenameFileImplActorState { - #line 9459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: - #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" RenameFileImplActorState(std::string const& from,std::string const& to) - #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" - #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" : from(from), - #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" to(to) - #line 9468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" { fdb_probe_actor_create("renameFileImpl", reinterpret_cast(this)); @@ -9478,16 +10208,16 @@ class RenameFileImplActorState { int a_body1(int loopDepth=0) { try { - #line 2712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_0 = delay(0.5 * deterministicRandom()->random01()); - #line 2712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -9508,36 +10238,72 @@ class RenameFileImplActorState { } int a_body1cont1(Void const& _,int loopDepth) { - #line 2713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + TraceEvent("RenamingFile").detail("From", from).detail("To", to).log(); + #line 3094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + using block_value_type = typename decltype(g_simulator->corruptedBlocks)::key_type::second_type; + #line 3095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + auto maxBlockValue = std::numeric_limits::max(); + #line 3096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->corruptedBlocks.erase(g_simulator->corruptedBlocks.lower_bound(std::make_pair(to, 0u)), g_simulator->corruptedBlocks.upper_bound(std::make_pair(to, maxBlockValue))); + #line 3099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + auto begin = g_simulator->corruptedBlocks.lower_bound(std::make_pair(from, 0u)), end = g_simulator->corruptedBlocks.upper_bound(std::make_pair(from, maxBlockValue)); + #line 3101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + for(auto iter = begin;iter != end;++iter) { + #line 3102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->corruptedBlocks.emplace(to, iter->second); + #line 10255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + } + #line 3104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->corruptedBlocks.erase(begin, end); + #line 3106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ::renameFile(from, to); - #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = delay(0.5 * deterministicRandom()->random01()); - #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 2713 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + TraceEvent("RenamingFile").detail("From", from).detail("To", to).log(); + #line 3094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + using block_value_type = typename decltype(g_simulator->corruptedBlocks)::key_type::second_type; + #line 3095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + auto maxBlockValue = std::numeric_limits::max(); + #line 3096 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->corruptedBlocks.erase(g_simulator->corruptedBlocks.lower_bound(std::make_pair(to, 0u)), g_simulator->corruptedBlocks.upper_bound(std::make_pair(to, maxBlockValue))); + #line 3099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + auto begin = g_simulator->corruptedBlocks.lower_bound(std::make_pair(from, 0u)), end = g_simulator->corruptedBlocks.upper_bound(std::make_pair(from, maxBlockValue)); + #line 3101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + for(auto iter = begin;iter != end;++iter) { + #line 3102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->corruptedBlocks.emplace(to, iter->second); + #line 10291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + } + #line 3104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + g_simulator->corruptedBlocks.erase(begin, end); + #line 3106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" ::renameFile(from, to); - #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" StrictFuture __when_expr_1 = delay(0.5 * deterministicRandom()->random01()); - #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 9535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 9540 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -9607,9 +10373,9 @@ class RenameFileImplActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 2715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RenameFileImplActorState(); static_cast(this)->destroy(); return 0; } - #line 9612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~RenameFileImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9619,9 +10385,9 @@ class RenameFileImplActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 2715 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RenameFileImplActorState(); static_cast(this)->destroy(); return 0; } - #line 9624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10390 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~RenameFileImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -9692,16 +10458,16 @@ class RenameFileImplActorState { fdb_probe_actor_exit("renameFileImpl", reinterpret_cast(this), 1); } - #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" std::string from; - #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" std::string to; - #line 9699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" }; // This generated class is to be used only via renameFileImpl() - #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" class RenameFileImplActor final : public Actor, public ActorCallback< RenameFileImplActor, 0, Void >, public ActorCallback< RenameFileImplActor, 1, Void >, public FastAllocated, public RenameFileImplActorState { - #line 9704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -9711,9 +10477,9 @@ class RenameFileImplActor final : public Actor, public ActorCallback< Rena #pragma clang diagnostic pop friend struct ActorCallback< RenameFileImplActor, 0, Void >; friend struct ActorCallback< RenameFileImplActor, 1, Void >; - #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" RenameFileImplActor(std::string const& from,std::string const& to) - #line 9716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" : Actor(), RenameFileImplActorState(from, to) { @@ -9738,14 +10504,14 @@ friend struct ActorCallback< RenameFileImplActor, 1, Void >; } }; } - #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" [[nodiscard]] Future renameFileImpl( std::string const& from, std::string const& to ) { - #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" + #line 3088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" return Future(new RenameFileImplActor(from, to)); - #line 9745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" + #line 10511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.g.cpp" } -#line 2717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" +#line 3110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/sim2.actor.cpp" Future Sim2FileSystem::renameFile(std::string const& from, std::string const& to) { return renameFileImpl(from, to); diff --git a/src/fdbrpc/sim_validation.cpp b/src/fdbrpc/sim_validation.cpp index 292c525..6fff16a 100644 --- a/src/fdbrpc/sim_validation.cpp +++ b/src/fdbrpc/sim_validation.cpp @@ -18,7 +18,7 @@ * limitations under the License. */ -#include "sim_validation.h" +#include "fdbrpc/sim_validation.h" #include "fdbrpc/TraceFileIO.h" #include "flow/network.h" #include "fdbrpc/simulator.h" @@ -51,13 +51,13 @@ void debug_advanceVersion(UID id, int64_t version, const char* suffix) { } void debug_advanceMinCommittedVersion(UID id, int64_t version) { - if (!g_network->isSimulated() || g_simulator.extraDB) + if (!g_network->isSimulated() || !g_simulator->extraDatabases.empty()) return; debug_advanceVersion(id, version, "min"); } void debug_advanceMaxCommittedVersion(UID id, int64_t version) { - if (!g_network->isSimulated() || g_simulator.extraDB) + if (!g_network->isSimulated() || !g_simulator->extraDatabases.empty()) return; debug_advanceVersion(id, version, "max"); } @@ -67,7 +67,7 @@ bool debug_checkPartRestoredVersion(UID id, std::string context, std::string minormax, Severity sev = SevError) { - if (!g_network->isSimulated() || g_simulator.extraDB) + if (!g_network->isSimulated() || !g_simulator->extraDatabases.empty()) return false; if (disabledMachines.count(id)) return false; @@ -88,33 +88,33 @@ bool debug_checkPartRestoredVersion(UID id, } bool debug_checkRestoredVersion(UID id, int64_t version, std::string context, Severity sev) { - if (!g_network->isSimulated() || g_simulator.extraDB) + if (!g_network->isSimulated() || !g_simulator->extraDatabases.empty()) return false; return debug_checkPartRestoredVersion(id, version, context, "min", sev) || debug_checkPartRestoredVersion(id, version, context, "max", sev); } void debug_removeVersions(UID id) { - if (!g_network->isSimulated() || g_simulator.extraDB) + if (!g_network->isSimulated() || !g_simulator->extraDatabases.empty()) return; validationData.erase(id.toString() + "min"); validationData.erase(id.toString() + "max"); } bool debug_versionsExist(UID id) { - if (!g_network->isSimulated() || g_simulator.extraDB) + if (!g_network->isSimulated() || !g_simulator->extraDatabases.empty()) return false; return validationData.count(id.toString() + "min") != 0 || validationData.count(id.toString() + "max") != 0; } bool debug_checkMinRestoredVersion(UID id, int64_t version, std::string context, Severity sev) { - if (!g_network->isSimulated() || g_simulator.extraDB) + if (!g_network->isSimulated() || !g_simulator->extraDatabases.empty()) return false; return debug_checkPartRestoredVersion(id, version, context, "min", sev); } bool debug_checkMaxRestoredVersion(UID id, int64_t version, std::string context, Severity sev) { - if (!g_network->isSimulated() || g_simulator.extraDB) + if (!g_network->isSimulated() || !g_simulator->extraDatabases.empty()) return false; return debug_checkPartRestoredVersion(id, version, context, "max", sev); } @@ -129,13 +129,13 @@ void debug_setCheckRelocationDuration(bool check) { checkRelocationDuration = check; } void debug_advanceVersionTimestamp(int64_t version, double t) { - if (!g_network->isSimulated() || g_simulator.extraDB) + if (!g_network->isSimulated() || !g_simulator->extraDatabases.empty()) return; timedVersionsValidationData[version] = t; } bool debug_checkVersionTime(int64_t version, double t, std::string context, Severity sev) { - if (!g_network->isSimulated() || g_simulator.extraDB) + if (!g_network->isSimulated() || !g_simulator->extraDatabases.empty()) return false; if (!timedVersionsValidationData.count(version)) { TraceEvent(SevWarn, (context + "UnknownTime").c_str()) @@ -151,4 +151,4 @@ bool debug_checkVersionTime(int64_t version, double t, std::string context, Seve return true; } return false; -} \ No newline at end of file +} diff --git a/src/fdbserver/Knobs.h b/src/fdbserver/include/fdbserver/Knobs.h similarity index 100% rename from src/fdbserver/Knobs.h rename to src/fdbserver/include/fdbserver/Knobs.h diff --git a/src/flow/ActorCollection.actor.cpp b/src/flow/ActorCollection.actor.cpp index 3958fa2..39ecac5 100644 --- a/src/flow/ActorCollection.actor.cpp +++ b/src/flow/ActorCollection.actor.cpp @@ -21,17 +21,52 @@ #include "flow/ActorCollection.h" #include "flow/IndexedSet.h" #include "flow/UnitTest.h" +#include #include "flow/actorcompiler.h" // This must be the last #include. +struct Runner : public boost::intrusive::list_base_hook<>, FastAllocated, NonCopyable { + Future handler; +}; + +// An intrusive list of Runners, which are FastAllocated. Each runner holds a handler future +typedef boost::intrusive::list> RunnerList; + +// The runners list in the ActorCollection must be destroyed when the actor is destructed rather +// than before returning or throwing +struct RunnerListDestroyer : NonCopyable { + RunnerListDestroyer(RunnerList* list) : list(list) {} + + ~RunnerListDestroyer() { + list->clear_and_dispose([](Runner* r) { delete r; }); + } + + RunnerList* list; +}; + +ACTOR Future runnerHandler(PromiseStream output, + PromiseStream errors, + Future task, + RunnerList::iterator runner) { + try { + wait(task); + output.send(runner); + } catch (Error& e) { + if (e.code() == error_code_actor_cancelled) + throw; + errors.send(e); + } + return Void(); +} + ACTOR Future actorCollection(FutureStream> addActor, int* pCount, double* lastChangeTime, double* idleTime, double* allTime, bool returnWhenEmptied) { - state int64_t nextTag = 0; - state Map> tag_streamHelper; - state PromiseStream complete; + state RunnerList runners; + state RunnerListDestroyer runnersDestroyer(&runners); + state PromiseStream complete; state PromiseStream errors; state int count = 0; if (!pCount) @@ -39,8 +74,13 @@ ACTOR Future actorCollection(FutureStream> addActor, loop choose { when(Future f = waitNext(addActor)) { - int64_t t = nextTag++; - tag_streamHelper[t] = streamHelper(complete, errors, tag(f, t)); + // Insert new Runner at the end of the instrusive list and get an iterator to it + auto i = runners.insert(runners.end(), *new Runner()); + + // Start the handler for completions or errors from f, sending runner to complete stream + Future handler = runnerHandler(complete, errors, f, i); + i->handler = handler; + ++*pCount; if (*pCount == 1 && lastChangeTime && idleTime && allTime) { double currentTime = now(); @@ -49,7 +89,7 @@ ACTOR Future actorCollection(FutureStream> addActor, *lastChangeTime = currentTime; } } - when(int64_t t = waitNext(complete.getFuture())) { + when(RunnerList::iterator i = waitNext(complete.getFuture())) { if (!--*pCount) { if (lastChangeTime && idleTime && allTime) { double currentTime = now(); @@ -59,7 +99,8 @@ ACTOR Future actorCollection(FutureStream> addActor, if (returnWhenEmptied) return Void(); } - tag_streamHelper.erase(t); + // If we didn't return then the entire list wasn't destroyed so erase/destroy i + runners.erase_and_dispose(i, [](Runner* r) { delete r; }); } when(Error e = waitNext(errors.getFuture())) { throw e; @@ -83,3 +124,66 @@ struct Traceable> { return result; } }; + +void forceLinkActorCollectionTests() {} + +// The above implementation relies on the behavior that fulfilling a promise +// that another when clause in the same choose block is waiting on is not fired synchronously. +TEST_CASE("/flow/actorCollection/chooseWhen") { + state Promise promise; + choose { + when(wait(delay(0))) { + promise.send(Void()); + } + when(wait(promise.getFuture())) { + // Should be cancelled, since another when clause in this choose block has executed + ASSERT(false); + } + } + return Void(); +} + +ACTOR Future failIfNotCancelled() { + wait(delay(0)); + ASSERT(false); + return Void(); +} + +// test contract that actors are cancelled when the actor collection is cleared +TEST_CASE("/flow/actorCollection/testCancel") { + state ActorCollection actorCollection(false); + int actors = deterministicRandom()->randomInt(1, 1000); + for (int i = 0; i < actors; i++) { + actorCollection.add(failIfNotCancelled()); + } + actorCollection.clear(false); + wait(delay(0)); + return Void(); +} + +ACTOR Future failedActor() { + throw operation_failed(); +} + +// test contract that even if the actor collection has stopped and new actors are added to the promise stream, they are +// all cancelled when resetting actor +TEST_CASE("/flow/actorCollection/testCancelPromiseStream") { + state ActorCollection actorCollection(false); + int actors = deterministicRandom()->randomInt(1, 500); + for (int i = 0; i < actors; i++) { + actorCollection.add(failIfNotCancelled()); + } + // this actor should cause the actorCollection actor to exit, meaning the new futures just build up in the promise + // stream + actorCollection.add(failedActor()); + for (int i = 0; i < actors; i++) { + actorCollection.add(failIfNotCancelled()); + } + // Instead of doing actorCollection.clear(false) we reinitialize to also clear the promise stream. Otherwise on + // resetting the actor collection actor, the new actors will be pulled from the promise stream into the new instance + // Note that this test fails on the assert in failIfNotCancelled() when this is replaced with + // actorCollection.clear(false). + actorCollection = ActorCollection(false); + wait(delay(0)); + return Void(); +} diff --git a/src/flow/ActorCollection.actor.g.cpp b/src/flow/ActorCollection.actor.g.cpp index 0954a73..dc2c749 100644 --- a/src/flow/ActorCollection.actor.g.cpp +++ b/src/flow/ActorCollection.actor.g.cpp @@ -23,43 +23,318 @@ #include "flow/ActorCollection.h" #include "flow/IndexedSet.h" #include "flow/UnitTest.h" +#include #include "flow/actorcompiler.h" // This must be the last #include. - #line 28 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +struct Runner : public boost::intrusive::list_base_hook<>, FastAllocated, NonCopyable { + Future handler; +}; + +// An intrusive list of Runners, which are FastAllocated. Each runner holds a handler future +typedef boost::intrusive::list> RunnerList; + +// The runners list in the ActorCollection must be destroyed when the actor is destructed rather +// than before returning or throwing +struct RunnerListDestroyer : NonCopyable { + RunnerListDestroyer(RunnerList* list) : list(list) {} + + ~RunnerListDestroyer() { + list->clear_and_dispose([](Runner* r) { delete r; }); + } + + RunnerList* list; +}; + + #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +namespace { +// This generated class is to be used only via runnerHandler() + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +template + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +class RunnerHandlerActorState { + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +public: + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + RunnerHandlerActorState(PromiseStream const& output,PromiseStream const& errors,Future const& task,RunnerList::iterator const& runner) + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + : output(output), + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + errors(errors), + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + task(task), + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + runner(runner) + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + { + fdb_probe_actor_create("runnerHandler", reinterpret_cast(this)); + + } + ~RunnerHandlerActorState() + { + fdb_probe_actor_destroy("runnerHandler", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + try { + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + StrictFuture __when_expr_0 = task; + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch2(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch2(unknown_error(), loopDepth); + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~RunnerHandlerActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~RunnerHandlerActorState(); static_cast(this)->destroy(); return 0; } + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~RunnerHandlerActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1Catch2(const Error& e,int loopDepth=0) + { + try { + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + if (e.code() == error_code_actor_cancelled) + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + { + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + } + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + errors.send(e); + #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + output.send(runner); + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + output.send(runner); + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< RunnerHandlerActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< RunnerHandlerActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("runnerHandler", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("runnerHandler", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< RunnerHandlerActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("runnerHandler", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("runnerHandler", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< RunnerHandlerActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("runnerHandler", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch2(err, 0); + } + catch (Error& error) { + a_body1Catch2(error, 0); + } catch (...) { + a_body1Catch2(unknown_error(), 0); + } + fdb_probe_actor_exit("runnerHandler", reinterpret_cast(this), 0); + + } + int a_body1cont4(int loopDepth) + { + try { + loopDepth = a_body1cont1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + PromiseStream output; + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + PromiseStream errors; + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + Future task; + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + RunnerList::iterator runner; + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +}; +// This generated class is to be used only via runnerHandler() + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +class RunnerHandlerActor final : public Actor, public ActorCallback< RunnerHandlerActor, 0, Void >, public FastAllocated, public RunnerHandlerActorState { + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< RunnerHandlerActor, 0, Void >; + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + RunnerHandlerActor(PromiseStream const& output,PromiseStream const& errors,Future const& task,RunnerList::iterator const& runner) + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + : Actor(), + RunnerHandlerActorState(output, errors, task, runner) + { + fdb_probe_actor_enter("runnerHandler", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("runnerHandler"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("runnerHandler", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< RunnerHandlerActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +[[nodiscard]] Future runnerHandler( PromiseStream const& output, PromiseStream const& errors, Future const& task, RunnerList::iterator const& runner ) { + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + return Future(new RunnerHandlerActor(output, errors, task, runner)); + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +} + +#line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" namespace { // This generated class is to be used only via actorCollection() - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" template - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" class ActorCollectionActorState { - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" public: - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" ActorCollectionActorState(FutureStream> const& addActor,int* const& pCount,double* const& lastChangeTime,double* const& idleTime,double* const& allTime,bool const& returnWhenEmptied) - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" : addActor(addActor), - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" pCount(pCount), - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" lastChangeTime(lastChangeTime), - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" idleTime(idleTime), - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" allTime(allTime), - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" returnWhenEmptied(returnWhenEmptied), - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" - nextTag(0), - #line 33 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" - tag_streamHelper(), - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + runners(), + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + runnersDestroyer(&runners), + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" complete(), - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" errors(), - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" count(0) - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" { fdb_probe_actor_create("actorCollection", reinterpret_cast(this)); @@ -72,17 +347,17 @@ class ActorCollectionActorState { int a_body1(int loopDepth=0) { try { - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" if (!pCount) - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" { - #line 38 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" pCount = &count; - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" } - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" ; - #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -110,28 +385,28 @@ class ActorCollectionActorState { } int a_body1loopBody1(int loopDepth) { - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" FutureStream> __when_expr_0 = addActor; - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.pop(), loopDepth); }; - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" - FutureStream __when_expr_1 = complete.getFuture(); - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + FutureStream __when_expr_1 = complete.getFuture(); + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when2(__when_expr_1.pop(), loopDepth); }; - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" FutureStream __when_expr_2 = errors.getFuture(); - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when3(__when_expr_2.pop(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 409 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -144,25 +419,27 @@ class ActorCollectionActorState { } int a_body1loopBody1when1(Future const& f,int loopDepth) { - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" - int64_t t = nextTag++; - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" - tag_streamHelper[t] = streamHelper(complete, errors, tag(f, t)); - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + auto i = runners.insert(runners.end(), *new Runner()); + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + Future handler = runnerHandler(complete, errors, f, i); + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + i->handler = handler; + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" ++*pCount; - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" if (*pCount == 1 && lastChangeTime && idleTime && allTime) - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" { - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" double currentTime = now(); - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" *idleTime += currentTime - *lastChangeTime; - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" *allTime += currentTime - *lastChangeTime; - #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" *lastChangeTime = currentTime; - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 442 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" } loopDepth = a_body1loopBody1cont1(loopDepth); @@ -170,119 +447,121 @@ class ActorCollectionActorState { } int a_body1loopBody1when1(Future && f,int loopDepth) { - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" - int64_t t = nextTag++; - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" - tag_streamHelper[t] = streamHelper(complete, errors, tag(f, t)); - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + auto i = runners.insert(runners.end(), *new Runner()); + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + Future handler = runnerHandler(complete, errors, f, i); + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + i->handler = handler; + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" ++*pCount; - #line 45 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" if (*pCount == 1 && lastChangeTime && idleTime && allTime) - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" { - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" double currentTime = now(); - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" *idleTime += currentTime - *lastChangeTime; - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" *allTime += currentTime - *lastChangeTime; - #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" *lastChangeTime = currentTime; - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" } loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1when2(int64_t const& t,int loopDepth) + int a_body1loopBody1when2(RunnerList::iterator const& i,int loopDepth) { - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" if (!--*pCount) - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" { - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" if (lastChangeTime && idleTime && allTime) - #line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" { - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" double currentTime = now(); - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" *allTime += currentTime - *lastChangeTime; - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" *lastChangeTime = currentTime; - #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" } - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" if (returnWhenEmptied) - #line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" { - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ActorCollectionActorState(); static_cast(this)->destroy(); return 0; } - #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ActorCollectionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" - tag_streamHelper.erase(t); - #line 230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + runners.erase_and_dispose(i, [](Runner* r) { delete r; }); + #line 509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } - int a_body1loopBody1when2(int64_t && t,int loopDepth) + int a_body1loopBody1when2(RunnerList::iterator && i,int loopDepth) { - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" if (!--*pCount) - #line 239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" { - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" if (lastChangeTime && idleTime && allTime) - #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" { - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" double currentTime = now(); - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" *allTime += currentTime - *lastChangeTime; - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" *lastChangeTime = currentTime; - #line 251 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" } - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" if (returnWhenEmptied) - #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 534 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" { - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ActorCollectionActorState(); static_cast(this)->destroy(); return 0; } - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ActorCollectionActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" - tag_streamHelper.erase(t); - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + runners.erase_and_dispose(i, [](Runner* r) { delete r; }); + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1when3(Error const& e,int loopDepth) { - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" return loopDepth; } int a_body1loopBody1when3(Error && e,int loopDepth) { - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" return loopDepth; } @@ -290,7 +569,7 @@ class ActorCollectionActorState { { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; static_cast(this)->ActorSingleCallback< ActorCollectionActor, 0, Future >::remove(); - static_cast(this)->ActorSingleCallback< ActorCollectionActor, 1, int64_t >::remove(); + static_cast(this)->ActorSingleCallback< ActorCollectionActor, 1, RunnerList::iterator >::remove(); static_cast(this)->ActorSingleCallback< ActorCollectionActor, 2, Error >::remove(); } @@ -339,7 +618,7 @@ class ActorCollectionActorState { fdb_probe_actor_exit("actorCollection", reinterpret_cast(this), 0); } - void a_callback_fire(ActorSingleCallback< ActorCollectionActor, 1, int64_t >*,int64_t const& value) + void a_callback_fire(ActorSingleCallback< ActorCollectionActor, 1, RunnerList::iterator >*,RunnerList::iterator const& value) { fdb_probe_actor_enter("actorCollection", reinterpret_cast(this), 1); a_exitChoose1(); @@ -354,7 +633,7 @@ class ActorCollectionActorState { fdb_probe_actor_exit("actorCollection", reinterpret_cast(this), 1); } - void a_callback_fire(ActorSingleCallback< ActorCollectionActor, 1, int64_t >*,int64_t && value) + void a_callback_fire(ActorSingleCallback< ActorCollectionActor, 1, RunnerList::iterator >*,RunnerList::iterator && value) { fdb_probe_actor_enter("actorCollection", reinterpret_cast(this), 1); a_exitChoose1(); @@ -369,7 +648,7 @@ class ActorCollectionActorState { fdb_probe_actor_exit("actorCollection", reinterpret_cast(this), 1); } - void a_callback_error(ActorSingleCallback< ActorCollectionActor, 1, int64_t >*,Error err) + void a_callback_error(ActorSingleCallback< ActorCollectionActor, 1, RunnerList::iterator >*,Error err) { fdb_probe_actor_enter("actorCollection", reinterpret_cast(this), 1); a_exitChoose1(); @@ -429,34 +708,34 @@ class ActorCollectionActorState { fdb_probe_actor_exit("actorCollection", reinterpret_cast(this), 2); } - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" FutureStream> addActor; - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" int* pCount; - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" double* lastChangeTime; - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" double* idleTime; - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" double* allTime; - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" bool returnWhenEmptied; - #line 32 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" - int64_t nextTag; - #line 33 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" - Map> tag_streamHelper; - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" - PromiseStream complete; - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + RunnerList runners; + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + RunnerListDestroyer runnersDestroyer; + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + PromiseStream complete; + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" PromiseStream errors; - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" int count; - #line 454 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" }; // This generated class is to be used only via actorCollection() - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" -class ActorCollectionActor final : public Actor, public ActorSingleCallback< ActorCollectionActor, 0, Future >, public ActorSingleCallback< ActorCollectionActor, 1, int64_t >, public ActorSingleCallback< ActorCollectionActor, 2, Error >, public FastAllocated, public ActorCollectionActorState { - #line 459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +class ActorCollectionActor final : public Actor, public ActorSingleCallback< ActorCollectionActor, 0, Future >, public ActorSingleCallback< ActorCollectionActor, 1, RunnerList::iterator >, public ActorSingleCallback< ActorCollectionActor, 2, Error >, public FastAllocated, public ActorCollectionActorState { + #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -465,11 +744,11 @@ class ActorCollectionActor final : public Actor, public ActorSingleCallbac void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorSingleCallback< ActorCollectionActor, 0, Future >; -friend struct ActorSingleCallback< ActorCollectionActor, 1, int64_t >; +friend struct ActorSingleCallback< ActorCollectionActor, 1, RunnerList::iterator >; friend struct ActorSingleCallback< ActorCollectionActor, 2, Error >; - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" ActorCollectionActor(FutureStream> const& addActor,int* const& pCount,double* const& lastChangeTime,double* const& idleTime,double* const& allTime,bool const& returnWhenEmptied) - #line 472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" : Actor(), ActorCollectionActorState(addActor, pCount, lastChangeTime, idleTime, allTime, returnWhenEmptied) { @@ -493,14 +772,14 @@ friend struct ActorSingleCallback< ActorCollectionActor, 2, Error >; } }; } - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" [[nodiscard]] Future actorCollection( FutureStream> const& addActor, int* const& pCount, double* const& lastChangeTime, double* const& idleTime, double* const& allTime, bool const& returnWhenEmptied ) { - #line 26 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" return Future(new ActorCollectionActor(addActor, pCount, lastChangeTime, idleTime, allTime, returnWhenEmptied)); - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" } -#line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +#line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" template struct Traceable> { @@ -518,3 +797,980 @@ struct Traceable> { return result; } }; + +void forceLinkActorCollectionTests() {} + +// The above implementation relies on the behavior that fulfilling a promise +// that another when clause in the same choose block is waiting on is not fired synchronously. + #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase132() + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +template + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +class FlowTestCase132ActorState { + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +public: + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + FlowTestCase132ActorState(UnitTestParameters const& params) + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + : params(params), + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + promise() + #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase132", reinterpret_cast(this)); + + } + ~FlowTestCase132ActorState() + { + fdb_probe_actor_destroy("flowTestCase132", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + StrictFuture __when_expr_0 = delay(0); + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + StrictFuture __when_expr_1 = promise.getFuture(); + #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase132ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase132ActorState(); static_cast(this)->destroy(); return 0; } + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase132ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + promise.send(Void()); + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + promise.send(Void()); + #line 893 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when2(Void const& _,int loopDepth) + { + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + ASSERT(false); + #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when2(Void && _,int loopDepth) + { + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + ASSERT(false); + #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase132Actor, 0, Void >::remove(); + static_cast(this)->ActorCallback< FlowTestCase132Actor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase132Actor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase132", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase132", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FlowTestCase132Actor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase132", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase132", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< FlowTestCase132Actor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase132", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase132", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FlowTestCase132Actor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase132", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1when2(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase132", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< FlowTestCase132Actor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase132", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1when2(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase132", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< FlowTestCase132Actor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase132", reinterpret_cast(this), 1); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase132", reinterpret_cast(this), 1); + + } + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + UnitTestParameters params; + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + Promise promise; + #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase132() + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +class FlowTestCase132Actor final : public Actor, public ActorCallback< FlowTestCase132Actor, 0, Void >, public ActorCallback< FlowTestCase132Actor, 1, Void >, public FastAllocated, public FlowTestCase132ActorState { + #line 1022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< FlowTestCase132Actor, 0, Void >; +friend struct ActorCallback< FlowTestCase132Actor, 1, Void >; + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + FlowTestCase132Actor(UnitTestParameters const& params) + #line 1034 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + : Actor(), + FlowTestCase132ActorState(params) + { + fdb_probe_actor_enter("flowTestCase132", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase132"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase132", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< FlowTestCase132Actor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +static Future flowTestCase132( UnitTestParameters const& params ) { + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + return Future(new FlowTestCase132Actor(params)); + #line 1062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase132, "/flow/actorCollection/chooseWhen") + +#line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +namespace { +// This generated class is to be used only via failIfNotCancelled() + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +template + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +class FailIfNotCancelledActorState { + #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +public: + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + FailIfNotCancelledActorState() + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + { + #line 1081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + fdb_probe_actor_create("failIfNotCancelled", reinterpret_cast(this)); + + } + ~FailIfNotCancelledActorState() + { + fdb_probe_actor_destroy("failIfNotCancelled", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + StrictFuture __when_expr_0 = delay(0); + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FailIfNotCancelledActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + ASSERT(false); + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FailIfNotCancelledActorState(); static_cast(this)->destroy(); return 0; } + #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FailIfNotCancelledActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + ASSERT(false); + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FailIfNotCancelledActorState(); static_cast(this)->destroy(); return 0; } + #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FailIfNotCancelledActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FailIfNotCancelledActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FailIfNotCancelledActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("failIfNotCancelled", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("failIfNotCancelled", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FailIfNotCancelledActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("failIfNotCancelled", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("failIfNotCancelled", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< FailIfNotCancelledActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("failIfNotCancelled", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("failIfNotCancelled", reinterpret_cast(this), 0); + + } +}; +// This generated class is to be used only via failIfNotCancelled() + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +class FailIfNotCancelledActor final : public Actor, public ActorCallback< FailIfNotCancelledActor, 0, Void >, public FastAllocated, public FailIfNotCancelledActorState { + #line 1216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< FailIfNotCancelledActor, 0, Void >; + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + FailIfNotCancelledActor() + #line 1227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + : Actor(), + FailIfNotCancelledActorState() + { + fdb_probe_actor_enter("failIfNotCancelled", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("failIfNotCancelled"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("failIfNotCancelled", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< FailIfNotCancelledActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +[[nodiscard]] Future failIfNotCancelled( ) { + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + return Future(new FailIfNotCancelledActor()); + #line 1255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +} + +#line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + +// test contract that actors are cancelled when the actor collection is cleared + #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase153() + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +template + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +class FlowTestCase153ActorState { + #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +public: + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + FlowTestCase153ActorState(UnitTestParameters const& params) + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + : params(params), + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + actorCollection(false) + #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase153", reinterpret_cast(this)); + + } + ~FlowTestCase153ActorState() + { + fdb_probe_actor_destroy("flowTestCase153", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + int actors = deterministicRandom()->randomInt(1, 1000); + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + for(int i = 0;i < actors;i++) { + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + actorCollection.add(failIfNotCancelled()); + #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + } + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + actorCollection.clear(false); + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + StrictFuture __when_expr_0 = delay(0); + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase153ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase153ActorState(); static_cast(this)->destroy(); return 0; } + #line 1332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase153ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase153ActorState(); static_cast(this)->destroy(); return 0; } + #line 1344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase153ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase153Actor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase153Actor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase153", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase153", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FlowTestCase153Actor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase153", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase153", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< FlowTestCase153Actor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase153", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase153", reinterpret_cast(this), 0); + + } + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + UnitTestParameters params; + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + ActorCollection actorCollection; + #line 1419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase153() + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +class FlowTestCase153Actor final : public Actor, public ActorCallback< FlowTestCase153Actor, 0, Void >, public FastAllocated, public FlowTestCase153ActorState { + #line 1424 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< FlowTestCase153Actor, 0, Void >; + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + FlowTestCase153Actor(UnitTestParameters const& params) + #line 1435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + : Actor(), + FlowTestCase153ActorState(params) + { + fdb_probe_actor_enter("flowTestCase153", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase153"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase153", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< FlowTestCase153Actor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +static Future flowTestCase153( UnitTestParameters const& params ) { + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + return Future(new FlowTestCase153Actor(params)); + #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase153, "/flow/actorCollection/testCancel") + +#line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + + #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +namespace { +// This generated class is to be used only via failedActor() + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +template + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +class FailedActorActorState { + #line 1476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +public: + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + FailedActorActorState() + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + { + #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + fdb_probe_actor_create("failedActor", reinterpret_cast(this)); + + } + ~FailedActorActorState() + { + fdb_probe_actor_destroy("failedActor", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + return a_body1Catch1(operation_failed(), loopDepth); + #line 1496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FailedActorActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } +}; +// This generated class is to be used only via failedActor() + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +class FailedActorActor final : public Actor, public FastAllocated, public FailedActorActorState { + #line 1518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + FailedActorActor() + #line 1528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + : Actor(), + FailedActorActorState() + { + fdb_probe_actor_enter("failedActor", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("failedActor"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("failedActor", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +[[nodiscard]] Future failedActor( ) { + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + return Future(new FailedActorActor()); + #line 1555 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +} + +#line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + +// test contract that even if the actor collection has stopped and new actors are added to the promise stream, they are +// all cancelled when resetting actor + #line 1562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase170() + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +template + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +class FlowTestCase170ActorState { + #line 1569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +public: + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + FlowTestCase170ActorState(UnitTestParameters const& params) + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + : params(params), + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + actorCollection(false) + #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase170", reinterpret_cast(this)); + + } + ~FlowTestCase170ActorState() + { + fdb_probe_actor_destroy("flowTestCase170", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + int actors = deterministicRandom()->randomInt(1, 500); + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + for(int i = 0;i < actors;i++) { + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + actorCollection.add(failIfNotCancelled()); + #line 1597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + } + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + actorCollection.add(failedActor()); + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + for(int i = 0;i < actors;i++) { + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + actorCollection.add(failIfNotCancelled()); + #line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + } + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + actorCollection = ActorCollection(false); + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + StrictFuture __when_expr_0 = delay(0); + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase170ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase170ActorState(); static_cast(this)->destroy(); return 0; } + #line 1641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase170ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase170ActorState(); static_cast(this)->destroy(); return 0; } + #line 1653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase170ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase170Actor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase170Actor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase170", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase170", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FlowTestCase170Actor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase170", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase170", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< FlowTestCase170Actor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase170", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase170", reinterpret_cast(this), 0); + + } + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + UnitTestParameters params; + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + ActorCollection actorCollection; + #line 1728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase170() + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +class FlowTestCase170Actor final : public Actor, public ActorCallback< FlowTestCase170Actor, 0, Void >, public FastAllocated, public FlowTestCase170ActorState { + #line 1733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< FlowTestCase170Actor, 0, Void >; + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + FlowTestCase170Actor(UnitTestParameters const& params) + #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" + : Actor(), + FlowTestCase170ActorState(params) + { + fdb_probe_actor_enter("flowTestCase170", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase170"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase170", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< FlowTestCase170Actor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" +static Future flowTestCase170( UnitTestParameters const& params ) { + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" + return Future(new FlowTestCase170Actor(params)); + #line 1772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase170, "/flow/actorCollection/testCancelPromiseStream") + +#line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ActorCollection.actor.cpp" diff --git a/src/flow/Arena.cpp b/src/flow/Arena.cpp index c98bd9f..1c5d077 100644 --- a/src/flow/Arena.cpp +++ b/src/flow/Arena.cpp @@ -18,15 +18,22 @@ * limitations under the License. */ -#include "Arena.h" +#include "flow/Arena.h" #include "flow/UnitTest.h" +#include "flow/ScopeExit.h" + +#include "flow/config.h" // We don't align memory properly, and we need to tell lsan about that. extern "C" const char* __lsan_default_options(void) { return "use_unaligned=1"; } +#ifdef ADDRESS_SANITIZER +#include +#endif + // See https://dox.ipxe.org/memcheck_8h_source.html and https://dox.ipxe.org/valgrind_8h_source.html for an explanation // of valgrind client requests #if VALGRIND @@ -68,6 +75,29 @@ void makeUndefined(void* addr, size_t size) { VALGRIND_MAKE_MEM_UNDEFINED(addr, size); } } +#elif defined(ADDRESS_SANITZER) +void allowAccess(ArenaBlock* b) { + if (b) { + ASAN_UNPOISON_MEMORY_REGION(b, ArenaBlock::TINY_HEADER); + int headerSize = b->isTiny() ? ArenaBlock::TINY_HEADER : sizeof(ArenaBlock); + ASAN_UNPOISON_MEMORY_REGION(b, headerSize); + } +} +void disallowAccess(ArenaBlock* b) { + if (b) { + int headerSize = b->isTiny() ? ArenaBlock::TINY_HEADER : sizeof(ArenaBlock); + ASAN_POISON_MEMORY_REGION(b, headerSize); + } +} +void makeNoAccess(void* addr, size_t size) { + ASAN_POISON_MEMORY_REGION(addr, size); +} +void makeDefined(void* addr, size_t size) { + ASAN_UNPOISON_MEMORY_REGION(addr, size); +} +void makeUndefined(void* addr, size_t size) { + ASAN_UNPOISON_MEMORY_REGION(addr, size); +} #else void allowAccess(ArenaBlock*) {} void disallowAccess(ArenaBlock*) {} @@ -91,14 +121,14 @@ Arena::Arena(Arena&& r) noexcept = default; Arena& Arena::operator=(const Arena& r) = default; Arena& Arena::operator=(Arena&& r) noexcept = default; void Arena::dependsOn(const Arena& p) { - if (p.impl) { + // x.dependsOn(y) is a no-op if they refer to the same ArenaBlocks. + // They will already have the same lifetime. + if (p.impl && p.impl.getPtr() != impl.getPtr()) { allowAccess(impl.getPtr()); allowAccess(p.impl.getPtr()); ArenaBlock::dependOn(impl, p.impl.getPtr()); disallowAccess(p.impl.getPtr()); - if (p.impl.getPtr() != impl.getPtr()) { - disallowAccess(impl.getPtr()); - } + disallowAccess(impl.getPtr()); } } @@ -106,8 +136,6 @@ void* Arena::allocate4kAlignedBuffer(uint32_t size) { return ArenaBlock::dependOn4kAlignedBuffer(impl, size); } -FDB_DEFINE_BOOLEAN_PARAM(FastInaccurateEstimate); - size_t Arena::getSize(FastInaccurateEstimate fastInaccurateEstimate) const { if (impl) { allowAccess(impl.getPtr()); @@ -149,6 +177,9 @@ void ArenaBlock::delref() { } } +bool ArenaBlock::isSecure() const { + return secure; +} bool ArenaBlock::isTiny() const { return tinySize != NOT_TINY; } @@ -208,6 +239,15 @@ size_t ArenaBlock::estimatedTotalSize() const { return totalSizeEstimate; } +void ArenaBlock::wipeUsed() { + int dataOffset = isTiny() ? TINY_HEADER : sizeof(ArenaBlock); + void* dataBegin = (char*)getData() + dataOffset; + int dataSize = used() - dataOffset; + makeDefined(dataBegin, dataSize); + ::memset(dataBegin, 0, dataSize); + makeNoAccess(dataBegin, dataSize); +} + // just for debugging: void ArenaBlock::getUniqueBlocks(std::set& a) { a.insert(this); @@ -271,10 +311,12 @@ void* ArenaBlock::make4kAlignedBuffer(uint32_t size) { void ArenaBlock::dependOn(Reference& self, ArenaBlock* other) { other->addref(); - if (!self || self->isTiny() || self->unused() < sizeof(ArenaBlockRef)) + if (!self || self->isTiny() || self->unused() < sizeof(ArenaBlockRef)) { create(SMALL, self)->makeReference(other); - else + } else { + ASSERT(self->getData() != other->getData()); self->makeReference(other); + } } void* ArenaBlock::dependOn4kAlignedBuffer(Reference& self, uint32_t size) { @@ -285,7 +327,7 @@ void* ArenaBlock::dependOn4kAlignedBuffer(Reference& self, uint32_t } } -void* ArenaBlock::allocate(Reference& self, int bytes) { +void* ArenaBlock::allocate(Reference& self, int bytes, IsSecureMem isSecure) { ArenaBlock* b = self.getPtr(); allowAccess(b); if (!self || self->unused() < bytes) { @@ -295,6 +337,8 @@ void* ArenaBlock::allocate(Reference& self, int bytes) { } void* result = (char*)b->getData() + b->addUsed(bytes); + if (isSecure) + b->secure = 1; disallowAccess(b); makeUndefined(result, bytes); return result; @@ -303,6 +347,7 @@ void* ArenaBlock::allocate(Reference& self, int bytes) { // Return an appropriately-sized ArenaBlock to store the given data ArenaBlock* ArenaBlock::create(int dataSize, Reference& next) { ArenaBlock* b; + // all blocks are initialized with no-wipe by default. allocate() sets it, if needed. if (dataSize <= SMALL - TINY_HEADER && !next) { static_assert(sizeof(ArenaBlock) <= 32); // Need to allocate at least sizeof(ArenaBlock) for an ArenaBlock*. See // https://github.com/apple/foundationdb/issues/6753 @@ -316,6 +361,7 @@ ArenaBlock* ArenaBlock::create(int dataSize, Reference& next) { INSTRUMENT_ALLOCATE("Arena64"); } b->tinyUsed = TINY_HEADER; + b->secure = 0; } else { int reqSize = dataSize + sizeof(ArenaBlock); @@ -340,38 +386,40 @@ ArenaBlock* ArenaBlock::create(int dataSize, Reference& next) { b->bigSize = 256; INSTRUMENT_ALLOCATE("Arena256"); } else if (reqSize <= 512) { - b = (ArenaBlock*)new uint8_t[512]; + b = (ArenaBlock*)allocateAndMaybeKeepalive(512); b->bigSize = 512; INSTRUMENT_ALLOCATE("Arena512"); } else if (reqSize <= 1024) { - b = (ArenaBlock*)new uint8_t[1024]; + b = (ArenaBlock*)allocateAndMaybeKeepalive(1024); b->bigSize = 1024; INSTRUMENT_ALLOCATE("Arena1024"); } else if (reqSize <= 2048) { - b = (ArenaBlock*)new uint8_t[2048]; + b = (ArenaBlock*)allocateAndMaybeKeepalive(2048); b->bigSize = 2048; INSTRUMENT_ALLOCATE("Arena2048"); } else if (reqSize <= 4096) { - b = (ArenaBlock*)new uint8_t[4096]; + b = (ArenaBlock*)allocateAndMaybeKeepalive(4096); b->bigSize = 4096; INSTRUMENT_ALLOCATE("Arena4096"); } else { - b = (ArenaBlock*)new uint8_t[8192]; + b = (ArenaBlock*)allocateAndMaybeKeepalive(8192); b->bigSize = 8192; INSTRUMENT_ALLOCATE("Arena8192"); } b->totalSizeEstimate = b->bigSize; b->tinySize = b->tinyUsed = NOT_TINY; b->bigUsed = sizeof(ArenaBlock); + b->secure = 0; } else { #ifdef ALLOC_INSTRUMENTATION allocInstr["ArenaHugeKB"].alloc((reqSize + 1023) >> 10); #endif - b = (ArenaBlock*)new uint8_t[reqSize]; + b = (ArenaBlock*)allocateAndMaybeKeepalive(reqSize); b->tinySize = b->tinyUsed = NOT_TINY; b->bigSize = reqSize; b->totalSizeEstimate = b->bigSize; b->bigUsed = sizeof(ArenaBlock); + b->secure = 0; #if !DEBUG_DETERMINISM if (FLOW_KNOBS && g_allocation_tracing_disabled == 0 && @@ -439,6 +487,9 @@ void ArenaBlock::destroy() { } void ArenaBlock::destroyLeaf() { + if (secure) { + wipeUsed(); + } if (isTiny()) { if (tinySize <= 32) { FastAllocator<32>::release(this); @@ -455,26 +506,26 @@ void ArenaBlock::destroyLeaf() { FastAllocator<256>::release(this); INSTRUMENT_RELEASE("Arena256"); } else if (bigSize <= 512) { - delete[] reinterpret_cast(this); + freeOrMaybeKeepalive(this); INSTRUMENT_RELEASE("Arena512"); } else if (bigSize <= 1024) { - delete[] reinterpret_cast(this); + freeOrMaybeKeepalive(this); INSTRUMENT_RELEASE("Arena1024"); } else if (bigSize <= 2048) { - delete[] reinterpret_cast(this); + freeOrMaybeKeepalive(this); INSTRUMENT_RELEASE("Arena2048"); } else if (bigSize <= 4096) { - delete[] reinterpret_cast(this); + freeOrMaybeKeepalive(this); INSTRUMENT_RELEASE("Arena4096"); } else if (bigSize <= 8192) { - delete[] reinterpret_cast(this); + freeOrMaybeKeepalive(this); INSTRUMENT_RELEASE("Arena8192"); } else { #ifdef ALLOC_INSTRUMENTATION allocInstr["ArenaHugeKB"].dealloc((bigSize + 1023) >> 10); #endif g_hugeArenaMemory.fetch_sub(bigSize); - delete[] reinterpret_cast(this); + freeOrMaybeKeepalive(this); } } } @@ -747,3 +798,244 @@ TEST_CASE("/flow/Arena/Size") { return Void(); } + +// Test that x.dependsOn(x) works, and is effectively a no-op. +TEST_CASE("/flow/Arena/SelfRef") { + Arena a(4096); + + // This should be a no-op. + a.dependsOn(a); + + return Void(); +} + +TEST_CASE("flow/StringRef/eat") { + StringRef str = "test/case"_sr; + StringRef first = str.eat("/"); + ASSERT(first == "test"_sr); + ASSERT(str == "case"_sr); + + str = "test/case"_sr; + first = str.eat("/"_sr); + ASSERT(first == "test"_sr); + ASSERT(str == "case"_sr); + + str = "testcase"_sr; + first = str.eat("/"_sr); + ASSERT(first == "testcase"_sr); + ASSERT(str == ""_sr); + + str = "testcase/"_sr; + first = str.eat("/"_sr); + ASSERT(first == "testcase"_sr); + ASSERT(str == ""_sr); + + str = "test/case/extra"_sr; + first = str.eat("/"_sr); + ASSERT(first == "test"_sr); + ASSERT(str == "case/extra"_sr); + + bool hasSep; + str = "test/case"_sr; + first = str.eat("/"_sr, &hasSep); + ASSERT(hasSep); + ASSERT(first == "test"_sr); + ASSERT(str == "case"_sr); + + str = "testcase"_sr; + first = str.eat("/", &hasSep); + ASSERT(!hasSep); + ASSERT(first == "testcase"_sr); + ASSERT(str == ""_sr); + + return Void(); +} + +struct TestOptionalMapClass { + StringRef value; + Optional optionalValue; + + const StringRef constValue; + const Optional constOptionalValue; + + StringRef getValue() const { return value; } + Optional getOptionalValue() const { return optionalValue; } + + StringRef const& getValueRef() const { return value; } + Optional const& getOptionalValueRef() const { return optionalValue; } + + StringRef sub(int x) const { return value.substr(x); } + Optional optionalSub(int x) const { return optionalValue.map(&StringRef::substr, (int)x); } + + TestOptionalMapClass(StringRef value, bool setOptional) + : value(value), constValue(value), + optionalValue(setOptional ? Optional(value) : Optional()), + constOptionalValue(setOptional ? Optional(value) : Optional()) {} +}; + +struct TestOptionalMapClassRef : public TestOptionalMapClass, public ReferenceCounted { + TestOptionalMapClassRef(StringRef value, bool setOptional) : TestOptionalMapClass(value, setOptional) {} +}; + +void checkResults(std::vector> const& results, + StringRef value, + bool shouldBeEmpty, + std::string context) { + if (shouldBeEmpty) { + for (int i = 0; i < results.size(); ++i) { + if (results[i].present()) { + fmt::print("Unexpected result {} at index {} in {}\n", results[i].get().printable(), i, context); + ASSERT(false); + } + } + } else { + for (int i = 0; i < results.size(); ++i) { + if (!results[i].present()) { + fmt::print("Missing result {} at index {} in {}\n", value.printable(), i, context); + ASSERT(false); + } + + if (i < results.size() - 1) { + if (results[i].get() != value) { + fmt::print("Incorrect result {} at index {} in {}: expected {}\n", + results[i].get().printable(), + i, + context, + value.printable()); + ASSERT(false); + } + } else { + if (results[i].get() != value.substr(5)) { + fmt::print("Incorrect result {} at index {} in {}: expected {}\n", + results[i].get().printable(), + i, + context, + value.substr(5).printable()); + ASSERT(false); + } + } + } + } +} + +template +void checkOptional(Optional val) { + StringRef value; + bool isEmpty = !val.present(); + bool isFlatMapEmpty = isEmpty; + std::vector> mapResults; + std::vector> flatMapResults; + + if constexpr (IsRef) { + isEmpty = isFlatMapEmpty = isEmpty || !val.get(); + if (!isEmpty) { + value = val.get()->value; + isFlatMapEmpty = !val.get()->optionalValue.present(); + } + mapResults.push_back(val.mapRef(&TestOptionalMapClass::value)); + mapResults.push_back(val.mapRef(&TestOptionalMapClass::constValue)); + mapResults.push_back(val.mapRef(&TestOptionalMapClass::getValue)); + mapResults.push_back(val.mapRef(&TestOptionalMapClass::getValueRef)); + mapResults.push_back(val.mapRef(&TestOptionalMapClass::sub, 5)); + + flatMapResults.push_back(val.flatMap([](auto t) { return t ? t->optionalValue : Optional(); })); + flatMapResults.push_back(val.flatMapRef(&TestOptionalMapClass::optionalValue)); + flatMapResults.push_back(val.flatMapRef(&TestOptionalMapClass::constOptionalValue)); + flatMapResults.push_back(val.flatMapRef(&TestOptionalMapClass::getOptionalValue)); + flatMapResults.push_back(val.flatMapRef(&TestOptionalMapClass::getOptionalValueRef)); + flatMapResults.push_back(val.flatMapRef(&TestOptionalMapClass::optionalSub, 5)); + } else { + if (!isEmpty) { + value = val.get().value; + isFlatMapEmpty = !val.get().optionalValue.present(); + } + mapResults.push_back(val.map([](auto t) { return t.value; })); + mapResults.push_back(val.map(&TestOptionalMapClass::value)); + mapResults.push_back(val.map(&TestOptionalMapClass::constValue)); + mapResults.push_back(val.map(&TestOptionalMapClass::getValue)); + mapResults.push_back(val.map(&TestOptionalMapClass::getValueRef)); + mapResults.push_back(val.map(&TestOptionalMapClass::sub, 5)); + + flatMapResults.push_back(val.flatMap([](auto t) { return t.optionalValue; })); + flatMapResults.push_back(val.flatMap(&TestOptionalMapClass::optionalValue)); + flatMapResults.push_back(val.flatMap(&TestOptionalMapClass::constOptionalValue)); + flatMapResults.push_back(val.flatMap(&TestOptionalMapClass::getOptionalValue)); + flatMapResults.push_back(val.flatMap(&TestOptionalMapClass::getOptionalValueRef)); + flatMapResults.push_back(val.flatMap(&TestOptionalMapClass::optionalSub, 5)); + } + + checkResults(mapResults, value, isEmpty, IsRef ? "ref map" : "non-ref map"); + checkResults(flatMapResults, value, isFlatMapEmpty, IsRef ? "ref flat map" : "non-ref flat map"); +} + +TEST_CASE("/flow/Arena/OptionalMap") { + // Optional + checkOptional(Optional()); + checkOptional(Optional(TestOptionalMapClass("test_string"_sr, false))); + checkOptional(Optional(TestOptionalMapClass("test_string"_sr, true))); + + // Optional> + checkOptional(Optional>()); + checkOptional(Optional>(Reference())); + checkOptional( + Optional>(makeReference("test_string"_sr, false))); + checkOptional( + Optional>(makeReference("test_string"_sr, true))); + + // Optional + checkOptional(Optional()); + checkOptional(Optional(nullptr)); + + auto ptr = new TestOptionalMapClass("test_string"_sr, false); + checkOptional(Optional(ptr)); + delete ptr; + + ptr = new TestOptionalMapClass("test_string"_sr, true); + checkOptional(Optional(ptr)); + delete ptr; + + return Void(); +} + +TEST_CASE("/flow/Arena/Secure") { + auto& rng = *deterministicRandom(); + auto sizes = std::vector{ 1 }; + for (auto i = 2; i <= ArenaBlock::LARGE * 2; i *= 2) { + sizes.push_back(i); + // randomly select one value between this pow2 and the next + sizes.push_back(rng.randomInt(sizes.back() + 1, sizes.back() * 2)); + } + // temporarily disable allocation tracing: runs with hugeArenaSample seems to cause test to fail for some reason + g_allocation_tracing_disabled++; + auto reenableAllocTracingOnUnwind = ScopeExit([]() { g_allocation_tracing_disabled--; }); + for (auto iter = 0; iter < 100; iter++) { + auto const allocsPerArena = rng.randomInt(1, 80); + std::vector> buffers; + // below scope object keeps deallocated memory alive to test if wipe-after-use behaves correctly + auto keepaliveScope = keepalive_allocator::ActiveScope{}; + { + Arena arena; + for (auto i = 0; i < allocsPerArena; i++) { + auto const len = sizes[rng.randomInt(0, sizes.size())]; + auto const buf = new (arena, WipeAfterUse{}) uint8_t[len]; + for (auto i = 0; i < len; i++) + buf[i] = rng.randomInt(1, 256); + buffers.push_back(std::make_pair(buf, len)); + } + } + // make sure the buffers have been zeroed out + for (auto const& buffer : buffers) { + auto buf = buffer.first; + auto len = buffer.second; + makeDefined(buf, len); + auto poisonOnUnwind = ScopeExit([buf, len]() { makeNoAccess(buf, len); }); + for (auto i = 0; i < len; i++) { + if (buf[i] != 0) { + fmt::print("Non-zero byte found at iter {} size {} offset {}\n", iter + 1, len, i); + ASSERT(false); + } + } + } + } + return Void(); +} diff --git a/src/flow/ArenaString.cpp b/src/flow/ArenaString.cpp new file mode 100644 index 0000000..9e9b7d3 --- /dev/null +++ b/src/flow/ArenaString.cpp @@ -0,0 +1,49 @@ +#include "flow/UnitTest.h" +#include "flow/ArenaAllocator.h" +#include "flow/ArenaString.h" + +TEST_CASE("/flow/ArenaString") { + Arena arena; + ArenaAllocator alloc(arena); + { + ArenaString s("1", alloc); + auto shortStrBuf = s.data(); + s.assign(100, '1'); + auto longStrBuf = s.data(); + ASSERT_NE(shortStrBuf, longStrBuf); + ArenaString t = s; + auto copiedStrBuf = t.data(); + ASSERT_NE(copiedStrBuf, longStrBuf); + } + { + ArenaString s(alloc); + s.assign(100, 'a'); + ArenaString t(100, 'a', alloc); + ASSERT(s == t); + } + { + // Default construction of string does not specify an allocator, and Arena by extension. + // Any modification that requires allocation will throw bad_allocator() when assigning beyond + // short-string-optimized length. + ArenaString s; + bool hit = false; + try { + s.assign(100, 'a'); + } catch (Error& e) { + hit = true; + ASSERT_EQ(e.code(), error_code_bad_allocator); + } + ASSERT(hit); + } + { + // string_view may be used to bridge strings with different allocators + ArenaString s(100, 'a', alloc); + std::string_view sv(s); + std::string s2(sv); + std::string_view sv2(s2); + ASSERT(sv == sv2); + } + return Void(); +} + +void forceLinkArenaStringTests() {} diff --git a/src/flow/BlobCipher.cpp b/src/flow/BlobCipher.cpp deleted file mode 100644 index 5f82a86..0000000 --- a/src/flow/BlobCipher.cpp +++ /dev/null @@ -1,1063 +0,0 @@ -/* - * BlobCipher.cpp - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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. - */ - -#include "flow/BlobCipher.h" -#include "flow/EncryptUtils.h" -#include "flow/Error.h" -#include "flow/FastRef.h" -#include "flow/IRandom.h" -#include "flow/ITrace.h" -#include "flow/network.h" -#include "flow/Trace.h" -#include "flow/UnitTest.h" - -#include -#include -#include - -#if ENCRYPTION_ENABLED - -namespace { -bool isEncryptHeaderAuthTokenModeValid(const EncryptAuthTokenMode mode) { - return mode >= ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE && mode < ENCRYPT_HEADER_AUTH_TOKEN_LAST; -} -} // namespace - -// BlobCipherKey class methods - -BlobCipherKey::BlobCipherKey(const EncryptCipherDomainId& domainId, - const EncryptCipherBaseKeyId& baseCiphId, - const uint8_t* baseCiph, - int baseCiphLen) { - EncryptCipherRandomSalt salt; - if (g_network->isSimulated()) { - salt = deterministicRandom()->randomUInt64(); - } else { - salt = nondeterministicRandom()->randomUInt64(); - } - initKey(domainId, baseCiph, baseCiphLen, baseCiphId, salt); - /*TraceEvent("BlobCipherKey") - .detail("DomainId", domainId) - .detail("BaseCipherId", baseCipherId) - .detail("BaseCipherLen", baseCipherLen) - .detail("RandomSalt", randomSalt) - .detail("CreationTime", creationTime);*/ -} - -void BlobCipherKey::initKey(const EncryptCipherDomainId& domainId, - const uint8_t* baseCiph, - int baseCiphLen, - const EncryptCipherBaseKeyId& baseCiphId, - const EncryptCipherRandomSalt& salt) { - // Set the base encryption key properties - baseCipher = std::make_unique(AES_256_KEY_LENGTH); - memset(baseCipher.get(), 0, AES_256_KEY_LENGTH); - memcpy(baseCipher.get(), baseCiph, std::min(baseCiphLen, AES_256_KEY_LENGTH)); - baseCipherLen = baseCiphLen; - baseCipherId = baseCiphId; - // Set the encryption domain for the base encryption key - encryptDomainId = domainId; - randomSalt = salt; - // derive the encryption key - cipher = std::make_unique(AES_256_KEY_LENGTH); - memset(cipher.get(), 0, AES_256_KEY_LENGTH); - applyHmacSha256Derivation(); - // update the key creation time - creationTime = now(); -} - -void BlobCipherKey::applyHmacSha256Derivation() { - Arena arena; - uint8_t buf[baseCipherLen + sizeof(EncryptCipherRandomSalt)]; - memcpy(&buf[0], baseCipher.get(), baseCipherLen); - memcpy(&buf[0] + baseCipherLen, &randomSalt, sizeof(EncryptCipherRandomSalt)); - HmacSha256DigestGen hmacGen(baseCipher.get(), baseCipherLen); - StringRef digest = hmacGen.digest(&buf[0], baseCipherLen + sizeof(EncryptCipherRandomSalt), arena); - std::copy(digest.begin(), digest.end(), cipher.get()); - if (digest.size() < AES_256_KEY_LENGTH) { - memcpy(cipher.get() + digest.size(), buf, AES_256_KEY_LENGTH - digest.size()); - } -} - -void BlobCipherKey::reset() { - memset(baseCipher.get(), 0, baseCipherLen); - memset(cipher.get(), 0, AES_256_KEY_LENGTH); -} - -// BlobKeyIdCache class methods - -BlobCipherKeyIdCache::BlobCipherKeyIdCache() - : domainId(ENCRYPT_INVALID_DOMAIN_ID), latestBaseCipherKeyId(ENCRYPT_INVALID_CIPHER_KEY_ID) {} - -BlobCipherKeyIdCache::BlobCipherKeyIdCache(EncryptCipherDomainId dId) - : domainId(dId), latestBaseCipherKeyId(ENCRYPT_INVALID_CIPHER_KEY_ID) { - TraceEvent("Init_BlobCipherKeyIdCache").detail("DomainId", domainId); -} - -Reference BlobCipherKeyIdCache::getLatestCipherKey() { - return getCipherByBaseCipherId(latestBaseCipherKeyId); -} - -Reference BlobCipherKeyIdCache::getCipherByBaseCipherId(EncryptCipherBaseKeyId baseCipherKeyId) { - BlobCipherKeyIdCacheMapCItr itr = keyIdCache.find(baseCipherKeyId); - if (itr == keyIdCache.end()) { - throw encrypt_key_not_found(); - } - return itr->second; -} - -void BlobCipherKeyIdCache::insertBaseCipherKey(EncryptCipherBaseKeyId baseCipherId, - const uint8_t* baseCipher, - int baseCipherLen) { - ASSERT_GT(baseCipherId, ENCRYPT_INVALID_CIPHER_KEY_ID); - - // BaseCipherKeys are immutable, ensure that cached value doesn't get updated. - BlobCipherKeyIdCacheMapCItr itr = keyIdCache.find(baseCipherId); - if (itr != keyIdCache.end()) { - if (memcmp(itr->second->rawBaseCipher(), baseCipher, baseCipherLen) == 0) { - TraceEvent("InsertBaseCipherKey_AlreadyPresent") - .detail("BaseCipherKeyId", baseCipherId) - .detail("DomainId", domainId); - // Key is already present; nothing more to do. - return; - } else { - TraceEvent("InsertBaseCipherKey_UpdateCipher") - .detail("BaseCipherKeyId", baseCipherId) - .detail("DomainId", domainId); - throw encrypt_update_cipher(); - } - } - - keyIdCache.emplace(baseCipherId, makeReference(domainId, baseCipherId, baseCipher, baseCipherLen)); - // Update the latest BaseCipherKeyId for the given encryption domain - latestBaseCipherKeyId = baseCipherId; -} - -void BlobCipherKeyIdCache::cleanup() { - for (auto& keyItr : keyIdCache) { - keyItr.second->reset(); - } - - keyIdCache.clear(); -} - -std::vector> BlobCipherKeyIdCache::getAllCipherKeys() { - std::vector> cipherKeys; - for (auto& keyItr : keyIdCache) { - cipherKeys.push_back(keyItr.second); - } - return cipherKeys; -} - -// BlobCipherKeyCache class methods - -void BlobCipherKeyCache::insertCipherKey(const EncryptCipherDomainId& domainId, - const EncryptCipherBaseKeyId& baseCipherId, - const uint8_t* baseCipher, - int baseCipherLen) { - if (domainId == ENCRYPT_INVALID_DOMAIN_ID || baseCipherId == ENCRYPT_INVALID_CIPHER_KEY_ID) { - throw encrypt_invalid_id(); - } - - try { - auto domainItr = domainCacheMap.find(domainId); - if (domainItr == domainCacheMap.end()) { - // Add mapping to track new encryption domain - Reference keyIdCache = makeReference(domainId); - keyIdCache->insertBaseCipherKey(baseCipherId, baseCipher, baseCipherLen); - domainCacheMap.emplace(domainId, keyIdCache); - } else { - // Track new baseCipher keys - Reference keyIdCache = domainItr->second; - keyIdCache->insertBaseCipherKey(baseCipherId, baseCipher, baseCipherLen); - } - - TraceEvent("InsertCipherKey").detail("DomainId", domainId).detail("BaseCipherKeyId", baseCipherId); - } catch (Error& e) { - TraceEvent("InsertCipherKey_Failed").detail("BaseCipherKeyId", baseCipherId).detail("DomainId", domainId); - throw; - } -} - -Reference BlobCipherKeyCache::getLatestCipherKey(const EncryptCipherDomainId& domainId) { - auto domainItr = domainCacheMap.find(domainId); - if (domainItr == domainCacheMap.end()) { - TraceEvent("GetLatestCipherKey_DomainNotFound").detail("DomainId", domainId); - throw encrypt_key_not_found(); - } - - Reference keyIdCache = domainItr->second; - Reference cipherKey = keyIdCache->getLatestCipherKey(); - if ((now() - cipherKey->getCreationTime()) > BlobCipherKeyCache::CIPHER_KEY_CACHE_TTL_SEC) { - TraceEvent("GetLatestCipherKey_ExpiredTTL") - .detail("DomainId", domainId) - .detail("BaseCipherId", cipherKey->getBaseCipherId()); - throw encrypt_key_ttl_expired(); - } - - return cipherKey; -} - -Reference BlobCipherKeyCache::getCipherKey(const EncryptCipherDomainId& domainId, - const EncryptCipherBaseKeyId& baseCipherId) { - auto domainItr = domainCacheMap.find(domainId); - if (domainItr == domainCacheMap.end()) { - throw encrypt_key_not_found(); - } - - Reference keyIdCache = domainItr->second; - return keyIdCache->getCipherByBaseCipherId(baseCipherId); -} - -void BlobCipherKeyCache::resetEncyrptDomainId(const EncryptCipherDomainId domainId) { - auto domainItr = domainCacheMap.find(domainId); - if (domainItr == domainCacheMap.end()) { - throw encrypt_key_not_found(); - } - - Reference keyIdCache = domainItr->second; - keyIdCache->cleanup(); - TraceEvent("ResetEncryptDomainId").detail("DomainId", domainId); -} - -void BlobCipherKeyCache::cleanup() noexcept { - BlobCipherKeyCache& instance = BlobCipherKeyCache::getInstance(); - for (auto& domainItr : instance.domainCacheMap) { - Reference keyIdCache = domainItr.second; - keyIdCache->cleanup(); - TraceEvent("BlobCipherKeyCache_Cleanup").detail("DomainId", domainItr.first); - } - - instance.domainCacheMap.clear(); -} - -std::vector> BlobCipherKeyCache::getAllCiphers(const EncryptCipherDomainId& domainId) { - auto domainItr = domainCacheMap.find(domainId); - if (domainItr == domainCacheMap.end()) { - return {}; - } - - Reference keyIdCache = domainItr->second; - return keyIdCache->getAllCipherKeys(); -} - -// EncryptBlobCipherAes265Ctr class methods - -EncryptBlobCipherAes265Ctr::EncryptBlobCipherAes265Ctr(Reference tCipherKey, - Reference hCipherKey, - const uint8_t* cipherIV, - const int ivLen, - const EncryptAuthTokenMode mode) - : ctx(EVP_CIPHER_CTX_new()), textCipherKey(tCipherKey), headerCipherKey(hCipherKey), authTokenMode(mode) { - ASSERT(isEncryptHeaderAuthTokenModeValid(mode)); - ASSERT_EQ(ivLen, AES_256_IV_LENGTH); - - memcpy(&iv[0], cipherIV, ivLen); - - if (ctx == nullptr) { - throw encrypt_ops_error(); - } - if (EVP_EncryptInit_ex(ctx, EVP_aes_256_ctr(), nullptr, nullptr, nullptr) != 1) { - throw encrypt_ops_error(); - } - if (EVP_EncryptInit_ex(ctx, nullptr, nullptr, textCipherKey.getPtr()->data(), cipherIV) != 1) { - throw encrypt_ops_error(); - } -} - -Reference EncryptBlobCipherAes265Ctr::encrypt(const uint8_t* plaintext, - const int plaintextLen, - BlobCipherEncryptHeader* header, - Arena& arena) { - TEST(true); // Encrypting data with BlobCipher - - memset(reinterpret_cast(header), 0, sizeof(BlobCipherEncryptHeader)); - - // Alloc buffer computation accounts for 'header authentication' generation scheme. If single-auth-token needs to be - // generated, allocate buffer sufficient to append header to the cipherText optimizing memcpy cost. - - const int allocSize = authTokenMode == ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE - ? plaintextLen + AES_BLOCK_SIZE + sizeof(BlobCipherEncryptHeader) - : plaintextLen + AES_BLOCK_SIZE; - Reference encryptBuf = makeReference(allocSize, arena); - uint8_t* ciphertext = encryptBuf->begin(); - int bytes{ 0 }; - if (EVP_EncryptUpdate(ctx, ciphertext, &bytes, plaintext, plaintextLen) != 1) { - TraceEvent("Encrypt_UpdateFailed") - .detail("BaseCipherId", textCipherKey->getBaseCipherId()) - .detail("EncryptDomainId", textCipherKey->getDomainId()); - throw encrypt_ops_error(); - } - - int finalBytes{ 0 }; - if (EVP_EncryptFinal_ex(ctx, ciphertext + bytes, &finalBytes) != 1) { - TraceEvent("Encrypt_FinalFailed") - .detail("BaseCipherId", textCipherKey->getBaseCipherId()) - .detail("EncryptDomainId", textCipherKey->getDomainId()); - throw encrypt_ops_error(); - } - - if ((bytes + finalBytes) != plaintextLen) { - TraceEvent("Encrypt_UnexpectedCipherLen") - .detail("PlaintextLen", plaintextLen) - .detail("EncryptedBufLen", bytes + finalBytes); - throw encrypt_ops_error(); - } - - // Populate encryption header flags details - header->flags.size = sizeof(BlobCipherEncryptHeader); - header->flags.headerVersion = EncryptBlobCipherAes265Ctr::ENCRYPT_HEADER_VERSION; - header->flags.encryptMode = ENCRYPT_CIPHER_MODE_AES_256_CTR; - header->flags.authTokenMode = authTokenMode; - - // Populate cipherText encryption-key details - header->cipherTextDetails.baseCipherId = textCipherKey->getBaseCipherId(); - header->cipherTextDetails.encryptDomainId = textCipherKey->getDomainId(); - header->cipherTextDetails.salt = textCipherKey->getSalt(); - memcpy(&header->cipherTextDetails.iv[0], &iv[0], AES_256_IV_LENGTH); - - if (authTokenMode == ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) { - // No header 'authToken' generation needed. - } else { - // Populate header encryption-key details - header->cipherHeaderDetails.encryptDomainId = headerCipherKey->getDomainId(); - header->cipherHeaderDetails.baseCipherId = headerCipherKey->getBaseCipherId(); - - // Populate header authToken details - if (header->flags.authTokenMode == ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE) { - ASSERT_GE(allocSize, (bytes + finalBytes + sizeof(BlobCipherEncryptHeader))); - ASSERT_GE(encryptBuf->getLogicalSize(), (bytes + finalBytes + sizeof(BlobCipherEncryptHeader))); - - memcpy(&ciphertext[bytes + finalBytes], - reinterpret_cast(header), - sizeof(BlobCipherEncryptHeader)); - StringRef authToken = computeAuthToken(ciphertext, - bytes + finalBytes + sizeof(BlobCipherEncryptHeader), - headerCipherKey->rawCipher(), - AES_256_KEY_LENGTH, - arena); - memcpy(&header->singleAuthToken.authToken[0], authToken.begin(), AUTH_TOKEN_SIZE); - } else { - ASSERT_EQ(header->flags.authTokenMode, ENCRYPT_HEADER_AUTH_TOKEN_MODE_MULTI); - - StringRef cipherTextAuthToken = - computeAuthToken(ciphertext, - bytes + finalBytes, - reinterpret_cast(&header->cipherTextDetails.salt), - sizeof(EncryptCipherRandomSalt), - arena); - memcpy(&header->multiAuthTokens.cipherTextAuthToken[0], cipherTextAuthToken.begin(), AUTH_TOKEN_SIZE); - StringRef headerAuthToken = computeAuthToken(reinterpret_cast(header), - sizeof(BlobCipherEncryptHeader), - headerCipherKey->rawCipher(), - AES_256_KEY_LENGTH, - arena); - memcpy(&header->multiAuthTokens.headerAuthToken[0], headerAuthToken.begin(), AUTH_TOKEN_SIZE); - } - } - - encryptBuf->setLogicalSize(plaintextLen); - return encryptBuf; -} - -EncryptBlobCipherAes265Ctr::~EncryptBlobCipherAes265Ctr() { - if (ctx != nullptr) { - EVP_CIPHER_CTX_free(ctx); - } -} - -// DecryptBlobCipherAes256Ctr class methods - -DecryptBlobCipherAes256Ctr::DecryptBlobCipherAes256Ctr(Reference tCipherKey, - Reference hCipherKey, - const uint8_t* iv) - : ctx(EVP_CIPHER_CTX_new()), textCipherKey(tCipherKey), headerCipherKey(hCipherKey), - headerAuthTokenValidationDone(false), authTokensValidationDone(false) { - if (ctx == nullptr) { - throw encrypt_ops_error(); - } - if (!EVP_DecryptInit_ex(ctx, EVP_aes_256_ctr(), nullptr, nullptr, nullptr)) { - throw encrypt_ops_error(); - } - if (!EVP_DecryptInit_ex(ctx, nullptr, nullptr, tCipherKey.getPtr()->data(), iv)) { - throw encrypt_ops_error(); - } -} - -void DecryptBlobCipherAes256Ctr::verifyHeaderAuthToken(const BlobCipherEncryptHeader& header, Arena& arena) { - if (header.flags.authTokenMode != ENCRYPT_HEADER_AUTH_TOKEN_MODE_MULTI) { - // NoneAuthToken mode; no authToken is generated; nothing to do - // SingleAuthToken mode; verification will happen as part of decryption. - return; - } - - ASSERT_EQ(header.flags.authTokenMode, ENCRYPT_HEADER_AUTH_TOKEN_MODE_MULTI); - - BlobCipherEncryptHeader headerCopy; - memcpy(reinterpret_cast(&headerCopy), - reinterpret_cast(&header), - sizeof(BlobCipherEncryptHeader)); - memset(reinterpret_cast(&headerCopy.multiAuthTokens.headerAuthToken), 0, AUTH_TOKEN_SIZE); - StringRef computedHeaderAuthToken = computeAuthToken(reinterpret_cast(&headerCopy), - sizeof(BlobCipherEncryptHeader), - headerCipherKey->rawCipher(), - AES_256_KEY_LENGTH, - arena); - if (memcmp(&header.multiAuthTokens.headerAuthToken[0], computedHeaderAuthToken.begin(), AUTH_TOKEN_SIZE) != 0) { - TraceEvent("VerifyEncryptBlobHeader_AuthTokenMismatch") - .detail("HeaderVersion", header.flags.headerVersion) - .detail("HeaderMode", header.flags.encryptMode) - .detail("MultiAuthHeaderAuthToken", - StringRef(arena, &header.multiAuthTokens.headerAuthToken[0], AUTH_TOKEN_SIZE).toString()) - .detail("ComputedHeaderAuthToken", computedHeaderAuthToken.toString()); - throw encrypt_header_authtoken_mismatch(); - } - - headerAuthTokenValidationDone = true; -} - -void DecryptBlobCipherAes256Ctr::verifyHeaderSingleAuthToken(const uint8_t* ciphertext, - const int ciphertextLen, - const BlobCipherEncryptHeader& header, - uint8_t* buff, - Arena& arena) { - // Header authToken not set for single auth-token mode. - ASSERT(!headerAuthTokenValidationDone); - - // prepare the payload {cipherText + encryptionHeader} - memcpy(&buff[0], ciphertext, ciphertextLen); - memcpy(&buff[ciphertextLen], reinterpret_cast(&header), sizeof(BlobCipherEncryptHeader)); - // ensure the 'authToken' is reset before computing the 'authentication token' - BlobCipherEncryptHeader* eHeader = (BlobCipherEncryptHeader*)(&buff[ciphertextLen]); - memset(reinterpret_cast(&eHeader->singleAuthToken), 0, 2 * AUTH_TOKEN_SIZE); - - StringRef computed = computeAuthToken( - buff, ciphertextLen + sizeof(BlobCipherEncryptHeader), headerCipherKey->rawCipher(), AES_256_KEY_LENGTH, arena); - if (memcmp(&header.singleAuthToken.authToken[0], computed.begin(), AUTH_TOKEN_SIZE) != 0) { - TraceEvent("VerifyEncryptBlobHeader_AuthTokenMismatch") - .detail("HeaderVersion", header.flags.headerVersion) - .detail("HeaderMode", header.flags.encryptMode) - .detail("SingleAuthToken", - StringRef(arena, &header.singleAuthToken.authToken[0], AUTH_TOKEN_SIZE).toString()) - .detail("ComputedSingleAuthToken", computed.toString()); - throw encrypt_header_authtoken_mismatch(); - } -} - -void DecryptBlobCipherAes256Ctr::verifyHeaderMultiAuthToken(const uint8_t* ciphertext, - const int ciphertextLen, - const BlobCipherEncryptHeader& header, - uint8_t* buff, - Arena& arena) { - if (!headerAuthTokenValidationDone) { - verifyHeaderAuthToken(header, arena); - } - StringRef computedCipherTextAuthToken = - computeAuthToken(ciphertext, - ciphertextLen, - reinterpret_cast(&header.cipherTextDetails.salt), - sizeof(EncryptCipherRandomSalt), - arena); - if (memcmp(&header.multiAuthTokens.cipherTextAuthToken[0], computedCipherTextAuthToken.begin(), AUTH_TOKEN_SIZE) != - 0) { - TraceEvent("VerifyEncryptBlobHeader_AuthTokenMismatch") - .detail("HeaderVersion", header.flags.headerVersion) - .detail("HeaderMode", header.flags.encryptMode) - .detail("MultiAuthCipherTextAuthToken", - StringRef(arena, &header.multiAuthTokens.cipherTextAuthToken[0], AUTH_TOKEN_SIZE).toString()) - .detail("ComputedCipherTextAuthToken", computedCipherTextAuthToken.toString()); - throw encrypt_header_authtoken_mismatch(); - } -} - -void DecryptBlobCipherAes256Ctr::verifyAuthTokens(const uint8_t* ciphertext, - const int ciphertextLen, - const BlobCipherEncryptHeader& header, - uint8_t* buff, - Arena& arena) { - if (header.flags.authTokenMode == ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE) { - verifyHeaderSingleAuthToken(ciphertext, ciphertextLen, header, buff, arena); - } else { - ASSERT_EQ(header.flags.authTokenMode, ENCRYPT_HEADER_AUTH_TOKEN_MODE_MULTI); - verifyHeaderMultiAuthToken(ciphertext, ciphertextLen, header, buff, arena); - } - - authTokensValidationDone = true; -} - -void DecryptBlobCipherAes256Ctr::verifyEncryptHeaderMetadata(const BlobCipherEncryptHeader& header) { - // validate header flag sanity - if (header.flags.headerVersion != EncryptBlobCipherAes265Ctr::ENCRYPT_HEADER_VERSION || - header.flags.encryptMode != ENCRYPT_CIPHER_MODE_AES_256_CTR || - !isEncryptHeaderAuthTokenModeValid((EncryptAuthTokenMode)header.flags.authTokenMode)) { - TraceEvent("VerifyEncryptBlobHeader") - .detail("HeaderVersion", header.flags.headerVersion) - .detail("ExpectedVersion", EncryptBlobCipherAes265Ctr::ENCRYPT_HEADER_VERSION) - .detail("EncryptCipherMode", header.flags.encryptMode) - .detail("ExpectedCipherMode", ENCRYPT_CIPHER_MODE_AES_256_CTR) - .detail("EncryptHeaderAuthTokenMode", header.flags.authTokenMode); - throw encrypt_header_metadata_mismatch(); - } -} - -Reference DecryptBlobCipherAes256Ctr::decrypt(const uint8_t* ciphertext, - const int ciphertextLen, - const BlobCipherEncryptHeader& header, - Arena& arena) { - TEST(true); // Decrypting data with BlobCipher - - verifyEncryptHeaderMetadata(header); - - if (header.flags.authTokenMode != ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE && !headerCipherKey.isValid()) { - TraceEvent("Decrypt_InvalidHeaderCipherKey").detail("AuthTokenMode", header.flags.authTokenMode); - throw encrypt_ops_error(); - } - - const int allocSize = header.flags.authTokenMode == ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE - ? ciphertextLen + AES_BLOCK_SIZE + sizeof(BlobCipherEncryptHeader) - : ciphertextLen + AES_BLOCK_SIZE; - Reference decrypted = makeReference(allocSize, arena); - - if (header.flags.authTokenMode != ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) { - verifyAuthTokens(ciphertext, ciphertextLen, header, decrypted->begin(), arena); - ASSERT(authTokensValidationDone); - } - - uint8_t* plaintext = decrypted->begin(); - int bytesDecrypted{ 0 }; - if (!EVP_DecryptUpdate(ctx, plaintext, &bytesDecrypted, ciphertext, ciphertextLen)) { - TraceEvent("Decrypt_UpdateFailed") - .detail("BaseCipherId", header.cipherTextDetails.baseCipherId) - .detail("EncryptDomainId", header.cipherTextDetails.encryptDomainId); - throw encrypt_ops_error(); - } - - int finalBlobBytes{ 0 }; - if (EVP_DecryptFinal_ex(ctx, plaintext + bytesDecrypted, &finalBlobBytes) <= 0) { - TraceEvent("Decrypt_FinalFailed") - .detail("BaseCipherId", header.cipherTextDetails.baseCipherId) - .detail("EncryptDomainId", header.cipherTextDetails.encryptDomainId); - throw encrypt_ops_error(); - } - - if ((bytesDecrypted + finalBlobBytes) != ciphertextLen) { - TraceEvent("Encrypt_UnexpectedPlaintextLen") - .detail("CiphertextLen", ciphertextLen) - .detail("DecryptedBufLen", bytesDecrypted + finalBlobBytes); - throw encrypt_ops_error(); - } - - decrypted->setLogicalSize(ciphertextLen); - return decrypted; -} - -DecryptBlobCipherAes256Ctr::~DecryptBlobCipherAes256Ctr() { - if (ctx != nullptr) { - EVP_CIPHER_CTX_free(ctx); - } -} - -// HmacSha256DigestGen class methods - -HmacSha256DigestGen::HmacSha256DigestGen(const unsigned char* key, size_t len) : ctx(HMAC_CTX_new()) { - if (!HMAC_Init_ex(ctx, key, len, EVP_sha256(), nullptr)) { - throw encrypt_ops_error(); - } -} - -HmacSha256DigestGen::~HmacSha256DigestGen() { - if (ctx != nullptr) { - HMAC_CTX_free(ctx); - } -} - -StringRef HmacSha256DigestGen::digest(const unsigned char* data, size_t len, Arena& arena) { - TEST(true); // Digest generation - unsigned int digestLen = HMAC_size(ctx); - auto digest = new (arena) unsigned char[digestLen]; - if (HMAC_Update(ctx, data, len) != 1) { - throw encrypt_ops_error(); - } - - if (HMAC_Final(ctx, digest, &digestLen) != 1) { - throw encrypt_ops_error(); - } - return StringRef(digest, digestLen); -} - -StringRef computeAuthToken(const uint8_t* payload, - const int payloadLen, - const uint8_t* key, - const int keyLen, - Arena& arena) { - HmacSha256DigestGen hmacGenerator(key, keyLen); - StringRef digest = hmacGenerator.digest(payload, payloadLen, arena); - - ASSERT_GE(digest.size(), AUTH_TOKEN_SIZE); - return digest; -} - -// Only used to link unit tests -void forceLinkBlobCipherTests() {} - -// Tests cases includes: -// 1. Populate cache by inserting 'baseCipher' details for new encryptionDomainIds -// 2. Random lookup for cipherKeys and content validation -// 3. Inserting of 'identical' cipherKey (already cached) more than once works as desired. -// 4. Inserting of 'non-identical' cipherKey (already cached) more than once works as desired. -// 5. Validation encryption ops (correctness): -// 5.1. Encyrpt a buffer followed by decryption of the buffer, validate the contents. -// 5.2. Simulate anomalies such as: EncyrptionHeader corruption, authToken mismatch / encryptionMode mismatch etc. -// 6. Cache cleanup -// 6.1 cleanup cipherKeys by given encryptDomainId -// 6.2. Cleanup all cached cipherKeys -TEST_CASE("flow/BlobCipher") { - TraceEvent("BlobCipherTest_Start").log(); - - // Construct a dummy External Key Manager representation and populate with some keys - class BaseCipher : public ReferenceCounted, NonCopyable { - public: - EncryptCipherDomainId domainId; - int len; - EncryptCipherBaseKeyId keyId; - std::unique_ptr key; - - BaseCipher(const EncryptCipherDomainId& dId, const EncryptCipherBaseKeyId& kId) - : domainId(dId), len(deterministicRandom()->randomInt(AES_256_KEY_LENGTH / 2, AES_256_KEY_LENGTH + 1)), - keyId(kId), key(std::make_unique(len)) { - generateRandomData(key.get(), len); - } - }; - - using BaseKeyMap = std::unordered_map>; - using DomainKeyMap = std::unordered_map; - DomainKeyMap domainKeyMap; - const EncryptCipherDomainId minDomainId = 1; - const EncryptCipherDomainId maxDomainId = deterministicRandom()->randomInt(minDomainId, minDomainId + 10) + 5; - const EncryptCipherBaseKeyId minBaseCipherKeyId = 100; - const EncryptCipherBaseKeyId maxBaseCipherKeyId = - deterministicRandom()->randomInt(minBaseCipherKeyId, minBaseCipherKeyId + 50) + 15; - for (int dId = minDomainId; dId <= maxDomainId; dId++) { - for (int kId = minBaseCipherKeyId; kId <= maxBaseCipherKeyId; kId++) { - domainKeyMap[dId].emplace(kId, makeReference(dId, kId)); - } - } - ASSERT_EQ(domainKeyMap.size(), maxDomainId); - - // insert BlobCipher keys into BlobCipherKeyCache map and validate - TraceEvent("BlobCipherTest_InsertKeys").log(); - BlobCipherKeyCache& cipherKeyCache = BlobCipherKeyCache::getInstance(); - for (auto& domainItr : domainKeyMap) { - for (auto& baseKeyItr : domainItr.second) { - Reference baseCipher = baseKeyItr.second; - - cipherKeyCache.insertCipherKey( - baseCipher->domainId, baseCipher->keyId, baseCipher->key.get(), baseCipher->len); - } - } - // insert EncryptHeader BlobCipher key - Reference headerBaseCipher = makeReference(ENCRYPT_HEADER_DOMAIN_ID, 1); - cipherKeyCache.insertCipherKey( - headerBaseCipher->domainId, headerBaseCipher->keyId, headerBaseCipher->key.get(), headerBaseCipher->len); - - TraceEvent("BlobCipherTest_InsertKeysDone").log(); - - // validate the cipherKey lookups work as desired - for (auto& domainItr : domainKeyMap) { - for (auto& baseKeyItr : domainItr.second) { - Reference baseCipher = baseKeyItr.second; - Reference cipherKey = cipherKeyCache.getCipherKey(baseCipher->domainId, baseCipher->keyId); - ASSERT(cipherKey.isValid()); - // validate common cipher properties - domainId, baseCipherId, baseCipherLen, rawBaseCipher - ASSERT_EQ(cipherKey->getBaseCipherId(), baseCipher->keyId); - ASSERT_EQ(cipherKey->getDomainId(), baseCipher->domainId); - ASSERT_EQ(cipherKey->getBaseCipherLen(), baseCipher->len); - // ensure that baseCipher matches with the cached information - ASSERT_EQ(std::memcmp(cipherKey->rawBaseCipher(), baseCipher->key.get(), cipherKey->getBaseCipherLen()), 0); - // validate the encryption derivation - ASSERT_NE(std::memcmp(cipherKey->rawCipher(), baseCipher->key.get(), cipherKey->getBaseCipherLen()), 0); - } - } - TraceEvent("BlobCipherTest_LooksupDone").log(); - - // Ensure attemtping to insert existing cipherKey (identical) more than once is treated as a NOP - try { - Reference baseCipher = domainKeyMap[minDomainId][minBaseCipherKeyId]; - cipherKeyCache.insertCipherKey(baseCipher->domainId, baseCipher->keyId, baseCipher->key.get(), baseCipher->len); - } catch (Error& e) { - throw; - } - TraceEvent("BlobCipherTest_ReinsertIdempotentKeyDone").log(); - - // Ensure attemtping to insert an existing cipherKey (modified) fails with appropriate error - try { - Reference baseCipher = domainKeyMap[minDomainId][minBaseCipherKeyId]; - uint8_t rawCipher[baseCipher->len]; - memcpy(rawCipher, baseCipher->key.get(), baseCipher->len); - // modify few bytes in the cipherKey - for (int i = 2; i < 5; i++) { - rawCipher[i]++; - } - cipherKeyCache.insertCipherKey(baseCipher->domainId, baseCipher->keyId, &rawCipher[0], baseCipher->len); - } catch (Error& e) { - if (e.code() != error_code_encrypt_update_cipher) { - throw; - } - } - TraceEvent("BlobCipherTest_ReinsertNonIdempotentKeyDone").log(); - - // Validate Encyrption ops - Reference cipherKey = cipherKeyCache.getLatestCipherKey(minDomainId); - Reference headerCipherKey = cipherKeyCache.getLatestCipherKey(ENCRYPT_HEADER_DOMAIN_ID); - const int bufLen = deterministicRandom()->randomInt(786, 2127) + 512; - uint8_t orgData[bufLen]; - generateRandomData(&orgData[0], bufLen); - - Arena arena; - uint8_t iv[AES_256_IV_LENGTH]; - generateRandomData(&iv[0], AES_256_IV_LENGTH); - - BlobCipherEncryptHeader headerCopy; - // validate basic encrypt followed by decrypt operation for AUTH_MODE_NONE - { - TraceEvent("NoneAuthMode_Start").log(); - - EncryptBlobCipherAes265Ctr encryptor( - cipherKey, Reference(), iv, AES_256_IV_LENGTH, ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE); - BlobCipherEncryptHeader header; - Reference encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - - ASSERT_EQ(encrypted->getLogicalSize(), bufLen); - ASSERT_NE(memcmp(&orgData[0], encrypted->begin(), bufLen), 0); - ASSERT_EQ(header.flags.headerVersion, EncryptBlobCipherAes265Ctr::ENCRYPT_HEADER_VERSION); - ASSERT_EQ(header.flags.encryptMode, ENCRYPT_CIPHER_MODE_AES_256_CTR); - ASSERT_EQ(header.flags.authTokenMode, ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE); - - TraceEvent("BlobCipherTest_EncryptDone") - .detail("HeaderVersion", header.flags.headerVersion) - .detail("HeaderEncryptMode", header.flags.encryptMode) - .detail("DomainId", header.cipherTextDetails.encryptDomainId) - .detail("BaseCipherId", header.cipherTextDetails.baseCipherId); - - Reference tCipherKeyKey = cipherKeyCache.getCipherKey(header.cipherTextDetails.encryptDomainId, - header.cipherTextDetails.baseCipherId); - ASSERT(tCipherKeyKey->isEqual(cipherKey)); - DecryptBlobCipherAes256Ctr decryptor( - tCipherKeyKey, Reference(), &header.cipherTextDetails.iv[0]); - Reference decrypted = decryptor.decrypt(encrypted->begin(), bufLen, header, arena); - - ASSERT_EQ(decrypted->getLogicalSize(), bufLen); - ASSERT_EQ(memcmp(decrypted->begin(), &orgData[0], bufLen), 0); - - TraceEvent("BlobCipherTest_DecryptDone").log(); - - // induce encryption header corruption - headerVersion corrupted - memcpy(reinterpret_cast(&headerCopy), - reinterpret_cast(&header), - sizeof(BlobCipherEncryptHeader)); - headerCopy.flags.headerVersion += 1; - try { - encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - DecryptBlobCipherAes256Ctr decryptor( - tCipherKeyKey, Reference(), &header.cipherTextDetails.iv[0]); - decrypted = decryptor.decrypt(encrypted->begin(), bufLen, headerCopy, arena); - ASSERT(false); // error expected - } catch (Error& e) { - if (e.code() != error_code_encrypt_header_metadata_mismatch) { - throw; - } - } - - // induce encryption header corruption - encryptionMode corrupted - memcpy(reinterpret_cast(&headerCopy), - reinterpret_cast(&header), - sizeof(BlobCipherEncryptHeader)); - headerCopy.flags.encryptMode += 1; - try { - encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - DecryptBlobCipherAes256Ctr decryptor( - tCipherKeyKey, Reference(), &header.cipherTextDetails.iv[0]); - decrypted = decryptor.decrypt(encrypted->begin(), bufLen, headerCopy, arena); - ASSERT(false); // error expected - } catch (Error& e) { - if (e.code() != error_code_encrypt_header_metadata_mismatch) { - throw; - } - } - - // induce encrypted buffer payload corruption - try { - encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - uint8_t temp[bufLen]; - memcpy(encrypted->begin(), &temp[0], bufLen); - int tIdx = deterministicRandom()->randomInt(0, bufLen - 1); - temp[tIdx] += 1; - DecryptBlobCipherAes256Ctr decryptor( - tCipherKeyKey, Reference(), &header.cipherTextDetails.iv[0]); - decrypted = decryptor.decrypt(&temp[0], bufLen, header, arena); - } catch (Error& e) { - // No authToken, hence, no corruption detection supported - ASSERT(false); - } - - TraceEvent("NoneAuthMode_Done").log(); - } - - // validate basic encrypt followed by decrypt operation for AUTH_TOKEN_MODE_SINGLE - { - TraceEvent("SingleAuthMode_Start").log(); - - EncryptBlobCipherAes265Ctr encryptor( - cipherKey, headerCipherKey, iv, AES_256_IV_LENGTH, ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE); - BlobCipherEncryptHeader header; - Reference encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - - ASSERT_EQ(encrypted->getLogicalSize(), bufLen); - ASSERT_NE(memcmp(&orgData[0], encrypted->begin(), bufLen), 0); - ASSERT_EQ(header.flags.headerVersion, EncryptBlobCipherAes265Ctr::ENCRYPT_HEADER_VERSION); - ASSERT_EQ(header.flags.encryptMode, ENCRYPT_CIPHER_MODE_AES_256_CTR); - ASSERT_EQ(header.flags.authTokenMode, ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE); - - TraceEvent("BlobCipherTest_EncryptDone") - .detail("HeaderVersion", header.flags.headerVersion) - .detail("HeaderEncryptMode", header.flags.encryptMode) - .detail("DomainId", header.cipherTextDetails.encryptDomainId) - .detail("BaseCipherId", header.cipherTextDetails.baseCipherId) - .detail("HeaderAuthToken", - StringRef(arena, &header.singleAuthToken.authToken[0], AUTH_TOKEN_SIZE).toString()); - - Reference tCipherKeyKey = cipherKeyCache.getCipherKey(header.cipherTextDetails.encryptDomainId, - header.cipherTextDetails.baseCipherId); - Reference hCipherKey = cipherKeyCache.getCipherKey(header.cipherHeaderDetails.encryptDomainId, - header.cipherHeaderDetails.baseCipherId); - ASSERT(tCipherKeyKey->isEqual(cipherKey)); - DecryptBlobCipherAes256Ctr decryptor(tCipherKeyKey, hCipherKey, &header.cipherTextDetails.iv[0]); - Reference decrypted = decryptor.decrypt(encrypted->begin(), bufLen, header, arena); - - ASSERT_EQ(decrypted->getLogicalSize(), bufLen); - ASSERT_EQ(memcmp(decrypted->begin(), &orgData[0], bufLen), 0); - - TraceEvent("BlobCipherTest_DecryptDone").log(); - - // induce encryption header corruption - headerVersion corrupted - encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - memcpy(reinterpret_cast(&headerCopy), - reinterpret_cast(&header), - sizeof(BlobCipherEncryptHeader)); - headerCopy.flags.headerVersion += 1; - try { - DecryptBlobCipherAes256Ctr decryptor(tCipherKeyKey, hCipherKey, &header.cipherTextDetails.iv[0]); - decrypted = decryptor.decrypt(encrypted->begin(), bufLen, headerCopy, arena); - ASSERT(false); // error expected - } catch (Error& e) { - if (e.code() != error_code_encrypt_header_metadata_mismatch) { - throw; - } - } - - // induce encryption header corruption - encryptionMode corrupted - encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - memcpy(reinterpret_cast(&headerCopy), - reinterpret_cast(&header), - sizeof(BlobCipherEncryptHeader)); - headerCopy.flags.encryptMode += 1; - try { - DecryptBlobCipherAes256Ctr decryptor(tCipherKeyKey, hCipherKey, &header.cipherTextDetails.iv[0]); - decrypted = decryptor.decrypt(encrypted->begin(), bufLen, headerCopy, arena); - ASSERT(false); // error expected - } catch (Error& e) { - if (e.code() != error_code_encrypt_header_metadata_mismatch) { - throw; - } - } - - // induce encryption header corruption - authToken mismatch - encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - memcpy(reinterpret_cast(&headerCopy), - reinterpret_cast(&header), - sizeof(BlobCipherEncryptHeader)); - int hIdx = deterministicRandom()->randomInt(0, AUTH_TOKEN_SIZE - 1); - headerCopy.singleAuthToken.authToken[hIdx] += 1; - try { - DecryptBlobCipherAes256Ctr decryptor(tCipherKeyKey, hCipherKey, &header.cipherTextDetails.iv[0]); - decrypted = decryptor.decrypt(encrypted->begin(), bufLen, headerCopy, arena); - ASSERT(false); // error expected - } catch (Error& e) { - if (e.code() != error_code_encrypt_header_authtoken_mismatch) { - throw; - } - } - - // induce encrypted buffer payload corruption - try { - encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - uint8_t temp[bufLen]; - memcpy(encrypted->begin(), &temp[0], bufLen); - int tIdx = deterministicRandom()->randomInt(0, bufLen - 1); - temp[tIdx] += 1; - DecryptBlobCipherAes256Ctr decryptor(tCipherKeyKey, hCipherKey, &header.cipherTextDetails.iv[0]); - decrypted = decryptor.decrypt(&temp[0], bufLen, header, arena); - } catch (Error& e) { - if (e.code() != error_code_encrypt_header_authtoken_mismatch) { - throw; - } - } - - TraceEvent("SingleAuthMode_Done").log(); - } - - // validate basic encrypt followed by decrypt operation for AUTH_TOKEN_MODE_MULTI - { - TraceEvent("MultiAuthMode_Start").log(); - - EncryptBlobCipherAes265Ctr encryptor( - cipherKey, headerCipherKey, iv, AES_256_IV_LENGTH, ENCRYPT_HEADER_AUTH_TOKEN_MODE_MULTI); - BlobCipherEncryptHeader header; - Reference encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - - ASSERT_EQ(encrypted->getLogicalSize(), bufLen); - ASSERT_NE(memcmp(&orgData[0], encrypted->begin(), bufLen), 0); - ASSERT_EQ(header.flags.headerVersion, EncryptBlobCipherAes265Ctr::ENCRYPT_HEADER_VERSION); - ASSERT_EQ(header.flags.encryptMode, ENCRYPT_CIPHER_MODE_AES_256_CTR); - ASSERT_EQ(header.flags.authTokenMode, ENCRYPT_HEADER_AUTH_TOKEN_MODE_MULTI); - - TraceEvent("BlobCipherTest_EncryptDone") - .detail("HeaderVersion", header.flags.headerVersion) - .detail("HeaderEncryptMode", header.flags.encryptMode) - .detail("DomainId", header.cipherTextDetails.encryptDomainId) - .detail("BaseCipherId", header.cipherTextDetails.baseCipherId) - .detail("HeaderAuthToken", - StringRef(arena, &header.singleAuthToken.authToken[0], AUTH_TOKEN_SIZE).toString()); - - Reference tCipherKey = cipherKeyCache.getCipherKey(header.cipherTextDetails.encryptDomainId, - header.cipherTextDetails.baseCipherId); - Reference hCipherKey = cipherKeyCache.getCipherKey(header.cipherHeaderDetails.encryptDomainId, - header.cipherHeaderDetails.baseCipherId); - - ASSERT(tCipherKey->isEqual(cipherKey)); - DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, &header.cipherTextDetails.iv[0]); - Reference decrypted = decryptor.decrypt(encrypted->begin(), bufLen, header, arena); - - ASSERT_EQ(decrypted->getLogicalSize(), bufLen); - ASSERT_EQ(memcmp(decrypted->begin(), &orgData[0], bufLen), 0); - - TraceEvent("BlobCipherTest_DecryptDone").log(); - - // induce encryption header corruption - headerVersion corrupted - encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - memcpy(reinterpret_cast(&headerCopy), - reinterpret_cast(&header), - sizeof(BlobCipherEncryptHeader)); - headerCopy.flags.headerVersion += 1; - try { - DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, &header.cipherTextDetails.iv[0]); - decrypted = decryptor.decrypt(encrypted->begin(), bufLen, headerCopy, arena); - ASSERT(false); // error expected - } catch (Error& e) { - if (e.code() != error_code_encrypt_header_metadata_mismatch) { - throw; - } - } - - // induce encryption header corruption - encryptionMode corrupted - encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - memcpy(reinterpret_cast(&headerCopy), - reinterpret_cast(&header), - sizeof(BlobCipherEncryptHeader)); - headerCopy.flags.encryptMode += 1; - try { - DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, &header.cipherTextDetails.iv[0]); - decrypted = decryptor.decrypt(encrypted->begin(), bufLen, headerCopy, arena); - ASSERT(false); // error expected - } catch (Error& e) { - if (e.code() != error_code_encrypt_header_metadata_mismatch) { - throw; - } - } - - // induce encryption header corruption - cipherText authToken mismatch - encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - memcpy(reinterpret_cast(&headerCopy), - reinterpret_cast(&header), - sizeof(BlobCipherEncryptHeader)); - int hIdx = deterministicRandom()->randomInt(0, AUTH_TOKEN_SIZE - 1); - headerCopy.multiAuthTokens.cipherTextAuthToken[hIdx] += 1; - try { - DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, &header.cipherTextDetails.iv[0]); - decrypted = decryptor.decrypt(encrypted->begin(), bufLen, headerCopy, arena); - ASSERT(false); // error expected - } catch (Error& e) { - if (e.code() != error_code_encrypt_header_authtoken_mismatch) { - throw; - } - } - - // induce encryption header corruption - header authToken mismatch - encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - memcpy(reinterpret_cast(&headerCopy), - reinterpret_cast(&header), - sizeof(BlobCipherEncryptHeader)); - hIdx = deterministicRandom()->randomInt(0, AUTH_TOKEN_SIZE - 1); - headerCopy.multiAuthTokens.headerAuthToken[hIdx] += 1; - try { - DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, &header.cipherTextDetails.iv[0]); - decrypted = decryptor.decrypt(encrypted->begin(), bufLen, headerCopy, arena); - ASSERT(false); // error expected - } catch (Error& e) { - if (e.code() != error_code_encrypt_header_authtoken_mismatch) { - throw; - } - } - - try { - encrypted = encryptor.encrypt(&orgData[0], bufLen, &header, arena); - uint8_t temp[bufLen]; - memcpy(encrypted->begin(), &temp[0], bufLen); - int tIdx = deterministicRandom()->randomInt(0, bufLen - 1); - temp[tIdx] += 1; - DecryptBlobCipherAes256Ctr decryptor(tCipherKey, hCipherKey, &header.cipherTextDetails.iv[0]); - decrypted = decryptor.decrypt(&temp[0], bufLen, header, arena); - } catch (Error& e) { - if (e.code() != error_code_encrypt_header_authtoken_mismatch) { - throw; - } - } - - TraceEvent("MultiAuthMode_Done").log(); - } - - // Validate dropping encyrptDomainId cached keys - const EncryptCipherDomainId candidate = deterministicRandom()->randomInt(minDomainId, maxDomainId); - cipherKeyCache.resetEncyrptDomainId(candidate); - std::vector> cachedKeys = cipherKeyCache.getAllCiphers(candidate); - ASSERT(cachedKeys.empty()); - - // Validate dropping all cached cipherKeys - cipherKeyCache.cleanup(); - for (int dId = minDomainId; dId < maxDomainId; dId++) { - std::vector> cachedKeys = cipherKeyCache.getAllCiphers(dId); - ASSERT(cachedKeys.empty()); - } - - TraceEvent("BlobCipherTest_Done").log(); - return Void(); -} - -#endif // ENCRYPTION_ENABLED diff --git a/src/flow/BlobCipher.h b/src/flow/BlobCipher.h deleted file mode 100644 index 8fc0242..0000000 --- a/src/flow/BlobCipher.h +++ /dev/null @@ -1,403 +0,0 @@ -/* - * BlobCipher.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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 - -#include -#include -#include -#include - -#if (!defined(TLS_DISABLED) && !defined(_WIN32)) -#define ENCRYPTION_ENABLED 1 -#else -#define ENCRYPTION_ENABLED 0 -#endif - -#if ENCRYPTION_ENABLED - -#include "flow/Arena.h" -#include "flow/EncryptUtils.h" -#include "flow/FastRef.h" -#include "flow/flow.h" -#include "flow/xxhash.h" - -#include -#include -#include -#include -#include - -#define AES_256_KEY_LENGTH 32 -#define AES_256_IV_LENGTH 16 - -// Encryption operations buffer management -// Approach limits number of copies needed during encryption or decryption operations. -// For encryption EncryptBuf is allocated using client supplied Arena and provided to AES library to capture -// the ciphertext. Similarly, on decryption EncryptBuf is allocated using client supplied Arena and provided -// to the AES library to capture decipher text and passed back to the clients. Given the object passed around -// is reference-counted, it gets freed once refrenceCount goes to 0. - -class EncryptBuf : public ReferenceCounted, NonCopyable { -public: - EncryptBuf(int size, Arena& arena) : allocSize(size), logicalSize(size) { - if (size > 0) { - buffer = new (arena) uint8_t[size]; - } else { - buffer = nullptr; - } - } - - int getLogicalSize() { return logicalSize; } - void setLogicalSize(int value) { - ASSERT(value <= allocSize); - logicalSize = value; - } - uint8_t* begin() { return buffer; } - -private: - int allocSize; - int logicalSize; - uint8_t* buffer; -}; - -// BlobCipher Encryption header format -// This header is persisted along with encrypted buffer, it contains information necessary -// to assist decrypting the buffers to serve read requests. -// -// The total space overhead is 96 bytes. - -#pragma pack(push, 1) // exact fit - no padding -typedef struct BlobCipherEncryptHeader { - static constexpr int headerSize = 96; - union { - struct { - uint8_t size; // reading first byte is sufficient to determine header - // length. ALWAYS THE FIRST HEADER ELEMENT. - uint8_t headerVersion{}; - uint8_t encryptMode{}; - uint8_t authTokenMode{}; - uint8_t _reserved[4]{}; - } flags; - uint64_t _padding{}; - }; - - // Cipher text encryption information - struct { - // Encyrption domain boundary identifier. - EncryptCipherDomainId encryptDomainId{}; - // BaseCipher encryption key identifier - EncryptCipherBaseKeyId baseCipherId{}; - // Random salt - EncryptCipherRandomSalt salt{}; - // Initialization vector used to encrypt the payload. - uint8_t iv[AES_256_IV_LENGTH]; - } cipherTextDetails; - - struct { - // Encryption domainId for the header - EncryptCipherDomainId encryptDomainId{}; - // BaseCipher encryption key identifier. - EncryptCipherBaseKeyId baseCipherId{}; - } cipherHeaderDetails; - - // Encryption header is stored as plaintext on a persistent storage to assist reconstruction of cipher-key(s) for - // reads. FIPS compliance recommendation is to leverage cryptographic digest mechanism to generate 'authentication - // token' (crypto-secure) to protect against malicious tampering and/or bit rot/flip scenarios. - - union { - // Encryption header support two modes of generation 'authentication tokens': - // 1) SingleAuthTokenMode: the scheme generates single crypto-secrure auth token to protect {cipherText + - // header} payload. Scheme is geared towards optimizing cost due to crypto-secure auth-token generation, - // however, on decryption client needs to be read 'header' + 'encrypted-buffer' to validate the 'auth-token'. - // The scheme is ideal for usecases where payload represented by the encryptionHeader is not large and it is - // desirable to minimize CPU/latency penalty due to crypto-secure ops, such as: CommitProxies encrypted inline - // transactions, StorageServer encrypting pages etc. 2) MultiAuthTokenMode: Scheme generates separate authTokens - // for 'encrypted buffer' & 'encryption-header'. The scheme is ideal where payload represented by - // encryptionHeader is large enough such that it is desirable to optimize cost of upfront reading full - // 'encrypted buffer', compared to reading only encryptionHeader and ensuring its sanity; for instance: - // backup-files. - - struct { - // Cipher text authentication token - uint8_t cipherTextAuthToken[AUTH_TOKEN_SIZE]{}; - uint8_t headerAuthToken[AUTH_TOKEN_SIZE]{}; - } multiAuthTokens; - struct { - uint8_t authToken[AUTH_TOKEN_SIZE]{}; - uint8_t _reserved[AUTH_TOKEN_SIZE]{}; - } singleAuthToken; - }; - - BlobCipherEncryptHeader() {} -} BlobCipherEncryptHeader; -#pragma pack(pop) - -// Ensure no struct-packing issues -static_assert(sizeof(BlobCipherEncryptHeader) == BlobCipherEncryptHeader::headerSize, - "BlobCipherEncryptHeader size mismatch"); - -// This interface is in-memory representation of CipherKey used for encryption/decryption information. -// It caches base encryption key properties as well as caches the 'derived encryption' key obtained by applying -// HMAC-SHA-256 derivation technique. - -class BlobCipherKey : public ReferenceCounted, NonCopyable { -public: - BlobCipherKey(const EncryptCipherDomainId& domainId, - const EncryptCipherBaseKeyId& baseCiphId, - const uint8_t* baseCiph, - int baseCiphLen); - - uint8_t* data() const { return cipher.get(); } - uint64_t getCreationTime() const { return creationTime; } - EncryptCipherDomainId getDomainId() const { return encryptDomainId; } - EncryptCipherRandomSalt getSalt() const { return randomSalt; } - EncryptCipherBaseKeyId getBaseCipherId() const { return baseCipherId; } - int getBaseCipherLen() const { return baseCipherLen; } - uint8_t* rawCipher() const { return cipher.get(); } - uint8_t* rawBaseCipher() const { return baseCipher.get(); } - bool isEqual(const Reference toCompare) { - return encryptDomainId == toCompare->getDomainId() && baseCipherId == toCompare->getBaseCipherId() && - randomSalt == toCompare->getSalt() && baseCipherLen == toCompare->getBaseCipherLen() && - memcmp(cipher.get(), toCompare->rawCipher(), AES_256_KEY_LENGTH) == 0 && - memcmp(baseCipher.get(), toCompare->rawBaseCipher(), baseCipherLen) == 0; - } - void reset(); - -private: - // Encryption domain boundary identifier - EncryptCipherDomainId encryptDomainId; - // Base encryption cipher key properties - std::unique_ptr baseCipher; - int baseCipherLen; - EncryptCipherBaseKeyId baseCipherId; - // Random salt used for encryption cipher key derivation - EncryptCipherRandomSalt randomSalt; - // Creation timestamp for the derived encryption cipher key - uint64_t creationTime; - // Derived encryption cipher key - std::unique_ptr cipher; - - void initKey(const EncryptCipherDomainId& domainId, - const uint8_t* baseCiph, - int baseCiphLen, - const EncryptCipherBaseKeyId& baseCiphId, - const EncryptCipherRandomSalt& salt); - void applyHmacSha256Derivation(); -}; - -// This interface allows FDB processes participating in encryption to store and -// index recently used encyption cipher keys. FDB encryption has two dimensions: -// 1. Mapping on cipher encryption keys per "encryption domains" -// 2. Per encryption domain, the cipher keys are index using "baseCipherKeyId". -// -// The design supports NIST recommendation of limiting lifetime of an encryption -// key. For details refer to: -// https://csrc.nist.gov/publications/detail/sp/800-57-part-1/rev-3/archive/2012-07-10 -// -// Below gives a pictoral representation of in-memory datastructure implemented -// to index encryption keys: -// { encryptionDomain -> { baseCipherId -> cipherKey } } -// -// Supported cache lookups schemes: -// 1. Lookup cipher based on { encryptionDomainId, baseCipherKeyId } tuple. -// 2. Lookup latest cipher key for a given encryptionDomainId. -// -// Client is responsible to handle cache-miss usecase, the corrective operation -// might vary based on the calling process, for instance: EncryptKeyServer -// cache-miss shall invoke RPC to external Encryption Key Manager to fetch the -// required encryption key, however, CPs/SSs cache-miss would result in RPC to -// EncryptKeyServer to refresh the desired encryption key. - -using BlobCipherKeyIdCacheMap = std::unordered_map>; -using BlobCipherKeyIdCacheMapCItr = - std::unordered_map>::const_iterator; - -struct BlobCipherKeyIdCache : ReferenceCounted { -public: - BlobCipherKeyIdCache(); - explicit BlobCipherKeyIdCache(EncryptCipherDomainId dId); - - // API returns the last inserted cipherKey. - // If none exists, 'encrypt_key_not_found' is thrown. - - Reference getLatestCipherKey(); - - // API returns cipherKey corresponding to input 'baseCipherKeyId'. - // If none exists, 'encrypt_key_not_found' is thrown. - - Reference getCipherByBaseCipherId(EncryptCipherBaseKeyId baseCipherKeyId); - - // API enables inserting base encryption cipher details to the BlobCipherKeyIdCache. - // Given cipherKeys are immutable, attempting to re-insert same 'identical' cipherKey - // is treated as a NOP (success), however, an attempt to update cipherKey would throw - // 'encrypt_update_cipher' exception. - - void insertBaseCipherKey(EncryptCipherBaseKeyId baseCipherId, const uint8_t* baseCipher, int baseCipherLen); - - // API cleanup the cache by dropping all cached cipherKeys - void cleanup(); - - // API returns list of all 'cached' cipherKeys - std::vector> getAllCipherKeys(); - -private: - EncryptCipherDomainId domainId; - BlobCipherKeyIdCacheMap keyIdCache; - EncryptCipherBaseKeyId latestBaseCipherKeyId; -}; - -using BlobCipherDomainCacheMap = std::unordered_map>; - -class BlobCipherKeyCache : NonCopyable { -public: - // Enable clients to insert base encryption cipher details to the BlobCipherKeyCache. - // The cipherKeys are indexed using 'baseCipherId', given cipherKeys are immutable, - // attempting to re-insert same 'identical' cipherKey is treated as a NOP (success), - // however, an attempt to update cipherKey would throw 'encrypt_update_cipher' exception. - - void insertCipherKey(const EncryptCipherDomainId& domainId, - const EncryptCipherBaseKeyId& baseCipherId, - const uint8_t* baseCipher, - int baseCipherLen); - // API returns the last insert cipherKey for a given encyryption domain Id. - // If none exists, it would throw 'encrypt_key_not_found' exception. - - Reference getLatestCipherKey(const EncryptCipherDomainId& domainId); - - // API returns cipherKey corresponding to {encryptionDomainId, baseCipherId} tuple. - // If none exists, it would throw 'encrypt_key_not_found' exception. - - Reference getCipherKey(const EncryptCipherDomainId& domainId, - const EncryptCipherBaseKeyId& baseCipherId); - // API returns point in time list of all 'cached' cipherKeys for a given encryption domainId. - std::vector> getAllCiphers(const EncryptCipherDomainId& domainId); - - // API enables dropping all 'cached' cipherKeys for a given encryption domain Id. - // Useful to cleanup cache if an encryption domain gets removed/destroyed etc. - - void resetEncyrptDomainId(const EncryptCipherDomainId domainId); - - static BlobCipherKeyCache& getInstance() { - static BlobCipherKeyCache instance; - return instance; - } - // Ensures cached encryption key(s) (plaintext) never gets persisted as part - // of FDB process/core dump. - static void cleanup() noexcept; - -private: - BlobCipherDomainCacheMap domainCacheMap; - static constexpr uint64_t CIPHER_KEY_CACHE_TTL_SEC = 10 * 60L; - - BlobCipherKeyCache() {} -}; - -// This interface enables data block encryption. An invocation to encrypt() will -// do two things: -// 1) generate encrypted ciphertext for given plaintext input. -// 2) generate BlobCipherEncryptHeader (including the 'header authTokens') and persit for decryption on reads. - -class EncryptBlobCipherAes265Ctr final : NonCopyable, public ReferenceCounted { -public: - static constexpr uint8_t ENCRYPT_HEADER_VERSION = 1; - - EncryptBlobCipherAes265Ctr(Reference tCipherKey, - Reference hCipherKey, - const uint8_t* iv, - const int ivLen, - const EncryptAuthTokenMode mode); - ~EncryptBlobCipherAes265Ctr(); - - Reference encrypt(const uint8_t* plaintext, - const int plaintextLen, - BlobCipherEncryptHeader* header, - Arena&); - -private: - EVP_CIPHER_CTX* ctx; - Reference textCipherKey; - Reference headerCipherKey; - EncryptAuthTokenMode authTokenMode; - uint8_t iv[AES_256_IV_LENGTH]; -}; - -// This interface enable data block decryption. An invocation to decrypt() would generate -// 'plaintext' for a given 'ciphertext' input, the caller needs to supply BlobCipherEncryptHeader. - -class DecryptBlobCipherAes256Ctr final : NonCopyable, public ReferenceCounted { -public: - DecryptBlobCipherAes256Ctr(Reference tCipherKey, - Reference hCipherKey, - const uint8_t* iv); - ~DecryptBlobCipherAes256Ctr(); - - Reference decrypt(const uint8_t* ciphertext, - const int ciphertextLen, - const BlobCipherEncryptHeader& header, - Arena&); - - // Enable caller to validate encryption header auth-token (if available) without needing to read the full encyrpted - // payload. The call is NOP unless header.flags.authTokenMode == ENCRYPT_HEADER_AUTH_TOKEN_MODE_MULTI. - - void verifyHeaderAuthToken(const BlobCipherEncryptHeader& header, Arena& arena); - -private: - EVP_CIPHER_CTX* ctx; - Reference textCipherKey; - Reference headerCipherKey; - bool headerAuthTokenValidationDone; - bool authTokensValidationDone; - - void verifyEncryptHeaderMetadata(const BlobCipherEncryptHeader& header); - void verifyAuthTokens(const uint8_t* ciphertext, - const int ciphertextLen, - const BlobCipherEncryptHeader& header, - uint8_t* buff, - Arena& arena); - void verifyHeaderSingleAuthToken(const uint8_t* ciphertext, - const int ciphertextLen, - const BlobCipherEncryptHeader& header, - uint8_t* buff, - Arena& arena); - void verifyHeaderMultiAuthToken(const uint8_t* ciphertext, - const int ciphertextLen, - const BlobCipherEncryptHeader& header, - uint8_t* buff, - Arena& arena); -}; - -class HmacSha256DigestGen final : NonCopyable { -public: - HmacSha256DigestGen(const unsigned char* key, size_t len); - ~HmacSha256DigestGen(); - HMAC_CTX* getCtx() const { return ctx; } - StringRef digest(unsigned char const* data, size_t len, Arena&); - -private: - HMAC_CTX* ctx; -}; - -StringRef computeAuthToken(const uint8_t* payload, - const int payloadLen, - const uint8_t* key, - const int keyLen, - Arena& arena); - -#endif // ENCRYPTION_ENABLED diff --git a/src/flow/CMakeLists.txt b/src/flow/CMakeLists.txt index c1d7615..c893efe 100644 --- a/src/flow/CMakeLists.txt +++ b/src/flow/CMakeLists.txt @@ -4,9 +4,15 @@ add_library(flow STATIC ${FLOW_SRC}) target_link_libraries(flow PRIVATE Boost::headers + Boost::filesystem fmt::fmt absl::debugging OpenSSL::SSL OpenSSL::Crypto + crc32 + SimpleOpt ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) \ No newline at end of file +target_include_directories(flow PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include) + +make_directory(${CMAKE_CURRENT_BINARY_DIR}/include/flow) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/include/flow/config.h) \ No newline at end of file diff --git a/src/flow/CodeProbe.cpp b/src/flow/CodeProbe.cpp new file mode 100644 index 0000000..0a4d391 --- /dev/null +++ b/src/flow/CodeProbe.cpp @@ -0,0 +1,293 @@ +/* + * CodeProbe.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "flow/CodeProbe.h" +#include "flow/CodeProbeUtils.h" +#include "flow/Arena.h" +#include "flow/network.h" + +#include +#include +#include +#include +#include + +namespace probe { + +namespace { + +std::vector fromStrings(std::vector const& ctxs) { + std::vector res; + for (auto const& ctx : ctxs) { + std::string c; + c.reserve(ctx.size()); + std::transform(ctx.begin(), ctx.end(), std::back_inserter(c), [](char c) { return std::tolower(c); }); + if (c == "all") { + res.push_back(ExecutionContext::Net2); + res.push_back(ExecutionContext::Simulation); + } else if (c == "simulation") { + res.push_back(ExecutionContext::Simulation); + } else if (c == "net2") { + res.push_back(ExecutionContext::Net2); + } else { + throw invalid_option_value(); + } + } + std::sort(res.begin(), res.end()); + res.erase(std::unique(res.begin(), res.end()), res.end()); + return res; +} + +std::string_view normalizePath(const char* path) { + std::string_view srcBase(FDB_SOURCE_DIR); + std::string_view binBase(FDB_SOURCE_DIR); + std::string_view filename(path); + if (srcBase.size() < filename.size() && filename.substr(0, srcBase.size()) == srcBase) { + filename.remove_prefix(srcBase.size()); + } else if (binBase.size() < filename.size() && filename.substr(0, binBase.size()) == binBase) { + filename.remove_prefix(binBase.size()); + } + if (filename[0] == '/') { + filename.remove_prefix(1); + } + return filename; +} + +struct CodeProbes { + struct Location { + std::string_view file; + unsigned line; + Location(std::string_view file, unsigned line) : file(file), line(line) {} + bool operator==(Location const& rhs) const { return line == rhs.line && file == rhs.file; } + bool operator!=(Location const& rhs) const { return line != rhs.line && file != rhs.file; } + bool operator<(Location const& rhs) const { + if (file < rhs.file) { + return true; + } else if (file == rhs.file) { + return line < rhs.line; + } else { + return false; + } + } + bool operator<=(Location const& rhs) const { + if (file < rhs.file) { + return true; + } else if (file == rhs.file) { + return line <= rhs.line; + } else { + return false; + } + } + bool operator>(Location const& rhs) const { return rhs < *this; } + bool operator>=(Location const& rhs) const { return rhs <= *this; } + }; + + std::multimap codeProbes; + + void traceMissedProbes(Optional context) const; + + void add(ICodeProbe const* probe) { + Location loc(probe->filename(), probe->line()); + codeProbes.emplace(loc, probe); + } + + static CodeProbes& instance() { + static CodeProbes probes; + return probes; + } + + void verify() const { + std::map, ICodeProbe const*> comments; + for (auto probe : codeProbes) { + auto file = probe.first.file; + auto comment = probe.second->comment(); + auto commentEntry = std::make_pair(file, std::string_view(comment)); + ASSERT(file == probe.second->filename()); + auto iter = comments.find(commentEntry); + if (iter != comments.end() && probe.second->line() != iter->second->line()) { + fmt::print("ERROR ({}:{}): {} isn't unique in file {}. Previously seen here: {}:{}\n", + probe.first.file, + probe.first.line, + iter->first.second, + probe.second->filename(), + iter->second->filename(), + iter->second->line()); + // ICodeProbe const& fst = *iter->second; + // ICodeProbe const& snd = *probe.second; + // fmt::print("\t1st Type: {}\n", boost::core::demangle(typeid(fst).name())); + // fmt::print("\t2nd Type: {}\n", boost::core::demangle(typeid(snd).name())); + // fmt::print("\n"); + // fmt::print("\t1st Comment: {}\n", fst.comment()); + // fmt::print("\t2nd Comment: {}\n", snd.comment()); + // fmt::print("\n"); + // fmt::print("\t1st CompUnit: {}\n", fst.compilationUnit()); + // fmt::print("\t2nd CompUnit: {}\n", snd.compilationUnit()); + // fmt::print("\n"); + } else { + comments.emplace(commentEntry, probe.second); + } + } + } + + void printXML() const { + verify(); + fmt::print("\n"); + fmt::print("\n"); + if (codeProbes.empty()) { + fmt::print("\t\n"); + fmt::print("\t\n"); + } else { + std::vector files; + fmt::print("\t\n"); + for (auto probe : codeProbes) { + files.push_back(probe.first.file); + fmt::print("\t\t\n", + probe.first.file, + probe.first.line, + probe.second->comment(), + probe.second->condition()); + } + fmt::print("\t\n"); + fmt::print("\t\n"); + for (auto const& f : files) { + fmt::print("\t\t{}\n", f); + } + fmt::print("\t\n"); + } + fmt::print("\n"); + } + + void printJSON(std::vector const& context = std::vector()) const { + verify(); + do { + struct foo {}; + foo f; + fmt::print("{}\n", boost::core::demangle(typeid(f).name())); + } while (false); + do { + struct foo {}; + foo f; + fmt::print("{}\n", boost::core::demangle(typeid(f).name())); + } while (false); + auto contexts = fromStrings(context); + const ICodeProbe* prev = nullptr; + for (auto probe : codeProbes) { + auto p = probe.second; + if (!contexts.empty()) { + bool print = false; + for (auto c : contexts) { + print = print || p->expectInContext(c); + } + if (!print) { + continue; + } + } + if (prev == nullptr || *prev != *probe.second) { + fmt::print( + "{{ \"File\": \"{}\", \"Line\": {}, \"Comment\": \"{}\", \"Condition\": \"{}\", \"Function\": " + "\"{}\" }}\n", + probe.first.file, + p->line(), + p->comment(), + p->condition(), + p->function()); + } + prev = probe.second; + } + } +}; + +size_t hash_value(CodeProbes::Location const& location) { + size_t seed = 0; + boost::hash_combine(seed, location.file); + boost::hash_combine(seed, location.line); + return seed; +} + +void CodeProbes::traceMissedProbes(Optional context) const { + boost::unordered_map locations; + for (auto probe : codeProbes) { + decltype(locations.begin()) iter; + std::tie(iter, std::ignore) = locations.emplace(probe.first, false); + iter->second = iter->second || probe.second->wasHit(); + } + for (const auto& [loc, probe] : codeProbes) { + auto iter = locations.find(loc); + ASSERT(iter != locations.end()); + if (!iter->second && probe->shouldTrace()) { + iter->second = true; + probe->trace(false); + } + } +} + +} // namespace + +std::string functionNameFromInnerType(const char* name) { + auto res = boost::core::demangle(name); + auto pos = res.find_last_of(':'); + ASSERT(pos != res.npos); + return res.substr(0, pos - 1); +} + +void registerProbe(const ICodeProbe& probe) { + CodeProbes::instance().add(&probe); +} + +void traceMissedProbes(Optional context) { + CodeProbes::instance().traceMissedProbes(context); +} + +ICodeProbe::~ICodeProbe() {} + +bool ICodeProbe::operator==(const ICodeProbe& other) const { + return filename() == other.filename() && line() == other.line(); +} + +bool ICodeProbe::operator!=(const ICodeProbe& other) const { + return !(*this == other); +} + +std::string_view ICodeProbe::filename() const { + return normalizePath(filePath()); +} + +void ICodeProbe::printProbesXML() { + CodeProbes::instance().printXML(); +} + +void ICodeProbe::printProbesJSON(std::vector const& ctxs) { + CodeProbes::instance().printJSON(ctxs); +} + +// annotations +namespace assert { + +bool NoSim::operator()(ICodeProbe const* self) const { + return !g_network->isSimulated(); +} + +bool SimOnly::operator()(ICodeProbe const* self) const { + return g_network->isSimulated(); +} + +} // namespace assert + +} // namespace probe diff --git a/src/flow/CompressedInt.actor.cpp b/src/flow/CompressedInt.actor.cpp index ef889cf..0081f79 100644 --- a/src/flow/CompressedInt.actor.cpp +++ b/src/flow/CompressedInt.actor.cpp @@ -86,12 +86,12 @@ void testCompressedInt(IntType n, StringRef rep = StringRef()) { } TEST_CASE("/flow/compressed_ints") { - testCompressedInt(-2, LiteralStringRef("\x7e")); - testCompressedInt(-1, LiteralStringRef("\x7f")); - testCompressedInt(0, LiteralStringRef("\x80")); - testCompressedInt(1, LiteralStringRef("\x81")); - testCompressedInt(2, LiteralStringRef("\x82")); - testCompressedInt(0x4000000000000000, LiteralStringRef("\xFF\xC0\x40\x00\x00\x00\x00\x00\x00\x00")); + testCompressedInt(-2, "\x7e"_sr); + testCompressedInt(-1, "\x7f"_sr); + testCompressedInt(0, "\x80"_sr); + testCompressedInt(1, "\x81"_sr); + testCompressedInt(2, "\x82"_sr); + testCompressedInt(0x4000000000000000, "\xFF\xC0\x40\x00\x00\x00\x00\x00\x00\x00"_sr); int64_t n = 0; for (int i = 0; i < 10000000; ++i) { diff --git a/src/flow/CompressedInt.actor.g.cpp b/src/flow/CompressedInt.actor.g.cpp index 0410196..f339a52 100644 --- a/src/flow/CompressedInt.actor.g.cpp +++ b/src/flow/CompressedInt.actor.g.cpp @@ -115,17 +115,17 @@ class FlowTestCase88ActorState { { try { #line 89 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/CompressedInt.actor.cpp" - testCompressedInt(-2, LiteralStringRef("\x7e")); + testCompressedInt(-2, "\x7e"_sr); #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/CompressedInt.actor.cpp" - testCompressedInt(-1, LiteralStringRef("\x7f")); + testCompressedInt(-1, "\x7f"_sr); #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/CompressedInt.actor.cpp" - testCompressedInt(0, LiteralStringRef("\x80")); + testCompressedInt(0, "\x80"_sr); #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/CompressedInt.actor.cpp" - testCompressedInt(1, LiteralStringRef("\x81")); + testCompressedInt(1, "\x81"_sr); #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/CompressedInt.actor.cpp" - testCompressedInt(2, LiteralStringRef("\x82")); + testCompressedInt(2, "\x82"_sr); #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/CompressedInt.actor.cpp" - testCompressedInt(0x4000000000000000, LiteralStringRef("\xFF\xC0\x40\x00\x00\x00\x00\x00\x00\x00")); + testCompressedInt(0x4000000000000000, "\xFF\xC0\x40\x00\x00\x00\x00\x00\x00\x00"_sr); #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/CompressedInt.actor.cpp" int64_t n = 0; #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/CompressedInt.actor.cpp" diff --git a/src/flow/CompressionUtils.cpp b/src/flow/CompressionUtils.cpp new file mode 100644 index 0000000..554effc --- /dev/null +++ b/src/flow/CompressionUtils.cpp @@ -0,0 +1,209 @@ +/* + * CompressionUtils.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "flow/CompressionUtils.h" + +#include "flow/Arena.h" +#include "flow/Error.h" +#include "flow/IRandom.h" +#include "flow/UnitTest.h" + +#ifdef ZSTD_LIB_SUPPORTED +#define ZSTD_STATIC_LINKING_ONLY +#include +static constexpr int ZSTD_COMPRESSION_LEVEL_1 = 1; +#endif + +namespace { +std::unordered_set getSupportedFilters() { + std::unordered_set filters; + + filters.insert(CompressionFilter::NONE); +#ifdef ZSTD_LIB_SUPPORTED + filters.insert(CompressionFilter::ZSTD); +#endif + ASSERT_GE(filters.size(), 1); + return filters; +} +} // namespace + +std::unordered_set CompressionUtils::supportedFilters = getSupportedFilters(); + +StringRef CompressionUtils::compress(const CompressionFilter filter, const StringRef& data, Arena& arena) { + checkFilterSupported(filter); + + if (filter == CompressionFilter::NONE) { + return StringRef(arena, data); + } +#ifdef ZSTD_LIB_SUPPORTED + if (filter == CompressionFilter::ZSTD) { + return CompressionUtils::compress(filter, data, ZSTD_COMPRESSION_LEVEL_1, arena); + } +#endif + + throw internal_error(); // We should never get here +} + +StringRef CompressionUtils::compress(const CompressionFilter filter, const StringRef& data, int level, Arena& arena) { + checkFilterSupported(filter); + + if (filter == CompressionFilter::NONE) { + return StringRef(arena, data); + } +#ifdef ZSTD_LIB_SUPPORTED + if (filter == CompressionFilter::ZSTD) { + const char* src = reinterpret_cast(data.begin()); + size_t destSize = ZSTD_compressBound(data.size()); + std::unique_ptr dest = std::make_unique(destSize); + size_t bytes = ZSTD_compress(dest.get(), destSize, src, data.size(), level); + if (ZSTD_isError(bytes)) { + throw internal_error(); + } + return StringRef(arena, StringRef(dest.get(), bytes)); + } +#endif + throw internal_error(); // We should never get here +} + +StringRef CompressionUtils::decompress(const CompressionFilter filter, const StringRef& data, Arena& arena) { + checkFilterSupported(filter); + + if (filter == CompressionFilter::NONE) { + return StringRef(arena, data); + } +#ifdef ZSTD_LIB_SUPPORTED + if (filter == CompressionFilter::ZSTD) { + const char* src = reinterpret_cast(data.begin()); + size_t destSize = ZSTD_decompressBound(src, data.size()); + std::unique_ptr dest = std::make_unique(destSize); + size_t bytes = ZSTD_decompress(dest.get(), destSize, src, data.size()); + if (ZSTD_isError(bytes)) { + throw internal_error(); + } + return StringRef(arena, StringRef(dest.get(), bytes)); + } +#endif + throw internal_error(); // We should never get here +} + +int CompressionUtils::getDefaultCompressionLevel(CompressionFilter filter) { + checkFilterSupported(filter); + + if (filter == CompressionFilter::NONE) { + return -1; + } + +#ifdef ZSTD_LIB_SUPPORTED + if (filter == CompressionFilter::ZSTD) { + // optimize for high speed compression, larger levels have a high cpu cost and not much compression ratio + // improvement, according to benchmarks + return ZSTD_COMPRESSION_LEVEL_1; + } +#endif + + throw internal_error(); // We should never get here +} + +CompressionFilter CompressionUtils::getRandomFilter() { + ASSERT_GE(supportedFilters.size(), 1); + std::vector filters; + filters.insert(filters.end(), CompressionUtils::supportedFilters.begin(), CompressionUtils::supportedFilters.end()); + + ASSERT_GE(filters.size(), 1); + + CompressionFilter res; + if (filters.size() == 1) { + res = filters[0]; + } else { + int idx = deterministicRandom()->randomInt(0, filters.size()); + res = filters[idx]; + } + + ASSERT(supportedFilters.find(res) != supportedFilters.end()); + return res; +} + +// Only used to link unit tests +void forceLinkCompressionUtilsTest() {} + +namespace { +void testCompression(CompressionFilter filter) { + Arena arena; + const int size = deterministicRandom()->randomInt(512, 1024); + Standalone uncompressed = makeString(size); + deterministicRandom()->randomBytes(mutateString(uncompressed), size); + + Standalone compressed = CompressionUtils::compress(filter, uncompressed, arena); + ASSERT_NE(compressed.compare(uncompressed), 0); + + StringRef verify = CompressionUtils::decompress(filter, compressed, arena); + ASSERT_EQ(verify.compare(uncompressed), 0); +} + +void testCompression2(CompressionFilter filter) { + Arena arena; + const int size = deterministicRandom()->randomInt(512, 1024); + std::string s(size, 'x'); + Standalone uncompressed = Standalone(StringRef(s)); + printf("Size before: %d\n", (int)uncompressed.size()); + + Standalone compressed = CompressionUtils::compress(filter, uncompressed, arena); + ASSERT_NE(compressed.compare(uncompressed), 0); + printf("Size after: %d\n", (int)compressed.size()); + // Assert compressed size is less than half. + ASSERT(compressed.size() * 2 < uncompressed.size()); + + StringRef verify = CompressionUtils::decompress(filter, compressed, arena); + ASSERT_EQ(verify.compare(uncompressed), 0); +} + +} // namespace + +TEST_CASE("/CompressionUtils/noCompression") { + Arena arena; + const int size = deterministicRandom()->randomInt(512, 1024); + Standalone uncompressed = makeString(size); + deterministicRandom()->randomBytes(mutateString(uncompressed), size); + + Standalone compressed = CompressionUtils::compress(CompressionFilter::NONE, uncompressed, arena); + ASSERT_EQ(compressed.compare(uncompressed), 0); + + StringRef verify = CompressionUtils::decompress(CompressionFilter::NONE, compressed, arena); + ASSERT_EQ(verify.compare(uncompressed), 0); + + TraceEvent("NoCompressionDone"); + + return Void(); +} +#ifdef ZSTD_LIB_SUPPORTED +TEST_CASE("/CompressionUtils/zstdCompression") { + testCompression(CompressionFilter::ZSTD); + TraceEvent("ZstdCompressionDone"); + + return Void(); +} + +TEST_CASE("/CompressionUtils/zstdCompression2") { + testCompression2(CompressionFilter::ZSTD); + TraceEvent("ZstdCompression2Done"); + + return Void(); +} +#endif diff --git a/src/flow/DeterministicRandom.cpp b/src/flow/DeterministicRandom.cpp index 5fff2e0..e17ed70 100644 --- a/src/flow/DeterministicRandom.cpp +++ b/src/flow/DeterministicRandom.cpp @@ -19,6 +19,7 @@ */ #include "fmt/format.h" +#include "flow/Arena.h" #include "flow/DeterministicRandom.h" #include @@ -32,9 +33,7 @@ uint64_t DeterministicRandom::gen64() { } DeterministicRandom::DeterministicRandom(uint32_t seed, bool useRandLog) - : random((unsigned long)seed), next((uint64_t(random()) << 32) ^ random()), useRandLog(useRandLog) { - UNSTOPPABLE_ASSERT(seed != 0); // docs for mersenne twister say x0>0 -}; + : random((unsigned long)seed), next((uint64_t(random()) << 32) ^ random()), useRandLog(useRandLog) {} double DeterministicRandom::random01() { double d = gen64() / double(uint64_t(-1)); @@ -44,7 +43,7 @@ double DeterministicRandom::random01() { } int DeterministicRandom::randomInt(int min, int maxPlusOne) { - ASSERT(min < maxPlusOne); + ASSERT_LT(min, maxPlusOne); unsigned int range; if (maxPlusOne < 0) range = std::abs(maxPlusOne - min); @@ -64,7 +63,7 @@ int DeterministicRandom::randomInt(int min, int maxPlusOne) { } int64_t DeterministicRandom::randomInt64(int64_t min, int64_t maxPlusOne) { - ASSERT(min < maxPlusOne); + ASSERT_LT(min, maxPlusOne); uint64_t range; if (maxPlusOne < 0) range = std::abs(maxPlusOne - min); @@ -92,11 +91,12 @@ uint64_t DeterministicRandom::randomUInt64() { } uint32_t DeterministicRandom::randomSkewedUInt32(uint32_t min, uint32_t maxPlusOne) { - std::uniform_real_distribution distribution(std::log(min), std::log(maxPlusOne - 1)); - double logpower = distribution(random); - uint32_t loguniform = static_cast(std::pow(10, logpower)); - // doubles can be imprecise, so let's make sure we don't violate an edge case. - return std::max(std::min(loguniform, maxPlusOne - 1), min); + ASSERT_LT(min, maxPlusOne); + std::uniform_real_distribution distribution(std::log(std::max(min, 1.0 / M_E)), + std::log(maxPlusOne)); + double exponent = distribution(random); + uint32_t value = static_cast(std::pow(M_E, exponent)); + return std::max(std::min(value, maxPlusOne - 1), min); } UID DeterministicRandom::randomUniqueID() { @@ -124,6 +124,23 @@ std::string DeterministicRandom::randomAlphaNumeric(int length) { return s; } +void DeterministicRandom::randomBytes(uint8_t* buf, int length) { + constexpr const int unitLen = sizeof(decltype(gen64())); + for (int i = 0; i < length; i += unitLen) { + auto val = gen64(); + memcpy(buf + i, &val, std::min(unitLen, length - i)); + } + if (randLog && useRandLog) { + constexpr const int cutOff = 32; + bool tooLong = length > cutOff; + fmt::print(randLog, + "Rbytes[{}] {}{}\n", + length, + StringRef(buf, std::min(cutOff, length)).printable(), + tooLong ? "..." : ""); + } +} + uint64_t DeterministicRandom::peek() const { return next; } @@ -134,10 +151,3 @@ void DeterministicRandom::addref() { void DeterministicRandom::delref() { ReferenceCounted::delref(); } - -void generateRandomData(uint8_t* buffer, int length) { - for (int i = 0; i < length; i += sizeof(uint32_t)) { - uint32_t val = deterministicRandom()->randomUInt32(); - memcpy(&buffer[i], &val, std::min(length - i, (int)sizeof(uint32_t))); - } -} diff --git a/src/flow/EncryptUtils.cpp b/src/flow/EncryptUtils.cpp new file mode 100644 index 0000000..c721b78 --- /dev/null +++ b/src/flow/EncryptUtils.cpp @@ -0,0 +1,138 @@ +/* + * EncryptUtils.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "flow/EncryptUtils.h" +#include "flow/IRandom.h" +#include "flow/Knobs.h" +#include "flow/Trace.h" + +#include +#include + +EncryptCipherMode encryptModeFromString(const std::string& modeStr) { + if (modeStr == "NONE") { + return ENCRYPT_CIPHER_MODE_NONE; + } else if (modeStr == "AES-256-CTR") { + return ENCRYPT_CIPHER_MODE_AES_256_CTR; + } else { + TraceEvent("EncryptModeFromString").log(); + throw not_implemented(); + } +} + +std::string getEncryptDbgTraceKey(std::string_view prefix, + EncryptCipherDomainId domainId, + Optional baseCipherId) { + // Construct the TraceEvent field key ensuring its uniqueness and compliance to TraceEvent field validator and log + // parsing tools + if (baseCipherId.present()) { + boost::format fmter("%s.%lld.%llu"); + return boost::str(boost::format(fmter % prefix % domainId % baseCipherId.get())); + } else { + boost::format fmter("%s.%lld.%s"); + return boost::str(boost::format(fmter % prefix % domainId)); + } +} + +std::string getEncryptDbgTraceKeyWithTS(std::string_view prefix, + EncryptCipherDomainId domainId, + EncryptCipherBaseKeyId baseCipherId, + int64_t refAfterTS, + int64_t expAfterTS) { + // Construct the TraceEvent field key ensuring its uniqueness and compliance to TraceEvent field validator and log + // parsing tools + boost::format fmter("%s.%lld.%llu.%lld.%lld"); + return boost::str(boost::format(fmter % prefix % domainId % baseCipherId % refAfterTS % expAfterTS)); +} + +int getEncryptHeaderAuthTokenSize(int algo) { + switch (algo) { + case ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA: + return 32; + case ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC: + return 16; + default: + throw not_implemented(); + } +} + +bool isEncryptHeaderAuthTokenAlgoValid(const EncryptAuthTokenAlgo algo) { + return algo >= EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_NONE && + algo < EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_LAST; +} + +bool isEncryptHeaderAuthTokenModeValid(const EncryptAuthTokenMode mode) { + return mode >= EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE && + mode < EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_LAST; +} + +bool isEncryptHeaderAuthTokenDetailsValid(const EncryptAuthTokenMode mode, const EncryptAuthTokenAlgo algo) { + if (!isEncryptHeaderAuthTokenModeValid(mode) || !isEncryptHeaderAuthTokenAlgoValid(algo) || + (mode == EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE && + algo != EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_NONE) || + (mode != EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE && + algo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_NONE)) { + return false; + } + return true; +} + +// Routine enables mapping EncryptHeader authTokenAlgo for a given authTokenMode; rules followed are: +// 1. AUTH_TOKEN_NONE overrides authTokenAlgo configuration (as expected) +// 2. AuthToken mode governed by the FLOW_KNOBS->ENCRYPT_HEADER_AUTH_TOKEN_ALGO +EncryptAuthTokenAlgo getAuthTokenAlgoFromMode(const EncryptAuthTokenMode mode) { + EncryptAuthTokenAlgo algo; + + if (mode == EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE) { + // TOKEN_MODE_NONE overrides authTokenAlgo + algo = EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_NONE; + } else { + algo = (EncryptAuthTokenAlgo)FLOW_KNOBS->ENCRYPT_HEADER_AUTH_TOKEN_ALGO; + // Ensure cluster authTokenAlgo sanity + if (algo == EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_NONE) { + TraceEvent(SevWarn, "AuthTokenAlgoMisconfiguration").detail("Algo", algo).detail("Mode", mode); + throw not_implemented(); + } + } + ASSERT(isEncryptHeaderAuthTokenDetailsValid(mode, algo)); + return algo; +} + +EncryptAuthTokenMode getRandomAuthTokenMode() { + return deterministicRandom()->coinflip() ? EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE + : EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE; +} + +EncryptAuthTokenAlgo getRandomAuthTokenAlgo() { + EncryptAuthTokenAlgo algo = deterministicRandom()->coinflip() + ? EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_AES_CMAC + : EncryptAuthTokenAlgo::ENCRYPT_HEADER_AUTH_TOKEN_ALGO_HMAC_SHA; + + return algo; +} + +bool isReservedEncryptDomain(EncryptCipherDomainId domainId) { + return domainId == SYSTEM_KEYSPACE_ENCRYPT_DOMAIN_ID || domainId == ENCRYPT_HEADER_DOMAIN_ID || + domainId == FDB_DEFAULT_ENCRYPT_DOMAIN_ID; +} + +bool isEncryptHeaderDomain(EncryptCipherDomainId domainId) { + return domainId == ENCRYPT_HEADER_DOMAIN_ID; +} \ No newline at end of file diff --git a/src/flow/EncryptUtils.h b/src/flow/EncryptUtils.h deleted file mode 100644 index e386602..0000000 --- a/src/flow/EncryptUtils.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * EncryptUtils.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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. - */ - -#ifndef ENCRYPT_UTILS_H -#define ENCRYPT_UTILS_H -#pragma once - -#include -#include - -#define ENCRYPT_INVALID_DOMAIN_ID 0 -#define ENCRYPT_INVALID_CIPHER_KEY_ID 0 - -#define AUTH_TOKEN_SIZE 16 - -#define SYSTEM_KEYSPACE_ENCRYPT_DOMAIN_ID -1 -#define ENCRYPT_HEADER_DOMAIN_ID -2 - -using EncryptCipherDomainId = int64_t; -using EncryptCipherBaseKeyId = uint64_t; -using EncryptCipherRandomSalt = uint64_t; - -typedef enum { - ENCRYPT_CIPHER_MODE_NONE = 0, - ENCRYPT_CIPHER_MODE_AES_256_CTR = 1, - ENCRYPT_CIPHER_MODE_LAST = 2 -} EncryptCipherMode; - -static_assert(EncryptCipherMode::ENCRYPT_CIPHER_MODE_LAST <= std::numeric_limits::max(), - "EncryptCipherMode value overflow"); - -// EncryptionHeader authentication modes -// 1. NONE - No 'authentication token' generation needed for EncryptionHeader i.e. no protection against header OR -// cipherText 'tampering' and/or bit rot/flip corruptions. -// 2. Single/Multi - Encyrption header would generate one or more 'authentication tokens' to protect the header against -// 'tempering' and/or bit rot/flip corruptions. Refer to BlobCipher.h for detailed usage recommendations. -// 3. LAST - Invalid mode, used for static asserts. - -typedef enum { - ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE = 0, - ENCRYPT_HEADER_AUTH_TOKEN_MODE_SINGLE = 1, - ENCRYPT_HEADER_AUTH_TOKEN_MODE_MULTI = 2, - ENCRYPT_HEADER_AUTH_TOKEN_LAST = 3 // Always the last element -} EncryptAuthTokenMode; - -static_assert(EncryptAuthTokenMode::ENCRYPT_HEADER_AUTH_TOKEN_LAST <= std::numeric_limits::max(), - "EncryptHeaderAuthToken value overflow"); - -#endif diff --git a/src/flow/Error.cpp b/src/flow/Error.cpp index e756fb6..3753812 100644 --- a/src/flow/Error.cpp +++ b/src/flow/Error.cpp @@ -34,8 +34,6 @@ std::set debugErrorSet = std::set{ error_code_platform_error }; #define SHOULD_LOG_ERROR(x) (debugErrorSet.count(x) > 0) #endif -#include - Error Error::fromUnvalidatedCode(int code) { if (code < 0 || code > 30000) { Error e = Error::fromCode(error_code_unknown_error); @@ -77,17 +75,17 @@ Error internal_error_impl(const char* msg, const char* file, int line) { } Error internal_error_impl(const char* a_nm, - long long a, + std::string const& a, const char* op_nm, const char* b_nm, - long long b, + std::string const& b, const char* file, int line) { fprintf(stderr, "Assertion failed @ %s %d:\n", file, line); fprintf(stderr, " expression:\n"); fprintf(stderr, " %s %s %s\n", a_nm, op_nm, b_nm); fprintf(stderr, " expands to:\n"); - fprintf(stderr, " %lld %s %lld\n\n", a, op_nm, b); + fprintf(stderr, " %s %s %s\n\n", a.c_str(), op_nm, b.c_str()); fprintf(stderr, " %s\n", platform::get_backtrace().c_str()); TraceEvent(SevError, "InternalError") @@ -180,11 +178,18 @@ Error Error::asInjectedFault() const { return e; } +AttributeNotFoundError::AttributeNotFoundError(const std::string& missingAttribute_) + : Error(error_code_attribute_not_found), missingAttribute(missingAttribute_) {} + +const std::string& AttributeNotFoundError::getMissingAttribute() const { + return missingAttribute; +} + ErrorCodeTable::ErrorCodeTable() { #define ERROR(name, number, description) \ addCode(number, #name, description); \ enum { Duplicate_Error_Code_##number = 0 }; -#include "error_definitions.h" +#include "flow/error_definitions.h" } void ErrorCodeTable::addCode(int code, const char* name, const char* description) { @@ -199,6 +204,20 @@ void breakpoint_me() { return; } +// FIXME: combine with bindings/c/fdb_c.cpp fdb_error_predicate function +const std::set transactionRetryableErrors = { error_code_not_committed, + error_code_transaction_too_old, + error_code_future_version, + error_code_commit_proxy_memory_limit_exceeded, + error_code_grv_proxy_memory_limit_exceeded, + error_code_process_behind, + error_code_batch_transaction_throttled, + error_code_tag_throttled, + error_code_proxy_tag_throttled, + // maybe committed error + error_code_cluster_version_changed, + error_code_commit_unknown_result }; + TEST_CASE("/flow/AssertTest") { // this is mostly checking bug for bug compatibility with the C integer / sign promotion rules. diff --git a/src/flow/FastAlloc.cpp b/src/flow/FastAlloc.cpp index 03123a5..a105a55 100644 --- a/src/flow/FastAlloc.cpp +++ b/src/flow/FastAlloc.cpp @@ -25,18 +25,18 @@ #include "flow/Error.h" #include "flow/Knobs.h" #include "flow/UnitTest.h" -#include "flow/crc32c.h" +#include "crc32/crc32c.h" #include "flow/flow.h" #include #include #include -// #ifdef WIN32 -// #include -// #undef min -// #undef max -// #endif +#ifdef WIN32 +#include +#undef min +#undef max +#endif #ifdef __linux__ #include @@ -304,8 +304,74 @@ static int64_t getSizeCode(int i) { } #endif +namespace keepalive_allocator { + +namespace detail { + +std::set g_allocatedSet; +std::set g_freedSet; +std::vector> g_wipedSet; +bool g_active = false; + +} // namespace detail + +ActiveScope::ActiveScope() { + // no nested scopes allowed + ASSERT(!detail::g_active); + ASSERT(detail::g_allocatedSet.empty()); + ASSERT(detail::g_freedSet.empty()); + ASSERT(detail::g_wipedSet.empty()); + detail::g_active = true; + // As of writing, TraceEvent uses eventname-based throttling keyed by Standalone, + // which uses Arena and stays allocated after scope. + // Therefore, we disable allocation tracing (e.g. hugeArenaSample()) while this scope is active. + g_allocation_tracing_disabled++; +} + +ActiveScope::~ActiveScope() { + ASSERT_ABORT(detail::g_active); + ASSERT_ABORT(detail::g_allocatedSet == detail::g_freedSet); + g_allocation_tracing_disabled--; + for (auto memory : detail::g_allocatedSet) { + delete[] static_cast(memory); + } + detail::g_allocatedSet.clear(); + detail::g_freedSet.clear(); + detail::g_wipedSet.clear(); + detail::g_active = false; +} + +void* allocate(size_t size) { + ASSERT_ABORT(detail::g_active); + auto ptr = new uint8_t[size]; + auto [_, inserted] = detail::g_allocatedSet.insert(ptr); + ASSERT_ABORT(inserted); // no duplicates + return ptr; +} + +void invalidate(void* ptr) { + ASSERT_ABORT(detail::g_active); + ASSERT_ABORT(detail::g_allocatedSet.contains(ptr)); + ASSERT_ABORT(!detail::g_freedSet.contains(ptr)); + detail::g_freedSet.insert(ptr); +} + +void trackWipedArea(const uint8_t* begin, int size) { + ASSERT_ABORT(detail::g_active); + detail::g_wipedSet.emplace_back(begin, size); +} + +std::vector> const& getWipedAreaSet() { + ASSERT_ABORT(detail::g_active); + return detail::g_wipedSet; +} + +} // namespace keepalive_allocator + template void* FastAllocator::allocate() { + if (keepalive_allocator::isActive()) [[unlikely]] + return keepalive_allocator::allocate(Size); #if defined(USE_GPERFTOOLS) || defined(ADDRESS_SANITIZER) // Some usages of FastAllocator require 4096 byte alignment. @@ -359,6 +425,8 @@ void* FastAllocator::allocate() { template void FastAllocator::release(void* ptr) { + if (keepalive_allocator::isActive()) [[unlikely]] + return keepalive_allocator::invalidate(ptr); #if defined(USE_GPERFTOOLS) || defined(ADDRESS_SANITIZER) return aligned_free(ptr); @@ -519,7 +587,12 @@ void FastAllocator::getMagazine() { --g_allocation_tracing_disabled; } #endif - block = (void**)::allocate(magazine_size * Size, false); +#ifdef VALGRIND + const bool includeGuardPages = false; +#else + const bool includeGuardPages = true; +#endif + block = (void**)::allocate(magazine_size * Size, /*allowLargePages*/ false, includeGuardPages); #endif // void** block = new void*[ magazine_size * PSize ]; @@ -615,4 +688,4 @@ TEST_CASE("/jemalloc/4k_aligned_usable_size") { } return Void(); } -#endif \ No newline at end of file +#endif diff --git a/src/flow/FaultInjection.cpp b/src/flow/FaultInjection.cpp index d309574..786c585 100644 --- a/src/flow/FaultInjection.cpp +++ b/src/flow/FaultInjection.cpp @@ -21,6 +21,7 @@ #include "flow/FaultInjection.h" bool (*should_inject_fault)(const char* context, const char* file, int line, int error_code) = 0; +bool (*should_inject_blob_fault)(const char* context, const char* file, int line, int error_code) = 0; bool faultInjectionActivated = true; void enableFaultInjection(bool enabled) { diff --git a/src/flow/Histogram.cpp b/src/flow/Histogram.cpp index 1b6f154..41cbeaf 100644 --- a/src/flow/Histogram.cpp +++ b/src/flow/Histogram.cpp @@ -27,37 +27,20 @@ // scoped to the right "machine". // either we pull g_simulator into flow, or flow (and the I/O path) will be unable to log performance // metrics. -#include #include -// pull in some global pointers too: These types are implemented in fdbrpc/sim2.actor.cpp, which is not available here. -// Yuck. If you're not using the simulator, these will remain null, and all should be well. - -// TODO: create a execution context abstraction that allows independent flow instances within a process. -// The simulator would be the main user of it, and histogram would be the only other user (for now). -ISimulator* g_pSimulator = nullptr; -thread_local ISimulator::ProcessInfo* ISimulator::currentProcess = nullptr; - -// Fallback registry when we're not in simulation -- if we had execution contexts we wouldn't need to check if -// we have a simulated contex here; we'd just use the current context regardless. -static HistogramRegistry* globalHistograms = nullptr; - #pragma region HistogramRegistry HistogramRegistry& GetHistogramRegistry() { - ISimulator::ProcessInfo* info = g_network && g_network->isSimulated() ? g_simulator.getCurrentProcess() : nullptr; + auto h = g_network->global(INetwork::enHistogram); - if (info) { - // in simulator; scope histograms to simulated process - return info->histograms; - } - // avoid link order issues where the registry hasn't been initialized, but we're - // instantiating a histogram - if (globalHistograms == nullptr) { - // Note: This will show up as a leak on shutdown, but we're OK with that. - globalHistograms = new HistogramRegistry(); + if (h) { + return *reinterpret_cast(h); + } else { + auto res = new HistogramRegistry(); + g_network->setGlobal(INetwork::enHistogram, res); + return *res; } - return *globalHistograms; } void HistogramRegistry::registerHistogram(Histogram* h) { @@ -102,7 +85,7 @@ void HistogramRegistry::clear() { #pragma region Histogram -const char* const Histogram::UnitToStringMapper[] = { "microseconds", "bytes", "bytes_per_second", +const char* const Histogram::UnitToStringMapper[] = { "milliseconds", "bytes", "bytes_per_second", "percentage", "count", "none" }; void Histogram::writeToLog(double elapsed) { @@ -128,7 +111,8 @@ void Histogram::writeToLog(double elapsed) { if (buckets[i]) { totalCount += buckets[i]; switch (unit) { - case Unit::microseconds: + case Unit::milliseconds: + // value stored in microseconds, so divide by 1000 before writing e.detail(format("LessThan%u.%03u", int(value / 1000), int(value % 1000)), buckets[i]); break; case Unit::bytes: @@ -223,8 +207,7 @@ std::string Histogram::drawHistogram() { TEST_CASE("/flow/histogram/smoke_test") { { - Reference h = - Histogram::getHistogram(LiteralStringRef("smoke_test"), LiteralStringRef("counts"), Histogram::Unit::bytes); + Reference h = Histogram::getHistogram("smoke_test"_sr, "counts"_sr, Histogram::Unit::bytes); h->sample(0); ASSERT(h->buckets[0] == 1); @@ -239,15 +222,13 @@ TEST_CASE("/flow/histogram/smoke_test") { ASSERT(h->buckets[0] == 0); h->sample(0); ASSERT(h->buckets[0] == 1); - h = Histogram::getHistogram( - LiteralStringRef("smoke_test"), LiteralStringRef("counts2"), Histogram::Unit::bytes); + h = Histogram::getHistogram("smoke_test"_sr, "counts2"_sr, Histogram::Unit::bytes); // confirm that old h was deallocated. - h = Histogram::getHistogram(LiteralStringRef("smoke_test"), LiteralStringRef("counts"), Histogram::Unit::bytes); + h = Histogram::getHistogram("smoke_test"_sr, "counts"_sr, Histogram::Unit::bytes); ASSERT(h->buckets[0] == 0); - h = Histogram::getHistogram( - LiteralStringRef("smoke_test"), LiteralStringRef("times"), Histogram::Unit::microseconds); + h = Histogram::getHistogram("smoke_test"_sr, "times"_sr, Histogram::Unit::milliseconds); h->sampleSeconds(0.000000); h->sampleSeconds(0.0000019); diff --git a/src/flow/Hostname.actor.cpp b/src/flow/Hostname.actor.cpp index 84a3cc7..8052dc0 100644 --- a/src/flow/Hostname.actor.cpp +++ b/src/flow/Hostname.actor.cpp @@ -19,9 +19,30 @@ */ #include "flow/Hostname.h" + +#include + +#include "flow/IConnection.h" #include "flow/UnitTest.h" + #include "flow/actorcompiler.h" // has to be last include +namespace { + +const static std::regex validation("^([\\w\\-]+\\.?)+:([\\d]+){1,}(:tls)?$"); +const static std::regex ipv4Validation("^([\\d]{1,3}\\.?){4,}:([\\d]+){1,}(:tls)?$"); + +} // anonymous namespace + +bool Hostname::isHostname(const std::string& str) { + try { + return !std::regex_match(str, ipv4Validation) && std::regex_match(str, validation); + } catch (std::exception e) { + TraceEvent(SevWarn, "AddressParseError").detail("StdException", e.what()).detail("String", str); + throw address_parse_error(); + } +} + Hostname Hostname::parse(const std::string& s) { if (s.empty() || !Hostname::isHostname(s)) { throw connection_string_invalid(); @@ -39,7 +60,7 @@ Hostname Hostname::parse(const std::string& s) { return Hostname(f.substr(0, colonPos), f.substr(colonPos + 1), isTLS); } -ACTOR Future> resolveImpl(Hostname* self) { +ACTOR Future> resolveImpl(const Hostname* self) { try { std::vector addresses = wait(INetworkConnections::net()->resolveTCPEndpointWithDNSCache(self->host, self->service)); @@ -55,7 +76,7 @@ ACTOR Future> resolveImpl(Hostname* self) { } } -ACTOR Future resolveWithRetryImpl(Hostname* self) { +ACTOR Future resolveWithRetryImpl(const Hostname* self) { state double resolveInterval = FLOW_KNOBS->HOSTNAME_RESOLVE_INIT_INTERVAL; loop { try { @@ -76,11 +97,11 @@ Future> Hostname::resolve() { return resolveImpl(this); } -Future Hostname::resolveWithRetry() { +Future Hostname::resolveWithRetry() const { return resolveWithRetryImpl(this); } -Optional Hostname::resolveBlocking() { +Optional Hostname::resolveBlocking() const { try { std::vector addresses = INetworkConnections::net()->resolveTCPEndpointBlockingWithDNSCache(host, service); diff --git a/src/flow/Hostname.actor.g.cpp b/src/flow/Hostname.actor.g.cpp index 1a69284..d720bae 100644 --- a/src/flow/Hostname.actor.g.cpp +++ b/src/flow/Hostname.actor.g.cpp @@ -21,9 +21,30 @@ */ #include "flow/Hostname.h" + +#include + +#include "flow/IConnection.h" #include "flow/UnitTest.h" + #include "flow/actorcompiler.h" // has to be last include +namespace { + +const static std::regex validation("^([\\w\\-]+\\.?)+:([\\d]+){1,}(:tls)?$"); +const static std::regex ipv4Validation("^([\\d]{1,3}\\.?){4,}:([\\d]+){1,}(:tls)?$"); + +} // anonymous namespace + +bool Hostname::isHostname(const std::string& str) { + try { + return !std::regex_match(str, ipv4Validation) && std::regex_match(str, validation); + } catch (std::exception e) { + TraceEvent(SevWarn, "AddressParseError").detail("StdException", e.what()).detail("String", str); + throw address_parse_error(); + } +} + Hostname Hostname::parse(const std::string& s) { if (s.empty() || !Hostname::isHostname(s)) { throw connection_string_invalid(); @@ -41,21 +62,21 @@ Hostname Hostname::parse(const std::string& s) { return Hostname(f.substr(0, colonPos), f.substr(colonPos + 1), isTLS); } - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" namespace { // This generated class is to be used only via resolveImpl() - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" template - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" class ResolveImplActorState { - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" public: - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - ResolveImplActorState(Hostname* const& self) - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + ResolveImplActorState(const Hostname* const& self) + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" : self(self) - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" { fdb_probe_actor_create("resolveImpl", reinterpret_cast(this)); @@ -69,16 +90,16 @@ class ResolveImplActorState { { try { try { - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" StrictFuture> __when_expr_0 = INetworkConnections::net()->resolveTCPEndpointWithDNSCache(self->host, self->service); - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 44 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -106,9 +127,9 @@ class ResolveImplActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(Optional()); this->~ResolveImplActorState(); static_cast(this)->destroy(); return 0; } - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(Optional()); this->~ResolveImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -124,23 +145,23 @@ class ResolveImplActorState { } int a_body1cont2(std::vector const& addresses,int loopDepth) { - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" NetworkAddress address = INetworkConnections::pickOneAddress(addresses); - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" address.flags = 0; - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" address.fromHostname = NetworkAddressFromHostname::True; - #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" if (self->isTLS) - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" { - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" address.flags |= NetworkAddress::FLAG_TLS; - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" } - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(address); this->~ResolveImplActorState(); static_cast(this)->destroy(); return 0; } - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(address); this->~ResolveImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -150,23 +171,23 @@ class ResolveImplActorState { } int a_body1cont2(std::vector && addresses,int loopDepth) { - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" NetworkAddress address = INetworkConnections::pickOneAddress(addresses); - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" address.flags = 0; - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" address.fromHostname = NetworkAddressFromHostname::True; - #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" if (self->isTLS) - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" { - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" address.flags |= NetworkAddress::FLAG_TLS; - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" } - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(address); this->~ResolveImplActorState(); static_cast(this)->destroy(); return 0; } - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" new (&static_cast(this)->SAV< Optional >::value()) Optional(address); this->~ResolveImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -237,14 +258,14 @@ class ResolveImplActorState { fdb_probe_actor_exit("resolveImpl", reinterpret_cast(this), 0); } - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - Hostname* self; - #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + const Hostname* self; + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" }; // This generated class is to be used only via resolveImpl() - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" class ResolveImplActor final : public Actor>, public ActorCallback< ResolveImplActor, 0, std::vector >, public FastAllocated, public ResolveImplActorState { - #line 247 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -253,9 +274,9 @@ class ResolveImplActor final : public Actor>, public Ac void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ResolveImplActor, 0, std::vector >; - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - ResolveImplActor(Hostname* const& self) - #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + ResolveImplActor(const Hostname* const& self) + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" : Actor>(), ResolveImplActorState(self) { @@ -279,32 +300,32 @@ friend struct ActorCallback< ResolveImplActor, 0, std::vector >; } }; } - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" -[[nodiscard]] Future> resolveImpl( Hostname* const& self ) { - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" +[[nodiscard]] Future> resolveImpl( const Hostname* const& self ) { + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" return Future>(new ResolveImplActor(self)); - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" } -#line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" +#line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" namespace { // This generated class is to be used only via resolveWithRetryImpl() - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" template - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" class ResolveWithRetryImplActorState { - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" public: - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - ResolveWithRetryImplActorState(Hostname* const& self) - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + ResolveWithRetryImplActorState(const Hostname* const& self) + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" : self(self), - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" resolveInterval(FLOW_KNOBS->HOSTNAME_RESOLVE_INIT_INTERVAL) - #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" { fdb_probe_actor_create("resolveWithRetryImpl", reinterpret_cast(this)); @@ -317,9 +338,9 @@ class ResolveWithRetryImplActorState { int a_body1(int loopDepth=0) { try { - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ; - #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -348,16 +369,16 @@ class ResolveWithRetryImplActorState { int a_body1loopBody1(int loopDepth) { try { - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" StrictFuture> __when_expr_0 = resolveImpl(self); - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -377,11 +398,11 @@ class ResolveWithRetryImplActorState { int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) { try { - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(e.code() == error_code_actor_cancelled); - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); @@ -393,56 +414,56 @@ class ResolveWithRetryImplActorState { } int a_body1loopBody1cont2(Optional const& address,int loopDepth) { - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" if (address.present()) - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" { - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(address.get()); this->~ResolveWithRetryImplActorState(); static_cast(this)->destroy(); return 0; } - #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" new (&static_cast(this)->SAV< NetworkAddress >::value()) NetworkAddress(address.get()); this->~ResolveWithRetryImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" StrictFuture __when_expr_1 = delay(resolveInterval); - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 433 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont2(Optional && address,int loopDepth) { - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" if (address.present()) - #line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" { - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(address.get()); this->~ResolveWithRetryImplActorState(); static_cast(this)->destroy(); return 0; } - #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" new (&static_cast(this)->SAV< NetworkAddress >::value()) NetworkAddress(address.get()); this->~ResolveWithRetryImplActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" StrictFuture __when_expr_1 = delay(resolveInterval); - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1loopBody1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1loopBody1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 445 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -512,18 +533,18 @@ class ResolveWithRetryImplActorState { } int a_body1loopBody1cont3(Void const& _,int loopDepth) { - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" resolveInterval = std::min(2 * resolveInterval, FLOW_KNOBS->HOSTNAME_RESOLVE_MAX_INTERVAL); - #line 517 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; } int a_body1loopBody1cont3(Void && _,int loopDepth) { - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" resolveInterval = std::min(2 * resolveInterval, FLOW_KNOBS->HOSTNAME_RESOLVE_MAX_INTERVAL); - #line 526 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" loopDepth = a_body1loopBody1cont6(loopDepth); return loopDepth; @@ -604,16 +625,16 @@ class ResolveWithRetryImplActorState { return loopDepth; } - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - Hostname* self; - #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + const Hostname* self; + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" double resolveInterval; - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" }; // This generated class is to be used only via resolveWithRetryImpl() - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" class ResolveWithRetryImplActor final : public Actor, public ActorCallback< ResolveWithRetryImplActor, 0, Optional >, public ActorCallback< ResolveWithRetryImplActor, 1, Void >, public FastAllocated, public ResolveWithRetryImplActorState { - #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -623,9 +644,9 @@ class ResolveWithRetryImplActor final : public Actor, public Act #pragma clang diagnostic pop friend struct ActorCallback< ResolveWithRetryImplActor, 0, Optional >; friend struct ActorCallback< ResolveWithRetryImplActor, 1, Void >; - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - ResolveWithRetryImplActor(Hostname* const& self) - #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + ResolveWithRetryImplActor(const Hostname* const& self) + #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" : Actor(), ResolveWithRetryImplActorState(self) { @@ -650,24 +671,24 @@ friend struct ActorCallback< ResolveWithRetryImplActor, 1, Void >; } }; } - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" -[[nodiscard]] Future resolveWithRetryImpl( Hostname* const& self ) { - #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" +[[nodiscard]] Future resolveWithRetryImpl( const Hostname* const& self ) { + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" return Future(new ResolveWithRetryImplActor(self)); - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" } -#line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" +#line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" Future> Hostname::resolve() { return resolveImpl(this); } -Future Hostname::resolveWithRetry() { +Future Hostname::resolveWithRetry() const { return resolveWithRetryImpl(this); } -Optional Hostname::resolveBlocking() { +Optional Hostname::resolveBlocking() const { try { std::vector addresses = INetworkConnections::net()->resolveTCPEndpointBlockingWithDNSCache(host, service); @@ -683,127 +704,127 @@ Optional Hostname::resolveBlocking() { } } - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase99() - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" -template - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" -class FlowTestCase99ActorState { - #line 693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" +// This generated class is to be used only via flowTestCase120() + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" +template + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" +class FlowTestCase120ActorState { + #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" public: - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - FlowTestCase99ActorState(UnitTestParameters const& params) - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + FlowTestCase120ActorState(UnitTestParameters const& params) + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" : params(params) - #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase99", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase120", reinterpret_cast(this)); } - ~FlowTestCase99ActorState() + ~FlowTestCase120ActorState() { - fdb_probe_actor_destroy("flowTestCase99", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase120", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" std::string hn1s = "localhost:1234"; - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" std::string hn2s = "host-name:1234"; - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" std::string hn3s = "host.name:1234"; - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" std::string hn4s = "host-name_part1.host-name_part2:1234:tls"; - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" std::string hn5s = "127.0.0.1:1234"; - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" std::string hn6s = "127.0.0.1:1234:tls"; - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" std::string hn7s = "[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:4800"; - #line 108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" std::string hn8s = "[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:4800:tls"; - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" std::string hn9s = "2001:0db8:85a3:0000:0000:8a2e:0370:7334"; - #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" std::string hn10s = "2001:0db8:85a3:0000:0000:8a2e:0370:7334:tls"; - #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" std::string hn11s = "[::1]:4800"; - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" std::string hn12s = "[::1]:4800:tls"; - #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" std::string hn13s = "1234"; - #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" auto hn1 = Hostname::parse(hn1s); - #line 116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(hn1.toString() == hn1s); - #line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(hn1.host == "localhost"); - #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(hn1.service == "1234"); - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(!hn1.isTLS); - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" hn2 = Hostname::parse(hn2s); - #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(hn2.toString() == hn2s); - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(hn2.host == "host-name"); - #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(hn2.service == "1234"); - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(!hn2.isTLS); - #line 127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" auto hn3 = Hostname::parse(hn3s); - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(hn3.toString() == hn3s); - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(hn3.host == "host.name"); - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(hn3.service == "1234"); - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(!hn3.isTLS); - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" auto hn4 = Hostname::parse(hn4s); - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(hn4.toString() == hn4s); - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(hn4.host == "host-name_part1.host-name_part2"); - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(hn4.service == "1234"); - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(hn4.isTLS); - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(!Hostname::isHostname(hn5s)); - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(!Hostname::isHostname(hn6s)); - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(!Hostname::isHostname(hn7s)); - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(!Hostname::isHostname(hn8s)); - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(!Hostname::isHostname(hn9s)); - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(!Hostname::isHostname(hn10s)); - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(!Hostname::isHostname(hn11s)); - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(!Hostname::isHostname(hn12s)); - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(!Hostname::isHostname(hn13s)); - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" StrictFuture> __when_expr_0 = hn2.resolve(); - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); + #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -816,34 +837,34 @@ class FlowTestCase99ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase99ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase120ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(!optionalAddress.present()); - #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" optionalAddress = hn2.resolveBlocking(); - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(!optionalAddress.present()); - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" address = NetworkAddress(); - #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" try { - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" StrictFuture __when_expr_1 = timeoutError(store(address, hn2.resolveWithRetry()), 1); - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + static_cast(this)->actor_wait_state = 2; + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -856,9 +877,9 @@ class FlowTestCase99ActorState { } int a_body1when1(Optional const& __optionalAddress,int loopDepth) { - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" optionalAddress = __optionalAddress; - #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -872,13 +893,13 @@ class FlowTestCase99ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase99Actor, 0, Optional >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase120Actor, 0, Optional >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase99Actor, 0, Optional >*,Optional const& value) + void a_callback_fire(ActorCallback< FlowTestCase120Actor, 0, Optional >*,Optional const& value) { - fdb_probe_actor_enter("flowTestCase99", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase120", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -888,12 +909,12 @@ class FlowTestCase99ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase99", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase120", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase99Actor, 0, Optional >*,Optional && value) + void a_callback_fire(ActorCallback< FlowTestCase120Actor, 0, Optional >*,Optional && value) { - fdb_probe_actor_enter("flowTestCase99", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase120", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -903,12 +924,12 @@ class FlowTestCase99ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase99", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase120", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase99Actor, 0, Optional >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase120Actor, 0, Optional >*,Error err) { - fdb_probe_actor_enter("flowTestCase99", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase120", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -918,27 +939,27 @@ class FlowTestCase99ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase99", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase120", reinterpret_cast(this), 0); } int a_body1cont2(int loopDepth) { - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(address == NetworkAddress()); - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" addressSource = NetworkAddress::parse("127.0.0.0:1234"); - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" INetworkConnections::net()->addMockTCPEndpoint("host-name", "1234", { addressSource }); - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" StrictFuture __when_expr_2 = store(optionalAddress, hn2.resolve()); - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + static_cast(this)->actor_wait_state = 3; + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -946,9 +967,9 @@ class FlowTestCase99ActorState { int a_body1cont1Catch1(const Error& e,int loopDepth=0) { try { - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(e.code() == error_code_timed_out); - #line 951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); } catch (Error& error) { @@ -985,13 +1006,13 @@ class FlowTestCase99ActorState { } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase99Actor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase120Actor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase99Actor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase120Actor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase99", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase120", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(value, 0); @@ -1001,12 +1022,12 @@ class FlowTestCase99ActorState { } catch (...) { a_body1cont1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase99", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase120", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< FlowTestCase99Actor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase120Actor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase99", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase120", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1when1(std::move(value), 0); @@ -1016,12 +1037,12 @@ class FlowTestCase99ActorState { } catch (...) { a_body1cont1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase99", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase120", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< FlowTestCase99Actor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase120Actor, 1, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase99", reinterpret_cast(this), 1); + fdb_probe_actor_enter("flowTestCase120", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1cont1Catch1(err, 0); @@ -1031,7 +1052,7 @@ class FlowTestCase99ActorState { } catch (...) { a_body1cont1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase99", reinterpret_cast(this), 1); + fdb_probe_actor_exit("flowTestCase120", reinterpret_cast(this), 1); } int a_body1cont4(int loopDepth) @@ -1049,52 +1070,52 @@ class FlowTestCase99ActorState { } int a_body1cont5(Void const& _,int loopDepth) { - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(optionalAddress.present() && optionalAddress.get() == addressSource); - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" optionalAddress = Optional(); - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" optionalAddress = hn2.resolveBlocking(); - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(optionalAddress.present() && optionalAddress.get() == addressSource); - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" optionalAddress = Optional(); - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" StrictFuture __when_expr_3 = store(address, hn2.resolveWithRetry()); - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + static_cast(this)->actor_wait_state = 4; + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont5(Void && _,int loopDepth) { - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(optionalAddress.present() && optionalAddress.get() == addressSource); - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" optionalAddress = Optional(); - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" optionalAddress = hn2.resolveBlocking(); - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(optionalAddress.present() && optionalAddress.get() == addressSource); - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" optionalAddress = Optional(); - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" StrictFuture __when_expr_3 = store(address, hn2.resolveWithRetry()); - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont5when1(__when_expr_3.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 4; - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + static_cast(this)->actor_wait_state = 4; + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1113,13 +1134,13 @@ class FlowTestCase99ActorState { } void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase99Actor, 2, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase120Actor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase99Actor, 2, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase120Actor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase99", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase120", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont2when1(value, 0); @@ -1129,12 +1150,12 @@ class FlowTestCase99ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase99", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase120", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< FlowTestCase99Actor, 2, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase120Actor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase99", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase120", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1cont2when1(std::move(value), 0); @@ -1144,12 +1165,12 @@ class FlowTestCase99ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase99", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase120", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< FlowTestCase99Actor, 2, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase120Actor, 2, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase99", reinterpret_cast(this), 2); + fdb_probe_actor_enter("flowTestCase120", reinterpret_cast(this), 2); a_exitChoose3(); try { a_body1Catch1(err, 0); @@ -1159,33 +1180,33 @@ class FlowTestCase99ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase99", reinterpret_cast(this), 2); + fdb_probe_actor_exit("flowTestCase120", reinterpret_cast(this), 2); } int a_body1cont6(Void const& _,int loopDepth) { - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(address == addressSource); - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase99ActorState(); static_cast(this)->destroy(); return 0; } - #line 1171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase99ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase120ActorState(); static_cast(this)->destroy(); return 0; } + #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase120ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont6(Void && _,int loopDepth) { - #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" ASSERT(address == addressSource); - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase99ActorState(); static_cast(this)->destroy(); return 0; } - #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase99ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase120ActorState(); static_cast(this)->destroy(); return 0; } + #line 1206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase120ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -1204,13 +1225,13 @@ class FlowTestCase99ActorState { } void a_exitChoose4() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase99Actor, 3, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase120Actor, 3, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase99Actor, 3, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase120Actor, 3, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase99", reinterpret_cast(this), 3); + fdb_probe_actor_enter("flowTestCase120", reinterpret_cast(this), 3); a_exitChoose4(); try { a_body1cont5when1(value, 0); @@ -1220,12 +1241,12 @@ class FlowTestCase99ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase99", reinterpret_cast(this), 3); + fdb_probe_actor_exit("flowTestCase120", reinterpret_cast(this), 3); } - void a_callback_fire(ActorCallback< FlowTestCase99Actor, 3, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase120Actor, 3, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase99", reinterpret_cast(this), 3); + fdb_probe_actor_enter("flowTestCase120", reinterpret_cast(this), 3); a_exitChoose4(); try { a_body1cont5when1(std::move(value), 0); @@ -1235,12 +1256,12 @@ class FlowTestCase99ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase99", reinterpret_cast(this), 3); + fdb_probe_actor_exit("flowTestCase120", reinterpret_cast(this), 3); } - void a_callback_error(ActorCallback< FlowTestCase99Actor, 3, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase120Actor, 3, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase99", reinterpret_cast(this), 3); + fdb_probe_actor_enter("flowTestCase120", reinterpret_cast(this), 3); a_exitChoose4(); try { a_body1Catch1(err, 0); @@ -1250,49 +1271,49 @@ class FlowTestCase99ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase99", reinterpret_cast(this), 3); + fdb_probe_actor_exit("flowTestCase120", reinterpret_cast(this), 3); } - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" UnitTestParameters params; - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" Hostname hn2; - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" Optional optionalAddress; - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" NetworkAddress address; - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" NetworkAddress addressSource; - #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase99() - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" -class FlowTestCase99Actor final : public Actor, public ActorCallback< FlowTestCase99Actor, 0, Optional >, public ActorCallback< FlowTestCase99Actor, 1, Void >, public ActorCallback< FlowTestCase99Actor, 2, Void >, public ActorCallback< FlowTestCase99Actor, 3, Void >, public FastAllocated, public FlowTestCase99ActorState { - #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" +// This generated class is to be used only via flowTestCase120() + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" +class FlowTestCase120Actor final : public Actor, public ActorCallback< FlowTestCase120Actor, 0, Optional >, public ActorCallback< FlowTestCase120Actor, 1, Void >, public ActorCallback< FlowTestCase120Actor, 2, Void >, public ActorCallback< FlowTestCase120Actor, 3, Void >, public FastAllocated, public FlowTestCase120ActorState { + #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase99Actor, 0, Optional >; -friend struct ActorCallback< FlowTestCase99Actor, 1, Void >; -friend struct ActorCallback< FlowTestCase99Actor, 2, Void >; -friend struct ActorCallback< FlowTestCase99Actor, 3, Void >; - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - FlowTestCase99Actor(UnitTestParameters const& params) - #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" +friend struct ActorCallback< FlowTestCase120Actor, 0, Optional >; +friend struct ActorCallback< FlowTestCase120Actor, 1, Void >; +friend struct ActorCallback< FlowTestCase120Actor, 2, Void >; +friend struct ActorCallback< FlowTestCase120Actor, 3, Void >; + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + FlowTestCase120Actor(UnitTestParameters const& params) + #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" : Actor(), - FlowTestCase99ActorState(params) + FlowTestCase120ActorState(params) { - fdb_probe_actor_enter("flowTestCase99", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase120", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase99"); + this->lineage.setActorName("flowTestCase120"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase99", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase120", reinterpret_cast(this), -1); } void cancel() override @@ -1300,21 +1321,21 @@ friend struct ActorCallback< FlowTestCase99Actor, 3, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase99Actor, 0, Optional >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< FlowTestCase99Actor, 1, Void >*)0, actor_cancelled()); break; - case 3: this->a_callback_error((ActorCallback< FlowTestCase99Actor, 2, Void >*)0, actor_cancelled()); break; - case 4: this->a_callback_error((ActorCallback< FlowTestCase99Actor, 3, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase120Actor, 0, Optional >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase120Actor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< FlowTestCase120Actor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< FlowTestCase120Actor, 3, Void >*)0, actor_cancelled()); break; } } }; } - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" -static Future flowTestCase99( UnitTestParameters const& params ) { - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" - return Future(new FlowTestCase99Actor(params)); - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" +static Future flowTestCase120( UnitTestParameters const& params ) { + #line 120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" + return Future(new FlowTestCase120Actor(params)); + #line 1337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase99, "/flow/Hostname/hostname") +ACTOR_TEST_CASE(flowTestCase120, "/flow/Hostname/hostname") -#line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" +#line 203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Hostname.actor.cpp" diff --git a/src/fdbrpc/IAsyncFile.actor.cpp b/src/flow/IAsyncFile.actor.cpp similarity index 99% rename from src/fdbrpc/IAsyncFile.actor.cpp rename to src/flow/IAsyncFile.actor.cpp index 591b7ad..6a8c483 100644 --- a/src/fdbrpc/IAsyncFile.actor.cpp +++ b/src/flow/IAsyncFile.actor.cpp @@ -18,7 +18,7 @@ * limitations under the License. */ -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/Error.h" #include "flow/Knobs.h" #include "flow/Platform.h" diff --git a/src/fdbrpc/IAsyncFile.actor.g.cpp b/src/flow/IAsyncFile.actor.g.cpp similarity index 87% rename from src/fdbrpc/IAsyncFile.actor.g.cpp rename to src/flow/IAsyncFile.actor.g.cpp index 27e7bc2..4c14250 100644 --- a/src/fdbrpc/IAsyncFile.actor.g.cpp +++ b/src/flow/IAsyncFile.actor.g.cpp @@ -1,5 +1,5 @@ #define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" +#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" /* * IAsyncFile.actor.cpp * @@ -20,7 +20,7 @@ * limitations under the License. */ -#include "fdbrpc/IAsyncFile.h" +#include "flow/IAsyncFile.h" #include "flow/Error.h" #include "flow/Knobs.h" #include "flow/Platform.h" @@ -33,31 +33,31 @@ IAsyncFile::~IAsyncFile() = default; const static unsigned int ONE_MEGABYTE = 1 << 20; const static unsigned int FOUR_KILOBYTES = 4 << 10; - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" namespace { // This generated class is to be used only via zeroRangeHelper() - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" template - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" class ZeroRangeHelperActorState { - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" public: - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ZeroRangeHelperActorState(Reference const& f,int64_t const& offset,int64_t const& length,int const& fixedbyte) - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" : f(f), - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" offset(offset), - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" length(length), - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" fixedbyte(fixedbyte), - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" pos(offset), - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" zeros(aligned_alloc(ONE_MEGABYTE, ONE_MEGABYTE)) - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" { fdb_probe_actor_create("zeroRangeHelper", reinterpret_cast(this)); @@ -70,11 +70,11 @@ class ZeroRangeHelperActorState { int a_body1(int loopDepth=0) { try { - #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 37 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" memset(zeros, fixedbyte, ONE_MEGABYTE); - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ; - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -95,11 +95,11 @@ class ZeroRangeHelperActorState { } int a_body1cont1(int loopDepth) { - #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 46 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" aligned_free(zeros); - #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 47 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ZeroRangeHelperActorState(); static_cast(this)->destroy(); return 0; } - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ZeroRangeHelperActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -116,24 +116,24 @@ class ZeroRangeHelperActorState { } int a_body1loopBody1(int loopDepth) { - #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 39 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (!(pos < offset + length)) - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" len = std::min(ONE_MEGABYTE, offset + length - pos); - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_0 = f->write(zeros, len, pos); - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 41 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -153,36 +153,36 @@ class ZeroRangeHelperActorState { } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" pos += len; - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_1 = yield(); - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 42 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" pos += len; - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_1 = yield(); - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 43 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -325,26 +325,26 @@ class ZeroRangeHelperActorState { fdb_probe_actor_exit("zeroRangeHelper", reinterpret_cast(this), 1); } - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" Reference f; - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" int64_t offset; - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" int64_t length; - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" int fixedbyte; - #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 35 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" int64_t pos; - #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 36 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" void* zeros; - #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 40 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" int len; - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" }; // This generated class is to be used only via zeroRangeHelper() - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" class ZeroRangeHelperActor final : public Actor, public ActorCallback< ZeroRangeHelperActor, 0, Void >, public ActorCallback< ZeroRangeHelperActor, 1, Void >, public FastAllocated, public ZeroRangeHelperActorState { - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -354,9 +354,9 @@ class ZeroRangeHelperActor final : public Actor, public ActorCallback< Zer #pragma clang diagnostic pop friend struct ActorCallback< ZeroRangeHelperActor, 0, Void >; friend struct ActorCallback< ZeroRangeHelperActor, 1, Void >; - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ZeroRangeHelperActor(Reference const& f,int64_t const& offset,int64_t const& length,int const& fixedbyte) - #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" : Actor(), ZeroRangeHelperActorState(f, offset, length, fixedbyte) { @@ -381,36 +381,36 @@ friend struct ActorCallback< ZeroRangeHelperActor, 1, Void >; } }; } - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" [[nodiscard]] static Future zeroRangeHelper( Reference const& f, int64_t const& offset, int64_t const& length, int const& fixedbyte ) { - #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 34 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" return Future(new ZeroRangeHelperActor(f, offset, length, fixedbyte)); - #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } -#line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" +#line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" Future IAsyncFile::zeroRange(int64_t offset, int64_t length) { return uncancellable(zeroRangeHelper(Reference::addRef(this), offset, length, 0)); } - #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" namespace { // This generated class is to be used only via flowTestCase54() - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" template - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" class FlowTestCase54ActorState { - #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" public: - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" FlowTestCase54ActorState(UnitTestParameters const& params) - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" : params(params), - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" filename("/tmp/__ZEROJUNK__") - #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" { fdb_probe_actor_create("flowTestCase54", reinterpret_cast(this)); @@ -423,16 +423,16 @@ class FlowTestCase54ActorState { int a_body1(int loopDepth=0) { try { - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture> __when_expr_0 = IAsyncFileSystem::filesystem()->open( filename, IAsyncFile::OPEN_ATOMIC_WRITE_AND_CREATE | IAsyncFile::OPEN_CREATE | IAsyncFile::OPEN_READWRITE, 0); - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -453,25 +453,25 @@ class FlowTestCase54ActorState { } int a_body1cont1(int loopDepth) { - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_1 = f->sync(); - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(Reference const& __f,int loopDepth) { - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f = __f; - #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -536,32 +536,32 @@ class FlowTestCase54ActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_2 = f->zeroRange(0, ONE_MEGABYTE); - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 543 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_2 = f->zeroRange(0, ONE_MEGABYTE); - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -631,32 +631,32 @@ class FlowTestCase54ActorState { } int a_body1cont3(Void const& _,int loopDepth) { - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_3 = f->size(); - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_3 = f->size(); - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -726,36 +726,36 @@ class FlowTestCase54ActorState { } int a_body1cont4(int64_t const& size,int loopDepth) { - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(ONE_MEGABYTE == size); - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_4 = zeroRangeHelper(f, 0, ONE_MEGABYTE, 0xff); - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4(int64_t && size,int loopDepth) { - #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(ONE_MEGABYTE == size); - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_4 = zeroRangeHelper(f, 0, ONE_MEGABYTE, 0xff); - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 753 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -825,32 +825,32 @@ class FlowTestCase54ActorState { } int a_body1cont5(Void const& _,int loopDepth) { - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_5 = f->zeroRange(0, ONE_MEGABYTE); - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont5when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont5(Void && _,int loopDepth) { - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_5 = f->zeroRange(0, ONE_MEGABYTE); - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont5when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -920,36 +920,36 @@ class FlowTestCase54ActorState { } int a_body1cont6(Void const& _,int loopDepth) { - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" page = (uint8_t*)malloc(FOUR_KILOBYTES); - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_6 = f->read(page, FOUR_KILOBYTES, 0); - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont6when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont6(Void && _,int loopDepth) { - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" page = (uint8_t*)malloc(FOUR_KILOBYTES); - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_6 = f->read(page, FOUR_KILOBYTES, 0); - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 947 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont6when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1019,56 +1019,56 @@ class FlowTestCase54ActorState { } int a_body1cont7(int const& n,int loopDepth) { - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(n == FOUR_KILOBYTES); - #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" for(int i = 0;i < FOUR_KILOBYTES;i++) { - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(page[i] == 0); - #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" free(page); - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f.clear(); - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_7 = IAsyncFileSystem::filesystem()->deleteFile(filename, true); - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont7when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont7(int && n,int loopDepth) { - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(n == FOUR_KILOBYTES); - #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" for(int i = 0;i < FOUR_KILOBYTES;i++) { - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(page[i] == 0); - #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" free(page); - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f.clear(); - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_7 = IAsyncFileSystem::filesystem()->deleteFile(filename, true); - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont7when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1138,9 +1138,9 @@ class FlowTestCase54ActorState { } int a_body1cont8(Void const& _,int loopDepth) { - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase54ActorState(); static_cast(this)->destroy(); return 0; } - #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~FlowTestCase54ActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1150,9 +1150,9 @@ class FlowTestCase54ActorState { } int a_body1cont8(Void && _,int loopDepth) { - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase54ActorState(); static_cast(this)->destroy(); return 0; } - #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~FlowTestCase54ActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1223,20 +1223,20 @@ class FlowTestCase54ActorState { fdb_probe_actor_exit("flowTestCase54", reinterpret_cast(this), 7); } - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" UnitTestParameters params; - #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" std::string filename; - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" Reference f; - #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" uint8_t* page; - #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" }; // This generated class is to be used only via flowTestCase54() - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" class FlowTestCase54Actor final : public Actor, public ActorCallback< FlowTestCase54Actor, 0, Reference >, public ActorCallback< FlowTestCase54Actor, 1, Void >, public ActorCallback< FlowTestCase54Actor, 2, Void >, public ActorCallback< FlowTestCase54Actor, 3, int64_t >, public ActorCallback< FlowTestCase54Actor, 4, Void >, public ActorCallback< FlowTestCase54Actor, 5, Void >, public ActorCallback< FlowTestCase54Actor, 6, int >, public ActorCallback< FlowTestCase54Actor, 7, Void >, public FastAllocated, public FlowTestCase54ActorState { - #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1252,9 +1252,9 @@ friend struct ActorCallback< FlowTestCase54Actor, 4, Void >; friend struct ActorCallback< FlowTestCase54Actor, 5, Void >; friend struct ActorCallback< FlowTestCase54Actor, 6, int >; friend struct ActorCallback< FlowTestCase54Actor, 7, Void >; - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" FlowTestCase54Actor(UnitTestParameters const& params) - #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" : Actor(), FlowTestCase54ActorState(params) { @@ -1285,43 +1285,43 @@ friend struct ActorCallback< FlowTestCase54Actor, 7, Void >; } }; } - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" static Future flowTestCase54( UnitTestParameters const& params ) { - #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" return Future(new FlowTestCase54Actor(params)); - #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } ACTOR_TEST_CASE(flowTestCase54, "/fileio/zero") -#line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" +#line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" - #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" namespace { // This generated class is to be used only via incrementalDeleteHelper() - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" template - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" class IncrementalDeleteHelperActorState { - #line 1305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" public: - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" IncrementalDeleteHelperActorState(std::string const& filename,bool const& mustBeDurable,int64_t const& truncateAmt,double const& interval) - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" : filename(filename), - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" mustBeDurable(mustBeDurable), - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" truncateAmt(truncateAmt), - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" interval(interval), - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" file(), - #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" remainingFileSize(), - #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" exists(fileExists(filename)) - #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" { fdb_probe_actor_create("incrementalDeleteHelper", reinterpret_cast(this)); @@ -1334,20 +1334,20 @@ class IncrementalDeleteHelperActorState { int a_body1(int loopDepth=0) { try { - #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (exists) - #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" { - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture> __when_expr_0 = IAsyncFileSystem::filesystem()->open( filename, IAsyncFile::OPEN_READWRITE | IAsyncFile::OPEN_UNCACHED | IAsyncFile::OPEN_UNBUFFERED, 0); - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 1350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; } else @@ -1373,52 +1373,52 @@ class IncrementalDeleteHelperActorState { } int a_body1cont1(int loopDepth) { - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_2 = IAsyncFileSystem::filesystem()->deleteFile(filename, mustBeDurable); - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Reference const& f,int loopDepth) { - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" file = f; - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_1 = file->size(); - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Reference && f,int loopDepth) { - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" file = f; - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_1 = file->size(); - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1416 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1488,18 +1488,18 @@ class IncrementalDeleteHelperActorState { } int a_body1cont3(int64_t const& fileSize,int loopDepth) { - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" remainingFileSize = fileSize; - #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; } int a_body1cont3(int64_t && fileSize,int loopDepth) { - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" remainingFileSize = fileSize; - #line 1502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1502 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -1569,13 +1569,13 @@ class IncrementalDeleteHelperActorState { } int a_body1cont5(Void const& _,int loopDepth) { - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (exists) - #line 1574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" { - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ; - #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = a_body1cont5loopHead1(loopDepth); } else @@ -1587,13 +1587,13 @@ class IncrementalDeleteHelperActorState { } int a_body1cont5(Void && _,int loopDepth) { - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (exists) - #line 1592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" { - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ; - #line 1596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = a_body1cont5loopHead1(loopDepth); } else @@ -1668,9 +1668,9 @@ class IncrementalDeleteHelperActorState { } int a_body1cont6(int loopDepth) { - #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~IncrementalDeleteHelperActorState(); static_cast(this)->destroy(); return 0; } - #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~IncrementalDeleteHelperActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1693,22 +1693,22 @@ class IncrementalDeleteHelperActorState { } int a_body1cont5loopBody1(int loopDepth) { - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (!(remainingFileSize > 0)) - #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" { return a_body1cont5break1(loopDepth==0?0:loopDepth-1); // break } - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_3 = file->truncate(remainingFileSize); - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), std::max(0, loopDepth - 1)); else return a_body1cont5loopBody1when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1728,32 +1728,32 @@ class IncrementalDeleteHelperActorState { } int a_body1cont5loopBody1cont1(Void const& _,int loopDepth) { - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_4 = file->sync(); - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont5loopBody1cont1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont5loopBody1cont1(Void && _,int loopDepth) { - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_4 = file->sync(); - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), std::max(0, loopDepth - 1)); else return a_body1cont5loopBody1cont1when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1823,32 +1823,32 @@ class IncrementalDeleteHelperActorState { } int a_body1cont5loopBody1cont3(Void const& _,int loopDepth) { - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_5 = delay(interval); - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont5loopBody1cont3when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont5loopBody1cont3(Void && _,int loopDepth) { - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_5 = delay(interval); - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), std::max(0, loopDepth - 1)); else return a_body1cont5loopBody1cont3when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1918,18 +1918,18 @@ class IncrementalDeleteHelperActorState { } int a_body1cont5loopBody1cont4(Void const& _,int loopDepth) { - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" remainingFileSize -= truncateAmt; - #line 1923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (loopDepth == 0) return a_body1cont5loopHead1(0); return loopDepth; } int a_body1cont5loopBody1cont4(Void && _,int loopDepth) { - #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" remainingFileSize -= truncateAmt; - #line 1932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 1932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (loopDepth == 0) return a_body1cont5loopHead1(0); return loopDepth; @@ -1997,26 +1997,26 @@ class IncrementalDeleteHelperActorState { fdb_probe_actor_exit("incrementalDeleteHelper", reinterpret_cast(this), 5); } - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" std::string filename; - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" bool mustBeDurable; - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" int64_t truncateAmt; - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" double interval; - #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 86 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" Reference file; - #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" int64_t remainingFileSize; - #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" bool exists; - #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" }; // This generated class is to be used only via incrementalDeleteHelper() - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" class IncrementalDeleteHelperActor final : public Actor, public ActorCallback< IncrementalDeleteHelperActor, 0, Reference >, public ActorCallback< IncrementalDeleteHelperActor, 1, int64_t >, public ActorCallback< IncrementalDeleteHelperActor, 2, Void >, public ActorCallback< IncrementalDeleteHelperActor, 3, Void >, public ActorCallback< IncrementalDeleteHelperActor, 4, Void >, public ActorCallback< IncrementalDeleteHelperActor, 5, Void >, public FastAllocated, public IncrementalDeleteHelperActorState { - #line 2019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2030,9 +2030,9 @@ friend struct ActorCallback< IncrementalDeleteHelperActor, 2, Void >; friend struct ActorCallback< IncrementalDeleteHelperActor, 3, Void >; friend struct ActorCallback< IncrementalDeleteHelperActor, 4, Void >; friend struct ActorCallback< IncrementalDeleteHelperActor, 5, Void >; - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" IncrementalDeleteHelperActor(std::string const& filename,bool const& mustBeDurable,int64_t const& truncateAmt,double const& interval) - #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" : Actor(), IncrementalDeleteHelperActorState(filename, mustBeDurable, truncateAmt, interval) { @@ -2061,14 +2061,14 @@ friend struct ActorCallback< IncrementalDeleteHelperActor, 5, Void >; } }; } - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" [[nodiscard]] static Future incrementalDeleteHelper( std::string const& filename, bool const& mustBeDurable, int64_t const& truncateAmt, double const& interval ) { - #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 82 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" return Future(new IncrementalDeleteHelperActor(filename, mustBeDurable, truncateAmt, interval)); - #line 2068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } -#line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" +#line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" Future IAsyncFileSystem::incrementalDeleteFile(const std::string& filename, bool mustBeDurable) { return uncancellable(incrementalDeleteHelper(filename, @@ -2077,25 +2077,25 @@ Future IAsyncFileSystem::incrementalDeleteFile(const std::string& filename FLOW_KNOBS->INCREMENTAL_DELETE_INTERVAL)); } - #line 2080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" namespace { // This generated class is to be used only via flowTestCase119() - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" template - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" class FlowTestCase119ActorState { - #line 2087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" public: - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" FlowTestCase119ActorState(UnitTestParameters const& params) - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" : params(params), - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" fileSize(5e9), - #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" filename("/tmp/__JUNK__") - #line 2098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" { fdb_probe_actor_create("flowTestCase119", reinterpret_cast(this)); @@ -2108,16 +2108,16 @@ class FlowTestCase119ActorState { int a_body1(int loopDepth=0) { try { - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture> __when_expr_0 = IAsyncFileSystem::filesystem()->open( filename, IAsyncFile::OPEN_ATOMIC_WRITE_AND_CREATE | IAsyncFile::OPEN_CREATE | IAsyncFile::OPEN_READWRITE, 0); - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2138,25 +2138,25 @@ class FlowTestCase119ActorState { } int a_body1cont1(int loopDepth) { - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_1 = f->sync(); - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(Reference const& __f,int loopDepth) { - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f = __f; - #line 2159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -2221,32 +2221,32 @@ class FlowTestCase119ActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_2 = f->truncate(fileSize); - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_2 = f->truncate(fileSize); - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2316,36 +2316,36 @@ class FlowTestCase119ActorState { } int a_body1cont3(Void const& _,int loopDepth) { - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f.clear(); - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_3 = IAsyncFileSystem::filesystem()->incrementalDeleteFile(filename, true); - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f.clear(); - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_3 = IAsyncFileSystem::filesystem()->incrementalDeleteFile(filename, true); - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2415,9 +2415,9 @@ class FlowTestCase119ActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase119ActorState(); static_cast(this)->destroy(); return 0; } - #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2420 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~FlowTestCase119ActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2427,9 +2427,9 @@ class FlowTestCase119ActorState { } int a_body1cont4(Void && _,int loopDepth) { - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase119ActorState(); static_cast(this)->destroy(); return 0; } - #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~FlowTestCase119ActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2500,20 +2500,20 @@ class FlowTestCase119ActorState { fdb_probe_actor_exit("flowTestCase119", reinterpret_cast(this), 3); } - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" UnitTestParameters params; - #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" int64_t fileSize; - #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" std::string filename; - #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" Reference f; - #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2511 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" }; // This generated class is to be used only via flowTestCase119() - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" class FlowTestCase119Actor final : public Actor, public ActorCallback< FlowTestCase119Actor, 0, Reference >, public ActorCallback< FlowTestCase119Actor, 1, Void >, public ActorCallback< FlowTestCase119Actor, 2, Void >, public ActorCallback< FlowTestCase119Actor, 3, Void >, public FastAllocated, public FlowTestCase119ActorState { - #line 2516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2525,9 +2525,9 @@ friend struct ActorCallback< FlowTestCase119Actor, 0, Reference >; friend struct ActorCallback< FlowTestCase119Actor, 1, Void >; friend struct ActorCallback< FlowTestCase119Actor, 2, Void >; friend struct ActorCallback< FlowTestCase119Actor, 3, Void >; - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" FlowTestCase119Actor(UnitTestParameters const& params) - #line 2530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" : Actor(), FlowTestCase119ActorState(params) { @@ -2554,41 +2554,41 @@ friend struct ActorCallback< FlowTestCase119Actor, 3, Void >; } }; } - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" static Future flowTestCase119( UnitTestParameters const& params ) { - #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" return Future(new FlowTestCase119Actor(params)); - #line 2561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } ACTOR_TEST_CASE(flowTestCase119, "/fileio/incrementalDelete") -#line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" +#line 132 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" - #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2567 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" namespace { // This generated class is to be used only via flowTestCase133() - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" template - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" class FlowTestCase133ActorState { - #line 2574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" public: - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" FlowTestCase133ActorState(UnitTestParameters const& params) - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" : params(params), - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" fileSize(100e6), - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" filename("/tmp/__JUNK__." + deterministicRandom()->randomUniqueID().toString()), - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" renamedFile("/tmp/__RENAMED_JUNK__." + deterministicRandom()->randomUniqueID().toString()), - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" data(new char[4096]), - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" readData(new char[4096]) - #line 2591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2591 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" { fdb_probe_actor_create("flowTestCase133", reinterpret_cast(this)); @@ -2601,16 +2601,16 @@ class FlowTestCase133ActorState { int a_body1(int loopDepth=0) { try { - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture> __when_expr_0 = IAsyncFileSystem::filesystem()->open( filename, IAsyncFile::OPEN_ATOMIC_WRITE_AND_CREATE | IAsyncFile::OPEN_CREATE | IAsyncFile::OPEN_READWRITE, 0644); - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 2613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2631,25 +2631,25 @@ class FlowTestCase133ActorState { } int a_body1cont1(int loopDepth) { - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_1 = f->sync(); - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(Reference const& __f,int loopDepth) { - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f = __f; - #line 2652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2652 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -2714,32 +2714,32 @@ class FlowTestCase133ActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_2 = f->truncate(fileSize); - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_2 = f->truncate(fileSize); - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2809,48 +2809,48 @@ class FlowTestCase133ActorState { } int a_body1cont3(Void const& _,int loopDepth) { - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" memset(data.get(), 0, 4096); - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" for(int i = 0;i < 16;++i) { - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" data[i] = deterministicRandom()->randomAlphaNumeric(); - #line 2818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_3 = f->write(data.get(), 4096, 0); - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" memset(data.get(), 0, 4096); - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" for(int i = 0;i < 16;++i) { - #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" data[i] = deterministicRandom()->randomAlphaNumeric(); - #line 2842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_3 = f->write(data.get(), 4096, 0); - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2920,32 +2920,32 @@ class FlowTestCase133ActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_4 = f->write(data.get(), 4096, fileSize - 4096); - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4(Void && _,int loopDepth) { - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_4 = f->write(data.get(), 4096, fileSize - 4096); - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2943 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 2948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3015,32 +3015,32 @@ class FlowTestCase133ActorState { } int a_body1cont6(Void const& _,int loopDepth) { - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_5 = f->sync(); - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont6when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont6(Void && _,int loopDepth) { - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_5 = f->sync(); - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3038 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_5.isReady()) { if (__when_expr_5.isError()) return a_body1Catch1(__when_expr_5.getError(), loopDepth); else return a_body1cont6when1(__when_expr_5.get(), loopDepth); }; static_cast(this)->actor_wait_state = 6; - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_5.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3110,36 +3110,36 @@ class FlowTestCase133ActorState { } int a_body1cont7(Void const& _,int loopDepth) { - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f.clear(); - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_6 = IAsyncFileSystem::filesystem()->renameFile(filename, renamedFile); - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont7when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont7(Void && _,int loopDepth) { - #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f.clear(); - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_6 = IAsyncFileSystem::filesystem()->renameFile(filename, renamedFile); - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_6.isReady()) { if (__when_expr_6.isError()) return a_body1Catch1(__when_expr_6.getError(), loopDepth); else return a_body1cont7when1(__when_expr_6.get(), loopDepth); }; static_cast(this)->actor_wait_state = 7; - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_6.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3209,32 +3209,32 @@ class FlowTestCase133ActorState { } int a_body1cont8(Void const& _,int loopDepth) { - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture> __when_expr_7 = IAsyncFileSystem::filesystem()->open(renamedFile, IAsyncFile::OPEN_READONLY, 0); - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3216 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont8when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont8(Void && _,int loopDepth) { - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture> __when_expr_7 = IAsyncFileSystem::filesystem()->open(renamedFile, IAsyncFile::OPEN_READONLY, 0); - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_7.isReady()) { if (__when_expr_7.isError()) return a_body1Catch1(__when_expr_7.getError(), loopDepth); else return a_body1cont8when1(__when_expr_7.get(), loopDepth); }; static_cast(this)->actor_wait_state = 8; - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_7.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3304,80 +3304,80 @@ class FlowTestCase133ActorState { } int a_body1cont9(Reference const& _f,int loopDepth) { - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f = _f; - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" bool renamedExists = false; - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" auto bName = basename(renamedFile); - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" auto files = platform::listFiles("/tmp/"); - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" for( const auto& file : files ) { - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (file == bName) - #line 3319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" { - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" renamedExists = true; - #line 3323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(file != filename); - #line 3327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(renamedExists); - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_8 = f->read(readData.get(), 4096, 0); - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont9when1(__when_expr_8.get(), loopDepth); }; static_cast(this)->actor_wait_state = 9; - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont9(Reference && _f,int loopDepth) { - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f = _f; - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" bool renamedExists = false; - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" auto bName = basename(renamedFile); - #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" auto files = platform::listFiles("/tmp/"); - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" for( const auto& file : files ) { - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (file == bName) - #line 3359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" { - #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" renamedExists = true; - #line 3363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(file != filename); - #line 3367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(renamedExists); - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_8 = f->read(readData.get(), 4096, 0); - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_8.isReady()) { if (__when_expr_8.isError()) return a_body1Catch1(__when_expr_8.getError(), loopDepth); else return a_body1cont9when1(__when_expr_8.get(), loopDepth); }; static_cast(this)->actor_wait_state = 9; - #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_8.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3447,44 +3447,44 @@ class FlowTestCase133ActorState { } int a_body1cont10(int const& length,int loopDepth) { - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(length == 4096); - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(memcmp(readData.get(), data.get(), 4096) == 0); - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f.clear(); - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_9 = IAsyncFileSystem::filesystem()->deleteFile(renamedFile, true); - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3460 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1cont10when1(__when_expr_9.get(), loopDepth); }; static_cast(this)->actor_wait_state = 10; - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3465 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont10(int && length,int loopDepth) { - #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(length == 4096); - #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(memcmp(readData.get(), data.get(), 4096) == 0); - #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f.clear(); - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_9 = IAsyncFileSystem::filesystem()->deleteFile(renamedFile, true); - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_9.isReady()) { if (__when_expr_9.isError()) return a_body1Catch1(__when_expr_9.getError(), loopDepth); else return a_body1cont10when1(__when_expr_9.get(), loopDepth); }; static_cast(this)->actor_wait_state = 10; - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_9.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3487 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3554,9 +3554,9 @@ class FlowTestCase133ActorState { } int a_body1cont10cont1(Void const& _,int loopDepth) { - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase133ActorState(); static_cast(this)->destroy(); return 0; } - #line 3559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~FlowTestCase133ActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3566,9 +3566,9 @@ class FlowTestCase133ActorState { } int a_body1cont10cont1(Void && _,int loopDepth) { - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase133ActorState(); static_cast(this)->destroy(); return 0; } - #line 3571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~FlowTestCase133ActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3639,26 +3639,26 @@ class FlowTestCase133ActorState { fdb_probe_actor_exit("flowTestCase133", reinterpret_cast(this), 9); } - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" UnitTestParameters params; - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" int64_t fileSize; - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" std::string filename; - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" std::string renamedFile; - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" std::unique_ptr data; - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" std::unique_ptr readData; - #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" Reference f; - #line 3656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" }; // This generated class is to be used only via flowTestCase133() - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" class FlowTestCase133Actor final : public Actor, public ActorCallback< FlowTestCase133Actor, 0, Reference >, public ActorCallback< FlowTestCase133Actor, 1, Void >, public ActorCallback< FlowTestCase133Actor, 2, Void >, public ActorCallback< FlowTestCase133Actor, 3, Void >, public ActorCallback< FlowTestCase133Actor, 4, Void >, public ActorCallback< FlowTestCase133Actor, 5, Void >, public ActorCallback< FlowTestCase133Actor, 6, Void >, public ActorCallback< FlowTestCase133Actor, 7, Reference >, public ActorCallback< FlowTestCase133Actor, 8, int >, public ActorCallback< FlowTestCase133Actor, 9, Void >, public FastAllocated, public FlowTestCase133ActorState { - #line 3661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3676,9 +3676,9 @@ friend struct ActorCallback< FlowTestCase133Actor, 6, Void >; friend struct ActorCallback< FlowTestCase133Actor, 7, Reference >; friend struct ActorCallback< FlowTestCase133Actor, 8, int >; friend struct ActorCallback< FlowTestCase133Actor, 9, Void >; - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" FlowTestCase133Actor(UnitTestParameters const& params) - #line 3681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" : Actor(), FlowTestCase133ActorState(params) { @@ -3711,34 +3711,34 @@ friend struct ActorCallback< FlowTestCase133Actor, 9, Void >; } }; } - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" static Future flowTestCase133( UnitTestParameters const& params ) { - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" return Future(new FlowTestCase133Actor(params)); - #line 3718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } ACTOR_TEST_CASE(flowTestCase133, "/fileio/rename") -#line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" +#line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" // Truncating to extend size should zero the new data - #line 3725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" namespace { // This generated class is to be used only via flowTestCase187() - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" template - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" class FlowTestCase187ActorState { - #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" public: - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" FlowTestCase187ActorState(UnitTestParameters const& params) - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" : params(params), - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" filename("/tmp/__JUNK__") - #line 3741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" { fdb_probe_actor_create("flowTestCase187", reinterpret_cast(this)); @@ -3751,16 +3751,16 @@ class FlowTestCase187ActorState { int a_body1(int loopDepth=0) { try { - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture> __when_expr_0 = IAsyncFileSystem::filesystem()->open( filename, IAsyncFile::OPEN_ATOMIC_WRITE_AND_CREATE | IAsyncFile::OPEN_CREATE | IAsyncFile::OPEN_READWRITE, 0); - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3758 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3781,27 +3781,27 @@ class FlowTestCase187ActorState { } int a_body1cont1(int loopDepth) { - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" data = std::array(); - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_1 = f->sync(); - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(Reference const& __f,int loopDepth) { - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f = __f; - #line 3804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -3866,32 +3866,32 @@ class FlowTestCase187ActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_2 = f->truncate(4096); - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_2 = f->truncate(4096); - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3894 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3961,32 +3961,32 @@ class FlowTestCase187ActorState { } int a_body1cont3(Void const& _,int loopDepth) { - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_3 = f->read(&data[0], 4096, 0); - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3973 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_3 = f->read(&data[0], 4096, 0); - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont3when1(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 4; - #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 3989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4056,52 +4056,52 @@ class FlowTestCase187ActorState { } int a_body1cont4(int const& length,int loopDepth) { - #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(length == 4096); - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" for( auto c : data ) { - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(c == '\0'); - #line 4065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 4065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f.clear(); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_4 = IAsyncFileSystem::filesystem()->incrementalDeleteFile(filename, true); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 4073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 4078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont4(int && length,int loopDepth) { - #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(length == 4096); - #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" for( auto c : data ) { - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" ASSERT(c == '\0'); - #line 4091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 4091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" f.clear(); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" StrictFuture __when_expr_4 = IAsyncFileSystem::filesystem()->incrementalDeleteFile(filename, true); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 4099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 4099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont4when1(__when_expr_4.get(), loopDepth); }; static_cast(this)->actor_wait_state = 5; - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 4104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -4171,9 +4171,9 @@ class FlowTestCase187ActorState { } int a_body1cont5(Void const& _,int loopDepth) { - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase187ActorState(); static_cast(this)->destroy(); return 0; } - #line 4176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 4176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~FlowTestCase187ActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4183,9 +4183,9 @@ class FlowTestCase187ActorState { } int a_body1cont5(Void && _,int loopDepth) { - #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase187ActorState(); static_cast(this)->destroy(); return 0; } - #line 4188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 4188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~FlowTestCase187ActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4256,20 +4256,20 @@ class FlowTestCase187ActorState { fdb_probe_actor_exit("flowTestCase187", reinterpret_cast(this), 4); } - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" UnitTestParameters params; - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" std::string filename; - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" Reference f; - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" std::array data; - #line 4267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 4267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" }; // This generated class is to be used only via flowTestCase187() - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" class FlowTestCase187Actor final : public Actor, public ActorCallback< FlowTestCase187Actor, 0, Reference >, public ActorCallback< FlowTestCase187Actor, 1, Void >, public ActorCallback< FlowTestCase187Actor, 2, Void >, public ActorCallback< FlowTestCase187Actor, 3, int >, public ActorCallback< FlowTestCase187Actor, 4, Void >, public FastAllocated, public FlowTestCase187ActorState { - #line 4272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 4272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4282,9 +4282,9 @@ friend struct ActorCallback< FlowTestCase187Actor, 1, Void >; friend struct ActorCallback< FlowTestCase187Actor, 2, Void >; friend struct ActorCallback< FlowTestCase187Actor, 3, int >; friend struct ActorCallback< FlowTestCase187Actor, 4, Void >; - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" FlowTestCase187Actor(UnitTestParameters const& params) - #line 4287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 4287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" : Actor(), FlowTestCase187ActorState(params) { @@ -4312,12 +4312,12 @@ friend struct ActorCallback< FlowTestCase187Actor, 4, Void >; } }; } - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" static Future flowTestCase187( UnitTestParameters const& params ) { - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" return Future(new FlowTestCase187Actor(params)); - #line 4319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.g.cpp" + #line 4319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.g.cpp" } ACTOR_TEST_CASE(flowTestCase187, "/fileio/truncateAndRead") -#line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/fdbrpc/IAsyncFile.actor.cpp" +#line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/IAsyncFile.actor.cpp" diff --git a/src/flow/IThreadPool.cpp b/src/flow/IThreadPool.cpp index a898d30..477559d 100644 --- a/src/flow/IThreadPool.cpp +++ b/src/flow/IThreadPool.cpp @@ -21,9 +21,20 @@ #include "flow/IThreadPool.h" #include +// The ifndef's allow us to compile with pre-built boost. Otherwise, we get +// errors about double-defines. As of this writing, the automatically downloaded +// build of boost doesn't define these, but the pre-built version does. (The old +// prebuilt version was being silently ignored by cmake, so it's unclear when the +// compatibility divergence started) +#ifndef BOOST_SYSTEM_NO_LIB #define BOOST_SYSTEM_NO_LIB +#endif +#ifndef BOOST_DATE_TIME_NO_LIB #define BOOST_DATE_TIME_NO_LIB +#endif +#ifndef BOOST_REGEX_NO_LIB #define BOOST_REGEX_NO_LIB +#endif #include "boost/asio.hpp" class ThreadPool final : public IThreadPool, public ReferenceCounted { diff --git a/src/flow/IThreadPoolTest.actor.cpp b/src/flow/IThreadPoolTest.actor.cpp index ed18c17..023a4aa 100644 --- a/src/flow/IThreadPoolTest.actor.cpp +++ b/src/flow/IThreadPoolTest.actor.cpp @@ -24,7 +24,7 @@ #include "flow/IThreadPool.h" #include -#include +#include #include "flow/UnitTest.h" #include "flow/actorcompiler.h" // has to be last include diff --git a/src/flow/IThreadPoolTest.actor.g.cpp b/src/flow/IThreadPoolTest.actor.g.cpp index e6a236c..8afe8c6 100644 --- a/src/flow/IThreadPoolTest.actor.g.cpp +++ b/src/flow/IThreadPoolTest.actor.g.cpp @@ -26,7 +26,7 @@ #include "flow/IThreadPool.h" #include -#include +#include #include "flow/UnitTest.h" #include "flow/actorcompiler.h" // has to be last include diff --git a/src/flow/JsonTraceLogFormatter.cpp b/src/flow/JsonTraceLogFormatter.cpp index 2323d3d..3e5239b 100644 --- a/src/flow/JsonTraceLogFormatter.cpp +++ b/src/flow/JsonTraceLogFormatter.cpp @@ -80,6 +80,6 @@ std::string JsonTraceLogFormatter::formatEvent(const TraceEventFields& fields) c escapeString(oss, iter->second); oss << "\""; } - oss << " }\r\n"; + oss << " }\n"; return std::move(oss).str(); } diff --git a/src/flow/Knobs.cpp b/src/flow/Knobs.cpp index 1adbbe9..2919874 100644 --- a/src/flow/Knobs.cpp +++ b/src/flow/Knobs.cpp @@ -18,9 +18,13 @@ * limitations under the License. */ +#include "flow/EncryptUtils.h" +#include "flow/Error.h" #include "flow/flow.h" #include "flow/Knobs.h" #include "flow/BooleanParam.h" +#include "flow/UnitTest.h" + #include #include @@ -67,8 +71,8 @@ void FlowKnobs::initialize(Randomize randomize, IsSimulated isSimulated) { init( SATURATION_PROFILING_MAX_LOG_INTERVAL, 5.0 ); init( SATURATION_PROFILING_LOG_BACKOFF, 2.0 ); - init( RANDOMSEED_RETRY_LIMIT, 4 ); init( FAST_ALLOC_LOGGING_BYTES, 10e6 ); + init( FAST_ALLOC_ALLOW_GUARD_PAGES, false ); init( HUGE_ARENA_LOGGING_BYTES, 100e6 ); init( HUGE_ARENA_LOGGING_INTERVAL, 5.0 ); @@ -80,10 +84,19 @@ void FlowKnobs::initialize(Randomize randomize, IsSimulated isSimulated) { init( WRITE_TRACING_ENABLED, true ); if( randomize && BUGGIFY ) WRITE_TRACING_ENABLED = false; - init( TRACING_SAMPLE_RATE, 0.0 ); // Fraction of distributed traces (not spans) to sample (0 means ignore all traces) + init( TRACING_SAMPLE_RATE, 0.0 ); if (randomize && BUGGIFY) TRACING_SAMPLE_RATE = 0.01; // Fraction of distributed traces (not spans) to sample (0 means ignore all traces) init( TRACING_UDP_LISTENER_ADDR, "127.0.0.1" ); // Only applicable if TracerType is set to a network option init( TRACING_UDP_LISTENER_PORT, 8889 ); // Only applicable if TracerType is set to a network option + // Native metrics + init( METRICS_DATA_MODEL, "none"); if (randomize && BUGGIFY) METRICS_DATA_MODEL="otel"; + init( METRICS_EMISSION_INTERVAL, 30.0 ); // The time (in seconds) between metric flushes + init( STATSD_UDP_EMISSION_ADDR, "127.0.0.1"); + init( STATSD_UDP_EMISSION_PORT, 8125 ); + init( OTEL_UDP_EMISSION_ADDR, "127.0.0.1"); + init( OTEL_UDP_EMISSION_PORT, 8903 ); + init( METRICS_EMIT_DDSKETCH, false ); // Determines if DDSketch buckets will get emitted + //connectionMonitor init( CONNECTION_MONITOR_LOOP_TIME, isSimulated ? 0.75 : 1.0 ); if( randomize && BUGGIFY ) CONNECTION_MONITOR_LOOP_TIME = 6.0; init( CONNECTION_MONITOR_TIMEOUT, isSimulated ? 1.50 : 2.0 ); if( randomize && BUGGIFY ) CONNECTION_MONITOR_TIMEOUT = 6.0; @@ -106,8 +119,7 @@ void FlowKnobs::initialize(Randomize randomize, IsSimulated isSimulated) { init( PEER_UNAVAILABLE_FOR_LONG_TIME_TIMEOUT, 3600.0 ); init( INCOMPATIBLE_PEER_DELAY_BEFORE_LOGGING, 5.0 ); init( PING_LOGGING_INTERVAL, 3.0 ); - init( PING_SAMPLE_AMOUNT, 100 ); - init( NETWORK_CONNECT_SAMPLE_AMOUNT, 100 ); + init( PING_SKETCH_ACCURACY, 0.1 ); init( TLS_CERT_REFRESH_DELAY_SECONDS, 12*60*60 ); init( TLS_SERVER_CONNECTION_THROTTLE_TIMEOUT, 9.0 ); @@ -126,6 +138,15 @@ void FlowKnobs::initialize(Randomize randomize, IsSimulated isSimulated) { init( NETWORK_TEST_REQUEST_SIZE, 1 ); init( NETWORK_TEST_SCRIPT_MODE, false ); + //Authorization + init( ALLOW_TOKENLESS_TENANT_ACCESS, false ); + init( AUDIT_LOGGING_ENABLED, true ); + init( PUBLIC_KEY_FILE_MAX_SIZE, 1024 * 1024 ); + init( PUBLIC_KEY_FILE_REFRESH_INTERVAL_SECONDS, 300 ); + init( AUDIT_TIME_WINDOW, 5.0 ); + init( TOKEN_CACHE_SIZE, 2000 ); + init( WIPE_SENSITIVE_DATA_FROM_PACKET_BUFFER, true ); + //AsyncFileCached init( PAGE_CACHE_4K, 2LL<<30 ); init( PAGE_CACHE_64K, 200LL<<20 ); @@ -133,6 +154,7 @@ void FlowKnobs::initialize(Randomize randomize, IsSimulated isSimulated) { init( SIM_PAGE_CACHE_64K, 1e7 ); init( BUGGIFY_SIM_PAGE_CACHE_4K, 1e6 ); init( BUGGIFY_SIM_PAGE_CACHE_64K, 1e6 ); + init( BLOB_WORKER_PAGE_CACHE, 500e6 ); init( MAX_EVICT_ATTEMPTS, 100 ); if( randomize && BUGGIFY ) MAX_EVICT_ATTEMPTS = 2; init( CACHE_EVICTION_POLICY, "random" ); init( PAGE_CACHE_TRUNCATE_LOOKUP_FRACTION, 0.1 ); if( randomize && BUGGIFY ) PAGE_CACHE_TRUNCATE_LOOKUP_FRACTION = 0.0; else if( randomize && BUGGIFY ) PAGE_CACHE_TRUNCATE_LOOKUP_FRACTION = 1.0; @@ -153,6 +175,9 @@ void FlowKnobs::initialize(Randomize randomize, IsSimulated isSimulated) { //AsyncFileKAIO init( MAX_OUTSTANDING, 64 ); init( MIN_SUBMIT, 10 ); + init( SQLITE_DISK_METRIC_LOGGING_INTERVAL, 5.0 ); + init( KAIO_LATENCY_LOGGING_INTERVAL, 30.0 ); + init( KAIO_LATENCY_SKETCH_ACCURACY, 0.01 ); init( PAGE_WRITE_CHECKSUM_HISTORY, 0 ); if( randomize && BUGGIFY ) PAGE_WRITE_CHECKSUM_HISTORY = 10000000; init( DISABLE_POSIX_KERNEL_AIO, 0 ); @@ -167,12 +192,11 @@ void FlowKnobs::initialize(Randomize randomize, IsSimulated isSimulated) { init( LOW_PRIORITY_MAX_DELAY, 5.0 ); // HTTP - init( HTTP_READ_SIZE, 128*1024 ); - init( HTTP_SEND_SIZE, 32*1024 ); + init( HTTP_READ_SIZE, 128*1024 ); if (randomize && BUGGIFY) HTTP_READ_SIZE = deterministicRandom()->randomSkewedUInt32(1024, 2 * HTTP_READ_SIZE); + init( HTTP_SEND_SIZE, 32*1024 ); if (randomize && BUGGIFY) HTTP_SEND_SIZE = deterministicRandom()->randomSkewedUInt32(1024, 2 * HTTP_SEND_SIZE); init( HTTP_VERBOSE_LEVEL, 0 ); init( HTTP_REQUEST_ID_HEADER, "" ); init( HTTP_RESPONSE_SKIP_VERIFY_CHECKSUM_FOR_PARTIAL_CONTENT, false ); - init( HTTP_CONNECT_TRIES, 10 ); //IAsyncFile init( INCREMENTAL_DELETE_TRUNCATE_AMOUNT, 5e8 ); //500MB @@ -210,13 +234,14 @@ void FlowKnobs::initialize(Randomize randomize, IsSimulated isSimulated) { init( SLOW_NETWORK_LATENCY, 100e-3 ); init( MAX_CLOGGING_LATENCY, 0 ); if( randomize && BUGGIFY ) MAX_CLOGGING_LATENCY = 0.1 * deterministicRandom()->random01(); init( MAX_BUGGIFIED_DELAY, 0 ); if( randomize && BUGGIFY ) MAX_BUGGIFIED_DELAY = 0.2 * deterministicRandom()->random01(); + init( MAX_RUNLOOP_SLEEP_DELAY, 0 ); init( SIM_CONNECT_ERROR_MODE, deterministicRandom()->randomInt(0,3) ); //Tracefiles init( ZERO_LENGTH_FILE_PAD, 1 ); init( TRACE_FLUSH_INTERVAL, 0.25 ); init( TRACE_RETRY_OPEN_INTERVAL, 1.00 ); - init( MIN_TRACE_SEVERITY, isSimulated ? 1 : 10 ); // Related to the trace severity in Trace.h + init( MIN_TRACE_SEVERITY, isSimulated ? 1 : 10, Atomic::NO ); // Related to the trace severity in Trace.h init( MAX_TRACE_SUPPRESSIONS, 1e4 ); init( TRACE_DATETIME_ENABLED, true ); // trace time in human readable format (always real time) init( TRACE_SYNC_ENABLED, 0 ); @@ -232,7 +257,7 @@ void FlowKnobs::initialize(Randomize randomize, IsSimulated isSimulated) { //TDMetrics init( MAX_METRICS, 600 ); - init( MAX_METRIC_SIZE, 2500 ); + init( MAX_METRIC_SIZE, 2500, Atomic::NO ); init( MAX_METRIC_LEVEL, 25 ); init( METRIC_LEVEL_DIVISOR, log(4) ); init( METRIC_LIMIT_START_QUEUE_SIZE, 10 ); // The queue size at which to start restricting logging by disabling levels @@ -280,6 +305,31 @@ void FlowKnobs::initialize(Randomize randomize, IsSimulated isSimulated) { init( HEALTH_MONITOR_MARK_FAILED_UNSTABLE_CONNECTIONS, true ); init( HEALTH_MONITOR_CLIENT_REQUEST_INTERVAL_SECS, 30 ); init( HEALTH_MONITOR_CONNECTION_MAX_CLOSED, 5 ); + + // Encryption + init( ENCRYPT_CIPHER_KEY_CACHE_TTL, isSimulated ? 5 * 60 : 10 * 60 ); + if ( randomize && BUGGIFY) { ENCRYPT_CIPHER_KEY_CACHE_TTL = deterministicRandom()->randomInt(2, 10) * 60; } + init( ENCRYPT_KEY_REFRESH_INTERVAL, isSimulated ? 60 : 8 * 60 ); + if ( randomize && BUGGIFY) { ENCRYPT_KEY_REFRESH_INTERVAL = deterministicRandom()->randomInt(2, 10); } + init( ENCRYPT_KEY_HEALTH_CHECK_INTERVAL, 10 ); + if ( randomize && BUGGIFY) { ENCRYPT_KEY_HEALTH_CHECK_INTERVAL = deterministicRandom()->randomInt(10, 60); } + init( EKP_HEALTH_CHECK_REQUEST_TIMEOUT, 10.0); + init( ENCRYPT_KEY_CACHE_LOGGING_INTERVAL, 5.0 ); + init( ENCRYPT_KEY_CACHE_LATENCY_LOGGING_INTERVAL, 60.0 ); + init( ENCRYPT_KEY_CACHE_LOGGING_SKETCH_ACCURACY, 0.01 ); + // Refer to EncryptUtil::EncryptAuthTokenAlgo for more details + init( ENCRYPT_HEADER_AUTH_TOKEN_ENABLED, false ); if ( randomize && BUGGIFY ) { ENCRYPT_HEADER_AUTH_TOKEN_ENABLED = !ENCRYPT_HEADER_AUTH_TOKEN_ENABLED; } + init( ENCRYPT_HEADER_AUTH_TOKEN_ALGO, 0 ); if ( randomize && ENCRYPT_HEADER_AUTH_TOKEN_ENABLED ) { ENCRYPT_HEADER_AUTH_TOKEN_ALGO = getRandomAuthTokenAlgo(); } + init( ENCRYPT_INPLACE_ENABLED, false ); if ( randomize && BUGGIFY ) { ENCRYPT_INPLACE_ENABLED = true; } + + // REST Client + init( RESTCLIENT_MAX_CONNECTIONPOOL_SIZE, 10 ); + init( RESTCLIENT_CONNECT_TRIES, 10 ); + init( RESTCLIENT_CONNECT_TIMEOUT, 10 ); + init( RESTCLIENT_MAX_CONNECTION_LIFE, 120 ); + init( RESTCLIENT_REQUEST_TRIES, 10 ); + init( RESTCLIENT_REQUEST_TIMEOUT_SEC, 120 ); + init( REST_LOG_LEVEL, 3 ); } // clang-format on @@ -293,22 +343,68 @@ static std::string toLower(std::string const& name) { return lower_name; } +// Converts the given string into a double. If any errors are +// encountered, it throws an invalid_option_value exception. +static double safe_stod(std::string const& str) { + size_t n; + double value = std::stod(str, &n); + if (n < str.size()) { + throw invalid_option_value(); + } + return value; +} + +// Converts the given (possibly hexadecimal) string into an +// integer. If any errors are encountered, it throws an +// invalid_option_value exception. +static int safe_stoi(std::string const& str) { + size_t n; + int value = std::stoi(str, &n, 0); + if (n < str.size()) { + throw invalid_option_value(); + } + return value; +} + +// Converts the given (possibly hexadecimal) string into a 64-bit +// integer. If any errors are encountered, it throws an +// invalid_option_value exception. +static int64_t safe_stoi64(std::string const& str) { + size_t n; + int64_t value = static_cast(std::stoll(str, &n, 0)); + if (n < str.size()) { + throw invalid_option_value(); + } + return value; +} + +// Converts the given string into a bool. "true" and "false" are case +// insenstively interpreted as true and false. Otherwise, any non-zero +// integer is true. If any errors are encountered, it throws an +// invalid_option_value exception. +static bool safe_stob(std::string const& str) { + if (toLower(str) == "true") { + return true; + } else if (toLower(str) == "false") { + return false; + } else { + return safe_stoi(str) != 0; + } +} + +// Parses a string value into the appropriate type based upon the knob +// name. If any errors are encountered, it throws an +// invalid_option_value exception. ParsedKnobValue Knobs::parseKnobValue(std::string const& knob, std::string const& value) const { try { if (double_knobs.count(knob)) { - return std::stod(value); + return safe_stod(value); } else if (bool_knobs.count(knob)) { - if (toLower(value) == "true") { - return true; - } else if (toLower(value) == "false") { - return false; - } else { - return (std::stoi(value) != 0); - } + return safe_stob(value); } else if (int64_knobs.count(knob)) { - return static_cast(std::stol(value, nullptr, 0)); + return safe_stoi64(value); } else if (int_knobs.count(knob)) { - return std::stoi(value, nullptr, 0); + return safe_stoi(value); } else if (string_knobs.count(knob)) { return value; } @@ -460,3 +556,23 @@ void Knobs::trace() const { .detail("Value", *k.second.value) .detail("Atomic", k.second.atomic); } + +TEST_CASE("/flow/Knobs/ParseKnobValue") { + // Test the safe conversion functions. + ASSERT_EQ(safe_stod("4.0"), 4.0); + + ASSERT_EQ(safe_stoi("4"), 4); + + ASSERT_EQ(safe_stoi64("4"), (int64_t)4); + try { + [[maybe_unused]] int64_t value = safe_stoi64("4GiB"); + UNREACHABLE(); + } catch (Error& e) { + ASSERT_EQ(e.code(), error_code_invalid_option_value); + } + + ASSERT_EQ(safe_stob("true"), true); + ASSERT_EQ(safe_stob("false"), false); + + return Void(); +} diff --git a/src/flow/LinkTest.cpp b/src/flow/LinkTest.cpp new file mode 100644 index 0000000..73dcd81 --- /dev/null +++ b/src/flow/LinkTest.cpp @@ -0,0 +1,8 @@ +// When creating a static or shared library, undefined symbols will be ignored. +// Since we want to ensure no symbols from other modules are used, each module +// will create an executable so the linker will throw errors if it can't find +// the declaration of a symbol. This class defines a dummy main function so the +// executable can be built. +int main() { + return 0; +} diff --git a/src/flow/MkCert.cpp b/src/flow/MkCert.cpp new file mode 100644 index 0000000..b62f156 --- /dev/null +++ b/src/flow/MkCert.cpp @@ -0,0 +1,372 @@ +/* + * MkCert.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "flow/Arena.h" +#include "flow/AutoCPointer.h" +#include "flow/IRandom.h" +#include "flow/MkCert.h" +#include "flow/PKey.h" +#include "flow/ScopeExit.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace { + +[[noreturn]] void traceAndThrow(const char* condition, int line) { + auto te = TraceEvent(SevWarnAlways, "MkCertOrKeyError"); + te.suppressFor(10).detail("Line", line).detail("Condition", condition); + if (auto err = ::ERR_get_error()) { + char buf[256]{ + 0, + }; + ::ERR_error_string_n(err, buf, sizeof(buf)); + te.detail("OpenSSLError", static_cast(buf)); + } + throw tls_error(); +} + +} // anonymous namespace + +#define OSSL_ASSERT(condition) \ + do { \ + if (!(condition)) \ + traceAndThrow(#condition, __LINE__); \ + } while (false) + +namespace mkcert { + +// Helper functions working with OpenSSL native types +std::shared_ptr readX509CertPem(StringRef x509CertPem); +StringRef writeX509CertPem(Arena& arena, const std::shared_ptr& nativeCert); + +struct CertAndKeyNative { + std::shared_ptr cert; + PrivateKey privateKey; + bool valid() const noexcept { return cert && privateKey; } + // self-signed cert case + bool null() const noexcept { return !cert && !privateKey; } + using SelfType = CertAndKeyNative; + using PemType = CertAndKeyRef; + + static SelfType fromPem(PemType certAndKey) { + auto ret = SelfType{}; + if (certAndKey.empty()) + return ret; + auto [certPem, keyPem] = certAndKey; + // either both set or both unset + ASSERT(!certPem.empty() && !keyPem.empty()); + ret.cert = readX509CertPem(certPem); + ret.privateKey = PrivateKey(PemEncoded{}, keyPem); + return ret; + } + + PemType toPem(Arena& arena) { + auto ret = PemType{}; + if (null()) + return ret; + ASSERT(valid()); + ret.certPem = writeX509CertPem(arena, cert); + ret.privateKeyPem = privateKey.writePem(arena); + return ret; + } +}; + +CertAndKeyNative makeCertNative(CertSpecRef spec, CertAndKeyNative issuer); + +void printCert(FILE* out, StringRef certPem) { + auto x = readX509CertPem(certPem); + OSSL_ASSERT(0 < ::X509_print_fp(out, x.get())); +} + +void printPrivateKey(FILE* out, StringRef privateKeyPem) { + auto key = PrivateKey(PemEncoded{}, privateKeyPem); + auto bio = AutoCPointer(::BIO_new_fp(out, BIO_NOCLOSE), &::BIO_free); + OSSL_ASSERT(bio); + OSSL_ASSERT(0 < ::EVP_PKEY_print_private(bio, key.nativeHandle(), 0, nullptr)); +} + +std::shared_ptr readX509CertPem(StringRef x509CertPem) { + ASSERT(!x509CertPem.empty()); + auto bio_mem = AutoCPointer(::BIO_new_mem_buf(x509CertPem.begin(), x509CertPem.size()), &::BIO_free); + OSSL_ASSERT(bio_mem); + auto ret = ::PEM_read_bio_X509(bio_mem, nullptr, nullptr, nullptr); + OSSL_ASSERT(ret); + return std::shared_ptr(ret, &::X509_free); +} + +StringRef writeX509CertPem(Arena& arena, const std::shared_ptr& nativeCert) { + auto mem = AutoCPointer(::BIO_new(::BIO_s_mem()), &::BIO_free); + OSSL_ASSERT(mem); + OSSL_ASSERT(::PEM_write_bio_X509(mem, nativeCert.get())); + auto bioBuf = std::add_pointer_t{}; + auto const len = ::BIO_get_mem_data(mem, &bioBuf); + ASSERT_GT(len, 0); + auto buf = new (arena) uint8_t[len]; + ::memcpy(buf, bioBuf, len); + return StringRef(buf, static_cast(len)); +} + +PrivateKey makeEcP256() { + auto params = AutoCPointer(nullptr, &::EVP_PKEY_free); + { + auto paramsRaw = std::add_pointer_t(); + auto pctx = AutoCPointer(::EVP_PKEY_CTX_new_id(EVP_PKEY_EC, nullptr), &::EVP_PKEY_CTX_free); + OSSL_ASSERT(pctx); + OSSL_ASSERT(0 < ::EVP_PKEY_paramgen_init(pctx)); + OSSL_ASSERT(0 < ::EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, NID_X9_62_prime256v1)); + OSSL_ASSERT(0 < ::EVP_PKEY_paramgen(pctx, ¶msRaw)); + OSSL_ASSERT(paramsRaw); + params.reset(paramsRaw); + } + // keygen + auto kctx = AutoCPointer(::EVP_PKEY_CTX_new(params, nullptr), &::EVP_PKEY_CTX_free); + OSSL_ASSERT(kctx); + auto key = AutoCPointer(nullptr, &::EVP_PKEY_free); + auto keyRaw = std::add_pointer_t(); + OSSL_ASSERT(0 < ::EVP_PKEY_keygen_init(kctx)); + OSSL_ASSERT(0 < ::EVP_PKEY_keygen(kctx, &keyRaw)); + OSSL_ASSERT(keyRaw); + key.reset(keyRaw); + auto len = 0; + len = ::i2d_PrivateKey(key, nullptr); + ASSERT_LT(0, len); + auto tmpArena = Arena(); + auto buf = new (tmpArena) uint8_t[len]; + auto out = std::add_pointer_t(buf); + len = ::i2d_PrivateKey(key, &out); + return PrivateKey(DerEncoded{}, StringRef(buf, len)); +} + +PrivateKey makeRsa4096Bit() { + auto kctx = AutoCPointer(::EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, nullptr), &::EVP_PKEY_CTX_free); + OSSL_ASSERT(kctx); + auto key = AutoCPointer(nullptr, &::EVP_PKEY_free); + auto keyRaw = std::add_pointer_t(); + OSSL_ASSERT(0 < ::EVP_PKEY_keygen_init(kctx)); + OSSL_ASSERT(0 < ::EVP_PKEY_CTX_set_rsa_keygen_bits(kctx, 4096)); + OSSL_ASSERT(0 < ::EVP_PKEY_keygen(kctx, &keyRaw)); + OSSL_ASSERT(keyRaw); + key.reset(keyRaw); + auto len = 0; + len = ::i2d_PrivateKey(key, nullptr); + ASSERT_LT(0, len); + auto tmpArena = Arena(); + auto buf = new (tmpArena) uint8_t[len]; + auto out = std::add_pointer_t(buf); + len = ::i2d_PrivateKey(key, &out); + return PrivateKey(DerEncoded{}, StringRef(buf, len)); +} + +CertAndKeyNative makeCertNative(CertSpecRef spec, CertAndKeyNative issuer) { + // issuer key/cert must be both set or both null (self-signed case) + ASSERT(issuer.valid() || issuer.null()); + + auto const isSelfSigned = issuer.null(); + auto keypair = makeEcP256(); + auto newX = ::X509_new(); + OSSL_ASSERT(newX); + auto x509Guard = ScopeExit([&newX]() { + if (newX) + ::X509_free(newX); + }); + auto smartX = std::shared_ptr(newX, &::X509_free); + newX = nullptr; + auto x = smartX.get(); + OSSL_ASSERT(0 < ::X509_set_version(x, 2 /*X509_VERSION_3*/)); + auto serialPtr = ::X509_get_serialNumber(x); + OSSL_ASSERT(serialPtr); + OSSL_ASSERT(0 < ::ASN1_INTEGER_set(serialPtr, spec.serialNumber)); + auto notBefore = ::X509_getm_notBefore(x); + OSSL_ASSERT(notBefore); + OSSL_ASSERT(::X509_gmtime_adj(notBefore, spec.offsetNotBefore)); + auto notAfter = ::X509_getm_notAfter(x); + OSSL_ASSERT(notAfter); + OSSL_ASSERT(::X509_gmtime_adj(notAfter, spec.offsetNotAfter)); + OSSL_ASSERT(0 < ::X509_set_pubkey(x, keypair.nativeHandle())); + auto subjectName = ::X509_get_subject_name(x); + OSSL_ASSERT(subjectName); + for (const auto& entry : spec.subjectName) { + // field names are expected to null-terminate + auto fieldName = entry.field.toString(); + OSSL_ASSERT(0 < + ::X509_NAME_add_entry_by_txt( + subjectName, fieldName.c_str(), MBSTRING_ASC, entry.bytes.begin(), entry.bytes.size(), -1, 0)); + } + auto issuerName = ::X509_get_issuer_name(x); + OSSL_ASSERT(issuerName); + OSSL_ASSERT(::X509_set_issuer_name(x, (isSelfSigned ? subjectName : ::X509_get_subject_name(issuer.cert.get())))); + auto ctx = X509V3_CTX{}; + X509V3_set_ctx_nodb(&ctx); + ::X509V3_set_ctx(&ctx, (isSelfSigned ? x : issuer.cert.get()), x, nullptr, nullptr, 0); + for (const auto& entry : spec.extensions) { + // extension field names and values are expected to null-terminate + auto extName = entry.field.toString(); + auto extValue = entry.bytes.toString(); + auto extNid = ::OBJ_txt2nid(extName.c_str()); + if (extNid == NID_undef) { + TraceEvent(SevWarnAlways, "MkCertInvalidExtName").suppressFor(10).detail("Name", extName); + throw tls_error(); + } +#ifdef OPENSSL_IS_BORINGSSL + auto ext = ::X509V3_EXT_nconf_nid(nullptr, &ctx, extNid, const_cast(extValue.c_str())); +#else + auto ext = ::X509V3_EXT_nconf_nid(nullptr, &ctx, extNid, extValue.c_str()); +#endif + OSSL_ASSERT(ext); + auto extGuard = ScopeExit([ext]() { ::X509_EXTENSION_free(ext); }); + OSSL_ASSERT(::X509_add_ext(x, ext, -1)); + } + OSSL_ASSERT( + ::X509_sign(x, (isSelfSigned ? keypair.nativeHandle() : issuer.privateKey.nativeHandle()), ::EVP_sha256())); + auto ret = CertAndKeyNative{}; + ret.cert = smartX; + ret.privateKey = keypair; + return ret; +} + +CertAndKeyRef CertAndKeyRef::make(Arena& arena, CertSpecRef spec, CertAndKeyRef issuerPem) { + auto issuer = CertAndKeyNative::fromPem(issuerPem); + auto newCertAndKey = makeCertNative(spec, issuer); + return newCertAndKey.toPem(arena); +} + +CertSpecRef CertSpecRef::make(Arena& arena, CertKind kind) { + auto spec = CertSpecRef{}; + spec.serialNumber = static_cast(deterministicRandom()->randomInt64(0, 1e10)); + spec.offsetNotBefore = 0; // now + spec.offsetNotAfter = 60 * 60 * 24 * 365; // 1 year from now + auto& subject = spec.subjectName; + subject.push_back(arena, { "countryName"_sr, "DE"_sr }); + subject.push_back(arena, { "localityName"_sr, "Berlin"_sr }); + subject.push_back(arena, { "organizationName"_sr, "FoundationDB"_sr }); + subject.push_back(arena, { "commonName"_sr, kind.getCommonName("FDB Testing Services"_sr, arena) }); + auto& ext = spec.extensions; + if (kind.isCA()) { + ext.push_back(arena, { "basicConstraints"_sr, "critical, CA:TRUE"_sr }); + ext.push_back(arena, { "keyUsage"_sr, "critical, digitalSignature, keyCertSign, cRLSign"_sr }); + } else { + ext.push_back(arena, { "basicConstraints"_sr, "critical, CA:FALSE"_sr }); + ext.push_back(arena, { "keyUsage"_sr, "critical, digitalSignature, keyEncipherment"_sr }); + ext.push_back(arena, { "extendedKeyUsage"_sr, "serverAuth, clientAuth"_sr }); + } + ext.push_back(arena, { "subjectKeyIdentifier"_sr, "hash"_sr }); + if (!kind.isRootCA()) + ext.push_back(arena, { "authorityKeyIdentifier"_sr, "keyid, issuer"_sr }); + return spec; +} + +StringRef concatCertChain(Arena& arena, CertChainRef chain) { + auto len = 0; + for (const auto& entry : chain) { + len += entry.certPem.size(); + } + if (len == 0) + return StringRef(); + auto buf = new (arena) uint8_t[len]; + auto offset = 0; + for (auto const& entry : chain) { + ::memcpy(&buf[offset], entry.certPem.begin(), entry.certPem.size()); + offset += entry.certPem.size(); + } + UNSTOPPABLE_ASSERT(offset == len); + return StringRef(buf, len); +} + +CertChainRef makeCertChain(Arena& arena, VectorRef specs, Optional rootAuthority) { + ASSERT_GT(specs.size(), 0); + // if rootAuthority is empty, use last element in specs to make root CA + if (!rootAuthority.present()) { + int const chainLength = specs.size(); + auto chain = new (arena) CertAndKeyRef[chainLength]; + auto caNative = makeCertNative(specs.back(), CertAndKeyNative{} /* empty issuer == self-signed */); + chain[chainLength - 1] = caNative.toPem(arena); + for (auto i = chainLength - 2; i >= 0; i--) { + auto cnkNative = makeCertNative(specs[i], caNative); + chain[i] = cnkNative.toPem(arena); + caNative = cnkNative; + } + return CertChainRef(chain, chainLength); + } else { + int const chainLength = specs.size() + 1; /* account for deep-copied rootAuthority */ + auto chain = new (arena) CertAndKeyRef[chainLength]; + auto caNative = CertAndKeyNative::fromPem(rootAuthority.get()); + chain[chainLength - 1] = rootAuthority.get().deepCopy(arena); + for (auto i = chainLength - 2; i >= 0; i--) { + auto cnkNative = makeCertNative(specs[i], caNative); + chain[i] = cnkNative.toPem(arena); + caNative = cnkNative; + } + return CertChainRef(chain, chainLength); + } +} + +VectorRef makeCertChainSpec(Arena& arena, unsigned length, ESide side) { + if (!length) + return {}; + auto specs = new (arena) CertSpecRef[length]; + auto const isServerSide = side == ESide::Server; + for (auto i = 0u; i < length; i++) { + auto kind = CertKind{}; + if (i == 0u) + kind = isServerSide ? CertKind(Server{}) : CertKind(Client{}); + else if (i == length - 1) + kind = isServerSide ? CertKind(ServerRootCA{}) : CertKind(ClientRootCA{}); + else + kind = isServerSide ? CertKind(ServerIntermediateCA{ i }) : CertKind(ClientIntermediateCA{ i }); + specs[i] = CertSpecRef::make(arena, kind); + } + return VectorRef(specs, length); +} + +CertChainRef makeCertChain(Arena& arena, unsigned length, ESide side) { + if (!length) + return {}; + // temporary arena for writing up specs + auto tmpArena = Arena(); + auto specs = makeCertChainSpec(tmpArena, length, side); + return makeCertChain(arena, specs, {} /*root*/); +} + +StringRef CertKind::getCommonName(StringRef prefix, Arena& arena) const { + auto const side = std::string(isClientSide() ? " Client" : " Server"); + if (isIntermediateCA()) { + auto const level = isClientSide() ? get().level : get().level; + return prefix.withSuffix(fmt::format("{} Intermediate {}", side, level), arena); + } else if (isRootCA()) { + return prefix.withSuffix(fmt::format("{} Root", side), arena); + } else { + return prefix.withSuffix(side, arena); + } +} + +} // namespace mkcert diff --git a/src/flow/MkCertCli.cpp b/src/flow/MkCertCli.cpp new file mode 100644 index 0000000..028baad --- /dev/null +++ b/src/flow/MkCertCli.cpp @@ -0,0 +1,340 @@ +/* + * MkCertCli.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include +#include +#include +#include +#include +#include +#include "flow/Arena.h" +#include "flow/Error.h" +#include "flow/MkCert.h" +#include "flow/network.h" +#include "flow/Platform.h" +#include "flow/ScopeExit.h" +#include "SimpleOpt/SimpleOpt.h" +#include "flow/TLSConfig.actor.h" +#include "flow/Trace.h" + +enum EMkCertOpt : int { + OPT_HELP, + OPT_SERVER_CHAIN_LEN, + OPT_CLIENT_CHAIN_LEN, + OPT_SERVER_CERT_FILE, + OPT_SERVER_KEY_FILE, + OPT_SERVER_CA_FILE, + OPT_CLIENT_CERT_FILE, + OPT_CLIENT_KEY_FILE, + OPT_CLIENT_CA_FILE, + OPT_EXPIRE_SERVER_CERT, + OPT_EXPIRE_CLIENT_CERT, + OPT_PRINT_SERVER_CERT, + OPT_PRINT_CLIENT_CERT, + OPT_PRINT_ARGUMENTS, + OPT_ENABLE_TRACE, + OPT_NO_SHARED_SERVER_CLIENT_CA, +}; + +CSimpleOpt::SOption gOptions[] = { { OPT_HELP, "--help", SO_NONE }, + { OPT_HELP, "-h", SO_NONE }, + { OPT_SERVER_CHAIN_LEN, "--server-chain-length", SO_REQ_SEP }, + { OPT_SERVER_CHAIN_LEN, "-S", SO_REQ_SEP }, + { OPT_CLIENT_CHAIN_LEN, "--client-chain-length", SO_REQ_SEP }, + { OPT_CLIENT_CHAIN_LEN, "-C", SO_REQ_SEP }, + { OPT_SERVER_CERT_FILE, "--server-cert-file", SO_REQ_SEP }, + { OPT_SERVER_KEY_FILE, "--server-key-file", SO_REQ_SEP }, + { OPT_SERVER_CA_FILE, "--server-ca-file", SO_REQ_SEP }, + { OPT_CLIENT_CERT_FILE, "--client-cert-file", SO_REQ_SEP }, + { OPT_CLIENT_KEY_FILE, "--client-key-file", SO_REQ_SEP }, + { OPT_CLIENT_CA_FILE, "--client-ca-file", SO_REQ_SEP }, + { OPT_EXPIRE_SERVER_CERT, "--expire-server-cert", SO_NONE }, + { OPT_EXPIRE_CLIENT_CERT, "--expire-client-cert", SO_NONE }, + { OPT_PRINT_SERVER_CERT, "--print-server-cert", SO_NONE }, + { OPT_PRINT_CLIENT_CERT, "--print-client-cert", SO_NONE }, + { OPT_PRINT_ARGUMENTS, "--print-args", SO_NONE }, + { OPT_ENABLE_TRACE, "--trace", SO_NONE }, + { OPT_NO_SHARED_SERVER_CLIENT_CA, "--no-shared-server-client-ca", SO_NONE }, + SO_END_OF_OPTIONS }; + +template +void printOptionUsage(std::string_view option, const char* (&&optionDescLines)[Len]) { + constexpr std::string_view optionIndent{ " " }; + constexpr std::string_view descIndent{ " " }; + fmt::print(stdout, "{}{}\n", optionIndent, option); + for (auto descLine : optionDescLines) + fmt::print(stdout, "{}{}\n", descIndent, descLine); + fmt::print("\n"); +} + +void printUsage(std::string_view binary) { + fmt::print(stdout, + "mkcert: FDB test certificate chain generator\n\n" + "Usage: {} [OPTIONS...]\n\n", + binary); + printOptionUsage("--server-chain-length LENGTH, -S LENGTH (default: 3)", + { "Length of server certificate chain including root CA certificate." }); + printOptionUsage("--client-chain-length LENGTH, -C LENGTH (default: 2)", + { "Length of client certificate chain including root CA certificate.", + "Use zero-length to test to setup untrusted clients." }); + printOptionUsage("--server-cert-file PATH (default: 'server_cert.pem')", + { "Output filename for server certificate chain excluding root CA.", + "Intended for SERVERS to use as 'tls_certificate_file'.", + "Certificates are concatenated in leaf-to-CA order." }); + printOptionUsage("--server-key-file PATH (default: 'server_key.pem')", + { "Output filename for server private key matching its leaf certificate.", + "Intended for SERVERS to use as 'tls_key_file'" }); + printOptionUsage("--server-ca-file PATH (default: 'server_ca.pem')", + { "Output filename for server's root CA certificate.", + "Content same as '--server-cert-file' for '--server-chain-length' == 1.", + "Intended for CLIENTS to use as 'tls_ca_file': i.e. cert issuer to trust." }); + printOptionUsage("--client-cert-file PATH (default: 'client_cert.pem')", + { "Output filename for client certificate chain excluding root CA.", + "Intended for CLIENTS to use as 'tls_certificate_file'.", + "Certificates are concatenated in leaf-to-CA order." }); + printOptionUsage("--client-key-file PATH (default: 'client_key.pem')", + { "Output filename for client private key matching its leaf certificate.", + "Intended for CLIENTS to use as 'tls_key_file'" }); + printOptionUsage("--client-ca-file PATH (default: 'client_ca.pem')", + { "Output filename for client's root CA certificate.", + "Content same as '--client-cert-file' for '--client-chain-length' == 1.", + "Intended for SERVERS to use as 'tls_ca_file': i.e. cert issuer to trust." }); + printOptionUsage("--expire-server-cert (default: no)", + { "Deliberately expire server's leaf certificate for testing." }); + printOptionUsage("--expire-client-cert (default: no)", + { "Deliberately expire client's leaf certificate for testing." }); + printOptionUsage("--print-server-cert (default: no)", + { "Print generated server certificate chain including root in human readable form.", + "Printed certificates are in leaf-to-CA order.", + "If --print-client-cert is also used, server chain precedes client's." }); + printOptionUsage("--print-client-cert (default: no)", + { "Print generated client certificate chain including root in human readable form.", + "Printed certificates are in leaf-to-CA order.", + "If --print-server-cert is also used, server chain precedes client's." }); + printOptionUsage("--print-args (default: no)", { "Print chain generation arguments." }); + printOptionUsage("--no-shared-server-client-ca (default: no)", + { "DISABLE the use of common root CA for client and server certificates." }); +} + +struct ChainSpec { + unsigned length; + std::string certFile; + std::string keyFile; + std::string caFile; + mkcert::ESide side; + bool expireLeaf; + void transformPathToAbs() { + certFile = abspath(certFile); + keyFile = abspath(keyFile); + caFile = abspath(caFile); + } + void print() { + fmt::print(stdout, "{}-side:\n", side == mkcert::ESide::Server ? "Server" : "Client"); + fmt::print(stdout, " Chain length: {}\n", length); + fmt::print(stdout, " Certificate file: {}\n", certFile); + fmt::print(stdout, " Key file: {}\n", keyFile); + fmt::print(stdout, " CA file: {}\n", caFile); + fmt::print(stdout, " Expire cert: {}\n", expireLeaf); + } + mkcert::CertChainRef makeChain(Arena& arena, Optional rootCa = {}); +}; + +mkcert::CertChainRef ChainSpec::makeChain(Arena& arena, Optional rootCa) { + auto checkStream = [](std::ofstream& fs, std::string_view filename) { + if (!fs) { + throw std::runtime_error(fmt::format("cannot open '{}' for writing", filename)); + } + }; + auto ofsCert = std::ofstream(certFile, std::ofstream::out | std::ofstream::trunc); + checkStream(ofsCert, certFile); + auto ofsKey = std::ofstream(keyFile, std::ofstream::out | std::ofstream::trunc); + checkStream(ofsKey, keyFile); + auto ofsCa = std::ofstream(caFile, std::ofstream::out | std::ofstream::trunc); + checkStream(ofsCa, caFile); + if (!length) + return {}; + auto specs = mkcert::makeCertChainSpec(arena, length, side); + if (expireLeaf) { + specs[0].offsetNotBefore = -60l * 60 * 24 * 365; + specs[0].offsetNotAfter = -10l; + } + auto chain = mkcert::makeCertChain(arena, specs, rootCa); + auto ca = chain.back().certPem; + ofsCa.write(reinterpret_cast(ca.begin()), ca.size()); + auto chainMinusRoot = chain; + if (chainMinusRoot.size() > 1) + chainMinusRoot.pop_back(); + auto cert = mkcert::concatCertChain(arena, chainMinusRoot); + ofsCert.write(reinterpret_cast(cert.begin()), cert.size()); + auto key = chain[0].privateKeyPem; + ofsKey.write(reinterpret_cast(key.begin()), key.size()); + return chain; +} + +int main(int argc, char** argv) { + // default chain specs + auto serverArgs = ChainSpec{ 3u /*length*/, "server_cert.pem", "server_key.pem", + "server_ca.pem", mkcert::ESide::Server, false /* expireLeaf */ }; + auto clientArgs = ChainSpec{ 2u /*length*/, "client_cert.pem", "client_key.pem", + "client_ca.pem", mkcert::ESide::Client, false /* expireLeaf */ }; + auto printServerCert = false; + auto printClientCert = false; + auto printArguments = false; + auto enableTrace = false; + auto noSharedServerClientCa = false; + auto args = CSimpleOpt(argc, argv, gOptions, SO_O_EXACT | SO_O_HYPHEN_TO_UNDERSCORE); + while (args.Next()) { + if (auto err = args.LastError()) { + switch (err) { + case SO_ARG_INVALID_DATA: + fmt::print(stderr, "ERROR: invalid argument to option '{}'\n", args.OptionText()); + return FDB_EXIT_ERROR; + case SO_ARG_INVALID: + fmt::print(stderr, "ERROR: argument given to no-argument option '{}'\n", args.OptionText()); + return FDB_EXIT_ERROR; + case SO_ARG_MISSING: + fmt::print(stderr, "ERROR: argument missing for option '{}'\n", args.OptionText()); + return FDB_EXIT_ERROR; + case SO_OPT_INVALID: + fmt::print(stderr, "ERROR: unknown option '{}'\n", args.OptionText()); + return FDB_EXIT_ERROR; + default: + fmt::print(stderr, "ERROR: unknown error {} with option '{}'\n", err, args.OptionText()); + return FDB_EXIT_ERROR; + } + } else { + auto const optId = args.OptionId(); + switch (optId) { + case OPT_HELP: + printUsage(argv[0]); + return FDB_EXIT_SUCCESS; + case OPT_SERVER_CHAIN_LEN: + try { + serverArgs.length = std::stoul(args.OptionArg()); + assert(serverArgs.length > 0); + } catch (std::exception const& ex) { + fmt::print(stderr, "ERROR: Invalid chain length ({})\n", ex.what()); + return FDB_EXIT_ERROR; + } + break; + case OPT_CLIENT_CHAIN_LEN: + try { + clientArgs.length = std::stoul(args.OptionArg()); + assert(clientArgs.length > 0); + } catch (std::exception const& ex) { + fmt::print(stderr, "ERROR: Invalid chain length ({})\n", ex.what()); + return FDB_EXIT_ERROR; + } + break; + case OPT_SERVER_CERT_FILE: + serverArgs.certFile.assign(args.OptionArg()); + break; + case OPT_SERVER_KEY_FILE: + serverArgs.keyFile.assign(args.OptionArg()); + break; + case OPT_SERVER_CA_FILE: + serverArgs.caFile.assign(args.OptionArg()); + break; + case OPT_CLIENT_CERT_FILE: + clientArgs.certFile.assign(args.OptionArg()); + break; + case OPT_CLIENT_KEY_FILE: + clientArgs.keyFile.assign(args.OptionArg()); + break; + case OPT_CLIENT_CA_FILE: + clientArgs.caFile.assign(args.OptionArg()); + break; + case OPT_EXPIRE_SERVER_CERT: + serverArgs.expireLeaf = true; + break; + case OPT_EXPIRE_CLIENT_CERT: + clientArgs.expireLeaf = true; + break; + case OPT_PRINT_SERVER_CERT: + printServerCert = true; + break; + case OPT_PRINT_CLIENT_CERT: + printClientCert = true; + break; + case OPT_PRINT_ARGUMENTS: + printArguments = true; + break; + case OPT_ENABLE_TRACE: + enableTrace = true; + break; + case OPT_NO_SHARED_SERVER_CLIENT_CA: + noSharedServerClientCa = true; + break; + default: + fmt::print(stderr, "ERROR: Unknown option {}\n", args.OptionText()); + return FDB_EXIT_ERROR; + } + } + } + // Need to involve flow for the TraceEvent. + try { + platformInit(); + Error::init(); + g_network = newNet2(TLSConfig()); + if (enableTrace) + openTraceFile({}, 10 << 20, 10 << 20, ".", "mkcert"); + auto thread = std::thread([]() { g_network->run(); }); + auto cleanUpGuard = ScopeExit([&thread, enableTrace]() { + g_network->stop(); + thread.join(); + if (enableTrace) + closeTraceFile(); + }); + + serverArgs.transformPathToAbs(); + clientArgs.transformPathToAbs(); + if (printArguments) { + serverArgs.print(); + clientArgs.print(); + } + auto arena = Arena(); + auto serverChain = serverArgs.makeChain(arena); + // IMPORTANT: By default, use same root CA for server and client, such that servers can trust other servers + auto clientChain = clientArgs.makeChain( + arena, noSharedServerClientCa ? Optional() : serverChain.back()); + + if (printServerCert || printClientCert) { + if (printServerCert) { + for (auto i = 0; i < serverChain.size(); i++) { + mkcert::printCert(stdout, serverChain[i].certPem); + } + } + if (printClientCert) { + for (auto i = 0; i < clientChain.size(); i++) { + mkcert::printCert(stdout, clientChain[i].certPem); + } + } + } else { + fmt::print("OK\n"); + } + return FDB_EXIT_SUCCESS; + } catch (const Error& e) { + fmt::print(stderr, "error: {}\n", e.name()); + return FDB_EXIT_MAIN_ERROR; + } catch (const std::exception& e) { + fmt::print(stderr, "exception: {}\n", e.what()); + return FDB_EXIT_MAIN_EXCEPTION; + } +} diff --git a/src/flow/Net2.actor.cpp b/src/flow/Net2.actor.cpp index 4043376..4987b80 100644 --- a/src/flow/Net2.actor.cpp +++ b/src/flow/Net2.actor.cpp @@ -21,39 +21,51 @@ #include "boost/asio/buffer.hpp" #include "boost/asio/ip/address.hpp" #include "boost/system/system_error.hpp" +#include "flow/Arena.h" #include "flow/Platform.h" #include "flow/Trace.h" #include #include +#ifndef BOOST_SYSTEM_NO_LIB #define BOOST_SYSTEM_NO_LIB +#endif +#ifndef BOOST_DATE_TIME_NO_LIB #define BOOST_DATE_TIME_NO_LIB +#endif +#ifndef BOOST_REGEX_NO_LIB #define BOOST_REGEX_NO_LIB +#endif #include +#include "boost/asio/ssl.hpp" #include #include #include #include "flow/network.h" #include "flow/IThreadPool.h" +#include "flow/IAsyncFile.h" #include "flow/ActorCollection.h" -#include "flow/ThreadSafeQueue.h" +#include "flow/TaskQueue.h" #include "flow/ThreadHelper.actor.h" +#include "flow/ChaosMetrics.h" #include "flow/TDMetric.actor.h" #include "flow/AsioReactor.h" #include "flow/Profiler.h" #include "flow/ProtocolVersion.h" #include "flow/SendBufferIterator.h" #include "flow/TLSConfig.actor.h" +#include "flow/WatchFile.actor.h" #include "flow/genericactors.actor.h" #include "flow/Util.h" +#include "flow/UnitTest.h" +#include "flow/ScopeExit.h" +#include "flow/IUDPSocket.h" +#include "flow/IConnection.h" #ifdef ADDRESS_SANITIZER #include #endif -// See the comment in TLSConfig.actor.h for the explanation of why this module breaking include was done. -#include "fdbrpc/IAsyncFile.h" - #ifdef WIN32 #include #endif @@ -109,27 +121,6 @@ class Connection; // Outlives main Net2* g_net2 = nullptr; -class Task { -public: - virtual void operator()() = 0; -}; - -struct OrderedTask { - int64_t priority; - TaskPriority taskID; - Task* task; - OrderedTask(int64_t priority, TaskPriority taskID, Task* task) : priority(priority), taskID(taskID), task(task) {} - bool operator<(OrderedTask const& rhs) const { return priority < rhs.priority; } -}; - -template -class ReadyQueue : public std::priority_queue> { -public: - typedef typename std::priority_queue>::size_type size_type; - ReadyQueue(size_type capacity = 0) { reserve(capacity); }; - void reserve(size_type capacity) { this->c.reserve(capacity); } -}; - thread_local INetwork* thread_network = 0; class Net2 final : public INetwork, public INetworkConnections { @@ -215,7 +206,7 @@ class Net2 final : public INetwork, public INetworkConnections { globals[id] = v; } - ProtocolVersion protocolVersion() const override { return currentProtocolVersion; } + ProtocolVersion protocolVersion() const override { return currentProtocolVersion(); } std::vector globals; @@ -232,13 +223,12 @@ class Net2 final : public INetwork, public INetworkConnections { // private: ASIOReactor reactor; -#ifndef TLS_DISABLED AsyncVar>> sslContextVar; Reference sslHandshakerPool; int sslHandshakerThreadsStarted; int sslPoolHandshakesInProgress; -#endif TLSConfig tlsConfig; + Reference activeTlsPolicy; Future backgroundCertRefresh; ETLSInitState tlsInitializedState; @@ -247,8 +237,8 @@ class Net2 final : public INetwork, public INetworkConnections { int64_t tscBegin, tscEnd; double taskBegin; TaskPriority currentTaskID; - uint64_t tasksIssued; TDMetricCollection tdmetrics; + MetricCollection metrics; ChaosMetrics chaosMetrics; // we read now() from a different thread. On Intel, reading a double is atomic anyways, but on other platforms it's // not. For portability this should be atomic @@ -267,20 +257,21 @@ class Net2 final : public INetwork, public INetworkConnections { NetworkMetrics::PriorityStats* lastPriorityStats; - ReadyQueue ready; - ThreadSafeQueue threadReady; + struct PromiseTask final : public FastAllocated { + Promise promise; + PromiseTask() {} + explicit PromiseTask(Promise&& promise) noexcept : promise(std::move(promise)) {} - struct DelayedTask : OrderedTask { - double at; - DelayedTask(double at, int64_t priority, TaskPriority taskID, Task* task) - : OrderedTask(priority, taskID, task), at(at) {} - bool operator<(DelayedTask const& rhs) const { return at > rhs.at; } // Ordering is reversed for priority_queue + void operator()() { + promise.send(Void()); + delete this; + } }; - std::priority_queue> timers; + + TaskQueue taskQueue; void checkForSlowTask(int64_t tscBegin, int64_t tscEnd, double duration, TaskPriority priority); bool check_yield(TaskPriority taskId, int64_t tscNow); - void processThreadReady(); void trackAtPriority(TaskPriority priority, double now); void stopImmediately() { #ifdef ADDRESS_SANITIZER @@ -288,10 +279,7 @@ class Net2 final : public INetwork, public INetworkConnections { __lsan_do_leak_check(); #endif stopped = true; - decltype(ready) _1; - ready.swap(_1); - decltype(timers) _2; - timers.swap(_2); + taskQueue.clear(); } Future timeOffsetLogger; @@ -307,9 +295,6 @@ class Net2 final : public INetwork, public INetworkConnections { Int64MetricHandle countWrites; Int64MetricHandle countUDPWrites; Int64MetricHandle countRunLoop; - Int64MetricHandle countCantSleep; - Int64MetricHandle countWontSleep; - Int64MetricHandle countTimers; Int64MetricHandle countTasks; Int64MetricHandle countYields; Int64MetricHandle countYieldBigStack; @@ -355,31 +340,35 @@ static udp::endpoint udpEndpoint(NetworkAddress const& n) { class BindPromise { Promise p; - const char* errContext; + std::variant errContext; UID errID; public: BindPromise(const char* errContext, UID errID) : errContext(errContext), errID(errID) {} + BindPromise(AuditedEvent auditedEvent, UID errID) : errContext(auditedEvent), errID(errID) {} BindPromise(BindPromise const& r) : p(r.p), errContext(r.errContext), errID(r.errID) {} BindPromise(BindPromise&& r) noexcept : p(std::move(r.p)), errContext(r.errContext), errID(r.errID) {} - Future getFuture() { return p.getFuture(); } + Future getFuture() const { return p.getFuture(); } void operator()(const boost::system::error_code& error, size_t bytesWritten = 0) { try { if (error) { // Log the error... { - TraceEvent evt(SevWarn, errContext, errID); + std::optional traceEvent; + if (std::holds_alternative(errContext)) + traceEvent.emplace(SevWarn, std::get(errContext), errID); + else + traceEvent.emplace(SevWarn, std::get(errContext), errID); + TraceEvent& evt = *traceEvent; evt.suppressFor(1.0).detail("ErrorCode", error.value()).detail("Message", error.message()); -#ifndef TLS_DISABLED // There is no function in OpenSSL to use to check if an error code is from OpenSSL, // but all OpenSSL errors have a non-zero "library" code set in bits 24-32, and linux // error codes should never go that high. if (error.value() >= (1 << 24L)) { evt.detail("WhichMeans", TLSPolicy::ErrorString(error)); } -#endif } p.sendError(connection_failed()); @@ -510,6 +499,8 @@ class Connection final : public IConnection, ReferenceCounted { NetworkAddress getPeerAddress() const override { return peer_address; } + bool hasTrustedPeer() const override { return true; } + UID getDebugID() const override { return id; } tcp::socket& getSocket() override { return socket; } @@ -541,6 +532,7 @@ class Connection final : public IConnection, ReferenceCounted { if (error) TraceEvent(SevWarn, "N2_CloseError", id) .suppressFor(1.0) + .detail("PeerAddr", peer_address) .detail("ErrorCode", error.value()) .detail("Message", error.message()); } @@ -548,6 +540,7 @@ class Connection final : public IConnection, ReferenceCounted { void onReadError(const boost::system::error_code& error) { TraceEvent(SevWarn, "N2_ReadError", id) .suppressFor(1.0) + .detail("PeerAddr", peer_address) .detail("ErrorCode", error.value()) .detail("Message", error.message()); closeSocket(); @@ -555,6 +548,7 @@ class Connection final : public IConnection, ReferenceCounted { void onWriteError(const boost::system::error_code& error) { TraceEvent(SevWarn, "N2_WriteError", id) .suppressFor(1.0) + .detail("PeerAddr", peer_address) .detail("ErrorCode", error.value()) .detail("Message", error.message()); closeSocket(); @@ -786,7 +780,6 @@ class Listener final : public IListener, ReferenceCounted { } }; -#ifndef TLS_DISABLED typedef boost::asio::ssl::stream ssl_socket; struct SSLHandshakerThread final : IThreadPoolReceiver { @@ -814,8 +807,8 @@ struct SSLHandshakerThread final : IThreadPoolReceiver { } if (h.err.failed()) { TraceEvent(SevWarn, - h.type == ssl_socket::handshake_type::client ? "N2_ConnectHandshakeError" - : "N2_AcceptHandshakeError") + h.type == ssl_socket::handshake_type::client ? "N2_ConnectHandshakeError"_audit + : "N2_AcceptHandshakeError"_audit) .detail("ErrorCode", h.err.value()) .detail("ErrorMsg", h.err.message().c_str()) .detail("BackgroundThread", true); @@ -825,8 +818,8 @@ struct SSLHandshakerThread final : IThreadPoolReceiver { } } catch (...) { TraceEvent(SevWarn, - h.type == ssl_socket::handshake_type::client ? "N2_ConnectHandshakeUnknownError" - : "N2_AcceptHandshakeUnknownError") + h.type == ssl_socket::handshake_type::client ? "N2_ConnectHandshakeUnknownError"_audit + : "N2_AcceptHandshakeUnknownError"_audit) .detail("BackgroundThread", true); h.done.sendError(connection_failed()); } @@ -843,7 +836,7 @@ class SSLConnection final : public IConnection, ReferenceCounted explicit SSLConnection(boost::asio::io_service& io_service, Reference> context) : id(nondeterministicRandom()->randomUniqueID()), socket(io_service), ssl_sock(socket, context->mutate()), - sslContext(context) {} + sslContext(context), has_trusted_peer(false) {} explicit SSLConnection(Reference> context, tcp::socket* existingSocket) : id(nondeterministicRandom()->randomUniqueID()), socket(std::move(*existingSocket)), @@ -904,6 +897,9 @@ class SSLConnection final : public IConnection, ReferenceCounted try { Future onHandshook; + ConfigureSSLStream(N2::g_net2->activeTlsPolicy, self->ssl_sock, [conn = self.getPtr()](bool verifyOk) { + conn->has_trusted_peer = verifyOk; + }); // If the background handshakers are not all busy, use one if (N2::g_net2->sslPoolHandshakesInProgress < N2::g_net2->sslHandshakerThreadsStarted) { @@ -914,7 +910,7 @@ class SSLConnection final : public IConnection, ReferenceCounted N2::g_net2->sslHandshakerPool->post(handshake); } else { // Otherwise use flow network thread - BindPromise p("N2_AcceptHandshakeError", UID()); + BindPromise p("N2_AcceptHandshakeError"_audit, UID()); onHandshook = p.getFuture(); self->ssl_sock.async_handshake(boost::asio::ssl::stream_base::server, std::move(p)); } @@ -983,6 +979,10 @@ class SSLConnection final : public IConnection, ReferenceCounted try { Future onHandshook; + ConfigureSSLStream(N2::g_net2->activeTlsPolicy, self->ssl_sock, [conn = self.getPtr()](bool verifyOk) { + conn->has_trusted_peer = verifyOk; + }); + // If the background handshakers are not all busy, use one if (N2::g_net2->sslPoolHandshakesInProgress < N2::g_net2->sslHandshakerThreadsStarted) { holder = Hold(&N2::g_net2->sslPoolHandshakesInProgress); @@ -992,7 +992,7 @@ class SSLConnection final : public IConnection, ReferenceCounted N2::g_net2->sslHandshakerPool->post(handshake); } else { // Otherwise use flow network thread - BindPromise p("N2_ConnectHandshakeError", self->id); + BindPromise p("N2_ConnectHandshakeError"_audit, self->id); onHandshook = p.getFuture(); self->ssl_sock.async_handshake(boost::asio::ssl::stream_base::client, std::move(p)); } @@ -1120,6 +1120,8 @@ class SSLConnection final : public IConnection, ReferenceCounted NetworkAddress getPeerAddress() const override { return peer_address; } + bool hasTrustedPeer() const override { return has_trusted_peer; } + UID getDebugID() const override { return id; } tcp::socket& getSocket() override { return socket; } @@ -1132,6 +1134,7 @@ class SSLConnection final : public IConnection, ReferenceCounted ssl_socket ssl_sock; NetworkAddress peer_address; Reference> sslContext; + bool has_trusted_peer; void init() { // Socket settings that have to be set after connect or accept succeeds @@ -1152,6 +1155,7 @@ class SSLConnection final : public IConnection, ReferenceCounted void onReadError(const boost::system::error_code& error) { TraceEvent(SevWarn, "N2_ReadError", id) .suppressFor(1.0) + .detail("PeerAddr", peer_address) .detail("ErrorCode", error.value()) .detail("Message", error.message()); closeSocket(); @@ -1159,6 +1163,7 @@ class SSLConnection final : public IConnection, ReferenceCounted void onWriteError(const boost::system::error_code& error) { TraceEvent(SevWarn, "N2_WriteError", id) .suppressFor(1.0) + .detail("PeerAddr", peer_address) .detail("ErrorCode", error.value()) .detail("Message", error.message()); closeSocket(); @@ -1177,6 +1182,16 @@ class SSLListener final : public IListener, ReferenceCounted { NetworkAddress listenAddress) : io_service(io_service), listenAddress(listenAddress), acceptor(io_service, tcpEndpoint(listenAddress)), contextVar(contextVar) { + // when port 0 is passed in, a random port will be opened + // set listenAddress as the address with the actual port opened instead of port 0 + if (listenAddress.port == 0) { + this->listenAddress = NetworkAddress::parse(acceptor.local_endpoint() + .address() + .to_string() + .append(":") + .append(std::to_string(acceptor.local_endpoint().port())) + .append(listenAddress.isTLS() ? ":tls" : "")); + } platform::setCloseOnExec(acceptor.native_handle()); } @@ -1209,31 +1224,17 @@ class SSLListener final : public IListener, ReferenceCounted { } } }; -#endif - -struct PromiseTask final : public Task, public FastAllocated { - Promise promise; - PromiseTask() {} - explicit PromiseTask(Promise&& promise) noexcept : promise(std::move(promise)) {} - - void operator()() override { - promise.send(Void()); - delete this; - } -}; // 5MB for loading files into memory Net2::Net2(const TLSConfig& tlsConfig, bool useThreadPool, bool useMetrics) : globals(enumGlobal::COUNT), useThreadPool(useThreadPool), reactor(this), -#ifndef TLS_DISABLED sslContextVar({ ReferencedObject::from( boost::asio::ssl::context(boost::asio::ssl::context::tls)) }), - sslHandshakerThreadsStarted(0), sslPoolHandshakesInProgress(0), -#endif - tlsConfig(tlsConfig), tlsInitializedState(ETLSInitState::NONE), network(this), tscBegin(0), tscEnd(0), taskBegin(0), - currentTaskID(TaskPriority::DefaultYield), tasksIssued(0), stopped(false), started(false), numYields(0), - lastPriorityStats(nullptr), ready(FLOW_KNOBS->READY_QUEUE_RESERVED_SIZE) { + sslHandshakerThreadsStarted(0), sslPoolHandshakesInProgress(0), tlsConfig(tlsConfig), + tlsInitializedState(ETLSInitState::NONE), network(this), tscBegin(0), tscEnd(0), taskBegin(0), + currentTaskID(TaskPriority::DefaultYield), stopped(false), started(false), numYields(0), + lastPriorityStats(nullptr) { // Until run() is called, yield() will always yield TraceEvent("Net2Starting").log(); @@ -1244,6 +1245,7 @@ Net2::Net2(const TLSConfig& tlsConfig, bool useThreadPool, bool useMetrics) if (FLOW_KNOBS->ENABLE_CHAOS_FEATURES) { setGlobal(INetwork::enChaosMetrics, (flowGlobalType)&chaosMetrics); } + setGlobal(INetwork::enMetrics, (flowGlobalType)&metrics); setGlobal(INetwork::enNetworkConnections, (flowGlobalType)network); setGlobal(INetwork::enASIOService, (flowGlobalType)&reactor.ios); setGlobal(INetwork::enBlobCredentialFiles, &blobCredentialFiles); @@ -1255,46 +1257,11 @@ Net2::Net2(const TLSConfig& tlsConfig, bool useThreadPool, bool useMetrics) updateNow(); } -#ifndef TLS_DISABLED -ACTOR static Future watchFileForChanges(std::string filename, AsyncTrigger* fileChanged) { - if (filename == "") { - return Never(); - } - state bool firstRun = true; - state bool statError = false; - state std::time_t lastModTime = 0; - loop { - try { - std::time_t modtime = wait(IAsyncFileSystem::filesystem()->lastWriteTime(filename)); - if (firstRun) { - lastModTime = modtime; - firstRun = false; - } - if (lastModTime != modtime || statError) { - lastModTime = modtime; - statError = false; - fileChanged->trigger(); - } - } catch (Error& e) { - if (e.code() == error_code_io_error) { - // EACCES, ELOOP, ENOENT all come out as io_error(), but are more of a system - // configuration issue than an FDB problem. If we managed to load valid - // certificates, then there's no point in crashing, but we should complain - // loudly. IAsyncFile will log the error, but not necessarily as a warning. - TraceEvent(SevWarnAlways, "TLSCertificateRefreshStatError").detail("File", filename); - statError = true; - } else { - throw; - } - } - wait(delay(FLOW_KNOBS->TLS_CERT_REFRESH_DELAY_SECONDS)); - } -} - ACTOR static Future reloadCertificatesOnChange( TLSConfig config, std::function onPolicyFailure, - AsyncVar>>* contextVar) { + AsyncVar>>* contextVar, + Reference* policy) { if (FLOW_KNOBS->TLS_CERT_REFRESH_DELAY_SECONDS <= 0) { return Void(); } @@ -1308,9 +1275,13 @@ ACTOR static Future reloadCertificatesOnChange( state int mismatches = 0; state AsyncTrigger fileChanged; state std::vector> lifetimes; - lifetimes.push_back(watchFileForChanges(config.getCertificatePathSync(), &fileChanged)); - lifetimes.push_back(watchFileForChanges(config.getKeyPathSync(), &fileChanged)); - lifetimes.push_back(watchFileForChanges(config.getCAPathSync(), &fileChanged)); + const int& intervalSeconds = FLOW_KNOBS->TLS_CERT_REFRESH_DELAY_SECONDS; + lifetimes.push_back(watchFileForChanges( + config.getCertificatePathSync(), &fileChanged, &intervalSeconds, "TLSCertificateRefreshStatError")); + lifetimes.push_back( + watchFileForChanges(config.getKeyPathSync(), &fileChanged, &intervalSeconds, "TLSKeyRefreshStatError")); + lifetimes.push_back( + watchFileForChanges(config.getCAPathSync(), &fileChanged, &intervalSeconds, "TLSCARefreshStatError")); loop { wait(fileChanged.onTrigger()); TraceEvent("TLSCertificateRefreshBegin").log(); @@ -1318,7 +1289,8 @@ ACTOR static Future reloadCertificatesOnChange( try { LoadedTLSConfig loaded = wait(config.loadAsync()); boost::asio::ssl::context context(boost::asio::ssl::context::tls); - ConfigureSSLContext(loaded, &context, onPolicyFailure); + ConfigureSSLContext(loaded, context); + *policy = makeReference(loaded, onPolicyFailure); TraceEvent(SevInfo, "TLSCertificateRefreshSucceeded").log(); mismatches = 0; contextVar->set(ReferencedObject::from(std::move(context))); @@ -1332,13 +1304,11 @@ ACTOR static Future reloadCertificatesOnChange( } } } -#endif void Net2::initTLS(ETLSInitState targetState) { if (tlsInitializedState >= targetState) { return; } -#ifndef TLS_DISABLED // Any target state must be higher than NONE so if the current state is NONE // then initialize the TLS config if (tlsInitializedState == ETLSInitState::NONE) { @@ -1352,12 +1322,15 @@ void Net2::initTLS(ETLSInitState targetState) { .detail("KeyPath", tlsConfig.getKeyPathSync()) .detail("HasPassword", !loaded.getPassword().empty()) .detail("VerifyPeers", boost::algorithm::join(loaded.getVerifyPeers(), "|")); - ConfigureSSLContext(tlsConfig.loadSync(), &newContext, onPolicyFailure); + auto loadedTlsConfig = tlsConfig.loadSync(); + ConfigureSSLContext(loadedTlsConfig, newContext); + activeTlsPolicy = makeReference(loadedTlsConfig, onPolicyFailure); sslContextVar.set(ReferencedObject::from(std::move(newContext))); } catch (Error& e) { TraceEvent("Net2TLSInitError").error(e); } - backgroundCertRefresh = reloadCertificatesOnChange(tlsConfig, onPolicyFailure, &sslContextVar); + backgroundCertRefresh = + reloadCertificatesOnChange(tlsConfig, onPolicyFailure, &sslContextVar, &activeTlsPolicy); } // If a TLS connection is actually going to be used then start background threads if configured @@ -1392,7 +1365,6 @@ void Net2::initTLS(ETLSInitState targetState) { } } } -#endif tlsInitializedState = targetState; } @@ -1410,29 +1382,27 @@ ACTOR Future Net2::logTimeOffset() { } void Net2::initMetrics() { - bytesReceived.init(LiteralStringRef("Net2.BytesReceived")); - countWriteProbes.init(LiteralStringRef("Net2.CountWriteProbes")); - countReadProbes.init(LiteralStringRef("Net2.CountReadProbes")); - countReads.init(LiteralStringRef("Net2.CountReads")); - countWouldBlock.init(LiteralStringRef("Net2.CountWouldBlock")); - countWrites.init(LiteralStringRef("Net2.CountWrites")); - countRunLoop.init(LiteralStringRef("Net2.CountRunLoop")); - countCantSleep.init(LiteralStringRef("Net2.CountCantSleep")); - countWontSleep.init(LiteralStringRef("Net2.CountWontSleep")); - countTimers.init(LiteralStringRef("Net2.CountTimers")); - countTasks.init(LiteralStringRef("Net2.CountTasks")); - countYields.init(LiteralStringRef("Net2.CountYields")); - countYieldBigStack.init(LiteralStringRef("Net2.CountYieldBigStack")); - countYieldCalls.init(LiteralStringRef("Net2.CountYieldCalls")); - countASIOEvents.init(LiteralStringRef("Net2.CountASIOEvents")); - countYieldCallsTrue.init(LiteralStringRef("Net2.CountYieldCallsTrue")); - countRunLoopProfilingSignals.init(LiteralStringRef("Net2.CountRunLoopProfilingSignals")); - countTLSPolicyFailures.init(LiteralStringRef("Net2.CountTLSPolicyFailures")); - priorityMetric.init(LiteralStringRef("Net2.Priority")); - awakeMetric.init(LiteralStringRef("Net2.Awake")); - slowTaskMetric.init(LiteralStringRef("Net2.SlowTask")); - countLaunchTime.init(LiteralStringRef("Net2.CountLaunchTime")); - countReactTime.init(LiteralStringRef("Net2.CountReactTime")); + bytesReceived.init("Net2.BytesReceived"_sr); + countWriteProbes.init("Net2.CountWriteProbes"_sr); + countReadProbes.init("Net2.CountReadProbes"_sr); + countReads.init("Net2.CountReads"_sr); + countWouldBlock.init("Net2.CountWouldBlock"_sr); + countWrites.init("Net2.CountWrites"_sr); + countRunLoop.init("Net2.CountRunLoop"_sr); + countTasks.init("Net2.CountTasks"_sr); + countYields.init("Net2.CountYields"_sr); + countYieldBigStack.init("Net2.CountYieldBigStack"_sr); + countYieldCalls.init("Net2.CountYieldCalls"_sr); + countASIOEvents.init("Net2.CountASIOEvents"_sr); + countYieldCallsTrue.init("Net2.CountYieldCallsTrue"_sr); + countRunLoopProfilingSignals.init("Net2.CountRunLoopProfilingSignals"_sr); + countTLSPolicyFailures.init("Net2.CountTLSPolicyFailures"_sr); + priorityMetric.init("Net2.Priority"_sr); + awakeMetric.init("Net2.Awake"_sr); + slowTaskMetric.init("Net2.SlowTask"_sr); + countLaunchTime.init("Net2.CountLaunchTime"_sr); + countReactTime.init("Net2.CountReactTime"_sr); + taskQueue.initMetrics(); } bool Net2::checkRunnable() { @@ -1490,19 +1460,10 @@ void Net2::run() { } double sleepTime = 0; - bool b = ready.empty(); - if (b) { - b = threadReady.canSleep(); - if (!b) - ++countCantSleep; - } else - ++countWontSleep; - if (b) { + if (taskQueue.canSleep()) { sleepTime = 1e99; double sleepStart = timer_monotonic(); - if (!timers.empty()) { - sleepTime = timers.top().at - sleepStart; // + 500e-6? - } + sleepTime = taskQueue.getSleepTime(sleepStart); if (sleepTime > 0) { #if defined(__linux__) // notify the run loop monitoring thread that we have gone idle @@ -1534,33 +1495,24 @@ void Net2::run() { nondeterministicRandom()->random01() < (now - nnow) * FLOW_KNOBS->SLOW_LOOP_SAMPLING_RATE) TraceEvent("SomewhatSlowRunLoopTop").detail("Elapsed", now - nnow); - int numTimers = 0; - while (!timers.empty() && timers.top().at < now) { - ++numTimers; - ++countTimers; - ready.push(timers.top()); - timers.pop(); - } - // FIXME: Is this double counting? - countTimers += numTimers; - FDB_TRACE_PROBE(run_loop_ready_timers, numTimers); + taskQueue.processReadyTimers(now); - processThreadReady(); + taskQueue.processThreadReady(); tscBegin = timestampCounter(); tscEnd = tscBegin + FLOW_KNOBS->TSC_YIELD_TIME; taskBegin = timer_monotonic(); numYields = 0; TaskPriority minTaskID = TaskPriority::Max; - [[maybe_unused]] int queueSize = ready.size(); + [[maybe_unused]] int queueSize = taskQueue.getNumReadyTasks(); FDB_TRACE_PROBE(run_loop_tasks_start, queueSize); - while (!ready.empty()) { + while (taskQueue.hasReadyTask()) { ++countTasks; - currentTaskID = ready.top().taskID; + currentTaskID = taskQueue.getReadyTaskID(); priorityMetric = static_cast(currentTaskID); - Task* task = ready.top().task; - ready.pop(); + PromiseTask* task = taskQueue.getReadyTask(); + taskQueue.popReadyTask(); try { ++tasksSinceReact; @@ -1601,7 +1553,7 @@ void Net2::run() { trackAtPriority(TaskPriority::RunLoop, taskBegin); - queueSize = ready.size(); + queueSize = taskQueue.getNumReadyTasks(); FDB_TRACE_PROBE(run_loop_done, queueSize); #if defined(__linux__) @@ -1716,20 +1668,6 @@ void Net2::trackAtPriority(TaskPriority priority, double now) { } } -void Net2::processThreadReady() { - [[maybe_unused]] int numReady = 0; - while (true) { - Optional t = threadReady.pop(); - if (!t.present()) - break; - t.get().priority -= ++tasksIssued; - ASSERT(t.get().task != 0); - ready.push(t.get()); - ++numReady; - } - FDB_TRACE_PROBE(run_loop_thread_ready, numReady); -} - void Net2::checkForSlowTask(int64_t tscBegin, int64_t tscEnd, double duration, TaskPriority priority) { int64_t elapsed = tscEnd - tscBegin; if (elapsed > FLOW_KNOBS->TSC_YIELD_TIME && tscBegin > 0) { @@ -1769,11 +1707,11 @@ bool Net2::check_yield(TaskPriority taskID, int64_t tscNow) { return true; } - processThreadReady(); + taskQueue.processThreadReady(); if (taskID == TaskPriority::DefaultYield) taskID = currentTaskID; - if (!ready.empty() && ready.top().priority > int64_t(taskID) << 32) { + if (taskQueue.hasReadyTask() && taskQueue.getReadyTaskPriority() > int64_t(taskID) << 32) { return true; } @@ -1811,18 +1749,17 @@ Future Net2::yield(TaskPriority taskID) { } Future Net2::delay(double seconds, TaskPriority taskId) { - if (seconds <= 0.) { - PromiseTask* t = new PromiseTask; - this->ready.push(OrderedTask((int64_t(taskId) << 32) - (++tasksIssued), taskId, t)); - return t->promise.getFuture(); - } - if (seconds >= - 4e12) // Intervals that overflow an int64_t in microseconds (more than 100,000 years) are treated as infinite + if (seconds >= 4e12) // Intervals that overflow an int64_t in microseconds (more than 100,000 years) are treated + // as infinite return Never(); - double at = now() + seconds; PromiseTask* t = new PromiseTask; - this->timers.push(DelayedTask(at, (int64_t(taskId) << 32) - (++tasksIssued), taskId, t)); + if (seconds <= 0.) { + taskQueue.addReady(taskId, t); + } else { + double at = now() + seconds; + taskQueue.addTimer(at, taskId, t); + } return t->promise.getFuture(); } @@ -1835,14 +1772,8 @@ void Net2::onMainThread(Promise&& signal, TaskPriority taskID) { if (stopped) return; PromiseTask* p = new PromiseTask(std::move(signal)); - int64_t priority = int64_t(taskID) << 32; - - if (thread_network == this) { - processThreadReady(); - this->ready.push(OrderedTask(priority - (++tasksIssued), taskID, p)); - } else { - if (threadReady.push(OrderedTask(priority, taskID, p))) - reactor.wake(); + if (taskQueue.addReadyThreadSafe(isOnMainThread(), taskID, p)) { + reactor.wake(); } } @@ -1851,12 +1782,10 @@ THREAD_HANDLE Net2::startThread(THREAD_FUNC_RETURN (*func)(void*), void* arg, in } Future> Net2::connect(NetworkAddress toAddr, tcp::socket* existingSocket) { -#ifndef TLS_DISABLED if (toAddr.isTLS()) { initTLS(ETLSInitState::CONNECT); return SSLConnection::connect(&this->reactor.ios, this->sslContextVar.get(), toAddr, existingSocket); } -#endif return Connection::connect(&this->reactor.ios, toAddr); } @@ -1894,7 +1823,10 @@ ACTOR static Future> resolveTCPEndpoint_impl(Net2* s auto endpoint = iter->endpoint(); auto addr = endpoint.address(); if (addr.is_v6()) { - addrs.emplace_back(IPAddress(addr.to_v6().to_bytes()), endpoint.port()); + // IPV6 loopback might not be supported, only return IPV6 address + if (!addr.is_loopback()) { + addrs.emplace_back(IPAddress(addr.to_v6().to_bytes()), endpoint.port()); + } } else { addrs.emplace_back(addr.to_v4().to_ulong(), endpoint.port()); } @@ -2005,12 +1937,10 @@ bool Net2::isAddressOnThisHost(NetworkAddress const& addr) const { Reference Net2::listen(NetworkAddress localAddr) { try { -#ifndef TLS_DISABLED if (localAddr.isTLS()) { initTLS(ETLSInitState::LISTEN); return Reference(new SSLListener(reactor.ios, &this->sslContextVar, localAddr)); } -#endif return Reference(new Listener(reactor.ios, localAddr)); } catch (boost::system::system_error const& e) { Error x; @@ -2151,7 +2081,7 @@ struct TestGVR { }; template -void startThreadF(F&& func) { +THREAD_HANDLE startThreadF(F&& func) { struct Thing { F f; Thing(F&& f) : f(std::move(f)) {} @@ -2163,71 +2093,151 @@ void startThreadF(F&& func) { } }; Thing* t = new Thing(std::move(func)); - startThread(Thing::start, t); + return g_network->startThread(Thing::start, t); } -void net2_test(){ - /*printf("ThreadSafeQueue test\n"); - printf(" Interface: "); +TEST_CASE("flow/Net2/ThreadSafeQueue/Interface") { ThreadSafeQueue tq; - ASSERT( tq.canSleep() == true ); - - ASSERT( tq.push( 1 ) == true ) ; - ASSERT( tq.push( 2 ) == false ); - ASSERT( tq.push( 3 ) == false ); - - ASSERT( tq.pop().get() == 1 ); - ASSERT( tq.pop().get() == 2 ); - ASSERT( tq.push( 4 ) == false ); - ASSERT( tq.pop().get() == 3 ); - ASSERT( tq.pop().get() == 4 ); - ASSERT( !tq.pop().present() ); - printf("OK\n"); - - printf("Threaded: "); - Event finished, finished2; - int thread1Iterations = 1000000, thread2Iterations = 100000; - - if (thread1Iterations) - startThreadF([&](){ - printf("Thread1\n"); - for(int i=0; i i = tq.pop(); - if (i.present()) { - int v = i.get(); - ++c; - if (mx[v>>20] != v) - printf("Wrong value dequeued!\n"); - ASSERT( mx[v>>20] == v ); - mx[v>>20] = v + 1; - } else { - ++p; - _mm_pause(); - } - if ((c&3)==0) tq.canSleep(); + ASSERT(!tq.pop().present()); + ASSERT(tq.canSleep()); + + ASSERT(tq.push(1) == true); + ASSERT(!tq.canSleep()); + ASSERT(!tq.canSleep()); + ASSERT(tq.push(2) == false); + ASSERT(tq.push(3) == false); + + ASSERT(tq.pop().get() == 1); + ASSERT(tq.pop().get() == 2); + ASSERT(tq.push(4) == false); + ASSERT(tq.pop().get() == 3); + ASSERT(tq.pop().get() == 4); + ASSERT(!tq.pop().present()); + ASSERT(tq.canSleep()); + return Void(); +} + +// A helper struct used by queueing tests which use multiple threads. +struct QueueTestThreadState { + QueueTestThreadState(int threadId, int toProduce) : threadId(threadId), toProduce(toProduce) {} + int threadId; + THREAD_HANDLE handle; + int toProduce; + int produced = 0; + Promise doneProducing; + int consumed = 0; + + static int valueToThreadId(int value) { return value >> 20; } + int elementValue(int index) { return index + (threadId << 20); } + int nextProduced() { return elementValue(produced++); } + int nextConsumed() { return elementValue(consumed++); } + void checkDone() { + ASSERT_EQ(produced, toProduce); + ASSERT_EQ(consumed, produced); + } +}; + +TEST_CASE("flow/Net2/ThreadSafeQueue/Threaded") { + // Uses ThreadSafeQueue from multiple threads. Verifies that all pushed elements are popped, maintaining the + // ordering within a thread. + noUnseed = true; // multi-threading inherently non-deterministic + + ThreadSafeQueue queue; + state std::vector perThread = { QueueTestThreadState(0, 1000000), + QueueTestThreadState(1, 100000), + QueueTestThreadState(2, 1000000) }; + state std::vector> doneProducing; + + int total = 0; + for (int t = 0; t < perThread.size(); ++t) { + auto& s = perThread[t]; + doneProducing.push_back(s.doneProducing.getFuture()); + total += s.toProduce; + s.handle = startThreadF([&queue, &s]() { + printf("Thread%d\n", s.threadId); + int nextYield = 0; + while (s.produced < s.toProduce) { + queue.push(s.nextProduced()); + if (nextYield-- == 0) { + std::this_thread::yield(); + nextYield = nondeterministicRandom()->randomInt(0, 100); + } + } + printf("T%dDone\n", s.threadId); + s.doneProducing.send(Void()); + }); + } + int consumed = 0; + while (consumed < total) { + Optional element = queue.pop(); + if (element.present()) { + int v = element.get(); + auto& s = perThread[QueueTestThreadState::valueToThreadId(v)]; + ++consumed; + ASSERT(v == s.nextConsumed()); + } else { + std::this_thread::yield(); + } + if ((consumed & 3) == 0) + queue.canSleep(); + } + + wait(waitForAll(doneProducing)); + + // Make sure we continue on the main thread. + Promise signal; + state Future doneConsuming = signal.getFuture(); + g_network->onMainThread(std::move(signal), TaskPriority::DefaultOnMainThread); + wait(doneConsuming); + + for (int t = 0; t < perThread.size(); ++t) { + waitThread(perThread[t].handle); + perThread[t].checkDone(); } - printf("%d %d %x %x %s\n", c, p, mx[0], mx[1], mx[0]==thread1Iterations && mx[1]==(1<<20)+thread2Iterations ? "OK" : - "FAIL"); + return Void(); +} - finished.block(); - finished2.block(); +TEST_CASE("noSim/flow/Net2/onMainThreadFIFO") { + // Verifies that signals processed by onMainThread() are executed in order. + noUnseed = true; // multi-threading inherently non-deterministic + + state std::vector perThread = { QueueTestThreadState(0, 1000000), + QueueTestThreadState(1, 100000), + QueueTestThreadState(2, 1000000) }; + state std::vector> doneProducing; + for (int t = 0; t < perThread.size(); ++t) { + auto& s = perThread[t]; + doneProducing.push_back(s.doneProducing.getFuture()); + s.handle = startThreadF([&s]() { + int nextYield = 0; + while (s.produced < s.toProduce) { + if (nextYield-- == 0) { + std::this_thread::yield(); + nextYield = nondeterministicRandom()->randomInt(0, 100); + } + int v = s.nextProduced(); + onMainThreadVoid([&s, v]() { ASSERT_EQ(v, s.nextConsumed()); }); + } + s.doneProducing.send(Void()); + }); + } + wait(waitForAll(doneProducing)); + // Wait for one more onMainThread to wait for all scheduled signals to be executed. + Promise signal; + state Future doneConsuming = signal.getFuture(); + g_network->onMainThread(std::move(signal), TaskPriority::DefaultOnMainThread); + wait(doneConsuming); + for (int t = 0; t < perThread.size(); ++t) { + waitThread(perThread[t].handle); + perThread[t].checkDone(); + } + return Void(); +} + +void net2_test(){ + /* g_network = newNet2(); // for promise serialization below Endpoint destination; @@ -2249,7 +2259,7 @@ void net2_test(){ reqs.resize(10000); for(int i=0; i<10000; i++) { TestGVR &req = reqs[i]; - req.key = LiteralStringRef("Foobar"); + req.key = "Foobar"_sr; SerializeSource what(req); diff --git a/src/flow/Net2.actor.g.cpp b/src/flow/Net2.actor.g.cpp index d0b7e56..f24f1d7 100644 --- a/src/flow/Net2.actor.g.cpp +++ b/src/flow/Net2.actor.g.cpp @@ -23,39 +23,51 @@ #include "boost/asio/buffer.hpp" #include "boost/asio/ip/address.hpp" #include "boost/system/system_error.hpp" +#include "flow/Arena.h" #include "flow/Platform.h" #include "flow/Trace.h" #include #include +#ifndef BOOST_SYSTEM_NO_LIB #define BOOST_SYSTEM_NO_LIB +#endif +#ifndef BOOST_DATE_TIME_NO_LIB #define BOOST_DATE_TIME_NO_LIB +#endif +#ifndef BOOST_REGEX_NO_LIB #define BOOST_REGEX_NO_LIB +#endif #include +#include "boost/asio/ssl.hpp" #include #include #include #include "flow/network.h" #include "flow/IThreadPool.h" +#include "flow/IAsyncFile.h" #include "flow/ActorCollection.h" -#include "flow/ThreadSafeQueue.h" +#include "flow/TaskQueue.h" #include "flow/ThreadHelper.actor.h" +#include "flow/ChaosMetrics.h" #include "flow/TDMetric.actor.h" #include "flow/AsioReactor.h" #include "flow/Profiler.h" #include "flow/ProtocolVersion.h" #include "flow/SendBufferIterator.h" #include "flow/TLSConfig.actor.h" +#include "flow/WatchFile.actor.h" #include "flow/genericactors.actor.h" #include "flow/Util.h" +#include "flow/UnitTest.h" +#include "flow/ScopeExit.h" +#include "flow/IUDPSocket.h" +#include "flow/IConnection.h" #ifdef ADDRESS_SANITIZER #include #endif -// See the comment in TLSConfig.actor.h for the explanation of why this module breaking include was done. -#include "fdbrpc/IAsyncFile.h" - #ifdef WIN32 #include #endif @@ -96,33 +108,33 @@ void initProfiling() { #endif template<> struct Descriptor { - static StringRef typeName() { return LiteralStringRef("SlowTask"); } + static StringRef typeName() { return "SlowTask"_sr; } typedef SlowTask type; struct clocksDescriptor { - static StringRef name() { return LiteralStringRef("clocks"); } - static StringRef typeName() { return LiteralStringRef("int64_t"); } - static StringRef comment() { return LiteralStringRef(" clocks"); } + static StringRef name() { return "clocks"_sr; } + static StringRef typeName() { return "int64_t"_sr; } + static StringRef comment() { return " clocks"_sr; } typedef int64_t type; static inline type get(SlowTask& from); }; struct durationDescriptor { - static StringRef name() { return LiteralStringRef("duration"); } - static StringRef typeName() { return LiteralStringRef("int64_t"); } - static StringRef comment() { return LiteralStringRef(" ns"); } + static StringRef name() { return "duration"_sr; } + static StringRef typeName() { return "int64_t"_sr; } + static StringRef comment() { return " ns"_sr; } typedef int64_t type; static inline type get(SlowTask& from); }; struct priorityDescriptor { - static StringRef name() { return LiteralStringRef("priority"); } - static StringRef typeName() { return LiteralStringRef("int64_t"); } - static StringRef comment() { return LiteralStringRef(" priority level"); } + static StringRef name() { return "priority"_sr; } + static StringRef typeName() { return "int64_t"_sr; } + static StringRef comment() { return " priority level"_sr; } typedef int64_t type; static inline type get(SlowTask& from); }; struct numYieldsDescriptor { - static StringRef name() { return LiteralStringRef("numYields"); } - static StringRef typeName() { return LiteralStringRef("int64_t"); } - static StringRef comment() { return LiteralStringRef(" count"); } + static StringRef name() { return "numYields"_sr; } + static StringRef typeName() { return "int64_t"_sr; } + static StringRef comment() { return " count"_sr; } typedef int64_t type; static inline type get(SlowTask& from); }; @@ -139,7 +151,7 @@ int64_t Descriptor::clocksDescriptor::get(SlowTask& from) { return fro int64_t Descriptor::durationDescriptor::get(SlowTask& from) { return from.duration; } int64_t Descriptor::priorityDescriptor::get(SlowTask& from) { return from.priority; } int64_t Descriptor::numYieldsDescriptor::get(SlowTask& from) { return from.numYields; } -#line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +#line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" namespace N2 { // No indent, it's the whole file @@ -151,27 +163,6 @@ class Connection; // Outlives main Net2* g_net2 = nullptr; -class Task { -public: - virtual void operator()() = 0; -}; - -struct OrderedTask { - int64_t priority; - TaskPriority taskID; - Task* task; - OrderedTask(int64_t priority, TaskPriority taskID, Task* task) : priority(priority), taskID(taskID), task(task) {} - bool operator<(OrderedTask const& rhs) const { return priority < rhs.priority; } -}; - -template -class ReadyQueue : public std::priority_queue> { -public: - typedef typename std::priority_queue>::size_type size_type; - ReadyQueue(size_type capacity = 0) { reserve(capacity); }; - void reserve(size_type capacity) { this->c.reserve(capacity); } -}; - thread_local INetwork* thread_network = 0; class Net2 final : public INetwork, public INetworkConnections { @@ -257,7 +248,7 @@ class Net2 final : public INetwork, public INetworkConnections { globals[id] = v; } - ProtocolVersion protocolVersion() const override { return currentProtocolVersion; } + ProtocolVersion protocolVersion() const override { return currentProtocolVersion(); } std::vector globals; @@ -274,13 +265,12 @@ class Net2 final : public INetwork, public INetworkConnections { // private: ASIOReactor reactor; -#ifndef TLS_DISABLED AsyncVar>> sslContextVar; Reference sslHandshakerPool; int sslHandshakerThreadsStarted; int sslPoolHandshakesInProgress; -#endif TLSConfig tlsConfig; + Reference activeTlsPolicy; Future backgroundCertRefresh; ETLSInitState tlsInitializedState; @@ -289,8 +279,8 @@ class Net2 final : public INetwork, public INetworkConnections { int64_t tscBegin, tscEnd; double taskBegin; TaskPriority currentTaskID; - uint64_t tasksIssued; TDMetricCollection tdmetrics; + MetricCollection metrics; ChaosMetrics chaosMetrics; // we read now() from a different thread. On Intel, reading a double is atomic anyways, but on other platforms it's // not. For portability this should be atomic @@ -309,20 +299,21 @@ class Net2 final : public INetwork, public INetworkConnections { NetworkMetrics::PriorityStats* lastPriorityStats; - ReadyQueue ready; - ThreadSafeQueue threadReady; + struct PromiseTask final : public FastAllocated { + Promise promise; + PromiseTask() {} + explicit PromiseTask(Promise&& promise) noexcept : promise(std::move(promise)) {} - struct DelayedTask : OrderedTask { - double at; - DelayedTask(double at, int64_t priority, TaskPriority taskID, Task* task) - : OrderedTask(priority, taskID, task), at(at) {} - bool operator<(DelayedTask const& rhs) const { return at > rhs.at; } // Ordering is reversed for priority_queue + void operator()() { + promise.send(Void()); + delete this; + } }; - std::priority_queue> timers; + + TaskQueue taskQueue; void checkForSlowTask(int64_t tscBegin, int64_t tscEnd, double duration, TaskPriority priority); bool check_yield(TaskPriority taskId, int64_t tscNow); - void processThreadReady(); void trackAtPriority(TaskPriority priority, double now); void stopImmediately() { #ifdef ADDRESS_SANITIZER @@ -330,10 +321,7 @@ class Net2 final : public INetwork, public INetworkConnections { __lsan_do_leak_check(); #endif stopped = true; - decltype(ready) _1; - ready.swap(_1); - decltype(timers) _2; - timers.swap(_2); + taskQueue.clear(); } Future timeOffsetLogger; @@ -349,9 +337,6 @@ class Net2 final : public INetwork, public INetworkConnections { Int64MetricHandle countWrites; Int64MetricHandle countUDPWrites; Int64MetricHandle countRunLoop; - Int64MetricHandle countCantSleep; - Int64MetricHandle countWontSleep; - Int64MetricHandle countTimers; Int64MetricHandle countTasks; Int64MetricHandle countYields; Int64MetricHandle countYieldBigStack; @@ -397,31 +382,35 @@ static udp::endpoint udpEndpoint(NetworkAddress const& n) { class BindPromise { Promise p; - const char* errContext; + std::variant errContext; UID errID; public: BindPromise(const char* errContext, UID errID) : errContext(errContext), errID(errID) {} + BindPromise(AuditedEvent auditedEvent, UID errID) : errContext(auditedEvent), errID(errID) {} BindPromise(BindPromise const& r) : p(r.p), errContext(r.errContext), errID(r.errID) {} BindPromise(BindPromise&& r) noexcept : p(std::move(r.p)), errContext(r.errContext), errID(r.errID) {} - Future getFuture() { return p.getFuture(); } + Future getFuture() const { return p.getFuture(); } void operator()(const boost::system::error_code& error, size_t bytesWritten = 0) { try { if (error) { // Log the error... { - TraceEvent evt(SevWarn, errContext, errID); + std::optional traceEvent; + if (std::holds_alternative(errContext)) + traceEvent.emplace(SevWarn, std::get(errContext), errID); + else + traceEvent.emplace(SevWarn, std::get(errContext), errID); + TraceEvent& evt = *traceEvent; evt.suppressFor(1.0).detail("ErrorCode", error.value()).detail("Message", error.message()); -#ifndef TLS_DISABLED // There is no function in OpenSSL to use to check if an error code is from OpenSSL, // but all OpenSSL errors have a non-zero "library" code set in bits 24-32, and linux // error codes should never go that high. if (error.value() >= (1 << 24L)) { evt.detail("WhichMeans", TLSPolicy::ErrorString(error)); } -#endif } p.sendError(connection_failed()); @@ -446,24 +435,24 @@ class Connection final : public IConnection, ReferenceCounted { : id(nondeterministicRandom()->randomUniqueID()), socket(io_service) {} // This is not part of the IConnection interface, because it is wrapped by INetwork::connect() - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" // This generated class is to be used only via connect() - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" template - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class ConnectActorState { - #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" ConnectActorState(boost::asio::io_service* const& ios,NetworkAddress const& addr) - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" : ios(ios), - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" addr(addr), - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self(new Connection(*ios)) - #line 466 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 455 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { fdb_probe_actor_create("connect", reinterpret_cast(this)); @@ -476,28 +465,28 @@ class ConnectActorState { int a_body1(int loopDepth=0) { try { - #line 410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 399 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->peer_address = addr; - #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 470 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" try { - #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" auto to = tcpEndpoint(addr); - #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" BindPromise p("N2_ConnectError", self->id); - #line 414 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Future onConnected = p.getFuture(); - #line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->socket.async_connect(to, std::move(p)); - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_0 = onConnected; - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 500 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -525,11 +514,11 @@ class ConnectActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->closeSocket(); - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1Catch1(__current_error, loopDepth); - #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -541,11 +530,11 @@ class ConnectActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->init(); - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(self); this->~ConnectActorState(); static_cast(this)->destroy(); return 0; } - #line 548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 537 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(self)); // state_var_RVO this->~ConnectActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -555,11 +544,11 @@ class ConnectActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->init(); - #line 419 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(self); this->~ConnectActorState(); static_cast(this)->destroy(); return 0; } - #line 562 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 551 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(self)); // state_var_RVO this->~ConnectActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -630,18 +619,18 @@ class ConnectActorState { fdb_probe_actor_exit("connect", reinterpret_cast(this), 0); } - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" boost::asio::io_service* ios; - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" NetworkAddress addr; - #line 408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Reference self; - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" }; // This generated class is to be used only via connect() - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class ConnectActor final : public Actor>, public ActorCallback< ConnectActor, 0, Void >, public FastAllocated, public ConnectActorState { - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -650,9 +639,9 @@ class ConnectActor final : public Actor>, public ActorCal void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ConnectActor, 0, Void >; - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" ConnectActor(boost::asio::io_service* const& ios,NetworkAddress const& addr) - #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" : Actor>(), ConnectActorState(ios, addr) { @@ -675,14 +664,14 @@ friend struct ActorCallback< ConnectActor, 0, Void >; } }; - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" [[nodiscard]] static Future> connect( boost::asio::io_service* const& ios, NetworkAddress const& addr ) { - #line 407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 396 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return Future>(new ConnectActor(ios, addr)); - #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } -#line 426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +#line 415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" // This is not part of the IConnection interface, because it is wrapped by IListener::accept() void accept(NetworkAddress peerAddr) { @@ -770,6 +759,8 @@ friend struct ActorCallback< ConnectActor, 0, Void >; NetworkAddress getPeerAddress() const override { return peer_address; } + bool hasTrustedPeer() const override { return true; } + UID getDebugID() const override { return id; } tcp::socket& getSocket() override { return socket; } @@ -801,6 +792,7 @@ friend struct ActorCallback< ConnectActor, 0, Void >; if (error) TraceEvent(SevWarn, "N2_CloseError", id) .suppressFor(1.0) + .detail("PeerAddr", peer_address) .detail("ErrorCode", error.value()) .detail("Message", error.message()); } @@ -808,6 +800,7 @@ friend struct ActorCallback< ConnectActor, 0, Void >; void onReadError(const boost::system::error_code& error) { TraceEvent(SevWarn, "N2_ReadError", id) .suppressFor(1.0) + .detail("PeerAddr", peer_address) .detail("ErrorCode", error.value()) .detail("Message", error.message()); closeSocket(); @@ -815,6 +808,7 @@ friend struct ActorCallback< ConnectActor, 0, Void >; void onWriteError(const boost::system::error_code& error) { TraceEvent(SevWarn, "N2_WriteError", id) .suppressFor(1.0) + .detail("PeerAddr", peer_address) .detail("ErrorCode", error.value()) .detail("Message", error.message()); closeSocket(); @@ -859,26 +853,26 @@ class UDPSocket : public IUDPSocket, ReferenceCounted { bool isPublic = false; public: - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" // This generated class is to be used only via connect() - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" template - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class ConnectActor1State { - #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" ConnectActor1State(boost::asio::io_service* const& io_service,Optional const& toAddress,bool const& isV6) - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" : io_service(io_service), - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" toAddress(toAddress), - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" isV6(isV6), - #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self(new UDPSocket(*io_service, toAddress, isV6)) - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { fdb_probe_actor_create("connect", reinterpret_cast(this)); @@ -891,43 +885,43 @@ class ConnectActor1State { int a_body1(int loopDepth=0) { try { - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" ASSERT(!toAddress.present() || toAddress.get().ip.isV6() == isV6); - #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!toAddress.present()) - #line 898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(self); this->~ConnectActor1State(); static_cast(this)->destroy(); return 0; } - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(self)); // state_var_RVO this->~ConnectActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } try { - #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (toAddress.present()) - #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" auto to = udpEndpoint(toAddress.get()); - #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" BindPromise p("N2_UDPConnectError", self->id); - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Future onConnected = p.getFuture(); - #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->socket.async_connect(to, std::move(p)); - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_0 = onConnected; - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } else @@ -960,11 +954,11 @@ class ConnectActor1State { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->closeSocket(); - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1Catch1(__current_error, loopDepth); - #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -976,11 +970,11 @@ class ConnectActor1State { } int a_body1cont3(int loopDepth) { - #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->init(); - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(self); this->~ConnectActor1State(); static_cast(this)->destroy(); return 0; } - #line 983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(self)); // state_var_RVO this->~ConnectActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1063,20 +1057,20 @@ class ConnectActor1State { fdb_probe_actor_exit("connect", reinterpret_cast(this), 0); } - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" boost::asio::io_service* io_service; - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Optional toAddress; - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" bool isV6; - #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Reference self; - #line 1074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" }; // This generated class is to be used only via connect() - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class ConnectActor1 final : public Actor>, public ActorCallback< ConnectActor1, 0, Void >, public FastAllocated, public ConnectActor1State { - #line 1079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1085,9 +1079,9 @@ class ConnectActor1 final : public Actor>, public ActorCal void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ConnectActor1, 0, Void >; - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" ConnectActor1(boost::asio::io_service* const& io_service,Optional const& toAddress,bool const& isV6) - #line 1090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" : Actor>(), ConnectActor1State(io_service, toAddress, isV6) { @@ -1110,14 +1104,14 @@ friend struct ActorCallback< ConnectActor1, 0, Void >; } }; - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" [[nodiscard]] static Future> connect( boost::asio::io_service* const& io_service, Optional const& toAddress, bool const& isV6 ) { - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return Future>(new ConnectActor1(io_service, toAddress, isV6)); - #line 1117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } -#line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +#line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" void close() override { closeSocket(); } @@ -1261,24 +1255,24 @@ class Listener final : public IListener, ReferenceCounted { NetworkAddress getListenAddress() const override { return listenAddress; } private: - #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" // This generated class is to be used only via doAccept() - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" template - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class DoAcceptActorState { - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" DoAcceptActorState(Listener* const& self) - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" : self(self), - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" conn(new Connection(self->io_service)), - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" peer_endpoint() - #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { fdb_probe_actor_create("doAccept", reinterpret_cast(this)); @@ -1292,22 +1286,22 @@ class DoAcceptActorState { { try { try { - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" BindPromise p("N2_AcceptError", UID()); - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" auto f = p.getFuture(); - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->acceptor.async_accept(conn->getSocket(), peer_endpoint, std::move(p)); - #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_0 = f; - #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 1305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1335,11 +1329,11 @@ class DoAcceptActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" conn->close(); - #line 784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1Catch1(__current_error, loopDepth); - #line 1342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -1351,13 +1345,13 @@ class DoAcceptActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" auto peer_address = peer_endpoint.address().is_v6() ? IPAddress(peer_endpoint.address().to_v6().to_bytes()) : IPAddress(peer_endpoint.address().to_v4().to_ulong()); - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" conn->accept(NetworkAddress(peer_address, peer_endpoint.port())); - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(conn); this->~DoAcceptActorState(); static_cast(this)->destroy(); return 0; } - #line 1360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(conn)); // state_var_RVO this->~DoAcceptActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1367,13 +1361,13 @@ class DoAcceptActorState { } int a_body1cont2(Void && _,int loopDepth) { - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" auto peer_address = peer_endpoint.address().is_v6() ? IPAddress(peer_endpoint.address().to_v6().to_bytes()) : IPAddress(peer_endpoint.address().to_v4().to_ulong()); - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" conn->accept(NetworkAddress(peer_address, peer_endpoint.port())); - #line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(conn); this->~DoAcceptActorState(); static_cast(this)->destroy(); return 0; } - #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(conn)); // state_var_RVO this->~DoAcceptActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1444,18 +1438,18 @@ class DoAcceptActorState { fdb_probe_actor_exit("doAccept", reinterpret_cast(this), 0); } - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Listener* self; - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Reference conn; - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" tcp::acceptor::endpoint_type peer_endpoint; - #line 1453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1447 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" }; // This generated class is to be used only via doAccept() - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class DoAcceptActor final : public Actor>, public ActorCallback< DoAcceptActor, 0, Void >, public FastAllocated, public DoAcceptActorState { - #line 1458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1464,9 +1458,9 @@ class DoAcceptActor final : public Actor>, public ActorCa void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< DoAcceptActor, 0, Void >; - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" DoAcceptActor(Listener* const& self) - #line 1469 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1463 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" : Actor>(), DoAcceptActorState(self) { @@ -1489,17 +1483,16 @@ friend struct ActorCallback< DoAcceptActor, 0, Void >; } }; - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" [[nodiscard]] static Future> doAccept( Listener* const& self ) { - #line 769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return Future>(new DoAcceptActor(self)); - #line 1496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1490 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } -#line 787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +#line 781 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" }; -#ifndef TLS_DISABLED typedef boost::asio::ssl::stream ssl_socket; struct SSLHandshakerThread final : IThreadPoolReceiver { @@ -1527,8 +1520,8 @@ struct SSLHandshakerThread final : IThreadPoolReceiver { } if (h.err.failed()) { TraceEvent(SevWarn, - h.type == ssl_socket::handshake_type::client ? "N2_ConnectHandshakeError" - : "N2_AcceptHandshakeError") + h.type == ssl_socket::handshake_type::client ? "N2_ConnectHandshakeError"_audit + : "N2_AcceptHandshakeError"_audit) .detail("ErrorCode", h.err.value()) .detail("ErrorMsg", h.err.message().c_str()) .detail("BackgroundThread", true); @@ -1538,8 +1531,8 @@ struct SSLHandshakerThread final : IThreadPoolReceiver { } } catch (...) { TraceEvent(SevWarn, - h.type == ssl_socket::handshake_type::client ? "N2_ConnectHandshakeUnknownError" - : "N2_AcceptHandshakeUnknownError") + h.type == ssl_socket::handshake_type::client ? "N2_ConnectHandshakeUnknownError"_audit + : "N2_AcceptHandshakeUnknownError"_audit) .detail("BackgroundThread", true); h.done.sendError(connection_failed()); } @@ -1556,33 +1549,33 @@ class SSLConnection final : public IConnection, ReferenceCounted explicit SSLConnection(boost::asio::io_service& io_service, Reference> context) : id(nondeterministicRandom()->randomUniqueID()), socket(io_service), ssl_sock(socket, context->mutate()), - sslContext(context) {} + sslContext(context), has_trusted_peer(false) {} explicit SSLConnection(Reference> context, tcp::socket* existingSocket) : id(nondeterministicRandom()->randomUniqueID()), socket(std::move(*existingSocket)), ssl_sock(socket, context->mutate()), sslContext(context) {} // This is not part of the IConnection interface, because it is wrapped by INetwork::connect() - #line 1566 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" // This generated class is to be used only via connect() - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" template - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class ConnectActor2State { - #line 1572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" ConnectActor2State(boost::asio::io_service* const& ios,Reference> const& context,NetworkAddress const& addr,tcp::socket* const& existingSocket = nullptr) - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" : ios(ios), - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" context(context), - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" addr(addr), - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" existingSocket(existingSocket) - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { fdb_probe_actor_create("connect", reinterpret_cast(this)); @@ -1595,34 +1588,34 @@ class ConnectActor2State { int a_body1(int loopDepth=0) { try { - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" std::pair peerIP = std::make_pair(addr.ip, addr.port); - #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" auto iter(g_network->networkInfo.serverTLSConnectionThrottler.find(peerIP)); - #line 859 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (iter != g_network->networkInfo.serverTLSConnectionThrottler.end()) - #line 1604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (now() < iter->second.second) - #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 854 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (iter->second.first >= FLOW_KNOBS->TLS_CLIENT_CONNECTION_THROTTLE_ATTEMPTS) - #line 1612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - #line 862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" TraceEvent("TLSOutgoingConnectionThrottlingWarning").suppressFor(1.0).detail("PeerIP", addr); - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_0 = delay(FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT); - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } else @@ -1632,9 +1625,9 @@ class ConnectActor2State { } else { - #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" g_network->networkInfo.serverTLSConnectionThrottler.erase(peerIP); - #line 1637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); } } @@ -1661,48 +1654,48 @@ class ConnectActor2State { } int a_body1cont1(int loopDepth) { - #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (existingSocket != nullptr) - #line 1666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Reference self(new SSLConnection(context, existingSocket)); - #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->peer_address = addr; - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->init(); - #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(self); this->~ConnectActor2State(); static_cast(this)->destroy(); return 0; } - #line 1676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(self); this->~ConnectActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self = Reference(new SSLConnection(*ios, context)); - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->peer_address = addr; - #line 1686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" try { - #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" auto to = tcpEndpoint(self->peer_address); - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" BindPromise p("N2_ConnectError", self->id); - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Future onConnected = p.getFuture(); - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->socket.async_connect(to, std::move(p)); - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_1 = onConnected; - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 1700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1698 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1727,17 +1720,17 @@ class ConnectActor2State { } int a_body1cont4(Void const& _,int loopDepth) { - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1Catch1(connection_failed(), loopDepth); - #line 1732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" return loopDepth; } int a_body1cont4(Void && _,int loopDepth) { - #line 864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1Catch1(connection_failed(), loopDepth); - #line 1740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" return loopDepth; } @@ -1807,11 +1800,11 @@ class ConnectActor2State { int a_body1cont1Catch1(const Error& __current_error,int loopDepth=0) { try { - #line 891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->closeSocket(); - #line 892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1Catch1(__current_error, loopDepth); - #line 1814 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -1823,11 +1816,11 @@ class ConnectActor2State { } int a_body1cont9(Void const& _,int loopDepth) { - #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->init(); - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(self); this->~ConnectActor2State(); static_cast(this)->destroy(); return 0; } - #line 1830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(self)); // state_var_RVO this->~ConnectActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1837,11 +1830,11 @@ class ConnectActor2State { } int a_body1cont9(Void && _,int loopDepth) { - #line 887 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->init(); - #line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(self); this->~ConnectActor2State(); static_cast(this)->destroy(); return 0; } - #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(self)); // state_var_RVO this->~ConnectActor2State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1912,22 +1905,22 @@ class ConnectActor2State { fdb_probe_actor_exit("connect", reinterpret_cast(this), 1); } - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" boost::asio::io_service* ios; - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Reference> context; - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" NetworkAddress addr; - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" tcp::socket* existingSocket; - #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Reference self; - #line 1925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" }; // This generated class is to be used only via connect() - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class ConnectActor2 final : public Actor>, public ActorCallback< ConnectActor2, 0, Void >, public ActorCallback< ConnectActor2, 1, Void >, public FastAllocated, public ConnectActor2State { - #line 1930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1937,9 +1930,9 @@ class ConnectActor2 final : public Actor>, public ActorCa #pragma clang diagnostic pop friend struct ActorCallback< ConnectActor2, 0, Void >; friend struct ActorCallback< ConnectActor2, 1, Void >; - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" ConnectActor2(boost::asio::io_service* const& ios,Reference> const& context,NetworkAddress const& addr,tcp::socket* const& existingSocket = nullptr) - #line 1942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" : Actor>(), ConnectActor2State(ios, context, addr, existingSocket) { @@ -1963,14 +1956,14 @@ friend struct ActorCallback< ConnectActor2, 1, Void >; } }; - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" [[nodiscard]] static Future> connect( boost::asio::io_service* const& ios, Reference> const& context, NetworkAddress const& addr, tcp::socket* const& existingSocket = nullptr ) { - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return Future>(new ConnectActor2(ios, context, addr, existingSocket)); - #line 1970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } -#line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +#line 888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" // This is not part of the IConnection interface, because it is wrapped by IListener::accept() void accept(NetworkAddress peerAddr) { @@ -1978,24 +1971,24 @@ friend struct ActorCallback< ConnectActor2, 1, Void >; init(); } - #line 1981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" // This generated class is to be used only via doAcceptHandshake() - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" template - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class DoAcceptHandshakeActorState { - #line 1987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1980 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" DoAcceptHandshakeActorState(Reference const& self,Promise const& connected) - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" : self(self), - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" connected(connected), - #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" holder() - #line 1998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { fdb_probe_actor_create("doAcceptHandshake", reinterpret_cast(this)); @@ -2009,41 +2002,43 @@ class DoAcceptHandshakeActorState { { try { try { - #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Future onHandshook; - #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ConfigureSSLStream(N2::g_net2->activeTlsPolicy, self->ssl_sock, [conn = self.getPtr()](bool verifyOk) { conn->has_trusted_peer = verifyOk; }); + #line 905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (N2::g_net2->sslPoolHandshakesInProgress < N2::g_net2->sslHandshakerThreadsStarted) - #line 2016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 906 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" holder = Hold(&N2::g_net2->sslPoolHandshakesInProgress); - #line 911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" auto handshake = new SSLHandshakerThread::Handshake(self->ssl_sock, boost::asio::ssl::stream_base::server); - #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 909 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" onHandshook = handshake->done.getFuture(); - #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" N2::g_net2->sslHandshakerPool->post(handshake); - #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } else { - #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - BindPromise p("N2_AcceptHandshakeError", UID()); - #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + BindPromise p("N2_AcceptHandshakeError"_audit, UID()); + #line 914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" onHandshook = p.getFuture(); - #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->ssl_sock.async_handshake(boost::asio::ssl::stream_base::server, std::move(p)); - #line 2036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } - #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_0 = onHandshook; - #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 2042 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2037 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" static_cast(this)->actor_wait_state = 1; - #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2046 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2076,11 +2071,11 @@ class DoAcceptHandshakeActorState { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->closeSocket(); - #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" connected.sendError(connection_failed()); - #line 2083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2078 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); } catch (Error& error) { @@ -2093,30 +2088,30 @@ class DoAcceptHandshakeActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_1 = delay(0, TaskPriority::Handshake); - #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; - #line 2100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" static_cast(this)->actor_wait_state = 2; - #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_1 = delay(0, TaskPriority::Handshake); - #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; - #line 2115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" static_cast(this)->actor_wait_state = 2; - #line 922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2186,18 +2181,18 @@ class DoAcceptHandshakeActorState { } int a_body1cont5(Void const& _,int loopDepth) { - #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" connected.send(Void()); - #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = a_body1cont7(loopDepth); return loopDepth; } int a_body1cont5(Void && _,int loopDepth) { - #line 923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" connected.send(Void()); - #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = a_body1cont7(loopDepth); return loopDepth; @@ -2280,25 +2275,25 @@ class DoAcceptHandshakeActorState { } int a_body1cont8(int loopDepth) { - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" delete static_cast(this); - #line 2285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" return 0; return loopDepth; } - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Reference self; - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Promise connected; - #line 903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Hold holder; - #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" }; // This generated class is to be used only via doAcceptHandshake() - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class DoAcceptHandshakeActor final : public Actor, public ActorCallback< DoAcceptHandshakeActor, 0, Void >, public ActorCallback< DoAcceptHandshakeActor, 1, Void >, public FastAllocated, public DoAcceptHandshakeActorState { - #line 2301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2308,9 +2303,9 @@ class DoAcceptHandshakeActor final : public Actor, public ActorCallback< D #pragma clang diagnostic pop friend struct ActorCallback< DoAcceptHandshakeActor, 0, Void >; friend struct ActorCallback< DoAcceptHandshakeActor, 1, Void >; - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" DoAcceptHandshakeActor(Reference const& self,Promise const& connected) - #line 2313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" : Actor(), DoAcceptHandshakeActorState(self, connected) { @@ -2324,31 +2319,31 @@ friend struct ActorCallback< DoAcceptHandshakeActor, 1, Void >; } }; - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" static void doAcceptHandshake( Reference const& self, Promise const& connected ) { - #line 902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" new DoAcceptHandshakeActor(self, connected); - #line 2331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } -#line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +#line 925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - #line 2336 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" // This generated class is to be used only via acceptHandshakeWrapper() - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" template - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class AcceptHandshakeWrapperActorState { - #line 2342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" AcceptHandshakeWrapperActorState(Reference const& self) - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" : self(self), - #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" peerIP() - #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { fdb_probe_actor_create("acceptHandshakeWrapper", reinterpret_cast(this)); @@ -2361,34 +2356,34 @@ class AcceptHandshakeWrapperActorState { int a_body1(int loopDepth=0) { try { - #line 932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" peerIP = std::make_pair(self->getPeerAddress().ip, static_cast(0)); - #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" auto iter(g_network->networkInfo.serverTLSConnectionThrottler.find(peerIP)); - #line 934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (iter != g_network->networkInfo.serverTLSConnectionThrottler.end()) - #line 2370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - #line 935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (now() < iter->second.second) - #line 2374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (iter->second.first >= FLOW_KNOBS->TLS_SERVER_CONNECTION_THROTTLE_ATTEMPTS) - #line 2378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 933 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" TraceEvent("TLSIncomingConnectionThrottlingWarning") .suppressFor(1.0) .detail("PeerIP", peerIP.first.toString()); - #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_0 = delay(FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT); - #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 936 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2386 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } else @@ -2398,9 +2393,9 @@ class AcceptHandshakeWrapperActorState { } else { - #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" g_network->networkInfo.serverTLSConnectionThrottler.erase(peerIP); - #line 2403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); } } @@ -2427,16 +2422,16 @@ class AcceptHandshakeWrapperActorState { } int a_body1cont1(int loopDepth) { - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_1 = g_network->networkInfo.handshakeLock->take(); - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2429 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2455,21 +2450,21 @@ class AcceptHandshakeWrapperActorState { } int a_body1cont4(Void const& _,int loopDepth) { - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->closeSocket(); - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1Catch1(connection_failed(), loopDepth); - #line 2462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" return loopDepth; } int a_body1cont4(Void && _,int loopDepth) { - #line 941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 937 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->closeSocket(); - #line 942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1Catch1(connection_failed(), loopDepth); - #line 2472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" return loopDepth; } @@ -2538,30 +2533,30 @@ class AcceptHandshakeWrapperActorState { } int a_body1cont7(Void const& _,int loopDepth) { - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" releaser = FlowLock::Releaser(*g_network->networkInfo.handshakeLock); - #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Promise connected; - #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" doAcceptHandshake(self, connected); - #line 2547 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2542 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" try { - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_2 = connected.getFuture(); - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont7Catch1(actor_cancelled(), loopDepth); - #line 2553 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2548 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont7Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont7when1(__when_expr_2.get(), loopDepth); }; - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_3 = delay(FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT); - #line 2557 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2552 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont7Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont7when2(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2574,30 +2569,30 @@ class AcceptHandshakeWrapperActorState { } int a_body1cont7(Void && _,int loopDepth) { - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" releaser = FlowLock::Releaser(*g_network->networkInfo.handshakeLock); - #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 948 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Promise connected; - #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" doAcceptHandshake(self, connected); - #line 2583 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" try { - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_2 = connected.getFuture(); - #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 951 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont7Catch1(actor_cancelled(), loopDepth); - #line 2589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2584 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont7Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont7when1(__when_expr_2.get(), loopDepth); }; - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_3 = delay(FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT); - #line 2593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1cont7Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont7when2(__when_expr_3.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 959 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2674,32 +2669,32 @@ class AcceptHandshakeWrapperActorState { int a_body1cont7Catch1(const Error& e,int loopDepth=0) { try { - #line 964 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (e.code() != error_code_actor_cancelled) - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 961 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" auto iter(g_network->networkInfo.serverTLSConnectionThrottler.find(peerIP)); - #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (iter != g_network->networkInfo.serverTLSConnectionThrottler.end()) - #line 2685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - #line 967 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" iter->second.first++; - #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } else { - #line 969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" g_network->networkInfo.serverTLSConnectionThrottler[peerIP] = std::make_pair(0, now() + FLOW_KNOBS->TLS_SERVER_CONNECTION_THROTTLE_TIMEOUT); - #line 2695 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } } - #line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 970 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->closeSocket(); - #line 975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 2702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -2711,9 +2706,9 @@ class AcceptHandshakeWrapperActorState { } int a_body1cont7when1(Void const& _,int loopDepth) { - #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AcceptHandshakeWrapperActorState(); static_cast(this)->destroy(); return 0; } - #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AcceptHandshakeWrapperActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2723,9 +2718,9 @@ class AcceptHandshakeWrapperActorState { } int a_body1cont7when1(Void && _,int loopDepth) { - #line 957 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 953 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~AcceptHandshakeWrapperActorState(); static_cast(this)->destroy(); return 0; } - #line 2728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~AcceptHandshakeWrapperActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2735,17 +2730,17 @@ class AcceptHandshakeWrapperActorState { } int a_body1cont7when2(Void const& _,int loopDepth) { - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1cont7Catch1(connection_failed(), loopDepth); - #line 2740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" return loopDepth; } int a_body1cont7when2(Void && _,int loopDepth) { - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1cont7Catch1(connection_failed(), loopDepth); - #line 2748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" return loopDepth; } @@ -2846,18 +2841,18 @@ class AcceptHandshakeWrapperActorState { fdb_probe_actor_exit("acceptHandshakeWrapper", reinterpret_cast(this), 3); } - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Reference self; - #line 931 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" std::pair peerIP; - #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" FlowLock::Releaser releaser; - #line 2855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" }; // This generated class is to be used only via acceptHandshakeWrapper() - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class AcceptHandshakeWrapperActor final : public Actor, public ActorCallback< AcceptHandshakeWrapperActor, 0, Void >, public ActorCallback< AcceptHandshakeWrapperActor, 1, Void >, public ActorCallback< AcceptHandshakeWrapperActor, 2, Void >, public ActorCallback< AcceptHandshakeWrapperActor, 3, Void >, public FastAllocated, public AcceptHandshakeWrapperActorState { - #line 2860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2869,9 +2864,9 @@ friend struct ActorCallback< AcceptHandshakeWrapperActor, 0, Void >; friend struct ActorCallback< AcceptHandshakeWrapperActor, 1, Void >; friend struct ActorCallback< AcceptHandshakeWrapperActor, 2, Void >; friend struct ActorCallback< AcceptHandshakeWrapperActor, 3, Void >; - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" AcceptHandshakeWrapperActor(Reference const& self) - #line 2874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" : Actor(), AcceptHandshakeWrapperActorState(self) { @@ -2896,35 +2891,35 @@ friend struct ActorCallback< AcceptHandshakeWrapperActor, 3, Void >; } }; - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" [[nodiscard]] static Future acceptHandshakeWrapper( Reference const& self ) { - #line 930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return Future(new AcceptHandshakeWrapperActor(self)); - #line 2903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2898 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } -#line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +#line 974 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Future acceptHandshake() override { return acceptHandshakeWrapper(Reference::addRef(this)); } - #line 2910 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2905 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" // This generated class is to be used only via doConnectHandshake() - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" template - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class DoConnectHandshakeActorState { - #line 2916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2911 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" DoConnectHandshakeActorState(Reference const& self,Promise const& connected) - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" : self(self), - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" connected(connected), - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" holder() - #line 2927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { fdb_probe_actor_create("doConnectHandshake", reinterpret_cast(this)); @@ -2938,11 +2933,13 @@ class DoConnectHandshakeActorState { { try { try { - #line 985 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Future onHandshook; + #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ConfigureSSLStream(N2::g_net2->activeTlsPolicy, self->ssl_sock, [conn = self.getPtr()](bool verifyOk) { conn->has_trusted_peer = verifyOk; }); #line 987 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (N2::g_net2->sslPoolHandshakesInProgress < N2::g_net2->sslHandshakerThreadsStarted) - #line 2945 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { #line 988 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" holder = Hold(&N2::g_net2->sslPoolHandshakesInProgress); @@ -2952,27 +2949,27 @@ class DoConnectHandshakeActorState { onHandshook = handshake->done.getFuture(); #line 992 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" N2::g_net2->sslHandshakerPool->post(handshake); - #line 2955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } else { #line 995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - BindPromise p("N2_ConnectHandshakeError", self->id); + BindPromise p("N2_ConnectHandshakeError"_audit, self->id); #line 996 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" onHandshook = p.getFuture(); #line 997 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->ssl_sock.async_handshake(boost::asio::ssl::stream_base::client, std::move(p)); - #line 2965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_0 = onHandshook; #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 2971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2968 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" static_cast(this)->actor_wait_state = 1; #line 999 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 2972 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3009,7 +3006,7 @@ class DoConnectHandshakeActorState { self->closeSocket(); #line 1004 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" connected.sendError(connection_failed()); - #line 3012 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); } catch (Error& error) { @@ -3026,11 +3023,11 @@ class DoConnectHandshakeActorState { StrictFuture __when_expr_1 = delay(0, TaskPriority::Handshake); #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; - #line 3029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" static_cast(this)->actor_wait_state = 2; #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3033 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3030 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3041,11 +3038,11 @@ class DoConnectHandshakeActorState { StrictFuture __when_expr_1 = delay(0, TaskPriority::Handshake); #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch2(__when_expr_1.getError(), loopDepth); else return a_body1cont2when1(__when_expr_1.get(), loopDepth); }; - #line 3044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" static_cast(this)->actor_wait_state = 2; #line 1000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3048 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3045 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -3117,7 +3114,7 @@ class DoConnectHandshakeActorState { { #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" connected.send(Void()); - #line 3120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = a_body1cont7(loopDepth); return loopDepth; @@ -3126,7 +3123,7 @@ class DoConnectHandshakeActorState { { #line 1001 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" connected.send(Void()); - #line 3129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = a_body1cont7(loopDepth); return loopDepth; @@ -3209,25 +3206,25 @@ class DoConnectHandshakeActorState { } int a_body1cont8(int loopDepth) { - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" delete static_cast(this); - #line 3214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" return 0; return loopDepth; } - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Reference self; - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Promise connected; - #line 982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 978 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Hold holder; - #line 3225 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" }; // This generated class is to be used only via doConnectHandshake() - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class DoConnectHandshakeActor final : public Actor, public ActorCallback< DoConnectHandshakeActor, 0, Void >, public ActorCallback< DoConnectHandshakeActor, 1, Void >, public FastAllocated, public DoConnectHandshakeActorState { - #line 3230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3237,9 +3234,9 @@ class DoConnectHandshakeActor final : public Actor, public ActorCallback< #pragma clang diagnostic pop friend struct ActorCallback< DoConnectHandshakeActor, 0, Void >; friend struct ActorCallback< DoConnectHandshakeActor, 1, Void >; - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" DoConnectHandshakeActor(Reference const& self,Promise const& connected) - #line 3242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3239 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" : Actor(), DoConnectHandshakeActorState(self, connected) { @@ -3253,29 +3250,29 @@ friend struct ActorCallback< DoConnectHandshakeActor, 1, Void >; } }; - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" static void doConnectHandshake( Reference const& self, Promise const& connected ) { - #line 981 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" new DoConnectHandshakeActor(self, connected); - #line 3260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } #line 1007 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - #line 3265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" // This generated class is to be used only via connectHandshakeWrapper() #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" template #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class ConnectHandshakeWrapperActorState { - #line 3271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" ConnectHandshakeWrapperActorState(Reference const& self) #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" : self(self) - #line 3278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { fdb_probe_actor_create("connectHandshakeWrapper", reinterpret_cast(this)); @@ -3292,12 +3289,12 @@ class ConnectHandshakeWrapperActorState { StrictFuture __when_expr_0 = g_network->networkInfo.handshakeLock->take(); #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; #line 1009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3324,24 +3321,24 @@ class ConnectHandshakeWrapperActorState { Promise connected; #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" doConnectHandshake(self, connected); - #line 3327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" try { #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_1 = connected.getFuture(); #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 3333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_2 = delay(FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT); - #line 3337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3360,24 +3357,24 @@ class ConnectHandshakeWrapperActorState { Promise connected; #line 1013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" doConnectHandshake(self, connected); - #line 3363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" try { #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_1 = connected.getFuture(); #line 1015 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1cont1Catch1(actor_cancelled(), loopDepth); - #line 3369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3366 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1cont1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_2 = delay(FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT); - #line 3373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1when2(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; #line 1016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); #line 1019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3456,7 +3453,7 @@ class ConnectHandshakeWrapperActorState { try { #line 1025 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (e.code() != error_code_actor_cancelled) - #line 3459 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3456 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { #line 1026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" std::pair peerIP = std::make_pair(self->peer_address.ip, self->peer_address.port); @@ -3464,24 +3461,24 @@ class ConnectHandshakeWrapperActorState { auto iter(g_network->networkInfo.serverTLSConnectionThrottler.find(peerIP)); #line 1028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (iter != g_network->networkInfo.serverTLSConnectionThrottler.end()) - #line 3467 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { #line 1029 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" iter->second.first++; - #line 3471 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } else { #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" g_network->networkInfo.serverTLSConnectionThrottler[peerIP] = std::make_pair(0, now() + FLOW_KNOBS->TLS_CLIENT_CONNECTION_THROTTLE_TIMEOUT); - #line 3477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } } #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->closeSocket(); #line 1036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 3484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -3495,7 +3492,7 @@ class ConnectHandshakeWrapperActorState { { #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ConnectHandshakeWrapperActorState(); static_cast(this)->destroy(); return 0; } - #line 3498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3495 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ConnectHandshakeWrapperActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3507,7 +3504,7 @@ class ConnectHandshakeWrapperActorState { { #line 1017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ConnectHandshakeWrapperActorState(); static_cast(this)->destroy(); return 0; } - #line 3510 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ConnectHandshakeWrapperActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3519,7 +3516,7 @@ class ConnectHandshakeWrapperActorState { { #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1cont1Catch1(connection_failed(), loopDepth); - #line 3522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3519 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" return loopDepth; } @@ -3527,7 +3524,7 @@ class ConnectHandshakeWrapperActorState { { #line 1020 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1cont1Catch1(connection_failed(), loopDepth); - #line 3530 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3527 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" return loopDepth; } @@ -3632,12 +3629,12 @@ class ConnectHandshakeWrapperActorState { Reference self; #line 1010 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" FlowLock::Releaser releaser; - #line 3635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" }; // This generated class is to be used only via connectHandshakeWrapper() #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class ConnectHandshakeWrapperActor final : public Actor, public ActorCallback< ConnectHandshakeWrapperActor, 0, Void >, public ActorCallback< ConnectHandshakeWrapperActor, 1, Void >, public ActorCallback< ConnectHandshakeWrapperActor, 2, Void >, public FastAllocated, public ConnectHandshakeWrapperActorState { - #line 3640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3650,7 +3647,7 @@ friend struct ActorCallback< ConnectHandshakeWrapperActor, 1, Void >; friend struct ActorCallback< ConnectHandshakeWrapperActor, 2, Void >; #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" ConnectHandshakeWrapperActor(Reference const& self) - #line 3653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" : Actor(), ConnectHandshakeWrapperActorState(self) { @@ -3678,7 +3675,7 @@ friend struct ActorCallback< ConnectHandshakeWrapperActor, 2, Void >; [[nodiscard]] static Future connectHandshakeWrapper( Reference const& self ) { #line 1008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return Future(new ConnectHandshakeWrapperActor(self)); - #line 3681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } #line 1039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" @@ -3766,6 +3763,8 @@ friend struct ActorCallback< ConnectHandshakeWrapperActor, 2, Void >; NetworkAddress getPeerAddress() const override { return peer_address; } + bool hasTrustedPeer() const override { return has_trusted_peer; } + UID getDebugID() const override { return id; } tcp::socket& getSocket() override { return socket; } @@ -3778,6 +3777,7 @@ friend struct ActorCallback< ConnectHandshakeWrapperActor, 2, Void >; ssl_socket ssl_sock; NetworkAddress peer_address; Reference> sslContext; + bool has_trusted_peer; void init() { // Socket settings that have to be set after connect or accept succeeds @@ -3798,6 +3798,7 @@ friend struct ActorCallback< ConnectHandshakeWrapperActor, 2, Void >; void onReadError(const boost::system::error_code& error) { TraceEvent(SevWarn, "N2_ReadError", id) .suppressFor(1.0) + .detail("PeerAddr", peer_address) .detail("ErrorCode", error.value()) .detail("Message", error.message()); closeSocket(); @@ -3805,6 +3806,7 @@ friend struct ActorCallback< ConnectHandshakeWrapperActor, 2, Void >; void onWriteError(const boost::system::error_code& error) { TraceEvent(SevWarn, "N2_WriteError", id) .suppressFor(1.0) + .detail("PeerAddr", peer_address) .detail("ErrorCode", error.value()) .detail("Message", error.message()); closeSocket(); @@ -3823,6 +3825,16 @@ class SSLListener final : public IListener, ReferenceCounted { NetworkAddress listenAddress) : io_service(io_service), listenAddress(listenAddress), acceptor(io_service, tcpEndpoint(listenAddress)), contextVar(contextVar) { + // when port 0 is passed in, a random port will be opened + // set listenAddress as the address with the actual port opened instead of port 0 + if (listenAddress.port == 0) { + this->listenAddress = NetworkAddress::parse(acceptor.local_endpoint() + .address() + .to_string() + .append(":") + .append(std::to_string(acceptor.local_endpoint().port())) + .append(listenAddress.isTLS() ? ":tls" : "")); + } platform::setCloseOnExec(acceptor.native_handle()); } @@ -3835,24 +3847,24 @@ class SSLListener final : public IListener, ReferenceCounted { NetworkAddress getListenAddress() const override { return listenAddress; } private: - #line 3838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" // This generated class is to be used only via doAccept() - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" template - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class DoAcceptActor1State { - #line 3844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" DoAcceptActor1State(SSLListener* const& self) - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" : self(self), - #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" conn(new SSLConnection(self->io_service, self->contextVar->get())), - #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" peer_endpoint() - #line 3855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { fdb_probe_actor_create("doAccept", reinterpret_cast(this)); @@ -3866,22 +3878,22 @@ class DoAcceptActor1State { { try { try { - #line 1196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" BindPromise p("N2_AcceptError", UID()); - #line 1197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" auto f = p.getFuture(); - #line 1198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->acceptor.async_accept(conn->getSocket(), peer_endpoint, std::move(p)); - #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_0 = f; - #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 3879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3909,11 +3921,11 @@ class DoAcceptActor1State { int a_body1Catch2(const Error& __current_error,int loopDepth=0) { try { - #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" conn->close(); - #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1Catch1(__current_error, loopDepth); - #line 3916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -3925,13 +3937,13 @@ class DoAcceptActor1State { } int a_body1cont2(Void const& _,int loopDepth) { - #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" auto peer_address = peer_endpoint.address().is_v6() ? IPAddress(peer_endpoint.address().to_v6().to_bytes()) : IPAddress(peer_endpoint.address().to_v4().to_ulong()); - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" conn->accept(NetworkAddress(peer_address, peer_endpoint.port(), false, true)); - #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(conn); this->~DoAcceptActor1State(); static_cast(this)->destroy(); return 0; } - #line 3934 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(conn)); // state_var_RVO this->~DoAcceptActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3941,13 +3953,13 @@ class DoAcceptActor1State { } int a_body1cont2(Void && _,int loopDepth) { - #line 1200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" auto peer_address = peer_endpoint.address().is_v6() ? IPAddress(peer_endpoint.address().to_v6().to_bytes()) : IPAddress(peer_endpoint.address().to_v4().to_ulong()); - #line 1203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" conn->accept(NetworkAddress(peer_address, peer_endpoint.port(), false, true)); - #line 1205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(conn); this->~DoAcceptActor1State(); static_cast(this)->destroy(); return 0; } - #line 3950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 3962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< Reference >::value()) Reference(std::move(conn)); // state_var_RVO this->~DoAcceptActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -4018,18 +4030,18 @@ class DoAcceptActor1State { fdb_probe_actor_exit("doAccept", reinterpret_cast(this), 0); } - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" SSLListener* self; - #line 1193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Reference conn; - #line 1194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" tcp::acceptor::endpoint_type peer_endpoint; - #line 4027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4039 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" }; // This generated class is to be used only via doAccept() - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class DoAcceptActor1 final : public Actor>, public ActorCallback< DoAcceptActor1, 0, Void >, public FastAllocated, public DoAcceptActor1State { - #line 4032 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -4038,9 +4050,9 @@ class DoAcceptActor1 final : public Actor>, public ActorC void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< DoAcceptActor1, 0, Void >; - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" DoAcceptActor1(SSLListener* const& self) - #line 4043 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" : Actor>(), DoAcceptActor1State(self) { @@ -4063,40 +4075,26 @@ friend struct ActorCallback< DoAcceptActor1, 0, Void >; } }; - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" [[nodiscard]] static Future> doAccept( SSLListener* const& self ) { - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return Future>(new DoAcceptActor1(self)); - #line 4070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } -#line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" -}; -#endif - -struct PromiseTask final : public Task, public FastAllocated { - Promise promise; - PromiseTask() {} - explicit PromiseTask(Promise&& promise) noexcept : promise(std::move(promise)) {} - - void operator()() override { - promise.send(Void()); - delete this; - } +#line 1226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" }; // 5MB for loading files into memory Net2::Net2(const TLSConfig& tlsConfig, bool useThreadPool, bool useMetrics) : globals(enumGlobal::COUNT), useThreadPool(useThreadPool), reactor(this), -#ifndef TLS_DISABLED sslContextVar({ ReferencedObject::from( boost::asio::ssl::context(boost::asio::ssl::context::tls)) }), - sslHandshakerThreadsStarted(0), sslPoolHandshakesInProgress(0), -#endif - tlsConfig(tlsConfig), tlsInitializedState(ETLSInitState::NONE), network(this), tscBegin(0), tscEnd(0), taskBegin(0), - currentTaskID(TaskPriority::DefaultYield), tasksIssued(0), stopped(false), started(false), numYields(0), - lastPriorityStats(nullptr), ready(FLOW_KNOBS->READY_QUEUE_RESERVED_SIZE) { + sslHandshakerThreadsStarted(0), sslPoolHandshakesInProgress(0), tlsConfig(tlsConfig), + tlsInitializedState(ETLSInitState::NONE), network(this), tscBegin(0), tscEnd(0), taskBegin(0), + currentTaskID(TaskPriority::DefaultYield), stopped(false), started(false), numYields(0), + lastPriorityStats(nullptr) { // Until run() is called, yield() will always yield TraceEvent("Net2Starting").log(); @@ -4107,6 +4105,7 @@ Net2::Net2(const TLSConfig& tlsConfig, bool useThreadPool, bool useMetrics) if (FLOW_KNOBS->ENABLE_CHAOS_FEATURES) { setGlobal(INetwork::enChaosMetrics, (flowGlobalType)&chaosMetrics); } + setGlobal(INetwork::enMetrics, (flowGlobalType)&metrics); setGlobal(INetwork::enNetworkConnections, (flowGlobalType)network); setGlobal(INetwork::enASIOService, (flowGlobalType)&reactor.ios); setGlobal(INetwork::enBlobCredentialFiles, &blobCredentialFiles); @@ -4118,54 +4117,53 @@ Net2::Net2(const TLSConfig& tlsConfig, bool useThreadPool, bool useMetrics) updateNow(); } -#ifndef TLS_DISABLED - #line 4122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" -// This generated class is to be used only via watchFileForChanges() - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" -template - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" -class WatchFileForChangesActorState { - #line 4128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +// This generated class is to be used only via reloadCertificatesOnChange() + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +template + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +class ReloadCertificatesOnChangeActorState { + #line 4126 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - WatchFileForChangesActorState(std::string const& filename,AsyncTrigger* const& fileChanged) - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - : filename(filename), - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - fileChanged(fileChanged) - #line 4137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ReloadCertificatesOnChangeActorState(TLSConfig const& config,std::function const& onPolicyFailure,AsyncVar>>* const& contextVar,Reference* const& policy) + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + : config(config), + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + onPolicyFailure(onPolicyFailure), + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + contextVar(contextVar), + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + policy(policy) + #line 4139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - fdb_probe_actor_create("watchFileForChanges", reinterpret_cast(this)); + fdb_probe_actor_create("reloadCertificatesOnChange", reinterpret_cast(this)); } - ~WatchFileForChangesActorState() + ~ReloadCertificatesOnChangeActorState() { - fdb_probe_actor_destroy("watchFileForChanges", reinterpret_cast(this)); + fdb_probe_actor_destroy("reloadCertificatesOnChange", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (filename == "") - #line 4152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (FLOW_KNOBS->TLS_CERT_REFRESH_DELAY_SECONDS <= 0) + #line 4154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - #line 1261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - this->~WatchFileForChangesActorState(); - #line 4156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - static_cast(this)->sendAndDelPromiseRef(Never()); + #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReloadCertificatesOnChangeActorState(); static_cast(this)->destroy(); return 0; } + #line 4158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~ReloadCertificatesOnChangeActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - firstRun = true; - #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - statError = false; - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - lastModTime = 0; - #line 1266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" ; - #line 4168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -4178,12 +4176,35 @@ class WatchFileForChangesActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~WatchFileForChangesActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~ReloadCertificatesOnChangeActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } + int a_body1cont1(int loopDepth) + { + #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + mismatches = 0; + #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + fileChanged = AsyncTrigger(); + #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + lifetimes = std::vector>(); + #line 1278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + const int& intervalSeconds = FLOW_KNOBS->TLS_CERT_REFRESH_DELAY_SECONDS; + #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + lifetimes.push_back(watchFileForChanges( config.getCertificatePathSync(), &fileChanged, &intervalSeconds, "TLSCertificateRefreshStatError")); + #line 1281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + lifetimes.push_back( watchFileForChanges(config.getKeyPathSync(), &fileChanged, &intervalSeconds, "TLSKeyRefreshStatError")); + #line 1283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + lifetimes.push_back( watchFileForChanges(config.getCAPathSync(), &fileChanged, &intervalSeconds, "TLSCARefreshStatError")); + #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ; + #line 4203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + loopDepth = a_body1cont1loopHead1(loopDepth); + + return loopDepth; + } int a_body1loopHead1(int loopDepth) { int oldLoopDepth = ++loopDepth; @@ -4193,267 +4214,240 @@ class WatchFileForChangesActorState { } int a_body1loopBody1(int loopDepth) { - try { - #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - StrictFuture __when_expr_0 = IAsyncFileSystem::filesystem()->lastWriteTime(filename); - #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1loopBody1Catch1(actor_cancelled(), loopDepth); - #line 4201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1loopBody1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4206 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1loopBody1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1loopBody1Catch1(unknown_error(), loopDepth); + #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (IAsyncFileSystem::filesystem() != nullptr) + #line 4219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + { + return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - - return loopDepth; - } - int a_body1loopBody1cont1(int loopDepth) - { - #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - StrictFuture __when_expr_1 = delay(FLOW_KNOBS->TLS_CERT_REFRESH_DELAY_SECONDS); - #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1cont1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + StrictFuture __when_expr_0 = delay(1.0); + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 4227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; return loopDepth; } - int a_body1loopBody1Catch1(const Error& e,int loopDepth=0) + int a_body1break1(int loopDepth) { try { - #line 1279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (e.code() == error_code_io_error) - #line 4238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - { - #line 1284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - TraceEvent(SevWarnAlways, "TLSCertificateRefreshStatError").detail("File", filename); - #line 1285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - statError = true; - #line 4244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - } - else - { - #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 4250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - } - loopDepth = a_body1loopBody1cont1(loopDepth); + return a_body1cont1(loopDepth); } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1loopBody1cont2(std::time_t const& modtime,int loopDepth) + int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (firstRun) - #line 4266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - { - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - lastModTime = modtime; - #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - firstRun = false; - #line 4272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - } - #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (lastModTime != modtime || statError) - #line 4276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - { - #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - lastModTime = modtime; - #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - statError = false; - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - fileChanged->trigger(); - #line 4284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - } - loopDepth = a_body1loopBody1cont6(loopDepth); + if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1loopBody1cont2(std::time_t && modtime,int loopDepth) + int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 1269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (firstRun) - #line 4294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - { - #line 1270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - lastModTime = modtime; - #line 1271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - firstRun = false; - #line 4300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - } - #line 1273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (lastModTime != modtime || statError) - #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - { - #line 1274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - lastModTime = modtime; - #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - statError = false; - #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - fileChanged->trigger(); - #line 4312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - } - loopDepth = a_body1loopBody1cont6(loopDepth); + if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1loopBody1when1(std::time_t const& modtime,int loopDepth) + int a_body1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont2(modtime, loopDepth); + loopDepth = a_body1loopBody1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1when1(std::time_t && modtime,int loopDepth) + int a_body1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont2(std::move(modtime), loopDepth); + loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WatchFileForChangesActor, 0, std::time_t >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ReloadCertificatesOnChangeActor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< WatchFileForChangesActor, 0, std::time_t >*,std::time_t const& value) + void a_callback_fire(ActorCallback< ReloadCertificatesOnChangeActor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("watchFileForChanges", reinterpret_cast(this), 0); + fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(value, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("watchFileForChanges", reinterpret_cast(this), 0); + fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< WatchFileForChangesActor, 0, std::time_t >*,std::time_t && value) + void a_callback_fire(ActorCallback< ReloadCertificatesOnChangeActor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("watchFileForChanges", reinterpret_cast(this), 0); + fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1loopBody1when1(std::move(value), 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("watchFileForChanges", reinterpret_cast(this), 0); + fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< WatchFileForChangesActor, 0, std::time_t >*,Error err) + void a_callback_error(ActorCallback< ReloadCertificatesOnChangeActor, 0, Void >*,Error err) { - fdb_probe_actor_enter("watchFileForChanges", reinterpret_cast(this), 0); + fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 0); a_exitChoose1(); try { - a_body1loopBody1Catch1(err, 0); + a_body1Catch1(err, 0); } catch (Error& error) { - a_body1loopBody1Catch1(error, 0); + a_body1Catch1(error, 0); } catch (...) { - a_body1loopBody1Catch1(unknown_error(), 0); + a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("watchFileForChanges", reinterpret_cast(this), 0); + fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 0); + + } + int a_body1cont1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1cont1loopBody1(int loopDepth) + { + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + StrictFuture __when_expr_1 = fileChanged.onTrigger(); + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 4338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 1286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + loopDepth = 0; + return loopDepth; } - int a_body1loopBody1cont6(int loopDepth) + int a_body1cont1loopBody1cont1(Void const& _,int loopDepth) { + #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + TraceEvent("TLSCertificateRefreshBegin").log(); + #line 4352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" try { - loopDepth = a_body1loopBody1cont1(loopDepth); + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + StrictFuture __when_expr_2 = config.loadAsync(); + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont1Catch1(actor_cancelled(), loopDepth); + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + loopDepth = 0; } catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); + loopDepth = a_body1cont1loopBody1cont1Catch1(error, loopDepth); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); + loopDepth = a_body1cont1loopBody1cont1Catch1(unknown_error(), loopDepth); } return loopDepth; } - int a_body1loopBody1cont7(Void const& _,int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1cont7(Void && _,int loopDepth) + int a_body1cont1loopBody1cont1(Void && _,int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); + #line 1287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + TraceEvent("TLSCertificateRefreshBegin").log(); + #line 4378 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + try { + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + StrictFuture __when_expr_2 = config.loadAsync(); + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont1Catch1(actor_cancelled(), loopDepth); + #line 4384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 1290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 4389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont1loopBody1cont1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont1loopBody1cont1Catch1(unknown_error(), loopDepth); + } return loopDepth; } - int a_body1loopBody1cont1when1(Void const& _,int loopDepth) + int a_body1cont1loopBody1when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont7(_, loopDepth); + loopDepth = a_body1cont1loopBody1cont1(_, loopDepth); return loopDepth; } - int a_body1loopBody1cont1when1(Void && _,int loopDepth) + int a_body1cont1loopBody1when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont7(std::move(_), loopDepth); + loopDepth = a_body1cont1loopBody1cont1(std::move(_), loopDepth); return loopDepth; } void a_exitChoose2() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< WatchFileForChangesActor, 1, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< ReloadCertificatesOnChangeActor, 1, Void >::remove(); } - void a_callback_fire(ActorCallback< WatchFileForChangesActor, 1, Void >*,Void const& value) + void a_callback_fire(ActorCallback< ReloadCertificatesOnChangeActor, 1, Void >*,Void const& value) { - fdb_probe_actor_enter("watchFileForChanges", reinterpret_cast(this), 1); + fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1cont1when1(value, 0); + a_body1cont1loopBody1when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("watchFileForChanges", reinterpret_cast(this), 1); + fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 1); } - void a_callback_fire(ActorCallback< WatchFileForChangesActor, 1, Void >*,Void && value) + void a_callback_fire(ActorCallback< ReloadCertificatesOnChangeActor, 1, Void >*,Void && value) { - fdb_probe_actor_enter("watchFileForChanges", reinterpret_cast(this), 1); + fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 1); a_exitChoose2(); try { - a_body1loopBody1cont1when1(std::move(value), 0); + a_body1cont1loopBody1when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("watchFileForChanges", reinterpret_cast(this), 1); + fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 1); } - void a_callback_error(ActorCallback< WatchFileForChangesActor, 1, Void >*,Error err) + void a_callback_error(ActorCallback< ReloadCertificatesOnChangeActor, 1, Void >*,Error err) { - fdb_probe_actor_enter("watchFileForChanges", reinterpret_cast(this), 1); + fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 1); a_exitChoose2(); try { a_body1Catch1(err, 0); @@ -4463,568 +4457,175 @@ class WatchFileForChangesActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("watchFileForChanges", reinterpret_cast(this), 1); - - } - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - std::string filename; - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - AsyncTrigger* fileChanged; - #line 1263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - bool firstRun; - #line 1264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - bool statError; - #line 1265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - std::time_t lastModTime; - #line 4479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" -}; -// This generated class is to be used only via watchFileForChanges() - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" -class WatchFileForChangesActor final : public Actor, public ActorCallback< WatchFileForChangesActor, 0, std::time_t >, public ActorCallback< WatchFileForChangesActor, 1, Void >, public FastAllocated, public WatchFileForChangesActorState { - #line 4484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< WatchFileForChangesActor, 0, std::time_t >; -friend struct ActorCallback< WatchFileForChangesActor, 1, Void >; - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - WatchFileForChangesActor(std::string const& filename,AsyncTrigger* const& fileChanged) - #line 4496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - : Actor(), - WatchFileForChangesActorState(filename, fileChanged) - { - fdb_probe_actor_enter("watchFileForChanges", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("watchFileForChanges"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("watchFileForChanges", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< WatchFileForChangesActor, 0, std::time_t >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< WatchFileForChangesActor, 1, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" -[[nodiscard]] static Future watchFileForChanges( std::string const& filename, AsyncTrigger* const& fileChanged ) { - #line 1259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - return Future(new WatchFileForChangesActor(filename, fileChanged)); - #line 4524 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" -} - -#line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - - #line 4529 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" -// This generated class is to be used only via reloadCertificatesOnChange() - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" -template - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" -class ReloadCertificatesOnChangeActorState { - #line 4535 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" -public: - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - ReloadCertificatesOnChangeActorState(TLSConfig const& config,std::function const& onPolicyFailure,AsyncVar>>* const& contextVar) - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - : config(config), - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - onPolicyFailure(onPolicyFailure), - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - contextVar(contextVar) - #line 4546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - { - fdb_probe_actor_create("reloadCertificatesOnChange", reinterpret_cast(this)); + fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 1); } - ~ReloadCertificatesOnChangeActorState() + int a_body1cont1loopBody1cont2(int loopDepth) { - fdb_probe_actor_destroy("reloadCertificatesOnChange", reinterpret_cast(this)); + if (loopDepth == 0) return a_body1cont1loopHead1(0); + return loopDepth; } - int a_body1(int loopDepth=0) + int a_body1cont1loopBody1cont1Catch1(const Error& e,int loopDepth=0) { try { #line 1298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (FLOW_KNOBS->TLS_CERT_REFRESH_DELAY_SECONDS <= 0) - #line 4561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + if (e.code() == error_code_actor_cancelled) + #line 4474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReloadCertificatesOnChangeActorState(); static_cast(this)->destroy(); return 0; } - #line 4565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~ReloadCertificatesOnChangeActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + return a_body1Catch1(e, std::max(0, loopDepth - 1)); + #line 4478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } - #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - ; - #line 4573 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~ReloadCertificatesOnChangeActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(int loopDepth) - { - #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - mismatches = 0; - #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - fileChanged = AsyncTrigger(); - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - lifetimes = std::vector>(); - #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - lifetimes.push_back(watchFileForChanges(config.getCertificatePathSync(), &fileChanged)); - #line 1312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - lifetimes.push_back(watchFileForChanges(config.getKeyPathSync(), &fileChanged)); - #line 1313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - lifetimes.push_back(watchFileForChanges(config.getCAPathSync(), &fileChanged)); - #line 1314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - ; - #line 4608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - loopDepth = a_body1cont1loopHead1(loopDepth); - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) - { + #line 1302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + mismatches++; #line 1303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (IAsyncFileSystem::filesystem() != nullptr) - #line 4624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - { - return a_body1break1(loopDepth==0?0:loopDepth-1); // break - } - #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - StrictFuture __when_expr_0 = delay(1.0); - #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 1306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1break1(int loopDepth) - { - try { - return a_body1cont1(loopDepth); + TraceEvent(SevWarn, "TLSCertificateRefreshMismatch").error(e).detail("mismatches", mismatches); + #line 4484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont2(loopDepth); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } return loopDepth; } - int a_body1loopBody1cont1(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont3(LoadedTLSConfig const& loaded,int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); + #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + boost::asio::ssl::context context(boost::asio::ssl::context::tls); + #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ConfigureSSLContext(loaded, context); + #line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + *policy = makeReference(loaded, onPolicyFailure); + #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + TraceEvent(SevInfo, "TLSCertificateRefreshSucceeded").log(); + #line 1295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + mismatches = 0; + #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + contextVar->set(ReferencedObject::from(std::move(context))); + #line 4509 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont5(loopDepth); return loopDepth; } - int a_body1loopBody1cont1(Void && _,int loopDepth) + int a_body1cont1loopBody1cont3(LoadedTLSConfig && loaded,int loopDepth) { - if (loopDepth == 0) return a_body1loopHead1(0); + #line 1291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + boost::asio::ssl::context context(boost::asio::ssl::context::tls); + #line 1292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ConfigureSSLContext(loaded, context); + #line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + *policy = makeReference(loaded, onPolicyFailure); + #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + TraceEvent(SevInfo, "TLSCertificateRefreshSucceeded").log(); + #line 1295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + mismatches = 0; + #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + contextVar->set(ReferencedObject::from(std::move(context))); + #line 4528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + loopDepth = a_body1cont1loopBody1cont5(loopDepth); return loopDepth; } - int a_body1loopBody1when1(Void const& _,int loopDepth) + int a_body1cont1loopBody1cont1when1(LoadedTLSConfig const& loaded,int loopDepth) { - loopDepth = a_body1loopBody1cont1(_, loopDepth); + loopDepth = a_body1cont1loopBody1cont3(loaded, loopDepth); return loopDepth; } - int a_body1loopBody1when1(Void && _,int loopDepth) + int a_body1cont1loopBody1cont1when1(LoadedTLSConfig && loaded,int loopDepth) { - loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont1loopBody1cont3(std::move(loaded), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose3() { if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ReloadCertificatesOnChangeActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ReloadCertificatesOnChangeActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 0); + static_cast(this)->ActorCallback< ReloadCertificatesOnChangeActor, 2, LoadedTLSConfig >::remove(); } - void a_callback_fire(ActorCallback< ReloadCertificatesOnChangeActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< ReloadCertificatesOnChangeActor, 2, LoadedTLSConfig >*,LoadedTLSConfig const& value) { - fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1cont1loopBody1cont1when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont1loopBody1cont1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont1loopBody1cont1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 0); + fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< ReloadCertificatesOnChangeActor, 0, Void >*,Error err) + void a_callback_fire(ActorCallback< ReloadCertificatesOnChangeActor, 2, LoadedTLSConfig >*,LoadedTLSConfig && value) { - fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1Catch1(err, 0); + a_body1cont1loopBody1cont1when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont1loopBody1cont1Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont1loopBody1cont1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 0); - - } - int a_body1cont1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1cont1loopBody1(int loopDepth) - { - #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - StrictFuture __when_expr_1 = fileChanged.onTrigger(); - #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 4743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 1315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - loopDepth = 0; + fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 2); - return loopDepth; } - int a_body1cont1loopBody1cont1(Void const& _,int loopDepth) + void a_callback_error(ActorCallback< ReloadCertificatesOnChangeActor, 2, LoadedTLSConfig >*,Error err) { - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - TraceEvent("TLSCertificateRefreshBegin").log(); - #line 4757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 2); + a_exitChoose3(); try { - #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - StrictFuture __when_expr_2 = config.loadAsync(); - #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 4763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - loopDepth = 0; + a_body1cont1loopBody1cont1Catch1(err, 0); } catch (Error& error) { - loopDepth = a_body1cont1loopBody1cont1Catch1(error, loopDepth); + a_body1cont1loopBody1cont1Catch1(error, 0); } catch (...) { - loopDepth = a_body1cont1loopBody1cont1Catch1(unknown_error(), loopDepth); + a_body1cont1loopBody1cont1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 2); - return loopDepth; } - int a_body1cont1loopBody1cont1(Void && _,int loopDepth) + int a_body1cont1loopBody1cont5(int loopDepth) { - #line 1316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - TraceEvent("TLSCertificateRefreshBegin").log(); - #line 4783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" try { - #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - StrictFuture __when_expr_2 = config.loadAsync(); - #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1cont1loopBody1cont1Catch1(actor_cancelled(), loopDepth); - #line 4789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1cont1loopBody1cont1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont1loopBody1cont1when1(__when_expr_2.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 3; - #line 1319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 4794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1cont1loopBody1cont2(loopDepth); } catch (Error& error) { - loopDepth = a_body1cont1loopBody1cont1Catch1(error, loopDepth); + loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); } catch (...) { - loopDepth = a_body1cont1loopBody1cont1Catch1(unknown_error(), loopDepth); + loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); } return loopDepth; } - int a_body1cont1loopBody1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1cont1loopBody1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1cont1loopBody1when1(Void && _,int loopDepth) - { - loopDepth = a_body1cont1loopBody1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ReloadCertificatesOnChangeActor, 1, Void >::remove(); - - } - void a_callback_fire(ActorCallback< ReloadCertificatesOnChangeActor, 1, Void >*,Void const& value) - { - fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< ReloadCertificatesOnChangeActor, 1, Void >*,Void && value) - { - fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< ReloadCertificatesOnChangeActor, 1, Void >*,Error err) - { - fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 1); - - } - int a_body1cont1loopBody1cont2(int loopDepth) - { - if (loopDepth == 0) return a_body1cont1loopHead1(0); - - return loopDepth; - } - int a_body1cont1loopBody1cont1Catch1(const Error& e,int loopDepth=0) - { - try { - #line 1326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - if (e.code() == error_code_actor_cancelled) - #line 4879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - { - #line 1327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - return a_body1Catch1(e, std::max(0, loopDepth - 1)); - #line 4883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - } - #line 1330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - mismatches++; - #line 1331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - TraceEvent(SevWarn, "TLSCertificateRefreshMismatch").error(e).detail("mismatches", mismatches); - #line 4889 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - loopDepth = a_body1cont1loopBody1cont2(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - int a_body1cont1loopBody1cont3(LoadedTLSConfig const& loaded,int loopDepth) - { - #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - boost::asio::ssl::context context(boost::asio::ssl::context::tls); - #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - ConfigureSSLContext(loaded, &context, onPolicyFailure); - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - TraceEvent(SevInfo, "TLSCertificateRefreshSucceeded").log(); - #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - mismatches = 0; - #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - contextVar->set(ReferencedObject::from(std::move(context))); - #line 4912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - loopDepth = a_body1cont1loopBody1cont5(loopDepth); - - return loopDepth; - } - int a_body1cont1loopBody1cont3(LoadedTLSConfig && loaded,int loopDepth) - { - #line 1320 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - boost::asio::ssl::context context(boost::asio::ssl::context::tls); - #line 1321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - ConfigureSSLContext(loaded, &context, onPolicyFailure); - #line 1322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - TraceEvent(SevInfo, "TLSCertificateRefreshSucceeded").log(); - #line 1323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - mismatches = 0; - #line 1324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - contextVar->set(ReferencedObject::from(std::move(context))); - #line 4929 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" - loopDepth = a_body1cont1loopBody1cont5(loopDepth); - - return loopDepth; - } - int a_body1cont1loopBody1cont1when1(LoadedTLSConfig const& loaded,int loopDepth) - { - loopDepth = a_body1cont1loopBody1cont3(loaded, loopDepth); - - return loopDepth; - } - int a_body1cont1loopBody1cont1when1(LoadedTLSConfig && loaded,int loopDepth) - { - loopDepth = a_body1cont1loopBody1cont3(std::move(loaded), loopDepth); - - return loopDepth; - } - void a_exitChoose3() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< ReloadCertificatesOnChangeActor, 2, LoadedTLSConfig >::remove(); - - } - void a_callback_fire(ActorCallback< ReloadCertificatesOnChangeActor, 2, LoadedTLSConfig >*,LoadedTLSConfig const& value) - { - fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont1loopBody1cont1when1(value, 0); - } - catch (Error& error) { - a_body1cont1loopBody1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1loopBody1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 2); - - } - void a_callback_fire(ActorCallback< ReloadCertificatesOnChangeActor, 2, LoadedTLSConfig >*,LoadedTLSConfig && value) - { - fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont1loopBody1cont1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1cont1loopBody1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1loopBody1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 2); - - } - void a_callback_error(ActorCallback< ReloadCertificatesOnChangeActor, 2, LoadedTLSConfig >*,Error err) - { - fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), 2); - a_exitChoose3(); - try { - a_body1cont1loopBody1cont1Catch1(err, 0); - } - catch (Error& error) { - a_body1cont1loopBody1cont1Catch1(error, 0); - } catch (...) { - a_body1cont1loopBody1cont1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("reloadCertificatesOnChange", reinterpret_cast(this), 2); - - } - int a_body1cont1loopBody1cont5(int loopDepth) - { - try { - loopDepth = a_body1cont1loopBody1cont2(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, std::max(0, loopDepth - 1)); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), std::max(0, loopDepth - 1)); - } - - return loopDepth; - } - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" TLSConfig config; - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" std::function onPolicyFailure; - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" AsyncVar>>* contextVar; - #line 1308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + Reference* policy; + #line 1275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" int mismatches; - #line 1309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" AsyncTrigger fileChanged; - #line 1310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" std::vector> lifetimes; - #line 5022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" }; // This generated class is to be used only via reloadCertificatesOnChange() - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class ReloadCertificatesOnChangeActor final : public Actor, public ActorCallback< ReloadCertificatesOnChangeActor, 0, Void >, public ActorCallback< ReloadCertificatesOnChangeActor, 1, Void >, public ActorCallback< ReloadCertificatesOnChangeActor, 2, LoadedTLSConfig >, public FastAllocated, public ReloadCertificatesOnChangeActorState { - #line 5027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5035,11 +4636,11 @@ class ReloadCertificatesOnChangeActor final : public Actor, public ActorCa friend struct ActorCallback< ReloadCertificatesOnChangeActor, 0, Void >; friend struct ActorCallback< ReloadCertificatesOnChangeActor, 1, Void >; friend struct ActorCallback< ReloadCertificatesOnChangeActor, 2, LoadedTLSConfig >; - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - ReloadCertificatesOnChangeActor(TLSConfig const& config,std::function const& onPolicyFailure,AsyncVar>>* const& contextVar) - #line 5040 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ReloadCertificatesOnChangeActor(TLSConfig const& config,std::function const& onPolicyFailure,AsyncVar>>* const& contextVar,Reference* const& policy) + #line 4641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" : Actor(), - ReloadCertificatesOnChangeActorState(config, onPolicyFailure, contextVar) + ReloadCertificatesOnChangeActorState(config, onPolicyFailure, contextVar, policy) { fdb_probe_actor_enter("reloadCertificatesOnChange", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING @@ -5062,21 +4663,19 @@ friend struct ActorCallback< ReloadCertificatesOnChangeActor, 2, LoadedTLSConfig } }; - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" -[[nodiscard]] static Future reloadCertificatesOnChange( TLSConfig const& config, std::function const& onPolicyFailure, AsyncVar>>* const& contextVar ) { - #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - return Future(new ReloadCertificatesOnChangeActor(config, onPolicyFailure, contextVar)); - #line 5069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +[[nodiscard]] static Future reloadCertificatesOnChange( TLSConfig const& config, std::function const& onPolicyFailure, AsyncVar>>* const& contextVar, Reference* const& policy ) { + #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + return Future(new ReloadCertificatesOnChangeActor(config, onPolicyFailure, contextVar, policy)); + #line 4670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } -#line 1335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" -#endif +#line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" void Net2::initTLS(ETLSInitState targetState) { if (tlsInitializedState >= targetState) { return; } -#ifndef TLS_DISABLED // Any target state must be higher than NONE so if the current state is NONE // then initialize the TLS config if (tlsInitializedState == ETLSInitState::NONE) { @@ -5090,12 +4689,15 @@ void Net2::initTLS(ETLSInitState targetState) { .detail("KeyPath", tlsConfig.getKeyPathSync()) .detail("HasPassword", !loaded.getPassword().empty()) .detail("VerifyPeers", boost::algorithm::join(loaded.getVerifyPeers(), "|")); - ConfigureSSLContext(tlsConfig.loadSync(), &newContext, onPolicyFailure); + auto loadedTlsConfig = tlsConfig.loadSync(); + ConfigureSSLContext(loadedTlsConfig, newContext); + activeTlsPolicy = makeReference(loadedTlsConfig, onPolicyFailure); sslContextVar.set(ReferencedObject::from(std::move(newContext))); } catch (Error& e) { TraceEvent("Net2TLSInitError").error(e); } - backgroundCertRefresh = reloadCertificatesOnChange(tlsConfig, onPolicyFailure, &sslContextVar); + backgroundCertRefresh = + reloadCertificatesOnChange(tlsConfig, onPolicyFailure, &sslContextVar, &activeTlsPolicy); } // If a TLS connection is actually going to be used then start background threads if configured @@ -5130,24 +4732,23 @@ void Net2::initTLS(ETLSInitState targetState) { } } } -#endif tlsInitializedState = targetState; } - #line 5138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" // This generated class is to be used only via logTimeOffset() - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" template - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class Net2_LogTimeOffsetActorState { - #line 5144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Net2_LogTimeOffsetActorState() - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" { - #line 5150 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" fdb_probe_actor_create("logTimeOffset", reinterpret_cast(this)); } @@ -5159,9 +4760,9 @@ class Net2_LogTimeOffsetActorState { int a_body1(int loopDepth=0) { try { - #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" ; - #line 5164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -5189,22 +4790,22 @@ class Net2_LogTimeOffsetActorState { } int a_body1loopBody1(int loopDepth) { - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" double processTime = timer_monotonic(); - #line 1403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" double systemTime = timer(); - #line 1404 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1376 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" TraceEvent("ProcessTimeOffset") .detailf("ProcessTime", "%lf", processTime) .detailf("SystemTime", "%lf", systemTime) .detailf("OffsetFromSystemTime", "%lf", processTime - systemTime); - #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_0 = ::delay(FLOW_KNOBS->TIME_OFFSET_LOGGING_INTERVAL); - #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 5202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1408 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -5286,9 +4887,9 @@ class Net2_LogTimeOffsetActorState { } }; // This generated class is to be used only via logTimeOffset() - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class Net2_LogTimeOffsetActor final : public Actor, public ActorCallback< Net2_LogTimeOffsetActor, 0, Void >, public FastAllocated, public Net2_LogTimeOffsetActorState { - #line 5291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -5297,9 +4898,9 @@ class Net2_LogTimeOffsetActor final : public Actor, public ActorCallback< void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< Net2_LogTimeOffsetActor, 0, Void >; - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Net2_LogTimeOffsetActor() - #line 5302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" : Actor(), Net2_LogTimeOffsetActorState() { @@ -5322,39 +4923,37 @@ friend struct ActorCallback< Net2_LogTimeOffsetActor, 0, Void >; } }; - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" [[nodiscard]] Future Net2::logTimeOffset( ) { - #line 1400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1372 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return Future(new Net2_LogTimeOffsetActor()); - #line 5329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 4930 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } -#line 1411 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +#line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" void Net2::initMetrics() { - bytesReceived.init(LiteralStringRef("Net2.BytesReceived")); - countWriteProbes.init(LiteralStringRef("Net2.CountWriteProbes")); - countReadProbes.init(LiteralStringRef("Net2.CountReadProbes")); - countReads.init(LiteralStringRef("Net2.CountReads")); - countWouldBlock.init(LiteralStringRef("Net2.CountWouldBlock")); - countWrites.init(LiteralStringRef("Net2.CountWrites")); - countRunLoop.init(LiteralStringRef("Net2.CountRunLoop")); - countCantSleep.init(LiteralStringRef("Net2.CountCantSleep")); - countWontSleep.init(LiteralStringRef("Net2.CountWontSleep")); - countTimers.init(LiteralStringRef("Net2.CountTimers")); - countTasks.init(LiteralStringRef("Net2.CountTasks")); - countYields.init(LiteralStringRef("Net2.CountYields")); - countYieldBigStack.init(LiteralStringRef("Net2.CountYieldBigStack")); - countYieldCalls.init(LiteralStringRef("Net2.CountYieldCalls")); - countASIOEvents.init(LiteralStringRef("Net2.CountASIOEvents")); - countYieldCallsTrue.init(LiteralStringRef("Net2.CountYieldCallsTrue")); - countRunLoopProfilingSignals.init(LiteralStringRef("Net2.CountRunLoopProfilingSignals")); - countTLSPolicyFailures.init(LiteralStringRef("Net2.CountTLSPolicyFailures")); - priorityMetric.init(LiteralStringRef("Net2.Priority")); - awakeMetric.init(LiteralStringRef("Net2.Awake")); - slowTaskMetric.init(LiteralStringRef("Net2.SlowTask")); - countLaunchTime.init(LiteralStringRef("Net2.CountLaunchTime")); - countReactTime.init(LiteralStringRef("Net2.CountReactTime")); + bytesReceived.init("Net2.BytesReceived"_sr); + countWriteProbes.init("Net2.CountWriteProbes"_sr); + countReadProbes.init("Net2.CountReadProbes"_sr); + countReads.init("Net2.CountReads"_sr); + countWouldBlock.init("Net2.CountWouldBlock"_sr); + countWrites.init("Net2.CountWrites"_sr); + countRunLoop.init("Net2.CountRunLoop"_sr); + countTasks.init("Net2.CountTasks"_sr); + countYields.init("Net2.CountYields"_sr); + countYieldBigStack.init("Net2.CountYieldBigStack"_sr); + countYieldCalls.init("Net2.CountYieldCalls"_sr); + countASIOEvents.init("Net2.CountASIOEvents"_sr); + countYieldCallsTrue.init("Net2.CountYieldCallsTrue"_sr); + countRunLoopProfilingSignals.init("Net2.CountRunLoopProfilingSignals"_sr); + countTLSPolicyFailures.init("Net2.CountTLSPolicyFailures"_sr); + priorityMetric.init("Net2.Priority"_sr); + awakeMetric.init("Net2.Awake"_sr); + slowTaskMetric.init("Net2.SlowTask"_sr); + countLaunchTime.init("Net2.CountLaunchTime"_sr); + countReactTime.init("Net2.CountReactTime"_sr); + taskQueue.initMetrics(); } bool Net2::checkRunnable() { @@ -5412,19 +5011,10 @@ void Net2::run() { } double sleepTime = 0; - bool b = ready.empty(); - if (b) { - b = threadReady.canSleep(); - if (!b) - ++countCantSleep; - } else - ++countWontSleep; - if (b) { + if (taskQueue.canSleep()) { sleepTime = 1e99; double sleepStart = timer_monotonic(); - if (!timers.empty()) { - sleepTime = timers.top().at - sleepStart; // + 500e-6? - } + sleepTime = taskQueue.getSleepTime(sleepStart); if (sleepTime > 0) { #if defined(__linux__) // notify the run loop monitoring thread that we have gone idle @@ -5456,33 +5046,24 @@ void Net2::run() { nondeterministicRandom()->random01() < (now - nnow) * FLOW_KNOBS->SLOW_LOOP_SAMPLING_RATE) TraceEvent("SomewhatSlowRunLoopTop").detail("Elapsed", now - nnow); - int numTimers = 0; - while (!timers.empty() && timers.top().at < now) { - ++numTimers; - ++countTimers; - ready.push(timers.top()); - timers.pop(); - } - // FIXME: Is this double counting? - countTimers += numTimers; - FDB_TRACE_PROBE(run_loop_ready_timers, numTimers); + taskQueue.processReadyTimers(now); - processThreadReady(); + taskQueue.processThreadReady(); tscBegin = timestampCounter(); tscEnd = tscBegin + FLOW_KNOBS->TSC_YIELD_TIME; taskBegin = timer_monotonic(); numYields = 0; TaskPriority minTaskID = TaskPriority::Max; - [[maybe_unused]] int queueSize = ready.size(); + [[maybe_unused]] int queueSize = taskQueue.getNumReadyTasks(); FDB_TRACE_PROBE(run_loop_tasks_start, queueSize); - while (!ready.empty()) { + while (taskQueue.hasReadyTask()) { ++countTasks; - currentTaskID = ready.top().taskID; + currentTaskID = taskQueue.getReadyTaskID(); priorityMetric = static_cast(currentTaskID); - Task* task = ready.top().task; - ready.pop(); + PromiseTask* task = taskQueue.getReadyTask(); + taskQueue.popReadyTask(); try { ++tasksSinceReact; @@ -5523,7 +5104,7 @@ void Net2::run() { trackAtPriority(TaskPriority::RunLoop, taskBegin); - queueSize = ready.size(); + queueSize = taskQueue.getNumReadyTasks(); FDB_TRACE_PROBE(run_loop_done, queueSize); #if defined(__linux__) @@ -5638,20 +5219,6 @@ void Net2::trackAtPriority(TaskPriority priority, double now) { } } -void Net2::processThreadReady() { - [[maybe_unused]] int numReady = 0; - while (true) { - Optional t = threadReady.pop(); - if (!t.present()) - break; - t.get().priority -= ++tasksIssued; - ASSERT(t.get().task != 0); - ready.push(t.get()); - ++numReady; - } - FDB_TRACE_PROBE(run_loop_thread_ready, numReady); -} - void Net2::checkForSlowTask(int64_t tscBegin, int64_t tscEnd, double duration, TaskPriority priority) { int64_t elapsed = tscEnd - tscBegin; if (elapsed > FLOW_KNOBS->TSC_YIELD_TIME && tscBegin > 0) { @@ -5691,11 +5258,11 @@ bool Net2::check_yield(TaskPriority taskID, int64_t tscNow) { return true; } - processThreadReady(); + taskQueue.processThreadReady(); if (taskID == TaskPriority::DefaultYield) taskID = currentTaskID; - if (!ready.empty() && ready.top().priority > int64_t(taskID) << 32) { + if (taskQueue.hasReadyTask() && taskQueue.getReadyTaskPriority() > int64_t(taskID) << 32) { return true; } @@ -5733,18 +5300,17 @@ Future Net2::yield(TaskPriority taskID) { } Future Net2::delay(double seconds, TaskPriority taskId) { - if (seconds <= 0.) { - PromiseTask* t = new PromiseTask; - this->ready.push(OrderedTask((int64_t(taskId) << 32) - (++tasksIssued), taskId, t)); - return t->promise.getFuture(); - } - if (seconds >= - 4e12) // Intervals that overflow an int64_t in microseconds (more than 100,000 years) are treated as infinite + if (seconds >= 4e12) // Intervals that overflow an int64_t in microseconds (more than 100,000 years) are treated + // as infinite return Never(); - double at = now() + seconds; PromiseTask* t = new PromiseTask; - this->timers.push(DelayedTask(at, (int64_t(taskId) << 32) - (++tasksIssued), taskId, t)); + if (seconds <= 0.) { + taskQueue.addReady(taskId, t); + } else { + double at = now() + seconds; + taskQueue.addTimer(at, taskId, t); + } return t->promise.getFuture(); } @@ -5757,14 +5323,8 @@ void Net2::onMainThread(Promise&& signal, TaskPriority taskID) { if (stopped) return; PromiseTask* p = new PromiseTask(std::move(signal)); - int64_t priority = int64_t(taskID) << 32; - - if (thread_network == this) { - processThreadReady(); - this->ready.push(OrderedTask(priority - (++tasksIssued), taskID, p)); - } else { - if (threadReady.push(OrderedTask(priority, taskID, p))) - reactor.wake(); + if (taskQueue.addReadyThreadSafe(isOnMainThread(), taskID, p)) { + reactor.wake(); } } @@ -5773,12 +5333,10 @@ THREAD_HANDLE Net2::startThread(THREAD_FUNC_RETURN (*func)(void*), void* arg, in } Future> Net2::connect(NetworkAddress toAddr, tcp::socket* existingSocket) { -#ifndef TLS_DISABLED if (toAddr.isTLS()) { initTLS(ETLSInitState::CONNECT); return SSLConnection::connect(&this->reactor.ios, this->sslContextVar.get(), toAddr, existingSocket); } -#endif return Connection::connect(&this->reactor.ios, toAddr); } @@ -5795,26 +5353,26 @@ Future> Net2::createUDPSocket(bool isV6) { return UDPSocket::connect(&reactor.ios, Optional(), isV6); } - #line 5798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 5356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" // This generated class is to be used only via resolveTCPEndpoint_impl() - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" template - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class ResolveTCPEndpoint_implActorState { - #line 5804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 5362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" ResolveTCPEndpoint_implActorState(Net2* const& self,std::string const& host,std::string const& service) - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" : self(self), - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" host(host), - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" service(service), - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" tcpResolver(self->reactor.ios) - #line 5817 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 5375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { fdb_probe_actor_create("resolveTCPEndpoint_impl", reinterpret_cast(this)); @@ -5827,24 +5385,24 @@ class ResolveTCPEndpoint_implActorState { int a_body1(int loopDepth=0) { try { - #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Promise> promise; - #line 1881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" result = promise.getFuture(); - #line 1883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" - tcpResolver.async_resolve( host, service, [promise](const boost::system::error_code& ec, tcp::resolver::iterator iter) { if (ec) { promise.sendError(lookup_failed()); return; } std::vector addrs; tcp::resolver::iterator end; while (iter != end) { auto endpoint = iter->endpoint(); auto addr = endpoint.address(); if (addr.is_v6()) { addrs.emplace_back(IPAddress(addr.to_v6().to_bytes()), endpoint.port()); } else { addrs.emplace_back(addr.to_v4().to_ulong(), endpoint.port()); } ++iter; } if (addrs.empty()) { promise.sendError(lookup_failed()); } else { promise.send(addrs); } }); - #line 5836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 1812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + tcpResolver.async_resolve( host, service, [promise](const boost::system::error_code& ec, tcp::resolver::iterator iter) { if (ec) { promise.sendError(lookup_failed()); return; } std::vector addrs; tcp::resolver::iterator end; while (iter != end) { auto endpoint = iter->endpoint(); auto addr = endpoint.address(); if (addr.is_v6()) { if (!addr.is_loopback()) { addrs.emplace_back(IPAddress(addr.to_v6().to_bytes()), endpoint.port()); } } else { addrs.emplace_back(addr.to_v4().to_ulong(), endpoint.port()); } ++iter; } if (addrs.empty()) { promise.sendError(lookup_failed()); } else { promise.send(addrs); } }); + #line 5394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" try { - #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" StrictFuture __when_expr_0 = ready(result); - #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 5842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 5400 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 1912 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 5847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 5405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -5871,15 +5429,15 @@ class ResolveTCPEndpoint_implActorState { } int a_body1cont1(int loopDepth) { - #line 1919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" tcpResolver.cancel(); - #line 1920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" std::vector ret = result.get(); - #line 1921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->dnsCache.add(host, service, ret); - #line 1923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(ret); this->~ResolveTCPEndpoint_implActorState(); static_cast(this)->destroy(); return 0; } - #line 5882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 5440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(ret); this->~ResolveTCPEndpoint_implActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -5890,17 +5448,17 @@ class ResolveTCPEndpoint_implActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" if (e.code() == error_code_lookup_failed) - #line 5895 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 5453 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" { - #line 1915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" self->dnsCache.remove(host, service); - #line 5899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 5457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } - #line 1917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 5903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 5461 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -5998,22 +5556,22 @@ class ResolveTCPEndpoint_implActorState { return loopDepth; } - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Net2* self; - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" std::string host; - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" std::string service; - #line 1879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" tcp::resolver tcpResolver; - #line 1881 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1810 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Future> result; - #line 6011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 5569 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" }; // This generated class is to be used only via resolveTCPEndpoint_impl() - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" class ResolveTCPEndpoint_implActor final : public Actor>, public ActorCallback< ResolveTCPEndpoint_implActor, 0, Void >, public FastAllocated, public ResolveTCPEndpoint_implActorState { - #line 6016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 5574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -6022,9 +5580,9 @@ class ResolveTCPEndpoint_implActor final : public Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ResolveTCPEndpoint_implActor, 0, Void >; - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" ResolveTCPEndpoint_implActor(Net2* const& self,std::string const& host,std::string const& service) - #line 6027 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 5585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" : Actor>(), ResolveTCPEndpoint_implActorState(self, host, service) { @@ -6047,14 +5605,14 @@ friend struct ActorCallback< ResolveTCPEndpoint_implActor, 0, Void >; } }; - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" [[nodiscard]] static Future> resolveTCPEndpoint_impl( Net2* const& self, std::string const& host, std::string const& service ) { - #line 1876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 1805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" return Future>(new ResolveTCPEndpoint_implActor(self, host, service)); - #line 6054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + #line 5612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" } -#line 1925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +#line 1857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" Future> Net2::resolveTCPEndpoint(const std::string& host, const std::string& service) { return resolveTCPEndpoint_impl(this, host, service); @@ -6138,12 +5696,10 @@ bool Net2::isAddressOnThisHost(NetworkAddress const& addr) const { Reference Net2::listen(NetworkAddress localAddr) { try { -#ifndef TLS_DISABLED if (localAddr.isTLS()) { initTLS(ETLSInitState::LISTEN); return Reference(new SSLListener(reactor.ios, &this->sslContextVar, localAddr)); } -#endif return Reference(new Listener(reactor.ios, localAddr)); } catch (boost::system::system_error const& e) { Error x; @@ -6284,7 +5840,7 @@ struct TestGVR { }; template -void startThreadF(F&& func) { +THREAD_HANDLE startThreadF(F&& func) { struct Thing { F f; Thing(F&& f) : f(std::move(f)) {} @@ -6296,71 +5852,885 @@ void startThreadF(F&& func) { } }; Thing* t = new Thing(std::move(func)); - startThread(Thing::start, t); + return g_network->startThread(Thing::start, t); } -void net2_test(){ - /*printf("ThreadSafeQueue test\n"); - printf(" Interface: "); - ThreadSafeQueue tq; - ASSERT( tq.canSleep() == true ); - - ASSERT( tq.push( 1 ) == true ) ; - ASSERT( tq.push( 2 ) == false ); - ASSERT( tq.push( 3 ) == false ); - - ASSERT( tq.pop().get() == 1 ); - ASSERT( tq.pop().get() == 2 ); - ASSERT( tq.push( 4 ) == false ); - ASSERT( tq.pop().get() == 3 ); - ASSERT( tq.pop().get() == 4 ); - ASSERT( !tq.pop().present() ); - printf("OK\n"); - - printf("Threaded: "); - Event finished, finished2; - int thread1Iterations = 1000000, thread2Iterations = 100000; - - if (thread1Iterations) - startThreadF([&](){ - printf("Thread1\n"); - for(int i=0; i i = tq.pop(); - if (i.present()) { - int v = i.get(); - ++c; - if (mx[v>>20] != v) - printf("Wrong value dequeued!\n"); - ASSERT( mx[v>>20] == v ); - mx[v>>20] = v + 1; - } else { - ++p; - _mm_pause(); - } - if ((c&3)==0) tq.canSleep(); + #line 5858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase2099() + #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +template + #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +class FlowTestCase2099ActorState { + #line 5865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +public: + #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + FlowTestCase2099ActorState(UnitTestParameters const& params) + #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + : params(params) + #line 5872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase2099", reinterpret_cast(this)); + + } + ~FlowTestCase2099ActorState() + { + fdb_probe_actor_destroy("flowTestCase2099", reinterpret_cast(this)); + } - printf("%d %d %x %x %s\n", c, p, mx[0], mx[1], mx[0]==thread1Iterations && mx[1]==(1<<20)+thread2Iterations ? "OK" : - "FAIL"); + int a_body1(int loopDepth=0) + { + try { + #line 2100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ThreadSafeQueue tq; + #line 2101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(!tq.pop().present()); + #line 2102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(tq.canSleep()); + #line 2104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(tq.push(1) == true); + #line 2105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(!tq.canSleep()); + #line 2106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(!tq.canSleep()); + #line 2107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(tq.push(2) == false); + #line 2108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(tq.push(3) == false); + #line 2110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(tq.pop().get() == 1); + #line 2111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(tq.pop().get() == 2); + #line 2112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(tq.push(4) == false); + #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(tq.pop().get() == 3); + #line 2114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(tq.pop().get() == 4); + #line 2115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(!tq.pop().present()); + #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(tq.canSleep()); + #line 2117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase2099ActorState(); static_cast(this)->destroy(); return 0; } + #line 5917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase2099ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } - finished.block(); - finished2.block(); + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase2099ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + return loopDepth; + } + #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + UnitTestParameters params; + #line 5941 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase2099() + #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +class FlowTestCase2099Actor final : public Actor, public FastAllocated, public FlowTestCase2099ActorState { + #line 5946 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop + #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + FlowTestCase2099Actor(UnitTestParameters const& params) + #line 5956 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + : Actor(), + FlowTestCase2099ActorState(params) + { + fdb_probe_actor_enter("flowTestCase2099", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase2099"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase2099", reinterpret_cast(this), -1); + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + } + + } +}; +} + #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +static Future flowTestCase2099( UnitTestParameters const& params ) { + #line 2099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + return Future(new FlowTestCase2099Actor(params)); + #line 5983 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase2099, "flow/Net2/ThreadSafeQueue/Interface") + +#line 2119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + +// A helper struct used by queueing tests which use multiple threads. +struct QueueTestThreadState { + QueueTestThreadState(int threadId, int toProduce) : threadId(threadId), toProduce(toProduce) {} + int threadId; + THREAD_HANDLE handle; + int toProduce; + int produced = 0; + Promise doneProducing; + int consumed = 0; + + static int valueToThreadId(int value) { return value >> 20; } + int elementValue(int index) { return index + (threadId << 20); } + int nextProduced() { return elementValue(produced++); } + int nextConsumed() { return elementValue(consumed++); } + void checkDone() { + ASSERT_EQ(produced, toProduce); + ASSERT_EQ(consumed, produced); + } +}; + + #line 6009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase2140() + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +template + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +class FlowTestCase2140ActorState { + #line 6016 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +public: + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + FlowTestCase2140ActorState(UnitTestParameters const& params) + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + : params(params) + #line 6023 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase2140", reinterpret_cast(this)); + + } + ~FlowTestCase2140ActorState() + { + fdb_probe_actor_destroy("flowTestCase2140", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 2143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + noUnseed = true; + #line 2145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ThreadSafeQueue queue; + #line 2146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + perThread = { QueueTestThreadState(0, 1000000), QueueTestThreadState(1, 100000), QueueTestThreadState(2, 1000000) }; + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + doneProducing = std::vector>(); + #line 2151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + int total = 0; + #line 2152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + for(int t = 0;t < perThread.size();++t) { + #line 2153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + auto& s = perThread[t]; + #line 2154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + doneProducing.push_back(s.doneProducing.getFuture()); + #line 2155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + total += s.toProduce; + #line 2156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + s.handle = startThreadF([&queue, &s]() { printf("Thread%d\n", s.threadId); int nextYield = 0; while (s.produced < s.toProduce) { queue.push(s.nextProduced()); if (nextYield-- == 0) { std::this_thread::yield(); nextYield = nondeterministicRandom()->randomInt(0, 100); } } printf("T%dDone\n", s.threadId); s.doneProducing.send(Void()); }); + #line 6056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + } + #line 2170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + int consumed = 0; + #line 2171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + for(;consumed < total;) { + #line 2172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + Optional element = queue.pop(); + #line 2173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (element.present()) + #line 6066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + { + #line 2174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + int v = element.get(); + #line 2175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + auto& s = perThread[QueueTestThreadState::valueToThreadId(v)]; + #line 2176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ++consumed; + #line 2177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + ASSERT(v == s.nextConsumed()); + #line 6076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + } + else + { + #line 2179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + std::this_thread::yield(); + #line 6082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + } + #line 2181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if ((consumed & 3) == 0) + #line 6086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + { + #line 2182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + queue.canSleep(); + #line 6090 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + } + } + #line 2185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + StrictFuture __when_expr_0 = waitForAll(doneProducing); + #line 2185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 2185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase2140ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 2188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + Promise signal; + #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + doneConsuming = signal.getFuture(); + #line 2190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + g_network->onMainThread(std::move(signal), TaskPriority::DefaultOnMainThread); + #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + StrictFuture __when_expr_1 = doneConsuming; + #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 2188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + Promise signal; + #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + doneConsuming = signal.getFuture(); + #line 2190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + g_network->onMainThread(std::move(signal), TaskPriority::DefaultOnMainThread); + #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + StrictFuture __when_expr_1 = doneConsuming; + #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase2140Actor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase2140Actor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase2140", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase2140", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FlowTestCase2140Actor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase2140", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase2140", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< FlowTestCase2140Actor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase2140", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase2140", reinterpret_cast(this), 0); + + } + int a_body1cont7(Void const& _,int loopDepth) + { + #line 2193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + for(int t = 0;t < perThread.size();++t) { + #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + waitThread(perThread[t].handle); + #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + perThread[t].checkDone(); + #line 6236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + } + #line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase2140ActorState(); static_cast(this)->destroy(); return 0; } + #line 6240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase2140ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont7(Void && _,int loopDepth) + { + #line 2193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + for(int t = 0;t < perThread.size();++t) { + #line 2194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + waitThread(perThread[t].handle); + #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + perThread[t].checkDone(); + #line 6256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + } + #line 2197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase2140ActorState(); static_cast(this)->destroy(); return 0; } + #line 6260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase2140ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont7(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont7(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase2140Actor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase2140Actor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase2140", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase2140", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< FlowTestCase2140Actor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase2140", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase2140", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< FlowTestCase2140Actor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase2140", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase2140", reinterpret_cast(this), 1); + + } + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + UnitTestParameters params; + #line 2146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + std::vector perThread; + #line 2149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + std::vector> doneProducing; + #line 2189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + Future doneConsuming; + #line 6339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase2140() + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +class FlowTestCase2140Actor final : public Actor, public ActorCallback< FlowTestCase2140Actor, 0, Void >, public ActorCallback< FlowTestCase2140Actor, 1, Void >, public FastAllocated, public FlowTestCase2140ActorState { + #line 6344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< FlowTestCase2140Actor, 0, Void >; +friend struct ActorCallback< FlowTestCase2140Actor, 1, Void >; + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + FlowTestCase2140Actor(UnitTestParameters const& params) + #line 6356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + : Actor(), + FlowTestCase2140ActorState(params) + { + fdb_probe_actor_enter("flowTestCase2140", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase2140"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase2140", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< FlowTestCase2140Actor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase2140Actor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +static Future flowTestCase2140( UnitTestParameters const& params ) { + #line 2140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + return Future(new FlowTestCase2140Actor(params)); + #line 6385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase2140, "flow/Net2/ThreadSafeQueue/Threaded") + +#line 2199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + + #line 6391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase2200() + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +template + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +class FlowTestCase2200ActorState { + #line 6398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +public: + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + FlowTestCase2200ActorState(UnitTestParameters const& params) + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + : params(params) + #line 6405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase2200", reinterpret_cast(this)); + + } + ~FlowTestCase2200ActorState() + { + fdb_probe_actor_destroy("flowTestCase2200", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 2202 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + noUnseed = true; + #line 2204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + perThread = { QueueTestThreadState(0, 1000000), QueueTestThreadState(1, 100000), QueueTestThreadState(2, 1000000) }; + #line 2207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + doneProducing = std::vector>(); + #line 2208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + for(int t = 0;t < perThread.size();++t) { + #line 2209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + auto& s = perThread[t]; + #line 2210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + doneProducing.push_back(s.doneProducing.getFuture()); + #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + s.handle = startThreadF([&s]() { int nextYield = 0; while (s.produced < s.toProduce) { if (nextYield-- == 0) { std::this_thread::yield(); nextYield = nondeterministicRandom()->randomInt(0, 100); } int v = s.nextProduced(); onMainThreadVoid([&s, v]() { ASSERT_EQ(v, s.nextConsumed()); }); } s.doneProducing.send(Void()); }); + #line 6432 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + } + #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + StrictFuture __when_expr_0 = waitForAll(doneProducing); + #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6438 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 2224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6443 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase2200ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 2227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + Promise signal; + #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + doneConsuming = signal.getFuture(); + #line 2229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + g_network->onMainThread(std::move(signal), TaskPriority::DefaultOnMainThread); + #line 2230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + StrictFuture __when_expr_1 = doneConsuming; + #line 2230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6479 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 2227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + Promise signal; + #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + doneConsuming = signal.getFuture(); + #line 2229 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + g_network->onMainThread(std::move(signal), TaskPriority::DefaultOnMainThread); + #line 2230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + StrictFuture __when_expr_1 = doneConsuming; + #line 2230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 6496 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 2230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 6501 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase2200Actor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase2200Actor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase2200", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase2200", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FlowTestCase2200Actor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase2200", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase2200", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< FlowTestCase2200Actor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase2200", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase2200", reinterpret_cast(this), 0); + + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 2232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + for(int t = 0;t < perThread.size();++t) { + #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + waitThread(perThread[t].handle); + #line 2234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + perThread[t].checkDone(); + #line 6577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + } + #line 2236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase2200ActorState(); static_cast(this)->destroy(); return 0; } + #line 6581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase2200ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 2232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + for(int t = 0;t < perThread.size();++t) { + #line 2233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + waitThread(perThread[t].handle); + #line 2234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + perThread[t].checkDone(); + #line 6597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + } + #line 2236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase2200ActorState(); static_cast(this)->destroy(); return 0; } + #line 6601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase2200ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase2200Actor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase2200Actor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase2200", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase2200", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< FlowTestCase2200Actor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase2200", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase2200", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< FlowTestCase2200Actor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase2200", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase2200", reinterpret_cast(this), 1); + + } + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + UnitTestParameters params; + #line 2204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + std::vector perThread; + #line 2207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + std::vector> doneProducing; + #line 2228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + Future doneConsuming; + #line 6680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase2200() + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +class FlowTestCase2200Actor final : public Actor, public ActorCallback< FlowTestCase2200Actor, 0, Void >, public ActorCallback< FlowTestCase2200Actor, 1, Void >, public FastAllocated, public FlowTestCase2200ActorState { + #line 6685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< FlowTestCase2200Actor, 0, Void >; +friend struct ActorCallback< FlowTestCase2200Actor, 1, Void >; + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + FlowTestCase2200Actor(UnitTestParameters const& params) + #line 6697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" + : Actor(), + FlowTestCase2200ActorState(params) + { + fdb_probe_actor_enter("flowTestCase2200", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase2200"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase2200", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< FlowTestCase2200Actor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase2200Actor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" +static Future flowTestCase2200( UnitTestParameters const& params ) { + #line 2200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + return Future(new FlowTestCase2200Actor(params)); + #line 6726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase2200, "noSim/flow/Net2/onMainThreadFIFO") + +#line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Net2.actor.cpp" + +void net2_test(){ + /* g_network = newNet2(); // for promise serialization below Endpoint destination; @@ -6382,7 +6752,7 @@ void net2_test(){ reqs.resize(10000); for(int i=0; i<10000; i++) { TestGVR &req = reqs[i]; - req.key = LiteralStringRef("Foobar"); + req.key = "Foobar"_sr; SerializeSource what(req); diff --git a/src/flow/PKey.cpp b/src/flow/PKey.cpp new file mode 100644 index 0000000..1424fc2 --- /dev/null +++ b/src/flow/PKey.cpp @@ -0,0 +1,294 @@ +/* + * PKey.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "flow/AutoCPointer.h" +#include "flow/Error.h" +#include "flow/PKey.h" +#include +#include +#include +#include +#include +#include +#include + +namespace { + +void traceAndThrowDecode(const char* type) { + auto te = TraceEvent(SevWarnAlways, type); + te.suppressFor(10); + if (auto err = ::ERR_get_error()) { + char buf[256]{ + 0, + }; + ::ERR_error_string_n(err, buf, sizeof(buf)); + te.detail("OpenSSLError", static_cast(buf)); + } + throw pkey_decode_error(); +} + +void traceAndThrowEncode(const char* type) { + auto te = TraceEvent(SevWarnAlways, type); + te.suppressFor(10); + if (auto err = ::ERR_get_error()) { + char buf[256]{ + 0, + }; + ::ERR_error_string_n(err, buf, sizeof(buf)); + te.detail("OpenSSLError", static_cast(buf)); + } + throw pkey_encode_error(); +} + +void traceAndThrowDsa(const char* type) { + auto te = TraceEvent(SevWarnAlways, type); + te.suppressFor(10); + if (auto err = ::ERR_get_error()) { + char buf[256]{ + 0, + }; + ::ERR_error_string_n(err, buf, sizeof(buf)); + te.detail("OpenSSLError", static_cast(buf)); + } + throw digital_signature_ops_error(); +} + +inline PKeyAlgorithm getPKeyAlgorithm(const EVP_PKEY* key) noexcept { + auto id = ::EVP_PKEY_base_id(key); + if (id == EVP_PKEY_RSA) + return PKeyAlgorithm::RSA; + else if (id == EVP_PKEY_EC) + return PKeyAlgorithm::EC; + else + return PKeyAlgorithm::UNSUPPORTED; +} + +} // anonymous namespace + +std::string_view pkeyAlgorithmName(PKeyAlgorithm alg) noexcept { + switch (alg) { + case PKeyAlgorithm::EC: + return "EC"; + case PKeyAlgorithm::RSA: + return "RSA"; + default: + return "UNSUPPORTED"; + } +} + +StringRef doWritePublicKeyPem(Arena& arena, EVP_PKEY* key) { + ASSERT(key); + auto mem = AutoCPointer(::BIO_new(::BIO_s_mem()), &::BIO_free); + if (!mem) + traceAndThrowEncode("PublicKeyPemWriteInitError"); + if (1 != ::PEM_write_bio_PUBKEY(mem, key)) + traceAndThrowEncode("PublicKeyPemWrite"); + auto bioBuf = std::add_pointer_t{}; + auto const len = ::BIO_get_mem_data(mem, &bioBuf); + ASSERT_GT(len, 0); + auto buf = new (arena) uint8_t[len]; + ::memcpy(buf, bioBuf, len); + return StringRef(buf, static_cast(len)); +} + +StringRef doWritePublicKeyDer(Arena& arena, EVP_PKEY* key) { + auto len = 0; + len = ::i2d_PUBKEY(key, nullptr); + ASSERT_LT(0, len); + auto buf = new (arena) uint8_t[len]; + auto out = std::add_pointer_t(buf); + len = ::i2d_PUBKEY(key, &out); + return StringRef(buf, len); +} + +bool doVerifyStringSignature(StringRef data, StringRef signature, const EVP_MD& digest, EVP_PKEY* key) { + auto mdctx = AutoCPointer(::EVP_MD_CTX_create(), &::EVP_MD_CTX_free); + if (!mdctx) { + traceAndThrowDsa("PKeyVerifyInitFail"); + } + if (1 != ::EVP_DigestVerifyInit(mdctx, nullptr, &digest, nullptr, key)) { + traceAndThrowDsa("PKeyVerifyInitFail"); + } + if (1 != ::EVP_DigestVerifyUpdate(mdctx, data.begin(), data.size())) { + traceAndThrowDsa("PKeyVerifyUpdateFail"); + } + if (1 != ::EVP_DigestVerifyFinal(mdctx, signature.begin(), signature.size())) { + return false; + } + return true; +} + +PublicKey::PublicKey(PemEncoded, StringRef pem) { + ASSERT(!pem.empty()); + auto mem = AutoCPointer(::BIO_new_mem_buf(pem.begin(), pem.size()), &::BIO_free); + if (!mem) + traceAndThrowDecode("PemMemBioInitError"); + auto key = ::PEM_read_bio_PUBKEY(mem, nullptr, nullptr, nullptr); + if (!key) + traceAndThrowDecode("PemReadPublicKeyError"); + ptr = std::shared_ptr(key, &::EVP_PKEY_free); + if (algorithm() == PKeyAlgorithm::UNSUPPORTED) { + TraceEvent(SevWarnAlways, "UnsupportedPKeyAlgorithm") + .suppressFor(10) + .detail("Algorithm", ::OBJ_nid2sn(EVP_PKEY_base_id(ptr.get()))); + throw pkey_decode_error(); + } +} + +PublicKey::PublicKey(DerEncoded, StringRef der) { + ASSERT(!der.empty()); + auto data = der.begin(); + auto key = ::d2i_PUBKEY(nullptr, &data, der.size()); + if (!key) + traceAndThrowDecode("DerReadPublicKeyError"); + ptr = std::shared_ptr(key, &::EVP_PKEY_free); + if (algorithm() == PKeyAlgorithm::UNSUPPORTED) { + TraceEvent(SevWarnAlways, "UnsupportedPKeyAlgorithm") + .suppressFor(10) + .detail("Algorithm", ::OBJ_nid2sn(EVP_PKEY_base_id(ptr.get()))); + throw pkey_decode_error(); + } +} + +StringRef PublicKey::writePem(Arena& arena) const { + return doWritePublicKeyPem(arena, nativeHandle()); +} + +StringRef PublicKey::writeDer(Arena& arena) const { + return doWritePublicKeyDer(arena, nativeHandle()); +} + +PKeyAlgorithm PublicKey::algorithm() const { + auto key = nativeHandle(); + ASSERT(key); + return getPKeyAlgorithm(key); +} + +std::string_view PublicKey::algorithmName() const { + return pkeyAlgorithmName(this->algorithm()); +} + +bool PublicKey::verify(StringRef data, StringRef signature, const EVP_MD& digest) const { + return doVerifyStringSignature(data, signature, digest, nativeHandle()); +} + +PrivateKey::PrivateKey(PemEncoded, StringRef pem) { + ASSERT(!pem.empty()); + auto mem = AutoCPointer(::BIO_new_mem_buf(pem.begin(), pem.size()), &::BIO_free); + if (!mem) + traceAndThrowDecode("PrivateKeyDecodeInitError"); + auto key = ::PEM_read_bio_PrivateKey(mem, nullptr, nullptr, nullptr); + if (!key) + traceAndThrowDecode("PemReadPrivateKeyError"); + ptr = std::shared_ptr(key, &::EVP_PKEY_free); + if (algorithm() == PKeyAlgorithm::UNSUPPORTED) { + TraceEvent(SevWarnAlways, "UnsupportedPKeyAlgorithm") + .suppressFor(10) + .detail("Algorithm", ::OBJ_nid2sn(EVP_PKEY_base_id(ptr.get()))); + throw pkey_decode_error(); + } +} + +PrivateKey::PrivateKey(DerEncoded, StringRef der) { + ASSERT(!der.empty()); + auto data = der.begin(); + auto key = ::d2i_AutoPrivateKey(nullptr, &data, der.size()); + if (!key) + traceAndThrowDecode("DerReadPrivateKeyError"); + ptr = std::shared_ptr(key, &::EVP_PKEY_free); + if (algorithm() == PKeyAlgorithm::UNSUPPORTED) { + TraceEvent(SevWarnAlways, "UnsupportedPKeyAlgorithm") + .suppressFor(10) + .detail("Algorithm", ::OBJ_nid2sn(EVP_PKEY_base_id(ptr.get()))); + throw pkey_decode_error(); + } +} + +StringRef PrivateKey::writePem(Arena& arena) const { + ASSERT(ptr); + auto mem = AutoCPointer(::BIO_new(::BIO_s_mem()), &::BIO_free); + if (!mem) + traceAndThrowEncode("PrivateKeyPemWriteInitError"); + if (1 != ::PEM_write_bio_PrivateKey(mem, nativeHandle(), nullptr, nullptr, 0, 0, nullptr)) + traceAndThrowEncode("PrivateKeyDerPemWrite"); + auto bioBuf = std::add_pointer_t{}; + auto const len = ::BIO_get_mem_data(mem, &bioBuf); + ASSERT_GT(len, 0); + auto buf = new (arena) uint8_t[len]; + ::memcpy(buf, bioBuf, len); + return StringRef(buf, static_cast(len)); +} + +StringRef PrivateKey::writeDer(Arena& arena) const { + ASSERT(ptr); + auto len = 0; + len = ::i2d_PrivateKey(nativeHandle(), nullptr); + ASSERT_LT(0, len); + auto buf = new (arena) uint8_t[len]; + auto out = std::add_pointer_t(buf); + len = ::i2d_PrivateKey(nativeHandle(), &out); + return StringRef(buf, len); +} + +StringRef PrivateKey::writePublicKeyPem(Arena& arena) const { + return doWritePublicKeyPem(arena, nativeHandle()); +} + +StringRef PrivateKey::writePublicKeyDer(Arena& arena) const { + return doWritePublicKeyDer(arena, nativeHandle()); +} + +PKeyAlgorithm PrivateKey::algorithm() const { + auto key = nativeHandle(); + ASSERT(key); + return getPKeyAlgorithm(key); +} + +std::string_view PrivateKey::algorithmName() const { + return pkeyAlgorithmName(this->algorithm()); +} + +StringRef PrivateKey::sign(Arena& arena, StringRef data, const EVP_MD& digest) const { + auto key = nativeHandle(); + ASSERT(key); + auto mdctx = AutoCPointer(::EVP_MD_CTX_create(), &::EVP_MD_CTX_free); + if (!mdctx) + traceAndThrowDsa("PKeySignInitError"); + if (1 != ::EVP_DigestSignInit(mdctx, nullptr, &digest, nullptr, nativeHandle())) + traceAndThrowDsa("PKeySignInitError"); + if (1 != ::EVP_DigestSignUpdate(mdctx, data.begin(), data.size())) + traceAndThrowDsa("PKeySignUpdateError"); + auto sigLen = size_t{}; + if (1 != ::EVP_DigestSignFinal(mdctx, nullptr, &sigLen)) // assess the length first + traceAndThrowDsa("PKeySignFinalGetLengthError"); + auto sigBuf = new (arena) uint8_t[sigLen]; + if (1 != ::EVP_DigestSignFinal(mdctx, sigBuf, &sigLen)) + traceAndThrowDsa("SignTokenFinalError"); + return StringRef(sigBuf, sigLen); +} + +bool PrivateKey::verify(StringRef data, StringRef signature, const EVP_MD& digest) const { + return doVerifyStringSignature(data, signature, digest, nativeHandle()); +} + +PublicKey PrivateKey::toPublic() const { + auto arena = Arena(); + return PublicKey(DerEncoded{}, writePublicKeyDer(arena)); +} diff --git a/src/flow/Platform.actor.cpp b/src/flow/Platform.actor.cpp index 3b898fe..0051a37 100644 --- a/src/flow/Platform.actor.cpp +++ b/src/flow/Platform.actor.cpp @@ -21,52 +21,65 @@ #ifdef _WIN32 // This has to come as the first include on Win32 for rand_s() to be found #define _CRT_RAND_S -#include -#include // For _set_FMA3_enable workaround in platformInit -#endif +#endif // _WIN32 -#include -#include "fmt/format.h" #include "flow/Platform.h" -#include "flow/Platform.actor.h" -#include "flow/Arena.h" - -#if (!defined(TLS_DISABLED) && !defined(_WIN32)) -#include "flow/StreamCipher.h" -#include "flow/BlobCipher.h" -#endif -#include "flow/Trace.h" -#include "flow/Error.h" - -#include "flow/Knobs.h" +#include #include #include #include #include -#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include "flow/UnitTest.h" -#include "flow/FaultInjection.h" -#include "fdbrpc/IAsyncFile.h" +#include +#include +#include +#include +#include + +#include "fmt/format.h" + +#include "flow/Arena.h" +#include "flow/Error.h" +#include "flow/FaultInjection.h" +#include "flow/Knobs.h" +#include "flow/Platform.actor.h" +#include "flow/ScopeExit.h" +#include "flow/StreamCipher.h" +#include "flow/Trace.h" +#include "flow/Trace.h" +#include "flow/UnitTest.h" +#include "flow/Util.h" -#include "fdbclient/AnnotateActor.h" +// boost uses either std::array or boost::asio::detail::array to store the IPv6 Addresses. +// Enforce the format of IPAddressStore, which is declared in IPAddress.h, is using the same type +// to boost. +static_assert(std::is_same>::value, + "IPAddressStore must be std::array"); #ifdef _WIN32 -#include -#include -#include -#include -#include + #include #include +#include +#include // For _set_FMA3_enable workaround in platformInit #include #include +#include +#include +#include +#include +#include + #pragma comment(lib, "pdh.lib") // for SHGetFolderPath @@ -81,19 +94,18 @@ #define CANONICAL_PATH_SEPARATOR '/' #include -#include -#include -#include #include #include #include +#include +#include +#include +#include /* Needed for disk capacity */ + #if !defined(__aarch64__) && !defined(__powerpc64__) #include #endif -/* Needed for disk capacity */ -#include - /* getifaddrs */ #include #include @@ -114,7 +126,7 @@ #include /* Needed for gnu_dev_{major,minor} */ #include -#endif +#endif // __linux__ #ifdef __FreeBSD__ /* Needed for processor affinity */ @@ -147,29 +159,31 @@ #include #include #include -#endif +#endif // __FreeBSD__ #ifdef __APPLE__ -#include -#include -#include +/* Needed for cross-platform 'environ' */ +#include #include -#include -#include -#include -#include -#include +#include #include +#include #include +#include +#include +#include +#include +#include +#include #include #include #include #include #include -#endif +#endif // __APPLE_ -#endif +#endif // __unixish__ #include "flow/actorcompiler.h" // This must be the last #include. @@ -403,25 +417,24 @@ uint64_t getMemoryUsage() { #endif } -#if defined(__linux__) +#ifdef __linux__ +namespace linux_os { + +namespace { + void getMemoryInfo(std::map& request, std::stringstream& memInfoStream) { size_t count = request.size(); if (count == 0) return; - while (count > 0 && !memInfoStream.eof()) { - std::string key; - - memInfoStream >> key; + keyValueReader(memInfoStream, [&](const std::string& key, const int64_t& value) -> bool { auto item = request.find(StringRef(key)); - if (item != request.end()) { - int64_t value; - memInfoStream >> value; + if (item != std::end(request)) { item->second = value; - count--; + --count; } - memInfoStream.ignore(std::numeric_limits::max(), '\n'); - } + return count != 0; + }); } int64_t getLowWatermark(std::stringstream& zoneInfoStream) { @@ -441,10 +454,8 @@ int64_t getLowWatermark(std::stringstream& zoneInfoStream) { return lowWatermark; } -#endif -void getMachineRAMInfo(MachineRAMInfo& memInfo) { -#if defined(__linux__) +void getMachineRAMInfoImpl(MachineRAMInfo& memInfo) { std::ifstream zoneInfoFileStream("/proc/zoneinfo", std::ifstream::in); int64_t lowWatermark = 0; if (!zoneInfoFileStream.good()) { @@ -462,24 +473,22 @@ void getMachineRAMInfo(MachineRAMInfo& memInfo) { } std::map request = { - { LiteralStringRef("MemTotal:"), 0 }, { LiteralStringRef("MemFree:"), 0 }, - { LiteralStringRef("MemAvailable:"), -1 }, { LiteralStringRef("Active(file):"), 0 }, - { LiteralStringRef("Inactive(file):"), 0 }, { LiteralStringRef("SwapTotal:"), 0 }, - { LiteralStringRef("SwapFree:"), 0 }, { LiteralStringRef("SReclaimable:"), 0 }, + { "MemTotal:"_sr, 0 }, { "MemFree:"_sr, 0 }, { "MemAvailable:"_sr, -1 }, { "Active(file):"_sr, 0 }, + { "Inactive(file):"_sr, 0 }, { "SwapTotal:"_sr, 0 }, { "SwapFree:"_sr, 0 }, { "SReclaimable:"_sr, 0 }, }; std::stringstream memInfoStream; memInfoStream << fileStream.rdbuf(); getMemoryInfo(request, memInfoStream); - int64_t memFree = request[LiteralStringRef("MemFree:")]; - int64_t pageCache = request[LiteralStringRef("Active(file):")] + request[LiteralStringRef("Inactive(file):")]; - int64_t slabReclaimable = request[LiteralStringRef("SReclaimable:")]; - int64_t usedSwap = request[LiteralStringRef("SwapTotal:")] - request[LiteralStringRef("SwapFree:")]; + int64_t memFree = request["MemFree:"_sr]; + int64_t pageCache = request["Active(file):"_sr] + request["Inactive(file):"_sr]; + int64_t slabReclaimable = request["SReclaimable:"_sr]; + int64_t usedSwap = request["SwapTotal:"_sr] - request["SwapFree:"_sr]; - memInfo.total = 1024 * request[LiteralStringRef("MemTotal:")]; - if (request[LiteralStringRef("MemAvailable:")] != -1) { - memInfo.available = 1024 * (request[LiteralStringRef("MemAvailable:")] - usedSwap); + memInfo.total = 1024 * request["MemTotal:"_sr]; + if (request["MemAvailable:"_sr] != -1) { + memInfo.available = 1024 * (request["MemAvailable:"_sr] - usedSwap); } else { memInfo.available = 1024 * (std::max(0, @@ -489,6 +498,35 @@ void getMachineRAMInfo(MachineRAMInfo& memInfo) { } memInfo.committed = memInfo.total - memInfo.available; +} + +} // anonymous namespace + +std::map reportCGroupCpuStat() { + // Default path to the cpu,cpuacct + // See manpages for cgroup + static const std::string PATH_TO_CPU_CPUACCT = "/sys/fs/cgroup/cpu,cpuacct/cpu.stat"; + + std::map result; + std::ifstream ifs(PATH_TO_CPU_CPUACCT); + if (!ifs.is_open()) { + return result; + } + + keyValueReader(ifs, [&](const std::string& key, const int64_t& value) -> bool { + result[key] = value; + return true; + }); + + return result; +} + +} // namespace linux_os +#endif // #ifdef __linux__ + +void getMachineRAMInfo(MachineRAMInfo& memInfo) { +#if defined(__linux__) + linux_os::getMachineRAMInfoImpl(memInfo); #elif defined(__FreeBSD__) int status; @@ -613,7 +651,11 @@ void getDiskBytes(std::string const& directory, int64_t& free, int64_t& total) { #endif free = std::min((uint64_t)std::numeric_limits::max(), buf.f_bavail * blockSize); - total = std::min((uint64_t)std::numeric_limits::max(), buf.f_blocks * blockSize); + + // f_blocks is the total fs space but (f_bfree - f_bavail) is space only available to privileged users + // so that amount will be subtracted from the reported total since FDB can't use it. + total = std::min((uint64_t)std::numeric_limits::max(), + (buf.f_blocks - (buf.f_bfree - buf.f_bavail)) * blockSize); #elif defined(_WIN32) std::string fullPath = abspath(directory); @@ -1936,6 +1978,39 @@ std::string epochsToGMTString(double epochs) { return timeString; } +std::vector getEnvironmentKnobOptions() { + constexpr const size_t ENVKNOB_PREFIX_LEN = sizeof(ENVIRONMENT_KNOB_OPTION_PREFIX) - 1; + std::vector knobOptions; +#if defined(_WIN32) + auto e = GetEnvironmentStrings(); + if (e == nullptr) + return {}; + auto cleanup = ScopeExit([e]() { FreeEnvironmentStrings(e); }); + while (*e) { + auto candidate = std::string_view(e); + if (boost::starts_with(candidate, ENVIRONMENT_KNOB_OPTION_PREFIX)) + knobOptions.emplace_back(candidate.substr(ENVKNOB_PREFIX_LEN)); + e += (candidate.size() + 1); + } +#else + char** e = nullptr; +#ifdef __linux__ + e = environ; +#elif defined(__APPLE__) + e = *_NSGetEnviron(); +#else +#error Port me! +#endif + for (; e && *e; e++) { + std::string_view envOption(*e); + if (boost::starts_with(envOption, ENVIRONMENT_KNOB_OPTION_PREFIX)) { + knobOptions.emplace_back(envOption.substr(ENVKNOB_PREFIX_LEN)); + } + } +#endif + return knobOptions; +} + void setMemoryQuota(size_t limit) { if (limit == 0) { return; @@ -2032,7 +2107,53 @@ static void enableLargePages() { #endif } -static void* allocateInternal(size_t length, bool largePages) { +#ifndef _WIN32 +static void* mmapSafe(void* addr, size_t len, int prot, int flags, int fd, off_t offset) { + void* result = mmap(addr, len, prot, flags, fd, offset); + if (result == MAP_FAILED) { + int err = errno; + fprintf(stderr, + "Error calling mmap(%p, %zu, %d, %d, %d, %jd): %s\n", + addr, + len, + prot, + flags, + fd, + (intmax_t)offset, + strerror(err)); + fflush(stderr); + std::abort(); + } + return result; +} + +static void mprotectSafe(void* p, size_t s, int prot) { + if (mprotect(p, s, prot) != 0) { + int err = errno; + fprintf(stderr, "Error calling mprotect(%p, %zu, %d): %s\n", p, s, prot, strerror(err)); + fflush(stderr); + std::abort(); + } +} + +static void* mmapInternal(size_t length, int flags, bool guardPages) { + if (guardPages && FLOW_KNOBS->FAST_ALLOC_ALLOW_GUARD_PAGES) { + static size_t pageSize = sysconf(_SC_PAGESIZE); + length = RightAlign(length, pageSize); + length += 2 * pageSize; // Map enough for the guard pages + void* resultWithGuardPages = mmapSafe(nullptr, length, PROT_READ | PROT_WRITE, flags, -1, 0); + // left guard page + mprotectSafe(resultWithGuardPages, pageSize, PROT_NONE); + // right guard page + mprotectSafe((void*)(uintptr_t(resultWithGuardPages) + length - pageSize), pageSize, PROT_NONE); + return (void*)(uintptr_t(resultWithGuardPages) + pageSize); + } else { + return mmapSafe(nullptr, length, PROT_READ | PROT_WRITE, flags, -1, 0); + } +} +#endif + +static void* allocateInternal(size_t length, bool largePages, bool guardPages) { #ifdef _WIN32 DWORD allocType = MEM_COMMIT | MEM_RESERVE; @@ -2047,31 +2168,31 @@ static void* allocateInternal(size_t length, bool largePages) { if (largePages) flags |= MAP_HUGETLB; - return mmap(nullptr, length, PROT_READ | PROT_WRITE, flags, -1, 0); + return mmapInternal(length, flags, guardPages); #elif defined(__APPLE__) || defined(__FreeBSD__) int flags = MAP_PRIVATE | MAP_ANON; - return mmap(nullptr, length, PROT_READ | PROT_WRITE, flags, -1, 0); + return mmapInternal(length, flags, guardPages); #else #error Port me! #endif } static bool largeBlockFail = false; -void* allocate(size_t length, bool allowLargePages) { +void* allocate(size_t length, bool allowLargePages, bool includeGuardPages) { if (allowLargePages) enableLargePages(); void* block = ALLOC_FAIL; if (allowLargePages && !largeBlockFail) { - block = allocateInternal(length, true); + block = allocateInternal(length, true, includeGuardPages); if (block == ALLOC_FAIL) largeBlockFail = true; } if (block == ALLOC_FAIL) - block = allocateInternal(length, false); + block = allocateInternal(length, false, includeGuardPages); // FIXME: SevWarnAlways trace if "close" to out of memory @@ -2136,35 +2257,21 @@ namespace platform { int getRandomSeed() { INJECT_FAULT(platform_error, "getRandomSeed"); // getting a random seed failed int randomSeed; - int retryCount = 0; #ifdef _WIN32 - do { - retryCount++; - if (rand_s((unsigned int*)&randomSeed) != 0) { - TraceEvent(SevError, "WindowsRandomSeedError").log(); - throw platform_error(); - } - } while (randomSeed == 0 && - retryCount < - FLOW_KNOBS->RANDOMSEED_RETRY_LIMIT); // randomSeed cannot be 0 since we use mersenne twister in - // DeterministicRandom. Get a new one if randomSeed is 0. + if (rand_s((unsigned int*)&randomSeed) != 0) { + TraceEvent(SevError, "WindowsRandomSeedError").log(); + throw platform_error(); + } #else int devRandom = open("/dev/urandom", O_RDONLY | O_CLOEXEC); - do { - retryCount++; - if (read(devRandom, &randomSeed, sizeof(randomSeed)) != sizeof(randomSeed)) { - TraceEvent(SevError, "OpenURandom").GetLastError(); - throw platform_error(); - } - } while (randomSeed == 0 && retryCount < FLOW_KNOBS->RANDOMSEED_RETRY_LIMIT); + if (read(devRandom, &randomSeed, sizeof(randomSeed)) != sizeof(randomSeed)) { + TraceEvent(SevError, "OpenURandom").GetLastError(); + throw platform_error(); + } close(devRandom); #endif - if (randomSeed == 0) { - TraceEvent(SevError, "RandomSeedZeroError").log(); - throw platform_error(); - } return randomSeed; } } // namespace platform @@ -2186,7 +2293,9 @@ void renamedFile() { void renameFile(std::string const& fromPath, std::string const& toPath) { INJECT_FAULT(io_error, "renameFile"); // rename file failed #ifdef _WIN32 - if (MoveFile(fromPath.c_str(), toPath.c_str())) { + if (MoveFileExA(fromPath.c_str(), + toPath.c_str(), + MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH)) { // renamedFile(); return; } @@ -2279,8 +2388,11 @@ void atomicReplace(std::string const& path, std::string const& content, bool tex } f = 0; - if (!ReplaceFile(path.c_str(), tempfilename.c_str(), nullptr, NULL, nullptr, nullptr)) + if (!MoveFileExA(tempfilename.c_str(), + path.c_str(), + MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH)) { throw io_error(); + } #elif defined(__unixish__) if (!g_network->isSimulated()) { if (fsync(fileno(f)) != 0) @@ -2403,7 +2515,7 @@ bool createDirectory(std::string const& directory) { const uint8_t separatorChar = CANONICAL_PATH_SEPARATOR; StringRef separator(&separatorChar, 1); -StringRef dotdot = LiteralStringRef(".."); +StringRef dotdot = ".."_sr; std::string cleanPath(std::string const& path) { std::vector finalParts; @@ -2471,14 +2583,14 @@ std::string popPath(const std::string& path) { return path.substr(0, i + 1); } -std::string abspath(std::string const& path, bool resolveLinks, bool mustExist) { - if (path.empty()) { +std::string abspath(std::string const& path_, bool resolveLinks, bool mustExist) { + if (path_.empty()) { Error e = platform_error(); Severity sev = e.code() == error_code_io_error ? SevError : SevWarnAlways; - TraceEvent(sev, "AbsolutePathError").error(e).detail("Path", path); + TraceEvent(sev, "AbsolutePathError").error(e).detail("Path", path_); throw e; } - + std::string path = path_.back() == '\\' ? path_.substr(0, path_.size() - 1) : path_; // Returns an absolute path canonicalized to use only CANONICAL_PATH_SEPARATOR INJECT_FAULT(platform_error, "abspath"); // abspath failed @@ -2898,54 +3010,54 @@ int64_t fileSize(std::string const& filename) { #endif } -std::string readFileBytes(std::string const& filename, int maxSize) { - std::string s; - FILE* f = fopen(filename.c_str(), "rb" FOPEN_CLOEXEC_MODE); - if (!f) { - TraceEvent(SevWarn, "FileOpenError") +size_t readFileBytes(std::string const& filename, uint8_t* buff, size_t len) { + std::fstream ifs(filename, std::fstream::in | std::fstream::binary); + if (!ifs.good()) { + TraceEvent("ileBytes_FileOpenError").detail("Filename", filename).GetLastError(); + throw io_error(); + } + + size_t bytesRead = len; + ifs.seekg(0, std::fstream::beg); + ifs.read((char*)buff, len); + if (!ifs) { + bytesRead = ifs.gcount(); + TraceEvent("ReadFileBytes_ShortRead") .detail("Filename", filename) - .detail("Errno", errno) - .detail("ErrorDescription", strerror(errno)); - throw file_not_readable(); + .detail("Requested", len) + .detail("Actual", bytesRead); } - try { - fseek(f, 0, SEEK_END); - size_t size = ftell(f); - if (size > maxSize) - throw file_too_large(); - s.resize(size); - fseek(f, 0, SEEK_SET); - if (!fread(&s[0], size, 1, f)) - throw file_not_readable(); - } catch (...) { - fclose(f); - throw; + + return bytesRead; +} + +std::string readFileBytes(std::string const& filename, int maxSize) { + if (!fileExists(filename)) { + TraceEvent("ReadFileBytes_FileNotFound").detail("Filename", filename); + throw file_not_found(); } - fclose(f); - return s; + + size_t size = fileSize(filename); + if (size > maxSize) { + TraceEvent("ReadFileBytes_FileTooLarge").detail("Filename", filename); + throw file_too_large(); + } + + std::string ret; + ret.resize(size); + readFileBytes(filename, (uint8_t*)ret.data(), size); + + return ret; } void writeFileBytes(std::string const& filename, const uint8_t* data, size_t count) { - FILE* f = fopen(filename.c_str(), "wb" FOPEN_CLOEXEC_MODE); - if (!f) { - TraceEvent(SevError, "WriteFileBytes").detail("Filename", filename).GetLastError(); - throw file_not_writable(); + std::ofstream ofs(filename, std::fstream::out | std::fstream::binary); + if (!ofs.good()) { + TraceEvent("WriteFileBytes_FileOpenError").detail("Filename", filename).GetLastError(); + throw io_error(); } - try { - size_t length = fwrite(data, sizeof(uint8_t), count, f); - if (length != count) { - TraceEvent(SevError, "WriteFileBytes") - .detail("Filename", filename) - .detail("WrittenLength", length) - .GetLastError(); - throw file_not_writable(); - } - } catch (...) { - fclose(f); - throw; - } - fclose(f); + ofs.write((const char*)data, count); } void writeFile(std::string const& filename, std::string const& content) { @@ -3067,19 +3179,19 @@ void outOfMemory() { char* demangled = abi::__cxa_demangle(i->first, nullptr, nullptr, nullptr); if (demangled) { s = demangled; - if (StringRef(s).startsWith(LiteralStringRef("(anonymous namespace)::"))) - s = s.substr(LiteralStringRef("(anonymous namespace)::").size()); + if (StringRef(s).startsWith("(anonymous namespace)::"_sr)) + s = s.substr("(anonymous namespace)::"_sr.size()); free(demangled); } else s = i->first; #else s = i->first; - if (StringRef(s).startsWith(LiteralStringRef("class `anonymous namespace'::"))) - s = s.substr(LiteralStringRef("class `anonymous namespace'::").size()); - else if (StringRef(s).startsWith(LiteralStringRef("class "))) - s = s.substr(LiteralStringRef("class ").size()); - else if (StringRef(s).startsWith(LiteralStringRef("struct "))) - s = s.substr(LiteralStringRef("struct ").size()); + if (StringRef(s).startsWith("class `anonymous namespace'::"_sr)) + s = s.substr("class `anonymous namespace'::"_sr.size()); + else if (StringRef(s).startsWith("class "_sr)) + s = s.substr("class "_sr.size()); + else if (StringRef(s).startsWith("struct "_sr)) + s = s.substr("struct "_sr.size()); #endif typeNames.emplace_back(s, i->first); } @@ -3159,10 +3271,10 @@ void outOfMemory() { } // Because the lambda used with nftw below cannot capture -int __eraseDirectoryRecurseiveCount; +int __eraseDirectoryRecursiveCount; int eraseDirectoryRecursive(std::string const& dir) { - __eraseDirectoryRecurseiveCount = 0; + __eraseDirectoryRecursiveCount = 0; #ifdef _WIN32 system(("rd /s /q \"" + dir + "\"").c_str()); #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) @@ -3171,7 +3283,7 @@ int eraseDirectoryRecursive(std::string const& dir) { [](const char* fpath, const struct stat* sb, int typeflag, struct FTW* ftwbuf) -> int { int r = remove(fpath); if (r == 0) - ++__eraseDirectoryRecurseiveCount; + ++__eraseDirectoryRecursiveCount; return r; }, 64, @@ -3188,25 +3300,62 @@ int eraseDirectoryRecursive(std::string const& dir) { #error Port me! #endif // INJECT_FAULT( platform_error, "eraseDirectoryRecursive" ); - return __eraseDirectoryRecurseiveCount; + return __eraseDirectoryRecursiveCount; } -bool isHwCrcSupported() { -#if defined(_WIN32) - int info[4]; - __cpuid(info, 1); - return (info[2] & (1 << 20)) != 0; -#elif defined(__aarch64__) - return true; /* force to use crc instructions */ -#elif defined(__powerpc64__) - return false; /* force not to use crc instructions */ -#elif defined(__unixish__) - uint32_t eax, ebx, ecx, edx, level = 1, count = 0; - __cpuid_count(level, count, eax, ebx, ecx, edx); - return ((ecx >> 20) & 1) != 0; -#else -#error Port me! -#endif +TmpFile::TmpFile() : filename("") { + createTmpFile(boost::filesystem::temp_directory_path().string(), TmpFile::defaultPrefix); +} + +TmpFile::TmpFile(const std::string& tmpDir) : filename("") { + std::string dir = removeWhitespace(tmpDir); + createTmpFile(dir, TmpFile::defaultPrefix); +} + +TmpFile::TmpFile(const std::string& tmpDir, const std::string& prefix) : filename("") { + std::string dir = removeWhitespace(tmpDir); + createTmpFile(dir, prefix); +} + +TmpFile::~TmpFile() { + if (!filename.empty()) { + destroyFile(); + } +} + +void TmpFile::createTmpFile(const std::string_view dir, const std::string_view prefix) { + std::string modelPattern = "%%%%-%%%%-%%%%-%%%%"; + boost::format fmter("%s/%s-%s"); + std::string modelPath = boost::str(boost::format(fmter % dir % prefix % modelPattern)); + boost::filesystem::path filePath = boost::filesystem::unique_path(modelPath); + + filename = filePath.string(); + + // Create empty tmp file + std::fstream tmpFile(filename, std::fstream::out); + if (!tmpFile.good()) { + TraceEvent("TmpFile_CreateFileError").detail("Filename", filename); + throw io_error(); + } + TraceEvent("TmpFile_CreateSuccess").detail("Filename", filename); +} + +size_t TmpFile::read(uint8_t* buff, size_t len) { + return readFileBytes(filename, buff, len); +} + +void TmpFile::write(const uint8_t* buff, size_t len) { + writeFileBytes(filename, buff, len); +} + +bool TmpFile::destroyFile() { + bool deleted = deleteFile(filename); + if (deleted) { + TraceEvent("TmpFileDestory_Success").detail("Filename", filename); + } else { + TraceEvent("TmpFileDestory_Failed").detail("Filename", filename); + } + return deleted; } } // namespace platform @@ -3379,7 +3528,12 @@ void* loadLibrary(const char* lib_path) { void* dlobj = nullptr; #if defined(__unixish__) - dlobj = dlopen(lib_path, RTLD_LAZY | RTLD_LOCAL); + dlobj = dlopen(lib_path, + RTLD_LAZY | RTLD_LOCAL +#ifdef USE_SANITIZER // Keep alive dlopen()-ed libs for symbolized XSAN backtrace + | RTLD_NODELETE +#endif + ); if (dlobj == nullptr) { TraceEvent(SevWarn, "LoadLibraryFailed").detail("Library", lib_path).detail("Error", dlerror()); } @@ -3491,6 +3645,12 @@ void platformInit() { #endif } +std::vector> g_crashHandlerCallbacks; + +void registerCrashHandlerCallback(void (*f)()) { + g_crashHandlerCallbacks.push_back(f); +} + // The crashHandler function is registered to handle signals before the process terminates. // Basic information about the crash is printed/traced, and stdout and trace events are flushed. void crashHandler(int sig) { @@ -3499,13 +3659,19 @@ void crashHandler(int sig) { // but the idea is that we're about to crash anyway... std::string backtrace = platform::get_backtrace(); - bool error = (sig != SIGUSR2); + bool error = (sig != SIGUSR2 && sig != SIGTERM); -#if (!defined(TLS_DISABLED) && !defined(_WIN32)) StreamCipherKey::cleanup(); StreamCipher::cleanup(); - BlobCipherKeyCache::cleanup(); -#endif + + for (auto& f : g_crashHandlerCallbacks) { + f(); + } + + fprintf(error ? stderr : stdout, "SIGNAL: %s (%d)\n", strsignal(sig), sig); + if (error) { + fprintf(stderr, "Trace: %s\n", backtrace.c_str()); + } fflush(stdout); { @@ -3517,8 +3683,9 @@ void crashHandler(int sig) { } flushTraceFileVoid(); - fprintf(stderr, "SIGNAL: %s (%d)\n", strsignal(sig), sig); - fprintf(stderr, "Trace: %s\n", backtrace.c_str()); +#ifdef USE_GCOV + __gcov_flush(); +#endif struct sigaction sa; sa.sa_handler = SIG_DFL; @@ -3558,6 +3725,15 @@ void registerCrashHandler() { sigaction(SIGSEGV, &action, nullptr); sigaction(SIGBUS, &action, nullptr); sigaction(SIGUSR2, &action, nullptr); +#ifdef USE_GCOV + // SIGTERM is the "graceful" way to end an fdbserver process, so we actually + // don't want to invoke crashHandler. crashHandler is not actually + // async-signal-safe, so we can only justify calling it if we were going to + // crash anyway. For USE_GCOV though we need to flush coverage info, which + // we do through crashHandler. + sigaction(SIGTERM, &action, nullptr); +#endif + sigaction(SIGABRT, &action, nullptr); #else // No crash handler for other platforms! #endif @@ -3573,38 +3749,71 @@ extern std::atomic net2RunLoopIterations; extern std::atomic net2RunLoopSleeps; extern void initProfiling(); +namespace { + std::atomic checkThreadTime; +std::mutex loopProfilerThreadMutex; +std::optional loopProfilerThread; +std::atomic loopProfilerStopRequested = false; + +} // namespace #endif -volatile thread_local bool profileThread = false; -volatile thread_local int profilingEnabled = 1; +// True if this thread is the thread being profiled. Not to be used from the signal handler. +thread_local bool profileThread = false; + +// The thread ID of the profiled thread. This can be compared against the current thread ID +// to see if we are on the profiled thread. Can be used in the signal handler. +volatile int64_t profileThreadId = -1; -volatile thread_local int64_t numProfilesDeferred = 0; -volatile thread_local int64_t numProfilesOverflowed = 0; -volatile thread_local int64_t numProfilesCaptured = 0; -volatile thread_local bool profileRequested = false; +#ifdef __linux__ +struct sigaction chainedAction; +#endif -int64_t getNumProfilesDeferred() { - return numProfilesDeferred; +volatile bool profilingEnabled = 1; +volatile thread_local bool flowProfilingEnabled = 1; + +volatile int64_t numProfilesDisabled = 0; +volatile int64_t numProfilesOverflowed = 0; +volatile int64_t numProfilesCaptured = 0; + +int64_t getNumProfilesDisabled() { + if (profileThread) { + return numProfilesDisabled; + } else { + return 0; + } } int64_t getNumProfilesOverflowed() { - return numProfilesOverflowed; + if (profileThread) { + return numProfilesOverflowed; + } else { + return 0; + } } int64_t getNumProfilesCaptured() { - return numProfilesCaptured; + if (profileThread) { + return numProfilesCaptured; + } else { + return 0; + } } void profileHandler(int sig) { #ifdef __linux__ - if (!profileThread) { - return; + if (chainedAction.sa_handler != SIG_DFL && chainedAction.sa_handler != SIG_IGN && + chainedAction.sa_handler != nullptr) { + chainedAction.sa_handler(sig); } - if (!profilingEnabled) { - profileRequested = true; - ++numProfilesDeferred; + // This is not documented in the POSIX list of signal-safe functions, but numbered syscalls are reported to be + // async safe in Linux. + if (profileThreadId != syscall(__NR_gettid)) { + return; + } else if (!profilingEnabled) { + ++numProfilesDisabled; return; } @@ -3627,26 +3836,29 @@ void profileHandler(int sig) { // We can't get the time from a timer() call because it's not signal safe. ps->timestamp = checkThreadTime.is_lock_free() ? checkThreadTime.load() : 0; +#if defined(USE_SANITIZER) + // In sanitizer builds the workaround implemented in SignalSafeUnwind.cpp is disabled + // so calling backtrace may cause a deadlock + size_t size = 0; +#else // SOMEDAY: should we limit the maximum number of frames from backtrace beyond just available space? size_t size = backtrace(ps->frames, net2backtraces_max - net2backtraces_offset - 2); +#endif ps->length = size; net2backtraces_offset += size + 2; #else - // No slow task profiling for other platforms! +// No slow task profiling for other platforms! #endif } void setProfilingEnabled(int enabled) { #ifdef __linux__ - if (profileThread && enabled && !profilingEnabled && profileRequested) { - profilingEnabled = true; - profileRequested = false; - pthread_kill(pthread_self(), SIGPROF); - } else { + if (profileThread) { profilingEnabled = enabled; } + flowProfilingEnabled = enabled; #else // No profiling for other platforms! #endif @@ -3673,7 +3885,7 @@ void* checkThread(void* arg) { double slowTaskLogInterval = minSlowTaskLogInterval; double saturatedLogInterval = minSaturationLogInterval; - while (true) { + while (!loopProfilerStopRequested) { threadSleep(FLOW_KNOBS->RUN_LOOP_PROFILING_INTERVAL); int64_t currentRunLoopIterations = net2RunLoopIterations.load(); @@ -3793,27 +4005,59 @@ std::string getExecPath() { void setupRunLoopProfiler() { #ifdef __linux__ - if (!profileThread && FLOW_KNOBS->RUN_LOOP_PROFILING_INTERVAL > 0) { + if (profileThreadId == -1 && FLOW_KNOBS->RUN_LOOP_PROFILING_INTERVAL > 0) { + chainedAction.sa_handler = SIG_DFL; + TraceEvent("StartingRunLoopProfilingThread").detail("Interval", FLOW_KNOBS->RUN_LOOP_PROFILING_INTERVAL); - initProfiling(); + profileThread = true; + profileThreadId = syscall(__NR_gettid); + if (profileThreadId < 0) { + TraceEvent(SevWarnAlways, "RunLoopProfilingSetupFailed") + .detail("Reason", "Error getting thread ID") + .GetLastError(); + return; + } + + initProfiling(); struct sigaction action; action.sa_handler = profileHandler; sigfillset(&action.sa_mask); action.sa_flags = 0; - sigaction(SIGPROF, &action, nullptr); + if (sigaction(SIGPROF, &action, &chainedAction)) { + TraceEvent(SevWarnAlways, "RunLoopProfilingSetupFailed") + .detail("Reason", "Error configuring signal handler") + .GetLastError(); + return; + } // Start a thread which will use signals to log stacks on long events pthread_t* mainThread = (pthread_t*)malloc(sizeof(pthread_t)); *mainThread = pthread_self(); - startThread(&checkThread, (void*)mainThread, 0, "fdb-loopprofile"); + { + std::unique_lock lock(loopProfilerThreadMutex); + if (!loopProfilerStopRequested) { + loopProfilerThread = startThread(&checkThread, (void*)mainThread, 0, "fdb-loopprofile"); + } + } } #else // No slow task profiling for other platforms! #endif } +void stopRunLoopProfiler() { +#ifdef __linux__ + std::unique_lock lock(loopProfilerThreadMutex); + loopProfilerStopRequested.store(true); + if (loopProfilerThread) { + pthread_join(loopProfilerThread.value(), NULL); + loopProfilerThread = {}; + } +#endif +} + // UnitTest for getMemoryInfo #ifdef __linux__ TEST_CASE("/flow/Platform/getMemoryInfo") { @@ -3853,21 +4097,19 @@ TEST_CASE("/flow/Platform/getMemoryInfo") { "VmallocUsed: 410576 kB\n"; std::map request = { - { LiteralStringRef("MemTotal:"), 0 }, { LiteralStringRef("MemFree:"), 0 }, - { LiteralStringRef("MemAvailable:"), 0 }, { LiteralStringRef("Buffers:"), 0 }, - { LiteralStringRef("Cached:"), 0 }, { LiteralStringRef("SwapTotal:"), 0 }, - { LiteralStringRef("SwapFree:"), 0 }, + { "MemTotal:"_sr, 0 }, { "MemFree:"_sr, 0 }, { "MemAvailable:"_sr, 0 }, { "Buffers:"_sr, 0 }, + { "Cached:"_sr, 0 }, { "SwapTotal:"_sr, 0 }, { "SwapFree:"_sr, 0 }, }; std::stringstream memInfoStream(memString); - getMemoryInfo(request, memInfoStream); - ASSERT(request[LiteralStringRef("MemTotal:")] == 24733228); - ASSERT(request[LiteralStringRef("MemFree:")] == 2077580); - ASSERT(request[LiteralStringRef("MemAvailable:")] == 0); - ASSERT(request[LiteralStringRef("Buffers:")] == 266940); - ASSERT(request[LiteralStringRef("Cached:")] == 16798292); - ASSERT(request[LiteralStringRef("SwapTotal:")] == 25165820); - ASSERT(request[LiteralStringRef("SwapFree:")] == 23680228); + linux_os::getMemoryInfo(request, memInfoStream); + ASSERT(request["MemTotal:"_sr] == 24733228); + ASSERT(request["MemFree:"_sr] == 2077580); + ASSERT(request["MemAvailable:"_sr] == 0); + ASSERT(request["Buffers:"_sr] == 266940); + ASSERT(request["Cached:"_sr] == 16798292); + ASSERT(request["SwapTotal:"_sr] == 25165820); + ASSERT(request["SwapFree:"_sr] == 23680228); for (auto& item : request) { fmt::print("{}:{}\n", item.first.toString().c_str(), item.second); } @@ -3911,14 +4153,14 @@ TEST_CASE("/flow/Platform/getMemoryInfo") { "AnonHugePages: 1275904 kB\n"; std::stringstream memInfoStream1(memString1); - getMemoryInfo(request, memInfoStream1); - ASSERT(request[LiteralStringRef("MemTotal:")] == 31856496); - ASSERT(request[LiteralStringRef("MemFree:")] == 25492716); - ASSERT(request[LiteralStringRef("MemAvailable:")] == 28470756); - ASSERT(request[LiteralStringRef("Buffers:")] == 313644); - ASSERT(request[LiteralStringRef("Cached:")] == 2956444); - ASSERT(request[LiteralStringRef("SwapTotal:")] == 0); - ASSERT(request[LiteralStringRef("SwapFree:")] == 0); + linux_os::getMemoryInfo(request, memInfoStream1); + ASSERT(request["MemTotal:"_sr] == 31856496); + ASSERT(request["MemFree:"_sr] == 25492716); + ASSERT(request["MemAvailable:"_sr] == 28470756); + ASSERT(request["Buffers:"_sr] == 313644); + ASSERT(request["Cached:"_sr] == 2956444); + ASSERT(request["SwapTotal:"_sr] == 0); + ASSERT(request["SwapFree:"_sr] == 0); for (auto& item : request) { fmt::print("{}:{}\n", item.first.toString().c_str(), item.second); } diff --git a/src/flow/Platform.actor.g.cpp b/src/flow/Platform.actor.g.cpp index 7b84c5f..f506f27 100644 --- a/src/flow/Platform.actor.g.cpp +++ b/src/flow/Platform.actor.g.cpp @@ -23,52 +23,65 @@ #ifdef _WIN32 // This has to come as the first include on Win32 for rand_s() to be found #define _CRT_RAND_S -#include -#include // For _set_FMA3_enable workaround in platformInit -#endif +#endif // _WIN32 -#include -#include "fmt/format.h" #include "flow/Platform.h" -#include "flow/Platform.actor.h" -#include "flow/Arena.h" - -#if (!defined(TLS_DISABLED) && !defined(_WIN32)) -#include "flow/StreamCipher.h" -#include "flow/BlobCipher.h" -#endif -#include "flow/Trace.h" -#include "flow/Error.h" - -#include "flow/Knobs.h" +#include #include #include #include #include -#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include "flow/UnitTest.h" -#include "flow/FaultInjection.h" -#include "fdbrpc/IAsyncFile.h" +#include +#include +#include +#include +#include -#include "fdbclient/AnnotateActor.h" +#include "fmt/format.h" + +#include "flow/Arena.h" +#include "flow/Error.h" +#include "flow/FaultInjection.h" +#include "flow/Knobs.h" +#include "flow/Platform.actor.h" +#include "flow/ScopeExit.h" +#include "flow/StreamCipher.h" +#include "flow/Trace.h" +#include "flow/Trace.h" +#include "flow/UnitTest.h" +#include "flow/Util.h" + +// boost uses either std::array or boost::asio::detail::array to store the IPv6 Addresses. +// Enforce the format of IPAddressStore, which is declared in IPAddress.h, is using the same type +// to boost. +static_assert(std::is_same>::value, + "IPAddressStore must be std::array"); #ifdef _WIN32 -#include -#include -#include -#include -#include + #include #include +#include +#include // For _set_FMA3_enable workaround in platformInit #include #include +#include +#include +#include +#include +#include + #pragma comment(lib, "pdh.lib") // for SHGetFolderPath @@ -83,19 +96,18 @@ #define CANONICAL_PATH_SEPARATOR '/' #include -#include -#include -#include #include #include #include +#include +#include +#include +#include /* Needed for disk capacity */ + #if !defined(__aarch64__) && !defined(__powerpc64__) #include #endif -/* Needed for disk capacity */ -#include - /* getifaddrs */ #include #include @@ -116,7 +128,7 @@ #include /* Needed for gnu_dev_{major,minor} */ #include -#endif +#endif // __linux__ #ifdef __FreeBSD__ /* Needed for processor affinity */ @@ -149,29 +161,31 @@ #include #include #include -#endif +#endif // __FreeBSD__ #ifdef __APPLE__ -#include -#include -#include +/* Needed for cross-platform 'environ' */ +#include #include -#include -#include -#include -#include -#include +#include #include +#include #include +#include +#include +#include +#include +#include +#include #include #include #include #include #include -#endif +#endif // __APPLE_ -#endif +#endif // __unixish__ #include "flow/actorcompiler.h" // This must be the last #include. @@ -405,25 +419,24 @@ uint64_t getMemoryUsage() { #endif } -#if defined(__linux__) +#ifdef __linux__ +namespace linux_os { + +namespace { + void getMemoryInfo(std::map& request, std::stringstream& memInfoStream) { size_t count = request.size(); if (count == 0) return; - while (count > 0 && !memInfoStream.eof()) { - std::string key; - - memInfoStream >> key; + keyValueReader(memInfoStream, [&](const std::string& key, const int64_t& value) -> bool { auto item = request.find(StringRef(key)); - if (item != request.end()) { - int64_t value; - memInfoStream >> value; + if (item != std::end(request)) { item->second = value; - count--; + --count; } - memInfoStream.ignore(std::numeric_limits::max(), '\n'); - } + return count != 0; + }); } int64_t getLowWatermark(std::stringstream& zoneInfoStream) { @@ -443,10 +456,8 @@ int64_t getLowWatermark(std::stringstream& zoneInfoStream) { return lowWatermark; } -#endif -void getMachineRAMInfo(MachineRAMInfo& memInfo) { -#if defined(__linux__) +void getMachineRAMInfoImpl(MachineRAMInfo& memInfo) { std::ifstream zoneInfoFileStream("/proc/zoneinfo", std::ifstream::in); int64_t lowWatermark = 0; if (!zoneInfoFileStream.good()) { @@ -464,24 +475,22 @@ void getMachineRAMInfo(MachineRAMInfo& memInfo) { } std::map request = { - { LiteralStringRef("MemTotal:"), 0 }, { LiteralStringRef("MemFree:"), 0 }, - { LiteralStringRef("MemAvailable:"), -1 }, { LiteralStringRef("Active(file):"), 0 }, - { LiteralStringRef("Inactive(file):"), 0 }, { LiteralStringRef("SwapTotal:"), 0 }, - { LiteralStringRef("SwapFree:"), 0 }, { LiteralStringRef("SReclaimable:"), 0 }, + { "MemTotal:"_sr, 0 }, { "MemFree:"_sr, 0 }, { "MemAvailable:"_sr, -1 }, { "Active(file):"_sr, 0 }, + { "Inactive(file):"_sr, 0 }, { "SwapTotal:"_sr, 0 }, { "SwapFree:"_sr, 0 }, { "SReclaimable:"_sr, 0 }, }; std::stringstream memInfoStream; memInfoStream << fileStream.rdbuf(); getMemoryInfo(request, memInfoStream); - int64_t memFree = request[LiteralStringRef("MemFree:")]; - int64_t pageCache = request[LiteralStringRef("Active(file):")] + request[LiteralStringRef("Inactive(file):")]; - int64_t slabReclaimable = request[LiteralStringRef("SReclaimable:")]; - int64_t usedSwap = request[LiteralStringRef("SwapTotal:")] - request[LiteralStringRef("SwapFree:")]; + int64_t memFree = request["MemFree:"_sr]; + int64_t pageCache = request["Active(file):"_sr] + request["Inactive(file):"_sr]; + int64_t slabReclaimable = request["SReclaimable:"_sr]; + int64_t usedSwap = request["SwapTotal:"_sr] - request["SwapFree:"_sr]; - memInfo.total = 1024 * request[LiteralStringRef("MemTotal:")]; - if (request[LiteralStringRef("MemAvailable:")] != -1) { - memInfo.available = 1024 * (request[LiteralStringRef("MemAvailable:")] - usedSwap); + memInfo.total = 1024 * request["MemTotal:"_sr]; + if (request["MemAvailable:"_sr] != -1) { + memInfo.available = 1024 * (request["MemAvailable:"_sr] - usedSwap); } else { memInfo.available = 1024 * (std::max(0, @@ -491,6 +500,35 @@ void getMachineRAMInfo(MachineRAMInfo& memInfo) { } memInfo.committed = memInfo.total - memInfo.available; +} + +} // anonymous namespace + +std::map reportCGroupCpuStat() { + // Default path to the cpu,cpuacct + // See manpages for cgroup + static const std::string PATH_TO_CPU_CPUACCT = "/sys/fs/cgroup/cpu,cpuacct/cpu.stat"; + + std::map result; + std::ifstream ifs(PATH_TO_CPU_CPUACCT); + if (!ifs.is_open()) { + return result; + } + + keyValueReader(ifs, [&](const std::string& key, const int64_t& value) -> bool { + result[key] = value; + return true; + }); + + return result; +} + +} // namespace linux_os +#endif // #ifdef __linux__ + +void getMachineRAMInfo(MachineRAMInfo& memInfo) { +#if defined(__linux__) + linux_os::getMachineRAMInfoImpl(memInfo); #elif defined(__FreeBSD__) int status; @@ -615,7 +653,11 @@ void getDiskBytes(std::string const& directory, int64_t& free, int64_t& total) { #endif free = std::min((uint64_t)std::numeric_limits::max(), buf.f_bavail * blockSize); - total = std::min((uint64_t)std::numeric_limits::max(), buf.f_blocks * blockSize); + + // f_blocks is the total fs space but (f_bfree - f_bavail) is space only available to privileged users + // so that amount will be subtracted from the reported total since FDB can't use it. + total = std::min((uint64_t)std::numeric_limits::max(), + (buf.f_blocks - (buf.f_bfree - buf.f_bavail)) * blockSize); #elif defined(_WIN32) std::string fullPath = abspath(directory); @@ -1938,6 +1980,39 @@ std::string epochsToGMTString(double epochs) { return timeString; } +std::vector getEnvironmentKnobOptions() { + constexpr const size_t ENVKNOB_PREFIX_LEN = sizeof(ENVIRONMENT_KNOB_OPTION_PREFIX) - 1; + std::vector knobOptions; +#if defined(_WIN32) + auto e = GetEnvironmentStrings(); + if (e == nullptr) + return {}; + auto cleanup = ScopeExit([e]() { FreeEnvironmentStrings(e); }); + while (*e) { + auto candidate = std::string_view(e); + if (boost::starts_with(candidate, ENVIRONMENT_KNOB_OPTION_PREFIX)) + knobOptions.emplace_back(candidate.substr(ENVKNOB_PREFIX_LEN)); + e += (candidate.size() + 1); + } +#else + char** e = nullptr; +#ifdef __linux__ + e = environ; +#elif defined(__APPLE__) + e = *_NSGetEnviron(); +#else +#error Port me! +#endif + for (; e && *e; e++) { + std::string_view envOption(*e); + if (boost::starts_with(envOption, ENVIRONMENT_KNOB_OPTION_PREFIX)) { + knobOptions.emplace_back(envOption.substr(ENVKNOB_PREFIX_LEN)); + } + } +#endif + return knobOptions; +} + void setMemoryQuota(size_t limit) { if (limit == 0) { return; @@ -2034,7 +2109,53 @@ static void enableLargePages() { #endif } -static void* allocateInternal(size_t length, bool largePages) { +#ifndef _WIN32 +static void* mmapSafe(void* addr, size_t len, int prot, int flags, int fd, off_t offset) { + void* result = mmap(addr, len, prot, flags, fd, offset); + if (result == MAP_FAILED) { + int err = errno; + fprintf(stderr, + "Error calling mmap(%p, %zu, %d, %d, %d, %jd): %s\n", + addr, + len, + prot, + flags, + fd, + (intmax_t)offset, + strerror(err)); + fflush(stderr); + std::abort(); + } + return result; +} + +static void mprotectSafe(void* p, size_t s, int prot) { + if (mprotect(p, s, prot) != 0) { + int err = errno; + fprintf(stderr, "Error calling mprotect(%p, %zu, %d): %s\n", p, s, prot, strerror(err)); + fflush(stderr); + std::abort(); + } +} + +static void* mmapInternal(size_t length, int flags, bool guardPages) { + if (guardPages && FLOW_KNOBS->FAST_ALLOC_ALLOW_GUARD_PAGES) { + static size_t pageSize = sysconf(_SC_PAGESIZE); + length = RightAlign(length, pageSize); + length += 2 * pageSize; // Map enough for the guard pages + void* resultWithGuardPages = mmapSafe(nullptr, length, PROT_READ | PROT_WRITE, flags, -1, 0); + // left guard page + mprotectSafe(resultWithGuardPages, pageSize, PROT_NONE); + // right guard page + mprotectSafe((void*)(uintptr_t(resultWithGuardPages) + length - pageSize), pageSize, PROT_NONE); + return (void*)(uintptr_t(resultWithGuardPages) + pageSize); + } else { + return mmapSafe(nullptr, length, PROT_READ | PROT_WRITE, flags, -1, 0); + } +} +#endif + +static void* allocateInternal(size_t length, bool largePages, bool guardPages) { #ifdef _WIN32 DWORD allocType = MEM_COMMIT | MEM_RESERVE; @@ -2049,31 +2170,31 @@ static void* allocateInternal(size_t length, bool largePages) { if (largePages) flags |= MAP_HUGETLB; - return mmap(nullptr, length, PROT_READ | PROT_WRITE, flags, -1, 0); + return mmapInternal(length, flags, guardPages); #elif defined(__APPLE__) || defined(__FreeBSD__) int flags = MAP_PRIVATE | MAP_ANON; - return mmap(nullptr, length, PROT_READ | PROT_WRITE, flags, -1, 0); + return mmapInternal(length, flags, guardPages); #else #error Port me! #endif } static bool largeBlockFail = false; -void* allocate(size_t length, bool allowLargePages) { +void* allocate(size_t length, bool allowLargePages, bool includeGuardPages) { if (allowLargePages) enableLargePages(); void* block = ALLOC_FAIL; if (allowLargePages && !largeBlockFail) { - block = allocateInternal(length, true); + block = allocateInternal(length, true, includeGuardPages); if (block == ALLOC_FAIL) largeBlockFail = true; } if (block == ALLOC_FAIL) - block = allocateInternal(length, false); + block = allocateInternal(length, false, includeGuardPages); // FIXME: SevWarnAlways trace if "close" to out of memory @@ -2138,35 +2259,21 @@ namespace platform { int getRandomSeed() { INJECT_FAULT(platform_error, "getRandomSeed"); // getting a random seed failed int randomSeed; - int retryCount = 0; #ifdef _WIN32 - do { - retryCount++; - if (rand_s((unsigned int*)&randomSeed) != 0) { - TraceEvent(SevError, "WindowsRandomSeedError").log(); - throw platform_error(); - } - } while (randomSeed == 0 && - retryCount < - FLOW_KNOBS->RANDOMSEED_RETRY_LIMIT); // randomSeed cannot be 0 since we use mersenne twister in - // DeterministicRandom. Get a new one if randomSeed is 0. + if (rand_s((unsigned int*)&randomSeed) != 0) { + TraceEvent(SevError, "WindowsRandomSeedError").log(); + throw platform_error(); + } #else int devRandom = open("/dev/urandom", O_RDONLY | O_CLOEXEC); - do { - retryCount++; - if (read(devRandom, &randomSeed, sizeof(randomSeed)) != sizeof(randomSeed)) { - TraceEvent(SevError, "OpenURandom").GetLastError(); - throw platform_error(); - } - } while (randomSeed == 0 && retryCount < FLOW_KNOBS->RANDOMSEED_RETRY_LIMIT); + if (read(devRandom, &randomSeed, sizeof(randomSeed)) != sizeof(randomSeed)) { + TraceEvent(SevError, "OpenURandom").GetLastError(); + throw platform_error(); + } close(devRandom); #endif - if (randomSeed == 0) { - TraceEvent(SevError, "RandomSeedZeroError").log(); - throw platform_error(); - } return randomSeed; } } // namespace platform @@ -2188,7 +2295,9 @@ void renamedFile() { void renameFile(std::string const& fromPath, std::string const& toPath) { INJECT_FAULT(io_error, "renameFile"); // rename file failed #ifdef _WIN32 - if (MoveFile(fromPath.c_str(), toPath.c_str())) { + if (MoveFileExA(fromPath.c_str(), + toPath.c_str(), + MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH)) { // renamedFile(); return; } @@ -2281,8 +2390,11 @@ void atomicReplace(std::string const& path, std::string const& content, bool tex } f = 0; - if (!ReplaceFile(path.c_str(), tempfilename.c_str(), nullptr, NULL, nullptr, nullptr)) + if (!MoveFileExA(tempfilename.c_str(), + path.c_str(), + MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH)) { throw io_error(); + } #elif defined(__unixish__) if (!g_network->isSimulated()) { if (fsync(fileno(f)) != 0) @@ -2405,7 +2517,7 @@ bool createDirectory(std::string const& directory) { const uint8_t separatorChar = CANONICAL_PATH_SEPARATOR; StringRef separator(&separatorChar, 1); -StringRef dotdot = LiteralStringRef(".."); +StringRef dotdot = ".."_sr; std::string cleanPath(std::string const& path) { std::vector finalParts; @@ -2473,14 +2585,14 @@ std::string popPath(const std::string& path) { return path.substr(0, i + 1); } -std::string abspath(std::string const& path, bool resolveLinks, bool mustExist) { - if (path.empty()) { +std::string abspath(std::string const& path_, bool resolveLinks, bool mustExist) { + if (path_.empty()) { Error e = platform_error(); Severity sev = e.code() == error_code_io_error ? SevError : SevWarnAlways; - TraceEvent(sev, "AbsolutePathError").error(e).detail("Path", path); + TraceEvent(sev, "AbsolutePathError").error(e).detail("Path", path_); throw e; } - + std::string path = path_.back() == '\\' ? path_.substr(0, path_.size() - 1) : path_; // Returns an absolute path canonicalized to use only CANONICAL_PATH_SEPARATOR INJECT_FAULT(platform_error, "abspath"); // abspath failed @@ -2587,27 +2699,27 @@ bool acceptDirectory(FILE_ATTRIBUTE_DATA fileAttributes, std::string const& name return (fileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; } - #line 2590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" namespace { // This generated class is to be used only via findFiles() - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" template - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" class FindFilesActorState { - #line 2597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" public: - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" FindFilesActorState(std::string const& directory,std::string const& extension,bool const& directoryOnly,bool const& async) - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" : directory(directory), - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" extension(extension), - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" directoryOnly(directoryOnly), - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" async(async) - #line 2610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { fdb_probe_actor_create("findFiles", reinterpret_cast(this)); @@ -2620,37 +2732,37 @@ class FindFilesActorState { int a_body1(int loopDepth=0) { try { - #line 2592 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" INJECT_FAULT(platform_error, "findFiles"); - #line 2593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" result = std::vector(); - #line 2594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" tsc_begin = timestampCounter(); - #line 2596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" fd = WIN32_FIND_DATA(); - #line 2597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" h = FindFirstFile((directory + "/*" + extension).c_str(), &fd); - #line 2598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (h == INVALID_HANDLE_VALUE) - #line 2635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2747 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { - #line 2599 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (GetLastError() != ERROR_FILE_NOT_FOUND && GetLastError() != ERROR_PATH_NOT_FOUND) - #line 2639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { - #line 2600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" TraceEvent(SevError, "FindFirstFile") .detail("Directory", directory) .detail("Extension", extension) .GetLastError(); - #line 2604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" return a_body1Catch1(platform_error(), loopDepth); - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" } loopDepth = a_body1cont1(loopDepth); } else { - #line 2607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2719 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" ; - #line 2653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } } @@ -2672,11 +2784,11 @@ class FindFilesActorState { } int a_body1cont1(int loopDepth) { - #line 2630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::sort(result.begin(), result.end()); - #line 2631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(result); this->~FindFilesActorState(); static_cast(this)->destroy(); return 0; } - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::move(result)); // state_var_RVO this->~FindFilesActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2686,21 +2798,21 @@ class FindFilesActorState { } int a_body1cont4(int loopDepth) { - #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (GetLastError() != ERROR_NO_MORE_FILES) - #line 2691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2803 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { - #line 2621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" TraceEvent(SevError, "FindNextFile") .detail("Directory", directory) .detail("Extension", extension) .GetLastError(); - #line 2625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" FindClose(h); - #line 2626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" return a_body1Catch1(platform_error(), loopDepth); - #line 2699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" } - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" FindClose(h); - #line 2703 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2815 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -2714,36 +2826,36 @@ class FindFilesActorState { } int a_body1loopBody1(int loopDepth) { - #line 2608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::string name = fd.cFileName; - #line 2609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if ((directoryOnly && acceptDirectory(fd.dwFileAttributes, name, extension)) || (!directoryOnly && acceptFile(fd.dwFileAttributes, name, extension))) - #line 2721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { - #line 2611 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2723 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" result.push_back(name); - #line 2725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" } - #line 2613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2725 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (!FindNextFile(h, &fd)) - #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 2615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2727 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (async && timestampCounter() - tsc_begin > FLOW_KNOBS->TSC_YIELD_TIME && !g_network->isSimulated()) - #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { - #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" StrictFuture __when_expr_0 = yield(); - #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2728 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = 0; } else @@ -2774,18 +2886,18 @@ class FindFilesActorState { } int a_body1loopBody1cont4(Void const& _,int loopDepth) { - #line 2617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" tsc_begin = timestampCounter(); - #line 2779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1cont4(Void && _,int loopDepth) { - #line 2617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" tsc_begin = timestampCounter(); - #line 2788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2900 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -2853,28 +2965,28 @@ class FindFilesActorState { fdb_probe_actor_exit("findFiles", reinterpret_cast(this), 0); } - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::string directory; - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::string extension; - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" bool directoryOnly; - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" bool async; - #line 2593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::vector result; - #line 2594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" int64_t tsc_begin; - #line 2596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" WIN32_FIND_DATA fd; - #line 2597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2709 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" HANDLE h; - #line 2872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" }; // This generated class is to be used only via findFiles() - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" class FindFilesActor final : public Actor>, public ActorCallback< FindFilesActor, 0, Void >, public FastAllocated, public FindFilesActorState { - #line 2877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 2989 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2883,9 +2995,9 @@ class FindFilesActor final : public Actor>, public Acto void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< FindFilesActor, 0, Void >; - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" FindFilesActor(std::string const& directory,std::string const& extension,bool const& directoryOnly,bool const& async) - #line 2888 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3000 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" : Actor>(), FindFilesActorState(directory, extension, directoryOnly, async) { @@ -2909,14 +3021,14 @@ friend struct ActorCallback< FindFilesActor, 0, Void >; } }; } - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" [[nodiscard]] Future> findFiles( std::string const& directory, std::string const& extension, bool const& directoryOnly, bool const& async ) { - #line 2588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" return Future>(new FindFilesActor(directory, extension, directoryOnly, async)); - #line 2916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3028 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" } -#line 2633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" +#line 2745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" #elif (defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)) #define FILE_ATTRIBUTE_DATA mode_t @@ -2929,27 +3041,27 @@ bool acceptDirectory(FILE_ATTRIBUTE_DATA fileAttributes, std::string const& name return S_ISDIR(fileAttributes); } - #line 2932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" namespace { // This generated class is to be used only via findFiles() - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" template - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" class FindFilesActor1State { - #line 2939 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" public: - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" FindFilesActor1State(std::string const& directory,std::string const& extension,bool const& directoryOnly,bool const& async) - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" : directory(directory), - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" extension(extension), - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" directoryOnly(directoryOnly), - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" async(async) - #line 2952 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { fdb_probe_actor_create("findFiles", reinterpret_cast(this)); @@ -2962,21 +3074,21 @@ class FindFilesActor1State { int a_body1(int loopDepth=0) { try { - #line 2649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" INJECT_FAULT(platform_error, "findFiles"); - #line 2650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" result = std::vector(); - #line 2651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" tsc_begin = timestampCounter(); - #line 2653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" dip = nullptr; - #line 2655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if ((dip = opendir(directory.c_str())) != nullptr) - #line 2975 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { - #line 2656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" ; - #line 2979 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } else @@ -3002,11 +3114,11 @@ class FindFilesActor1State { } int a_body1cont1(int loopDepth) { - #line 2689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::sort(result.begin(), result.end()); - #line 2690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (!static_cast(this)->SAV>::futures) { (void)(result); this->~FindFilesActor1State(); static_cast(this)->destroy(); return 0; } - #line 3009 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" new (&static_cast(this)->SAV< std::vector >::value()) std::vector(std::move(result)); // state_var_RVO this->~FindFilesActor1State(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3016,9 +3128,9 @@ class FindFilesActor1State { } int a_body1cont2(int loopDepth) { - #line 2687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" closedir(dip); - #line 3021 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -3032,63 +3144,63 @@ class FindFilesActor1State { } int a_body1loopBody1(int loopDepth) { - #line 2657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2769 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" struct dirent* dit; - #line 2658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" dit = readdir(dip); - #line 2659 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (dit == nullptr) - #line 3041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 2662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::string name(dit->d_name); - #line 2663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" struct stat buf; - #line 2664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2776 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (stat(joinPath(directory, name).c_str(), &buf)) - #line 3051 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { - #line 2665 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" bool isError = errno != ENOENT; - #line 2666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2778 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" TraceEvent(isError ? SevError : SevWarn, "StatFailed") .detail("Directory", directory) .detail("Extension", extension) .detail("Name", name) .GetLastError(); - #line 2671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (isError) - #line 3059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" return a_body1Catch1(platform_error(), std::max(0, loopDepth - 1)); - #line 3063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3175 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" } else { return a_body1loopHead1(loopDepth); // continue } } - #line 2677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if ((directoryOnly && acceptDirectory(buf.st_mode, name, extension)) || (!directoryOnly && acceptFile(buf.st_mode, name, extension))) - #line 3072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { - #line 2679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" result.push_back(name); - #line 3076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" } - #line 2681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (async && timestampCounter() - tsc_begin > FLOW_KNOBS->TSC_YIELD_TIME && !g_network->isSimulated()) - #line 3080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { - #line 2682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" StrictFuture __when_expr_0 = yield(); - #line 2682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3203 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = 0; } else @@ -3119,18 +3231,18 @@ class FindFilesActor1State { } int a_body1loopBody1cont7(Void const& _,int loopDepth) { - #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" tsc_begin = timestampCounter(); - #line 3124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; } int a_body1loopBody1cont7(Void && _,int loopDepth) { - #line 2683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" tsc_begin = timestampCounter(); - #line 3133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = a_body1loopBody1cont1(loopDepth); return loopDepth; @@ -3198,26 +3310,26 @@ class FindFilesActor1State { fdb_probe_actor_exit("findFiles", reinterpret_cast(this), 0); } - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::string directory; - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::string extension; - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" bool directoryOnly; - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" bool async; - #line 2650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2762 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::vector result; - #line 2651 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" int64_t tsc_begin; - #line 2653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" DIR* dip; - #line 3215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" }; // This generated class is to be used only via findFiles() - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" class FindFilesActor1 final : public Actor>, public ActorCallback< FindFilesActor1, 0, Void >, public FastAllocated, public FindFilesActor1State { - #line 3220 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3226,9 +3338,9 @@ class FindFilesActor1 final : public Actor>, public Act void destroy() override { ((Actor>*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< FindFilesActor1, 0, Void >; - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" FindFilesActor1(std::string const& directory,std::string const& extension,bool const& directoryOnly,bool const& async) - #line 3231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" : Actor>(), FindFilesActor1State(directory, extension, directoryOnly, async) { @@ -3252,14 +3364,14 @@ friend struct ActorCallback< FindFilesActor1, 0, Void >; } }; } - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" [[nodiscard]] Future> findFiles( std::string const& directory, std::string const& extension, bool const& directoryOnly, bool const& async ) { - #line 2645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" return Future>(new FindFilesActor1(directory, extension, directoryOnly, async)); - #line 3259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" } -#line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" +#line 2804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" #else #error Port me! @@ -3297,22 +3409,22 @@ void findFilesRecursively(std::string const& path, std::vector& out } } - #line 3300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" // This generated class is to be used only via findFilesRecursivelyAsync() - #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" template - #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" class FindFilesRecursivelyAsyncActorState { - #line 3306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3418 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" public: - #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" FindFilesRecursivelyAsyncActorState(std::string const& path,std::vector* const& out) - #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" : path(path), - #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" out(out) - #line 3315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { fdb_probe_actor_create("findFilesRecursivelyAsync", reinterpret_cast(this)); @@ -3325,16 +3437,16 @@ class FindFilesRecursivelyAsyncActorState { int a_body1(int loopDepth=0) { try { - #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" StrictFuture> __when_expr_0 = listFilesAsync(path, ""); - #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3444 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -3355,31 +3467,31 @@ class FindFilesRecursivelyAsyncActorState { } int a_body1cont1(int loopDepth) { - #line 2732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" for( auto const& f : files ) { - #line 2733 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2845 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" out->push_back(joinPath(path, f)); - #line 3362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3474 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" } - #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" StrictFuture> __when_expr_1 = listDirectoriesAsync(path); - #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 3368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3480 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 3373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3485 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(std::vector const& __files,int loopDepth) { - #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" files = __files; - #line 3382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3494 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -3444,18 +3556,18 @@ class FindFilesRecursivelyAsyncActorState { } int a_body1cont2(int loopDepth) { - #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" RangeForbody1cont2Iterator0 = std::begin(directories); - #line 3449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = a_body1cont2loopHead1(loopDepth); return loopDepth; } int a_body1cont1when1(std::vector const& __directories,int loopDepth) { - #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" directories = __directories; - #line 3458 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -3520,9 +3632,9 @@ class FindFilesRecursivelyAsyncActorState { } int a_body1cont4(int loopDepth) { - #line 2741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FindFilesRecursivelyAsyncActorState(); static_cast(this)->destroy(); return 0; } - #line 3525 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~FindFilesRecursivelyAsyncActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -3539,30 +3651,30 @@ class FindFilesRecursivelyAsyncActorState { } int a_body1cont2loopBody1(int loopDepth) { - #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (!(RangeForbody1cont2Iterator0 != std::end(directories))) - #line 3544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { return a_body1cont2break1(loopDepth==0?0:loopDepth-1); // break } - #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" auto const& dir = *RangeForbody1cont2Iterator0; - #line 3550 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { - #line 2738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (dir != "." && dir != "..") - #line 3554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { - #line 2739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" StrictFuture __when_expr_2 = findFilesRecursivelyAsync(joinPath(path, dir), out); - #line 2739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 3560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), std::max(0, loopDepth - 1)); else return a_body1cont2loopBody1when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 2739 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 3565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" loopDepth = 0; } else @@ -3588,9 +3700,9 @@ class FindFilesRecursivelyAsyncActorState { } int a_body1cont2loopBody1cont1(int loopDepth) { - #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" ++RangeForbody1cont2Iterator0; - #line 3593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" if (loopDepth == 0) return a_body1cont2loopHead1(0); return loopDepth; @@ -3676,22 +3788,22 @@ class FindFilesRecursivelyAsyncActorState { fdb_probe_actor_exit("findFilesRecursivelyAsync", reinterpret_cast(this), 2); } - #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::string path; - #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::vector* out; - #line 2731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::vector files; - #line 2736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::vector directories; - #line 2737 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" decltype(std::begin(std::declval>())) RangeForbody1cont2Iterator0; - #line 3689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" }; // This generated class is to be used only via findFilesRecursivelyAsync() - #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" class FindFilesRecursivelyAsyncActor final : public Actor, public ActorCallback< FindFilesRecursivelyAsyncActor, 0, std::vector >, public ActorCallback< FindFilesRecursivelyAsyncActor, 1, std::vector >, public ActorCallback< FindFilesRecursivelyAsyncActor, 2, Void >, public FastAllocated, public FindFilesRecursivelyAsyncActorState { - #line 3694 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -3702,9 +3814,9 @@ class FindFilesRecursivelyAsyncActor final : public Actor, public ActorCal friend struct ActorCallback< FindFilesRecursivelyAsyncActor, 0, std::vector >; friend struct ActorCallback< FindFilesRecursivelyAsyncActor, 1, std::vector >; friend struct ActorCallback< FindFilesRecursivelyAsyncActor, 2, Void >; - #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" FindFilesRecursivelyAsyncActor(std::string const& path,std::vector* const& out) - #line 3707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" : Actor(), FindFilesRecursivelyAsyncActorState(path, out) { @@ -3729,14 +3841,14 @@ friend struct ActorCallback< FindFilesRecursivelyAsyncActor, 2, Void >; } }; - #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" [[nodiscard]] Future findFilesRecursivelyAsync( std::string const& path, std::vector* const& out ) { - #line 2729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 2841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" return Future(new FindFilesRecursivelyAsyncActor(path, out)); - #line 3736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 3848 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" } -#line 2743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" +#line 2855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" } // namespace platform @@ -3895,54 +4007,54 @@ int64_t fileSize(std::string const& filename) { #endif } -std::string readFileBytes(std::string const& filename, int maxSize) { - std::string s; - FILE* f = fopen(filename.c_str(), "rb" FOPEN_CLOEXEC_MODE); - if (!f) { - TraceEvent(SevWarn, "FileOpenError") +size_t readFileBytes(std::string const& filename, uint8_t* buff, size_t len) { + std::fstream ifs(filename, std::fstream::in | std::fstream::binary); + if (!ifs.good()) { + TraceEvent("ileBytes_FileOpenError").detail("Filename", filename).GetLastError(); + throw io_error(); + } + + size_t bytesRead = len; + ifs.seekg(0, std::fstream::beg); + ifs.read((char*)buff, len); + if (!ifs) { + bytesRead = ifs.gcount(); + TraceEvent("ReadFileBytes_ShortRead") .detail("Filename", filename) - .detail("Errno", errno) - .detail("ErrorDescription", strerror(errno)); - throw file_not_readable(); + .detail("Requested", len) + .detail("Actual", bytesRead); } - try { - fseek(f, 0, SEEK_END); - size_t size = ftell(f); - if (size > maxSize) - throw file_too_large(); - s.resize(size); - fseek(f, 0, SEEK_SET); - if (!fread(&s[0], size, 1, f)) - throw file_not_readable(); - } catch (...) { - fclose(f); - throw; + + return bytesRead; +} + +std::string readFileBytes(std::string const& filename, int maxSize) { + if (!fileExists(filename)) { + TraceEvent("ReadFileBytes_FileNotFound").detail("Filename", filename); + throw file_not_found(); } - fclose(f); - return s; + + size_t size = fileSize(filename); + if (size > maxSize) { + TraceEvent("ReadFileBytes_FileTooLarge").detail("Filename", filename); + throw file_too_large(); + } + + std::string ret; + ret.resize(size); + readFileBytes(filename, (uint8_t*)ret.data(), size); + + return ret; } void writeFileBytes(std::string const& filename, const uint8_t* data, size_t count) { - FILE* f = fopen(filename.c_str(), "wb" FOPEN_CLOEXEC_MODE); - if (!f) { - TraceEvent(SevError, "WriteFileBytes").detail("Filename", filename).GetLastError(); - throw file_not_writable(); + std::ofstream ofs(filename, std::fstream::out | std::fstream::binary); + if (!ofs.good()) { + TraceEvent("WriteFileBytes_FileOpenError").detail("Filename", filename).GetLastError(); + throw io_error(); } - try { - size_t length = fwrite(data, sizeof(uint8_t), count, f); - if (length != count) { - TraceEvent(SevError, "WriteFileBytes") - .detail("Filename", filename) - .detail("WrittenLength", length) - .GetLastError(); - throw file_not_writable(); - } - } catch (...) { - fclose(f); - throw; - } - fclose(f); + ofs.write((const char*)data, count); } void writeFile(std::string const& filename, std::string const& content) { @@ -4064,19 +4176,19 @@ void outOfMemory() { char* demangled = abi::__cxa_demangle(i->first, nullptr, nullptr, nullptr); if (demangled) { s = demangled; - if (StringRef(s).startsWith(LiteralStringRef("(anonymous namespace)::"))) - s = s.substr(LiteralStringRef("(anonymous namespace)::").size()); + if (StringRef(s).startsWith("(anonymous namespace)::"_sr)) + s = s.substr("(anonymous namespace)::"_sr.size()); free(demangled); } else s = i->first; #else s = i->first; - if (StringRef(s).startsWith(LiteralStringRef("class `anonymous namespace'::"))) - s = s.substr(LiteralStringRef("class `anonymous namespace'::").size()); - else if (StringRef(s).startsWith(LiteralStringRef("class "))) - s = s.substr(LiteralStringRef("class ").size()); - else if (StringRef(s).startsWith(LiteralStringRef("struct "))) - s = s.substr(LiteralStringRef("struct ").size()); + if (StringRef(s).startsWith("class `anonymous namespace'::"_sr)) + s = s.substr("class `anonymous namespace'::"_sr.size()); + else if (StringRef(s).startsWith("class "_sr)) + s = s.substr("class "_sr.size()); + else if (StringRef(s).startsWith("struct "_sr)) + s = s.substr("struct "_sr.size()); #endif typeNames.emplace_back(s, i->first); } @@ -4156,10 +4268,10 @@ void outOfMemory() { } // Because the lambda used with nftw below cannot capture -int __eraseDirectoryRecurseiveCount; +int __eraseDirectoryRecursiveCount; int eraseDirectoryRecursive(std::string const& dir) { - __eraseDirectoryRecurseiveCount = 0; + __eraseDirectoryRecursiveCount = 0; #ifdef _WIN32 system(("rd /s /q \"" + dir + "\"").c_str()); #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) @@ -4168,7 +4280,7 @@ int eraseDirectoryRecursive(std::string const& dir) { [](const char* fpath, const struct stat* sb, int typeflag, struct FTW* ftwbuf) -> int { int r = remove(fpath); if (r == 0) - ++__eraseDirectoryRecurseiveCount; + ++__eraseDirectoryRecursiveCount; return r; }, 64, @@ -4185,25 +4297,62 @@ int eraseDirectoryRecursive(std::string const& dir) { #error Port me! #endif // INJECT_FAULT( platform_error, "eraseDirectoryRecursive" ); - return __eraseDirectoryRecurseiveCount; + return __eraseDirectoryRecursiveCount; } -bool isHwCrcSupported() { -#if defined(_WIN32) - int info[4]; - __cpuid(info, 1); - return (info[2] & (1 << 20)) != 0; -#elif defined(__aarch64__) - return true; /* force to use crc instructions */ -#elif defined(__powerpc64__) - return false; /* force not to use crc instructions */ -#elif defined(__unixish__) - uint32_t eax, ebx, ecx, edx, level = 1, count = 0; - __cpuid_count(level, count, eax, ebx, ecx, edx); - return ((ecx >> 20) & 1) != 0; -#else -#error Port me! -#endif +TmpFile::TmpFile() : filename("") { + createTmpFile(boost::filesystem::temp_directory_path().string(), TmpFile::defaultPrefix); +} + +TmpFile::TmpFile(const std::string& tmpDir) : filename("") { + std::string dir = removeWhitespace(tmpDir); + createTmpFile(dir, TmpFile::defaultPrefix); +} + +TmpFile::TmpFile(const std::string& tmpDir, const std::string& prefix) : filename("") { + std::string dir = removeWhitespace(tmpDir); + createTmpFile(dir, prefix); +} + +TmpFile::~TmpFile() { + if (!filename.empty()) { + destroyFile(); + } +} + +void TmpFile::createTmpFile(const std::string_view dir, const std::string_view prefix) { + std::string modelPattern = "%%%%-%%%%-%%%%-%%%%"; + boost::format fmter("%s/%s-%s"); + std::string modelPath = boost::str(boost::format(fmter % dir % prefix % modelPattern)); + boost::filesystem::path filePath = boost::filesystem::unique_path(modelPath); + + filename = filePath.string(); + + // Create empty tmp file + std::fstream tmpFile(filename, std::fstream::out); + if (!tmpFile.good()) { + TraceEvent("TmpFile_CreateFileError").detail("Filename", filename); + throw io_error(); + } + TraceEvent("TmpFile_CreateSuccess").detail("Filename", filename); +} + +size_t TmpFile::read(uint8_t* buff, size_t len) { + return readFileBytes(filename, buff, len); +} + +void TmpFile::write(const uint8_t* buff, size_t len) { + writeFileBytes(filename, buff, len); +} + +bool TmpFile::destroyFile() { + bool deleted = deleteFile(filename); + if (deleted) { + TraceEvent("TmpFileDestory_Success").detail("Filename", filename); + } else { + TraceEvent("TmpFileDestory_Failed").detail("Filename", filename); + } + return deleted; } } // namespace platform @@ -4376,7 +4525,12 @@ void* loadLibrary(const char* lib_path) { void* dlobj = nullptr; #if defined(__unixish__) - dlobj = dlopen(lib_path, RTLD_LAZY | RTLD_LOCAL); + dlobj = dlopen(lib_path, + RTLD_LAZY | RTLD_LOCAL +#ifdef USE_SANITIZER // Keep alive dlopen()-ed libs for symbolized XSAN backtrace + | RTLD_NODELETE +#endif + ); if (dlobj == nullptr) { TraceEvent(SevWarn, "LoadLibraryFailed").detail("Library", lib_path).detail("Error", dlerror()); } @@ -4488,6 +4642,12 @@ void platformInit() { #endif } +std::vector> g_crashHandlerCallbacks; + +void registerCrashHandlerCallback(void (*f)()) { + g_crashHandlerCallbacks.push_back(f); +} + // The crashHandler function is registered to handle signals before the process terminates. // Basic information about the crash is printed/traced, and stdout and trace events are flushed. void crashHandler(int sig) { @@ -4496,13 +4656,19 @@ void crashHandler(int sig) { // but the idea is that we're about to crash anyway... std::string backtrace = platform::get_backtrace(); - bool error = (sig != SIGUSR2); + bool error = (sig != SIGUSR2 && sig != SIGTERM); -#if (!defined(TLS_DISABLED) && !defined(_WIN32)) StreamCipherKey::cleanup(); StreamCipher::cleanup(); - BlobCipherKeyCache::cleanup(); -#endif + + for (auto& f : g_crashHandlerCallbacks) { + f(); + } + + fprintf(error ? stderr : stdout, "SIGNAL: %s (%d)\n", strsignal(sig), sig); + if (error) { + fprintf(stderr, "Trace: %s\n", backtrace.c_str()); + } fflush(stdout); { @@ -4514,8 +4680,9 @@ void crashHandler(int sig) { } flushTraceFileVoid(); - fprintf(stderr, "SIGNAL: %s (%d)\n", strsignal(sig), sig); - fprintf(stderr, "Trace: %s\n", backtrace.c_str()); +#ifdef USE_GCOV + __gcov_flush(); +#endif struct sigaction sa; sa.sa_handler = SIG_DFL; @@ -4555,6 +4722,15 @@ void registerCrashHandler() { sigaction(SIGSEGV, &action, nullptr); sigaction(SIGBUS, &action, nullptr); sigaction(SIGUSR2, &action, nullptr); +#ifdef USE_GCOV + // SIGTERM is the "graceful" way to end an fdbserver process, so we actually + // don't want to invoke crashHandler. crashHandler is not actually + // async-signal-safe, so we can only justify calling it if we were going to + // crash anyway. For USE_GCOV though we need to flush coverage info, which + // we do through crashHandler. + sigaction(SIGTERM, &action, nullptr); +#endif + sigaction(SIGABRT, &action, nullptr); #else // No crash handler for other platforms! #endif @@ -4570,38 +4746,71 @@ extern std::atomic net2RunLoopIterations; extern std::atomic net2RunLoopSleeps; extern void initProfiling(); +namespace { + std::atomic checkThreadTime; +std::mutex loopProfilerThreadMutex; +std::optional loopProfilerThread; +std::atomic loopProfilerStopRequested = false; + +} // namespace +#endif + +// True if this thread is the thread being profiled. Not to be used from the signal handler. +thread_local bool profileThread = false; + +// The thread ID of the profiled thread. This can be compared against the current thread ID +// to see if we are on the profiled thread. Can be used in the signal handler. +volatile int64_t profileThreadId = -1; + +#ifdef __linux__ +struct sigaction chainedAction; #endif -volatile thread_local bool profileThread = false; -volatile thread_local int profilingEnabled = 1; +volatile bool profilingEnabled = 1; +volatile thread_local bool flowProfilingEnabled = 1; -volatile thread_local int64_t numProfilesDeferred = 0; -volatile thread_local int64_t numProfilesOverflowed = 0; -volatile thread_local int64_t numProfilesCaptured = 0; -volatile thread_local bool profileRequested = false; +volatile int64_t numProfilesDisabled = 0; +volatile int64_t numProfilesOverflowed = 0; +volatile int64_t numProfilesCaptured = 0; -int64_t getNumProfilesDeferred() { - return numProfilesDeferred; +int64_t getNumProfilesDisabled() { + if (profileThread) { + return numProfilesDisabled; + } else { + return 0; + } } int64_t getNumProfilesOverflowed() { - return numProfilesOverflowed; + if (profileThread) { + return numProfilesOverflowed; + } else { + return 0; + } } int64_t getNumProfilesCaptured() { - return numProfilesCaptured; + if (profileThread) { + return numProfilesCaptured; + } else { + return 0; + } } void profileHandler(int sig) { #ifdef __linux__ - if (!profileThread) { - return; + if (chainedAction.sa_handler != SIG_DFL && chainedAction.sa_handler != SIG_IGN && + chainedAction.sa_handler != nullptr) { + chainedAction.sa_handler(sig); } - if (!profilingEnabled) { - profileRequested = true; - ++numProfilesDeferred; + // This is not documented in the POSIX list of signal-safe functions, but numbered syscalls are reported to be + // async safe in Linux. + if (profileThreadId != syscall(__NR_gettid)) { + return; + } else if (!profilingEnabled) { + ++numProfilesDisabled; return; } @@ -4624,26 +4833,29 @@ void profileHandler(int sig) { // We can't get the time from a timer() call because it's not signal safe. ps->timestamp = checkThreadTime.is_lock_free() ? checkThreadTime.load() : 0; +#if defined(USE_SANITIZER) + // In sanitizer builds the workaround implemented in SignalSafeUnwind.cpp is disabled + // so calling backtrace may cause a deadlock + size_t size = 0; +#else // SOMEDAY: should we limit the maximum number of frames from backtrace beyond just available space? size_t size = backtrace(ps->frames, net2backtraces_max - net2backtraces_offset - 2); +#endif ps->length = size; net2backtraces_offset += size + 2; #else - // No slow task profiling for other platforms! +// No slow task profiling for other platforms! #endif } void setProfilingEnabled(int enabled) { #ifdef __linux__ - if (profileThread && enabled && !profilingEnabled && profileRequested) { - profilingEnabled = true; - profileRequested = false; - pthread_kill(pthread_self(), SIGPROF); - } else { + if (profileThread) { profilingEnabled = enabled; } + flowProfilingEnabled = enabled; #else // No profiling for other platforms! #endif @@ -4670,7 +4882,7 @@ void* checkThread(void* arg) { double slowTaskLogInterval = minSlowTaskLogInterval; double saturatedLogInterval = minSaturationLogInterval; - while (true) { + while (!loopProfilerStopRequested) { threadSleep(FLOW_KNOBS->RUN_LOOP_PROFILING_INTERVAL); int64_t currentRunLoopIterations = net2RunLoopIterations.load(); @@ -4790,120 +5002,152 @@ std::string getExecPath() { void setupRunLoopProfiler() { #ifdef __linux__ - if (!profileThread && FLOW_KNOBS->RUN_LOOP_PROFILING_INTERVAL > 0) { + if (profileThreadId == -1 && FLOW_KNOBS->RUN_LOOP_PROFILING_INTERVAL > 0) { + chainedAction.sa_handler = SIG_DFL; + TraceEvent("StartingRunLoopProfilingThread").detail("Interval", FLOW_KNOBS->RUN_LOOP_PROFILING_INTERVAL); - initProfiling(); + profileThread = true; + profileThreadId = syscall(__NR_gettid); + if (profileThreadId < 0) { + TraceEvent(SevWarnAlways, "RunLoopProfilingSetupFailed") + .detail("Reason", "Error getting thread ID") + .GetLastError(); + return; + } + + initProfiling(); struct sigaction action; action.sa_handler = profileHandler; sigfillset(&action.sa_mask); action.sa_flags = 0; - sigaction(SIGPROF, &action, nullptr); + if (sigaction(SIGPROF, &action, &chainedAction)) { + TraceEvent(SevWarnAlways, "RunLoopProfilingSetupFailed") + .detail("Reason", "Error configuring signal handler") + .GetLastError(); + return; + } // Start a thread which will use signals to log stacks on long events pthread_t* mainThread = (pthread_t*)malloc(sizeof(pthread_t)); *mainThread = pthread_self(); - startThread(&checkThread, (void*)mainThread, 0, "fdb-loopprofile"); + { + std::unique_lock lock(loopProfilerThreadMutex); + if (!loopProfilerStopRequested) { + loopProfilerThread = startThread(&checkThread, (void*)mainThread, 0, "fdb-loopprofile"); + } + } } #else // No slow task profiling for other platforms! #endif } +void stopRunLoopProfiler() { +#ifdef __linux__ + std::unique_lock lock(loopProfilerThreadMutex); + loopProfilerStopRequested.store(true); + if (loopProfilerThread) { + pthread_join(loopProfilerThread.value(), NULL); + loopProfilerThread = {}; + } +#endif +} + // UnitTest for getMemoryInfo #ifdef __linux__ - #line 4816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 5060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase3819() - #line 3819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" -template - #line 3819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" -class FlowTestCase3819ActorState { - #line 4823 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" +// This generated class is to be used only via flowTestCase4063() + #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" +template + #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" +class FlowTestCase4063ActorState { + #line 5067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" public: - #line 3819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - FlowTestCase3819ActorState(UnitTestParameters const& params) - #line 3819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - #line 3819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + FlowTestCase4063ActorState(UnitTestParameters const& params) + #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" : params(params) - #line 4830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 5074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase3819", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase4063", reinterpret_cast(this)); } - ~FlowTestCase3819ActorState() + ~FlowTestCase4063ActorState() { - fdb_probe_actor_destroy("flowTestCase3819", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase4063", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 3821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" printf("UnitTest flow/Platform/getMemoryInfo 1\n"); - #line 3822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::string memString = "MemTotal: 24733228 kB\n" "MemFree: 2077580 kB\n" "Buffers: 266940 kB\n" "Cached: 16798292 kB\n" "SwapCached: 210240 kB\n" "Active: 12447724 kB\n" "Inactive: 9175508 kB\n" "Active(anon): 3458596 kB\n" "Inactive(anon): 1102948 kB\n" "Active(file): 8989128 kB\n" "Inactive(file): 8072560 kB\n" "Unevictable: 0 kB\n" "Mlocked: 0 kB\n" "SwapTotal: 25165820 kB\n" "SwapFree: 23680228 kB\n" "Dirty: 200 kB\n" "Writeback: 0 kB\n" "AnonPages: 4415148 kB\n" "Mapped: 62804 kB\n" "Shmem: 3544 kB\n" "Slab: 620144 kB\n" "SReclaimable: 556640 kB\n" "SUnreclaim: 63504 kB\n" "KernelStack: 5240 kB\n" "PageTables: 47292 kB\n" "NFS_Unstable: 0 kB\n" "Bounce: 0 kB\n" "WritebackTmp: 0 kB\n" "CommitLimit: 37532432 kB\n" "Committed_AS: 8603484 kB\n" "VmallocTotal: 34359738367 kB\n" "VmallocUsed: 410576 kB\n"; - #line 3855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - std::map request = { { LiteralStringRef("MemTotal:"), 0 }, { LiteralStringRef("MemFree:"), 0 }, { LiteralStringRef("MemAvailable:"), 0 }, { LiteralStringRef("Buffers:"), 0 }, { LiteralStringRef("Cached:"), 0 }, { LiteralStringRef("SwapTotal:"), 0 }, { LiteralStringRef("SwapFree:"), 0 }, }; - #line 3862 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + std::map request = { { "MemTotal:"_sr, 0 }, { "MemFree:"_sr, 0 }, { "MemAvailable:"_sr, 0 }, { "Buffers:"_sr, 0 }, { "Cached:"_sr, 0 }, { "SwapTotal:"_sr, 0 }, { "SwapFree:"_sr, 0 }, }; + #line 4104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::stringstream memInfoStream(memString); - #line 3863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - getMemoryInfo(request, memInfoStream); - #line 3864 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - ASSERT(request[LiteralStringRef("MemTotal:")] == 24733228); - #line 3865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - ASSERT(request[LiteralStringRef("MemFree:")] == 2077580); - #line 3866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - ASSERT(request[LiteralStringRef("MemAvailable:")] == 0); - #line 3867 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - ASSERT(request[LiteralStringRef("Buffers:")] == 266940); - #line 3868 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - ASSERT(request[LiteralStringRef("Cached:")] == 16798292); - #line 3869 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - ASSERT(request[LiteralStringRef("SwapTotal:")] == 25165820); - #line 3870 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - ASSERT(request[LiteralStringRef("SwapFree:")] == 23680228); - #line 3871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + linux_os::getMemoryInfo(request, memInfoStream); + #line 4106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + ASSERT(request["MemTotal:"_sr] == 24733228); + #line 4107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + ASSERT(request["MemFree:"_sr] == 2077580); + #line 4108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + ASSERT(request["MemAvailable:"_sr] == 0); + #line 4109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + ASSERT(request["Buffers:"_sr] == 266940); + #line 4110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + ASSERT(request["Cached:"_sr] == 16798292); + #line 4111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + ASSERT(request["SwapTotal:"_sr] == 25165820); + #line 4112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + ASSERT(request["SwapFree:"_sr] == 23680228); + #line 4113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" for( auto& item : request ) { - #line 3872 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" fmt::print("{}:{}\n", item.first.toString().c_str(), item.second); - #line 4871 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 5115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" } - #line 3875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" printf("UnitTest flow/Platform/getMemoryInfo 2\n"); - #line 3876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::string memString1 = "Slab: 192816 kB\n" "SReclaimable: 158404 kB\n" "SUnreclaim: 34412 kB\n" "KernelStack: 7152 kB\n" "PageTables: 45284 kB\n" "NFS_Unstable: 0 kB\n" "Bounce: 0 kB\n" "WritebackTmp: 0 kB\n" "MemTotal: 31856496 kB\n" "MemFree: 25492716 kB\n" "MemAvailable: 28470756 kB\n" "Buffers: 313644 kB\n" "Cached: 2956444 kB\n" "SwapCached: 0 kB\n" "Active: 3708432 kB\n" "Inactive: 2163752 kB\n" "Active(anon): 2604524 kB\n" "Inactive(anon): 199896 kB\n" "Active(file): 1103908 kB\n" "Inactive(file): 1963856 kB\n" "Unevictable: 0 kB\n" "Mlocked: 0 kB\n" "SwapTotal: 0 kB\n" "SwapFree: 0 kB\n" "Dirty: 0 kB\n" "Writeback: 0 kB\n" "AnonPages: 2602108 kB\n" "Mapped: 361088 kB\n" "Shmem: 202332 kB\n" "CommitLimit: 15928248 kB\n" "Committed_AS: 5556756 kB\n" "VmallocTotal: 34359738367 kB\n" "VmallocUsed: 427528 kB\n" "VmallocChunk: 34359283752 kB\n" "HardwareCorrupted: 0 kB\n" "AnonHugePages: 1275904 kB\n"; - #line 3913 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::stringstream memInfoStream1(memString1); - #line 3914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - getMemoryInfo(request, memInfoStream1); - #line 3915 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - ASSERT(request[LiteralStringRef("MemTotal:")] == 31856496); - #line 3916 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - ASSERT(request[LiteralStringRef("MemFree:")] == 25492716); - #line 3917 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - ASSERT(request[LiteralStringRef("MemAvailable:")] == 28470756); - #line 3918 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - ASSERT(request[LiteralStringRef("Buffers:")] == 313644); - #line 3919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - ASSERT(request[LiteralStringRef("Cached:")] == 2956444); - #line 3920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - ASSERT(request[LiteralStringRef("SwapTotal:")] == 0); - #line 3921 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - ASSERT(request[LiteralStringRef("SwapFree:")] == 0); - #line 3922 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + linux_os::getMemoryInfo(request, memInfoStream1); + #line 4157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + ASSERT(request["MemTotal:"_sr] == 31856496); + #line 4158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + ASSERT(request["MemFree:"_sr] == 25492716); + #line 4159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + ASSERT(request["MemAvailable:"_sr] == 28470756); + #line 4160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + ASSERT(request["Buffers:"_sr] == 313644); + #line 4161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + ASSERT(request["Cached:"_sr] == 2956444); + #line 4162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + ASSERT(request["SwapTotal:"_sr] == 0); + #line 4163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + ASSERT(request["SwapFree:"_sr] == 0); + #line 4164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" for( auto& item : request ) { - #line 3923 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" fmt::print("{}:{}\n", item.first.toString().c_str(), item.second); - #line 4899 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 5143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" } - #line 3926 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase3819ActorState(); static_cast(this)->destroy(); return 0; } - #line 4903 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase3819ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 4168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase4063ActorState(); static_cast(this)->destroy(); return 0; } + #line 5147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase4063ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -4916,40 +5160,40 @@ class FlowTestCase3819ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase3819ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase4063ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 3819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" UnitTestParameters params; - #line 4927 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 5171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase3819() - #line 3819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" -class FlowTestCase3819Actor final : public Actor, public FastAllocated, public FlowTestCase3819ActorState { - #line 4932 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" +// This generated class is to be used only via flowTestCase4063() + #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" +class FlowTestCase4063Actor final : public Actor, public FastAllocated, public FlowTestCase4063ActorState { + #line 5176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 3819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - FlowTestCase3819Actor(UnitTestParameters const& params) - #line 4942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + FlowTestCase4063Actor(UnitTestParameters const& params) + #line 5186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" : Actor(), - FlowTestCase3819ActorState(params) + FlowTestCase4063ActorState(params) { - fdb_probe_actor_enter("flowTestCase3819", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase4063", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase3819"); + this->lineage.setActorName("flowTestCase4063"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase3819", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase4063", reinterpret_cast(this), -1); } void cancel() override @@ -4962,15 +5206,15 @@ class FlowTestCase3819Actor final : public Actor, public FastAllocated flowTestCase3819( UnitTestParameters const& params ) { - #line 3819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - return Future(new FlowTestCase3819Actor(params)); - #line 4969 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" +static Future flowTestCase4063( UnitTestParameters const& params ) { + #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + return Future(new FlowTestCase4063Actor(params)); + #line 5213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase3819, "/flow/Platform/getMemoryInfo") +ACTOR_TEST_CASE(flowTestCase4063, "/flow/Platform/getMemoryInfo") -#line 3928 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" +#line 4170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" #endif int testPathFunction(const char* name, @@ -5092,191 +5336,191 @@ void platformSpecificDirectoryOpsTests(const std::string& cwd, int& errors) { void platformSpecificDirectoryOpsTests(const std::string& cwd, int& errors) {} #endif - #line 5095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 5339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase4049() - #line 4049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" -template - #line 4049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" -class FlowTestCase4049ActorState { - #line 5102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" +// This generated class is to be used only via flowTestCase4291() + #line 4291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" +template + #line 4291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" +class FlowTestCase4291ActorState { + #line 5346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" public: - #line 4049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - FlowTestCase4049ActorState(UnitTestParameters const& params) - #line 4049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - #line 4049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + FlowTestCase4291ActorState(UnitTestParameters const& params) + #line 4291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" : params(params) - #line 5109 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 5353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase4049", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase4291", reinterpret_cast(this)); } - ~FlowTestCase4049ActorState() + ~FlowTestCase4291ActorState() { - fdb_probe_actor_destroy("flowTestCase4049", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase4291", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 4050 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" int errors = 0; - #line 4052 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("popPath", popPath, "a", ""); - #line 4053 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("popPath", popPath, "a/", ""); - #line 4054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("popPath", popPath, "a///", ""); - #line 4055 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("popPath", popPath, "a///..", "a/"); - #line 4056 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("popPath", popPath, "a///../", "a/"); - #line 4057 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("popPath", popPath, "a///..//", "a/"); - #line 4058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("popPath", popPath, "/", "/"); - #line 4059 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("popPath", popPath, "/a", "/"); - #line 4060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("popPath", popPath, "/a/b", "/a/"); - #line 4061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("popPath", popPath, "/a/b/", "/a/"); - #line 4062 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("popPath", popPath, "/a/b/..", "/a/b/"); - #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("popPath", popPath, "/a/b///..//", "/a/b/"); - #line 4065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("cleanPath", cleanPath, "/", "/"); - #line 4066 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("cleanPath", cleanPath, "///.///", "/"); - #line 4067 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4309 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("cleanPath", cleanPath, "/a/b/.././../c/./././////./d/..//", "/c"); - #line 4068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("cleanPath", cleanPath, "a/b/.././../c/./././////./d/..//", "c"); - #line 4069 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("cleanPath", cleanPath, "..", ".."); - #line 4070 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("cleanPath", cleanPath, "../.././", "../.."); - #line 4071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("cleanPath", cleanPath, "../a/b/..//", "../a"); - #line 4072 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("cleanPath", cleanPath, "a/b/.././../c/./././////./d/..//..", "."); - #line 4073 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("cleanPath", cleanPath, "/..", "/"); - #line 4074 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("cleanPath", cleanPath, "/../foo/bar///", "/foo/bar"); - #line 4075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("cleanPath", cleanPath, "/a/b/../.././../", "/"); - #line 4076 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction("cleanPath", cleanPath, ".", "."); - #line 4079 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" platform::createDirectory("simfdb/backups/one/two/three"); - #line 4080 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" std::string cwd = platform::getWorkingDirectory(); - #line 4081 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" platformSpecificDirectoryOpsTests(cwd, errors); - #line 4082 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "/", false, false, "/"); - #line 4083 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "/foo//bar//baz/.././", false, false, "/foo/bar"); - #line 4084 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "/", true, false, "/"); - #line 4085 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "", true, false, platform_error()); - #line 4086 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, ".", true, false, cwd); - #line 4087 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "/a", true, false, "/a"); - #line 4088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "one/two/three/four", false, true, platform_error()); - #line 4089 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "one/two/three/four", false, false, joinPath(cwd, "one/two/three/four")); - #line 4091 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "abspath", abspath, "one/two/three/./four", false, false, joinPath(cwd, "one/two/three/four")); - #line 4093 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "abspath", abspath, "one/two/three/./four", false, false, joinPath(cwd, "one/two/three/four")); - #line 4095 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "one/two/three/./four/..", false, false, joinPath(cwd, "one/two/three")); - #line 4097 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "abspath", abspath, "one/./two/../three/./four", false, false, joinPath(cwd, "one/three/four")); - #line 4099 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "one/./two/../three/./four", false, true, platform_error()); - #line 4100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "one/two/three/./four", false, true, platform_error()); - #line 4101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "abspath", abspath, "simfdb/backups/one/two/three", false, true, joinPath(cwd, "simfdb/backups/one/two/three")); - #line 4103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "simfdb/backups/one/two/threefoo", false, true, platform_error()); - #line 4104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "abspath", abspath, "simfdb/backups/four/../two", false, false, joinPath(cwd, "simfdb/backups/two")); - #line 4106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4348 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "simfdb/backups/four/../two", false, true, platform_error()); - #line 4107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "simfdb/backups/five/../two", false, true, platform_error()); - #line 4108 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "abspath", abspath, "simfdb/backups/five/../two", false, false, joinPath(cwd, "simfdb/backups/two")); - #line 4110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "foo/./../foo2/./bar//", false, false, joinPath(cwd, "foo2/bar")); - #line 4111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4353 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "foo/./../foo2/./bar//", false, true, platform_error()); - #line 4112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "foo/./../foo2/./bar//", true, false, joinPath(cwd, "foo2/bar")); - #line 4113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("abspath", abspath, "foo/./../foo2/./bar//", true, true, platform_error()); - #line 4115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("parentDirectory", parentDirectory, "", true, false, platform_error()); - #line 4116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("parentDirectory", parentDirectory, "/", true, false, "/"); - #line 4117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("parentDirectory", parentDirectory, "/a", true, false, "/"); - #line 4118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("parentDirectory", parentDirectory, ".", false, false, cleanPath(joinPath(cwd, "..")) + "/"); - #line 4120 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4362 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("parentDirectory", parentDirectory, "./foo", false, false, cleanPath(cwd) + "/"); - #line 4121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("parentDirectory", parentDirectory, "one/two/three/four", false, true, platform_error()); - #line 4123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "parentDirectory", parentDirectory, "one/two/three/four", false, false, joinPath(cwd, "one/two/three/")); - #line 4125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "parentDirectory", parentDirectory, "one/two/three/./four", false, false, joinPath(cwd, "one/two/three/")); - #line 4127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4369 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "parentDirectory", parentDirectory, "one/two/three/./four/..", false, false, joinPath(cwd, "one/two/")); - #line 4129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "parentDirectory", parentDirectory, "one/./two/../three/./four", false, false, joinPath(cwd, "one/three/")); - #line 4131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4373 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "parentDirectory", parentDirectory, "one/./two/../three/./four", false, true, platform_error()); - #line 4133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4375 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("parentDirectory", parentDirectory, "one/two/three/./four", false, true, platform_error()); - #line 4135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4377 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("parentDirectory", parentDirectory, "simfdb/backups/one/two/three", false, true, joinPath(cwd, "simfdb/backups/one/two/")); - #line 4141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "parentDirectory", parentDirectory, "simfdb/backups/one/two/threefoo", false, true, platform_error()); - #line 4143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("parentDirectory", parentDirectory, "simfdb/backups/four/../two", false, false, joinPath(cwd, "simfdb/backups/")); - #line 4149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "parentDirectory", parentDirectory, "simfdb/backups/four/../two", false, true, platform_error()); - #line 4151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "parentDirectory", parentDirectory, "simfdb/backups/five/../two", false, true, platform_error()); - #line 4153 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("parentDirectory", parentDirectory, "simfdb/backups/five/../two", false, false, joinPath(cwd, "simfdb/backups/")); - #line 4159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "parentDirectory", parentDirectory, "foo/./../foo2/./bar//", false, false, joinPath(cwd, "foo2/")); - #line 4161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4403 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("parentDirectory", parentDirectory, "foo/./../foo2/./bar//", false, true, platform_error()); - #line 4163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2( "parentDirectory", parentDirectory, "foo/./../foo2/./bar//", true, false, joinPath(cwd, "foo2/")); - #line 4165 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4407 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" errors += testPathFunction2("parentDirectory", parentDirectory, "foo/./../foo2/./bar//", true, true, platform_error()); - #line 4168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" printf("%d errors.\n", errors); - #line 4170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" ASSERT(errors == 0); - #line 4171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase4049ActorState(); static_cast(this)->destroy(); return 0; } - #line 5276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase4049ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 4413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase4291ActorState(); static_cast(this)->destroy(); return 0; } + #line 5520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase4291ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } catch (Error& error) { @@ -5289,40 +5533,40 @@ class FlowTestCase4049ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase4049ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase4291ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } - #line 4049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + #line 4291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" UnitTestParameters params; - #line 5300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 5544 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase4049() - #line 4049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" -class FlowTestCase4049Actor final : public Actor, public FastAllocated, public FlowTestCase4049ActorState { - #line 5305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" +// This generated class is to be used only via flowTestCase4291() + #line 4291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" +class FlowTestCase4291Actor final : public Actor, public FastAllocated, public FlowTestCase4291ActorState { + #line 5549 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop - #line 4049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - FlowTestCase4049Actor(UnitTestParameters const& params) - #line 5315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 4291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + FlowTestCase4291Actor(UnitTestParameters const& params) + #line 5559 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" : Actor(), - FlowTestCase4049ActorState(params) + FlowTestCase4291ActorState(params) { - fdb_probe_actor_enter("flowTestCase4049", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase4291", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase4049"); + this->lineage.setActorName("flowTestCase4291"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase4049", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase4291", reinterpret_cast(this), -1); } void cancel() override @@ -5335,12 +5579,12 @@ class FlowTestCase4049Actor final : public Actor, public FastAllocated flowTestCase4049( UnitTestParameters const& params ) { - #line 4049 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" - return Future(new FlowTestCase4049Actor(params)); - #line 5342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" + #line 4291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" +static Future flowTestCase4291( UnitTestParameters const& params ) { + #line 4291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" + return Future(new FlowTestCase4291Actor(params)); + #line 5586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase4049, "/flow/Platform/directoryOps") +ACTOR_TEST_CASE(flowTestCase4291, "/flow/Platform/directoryOps") -#line 4173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" +#line 4415 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Platform.actor.cpp" diff --git a/src/flow/ProcessEvents.cpp b/src/flow/ProcessEvents.cpp new file mode 100644 index 0000000..44b1cdc --- /dev/null +++ b/src/flow/ProcessEvents.cpp @@ -0,0 +1,269 @@ +/* + * ProcessEvents.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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. + */ + +#include "flow/ProcessEvents.h" +#include "flow/UnitTest.h" + +#include +#include + +namespace { + +struct EventImpl { + using Id = intptr_t; + std::vector names; + ProcessEvents::Callback callback; + + EventImpl(std::vector names, ProcessEvents::Callback callback) + : names(std::move(names)), callback(std::move(callback)) { + addEvent(); + } + Id id() const { return reinterpret_cast(this); } + void addEvent(); + void removeEvent(); +}; + +struct ProcessEventsImpl { + struct Triggering { + unsigned& value; + ProcessEventsImpl& processEvents; + explicit Triggering(unsigned& value, ProcessEventsImpl& processEvents) + : value(value), processEvents(processEvents) { + ++value; + } + ~Triggering() { + if (--value == 0) { + // merge modifications back into the event map + for (auto const& p : processEvents.toRemove) { + for (auto const& n : p.second) { + processEvents.events[n].erase(p.first); + } + } + processEvents.toRemove.clear(); + for (auto const& p : processEvents.toInsert) { + processEvents.events[p.first].insert(p.second.begin(), p.second.end()); + } + processEvents.toInsert.clear(); + } + } + }; + using EventMap = std::unordered_map>; + unsigned triggering = 0; + EventMap events; + std::map> toRemove; + EventMap toInsert; + + void trigger(StringRef name, std::any const& data, Error const& e) { + Triggering _(triggering, *this); + auto iter = events.find(name); + // strictly speaking this isn't a bug, but having callbacks that aren't caught + // by anyone could mean that something was misspelled. Therefore, the safe thing + // to do is to abort. + if (iter == events.end()) { + return; + } + std::unordered_map& callbacks = iter->second; + // after we collected all unique callbacks we can call each + for (auto const& c : callbacks) { + try { + // it's possible that the callback has been removed in + // which case attempting to call it will be undefined + // behavior. + if (toRemove.count(c.first) == 0) { + c.second->callback(name, data, e); + } + } catch (...) { + // callbacks are not allowed to throw + UNSTOPPABLE_ASSERT(false); + } + } + } + + void add(StringRef const& name, EventImpl* event) { + EventMap& m = triggering ? toInsert : events; + m[name].emplace(event->id(), event); + } + + void add(std::vector const& names, EventImpl* event) { + for (auto const& name : names) { + add(name, event); + } + } + + void remove(std::vector names, EventImpl::Id id) { + if (triggering) { + // it's possible that the event hasn't been added yet + bool inInsertMap = false; + for (auto const& name : names) { + auto it = toInsert.find(name); + if (it == toInsert.end()) { + // either all are in the insert map or none + ASSERT(!inInsertMap); + break; + } + auto it2 = it->second.find(id); + if (it2 == it->second.end()) { + // either all are in the insert map or none + ASSERT(!inInsertMap); + break; + } + inInsertMap = true; + it->second.erase(it2); + if (it->second.empty()) { + toInsert.erase(it); + } + } + if (!inInsertMap) { + toRemove.emplace(id, std::move(names)); + } + } else { + for (auto const& name : names) { + events[name].erase(id); + } + } + } +}; + +ProcessEventsImpl processEventsImpl; + +void EventImpl::addEvent() { + processEventsImpl.add(names, this); +} + +void EventImpl::removeEvent() { + processEventsImpl.remove(names, this->id()); +} + +} // namespace + +namespace ProcessEvents { + +void trigger(StringRef name, std::any const& data, Error const& e) { + processEventsImpl.trigger(name, data, e); +} + +void uncancellableEvent(StringRef name, Callback callback) { + new EventImpl({ name }, std::move(callback)); +} + +Event::Event(StringRef name, Callback callback) { + impl = new EventImpl({ std::move(name) }, std::move(callback)); +} +Event::Event(std::vector names, Callback callback) { + impl = new EventImpl(std::move(names), std::move(callback)); +} +Event::~Event() { + auto ptr = reinterpret_cast(impl); + ptr->removeEvent(); + delete ptr; +} + +TEST_CASE("/flow/ProcessEvents") { + { + // Basic test + unsigned numHits = 0; + Event _("basic"_sr, [&numHits](StringRef n, std::any const&, Error const& e) { + ASSERT_EQ(n, "basic"_sr); + ASSERT_EQ(e.code(), error_code_success); + ++numHits; + }); + trigger("basic"_sr, ""_sr, success()); + ASSERT(numHits == 1); + trigger("basic"_sr, ""_sr, success()); + } + { + // Test that Events can be added during a trigger + unsigned hits1 = 0; + std::vector> createdEvents; + std::vector numHits; + numHits.reserve(2); + Event _("create"_sr, [&](StringRef n, std::any const&, Error const& e) { + ASSERT_EQ(n, "create"_sr); + ASSERT_EQ(e.code(), error_code_success); + ++hits1; + numHits.push_back(0); + createdEvents.push_back(std::make_shared( + std::vector{ "create"_sr, "secondaries"_sr }, + [&numHits, idx = numHits.size() - 1](StringRef n, std::any const&, Error const& e) { + ASSERT(n == "create"_sr || n == "secondaries"); + ASSERT_EQ(e.code(), error_code_success); + ++numHits[idx]; + })); + }); + trigger("create"_sr, ""_sr, success()); + ASSERT_EQ(hits1, 1); + ASSERT_EQ(createdEvents.size(), 1); + ASSERT_EQ(numHits.size(), 1); + // an event that is created in a callback mustn't be called in the same trigger + ASSERT_EQ(numHits[0], 0); + trigger("create"_sr, ""_sr, success()); + ASSERT_EQ(hits1, 2); + ASSERT_EQ(createdEvents.size(), 2); + ASSERT_EQ(numHits.size(), 2); + ASSERT_EQ(numHits[0], 1); + ASSERT_EQ(numHits[1], 0); + trigger("secondaries"_sr, ""_sr, success()); + ASSERT_EQ(hits1, 2); + ASSERT_EQ(createdEvents.size(), 2); + ASSERT_EQ(numHits.size(), 2); + ASSERT_EQ(numHits[0], 2); + ASSERT_EQ(numHits[1], 1); + } + { + // Remove self + unsigned called_self_delete = 0, called_non_delete = 0; + std::unique_ptr ev; + auto callback_del = [&](StringRef n, std::any const&, Error const& e) { + ASSERT_EQ(n, "deletion"_sr); + ASSERT_EQ(e.code(), error_code_success); + ++called_self_delete; + // remove Event + ev.reset(); + }; + ev.reset(new Event("deletion"_sr, callback_del)); + Event _("deletion"_sr, [&](StringRef n, std::any const&, Error const& e) { + ASSERT_EQ(n, "deletion"_sr); + ASSERT_EQ(e.code(), error_code_success); + ++called_non_delete; + }); + trigger("deletion"_sr, ""_sr, success()); + trigger("deletion"_sr, ""_sr, success()); + ASSERT_EQ(called_self_delete, 1); + ASSERT_EQ(called_non_delete, 2); + } + { + // Reentrant safe + Event ev("reentrant"_sr, [](StringRef, std::any const& data, Error const&) { + // call depth of 5 + auto v = std::any_cast(data); + if (v < 5) { + Event doNotCall("reentrant"_sr, [](StringRef, std::any const&, Error const&) { + // should never be called + ASSERT(false); + }); + trigger("reentrant"_sr, v + 1, success()); + } + }); + trigger("reentrant"_sr, 0, success()); + } + return Void(); +} + +} // namespace ProcessEvents \ No newline at end of file diff --git a/src/flow/Profiler.actor.cpp b/src/flow/Profiler.actor.cpp index 26ba599..3541e29 100644 --- a/src/flow/Profiler.actor.cpp +++ b/src/flow/Profiler.actor.cpp @@ -33,7 +33,7 @@ #include "flow/Platform.h" #include "flow/actorcompiler.h" // This must be the last include. -extern volatile thread_local int profilingEnabled; +extern volatile thread_local int flowProfilingEnabled; static uint64_t sys_gettid() { return syscall(__NR_gettid); @@ -146,7 +146,7 @@ struct Profiler { if (inSigHandler.exchange(true)) { return; } - if (profilingEnabled) { + if (flowProfilingEnabled) { double t = timer(); output_buffer->push(*(void**)&t); size_t n = platform::raw_backtrace(addresses, 256); diff --git a/src/flow/Profiler.actor.g.cpp b/src/flow/Profiler.actor.g.cpp index ae2d19a..de29fb6 100644 --- a/src/flow/Profiler.actor.g.cpp +++ b/src/flow/Profiler.actor.g.cpp @@ -35,7 +35,7 @@ #include "flow/Platform.h" #include "flow/actorcompiler.h" // This must be the last include. -extern volatile thread_local int profilingEnabled; +extern volatile thread_local int flowProfilingEnabled; static uint64_t sys_gettid() { return syscall(__NR_gettid); @@ -148,7 +148,7 @@ struct Profiler { if (inSigHandler.exchange(true)) { return; } - if (profilingEnabled) { + if (flowProfilingEnabled) { double t = timer(); output_buffer->push(*(void**)&t); size_t n = platform::raw_backtrace(addresses, 256); diff --git a/src/flow/ProtocolVersion.cpp b/src/flow/ProtocolVersion.cpp new file mode 100644 index 0000000..b70e7b7 --- /dev/null +++ b/src/flow/ProtocolVersion.cpp @@ -0,0 +1,37 @@ +/* + * ProtocolVersion.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ +#include "flow/ProtocolVersion.h" + +namespace { + +ProtocolVersion g_currentProtocolVersion(defaultProtocolVersionValue); + +} + +ProtocolVersion currentProtocolVersion() { + static ProtocolVersion firstReturnedProtocolVersion = g_currentProtocolVersion; + // Make sure the protocol version is not changed, once it is already in use + ASSERT(firstReturnedProtocolVersion == g_currentProtocolVersion); + return g_currentProtocolVersion; +} + +void useFutureProtocolVersion() { + g_currentProtocolVersion = ProtocolVersion(futureProtocolVersionValue); +} \ No newline at end of file diff --git a/src/flow/ProtocolVersions.cmake b/src/flow/ProtocolVersions.cmake new file mode 100644 index 0000000..06cef91 --- /dev/null +++ b/src/flow/ProtocolVersions.cmake @@ -0,0 +1,95 @@ +# Protocol Versions. +# This version impacts both communications and the deserialization of certain database and IKeyValueStore keys. +# +# The convention is that 'x' and 'y' should match the major and minor version of the software, and 'z' should be 0. +# To make a change without a corresponding increase to the x.y version, increment the 'dev' digit. +# +# The last 2 bytes (4 digits) of the protocol version do not affect compatibility. These two bytes are not currently +# used and should not be changed from 0. +# xyzdev +# vvvv +set(FDB_PV_DEFAULT_VERSION "0x0FDB00B073000000LL") +set(FDB_PV_FUTURE_VERSION "0x0FDB00B074000000LL") +set(FDB_PV_MIN_COMPATIBLE_VERSION "0x0FDB00B072000000LL") +set(FDB_PV_MIN_INVALID_VERSION "0x0FDB00B075000000LL") +set(FDB_PV_LEFT_MOST_CHECK "0x0FDB00B100000000LL") +set(FDB_PV_LSB_MASK "0xF0FFFFLL") + +# The 5th digit from right is dev version, for example, 2 in 0x0FDB00B061020000LL; +# It was used to identify a protocol change (e.g., interface change) between major/minor versions (say 5.1 and 5.2) +# We stopped using the dev version consistently in the past. +# To ensure binaries work across patch releases (e.g., 6.2.0 to 6.2.22), we require that the protocol version be +# the same for each of them. +set(FDB_PV_WATCHES "0x0FDB00A200090000LL") +set(FDB_PV_MOVABLE_COORDINATED_STATE "0x0FDB00A2000D0000LL") +set(FDB_PV_PROCESS_ID "0x0FDB00A340000000LL") +set(FDB_PV_OPEN_DATABASE "0x0FDB00A400040000LL") +set(FDB_PV_LOCALITY "0x0FDB00A446020000LL") +set(FDB_PV_MULTIGENERATION_TLOG "0x0FDB00A460010000LL") +set(FDB_PV_SHARED_MUTATIONS "0x0FDB00A460010000LL") +set(FDB_PV_INEXPENSIVE_MULTIVERSION_CLIENT "0x0FDB00A551000000LL") +set(FDB_PV_TAG_LOCALITY "0x0FDB00A560010000LL") +set(FDB_PV_FEARLESS "0x0FDB00B060000000LL") +set(FDB_PV_ENDPOINT_ADDR_LIST "0x0FDB00B061020000LL") +set(FDB_PV_IPV6 "0x0FDB00B061030000LL") +set(FDB_PV_TLOG_VERSION "0x0FDB00B061030000LL") +set(FDB_PV_PSEUDO_LOCALITIES "0x0FDB00B061070000LL") +set(FDB_PV_SHARDED_TXS_TAGS "0x0FDB00B061070000LL") +set(FDB_PV_TLOG_QUEUE_ENTRY_REF "0x0FDB00B062010001LL") +set(FDB_PV_GENERATION_REG_VAL "0x0FDB00B062010001LL") +set(FDB_PV_MOVABLE_COORDINATED_STATE_V2 "0x0FDB00B062010001LL") +set(FDB_PV_KEY_SERVER_VALUE "0x0FDB00B062010001LL") +set(FDB_PV_LOGS_VALUE "0x0FDB00B062010001LL") +set(FDB_PV_SERVER_TAG_VALUE "0x0FDB00B062010001LL") +set(FDB_PV_TAG_LOCALITY_LIST_VALUE "0x0FDB00B062010001LL") +set(FDB_PV_DATACENTER_REPLICAS_VALUE "0x0FDB00B062010001LL") +set(FDB_PV_PROCESS_CLASS_VALUE "0x0FDB00B062010001LL") +set(FDB_PV_WORKER_LIST_VALUE "0x0FDB00B062010001LL") +set(FDB_PV_BACKUP_START_VALUE "0x0FDB00B062010001LL") +set(FDB_PV_LOG_RANGE_ENCODE_VALUE "0x0FDB00B062010001LL") +set(FDB_PV_HEALTHY_ZONE_VALUE "0x0FDB00B062010001LL") +set(FDB_PV_DR_BACKUP_RANGES "0x0FDB00B062010001LL") +set(FDB_PV_REGION_CONFIGURATION "0x0FDB00B062010001LL") +set(FDB_PV_REPLICATION_POLICY "0x0FDB00B062010001LL") +set(FDB_PV_BACKUP_MUTATIONS "0x0FDB00B062010001LL") +set(FDB_PV_CLUSTER_CONTROLLER_PRIORITY_INFO "0x0FDB00B062010001LL") +set(FDB_PV_PROCESS_ID_FILE "0x0FDB00B062010001LL") +set(FDB_PV_CLOSE_UNUSED_CONNECTION "0x0FDB00B062010001LL") +set(FDB_PV_DB_CORE_STATE "0x0FDB00B063010000LL") +set(FDB_PV_TAG_THROTTLE_VALUE "0x0FDB00B063010000LL") +set(FDB_PV_STORAGE_CACHE_VALUE "0x0FDB00B063010000LL") +set(FDB_PV_RESTORE_STATUS_VALUE "0x0FDB00B063010000LL") +set(FDB_PV_RESTORE_REQUEST_VALUE "0x0FDB00B063010000LL") +set(FDB_PV_RESTORE_REQUEST_DONE_VERSION_VALUE "0x0FDB00B063010000LL") +set(FDB_PV_RESTORE_REQUEST_TRIGGER_VALUE "0x0FDB00B063010000LL") +set(FDB_PV_RESTORE_WORKER_INTERFACE_VALUE "0x0FDB00B063010000LL") +set(FDB_PV_BACKUP_PROGRESS_VALUE "0x0FDB00B063010000LL") +set(FDB_PV_KEY_SERVER_VALUE_V2 "0x0FDB00B063010000LL") +set(FDB_PV_UNIFIED_TLOG_SPILLING "0x0FDB00B063000000LL") +set(FDB_PV_BACKUP_WORKER "0x0FDB00B063010000LL") +set(FDB_PV_REPORT_CONFLICTING_KEYS "0x0FDB00B063010000LL") +set(FDB_PV_SMALL_ENDPOINTS "0x0FDB00B063010000LL") +set(FDB_PV_CACHE_ROLE "0x0FDB00B063010000LL") +set(FDB_PV_STABLE_INTERFACES "0x0FDB00B070010000LL") +set(FDB_PV_SERVER_LIST_VALUE "0x0FDB00B070010001LL") +set(FDB_PV_TAG_THROTTLE_VALUE_REASON "0x0FDB00B070010001LL") +set(FDB_PV_SPAN_CONTEXT "0x0FDB00B070010001LL") +set(FDB_PV_TSS "0x0FDB00B070010001LL") +set(FDB_PV_CHANGE_FEED "0x0FDB00B071010000LL") +set(FDB_PV_BLOB_GRANULE "0x0FDB00B071010000LL") +set(FDB_PV_NETWORK_ADDRESS_HOSTNAME_FLAG "0x0FDB00B071010000LL") +set(FDB_PV_STORAGE_METADATA "0x0FDB00B071010000LL") +set(FDB_PV_PERPETUAL_WIGGLE_METADATA "0x0FDB00B071010000LL") +set(FDB_PV_STORAGE_INTERFACE_READINESS "0x0FDB00B071010000LL") +set(FDB_PV_TENANTS "0x0FDB00B071010000LL") +set(FDB_PV_RESOLVER_PRIVATE_MUTATIONS "0x0FDB00B071010000LL") +set(FDB_PV_OTEL_SPAN_CONTEXT "0x0FDB00B072000000LL") +set(FDB_PV_SW_VERSION_TRACKING "0x0FDB00B072000000LL") +set(FDB_PV_ENCRYPTION_AT_REST "0x0FDB00B072000000LL") +set(FDB_PV_SHARD_ENCODE_LOCATION_METADATA "0x0FDB00B072000000LL") +set(FDB_PV_BLOB_GRANULE_FILE "0x0FDB00B072000000LL") +set(FDB_ENCRYPTED_SNAPSHOT_BACKUP_FILE "0x0FDB00B072000000LL") +set(FDB_PV_CLUSTER_ID_SPECIAL_KEY "0x0FDB00B072000000LL") +set(FDB_PV_BLOB_GRANULE_FILE_LOGICAL_SIZE "0x0FDB00B072000000LL") +set(FDB_PV_BLOB_RANGE_CHANGE_LOG "0x0FDB00B072000000LL") +set(FDB_PV_GC_TXN_GENERATIONS "0x0FDB00B073000000LL") diff --git a/src/flow/SignalSafeUnwind.cpp b/src/flow/SignalSafeUnwind.cpp index a43dd81..2467ff7 100644 --- a/src/flow/SignalSafeUnwind.cpp +++ b/src/flow/SignalSafeUnwind.cpp @@ -22,6 +22,9 @@ int64_t dl_iterate_phdr_calls = 0; +// Disabling the workaround in santizer builds, because dl_iterate_phdr used in the initialization of +// the sanitizer state, so calling any sanitizer-instrumented code in the context of this function +// causes uninitialized memory access #if defined(__linux__) && !defined(USE_SANITIZER) #include diff --git a/src/flow/SimBugInjector.cpp b/src/flow/SimBugInjector.cpp new file mode 100644 index 0000000..42cf9b9 --- /dev/null +++ b/src/flow/SimBugInjector.cpp @@ -0,0 +1,116 @@ +/* + * SimBugInjector.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include "flow/SimBugInjector.h" +#include "flow/network.h" + +#include +#include + +namespace { + +struct SimBugInjectorImpl { + bool isEnabled = true; + std::unordered_map> bugs; +}; + +struct ISimBugImpl { + unsigned numHits = 0; + static ISimBugImpl* get(void* self) { return reinterpret_cast(self); } +}; + +SimBugInjectorImpl* simBugInjector = nullptr; + +} // namespace + +ISimBug::ISimBug() : impl(new ISimBugImpl()) {} + +ISimBug::~ISimBug() { + delete ISimBugImpl::get(impl); +} + +std::string ISimBug::name() const { + auto const& typeInfo = typeid(*this); + return boost::core::demangle(typeInfo.name()); +} + +void ISimBug::hit() { + ++ISimBugImpl::get(impl)->numHits; + TraceEvent(SevWarnAlways, "BugInjected").detail("Name", name()).detail("NumHits", numHits()).log(); + this->onHit(); +} + +void ISimBug::onHit() {} + +unsigned ISimBug::numHits() const { + return ISimBugImpl::get(impl)->numHits; +} + +IBugIdentifier::~IBugIdentifier() {} + +bool SimBugInjector::isEnabled() const { + return simBugInjector != nullptr && simBugInjector->isEnabled; +} + +void SimBugInjector::enable() { + // SimBugInjector is very dangerous. It will corrupt your data! Therefore, using it outside of simulation is + // not allowed + UNSTOPPABLE_ASSERT(g_network->isSimulated()); + if (simBugInjector == nullptr) { + simBugInjector = new SimBugInjectorImpl(); + } + simBugInjector->isEnabled = true; +} + +void SimBugInjector::disable() { + if (simBugInjector) { + simBugInjector->isEnabled = false; + } +} + +void SimBugInjector::reset() { + if (simBugInjector) { + delete simBugInjector; + } +} + +std::shared_ptr SimBugInjector::getImpl(const IBugIdentifier& id, bool getDisabled /* = false */) const { + if (!simBugInjector) { + return {}; + } + if (!getDisabled && !isEnabled()) { + return {}; + } + auto it = simBugInjector->bugs.find(std::type_index(typeid(id))); + if (it == simBugInjector->bugs.end()) { + return {}; + } else { + return it->second; + } +} + +std::shared_ptr SimBugInjector::enableImpl(const IBugIdentifier& id) { + UNSTOPPABLE_ASSERT(isEnabled()); + auto& res = simBugInjector->bugs[std::type_index(typeid(id))]; + if (!res) { + res = id.create(); + } + return res; +} \ No newline at end of file diff --git a/src/flow/SourceVersion.h b/src/flow/SourceVersion.h deleted file mode 100644 index 11bfd90..0000000 --- a/src/flow/SourceVersion.h +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#define sourceVersion "da6380912f715a693de740c4c2454d96b09ddb15" diff --git a/src/flow/StreamCipher.cpp b/src/flow/StreamCipher.cpp index cf5f8d7..8cd4f95 100644 --- a/src/flow/StreamCipher.cpp +++ b/src/flow/StreamCipher.cpp @@ -113,16 +113,6 @@ void StreamCipher::cleanup() noexcept { } } -void applyHmacKeyDerivationFunc(StreamCipherKey* cipherKey, HmacSha256StreamCipher* hmacGenerator, Arena& arena) { - uint8_t buf[cipherKey->size() + sizeof(uint64_t)]; - memcpy(&buf[0], cipherKey->data(), cipherKey->size()); - uint64_t seed = deterministicRandom()->randomUInt64(); - memcpy(&buf[0] + cipherKey->size(), &seed, sizeof(uint64_t)); - StringRef digest = hmacGenerator->digest(&buf[0], cipherKey->size() + sizeof(uint64_t), arena); - std::copy(digest.begin(), digest.end(), &buf[0]); - cipherKey->initializeKey(&buf[0], cipherKey->size()); -} - EncryptionStreamCipher::EncryptionStreamCipher(const StreamCipherKey* key, const StreamCipher::IV& iv) : cipher(StreamCipher(key->size())) { EVP_EncryptInit_ex(cipher.getCtx(), EVP_aes_256_gcm(), nullptr, nullptr, nullptr); @@ -131,7 +121,7 @@ EncryptionStreamCipher::EncryptionStreamCipher(const StreamCipherKey* key, const } StringRef EncryptionStreamCipher::encrypt(unsigned char const* plaintext, int len, Arena& arena) { - TEST(true); // Encrypting data with StreamCipher + CODE_PROBE(true, "Encrypting data with StreamCipher"); auto ciphertext = new (arena) unsigned char[len + AES_BLOCK_SIZE]; int bytes{ 0 }; EVP_EncryptUpdate(cipher.getCtx(), ciphertext, &bytes, plaintext, len); @@ -153,7 +143,7 @@ DecryptionStreamCipher::DecryptionStreamCipher(const StreamCipherKey* key, const } StringRef DecryptionStreamCipher::decrypt(unsigned char const* ciphertext, int len, Arena& arena) { - TEST(true); // Decrypting data with StreamCipher + CODE_PROBE(true, "Decrypting data with StreamCipher"); auto plaintext = new (arena) unsigned char[len]; int bytesDecrypted{ 0 }; EVP_DecryptUpdate(cipher.getCtx(), plaintext, &bytesDecrypted, ciphertext, len); @@ -173,15 +163,6 @@ HmacSha256StreamCipher::HmacSha256StreamCipher() : cipher(EVP_MAX_KEY_LENGTH) { HMAC_Init_ex(cipher.getHmacCtx(), NULL, 0, EVP_sha256(), nullptr); } -StringRef HmacSha256StreamCipher::digest(unsigned char const* data, int len, Arena& arena) { - TEST(true); // Digest using StreamCipher - unsigned int digestLen = HMAC_size(cipher.getHmacCtx()); - auto digest = new (arena) unsigned char[digestLen]; - HMAC_Update(cipher.getHmacCtx(), data, len); - HMAC_Final(cipher.getHmacCtx(), digest, &digestLen); - return StringRef(digest, digestLen); -} - StringRef HmacSha256StreamCipher::finish(Arena& arena) { unsigned int digestLen = HMAC_size(cipher.getHmacCtx()); auto digest = new (arena) unsigned char[digestLen]; @@ -199,11 +180,11 @@ TEST_CASE("flow/StreamCipher") { StreamCipherKey const* key = StreamCipherKey::getGlobalCipherKey(); StreamCipher::IV iv; - generateRandomData(iv.data(), iv.size()); + deterministicRandom()->randomBytes(iv.data(), iv.size()); Arena arena; std::vector plaintext(deterministicRandom()->randomInt(0, 10001)); - generateRandomData(&plaintext.front(), plaintext.size()); + deterministicRandom()->randomBytes(&plaintext.front(), plaintext.size()); std::vector ciphertext(plaintext.size() + AES_BLOCK_SIZE); std::vector decryptedtext(plaintext.size() + AES_BLOCK_SIZE); diff --git a/src/flow/SystemMonitor.cpp b/src/flow/SystemMonitor.cpp index c4572c0..e284a50 100644 --- a/src/flow/SystemMonitor.cpp +++ b/src/flow/SystemMonitor.cpp @@ -18,6 +18,8 @@ * limitations under the License. */ +#include + #include "flow/flow.h" #include "flow/Histogram.h" #include "flow/Platform.h" @@ -28,6 +30,10 @@ #include #endif +#ifdef ADDRESS_SANITIZER +#include +#endif + SystemMonitorMachineState machineState; void initializeSystemMonitorMachineState(SystemMonitorMachineState machineState) { @@ -67,6 +73,35 @@ SystemStatistics getSystemStatistics() { .detail("ApproximateUnusedMemory" #size, FastAllocator::getApproximateMemoryUnused()) \ .detail("ActiveThreads" #size, FastAllocator::getActiveThreads()) +namespace { + +#ifdef __linux__ +// Converts cgroup key, e.g. nr_periods, to NrPeriods +std::string capitalizeCgroupKey(const std::string& key) { + bool wordStart = true; + std::string result; + result.reserve(key.size()); + + for (const char ch : key) { + if (std::isalnum(ch)) { + if (wordStart) { + result.push_back(std::toupper(ch)); + wordStart = false; + } else { + result.push_back(ch); + } + } else { + // Skip non-alnum characters + wordStart = true; + } + } + + return result; +} +#endif // __linux__ + +} // anonymous namespace + SystemStatistics customSystemMonitor(std::string const& eventName, StatisticsState* statState, bool machineMetrics) { const IPAddress ipAddr = machineState.ip.present() ? machineState.ip.get() : IPAddress(); SystemStatistics currentStats = getSystemStatistics( @@ -285,8 +320,8 @@ SystemStatistics customSystemMonitor(std::string const& eventName, StatisticsSta } if (machineMetrics) { - TraceEvent("MachineMetrics") - .detail("Elapsed", currentStats.elapsed) + auto traceEvent = TraceEvent("MachineMetrics"); + traceEvent.detail("Elapsed", currentStats.elapsed) .detail("MbpsSent", currentStats.machineMegabitsSent / currentStats.elapsed) .detail("MbpsReceived", currentStats.machineMegabitsReceived / currentStats.elapsed) .detail("OutSegs", currentStats.machineOutSegs) @@ -298,7 +333,13 @@ SystemStatistics customSystemMonitor(std::string const& eventName, StatisticsSta .detail("DCID", machineState.dcId) .detail("ZoneID", machineState.zoneId) .detail("MachineID", machineState.machineId) + .detail("DatahallID", machineState.datahallId) .trackLatest("MachineMetrics"); +#ifdef __linux__ + for (const auto& [k, v] : linux_os::reportCGroupCpuStat()) { + traceEvent.detail(capitalizeCgroupKey(k).c_str(), v); + } +#endif // __linux__ } } @@ -316,19 +357,19 @@ SystemStatistics customSystemMonitor(std::string const& eventName, StatisticsSta char* demangled = abi::__cxa_demangle(i->first, nullptr, nullptr, nullptr); if (demangled) { s = demangled; - if (StringRef(s).startsWith(LiteralStringRef("(anonymous namespace)::"))) - s = s.substr(LiteralStringRef("(anonymous namespace)::").size()); + if (StringRef(s).startsWith("(anonymous namespace)::"_sr)) + s = s.substr("(anonymous namespace)::"_sr.size()); free(demangled); } else s = i->first; #else s = i->first; - if (StringRef(s).startsWith(LiteralStringRef("class `anonymous namespace'::"))) - s = s.substr(LiteralStringRef("class `anonymous namespace'::").size()); - else if (StringRef(s).startsWith(LiteralStringRef("class "))) - s = s.substr(LiteralStringRef("class ").size()); - else if (StringRef(s).startsWith(LiteralStringRef("struct "))) - s = s.substr(LiteralStringRef("struct ").size()); + if (StringRef(s).startsWith("class `anonymous namespace'::"_sr)) + s = s.substr("class `anonymous namespace'::"_sr.size()); + else if (StringRef(s).startsWith("class "_sr)) + s = s.substr("class "_sr.size()); + else if (StringRef(s).startsWith("struct "_sr)) + s = s.substr("struct "_sr.size()); #endif typeNames.emplace_back(s, i->first); } @@ -423,8 +464,11 @@ Future startMemoryUsageMonitor(uint64_t memLimit) { } auto checkMemoryUsage = [=]() { if (getResidentMemoryUsage() > memLimit) { +#if defined(ADDRESS_SANITIZER) && defined(__linux__) + __sanitizer_print_memory_profile(/*top percent*/ 100, /*max contexts*/ 10); +#endif platform::outOfMemory(); } }; return recurring(checkMemoryUsage, FLOW_KNOBS->MEMORY_USAGE_CHECK_INTERVAL); -} \ No newline at end of file +} diff --git a/src/flow/SystemMonitor.h b/src/flow/SystemMonitor.h deleted file mode 100644 index 41c7642..0000000 --- a/src/flow/SystemMonitor.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * SystemMonitor.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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. - */ - -#ifndef FLOW_SYSTEM_MONITOR_H -#define FLOW_SYSTEM_MONITOR_H -#pragma once - -#include "flow/Platform.h" -#include "flow/TDMetric.actor.h" - -struct SystemMonitorMachineState { - Optional folder; - Optional> dcId; - Optional> zoneId; - Optional> machineId; - Optional ip; - Optional fdbVersion; - - double monitorStartTime; - - SystemMonitorMachineState() : monitorStartTime(0) {} - explicit SystemMonitorMachineState(const IPAddress& ip) : ip(ip), monitorStartTime(0) {} - SystemMonitorMachineState(std::string const& folder, - Optional> const& dcId, - Optional> const& zoneId, - Optional> const& machineId, - IPAddress const& ip, - std::string const& fdbVersion) - : folder(folder), dcId(dcId), zoneId(zoneId), machineId(machineId), ip(ip), fdbVersion(fdbVersion), - monitorStartTime(0) {} -}; - -void initializeSystemMonitorMachineState(SystemMonitorMachineState machineState); - -// Returns the machine start time. 0 if the system monitor is not initialized. -double machineStartTime(); - -struct NetworkData { - int64_t bytesSent; - int64_t countPacketsReceived; - int64_t countPacketsGenerated; - int64_t bytesReceived; - int64_t countWriteProbes; - int64_t countReadProbes; - int64_t countReads; - int64_t countWouldBlock; - int64_t countWrites; - int64_t countRunLoop; - int64_t countCantSleep; - int64_t countWontSleep; - int64_t countTimers; - int64_t countTasks; - int64_t countYields; - int64_t countYieldBigStack; - int64_t countYieldCalls; - int64_t countASIOEvents; - int64_t countYieldCallsTrue; - int64_t countRunLoopProfilingSignals; - int64_t countFileLogicalWrites; - int64_t countFileLogicalReads; - int64_t countAIOSubmit; - int64_t countAIOCollect; - int64_t countFileCacheWrites; - int64_t countFileCacheReads; - int64_t countFileCacheWritesBlocked; - int64_t countFileCacheReadsBlocked; - int64_t countFileCachePageReadsMerged; - int64_t countFileCacheFinds; - int64_t countFileCacheReadBytes; - int64_t countFilePageCacheHits; - int64_t countFilePageCacheMisses; - int64_t countFilePageCacheEvictions; - int64_t countConnEstablished; - int64_t countConnClosedWithError; - int64_t countConnClosedWithoutError; - int64_t countTLSPolicyFailures; - double countLaunchTime; - double countReactTime; - - void init() { - bytesSent = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.BytesSent")); - countPacketsReceived = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountPacketsReceived")); - countPacketsGenerated = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountPacketsGenerated")); - bytesReceived = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.BytesReceived")); - countWriteProbes = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountWriteProbes")); - countReadProbes = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountReadProbes")); - countReads = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountReads")); - countWouldBlock = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountWouldBlock")); - countWrites = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountWrites")); - countRunLoop = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountRunLoop")); - countCantSleep = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountCantSleep")); - countWontSleep = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountWontSleep")); - countTimers = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountTimers")); - countTasks = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountTasks")); - countYields = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountYields")); - countYieldBigStack = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountYieldBigStack")); - countYieldCalls = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountYieldCalls")); - countASIOEvents = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountASIOEvents")); - countYieldCallsTrue = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountYieldCallsTrue")); - countRunLoopProfilingSignals = - Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountRunLoopProfilingSignals")); - countConnEstablished = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountConnEstablished")); - countConnClosedWithError = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountConnClosedWithError")); - countConnClosedWithoutError = - Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountConnClosedWithoutError")); - countTLSPolicyFailures = Int64Metric::getValueOrDefault(LiteralStringRef("Net2.CountTLSPolicyFailures")); - countLaunchTime = DoubleMetric::getValueOrDefault(LiteralStringRef("Net2.CountLaunchTime")); - countReactTime = DoubleMetric::getValueOrDefault(LiteralStringRef("Net2.CountReactTime")); - countFileLogicalWrites = Int64Metric::getValueOrDefault(LiteralStringRef("AsyncFile.CountLogicalWrites")); - countFileLogicalReads = Int64Metric::getValueOrDefault(LiteralStringRef("AsyncFile.CountLogicalReads")); - countAIOSubmit = Int64Metric::getValueOrDefault(LiteralStringRef("AsyncFile.CountAIOSubmit")); - countAIOCollect = Int64Metric::getValueOrDefault(LiteralStringRef("AsyncFile.CountAIOCollect")); - countFileCacheWrites = Int64Metric::getValueOrDefault(LiteralStringRef("AsyncFile.CountCacheWrites")); - countFileCacheReads = Int64Metric::getValueOrDefault(LiteralStringRef("AsyncFile.CountCacheReads")); - countFileCacheWritesBlocked = - Int64Metric::getValueOrDefault(LiteralStringRef("AsyncFile.CountCacheWritesBlocked")); - countFileCacheReadsBlocked = - Int64Metric::getValueOrDefault(LiteralStringRef("AsyncFile.CountCacheReadsBlocked")); - countFileCachePageReadsMerged = - Int64Metric::getValueOrDefault(LiteralStringRef("AsyncFile.CountCachePageReadsMerged")); - countFileCacheFinds = Int64Metric::getValueOrDefault(LiteralStringRef("AsyncFile.CountCacheFinds")); - countFileCacheReadBytes = Int64Metric::getValueOrDefault(LiteralStringRef("AsyncFile.CountCacheReadBytes")); - countFilePageCacheHits = Int64Metric::getValueOrDefault(LiteralStringRef("AsyncFile.CountCachePageReadsHit")); - countFilePageCacheMisses = - Int64Metric::getValueOrDefault(LiteralStringRef("AsyncFile.CountCachePageReadsMissed")); - countFilePageCacheEvictions = - Int64Metric::getValueOrDefault(LiteralStringRef("EvictablePageCache.CacheEvictions")); - } -}; - -struct StatisticsState { - SystemStatisticsState* systemState; - NetworkData networkState; - NetworkMetrics networkMetricsState; - - StatisticsState() : systemState(nullptr) {} -}; - -void systemMonitor(); -SystemStatistics customSystemMonitor(std::string const& eventName, - StatisticsState* statState, - bool machineMetrics = false); -SystemStatistics getSystemStatistics(); - -Future startMemoryUsageMonitor(uint64_t memLimit); - -#endif /* FLOW_SYSTEM_MONITOR_H */ diff --git a/src/flow/TDMetric.cpp b/src/flow/TDMetric.cpp index 0d66e28..2e6b80e 100644 --- a/src/flow/TDMetric.cpp +++ b/src/flow/TDMetric.cpp @@ -18,18 +18,23 @@ * limitations under the License. */ +#include "flow/Error.h" +#include "flow/OTELMetrics.h" #include "flow/TDMetric.actor.h" #include "flow/flow.h" +#include +#include +#include -const StringRef BaseEventMetric::metricType = LiteralStringRef("Event"); +const StringRef BaseEventMetric::metricType = "Event"_sr; template <> -const StringRef Int64Metric::metricType = LiteralStringRef("Int64"); +const StringRef Int64Metric::metricType = "Int64"_sr; template <> -const StringRef DoubleMetric::metricType = LiteralStringRef("Double"); +const StringRef DoubleMetric::metricType = "Double"_sr; template <> -const StringRef BoolMetric::metricType = LiteralStringRef("Bool"); +const StringRef BoolMetric::metricType = "Bool"_sr; template <> -const StringRef StringMetric::metricType = LiteralStringRef("String"); +const StringRef StringMetric::metricType = "String"_sr; std::string reduceFilename(std::string const& filename) { std::string r = filename; @@ -60,29 +65,29 @@ std::string reduceFilename(std::string const& filename) { } void MetricKeyRef::writeField(BinaryWriter& wr) const { - wr.serializeBytes(LiteralStringRef("\x01")); + wr.serializeBytes("\x01"_sr); wr.serializeBytes(fieldName); - wr.serializeBytes(LiteralStringRef("\x00\x01")); + wr.serializeBytes("\x00\x01"_sr); wr.serializeBytes(fieldType); - wr.serializeBytes(LiteralStringRef("\x00")); + wr.serializeBytes("\x00"_sr); } void MetricKeyRef::writeMetricName(BinaryWriter& wr) const { - wr.serializeBytes(LiteralStringRef("\x01")); + wr.serializeBytes("\x01"_sr); wr.serializeBytes(name.name); - wr.serializeBytes(LiteralStringRef("\x00\x01")); + wr.serializeBytes("\x00\x01"_sr); wr.serializeBytes(name.type); - wr.serializeBytes(LiteralStringRef("\x00\x01")); + wr.serializeBytes("\x00\x01"_sr); wr.serializeBytes(address); - wr.serializeBytes(LiteralStringRef("\x00\x01")); + wr.serializeBytes("\x00\x01"_sr); wr.serializeBytes(name.id); - wr.serializeBytes(LiteralStringRef("\x00")); + wr.serializeBytes("\x00"_sr); } const Standalone MetricKeyRef::packLatestKey() const { BinaryWriter wr(Unversioned()); wr.serializeBytes(prefix); - wr.serializeBytes(LiteralStringRef("\x01TDMetricsLastValue\x00")); + wr.serializeBytes("\x01TDMetricsLastValue\x00"_sr); writeMetricName(wr); return wr.toValue(); } @@ -91,9 +96,9 @@ const Standalone MetricKeyRef::packDataKey(int64_t time) const { BinaryWriter wr(Unversioned()); wr.serializeBytes(prefix); if (isField()) - wr.serializeBytes(LiteralStringRef("\x01TDFieldData\x00")); + wr.serializeBytes("\x01TDFieldData\x00"_sr); else - wr.serializeBytes(LiteralStringRef("\x01TDMetricData\x00")); + wr.serializeBytes("\x01TDMetricData\x00"_sr); writeMetricName(wr); if (isField()) writeField(wr); @@ -107,15 +112,15 @@ const Standalone MetricKeyRef::packFieldRegKey() const { ASSERT(isField()); BinaryWriter wr(Unversioned()); wr.serializeBytes(prefix); - wr.serializeBytes(LiteralStringRef("\x01TDFields\x00\x01")); + wr.serializeBytes("\x01TDFields\x00\x01"_sr); wr.serializeBytes(name.name); - wr.serializeBytes(LiteralStringRef("\x00\x01")); + wr.serializeBytes("\x00\x01"_sr); wr.serializeBytes(name.type); - wr.serializeBytes(LiteralStringRef("\x00\x01")); + wr.serializeBytes("\x00\x01"_sr); wr.serializeBytes(fieldName); - wr.serializeBytes(LiteralStringRef("\x00\x01")); + wr.serializeBytes("\x00\x01"_sr); wr.serializeBytes(fieldType); - wr.serializeBytes(LiteralStringRef("\x00")); + wr.serializeBytes("\x00"_sr); return wr.toValue(); } @@ -134,7 +139,7 @@ bool TDMetricCollection::canLog(int level) const { void TDMetricCollection::checkRoll(uint64_t t, int64_t usedBytes) { currentTimeBytes += usedBytes; if (currentTimeBytes > 1e6) { - TEST(true); // metrics were rolled + CODE_PROBE(true, "metrics were rolled", probe::decoration::rare); currentTimeBytes = 0; rollTimes.push_back(t); for (auto& it : metricMap) @@ -193,12 +198,12 @@ uint64_t DynamicEventMetric::log(uint64_t explicitTime) { return t; } -void DynamicEventMetric::flushData(MetricKeyRef const& mk, uint64_t rollTime, MetricUpdateBatch& batch) { +void DynamicEventMetric::flushData(MetricKeyRef const& mk, uint64_t rollTime, MetricBatch& batch) { time.flushField(mk, rollTime, batch); for (auto& [name, field] : fields) field->flushField(mk, rollTime, batch); if (!latestRecorded) { - batch.updates.emplace_back(mk.packLatestKey(), StringRef()); + batch.scope.updates.emplace_back(mk.packLatestKey(), StringRef()); latestRecorded = true; } } @@ -229,3 +234,172 @@ std::string MetricData::toString() const { rollTime, writer.getLength()); } + +std::string createStatsdMessage(const std::string& name, StatsDMetric type, const std::string& val) { + return createStatsdMessage(name, type, val, {}); +} + +std::string createStatsdMessage(const std::string& name, + StatsDMetric type, + const std::string& val, + const std::vector>& tags) { + ASSERT(!name.empty()); + std::string msg = name + ":" + val; + switch (type) { + case StatsDMetric::GAUGE: + msg += "|g"; + break; + + case StatsDMetric::COUNTER: + msg += "|c"; + break; + } + + if (!tags.empty()) { + msg += "|"; + for (size_t i = 0; i < tags.size(); i++) { + msg = msg + "#" + tags[i].first + ":" + tags[i].second; + // If we know there is another tag coming, we should add a comma in the message + if (i != tags.size() - 1) { + msg += ","; + } + } + } + + return msg; +} + +MetricsDataModel knobToMetricModel(const std::string& knob) { + if (knob == "statsd") { + return MetricsDataModel::STATSD; + } else if (knob == "otel") { + return MetricsDataModel::OTLP; + } else if (knob == "none") { + return MetricsDataModel::NONE; + } + ASSERT(false); + return MetricsDataModel::NONE; +} + +std::vector splitString(const std::string& str, const std::string& delimit) { + std::vector splitted; + size_t pos = 0; + std::string s = str; + + while ((pos = s.find(delimit)) != std::string::npos) { + splitted.push_back(s.substr(0, pos)); + s.erase(0, pos + delimit.length()); + } + splitted.push_back(s); + return splitted; +} + +/* + Returns true if num is exactly a string representation of a number + Ex: "123", "123.65" both return true + "124.532.13", "t4fr", "102g" all return false +*/ +bool isNumber(const std::string& num) { + if (num.empty()) { + return false; + } + + size_t start = 0; + // We could have a negative number, if the first character isn't a digit + // but it's a "-", then we start from position 1. Otherwise it's not a valid number + if (!std::isdigit(num[0])) { + if (num[0] == '-') { + start = 1; + } else { + return false; + } + } + + // Iterate through the string and make sure every char is a digit and there is only one occurence of "." + int dot_count = 0; + for (size_t i = start; i < num.size(); i++) { + if (!std::isdigit(num[i])) { + if (num[i] == '.') { + if (dot_count > 0) { + return false; + } + ++dot_count; + } else { + return false; + } + } + } + return true; +} + +/* + Returns true if msg is a valid statsd string. Valid statsd strings are of the form + :||#:, + + Where name consists of only upper or lowercase letters (no symbols), + value is numeric (postive or negative, integer or decimal), + type is one of "g", "c", + +*/ +bool verifyStatsdMessage(const std::string& msg) { + auto tokens = splitString(msg, "|"); + std::vector statsdTypes{ "c", "g" }; + + // We can't have more than three "|" in our string based on above format + if (tokens.size() > 3) { + return false; + } + + // First check if : is valid, this should be in tokens[0] + auto nameVal = splitString(tokens[0], ":"); + if (nameVal.size() != 2) { + return false; + } + // nameVal[1] should be a numeric value + if (!isNumber(nameVal[1])) { + return false; + } + + // The 2nd token should always represent a valid statsd type + if (std::find(statsdTypes.begin(), statsdTypes.end(), tokens[1]) == statsdTypes.end()) { + return false; + } + + // It is optional to have tags but the tags section must be non-empty and begin + // with a "#" + if (tokens.size() > 2) { + if (tokens[2].empty()) { + return false; + } + if (tokens[2][0] != '#') { + return false; + } + } + return true; +} + +void createOtelGauge(UID id, const std::string& name, double value) { + MetricCollection* metrics = MetricCollection::getMetricCollection(); + if (metrics != nullptr) { + NetworkAddress addr = g_network->getLocalAddress(); + std::string ip_str = addr.ip.toString(); + std::string port_str = std::to_string(addr.port); + if (metrics->gaugeMap.find(id) != metrics->gaugeMap.end()) { + metrics->gaugeMap[id].points.emplace_back(value); + } else { + metrics->gaugeMap[id] = OTEL::OTELGauge(name, value); + } + metrics->gaugeMap[id].points.back().addAttribute("ip", ip_str); + metrics->gaugeMap[id].points.back().addAttribute("port", port_str); + } +} + +void createOtelGauge(UID id, const std::string& name, double value, const std::vector& attrs) { + MetricCollection* metrics = MetricCollection::getMetricCollection(); + createOtelGauge(id, name, value); + if (metrics != nullptr) { + for (const auto& attr : attrs) { + metrics->gaugeMap[id].points.back().addAttribute(attr.key, attr.value); + } + } +} diff --git a/src/flow/TLSConfig.actor.cpp b/src/flow/TLSConfig.actor.cpp index 4f1d385..591960b 100644 --- a/src/flow/TLSConfig.actor.cpp +++ b/src/flow/TLSConfig.actor.cpp @@ -25,14 +25,6 @@ // To force typeinfo to only be emitted once. TLSPolicy::~TLSPolicy() {} -#ifdef TLS_DISABLED - -void LoadedTLSConfig::print(FILE* fp) { - fprintf(fp, "Cannot print LoadedTLSConfig. TLS support is not enabled.\n"); -} - -#else // TLS is enabled - #include #include #include @@ -51,14 +43,8 @@ void LoadedTLSConfig::print(FILE* fp) { #include #include -// This include breaks module dependencies, but we need to do async file reads. -// So either we include fdbrpc here, or this file is moved to fdbrpc/, and then -// Net2, which depends on us, includes fdbrpc/. -// -// Either way, the only way to break this dependency cycle is to move all of -// AsyncFile to flow/ -#include "fdbrpc/IAsyncFile.h" #include "flow/Platform.h" +#include "flow/IAsyncFile.h" #include "flow/FastRef.h" #include "flow/Trace.h" @@ -92,7 +78,7 @@ void LoadedTLSConfig::print(FILE* fp) { int num_certs = 0; boost::asio::ssl::context context(boost::asio::ssl::context::tls); try { - ConfigureSSLContext(*this, &context); + ConfigureSSLContext(*this, context); } catch (Error& e) { fprintf(fp, "There was an error in loading the certificate chain.\n"); throw; @@ -120,51 +106,58 @@ void LoadedTLSConfig::print(FILE* fp) { X509_STORE_CTX_free(store_ctx); } -void ConfigureSSLContext(const LoadedTLSConfig& loaded, - boost::asio::ssl::context* context, - std::function onPolicyFailure) { +void ConfigureSSLContext(const LoadedTLSConfig& loaded, boost::asio::ssl::context& context) { try { - context->set_options(boost::asio::ssl::context::default_workarounds); - context->set_verify_mode(boost::asio::ssl::context::verify_peer | - boost::asio::ssl::verify_fail_if_no_peer_cert); - - if (loaded.isTLSEnabled()) { - auto tlsPolicy = makeReference(loaded.getEndpointType()); - tlsPolicy->set_verify_peers({ loaded.getVerifyPeers() }); - - context->set_verify_callback( - [policy = tlsPolicy, onPolicyFailure](bool preverified, boost::asio::ssl::verify_context& ctx) { - bool success = policy->verify_peer(preverified, ctx.native_handle()); - if (!success) { - onPolicyFailure(); - } - return success; - }); - } else { - // Insecurely always except if TLS is not enabled. - context->set_verify_callback([](bool, boost::asio::ssl::verify_context&) { return true; }); - } + context.set_options(boost::asio::ssl::context::default_workarounds); + auto verifyFailIfNoPeerCert = boost::asio::ssl::verify_fail_if_no_peer_cert; + // Servers get to accept connections without peer certs as "untrusted" clients + if (loaded.getEndpointType() == TLSEndpointType::SERVER) + verifyFailIfNoPeerCert = 0; + context.set_verify_mode(boost::asio::ssl::context::verify_peer | verifyFailIfNoPeerCert); - context->set_password_callback([password = loaded.getPassword()]( - size_t, boost::asio::ssl::context::password_purpose) { return password; }); + context.set_password_callback([password = loaded.getPassword()]( + size_t, boost::asio::ssl::context::password_purpose) { return password; }); const std::string& CABytes = loaded.getCABytes(); if (CABytes.size()) { - context->add_certificate_authority(boost::asio::buffer(CABytes.data(), CABytes.size())); + context.add_certificate_authority(boost::asio::buffer(CABytes.data(), CABytes.size())); } const std::string& keyBytes = loaded.getKeyBytes(); if (keyBytes.size()) { - context->use_private_key(boost::asio::buffer(keyBytes.data(), keyBytes.size()), - boost::asio::ssl::context::pem); + context.use_private_key(boost::asio::buffer(keyBytes.data(), keyBytes.size()), + boost::asio::ssl::context::pem); } const std::string& certBytes = loaded.getCertificateBytes(); if (certBytes.size()) { - context->use_certificate_chain(boost::asio::buffer(certBytes.data(), certBytes.size())); + context.use_certificate_chain(boost::asio::buffer(certBytes.data(), certBytes.size())); } } catch (boost::system::system_error& e) { - TraceEvent("TLSConfigureError") + TraceEvent("TLSContextConfigureError") + .detail("What", e.what()) + .detail("Value", e.code().value()) + .detail("WhichMeans", TLSPolicy::ErrorString(e.code())); + throw tls_error(); + } +} + +void ConfigureSSLStream(Reference policy, + boost::asio::ssl::stream& stream, + std::function callback) { + try { + stream.set_verify_callback([policy, callback](bool preverified, boost::asio::ssl::verify_context& ctx) { + bool success = policy->verify_peer(preverified, ctx.native_handle()); + if (!success) { + if (policy->on_failure) + policy->on_failure(); + } + if (callback) + callback(success); + return success; + }); + } catch (boost::system::system_error& e) { + TraceEvent("TLSStreamConfigureError") .detail("What", e.what()) .detail("Value", e.code().value()) .detail("WhichMeans", TLSPolicy::ErrorString(e.code())); @@ -182,11 +175,7 @@ std::string TLSConfig::getCertificatePathSync() const { return envCertPath; } - const char* defaultCertFileName = "fdb.pem"; - if (fileExists(defaultCertFileName)) { - return defaultCertFileName; - } - + const char* defaultCertFileName = "cert.pem"; if (fileExists(joinPath(platform::getDefaultConfigPath(), defaultCertFileName))) { return joinPath(platform::getDefaultConfigPath(), defaultCertFileName); } @@ -204,13 +193,9 @@ std::string TLSConfig::getKeyPathSync() const { return envKeyPath; } - const char* defaultCertFileName = "fdb.pem"; - if (fileExists(defaultCertFileName)) { - return defaultCertFileName; - } - - if (fileExists(joinPath(platform::getDefaultConfigPath(), defaultCertFileName))) { - return joinPath(platform::getDefaultConfigPath(), defaultCertFileName); + const char* defaultKeyFileName = "key.pem"; + if (fileExists(joinPath(platform::getDefaultConfigPath(), defaultKeyFileName))) { + return joinPath(platform::getDefaultConfigPath(), defaultKeyFileName); } return std::string(); @@ -234,7 +219,7 @@ LoadedTLSConfig TLSConfig::loadSync() const { try { loaded.tlsCertBytes = readFileBytes(certPath, FLOW_KNOBS->CERT_FILE_MAX_SIZE); } catch (Error& e) { - fprintf(stderr, "Error reading TLS Certificate [%s]: %s\n", certPath.c_str(), e.what()); + fprintf(stderr, "Warning: Error reading TLS Certificate [%s]: %s\n", certPath.c_str(), e.what()); throw; } } else { @@ -246,7 +231,7 @@ LoadedTLSConfig TLSConfig::loadSync() const { try { loaded.tlsKeyBytes = readFileBytes(keyPath, FLOW_KNOBS->CERT_FILE_MAX_SIZE); } catch (Error& e) { - fprintf(stderr, "Error reading TLS Key [%s]: %s\n", keyPath.c_str(), e.what()); + fprintf(stderr, "Warning: Error reading TLS Key [%s]: %s\n", keyPath.c_str(), e.what()); throw; } } else { @@ -258,7 +243,7 @@ LoadedTLSConfig TLSConfig::loadSync() const { try { loaded.tlsCABytes = readFileBytes(CAPath, FLOW_KNOBS->CERT_FILE_MAX_SIZE); } catch (Error& e) { - fprintf(stderr, "Error reading TLS CA [%s]: %s\n", CAPath.c_str(), e.what()); + fprintf(stderr, "Warning: Error reading TLS CA [%s]: %s\n", CAPath.c_str(), e.what()); throw; } } else { @@ -272,6 +257,11 @@ LoadedTLSConfig TLSConfig::loadSync() const { return loaded; } +TLSPolicy::TLSPolicy(const LoadedTLSConfig& loaded, std::function on_failure) + : rules(), on_failure(std::move(on_failure)), is_client(loaded.getEndpointType() == TLSEndpointType::CLIENT) { + set_verify_peers(loaded.getVerifyPeers()); +} + // And now do the same thing, but async... ACTOR static Future readEntireFile(std::string filename, std::string* destination) { @@ -322,13 +312,13 @@ ACTOR Future TLSConfig::loadAsync(const TLSConfig* self) { wait(waitForAll(reads)); } catch (Error& e) { if (certIdx != -1 && reads[certIdx].isError()) { - fprintf(stderr, "Failure reading TLS Certificate [%s]: %s\n", certPath.c_str(), e.what()); + fprintf(stderr, "Warning: Error reading TLS Certificate [%s]: %s\n", certPath.c_str(), e.what()); } else if (keyIdx != -1 && reads[keyIdx].isError()) { - fprintf(stderr, "Failure reading TLS Key [%s]: %s\n", keyPath.c_str(), e.what()); + fprintf(stderr, "Warning: Error reading TLS Key [%s]: %s\n", keyPath.c_str(), e.what()); } else if (caIdx != -1 && reads[caIdx].isError()) { - fprintf(stderr, "Failure reading TLS Key [%s]: %s\n", CAPath.c_str(), e.what()); + fprintf(stderr, "Warning: Error reading TLS Key [%s]: %s\n", CAPath.c_str(), e.what()); } else { - fprintf(stderr, "Failure reading TLS needed file: %s\n", e.what()); + fprintf(stderr, "Warning: Error reading TLS needed file: %s\n", e.what()); } throw; @@ -834,4 +824,3 @@ bool TLSPolicy::verify_peer(bool preverified, X509_STORE_CTX* store_ctx) { } return rc; } -#endif diff --git a/src/flow/TLSConfig.actor.g.cpp b/src/flow/TLSConfig.actor.g.cpp index 573f61f..afcc3bb 100644 --- a/src/flow/TLSConfig.actor.g.cpp +++ b/src/flow/TLSConfig.actor.g.cpp @@ -27,14 +27,6 @@ // To force typeinfo to only be emitted once. TLSPolicy::~TLSPolicy() {} -#ifdef TLS_DISABLED - -void LoadedTLSConfig::print(FILE* fp) { - fprintf(fp, "Cannot print LoadedTLSConfig. TLS support is not enabled.\n"); -} - -#else // TLS is enabled - #include #include #include @@ -53,14 +45,8 @@ void LoadedTLSConfig::print(FILE* fp) { #include #include -// This include breaks module dependencies, but we need to do async file reads. -// So either we include fdbrpc here, or this file is moved to fdbrpc/, and then -// Net2, which depends on us, includes fdbrpc/. -// -// Either way, the only way to break this dependency cycle is to move all of -// AsyncFile to flow/ -#include "fdbrpc/IAsyncFile.h" #include "flow/Platform.h" +#include "flow/IAsyncFile.h" #include "flow/FastRef.h" #include "flow/Trace.h" @@ -94,7 +80,7 @@ void LoadedTLSConfig::print(FILE* fp) { int num_certs = 0; boost::asio::ssl::context context(boost::asio::ssl::context::tls); try { - ConfigureSSLContext(*this, &context); + ConfigureSSLContext(*this, context); } catch (Error& e) { fprintf(fp, "There was an error in loading the certificate chain.\n"); throw; @@ -122,51 +108,58 @@ void LoadedTLSConfig::print(FILE* fp) { X509_STORE_CTX_free(store_ctx); } -void ConfigureSSLContext(const LoadedTLSConfig& loaded, - boost::asio::ssl::context* context, - std::function onPolicyFailure) { +void ConfigureSSLContext(const LoadedTLSConfig& loaded, boost::asio::ssl::context& context) { try { - context->set_options(boost::asio::ssl::context::default_workarounds); - context->set_verify_mode(boost::asio::ssl::context::verify_peer | - boost::asio::ssl::verify_fail_if_no_peer_cert); - - if (loaded.isTLSEnabled()) { - auto tlsPolicy = makeReference(loaded.getEndpointType()); - tlsPolicy->set_verify_peers({ loaded.getVerifyPeers() }); - - context->set_verify_callback( - [policy = tlsPolicy, onPolicyFailure](bool preverified, boost::asio::ssl::verify_context& ctx) { - bool success = policy->verify_peer(preverified, ctx.native_handle()); - if (!success) { - onPolicyFailure(); - } - return success; - }); - } else { - // Insecurely always except if TLS is not enabled. - context->set_verify_callback([](bool, boost::asio::ssl::verify_context&) { return true; }); - } + context.set_options(boost::asio::ssl::context::default_workarounds); + auto verifyFailIfNoPeerCert = boost::asio::ssl::verify_fail_if_no_peer_cert; + // Servers get to accept connections without peer certs as "untrusted" clients + if (loaded.getEndpointType() == TLSEndpointType::SERVER) + verifyFailIfNoPeerCert = 0; + context.set_verify_mode(boost::asio::ssl::context::verify_peer | verifyFailIfNoPeerCert); - context->set_password_callback([password = loaded.getPassword()]( - size_t, boost::asio::ssl::context::password_purpose) { return password; }); + context.set_password_callback([password = loaded.getPassword()]( + size_t, boost::asio::ssl::context::password_purpose) { return password; }); const std::string& CABytes = loaded.getCABytes(); if (CABytes.size()) { - context->add_certificate_authority(boost::asio::buffer(CABytes.data(), CABytes.size())); + context.add_certificate_authority(boost::asio::buffer(CABytes.data(), CABytes.size())); } const std::string& keyBytes = loaded.getKeyBytes(); if (keyBytes.size()) { - context->use_private_key(boost::asio::buffer(keyBytes.data(), keyBytes.size()), - boost::asio::ssl::context::pem); + context.use_private_key(boost::asio::buffer(keyBytes.data(), keyBytes.size()), + boost::asio::ssl::context::pem); } const std::string& certBytes = loaded.getCertificateBytes(); if (certBytes.size()) { - context->use_certificate_chain(boost::asio::buffer(certBytes.data(), certBytes.size())); + context.use_certificate_chain(boost::asio::buffer(certBytes.data(), certBytes.size())); } } catch (boost::system::system_error& e) { - TraceEvent("TLSConfigureError") + TraceEvent("TLSContextConfigureError") + .detail("What", e.what()) + .detail("Value", e.code().value()) + .detail("WhichMeans", TLSPolicy::ErrorString(e.code())); + throw tls_error(); + } +} + +void ConfigureSSLStream(Reference policy, + boost::asio::ssl::stream& stream, + std::function callback) { + try { + stream.set_verify_callback([policy, callback](bool preverified, boost::asio::ssl::verify_context& ctx) { + bool success = policy->verify_peer(preverified, ctx.native_handle()); + if (!success) { + if (policy->on_failure) + policy->on_failure(); + } + if (callback) + callback(success); + return success; + }); + } catch (boost::system::system_error& e) { + TraceEvent("TLSStreamConfigureError") .detail("What", e.what()) .detail("Value", e.code().value()) .detail("WhichMeans", TLSPolicy::ErrorString(e.code())); @@ -184,11 +177,7 @@ std::string TLSConfig::getCertificatePathSync() const { return envCertPath; } - const char* defaultCertFileName = "fdb.pem"; - if (fileExists(defaultCertFileName)) { - return defaultCertFileName; - } - + const char* defaultCertFileName = "cert.pem"; if (fileExists(joinPath(platform::getDefaultConfigPath(), defaultCertFileName))) { return joinPath(platform::getDefaultConfigPath(), defaultCertFileName); } @@ -206,13 +195,9 @@ std::string TLSConfig::getKeyPathSync() const { return envKeyPath; } - const char* defaultCertFileName = "fdb.pem"; - if (fileExists(defaultCertFileName)) { - return defaultCertFileName; - } - - if (fileExists(joinPath(platform::getDefaultConfigPath(), defaultCertFileName))) { - return joinPath(platform::getDefaultConfigPath(), defaultCertFileName); + const char* defaultKeyFileName = "key.pem"; + if (fileExists(joinPath(platform::getDefaultConfigPath(), defaultKeyFileName))) { + return joinPath(platform::getDefaultConfigPath(), defaultKeyFileName); } return std::string(); @@ -236,7 +221,7 @@ LoadedTLSConfig TLSConfig::loadSync() const { try { loaded.tlsCertBytes = readFileBytes(certPath, FLOW_KNOBS->CERT_FILE_MAX_SIZE); } catch (Error& e) { - fprintf(stderr, "Error reading TLS Certificate [%s]: %s\n", certPath.c_str(), e.what()); + fprintf(stderr, "Warning: Error reading TLS Certificate [%s]: %s\n", certPath.c_str(), e.what()); throw; } } else { @@ -248,7 +233,7 @@ LoadedTLSConfig TLSConfig::loadSync() const { try { loaded.tlsKeyBytes = readFileBytes(keyPath, FLOW_KNOBS->CERT_FILE_MAX_SIZE); } catch (Error& e) { - fprintf(stderr, "Error reading TLS Key [%s]: %s\n", keyPath.c_str(), e.what()); + fprintf(stderr, "Warning: Error reading TLS Key [%s]: %s\n", keyPath.c_str(), e.what()); throw; } } else { @@ -260,7 +245,7 @@ LoadedTLSConfig TLSConfig::loadSync() const { try { loaded.tlsCABytes = readFileBytes(CAPath, FLOW_KNOBS->CERT_FILE_MAX_SIZE); } catch (Error& e) { - fprintf(stderr, "Error reading TLS CA [%s]: %s\n", CAPath.c_str(), e.what()); + fprintf(stderr, "Warning: Error reading TLS CA [%s]: %s\n", CAPath.c_str(), e.what()); throw; } } else { @@ -274,25 +259,30 @@ LoadedTLSConfig TLSConfig::loadSync() const { return loaded; } +TLSPolicy::TLSPolicy(const LoadedTLSConfig& loaded, std::function on_failure) + : rules(), on_failure(std::move(on_failure)), is_client(loaded.getEndpointType() == TLSEndpointType::CLIENT) { + set_verify_peers(loaded.getVerifyPeers()); +} + // And now do the same thing, but async... - #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" namespace { // This generated class is to be used only via readEntireFile() - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" template - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" class ReadEntireFileActorState { - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" public: - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" ReadEntireFileActorState(std::string const& filename,std::string* const& destination) - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" : filename(filename), - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" destination(destination) - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" { fdb_probe_actor_create("readEntireFile", reinterpret_cast(this)); @@ -305,16 +295,16 @@ class ReadEntireFileActorState { int a_body1(int loopDepth=0) { try { - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" StrictFuture> __when_expr_0 = IAsyncFileSystem::filesystem()->open(filename, IAsyncFile::OPEN_READONLY | IAsyncFile::OPEN_UNCACHED, 0); - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -335,25 +325,25 @@ class ReadEntireFileActorState { } int a_body1cont1(int loopDepth) { - #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" StrictFuture __when_expr_1 = file->size(); - #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 342 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 332 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 347 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1when1(Reference const& __file,int loopDepth) { - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" file = __file; - #line 356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 346 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); return loopDepth; @@ -418,35 +408,35 @@ class ReadEntireFileActorState { } int a_body1cont2(int loopDepth) { - #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" if (filesize > FLOW_KNOBS->CERT_FILE_MAX_SIZE) - #line 423 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 413 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" { - #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" return a_body1Catch1(file_too_large(), loopDepth); - #line 427 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 417 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" } - #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" destination->resize(filesize); - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" StrictFuture __when_expr_2 = success(file->read(&((*destination)[0]), filesize, 0)); - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 425 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont2when1(__when_expr_2.get(), loopDepth); }; static_cast(this)->actor_wait_state = 3; - #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 430 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1when1(int64_t const& __filesize,int loopDepth) { - #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" filesize = __filesize; - #line 449 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" loopDepth = a_body1cont2(loopDepth); return loopDepth; @@ -511,9 +501,9 @@ class ReadEntireFileActorState { } int a_body1cont3(Void const& _,int loopDepth) { - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReadEntireFileActorState(); static_cast(this)->destroy(); return 0; } - #line 516 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 506 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ReadEntireFileActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -523,9 +513,9 @@ class ReadEntireFileActorState { } int a_body1cont3(Void && _,int loopDepth) { - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReadEntireFileActorState(); static_cast(this)->destroy(); return 0; } - #line 528 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 518 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ReadEntireFileActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -596,20 +586,20 @@ class ReadEntireFileActorState { fdb_probe_actor_exit("readEntireFile", reinterpret_cast(this), 2); } - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" std::string filename; - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" std::string* destination; - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" Reference file; - #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" int64_t filesize; - #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" }; // This generated class is to be used only via readEntireFile() - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" class ReadEntireFileActor final : public Actor, public ActorCallback< ReadEntireFileActor, 0, Reference >, public ActorCallback< ReadEntireFileActor, 1, int64_t >, public ActorCallback< ReadEntireFileActor, 2, Void >, public FastAllocated, public ReadEntireFileActorState { - #line 612 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -620,9 +610,9 @@ class ReadEntireFileActor final : public Actor, public ActorCallback< Read friend struct ActorCallback< ReadEntireFileActor, 0, Reference >; friend struct ActorCallback< ReadEntireFileActor, 1, int64_t >; friend struct ActorCallback< ReadEntireFileActor, 2, Void >; - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" ReadEntireFileActor(std::string const& filename,std::string* const& destination) - #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" : Actor(), ReadEntireFileActorState(filename, destination) { @@ -648,41 +638,41 @@ friend struct ActorCallback< ReadEntireFileActor, 2, Void >; } }; } - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" [[nodiscard]] static Future readEntireFile( std::string const& filename, std::string* const& destination ) { - #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" return Future(new ReadEntireFileActor(filename, destination)); - #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" } -#line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" +#line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 650 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" // This generated class is to be used only via loadAsync() - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" template - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" class TLSConfig_LoadAsyncActorState { - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" public: - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" TLSConfig_LoadAsyncActorState(const TLSConfig* const& self) - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" : self(self), - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" loaded(), - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" reads(), - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" certIdx(-1), - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" keyIdx(-1), - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" caIdx(-1), - #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" certPath(self->getCertificatePathSync()) - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" { fdb_probe_actor_create("loadAsync", reinterpret_cast(this)); @@ -695,69 +685,69 @@ class TLSConfig_LoadAsyncActorState { int a_body1(int loopDepth=0) { try { - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" if (certPath.size()) - #line 700 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" { - #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" reads.push_back(readEntireFile(certPath, &loaded.tlsCertBytes)); - #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" certIdx = reads.size() - 1; - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 696 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" } else { - #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" loaded.tlsCertBytes = self->tlsCertBytes; - #line 712 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" } - #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" keyPath = self->getKeyPathSync(); - #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" if (keyPath.size()) - #line 718 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" { - #line 307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" reads.push_back(readEntireFile(keyPath, &loaded.tlsKeyBytes)); - #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" keyIdx = reads.size() - 1; - #line 724 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 714 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" } else { - #line 310 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" loaded.tlsKeyBytes = self->tlsKeyBytes; - #line 730 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 720 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" } - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" CAPath = self->getCAPathSync(); - #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 304 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" if (CAPath.size()) - #line 736 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 726 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" { - #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" reads.push_back(readEntireFile(CAPath, &loaded.tlsCABytes)); - #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 306 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" caIdx = reads.size() - 1; - #line 742 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 732 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" } else { - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 308 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" loaded.tlsCABytes = self->tlsCABytes; - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 738 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" } try { - #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" StrictFuture __when_expr_0 = waitForAll(reads); - #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 322 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -784,15 +774,15 @@ class TLSConfig_LoadAsyncActorState { } int a_body1cont1(int loopDepth) { - #line 337 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" loaded.tlsPassword = self->tlsPassword; - #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" loaded.tlsVerifyPeers = self->tlsVerifyPeers; - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" loaded.endpointType = self->endpointType; - #line 341 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(loaded); this->~TLSConfig_LoadAsyncActorState(); static_cast(this)->destroy(); return 0; } - #line 795 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" new (&static_cast(this)->SAV< LoadedTLSConfig >::value()) LoadedTLSConfig(std::move(loaded)); // state_var_RVO this->~TLSConfig_LoadAsyncActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -803,45 +793,45 @@ class TLSConfig_LoadAsyncActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 314 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" if (certIdx != -1 && reads[certIdx].isError()) - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" { - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" - fprintf(stderr, "Failure reading TLS Certificate [%s]: %s\n", certPath.c_str(), e.what()); - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 315 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + fprintf(stderr, "Warning: Error reading TLS Certificate [%s]: %s\n", certPath.c_str(), e.what()); + #line 802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" } else { - #line 326 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" if (keyIdx != -1 && reads[keyIdx].isError()) - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" { - #line 327 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" - fprintf(stderr, "Failure reading TLS Key [%s]: %s\n", keyPath.c_str(), e.what()); - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + fprintf(stderr, "Warning: Error reading TLS Key [%s]: %s\n", keyPath.c_str(), e.what()); + #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" } else { - #line 328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" if (caIdx != -1 && reads[caIdx].isError()) - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" { - #line 329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" - fprintf(stderr, "Failure reading TLS Key [%s]: %s\n", CAPath.c_str(), e.what()); - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + fprintf(stderr, "Warning: Error reading TLS Key [%s]: %s\n", CAPath.c_str(), e.what()); + #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" } else { - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" - fprintf(stderr, "Failure reading TLS needed file: %s\n", e.what()); - #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 321 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + fprintf(stderr, "Warning: Error reading TLS needed file: %s\n", e.what()); + #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" } } } - #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" return a_body1Catch1(e, loopDepth); - #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 834 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); @@ -939,30 +929,30 @@ class TLSConfig_LoadAsyncActorState { return loopDepth; } - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" const TLSConfig* self; - #line 290 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 280 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" LoadedTLSConfig loaded; - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" std::vector> reads; - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" int32_t certIdx; - #line 294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" int32_t keyIdx; - #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 285 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" int32_t caIdx; - #line 297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" std::string certPath; - #line 305 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 295 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" std::string keyPath; - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" std::string CAPath; - #line 960 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 950 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" }; // This generated class is to be used only via loadAsync() - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" class TLSConfig_LoadAsyncActor final : public Actor, public ActorCallback< TLSConfig_LoadAsyncActor, 0, Void >, public FastAllocated, public TLSConfig_LoadAsyncActorState { - #line 965 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 955 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -971,9 +961,9 @@ class TLSConfig_LoadAsyncActor final : public Actor, public Act void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< TLSConfig_LoadAsyncActor, 0, Void >; - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" TLSConfig_LoadAsyncActor(const TLSConfig* const& self) - #line 976 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" : Actor(), TLSConfig_LoadAsyncActorState(self) { @@ -996,14 +986,14 @@ friend struct ActorCallback< TLSConfig_LoadAsyncActor, 0, Void >; } }; - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" [[nodiscard]] Future TLSConfig::loadAsync( const TLSConfig* const& self ) { - #line 289 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" + #line 279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" return Future(new TLSConfig_LoadAsyncActor(self)); - #line 1003 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" + #line 993 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.g.cpp" } -#line 343 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" +#line 333 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/TLSConfig.actor.cpp" std::string TLSPolicy::ErrorString(boost::system::error_code e) { char* str = ERR_error_string(e.value(), nullptr); @@ -1498,4 +1488,3 @@ bool TLSPolicy::verify_peer(bool preverified, X509_STORE_CTX* store_ctx) { } return rc; } -#endif diff --git a/src/flow/TLSTest.cpp b/src/flow/TLSTest.cpp new file mode 100644 index 0000000..d988dd8 --- /dev/null +++ b/src/flow/TLSTest.cpp @@ -0,0 +1,253 @@ +/* + * TLSTest.cpp + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include "flow/Arena.h" +#include "flow/MkCert.h" + +std::FILE* outp = stdout; + +template +void log(fmt::format_string fmt, Args&&... args) { + auto buf = fmt::memory_buffer{}; + fmt::format_to(std::back_inserter(buf), fmt, std::forward(args)...); + fmt::print(outp, "{}\n", std::string_view(buf.data(), buf.size())); +} + +template +void logc(fmt::format_string fmt, Args&&... args) { + auto buf = fmt::memory_buffer{}; + fmt::format_to(std::back_inserter(buf), "[CLIENT] "); + fmt::format_to(std::back_inserter(buf), fmt, std::forward(args)...); + fmt::print(outp, "{}\n", std::string_view(buf.data(), buf.size())); +} + +template +void logs(fmt::format_string fmt, Args&&... args) { + auto buf = fmt::memory_buffer{}; + fmt::format_to(std::back_inserter(buf), "[SERVER] "); + fmt::format_to(std::back_inserter(buf), fmt, std::forward(args)...); + fmt::print(outp, "{}\n", std::string_view(buf.data(), buf.size())); +} + +using namespace boost::asio; +using ip::tcp; + +using ec_type = boost::system::error_code; + +using socket_type = ssl::stream; +using work_guard_type = executor_work_guard; + +const_buffer toBuffer(StringRef s) { + ASSERT(!s.empty()); + return const_buffer(s.begin(), s.size()); +} + +void trustRootCaCert(ssl::context& ctx, StringRef certPem) { + if (!certPem.empty()) + ctx.add_certificate_authority(const_buffer(certPem.begin(), certPem.size())); +} + +void useChain(ssl::context& ctx, mkcert::CertChainRef chain) { + auto arena = Arena(); + auto chainStr = concatCertChain(arena, chain); + if (!chainStr.empty()) + ctx.use_certificate_chain(toBuffer(chainStr)); + auto keyPem = chain.front().privateKeyPem; + if (!keyPem.empty()) + ctx.use_private_key(toBuffer(keyPem), ssl::context::pem); +} + +void initCerts(ssl::context& ctx, mkcert::CertChainRef myChain, StringRef peerRootPem) { + trustRootCaCert(ctx, peerRootPem); + if (myChain.size() > 1) + myChain.pop_back(); + if (!myChain.empty()) + useChain(ctx, myChain); +} + +void initSslContext(ssl::context& ctx, + mkcert::CertChainRef myChain, + mkcert::CertChainRef peerChain, + mkcert::ESide side) { + ctx.set_options(ssl::context::default_workarounds); + ctx.set_verify_mode(ssl::context::verify_peer | + (side == mkcert::ESide::Server ? 0 : ssl::verify_fail_if_no_peer_cert)); + initCerts(ctx, myChain, peerChain.empty() ? StringRef() : peerChain.back().certPem); +} + +template <> +struct fmt::formatter { + constexpr auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) { return ctx.begin(); } + + template + auto format(const tcp::endpoint& ep, FormatContext& ctx) -> decltype(ctx.out()) { + return fmt::format_to(ctx.out(), "{}:{}", ep.address().to_string(), ep.port()); + } +}; + +void runTlsTest(int serverChainLen, int clientChainLen) { + log("==== BEGIN TESTCASE ===="); + auto clientSsl = ssl::context(ssl::context::tls); + auto serverSsl = ssl::context(ssl::context::tls); + auto const expectHandshakeOk = clientChainLen >= 0 && serverChainLen > 0; + auto const expectTrusted = clientChainLen != 0; + log("cert chain length: server {}, client {}", serverChainLen, clientChainLen); + auto arena = Arena(); + auto serverChain = mkcert::CertChainRef{}; + auto clientChain = mkcert::CertChainRef{}; + if (serverChainLen) { + auto tmpArena = Arena(); + auto specs = mkcert::makeCertChainSpec(tmpArena, std::labs(serverChainLen), mkcert::ESide::Server); + if (serverChainLen < 0) { + specs[0].offsetNotBefore = -60l * 60 * 24 * 365; + specs[0].offsetNotAfter = -10l; // cert that expired 10 seconds ago + } + serverChain = mkcert::makeCertChain(arena, specs, {} /* create root CA cert from spec*/); + } + if (clientChainLen) { + auto tmpArena = Arena(); + auto specs = mkcert::makeCertChainSpec(tmpArena, std::labs(clientChainLen), mkcert::ESide::Client); + if (clientChainLen < 0) { + specs[0].offsetNotBefore = -60l * 60 * 24 * 365; + specs[0].offsetNotAfter = -10l; // cert that expired 10 seconds ago + } + clientChain = mkcert::makeCertChain(arena, specs, {} /* create root CA cert from spec*/); + } + initSslContext(clientSsl, clientChain, serverChain, mkcert::ESide::Client); + log("client SSL contexts initialized"); + initSslContext(serverSsl, serverChain, clientChain, mkcert::ESide::Server); + log("server SSL contexts initialized"); + auto io = io_context(); + auto serverWorkGuard = work_guard_type(io.get_executor()); + auto clientWorkGuard = work_guard_type(io.get_executor()); + auto const ip = ip::address::from_string("127.0.0.1"); + auto acceptor = tcp::acceptor(io, tcp::endpoint(ip, 0)); + auto const serverAddr = acceptor.local_endpoint(); + logs("server listening at {}", serverAddr); + auto serverSock = tcp::socket(io); + auto serverSslSock = socket_type(serverSock, serverSsl); + enum class ESockState { AssumedUntrusted, Trusted }; + auto serverSockState = ESockState::AssumedUntrusted; + auto clientSockState = ESockState::AssumedUntrusted; + auto handshakeOk = true; + serverSslSock.set_verify_callback([&serverSockState, &handshakeOk](bool preverify, ssl::verify_context&) { + logs("client preverify: {}", preverify); + switch (serverSockState) { + case ESockState::AssumedUntrusted: + if (!preverify) + return handshakeOk = false; + serverSockState = ESockState::Trusted; + break; + case ESockState::Trusted: + if (!preverify) + return handshakeOk = false; + break; + default: + break; + } + // if untrusted connection passes preverify, they are considered trusted + return true; + }); + acceptor.async_accept(serverSock, [&serverSslSock, &serverWorkGuard, &handshakeOk](const ec_type& ec) { + if (ec) { + logs("accept error: {}", ec.message()); + handshakeOk = false; + serverWorkGuard.reset(); + } else { + logs("accepted connection from {}", serverSslSock.next_layer().remote_endpoint()); + serverSslSock.async_handshake(ssl::stream_base::handshake_type::server, + [&serverWorkGuard, &handshakeOk](const ec_type& ec) { + if (ec) { + logs("server handshake returned {}", ec.message()); + handshakeOk = false; + } else { + logs("handshake OK"); + } + serverWorkGuard.reset(); + }); + } + }); + auto clientSock = tcp::socket(io); + auto clientSslSock = socket_type(clientSock, clientSsl); + clientSslSock.set_verify_callback([&clientSockState](bool preverify, ssl::verify_context&) { + logc("server preverify: {}", preverify); + switch (clientSockState) { + case ESockState::AssumedUntrusted: + if (!preverify) + return false; + clientSockState = ESockState::Trusted; + break; + case ESockState::Trusted: + if (!preverify) + return false; + break; + default: + break; + } + // if untrusted connection passes preverify, they are considered trusted + return true; + }); + clientSock.async_connect(serverAddr, + [&clientWorkGuard, &clientSock, &clientSslSock, &handshakeOk](const ec_type& ec) { + if (ec) { + logc("connect error: {}", ec.message()); + handshakeOk = false; + clientWorkGuard.reset(); + } else { + logc("connected to {}", clientSock.remote_endpoint()); + clientSslSock.async_handshake(ssl::stream_base::handshake_type::client, + [&clientWorkGuard, &handshakeOk](const ec_type& ec) { + if (ec) { + logc("handshake returned: {}", ec.message()); + handshakeOk = false; + } else { + logc("handshake OK"); + } + clientWorkGuard.reset(); + }); + } + }); + io.run(); + ASSERT_EQ(expectHandshakeOk, handshakeOk); + if (expectHandshakeOk) { + ASSERT_EQ(expectTrusted, (serverSockState == ESockState::Trusted)); + log("Test OK: Handshake passed and connection {} as expected", + serverSockState == ESockState::Trusted ? "trusted" : "untrusted"); + } else { + log("Test OK: Handshake failed as expected"); + } +} + +int main() { + std::pair inputs[] = { { 3, 2 }, { 4, 0 }, { -3, 1 }, { 3, -2 }, { -3, 0 }, + { 0, 0 }, { 0, 1 }, { 1, 3 }, { -1, -3 }, { 1, 0 } }; + for (auto input : inputs) { + auto [serverChainLen, clientChainLen] = input; + runTlsTest(serverChainLen, clientChainLen); + } + return 0; +} diff --git a/src/flow/ThreadHelper.actor.cpp b/src/flow/ThreadHelper.actor.cpp index 5b5cf83..454de9d 100644 --- a/src/flow/ThreadHelper.actor.cpp +++ b/src/flow/ThreadHelper.actor.cpp @@ -19,6 +19,7 @@ */ #include +#include #include "flow/flow.h" #include "flow/network.h" diff --git a/src/flow/ThreadHelper.actor.g.cpp b/src/flow/ThreadHelper.actor.g.cpp index 50fb011..b83e88e 100644 --- a/src/flow/ThreadHelper.actor.g.cpp +++ b/src/flow/ThreadHelper.actor.g.cpp @@ -21,6 +21,7 @@ */ #include +#include #include "flow/flow.h" #include "flow/network.h" @@ -47,61 +48,61 @@ struct ThreadFutureCancelObj { }; // This unit test should be running with TSAN enabled binary - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase48() - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" -template - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" -class FlowTestCase48ActorState { - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" +// This generated class is to be used only via flowTestCase49() + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" +template + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" +class FlowTestCase49ActorState { + #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" public: - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - FlowTestCase48ActorState(UnitTestParameters const& params) - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + FlowTestCase49ActorState(UnitTestParameters const& params) + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" : params(params) - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase48", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase49", reinterpret_cast(this)); } - ~FlowTestCase48ActorState() + ~FlowTestCase49ActorState() { - fdb_probe_actor_destroy("flowTestCase48", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase49", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 50 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" if (g_network->isSimulated()) - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" { - #line 51 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase48ActorState(); static_cast(this)->destroy(); return 0; } - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase48ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase49ActorState(); static_cast(this)->destroy(); return 0; } + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase49ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 52 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - auto* tsav = new ThreadSingleAssignmentVar; #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - thread = std::thread{ ThreadFutureSendObj{ tsav } }; + auto* tsav = new ThreadSingleAssignmentVar; #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + thread = std::thread{ ThreadFutureSendObj{ tsav } }; + #line 55 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" ThreadFuture f(tsav); - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" StrictFuture __when_expr_0 = safeThreadFutureToFuture(f); - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 99 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 56 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 104 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -114,36 +115,36 @@ class FlowTestCase48ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase48ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase49ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(Void const& _,int loopDepth) { - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - thread.join(); #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase48ActorState(); static_cast(this)->destroy(); return 0; } - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase48ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + thread.join(); + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase49ActorState(); static_cast(this)->destroy(); return 0; } + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase49ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 57 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - thread.join(); #line 58 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase48ActorState(); static_cast(this)->destroy(); return 0; } - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase48ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + thread.join(); + #line 59 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase49ActorState(); static_cast(this)->destroy(); return 0; } + #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase49ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -162,13 +163,13 @@ class FlowTestCase48ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase48Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase49Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase48Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase49Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase48", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase49", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -178,12 +179,12 @@ class FlowTestCase48ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase48", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase49", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase48Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase49Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase48", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase49", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -193,12 +194,12 @@ class FlowTestCase48ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase48", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase49", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase48Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase49Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase48", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase49", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -208,40 +209,40 @@ class FlowTestCase48ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase48", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase49", reinterpret_cast(this), 0); } - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" UnitTestParameters params; - #line 53 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 54 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" std::thread thread; - #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase48() - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" -class FlowTestCase48Actor final : public Actor, public ActorCallback< FlowTestCase48Actor, 0, Void >, public FastAllocated, public FlowTestCase48ActorState { - #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" +// This generated class is to be used only via flowTestCase49() + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" +class FlowTestCase49Actor final : public Actor, public ActorCallback< FlowTestCase49Actor, 0, Void >, public FastAllocated, public FlowTestCase49ActorState { + #line 224 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase48Actor, 0, Void >; - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - FlowTestCase48Actor(UnitTestParameters const& params) - #line 234 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" +friend struct ActorCallback< FlowTestCase49Actor, 0, Void >; + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + FlowTestCase49Actor(UnitTestParameters const& params) + #line 235 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" : Actor(), - FlowTestCase48ActorState(params) + FlowTestCase49ActorState(params) { - fdb_probe_actor_enter("flowTestCase48", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase49", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase48"); + this->lineage.setActorName("flowTestCase49"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase48", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase49", reinterpret_cast(this), -1); } void cancel() override @@ -249,78 +250,78 @@ friend struct ActorCallback< FlowTestCase48Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase48Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase49Actor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" -static Future flowTestCase48( UnitTestParameters const& params ) { - #line 48 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - return Future(new FlowTestCase48Actor(params)); - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" +static Future flowTestCase49( UnitTestParameters const& params ) { + #line 49 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + return Future(new FlowTestCase49Actor(params)); + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase48, "/flow/safeThreadFutureToFuture/Send") +ACTOR_TEST_CASE(flowTestCase49, "/flow/safeThreadFutureToFuture/Send") -#line 60 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" +#line 61 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" // Test the case where the underlying threadFuture is cancelled - #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase62() - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" -template - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" -class FlowTestCase62ActorState { - #line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" +// This generated class is to be used only via flowTestCase63() + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" +template + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" +class FlowTestCase63ActorState { + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" public: - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - FlowTestCase62ActorState(UnitTestParameters const& params) - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + FlowTestCase63ActorState(UnitTestParameters const& params) + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" : params(params) - #line 283 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 284 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase62", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase63", reinterpret_cast(this)); } - ~FlowTestCase62ActorState() + ~FlowTestCase63ActorState() { - fdb_probe_actor_destroy("flowTestCase62", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase63", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 64 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" if (g_network->isSimulated()) - #line 298 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" { - #line 65 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase62ActorState(); static_cast(this)->destroy(); return 0; } - #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase62ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase63ActorState(); static_cast(this)->destroy(); return 0; } + #line 303 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase63ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 66 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - ThreadFuture f = onMainThread([]() -> Future { return Never(); }); #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + ThreadFuture f = onMainThread([]() -> Future { return Never(); }); + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" thread = std::thread{ ThreadFutureCancelObj(f) }; - #line 312 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" try { - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" StrictFuture __when_expr_0 = safeThreadFutureToFuture(f); - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); - #line 318 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch2(actor_cancelled(), loopDepth); + #line 319 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch2(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 69 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 323 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -339,22 +340,22 @@ class FlowTestCase62ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase62ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase63ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(int loopDepth) { - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - thread.join(); #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase62ActorState(); static_cast(this)->destroy(); return 0; } - #line 354 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase62ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + thread.join(); + #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase63ActorState(); static_cast(this)->destroy(); return 0; } + #line 355 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase63ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -362,9 +363,9 @@ class FlowTestCase62ActorState { int a_body1Catch2(const Error& e,int loopDepth=0) { try { - #line 72 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" ASSERT(e.code() == error_code_actor_cancelled); - #line 367 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 368 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" loopDepth = a_body1cont1(loopDepth); } catch (Error& error) { @@ -377,18 +378,18 @@ class FlowTestCase62ActorState { } int a_body1cont3(Void const& _,int loopDepth) { - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" ASSERT(false); - #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" loopDepth = a_body1cont5(loopDepth); return loopDepth; } int a_body1cont3(Void && _,int loopDepth) { - #line 70 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 71 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" ASSERT(false); - #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" loopDepth = a_body1cont5(loopDepth); return loopDepth; @@ -407,13 +408,13 @@ class FlowTestCase62ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase62Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase63Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase62Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase63Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase62", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase63", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -423,12 +424,12 @@ class FlowTestCase62ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase62", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase63", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase62Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase63Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase62", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase63", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -438,12 +439,12 @@ class FlowTestCase62ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase62", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase63", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase62Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase63Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase62", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase63", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch2(err, 0); @@ -453,7 +454,7 @@ class FlowTestCase62ActorState { } catch (...) { a_body1Catch2(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase62", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase63", reinterpret_cast(this), 0); } int a_body1cont5(int loopDepth) @@ -469,37 +470,37 @@ class FlowTestCase62ActorState { return loopDepth; } - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" UnitTestParameters params; - #line 67 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + #line 68 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" std::thread thread; - #line 476 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase62() - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" -class FlowTestCase62Actor final : public Actor, public ActorCallback< FlowTestCase62Actor, 0, Void >, public FastAllocated, public FlowTestCase62ActorState { - #line 481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" +// This generated class is to be used only via flowTestCase63() + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" +class FlowTestCase63Actor final : public Actor, public ActorCallback< FlowTestCase63Actor, 0, Void >, public FastAllocated, public FlowTestCase63ActorState { + #line 482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase62Actor, 0, Void >; - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - FlowTestCase62Actor(UnitTestParameters const& params) - #line 492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" +friend struct ActorCallback< FlowTestCase63Actor, 0, Void >; + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + FlowTestCase63Actor(UnitTestParameters const& params) + #line 493 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" : Actor(), - FlowTestCase62ActorState(params) + FlowTestCase63ActorState(params) { - fdb_probe_actor_enter("flowTestCase62", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase63", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase62"); + this->lineage.setActorName("flowTestCase63"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase62", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase63", reinterpret_cast(this), -1); } void cancel() override @@ -507,18 +508,18 @@ friend struct ActorCallback< FlowTestCase62Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase62Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase63Actor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" -static Future flowTestCase62( UnitTestParameters const& params ) { - #line 62 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" - return Future(new FlowTestCase62Actor(params)); - #line 520 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" +static Future flowTestCase63( UnitTestParameters const& params ) { + #line 63 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" + return Future(new FlowTestCase63Actor(params)); + #line 521 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase62, "/flow/safeThreadFutureToFuture/Cancel") +ACTOR_TEST_CASE(flowTestCase63, "/flow/safeThreadFutureToFuture/Cancel") -#line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" +#line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/ThreadHelper.actor.cpp" diff --git a/src/flow/ThreadPrimitives.cpp b/src/flow/ThreadPrimitives.cpp index f87dc27..21b64e0 100644 --- a/src/flow/ThreadPrimitives.cpp +++ b/src/flow/ThreadPrimitives.cpp @@ -34,67 +34,16 @@ extern std::string format(const char* form, ...); -Event::Event() { -#ifdef _WIN32 - ev = CreateEvent(nullptr, FALSE, FALSE, nullptr); -#elif defined(__linux__) || defined(__FreeBSD__) - int result = sem_init(&sem, 0, 0); - if (result) - criticalError(FDB_EXIT_INIT_SEMAPHORE, - "UnableToInitializeSemaphore", - format("Could not initialize semaphore - %s", strerror(errno)).c_str()); -#elif defined(__APPLE__) - self = mach_task_self(); - kern_return_t ret = semaphore_create(self, &sem, SYNC_POLICY_FIFO, 0); - if (ret != KERN_SUCCESS) - criticalError(FDB_EXIT_INIT_SEMAPHORE, - "UnableToInitializeSemaphore", - format("Could not initialize semaphore - %s", strerror(errno)).c_str()); -#else -#error Port me! -#endif -} +Event::Event() = default; -Event::~Event() { -#ifdef _WIN32 - CloseHandle(ev); -#elif defined(__linux__) || defined(__FreeBSD__) - sem_destroy(&sem); -#elif defined(__APPLE__) - semaphore_destroy(self, sem); -#else -#error Port me! -#endif -} +Event::~Event() = default; void Event::set() { -#ifdef _WIN32 - SetEvent(ev); -#elif defined(__linux__) || defined(__FreeBSD__) - sem_post(&sem); -#elif defined(__APPLE__) - semaphore_signal(sem); -#else -#error Port me! -#endif + latch.count_down(); } void Event::block() { -#ifdef _WIN32 - WaitForSingleObject(ev, INFINITE); -#elif defined(__linux__) || defined(__FreeBSD__) - int ret; - do { - ret = sem_wait(&sem); - } while (ret != 0 && errno == EINTR); -#elif defined(__APPLE__) - kern_return_t ret; - do { - ret = semaphore_wait(sem); - } while ((ret != KERN_SUCCESS) && (ret != KERN_TERMINATED)); -#else -#error Port me! -#endif + latch.wait(); } // Mutex::impl is allocated from the heap so that its size doesn't need to be in the header. Is there a better way? diff --git a/src/flow/Trace.cpp b/src/flow/Trace.cpp index 63a58fe..55f63c5 100644 --- a/src/flow/Trace.cpp +++ b/src/flow/Trace.cpp @@ -25,11 +25,15 @@ #include "flow/JsonTraceLogFormatter.h" #include "flow/flow.h" #include "flow/DeterministicRandom.h" +#include "flow/ProcessEvents.h" +#include #include #include #include #include #include +#include +#include #include #include "flow/IThreadPool.h" #include "flow/ThreadHelper.actor.h" @@ -37,6 +41,8 @@ #include "flow/EventTypes.actor.h" #include "flow/TDMetric.actor.h" #include "flow/MetricSample.h" +#include "flow/network.h" +#include "flow/SimBugInjector.h" #ifdef _WIN32 #include @@ -55,6 +61,7 @@ thread_local int g_allocation_tracing_disabled = 1; unsigned tracedLines = 0; thread_local int failedLineOverflow = 0; +bool g_traceProcessEvents = false; ITraceLogIssuesReporter::~ITraceLogIssuesReporter() {} @@ -99,6 +106,7 @@ SuppressionMap suppressedEvents; static TransientThresholdMetricSample>* traceEventThrottlerCache; static const char* TRACE_EVENT_THROTTLE_STARTING_TYPE = "TraceEventThrottle_"; static const char* TRACE_EVENT_INVALID_SUPPRESSION = "InvalidSuppression_"; +static const char* TRACE_EVENT_INVALID_AUDIT_LOG_TYPE = "InvalidAuditLogType_"; static int TRACE_LOG_MAX_PREOPEN_BUFFER = 1000000; struct TraceLog { @@ -162,11 +170,12 @@ struct TraceLog { bool logTraceEventMetrics; void initMetrics() { - SevErrorNames.init(LiteralStringRef("TraceEvents.SevError")); - SevWarnAlwaysNames.init(LiteralStringRef("TraceEvents.SevWarnAlways")); - SevWarnNames.init(LiteralStringRef("TraceEvents.SevWarn")); - SevInfoNames.init(LiteralStringRef("TraceEvents.SevInfo")); - SevDebugNames.init(LiteralStringRef("TraceEvents.SevDebug")); + ASSERT(!isOpen()); + SevErrorNames.init("TraceEvents.SevError"_sr); + SevWarnAlwaysNames.init("TraceEvents.SevWarnAlways"_sr); + SevWarnNames.init("TraceEvents.SevWarn"_sr); + SevInfoNames.init("TraceEvents.SevInfo"_sr); + SevDebugNames.init("TraceEvents.SevDebug"_sr); logTraceEventMetrics = true; } @@ -254,7 +263,7 @@ struct TraceLog { double getTimeEstimate() const override { return .001; } }; void action(WriteBuffer& a) { - for (auto event : a.events) { + for (const auto& event : a.events) { event.validateFormat(); logWriter->write(formatter->formatEvent(event)); } @@ -422,9 +431,8 @@ struct TraceLog { } } - void log(int severity, const char* name, UID id, uint64_t event_ts) { - if (!logTraceEventMetrics) - return; + void logMetrics(int severity, const char* name, UID id, uint64_t event_ts) { + ASSERT(TraceEvent::isNetworkThread() && logTraceEventMetrics); EventMetricHandle* m = nullptr; switch (severity) { @@ -454,7 +462,9 @@ struct TraceLog { } ThreadFuture flush() { - traceEventThrottlerCache->poll(); + if (TraceEvent::isNetworkThread()) { + traceEventThrottlerCache->poll(); + } MutexHolder hold(mutex); bool roll = false; @@ -511,25 +521,29 @@ struct TraceLog { void close() { if (opened) { - MutexHolder hold(mutex); + try { + MutexHolder hold(mutex); - // Write remaining contents - auto a = new WriterThread::WriteBuffer(std::move(eventBuffer)); - loggedLength += bufferLength; - eventBuffer = std::vector(); - bufferLength = 0; - writer->post(a); + // Write remaining contents + auto a = new WriterThread::WriteBuffer(std::move(eventBuffer)); + loggedLength += bufferLength; + eventBuffer = std::vector(); + bufferLength = 0; + writer->post(a); - auto c = new WriterThread::Close(); - writer->post(c); + auto c = new WriterThread::Close(); + writer->post(c); - ThreadFuture f(new ThreadSingleAssignmentVar); - barriers->push(f); - writer->post(new WriterThread::Barrier); + ThreadFuture f(new ThreadSingleAssignmentVar); + barriers->push(f); + writer->post(new WriterThread::Barrier); - f.getBlocking(); + f.getBlocking(); - opened = false; + opened = false; + } catch (const std::exception& e) { + fprintf(stderr, "Error closing trace file: %s\n", e.what()); + } } } @@ -566,6 +580,21 @@ struct TraceLog { universalFields[name] = value; } + Optional getLocalAddress() { + MutexHolder holder(mutex); + return this->localAddress; + } + + void setLocalAddress(const NetworkAddress& addr) { + MutexHolder holder(mutex); + this->localAddress = addr; + } + + void disposeWriter() { + writer->addref(); + writer.clear(); + } + Future pingWriterThread() { auto ping = new WriterThread::Ping; auto f = ping->ack.getFuture(); @@ -587,7 +616,7 @@ struct TraceLog { NetworkAddress getAddressIndex() { // ahm // if( g_network->isSimulated() ) - // return g_simulator.getCurrentProcess()->address; + // return g_simulator->getCurrentProcess()->address; // else return g_network->getLocalAddress(); } @@ -745,14 +774,15 @@ void flushTraceFileVoid() { } } -void openTraceFile(const NetworkAddress& na, +void openTraceFile(const Optional& na, uint64_t rollsize, uint64_t maxLogsSize, std::string directory, std::string baseOfBase, std::string logGroup, std::string identifier, - std::string tracePartialFileSuffix) { + std::string tracePartialFileSuffix, + InitializeTraceMetrics initializeTraceMetrics) { if (g_traceLog.isOpen()) return; @@ -762,14 +792,27 @@ void openTraceFile(const NetworkAddress& na, if (baseOfBase.empty()) baseOfBase = "trace"; - std::string ip = na.ip.toString(); - std::replace(ip.begin(), ip.end(), ':', '_'); // For IPv6, Windows doesn't accept ':' in filenames. std::string baseName; - if (identifier.size() > 0) { - baseName = format("%s.%s.%s", baseOfBase.c_str(), ip.c_str(), identifier.c_str()); + if (na.present()) { + std::string ip = na.get().ip.toString(); + std::replace(ip.begin(), ip.end(), ':', '_'); // For IPv6, Windows doesn't accept ':' in filenames. + + if (!identifier.empty()) { + baseName = format("%s.%s.%s", baseOfBase.c_str(), ip.c_str(), identifier.c_str()); + } else { + baseName = format("%s.%s.%d", baseOfBase.c_str(), ip.c_str(), na.get().port); + } + } else if (!identifier.empty()) { + baseName = format("%s.0.0.0.0.%s", baseOfBase.c_str(), identifier.c_str()); } else { - baseName = format("%s.%s.%d", baseOfBase.c_str(), ip.c_str(), na.port); + // If neither network address nor identifier is provided, use PID for identification + baseName = format("%s.0.0.0.0.%d", baseOfBase.c_str(), ::getpid()); + } + + if (initializeTraceMetrics) { + g_traceLog.initMetrics(); } + g_traceLog.open(directory, baseName, logGroup, @@ -783,10 +826,6 @@ void openTraceFile(const NetworkAddress& na, g_traceBatch.dump(); } -void initTraceEventMetrics() { - g_traceLog.initMetrics(); -} - void closeTraceFile() { g_traceLog.close(); } @@ -811,13 +850,31 @@ void addUniversalTraceField(const std::string& name, const std::string& value) { g_traceLog.addUniversalTraceField(name, value); } -BaseTraceEvent::BaseTraceEvent() : initialized(true), enabled(false), logged(true) {} +bool isTraceLocalAddressSet() { + return g_traceLog.getLocalAddress().present(); +} + +void setTraceLocalAddress(const NetworkAddress& addr) { + g_traceLog.setLocalAddress(addr); +} + +void disposeTraceFileWriter() { + g_traceLog.disposeWriter(); +} + +std::string getTraceFormatExtension() { + return std::string(g_traceLog.formatter->getExtension()); +} + +BaseTraceEvent::State::State(Severity severity) noexcept + : value((g_network == nullptr || FLOW_KNOBS->MIN_TRACE_SEVERITY <= severity) ? Type::ENABLED : Type::DISABLED) {} + +BaseTraceEvent::BaseTraceEvent() : enabled(), initialized(true), logged(true) {} BaseTraceEvent::BaseTraceEvent(Severity severity, const char* type, UID id) - : initialized(false), enabled(g_network == nullptr || FLOW_KNOBS->MIN_TRACE_SEVERITY <= severity), logged(false), - severity(severity), type(type), id(id) {} + : enabled(severity), initialized(false), logged(false), severity(severity), type(type), id(id) {} BaseTraceEvent::BaseTraceEvent(BaseTraceEvent&& ev) { - enabled = ev.enabled; + enabled = std::move(ev.enabled); err = ev.err; fields = std::move(ev.fields); id = ev.id; @@ -838,13 +895,12 @@ BaseTraceEvent::BaseTraceEvent(BaseTraceEvent&& ev) { networkThread = ev.networkThread; ev.initialized = true; - ev.enabled = false; ev.logged = true; } BaseTraceEvent& BaseTraceEvent::operator=(BaseTraceEvent&& ev) { // Note: still broken if ev and this are the same memory address. - enabled = ev.enabled; + enabled = std::move(ev.enabled); err = ev.err; fields = std::move(ev.fields); id = ev.id; @@ -865,7 +921,6 @@ BaseTraceEvent& BaseTraceEvent::operator=(BaseTraceEvent&& ev) { networkThread = ev.networkThread; ev.initialized = true; - ev.enabled = false; ev.logged = true; return *this; @@ -901,8 +956,26 @@ TraceEvent::TraceEvent(Severity severity, TraceInterval& interval, UID id) init(interval); } -bool BaseTraceEvent::init(TraceInterval& interval) { - bool result = init(); +TraceEvent::TraceEvent(Severity severity, AuditedEvent auditedEvent, UID id) + : BaseTraceEvent(severity, auditedEvent.type(), id) { + setMaxFieldLength(0); + setMaxEventLength(0); + if (FLOW_KNOBS->AUDIT_LOGGING_ENABLED) { + if (!auditedEvent) { + // Event is not whitelisted. Trace error in simulation and warning in real deployment + TraceEvent(g_network && g_network->isSimulated() ? SevError : SevWarnAlways, + std::string(TRACE_EVENT_INVALID_AUDIT_LOG_TYPE).append(auditedEvent.typeSv()).c_str()) + .suppressFor(5); + } else { + enabled.promoteToForcedIfEnabled(); + } + } +} + +TraceEvent::TraceEvent(AuditedEvent auditedEvent, UID id) : TraceEvent(SevInfo, auditedEvent, id) {} + +void BaseTraceEvent::init(TraceInterval& interval) { + init(); switch (interval.count++) { case 0: { detail("BeginPair", interval.pairID); @@ -915,10 +988,9 @@ bool BaseTraceEvent::init(TraceInterval& interval) { default: ASSERT(false); } - return result; } -bool BaseTraceEvent::init() { +BaseTraceEvent::State BaseTraceEvent::init() { ASSERT(!logged); if (initialized) { return enabled; @@ -929,12 +1001,16 @@ bool BaseTraceEvent::init() { ++g_allocation_tracing_disabled; - enabled = enabled && (!g_network || severity >= FLOW_KNOBS->MIN_TRACE_SEVERITY); + if (g_network && severity < FLOW_KNOBS->MIN_TRACE_SEVERITY) + enabled = BaseTraceEvent::State::disabled(); + + std::string_view typeSv(type); // Backstop to throttle very spammy trace events - if (enabled && g_network && !g_network->isSimulated() && severity > SevDebug && isNetworkThread()) { + if (enabled.isSuppressible() && g_network && !g_network->isSimulated() && severity > SevDebug && + isNetworkThread()) { if (traceEventThrottlerCache->isAboveThreshold(StringRef((uint8_t*)type, strlen(type)))) { - enabled = false; + enabled.suppress(); TraceEvent(SevWarnAlways, std::string(TRACE_EVENT_THROTTLE_STARTING_TYPE).append(type).c_str()) .suppressFor(5); } else { @@ -983,9 +1059,9 @@ bool BaseTraceEvent::init() { return enabled; } -TraceEvent& TraceEvent::errorImpl(class Error const& error, bool includeCancelled) { - ASSERT(!logged); - if (error.code() != error_code_actor_cancelled || includeCancelled) { +BaseTraceEvent& BaseTraceEvent::errorUnsuppressed(class Error const& error) { + if (enabled) { + ASSERT(!logged); err = error; if (initialized) { if (error.isInjectedFault()) { @@ -997,18 +1073,31 @@ TraceEvent& TraceEvent::errorImpl(class Error const& error, bool includeCancelle detail("ErrorDescription", error.what()); detail("ErrorCode", error.code()); } - if (err.isDiskError()) { + if (error.isDiskError()) { setErrorKind(ErrorKind::DiskIssue); } - } else { - if (initialized) { - TraceEvent(g_network && g_network->isSimulated() ? SevError : SevWarnAlways, - std::string(TRACE_EVENT_INVALID_SUPPRESSION).append(type).c_str()) - .suppressFor(5); + } + + return *this; +} + +BaseTraceEvent& TraceEvent::error(class Error const& error) { + if (enabled) { + if (error.code() != error_code_actor_cancelled) { + BaseTraceEvent::errorUnsuppressed(error); } else { - enabled = false; + ASSERT(!logged); + if (initialized) { + TraceEvent(g_network && g_network->isSimulated() ? SevError : SevWarnAlways, + std::string(TRACE_EVENT_INVALID_SUPPRESSION).append(type).c_str()) + .suppressFor(5); + } else { + // even force-enabled events should respect suppression by error type + enabled = BaseTraceEvent::State::disabled(); + } } } + return *this; } @@ -1030,7 +1119,7 @@ BaseTraceEvent& BaseTraceEvent::detailImpl(std::string&& key, std::string&& valu TraceEvent(g_network && g_network->isSimulated() ? SevError : SevWarnAlways, "TraceEventOverflow") .setMaxEventLength(1000) .detail("TraceFirstBytes", fields.toString().substr(0, 300)); - enabled = false; + enabled = BaseTraceEvent::State::disabled(); } --g_allocation_tracing_disabled; } @@ -1101,7 +1190,8 @@ BaseTraceEvent& TraceEvent::sample(double sampleRate, bool logSampleRate) { return *this; } - enabled = enabled && deterministicRandom()->random01() < sampleRate; + if (deterministicRandom()->random01() >= sampleRate) + enabled.suppress(); if (enabled && logSampleRate) { detail("SampleRate", sampleRate); @@ -1113,7 +1203,7 @@ BaseTraceEvent& TraceEvent::sample(double sampleRate, bool logSampleRate) { BaseTraceEvent& TraceEvent::suppressFor(double duration, bool logSuppressedEventCount) { ASSERT(!logged); - if (enabled) { + if (enabled.isSuppressible()) { if (initialized) { TraceEvent(g_network && g_network->isSimulated() ? SevError : SevWarnAlways, std::string(TRACE_EVENT_INVALID_SUPPRESSION).append(type).c_str()) @@ -1124,7 +1214,8 @@ BaseTraceEvent& TraceEvent::suppressFor(double duration, bool logSuppressedEvent if (g_network) { if (isNetworkThread()) { int64_t suppressedEventCount = suppressedEvents.checkAndInsertSuppression(type, duration); - enabled = enabled && suppressedEventCount >= 0; + if (suppressedEventCount < 0) + enabled.suppress(); if (enabled && logSuppressedEventCount) { detail("SuppressedEventCount", suppressedEventCount); } @@ -1242,22 +1333,25 @@ void BaseTraceEvent::log() { if (isNetworkThread()) { TraceEvent::eventCounts[severity / 10]++; } - + if (g_traceProcessEvents) { + auto name = fmt::format("TraceEvent::{}", type); + ProcessEvents::trigger(StringRef(name), this, success()); + } g_traceLog.writeEvent(fields, trackingKey, severity > SevWarnAlways); if (g_traceLog.isOpen()) { // Log Metrics - if (g_traceLog.logTraceEventMetrics && isNetworkThread()) { + if (isNetworkThread() && g_traceLog.logTraceEventMetrics) { // Get the persistent Event Metric representing this trace event and push the fields (details) - // accumulated in *this to it and then log() it. Note that if the event metric is disabled it - // won't actually be logged BUT any new fields added to it will be registered. If the event IS - // logged, a timestamp will be returned, if not then 0. Either way, pass it through to be used - // if possible in the Sev* event metrics. + // accumulated in *this to it and then logMetrics() it. Note that if the event metric is + // disabled it won't actually be logged BUT any new fields added to it will be registered. If + // the event IS logged, a timestamp will be returned, if not then 0. Either way, pass it + // through to be used if possible in the Sev* event metrics. uint64_t event_ts = DynamicEventMetric::getOrCreateInstance(format("TraceEvent.%s", type), StringRef(), true) ->setFieldsAndLogFrom(tmpEventMetric.get()); - g_traceLog.log(severity, type, id, event_ts); + g_traceLog.logMetrics(severity, type, id, event_ts); } } } @@ -1274,6 +1368,8 @@ BaseTraceEvent::~BaseTraceEvent() { log(); if (failedLineOverflow == 1) { failedLineOverflow = 2; + auto msg = fmt::format("Traced {} lines", tracedLines); + ProcessEvents::trigger("TracedTooManyLines"_sr, StringRef(msg), test_failed()); TraceEvent(SevError, "TracedTooManyLines").log(); crashAndDie(); } @@ -1284,6 +1380,10 @@ thread_local bool BaseTraceEvent::networkThread = false; void BaseTraceEvent::setNetworkThread() { if (!networkThread) { if (FLOW_KNOBS->ALLOCATION_TRACING_ENABLED) { + // Ensure that threadId is initialized before we enable allocation tracing, otherwise it would + // be initialized either by first normal usage of TraceEvent or by allocation tracing which is + // non-deterministic, and we could run into https://github.com/apple/foundationdb/issues/7872. + getTraceThreadId(); --g_allocation_tracing_disabled; } @@ -1335,7 +1435,9 @@ std::string BaseTraceEvent::printRealTime(double time) { } TraceInterval& TraceInterval::begin() { - pairID = nondeterministicRandom()->randomUniqueID(); + if (!pairID.isValid()) { + pairID = nondeterministicRandom()->randomUniqueID(); + } count = 0; return *this; } @@ -1348,7 +1450,8 @@ void TraceBatch::addEvent(const char* name, uint64_t id, const char* location) { if (FLOW_KNOBS->MIN_TRACE_SEVERITY > TRACE_BATCH_IMPLICIT_SEVERITY) { return; } - auto& eventInfo = eventBatch.emplace_back(EventInfo(TraceEvent::getCurrentTime(), name, id, location)); + auto& eventInfo = + eventBatch.emplace_back(EventInfo(TraceEvent::getCurrentTime(), ::timer_monotonic(), name, id, location)); if (dumpImmediately()) dump(); else @@ -1417,9 +1520,16 @@ void TraceBatch::dump() { buggifyBatch.clear(); } -TraceBatch::EventInfo::EventInfo(double time, const char* name, uint64_t id, const char* location) { +TraceBatch::EventInfo::EventInfo(double time, + double monotonicTime, + const char* name, + uint64_t id, + const char* location) { fields.addField("Severity", format("%d", (int)TRACE_BATCH_IMPLICIT_SEVERITY)); fields.addField("Time", format("%.6f", time)); + // Include monotonic time for computing elapsed time between events on the same machine. + // The Time field is based on now(), which doesn't advance between wait()'s. + fields.addField("MonotonicTime", format("%.6f", monotonicTime)); if (FLOW_KNOBS && FLOW_KNOBS->TRACE_DATETIME_ENABLED) { fields.addField("DateTime", TraceEvent::printRealTime(time)); } @@ -1515,7 +1625,7 @@ std::string TraceEventFields::getValue(std::string key) const { } ev.detail("FieldName", key); - throw attribute_not_found(); + throw attribute_not_found_error(key); } } @@ -1576,44 +1686,75 @@ void parseNumericValue(std::string const& s, uint64_t& outValue, bool permissive throw attribute_not_found(); } -template -T getNumericValue(TraceEventFields const& fields, std::string key, bool permissive) { +template +bool getNumericValue(TraceEventFields const& fields, std::string key, T& outValue, bool permissive) { std::string field = fields.getValue(key); try { - T value; - parseNumericValue(field, value, permissive); - return value; + parseNumericValue(field, outValue, permissive); + return true; } catch (Error& e) { - std::string type; + if (tryError) { + std::string type; - TraceEvent ev(SevWarn, "ErrorParsingNumericTraceEventField"); - ev.error(e); - if (fields.tryGetValue("Type", type)) { - ev.detail("Event", type); - } - ev.detail("FieldName", key); - ev.detail("FieldValue", field); + TraceEvent ev(SevWarn, "ErrorParsingNumericTraceEventField"); + ev.error(e); + if (fields.tryGetValue("Type", type)) { + ev.detail("Event", type); + } + ev.detail("FieldName", key); + ev.detail("FieldValue", field); - throw; + throw; + } else { + return false; + } } } } // namespace +bool TraceEventFields::tryGetInt(std::string key, int& outVal, bool permissive) const { + bool success = getNumericValue(*this, key, outVal, permissive); + return success; +} + int TraceEventFields::getInt(std::string key, bool permissive) const { - return getNumericValue(*this, key, permissive); + int outVal; + getNumericValue(*this, key, outVal, permissive); + return outVal; +} + +bool TraceEventFields::tryGetInt64(std::string key, int64_t& outVal, bool permissive) const { + bool success = getNumericValue(*this, key, outVal, permissive); + return success; } int64_t TraceEventFields::getInt64(std::string key, bool permissive) const { - return getNumericValue(*this, key, permissive); + int64_t outVal; + getNumericValue(*this, key, outVal, permissive); + return outVal; +} + +bool TraceEventFields::tryGetUint64(std::string key, uint64_t& outVal, bool permissive) const { + bool success = getNumericValue(*this, key, outVal, permissive); + return success; } uint64_t TraceEventFields::getUint64(std::string key, bool permissive) const { - return getNumericValue(*this, key, permissive); + uint64_t outVal; + getNumericValue(*this, key, outVal, permissive); + return outVal; +} + +bool TraceEventFields::tryGetDouble(std::string key, double& outVal, bool permissive) const { + bool success = getNumericValue(*this, key, outVal, permissive); + return success; } double TraceEventFields::getDouble(std::string key, bool permissive) const { - return getNumericValue(*this, key, permissive); + double outVal; + getNumericValue(*this, key, outVal, permissive); + return outVal; } std::string TraceEventFields::toString() const { @@ -1671,3 +1812,8 @@ std::string traceableStringToString(const char* value, size_t S) { return std::string(value, S - 1); // Exclude trailing \0 byte } + +// AuditedEvent unit test: make sure that whitelist-checks for AuditedEvent gets evaluated at compile time, and has a +// correct outcome +static_assert("InvalidToken"_audit, "Either AuditedEvent has a bug or whitelisting for this event type has changed"); +static_assert(!"nvalidToken"_audit, "AuditedEvent has a bug"); diff --git a/src/flow/Tracing.actor.g.cpp b/src/flow/Tracing.actor.g.cpp deleted file mode 100644 index 33e1cb5..0000000 --- a/src/flow/Tracing.actor.g.cpp +++ /dev/null @@ -1,1968 +0,0 @@ -#define POST_ACTOR_COMPILER 1 -#line 1 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -/* - * Tracing.actor.cpp - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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. - */ - -#include "flow/Tracing.h" -#include "flow/UnitTest.h" -#include "flow/Knobs.h" -#include "flow/network.h" -#include -#include -#include - -#include "flow/actorcompiler.h" // has to be last include - -#ifdef NO_INTELLISENSE -namespace { -#endif - -// Initial size of buffer used to store serialized traces. Buffer will be -// resized when necessary. -constexpr int kTraceBufferSize = 1024; - -// The time interval between each report of the tracer queue size (seconds). -constexpr float kQueueSizeLogInterval = 5.0; - -struct NoopTracer : ITracer { - TracerType type() const override { return TracerType::DISABLED; } - void trace(Span const& span) override {} - void trace(OTELSpan const& span) override {} -}; - -struct LogfileTracer : ITracer { - TracerType type() const override { return TracerType::LOG_FILE; } - void trace(Span const& span) override { - TraceEvent te(SevInfo, "TracingSpan", span.context); - te.detail("Location", span.location.name) - .detail("Begin", format("%.6f", span.begin)) - .detail("End", format("%.6f", span.end)); - if (span.parents.size() == 1) { - te.detail("Parent", *span.parents.begin()); - } else { - for (auto parent : span.parents) { - TraceEvent(SevInfo, "TracingSpanAddParent", span.context).detail("AddParent", parent); - } - } - for (const auto& [key, value] : span.tags) { - TraceEvent(SevInfo, "TracingSpanTag", span.context).detail("Key", key).detail("Value", value); - } - } - void trace(OTELSpan const& span) override { - TraceEvent te(SevInfo, "TracingSpan", span.context.traceID); - te.detail("SpanID", span.context.spanID) - .detail("Location", span.location.name) - .detail("Begin", format("%.6f", span.begin)) - .detail("End", format("%.6f", span.end)) - .detail("Kind", span.kind) - .detail("Status", span.status) - .detail("ParentSpanID", span.parentContext.spanID); - - for (const auto& link : span.links) { - TraceEvent(SevInfo, "TracingSpanLink", span.context.traceID) - .detail("TraceID", link.traceID) - .detail("SpanID", link.spanID); - } - for (const auto& [key, value] : span.attributes) { - TraceEvent(SevInfo, "TracingSpanTag", span.context.traceID).detail("Key", key).detail("Value", value); - } - for (const auto& event : span.events) { - TraceEvent(SevInfo, "TracingSpanEvent", span.context.traceID) - .detail("Name", event.name) - .detail("Time", event.time); - for (const auto& [key, value] : event.attributes) { - TraceEvent(SevInfo, "TracingSpanEventAttribute", span.context.traceID) - .detail("Key", key) - .detail("Value", value); - } - } - } -}; - -struct TraceRequest { - std::unique_ptr buffer; - // Amount of data in buffer (bytes). - std::size_t data_size; - // Size of buffer (bytes). - std::size_t buffer_size; - - void write_byte(uint8_t byte) { write_bytes(&byte, 1); } - - void write_bytes(const uint8_t* buf, std::size_t n) { - resize(n); - std::copy(buf, buf + n, buffer.get() + data_size); - data_size += n; - } - - void resize(std::size_t n) { - if (data_size + n <= buffer_size) { - return; - } - - std::size_t size = buffer_size; - while (size < data_size + n) { - size *= 2; - } - - TraceEvent(SevInfo, "TracingSpanResizedBuffer").detail("OldSize", buffer_size).detail("NewSize", size); - auto new_buffer = std::make_unique(size); - std::copy(buffer.get(), buffer.get() + data_size, new_buffer.get()); - buffer = std::move(new_buffer); - buffer_size = size; - } - - void reset() { data_size = 0; } -}; - -// A server listening for UDP trace messages, run only in simulation. - #line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -// This generated class is to be used only via simulationStartServer() - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -template - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -class SimulationStartServerActorState { - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -public: - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - SimulationStartServerActorState() - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - { - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - fdb_probe_actor_create("simulationStartServer", reinterpret_cast(this)); - - } - ~SimulationStartServerActorState() - { - fdb_probe_actor_destroy("simulationStartServer", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - TraceEvent(SevInfo, "UDPServerStarted") .detail("Address", "127.0.0.1") .detail("Port", FLOW_KNOBS->TRACING_UDP_LISTENER_PORT); - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - localAddress = NetworkAddress::parse("127.0.0.1:" + std::to_string(FLOW_KNOBS->TRACING_UDP_LISTENER_PORT)); - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - StrictFuture> __when_expr_0 = INetworkConnections::net()->createUDPSocket(localAddress); - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 167 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast >*>(static_cast(this))); - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - loopDepth = 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~SimulationStartServerActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1(int loopDepth) - { - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - serverSocket->bind(localAddress); - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - packetString = makeString(IUDPSocket::MAX_PACKET_SIZE); - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - packet = mutateString(packetString); - #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ; - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - loopDepth = a_body1cont1loopHead1(loopDepth); - - return loopDepth; - } - int a_body1when1(Reference const& __serverSocket,int loopDepth) - { - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - serverSocket = __serverSocket; - #line 210 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - loopDepth = a_body1cont1(loopDepth); - - return loopDepth; - } - int a_body1when1(Reference && __serverSocket,int loopDepth) - { - serverSocket = std::move(__serverSocket); - loopDepth = a_body1cont1(loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SimulationStartServerActor, 0, Reference >::remove(); - - } - void a_callback_fire(ActorCallback< SimulationStartServerActor, 0, Reference >*,Reference const& value) - { - fdb_probe_actor_enter("simulationStartServer", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("simulationStartServer", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< SimulationStartServerActor, 0, Reference >*,Reference && value) - { - fdb_probe_actor_enter("simulationStartServer", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("simulationStartServer", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< SimulationStartServerActor, 0, Reference >*,Error err) - { - fdb_probe_actor_enter("simulationStartServer", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("simulationStartServer", reinterpret_cast(this), 0); - - } - int a_body1cont1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1cont1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1cont1loopBody1(int loopDepth) - { - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - StrictFuture __when_expr_1 = serverSocket->receive(packet, packet + IUDPSocket::MAX_PACKET_SIZE); - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), std::max(0, loopDepth - 1)); else return a_body1cont1loopBody1when1(__when_expr_1.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 2; - #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 291 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1cont1loopBody1cont1(int const& size,int loopDepth) - { - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto message = packetString.substr(0, size); - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(message[0] == (4 | 0b10010000) || (5 | 0b10010000)); - #line 302 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - if (loopDepth == 0) return a_body1cont1loopHead1(0); - - return loopDepth; - } - int a_body1cont1loopBody1cont1(int && size,int loopDepth) - { - #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto message = packetString.substr(0, size); - #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(message[0] == (4 | 0b10010000) || (5 | 0b10010000)); - #line 313 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - if (loopDepth == 0) return a_body1cont1loopHead1(0); - - return loopDepth; - } - int a_body1cont1loopBody1when1(int const& size,int loopDepth) - { - loopDepth = a_body1cont1loopBody1cont1(size, loopDepth); - - return loopDepth; - } - int a_body1cont1loopBody1when1(int && size,int loopDepth) - { - loopDepth = a_body1cont1loopBody1cont1(std::move(size), loopDepth); - - return loopDepth; - } - void a_exitChoose2() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< SimulationStartServerActor, 1, int >::remove(); - - } - void a_callback_fire(ActorCallback< SimulationStartServerActor, 1, int >*,int const& value) - { - fdb_probe_actor_enter("simulationStartServer", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("simulationStartServer", reinterpret_cast(this), 1); - - } - void a_callback_fire(ActorCallback< SimulationStartServerActor, 1, int >*,int && value) - { - fdb_probe_actor_enter("simulationStartServer", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1cont1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("simulationStartServer", reinterpret_cast(this), 1); - - } - void a_callback_error(ActorCallback< SimulationStartServerActor, 1, int >*,Error err) - { - fdb_probe_actor_enter("simulationStartServer", reinterpret_cast(this), 1); - a_exitChoose2(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("simulationStartServer", reinterpret_cast(this), 1); - - } - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - NetworkAddress localAddress; - #line 141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - Reference serverSocket; - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - Standalone packetString; - #line 145 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - uint8_t* packet; - #line 389 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -}; -// This generated class is to be used only via simulationStartServer() - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -class SimulationStartServerActor final : public Actor, public ActorCallback< SimulationStartServerActor, 0, Reference >, public ActorCallback< SimulationStartServerActor, 1, int >, public FastAllocated, public SimulationStartServerActorState { - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< SimulationStartServerActor, 0, Reference >; -friend struct ActorCallback< SimulationStartServerActor, 1, int >; - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - SimulationStartServerActor() - #line 406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - : Actor(), - SimulationStartServerActorState() - { - fdb_probe_actor_enter("simulationStartServer", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("simulationStartServer"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("simulationStartServer", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< SimulationStartServerActor, 0, Reference >*)0, actor_cancelled()); break; - case 2: this->a_callback_error((ActorCallback< SimulationStartServerActor, 1, int >*)0, actor_cancelled()); break; - } - - } -}; - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -[[nodiscard]] Future simulationStartServer( ) { - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - return Future(new SimulationStartServerActor()); - #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -} - -#line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - -/* -// Runs on an interval, printing debug information and performing other -// connection tasks. -ACTOR Future traceLog(int* pendingMessages, bool* sendError) { - state bool sendErrorReset = false; - - loop { - TraceEvent("TracingSpanQueueSize").detail("PendingMessages", *pendingMessages); - - // Wait at least one full loop before attempting to send messages - // again. - if (sendErrorReset) { - sendErrorReset = false; - *sendError = false; - } else if (*sendError) { - sendErrorReset = true; - } - - wait(delay(kQueueSizeLogInterval)); - } -} -*/ - -struct UDPTracer : public ITracer { - // Serializes span fields as an array into the supplied TraceRequest - // buffer. - void serialize_span(const Span& span, TraceRequest& request) { - // If you change the serialization format here, make sure to update the - // fluentd filter to be able to correctly parse the updated format! See - // the msgpack specification for more info on the bit patterns used - // here. - uint8_t size = 8; - if (span.parents.size() == 0) - --size; - request.write_byte(size | 0b10010000); // write as array - - serialize_string(g_network->getLocalAddress().toString(), request); // ip:port - - serialize_value(span.context.first(), request, 0xcf); // trace id - serialize_value(span.context.second(), request, 0xcf); // token (span id) - - serialize_value(span.begin, request, 0xcb); // start time - serialize_value(span.end - span.begin, request, 0xcb); // duration - - serialize_string(span.location.name.toString(), request); - - serialize_map(span.tags, request); - - serialize_vector(span.parents, request); - } - - void serialize_span(const OTELSpan& span, TraceRequest& request) { - uint16_t size = 14; - request.write_byte(size | 0b10010000); // write as array - serialize_value(span.context.traceID.first(), request, 0xcf); // trace id - serialize_value(span.context.traceID.second(), request, 0xcf); // trace id - serialize_value(span.context.spanID, request, 0xcf); // spanid - // parent value - serialize_value(span.parentContext.traceID.first(), request, 0xcf); // trace id - serialize_value(span.parentContext.traceID.second(), request, 0xcf); // trace id - serialize_value(span.parentContext.spanID, request, 0xcf); // spanId - // Payload - serialize_string(span.location.name.toString(), request); - serialize_value(span.begin, request, 0xcb); // start time - serialize_value(span.end, request, 0xcb); // end - // Kind - serialize_value(span.kind, request, 0xcc); - // Status - serialize_value(span.status, request, 0xcc); - // Links - serialize_vector(span.links, request); - // Events - serialize_vector(span.events, request); - // Attributes - serialize_map(span.attributes, request); - } - -private: - // Writes the given value in big-endian format to the request. Sets the - // first byte to msgpack_type. - template - inline void serialize_value(const T& val, TraceRequest& request, uint8_t msgpack_type) { - request.write_byte(msgpack_type); - - const uint8_t* p = reinterpret_cast(std::addressof(val)); - for (size_t i = 0; i < sizeof(T); ++i) { - request.write_byte(p[sizeof(T) - i - 1]); - } - } - - // Writes the given string to the request as a sequence of bytes. Inserts a - // format byte at the beginning of the string according to the its length, - // as specified by the msgpack specification. - inline void serialize_string(const uint8_t* c, int length, TraceRequest& request) { - if (length <= 31) { - // A size 0 string is ok. We still need to write a byte - // identifiying the item as a string, but can set the size to 0. - request.write_byte(static_cast(length) | 0b10100000); - } else if (length <= 255) { - request.write_byte(0xd9); - request.write_byte(static_cast(length)); - } else if (length <= 65535) { - request.write_byte(0xda); - request.write_byte(reinterpret_cast(&length)[1]); - request.write_byte(reinterpret_cast(&length)[0]); - } else { - TraceEvent(SevWarn, "TracingSpanSerializeString") - .detail("Failed to MessagePack encode very large string", length); - ASSERT_WE_THINK(false); - } - - request.write_bytes(c, length); - } - - inline void serialize_string(const std::string& str, TraceRequest& request) { - serialize_string(reinterpret_cast(str.data()), str.size(), request); - } - - // Writes the given vector of SpanIDs to the request. If the vector is - // empty, the request is not modified. - inline void serialize_vector(const SmallVectorRef& vec, TraceRequest& request) { - int size = vec.size(); - if (size == 0) { - return; - } - if (size <= 15) { - request.write_byte(static_cast(size) | 0b10010000); - } else if (size <= 65535) { - request.write_byte(0xdc); - request.write_byte(reinterpret_cast(&size)[1]); - request.write_byte(reinterpret_cast(&size)[0]); - } else { - TraceEvent(SevWarn, "TracingSpanSerializeVector") - .detail("Failed to MessagePack encode very large vector", size); - ASSERT_WE_THINK(false); - } - - for (const auto& parentContext : vec) { - serialize_value(parentContext.second(), request, 0xcf); - } - } - - // Writes the given vector of linked SpanContext's to the request. If the vector is - // empty, the request is not modified. - inline void serialize_vector(const SmallVectorRef& vec, TraceRequest& request) { - int size = vec.size(); - if (size <= 15) { - request.write_byte(static_cast(size) | 0b10010000); - } else if (size <= 65535) { - request.write_byte(0xdc); - request.write_byte(reinterpret_cast(&size)[1]); - request.write_byte(reinterpret_cast(&size)[0]); - } else { - TraceEvent(SevWarn, "TracingSpanSerializeVector").detail("Failed to MessagePack encode large vector", size); - ASSERT_WE_THINK(false); - } - - for (const auto& link : vec) { - serialize_value(link.traceID.first(), request, 0xcf); // trace id - serialize_value(link.traceID.second(), request, 0xcf); // trace id - serialize_value(link.spanID, request, 0xcf); // spanid - } - } - - // Writes the given vector of linked SpanContext's to the request. If the vector is - // empty, the request is not modified. - inline void serialize_vector(const SmallVectorRef& vec, TraceRequest& request) { - int size = vec.size(); - if (size <= 15) { - request.write_byte(static_cast(size) | 0b10010000); - } else if (size <= 65535) { - request.write_byte(0xdc); - request.write_byte(reinterpret_cast(&size)[1]); - request.write_byte(reinterpret_cast(&size)[0]); - } else { - TraceEvent(SevWarn, "TracingSpanSerializeVector").detail("Failed to MessagePack encode large vector", size); - ASSERT_WE_THINK(false); - } - - for (const auto& event : vec) { - serialize_string(event.name.toString(), request); // event name - serialize_value(event.time, request, 0xcb); // event time - serialize_vector(event.attributes, request); - } - } - - inline void serialize_vector(const SmallVectorRef& vals, TraceRequest& request) { - int size = vals.size(); - if (size <= 15) { - // N.B. We're actually writing this out as a fixmap here in messagepack format! - // fixmap 1000xxxx 0x80 - 0x8f - request.write_byte(static_cast(size) | 0b10000000); - } else { - TraceEvent(SevWarn, "TracingSpanSerializeVector").detail("Failed to MessagePack encode large vector", size); - ASSERT_WE_THINK(false); - } - - for (const auto& kv : vals) { - serialize_string(kv.key.toString(), request); - serialize_string(kv.value.toString(), request); - } - } - - template - inline void serialize_map(const Map& map, TraceRequest& request) { - int size = map.size(); - - if (size <= 15) { - request.write_byte(static_cast(size) | 0b10000000); - } else { - TraceEvent(SevWarn, "TracingSpanSerializeMap").detail("Failed to MessagePack encode large map", size); - ASSERT_WE_THINK(false); - } - - for (const auto& [key, value] : map) { - serialize_string(key.begin(), key.size(), request); - serialize_string(value.begin(), value.size(), request); - } - } -}; - -#ifndef WIN32 - #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -// This generated class is to be used only via fastTraceLogger() - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -template - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -class FastTraceLoggerActorState { - #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -public: - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - FastTraceLoggerActorState(int* const& unreadyMessages,int* const& failedMessages,int* const& totalMessages,bool* const& sendError) - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - : unreadyMessages(unreadyMessages), - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - failedMessages(failedMessages), - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - totalMessages(totalMessages), - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - sendError(sendError), - #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - sendErrorReset(false) - #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - { - fdb_probe_actor_create("fastTraceLogger", reinterpret_cast(this)); - - } - ~FastTraceLoggerActorState() - { - fdb_probe_actor_destroy("fastTraceLogger", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 384 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ; - #line 697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~FastTraceLoggerActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - int a_body1loopHead1(int loopDepth) - { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); - - return loopDepth; - } - int a_body1loopBody1(int loopDepth) - { - #line 385 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - TraceEvent("TracingSpanStats") .detail("UnreadyMessages", *unreadyMessages) .detail("FailedMessages", *failedMessages) .detail("TotalMessages", *totalMessages) .detail("SendError", *sendError); - #line 391 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - if (sendErrorReset) - #line 729 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - { - #line 392 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - sendErrorReset = false; - #line 393 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - *sendError = false; - #line 735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - } - else - { - #line 394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - if (*sendError) - #line 741 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - { - #line 395 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - sendErrorReset = true; - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - } - } - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - StrictFuture __when_expr_0 = delay(kQueueSizeLogInterval); - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 757 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - loopDepth = 0; - - return loopDepth; - } - int a_body1loopBody1cont1(Void const& _,int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1cont1(Void && _,int loopDepth) - { - if (loopDepth == 0) return a_body1loopHead1(0); - - return loopDepth; - } - int a_body1loopBody1when1(Void const& _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(_, loopDepth); - - return loopDepth; - } - int a_body1loopBody1when1(Void && _,int loopDepth) - { - loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); - - return loopDepth; - } - void a_exitChoose1() - { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FastTraceLoggerActor, 0, Void >::remove(); - - } - void a_callback_fire(ActorCallback< FastTraceLoggerActor, 0, Void >*,Void const& value) - { - fdb_probe_actor_enter("fastTraceLogger", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(value, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("fastTraceLogger", reinterpret_cast(this), 0); - - } - void a_callback_fire(ActorCallback< FastTraceLoggerActor, 0, Void >*,Void && value) - { - fdb_probe_actor_enter("fastTraceLogger", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1loopBody1when1(std::move(value), 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("fastTraceLogger", reinterpret_cast(this), 0); - - } - void a_callback_error(ActorCallback< FastTraceLoggerActor, 0, Void >*,Error err) - { - fdb_probe_actor_enter("fastTraceLogger", reinterpret_cast(this), 0); - a_exitChoose1(); - try { - a_body1Catch1(err, 0); - } - catch (Error& error) { - a_body1Catch1(error, 0); - } catch (...) { - a_body1Catch1(unknown_error(), 0); - } - fdb_probe_actor_exit("fastTraceLogger", reinterpret_cast(this), 0); - - } - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - int* unreadyMessages; - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - int* failedMessages; - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - int* totalMessages; - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - bool* sendError; - #line 382 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - bool sendErrorReset; - #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -}; -// This generated class is to be used only via fastTraceLogger() - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -class FastTraceLoggerActor final : public Actor, public ActorCallback< FastTraceLoggerActor, 0, Void >, public FastAllocated, public FastTraceLoggerActorState { - #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< FastTraceLoggerActor, 0, Void >; - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - FastTraceLoggerActor(int* const& unreadyMessages,int* const& failedMessages,int* const& totalMessages,bool* const& sendError) - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - : Actor(), - FastTraceLoggerActorState(unreadyMessages, failedMessages, totalMessages, sendError) - { - fdb_probe_actor_enter("fastTraceLogger", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("fastTraceLogger"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("fastTraceLogger", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FastTraceLoggerActor, 0, Void >*)0, actor_cancelled()); break; - } - - } -}; - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -[[nodiscard]] Future fastTraceLogger( int* const& unreadyMessages, int* const& failedMessages, int* const& totalMessages, bool* const& sendError ) { - #line 381 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - return Future(new FastTraceLoggerActor(unreadyMessages, failedMessages, totalMessages, sendError)); - #line 890 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -} - -#line 401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - -struct FastUDPTracer : public UDPTracer { - FastUDPTracer() - : unready_socket_messages_(0), failed_messages_(0), total_messages_(0), socket_fd_(-1), send_error_(false) { - request_ = TraceRequest{ .buffer = std::make_unique(kTraceBufferSize), - .data_size = 0, - .buffer_size = kTraceBufferSize }; - } - - TracerType type() const override { return TracerType::NETWORK_LOSSY; } - - void prepare(int size) { - static std::once_flag once; - std::call_once(once, [&]() { - log_actor_ = fastTraceLogger(&unready_socket_messages_, &failed_messages_, &total_messages_, &send_error_); - std::string destAddr = FLOW_KNOBS->TRACING_UDP_LISTENER_ADDR; - if (g_network->isSimulated()) { - udp_server_actor_ = simulationStartServer(); - // Force loopback when in simulation mode - destAddr = "127.0.0.1"; - } - NetworkAddress destAddress = - NetworkAddress::parse(destAddr + ":" + std::to_string(FLOW_KNOBS->TRACING_UDP_LISTENER_PORT)); - - socket_ = INetworkConnections::net()->createUDPSocket(destAddress); - }); - - if (size == 0) { - return; - } - - ++total_messages_; - if (!socket_.isReady()) { - ++unready_socket_messages_; - return; - } else if (socket_fd_ == -1) { - socket_fd_ = socket_.get()->native_handle(); - } - - if (send_error_) { - return; - } - } - - void write() { - int bytesSent = send(socket_fd_, request_.buffer.get(), request_.data_size, MSG_DONTWAIT); - if (bytesSent == -1) { - // Will forgo checking errno here, and assume all error messages - // should be treated the same. - ++failed_messages_; - send_error_ = true; - } - request_.reset(); - } - - void trace(OTELSpan const& span) override { - prepare(span.location.name.size()); - serialize_span(span, request_); - write(); - } - - void trace(Span const& span) override { - prepare(span.location.name.size()); - serialize_span(span, request_); - write(); - } - -private: - TraceRequest request_; - - int unready_socket_messages_; - int failed_messages_; - int total_messages_; - - int socket_fd_; - bool send_error_; - - Future> socket_; - Future log_actor_; - Future udp_server_actor_; -}; -#endif - -ITracer* g_tracer = new NoopTracer(); - -#ifdef NO_INTELLISENSE -} // namespace -#endif - -void openTracer(TracerType type) { - if (g_tracer->type() == type) { - return; - } - delete g_tracer; - switch (type) { - case TracerType::DISABLED: - g_tracer = new NoopTracer{}; - break; - case TracerType::LOG_FILE: - g_tracer = new LogfileTracer{}; - break; - case TracerType::NETWORK_LOSSY: -#ifndef WIN32 - g_tracer = new FastUDPTracer{}; -#endif - break; - case TracerType::SIM_END: - ASSERT(false); - break; - } -} - -ITracer::~ITracer() {} - -Span& Span::operator=(Span&& o) { - if (begin > 0.0 && context.second() > 0) { - end = g_network->now(); - g_tracer->trace(*this); - } - arena = std::move(o.arena); - context = o.context; - begin = o.begin; - end = o.end; - location = o.location; - parents = std::move(o.parents); - o.begin = 0; - return *this; -} - -Span::~Span() { - if (begin > 0.0 && context.second() > 0) { - end = g_network->now(); - g_tracer->trace(*this); - } -} - -OTELSpan& OTELSpan::operator=(OTELSpan&& o) { - if (begin > 0.0 && o.context.isSampled() > 0) { - end = g_network->now(); - g_tracer->trace(*this); - } - arena = std::move(o.arena); - context = o.context; - parentContext = o.parentContext; - begin = o.begin; - end = o.end; - location = o.location; - links = std::move(o.links); - events = std::move(o.events); - status = o.status; - kind = o.kind; - o.context = SpanContext(); - o.parentContext = SpanContext(); - o.kind = SpanKind::INTERNAL; - o.begin = 0.0; - o.end = 0.0; - o.status = SpanStatus::UNSET; - return *this; -} - -OTELSpan::~OTELSpan() { - if (begin > 0.0 && context.isSampled()) { - end = g_network->now(); - g_tracer->trace(*this); - } -} - - #line 1061 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -namespace { -// This generated class is to be used only via flowTestCase568() - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -template - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -class FlowTestCase568ActorState { - #line 1068 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -public: - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - FlowTestCase568ActorState(UnitTestParameters const& params) - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - : params(params) - #line 1075 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - { - fdb_probe_actor_create("flowTestCase568", reinterpret_cast(this)); - - } - ~FlowTestCase568ActorState() - { - fdb_probe_actor_destroy("flowTestCase568", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 570 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan notSampled("foo"_loc); - #line 571 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(!notSampled.context.isSampled()); - #line 574 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan sampled("foo"_loc, []() { return 1.0; }); - #line 575 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(sampled.context.isSampled()); - #line 578 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan childTraceIDMatchesParent( "foo"_loc, []() { return 1.0; }, SpanContext(UID(100, 101), 200, TraceFlags::sampled)); - #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(childTraceIDMatchesParent.context.traceID.first() == childTraceIDMatchesParent.parentContext.traceID.first()); - #line 582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(childTraceIDMatchesParent.context.traceID.second() == childTraceIDMatchesParent.parentContext.traceID.second()); - #line 587 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan parentNotSampled( "foo"_loc, []() { return 1.0; }, SpanContext(UID(1, 1), 1, TraceFlags::unsampled)); - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(!parentNotSampled.context.isSampled()); - #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan noParent( "foo"_loc, []() { return 1.0; }, SpanContext(UID(0, 0), 0, TraceFlags::unsampled)); - #line 596 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(noParent.context.isSampled()); - #line 597 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase568ActorState(); static_cast(this)->destroy(); return 0; } - #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase568ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~FlowTestCase568ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - UnitTestParameters params; - #line 1136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -}; -// This generated class is to be used only via flowTestCase568() - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -class FlowTestCase568Actor final : public Actor, public FastAllocated, public FlowTestCase568ActorState { - #line 1141 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - FlowTestCase568Actor(UnitTestParameters const& params) - #line 1151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - : Actor(), - FlowTestCase568ActorState(params) - { - fdb_probe_actor_enter("flowTestCase568", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase568"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("flowTestCase568", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - } - - } -}; -} - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -static Future flowTestCase568( UnitTestParameters const& params ) { - #line 568 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - return Future(new FlowTestCase568Actor(params)); - #line 1178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -} -ACTOR_TEST_CASE(flowTestCase568, "/flow/Tracing/CreateOTELSpan") - -#line 598 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - - - #line 1185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -namespace { -// This generated class is to be used only via flowTestCase600() - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -template - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -class FlowTestCase600ActorState { - #line 1192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -public: - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - FlowTestCase600ActorState(UnitTestParameters const& params) - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - : params(params) - #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - { - fdb_probe_actor_create("flowTestCase600", reinterpret_cast(this)); - - } - ~FlowTestCase600ActorState() - { - fdb_probe_actor_destroy("flowTestCase600", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 602 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan span1("span_with_event"_loc); - #line 603 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto arena = span1.arena; - #line 604 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - SmallVectorRef attrs; - #line 605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - attrs.push_back(arena, KeyValueRef("foo"_sr, "bar"_sr)); - #line 606 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - span1.addEvent(LiteralStringRef("read_version"), 1.0, attrs); - #line 607 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.events[0].name.toString() == "read_version"); - #line 608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.events[0].time == 1.0); - #line 609 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.events[0].attributes.begin()->key.toString() == "foo"); - #line 610 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.events[0].attributes.begin()->value.toString() == "bar"); - #line 613 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan span2("span_with_event"_loc); - #line 614 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - span2.addEvent(StringRef(span2.arena, LiteralStringRef("commit_succeed")), 1234567.100); - #line 615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span2.events[0].name.toString() == "commit_succeed"); - #line 616 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span2.events[0].time == 1234567.100); - #line 617 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span2.events[0].attributes.size() == 0); - #line 620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan span3("span_with_event"_loc); - #line 621 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto s3Arena = span3.arena; - #line 622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - SmallVectorRef s3Attrs; - #line 623 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - s3Attrs.push_back(s3Arena, KeyValueRef("xyz"_sr, "123"_sr)); - #line 624 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - span3.addEvent("commit_fail"_sr, 1234567.100, s3Attrs).addEvent("commit_succeed"_sr, 1111.001, s3Attrs); - #line 625 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span3.events[0].name.toString() == "commit_fail"); - #line 626 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span3.events[0].time == 1234567.100); - #line 627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span3.events[0].attributes.size() == 1); - #line 628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span3.events[0].attributes.begin()->key.toString() == "xyz"); - #line 629 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span3.events[0].attributes.begin()->value.toString() == "123"); - #line 630 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span3.events[1].name.toString() == "commit_succeed"); - #line 631 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span3.events[1].time == 1111.001); - #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span3.events[1].attributes.size() == 1); - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span3.events[1].attributes.begin()->key.toString() == "xyz"); - #line 634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span3.events[1].attributes.begin()->value.toString() == "123"); - #line 635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase600ActorState(); static_cast(this)->destroy(); return 0; } - #line 1272 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase600ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~FlowTestCase600ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - UnitTestParameters params; - #line 1296 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -}; -// This generated class is to be used only via flowTestCase600() - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -class FlowTestCase600Actor final : public Actor, public FastAllocated, public FlowTestCase600ActorState { - #line 1301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - FlowTestCase600Actor(UnitTestParameters const& params) - #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - : Actor(), - FlowTestCase600ActorState(params) - { - fdb_probe_actor_enter("flowTestCase600", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase600"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("flowTestCase600", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - } - - } -}; -} - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -static Future flowTestCase600( UnitTestParameters const& params ) { - #line 600 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - return Future(new FlowTestCase600Actor(params)); - #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -} -ACTOR_TEST_CASE(flowTestCase600, "/flow/Tracing/AddEvents") - -#line 636 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - - - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -namespace { -// This generated class is to be used only via flowTestCase638() - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -template - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -class FlowTestCase638ActorState { - #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -public: - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - FlowTestCase638ActorState(UnitTestParameters const& params) - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - : params(params) - #line 1359 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - { - fdb_probe_actor_create("flowTestCase638", reinterpret_cast(this)); - - } - ~FlowTestCase638ActorState() - { - fdb_probe_actor_destroy("flowTestCase638", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 639 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan span1("span_with_attrs"_loc); - #line 640 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto arena = span1.arena; - #line 641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - span1.addAttribute(StringRef(arena, LiteralStringRef("foo")), StringRef(arena, LiteralStringRef("bar"))); - #line 642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - span1.addAttribute(StringRef(arena, LiteralStringRef("operation")), StringRef(arena, LiteralStringRef("grv"))); - #line 643 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT_EQ(span1.attributes.size(), 3); - #line 644 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.attributes[1] == KeyValueRef("foo"_sr, "bar"_sr)); - #line 645 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.attributes[2] == KeyValueRef("operation"_sr, "grv"_sr)); - #line 647 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan span3("span_with_attrs"_loc); - #line 648 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto s3Arena = span3.arena; - #line 649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - span3.addAttribute(StringRef(s3Arena, LiteralStringRef("a")), StringRef(s3Arena, LiteralStringRef("1"))) .addAttribute(StringRef(s3Arena, LiteralStringRef("b")), LiteralStringRef("2")) .addAttribute(StringRef(s3Arena, LiteralStringRef("c")), LiteralStringRef("3")); - #line 653 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT_EQ(span3.attributes.size(), 4); - #line 654 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span3.attributes[1] == KeyValueRef("a"_sr, "1"_sr)); - #line 655 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span3.attributes[2] == KeyValueRef("b"_sr, "2"_sr)); - #line 656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span3.attributes[3] == KeyValueRef("c"_sr, "3"_sr)); - #line 657 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase638ActorState(); static_cast(this)->destroy(); return 0; } - #line 1402 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase638ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~FlowTestCase638ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - UnitTestParameters params; - #line 1426 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -}; -// This generated class is to be used only via flowTestCase638() - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -class FlowTestCase638Actor final : public Actor, public FastAllocated, public FlowTestCase638ActorState { - #line 1431 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - FlowTestCase638Actor(UnitTestParameters const& params) - #line 1441 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - : Actor(), - FlowTestCase638ActorState(params) - { - fdb_probe_actor_enter("flowTestCase638", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase638"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("flowTestCase638", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - } - - } -}; -} - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -static Future flowTestCase638( UnitTestParameters const& params ) { - #line 638 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - return Future(new FlowTestCase638Actor(params)); - #line 1468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -} -ACTOR_TEST_CASE(flowTestCase638, "/flow/Tracing/AddAttributes") - -#line 658 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - - - #line 1475 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -namespace { -// This generated class is to be used only via flowTestCase660() - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -template - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -class FlowTestCase660ActorState { - #line 1482 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -public: - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - FlowTestCase660ActorState(UnitTestParameters const& params) - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - : params(params) - #line 1489 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - { - fdb_probe_actor_create("flowTestCase660", reinterpret_cast(this)); - - } - ~FlowTestCase660ActorState() - { - fdb_probe_actor_destroy("flowTestCase660", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 661 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan span1("span_with_links"_loc); - #line 662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - span1.addLink(SpanContext(UID(100, 101), 200, TraceFlags::sampled)); - #line 663 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - span1.addLink(SpanContext(UID(200, 201), 300, TraceFlags::unsampled)) .addLink(SpanContext(UID(300, 301), 400, TraceFlags::sampled)); - #line 666 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.links[0].traceID == UID(100, 101)); - #line 667 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.links[0].spanID == 200); - #line 668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.links[0].m_Flags == TraceFlags::sampled); - #line 669 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.links[1].traceID == UID(200, 201)); - #line 670 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.links[1].spanID == 300); - #line 671 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.links[1].m_Flags == TraceFlags::unsampled); - #line 672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.links[2].traceID == UID(300, 301)); - #line 673 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.links[2].spanID == 400); - #line 674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span1.links[2].m_Flags == TraceFlags::sampled); - #line 676 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan span2("span_with_links"_loc); - #line 677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto link1 = SpanContext(UID(1, 1), 1, TraceFlags::sampled); - #line 678 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto link2 = SpanContext(UID(2, 2), 2, TraceFlags::sampled); - #line 679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto link3 = SpanContext(UID(3, 3), 3, TraceFlags::sampled); - #line 680 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - span2.addLinks({ link1, link2 }).addLinks({ link3 }); - #line 681 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span2.links[0].traceID == UID(1, 1)); - #line 682 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span2.links[0].spanID == 1); - #line 683 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span2.links[0].m_Flags == TraceFlags::sampled); - #line 684 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span2.links[1].traceID == UID(2, 2)); - #line 685 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span2.links[1].spanID == 2); - #line 686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span2.links[1].m_Flags == TraceFlags::sampled); - #line 687 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span2.links[2].traceID == UID(3, 3)); - #line 688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span2.links[2].spanID == 3); - #line 689 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(span2.links[2].m_Flags == TraceFlags::sampled); - #line 690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase660ActorState(); static_cast(this)->destroy(); return 0; } - #line 1556 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase660ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~FlowTestCase660ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - UnitTestParameters params; - #line 1580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -}; -// This generated class is to be used only via flowTestCase660() - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -class FlowTestCase660Actor final : public Actor, public FastAllocated, public FlowTestCase660ActorState { - #line 1585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - FlowTestCase660Actor(UnitTestParameters const& params) - #line 1595 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - : Actor(), - FlowTestCase660ActorState(params) - { - fdb_probe_actor_enter("flowTestCase660", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase660"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("flowTestCase660", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - } - - } -}; -} - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -static Future flowTestCase660( UnitTestParameters const& params ) { - #line 660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - return Future(new FlowTestCase660Actor(params)); - #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -} -ACTOR_TEST_CASE(flowTestCase660, "/flow/Tracing/AddLinks") - -#line 691 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - - -uint16_t swapUint16BE(uint8_t* index) { - uint16_t value; - memcpy(&value, index, sizeof(value)); - return fromBigEndian16(value); -} - -uint64_t swapUint64BE(uint8_t* index) { - uint64_t value; - memcpy(&value, index, sizeof(value)); - return fromBigEndian64(value); -} - -double swapDoubleBE(uint8_t* index) { - double value; - memcpy(&value, index, sizeof(value)); - char* const p = reinterpret_cast(&value); - for (size_t i = 0; i < sizeof(double) / 2; ++i) - std::swap(p[i], p[sizeof(double) - i - 1]); - return value; -} - -std::string readMPString(uint8_t* index, int len) { - uint8_t data[len + 1]; - std::copy(index, index + len, data); - data[len] = '\0'; - return reinterpret_cast(data); -} - -std::string readMPString(uint8_t* index) { - auto len = 0; - switch (*index) { - case 0xda: - index++; // read the size in the next 2 bytes - len = swapUint16BE(index); - index += 2; // move index past the size bytes - break; - default: - // We & out the bits here that contain the length the initial 3 higher order bits are - // to signify this is a string of len <= 31 chars. - len = static_cast(*index & 0b00011111); - index++; - } - uint8_t data[len + 1]; - std::copy(index, index + len, data); - data[len] = '\0'; - return reinterpret_cast(data); -} - -// Windows doesn't like lack of header and declaration of constructor for FastUDPTracer -#ifndef WIN32 - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -namespace { -// This generated class is to be used only via flowTestCase743() - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -template - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -class FlowTestCase743ActorState { - #line 1686 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -public: - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - FlowTestCase743ActorState(UnitTestParameters const& params) - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - : params(params) - #line 1693 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - { - fdb_probe_actor_create("flowTestCase743", reinterpret_cast(this)); - - } - ~FlowTestCase743ActorState() - { - fdb_probe_actor_destroy("flowTestCase743", reinterpret_cast(this)); - - } - int a_body1(int loopDepth=0) - { - try { - #line 744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan span1("encoded_span"_loc); - #line 745 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto request = TraceRequest{ .buffer = std::make_unique(kTraceBufferSize), .data_size = 0, .buffer_size = kTraceBufferSize }; - #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto tracer = FastUDPTracer(); - #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - tracer.serialize_span(span1, request); - #line 750 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto data = request.buffer.get(); - #line 751 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[0] == 0b10011110); - #line 752 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - request.reset(); - #line 756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan span2("encoded_span"_loc, SpanContext(UID(100, 101), 1, TraceFlags::sampled), SpanContext(UID(200, 201), 2, TraceFlags::sampled)); - #line 759 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - tracer.serialize_span(span2, request); - #line 760 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - data = request.buffer.get(); - #line 761 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[0] == 0b10011110); - #line 763 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[1] == 0xcf); - #line 764 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(swapUint64BE(&data[2]) == 100); - #line 765 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[10] == 0xcf); - #line 766 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(swapUint64BE(&data[11]) == 101); - #line 767 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[19] == 0xcf); - #line 770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[28] == 0xcf); - #line 771 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(swapUint64BE(&data[29]) == 100); - #line 772 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[37] == 0xcf); - #line 773 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(swapUint64BE(&data[38]) == 101); - #line 774 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[46] == 0xcf); - #line 775 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(swapUint64BE(&data[47]) == 1); - #line 777 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(readMPString(&data[55]) == "encoded_span"); - #line 779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[68] == 0xcb); - #line 780 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[77] == 0xcb); - #line 782 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[86] == 0xcc); - #line 783 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[87] == static_cast(SpanKind::SERVER)); - #line 785 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[88] == 0xcc); - #line 786 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[89] == static_cast(SpanStatus::OK)); - #line 788 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[90] == 0b10010001); - #line 789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[91] == 0xcf); - #line 790 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(swapUint64BE(&data[92]) == 200); - #line 791 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[100] == 0xcf); - #line 792 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(swapUint64BE(&data[101]) == 201); - #line 793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[109] == 0xcf); - #line 794 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(swapUint64BE(&data[110]) == 2); - #line 796 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[118] == 0b10010000); - #line 798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[119] == 0b10000001); - #line 799 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[120] == 0b10100111); - #line 801 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - request.reset(); - #line 804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - OTELSpan span3("encoded_span_3"_loc); - #line 805 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto s3Arena = span3.arena; - #line 806 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - SmallVectorRef attrs; - #line 807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - attrs.push_back(s3Arena, KeyValueRef("foo"_sr, "bar"_sr)); - #line 808 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - span3.addAttribute("operation"_sr, "grv"_sr) .addLink(SpanContext(UID(300, 301), 400, TraceFlags::sampled)) .addEvent(StringRef(s3Arena, LiteralStringRef("event1")), 100.101, attrs); - #line 811 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - tracer.serialize_span(span3, request); - #line 812 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - data = request.buffer.get(); - #line 813 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[0] == 0b10011110); - #line 816 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(readMPString(&data[55]) == "encoded_span_3"); - #line 818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[70] == 0xcb); - #line 819 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[79] == 0xcb); - #line 821 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[88] == 0xcc); - #line 822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[89] == static_cast(SpanKind::SERVER)); - #line 824 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[90] == 0xcc); - #line 825 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[91] == static_cast(SpanStatus::OK)); - #line 827 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[92] == 0b10010001); - #line 828 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[93] == 0xcf); - #line 829 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(swapUint64BE(&data[94]) == 300); - #line 830 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[102] == 0xcf); - #line 831 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(swapUint64BE(&data[103]) == 301); - #line 832 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[111] == 0xcf); - #line 833 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(swapUint64BE(&data[112]) == 400); - #line 835 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[120] == 0b10010001); - #line 836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(readMPString(&data[121]) == "event1"); - #line 837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[128] == 0xcb); - #line 838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(swapDoubleBE(&data[129]) == 100.101); - #line 840 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[137] == 0b10000001); - #line 841 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(readMPString(&data[138]) == "foo"); - #line 842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(readMPString(&data[142]) == "bar"); - #line 844 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[146] == 0b10000010); - #line 846 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - std::unordered_map attributes; - #line 847 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto index = 147; - #line 849 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto firstKey = readMPString(&data[index]); - #line 850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - index += firstKey.length() + 1; - #line 851 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto firstValue = readMPString(&data[index]); - #line 852 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - index += firstValue.length() + 1; - #line 853 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - attributes[firstKey] = firstValue; - #line 855 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto secondKey = readMPString(&data[index]); - #line 856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - index += secondKey.length() + 1; - #line 857 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto secondValue = readMPString(&data[index]); - #line 858 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - attributes[secondKey] = secondValue; - #line 860 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(attributes.find("address") != attributes.end()); - #line 861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(attributes["operation"] == "grv"); - #line 863 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - request.reset(); - #line 866 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - const char* longString = "yGUtj42gSKfdqib3f0Ri4OVhD7eWyTbKsH/g9+x4UWyXry7NIBFIapPV9f1qdTRl" "2jXcZI8Ua/Gp8k9EBn7peaEN1uj4w9kf4FQ2Lalu0VrA4oquQoaKYr+wPsLBak9i" "uyZDF9sX/HW4pVvQhPQdXQWME5E7m58XFMpZ3H8HNXuytWInEuh97SRLlI0RhrvG" "ixNpYtYlvghsLCrEdZMMGnS2gXgGufIdg1xKJd30fUbZLHcYIC4DTnL5RBpkbQCR" "SGKKUrpIb/7zePhBDi+gzUzyAcbQ2zUbFWI1KNi3zQk58uUG6wWJZkw+GCs7Cc3V" "OUxOljwCJkC4QTgdsbbFhxUC+rtoHV5xAqoTQwR0FXnWigUjP7NtdL6huJUr3qRv" "40c4yUI1a4+P5vJa"; - #line 873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto span4 = OTELSpan(); - #line 874 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - auto location = Location(); - #line 875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - location.name = StringRef(span4.arena, longString); - #line 876 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - span4.location = location; - #line 877 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - tracer.serialize_span(span4, request); - #line 878 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - data = request.buffer.get(); - #line 879 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[0] == 0b10011110); - #line 882 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(data[55] == 0xda); - #line 883 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - ASSERT(readMPString(&data[55]) == longString); - #line 884 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase743ActorState(); static_cast(this)->destroy(); return 0; } - #line 1896 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase743ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); - } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); - } - - return loopDepth; - } - int a_body1Catch1(Error error,int loopDepth=0) - { - this->~FlowTestCase743ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; - - return loopDepth; - } - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - UnitTestParameters params; - #line 1920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -}; -// This generated class is to be used only via flowTestCase743() - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -class FlowTestCase743Actor final : public Actor, public FastAllocated, public FlowTestCase743ActorState { - #line 1925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - FlowTestCase743Actor(UnitTestParameters const& params) - #line 1935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" - : Actor(), - FlowTestCase743ActorState(params) - { - fdb_probe_actor_enter("flowTestCase743", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase743"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("flowTestCase743", reinterpret_cast(this), -1); - - } - void cancel() override - { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - } - - } -}; -} - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" -static Future flowTestCase743( UnitTestParameters const& params ) { - #line 743 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - return Future(new FlowTestCase743Actor(params)); - #line 1962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.g.cpp" -} -ACTOR_TEST_CASE(flowTestCase743, "/flow/Tracing/FastUDPMessagePackEncoding") - -#line 885 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/Tracing.actor.cpp" - -#endif diff --git a/src/flow/Tracing.h b/src/flow/Tracing.h deleted file mode 100644 index c289a73..0000000 --- a/src/flow/Tracing.h +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Tracing.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 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 - -#include "fdbclient/FDBTypes.h" -#include "flow/IRandom.h" -#include -#include - -struct Location { - StringRef name; -}; - -inline Location operator"" _loc(const char* str, size_t size) { - return Location{ StringRef(reinterpret_cast(str), size) }; -} - -struct Span { - Span(SpanID context, Location location, std::initializer_list const& parents = {}) - : context(context), begin(g_network->now()), location(location), parents(arena, parents.begin(), parents.end()) { - if (parents.size() > 0) { - // If the parents' token is 0 (meaning the trace should not be - // recorded), set the child token to 0 as well. Otherwise, generate - // a new, random token. - uint64_t traceId = 0; - if ((*parents.begin()).second() > 0) { - traceId = deterministicRandom()->randomUInt64(); - } - this->context = SpanID((*parents.begin()).first(), traceId); - } - } - Span(Location location, std::initializer_list const& parents = {}) - : Span(UID(deterministicRandom()->randomUInt64(), - deterministicRandom()->random01() < FLOW_KNOBS->TRACING_SAMPLE_RATE - ? deterministicRandom()->randomUInt64() - : 0), - location, - parents) {} - Span(Location location, SpanID context) : Span(location, { context }) {} - Span(const Span&) = delete; - Span(Span&& o) { - arena = std::move(o.arena); - context = o.context; - begin = o.begin; - end = o.end; - location = o.location; - parents = std::move(o.parents); - o.context = UID(); - o.begin = 0.0; - o.end = 0.0; - } - Span() {} - ~Span(); - Span& operator=(Span&& o); - Span& operator=(const Span&) = delete; - void swap(Span& other) { - std::swap(arena, other.arena); - std::swap(context, other.context); - std::swap(begin, other.begin); - std::swap(end, other.end); - std::swap(location, other.location); - std::swap(parents, other.parents); - } - - void addParent(SpanID span) { - if (parents.size() == 0) { - uint64_t traceId = 0; - if (span.second() > 0) { - traceId = context.second() == 0 ? deterministicRandom()->randomUInt64() : context.second(); - } - // Use first parent to set trace ID. This is non-ideal for spans - // with multiple parents, because the trace ID will associate the - // span with only one trace. A workaround is to look at the parent - // relationships instead of the trace ID. Another option in the - // future is to keep a list of trace IDs. - context = SpanID(span.first(), traceId); - } - parents.push_back(arena, span); - } - - void addTag(const StringRef& key, const StringRef& value) { tags[key] = value; } - - Arena arena; - UID context = UID(); - double begin = 0.0, end = 0.0; - Location location; - SmallVectorRef parents; - std::unordered_map tags; -}; - -// OTELSpan -// -// OTELSpan is a tracing implementation which, for the most part, complies with the W3C Trace Context specification -// https://www.w3.org/TR/trace-context/ and the OpenTelemetry API -// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md. -// -// The major differences between OTELSpan and the current Span implementation, which is based off the OpenTracing.io -// specification https://opentracing.io/ are as follows. -// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span -// -// OTELSpans have... -// 1. A SpanContext which consists of 3 attributes. -// -// TraceId - A valid trace identifier is a 16-byte array with at least one non-zero byte. -// SpanId - A valid span identifier is an 8-byte array with at least one non-zero byte. -// TraceFlags - 1 byte, bit field for flags. -// -// TraceState is not implemented, specifically we do not provide some of the following APIs -// https://www.w3.org/TR/trace-context/#mutating-the-tracestate-field In particular APIs to delete/update a specific, -// arbitrary key/value pair, as this complies with the OTEL specification where SpanContexts are immutable. -// 2. A begin/end and those values are serialized, unlike the Span implementation which has an end but serializes with a -// begin and calculated duration field. -// 3. A SpanKind -// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#spankind -// 4. A SpanStatus -// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status -// 5. A singular parent SpanContext, which may optionally be null, as opposed to our Span implementation which allows -// for a list of parents. -// 6. An "attributes" rather than "tags", however the implementation is essentially the same, a set of key/value of -// strings, stored here as a SmallVectorRef rather than map as a convenience. -// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/common.md#attributes -// 7. An optional list of linked SpanContexts. -// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#specifying-links -// 8. An optional list of timestamped Events. -// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#add-events - -enum class SpanKind : uint8_t { INTERNAL = 0, CLIENT = 1, SERVER = 2, PRODUCER = 3, CONSUMER = 4 }; - -enum class SpanStatus : uint8_t { UNSET = 0, OK = 1, ERR = 2 }; - -struct OTELEventRef { - OTELEventRef() {} - OTELEventRef(const StringRef& name, - const double& time, - const SmallVectorRef& attributes = SmallVectorRef()) - : name(name), time(time), attributes(attributes) {} - OTELEventRef(Arena& arena, const OTELEventRef& other) - : name(arena, other.name), time(other.time), attributes(arena, other.attributes) {} - StringRef name; - double time = 0.0; - SmallVectorRef attributes; -}; - -class OTELSpan { -public: - OTELSpan(const SpanContext& context, - const Location& location, - const SpanContext& parentContext, - const std::initializer_list& links = {}) - : context(context), location(location), parentContext(parentContext), links(arena, links.begin(), links.end()), - begin(g_network->now()) { - // We've simplified the logic here, essentially we're now always setting trace and span ids and relying on the - // TraceFlags to determine if we're sampling. Therefore if the parent is sampled, we simply overwrite this - // span's traceID with the parent trace id. - if (parentContext.isSampled()) { - this->context.traceID = UID(parentContext.traceID.first(), parentContext.traceID.second()); - this->context.m_Flags = TraceFlags::sampled; - } else { - // However there are two other cases. - // 1. A legitamite parent span exists but it was not selected for tracing. - // 2. There is no actual parent, just a default arg parent provided by the constructor AND the "child" span - // was selected for sampling. For case 1. we handle below by marking the child as unsampled. For case 2 we - // needn't do anything, and can rely on the values in this OTELSpan - if (parentContext.traceID.first() != 0 && parentContext.traceID.second() != 0 && - parentContext.spanID != 0) { - this->context.m_Flags = TraceFlags::unsampled; - } - } - this->kind = SpanKind::SERVER; - this->status = SpanStatus::OK; - this->attributes.push_back( - this->arena, KeyValueRef("address"_sr, StringRef(this->arena, g_network->getLocalAddress().toString()))); - } - - OTELSpan(const Location& location, - const SpanContext& parent = SpanContext(), - const std::initializer_list& links = {}) - : OTELSpan( - SpanContext(UID(deterministicRandom()->randomUInt64(), deterministicRandom()->randomUInt64()), // traceID - deterministicRandom()->randomUInt64(), // spanID - deterministicRandom()->random01() < FLOW_KNOBS->TRACING_SAMPLE_RATE // sampled or unsampled - ? TraceFlags::sampled - : TraceFlags::unsampled), - location, - parent, - links) {} - - OTELSpan(const Location& location, const SpanContext parent, const SpanContext& link) - : OTELSpan(location, parent, { link }) {} - - // NOTE: This constructor is primarly for unit testing until we sort out how to enable/disable a Knob dynamically in - // a test. - OTELSpan(const Location& location, - const std::function& rateProvider, - const SpanContext& parent = SpanContext(), - const std::initializer_list& links = {}) - : OTELSpan(SpanContext(UID(deterministicRandom()->randomUInt64(), deterministicRandom()->randomUInt64()), - deterministicRandom()->randomUInt64(), - deterministicRandom()->random01() < rateProvider() ? TraceFlags::sampled - : TraceFlags::unsampled), - location, - parent, - links) {} - - OTELSpan(const OTELSpan&) = delete; - OTELSpan(OTELSpan&& o) { - arena = std::move(o.arena); - context = o.context; - location = o.location; - parentContext = std::move(o.parentContext); - kind = o.kind; - begin = o.begin; - end = o.end; - links = std::move(o.links); - events = std::move(o.events); - status = o.status; - o.context = SpanContext(); - o.parentContext = SpanContext(); - o.kind = SpanKind::INTERNAL; - o.begin = 0.0; - o.end = 0.0; - o.status = SpanStatus::UNSET; - } - OTELSpan() {} - ~OTELSpan(); - OTELSpan& operator=(OTELSpan&& o); - OTELSpan& operator=(const OTELSpan&) = delete; - void swap(OTELSpan& other) { - std::swap(arena, other.arena); - std::swap(context, other.context); - std::swap(location, other.location); - std::swap(parentContext, other.parentContext); - std::swap(kind, other.kind); - std::swap(status, other.status); - std::swap(begin, other.begin); - std::swap(end, other.end); - std::swap(links, other.links); - std::swap(events, other.events); - } - - OTELSpan& addLink(const SpanContext& linkContext) { - links.push_back(arena, linkContext); - return *this; - } - - OTELSpan& addLinks(const std::initializer_list& linkContexts = {}) { - for (auto const& sc : linkContexts) { - links.push_back(arena, sc); - } - return *this; - } - - OTELSpan& addEvent(const OTELEventRef& event) { - events.push_back_deep(arena, event); - return *this; - } - - OTELSpan& addEvent(const StringRef& name, - const double& time, - const SmallVectorRef& attrs = SmallVectorRef()) { - return addEvent(OTELEventRef(name, time, attrs)); - } - - OTELSpan& addAttribute(const StringRef& key, const StringRef& value) { - attributes.push_back_deep(arena, KeyValueRef(key, value)); - return *this; - } - - Arena arena; - SpanContext context; - Location location; - SpanContext parentContext; - SpanKind kind; - SmallVectorRef links; - double begin = 0.0, end = 0.0; - SmallVectorRef attributes; // not necessarily sorted - SmallVectorRef events; - SpanStatus status; -}; - -// The user selects a tracer using a string passed to fdbserver on boot. -// Clients should not refer to TracerType directly, and mappings of names to -// values in this enum can change without notice. -enum class TracerType { - DISABLED = 0, - NETWORK_LOSSY = 1, - SIM_END = 2, // Any tracers that come after SIM_END will not be tested in simulation - LOG_FILE = 3 -}; - -struct ITracer { - virtual ~ITracer(); - virtual TracerType type() const = 0; - // passed ownership to the tracer - virtual void trace(Span const& span) = 0; - virtual void trace(OTELSpan const& span) = 0; -}; - -void openTracer(TracerType type); - -template -struct SpannedDeque : Deque { - Span span; - explicit SpannedDeque(Location loc) : span(loc) {} - SpannedDeque(SpannedDeque&& other) : Deque(std::move(other)), span(std::move(other.span)) {} - SpannedDeque(SpannedDeque const&) = delete; - SpannedDeque& operator=(SpannedDeque const&) = delete; - SpannedDeque& operator=(SpannedDeque&& other) { - *static_cast*>(this) = std::move(other); - span = std::move(other.span); - } -}; - -template -struct OTELSpannedDeque : Deque { - OTELSpan span; - explicit OTELSpannedDeque(Location loc) : span(loc) {} - OTELSpannedDeque(OTELSpannedDeque&& other) : Deque(std::move(other)), span(std::move(other.span)) {} - OTELSpannedDeque(OTELSpannedDeque const&) = delete; - OTELSpannedDeque& operator=(OTELSpannedDeque const&) = delete; - OTELSpannedDeque& operator=(OTELSpannedDeque&& other) { - *static_cast*>(this) = std::move(other); - span = std::move(other.span); - } -}; diff --git a/src/flow/WipedString.cpp b/src/flow/WipedString.cpp new file mode 100644 index 0000000..e9200ec --- /dev/null +++ b/src/flow/WipedString.cpp @@ -0,0 +1,258 @@ +#include "flow/FastAlloc.h" +#include "flow/ScopeExit.h" +#include "flow/UnitTest.h" +#include "flow/WipedString.h" +#include "flow/ObjectSerializer.h" +#include "flow/Net2Packet.h" +#include "flow/serialize.h" + +static_assert(detail::is_wipe_enabled); + +TEST_CASE("/flow/WipedString/basic") { + auto& rng = *deterministicRandom(); + for (auto iter = 0; iter < 100; iter++) { + auto randomString = rng.randomAlphaNumeric(rng.randomInt(1, 1000)); + // keeps arena-allocated memory from being really freed, for test purposes + auto kaScope = keepalive_allocator::ActiveScope(); + const uint8_t* begin = nullptr; + int size = 0; + { + StringRef rs(randomString); + WipedString ws(rs); + begin = ws.contents().begin(); + size = ws.contents().size(); + } + for (auto i = 0; i < size; i++) { + ASSERT_EQ(begin[i], 0); + } + } + return Void(); +} + +namespace unit_tests { + +void fillRandom(int& i) { + i = deterministicRandom()->randomInt(0, 10000); +} + +void fillRandom(int64_t& i) { + i = deterministicRandom()->randomInt64(0, 1e15); +} + +void fillRandom(double& d) { + auto i64 = deterministicRandom()->randomInt64(0, 1e15); + static_assert(sizeof(i64) == sizeof(double)); + d = *reinterpret_cast(&i64); +} + +void fillRandom(VectorRef& vi, Arena& arena, int minLen = 1, int maxLen = 100) { + vi.resize(arena, deterministicRandom()->randomInt(minLen, maxLen + 1)); + for (auto i = 0; i < vi.size(); i++) + fillRandom(vi[i]); +} + +void fillRandom(StringRef& s, Arena& arena, int minLen = 1, int maxLen = 100) { + const auto len = deterministicRandom()->randomInt(minLen, maxLen + 1); + s = StringRef(arena, deterministicRandom()->randomAlphaNumeric(len)); +} + +void fillRandom(VectorRef& vs, + Arena& arena, + int minLen = 1, + int maxLen = 100, + int minElementLen = 1, + int maxElementLen = 100) { + vs.resize(arena, deterministicRandom()->randomInt(minLen, maxLen + 1)); + for (auto i = 0; i < vs.size(); i++) + fillRandom(vs[i], arena, minElementLen, maxElementLen); +} + +void fillRandom(WipedString& ws, Arena& arena, int minLen = 1, int maxLen = 1000) { + StringRef s; + fillRandom(s, arena, minLen, maxLen); + ws = WipedString(s); +} + +void fillRandom(Optional& ows, Arena& arena, int minLen = 1, int maxLen = 1000) { + WipedString ws; + fillRandom(ws, arena, minLen, maxLen); + ows = ws; +} + +void fillRandom(std::vector& vws, + Arena& arena, + int minLen = 1, + int maxLen = 100, + int minElementLen = 10, + int maxElementLen = 1000) { + auto vs = VectorRef(); + fillRandom(vs, arena, minLen, maxLen); + for (auto s : vs) { + vws.push_back(WipedString(s)); + } +} + +// WipedString embedded in the middle of struct, with variable-length objects +struct WS_A { + constexpr static FileIdentifier file_identifier = 1557618; + Arena a; + int64_t i; + double d; + VectorRef vi; + WipedString ws; + StringRef s; + + static WS_A makeRandom() { + WS_A o; + fillRandom(o.i); + fillRandom(o.d); + fillRandom(o.vi, o.a, 0, 1000); + fillRandom(o.ws, o.a, 100, 1000); + fillRandom(o.s, o.a, 0, 1000); + return o; + } + + static WS_A makeMax() { + WS_A o; + fillRandom(o.i); + fillRandom(o.d); + fillRandom(o.vi, o.a, 9000, 10000); + fillRandom(o.ws, o.a, 9000, 10000); + fillRandom(o.s, o.a, 9000, 10000); + return o; + } + + template + void serialize(Ar& ar) { + serializer(ar, i, d, vi, ws, s, a); + } +}; + +// optional WipedString +struct WS_B { + constexpr static FileIdentifier file_identifier = 7621124; + Arena a; + Optional ows; + int64_t i; + StringRef s; + VectorRef vi; + VectorRef vs; + + static WS_B makeRandom() { + WS_B o; + fillRandom(o.ows, o.a, 100, 10000); + fillRandom(o.i); + fillRandom(o.s, o.a, 0, 10000); + fillRandom(o.vi, o.a, 0, 10000); + fillRandom(o.vs, o.a, 1, 10, 100, 1000); + return o; + } + + static WS_B makeMax() { + WS_B o; + fillRandom(o.ows, o.a, 9000, 10000); + fillRandom(o.i); + fillRandom(o.s, o.a, 9000, 10000); + fillRandom(o.vi, o.a, 9000, 10000); + fillRandom(o.vs, o.a, 50, 200, 100, 1000); + return o; + } + + template + void serialize(Ar& ar) { + serializer(ar, ows, i, s, vi, vs, a); + } +}; + +// vector of WipedStrings +struct WS_C { + constexpr static FileIdentifier file_identifier = 151112; + Arena a; + int64_t i; + StringRef s; + VectorRef vi; + std::vector vws; + VectorRef vs; + + static WS_C makeRandom() { + WS_C o; + fillRandom(o.i); + fillRandom(o.s, o.a, 100, 1000); + fillRandom(o.vi, o.a, 100, 1000); + fillRandom(o.vws, o.a, 10, 100, 100, 1000); + fillRandom(o.vs, o.a, 10, 100, 100, 200); + return o; + } + + static WS_C makeMax() { + WS_C o; + fillRandom(o.i); + fillRandom(o.s, o.a, 9000, 10000); + fillRandom(o.vi, o.a, 1000, 10000); + fillRandom(o.vws, o.a, 10, 20, 1000, 10000); + fillRandom(o.vs, o.a, 10, 100, 100, 200); + return o; + } + + template + void serialize(Ar& ar) { + serializer(ar, i, s, vi, vws, vs, a); + } +}; + +template +void testWipeAfterPacketSerialize(GenerateObjectFunc&& fn) { + // Note that kaScope is not created before object creation. + // This is because ArenaBlock wiping is not a target of this test function + auto obj = fn(); + { + // Emulate network packet writing with keepalive allocator active + auto pq = UnsentPacketQueue(); + auto kaScope = keepalive_allocator::ActiveScope(); + auto pb = pq.getWriteBuffer(); + auto pw = PacketWriter(pb, nullptr /* ReliablePacket* */, AssumeVersion(g_network->protocolVersion())); + // Below call serializes the object, marking sensitive areas for wiping in the process, + // because the serialized objects all have WipedString in it. + SerializeSource(obj).serializePacketWriter(pw); + pq.setWriteBuffer(pw.finish()); + auto const& wipedSet = keepalive_allocator::getWipedAreaSet(); + ASSERT_GT(wipedSet.size(), 0); + for (auto [begin, size] : wipedSet) { + for (auto i = 0; i < size; i++) { + // This weakly verifies that memory is filled with serialized string. + ASSERT(std::isalnum(begin[i])); + } + } + + // This should normally deallocate the packet buffers after wiping the sensitive region. + // With keepalive_allocator active, however, the memory is kept alive for post-free inspection. + pq.discardAll(); + for (auto [begin, size] : wipedSet) { + for (auto i = 0; i < size; i++) + ASSERT_EQ(begin[i], 0); + } + } +} + +} // namespace unit_tests + +TEST_CASE("/flow/WipedString/serialize/modest") { + for (auto i = 0; i < 100; i++) { + unit_tests::testWipeAfterPacketSerialize([]() { return unit_tests::WS_A::makeRandom(); }); + unit_tests::testWipeAfterPacketSerialize([]() { return unit_tests::WS_B::makeRandom(); }); + unit_tests::testWipeAfterPacketSerialize([]() { return unit_tests::WS_C::makeRandom(); }); + } + return Void(); +} + +TEST_CASE("/flow/WipedString/serialize/maximal") { + // Test with larger test objects fewer times to test wiping memory with larger allocation/serialization context + for (auto i = 0; i < 10; i++) { + unit_tests::testWipeAfterPacketSerialize([]() { return unit_tests::WS_A::makeMax(); }); + unit_tests::testWipeAfterPacketSerialize([]() { return unit_tests::WS_B::makeMax(); }); + unit_tests::testWipeAfterPacketSerialize([]() { return unit_tests::WS_C::makeMax(); }); + } + return Void(); +} + +void forceLinkWipedStringTests() {} diff --git a/src/flow/WriteOnlySet.actor.cpp b/src/flow/WriteOnlySet.actor.cpp index e75547c..96d7792 100644 --- a/src/flow/WriteOnlySet.actor.cpp +++ b/src/flow/WriteOnlySet.actor.cpp @@ -26,7 +26,6 @@ #include #include #include - #include "flow/actorcompiler.h" // has to be last include #ifdef ENABLE_SAMPLING diff --git a/src/flow/WriteOnlySet.actor.g.cpp b/src/flow/WriteOnlySet.actor.g.cpp index 9922c78..8542c9a 100644 --- a/src/flow/WriteOnlySet.actor.g.cpp +++ b/src/flow/WriteOnlySet.actor.g.cpp @@ -28,7 +28,6 @@ #include #include #include - #include "flow/actorcompiler.h" // has to be last include #ifdef ENABLE_SAMPLING @@ -179,22 +178,22 @@ using TestSet = WriteOnlySet; using Clock = std::chrono::steady_clock; // An actor that can join a set of threads in an async way. - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" // This generated class is to be used only via threadjoiner() - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" template - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" class ThreadjoinerActorState { - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" public: - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" ThreadjoinerActorState(std::shared_ptr> const& threads,std::shared_ptr const& set) - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" : threads(threads), - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" set(set) - #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" { fdb_probe_actor_create("threadjoiner", reinterpret_cast(this)); @@ -207,9 +206,9 @@ class ThreadjoinerActorState { int a_body1(int loopDepth=0) { try { - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" ; - #line 212 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -237,68 +236,68 @@ class ThreadjoinerActorState { } int a_body1loopBody1(int loopDepth) { - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" StrictFuture __when_expr_0 = delay(0.1); - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 244 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 249 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" for(unsigned i = 0;;) { - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" if (threads->size() == i) - #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" { break; } - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" auto& t = (*threads)[i]; - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" if (t.joinable()) - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" { - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" t.join(); - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" if (i + 1 < threads->size()) - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" { - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" std::swap(*threads->rbegin(), (*threads)[i]); - #line 278 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 277 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" } - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" threads->pop_back(); - #line 282 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 281 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" } else { - #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" ++i; - #line 288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 287 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" } } - #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" if (threads->empty()) - #line 293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 292 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" { - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" set->copy(); - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" ASSERT(instanceCounter.load() == 0); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ThreadjoinerActorState(); static_cast(this)->destroy(); return 0; } - #line 301 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ThreadjoinerActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -310,52 +309,52 @@ class ThreadjoinerActorState { } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" for(unsigned i = 0;;) { - #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" if (threads->size() == i) - #line 317 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" { break; } - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" auto& t = (*threads)[i]; - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" if (t.joinable()) - #line 325 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" { - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" t.join(); - #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" if (i + 1 < threads->size()) - #line 331 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 330 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" { - #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" std::swap(*threads->rbegin(), (*threads)[i]); - #line 335 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" } - #line 193 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" threads->pop_back(); - #line 339 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" } else { - #line 195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 194 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" ++i; - #line 345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 344 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" } } - #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 197 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" if (threads->empty()) - #line 350 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 349 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" { - #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 198 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" set->copy(); - #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" ASSERT(instanceCounter.load() == 0); - #line 201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 200 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ThreadjoinerActorState(); static_cast(this)->destroy(); return 0; } - #line 358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 357 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ThreadjoinerActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -428,16 +427,16 @@ class ThreadjoinerActorState { fdb_probe_actor_exit("threadjoiner", reinterpret_cast(this), 0); } - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" std::shared_ptr> threads; - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" std::shared_ptr set; - #line 435 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" }; // This generated class is to be used only via threadjoiner() - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" class ThreadjoinerActor final : public Actor, public ActorCallback< ThreadjoinerActor, 0, Void >, public FastAllocated, public ThreadjoinerActorState { - #line 440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -446,9 +445,9 @@ class ThreadjoinerActor final : public Actor, public ActorCallback< Thread void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< ThreadjoinerActor, 0, Void >; - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" ThreadjoinerActor(std::shared_ptr> const& threads,std::shared_ptr const& set) - #line 451 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" : Actor(), ThreadjoinerActorState(threads, set) { @@ -471,14 +470,14 @@ friend struct ActorCallback< ThreadjoinerActor, 0, Void >; } }; - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" [[nodiscard]] Future threadjoiner( std::shared_ptr> const& threads, std::shared_ptr const& set ) { - #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" return Future(new ThreadjoinerActor(threads, set)); - #line 478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 477 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" } -#line 205 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" +#line 204 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" // occasionally copy the contents of the past set. void testCopier(std::shared_ptr set, std::chrono::seconds runFor) { @@ -530,68 +529,68 @@ void writer(std::shared_ptr set, std::chrono::seconds runFor) { } // This unit test creates 5 writer threads and one copier thread. - #line 533 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" -// This generated class is to be used only via flowTestCase256() - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" -template - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" -class FlowTestCase256ActorState { - #line 539 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 532 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" +// This generated class is to be used only via flowTestCase255() + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" +template + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" +class FlowTestCase255ActorState { + #line 538 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" public: - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" - FlowTestCase256ActorState(UnitTestParameters const& params) - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + FlowTestCase255ActorState(UnitTestParameters const& params) + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" : params(params) - #line 546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase256", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase255", reinterpret_cast(this)); } - ~FlowTestCase256ActorState() + ~FlowTestCase255ActorState() { - fdb_probe_actor_destroy("flowTestCase256", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase255", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" if (g_network->isSimulated()) - #line 561 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" { - #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase256ActorState(); static_cast(this)->destroy(); return 0; } - #line 565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase256ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 258 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase255ActorState(); static_cast(this)->destroy(); return 0; } + #line 564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase255ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" auto set = std::make_shared(); - #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" auto threads = std::make_shared>(); - #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" std::chrono::seconds runFor(10); - #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" for(int i = 0;i < 5;++i) { - #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" threads->emplace_back([set, runFor]() { writer(set, runFor); }); - #line 581 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 580 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" } - #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" threads->emplace_back([set, runFor]() { testCopier(set, runFor); }); - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" StrictFuture __when_expr_0 = threadjoiner(threads, set); - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 589 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 588 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 267 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 593 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -604,36 +603,36 @@ class FlowTestCase256ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase256ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase255ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(Void const& _,int loopDepth) { - #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" TraceEvent("WriteOnlySetTestResult") .detail("Inserts", numInserts.load()) .detail("Erases", numErase.load()) .detail("Copies", numCopied.load()) .detail("LockedErase", numLockedErase.load()); - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase256ActorState(); static_cast(this)->destroy(); return 0; } - #line 619 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase256ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase255ActorState(); static_cast(this)->destroy(); return 0; } + #line 618 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase255ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 269 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" TraceEvent("WriteOnlySetTestResult") .detail("Inserts", numInserts.load()) .detail("Erases", numErase.load()) .detail("Copies", numCopied.load()) .detail("LockedErase", numLockedErase.load()); - #line 274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase256ActorState(); static_cast(this)->destroy(); return 0; } - #line 633 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase256ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 273 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase255ActorState(); static_cast(this)->destroy(); return 0; } + #line 632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase255ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -652,13 +651,13 @@ class FlowTestCase256ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase256Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase255Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase256Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase255Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase256", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase255", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -668,12 +667,12 @@ class FlowTestCase256ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase256", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase255", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase256Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase255Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase256", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase255", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -683,12 +682,12 @@ class FlowTestCase256ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase256", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase255", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase256Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase255Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase256", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase255", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -698,38 +697,38 @@ class FlowTestCase256ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase256", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase255", reinterpret_cast(this), 0); } - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" UnitTestParameters params; - #line 706 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 705 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase256() - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" -class FlowTestCase256Actor final : public Actor, public ActorCallback< FlowTestCase256Actor, 0, Void >, public FastAllocated, public FlowTestCase256ActorState { - #line 711 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" +// This generated class is to be used only via flowTestCase255() + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" +class FlowTestCase255Actor final : public Actor, public ActorCallback< FlowTestCase255Actor, 0, Void >, public FastAllocated, public FlowTestCase255ActorState { + #line 710 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase256Actor, 0, Void >; - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" - FlowTestCase256Actor(UnitTestParameters const& params) - #line 722 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" +friend struct ActorCallback< FlowTestCase255Actor, 0, Void >; + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + FlowTestCase255Actor(UnitTestParameters const& params) + #line 721 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" : Actor(), - FlowTestCase256ActorState(params) + FlowTestCase255ActorState(params) { - fdb_probe_actor_enter("flowTestCase256", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase255", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase256"); + this->lineage.setActorName("flowTestCase255"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase256", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase255", reinterpret_cast(this), -1); } void cancel() override @@ -737,19 +736,19 @@ friend struct ActorCallback< FlowTestCase256Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase256Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase255Actor, 0, Void >*)0, actor_cancelled()); break; } } }; - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" -static Future flowTestCase256( UnitTestParameters const& params ) { - #line 256 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" - return Future(new FlowTestCase256Actor(params)); - #line 749 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" +static Future flowTestCase255( UnitTestParameters const& params ) { + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" + return Future(new FlowTestCase255Actor(params)); + #line 748 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase256, "/flow/WriteOnlySet") +ACTOR_TEST_CASE(flowTestCase255, "/flow/WriteOnlySet") -#line 276 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" +#line 275 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/WriteOnlySet.actor.cpp" } // namespace #endif diff --git a/src/flow/XmlTraceLogFormatter.cpp b/src/flow/XmlTraceLogFormatter.cpp index dff1ca1..af5173c 100644 --- a/src/flow/XmlTraceLogFormatter.cpp +++ b/src/flow/XmlTraceLogFormatter.cpp @@ -20,7 +20,6 @@ #include "flow/flow.h" #include "flow/XmlTraceLogFormatter.h" -#include "flow/actorcompiler.h" void XmlTraceLogFormatter::addref() { ReferenceCounted::addref(); @@ -43,7 +42,7 @@ const char* XmlTraceLogFormatter::getFooter() const { } void XmlTraceLogFormatter::escape(std::ostringstream& oss, std::string source) const { - loop { + for (;;) { int index = source.find_first_of(std::string({ '&', '"', '<', '>', '\r', '\n', '\0' })); if (index == source.npos) { break; @@ -86,6 +85,6 @@ std::string XmlTraceLogFormatter::formatEvent(const TraceEventFields& fields) co oss << "\" "; } - oss << "/>\r\n"; + oss << "/>\n"; return std::move(oss).str(); } diff --git a/src/flow/config.h.cmake b/src/flow/config.h.cmake index 864d7c6..cad9c61 100644 --- a/src/flow/config.h.cmake +++ b/src/flow/config.h.cmake @@ -5,6 +5,8 @@ # define FDB_CLEAN_BUILD #endif // FDB_RELEASE #cmakedefine OPEN_FOR_IDE +#define FDB_SOURCE_DIR "${CMAKE_SOURCE_DIR}" +#define FDB_BINARY_DIR "${CMAKE_BINARY_DIR}" #ifdef WIN32 # define _WIN32_WINNT ${WINDOWS_TARGET} # define WINVER ${WINDOWS_TARGET} diff --git a/src/flow/flat_buffers.cpp b/src/flow/flat_buffers.cpp index ea1c1c2..d91be1f 100644 --- a/src/flow/flat_buffers.cpp +++ b/src/flow/flat_buffers.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -473,13 +474,13 @@ TEST_CASE("/flow/FlatBuffers/VectorRef") { vec.push_back(arena, str); } ObjectWriter writer(Unversioned()); - writer.serialize(FileIdentifierFor::value, arena, vec); + writer.serialize(FileIdentifierFor::value, vec); serializedVector = StringRef(readerArena, writer.toStringRef()); } ArenaObjectReader reader(readerArena, serializedVector, Unversioned()); - // The VectorRef and Arena arguments are intentionally in a different order from the serialize call above. + // The Arena argument is intentionally missing from the serialize call above. // Arenas need to get serialized after any Ref types whose memory they own. In order for schema evolution to be - // possible, it needs to be okay to reorder an Arena so that it appears after a newly added Ref type. For this + // possible, it needs to be okay to move/add an Arena so that it appears after a newly added Ref type. For this // reason, Arenas are ignored by the wire protocol entirely. We test that behavior here. reader.deserialize(FileIdentifierFor::value, outVec, vecArena); } diff --git a/src/flow/flow.cpp b/src/flow/flow.cpp index 26ea7af..aa4f465 100644 --- a/src/flow/flow.cpp +++ b/src/flow/flow.cpp @@ -19,13 +19,26 @@ */ #include "flow/flow.h" -#include "flow/DeterministicRandom.h" -#include "flow/UnitTest.h" -#include "flow/rte_memcpy.h" -#include "flow/folly_memcpy.h" + #include + #include +#include +#include + +#include + +#include "flow/DeterministicRandom.h" +#include "flow/Error.h" +#include "flow/Hostname.h" +#include "flow/rte_memcpy.h" +#include "flow/UnitTest.h" + +#ifdef WITH_FOLLY_MEMCPY +#include "folly_memcpy.h" +#endif + std::atomic startSampling = false; LineageReference rootLineage; thread_local LineageReference* currentLineage = &rootLineage; @@ -119,7 +132,7 @@ Reference nondeterministicRandom() { } std::string UID::toString() const { - return format("%016llx%016llx", part[0], part[1]); + return fmt::format("{:016x}{:016x}", part[0], part[1]); } UID UID::fromString(std::string const& s) { @@ -130,6 +143,19 @@ UID UID::fromString(std::string const& s) { return UID(a, b); } +UID UID::fromStringThrowsOnFailure(std::string const& s) { + if (s.size() != 32) { + // invalid string size + throw operation_failed(); + } + uint64_t a = 0, b = 0; + int r = sscanf(s.c_str(), "%16" SCNx64 "%16" SCNx64, &a, &b); + if (r != 2) { + throw operation_failed(); + } + return UID(a, b); +} + std::string UID::shortString() const { return format("%016llx", part[0]); } @@ -246,7 +272,7 @@ int vsformat(std::string& outputString, const char* form, va_list args) { return -1; } - TEST(true); // large format result + CODE_PROBE(true, "large format result"); outputString.resize(size + 1); size = vsnprintf(&outputString[0], outputString.size(), form, args); @@ -359,6 +385,77 @@ void enableBuggify(bool enabled, BuggifyType type) { buggifyActivated[int(type)] = enabled; } +// Make OpenSSL use DeterministicRandom as RNG source such that simulation runs stay deterministic w/ e.g. signature ops +void bindDeterministicRandomToOpenssl() { + // TODO: implement ifdef branch for 3.x using provider API +#ifndef OPENSSL_IS_BORINGSSL + static const RAND_METHOD method = { + // replacement for RAND_seed(), which reseeds OpenSSL RNG + [](const void*, int) -> int { return 1; }, + // replacement for RAND_bytes(), which fills given buffer with random byte sequence + [](unsigned char* buf, int length) -> int { + if (g_network) + ASSERT_ABORT(g_network->isSimulated()); + deterministicRandom()->randomBytes(buf, length); + return 1; + }, + // replacement for RAND_cleanup(), a no-op for simulation + []() -> void {}, + // replacement for RAND_add(), which reseeds OpenSSL RNG with randomness hint + [](const void*, int, double) -> int { return 1; }, + // replacement for default pseudobytes getter (same as RAND_bytes by default) + [](unsigned char* buf, int length) -> int { + if (g_network) + ASSERT_ABORT(g_network->isSimulated()); + deterministicRandom()->randomBytes(buf, length); + return 1; + }, + // status function for PRNG readiness check + []() -> int { return 1; }, + }; + + if (1 != ::RAND_set_rand_method(&method)) { + auto ec = ::ERR_get_error(); + char msg[256]{ + 0, + }; + if (ec) { + ::ERR_error_string_n(ec, msg, sizeof(msg)); + } + fprintf(stderr, + "ERROR: Failed to bind DeterministicRandom to OpenSSL RNG\n" + " OpenSSL error message: '%s'\n", + msg); + throw internal_error(); + } else { + printf("DeterministicRandom successfully bound to OpenSSL RNG\n"); + } +#else // OPENSSL_IS_BORINGSSL + static const RAND_METHOD method = { + [](const void*, int) -> void {}, + [](unsigned char* buf, unsigned long length) -> int { + if (g_network) + ASSERT_ABORT(g_network->isSimulated()); + ASSERT(length <= std::numeric_limits::max()); + deterministicRandom()->randomBytes(buf, length); + return 1; + }, + []() -> void {}, + [](const void*, int, double) -> void {}, + [](unsigned char* buf, unsigned long length) -> int { + if (g_network) + ASSERT_ABORT(g_network->isSimulated()); + ASSERT(length <= std::numeric_limits::max()); + deterministicRandom()->randomBytes(buf, length); + return 1; + }, + []() -> int { return 1; }, + }; + ::RAND_set_rand_method(&method); + printf("DeterministicRandom successfully bound to OpenSSL RNG\n"); +#endif // OPENSSL_IS_BORINGSSL +} + int nChooseK(int n, int k) { assert(n >= k && k >= 0); if (k == 0) { @@ -457,7 +554,7 @@ TEST_CASE("/flow/FlatBuffers/Standalone") { ASSERT(in == out); } { - StringRef in = LiteralStringRef("foobar"); + StringRef in = "foobar"_sr; Standalone out; ObjectWriter writer(Unversioned()); writer.serialize(in); @@ -474,3 +571,179 @@ TEST_CASE("/flow/FlatBuffers/Standalone") { TEST_CASE("noSim/noopTest") { return Void(); } + +struct TestErrorOrMapClass { + StringRef value; + ErrorOr errorOrValue; + + const StringRef constValue; + const ErrorOr constErrorOrValue; + + StringRef getValue() const { return value; } + ErrorOr getErrorOrValue() const { return errorOrValue; } + + StringRef const& getValueRef() const { return value; } + ErrorOr const& getErrorOrValueRef() const { return errorOrValue; } + + StringRef sub(int x) const { return value.substr(x); } + ErrorOr errorOrSub(int x) const { return errorOrValue.map(&StringRef::substr, (int)x); } + + TestErrorOrMapClass(StringRef value, Optional optionalValueError) + : value(value), constValue(value), + errorOrValue(!optionalValueError.present() ? ErrorOr(value) + : ErrorOr(optionalValueError.get())), + constErrorOrValue(!optionalValueError.present() ? ErrorOr(value) + : ErrorOr(optionalValueError.get())) {} +}; + +struct TestErrorOrMapClassRef : public TestErrorOrMapClass, public ReferenceCounted { + TestErrorOrMapClassRef(StringRef value, Optional optionalValueError) + : TestErrorOrMapClass(value, optionalValueError) {} +}; + +void checkResults(std::vector> const& results, + StringRef value, + Optional expectedError, + std::string context) { + if (expectedError.present()) { + for (int i = 0; i < results.size(); ++i) { + if (results[i].present() || results[i].getError().code() != expectedError.get().code()) { + fmt::print("Unexpected result at index {} in {}\n", i, context); + ASSERT(false); + } + } + } else { + for (int i = 0; i < results.size(); ++i) { + if (!results[i].present()) { + fmt::print("Missing result {} at index {} in {}\n", value.printable(), i, context); + ASSERT(false); + } + + if (i < results.size() - 1) { + if (results[i].get() != value) { + fmt::print("Incorrect result {} at index {} in {}: expected {}\n", + results[i].get().printable(), + i, + context, + value.printable()); + ASSERT(false); + } + } else { + if (results[i].get() != value.substr(5)) { + fmt::print("Incorrect result {} at index {} in {}: expected {}\n", + results[i].get().printable(), + i, + context, + value.substr(5).printable()); + ASSERT(false); + } + } + } + } +} + +template +void checkErrorOr(ErrorOr val) { + StringRef value; + bool isError = !val.present(); + bool isFlatMapError = isError; + Optional expectedError; + std::vector> mapResults; + std::vector> flatMapResults; + + if (isError) { + expectedError = val.getError(); + } + + if constexpr (IsRef) { + if (!isError && !val.get()) { + isError = isFlatMapError = true; + expectedError = default_error_or(); + } + if (!isError) { + value = val.get()->value; + isFlatMapError = !val.get()->errorOrValue.present(); + if (isFlatMapError) { + expectedError = val.get()->errorOrValue.getError(); + } + } + mapResults.push_back(val.mapRef(&TestErrorOrMapClass::value)); + mapResults.push_back(val.mapRef(&TestErrorOrMapClass::constValue)); + mapResults.push_back(val.mapRef(&TestErrorOrMapClass::getValue)); + mapResults.push_back(val.mapRef(&TestErrorOrMapClass::getValueRef)); + mapResults.push_back(val.mapRef(&TestErrorOrMapClass::sub, 5)); + + flatMapResults.push_back(val.flatMap([](auto t) { return t ? t->errorOrValue : ErrorOr(); })); + flatMapResults.push_back(val.flatMapRef(&TestErrorOrMapClass::errorOrValue)); + flatMapResults.push_back(val.flatMapRef(&TestErrorOrMapClass::constErrorOrValue)); + flatMapResults.push_back(val.flatMapRef(&TestErrorOrMapClass::getErrorOrValue)); + flatMapResults.push_back(val.flatMapRef(&TestErrorOrMapClass::getErrorOrValueRef)); + flatMapResults.push_back(val.flatMapRef(&TestErrorOrMapClass::errorOrSub, 5)); + } else { + if (!isError) { + value = val.get().value; + isFlatMapError = !val.get().errorOrValue.present(); + if (isFlatMapError) { + expectedError = val.get().errorOrValue.getError(); + } + } + mapResults.push_back(val.map([](auto t) { return t.value; })); + mapResults.push_back(val.map(&TestErrorOrMapClass::value)); + mapResults.push_back(val.map(&TestErrorOrMapClass::constValue)); + mapResults.push_back(val.map(&TestErrorOrMapClass::getValue)); + mapResults.push_back(val.map(&TestErrorOrMapClass::getValueRef)); + mapResults.push_back(val.map(&TestErrorOrMapClass::sub, 5)); + + flatMapResults.push_back(val.flatMap([](auto t) { return t.errorOrValue; })); + flatMapResults.push_back(val.flatMap(&TestErrorOrMapClass::errorOrValue)); + flatMapResults.push_back(val.flatMap(&TestErrorOrMapClass::constErrorOrValue)); + flatMapResults.push_back(val.flatMap(&TestErrorOrMapClass::getErrorOrValue)); + flatMapResults.push_back(val.flatMap(&TestErrorOrMapClass::getErrorOrValueRef)); + flatMapResults.push_back(val.flatMap(&TestErrorOrMapClass::errorOrSub, 5)); + } + + checkResults(mapResults, value, isError ? expectedError : Optional(), IsRef ? "ref map" : "non-ref map"); + checkResults(flatMapResults, + value, + isFlatMapError ? expectedError : Optional(), + IsRef ? "ref flat map" : "non-ref flat map"); +} + +TEST_CASE("/flow/ErrorOr/Map") { + // ErrorOr + checkErrorOr(ErrorOr()); + checkErrorOr(ErrorOr(transaction_too_old())); + checkErrorOr(ErrorOr(TestErrorOrMapClass("test_string"_sr, {}))); + checkErrorOr(ErrorOr(TestErrorOrMapClass("test_string"_sr, default_error_or()))); + checkErrorOr(ErrorOr(TestErrorOrMapClass("test_string"_sr, transaction_too_old()))); + + // ErrorOr> + checkErrorOr(ErrorOr>()); + checkErrorOr(ErrorOr>(Reference())); + checkErrorOr(ErrorOr>(transaction_too_old())); + checkErrorOr(ErrorOr>( + makeReference("test_string"_sr, Optional()))); + checkErrorOr(ErrorOr>( + makeReference("test_string"_sr, Optional(default_error_or())))); + checkErrorOr(ErrorOr>( + makeReference("test_string"_sr, Optional(transaction_too_old())))); + + // ErrorOr + checkErrorOr(ErrorOr()); + checkErrorOr(ErrorOr(nullptr)); + checkErrorOr(ErrorOr(transaction_too_old())); + + auto ptr = new TestErrorOrMapClass("test_string"_sr, Optional()); + checkErrorOr(ErrorOr(ptr)); + delete ptr; + + ptr = new TestErrorOrMapClass("test_string"_sr, default_error_or()); + checkErrorOr(ErrorOr(ptr)); + delete ptr; + + ptr = new TestErrorOrMapClass("test_string"_sr, transaction_too_old()); + checkErrorOr(ErrorOr(ptr)); + delete ptr; + + return Void(); +} diff --git a/src/flow/folly_memcpy.S b/src/flow/folly_memcpy.S deleted file mode 100644 index 66361a7..0000000 --- a/src/flow/folly_memcpy.S +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * 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. - */ - -/* - * memcpy: An optimized memcpy implementation for x86_64. It uses AVX when - * __AVX__ is defined, and uses SSE2 otherwise. - * - * @author Bin Liu - */ - -#if defined(__x86_64__) && defined(__linux__) && !defined(__CYGWIN__) - - .file "memcpy.S" - .text - -/* - * _memcpy_short is a local helper used when length < 8. It cannot be called - * from outside, because it expects a non-standard calling convention: - * - * %rax: destination buffer address. - * %rsi: source buffer address. - * %edx: length, in the range of [0, 7] - */ - .type _memcpy_short, @function -_memcpy_short: -.LSHORT: - .cfi_startproc - // if (length == 0) return; - test %edx, %edx - jz .LEND - - movzbl (%rsi), %ecx - // if (length - 4 < 0) goto LS4; - sub $4, %edx - jb .LS4 - - mov (%rsi), %ecx - mov (%rsi, %rdx), %edi - mov %ecx, (%rax) - mov %edi, (%rax, %rdx) -.LEND: - rep - ret - nop - -.LS4: - // At this point, length can be 1 or 2 or 3, and $cl contains - // the first byte. - mov %cl, (%rax) - // if (length - 4 + 2 < 0) return; - add $2, %edx - jnc .LEND - - // length is 2 or 3 here. In either case, just copy the last - // two bytes. - movzwl (%rsi, %rdx), %ecx - mov %cx, (%rax, %rdx) - ret - - .cfi_endproc - .size _memcpy_short, .-_memcpy_short - - -/* - * void* memcpy(void* dst, void* src, uint32_t length); - * - */ - .align 16 - .globl folly_memcpy - .type folly_memcpy, @function -folly_memcpy: - .cfi_startproc - - mov %rdx, %rcx - mov %rdi, %rax - cmp $8, %rdx - jb .LSHORT - - mov -8(%rsi, %rdx), %r8 - mov (%rsi), %r9 - mov %r8, -8(%rdi, %rdx) - and $24, %rcx - jz .L32 - - mov %r9, (%rdi) - mov %rcx, %r8 - sub $16, %rcx - jb .LT32 -#ifndef __AVX__ - movdqu (%rsi, %rcx), %xmm1 - movdqu %xmm1, (%rdi, %rcx) -#else - vmovdqu (%rsi, %rcx), %xmm1 - vmovdqu %xmm1, (%rdi, %rcx) -#endif - // Test if there are 32-byte groups -.LT32: - add %r8, %rsi - and $-32, %rdx - jnz .L32_adjDI - ret - - .align 16 -.L32_adjDI: - add %r8, %rdi -.L32: -#ifndef __AVX__ - movdqu (%rsi), %xmm0 - movdqu 16(%rsi), %xmm1 -#else - vmovdqu (%rsi), %ymm0 -#endif - shr $6, %rdx - jnc .L64_32read -#ifndef __AVX__ - movdqu %xmm0, (%rdi) - movdqu %xmm1, 16(%rdi) -#else - vmovdqu %ymm0, (%rdi) -#endif - lea 32(%rsi), %rsi - jnz .L64_adjDI -#ifdef __AVX__ - vzeroupper -#endif - ret - -.L64_adjDI: - add $32, %rdi - -.L64: -#ifndef __AVX__ - movdqu (%rsi), %xmm0 - movdqu 16(%rsi), %xmm1 -#else - vmovdqu (%rsi), %ymm0 -#endif - -.L64_32read: -#ifndef __AVX__ - movdqu 32(%rsi), %xmm2 - movdqu 48(%rsi), %xmm3 - add $64, %rsi - movdqu %xmm0, (%rdi) - movdqu %xmm1, 16(%rdi) - movdqu %xmm2, 32(%rdi) - movdqu %xmm3, 48(%rdi) -#else - vmovdqu 32(%rsi), %ymm1 - add $64, %rsi - vmovdqu %ymm0, (%rdi) - vmovdqu %ymm1, 32(%rdi) -#endif - add $64, %rdi - dec %rdx - jnz .L64 -#ifdef __AVX__ - vzeroupper -#endif - ret - - .cfi_endproc - .size folly_memcpy, .-folly_memcpy - -#endif diff --git a/src/flow/genericactors.actor.cpp b/src/flow/genericactors.actor.cpp index c90a8a0..fc88c9b 100644 --- a/src/flow/genericactors.actor.cpp +++ b/src/flow/genericactors.actor.cpp @@ -70,6 +70,24 @@ ACTOR Future timeoutWarningCollector(FutureStream input, double logD } } +ACTOR Future waitForMost(std::vector>> futures, + int faultTolerance, + Error e, + double waitMultiplierForSlowFutures) { + state std::vector> successFutures; + state double startTime = now(); + successFutures.reserve(futures.size()); + for (const auto& future : futures) { + successFutures.push_back(fmap([](auto const& result) { return result.present(); }, future)); + } + bool success = wait(quorumEqualsTrue(successFutures, successFutures.size() - faultTolerance)); + if (!success) { + throw e; + } + wait(delay((now() - startTime) * waitMultiplierForSlowFutures) || waitForAll(successFutures)); + return Void(); +} + ACTOR Future quorumEqualsTrue(std::vector> futures, int required) { state std::vector> true_futures; state std::vector> false_futures; @@ -176,6 +194,14 @@ ACTOR Future testSubscriber(Reference> output, Optiona } } +static Future> goodTestFuture(double duration) { + return tag(delay(duration), ErrorOr(Void())); +} + +static Future> badTestFuture(double duration, Error e) { + return tag(delay(duration), ErrorOr(e)); +} + } // namespace TEST_CASE("/flow/genericactors/AsyncListener") { @@ -188,3 +214,55 @@ TEST_CASE("/flow/genericactors/AsyncListener") { ASSERT(!subscriber2.isReady()); return Void(); } + +TEST_CASE("/flow/genericactors/WaitForMost") { + state std::vector>> futures; + { + futures = { goodTestFuture(1), goodTestFuture(2), goodTestFuture(3) }; + wait(waitForMost(futures, 1, operation_failed(), 0.0)); // Don't wait for slowest future + ASSERT(!futures[2].isReady()); + } + { + futures = { goodTestFuture(1), goodTestFuture(2), goodTestFuture(3) }; + wait(waitForMost(futures, 0, operation_failed(), 0.0)); // Wait for all futures + ASSERT(futures[2].isReady()); + } + { + futures = { goodTestFuture(1), goodTestFuture(2), goodTestFuture(3) }; + wait(waitForMost(futures, 1, operation_failed(), 1.0)); // Wait for slowest future + ASSERT(futures[2].isReady()); + } + { + futures = { goodTestFuture(1), goodTestFuture(2), badTestFuture(1, success()) }; + wait(waitForMost(futures, 1, operation_failed(), 1.0)); // Error ignored + } + { + futures = { goodTestFuture(1), goodTestFuture(2), badTestFuture(1, success()) }; + try { + wait(waitForMost(futures, 0, operation_failed(), 1.0)); + ASSERT(false); + } catch (Error& e) { + ASSERT_EQ(e.code(), error_code_operation_failed); + } + } + return Void(); +} + +#if false +TEST_CASE("/flow/genericactors/generic/storeTuple") { + state std::vector resA; + state int resB; + state double resC; + + state Promise, int, double>> promise; + + auto future = storeTuple(promise.getFuture(), resA, resB, resC); + + promise.send(std::make_tuple(std::vector(10), 15, 2.0)); + wait(ready(future)); + ASSERT(resA.size() == 10); + ASSERT(resB == 15); + ASSERT(resC == 2.0); + return Void(); +} +#endif diff --git a/src/flow/genericactors.actor.g.cpp b/src/flow/genericactors.actor.g.cpp index 980250b..57ba620 100644 --- a/src/flow/genericactors.actor.g.cpp +++ b/src/flow/genericactors.actor.g.cpp @@ -1010,25 +1010,359 @@ friend struct ActorCallback< TimeoutWarningCollectorActor, 1, Void >; #line 1011 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" namespace { -// This generated class is to be used only via quorumEqualsTrue() +// This generated class is to be used only via waitForMost() #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" -template +template #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" -class QuorumEqualsTrueActorState { +class WaitForMostActorState { #line 1018 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" public: #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - QuorumEqualsTrueActorState(std::vector> const& futures,int const& required) + WaitForMostActorState(std::vector>> const& futures,int const& faultTolerance,Error const& e,double const& waitMultiplierForSlowFutures) #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" : futures(futures), #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + faultTolerance(faultTolerance), + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + e(e), + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + waitMultiplierForSlowFutures(waitMultiplierForSlowFutures), + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + successFutures(), + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + startTime(now()) + #line 1035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + { + fdb_probe_actor_create("waitForMost", reinterpret_cast(this)); + + } + ~WaitForMostActorState() + { + fdb_probe_actor_destroy("waitForMost", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + successFutures.reserve(futures.size()); + #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + for( const auto& future : futures ) { + #line 81 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + successFutures.push_back(fmap([](auto const& result) { return result.present(); }, future)); + #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + } + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + StrictFuture __when_expr_0 = quorumEqualsTrue(successFutures, successFutures.size() - faultTolerance); + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1065 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~WaitForMostActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(bool const& success,int loopDepth) + { + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (!success) + #line 1088 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + { + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 1092 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + } + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + StrictFuture __when_expr_1 = delay((now() - startTime) * waitMultiplierForSlowFutures) || waitForAll(successFutures); + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1098 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(bool && success,int loopDepth) + { + #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (!success) + #line 1112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + { + #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + return a_body1Catch1(e, loopDepth); + #line 1116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + } + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + StrictFuture __when_expr_1 = delay((now() - startTime) * waitMultiplierForSlowFutures) || waitForAll(successFutures); + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 1122 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 1127 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1when1(bool const& success,int loopDepth) + { + loopDepth = a_body1cont1(success, loopDepth); + + return loopDepth; + } + int a_body1when1(bool && success,int loopDepth) + { + loopDepth = a_body1cont1(std::move(success), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WaitForMostActor, 0, bool >::remove(); + + } + void a_callback_fire(ActorCallback< WaitForMostActor, 0, bool >*,bool const& value) + { + fdb_probe_actor_enter("waitForMost", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForMost", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< WaitForMostActor, 0, bool >*,bool && value) + { + fdb_probe_actor_enter("waitForMost", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForMost", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< WaitForMostActor, 0, bool >*,Error err) + { + fdb_probe_actor_enter("waitForMost", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForMost", reinterpret_cast(this), 0); + + } + int a_body1cont3(Void const& _,int loopDepth) + { + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitForMostActorState(); static_cast(this)->destroy(); return 0; } + #line 1199 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WaitForMostActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont3(Void && _,int loopDepth) + { + #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~WaitForMostActorState(); static_cast(this)->destroy(); return 0; } + #line 1211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~WaitForMostActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont3(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont3(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< WaitForMostActor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< WaitForMostActor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("waitForMost", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForMost", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< WaitForMostActor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("waitForMost", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForMost", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< WaitForMostActor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("waitForMost", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("waitForMost", reinterpret_cast(this), 1); + + } + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + std::vector>> futures; + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + int faultTolerance; + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + Error e; + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + double waitMultiplierForSlowFutures; + #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + std::vector> successFutures; + #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + double startTime; + #line 1294 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +}; +// This generated class is to be used only via waitForMost() + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +class WaitForMostActor final : public Actor, public ActorCallback< WaitForMostActor, 0, bool >, public ActorCallback< WaitForMostActor, 1, Void >, public FastAllocated, public WaitForMostActorState { + #line 1299 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< WaitForMostActor, 0, bool >; +friend struct ActorCallback< WaitForMostActor, 1, Void >; + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + WaitForMostActor(std::vector>> const& futures,int const& faultTolerance,Error const& e,double const& waitMultiplierForSlowFutures) + #line 1311 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + : Actor(), + WaitForMostActorState(futures, faultTolerance, e, waitMultiplierForSlowFutures) + { + fdb_probe_actor_enter("waitForMost", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("waitForMost"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("waitForMost", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< WaitForMostActor, 0, bool >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< WaitForMostActor, 1, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +[[nodiscard]] Future waitForMost( std::vector>> const& futures, int const& faultTolerance, Error const& e, double const& waitMultiplierForSlowFutures ) { + #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + return Future(new WaitForMostActor(futures, faultTolerance, e, waitMultiplierForSlowFutures)); + #line 1340 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +} + +#line 90 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + + #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +namespace { +// This generated class is to be used only via quorumEqualsTrue() + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +template + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +class QuorumEqualsTrueActorState { + #line 1352 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +public: + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + QuorumEqualsTrueActorState(std::vector> const& futures,int const& required) + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + : futures(futures), + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" required(required), - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" true_futures(), - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" false_futures() - #line 1031 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1365 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" { fdb_probe_actor_create("quorumEqualsTrue", reinterpret_cast(this)); @@ -1041,34 +1375,34 @@ class QuorumEqualsTrueActorState { int a_body1(int loopDepth=0) { try { - #line 76 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" true_futures.reserve(futures.size()); - #line 77 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" false_futures.reserve(futures.size()); - #line 78 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" for(int i = 0;i < futures.size();i++) { - #line 79 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" true_futures.push_back(onEqual(futures[i], true)); - #line 80 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 98 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" false_futures.push_back(onEqual(futures[i], false)); - #line 1054 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1388 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" } - #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" StrictFuture __when_expr_0 = quorum(true_futures, required); - #line 83 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1060 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1394 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" StrictFuture __when_expr_1 = quorum(false_futures, futures.size() - required + 1); - #line 1064 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1398 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 84 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 102 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 87 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1071 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1405 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1089,9 +1423,9 @@ class QuorumEqualsTrueActorState { } int a_body1when1(Void const& _,int loopDepth) { - #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~QuorumEqualsTrueActorState(); static_cast(this)->destroy(); return 0; } - #line 1094 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1428 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~QuorumEqualsTrueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1101,9 +1435,9 @@ class QuorumEqualsTrueActorState { } int a_body1when1(Void && _,int loopDepth) { - #line 85 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 103 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~QuorumEqualsTrueActorState(); static_cast(this)->destroy(); return 0; } - #line 1106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1440 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~QuorumEqualsTrueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1113,9 +1447,9 @@ class QuorumEqualsTrueActorState { } int a_body1when2(Void const& _,int loopDepth) { - #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~QuorumEqualsTrueActorState(); static_cast(this)->destroy(); return 0; } - #line 1118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1452 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~QuorumEqualsTrueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1125,9 +1459,9 @@ class QuorumEqualsTrueActorState { } int a_body1when2(Void && _,int loopDepth) { - #line 88 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~QuorumEqualsTrueActorState(); static_cast(this)->destroy(); return 0; } - #line 1130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1464 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~QuorumEqualsTrueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1232,20 +1566,20 @@ class QuorumEqualsTrueActorState { fdb_probe_actor_exit("quorumEqualsTrue", reinterpret_cast(this), 1); } - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" std::vector> futures; - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" int required; - #line 74 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" std::vector> true_futures; - #line 75 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" std::vector> false_futures; - #line 1243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" }; // This generated class is to be used only via quorumEqualsTrue() - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" class QuorumEqualsTrueActor final : public Actor, public ActorCallback< QuorumEqualsTrueActor, 0, Void >, public ActorCallback< QuorumEqualsTrueActor, 1, Void >, public FastAllocated, public QuorumEqualsTrueActorState { - #line 1248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1582 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1255,9 +1589,9 @@ class QuorumEqualsTrueActor final : public Actor, public ActorCallback< Qu #pragma clang diagnostic pop friend struct ActorCallback< QuorumEqualsTrueActor, 0, Void >; friend struct ActorCallback< QuorumEqualsTrueActor, 1, Void >; - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" QuorumEqualsTrueActor(std::vector> const& futures,int const& required) - #line 1260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1594 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" : Actor(), QuorumEqualsTrueActorState(futures, required) { @@ -1281,30 +1615,30 @@ friend struct ActorCallback< QuorumEqualsTrueActor, 1, Void >; } }; } - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" [[nodiscard]] Future quorumEqualsTrue( std::vector> const& futures, int const& required ) { - #line 73 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 91 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" return Future(new QuorumEqualsTrueActor(futures, required)); - #line 1288 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1622 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" } -#line 92 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +#line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - #line 1293 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1627 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" namespace { // This generated class is to be used only via shortCircuitAny() - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" template - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" class ShortCircuitAnyActorState { - #line 1300 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1634 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" public: - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" ShortCircuitAnyActorState(std::vector> const& f) - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" : f(f) - #line 1307 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1641 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" { fdb_probe_actor_create("shortCircuitAny", reinterpret_cast(this)); @@ -1317,32 +1651,32 @@ class ShortCircuitAnyActorState { int a_body1(int loopDepth=0) { try { - #line 94 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" std::vector> sc; - #line 95 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" sc.reserve(f.size()); - #line 96 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 114 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" for( Future fut : f ) { - #line 97 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 115 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" sc.push_back(returnIfTrue(fut)); - #line 1328 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1662 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" } - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" StrictFuture __when_expr_0 = waitForAll(f); - #line 100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 118 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1334 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1668 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" StrictFuture __when_expr_1 = waitForAny(sc); - #line 1338 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1when2(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 101 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 119 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 112 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1345 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1363,24 +1697,24 @@ class ShortCircuitAnyActorState { } int a_body1when1(Void const& _,int loopDepth) { - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" for( const auto& fut : f ) { - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (fut.get()) - #line 1370 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1704 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" { - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~ShortCircuitAnyActorState(); static_cast(this)->destroy(); return 0; } - #line 1374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~ShortCircuitAnyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~ShortCircuitAnyActorState(); static_cast(this)->destroy(); return 0; } - #line 1383 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1717 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~ShortCircuitAnyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1390,24 +1724,24 @@ class ShortCircuitAnyActorState { } int a_body1when1(Void && _,int loopDepth) { - #line 105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 123 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" for( const auto& fut : f ) { - #line 106 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 124 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (fut.get()) - #line 1397 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1731 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" { - #line 107 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 125 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~ShortCircuitAnyActorState(); static_cast(this)->destroy(); return 0; } - #line 1401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~ShortCircuitAnyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } } - #line 110 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(false); this->~ShortCircuitAnyActorState(); static_cast(this)->destroy(); return 0; } - #line 1410 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1744 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(false); this->~ShortCircuitAnyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1417,9 +1751,9 @@ class ShortCircuitAnyActorState { } int a_body1when2(Void const& _,int loopDepth) { - #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~ShortCircuitAnyActorState(); static_cast(this)->destroy(); return 0; } - #line 1422 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1756 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~ShortCircuitAnyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1429,9 +1763,9 @@ class ShortCircuitAnyActorState { } int a_body1when2(Void && _,int loopDepth) { - #line 113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(true); this->~ShortCircuitAnyActorState(); static_cast(this)->destroy(); return 0; } - #line 1434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1768 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" new (&static_cast(this)->SAV< bool >::value()) bool(true); this->~ShortCircuitAnyActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1536,14 +1870,14 @@ class ShortCircuitAnyActorState { fdb_probe_actor_exit("shortCircuitAny", reinterpret_cast(this), 1); } - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" std::vector> f; - #line 1541 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1875 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" }; // This generated class is to be used only via shortCircuitAny() - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" class ShortCircuitAnyActor final : public Actor, public ActorCallback< ShortCircuitAnyActor, 0, Void >, public ActorCallback< ShortCircuitAnyActor, 1, Void >, public FastAllocated, public ShortCircuitAnyActorState { - #line 1546 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1880 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1553,9 +1887,9 @@ class ShortCircuitAnyActor final : public Actor, public ActorCallback< Sho #pragma clang diagnostic pop friend struct ActorCallback< ShortCircuitAnyActor, 0, Void >; friend struct ActorCallback< ShortCircuitAnyActor, 1, Void >; - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" ShortCircuitAnyActor(std::vector> const& f) - #line 1558 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1892 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" : Actor(), ShortCircuitAnyActorState(f) { @@ -1579,14 +1913,14 @@ friend struct ActorCallback< ShortCircuitAnyActor, 1, Void >; } }; } - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" [[nodiscard]] Future shortCircuitAny( std::vector> const& f ) { - #line 93 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 111 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" return Future(new ShortCircuitAnyActor(f)); - #line 1586 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" } -#line 117 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +#line 135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" Future orYield(Future f) { if (f.isReady()) { @@ -1598,21 +1932,21 @@ Future orYield(Future f) { return f; } - #line 1601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" namespace { // This generated class is to be used only via returnIfTrue() - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" template - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" class ReturnIfTrueActorState { - #line 1608 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1942 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" public: - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" ReturnIfTrueActorState(Future const& f) - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" : f(f) - #line 1615 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1949 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" { fdb_probe_actor_create("returnIfTrue", reinterpret_cast(this)); @@ -1625,16 +1959,16 @@ class ReturnIfTrueActorState { int a_body1(int loopDepth=0) { try { - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" StrictFuture __when_expr_0 = f; - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1632 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1966 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 129 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 147 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1637 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1971 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -1655,56 +1989,56 @@ class ReturnIfTrueActorState { } int a_body1cont1(bool const& b,int loopDepth) { - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (b) - #line 1660 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1994 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" { - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReturnIfTrueActorState(); static_cast(this)->destroy(); return 0; } - #line 1664 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 1998 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ReturnIfTrueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" StrictFuture __when_expr_1 = Never(); - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1674 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2008 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1679 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2013 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" loopDepth = 0; return loopDepth; } int a_body1cont1(bool && b,int loopDepth) { - #line 130 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (b) - #line 1688 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2022 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" { - #line 131 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 149 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~ReturnIfTrueActorState(); static_cast(this)->destroy(); return 0; } - #line 1692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~ReturnIfTrueActorState(); static_cast(this)->finishSendAndDelPromiseRef(); return 0; } - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" StrictFuture __when_expr_1 = Never(); - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 1702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2036 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; static_cast(this)->actor_wait_state = 2; - #line 133 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1707 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2041 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -1774,17 +2108,17 @@ class ReturnIfTrueActorState { } int a_body1cont2(Void const& _,int loopDepth) { - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" return a_body1Catch1(internal_error(), loopDepth); - #line 1779 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2113 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" return loopDepth; } int a_body1cont2(Void && _,int loopDepth) { - #line 134 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 152 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" return a_body1Catch1(internal_error(), loopDepth); - #line 1787 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2121 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" return loopDepth; } @@ -1851,14 +2185,14 @@ class ReturnIfTrueActorState { fdb_probe_actor_exit("returnIfTrue", reinterpret_cast(this), 1); } - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" Future f; - #line 1856 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" }; // This generated class is to be used only via returnIfTrue() - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" class ReturnIfTrueActor final : public Actor, public ActorCallback< ReturnIfTrueActor, 0, bool >, public ActorCallback< ReturnIfTrueActor, 1, Void >, public FastAllocated, public ReturnIfTrueActorState { - #line 1861 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2195 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -1868,9 +2202,9 @@ class ReturnIfTrueActor final : public Actor, public ActorCallback< Return #pragma clang diagnostic pop friend struct ActorCallback< ReturnIfTrueActor, 0, bool >; friend struct ActorCallback< ReturnIfTrueActor, 1, Void >; - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" ReturnIfTrueActor(Future const& f) - #line 1873 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" : Actor(), ReturnIfTrueActorState(f) { @@ -1895,34 +2229,34 @@ friend struct ActorCallback< ReturnIfTrueActor, 1, Void >; } }; } - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" [[nodiscard]] Future returnIfTrue( Future const& f ) { - #line 128 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" return Future(new ReturnIfTrueActor(f)); - #line 1902 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" } -#line 136 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +#line 154 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - #line 1907 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2241 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" namespace { // This generated class is to be used only via lowPriorityDelay() - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" template - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" class LowPriorityDelayActorState { - #line 1914 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" public: - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" LowPriorityDelayActorState(double const& waitTime) - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" : waitTime(waitTime), - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" loopCount(0), - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" totalLoops(std::max(waitTime / FLOW_KNOBS->LOW_PRIORITY_MAX_DELAY, FLOW_KNOBS->LOW_PRIORITY_DELAY_COUNT)) - #line 1925 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" { fdb_probe_actor_create("lowPriorityDelay", reinterpret_cast(this)); @@ -1935,9 +2269,9 @@ class LowPriorityDelayActorState { int a_body1(int loopDepth=0) { try { - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" ; - #line 1940 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2274 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -1958,9 +2292,9 @@ class LowPriorityDelayActorState { } int a_body1cont1(int loopDepth) { - #line 146 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~LowPriorityDelayActorState(); static_cast(this)->destroy(); return 0; } - #line 1963 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2297 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~LowPriorityDelayActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -1977,22 +2311,22 @@ class LowPriorityDelayActorState { } int a_body1loopBody1(int loopDepth) { - #line 142 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!(loopCount < totalLoops)) - #line 1982 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2316 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" StrictFuture __when_expr_0 = delay(waitTime / totalLoops, TaskPriority::Low); - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 1990 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2324 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 143 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 1995 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2329 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2012,18 +2346,18 @@ class LowPriorityDelayActorState { } int a_body1loopBody1cont1(Void const& _,int loopDepth) { - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" loopCount++; - #line 2017 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2351 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } int a_body1loopBody1cont1(Void && _,int loopDepth) { - #line 144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" loopCount++; - #line 2026 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2360 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; @@ -2091,18 +2425,18 @@ class LowPriorityDelayActorState { fdb_probe_actor_exit("lowPriorityDelay", reinterpret_cast(this), 0); } - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" double waitTime; - #line 138 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 156 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" int loopCount; - #line 139 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 157 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" int totalLoops; - #line 2100 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2434 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" }; // This generated class is to be used only via lowPriorityDelay() - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" class LowPriorityDelayActor final : public Actor, public ActorCallback< LowPriorityDelayActor, 0, Void >, public FastAllocated, public LowPriorityDelayActorState { - #line 2105 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2439 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" public: using FastAllocated::operator new; using FastAllocated::operator delete; @@ -2111,9 +2445,9 @@ class LowPriorityDelayActor final : public Actor, public ActorCallback< Lo void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop friend struct ActorCallback< LowPriorityDelayActor, 0, Void >; - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" LowPriorityDelayActor(double const& waitTime) - #line 2116 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2450 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" : Actor(), LowPriorityDelayActorState(waitTime) { @@ -2137,14 +2471,14 @@ friend struct ActorCallback< LowPriorityDelayActor, 0, Void >; } }; } - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" [[nodiscard]] Future lowPriorityDelay( double const& waitTime ) { - #line 137 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 155 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" return Future(new LowPriorityDelayActor(waitTime)); - #line 2144 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2478 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" } -#line 148 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +#line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" namespace { @@ -2155,22 +2489,22 @@ struct DummyState { bool operator!=(DummyState const& rhs) const { return !(*this == rhs); } }; - #line 2158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2492 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" // This generated class is to be used only via testPublisher() - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" template - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" class TestPublisherActorState { - #line 2164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2498 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" public: - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" TestPublisherActorState(Reference> const& input) - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" : input(input), - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" i(0) - #line 2173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2507 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" { fdb_probe_actor_create("testPublisher", reinterpret_cast(this)); @@ -2183,9 +2517,9 @@ class TestPublisherActorState { int a_body1(int loopDepth=0) { try { - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" ; - #line 2188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2522 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" loopDepth = a_body1loopHead1(loopDepth); } catch (Error& error) { @@ -2206,9 +2540,9 @@ class TestPublisherActorState { } int a_body1cont1(int loopDepth) { - #line 166 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 184 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TestPublisherActorState(); static_cast(this)->destroy(); return 0; } - #line 2211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2545 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" new (&static_cast(this)->SAV< Void >::value()) Void(Void()); this->~TestPublisherActorState(); static_cast(this)->finishSendAndDelPromiseRef(); @@ -2225,22 +2559,22 @@ class TestPublisherActorState { } int a_body1loopBody1(int loopDepth) { - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (!(i < 100)) - #line 2230 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2564 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" { return a_body1break1(loopDepth==0?0:loopDepth-1); // break } - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" StrictFuture __when_expr_0 = delay(deterministicRandom()->random01()); - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2238 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2572 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; static_cast(this)->actor_wait_state = 1; - #line 161 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 2577 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" loopDepth = 0; return loopDepth; @@ -2258,88 +2592,949 @@ class TestPublisherActorState { return loopDepth; } - int a_body1loopBody1cont1(Void const& _,int loopDepth) + int a_body1loopBody1cont1(Void const& _,int loopDepth) + { + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + auto var = input->get(); + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ++var.changed; + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + input->set(var); + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ++i; + #line 2605 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1(Void && _,int loopDepth) + { + #line 180 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + auto var = input->get(); + #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ++var.changed; + #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + input->set(var); + #line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ++i; + #line 2620 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TestPublisherActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< TestPublisherActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("testPublisher", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("testPublisher", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< TestPublisherActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("testPublisher", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("testPublisher", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< TestPublisherActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("testPublisher", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("testPublisher", reinterpret_cast(this), 0); + + } + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + Reference> input; + #line 177 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + int i; + #line 2692 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +}; +// This generated class is to be used only via testPublisher() + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +class TestPublisherActor final : public Actor, public ActorCallback< TestPublisherActor, 0, Void >, public FastAllocated, public TestPublisherActorState { + #line 2697 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< TestPublisherActor, 0, Void >; + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + TestPublisherActor(Reference> const& input) + #line 2708 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + : Actor(), + TestPublisherActorState(input) + { + fdb_probe_actor_enter("testPublisher", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("testPublisher"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("testPublisher", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< TestPublisherActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +[[nodiscard]] Future testPublisher( Reference> const& input ) { + #line 176 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + return Future(new TestPublisherActor(input)); + #line 2735 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +} + +#line 186 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + + #line 2740 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +// This generated class is to be used only via testSubscriber() + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +template + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +class TestSubscriberActorState { + #line 2746 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +public: + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + TestSubscriberActorState(Reference> const& output,Optional const& expected) + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + : output(output), + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + expected(expected) + #line 2755 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + { + fdb_probe_actor_create("testSubscriber", reinterpret_cast(this)); + + } + ~TestSubscriberActorState() + { + fdb_probe_actor_destroy("testSubscriber", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ; + #line 2770 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = a_body1loopHead1(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~TestSubscriberActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1loopHead1(int loopDepth) + { + int oldLoopDepth = ++loopDepth; + while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + + return loopDepth; + } + int a_body1loopBody1(int loopDepth) + { + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + StrictFuture __when_expr_0 = output->onChange(); + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); + #line 2802 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 2807 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = 0; + + return loopDepth; + } + int a_body1loopBody1cont1(Void const& _,int loopDepth) + { + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(expected.present()); + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (output->get() == expected.get()) + #line 2818 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + { + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TestSubscriberActorState(); static_cast(this)->destroy(); return 0; } + #line 2822 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~TestSubscriberActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1cont1(Void && _,int loopDepth) + { + #line 190 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(expected.present()); + #line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (output->get() == expected.get()) + #line 2838 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + { + #line 192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TestSubscriberActorState(); static_cast(this)->destroy(); return 0; } + #line 2842 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~TestSubscriberActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + } + if (loopDepth == 0) return a_body1loopHead1(0); + + return loopDepth; + } + int a_body1loopBody1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1loopBody1when1(Void && _,int loopDepth) + { + loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< TestSubscriberActor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< TestSubscriberActor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("testSubscriber", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("testSubscriber", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< TestSubscriberActor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("testSubscriber", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1loopBody1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("testSubscriber", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< TestSubscriberActor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("testSubscriber", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("testSubscriber", reinterpret_cast(this), 0); + + } + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + Reference> output; + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + Optional expected; + #line 2919 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +}; +// This generated class is to be used only via testSubscriber() + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +class TestSubscriberActor final : public Actor, public ActorCallback< TestSubscriberActor, 0, Void >, public FastAllocated, public TestSubscriberActorState { + #line 2924 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< TestSubscriberActor, 0, Void >; + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + TestSubscriberActor(Reference> const& output,Optional const& expected) + #line 2935 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + : Actor(), + TestSubscriberActorState(output, expected) + { + fdb_probe_actor_enter("testSubscriber", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("testSubscriber"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("testSubscriber", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< TestSubscriberActor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +[[nodiscard]] Future testSubscriber( Reference> const& output, Optional const& expected ) { + #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + return Future(new TestSubscriberActor(output, expected)); + #line 2962 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +} + +#line 196 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + +static Future> goodTestFuture(double duration) { + return tag(delay(duration), ErrorOr(Void())); +} + +static Future> badTestFuture(double duration, Error e) { + return tag(delay(duration), ErrorOr(e)); +} + +} // namespace + + #line 2977 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase207() + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +template + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +class FlowTestCase207ActorState { + #line 2984 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +public: + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + FlowTestCase207ActorState(UnitTestParameters const& params) + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + : params(params) + #line 2991 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase207", reinterpret_cast(this)); + + } + ~FlowTestCase207ActorState() + { + fdb_probe_actor_destroy("flowTestCase207", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + #line 208 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + auto input = makeReference>(); + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + subscriber1 = testSubscriber(IAsyncListener::create(input, [](auto const& var) { return var.changed; }), 100); + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + subscriber2 = testSubscriber(IAsyncListener::create(input, [](auto const& var) { return var.unchanged; }), {}); + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + StrictFuture __when_expr_0 = subscriber1 && testPublisher(input); + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3014 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 213 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase207ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(Void const& _,int loopDepth) + { + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(!subscriber2.isReady()); + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase207ActorState(); static_cast(this)->destroy(); return 0; } + #line 3044 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase207ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1cont1(Void && _,int loopDepth) + { + #line 214 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(!subscriber2.isReady()); + #line 215 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase207ActorState(); static_cast(this)->destroy(); return 0; } + #line 3058 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase207ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont1(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont1(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase207Actor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase207Actor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase207", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase207", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FlowTestCase207Actor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase207", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase207", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< FlowTestCase207Actor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase207", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase207", reinterpret_cast(this), 0); + + } + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + UnitTestParameters params; + #line 209 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + Future subscriber1; + #line 211 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + Future subscriber2; + #line 3135 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +}; +// This generated class is to be used only via flowTestCase207() + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +class FlowTestCase207Actor final : public Actor, public ActorCallback< FlowTestCase207Actor, 0, Void >, public FastAllocated, public FlowTestCase207ActorState { + #line 3140 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +public: + using FastAllocated::operator new; + using FastAllocated::operator delete; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" + void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } +#pragma clang diagnostic pop +friend struct ActorCallback< FlowTestCase207Actor, 0, Void >; + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + FlowTestCase207Actor(UnitTestParameters const& params) + #line 3151 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + : Actor(), + FlowTestCase207ActorState(params) + { + fdb_probe_actor_enter("flowTestCase207", reinterpret_cast(this), -1); + #ifdef ENABLE_SAMPLING + this->lineage.setActorName("flowTestCase207"); + LineageScope _(&this->lineage); + #endif + this->a_body1(); + fdb_probe_actor_exit("flowTestCase207", reinterpret_cast(this), -1); + + } + void cancel() override + { + auto wait_state = this->actor_wait_state; + this->actor_wait_state = -1; + switch (wait_state) { + case 1: this->a_callback_error((ActorCallback< FlowTestCase207Actor, 0, Void >*)0, actor_cancelled()); break; + } + + } +}; +} + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +static Future flowTestCase207( UnitTestParameters const& params ) { + #line 207 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + return Future(new FlowTestCase207Actor(params)); + #line 3179 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase207, "/flow/genericactors/AsyncListener") + +#line 217 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + + #line 3185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +namespace { +// This generated class is to be used only via flowTestCase218() + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +template + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +class FlowTestCase218ActorState { + #line 3192 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +public: + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + FlowTestCase218ActorState(UnitTestParameters const& params) + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + : params(params), + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + futures() + #line 3201 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + { + fdb_probe_actor_create("flowTestCase218", reinterpret_cast(this)); + + } + ~FlowTestCase218ActorState() + { + fdb_probe_actor_destroy("flowTestCase218", reinterpret_cast(this)); + + } + int a_body1(int loopDepth=0) + { + try { + { + #line 221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + futures = { goodTestFuture(1), goodTestFuture(2), goodTestFuture(3) }; + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + StrictFuture __when_expr_0 = waitForMost(futures, 1, operation_failed(), 0.0); + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3221 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 1; + #line 222 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = 0; + } + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + int a_body1Catch1(Error error,int loopDepth=0) + { + this->~FlowTestCase218ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); + loopDepth = 0; + + return loopDepth; + } + int a_body1cont1(int loopDepth) + { + { + #line 226 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + futures = { goodTestFuture(1), goodTestFuture(2), goodTestFuture(3) }; + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + StrictFuture __when_expr_1 = waitForMost(futures, 0, operation_failed(), 0.0); + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + if (__when_expr_1.isReady()) { if (__when_expr_1.isError()) return a_body1Catch1(__when_expr_1.getError(), loopDepth); else return a_body1cont1when1(__when_expr_1.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 2; + #line 227 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + __when_expr_1.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3260 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = 0; + } + + return loopDepth; + } + int a_body1cont2(Void const& _,int loopDepth) + { + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(!futures[2].isReady()); + #line 3270 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1cont2(Void && _,int loopDepth) + { + #line 223 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(!futures[2].isReady()); + #line 3279 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = a_body1cont1(loopDepth); + + return loopDepth; + } + int a_body1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont2(_, loopDepth); + + return loopDepth; + } + int a_body1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont2(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose1() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase218Actor, 0, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase218Actor, 0, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 0); + + } + void a_callback_fire(ActorCallback< FlowTestCase218Actor, 0, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 0); + + } + void a_callback_error(ActorCallback< FlowTestCase218Actor, 0, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 0); + a_exitChoose1(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 0); + + } + int a_body1cont4(int loopDepth) + { + { + #line 231 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + futures = { goodTestFuture(1), goodTestFuture(2), goodTestFuture(3) }; + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + StrictFuture __when_expr_2 = waitForMost(futures, 1, operation_failed(), 1.0); + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3356 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + if (__when_expr_2.isReady()) { if (__when_expr_2.isError()) return a_body1Catch1(__when_expr_2.getError(), loopDepth); else return a_body1cont4when1(__when_expr_2.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 3; + #line 232 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + __when_expr_2.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3361 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = 0; + } + + return loopDepth; + } + int a_body1cont5(Void const& _,int loopDepth) + { + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(futures[2].isReady()); + #line 3371 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont5(Void && _,int loopDepth) + { + #line 228 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(futures[2].isReady()); + #line 3380 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = a_body1cont4(loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont5(_, loopDepth); + + return loopDepth; + } + int a_body1cont1when1(Void && _,int loopDepth) + { + loopDepth = a_body1cont5(std::move(_), loopDepth); + + return loopDepth; + } + void a_exitChoose2() + { + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase218Actor, 1, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase218Actor, 1, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(value, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 1); + + } + void a_callback_fire(ActorCallback< FlowTestCase218Actor, 1, Void >*,Void && value) + { + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1cont1when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 1); + + } + void a_callback_error(ActorCallback< FlowTestCase218Actor, 1, Void >*,Error err) + { + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 1); + a_exitChoose2(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 1); + + } + int a_body1cont7(int loopDepth) + { + { + #line 236 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + futures = { goodTestFuture(1), goodTestFuture(2), badTestFuture(1, success()) }; + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + StrictFuture __when_expr_3 = waitForMost(futures, 1, operation_failed(), 1.0); + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3457 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + if (__when_expr_3.isReady()) { if (__when_expr_3.isError()) return a_body1Catch1(__when_expr_3.getError(), loopDepth); else return a_body1cont7when1(__when_expr_3.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 4; + #line 237 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + __when_expr_3.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3462 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = 0; + } + + return loopDepth; + } + int a_body1cont8(Void const& _,int loopDepth) { - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - auto var = input->get(); - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - ++var.changed; - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - input->set(var); - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - ++i; - #line 2271 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" - if (loopDepth == 0) return a_body1loopHead1(0); + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(futures[2].isReady()); + #line 3472 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = a_body1cont7(loopDepth); return loopDepth; } - int a_body1loopBody1cont1(Void && _,int loopDepth) + int a_body1cont8(Void && _,int loopDepth) { - #line 162 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - auto var = input->get(); - #line 163 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - ++var.changed; - #line 164 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - input->set(var); - #line 160 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - ++i; - #line 2286 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" - if (loopDepth == 0) return a_body1loopHead1(0); + #line 233 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(futures[2].isReady()); + #line 3481 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = a_body1cont7(loopDepth); return loopDepth; } - int a_body1loopBody1when1(Void const& _,int loopDepth) + int a_body1cont4when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(_, loopDepth); + loopDepth = a_body1cont8(_, loopDepth); return loopDepth; } - int a_body1loopBody1when1(Void && _,int loopDepth) + int a_body1cont4when1(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont8(std::move(_), loopDepth); return loopDepth; } - void a_exitChoose1() + void a_exitChoose3() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TestPublisherActor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase218Actor, 2, Void >::remove(); } - void a_callback_fire(ActorCallback< TestPublisherActor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase218Actor, 2, Void >*,Void const& value) { - fdb_probe_actor_enter("testPublisher", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1when1(value, 0); + a_body1cont4when1(value, 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("testPublisher", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 2); } - void a_callback_fire(ActorCallback< TestPublisherActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase218Actor, 2, Void >*,Void && value) { - fdb_probe_actor_enter("testPublisher", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 2); + a_exitChoose3(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1cont4when1(std::move(value), 0); } catch (Error& error) { a_body1Catch1(error, 0); } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("testPublisher", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 2); } - void a_callback_error(ActorCallback< TestPublisherActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase218Actor, 2, Void >*,Error err) { - fdb_probe_actor_enter("testPublisher", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 2); + a_exitChoose3(); try { a_body1Catch1(err, 0); } @@ -2348,267 +3543,275 @@ class TestPublisherActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("testPublisher", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 2); } - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - Reference> input; - #line 159 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - int i; - #line 2358 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" -}; -// This generated class is to be used only via testPublisher() - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" -class TestPublisherActor final : public Actor, public ActorCallback< TestPublisherActor, 0, Void >, public FastAllocated, public TestPublisherActorState { - #line 2363 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" -public: - using FastAllocated::operator new; - using FastAllocated::operator delete; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } -#pragma clang diagnostic pop -friend struct ActorCallback< TestPublisherActor, 0, Void >; - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - TestPublisherActor(Reference> const& input) - #line 2374 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" - : Actor(), - TestPublisherActorState(input) + int a_body1cont10(int loopDepth) { - fdb_probe_actor_enter("testPublisher", reinterpret_cast(this), -1); - #ifdef ENABLE_SAMPLING - this->lineage.setActorName("testPublisher"); - LineageScope _(&this->lineage); - #endif - this->a_body1(); - fdb_probe_actor_exit("testPublisher", reinterpret_cast(this), -1); + { + #line 240 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + futures = { goodTestFuture(1), goodTestFuture(2), badTestFuture(1, success()) }; + #line 3554 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + try { + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + StrictFuture __when_expr_4 = waitForMost(futures, 0, operation_failed(), 1.0); + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1cont10Catch1(actor_cancelled(), loopDepth); + #line 3560 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + if (__when_expr_4.isReady()) { if (__when_expr_4.isError()) return a_body1cont10Catch1(__when_expr_4.getError(), loopDepth); else return a_body1cont10when1(__when_expr_4.get(), loopDepth); }; + static_cast(this)->actor_wait_state = 5; + #line 242 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + __when_expr_4.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3565 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = 0; + } + catch (Error& error) { + loopDepth = a_body1cont10Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1cont10Catch1(unknown_error(), loopDepth); + } + } + return loopDepth; } - void cancel() override + int a_body1cont11(Void const& _,int loopDepth) { - auto wait_state = this->actor_wait_state; - this->actor_wait_state = -1; - switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< TestPublisherActor, 0, Void >*)0, actor_cancelled()); break; - } + loopDepth = a_body1cont10(loopDepth); + return loopDepth; } -}; - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" -[[nodiscard]] Future testPublisher( Reference> const& input ) { - #line 158 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - return Future(new TestPublisherActor(input)); - #line 2401 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" -} + int a_body1cont11(Void && _,int loopDepth) + { + loopDepth = a_body1cont10(loopDepth); -#line 168 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + return loopDepth; + } + int a_body1cont7when1(Void const& _,int loopDepth) + { + loopDepth = a_body1cont11(_, loopDepth); - #line 2406 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" -// This generated class is to be used only via testSubscriber() - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" -template - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" -class TestSubscriberActorState { - #line 2412 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" -public: - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - TestSubscriberActorState(Reference> const& output,Optional const& expected) - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - : output(output), - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - expected(expected) - #line 2421 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + return loopDepth; + } + int a_body1cont7when1(Void && _,int loopDepth) { - fdb_probe_actor_create("testSubscriber", reinterpret_cast(this)); + loopDepth = a_body1cont11(std::move(_), loopDepth); + return loopDepth; } - ~TestSubscriberActorState() + void a_exitChoose4() { - fdb_probe_actor_destroy("testSubscriber", reinterpret_cast(this)); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase218Actor, 3, Void >::remove(); } - int a_body1(int loopDepth=0) + void a_callback_fire(ActorCallback< FlowTestCase218Actor, 3, Void >*,Void const& value) { + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 3); + a_exitChoose4(); try { - #line 170 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - ; - #line 2436 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" - loopDepth = a_body1loopHead1(loopDepth); + a_body1cont7when1(value, 0); } catch (Error& error) { - loopDepth = a_body1Catch1(error, loopDepth); + a_body1Catch1(error, 0); } catch (...) { - loopDepth = a_body1Catch1(unknown_error(), loopDepth); + a_body1Catch1(unknown_error(), 0); } + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1Catch1(Error error,int loopDepth=0) + void a_callback_fire(ActorCallback< FlowTestCase218Actor, 3, Void >*,Void && value) { - this->~TestSubscriberActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); - loopDepth = 0; + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1cont7when1(std::move(value), 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 3); - return loopDepth; } - int a_body1loopHead1(int loopDepth) + void a_callback_error(ActorCallback< FlowTestCase218Actor, 3, Void >*,Error err) { - int oldLoopDepth = ++loopDepth; - while (loopDepth == oldLoopDepth) loopDepth = a_body1loopBody1(loopDepth); + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 3); + a_exitChoose4(); + try { + a_body1Catch1(err, 0); + } + catch (Error& error) { + a_body1Catch1(error, 0); + } catch (...) { + a_body1Catch1(unknown_error(), 0); + } + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 3); + + } + int a_body1cont10cont1(int loopDepth) + { + #line 248 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase218ActorState(); static_cast(this)->destroy(); return 0; } + #line 3656 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase218ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); + return 0; return loopDepth; } - int a_body1loopBody1(int loopDepth) + int a_body1cont10cont2(int loopDepth) { - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - StrictFuture __when_expr_0 = output->onChange(); - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), std::max(0, loopDepth - 1)); - #line 2468 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" - if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), std::max(0, loopDepth - 1)); else return a_body1loopBody1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 171 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2473 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" - loopDepth = 0; + loopDepth = a_body1cont10cont1(loopDepth); return loopDepth; } - int a_body1loopBody1cont1(Void const& _,int loopDepth) + int a_body1cont10Catch1(const Error& e,int loopDepth=0) { - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - ASSERT(expected.present()); - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - if (output->get() == expected.get()) - #line 2484 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" - { - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TestSubscriberActorState(); static_cast(this)->destroy(); return 0; } - #line 2488 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~TestSubscriberActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; + try { + #line 245 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT_EQ(e.code(), error_code_operation_failed); + #line 3675 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = a_body1cont10cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); } - if (loopDepth == 0) return a_body1loopHead1(0); return loopDepth; } - int a_body1loopBody1cont1(Void && _,int loopDepth) + int a_body1cont10cont3(Void const& _,int loopDepth) { - #line 172 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - ASSERT(expected.present()); - #line 173 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - if (output->get() == expected.get()) - #line 2504 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" - { - #line 174 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~TestSubscriberActorState(); static_cast(this)->destroy(); return 0; } - #line 2508 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~TestSubscriberActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); - return 0; - } - if (loopDepth == 0) return a_body1loopHead1(0); + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(false); + #line 3690 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = a_body1cont10cont5(loopDepth); return loopDepth; } - int a_body1loopBody1when1(Void const& _,int loopDepth) + int a_body1cont10cont3(Void && _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(_, loopDepth); + #line 243 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(false); + #line 3699 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + loopDepth = a_body1cont10cont5(loopDepth); return loopDepth; } - int a_body1loopBody1when1(Void && _,int loopDepth) + int a_body1cont10when1(Void const& _,int loopDepth) { - loopDepth = a_body1loopBody1cont1(std::move(_), loopDepth); + loopDepth = a_body1cont10cont3(_, loopDepth); return loopDepth; } - void a_exitChoose1() + int a_body1cont10when1(Void && _,int loopDepth) { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< TestSubscriberActor, 0, Void >::remove(); + loopDepth = a_body1cont10cont3(std::move(_), loopDepth); + return loopDepth; } - void a_callback_fire(ActorCallback< TestSubscriberActor, 0, Void >*,Void const& value) + void a_exitChoose5() { - fdb_probe_actor_enter("testSubscriber", reinterpret_cast(this), 0); - a_exitChoose1(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase218Actor, 4, Void >::remove(); + + } + void a_callback_fire(ActorCallback< FlowTestCase218Actor, 4, Void >*,Void const& value) + { + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1when1(value, 0); + a_body1cont10when1(value, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont10Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont10Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("testSubscriber", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 4); } - void a_callback_fire(ActorCallback< TestSubscriberActor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase218Actor, 4, Void >*,Void && value) { - fdb_probe_actor_enter("testSubscriber", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1loopBody1when1(std::move(value), 0); + a_body1cont10when1(std::move(value), 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont10Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont10Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("testSubscriber", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 4); } - void a_callback_error(ActorCallback< TestSubscriberActor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase218Actor, 4, Void >*,Error err) { - fdb_probe_actor_enter("testSubscriber", reinterpret_cast(this), 0); - a_exitChoose1(); + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), 4); + a_exitChoose5(); try { - a_body1Catch1(err, 0); + a_body1cont10Catch1(err, 0); } catch (Error& error) { - a_body1Catch1(error, 0); + a_body1cont10Catch1(error, 0); } catch (...) { - a_body1Catch1(unknown_error(), 0); + a_body1cont10Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("testSubscriber", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), 4); } - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - Reference> output; - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - Optional expected; - #line 2585 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + int a_body1cont10cont5(int loopDepth) + { + try { + loopDepth = a_body1cont10cont2(loopDepth); + } + catch (Error& error) { + loopDepth = a_body1Catch1(error, loopDepth); + } catch (...) { + loopDepth = a_body1Catch1(unknown_error(), loopDepth); + } + + return loopDepth; + } + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + UnitTestParameters params; + #line 219 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + std::vector>> futures; + #line 3784 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" }; -// This generated class is to be used only via testSubscriber() - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" -class TestSubscriberActor final : public Actor, public ActorCallback< TestSubscriberActor, 0, Void >, public FastAllocated, public TestSubscriberActorState { - #line 2590 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +// This generated class is to be used only via flowTestCase218() + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +class FlowTestCase218Actor final : public Actor, public ActorCallback< FlowTestCase218Actor, 0, Void >, public ActorCallback< FlowTestCase218Actor, 1, Void >, public ActorCallback< FlowTestCase218Actor, 2, Void >, public ActorCallback< FlowTestCase218Actor, 3, Void >, public ActorCallback< FlowTestCase218Actor, 4, Void >, public FastAllocated, public FlowTestCase218ActorState { + #line 3789 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< TestSubscriberActor, 0, Void >; - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - TestSubscriberActor(Reference> const& output,Optional const& expected) - #line 2601 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +friend struct ActorCallback< FlowTestCase218Actor, 0, Void >; +friend struct ActorCallback< FlowTestCase218Actor, 1, Void >; +friend struct ActorCallback< FlowTestCase218Actor, 2, Void >; +friend struct ActorCallback< FlowTestCase218Actor, 3, Void >; +friend struct ActorCallback< FlowTestCase218Actor, 4, Void >; + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + FlowTestCase218Actor(UnitTestParameters const& params) + #line 3804 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" : Actor(), - TestSubscriberActorState(output, expected) + FlowTestCase218ActorState(params) { - fdb_probe_actor_enter("testSubscriber", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase218", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("testSubscriber"); + this->lineage.setActorName("flowTestCase218"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("testSubscriber", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase218", reinterpret_cast(this), -1); } void cancel() override @@ -2616,65 +3819,76 @@ friend struct ActorCallback< TestSubscriberActor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< TestSubscriberActor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase218Actor, 0, Void >*)0, actor_cancelled()); break; + case 2: this->a_callback_error((ActorCallback< FlowTestCase218Actor, 1, Void >*)0, actor_cancelled()); break; + case 3: this->a_callback_error((ActorCallback< FlowTestCase218Actor, 2, Void >*)0, actor_cancelled()); break; + case 4: this->a_callback_error((ActorCallback< FlowTestCase218Actor, 3, Void >*)0, actor_cancelled()); break; + case 5: this->a_callback_error((ActorCallback< FlowTestCase218Actor, 4, Void >*)0, actor_cancelled()); break; } } }; - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" -[[nodiscard]] Future testSubscriber( Reference> const& output, Optional const& expected ) { - #line 169 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - return Future(new TestSubscriberActor(output, expected)); - #line 2628 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" } + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +static Future flowTestCase218( UnitTestParameters const& params ) { + #line 218 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + return Future(new FlowTestCase218Actor(params)); + #line 3836 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +} +ACTOR_TEST_CASE(flowTestCase218, "/flow/genericactors/WaitForMost") -#line 178 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - -} // namespace +#line 250 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - #line 2635 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +#if false + #line 3843 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" namespace { -// This generated class is to be used only via flowTestCase181() - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" -template - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" -class FlowTestCase181ActorState { - #line 2642 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +// This generated class is to be used only via flowTestCase252() + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +template + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +class FlowTestCase252ActorState { + #line 3850 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" public: - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - FlowTestCase181ActorState(UnitTestParameters const& params) - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - : params(params) - #line 2649 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + FlowTestCase252ActorState(UnitTestParameters const& params) + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + : params(params), + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + resA(), + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + resB(), + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + resC(), + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + promise() + #line 3865 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" { - fdb_probe_actor_create("flowTestCase181", reinterpret_cast(this)); + fdb_probe_actor_create("flowTestCase252", reinterpret_cast(this)); } - ~FlowTestCase181ActorState() + ~FlowTestCase252ActorState() { - fdb_probe_actor_destroy("flowTestCase181", reinterpret_cast(this)); + fdb_probe_actor_destroy("flowTestCase252", reinterpret_cast(this)); } int a_body1(int loopDepth=0) { try { - #line 182 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - auto input = makeReference>(); - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - subscriber1 = testSubscriber(IAsyncListener::create(input, [](auto const& var) { return var.changed; }), 100); - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - subscriber2 = testSubscriber(IAsyncListener::create(input, [](auto const& var) { return var.unchanged; }), {}); - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - StrictFuture __when_expr_0 = subscriber1 && testPublisher(input); - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); - #line 2672 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 259 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + auto future = storeTuple(promise.getFuture(), resA, resB, resC); + #line 261 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + promise.send(std::make_tuple(std::vector(10), 15, 2.0)); + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + StrictFuture __when_expr_0 = ready(future); + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (static_cast(this)->actor_wait_state < 0) return a_body1Catch1(actor_cancelled(), loopDepth); + #line 3886 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" if (__when_expr_0.isReady()) { if (__when_expr_0.isError()) return a_body1Catch1(__when_expr_0.getError(), loopDepth); else return a_body1when1(__when_expr_0.get(), loopDepth); }; - static_cast(this)->actor_wait_state = 1; - #line 187 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); - #line 2677 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + static_cast(this)->actor_wait_state = 1; + #line 262 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + __when_expr_0.addCallbackAndClear(static_cast*>(static_cast(this))); + #line 3891 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" loopDepth = 0; } catch (Error& error) { @@ -2687,36 +3901,44 @@ class FlowTestCase181ActorState { } int a_body1Catch1(Error error,int loopDepth=0) { - this->~FlowTestCase181ActorState(); - static_cast(this)->sendErrorAndDelPromiseRef(error); + this->~FlowTestCase252ActorState(); + static_cast(this)->sendErrorAndDelPromiseRef(error); loopDepth = 0; return loopDepth; } int a_body1cont1(Void const& _,int loopDepth) { - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - ASSERT(!subscriber2.isReady()); - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase181ActorState(); static_cast(this)->destroy(); return 0; } - #line 2702 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase181ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(resA.size() == 10); + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(resB == 15); + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(resC == 2.0); + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase252ActorState(); static_cast(this)->destroy(); return 0; } + #line 3920 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase252ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; } int a_body1cont1(Void && _,int loopDepth) { - #line 188 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - ASSERT(!subscriber2.isReady()); - #line 189 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase181ActorState(); static_cast(this)->destroy(); return 0; } - #line 2716 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" - new (&static_cast(this)->SAV< Void >::value()) Void(Void()); - this->~FlowTestCase181ActorState(); - static_cast(this)->finishSendAndDelPromiseRef(); + #line 263 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(resA.size() == 10); + #line 264 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(resB == 15); + #line 265 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + ASSERT(resC == 2.0); + #line 266 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + if (!static_cast(this)->SAV::futures) { (void)(Void()); this->~FlowTestCase252ActorState(); static_cast(this)->destroy(); return 0; } + #line 3938 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + new (&static_cast(this)->SAV< Void >::value()) Void(Void()); + this->~FlowTestCase252ActorState(); + static_cast(this)->finishSendAndDelPromiseRef(); return 0; return loopDepth; @@ -2735,13 +3957,13 @@ class FlowTestCase181ActorState { } void a_exitChoose1() { - if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; - static_cast(this)->ActorCallback< FlowTestCase181Actor, 0, Void >::remove(); + if (static_cast(this)->actor_wait_state > 0) static_cast(this)->actor_wait_state = 0; + static_cast(this)->ActorCallback< FlowTestCase252Actor, 0, Void >::remove(); } - void a_callback_fire(ActorCallback< FlowTestCase181Actor, 0, Void >*,Void const& value) + void a_callback_fire(ActorCallback< FlowTestCase252Actor, 0, Void >*,Void const& value) { - fdb_probe_actor_enter("flowTestCase181", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase252", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(value, 0); @@ -2751,12 +3973,12 @@ class FlowTestCase181ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase181", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase252", reinterpret_cast(this), 0); } - void a_callback_fire(ActorCallback< FlowTestCase181Actor, 0, Void >*,Void && value) + void a_callback_fire(ActorCallback< FlowTestCase252Actor, 0, Void >*,Void && value) { - fdb_probe_actor_enter("flowTestCase181", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase252", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1when1(std::move(value), 0); @@ -2766,12 +3988,12 @@ class FlowTestCase181ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase181", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase252", reinterpret_cast(this), 0); } - void a_callback_error(ActorCallback< FlowTestCase181Actor, 0, Void >*,Error err) + void a_callback_error(ActorCallback< FlowTestCase252Actor, 0, Void >*,Error err) { - fdb_probe_actor_enter("flowTestCase181", reinterpret_cast(this), 0); + fdb_probe_actor_enter("flowTestCase252", reinterpret_cast(this), 0); a_exitChoose1(); try { a_body1Catch1(err, 0); @@ -2781,42 +4003,46 @@ class FlowTestCase181ActorState { } catch (...) { a_body1Catch1(unknown_error(), 0); } - fdb_probe_actor_exit("flowTestCase181", reinterpret_cast(this), 0); + fdb_probe_actor_exit("flowTestCase252", reinterpret_cast(this), 0); } - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" UnitTestParameters params; - #line 183 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - Future subscriber1; - #line 185 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - Future subscriber2; - #line 2793 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 253 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + std::vector resA; + #line 254 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + int resB; + #line 255 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + double resC; + #line 257 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + Promise, int, double>> promise; + #line 4019 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" }; -// This generated class is to be used only via flowTestCase181() - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" -class FlowTestCase181Actor final : public Actor, public ActorCallback< FlowTestCase181Actor, 0, Void >, public FastAllocated, public FlowTestCase181ActorState { - #line 2798 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +// This generated class is to be used only via flowTestCase252() + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +class FlowTestCase252Actor final : public Actor, public ActorCallback< FlowTestCase252Actor, 0, Void >, public FastAllocated, public FlowTestCase252ActorState { + #line 4024 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" public: - using FastAllocated::operator new; - using FastAllocated::operator delete; + using FastAllocated::operator new; + using FastAllocated::operator delete; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" void destroy() override { ((Actor*)this)->~Actor(); operator delete(this); } #pragma clang diagnostic pop -friend struct ActorCallback< FlowTestCase181Actor, 0, Void >; - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - FlowTestCase181Actor(UnitTestParameters const& params) - #line 2809 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" +friend struct ActorCallback< FlowTestCase252Actor, 0, Void >; + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + FlowTestCase252Actor(UnitTestParameters const& params) + #line 4035 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" : Actor(), - FlowTestCase181ActorState(params) + FlowTestCase252ActorState(params) { - fdb_probe_actor_enter("flowTestCase181", reinterpret_cast(this), -1); + fdb_probe_actor_enter("flowTestCase252", reinterpret_cast(this), -1); #ifdef ENABLE_SAMPLING - this->lineage.setActorName("flowTestCase181"); + this->lineage.setActorName("flowTestCase252"); LineageScope _(&this->lineage); #endif this->a_body1(); - fdb_probe_actor_exit("flowTestCase181", reinterpret_cast(this), -1); + fdb_probe_actor_exit("flowTestCase252", reinterpret_cast(this), -1); } void cancel() override @@ -2824,18 +4050,19 @@ friend struct ActorCallback< FlowTestCase181Actor, 0, Void >; auto wait_state = this->actor_wait_state; this->actor_wait_state = -1; switch (wait_state) { - case 1: this->a_callback_error((ActorCallback< FlowTestCase181Actor, 0, Void >*)0, actor_cancelled()); break; + case 1: this->a_callback_error((ActorCallback< FlowTestCase252Actor, 0, Void >*)0, actor_cancelled()); break; } } }; } - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" -static Future flowTestCase181( UnitTestParameters const& params ) { - #line 181 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" - return Future(new FlowTestCase181Actor(params)); - #line 2837 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +static Future flowTestCase252( UnitTestParameters const& params ) { + #line 252 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" + return Future(new FlowTestCase252Actor(params)); + #line 4063 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.g.cpp" } -ACTOR_TEST_CASE(flowTestCase181, "/flow/genericactors/AsyncListener") +ACTOR_TEST_CASE(flowTestCase252, "/flow/genericactors/generic/storeTuple") -#line 191 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +#line 268 "/home/ccat3z/Documents/moqi/foundationdb-client/src/flow/genericactors.actor.cpp" +#endif diff --git a/src/flow/ActorCollection.h b/src/flow/include/flow/ActorCollection.h similarity index 98% rename from src/flow/ActorCollection.h rename to src/flow/include/flow/ActorCollection.h index ae4567f..c1fbae1 100644 --- a/src/flow/ActorCollection.h +++ b/src/flow/include/flow/ActorCollection.h @@ -67,7 +67,7 @@ class ActorCollection : NonCopyable { Future m_out; public: - explicit ActorCollection(bool returnWhenEmptied) { + explicit ActorCollection(bool returnWhenEmptied = false) { m_out = actorCollection(m_add.getFuture(), nullptr, nullptr, nullptr, nullptr, returnWhenEmptied); } diff --git a/src/flow/include/flow/ApiVersion.h b/src/flow/include/flow/ApiVersion.h new file mode 100644 index 0000000..7681e7e --- /dev/null +++ b/src/flow/include/flow/ApiVersion.h @@ -0,0 +1,88 @@ +/* + * ApiVersion.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FLOW_CODE_API_VERSION_H +#define FLOW_CODE_API_VERSION_H + +#pragma once +#include "flow/Trace.h" +#include + +constexpr int noBackwardsCompatibility = 13; + +// The first check second expression version doesn't need to change because it's just for earlier API versions. +#define API_VERSION_FEATURE(v, x) \ + static_assert(v <= 730, "Feature API version too large"); \ + struct x { \ + static constexpr uint64_t apiVersion = v; \ + }; \ + constexpr bool has##x() const { return this->version() >= x ::apiVersion; } \ + static constexpr ApiVersion with##x() { return ApiVersion(x ::apiVersion); } + +class ApiVersion { + int _version; + +public: + // Statics. + constexpr static int LATEST_VERSION = 730; + + constexpr explicit ApiVersion(int version) : _version(version) {} + constexpr ApiVersion() : _version(0) {} + + constexpr bool isValid() const { + return version() > noBackwardsCompatibility && version() <= LATEST_VERSION; + } + + constexpr int version() const { return _version; } + + // comparison operators + constexpr bool operator==(const ApiVersion other) const { return version() == other.version(); } + constexpr bool operator!=(const ApiVersion other) const { return version() != other.version(); } + constexpr bool operator<=(const ApiVersion other) const { return version() <= other.version(); } + constexpr bool operator>=(const ApiVersion other) const { return version() >= other.version(); } + constexpr bool operator<(const ApiVersion other) const { return version() < other.version(); } + constexpr bool operator>(const ApiVersion other) const { return version() > other.version(); } + +public: // introduced features + API_VERSION_FEATURE(300, SnapshotRYW); + API_VERSION_FEATURE(610, InlineUpdateDatabase); + API_VERSION_FEATURE(610, PersistentOptions); + API_VERSION_FEATURE(630, TraceFileIdentifier); + API_VERSION_FEATURE(710, ClusterSharedStateMap); + API_VERSION_FEATURE(720, BlobRangeApi); + API_VERSION_FEATURE(720, CreateDBFromConnString); + API_VERSION_FEATURE(720, FutureGetBool); + API_VERSION_FEATURE(720, FutureProtocolVersionApi); + API_VERSION_FEATURE(720, TenantBlobRangeApi); + API_VERSION_FEATURE(720, ClientTmpDir); + API_VERSION_FEATURE(720, DisableClientBypass) + API_VERSION_FEATURE(720, GrvCache); + API_VERSION_FEATURE(720, ClientProfilingDeprecated); + API_VERSION_FEATURE(720, TenantApiReleased); + API_VERSION_FEATURE(730, GetTotalCost); + API_VERSION_FEATURE(730, FailOnExternalClientErrors); + API_VERSION_FEATURE(730, GetTagThrottledDuration); + API_VERSION_FEATURE(730, FutureGetDouble); + API_VERSION_FEATURE(730, GetClientStatus); + API_VERSION_FEATURE(730, InitializeTraceOnSetup); + API_VERSION_FEATURE(730, TenantGetId); +}; + +#endif // FLOW_CODE_API_VERSION_H diff --git a/src/flow/Arena.h b/src/flow/include/flow/Arena.h similarity index 90% rename from src/flow/Arena.h rename to src/flow/include/flow/Arena.h index 4185e0e..6b4d2c6 100644 --- a/src/flow/Arena.h +++ b/src/flow/include/flow/Arena.h @@ -31,9 +31,12 @@ #include "flow/Trace.h" #include "flow/ObjectSerializerTraits.h" #include "flow/FileIdentifier.h" +#include "flow/Optional.h" +#include "flow/Traceable.h" #include #include #include +#include #include #include #include @@ -41,7 +44,8 @@ #include #include #include -#include "flow/crc32c.h" +#include +#include // TrackIt is a zero-size class for tracking constructions, destructions, and assignments of instances // of a class. Just inherit TrackIt from T to enable tracking of construction and destruction of @@ -90,7 +94,10 @@ class NonCopyable { NonCopyable& operator=(const NonCopyable&) = delete; }; -FDB_DECLARE_BOOLEAN_PARAM(FastInaccurateEstimate); +FDB_BOOLEAN_PARAM(FastInaccurateEstimate); + +// Tag struct to indicate that the block containing allocated memory needs to be zero-ed out after use +struct WipeAfterUse {}; // An Arena is a custom allocator that consists of a set of ArenaBlocks. Allocation is performed by bumping a pointer // on the most recent ArenaBlock until the block is unable to service the next allocation request. When the current @@ -98,6 +105,7 @@ FDB_DECLARE_BOOLEAN_PARAM(FastInaccurateEstimate); // memory is freed by deleting the entire Arena at once. See flow/README.md for details on using Arenas. class Arena { public: + constexpr static auto fb_must_appear_last = true; Arena(); explicit Arena(size_t reservedSize); //~Arena(); @@ -120,6 +128,8 @@ class Arena { friend void* operator new(size_t size, Arena& p); friend void* operator new[](size_t size, Arena& p); + friend void* operator new(size_t size, Arena& p, struct WipeAfterUse); + friend void* operator new[](size_t size, Arena& p, struct WipeAfterUse); bool sameArena(const Arena& other) const { return impl.getPtr() == other.impl.getPtr(); } @@ -153,16 +163,19 @@ struct ArenaBlockRef { uint32_t nextBlockOffset; }; +FDB_BOOLEAN_PARAM(IsSecureMem); + struct ArenaBlock : NonCopyable, ThreadSafeReferenceCounted { enum { SMALL = 64, LARGE = 8193 // If size == used == LARGE, then use hugeSize, hugeUsed }; - enum { NOT_TINY = 255, TINY_HEADER = 6 }; + enum { NOT_TINY = 127, TINY_HEADER = 6 }; // int32_t referenceCount; // 4 bytes (in ThreadSafeReferenceCounted) - uint8_t tinySize, tinyUsed; // If these == NOT_TINY, use bigSize, bigUsed instead + bool secure : 1; // If this is set, block is zero-ed out after use + uint8_t tinySize : 7, tinyUsed; // If these == NOT_TINY, use bigSize, bigUsed instead // if tinySize != NOT_TINY, following variables aren't used uint32_t bigSize, bigUsed; // include block header uint32_t nextBlockOffset; @@ -170,6 +183,7 @@ struct ArenaBlock : NonCopyable, ThreadSafeReferenceCounted { void addref(); void delref(); + bool isSecure() const; bool isTiny() const; int size() const; int used() const; @@ -178,6 +192,7 @@ struct ArenaBlock : NonCopyable, ThreadSafeReferenceCounted { const void* getNextData() const; size_t totalSize() const; size_t estimatedTotalSize() const; + void wipeUsed(); // just for debugging: void getUniqueBlocks(std::set& a); int addUsed(int bytes); @@ -185,7 +200,7 @@ struct ArenaBlock : NonCopyable, ThreadSafeReferenceCounted { void* make4kAlignedBuffer(uint32_t size); static void dependOn(Reference& self, ArenaBlock* other); static void* dependOn4kAlignedBuffer(Reference& self, uint32_t size); - static void* allocate(Reference& self, int bytes); + static void* allocate(Reference& self, int bytes, IsSecureMem isSecure = IsSecureMem::False); // Return an appropriately-sized ArenaBlock to store the given data static ArenaBlock* create(int dataSize, Reference& next); void destroy(); @@ -204,6 +219,19 @@ inline void* operator new[](size_t size, Arena& p) { } inline void operator delete[](void*, Arena& p) {} +inline void* operator new(size_t size, Arena& p, struct WipeAfterUse) { + UNSTOPPABLE_ASSERT(size < std::numeric_limits::max()); + return ArenaBlock::allocate(p.impl, (int)size, IsSecureMem::True); +} + +inline void operator delete(void*, Arena& p, struct WipeAfterUse) {} + +inline void* operator new[](size_t size, Arena& p, struct WipeAfterUse) { + UNSTOPPABLE_ASSERT(size < std::numeric_limits::max()); + return ArenaBlock::allocate(p.impl, (int)size, IsSecureMem::True); +} +inline void operator delete[](void*, Arena& p, struct WipeAfterUse) {} + template inline void load(Archive& ar, Arena& p) { p = ar.arena(); @@ -213,95 +241,6 @@ inline void save(Archive& ar, const Arena& p) { // No action required } -// Optional is a wrapper for std::optional. There -// are two primary reasons to use this wrapper instead -// of using std::optional directly: -// -// 1) Legacy: A lot of code was written using Optional before -// std::optional was available. -// 2) When you call get but no value is present Optional gives an -// assertion failure. std::optional, on the other hand, would -// throw std::bad_optional_access. It is easier to debug assertion -// failures, and FDB generally does not handle std exceptions, so -// assertion failures are preferable. This is the main reason we -// don't intend to use std::optional directly. -template -class Optional : public ComposedIdentifier { -public: - Optional() = default; - - template - Optional(const U& t) : impl(std::in_place, t) {} - Optional(T&& t) : impl(std::in_place, std::move(t)) {} - - /* This conversion constructor was nice, but combined with the prior constructor it means that Optional can be - converted to Optional> in the wrong way (a non-present Optional converts to a non-present - Optional>). Use .castTo<>() instead. template Optional(const Optional& o) : - valid(o.present()) { if (valid) new (&value) T(o.get()); } */ - - Optional(Arena& a, const Optional& o) { - if (o.present()) - impl = std::make_optional(a, o.get()); - } - int expectedSize() const { return present() ? get().expectedSize() : 0; } - - template - Optional castTo() const { - return map([](const T& v) { return (R)v; }); - } - - template - Optional map(std::function f) const& { - return present() ? Optional(f(get())) : Optional(); - } - template - Optional map(std::function f) && { - return present() ? Optional(f(std::move(*this).get())) : Optional(); - } - - bool present() const { return impl.has_value(); } - T& get() & { - UNSTOPPABLE_ASSERT(impl.has_value()); - return impl.value(); - } - T const& get() const& { - UNSTOPPABLE_ASSERT(impl.has_value()); - return impl.value(); - } - T&& get() && { - UNSTOPPABLE_ASSERT(impl.has_value()); - return std::move(impl.value()); - } - template - T orDefault(U&& defaultValue) const& { - return impl.value_or(std::forward(defaultValue)); - } - template - T orDefault(U&& defaultValue) && { - return std::move(impl).value_or(std::forward(defaultValue)); - } - - // Spaceship operator. Treats not-present as less-than present. - int compare(Optional const& rhs) const { - if (present() == rhs.present()) { - return present() ? get().compare(rhs.get()) : 0; - } - return present() ? 1 : -1; - } - - bool operator==(Optional const& o) const { return impl == o.impl; } - bool operator!=(Optional const& o) const { return !(*this == o); } - // Ordering: If T is ordered, then Optional() < Optional(t) and (Optional(u)> hashFunc{}; - std::optional impl; -}; - template inline void load(Archive& ar, Optional& value) { bool valid; @@ -323,13 +262,6 @@ inline void save(Archive& ar, const Optional& value) { } } -template -struct Traceable> : std::conditional::value, std::true_type, std::false_type>::type { - static std::string toString(const Optional& value) { - return value.present() ? Traceable::toString(value.get()) : "[not set]"; - } -}; - template struct union_like_traits> : std::true_type { using Member = Optional; @@ -363,6 +295,8 @@ class Standalone : private Arena, public T { public: using RefType = T; + constexpr static auto fb_must_appear_last = false; + // T must have no destructor Arena& arena() { return *(Arena*)this; } const Arena& arena() const { return *(const Arena*)this; } @@ -531,7 +465,9 @@ class StringRef { return substr(0, size() - s.size()); } - std::string toString() const { return std::string((const char*)data, length); } + std::string toString() const { return std::string(reinterpret_cast(data), length); } + + std::string_view toStringView() const { return std::string_view(reinterpret_cast(data), length); } static bool isPrintable(char c) { return c > 32 && c < 127; } inline std::string printable() const; @@ -588,14 +524,20 @@ class StringRef { } // Removes bytes from begin up to and including the sep string, returns StringRef of the part before sep - StringRef eat(StringRef sep) { + StringRef eat(StringRef sep, bool* foundSep = nullptr) { for (int i = 0, iend = size() - sep.size(); i <= iend; ++i) { if (sep.compare(substr(i, sep.size())) == 0) { + if (foundSep) { + *foundSep = true; + } StringRef token = substr(0, i); *this = substr(i + sep.size()); return token; } } + if (foundSep) { + *foundSep = false; + } return eat(); } StringRef eat() { @@ -603,7 +545,9 @@ class StringRef { *this = StringRef(); return r; } - StringRef eat(const char* sep) { return eat(StringRef((const uint8_t*)sep, (int)strlen(sep))); } + StringRef eat(const char* sep, bool* foundSep = nullptr) { + return eat(StringRef((const uint8_t*)sep, (int)strlen(sep)), foundSep); + } // Return StringRef of bytes from begin() up to but not including the first byte matching any byte in sep, // and remove that sequence (including the sep byte) from *this // Returns and removes all bytes from *this if no bytes within sep were found @@ -624,9 +568,21 @@ class StringRef { return eatAny(StringRef((const uint8_t*)sep, strlen(sep)), foundSeparator); } + uint8_t back() { + UNSTOPPABLE_ASSERT(!empty()); + return data[length - 1]; + } + + void popBack() { + UNSTOPPABLE_ASSERT(!empty()); + --length; + } + // Copies string contents to dst and returns a pointer to the next byte after uint8_t* copyTo(uint8_t* dst) const { - memcpy(dst, data, length); + if (length > 0) { + memcpy(dst, data, length); + } return dst + length; } @@ -642,20 +598,6 @@ class StringRef { // True if both StringRefs reference exactly the same memory bool same(const StringRef& s) const { return data == s.data && length == s.length; } - // convert a StringRef to Hex string - std::string toHex() const { - std::string result; - result.reserve(length * 2); - for (int i = 0; i < length; i++) { - result.append(format("%02x", data[i])); - } - return result; - } - - std::string getChecksum() const { - return length > 12 ? format("(%d)%08x", length, crc32c_append(0, data, length)) : toString(); - } - private: // Unimplemented; blocks conversion through std::string StringRef(char*); @@ -719,24 +661,21 @@ struct TraceableString { template <> struct Traceable : TraceableStringImpl {}; +template <> +struct fmt::formatter : FormatUsingTraceable {}; + inline std::string StringRef::printable() const { return Traceable::toString(*this); } template -struct Traceable> : std::conditional::value, std::true_type, std::false_type>::type { - static std::string toString(const Standalone& value) { return Traceable::toString(value); } -}; +struct Traceable> : Traceable {}; -namespace literal_string_ref { -template -StringRef LiteralStringRefHelper(const char* str) { - static_assert(std::is_same_v || std::is_same_v, - "Argument to LiteralStringRef must be a literal string"); - return StringRef(reinterpret_cast(str), Size - 1); -} -} // namespace literal_string_ref -#define LiteralStringRef(str) literal_string_ref::LiteralStringRefHelper(str) +template +struct fmt::formatter> : fmt::formatter {}; + +#define __FILE__sr StringRef(reinterpret_cast(__FILE__), sizeof(__FILE__) - 1) +#define __FUNCTION__sr StringRef(reinterpret_cast(__FUNCTION__), sizeof(__FUNCTION__) - 1) inline StringRef operator"" _sr(const char* str, size_t size) { return StringRef(reinterpret_cast(str), size); @@ -818,6 +757,10 @@ inline bool operator==(const StringRef& lhs, const StringRef& rhs) { ASSERT(lhs.size() >= 0); return lhs.size() == rhs.size() && memcmp(lhs.begin(), rhs.begin(), static_cast(lhs.size())) == 0; } +template +inline bool operator==(const StringRef& lhs, const char (&rhs)[N]) { + return lhs == StringRef(reinterpret_cast(rhs), N - 1); +} inline bool operator<(const StringRef& lhs, const StringRef& rhs) { if (std::min(lhs.size(), rhs.size()) > 0) { int c = memcmp(lhs.begin(), rhs.begin(), std::min(lhs.size(), rhs.size())); @@ -844,6 +787,40 @@ inline bool operator>=(const StringRef& lhs, const StringRef& rhs) { return !(lhs < rhs); } +typedef uint64_t Word; +// Get the number of prefix bytes that are the same between a and b, up to their common length of cl +static inline int commonPrefixLength(uint8_t const* ap, uint8_t const* bp, int cl) { + int i = 0; + const int wordEnd = cl - sizeof(Word) + 1; + + for (; i < wordEnd; i += sizeof(Word)) { + Word a = *(Word*)ap; + Word b = *(Word*)bp; + if (a != b) { + return i + ctzll(a ^ b) / 8; + } + ap += sizeof(Word); + bp += sizeof(Word); + } + + for (; i < cl; i++) { + if (*ap != *bp) { + return i; + } + ++ap; + ++bp; + } + return cl; +} + +static inline int commonPrefixLength(const StringRef& a, const StringRef& b) { + return commonPrefixLength(a.begin(), b.begin(), std::min(a.size(), b.size())); +} + +static inline int commonPrefixLength(const StringRef& a, const StringRef& b, int skipLen) { + return commonPrefixLength(a.begin() + skipLen, b.begin() + skipLen, std::min(a.size(), b.size()) - skipLen); +} + // This trait is used by VectorRef to determine if deep copy constructor should recursively // call deep copies of each element. // @@ -1120,7 +1097,7 @@ class VectorRef : public ComposedIdentifier, public VectorRefPreserializer m_size--; } - void pop_front(int count) { + void pop_front(int count = 1) { VPS::invalidate(); count = std::min(m_size, count); diff --git a/src/flow/include/flow/ArenaAllocator.h b/src/flow/include/flow/ArenaAllocator.h new file mode 100644 index 0000000..3d90891 --- /dev/null +++ b/src/flow/include/flow/ArenaAllocator.h @@ -0,0 +1,90 @@ +/* + * ArenaAllocator.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FLOW_ARENA_ALLOCATOR_H +#define FLOW_ARENA_ALLOCATOR_H +#pragma once + +#include "flow/Arena.h" +#include "flow/Error.h" +#include "flow/FastRef.h" +#include +#include +#include + +template +class ArenaAllocator { + Arena* arenaPtr; + + Arena& arena() noexcept { return *arenaPtr; } + +public: + using pointer = T*; + using const_pointer = const T*; + using reference = T&; + using const_reference = const T&; + using void_pointer = void*; + using const_void_pointer = const void*; + using self_type = ArenaAllocator; + using size_type = size_t; + using value_type = T; + using difference_type = typename std::pointer_traits::difference_type; + + // Unfortunately this needs to exist due to STL's internal use of Allocator() in internal coding + ArenaAllocator() noexcept : arenaPtr(nullptr) {} + + ArenaAllocator(Arena& arena) noexcept : arenaPtr(&arena) {} + + ArenaAllocator(const self_type& other) noexcept = default; + + // Rebind constructor does not modify + template + ArenaAllocator(const ArenaAllocator& other) noexcept : arenaPtr(other.arenaPtr) {} + + ArenaAllocator& operator=(const self_type& other) noexcept = default; + + ArenaAllocator(self_type&& other) noexcept = default; + + ArenaAllocator& operator=(self_type&& other) noexcept = default; + + T* allocate(size_t n) { + if (!arenaPtr) + throw bad_allocator(); + return new (arena()) T[n]; + } + + void deallocate(T*, size_t) noexcept {} + + bool operator==(const self_type& other) const noexcept { return arenaPtr == other.arenaPtr; } + + bool operator!=(const self_type& other) const noexcept { return !(*this == other); } + + template + struct rebind { + using other = ArenaAllocator; + }; + + using is_always_equal = std::false_type; + using propagate_on_container_copy_assignment = std::true_type; + using propagate_on_container_move_assignment = std::true_type; + using propagate_on_container_swap = std::true_type; +}; + +#endif /*FLOW_ARENA_ALLOCATOR_H*/ diff --git a/src/fdbrpc/PerfMetric.cpp b/src/flow/include/flow/ArenaString.h similarity index 73% rename from src/fdbrpc/PerfMetric.cpp rename to src/flow/include/flow/ArenaString.h index c3caa10..c2fd2f8 100644 --- a/src/fdbrpc/PerfMetric.cpp +++ b/src/flow/include/flow/ArenaString.h @@ -1,5 +1,5 @@ -#/* - * PerfMetric.cpp +/* + * ArenaString.h * * This source file is part of the FoundationDB open source project * @@ -18,6 +18,13 @@ * limitations under the License. */ -#include "fdbrpc/PerfMetric.h" +#ifndef FLOW_ARENA_STRING_H +#define FLOW_ARENA_STRING_H +#pragma once -FDB_DEFINE_BOOLEAN_PARAM(Averaged); +#include "flow/ArenaAllocator.h" +#include "flow/CustomAllocatorString.h" + +using ArenaString = CustomAllocatorString; + +#endif /*FLOW_ARENA_STRING_H*/ diff --git a/src/flow/ArgParseUtil.h b/src/flow/include/flow/ArgParseUtil.h similarity index 100% rename from src/flow/ArgParseUtil.h rename to src/flow/include/flow/ArgParseUtil.h diff --git a/src/flow/AsioReactor.h b/src/flow/include/flow/AsioReactor.h similarity index 100% rename from src/flow/AsioReactor.h rename to src/flow/include/flow/AsioReactor.h diff --git a/src/flow/include/flow/AutoCPointer.h b/src/flow/include/flow/AutoCPointer.h new file mode 100644 index 0000000..cf28982 --- /dev/null +++ b/src/flow/include/flow/AutoCPointer.h @@ -0,0 +1,55 @@ +/* + * AutoCPointer.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FLOW_AUTO_C_POINTER_H +#define FLOW_AUTO_C_POINTER_H +#include +#include + +/* + * Extend std::unique_ptr to apply scope semantics to C-style pointers with matching free functions + * Also, add implicit conversion to avoid calling get()s when invoking C functions + * + * e.g. EVP_PKEY_new() returns EVP_PKEY*, which needs to be freed by EVP_PKEY_free(): + * AutoCPointer pkey(nullptr, &EVP_PKEY_free); // Null-initialized, won't invoke free + * pkey.reset(EVP_PKEY_new()); // Initialized. Freed when pkey goes out of scope + * ASSERT(!EVP_PKEY_is_a(pkey, "RSA")); // Implicit conversion from AutoCPointer to EVP_PKEY* + * pkey.release(); // Choose not to free (useful e.g. after passing as arg to set0 call, + * transferring ownership) + */ +template +class AutoCPointer : protected std::unique_ptr { + using ParentType = std::unique_ptr; + +public: + using DeleterType = R (*)(T*); + + AutoCPointer(T* ptr, R (*deleter)(T*)) noexcept : ParentType(ptr, deleter) {} + + AutoCPointer(std::nullptr_t, R (*deleter)(T*)) noexcept : ParentType(nullptr, deleter) {} + + using ParentType::operator bool; + using ParentType::release; + using ParentType::reset; + + operator T*() const { return ParentType::get(); } +}; + +#endif // FLOW_AUTO_C_POINTER_H diff --git a/src/flow/BooleanParam.h b/src/flow/include/flow/BooleanParam.h similarity index 51% rename from src/flow/BooleanParam.h rename to src/flow/include/flow/BooleanParam.h index d5491ac..7413c7b 100644 --- a/src/flow/BooleanParam.h +++ b/src/flow/include/flow/BooleanParam.h @@ -20,27 +20,35 @@ #pragma once -#include "flow/Trace.h" +class BooleanParam { + bool value; +public: + explicit constexpr BooleanParam(bool value) : value(value) {} + constexpr operator bool() const { return value; } + constexpr void set(bool value) { this->value = value; } +}; + +// Declares a boolean parametr with the desired name. This declaration can be nested inside of a namespace or another +// class. This macro should not be used directly unless this boolean parameter is going to be defined as a nested class. #define FDB_DECLARE_BOOLEAN_PARAM(ParamName) \ - class ParamName { \ - bool value; \ - \ + class ParamName : public BooleanParam { \ public: \ - explicit constexpr ParamName(bool value) : value(value) {} \ - constexpr operator bool() const { return value; } \ - static ParamName const True, False; \ - constexpr void set(bool value) { this->value = value; } \ - }; \ - template <> \ - struct Traceable : std::true_type { \ - static std::string toString(ParamName const& value) { return Traceable::toString(value); } \ + explicit constexpr ParamName(bool value) : BooleanParam(value) {} \ + static ParamName const True; \ + static ParamName const False; \ } +// Defines the static members True and False of a boolean parameter. +// This macro should not be used directly unless this boolean parameter is going to be defined as a nested class. +// For a nested class, it is necessary to specify the fully qualified name for the boolean param. #define FDB_DEFINE_BOOLEAN_PARAM(ParamName) \ - ParamName const ParamName::True = ParamName(true); \ - ParamName const ParamName::False = ParamName(false) + inline ParamName const ParamName::True = ParamName(true); \ + inline ParamName const ParamName::False = ParamName(false) +// Declares and defines a boolean parameter. Use this macro unless this parameter will be nested inside of another +// class. In that case, declare the boolean parameter inside of the class using FDB_DECLARE_BOOLEAN_PARAM and define it +// outside the class using FDB_DEFINE_BOOLEAN_PARAM with a fully-qualified name. #define FDB_BOOLEAN_PARAM(ParamName) \ FDB_DECLARE_BOOLEAN_PARAM(ParamName); \ FDB_DEFINE_BOOLEAN_PARAM(ParamName) diff --git a/src/flow/include/flow/ChaosMetrics.h b/src/flow/include/flow/ChaosMetrics.h new file mode 100644 index 0000000..7d40976 --- /dev/null +++ b/src/flow/include/flow/ChaosMetrics.h @@ -0,0 +1,79 @@ +/* + * ChaosMetrics.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2023 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. + */ + +#ifndef FLOW_CHAOSMETRICS_H +#define FLOW_CHAOSMETRICS_H + +struct TraceEvent; + +// Chaos Metrics - We periodically log chaosMetrics to make sure that chaos events are happening +// Only includes DiskDelays which encapsulates all type delays and BitFlips for now +// Expand as per need +struct ChaosMetrics { + + ChaosMetrics(); + + void clear(); + unsigned int diskDelays; + unsigned int bitFlips; + double startTime; + + void getFields(TraceEvent* e); +}; + +// This class supports injecting two type of disk failures +// 1. Stalls: Every interval seconds, the disk will stall and no IO will complete for x seconds, where x is a randomly +// chosen interval +// 2. Slowdown: Random slowdown is injected to each disk operation for specified period of time +struct DiskFailureInjector { + static DiskFailureInjector* injector(); + void setDiskFailure(double interval, double stallFor, double throttleFor); + double getStallDelay() const; + double getThrottleDelay() const; + double getDiskDelay() const; + +private: // members + double stallInterval = 0.0; // how often should the disk be stalled (0 meaning once, 10 meaning every 10 secs) + double stallPeriod; // Period of time disk stalls will be injected for + double stallUntil; // End of disk stall period + double stallDuration; // Duration of each stall + double throttlePeriod; // Period of time the disk will be slowed down for + double throttleUntil; // End of disk slowdown period + +private: // construction + DiskFailureInjector() = default; + DiskFailureInjector(DiskFailureInjector const&) = delete; +}; + +struct BitFlipper { + static BitFlipper* flipper(); + double getBitFlipPercentage() { return bitFlipPercentage; } + + void setBitFlipPercentage(double percentage) { bitFlipPercentage = percentage; } + +private: // members + double bitFlipPercentage = 0.0; + +private: // construction + BitFlipper() = default; + BitFlipper(BitFlipper const&) = delete; +}; + +#endif // FLOW_CHAOSMETRICS_H diff --git a/src/flow/include/flow/CodeProbe.h b/src/flow/include/flow/CodeProbe.h new file mode 100644 index 0000000..bc52546 --- /dev/null +++ b/src/flow/include/flow/CodeProbe.h @@ -0,0 +1,339 @@ +/* + * CodeProbe.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FLOW_TESTPROBE_H_ +#define FLOW_TESTPROBE_H_ + +#include "flow/Knobs.h" +#include "flow/Trace.h" + +namespace probe { + +struct ICodeProbe; + +enum class AnnotationType { Decoration, Assertion, Context, Functional }; +enum class ExecutionContext { Simulation, Net2 }; + +namespace context { +struct Net2 { + constexpr static AnnotationType type = AnnotationType::Context; + constexpr static ExecutionContext value = ExecutionContext::Net2; +}; +struct Sim2 { + constexpr static AnnotationType type = AnnotationType::Context; + constexpr static ExecutionContext value = ExecutionContext::Simulation; +}; + +constexpr Net2 net2; +constexpr Sim2 sim2; + +template +struct OrContext { + typename std::remove_const::type left; + typename std::remove_const::type right; + constexpr OrContext(Left left, Right right) : left(left), right(right) {} + constexpr bool operator()(ExecutionContext context) const { return left(context) || right(context); } +}; + +template +constexpr std::enable_if_t> +operator|(Left const& lhs, Right const& rhs) { + return OrContext(lhs, rhs); +} + +} // namespace context + +namespace assert { +struct NoSim { + constexpr static AnnotationType type = AnnotationType::Assertion; + bool operator()(ICodeProbe const* self) const; +}; +struct SimOnly { + constexpr static AnnotationType type = AnnotationType::Assertion; + bool operator()(ICodeProbe const* self) const; +}; + +template +struct AssertOr { + typename std::remove_const::type left; + typename std::remove_const::type right; + constexpr AssertOr() {} + constexpr bool operator()(ICodeProbe* self) const { return left(self) || right(self); } +}; +template +struct AssertAnd { + typename std::remove_const::type left; + typename std::remove_const::type right; + constexpr AssertAnd() {} + constexpr bool operator()(ICodeProbe* self) const { return left(self) && right(self); } +}; +template +struct AssertNot { + typename std::remove_const::type other; + constexpr bool operator()(ICodeProbe* self) const { return !other(self); } +}; + +template +constexpr std::enable_if_t> +operator||(Left const& lhs, Right const& rhs) { + return AssertOr(); +} +template +constexpr std::enable_if_t> +operator&&(Left const& lhs, Right const& rhs) { + return AssertAnd(); +} + +template +constexpr std::enable_if_t> operator!(T const&) { + return AssertNot(); +} + +constexpr SimOnly simOnly; +constexpr NoSim noSim; + +} // namespace assert + +namespace decoration { + +// Code probes that currently (as of 9/25/2022) are not expected to show up in a 250k-test Joshua run +// are marked as "rare." This indicates a testing bug, and these probes should either be removed or testing +// coverage should be improved to hit them. Ideally, then, we should remove uses of this annotation in the +// long-term. However, this annotation has been added to prevent further regressions in code coverage, so that +// we can detect changes that fail to hit non-rare code probes. +// +// This should also hopefully help with debugging, because if a code probe is marked as rare, it means that this +// is a case not likely hit in simulation, and it may be a case that is more prone to buggy behaviour. +struct Rare { + constexpr static AnnotationType type = AnnotationType::Decoration; + void trace(struct ICodeProbe const*, BaseTraceEvent& evt, bool) const { evt.detail("Rare", true); } +}; + +constexpr Rare rare; + +} // namespace decoration + +namespace func { + +struct Deduplicate { + constexpr static AnnotationType type = AnnotationType::Functional; +}; + +constexpr Deduplicate deduplicate; + +} // namespace func + +template +struct CodeProbeAnnotations; + +template <> +struct CodeProbeAnnotations<> { + static constexpr bool providesContext = false; + void hit(ICodeProbe* self) {} + void trace(const ICodeProbe*, BaseTraceEvent&, bool) const {} + constexpr bool expectContext(ExecutionContext context, bool prevHadSomeContext = false) const { + return !prevHadSomeContext; + } + constexpr bool shouldTrace(ICodeProbe const*) const { return true; } + constexpr bool deduplicate() const { return false; } +}; + +template +struct CodeProbeAnnotations { + using HeadType = typename std::remove_const::type; + using ChildType = CodeProbeAnnotations; + + static constexpr bool providesContext = HeadType::type == AnnotationType::Context || ChildType::providesContext; + static_assert(HeadType::type != AnnotationType::Context || !ChildType::providesContext, + "Only one context annotation can be used"); + + HeadType head; + ChildType tail; + + void hit(ICodeProbe* self) { + if constexpr (Head::type == AnnotationType::Assertion) { + ASSERT(head(self)); + } + tail.hit(self); + } + + bool shouldTrace(ICodeProbe const* self) const { + if constexpr (Head::type == AnnotationType::Assertion) { + if (!head(self)) { + return false; + } + } + return tail.shouldTrace(self); + } + + void trace(const ICodeProbe* self, BaseTraceEvent& evt, bool condition) const { + if constexpr (Head::type == AnnotationType::Decoration) { + head.trace(self, evt, condition); + } + tail.trace(self, evt, condition); + } + // This should behave like the following: + // 1. If no context is passed in the code probe, we expect to see this in every context + // 2. Otherwise we will return true iff the execution context we're looking for has been passed to the probe + constexpr bool expectContext(ExecutionContext context, bool prevHadSomeContext = false) const { + if constexpr (HeadType::type == AnnotationType::Context) { + if (HeadType::value == context) { + return true; + } else { + return tail.expectContext(context, true); + } + } else { + return tail.expectContext(context, prevHadSomeContext); + } + } + + constexpr bool deduplicate() const { + if constexpr (std::is_same_v) { + return true; + } else { + return tail.deduplicate(); + } + } +}; + +struct ICodeProbe { + virtual ~ICodeProbe(); + + bool operator==(ICodeProbe const& other) const; + bool operator!=(ICodeProbe const& other) const; + + std::string_view filename() const; + virtual const char* filePath() const = 0; + virtual unsigned line() const = 0; + virtual const char* comment() const = 0; + virtual const char* condition() const = 0; + virtual const char* compilationUnit() const = 0; + virtual void trace(bool) const = 0; + virtual bool shouldTrace() const = 0; + virtual bool wasHit() const = 0; + virtual unsigned hitCount() const = 0; + virtual bool expectInContext(ExecutionContext context) const = 0; + virtual std::string function() const = 0; + virtual bool deduplicate() const = 0; + + static void printProbesXML(); + static void printProbesJSON(std::vector const& ctxs = std::vector()); +}; + +void registerProbe(ICodeProbe const& probe); +std::string functionNameFromInnerType(const char* name); + +template +struct CodeProbeImpl : ICodeProbe { + static CodeProbeImpl* instancePtr() { return &_instance; } + static CodeProbeImpl& instance() { return _instance; } + void hit() { + if (_hitCount++ == 0) { + trace(true); + } + annotations.hit(this); + } + + void trace(bool condition) const override { + TraceEvent evt(intToSeverity(FLOW_KNOBS->CODE_COV_TRACE_EVENT_SEVERITY), "CodeCoverage"); + evt.detail("File", filename()) + .detail("Line", Line) + .detail("Condition", Condition::value()) + .detail("Covered", condition) + .detail("Comment", Comment::value()); + annotations.trace(this, evt, condition); + } + + bool shouldTrace() const override { return annotations.shouldTrace(this); } + + bool wasHit() const override { return _hitCount > 0; } + unsigned hitCount() const override { return _hitCount; } + + const char* filePath() const override { return FileName::value(); } + unsigned line() const override { return Line; } + const char* comment() const override { return Comment::value(); } + const char* condition() const override { return Condition::value(); } + const char* compilationUnit() const override { return CompUnit::value(); } + bool expectInContext(ExecutionContext context) const override { return annotations.expectContext(context); } + std::string function() const override { return functionNameFromInnerType(typeid(FileName).name()); } + bool deduplicate() const override { return annotations.deduplicate(); } + +private: + CodeProbeImpl() { registerProbe(*this); } + inline static CodeProbeImpl _instance; + std::atomic _hitCount = 0; + Annotations annotations; +}; + +template +CodeProbeImpl>& probeInstance( + Annotations&... annotations) { + return CodeProbeImpl>:: + instance(); +} + +} // namespace probe + +#ifdef COMPILATION_UNIT +#define CODE_PROBE_QUOTE(x) #x +#define CODE_PROBE_EXPAND_AND_QUOTE(x) CODE_PROBE_QUOTE(x) +#define CODE_PROBE_COMPILATION_UNIT CODE_PROBE_EXPAND_AND_QUOTE(COMPILATION_UNIT) +#else +#define CODE_PROBE_COMPILATION_UNIT "COMPILATION_UNIT not set" +#endif + +#define _CODE_PROBE_IMPL(file, line, condition, comment, compUnit, fileType, condType, commentType, compUnitType, ...) \ + struct fileType { \ + constexpr static const char* value() { return file; } \ + }; \ + struct condType { \ + constexpr static const char* value() { return #condition; } \ + }; \ + struct commentType { \ + constexpr static const char* value() { return comment; } \ + }; \ + struct compUnitType { \ + constexpr static const char* value() { return compUnit; } \ + }; \ + if (condition) { \ + probe::probeInstance(__VA_ARGS__).hit(); \ + } + +#define _CODE_PROBE_T2(type, counter) type##counter +#define _CODE_PROBE_T(type, counter) _CODE_PROBE_T2(type, counter) + +#define CODE_PROBE(condition, comment, ...) \ + do { \ + _CODE_PROBE_IMPL(__FILE__, \ + __LINE__, \ + condition, \ + comment, \ + CODE_PROBE_COMPILATION_UNIT, \ + _CODE_PROBE_T(FileType, __LINE__), \ + _CODE_PROBE_T(CondType, __LINE__), \ + _CODE_PROBE_T(CommentType, __LINE__), \ + _CODE_PROBE_T(CompilationUnitType, __LINE__), \ + __VA_ARGS__) \ + } while (false) + +#endif // FLOW_TESTPROBE_H_ diff --git a/src/flow/include/flow/CodeProbeUtils.h b/src/flow/include/flow/CodeProbeUtils.h new file mode 100644 index 0000000..07b04dc --- /dev/null +++ b/src/flow/include/flow/CodeProbeUtils.h @@ -0,0 +1,32 @@ +/* + * CodeProbeUtils.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FLOW_CODE_PROBE_UTILS_H +#define FLOW_CODE_PROBE_UTILS_H +#include "flow/CodeProbe.h" +#include "flow/Arena.h" + +namespace probe { + +void traceMissedProbes(Optional context); + +} + +#endif // FLOW_CODE_PROBE_UTILS_H diff --git a/src/flow/CompressedInt.h b/src/flow/include/flow/CompressedInt.h similarity index 100% rename from src/flow/CompressedInt.h rename to src/flow/include/flow/CompressedInt.h diff --git a/src/flow/include/flow/CompressionUtils.h b/src/flow/include/flow/CompressionUtils.h new file mode 100644 index 0000000..807d45c --- /dev/null +++ b/src/flow/include/flow/CompressionUtils.h @@ -0,0 +1,72 @@ +/* + * CompressionUtils.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FLOW_COMPRESSION_UTILS_H +#define FLOW_COMPRESSION_UTILS_H +#pragma once + +#include "flow/Arena.h" + +#include + +enum class CompressionFilter { + NONE, + ZSTD, + LAST // Always the last member +}; + +struct CompressionUtils { + static StringRef compress(const CompressionFilter filter, const StringRef& data, Arena& arena); + static StringRef compress(const CompressionFilter filter, const StringRef& data, int level, Arena& arena); + static StringRef decompress(const CompressionFilter filter, const StringRef& data, Arena& arena); + + static int getDefaultCompressionLevel(CompressionFilter filter); + static CompressionFilter getRandomFilter(); + + static CompressionFilter fromFilterString(const std::string& filter) { + if (filter == "NONE") { + return CompressionFilter::NONE; + } else if (filter == "ZSTD") { + return CompressionFilter::ZSTD; + } else { + throw not_implemented(); + } + } + + static std::string toString(const CompressionFilter filter) { + if (filter == CompressionFilter::NONE) { + return "NONE"; + } else if (filter == CompressionFilter::ZSTD) { + return "ZSTD"; + } else { + throw not_implemented(); + } + } + + static void checkFilterSupported(const CompressionFilter filter) { + if (CompressionUtils::supportedFilters.find(filter) == CompressionUtils::supportedFilters.end()) { + throw not_implemented(); + } + } + + static std::unordered_set supportedFilters; +}; + +#endif // FLOW_COMPRRESSION_UTILS_H diff --git a/src/flow/include/flow/CustomAllocatorString.h b/src/flow/include/flow/CustomAllocatorString.h new file mode 100644 index 0000000..3b8249d --- /dev/null +++ b/src/flow/include/flow/CustomAllocatorString.h @@ -0,0 +1,30 @@ +/* + * CustomAllocatorString.h + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2013-2022 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. + */ + +#ifndef FLOW_CUSTOM_ALLOCATOR_STRING_H +#define FLOW_CUSTOM_ALLOCATOR_STRING_H +#pragma once + +#include + +template